@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.
Files changed (226) hide show
  1. package/bin/codemod.sh +39 -0
  2. package/codemods/README.md +31 -0
  3. package/codemods/__tests__/utils/index.ts +1 -0
  4. package/codemods/__tests__/utils/parseJsx.ts +11 -0
  5. package/codemods/migrateBrandMomentMoodToVariant/index.ts +21 -0
  6. package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.spec.ts +44 -0
  7. package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.ts +24 -0
  8. package/codemods/migrateCardVariantToColor/index.ts +15 -0
  9. package/codemods/migrateCardVariantToColor/transformCardVariantToColor.spec.ts +91 -0
  10. package/codemods/migrateCardVariantToColor/transformCardVariantToColor.ts +32 -0
  11. package/codemods/migrateConfirmationModalMoodsToVariant/index.ts +19 -0
  12. package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.spec.ts +110 -0
  13. package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.ts +59 -0
  14. package/codemods/migrateEmptyStateIllustrationTypeToVariant/index.ts +21 -0
  15. package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.spec.ts +74 -0
  16. package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.ts +28 -0
  17. package/codemods/migrateGlobalNotificationTypeToVariant/index.ts +19 -0
  18. package/codemods/migrateInformationTileMoodToVariant/index.ts +21 -0
  19. package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.spec.ts +84 -0
  20. package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.ts +22 -0
  21. package/codemods/migrateInlineNotificationTypeToVariant/index.ts +19 -0
  22. package/codemods/migrateMultiActionTileMoodToVariant/index.ts +21 -0
  23. package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.spec.ts +84 -0
  24. package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.ts +22 -0
  25. package/codemods/migrateNotificationTypeToVariant/index.ts +1 -0
  26. package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.spec.ts +107 -0
  27. package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.ts +28 -0
  28. package/codemods/migrateProgressBarMoodToColor/index.ts +21 -0
  29. package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.spec.ts +54 -0
  30. package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.ts +26 -0
  31. package/codemods/migrateToastNotificationTypeToVariant/index.ts +19 -0
  32. package/codemods/migrateWellVariantToColor/index.ts +15 -0
  33. package/codemods/migrateWellVariantToColor/transformWellVariantToColor.spec.ts +192 -0
  34. package/codemods/migrateWellVariantToColor/transformWellVariantToColor.ts +75 -0
  35. package/codemods/removeInputEditModalMood/index.ts +19 -0
  36. package/codemods/removeInputEditModalMood/removeInputEditModalMood.spec.ts +80 -0
  37. package/codemods/removeInputEditModalMood/removeInputEditModalMood.ts +40 -0
  38. package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.spec.ts +118 -0
  39. package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.ts +64 -0
  40. package/codemods/utils/__fixtures__/KaioComponent.tsx +6 -0
  41. package/codemods/utils/__snapshots__/transformSource.spec.ts.snap +11 -0
  42. package/codemods/utils/getPropValueText.spec.ts +75 -0
  43. package/codemods/utils/getPropValueText.ts +21 -0
  44. package/codemods/utils/getTagName.spec.ts +24 -0
  45. package/codemods/utils/getTagName.ts +32 -0
  46. package/codemods/utils/index.ts +7 -0
  47. package/codemods/utils/migrateStringProp.spec.ts +129 -0
  48. package/codemods/utils/migrateStringProp.ts +43 -0
  49. package/codemods/utils/printAst.ts +6 -0
  50. package/codemods/utils/transformComponentsInDir.ts +42 -0
  51. package/codemods/utils/transformSource.spec.ts +56 -0
  52. package/codemods/utils/transformSource.ts +25 -0
  53. package/codemods/utils/updateJsxElementWithNewProps.spec.ts +67 -0
  54. package/codemods/utils/updateJsxElementWithNewProps.ts +24 -0
  55. package/dist/cjs/BrandMoment/BrandMoment.cjs +3 -2
  56. package/dist/cjs/BrandMoment/BrandMoment.module.scss.cjs +3 -1
  57. package/dist/cjs/Card/Card.cjs +7 -6
  58. package/dist/cjs/Card/Card.module.scss.cjs +10 -2
  59. package/dist/cjs/EmptyState/EmptyState.cjs +14 -6
  60. package/dist/cjs/EmptyState/EmptyState.module.scss.cjs +3 -0
  61. package/dist/cjs/ErrorPage/ErrorPage.cjs +1 -1
  62. package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +9 -5
  63. package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.module.scss.cjs +6 -2
  64. package/dist/cjs/Notification/ToastNotification/ToastNotification/ToastNotification.cjs +1 -3
  65. package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs +1 -3
  66. package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.cjs +6 -3
  67. package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +5 -3
  68. package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +35 -3
  69. package/dist/cjs/ProgressBar/ProgressBar.cjs +3 -2
  70. package/dist/cjs/ProgressBar/ProgressBar.module.scss.cjs +8 -4
  71. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +7 -5
  72. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.module.scss.cjs +8 -6
  73. package/dist/cjs/Well/Well.cjs +5 -4
  74. package/dist/cjs/Well/Well.module.scss.cjs +9 -1
  75. package/dist/cjs/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.cjs +6 -6
  76. package/dist/cjs/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.cjs +33 -0
  77. package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.cjs +160 -0
  78. package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.cjs +28 -0
  79. package/dist/cjs/containersV1.cjs +4 -0
  80. package/dist/cjs/containersV2.cjs +4 -0
  81. package/dist/cjs/index.cjs +2 -2
  82. package/dist/esm/BrandMoment/BrandMoment.mjs +3 -2
  83. package/dist/esm/BrandMoment/BrandMoment.module.scss.mjs +3 -1
  84. package/dist/esm/Card/Card.mjs +7 -6
  85. package/dist/esm/Card/Card.module.scss.mjs +10 -2
  86. package/dist/esm/EmptyState/EmptyState.mjs +15 -7
  87. package/dist/esm/EmptyState/EmptyState.module.scss.mjs +3 -0
  88. package/dist/esm/ErrorPage/ErrorPage.mjs +1 -1
  89. package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +9 -5
  90. package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.module.scss.mjs +6 -2
  91. package/dist/esm/Notification/ToastNotification/ToastNotification/ToastNotification.mjs +1 -3
  92. package/dist/esm/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.mjs +1 -3
  93. package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.mjs +8 -5
  94. package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +5 -3
  95. package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +39 -5
  96. package/dist/esm/ProgressBar/ProgressBar.mjs +3 -2
  97. package/dist/esm/ProgressBar/ProgressBar.module.scss.mjs +8 -4
  98. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +7 -5
  99. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.module.scss.mjs +8 -6
  100. package/dist/esm/Well/Well.mjs +5 -4
  101. package/dist/esm/Well/Well.module.scss.mjs +9 -1
  102. package/dist/esm/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.mjs +6 -6
  103. package/dist/esm/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.mjs +31 -0
  104. package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.mjs +153 -0
  105. package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.mjs +26 -0
  106. package/dist/esm/containersV1.mjs +1 -0
  107. package/dist/esm/containersV2.mjs +1 -0
  108. package/dist/esm/index.mjs +1 -1
  109. package/dist/styles.css +13 -12
  110. package/dist/types/BrandMoment/BrandMoment.d.ts +19 -3
  111. package/dist/types/Card/Card.d.ts +20 -7
  112. package/dist/types/EmptyState/EmptyState.d.ts +14 -6
  113. package/dist/types/Modal/ConfirmationModal/ConfirmationModal.d.ts +25 -7
  114. package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +3 -0
  115. package/dist/types/Modal/InputEditModal/InputEditModal.d.ts +4 -1
  116. package/dist/types/Notification/GlobalNotification/GlobalNotification.d.ts +3 -3
  117. package/dist/types/Notification/InlineNotification/InlineNotification.d.ts +3 -3
  118. package/dist/types/Notification/ToastNotification/ToastNotification/ToastNotification.d.ts +5 -4
  119. package/dist/types/Notification/ToastNotification/context/ToastNotificationContext.d.ts +4 -3
  120. package/dist/types/Notification/ToastNotification/types.d.ts +3 -3
  121. package/dist/types/Notification/subcomponents/GenericNotification/GenericNotification.d.ts +24 -4
  122. package/dist/types/Notification/subcomponents/NotificationIcon/NotificationIcon.d.ts +11 -4
  123. package/dist/types/Notification/types.d.ts +2 -1
  124. package/dist/types/ProgressBar/ProgressBar.d.ts +25 -6
  125. package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +10 -3
  126. package/dist/types/Well/Well.d.ts +6 -2
  127. package/dist/types/Well/types.d.ts +4 -0
  128. package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.d.ts +4 -4
  129. package/dist/types/__containers__/GuidanceBlock/v2/GuidanceBlock.d.ts +59 -0
  130. package/dist/types/__containers__/GuidanceBlock/v2/index.d.ts +1 -0
  131. package/dist/types/__containers__/v1.d.ts +1 -0
  132. package/dist/types/__containers__/v2.d.ts +1 -0
  133. package/dist/types/index.d.ts +1 -1
  134. package/package.json +19 -5
  135. package/src/BrandMoment/BrandMoment.module.scss +20 -9
  136. package/src/BrandMoment/BrandMoment.tsx +26 -3
  137. package/src/BrandMoment/_docs/BrandMoment.mdx +13 -13
  138. package/src/BrandMoment/_docs/BrandMoment.stickersheet.stories.tsx +102 -0
  139. package/src/BrandMoment/_docs/BrandMoment.stories.tsx +17 -99
  140. package/src/Card/Card.module.scss +56 -7
  141. package/src/Card/Card.tsx +35 -11
  142. package/src/Card/_docs/Card.mdx +6 -3
  143. package/src/Card/_docs/Card.stickersheet.stories.tsx +44 -39
  144. package/src/Card/_docs/Card.stories.tsx +23 -23
  145. package/src/EmptyState/EmptyState.module.scss +32 -14
  146. package/src/EmptyState/EmptyState.tsx +32 -18
  147. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +69 -121
  148. package/src/EmptyState/_docs/EmptyState.stories.tsx +6 -8
  149. package/src/ErrorPage/ErrorPage.tsx +1 -1
  150. package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +100 -78
  151. package/src/Modal/ConfirmationModal/ConfirmationModal.spec.tsx +5 -5
  152. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +41 -10
  153. package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +3 -3
  154. package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.stories.tsx +11 -4
  155. package/src/Modal/ContextModal/_docs/ContextModal.stories.tsx +3 -1
  156. package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +3 -0
  157. package/src/Modal/InputEditModal/InputEditModal.tsx +4 -1
  158. package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +0 -13
  159. package/src/Modal/InputEditModal/_docs/InputEditModal.stories.tsx +9 -10
  160. package/src/Notification/GlobalNotification/GlobalNotification.tsx +9 -4
  161. package/src/Notification/GlobalNotification/_docs/GlobalNotification.stickersheet.stories.tsx +68 -58
  162. package/src/Notification/GlobalNotification/_docs/GlobalNotification.stories.tsx +10 -13
  163. package/src/Notification/InlineNotification/InlineNotification.tsx +9 -4
  164. package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +79 -44
  165. package/src/Notification/InlineNotification/_docs/InlineNotification.stories.tsx +17 -17
  166. package/src/Notification/ToastNotification/ToastNotification/ToastNotification.tsx +7 -5
  167. package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx +1 -2
  168. package/src/Notification/ToastNotification/_docs/ToastNotification.stickersheet.stories.tsx +12 -7
  169. package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +6 -1
  170. package/src/Notification/ToastNotification/context/ToastNotificationContext.tsx +7 -3
  171. package/src/Notification/ToastNotification/types.ts +8 -3
  172. package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +42 -5
  173. package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +40 -6
  174. package/src/Notification/subcomponents/GenericNotification/_mixins.scss +2 -1
  175. package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +31 -5
  176. package/src/Notification/types.ts +9 -2
  177. package/src/ProgressBar/ProgressBar.module.scss +37 -25
  178. package/src/ProgressBar/ProgressBar.tsx +30 -5
  179. package/src/ProgressBar/_docs/ProgressBar.mdx +2 -3
  180. package/src/ProgressBar/_docs/ProgressBar.stickersheet.stories.tsx +95 -51
  181. package/src/ProgressBar/_docs/ProgressBar.stories.tsx +56 -25
  182. package/src/Tile/InformationTile/_docs/InformationTile.mdx +3 -2
  183. package/src/Tile/InformationTile/_docs/InformationTile.stickersheet.stories.tsx +57 -19
  184. package/src/Tile/InformationTile/_docs/InformationTile.stories.tsx +19 -7
  185. package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +3 -2
  186. package/src/Tile/MultiActionTile/_docs/MultiActionTile.stickersheet.stories.tsx +62 -24
  187. package/src/Tile/MultiActionTile/_docs/MultiActionTile.stories.tsx +19 -7
  188. package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +34 -22
  189. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -8
  190. package/src/Tile/subcomponents/GenericTile/_docs/GenericTile.stickersheet.stories.tsx +57 -19
  191. package/src/Well/Well.module.scss +70 -33
  192. package/src/Well/Well.tsx +9 -3
  193. package/src/Well/_docs/Well.mdx +9 -2
  194. package/src/Well/_docs/Well.stickersheet.stories.tsx +10 -1
  195. package/src/Well/_docs/Well.stories.tsx +54 -29
  196. package/src/Well/types.ts +15 -0
  197. package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +1 -1
  198. package/src/__actions__/Menu/v3/MenuItem.module.scss +1 -0
  199. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.module.scss +2 -2
  200. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.mdx +2 -2
  201. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stickersheet.stories.tsx +1 -1
  202. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stories.tsx +1 -1
  203. package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss +356 -0
  204. package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.spec.tsx +82 -0
  205. package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.tsx +262 -0
  206. package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.mdx +38 -0
  207. package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stickersheet.stories.tsx +118 -0
  208. package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stories.tsx +152 -0
  209. package/src/__containers__/GuidanceBlock/v2/index.ts +1 -0
  210. package/src/__containers__/v1.ts +1 -0
  211. package/src/__containers__/v2.ts +1 -0
  212. package/src/index.ts +2 -1
  213. package/v1/containers/package.json +5 -0
  214. package/v2/containers/package.json +5 -0
  215. package/dist/cjs/GuidanceBlock/GuidanceBlock.module.scss.cjs +0 -33
  216. package/dist/esm/GuidanceBlock/GuidanceBlock.module.scss.mjs +0 -31
  217. package/dist/types/Tile/subcomponents/GenericTile/types.d.ts +0 -2
  218. package/src/EmptyState/_docs/EmptyState.stories.module.scss +0 -15
  219. package/src/Notification/ToastNotification/ToastNotification/ToastNotification.spec.tsx +0 -33
  220. package/src/Tile/subcomponents/GenericTile/types.ts +0 -10
  221. /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.d.ts +0 -0
  222. /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.d.ts +0 -0
  223. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.spec.tsx +0 -0
  224. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.tsx +0 -0
  225. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.ts +0 -0
  226. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.ts +0 -0
