@kaizen/components 0.0.0-canary-fix-select-futureselect-focus-jumping-20241003232256 → 0.0.0-canary-tsx-codemod-20241029235345
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/Filter/FilterSelect/FilterSelect.cjs +2 -1
- 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__/Tabs/Tabs.cjs +23 -0
- package/dist/cjs/__future__/Tabs/subcomponents/Tab/Tab.cjs +39 -0
- package/dist/cjs/__future__/Tabs/subcomponents/Tab/Tab.module.css.cjs +7 -0
- package/dist/cjs/__future__/Tabs/subcomponents/TabList/TabList.cjs +31 -0
- package/dist/cjs/__future__/Tabs/subcomponents/TabList/TabList.module.css.cjs +7 -0
- package/dist/cjs/__future__/Tabs/subcomponents/TabPanel/TabPanel.cjs +24 -0
- package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveButton.cjs +4 -3
- package/dist/cjs/future.cjs +10 -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/Filter/FilterSelect/FilterSelect.mjs +2 -1
- 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 -11
- 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__/Tabs/Tabs.mjs +15 -0
- package/dist/esm/__future__/Tabs/subcomponents/Tab/Tab.mjs +30 -0
- package/dist/esm/__future__/Tabs/subcomponents/Tab/Tab.module.css.mjs +5 -0
- package/dist/esm/__future__/Tabs/subcomponents/TabList/TabList.mjs +22 -0
- package/dist/esm/__future__/Tabs/subcomponents/TabList/TabList.module.css.mjs +5 -0
- package/dist/esm/__future__/Tabs/subcomponents/TabPanel/TabPanel.mjs +16 -0
- package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveButton.mjs +4 -3
- package/dist/esm/future.mjs +5 -0
- package/dist/styles.css +828 -1388
- 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/Tabs/subcomponents/index.d.ts +0 -1
- 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__/Tabs/Tabs.d.ts +11 -0
- package/dist/types/__future__/Tabs/index.d.ts +2 -0
- package/dist/types/__future__/Tabs/subcomponents/Tab/Tab.d.ts +12 -0
- package/dist/types/__future__/Tabs/subcomponents/Tab/index.d.ts +1 -0
- package/dist/types/__future__/Tabs/subcomponents/TabList/TabList.d.ts +17 -0
- package/dist/types/__future__/Tabs/subcomponents/TabList/index.d.ts +1 -0
- package/dist/types/__future__/Tabs/subcomponents/TabPanel/TabPanel.d.ts +6 -0
- package/dist/types/__future__/Tabs/subcomponents/TabPanel/index.d.ts +1 -0
- package/dist/types/__future__/Tabs/subcomponents/index.d.ts +3 -0
- package/dist/types/__future__/index.d.ts +2 -0
- package/package.json +36 -37
- 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 -11
- package/src/Filter/FilterSelect/FilterSelect.spec.tsx +52 -21
- package/src/Filter/FilterSelect/FilterSelect.tsx +2 -1
- package/src/Filter/FilterSelect/_docs/FilterSelect.stories.tsx +0 -1
- 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/ToggleIconButton.module.scss +1 -1
- 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 -9
- 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/Tabs/subcomponents/index.ts +0 -1
- 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/Button.module.scss +0 -1
- 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/_docs/Select.stories.tsx +1 -2
- package/src/__future__/Select/subcomponents/ListBox/ListBox.tsx +3 -4
- 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__/Tabs/Tabs.tsx +18 -0
- package/src/__future__/Tabs/_docs/Tabs--api-specification.mdx +43 -0
- package/src/__future__/Tabs/_docs/Tabs--migration-guide.mdx +93 -0
- package/src/__future__/Tabs/_docs/Tabs.stories.tsx +74 -0
- package/src/__future__/Tabs/index.ts +2 -0
- package/src/__future__/Tabs/subcomponents/Tab/Tab.module.css +94 -0
- package/src/__future__/Tabs/subcomponents/Tab/Tab.tsx +58 -0
- package/src/__future__/Tabs/subcomponents/Tab/index.ts +1 -0
- package/src/__future__/Tabs/subcomponents/TabList/TabList.module.css +8 -0
- package/src/__future__/Tabs/subcomponents/TabList/TabList.tsx +45 -0
- package/src/__future__/Tabs/subcomponents/TabList/index.ts +1 -0
- package/src/__future__/Tabs/subcomponents/TabPanel/TabPanel.module.css +12 -0
- package/src/__future__/Tabs/subcomponents/TabPanel/TabPanel.tsx +20 -0
- package/src/__future__/Tabs/subcomponents/TabPanel/index.ts +1 -0
- package/src/__future__/Tabs/subcomponents/index.ts +3 -0
- 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 +2 -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
- /package/dist/cjs/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.cjs +0 -0
- /package/dist/esm/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.mjs +0 -0
- /package/dist/types/__utilities__/{isClientReady → useIsClientReady}/index.d.ts +0 -0
- /package/dist/types/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.d.ts +0 -0
- /package/src/__utilities__/{isClientReady → useIsClientReady}/index.ts +0 -0
- /package/src/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.tsx +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import iconsMetadata from "./material-symbols-metadata.json"
|
|
2
|
+
|
|
3
|
+
// Icon names are from https://github.com/marella/material-symbols/blob/main/metadata/versions.json
|
|
4
|
+
// Update `material-symbols-metadata.json` for new icons.
|
|
5
|
+
// Last updated: 28 Aug 2024
|
|
6
|
+
type MaterialIconNames = keyof typeof iconsMetadata
|
|
7
|
+
|
|
8
|
+
// `auto_awesome` is not listed as part of Material Symbols, however is
|
|
9
|
+
// available in Material Icons, which appears to still work.
|
|
10
|
+
// https://fonts.google.com/icons?icon.query=auto+awesome&icon.set=Material+Icons&icon.size=20&icon.color=%23000000&selected=Material+Icons+Outlined:auto_awesome:
|
|
11
|
+
export type IconNames = MaterialIconNames | "auto_awesome"
|
|
@@ -188,14 +188,13 @@ export const PortalContainer: Story = {
|
|
|
188
188
|
Open Modal
|
|
189
189
|
</button>
|
|
190
190
|
<ContextModal
|
|
191
|
-
{...args}
|
|
192
191
|
isOpen={isOpen}
|
|
193
192
|
onConfirm={handleClose}
|
|
194
193
|
onDismiss={handleClose}
|
|
195
194
|
title="Select test"
|
|
196
195
|
>
|
|
197
196
|
<div
|
|
198
|
-
className="flex gap-24 bg-gray-200 p-12
|
|
197
|
+
className="flex gap-24 bg-gray-200 p-12"
|
|
199
198
|
id={portalContainerId}
|
|
200
199
|
>
|
|
201
200
|
<Select
|
|
@@ -2,7 +2,7 @@ import React, { HTMLAttributes, Key, useEffect, useRef, ReactNode } from "react"
|
|
|
2
2
|
import { AriaListBoxOptions, useListBox } from "@react-aria/listbox"
|
|
3
3
|
import { SelectState } from "@react-stately/select"
|
|
4
4
|
import classnames from "classnames"
|
|
5
|
-
import { useIsClientReady } from "~components/__utilities__/
|
|
5
|
+
import { useIsClientReady } from "~components/__utilities__/useIsClientReady"
|
|
6
6
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
7
7
|
import { useSelectContext } from "../../context"
|
|
8
8
|
import { SelectOption, SelectItem } from "../../types"
|
|
@@ -38,7 +38,7 @@ const safeQuerySelector = (selector: string): HTMLElement | null => {
|
|
|
38
38
|
return document.querySelector(selector)
|
|
39
39
|
} catch (error) {
|
|
40
40
|
// eslint-disable-next-line no-console
|
|
41
|
-
console.error("
|
|
41
|
+
console.error("Kaizen querySelector failed:", error)
|
|
42
42
|
return null
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -56,7 +56,7 @@ export const ListBox = <Option extends SelectOption>({
|
|
|
56
56
|
{
|
|
57
57
|
...menuProps,
|
|
58
58
|
disallowEmptySelection: true,
|
|
59
|
-
// This is to ensure that the listbox use React Aria's auto focus feature for Listbox, which creates a visual bug
|
|
59
|
+
// This is to ensure that the listbox doesn't use React Aria's auto focus feature for Listbox, which creates a visual bug
|
|
60
60
|
autoFocus: false,
|
|
61
61
|
},
|
|
62
62
|
state,
|
|
@@ -81,7 +81,6 @@ export const ListBox = <Option extends SelectOption>({
|
|
|
81
81
|
}, [isClientReady])
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
85
84
|
<ul
|
|
86
85
|
ref={ref}
|
|
87
86
|
className={classnames(styles.listBox, classNameOverride)}
|
|
@@ -2,7 +2,7 @@ import React, { HTMLAttributes } from "react"
|
|
|
2
2
|
import { FocusableElement } from "@react-types/shared"
|
|
3
3
|
import classnames from "classnames"
|
|
4
4
|
import { mergeProps, useFocusRing, useOption } from "react-aria"
|
|
5
|
-
import {
|
|
5
|
+
import { Icon } from "~components/__future__/Icon"
|
|
6
6
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
7
7
|
import { useSelectContext } from "../../context"
|
|
8
8
|
import { SelectOption, SelectOptionNode } from "../../types"
|
|
@@ -56,7 +56,7 @@ export const Option = <Option extends SelectOption = SelectOption>({
|
|
|
56
56
|
<span
|
|
57
57
|
className={classnames(styles.icon, isSelected && styles.isSelected)}
|
|
58
58
|
>
|
|
59
|
-
{isSelected && <
|
|
59
|
+
{isSelected && <Icon name="check" isPresentational />}
|
|
60
60
|
</span>
|
|
61
61
|
</li>
|
|
62
62
|
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react"
|
|
2
2
|
import { DOMAttributes, FocusableElement } from "@react-types/shared"
|
|
3
3
|
import classnames from "classnames"
|
|
4
|
-
import { ChevronDownIcon, ChevronUpIcon } from "~components/Icon"
|
|
5
4
|
import { Label } from "~components/Label"
|
|
5
|
+
import { Icon } from "~components/__future__/Icon"
|
|
6
6
|
import { OverrideClassName } from "~components/types/OverrideClassName"
|
|
7
7
|
import styles from "./SelectToggle.module.scss"
|
|
8
8
|
|
|
@@ -69,14 +69,11 @@ export const SelectToggle = React.forwardRef<
|
|
|
69
69
|
<span {...valueProps} className={styles.value}>
|
|
70
70
|
{value ?? placeholder}
|
|
71
71
|
</span>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
classNameOverride={styles.icon}
|
|
78
|
-
/>
|
|
79
|
-
)}
|
|
72
|
+
<Icon
|
|
73
|
+
name={isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}
|
|
74
|
+
isPresentational
|
|
75
|
+
className={styles.icon}
|
|
76
|
+
/>
|
|
80
77
|
</button>
|
|
81
78
|
</div>
|
|
82
79
|
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import {
|
|
3
|
+
Tabs as RACTabs,
|
|
4
|
+
TabsProps as RACTabsProps,
|
|
5
|
+
Key as RACKey,
|
|
6
|
+
} from "react-aria-components"
|
|
7
|
+
|
|
8
|
+
export type TabsProps = Omit<RACTabsProps, "orientation">
|
|
9
|
+
export type Key = RACKey
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081929117/Tabs Guidance} |
|
|
13
|
+
* {@link https://cultureamp.design/?path=/docs/components-tabs--controlled Storybook}
|
|
14
|
+
*
|
|
15
|
+
* Wrapper around all of the tab subcomponents
|
|
16
|
+
* Holds a TabList and TabPanels
|
|
17
|
+
*/
|
|
18
|
+
export const Tabs = (props: TabsProps): JSX.Element => <RACTabs {...props} />
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Canvas, Controls, Meta } from "@storybook/blocks"
|
|
2
|
+
import { ResourceLinks, KAIOInstallation } from "~storybook/components"
|
|
3
|
+
import * as TabsStories from "./Tabs.stories"
|
|
4
|
+
|
|
5
|
+
<Meta title="Components/Tabs/Tabs (Future)/API Specification" />
|
|
6
|
+
|
|
7
|
+
# Tabs
|
|
8
|
+
|
|
9
|
+
<ResourceLinks
|
|
10
|
+
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Tabs"
|
|
11
|
+
figma="https://www.figma.com/file/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-UI-Kit%3A-Heart?type=design&node-id=1929%3A28886&mode=design&t=AGMmnoJia9RscurE-1"
|
|
12
|
+
designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081929117/Tabs"
|
|
13
|
+
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<KAIOInstallation
|
|
17
|
+
exportNames={["Tabs", "TabList", "Tab", "TabPanel"]}
|
|
18
|
+
isFuture
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
<Canvas of={TabsStories.Playground} />
|
|
24
|
+
<Controls of={TabsStories.Playground} />
|
|
25
|
+
|
|
26
|
+
## Uncontrolled vs controlled
|
|
27
|
+
|
|
28
|
+
This component is uncontrolled by default. You can specify a default active tab on load with `defaultSelectedKey`.
|
|
29
|
+
|
|
30
|
+
If you need to control the state of the active tabs on the consuming side, use the `selectedKey` prop instead of `defaultSelectedKey`, and hook into `onSelectionChange`.
|
|
31
|
+
|
|
32
|
+
<Canvas of={TabsStories.Controlled} />
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## `tablist|tab` role vs `nav|link`
|
|
36
|
+
|
|
37
|
+
This component implements the `tablist` role and WAI ARIA guidelines for tabs:
|
|
38
|
+
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tablist_role
|
|
39
|
+
https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
40
|
+
|
|
41
|
+
It's not intended to be used for a navigation bar where you need links wrapped in a `<nav>` instead.
|
|
42
|
+
|
|
43
|
+
If you really need to, you can add a URL history change here (using onChange), but that's probably a sign that this component is being misused.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Meta } from "@storybook/blocks"
|
|
2
|
+
|
|
3
|
+
<Meta title="Components/Tabs/Tabs (Future)/Migration Guide" />
|
|
4
|
+
|
|
5
|
+
# Future Tabs migration guide
|
|
6
|
+
|
|
7
|
+
A brief guide on how and why to migrate from Kaizen's current `Tabs` to the `future` release.
|
|
8
|
+
|
|
9
|
+
## Why the change?
|
|
10
|
+
|
|
11
|
+
Current Tabs uses the Reach UI library under the hood, which is no longer actively maintained. This switches the library used internally to React Aria Components.
|
|
12
|
+
|
|
13
|
+
## Component and API changes at a glance
|
|
14
|
+
|
|
15
|
+
The Reach UI and React Aria APIs are fairly similar so there's not too much to adjust.
|
|
16
|
+
|
|
17
|
+
The biggest adjustment is that you now need to provide an `id` for each `<Tab>` and match it with the one on `<TabPanel>`
|
|
18
|
+
|
|
19
|
+
Additionally:
|
|
20
|
+
- `<TabPanel>`s no longer needs to be wrapped in a `<TabPanels>` component
|
|
21
|
+
- `classNameOverride` changes to `className`
|
|
22
|
+
- `<Tabs defaultIndex={}>` changes to `<Tabs defaultSelectedKey={}>`
|
|
23
|
+
- `<Tabs index={}>` changes to `<Tabs selectedKey={}>`
|
|
24
|
+
- `<Tabs onChange={}>` changes to `<Tabs onSelectionChange={}>`
|
|
25
|
+
- `<Tab disabled>` changes to `<Tab isDisabled>`
|
|
26
|
+
|
|
27
|
+
## Migration examples
|
|
28
|
+
|
|
29
|
+
### Uncontrolled
|
|
30
|
+
|
|
31
|
+
#### Before
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<Tabs defaultIndex={1}>
|
|
35
|
+
<TabList>
|
|
36
|
+
<Tab>Tab 1</Tab>
|
|
37
|
+
<Tab>Tab 2</Tab>
|
|
38
|
+
<Tab disabled>Disabled tab</Tab>
|
|
39
|
+
</TabList>
|
|
40
|
+
<TabPanels>
|
|
41
|
+
<TabPanel classNameOverride="p-4">Content 1</TabPanel>
|
|
42
|
+
<TabPanel>Content 2</TabPanel>
|
|
43
|
+
<TabPanel>Disabled content</TabPanel>
|
|
44
|
+
</TabPanels>
|
|
45
|
+
</Tabs>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### After
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
<Tabs defaultSelectedKey="two">
|
|
52
|
+
<TabList>
|
|
53
|
+
<Tab id="one">Tab 1</Tab>
|
|
54
|
+
<Tab id="two">Tab 2</Tab>
|
|
55
|
+
<Tab id="three" isDisabled>Disabled tab</Tab>
|
|
56
|
+
</TabList>
|
|
57
|
+
<TabPanel id="one" className="p-4">Content 1</TabPanel>
|
|
58
|
+
<TabPanel id="two">Content 2</TabPanel>
|
|
59
|
+
</Tabs>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Controlled
|
|
63
|
+
|
|
64
|
+
#### Before
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<Tabs onChange={setSelectedTab} defaultIndex={1}>
|
|
68
|
+
<TabList>
|
|
69
|
+
<Tab>Tab 1</Tab>
|
|
70
|
+
<Tab>Tab 2</Tab>
|
|
71
|
+
<Tab disabled>Disabled tab</Tab>
|
|
72
|
+
</TabList>
|
|
73
|
+
<TabPanels>
|
|
74
|
+
<TabPanel>Content 1</TabPanel>
|
|
75
|
+
<TabPanel>Content 2</TabPanel>
|
|
76
|
+
<TabPanel>Disabled content</TabPanel>
|
|
77
|
+
</TabPanels>
|
|
78
|
+
</Tabs>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### After
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
<Tabs onSelectionChange={setSelectedTab} selectedKey="two">
|
|
85
|
+
<TabList>
|
|
86
|
+
<Tab id="one">Tab 1</Tab>
|
|
87
|
+
<Tab id="two">Tab 2</Tab>
|
|
88
|
+
<Tab id="three" isDisabled>Disabled tab</Tab>
|
|
89
|
+
</TabList>
|
|
90
|
+
<TabPanel id="one">Content 1</TabPanel>
|
|
91
|
+
<TabPanel id="two">Content 2</TabPanel>
|
|
92
|
+
</Tabs>
|
|
93
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { Text } from "~components/Text"
|
|
4
|
+
import { Button } from "~components/__actions__/v2"
|
|
5
|
+
import { Tab, TabList, TabPanel, Tabs, Key } from "../index"
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Components/Tabs/Tabs (Future)",
|
|
9
|
+
component: Tabs,
|
|
10
|
+
args: {
|
|
11
|
+
children: (
|
|
12
|
+
<>
|
|
13
|
+
<TabList aria-label="Tabs">
|
|
14
|
+
<Tab id="one">Tab 1</Tab>
|
|
15
|
+
<Tab id="two">Tab 2</Tab>
|
|
16
|
+
<Tab id="three" badge="3">
|
|
17
|
+
Tab 3
|
|
18
|
+
</Tab>
|
|
19
|
+
<Tab id="four" isDisabled>
|
|
20
|
+
Disabled Tab
|
|
21
|
+
</Tab>
|
|
22
|
+
</TabList>
|
|
23
|
+
<TabPanel id="one" className="p-24">
|
|
24
|
+
<Text variant="body">Content 1</Text>
|
|
25
|
+
</TabPanel>
|
|
26
|
+
<TabPanel id="two" className="p-24">
|
|
27
|
+
<Text variant="body">Content 2</Text>
|
|
28
|
+
</TabPanel>
|
|
29
|
+
<TabPanel id="three" className="p-24">
|
|
30
|
+
<Text variant="body">Content 3</Text>
|
|
31
|
+
</TabPanel>
|
|
32
|
+
</>
|
|
33
|
+
),
|
|
34
|
+
},
|
|
35
|
+
} satisfies Meta<typeof Tabs>
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
|
|
39
|
+
type Story = StoryObj<typeof meta>
|
|
40
|
+
|
|
41
|
+
export const Playground: Story = {
|
|
42
|
+
parameters: {
|
|
43
|
+
chromatic: { disable: false },
|
|
44
|
+
docs: {
|
|
45
|
+
canvas: {
|
|
46
|
+
sourceState: "shown",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
args: {
|
|
51
|
+
defaultSelectedKey: "one",
|
|
52
|
+
// eslint-disable-next-line no-console
|
|
53
|
+
onSelectionChange: (key): void => console.log("Tab changed to ", key),
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Controlled: Story = {
|
|
58
|
+
render: args => {
|
|
59
|
+
const [selectedKey, setSelectedKey] = useState<Key>(0)
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
<Tabs
|
|
63
|
+
{...args}
|
|
64
|
+
selectedKey={selectedKey}
|
|
65
|
+
onSelectionChange={setSelectedKey}
|
|
66
|
+
/>
|
|
67
|
+
<Button
|
|
68
|
+
label="Switch to tab 2"
|
|
69
|
+
onClick={(): void => setSelectedKey("two")}
|
|
70
|
+
/>
|
|
71
|
+
</>
|
|
72
|
+
)
|
|
73
|
+
},
|
|
74
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
.tab {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
border: 2px solid transparent;
|
|
5
|
+
border-bottom: 0;
|
|
6
|
+
border-top-left-radius: var(--border-borderless-border-radius);
|
|
7
|
+
border-top-right-radius: var(--border-borderless-border-radius);
|
|
8
|
+
background: var(--color-white);
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
padding: var(--spacing-md) var(--spacing-md);
|
|
12
|
+
margin: 0;
|
|
13
|
+
font-family: var(--typography-heading-4-font-family);
|
|
14
|
+
font-size: var(--typography-heading-4-font-size);
|
|
15
|
+
font-weight: var(--typography-heading-4-font-weight);
|
|
16
|
+
line-height: var(--typography-heading-4-line-height);
|
|
17
|
+
letter-spacing: var(--typography-heading-4-letter-spacing);
|
|
18
|
+
color: var(--color-purple-800);
|
|
19
|
+
|
|
20
|
+
&:focus {
|
|
21
|
+
outline: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:focus-visible {
|
|
25
|
+
background: var(--color-blue-100);
|
|
26
|
+
color: var(--color-blue-500);
|
|
27
|
+
border-color: var(--color-blue-500);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&[data-disabled] {
|
|
31
|
+
opacity: 0.3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:not(:first-child) {
|
|
35
|
+
margin-inline-start: var(--spacing-xs);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:not([data-disabled]):hover {
|
|
39
|
+
background: var(--color-blue-100);
|
|
40
|
+
color: var(--color-blue-500);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.tab[data-selected] {
|
|
45
|
+
position: relative;
|
|
46
|
+
color: var(--color-blue-500);
|
|
47
|
+
|
|
48
|
+
&::before {
|
|
49
|
+
content: "";
|
|
50
|
+
display: block;
|
|
51
|
+
border-top-left-radius: 5px;
|
|
52
|
+
border-top-right-radius: 5px;
|
|
53
|
+
background-color: currentcolor;
|
|
54
|
+
height: 5px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
position: absolute;
|
|
57
|
+
left: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.badge {
|
|
64
|
+
margin-inline-start: var(--spacing-sm);
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (forced-colors: active) {
|
|
70
|
+
.tab {
|
|
71
|
+
border: 2px solid transparent;
|
|
72
|
+
|
|
73
|
+
&:focus-visible::after {
|
|
74
|
+
content: "";
|
|
75
|
+
position: absolute;
|
|
76
|
+
background: transparent;
|
|
77
|
+
border-radius: var(--border-focus-ring-border-radius);
|
|
78
|
+
border-width: var(--border-focus-ring-border-width);
|
|
79
|
+
border-style: var(--border-focus-ring-border-style);
|
|
80
|
+
border-color: transparent;
|
|
81
|
+
inset: -2px;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tab[data-selected]::before {
|
|
86
|
+
/* High contrast also doesn't see the pseudo element created to show the active tab. */
|
|
87
|
+
content: "";
|
|
88
|
+
position: absolute;
|
|
89
|
+
left: 0;
|
|
90
|
+
right: 0;
|
|
91
|
+
bottom: 0;
|
|
92
|
+
border-bottom: 2px solid transparent;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import classnames from "classnames"
|
|
3
|
+
import { Tab as RACTab, TabProps as RACTabProps } from "react-aria-components"
|
|
4
|
+
import { Badge } from "~components/Badge"
|
|
5
|
+
import styles from "./Tab.module.css"
|
|
6
|
+
|
|
7
|
+
export type TabProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Adds a Kaizen Badge component to the tab.
|
|
10
|
+
* Comes with some logic baked in - changes variant based on active/focus/hover state.
|
|
11
|
+
*/
|
|
12
|
+
badge?: string
|
|
13
|
+
} & Omit<
|
|
14
|
+
RACTabProps,
|
|
15
|
+
// omitting link functionality because it goes against WAI ARIA standards https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
16
|
+
| "href"
|
|
17
|
+
| "hrefLang"
|
|
18
|
+
| "target"
|
|
19
|
+
| "rel"
|
|
20
|
+
| "download"
|
|
21
|
+
| "ping"
|
|
22
|
+
| "referrerPolicy"
|
|
23
|
+
>
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A tab button
|
|
27
|
+
*/
|
|
28
|
+
export const Tab = (props: TabProps): JSX.Element => {
|
|
29
|
+
const { badge, children, className, ...restProps } = props
|
|
30
|
+
|
|
31
|
+
const tabProps = {
|
|
32
|
+
className: classnames(styles.tab, className),
|
|
33
|
+
...restProps,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<RACTab {...tabProps}>
|
|
38
|
+
{({ isSelected, isFocusVisible, isHovered }) => (
|
|
39
|
+
<>
|
|
40
|
+
{children}
|
|
41
|
+
{badge && (
|
|
42
|
+
<span className={styles.badge}>
|
|
43
|
+
<Badge
|
|
44
|
+
variant={
|
|
45
|
+
isSelected || isFocusVisible || isHovered
|
|
46
|
+
? "active"
|
|
47
|
+
: "default"
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
{badge}
|
|
51
|
+
</Badge>
|
|
52
|
+
</span>
|
|
53
|
+
)}
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
</RACTab>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tab"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { ReactNode } from "react"
|
|
2
|
+
import classnames from "classnames"
|
|
3
|
+
import {
|
|
4
|
+
TabList as RACTabList,
|
|
5
|
+
TabListProps as RACTabListProps,
|
|
6
|
+
} from "react-aria-components"
|
|
7
|
+
import styles from "./TabList.module.css"
|
|
8
|
+
|
|
9
|
+
export type TabListProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Accessible name for the set of tabs
|
|
12
|
+
*/
|
|
13
|
+
"aria-label": string
|
|
14
|
+
/**
|
|
15
|
+
* Removes the built in padding
|
|
16
|
+
*/
|
|
17
|
+
noPadding?: boolean
|
|
18
|
+
children: ReactNode
|
|
19
|
+
} & RACTabListProps<HTMLElement>
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Wrapper for the tabs themselves
|
|
23
|
+
*/
|
|
24
|
+
export const TabList = (props: TabListProps): JSX.Element => {
|
|
25
|
+
const {
|
|
26
|
+
"aria-label": ariaLabel,
|
|
27
|
+
noPadding = false,
|
|
28
|
+
children,
|
|
29
|
+
className,
|
|
30
|
+
...restProps
|
|
31
|
+
} = props
|
|
32
|
+
return (
|
|
33
|
+
<RACTabList
|
|
34
|
+
aria-label={ariaLabel}
|
|
35
|
+
className={classnames(
|
|
36
|
+
styles.tabList,
|
|
37
|
+
className,
|
|
38
|
+
noPadding && styles.noPadding
|
|
39
|
+
)}
|
|
40
|
+
{...restProps}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</RACTabList>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TabList"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import {
|
|
3
|
+
TabPanel as RACTabPanel,
|
|
4
|
+
TabPanelProps as RACTabPanelProps,
|
|
5
|
+
} from "react-aria-components"
|
|
6
|
+
import styles from "./TabPanel.module.css"
|
|
7
|
+
|
|
8
|
+
export type TabPanelProps = RACTabPanelProps
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wrapper for the content that shows when tab is active
|
|
12
|
+
*/
|
|
13
|
+
export const TabPanel = (props: TabPanelProps): JSX.Element => {
|
|
14
|
+
const { className, children, ...restProps } = props
|
|
15
|
+
return (
|
|
16
|
+
<RACTabPanel className={(styles.tabPanel, className)} {...restProps}>
|
|
17
|
+
{children}
|
|
18
|
+
</RACTabPanel>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TabPanel"
|