@dxc-technology/halstack-react 0.0.0-fce22b8 → 0.0.0-fd47ea5
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 +343 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +239 -0
- package/accordion/Accordion.stories.tsx +395 -0
- package/accordion/Accordion.test.js +71 -0
- package/accordion/types.d.ts +69 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +149 -0
- package/accordion-group/AccordionGroup.stories.tsx +251 -0
- package/accordion-group/AccordionGroup.test.js +126 -0
- package/accordion-group/types.d.ts +79 -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 +198 -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 +147 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +44 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +154 -0
- package/button/Button.stories.tsx +425 -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 +68 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/Checkbox.js +250 -0
- package/checkbox/Checkbox.stories.tsx +260 -0
- package/checkbox/Checkbox.test.js +155 -0
- package/checkbox/types.d.ts +68 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +155 -0
- package/chip/Chip.stories.tsx +206 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/variables.js +1538 -0
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +269 -0
- package/date-input/DateInput.stories.tsx +304 -0
- package/date-input/DateInput.test.js +835 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +126 -0
- package/date-input/types.d.ts +158 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +160 -0
- package/dialog/Dialog.stories.tsx +289 -0
- package/dialog/Dialog.test.js +70 -0
- package/dialog/types.d.ts +44 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +388 -0
- package/dropdown/Dropdown.stories.tsx +438 -0
- package/dropdown/Dropdown.test.js +585 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +70 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +81 -0
- package/dropdown/types.d.ts +100 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +548 -0
- package/file-input/FileInput.stories.tsx +618 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +162 -0
- package/file-input/types.d.ts +129 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +185 -0
- package/footer/Footer.stories.tsx +228 -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 +66 -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 +315 -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 +48 -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/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 +20 -0
- package/layout/ApplicationLayout.js +171 -0
- package/layout/ApplicationLayout.stories.tsx +162 -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 +42 -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 +253 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +148 -90
- package/nav-tabs/NavTabs.d.ts +8 -0
- package/nav-tabs/NavTabs.js +125 -0
- package/nav-tabs/NavTabs.stories.tsx +260 -0
- package/nav-tabs/NavTabs.test.js +82 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +150 -0
- package/nav-tabs/types.d.ts +53 -0
- package/nav-tabs/types.js +5 -0
- 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 +542 -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 +48 -40
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +54 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +165 -0
- package/paginator/Paginator.stories.tsx +87 -0
- package/paginator/Paginator.test.js +315 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -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 +181 -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 +176 -0
- package/progress-bar/ProgressBar.stories.jsx +93 -0
- package/progress-bar/ProgressBar.test.js +110 -0
- package/progress-bar/types.d.ts +36 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +117 -0
- package/quick-nav/QuickNav.stories.tsx +356 -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 +156 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +283 -0
- package/radio-group/RadioGroup.stories.tsx +214 -0
- package/radio-group/RadioGroup.test.js +722 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +195 -0
- package/resultsetTable/ResultsetTable.stories.tsx +300 -0
- package/resultsetTable/ResultsetTable.test.js +325 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/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 +169 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +97 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +664 -0
- package/select/Select.stories.tsx +971 -0
- package/select/Select.test.js +2228 -0
- package/select/types.d.ts +210 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +266 -0
- package/sidenav/Sidenav.stories.tsx +282 -0
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +73 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +343 -0
- package/slider/Slider.stories.tsx +240 -0
- package/slider/Slider.test.js +250 -0
- package/slider/types.d.ts +86 -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 +129 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +262 -0
- package/switch/Switch.stories.tsx +171 -0
- package/switch/Switch.test.js +225 -0
- package/switch/types.d.ts +66 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +118 -0
- package/table/Table.stories.jsx +356 -0
- package/table/Table.test.js +26 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +467 -0
- package/tabs/Tabs.stories.tsx +226 -0
- package/tabs/Tabs.test.js +351 -0
- package/tabs/types.d.ts +92 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +183 -0
- package/tag/Tag.stories.tsx +155 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +84 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +673 -0
- package/text-input/TextInput.stories.tsx +569 -0
- package/text-input/TextInput.test.js +1724 -0
- package/text-input/types.d.ts +197 -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 +216 -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 +215 -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/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/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 +285 -0
- package/wizard/Wizard.stories.tsx +253 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +65 -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 -340
- 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 -61
- package/dist/box/Box.js +0 -164
- package/dist/button/Button.js +0 -228
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/card/Card.js +0 -256
- 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 -263
- package/dist/common/RequiredComponent.js +0 -40
- package/dist/common/variables.js +0 -1154
- package/dist/date/Date.js +0 -391
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.js +0 -236
- 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 -212
- 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/ResultsetTable.js +0 -375
- 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 -525
- 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/table/Table.js +0 -122
- package/dist/tabs/Tabs.js +0 -347
- 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 -383
- package/dist/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- 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 -42
- 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/{dist/common → common}/OpenSans.css +0 -0
- /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
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
3
|
+
import DxcButton from "./Button";
|
|
4
|
+
import DxcFlex from "./../flex/Flex";
|
|
5
|
+
import Title from "../../.storybook/components/Title";
|
|
6
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
7
|
+
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
8
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: "Button",
|
|
12
|
+
component: DxcButton,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const iconSVG = (
|
|
16
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="currentColor">
|
|
17
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
18
|
+
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const facebookIcon = (
|
|
23
|
+
<svg
|
|
24
|
+
version="1.1"
|
|
25
|
+
id="Capa_1"
|
|
26
|
+
x="0px"
|
|
27
|
+
y="0px"
|
|
28
|
+
width="438.536px"
|
|
29
|
+
height="438.536px"
|
|
30
|
+
viewBox="0 0 438.536 438.536"
|
|
31
|
+
fill="currentColor"
|
|
32
|
+
>
|
|
33
|
+
<g>
|
|
34
|
+
<path
|
|
35
|
+
d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
|
|
36
|
+
C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
|
|
37
|
+
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
38
|
+
C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
|
|
39
|
+
c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
|
|
40
|
+
c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
|
|
41
|
+
/>
|
|
42
|
+
</g>
|
|
43
|
+
</svg>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const smallIcon = (
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="20" width="20" fill="currentColor">
|
|
48
|
+
<path d="m7.646 18.333-.313-2.625q-.208-.125-.458-.27-.25-.146-.458-.271l-2.438 1.021-2.354-4.063 2.083-1.583V9.458L1.625 7.875l2.354-4.063 2.438 1.021q.208-.125.458-.27.25-.146.458-.271l.313-2.625h4.708l.313 2.625q.208.125.458.271.25.145.458.27l2.438-1.021 2.354 4.063-2.063 1.583v1.084l2.063 1.583-2.354 4.063-2.438-1.021q-.208.125-.458.271-.25.145-.458.27l-.313 2.625ZM10 12.979q1.229 0 2.104-.875T12.979 10q0-1.229-.875-2.104T10 7.021q-1.229 0-2.104.875T7.021 10q0 1.229.875 2.104t2.104.875Zm0-1.75q-.5 0-.865-.364-.364-.365-.364-.865t.364-.865q.365-.364.865-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.166q.605-.167 1.167-.5.562-.334 1.021-.792l2.021.854.833-1.375-1.771-1.354q.104-.292.146-.604.042-.313.042-.646 0-.292-.042-.594t-.125-.635l1.771-1.375-.834-1.375-2.02.875q-.48-.479-1.032-.802-.552-.323-1.156-.49l-.271-2.187H9.167l-.271 2.187q-.604.167-1.156.49-.552.323-1.011.781l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.459.458 1.011.781.552.323 1.156.49Z" />
|
|
49
|
+
</svg>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const opinionatedTheme = {
|
|
53
|
+
button: {
|
|
54
|
+
baseColor: "#5f249f",
|
|
55
|
+
primaryFontColor: "#ffffff",
|
|
56
|
+
secondaryHoverFontColor: "#ffffff",
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Chromatic = () => (
|
|
61
|
+
<>
|
|
62
|
+
<Title title="Primary" theme="light" level={2} />
|
|
63
|
+
<ExampleContainer>
|
|
64
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
65
|
+
<DxcButton label="Primary enabled" />
|
|
66
|
+
</ExampleContainer>
|
|
67
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
68
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
69
|
+
<DxcButton label="Primary hovered" />
|
|
70
|
+
</ExampleContainer>
|
|
71
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
72
|
+
<Title title="Focused" theme="light" level={4} />
|
|
73
|
+
<DxcButton label="Primary focused" />
|
|
74
|
+
</ExampleContainer>
|
|
75
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
76
|
+
<Title title="Actived" theme="light" level={4} />
|
|
77
|
+
<DxcButton label="Primary actived" />
|
|
78
|
+
</ExampleContainer>
|
|
79
|
+
<ExampleContainer>
|
|
80
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
81
|
+
<DxcButton label="Primary disabled" disabled icon={iconSVG} />
|
|
82
|
+
</ExampleContainer>
|
|
83
|
+
<ExampleContainer>
|
|
84
|
+
<Title title="With left icon" theme="light" level={4} />
|
|
85
|
+
<DxcButton label="Primary" icon={iconSVG} />
|
|
86
|
+
</ExampleContainer>
|
|
87
|
+
<ExampleContainer>
|
|
88
|
+
<Title title="With right icon" theme="light" level={4} />
|
|
89
|
+
<DxcButton label="Primary" icon={iconSVG} iconPosition="after" />
|
|
90
|
+
</ExampleContainer>
|
|
91
|
+
<ExampleContainer>
|
|
92
|
+
<Title title="Only icon" theme="light" level={4} />
|
|
93
|
+
<DxcButton icon={iconSVG} />
|
|
94
|
+
</ExampleContainer>
|
|
95
|
+
<ExampleContainer>
|
|
96
|
+
<Title title="Big icon (SVG)" theme="light" level={4} />
|
|
97
|
+
<DxcButton icon={facebookIcon} />
|
|
98
|
+
</ExampleContainer>
|
|
99
|
+
<ExampleContainer>
|
|
100
|
+
<Title title="Big icon (image)" theme="light" level={4} />
|
|
101
|
+
<DxcButton icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png" />
|
|
102
|
+
</ExampleContainer>
|
|
103
|
+
<ExampleContainer>
|
|
104
|
+
<Title title="Small icon" theme="light" level={4} />
|
|
105
|
+
<DxcButton icon={smallIcon} />
|
|
106
|
+
</ExampleContainer>
|
|
107
|
+
<Title title="Secondary" theme="light" level={2} />
|
|
108
|
+
<ExampleContainer>
|
|
109
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
110
|
+
<DxcButton mode="secondary" label="Secondary enabled" />
|
|
111
|
+
</ExampleContainer>
|
|
112
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
113
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
114
|
+
<DxcButton mode="secondary" label="Secondary hovered" />
|
|
115
|
+
</ExampleContainer>
|
|
116
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
117
|
+
<Title title="Focused" theme="light" level={4} />
|
|
118
|
+
<DxcButton mode="secondary" label="Secondary focused" />
|
|
119
|
+
</ExampleContainer>
|
|
120
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
121
|
+
<Title title="Actived" theme="light" level={4} />
|
|
122
|
+
<DxcButton mode="secondary" label="Secondary actived" />
|
|
123
|
+
</ExampleContainer>
|
|
124
|
+
<ExampleContainer>
|
|
125
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
126
|
+
<DxcButton mode="secondary" disabled label="Secondary disabled" icon={iconSVG} />
|
|
127
|
+
</ExampleContainer>
|
|
128
|
+
<ExampleContainer>
|
|
129
|
+
<Title title="With icon" theme="light" level={4} />
|
|
130
|
+
<DxcButton mode="secondary" label="Secondary" icon={iconSVG} />
|
|
131
|
+
</ExampleContainer>
|
|
132
|
+
<ExampleContainer>
|
|
133
|
+
<Title title="Only icon (image)" theme="light" level={4} />
|
|
134
|
+
<DxcButton
|
|
135
|
+
mode="secondary"
|
|
136
|
+
icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
|
|
137
|
+
/>
|
|
138
|
+
</ExampleContainer>
|
|
139
|
+
<Title title="Text" theme="light" level={2} />
|
|
140
|
+
<ExampleContainer>
|
|
141
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
142
|
+
<DxcButton mode="text" label="Text enabled" />
|
|
143
|
+
</ExampleContainer>
|
|
144
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
145
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
146
|
+
<DxcButton mode="text" label="Text hovered" />
|
|
147
|
+
</ExampleContainer>
|
|
148
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
149
|
+
<Title title="Focused" theme="light" level={4} />
|
|
150
|
+
<DxcButton mode="text" label="Text focused" />
|
|
151
|
+
</ExampleContainer>
|
|
152
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
153
|
+
<Title title="Actived" theme="light" level={4} />
|
|
154
|
+
<DxcButton mode="text" label="Text actived" />
|
|
155
|
+
</ExampleContainer>
|
|
156
|
+
<ExampleContainer>
|
|
157
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
158
|
+
<DxcButton mode="text" label="Text disabled" disabled icon={iconSVG} />
|
|
159
|
+
</ExampleContainer>
|
|
160
|
+
<ExampleContainer>
|
|
161
|
+
<Title title="With icon" theme="light" level={4} />
|
|
162
|
+
<DxcButton label="Text" mode="text" icon={iconSVG} />
|
|
163
|
+
</ExampleContainer>
|
|
164
|
+
<ExampleContainer>
|
|
165
|
+
<Title title="Only icon (image)" theme="light" level={4} />
|
|
166
|
+
<DxcButton
|
|
167
|
+
mode="text"
|
|
168
|
+
icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
|
|
169
|
+
/>
|
|
170
|
+
</ExampleContainer>
|
|
171
|
+
<BackgroundColorProvider color="#333333">
|
|
172
|
+
<DarkContainer>
|
|
173
|
+
<Title title="Primary" theme="dark" level={2} />
|
|
174
|
+
<ExampleContainer>
|
|
175
|
+
<Title title="Enabled" theme="dark" level={4} />
|
|
176
|
+
<DxcButton label="Primary enabled" />
|
|
177
|
+
</ExampleContainer>
|
|
178
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
179
|
+
<Title title="Hovered" theme="dark" level={4} />
|
|
180
|
+
<DxcButton label="Primary hovered" />
|
|
181
|
+
</ExampleContainer>
|
|
182
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
183
|
+
<Title title="Focused" theme="dark" level={4} />
|
|
184
|
+
<DxcButton label="Primary focused" />
|
|
185
|
+
</ExampleContainer>
|
|
186
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
187
|
+
<Title title="Actived" theme="dark" level={4} />
|
|
188
|
+
<DxcButton label="Primary actived" />
|
|
189
|
+
</ExampleContainer>
|
|
190
|
+
<ExampleContainer>
|
|
191
|
+
<Title title="Disabled" theme="dark" level={4} />
|
|
192
|
+
<DxcButton label="Primary disabled" disabled icon={iconSVG} />
|
|
193
|
+
</ExampleContainer>
|
|
194
|
+
<ExampleContainer>
|
|
195
|
+
<Title title="With icon" theme="dark" level={4} />
|
|
196
|
+
<DxcButton label="Primary" icon={iconSVG} />
|
|
197
|
+
</ExampleContainer>
|
|
198
|
+
<Title title="Secondary" theme="dark" level={2} />
|
|
199
|
+
<ExampleContainer>
|
|
200
|
+
<Title title="Enabled" theme="dark" level={4} />
|
|
201
|
+
<DxcButton mode="secondary" label="Secondary enabled" />
|
|
202
|
+
</ExampleContainer>
|
|
203
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
204
|
+
<Title title="Hovered" theme="dark" level={4} />
|
|
205
|
+
<DxcButton mode="secondary" label="Secondary hovered" />
|
|
206
|
+
</ExampleContainer>
|
|
207
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
208
|
+
<Title title="Focused" theme="dark" level={4} />
|
|
209
|
+
<DxcButton mode="secondary" label="Secondary focused" />
|
|
210
|
+
</ExampleContainer>
|
|
211
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
212
|
+
<Title title="Actived" theme="dark" level={4} />
|
|
213
|
+
<DxcButton mode="secondary" label="Secondary actived" />
|
|
214
|
+
</ExampleContainer>
|
|
215
|
+
<ExampleContainer>
|
|
216
|
+
<Title title="Disabled" theme="dark" level={4} />
|
|
217
|
+
<DxcButton mode="secondary" disabled label="Secondary disabled" icon={iconSVG} />
|
|
218
|
+
</ExampleContainer>
|
|
219
|
+
<ExampleContainer>
|
|
220
|
+
<Title title="With icon" theme="dark" level={4} />
|
|
221
|
+
<DxcButton mode="secondary" label="Primary" icon={iconSVG} />
|
|
222
|
+
</ExampleContainer>
|
|
223
|
+
<Title title="Text" theme="dark" level={2} />
|
|
224
|
+
<ExampleContainer>
|
|
225
|
+
<Title title="Enabled" theme="dark" level={4} />
|
|
226
|
+
<DxcButton mode="text" label="Text enabled" />
|
|
227
|
+
</ExampleContainer>
|
|
228
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
229
|
+
<Title title="Hovered" theme="dark" level={4} />
|
|
230
|
+
<DxcButton mode="text" label="Text hovered" />
|
|
231
|
+
</ExampleContainer>
|
|
232
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
233
|
+
<Title title="Focused" theme="dark" level={4} />
|
|
234
|
+
<DxcButton mode="text" label="Text focused" />
|
|
235
|
+
</ExampleContainer>
|
|
236
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
237
|
+
<Title title="Actived" theme="dark" level={4} />
|
|
238
|
+
<DxcButton mode="text" label="Text actived" />
|
|
239
|
+
</ExampleContainer>
|
|
240
|
+
<ExampleContainer>
|
|
241
|
+
<Title title="Disabled" theme="dark" level={4} />
|
|
242
|
+
<DxcButton mode="text" label="Text disabled" disabled icon={iconSVG} />
|
|
243
|
+
</ExampleContainer>
|
|
244
|
+
<ExampleContainer>
|
|
245
|
+
<Title title="With icon" theme="dark" level={4} />
|
|
246
|
+
<DxcButton mode="text" label="Primary" icon={iconSVG} />
|
|
247
|
+
</ExampleContainer>
|
|
248
|
+
</DarkContainer>
|
|
249
|
+
</BackgroundColorProvider>
|
|
250
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
251
|
+
<ExampleContainer>
|
|
252
|
+
<Title title="Small size" theme="light" level={4} />
|
|
253
|
+
<DxcButton label="Small" size="small" />
|
|
254
|
+
</ExampleContainer>
|
|
255
|
+
<ExampleContainer>
|
|
256
|
+
<Title title="Medium size" theme="light" level={4} />
|
|
257
|
+
<DxcButton label="MediumSiz" size="medium" />
|
|
258
|
+
</ExampleContainer>
|
|
259
|
+
<ExampleContainer>
|
|
260
|
+
<Title title="Medium size with ellipsis" theme="light" level={4} />
|
|
261
|
+
<DxcButton label="MediumSize" size="medium" />
|
|
262
|
+
</ExampleContainer>
|
|
263
|
+
<ExampleContainer>
|
|
264
|
+
<Title title="Medium size icon after" theme="light" level={4} />
|
|
265
|
+
<DxcButton label="Mediu" iconPosition="after" icon={iconSVG} size="medium" />
|
|
266
|
+
</ExampleContainer>
|
|
267
|
+
<ExampleContainer>
|
|
268
|
+
<Title title="Medium size icon before" theme="light" level={4} />
|
|
269
|
+
<DxcButton label="Mediu" iconPosition="before" icon={iconSVG} size="medium" />
|
|
270
|
+
</ExampleContainer>
|
|
271
|
+
<ExampleContainer>
|
|
272
|
+
<Title title="Medium size icon after with ellipsis" theme="light" level={4} />
|
|
273
|
+
<DxcButton label="Medium" iconPosition="after" icon={iconSVG} size="medium" />
|
|
274
|
+
</ExampleContainer>
|
|
275
|
+
<ExampleContainer>
|
|
276
|
+
<Title title="Medium size icon before with ellipsis" theme="light" level={4} />
|
|
277
|
+
<DxcButton label="Medium" iconPosition="before" icon={iconSVG} size="medium" />
|
|
278
|
+
</ExampleContainer>
|
|
279
|
+
<ExampleContainer>
|
|
280
|
+
<Title title="Large size" theme="light" level={4} />
|
|
281
|
+
<DxcButton label="LargeSizePrimaryButtonEx" size="large" />
|
|
282
|
+
</ExampleContainer>
|
|
283
|
+
<ExampleContainer>
|
|
284
|
+
<Title title="Large size with ellipsis" theme="light" level={4} />
|
|
285
|
+
<DxcButton label="LargeSizePrimaryButtonExa" size="large" />
|
|
286
|
+
</ExampleContainer>
|
|
287
|
+
<ExampleContainer>
|
|
288
|
+
<Title title="Large size icon after" theme="light" level={4} />
|
|
289
|
+
<DxcButton label="LargeSizePrimaryButto" iconPosition="after" icon={iconSVG} size="large" />
|
|
290
|
+
</ExampleContainer>
|
|
291
|
+
<ExampleContainer>
|
|
292
|
+
<Title title="Large size icon before" theme="light" level={4} />
|
|
293
|
+
<DxcButton label="LargeSizePrimaryButto" iconPosition="before" icon={iconSVG} size="large" />
|
|
294
|
+
</ExampleContainer>
|
|
295
|
+
<ExampleContainer>
|
|
296
|
+
<Title title="Large size icon after with ellipsis" theme="light" level={4} />
|
|
297
|
+
<DxcButton label="LargeSizePrimaryButton" iconPosition="after" icon={iconSVG} size="large" />
|
|
298
|
+
</ExampleContainer>
|
|
299
|
+
<ExampleContainer>
|
|
300
|
+
<Title title="Large size icon before with ellipsis" theme="light" level={4} />
|
|
301
|
+
<DxcButton label="LargeSizePrimaryButton" iconPosition="before" icon={iconSVG} size="large" />
|
|
302
|
+
</ExampleContainer>
|
|
303
|
+
<ExampleContainer>
|
|
304
|
+
<Title title="FillParent size" theme="light" level={4} />
|
|
305
|
+
<DxcButton label="FillParent" size="fillParent" />
|
|
306
|
+
</ExampleContainer>
|
|
307
|
+
<ExampleContainer>
|
|
308
|
+
<Title title="FitContent size" theme="light" level={4} />
|
|
309
|
+
<DxcButton label="FitContent" size="fitContent" />
|
|
310
|
+
</ExampleContainer>
|
|
311
|
+
<Title title="Margins" theme="light" level={2} />
|
|
312
|
+
<ExampleContainer>
|
|
313
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
314
|
+
<DxcButton label="Xxsmall margin" margin="xxsmall" />
|
|
315
|
+
</ExampleContainer>
|
|
316
|
+
<ExampleContainer>
|
|
317
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
318
|
+
<DxcButton label="Xsmall margin" margin="xsmall" />
|
|
319
|
+
</ExampleContainer>
|
|
320
|
+
<ExampleContainer>
|
|
321
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
322
|
+
<DxcButton label="Small margin" margin="small" />
|
|
323
|
+
</ExampleContainer>
|
|
324
|
+
<ExampleContainer>
|
|
325
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
326
|
+
<DxcButton label="Medium margin" margin="medium" />
|
|
327
|
+
</ExampleContainer>
|
|
328
|
+
<ExampleContainer>
|
|
329
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
330
|
+
<DxcButton label="Large margin" margin="large" />
|
|
331
|
+
</ExampleContainer>
|
|
332
|
+
<ExampleContainer>
|
|
333
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
334
|
+
<DxcButton label="Xlarge margin" margin="xlarge" />
|
|
335
|
+
</ExampleContainer>
|
|
336
|
+
<ExampleContainer>
|
|
337
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
338
|
+
<DxcButton label="Xxlarge margin" margin="xxlarge" />
|
|
339
|
+
</ExampleContainer>
|
|
340
|
+
<Title title="Inside a flex" theme="light" level={2} />
|
|
341
|
+
<ExampleContainer>
|
|
342
|
+
<DxcFlex direction="column" gap="0.75rem">
|
|
343
|
+
<DxcButton label="Button" />
|
|
344
|
+
<DxcButton label="Button" />
|
|
345
|
+
<DxcButton label="Button" />
|
|
346
|
+
</DxcFlex>
|
|
347
|
+
</ExampleContainer>
|
|
348
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
349
|
+
<Title title="Primary" theme="light" level={3} />
|
|
350
|
+
<ExampleContainer>
|
|
351
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
352
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
353
|
+
<DxcButton label="Primary" icon={iconSVG} />
|
|
354
|
+
</HalstackProvider>
|
|
355
|
+
</ExampleContainer>
|
|
356
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
357
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
358
|
+
<DxcButton label="Primary hovered" icon={iconSVG} />
|
|
359
|
+
</ExampleContainer>
|
|
360
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
361
|
+
<Title title="Focused" theme="light" level={4} />
|
|
362
|
+
<DxcButton label="Primary focused" icon={iconSVG} />
|
|
363
|
+
</ExampleContainer>
|
|
364
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
365
|
+
<Title title="Actived" theme="light" level={4} />
|
|
366
|
+
<DxcButton label="Primary actived" icon={iconSVG} />
|
|
367
|
+
</ExampleContainer>
|
|
368
|
+
<ExampleContainer>
|
|
369
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
370
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
371
|
+
<DxcButton label="Primary" icon={iconSVG} disabled />
|
|
372
|
+
</HalstackProvider>
|
|
373
|
+
</ExampleContainer>
|
|
374
|
+
<Title title="Secondary" theme="light" level={3} />
|
|
375
|
+
<ExampleContainer>
|
|
376
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
377
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
378
|
+
<DxcButton mode="secondary" label="Secondary" icon={iconSVG} />
|
|
379
|
+
</HalstackProvider>
|
|
380
|
+
</ExampleContainer>
|
|
381
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
382
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
383
|
+
<DxcButton mode="secondary" label="Secondary hovered" icon={iconSVG} />
|
|
384
|
+
</ExampleContainer>
|
|
385
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
386
|
+
<Title title="Focused" theme="light" level={4} />
|
|
387
|
+
<DxcButton mode="secondary" label="Secondary focused" icon={iconSVG} />
|
|
388
|
+
</ExampleContainer>
|
|
389
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
390
|
+
<Title title="Actived" theme="light" level={4} />
|
|
391
|
+
<DxcButton mode="secondary" label="Secondary actived" icon={iconSVG} />
|
|
392
|
+
</ExampleContainer>
|
|
393
|
+
<ExampleContainer>
|
|
394
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
395
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
396
|
+
<DxcButton mode="secondary" label="Secondary" icon={iconSVG} disabled />
|
|
397
|
+
</HalstackProvider>
|
|
398
|
+
</ExampleContainer>
|
|
399
|
+
<Title title="Text" theme="light" level={3} />
|
|
400
|
+
<ExampleContainer>
|
|
401
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
402
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
403
|
+
<DxcButton mode="text" label="Text" icon={iconSVG} />
|
|
404
|
+
</HalstackProvider>
|
|
405
|
+
</ExampleContainer>
|
|
406
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
407
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
408
|
+
<DxcButton mode="text" label="Text hovered" icon={iconSVG} />
|
|
409
|
+
</ExampleContainer>
|
|
410
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
411
|
+
<Title title="Focused" theme="light" level={4} />
|
|
412
|
+
<DxcButton mode="text" label="Text focused" icon={iconSVG} />
|
|
413
|
+
</ExampleContainer>
|
|
414
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
415
|
+
<Title title="Actived" theme="light" level={4} />
|
|
416
|
+
<DxcButton mode="text" label="Text actived" icon={iconSVG} />
|
|
417
|
+
</ExampleContainer>
|
|
418
|
+
<ExampleContainer>
|
|
419
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
420
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
421
|
+
<DxcButton mode="text" label="Text disabled" icon={iconSVG} disabled />
|
|
422
|
+
</HalstackProvider>
|
|
423
|
+
</ExampleContainer>
|
|
424
|
+
</>
|
|
425
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
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 _Button = _interopRequireDefault(require("./Button"));
|
|
10
|
+
|
|
11
|
+
describe("Button component tests", function () {
|
|
12
|
+
test("Button renders with correct text", function () {
|
|
13
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
14
|
+
label: "Button"
|
|
15
|
+
})),
|
|
16
|
+
getByText = _render.getByText;
|
|
17
|
+
|
|
18
|
+
expect(getByText("Button")).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
test("Calls correct function on click", function () {
|
|
21
|
+
var onClick = jest.fn();
|
|
22
|
+
|
|
23
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
24
|
+
label: "Button",
|
|
25
|
+
onClick: onClick
|
|
26
|
+
})),
|
|
27
|
+
getByText = _render2.getByText;
|
|
28
|
+
|
|
29
|
+
var button = getByText("Button");
|
|
30
|
+
|
|
31
|
+
_react2.fireEvent.click(button);
|
|
32
|
+
|
|
33
|
+
expect(onClick).toHaveBeenCalled();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
export declare type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
export declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
+
declare type Props = {
|
|
11
|
+
/**
|
|
12
|
+
* Text to be placed in the button.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The available button modes.
|
|
17
|
+
*/
|
|
18
|
+
mode?: "primary" | "secondary" | "text";
|
|
19
|
+
/**
|
|
20
|
+
* If true, the component will be disabled.
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the icon should appear after or before the label.
|
|
25
|
+
*/
|
|
26
|
+
iconPosition?: "before" | "after";
|
|
27
|
+
/**
|
|
28
|
+
* 'type' html prop of the button.
|
|
29
|
+
*/
|
|
30
|
+
type?: "button" | "reset" | "submit";
|
|
31
|
+
/**
|
|
32
|
+
* Element or path used as the icon that will be placed next to the label.
|
|
33
|
+
*/
|
|
34
|
+
icon?: string | SVG;
|
|
35
|
+
/**
|
|
36
|
+
* This function will be called when the user clicks the button.
|
|
37
|
+
*/
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
41
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
42
|
+
*/
|
|
43
|
+
margin?: Space | Margin;
|
|
44
|
+
/**
|
|
45
|
+
* Size of the component.
|
|
46
|
+
*/
|
|
47
|
+
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
48
|
+
/**
|
|
49
|
+
* Value of the tabindex attribute.
|
|
50
|
+
*/
|
|
51
|
+
tabIndex?: number;
|
|
52
|
+
};
|
|
53
|
+
export default Props;
|
package/button/types.js
ADDED
package/card/Card.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import CardPropsType from "./types";
|
|
3
|
+
declare const DxcCard: ({ imageSrc, imageBgColor, imagePadding, imagePosition, linkHref, onClick, imageCover, margin, contentPadding, tabIndex, outlined, children, }: CardPropsType) => JSX.Element;
|
|
4
|
+
export default DxcCard;
|