@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
@@ -5,22 +5,21 @@
5
5
  @import "../../../styles/utils/animation";
6
6
  @import "../GenericModal/GenericModal.module";
7
7
 
8
- $dt-positive-header-background: $color-green-100;
9
- $dt-informative-header-background: $color-blue-100;
10
- $dt-negative-header-background: $color-red-100;
11
- $dt-cautionary-header-background: $color-yellow-100;
12
- $dt-heading-text-color: $color-purple-800;
13
- $dt-cautionary-heading-text-color: $color-purple-800;
14
- $dt-assertive-header-background: $color-orange-100;
15
-
16
8
  .modal {
17
9
  @extend %genericModal;
18
10
 
19
11
  min-width: 300px;
20
12
  max-width: 600px;
13
+
14
+ .spotIcon {
15
+ color: var(--spot-icon-color);
16
+ }
21
17
  }
22
18
 
23
19
  .header {
20
+ display: grid;
21
+ grid-template-columns: 0.2fr 2fr;
22
+ align-items: center;
24
23
  color: $color-white;
25
24
  text-align: left;
26
25
  border-radius: $border-solid-border-radius $border-solid-border-radius 0 0;
@@ -35,14 +34,87 @@ $dt-assertive-header-background: $color-orange-100;
35
34
 
36
35
  // override Murmur global styles :(
37
36
  h1 {
38
- color: $dt-heading-text-color;
37
+ color: var(color-purple-800);
39
38
  }
40
39
  }
41
40
 
42
41
  .iconContainer {
43
42
  position: relative;
43
+ align-self: flex-start;
44
+
45
+ @media (min-width: $layout-breakpoints-medium) {
46
+ align-self: center;
47
+ }
48
+
49
+ .spotIcon {
50
+ width: 30px;
51
+ height: 30px;
52
+
53
+ @media (max-width: $layout-breakpoints-medium) {
54
+ margin-right: 0.9375rem;
55
+ position: relative;
56
+ top: 0.125rem;
57
+ }
58
+ }
44
59
  }
45
60
 
61
+ .prominent {
62
+ display: grid;
63
+ grid-template-columns: 1.1fr 2fr;
64
+ align-items: center;
65
+
66
+ @media (max-width: $layout-breakpoints-medium) {
67
+ grid-template-columns: 1fr;
68
+ display: flex;
69
+ flex-direction: column;
70
+ place-content: flex-start center;
71
+ align-items: flex-start;
72
+ }
73
+
74
+ .iconContainer {
75
+ position: absolute;
76
+ top: 8%;
77
+
78
+ @media (max-width: $layout-breakpoints-medium) {
79
+ position: relative;
80
+ top: 0;
81
+ margin-bottom: $spacing-sm;
82
+ }
83
+ }
84
+
85
+ .spotIcon {
86
+ width: 155px;
87
+ height: 155px;
88
+ margin: 0 auto;
89
+ color: $color-purple-800;
90
+
91
+ @media (max-width: $layout-breakpoints-medium) {
92
+ width: 86px;
93
+ height: 86px;
94
+ }
95
+ }
96
+ }
97
+
98
+ .padded {
99
+ padding: $spacing-md $spacing-lg $spacing-md $spacing-lg;
100
+
101
+ @media (max-width: $layout-breakpoints-medium) {
102
+ padding: $spacing-md;
103
+ }
104
+ }
105
+
106
+ // --------------------------------
107
+ // @deprecated moods use variant styles instead
108
+ // --------------------------------
109
+
110
+ $dt-positive-header-background: $color-green-100;
111
+ $dt-informative-header-background: $color-blue-100;
112
+ $dt-negative-header-background: $color-red-100;
113
+ $dt-cautionary-header-background: $color-yellow-100;
114
+ $dt-heading-text-color: $color-purple-800;
115
+ $dt-cautionary-heading-text-color: $color-purple-800;
116
+ $dt-assertive-header-background: $color-orange-100;
117
+
46
118
  .positiveHeader {
47
119
  background-color: $dt-positive-header-background;
48
120
 
@@ -76,83 +148,33 @@ $dt-assertive-header-background: $color-orange-100;
76
148
  }
