@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.
Files changed (232) 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 +135 -0
  39. package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.ts +77 -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/Icon/subcomponents/SVG/SVG.cjs +2 -3
  63. package/dist/cjs/Illustration/subcomponents/VideoPlayer/VideoPlayer.cjs +1 -1
  64. package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +9 -5
  65. package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.module.scss.cjs +6 -2
  66. package/dist/cjs/Notification/ToastNotification/ToastNotification/ToastNotification.cjs +1 -3
  67. package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs +1 -3
  68. package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.cjs +6 -3
  69. package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +5 -3
  70. package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +35 -3
  71. package/dist/cjs/ProgressBar/ProgressBar.cjs +3 -2
  72. package/dist/cjs/ProgressBar/ProgressBar.module.scss.cjs +8 -4
  73. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +7 -5
  74. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.module.scss.cjs +8 -6
  75. package/dist/cjs/Well/Well.cjs +5 -4
  76. package/dist/cjs/Well/Well.module.scss.cjs +9 -1
  77. package/dist/cjs/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.cjs +6 -6
  78. package/dist/cjs/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.cjs +33 -0
  79. package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.cjs +160 -0
  80. package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.cjs +28 -0
  81. package/dist/cjs/containersV1.cjs +4 -0
  82. package/dist/cjs/containersV2.cjs +4 -0
  83. package/dist/cjs/index.cjs +2 -2
  84. package/dist/esm/BrandMoment/BrandMoment.mjs +3 -2
  85. package/dist/esm/BrandMoment/BrandMoment.module.scss.mjs +3 -1
  86. package/dist/esm/Card/Card.mjs +7 -6
  87. package/dist/esm/Card/Card.module.scss.mjs +10 -2
  88. package/dist/esm/EmptyState/EmptyState.mjs +15 -7
  89. package/dist/esm/EmptyState/EmptyState.module.scss.mjs +3 -0
  90. package/dist/esm/ErrorPage/ErrorPage.mjs +1 -1
  91. package/dist/esm/Icon/subcomponents/SVG/SVG.mjs +2 -3
  92. package/dist/esm/Illustration/subcomponents/VideoPlayer/VideoPlayer.mjs +1 -1
  93. package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +9 -5
  94. package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.module.scss.mjs +6 -2
  95. package/dist/esm/Notification/ToastNotification/ToastNotification/ToastNotification.mjs +1 -3
  96. package/dist/esm/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.mjs +1 -3
  97. package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.mjs +8 -5
  98. package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +5 -3
  99. package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +39 -5
  100. package/dist/esm/ProgressBar/ProgressBar.mjs +3 -2
  101. package/dist/esm/ProgressBar/ProgressBar.module.scss.mjs +8 -4
  102. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +7 -5
  103. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.module.scss.mjs +8 -6
  104. package/dist/esm/Well/Well.mjs +5 -4
  105. package/dist/esm/Well/Well.module.scss.mjs +9 -1
  106. package/dist/esm/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.mjs +6 -6
  107. package/dist/esm/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.mjs +31 -0
  108. package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.mjs +153 -0
  109. package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.mjs +26 -0
  110. package/dist/esm/containersV1.mjs +1 -0
  111. package/dist/esm/containersV2.mjs +1 -0
  112. package/dist/esm/index.mjs +1 -1
  113. package/dist/styles.css +13 -12
  114. package/dist/types/BrandMoment/BrandMoment.d.ts +19 -3
  115. package/dist/types/Card/Card.d.ts +20 -7
  116. package/dist/types/EmptyState/EmptyState.d.ts +14 -6
  117. package/dist/types/Icon/subcomponents/SVG/SVG.d.ts +1 -2
  118. package/dist/types/Modal/ConfirmationModal/ConfirmationModal.d.ts +25 -7
  119. package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +3 -0
  120. package/dist/types/Modal/InputEditModal/InputEditModal.d.ts +4 -1
  121. package/dist/types/Notification/GlobalNotification/GlobalNotification.d.ts +3 -3
  122. package/dist/types/Notification/InlineNotification/InlineNotification.d.ts +3 -3
  123. package/dist/types/Notification/ToastNotification/ToastNotification/ToastNotification.d.ts +5 -4
  124. package/dist/types/Notification/ToastNotification/context/ToastNotificationContext.d.ts +4 -3
  125. package/dist/types/Notification/ToastNotification/types.d.ts +3 -3
  126. package/dist/types/Notification/subcomponents/GenericNotification/GenericNotification.d.ts +24 -4
  127. package/dist/types/Notification/subcomponents/NotificationIcon/NotificationIcon.d.ts +11 -4
  128. package/dist/types/Notification/types.d.ts +2 -1
  129. package/dist/types/ProgressBar/ProgressBar.d.ts +25 -6
  130. package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +10 -3
  131. package/dist/types/Well/Well.d.ts +6 -2
  132. package/dist/types/Well/types.d.ts +4 -0
  133. package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.d.ts +4 -4
  134. package/dist/types/__containers__/GuidanceBlock/v2/GuidanceBlock.d.ts +59 -0
  135. package/dist/types/__containers__/GuidanceBlock/v2/index.d.ts +1 -0
  136. package/dist/types/__containers__/v1.d.ts +1 -0
  137. package/dist/types/__containers__/v2.d.ts +1 -0
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +28 -13
  140. package/src/BrandMoment/BrandMoment.module.scss +20 -9
  141. package/src/BrandMoment/BrandMoment.tsx +26 -3
  142. package/src/BrandMoment/_docs/BrandMoment.mdx +13 -13
  143. package/src/BrandMoment/_docs/BrandMoment.stickersheet.stories.tsx +102 -0
  144. package/src/BrandMoment/_docs/BrandMoment.stories.tsx +17 -99
  145. package/src/Card/Card.module.scss +56 -7
  146. package/src/Card/Card.tsx +35 -11
  147. package/src/Card/_docs/Card.mdx +6 -3
  148. package/src/Card/_docs/Card.stickersheet.stories.tsx +44 -39
  149. package/src/Card/_docs/Card.stories.tsx +23 -23
  150. package/src/EmptyState/EmptyState.module.scss +32 -14
  151. package/src/EmptyState/EmptyState.tsx +32 -18
  152. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +69 -121
  153. package/src/EmptyState/_docs/EmptyState.stories.tsx +6 -8
  154. package/src/ErrorPage/ErrorPage.tsx +1 -1
  155. package/src/Icon/subcomponents/SVG/SVG.tsx +1 -4
  156. package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.tsx +1 -1
  157. package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +100 -78
  158. package/src/Modal/ConfirmationModal/ConfirmationModal.spec.tsx +5 -5
  159. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +41 -10
  160. package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +3 -3
  161. package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.stories.tsx +11 -4
  162. package/src/Modal/ContextModal/_docs/ContextModal.stories.tsx +3 -1
  163. package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +3 -0
  164. package/src/Modal/InputEditModal/InputEditModal.tsx +4 -1
  165. package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +0 -13
  166. package/src/Modal/InputEditModal/_docs/InputEditModal.stories.tsx +9 -10
  167. package/src/Notification/GlobalNotification/GlobalNotification.tsx +9 -4
  168. package/src/Notification/GlobalNotification/_docs/GlobalNotification.stickersheet.stories.tsx +68 -58
  169. package/src/Notification/GlobalNotification/_docs/GlobalNotification.stories.tsx +10 -13
  170. package/src/Notification/InlineNotification/InlineNotification.tsx +9 -4
  171. package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +79 -44
  172. package/src/Notification/InlineNotification/_docs/InlineNotification.stories.tsx +17 -17
  173. package/src/Notification/ToastNotification/ToastNotification/ToastNotification.tsx +7 -5
  174. package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx +1 -2
  175. package/src/Notification/ToastNotification/_docs/ToastNotification.stickersheet.stories.tsx +12 -7
  176. package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +6 -1
  177. package/src/Notification/ToastNotification/context/ToastNotificationContext.tsx +7 -3
  178. package/src/Notification/ToastNotification/types.ts +8 -3
  179. package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +42 -5
  180. package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +40 -6
  181. package/src/Notification/subcomponents/GenericNotification/_mixins.scss +2 -1
  182. package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +31 -5
  183. package/src/Notification/types.ts +9 -2
  184. package/src/ProgressBar/ProgressBar.module.scss +37 -25
  185. package/src/ProgressBar/ProgressBar.tsx +30 -5
  186. package/src/ProgressBar/_docs/ProgressBar.mdx +2 -3
  187. package/src/ProgressBar/_docs/ProgressBar.stickersheet.stories.tsx +95 -51
  188. package/src/ProgressBar/_docs/ProgressBar.stories.tsx +56 -25
  189. package/src/Tile/InformationTile/_docs/InformationTile.mdx +3 -2
  190. package/src/Tile/InformationTile/_docs/InformationTile.stickersheet.stories.tsx +57 -19
  191. package/src/Tile/InformationTile/_docs/InformationTile.stories.tsx +19 -7
  192. package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +3 -2
  193. package/src/Tile/MultiActionTile/_docs/MultiActionTile.stickersheet.stories.tsx +62 -24
  194. package/src/Tile/MultiActionTile/_docs/MultiActionTile.stories.tsx +19 -7
  195. package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +34 -22
  196. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -8
  197. package/src/Tile/subcomponents/GenericTile/_docs/GenericTile.stickersheet.stories.tsx +57 -19
  198. package/src/Well/Well.module.scss +70 -33
  199. package/src/Well/Well.tsx +9 -3
  200. package/src/Well/_docs/Well.mdx +9 -2
  201. package/src/Well/_docs/Well.stickersheet.stories.tsx +10 -1
  202. package/src/Well/_docs/Well.stories.tsx +54 -29
  203. package/src/Well/types.ts +15 -0
  204. package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +1 -1
  205. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.module.scss +2 -2
  206. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.mdx +2 -2
  207. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stickersheet.stories.tsx +1 -1
  208. package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stories.tsx +1 -1
  209. package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss +356 -0
  210. package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.spec.tsx +82 -0
  211. package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.tsx +262 -0
  212. package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.mdx +38 -0
  213. package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stickersheet.stories.tsx +118 -0
  214. package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stories.tsx +152 -0
  215. package/src/__containers__/GuidanceBlock/v2/index.ts +1 -0
  216. package/src/__containers__/v1.ts +1 -0
  217. package/src/__containers__/v2.ts +1 -0
  218. package/src/index.ts +2 -1
  219. package/v1/containers/package.json +5 -0
  220. package/v2/containers/package.json +5 -0
  221. package/dist/cjs/GuidanceBlock/GuidanceBlock.module.scss.cjs +0 -33
  222. package/dist/esm/GuidanceBlock/GuidanceBlock.module.scss.mjs +0 -31
  223. package/dist/types/Tile/subcomponents/GenericTile/types.d.ts +0 -2
  224. package/src/EmptyState/_docs/EmptyState.stories.module.scss +0 -15
  225. package/src/Notification/ToastNotification/ToastNotification/ToastNotification.spec.tsx +0 -33
  226. package/src/Tile/subcomponents/GenericTile/types.ts +0 -10
  227. /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.d.ts +0 -0
  228. /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.d.ts +0 -0
  229. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.spec.tsx +0 -0
  230. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.tsx +0 -0
  231. /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.ts +0 -0
  232. /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, variantTypes } from "../types"
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 Variants: Story = {
43
+ export const Colors: Story = {
41
44
  render: args => (
42
45
  <>
43
- {variantTypes.map(variant => (
44
- <>
45
- <Heading tag="h3" variant="heading-6">
46
- {variant}
47
- </Heading>
48
- <Well variant={variant} {...args} />
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="h3" variant="heading-6">
87
+ <Heading tag="h4" variant="heading-6">
61
88
  {border}
62
89
  </Heading>
63
- <Well borderStyle={border} {...args} />
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 className="flex gap-16">
74
- <div>
75
- <Heading tag="h3" variant="heading-6">
76
- Margin (default)
77
- </Heading>
78
- <Well {...args} />
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 specification" />
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 "../../styles/utils/responsive";
8
- @import "../../styles/utils/button-reset";
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: "Components/GuidanceBlock",
15
+ title: "Containers/GuidanceBlock/v1",
16
16
  parameters: {
17
17
  chromatic: { disable: false },
18
18
  controls: { disable: true },
@@ -29,7 +29,7 @@ const defaultText = {
29
29
  }
30
30
 
31
31
  const meta = {
32
- title: "Components/GuidanceBlock",
32
+ title: "Containers/GuidanceBlock/v1",
33
33
  component: GuidanceBlock,
34
34
  args: {
35
35
  layout: "default",
@@ -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
+ })