@kaizen/components 1.57.1 → 1.58.0
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 +39 -0
- package/codemods/README.md +31 -0
- package/codemods/__tests__/utils/index.ts +1 -0
- package/codemods/__tests__/utils/parseJsx.ts +11 -0
- package/codemods/migrateBrandMomentMoodToVariant/index.ts +21 -0
- package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.spec.ts +44 -0
- package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.ts +24 -0
- package/codemods/migrateCardVariantToColor/index.ts +15 -0
- package/codemods/migrateCardVariantToColor/transformCardVariantToColor.spec.ts +91 -0
- package/codemods/migrateCardVariantToColor/transformCardVariantToColor.ts +32 -0
- package/codemods/migrateConfirmationModalMoodsToVariant/index.ts +19 -0
- package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.spec.ts +110 -0
- package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.ts +59 -0
- package/codemods/migrateEmptyStateIllustrationTypeToVariant/index.ts +21 -0
- package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.spec.ts +74 -0
- package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.ts +28 -0
- package/codemods/migrateGlobalNotificationTypeToVariant/index.ts +19 -0
- package/codemods/migrateInformationTileMoodToVariant/index.ts +21 -0
- package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.spec.ts +84 -0
- package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.ts +22 -0
- package/codemods/migrateInlineNotificationTypeToVariant/index.ts +19 -0
- package/codemods/migrateMultiActionTileMoodToVariant/index.ts +21 -0
- package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.spec.ts +84 -0
- package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.ts +22 -0
- package/codemods/migrateNotificationTypeToVariant/index.ts +1 -0
- package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.spec.ts +107 -0
- package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.ts +28 -0
- package/codemods/migrateProgressBarMoodToColor/index.ts +21 -0
- package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.spec.ts +54 -0
- package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.ts +26 -0
- package/codemods/migrateToastNotificationTypeToVariant/index.ts +19 -0
- package/codemods/migrateWellVariantToColor/index.ts +15 -0
- package/codemods/migrateWellVariantToColor/transformWellVariantToColor.spec.ts +192 -0
- package/codemods/migrateWellVariantToColor/transformWellVariantToColor.ts +75 -0
- package/codemods/removeInputEditModalMood/index.ts +19 -0
- package/codemods/removeInputEditModalMood/removeInputEditModalMood.spec.ts +80 -0
- package/codemods/removeInputEditModalMood/removeInputEditModalMood.ts +40 -0
- package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.spec.ts +118 -0
- package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.ts +64 -0
- package/codemods/utils/__fixtures__/KaioComponent.tsx +6 -0
- package/codemods/utils/__snapshots__/transformSource.spec.ts.snap +11 -0
- package/codemods/utils/getPropValueText.spec.ts +75 -0
- package/codemods/utils/getPropValueText.ts +21 -0
- package/codemods/utils/getTagName.spec.ts +24 -0
- package/codemods/utils/getTagName.ts +32 -0
- package/codemods/utils/index.ts +7 -0
- package/codemods/utils/migrateStringProp.spec.ts +129 -0
- package/codemods/utils/migrateStringProp.ts +43 -0
- package/codemods/utils/printAst.ts +6 -0
- package/codemods/utils/transformComponentsInDir.ts +42 -0
- package/codemods/utils/transformSource.spec.ts +56 -0
- package/codemods/utils/transformSource.ts +25 -0
- package/codemods/utils/updateJsxElementWithNewProps.spec.ts +67 -0
- package/codemods/utils/updateJsxElementWithNewProps.ts +24 -0
- package/dist/cjs/BrandMoment/BrandMoment.cjs +3 -2
- package/dist/cjs/BrandMoment/BrandMoment.module.scss.cjs +3 -1
- package/dist/cjs/Card/Card.cjs +7 -6
- package/dist/cjs/Card/Card.module.scss.cjs +10 -2
- package/dist/cjs/EmptyState/EmptyState.cjs +14 -6
- package/dist/cjs/EmptyState/EmptyState.module.scss.cjs +3 -0
- package/dist/cjs/ErrorPage/ErrorPage.cjs +1 -1
- package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +9 -5
- package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.module.scss.cjs +6 -2
- package/dist/cjs/Notification/ToastNotification/ToastNotification/ToastNotification.cjs +1 -3
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs +1 -3
- package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.cjs +6 -3
- package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +5 -3
- package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +35 -3
- package/dist/cjs/ProgressBar/ProgressBar.cjs +3 -2
- package/dist/cjs/ProgressBar/ProgressBar.module.scss.cjs +8 -4
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +7 -5
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.module.scss.cjs +8 -6
- package/dist/cjs/Well/Well.cjs +5 -4
- package/dist/cjs/Well/Well.module.scss.cjs +9 -1
- package/dist/cjs/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.cjs +6 -6
- package/dist/cjs/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.cjs +33 -0
- package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.cjs +160 -0
- package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.cjs +28 -0
- package/dist/cjs/containersV1.cjs +4 -0
- package/dist/cjs/containersV2.cjs +4 -0
- package/dist/cjs/index.cjs +2 -2
- package/dist/esm/BrandMoment/BrandMoment.mjs +3 -2
- package/dist/esm/BrandMoment/BrandMoment.module.scss.mjs +3 -1
- package/dist/esm/Card/Card.mjs +7 -6
- package/dist/esm/Card/Card.module.scss.mjs +10 -2
- package/dist/esm/EmptyState/EmptyState.mjs +15 -7
- package/dist/esm/EmptyState/EmptyState.module.scss.mjs +3 -0
- package/dist/esm/ErrorPage/ErrorPage.mjs +1 -1
- package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +9 -5
- package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.module.scss.mjs +6 -2
- package/dist/esm/Notification/ToastNotification/ToastNotification/ToastNotification.mjs +1 -3
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.mjs +1 -3
- package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.mjs +8 -5
- package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +5 -3
- package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +39 -5
- package/dist/esm/ProgressBar/ProgressBar.mjs +3 -2
- package/dist/esm/ProgressBar/ProgressBar.module.scss.mjs +8 -4
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +7 -5
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.module.scss.mjs +8 -6
- package/dist/esm/Well/Well.mjs +5 -4
- package/dist/esm/Well/Well.module.scss.mjs +9 -1
- package/dist/esm/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.mjs +6 -6
- package/dist/esm/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.mjs +31 -0
- package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.mjs +153 -0
- package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.mjs +26 -0
- package/dist/esm/containersV1.mjs +1 -0
- package/dist/esm/containersV2.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/styles.css +13 -12
- package/dist/types/BrandMoment/BrandMoment.d.ts +19 -3
- package/dist/types/Card/Card.d.ts +20 -7
- package/dist/types/EmptyState/EmptyState.d.ts +14 -6
- package/dist/types/Modal/ConfirmationModal/ConfirmationModal.d.ts +25 -7
- package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +3 -0
- package/dist/types/Modal/InputEditModal/InputEditModal.d.ts +4 -1
- package/dist/types/Notification/GlobalNotification/GlobalNotification.d.ts +3 -3
- package/dist/types/Notification/InlineNotification/InlineNotification.d.ts +3 -3
- package/dist/types/Notification/ToastNotification/ToastNotification/ToastNotification.d.ts +5 -4
- package/dist/types/Notification/ToastNotification/context/ToastNotificationContext.d.ts +4 -3
- package/dist/types/Notification/ToastNotification/types.d.ts +3 -3
- package/dist/types/Notification/subcomponents/GenericNotification/GenericNotification.d.ts +24 -4
- package/dist/types/Notification/subcomponents/NotificationIcon/NotificationIcon.d.ts +11 -4
- package/dist/types/Notification/types.d.ts +2 -1
- package/dist/types/ProgressBar/ProgressBar.d.ts +25 -6
- package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +10 -3
- package/dist/types/Well/Well.d.ts +6 -2
- package/dist/types/Well/types.d.ts +4 -0
- package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.d.ts +4 -4
- package/dist/types/__containers__/GuidanceBlock/v2/GuidanceBlock.d.ts +59 -0
- package/dist/types/__containers__/GuidanceBlock/v2/index.d.ts +1 -0
- package/dist/types/__containers__/v1.d.ts +1 -0
- package/dist/types/__containers__/v2.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +19 -5
- package/src/BrandMoment/BrandMoment.module.scss +20 -9
- package/src/BrandMoment/BrandMoment.tsx +26 -3
- package/src/BrandMoment/_docs/BrandMoment.mdx +13 -13
- package/src/BrandMoment/_docs/BrandMoment.stickersheet.stories.tsx +102 -0
- package/src/BrandMoment/_docs/BrandMoment.stories.tsx +17 -99
- package/src/Card/Card.module.scss +56 -7
- package/src/Card/Card.tsx +35 -11
- package/src/Card/_docs/Card.mdx +6 -3
- package/src/Card/_docs/Card.stickersheet.stories.tsx +44 -39
- package/src/Card/_docs/Card.stories.tsx +23 -23
- package/src/EmptyState/EmptyState.module.scss +32 -14
- package/src/EmptyState/EmptyState.tsx +32 -18
- package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +69 -121
- package/src/EmptyState/_docs/EmptyState.stories.tsx +6 -8
- package/src/ErrorPage/ErrorPage.tsx +1 -1
- package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +100 -78
- package/src/Modal/ConfirmationModal/ConfirmationModal.spec.tsx +5 -5
- package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +41 -10
- package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +3 -3
- package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.stories.tsx +11 -4
- package/src/Modal/ContextModal/_docs/ContextModal.stories.tsx +3 -1
- package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +3 -0
- package/src/Modal/InputEditModal/InputEditModal.tsx +4 -1
- package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +0 -13
- package/src/Modal/InputEditModal/_docs/InputEditModal.stories.tsx +9 -10
- package/src/Notification/GlobalNotification/GlobalNotification.tsx +9 -4
- package/src/Notification/GlobalNotification/_docs/GlobalNotification.stickersheet.stories.tsx +68 -58
- package/src/Notification/GlobalNotification/_docs/GlobalNotification.stories.tsx +10 -13
- package/src/Notification/InlineNotification/InlineNotification.tsx +9 -4
- package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +79 -44
- package/src/Notification/InlineNotification/_docs/InlineNotification.stories.tsx +17 -17
- package/src/Notification/ToastNotification/ToastNotification/ToastNotification.tsx +7 -5
- package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx +1 -2
- package/src/Notification/ToastNotification/_docs/ToastNotification.stickersheet.stories.tsx +12 -7
- package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +6 -1
- package/src/Notification/ToastNotification/context/ToastNotificationContext.tsx +7 -3
- package/src/Notification/ToastNotification/types.ts +8 -3
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +42 -5
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +40 -6
- package/src/Notification/subcomponents/GenericNotification/_mixins.scss +2 -1
- package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +31 -5
- package/src/Notification/types.ts +9 -2
- package/src/ProgressBar/ProgressBar.module.scss +37 -25
- package/src/ProgressBar/ProgressBar.tsx +30 -5
- package/src/ProgressBar/_docs/ProgressBar.mdx +2 -3
- package/src/ProgressBar/_docs/ProgressBar.stickersheet.stories.tsx +95 -51
- package/src/ProgressBar/_docs/ProgressBar.stories.tsx +56 -25
- package/src/Tile/InformationTile/_docs/InformationTile.mdx +3 -2
- package/src/Tile/InformationTile/_docs/InformationTile.stickersheet.stories.tsx +57 -19
- package/src/Tile/InformationTile/_docs/InformationTile.stories.tsx +19 -7
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +3 -2
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.stickersheet.stories.tsx +62 -24
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.stories.tsx +19 -7
- package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +34 -22
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -8
- package/src/Tile/subcomponents/GenericTile/_docs/GenericTile.stickersheet.stories.tsx +57 -19
- package/src/Well/Well.module.scss +70 -33
- package/src/Well/Well.tsx +9 -3
- package/src/Well/_docs/Well.mdx +9 -2
- package/src/Well/_docs/Well.stickersheet.stories.tsx +10 -1
- package/src/Well/_docs/Well.stories.tsx +54 -29
- package/src/Well/types.ts +15 -0
- package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +1 -1
- package/src/__actions__/Menu/v3/MenuItem.module.scss +1 -0
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.module.scss +2 -2
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.mdx +2 -2
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stickersheet.stories.tsx +1 -1
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stories.tsx +1 -1
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss +356 -0
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.spec.tsx +82 -0
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.tsx +262 -0
- package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.mdx +38 -0
- package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stickersheet.stories.tsx +118 -0
- package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stories.tsx +152 -0
- package/src/__containers__/GuidanceBlock/v2/index.ts +1 -0
- package/src/__containers__/v1.ts +1 -0
- package/src/__containers__/v2.ts +1 -0
- package/src/index.ts +2 -1
- package/v1/containers/package.json +5 -0
- package/v2/containers/package.json +5 -0
- package/dist/cjs/GuidanceBlock/GuidanceBlock.module.scss.cjs +0 -33
- package/dist/esm/GuidanceBlock/GuidanceBlock.module.scss.mjs +0 -31
- package/dist/types/Tile/subcomponents/GenericTile/types.d.ts +0 -2
- package/src/EmptyState/_docs/EmptyState.stories.module.scss +0 -15
- package/src/Notification/ToastNotification/ToastNotification/ToastNotification.spec.tsx +0 -33
- package/src/Tile/subcomponents/GenericTile/types.ts +0 -10
- /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.d.ts +0 -0
- /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.d.ts +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.spec.tsx +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.tsx +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.ts +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.ts +0 -0
|
@@ -3,7 +3,7 @@ import { Meta, StoryObj } from "@storybook/react"
|
|
|
3
3
|
import { Heading } from "~components/Heading"
|
|
4
4
|
import { Text } from "~components/Text"
|
|
5
5
|
import { Well } from "../index"
|
|
6
|
-
import { borderStyleTypes
|
|
6
|
+
import { borderStyleTypes } from "../types"
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
9
|
title: "Components/Well",
|
|
@@ -20,6 +20,9 @@ const meta = {
|
|
|
20
20
|
},
|
|
21
21
|
argTypes: {
|
|
22
22
|
children: { control: false },
|
|
23
|
+
variant: {
|
|
24
|
+
control: false,
|
|
25
|
+
},
|
|
23
26
|
},
|
|
24
27
|
} satisfies Meta<typeof Well>
|
|
25
28
|
|
|
@@ -37,17 +40,41 @@ export const Playground: Story = {
|
|
|
37
40
|
},
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
export const
|
|
43
|
+
export const Colors: Story = {
|
|
41
44
|
render: args => (
|
|
42
45
|
<>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
47
|
+
`white` is the new default when no color/variant is defined
|
|
48
|
+
</Heading>
|
|
49
|
+
<Well {...args} />
|
|
50
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
51
|
+
`gray` is the accessible version of the former `default` variant
|
|
52
|
+
</Heading>
|
|
53
|
+
<Well {...args} color="gray" />
|
|
54
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
55
|
+
`blue` replaces the `informative` variant
|
|
56
|
+
</Heading>
|
|
57
|
+
<Well {...args} color="blue" />
|
|
58
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
59
|
+
`yellow` replaces the `cautionary` variant
|
|
60
|
+
</Heading>
|
|
61
|
+
<Well {...args} color="yellow" />
|
|
62
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
63
|
+
`orange` replaces the `assertive` variant
|
|
64
|
+
</Heading>
|
|
65
|
+
<Well {...args} color="orange" />
|
|
66
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
67
|
+
`red` replaces the `negative` variant
|
|
68
|
+
</Heading>
|
|
69
|
+
<Well {...args} color="red" />
|
|
70
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
71
|
+
`green` replaces the `positive` variant
|
|
72
|
+
</Heading>
|
|
73
|
+
<Well {...args} color="green" />
|
|
74
|
+
<Heading tag="h4" variant="heading-6" classNameOverride="mb-12">
|
|
75
|
+
`purple` replaces the `prominent` variant
|
|
76
|
+
</Heading>
|
|
77
|
+
<Well {...args} color="purple" />
|
|
51
78
|
</>
|
|
52
79
|
),
|
|
53
80
|
}
|
|
@@ -57,10 +84,10 @@ export const BorderStyles: Story = {
|
|
|
57
84
|
<>
|
|
58
85
|
{borderStyleTypes.map(border => (
|
|
59
86
|
<>
|
|
60
|
-
<Heading tag="
|
|
87
|
+
<Heading tag="h4" variant="heading-6">
|
|
61
88
|
{border}
|
|
62
89
|
</Heading>
|
|
63
|
-
<Well borderStyle={border}
|
|
90
|
+
<Well {...args} borderStyle={border} />
|
|
64
91
|
</>
|
|
65
92
|
))}
|
|
66
93
|
</>
|
|
@@ -69,23 +96,21 @@ export const BorderStyles: Story = {
|
|
|
69
96
|
|
|
70
97
|
export const NoMargin: Story = {
|
|
71
98
|
render: args => (
|
|
72
|
-
|
|
73
|
-
<div
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<Well {...args} />
|
|
80
|
-
</div>
|
|
81
|
-
<div>
|
|
82
|
-
<Heading tag="h3" variant="heading-6">
|
|
83
|
-
noMargin
|
|
84
|
-
</Heading>
|
|
85
|
-
<Well noMargin {...args} />
|
|
86
|
-
<Well {...args} />
|
|
87
|
-
</div>
|
|
99
|
+
<div className="flex gap-16">
|
|
100
|
+
<div>
|
|
101
|
+
<Heading tag="h4" variant="heading-6">
|
|
102
|
+
Margin (default)
|
|
103
|
+
</Heading>
|
|
104
|
+
<Well {...args} />
|
|
105
|
+
<Well {...args} />
|
|
88
106
|
</div>
|
|
89
|
-
|
|
107
|
+
<div>
|
|
108
|
+
<Heading tag="h4" variant="heading-6">
|
|
109
|
+
noMargin
|
|
110
|
+
</Heading>
|
|
111
|
+
<Well {...args} noMargin />
|
|
112
|
+
<Well {...args} />
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
90
115
|
),
|
|
91
116
|
}
|
package/src/Well/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @deprecated */
|
|
1
2
|
export const variantTypes = [
|
|
2
3
|
"positive",
|
|
3
4
|
"negative",
|
|
@@ -8,8 +9,22 @@ export const variantTypes = [
|
|
|
8
9
|
"prominent",
|
|
9
10
|
] as const
|
|
10
11
|
|
|
12
|
+
/** @deprecated use `WellColors` and `color` prop instead */
|
|
11
13
|
export type WellVariantType = (typeof variantTypes)[number]
|
|
12
14
|
|
|
15
|
+
export const wellColors = [
|
|
16
|
+
"white",
|
|
17
|
+
"gray",
|
|
18
|
+
"blue",
|
|
19
|
+
"yellow",
|
|
20
|
+
"orange",
|
|
21
|
+
"red",
|
|
22
|
+
"green",
|
|
23
|
+
"purple",
|
|
24
|
+
] as const
|
|
25
|
+
|
|
26
|
+
export type WellColors = (typeof wellColors)[number]
|
|
27
|
+
|
|
13
28
|
export const borderStyleTypes = ["solid", "dashed", "none"] as const
|
|
14
29
|
|
|
15
30
|
export type WellBorderStyleType = (typeof borderStyleTypes)[number]
|
|
@@ -3,7 +3,7 @@ import { ResourceLinks, SbContent, KAIOInstallation } from "~storybook/component
|
|
|
3
3
|
import * as docsStories from "./Button.docs.stories"
|
|
4
4
|
import * as exampleStories from "./Button.stories"
|
|
5
5
|
|
|
6
|
-
<Meta title="Actions/Button/v3/API
|
|
6
|
+
<Meta title="Actions/Button/v3/API Specification" />
|
|
7
7
|
|
|
8
8
|
<SbContent>
|
|
9
9
|
# Button API Specification (v3)
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@import "~@kaizen/design-tokens/sass/color";
|
|
5
5
|
@import "~@kaizen/design-tokens/sass/animation";
|
|
6
6
|
@import "~@kaizen/design-tokens/sass/spacing";
|
|
7
|
-
@import "
|
|
8
|
-
@import "
|
|
7
|
+
@import "../../../../styles/utils/responsive";
|
|
8
|
+
@import "../../../../styles/utils/button-reset";
|
|
9
9
|
|
|
10
10
|
@mixin guidance-block-under-480 {
|
|
11
11
|
@media (max-width: 480px) {
|
|
@@ -4,7 +4,7 @@ import * as GuidanceBlockStories from "./GuidanceBlock.stories"
|
|
|
4
4
|
|
|
5
5
|
<Meta of={GuidanceBlockStories} />
|
|
6
6
|
|
|
7
|
-
# GuidanceBlock
|
|
7
|
+
# GuidanceBlock (V1)
|
|
8
8
|
|
|
9
9
|
<ResourceLinks
|
|
10
10
|
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/GuidanceBlock"
|
|
@@ -13,7 +13,7 @@ import * as GuidanceBlockStories from "./GuidanceBlock.stories"
|
|
|
13
13
|
|
|
14
14
|
/>
|
|
15
15
|
|
|
16
|
-
<KAIOInstallation exportNames="GuidanceBlock" />
|
|
16
|
+
<KAIOInstallation exportNames="GuidanceBlock" version="1" family="containers" />
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
@@ -12,7 +12,7 @@ import { GuidanceBlock, GuidanceBlockProps } from "../index"
|
|
|
12
12
|
import { variantsMap } from "../types"
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
title: "
|
|
15
|
+
title: "Containers/GuidanceBlock/v1",
|
|
16
16
|
parameters: {
|
|
17
17
|
chromatic: { disable: false },
|
|
18
18
|
controls: { disable: true },
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
@import "~@kaizen/design-tokens/sass/shadow";
|
|
2
|
+
@import "~@kaizen/design-tokens/sass/border";
|
|
3
|
+
@import "~@kaizen/design-tokens/sass/layout";
|
|
4
|
+
@import "~@kaizen/design-tokens/sass/color";
|
|
5
|
+
@import "~@kaizen/design-tokens/sass/animation";
|
|
6
|
+
@import "~@kaizen/design-tokens/sass/spacing";
|
|
7
|
+
@import "../../../../styles/utils/responsive";
|
|
8
|
+
@import "../../../../styles/utils/button-reset";
|
|
9
|
+
|
|
10
|
+
@mixin guidance-block-under-480 {
|
|
11
|
+
@media (max-width: 480px) {
|
|
12
|
+
@content;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$bannerPadding: $spacing-lg;
|
|
17
|
+
$ca-banner-fade-out: opacity $animation-duration-slow ease;
|
|
18
|
+
$ca-banner-collapse-height-delayed: margin-top $animation-duration-fast
|
|
19
|
+
$animation-duration-slow ease;
|
|
20
|
+
$illustration-size: 155px;
|
|
21
|
+
$scene-illustration-size: 300px;
|
|
22
|
+
|
|
23
|
+
.rightMargin {
|
|
24
|
+
margin-right: $spacing-8;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.noRightMargin {
|
|
28
|
+
margin-right: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.banner.noMaxWidth {
|
|
32
|
+
max-width: inherit;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.banner {
|
|
36
|
+
--border-width: var(--border-width-1);
|
|
37
|
+
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: $spacing-sm;
|
|
41
|
+
min-width: 320px;
|
|
42
|
+
max-width: $layout-breakpoints-large;
|
|
43
|
+
border: var(--border-width) var(--border-solid-border-style);
|
|
44
|
+
border-radius: $border-solid-border-radius;
|
|
45
|
+
padding: calc(#{$bannerPadding} - var(--border-width));
|
|
46
|
+
box-shadow: $shadow-small-box-shadow;
|
|
47
|
+
position: relative;
|
|
48
|
+
top: -1px;
|
|
49
|
+
transition: $ca-banner-fade-out, $ca-banner-collapse-height-delayed;
|
|
50
|
+
color: $color-purple-800;
|
|
51
|
+
|
|
52
|
+
@include ca-media-desktop {
|
|
53
|
+
min-height: calc(12rem - calc(#{$bannerPadding} * 2));
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
gap: $spacing-md;
|
|
56
|
+
width: auto;
|
|
57
|
+
align-items: center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@include ca-media-mobile {
|
|
61
|
+
min-width: unset;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.illustrationWrapper {
|
|
66
|
+
display: flex;
|
|
67
|
+
|
|
68
|
+
@include ca-media-tablet {
|
|
69
|
+
text-align: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-self: center;
|
|
72
|
+
padding: $spacing-sm;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include ca-media-mobile {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.illustration {
|
|
81
|
+
width: $illustration-size;
|
|
82
|
+
height: $illustration-size;
|
|
83
|
+
|
|
84
|
+
// This has been created to handle scene illustrations consistently until the tile component is created
|
|
85
|
+
.hasSceneIllustration & {
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
max-width: $scene-illustration-size;
|
|
89
|
+
max-height: $scene-illustration-size;
|
|
90
|
+
width: $scene-illustration-size;
|
|
91
|
+
height: auto;
|
|
92
|
+
|
|
93
|
+
figure {
|
|
94
|
+
max-height: 100%;
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
aspect-ratio: 4/3;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
img {
|
|
100
|
+
height: 100%;
|
|
101
|
+
object-fit: contain;
|
|
102
|
+
object-position: center;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.descriptionContainer {
|
|
108
|
+
flex: 1;
|
|
109
|
+
text-align: center;
|
|
110
|
+
align-self: center;
|
|
111
|
+
max-width: 780px;
|
|
112
|
+
|
|
113
|
+
@include ca-media-desktop {
|
|
114
|
+
padding: 0 $spacing-sm;
|
|
115
|
+
text-align: left;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@include ca-media-mobile {
|
|
119
|
+
margin: $spacing-sm;
|
|
120
|
+
max-width: 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[dir="rtl"] & {
|
|
124
|
+
@include ca-media-desktop {
|
|
125
|
+
padding: 0 $spacing-sm;
|
|
126
|
+
text-align: right;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.descriptionAndActions {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex: 1;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: space-between;
|
|
136
|
+
gap: $spacing-md;
|
|
137
|
+
|
|
138
|
+
@include ca-media-tablet-and-under {
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
width: 100%;
|
|
141
|
+
align-items: unset;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.buttonContainer {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex: 1 0 auto;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
flex-direction: row-reverse;
|
|
150
|
+
gap: $spacing-sm;
|
|
151
|
+
min-width: max-content;
|
|
152
|
+
|
|
153
|
+
@include ca-media-tablet-and-up {
|
|
154
|
+
text-align: center;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@include ca-media-mobile {
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
width: 100%;
|
|
160
|
+
margin-top: $spacing-xs;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[dir="rtl"] & svg {
|
|
164
|
+
transform: rotate(180deg);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.hidden {
|
|
169
|
+
opacity: 0%;
|
|
170
|
+
margin-bottom: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.headingWrapper {
|
|
174
|
+
margin-bottom: $spacing-md;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.cancel {
|
|
178
|
+
@include button-reset;
|
|
179
|
+
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
|
|
182
|
+
.icon {
|
|
183
|
+
opacity: 70%;
|
|
184
|
+
transition: $animation-duration-fast opacity;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&:disabled,
|
|
188
|
+
&.disabled {
|
|
189
|
+
.icon {
|
|
190
|
+
opacity: 30%;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&:not(:disabled, .disabled) {
|
|
195
|
+
&:hover,
|
|
196
|
+
&:focus,
|
|
197
|
+
&.hover {
|
|
198
|
+
.icon {
|
|
199
|
+
opacity: 100%;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&:active,
|
|
204
|
+
&.active {
|
|
205
|
+
.icon {
|
|
206
|
+
opacity: 100%;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: $spacing-sm;
|
|
213
|
+
right: $spacing-sm;
|
|
214
|
+
color: $color-purple-800;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.default {
|
|
218
|
+
border-color: var(--color-gray-500);
|
|
219
|
+
background: var(--color-white);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.expert-advice {
|
|
223
|
+
border-color: var(--color-purple-400);
|
|
224
|
+
background: $color-purple-100;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.inline,
|
|
228
|
+
.stacked {
|
|
229
|
+
flex-flow: row wrap;
|
|
230
|
+
align-items: unset;
|
|
231
|
+
gap: $spacing-md;
|
|
232
|
+
min-width: unset;
|
|
233
|
+
|
|
234
|
+
@include ca-media-tablet-and-under {
|
|
235
|
+
flex-direction: unset;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.illustrationWrapper {
|
|
239
|
+
margin-right: $spacing-sm;
|
|
240
|
+
|
|
241
|
+
[dir="rtl"] & {
|
|
242
|
+
margin-left: $spacing-sm;
|
|
243
|
+
margin-right: inherit;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@include ca-media-tablet {
|
|
247
|
+
padding: 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@include ca-media-mobile {
|
|
251
|
+
display: flex;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.descriptionAndActions {
|
|
256
|
+
margin: auto 0;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.descriptionContainer {
|
|
260
|
+
text-align: left;
|
|
261
|
+
max-width: unset;
|
|
262
|
+
min-width: 320px;
|
|
263
|
+
|
|
264
|
+
@include ca-media-desktop {
|
|
265
|
+
padding: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@include ca-media-mobile {
|
|
269
|
+
margin: 0;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
[dir="rtl"] & {
|
|
273
|
+
text-align: right;
|
|
274
|
+
|
|
275
|
+
@include ca-media-desktop {
|
|
276
|
+
padding: 0;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.buttonContainer {
|
|
282
|
+
padding-left: $spacing-sm;
|
|
283
|
+
justify-content: flex-start;
|
|
284
|
+
width: unset;
|
|
285
|
+
min-width: unset;
|
|
286
|
+
|
|
287
|
+
@include ca-media-mobile {
|
|
288
|
+
flex-direction: row-reverse;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
[dir="rtl"] & {
|
|
292
|
+
padding-left: 0;
|
|
293
|
+
padding-right: $spacing-sm;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
> * {
|
|
297
|
+
width: unset;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
&.hasSceneIllustration {
|
|
302
|
+
justify-content: center;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
&.centerContent {
|
|
306
|
+
flex-direction: column;
|
|
307
|
+
|
|
308
|
+
&.hasSceneIllustration .illustration {
|
|
309
|
+
width: 100%;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.illustrationWrapper {
|
|
313
|
+
margin: 0 auto;
|
|
314
|
+
align-self: center;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.descriptionContainer {
|
|
318
|
+
text-align: center;
|
|
319
|
+
min-width: unset;
|
|
320
|
+
|
|
321
|
+
[dir="rtl"] & {
|
|
322
|
+
text-align: center;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.buttonContainer {
|
|
327
|
+
padding: 0;
|
|
328
|
+
flex-direction: column;
|
|
329
|
+
min-width: unset;
|
|
330
|
+
justify-content: center;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
&.centerContent.smallScreenTextAlignment {
|
|
335
|
+
.descriptionContainer {
|
|
336
|
+
text-align: left;
|
|
337
|
+
|
|
338
|
+
[dir="rtl"] & {
|
|
339
|
+
text-align: right;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* stylelint-disable no-descending-specificity */
|
|
346
|
+
.stacked {
|
|
347
|
+
.descriptionAndActions {
|
|
348
|
+
flex-direction: column;
|
|
349
|
+
align-items: unset;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.descriptionContainer {
|
|
353
|
+
align-self: flex-start;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/* stylelint-enable no-descending-specificity */
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { cleanup, render, waitFor } from "@testing-library/react"
|
|
3
|
+
import userEvent from "@testing-library/user-event"
|
|
4
|
+
import { Informative } from "~components/Illustration"
|
|
5
|
+
import { GuidanceBlock } from "./GuidanceBlock"
|
|
6
|
+
|
|
7
|
+
const user = userEvent.setup()
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
|
10
|
+
window.matchMedia = jest.fn().mockImplementation(() => ({
|
|
11
|
+
matches: false,
|
|
12
|
+
media: "",
|
|
13
|
+
onchange: null,
|
|
14
|
+
addListener: jest.fn(),
|
|
15
|
+
removeListener: jest.fn(),
|
|
16
|
+
}))
|
|
17
|
+
|
|
18
|
+
describe("GuidanceBlock", () => {
|
|
19
|
+
afterEach(cleanup)
|
|
20
|
+
|
|
21
|
+
it("calls the action function when action button is clicked", async () => {
|
|
22
|
+
const onAction = jest.fn()
|
|
23
|
+
const { container } = render(
|
|
24
|
+
<GuidanceBlock
|
|
25
|
+
illustration={<Informative alt="" />}
|
|
26
|
+
text={{
|
|
27
|
+
title: "This is the call to action title",
|
|
28
|
+
description:
|
|
29
|
+
"Mussum Ipsum, cacilds vidis litro abertis. Suco de cevadiss, é um leite divinis.",
|
|
30
|
+
}}
|
|
31
|
+
actions={{
|
|
32
|
+
primary: { label: "Action!", onClick: onAction },
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
const actionButton = container.querySelector("button")
|
|
37
|
+
actionButton && (await user.click(actionButton))
|
|
38
|
+
|
|
39
|
+
await waitFor(() => {
|
|
40
|
+
expect(onAction).toHaveBeenCalledTimes(1)
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it("has a default title tag of h3", () => {
|
|
45
|
+
const { getByRole } = render(
|
|
46
|
+
<GuidanceBlock
|
|
47
|
+
illustration={<Informative alt="" />}
|
|
48
|
+
text={{
|
|
49
|
+
title: "This is the call to action title",
|
|
50
|
+
description:
|
|
51
|
+
"Mussum Ipsum, cacilds vidis litro abertis. Suco de cevadiss, é um leite divinis.",
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
expect(
|
|
56
|
+
getByRole("heading", {
|
|
57
|
+
level: 3,
|
|
58
|
+
name: "This is the call to action title",
|
|
59
|
+
})
|
|
60
|
+
).toBeInTheDocument()
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it("can allow the user to override the title tag", () => {
|
|
64
|
+
const { getByRole } = render(
|
|
65
|
+
<GuidanceBlock
|
|
66
|
+
illustration={<Informative alt="" />}
|
|
67
|
+
text={{
|
|
68
|
+
title: "This is the call to action title",
|
|
69
|
+
description:
|
|
70
|
+
"Mussum Ipsum, cacilds vidis litro abertis. Suco de cevadiss, é um leite divinis.",
|
|
71
|
+
titleTag: "h2",
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
expect(
|
|
76
|
+
getByRole("heading", {
|
|
77
|
+
level: 2,
|
|
78
|
+
name: "This is the call to action title",
|
|
79
|
+
})
|
|
80
|
+
).toBeInTheDocument()
|
|
81
|
+
})
|
|
82
|
+
})
|