@dxc-technology/halstack-react 0.0.0-fcf16fe → 0.0.0-fd5a25e
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/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +226 -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 +169 -0
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +293 -0
- 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 +61 -0
- package/badge/types.d.ts +5 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +51 -0
- package/bleed/Bleed.stories.tsx +341 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +116 -0
- 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/button/Button.js +174 -0
- 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/card/Card.js +161 -0
- 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/checkbox/Checkbox.js +257 -0
- package/checkbox/Checkbox.stories.tsx +188 -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/common/variables.js +1470 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +372 -0
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +107 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +138 -0
- 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/dropdown/Dropdown.js +391 -0
- 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 +593 -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 +186 -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 +185 -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 +303 -0
- package/header/Header.stories.tsx +172 -0
- package/header/Header.test.js +79 -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 -94
- 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/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +60 -0
- package/inline/Inline.stories.tsx +319 -0
- package/inline/types.d.ts +36 -0
- package/inline/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +51 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +11 -0
- package/layout/ApplicationLayout.js +199 -0
- package/layout/ApplicationLayout.stories.tsx +126 -0
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +66 -0
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +52 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +136 -0
- package/link/Link.stories.tsx +186 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +54 -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 +89 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +48 -0
- package/{dist/main.js → main.js} +166 -76
- 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 +506 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +19 -0
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +124 -0
- package/number-input/types.js +5 -0
- package/package.json +41 -28
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +171 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +308 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +166 -0
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +180 -0
- package/password-input/types.d.ts +110 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +170 -0
- 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 +116 -0
- package/quick-nav/QuickNav.stories.tsx +264 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/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 +283 -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 +348 -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/Listbox.d.ts +4 -0
- package/select/Listbox.js +175 -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 +660 -0
- package/select/Select.stories.tsx +626 -0
- package/select/Select.test.js +2162 -0
- package/select/types.d.ts +212 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +147 -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 +318 -0
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +150 -0
- package/slider/types.d.ts +82 -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 +4 -0
- package/stack/Stack.js +56 -0
- package/stack/Stack.stories.tsx +263 -0
- package/stack/types.d.ts +32 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +195 -0
- 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 +14 -24
- 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 +211 -0
- package/tabs/Tabs.stories.tsx +112 -0
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +82 -0
- package/tabs/types.js +5 -0
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +183 -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/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +770 -0
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +178 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +277 -0
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +137 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +215 -0
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +105 -0
- package/toggle-group/types.js +5 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +292 -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 -216
- package/dist/accordion/Accordion.js +0 -346
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- 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/alert/Alert.js +0 -388
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/badge/Badge.js +0 -63
- package/dist/box/Box.js +0 -164
- package/dist/button/Button.js +0 -232
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/card/Card.js +0 -254
- package/dist/checkbox/Checkbox.js +0 -291
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/chip/Chip.js +0 -269
- package/dist/common/variables.js +0 -1158
- package/dist/date/Date.js +0 -381
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.js +0 -235
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.js +0 -492
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.js +0 -405
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -431
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- 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 -669
- 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/Link.js +0 -237
- package/dist/link/readme.md +0 -51
- package/dist/paginator/Paginator.js +0 -283
- 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/progress-bar/ProgressBar.js +0 -206
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.js +0 -209
- 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 -563
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/Sidenav.js +0 -183
- package/dist/slider/Slider.js +0 -315
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -214
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.js +0 -222
- 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 -280
- package/dist/textarea/Textarea.js +0 -260
- 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 -241
- package/dist/toggle-group/readme.md +0 -82
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- 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 -325
- 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 -171
- 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 -130
- 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/Paginator.test.js +0 -177
- 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 -192
- 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/box/Box.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
|
+
|
|
20
|
+
var _variables = require("../common/variables.js");
|
|
21
|
+
|
|
22
|
+
var _utils = require("../common/utils.js");
|
|
23
|
+
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
|
+
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
27
|
+
|
|
28
|
+
var _templateObject;
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
33
|
+
|
|
34
|
+
var DxcBox = function DxcBox(_ref) {
|
|
35
|
+
var _ref$shadowDepth = _ref.shadowDepth,
|
|
36
|
+
shadowDepth = _ref$shadowDepth === void 0 ? 2 : _ref$shadowDepth,
|
|
37
|
+
_ref$display = _ref.display,
|
|
38
|
+
display = _ref$display === void 0 ? "inline-flex" : _ref$display,
|
|
39
|
+
children = _ref.children,
|
|
40
|
+
margin = _ref.margin,
|
|
41
|
+
padding = _ref.padding,
|
|
42
|
+
_ref$size = _ref.size,
|
|
43
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
44
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
46
|
+
theme: colorsTheme.box
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledDxcBox, {
|
|
48
|
+
shadowDepth: shadowDepth,
|
|
49
|
+
display: display,
|
|
50
|
+
margin: margin,
|
|
51
|
+
padding: padding,
|
|
52
|
+
size: size
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
54
|
+
color: colorsTheme.box.backgroundColor
|
|
55
|
+
}, children)));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var sizes = {
|
|
59
|
+
small: "48px",
|
|
60
|
+
medium: "240px",
|
|
61
|
+
large: "480px",
|
|
62
|
+
fillParent: "100%",
|
|
63
|
+
fitContent: "unset"
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var calculateWidth = function calculateWidth(margin, size, padding) {
|
|
67
|
+
if (size === "fillParent") {
|
|
68
|
+
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), " -\n ").concat((0, _utils.getMargin)(padding, "left"), " - ").concat((0, _utils.getMargin)(padding, "right"), ")");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return sizes[size];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var StyledDxcBox = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n letter-spacing: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (props) {
|
|
75
|
+
return props.display;
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.theme.borderRadius;
|
|
78
|
+
}, function (props) {
|
|
79
|
+
return props.theme.borderThickness;
|
|
80
|
+
}, function (props) {
|
|
81
|
+
return props.theme.borderStyle;
|
|
82
|
+
}, function (props) {
|
|
83
|
+
return props.theme.borderColor;
|
|
84
|
+
}, function (props) {
|
|
85
|
+
return props.theme.letterSpacing;
|
|
86
|
+
}, function (props) {
|
|
87
|
+
return calculateWidth(props.margin, props.size, props.padding);
|
|
88
|
+
}, function (props) {
|
|
89
|
+
return props.theme.backgroundColor;
|
|
90
|
+
}, function (props) {
|
|
91
|
+
return props.shadowDepth === 1 ? "".concat(props.theme.oneShadowDepthShadowOffsetX, " ").concat(props.theme.oneShadowDepthShadowOffsetY, " ").concat(props.theme.oneShadowDepthShadowBlur, " ").concat(props.theme.oneShadowDepthShadowSpread, " ").concat(props.theme.oneShadowDepthShadowColor) : props.shadowDepth === 2 ? "".concat(props.theme.twoShadowDepthShadowOffsetX, " ").concat(props.theme.twoShadowDepthShadowOffsetY, " ").concat(props.theme.twoShadowDepthShadowBlur, " ").concat(props.theme.twoShadowDepthShadowSpread, " ").concat(props.theme.twoShadowDepthShadowColor) : "".concat(props.theme.noneShadowDepthShadowOffsetX, " ").concat(props.theme.noneShadowDepthShadowOffsetY, " ").concat(props.theme.noneShadowDepthShadowBlur, " ").concat(props.theme.noneShadowDepthShadowSpread, " ").concat(props.theme.noneShadowDepthShadowColor);
|
|
92
|
+
}, function (props) {
|
|
93
|
+
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
94
|
+
}, function (props) {
|
|
95
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
96
|
+
}, function (props) {
|
|
97
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
98
|
+
}, function (props) {
|
|
99
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
100
|
+
}, function (props) {
|
|
101
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
102
|
+
}, function (_ref2) {
|
|
103
|
+
var padding = _ref2.padding;
|
|
104
|
+
return padding && (0, _typeof2["default"])(padding) !== "object" ? _variables.spaces[padding] : "0px";
|
|
105
|
+
}, function (props) {
|
|
106
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
107
|
+
}, function (props) {
|
|
108
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
|
|
111
|
+
}, function (props) {
|
|
112
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
var _default = DxcBox;
|
|
116
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
+
import DxcBox from "./Box";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Box ",
|
|
8
|
+
component: DxcBox,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Display flex" theme="light" level={2} />
|
|
14
|
+
<ExampleContainer>
|
|
15
|
+
<DxcBox display="flex" padding="medium">
|
|
16
|
+
Box
|
|
17
|
+
</DxcBox>
|
|
18
|
+
</ExampleContainer>
|
|
19
|
+
<Title title="ShadowDepth" theme="light" level={2} />
|
|
20
|
+
<ExampleContainer>
|
|
21
|
+
<Title title="ShadowDepth 0" theme="light" level={4} />
|
|
22
|
+
<DxcBox shadowDepth={0} margin="medium" padding="medium">
|
|
23
|
+
Box
|
|
24
|
+
</DxcBox>
|
|
25
|
+
</ExampleContainer>
|
|
26
|
+
<ExampleContainer>
|
|
27
|
+
<Title title="ShadowDepth 1" theme="light" level={4} />
|
|
28
|
+
<DxcBox shadowDepth={1} margin="medium" padding="medium">
|
|
29
|
+
Box
|
|
30
|
+
</DxcBox>
|
|
31
|
+
</ExampleContainer>
|
|
32
|
+
<ExampleContainer>
|
|
33
|
+
<Title title="ShadowDepth 2" theme="light" level={4} />
|
|
34
|
+
<DxcBox shadowDepth={2} margin="medium" padding="medium">
|
|
35
|
+
Box
|
|
36
|
+
</DxcBox>
|
|
37
|
+
</ExampleContainer>
|
|
38
|
+
<Title title="Paddings" theme="light" level={2} />
|
|
39
|
+
<ExampleContainer>
|
|
40
|
+
<Title title="Xxsmall padding" theme="light" level={4} />
|
|
41
|
+
<DxcBox padding="xxsmall">Box</DxcBox>
|
|
42
|
+
</ExampleContainer>
|
|
43
|
+
<ExampleContainer>
|
|
44
|
+
<Title title="Xsmall padding" theme="light" level={4} />
|
|
45
|
+
<DxcBox padding="xsmall">Box</DxcBox>
|
|
46
|
+
</ExampleContainer>
|
|
47
|
+
<ExampleContainer>
|
|
48
|
+
<Title title="Small padding" theme="light" level={4} />
|
|
49
|
+
<DxcBox padding="small">Box</DxcBox>
|
|
50
|
+
</ExampleContainer>
|
|
51
|
+
<ExampleContainer>
|
|
52
|
+
<Title title="Medium padding" theme="light" level={4} />
|
|
53
|
+
<DxcBox padding="medium">Box</DxcBox>
|
|
54
|
+
</ExampleContainer>
|
|
55
|
+
<ExampleContainer>
|
|
56
|
+
<Title title="Large padding" theme="light" level={4} />
|
|
57
|
+
<DxcBox padding="large">Box</DxcBox>
|
|
58
|
+
</ExampleContainer>
|
|
59
|
+
<ExampleContainer>
|
|
60
|
+
<Title title="Xlarge padding" theme="light" level={4} />
|
|
61
|
+
<DxcBox padding="xlarge">Box</DxcBox>
|
|
62
|
+
</ExampleContainer>
|
|
63
|
+
<ExampleContainer>
|
|
64
|
+
<Title title="Xxlarge padding" theme="light" level={4} />
|
|
65
|
+
<DxcBox padding="xxlarge">Box</DxcBox>
|
|
66
|
+
</ExampleContainer>
|
|
67
|
+
<Title title="Margins" theme="light" level={2} />
|
|
68
|
+
<ExampleContainer>
|
|
69
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
70
|
+
<DxcBox margin="xxsmall" padding="medium">
|
|
71
|
+
Box
|
|
72
|
+
</DxcBox>
|
|
73
|
+
</ExampleContainer>
|
|
74
|
+
<ExampleContainer>
|
|
75
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
76
|
+
<DxcBox margin="xsmall" padding="medium">
|
|
77
|
+
Box
|
|
78
|
+
</DxcBox>
|
|
79
|
+
</ExampleContainer>
|
|
80
|
+
<ExampleContainer>
|
|
81
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
82
|
+
<DxcBox margin="small" padding="medium">
|
|
83
|
+
Box
|
|
84
|
+
</DxcBox>
|
|
85
|
+
</ExampleContainer>
|
|
86
|
+
<ExampleContainer>
|
|
87
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
88
|
+
<DxcBox margin="medium" padding="medium">
|
|
89
|
+
Box
|
|
90
|
+
</DxcBox>
|
|
91
|
+
</ExampleContainer>
|
|
92
|
+
<ExampleContainer>
|
|
93
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
94
|
+
<DxcBox margin="large" padding="medium">
|
|
95
|
+
Box
|
|
96
|
+
</DxcBox>
|
|
97
|
+
</ExampleContainer>
|
|
98
|
+
<ExampleContainer>
|
|
99
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
100
|
+
<DxcBox margin="xlarge" padding="medium">
|
|
101
|
+
Box
|
|
102
|
+
</DxcBox>
|
|
103
|
+
</ExampleContainer>
|
|
104
|
+
<ExampleContainer>
|
|
105
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
106
|
+
<DxcBox margin="xxlarge" padding="medium">
|
|
107
|
+
Box
|
|
108
|
+
</DxcBox>
|
|
109
|
+
</ExampleContainer>
|
|
110
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
111
|
+
<ExampleContainer>
|
|
112
|
+
<Title title="Small size" theme="light" level={4} />
|
|
113
|
+
<DxcBox size="small">Box</DxcBox>
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Medium size" theme="light" level={4} />
|
|
117
|
+
<DxcBox size="medium">Box</DxcBox>
|
|
118
|
+
</ExampleContainer>
|
|
119
|
+
<ExampleContainer>
|
|
120
|
+
<Title title="Large size" theme="light" level={4} />
|
|
121
|
+
<DxcBox size="large">Box</DxcBox>
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="FillParent size" theme="light" level={4} />
|
|
125
|
+
<DxcBox size="fillParent">Box</DxcBox>
|
|
126
|
+
</ExampleContainer>
|
|
127
|
+
<ExampleContainer>
|
|
128
|
+
<Title title="FitContent" theme="light" level={4} />
|
|
129
|
+
<DxcBox size="fitContent">Box</DxcBox>
|
|
130
|
+
</ExampleContainer>
|
|
131
|
+
</>
|
|
132
|
+
);
|
package/box/Box.test.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
9
|
+
var _Card = _interopRequireDefault(require("../card/Card"));
|
|
10
|
+
|
|
11
|
+
describe("Box component tests", function () {
|
|
12
|
+
test("Box renders with correct text", function () {
|
|
13
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Card["default"], null, "test-box")),
|
|
14
|
+
getByText = _render.getByText;
|
|
15
|
+
|
|
16
|
+
expect(getByText("test-box")).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
});
|
package/box/types.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
declare type Padding = {
|
|
10
|
+
top?: Space;
|
|
11
|
+
bottom?: Space;
|
|
12
|
+
left?: Space;
|
|
13
|
+
right?: Space;
|
|
14
|
+
};
|
|
15
|
+
declare type Props = {
|
|
16
|
+
/**
|
|
17
|
+
* The size of the shadow to be displayed around the box.
|
|
18
|
+
*/
|
|
19
|
+
shadowDepth?: 0 | 1 | 2;
|
|
20
|
+
/**
|
|
21
|
+
* Changes the display CSS property of the box div.
|
|
22
|
+
*/
|
|
23
|
+
display?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Custom content that will be placed in the box component.
|
|
26
|
+
*/
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
30
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
31
|
+
*/
|
|
32
|
+
margin?: Space | Margin;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
|
+
*/
|
|
37
|
+
padding?: Space | Padding;
|
|
38
|
+
/**
|
|
39
|
+
* Size of the component.
|
|
40
|
+
*/
|
|
41
|
+
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
42
|
+
};
|
|
43
|
+
export default Props;
|
package/box/types.js
ADDED
package/button/Button.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
19
|
+
|
|
20
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
+
|
|
22
|
+
var _variables = require("../common/variables.js");
|
|
23
|
+
|
|
24
|
+
var _utils = require("../common/utils.js");
|
|
25
|
+
|
|
26
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
27
|
+
|
|
28
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
29
|
+
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
35
|
+
|
|
36
|
+
var DxcButton = function DxcButton(_ref) {
|
|
37
|
+
var _ref$label = _ref.label,
|
|
38
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
39
|
+
_ref$mode = _ref.mode,
|
|
40
|
+
mode = _ref$mode === void 0 ? "primary" : _ref$mode,
|
|
41
|
+
_ref$disabled = _ref.disabled,
|
|
42
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
43
|
+
_ref$iconPosition = _ref.iconPosition,
|
|
44
|
+
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
45
|
+
_ref$type = _ref.type,
|
|
46
|
+
type = _ref$type === void 0 ? "button" : _ref$type,
|
|
47
|
+
icon = _ref.icon,
|
|
48
|
+
_ref$onClick = _ref.onClick,
|
|
49
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
50
|
+
margin = _ref.margin,
|
|
51
|
+
_ref$size = _ref.size,
|
|
52
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
53
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
54
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
55
|
+
|
|
56
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
57
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
58
|
+
|
|
59
|
+
var labelComponent = /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
60
|
+
icon: icon,
|
|
61
|
+
iconPosition: iconPosition
|
|
62
|
+
}, label);
|
|
63
|
+
|
|
64
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
65
|
+
theme: colorsTheme.button
|
|
66
|
+
}, /*#__PURE__*/_react["default"].createElement(DxCButton, {
|
|
67
|
+
type: type,
|
|
68
|
+
margin: margin,
|
|
69
|
+
mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
iconPosition: iconPosition,
|
|
72
|
+
size: size,
|
|
73
|
+
backgroundType: backgroundType,
|
|
74
|
+
icon: icon
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
76
|
+
type: type,
|
|
77
|
+
disabled: disabled,
|
|
78
|
+
disableRipple: true,
|
|
79
|
+
"aria-disabled": disabled,
|
|
80
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
81
|
+
onClick: function onClick() {
|
|
82
|
+
_onClick();
|
|
83
|
+
}
|
|
84
|
+
}, label && iconPosition === "after" && labelComponent, icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
85
|
+
label: label,
|
|
86
|
+
iconPosition: iconPosition
|
|
87
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
|
|
88
|
+
src: icon
|
|
89
|
+
}) : icon), label && iconPosition === "before" && labelComponent)));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var sizes = {
|
|
93
|
+
small: "42px",
|
|
94
|
+
medium: "120px",
|
|
95
|
+
large: "240px",
|
|
96
|
+
fillParent: "100%",
|
|
97
|
+
fitContent: "unset"
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var calculateWidth = function calculateWidth(margin, size) {
|
|
101
|
+
if (size === "fillParent") {
|
|
102
|
+
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return sizes[size];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var LabelContainer = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n white-space: nowrap;\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
109
|
+
return props.theme.labelFontLineHeight;
|
|
110
|
+
}, function (props) {
|
|
111
|
+
return props.theme.fontSize;
|
|
112
|
+
}, function (props) {
|
|
113
|
+
return !props.icon || props.iconPosition === "before" ? "8px" : "0px";
|
|
114
|
+
}, function (props) {
|
|
115
|
+
return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
var IconContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
119
|
+
return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
|
|
120
|
+
}, function (props) {
|
|
121
|
+
return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
var ButtonIcon = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
125
|
+
|
|
126
|
+
var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\n"])), function (props) {
|
|
127
|
+
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
128
|
+
}, function (props) {
|
|
129
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
130
|
+
}, function (props) {
|
|
131
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
132
|
+
}, function (props) {
|
|
133
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
134
|
+
}, function (props) {
|
|
135
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
136
|
+
}, function (props) {
|
|
137
|
+
return calculateWidth(props.margin, props.size);
|
|
138
|
+
}, function (props) {
|
|
139
|
+
return props.disabled && "not-allowed" || "pointer";
|
|
140
|
+
}, function (props) {
|
|
141
|
+
return props.theme.paddingLeft;
|
|
142
|
+
}, function (props) {
|
|
143
|
+
return props.theme.paddingRight;
|
|
144
|
+
}, function (props) {
|
|
145
|
+
return props.theme.paddingTop;
|
|
146
|
+
}, function (props) {
|
|
147
|
+
return props.theme.paddingBottom;
|
|
148
|
+
}, function (props) {
|
|
149
|
+
return props.theme.fontFamily;
|
|
150
|
+
}, function (props) {
|
|
151
|
+
return props.theme.fontSize;
|
|
152
|
+
}, function (props) {
|
|
153
|
+
return props.theme.fontWeight;
|
|
154
|
+
}, function (props) {
|
|
155
|
+
return props.theme.labelLetterSpacing;
|
|
156
|
+
}, function (props) {
|
|
157
|
+
return props.size === "small" && "calc(100% - 22px)" || "unset";
|
|
158
|
+
}, function (props) {
|
|
159
|
+
return props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor;
|
|
160
|
+
}, function (props) {
|
|
161
|
+
var mode = props.mode,
|
|
162
|
+
backgroundType = props.backgroundType;
|
|
163
|
+
|
|
164
|
+
if (mode === "primary") {
|
|
165
|
+
return "\n border-radius: ".concat(props.theme.primaryBorderRadius, ";\n border-width: ").concat(props.theme.primaryBorderThickness, ";\n border-style: ").concat(props.theme.primaryBorderStyle, ";\n font-family: ").concat(props.theme.primaryFontFamily, ";\n font-size: ").concat(props.theme.primaryFontSize, ";\n font-weight: ").concat(props.theme.primaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType && backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled { \n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor, " !important; \n }\n ");
|
|
166
|
+
} else if (mode === "secondary") {
|
|
167
|
+
return "\n border-radius: ".concat(props.theme.secondaryBorderRadius, ";\n border-width: ").concat(props.theme.secondaryBorderThickness, ";\n border-style: ").concat(props.theme.secondaryBorderStyle, ";\n font-family: ").concat(props.theme.secondaryFontFamily, ";\n font-size: ").concat(props.theme.secondaryFontSize, ";\n font-weight: ").concat(props.theme.secondaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor, ";\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor, ";\n }\n ");
|
|
168
|
+
} else if (mode === "text") {
|
|
169
|
+
return "\n border-radius: ".concat(props.theme.textBorderRadius, ";\n border-width: ").concat(props.theme.textBorderThickness, ";\n border-style: ").concat(props.theme.textBorderStyle, ";\n font-family: ").concat(props.theme.textFontFamily, ";\n font-size: ").concat(props.theme.textFontSize, ";\n font-weight: ").concat(props.theme.textFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor:not-allowed;\n color: ").concat(backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, " !important;\n background-color: ").concat(backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n }\n ");
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
var _default = DxcButton;
|
|
174
|
+
exports["default"] = _default;
|