@dxc-technology/halstack-react 0.0.0-509f1eb → 0.0.0-50acff4
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.js +1 -1
- package/HalstackContext.d.ts +31 -20
- package/HalstackContext.js +6 -6
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +17 -31
- package/accordion/Accordion.stories.tsx +7 -49
- package/accordion/Accordion.test.d.ts +1 -0
- package/accordion/Accordion.test.js +3 -3
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.accessibility.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.accessibility.test.js +82 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +4 -4
- package/accordion-group/AccordionGroup.stories.tsx +23 -23
- package/accordion-group/AccordionGroup.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.test.js +5 -9
- package/accordion-group/AccordionGroupAccordion.js +3 -3
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +1 -1
- package/action-icon/ActionIcon.accessibility.test.d.ts +1 -0
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +2 -2
- package/action-icon/ActionIcon.js +11 -6
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.d.ts +1 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +1 -1
- package/alert/Alert.accessibility.test.d.ts +1 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +21 -72
- package/alert/Alert.test.d.ts +1 -0
- package/alert/Alert.test.js +1 -1
- package/badge/Badge.accessibility.test.d.ts +1 -0
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -28
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.d.ts +1 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/box/Box.accessibility.test.d.ts +1 -0
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +1 -1
- package/box/Box.test.d.ts +1 -0
- package/box/Box.test.js +1 -1
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +96 -0
- package/breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/breadcrumbs/Breadcrumbs.js +79 -0
- package/breadcrumbs/Breadcrumbs.stories.tsx +194 -0
- package/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.test.js +168 -0
- package/breadcrumbs/Item.d.ts +4 -0
- package/breadcrumbs/Item.js +52 -0
- package/breadcrumbs/dropdownTheme.d.ts +53 -0
- package/breadcrumbs/dropdownTheme.js +62 -0
- package/breadcrumbs/types.d.ts +16 -0
- package/breadcrumbs/types.js +5 -0
- package/bulleted-list/BulletedList.accessibility.test.d.ts +1 -0
- package/bulleted-list/BulletedList.accessibility.test.js +119 -0
- package/bulleted-list/BulletedList.js +7 -4
- package/bulleted-list/BulletedList.stories.tsx +1 -1
- package/button/Button.accessibility.test.d.ts +1 -0
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +5 -4
- package/button/Button.stories.tsx +34 -53
- package/button/Button.test.d.ts +1 -0
- package/button/Button.test.js +4 -2
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.d.ts +1 -0
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +3 -2
- package/card/Card.stories.tsx +1 -1
- package/card/Card.test.d.ts +1 -0
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.accessibility.test.d.ts +1 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +10 -13
- package/checkbox/Checkbox.test.d.ts +1 -0
- package/checkbox/Checkbox.test.js +1 -1
- package/chip/Chip.accessibility.test.d.ts +1 -0
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +11 -6
- package/chip/Chip.stories.tsx +6 -25
- package/chip/Chip.test.d.ts +1 -0
- package/chip/Chip.test.js +5 -5
- package/common/coreTokens.js +4 -4
- package/common/variables.d.ts +31 -20
- package/common/variables.js +101 -90
- package/container/Container.js +1 -1
- package/container/Container.stories.tsx +3 -3
- package/contextual-menu/ContextualMenu.accessibility.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +98 -0
- package/contextual-menu/ContextualMenu.d.ts +5 -0
- package/contextual-menu/ContextualMenu.js +108 -0
- package/contextual-menu/ContextualMenu.stories.tsx +223 -0
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +247 -0
- package/contextual-menu/GroupItem.d.ts +4 -0
- package/contextual-menu/GroupItem.js +67 -0
- package/contextual-menu/ItemAction.d.ts +4 -0
- package/contextual-menu/ItemAction.js +50 -0
- package/contextual-menu/MenuItem.d.ts +4 -0
- package/contextual-menu/MenuItem.js +29 -0
- package/contextual-menu/SingleItem.d.ts +4 -0
- package/contextual-menu/SingleItem.js +38 -0
- package/contextual-menu/types.d.ts +61 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +47 -31
- package/date-input/DateInput.accessibility.test.d.ts +1 -0
- package/date-input/DateInput.accessibility.test.js +229 -0
- package/date-input/DateInput.js +28 -23
- package/date-input/DateInput.stories.tsx +18 -12
- package/date-input/DateInput.test.d.ts +1 -0
- package/date-input/DateInput.test.js +39 -39
- package/date-input/DatePicker.js +13 -7
- package/date-input/YearPicker.js +10 -5
- package/date-input/types.d.ts +2 -2
- package/dialog/Dialog.accessibility.test.d.ts +1 -0
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +9 -20
- package/dialog/Dialog.stories.tsx +8 -4
- package/dialog/Dialog.test.d.ts +1 -0
- package/dialog/Dialog.test.js +112 -49
- package/divider/Divider.accessibility.test.d.ts +1 -0
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.d.ts +1 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.js +183 -0
- package/dropdown/Dropdown.js +37 -51
- package/dropdown/Dropdown.stories.tsx +16 -27
- package/dropdown/Dropdown.test.d.ts +1 -0
- package/dropdown/Dropdown.test.js +101 -72
- package/dropdown/DropdownMenu.js +4 -4
- package/dropdown/DropdownMenuItem.js +8 -4
- package/dropdown/types.d.ts +3 -5
- package/file-input/FileInput.accessibility.test.d.ts +1 -0
- package/file-input/FileInput.accessibility.test.js +167 -0
- package/file-input/FileInput.js +6 -47
- package/file-input/FileInput.test.d.ts +1 -0
- package/file-input/FileInput.test.js +51 -106
- package/file-input/FileItem.js +18 -28
- package/file-input/types.d.ts +0 -4
- package/footer/Footer.accessibility.test.d.ts +1 -0
- package/footer/Footer.accessibility.test.js +125 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +31 -16
- package/footer/Footer.stories.tsx +58 -2
- package/footer/Footer.test.d.ts +1 -0
- package/footer/Footer.test.js +1 -1
- package/footer/Icons.d.ts +1 -0
- package/footer/Icons.js +52 -16
- package/footer/types.d.ts +7 -1
- package/grid/Grid.stories.tsx +3 -1
- package/header/Header.accessibility.test.d.ts +1 -0
- package/header/Header.accessibility.test.js +94 -0
- package/header/Header.js +12 -22
- package/header/Header.stories.tsx +17 -1
- package/header/Header.test.d.ts +1 -0
- package/header/Header.test.js +1 -1
- package/header/Icons.js +1 -6
- package/header/types.d.ts +2 -2
- package/heading/Heading.accessibility.test.d.ts +1 -0
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.d.ts +1 -0
- package/heading/Heading.test.js +1 -14
- package/icon/Icon.accessibility.test.d.ts +1 -0
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.d.ts +1 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.js +1 -1
- package/image/Image.stories.tsx +3 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +10 -7
- package/layout/Icons.d.ts +0 -1
- package/layout/Icons.js +1 -11
- package/link/Link.accessibility.test.d.ts +1 -0
- package/link/Link.accessibility.test.js +108 -0
- package/link/Link.js +8 -6
- package/link/Link.stories.tsx +4 -4
- package/link/Link.test.d.ts +1 -0
- package/link/Link.test.js +1 -1
- package/link/types.d.ts +1 -1
- package/main.d.ts +6 -2
- package/main.js +30 -2
- package/nav-tabs/NavTabs.accessibility.test.d.ts +1 -0
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +22 -7
- package/nav-tabs/NavTabs.stories.tsx +44 -24
- package/nav-tabs/NavTabs.test.d.ts +1 -0
- package/nav-tabs/NavTabs.test.js +12 -10
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +23 -23
- package/nav-tabs/types.d.ts +1 -1
- package/number-input/NumberInput.accessibility.test.d.ts +1 -0
- package/number-input/NumberInput.accessibility.test.js +227 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +28 -6
- package/number-input/NumberInput.stories.tsx +11 -16
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +167 -9
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +6 -0
- package/package.json +31 -27
- package/paginator/Paginator.accessibility.test.d.ts +1 -0
- package/paginator/Paginator.accessibility.test.js +78 -0
- package/paginator/Paginator.js +13 -10
- package/paginator/Paginator.test.d.ts +1 -0
- package/paginator/Paginator.test.js +2 -3
- package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/password-input/PasswordInput.accessibility.test.d.ts +1 -0
- package/password-input/PasswordInput.accessibility.test.js +152 -0
- package/password-input/PasswordInput.js +11 -8
- package/password-input/PasswordInput.stories.tsx +10 -1
- package/password-input/PasswordInput.test.d.ts +1 -0
- package/password-input/PasswordInput.test.js +6 -7
- package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +6 -4
- package/progress-bar/ProgressBar.test.d.ts +1 -0
- package/progress-bar/ProgressBar.test.js +1 -1
- package/quick-nav/QuickNav.accessibility.test.d.ts +1 -0
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +1 -1
- package/radio-group/Radio.js +6 -9
- package/radio-group/RadioGroup.accessibility.test.d.ts +1 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +14 -16
- package/radio-group/RadioGroup.test.d.ts +1 -0
- package/radio-group/RadioGroup.test.js +3 -5
- package/resultset-table/ResultsetTable.accessibility.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.accessibility.test.js +284 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +25 -13
- package/resultset-table/ResultsetTable.stories.tsx +119 -6
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +77 -3
- package/resultset-table/types.d.ts +40 -7
- package/select/Listbox.js +24 -16
- package/select/Option.js +12 -10
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +227 -0
- package/select/Select.js +41 -29
- package/select/Select.stories.tsx +69 -112
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +371 -474
- package/select/types.d.ts +1 -1
- package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +19 -14
- package/sidenav/Sidenav.stories.tsx +5 -10
- package/sidenav/Sidenav.test.d.ts +1 -0
- package/sidenav/Sidenav.test.js +1 -1
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.d.ts +1 -0
- package/slider/Slider.accessibility.test.js +103 -0
- package/slider/Slider.js +11 -13
- package/slider/Slider.stories.tsx +180 -0
- package/slider/Slider.test.d.ts +1 -0
- package/slider/Slider.test.js +13 -11
- package/spinner/Spinner.accessibility.test.d.ts +1 -0
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +6 -2
- package/spinner/Spinner.test.d.ts +1 -0
- package/spinner/Spinner.test.js +1 -1
- package/status-light/StatusLight.accessibility.test.d.ts +1 -0
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.d.ts +1 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.d.ts +1 -0
- package/switch/Switch.accessibility.test.js +98 -0
- package/switch/Switch.js +6 -9
- package/switch/Switch.stories.tsx +12 -0
- package/switch/Switch.test.d.ts +1 -0
- package/switch/Switch.test.js +1 -1
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.d.ts +1 -0
- package/table/Table.accessibility.test.js +92 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +74 -9
- package/table/Table.stories.tsx +309 -2
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +91 -1
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +13 -9
- package/tabs/Tabs.accessibility.test.d.ts +1 -0
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +9 -20
- package/tabs/Tabs.stories.tsx +8 -4
- package/tabs/Tabs.test.d.ts +1 -0
- package/tabs/Tabs.test.js +20 -38
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.accessibility.test.d.ts +1 -0
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +7 -7
- package/tag/Tag.stories.tsx +5 -8
- package/tag/Tag.test.d.ts +1 -0
- package/tag/Tag.test.js +5 -13
- package/tag/types.d.ts +2 -2
- package/text-input/Suggestion.js +1 -1
- package/text-input/Suggestions.js +17 -7
- package/text-input/TextInput.accessibility.test.d.ts +1 -0
- package/text-input/TextInput.accessibility.test.js +320 -0
- package/text-input/TextInput.js +69 -70
- package/text-input/TextInput.stories.tsx +20 -8
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +98 -82
- package/textarea/Textarea.accessibility.test.d.ts +1 -0
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +14 -13
- package/textarea/Textarea.test.d.ts +1 -0
- package/textarea/Textarea.test.js +1 -1
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +10 -12
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +2 -2
- package/typography/Typography.accessibility.test.d.ts +1 -0
- package/typography/Typography.accessibility.test.js +339 -0
- package/typography/Typography.stories.tsx +1 -3
- package/useTheme.d.ts +31 -20
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +6 -2
- package/wizard/Wizard.accessibility.test.d.ts +1 -0
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +14 -25
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/Wizard.test.d.ts +1 -0
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +2 -2
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -58
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -40
- package/password-input/Icons.d.ts +0 -6
- package/password-input/Icons.js +0 -35
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -89
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -47
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -56
- /package/{layout → sidenav}/SidenavContext.d.ts +0 -0
- /package/{layout → sidenav}/SidenavContext.js +0 -0
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _color = _interopRequireDefault(require("color"));
|
|
7
7
|
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); }
|
|
8
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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 &&
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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; }
|
|
9
9
|
var BackgroundColorContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
10
10
|
var getColorType = function getColorType(hexColor) {
|
|
11
11
|
try {
|
package/HalstackContext.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
38
38
|
disabledIconColor: string;
|
|
39
39
|
iconSize: string;
|
|
40
40
|
iconMarginLeft: string;
|
|
41
|
-
|
|
41
|
+
iconMarginRight: string;
|
|
42
42
|
accordionGroupSeparatorBorderColor: string;
|
|
43
43
|
accordionGroupSeparatorBorderThickness: string;
|
|
44
44
|
accordionGroupSeparatorBorderRadius: string;
|
|
@@ -253,8 +253,7 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
253
253
|
dialog: {
|
|
254
254
|
overlayColor: string;
|
|
255
255
|
backgroundColor: string;
|
|
256
|
-
|
|
257
|
-
closeIconHeight: string;
|
|
256
|
+
closeIconSize: string;
|
|
258
257
|
closeIconTopPosition: string;
|
|
259
258
|
closeIconRightPosition: string;
|
|
260
259
|
closeIconBackgroundColor: string;
|
|
@@ -284,9 +283,14 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
284
283
|
buttonPaddingBottom: string;
|
|
285
284
|
buttonPaddingLeft: string;
|
|
286
285
|
buttonPaddingRight: string;
|
|
286
|
+
buttonHeight: string;
|
|
287
|
+
buttonBorderRadius: string;
|
|
288
|
+
buttonBorderStyle: string;
|
|
289
|
+
buttonBorderThickness: string;
|
|
290
|
+
buttonBorderColor: string;
|
|
287
291
|
disabledColor: string;
|
|
288
292
|
disabledButtonBackgroundColor: string;
|
|
289
|
-
|
|
293
|
+
disabledButtonBorderColor: string;
|
|
290
294
|
optionBackgroundColor: string;
|
|
291
295
|
hoverOptionBackgroundColor: string;
|
|
292
296
|
activeOptionBackgroundColor: string;
|
|
@@ -326,7 +330,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
326
330
|
focusDropBorderColor: string;
|
|
327
331
|
disabledDropBorderColor: string;
|
|
328
332
|
dragoverDropBackgroundColor: string;
|
|
329
|
-
activeFileItemIconBackgrounColor: string;
|
|
330
333
|
errorFileItemBorderColor: string;
|
|
331
334
|
errorFileItemBackgroundColor: string;
|
|
332
335
|
errorFilePreviewBackgroundColor: string;
|
|
@@ -527,8 +530,8 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
527
530
|
totalItemsContainerMarginLeft: string;
|
|
528
531
|
};
|
|
529
532
|
paragraph: {
|
|
530
|
-
fontColor: string;
|
|
531
533
|
display: string;
|
|
534
|
+
fontColor: string;
|
|
532
535
|
fontSize: string;
|
|
533
536
|
fontWeight: string;
|
|
534
537
|
};
|
|
@@ -848,8 +851,16 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
848
851
|
dataPaddingBottom: string;
|
|
849
852
|
dataPaddingRight: string;
|
|
850
853
|
dataPaddingLeft: string;
|
|
854
|
+
dataPaddingTopReduced: string;
|
|
855
|
+
dataPaddingBottomReduced: string;
|
|
856
|
+
dataPaddingRightReduced: string;
|
|
857
|
+
dataPaddingLeftReduced: string;
|
|
851
858
|
dataTextAlign: string;
|
|
852
859
|
dataTextLineHeight: string;
|
|
860
|
+
firstChildPaddingLeft: string;
|
|
861
|
+
lastChildPaddingRight: string;
|
|
862
|
+
firstChildPaddingLeftReduced: string;
|
|
863
|
+
lastChildPaddingRightReduced: string;
|
|
853
864
|
headerBackgroundColor: string;
|
|
854
865
|
headerBorderRadius: string;
|
|
855
866
|
headerFontFamily: string;
|
|
@@ -862,11 +873,25 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
862
873
|
headerPaddingBottom: string;
|
|
863
874
|
headerPaddingRight: string;
|
|
864
875
|
headerPaddingLeft: string;
|
|
876
|
+
headerPaddingTopReduced: string;
|
|
877
|
+
headerPaddingBottomReduced: string;
|
|
878
|
+
headerPaddingRightReduced: string;
|
|
879
|
+
headerPaddingLeftReduced: string;
|
|
865
880
|
headerTextAlign: string;
|
|
866
881
|
headerTextLineHeight: string;
|
|
867
882
|
scrollBarThumbColor: string;
|
|
868
883
|
scrollBarTrackColor: string;
|
|
869
884
|
sortIconColor: string;
|
|
885
|
+
actionIconColor: string;
|
|
886
|
+
disabledActionIconColor: string;
|
|
887
|
+
hoverActionIconColor: string;
|
|
888
|
+
focusActionIconColor: string;
|
|
889
|
+
activeActionIconColor: string;
|
|
890
|
+
actionBackgroundColor: string;
|
|
891
|
+
disabledActionBackgroundColor: string;
|
|
892
|
+
hoverActionBackgroundColor: string;
|
|
893
|
+
focusActionBorderColor: string;
|
|
894
|
+
activeActionBackgroundColor: string;
|
|
870
895
|
};
|
|
871
896
|
tabs: {
|
|
872
897
|
fontFamily: string;
|
|
@@ -885,7 +910,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
885
910
|
disabledFontColor: string;
|
|
886
911
|
disabledIconColor: string;
|
|
887
912
|
disabledFontStyle: string;
|
|
888
|
-
disabledBadgeBackgroundColor: string;
|
|
889
913
|
hoverBackgroundColor: string;
|
|
890
914
|
pressedBackgroundColor: string;
|
|
891
915
|
pressedFontWeight: string;
|
|
@@ -893,19 +917,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
893
917
|
dividerThickness: string;
|
|
894
918
|
focusOutline: string;
|
|
895
919
|
scrollButtonsWidth: string;
|
|
896
|
-
badgeBackgroundColor: string;
|
|
897
|
-
badgeFontFamily: string;
|
|
898
|
-
badgeFontSize: string;
|
|
899
|
-
badgeFontStyle: string;
|
|
900
|
-
badgeFontWeight: string;
|
|
901
|
-
badgeFontColor: string;
|
|
902
|
-
badgeLetterSpacing: string;
|
|
903
|
-
badgeWidth: string;
|
|
904
|
-
badgeHeight: string;
|
|
905
|
-
badgeRadius: string;
|
|
906
|
-
badgeWidthWithNotificationNumber: string;
|
|
907
|
-
badgeHeightWithNotificationNumber: string;
|
|
908
|
-
badgeRadiusWithNotificationNumber: string;
|
|
909
920
|
};
|
|
910
921
|
tag: {
|
|
911
922
|
fontFamily: string;
|
package/HalstackContext.js
CHANGED
|
@@ -9,11 +9,11 @@ exports["default"] = exports.HalstackProvider = exports.HalstackLanguageContext
|
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _color = _interopRequireDefault(require("color"));
|
|
12
|
-
var _styledComponents =
|
|
12
|
+
var _styledComponents = require("styled-components");
|
|
13
13
|
var _variables = require("./common/variables");
|
|
14
14
|
var _templateObject;
|
|
15
15
|
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); }
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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 &&
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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; }
|
|
17
17
|
var HalstackContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
18
18
|
var HalstackLanguageContext = exports.HalstackLanguageContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
19
19
|
var addLightness = function addLightness(newLightness, hexColor) {
|
|
@@ -300,11 +300,11 @@ var HalstackProvider = exports.HalstackProvider = function HalstackProvider(_ref
|
|
|
300
300
|
var parsedLabels = (0, _react.useMemo)(function () {
|
|
301
301
|
return labels ? parseLabels(labels) : _variables.defaultTranslatedComponentLabels;
|
|
302
302
|
}, [labels]);
|
|
303
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
303
|
+
return /*#__PURE__*/_react["default"].createElement(HalstackContext.Provider, {
|
|
304
304
|
value: parsedTheme
|
|
305
|
-
}, /*#__PURE__*/_react["default"].createElement(HalstackLanguageContext.Provider, {
|
|
305
|
+
}, /*#__PURE__*/_react["default"].createElement(GlobalStyle, null), /*#__PURE__*/_react["default"].createElement(HalstackLanguageContext.Provider, {
|
|
306
306
|
value: parsedLabels
|
|
307
|
-
}, children))
|
|
307
|
+
}, children));
|
|
308
308
|
};
|
|
309
|
-
var
|
|
309
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n @import url(\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap\");\n"])));
|
|
310
310
|
var _default = exports["default"] = HalstackContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
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 _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
9
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
10
|
+
var folderIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
enableBackground: "new 0 0 24 24",
|
|
13
|
+
height: "24px",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
width: "24px",
|
|
16
|
+
fill: "currentColor"
|
|
17
|
+
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
18
|
+
fill: "none",
|
|
19
|
+
height: "24",
|
|
20
|
+
width: "24"
|
|
21
|
+
})), /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
22
|
+
d: "M20,6h-8l-2-2H4C2.9,4,2.01,4.9,2.01,6L2,18c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V8C22,6.9,21.1,6,20,6z M16,16h2v-2h-2v-2 h2v-2h-2V8h4v10h-4V16z M16,16h-2v2H4V6h5.17l2,2H14v2h2v2h-2v2h2V16z"
|
|
23
|
+
})));
|
|
24
|
+
describe("Accordion component accessibility tests", function () {
|
|
25
|
+
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
26
|
+
var _render, container, results;
|
|
27
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Accordion["default"], {
|
|
31
|
+
label: "Accordion",
|
|
32
|
+
assistiveText: "Assistive Text",
|
|
33
|
+
icon: folderIcon,
|
|
34
|
+
margin: "small",
|
|
35
|
+
defaultIsExpanded: true
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "test-expanded"))), container = _render.container;
|
|
37
|
+
_context.next = 3;
|
|
38
|
+
return (0, _axeHelper.axe)(container);
|
|
39
|
+
case 3:
|
|
40
|
+
results = _context.sent;
|
|
41
|
+
expect(results).toHaveNoViolations();
|
|
42
|
+
case 5:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee);
|
|
47
|
+
})));
|
|
48
|
+
it("Should not have basic accessibility issues for disabled mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
49
|
+
var _render2, container, results;
|
|
50
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
51
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Accordion["default"], {
|
|
54
|
+
label: "Accordion",
|
|
55
|
+
assistiveText: "Assistive Text",
|
|
56
|
+
icon: folderIcon,
|
|
57
|
+
margin: "small",
|
|
58
|
+
disabled: true
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "test-expanded"))), container = _render2.container;
|
|
60
|
+
_context2.next = 3;
|
|
61
|
+
return (0, _axeHelper.axe)(container);
|
|
62
|
+
case 3:
|
|
63
|
+
results = _context2.sent;
|
|
64
|
+
expect(results).toHaveNoViolations();
|
|
65
|
+
case 5:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context2.stop();
|
|
68
|
+
}
|
|
69
|
+
}, _callee2);
|
|
70
|
+
})));
|
|
71
|
+
});
|
package/accordion/Accordion.js
CHANGED
|
@@ -15,26 +15,10 @@ var _utils = require("../common/utils");
|
|
|
15
15
|
var _variables = require("../common/variables");
|
|
16
16
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
17
17
|
var _BaseTypography = _interopRequireDefault(require("../utils/BaseTypography"));
|
|
18
|
-
var
|
|
18
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
19
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
20
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 &&
|
|
22
|
-
var expandLess = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
23
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
-
height: "24",
|
|
25
|
-
width: "24",
|
|
26
|
-
fill: "currentColor"
|
|
27
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
28
|
-
d: "m7.4 15.375-1.4-1.4 6-6 6 6-1.4 1.4-4.6-4.6Z"
|
|
29
|
-
}));
|
|
30
|
-
var expandMore = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
31
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
-
height: "24",
|
|
33
|
-
width: "24",
|
|
34
|
-
fill: "currentColor"
|
|
35
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
36
|
-
d: "m12 15.375-6-6 1.4-1.4 4.6 4.6 4.6-4.6 1.4 1.4Z"
|
|
37
|
-
}));
|
|
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; }
|
|
38
22
|
var DxcAccordion = function DxcAccordion(_ref) {
|
|
39
23
|
var _ref$label = _ref.label,
|
|
40
24
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -50,13 +34,11 @@ var DxcAccordion = function DxcAccordion(_ref) {
|
|
|
50
34
|
margin = _ref.margin,
|
|
51
35
|
_ref$tabIndex = _ref.tabIndex,
|
|
52
36
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
innerIsExpanded = _useState4[0],
|
|
59
|
-
setInnerIsExpanded = _useState4[1];
|
|
37
|
+
var id = (0, _react.useId)();
|
|
38
|
+
var _useState = (0, _react.useState)(defaultIsExpanded !== null && defaultIsExpanded !== void 0 ? defaultIsExpanded : false),
|
|
39
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
40
|
+
innerIsExpanded = _useState2[0],
|
|
41
|
+
setInnerIsExpanded = _useState2[1];
|
|
60
42
|
var colorsTheme = (0, _useTheme["default"])();
|
|
61
43
|
var handleAccordionState = function handleAccordionState() {
|
|
62
44
|
var _isExpanded;
|
|
@@ -80,8 +62,8 @@ var DxcAccordion = function DxcAccordion(_ref) {
|
|
|
80
62
|
isExpanded: isExpanded !== null && isExpanded !== void 0 ? isExpanded : innerIsExpanded
|
|
81
63
|
}, /*#__PURE__*/_react["default"].createElement(AccordionInfo, null, /*#__PURE__*/_react["default"].createElement(AccordionLabel, null, icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
82
64
|
disabled: disabled
|
|
83
|
-
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("
|
|
84
|
-
|
|
65
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
66
|
+
icon: icon
|
|
85
67
|
}) : icon), /*#__PURE__*/_react["default"].createElement(_BaseTypography["default"], {
|
|
86
68
|
color: disabled ? colorsTheme.accordion.disabledTitleLabelFontColor : colorsTheme.accordion.titleLabelFontColor,
|
|
87
69
|
fontFamily: colorsTheme.accordion.titleLabelFontFamily,
|
|
@@ -99,7 +81,9 @@ var DxcAccordion = function DxcAccordion(_ref) {
|
|
|
99
81
|
lineHeight: "1.5em"
|
|
100
82
|
}, assistiveText))), /*#__PURE__*/_react["default"].createElement(CollapseIndicator, {
|
|
101
83
|
disabled: disabled
|
|
102
|
-
},
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
85
|
+
icon: (isExpanded !== null && isExpanded !== void 0 ? isExpanded : innerIsExpanded) ? "expand_less" : "expand_more"
|
|
86
|
+
})))), (isExpanded !== null && isExpanded !== void 0 ? isExpanded : innerIsExpanded) && /*#__PURE__*/_react["default"].createElement(AccordionPanel, {
|
|
103
87
|
id: "accordion-panel-".concat(id),
|
|
104
88
|
role: "region",
|
|
105
89
|
"aria-labelledby": "accordion-".concat(id)
|
|
@@ -153,16 +137,18 @@ var AccordionLabel = _styledComponents["default"].span(_templateObject5 || (_tem
|
|
|
153
137
|
}, function (props) {
|
|
154
138
|
return props.theme.titleLabelPaddingLeft;
|
|
155
139
|
});
|
|
156
|
-
var IconContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-left: ", ";\n margin-right: ", ";\n color: ", ";\n\n svg
|
|
140
|
+
var IconContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-left: ", ";\n margin-right: ", ";\n color: ", ";\n font-size: ", ";\n\n svg {\n height: ", ";\n width: ", ";\n }\n"])), function (props) {
|
|
157
141
|
return props.theme.iconMarginLeft;
|
|
158
142
|
}, function (props) {
|
|
159
|
-
return props.theme.
|
|
143
|
+
return props.theme.iconMarginRight;
|
|
160
144
|
}, function (props) {
|
|
161
145
|
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
162
146
|
}, function (props) {
|
|
163
147
|
return props.theme.iconSize;
|
|
164
148
|
}, function (props) {
|
|
165
149
|
return props.theme.iconSize;
|
|
150
|
+
}, function (props) {
|
|
151
|
+
return props.theme.iconSize;
|
|
166
152
|
});
|
|
167
153
|
var AccordionAssistiveText = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n min-width: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"])), function (props) {
|
|
168
154
|
return props.theme.assistiveTextMinWidth;
|
|
@@ -171,7 +157,7 @@ var AccordionAssistiveText = _styledComponents["default"].span(_templateObject7
|
|
|
171
157
|
}, function (props) {
|
|
172
158
|
return props.theme.assistiveTextPaddingRight;
|
|
173
159
|
});
|
|
174
|
-
var CollapseIndicator = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n color: ", ";\n"])), function (props) {
|
|
160
|
+
var CollapseIndicator = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n font-size: 24px;\n color: ", ";\n"])), function (props) {
|
|
175
161
|
return props.disabled ? props.theme.disabledArrowColor : props.theme.arrowColor;
|
|
176
162
|
});
|
|
177
163
|
var AccordionPanel = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n"])), function (props) {
|
|
@@ -9,24 +9,6 @@ export default {
|
|
|
9
9
|
component: DxcAccordion,
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const folderIcon = (
|
|
13
|
-
<svg
|
|
14
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
-
enableBackground="new 0 0 24 24"
|
|
16
|
-
height="24px"
|
|
17
|
-
viewBox="0 0 24 24"
|
|
18
|
-
width="24px"
|
|
19
|
-
fill="currentColor"
|
|
20
|
-
>
|
|
21
|
-
<g>
|
|
22
|
-
<rect fill="none" height="24" width="24" />
|
|
23
|
-
</g>
|
|
24
|
-
<g>
|
|
25
|
-
<path d="M20,6h-8l-2-2H4C2.9,4,2.01,4.9,2.01,6L2,18c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V8C22,6.9,21.1,6,20,6z M16,16h2v-2h-2v-2 h2v-2h-2V8h4v10h-4V16z M16,16h-2v2H4V6h5.17l2,2H14v2h2v2h-2v2h2V16z" />
|
|
26
|
-
</g>
|
|
27
|
-
</svg>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
12
|
const smallIcon = (
|
|
31
13
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="20" width="20">
|
|
32
14
|
<path d="m7.646 18.333-.313-2.625q-.208-.125-.458-.27-.25-.146-.458-.271l-2.438 1.021-2.354-4.063 2.083-1.583V9.458L1.625 7.875l2.354-4.063 2.438 1.021q.208-.125.458-.27.25-.146.458-.271l.313-2.625h4.708l.313 2.625q.208.125.458.271.25.145.458.27l2.438-1.021 2.354 4.063-2.063 1.583v1.084l2.063 1.583-2.354 4.063-2.438-1.021q-.208.125-.458.271-.25.145-.458.27l-.313 2.625ZM10 12.979q1.229 0 2.104-.875T12.979 10q0-1.229-.875-2.104T10 7.021q-1.229 0-2.104.875T7.021 10q0 1.229.875 2.104t2.104.875Zm0-1.75q-.5 0-.865-.364-.364-.365-.364-.865t.364-.865q.365-.364.865-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.166q.605-.167 1.167-.5.562-.334 1.021-.792l2.021.854.833-1.375-1.771-1.354q.104-.292.146-.604.042-.313.042-.646 0-.292-.042-.594t-.125-.635l1.771-1.375-.834-1.375-2.02.875q-.48-.479-1.032-.802-.552-.323-1.156-.49l-.271-2.187H9.167l-.271 2.187q-.604.167-1.156.49-.552.323-1.011.781l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.459.458 1.011.781.552.323 1.156.49Z" />
|
|
@@ -36,7 +18,6 @@ const smallIcon = (
|
|
|
36
18
|
const facebookIcon = (
|
|
37
19
|
<svg
|
|
38
20
|
version="1.1"
|
|
39
|
-
id="Capa_1"
|
|
40
21
|
x="0px"
|
|
41
22
|
y="0px"
|
|
42
23
|
width="438.536px"
|
|
@@ -57,16 +38,6 @@ const facebookIcon = (
|
|
|
57
38
|
</svg>
|
|
58
39
|
);
|
|
59
40
|
|
|
60
|
-
const advancedTheme = {
|
|
61
|
-
accordion: {
|
|
62
|
-
backgroundColor: "#000000",
|
|
63
|
-
assistiveTextFontColor: "#ffffff",
|
|
64
|
-
titleLabelFontColor: "#ffffff",
|
|
65
|
-
arrowColor: "#5f249f",
|
|
66
|
-
iconColor: "#5f249f",
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
41
|
const opinionatedTheme = {
|
|
71
42
|
accordion: {
|
|
72
43
|
accentColor: "#5f249f",
|
|
@@ -80,7 +51,7 @@ export const Chromatic = () => (
|
|
|
80
51
|
<Title title="Component anatomy" theme="light" level={2} />
|
|
81
52
|
<ExampleContainer>
|
|
82
53
|
<Title title="With label" theme="light" level={4} />
|
|
83
|
-
<DxcAccordion label="Accordion">
|
|
54
|
+
<DxcAccordion label="Accordion 1">
|
|
84
55
|
<div>
|
|
85
56
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
86
57
|
lobortis eget.
|
|
@@ -89,7 +60,7 @@ export const Chromatic = () => (
|
|
|
89
60
|
</ExampleContainer>
|
|
90
61
|
<ExampleContainer>
|
|
91
62
|
<Title title="With assistive text" theme="light" level={4} />
|
|
92
|
-
<DxcAccordion label="Accordion" assistiveText="Assistive text">
|
|
63
|
+
<DxcAccordion label="Accordion 2" assistiveText="Assistive text">
|
|
93
64
|
<div>
|
|
94
65
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
95
66
|
lobortis eget.
|
|
@@ -98,7 +69,7 @@ export const Chromatic = () => (
|
|
|
98
69
|
</ExampleContainer>
|
|
99
70
|
<ExampleContainer>
|
|
100
71
|
<Title title="With icon" theme="light" level={4} />
|
|
101
|
-
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon=
|
|
72
|
+
<DxcAccordion label="Accordion 3" assistiveText="Assistive text" icon="folder">
|
|
102
73
|
<div>
|
|
103
74
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
104
75
|
lobortis eget.
|
|
@@ -107,7 +78,7 @@ export const Chromatic = () => (
|
|
|
107
78
|
</ExampleContainer>
|
|
108
79
|
<ExampleContainer>
|
|
109
80
|
<Title title="With smaller icon" theme="light" level={4} />
|
|
110
|
-
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon={smallIcon}>
|
|
81
|
+
<DxcAccordion label="Accordion 4" assistiveText="Assistive text" icon={smallIcon}>
|
|
111
82
|
<div>
|
|
112
83
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
113
84
|
lobortis eget.
|
|
@@ -123,19 +94,6 @@ export const Chromatic = () => (
|
|
|
123
94
|
</div>
|
|
124
95
|
</DxcAccordion>
|
|
125
96
|
</ExampleContainer>
|
|
126
|
-
<ExampleContainer>
|
|
127
|
-
<Title title="With bigger icon (image)" theme="light" level={4} />
|
|
128
|
-
<DxcAccordion
|
|
129
|
-
label="Accordion"
|
|
130
|
-
assistiveText="Assistive text"
|
|
131
|
-
icon="https://www.freepnglogos.com/uploads/facebook-logo-design-1.png"
|
|
132
|
-
>
|
|
133
|
-
<div>
|
|
134
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
135
|
-
lobortis eget.
|
|
136
|
-
</div>
|
|
137
|
-
</DxcAccordion>
|
|
138
|
-
</ExampleContainer>
|
|
139
97
|
<Title title="States" theme="light" level={2} />
|
|
140
98
|
<ExampleContainer pseudoState="pseudo-focus">
|
|
141
99
|
<Title title="Focused" theme="light" level={4} />
|
|
@@ -166,7 +124,7 @@ export const Chromatic = () => (
|
|
|
166
124
|
</ExampleContainer>
|
|
167
125
|
<ExampleContainer>
|
|
168
126
|
<Title title="Disabled" theme="light" level={4} />
|
|
169
|
-
<DxcAccordion label="Disabled" assistiveText="Assistive text" icon=
|
|
127
|
+
<DxcAccordion label="Disabled" assistiveText="Assistive text" icon="folder" disabled>
|
|
170
128
|
<div>
|
|
171
129
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
172
130
|
lobortis eget.
|
|
@@ -241,7 +199,7 @@ export const Chromatic = () => (
|
|
|
241
199
|
<ExampleContainer>
|
|
242
200
|
<Title title="With assistive text and icon" theme="light" level={4} />
|
|
243
201
|
<HalstackProvider theme={opinionatedTheme}>
|
|
244
|
-
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon=
|
|
202
|
+
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon="folder">
|
|
245
203
|
Content
|
|
246
204
|
</DxcAccordion>
|
|
247
205
|
</HalstackProvider>
|
|
@@ -271,7 +229,7 @@ export const Chromatic = () => (
|
|
|
271
229
|
<ExampleContainer>
|
|
272
230
|
<Title title="Disabled" theme="light" level={4} />
|
|
273
231
|
<HalstackProvider theme={opinionatedTheme}>
|
|
274
|
-
<DxcAccordion label="Disabled" assistiveText="Assistive text" icon=
|
|
232
|
+
<DxcAccordion label="Disabled" assistiveText="Assistive text" icon="folder" disabled>
|
|
275
233
|
<div>
|
|
276
234
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
|
|
277
235
|
leo lobortis eget.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
var _react = _interopRequireDefault(require("react"));
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
|
-
var _Accordion = _interopRequireDefault(require("./Accordion
|
|
6
|
+
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
7
7
|
describe("Accordion component tests", function () {
|
|
8
8
|
test("Renders with correct aria accessibility attributes", function () {
|
|
9
9
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Accordion["default"], {
|
|
@@ -30,7 +30,7 @@ describe("Accordion component tests", function () {
|
|
|
30
30
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Accordion["default"], {
|
|
31
31
|
label: "Accordion",
|
|
32
32
|
onChange: onChange
|
|
33
|
-
})),
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "test-expanded"))),
|
|
34
34
|
getByText = _render3.getByText;
|
|
35
35
|
_react2.fireEvent.click(getByText("Accordion"));
|
|
36
36
|
expect(onChange).toHaveBeenCalled();
|
|
@@ -41,7 +41,7 @@ describe("Accordion component tests", function () {
|
|
|
41
41
|
label: "Accordion",
|
|
42
42
|
onChange: onChange,
|
|
43
43
|
isExpanded: true
|
|
44
|
-
})),
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "test-expanded"))),
|
|
45
45
|
getByText = _render4.getByText,
|
|
46
46
|
getByRole = _render4.getByRole;
|
|
47
47
|
expect(getByRole("button").getAttribute("aria-expanded")).toBe("true");
|
package/accordion/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ type Props = {
|
|
|
23
23
|
*/
|
|
24
24
|
isExpanded?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Material Symbol name or SVG element used as the icon that will be placed next to panel label.
|
|
27
27
|
*/
|
|
28
28
|
icon?: string | SVG;
|
|
29
29
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
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 _AccordionGroup = _interopRequireDefault(require("./AccordionGroup"));
|
|
9
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
10
|
+
var folderIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
enableBackground: "new 0 0 24 24",
|
|
13
|
+
height: "24px",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
width: "24px",
|
|
16
|
+
fill: "currentColor"
|
|
17
|
+
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
18
|
+
fill: "none",
|
|
19
|
+
height: "24",
|
|
20
|
+
width: "24"
|
|
21
|
+
})), /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
22
|
+
d: "M20,6h-8l-2-2H4C2.9,4,2.01,4.9,2.01,6L2,18c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V8C22,6.9,21.1,6,20,6z M16,16h2v-2h-2v-2 h2v-2h-2V8h4v10h-4V16z M16,16h-2v2H4V6h5.17l2,2H14v2h2v2h-2v2h2V16z"
|
|
23
|
+
})));
|
|
24
|
+
describe("Accordion component accessibility tests", function () {
|
|
25
|
+
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
26
|
+
var _render, container, results;
|
|
27
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AccordionGroup["default"], {
|
|
31
|
+
defaultIndexActive: 1,
|
|
32
|
+
margin: "small"
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement(_AccordionGroup["default"].Accordion, {
|
|
34
|
+
label: "Accordion1",
|
|
35
|
+
assistiveText: "Assistive Text1",
|
|
36
|
+
icon: folderIcon
|
|
37
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "First accordion")), /*#__PURE__*/_react["default"].createElement(_AccordionGroup["default"].Accordion, {
|
|
38
|
+
label: "Accordion2",
|
|
39
|
+
assistiveText: "Assistive Text2",
|
|
40
|
+
icon: folderIcon
|
|
41
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "Second accordion")))), container = _render.container;
|
|
42
|
+
_context.next = 3;
|
|
43
|
+
return (0, _axeHelper.axe)(container);
|
|
44
|
+
case 3:
|
|
45
|
+
results = _context.sent;
|
|
46
|
+
expect(results).toHaveNoViolations();
|
|
47
|
+
case 5:
|
|
48
|
+
case "end":
|
|
49
|
+
return _context.stop();
|
|
50
|
+
}
|
|
51
|
+
}, _callee);
|
|
52
|
+
})));
|
|
53
|
+
it("Should not have basic accessibility issues for disabled mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
54
|
+
var _render2, container, results;
|
|
55
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
56
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AccordionGroup["default"], {
|
|
59
|
+
defaultIndexActive: 1,
|
|
60
|
+
margin: "small",
|
|
61
|
+
disabled: true
|
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement(_AccordionGroup["default"].Accordion, {
|
|
63
|
+
label: "Accordion1",
|
|
64
|
+
assistiveText: "Assistive Text1",
|
|
65
|
+
icon: folderIcon
|
|
66
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "First accordion")), /*#__PURE__*/_react["default"].createElement(_AccordionGroup["default"].Accordion, {
|
|
67
|
+
label: "Accordion2",
|
|
68
|
+
assistiveText: "Assistive Text2",
|
|
69
|
+
icon: folderIcon
|
|
70
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "Second accordion")))), container = _render2.container;
|
|
71
|
+
_context2.next = 3;
|
|
72
|
+
return (0, _axeHelper.axe)(container);
|
|
73
|
+
case 3:
|
|
74
|
+
results = _context2.sent;
|
|
75
|
+
expect(results).toHaveNoViolations();
|
|
76
|
+
case 5:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context2.stop();
|
|
79
|
+
}
|
|
80
|
+
}, _callee2);
|
|
81
|
+
})));
|
|
82
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import AccordionGroupPropsType
|
|
3
|
-
export declare const AccordionGroupAccordionContext: React.Context<AccordionGroupAccordionContextProps>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import AccordionGroupPropsType from "./types";
|
|
4
3
|
declare const DxcAccordionGroup: {
|
|
5
4
|
({ defaultIndexActive, indexActive, disabled, onActiveChange, margin, children, }: AccordionGroupPropsType): JSX.Element;
|
|
6
5
|
Accordion: ({ ...childProps }: import("./types").AccordionPropsType) => JSX.Element;
|