77
149
  }
78
150
 
79
- .positiveHeader,
80
- .informativeHeader,
81
- .negativeHeader,
82
- .cautionaryHeader,
83
- .assertiveHeader {
84
- display: grid;
85
- grid-template-columns: 0.2fr 2fr;
86
- align-items: center;
87
-
88
- .iconContainer {
89
- align-self: flex-start;
90
-
91
- @media (min-width: $layout-breakpoints-medium) {
92
- align-self: center;
93
- }
94
- }
95
-
96
- .spotIcon {
97
- width: 30px;
98
- height: 30px;
99
-
100
- @media (max-width: $layout-breakpoints-medium) {
101
- margin-right: 0.9375rem;
102
- position: relative;
103
- top: 0.125rem;
104
- }
105
- }
106
-
107
- &.prominent {
108
- grid-template-columns: 1.1fr 2fr;
151
+ // End @deprecated ----------------
109
152
 
110
- @media (max-width: $layout-breakpoints-medium) {
111
- display: flex;
112
- flex-direction: column;
113
- place-content: flex-start center;
114
- align-items: flex-start;
115
- }
153
+ // --------------------------------
154
+ // variant styles
155
+ // --------------------------------
156
+ .success {
157
+ background-color: var(--color-green-100);
116
158
 
117
- .iconContainer {
118
- position: absolute;
119
- top: 8%;
120
-
121
- @media (max-width: $layout-breakpoints-medium) {
122
- position: relative;
123
- top: 0;
124
- margin-bottom: $spacing-sm;
125
- }
126
- }
159
+ --spot-icon-color: var(--color-green-500);
160
+ }
127
161
 
128
- .spotIcon {
129
- width: 155px;
130
- height: 155px;
131
- margin: 0 auto;
132
- color: $color-purple-800;
162
+ .informative {
163
+ background-color: var(--color-blue-100);
133
164
 
134
- @media (max-width: $layout-breakpoints-medium) {
135
- width: 86px;
136
- height: 86px;
137
- }
138
- }
139
- }
165
+ --spot-icon-color: var(--color-blue-500);
140
166
  }
141
167
 
142
- .prominent {
143
- display: grid;
144
- grid-template-columns: 1.1fr 2fr;
145
- align-items: center;
168
+ .warning {
169
+ background-color: var(--color-red-100);
146
170
 
147
- @media (max-width: $layout-breakpoints-medium) {
148
- grid-template-columns: 1fr;
149
- }
171
+ --spot-icon-color: var(--color-red-500);
150
172
  }
151
173
 
152
- .padded {
153
- padding: $spacing-md $spacing-lg $spacing-md $spacing-lg;
174
+ .cautionary {
175
+ background-color: var(--color-yellow-100);
154
176
 
155
- @media (max-width: $layout-breakpoints-medium) {
156
- padding: $spacing-md;
157
- }
177
+ --spot-icon-color: var(--color-yellow-700);
158
178
  }
179
+
180
+ // --------------------------------
@@ -8,15 +8,15 @@ const user = userEvent.setup()
8
8
 
9
9
  const ConfirmationModalWrapper = ({
10
10
  children,
11
- ...props
11
+ onDismiss: propsOnDismiss = (): void => undefined,
12
+ onConfirm: propsOnConfirm = (): void => undefined,
12
13
  }: Partial<ConfirmationModalProps>): JSX.Element => (
13
14
  <ConfirmationModal
14
- mood="informative"
15
+ variant="success"
15
16
  isOpen={true}
16
17
  title="Example Modal Title"
17
- onDismiss={(): void => undefined}
18
- onConfirm={(): void => undefined}
19
- {...props}
18
+ onDismiss={propsOnDismiss}
19
+ onConfirm={propsOnConfirm}
20
20
  >
21
21
  {children}
22
22
  </ConfirmationModal>
@@ -25,17 +25,16 @@ import {
25
25
  import { ButtonProps } from "~components/__actions__/v2"
26
26
  import styles from "./ConfirmationModal.module.scss"
27
27
 
28
- export type ConfirmationModalProps = {
28
+ type Mood = "positive" | "informative" | "negative" | "cautionary" | "assertive"
29
+ type Variant = "success" | "informative" | "warning" | "cautionary"
30
+
31
+ type BaseConfirmationModalProps = {
29
32
  isOpen: boolean
30
33
  unpadded?: boolean
31
34
  /**
32
35
  * To display the Prominent variation of the modal types
33
36
  */
34
37
  isProminent?: boolean
35
- /**
36
- * Defines the modal type or mood
37
- */
38
- mood: Mood
39
38
  title: string
40
39
  onConfirm?: () => void
41
40
  onDismiss: () => void
@@ -53,10 +52,36 @@ export type ConfirmationModalProps = {
53
52
  children: React.ReactNode
54
53
  } & HTMLAttributes<HTMLDivElement>
55
54
 
56
- type Mood = "positive" | "informative" | "negative" | "cautionary" | "assertive"
55
+ type ConfirmationModalMoods = {
56
+ /**
57
+ * @deprecated Please use `variant` instead
58
+ */
59
+ mood: Mood
60
+ variant?: never
61
+ }
57
62
 
58
- const getIcon = (mood: Mood, isProminent: boolean): JSX.Element => {
59
- switch (mood) {
63
+ type ConfirmationModalVariants = {
64
+ /**
65
+ * @deprecated Please use `variant` instead
66
+ */
67
+ mood?: never
68
+ /**
69
+ * If you are transitioning from Moods:
70
+ * - `positive` should be `success`
71
+ * - `negative` should be `warning`
72
+ * - `assertive` should be `cautionary`
73
+ */
74
+ variant: Variant
75
+ }
76
+
77
+ export type ConfirmationModalProps = BaseConfirmationModalProps &
78
+ (ConfirmationModalMoods | ConfirmationModalVariants)
79
+
80
+ const getIcon = (
81
+ variantName: Mood | Variant,
82
+ isProminent: boolean
83
+ ): JSX.Element => {
84
+ switch (variantName) {
60
85
  case "cautionary":
61
86
  return isProminent ? (
62
87
  <Cautionary />
@@ -70,12 +95,14 @@ const getIcon = (mood: Mood, isProminent: boolean): JSX.Element => {
70
95
  <InformationWhiteIcon inheritSize role="presentation" />
71
96
  )
72
97
  case "negative":
98
+ case "warning":
73
99
  return isProminent ? (
74
100
  <Negative />
75
101
  ) : (
76
102
  <ExclamationWhiteIcon inheritSize role="presentation" />
77
103
  )
78
104
  case "positive":
105
+ case "success":
79
106
  return isProminent ? (
80
107
  <Positive />
81
108
  ) : (
@@ -99,6 +126,7 @@ export const ConfirmationModal = ({
99
126
  isProminent = false,
100
127
  unpadded = false,
101
128
  mood,
129
+ variant,
102
130
  title,
103
131
  onConfirm,
104
132
  onAfterLeave,
@@ -110,9 +138,12 @@ export const ConfirmationModal = ({
110
138
  children,
111
139
  ...props
112
140
  }: ConfirmationModalProps): JSX.Element => {
141
+ const variantName = variant || mood
142
+
113
143
  const onDismiss = confirmWorking ? undefined : propsOnDismiss
114
144
 
115
145
  const footerActions: ButtonProps[] = []
146
+
116
147
  if (onConfirm) {
117
148
  const confirmAction = { label: confirmLabel, onClick: onConfirm }
118
149
  const workingProps = confirmWorking
@@ -145,7 +176,7 @@ export const ConfirmationModal = ({
145
176
  <div
146
177
  className={classnames(
147
178
  styles.header,
148
- styles[`${mood}Header`],
179
+ variant ? styles[variant] : styles[`${mood}Header`],
149
180
  isProminent && styles.prominent,
150
181
  !unpadded && styles.padded
151
182
  )}
@@ -157,7 +188,7 @@ export const ConfirmationModal = ({
157
188
  )}
158
189
  >
159
190
  <div className={styles.spotIcon}>
160
- {getIcon(mood, isProminent)}
191
+ {getIcon(variantName, isProminent)}
161
192
  </div>
162
193
  </div>
163
194
  <ModalAccessibleLabel isProminent={isProminent}>
@@ -32,9 +32,9 @@ it known to the user that they need to pay attention to important information.
32
32
 
33
33
  <Canvas of={ConfirmationModalStories.Prominent} />
34
34
 
35
- ### Assertive
35
+ ### Cautionary
36
36
 
37
- The Assertive Confirmation Modal indicates a show-stopping problem that we couldn't address earlier in the flow.
37
+ The Cautionary Confirmation Modal indicates a show-stopping problem that we couldn't address earlier in the flow.
38
38
  Use as a last resort.For example, server-side validation shows a form error that needs to be addressed before continuing.
39
39
 
40
- <Canvas of={ConfirmationModalStories.Assertive} />
40
+ <Canvas of={ConfirmationModalStories.Cautionary} />
@@ -14,7 +14,7 @@ const meta = {
14
14
  args: {
15
15
  isOpen: false,
16
16
  title: "Confirmation modal title",
17
- mood: "cautionary",
17
+ variant: "success",
18
18
  children: (
19
19
  <Text variant="body">
20
20
  Confirmation modals contain smaller pieces of content and can provide
@@ -26,7 +26,14 @@ const meta = {
26
26
  },
27
27
  argTypes: {
28
28
  children: {
29
- control: false,
29
+ control: {
30
+ disable: true,
31
+ },
32
+ },
33
+ mood: {
34
+ control: {
35
+ disable: true,
36
+ },
30
37
  },
31
38
  },
32
39
  } satisfies Meta<typeof ConfirmationModal>
@@ -79,9 +86,9 @@ export const Prominent: Story = {
79
86
  args: { isProminent: true },
80
87
  }
81
88
 
82
- export const Assertive: Story = {
89
+ export const Cautionary: Story = {
83
90
  ...ConfirmationModalTemplate,
84
- args: { mood: "assertive" },
91
+ args: { variant: "cautionary" },
85
92
  }
86
93
 
87
94
  export const Unpadded: Story = {
@@ -21,7 +21,9 @@ const meta = {
21
21
  },
22
22
  argTypes: {
23
23
  children: {
24
- control: false,
24
+ control: {
25
+ disable: true,
26
+ },
25
27
  },
26
28
  },
27
29
  } satisfies Meta<typeof ContextModal>
@@ -18,6 +18,9 @@ export type ModalFooterProps = {
18
18
  variant?: ActionsVariantProps
19
19
  unpadded?: boolean
20
20
  actions: ButtonProps[]
21
+ /**
22
+ * @deprecated we are no longer supporting different appearances for ModalFooter, instead there will only be a single default appearance set by the Button.
23
+ */
21
24
  appearance?: "primary" | "destructive"
22
25
  /**
23
26
  * @deprecated Please use data-testid
@@ -14,7 +14,10 @@ import styles from "./InputEditModal.module.scss"
14
14
  export type InputEditModalProps = {
15
15
  isOpen: boolean
16
16
  unpadded?: boolean
17
- mood: "positive" | "destructive"
17
+ /**
18
+ * @deprecated we are no longer supporting different moods for InputModal, instead there will only be a single default variant set by the component.
19
+ */
20
+ mood?: "positive" | "destructive"
18
21
  title: string
19
22
  onSubmit: () => void
20
23
  onSecondaryAction?: () => void
@@ -23,19 +23,6 @@ They support the ability to edit up to 3 fields. Any more becomes crowded and a
23
23
  <Canvas of={InputEditModalStories.Playground} />
24
24
  <Controls of={InputEditModalStories.Playground} />
25
25
 
26
- ## API
27
-
28
- ### Mood
29
-
30
- #### Positive
31
-
32
- <Canvas of={InputEditModalStories.Positive} />
33
-
34
- #### Destructive
35
- When your modal is preforming a destructive action eg. delete customer data.
36
-
37
- <Canvas of={InputEditModalStories.Destructive} />
38
-
39
26
  ### Unpadded
40
27
 
41
28
  <Canvas of={InputEditModalStories.Unpadded} />
@@ -29,7 +29,6 @@ const meta = {
29
29
  args: {
30
30
  isOpen: false,
31
31
  title: "Your input is valuable",
32
- mood: "positive",
33
32
  children: <ExampleForm />,
34
33
  submitLabel: "Submit label",
35
34
  onSubmit: fn(),
@@ -37,7 +36,14 @@ const meta = {
37
36
  },
38
37
  argTypes: {
39
38
  children: {
40
- control: false,
39
+ control: {
40
+ disable: true,
41
+ },
42
+ },
43
+ mood: {
44
+ control: {
45
+ disable: true,
46
+ },
41
47
  },
42
48
  },
43
49
  } satisfies Meta<typeof InputEditModal>
@@ -84,15 +90,8 @@ export const Playground: Story = {
84
90
  },
85
91
  }
86
92
 
87
- export const Positive: Story = {
88
- ...InputModalTemplate,
89
- args: { mood: "positive" },
90
- ...chromaticModalSettings,
91
- }
92
-
93
- export const Destructive: Story = {
93
+ export const Default: Story = {
94
94
  ...InputModalTemplate,
95
- args: { mood: "destructive" },
96
95
  ...chromaticModalSettings,
97
96
  }
98
97
 
@@ -1,15 +1,20 @@
1
1
  import React from "react"
2
- import { NotificationType } from "~components/Notification/types"
3
2
  import { OverrideClassName } from "~types/OverrideClassName"
4
- import { GenericNotification } from "../subcomponents/GenericNotification"
3
+ import {
4
+ GenericNotification,
5
+ GenericNotificationType,
6
+ GenericNotificationVariant,
7
+ } from "../subcomponents/GenericNotification"
5
8
 
6
- export type GlobalNotificationProps = OverrideClassName<{
7
- type: NotificationType
9
+ export type GlobalNotificationBase = OverrideClassName<{
8
10
  children: React.ReactNode
9
11
  onHide?: () => void
10
12
  persistent?: boolean
11
13
  }>
12
14
 
15
+ export type GlobalNotificationProps = GlobalNotificationBase &
16
+ (GenericNotificationType | GenericNotificationVariant)
17
+
13
18
  /**
14
19
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082060757/Global+Notification Guidance} |
15
20
  * {@link https://cultureamp.design/?path=/docs/components-notifications-global-notification--docs Storybook}
@@ -21,81 +21,91 @@ export default {
21
21
  },
22
22
  } satisfies Meta
23
23
 
24
- const DEFAULT_CHILDREN: JSX.Element = (
25
- <span>
26
- {"This survey status has been changed to 'Archived'. "}
27
- <a href="/">View all</a>
28
- </span>
29
- )
30
-
31
- const DEFAULT_PROPS = {
32
- persistent: false,
33
- children: DEFAULT_CHILDREN,
34
- } satisfies Partial<GlobalNotificationProps>
35
-
36
- const VARIANTS_PROPS: Array<{
37
- title: string
38
- props: GlobalNotificationProps
39
- }> = [
24
+ const variants = [
40
25
  {
41
26
  title: "Informative",
42
- props: {
43
- ...DEFAULT_PROPS,
44
- type: "informative",
45
- },
27
+ props: { variant: "informative" },
46
28
  },
47
29
  {
48
- title: "Positive",
49
- props: {
50
- ...DEFAULT_PROPS,
51
- type: "positive",
52
- },
30
+ title: "Success",
31
+ props: { variant: "success" },
53
32
  },
54
33
  {
55
- title: "Negative",
56
- props: {
57
- ...DEFAULT_PROPS,
58
- type: "negative",
59
- },
34
+ title: "Cautionary",
35
+ props: { variant: "cautionary" },
60
36
  },
61
37
  {
62
- title: "Cautionary",
63
- props: {
64
- ...DEFAULT_PROPS,
65
- type: "cautionary",
66
- },
38
+ title: "Warning",
39
+ props: { variant: "warning" },
67
40
  },
68
41
  {
69
42
  title: "Security",
70
- props: {
71
- ...DEFAULT_PROPS,
72
- type: "security",
73
- },
43
+ props: { variant: "security" },
74
44
  },
75
45
  {
76
46
  title: "Persistent",
77
- props: {
78
- ...DEFAULT_PROPS,
79
- type: "informative",
80
- persistent: true,
81
- },
47
+ props: { variant: "informative", persistent: true },
48
+ },
49
+ ] satisfies Array<{ title: string; props: Partial<GlobalNotificationProps> }>
50
+
51
+ const types = [
52
+ {
53
+ title: "Informative",
54
+ props: { type: "informative" },
55
+ },
56
+ {
57
+ title: "Success",
58
+ props: { type: "positive" },
59
+ },
60
+ {
61
+ title: "Cautionary",
62
+ props: { type: "cautionary" },
63
+ },
64
+ {
65
+ title: "Negative",
66
+ props: { type: "negative" },
82
67
  },
83
- ]
68
+ {
69
+ title: "Security",
70
+ props: { type: "security" },
71
+ },
72
+ ] satisfies Array<{ title: string; props: Partial<GlobalNotificationProps> }>
84
73
 
85
74
  const StickerSheetTemplate: StickerSheetStory = {
86
- render: ({ isReversed }) => (
87
- <>
88
- <StickerSheet heading="GlobalNotification" isReversed={isReversed}>
89
- <StickerSheet.Body>
90
- {VARIANTS_PROPS.map(({ title, props }) => (
91
- <StickerSheet.Row key={title} rowTitle={title}>
92
- <GlobalNotification {...props} />
93
- </StickerSheet.Row>
94
- ))}
95
- </StickerSheet.Body>
96
- </StickerSheet>
97
- </>
98
- ),
75
+ render: ({ isReversed }) => {
76
+ const defaultProps = {
77
+ persistent: false,
78
+ children: (
79
+ <span>
80
+ {"This survey status has been changed to 'Archived'. "}
81
+ <a href="/">View all</a>
82
+ </span>
83
+ ),
84
+ } satisfies Partial<GlobalNotificationProps>
85
+
86
+ return (
87
+ <>
88
+ <StickerSheet heading="GlobalNotification" isReversed={isReversed}>
89
+ <StickerSheet.Body>
90
+ {variants.map(({ title, props }) => (
91
+ <StickerSheet.Row key={title} rowTitle={title}>
92
+ <GlobalNotification {...defaultProps} {...props} />
93
+ </StickerSheet.Row>
94
+ ))}
95
+ </StickerSheet.Body>
96
+ </StickerSheet>
97
+ <StickerSheet heading="Type (deprecated)" isReversed={isReversed}>
98
+ <StickerSheet.Body>
99
+ {types.map(({ title, props }) => (
100
+ <StickerSheet.Row key={title} rowTitle={title}>
101
+ <GlobalNotification {...defaultProps} {...props} />
102
+ </StickerSheet.Row>
103
+ ))}
104
+ </StickerSheet.Body>
105
+ </StickerSheet>
106
+ </>
107
+ )
108
+ },
99
109
  }
100
110
 
101
111
  export const StickerSheetDefault: StickerSheetStory = {