@kaizen/components 1.66.0 → 1.67.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 (274) hide show
  1. package/codemods/README.md +5 -0
  2. package/codemods/upgradeIconV1/getNewIconPropsFromOldIconName.ts +255 -0
  3. package/codemods/upgradeIconV1/index.ts +33 -0
  4. package/codemods/upgradeIconV1/transformCaMonogramIconToBrand.spec.ts +83 -0
  5. package/codemods/upgradeIconV1/transformCaMonogramIconToBrand.ts +53 -0
  6. package/codemods/upgradeIconV1/transformIcon.spec.ts +181 -0
  7. package/codemods/upgradeIconV1/transformIcon.ts +115 -0
  8. package/codemods/upgradeIconV1/transformSpinnerIconToLoadingSpinner.spec.ts +81 -0
  9. package/codemods/upgradeIconV1/transformSpinnerIconToLoadingSpinner.ts +41 -0
  10. package/codemods/upgradeIconV1/upgradeIconV1.spec.ts +306 -0
  11. package/codemods/upgradeIconV1/upgradeIconV1.ts +94 -0
  12. package/codemods/utils/createProp.spec.ts +83 -0
  13. package/codemods/utils/createProp.ts +51 -0
  14. package/codemods/utils/getKaioTagName.spec.ts +85 -0
  15. package/codemods/utils/getKaioTagName.ts +129 -0
  16. package/codemods/utils/index.ts +3 -1
  17. package/codemods/utils/transformComponentsInDir.ts +32 -16
  18. package/codemods/utils/transformSource.ts +10 -5
  19. package/codemods/utils/updateJsxElementWithNewProps.ts +4 -3
  20. package/codemods/utils/updateKaioImports.spec.ts +223 -0
  21. package/codemods/utils/updateKaioImports.ts +233 -0
  22. package/dist/cjs/Avatar/Avatar.cjs +16 -13
  23. package/dist/cjs/Calendar/CalendarRange/CalendarRange.cjs +9 -7
  24. package/dist/cjs/Calendar/CalendarSingle/CalendarSingle.cjs +9 -7
  25. package/dist/cjs/Calendar/LegacyCalendarRange/LegacyCalendarRange.cjs +9 -7
  26. package/dist/cjs/Checkbox/Checkbox/Checkbox.cjs +5 -11
  27. package/dist/cjs/ClearButton/ClearButton.cjs +5 -4
  28. package/dist/cjs/Collapsible/Collapsible/Collapsible.cjs +4 -7
  29. package/dist/cjs/DateInput/DateInputWithIconButton/DateInputWithIconButton.cjs +5 -4
  30. package/dist/cjs/DateRangePicker/DateRangePicker.cjs +5 -4
  31. package/dist/cjs/ErrorPage/ErrorPage.cjs +9 -7
  32. package/dist/cjs/FieldMessage/FieldMessage.cjs +5 -11
  33. package/dist/cjs/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +4 -5
  34. package/dist/cjs/Filter/FilterButton/FilterButton/FilterButton.cjs +4 -7
  35. package/dist/cjs/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.cjs +5 -5
  36. package/dist/cjs/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.cjs +4 -4
  37. package/dist/cjs/GuidanceBlock/GuidanceBlock.cjs +5 -4
  38. package/dist/cjs/Illustration/utils/usePausePlay.cjs +5 -8
  39. package/dist/cjs/Input/InputSearch/InputSearch.cjs +4 -3
  40. package/dist/cjs/LikertScaleLegacy/LikertScaleLegacy.cjs +5 -6
  41. package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +31 -26
  42. package/dist/cjs/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.cjs +4 -5
  43. package/dist/cjs/MultiSelect/subcomponents/Checkbox/Checkbox.cjs +7 -17
  44. package/dist/cjs/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.cjs +4 -7
  45. package/dist/cjs/Notification/subcomponents/CancelButton/CancelButton.cjs +4 -3
  46. package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +33 -38
  47. package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css.cjs +6 -0
  48. package/dist/cjs/Pagination/subcomponents/DirectionalLink/DirectionalLink.cjs +11 -19
  49. package/dist/cjs/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.cjs +4 -5
  50. package/dist/cjs/Popover/Popover.cjs +5 -4
  51. package/dist/cjs/Popover/utils/classMappers.cjs +21 -16
  52. package/dist/cjs/RichTextEditor/RichTextEditor/utils/controlmap.cjs +29 -25
  53. package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.cjs +10 -12
  54. package/dist/cjs/Select/Select.cjs +8 -10
  55. package/dist/cjs/SplitButton/subcomponents/DropdownButton/DropdownButton.cjs +4 -4
  56. package/dist/cjs/Table/Table.cjs +11 -10
  57. package/dist/cjs/Tag/Tag.cjs +21 -17
  58. package/dist/cjs/TextField/TextField.cjs +5 -4
  59. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +8 -7
  60. package/dist/cjs/TitleBlockZen/TitleBlockZen.cjs +9 -12
  61. package/dist/cjs/TitleBlockZen/subcomponents/MainActions.cjs +7 -7
  62. package/dist/cjs/TitleBlockZen/subcomponents/MobileActions.cjs +10 -15
  63. package/dist/cjs/TitleBlockZen/subcomponents/SecondaryActions.cjs +7 -7
  64. package/dist/cjs/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +5 -5
  65. package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs +13 -18
  66. package/dist/cjs/__future__/Icon/Icon.cjs +47 -0
  67. package/dist/cjs/__future__/Icon/Icon.module.css.cjs +10 -0
  68. package/dist/cjs/__future__/Icon/constants.cjs +8 -0
  69. package/dist/cjs/__future__/Select/subcomponents/Option/Option.cjs +4 -5
  70. package/dist/cjs/__future__/Select/subcomponents/SelectToggle/SelectToggle.cjs +5 -9
  71. package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveButton.cjs +4 -3
  72. package/dist/cjs/future.cjs +2 -0
  73. package/dist/esm/Avatar/Avatar.mjs +16 -13
  74. package/dist/esm/Calendar/CalendarRange/CalendarRange.mjs +9 -7
  75. package/dist/esm/Calendar/CalendarSingle/CalendarSingle.mjs +9 -7
  76. package/dist/esm/Calendar/LegacyCalendarRange/LegacyCalendarRange.mjs +9 -7
  77. package/dist/esm/Checkbox/Checkbox/Checkbox.mjs +5 -11
  78. package/dist/esm/ClearButton/ClearButton.mjs +5 -4
  79. package/dist/esm/Collapsible/Collapsible/Collapsible.mjs +5 -8
  80. package/dist/esm/DateInput/DateInputWithIconButton/DateInputWithIconButton.mjs +5 -4
  81. package/dist/esm/DateRangePicker/DateRangePicker.mjs +5 -4
  82. package/dist/esm/ErrorPage/ErrorPage.mjs +10 -8
  83. package/dist/esm/FieldMessage/FieldMessage.mjs +6 -12
  84. package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +4 -5
  85. package/dist/esm/Filter/FilterButton/FilterButton/FilterButton.mjs +5 -8
  86. package/dist/esm/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.mjs +5 -5
  87. package/dist/esm/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.mjs +4 -4
  88. package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +5 -4
  89. package/dist/esm/Illustration/utils/usePausePlay.mjs +5 -8
  90. package/dist/esm/Input/InputSearch/InputSearch.mjs +4 -3
  91. package/dist/esm/LikertScaleLegacy/LikertScaleLegacy.mjs +5 -6
  92. package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +31 -26
  93. package/dist/esm/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.mjs +4 -5
  94. package/dist/esm/MultiSelect/subcomponents/Checkbox/Checkbox.mjs +7 -17
  95. package/dist/esm/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.mjs +5 -8
  96. package/dist/esm/Notification/subcomponents/CancelButton/CancelButton.mjs +4 -3
  97. package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +33 -38
  98. package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css.mjs +4 -0
  99. package/dist/esm/Pagination/subcomponents/DirectionalLink/DirectionalLink.mjs +11 -19
  100. package/dist/esm/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.mjs +4 -5
  101. package/dist/esm/Popover/Popover.mjs +5 -4
  102. package/dist/esm/Popover/utils/classMappers.mjs +21 -16
  103. package/dist/esm/RichTextEditor/RichTextEditor/utils/controlmap.mjs +33 -29
  104. package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.mjs +10 -12
  105. package/dist/esm/Select/Select.mjs +9 -11
  106. package/dist/esm/SplitButton/subcomponents/DropdownButton/DropdownButton.mjs +4 -4
  107. package/dist/esm/Table/Table.mjs +11 -10
  108. package/dist/esm/Tag/Tag.mjs +21 -17
  109. package/dist/esm/TextField/TextField.mjs +5 -4
  110. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +8 -7
  111. package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +9 -12
  112. package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs +7 -7
  113. package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs +13 -18
  114. package/dist/esm/TitleBlockZen/subcomponents/SecondaryActions.mjs +7 -7
  115. package/dist/esm/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +5 -5
  116. package/dist/esm/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs +16 -21
  117. package/dist/esm/__future__/Icon/Icon.mjs +38 -0
  118. package/dist/esm/__future__/Icon/Icon.module.css.mjs +8 -0
  119. package/dist/esm/__future__/Icon/constants.mjs +6 -0
  120. package/dist/esm/__future__/Select/subcomponents/Option/Option.mjs +4 -5
  121. package/dist/esm/__future__/Select/subcomponents/SelectToggle/SelectToggle.mjs +6 -10
  122. package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveButton.mjs +4 -3
  123. package/dist/esm/future.mjs +1 -0
  124. package/dist/styles.css +585 -561
  125. package/dist/types/__future__/Icon/Icon.d.ts +21 -0
  126. package/dist/types/__future__/Icon/constants.d.ts +5 -0
  127. package/dist/types/__future__/Icon/index.d.ts +1 -0
  128. package/dist/types/__future__/Icon/types.d.ts +4 -0
  129. package/dist/types/__future__/index.d.ts +1 -0
  130. package/package.json +10 -10
  131. package/src/Avatar/Avatar.module.scss +6 -8
  132. package/src/Avatar/Avatar.tsx +14 -5
  133. package/src/BrandMoment/_docs/BrandMoment.stories.tsx +6 -10
  134. package/src/BrandMoment/_docs/ExampleHeaders.tsx +2 -2
  135. package/src/Calendar/CalendarRange/CalendarRange.tsx +7 -3
  136. package/src/Calendar/CalendarSingle/CalendarSingle.tsx +7 -3
  137. package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.tsx +7 -3
  138. package/src/Calendar/baseCalendarClassNames.module.scss +0 -4
  139. package/src/Checkbox/Checkbox/Checkbox.module.scss +0 -8
  140. package/src/Checkbox/Checkbox/Checkbox.tsx +6 -8
  141. package/src/ClearButton/ClearButton.tsx +2 -2
  142. package/src/Collapsible/Collapsible/Collapsible.tsx +5 -6
  143. package/src/Collapsible/Collapsible/_docs/Collapsible.stories.tsx +2 -2
  144. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +2 -7
  145. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.tsx +2 -2
  146. package/src/DateRangePicker/DateRangePicker.tsx +2 -2
  147. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +8 -2
  148. package/src/EmptyState/_docs/EmptyState.stories.tsx +4 -2
  149. package/src/ErrorPage/ErrorPage.tsx +5 -3
  150. package/src/FieldMessage/FieldMessage.tsx +6 -14
  151. package/src/Filter/FilterBar/FilterBar.spec.tsx +12 -12
  152. package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +2 -2
  153. package/src/Filter/FilterButton/FilterButton/FilterButton.module.scss +1 -1
  154. package/src/Filter/FilterButton/FilterButton/FilterButton.tsx +5 -6
  155. package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.tsx +2 -2
  156. package/src/Filter/FilterDateRangePicker/FilterDateRangePicker.spec.tsx +0 -1
  157. package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.spec.tsx +2 -1
  158. package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.tsx +2 -2
  159. package/src/Filter/FilterSelect/FilterSelect.spec.tsx +4 -5
  160. package/src/GuidanceBlock/GuidanceBlock.tsx +6 -2
  161. package/src/Icon/_docs/{Icon.stories.tsx → Icon.docs.stories.tsx} +1 -1
  162. package/src/Icon/_docs/Icon.mdx +1 -2
  163. package/src/Icon/_docs/Icon.stickersheet.stories.tsx +1 -1
  164. package/src/Illustration/utils/usePausePlay.tsx +7 -5
  165. package/src/Input/Input/_docs/Input.stickersheet.stories.tsx +7 -5
  166. package/src/Input/Input/_docs/Input.stories.tsx +5 -3
  167. package/src/Input/InputSearch/InputSearch.tsx +2 -2
  168. package/src/Label/Label.module.scss +4 -0
  169. package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +2 -2
  170. package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.stories.tsx +2 -2
  171. package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +2 -0
  172. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +32 -35
  173. package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.tsx +2 -2
  174. package/src/MultiSelect/MultiSelect.spec.tsx +7 -3
  175. package/src/MultiSelect/subcomponents/Checkbox/Checkbox.module.scss +0 -6
  176. package/src/MultiSelect/subcomponents/Checkbox/Checkbox.tsx +10 -9
  177. package/src/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.spec.tsx +11 -7
  178. package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.tsx +5 -7
  179. package/src/Notification/subcomponents/CancelButton/CancelButton.tsx +2 -2
  180. package/src/Notification/subcomponents/GenericNotification/_mixins.scss +2 -0
  181. package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css +3 -0
  182. package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +22 -16
  183. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.module.scss +0 -4
  184. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.tsx +13 -12
  185. package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.module.scss +0 -1
  186. package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.tsx +2 -2
  187. package/src/Popover/Popover.module.scss +3 -3
  188. package/src/Popover/Popover.tsx +2 -2
  189. package/src/Popover/utils/classMappers.tsx +6 -11
  190. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stickersheet.stories.tsx +7 -7
  191. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stories.tsx +2 -2
  192. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.spec.tsx +7 -4
  193. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/_docs/Toolbar.stories.tsx +18 -12
  194. package/src/RichTextEditor/RichTextEditor/utils/controlmap.tsx +25 -18
  195. package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx +4 -8
  196. package/src/Select/Select.module.scss +2 -0
  197. package/src/Select/Select.tsx +10 -7
  198. package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.spec.tsx +4 -5
  199. package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.tsx +2 -2
  200. package/src/Table/Table.tsx +4 -8
  201. package/src/Table/_docs/Table.stickersheet.stories.tsx +4 -4
  202. package/src/Table/_docs/Table.stories.tsx +3 -3
  203. package/src/Tag/Tag.module.scss +2 -0
  204. package/src/Tag/Tag.tsx +7 -13
  205. package/src/Text/Text.module.scss +2 -0
  206. package/src/TextField/TextField.spec.tsx +9 -4
  207. package/src/TextField/TextField.tsx +2 -2
  208. package/src/TextField/_docs/TextField.stories.tsx +4 -3
  209. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +3 -3
  210. package/src/TitleBlockZen/TitleBlockZen.module.scss +1 -0
  211. package/src/TitleBlockZen/TitleBlockZen.spec.tsx +1 -1
  212. package/src/TitleBlockZen/TitleBlockZen.tsx +6 -9
  213. package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +5 -5
  214. package/src/TitleBlockZen/subcomponents/MainActions.tsx +5 -3
  215. package/src/TitleBlockZen/subcomponents/MobileActions.tsx +13 -16
  216. package/src/TitleBlockZen/subcomponents/SecondaryActions.tsx +3 -3
  217. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +0 -3
  218. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +2 -2
  219. package/src/Workflow/_docs/Workflow.stories.tsx +4 -5
  220. package/src/Workflow/_docs/WorkflowHeader.stories.tsx +4 -5
  221. package/src/Workflow/_docs/controls/controls.tsx +4 -4
  222. package/src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx +6 -31
  223. package/src/__actions__/Button/v1/Button/_docs/Button.stickersheet.stories.tsx +5 -5
  224. package/src/__actions__/Button/v1/Button/_docs/Button.stories.tsx +6 -5
  225. package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stickersheet.stories.tsx +6 -6
  226. package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stories.tsx +4 -4
  227. package/src/__actions__/Button/v2/Button/_docs/Button.stories.tsx +6 -5
  228. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.stories.tsx +4 -4
  229. package/src/__actions__/Menu/v1/_docs/Menu.stickersheet.stories.tsx +3 -3
  230. package/src/__actions__/Menu/v1/_docs/Menu.stories.tsx +3 -3
  231. package/src/__actions__/Menu/v1/_docs/MenuContentExample.tsx +6 -6
  232. package/src/__actions__/Menu/v1/_docs/examples.tsx +5 -5
  233. package/src/__actions__/Menu/v2/_docs/Menu.stories.tsx +3 -3
  234. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +1 -3
  235. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +46 -45
  236. package/src/__actions__/Menu/v3/_docs/Menu.mdx +1 -1
  237. package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +21 -23
  238. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +12 -15
  239. package/src/__future__/Icon/Icon.module.css +35 -0
  240. package/src/__future__/Icon/Icon.spec.tsx +36 -0
  241. package/src/__future__/Icon/Icon.tsx +85 -0
  242. package/src/__future__/Icon/_docs/Icon--api-specification.mdx +98 -0
  243. package/src/__future__/Icon/_docs/Icon--usage-guidelines.mdx +145 -0
  244. package/src/__future__/Icon/_docs/Icon.docs.module.css +17 -0
  245. package/src/__future__/Icon/_docs/Icon.docs.stories.tsx +524 -0
  246. package/src/__future__/Icon/_docs/Icon.stickersheet.stories.tsx +126 -0
  247. package/src/__future__/Icon/_docs/assets/interface-dont.png +0 -0
  248. package/src/__future__/Icon/_docs/assets/tooltip-dont.png +0 -0
  249. package/src/__future__/Icon/constants.ts +149 -0
  250. package/src/__future__/Icon/index.ts +1 -0
  251. package/src/__future__/Icon/material-symbols-metadata.json +3370 -0
  252. package/src/__future__/Icon/types.ts +11 -0
  253. package/src/__future__/Select/subcomponents/Option/Option.tsx +2 -2
  254. package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.module.scss +1 -1
  255. package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.tsx +6 -9
  256. package/src/__future__/Tag/RemovableTag/_docs/RemovableTag.stories.tsx +0 -77
  257. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.module.scss +0 -56
  258. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.tsx +2 -12
  259. package/src/__future__/Tag/Tag/Tag.module.scss +1 -1
  260. package/src/__future__/Tag/Tag/_docs/Tag-migration-guide.stories.tsx +6 -17
  261. package/src/__future__/Tag/Tag/_docs/Tag.stickersheet.stories.tsx +5 -2
  262. package/src/__future__/Tag/Tag/_docs/Tag.stories.tsx +13 -6
  263. package/src/__future__/index.ts +1 -0
  264. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stickersheet.stories.tsx +10 -10
  265. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stories.tsx +7 -4
  266. package/src/__overlays__/Tooltip/v1/utils/isSemanticElement.spec.tsx +4 -11
  267. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.docs.stories.tsx +10 -10
  268. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +3 -3
  269. package/codemods/utils/getTagName.spec.ts +0 -24
  270. package/codemods/utils/getTagName.ts +0 -32
  271. package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.cjs +0 -23
  272. package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.mjs +0 -15
  273. package/dist/types/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.d.ts +0 -2
  274. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.tsx +0 -21
