@kaizen/components 0.0.0-canary-fix-select-focus-add-small-delay-20241013230007 → 0.0.0-canary-codemod-tsx-20241030002309
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/bin/codemod.sh +2 -2
- package/codemods/README.md +12 -4
- package/codemods/upgradeIconV1/getNewIconPropsFromOldIconName.ts +255 -0
- package/codemods/upgradeIconV1/index.ts +33 -0
- package/codemods/upgradeIconV1/transformCaMonogramIconToBrand.spec.ts +83 -0
- package/codemods/upgradeIconV1/transformCaMonogramIconToBrand.ts +53 -0
- package/codemods/upgradeIconV1/transformIcon.spec.ts +181 -0
- package/codemods/upgradeIconV1/transformIcon.ts +115 -0
- package/codemods/upgradeIconV1/transformSpinnerIconToLoadingSpinner.spec.ts +81 -0
- package/codemods/upgradeIconV1/transformSpinnerIconToLoadingSpinner.ts +41 -0
- package/codemods/upgradeIconV1/upgradeIconV1.spec.ts +306 -0
- package/codemods/upgradeIconV1/upgradeIconV1.ts +94 -0
- package/codemods/utils/createProp.spec.ts +83 -0
- package/codemods/utils/createProp.ts +51 -0
- package/codemods/utils/getKaioTagName.spec.ts +85 -0
- package/codemods/utils/getKaioTagName.ts +129 -0
- package/codemods/utils/index.ts +3 -1
- package/codemods/utils/transformComponentsInDir.ts +32 -16
- package/codemods/utils/transformSource.ts +10 -5
- package/codemods/utils/updateJsxElementWithNewProps.ts +4 -3
- package/codemods/utils/updateKaioImports.spec.ts +223 -0
- package/codemods/utils/updateKaioImports.ts +233 -0
- package/dist/cjs/Avatar/Avatar.cjs +16 -13
- package/dist/cjs/Calendar/CalendarRange/CalendarRange.cjs +9 -7
- package/dist/cjs/Calendar/CalendarSingle/CalendarSingle.cjs +9 -7
- package/dist/cjs/Calendar/LegacyCalendarRange/LegacyCalendarRange.cjs +9 -7
- package/dist/cjs/Checkbox/Checkbox/Checkbox.cjs +5 -11
- package/dist/cjs/ClearButton/ClearButton.cjs +5 -4
- package/dist/cjs/Collapsible/Collapsible/Collapsible.cjs +4 -7
- package/dist/cjs/DateInput/DateInputWithIconButton/DateInputWithIconButton.cjs +5 -4
- package/dist/cjs/DateRangePicker/DateRangePicker.cjs +5 -4
- package/dist/cjs/ErrorPage/ErrorPage.cjs +9 -7
- package/dist/cjs/FieldMessage/FieldMessage.cjs +5 -11
- package/dist/cjs/Filter/FilterBar/context/FilterBarContext.cjs +17 -2
- package/dist/cjs/Filter/FilterBar/context/reducer/filterBarStateReducer.cjs +4 -0
- package/dist/cjs/Filter/FilterBar/context/reducer/setupFilterBarState.cjs +2 -1
- package/dist/cjs/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +16 -6
- package/dist/cjs/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.cjs +12 -1
- package/dist/cjs/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.cjs +13 -2
- package/dist/cjs/Filter/FilterButton/FilterButton/FilterButton.cjs +4 -7
- package/dist/cjs/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.cjs +5 -5
- package/dist/cjs/Filter/FilterMultiSelect/FilterMultiSelect.cjs +4 -2
- package/dist/cjs/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.cjs +4 -2
- package/dist/cjs/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.cjs +4 -4
- package/dist/cjs/GuidanceBlock/GuidanceBlock.cjs +5 -4
- package/dist/cjs/Illustration/utils/usePausePlay.cjs +5 -8
- package/dist/cjs/Input/InputSearch/InputSearch.cjs +4 -3
- package/dist/cjs/LikertScaleLegacy/LikertScaleLegacy.cjs +5 -6
- package/dist/cjs/Loading/LoadingSpinner/LoadingSpinner.cjs +6 -42
- package/dist/cjs/Loading/LoadingSpinner/LoadingSpinner.module.css.cjs +10 -0
- package/dist/cjs/Loading/LoadingSpinner/subcomponents/SpinnerIcon.cjs +80 -0
- package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +31 -26
- package/dist/cjs/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.cjs +4 -5
- package/dist/cjs/MultiSelect/subcomponents/Checkbox/Checkbox.cjs +7 -17
- package/dist/cjs/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.cjs +4 -7
- package/dist/cjs/Notification/subcomponents/CancelButton/CancelButton.cjs +4 -3
- package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +33 -38
- package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css.cjs +6 -0
- package/dist/cjs/Pagination/subcomponents/DirectionalLink/DirectionalLink.cjs +11 -19
- package/dist/cjs/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.cjs +4 -5
- package/dist/cjs/Popover/Popover.cjs +5 -4
- package/dist/cjs/Popover/utils/classMappers.cjs +21 -16
- package/dist/cjs/RichTextEditor/RichTextEditor/utils/controlmap.cjs +29 -25
- package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.cjs +10 -12
- package/dist/cjs/Select/Select.cjs +8 -10
- package/dist/cjs/SplitButton/subcomponents/DropdownButton/DropdownButton.cjs +4 -4
- package/dist/cjs/Table/Table.cjs +11 -10
- package/dist/cjs/Tag/Tag.cjs +21 -17
- package/dist/cjs/TextArea/TextArea.cjs +20 -52
- package/dist/cjs/TextArea/TextArea.module.css.cjs +14 -0
- package/dist/cjs/TextField/TextField.cjs +7 -6
- package/dist/cjs/TextField/TextField.module.scss.cjs +4 -6
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +8 -7
- package/dist/cjs/TitleBlockZen/TitleBlockZen.cjs +9 -12
- package/dist/cjs/TitleBlockZen/subcomponents/MainActions.cjs +7 -7
- package/dist/cjs/TitleBlockZen/subcomponents/MobileActions.cjs +10 -15
- package/dist/cjs/TitleBlockZen/subcomponents/SecondaryActions.cjs +7 -7
- package/dist/cjs/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +5 -5
- package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs +13 -18
- package/dist/cjs/__future__/Icon/Icon.cjs +47 -0
- package/dist/cjs/__future__/Icon/Icon.module.css.cjs +10 -0
- package/dist/cjs/__future__/Icon/constants.cjs +8 -0
- package/dist/cjs/__future__/Select/subcomponents/ListBox/ListBox.cjs +7 -10
- package/dist/cjs/__future__/Select/subcomponents/Option/Option.cjs +4 -5
- package/dist/cjs/__future__/Select/subcomponents/SelectToggle/SelectToggle.cjs +5 -9
- package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveButton.cjs +4 -3
- package/dist/cjs/future.cjs +2 -0
- package/dist/esm/Avatar/Avatar.mjs +16 -13
- package/dist/esm/Calendar/CalendarRange/CalendarRange.mjs +9 -7
- package/dist/esm/Calendar/CalendarSingle/CalendarSingle.mjs +9 -7
- package/dist/esm/Calendar/LegacyCalendarRange/LegacyCalendarRange.mjs +9 -7
- package/dist/esm/Checkbox/Checkbox/Checkbox.mjs +5 -11
- package/dist/esm/ClearButton/ClearButton.mjs +5 -4
- package/dist/esm/Collapsible/Collapsible/Collapsible.mjs +5 -8
- package/dist/esm/DateInput/DateInputWithIconButton/DateInputWithIconButton.mjs +5 -4
- package/dist/esm/DateRangePicker/DateRangePicker.mjs +5 -4
- package/dist/esm/ErrorPage/ErrorPage.mjs +10 -8
- package/dist/esm/FieldMessage/FieldMessage.mjs +6 -12
- package/dist/esm/Filter/FilterBar/context/FilterBarContext.mjs +17 -2
- package/dist/esm/Filter/FilterBar/context/reducer/filterBarStateReducer.mjs +4 -0
- package/dist/esm/Filter/FilterBar/context/reducer/setupFilterBarState.mjs +2 -1
- package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +17 -7
- package/dist/esm/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.mjs +13 -2
- package/dist/esm/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.mjs +14 -3
- package/dist/esm/Filter/FilterButton/FilterButton/FilterButton.mjs +5 -8
- package/dist/esm/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.mjs +5 -5
- package/dist/esm/Filter/FilterMultiSelect/FilterMultiSelect.mjs +4 -2
- package/dist/esm/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.mjs +4 -2
- package/dist/esm/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.mjs +4 -4
- package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +5 -4
- package/dist/esm/Illustration/utils/usePausePlay.mjs +5 -8
- package/dist/esm/Input/InputSearch/InputSearch.mjs +4 -3
- package/dist/esm/LikertScaleLegacy/LikertScaleLegacy.mjs +5 -6
- package/dist/esm/Loading/LoadingSpinner/LoadingSpinner.mjs +6 -42
- package/dist/esm/Loading/LoadingSpinner/LoadingSpinner.module.css.mjs +8 -0
- package/dist/esm/Loading/LoadingSpinner/subcomponents/SpinnerIcon.mjs +72 -0
- package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +31 -26
- package/dist/esm/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.mjs +4 -5
- package/dist/esm/MultiSelect/subcomponents/Checkbox/Checkbox.mjs +7 -17
- package/dist/esm/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.mjs +5 -8
- package/dist/esm/Notification/subcomponents/CancelButton/CancelButton.mjs +4 -3
- package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +33 -38
- package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css.mjs +4 -0
- package/dist/esm/Pagination/subcomponents/DirectionalLink/DirectionalLink.mjs +11 -19
- package/dist/esm/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.mjs +4 -5
- package/dist/esm/Popover/Popover.mjs +5 -4
- package/dist/esm/Popover/utils/classMappers.mjs +21 -16
- package/dist/esm/RichTextEditor/RichTextEditor/utils/controlmap.mjs +33 -29
- package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.mjs +10 -12
- package/dist/esm/Select/Select.mjs +9 -11
- package/dist/esm/SplitButton/subcomponents/DropdownButton/DropdownButton.mjs +4 -4
- package/dist/esm/Table/Table.mjs +11 -10
- package/dist/esm/Tag/Tag.mjs +21 -17
- package/dist/esm/TextArea/TextArea.mjs +21 -53
- package/dist/esm/TextArea/TextArea.module.css.mjs +12 -0
- package/dist/esm/TextField/TextField.mjs +7 -6
- package/dist/esm/TextField/TextField.module.scss.mjs +4 -6
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +8 -7
- package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +9 -12
- package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs +7 -7
- package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs +13 -18
- package/dist/esm/TitleBlockZen/subcomponents/SecondaryActions.mjs +7 -7
- package/dist/esm/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +5 -5
- package/dist/esm/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs +16 -21
- package/dist/esm/__future__/Icon/Icon.mjs +38 -0
- package/dist/esm/__future__/Icon/Icon.module.css.mjs +8 -0
- package/dist/esm/__future__/Icon/constants.mjs +6 -0
- package/dist/esm/__future__/Select/subcomponents/ListBox/ListBox.mjs +7 -10
- package/dist/esm/__future__/Select/subcomponents/Option/Option.mjs +4 -5
- package/dist/esm/__future__/Select/subcomponents/SelectToggle/SelectToggle.mjs +6 -10
- package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveButton.mjs +4 -3
- package/dist/esm/future.mjs +1 -0
- package/dist/styles.css +1026 -1699
- package/dist/types/Filter/FilterBar/context/FilterBarContext.d.ts +2 -0
- package/dist/types/Filter/FilterBar/context/reducer/filterBarStateReducer.d.ts +3 -0
- package/dist/types/Filter/FilterBar/context/types.d.ts +1 -0
- package/dist/types/Filter/FilterMultiSelect/FilterMultiSelect.d.ts +2 -1
- package/dist/types/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.d.ts +2 -1
- package/dist/types/Loading/LoadingSpinner/LoadingSpinner.d.ts +2 -2
- package/dist/types/Loading/LoadingSpinner/subcomponents/SpinnerIcon.d.ts +5 -0
- package/dist/types/Loading/LoadingSpinner/subcomponents/index.d.ts +1 -0
- package/dist/types/TextArea/TextArea.d.ts +4 -0
- package/dist/types/__future__/Icon/Icon.d.ts +21 -0
- package/dist/types/__future__/Icon/constants.d.ts +5 -0
- package/dist/types/__future__/Icon/index.d.ts +1 -0
- package/dist/types/__future__/Icon/types.d.ts +4 -0
- package/dist/types/__future__/index.d.ts +1 -0
- package/package.json +34 -35
- package/src/Avatar/Avatar.module.scss +10 -12
- package/src/Avatar/Avatar.tsx +14 -5
- package/src/BrandMoment/_docs/BrandMoment.stories.tsx +6 -10
- package/src/BrandMoment/_docs/ExampleHeaders.tsx +2 -2
- package/src/Calendar/CalendarRange/CalendarRange.tsx +7 -3
- package/src/Calendar/CalendarSingle/CalendarSingle.tsx +7 -3
- package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.tsx +7 -3
- package/src/Calendar/baseCalendarClassNames.module.scss +0 -4
- package/src/Checkbox/Checkbox/Checkbox.module.scss +2 -10
- package/src/Checkbox/Checkbox/Checkbox.tsx +6 -8
- package/src/ClearButton/ClearButton.tsx +2 -2
- package/src/Collapsible/Collapsible/Collapsible.tsx +5 -6
- package/src/Collapsible/Collapsible/_docs/Collapsible.stories.tsx +2 -2
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +2 -7
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.tsx +2 -2
- package/src/DateRangePicker/DateRangePicker.tsx +2 -2
- package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +8 -2
- package/src/EmptyState/_docs/EmptyState.stories.tsx +4 -2
- package/src/ErrorPage/ErrorPage.tsx +5 -3
- package/src/FieldMessage/FieldMessage.tsx +6 -14
- package/src/Filter/FilterBar/FilterBar.spec.tsx +99 -12
- package/src/Filter/FilterBar/context/FilterBarContext.tsx +11 -2
- package/src/Filter/FilterBar/context/reducer/filterBarStateReducer.ts +7 -0
- package/src/Filter/FilterBar/context/reducer/setupFilterBarState.ts +1 -0
- package/src/Filter/FilterBar/context/types.ts +1 -0
- package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +14 -4
- package/src/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.tsx +10 -2
- package/src/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.tsx +18 -3
- package/src/Filter/FilterButton/FilterButton/FilterButton.module.scss +1 -1
- package/src/Filter/FilterButton/FilterButton/FilterButton.tsx +5 -6
- package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.tsx +2 -2
- package/src/Filter/FilterDateRangePicker/FilterDateRangePicker.spec.tsx +0 -1
- package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.spec.tsx +2 -1
- package/src/Filter/FilterMultiSelect/FilterMultiSelect.tsx +3 -1
- package/src/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.tsx +4 -1
- package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.tsx +2 -2
- package/src/Filter/FilterMultiSelect/subcomponents/SelectionControlButton/SelectionControlButton.module.scss +9 -10
- package/src/Filter/FilterSelect/FilterSelect.spec.tsx +4 -5
- package/src/GuidanceBlock/GuidanceBlock.module.scss +4 -5
- package/src/GuidanceBlock/GuidanceBlock.tsx +6 -2
- package/src/Icon/_docs/{Icon.stories.tsx → Icon.docs.stories.tsx} +1 -1
- package/src/Icon/_docs/Icon.mdx +1 -2
- package/src/Icon/_docs/Icon.stickersheet.stories.tsx +1 -1
- package/src/Icon/bin/update-icons.sh +1 -1
- package/src/Illustration/utils/usePausePlay.tsx +7 -5
- package/src/Input/Input/_docs/Input.stickersheet.stories.tsx +7 -5
- package/src/Input/Input/_docs/Input.stories.tsx +5 -3
- package/src/Input/InputRange/InputRange.module.scss +4 -4
- package/src/Input/InputSearch/InputSearch.module.scss +21 -21
- package/src/Input/InputSearch/InputSearch.tsx +2 -2
- package/src/Label/Label.module.scss +4 -0
- package/src/LikertScaleLegacy/LikertScaleLegacy.module.scss +7 -8
- package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +2 -2
- package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.stories.tsx +2 -2
- package/src/Loading/LoadingSpinner/LoadingSpinner.module.css +32 -0
- package/src/Loading/LoadingSpinner/LoadingSpinner.tsx +10 -54
- package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.mdx +7 -2
- package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.stickersheet.stories.tsx +2 -1
- package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.stories.tsx +19 -0
- package/src/Loading/LoadingSpinner/subcomponents/SpinnerIcon.tsx +87 -0
- package/src/Loading/LoadingSpinner/subcomponents/index.ts +1 -0
- package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +2 -0
- package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +32 -35
- package/src/Modal/ContextModal/ContextModal.module.scss +4 -4
- package/src/Modal/GenericModal/GenericModal.module.scss +8 -8
- package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.module.scss +2 -2
- package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.tsx +2 -2
- package/src/Modal/InputEditModal/InputEditModal.module.scss +4 -4
- package/src/MultiSelect/MultiSelect.spec.tsx +7 -3
- package/src/MultiSelect/subcomponents/Checkbox/Checkbox.module.scss +0 -6
- package/src/MultiSelect/subcomponents/Checkbox/Checkbox.tsx +10 -9
- package/src/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.spec.tsx +11 -7
- package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.tsx +5 -7
- package/src/Notification/subcomponents/CancelButton/CancelButton.tsx +2 -2
- package/src/Notification/subcomponents/GenericNotification/_mixins.scss +9 -8
- package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css +3 -0
- package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +22 -16
- package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.module.scss +0 -4
- package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.tsx +13 -12
- package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.module.scss +0 -1
- package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.tsx +2 -2
- package/src/Popover/Popover.module.scss +3 -3
- package/src/Popover/Popover.tsx +2 -2
- package/src/Popover/utils/classMappers.tsx +6 -11
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss +2 -2
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stickersheet.stories.tsx +7 -7
- package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stories.tsx +2 -2
- package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.spec.tsx +7 -4
- package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/_docs/Toolbar.stories.tsx +18 -12
- package/src/RichTextEditor/RichTextEditor/utils/controlmap.tsx +25 -18
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx +4 -8
- package/src/Select/Select.module.scss +9 -7
- package/src/Select/Select.tsx +10 -7
- package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.spec.tsx +4 -5
- package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.tsx +2 -2
- package/src/Table/Table.module.scss +11 -7
- package/src/Table/Table.tsx +4 -8
- package/src/Table/_docs/Table.stickersheet.stories.tsx +4 -4
- package/src/Table/_docs/Table.stories.tsx +3 -3
- package/src/Tag/Tag.module.scss +2 -0
- package/src/Tag/Tag.tsx +7 -13
- package/src/Text/Text.module.scss +2 -0
- package/src/TextArea/TextArea.module.css +142 -0
- package/src/TextArea/TextArea.tsx +25 -53
- package/src/TextField/TextField.module.scss +10 -36
- package/src/TextField/TextField.spec.tsx +9 -4
- package/src/TextField/TextField.tsx +4 -6
- package/src/TextField/_docs/TextField.stickersheet.stories.tsx +9 -1
- package/src/TextField/_docs/TextField.stories.tsx +4 -3
- package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +7 -8
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +3 -3
- package/src/TitleBlockZen/TitleBlockZen.module.scss +15 -21
- package/src/TitleBlockZen/TitleBlockZen.spec.tsx +1 -1
- package/src/TitleBlockZen/TitleBlockZen.tsx +6 -9
- package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +5 -5
- package/src/TitleBlockZen/subcomponents/MainActions.tsx +5 -3
- package/src/TitleBlockZen/subcomponents/MobileActions.module.scss +2 -2
- package/src/TitleBlockZen/subcomponents/MobileActions.tsx +13 -16
- package/src/TitleBlockZen/subcomponents/SecondaryActions.tsx +3 -3
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +0 -3
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +2 -2
- package/src/Workflow/_docs/Workflow.stories.tsx +4 -5
- package/src/Workflow/_docs/WorkflowHeader.stories.tsx +4 -5
- package/src/Workflow/_docs/controls/controls.tsx +4 -4
- package/src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx +6 -31
- package/src/__actions__/Button/v1/Button/_docs/Button.mdx +1 -1
- package/src/__actions__/Button/v1/Button/_docs/Button.stickersheet.stories.tsx +6 -6
- package/src/__actions__/Button/v1/Button/_docs/Button.stories.tsx +7 -6
- package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stickersheet.stories.tsx +7 -7
- package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stories.tsx +5 -5
- package/src/__actions__/Button/v2/Button/_docs/Button.mdx +1 -1
- package/src/__actions__/Button/v2/Button/_docs/Button.stories.tsx +7 -6
- package/src/__actions__/Button/v2/IconButton/_docs/IconButton.stories.tsx +5 -5
- package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +1 -1
- package/src/__actions__/Button/v3/_docs/Button.docs.stories.tsx +1 -1
- package/src/__actions__/Button/v3/_docs/Button.mdx +1 -1
- package/src/__actions__/Button/v3/_docs/Button.spec.stories.tsx +1 -1
- package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +3 -3
- package/src/__actions__/Button/v3/_docs/Button.stories.tsx +1 -1
- package/src/__actions__/Menu/v1/_docs/Menu.stickersheet.stories.tsx +3 -3
- package/src/__actions__/Menu/v1/_docs/Menu.stories.tsx +3 -3
- package/src/__actions__/Menu/v1/_docs/MenuContentExample.tsx +6 -6
- package/src/__actions__/Menu/v1/_docs/examples.tsx +5 -5
- package/src/__actions__/Menu/v2/_docs/Menu.stories.tsx +3 -3
- package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +1 -3
- package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +46 -45
- package/src/__actions__/Menu/v3/_docs/Menu.mdx +1 -1
- package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +21 -23
- package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +12 -15
- package/src/__future__/Icon/Icon.module.css +35 -0
- package/src/__future__/Icon/Icon.spec.tsx +36 -0
- package/src/__future__/Icon/Icon.tsx +85 -0
- package/src/__future__/Icon/_docs/Icon--api-specification.mdx +98 -0
- package/src/__future__/Icon/_docs/Icon--usage-guidelines.mdx +145 -0
- package/src/__future__/Icon/_docs/Icon.docs.module.css +17 -0
- package/src/__future__/Icon/_docs/Icon.docs.stories.tsx +524 -0
- package/src/__future__/Icon/_docs/Icon.stickersheet.stories.tsx +126 -0
- package/src/__future__/Icon/_docs/assets/interface-dont.png +0 -0
- package/src/__future__/Icon/_docs/assets/tooltip-dont.png +0 -0
- package/src/__future__/Icon/constants.ts +149 -0
- package/src/__future__/Icon/index.ts +1 -0
- package/src/__future__/Icon/material-symbols-metadata.json +3370 -0
- package/src/__future__/Icon/types.ts +11 -0
- package/src/__future__/Select/subcomponents/ListBox/ListBox.tsx +4 -7
- package/src/__future__/Select/subcomponents/Option/Option.tsx +2 -2
- package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.module.scss +1 -1
- package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.tsx +6 -9
- package/src/__future__/Tag/RemovableTag/_docs/RemovableTag.stories.tsx +0 -77
- package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.module.scss +1 -58
- package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.tsx +2 -12
- package/src/__future__/Tag/Tag/Tag.module.scss +1 -1
- package/src/__future__/Tag/Tag/_docs/Tag-migration-guide.stories.tsx +6 -17
- package/src/__future__/Tag/Tag/_docs/Tag.stickersheet.stories.tsx +5 -2
- package/src/__future__/Tag/Tag/_docs/Tag.stories.tsx +13 -6
- package/src/__future__/index.ts +1 -0
- package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stickersheet.stories.tsx +10 -10
- package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stories.tsx +7 -4
- package/src/__overlays__/Tooltip/v1/utils/isSemanticElement.spec.tsx +4 -11
- package/src/__overlays__/Tooltip/v3/_docs/Tooltip.docs.stories.tsx +10 -10
- package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +3 -3
- package/codemods/utils/getTagName.spec.ts +0 -24
- package/codemods/utils/getTagName.ts +0 -32
- package/dist/cjs/Loading/LoadingSpinner/LoadingSpinner.module.scss.cjs +0 -7
- package/dist/cjs/TextArea/TextArea.module.scss.cjs +0 -13
- package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.cjs +0 -23
- package/dist/esm/Loading/LoadingSpinner/LoadingSpinner.module.scss.mjs +0 -5
- package/dist/esm/TextArea/TextArea.module.scss.mjs +0 -11
- package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.mjs +0 -15
- package/dist/types/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.d.ts +0 -2
- package/src/Loading/LoadingSpinner/LoadingSpinner.module.scss +0 -16
- package/src/TextArea/TextArea.module.scss +0 -137
- package/src/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.tsx +0 -21
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
3
|
import { Heading } from "~components/Heading"
|
|
4
|
-
import { AddIcon } from "~components/Icon"
|
|
5
4
|
import { Text } from "~components/Text"
|
|
5
|
+
import { Icon } from "~components/__future__/Icon"
|
|
6
6
|
import { Collapsible } from "../index"
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
@@ -76,7 +76,7 @@ export const CustomHeader: Story = {
|
|
|
76
76
|
renderHeader={title => (
|
|
77
77
|
<Heading variant="heading-4" tag="span">
|
|
78
78
|
<span className="flex gap-8 items-center">
|
|
79
|
-
<
|
|
79
|
+
<Icon name="potted_plant" isPresentational /> {title}
|
|
80
80
|
</span>
|
|
81
81
|
</Heading>
|
|
82
82
|
)}
|
|
@@ -9,8 +9,8 @@ $input-disabled-opacity: 0.3;
|
|
|
9
9
|
.iconButton {
|
|
10
10
|
@include button-reset;
|
|
11
11
|
|
|
12
|
-
display:
|
|
13
|
-
padding:
|
|
12
|
+
display: flex;
|
|
13
|
+
padding: var(--spacing-6);
|
|
14
14
|
border: $border-solid-border-width $border-solid-border-style transparent;
|
|
15
15
|
border-radius: $border-solid-border-radius;
|
|
16
16
|
position: relative;
|
|
@@ -35,11 +35,6 @@ $input-disabled-opacity: 0.3;
|
|
|
35
35
|
background-color: $color-blue-100;
|
|
36
36
|
color: $color-blue-500;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
svg {
|
|
40
|
-
position: relative;
|
|
41
|
-
top: 2px;
|
|
42
|
-
}
|
|
43
38
|
}
|
|
44
39
|
|
|
45
40
|
.calendarActive {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import classnames from "classnames"
|
|
3
|
-
import {
|
|
3
|
+
import { Icon } from "~components/__future__/Icon"
|
|
4
4
|
import { isRefObject } from "~components/utils/isRefObject"
|
|
5
5
|
import { DateInput, DateInputProps } from "../DateInput"
|
|
6
6
|
import styles from "./DateInputWithIconButton.module.scss"
|
|
@@ -39,7 +39,7 @@ export const DateInputWithIconButton = React.forwardRef<
|
|
|
39
39
|
disabled && styles.disabled
|
|
40
40
|
)}
|
|
41
41
|
>
|
|
42
|
-
<
|
|
42
|
+
<Icon name="today" isPresentational isFilled />
|
|
43
43
|
</button>
|
|
44
44
|
)
|
|
45
45
|
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
LegacyCalendarRange,
|
|
14
14
|
LegacyCalendarRangeProps,
|
|
15
15
|
} from "~components/Calendar/LegacyCalendarRange"
|
|
16
|
-
import { DateStartIcon } from "~components/Icon"
|
|
17
16
|
import { Label } from "~components/Label"
|
|
18
17
|
import { VisuallyHidden } from "~components/VisuallyHidden"
|
|
18
|
+
import { Icon } from "~components/__future__/Icon"
|
|
19
19
|
import styles from "./DateRangePicker.module.scss"
|
|
20
20
|
|
|
21
21
|
export type DateRangePickerProps = {
|
|
@@ -168,7 +168,7 @@ export const DateRangePicker = ({
|
|
|
168
168
|
{...inputProps}
|
|
169
169
|
>
|
|
170
170
|
<div className={styles.startIconAdornment}>
|
|
171
|
-
<
|
|
171
|
+
<Icon name="today" isPresentational isFilled />
|
|
172
172
|
</div>
|
|
173
173
|
<span className={styles.value}>
|
|
174
174
|
{selectedDateRange?.from ? value : undefined}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Meta } from "@storybook/react"
|
|
3
3
|
import isChromatic from "chromatic"
|
|
4
|
-
import { ChevronRightIcon } from "~components/Icon"
|
|
5
4
|
import { Button } from "~components/__actions__/v2"
|
|
5
|
+
import { Icon } from "~components/__future__/Icon"
|
|
6
6
|
import {
|
|
7
7
|
StickerSheet,
|
|
8
8
|
StickerSheetStory,
|
|
@@ -85,7 +85,13 @@ const StickerSheetTemplate: StickerSheetStory = {
|
|
|
85
85
|
>
|
|
86
86
|
<Button
|
|
87
87
|
label="Label"
|
|
88
|
-
icon={
|
|
88
|
+
icon={
|
|
89
|
+
<Icon
|
|
90
|
+
name="chevron_right"
|
|
91
|
+
isPresentational
|
|
92
|
+
shouldMirrorInRTL
|
|
93
|
+
/>
|
|
94
|
+
}
|
|
89
95
|
iconPosition="end"
|
|
90
96
|
/>
|
|
91
97
|
</EmptyStateWrapper>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
-
import { ChevronRightIcon } from "~components/Icon"
|
|
4
3
|
import { Button } from "~components/__actions__/v2"
|
|
4
|
+
import { Icon } from "~components/__future__/Icon"
|
|
5
5
|
import { EmptyState } from "../index"
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
@@ -17,7 +17,9 @@ const meta = {
|
|
|
17
17
|
"Button (chevron right)": (
|
|
18
18
|
<Button
|
|
19
19
|
label="Label"
|
|
20
|
-
icon={
|
|
20
|
+
icon={
|
|
21
|
+
<Icon name="chevron_right" isPresentational shouldMirrorInRTL />
|
|
22
|
+
}
|
|
21
23
|
iconPosition="end"
|
|
22
24
|
/>
|
|
23
25
|
),
|
|
@@ -2,9 +2,9 @@ import React, { HTMLAttributes } from "react"
|
|
|
2
2
|
import { FormattedMessage, useIntl } from "@cultureamp/i18n-react-intl"
|
|
3
3
|
import classNames from "classnames"
|
|
4
4
|
import { BrandMoment } from "~components/BrandMoment"
|
|
5
|
-
import { ArrowRightIcon, EmailIcon } from "~components/Icon"
|
|
6
5
|
import { BrandMomentError } from "~components/Illustration"
|
|
7
6
|
import { Text } from "~components/Text"
|
|
7
|
+
import { Icon } from "~components/__future__/Icon"
|
|
8
8
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
9
9
|
import { ErrorStatuses, useErrorMessages } from "./hooks"
|
|
10
10
|
import styles from "./ErrorPage.module.scss"
|
|
@@ -67,7 +67,9 @@ export const ErrorPage = ({
|
|
|
67
67
|
variant="warning"
|
|
68
68
|
primaryAction={{
|
|
69
69
|
...actions.primary,
|
|
70
|
-
icon:
|
|
70
|
+
icon: (
|
|
71
|
+
<Icon name="arrow_forward" isPresentational shouldMirrorInRTL />
|
|
72
|
+
),
|
|
71
73
|
iconPosition: "end",
|
|
72
74
|
label: formatMessage({
|
|
73
75
|
id: "kzErrorPage.goToHome",
|
|
@@ -77,7 +79,7 @@ export const ErrorPage = ({
|
|
|
77
79
|
}}
|
|
78
80
|
secondaryAction={{
|
|
79
81
|
...actions.secondary,
|
|
80
|
-
icon: <
|
|
82
|
+
icon: <Icon name="mail" isPresentational isFilled />,
|
|
81
83
|
label: formatMessage({
|
|
82
84
|
id: "kzErrorPage",
|
|
83
85
|
defaultMessage: "Contact support",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react"
|
|
2
2
|
import classnames from "classnames"
|
|
3
|
-
import { CautionWhiteIcon, ExclamationWhiteIcon } from "~components/Icon"
|
|
4
3
|
import { Text } from "~components/Text"
|
|
4
|
+
import { Icon } from "~components/__future__/Icon"
|
|
5
5
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
6
6
|
import styles from "./FieldMessage.module.scss"
|
|
7
7
|
|
|
@@ -45,19 +45,11 @@ export const FieldMessage = ({
|
|
|
45
45
|
>
|
|
46
46
|
{(status === "error" || status === "caution") && (
|
|
47
47
|
<span className={styles.warningIcon}>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/>
|
|
54
|
-
) : (
|
|
55
|
-
<CautionWhiteIcon
|
|
56
|
-
role="img"
|
|
57
|
-
inheritSize={false}
|
|
58
|
-
aria-label={`${status} message`}
|
|
59
|
-
/>
|
|
60
|
-
)}
|
|
48
|
+
<Icon
|
|
49
|
+
name={status === "error" ? "error" : "warning"}
|
|
50
|
+
isFilled
|
|
51
|
+
alt={`${status} message`}
|
|
52
|
+
/>
|
|
61
53
|
</span>
|
|
62
54
|
)}
|
|
63
55
|
<div className={styles.message}>
|
|
@@ -65,6 +65,7 @@ const simpleFilters = [
|
|
|
65
65
|
type ValuesRemovable = {
|
|
66
66
|
flavour: string
|
|
67
67
|
topping: string
|
|
68
|
+
others: string
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
const filtersRemovable = [
|
|
@@ -86,6 +87,37 @@ const filtersRemovable = [
|
|
|
86
87
|
),
|
|
87
88
|
isRemovable: true,
|
|
88
89
|
},
|
|
90
|
+
{
|
|
91
|
+
id: "others",
|
|
92
|
+
name: "Others",
|
|
93
|
+
Component: (
|
|
94
|
+
<FilterBar.MultiSelect
|
|
95
|
+
items={[
|
|
96
|
+
{ value: "gluten-free", label: "Gluten Free" },
|
|
97
|
+
{ value: "no-sugar", label: "No Sugar" },
|
|
98
|
+
{ value: "dairy-free", label: "Dairy Free" },
|
|
99
|
+
]}
|
|
100
|
+
>
|
|
101
|
+
{(): JSX.Element => (
|
|
102
|
+
<>
|
|
103
|
+
<FilterMultiSelect.SearchInput />
|
|
104
|
+
<FilterMultiSelect.ListBox>
|
|
105
|
+
{({ allItems }): JSX.Element | JSX.Element[] =>
|
|
106
|
+
allItems.map(item => (
|
|
107
|
+
<FilterMultiSelect.Option key={item.key} item={item} />
|
|
108
|
+
))
|
|
109
|
+
}
|
|
110
|
+
</FilterMultiSelect.ListBox>
|
|
111
|
+
<FilterMultiSelect.MenuFooter>
|
|
112
|
+
<FilterMultiSelect.SelectAllButton />
|
|
113
|
+
<FilterMultiSelect.ClearButton />
|
|
114
|
+
</FilterMultiSelect.MenuFooter>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
</FilterBar.MultiSelect>
|
|
118
|
+
),
|
|
119
|
+
isRemovable: true,
|
|
120
|
+
},
|
|
89
121
|
] satisfies Filters<ValuesRemovable>
|
|
90
122
|
|
|
91
123
|
type ValuesDependent = {
|
|
@@ -288,6 +320,61 @@ describe("<FilterBar />", () => {
|
|
|
288
320
|
expect(filters[1]).toHaveTextContent("Flavour")
|
|
289
321
|
expect(filters[2]).toHaveTextContent("Sugar Level")
|
|
290
322
|
})
|
|
323
|
+
|
|
324
|
+
it("moves focus to recently added filter button", async () => {
|
|
325
|
+
const { getByRole } = render(
|
|
326
|
+
<FilterBarWrapper<ValuesSimple>
|
|
327
|
+
filters={simpleFilters.map(filter => ({
|
|
328
|
+
...filter,
|
|
329
|
+
isRemovable: true,
|
|
330
|
+
}))}
|
|
331
|
+
/>
|
|
332
|
+
)
|
|
333
|
+
await waitForI18nContent()
|
|
334
|
+
|
|
335
|
+
const addFiltersButton = getByRole("button", { name: "Add Filters" })
|
|
336
|
+
await user.click(addFiltersButton)
|
|
337
|
+
|
|
338
|
+
const menuOptionIceLevel = getByRole("button", { name: "Ice Level" })
|
|
339
|
+
await user.click(menuOptionIceLevel)
|
|
340
|
+
|
|
341
|
+
expect(getByRole("button", { name: "Ice Level" })).toHaveFocus()
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
it("moves focus to recently added filter button in the FilterMultiSelect case", async () => {
|
|
345
|
+
const { getByRole } = render(
|
|
346
|
+
<FilterBarWrapper<ValuesRemovable> filters={filtersRemovable} />
|
|
347
|
+
)
|
|
348
|
+
await waitForI18nContent()
|
|
349
|
+
|
|
350
|
+
const addFiltersButton = getByRole("button", { name: "Add Filters" })
|
|
351
|
+
await user.click(addFiltersButton)
|
|
352
|
+
|
|
353
|
+
const menuOptionOthers = getByRole("button", { name: "Others" })
|
|
354
|
+
await user.click(menuOptionOthers)
|
|
355
|
+
|
|
356
|
+
expect(getByRole("button", { name: "Others" })).toHaveFocus()
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
it("restores focus to the add filter button after remove", async () => {
|
|
360
|
+
const { getByRole } = render(
|
|
361
|
+
<FilterBarWrapper<ValuesRemovable>
|
|
362
|
+
filters={filtersRemovable}
|
|
363
|
+
defaultValues={{ topping: "pearls" }}
|
|
364
|
+
/>
|
|
365
|
+
)
|
|
366
|
+
await waitForI18nContent()
|
|
367
|
+
|
|
368
|
+
const filterButton = getByRole("button", { name: "Topping : Pearls" })
|
|
369
|
+
expect(filterButton).toBeVisible()
|
|
370
|
+
|
|
371
|
+
await user.click(getByRole("button", { name: "Remove filter - Topping" }))
|
|
372
|
+
await waitFor(() => {
|
|
373
|
+
expect(filterButton).not.toBeInTheDocument()
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
expect(getByRole("button", { name: "Add Filters" })).toHaveFocus()
|
|
377
|
+
})
|
|
291
378
|
})
|
|
292
379
|
|
|
293
380
|
describe("Dependent filters", () => {
|
|
@@ -313,7 +400,7 @@ describe("<FilterBar />", () => {
|
|
|
313
400
|
/>
|
|
314
401
|
)
|
|
315
402
|
await waitForI18nContent()
|
|
316
|
-
expect(getByTestId("testid__values").textContent).
|
|
403
|
+
expect(getByTestId("testid__values").textContent).toBe(
|
|
317
404
|
JSON.stringify({})
|
|
318
405
|
)
|
|
319
406
|
})
|
|
@@ -580,7 +667,7 @@ describe("<FilterBar />", () => {
|
|
|
580
667
|
await user.click(getByRole("option", { name: "Long Black" }))
|
|
581
668
|
|
|
582
669
|
await waitFor(() => {
|
|
583
|
-
expect(coffeeButton
|
|
670
|
+
expect(coffeeButton).toHaveAccessibleName("Coffee : Long Black")
|
|
584
671
|
})
|
|
585
672
|
const iceButton = getByRole("button", { name: "Ice" })
|
|
586
673
|
expect(iceButton).toBeVisible()
|
|
@@ -590,7 +677,7 @@ describe("<FilterBar />", () => {
|
|
|
590
677
|
await user.click(getByRole("option", { name: "Latte" }))
|
|
591
678
|
|
|
592
679
|
await waitFor(() => {
|
|
593
|
-
expect(coffeeButton
|
|
680
|
+
expect(coffeeButton).toHaveAccessibleName("Coffee : Latte")
|
|
594
681
|
})
|
|
595
682
|
const milkButton = getByRole("button", { name: "Milk" })
|
|
596
683
|
expect(milkButton).toBeVisible()
|
|
@@ -600,7 +687,7 @@ describe("<FilterBar />", () => {
|
|
|
600
687
|
await user.click(getByRole("option", { name: "Oat" }))
|
|
601
688
|
|
|
602
689
|
await waitFor(() => {
|
|
603
|
-
expect(milkButton
|
|
690
|
+
expect(milkButton).toHaveAccessibleName("Milk : Oat")
|
|
604
691
|
})
|
|
605
692
|
expect(addFiltersButton).not.toBeDisabled()
|
|
606
693
|
|
|
@@ -657,16 +744,16 @@ describe("<FilterBar />", () => {
|
|
|
657
744
|
})
|
|
658
745
|
const iceLevelButton = getByRole("button", { name: "Ice Level : 100%" })
|
|
659
746
|
|
|
660
|
-
expect(flavourButton
|
|
661
|
-
expect(sugarLevelButton
|
|
662
|
-
expect(iceLevelButton
|
|
747
|
+
expect(flavourButton).toHaveAccessibleName("Flavour : Jasmine Milk Tea")
|
|
748
|
+
expect(sugarLevelButton).toHaveAccessibleName("Sugar Level : 50%")
|
|
749
|
+
expect(iceLevelButton).toHaveAccessibleName("Ice Level : 100%")
|
|
663
750
|
|
|
664
751
|
await user.click(getByRole("button", { name: "Clear all filters" }))
|
|
665
752
|
|
|
666
753
|
await waitFor(() => {
|
|
667
|
-
expect(flavourButton
|
|
668
|
-
expect(sugarLevelButton
|
|
669
|
-
expect(iceLevelButton
|
|
754
|
+
expect(flavourButton).toHaveAccessibleName("Flavour")
|
|
755
|
+
expect(sugarLevelButton).toHaveAccessibleName("Sugar Level")
|
|
756
|
+
expect(iceLevelButton).toHaveAccessibleName("Ice Level")
|
|
670
757
|
})
|
|
671
758
|
})
|
|
672
759
|
|
|
@@ -744,14 +831,14 @@ describe("<FilterBar />", () => {
|
|
|
744
831
|
await waitForI18nContent()
|
|
745
832
|
|
|
746
833
|
const flavourButton = getByRole("button", { name: "Flavour" })
|
|
747
|
-
expect(flavourButton
|
|
834
|
+
expect(flavourButton).toHaveAccessibleName("Flavour")
|
|
748
835
|
|
|
749
836
|
await user.click(
|
|
750
837
|
getByRole("button", { name: "Update Flavour to honey-milk-tea" })
|
|
751
838
|
)
|
|
752
839
|
|
|
753
840
|
await waitFor(() => {
|
|
754
|
-
expect(flavourButton
|
|
841
|
+
expect(flavourButton).toHaveAccessibleName("Flavour : Honey Milk Tea")
|
|
755
842
|
})
|
|
756
843
|
})
|
|
757
844
|
|
|
@@ -43,6 +43,8 @@ export type FilterBarContextValue<
|
|
|
43
43
|
hideFilter: <Id extends keyof ValuesMap>(id: Id) => void
|
|
44
44
|
getInactiveFilters: () => Array<FilterAttributes<ValuesMap>>
|
|
45
45
|
clearAllFilters: () => void
|
|
46
|
+
setFocus: <Id extends keyof ValuesMap>(id: Id | undefined) => void
|
|
47
|
+
focusId?: keyof ValuesMap
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
const FilterBarContext = React.createContext<FilterBarContextValue<any> | null>(
|
|
@@ -119,10 +121,13 @@ export const FilterBarProvider = <ValuesMap extends FiltersValues>({
|
|
|
119
121
|
values: { ...values, [id]: getValidValue(newValue) },
|
|
120
122
|
})
|
|
121
123
|
},
|
|
122
|
-
showFilter: <Id extends keyof ValuesMap>(id: Id): void =>
|
|
123
|
-
dispatch({ type: "activate_filter", id })
|
|
124
|
+
showFilter: <Id extends keyof ValuesMap>(id: Id): void => {
|
|
125
|
+
dispatch({ type: "activate_filter", id })
|
|
126
|
+
dispatch({ type: "set_focus", id })
|
|
127
|
+
},
|
|
124
128
|
hideFilter: <Id extends keyof ValuesMap>(id: Id): void => {
|
|
125
129
|
dispatch({ type: "deactivate_filter", id })
|
|
130
|
+
dispatch({ type: "set_focus", id: "add_filter" })
|
|
126
131
|
},
|
|
127
132
|
getInactiveFilters: () => getInactiveFilters<ValuesMap>(state),
|
|
128
133
|
clearAllFilters: () => {
|
|
@@ -132,6 +137,10 @@ export const FilterBarProvider = <ValuesMap extends FiltersValues>({
|
|
|
132
137
|
})
|
|
133
138
|
dispatch({ type: "update_values", values: {} })
|
|
134
139
|
},
|
|
140
|
+
setFocus: <Id extends keyof ValuesMap>(id: Id | undefined) => {
|
|
141
|
+
dispatch({ type: "set_focus", id })
|
|
142
|
+
},
|
|
143
|
+
focusId: state.focusId,
|
|
135
144
|
} satisfies FilterBarContextValue<any, ValuesMap>
|
|
136
145
|
|
|
137
146
|
useEffect(() => {
|
|
@@ -15,12 +15,19 @@ type Actions<ValuesMap extends FiltersValues> =
|
|
|
15
15
|
| { type: "activate_filter"; id: keyof ValuesMap }
|
|
16
16
|
| { type: "deactivate_filter"; id: keyof ValuesMap }
|
|
17
17
|
| { type: "update_filter_labels"; data: Filters<ValuesMap> }
|
|
18
|
+
| { type: "set_focus"; id: keyof ValuesMap | undefined }
|
|
18
19
|
|
|
19
20
|
export const filterBarStateReducer = <ValuesMap extends FiltersValues>(
|
|
20
21
|
state: FilterBarState<ValuesMap>,
|
|
21
22
|
action: Actions<ValuesMap>
|
|
22
23
|
): FilterBarState<ValuesMap> => {
|
|
23
24
|
switch (action.type) {
|
|
25
|
+
case "set_focus":
|
|
26
|
+
return {
|
|
27
|
+
...state,
|
|
28
|
+
focusId: action.id,
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
case "update_values":
|
|
25
32
|
return { ...updateValues(state, action.values) }
|
|
26
33
|
|
|
@@ -32,6 +32,7 @@ export type FilterBarState<ValuesMap extends FiltersValues> = {
|
|
|
32
32
|
activeFilterIds: Set<keyof ValuesMap>
|
|
33
33
|
values: Partial<ValuesMap>
|
|
34
34
|
dependentFilterIds: Set<keyof ValuesMap>
|
|
35
|
+
focusId?: keyof ValuesMap
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export type ActiveFiltersArray<ValuesMap extends FiltersValues> = Array<
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React, { useEffect, useRef } from "react"
|
|
2
2
|
import { useIntl } from "@cultureamp/i18n-react-intl"
|
|
3
|
-
import { AddIcon } from "~components/Icon"
|
|
4
3
|
import { Menu, MenuList, MenuItem, Button } from "~components/__actions__/v2"
|
|
4
|
+
import { Icon } from "~components/__future__/Icon"
|
|
5
5
|
import { useFilterBarContext } from "../../context/FilterBarContext"
|
|
6
6
|
|
|
7
7
|
export const AddFiltersMenu = (): JSX.Element => {
|
|
8
8
|
const { formatMessage } = useIntl()
|
|
9
|
+
const buttonRef = useRef<HTMLButtonElement>(null)
|
|
9
10
|
|
|
10
11
|
const menuButtonLabel = formatMessage({
|
|
11
12
|
id: "filterBar.addFiltersMenu.buttonLabel",
|
|
@@ -14,17 +15,26 @@ export const AddFiltersMenu = (): JSX.Element => {
|
|
|
14
15
|
"Menu button label to show additional available filter options",
|
|
15
16
|
})
|
|
16
17
|
|
|
17
|
-
const { getInactiveFilters, showFilter } =
|
|
18
|
+
const { getInactiveFilters, showFilter, focusId, setFocus } =
|
|
19
|
+
useFilterBarContext()
|
|
18
20
|
const inactiveFilters = getInactiveFilters()
|
|
19
21
|
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (focusId === "add_filter") {
|
|
24
|
+
buttonRef.current?.focus()
|
|
25
|
+
setFocus(undefined)
|
|
26
|
+
}
|
|
27
|
+
}, [focusId])
|
|
28
|
+
|
|
20
29
|
return (
|
|
21
30
|
<Menu
|
|
22
31
|
button={
|
|
23
32
|
<Button
|
|
33
|
+
ref={buttonRef}
|
|
24
34
|
label={menuButtonLabel}
|
|
25
35
|
secondary
|
|
26
36
|
disabled={inactiveFilters.length === 0}
|
|
27
|
-
icon={<
|
|
37
|
+
icon={<Icon name="add" isPresentational />}
|
|
28
38
|
/>
|
|
29
39
|
}
|
|
30
40
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef } from "react"
|
|
1
|
+
import React, { forwardRef, useEffect } from "react"
|
|
2
2
|
import { FilterTriggerRef } from "~components/Filter/Filter"
|
|
3
3
|
import { useFilterBarContext } from "~components/Filter/FilterBar/context/FilterBarContext"
|
|
4
4
|
import {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
FilterButtonProps,
|
|
7
7
|
FilterButtonRemovable,
|
|
8
8
|
} from "~components/Filter/FilterButton"
|
|
9
|
+
import { isRefObject } from "~components/utils/isRefObject"
|
|
9
10
|
|
|
10
11
|
export type FilterBarButtonProps = FilterButtonProps & {
|
|
11
12
|
filterId: string
|
|
@@ -16,7 +17,14 @@ export const FilterBarButton = forwardRef<
|
|
|
16
17
|
FilterTriggerRef,
|
|
17
18
|
FilterBarButtonProps
|
|
18
19
|
>(({ filterId, isRemovable = false, ...props }, ref): JSX.Element => {
|
|
19
|
-
const { hideFilter } = useFilterBarContext()
|
|
20
|
+
const { hideFilter, focusId, setFocus } = useFilterBarContext()
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (focusId === filterId && isRefObject(ref)) {
|
|
24
|
+
ref?.current?.triggerRef?.current?.focus()
|
|
25
|
+
setFocus(undefined)
|
|
26
|
+
}
|
|
27
|
+
}, [focusId])
|
|
20
28
|
|
|
21
29
|
return isRemovable ? (
|
|
22
30
|
<FilterButtonRemovable
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react"
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react"
|
|
2
2
|
import { Selection, Key } from "@react-types/shared"
|
|
3
3
|
import {
|
|
4
4
|
FilterMultiSelect,
|
|
@@ -43,9 +43,16 @@ export const FilterBarMultiSelect = ({
|
|
|
43
43
|
onSelectionChange,
|
|
44
44
|
...props
|
|
45
45
|
}: FilterBarMultiSelectProps): JSX.Element | null => {
|
|
46
|
-
const {
|
|
47
|
-
|
|
46
|
+
const {
|
|
47
|
+
getFilterState,
|
|
48
|
+
setFilterOpenState,
|
|
49
|
+
updateValue,
|
|
50
|
+
hideFilter,
|
|
51
|
+
focusId,
|
|
52
|
+
setFocus,
|
|
53
|
+
} = useFilterBarContext<ConsumableSelection>()
|
|
48
54
|
const [items, setItems] = useState<ItemType[]>(propsItems)
|
|
55
|
+
const buttonRef = useRef<HTMLButtonElement>(null)
|
|
49
56
|
|
|
50
57
|
if (!id) throw Error("Missing `id` prop in FilterBarMultiSelect")
|
|
51
58
|
|
|
@@ -70,6 +77,13 @@ export const FilterBarMultiSelect = ({
|
|
|
70
77
|
}
|
|
71
78
|
}, [items])
|
|
72
79
|
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (focusId === id) {
|
|
82
|
+
buttonRef.current?.focus()
|
|
83
|
+
setFocus(undefined)
|
|
84
|
+
}
|
|
85
|
+
}, [focusId])
|
|
86
|
+
|
|
73
87
|
return (
|
|
74
88
|
<FilterMultiSelect
|
|
75
89
|
label={filterState.name}
|
|
@@ -103,6 +117,7 @@ export const FilterBarMultiSelect = ({
|
|
|
103
117
|
<FilterMultiSelect.TriggerButton {...triggerProps} />
|
|
104
118
|
)
|
|
105
119
|
}}
|
|
120
|
+
triggerRef={buttonRef}
|
|
106
121
|
{...props}
|
|
107
122
|
>
|
|
108
123
|
{children}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from "react"
|
|
2
2
|
import classnames from "classnames"
|
|
3
|
-
import {
|
|
3
|
+
import { Icon } from "~components/__future__/Icon"
|
|
4
4
|
import { isRefObject } from "~components/utils/isRefObject"
|
|
5
5
|
import { FilterTriggerRef } from "../../Filter/types"
|
|
6
6
|
import {
|
|
@@ -45,11 +45,10 @@ export const FilterButton = forwardRef<FilterTriggerRef, FilterButtonProps>(
|
|
|
45
45
|
label
|
|
46
46
|
)}
|
|
47
47
|
</span>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)}
|
|
48
|
+
<Icon
|
|
49
|
+
name={isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}
|
|
50
|
+
isPresentational
|
|
51
|
+
/>
|
|
53
52
|
</FilterButtonBase>
|
|
54
53
|
)
|
|
55
54
|
}
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from "react"
|
|
|
2
2
|
import { useIntl } from "@cultureamp/i18n-react-intl"
|
|
3
3
|
import { ButtonGroup, ButtonGroupProps } from "~components/ButtonGroup"
|
|
4
4
|
import { FilterTriggerRef } from "~components/Filter/Filter"
|
|
5
|
-
import {
|
|
5
|
+
import { Icon } from "~components/__future__/Icon"
|
|
6
6
|
import { Tooltip } from "~components/__overlays__/Tooltip/v1"
|
|
7
7
|
import { DataAttributes } from "~components/types/DataAttributes"
|
|
8
8
|
import { isRefObject } from "~components/utils/isRefObject"
|
|
@@ -50,7 +50,7 @@ export const FilterButtonRemovable = forwardRef<
|
|
|
50
50
|
<FilterButton ref={ref} {...triggerButtonProps} />
|
|
51
51
|
<Tooltip text={removeButtonLabel} display="inline-block" position="below">
|
|
52
52
|
<FilterButtonBase ref={removeButtonRef} {...removeButtonProps}>
|
|
53
|
-
<
|
|
53
|
+
<Icon name="cancel" alt={removeButtonLabel} isFilled />
|
|
54
54
|
</FilterButtonBase>
|
|
55
55
|
</Tooltip>
|
|
56
56
|
</ButtonGroup>
|
|
@@ -67,7 +67,8 @@ describe("<DateRangeInputField />", () => {
|
|
|
67
67
|
const inputStart = screen.getByRole("textbox", { name: "Date from" })
|
|
68
68
|
await waitFor(() => {
|
|
69
69
|
expect(inputStart).toHaveAccessibleDescription(
|
|
70
|
-
|
|
70
|
+
// React Testing Library bug: Icon should be showing aria-label "error message" instead
|
|
71
|
+
"error Date Start has an error Input format : dd/mm/yyyy"
|
|
71
72
|
)
|
|
72
73
|
expect(screen.getByText("Date Start has an error")).toBeVisible()
|
|
73
74
|
})
|
|
@@ -41,6 +41,7 @@ type SelectionProps = {
|
|
|
41
41
|
export type FilterMultiSelectProps = {
|
|
42
42
|
trigger: (value?: MenuTriggerProviderContextType) => React.ReactNode
|
|
43
43
|
children: (value?: SelectionProviderContextType) => React.ReactNode // the content of the menu
|
|
44
|
+
triggerRef?: React.RefObject<HTMLButtonElement>
|
|
44
45
|
} & Omit<MenuPopupProps, "children"> &
|
|
45
46
|
Omit<MenuTriggerProviderProps, "children"> &
|
|
46
47
|
SelectionProps
|
|
@@ -60,8 +61,9 @@ export const FilterMultiSelect = ({
|
|
|
60
61
|
onSelectionChange,
|
|
61
62
|
selectionMode = "multiple",
|
|
62
63
|
onSearchInputChange,
|
|
64
|
+
triggerRef,
|
|
63
65
|
}: FilterMultiSelectProps): JSX.Element => {
|
|
64
|
-
const menuTriggerProps = { isOpen, defaultOpen, onOpenChange }
|
|
66
|
+
const menuTriggerProps = { isOpen, defaultOpen, onOpenChange, triggerRef }
|
|
65
67
|
const menuPopupProps = { isLoading, loadingSkeleton }
|
|
66
68
|
const disabledKeys: Selection = new Set(
|
|
67
69
|
items
|