@dxc-technology/halstack-react 0.0.0-b915415 → 0.0.0-b94d9fc
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 +1 -0
- package/BackgroundColorContext.js +30 -0
- package/HalstackContext.d.ts +1249 -0
- package/HalstackContext.js +310 -0
- package/README.md +28 -47
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +182 -0
- package/accordion/Accordion.stories.tsx +283 -0
- package/accordion/Accordion.test.js +56 -0
- package/accordion/types.d.ts +57 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +8 -0
- package/accordion-group/AccordionGroup.js +101 -0
- package/accordion-group/AccordionGroup.stories.tsx +252 -0
- package/accordion-group/AccordionGroup.test.js +98 -0
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- package/accordion-group/types.d.ts +67 -0
- package/accordion-group/types.js +5 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +47 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/action-icon/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +55 -204
- package/alert/Alert.stories.tsx +198 -0
- package/alert/Alert.test.js +75 -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 +159 -0
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +54 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +43 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +75 -0
- package/box/Box.stories.tsx +119 -0
- package/box/Box.test.js +13 -0
- package/box/types.d.ts +32 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +89 -0
- package/bulleted-list/BulletedList.stories.tsx +115 -0
- package/bulleted-list/types.d.ts +38 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +120 -0
- package/button/Button.stories.tsx +344 -0
- package/button/Button.test.js +38 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +120 -0
- package/card/Card.stories.tsx +171 -0
- package/card/Card.test.js +39 -0
- package/card/types.d.ts +62 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/Checkbox.js +215 -0
- package/checkbox/Checkbox.stories.tsx +222 -0
- package/checkbox/Checkbox.test.js +199 -0
- package/checkbox/types.d.ts +72 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +121 -0
- package/chip/Chip.stories.tsx +214 -0
- package/chip/Chip.test.js +41 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/OpenSans.css +69 -0
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.d.ts +1 -0
- package/{dist/common → common}/utils.js +6 -12
- package/common/variables.d.ts +1395 -0
- package/common/variables.js +1267 -0
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +214 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +223 -0
- package/date-input/DateInput.stories.tsx +285 -0
- package/date-input/DateInput.test.js +808 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +115 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +58 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +100 -0
- package/date-input/types.d.ts +164 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +104 -0
- package/dialog/Dialog.stories.tsx +365 -0
- package/dialog/Dialog.test.js +307 -0
- package/dialog/types.d.ts +36 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +336 -0
- package/dropdown/Dropdown.stories.tsx +438 -0
- package/dropdown/Dropdown.test.js +599 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +63 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +67 -0
- package/dropdown/types.d.ts +98 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +479 -0
- package/file-input/FileInput.stories.tsx +618 -0
- package/file-input/FileInput.test.js +459 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +135 -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 +57 -0
- package/flex/Flex.stories.tsx +112 -0
- package/flex/types.d.ts +97 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +138 -0
- package/footer/Footer.stories.tsx +171 -0
- package/footer/Footer.test.js +85 -0
- package/footer/Icons.d.ts +3 -0
- package/footer/Icons.js +136 -0
- package/footer/types.d.ts +64 -0
- package/footer/types.js +5 -0
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +76 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.d.ts +8 -0
- package/header/Header.js +220 -0
- package/header/Header.stories.tsx +251 -0
- package/header/Header.test.js +66 -0
- package/header/Icons.d.ts +2 -0
- package/{dist/header → header}/Icons.js +9 -39
- package/header/types.d.ts +33 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +31 -124
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +169 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/image/Image.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +129 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +43 -0
- package/inset/Inset.stories.tsx +230 -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 +134 -0
- package/layout/ApplicationLayout.stories.tsx +162 -0
- package/layout/Icons.d.ts +8 -0
- package/layout/Icons.js +58 -0
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +13 -0
- package/layout/types.d.ts +41 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +115 -0
- package/link/Link.stories.tsx +253 -0
- package/link/Link.test.js +63 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +47 -0
- package/{dist/main.js → main.js} +123 -139
- package/nav-tabs/NavTabs.d.ts +8 -0
- package/nav-tabs/NavTabs.js +93 -0
- package/nav-tabs/NavTabs.stories.tsx +276 -0
- package/nav-tabs/NavTabs.test.js +76 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +118 -0
- package/nav-tabs/types.d.ts +52 -0
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.d.ts +11 -0
- package/number-input/NumberInput.js +86 -0
- package/number-input/NumberInput.stories.tsx +131 -0
- package/number-input/NumberInput.test.js +989 -0
- package/number-input/types.d.ts +130 -0
- package/number-input/types.js +5 -0
- package/package.json +56 -52
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +40 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +135 -0
- package/paginator/Paginator.stories.tsx +87 -0
- package/paginator/Paginator.test.js +335 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +5 -0
- package/paragraph/Paragraph.js +22 -0
- package/paragraph/Paragraph.stories.tsx +27 -0
- package/password-input/Icons.d.ts +6 -0
- package/password-input/Icons.js +35 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +97 -0
- package/password-input/PasswordInput.stories.tsx +99 -0
- package/password-input/PasswordInput.test.js +198 -0
- package/password-input/types.d.ts +111 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +144 -0
- package/progress-bar/ProgressBar.stories.tsx +93 -0
- package/progress-bar/ProgressBar.test.js +93 -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 +94 -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 +124 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +235 -0
- package/radio-group/RadioGroup.stories.tsx +214 -0
- package/radio-group/RadioGroup.test.js +756 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultset-table/Icons.d.ts +7 -0
- package/resultset-table/Icons.js +47 -0
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/resultset-table/ResultsetTable.js +166 -0
- package/resultset-table/ResultsetTable.stories.tsx +397 -0
- package/resultset-table/ResultsetTable.test.js +371 -0
- package/resultset-table/types.d.ts +73 -0
- package/resultset-table/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +89 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +143 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +87 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +590 -0
- package/select/Select.stories.tsx +971 -0
- package/select/Select.test.js +2370 -0
- package/select/types.d.ts +209 -0
- package/select/types.js +5 -0
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +47 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +196 -0
- package/sidenav/Sidenav.stories.tsx +282 -0
- package/sidenav/Sidenav.test.js +37 -0
- package/sidenav/types.d.ts +76 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +285 -0
- package/slider/Slider.test.js +254 -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 +206 -0
- package/spinner/Spinner.stories.tsx +129 -0
- package/spinner/Spinner.test.js +55 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +214 -0
- package/switch/Switch.stories.tsx +137 -0
- package/switch/Switch.test.js +180 -0
- package/switch/types.d.ts +66 -0
- package/switch/types.js +5 -0
- package/table/DropdownTheme.js +62 -0
- package/table/Table.d.ts +8 -0
- package/table/Table.js +170 -0
- package/table/Table.stories.tsx +658 -0
- package/table/Table.test.js +113 -0
- package/table/types.d.ts +63 -0
- package/table/types.js +5 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +116 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +384 -0
- package/tabs/Tabs.stories.tsx +226 -0
- package/tabs/Tabs.test.js +294 -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 +151 -0
- package/tag/Tag.stories.tsx +155 -0
- package/tag/Tag.test.js +49 -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 +56 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +67 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +84 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +565 -0
- package/text-input/TextInput.stories.tsx +465 -0
- package/text-input/TextInput.test.js +1756 -0
- package/text-input/types.d.ts +205 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +234 -0
- package/textarea/Textarea.stories.tsx +174 -0
- package/textarea/Textarea.test.js +406 -0
- package/textarea/types.d.ts +141 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +201 -0
- package/toggle-group/ToggleGroup.stories.tsx +218 -0
- package/toggle-group/ToggleGroup.test.js +137 -0
- package/toggle-group/types.d.ts +114 -0
- package/toggle-group/types.js +5 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +23 -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 +1148 -0
- package/{dist/useTheme.js → useTheme.js} +4 -11
- package/useTranslatedLabels.d.ts +85 -0
- package/useTranslatedLabels.js +14 -0
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +94 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +124 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +250 -0
- package/wizard/Wizard.stories.tsx +253 -0
- package/wizard/Wizard.test.js +114 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/babel.config.js +0 -7
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -250
- package/dist/V3Select/V3Select.js +0 -549
- package/dist/V3Select/index.d.ts +0 -27
- package/dist/V3Textarea/V3Textarea.js +0 -264
- package/dist/V3Textarea/index.d.ts +0 -27
- package/dist/accordion/Accordion.js +0 -353
- package/dist/accordion/index.d.ts +0 -28
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/accordion-group/index.d.ts +0 -16
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/box/Box.js +0 -156
- package/dist/box/index.d.ts +0 -25
- package/dist/button/Button.js +0 -238
- package/dist/button/Button.stories.js +0 -27
- package/dist/button/index.d.ts +0 -24
- package/dist/card/Card.js +0 -254
- package/dist/card/index.d.ts +0 -22
- package/dist/checkbox/Checkbox.js +0 -299
- package/dist/checkbox/index.d.ts +0 -24
- package/dist/chip/Chip.js +0 -265
- package/dist/chip/index.d.ts +0 -22
- package/dist/common/OpenSans.css +0 -81
- package/dist/common/RequiredComponent.js +0 -40
- package/dist/common/variables.js +0 -1574
- package/dist/date/Date.js +0 -379
- package/dist/date/index.d.ts +0 -27
- package/dist/date-input/DateInput.js +0 -400
- package/dist/date-input/index.d.ts +0 -95
- package/dist/dialog/Dialog.js +0 -218
- package/dist/dialog/index.d.ts +0 -18
- package/dist/dropdown/Dropdown.js +0 -544
- package/dist/dropdown/index.d.ts +0 -26
- package/dist/file-input/FileInput.js +0 -644
- package/dist/file-input/FileItem.js +0 -287
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -421
- package/dist/footer/Icons.js +0 -77
- package/dist/footer/index.d.ts +0 -25
- package/dist/header/Header.js +0 -470
- package/dist/header/index.d.ts +0 -25
- package/dist/heading/index.d.ts +0 -17
- package/dist/input-text/Icons.js +0 -22
- package/dist/input-text/InputText.js +0 -705
- package/dist/input-text/index.d.ts +0 -36
- package/dist/layout/ApplicationLayout.js +0 -327
- package/dist/layout/Icons.js +0 -55
- package/dist/link/Link.js +0 -237
- package/dist/link/index.d.ts +0 -23
- package/dist/main.d.ts +0 -40
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/NumberInputContext.js +0 -16
- package/dist/number-input/index.d.ts +0 -113
- package/dist/paginator/Icons.js +0 -66
- package/dist/paginator/Paginator.js +0 -305
- package/dist/paginator/index.d.ts +0 -20
- package/dist/password-input/PasswordInput.js +0 -203
- package/dist/password-input/index.d.ts +0 -94
- package/dist/progress-bar/ProgressBar.js +0 -242
- package/dist/progress-bar/index.d.ts +0 -18
- package/dist/radio/Radio.js +0 -209
- package/dist/radio/index.d.ts +0 -23
- package/dist/resultsetTable/ResultsetTable.js +0 -358
- package/dist/resultsetTable/index.d.ts +0 -19
- package/dist/select/Select.js +0 -1096
- package/dist/select/index.d.ts +0 -53
- package/dist/sidenav/Sidenav.js +0 -179
- package/dist/sidenav/index.d.ts +0 -13
- package/dist/slider/Slider.js +0 -404
- package/dist/slider/index.d.ts +0 -29
- package/dist/spinner/Spinner.js +0 -381
- package/dist/spinner/index.d.ts +0 -17
- package/dist/switch/Switch.js +0 -222
- package/dist/switch/index.d.ts +0 -24
- package/dist/table/Table.js +0 -132
- package/dist/table/index.d.ts +0 -13
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/index.d.ts +0 -19
- package/dist/tag/Tag.js +0 -282
- package/dist/tag/index.d.ts +0 -24
- package/dist/text-input/TextInput.js +0 -974
- package/dist/text-input/index.d.ts +0 -135
- package/dist/textarea/Textarea.js +0 -369
- package/dist/textarea/index.d.ts +0 -117
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/index.d.ts +0 -21
- package/dist/toggle-group/ToggleGroup.js +0 -327
- package/dist/toggle-group/index.d.ts +0 -21
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/buttons-upload/Icons.js +0 -40
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/dragAndDropArea/Icons.js +0 -39
- package/dist/upload/file-upload/FileToUpload.js +0 -189
- package/dist/upload/file-upload/Icons.js +0 -66
- package/dist/upload/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/index.d.ts +0 -15
- package/dist/upload/transaction/Icons.js +0 -160
- package/dist/upload/transaction/Transaction.js +0 -148
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Icons.js +0 -65
- package/dist/wizard/Wizard.js +0 -405
- package/dist/wizard/index.d.ts +0 -18
- 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 -395
- package/test/DateInput.test.js +0 -242
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/FileInput.test.js +0 -201
- package/test/Footer.test.js +0 -94
- package/test/Header.test.js +0 -34
- package/test/Heading.test.js +0 -83
- package/test/InputText.test.js +0 -239
- package/test/Link.test.js +0 -43
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -181
- package/test/PasswordInput.test.js +0 -83
- 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 -415
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -74
- package/test/Spinner.test.js +0 -32
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/Tag.test.js +0 -32
- package/test/TextInput.test.js +0 -732
- package/test/Textarea.test.js +0 -193
- package/test/ToggleGroup.test.js +0 -85
- package/test/Upload.test.js +0 -60
- package/test/V3Select.test.js +0 -212
- package/test/V3TextArea.test.js +0 -51
- 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}/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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
+
import DxcActionIcon from "./ActionIcon";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Action Icon ",
|
|
8
|
+
component: DxcActionIcon,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const iconSVG = (
|
|
12
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="currentColor">
|
|
13
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
14
|
+
<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" />
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const Chromatic = () => (
|
|
19
|
+
<>
|
|
20
|
+
<Title title="Default" theme="light" level={2} />
|
|
21
|
+
<ExampleContainer>
|
|
22
|
+
<DxcActionIcon icon={"https://www.freepnglogos.com/uploads/facebook-logo-design-1.png"} title="Favourite" />
|
|
23
|
+
</ExampleContainer>
|
|
24
|
+
<Title title="Disabled" theme="light" level={2} />
|
|
25
|
+
<ExampleContainer>
|
|
26
|
+
<DxcActionIcon icon={iconSVG} title="Favourite" disabled />
|
|
27
|
+
</ExampleContainer>
|
|
28
|
+
<Title title="Hover" theme="light" level={2} />
|
|
29
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
30
|
+
<DxcActionIcon icon={iconSVG} title="Favourite" />
|
|
31
|
+
</ExampleContainer>
|
|
32
|
+
<Title title="Focus" theme="light" level={2} />
|
|
33
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
34
|
+
<DxcActionIcon icon={iconSVG} title="Favourite" />
|
|
35
|
+
</ExampleContainer>
|
|
36
|
+
<Title title="Active" theme="light" level={2} />
|
|
37
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
38
|
+
<DxcActionIcon icon={iconSVG} title="Favourite" />
|
|
39
|
+
</ExampleContainer>
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
var _ActionIcon = _interopRequireDefault(require("./ActionIcon.tsx"));
|
|
7
|
+
var iconSVG = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
8
|
+
width: "24px",
|
|
9
|
+
height: "24px",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "currentColor"
|
|
12
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
13
|
+
d: "M0 0h24v24H0z",
|
|
14
|
+
fill: "none"
|
|
15
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
16
|
+
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"
|
|
17
|
+
}));
|
|
18
|
+
describe("Action icon component tests", function () {
|
|
19
|
+
test("Action icon renders with correct text", function () {
|
|
20
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
21
|
+
icon: iconSVG,
|
|
22
|
+
title: "favourite"
|
|
23
|
+
})),
|
|
24
|
+
getByTitle = _render.getByTitle;
|
|
25
|
+
expect(getByTitle("favourite")).toBeTruthy();
|
|
26
|
+
});
|
|
27
|
+
test("Calls correct function on click", function () {
|
|
28
|
+
var onClick = jest.fn();
|
|
29
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
30
|
+
icon: iconSVG,
|
|
31
|
+
title: "favourite",
|
|
32
|
+
onClick: onClick
|
|
33
|
+
})),
|
|
34
|
+
getByTitle = _render2.getByTitle;
|
|
35
|
+
var action = getByTitle("favourite");
|
|
36
|
+
_react2.fireEvent.click(action);
|
|
37
|
+
expect(onClick).toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
test("On click is not called when disabled", function () {
|
|
40
|
+
var onClick = jest.fn();
|
|
41
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
42
|
+
disabled: true,
|
|
43
|
+
icon: iconSVG,
|
|
44
|
+
title: "favourite",
|
|
45
|
+
onClick: onClick
|
|
46
|
+
})),
|
|
47
|
+
getByTitle = _render3.getByTitle;
|
|
48
|
+
var action = getByTitle("favourite");
|
|
49
|
+
_react2.fireEvent.click(action);
|
|
50
|
+
expect(onClick).toHaveBeenCalledTimes(0);
|
|
51
|
+
});
|
|
52
|
+
test("Renders with correct accessibility attributes", function () {
|
|
53
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
54
|
+
icon: iconSVG,
|
|
55
|
+
title: "favourite",
|
|
56
|
+
tabIndex: 1
|
|
57
|
+
})),
|
|
58
|
+
getByRole = _render4.getByRole;
|
|
59
|
+
var button = getByRole("button");
|
|
60
|
+
expect(button.getAttribute("aria-label")).toBe("favourite");
|
|
61
|
+
expect(button.getAttribute("title")).toBe("favourite");
|
|
62
|
+
expect(button.getAttribute("tabindex")).toBe("1");
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
3
|
+
type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* If true, the component will be disabled.
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Value for the HTML properties title and aria-label.
|
|
10
|
+
*/
|
|
11
|
+
title: string;
|
|
12
|
+
/**
|
|
13
|
+
* Element or path used as the icon that will be placed next to the label.
|
|
14
|
+
*/
|
|
15
|
+
icon: string | SVG;
|
|
16
|
+
/**
|
|
17
|
+
* This function will be called when the user clicks the button.
|
|
18
|
+
*/
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Value of the tabindex attribute.
|
|
22
|
+
*/
|
|
23
|
+
tabIndex?: number;
|
|
24
|
+
};
|
|
25
|
+
export type RefType = HTMLButtonElement;
|
|
26
|
+
export default Props;
|
package/alert/Alert.d.ts
ADDED
|
@@ -1,254 +1,133 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
-
|
|
18
11
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
-
|
|
20
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
|
-
|
|
30
|
-
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
31
|
-
|
|
32
|
-
function _templateObject10() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n border: 1px solid transparent;\n border-radius: 2px;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n margin-left: 12px;\n background-color: transparent;\n color: #000000;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject10 = function _templateObject10() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject9() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n padding: ", ";\n overflow-y: auto;\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject9 = function _templateObject9() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject8() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n align-items: center;\n overflow: hidden;\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject8 = function _templateObject8() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject7() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 12px;\n padding-right: ", ";\n padding-left: ", ";\n\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject7 = function _templateObject7() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject6() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 8px;\n padding-right: ", ";\n padding-left: ", ";\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
|
|
74
|
-
|
|
75
|
-
_templateObject6 = function _templateObject6() {
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject5() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 8px;\n padding-right: ", ";\n padding-left: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n"]);
|
|
84
|
-
|
|
85
|
-
_templateObject5 = function _templateObject5() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _templateObject4() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n height: calc(48px - calc(", " * 2));\n align-items: center;\n width: 100%;\n"]);
|
|
94
|
-
|
|
95
|
-
_templateObject4 = function _templateObject4() {
|
|
96
|
-
return data;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _templateObject3() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: ", ";\n overflow: hidden;\n box-sizing: border-box;\n\n background-color: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n\n padding-left: 12px;\n padding-right: 12px;\n justify-content: ", ";\n align-items: ", ";\n max-width: ", ";\n width: ", ";\n z-index: ", ";\n"]);
|
|
104
|
-
|
|
105
|
-
_templateObject3 = function _templateObject3() {
|
|
106
|
-
return data;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return data;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _templateObject2() {
|
|
113
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n"]);
|
|
114
|
-
|
|
115
|
-
_templateObject2 = function _templateObject2() {
|
|
116
|
-
return data;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return data;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _templateObject() {
|
|
123
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n width: ", ";\n height: ", ";\n justify-content: ", ";\n align-items: ", ";\n top: ", ";\n left: ", ";\n position: ", ";\n display: ", ";\n z-index: ", ";\n"]);
|
|
124
|
-
|
|
125
|
-
_templateObject = function _templateObject() {
|
|
126
|
-
return data;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return data;
|
|
130
|
-
}
|
|
131
|
-
|
|
13
|
+
var _variables = require("../common/variables");
|
|
14
|
+
var _utils = require("../common/utils");
|
|
15
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
16
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
17
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
132
20
|
var alertIcons = {
|
|
133
|
-
close: _react["default"].createElement("svg", {
|
|
21
|
+
close: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
134
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
135
23
|
width: "20",
|
|
136
24
|
height: "20",
|
|
137
25
|
viewBox: "0 0 24 24",
|
|
138
26
|
fill: "currentColor"
|
|
139
|
-
}, _react["default"].createElement("path", {
|
|
27
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
140
28
|
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
141
|
-
}), _react["default"].createElement("path", {
|
|
29
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
142
30
|
d: "M0 0h24v24H0z",
|
|
143
31
|
fill: "none"
|
|
144
32
|
})),
|
|
145
|
-
info: _react["default"].createElement("svg", {
|
|
33
|
+
info: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
146
34
|
xmlns: "http://www.w3.org/2000/svg",
|
|
147
35
|
width: "23",
|
|
148
36
|
height: "23",
|
|
149
37
|
viewBox: "0 0 24 24",
|
|
150
38
|
fill: "currentColor"
|
|
151
|
-
}, _react["default"].createElement("path", {
|
|
39
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
152
40
|
d: "M0 0h24v24H0z",
|
|
153
41
|
fill: "none"
|
|
154
|
-
}), _react["default"].createElement("path", {
|
|
42
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
155
43
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"
|
|
156
44
|
})),
|
|
157
|
-
success: _react["default"].createElement("svg", {
|
|
45
|
+
success: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
158
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
159
47
|
width: "23",
|
|
160
48
|
height: "23",
|
|
161
49
|
viewBox: "0 0 24 24",
|
|
162
50
|
fill: "currentColor"
|
|
163
|
-
}, _react["default"].createElement("path", {
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
164
52
|
d: "M0 0h24v24H0z",
|
|
165
53
|
fill: "none"
|
|
166
|
-
}), _react["default"].createElement("path", {
|
|
54
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
167
55
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
168
56
|
})),
|
|
169
|
-
warning: _react["default"].createElement("svg", {
|
|
57
|
+
warning: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
170
58
|
xmlns: "http://www.w3.org/2000/svg",
|
|
171
59
|
width: "23",
|
|
172
60
|
height: "23",
|
|
173
61
|
viewBox: "0 0 24 24",
|
|
174
62
|
fill: "currentColor"
|
|
175
|
-
}, _react["default"].createElement("path", {
|
|
63
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
176
64
|
d: "M0 0h24v24H0z",
|
|
177
65
|
fill: "none"
|
|
178
|
-
}), _react["default"].createElement("path", {
|
|
66
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
179
67
|
d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
|
|
180
68
|
})),
|
|
181
|
-
error: _react["default"].createElement("svg", {
|
|
69
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
182
70
|
xmlns: "http://www.w3.org/2000/svg",
|
|
183
71
|
width: "23",
|
|
184
72
|
height: "23",
|
|
185
73
|
viewBox: "0 0 24 24",
|
|
186
74
|
fill: "currentColor"
|
|
187
|
-
}, _react["default"].createElement("path", {
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
188
76
|
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",
|
|
189
77
|
fill: "currentColor"
|
|
190
|
-
}), _react["default"].createElement("path", {
|
|
78
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
191
79
|
d: "M0 0h24v24H0z",
|
|
192
80
|
fill: "none"
|
|
193
81
|
}))
|
|
194
82
|
};
|
|
195
|
-
|
|
196
83
|
var DxcAlert = function DxcAlert(_ref) {
|
|
197
84
|
var _ref$type = _ref.type,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
85
|
+
type = _ref$type === void 0 ? "info" : _ref$type,
|
|
86
|
+
_ref$mode = _ref.mode,
|
|
87
|
+
mode = _ref$mode === void 0 ? "inline" : _ref$mode,
|
|
88
|
+
_ref$inlineText = _ref.inlineText,
|
|
89
|
+
inlineText = _ref$inlineText === void 0 ? "" : _ref$inlineText,
|
|
90
|
+
onClose = _ref.onClose,
|
|
91
|
+
children = _ref.children,
|
|
92
|
+
margin = _ref.margin,
|
|
93
|
+
_ref$size = _ref.size,
|
|
94
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
95
|
+
tabIndex = _ref.tabIndex;
|
|
209
96
|
var colorsTheme = (0, _useTheme["default"])();
|
|
210
|
-
|
|
97
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
211
98
|
var getTypeText = function getTypeText() {
|
|
212
|
-
return type === "info" ?
|
|
99
|
+
return type === "info" ? translatedLabels.alert.infoTitleText : type === "confirm" ? translatedLabels.alert.successTitleText : type === "warning" ? translatedLabels.alert.warningTitleText : translatedLabels.alert.errorTitleText;
|
|
213
100
|
};
|
|
214
|
-
|
|
215
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
216
102
|
theme: colorsTheme.alert
|
|
217
|
-
}, _react["default"].createElement(AlertModal, {
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement(AlertModal, {
|
|
218
104
|
mode: mode
|
|
219
|
-
}, mode === "modal" && _react["default"].createElement(OverlayContainer, {
|
|
105
|
+
}, mode === "modal" && /*#__PURE__*/_react["default"].createElement(OverlayContainer, {
|
|
220
106
|
mode: mode,
|
|
221
107
|
onClick: onClose
|
|
222
|
-
}), _react["default"].createElement(AlertContainer, {
|
|
108
|
+
}), /*#__PURE__*/_react["default"].createElement(AlertContainer, {
|
|
223
109
|
mode: mode,
|
|
224
110
|
type: type,
|
|
225
111
|
margin: margin,
|
|
226
112
|
size: size
|
|
227
|
-
}, _react["default"].createElement(AlertInfo, null, _react["default"].createElement(AlertIcon, {
|
|
228
|
-
type: type
|
|
229
|
-
}, type === "info" && alertIcons.info || type === "confirm" && alertIcons.success || type === "warning" && alertIcons.warning || type === "error" && alertIcons.error), _react["default"].createElement(AlertText, null, _react["default"].createElement(AlertTitle, {
|
|
113
|
+
}, /*#__PURE__*/_react["default"].createElement(AlertInfo, null, /*#__PURE__*/_react["default"].createElement(AlertIcon, {
|
|
230
114
|
type: type
|
|
231
|
-
}, getTypeText(
|
|
115
|
+
}, type === "info" && alertIcons.info || type === "confirm" && alertIcons.success || type === "warning" && alertIcons.warning || type === "error" && alertIcons.error), /*#__PURE__*/_react["default"].createElement(AlertText, null, /*#__PURE__*/_react["default"].createElement(AlertTitle, null, getTypeText()), inlineText && inlineText !== "" && "-", /*#__PURE__*/_react["default"].createElement(AlertInlineText, null, inlineText)), onClose && /*#__PURE__*/_react["default"].createElement(AlertCloseAction, {
|
|
232
116
|
onClick: onClose,
|
|
233
117
|
tabIndex: tabIndex
|
|
234
|
-
}, alertIcons.close)), children && _react["default"].createElement(AlertContent, null,
|
|
235
|
-
color: type === "info" && colorsTheme.alert.infoBackgroundColor || type === "confirm" && colorsTheme.alert.successBackgroundColor || type === "warning" && colorsTheme.alert.warningBackgroundColor || type === "error" && colorsTheme.alert.errorBackgroundColor
|
|
236
|
-
}, children)))));
|
|
118
|
+
}, alertIcons.close)), children && /*#__PURE__*/_react["default"].createElement(AlertContent, null, children))));
|
|
237
119
|
};
|
|
238
|
-
|
|
239
120
|
var sizes = {
|
|
240
121
|
small: "280px",
|
|
241
122
|
medium: "480px",
|
|
242
123
|
large: "820px",
|
|
243
124
|
fillParent: "100%",
|
|
244
|
-
fitContent: "
|
|
125
|
+
fitContent: "fit-content"
|
|
245
126
|
};
|
|
246
|
-
|
|
247
127
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
248
128
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
249
129
|
};
|
|
250
|
-
|
|
251
|
-
var AlertModal = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
130
|
+
var AlertModal = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n width: ", ";\n height: ", ";\n justify-content: ", ";\n align-items: ", ";\n top: ", ";\n left: ", ";\n position: ", ";\n display: ", ";\n z-index: ", ";\n"])), function (props) {
|
|
252
131
|
return props.theme.fontSizeBase;
|
|
253
132
|
}, function (props) {
|
|
254
133
|
return props.mode === "modal" ? "100%" : "";
|
|
@@ -269,8 +148,7 @@ var AlertModal = _styledComponents["default"].div(_templateObject(), function (p
|
|
|
269
148
|
}, function (props) {
|
|
270
149
|
return props.mode === "modal" ? "1200" : "";
|
|
271
150
|
});
|
|
272
|
-
|
|
273
|
-
var OverlayContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
151
|
+
var OverlayContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n"])), function (props) {
|
|
274
152
|
return props.mode === "modal" ? "".concat(props.theme.overlayColor) : "transparent";
|
|
275
153
|
}, function (props) {
|
|
276
154
|
return props.mode === "modal" ? "fixed" : "";
|
|
@@ -283,8 +161,7 @@ var OverlayContainer = _styledComponents["default"].div(_templateObject2(), func
|
|
|
283
161
|
}, function (props) {
|
|
284
162
|
return props.mode === "modal" ? "0" : "";
|
|
285
163
|
});
|
|
286
|
-
|
|
287
|
-
var AlertContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
164
|
+
var AlertContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: ", ";\n overflow: hidden;\n box-sizing: border-box;\n\n background-color: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n\n padding-left: 12px;\n padding-right: 12px;\n justify-content: ", ";\n align-items: ", ";\n max-width: ", ";\n width: ", ";\n z-index: ", ";\n"])), function (props) {
|
|
288
165
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
289
166
|
}, function (props) {
|
|
290
167
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -317,12 +194,10 @@ var AlertContainer = _styledComponents["default"].div(_templateObject3(), functi
|
|
|
317
194
|
}, function (props) {
|
|
318
195
|
return props.mode === "modal" ? "1300" : "";
|
|
319
196
|
});
|
|
320
|
-
|
|
321
|
-
var AlertInfo = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
197
|
+
var AlertInfo = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n height: calc(48px - calc(", " * 2));\n align-items: center;\n width: 100%;\n"])), function (props) {
|
|
322
198
|
return props.theme.borderThickness;
|
|
323
199
|
});
|
|
324
|
-
|
|
325
|
-
var AlertTitle = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
200
|
+
var AlertTitle = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 8px;\n padding-right: ", ";\n padding-left: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n"])), function (props) {
|
|
326
201
|
return props.theme.titlePaddingRight;
|
|
327
202
|
}, function (props) {
|
|
328
203
|
return props.theme.titlePaddingLeft;
|
|
@@ -339,8 +214,7 @@ var AlertTitle = _styledComponents["default"].div(_templateObject5(), function (
|
|
|
339
214
|
}, function (props) {
|
|
340
215
|
return props.theme.titleTextTransform;
|
|
341
216
|
});
|
|
342
|
-
|
|
343
|
-
var AlertInlineText = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
217
|
+
var AlertInlineText = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 8px;\n padding-right: ", ";\n padding-left: ", ";\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (props) {
|
|
344
218
|
return props.theme.inlineTextPaddingRight;
|
|
345
219
|
}, function (props) {
|
|
346
220
|
return props.theme.inlineTextPaddingLeft;
|
|
@@ -355,8 +229,7 @@ var AlertInlineText = _styledComponents["default"].div(_templateObject6(), funct
|
|
|
355
229
|
}, function (props) {
|
|
356
230
|
return props.theme.inlineTextFontColor;
|
|
357
231
|
});
|
|
358
|
-
|
|
359
|
-
var AlertIcon = _styledComponents["default"].span(_templateObject7(), function (props) {
|
|
232
|
+
var AlertIcon = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 12px;\n padding-right: ", ";\n padding-left: ", ";\n\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
|
|
360
233
|
return props.theme.iconPaddingRight;
|
|
361
234
|
}, function (props) {
|
|
362
235
|
return props.theme.iconPaddingLeft;
|
|
@@ -367,37 +240,15 @@ var AlertIcon = _styledComponents["default"].span(_templateObject7(), function (
|
|
|
367
240
|
}, function (props) {
|
|
368
241
|
return props.theme.iconSize;
|
|
369
242
|
});
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
|
|
373
|
-
var AlertContent = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
243
|
+
var AlertText = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n align-items: center;\n overflow: hidden;\n"])));
|
|
244
|
+
var AlertContent = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n padding: ", ";\n overflow-y: auto;\n"])), function (props) {
|
|
374
245
|
return "".concat(props.theme.contentPaddingTop, " ").concat(props.theme.contentPaddingRight, " ").concat(props.theme.contentPaddingBottom, " ").concat(props.theme.contentPaddingLeft);
|
|
375
246
|
});
|
|
376
|
-
|
|
377
|
-
var AlertCloseAction = _styledComponents["default"].button(_templateObject10(), function (props) {
|
|
247
|
+
var AlertCloseAction = _styledComponents["default"].button(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n border: 1px solid transparent;\n border-radius: 2px;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n margin-left: 12px;\n background-color: transparent;\n color: #000000;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n &:focus,\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
378
248
|
return props.theme.hoverActionBackgroundColor;
|
|
379
249
|
}, function (props) {
|
|
380
250
|
return props.theme.focusActionBorderColor;
|
|
381
|
-
}, function (props) {
|
|
382
|
-
return props.theme.focusActionBorderColor;
|
|
383
251
|
}, function (props) {
|
|
384
252
|
return props.theme.activeActionBackgroundColor;
|
|
385
253
|
});
|
|
386
|
-
|
|
387
|
-
DxcAlert.propTypes = {
|
|
388
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
389
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
390
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
391
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
392
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
393
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
394
|
-
type: _propTypes["default"].oneOf(["info", "confirm", "warning", "error"]),
|
|
395
|
-
mode: _propTypes["default"].oneOf(["inline", "modal"]),
|
|
396
|
-
inlineText: _propTypes["default"].string,
|
|
397
|
-
onClose: _propTypes["default"].func,
|
|
398
|
-
children: _propTypes["default"].element,
|
|
399
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
400
|
-
tabIndex: _propTypes["default"].number
|
|
401
|
-
};
|
|
402
|
-
var _default = DxcAlert;
|
|
403
|
-
exports["default"] = _default;
|
|
254
|
+
var _default = exports["default"] = DxcAlert;
|