@@ -1,6 +1,5 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { moodsList } from "~components/Tile/subcomponents/GenericTile/types"
4
3
  import { InformationTile } from "../index"
5
4
 
6
5
  const meta = {
@@ -11,6 +10,9 @@ const meta = {
11
10
  metadata: "Side A",
12
11
  footer: <>Example Footer</>,
13
12
  },
13
+ argTypes: {
14
+ mood: { control: false },
15
+ },
14
16
  } satisfies Meta<typeof InformationTile>
15
17
 
16
18
  export default meta
@@ -27,14 +29,24 @@ export const Playground: Story = {
27
29
  },
28
30
  }
29
31
 
30
- export const Moods: Story = {
32
+ export const Variants: Story = {
31
33
  render: args => (
32
- <div className="flex gap-16 flex-wrap">
33
- {moodsList.map(mood => (
34
- <InformationTile key={mood} mood={mood} {...args} />
35
- ))}
36
- </div>
34
+ <>
35
+ <InformationTile {...args} variant="default" title="default" />
36
+ <InformationTile
37
+ {...args}
38
+ variant="expert-advice"
39
+ title="expert-advice"
40
+ />
41
+ </>
37
42
  ),
43
+ decorators: [
44
+ Story => (
45
+ <div className="flex gap-16 flex-wrap">
46
+ <Story />
47
+ </div>
48
+ ),
49
+ ],
38
50
  }
39
51
 
40
52
  export const Information: Story = {
@@ -24,8 +24,9 @@ A visually interesting item in a list consisting of a card, visual, title, metad
24
24
 
25
25
  ## API
26
26
 
27
- ### Moods
28
- <Canvas of={MultiActionTileStories.Moods} />
27
+ ### Variants
28
+
29
+ <Canvas of={MultiActionTileStories.Variants} />
29
30
 
30
31
  ### Secondary Action
31
32
  <Canvas of={MultiActionTileStories.SecondaryAction} />
@@ -1,11 +1,10 @@
1
1
  import React from "react"
2
2
  import { Meta } from "@storybook/react"
3
- import { moodsList } from "~components/Tile/subcomponents/GenericTile/types"
4
3
  import {
5
4
  StickerSheet,
6
5
  StickerSheetStory,
7
6
  } from "~storybook/components/StickerSheet"
8
- import { MultiActionTile } from "../index"
7
+ import { MultiActionTile, MultiActionTileProps } from "../index"
9
8
 
10
9
  export default {
11
10
  title: "Components/Tiles/MultiActionTile",
@@ -16,31 +15,70 @@ export default {
16
15
  } satisfies Meta
17
16
 
18
17
  const StickerSheetTemplate: StickerSheetStory = {
19
- render: () => (
20
- <StickerSheet>
21
- <StickerSheet.Body>
22
- {(["default", ...moodsList] as const).map(mood => (
23
- <StickerSheet.Row key={mood} rowTitle={mood}>
24
- <MultiActionTile
25
- mood={mood === "default" ? undefined : mood}
26
- title="Title"
27
- metadata="Side A"
28
- information="Side B"
29
- primaryAction={{
30
- label: "Take Action!",
31
- }}
32
- secondaryAction={{
33
- label: "Nevermind",
34
- }}
35
- />
36
- </StickerSheet.Row>
37
- ))}
38
- </StickerSheet.Body>
39
- </StickerSheet>
40
- ),
18
+ render: () => {
19
+ const defaultProps = {
20
+ title: "Title",
21
+ metadata: "Side A",
22
+ information: "Side B",
23
+ primaryAction: {
24
+ label: "Take Action!",
25
+ },
26
+ secondaryAction: {
27
+ label: "Nevermind",
28
+ },
29
+ } satisfies MultiActionTileProps
30
+
31
+ const variants = ["default", "expert-advice"] satisfies Array<
32
+ MultiActionTileProps["variant"]
33
+ >
34
+
35
+ const moods = [
36
+ "positive",
37
+ "informative",
38
+ "cautionary",
39
+ "assertive",
40
+ "negative",
41
+ "prominent",
42
+ ] satisfies Array<MultiActionTileProps["mood"]>
43
+
44
+ return (
45
+ <>
46
+ <StickerSheet heading="MultiActionTile">
47
+ <StickerSheet.Body>
48
+ {variants.map(variant => (
49
+ <StickerSheet.Row key={variant} rowTitle={variant}>
50
+ <MultiActionTile {...defaultProps} variant={variant} />
51
+ </StickerSheet.Row>
52
+ ))}
53
+ </StickerSheet.Body>
54
+ </StickerSheet>
55
+
56
+ <StickerSheet heading="Mood (deprecated)">
57
+ <StickerSheet.Body>
58
+ <>
59
+ <StickerSheet.Row rowTitle="default">
60
+ <MultiActionTile {...defaultProps} />
61
+ </StickerSheet.Row>
62
+ {moods.map(mood => (
63
+ <StickerSheet.Row key={mood} rowTitle={mood}>
64
+ <MultiActionTile {...defaultProps} mood={mood} />
65
+ </StickerSheet.Row>
66
+ ))}
67
+ </>
68
+ </StickerSheet.Body>
69
+ </StickerSheet>
70
+ </>
71
+ )
72
+ },
41
73
  }
42
74
 
43
75
  export const StickerSheetDefault: StickerSheetStory = {
44
76
  ...StickerSheetTemplate,
45
77
  name: "Sticker Sheet (Default)",
46
78
  }
79
+
80
+ export const StickerSheetRTL: StickerSheetStory = {
81
+ ...StickerSheetTemplate,
82
+ name: "Sticker Sheet (RTL)",
83
+ parameters: { textDirection: "rtl" },
84
+ }
@@ -1,6 +1,5 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { moodsList } from "~components/Tile/subcomponents/GenericTile/types"
4
3
  import { MultiActionTile } from "../index"
5
4
 
6
5
  const meta = {
@@ -13,6 +12,9 @@ const meta = {
13
12
  label: "Take Action!",
14
13
  },
15
14
  },
15
+ argTypes: {
16
+ mood: { control: false },
17
+ },
16
18
  } satisfies Meta<typeof MultiActionTile>
17
19
 
18
20
  export default meta
@@ -29,14 +31,24 @@ export const Playground: Story = {
29
31
  },
30
32
  }
31
33
 
32
- export const Moods: Story = {
34
+ export const Variants: Story = {
33
35
  render: args => (
34
- <div className="flex gap-16 flex-wrap">
35
- {moodsList.map(mood => (
36
- <MultiActionTile key={mood} mood={mood} {...args} />
37
- ))}
38
- </div>
36
+ <>
37
+ <MultiActionTile {...args} variant="default" title="default" />
38
+ <MultiActionTile
39
+ {...args}
40
+ variant="expert-advice"
41
+ title="expert-advice"
42
+ />
43
+ </>
39
44
  ),
45
+ decorators: [
46
+ Story => (
47
+ <div className="flex gap-16 flex-wrap">
48
+ <Story />
49
+ </div>
50
+ ),
51
+ ],
40
52
  }
41
53
 
42
54
  export const Information: Story = {
@@ -44,9 +44,6 @@ $tilePaddingTop: $spacing-xl;
44
44
 
45
45
  .face {
46
46
  position: absolute;
47
- background-color: $color-white;
48
- border: var(--border-width-1) var(--border-solid-border-style);
49
- border-radius: 7px;
50
47
  box-sizing: border-box;
51
48
  display: flex;
52
49
  flex-direction: column;
@@ -54,6 +51,9 @@ $tilePaddingTop: $spacing-xl;
54
51
  width: 100%;
55
52
  height: 100%;
56
53
  backface-visibility: hidden;
54
+ border: var(--border-width-1) solid var(--generic-tile-border-color);
55
+ border-radius: var(--border-solid-border-radius);
56
+ background-color: var(--generic-tile-background-color);
57
57
 
58
58
  * {
59
59
  backface-visibility: hidden;
@@ -62,41 +62,53 @@ $tilePaddingTop: $spacing-xl;
62
62
 
63
63
  .faceFront {
64
64
  justify-content: space-between;
65
- border-color: var(--color-gray-500);
66
65
  padding: $tilePaddingTop $spacing-md $spacing-md;
67
66
  }
68
67
 
69
68
  .faceBack {
69
+ --generic-tile-border-color: var(--color-blue-400);
70
+ --generic-tile-background-color: var(--color-blue-100);
71
+
70
72
  padding-top: $tilePaddingTop;
71
73
  transform: rotateY(180deg);
72
- border-color: var(--color-blue-400);
73
- background-color: $color-blue-100;
74
74
  }
75
75
 
76
- .faceMoodPositive {
77
- border-color: var(--color-green-500);
78
- background-color: $color-green-100;
76
+ /** @deprecated */
77
+ .positive {
78
+ --generic-tile-border-color: var(--color-green-500);
79
+ --generic-tile-background-color: var(--color-green-100);
80
+ }
81
+
82
+ .informative {
83
+ --generic-tile-border-color: var(--color-blue-400);
84
+ --generic-tile-background-color: var(--color-blue-100);
85
+ }
86
+
87
+ .cautionary {
88
+ --generic-tile-border-color: var(--color-yellow-700);
89
+ --generic-tile-background-color: var(--color-yellow-100);
79
90
  }
80
91
 
81
- .faceMoodInformative {
82
- border-color: var(--color-blue-400);
83
- background-color: $color-blue-100;
92
+ .negative,
93
+ .assertive {
94
+ --generic-tile-border-color: var(--color-red-500);
95
+ --generic-tile-background-color: var(--color-red-100);
84
96
  }
85
97
 
86
- .faceMoodCautionary {
87
- border-color: var(--color-yellow-700);
88
- background-color: $color-yellow-100;
98
+ .prominent {
99
+ --generic-tile-border-color: var(--color-purple-400);
100
+ --generic-tile-background-color: var(--color-purple-100);
89
101
  }
90
102
 
91
- .faceMoodNegative,
92
- .faceMoodAssertive {
93
- border-color: var(--color-red-500);
94
- background-color: $color-red-100;
103
+ /** end @deprecated */
104
+ .default {
105
+ --generic-tile-border-color: var(--color-gray-500);
106
+ --generic-tile-background-color: var(--color-white);
95
107
  }
96
108
 
97
- .faceMoodProminent {
98
- border-color: var(--color-purple-400);
99
- background-color: $color-purple-100;
109
+ .expert-advice {
110
+ --generic-tile-border-color: var(--color-purple-400);
111
+ --generic-tile-background-color: var(--color-purple-100);
100
112
  }
101
113
 
102
114
  .isFlipped {
@@ -7,7 +7,6 @@ import { GenericButtonProps } from "~components/__actions__/Button/v1/GenericBut
7
7
  import { IconButton } from "~components/__actions__/v2"
8
8
  import { OverrideClassName } from "~types/OverrideClassName"
9
9
  import Action from "./Action"
10
- import { Moods } from "./types"
11
10
  import styles from "./GenericTile.module.scss"
12
11
 
13
12
  export type TileAction = {
@@ -34,7 +33,21 @@ export type GenericTileProps = {
34
33
  titleTag?: AllowedHeadingTags
35
34
  metadata?: string
36
35
  information?: TileInformation | React.ReactNode
37
- mood?: Moods
36
+ /** @deprecated Use `variant` instead */
37
+ mood?:
38
+ | "positive"
39
+ | "informative"
40
+ | "cautionary"
41
+ | "assertive"
42
+ | "negative"
43
+ | "prominent"
44
+ /**
45
+ * If you are transitioning from `mood`:
46
+ * - `prominent` should be `expert-advice`
47
+ * - all else should be `default`
48
+ * @default default
49
+ */
50
+ variant?: "default" | "expert-advice"
38
51
  footer: React.ReactNode
39
52
  } & OverrideClassName<Omit<HTMLAttributes<HTMLDivElement>, "title">>
40
53
 
@@ -45,6 +58,7 @@ export const GenericTile = ({
45
58
  metadata,
46
59
  information,
47
60
  mood,
61
+ variant = "default",
48
62
  footer,
49
63
  classNameOverride,
50
64
  ...restProps
@@ -84,12 +98,7 @@ export const GenericTile = ({
84
98
  className={classnames(
85
99
  styles.face,
86
100
  styles.faceFront,
87
- mood === "positive" && styles.faceMoodPositive,
88
- mood === "informative" && styles.faceMoodInformative,
89
- mood === "cautionary" && styles.faceMoodCautionary,
90
- mood === "assertive" && styles.faceMoodAssertive,
91
- mood === "negative" && styles.faceMoodNegative,
92
- mood === "prominent" && styles.faceMoodProminent
101
+ mood ? styles[mood] : styles[variant]
93
102
  )}
94
103
  >
95
104
  {information && (
@@ -4,8 +4,7 @@ import {
4
4
  StickerSheet,
5
5
  StickerSheetStory,
6
6
  } from "~storybook/components/StickerSheet"
7
- import { GenericTile } from "../index"
8
- import { moodsList } from "../types"
7
+ import { GenericTile, GenericTileProps } from "../index"
9
8
 
10
9
  export default {
11
10
  title: "Components/Tiles/GenericTile",
@@ -16,26 +15,65 @@ export default {
16
15
  } satisfies Meta
17
16
 
18
17
  const StickerSheetTemplate: StickerSheetStory = {
19
- render: ({ isReversed }) => (
20
- <StickerSheet isReversed={isReversed}>
21
- <StickerSheet.Body>
22
- {(["default", ...moodsList] as const).map(mood => (
23
- <StickerSheet.Row key={mood} rowTitle={mood}>
24
- <GenericTile
25
- mood={mood === "default" ? undefined : mood}
26
- title="Title"
27
- metadata="metadata"
28
- information="string"
29
- footer={<>Footer</>}
30
- />
31
- </StickerSheet.Row>
32
- ))}
33
- </StickerSheet.Body>
34
- </StickerSheet>
35
- ),
18
+ render: () => {
19
+ const defaultProps = {
20
+ title: "Title",
21
+ metadata: "metadata",
22
+ information: "string",
23
+ footer: <>Footer</>,
24
+ } satisfies GenericTileProps
25
+
26
+ const variants = ["default", "expert-advice"] satisfies Array<
27
+ GenericTileProps["variant"]
28
+ >
29
+
30
+ const moods = [
31
+ "positive",
32
+ "informative",
33
+ "cautionary",
34
+ "assertive",
35
+ "negative",
36
+ "prominent",
37
+ ] satisfies Array<GenericTileProps["mood"]>
38
+
39
+ return (
40
+ <>
41
+ <StickerSheet heading="GenericTile">
42
+ <StickerSheet.Body>
43
+ {variants.map(variant => (
44
+ <StickerSheet.Row key={variant} rowTitle={variant}>
45
+ <GenericTile {...defaultProps} variant={variant} />
46
+ </StickerSheet.Row>
47
+ ))}
48
+ </StickerSheet.Body>
49
+ </StickerSheet>
50
+
51
+ <StickerSheet heading="Mood (deprecated)">
52
+ <StickerSheet.Body>
53
+ <>
54
+ <StickerSheet.Row rowTitle="default">
55
+ <GenericTile {...defaultProps} />
56
+ </StickerSheet.Row>
57
+ {moods.map(mood => (
58
+ <StickerSheet.Row key={mood} rowTitle={mood}>
59
+ <GenericTile {...defaultProps} mood={mood} />
60
+ </StickerSheet.Row>
61
+ ))}
62
+ </>
63
+ </StickerSheet.Body>
64
+ </StickerSheet>
65
+ </>
66
+ )
67
+ },
36
68
  }
37
69
 
38
70
  export const StickerSheetDefault: StickerSheetStory = {
39
71
  ...StickerSheetTemplate,
40
72
  name: "Sticker Sheet (Default)",
41
73
  }
74
+
75
+ export const StickerSheetRTL: StickerSheetStory = {
76
+ ...StickerSheetTemplate,
77
+ name: "Sticker Sheet (RTL)",
78
+ parameters: { textDirection: "rtl" },
79
+ }
@@ -1,69 +1,106 @@
1
- @import "~@kaizen/design-tokens/sass/color";
2
- @import "~@kaizen/design-tokens/sass/border";
3
- @import "~@kaizen/design-tokens/sass/spacing";
4
-
5
1
  .container {
6
- border-width: $border-width-1;
7
- border-radius: $border-solid-border-radius;
8
- margin-bottom: $spacing-md;
2
+ background-color: var(--background-color);
3
+ border-width: var(--border-width-1);
4
+ border-radius: var(--border-solid-border-radius);
5
+ border-style: var(--border-style);
6
+ margin-bottom: var(--spacing-24);
7
+ color: var(--color-purple-800);
8
+ border-color: var(--border-color);
9
9
  }
10
10
 
11
11
  .noMargin {
12
12
  margin: 0;
13
13
  }
14
14
 
15
- // Background Style Variations
16
- .default {
17
- background-color: var(--color-gray-200);
18
- border-color: $color-gray-500;
15
+ .white {
16
+ --background-color: var(--color-white);
17
+ --border-color: var(--color-gray-500);
18
+ }
19
+
20
+ .gray {
21
+ --background-color: var(--color-gray-200);
22
+ --border-color: var(--color-gray-500);
23
+ }
24
+
25
+ .blue {
26
+ --background-color: var(--color-blue-100);
27
+ --border-color: var(--color-blue-400);
28
+ }
29
+
30
+ .yellow {
31
+ --background-color: var(--color-yellow-100);
32
+ --border-color: var(--color-yellow-700);
33
+ }
34
+
35
+ .orange {
36
+ --background-color: var(--color-orange-100);
37
+ --border-color: var(--color-orange-600);
38
+ }
39
+
40
+ .red {
41
+ --background-color: var(--color-red-100);
42
+ --border-color: var(--color-red-500);
43
+ }
44
+
45
+ .green {
46
+ --background-color: var(--color-green-100);
47
+ --border-color: var(--color-green-500);
48
+ }
49
+
50
+ .purple {
51
+ --background-color: var(--color-purple-100);
52
+ --border-color: var(--color-purple-400);
19
53
  }
20
54
 
21
55
  .positive {
22
- background: $color-green-100;
23
- border-color: $color-green-500;
24
- color: $color-purple-800;
56
+ --background-color: var(--color-green-100);
57
+ --border-color: var(--color-green-500);
58
+ }
59
+
60
+ // These are @deprecated but must come after `color` so not everything will default to white
61
+ // This will be @deprecated
62
+ .default {
63
+ --background-color: var(--color-gray-200);
64
+ --border-color: var(--color-gray-500);
25
65
  }
26
66
 
27
67
  .negative {
28
- background: $color-red-100;
29
- border-color: $color-red-500;
30
- color: $color-purple-800;
68
+ --background-color: var(--color-red-100);
69
+ --border-color: var(--color-red-500);
31
70
  }
32
71
 
33
72
  .informative {
34
- background: $color-blue-100;
35
- border-color: $color-blue-400;
36
- color: $color-purple-800;
73
+ --background-color: var(--color-blue-100);
74
+ --border-color: var(--color-blue-400);
37
75
  }
38
76
 
39
77
  .cautionary {
40
- background: $color-yellow-100;
41
- border-color: $color-yellow-700;
42
- color: $color-purple-800;
78
+ --background-color: var(--color-yellow-100);
79
+ --border-color: var(--color-yellow-700);
43
80
  }
44
81
 
45
82
  .assertive {
46
- background: $color-orange-100;
47
- border-color: $color-orange-600;
48
- color: $color-purple-800;
83
+ --background-color: var(--color-orange-100);
84
+ --border-color: var(--color-orange-600);
49
85
  }
50
86
 
51
87
  .prominent {
52
- background: $color-purple-100;
53
- border-color: $color-purple-400;
54
- color: $color-purple-800;
88
+ --background-color: var(--color-purple-100);
89
+ --border-color: var(--color-purple-400);
55
90
  }
56
91
 
92
+ // @deprecated end
93
+
57
94
  // Border Style Variations
58
95
  .solid {
59
- border-style: $border-solid-border-style;
96
+ --border-style: solid;
60
97
  }
61
98
 
62
99
  .dashed {
63
- border-style: $border-dashed-border-style;
100
+ --border-style: dashed;
64
101
  }
65
102
 
66
103
  .none {
67
- border-color: $border-borderless-border-color;
68
- border-style: $border-borderless-border-style;
104
+ --border-color: transparent;
105
+ --border-style: none;
69
106
  }
package/src/Well/Well.tsx CHANGED
@@ -1,12 +1,16 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { OverrideClassName } from "~types/OverrideClassName"
4
- import { WellBorderStyleType, WellVariantType } from "./types"
4
+ import { WellBorderStyleType, WellVariantType, WellColors } from "./types"
5
5
  import styles from "./Well.module.scss"
6
6
 
7
7
  export type WellProps = {
8
8
  children?: React.ReactNode
9
+ /** @deprecated This will not fallback to `default` variant. `default` can be used but must be explicitly passed to the Well component. It is recommended to use `color` prop and `gray` value if you need a gray background. */
9
10
  variant?: WellVariantType
11
+ /** @default `white` */
12
+ color?: WellColors
13
+ /** @default `solid` */
10
14
  borderStyle?: WellBorderStyleType
11
15
  noMargin?: boolean
12
16
  } & OverrideClassName<HTMLAttributes<HTMLDivElement>>
@@ -17,7 +21,8 @@ export type WellProps = {
17
21
  */
18
22
  export const Well = ({
19
23
  children,
20
- variant = "default",
24
+ variant,
25
+ color = "white",
21
26
  borderStyle = "solid",
22
27
  noMargin = false,
23
28
  classNameOverride,
@@ -27,7 +32,8 @@ export const Well = ({
27
32
  className={classnames(
28
33
  styles.container,
29
34
  styles[borderStyle],
30
- styles[variant],
35
+ styles[color],
36
+ variant && styles[variant],
31
37
  noMargin && styles.noMargin,
32
38
  classNameOverride
33
39
  )}
@@ -24,11 +24,18 @@ Wells are used as a visual container around secondary content.
24
24
 
25
25
  ## API
26
26
 
27
- ### Variants
28
- <Canvas of={WellStories.Variants} />
27
+ ### Color
28
+
29
+ Formerly controlled by `variant`, `color` sets the background and border color of the `Well`.
30
+
31
+ All `variant`s have a corresponding `color` value, with some minor update to ensure minimum contrast ratios are met.
32
+
33
+ <Canvas of={WellStories.Colors} />
34
+
29
35
 
30
36
  ### Border Styles
31
37
  <Canvas of={WellStories.BorderStyles} />
32
38
 
33
39
  ### No Margin
34
40
  <Canvas of={WellStories.NoMargin} />
41
+
@@ -6,7 +6,7 @@ import {
6
6
  StickerSheetStory,
7
7
  } from "~storybook/components/StickerSheet"
8
8
  import { Well, WellProps } from "../index"
9
- import { borderStyleTypes, variantTypes } from "../types"
9
+ import { borderStyleTypes, wellColors, variantTypes } from "../types"
10
10
 
11
11
  export default {
12
12
  title: "Components/Well",
@@ -48,6 +48,15 @@ const StickerSheetTemplate: StickerSheetStory = {
48
48
  </StickerSheet.Row>
49
49
  ))}
50
50
  </StickerSheet.Body>
51
+ <StickerSheet.Body>
52
+ {wellColors.map(color => (
53
+ <StickerSheet.Row key={color} rowTitle={color}>
54
+ {borderStyleTypes.map(border => (
55
+ <WellWrapped key={border} color={color} borderStyle={border} />
56
+ ))}
57
+ </StickerSheet.Row>
58
+ ))}
59
+ </StickerSheet.Body>
51
60
  </StickerSheet>
52
61
  <StickerSheet>
53
62
  <StickerSheet.Header headings={["Margin", "No Margin"]} />