@kaizen/components 1.57.2 → 1.58.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/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 +135 -0
- package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.ts +77 -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/Icon/subcomponents/SVG/SVG.cjs +2 -3
- package/dist/cjs/Illustration/subcomponents/VideoPlayer/VideoPlayer.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/Icon/subcomponents/SVG/SVG.mjs +2 -3
- package/dist/esm/Illustration/subcomponents/VideoPlayer/VideoPlayer.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/Icon/subcomponents/SVG/SVG.d.ts +1 -2
- 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 +28 -13
- 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/Icon/subcomponents/SVG/SVG.tsx +1 -4
- package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.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/{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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.1",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"url": "git+https://github.com/cultureamp/kaizen-design-system.git"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
+
"bin",
|
|
17
|
+
"codemods",
|
|
16
18
|
"future",
|
|
17
19
|
"v1",
|
|
18
20
|
"v2",
|
|
@@ -28,6 +30,9 @@
|
|
|
28
30
|
"sideEffects": [
|
|
29
31
|
"styles.css"
|
|
30
32
|
],
|
|
33
|
+
"bin": {
|
|
34
|
+
"kaizen-codemod": "./bin/codemod.sh"
|
|
35
|
+
},
|
|
31
36
|
"dependencies": {
|
|
32
37
|
"@floating-ui/react-dom": "^2.1.1",
|
|
33
38
|
"@headlessui/react": "<=1.5.0",
|
|
@@ -53,11 +58,11 @@
|
|
|
53
58
|
"date-fns": "^3.6.0",
|
|
54
59
|
"lodash.debounce": "^4.0.8",
|
|
55
60
|
"nanobus": "^4.5.0",
|
|
56
|
-
"prosemirror-commands": "^1.
|
|
61
|
+
"prosemirror-commands": "^1.6.0",
|
|
57
62
|
"prosemirror-history": "^1.4.1",
|
|
58
63
|
"prosemirror-inputrules": "^1.4.0",
|
|
59
64
|
"prosemirror-keymap": "^1.2.2",
|
|
60
|
-
"prosemirror-model": "^1.22.
|
|
65
|
+
"prosemirror-model": "^1.22.3",
|
|
61
66
|
"prosemirror-schema-basic": "^1.2.3",
|
|
62
67
|
"prosemirror-schema-list": "^1.4.1",
|
|
63
68
|
"prosemirror-state": "^1.4.3",
|
|
@@ -75,7 +80,8 @@
|
|
|
75
80
|
"react-select": "^5.8.0",
|
|
76
81
|
"react-textfit": "^1.1.1",
|
|
77
82
|
"resize-observer-polyfill": "^1.5.1",
|
|
78
|
-
"use-debounce": "^10.0.
|
|
83
|
+
"use-debounce": "^10.0.2",
|
|
84
|
+
"tsx": "^4.17.0",
|
|
79
85
|
"uuid": "^10.0.0",
|
|
80
86
|
"@kaizen/hosted-assets": "2.0.3"
|
|
81
87
|
},
|
|
@@ -83,25 +89,25 @@
|
|
|
83
89
|
"react-day-picker": "Version locked until a11y gets fixed (https://github.com/gpbl/react-day-picker/pull/1708)"
|
|
84
90
|
},
|
|
85
91
|
"devDependencies": {
|
|
86
|
-
"@cultureamp/frontend-apis": "^9.
|
|
87
|
-
"@cultureamp/i18n-react-intl": "^2.
|
|
92
|
+
"@cultureamp/frontend-apis": "^9.8.0",
|
|
93
|
+
"@cultureamp/i18n-react-intl": "^2.6.0",
|
|
88
94
|
"@types/lodash.debounce": "^4.0.9",
|
|
89
95
|
"@types/react-dom": "^18.3.0",
|
|
90
96
|
"@types/react-textfit": "^1.1.4",
|
|
91
97
|
"@types/uuid": "^10.0.0",
|
|
92
|
-
"autoprefixer": "^10.4.
|
|
98
|
+
"autoprefixer": "^10.4.20",
|
|
93
99
|
"concat-cli": "^4.0.0",
|
|
94
100
|
"query-string": "^9.1.0",
|
|
95
101
|
"react-intl": "^6.6.8",
|
|
96
|
-
"rollup": "^4.
|
|
102
|
+
"rollup": "^4.20.0",
|
|
97
103
|
"sass": "^1.77.8",
|
|
98
104
|
"serialize-query-params": "^2.0.2",
|
|
99
105
|
"svgo": "^3.3.2",
|
|
100
|
-
"ts-jest": "^29.2.
|
|
106
|
+
"ts-jest": "^29.2.4",
|
|
101
107
|
"tslib": "^2.6.3",
|
|
102
|
-
"tsx": "^4.
|
|
103
|
-
"@kaizen/design-tokens": "10.5.
|
|
104
|
-
"@kaizen/package-bundler": "1.1.
|
|
108
|
+
"tsx": "^4.17.0",
|
|
109
|
+
"@kaizen/design-tokens": "10.5.2",
|
|
110
|
+
"@kaizen/package-bundler": "1.1.4"
|
|
105
111
|
},
|
|
106
112
|
"devDependenciesComments": {
|
|
107
113
|
"postcss": "Installed in root",
|
|
@@ -111,7 +117,16 @@
|
|
|
111
117
|
"peerDependencies": {
|
|
112
118
|
"@cultureamp/i18n-react-intl": "^2.5.9",
|
|
113
119
|
"react": "^18.3.1",
|
|
114
|
-
"react-intl": "^6.6.8"
|
|
120
|
+
"react-intl": "^6.6.8",
|
|
121
|
+
"typescript": "^5.5.4"
|
|
122
|
+
},
|
|
123
|
+
"peerDependenciesComments": {
|
|
124
|
+
"typescript": "Used for codemods"
|
|
125
|
+
},
|
|
126
|
+
"peerDependenciesMeta": {
|
|
127
|
+
"typescript": {
|
|
128
|
+
"optional": true
|
|
129
|
+
}
|
|
115
130
|
},
|
|
116
131
|
"scripts": {
|
|
117
132
|
"clean": "rm -rf dist",
|
|
@@ -13,18 +13,29 @@ $breakpoint-xl: 1366px; // TODO: create an xl breakpoint in design-tokens and re
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
|
+
background-color: var(--brand-moment-background-color);
|
|
17
|
+
}
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
/** @deprecated */
|
|
20
|
+
.positive {
|
|
21
|
+
--brand-moment-background-color: var(--color-green-100);
|
|
22
|
+
}
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
.negative {
|
|
25
|
+
--brand-moment-background-color: var(--color-red-100);
|
|
26
|
+
}
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
/** end @deprecated */
|
|
29
|
+
.informative {
|
|
30
|
+
--brand-moment-background-color: var(--color-blue-100);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.success {
|
|
34
|
+
--brand-moment-background-color: var(--color-green-100);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.warning {
|
|
38
|
+
--brand-moment-background-color: var(--color-red-100);
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
// --------------------------------
|
|
@@ -9,8 +9,25 @@ import { OverrideClassName } from "~types/OverrideClassName"
|
|
|
9
9
|
import { useMediaQueries } from "~utils/useMediaQueries"
|
|
10
10
|
import styles from "./BrandMoment.module.scss"
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type DeprecatedMoodProps = {
|
|
13
|
+
/** @deprecated Use `variant` instead */
|
|
13
14
|
mood: "informative" | "positive" | "negative"
|
|
15
|
+
variant?: never
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type VariantProps = {
|
|
19
|
+
/**
|
|
20
|
+
* If you are transitioning from `mood`:
|
|
21
|
+
* - `informative` remains as `informative`
|
|
22
|
+
* - `positive` should be `success`
|
|
23
|
+
* - `negative` should be `warning`
|
|
24
|
+
*/
|
|
25
|
+
variant: "informative" | "success" | "warning"
|
|
26
|
+
/** @deprecated Use `variant` instead */
|
|
27
|
+
mood?: never
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type BrandMomentProps = {
|
|
14
31
|
illustration: ReactElement<SceneProps>
|
|
15
32
|
header: ReactNode
|
|
16
33
|
body?: ReactNode
|
|
@@ -22,7 +39,8 @@ export type BrandMomentProps = {
|
|
|
22
39
|
body?: ReactNode
|
|
23
40
|
footer?: ReactNode
|
|
24
41
|
}
|
|
25
|
-
} & OverrideClassName<HTMLAttributes<HTMLDivElement>>
|
|
42
|
+
} & OverrideClassName<HTMLAttributes<HTMLDivElement>> &
|
|
43
|
+
(DeprecatedMoodProps | VariantProps)
|
|
26
44
|
|
|
27
45
|
/**
|
|
28
46
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082061589/Brand+Moment Guidance} |
|
|
@@ -30,6 +48,7 @@ export type BrandMomentProps = {
|
|
|
30
48
|
*/
|
|
31
49
|
export const BrandMoment = ({
|
|
32
50
|
mood,
|
|
51
|
+
variant,
|
|
33
52
|
illustration,
|
|
34
53
|
header,
|
|
35
54
|
body,
|
|
@@ -43,7 +62,11 @@ export const BrandMoment = ({
|
|
|
43
62
|
|
|
44
63
|
return (
|
|
45
64
|
<div
|
|
46
|
-
className={classnames(
|
|
65
|
+
className={classnames(
|
|
66
|
+
styles.body,
|
|
67
|
+
variant ? styles[variant] : styles[mood],
|
|
68
|
+
classNameOverride
|
|
69
|
+
)}
|
|
47
70
|
{...restProps}
|
|
48
71
|
>
|
|
49
72
|
<header className={styles.header}>{header}</header>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Canvas, Meta } from "@storybook/blocks"
|
|
2
|
-
import { InlineNotification } from "~components/Notification"
|
|
1
|
+
import { Canvas, Controls, Meta } from "@storybook/blocks"
|
|
3
2
|
import { ResourceLinks, KAIOInstallation } from "~storybook/components"
|
|
4
3
|
import * as BrandMoment from "./BrandMoment.stories"
|
|
5
4
|
|
|
6
5
|
<Meta of={BrandMoment} />
|
|
7
6
|
|
|
8
|
-
#
|
|
7
|
+
# BrandMoment
|
|
9
8
|
|
|
10
9
|
<ResourceLinks
|
|
11
10
|
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/BrandMoment"
|
|
@@ -20,18 +19,19 @@ import * as BrandMoment from "./BrandMoment.stories"
|
|
|
20
19
|
|
|
21
20
|
A brand moment is a page that showcases the brand's vibrant animations and illustration. The page provides an engaging experience for users when they reach these junction, helping to create a strong connection between the brand and product.
|
|
22
21
|
|
|
23
|
-
<
|
|
22
|
+
<Canvas of={BrandMoment.Playground} />
|
|
23
|
+
<Controls of={BrandMoment.Playground} />
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Variant
|
|
26
26
|
|
|
27
|
-
### Informative
|
|
28
|
-
<Canvas of={BrandMoment.InformativeIntro} />
|
|
27
|
+
### Informative
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
<Canvas of={BrandMoment.PositiveOutro} />
|
|
29
|
+
<Canvas of={BrandMoment.Informative} />
|
|
32
30
|
|
|
33
|
-
###
|
|
34
|
-
<Canvas of={BrandMoment.PositiveOutroCustomerFocused} />
|
|
31
|
+
### Success
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
<Canvas of={BrandMoment.Success} />
|
|
34
|
+
|
|
35
|
+
### Warning
|
|
36
|
+
|
|
37
|
+
<Canvas of={BrandMoment.Warning} />
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Meta } from "@storybook/react"
|
|
3
|
+
import {
|
|
4
|
+
BrandMomentCaptureIntro,
|
|
5
|
+
BrandMomentError,
|
|
6
|
+
BrandMomentPositiveOutro,
|
|
7
|
+
} from "~components/Illustration"
|
|
8
|
+
import {
|
|
9
|
+
StickerSheet,
|
|
10
|
+
StickerSheetStory,
|
|
11
|
+
} from "~storybook/components/StickerSheet"
|
|
12
|
+
import { BrandMoment } from "../BrandMoment"
|
|
13
|
+
import { Informative, Success, Warning } from "./BrandMoment.stories"
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/BrandMoment",
|
|
17
|
+
parameters: {
|
|
18
|
+
chromatic: { disable: false },
|
|
19
|
+
controls: { disable: true },
|
|
20
|
+
a11y: {
|
|
21
|
+
config: {
|
|
22
|
+
rules: [
|
|
23
|
+
{
|
|
24
|
+
// There's gonna be duplicate landmarks here because it's a stickersheet
|
|
25
|
+
id: "landmark-no-duplicate-banner",
|
|
26
|
+
enabled: false,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
// There's gonna be duplicate landmarks here because it's a stickersheet
|
|
30
|
+
id: "landmark-no-duplicate-contentinfo",
|
|
31
|
+
enabled: false,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
// There's gonna be duplicate landmarks here because it's a stickersheet
|
|
35
|
+
id: "landmark-no-duplicate-main",
|
|
36
|
+
enabled: false,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
} satisfies Meta
|
|
43
|
+
|
|
44
|
+
const StickerSheetTemplate: StickerSheetStory = {
|
|
45
|
+
render: ({ isReversed }) => (
|
|
46
|
+
<>
|
|
47
|
+
<StickerSheet isReversed={isReversed} heading="Variant">
|
|
48
|
+
<StickerSheet.Body>
|
|
49
|
+
<StickerSheet.Row rowTitle="Informative">
|
|
50
|
+
<BrandMoment {...Informative.args} />
|
|
51
|
+
</StickerSheet.Row>
|
|
52
|
+
<StickerSheet.Row rowTitle="Success">
|
|
53
|
+
<BrandMoment {...Success.args} />
|
|
54
|
+
</StickerSheet.Row>
|
|
55
|
+
<StickerSheet.Row rowTitle="Warning">
|
|
56
|
+
<BrandMoment {...Warning.args} />
|
|
57
|
+
</StickerSheet.Row>
|
|
58
|
+
</StickerSheet.Body>
|
|
59
|
+
</StickerSheet>
|
|
60
|
+
|
|
61
|
+
<StickerSheet isReversed={isReversed} heading="Mood (deprecated)">
|
|
62
|
+
<StickerSheet.Body>
|
|
63
|
+
<StickerSheet.Row rowTitle="Informative">
|
|
64
|
+
<BrandMoment
|
|
65
|
+
{...Informative.args}
|
|
66
|
+
illustration={<BrandMomentCaptureIntro />}
|
|
67
|
+
variant={undefined}
|
|
68
|
+
mood="informative"
|
|
69
|
+
/>
|
|
70
|
+
</StickerSheet.Row>
|
|
71
|
+
<StickerSheet.Row rowTitle="Positive">
|
|
72
|
+
<BrandMoment
|
|
73
|
+
{...Success.args}
|
|
74
|
+
illustration={<BrandMomentPositiveOutro />}
|
|
75
|
+
variant={undefined}
|
|
76
|
+
mood="positive"
|
|
77
|
+
/>
|
|
78
|
+
</StickerSheet.Row>
|
|
79
|
+
<StickerSheet.Row rowTitle="Negative">
|
|
80
|
+
<BrandMoment
|
|
81
|
+
{...Warning.args}
|
|
82
|
+
illustration={<BrandMomentError />}
|
|
83
|
+
variant={undefined}
|
|
84
|
+
mood="negative"
|
|
85
|
+
/>
|
|
86
|
+
</StickerSheet.Row>
|
|
87
|
+
</StickerSheet.Body>
|
|
88
|
+
</StickerSheet>
|
|
89
|
+
</>
|
|
90
|
+
),
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const StickerSheetDefault: StickerSheetStory = {
|
|
94
|
+
...StickerSheetTemplate,
|
|
95
|
+
name: "Sticker Sheet (Default)",
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const StickerSheetRTL: StickerSheetStory = {
|
|
99
|
+
...StickerSheetTemplate,
|
|
100
|
+
name: "Sticker Sheet (RTL)",
|
|
101
|
+
parameters: { textDirection: "rtl" },
|
|
102
|
+
}
|
|
@@ -3,11 +3,9 @@ import React from "react"
|
|
|
3
3
|
import { Meta, StoryObj } from "@storybook/react"
|
|
4
4
|
import isChromatic from "chromatic"
|
|
5
5
|
import {
|
|
6
|
-
ArrowLeftIcon,
|
|
7
6
|
ArrowRightIcon,
|
|
8
7
|
EmailIcon,
|
|
9
8
|
FeedbackClassifyIcon,
|
|
10
|
-
SecurityTipIcon,
|
|
11
9
|
} from "~components/Icon"
|
|
12
10
|
import {
|
|
13
11
|
BrandMomentCaptureIntro,
|
|
@@ -30,10 +28,12 @@ const illustrationProps = (
|
|
|
30
28
|
) satisfies AnimatedSceneProps
|
|
31
29
|
|
|
32
30
|
const meta = {
|
|
33
|
-
title: "Components/
|
|
31
|
+
title: "Components/BrandMoment",
|
|
34
32
|
component: BrandMoment,
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
argTypes: {
|
|
34
|
+
mood: { control: false },
|
|
35
|
+
illustration: { control: false },
|
|
36
|
+
header: { control: false },
|
|
37
37
|
},
|
|
38
38
|
} satisfies Meta<typeof BrandMoment>
|
|
39
39
|
|
|
@@ -41,120 +41,39 @@ export default meta
|
|
|
41
41
|
|
|
42
42
|
type Story = StoryObj<typeof meta>
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
render: ({ primaryAction, ...args }, { globals }) => (
|
|
46
|
-
<BrandMoment
|
|
47
|
-
{...args}
|
|
48
|
-
primaryAction={{
|
|
49
|
-
label: "Primary action label",
|
|
50
|
-
...primaryAction,
|
|
51
|
-
icon:
|
|
52
|
-
globals.textDirection === "ltr" ? (
|
|
53
|
-
<ArrowRightIcon role="presentation" />
|
|
54
|
-
) : (
|
|
55
|
-
<ArrowLeftIcon role="presentation" />
|
|
56
|
-
),
|
|
57
|
-
}}
|
|
58
|
-
/>
|
|
59
|
-
),
|
|
60
|
-
parameters: {
|
|
61
|
-
docs: {
|
|
62
|
-
source: {
|
|
63
|
-
// Code snippets will cause the browser to freeze when using JSX.Elements
|
|
64
|
-
// within an object form prop, thus we must disable them to flip the
|
|
65
|
-
// primaryAction icon when changing the global text direction
|
|
66
|
-
code: "disabled",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export const InformativeIntro: Story = {
|
|
73
|
-
...IconRTLTemplate,
|
|
74
|
-
name: "Informative intro",
|
|
44
|
+
export const Playground: Story = {
|
|
75
45
|
args: {
|
|
76
|
-
|
|
46
|
+
variant: "informative",
|
|
77
47
|
illustration: <BrandMomentCaptureIntro {...illustrationProps} />,
|
|
78
48
|
header: <MinimalBasic />,
|
|
79
49
|
text: {
|
|
80
50
|
subtitle: "Welcome to Culture Amp",
|
|
81
51
|
title: "Let's dive in and see how it works",
|
|
82
52
|
},
|
|
83
|
-
primaryAction: {
|
|
84
|
-
label: "Get started",
|
|
85
|
-
href: "#",
|
|
86
|
-
icon: <ArrowRightIcon role="presentation" />,
|
|
87
|
-
iconPosition: "end",
|
|
88
|
-
},
|
|
89
53
|
},
|
|
90
54
|
}
|
|
91
55
|
|
|
92
|
-
export const
|
|
93
|
-
...IconRTLTemplate,
|
|
94
|
-
name: "Positive outro",
|
|
56
|
+
export const Informative: Story = {
|
|
95
57
|
args: {
|
|
96
|
-
|
|
97
|
-
illustration: <BrandMomentPositiveOutro {...illustrationProps} />,
|
|
98
|
-
header: <MinimalBasic />,
|
|
99
|
-
text: {
|
|
100
|
-
title: "Import in progress",
|
|
101
|
-
body: (
|
|
102
|
-
<>
|
|
103
|
-
That's it for now. Your data is importing but you don't need
|
|
104
|
-
to hang out here while it happens. Get on with your day and we'll
|
|
105
|
-
let you know on the <a href="#">Users page</a> when it's
|
|
106
|
-
complete.
|
|
107
|
-
</>
|
|
108
|
-
),
|
|
109
|
-
},
|
|
110
|
-
primaryAction: {
|
|
111
|
-
label: "Go to Users",
|
|
112
|
-
href: "#",
|
|
113
|
-
icon: <ArrowRightIcon role="presentation" />,
|
|
114
|
-
iconPosition: "end",
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export const InformativeIntroCustomerFocused: Story = {
|
|
120
|
-
...IconRTLTemplate,
|
|
121
|
-
name: "Informative intro (customer focused)",
|
|
122
|
-
args: {
|
|
123
|
-
mood: "informative",
|
|
58
|
+
variant: "informative",
|
|
124
59
|
illustration: <BrandMomentCaptureIntro {...illustrationProps} />,
|
|
125
|
-
header: <
|
|
60
|
+
header: <MinimalBasic />,
|
|
126
61
|
text: {
|
|
127
|
-
subtitle: "
|
|
128
|
-
title: "
|
|
129
|
-
body: "Thank you for taking the time to respond to this survey. It'll help us better understand your experience and perspective.",
|
|
130
|
-
footer: (
|
|
131
|
-
<>
|
|
132
|
-
Your responses and information are securely collected and kept by
|
|
133
|
-
Culture Amp in accordance with our <a href="#">Privacy Policy</a>.
|
|
134
|
-
Your responses will be reported to Hooli based on the specific rules
|
|
135
|
-
for this survey. If you have any additional questions, please contact
|
|
136
|
-
us at <a href="#">support@cultureamp.com</a>.
|
|
137
|
-
</>
|
|
138
|
-
),
|
|
62
|
+
subtitle: "Welcome to Culture Amp",
|
|
63
|
+
title: "Let's dive in and see how it works",
|
|
139
64
|
},
|
|
140
65
|
primaryAction: {
|
|
141
|
-
label: "
|
|
66
|
+
label: "Get started",
|
|
142
67
|
href: "#",
|
|
143
68
|
icon: <ArrowRightIcon role="presentation" />,
|
|
144
69
|
iconPosition: "end",
|
|
145
70
|
},
|
|
146
|
-
secondaryAction: {
|
|
147
|
-
label: "About data safety",
|
|
148
|
-
icon: <SecurityTipIcon role="presentation" />,
|
|
149
|
-
},
|
|
150
71
|
},
|
|
151
72
|
}
|
|
152
73
|
|
|
153
|
-
export const
|
|
154
|
-
...IconRTLTemplate,
|
|
155
|
-
name: "Positive outro (customer focused)",
|
|
74
|
+
export const Success: Story = {
|
|
156
75
|
args: {
|
|
157
|
-
|
|
76
|
+
variant: "success",
|
|
158
77
|
illustration: <BrandMomentPositiveOutro {...illustrationProps} />,
|
|
159
78
|
header: <MinimalCustomerFocused />,
|
|
160
79
|
text: {
|
|
@@ -189,10 +108,9 @@ export const PositiveOutroCustomerFocused: Story = {
|
|
|
189
108
|
},
|
|
190
109
|
}
|
|
191
110
|
|
|
192
|
-
export const
|
|
193
|
-
...IconRTLTemplate,
|
|
111
|
+
export const Warning: Story = {
|
|
194
112
|
args: {
|
|
195
|
-
|
|
113
|
+
variant: "warning",
|
|
196
114
|
illustration: <BrandMomentError {...illustrationProps} />,
|
|
197
115
|
header: <FakeNavBar />,
|
|
198
116
|
text: {
|
|
@@ -3,12 +3,63 @@
|
|
|
3
3
|
@import "~@kaizen/design-tokens/sass/color";
|
|
4
4
|
|
|
5
5
|
.wrapper {
|
|
6
|
-
color:
|
|
7
|
-
border: var(--border-width-1) solid;
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
color: var(--color-purple-800);
|
|
7
|
+
border: var(--border-width-1) solid var(--card-border-color);
|
|
8
|
+
background-color: var(--card-background-color);
|
|
9
|
+
border-radius: var(--border-borderless-border-radius);
|
|
10
|
+
box-shadow: var(--card-box-shadow);
|
|
11
|
+
|
|
12
|
+
--card-border-color: var(--color-gray-500);
|
|
13
|
+
--card-background-color: var(--color-white);
|
|
14
|
+
--card-box-shadow: var(--shadow-small-box-shadow);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.elevated {
|
|
18
|
+
--card-box-shadow: var(--shadow-large-box-shadow);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Color styles ---------------------------
|
|
22
|
+
.blue {
|
|
23
|
+
--card-background-color: var(--color-blue-100);
|
|
24
|
+
--card-border-color: var(--color-blue-400);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.gray {
|
|
28
|
+
--card-background-color: var(--color-gray-200);
|
|
29
|
+
--card-border-color: var(--color-gray-500);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.green {
|
|
33
|
+
--card-background-color: var(--color-green-100);
|
|
34
|
+
--card-border-color: var(--color-green-500);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.orange {
|
|
38
|
+
--card-background-color: var(--color-orange-100);
|
|
39
|
+
--card-border-color: var(--color-orange-600);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.purple {
|
|
43
|
+
--card-background-color: var(--color-purple-100);
|
|
44
|
+
--card-border-color: var(--color-purple-400);
|
|
10
45
|
}
|
|
11
46
|
|
|
47
|
+
.red {
|
|
48
|
+
--card-background-color: var(--color-red-100);
|
|
49
|
+
--card-border-color: var(--color-red-500);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.white {
|
|
53
|
+
--card-background-color: var(--color-white);
|
|
54
|
+
--card-border-color: var(--color-gray-500);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.yellow {
|
|
58
|
+
--card-background-color: var(--color-yellow-100);
|
|
59
|
+
--card-border-color: var(--color-yellow-700);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Deprecated Variant styles ----------------
|
|
12
63
|
.default {
|
|
13
64
|
border-color: var(--color-gray-500);
|
|
14
65
|
background-color: var(--color-white);
|
|
@@ -44,6 +95,4 @@
|
|
|
44
95
|
background-color: $color-purple-100;
|
|
45
96
|
}
|
|
46
97
|
|
|
47
|
-
|
|
48
|
-
box-shadow: $shadow-large-box-shadow;
|
|
49
|
-
}
|
|
98
|
+
// --------------------------------------------
|
package/src/Card/Card.tsx
CHANGED
|
@@ -12,21 +12,43 @@ export type CardVariants =
|
|
|
12
12
|
| "assertive"
|
|
13
13
|
| "highlight"
|
|
14
14
|
|
|
15
|
-
export type
|
|
15
|
+
export type CardColors =
|
|
16
|
+
| "blue"
|
|
17
|
+
| "green"
|
|
18
|
+
| "gray"
|
|
19
|
+
| "orange"
|
|
20
|
+
| "purple"
|
|
21
|
+
| "red"
|
|
22
|
+
| "white"
|
|
23
|
+
| "yellow"
|
|
24
|
+
|
|
25
|
+
export type CardProps = {
|
|
16
26
|
children?: React.ReactNode
|
|
17
27
|
/**
|
|
18
28
|
* HTML elements that are allowed on Card.
|
|
19
29
|
*/
|
|
20
30
|
tag?: "div" | "article" | "header" | "main" | "section" | "li"
|
|
21
|
-
/**
|
|
22
|
-
* determines the card background colour on the card. It should match to the type of content being conveyed.
|
|
23
|
-
*/
|
|
24
|
-
variant?: CardVariants
|
|
25
31
|
/**
|
|
26
32
|
* Adds a larger box shadow to to the card container.
|
|
27
33
|
*/
|
|
28
34
|
isElevated?: boolean
|
|
29
|
-
|
|
35
|
+
/**
|
|
36
|
+
* If you are transitioning from `variant`:
|
|
37
|
+
* - `assertive` should be `orange`
|
|
38
|
+
* - `cautionary` should be `yellow`
|
|
39
|
+
* - `default` should be `white` OR you can remove the prop
|
|
40
|
+
* - `destructive` should be `red`
|
|
41
|
+
* - `highlight` should be `purple`
|
|
42
|
+
* - `informative` should be `blue`
|
|
43
|
+
* - `positive` should be `green`
|
|
44
|
+
* @default white
|
|
45
|
+
*/
|
|
46
|
+
color?: CardColors
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Please use color instead
|
|
49
|
+
*/
|
|
50
|
+
variant?: CardVariants
|
|
51
|
+
} & OverrideClassName<Omit<HTMLAttributes<HTMLElement>, "color">>
|
|
30
52
|
|
|
31
53
|
/**
|
|
32
54
|
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082094938/Card Guidance} |
|
|
@@ -35,24 +57,26 @@ export type CardProps = OverrideClassName<HTMLAttributes<HTMLElement>> & {
|
|
|
35
57
|
export const Card = ({
|
|
36
58
|
children,
|
|
37
59
|
tag = "div",
|
|
38
|
-
variant
|
|
60
|
+
variant,
|
|
61
|
+
color = "white",
|
|
39
62
|
isElevated = false,
|
|
40
63
|
classNameOverride,
|
|
41
64
|
...props
|
|
42
65
|
}: CardProps): JSX.Element => {
|
|
43
|
-
const
|
|
66
|
+
const Element = tag
|
|
67
|
+
|
|
44
68
|
return (
|
|
45
|
-
<
|
|
69
|
+
<Element
|
|
46
70
|
className={classnames(
|
|
47
71
|
styles.wrapper,
|
|
48
|
-
styles[variant],
|
|
72
|
+
variant ? styles[variant] : styles[color],
|
|
49
73
|
classNameOverride,
|
|
50
74
|
isElevated && styles.elevated
|
|
51
75
|
)}
|
|
52
76
|
{...props}
|
|
53
77
|
>
|
|
54
78
|
{children}
|
|
55
|
-
</
|
|
79
|
+
</Element>
|
|
56
80
|
)
|
|
57
81
|
}
|
|
58
82
|
|
package/src/Card/_docs/Card.mdx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Canvas, Controls,
|
|
1
|
+
import { Canvas, Controls, Meta } from "@storybook/blocks"
|
|
2
2
|
import { ResourceLinks, KAIOInstallation } from "~storybook/components"
|
|
3
3
|
import * as CardStories from "./Card.stories"
|
|
4
4
|
|
|
@@ -22,6 +22,9 @@ The `Card` component is a flexible container used to wrap primary content. It ha
|
|
|
22
22
|
|
|
23
23
|
## API
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### Colors
|
|
26
|
+
<Canvas of={CardStories.Colors} />
|
|
27
|
+
|
|
28
|
+
### Elevation
|
|
29
|
+
<Canvas of={CardStories.Elevation} />
|
|
26
30
|
|
|
27
|
-
<DocsStory of={CardStories.Elevation} />
|