@kaizen/components 1.68.0 → 1.68.2

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.
@@ -23,21 +23,107 @@ pnpm kaizen-codemod src migrateWellVariantToColor
23
23
  ```
24
24
 
25
25
  ## Available codemods
26
- - `migrateBrandMomentMoodToVariant`: Migrates `BrandMoment` component prop from `mood` to `variant`
27
- - `migrateCardVariantToColor`: Migrates `Card` component prop from `variant` to `color`
28
- - `migrateConfirmationModalMoodsToVariant`: Migrates `ConfirmationModal` component prop from `mood` to `variant`
29
- - `migrateEmptyStateIllustrationTypeToVariant`: Migrates `EmptyState` component prop from `illustrationType` to `variant`
30
- - `migrateGlobalNotificationTypeToVariant`: Transforms `GlobalNotification`'s `type` prop to the new `variant` prop
31
- - `migrateInformationTileMoodToVariant`: Migrates `InformationTile` component prop from `mood` to `variant`
32
- - `migrateInlineNotificationTypeToVariant`: Transforms `InlineNotification`'s `type` prop to the new `variant` prop
33
- - `migrateMultiActionTileMoodToVariant`: Migrates `MultiActionTile` component prop from `mood` to `variant`
34
- - `migrateProgressBarMoodToColor`: Migrates `ProgressBar` component prop from `mood` to `color`
35
- - `migrateToastNotificationTypeToVariant`: Transforms `ToastNotification`'s `type` prop to the new `variant` prop
36
- - `migrateWellVariantToColor`: Migrates `Well` component prop from `variant` to `color`
37
- - `removeInputEditModalMood`: Removes `InputEditModal` component prop `mood`
38
- - `removePopoverVariant`: Removes `Popover` component props `variant` and `customIcon`
39
- - `upgradeIconV1`: Migrates `*Icon` components to a new equivalent
40
- - `CaMonogramIcon` becomes `Brand`
41
- - `SpinnerIcon` becomes `LoadingSpinner`
42
- - All other Icons become future `Icon`
43
- - **Note:** See [Icon API Specification (Future)](https://cultureamp.design/?path=/docs/illustrations-icon-icon-future-api-specification--docs) for setup instructions
26
+
27
+ ### `migrateBrandMomentMoodToVariant`
28
+
29
+ Released in `1.58.0`
30
+
31
+ Migrates `BrandMoment` component prop from `mood` to `variant`.
32
+
33
+ ### `migrateCardVariantToColor`
34
+
35
+ Released in `1.58.0`
36
+
37
+ Migrates `Card` component prop from `variant` to `color`.
38
+
39
+ ### `migrateConfirmationModalMoodsToVariant`
40
+
41
+ Released in `1.58.0`
42
+
43
+ Migrates `ConfirmationModal` component prop from `mood` to `variant`.
44
+
45
+ ### `migrateEmptyStateIllustrationTypeToVariant`
46
+
47
+ Released in `1.58.0`
48
+
49
+ Migrates `EmptyState` component prop from `illustrationType` to `variant`.
50
+
51
+ ### `migrateGlobalNotificationTypeToVariant`
52
+
53
+ Released in `1.58.0`
54
+
55
+ Transforms `GlobalNotification`'s `type` prop to the new `variant` prop.
56
+
57
+ ### `migrateInformationTileMoodToVariant`
58
+
59
+ Released in `1.58.0`
60
+
61
+ Migrates `InformationTile` component prop from `mood` to `variant`.
62
+
63
+ ### `migrateInlineNotificationTypeToVariant`
64
+
65
+ Released in `1.58.0`
66
+
67
+ Transforms `InlineNotification`'s `type` prop to the new `variant` prop.
68
+
69
+ ### `migrateMultiActionTileMoodToVariant`
70
+
71
+ Released in `1.58.0`
72
+
73
+ Migrates `MultiActionTile` component prop from `mood` to `variant`.
74
+
75
+ ### `migrateProgressBarMoodToColor`
76
+
77
+ Released in `1.58.0`
78
+
79
+ Migrates `ProgressBar` component prop from `mood` to `color`.
80
+
81
+ ### `migrateToastNotificationTypeToVariant`
82
+
83
+ Released in `1.58.0`
84
+
85
+ Transforms `ToastNotification`'s `type` prop to the new `variant` prop.
86
+
87
+ ### `migrateWellVariantToColor`
88
+
89
+ Released in `1.58.0`
90
+
91
+ Migrates `Well` component prop from `variant` to `color`.
92
+
93
+ ### `removeInputEditModalMood`
94
+
95
+ Released in `1.58.0`
96
+
97
+ Removes `InputEditModal` component prop `mood`.
98
+
99
+ ### `removePopoverVariant`
100
+
101
+ Released in `1.60.0`
102
+
103
+ Removes `Popover` component props `variant` and `customIcon`.
104
+
105
+ ### `upgradeIconV1`
106
+
107
+ Released in `1.67.0`; last updated in `1.68.1`
108
+
109
+ Migrates `*Icon` components to a new equivalent.
110
+
111
+ - `CaMonogramIcon` becomes `Brand` variant `enso`
112
+ - `inheritSize` will be removed if set, if not set then `style` will be added to make it 20px (manually adjust to a `className` if you can)
113
+ - `SpinnerIcon` becomes `LoadingSpinner`
114
+ - `aria-label` will be replaced with `accessibilityLabel` (with a fallback value of `"Loading"`)
115
+ - `role` will be removed
116
+ - `viewBox` will be removed
117
+ - All other Icons become future `Icon`
118
+ - **Note:** See [Icon API Specification (Future)](https://cultureamp.design/?path=/docs/illustrations-icon-icon-future-api-specification--docs) for setup instructions
119
+ - Icons previously filled may become unfilled. This is intentional as filled icons should only be for active states or selection (see [Icon Usage Guidelines (Future)](https://cultureamp.design/?path=/docs/illustrations-icon-icon-future-usage-guidelines--docs#do-use-the-appropriate-fill-for-the-icon-context-and-state))
120
+ - `role="presentational"` becomes `isPresentational`
121
+ - `role="img"` will be removed (as `aria-label` should exist)
122
+ - `aria-label` becomes `alt`
123
+ - `classNameOverride` becomes `className`
124
+ - `inheritSize` will remain - however is no longer a valid prop, therefore will have a TypeScript error and will be prefixed with a comment to manually fix the usage
125
+ - `aria-hidden` becomes `isPresentational`
126
+ - `color` becomes an inline `style` (manually adjust to a `className` if you can)
127
+ - `fontSize` will be removed
128
+ - `height` and `width` become an inline `style` (manually adjust to a `className` if you can, ideally setting `--icon-size`)
129
+ - `viewBox` will be removed
@@ -88,10 +88,10 @@ const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
88
88
  ["EngagementWhiteIcon", undefined],
89
89
  ["EqualIcon", undefined],
90
90
  ["EqualWhiteIcon", undefined],
91
- ["ExclamationIcon", { name: "error" }],
91
+ ["ExclamationIcon", { name: "error", isFilled: true }],
92
92
  ["ExclamationOctagonIcon", { name: "warning" }],
93
93
  ["ExclamationOctagonWhiteIcon", undefined],
94
- ["ExclamationWhiteIcon", { name: "error" }],
94
+ ["ExclamationWhiteIcon", { name: "error", isFilled: true }],
95
95
  ["ExperienceIcon", undefined],
96
96
  ["ExportIcon", { name: "cloud_download" }],
97
97
  ["ExportWhiteIcon", { name: "cloud_download" }],
@@ -138,8 +138,8 @@ const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
138
138
  ["IncreaseIndentIcon", { name: "format_indent_increase" }],
139
139
  ["IndicatorActiveIcon", { name: "radio_button_checked" }],
140
140
  ["IndicatorInactiveIcon", { name: "radio_button_unchecked" }],
141
- ["InformationIcon", { name: "info" }],
142
- ["InformationWhiteIcon", { name: "info" }],
141
+ ["InformationIcon", { name: "info", isFilled: true }],
142
+ ["InformationWhiteIcon", { name: "info", isFilled: true }],
143
143
  ["InsightIcon", { name: "find_in_page" }],
144
144
  ["InsightsIcon", undefined],
145
145
  ["InvisibleIcon", { name: "visibility_off" }],
@@ -180,9 +180,9 @@ const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
180
180
  ["ProcessManagerIcon", { name: "playlist_add_check" }],
181
181
  ["PromotionIcon", { name: "grade" }],
182
182
  ["PromotionWhiteIcon", undefined],
183
- ["QuestionIcon", { name: "help" }],
183
+ ["QuestionIcon", { name: "help", isFilled: true }],
184
184
  ["QuestionsIcon", undefined],
185
- ["QuestionWhiteIcon", { name: "help" }],
185
+ ["QuestionWhiteIcon", { name: "help", isFilled: true }],
186
186
  ["RedoIcon", { name: "redo" }],
187
187
  ["RefreshIcon", { name: "refresh" }],
188
188
  ["RemoveLinkIcon", { name: "link_off" }],
@@ -193,7 +193,7 @@ const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
193
193
  ["SaveIcon", undefined],
194
194
  ["SearchIcon", { name: "search" }],
195
195
  ["SearchWhiteIcon", { name: "search" }],
196
- ["SecurityTipIcon", { name: "privacy_tip" }],
196
+ ["SecurityTipIcon", { name: "privacy_tip", isFilled: true }],
197
197
  ["SendIcon", { name: "send" }],
198
198
  ["SendRtlIcon", undefined],
199
199
  ["SettingsIcon", { name: "settings" }],
@@ -209,8 +209,8 @@ const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
209
209
  ["StartIcon", { name: "keyboard_tab_rtl" }],
210
210
  ["SubtractIcon", { name: "remove" }],
211
211
  ["SubtractWhiteIcon", undefined],
212
- ["SuccessIcon", { name: "check_circle" }],
213
- ["SuccessWhiteIcon", { name: "check_circle" }],
212
+ ["SuccessIcon", { name: "check_circle", isFilled: true }],
213
+ ["SuccessWhiteIcon", { name: "check_circle", isFilled: true }],
214
214
  ["SupportIcon", { name: "support" }],
215
215
  ["SurveysIcon", { name: "assignment" }],
216
216
  ["SurveysWhiteIcon", { name: "assignment" }],
package/dist/styles.css CHANGED
@@ -61,11 +61,19 @@
61
61
  align-items: center;
62
62
  }
63
63
 
64
- .MenuItem-module_item__uImZI[data-focused] {
64
+ .MenuItem-module_item__uImZI:focus {
65
+ outline: none;
66
+ }
67
+
68
+ .MenuItem-module_item__uImZI[data-hovered],
69
+ .MenuItem-module_item__uImZI[data-focus-visible] {
65
70
  background-color: var(--color-blue-100);
66
71
  color: var(--color-blue-500);
67
- outline: none;
68
- border-color: var(--color-blue-500);
72
+ }
73
+
74
+ .MenuItem-module_item__uImZI[data-focus-visible] {
75
+ outline: var(--border-focus-ring-border-width)
76
+ var(--border-focus-ring-border-style) var(--color-blue-500);
69
77
  }
70
78
 
71
79
  .MenuItem-module_item__uImZI[data-disabled] {
@@ -350,6 +358,34 @@
350
358
  }
351
359
  /** THIS IS AN AUTOGENERATED FILE **/
352
360
  /** THIS IS AN AUTOGENERATED FILE **/
361
+ .OverlayArrow-module_overlayArrow__hoDyK {
362
+ display: flex;
363
+ padding: 8px;
364
+ }
365
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=top], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] {
366
+ padding: 0 8px;
367
+ }
368
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] {
369
+ padding: 8px 0;
370
+ }
371
+ .OverlayArrow-module_overlayArrow__hoDyK path {
372
+ fill: var(--color-purple-800, #2f2438);
373
+ box-shadow: var(--shadow-small-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 16px 0 rgba(0, 0, 0, 0.06));
374
+ }
375
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] svg {
376
+ transform: rotate(90deg);
377
+ }
378
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] svg {
379
+ transform: rotate(180deg);
380
+ }
381
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left] svg {
382
+ transform: rotate(270deg);
383
+ }
384
+ .OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
385
+ fill: var(--color-white, #ffffff);
386
+ }
387
+ /** THIS IS AN AUTOGENERATED FILE **/
388
+ /** THIS IS AN AUTOGENERATED FILE **/
353
389
  /** THIS IS AN AUTOGENERATED FILE **/
354
390
  /** THIS IS AN AUTOGENERATED FILE **/
355
391
  /** THIS IS AN AUTOGENERATED FILE **/
@@ -404,34 +440,6 @@
404
440
  opacity: 1;
405
441
  }
406
442
  }
407
- /** THIS IS AN AUTOGENERATED FILE **/
408
- /** THIS IS AN AUTOGENERATED FILE **/
409
- .OverlayArrow-module_overlayArrow__hoDyK {
410
- display: flex;
411
- padding: 8px;
412
- }
413
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=top], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] {
414
- padding: 0 8px;
415
- }
416
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] {
417
- padding: 8px 0;
418
- }
419
- .OverlayArrow-module_overlayArrow__hoDyK path {
420
- fill: var(--color-purple-800, #2f2438);
421
- box-shadow: var(--shadow-small-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 16px 0 rgba(0, 0, 0, 0.06));
422
- }
423
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] svg {
424
- transform: rotate(90deg);
425
- }
426
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] svg {
427
- transform: rotate(180deg);
428
- }
429
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left] svg {
430
- transform: rotate(270deg);
431
- }
432
- .OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
433
- fill: var(--color-white, #ffffff);
434
- }
435
443
  /*
436
444
  * This is taken from the Material Symbols CDN
437
445
  * font-weight & font-size removed as overridden in .icon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "1.68.0",
3
+ "version": "1.68.2",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -27,11 +27,19 @@
27
27
  align-items: center;
28
28
  }
29
29
 
30
- .item[data-focused] {
30
+ .item:focus {
31
+ outline: none;
32
+ }
33
+
34
+ .item[data-hovered],
35
+ .item[data-focus-visible] {
31
36
  background-color: var(--color-blue-100);
32
37
  color: var(--color-blue-500);
33
- outline: none;
34
- border-color: var(--color-blue-500);
38
+ }
39
+
40
+ .item[data-focus-visible] {
41
+ outline: var(--border-focus-ring-border-width)
42
+ var(--border-focus-ring-border-style) var(--color-blue-500);
35
43
  }
36
44
 
37
45
  .item[data-disabled] {
@@ -44,6 +44,7 @@ export const Actions: Story = {
44
44
  <Button
45
45
  size="large"
46
46
  icon={<Icon name="more_horiz" isPresentational />}
47
+ variant="secondary"
47
48
  hasHiddenLabel
48
49
  >
49
50
  Additional actions
@@ -66,6 +67,7 @@ export const ItemsDo: Story = {
66
67
  <Button
67
68
  size="large"
68
69
  icon={<Icon name="more_horiz" isPresentational />}
70
+ variant="secondary"
69
71
  hasHiddenLabel
70
72
  >
71
73
  Additional actions
@@ -85,6 +87,7 @@ export const ItemsDont: Story = {
85
87
  <Button
86
88
  size="large"
87
89
  icon={<Icon name="more_horiz" isPresentational />}
90
+ variant="secondary"
88
91
  hasHiddenLabel
89
92
  >
90
93
  Additional actions
@@ -103,7 +106,7 @@ export const ItemsDont: Story = {
103
106
  export const SelectionDont: Story = {
104
107
  render: ({ defaultOpen, ...args }) => (
105
108
  <MenuTrigger defaultOpen={defaultOpen} {...args}>
106
- <Button className="[--icon-size:24]">
109
+ <Button variant="secondary" className="[--icon-size:24]">
107
110
  Sort by
108
111
  <Icon name="keyboard_arrow_down" isPresentational />
109
112
  </Button>
@@ -122,7 +125,7 @@ export const SelectionDont: Story = {
122
125
  export const LabelChevronDo: Story = {
123
126
  render: ({ defaultOpen, ...args }) => (
124
127
  <MenuTrigger defaultOpen={defaultOpen} {...args}>
125
- <Button className="[--icon-size:24]">
128
+ <Button variant="secondary" className="[--icon-size:24]">
126
129
  Edit item
127
130
  <Icon name="keyboard_arrow_down" isPresentational />
128
131
  </Button>
@@ -138,7 +141,7 @@ export const LabelChevronDo: Story = {
138
141
  export const LabelChevronDont: Story = {
139
142
  render: ({ defaultOpen, ...args }) => (
140
143
  <MenuTrigger defaultOpen={defaultOpen} {...args}>
141
- <Button>Edit item</Button>
144
+ <Button variant="secondary">Edit item</Button>
142
145
  <Popover>
143
146
  <Menu>
144
147
  <DefaultMenuItems />
@@ -151,7 +154,7 @@ export const LabelChevronDont: Story = {
151
154
  export const LabelDo: Story = {
152
155
  render: ({ defaultOpen, ...args }) => (
153
156
  <MenuTrigger defaultOpen={defaultOpen}>
154
- <Button className="[--icon-size:24]">
157
+ <Button variant="secondary" className="[--icon-size:24]">
155
158
  Actions [visually hidden], conversation with Harper[/visually hidden]
156
159
  <Icon name="keyboard_arrow_down" isPresentational />
157
160
  </Button>
@@ -167,7 +170,7 @@ export const LabelDo: Story = {
167
170
  export const LabelDont: Story = {
168
171
  render: ({ defaultOpen, ...args }) => (
169
172
  <MenuTrigger defaultOpen={defaultOpen}>
170
- <Button className="[--icon-size:24]">
173
+ <Button variant="secondary" className="[--icon-size:24]">
171
174
  Open menu
172
175
  <Icon name="keyboard_arrow_down" isPresentational />
173
176
  </Button>
@@ -186,6 +189,7 @@ export const IconsDont: Story = {
186
189
  <Button
187
190
  size="large"
188
191
  icon={<Icon name="more_horiz" isPresentational />}
192
+ variant="secondary"
189
193
  hasHiddenLabel
190
194
  >
191
195
  Additional actions
@@ -212,6 +216,7 @@ export const MenuItemLabelsDont: Story = {
212
216
  <Button
213
217
  size="large"
214
218
  icon={<Icon name="more_horiz" isPresentational />}
219
+ variant="secondary"
215
220
  hasHiddenLabel
216
221
  >
217
222
  Additional actions
@@ -233,6 +238,7 @@ export const SentenceCaseDo: Story = {
233
238
  <Button
234
239
  size="large"
235
240
  icon={<Icon name="more_horiz" isPresentational />}
241
+ variant="secondary"
236
242
  hasHiddenLabel
237
243
  >
238
244
  Additional actions
@@ -254,6 +260,7 @@ export const SentenceCaseDont: Story = {
254
260
  <Button
255
261
  size="large"
256
262
  icon={<Icon name="more_horiz" isPresentational />}
263
+ variant="secondary"
257
264
  hasHiddenLabel
258
265
  >
259
266
  Additional actions
@@ -275,6 +282,7 @@ export const ElipsesDo: Story = {
275
282
  <Button
276
283
  size="large"
277
284
  icon={<Icon name="more_horiz" isPresentational />}
285
+ variant="secondary"
278
286
  hasHiddenLabel
279
287
  >
280
288
  Additional actions
@@ -296,6 +304,7 @@ export const ElipsesDont: Story = {
296
304
  <Button
297
305
  size="large"
298
306
  icon={<Icon name="more_horiz" isPresentational />}
307
+ variant="secondary"
299
308
  hasHiddenLabel
300
309
  >
301
310
  Additional actions
@@ -39,6 +39,7 @@ export const KitchenSink: Story = {
39
39
  <Button
40
40
  size="large"
41
41
  icon={<Icon name="more_horiz" isPresentational />}
42
+ variant="secondary"
42
43
  hasHiddenLabel
43
44
  >
44
45
  Additional actions
@@ -91,6 +92,7 @@ export const Basic: Story = {
91
92
  <Button
92
93
  size="large"
93
94
  icon={<Icon name="more_horiz" isPresentational />}
95
+ variant="secondary"
94
96
  hasHiddenLabel
95
97
  >
96
98
  Additional actions
@@ -177,6 +179,7 @@ export const DisabledItems: Story = {
177
179
  <Button
178
180
  size="large"
179
181
  icon={<Icon name="more_horiz" isPresentational />}
182
+ variant="secondary"
180
183
  hasHiddenLabel
181
184
  >
182
185
  Additional actions
@@ -221,6 +224,7 @@ export const WithSections: Story = {
221
224
  <Button
222
225
  size="large"
223
226
  icon={<Icon name="more_horiz" isPresentational />}
227
+ variant="secondary"
224
228
  hasHiddenLabel
225
229
  >
226
230
  Additional actions
@@ -256,6 +260,7 @@ export const Controlled: Story = {
256
260
  <MenuTrigger isOpen={isOpen} onOpenChange={setOpen}>
257
261
  <Button
258
262
  icon={<Icon name="more_horiz" isPresentational />}
263
+ variant="secondary"
259
264
  hasHiddenLabel
260
265
  >
261
266
  Additional actions
@@ -28,6 +28,7 @@ export const Playground: Story = {
28
28
  <Button
29
29
  size="large"
30
30
  icon={<Icon name="more_horiz" isPresentational />}
31
+ variant="secondary"
31
32
  hasHiddenLabel
32
33
  >
33
34
  Additional actions
@@ -75,6 +76,7 @@ export const RichContent: Story = {
75
76
  <Button
76
77
  size="large"
77
78
  icon={<Icon name="more_horiz" isPresentational />}
79
+ variant="secondary"
78
80
  hasHiddenLabel
79
81
  >
80
82
  Additional actions