GithubHelp home page GithubHelp logo

aruberto / react-foundation-components Goto Github PK

View Code? Open in Web Editor NEW
62.0 5.0 19.0 1.71 MB

Foundation Sites 6 components implemented in React with CSS Modules!

Home Page: http://aruberto.github.io/react-foundation-components

License: MIT License

JavaScript 93.18% CSS 6.82%

react-foundation-components's Introduction

react-foundation-components

Foundation Sites 6 components implemented in React and compatible with CSS Modules!

Why?

I like React. I like CSS Modules. I like Foundation Sites. This is an experiment to see if it's possible to combine all these tools in a modular way!

Installation

npm install --save react-foundation-components

Each component uses local scoped CSS by requiring the subset of the Foundation stylesheets it needs.

Documentation (in progress) or demos of the components are available at http://aruberto.github.io/react-foundation-components. Please look at https://github.com/aruberto/react-foundation-components/tree/master/docs for an example webpack setup and example use of each component.

You can also look at https://github.com/aruberto/react-foundation-components/tree/master/examples/css-modules as an example project that uses CSS Modules with this library.

If you want to use CSS modules and customize Foundation at the same time, look at https://github.com/aruberto/react-foundation-components/tree/master/examples/css-modules-custom which uses https://www.npmjs.com/package/jsontosass-loader to inject sass variables that override Foundation's default settings.

Recommend importing on a per component basis instead of importing the main entry point of package. Importing main entry point will cause final bundle to include all CSS and JS whereas importing on a per component basis will cause your final bundle to only include the CSS and JS you actually need (this may change when tree shaking is introduced in webpack 2)!

Favor

import Button from 'react-foundation-components/lib/button';
import { ShowForScreenSize, HideForScreenSize } from 'react-foundation-components/lib/visibility';

over

import { Button, ShowForScreenSize, HideForScreenSize } from 'react-foundation-components';

If you can't use CSS Modules, a set of components that use Foundation's global scoped class names are also provided. These are located under react-foundation-components/lib/global. To import Button that uses global scoped class names:

import Button from 'react-foundation-components/lib/global/button';
import { ShowForScreenSize, HideForScreenSize } from 'react-foundation-components/lib/global/visibility';

If you use the components under react-foundation-components/lib/global, you are responsible for loading Foundation CSS stylesheet. You can do this in a few ways:

Here are some example applications that use global scoped class name components:

Thanks

A lot of the components are inspired by React Bootstrap and this project even makes heavy use their utility libraries like react-overlays, dom-helpers, prop-types-extra and uncontrollable. So big thanks to all these project's contributers for all their amazing work!

react-foundation-components's People

Contributors

aruberto avatar gl2748 avatar jthiard avatar yantakus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-foundation-components's Issues

NPM audit HIGH vulnerability in dependencies

High: Cross-Site Scripting (XSS)
Package: jquery
Patched in: >=3.0.0
Dependency of: react-foundation-components
Path: react-foundation-components > foundation-sites > jquery
More info: https://npmjs.com/advisories/328

Slider

Skipped this in the controls section since it seems like the most complex component in the entire suite. Currently don't have a need for it, so deferring it for now. This may be good research material.

Tob Bar Input Modifiers

Figure out what these are used for and if possible to handle this scenario in modular way. These CSS rules break modularity, may not be possible to support this.

  .input-group-field {
    width: 100%;
    margin-#{$global-right}: 0;
  }

  // scss-lint:disable QualifyingElement
  input.button {
    width: auto;
  }

Size of search input incorrect

I am trying out the tob-bar example/documentation.

When I do this, I get a topbar that looks like this:

http://i.stack.imgur.com/XSiWW.png

On the foundation example site: http://foundation.zurb.com/sites/docs/top-bar.html
there is a notable difference: The size of the search input.

So some css is missing, and I think it is this, taken from the example sites css:

[type='text'], [type='password'], [type='date'], [type='datetime'], [type='datetime-local'], [type='month'], [type='week'], [type='email'], [type='number'], [type='search'], [type='tel'], [type='time'], [type='url'], [type='color'], textarea {
    display: block;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    height: 2.4375rem;
    padding: 0.5rem;
    border: 1px solid #cacaca;
    margin: 0 0 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: #0a0a0a;
    background-color: #fefefe;
    -webkit-box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
    box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
    border-radius: 0;
    -webkit-transition: -webkit-box-shadow 0.5s, border-color 0.25s ease-in-out;
    transition: box-shadow 0.5s, border-color 0.25s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
}

Why is this not included, what do I have to do?

Foundation Default Mixins are not changeable

I want to change the form-input-error mixin to get a custom background-lighten value. I've tried to add both, "background-lighten": "1" and
"form-input-error": { "background": "blue", "background-lighten": "1" }
to the theme.json, as provided in the example at css-modules-custom, but no changes where shown. A simple "input-background-invalid": "blue", does change the border color, but results in a default 10% background-color for the input field.

Is it possible to change the background-lighten value?

Issue with global styles

lib/global/visibility/index.js

var _createWrapperComponent = require('../util/create-wrapper-component');

should be

var _createWrapperComponent = require('../../util/create-wrapper-component');

Unknown Prop warnings in React 15.2

@aruberto getting warnings about props being passed into a div.
<div horizontalAlignment={} />
Seems like a behavior caused by createWrapperComponent when using the flex grid.

Please advise.

[Reveal] overlay prop should accept 'static' as value

This jsx code

<Reveal onHide={() => this.setState({show: false})} show={this.state.show} overlay="static">
  <p>Content</p>
</Reveal>

Raises a warning in React 15.0.1:

Warning: Failed prop type: Invalid prop `overlay` of type `string` supplied to `Reveal`, expected `boolean`.

The Reveal overlay prop value is passed to the backdrop prop of the underlying Modal component from react-overlays. This backdrop prop accepts boolean values and the string 'static'.
See react-overlay Modal propTypes

This special 'static' value is used when a click on the overlay should not close the modal (same as a {closeOnClick: false} option in the reveal foundation plugin)

Customizable SASS

Provide a mechanism to be able to tweak Foundation SASS settings and/or provide custom styling.

Babel + Webpack Integration

Hello,

First of all, awesome work you've done, but i'm trying to integrate your components with react-starter-kit and i'm getting the following error:

/Users/<user>/Projects/<project>/node_modules/react-foundation-components/lib/top-bar/_styles.scss:1
(function (exports, require, module, __filename, __dirname) { @import '../common';
                                                              ^
SyntaxError: Invalid or unexpected token

Documentation

Convert the demo app into a doc site since demo app contains example of pretty much every use case would want in docs. Need a getting started page explaining how to setup webpack. Ideally try to include inline editing as well.

How to include main own scss in css-modules-custom example

I want to add my own scss files to the css-modules-custom-example project. But I am getting this error when adding a scss file:

ERROR in Loader <project-dir>/node_modules/jsontosass/jsontosass.js?path=<project-sir>/src/theme.json didn't return a function

So how do I included my own sass files?

Support react 16

We are using uncontrollable package as dependency. It has some issues with react 16, its batching version uses deprecated react-dom/lib/ReactUpdates. Can we switch to the non-batching version which works in all versions of react? For more details see this issue: jquense/uncontrollable#19

Unit Tests

All components should have some sort of unit test.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.