├── src ├── styles │ ├── mixins.css │ ├── variable.css │ └── variable.scss ├── components │ ├── tab │ │ ├── index.js │ │ ├── TabItem.js │ │ └── Tab.js │ ├── select │ │ ├── index.js │ │ ├── Option.js │ │ ├── Picker.js │ │ └── Select.js │ ├── flexbox │ │ ├── index.js │ │ ├── FlexboxItem.js │ │ └── Flexbox.js │ ├── radio │ │ ├── index.js │ │ ├── RadioGroup.js │ │ └── Radio.js │ ├── swiper │ │ ├── index.js │ │ ├── SwiperItem.js │ │ └── Swiper.js │ ├── tabbar │ │ ├── index.js │ │ ├── TabbarItem.js │ │ └── Tabbar.js │ ├── checker │ │ ├── index.js │ │ ├── Checker.js │ │ └── CheckerGroup.js │ ├── marquee │ │ ├── index.js │ │ ├── MarqueeItem.js │ │ └── Marquee.js │ ├── sidebar │ │ ├── index.js │ │ ├── SidebarItem.js │ │ └── Sidebar.js │ ├── checkbox │ │ ├── index.js │ │ ├── CheckboxGroup.js │ │ └── Checkbox.js │ ├── accordion │ │ ├── index.js │ │ ├── Accordion.js │ │ └── AccordionItem.js │ ├── button-tab │ │ ├── index.js │ │ ├── ButtonTabItem.js │ │ └── ButtonTab.js │ ├── actionsheet │ │ ├── index.js │ │ ├── ActionsheetItem.js │ │ └── Actionsheet.js │ ├── alert │ │ └── index.js │ ├── icon │ │ └── index.js │ ├── divider │ │ └── index.js │ ├── body │ │ └── index.js │ ├── message │ │ └── index.js │ ├── group │ │ └── index.js │ ├── badge │ │ └── index.js │ ├── spinner │ │ └── index.js │ ├── overlay │ │ └── index.js │ ├── cell │ │ └── index.js │ ├── layout │ │ └── index.js │ ├── qrcode │ │ └── index.js │ ├── AsyncComponent.js │ ├── rater │ │ └── index.js │ ├── switch │ │ └── index.js │ ├── button │ │ └── index.js │ ├── arrow │ │ └── index.js │ ├── nav │ │ └── index.js │ ├── ConnectComponent.js │ ├── password │ │ └── index.js │ ├── prompt │ │ └── index.js │ ├── remtopx │ │ └── index.js │ ├── popover │ │ └── index.js │ ├── input │ │ └── index.js │ ├── textarea │ │ └── index.js │ ├── input-number │ │ └── index.js │ ├── ripple │ │ └── index.js │ ├── preview │ │ └── index.js │ ├── toast │ │ └── index.js │ ├── sticky │ │ └── index.js │ ├── popup-picker │ │ └── index.js │ └── img │ │ └── index.js ├── store │ ├── root │ │ ├── action.js │ │ └── reducer.js │ ├── todo │ │ ├── action.js │ │ └── reducer.js │ └── index.js ├── index.css ├── index.scss ├── App.scss ├── App.css ├── App.test.js ├── views │ ├── Qrcode.js │ ├── Group.js │ ├── Nav.js │ ├── Message.js │ ├── Divider.js │ ├── Password.js │ ├── Spinner.js │ ├── InputNumber.js │ ├── Input.js │ ├── Ripple.js │ ├── Marquee.js │ ├── Textarea.js │ ├── IndexList.js │ ├── Cell.js │ ├── Badge.js │ ├── Sidebar.js │ ├── Alert.js │ ├── Flexbox.js │ ├── Tabbar.js │ ├── ButtonTab.js │ ├── Rater.js │ ├── Switch.js │ ├── Picker.js │ ├── Swiper.js │ ├── Range.js │ ├── Tab.js │ ├── Radio.js │ ├── Popover.js │ ├── Accordion.js │ ├── Button.js │ ├── Layout.js │ ├── Preview.js │ ├── Sticky.js │ ├── Img.js │ ├── Checker.js │ ├── Swipeout.js │ ├── Confirm.js │ ├── Prompt.js │ ├── Checkbox.js │ ├── Actionsheet.js │ ├── ListView.js │ ├── Popup.js │ ├── Toast.js │ ├── Select.js │ └── Home.js ├── devtools │ └── index.js ├── App.js ├── index.js ├── logo.svg └── registerServiceWorker.js ├── public ├── robots.txt ├── favicon.ico ├── images │ ├── code.png │ ├── logo.png │ └── github.png ├── manifest.json └── index.html ├── .gitignore ├── config ├── jest │ ├── cssTransform.js │ └── fileTransform.js ├── pnpTs.js ├── paths.js ├── env.js └── modules.js ├── scripts └── test.js ├── components.json ├── README.md └── package.json /src/styles/mixins.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/variable.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunfeihuang/react-components/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunfeihuang/react-components/HEAD/public/images/code.png -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunfeihuang/react-components/HEAD/public/images/logo.png -------------------------------------------------------------------------------- /public/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunfeihuang/react-components/HEAD/public/images/github.png -------------------------------------------------------------------------------- /src/components/tab/index.js: -------------------------------------------------------------------------------- 1 | import Tab from './Tab'; 2 | import TabItem from './TabItem'; 3 | 4 | export { 5 | Tab, 6 | TabItem 7 | } 8 | -------------------------------------------------------------------------------- /src/store/root/action.js: -------------------------------------------------------------------------------- 1 | export default { 2 | action (data) { 3 | return { 4 | type: 'ADD_TODO', 5 | data 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/select/index.js: -------------------------------------------------------------------------------- 1 | import Select from './Select'; 2 | import Option from './Option'; 3 | 4 | export { 5 | Select, 6 | Option 7 | } 8 | -------------------------------------------------------------------------------- /src/components/flexbox/index.js: -------------------------------------------------------------------------------- 1 | import Flexbox from './Flexbox' 2 | import FlexboxItem from './FlexboxItem' 3 | export { 4 | Flexbox, 5 | FlexboxItem 6 | } -------------------------------------------------------------------------------- /src/components/radio/index.js: -------------------------------------------------------------------------------- 1 | import Radio from './Radio'; 2 | import RadioGroup from './RadioGroup'; 3 | 4 | export { 5 | Radio, 6 | RadioGroup 7 | } 8 | -------------------------------------------------------------------------------- /src/components/swiper/index.js: -------------------------------------------------------------------------------- 1 | import Swiper from './Swiper'; 2 | import SwiperItem from './SwiperItem'; 3 | 4 | export { 5 | Swiper, 6 | SwiperItem 7 | } 8 | -------------------------------------------------------------------------------- /src/components/tabbar/index.js: -------------------------------------------------------------------------------- 1 | import Tabbar from './Tabbar'; 2 | import TabbarItem from './TabbarItem'; 3 | 4 | export { 5 | Tabbar, 6 | TabbarItem 7 | } 8 | -------------------------------------------------------------------------------- /src/components/checker/index.js: -------------------------------------------------------------------------------- 1 | import Checker from './Checker'; 2 | import CheckerGroup from './CheckerGroup'; 3 | 4 | export { 5 | Checker, 6 | CheckerGroup 7 | } 8 | -------------------------------------------------------------------------------- /src/components/marquee/index.js: -------------------------------------------------------------------------------- 1 | import Marquee from './Marquee'; 2 | import MarqueeItem from './MarqueeItem'; 3 | 4 | export { 5 | Marquee, 6 | MarqueeItem 7 | } 8 | -------------------------------------------------------------------------------- /src/components/sidebar/index.js: -------------------------------------------------------------------------------- 1 | import Sidebar from './Sidebar'; 2 | import SidebarItem from './SidebarItem'; 3 | 4 | export { 5 | Sidebar, 6 | SidebarItem 7 | } 8 | -------------------------------------------------------------------------------- /src/components/checkbox/index.js: -------------------------------------------------------------------------------- 1 | import Checkbox from './Checkbox'; 2 | import CheckboxGroup from './CheckboxGroup'; 3 | 4 | export { 5 | Checkbox, 6 | CheckboxGroup 7 | } 8 | -------------------------------------------------------------------------------- /src/components/accordion/index.js: -------------------------------------------------------------------------------- 1 | import Accordion from './Accordion'; 2 | import AccordionItem from './AccordionItem'; 3 | 4 | export { 5 | Accordion, 6 | AccordionItem 7 | } 8 | -------------------------------------------------------------------------------- /src/components/button-tab/index.js: -------------------------------------------------------------------------------- 1 | import ButtonTab from './ButtonTab'; 2 | import ButtonTabItem from './ButtonTabItem'; 3 | 4 | export { 5 | ButtonTab, 6 | ButtonTabItem 7 | } 8 | -------------------------------------------------------------------------------- /src/components/actionsheet/index.js: -------------------------------------------------------------------------------- 1 | import Actionsheet from './Actionsheet'; 2 | import ActionsheetItem from './ActionsheetItem'; 3 | 4 | export { 5 | Actionsheet, 6 | ActionsheetItem 7 | } 8 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | background: #f7f7f7; } 6 | 7 | a { 8 | color: inherit; 9 | text-decoration: none; } 10 | -------------------------------------------------------------------------------- /src/index.scss: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | background:#f7f7f7; 6 | } 7 | a{ 8 | color:inherit; 9 | text-decoration:none; 10 | } 11 | -------------------------------------------------------------------------------- /src/store/root/reducer.js: -------------------------------------------------------------------------------- 1 | export let initialState = { 2 | global: {id: 'fdsafds'} 3 | } 4 | 5 | let reducer = { 6 | global (state = {}, action) { 7 | return state 8 | } 9 | } 10 | 11 | export default reducer -------------------------------------------------------------------------------- /src/App.scss: -------------------------------------------------------------------------------- 1 | .flexbox-demo{ 2 | padding:10px; 3 | overflow:hidden; 4 | background: #fff; 5 | .vx-flexbox--item{ 6 | background:#eee; 7 | border-radius:6px; 8 | text-align:center; 9 | line-height:0.8rem; 10 | } 11 | } -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .flexbox-demo { 2 | padding: 10px; 3 | overflow: hidden; 4 | background: #fff; } 5 | .flexbox-demo .vx-flexbox--item { 6 | background: #eee; 7 | border-radius: 6px; 8 | text-align: center; 9 | line-height: 0.8rem; } 10 | -------------------------------------------------------------------------------- /src/components/alert/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Confirm from '../confirm'; 3 | 4 | let Alert = props => { 5 | let {children, ...others} = props 6 | return ( 7 | {children} 8 | ) 9 | } 10 | 11 | export default Alert; 12 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /src/components/icon/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import classnames from 'classnames' 3 | 4 | const Icon = props => { 5 | const { className, ...others } = props 6 | return ( 7 | 9 | 10 | ) 11 | } 12 | 13 | export default Icon 14 | -------------------------------------------------------------------------------- /src/components/select/Option.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | 3 | const Option = props => { 4 | return null 5 | } 6 | Option.propsTypes = { 7 | value: PropTypes.String, 8 | disabled: PropTypes.bool, 9 | label: PropTypes.String 10 | } 11 | Option.defaultProps = { 12 | disabled: false 13 | } 14 | export default Option; 15 | -------------------------------------------------------------------------------- /src/store/todo/action.js: -------------------------------------------------------------------------------- 1 | export default { 2 | add (data) { 3 | return dispatch => { 4 | setTimeout(() => { 5 | dispatch({ 6 | type: 'TODO_ADD', 7 | data 8 | }) 9 | }) 10 | } 11 | /* 12 | return { 13 | type: 'TODO_ADD', 14 | data 15 | } 16 | */ 17 | } 18 | } -------------------------------------------------------------------------------- /src/store/todo/reducer.js: -------------------------------------------------------------------------------- 1 | let initialState = { 2 | counter: 0 3 | } 4 | 5 | const todo = (state = initialState, action) => { 6 | switch (action.type) { 7 | case 'TODO_ADD': 8 | state.counter++ 9 | return { 10 | ...state 11 | } 12 | default: 13 | return state 14 | } 15 | } 16 | 17 | export default todo; 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /src/components/divider/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import classnames from 'classnames' 3 | 4 | const Divider = props => { 5 | const { children, className, ...others } = props 6 | return ( 7 |
10 | {children} 11 |
12 | ) 13 | } 14 | 15 | export default Divider 16 | -------------------------------------------------------------------------------- /config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/en/webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/swiper/SwiperItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import classnames from 'classnames'; 3 | 4 | const SwiperItem = props => { 5 | let {children, className, ...others} = props 6 | return ( 7 |
8 | {children} 9 |
10 | ); 11 | } 12 | 13 | export default SwiperItem; 14 | -------------------------------------------------------------------------------- /src/components/marquee/MarqueeItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import classnames from 'classnames'; 3 | 4 | const MarqueeItem = props => { 5 | let {children, className, ...others} = props 6 | return ( 7 |
8 | {children} 9 |
10 | ); 11 | } 12 | 13 | export default MarqueeItem; 14 | -------------------------------------------------------------------------------- /src/components/body/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import classnames from 'classnames' 3 | import { FlexboxItem } from '../flexbox' 4 | 5 | const Body = props => { 6 | const { children, className, ...others } = props 7 | return ( 8 | 9 | {children} 10 | 11 | ) 12 | } 13 | 14 | export default Body 15 | -------------------------------------------------------------------------------- /src/components/message/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import classnames from 'classnames' 3 | 4 | const Message = props => { 5 | const { children, className, type, ...others } = props 6 | return ( 7 |
10 | {children} 11 |
12 | ) 13 | } 14 | Message.defaultProps = { 15 | type: 'warning' 16 | } 17 | 18 | export default Message 19 | -------------------------------------------------------------------------------- /src/views/Qrcode.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Layout, Body, Nav, Qrcode } from '@/components' 3 | 4 | class Demo extends React.Component { 5 | render() { 6 | return ( 7 | 8 |