@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
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import classnames from "classnames"
|
|
4
|
+
import { InlineNotification } from "~components/Notification"
|
|
5
|
+
import {
|
|
6
|
+
TableCard,
|
|
7
|
+
TableContainer,
|
|
8
|
+
TableHeader,
|
|
9
|
+
TableHeaderRowCell,
|
|
10
|
+
TableRow,
|
|
11
|
+
TableRowCell,
|
|
12
|
+
} from "~components/Table"
|
|
13
|
+
import { Text } from "~components/Text"
|
|
14
|
+
import { ToggleSwitchField } from "~components/ToggleSwitch"
|
|
15
|
+
import { Button } from "~components/__actions__/v3"
|
|
16
|
+
import { Tag } from "~components/__future__/Tag"
|
|
17
|
+
import { StickerSheet } from "~storybook/components/StickerSheet"
|
|
18
|
+
import { iconDefaultSet } from "../constants"
|
|
19
|
+
import { Icon } from "../index"
|
|
20
|
+
import imgInterfaceDont from "./assets/interface-dont.png"
|
|
21
|
+
import imgTooltipDont from "./assets/tooltip-dont.png"
|
|
22
|
+
import styles from "./Icon.docs.module.css"
|
|
23
|
+
|
|
24
|
+
const meta = {
|
|
25
|
+
title: "Illustrations/Icon/Icon (Future)",
|
|
26
|
+
component: Icon,
|
|
27
|
+
args: {
|
|
28
|
+
name: "star",
|
|
29
|
+
isPresentational: true,
|
|
30
|
+
},
|
|
31
|
+
argTypes: {
|
|
32
|
+
name: { type: "string" },
|
|
33
|
+
alt: {
|
|
34
|
+
description: "Set this value when `isPresentational={false}`",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
} satisfies Meta<typeof Icon>
|
|
38
|
+
|
|
39
|
+
export default meta
|
|
40
|
+
|
|
41
|
+
type Story = StoryObj<typeof meta>
|
|
42
|
+
|
|
43
|
+
export const Playground: Story = {
|
|
44
|
+
render: args => {
|
|
45
|
+
if (args.isPresentational) return <Icon {...args} alt={undefined} />
|
|
46
|
+
return <Icon {...args} alt={args.alt ?? "Fallback string"} />
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Filled: Story = {
|
|
51
|
+
args: { isFilled: true },
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const MirrorInRTL: Story = {
|
|
55
|
+
render: args => (
|
|
56
|
+
<StickerSheet>
|
|
57
|
+
<StickerSheet.Header
|
|
58
|
+
headings={['dir=["ltr"]', 'dir=["rtl"]']}
|
|
59
|
+
hasVerticalHeadings
|
|
60
|
+
/>
|
|
61
|
+
<StickerSheet.Body>
|
|
62
|
+
<StickerSheet.Row rowTitle="arrow_forward">
|
|
63
|
+
<div dir="ltr" className="text-center">
|
|
64
|
+
<Icon {...args} name="arrow_forward" shouldMirrorInRTL />
|
|
65
|
+
</div>
|
|
66
|
+
<div dir="rtl" className="text-center">
|
|
67
|
+
<Icon {...args} name="arrow_forward" shouldMirrorInRTL />
|
|
68
|
+
</div>
|
|
69
|
+
</StickerSheet.Row>
|
|
70
|
+
<StickerSheet.Row rowTitle="format_list_numbered">
|
|
71
|
+
<div dir="ltr" className="text-center">
|
|
72
|
+
<Icon {...args} name="format_list_numbered" shouldMirrorInRTL />
|
|
73
|
+
</div>
|
|
74
|
+
<div dir="rtl" className="text-center">
|
|
75
|
+
<Icon {...args} name="format_list_numbered" shouldMirrorInRTL />
|
|
76
|
+
</div>
|
|
77
|
+
</StickerSheet.Row>
|
|
78
|
+
</StickerSheet.Body>
|
|
79
|
+
</StickerSheet>
|
|
80
|
+
),
|
|
81
|
+
parameters: {
|
|
82
|
+
docs: {
|
|
83
|
+
source: {
|
|
84
|
+
code: `
|
|
85
|
+
<div dir="ltr" className="text-center">
|
|
86
|
+
<Icon {...props} name="arrow_forward" shouldMirrorInRTL />
|
|
87
|
+
</div>
|
|
88
|
+
<div dir="rtl" className="text-center">
|
|
89
|
+
<Icon {...props} name="arrow_forward" shouldMirrorInRTL />
|
|
90
|
+
</div>
|
|
91
|
+
<div dir="ltr" className="text-center">
|
|
92
|
+
<Icon {...props} name="format_list_numbered" shouldMirrorInRTL />
|
|
93
|
+
</div>
|
|
94
|
+
<div dir="rtl" className="text-center">
|
|
95
|
+
<Icon {...props} name="format_list_numbered" shouldMirrorInRTL />
|
|
96
|
+
</div>
|
|
97
|
+
`,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const Color: Story = {
|
|
104
|
+
render: args => (
|
|
105
|
+
<div className="flex gap-16">
|
|
106
|
+
<div className="text-green-500">
|
|
107
|
+
<Icon {...args} />
|
|
108
|
+
</div>
|
|
109
|
+
<Icon {...args} className="text-blue-500" />
|
|
110
|
+
</div>
|
|
111
|
+
),
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const Size: Story = {
|
|
115
|
+
render: args => (
|
|
116
|
+
<div className="flex gap-16">
|
|
117
|
+
<Icon {...args} className="[--icon-size:48]" />
|
|
118
|
+
<div className="text-[48px]">
|
|
119
|
+
<Icon {...args} className="text-[1em] [--icon-optical-size:48]" />
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
),
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const MeaningfulIcon: Story = {
|
|
126
|
+
render: args => (
|
|
127
|
+
<Button>
|
|
128
|
+
<Icon {...args} />
|
|
129
|
+
</Button>
|
|
130
|
+
),
|
|
131
|
+
args: { isPresentational: false, alt: "Favourite" },
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const PresentationalIcon: Story = {
|
|
135
|
+
render: args => (
|
|
136
|
+
<Button>
|
|
137
|
+
<Icon {...args} /> Favourite
|
|
138
|
+
</Button>
|
|
139
|
+
),
|
|
140
|
+
args: { isPresentational: true },
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const IconSetButton = ({
|
|
144
|
+
iconName,
|
|
145
|
+
isFilled,
|
|
146
|
+
}: {
|
|
147
|
+
iconName: string
|
|
148
|
+
isFilled: boolean
|
|
149
|
+
}): JSX.Element => {
|
|
150
|
+
const [copied, setCopied] = useState(false)
|
|
151
|
+
|
|
152
|
+
const handleCopy = (): void => {
|
|
153
|
+
const snippet = isFilled
|
|
154
|
+
? `<Icon name="${iconName}" isPresentational isFilled />`
|
|
155
|
+
: `<Icon name="${iconName}" isPresentational />`
|
|
156
|
+
navigator.clipboard.writeText(snippet)
|
|
157
|
+
|
|
158
|
+
setCopied(true)
|
|
159
|
+
setTimeout(() => setCopied(false), 1000)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<li>
|
|
164
|
+
<button
|
|
165
|
+
type="button"
|
|
166
|
+
onClick={handleCopy}
|
|
167
|
+
className={classnames(
|
|
168
|
+
"flex flex-col justify-center items-center gap-16",
|
|
169
|
+
"cursor-pointer h-full w-full p-16 rounded",
|
|
170
|
+
"bg-gray-100 hover:bg-gray-200"
|
|
171
|
+
)}
|
|
172
|
+
>
|
|
173
|
+
{copied ? (
|
|
174
|
+
<Tag color="green" classNameOverride="border-1 border-green-500">
|
|
175
|
+
Copied!
|
|
176
|
+
</Tag>
|
|
177
|
+
) : (
|
|
178
|
+
<>
|
|
179
|
+
<Icon name={iconName} isPresentational isFilled={isFilled} />
|
|
180
|
+
<Text variant="small" tag="span">
|
|
181
|
+
{iconName}
|
|
182
|
+
</Text>
|
|
183
|
+
</>
|
|
184
|
+
)}
|
|
185
|
+
</button>
|
|
186
|
+
</li>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export const DefaultIconSet: Story = {
|
|
191
|
+
render: () => {
|
|
192
|
+
const [isFilled, setIsFilled] = useState(false)
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<div className="flex flex-col gap-8">
|
|
196
|
+
<ToggleSwitchField
|
|
197
|
+
labelText="Filled"
|
|
198
|
+
toggledStatus={isFilled ? "on" : "off"}
|
|
199
|
+
onToggle={() => setIsFilled(!isFilled)}
|
|
200
|
+
/>
|
|
201
|
+
<ul
|
|
202
|
+
className="grid list-none gap-16 m-0 p-0"
|
|
203
|
+
style={{ gridTemplateColumns: "repeat(auto-fit, minmax(11em, 1fr))" }}
|
|
204
|
+
>
|
|
205
|
+
{iconDefaultSet.map(iconName => (
|
|
206
|
+
<IconSetButton
|
|
207
|
+
key={iconName}
|
|
208
|
+
iconName={iconName}
|
|
209
|
+
isFilled={isFilled}
|
|
210
|
+
/>
|
|
211
|
+
))}
|
|
212
|
+
</ul>
|
|
213
|
+
</div>
|
|
214
|
+
)
|
|
215
|
+
},
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export const ConsistentDo: Story = {
|
|
219
|
+
render: () => (
|
|
220
|
+
<Text variant="body">
|
|
221
|
+
Edit <Icon name="edit" isPresentational />
|
|
222
|
+
</Text>
|
|
223
|
+
),
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export const FilledUnfilledDo: Story = {
|
|
227
|
+
render: () => (
|
|
228
|
+
<div className="flex gap-16">
|
|
229
|
+
<div className="flex items-center gap-4">
|
|
230
|
+
<Text variant="body">Default state</Text>
|
|
231
|
+
<Icon name="thumb_up" isPresentational />
|
|
232
|
+
</div>
|
|
233
|
+
<div className="flex items-center gap-4">
|
|
234
|
+
<Text variant="body">Selected</Text>
|
|
235
|
+
<Icon name="thumb_up" isPresentational isFilled />
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
),
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export const OpticalSizeDo: Story = {
|
|
242
|
+
render: () => (
|
|
243
|
+
<div className="flex gap-16">
|
|
244
|
+
<div className="flex items-center gap-4">
|
|
245
|
+
<Text variant="body">20/20</Text>
|
|
246
|
+
<Icon
|
|
247
|
+
name="star"
|
|
248
|
+
isPresentational
|
|
249
|
+
className="text-[20px] [--icon-optical-size:20]"
|
|
250
|
+
/>
|
|
251
|
+
</div>
|
|
252
|
+
<div className="flex items-center gap-4">
|
|
253
|
+
<Text variant="body">24/24</Text>
|
|
254
|
+
<Icon
|
|
255
|
+
name="star"
|
|
256
|
+
isPresentational
|
|
257
|
+
className="text-[24px] [--icon-optical-size:24]"
|
|
258
|
+
/>
|
|
259
|
+
</div>
|
|
260
|
+
<div className="flex items-center gap-4">
|
|
261
|
+
<Text variant="body">40/40</Text>
|
|
262
|
+
<Icon
|
|
263
|
+
name="star"
|
|
264
|
+
isPresentational
|
|
265
|
+
className="text-[40px] [--icon-optical-size:40]"
|
|
266
|
+
/>
|
|
267
|
+
</div>
|
|
268
|
+
<div className="flex items-center gap-4">
|
|
269
|
+
<Text variant="body">48/48</Text>
|
|
270
|
+
<Icon
|
|
271
|
+
name="star"
|
|
272
|
+
isPresentational
|
|
273
|
+
className="text-[48px] [--icon-optical-size:48]"
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
),
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export const OpticalSizeDont: Story = {
|
|
281
|
+
render: () => (
|
|
282
|
+
<div className="flex gap-16">
|
|
283
|
+
<div className="flex items-center gap-4">
|
|
284
|
+
<Text variant="body">20/48</Text>
|
|
285
|
+
<Icon
|
|
286
|
+
name="star"
|
|
287
|
+
isPresentational
|
|
288
|
+
className="text-[20px] [--icon-optical-size:48]"
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
<div className="flex items-center gap-4">
|
|
292
|
+
<Text variant="body">24/40</Text>
|
|
293
|
+
<Icon
|
|
294
|
+
name="star"
|
|
295
|
+
isPresentational
|
|
296
|
+
className="text-[24px] [--icon-optical-size:40]"
|
|
297
|
+
/>
|
|
298
|
+
</div>
|
|
299
|
+
<div className="flex items-center gap-4">
|
|
300
|
+
<Text variant="body">40/24</Text>
|
|
301
|
+
<Icon
|
|
302
|
+
name="star"
|
|
303
|
+
isPresentational
|
|
304
|
+
className="text-[40px] [--icon-optical-size:24]"
|
|
305
|
+
/>
|
|
306
|
+
</div>
|
|
307
|
+
<div className="flex items-center gap-4">
|
|
308
|
+
<Text variant="body">48/20</Text>
|
|
309
|
+
<Icon
|
|
310
|
+
name="star"
|
|
311
|
+
isPresentational
|
|
312
|
+
className="text-[48px] [--icon-optical-size:20]"
|
|
313
|
+
/>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
),
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export const AlignmentDo: Story = {
|
|
320
|
+
render: () => (
|
|
321
|
+
<img
|
|
322
|
+
src="https://lh3.googleusercontent.com/twRAsK6vahc7l_yuhhlBzVp1yR_8tsspDL16Xry73IrhYE3ItxmKSqHC6MznHq9EZKfrOgP_a3RDNGLK28JmhHeFiDmiwYrbhBtpxjodrsw=s0"
|
|
323
|
+
alt="Symbol baseline set lower in relation to symbol."
|
|
324
|
+
className="w-full"
|
|
325
|
+
/>
|
|
326
|
+
),
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const AlignmentDont: Story = {
|
|
330
|
+
render: () => (
|
|
331
|
+
<img
|
|
332
|
+
src="https://lh3.googleusercontent.com/MePU5NYnrFy96fiDdULne6XwFlboyznBeVWD5CTrFwzNdzsMjrvg_ySLfXJVdUNxSkeUT4UH28_Orz916LRN78bhneYBA0dL8YpCQswiERo=s0"
|
|
333
|
+
alt="Both symbol and text set on same baseline."
|
|
334
|
+
className="w-full"
|
|
335
|
+
/>
|
|
336
|
+
),
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export const ContrastDo: Story = {
|
|
340
|
+
render: () => (
|
|
341
|
+
<div className="bg-yellow-100 p-16">
|
|
342
|
+
<Icon name="star" isPresentational className="text-yellow-700" />
|
|
343
|
+
</div>
|
|
344
|
+
),
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export const ContrastDont: Story = {
|
|
348
|
+
render: () => (
|
|
349
|
+
<div className="bg-yellow-100 p-16">
|
|
350
|
+
<Icon name="star" isPresentational className="text-yellow-500" />
|
|
351
|
+
</div>
|
|
352
|
+
),
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export const ColorPurposefulDo: Story = {
|
|
356
|
+
render: () => (
|
|
357
|
+
<>
|
|
358
|
+
<InlineNotification variant="success">Success</InlineNotification>
|
|
359
|
+
<InlineNotification variant="warning" noBottomMargin>
|
|
360
|
+
Error
|
|
361
|
+
</InlineNotification>
|
|
362
|
+
</>
|
|
363
|
+
),
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export const DistinguishDo: Story = {
|
|
367
|
+
render: () => (
|
|
368
|
+
<div className="flex gap-16">
|
|
369
|
+
<div className="flex items-center gap-4">
|
|
370
|
+
<Text variant="body">Default state</Text>
|
|
371
|
+
<Icon name="thumb_up" isPresentational />
|
|
372
|
+
</div>
|
|
373
|
+
<div className="flex items-center gap-4">
|
|
374
|
+
<Text variant="body">Selected</Text>
|
|
375
|
+
<Icon name="thumb_up" isPresentational isFilled />
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
),
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export const DistinguishDont: Story = {
|
|
382
|
+
render: () => (
|
|
383
|
+
<div className="flex gap-16">
|
|
384
|
+
<div className="flex items-center gap-4">
|
|
385
|
+
<Text variant="body">Default state</Text>
|
|
386
|
+
<Icon name="thumb_up" isPresentational />
|
|
387
|
+
</div>
|
|
388
|
+
<div className="flex items-center gap-4">
|
|
389
|
+
<Text variant="body">Selected</Text>
|
|
390
|
+
<Icon name="thumb_up" isPresentational className="text-blue-500" />
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
),
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export const InterfaceDont: Story = {
|
|
397
|
+
render: () => (
|
|
398
|
+
<img
|
|
399
|
+
src={imgInterfaceDont}
|
|
400
|
+
alt="Example of a bad interface"
|
|
401
|
+
className="block m-auto max-w-[600px]"
|
|
402
|
+
/>
|
|
403
|
+
),
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export const ImportantInformationDo: Story = {
|
|
407
|
+
render: () => (
|
|
408
|
+
<TableContainer>
|
|
409
|
+
<TableHeader>
|
|
410
|
+
<TableRow>
|
|
411
|
+
<TableHeaderRowCell
|
|
412
|
+
labelText="Flag for review"
|
|
413
|
+
sorting="ascending"
|
|
414
|
+
width={4 / 12}
|
|
415
|
+
/>
|
|
416
|
+
<TableHeaderRowCell labelText="Employee" sorting="ascending" />
|
|
417
|
+
</TableRow>
|
|
418
|
+
</TableHeader>
|
|
419
|
+
<TableCard>
|
|
420
|
+
<TableRow>
|
|
421
|
+
<TableRowCell width={4 / 12}>
|
|
422
|
+
<Icon name="flag" alt="Flag" />
|
|
423
|
+
</TableRowCell>
|
|
424
|
+
<TableRowCell>
|
|
425
|
+
<Text tag="div" variant="body">
|
|
426
|
+
John Johnson
|
|
427
|
+
</Text>
|
|
428
|
+
</TableRowCell>
|
|
429
|
+
</TableRow>
|
|
430
|
+
</TableCard>
|
|
431
|
+
<TableCard>
|
|
432
|
+
<TableRow>
|
|
433
|
+
<TableRowCell width={4 / 12}>
|
|
434
|
+
<Icon name="flag" alt="Flag" />
|
|
435
|
+
</TableRowCell>
|
|
436
|
+
<TableRowCell>
|
|
437
|
+
<Text tag="div" variant="body">
|
|
438
|
+
Michelle Summer
|
|
439
|
+
</Text>
|
|
440
|
+
</TableRowCell>
|
|
441
|
+
</TableRow>
|
|
442
|
+
</TableCard>
|
|
443
|
+
</TableContainer>
|
|
444
|
+
),
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export const ImportantInformationDont: Story = {
|
|
448
|
+
render: () => (
|
|
449
|
+
<TableContainer>
|
|
450
|
+
<TableHeader>
|
|
451
|
+
<TableRow>
|
|
452
|
+
<TableHeaderRowCell labelText="" sorting="ascending" />
|
|
453
|
+
<TableHeaderRowCell labelText="Employee" sorting="ascending" />
|
|
454
|
+
</TableRow>
|
|
455
|
+
</TableHeader>
|
|
456
|
+
<TableCard>
|
|
457
|
+
<TableRow>
|
|
458
|
+
<TableRowCell>
|
|
459
|
+
<Icon name="flag" alt="Flag" />
|
|
460
|
+
</TableRowCell>
|
|
461
|
+
<TableRowCell>
|
|
462
|
+
<Text tag="div" variant="body">
|
|
463
|
+
John Johnson
|
|
464
|
+
</Text>
|
|
465
|
+
</TableRowCell>
|
|
466
|
+
</TableRow>
|
|
467
|
+
</TableCard>
|
|
468
|
+
<TableCard>
|
|
469
|
+
<TableRow>
|
|
470
|
+
<TableRowCell>
|
|
471
|
+
<Icon name="flag" alt="Flag" />
|
|
472
|
+
</TableRowCell>
|
|
473
|
+
<TableRowCell>
|
|
474
|
+
<Text tag="div" variant="body">
|
|
475
|
+
Michelle Summer
|
|
476
|
+
</Text>
|
|
477
|
+
</TableRowCell>
|
|
478
|
+
</TableRow>
|
|
479
|
+
</TableCard>
|
|
480
|
+
</TableContainer>
|
|
481
|
+
),
|
|
482
|
+
parameters: {
|
|
483
|
+
a11y: { disable: true }, // accessible label fix to be addressed in a separate PR
|
|
484
|
+
},
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const InteractiveIcon = (props: Record<string, any>): JSX.Element => (
|
|
488
|
+
<button type="button" className={styles.interactiveIcon} {...props}>
|
|
489
|
+
<Icon name="info" isPresentational isFilled />
|
|
490
|
+
</button>
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
export const InteractiveStatesDo: Story = {
|
|
494
|
+
render: () => (
|
|
495
|
+
<div className="flex gap-16">
|
|
496
|
+
<Text variant="body">
|
|
497
|
+
Base <InteractiveIcon />
|
|
498
|
+
</Text>
|
|
499
|
+
<Text variant="body">
|
|
500
|
+
Hover <InteractiveIcon data-sb-pseudo-styles="hover" />
|
|
501
|
+
</Text>
|
|
502
|
+
<Text variant="body">
|
|
503
|
+
Focus <InteractiveIcon data-sb-pseudo-styles="focus" />
|
|
504
|
+
</Text>
|
|
505
|
+
</div>
|
|
506
|
+
),
|
|
507
|
+
parameters: {
|
|
508
|
+
pseudo: {
|
|
509
|
+
hover: '[data-sb-pseudo-styles="hover"]',
|
|
510
|
+
focus: '[data-sb-pseudo-styles="focus"]',
|
|
511
|
+
focusVisible: '[data-sb-pseudo-styles="focus"]',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export const TooltipDont: Story = {
|
|
517
|
+
render: () => (
|
|
518
|
+
<img
|
|
519
|
+
src={imgTooltipDont}
|
|
520
|
+
alt="Example of a bad use of a tooltip on an icon"
|
|
521
|
+
className="block m-auto max-w-[600px]"
|
|
522
|
+
/>
|
|
523
|
+
),
|
|
524
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Meta } from "@storybook/react"
|
|
3
|
+
import { CheckboxField } from "~components/Checkbox"
|
|
4
|
+
import { Label } from "~components/Label"
|
|
5
|
+
import { Text } from "~components/Text"
|
|
6
|
+
import { Button as ButtonV2 } from "~components/__actions__/v2"
|
|
7
|
+
import { Button as ButtonV3 } from "~components/__actions__/v3"
|
|
8
|
+
import {
|
|
9
|
+
StickerSheet,
|
|
10
|
+
StickerSheetStory,
|
|
11
|
+
} from "~storybook/components/StickerSheet"
|
|
12
|
+
import { handledRtlIcons, iconDefaultSet } from "../constants"
|
|
13
|
+
import { Icon, IconProps } from "../index"
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: "Illustrations/Icon/Icon (Future)",
|
|
17
|
+
parameters: {
|
|
18
|
+
chromatic: { disable: false },
|
|
19
|
+
controls: { disable: true },
|
|
20
|
+
},
|
|
21
|
+
} satisfies Meta
|
|
22
|
+
|
|
23
|
+
const StickerSheetTemplate: StickerSheetStory = {
|
|
24
|
+
render: ({ isReversed }) => {
|
|
25
|
+
const defaultProps = {
|
|
26
|
+
name: "star",
|
|
27
|
+
isPresentational: true,
|
|
28
|
+
} satisfies IconProps
|
|
29
|
+
|
|
30
|
+
const mirrorInRTL = [
|
|
31
|
+
"arrow_forward",
|
|
32
|
+
"arrow_back",
|
|
33
|
+
...Object.keys(handledRtlIcons),
|
|
34
|
+
] satisfies Array<IconProps["name"]>
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<StickerSheet heading="Icon" isReversed={isReversed}>
|
|
39
|
+
<StickerSheet.Header
|
|
40
|
+
headings={["Outlined", "Filled", "Color"]}
|
|
41
|
+
hasVerticalHeadings
|
|
42
|
+
/>
|
|
43
|
+
<StickerSheet.Body>
|
|
44
|
+
{iconDefaultSet.map(name => (
|
|
45
|
+
<StickerSheet.Row key={name} rowTitle={name}>
|
|
46
|
+
<Icon {...defaultProps} name={name} />
|
|
47
|
+
<Icon {...defaultProps} name={name} isFilled />
|
|
48
|
+
<Icon {...defaultProps} name={name} className="text-blue-500" />
|
|
49
|
+
</StickerSheet.Row>
|
|
50
|
+
))}
|
|
51
|
+
</StickerSheet.Body>
|
|
52
|
+
</StickerSheet>
|
|
53
|
+
|
|
54
|
+
<StickerSheet heading="shouldMirrorInRTL" isReversed={isReversed}>
|
|
55
|
+
<StickerSheet.Header
|
|
56
|
+
headings={[
|
|
57
|
+
'true; dir=["ltr"]',
|
|
58
|
+
'true; dir=["rtl"]',
|
|
59
|
+
'false; dir=["rtl"]',
|
|
60
|
+
]}
|
|
61
|
+
hasVerticalHeadings
|
|
62
|
+
/>
|
|
63
|
+
<StickerSheet.Body>
|
|
64
|
+
{mirrorInRTL.map(name => (
|
|
65
|
+
<StickerSheet.Row key={name} rowTitle={name}>
|
|
66
|
+
<div dir="ltr" className="text-center">
|
|
67
|
+
<Icon {...defaultProps} name={name} shouldMirrorInRTL />
|
|
68
|
+
</div>
|
|
69
|
+
<div dir="rtl" className="text-center">
|
|
70
|
+
<Icon {...defaultProps} name={name} shouldMirrorInRTL />
|
|
71
|
+
</div>
|
|
72
|
+
<div dir="rtl" className="text-center">
|
|
73
|
+
<Icon {...defaultProps} name={name} />
|
|
74
|
+
</div>
|
|
75
|
+
</StickerSheet.Row>
|
|
76
|
+
))}
|
|
77
|
+
</StickerSheet.Body>
|
|
78
|
+
</StickerSheet>
|
|
79
|
+
|
|
80
|
+
<StickerSheet
|
|
81
|
+
heading="Alignment as children within other components"
|
|
82
|
+
isReversed={isReversed}
|
|
83
|
+
>
|
|
84
|
+
<StickerSheet.Body>
|
|
85
|
+
<StickerSheet.Row rowTitle="Text">
|
|
86
|
+
<Text variant="body">
|
|
87
|
+
Showcase alignment of an icon <Icon {...defaultProps} /> within
|
|
88
|
+
a sentence
|
|
89
|
+
</Text>
|
|
90
|
+
</StickerSheet.Row>
|
|
91
|
+
<StickerSheet.Row rowTitle="Label">
|
|
92
|
+
<Label>
|
|
93
|
+
Field label <Icon {...defaultProps} />
|
|
94
|
+
</Label>
|
|
95
|
+
</StickerSheet.Row>
|
|
96
|
+
<StickerSheet.Row rowTitle="CheckboxField">
|
|
97
|
+
<CheckboxField
|
|
98
|
+
labelText={
|
|
99
|
+
<>
|
|
100
|
+
Checkbox label <Icon {...defaultProps} />
|
|
101
|
+
</>
|
|
102
|
+
}
|
|
103
|
+
/>
|
|
104
|
+
</StickerSheet.Row>
|
|
105
|
+
<StickerSheet.Row rowTitle="Button (v2)">
|
|
106
|
+
<ButtonV2
|
|
107
|
+
label="Button label"
|
|
108
|
+
icon={<Icon {...defaultProps} />}
|
|
109
|
+
/>
|
|
110
|
+
</StickerSheet.Row>
|
|
111
|
+
<StickerSheet.Row rowTitle="Button (v3)">
|
|
112
|
+
<ButtonV3>
|
|
113
|
+
<Icon {...defaultProps} /> Button label
|
|
114
|
+
</ButtonV3>
|
|
115
|
+
</StickerSheet.Row>
|
|
116
|
+
</StickerSheet.Body>
|
|
117
|
+
</StickerSheet>
|
|
118
|
+
</>
|
|
119
|
+
)
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const StickerSheetDefault: StickerSheetStory = {
|
|
124
|
+
...StickerSheetTemplate,
|
|
125
|
+
name: "Sticker Sheet (Default)",
|
|
126
|
+
}
|
|
Binary file
|
|
Binary file
|