@dxc-technology/halstack-react 0.0.0-fcf16fe → 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/{dist/table → table}/Table.js +14 -24
- 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 -346
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.js +0 -188
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.js +0 -388
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/badge/Badge.js +0 -63
- package/dist/box/Box.js +0 -164
- package/dist/button/Button.js +0 -232
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/card/Card.js +0 -254
- package/dist/checkbox/Checkbox.js +0 -291
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/chip/Chip.js +0 -269
- package/dist/common/RequiredComponent.js +0 -40
- package/dist/common/variables.js +0 -1158
- package/dist/date/Date.js +0 -381
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.js +0 -235
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.js +0 -492
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.js +0 -405
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -431
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.js +0 -669
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/ApplicationLayout.js +0 -331
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/Link.js +0 -237
- package/dist/link/readme.md +0 -51
- package/dist/paginator/Paginator.js +0 -283
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/progress-bar/ProgressBar.js +0 -206
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.js +0 -209
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/resultsetTable/ResultsetTable.js +0 -358
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.js +0 -563
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/Sidenav.js +0 -183
- package/dist/slider/Slider.js +0 -315
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -214
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.js +0 -222
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/tag/Tag.js +0 -280
- package/dist/textarea/Textarea.js +0 -260
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -241
- package/dist/toggle-group/readme.md +0 -82
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -325
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/FileToUpload.js +0 -184
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -171
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Wizard.js +0 -411
- package/dist/wizard/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -393
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -130
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -240
- package/test/Link.test.js +0 -43
- package/test/Paginator.test.js +0 -177
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -192
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -27
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/ToggleGroup.test.js +0 -81
- package/test/Upload.test.js +0 -60
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
- /package/{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,315 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
6
|
+
|
|
7
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
|
|
11
|
+
var _react2 = require("@testing-library/react");
|
|
12
|
+
|
|
13
|
+
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
14
|
+
|
|
15
|
+
var _Paginator = _interopRequireDefault(require("./Paginator"));
|
|
16
|
+
|
|
17
|
+
// Mocking DOMRect for Radix Primitive Popover
|
|
18
|
+
global.globalThis = global;
|
|
19
|
+
global.DOMRect = {
|
|
20
|
+
fromRect: function fromRect() {
|
|
21
|
+
return {
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
bottom: 0,
|
|
25
|
+
right: 0,
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 0
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
global.ResizeObserver = /*#__PURE__*/function () {
|
|
33
|
+
function ResizeObserver() {
|
|
34
|
+
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
(0, _createClass2["default"])(ResizeObserver, [{
|
|
38
|
+
key: "observe",
|
|
39
|
+
value: function observe() {}
|
|
40
|
+
}, {
|
|
41
|
+
key: "unobserve",
|
|
42
|
+
value: function unobserve() {}
|
|
43
|
+
}, {
|
|
44
|
+
key: "disconnect",
|
|
45
|
+
value: function disconnect() {}
|
|
46
|
+
}]);
|
|
47
|
+
return ResizeObserver;
|
|
48
|
+
}();
|
|
49
|
+
|
|
50
|
+
global.DOMRect = {
|
|
51
|
+
fromRect: function fromRect() {
|
|
52
|
+
return {
|
|
53
|
+
top: 0,
|
|
54
|
+
left: 0,
|
|
55
|
+
bottom: 0,
|
|
56
|
+
right: 0,
|
|
57
|
+
width: 0,
|
|
58
|
+
height: 0
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
describe("Paginator component tests", function () {
|
|
63
|
+
test("Paginator renders with default values", function () {
|
|
64
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], null)),
|
|
65
|
+
getByText = _render.getByText;
|
|
66
|
+
|
|
67
|
+
expect(getByText("1 to 1 of 1")).toBeTruthy();
|
|
68
|
+
expect(getByText("Page: 1 of 1")).toBeTruthy();
|
|
69
|
+
});
|
|
70
|
+
test("Paginator renders with currentPage", function () {
|
|
71
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
72
|
+
currentPage: 2
|
|
73
|
+
})),
|
|
74
|
+
getByText = _render2.getByText;
|
|
75
|
+
|
|
76
|
+
expect(getByText("Page: 2 of 1")).toBeTruthy();
|
|
77
|
+
});
|
|
78
|
+
test("Paginator renders with itemsPerPageOptions", function () {
|
|
79
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
80
|
+
currentPage: 1,
|
|
81
|
+
itemsPerPage: 10,
|
|
82
|
+
itemsPerPageOptions: [10, 15],
|
|
83
|
+
totalItems: 20
|
|
84
|
+
})),
|
|
85
|
+
getByText = _render3.getByText;
|
|
86
|
+
|
|
87
|
+
expect(getByText("Items per page:")).toBeTruthy();
|
|
88
|
+
});
|
|
89
|
+
test("Paginator renders with itemsPerPageOptions", function () {
|
|
90
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
91
|
+
currentPage: 1,
|
|
92
|
+
itemsPerPage: 10,
|
|
93
|
+
totalItems: 20
|
|
94
|
+
})),
|
|
95
|
+
getByText = _render4.getByText;
|
|
96
|
+
|
|
97
|
+
expect(getByText("1 to 10 of 20")).toBeTruthy();
|
|
98
|
+
expect(getByText("Page: 1 of 2")).toBeTruthy();
|
|
99
|
+
});
|
|
100
|
+
test("Paginator renders with totalItems", function () {
|
|
101
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
102
|
+
totalItems: 20
|
|
103
|
+
})),
|
|
104
|
+
getByText = _render5.getByText;
|
|
105
|
+
|
|
106
|
+
expect(getByText("1 to 5 of 20")).toBeTruthy();
|
|
107
|
+
expect(getByText("Page: 1 of 4")).toBeTruthy();
|
|
108
|
+
});
|
|
109
|
+
test("Paginator renders with correct text in second page", function () {
|
|
110
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
111
|
+
currentPage: 2,
|
|
112
|
+
itemsPerPage: 10,
|
|
113
|
+
totalItems: 20
|
|
114
|
+
})),
|
|
115
|
+
getByText = _render6.getByText;
|
|
116
|
+
|
|
117
|
+
expect(getByText("11 to 20 of 20")).toBeTruthy();
|
|
118
|
+
expect(getByText("Page: 2 of 2")).toBeTruthy();
|
|
119
|
+
});
|
|
120
|
+
test("Paginator renders goToPage select", function () {
|
|
121
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
122
|
+
currentPage: 2,
|
|
123
|
+
showGoToPage: true,
|
|
124
|
+
itemsPerPage: 10,
|
|
125
|
+
totalItems: 20
|
|
126
|
+
})),
|
|
127
|
+
getByText = _render7.getByText;
|
|
128
|
+
|
|
129
|
+
expect(getByText("Go to page:")).toBeTruthy();
|
|
130
|
+
});
|
|
131
|
+
test("Paginator goToPage call correct function", function () {
|
|
132
|
+
var onClick = jest.fn();
|
|
133
|
+
|
|
134
|
+
window.HTMLElement.prototype.scrollIntoView = function () {};
|
|
135
|
+
|
|
136
|
+
window.HTMLElement.prototype.scrollTo = function () {};
|
|
137
|
+
|
|
138
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
139
|
+
currentPage: 1,
|
|
140
|
+
itemsPerPage: 10,
|
|
141
|
+
totalItems: 27,
|
|
142
|
+
showGoToPage: true,
|
|
143
|
+
onPageChange: onClick
|
|
144
|
+
})),
|
|
145
|
+
getByText = _render8.getByText,
|
|
146
|
+
getAllByRole = _render8.getAllByRole,
|
|
147
|
+
getByRole = _render8.getByRole;
|
|
148
|
+
|
|
149
|
+
var goToPageSelect = getAllByRole("combobox")[0];
|
|
150
|
+
(0, _react2.act)(function () {
|
|
151
|
+
_userEvent["default"].click(goToPageSelect);
|
|
152
|
+
});
|
|
153
|
+
var goToPageOption = getByText("2");
|
|
154
|
+
(0, _react2.act)(function () {
|
|
155
|
+
_userEvent["default"].click(goToPageOption);
|
|
156
|
+
});
|
|
157
|
+
expect(onClick).toHaveBeenCalledWith(2);
|
|
158
|
+
});
|
|
159
|
+
test("Call correct goToPageFunction", function () {
|
|
160
|
+
var onClick = jest.fn();
|
|
161
|
+
|
|
162
|
+
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
163
|
+
onPageChange: onClick,
|
|
164
|
+
currentPage: 1,
|
|
165
|
+
itemsPerPage: 10,
|
|
166
|
+
totalItems: 20
|
|
167
|
+
})),
|
|
168
|
+
getAllByRole = _render9.getAllByRole;
|
|
169
|
+
|
|
170
|
+
var nextButton = getAllByRole("button")[2];
|
|
171
|
+
|
|
172
|
+
_userEvent["default"].click(nextButton);
|
|
173
|
+
|
|
174
|
+
expect(onClick).toHaveBeenCalled();
|
|
175
|
+
});
|
|
176
|
+
test("Call correct itemsPerPageFunction", function () {
|
|
177
|
+
var onClick = jest.fn();
|
|
178
|
+
|
|
179
|
+
window.HTMLElement.prototype.scrollIntoView = function () {};
|
|
180
|
+
|
|
181
|
+
window.HTMLElement.prototype.scrollTo = function () {};
|
|
182
|
+
|
|
183
|
+
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
184
|
+
currentPage: 1,
|
|
185
|
+
itemsPerPage: 10,
|
|
186
|
+
itemsPerPageOptions: [10, 15],
|
|
187
|
+
itemsPerPageFunction: onClick,
|
|
188
|
+
totalItems: 20
|
|
189
|
+
})),
|
|
190
|
+
getAllByText = _render10.getAllByText,
|
|
191
|
+
getByText = _render10.getByText;
|
|
192
|
+
|
|
193
|
+
var select = getAllByText("10")[0];
|
|
194
|
+
(0, _react2.act)(function () {
|
|
195
|
+
_userEvent["default"].click(select);
|
|
196
|
+
});
|
|
197
|
+
var itemPerPageOption = getByText("15");
|
|
198
|
+
(0, _react2.act)(function () {
|
|
199
|
+
_userEvent["default"].click(itemPerPageOption);
|
|
200
|
+
});
|
|
201
|
+
expect(onClick).toHaveBeenCalledWith(15);
|
|
202
|
+
});
|
|
203
|
+
test("Next button is disable in last page", function () {
|
|
204
|
+
var onClick = jest.fn();
|
|
205
|
+
|
|
206
|
+
var _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
207
|
+
onPageChange: onClick,
|
|
208
|
+
currentPage: 2,
|
|
209
|
+
itemsPerPage: 10,
|
|
210
|
+
totalItems: 20
|
|
211
|
+
})),
|
|
212
|
+
getAllByRole = _render11.getAllByRole;
|
|
213
|
+
|
|
214
|
+
var nextButton = getAllByRole("button")[2];
|
|
215
|
+
expect(nextButton.hasAttribute("disabled")).toBeTruthy();
|
|
216
|
+
|
|
217
|
+
_userEvent["default"].click(nextButton);
|
|
218
|
+
|
|
219
|
+
expect(onClick).toHaveBeenCalledTimes(0);
|
|
220
|
+
});
|
|
221
|
+
test("Last button is disable in last page", function () {
|
|
222
|
+
var onClick = jest.fn();
|
|
223
|
+
|
|
224
|
+
var _render12 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
225
|
+
onPageChange: onClick,
|
|
226
|
+
currentPage: 2,
|
|
227
|
+
itemsPerPage: 10,
|
|
228
|
+
totalItems: 20
|
|
229
|
+
})),
|
|
230
|
+
getAllByRole = _render12.getAllByRole;
|
|
231
|
+
|
|
232
|
+
var lastButton = getAllByRole("button")[3];
|
|
233
|
+
expect(lastButton.hasAttribute("disabled")).toBeTruthy();
|
|
234
|
+
|
|
235
|
+
_userEvent["default"].click(lastButton);
|
|
236
|
+
|
|
237
|
+
expect(onClick).toHaveBeenCalledTimes(0);
|
|
238
|
+
});
|
|
239
|
+
test("First button is disable in first page", function () {
|
|
240
|
+
var onClick = jest.fn();
|
|
241
|
+
|
|
242
|
+
var _render13 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
243
|
+
onPageChange: onClick,
|
|
244
|
+
currentPage: 1,
|
|
245
|
+
itemsPerPage: 10,
|
|
246
|
+
totalItems: 20
|
|
247
|
+
})),
|
|
248
|
+
getAllByRole = _render13.getAllByRole;
|
|
249
|
+
|
|
250
|
+
var lastButton = getAllByRole("button")[0];
|
|
251
|
+
expect(lastButton.hasAttribute("disabled")).toBeTruthy();
|
|
252
|
+
|
|
253
|
+
_userEvent["default"].click(lastButton);
|
|
254
|
+
|
|
255
|
+
expect(onClick).toHaveBeenCalledTimes(0);
|
|
256
|
+
});
|
|
257
|
+
test("Previous button is disable in first page", function () {
|
|
258
|
+
var onClick = jest.fn();
|
|
259
|
+
|
|
260
|
+
var _render14 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
261
|
+
onPageChange: onClick,
|
|
262
|
+
currentPage: 1,
|
|
263
|
+
itemsPerPage: 10,
|
|
264
|
+
totalItems: 20
|
|
265
|
+
})),
|
|
266
|
+
getAllByRole = _render14.getAllByRole;
|
|
267
|
+
|
|
268
|
+
var lastButton = getAllByRole("button")[1];
|
|
269
|
+
expect(lastButton.hasAttribute("disabled")).toBeTruthy();
|
|
270
|
+
|
|
271
|
+
_userEvent["default"].click(lastButton);
|
|
272
|
+
|
|
273
|
+
expect(onClick).toHaveBeenCalledTimes(0);
|
|
274
|
+
});
|
|
275
|
+
test("Last and next buttons are disable in last page", function () {
|
|
276
|
+
var onClick = jest.fn();
|
|
277
|
+
|
|
278
|
+
var _render15 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
279
|
+
onPageChange: onClick,
|
|
280
|
+
currentPage: 2,
|
|
281
|
+
itemsPerPage: 10,
|
|
282
|
+
totalItems: 20
|
|
283
|
+
})),
|
|
284
|
+
getAllByRole = _render15.getAllByRole;
|
|
285
|
+
|
|
286
|
+
var firstButton = getAllByRole("button")[0];
|
|
287
|
+
var prevButton = getAllByRole("button")[1];
|
|
288
|
+
var nextButton = getAllByRole("button")[2];
|
|
289
|
+
var lastButton = getAllByRole("button")[3];
|
|
290
|
+
expect(firstButton.hasAttribute("disabled")).toBeFalsy();
|
|
291
|
+
expect(prevButton.hasAttribute("disabled")).toBeFalsy();
|
|
292
|
+
expect(nextButton.hasAttribute("disabled")).toBeTruthy();
|
|
293
|
+
expect(lastButton.hasAttribute("disabled")).toBeTruthy();
|
|
294
|
+
});
|
|
295
|
+
test("First and previous buttons are disable in first page", function () {
|
|
296
|
+
var onClick = jest.fn();
|
|
297
|
+
|
|
298
|
+
var _render16 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
299
|
+
onPageChange: onClick,
|
|
300
|
+
currentPage: 1,
|
|
301
|
+
itemsPerPage: 10,
|
|
302
|
+
totalItems: 20
|
|
303
|
+
})),
|
|
304
|
+
getAllByRole = _render16.getAllByRole;
|
|
305
|
+
|
|
306
|
+
var firstButton = getAllByRole("button")[0];
|
|
307
|
+
var prevButton = getAllByRole("button")[1];
|
|
308
|
+
var nextButton = getAllByRole("button")[2];
|
|
309
|
+
var lastButton = getAllByRole("button")[3];
|
|
310
|
+
expect(firstButton.hasAttribute("disabled")).toBeTruthy();
|
|
311
|
+
expect(prevButton.hasAttribute("disabled")).toBeTruthy();
|
|
312
|
+
expect(nextButton.hasAttribute("disabled")).toBeFalsy();
|
|
313
|
+
expect(lastButton.hasAttribute("disabled")).toBeFalsy();
|
|
314
|
+
});
|
|
315
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* Number of the current selected page.
|
|
4
|
+
*/
|
|
5
|
+
currentPage?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Number of items per page.
|
|
8
|
+
*/
|
|
9
|
+
itemsPerPage?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Array of numbers representing the items per page options.
|
|
12
|
+
* If undefined, the select with items per page options will not be displayed.
|
|
13
|
+
*/
|
|
14
|
+
itemsPerPageOptions?: number[];
|
|
15
|
+
/**
|
|
16
|
+
* This function will be called when the user selects an item per page option.
|
|
17
|
+
* The number will be passed as a parameter to this function.
|
|
18
|
+
*/
|
|
19
|
+
itemsPerPageFunction?: (val: number) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Total number of items in the pages.
|
|
22
|
+
*/
|
|
23
|
+
totalItems?: number;
|
|
24
|
+
/**
|
|
25
|
+
* If true, a select will be displayed with the page numbers to move through them.
|
|
26
|
+
*/
|
|
27
|
+
showGoToPage?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* This function will be called when the user clicks on any of the button to change pages.
|
|
30
|
+
* The page number will be passed as a parameter to this function.
|
|
31
|
+
*/
|
|
32
|
+
onPageChange?: (val: number) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Value of the tabindex attribute.
|
|
35
|
+
*/
|
|
36
|
+
tabIndex?: number;
|
|
37
|
+
};
|
|
38
|
+
export default Props;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
15
|
+
|
|
16
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
17
|
+
|
|
18
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
var Paragraph = function Paragraph(_ref) {
|
|
25
|
+
var children = _ref.children;
|
|
26
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
27
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
29
|
+
as: "p",
|
|
30
|
+
display: colorsTheme.paragraph.display,
|
|
31
|
+
fontSize: colorsTheme.paragraph.fontSize,
|
|
32
|
+
fontWeight: colorsTheme.paragraph.fontWeight,
|
|
33
|
+
color: backgroundType && backgroundType === "dark" ? colorsTheme.paragraph.fontColorOnDark : colorsTheme.paragraph.fontColor
|
|
34
|
+
}, children);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var _default = Paragraph;
|
|
38
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import DxcParagraph from "./Paragraph";
|
|
4
|
+
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Paragraph",
|
|
10
|
+
component: DxcParagraph,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Chromatic = () => (
|
|
14
|
+
<>
|
|
15
|
+
<ExampleContainer>
|
|
16
|
+
<Title title="Default Paragraph" level={4} />
|
|
17
|
+
<DxcParagraph>
|
|
18
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id tortor sit amet velit auctor cursus id eget
|
|
19
|
+
nisl. Vivamus luctus egestas eros, at mattis libero eleifend ac. Integer vel urna rutrum, pretium arcu
|
|
20
|
+
dignissim, fringilla turpis. Nullam luctus odio quis magna finibus, a pharetra magna euismod. Nullam efficitur
|
|
21
|
+
semper pellentesque. Nulla eget arcu ac diam fringilla vehicula. In imperdiet nisl hendrerit, elementum metus
|
|
22
|
+
eu, ornare risus. Aenean neque nibh, vestibulum vitae elit vel, imperdiet suscipit leo. Curabitur blandit
|
|
23
|
+
iaculis pretium. Fusce id imperdiet dui, ut laoreet justo. Sed maximus sollicitudin ipsum, et varius massa
|
|
24
|
+
condimentum eget. Vivamus id mauris et nisl mattis consequat et id lectus. Quisque mollis lacinia nisl.
|
|
25
|
+
Suspendisse sed quam tincidunt, commodo dolor vel, tincidunt nisl.
|
|
26
|
+
</DxcParagraph>
|
|
27
|
+
</ExampleContainer>
|
|
28
|
+
<BackgroundColorProvider color="#333333">
|
|
29
|
+
<DarkContainer>
|
|
30
|
+
<Title title="Default Paragraph" theme="dark" level={4} />
|
|
31
|
+
<DxcParagraph>
|
|
32
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id tortor sit amet velit auctor cursus id eget
|
|
33
|
+
nisl. Vivamus luctus egestas eros, at mattis libero eleifend ac. Integer vel urna rutrum, pretium arcu
|
|
34
|
+
dignissim, fringilla turpis. Nullam luctus odio quis magna finibus, a pharetra magna euismod. Nullam efficitur
|
|
35
|
+
semper pellentesque. Nulla eget arcu ac diam fringilla vehicula. In imperdiet nisl hendrerit, elementum metus
|
|
36
|
+
eu, ornare risus. Aenean neque nibh, vestibulum vitae elit vel, imperdiet suscipit leo. Curabitur blandit
|
|
37
|
+
iaculis pretium. Fusce id imperdiet dui, ut laoreet justo. Sed maximus sollicitudin ipsum, et varius massa
|
|
38
|
+
condimentum eget. Vivamus id mauris et nisl mattis consequat et id lectus. Quisque mollis lacinia nisl.
|
|
39
|
+
Suspendisse sed quam tincidunt, commodo dolor vel, tincidunt nisl.
|
|
40
|
+
</DxcParagraph>
|
|
41
|
+
</DarkContainer>
|
|
42
|
+
</BackgroundColorProvider>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
|
|
20
|
+
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
21
|
+
|
|
22
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
23
|
+
|
|
24
|
+
var _templateObject;
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
31
|
+
var label = _ref.label,
|
|
32
|
+
_ref$name = _ref.name,
|
|
33
|
+
name = _ref$name === void 0 ? "" : _ref$name,
|
|
34
|
+
value = _ref.value,
|
|
35
|
+
helperText = _ref.helperText,
|
|
36
|
+
_ref$clearable = _ref.clearable,
|
|
37
|
+
clearable = _ref$clearable === void 0 ? false : _ref$clearable,
|
|
38
|
+
onChange = _ref.onChange,
|
|
39
|
+
onBlur = _ref.onBlur,
|
|
40
|
+
error = _ref.error,
|
|
41
|
+
pattern = _ref.pattern,
|
|
42
|
+
minLength = _ref.minLength,
|
|
43
|
+
maxLength = _ref.maxLength,
|
|
44
|
+
_ref$autocomplete = _ref.autocomplete,
|
|
45
|
+
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
46
|
+
margin = _ref.margin,
|
|
47
|
+
_ref$size = _ref.size,
|
|
48
|
+
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
49
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
50
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
51
|
+
|
|
52
|
+
var _useState = (0, _react.useState)(false),
|
|
53
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
54
|
+
isPasswordVisible = _useState2[0],
|
|
55
|
+
setIsPasswordVisible = _useState2[1];
|
|
56
|
+
|
|
57
|
+
var inputRef = (0, _react.useRef)(null);
|
|
58
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
59
|
+
|
|
60
|
+
var setInputType = function setInputType(type) {
|
|
61
|
+
var _inputRef$current, _inputRef$current$chi;
|
|
62
|
+
|
|
63
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$chi = _inputRef$current.children[label && helperText ? 2 : label || helperText ? 1 : 0]) === null || _inputRef$current$chi === void 0 ? void 0 : _inputRef$current$chi.children[0].setAttribute("type", type);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var setAriaAttributes = function setAriaAttributes(ariaExpanded, ariaLabel) {
|
|
67
|
+
var inputIndex = label && helperText ? 2 : label || helperText ? 1 : 0;
|
|
68
|
+
|
|
69
|
+
if (error && clearable && value) {
|
|
70
|
+
var _inputRef$current2, _inputRef$current2$ch, _inputRef$current2$ch2, _inputRef$current3, _inputRef$current3$ch, _inputRef$current3$ch2;
|
|
71
|
+
|
|
72
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$ch = _inputRef$current2.children[inputIndex]) === null || _inputRef$current2$ch === void 0 ? void 0 : (_inputRef$current2$ch2 = _inputRef$current2$ch.children[3]) === null || _inputRef$current2$ch2 === void 0 ? void 0 : _inputRef$current2$ch2.setAttribute("aria-expanded", ariaExpanded);
|
|
73
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : (_inputRef$current3$ch = _inputRef$current3.children[inputIndex]) === null || _inputRef$current3$ch === void 0 ? void 0 : (_inputRef$current3$ch2 = _inputRef$current3$ch.children[3]) === null || _inputRef$current3$ch2 === void 0 ? void 0 : _inputRef$current3$ch2.setAttribute("aria-label", ariaLabel);
|
|
74
|
+
} else if (error || clearable && !value) {
|
|
75
|
+
var _inputRef$current4, _inputRef$current4$ch, _inputRef$current4$ch2, _inputRef$current5, _inputRef$current5$ch, _inputRef$current5$ch2;
|
|
76
|
+
|
|
77
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : (_inputRef$current4$ch = _inputRef$current4.children[inputIndex]) === null || _inputRef$current4$ch === void 0 ? void 0 : (_inputRef$current4$ch2 = _inputRef$current4$ch.children[2]) === null || _inputRef$current4$ch2 === void 0 ? void 0 : _inputRef$current4$ch2.setAttribute("aria-expanded", ariaExpanded);
|
|
78
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : (_inputRef$current5$ch = _inputRef$current5.children[inputIndex]) === null || _inputRef$current5$ch === void 0 ? void 0 : (_inputRef$current5$ch2 = _inputRef$current5$ch.children[2]) === null || _inputRef$current5$ch2 === void 0 ? void 0 : _inputRef$current5$ch2.setAttribute("aria-label", ariaLabel);
|
|
79
|
+
} else {
|
|
80
|
+
var _inputRef$current6, _inputRef$current6$ch, _inputRef$current6$ch2, _inputRef$current7, _inputRef$current7$ch, _inputRef$current7$ch2;
|
|
81
|
+
|
|
82
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : (_inputRef$current6$ch = _inputRef$current6.children[inputIndex]) === null || _inputRef$current6$ch === void 0 ? void 0 : (_inputRef$current6$ch2 = _inputRef$current6$ch.children[1]) === null || _inputRef$current6$ch2 === void 0 ? void 0 : _inputRef$current6$ch2.setAttribute("aria-expanded", ariaExpanded);
|
|
83
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current7 = inputRef.current) === null || _inputRef$current7 === void 0 ? void 0 : (_inputRef$current7$ch = _inputRef$current7.children[inputIndex]) === null || _inputRef$current7$ch === void 0 ? void 0 : (_inputRef$current7$ch2 = _inputRef$current7$ch.children[1]) === null || _inputRef$current7$ch2 === void 0 ? void 0 : _inputRef$current7$ch2.setAttribute("aria-label", ariaLabel);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
var getIconTitle = function getIconTitle() {
|
|
88
|
+
return isPasswordVisible ? translatedLabels.passwordInput.inputHidePasswordTitle : translatedLabels.passwordInput.inputShowPasswordTitle;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
(0, _react.useEffect)(function () {
|
|
92
|
+
setAriaAttributes(false, translatedLabels.passwordInput.inputShowPasswordTitle);
|
|
93
|
+
|
|
94
|
+
if (isPasswordVisible) {
|
|
95
|
+
setInputType("text");
|
|
96
|
+
setAriaAttributes(true, translatedLabels.passwordInput.inputHidePasswordTitle);
|
|
97
|
+
} else {
|
|
98
|
+
setInputType("password");
|
|
99
|
+
setAriaAttributes(false, translatedLabels.passwordInput.inputShowPasswordTitle);
|
|
100
|
+
}
|
|
101
|
+
}, [isPasswordVisible]);
|
|
102
|
+
|
|
103
|
+
var viewPassword = function viewPassword() {
|
|
104
|
+
setInputType("text");
|
|
105
|
+
setIsPasswordVisible(true);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var hidePassword = function hidePassword() {
|
|
109
|
+
setInputType("password");
|
|
110
|
+
setIsPasswordVisible(false);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var action = {
|
|
114
|
+
onClick: isPasswordVisible ? hidePassword : viewPassword,
|
|
115
|
+
icon: isPasswordVisible ? /*#__PURE__*/_react["default"].createElement("svg", {
|
|
116
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
+
height: "24px",
|
|
118
|
+
viewBox: "0 0 24 24",
|
|
119
|
+
width: "24px",
|
|
120
|
+
fill: "currentColor"
|
|
121
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
122
|
+
d: "M0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0z",
|
|
123
|
+
fill: "none"
|
|
124
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
125
|
+
d: "M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z"
|
|
126
|
+
})) : /*#__PURE__*/_react["default"].createElement("svg", {
|
|
127
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
128
|
+
height: "24px",
|
|
129
|
+
viewBox: "0 0 24 24",
|
|
130
|
+
width: "24px",
|
|
131
|
+
fill: "currentColor"
|
|
132
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
133
|
+
d: "M0 0h24v24H0V0z",
|
|
134
|
+
fill: "none"
|
|
135
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
136
|
+
d: "M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"
|
|
137
|
+
})),
|
|
138
|
+
title: getIconTitle()
|
|
139
|
+
};
|
|
140
|
+
return /*#__PURE__*/_react["default"].createElement(PasswordInput, {
|
|
141
|
+
ref: ref
|
|
142
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
143
|
+
ref: inputRef,
|
|
144
|
+
label: label,
|
|
145
|
+
name: name,
|
|
146
|
+
value: value,
|
|
147
|
+
helperText: helperText,
|
|
148
|
+
action: action,
|
|
149
|
+
error: error,
|
|
150
|
+
clearable: clearable,
|
|
151
|
+
onChange: onChange,
|
|
152
|
+
onBlur: onBlur,
|
|
153
|
+
margin: margin,
|
|
154
|
+
size: size,
|
|
155
|
+
pattern: pattern,
|
|
156
|
+
minLength: minLength,
|
|
157
|
+
maxLength: maxLength,
|
|
158
|
+
autocomplete: autocomplete,
|
|
159
|
+
tabIndex: tabIndex
|
|
160
|
+
}));
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
var PasswordInput = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n & ::-ms-reveal {\n display: none;\n }\n"])));
|
|
164
|
+
|
|
165
|
+
var _default = DxcPasswordInput;
|
|
166
|
+
exports["default"] = _default;
|