@dxc-technology/halstack-react 0.0.0-4e1277a → 0.0.0-4e3dbad
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 +42 -5
- package/HalstackContext.js +28 -18
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +16 -30
- 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.js +1 -1
- 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 +1 -1
- 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.js +4 -3
- package/action-icon/ActionIcon.stories.tsx +3 -3
- package/action-icon/ActionIcon.test.d.ts +1 -0
- package/action-icon/ActionIcon.test.js +1 -1
- 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.js +6 -4
- package/badge/Badge.stories.tsx +11 -11
- package/badge/Badge.test.d.ts +1 -0
- package/badge/Badge.test.js +2 -2
- package/badge/types.d.ts +1 -1
- package/bar-chart/BarChart.d.ts +4 -0
- package/bar-chart/BarChart.js +152 -0
- package/bar-chart/BarChart.stories.tsx +281 -0
- package/bar-chart/BarChart.test.d.ts +1 -0
- package/bar-chart/BarChart.test.js +194 -0
- package/bar-chart/theme.d.ts +3 -0
- package/bar-chart/theme.js +31 -0
- package/bar-chart/types.d.ts +118 -0
- package/bar-chart/types.js +5 -0
- package/bleed/Bleed.stories.tsx +0 -1
- 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 +40 -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 +2 -2
- package/button/Button.stories.tsx +3 -4
- package/button/Button.test.d.ts +1 -0
- package/button/Button.test.js +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.d.ts +0 -1
- package/common/coreTokens.js +3 -4
- package/common/variables.d.ts +48 -5
- package/common/variables.js +110 -73
- package/container/Container.stories.tsx +3 -3
- package/container/types.d.ts +113 -11
- 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 +3 -5
- package/contextual-menu/ContextualMenu.js +118 -53
- package/contextual-menu/ContextualMenu.stories.tsx +124 -75
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +200 -24
- 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 +88 -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 +54 -11
- 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/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.stories.tsx +2 -1
- package/divider/Divider.test.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.js +183 -0
- package/dropdown/Dropdown.js +31 -66
- 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 +2 -4
- 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.js +8 -6
- package/footer/Footer.stories.tsx +40 -3
- package/footer/Footer.test.d.ts +1 -0
- package/footer/Footer.test.js +1 -1
- package/footer/Icons.js +2 -30
- package/footer/types.d.ts +1 -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/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.js +1 -1
- package/icon/Icon.stories.tsx +6 -4
- package/image/Image.accessibility.test.d.ts +1 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.js +1 -1
- package/layout/ApplicationLayout.js +9 -6
- 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 +3 -1
- package/main.js +15 -1
- package/nav-tabs/NavTabs.accessibility.test.d.ts +1 -0
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.js +19 -4
- package/nav-tabs/NavTabs.stories.tsx +41 -23
- package/nav-tabs/NavTabs.test.d.ts +1 -0
- package/nav-tabs/NavTabs.test.js +10 -9
- package/nav-tabs/Tab.js +17 -18
- 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.js +6 -3
- package/number-input/NumberInput.stories.tsx +11 -16
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +6 -7
- package/package.json +34 -28
- 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 +1 -1
- package/resultset-table/ResultsetTable.js +47 -15
- package/resultset-table/ResultsetTable.stories.tsx +19 -3
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +111 -32
- package/resultset-table/types.d.ts +41 -13
- package/select/Listbox.d.ts +3 -3
- package/select/Listbox.js +33 -29
- package/select/Option.d.ts +3 -3
- package/select/Option.js +21 -15
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +227 -0
- package/select/Select.js +85 -192
- package/select/Select.stories.tsx +74 -117
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +348 -550
- package/select/selectUtils.d.ts +41 -0
- package/select/selectUtils.js +129 -0
- 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 +16 -12
- 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.d.ts +1 -1
- package/spinner/Spinner.js +32 -47
- 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.test.d.ts +1 -0
- package/status-light/StatusLight.test.js +1 -1
- 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/Table.accessibility.test.d.ts +1 -0
- package/table/Table.accessibility.test.js +92 -0
- package/table/Table.js +2 -11
- package/table/Table.stories.tsx +15 -10
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +2 -4
- package/table/types.d.ts +1 -15
- package/tabs/Tab.js +6 -5
- 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 +7 -3
- 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 +56 -73
- package/text-input/TextInput.stories.tsx +20 -8
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +2 -3
- 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/tooltip/Tooltip.accessibility.test.d.ts +1 -0
- package/tooltip/Tooltip.accessibility.test.js +144 -0
- package/tooltip/Tooltip.d.ts +4 -0
- package/tooltip/Tooltip.js +50 -0
- package/tooltip/Tooltip.stories.tsx +111 -0
- package/tooltip/Tooltip.test.d.ts +1 -0
- package/tooltip/Tooltip.test.js +112 -0
- package/tooltip/types.d.ts +16 -0
- package/tooltip/types.js +5 -0
- 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/typography/Typography.test.js +23 -0
- package/useTheme.d.ts +31 -5
- package/useTranslatedLabels.d.ts +11 -0
- package/utils/BaseTypography.js +45 -41
- package/utils/FocusLock.js +3 -2
- package/utils/useWidth.d.ts +2 -0
- package/utils/useWidth.js +30 -0
- 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 +1 -1
- package/contextual-menu/MenuItemAction.d.ts +0 -4
- package/contextual-menu/MenuItemAction.js +0 -46
- 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
|
@@ -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
|
@@ -219,6 +219,29 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
219
219
|
focusBorderThickness: string;
|
|
220
220
|
focusBorderRadius: string;
|
|
221
221
|
};
|
|
222
|
+
contextualMenu: {
|
|
223
|
+
fontFamily: string;
|
|
224
|
+
backgroundColor: string;
|
|
225
|
+
borderColor: string;
|
|
226
|
+
menuItemFontColor: string;
|
|
227
|
+
menuItemFontSize: string;
|
|
228
|
+
menuItemFontStyle: string;
|
|
229
|
+
menuItemFontWeight: string;
|
|
230
|
+
menuItemLineHeight: string;
|
|
231
|
+
hoverMenuItemBackgroundColor: string;
|
|
232
|
+
activeMenuItemBackgroundColor: string;
|
|
233
|
+
selectedMenuItemBackgroundColor: string;
|
|
234
|
+
hoverSelectedMenuItemBackgroundColor: string;
|
|
235
|
+
activeSelectedMenuItemBackgroundColor: string;
|
|
236
|
+
selectedMenuItemFontWeight: string;
|
|
237
|
+
sectionTitleFontColor: string;
|
|
238
|
+
sectionTitleFontSize: string;
|
|
239
|
+
sectionTitleFontStyle: string;
|
|
240
|
+
sectionTitleFontWeight: string;
|
|
241
|
+
sectionTitleLineHeight: string;
|
|
242
|
+
iconColor: string;
|
|
243
|
+
iconSize: string;
|
|
244
|
+
};
|
|
222
245
|
dateInput: {
|
|
223
246
|
pickerBackgroundColor: string;
|
|
224
247
|
pickerFontColor: string;
|
|
@@ -253,8 +276,7 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
253
276
|
dialog: {
|
|
254
277
|
overlayColor: string;
|
|
255
278
|
backgroundColor: string;
|
|
256
|
-
|
|
257
|
-
closeIconHeight: string;
|
|
279
|
+
closeIconSize: string;
|
|
258
280
|
closeIconTopPosition: string;
|
|
259
281
|
closeIconRightPosition: string;
|
|
260
282
|
closeIconBackgroundColor: string;
|
|
@@ -292,7 +314,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
292
314
|
disabledColor: string;
|
|
293
315
|
disabledButtonBackgroundColor: string;
|
|
294
316
|
disabledButtonBorderColor: string;
|
|
295
|
-
disabledBorderColor: string;
|
|
296
317
|
optionBackgroundColor: string;
|
|
297
318
|
hoverOptionBackgroundColor: string;
|
|
298
319
|
activeOptionBackgroundColor: string;
|
|
@@ -332,7 +353,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
332
353
|
focusDropBorderColor: string;
|
|
333
354
|
disabledDropBorderColor: string;
|
|
334
355
|
dragoverDropBackgroundColor: string;
|
|
335
|
-
activeFileItemIconBackgrounColor: string;
|
|
336
356
|
errorFileItemBorderColor: string;
|
|
337
357
|
errorFileItemBackgroundColor: string;
|
|
338
358
|
errorFilePreviewBackgroundColor: string;
|
|
@@ -533,8 +553,8 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
533
553
|
totalItemsContainerMarginLeft: string;
|
|
534
554
|
};
|
|
535
555
|
paragraph: {
|
|
536
|
-
fontColor: string;
|
|
537
556
|
display: string;
|
|
557
|
+
fontColor: string;
|
|
538
558
|
fontSize: string;
|
|
539
559
|
fontWeight: string;
|
|
540
560
|
};
|
|
@@ -1002,7 +1022,13 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
1002
1022
|
helperTextLineHeight: string;
|
|
1003
1023
|
disabledHelperTextFontColor: string;
|
|
1004
1024
|
prefixColor: string;
|
|
1025
|
+
prefixDividerBorderWidth: string;
|
|
1026
|
+
prefixDividerBorderStyle: string;
|
|
1027
|
+
prefixDividerPaddingRight: string;
|
|
1005
1028
|
suffixColor: string;
|
|
1029
|
+
suffixDividerBorderStyle: string;
|
|
1030
|
+
suffixDividerBorderWidth: string;
|
|
1031
|
+
suffixDividerPaddingLeft: string;
|
|
1006
1032
|
disabledPrefixColor: string;
|
|
1007
1033
|
disabledSuffixColor: string;
|
|
1008
1034
|
placeholderFontColor: string;
|
|
@@ -1165,6 +1191,17 @@ declare const HalstackLanguageContext: React.Context<DeepPartial<{
|
|
|
1165
1191
|
warningTitleText: string;
|
|
1166
1192
|
errorTitleText: string;
|
|
1167
1193
|
};
|
|
1194
|
+
barChart: {
|
|
1195
|
+
ariaLabel: string;
|
|
1196
|
+
filterLabel: string;
|
|
1197
|
+
filterPlaceholder: string;
|
|
1198
|
+
loadingDataMessage: string;
|
|
1199
|
+
noDataMessageBody: string;
|
|
1200
|
+
noDataMessageTitle: string;
|
|
1201
|
+
noMatchesMessageBody: string;
|
|
1202
|
+
noMatchesMessageTitle: string;
|
|
1203
|
+
retryButtonLabel: string;
|
|
1204
|
+
};
|
|
1168
1205
|
dateInput: {
|
|
1169
1206
|
invalidDateErrorMessage: string;
|
|
1170
1207
|
};
|
package/HalstackContext.js
CHANGED
|
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(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) {
|
|
@@ -54,7 +54,7 @@ var parseAdvancedTheme = function parseAdvancedTheme(advancedTheme) {
|
|
|
54
54
|
return allTokensCopy;
|
|
55
55
|
};
|
|
56
56
|
var parseTheme = function parseTheme(theme) {
|
|
57
|
-
var _theme$alert$baseColo, _theme$alert, _theme$alert$accentCo, _theme$alert2, _theme$alert$accentCo2, _theme$alert3, _theme$alert$overlayC, _theme$alert4, _theme$accordion$assi, _theme$accordion, _theme$accordion$titl, _theme$accordion2, _theme$accordion$acce, _theme$accordion3, _theme$accordion$acce2, _theme$accordion4, _addLightness, _theme$accordion5, _theme$box$baseColor, _theme$box, _theme$button$primary, _theme$button, _theme$button$baseCol, _theme$button2, _theme$button$baseCol2, _theme$button3, _theme$button$seconda, _theme$button4, _theme$button$baseCol3, _theme$button5, _theme$button$baseCol4, _theme$button6, _theme$button$baseCol5, _theme$button7, _subLightness, _theme$button8, _subLightness2, _theme$button9, _subLightness3, _theme$button10, _addLightness2, _theme$button11, _addLightness3, _theme$button12, _theme$checkbox$baseC, _theme$checkbox, _theme$checkbox$baseC2, _theme$checkbox2, _theme$checkbox$check, _theme$checkbox3, _theme$checkbox$fontC, _theme$checkbox4, _subLightness4, _theme$checkbox5, _subLightness5, _theme$checkbox6, _theme$chip$baseColor, _theme$chip, _theme$chip$fontColor, _theme$chip2, _theme$chip$iconColor, _theme$chip3, _subLightness6, _theme$chip4, _subLightness7, _theme$chip5, _theme$dateInput$base, _theme$dateInput, _theme$dateInput$sele, _theme$dateInput2,
|
|
57
|
+
var _theme$alert$baseColo, _theme$alert, _theme$alert$accentCo, _theme$alert2, _theme$alert$accentCo2, _theme$alert3, _theme$alert$overlayC, _theme$alert4, _theme$accordion$assi, _theme$accordion, _theme$accordion$titl, _theme$accordion2, _theme$accordion$acce, _theme$accordion3, _theme$accordion$acce2, _theme$accordion4, _addLightness, _theme$accordion5, _theme$box$baseColor, _theme$box, _theme$button$primary, _theme$button, _theme$button$baseCol, _theme$button2, _theme$button$baseCol2, _theme$button3, _theme$button$seconda, _theme$button4, _theme$button$baseCol3, _theme$button5, _theme$button$baseCol4, _theme$button6, _theme$button$baseCol5, _theme$button7, _subLightness, _theme$button8, _subLightness2, _theme$button9, _subLightness3, _theme$button10, _addLightness2, _theme$button11, _addLightness3, _theme$button12, _theme$checkbox$baseC, _theme$checkbox, _theme$checkbox$baseC2, _theme$checkbox2, _theme$checkbox$check, _theme$checkbox3, _theme$checkbox$fontC, _theme$checkbox4, _subLightness4, _theme$checkbox5, _subLightness5, _theme$checkbox6, _theme$chip$baseColor, _theme$chip, _theme$chip$fontColor, _theme$chip2, _theme$chip$iconColor, _theme$chip3, _subLightness6, _theme$chip4, _subLightness7, _theme$chip5, _theme$contextualMenu, _theme$contextualMenu2, _subLightness8, _theme$contextualMenu3, _subLightness9, _theme$contextualMenu4, _theme$contextualMenu5, _theme$contextualMenu6, _subLightness10, _theme$contextualMenu7, _subLightness11, _theme$contextualMenu8, _theme$contextualMenu9, _theme$contextualMenu10, _theme$contextualMenu11, _theme$contextualMenu12, _theme$contextualMenu13, _theme$contextualMenu14, _theme$dateInput$base, _theme$dateInput, _theme$dateInput$sele, _theme$dateInput2, _subLightness12, _theme$dateInput3, _theme$dateInput$sele2, _theme$dateInput4, _theme$dateInput$base2, _theme$dateInput5, _subLightness13, _theme$dateInput6, _theme$dateInput$sele3, _theme$dateInput7, _addLightness4, _theme$dateInput8, _addLightness5, _theme$dateInput9, _addLightness6, _theme$dateInput10, _theme$dialog$baseCol, _theme$dialog, _theme$dialog$closeIc, _theme$dialog2, _theme$dialog$overlay, _theme$dialog3, _theme$dropdown$baseC, _theme$dropdown, _theme$dropdown$fontC, _theme$dropdown2, _theme$dropdown$fontC2, _theme$dropdown3, _theme$dropdown$fontC3, _theme$dropdown4, _theme$dropdown$optio, _theme$dropdown5, _theme$dropdown$optio2, _theme$dropdown6, _subLightness14, _theme$dropdown7, _subLightness15, _theme$dropdown8, _subLightness16, _theme$dropdown9, _subLightness17, _theme$dropdown10, _theme$fileInput$font, _theme$fileInput, _theme$fileInput$font2, _theme$fileInput2, _theme$fileInput$font3, _theme$fileInput3, _theme$fileInput$font4, _theme$fileInput4, _theme$footer$baseCol, _theme$footer, _theme$footer$fontCol, _theme$footer2, _theme$footer$fontCol2, _theme$footer3, _theme$footer$fontCol3, _theme$footer4, _theme$footer$accentC, _theme$footer5, _theme$footer$logo, _theme$footer6, _theme$header$baseCol, _theme$header, _theme$header$accentC, _theme$header2, _theme$header$menuBas, _theme$header3, _theme$header$fontCol, _theme$header4, _theme$header$hamburg, _theme$header5, _addLightness7, _theme$header6, _theme$header$logo, _theme$header7, _theme$header$logoRes, _theme$header8, _theme$header$content, _theme$header9, _theme$header$overlay, _theme$header10, _theme$link$baseColor, _theme$link, _theme$link$baseColor2, _theme$link2, _theme$navTabs$baseCo, _theme$navTabs, _theme$navTabs$baseCo2, _theme$navTabs2, _theme$navTabs$baseCo3, _theme$navTabs3, _theme$navTabs$baseCo4, _theme$navTabs4, _theme$navTabs$accent, _theme$navTabs5, _addLightness8, _theme$navTabs6, _addLightness9, _theme$navTabs7, _theme$paginator$base, _theme$paginator, _theme$paginator$font, _theme$paginator2, _theme$progressBar$ac, _theme$progressBar, _theme$progressBar$ba, _theme$progressBar2, _theme$progressBar$fo, _theme$progressBar3, _theme$progressBar$fo2, _theme$progressBar4, _theme$progressBar$fo3, _theme$progressBar5, _theme$progressBar$ov, _theme$progressBar6, _theme$progressBar$ov2, _theme$progressBar7, _theme$quickNav$fontC, _theme$quickNav, _theme$quickNav$accen, _theme$quickNav2, _theme$radioGroup$bas, _theme$radioGroup, _theme$radioGroup$fon, _theme$radioGroup2, _theme$radioGroup$fon2, _theme$radioGroup3, _theme$radioGroup$fon3, _theme$radioGroup4, _subLightness18, _theme$radioGroup5, _subLightness19, _theme$radioGroup6, _theme$select$selecte, _theme$select, _theme$select$fontCol, _theme$select2, _theme$select$fontCol2, _theme$select3, _theme$select$fontCol3, _theme$select4, _theme$select$optionF, _theme$select5, _addLightness10, _theme$select6, _theme$select$fontCol4, _theme$select7, _theme$select$hoverBo, _theme$select8, _subLightness20, _theme$select9, _subLightness21, _theme$select10, _theme$sidenav$baseCo, _theme$sidenav, _theme$slider$fontCol, _theme$slider, _theme$slider$fontCol2, _theme$slider2, _theme$slider$fontCol3, _theme$slider3, _theme$slider$baseCol, _theme$slider4, _theme$slider$baseCol2, _theme$slider5, _theme$slider$baseCol3, _theme$slider6, _theme$slider$baseCol4, _theme$slider7, _theme$slider$totalLi, _theme$slider8, _subLightness22, _theme$slider9, _subLightness23, _theme$slider10, _theme$spinner$accent, _theme$spinner, _theme$spinner$baseCo, _theme$spinner2, _theme$spinner$overla, _theme$spinner3, _theme$spinner$fontCo, _theme$spinner4, _theme$spinner$fontCo2, _theme$spinner5, _theme$spinner$overla2, _theme$spinner6, _theme$spinner$overla3, _theme$spinner7, _theme$switch$checked, _theme$switch, _theme$switch$fontCol, _theme$switch2, _addLightness11, _theme$switch3, _theme$table$baseColo, _theme$table, _theme$table$headerFo, _theme$table2, _theme$table$cellFont, _theme$table3, _theme$table$headerFo2, _theme$table4, _theme$tabs$baseColor, _theme$tabs, _theme$tabs$baseColor2, _theme$tabs2, _theme$tabs$baseColor3, _theme$tabs3, _theme$tabs$baseColor4, _theme$tabs4, _addLightness12, _theme$tabs5, _addLightness13, _theme$tabs6, _theme$tag$fontColor, _theme$tag, _theme$tag$iconColor, _theme$tag2, _theme$textInput$font, _theme$textInput, _theme$textInput$font2, _theme$textInput2, _theme$textInput$font3, _theme$textInput3, _theme$textInput$font4, _theme$textInput4, _theme$textInput$font5, _theme$textInput5, _theme$textInput$font6, _theme$textInput6, _theme$textInput$font7, _theme$textInput7, _theme$textInput$hove, _theme$textInput8, _addLightness14, _theme$textInput9, _addLightness15, _theme$textInput10, _addLightness16, _theme$textInput11, _theme$textarea$fontC, _theme$textarea, _theme$textarea$fontC2, _theme$textarea2, _theme$textarea$fontC3, _theme$textarea3, _theme$textarea$hover, _theme$textarea4, _addLightness17, _theme$textarea5, _theme$toggleGroup$se, _theme$toggleGroup, _theme$toggleGroup$se2, _theme$toggleGroup2, _theme$toggleGroup$un, _theme$toggleGroup3, _theme$toggleGroup$se3, _theme$toggleGroup4, _theme$toggleGroup$un2, _theme$toggleGroup5, _subLightness24, _theme$toggleGroup6, _subLightness25, _theme$toggleGroup7, _addLightness18, _theme$toggleGroup8, _addLightness19, _theme$toggleGroup9, _subLightness26, _theme$toggleGroup10, _theme$wizard$baseCol, _theme$wizard, _theme$wizard$selecte, _theme$wizard2, _theme$wizard$baseCol2, _theme$wizard3, _theme$wizard$fontCol, _theme$wizard4, _theme$wizard$fontCol2, _theme$wizard5, _theme$wizard$fontCol3, _theme$wizard6, _theme$wizard$fontCol4, _theme$wizard7, _addLightness20, _theme$wizard8, _addLightness21, _theme$wizard9, _addLightness22, _theme$wizard10, _addLightness23, _theme$wizard11;
|
|
58
58
|
var componentTokensCopy = JSON.parse(JSON.stringify(_variables.componentTokens));
|
|
59
59
|
var alertTokens = componentTokensCopy.alert;
|
|
60
60
|
alertTokens.infoBackgroundColor = (_theme$alert$baseColo = theme === null || theme === void 0 ? void 0 : (_theme$alert = theme.alert) === null || _theme$alert === void 0 ? void 0 : _theme$alert.baseColor) !== null && _theme$alert$baseColo !== void 0 ? _theme$alert$baseColo : alertTokens.infoBackgroundColor;
|
|
@@ -95,13 +95,23 @@ var parseTheme = function parseTheme(theme) {
|
|
|
95
95
|
chipTokens.iconColor = (_theme$chip$iconColor = theme === null || theme === void 0 ? void 0 : (_theme$chip3 = theme.chip) === null || _theme$chip3 === void 0 ? void 0 : _theme$chip3.iconColor) !== null && _theme$chip$iconColor !== void 0 ? _theme$chip$iconColor : chipTokens.iconColor;
|
|
96
96
|
chipTokens.hoverIconColor = (_subLightness6 = subLightness(10, theme === null || theme === void 0 ? void 0 : (_theme$chip4 = theme.chip) === null || _theme$chip4 === void 0 ? void 0 : _theme$chip4.iconColor)) !== null && _subLightness6 !== void 0 ? _subLightness6 : chipTokens.hoverIconColor;
|
|
97
97
|
chipTokens.activeIconColor = (_subLightness7 = subLightness(30, theme === null || theme === void 0 ? void 0 : (_theme$chip5 = theme.chip) === null || _theme$chip5 === void 0 ? void 0 : _theme$chip5.iconColor)) !== null && _subLightness7 !== void 0 ? _subLightness7 : chipTokens.activeIconColor;
|
|
98
|
+
var contextualMenu = componentTokensCopy.contextualMenu;
|
|
99
|
+
contextualMenu.selectedMenuItemBackgroundColor = (_theme$contextualMenu = theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu2 = theme.contextualMenu) === null || _theme$contextualMenu2 === void 0 ? void 0 : _theme$contextualMenu2.accentColor) !== null && _theme$contextualMenu !== void 0 ? _theme$contextualMenu : contextualMenu.selectedMenuItemBackgroundColor;
|
|
100
|
+
contextualMenu.hoverSelectedMenuItemBackgroundColor = (_subLightness8 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu3 = theme.contextualMenu) === null || _theme$contextualMenu3 === void 0 ? void 0 : _theme$contextualMenu3.accentColor)) !== null && _subLightness8 !== void 0 ? _subLightness8 : contextualMenu.hoverSelectedMenuItemBackgroundColor;
|
|
101
|
+
contextualMenu.activeSelectedMenuItemBackgroundColor = (_subLightness9 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu4 = theme.contextualMenu) === null || _theme$contextualMenu4 === void 0 ? void 0 : _theme$contextualMenu4.accentColor)) !== null && _subLightness9 !== void 0 ? _subLightness9 : contextualMenu.activeSelectedMenuItemBackgroundColor;
|
|
102
|
+
contextualMenu.backgroundColor = (_theme$contextualMenu5 = theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu6 = theme.contextualMenu) === null || _theme$contextualMenu6 === void 0 ? void 0 : _theme$contextualMenu6.baseColor) !== null && _theme$contextualMenu5 !== void 0 ? _theme$contextualMenu5 : contextualMenu.backgroundColor;
|
|
103
|
+
contextualMenu.hoverMenuItemBackgroundColor = (_subLightness10 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu7 = theme.contextualMenu) === null || _theme$contextualMenu7 === void 0 ? void 0 : _theme$contextualMenu7.baseColor)) !== null && _subLightness10 !== void 0 ? _subLightness10 : contextualMenu.hoverMenuItemBackgroundColor;
|
|
104
|
+
contextualMenu.activeMenuItemBackgroundColor = (_subLightness11 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu8 = theme.contextualMenu) === null || _theme$contextualMenu8 === void 0 ? void 0 : _theme$contextualMenu8.baseColor)) !== null && _subLightness11 !== void 0 ? _subLightness11 : contextualMenu.activeMenuItemBackgroundColor;
|
|
105
|
+
contextualMenu.menuItemFontColor = (_theme$contextualMenu9 = theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu10 = theme.contextualMenu) === null || _theme$contextualMenu10 === void 0 ? void 0 : _theme$contextualMenu10.fontColor) !== null && _theme$contextualMenu9 !== void 0 ? _theme$contextualMenu9 : contextualMenu.menuItemFontColor;
|
|
106
|
+
contextualMenu.sectionTitleFontColor = (_theme$contextualMenu11 = theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu12 = theme.contextualMenu) === null || _theme$contextualMenu12 === void 0 ? void 0 : _theme$contextualMenu12.fontColor) !== null && _theme$contextualMenu11 !== void 0 ? _theme$contextualMenu11 : contextualMenu.sectionTitleFontColor;
|
|
107
|
+
contextualMenu.iconColor = (_theme$contextualMenu13 = theme === null || theme === void 0 ? void 0 : (_theme$contextualMenu14 = theme.contextualMenu) === null || _theme$contextualMenu14 === void 0 ? void 0 : _theme$contextualMenu14.iconColor) !== null && _theme$contextualMenu13 !== void 0 ? _theme$contextualMenu13 : contextualMenu.iconColor;
|
|
98
108
|
var dateTokens = componentTokensCopy.dateInput;
|
|
99
109
|
dateTokens.pickerSelectedBackgroundColor = (_theme$dateInput$base = theme === null || theme === void 0 ? void 0 : (_theme$dateInput = theme.dateInput) === null || _theme$dateInput === void 0 ? void 0 : _theme$dateInput.baseColor) !== null && _theme$dateInput$base !== void 0 ? _theme$dateInput$base : dateTokens.pickerSelectedBackgroundColor;
|
|
100
110
|
dateTokens.pickerSelectedFontColor = (_theme$dateInput$sele = theme === null || theme === void 0 ? void 0 : (_theme$dateInput2 = theme.dateInput) === null || _theme$dateInput2 === void 0 ? void 0 : _theme$dateInput2.selectedFontColor) !== null && _theme$dateInput$sele !== void 0 ? _theme$dateInput$sele : dateTokens.pickerSelectedFontColor;
|
|
101
|
-
dateTokens.pickerActiveBackgroundColor = (
|
|
111
|
+
dateTokens.pickerActiveBackgroundColor = (_subLightness12 = subLightness(8, theme === null || theme === void 0 ? void 0 : (_theme$dateInput3 = theme.dateInput) === null || _theme$dateInput3 === void 0 ? void 0 : _theme$dateInput3.baseColor)) !== null && _subLightness12 !== void 0 ? _subLightness12 : dateTokens.pickerActiveBackgroundColor;
|
|
102
112
|
dateTokens.pickerActiveFontColor = (_theme$dateInput$sele2 = theme === null || theme === void 0 ? void 0 : (_theme$dateInput4 = theme.dateInput) === null || _theme$dateInput4 === void 0 ? void 0 : _theme$dateInput4.selectedFontColor) !== null && _theme$dateInput$sele2 !== void 0 ? _theme$dateInput$sele2 : dateTokens.pickerActiveFontColor;
|
|
103
113
|
dateTokens.pickerCurrentYearFontColor = (_theme$dateInput$base2 = theme === null || theme === void 0 ? void 0 : (_theme$dateInput5 = theme.dateInput) === null || _theme$dateInput5 === void 0 ? void 0 : _theme$dateInput5.baseColor) !== null && _theme$dateInput$base2 !== void 0 ? _theme$dateInput$base2 : dateTokens.pickerCurrentYearFontColor;
|
|
104
|
-
dateTokens.pickerHeaderActiveBackgroundColor = (
|
|
114
|
+
dateTokens.pickerHeaderActiveBackgroundColor = (_subLightness13 = subLightness(8, theme === null || theme === void 0 ? void 0 : (_theme$dateInput6 = theme.dateInput) === null || _theme$dateInput6 === void 0 ? void 0 : _theme$dateInput6.baseColor)) !== null && _subLightness13 !== void 0 ? _subLightness13 : dateTokens.pickerHeaderActiveBackgroundColor;
|
|
105
115
|
dateTokens.pickerHeaderActiveFontColor = (_theme$dateInput$sele3 = theme === null || theme === void 0 ? void 0 : (_theme$dateInput7 = theme.dateInput) === null || _theme$dateInput7 === void 0 ? void 0 : _theme$dateInput7.selectedFontColor) !== null && _theme$dateInput$sele3 !== void 0 ? _theme$dateInput$sele3 : dateTokens.pickerHeaderActiveFontColor;
|
|
106
116
|
dateTokens.pickerHoverBackgroundColor = (_addLightness4 = addLightness(52, theme === null || theme === void 0 ? void 0 : (_theme$dateInput8 = theme.dateInput) === null || _theme$dateInput8 === void 0 ? void 0 : _theme$dateInput8.baseColor)) !== null && _addLightness4 !== void 0 ? _addLightness4 : dateTokens.pickerHoverBackgroundColor;
|
|
107
117
|
dateTokens.pickerCurrentDateBorderColor = (_addLightness5 = addLightness(42, theme === null || theme === void 0 ? void 0 : (_theme$dateInput9 = theme.dateInput) === null || _theme$dateInput9 === void 0 ? void 0 : _theme$dateInput9.baseColor)) !== null && _addLightness5 !== void 0 ? _addLightness5 : dateTokens.pickerCurrentDateBorderColor;
|
|
@@ -117,10 +127,10 @@ var parseTheme = function parseTheme(theme) {
|
|
|
117
127
|
dropdownTokens.caretIconColor = (_theme$dropdown$fontC3 = theme === null || theme === void 0 ? void 0 : (_theme$dropdown4 = theme.dropdown) === null || _theme$dropdown4 === void 0 ? void 0 : _theme$dropdown4.fontColor) !== null && _theme$dropdown$fontC3 !== void 0 ? _theme$dropdown$fontC3 : dropdownTokens.caretIconColor;
|
|
118
128
|
dropdownTokens.optionFontColor = (_theme$dropdown$optio = theme === null || theme === void 0 ? void 0 : (_theme$dropdown5 = theme.dropdown) === null || _theme$dropdown5 === void 0 ? void 0 : _theme$dropdown5.optionFontColor) !== null && _theme$dropdown$optio !== void 0 ? _theme$dropdown$optio : dropdownTokens.optionFontColor;
|
|
119
129
|
dropdownTokens.optionIconColor = (_theme$dropdown$optio2 = theme === null || theme === void 0 ? void 0 : (_theme$dropdown6 = theme.dropdown) === null || _theme$dropdown6 === void 0 ? void 0 : _theme$dropdown6.optionFontColor) !== null && _theme$dropdown$optio2 !== void 0 ? _theme$dropdown$optio2 : dropdownTokens.optionIconColor;
|
|
120
|
-
dropdownTokens.hoverButtonBackgroundColor = (
|
|
121
|
-
dropdownTokens.activeButtonBackgroundColor = (
|
|
122
|
-
dropdownTokens.hoverOptionBackgroundColor = (
|
|
123
|
-
dropdownTokens.activeOptionBackgroundColor = (
|
|
130
|
+
dropdownTokens.hoverButtonBackgroundColor = (_subLightness14 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$dropdown7 = theme.dropdown) === null || _theme$dropdown7 === void 0 ? void 0 : _theme$dropdown7.baseColor)) !== null && _subLightness14 !== void 0 ? _subLightness14 : dropdownTokens.hoverButtonBackgroundColor;
|
|
131
|
+
dropdownTokens.activeButtonBackgroundColor = (_subLightness15 = subLightness(12, theme === null || theme === void 0 ? void 0 : (_theme$dropdown8 = theme.dropdown) === null || _theme$dropdown8 === void 0 ? void 0 : _theme$dropdown8.baseColor)) !== null && _subLightness15 !== void 0 ? _subLightness15 : dropdownTokens.activeButtonBackgroundColor;
|
|
132
|
+
dropdownTokens.hoverOptionBackgroundColor = (_subLightness16 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$dropdown9 = theme.dropdown) === null || _theme$dropdown9 === void 0 ? void 0 : _theme$dropdown9.baseColor)) !== null && _subLightness16 !== void 0 ? _subLightness16 : dropdownTokens.hoverOptionBackgroundColor;
|
|
133
|
+
dropdownTokens.activeOptionBackgroundColor = (_subLightness17 = subLightness(20, theme === null || theme === void 0 ? void 0 : (_theme$dropdown10 = theme.dropdown) === null || _theme$dropdown10 === void 0 ? void 0 : _theme$dropdown10.baseColor)) !== null && _subLightness17 !== void 0 ? _subLightness17 : dropdownTokens.activeOptionBackgroundColor;
|
|
124
134
|
var fileInputTokens = componentTokensCopy.fileInput;
|
|
125
135
|
fileInputTokens.labelFontColor = (_theme$fileInput$font = theme === null || theme === void 0 ? void 0 : (_theme$fileInput = theme.fileInput) === null || _theme$fileInput === void 0 ? void 0 : _theme$fileInput.fontColor) !== null && _theme$fileInput$font !== void 0 ? _theme$fileInput$font : fileInputTokens.labelFontColor;
|
|
126
136
|
fileInputTokens.helperTextFontColor = (_theme$fileInput$font2 = theme === null || theme === void 0 ? void 0 : (_theme$fileInput2 = theme.fileInput) === null || _theme$fileInput2 === void 0 ? void 0 : _theme$fileInput2.fontColor) !== null && _theme$fileInput$font2 !== void 0 ? _theme$fileInput$font2 : fileInputTokens.helperTextFontColor;
|
|
@@ -174,8 +184,8 @@ var parseTheme = function parseTheme(theme) {
|
|
|
174
184
|
radioGroupTokens.labelFontColor = (_theme$radioGroup$fon = theme === null || theme === void 0 ? void 0 : (_theme$radioGroup2 = theme.radioGroup) === null || _theme$radioGroup2 === void 0 ? void 0 : _theme$radioGroup2.fontColor) !== null && _theme$radioGroup$fon !== void 0 ? _theme$radioGroup$fon : radioGroupTokens.labelFontColor;
|
|
175
185
|
radioGroupTokens.helperTextFontColor = (_theme$radioGroup$fon2 = theme === null || theme === void 0 ? void 0 : (_theme$radioGroup3 = theme.radioGroup) === null || _theme$radioGroup3 === void 0 ? void 0 : _theme$radioGroup3.fontColor) !== null && _theme$radioGroup$fon2 !== void 0 ? _theme$radioGroup$fon2 : radioGroupTokens.helperTextFontColor;
|
|
176
186
|
radioGroupTokens.radioInputLabelFontColor = (_theme$radioGroup$fon3 = theme === null || theme === void 0 ? void 0 : (_theme$radioGroup4 = theme.radioGroup) === null || _theme$radioGroup4 === void 0 ? void 0 : _theme$radioGroup4.fontColor) !== null && _theme$radioGroup$fon3 !== void 0 ? _theme$radioGroup$fon3 : radioGroupTokens.radioInputLabelFontColor;
|
|
177
|
-
radioGroupTokens.hoverRadioInputColor = (
|
|
178
|
-
radioGroupTokens.activeRadioInputColor = (
|
|
187
|
+
radioGroupTokens.hoverRadioInputColor = (_subLightness18 = subLightness(10, theme === null || theme === void 0 ? void 0 : (_theme$radioGroup5 = theme.radioGroup) === null || _theme$radioGroup5 === void 0 ? void 0 : _theme$radioGroup5.baseColor)) !== null && _subLightness18 !== void 0 ? _subLightness18 : radioGroupTokens.radioInputColor;
|
|
188
|
+
radioGroupTokens.activeRadioInputColor = (_subLightness19 = subLightness(25, theme === null || theme === void 0 ? void 0 : (_theme$radioGroup6 = theme.radioGroup) === null || _theme$radioGroup6 === void 0 ? void 0 : _theme$radioGroup6.baseColor)) !== null && _subLightness19 !== void 0 ? _subLightness19 : radioGroupTokens.radioInputColor;
|
|
179
189
|
var selectTokens = componentTokensCopy.select;
|
|
180
190
|
selectTokens.selectedListOptionBackgroundColor = (_theme$select$selecte = theme === null || theme === void 0 ? void 0 : (_theme$select = theme.select) === null || _theme$select === void 0 ? void 0 : _theme$select.selectedOptionBackgroundColor) !== null && _theme$select$selecte !== void 0 ? _theme$select$selecte : selectTokens.selectedListOptionBackgroundColor;
|
|
181
191
|
selectTokens.valueFontColor = (_theme$select$fontCol = theme === null || theme === void 0 ? void 0 : (_theme$select2 = theme.select) === null || _theme$select2 === void 0 ? void 0 : _theme$select2.fontColor) !== null && _theme$select$fontCol !== void 0 ? _theme$select$fontCol : selectTokens.valueFontColor;
|
|
@@ -185,8 +195,8 @@ var parseTheme = function parseTheme(theme) {
|
|
|
185
195
|
selectTokens.placeholderFontColor = (_addLightness10 = addLightness(30, theme === null || theme === void 0 ? void 0 : (_theme$select6 = theme.select) === null || _theme$select6 === void 0 ? void 0 : _theme$select6.fontColor)) !== null && _addLightness10 !== void 0 ? _addLightness10 : selectTokens.placeholderFontColor;
|
|
186
196
|
selectTokens.collapseIndicatorColor = (_theme$select$fontCol4 = theme === null || theme === void 0 ? void 0 : (_theme$select7 = theme.select) === null || _theme$select7 === void 0 ? void 0 : _theme$select7.fontColor) !== null && _theme$select$fontCol4 !== void 0 ? _theme$select$fontCol4 : selectTokens.collapseIndicatorColor;
|
|
187
197
|
selectTokens.hoverInputBorderColor = (_theme$select$hoverBo = theme === null || theme === void 0 ? void 0 : (_theme$select8 = theme.select) === null || _theme$select8 === void 0 ? void 0 : _theme$select8.hoverBorderColor) !== null && _theme$select$hoverBo !== void 0 ? _theme$select$hoverBo : selectTokens.hoverInputBorderColor;
|
|
188
|
-
selectTokens.selectedHoverListOptionBackgroundColor = (
|
|
189
|
-
selectTokens.selectedActiveListOptionBackgroundColor = (
|
|
198
|
+
selectTokens.selectedHoverListOptionBackgroundColor = (_subLightness20 = subLightness(5, theme === null || theme === void 0 ? void 0 : (_theme$select9 = theme.select) === null || _theme$select9 === void 0 ? void 0 : _theme$select9.selectedOptionBackgroundColor)) !== null && _subLightness20 !== void 0 ? _subLightness20 : selectTokens.selectedHoverListOptionBackgroundColor;
|
|
199
|
+
selectTokens.selectedActiveListOptionBackgroundColor = (_subLightness21 = subLightness(15, theme === null || theme === void 0 ? void 0 : (_theme$select10 = theme.select) === null || _theme$select10 === void 0 ? void 0 : _theme$select10.selectedOptionBackgroundColor)) !== null && _subLightness21 !== void 0 ? _subLightness21 : selectTokens.selectedActiveListOptionBackgroundColor;
|
|
190
200
|
var sideNavTokens = componentTokensCopy.sidenav;
|
|
191
201
|
sideNavTokens.backgroundColor = (_theme$sidenav$baseCo = theme === null || theme === void 0 ? void 0 : (_theme$sidenav = theme.sidenav) === null || _theme$sidenav === void 0 ? void 0 : _theme$sidenav.baseColor) !== null && _theme$sidenav$baseCo !== void 0 ? _theme$sidenav$baseCo : sideNavTokens.backgroundColor;
|
|
192
202
|
var sliderTokens = componentTokensCopy.slider;
|
|
@@ -198,8 +208,8 @@ var parseTheme = function parseTheme(theme) {
|
|
|
198
208
|
sliderTokens.tickBackgroundColor = (_theme$slider$baseCol3 = theme === null || theme === void 0 ? void 0 : (_theme$slider6 = theme.slider) === null || _theme$slider6 === void 0 ? void 0 : _theme$slider6.baseColor) !== null && _theme$slider$baseCol3 !== void 0 ? _theme$slider$baseCol3 : sliderTokens.tickBackgroundColor;
|
|
199
209
|
sliderTokens.trackLineColor = (_theme$slider$baseCol4 = theme === null || theme === void 0 ? void 0 : (_theme$slider7 = theme.slider) === null || _theme$slider7 === void 0 ? void 0 : _theme$slider7.baseColor) !== null && _theme$slider$baseCol4 !== void 0 ? _theme$slider$baseCol4 : sliderTokens.trackLineColor;
|
|
200
210
|
sliderTokens.totalLineColor = (_theme$slider$totalLi = theme === null || theme === void 0 ? void 0 : (_theme$slider8 = theme.slider) === null || _theme$slider8 === void 0 ? void 0 : _theme$slider8.totalLineColor) !== null && _theme$slider$totalLi !== void 0 ? _theme$slider$totalLi : sliderTokens.totalLineColor;
|
|
201
|
-
sliderTokens.hoverThumbBackgroundColor = (
|
|
202
|
-
sliderTokens.activeThumbBackgroundColor = (
|
|
211
|
+
sliderTokens.hoverThumbBackgroundColor = (_subLightness22 = subLightness(15, theme === null || theme === void 0 ? void 0 : (_theme$slider9 = theme.slider) === null || _theme$slider9 === void 0 ? void 0 : _theme$slider9.baseColor)) !== null && _subLightness22 !== void 0 ? _subLightness22 : sliderTokens.thumbBackgroundColor;
|
|
212
|
+
sliderTokens.activeThumbBackgroundColor = (_subLightness23 = subLightness(15, theme === null || theme === void 0 ? void 0 : (_theme$slider10 = theme.slider) === null || _theme$slider10 === void 0 ? void 0 : _theme$slider10.baseColor)) !== null && _subLightness23 !== void 0 ? _subLightness23 : sliderTokens.thumbBackgroundColor;
|
|
203
213
|
var spinnerTokens = componentTokensCopy.spinner;
|
|
204
214
|
spinnerTokens.trackCircleColor = (_theme$spinner$accent = theme === null || theme === void 0 ? void 0 : (_theme$spinner = theme.spinner) === null || _theme$spinner === void 0 ? void 0 : _theme$spinner.accentColor) !== null && _theme$spinner$accent !== void 0 ? _theme$spinner$accent : spinnerTokens.trackCircleColor;
|
|
205
215
|
spinnerTokens.totalCircleColor = (_theme$spinner$baseCo = theme === null || theme === void 0 ? void 0 : (_theme$spinner2 = theme.spinner) === null || _theme$spinner2 === void 0 ? void 0 : _theme$spinner2.baseColor) !== null && _theme$spinner$baseCo !== void 0 ? _theme$spinner$baseCo : spinnerTokens.totalCircleColor;
|
|
@@ -251,11 +261,11 @@ var parseTheme = function parseTheme(theme) {
|
|
|
251
261
|
toggleGroupTokens.unselectedBackgroundColor = (_theme$toggleGroup$un = theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup3 = theme.toggleGroup) === null || _theme$toggleGroup3 === void 0 ? void 0 : _theme$toggleGroup3.unselectedBaseColor) !== null && _theme$toggleGroup$un !== void 0 ? _theme$toggleGroup$un : toggleGroupTokens.unselectedBackgroundColor;
|
|
252
262
|
toggleGroupTokens.unselectedActiveBackgroundColor = (_theme$toggleGroup$se3 = theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup4 = theme.toggleGroup) === null || _theme$toggleGroup4 === void 0 ? void 0 : _theme$toggleGroup4.selectedBaseColor) !== null && _theme$toggleGroup$se3 !== void 0 ? _theme$toggleGroup$se3 : toggleGroupTokens.unselectedActiveBackgroundColor;
|
|
253
263
|
toggleGroupTokens.unselectedFontColor = (_theme$toggleGroup$un2 = theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup5 = theme.toggleGroup) === null || _theme$toggleGroup5 === void 0 ? void 0 : _theme$toggleGroup5.unselectedFontColor) !== null && _theme$toggleGroup$un2 !== void 0 ? _theme$toggleGroup$un2 : toggleGroupTokens.unselectedFontColor;
|
|
254
|
-
toggleGroupTokens.selectedHoverBackgroundColor = (
|
|
255
|
-
toggleGroupTokens.selectedActiveBackgroundColor = (
|
|
264
|
+
toggleGroupTokens.selectedHoverBackgroundColor = (_subLightness24 = subLightness(8, theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup6 = theme.toggleGroup) === null || _theme$toggleGroup6 === void 0 ? void 0 : _theme$toggleGroup6.selectedBaseColor)) !== null && _subLightness24 !== void 0 ? _subLightness24 : toggleGroupTokens.selectedHoverBackgroundColor;
|
|
265
|
+
toggleGroupTokens.selectedActiveBackgroundColor = (_subLightness25 = subLightness(18, theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup7 = theme.toggleGroup) === null || _theme$toggleGroup7 === void 0 ? void 0 : _theme$toggleGroup7.selectedBaseColor)) !== null && _subLightness25 !== void 0 ? _subLightness25 : toggleGroupTokens.selectedActiveBackgroundColor;
|
|
256
266
|
toggleGroupTokens.selectedDisabledBackgroundColor = (_addLightness18 = addLightness(57, theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup8 = theme.toggleGroup) === null || _theme$toggleGroup8 === void 0 ? void 0 : _theme$toggleGroup8.selectedBaseColor)) !== null && _addLightness18 !== void 0 ? _addLightness18 : toggleGroupTokens.selectedDisabledBackgroundColor;
|
|
257
267
|
toggleGroupTokens.selectedDisabledFontColor = (_addLightness19 = addLightness(42, theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup9 = theme.toggleGroup) === null || _theme$toggleGroup9 === void 0 ? void 0 : _theme$toggleGroup9.selectedBaseColor)) !== null && _addLightness19 !== void 0 ? _addLightness19 : toggleGroupTokens.selectedDisabledFontColor;
|
|
258
|
-
toggleGroupTokens.unselectedHoverBackgroundColor = (
|
|
268
|
+
toggleGroupTokens.unselectedHoverBackgroundColor = (_subLightness26 = subLightness(10, theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup10 = theme.toggleGroup) === null || _theme$toggleGroup10 === void 0 ? void 0 : _theme$toggleGroup10.unselectedBaseColor)) !== null && _subLightness26 !== void 0 ? _subLightness26 : toggleGroupTokens.unselectedHoverBackgroundColor;
|
|
259
269
|
var wizardTokens = componentTokensCopy.wizard;
|
|
260
270
|
wizardTokens.selectedStepBackgroundColor = (_theme$wizard$baseCol = theme === null || theme === void 0 ? void 0 : (_theme$wizard = theme.wizard) === null || _theme$wizard === void 0 ? void 0 : _theme$wizard.baseColor) !== null && _theme$wizard$baseCol !== void 0 ? _theme$wizard$baseCol : wizardTokens.selectedStepBackgroundColor;
|
|
261
271
|
wizardTokens.selectedStepFontColor = (_theme$wizard$selecte = theme === null || theme === void 0 ? void 0 : (_theme$wizard2 = theme.wizard) === null || _theme$wizard2 === void 0 ? void 0 : _theme$wizard2.selectedStepFontColor) !== null && _theme$wizard$selecte !== void 0 ? _theme$wizard$selecte : wizardTokens.selectedStepFontColor;
|
|
@@ -306,5 +316,5 @@ var HalstackProvider = exports.HalstackProvider = function HalstackProvider(_ref
|
|
|
306
316
|
value: parsedLabels
|
|
307
317
|
}, children)));
|
|
308
318
|
};
|
|
309
|
-
var Halstack = _styledComponents["default"].div(_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
|
|
319
|
+
var Halstack = _styledComponents["default"].div(_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
320
|
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,7 +137,7 @@ 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
143
|
return props.theme.iconMarginRight;
|
|
@@ -163,6 +147,8 @@ var IconContainer = _styledComponents["default"].span(_templateObject6 || (_temp
|
|
|
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 {};
|