react-miui 0.20.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/components/form/Select.d.ts +1 -5
- package/dist/components/form/Select.d.ts.map +1 -1
- package/dist/components/form/Select.js +2 -23
- package/dist/components/form/Select.js.map +1 -1
- package/dist/components/form/Select.stories.d.ts +8 -0
- package/dist/components/form/Select.stories.d.ts.map +1 -0
- package/dist/components/form/Select.stories.js +26 -0
- package/dist/components/form/Select.stories.js.map +1 -0
- package/dist/components/{layout/list/Value.styled.d.ts → form/Select.styled.d.ts} +20 -12
- package/dist/components/form/Select.styled.d.ts.map +1 -0
- package/dist/components/form/Select.styled.js +24 -0
- package/dist/components/form/Select.styled.js.map +1 -0
- package/dist/components/form/input/Input.css.d.ts +16 -16
- package/dist/components/form/input/Input.css.d.ts.map +1 -1
- package/dist/components/form/input/Input.css.js.map +1 -1
- package/dist/components/form/input/Input.styled.d.ts +68 -36
- package/dist/components/form/input/Input.styled.d.ts.map +1 -1
- package/dist/components/form/textarea/TextArea.styled.d.ts +17 -9
- package/dist/components/form/textarea/TextArea.styled.d.ts.map +1 -1
- package/dist/components/icons/Icon.js +1 -2
- package/dist/components/icons/Icon.js.map +1 -1
- package/dist/components/layout/list/Header.d.ts +174 -7
- package/dist/components/layout/list/Header.d.ts.map +1 -1
- package/dist/components/layout/list/Header.js +36 -11
- package/dist/components/layout/list/Header.js.map +1 -1
- package/dist/components/layout/list/Header.stories.d.ts +8 -0
- package/dist/components/layout/list/Header.stories.d.ts.map +1 -0
- package/dist/components/layout/list/Header.stories.js +33 -0
- package/dist/components/layout/list/Header.stories.js.map +1 -0
- package/dist/components/layout/list/Item.d.ts +88 -7
- package/dist/components/layout/list/Item.d.ts.map +1 -1
- package/dist/components/layout/list/Item.js +66 -33
- package/dist/components/layout/list/Item.js.map +1 -1
- package/dist/components/layout/list/Item.stories.d.ts +10 -0
- package/dist/components/layout/list/Item.stories.d.ts.map +1 -0
- package/dist/components/layout/list/Item.stories.js +65 -0
- package/dist/components/layout/list/Item.stories.js.map +1 -0
- package/dist/components/layout/list/Label.d.ts +83 -5
- package/dist/components/layout/list/Label.d.ts.map +1 -1
- package/dist/components/layout/list/Label.js +24 -6
- package/dist/components/layout/list/Label.js.map +1 -1
- package/dist/components/layout/list/Label.stories.d.ts +8 -0
- package/dist/components/layout/list/Label.stories.d.ts.map +1 -0
- package/dist/components/layout/list/Label.stories.js +35 -0
- package/dist/components/layout/list/Label.stories.js.map +1 -0
- package/dist/components/layout/list/List.d.ts +86 -7
- package/dist/components/layout/list/List.d.ts.map +1 -1
- package/dist/components/layout/list/List.js +15 -9
- package/dist/components/layout/list/List.js.map +1 -1
- package/dist/components/layout/list/List.stories.d.ts +9 -0
- package/dist/components/layout/list/List.stories.d.ts.map +1 -0
- package/dist/components/layout/list/List.stories.js +53 -0
- package/dist/components/layout/list/List.stories.js.map +1 -0
- package/dist/components/layout/list/Value.d.ts +81 -1
- package/dist/components/layout/list/Value.d.ts.map +1 -1
- package/dist/components/layout/list/Value.js +9 -2
- package/dist/components/layout/list/Value.js.map +1 -1
- package/dist/components/layout/list/Value.stories.d.ts +8 -0
- package/dist/components/layout/list/Value.stories.d.ts.map +1 -0
- package/dist/components/layout/list/Value.stories.js +29 -0
- package/dist/components/layout/list/Value.stories.js.map +1 -0
- package/dist/components/layout/section/Section.d.ts +83 -8
- package/dist/components/layout/section/Section.d.ts.map +1 -1
- package/dist/components/layout/section/Section.js +17 -15
- package/dist/components/layout/section/Section.js.map +1 -1
- package/dist/components/layout/section/Section.stories.d.ts +8 -0
- package/dist/components/layout/section/Section.stories.d.ts.map +1 -0
- package/dist/components/layout/section/Section.stories.js +37 -0
- package/dist/components/layout/section/Section.stories.js.map +1 -0
- package/dist/components/layout/section/SectionContainer.d.ts +80 -5
- package/dist/components/layout/section/SectionContainer.d.ts.map +1 -1
- package/dist/components/layout/section/SectionContainer.js +9 -8
- package/dist/components/layout/section/SectionContainer.js.map +1 -1
- package/dist/components/ui/button/Button.d.ts +1 -7
- package/dist/components/ui/button/Button.d.ts.map +1 -1
- package/dist/components/ui/button/Button.js +2 -28
- package/dist/components/ui/button/Button.js.map +1 -1
- package/dist/components/ui/button/Button.stories.d.ts +9 -0
- package/dist/components/ui/button/Button.stories.d.ts.map +1 -0
- package/dist/components/ui/button/Button.stories.js +62 -0
- package/dist/components/ui/button/Button.stories.js.map +1 -0
- package/dist/components/ui/button/Button.styled.d.ts +85 -0
- package/dist/components/ui/button/Button.styled.d.ts.map +1 -0
- package/dist/components/ui/button/Button.styled.js +38 -0
- package/dist/components/ui/button/Button.styled.js.map +1 -0
- package/dist/components/ui/message/Message.d.ts +17 -9
- package/dist/components/ui/message/Message.d.ts.map +1 -1
- package/dist/components/ui/message/Message.styled.d.ts +17 -9
- package/dist/components/ui/message/Message.styled.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.d.ts +6 -4
- package/dist/components/ui/modal/Modal.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.js +30 -21
- package/dist/components/ui/modal/Modal.js.map +1 -1
- package/dist/components/ui/modal/Modal.stories.d.ts +10 -0
- package/dist/components/ui/modal/Modal.stories.d.ts.map +1 -0
- package/dist/components/ui/modal/Modal.stories.js +112 -0
- package/dist/components/ui/modal/Modal.stories.js.map +1 -0
- package/dist/components/ui/modal/Modal.styled.d.ts +329 -0
- package/dist/components/ui/modal/Modal.styled.d.ts.map +1 -0
- package/dist/components/ui/modal/Modal.styled.js +90 -0
- package/dist/components/ui/modal/Modal.styled.js.map +1 -0
- package/dist/components/ui/modal/ModalButtons.d.ts +1 -11
- package/dist/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.js +2 -12
- package/dist/components/ui/modal/ModalButtons.js.map +1 -1
- package/dist/components/ui/modal/ModalButtons.stories.d.ts +8 -0
- package/dist/components/ui/modal/ModalButtons.stories.d.ts.map +1 -0
- package/dist/components/ui/modal/ModalButtons.stories.js +25 -0
- package/dist/components/ui/modal/ModalButtons.stories.js.map +1 -0
- package/dist/components/ui/modal/ModalButtons.styled.d.ts +166 -0
- package/dist/components/ui/modal/ModalButtons.styled.d.ts.map +1 -0
- package/dist/components/ui/modal/ModalButtons.styled.js +42 -0
- package/dist/components/ui/modal/ModalButtons.styled.js.map +1 -0
- package/dist/components/ui/pop/Pop.module.scss +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +125 -69
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +2 -0
- package/dist/theme.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Drawer.html +14 -17
- package/docs/classes/Pop.html +14 -17
- package/docs/classes/ToasterProvider.html +10 -13
- package/docs/enums/ICON.html +14 -17
- package/docs/functions/Action.html +6 -10
- package/docs/functions/Button.html +44 -15
- package/docs/functions/Card.html +6 -10
- package/docs/functions/Checkbox.html +6 -10
- package/docs/functions/Choice.html +7 -11
- package/docs/functions/CoveringLoader.html +6 -10
- package/docs/functions/DirectionPad.html +6 -10
- package/docs/functions/EqualActions.html +6 -10
- package/docs/functions/FullLoader.html +6 -10
- package/docs/functions/HandleEsc.html +6 -10
- package/docs/functions/Header.html +6 -10
- package/docs/functions/HeaderIconAction.html +6 -10
- package/docs/functions/Icon-1.html +6 -10
- package/docs/functions/If.html +6 -10
- package/docs/functions/Input.html +7 -11
- package/docs/functions/KeyValue.html +6 -10
- package/docs/functions/Label.html +6 -10
- package/docs/functions/List-1.html +18 -12
- package/docs/functions/Loader.html +6 -10
- package/docs/functions/Loading.html +6 -10
- package/docs/functions/Message.html +6 -10
- package/docs/functions/Modal-1.html +6 -10
- package/docs/functions/ModalButtons.html +135 -0
- package/docs/functions/PopLoader.html +6 -10
- package/docs/functions/PopOption.html +6 -10
- package/docs/functions/SearchContainer.html +6 -10
- package/docs/functions/Section.html +145 -0
- package/docs/functions/Select.html +40 -15
- package/docs/functions/Selector.html +7 -11
- package/docs/functions/Spacer.html +6 -10
- package/docs/functions/Stats.html +6 -10
- package/docs/functions/StickyHeader-1.html +6 -10
- package/docs/functions/StickyHeader.Content.html +5 -8
- package/docs/functions/Table.html +6 -10
- package/docs/functions/TextArea.html +6 -10
- package/docs/functions/Toggle.html +6 -10
- package/docs/functions/getCssText.html +6 -10
- package/docs/functions/styled.html +6 -10
- package/docs/functions/useToaster.html +7 -11
- package/docs/index.html +6 -10
- package/docs/modules/List.html +10 -10
- package/docs/modules/Modal.html +8 -11
- package/docs/modules/StickyHeader.html +6 -9
- package/docs/modules.html +9 -17
- package/docs/pages/tutorials/Test.html +6 -10
- package/docs/types/ThemeCSS.html +7 -11
- package/docs/variables/List.Header.html +8 -10
- package/docs/variables/List.Item.html +53 -0
- package/docs/variables/{ModalButtons.Button.html → Modal.RemovePadding.html} +11 -14
- package/docs/variables/cssReset.html +7 -11
- package/docs/variables/miuiScrollbars.html +7 -11
- package/esm/components/form/Select.d.ts +1 -5
- package/esm/components/form/Select.d.ts.map +1 -1
- package/esm/components/form/Select.js +1 -8
- package/esm/components/form/Select.js.map +1 -1
- package/esm/components/form/Select.stories.d.ts +8 -0
- package/esm/components/form/Select.stories.d.ts.map +1 -0
- package/esm/components/form/Select.stories.js +20 -0
- package/esm/components/form/Select.stories.js.map +1 -0
- package/esm/components/{layout/list/Value.styled.d.ts → form/Select.styled.d.ts} +20 -12
- package/esm/components/form/Select.styled.d.ts.map +1 -0
- package/esm/components/form/Select.styled.js +21 -0
- package/esm/components/form/Select.styled.js.map +1 -0
- package/esm/components/form/input/Input.css.d.ts +16 -16
- package/esm/components/form/input/Input.css.d.ts.map +1 -1
- package/esm/components/form/input/Input.css.js.map +1 -1
- package/esm/components/form/input/Input.styled.d.ts +68 -36
- package/esm/components/form/input/Input.styled.d.ts.map +1 -1
- package/esm/components/form/textarea/TextArea.styled.d.ts +17 -9
- package/esm/components/form/textarea/TextArea.styled.d.ts.map +1 -1
- package/esm/components/layout/list/Header.d.ts +174 -7
- package/esm/components/layout/list/Header.d.ts.map +1 -1
- package/esm/components/layout/list/Header.js +24 -11
- package/esm/components/layout/list/Header.js.map +1 -1
- package/esm/components/layout/list/Header.stories.d.ts +8 -0
- package/esm/components/layout/list/Header.stories.d.ts.map +1 -0
- package/esm/components/layout/list/Header.stories.js +27 -0
- package/esm/components/layout/list/Header.stories.js.map +1 -0
- package/esm/components/layout/list/Item.d.ts +88 -7
- package/esm/components/layout/list/Item.d.ts.map +1 -1
- package/esm/components/layout/list/Item.js +64 -33
- package/esm/components/layout/list/Item.js.map +1 -1
- package/esm/components/layout/list/Item.stories.d.ts +10 -0
- package/esm/components/layout/list/Item.stories.d.ts.map +1 -0
- package/esm/components/layout/list/Item.stories.js +57 -0
- package/esm/components/layout/list/Item.stories.js.map +1 -0
- package/esm/components/layout/list/Label.d.ts +83 -5
- package/esm/components/layout/list/Label.d.ts.map +1 -1
- package/esm/components/layout/list/Label.js +12 -6
- package/esm/components/layout/list/Label.js.map +1 -1
- package/esm/components/layout/list/Label.stories.d.ts +8 -0
- package/esm/components/layout/list/Label.stories.d.ts.map +1 -0
- package/esm/components/layout/list/Label.stories.js +29 -0
- package/esm/components/layout/list/Label.stories.js.map +1 -0
- package/esm/components/layout/list/List.d.ts +86 -7
- package/esm/components/layout/list/List.d.ts.map +1 -1
- package/esm/components/layout/list/List.js +15 -9
- package/esm/components/layout/list/List.js.map +1 -1
- package/esm/components/layout/list/List.stories.d.ts +9 -0
- package/esm/components/layout/list/List.stories.d.ts.map +1 -0
- package/esm/components/layout/list/List.stories.js +46 -0
- package/esm/components/layout/list/List.stories.js.map +1 -0
- package/esm/components/layout/list/Value.d.ts +81 -1
- package/esm/components/layout/list/Value.d.ts.map +1 -1
- package/esm/components/layout/list/Value.js +9 -1
- package/esm/components/layout/list/Value.js.map +1 -1
- package/esm/components/layout/list/Value.stories.d.ts +8 -0
- package/esm/components/layout/list/Value.stories.d.ts.map +1 -0
- package/esm/components/layout/list/Value.stories.js +23 -0
- package/esm/components/layout/list/Value.stories.js.map +1 -0
- package/esm/components/layout/section/Section.d.ts +83 -8
- package/esm/components/layout/section/Section.d.ts.map +1 -1
- package/esm/components/layout/section/Section.js +17 -12
- package/esm/components/layout/section/Section.js.map +1 -1
- package/esm/components/layout/section/Section.stories.d.ts +8 -0
- package/esm/components/layout/section/Section.stories.d.ts.map +1 -0
- package/esm/components/layout/section/Section.stories.js +31 -0
- package/esm/components/layout/section/Section.stories.js.map +1 -0
- package/esm/components/layout/section/SectionContainer.d.ts +80 -5
- package/esm/components/layout/section/SectionContainer.d.ts.map +1 -1
- package/esm/components/layout/section/SectionContainer.js +9 -5
- package/esm/components/layout/section/SectionContainer.js.map +1 -1
- package/esm/components/ui/button/Button.d.ts +1 -7
- package/esm/components/ui/button/Button.d.ts.map +1 -1
- package/esm/components/ui/button/Button.js +1 -13
- package/esm/components/ui/button/Button.js.map +1 -1
- package/esm/components/ui/button/Button.stories.d.ts +9 -0
- package/esm/components/ui/button/Button.stories.d.ts.map +1 -0
- package/esm/components/ui/button/Button.stories.js +35 -0
- package/esm/components/ui/button/Button.stories.js.map +1 -0
- package/esm/components/ui/button/Button.styled.d.ts +85 -0
- package/esm/components/ui/button/Button.styled.d.ts.map +1 -0
- package/esm/components/ui/button/Button.styled.js +35 -0
- package/esm/components/ui/button/Button.styled.js.map +1 -0
- package/esm/components/ui/message/Message.d.ts +17 -9
- package/esm/components/ui/message/Message.d.ts.map +1 -1
- package/esm/components/ui/message/Message.styled.d.ts +17 -9
- package/esm/components/ui/message/Message.styled.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.d.ts +6 -4
- package/esm/components/ui/modal/Modal.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.js +30 -18
- package/esm/components/ui/modal/Modal.js.map +1 -1
- package/esm/components/ui/modal/Modal.stories.d.ts +10 -0
- package/esm/components/ui/modal/Modal.stories.d.ts.map +1 -0
- package/esm/components/ui/modal/Modal.stories.js +84 -0
- package/esm/components/ui/modal/Modal.stories.js.map +1 -0
- package/esm/components/ui/modal/Modal.styled.d.ts +329 -0
- package/esm/components/ui/modal/Modal.styled.d.ts.map +1 -0
- package/esm/components/ui/modal/Modal.styled.js +83 -0
- package/esm/components/ui/modal/Modal.styled.js.map +1 -0
- package/esm/components/ui/modal/ModalButtons.d.ts +1 -11
- package/esm/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.js +1 -9
- package/esm/components/ui/modal/ModalButtons.js.map +1 -1
- package/esm/components/ui/modal/ModalButtons.stories.d.ts +8 -0
- package/esm/components/ui/modal/ModalButtons.stories.d.ts.map +1 -0
- package/esm/components/ui/modal/ModalButtons.stories.js +19 -0
- package/esm/components/ui/modal/ModalButtons.stories.js.map +1 -0
- package/esm/components/ui/modal/ModalButtons.styled.d.ts +166 -0
- package/esm/components/ui/modal/ModalButtons.styled.d.ts.map +1 -0
- package/esm/components/ui/modal/ModalButtons.styled.js +39 -0
- package/esm/components/ui/modal/ModalButtons.styled.js.map +1 -0
- package/esm/components/ui/pop/Pop.module.scss +1 -0
- package/esm/index.d.ts +0 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +0 -1
- package/esm/index.js.map +1 -1
- package/esm/theme.d.ts +125 -69
- package/esm/theme.d.ts.map +1 -1
- package/esm/theme.js +2 -0
- package/esm/theme.js.map +1 -1
- package/package.json +8 -7
- package/src/components/form/Select.stories.tsx +30 -0
- package/src/components/form/Select.styled.ts +25 -0
- package/src/components/form/Select.tsx +1 -22
- package/src/components/form/input/Input.css.ts +5 -3
- package/src/components/layout/list/Header.stories.tsx +40 -0
- package/src/components/layout/list/Header.tsx +43 -26
- package/src/components/layout/list/Item.stories.tsx +69 -0
- package/src/components/layout/list/Item.tsx +118 -46
- package/src/components/layout/list/Label.stories.tsx +45 -0
- package/src/components/layout/list/Label.tsx +21 -12
- package/src/components/layout/list/List.stories.tsx +84 -0
- package/src/components/layout/list/List.tsx +34 -23
- package/src/components/layout/list/Value.stories.tsx +37 -0
- package/src/components/layout/list/Value.tsx +15 -1
- package/src/components/layout/section/Section.stories.tsx +54 -0
- package/src/components/layout/section/Section.tsx +27 -27
- package/src/components/layout/section/SectionContainer.tsx +10 -13
- package/src/components/ui/button/Button.stories.tsx +55 -0
- package/src/components/ui/button/Button.styled.ts +43 -0
- package/src/components/ui/button/Button.tsx +1 -35
- package/src/components/ui/modal/Modal.stories.tsx +143 -0
- package/src/components/ui/modal/Modal.styled.ts +100 -0
- package/src/components/ui/modal/Modal.tsx +49 -26
- package/src/components/ui/modal/ModalButtons.stories.tsx +40 -0
- package/src/components/ui/modal/ModalButtons.styled.ts +51 -0
- package/src/components/ui/modal/ModalButtons.tsx +1 -22
- package/src/components/ui/pop/Pop.module.scss +1 -0
- package/src/demo/components/form/Choice.tsx +3 -3
- package/src/demo/components/form/Form.tsx +1 -1
- package/src/demo/components/form/Search.tsx +3 -1
- package/src/demo/components/form/Toggle.tsx +3 -1
- package/src/demo/components/layout/card/Card.tsx +3 -3
- package/src/demo/components/ui/icons/Icons.tsx +3 -1
- package/src/demo/components/ui/keyValue/KeyValue.tsx +1 -1
- package/src/demo/components/ui/pop/Pop.tsx +1 -1
- package/src/demo/componentsMap.ts +0 -77
- package/src/index.ts +0 -1
- package/src/pages/_app.tsx +2 -0
- package/src/theme.ts +5 -3
- package/dist/components/form/Select.module.scss +0 -18
- package/dist/components/layout/list/Header.module.scss +0 -8
- package/dist/components/layout/list/Item.module.scss +0 -46
- package/dist/components/layout/list/Label.module.scss +0 -9
- package/dist/components/layout/list/List.module.scss +0 -8
- package/dist/components/layout/list/Value.styled.d.ts.map +0 -1
- package/dist/components/layout/list/Value.styled.js +0 -13
- package/dist/components/layout/list/Value.styled.js.map +0 -1
- package/dist/components/layout/section/Section.module.scss +0 -24
- package/dist/components/layout/section/SectionContainer.module.scss +0 -4
- package/dist/components/ui/button/Button.module.scss +0 -25
- package/dist/components/ui/modal/Modal.module.scss +0 -92
- package/dist/components/ui/modal/ModalButtons.module.scss +0 -32
- package/dist/components/ui/modal/ModalNoMargin.d.ts +0 -7
- package/dist/components/ui/modal/ModalNoMargin.d.ts.map +0 -1
- package/dist/components/ui/modal/ModalNoMargin.js +0 -22
- package/dist/components/ui/modal/ModalNoMargin.js.map +0 -1
- package/docs/functions/Item-1.html +0 -110
- package/docs/functions/ModalButtons-1.html +0 -110
- package/docs/functions/Section-1.html +0 -110
- package/docs/modules/Item.html +0 -64
- package/docs/modules/ModalButtons.html +0 -61
- package/docs/modules/Section.html +0 -61
- package/docs/variables/Item.Label.html +0 -56
- package/docs/variables/Item.Value.html +0 -56
- package/docs/variables/Modal.NegateMargin.html +0 -55
- package/docs/variables/Section.Container.html +0 -55
- package/esm/components/form/Select.module.scss +0 -18
- package/esm/components/layout/list/Header.module.scss +0 -8
- package/esm/components/layout/list/Item.module.scss +0 -46
- package/esm/components/layout/list/Label.module.scss +0 -9
- package/esm/components/layout/list/List.module.scss +0 -8
- package/esm/components/layout/list/Value.styled.d.ts.map +0 -1
- package/esm/components/layout/list/Value.styled.js +0 -10
- package/esm/components/layout/list/Value.styled.js.map +0 -1
- package/esm/components/layout/section/Section.module.scss +0 -24
- package/esm/components/layout/section/SectionContainer.module.scss +0 -4
- package/esm/components/ui/button/Button.module.scss +0 -25
- package/esm/components/ui/modal/Modal.module.scss +0 -92
- package/esm/components/ui/modal/ModalButtons.module.scss +0 -32
- package/esm/components/ui/modal/ModalNoMargin.d.ts +0 -7
- package/esm/components/ui/modal/ModalNoMargin.d.ts.map +0 -1
- package/esm/components/ui/modal/ModalNoMargin.js +0 -16
- package/esm/components/ui/modal/ModalNoMargin.js.map +0 -1
- package/src/components/form/Select.module.scss +0 -18
- package/src/components/layout/list/Header.module.scss +0 -8
- package/src/components/layout/list/Item.module.scss +0 -46
- package/src/components/layout/list/Label.module.scss +0 -9
- package/src/components/layout/list/List.module.scss +0 -8
- package/src/components/layout/list/Value.styled.ts +0 -13
- package/src/components/layout/section/Section.module.scss +0 -24
- package/src/components/layout/section/SectionContainer.module.scss +0 -4
- package/src/components/ui/button/Button.module.scss +0 -25
- package/src/components/ui/modal/Modal.module.scss +0 -92
- package/src/components/ui/modal/ModalButtons.module.scss +0 -32
- package/src/components/ui/modal/ModalNoMargin.tsx +0 -25
- package/src/demo/components/form/Input.tsx +0 -28
- package/src/demo/components/form/Select.tsx +0 -26
- package/src/demo/components/layout/list/Header.tsx +0 -23
- package/src/demo/components/layout/list/Inset.tsx +0 -23
- package/src/demo/components/layout/list/ItemRatio.tsx +0 -20
- package/src/demo/components/layout/list/Label.tsx +0 -31
- package/src/demo/components/layout/list/List.Item.module.scss +0 -7
- package/src/demo/components/layout/list/List.Item.tsx +0 -24
- package/src/demo/components/layout/list/Selection.tsx +0 -16
- package/src/demo/components/layout/list/Value.module.scss +0 -4
- package/src/demo/components/layout/list/Value.tsx +0 -25
- package/src/demo/components/layout/section/Section.tsx +0 -33
- package/src/demo/components/ui/button/ButtonDemo.tsx +0 -23
- package/src/demo/components/ui/message/Message.tsx +0 -27
- package/src/demo/components/ui/modal/Modal.tsx +0 -104
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { Icon, ICON } from "../../icons/Icon.js";
|
|
6
|
+
|
|
7
|
+
import { List } from "./List.js";
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: "Components/Layout/List/List",
|
|
11
|
+
component: List,
|
|
12
|
+
tags: ["autodocs", "layout"],
|
|
13
|
+
argTypes: {
|
|
14
|
+
inset: {
|
|
15
|
+
type: "boolean",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof List>;
|
|
21
|
+
|
|
22
|
+
const Primary: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
inset: false,
|
|
25
|
+
},
|
|
26
|
+
render: (args) => {
|
|
27
|
+
return (
|
|
28
|
+
<List {...args}>
|
|
29
|
+
<List.Item>I am a list item</List.Item>
|
|
30
|
+
<List.Item>I am a list item</List.Item>
|
|
31
|
+
</List>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const FullFeaturedExample: Story = {
|
|
37
|
+
render: (args) => {
|
|
38
|
+
return (
|
|
39
|
+
<List>
|
|
40
|
+
<List.Header>GPS settings</List.Header>
|
|
41
|
+
<List.Item>
|
|
42
|
+
<List.Item.Label sub={"Higher precision means higher battery usage"}>
|
|
43
|
+
GPS precision
|
|
44
|
+
</List.Item.Label>
|
|
45
|
+
<List.Item.Value>
|
|
46
|
+
Low
|
|
47
|
+
</List.Item.Value>
|
|
48
|
+
<Icon name={ICON.forward} />
|
|
49
|
+
</List.Item>
|
|
50
|
+
<List.Item>
|
|
51
|
+
<List.Item>
|
|
52
|
+
Something
|
|
53
|
+
</List.Item>
|
|
54
|
+
</List.Item>
|
|
55
|
+
<List.Header>
|
|
56
|
+
Last trips
|
|
57
|
+
</List.Header>
|
|
58
|
+
<List.Item>
|
|
59
|
+
Portugal
|
|
60
|
+
</List.Item>
|
|
61
|
+
<List.Item>
|
|
62
|
+
<List.Item.Label sub={"Visited 2 times in last year"}>
|
|
63
|
+
Poland
|
|
64
|
+
</List.Item.Label>
|
|
65
|
+
</List.Item>
|
|
66
|
+
<List.Item>
|
|
67
|
+
Sweden
|
|
68
|
+
</List.Item>
|
|
69
|
+
<List.Header>
|
|
70
|
+
Choose one option
|
|
71
|
+
</List.Header>
|
|
72
|
+
<List.Item selected={true}>yes</List.Item>
|
|
73
|
+
<List.Item selected={false}>no</List.Item>
|
|
74
|
+
</List>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
Primary,
|
|
81
|
+
FullFeaturedExample,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default meta;
|
|
@@ -1,47 +1,58 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { makeVariants } from "../../../utils/index.js";
|
|
3
|
+
import { pxToRem, styled } from "../../../theme.js";
|
|
6
4
|
|
|
7
5
|
import { Header } from "./Header.js";
|
|
8
6
|
import { Item } from "./Item.js";
|
|
9
|
-
import styles from "./List.module.scss";
|
|
10
|
-
|
|
11
|
-
type Variant = "inset";
|
|
12
|
-
|
|
13
|
-
interface Props {
|
|
14
|
-
className?: string;
|
|
15
|
-
variant?: Variant | Variant[];
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
}
|
|
18
7
|
|
|
19
8
|
interface SubComponents {
|
|
20
9
|
Header: typeof Header;
|
|
10
|
+
Item: typeof Item;
|
|
21
11
|
}
|
|
22
12
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
const StyledList = styled("ul", {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
15
|
+
margin: `0 ${pxToRem(23)}`,
|
|
16
|
+
padding: 0,
|
|
17
|
+
|
|
18
|
+
variants: {
|
|
19
|
+
inset: {
|
|
20
|
+
true: {
|
|
21
|
+
margin: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
type StyledListProps = React.ComponentProps<typeof StyledList>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Component for rendering menu lists.
|
|
31
|
+
*
|
|
32
|
+
* It has two subcomponents:
|
|
33
|
+
* - `Item`: for rendering list items
|
|
34
|
+
* - `Header`: for rendering list headers
|
|
35
|
+
*
|
|
36
|
+
* List has one variant: `inset`, which removes the margin from the list. If used it will be automatically applied to
|
|
37
|
+
* all children.
|
|
38
|
+
*
|
|
39
|
+
* See `Item` and `Header` for more information about their usage.
|
|
40
|
+
*/
|
|
41
|
+
const List: React.FC<StyledListProps> & SubComponents = (props) => {
|
|
26
42
|
const chld = React.Children.map(props.children, (child) => {
|
|
27
43
|
if (child && typeof child === "object" && "type" in child && (child.type === Item || child.type === Header)) {
|
|
28
44
|
return React.cloneElement(child, {
|
|
29
|
-
|
|
30
|
-
variant: props.variant,
|
|
45
|
+
inset: props.inset,
|
|
31
46
|
});
|
|
32
47
|
}
|
|
33
48
|
return child;
|
|
34
49
|
});
|
|
35
50
|
|
|
36
|
-
const cls = classnames(props.className, styles.list, {
|
|
37
|
-
[styles.inset]: v.includes("inset"),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
51
|
return (
|
|
41
|
-
<
|
|
52
|
+
<StyledList {...props}>{chld}</StyledList>
|
|
42
53
|
);
|
|
43
54
|
};
|
|
44
|
-
|
|
45
55
|
List.Header = Header;
|
|
56
|
+
List.Item = Item;
|
|
46
57
|
|
|
47
58
|
export { List };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { Value } from "./Value.js";
|
|
6
|
+
import { List } from "./List.js";
|
|
7
|
+
import { Item } from "./Item.js";
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: "Components/Layout/List/Value",
|
|
11
|
+
component: Value,
|
|
12
|
+
tags: ["autodocs", "layout"],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Value>;
|
|
16
|
+
|
|
17
|
+
const Primary: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
children: "23,4*C",
|
|
20
|
+
},
|
|
21
|
+
render: (args) => {
|
|
22
|
+
return (
|
|
23
|
+
<List>
|
|
24
|
+
<Item>
|
|
25
|
+
<div>Some label</div>
|
|
26
|
+
<Value {...args} />
|
|
27
|
+
</Item>
|
|
28
|
+
</List>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Primary,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default meta;
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { fontPxToRem, styled } from "../../../theme.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Use this to render a value within `Item`. It's most useful when used with `Item.Label`.
|
|
5
|
+
*/
|
|
6
|
+
const Value = styled("div", {
|
|
7
|
+
color: "$icon",
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
9
|
+
fontSize: fontPxToRem(26),
|
|
10
|
+
display: "flex",
|
|
11
|
+
justifyContent: "flex-end",
|
|
12
|
+
flex: 1,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { Value };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { List } from "../list/List.js";
|
|
6
|
+
import { Item } from "../list/Item.js";
|
|
7
|
+
|
|
8
|
+
import { Section } from "./Section.js";
|
|
9
|
+
|
|
10
|
+
const meta: Meta = {
|
|
11
|
+
title: "Components/Layout/Section",
|
|
12
|
+
component: Section,
|
|
13
|
+
tags: ["autodocs", "layout"],
|
|
14
|
+
argTypes: {
|
|
15
|
+
vertical: {
|
|
16
|
+
type: "boolean",
|
|
17
|
+
},
|
|
18
|
+
horizontal: {
|
|
19
|
+
type: "boolean",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type Story = StoryObj<typeof Section>;
|
|
25
|
+
|
|
26
|
+
const Primary: Story = {
|
|
27
|
+
args: {},
|
|
28
|
+
render: (args) => (
|
|
29
|
+
<div style={{ border: "1px solid #ddd" }}>
|
|
30
|
+
<Section.Container>
|
|
31
|
+
<Section {...args}>
|
|
32
|
+
This is an example section, arguments in the arguments table are applied only to this
|
|
33
|
+
section. By default sections do not have any padding, so you can place elements that should touch
|
|
34
|
+
the edges. Use `vertical` and `horizontal` arguments to add padding.
|
|
35
|
+
</Section>
|
|
36
|
+
<Section vertical={true} horizontal={true}>
|
|
37
|
+
Some section
|
|
38
|
+
</Section>
|
|
39
|
+
<Section>
|
|
40
|
+
<List>
|
|
41
|
+
<Item>Some item</Item>
|
|
42
|
+
<Item>Some item</Item>
|
|
43
|
+
</List>
|
|
44
|
+
</Section>
|
|
45
|
+
</Section.Container>
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
Primary,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import classnames from "classnames";
|
|
4
|
-
|
|
5
|
-
import { makeVariants } from "../../../utils/makeVariants.js";
|
|
1
|
+
import { pxToRem, styled } from "../../../theme.js";
|
|
6
2
|
|
|
7
3
|
import { SectionContainer } from "./SectionContainer.js";
|
|
8
|
-
import styles from "./Section.module.scss";
|
|
9
4
|
|
|
10
5
|
interface SubComponents {
|
|
11
6
|
Container: typeof SectionContainer;
|
|
12
7
|
}
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
const SectionCmp = styled("div", {
|
|
10
|
+
background: "$background",
|
|
11
|
+
|
|
12
|
+
variants: {
|
|
13
|
+
vertical: {
|
|
14
|
+
true: {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
16
|
+
py: pxToRem(23),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
horizontal: {
|
|
20
|
+
true: {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
22
|
+
px: pxToRem(23),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A section is a container that can be used to group related content.
|
|
30
|
+
*
|
|
31
|
+
* You should use it along with the `Section.Container` component. Container stretches to fill the available space and
|
|
32
|
+
* has darker background color, sections are lighter and have a gap between them.
|
|
33
|
+
*/
|
|
34
|
+
const Section = SectionCmp as typeof SectionCmp & SubComponents;
|
|
35
35
|
|
|
36
36
|
Section.Container = SectionContainer;
|
|
37
37
|
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<div className={styles.container}>{props.children}</div>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
1
|
+
import { styled } from "../../../theme.js";
|
|
2
|
+
|
|
3
|
+
const SectionContainer = styled("div", {
|
|
4
|
+
background: "$toolbarBg",
|
|
5
|
+
flex: 1,
|
|
6
|
+
height: "100%",
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
gap: 23,
|
|
10
|
+
});
|
|
14
11
|
|
|
15
12
|
export { SectionContainer };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
|
|
3
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { styled } from "../../../theme.js";
|
|
6
|
+
|
|
7
|
+
import { Button } from "./Button.js";
|
|
8
|
+
|
|
9
|
+
// TODO better docs
|
|
10
|
+
|
|
11
|
+
const meta: Meta = {
|
|
12
|
+
title: "Components/UI/Button",
|
|
13
|
+
component: Button,
|
|
14
|
+
tags: ["autodocs", "ui"],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof Button>;
|
|
18
|
+
|
|
19
|
+
const Primary: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
children: "Click me",
|
|
22
|
+
onClick: () => { alert("Clicked"); },
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Container = styled("div", {
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
alignItems: "flex-start",
|
|
30
|
+
gap: "1rem",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const MultipleAtOnce: Story = {
|
|
34
|
+
render: () => {
|
|
35
|
+
const handleClick = useCallback(() => {
|
|
36
|
+
alert("Clicked");
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Container>
|
|
41
|
+
<Button onClick={handleClick}>Basic button</Button>
|
|
42
|
+
<Button disabled={true} onClick={handleClick}>Disabled button</Button>
|
|
43
|
+
<Button inline={true} onClick={handleClick}>Inline button</Button>
|
|
44
|
+
<Button outline={true} onClick={handleClick}>Outline button</Button>
|
|
45
|
+
</Container>
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
Primary,
|
|
52
|
+
MultipleAtOnce,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default meta;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { borderPxToRem, dimensionsPxToRem, fontPxToRem, pxToRem, styled } from "../../../theme.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Call-to-action button.
|
|
5
|
+
*/
|
|
6
|
+
const Button = styled("button", {
|
|
7
|
+
"height": dimensionsPxToRem(118),
|
|
8
|
+
"background": "$green1",
|
|
9
|
+
"border": `${borderPxToRem(1)} solid $green1Darker`,
|
|
10
|
+
"color": "white",
|
|
11
|
+
"borderRadius": "1000px",
|
|
12
|
+
"display": "flex",
|
|
13
|
+
"alignItems": "center",
|
|
14
|
+
"justifyContent": "center",
|
|
15
|
+
"width": "100%",
|
|
16
|
+
"fontSize": fontPxToRem(26),
|
|
17
|
+
"padding": "0 1em",
|
|
18
|
+
"gap": pxToRem(10),
|
|
19
|
+
|
|
20
|
+
"&:disabled": {
|
|
21
|
+
opacity: 0.5,
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"variants": {
|
|
25
|
+
inline: {
|
|
26
|
+
true: {
|
|
27
|
+
width: "auto",
|
|
28
|
+
display: "inline-flex",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
outline: {
|
|
32
|
+
true: {
|
|
33
|
+
background: "white",
|
|
34
|
+
borderColor: "$buttonBorder",
|
|
35
|
+
color: "$grey1",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
Button,
|
|
43
|
+
};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import classnames from "classnames";
|
|
4
|
-
|
|
5
|
-
import { makeVariants } from "../../../utils/index.js";
|
|
6
|
-
|
|
7
|
-
import styles from "./Button.module.scss";
|
|
8
|
-
|
|
9
|
-
type Variant = "inline" | "outline";
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
variant?: Variant | Variant[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & Props> = ({
|
|
16
|
-
className, children, variant, ...props
|
|
17
|
-
}) => {
|
|
18
|
-
const variants = makeVariants(variant);
|
|
19
|
-
|
|
20
|
-
const cls = classnames(styles.btn, {
|
|
21
|
-
[styles["btn--inline"]]: variants.includes("inline"),
|
|
22
|
-
[styles["btn--outline"]]: variants.includes("outline"),
|
|
23
|
-
}, className);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<button
|
|
27
|
-
{...props}
|
|
28
|
-
className={cls}
|
|
29
|
-
disabled={props.disabled}
|
|
30
|
-
>{children}
|
|
31
|
-
</button>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export { Button };
|
|
1
|
+
export { Button } from "./Button.styled.js";
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { Button } from "../button/Button.js";
|
|
6
|
+
import { Label } from "../../form/Label.js";
|
|
7
|
+
import { Input } from "../../form/input/Input.js";
|
|
8
|
+
import { Checkbox } from "../../form/Checkbox.js";
|
|
9
|
+
import { List } from "../../layout/list/List.js";
|
|
10
|
+
|
|
11
|
+
import { Modal } from "./Modal.js";
|
|
12
|
+
import { ModalButtons } from "./ModalButtons.js";
|
|
13
|
+
import { RemovePadding } from "./Modal.styled";
|
|
14
|
+
|
|
15
|
+
const meta: Meta = {
|
|
16
|
+
title: "Components/UI/Modal",
|
|
17
|
+
component: Modal,
|
|
18
|
+
tags: ["autodocs", "ui"],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof Modal>;
|
|
22
|
+
|
|
23
|
+
const handleNoop = () => undefined;
|
|
24
|
+
|
|
25
|
+
const Primary: Story = {
|
|
26
|
+
args: {},
|
|
27
|
+
render: () => {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
29
|
+
const [open, setIsOpen] = useState(false);
|
|
30
|
+
|
|
31
|
+
const handleClose = useCallback(() => {
|
|
32
|
+
setIsOpen(false);
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
const handleOpen = useCallback(() => {
|
|
36
|
+
setIsOpen(true);
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<Button onClick={handleOpen}>Open modal</Button>
|
|
42
|
+
<Modal onClose={handleClose} isOpen={open} title={"95.5 MHz"} position={"bottom"} full={true}>
|
|
43
|
+
<Label>
|
|
44
|
+
<Input placeholder={"New station"} />
|
|
45
|
+
</Label>
|
|
46
|
+
<Label>
|
|
47
|
+
<Checkbox name={""} onChange={handleNoop} checked={true}>
|
|
48
|
+
Remember me
|
|
49
|
+
</Checkbox>
|
|
50
|
+
</Label>
|
|
51
|
+
<ModalButtons>
|
|
52
|
+
<ModalButtons.Button onClick={handleClose}>
|
|
53
|
+
Cancel
|
|
54
|
+
</ModalButtons.Button>
|
|
55
|
+
<ModalButtons.Button variant={"main"} onClick={handleClose}>
|
|
56
|
+
Ok
|
|
57
|
+
</ModalButtons.Button>
|
|
58
|
+
</ModalButtons>
|
|
59
|
+
</Modal>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const WithRemovedPaddingSections: Story = {
|
|
66
|
+
args: {},
|
|
67
|
+
render: () => {
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
69
|
+
const [open, setIsOpen] = useState(false);
|
|
70
|
+
|
|
71
|
+
const handleClose = useCallback(() => {
|
|
72
|
+
setIsOpen(false);
|
|
73
|
+
}, []);
|
|
74
|
+
|
|
75
|
+
const handleOpen = useCallback(() => {
|
|
76
|
+
setIsOpen(true);
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div>
|
|
81
|
+
<Button onClick={handleOpen}>Open modal</Button>
|
|
82
|
+
<Modal onClose={handleClose} isOpen={open} position={"bottom"} full={true}>
|
|
83
|
+
<RemovePadding>
|
|
84
|
+
<Label>
|
|
85
|
+
<Input placeholder={"New station"} />
|
|
86
|
+
</Label>
|
|
87
|
+
</RemovePadding>
|
|
88
|
+
<Label>
|
|
89
|
+
<Input placeholder={"New station"} />
|
|
90
|
+
</Label>
|
|
91
|
+
<RemovePadding>
|
|
92
|
+
<Label>
|
|
93
|
+
<Input placeholder={"New station"} />
|
|
94
|
+
</Label>
|
|
95
|
+
</RemovePadding>
|
|
96
|
+
</Modal>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Just a demo how to render a pick-mode list in a modal.
|
|
104
|
+
*/
|
|
105
|
+
const WithList: Story = {
|
|
106
|
+
args: {},
|
|
107
|
+
render: () => {
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
109
|
+
const [open, setIsOpen] = useState(false);
|
|
110
|
+
|
|
111
|
+
const handleClose = useCallback(() => {
|
|
112
|
+
setIsOpen(false);
|
|
113
|
+
}, []);
|
|
114
|
+
|
|
115
|
+
const handleOpen = useCallback(() => {
|
|
116
|
+
setIsOpen(true);
|
|
117
|
+
}, []);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div>
|
|
121
|
+
<Button onClick={handleOpen}>Open modal</Button>
|
|
122
|
+
<Modal onClose={handleClose} isOpen={open} position={"bottom"} full={true}>
|
|
123
|
+
<RemovePadding>
|
|
124
|
+
<List inset={true}>
|
|
125
|
+
<List.Item selected={false} onClick={handleClose}>First item</List.Item>
|
|
126
|
+
<List.Item selected={true} onClick={handleClose}>Second item</List.Item>
|
|
127
|
+
<List.Item selected={false} onClick={handleClose}>Third item</List.Item>
|
|
128
|
+
<List.Item selected={false} onClick={handleClose}>Last option</List.Item>
|
|
129
|
+
</List>
|
|
130
|
+
</RemovePadding>
|
|
131
|
+
</Modal>
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export {
|
|
138
|
+
Primary,
|
|
139
|
+
WithRemovedPaddingSections,
|
|
140
|
+
WithList,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default meta;
|