@kaizen/components 1.66.1 → 1.67.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codemods/README.md +5 -0
- 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/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +4 -5
- 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/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/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/TextField/TextField.cjs +5 -4
- 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/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/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +4 -5
- 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/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/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/TextField/TextField.mjs +5 -4
- 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/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 +555 -531
- 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 +21 -21
- package/src/Avatar/Avatar.module.scss +6 -8
- 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 +0 -8
- 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 +12 -12
- package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +2 -2
- 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/subcomponents/MultiSelectOption/MultiSelectOption.tsx +2 -2
- package/src/Filter/FilterSelect/FilterSelect.spec.tsx +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/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/InputSearch/InputSearch.tsx +2 -2
- package/src/Label/Label.module.scss +4 -0
- package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +2 -2
- package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.stories.tsx +2 -2
- package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +2 -0
- package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +32 -35
- package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.tsx +2 -2
- 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 +2 -0
- 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/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 +2 -0
- 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.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/TextField/TextField.spec.tsx +9 -4
- package/src/TextField/TextField.tsx +2 -2
- package/src/TextField/_docs/TextField.stories.tsx +4 -3
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +3 -3
- package/src/TitleBlockZen/TitleBlockZen.module.scss +1 -0
- 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.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 +1 -1
- 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/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 +0 -56
- 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/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.cjs +0 -23
- 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/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.tsx +0 -21
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import ts from "typescript"
|
|
2
|
+
import { parseJsx } from "../__tests__/utils"
|
|
3
|
+
import { updateKaioImports, UpdateKaioImportsArgs } from "./updateKaioImports"
|
|
4
|
+
import { printAst } from "."
|
|
5
|
+
|
|
6
|
+
const transformInput =
|
|
7
|
+
(sourceFile: ts.SourceFile) =>
|
|
8
|
+
(imports: UpdateKaioImportsArgs): string => {
|
|
9
|
+
const result = ts.transform(sourceFile, [updateKaioImports(imports)])
|
|
10
|
+
const transformedSource = result.transformed[0] as ts.SourceFile
|
|
11
|
+
return printAst(transformedSource)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe("updateKaioImports()", () => {
|
|
15
|
+
describe("remove imports", () => {
|
|
16
|
+
it("removes listed named imports", () => {
|
|
17
|
+
const inputAst = parseJsx(`
|
|
18
|
+
import { Card, Well } from "@kaizen/components"
|
|
19
|
+
`)
|
|
20
|
+
const outputAst = parseJsx(`
|
|
21
|
+
import { Well } from "@kaizen/components"
|
|
22
|
+
`)
|
|
23
|
+
expect(
|
|
24
|
+
transformInput(inputAst)({
|
|
25
|
+
importsToRemove: new Map([["@kaizen/components", new Set(["Card"])]]),
|
|
26
|
+
})
|
|
27
|
+
).toEqual(printAst(outputAst))
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it("removes listed named aliased imports", () => {
|
|
31
|
+
const inputAst = parseJsx(`
|
|
32
|
+
import { Card as KzCard, Well } from "@kaizen/components"
|
|
33
|
+
`)
|
|
34
|
+
const outputAst = parseJsx(`
|
|
35
|
+
import { Well } from "@kaizen/components"
|
|
36
|
+
`)
|
|
37
|
+
expect(
|
|
38
|
+
transformInput(inputAst)({
|
|
39
|
+
importsToRemove: new Map([["@kaizen/components", new Set(["Card"])]]),
|
|
40
|
+
})
|
|
41
|
+
).toEqual(printAst(outputAst))
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it("removes import statement when all named imports are removed", () => {
|
|
45
|
+
const inputAst = parseJsx(`
|
|
46
|
+
import { Card } from "@kaizen/components"
|
|
47
|
+
import { Select } from "@kaizen/components/future"
|
|
48
|
+
`)
|
|
49
|
+
const outputAst = parseJsx(`
|
|
50
|
+
import { Select } from "@kaizen/components/future"
|
|
51
|
+
`)
|
|
52
|
+
expect(
|
|
53
|
+
transformInput(inputAst)({
|
|
54
|
+
importsToRemove: new Map([["@kaizen/components", new Set(["Card"])]]),
|
|
55
|
+
})
|
|
56
|
+
).toEqual(printAst(outputAst))
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it("does nothing if the import does not exist", () => {
|
|
60
|
+
const inputAst = parseJsx(`
|
|
61
|
+
import { Select } from "@kaizen/components/future"
|
|
62
|
+
`)
|
|
63
|
+
const outputAst = parseJsx(`
|
|
64
|
+
import { Select } from "@kaizen/components/future"
|
|
65
|
+
`)
|
|
66
|
+
expect(
|
|
67
|
+
transformInput(inputAst)({
|
|
68
|
+
importsToRemove: new Map([["@kaizen/components", new Set(["Card"])]]),
|
|
69
|
+
})
|
|
70
|
+
).toEqual(printAst(outputAst))
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
describe("add imports", () => {
|
|
75
|
+
it("creates a new import declaration for new imports", () => {
|
|
76
|
+
const inputAst = parseJsx(`
|
|
77
|
+
import { Well } from "@kaizen/components"
|
|
78
|
+
`)
|
|
79
|
+
const outputAst = parseJsx(`
|
|
80
|
+
import { Well } from "@kaizen/components"
|
|
81
|
+
import { Card } from "@kaizen/components/future"
|
|
82
|
+
`)
|
|
83
|
+
expect(
|
|
84
|
+
transformInput(inputAst)({
|
|
85
|
+
importsToAdd: new Map([
|
|
86
|
+
[
|
|
87
|
+
"@kaizen/components/future",
|
|
88
|
+
new Map([["Card", { componentName: "Card" }]]),
|
|
89
|
+
],
|
|
90
|
+
]),
|
|
91
|
+
})
|
|
92
|
+
).toEqual(printAst(outputAst))
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it("creates a new import declaration for new aliased imports", () => {
|
|
96
|
+
const inputAst = parseJsx(`
|
|
97
|
+
import { Well } from "@kaizen/components"
|
|
98
|
+
`)
|
|
99
|
+
const outputAst = parseJsx(`
|
|
100
|
+
import { Well } from "@kaizen/components"
|
|
101
|
+
import { Card as KzCard } from "@kaizen/components/future"
|
|
102
|
+
`)
|
|
103
|
+
expect(
|
|
104
|
+
transformInput(inputAst)({
|
|
105
|
+
importsToAdd: new Map([
|
|
106
|
+
[
|
|
107
|
+
"@kaizen/components/future",
|
|
108
|
+
new Map([["Card", { componentName: "Card", alias: "KzCard" }]]),
|
|
109
|
+
],
|
|
110
|
+
]),
|
|
111
|
+
})
|
|
112
|
+
).toEqual(printAst(outputAst))
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it("does not add a new named import if it already exists", () => {
|
|
116
|
+
const inputAst = parseJsx(`
|
|
117
|
+
import { Icon } from "@kaizen/components/future"
|
|
118
|
+
`)
|
|
119
|
+
const outputAst = parseJsx(`
|
|
120
|
+
import { Icon } from "@kaizen/components/future"
|
|
121
|
+
`)
|
|
122
|
+
expect(
|
|
123
|
+
transformInput(inputAst)({
|
|
124
|
+
importsToAdd: new Map([
|
|
125
|
+
[
|
|
126
|
+
"@kaizen/components/future",
|
|
127
|
+
new Map([["Icon", { componentName: "Icon" }]]),
|
|
128
|
+
],
|
|
129
|
+
]),
|
|
130
|
+
})
|
|
131
|
+
).toEqual(printAst(outputAst))
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it("updates existing import declaration with new imports", () => {
|
|
135
|
+
const inputAst = parseJsx(`
|
|
136
|
+
import { Select } from "@kaizen/components/future"
|
|
137
|
+
`)
|
|
138
|
+
const outputAst = parseJsx(`
|
|
139
|
+
import { Select, Card } from "@kaizen/components/future"
|
|
140
|
+
`)
|
|
141
|
+
expect(
|
|
142
|
+
transformInput(inputAst)({
|
|
143
|
+
importsToAdd: new Map([
|
|
144
|
+
[
|
|
145
|
+
"@kaizen/components/future",
|
|
146
|
+
new Map([["Card", { componentName: "Card" }]]),
|
|
147
|
+
],
|
|
148
|
+
]),
|
|
149
|
+
})
|
|
150
|
+
).toEqual(printAst(outputAst))
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
describe("insert position", () => {
|
|
154
|
+
it("inserts the new import below @kaizen/components", () => {
|
|
155
|
+
const inputAst = parseJsx(`
|
|
156
|
+
import React from "react"
|
|
157
|
+
import { Well } from "@kaizen/components"
|
|
158
|
+
import styles from "@kaizen/components/dist/styles.css"
|
|
159
|
+
`)
|
|
160
|
+
const outputAst = parseJsx(`
|
|
161
|
+
import React from "react"
|
|
162
|
+
import { Well } from "@kaizen/components"
|
|
163
|
+
import { Card } from "@kaizen/components/future"
|
|
164
|
+
import styles from "@kaizen/components/dist/styles.css"
|
|
165
|
+
`)
|
|
166
|
+
expect(
|
|
167
|
+
transformInput(inputAst)({
|
|
168
|
+
importsToAdd: new Map([
|
|
169
|
+
[
|
|
170
|
+
"@kaizen/components/future",
|
|
171
|
+
new Map([["Card", { componentName: "Card" }]]),
|
|
172
|
+
],
|
|
173
|
+
]),
|
|
174
|
+
})
|
|
175
|
+
).toEqual(printAst(outputAst))
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
it("inserts the new import below the first subpath of @kaizen/components", () => {
|
|
179
|
+
const inputAst = parseJsx(`
|
|
180
|
+
import React from "react"
|
|
181
|
+
import { Well } from "@kaizen/components/v1"
|
|
182
|
+
import styles from "@kaizen/components/dist/styles.css"
|
|
183
|
+
`)
|
|
184
|
+
const outputAst = parseJsx(`
|
|
185
|
+
import React from "react"
|
|
186
|
+
import { Well } from "@kaizen/components/v1"
|
|
187
|
+
import { Card } from "@kaizen/components/future"
|
|
188
|
+
import styles from "@kaizen/components/dist/styles.css"
|
|
189
|
+
`)
|
|
190
|
+
expect(
|
|
191
|
+
transformInput(inputAst)({
|
|
192
|
+
importsToAdd: new Map([
|
|
193
|
+
[
|
|
194
|
+
"@kaizen/components/future",
|
|
195
|
+
new Map([["Card", { componentName: "Card" }]]),
|
|
196
|
+
],
|
|
197
|
+
]),
|
|
198
|
+
})
|
|
199
|
+
).toEqual(printAst(outputAst))
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it("inserts at the top of the file if no pre-existing import of @kaizen/components", () => {
|
|
203
|
+
const inputAst = parseJsx(`
|
|
204
|
+
import React from "react"
|
|
205
|
+
`)
|
|
206
|
+
const outputAst = parseJsx(`
|
|
207
|
+
import { Card } from "@kaizen/components/future"
|
|
208
|
+
import React from "react"
|
|
209
|
+
`)
|
|
210
|
+
expect(
|
|
211
|
+
transformInput(inputAst)({
|
|
212
|
+
importsToAdd: new Map([
|
|
213
|
+
[
|
|
214
|
+
"@kaizen/components/future",
|
|
215
|
+
new Map([["Card", { componentName: "Card" }]]),
|
|
216
|
+
],
|
|
217
|
+
]),
|
|
218
|
+
})
|
|
219
|
+
).toEqual(printAst(outputAst))
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
})
|
|
223
|
+
})
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import ts from "typescript"
|
|
2
|
+
|
|
3
|
+
type ImportsToRemove = Set<string>
|
|
4
|
+
|
|
5
|
+
const removeNamedImports = (
|
|
6
|
+
factory: ts.NodeFactory,
|
|
7
|
+
node: ts.ImportDeclaration,
|
|
8
|
+
importsToRemove: ImportsToRemove
|
|
9
|
+
): ts.ImportDeclaration | null => {
|
|
10
|
+
const namedBindings = node.importClause?.namedBindings
|
|
11
|
+
if (namedBindings && ts.isNamedImports(namedBindings)) {
|
|
12
|
+
const namedImports = namedBindings.elements.filter(importSpecifier => {
|
|
13
|
+
const componentName =
|
|
14
|
+
importSpecifier.propertyName?.getText() ??
|
|
15
|
+
importSpecifier.name.getText()
|
|
16
|
+
return !importsToRemove.has(componentName)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
if (namedImports.length === 0) return null
|
|
20
|
+
|
|
21
|
+
return factory.updateImportDeclaration(
|
|
22
|
+
node,
|
|
23
|
+
node.modifiers,
|
|
24
|
+
factory.updateImportClause(
|
|
25
|
+
node.importClause,
|
|
26
|
+
node.importClause.isTypeOnly,
|
|
27
|
+
node.importClause.name,
|
|
28
|
+
factory.updateNamedImports(namedBindings, namedImports)
|
|
29
|
+
),
|
|
30
|
+
node.moduleSpecifier,
|
|
31
|
+
node.attributes
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return node
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type NewImportAttributes = { componentName: string; alias?: string }
|
|
39
|
+
type ImportsToAdd = Map<string, NewImportAttributes>
|
|
40
|
+
|
|
41
|
+
const createImportDeclaration = (
|
|
42
|
+
factory: ts.NodeFactory,
|
|
43
|
+
importsToAdd: ImportsToAdd,
|
|
44
|
+
moduleSpecifier: string
|
|
45
|
+
): ts.ImportDeclaration => {
|
|
46
|
+
const namedImports = Array.from(importsToAdd.values()).map(
|
|
47
|
+
({ componentName, alias }) =>
|
|
48
|
+
factory.createImportSpecifier(
|
|
49
|
+
false,
|
|
50
|
+
alias ? factory.createIdentifier(componentName) : undefined,
|
|
51
|
+
factory.createIdentifier(alias ?? componentName)
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
return factory.createImportDeclaration(
|
|
56
|
+
undefined,
|
|
57
|
+
factory.createImportClause(
|
|
58
|
+
false,
|
|
59
|
+
undefined,
|
|
60
|
+
factory.createNamedImports(namedImports)
|
|
61
|
+
),
|
|
62
|
+
factory.createStringLiteral(moduleSpecifier)
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const updateNamedImports = (
|
|
67
|
+
factory: ts.NodeFactory,
|
|
68
|
+
node: ts.ImportDeclaration,
|
|
69
|
+
importsToAdd: ImportsToAdd
|
|
70
|
+
): ts.ImportDeclaration => {
|
|
71
|
+
if (!node.importClause) return node
|
|
72
|
+
|
|
73
|
+
const existingNamedImportNames = new Set<string>()
|
|
74
|
+
const importSpecifiers: ts.ImportSpecifier[] = []
|
|
75
|
+
|
|
76
|
+
const namedBindings = node.importClause.namedBindings
|
|
77
|
+
if (namedBindings && ts.isNamedImports(namedBindings)) {
|
|
78
|
+
namedBindings.elements.forEach(importSpecifier => {
|
|
79
|
+
existingNamedImportNames.add(importSpecifier.name.getText())
|
|
80
|
+
importSpecifiers.push(importSpecifier)
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
Array.from(importsToAdd.values()).forEach(({ alias, componentName }) => {
|
|
85
|
+
const newImport = factory.createImportSpecifier(
|
|
86
|
+
false,
|
|
87
|
+
alias ? factory.createIdentifier(componentName) : undefined,
|
|
88
|
+
factory.createIdentifier(alias ?? componentName)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
if (!existingNamedImportNames.has(componentName)) {
|
|
92
|
+
importSpecifiers.push(newImport)
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
return factory.updateImportDeclaration(
|
|
97
|
+
node,
|
|
98
|
+
node.modifiers,
|
|
99
|
+
factory.updateImportClause(
|
|
100
|
+
node.importClause,
|
|
101
|
+
node.importClause.isTypeOnly,
|
|
102
|
+
node.importClause.name,
|
|
103
|
+
factory.createNamedImports(importSpecifiers)
|
|
104
|
+
),
|
|
105
|
+
node.moduleSpecifier,
|
|
106
|
+
node.attributes
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Key is module specifier (eg. "@kaizen/components")
|
|
111
|
+
type ImportsToRemoveMap = Map<string, ImportsToRemove>
|
|
112
|
+
// Key is module specifier (eg. "@kaizen/components")
|
|
113
|
+
type ImportsToAddMap = Map<string, ImportsToAdd>
|
|
114
|
+
|
|
115
|
+
export type UpdateKaioImportsArgs = {
|
|
116
|
+
importsToRemove?: ImportsToRemoveMap
|
|
117
|
+
importsToAdd?: ImportsToAddMap
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const updateKaioImports =
|
|
121
|
+
({ importsToRemove, importsToAdd }: UpdateKaioImportsArgs) =>
|
|
122
|
+
(context: ts.TransformationContext) =>
|
|
123
|
+
(rootNode: ts.Node): ts.Node => {
|
|
124
|
+
if (!ts.isSourceFile(rootNode)) return rootNode
|
|
125
|
+
|
|
126
|
+
if (!importsToRemove && !importsToAdd) return rootNode
|
|
127
|
+
|
|
128
|
+
const { factory } = context
|
|
129
|
+
|
|
130
|
+
const statements = Array.from(rootNode.statements)
|
|
131
|
+
|
|
132
|
+
if (importsToRemove) {
|
|
133
|
+
Array.from(importsToRemove.keys()).forEach(moduleSpecifier => {
|
|
134
|
+
const importIndex = statements.findIndex(
|
|
135
|
+
s =>
|
|
136
|
+
ts.isImportDeclaration(s) &&
|
|
137
|
+
(s.moduleSpecifier as ts.StringLiteral).text === moduleSpecifier
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
if (importIndex === -1) return
|
|
141
|
+
|
|
142
|
+
const importDeclaration = statements[
|
|
143
|
+
importIndex
|
|
144
|
+
] as ts.ImportDeclaration
|
|
145
|
+
|
|
146
|
+
const updatedImportDeclaration = removeNamedImports(
|
|
147
|
+
factory,
|
|
148
|
+
importDeclaration,
|
|
149
|
+
importsToRemove.get(moduleSpecifier)!
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
if (updatedImportDeclaration === null) {
|
|
153
|
+
// Remove import statement as there are no more imports
|
|
154
|
+
statements.splice(importIndex, 1)
|
|
155
|
+
return
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Update import statement
|
|
159
|
+
statements[importIndex] = updatedImportDeclaration
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (importsToAdd) {
|
|
164
|
+
Array.from(importsToAdd.keys()).forEach(newModuleSpecifier => {
|
|
165
|
+
const importIndex = statements.findIndex(
|
|
166
|
+
s =>
|
|
167
|
+
ts.isImportDeclaration(s) &&
|
|
168
|
+
(s.moduleSpecifier as ts.StringLiteral).text === newModuleSpecifier
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
if (importIndex === -1) {
|
|
172
|
+
const fallbackKaioImportIdx = statements.findIndex(
|
|
173
|
+
s =>
|
|
174
|
+
ts.isImportDeclaration(s) &&
|
|
175
|
+
(s.moduleSpecifier as ts.StringLiteral).text.includes(
|
|
176
|
+
"@kaizen/components"
|
|
177
|
+
)
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
const newImport = createImportDeclaration(
|
|
181
|
+
factory,
|
|
182
|
+
importsToAdd.get(newModuleSpecifier)!,
|
|
183
|
+
newModuleSpecifier
|
|
184
|
+
)
|
|
185
|
+
statements.splice(fallbackKaioImportIdx + 1, 0, newImport)
|
|
186
|
+
return
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const importDeclaration = statements[
|
|
190
|
+
importIndex
|
|
191
|
+
] as ts.ImportDeclaration
|
|
192
|
+
|
|
193
|
+
const updatedImportDeclaration = updateNamedImports(
|
|
194
|
+
factory,
|
|
195
|
+
importDeclaration,
|
|
196
|
+
importsToAdd.get(newModuleSpecifier)!
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
// Update import statement
|
|
200
|
+
statements[importIndex] = updatedImportDeclaration
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return factory.updateSourceFile(rootNode, statements)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Transformer helpers to generate `importsToRemove` and `importsToAdd` for `updateKaioImports` */
|
|
208
|
+
export const setImportToRemove = (
|
|
209
|
+
map: ImportsToRemoveMap,
|
|
210
|
+
moduleSpecifier: string,
|
|
211
|
+
componentName: string
|
|
212
|
+
): void => {
|
|
213
|
+
if (!map.has(moduleSpecifier)) {
|
|
214
|
+
map.set(moduleSpecifier, new Set([componentName]))
|
|
215
|
+
}
|
|
216
|
+
map.get(moduleSpecifier)?.add(componentName)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export const setImportToAdd = (
|
|
220
|
+
map: ImportsToAddMap,
|
|
221
|
+
moduleSpecifier: string,
|
|
222
|
+
importAttributes: NewImportAttributes
|
|
223
|
+
): void => {
|
|
224
|
+
if (!map.has(moduleSpecifier)) {
|
|
225
|
+
map.set(
|
|
226
|
+
moduleSpecifier,
|
|
227
|
+
new Map([[importAttributes.componentName, importAttributes]])
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
map
|
|
231
|
+
.get(moduleSpecifier)
|
|
232
|
+
?.set(importAttributes.componentName, importAttributes)
|
|
233
|
+
}
|
|
@@ -4,8 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var reactTextfit = require('react-textfit');
|
|
7
|
-
require('../Icon/
|
|
8
|
-
var UserIcon = require('../Icon/UserIcon.cjs');
|
|
7
|
+
var Icon = require('../__future__/Icon/Icon.cjs');
|
|
9
8
|
var Avatar_module = require('./Avatar.module.scss.cjs');
|
|
10
9
|
function _interopDefault(e) {
|
|
11
10
|
return e && e.__esModule ? e : {
|
|
@@ -28,17 +27,21 @@ var getMaxFontSizePixels = function (size) {
|
|
|
28
27
|
if (size === "xlarge" || size === "xxlarge") return 34;
|
|
29
28
|
return 22;
|
|
30
29
|
};
|
|
31
|
-
var
|
|
30
|
+
var FallbackIcon = function (_a) {
|
|
31
|
+
var alt = _a.alt;
|
|
32
32
|
if (alt) {
|
|
33
|
-
return React__default.default.createElement(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
34
|
+
name: "person",
|
|
35
|
+
alt: alt,
|
|
36
|
+
isFilled: true,
|
|
37
|
+
className: Avatar_module.fallbackIcon
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
return React__default.default.createElement(
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
41
|
+
name: "person",
|
|
42
|
+
isPresentational: true,
|
|
43
|
+
isFilled: true,
|
|
44
|
+
className: Avatar_module.fallbackIcon
|
|
42
45
|
});
|
|
43
46
|
};
|
|
44
47
|
var renderInitials = function (fullName, alt, size, disableInitials) {
|
|
@@ -51,9 +54,9 @@ var renderInitials = function (fullName, alt, size, disableInitials) {
|
|
|
51
54
|
var initials = getInitials(fullName);
|
|
52
55
|
var isLongName = initials.length > 2 && size !== "small";
|
|
53
56
|
var renderFallback = disableInitials || initials === "";
|
|
54
|
-
return renderFallback ? React__default.default.createElement(
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
+
return renderFallback ? React__default.default.createElement(FallbackIcon, {
|
|
58
|
+
alt: alt
|
|
59
|
+
}) : React__default.default.createElement("abbr", {
|
|
57
60
|
className: classnames__default.default(Avatar_module.initials, isLongName && Avatar_module.longName),
|
|
58
61
|
title: alt
|
|
59
62
|
}, isLongName ?
|
|
@@ -4,9 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var locale = require('date-fns/locale');
|
|
6
6
|
var reactDayPicker = require('react-day-picker');
|
|
7
|
-
require('../../Icon/
|
|
8
|
-
var ArrowBackwardIcon = require('../../Icon/ArrowBackwardIcon.cjs');
|
|
9
|
-
var ArrowForwardIcon = require('../../Icon/ArrowForwardIcon.cjs');
|
|
7
|
+
var Icon = require('../../__future__/Icon/Icon.cjs');
|
|
10
8
|
var baseCalendarClassNames = require('../baseCalendarClassNames.cjs');
|
|
11
9
|
require('date-fns');
|
|
12
10
|
var isInvalidDate = require('../utils/isInvalidDate.cjs');
|
|
@@ -55,13 +53,17 @@ var CalendarRange = function (_a) {
|
|
|
55
53
|
classNames: classNames,
|
|
56
54
|
components: {
|
|
57
55
|
IconRight: function () {
|
|
58
|
-
return React__default.default.createElement(
|
|
59
|
-
|
|
56
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
57
|
+
name: "arrow_forward",
|
|
58
|
+
isPresentational: true,
|
|
59
|
+
shouldMirrorInRTL: true
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
IconLeft: function () {
|
|
63
|
-
return React__default.default.createElement(
|
|
64
|
-
|
|
63
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
64
|
+
name: "arrow_back",
|
|
65
|
+
isPresentational: true,
|
|
66
|
+
shouldMirrorInRTL: true
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
},
|
|
@@ -4,9 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var locale = require('date-fns/locale');
|
|
6
6
|
var reactDayPicker = require('react-day-picker');
|
|
7
|
-
require('../../Icon/
|
|
8
|
-
var ArrowBackwardIcon = require('../../Icon/ArrowBackwardIcon.cjs');
|
|
9
|
-
var ArrowForwardIcon = require('../../Icon/ArrowForwardIcon.cjs');
|
|
7
|
+
var Icon = require('../../__future__/Icon/Icon.cjs');
|
|
10
8
|
var baseCalendarClassNames = require('../baseCalendarClassNames.cjs');
|
|
11
9
|
require('date-fns');
|
|
12
10
|
var isInvalidDate = require('../utils/isInvalidDate.cjs');
|
|
@@ -52,13 +50,17 @@ var CalendarSingle = function (_a) {
|
|
|
52
50
|
classNames: classNames,
|
|
53
51
|
components: {
|
|
54
52
|
IconRight: function () {
|
|
55
|
-
return React__default.default.createElement(
|
|
56
|
-
|
|
53
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
54
|
+
name: "arrow_forward",
|
|
55
|
+
isPresentational: true,
|
|
56
|
+
shouldMirrorInRTL: true
|
|
57
57
|
});
|
|
58
58
|
},
|
|
59
59
|
IconLeft: function () {
|
|
60
|
-
return React__default.default.createElement(
|
|
61
|
-
|
|
60
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
61
|
+
name: "arrow_back",
|
|
62
|
+
isPresentational: true,
|
|
63
|
+
shouldMirrorInRTL: true
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
},
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactDayPicker = require('react-day-picker');
|
|
6
|
-
require('../../Icon/
|
|
7
|
-
var ArrowBackwardIcon = require('../../Icon/ArrowBackwardIcon.cjs');
|
|
8
|
-
var ArrowForwardIcon = require('../../Icon/ArrowForwardIcon.cjs');
|
|
6
|
+
var Icon = require('../../__future__/Icon/Icon.cjs');
|
|
9
7
|
var baseCalendarClassNames = require('../baseCalendarClassNames.cjs');
|
|
10
8
|
var enums = require('../enums.cjs');
|
|
11
9
|
require('date-fns');
|
|
@@ -50,13 +48,17 @@ var LegacyCalendarRange = function (_a) {
|
|
|
50
48
|
classNames: classNames,
|
|
51
49
|
components: {
|
|
52
50
|
IconRight: function () {
|
|
53
|
-
return React__default.default.createElement(
|
|
54
|
-
|
|
51
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
52
|
+
name: "arrow_forward",
|
|
53
|
+
isPresentational: true,
|
|
54
|
+
shouldMirrorInRTL: true
|
|
55
55
|
});
|
|
56
56
|
},
|
|
57
57
|
IconLeft: function () {
|
|
58
|
-
return React__default.default.createElement(
|
|
59
|
-
|
|
58
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
59
|
+
name: "arrow_back",
|
|
60
|
+
isPresentational: true,
|
|
61
|
+
shouldMirrorInRTL: true
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
},
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
|
-
require('../../Icon/
|
|
7
|
-
var CheckIcon = require('../../Icon/CheckIcon.cjs');
|
|
8
|
-
var MinusIcon = require('../../Icon/MinusIcon.cjs');
|
|
6
|
+
var Icon = require('../../__future__/Icon/Icon.cjs');
|
|
9
7
|
var Checkbox_module = require('./Checkbox.module.scss.cjs');
|
|
10
8
|
function _interopDefault(e) {
|
|
11
9
|
return e && e.__esModule ? e : {
|
|
@@ -16,15 +14,11 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
16
14
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
17
15
|
var renderCheckOrMixedIcon = function (status, reversed) {
|
|
18
16
|
if (status === "off") return;
|
|
19
|
-
return React__default.default.createElement(
|
|
17
|
+
return React__default.default.createElement(Icon.Icon, {
|
|
18
|
+
name: status === "on" ? "check" : "remove",
|
|
19
|
+
isPresentational: true,
|
|
20
20
|
className: classnames__default.default(Checkbox_module.icon, reversed && Checkbox_module.reversed)
|
|
21
|
-
}
|
|
22
|
-
role: "presentation",
|
|
23
|
-
inheritSize: true
|
|
24
|
-
}) : React__default.default.createElement(MinusIcon.MinusIcon, {
|
|
25
|
-
role: "presentation",
|
|
26
|
-
inheritSize: true
|
|
27
|
-
}));
|
|
21
|
+
});
|
|
28
22
|
};
|
|
29
23
|
var getCheckedFromStatus = function (checkedStatus) {
|
|
30
24
|
return checkedStatus === "on";
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
|
-
require('../Icon/
|
|
7
|
-
var ClearIcon = require('../Icon/ClearIcon.cjs');
|
|
6
|
+
var Icon = require('../__future__/Icon/Icon.cjs');
|
|
8
7
|
var ClearButton_module = require('./ClearButton.module.scss.cjs');
|
|
9
8
|
function _interopDefault(e) {
|
|
10
9
|
return e && e.__esModule ? e : {
|
|
@@ -22,8 +21,10 @@ var ClearButton = function (_a) {
|
|
|
22
21
|
type: "button",
|
|
23
22
|
"aria-label": "clear",
|
|
24
23
|
className: classnames__default.default(ClearButton_module.clearButton, isReversed ? ClearButton_module.reversed : ClearButton_module.default, classNameOverride)
|
|
25
|
-
}, restProps), React__default.default.createElement(
|
|
26
|
-
|
|
24
|
+
}, restProps), React__default.default.createElement(Icon.Icon, {
|
|
25
|
+
name: "cancel",
|
|
26
|
+
isPresentational: true,
|
|
27
|
+
isFilled: true
|
|
27
28
|
}));
|
|
28
29
|
};
|
|
29
30
|
ClearButton.displayName = "ClearButton";
|
|
@@ -5,9 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var AnimateHeight = require('react-animate-height');
|
|
7
7
|
var Heading = require('../../Heading/Heading.cjs');
|
|
8
|
-
require('../../Icon/
|
|
9
|
-
var ChevronDownIcon = require('../../Icon/ChevronDownIcon.cjs');
|
|
10
|
-
var ChevronUpIcon = require('../../Icon/ChevronUpIcon.cjs');
|
|
8
|
+
var Icon = require('../../__future__/Icon/Icon.cjs');
|
|
11
9
|
var Collapsible_module = require('./Collapsible.module.scss.cjs');
|
|
12
10
|
var IconButton = require('../../__actions__/Button/v1/IconButton/IconButton.cjs');
|
|
13
11
|
function _interopDefault(e) {
|
|
@@ -74,10 +72,9 @@ var Collapsible = function (_a) {
|
|
|
74
72
|
tag: "span"
|
|
75
73
|
}, title)), React__default.default.createElement("div", null, React__default.default.createElement(IconButton.IconButton, {
|
|
76
74
|
label: title,
|
|
77
|
-
icon:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
role: "presentation"
|
|
75
|
+
icon: React__default.default.createElement(Icon.Icon, {
|
|
76
|
+
name: isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
77
|
+
isPresentational: true
|
|
81
78
|
}),
|
|
82
79
|
type: "button",
|
|
83
80
|
"aria-expanded": isOpen,
|