From 372fd0215101e7959ea3a5097fe254f10827f156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Mon, 31 Oct 2016 17:25:58 +0000 Subject: [PATCH] incomplete + {children} + + + ); }; -Select.propTypes = {}; +Select.propTypes = { + autoFocus: React.PropTypes.bool, + children: React.PropTypes.node, + className: React.PropTypes.string, + disabled: React.PropTypes.bool, + form: React.PropTypes.string, + id: React.PropTypes.string, + label: React.PropTypes.string, + multiple: React.PropTypes.bool, + name: React.PropTypes.string, + required: React.PropTypes.bool, + selected: React.PropTypes.bool +}; module.exports = Select; diff --git a/ui/src/components/select/readme.md b/ui/src/components/select/readme.md index 9dfe3fd8..78684710 100644 --- a/ui/src/components/select/readme.md +++ b/ui/src/components/select/readme.md @@ -1 +1,60 @@ # Select + + +## demo + +```embed +const React = require('react'); +const ReactDOM = require('react-dom/server'); +const Base = require('../base'); +const Container = require('../container'); +const Row = require('../row'); +const Column = require('../column'); +const Select = require('./index.js'); + +nmodule.exports = ReactDOM.renderToString( + + + + + + + + + + + + +); +``` + +## usage + +```js +const React = require('react'); +const Select = require('ui/select'); + +module.exports = () => { + return ( + + ); +} +``` diff --git a/ui/src/components/select/style.css b/ui/src/components/select/style.css index e69de29b..04e441d6 100644 --- a/ui/src/components/select/style.css +++ b/ui/src/components/select/style.css @@ -0,0 +1,25 @@ +.select { + composes: input from '../input/style.css'; + + &[multiple] { + padding-left: 0; + padding-right: 0; + + & :global option { + padding-left: 15px; + padding-right: 15px; + width: 100%; + } + +/* this doesn't seem to work, research further + &:-internal-list-box :global option:checked, + & :global option:checked { + background-color: white; + } +*/ + } +} + +.label { + composes: label from '../input/style.css'; +} \ No newline at end of file diff --git a/ui/src/docs.js b/ui/src/docs.js index be156257..0a8d004a 100644 --- a/ui/src/docs.js +++ b/ui/src/docs.js @@ -12,6 +12,7 @@ module.exports = { Input: require('./components/input/readme.md'), Radio: require('./components/radio/readme.md'), 'Radio Group': require('./components/radio-group/readme.md'), + Select: require('./components/select/readme.md'), Column: require('./components/column/readme.md'), Button: require('./components/button/readme.md'), 'Range Slider': require('./components/range-slider/readme.md'), diff --git a/ui/src/index.js b/ui/src/index.js index 0f7f21f9..7fa21642 100644 --- a/ui/src/index.js +++ b/ui/src/index.js @@ -13,5 +13,6 @@ module.exports = { 'Range Slider': require('./components/range-slider/'), Radio: require('./components/radio'), RadioGroup: require('./components/radio-group'), + Select: require('./components/select'), Widget: require('./components/widget') };