@dxc-technology/halstack-react 0.0.0-fc652e4 → 0.0.0-fdc49d2
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/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +47 -0
- package/ThemeContext.d.ts +10 -0
- package/ThemeContext.js +243 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +248 -0
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -0
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +170 -0
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +133 -0
- package/accordion-group/types.d.ts +68 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +44 -157
- package/alert/Alert.stories.tsx +170 -0
- package/alert/Alert.test.js +92 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +59 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/{dist/box → box}/Box.js +15 -45
- package/box/Box.stories.tsx +132 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/{dist/button → button}/Button.js +27 -94
- package/button/Button.stories.tsx +274 -0
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +53 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/{dist/card → card}/Card.js +34 -124
- package/card/Card.stories.tsx +201 -0
- package/card/Card.test.js +50 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +24 -77
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +64 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +161 -0
- package/chip/Chip.stories.tsx +119 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +351 -345
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +354 -0
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +492 -0
- package/date-input/types.d.ts +104 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +24 -76
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/Dialog.test.js +40 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +54 -208
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +80 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +590 -0
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +184 -0
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +258 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +77 -0
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +324 -0
- package/header/Header.stories.tsx +162 -0
- package/header/Header.test.js +63 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +34 -0
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +31 -90
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +186 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +231 -0
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/Icons.js +55 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/{dist/link → link}/Link.js +23 -111
- package/link/Link.stories.tsx +151 -0
- package/link/Link.test.js +91 -0
- package/link/types.d.ts +70 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +47 -0
- package/{dist/main.js → main.js} +135 -99
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +76 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +508 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/{dist/number/NumberContext.js → number-input/NumberInputContext.js} +6 -3
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +121 -0
- package/number-input/types.js +5 -0
- package/package.json +34 -24
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +192 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +266 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/{dist/password/Password.js → password-input/PasswordInput.js} +46 -83
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +183 -0
- package/password-input/types.d.ts +107 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/ProgressBar.test.js +65 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +60 -0
- package/quick-nav/QuickNav.stories.tsx +237 -0
- package/quick-nav/types.d.ts +25 -0
- package/quick-nav/types.js +5 -0
- package/radio/Radio.d.ts +4 -0
- package/{dist/radio → radio}/Radio.js +17 -52
- package/radio/Radio.stories.tsx +192 -0
- package/radio/Radio.test.js +71 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +280 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +43 -147
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +306 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +740 -0
- package/select/Select.stories.tsx +582 -0
- package/select/Select.test.js +2016 -0
- package/select/types.d.ts +191 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +136 -0
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/Sidenav.test.js +56 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +317 -0
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +129 -0
- package/slider/types.d.ts +78 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +103 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +3 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +164 -0
- package/stack/types.d.ts +24 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +45 -75
- package/switch/Switch.stories.tsx +160 -0
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +62 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +12 -26
- package/table/Table.stories.jsx +277 -0
- package/table/Table.test.js +26 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +213 -0
- package/tabs/Tabs.stories.tsx +120 -0
- package/tabs/Tabs.test.js +123 -0
- package/tabs/types.d.ts +78 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +186 -0
- package/tag/Tag.stories.tsx +142 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +798 -0
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1725 -0
- package/text-input/types.d.ts +163 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +95 -155
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +134 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +214 -0
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +125 -0
- package/toggle-group/types.d.ts +97 -0
- package/toggle-group/types.js +5 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +1 -1
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +286 -0
- package/wizard/Wizard.stories.tsx +214 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -241
- package/dist/accordion/Accordion.js +0 -353
- package/dist/accordion-group/AccordionGroup.js +0 -188
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/badge/Badge.js +0 -63
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/chip/Chip.js +0 -265
- package/dist/date/Date.js +0 -381
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/footer/Footer.js +0 -395
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo.svg +0 -15
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -403
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.svg +0 -8
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.js +0 -707
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/ApplicationLayout.js +0 -331
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/readme.md +0 -51
- package/dist/new-date/NewDate.js +0 -403
- package/dist/new-input-text/NewInputText.js +0 -961
- package/dist/number/Number.js +0 -138
- package/dist/paginator/Paginator.js +0 -289
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/password/styles.css +0 -3
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.js +0 -585
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/Sidenav.js +0 -177
- package/dist/slider/Slider.js +0 -319
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -218
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/tag/Tag.js +0 -288
- package/dist/textarea/Textarea.js +0 -264
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -223
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -139
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/FileToUpload.js +0 -184
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -175
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Wizard.js +0 -411
- package/dist/wizard/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -393
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -240
- package/test/Link.test.js +0 -43
- package/test/NewDate.test.js +0 -203
- package/test/NewInputText.test.js +0 -817
- package/test/NewTextarea.test.js +0 -201
- package/test/Number.test.js +0 -241
- package/test/Paginator.test.js +0 -177
- package/test/Password.test.js +0 -76
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -189
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -27
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/ToggleGroup.test.js +0 -81
- package/test/Upload.test.js +0 -60
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
package/row/Row.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = Row;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
function Row(_ref) {
|
|
19
|
+
var _ref$gutter = _ref.gutter,
|
|
20
|
+
gutter = _ref$gutter === void 0 ? "none" : _ref$gutter,
|
|
21
|
+
align = _ref.align,
|
|
22
|
+
justify = _ref.justify,
|
|
23
|
+
_ref$wrap = _ref.wrap,
|
|
24
|
+
wrap = _ref$wrap === void 0 ? true : _ref$wrap,
|
|
25
|
+
_ref$reverse = _ref.reverse,
|
|
26
|
+
reverse = _ref$reverse === void 0 ? false : _ref$reverse,
|
|
27
|
+
children = _ref.children;
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(StyledRow, {
|
|
29
|
+
gutter: gutter,
|
|
30
|
+
align: align,
|
|
31
|
+
justify: justify,
|
|
32
|
+
wrap: wrap,
|
|
33
|
+
reverse: reverse
|
|
34
|
+
}, children);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var StyledRow = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n flex-wrap: ", ";\n align-items: ", ";\n justify-content: ", ";\n gap: ", ";\n"])), function (_ref2) {
|
|
38
|
+
var reverse = _ref2.reverse;
|
|
39
|
+
return reverse ? "row-reverse" : "row";
|
|
40
|
+
}, function (_ref3) {
|
|
41
|
+
var wrap = _ref3.wrap;
|
|
42
|
+
return wrap ? "wrap" : "nowrap";
|
|
43
|
+
}, function (_ref4) {
|
|
44
|
+
var align = _ref4.align;
|
|
45
|
+
|
|
46
|
+
switch (align) {
|
|
47
|
+
case "start":
|
|
48
|
+
return "flex-start";
|
|
49
|
+
|
|
50
|
+
case "center":
|
|
51
|
+
return "center";
|
|
52
|
+
|
|
53
|
+
case "end":
|
|
54
|
+
return "flex-end";
|
|
55
|
+
|
|
56
|
+
case "baseline":
|
|
57
|
+
return "baseline";
|
|
58
|
+
|
|
59
|
+
case "stretch":
|
|
60
|
+
return "stretch";
|
|
61
|
+
|
|
62
|
+
default:
|
|
63
|
+
return "initial";
|
|
64
|
+
}
|
|
65
|
+
}, function (_ref5) {
|
|
66
|
+
var justify = _ref5.justify;
|
|
67
|
+
|
|
68
|
+
switch (justify) {
|
|
69
|
+
case "spaceBetween":
|
|
70
|
+
return "space-between";
|
|
71
|
+
|
|
72
|
+
case "spaceAround":
|
|
73
|
+
return "space-around";
|
|
74
|
+
|
|
75
|
+
case "spaceEvenly":
|
|
76
|
+
return "space-evenly";
|
|
77
|
+
|
|
78
|
+
case "start":
|
|
79
|
+
return "flex-start";
|
|
80
|
+
|
|
81
|
+
case "center":
|
|
82
|
+
return "center";
|
|
83
|
+
|
|
84
|
+
case "end":
|
|
85
|
+
return "flex-end";
|
|
86
|
+
|
|
87
|
+
default:
|
|
88
|
+
return "initial";
|
|
89
|
+
}
|
|
90
|
+
}, function (_ref6) {
|
|
91
|
+
var gutter = _ref6.gutter;
|
|
92
|
+
|
|
93
|
+
switch (gutter) {
|
|
94
|
+
case "none":
|
|
95
|
+
return "0";
|
|
96
|
+
|
|
97
|
+
case "xxxsmall":
|
|
98
|
+
return "0.125rem";
|
|
99
|
+
|
|
100
|
+
case "xxsmall":
|
|
101
|
+
return "0.25rem";
|
|
102
|
+
|
|
103
|
+
case "xsmall":
|
|
104
|
+
return "0.5rem";
|
|
105
|
+
|
|
106
|
+
case "small":
|
|
107
|
+
return "1rem";
|
|
108
|
+
|
|
109
|
+
case "medium":
|
|
110
|
+
return "1.5rem";
|
|
111
|
+
|
|
112
|
+
case "large":
|
|
113
|
+
return "2rem";
|
|
114
|
+
|
|
115
|
+
case "xlarge":
|
|
116
|
+
return "3rem";
|
|
117
|
+
|
|
118
|
+
case "xxlarge":
|
|
119
|
+
return "4rem";
|
|
120
|
+
|
|
121
|
+
case "xxxlarge":
|
|
122
|
+
return "5rem";
|
|
123
|
+
|
|
124
|
+
default:
|
|
125
|
+
return "0";
|
|
126
|
+
}
|
|
127
|
+
});
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import DxcRow from "./Row";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Row",
|
|
8
|
+
component: DxcRow,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Default" theme="light" level={4} />
|
|
14
|
+
<Container>
|
|
15
|
+
<DxcRow>
|
|
16
|
+
<Placeholder></Placeholder>
|
|
17
|
+
<Placeholder></Placeholder>
|
|
18
|
+
<Placeholder></Placeholder>
|
|
19
|
+
</DxcRow>
|
|
20
|
+
</Container>
|
|
21
|
+
<Title title="Justify = center" theme="light" level={4} />
|
|
22
|
+
<Container>
|
|
23
|
+
<DxcRow justify="center">
|
|
24
|
+
<Placeholder></Placeholder>
|
|
25
|
+
<Placeholder></Placeholder>
|
|
26
|
+
<Placeholder></Placeholder>
|
|
27
|
+
</DxcRow>
|
|
28
|
+
</Container>
|
|
29
|
+
<Title title="Justify = end" theme="light" level={4} />
|
|
30
|
+
<Container>
|
|
31
|
+
<DxcRow justify="end">
|
|
32
|
+
<Placeholder></Placeholder>
|
|
33
|
+
<Placeholder></Placeholder>
|
|
34
|
+
<Placeholder></Placeholder>
|
|
35
|
+
</DxcRow>
|
|
36
|
+
</Container>
|
|
37
|
+
<Title title="Justify = spaceAround" theme="light" level={4} />
|
|
38
|
+
<Container>
|
|
39
|
+
<DxcRow justify="spaceAround">
|
|
40
|
+
<Placeholder></Placeholder>
|
|
41
|
+
<Placeholder></Placeholder>
|
|
42
|
+
<Placeholder></Placeholder>
|
|
43
|
+
</DxcRow>
|
|
44
|
+
</Container>
|
|
45
|
+
<Title title="Justify = spaceBetween" theme="light" level={4} />
|
|
46
|
+
<Container>
|
|
47
|
+
<DxcRow justify="spaceBetween">
|
|
48
|
+
<Placeholder></Placeholder>
|
|
49
|
+
<Placeholder></Placeholder>
|
|
50
|
+
<Placeholder></Placeholder>
|
|
51
|
+
</DxcRow>
|
|
52
|
+
</Container>
|
|
53
|
+
<Title title="Justify = spaceEvenly" theme="light" level={4} />
|
|
54
|
+
<Container>
|
|
55
|
+
<DxcRow justify="spaceEvenly">
|
|
56
|
+
<Placeholder></Placeholder>
|
|
57
|
+
<Placeholder></Placeholder>
|
|
58
|
+
<Placeholder></Placeholder>
|
|
59
|
+
</DxcRow>
|
|
60
|
+
</Container>
|
|
61
|
+
<Title title="Justify = start" theme="light" level={4} />
|
|
62
|
+
<Container>
|
|
63
|
+
<DxcRow justify="start">
|
|
64
|
+
<Placeholder></Placeholder>
|
|
65
|
+
<Placeholder></Placeholder>
|
|
66
|
+
<Placeholder></Placeholder>
|
|
67
|
+
</DxcRow>
|
|
68
|
+
</Container>
|
|
69
|
+
<Title title="Align = baseline" theme="light" level={4} />
|
|
70
|
+
<Container>
|
|
71
|
+
<DxcRow align="baseline">
|
|
72
|
+
<Placeholder paddingTop={20}>test</Placeholder>
|
|
73
|
+
<Placeholder>test</Placeholder>
|
|
74
|
+
<Placeholder paddingBottom={60}>test</Placeholder>
|
|
75
|
+
</DxcRow>
|
|
76
|
+
</Container>
|
|
77
|
+
<Title title="Align = center" theme="light" level={4} />
|
|
78
|
+
<Container>
|
|
79
|
+
<DxcRow align="center">
|
|
80
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
81
|
+
<Placeholder></Placeholder>
|
|
82
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
83
|
+
</DxcRow>
|
|
84
|
+
</Container>
|
|
85
|
+
<Title title="Align = end" theme="light" level={4} />
|
|
86
|
+
<Container>
|
|
87
|
+
<DxcRow align="end">
|
|
88
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
89
|
+
<Placeholder></Placeholder>
|
|
90
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
91
|
+
</DxcRow>
|
|
92
|
+
</Container>
|
|
93
|
+
<Title title="Align = start" theme="light" level={4} />
|
|
94
|
+
<Container>
|
|
95
|
+
<DxcRow align="start">
|
|
96
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
97
|
+
<Placeholder></Placeholder>
|
|
98
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
99
|
+
</DxcRow>
|
|
100
|
+
</Container>
|
|
101
|
+
<Title title="Align = stretch" theme="light" level={4} />
|
|
102
|
+
<Container>
|
|
103
|
+
<DxcRow align="stretch">
|
|
104
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
105
|
+
<Placeholder></Placeholder>
|
|
106
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
107
|
+
</DxcRow>
|
|
108
|
+
</Container>
|
|
109
|
+
<Title title="gutter = xxxsmall" theme="light" level={4} />
|
|
110
|
+
<Container>
|
|
111
|
+
<DxcRow gutter="xxxsmall">
|
|
112
|
+
<Placeholder></Placeholder>
|
|
113
|
+
<Placeholder></Placeholder>
|
|
114
|
+
<Placeholder></Placeholder>
|
|
115
|
+
</DxcRow>
|
|
116
|
+
</Container>
|
|
117
|
+
<Title title="gutter = xxsmall" theme="light" level={4} />
|
|
118
|
+
<Container>
|
|
119
|
+
<DxcRow gutter="xxsmall">
|
|
120
|
+
<Placeholder></Placeholder>
|
|
121
|
+
<Placeholder></Placeholder>
|
|
122
|
+
<Placeholder></Placeholder>
|
|
123
|
+
</DxcRow>
|
|
124
|
+
</Container>
|
|
125
|
+
<Title title="gutter = xsmall" theme="light" level={4} />
|
|
126
|
+
<Container>
|
|
127
|
+
<DxcRow gutter="xsmall">
|
|
128
|
+
<Placeholder></Placeholder>
|
|
129
|
+
<Placeholder></Placeholder>
|
|
130
|
+
<Placeholder></Placeholder>
|
|
131
|
+
</DxcRow>
|
|
132
|
+
</Container>
|
|
133
|
+
<Title title="gutter = small" theme="light" level={4} />
|
|
134
|
+
<Container>
|
|
135
|
+
<DxcRow gutter="small">
|
|
136
|
+
<Placeholder></Placeholder>
|
|
137
|
+
<Placeholder></Placeholder>
|
|
138
|
+
<Placeholder></Placeholder>
|
|
139
|
+
</DxcRow>
|
|
140
|
+
</Container>
|
|
141
|
+
<Title title="gutter = medium" theme="light" level={4} />
|
|
142
|
+
<Container>
|
|
143
|
+
<DxcRow gutter="medium">
|
|
144
|
+
<Placeholder></Placeholder>
|
|
145
|
+
<Placeholder></Placeholder>
|
|
146
|
+
<Placeholder></Placeholder>
|
|
147
|
+
</DxcRow>
|
|
148
|
+
</Container>
|
|
149
|
+
<Title title="gutter = large" theme="light" level={4} />
|
|
150
|
+
<Container>
|
|
151
|
+
<DxcRow gutter="large">
|
|
152
|
+
<Placeholder></Placeholder>
|
|
153
|
+
<Placeholder></Placeholder>
|
|
154
|
+
<Placeholder></Placeholder>
|
|
155
|
+
</DxcRow>
|
|
156
|
+
</Container>
|
|
157
|
+
<Title title="gutter = xlarge" theme="light" level={4} />
|
|
158
|
+
<Container>
|
|
159
|
+
<DxcRow gutter="xlarge">
|
|
160
|
+
<Placeholder></Placeholder>
|
|
161
|
+
<Placeholder></Placeholder>
|
|
162
|
+
<Placeholder></Placeholder>
|
|
163
|
+
</DxcRow>
|
|
164
|
+
</Container>
|
|
165
|
+
<Title title="gutter = xxlarge" theme="light" level={4} />
|
|
166
|
+
<Container>
|
|
167
|
+
<DxcRow gutter="xxlarge">
|
|
168
|
+
<Placeholder></Placeholder>
|
|
169
|
+
<Placeholder></Placeholder>
|
|
170
|
+
<Placeholder></Placeholder>
|
|
171
|
+
</DxcRow>
|
|
172
|
+
</Container>
|
|
173
|
+
<Title title="gutter = xxxlarge" theme="light" level={4} />
|
|
174
|
+
<Container>
|
|
175
|
+
<DxcRow gutter="xxxlarge">
|
|
176
|
+
<Placeholder></Placeholder>
|
|
177
|
+
<Placeholder></Placeholder>
|
|
178
|
+
<Placeholder></Placeholder>
|
|
179
|
+
</DxcRow>
|
|
180
|
+
</Container>
|
|
181
|
+
<Title title="gutter = none" theme="light" level={4} />
|
|
182
|
+
<Container>
|
|
183
|
+
<DxcRow gutter="none">
|
|
184
|
+
<Placeholder></Placeholder>
|
|
185
|
+
<Placeholder></Placeholder>
|
|
186
|
+
<Placeholder></Placeholder>
|
|
187
|
+
</DxcRow>
|
|
188
|
+
</Container>
|
|
189
|
+
<Title title="reverse = false" theme="light" level={4} />
|
|
190
|
+
<Container>
|
|
191
|
+
<DxcRow reverse={false}>
|
|
192
|
+
<Placeholder>1</Placeholder>
|
|
193
|
+
<Placeholder>2</Placeholder>
|
|
194
|
+
<Placeholder>3</Placeholder>
|
|
195
|
+
</DxcRow>
|
|
196
|
+
</Container>
|
|
197
|
+
<Title title="reverse = true" theme="light" level={4} />
|
|
198
|
+
<Container>
|
|
199
|
+
<DxcRow reverse={true}>
|
|
200
|
+
<Placeholder>1</Placeholder>
|
|
201
|
+
<Placeholder>2</Placeholder>
|
|
202
|
+
<Placeholder>3</Placeholder>
|
|
203
|
+
</DxcRow>
|
|
204
|
+
</Container>
|
|
205
|
+
<Title title="wrap = true" theme="light" level={4} />
|
|
206
|
+
<Container width={300}>
|
|
207
|
+
<DxcRow wrap={true}>
|
|
208
|
+
<Placeholder>1</Placeholder>
|
|
209
|
+
<Placeholder>2</Placeholder>
|
|
210
|
+
<Placeholder>3</Placeholder>
|
|
211
|
+
</DxcRow>
|
|
212
|
+
</Container>
|
|
213
|
+
<Title title="wrap = false" theme="light" level={4} />
|
|
214
|
+
<Container width={300}>
|
|
215
|
+
<DxcRow wrap={false}>
|
|
216
|
+
<Placeholder>1</Placeholder>
|
|
217
|
+
<Placeholder>2</Placeholder>
|
|
218
|
+
<Placeholder>3</Placeholder>
|
|
219
|
+
</DxcRow>
|
|
220
|
+
</Container>
|
|
221
|
+
</>
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
const Container = styled.div`
|
|
225
|
+
background: #f2eafa;
|
|
226
|
+
padding: 10px;
|
|
227
|
+
width: ${({ width }) => (width ? `${width}px` : "unset")};
|
|
228
|
+
`;
|
|
229
|
+
|
|
230
|
+
const Placeholder = styled.div`
|
|
231
|
+
min-height: 40px;
|
|
232
|
+
min-width: 120px;
|
|
233
|
+
border: 1px solid #a46ede;
|
|
234
|
+
background-color: #e5d5f6;
|
|
235
|
+
padding-top: ${({ paddingTop }) => `${paddingTop ?? 0}px`};
|
|
236
|
+
padding-bottom: ${({ paddingBottom }) => `${paddingBottom ?? 0}px`};
|
|
237
|
+
`;
|
package/row/types.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* Space applied between each child.
|
|
5
|
+
*/
|
|
6
|
+
gutter?: "none" | "xxxsmall" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
7
|
+
/**
|
|
8
|
+
* Alignment applied to children.
|
|
9
|
+
*/
|
|
10
|
+
align?: "start" | "center" | "end" | "baseline" | "stretch";
|
|
11
|
+
/**
|
|
12
|
+
* Justification applied to children.
|
|
13
|
+
*/
|
|
14
|
+
justify?: "start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly";
|
|
15
|
+
/**
|
|
16
|
+
* If true, children will wrap onto multiple rows.
|
|
17
|
+
*/
|
|
18
|
+
wrap?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, children are shown in reverse order.
|
|
21
|
+
*/
|
|
22
|
+
reverse?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Custom content inside the row.
|
|
25
|
+
*/
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export default Props;
|
package/row/types.js
ADDED
package/select/Icons.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var selectIcons = {
|
|
13
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
14
|
+
role: "img",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
height: "24px",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
width: "24px",
|
|
19
|
+
fill: "currentColor"
|
|
20
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
21
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
22
|
+
})),
|
|
23
|
+
arrowUp: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
24
|
+
role: "img",
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
+
height: "24px",
|
|
27
|
+
viewBox: "0 0 24 24",
|
|
28
|
+
width: "24px",
|
|
29
|
+
fill: "currentColor"
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
31
|
+
d: "M0 0h24v24H0V0z",
|
|
32
|
+
fill: "none"
|
|
33
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
34
|
+
d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"
|
|
35
|
+
})),
|
|
36
|
+
arrowDown: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
37
|
+
role: "img",
|
|
38
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
+
height: "24px",
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
width: "24px",
|
|
42
|
+
fill: "currentColor"
|
|
43
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
44
|
+
d: "M0 0h24v24H0V0z",
|
|
45
|
+
fill: "none"
|
|
46
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
47
|
+
d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
48
|
+
})),
|
|
49
|
+
clear: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
50
|
+
role: "img",
|
|
51
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
52
|
+
width: "24",
|
|
53
|
+
height: "24",
|
|
54
|
+
viewBox: "0 0 24 24",
|
|
55
|
+
fill: "currentColor"
|
|
56
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
57
|
+
d: "M0 0h24v24H0V0z",
|
|
58
|
+
fill: "none"
|
|
59
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
60
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
61
|
+
})),
|
|
62
|
+
selected: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
63
|
+
role: "img",
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
+
height: "24px",
|
|
66
|
+
viewBox: "0 0 24 24",
|
|
67
|
+
width: "24px",
|
|
68
|
+
fill: "currentColor"
|
|
69
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
70
|
+
d: "M0 0h24v24H0z",
|
|
71
|
+
fill: "none"
|
|
72
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
73
|
+
d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
|
|
74
|
+
})),
|
|
75
|
+
searchOff: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
76
|
+
role: "img",
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
+
height: "24px",
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
width: "24px",
|
|
81
|
+
fill: "currentColor"
|
|
82
|
+
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
83
|
+
fill: "none",
|
|
84
|
+
height: "24",
|
|
85
|
+
width: "24"
|
|
86
|
+
})), /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
87
|
+
d: "M15.5,14h-0.79l-0.28-0.27C15.41,12.59,16,11.11,16,9.5C16,5.91,13.09,3,9.5,3C6.08,3,3.28,5.64,3.03,9h2.02 C5.3,6.75,7.18,5,9.5,5C11.99,5,14,7.01,14,9.5S11.99,14,9.5,14c-0.17,0-0.33-0.03-0.5-0.05v2.02C9.17,15.99,9.33,16,9.5,16 c1.61,0,3.09-0.59,4.23-1.57L14,14.71v0.79l5,4.99L20.49,19L15.5,14z"
|
|
88
|
+
}), /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
89
|
+
points: "6.47,10.82 4,13.29 1.53,10.82 0.82,11.53 3.29,14 0.82,16.47 1.53,17.18 4,14.71 6.47,17.18 7.18,16.47 4.71,14 7.18,11.53"
|
|
90
|
+
}))))
|
|
91
|
+
};
|
|
92
|
+
var _default = selectIcons;
|
|
93
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OptionProps } from "../select/types";
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ id, option, onClick, multiple, visualFocused, isGroupedOption, isLastOption, isSelected, }: OptionProps) => JSX.Element>;
|
|
4
|
+
export default _default;
|
package/select/Option.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
+
|
|
18
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
19
|
+
|
|
20
|
+
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
21
|
+
|
|
22
|
+
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
23
|
+
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
var Option = function Option(_ref) {
|
|
31
|
+
var id = _ref.id,
|
|
32
|
+
option = _ref.option,
|
|
33
|
+
_onClick = _ref.onClick,
|
|
34
|
+
multiple = _ref.multiple,
|
|
35
|
+
visualFocused = _ref.visualFocused,
|
|
36
|
+
_ref$isGroupedOption = _ref.isGroupedOption,
|
|
37
|
+
isGroupedOption = _ref$isGroupedOption === void 0 ? false : _ref$isGroupedOption,
|
|
38
|
+
isLastOption = _ref.isLastOption,
|
|
39
|
+
isSelected = _ref.isSelected;
|
|
40
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
42
|
+
theme: colorsTheme.radioGroup
|
|
43
|
+
}, /*#__PURE__*/_react["default"].createElement(OptionItem, {
|
|
44
|
+
id: id,
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
_onClick(option);
|
|
47
|
+
},
|
|
48
|
+
visualFocused: visualFocused,
|
|
49
|
+
selected: isSelected,
|
|
50
|
+
role: "option",
|
|
51
|
+
"aria-selected": isSelected
|
|
52
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledOption, {
|
|
53
|
+
visualFocused: visualFocused,
|
|
54
|
+
selected: isSelected,
|
|
55
|
+
last: isLastOption,
|
|
56
|
+
grouped: isGroupedOption,
|
|
57
|
+
multiple: multiple
|
|
58
|
+
}, multiple && /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
59
|
+
checked: isSelected,
|
|
60
|
+
tabIndex: -1
|
|
61
|
+
}), option.icon && /*#__PURE__*/_react["default"].createElement(OptionIcon, {
|
|
62
|
+
grouped: isGroupedOption,
|
|
63
|
+
multiple: multiple,
|
|
64
|
+
role: !(typeof option.icon === "string") ? "img" : undefined
|
|
65
|
+
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement(OptionIconImg, {
|
|
66
|
+
src: option.icon
|
|
67
|
+
}) : option.icon), /*#__PURE__*/_react["default"].createElement(OptionContent, {
|
|
68
|
+
grouped: isGroupedOption,
|
|
69
|
+
hasIcon: option.icon ? true : false,
|
|
70
|
+
multiple: multiple
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement(OptionLabel, null, option.label), !multiple && isSelected && /*#__PURE__*/_react["default"].createElement(OptionSelectedIndicator, null, _Icons["default"].selected)))));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var OptionItem = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 0.5rem;\n box-shadow: inset 0 0 0 2px transparent;\n ", "\n ", ";\n line-height: 1.715em;\n cursor: pointer;\n\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"])), function (props) {
|
|
75
|
+
return props.visualFocused && "box-shadow: inset 0 0 0 2px ".concat(props.theme.focusListOptionBorderColor, ";");
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.selected && "background-color: ".concat(props.theme.selectedListOptionBackgroundColor);
|
|
78
|
+
}, function (props) {
|
|
79
|
+
return props.selected ? "background-color: ".concat(props.theme.selectedHoverListOptionBackgroundColor, ";") : "background-color: ".concat(props.theme.unselectedHoverListOptionBackgroundColor, ";");
|
|
80
|
+
}, function (props) {
|
|
81
|
+
return props.selected ? "background-color: ".concat(props.theme.selectedActiveListOptionBackgroundColor, ";") : "background-color: ".concat(props.theme.unselectedActiveListOptionBackgroundColor, ";");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
var StyledOption = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 0.5rem 0.188rem 0;\n min-height: 24px;\n ", "\n ", ";\n"])), function (props) {
|
|
85
|
+
return props.grouped && props.multiple && "padding-left: 16px;";
|
|
86
|
+
}, function (props) {
|
|
87
|
+
return props.last || props.visualFocused || props.selected ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var OptionIcon = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n ", "\n color: ", ";\n"])), function (props) {
|
|
91
|
+
return props.grouped && !props.multiple ? "padding-left: 16px;" : "padding-left: 8px;";
|
|
92
|
+
}, function (props) {
|
|
93
|
+
return props.theme.listOptionIconColor;
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
var OptionContent = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n overflow: hidden;\n ", "\n"])), function (props) {
|
|
97
|
+
return props.grouped && !props.multiple && !props.hasIcon ? "padding-left: 16px;" : "padding-left: 8px;";
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
var OptionIconImg = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
|
|
101
|
+
|
|
102
|
+
var OptionLabel = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
103
|
+
|
|
104
|
+
var OptionSelectedIndicator = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 16px;\n width: 16px;\n margin-left: 4px;\n color: ", ";\n"])), function (props) {
|
|
105
|
+
return props.theme.selectedListOptionIconColor;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
var _default = /*#__PURE__*/_react["default"].memo(Option);
|
|
109
|
+
|
|
110
|
+
exports["default"] = _default;
|