@dxc-technology/halstack-react 12.1.0 → 13.0.0
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/README.md +1 -1
- package/dist/index.d.mts +6439 -0
- package/dist/index.d.ts +6439 -0
- package/dist/index.js +12617 -0
- package/dist/index.mjs +12529 -0
- package/package.json +59 -63
- package/BackgroundColorContext.d.ts +0 -1
- package/BackgroundColorContext.js +0 -30
- package/HalstackContext.d.ts +0 -1246
- package/HalstackContext.js +0 -310
- package/accordion/Accordion.accessibility.test.d.ts +0 -1
- package/accordion/Accordion.accessibility.test.js +0 -71
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -168
- package/accordion/Accordion.stories.tsx +0 -241
- package/accordion/Accordion.test.d.ts +0 -1
- package/accordion/Accordion.test.js +0 -56
- package/accordion/types.d.ts +0 -57
- package/accordion/types.js +0 -5
- package/accordion-group/AccordionGroup.accessibility.test.d.ts +0 -1
- package/accordion-group/AccordionGroup.accessibility.test.js +0 -82
- package/accordion-group/AccordionGroup.d.ts +0 -7
- package/accordion-group/AccordionGroup.js +0 -101
- package/accordion-group/AccordionGroup.stories.tsx +0 -252
- package/accordion-group/AccordionGroup.test.d.ts +0 -1
- package/accordion-group/AccordionGroup.test.js +0 -94
- package/accordion-group/AccordionGroupAccordion.d.ts +0 -4
- package/accordion-group/AccordionGroupAccordion.js +0 -31
- package/accordion-group/AccordionGroupContext.d.ts +0 -3
- package/accordion-group/AccordionGroupContext.js +0 -8
- package/accordion-group/types.d.ts +0 -67
- package/accordion-group/types.js +0 -5
- package/action-icon/ActionIcon.accessibility.test.d.ts +0 -1
- package/action-icon/ActionIcon.accessibility.test.js +0 -63
- package/action-icon/ActionIcon.d.ts +0 -4
- package/action-icon/ActionIcon.js +0 -48
- package/action-icon/ActionIcon.stories.tsx +0 -41
- package/action-icon/ActionIcon.test.d.ts +0 -1
- package/action-icon/ActionIcon.test.js +0 -64
- package/action-icon/types.d.ts +0 -26
- package/action-icon/types.js +0 -5
- package/alert/Alert.accessibility.test.d.ts +0 -1
- package/alert/Alert.accessibility.test.js +0 -95
- package/alert/Alert.d.ts +0 -4
- package/alert/Alert.js +0 -203
- package/alert/Alert.stories.tsx +0 -198
- package/alert/Alert.test.d.ts +0 -1
- package/alert/Alert.test.js +0 -75
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- package/badge/Badge.accessibility.test.d.ts +0 -1
- package/badge/Badge.accessibility.test.js +0 -129
- package/badge/Badge.d.ts +0 -4
- package/badge/Badge.js +0 -161
- package/badge/Badge.stories.tsx +0 -210
- package/badge/Badge.test.d.ts +0 -1
- package/badge/Badge.test.js +0 -30
- package/badge/types.d.ts +0 -54
- package/badge/types.js +0 -5
- package/bleed/Bleed.d.ts +0 -3
- package/bleed/Bleed.js +0 -43
- package/bleed/Bleed.stories.tsx +0 -342
- package/bleed/types.d.ts +0 -37
- package/bleed/types.js +0 -5
- package/box/Box.accessibility.test.d.ts +0 -1
- package/box/Box.accessibility.test.js +0 -33
- package/box/Box.d.ts +0 -4
- package/box/Box.js +0 -75
- package/box/Box.stories.tsx +0 -119
- package/box/Box.test.d.ts +0 -1
- package/box/Box.test.js +0 -13
- package/box/types.d.ts +0 -32
- package/box/types.js +0 -5
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +0 -1
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +0 -96
- package/breadcrumbs/Breadcrumbs.d.ts +0 -4
- package/breadcrumbs/Breadcrumbs.js +0 -79
- package/breadcrumbs/Breadcrumbs.stories.tsx +0 -194
- package/breadcrumbs/Breadcrumbs.test.d.ts +0 -1
- package/breadcrumbs/Breadcrumbs.test.js +0 -168
- package/breadcrumbs/Item.d.ts +0 -4
- package/breadcrumbs/Item.js +0 -52
- package/breadcrumbs/dropdownTheme.d.ts +0 -53
- package/breadcrumbs/dropdownTheme.js +0 -62
- package/breadcrumbs/types.d.ts +0 -16
- package/breadcrumbs/types.js +0 -5
- package/bulleted-list/BulletedList.accessibility.test.d.ts +0 -1
- package/bulleted-list/BulletedList.accessibility.test.js +0 -119
- package/bulleted-list/BulletedList.d.ts +0 -7
- package/bulleted-list/BulletedList.js +0 -92
- package/bulleted-list/BulletedList.stories.tsx +0 -115
- package/bulleted-list/types.d.ts +0 -38
- package/bulleted-list/types.js +0 -5
- package/button/Button.accessibility.test.d.ts +0 -1
- package/button/Button.accessibility.test.js +0 -127
- package/button/Button.d.ts +0 -4
- package/button/Button.js +0 -121
- package/button/Button.stories.tsx +0 -325
- package/button/Button.test.d.ts +0 -1
- package/button/Button.test.js +0 -38
- package/button/types.d.ts +0 -57
- package/button/types.js +0 -5
- package/card/Card.accessibility.test.d.ts +0 -1
- package/card/Card.accessibility.test.js +0 -36
- package/card/Card.d.ts +0 -4
- package/card/Card.js +0 -121
- package/card/Card.stories.tsx +0 -171
- package/card/Card.test.d.ts +0 -1
- package/card/Card.test.js +0 -39
- package/card/types.d.ts +0 -62
- package/card/types.js +0 -5
- package/checkbox/Checkbox.accessibility.test.d.ts +0 -1
- package/checkbox/Checkbox.accessibility.test.js +0 -87
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -212
- package/checkbox/Checkbox.stories.tsx +0 -222
- package/checkbox/Checkbox.test.d.ts +0 -1
- package/checkbox/Checkbox.test.js +0 -199
- package/checkbox/types.d.ts +0 -72
- package/checkbox/types.js +0 -5
- package/chip/Chip.accessibility.test.d.ts +0 -1
- package/chip/Chip.accessibility.test.js +0 -67
- package/chip/Chip.d.ts +0 -4
- package/chip/Chip.js +0 -126
- package/chip/Chip.stories.tsx +0 -195
- package/chip/Chip.test.d.ts +0 -1
- package/chip/Chip.test.js +0 -41
- package/chip/types.d.ts +0 -45
- package/chip/types.js +0 -5
- package/common/coreTokens.d.ts +0 -237
- package/common/coreTokens.js +0 -184
- package/common/utils.d.ts +0 -1
- package/common/utils.js +0 -16
- package/common/variables.d.ts +0 -1392
- package/common/variables.js +0 -1264
- package/container/Container.d.ts +0 -4
- package/container/Container.js +0 -194
- package/container/Container.stories.tsx +0 -214
- package/container/types.d.ts +0 -74
- package/container/types.js +0 -5
- package/contextual-menu/ContextualMenu.accessibility.test.d.ts +0 -1
- package/contextual-menu/ContextualMenu.accessibility.test.js +0 -98
- package/contextual-menu/ContextualMenu.d.ts +0 -5
- package/contextual-menu/ContextualMenu.js +0 -108
- package/contextual-menu/ContextualMenu.stories.tsx +0 -223
- package/contextual-menu/ContextualMenu.test.d.ts +0 -1
- package/contextual-menu/ContextualMenu.test.js +0 -247
- package/contextual-menu/GroupItem.d.ts +0 -4
- package/contextual-menu/GroupItem.js +0 -67
- package/contextual-menu/ItemAction.d.ts +0 -4
- package/contextual-menu/ItemAction.js +0 -50
- package/contextual-menu/MenuItem.d.ts +0 -4
- package/contextual-menu/MenuItem.js +0 -29
- package/contextual-menu/SingleItem.d.ts +0 -4
- package/contextual-menu/SingleItem.js +0 -38
- package/contextual-menu/types.d.ts +0 -61
- package/contextual-menu/types.js +0 -5
- package/date-input/Calendar.d.ts +0 -4
- package/date-input/Calendar.js +0 -230
- package/date-input/DateInput.accessibility.test.d.ts +0 -1
- package/date-input/DateInput.accessibility.test.js +0 -229
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -228
- package/date-input/DateInput.stories.tsx +0 -291
- package/date-input/DateInput.test.d.ts +0 -1
- package/date-input/DateInput.test.js +0 -808
- package/date-input/DatePicker.d.ts +0 -4
- package/date-input/DatePicker.js +0 -121
- package/date-input/YearPicker.d.ts +0 -4
- package/date-input/YearPicker.js +0 -105
- package/date-input/types.d.ts +0 -164
- package/date-input/types.js +0 -5
- package/dialog/Dialog.accessibility.test.d.ts +0 -1
- package/dialog/Dialog.accessibility.test.js +0 -69
- package/dialog/Dialog.d.ts +0 -4
- package/dialog/Dialog.js +0 -93
- package/dialog/Dialog.stories.tsx +0 -369
- package/dialog/Dialog.test.d.ts +0 -1
- package/dialog/Dialog.test.js +0 -370
- package/dialog/types.d.ts +0 -36
- package/dialog/types.js +0 -5
- package/divider/Divider.accessibility.test.d.ts +0 -1
- package/divider/Divider.accessibility.test.js +0 -33
- package/divider/Divider.d.ts +0 -4
- package/divider/Divider.js +0 -36
- package/divider/Divider.stories.tsx +0 -223
- package/divider/Divider.test.d.ts +0 -1
- package/divider/Divider.test.js +0 -38
- package/divider/types.d.ts +0 -21
- package/divider/types.js +0 -5
- package/dropdown/Dropdown.accessibility.test.d.ts +0 -1
- package/dropdown/Dropdown.accessibility.test.js +0 -183
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -320
- package/dropdown/Dropdown.stories.tsx +0 -427
- package/dropdown/Dropdown.test.d.ts +0 -1
- package/dropdown/Dropdown.test.js +0 -628
- package/dropdown/DropdownMenu.d.ts +0 -4
- package/dropdown/DropdownMenu.js +0 -63
- package/dropdown/DropdownMenuItem.d.ts +0 -4
- package/dropdown/DropdownMenuItem.js +0 -71
- package/dropdown/types.d.ts +0 -96
- package/dropdown/types.js +0 -5
- package/file-input/FileInput.accessibility.test.d.ts +0 -1
- package/file-input/FileInput.accessibility.test.js +0 -167
- package/file-input/FileInput.d.ts +0 -4
- package/file-input/FileInput.js +0 -438
- package/file-input/FileInput.stories.tsx +0 -618
- package/file-input/FileInput.test.d.ts +0 -1
- package/file-input/FileInput.test.js +0 -404
- package/file-input/FileItem.d.ts +0 -4
- package/file-input/FileItem.js +0 -125
- package/file-input/types.d.ts +0 -125
- package/file-input/types.js +0 -5
- package/flex/Flex.d.ts +0 -4
- package/flex/Flex.js +0 -57
- package/flex/Flex.stories.tsx +0 -112
- package/flex/types.d.ts +0 -97
- package/flex/types.js +0 -5
- package/footer/Footer.accessibility.test.d.ts +0 -1
- package/footer/Footer.accessibility.test.js +0 -125
- package/footer/Footer.d.ts +0 -4
- package/footer/Footer.js +0 -140
- package/footer/Footer.stories.tsx +0 -208
- package/footer/Footer.test.d.ts +0 -1
- package/footer/Footer.test.js +0 -85
- package/footer/Icons.d.ts +0 -3
- package/footer/Icons.js +0 -108
- package/footer/types.d.ts +0 -64
- package/footer/types.js +0 -5
- package/grid/Grid.d.ts +0 -7
- package/grid/Grid.js +0 -76
- package/grid/Grid.stories.tsx +0 -221
- package/grid/types.d.ts +0 -115
- package/grid/types.js +0 -5
- package/header/Header.accessibility.test.d.ts +0 -1
- package/header/Header.accessibility.test.js +0 -94
- package/header/Header.d.ts +0 -8
- package/header/Header.js +0 -210
- package/header/Header.stories.tsx +0 -267
- package/header/Header.test.d.ts +0 -1
- package/header/Header.test.js +0 -66
- package/header/Icons.d.ts +0 -2
- package/header/Icons.js +0 -24
- package/header/types.d.ts +0 -33
- package/header/types.js +0 -5
- package/heading/Heading.accessibility.test.d.ts +0 -1
- package/heading/Heading.accessibility.test.js +0 -33
- package/heading/Heading.d.ts +0 -4
- package/heading/Heading.js +0 -137
- package/heading/Heading.stories.tsx +0 -54
- package/heading/Heading.test.d.ts +0 -1
- package/heading/Heading.test.js +0 -156
- package/heading/types.d.ts +0 -33
- package/heading/types.js +0 -5
- package/icon/Icon.accessibility.test.d.ts +0 -1
- package/icon/Icon.accessibility.test.js +0 -30
- package/icon/Icon.d.ts +0 -4
- package/icon/Icon.js +0 -33
- package/icon/Icon.stories.tsx +0 -28
- package/icon/types.d.ts +0 -4
- package/icon/types.js +0 -5
- package/image/Image.accessibility.test.d.ts +0 -1
- package/image/Image.accessibility.test.js +0 -56
- package/image/Image.d.ts +0 -4
- package/image/Image.js +0 -70
- package/image/Image.stories.tsx +0 -129
- package/image/types.d.ts +0 -72
- package/image/types.js +0 -5
- package/inset/Inset.d.ts +0 -3
- package/inset/Inset.js +0 -43
- package/inset/Inset.stories.tsx +0 -230
- package/inset/types.d.ts +0 -37
- package/inset/types.js +0 -5
- package/layout/ApplicationLayout.d.ts +0 -20
- package/layout/ApplicationLayout.js +0 -137
- package/layout/ApplicationLayout.stories.tsx +0 -162
- package/layout/Icons.d.ts +0 -7
- package/layout/Icons.js +0 -48
- package/layout/types.d.ts +0 -41
- package/layout/types.js +0 -5
- package/link/Link.accessibility.test.d.ts +0 -1
- package/link/Link.accessibility.test.js +0 -108
- package/link/Link.d.ts +0 -4
- package/link/Link.js +0 -117
- package/link/Link.stories.tsx +0 -253
- package/link/Link.test.d.ts +0 -1
- package/link/Link.test.js +0 -63
- package/link/types.d.ts +0 -54
- package/link/types.js +0 -5
- package/main.d.ts +0 -50
- package/main.js +0 -364
- package/nav-tabs/NavTabs.accessibility.test.d.ts +0 -1
- package/nav-tabs/NavTabs.accessibility.test.js +0 -44
- package/nav-tabs/NavTabs.d.ts +0 -7
- package/nav-tabs/NavTabs.js +0 -108
- package/nav-tabs/NavTabs.stories.tsx +0 -294
- package/nav-tabs/NavTabs.test.d.ts +0 -1
- package/nav-tabs/NavTabs.test.js +0 -77
- package/nav-tabs/NavTabsContext.d.ts +0 -3
- package/nav-tabs/NavTabsContext.js +0 -8
- package/nav-tabs/Tab.d.ts +0 -4
- package/nav-tabs/Tab.js +0 -117
- package/nav-tabs/types.d.ts +0 -52
- package/nav-tabs/types.js +0 -5
- package/number-input/NumberInput.accessibility.test.d.ts +0 -1
- package/number-input/NumberInput.accessibility.test.js +0 -227
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -86
- package/number-input/NumberInput.stories.tsx +0 -117
- package/number-input/NumberInput.test.d.ts +0 -1
- package/number-input/NumberInput.test.js +0 -988
- package/number-input/NumberInputContext.d.ts +0 -3
- package/number-input/NumberInputContext.js +0 -8
- package/number-input/types.d.ts +0 -136
- package/number-input/types.js +0 -5
- package/paginator/Paginator.accessibility.test.d.ts +0 -1
- package/paginator/Paginator.accessibility.test.js +0 -78
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -138
- package/paginator/Paginator.stories.tsx +0 -87
- package/paginator/Paginator.test.d.ts +0 -1
- package/paginator/Paginator.test.js +0 -334
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- package/paragraph/Paragraph.accessibility.test.d.ts +0 -1
- package/paragraph/Paragraph.accessibility.test.js +0 -28
- package/paragraph/Paragraph.d.ts +0 -5
- package/paragraph/Paragraph.js +0 -22
- package/paragraph/Paragraph.stories.tsx +0 -27
- package/password-input/PasswordInput.accessibility.test.d.ts +0 -1
- package/password-input/PasswordInput.accessibility.test.js +0 -152
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -97
- package/password-input/PasswordInput.stories.tsx +0 -99
- package/password-input/PasswordInput.test.d.ts +0 -1
- package/password-input/PasswordInput.test.js +0 -197
- package/password-input/types.d.ts +0 -111
- package/password-input/types.js +0 -5
- package/progress-bar/ProgressBar.accessibility.test.d.ts +0 -1
- package/progress-bar/ProgressBar.accessibility.test.js +0 -35
- package/progress-bar/ProgressBar.d.ts +0 -4
- package/progress-bar/ProgressBar.js +0 -146
- package/progress-bar/ProgressBar.stories.tsx +0 -93
- package/progress-bar/ProgressBar.test.d.ts +0 -1
- package/progress-bar/ProgressBar.test.js +0 -93
- package/progress-bar/types.d.ts +0 -37
- package/progress-bar/types.js +0 -5
- package/quick-nav/QuickNav.accessibility.test.d.ts +0 -1
- package/quick-nav/QuickNav.accessibility.test.js +0 -57
- package/quick-nav/QuickNav.d.ts +0 -4
- package/quick-nav/QuickNav.js +0 -94
- package/quick-nav/QuickNav.stories.tsx +0 -356
- package/quick-nav/types.d.ts +0 -21
- package/quick-nav/types.js +0 -5
- package/radio-group/Radio.d.ts +0 -4
- package/radio-group/Radio.js +0 -121
- package/radio-group/RadioGroup.accessibility.test.d.ts +0 -1
- package/radio-group/RadioGroup.accessibility.test.js +0 -97
- package/radio-group/RadioGroup.d.ts +0 -4
- package/radio-group/RadioGroup.js +0 -233
- package/radio-group/RadioGroup.stories.tsx +0 -214
- package/radio-group/RadioGroup.test.d.ts +0 -1
- package/radio-group/RadioGroup.test.js +0 -754
- package/radio-group/types.d.ts +0 -114
- package/radio-group/types.js +0 -5
- package/resultset-table/Icons.d.ts +0 -7
- package/resultset-table/Icons.js +0 -47
- package/resultset-table/ResultsetTable.accessibility.test.d.ts +0 -1
- package/resultset-table/ResultsetTable.accessibility.test.js +0 -284
- package/resultset-table/ResultsetTable.d.ts +0 -7
- package/resultset-table/ResultsetTable.js +0 -171
- package/resultset-table/ResultsetTable.stories.tsx +0 -413
- package/resultset-table/ResultsetTable.test.d.ts +0 -1
- package/resultset-table/ResultsetTable.test.js +0 -379
- package/resultset-table/types.d.ts +0 -100
- package/resultset-table/types.js +0 -5
- package/select/Listbox.d.ts +0 -4
- package/select/Listbox.js +0 -151
- package/select/Option.d.ts +0 -4
- package/select/Option.js +0 -89
- package/select/Select.accessibility.test.d.ts +0 -1
- package/select/Select.accessibility.test.js +0 -227
- package/select/Select.d.ts +0 -4
- package/select/Select.js +0 -600
- package/select/Select.stories.tsx +0 -919
- package/select/Select.test.d.ts +0 -1
- package/select/Select.test.js +0 -2267
- package/select/types.d.ts +0 -209
- package/select/types.js +0 -5
- package/sidenav/Sidenav.accessibility.test.d.ts +0 -1
- package/sidenav/Sidenav.accessibility.test.js +0 -59
- package/sidenav/Sidenav.d.ts +0 -10
- package/sidenav/Sidenav.js +0 -201
- package/sidenav/Sidenav.stories.tsx +0 -277
- package/sidenav/Sidenav.test.d.ts +0 -1
- package/sidenav/Sidenav.test.js +0 -37
- package/sidenav/SidenavContext.d.ts +0 -5
- package/sidenav/SidenavContext.js +0 -13
- package/sidenav/types.d.ts +0 -76
- package/sidenav/types.js +0 -5
- package/slider/Slider.accessibility.test.d.ts +0 -1
- package/slider/Slider.accessibility.test.js +0 -103
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -283
- package/slider/Slider.stories.tsx +0 -180
- package/slider/Slider.test.d.ts +0 -1
- package/slider/Slider.test.js +0 -256
- package/slider/types.d.ts +0 -86
- package/slider/types.js +0 -5
- package/spinner/Spinner.accessibility.test.d.ts +0 -1
- package/spinner/Spinner.accessibility.test.js +0 -96
- package/spinner/Spinner.d.ts +0 -4
- package/spinner/Spinner.js +0 -210
- package/spinner/Spinner.stories.tsx +0 -129
- package/spinner/Spinner.test.d.ts +0 -1
- package/spinner/Spinner.test.js +0 -55
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- package/status-light/StatusLight.accessibility.test.d.ts +0 -1
- package/status-light/StatusLight.accessibility.test.js +0 -157
- package/status-light/StatusLight.d.ts +0 -4
- package/status-light/StatusLight.js +0 -51
- package/status-light/StatusLight.stories.tsx +0 -74
- package/status-light/StatusLight.test.d.ts +0 -1
- package/status-light/StatusLight.test.js +0 -25
- package/status-light/types.d.ts +0 -17
- package/status-light/types.js +0 -5
- package/switch/Switch.accessibility.test.d.ts +0 -1
- package/switch/Switch.accessibility.test.js +0 -98
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -211
- package/switch/Switch.stories.tsx +0 -149
- package/switch/Switch.test.d.ts +0 -1
- package/switch/Switch.test.js +0 -180
- package/switch/types.d.ts +0 -66
- package/switch/types.js +0 -5
- package/table/DropdownTheme.js +0 -62
- package/table/Table.accessibility.test.d.ts +0 -1
- package/table/Table.accessibility.test.js +0 -92
- package/table/Table.d.ts +0 -8
- package/table/Table.js +0 -161
- package/table/Table.stories.tsx +0 -663
- package/table/Table.test.d.ts +0 -1
- package/table/Table.test.js +0 -111
- package/table/types.d.ts +0 -49
- package/table/types.js +0 -5
- package/tabs/Tab.d.ts +0 -4
- package/tabs/Tab.js +0 -117
- package/tabs/Tabs.accessibility.test.d.ts +0 -1
- package/tabs/Tabs.accessibility.test.js +0 -56
- package/tabs/Tabs.d.ts +0 -4
- package/tabs/Tabs.js +0 -373
- package/tabs/Tabs.stories.tsx +0 -230
- package/tabs/Tabs.test.d.ts +0 -1
- package/tabs/Tabs.test.js +0 -276
- package/tabs/types.d.ts +0 -92
- package/tabs/types.js +0 -5
- package/tag/Tag.accessibility.test.d.ts +0 -1
- package/tag/Tag.accessibility.test.js +0 -69
- package/tag/Tag.d.ts +0 -4
- package/tag/Tag.js +0 -151
- package/tag/Tag.stories.tsx +0 -152
- package/tag/Tag.test.d.ts +0 -1
- package/tag/Tag.test.js +0 -41
- package/tag/types.d.ts +0 -69
- package/tag/types.js +0 -5
- package/text-input/Suggestion.d.ts +0 -4
- package/text-input/Suggestion.js +0 -67
- package/text-input/Suggestions.d.ts +0 -4
- package/text-input/Suggestions.js +0 -94
- package/text-input/TextInput.accessibility.test.d.ts +0 -1
- package/text-input/TextInput.accessibility.test.js +0 -320
- package/text-input/TextInput.d.ts +0 -4
- package/text-input/TextInput.js +0 -569
- package/text-input/TextInput.stories.tsx +0 -468
- package/text-input/TextInput.test.d.ts +0 -1
- package/text-input/TextInput.test.js +0 -1755
- package/text-input/types.d.ts +0 -205
- package/text-input/types.js +0 -5
- package/textarea/Textarea.accessibility.test.d.ts +0 -1
- package/textarea/Textarea.accessibility.test.js +0 -155
- package/textarea/Textarea.d.ts +0 -4
- package/textarea/Textarea.js +0 -235
- package/textarea/Textarea.stories.tsx +0 -174
- package/textarea/Textarea.test.d.ts +0 -1
- package/textarea/Textarea.test.js +0 -406
- package/textarea/types.d.ts +0 -141
- package/textarea/types.js +0 -5
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +0 -1
- package/toggle-group/ToggleGroup.accessibility.test.js +0 -107
- package/toggle-group/ToggleGroup.d.ts +0 -4
- package/toggle-group/ToggleGroup.js +0 -199
- package/toggle-group/ToggleGroup.stories.tsx +0 -218
- package/toggle-group/ToggleGroup.test.d.ts +0 -1
- package/toggle-group/ToggleGroup.test.js +0 -137
- package/toggle-group/types.d.ts +0 -114
- package/toggle-group/types.js +0 -5
- package/typography/Typography.accessibility.test.d.ts +0 -1
- package/typography/Typography.accessibility.test.js +0 -339
- package/typography/Typography.d.ts +0 -4
- package/typography/Typography.js +0 -23
- package/typography/Typography.stories.tsx +0 -196
- package/typography/types.d.ts +0 -18
- package/typography/types.js +0 -5
- package/useTheme.d.ts +0 -1145
- package/useTheme.js +0 -15
- package/useTranslatedLabels.d.ts +0 -85
- package/useTranslatedLabels.js +0 -14
- package/utils/BaseTypography.d.ts +0 -21
- package/utils/BaseTypography.js +0 -94
- package/utils/FocusLock.d.ts +0 -13
- package/utils/FocusLock.js +0 -125
- package/wizard/Wizard.accessibility.test.d.ts +0 -1
- package/wizard/Wizard.accessibility.test.js +0 -55
- package/wizard/Wizard.d.ts +0 -4
- package/wizard/Wizard.js +0 -239
- package/wizard/Wizard.stories.tsx +0 -272
- package/wizard/Wizard.test.d.ts +0 -1
- package/wizard/Wizard.test.js +0 -114
- package/wizard/types.d.ts +0 -64
- package/wizard/types.js +0 -5
package/tabs/Tabs.test.js
DELETED
|
@@ -1,276 +0,0 @@
|
|
|
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 _Tabs = _interopRequireDefault(require("./Tabs"));
|
|
7
|
-
var sampleTabs = [{
|
|
8
|
-
label: "Tab-1"
|
|
9
|
-
}, {
|
|
10
|
-
label: "Tab-2"
|
|
11
|
-
}, {
|
|
12
|
-
label: "Tab-3"
|
|
13
|
-
}];
|
|
14
|
-
var sampleTabsWithBadge = [{
|
|
15
|
-
label: "Tab-1",
|
|
16
|
-
notificationNumber: 10
|
|
17
|
-
}, {
|
|
18
|
-
label: "Tab-2",
|
|
19
|
-
notificationNumber: 20
|
|
20
|
-
}, {
|
|
21
|
-
label: "Tab-3",
|
|
22
|
-
notificationNumber: 101
|
|
23
|
-
}];
|
|
24
|
-
var sampleTabsMiddleDisabled = [{
|
|
25
|
-
label: "Tab-1"
|
|
26
|
-
}, {
|
|
27
|
-
label: "Tab-2",
|
|
28
|
-
isDisabled: true
|
|
29
|
-
}, {
|
|
30
|
-
label: "Tab-3"
|
|
31
|
-
}];
|
|
32
|
-
var sampleTabsLastTabNonDisabled = [{
|
|
33
|
-
label: "Tab-1",
|
|
34
|
-
isDisabled: true
|
|
35
|
-
}, {
|
|
36
|
-
label: "Tab-2",
|
|
37
|
-
isDisabled: true
|
|
38
|
-
}, {
|
|
39
|
-
label: "Tab-3"
|
|
40
|
-
}];
|
|
41
|
-
describe("Tabs component tests", function () {
|
|
42
|
-
test("Tabs render with correct labels", function () {
|
|
43
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
44
|
-
tabs: sampleTabs
|
|
45
|
-
})),
|
|
46
|
-
getByText = _render.getByText,
|
|
47
|
-
getAllByRole = _render.getAllByRole;
|
|
48
|
-
var tabs = getAllByRole("tab");
|
|
49
|
-
expect(getByText("Tab-1")).toBeTruthy();
|
|
50
|
-
expect(getByText("Tab-2")).toBeTruthy();
|
|
51
|
-
expect(getByText("Tab-3")).toBeTruthy();
|
|
52
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
53
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
54
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
55
|
-
});
|
|
56
|
-
test("Tabs render with correct labels and badges", function () {
|
|
57
|
-
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
58
|
-
tabs: sampleTabsWithBadge
|
|
59
|
-
})),
|
|
60
|
-
getByText = _render2.getByText;
|
|
61
|
-
expect(getByText("10")).toBeTruthy();
|
|
62
|
-
expect(getByText("20")).toBeTruthy();
|
|
63
|
-
expect(getByText("+99")).toBeTruthy();
|
|
64
|
-
});
|
|
65
|
-
test("Tabs render with an initially active tab", function () {
|
|
66
|
-
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
67
|
-
defaultActiveTabIndex: 2,
|
|
68
|
-
tabs: sampleTabsWithBadge
|
|
69
|
-
})),
|
|
70
|
-
getAllByRole = _render3.getAllByRole;
|
|
71
|
-
var tabs = getAllByRole("tab");
|
|
72
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
73
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
74
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("true");
|
|
75
|
-
});
|
|
76
|
-
test("Tabs render with disabled tab", function () {
|
|
77
|
-
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
78
|
-
tabs: [{
|
|
79
|
-
label: "Tab-1",
|
|
80
|
-
isDisabled: true
|
|
81
|
-
}, {
|
|
82
|
-
label: "Tab-2"
|
|
83
|
-
}]
|
|
84
|
-
})),
|
|
85
|
-
getAllByRole = _render4.getAllByRole;
|
|
86
|
-
expect(getAllByRole("tab")[0].hasAttribute("disabled")).toBeTruthy();
|
|
87
|
-
expect(getAllByRole("tab")[1].hasAttribute("disabled")).toBeFalsy();
|
|
88
|
-
});
|
|
89
|
-
test("Uncontrolled tabs", function () {
|
|
90
|
-
var onTabClick = jest.fn();
|
|
91
|
-
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
92
|
-
tabs: sampleTabs,
|
|
93
|
-
onTabClick: onTabClick
|
|
94
|
-
})),
|
|
95
|
-
getByText = _render5.getByText,
|
|
96
|
-
getAllByRole = _render5.getAllByRole;
|
|
97
|
-
var tabs = getAllByRole("tab");
|
|
98
|
-
var tab1 = getByText("Tab-1");
|
|
99
|
-
var tab2 = getByText("Tab-2");
|
|
100
|
-
_react2.fireEvent.click(tab2);
|
|
101
|
-
expect(onTabClick).toHaveBeenCalledWith(1);
|
|
102
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
103
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("true");
|
|
104
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
105
|
-
_react2.fireEvent.click(tab1);
|
|
106
|
-
expect(onTabClick).toHaveBeenCalledWith(0);
|
|
107
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
108
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
109
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
110
|
-
});
|
|
111
|
-
test("Controlled tabs", function () {
|
|
112
|
-
var onTabClick = jest.fn();
|
|
113
|
-
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
114
|
-
tabs: sampleTabs,
|
|
115
|
-
onTabClick: onTabClick,
|
|
116
|
-
activeTabIndex: 0
|
|
117
|
-
})),
|
|
118
|
-
getAllByRole = _render6.getAllByRole;
|
|
119
|
-
var tabs = getAllByRole("tab");
|
|
120
|
-
_react2.fireEvent.click(tabs[1]);
|
|
121
|
-
expect(onTabClick).toHaveBeenCalledWith(1);
|
|
122
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
123
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
124
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
125
|
-
_react2.fireEvent.click(tabs[2]);
|
|
126
|
-
expect(onTabClick).toHaveBeenCalledWith(2);
|
|
127
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
128
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
129
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
130
|
-
});
|
|
131
|
-
test("Uncontrolled tabs should have focus in the first non-disabled tab", function () {
|
|
132
|
-
var onTabClick = jest.fn();
|
|
133
|
-
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
134
|
-
tabs: sampleTabsLastTabNonDisabled,
|
|
135
|
-
onTabClick: onTabClick
|
|
136
|
-
})),
|
|
137
|
-
getAllByRole = _render7.getAllByRole;
|
|
138
|
-
var tabs = getAllByRole("tab");
|
|
139
|
-
expect(tabs[0].hasAttribute("disabled")).toBeTruthy();
|
|
140
|
-
expect(tabs[1].hasAttribute("disabled")).toBeTruthy();
|
|
141
|
-
expect(tabs[2].hasAttribute("disabled")).toBeFalsy();
|
|
142
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
143
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
144
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("true");
|
|
145
|
-
});
|
|
146
|
-
test("Controlled tabs with active index in disabled tab should not change focus to the first available tab", function () {
|
|
147
|
-
var onTabClick = jest.fn();
|
|
148
|
-
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
149
|
-
tabs: sampleTabsLastTabNonDisabled,
|
|
150
|
-
onTabClick: onTabClick,
|
|
151
|
-
activeTabIndex: 0
|
|
152
|
-
})),
|
|
153
|
-
getAllByRole = _render8.getAllByRole;
|
|
154
|
-
var tabs = getAllByRole("tab");
|
|
155
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
156
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
157
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
158
|
-
expect(tabs[0].hasAttribute("disabled")).toBeTruthy();
|
|
159
|
-
expect(tabs[1].hasAttribute("disabled")).toBeTruthy();
|
|
160
|
-
expect(tabs[2].hasAttribute("disabled")).toBeFalsy();
|
|
161
|
-
_react2.fireEvent.click(tabs[2]);
|
|
162
|
-
expect(onTabClick).toHaveBeenCalledWith(2);
|
|
163
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
164
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
165
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
166
|
-
expect(tabs[0].hasAttribute("disabled")).toBeTruthy();
|
|
167
|
-
expect(tabs[1].hasAttribute("disabled")).toBeTruthy();
|
|
168
|
-
expect(tabs[2].hasAttribute("disabled")).toBeFalsy();
|
|
169
|
-
});
|
|
170
|
-
test("Select tabs with keyboard event arrows", function () {
|
|
171
|
-
var onTabClick = jest.fn();
|
|
172
|
-
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
173
|
-
tabs: sampleTabs,
|
|
174
|
-
onTabClick: onTabClick
|
|
175
|
-
})),
|
|
176
|
-
getByText = _render9.getByText,
|
|
177
|
-
getByRole = _render9.getByRole,
|
|
178
|
-
getAllByRole = _render9.getAllByRole;
|
|
179
|
-
var tabList = getByRole("tablist");
|
|
180
|
-
var tab1 = getByText("Tab-1");
|
|
181
|
-
var tabs = getAllByRole("tab");
|
|
182
|
-
_react2.fireEvent.click(tab1);
|
|
183
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
184
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
185
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
186
|
-
expect(onTabClick).toHaveBeenCalledWith(0);
|
|
187
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
188
|
-
key: "ArrowRight"
|
|
189
|
-
});
|
|
190
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
191
|
-
key: "Enter"
|
|
192
|
-
});
|
|
193
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
194
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("true");
|
|
195
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
196
|
-
expect(onTabClick).toHaveBeenCalledWith(1);
|
|
197
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
198
|
-
key: "ArrowRight"
|
|
199
|
-
});
|
|
200
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
201
|
-
key: "Enter"
|
|
202
|
-
});
|
|
203
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
204
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
205
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("true");
|
|
206
|
-
expect(onTabClick).toHaveBeenCalledWith(2);
|
|
207
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
208
|
-
key: "ArrowLeft"
|
|
209
|
-
});
|
|
210
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
211
|
-
key: "Enter"
|
|
212
|
-
});
|
|
213
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
214
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("true");
|
|
215
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
216
|
-
expect(onTabClick).toHaveBeenCalledWith(1);
|
|
217
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
218
|
-
key: "ArrowLeft"
|
|
219
|
-
});
|
|
220
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
221
|
-
key: "Enter"
|
|
222
|
-
});
|
|
223
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
224
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
225
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
226
|
-
expect(onTabClick).toHaveBeenCalledWith(0);
|
|
227
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
228
|
-
key: "ArrowLeft"
|
|
229
|
-
});
|
|
230
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
231
|
-
key: "Enter"
|
|
232
|
-
});
|
|
233
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
234
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
235
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("true");
|
|
236
|
-
expect(onTabClick).toHaveBeenCalledWith(2);
|
|
237
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
238
|
-
key: "ArrowRight"
|
|
239
|
-
});
|
|
240
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
241
|
-
key: "Enter"
|
|
242
|
-
});
|
|
243
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
244
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
245
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
246
|
-
expect(onTabClick).toHaveBeenCalledWith(0);
|
|
247
|
-
});
|
|
248
|
-
test("Skip disabled tab with keyboard event arrows", function () {
|
|
249
|
-
var onTabClick = jest.fn();
|
|
250
|
-
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
251
|
-
tabs: sampleTabsMiddleDisabled,
|
|
252
|
-
onTabClick: onTabClick
|
|
253
|
-
})),
|
|
254
|
-
getByText = _render10.getByText,
|
|
255
|
-
getByRole = _render10.getByRole,
|
|
256
|
-
getAllByRole = _render10.getAllByRole;
|
|
257
|
-
var tabList = getByRole("tablist");
|
|
258
|
-
var tab1 = getByText("Tab-1");
|
|
259
|
-
var tabs = getAllByRole("tab");
|
|
260
|
-
_react2.fireEvent.click(tab1);
|
|
261
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("true");
|
|
262
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
263
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("false");
|
|
264
|
-
expect(onTabClick).toHaveBeenCalledWith(0);
|
|
265
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
266
|
-
key: "ArrowRight"
|
|
267
|
-
});
|
|
268
|
-
_react2.fireEvent.keyDown(tabList, {
|
|
269
|
-
key: " "
|
|
270
|
-
});
|
|
271
|
-
expect(tabs[0].getAttribute("aria-selected")).toBe("false");
|
|
272
|
-
expect(tabs[1].getAttribute("aria-selected")).toBe("false");
|
|
273
|
-
expect(tabs[2].getAttribute("aria-selected")).toBe("true");
|
|
274
|
-
expect(onTabClick).toHaveBeenCalledWith(2);
|
|
275
|
-
});
|
|
276
|
-
});
|
package/tabs/types.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
-
type TabCommonProps = {
|
|
11
|
-
/**
|
|
12
|
-
* Whether the tab is disabled or not.
|
|
13
|
-
*/
|
|
14
|
-
isDisabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* If the value is 'true', an empty badge will appear.
|
|
17
|
-
* If it is 'false', no badge will appear.
|
|
18
|
-
* If a number is put it will be shown as the label of the notification
|
|
19
|
-
* in the tab, taking into account that if that number is greater than 99,
|
|
20
|
-
* it will appear as '+99' in the badge.
|
|
21
|
-
*/
|
|
22
|
-
notificationNumber?: boolean | number;
|
|
23
|
-
};
|
|
24
|
-
export type TabLabelProps = TabCommonProps & {
|
|
25
|
-
/**
|
|
26
|
-
* Tab label.
|
|
27
|
-
*/
|
|
28
|
-
label: string;
|
|
29
|
-
/**
|
|
30
|
-
* Material Symbol name or SVG element used as the icon that will be displayed in the tab.
|
|
31
|
-
*/
|
|
32
|
-
icon?: string | SVG;
|
|
33
|
-
};
|
|
34
|
-
export type TabIconProps = TabCommonProps & {
|
|
35
|
-
/**
|
|
36
|
-
* Tab label.
|
|
37
|
-
*/
|
|
38
|
-
label?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Material Symbol name or SVG element used as the icon that will be displayed in the tab.
|
|
41
|
-
*/
|
|
42
|
-
icon: string | SVG;
|
|
43
|
-
};
|
|
44
|
-
export type TabProps = {
|
|
45
|
-
tab: TabLabelProps | TabIconProps;
|
|
46
|
-
active: boolean;
|
|
47
|
-
tabIndex: number;
|
|
48
|
-
hasLabelAndIcon: boolean;
|
|
49
|
-
iconPosition: "top" | "left";
|
|
50
|
-
onClick: () => void;
|
|
51
|
-
onMouseEnter: () => void;
|
|
52
|
-
onMouseLeave: () => void;
|
|
53
|
-
};
|
|
54
|
-
type Props = {
|
|
55
|
-
/**
|
|
56
|
-
* Initially active tab, only when it is uncontrolled.
|
|
57
|
-
*/
|
|
58
|
-
defaultActiveTabIndex?: number;
|
|
59
|
-
/**
|
|
60
|
-
* The index of the active tab. If undefined, the component will be
|
|
61
|
-
* uncontrolled and the active tab will be managed internally by the component.
|
|
62
|
-
*/
|
|
63
|
-
activeTabIndex?: number;
|
|
64
|
-
/**
|
|
65
|
-
* An array of objects representing the tabs.
|
|
66
|
-
*/
|
|
67
|
-
tabs: (TabLabelProps | TabIconProps)[];
|
|
68
|
-
/**
|
|
69
|
-
* Whether the icon should appear above or to the left of the label.
|
|
70
|
-
*/
|
|
71
|
-
iconPosition?: "top" | "left";
|
|
72
|
-
/**
|
|
73
|
-
* This function will be called when the user clicks on a tab. The index of the
|
|
74
|
-
* clicked tab will be passed as a parameter.
|
|
75
|
-
*/
|
|
76
|
-
onTabClick?: (index: number) => void;
|
|
77
|
-
/**
|
|
78
|
-
* This function will be called when the user hovers a tab.The index of the
|
|
79
|
-
* hovered tab will be passed as a parameter.
|
|
80
|
-
*/
|
|
81
|
-
onTabHover?: (index: number) => void;
|
|
82
|
-
/**
|
|
83
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
84
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
85
|
-
*/
|
|
86
|
-
margin?: Space | Margin;
|
|
87
|
-
/**
|
|
88
|
-
* Value of the tabindex attribute applied to each tab.
|
|
89
|
-
*/
|
|
90
|
-
tabIndex?: number;
|
|
91
|
-
};
|
|
92
|
-
export default Props;
|
package/tabs/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
-
var _Tag = _interopRequireDefault(require("./Tag"));
|
|
10
|
-
var icon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
11
|
-
viewBox: "0 0 24 24",
|
|
12
|
-
fill: "currentColor"
|
|
13
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
14
|
-
d: "M0 0h24v24H0z",
|
|
15
|
-
fill: "none"
|
|
16
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
17
|
-
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"
|
|
18
|
-
}));
|
|
19
|
-
describe("Tag component accessibility tests", function () {
|
|
20
|
-
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
21
|
-
var _render, container, results;
|
|
22
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
23
|
-
while (1) switch (_context.prev = _context.next) {
|
|
24
|
-
case 0:
|
|
25
|
-
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
|
26
|
-
label: "tag-test",
|
|
27
|
-
icon: icon,
|
|
28
|
-
iconBgColor: "#fabada",
|
|
29
|
-
margin: "medium",
|
|
30
|
-
size: "medium",
|
|
31
|
-
labelPosition: "before"
|
|
32
|
-
})), container = _render.container;
|
|
33
|
-
_context.next = 3;
|
|
34
|
-
return (0, _axeHelper.axe)(container);
|
|
35
|
-
case 3:
|
|
36
|
-
results = _context.sent;
|
|
37
|
-
expect(results).toHaveNoViolations();
|
|
38
|
-
case 5:
|
|
39
|
-
case "end":
|
|
40
|
-
return _context.stop();
|
|
41
|
-
}
|
|
42
|
-
}, _callee);
|
|
43
|
-
})));
|
|
44
|
-
it("Should not have basic accessibility issues for new-window mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
45
|
-
var _render2, container, results;
|
|
46
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
47
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
48
|
-
case 0:
|
|
49
|
-
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
|
50
|
-
label: "tag-test",
|
|
51
|
-
icon: icon,
|
|
52
|
-
iconBgColor: "#fabada",
|
|
53
|
-
margin: "medium",
|
|
54
|
-
size: "medium",
|
|
55
|
-
labelPosition: "before",
|
|
56
|
-
newWindow: true
|
|
57
|
-
})), container = _render2.container;
|
|
58
|
-
_context2.next = 3;
|
|
59
|
-
return (0, _axeHelper.axe)(container);
|
|
60
|
-
case 3:
|
|
61
|
-
results = _context2.sent;
|
|
62
|
-
expect(results).toHaveNoViolations();
|
|
63
|
-
case 5:
|
|
64
|
-
case "end":
|
|
65
|
-
return _context2.stop();
|
|
66
|
-
}
|
|
67
|
-
}, _callee2);
|
|
68
|
-
})));
|
|
69
|
-
});
|
package/tag/Tag.d.ts
DELETED
package/tag/Tag.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
14
|
-
var _variables = require("../common/variables");
|
|
15
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
16
|
-
var _utils = require("../common/utils");
|
|
17
|
-
var _Box = _interopRequireDefault(require("../box/Box"));
|
|
18
|
-
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
19
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
20
|
-
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); }
|
|
21
|
-
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 && {}.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; }
|
|
22
|
-
var DxcTag = function DxcTag(_ref) {
|
|
23
|
-
var icon = _ref.icon,
|
|
24
|
-
_ref$label = _ref.label,
|
|
25
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
26
|
-
linkHref = _ref.linkHref,
|
|
27
|
-
onClick = _ref.onClick,
|
|
28
|
-
_ref$iconBgColor = _ref.iconBgColor,
|
|
29
|
-
iconBgColor = _ref$iconBgColor === void 0 ? "#5f249f" : _ref$iconBgColor,
|
|
30
|
-
_ref$labelPosition = _ref.labelPosition,
|
|
31
|
-
labelPosition = _ref$labelPosition === void 0 ? "after" : _ref$labelPosition,
|
|
32
|
-
_ref$newWindow = _ref.newWindow,
|
|
33
|
-
newWindow = _ref$newWindow === void 0 ? false : _ref$newWindow,
|
|
34
|
-
margin = _ref.margin,
|
|
35
|
-
_ref$size = _ref.size,
|
|
36
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
37
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
38
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
39
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
40
|
-
var _useState = (0, _react.useState)(false),
|
|
41
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
42
|
-
isHovered = _useState2[0],
|
|
43
|
-
changeIsHovered = _useState2[1];
|
|
44
|
-
var clickHandler = function clickHandler() {
|
|
45
|
-
onClick && onClick();
|
|
46
|
-
};
|
|
47
|
-
var tagContent = /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
48
|
-
size: size,
|
|
49
|
-
shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
|
|
50
|
-
}, /*#__PURE__*/_react["default"].createElement(TagContent, null, labelPosition === "before" && size !== "small" && label && /*#__PURE__*/_react["default"].createElement(TagLabel, null, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
51
|
-
iconBgColor: iconBgColor
|
|
52
|
-
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
53
|
-
icon: icon
|
|
54
|
-
}) : icon), labelPosition === "after" && size !== "small" && label && /*#__PURE__*/_react["default"].createElement(TagLabel, null, label)));
|
|
55
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
56
|
-
theme: colorsTheme.tag
|
|
57
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledDxcTag, {
|
|
58
|
-
margin: margin,
|
|
59
|
-
size: size,
|
|
60
|
-
onMouseEnter: function onMouseEnter() {
|
|
61
|
-
return changeIsHovered(true);
|
|
62
|
-
},
|
|
63
|
-
onMouseLeave: function onMouseLeave() {
|
|
64
|
-
return changeIsHovered(false);
|
|
65
|
-
},
|
|
66
|
-
onClick: clickHandler,
|
|
67
|
-
hasAction: onClick || linkHref
|
|
68
|
-
}, onClick ? /*#__PURE__*/_react["default"].createElement(StyledButton, {
|
|
69
|
-
tabIndex: tabIndex
|
|
70
|
-
}, tagContent) : linkHref ? /*#__PURE__*/_react["default"].createElement(StyledLink, {
|
|
71
|
-
tabIndex: tabIndex,
|
|
72
|
-
href: linkHref,
|
|
73
|
-
target: newWindow ? "_blank" : "_self"
|
|
74
|
-
}, tagContent) : tagContent));
|
|
75
|
-
};
|
|
76
|
-
var sizes = {
|
|
77
|
-
small: "42px",
|
|
78
|
-
medium: "240px",
|
|
79
|
-
large: "480px",
|
|
80
|
-
fillParent: "100%",
|
|
81
|
-
fitContent: "fit-content"
|
|
82
|
-
};
|
|
83
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
84
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
85
|
-
};
|
|
86
|
-
var StyledDxcTag = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n height: ", ";\n"])), function (_ref2) {
|
|
87
|
-
var hasAction = _ref2.hasAction;
|
|
88
|
-
return hasAction && "pointer" || "unset";
|
|
89
|
-
}, function (_ref3) {
|
|
90
|
-
var margin = _ref3.margin;
|
|
91
|
-
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
92
|
-
}, function (_ref4) {
|
|
93
|
-
var margin = _ref4.margin;
|
|
94
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
|
|
95
|
-
}, function (_ref5) {
|
|
96
|
-
var margin = _ref5.margin;
|
|
97
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
|
|
98
|
-
}, function (_ref6) {
|
|
99
|
-
var margin = _ref6.margin;
|
|
100
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
101
|
-
}, function (_ref7) {
|
|
102
|
-
var margin = _ref7.margin;
|
|
103
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
|
|
104
|
-
}, function (props) {
|
|
105
|
-
return calculateWidth(props.margin, props.size);
|
|
106
|
-
}, function (props) {
|
|
107
|
-
return props.theme.height;
|
|
108
|
-
});
|
|
109
|
-
var TagContent = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n width: 100%;\n height: ", ";\n"])), function (props) {
|
|
110
|
-
return props.theme.height;
|
|
111
|
-
});
|
|
112
|
-
var StyledLink = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n border-radius: 4px;\n width: 100%;\n :focus {\n outline: 2px solid ", ";\n outline-offset: 0px;\n }\n"])), function (props) {
|
|
113
|
-
return props.theme.focusColor;
|
|
114
|
-
});
|
|
115
|
-
var StyledButton = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border-radius: 4px;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n width: 100%;\n :focus {\n outline: 2px solid ", ";\n }\n"])), function (props) {
|
|
116
|
-
return props.theme.focusColor;
|
|
117
|
-
});
|
|
118
|
-
var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width: ", ";\n height: 100%;\n justify-content: center;\n align-items: center;\n color: ", ";\n min-width: ", ";\n overflow: hidden;\n font-size: 24px;\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (_ref8) {
|
|
119
|
-
var iconBgColor = _ref8.iconBgColor;
|
|
120
|
-
return iconBgColor;
|
|
121
|
-
}, function (props) {
|
|
122
|
-
return props.theme.iconSectionWidth;
|
|
123
|
-
}, function (props) {
|
|
124
|
-
return props.theme.iconColor;
|
|
125
|
-
}, function (props) {
|
|
126
|
-
return props.theme.iconSectionWidth;
|
|
127
|
-
}, function (props) {
|
|
128
|
-
return props.theme.iconWidth;
|
|
129
|
-
}, function (props) {
|
|
130
|
-
return props.theme.iconHeight;
|
|
131
|
-
});
|
|
132
|
-
var TagLabel = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"])), function (props) {
|
|
133
|
-
return props.theme.fontFamily;
|
|
134
|
-
}, function (props) {
|
|
135
|
-
return props.theme.fontSize;
|
|
136
|
-
}, function (props) {
|
|
137
|
-
return props.theme.fontStyle;
|
|
138
|
-
}, function (props) {
|
|
139
|
-
return props.theme.fontWeight;
|
|
140
|
-
}, function (props) {
|
|
141
|
-
return props.theme.fontColor;
|
|
142
|
-
}, function (props) {
|
|
143
|
-
return props.theme.labelPaddingTop;
|
|
144
|
-
}, function (props) {
|
|
145
|
-
return props.theme.labelPaddingBottom;
|
|
146
|
-
}, function (props) {
|
|
147
|
-
return props.theme.labelPaddingLeft;
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return props.theme.labelPaddingRight;
|
|
150
|
-
});
|
|
151
|
-
var _default = exports["default"] = DxcTag;
|