@kaizen/components 1.61.1 → 1.61.3
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/codemods/utils/__snapshots__/transformSource.spec.ts.snap +2 -2
- package/dist/cjs/RichTextEditor/RichTextContent/RichTextContent.cjs +10 -1
- package/dist/cjs/__future__/Select/Select.cjs +1 -6
- package/dist/cjs/__future__/Select/subcomponents/ListBox/ListBox.cjs +1 -2
- package/dist/cjs/__future__/Select/subcomponents/ListBox/ListBox.module.scss.cjs +1 -2
- package/dist/esm/RichTextEditor/RichTextContent/RichTextContent.mjs +11 -2
- package/dist/esm/__future__/Select/Select.mjs +1 -6
- package/dist/esm/__future__/Select/subcomponents/ListBox/ListBox.mjs +1 -2
- package/dist/esm/__future__/Select/subcomponents/ListBox/ListBox.module.scss.mjs +1 -2
- package/dist/styles.css +46 -44
- package/package.json +6 -5
- package/src/Avatar/Avatar.spec.tsx +1 -1
- package/src/Calendar/utils/setFocusInCalendar.spec.tsx +2 -2
- package/src/Checkbox/Checkbox/Checkbox.spec.tsx +2 -2
- package/src/Collapsible/Collapsible/Collapsible.spec.tsx +2 -14
- package/src/Collapsible/Collapsible/_docs/Collapsible.mdx +0 -2
- package/src/Collapsible/Collapsible/_docs/Collapsible.stickersheet.stories.tsx +49 -0
- package/src/Collapsible/Collapsible/_docs/Collapsible.stories.tsx +0 -11
- package/src/DateInput/DateInputDescription/DateInputDescription.spec.tsx +5 -6
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.spec.tsx +4 -6
- package/src/DatePicker/DatePicker.spec.tsx +32 -36
- package/src/DatePicker/subcomponents/DateInputField/DateInputField.spec.tsx +13 -13
- package/src/DatePicker/utils/validateDate.spec.ts +5 -6
- package/src/EmptyState/EmptyState.spec.tsx +1 -1
- package/src/ErrorPage/ErrorPage.spec.tsx +19 -19
- package/src/Filter/FilterBar/FilterBar.spec.tsx +26 -26
- package/src/Filter/FilterBar/context/utils/updateDependentFilters.spec.ts +2 -4
- package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.spec.tsx +3 -4
- package/src/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.spec.tsx +3 -6
- package/src/Filter/FilterBar/subcomponents/FilterBarDatePicker/FilterBarDatePicker.spec.tsx +10 -12
- package/src/Filter/FilterBar/subcomponents/FilterBarDateRangePicker/FilterBarDateRangePicker.spec.tsx +9 -10
- package/src/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.spec.tsx +12 -14
- package/src/Filter/FilterBar/subcomponents/FilterBarSelect/FilterBarSelect.spec.tsx +11 -13
- package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.spec.tsx +5 -5
- package/src/Filter/FilterDatePicker/FilterDatePicker.spec.tsx +12 -15
- package/src/Filter/FilterDatePicker/hooks/useDateInputHandlers.spec.ts +12 -15
- package/src/Filter/FilterDatePicker/hooks/useDateValidation.spec.ts +3 -5
- package/src/Filter/FilterDatePicker/subcomponents/FilterDatePickerField/FilterDatePickerField.spec.tsx +23 -28
- package/src/Filter/FilterDatePicker/utils/getDateValidationHandler.spec.tsx +2 -6
- package/src/Filter/FilterDatePicker/utils/validateDate.spec.ts +5 -6
- package/src/Filter/FilterDateRangePicker/FilterDateRangePicker.spec.tsx +2 -3
- package/src/Filter/FilterDateRangePicker/_docs/FilterDateRangePicker.stickersheet.stories.tsx +27 -0
- package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.spec.tsx +9 -11
- package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeValidationMessage/DateRangeValidationMessage.spec.tsx +1 -63
- package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/FilterDateRangePickerField.spec.tsx +32 -32
- package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useEndDateValidation.spec.ts +3 -8
- package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/hooks/useStartDateValidation.spec.ts +2 -5
- package/src/Filter/FilterDateRangePicker/subcomponents/FilterDateRangePickerField/utils/validateEndDateBeforeStartDate.spec.ts +2 -3
- package/src/Filter/FilterMultiSelect/FilterMultiSelect.spec.tsx +9 -10
- package/src/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.spec.tsx +2 -1
- package/src/Filter/FilterMultiSelect/context/SelectionProvider/SelectionProvider.spec.tsx +32 -32
- package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.spec.tsx +9 -7
- package/src/Filter/FilterMultiSelect/subcomponents/SearchInput/SearchInput.spec.tsx +12 -12
- package/src/Filter/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.spec.tsx +7 -7
- package/src/Filter/FilterMultiSelect/subcomponents/SelectionControlButton/SelectAllButton/SelectAllButton.spec.tsx +9 -9
- package/src/Filter/FilterSelect/FilterSelect.spec.tsx +3 -5
- package/src/Heading/Heading.spec.tsx +1 -31
- package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.spec.tsx +43 -97
- package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.stickersheet.stories.tsx +68 -0
- package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.stories.tsx +37 -0
- package/src/Input/InputRange/InputRange.spec.tsx +2 -2
- package/src/Input/InputSearch/InputSearch.spec.tsx +3 -5
- package/src/KaizenProvider/KaizenProvider.spec.tsx +2 -2
- package/src/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.spec.tsx +2 -3
- package/src/Modal/ConfirmationModal/ConfirmationModal.spec.tsx +7 -7
- package/src/Modal/ContextModal/ContextModal.spec.tsx +5 -5
- package/src/Modal/GenericModal/GenericModal.spec.tsx +4 -4
- package/src/Modal/InputEditModal/InputEditModal.spec.tsx +7 -7
- package/src/MultiSelect/subcomponents/MultiSelectOptionField/MultiSelectOptionField.spec.tsx +3 -3
- package/src/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.spec.tsx +3 -3
- package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.spec.tsx +2 -2
- package/src/MultiSelect/subcomponents/Popover/Popover.module.scss +1 -0
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.stories.tsx +60 -0
- package/src/Pagination/Pagination.spec.tsx +2 -2
- package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.spec.tsx +4 -4
- package/src/RichTextEditor/RichTextContent/RichTextContent.tsx +11 -2
- package/src/RichTextEditor/utils/commands/addMark.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/fixtures/helpers.ts +4 -3
- package/src/RichTextEditor/utils/commands/getMarkAttrs.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/getMarkRange.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/listIsActive.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/markContainsSelection.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/markIsActive.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/removeMark.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/updateMark.spec.ts +2 -2
- package/src/RichTextEditor/utils/commands/validateAndRemoveMarks.spec.ts +3 -3
- package/src/RichTextEditor/utils/core/createRichTextEditor.spec.ts +11 -11
- package/src/RichTextEditor/utils/core/hooks/useRichTextEditor.spec.tsx +2 -2
- package/src/SplitButton/SplitButton.spec.tsx +5 -5
- package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.spec.tsx +3 -4
- package/src/Text/Text.spec.tsx +1 -57
- package/src/TextArea/TextArea.spec.tsx +2 -2
- package/src/TimeField/TimeField.spec.tsx +2 -2
- package/src/TitleBlockZen/TitleBlockZen.spec.tsx +36 -68
- package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +78 -8
- package/src/TitleBlockZen/subcomponents/MobileActions.spec.tsx +2 -2
- package/src/TitleBlockZen/subcomponents/NavigationTabs.spec.tsx +8 -2
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.spec.tsx +2 -2
- package/src/__actions__/Menu/v1/Menu.spec.tsx +2 -2
- package/src/__containers__/GuidanceBlock/v1/GuidanceBlock.spec.tsx +5 -5
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.spec.tsx +5 -5
- package/src/__future__/Select/Select.spec.tsx +8 -8
- package/src/__future__/Select/Select.tsx +1 -10
- package/src/__future__/Select/subcomponents/ListBox/ListBox.module.scss +3 -3
- package/src/__future__/Select/subcomponents/ListBox/ListBox.tsx +1 -1
- package/src/__overlays__/Tooltip/v1/Tooltip.spec.tsx +1 -1
- package/src/__overlays__/Tooltip/v1/utils/isSemanticElement.spec.tsx +4 -9
- package/src/utils/useMediaQueries.spec.tsx +7 -7
- package/src/Heading/__snapshots__/Heading.spec.tsx.snap +0 -85
- package/src/Illustration/utils/usePausePlay.spec.tsx +0 -85
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.spec.tsx +0 -76
- package/src/Text/__snapshots__/Text.spec.tsx.snap +0 -49
- package/src/__overlays__/Tooltip/v1/subcomponents/AppearanceAnim.spec.tsx +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`transformSource updates the value of Pancakes topping to jam 1`] = `
|
|
3
|
+
exports[`transformSource > updates the value of Pancakes topping to jam 1`] = `
|
|
4
4
|
"import * as React from "react";
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import { Pancakes } from "@kaizen/components";
|
|
@@ -47,13 +47,22 @@ var RichTextContent = function (props) {
|
|
|
47
47
|
classNameOverride = props.classNameOverride,
|
|
48
48
|
restProps = tslib.__rest(props, ["content", "classNameOverride"]);
|
|
49
49
|
var schema$1 = React.useState(schema.createSchemaWithAll())[0];
|
|
50
|
+
var editorId = React.useId();
|
|
51
|
+
React.useEffect(function () {
|
|
52
|
+
var _a;
|
|
53
|
+
// prosemirror only allows us to set this to false (which has caused a strange bug in the platform)
|
|
54
|
+
// so we have to hack a bit to remove the attribute completely
|
|
55
|
+
(_a = document.getElementById(editorId)) === null || _a === void 0 ? void 0 : _a.removeAttribute("contenteditable");
|
|
56
|
+
}, []);
|
|
50
57
|
var editorRef = useRichTextEditor.useRichTextEditor(ProseMirrorState__namespace.EditorState.create({
|
|
51
58
|
doc: ProseMirrorModel__namespace.Node.fromJSON(schema$1, {
|
|
52
59
|
type: "doc",
|
|
53
60
|
content: content
|
|
54
61
|
}),
|
|
55
62
|
schema: schema$1
|
|
56
|
-
}),
|
|
63
|
+
}), {
|
|
64
|
+
id: editorId
|
|
65
|
+
}, {
|
|
57
66
|
editable: false
|
|
58
67
|
})[0];
|
|
59
68
|
return React__default.default.createElement("div", tslib.__assign({
|
|
@@ -121,12 +121,7 @@ var Select = function (_a) {
|
|
|
121
121
|
}, trigger === undefined ? React__default.default.createElement(SelectToggle.SelectToggle, tslib.__assign({}, selectToggleProps)) : trigger(selectToggleProps, selectToggleProps.ref), state.isOpen && React__default.default.createElement(Popover.Popover, {
|
|
122
122
|
id: popoverId,
|
|
123
123
|
portalContainer: portalContainer,
|
|
124
|
-
refs: refs
|
|
125
|
-
focusOnProps: {
|
|
126
|
-
onEscapeKey: state.close,
|
|
127
|
-
onClickOutside: state.close,
|
|
128
|
-
noIsolation: true
|
|
129
|
-
}
|
|
124
|
+
refs: refs
|
|
130
125
|
}, React__default.default.createElement(SelectContext.SelectProvider, {
|
|
131
126
|
state: state
|
|
132
127
|
}, React__default.default.createElement(SelectPopoverContents.SelectPopoverContents, {
|
|
@@ -21,8 +21,7 @@ var ListBox = function (_a) {
|
|
|
21
21
|
var state = SelectContext.useSelectContext().state;
|
|
22
22
|
var ref = React__default.default.useRef(null);
|
|
23
23
|
var listBoxProps = listbox.useListBox(tslib.__assign(tslib.__assign({}, menuProps), {
|
|
24
|
-
disallowEmptySelection: true
|
|
25
|
-
autoFocus: "first"
|
|
24
|
+
disallowEmptySelection: true
|
|
26
25
|
}), state, ref).listBoxProps;
|
|
27
26
|
return React__default.default.createElement("ul", tslib.__assign({
|
|
28
27
|
ref: ref,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useState, useId, useEffect } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { createSchemaWithAll } from '../RichTextEditor/schema.mjs';
|
|
5
5
|
import * as ProseMirrorState from 'prosemirror-state';
|
|
@@ -18,13 +18,22 @@ const RichTextContent = /*#__PURE__*/function () {
|
|
|
18
18
|
classNameOverride = props.classNameOverride,
|
|
19
19
|
restProps = __rest(props, ["content", "classNameOverride"]);
|
|
20
20
|
var schema = useState(createSchemaWithAll())[0];
|
|
21
|
+
var editorId = useId();
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
var _a;
|
|
24
|
+
// prosemirror only allows us to set this to false (which has caused a strange bug in the platform)
|
|
25
|
+
// so we have to hack a bit to remove the attribute completely
|
|
26
|
+
(_a = document.getElementById(editorId)) === null || _a === void 0 ? void 0 : _a.removeAttribute("contenteditable");
|
|
27
|
+
}, []);
|
|
21
28
|
var editorRef = useRichTextEditor(ProseMirrorState.EditorState.create({
|
|
22
29
|
doc: ProseMirrorModel.Node.fromJSON(schema, {
|
|
23
30
|
type: "doc",
|
|
24
31
|
content: content
|
|
25
32
|
}),
|
|
26
33
|
schema: schema
|
|
27
|
-
}),
|
|
34
|
+
}), {
|
|
35
|
+
id: editorId
|
|
36
|
+
}, {
|
|
28
37
|
editable: false
|
|
29
38
|
})[0];
|
|
30
39
|
return /*#__PURE__*/React.createElement("div", __assign({
|
|
@@ -113,12 +113,7 @@ const Select = /*#__PURE__*/function () {
|
|
|
113
113
|
}, trigger === undefined ? ( /*#__PURE__*/React.createElement(SelectToggle, __assign({}, selectToggleProps))) : trigger(selectToggleProps, selectToggleProps.ref), state.isOpen && ( /*#__PURE__*/React.createElement(Popover, {
|
|
114
114
|
id: popoverId,
|
|
115
115
|
portalContainer: portalContainer,
|
|
116
|
-
refs: refs
|
|
117
|
-
focusOnProps: {
|
|
118
|
-
onEscapeKey: state.close,
|
|
119
|
-
onClickOutside: state.close,
|
|
120
|
-
noIsolation: true
|
|
121
|
-
}
|
|
116
|
+
refs: refs
|
|
122
117
|
}, /*#__PURE__*/React.createElement(SelectProvider, {
|
|
123
118
|
state: state
|
|
124
119
|
}, /*#__PURE__*/React.createElement(SelectPopoverContents, {
|
|
@@ -13,8 +13,7 @@ const ListBox = /*#__PURE__*/function () {
|
|
|
13
13
|
var state = useSelectContext().state;
|
|
14
14
|
var ref = React.useRef(null);
|
|
15
15
|
var listBoxProps = useListBox(__assign(__assign({}, menuProps), {
|
|
16
|
-
disallowEmptySelection: true
|
|
17
|
-
autoFocus: "first"
|
|
16
|
+
disallowEmptySelection: true
|
|
18
17
|
}), state, ref).listBoxProps;
|
|
19
18
|
return /*#__PURE__*/React.createElement("ul", __assign({
|
|
20
19
|
ref: ref,
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
@layer tokens, normalize, reset;@layer tokens{:root{--theme-key:heart;--animation-easing-function-ease-in-out:cubic-bezier(0.455,0.03,0.515,0.955);--animation-easing-function-ease-in:cubic-bezier(0.55,0.085,0.68,0.53);--animation-easing-function-ease-out:cubic-bezier(0.25,0.46,0.45,0.94);--animation-easing-function-linear:linear;--animation-easing-function-bounce-in:cubic-bezier(0.485,0.155,0.24,1.245);--animation-easing-function-bounce-out:cubic-bezier(0.485,0.155,0.515,0.845);--animation-easing-function-bounce-in-out:cubic-bezier(0.76,-0.245,0.24,1.245);--animation-duration-instant:0ms;--animation-duration-immediate:100ms;--animation-duration-rapid:200ms;--animation-duration-fast:300ms;--animation-duration-slow:400ms;--animation-duration-deliberate:700ms;--border-solid-border-width:2px;--border-solid-border-radius:7px;--border-solid-border-style:solid;--border-solid-border-color:#e1e2ea;--border-solid-border-color-rgb:225,226,234;--border-dashed-border-width:2px;--border-dashed-border-radius:7px;--border-dashed-border-style:dashed;--border-borderless-border-width:2px;--border-borderless-border-radius:7px;--border-borderless-border-style:solid;--border-borderless-border-color:transparent;--border-borderless-border-color-rgb:0,0,0;--border-focus-ring-border-width:2px;--border-focus-ring-border-radius:10px;--border-focus-ring-border-style:solid;--border-width-1:1px;--color-purple-100:#f4edf8;--color-purple-100-rgb:244,237,248;--color-purple-200:#dfc9ea;--color-purple-200-rgb:223,201,234;--color-purple-300:#c9a5dd;--color-purple-300-rgb:201,165,221;--color-purple-400:#ae67b1;--color-purple-400-rgb:174,103,177;--color-purple-500:#844587;--color-purple-500-rgb:132,69,135;--color-purple-600:#5f3361;--color-purple-600-rgb:95,51,97;--color-purple-700:#4a234d;--color-purple-700-rgb:74,35,77;--color-purple-800:#2f2438;--color-purple-800-rgb:47,36,56;--color-blue-100:#e6f6ff;--color-blue-100-rgb:230,246,255;--color-blue-200:#bde2f5;--color-blue-200-rgb:189,226,245;--color-blue-300:#73c0e8;--color-blue-300-rgb:115,192,232;--color-blue-400:#008bd6;--color-blue-400-rgb:0,139,214;--color-blue-500:#0168b3;--color-blue-500-rgb:1,104,179;--color-blue-600:#004970;--color-blue-600-rgb:0,73,112;--color-blue-700:#003157;--color-blue-700-rgb:0,49,87;--color-green-100:#e8f8f4;--color-green-100-rgb:232,248,244;--color-green-200:#c4ede2;--color-green-200-rgb:196,237,226;--color-green-300:#8fdbc7;--color-green-300-rgb:143,219,199;--color-green-400:#5dcaad;--color-green-400-rgb:93,202,173;--color-green-500:#3f9a86;--color-green-500-rgb:63,154,134;--color-green-600:#2c7d67;--color-green-600-rgb:44,125,103;--color-green-700:#22594a;--color-green-700-rgb:34,89,74;--color-yellow-100:#fff9e4;--color-yellow-100-rgb:255,249,228;--color-yellow-200:#ffeeb3;--color-yellow-200-rgb:255,238,179;--color-yellow-300:#ffe36e;--color-yellow-300-rgb:255,227,110;--color-yellow-400:#ffca4d;--color-yellow-400-rgb:255,202,77;--color-yellow-500:#ffb600;--color-yellow-500-rgb:255,182,0;--color-yellow-600:#c68600;--color-yellow-600-rgb:198,134,0;--color-yellow-700:#876400;--color-yellow-700-rgb:135,100,0;--color-red-100:#fdeaee;--color-red-100-rgb:253,234,238;--color-red-200:#f9c2cb;--color-red-200-rgb:249,194,203;--color-red-300:#f597a8;--color-red-300-rgb:245,151,168;--color-red-400:#e0707d;--color-red-400-rgb:224,112,125;--color-red-500:#c93b55;--color-red-500-rgb:201,59,85;--color-red-600:#a82433;--color-red-600-rgb:168,36,51;--color-red-700:#6c1e20;--color-red-700-rgb:108,30,32;--color-orange-100:#fff0e8;--color-orange-100-rgb:255,240,232;--color-orange-200:#ffd1b9;--color-orange-200-rgb:255,209,185;--color-orange-300:#ffb08a;--color-orange-300-rgb:255,176,138;--color-orange-400:#ff9461;--color-orange-400-rgb:255,148,97;--color-orange-500:#e96c2f;--color-orange-500-rgb:233,108,47;--color-orange-600:#b74302;--color-orange-600-rgb:183,67,2;--color-orange-700:#903c00;--color-orange-700-rgb:144,60,0;--color-gray-100:#f9f9f9;--color-gray-100-rgb:249,249,249;--color-gray-200:#f4f4f5;--color-gray-200-rgb:244,244,245;--color-gray-300:#eaeaec;--color-gray-300-rgb:234,234,236;--color-gray-400:#cdcdd0;--color-gray-400-rgb:205,205,208;--color-gray-500:#878792;--color-gray-500-rgb:135,135,146;--color-gray-600:#524e56;--color-gray-600-rgb:82,78,86;--color-white:#fff;--color-white-rgb:255,255,255;--color-black:#000;--color-black-rgb:0,0,0;--data-viz-favorable:#7dd5bd;--data-viz-favorable-rgb:125,213,189;--data-viz-unfavorable:#e68d97;--data-viz-unfavorable-rgb:230,141,151;--layout-content-max-width:1392px;--layout-content-max-width-with-sidebar:1080px;--layout-content-side-margin:72px;--layout-mobile-actions-drawer-height:60px;--layout-navigation-bar-height:72px;--layout-breakpoints-medium:768px;--layout-breakpoints-large:1080px;--shadow-small-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 3px 16px 0 rgba(0,0,0,.06);--shadow-large-box-shadow:0 3px 9px 0 rgba(0,0,0,.1),0 8px 40px 0 rgba(0,0,0,.08);--spacing-0:0;--spacing-1:.0625rem;--spacing-2:.125rem;--spacing-4:.25rem;--spacing-6:.375rem;--spacing-8:.5rem;--spacing-12:.75rem;--spacing-16:1rem;--spacing-20:1.25rem;--spacing-24:1.5rem;--spacing-32:2rem;--spacing-40:2.5rem;--spacing-48:3rem;--spacing-56:3.5rem;--spacing-64:4rem;--spacing-72:4.5rem;--spacing-80:5rem;--spacing-96:6rem;--spacing-112:7rem;--spacing-128:8rem;--spacing-160:10rem;--spacing-200:12.5rem;--spacing-240:15rem;--spacing-280:17.5rem;--spacing-320:20rem;--spacing-xs:0.375rem;--spacing-sm:0.75rem;--spacing-md:1.5rem;--spacing-lg:2.25rem;--spacing-xl:3rem;--spacing-xxl:3.75rem;--spacing-xxxl:4.5rem;--spacing-xxxxl:5.25rem;--spacing-xxxxxl:6rem;--typography-data-large-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-large-font-weight:700;--typography-data-large-font-size:5.25rem;--typography-data-large-line-height:5.25rem;--typography-data-large-letter-spacing:normal;--typography-data-large-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-large-units-font-weight:700;--typography-data-large-units-font-size:2.625rem;--typography-data-large-units-line-height:5.25rem;--typography-data-large-units-letter-spacing:normal;--typography-data-medium-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-medium-font-weight:700;--typography-data-medium-font-size:3rem;--typography-data-medium-line-height:5rem;--typography-data-medium-letter-spacing:normal;--typography-data-medium-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-medium-units-font-weight:700;--typography-data-medium-units-font-size:1.5rem;--typography-data-medium-units-line-height:5rem;--typography-data-medium-units-letter-spacing:normal;--typography-data-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-small-font-weight:700;--typography-data-small-font-size:1.5rem;--typography-data-small-line-height:1.5rem;--typography-data-small-letter-spacing:normal;--typography-data-small-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-small-units-font-weight:700;--typography-data-small-units-font-size:1.125rem;--typography-data-small-units-line-height:1.5rem;--typography-data-small-units-letter-spacing:normal;--typography-display-0-font-family:"Tiempos Headline",Georgia,serif;--typography-display-0-font-weight:800;--typography-display-0-font-size:4.5rem;--typography-display-0-line-height:5.25rem;--typography-display-0-letter-spacing:0em;--typography-heading-1-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-1-font-weight:700;--typography-heading-1-font-size:2.125rem;--typography-heading-1-line-height:2.625rem;--typography-heading-1-letter-spacing:normal;--typography-heading-2-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-2-font-weight:700;--typography-heading-2-font-size:1.75rem;--typography-heading-2-line-height:2.25rem;--typography-heading-2-letter-spacing:normal;--typography-heading-3-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-3-font-weight:700;--typography-heading-3-font-size:1.375rem;--typography-heading-3-line-height:1.875rem;--typography-heading-3-letter-spacing:normal;--typography-heading-4-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-4-font-weight:600;--typography-heading-4-font-size:1.125rem;--typography-heading-4-line-height:1.5rem;--typography-heading-4-letter-spacing:normal;--typography-heading-5-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-5-font-weight:600;--typography-heading-5-font-size:1rem;--typography-heading-5-line-height:1.5rem;--typography-heading-5-letter-spacing:normal;--typography-heading-6-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-6-font-weight:700;--typography-heading-6-font-size:0.875rem;--typography-heading-6-line-height:1.5rem;--typography-heading-6-letter-spacing:normal;--typography-paragraph-intro-lede-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-intro-lede-font-weight:400;--typography-paragraph-intro-lede-font-size:1.25rem;--typography-paragraph-intro-lede-line-height:1.875rem;--typography-paragraph-intro-lede-letter-spacing:0;--typography-paragraph-intro-lede-max-width:975px;--typography-paragraph-body-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-body-font-weight:400;--typography-paragraph-body-font-size:1rem;--typography-paragraph-body-line-height:1.5rem;--typography-paragraph-body-letter-spacing:normal;--typography-paragraph-body-max-width:780px;--typography-paragraph-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-small-font-weight:400;--typography-paragraph-small-font-size:0.875rem;--typography-paragraph-small-line-height:1.125rem;--typography-paragraph-small-letter-spacing:normal;--typography-paragraph-small-max-width:680px;--typography-paragraph-extra-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-extra-small-font-weight:400;--typography-paragraph-extra-small-font-size:0.75rem;--typography-paragraph-extra-small-line-height:1.125rem;--typography-paragraph-extra-small-letter-spacing:normal;--typography-paragraph-extra-small-max-width:600px;--typography-paragraph-bold-font-weight:600;--typography-button-primary-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-button-primary-font-weight:700;--typography-button-primary-font-size:1.125rem;--typography-button-primary-line-height:1.5rem;--typography-button-primary-letter-spacing:normal;--typography-button-secondary-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-button-secondary-font-weight:500;--typography-button-secondary-font-size:1rem;--typography-button-secondary-line-height:1.5rem;--typography-button-secondary-letter-spacing:normal}}@layer normalize{html{text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}}@layer reset{@font-face{font-family:Tiempos Headline;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff)}@font-face{font-family:Tiempos Headline;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-medium.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-medium.woff)}@font-face{font-family:Greycliff CF;font-weight:300;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-light.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:400;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-regular.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-medium.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:600;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-demi-bold.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:700;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-bold.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-extra-bold.woff) format("woff")}@font-face{font-family:Inter;font-weight:300;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-light.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-light.woff)}@font-face{font-family:Inter;font-weight:400;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff)}@font-face{font-family:Inter;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff)}@font-face{font-family:Inter;font-weight:600;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff)}@font-face{font-family:Inter;font-weight:700;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff)}@font-face{font-family:Inter;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-extra-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-extra-bold.woff)}@font-face{font-family:IBM Plex Mono;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff)}}@layer reset{*,:after,:before{border-color:var(--border-solid-border-color,"currentColor");border-style:solid;border-width:0}}
|
|
2
|
+
.Main-module_main__2ljR4 {
|
|
3
|
+
/* This is set so children will sit beneath the header and footer when sticky */
|
|
4
|
+
z-index: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
.Wrapper-module_wrapper__-IQnm {
|
|
3
8
|
display: grid;
|
|
4
9
|
grid-template-rows: min-content 1fr min-content;
|
|
@@ -7,11 +12,6 @@
|
|
|
7
12
|
background: var(--color-gray-100);
|
|
8
13
|
}
|
|
9
14
|
|
|
10
|
-
.Main-module_main__2ljR4 {
|
|
11
|
-
/* This is set so children will sit beneath the header and footer when sticky */
|
|
12
|
-
z-index: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
15
|
.ProgressStepper-module_stepsContainer__xiaZx {
|
|
16
16
|
--progress-stepper-indicator-size: 1.25rem;
|
|
17
17
|
|
|
@@ -123,6 +123,28 @@
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
.Titles-module_titles__gE8Zb {
|
|
127
|
+
grid-area: titles;
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
flex-grow: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.Titles-module_pageTitle__CMn-j {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.Titles-module_prefix__-Kflu {
|
|
141
|
+
margin-bottom: var(--spacing-4);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.Titles-module_statusTag__fhxfV {
|
|
145
|
+
margin-top: var(--spacing-8);
|
|
146
|
+
}
|
|
147
|
+
|
|
126
148
|
.FooterRoot-module_footerRoot__DUoiZ {
|
|
127
149
|
display: grid;
|
|
128
150
|
grid-template-areas: "prev stepper next";
|
|
@@ -144,22 +166,6 @@
|
|
|
144
166
|
}
|
|
145
167
|
}
|
|
146
168
|
|
|
147
|
-
.Branding-module_branding__bawwf {
|
|
148
|
-
justify-content: center;
|
|
149
|
-
grid-area: branding;
|
|
150
|
-
display: flex;
|
|
151
|
-
flex-grow: 1;
|
|
152
|
-
padding-top: var(--spacing-4);
|
|
153
|
-
|
|
154
|
-
@media (width >= 768px) {
|
|
155
|
-
justify-content: unset;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.Branding-module_logo__qhM6C {
|
|
160
|
-
flex-basis: 7.5rem;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
169
|
.Actions-module_actions__WJwtK {
|
|
164
170
|
grid-area: actions;
|
|
165
171
|
display: flex;
|
|
@@ -192,28 +198,6 @@
|
|
|
192
198
|
justify-content: end;
|
|
193
199
|
}
|
|
194
200
|
|
|
195
|
-
.Titles-module_titles__gE8Zb {
|
|
196
|
-
grid-area: titles;
|
|
197
|
-
display: flex;
|
|
198
|
-
flex-direction: column;
|
|
199
|
-
align-items: center;
|
|
200
|
-
justify-content: center;
|
|
201
|
-
flex-grow: 1;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.Titles-module_pageTitle__CMn-j {
|
|
205
|
-
display: flex;
|
|
206
|
-
flex-direction: column;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.Titles-module_prefix__-Kflu {
|
|
210
|
-
margin-bottom: var(--spacing-4);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.Titles-module_statusTag__fhxfV {
|
|
214
|
-
margin-top: var(--spacing-8);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
201
|
.Root-module_root__FYpNx {
|
|
218
202
|
display: grid;
|
|
219
203
|
background-color: var(--color-white);
|
|
@@ -235,6 +219,22 @@
|
|
|
235
219
|
}
|
|
236
220
|
}
|
|
237
221
|
|
|
222
|
+
.Branding-module_branding__bawwf {
|
|
223
|
+
justify-content: center;
|
|
224
|
+
grid-area: branding;
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-grow: 1;
|
|
227
|
+
padding-top: var(--spacing-4);
|
|
228
|
+
|
|
229
|
+
@media (width >= 768px) {
|
|
230
|
+
justify-content: unset;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.Branding-module_logo__qhM6C {
|
|
235
|
+
flex-basis: 7.5rem;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
238
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
239
239
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
240
240
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
@@ -5349,7 +5349,8 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
5349
5349
|
display: grid;
|
|
5350
5350
|
max-height: 22rem;
|
|
5351
5351
|
}
|
|
5352
|
-
|
|
5352
|
+
|
|
5353
|
+
.ListBox-module_listBox__Uf6Mc:focus-visible {
|
|
5353
5354
|
outline: none;
|
|
5354
5355
|
}
|
|
5355
5356
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
@@ -7777,6 +7778,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7777
7778
|
border-radius: var(--border-solid-border-radius, 7px);
|
|
7778
7779
|
background: var(--color-white, #ffffff);
|
|
7779
7780
|
overflow: auto;
|
|
7781
|
+
z-index: 100000;
|
|
7780
7782
|
}
|
|
7781
7783
|
.Popover-module_popover__B7k5I:focus {
|
|
7782
7784
|
outline: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.61.
|
|
3
|
+
"version": "1.61.3",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -92,6 +92,8 @@
|
|
|
92
92
|
"@cultureamp/frontend-apis": "^9.8.2",
|
|
93
93
|
"@cultureamp/i18n-react-intl": "^2.6.1",
|
|
94
94
|
"@tanstack/react-query": "^5.51.23",
|
|
95
|
+
"@testing-library/dom": "^10.4.0",
|
|
96
|
+
"@types/jest-axe": "^3.5.9",
|
|
95
97
|
"@types/lodash.debounce": "^4.0.9",
|
|
96
98
|
"@types/react-highlight": "^0.12.8",
|
|
97
99
|
"@types/react-textfit": "^1.1.4",
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
"autoprefixer": "^10.4.20",
|
|
100
102
|
"concat-cli": "^4.0.0",
|
|
101
103
|
"identity-obj-proxy": "^3.0.0",
|
|
104
|
+
"jest-axe": "^9.0.0",
|
|
102
105
|
"lodash.isempty": "^4.4.0",
|
|
103
106
|
"normalize.css": "^8.0.1",
|
|
104
107
|
"postcss": "^8.4.41",
|
|
@@ -115,10 +118,9 @@
|
|
|
115
118
|
"sass": "^1.77.8",
|
|
116
119
|
"serialize-query-params": "^2.0.2",
|
|
117
120
|
"svgo": "^3.3.2",
|
|
118
|
-
"ts-jest": "^29.2.4",
|
|
119
121
|
"tslib": "^2.6.3",
|
|
120
122
|
"tsx": "^4.17.0",
|
|
121
|
-
"@kaizen/design-tokens": "10.6.
|
|
123
|
+
"@kaizen/design-tokens": "10.6.1",
|
|
122
124
|
"@kaizen/package-bundler": "1.1.4"
|
|
123
125
|
},
|
|
124
126
|
"peerDependencies": {
|
|
@@ -142,8 +144,7 @@
|
|
|
142
144
|
"build:global-styles": "postcss ./styles/global.css --output dist/global.css",
|
|
143
145
|
"build:combine-styles": "concat-cli -f ./dist/global.css ./dist/styles.css -o ./dist/styles.css && rm ./dist/global.css",
|
|
144
146
|
"build:styles": "pnpm build:global-styles && pnpm build:combine-styles",
|
|
145
|
-
"test": "FORCE_COLOR=1
|
|
146
|
-
"test:ci": "pnpm test -- --ci",
|
|
147
|
+
"test": "FORCE_COLOR=1 vitest --config ../../vite.config.ts",
|
|
147
148
|
"update-icons": "./src/Icon/bin/update-icons.sh",
|
|
148
149
|
"i18n:extract": "pnpm i18n-extract",
|
|
149
150
|
"clean": "rimraf 'dist' 'node_modules' '.turbo'",
|
|
@@ -6,7 +6,7 @@ describe("<Avatar />", () => {
|
|
|
6
6
|
// there is an issue with react-textfit that is only flagged in a test suite
|
|
7
7
|
// this solution silences that specific case https://github.com/malte-wessel/react-textfit/issues/35
|
|
8
8
|
beforeEach(() => {
|
|
9
|
-
|
|
9
|
+
vi.spyOn(console, "warn").mockImplementation(() => "")
|
|
10
10
|
})
|
|
11
11
|
|
|
12
12
|
it("renders user initials if the image link is broken", () => {
|
|
@@ -2,13 +2,13 @@ import React from "react"
|
|
|
2
2
|
import { render, screen, within } from "@testing-library/react"
|
|
3
3
|
import { format } from "date-fns"
|
|
4
4
|
import { enUS } from "date-fns/locale"
|
|
5
|
+
import { vi } from "vitest"
|
|
5
6
|
import { CalendarSingle, CalendarSingleProps } from "../CalendarSingle"
|
|
6
7
|
import { setFocusInCalendar } from "./setFocusInCalendar"
|
|
7
|
-
|
|
8
8
|
const CalendarWrapper = (props: Partial<CalendarSingleProps>): JSX.Element => (
|
|
9
9
|
<CalendarSingle
|
|
10
10
|
id="calendar-dialog"
|
|
11
|
-
onDayClick={
|
|
11
|
+
onDayClick={vi.fn()}
|
|
12
12
|
locale={enUS}
|
|
13
13
|
onMount={calendarElement =>
|
|
14
14
|
setFocusInCalendar(calendarElement, props.selected)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { render, waitFor } from "@testing-library/react"
|
|
3
3
|
import userEvent from "@testing-library/user-event"
|
|
4
|
+
import { vi } from "vitest"
|
|
4
5
|
import { CheckboxProps } from "./Checkbox"
|
|
5
6
|
import { Checkbox } from "."
|
|
6
|
-
|
|
7
7
|
const user = userEvent.setup()
|
|
8
8
|
|
|
9
9
|
const defaultProps = {
|
|
@@ -11,7 +11,7 @@ const defaultProps = {
|
|
|
11
11
|
checkedStatus: "off",
|
|
12
12
|
disabled: false,
|
|
13
13
|
name: "someCheckboxName",
|
|
14
|
-
onCheck:
|
|
14
|
+
onCheck: vi.fn(),
|
|
15
15
|
} satisfies CheckboxProps
|
|
16
16
|
|
|
17
17
|
describe("<Checkbox />", () => {
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { queryByTestId, render, waitFor } from "@testing-library/react"
|
|
3
3
|
import userEvent from "@testing-library/user-event"
|
|
4
|
+
import { vi } from "vitest"
|
|
4
5
|
import { Collapsible } from "./Collapsible"
|
|
5
|
-
|
|
6
6
|
const user = userEvent.setup()
|
|
7
7
|
|
|
8
8
|
describe("<Collapsible />", () => {
|
|
9
|
-
it("includes the 'sticky' class on buttons when the 'sticky' prop is specified", () => {
|
|
10
|
-
const { getByTestId } = render(
|
|
11
|
-
<Collapsible id="1" title="First panel" sticky={{ top: "0px" }}>
|
|
12
|
-
First panel content
|
|
13
|
-
</Collapsible>
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
const collapsibleContainer = getByTestId("collapsible-header-1")
|
|
17
|
-
|
|
18
|
-
expect(collapsibleContainer.classList.contains("sticky")).toBeTruthy()
|
|
19
|
-
})
|
|
20
|
-
|
|
21
9
|
it("toggles the height of the section on click of the button", async () => {
|
|
22
10
|
const { getByTestId } = render(
|
|
23
11
|
<Collapsible id="1" open title="First panel">
|
|
@@ -74,7 +62,7 @@ describe("<Collapsible />", () => {
|
|
|
74
62
|
})
|
|
75
63
|
|
|
76
64
|
it("runs the onToggle callback", async () => {
|
|
77
|
-
const onToggle =
|
|
65
|
+
const onToggle = vi.fn()
|
|
78
66
|
|
|
79
67
|
const { getByTestId } = render(
|
|
80
68
|
<Collapsible id="1" open title="First panel" onToggle={onToggle}>
|
|
@@ -30,8 +30,6 @@ Collapsibles are used to collapse and expand content inline on a page. This lets
|
|
|
30
30
|
|
|
31
31
|
<DocsStory of={CollapsibleStories.CustomHeader} />
|
|
32
32
|
|
|
33
|
-
<DocsStory of={CollapsibleStories.Sticky} sourceState="shown" />
|
|
34
|
-
|
|
35
33
|
### Controlled
|
|
36
34
|
|
|
37
35
|
Control the open state using a `useState` (or similar) by setting the `controlled` prop to `true`
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Meta } from "@storybook/react"
|
|
3
|
+
import { within } from "@storybook/test"
|
|
3
4
|
import { Heading } from "~components/Heading"
|
|
5
|
+
import { Text } from "~components/Text"
|
|
4
6
|
import {
|
|
5
7
|
StickerSheet,
|
|
6
8
|
StickerSheetStory,
|
|
@@ -73,3 +75,50 @@ export const StickerSheetRTL: StickerSheetStory = {
|
|
|
73
75
|
name: "Sticker Sheet (RTL)",
|
|
74
76
|
parameters: { textDirection: "rtl" },
|
|
75
77
|
}
|
|
78
|
+
|
|
79
|
+
export const Sticky: StickerSheetStory = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<StickerSheet>
|
|
82
|
+
<StickerSheet.Body>
|
|
83
|
+
<StickerSheet.Row rowTitle="Sticky header">
|
|
84
|
+
<div style={{ height: "300px", overflow: "auto" }}>
|
|
85
|
+
<Collapsible
|
|
86
|
+
open
|
|
87
|
+
title="Sticky"
|
|
88
|
+
sticky={{ top: "-1px" }}
|
|
89
|
+
style={{ maxWidth: "300px" }}
|
|
90
|
+
>
|
|
91
|
+
<Text variant="body">
|
|
92
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
93
|
+
Phasellus ac scelerisque sem, vel ultricies justo. Donec eu
|
|
94
|
+
porttitor ante, nec gravida orci. Nulla facilisi. Cras varius
|
|
95
|
+
erat id fermentum mattis. Mauris bibendum vestibulum erat, quis
|
|
96
|
+
blandit metus viverra sit amet. Vivamus pretium vitae turpis ut
|
|
97
|
+
condimentum. Sed vulputate magna nisl, in cursus urna hendrerit
|
|
98
|
+
et. Aenean semper, est non feugiat sodales, nisl ligula aliquet
|
|
99
|
+
lorem, sit amet scelerisque arcu quam a sapien. Donec in viverra
|
|
100
|
+
urna.
|
|
101
|
+
</Text>
|
|
102
|
+
<Text variant="body" data-testid="bottom-content">
|
|
103
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
104
|
+
Phasellus ac scelerisque sem, vel ultricies justo. Donec eu
|
|
105
|
+
porttitor ante, nec gravida orci. Nulla facilisi. Cras varius
|
|
106
|
+
erat id fermentum mattis. Mauris bibendum vestibulum erat, quis
|
|
107
|
+
blandit metus viverra sit amet. Vivamus pretium vitae turpis ut
|
|
108
|
+
condimentum. Sed vulputate magna nisl, in cursus urna hendrerit
|
|
109
|
+
et. Aenean semper, est non feugiat sodales, nisl ligula aliquet
|
|
110
|
+
lorem, sit amet scelerisque arcu quam a sapien. Donec in viverra
|
|
111
|
+
urna.
|
|
112
|
+
</Text>
|
|
113
|
+
</Collapsible>
|
|
114
|
+
</div>
|
|
115
|
+
</StickerSheet.Row>
|
|
116
|
+
</StickerSheet.Body>
|
|
117
|
+
</StickerSheet>
|
|
118
|
+
),
|
|
119
|
+
play: async ({ canvasElement }) => {
|
|
120
|
+
const canvas = within(canvasElement)
|
|
121
|
+
const element = canvas.getByTestId("bottom-content")
|
|
122
|
+
element.scrollIntoView({ behavior: "instant", block: "end" })
|
|
123
|
+
},
|
|
124
|
+
}
|
|
@@ -88,17 +88,6 @@ export const CustomHeader: Story = {
|
|
|
88
88
|
),
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
export const Sticky: Story = {
|
|
92
|
-
args: {
|
|
93
|
-
title: "Sticky header",
|
|
94
|
-
},
|
|
95
|
-
render: ({ title }) => (
|
|
96
|
-
<Collapsible open title={title} sticky={{ top: "-1px" }}>
|
|
97
|
-
This does not work in Storybook docs, so use this as a code example only.
|
|
98
|
-
</Collapsible>
|
|
99
|
-
),
|
|
100
|
-
}
|
|
101
|
-
|
|
102
91
|
const controlledSourceCode = `
|
|
103
92
|
const [isOpen, setIsOpen] = useState<boolean>(false)
|
|
104
93
|
return (<Collapsible {...args} open={isOpen} onToggle={setIsOpen} />)
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
import { waitFor } from "@testing-library/react"
|
|
2
|
+
import { waitFor, render } from "@testing-library/react"
|
|
3
3
|
import { enUS } from "date-fns/locale"
|
|
4
|
-
import { renderWithIntl } from "~tests"
|
|
5
4
|
import { DateInputDescription } from "./DateInputDescription"
|
|
6
5
|
|
|
7
6
|
describe("DateInputDescription", () => {
|
|
8
7
|
it("returns template string when description is undefined", async () => {
|
|
9
|
-
const { container } =
|
|
8
|
+
const { container } = render(<DateInputDescription locale={enUS} />)
|
|
10
9
|
await waitFor(() => {
|
|
11
10
|
expect(container).toHaveTextContent("Input format:mm/dd/yyyy")
|
|
12
11
|
})
|
|
13
12
|
})
|
|
14
13
|
|
|
15
14
|
it("returns template string when description is empty string", async () => {
|
|
16
|
-
const { container } =
|
|
15
|
+
const { container } = render(
|
|
17
16
|
<DateInputDescription description="" locale={enUS} />
|
|
18
17
|
)
|
|
19
18
|
await waitFor(() => {
|
|
@@ -22,7 +21,7 @@ describe("DateInputDescription", () => {
|
|
|
22
21
|
})
|
|
23
22
|
|
|
24
23
|
it("returns template string when description is a string", async () => {
|
|
25
|
-
const { container } =
|
|
24
|
+
const { container } = render(
|
|
26
25
|
<DateInputDescription
|
|
27
26
|
description="Custom description here"
|
|
28
27
|
locale={enUS}
|
|
@@ -36,7 +35,7 @@ describe("DateInputDescription", () => {
|
|
|
36
35
|
})
|
|
37
36
|
|
|
38
37
|
it("returns template string when description is an element", async () => {
|
|
39
|
-
const { container } =
|
|
38
|
+
const { container } = render(
|
|
40
39
|
<DateInputDescription
|
|
41
40
|
description={<span>Custom description span</span>}
|
|
42
41
|
locale={enUS}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useRef } from "react"
|
|
2
2
|
import { render, screen } from "@testing-library/react"
|
|
3
3
|
import userEvent from "@testing-library/user-event"
|
|
4
|
+
import { vi } from "vitest"
|
|
4
5
|
import {
|
|
5
6
|
DateInputWithIconButton,
|
|
6
7
|
DateInputWithIconButtonProps,
|
|
@@ -11,7 +12,7 @@ const user = userEvent.setup()
|
|
|
11
12
|
const defaultProps: DateInputWithIconButtonProps = {
|
|
12
13
|
id: "test__date-input-with-icon-button",
|
|
13
14
|
labelText: "Due date",
|
|
14
|
-
onButtonClick:
|
|
15
|
+
onButtonClick: vi.fn(),
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const DateInputWithIconButtonWrapper = (
|
|
@@ -52,10 +53,7 @@ describe("<DateInputWithIconButton />", () => {
|
|
|
52
53
|
|
|
53
54
|
describe("Refs", () => {
|
|
54
55
|
it("correctly passes through input and button refs", async () => {
|
|
55
|
-
const onButtonClick =
|
|
56
|
-
void,
|
|
57
|
-
[string | null | undefined, string | null | undefined]
|
|
58
|
-
>()
|
|
56
|
+
const onButtonClick = vi.fn()
|
|
59
57
|
|
|
60
58
|
const Wrapper = (): JSX.Element => {
|
|
61
59
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
@@ -74,7 +72,7 @@ describe("<DateInputWithIconButton />", () => {
|
|
|
74
72
|
ref={ref}
|
|
75
73
|
id="test__date-input-field--ref"
|
|
76
74
|
labelText="label"
|
|
77
|
-
onButtonClick={
|
|
75
|
+
onButtonClick={vi.fn()}
|
|
78
76
|
/>
|
|
79
77
|
<button type="button" onClick={handleClick}>
|
|
80
78
|
Click me
|