@@ -313,7 +313,7 @@ describe("<FilterBar />", () => {
313
313
  />
314
314
  )
315
315
  await waitForI18nContent()
316
- expect(getByTestId("testid__values").textContent).toEqual(
316
+ expect(getByTestId("testid__values").textContent).toBe(
317
317
  JSON.stringify({})
318
318
  )
319
319
  })
@@ -580,7 +580,7 @@ describe("<FilterBar />", () => {
580
580
  await user.click(getByRole("option", { name: "Long Black" }))
581
581
 
582
582
  await waitFor(() => {
583
- expect(coffeeButton.textContent).toBe("Coffee:Long Black")
583
+ expect(coffeeButton).toHaveAccessibleName("Coffee : Long Black")
584
584
  })
585
585
  const iceButton = getByRole("button", { name: "Ice" })
586
586
  expect(iceButton).toBeVisible()
@@ -590,7 +590,7 @@ describe("<FilterBar />", () => {
590
590
  await user.click(getByRole("option", { name: "Latte" }))
591
591
 
592
592
  await waitFor(() => {
593
- expect(coffeeButton.textContent).toBe("Coffee:Latte")
593
+ expect(coffeeButton).toHaveAccessibleName("Coffee : Latte")
594
594
  })
595
595
  const milkButton = getByRole("button", { name: "Milk" })
596
596
  expect(milkButton).toBeVisible()
@@ -600,7 +600,7 @@ describe("<FilterBar />", () => {
600
600
  await user.click(getByRole("option", { name: "Oat" }))
601
601
 
602
602
  await waitFor(() => {
603
- expect(milkButton.textContent).toBe("Milk:Oat")
603
+ expect(milkButton).toHaveAccessibleName("Milk : Oat")
604
604
  })
605
605
  expect(addFiltersButton).not.toBeDisabled()
606
606
 
@@ -657,16 +657,16 @@ describe("<FilterBar />", () => {
657
657
  })
658
658
  const iceLevelButton = getByRole("button", { name: "Ice Level : 100%" })
659
659
 
660
- expect(flavourButton.textContent).toBe("Flavour:Jasmine Milk Tea")
661
- expect(sugarLevelButton.textContent).toBe("Sugar Level:50%")
662
- expect(iceLevelButton.textContent).toBe("Ice Level:100%")
660
+ expect(flavourButton).toHaveAccessibleName("Flavour : Jasmine Milk Tea")
661
+ expect(sugarLevelButton).toHaveAccessibleName("Sugar Level : 50%")
662
+ expect(iceLevelButton).toHaveAccessibleName("Ice Level : 100%")
663
663
 
664
664
  await user.click(getByRole("button", { name: "Clear all filters" }))
665
665
 
666
666
  await waitFor(() => {
667
- expect(flavourButton.textContent).toBe("Flavour")
668
- expect(sugarLevelButton.textContent).toBe("Sugar Level")
669
- expect(iceLevelButton.textContent).toBe("Ice Level")
667
+ expect(flavourButton).toHaveAccessibleName("Flavour")
668
+ expect(sugarLevelButton).toHaveAccessibleName("Sugar Level")
669
+ expect(iceLevelButton).toHaveAccessibleName("Ice Level")
670
670
  })
671
671
  })
672
672
 
@@ -744,14 +744,14 @@ describe("<FilterBar />", () => {
744
744
  await waitForI18nContent()
745
745
 
746
746
  const flavourButton = getByRole("button", { name: "Flavour" })
747
- expect(flavourButton.textContent).toEqual("Flavour")
747
+ expect(flavourButton).toHaveAccessibleName("Flavour")
748
748
 
749
749
  await user.click(
750
750
  getByRole("button", { name: "Update Flavour to honey-milk-tea" })
751
751
  )
752
752
 
753
753
  await waitFor(() => {
754
- expect(flavourButton.textContent).toEqual("Flavour:Honey Milk Tea")
754
+ expect(flavourButton).toHaveAccessibleName("Flavour : Honey Milk Tea")
755
755
  })
756
756
  })
757
757
 
@@ -1,7 +1,7 @@
1
1
  import React from "react"
2
2
  import { useIntl } from "@cultureamp/i18n-react-intl"
3
- import { AddIcon } from "~components/Icon"
4
3
  import { Menu, MenuList, MenuItem, Button } from "~components/__actions__/v2"
4
+ import { Icon } from "~components/__future__/Icon"
5
5
  import { useFilterBarContext } from "../../context/FilterBarContext"
6
6
 
7
7
  export const AddFiltersMenu = (): JSX.Element => {
@@ -24,7 +24,7 @@ export const AddFiltersMenu = (): JSX.Element => {
24
24
  label={menuButtonLabel}
25
25
  secondary
26
26
  disabled={inactiveFilters.length === 0}
27
- icon={<AddIcon role="presentation" />}
27
+ icon={<Icon name="add" isPresentational />}
28
28
  />
29
29
  }
30
30
  >
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  .hasSelectedValues {
13
- font-weight: $typography-button-primary-font-weight;
13
+ font-weight: bold;
14
14
  }
15
15
 
16
16
  .labelSeparator {
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from "react"
2
2
  import classnames from "classnames"
3
- import { ChevronDownIcon, ChevronUpIcon } from "~components/Icon"
3
+ import { Icon } from "~components/__future__/Icon"
4
4
  import { isRefObject } from "~components/utils/isRefObject"
5
5
  import { FilterTriggerRef } from "../../Filter/types"
6
6
  import {
@@ -45,11 +45,10 @@ export const FilterButton = forwardRef<FilterTriggerRef, FilterButtonProps>(
45
45
  label
46
46
  )}
47
47
  </span>
48
- {isOpen ? (
49
- <ChevronUpIcon role="presentation" />
50
- ) : (
51
- <ChevronDownIcon role="presentation" />
52
- )}
48
+ <Icon
49
+ name={isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}
50
+ isPresentational
51
+ />
53
52
  </FilterButtonBase>
54
53
  )
55
54
  }
@@ -2,7 +2,7 @@ import React, { forwardRef } from "react"
2
2
  import { useIntl } from "@cultureamp/i18n-react-intl"
3
3
  import { ButtonGroup, ButtonGroupProps } from "~components/ButtonGroup"
4
4
  import { FilterTriggerRef } from "~components/Filter/Filter"
5
- import { ClearIcon } from "~components/Icon"
5
+ import { Icon } from "~components/__future__/Icon"
6
6
  import { Tooltip } from "~components/__overlays__/Tooltip/v1"
7
7
  import { DataAttributes } from "~components/types/DataAttributes"
8
8
  import { isRefObject } from "~components/utils/isRefObject"
@@ -50,7 +50,7 @@ export const FilterButtonRemovable = forwardRef<
50
50
  <FilterButton ref={ref} {...triggerButtonProps} />
51
51
  <Tooltip text={removeButtonLabel} display="inline-block" position="below">
52
52
  <FilterButtonBase ref={removeButtonRef} {...removeButtonProps}>
53
- <ClearIcon role="img" aria-label={removeButtonLabel} />
53
+ <Icon name="cancel" alt={removeButtonLabel} isFilled />
54
54
  </FilterButtonBase>
55
55
  </Tooltip>
56
56
  </ButtonGroup>
@@ -115,7 +115,6 @@ describe("<FilterDateRangePicker />", () => {
115
115
 
116
116
  await waitFor(() => {
117
117
  expect(inputEndDate).not.toHaveFocus()
118
- expect(filterButton.textContent).toEqual("Dates")
119
118
  })
120
119
  }, 10000)
121
120
  })
@@ -67,7 +67,8 @@ describe("<DateRangeInputField />", () => {
67
67
  const inputStart = screen.getByRole("textbox", { name: "Date from" })
68
68
  await waitFor(() => {
69
69
  expect(inputStart).toHaveAccessibleDescription(
70
- "Date Start has an error Input format : dd/mm/yyyy"
70
+ // React Testing Library bug: Icon should be showing aria-label "error message" instead
71
+ "error Date Start has an error Input format : dd/mm/yyyy"
71
72
  )
72
73
  expect(screen.getByText("Date Start has an error")).toBeVisible()
73
74
  })
@@ -4,8 +4,8 @@ import { useOption } from "@react-aria/listbox"
4
4
  import { mergeProps } from "@react-aria/utils"
5
5
  import classnames from "classnames"
6
6
  import { Badge } from "~components/Badge"
7
- import { CheckIcon } from "~components/Icon"
8
7
  import { VisuallyHidden } from "~components/VisuallyHidden"
8
+ import { Icon } from "~components/__future__/Icon"
9
9
  import { useSelectionContext } from "../../context"
10
10
  import { MultiSelectItem } from "../../types"
11
11
  import styles from "./MultiSelectOption.module.scss"
@@ -50,7 +50,7 @@ export const MultiSelectOption = ({
50
50
  <span
51
51
  className={classnames(styles.icon, isSelected && styles.isSelected)}
52
52
  >
53
- {isSelected && <CheckIcon role="presentation" />}
53
+ {isSelected && <Icon name="check" isPresentational />}
54
54
  </span>
55
55
  {/* can also be item.value since 'rendered' is defined as item.value in SelectionProvider*/}
56
56
  {item.rendered}
@@ -198,16 +198,15 @@ describe("<FilterSelect>", () => {
198
198
  it("changes the value within the button when an option is selected", async () => {
199
199
  render(
200
200
  <FilterSelectWrapper
201
- isOpen
202
201
  renderTrigger={(triggerButtonProps): JSX.Element => (
203
- <FilterButton data-testid="test__trigger" {...triggerButtonProps} />
202
+ <FilterButton {...triggerButtonProps} />
204
203
  )}
205
204
  />
206
205
  )
207
- // Use testid because when the filter is open, the button is inaccessible
208
- expect(screen.getByTestId("test__trigger").textContent).toBe("Coffee")
209
206
 
210
- await user.tab()
207
+ const button = screen.getByRole("button", { name: "Coffee" })
208
+
209
+ await user.click(button)
211
210
  await waitFor(() => {
212
211
  expect(screen.queryByRole("listbox")).toBeVisible()
213
212
  })
@@ -2,10 +2,10 @@ import React, { useEffect, useState } from "react"
2
2
  import classNames from "classnames"
3
3
  import Media from "react-media"
4
4
  import { Heading, HeadingProps } from "~components/Heading"
5
- import { ArrowForwardIcon } from "~components/Icon"
6
5
  import { SceneProps, SpotProps } from "~components/Illustration"
7
6
  import { Text } from "~components/Text"
8
7
  import { Button, ButtonProps } from "~components/__actions__/v2"
8
+ import { Icon } from "~components/__future__/Icon"
9
9
  import { Tooltip, TooltipProps } from "~components/__overlays__/Tooltip/v1"
10
10
  import { VariantType } from "./types"
11
11
  import styles from "./GuidanceBlock.module.scss"
@@ -223,7 +223,11 @@ export const GuidanceBlock = ({
223
223
  <Button
224
224
  icon={
225
225
  withActionButtonArrow ? (
226
- <ArrowForwardIcon role="presentation" />
226
+ <Icon
227
+ name="arrow_forward"
228
+ isPresentational
229
+ shouldMirrorInRTL
230
+ />
227
231
  ) : undefined
228
232
  }
229
233
  iconPosition="end"
@@ -7,7 +7,7 @@ import { AddIcon } from "../index"
7
7
  import styles from "./icon.module.scss"
8
8
 
9
9
  const meta = {
10
- title: "Components/Icons",
10
+ title: "Illustrations/Icon",
11
11
  component: AddIcon,
12
12
  args: {
13
13
  role: "presentation",
@@ -1,6 +1,6 @@
1
1
  import { Canvas, Controls, Meta, Story } from "@storybook/blocks"
2
2
  import { ResourceLinks } from "~storybook/components"
3
- import * as IconStories from "./Icon.stories"
3
+ import * as IconStories from "./Icon.docs.stories"
4
4
 
5
5
  <Meta of={IconStories} />
6
6
 
@@ -8,7 +8,6 @@ import * as IconStories from "./Icon.stories"
8
8
 
9
9
  <ResourceLinks
10
10
  sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Icons"
11
-
12
11
  />
13
12
 
14
13
  ## Installation
@@ -7,7 +7,7 @@ import {
7
7
  } from "~storybook/components/StickerSheet"
8
8
 
9
9
  export default {
10
- title: "Components/Icons",
10
+ title: "Illustrations/Icon",
11
11
  parameters: {
12
12
  chromatic: { disable: false },
13
13
  controls: { disable: true },
@@ -1,5 +1,5 @@
1
1
  import React, { useState, RefObject } from "react"
2
- import { LaunchIcon, PauseIcon } from "~components/Icon"
2
+ import { Icon } from "~components/__future__/Icon"
3
3
 
4
4
  export type usePausePlayHook = {
5
5
  toggle: () => void
@@ -24,10 +24,12 @@ export const usePausePlay = (
24
24
  videoRef.current.pause()
25
25
  }
26
26
  },
27
- icon: isPaused ? (
28
- <LaunchIcon role="presentation" />
29
- ) : (
30
- <PauseIcon role="presentation" />
27
+ icon: (
28
+ <Icon
29
+ name={isPaused ? "play_circle" : "pause"}
30
+ isPresentational
31
+ isFilled
32
+ />
31
33
  ),
32
34
  label: isPaused ? "Play animation" : "Pause animation",
33
35
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import { Meta } from "@storybook/react"
3
- import { MeatballsIcon, WritingIcon } from "~components/Icon"
3
+ import { Icon } from "~components/__future__/Icon"
4
4
  import {
5
5
  StickerSheet,
6
6
  StickerSheetStory,
@@ -35,16 +35,18 @@ const InputExampleGroup = (props: InputProps): JSX.Element => (
35
35
  value={type}
36
36
  type={type}
37
37
  startIconAdornment={
38
- <WritingIcon
39
- role="presentation"
38
+ <Icon
39
+ name="edit"
40
+ isPresentational
40
41
  data-sb-a11y-color-contrast-disable={
41
42
  props.disabled ? "true" : "false"
42
43
  }
43
44
  />
44
45
  }
45
46
  endIconAdornment={
46
- <MeatballsIcon
47
- role="presentation"
47
+ <Icon
48
+ name="close"
49
+ isPresentational
48
50
  data-sb-a11y-color-contrast-disable={
49
51
  props.disabled ? "true" : "false"
50
52
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { UserAddIcon, WritingIcon } from "~components/Icon"
3
+ import { Icon } from "~components/__future__/Icon"
4
4
  import { Input } from "../index"
5
5
 
6
6
  const meta = {
@@ -87,14 +87,16 @@ export const Icons: Story = {
87
87
  <Input
88
88
  type="text"
89
89
  value="Start Icon"
90
- startIconAdornment={<UserAddIcon role="presentation" />}
90
+ startIconAdornment={
91
+ <Icon name="person_add" isPresentational isFilled />
92
+ }
91
93
  />
92
94
  </li>
93
95
  <li>
94
96
  <Input
95
97
  type="text"
96
98
  value="End Icon"
97
- endIconAdornment={<WritingIcon role="presentation" />}
99
+ endIconAdornment={<Icon name="edit" isPresentational isFilled />}
98
100
  />
99
101
  </li>
100
102
  </ul>
@@ -2,8 +2,8 @@ import React, { InputHTMLAttributes, useRef } from "react"
2
2
  import { useIntl } from "@cultureamp/i18n-react-intl"
3
3
  import classnames from "classnames"
4
4
  import { ClearButton } from "~components/ClearButton"
5
- import { SearchIcon } from "~components/Icon/SearchIcon"
6
5
  import { LoadingSpinner } from "~components/Loading"
6
+ import { Icon } from "~components/__future__/Icon"
7
7
  import { OverrideClassName } from "~components/types/OverrideClassName"
8
8
  import styles from "./InputSearch.module.scss"
9
9
 
@@ -63,7 +63,7 @@ export const InputSearch = (props: InputSearchProps): JSX.Element => {
63
63
  classNameOverride={styles.loadingSpinner}
64
64
  />
65
65
  ) : (
66
- <SearchIcon role="presentation" />
66
+ <Icon name="search" isPresentational />
67
67
  )}
68
68
  </div>
69
69
 
@@ -5,6 +5,10 @@
5
5
 
6
6
  $label-start-margin: $spacing-xs;
7
7
 
8
+ .label {
9
+ --icon-vertical-align: text-bottom;
10
+ }
11
+
8
12
  .label,
9
13
  :global(.ideal-sans) .label {
10
14
  // override Murmur global styles :(
@@ -1,8 +1,8 @@
1
1
  import React, { createRef, useState } from "react"
2
2
  import classnames from "classnames"
3
3
  import { FieldMessage } from "~components/FieldMessage"
4
- import { CheckIcon } from "~components/Icon"
5
4
  import { Text } from "~components/Text"
5
+ import { Icon } from "~components/__future__/Icon"
6
6
  import { ScaleValue, Scale, ScaleItem, ColorSchema } from "./types"
7
7
  import determineSelectionFromKeyPress from "./utils/determineSelectionFromKeyPress"
8
8
  import styles from "./LikertScaleLegacy.module.scss"
@@ -29,7 +29,7 @@ export type LikertScaleProps = {
29
29
  }
30
30
 
31
31
  const SelectedItemIcon = (): JSX.Element => (
32
- <CheckIcon role="presentation" classNameOverride={styles.check} />
32
+ <Icon name="check" isPresentational className={styles.check} />
33
33
  )
34
34
 
35
35
  /**
@@ -1,8 +1,8 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
3
  import { Avatar } from "~components/Avatar"
4
- import { ConfigureIcon } from "~components/Icon"
5
4
  import { BrandMomentPositiveOutro, Informative } from "~components/Illustration"
5
+ import { Icon } from "~components/__future__/Icon"
6
6
  import { StickerSheet } from "~storybook/components/StickerSheet"
7
7
  import { LoadingGraphic } from "../index"
8
8
 
@@ -49,7 +49,7 @@ export const Size: Story = {
49
49
  <StickerSheet.Body>
50
50
  <StickerSheet.Row rowTitle="Icon (small)">
51
51
  <LoadingGraphic size="small" />
52
- <ConfigureIcon aria-label="Aliens approaching!" role="img" />
52
+ <Icon name="build" alt="Aliens approaching!" isFilled />
53
53
  </StickerSheet.Row>
54
54
  <StickerSheet.Row rowTitle="Avatar (medium)">
55
55
  <LoadingGraphic size="medium" />
@@ -47,6 +47,8 @@
47
47
  }
48
48
 
49
49
  .spotIcon {
50
+ --icon-size: 30;
51
+
50
52
  width: 30px;
51
53
  height: 30px;
52
54
 
@@ -1,12 +1,6 @@
1
1
  import React, { HTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
3
  import { Heading } from "~components/Heading"
4
- import {
5
- CautionWhiteIcon,
6
- ExclamationWhiteIcon,
7
- InformationWhiteIcon,
8
- SuccessWhiteIcon,
9
- } from "~components/Icon"
10
4
  import {
11
5
  Assertive,
12
6
  Cautionary,
@@ -23,6 +17,7 @@ import {
23
17
  ModalBody,
24
18
  } from "~components/Modal/GenericModal"
25
19
  import { ButtonProps } from "~components/__actions__/v2"
20
+ import { Icon } from "~components/__future__/Icon"
26
21
  import styles from "./ConfirmationModal.module.scss"
27
22
 
28
23
  type Mood = "positive" | "informative" | "negative" | "cautionary" | "assertive"
@@ -77,46 +72,48 @@ type ConfirmationModalVariants = {
77
72
  export type ConfirmationModalProps = BaseConfirmationModalProps &
78
73
  (ConfirmationModalMoods | ConfirmationModalVariants)
79
74
 
80
- const getIcon = (
81
- variantName: Mood | Variant,
82
- isProminent: boolean
83
- ): JSX.Element => {
75
+ const getIconName = (variantName: Mood | Variant): string => {
84
76
  switch (variantName) {
85
77
  case "cautionary":
86
- return isProminent ? (
87
- <Cautionary />
88
- ) : (
89
- <CautionWhiteIcon inheritSize role="presentation" />
90
- )
78
+ return "warning"
91
79
  case "informative":
92
- return isProminent ? (
93
- <Informative />
94
- ) : (
95
- <InformationWhiteIcon inheritSize role="presentation" />
96
- )
80
+ return "info"
97
81
  case "negative":
98
82
  case "warning":
99
- return isProminent ? (
100
- <Negative />
101
- ) : (
102
- <ExclamationWhiteIcon inheritSize role="presentation" />
103
- )
83
+ return "error"
104
84
  case "positive":
105
85
  case "success":
106
- return isProminent ? (
107
- <Positive />
108
- ) : (
109
- <SuccessWhiteIcon inheritSize role="presentation" />
110
- )
86
+ return "check_circle"
111
87
  case "assertive":
112
- return isProminent ? (
113
- <Assertive />
114
- ) : (
115
- <ExclamationWhiteIcon inheritSize role="presentation" />
116
- )
88
+ return "error"
117
89
  }
118
90
  }
119
91
 
92
+ const getIcon = (
93
+ variantName: Mood | Variant,
94
+ isProminent: boolean
95
+ ): JSX.Element => {
96
+ if (isProminent) {
97
+ switch (variantName) {
98
+ case "cautionary":
99
+ return <Cautionary />
100
+ case "informative":
101
+ return <Informative />
102
+ case "negative":
103
+ case "warning":
104
+ return <Negative />
105
+ case "positive":
106
+ case "success":
107
+ return <Positive />
108
+ case "assertive":
109
+ return <Assertive />
110
+ }
111
+ }
112
+
113
+ const iconName = getIconName(variantName)
114
+ return <Icon name={iconName} isPresentational isFilled />
115
+ }
116
+
120
117
  /**
121
118
  * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093114/Modal Guidance} |
122
119
  * {@link https://cultureamp.design/?path=/docs/components-modals-confirmationmodal--docs Storybook}
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
- import { CloseIcon } from "~components/Icon"
3
2
  import { IconButton } from "~components/__actions__/v2"
3
+ import { Icon } from "~components/__future__/Icon"
4
4
  import { ModalBody } from "../ModalBody"
5
5
  import styles from "./ModalHeader.module.scss"
6
6
 
@@ -20,7 +20,7 @@ export const ModalHeader = ({
20
20
  <div className={styles.dismissButton}>
21
21
  <IconButton
22
22
  label="Dismiss"
23
- icon={<CloseIcon role="presentation" />}
23
+ icon={<Icon name="close" isPresentational />}
24
24
  reversed={reversed}
25
25
  onClick={onDismiss}
26
26
  disabled={onDismiss == undefined}
@@ -350,6 +350,7 @@ describe("Has validation status", () => {
350
350
  )
351
351
  expect(screen.getByText("No waffles are available")).toBeInTheDocument()
352
352
  })
353
+
353
354
  it("describes the Toggle", () => {
354
355
  render(
355
356
  <MultiSelectWrapper
@@ -364,13 +365,16 @@ describe("Has validation status", () => {
364
365
  expect(
365
366
  screen.getByRole("button", {
366
367
  name: "Breakfast menu",
367
- description: "Only four waffles remain",
368
+ // React Testing Library bug: Icon should be showing aria-label "caution message" instead
369
+ description: "warning Only four waffles remain",
368
370
  })
369
371
  ).toBeInTheDocument()
370
372
  })
373
+
371
374
  it("announces the validation message before the Toggle's description", () => {
372
- const description = "Choose you breakfast."
373
- const validationMessage = "Only four waffles remain."
375
+ const description = "Choose your breakfast."
376
+ // React Testing Library bug: Icon should be showing aria-label "caution message" instead
377
+ const validationMessage = "warning Only four waffles remain."
374
378
 
375
379
  render(
376
380
  <MultiSelectWrapper
@@ -68,11 +68,5 @@ $focus-ring-size: calc(#{$checkbox-size} + #{$focus-ring-offset});
68
68
  }
69
69
 
70
70
  .icon {
71
- height: $checkbox-size;
72
- width: $checkbox-size;
73
- position: absolute;
74
- top: 50%;
75
- left: 50%;
76
- transform: translate(-50%, -50%);
77
71
  color: $color-white;
78
72
  }
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useRef, InputHTMLAttributes } from "react"
2
2
  import classnames from "classnames"
3
- import { CheckIcon, MinusIcon } from "~components/Icon"
3
+ import { Icon } from "~components/__future__/Icon"
4
4
  import { OverrideClassName } from "~components/types/OverrideClassName"
5
5
  import styles from "./Checkbox.module.scss"
6
6
 
@@ -25,14 +25,15 @@ export type CheckboxProps = {
25
25
  >
26
26
 
27
27
  const renderIcon = (status: CheckedStatus): JSX.Element | null => {
28
- switch (status) {
29
- case "indeterminate":
30
- return <MinusIcon role="presentation" classNameOverride={styles.icon} />
31
- case "checked":
32
- return <CheckIcon role="presentation" classNameOverride={styles.icon} />
33
- default:
34
- return null
35
- }
28
+ if (status === "unchecked") return null
29
+
30
+ return (
31
+ <Icon
32
+ name={status === "checked" ? "check" : "remove"}
33
+ isPresentational
34
+ className={styles.icon}
35
+ />
36
+ )
36
37
  }
37
38
 
38
39
  export const Checkbox = ({