@kaizen/components 0.0.0-canary-fix-select-futureselect-focus-jumping-20241003232256 → 0.0.0-canary-tsx-codemod-20241029235345

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 (411) hide show
  1. package/bin/codemod.sh +2 -2
  2. package/codemods/README.md +12 -4
  3. package/codemods/upgradeIconV1/getNewIconPropsFromOldIconName.ts +255 -0
  4. package/codemods/upgradeIconV1/index.ts +33 -0
  5. package/codemods/upgradeIconV1/transformCaMonogramIconToBrand.spec.ts +83 -0
  6. package/codemods/upgradeIconV1/transformCaMonogramIconToBrand.ts +53 -0
  7. package/codemods/upgradeIconV1/transformIcon.spec.ts +181 -0
  8. package/codemods/upgradeIconV1/transformIcon.ts +115 -0
  9. package/codemods/upgradeIconV1/transformSpinnerIconToLoadingSpinner.spec.ts +81 -0
  10. package/codemods/upgradeIconV1/transformSpinnerIconToLoadingSpinner.ts +41 -0
  11. package/codemods/upgradeIconV1/upgradeIconV1.spec.ts +306 -0
  12. package/codemods/upgradeIconV1/upgradeIconV1.ts +94 -0
  13. package/codemods/utils/createProp.spec.ts +83 -0
  14. package/codemods/utils/createProp.ts +51 -0
  15. package/codemods/utils/getKaioTagName.spec.ts +85 -0
  16. package/codemods/utils/getKaioTagName.ts +129 -0
  17. package/codemods/utils/index.ts +3 -1
  18. package/codemods/utils/transformComponentsInDir.ts +32 -16
  19. package/codemods/utils/transformSource.ts +10 -5
  20. package/codemods/utils/updateJsxElementWithNewProps.ts +4 -3
  21. package/codemods/utils/updateKaioImports.spec.ts +223 -0
  22. package/codemods/utils/updateKaioImports.ts +233 -0
  23. package/dist/cjs/Avatar/Avatar.cjs +16 -13
  24. package/dist/cjs/Calendar/CalendarRange/CalendarRange.cjs +9 -7
  25. package/dist/cjs/Calendar/CalendarSingle/CalendarSingle.cjs +9 -7
  26. package/dist/cjs/Calendar/LegacyCalendarRange/LegacyCalendarRange.cjs +9 -7
  27. package/dist/cjs/Checkbox/Checkbox/Checkbox.cjs +5 -11
  28. package/dist/cjs/ClearButton/ClearButton.cjs +5 -4
  29. package/dist/cjs/Collapsible/Collapsible/Collapsible.cjs +4 -7
  30. package/dist/cjs/DateInput/DateInputWithIconButton/DateInputWithIconButton.cjs +5 -4
  31. package/dist/cjs/DateRangePicker/DateRangePicker.cjs +5 -4
  32. package/dist/cjs/ErrorPage/ErrorPage.cjs +9 -7
  33. package/dist/cjs/FieldMessage/FieldMessage.cjs +5 -11
  34. package/dist/cjs/Filter/FilterBar/context/FilterBarContext.cjs +17 -2
  35. package/dist/cjs/Filter/FilterBar/context/reducer/filterBarStateReducer.cjs +4 -0
  36. package/dist/cjs/Filter/FilterBar/context/reducer/setupFilterBarState.cjs +2 -1
  37. package/dist/cjs/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +16 -6
  38. package/dist/cjs/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.cjs +12 -1
  39. package/dist/cjs/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.cjs +13 -2
  40. package/dist/cjs/Filter/FilterButton/FilterButton/FilterButton.cjs +4 -7
  41. package/dist/cjs/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.cjs +5 -5
  42. package/dist/cjs/Filter/FilterMultiSelect/FilterMultiSelect.cjs +4 -2
  43. package/dist/cjs/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.cjs +4 -2
  44. package/dist/cjs/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.cjs +4 -4
  45. package/dist/cjs/Filter/FilterSelect/FilterSelect.cjs +2 -1
  46. package/dist/cjs/GuidanceBlock/GuidanceBlock.cjs +5 -4
  47. package/dist/cjs/Illustration/utils/usePausePlay.cjs +5 -8
  48. package/dist/cjs/Input/InputSearch/InputSearch.cjs +4 -3
  49. package/dist/cjs/LikertScaleLegacy/LikertScaleLegacy.cjs +5 -6
  50. package/dist/cjs/Loading/LoadingSpinner/LoadingSpinner.cjs +6 -42
  51. package/dist/cjs/Loading/LoadingSpinner/LoadingSpinner.module.css.cjs +10 -0
  52. package/dist/cjs/Loading/LoadingSpinner/subcomponents/SpinnerIcon.cjs +80 -0
  53. package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +31 -26
  54. package/dist/cjs/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.cjs +4 -5
  55. package/dist/cjs/MultiSelect/subcomponents/Checkbox/Checkbox.cjs +7 -17
  56. package/dist/cjs/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.cjs +4 -7
  57. package/dist/cjs/Notification/subcomponents/CancelButton/CancelButton.cjs +4 -3
  58. package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +33 -38
  59. package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css.cjs +6 -0
  60. package/dist/cjs/Pagination/subcomponents/DirectionalLink/DirectionalLink.cjs +11 -19
  61. package/dist/cjs/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.cjs +4 -5
  62. package/dist/cjs/Popover/Popover.cjs +5 -4
  63. package/dist/cjs/Popover/utils/classMappers.cjs +21 -16
  64. package/dist/cjs/RichTextEditor/RichTextEditor/utils/controlmap.cjs +29 -25
  65. package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.cjs +10 -12
  66. package/dist/cjs/Select/Select.cjs +8 -10
  67. package/dist/cjs/SplitButton/subcomponents/DropdownButton/DropdownButton.cjs +4 -4
  68. package/dist/cjs/Table/Table.cjs +11 -10
  69. package/dist/cjs/Tag/Tag.cjs +21 -17
  70. package/dist/cjs/TextArea/TextArea.cjs +20 -52
  71. package/dist/cjs/TextArea/TextArea.module.css.cjs +14 -0
  72. package/dist/cjs/TextField/TextField.cjs +7 -6
  73. package/dist/cjs/TextField/TextField.module.scss.cjs +4 -6
  74. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +8 -7
  75. package/dist/cjs/TitleBlockZen/TitleBlockZen.cjs +9 -12
  76. package/dist/cjs/TitleBlockZen/subcomponents/MainActions.cjs +7 -7
  77. package/dist/cjs/TitleBlockZen/subcomponents/MobileActions.cjs +10 -15
  78. package/dist/cjs/TitleBlockZen/subcomponents/SecondaryActions.cjs +7 -7
  79. package/dist/cjs/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +5 -5
  80. package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs +13 -18
  81. package/dist/cjs/__future__/Icon/Icon.cjs +47 -0
  82. package/dist/cjs/__future__/Icon/Icon.module.css.cjs +10 -0
  83. package/dist/cjs/__future__/Icon/constants.cjs +8 -0
  84. package/dist/cjs/__future__/Select/subcomponents/ListBox/ListBox.cjs +7 -10
  85. package/dist/cjs/__future__/Select/subcomponents/Option/Option.cjs +4 -5
  86. package/dist/cjs/__future__/Select/subcomponents/SelectToggle/SelectToggle.cjs +5 -9
  87. package/dist/cjs/__future__/Tabs/Tabs.cjs +23 -0
  88. package/dist/cjs/__future__/Tabs/subcomponents/Tab/Tab.cjs +39 -0
  89. package/dist/cjs/__future__/Tabs/subcomponents/Tab/Tab.module.css.cjs +7 -0
  90. package/dist/cjs/__future__/Tabs/subcomponents/TabList/TabList.cjs +31 -0
  91. package/dist/cjs/__future__/Tabs/subcomponents/TabList/TabList.module.css.cjs +7 -0
  92. package/dist/cjs/__future__/Tabs/subcomponents/TabPanel/TabPanel.cjs +24 -0
  93. package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveButton.cjs +4 -3
  94. package/dist/cjs/future.cjs +10 -0
  95. package/dist/esm/Avatar/Avatar.mjs +16 -13
  96. package/dist/esm/Calendar/CalendarRange/CalendarRange.mjs +9 -7
  97. package/dist/esm/Calendar/CalendarSingle/CalendarSingle.mjs +9 -7
  98. package/dist/esm/Calendar/LegacyCalendarRange/LegacyCalendarRange.mjs +9 -7
  99. package/dist/esm/Checkbox/Checkbox/Checkbox.mjs +5 -11
  100. package/dist/esm/ClearButton/ClearButton.mjs +5 -4
  101. package/dist/esm/Collapsible/Collapsible/Collapsible.mjs +5 -8
  102. package/dist/esm/DateInput/DateInputWithIconButton/DateInputWithIconButton.mjs +5 -4
  103. package/dist/esm/DateRangePicker/DateRangePicker.mjs +5 -4
  104. package/dist/esm/ErrorPage/ErrorPage.mjs +10 -8
  105. package/dist/esm/FieldMessage/FieldMessage.mjs +6 -12
  106. package/dist/esm/Filter/FilterBar/context/FilterBarContext.mjs +17 -2
  107. package/dist/esm/Filter/FilterBar/context/reducer/filterBarStateReducer.mjs +4 -0
  108. package/dist/esm/Filter/FilterBar/context/reducer/setupFilterBarState.mjs +2 -1
  109. package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +17 -7
  110. package/dist/esm/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.mjs +13 -2
  111. package/dist/esm/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.mjs +14 -3
  112. package/dist/esm/Filter/FilterButton/FilterButton/FilterButton.mjs +5 -8
  113. package/dist/esm/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.mjs +5 -5
  114. package/dist/esm/Filter/FilterMultiSelect/FilterMultiSelect.mjs +4 -2
  115. package/dist/esm/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.mjs +4 -2
  116. package/dist/esm/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.mjs +4 -4
  117. package/dist/esm/Filter/FilterSelect/FilterSelect.mjs +2 -1
  118. package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +5 -4
  119. package/dist/esm/Illustration/utils/usePausePlay.mjs +5 -8
  120. package/dist/esm/Input/InputSearch/InputSearch.mjs +4 -3
  121. package/dist/esm/LikertScaleLegacy/LikertScaleLegacy.mjs +5 -6
  122. package/dist/esm/Loading/LoadingSpinner/LoadingSpinner.mjs +6 -42
  123. package/dist/esm/Loading/LoadingSpinner/LoadingSpinner.module.css.mjs +8 -0
  124. package/dist/esm/Loading/LoadingSpinner/subcomponents/SpinnerIcon.mjs +72 -0
  125. package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +31 -26
  126. package/dist/esm/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.mjs +4 -5
  127. package/dist/esm/MultiSelect/subcomponents/Checkbox/Checkbox.mjs +7 -17
  128. package/dist/esm/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.mjs +5 -8
  129. package/dist/esm/Notification/subcomponents/CancelButton/CancelButton.mjs +4 -3
  130. package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +33 -38
  131. package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css.mjs +4 -0
  132. package/dist/esm/Pagination/subcomponents/DirectionalLink/DirectionalLink.mjs +11 -19
  133. package/dist/esm/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.mjs +4 -5
  134. package/dist/esm/Popover/Popover.mjs +5 -4
  135. package/dist/esm/Popover/utils/classMappers.mjs +21 -16
  136. package/dist/esm/RichTextEditor/RichTextEditor/utils/controlmap.mjs +33 -29
  137. package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.mjs +10 -12
  138. package/dist/esm/Select/Select.mjs +9 -11
  139. package/dist/esm/SplitButton/subcomponents/DropdownButton/DropdownButton.mjs +4 -4
  140. package/dist/esm/Table/Table.mjs +11 -10
  141. package/dist/esm/Tag/Tag.mjs +21 -17
  142. package/dist/esm/TextArea/TextArea.mjs +21 -53
  143. package/dist/esm/TextArea/TextArea.module.css.mjs +12 -0
  144. package/dist/esm/TextField/TextField.mjs +7 -6
  145. package/dist/esm/TextField/TextField.module.scss.mjs +4 -6
  146. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +8 -7
  147. package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +9 -12
  148. package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs +7 -7
  149. package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs +13 -18
  150. package/dist/esm/TitleBlockZen/subcomponents/SecondaryActions.mjs +7 -7
  151. package/dist/esm/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +5 -5
  152. package/dist/esm/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs +16 -21
  153. package/dist/esm/__future__/Icon/Icon.mjs +38 -0
  154. package/dist/esm/__future__/Icon/Icon.module.css.mjs +8 -0
  155. package/dist/esm/__future__/Icon/constants.mjs +6 -0
  156. package/dist/esm/__future__/Select/subcomponents/ListBox/ListBox.mjs +7 -11
  157. package/dist/esm/__future__/Select/subcomponents/Option/Option.mjs +4 -5
  158. package/dist/esm/__future__/Select/subcomponents/SelectToggle/SelectToggle.mjs +6 -10
  159. package/dist/esm/__future__/Tabs/Tabs.mjs +15 -0
  160. package/dist/esm/__future__/Tabs/subcomponents/Tab/Tab.mjs +30 -0
  161. package/dist/esm/__future__/Tabs/subcomponents/Tab/Tab.module.css.mjs +5 -0
  162. package/dist/esm/__future__/Tabs/subcomponents/TabList/TabList.mjs +22 -0
  163. package/dist/esm/__future__/Tabs/subcomponents/TabList/TabList.module.css.mjs +5 -0
  164. package/dist/esm/__future__/Tabs/subcomponents/TabPanel/TabPanel.mjs +16 -0
  165. package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveButton.mjs +4 -3
  166. package/dist/esm/future.mjs +5 -0
  167. package/dist/styles.css +828 -1388
  168. package/dist/types/Filter/FilterBar/context/FilterBarContext.d.ts +2 -0
  169. package/dist/types/Filter/FilterBar/context/reducer/filterBarStateReducer.d.ts +3 -0
  170. package/dist/types/Filter/FilterBar/context/types.d.ts +1 -0
  171. package/dist/types/Filter/FilterMultiSelect/FilterMultiSelect.d.ts +2 -1
  172. package/dist/types/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.d.ts +2 -1
  173. package/dist/types/Loading/LoadingSpinner/LoadingSpinner.d.ts +2 -2
  174. package/dist/types/Loading/LoadingSpinner/subcomponents/SpinnerIcon.d.ts +5 -0
  175. package/dist/types/Loading/LoadingSpinner/subcomponents/index.d.ts +1 -0
  176. package/dist/types/Tabs/subcomponents/index.d.ts +0 -1
  177. package/dist/types/TextArea/TextArea.d.ts +4 -0
  178. package/dist/types/__future__/Icon/Icon.d.ts +21 -0
  179. package/dist/types/__future__/Icon/constants.d.ts +5 -0
  180. package/dist/types/__future__/Icon/index.d.ts +1 -0
  181. package/dist/types/__future__/Icon/types.d.ts +4 -0
  182. package/dist/types/__future__/Tabs/Tabs.d.ts +11 -0
  183. package/dist/types/__future__/Tabs/index.d.ts +2 -0
  184. package/dist/types/__future__/Tabs/subcomponents/Tab/Tab.d.ts +12 -0
  185. package/dist/types/__future__/Tabs/subcomponents/Tab/index.d.ts +1 -0
  186. package/dist/types/__future__/Tabs/subcomponents/TabList/TabList.d.ts +17 -0
  187. package/dist/types/__future__/Tabs/subcomponents/TabList/index.d.ts +1 -0
  188. package/dist/types/__future__/Tabs/subcomponents/TabPanel/TabPanel.d.ts +6 -0
  189. package/dist/types/__future__/Tabs/subcomponents/TabPanel/index.d.ts +1 -0
  190. package/dist/types/__future__/Tabs/subcomponents/index.d.ts +3 -0
  191. package/dist/types/__future__/index.d.ts +2 -0
  192. package/package.json +36 -37
  193. package/src/Avatar/Avatar.module.scss +10 -12
  194. package/src/Avatar/Avatar.tsx +14 -5
  195. package/src/BrandMoment/_docs/BrandMoment.stories.tsx +6 -10
  196. package/src/BrandMoment/_docs/ExampleHeaders.tsx +2 -2
  197. package/src/Calendar/CalendarRange/CalendarRange.tsx +7 -3
  198. package/src/Calendar/CalendarSingle/CalendarSingle.tsx +7 -3
  199. package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.tsx +7 -3
  200. package/src/Calendar/baseCalendarClassNames.module.scss +0 -4
  201. package/src/Checkbox/Checkbox/Checkbox.module.scss +2 -10
  202. package/src/Checkbox/Checkbox/Checkbox.tsx +6 -8
  203. package/src/ClearButton/ClearButton.tsx +2 -2
  204. package/src/Collapsible/Collapsible/Collapsible.tsx +5 -6
  205. package/src/Collapsible/Collapsible/_docs/Collapsible.stories.tsx +2 -2
  206. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +2 -7
  207. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.tsx +2 -2
  208. package/src/DateRangePicker/DateRangePicker.tsx +2 -2
  209. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +8 -2
  210. package/src/EmptyState/_docs/EmptyState.stories.tsx +4 -2
  211. package/src/ErrorPage/ErrorPage.tsx +5 -3
  212. package/src/FieldMessage/FieldMessage.tsx +6 -14
  213. package/src/Filter/FilterBar/FilterBar.spec.tsx +99 -12
  214. package/src/Filter/FilterBar/context/FilterBarContext.tsx +11 -2
  215. package/src/Filter/FilterBar/context/reducer/filterBarStateReducer.ts +7 -0
  216. package/src/Filter/FilterBar/context/reducer/setupFilterBarState.ts +1 -0
  217. package/src/Filter/FilterBar/context/types.ts +1 -0
  218. package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +14 -4
  219. package/src/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.tsx +10 -2
  220. package/src/Filter/FilterBar/subcomponents/FilterBarMultiSelect/FilterBarMultiSelect.tsx +18 -3
  221. package/src/Filter/FilterButton/FilterButton/FilterButton.module.scss +1 -1
  222. package/src/Filter/FilterButton/FilterButton/FilterButton.tsx +5 -6
  223. package/src/Filter/FilterButton/FilterButtonRemovable/FilterButtonRemovable.tsx +2 -2
  224. package/src/Filter/FilterDateRangePicker/FilterDateRangePicker.spec.tsx +0 -1
  225. package/src/Filter/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.spec.tsx +2 -1
  226. package/src/Filter/FilterMultiSelect/FilterMultiSelect.tsx +3 -1
  227. package/src/Filter/FilterMultiSelect/context/MenuTriggerProvider/MenuTriggerProvider.tsx +4 -1
  228. package/src/Filter/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.tsx +2 -2
  229. package/src/Filter/FilterMultiSelect/subcomponents/SelectionControlButton/SelectionControlButton.module.scss +9 -11
  230. package/src/Filter/FilterSelect/FilterSelect.spec.tsx +52 -21
  231. package/src/Filter/FilterSelect/FilterSelect.tsx +2 -1
  232. package/src/Filter/FilterSelect/_docs/FilterSelect.stories.tsx +0 -1
  233. package/src/GuidanceBlock/GuidanceBlock.module.scss +4 -5
  234. package/src/GuidanceBlock/GuidanceBlock.tsx +6 -2
  235. package/src/Icon/_docs/{Icon.stories.tsx → Icon.docs.stories.tsx} +1 -1
  236. package/src/Icon/_docs/Icon.mdx +1 -2
  237. package/src/Icon/_docs/Icon.stickersheet.stories.tsx +1 -1
  238. package/src/Icon/bin/update-icons.sh +1 -1
  239. package/src/Illustration/utils/usePausePlay.tsx +7 -5
  240. package/src/Input/Input/_docs/Input.stickersheet.stories.tsx +7 -5
  241. package/src/Input/Input/_docs/Input.stories.tsx +5 -3
  242. package/src/Input/InputRange/InputRange.module.scss +4 -4
  243. package/src/Input/InputSearch/InputSearch.module.scss +21 -21
  244. package/src/Input/InputSearch/InputSearch.tsx +2 -2
  245. package/src/Label/Label.module.scss +4 -0
  246. package/src/LikertScaleLegacy/LikertScaleLegacy.module.scss +7 -8
  247. package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +2 -2
  248. package/src/Loading/LoadingGraphic/_docs/LoadingGraphic.stories.tsx +2 -2
  249. package/src/Loading/LoadingSpinner/LoadingSpinner.module.css +32 -0
  250. package/src/Loading/LoadingSpinner/LoadingSpinner.tsx +10 -54
  251. package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.mdx +7 -2
  252. package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.stickersheet.stories.tsx +2 -1
  253. package/src/Loading/LoadingSpinner/_docs/LoadingSpinner.stories.tsx +19 -0
  254. package/src/Loading/LoadingSpinner/subcomponents/SpinnerIcon.tsx +87 -0
  255. package/src/Loading/LoadingSpinner/subcomponents/index.ts +1 -0
  256. package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +2 -0
  257. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +32 -35
  258. package/src/Modal/ContextModal/ContextModal.module.scss +4 -4
  259. package/src/Modal/GenericModal/GenericModal.module.scss +8 -8
  260. package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.module.scss +2 -2
  261. package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.tsx +2 -2
  262. package/src/Modal/InputEditModal/InputEditModal.module.scss +4 -4
  263. package/src/MultiSelect/MultiSelect.spec.tsx +7 -3
  264. package/src/MultiSelect/subcomponents/Checkbox/Checkbox.module.scss +0 -6
  265. package/src/MultiSelect/subcomponents/Checkbox/Checkbox.tsx +10 -9
  266. package/src/MultiSelect/subcomponents/MultiSelectOptions/MultiSelectOptions.spec.tsx +11 -7
  267. package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.tsx +5 -7
  268. package/src/Notification/subcomponents/CancelButton/CancelButton.tsx +2 -2
  269. package/src/Notification/subcomponents/GenericNotification/_mixins.scss +9 -8
  270. package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.module.css +3 -0
  271. package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +22 -16
  272. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.module.scss +0 -4
  273. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.tsx +13 -12
  274. package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.module.scss +0 -1
  275. package/src/Pagination/subcomponents/TruncateIndicator/TruncateIndicator.tsx +2 -2
  276. package/src/Popover/Popover.module.scss +3 -3
  277. package/src/Popover/Popover.tsx +2 -2
  278. package/src/Popover/utils/classMappers.tsx +6 -11
  279. package/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss +2 -2
  280. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.module.scss +1 -1
  281. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stickersheet.stories.tsx +7 -7
  282. package/src/RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/_docs/ToggleIconButton.stories.tsx +2 -2
  283. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.spec.tsx +7 -4
  284. package/src/RichTextEditor/RichTextEditor/subcomponents/Toolbar/_docs/Toolbar.stories.tsx +18 -12
  285. package/src/RichTextEditor/RichTextEditor/utils/controlmap.tsx +25 -18
  286. package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx +4 -8
  287. package/src/Select/Select.module.scss +9 -9
  288. package/src/Select/Select.tsx +10 -7
  289. package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.spec.tsx +4 -5
  290. package/src/SplitButton/subcomponents/DropdownButton/DropdownButton.tsx +2 -2
  291. package/src/Table/Table.module.scss +11 -7
  292. package/src/Table/Table.tsx +4 -8
  293. package/src/Table/_docs/Table.stickersheet.stories.tsx +4 -4
  294. package/src/Table/_docs/Table.stories.tsx +3 -3
  295. package/src/Tabs/subcomponents/index.ts +0 -1
  296. package/src/Tag/Tag.module.scss +2 -0
  297. package/src/Tag/Tag.tsx +7 -13
  298. package/src/Text/Text.module.scss +2 -0
  299. package/src/TextArea/TextArea.module.css +142 -0
  300. package/src/TextArea/TextArea.tsx +25 -53
  301. package/src/TextField/TextField.module.scss +10 -36
  302. package/src/TextField/TextField.spec.tsx +9 -4
  303. package/src/TextField/TextField.tsx +4 -6
  304. package/src/TextField/_docs/TextField.stickersheet.stories.tsx +9 -1
  305. package/src/TextField/_docs/TextField.stories.tsx +4 -3
  306. package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +7 -8
  307. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +3 -3
  308. package/src/TitleBlockZen/TitleBlockZen.module.scss +15 -21
  309. package/src/TitleBlockZen/TitleBlockZen.spec.tsx +1 -1
  310. package/src/TitleBlockZen/TitleBlockZen.tsx +6 -9
  311. package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +5 -5
  312. package/src/TitleBlockZen/subcomponents/MainActions.tsx +5 -3
  313. package/src/TitleBlockZen/subcomponents/MobileActions.module.scss +2 -2
  314. package/src/TitleBlockZen/subcomponents/MobileActions.tsx +13 -16
  315. package/src/TitleBlockZen/subcomponents/SecondaryActions.tsx +3 -3
  316. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +0 -3
  317. package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +2 -2
  318. package/src/Workflow/_docs/Workflow.stories.tsx +4 -5
  319. package/src/Workflow/_docs/WorkflowHeader.stories.tsx +4 -5
  320. package/src/Workflow/_docs/controls/controls.tsx +4 -4
  321. package/src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx +6 -31
  322. package/src/__actions__/Button/v1/Button/Button.module.scss +0 -1
  323. package/src/__actions__/Button/v1/Button/_docs/Button.mdx +1 -1
  324. package/src/__actions__/Button/v1/Button/_docs/Button.stickersheet.stories.tsx +6 -6
  325. package/src/__actions__/Button/v1/Button/_docs/Button.stories.tsx +7 -6
  326. package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stickersheet.stories.tsx +7 -7
  327. package/src/__actions__/Button/v1/IconButton/_docs/IconButton.stories.tsx +5 -5
  328. package/src/__actions__/Button/v2/Button/_docs/Button.mdx +1 -1
  329. package/src/__actions__/Button/v2/Button/_docs/Button.stories.tsx +7 -6
  330. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.stories.tsx +5 -5
  331. package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +1 -1
  332. package/src/__actions__/Button/v3/_docs/Button.docs.stories.tsx +1 -1
  333. package/src/__actions__/Button/v3/_docs/Button.mdx +1 -1
  334. package/src/__actions__/Button/v3/_docs/Button.spec.stories.tsx +1 -1
  335. package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +3 -3
  336. package/src/__actions__/Button/v3/_docs/Button.stories.tsx +1 -1
  337. package/src/__actions__/Menu/v1/_docs/Menu.stickersheet.stories.tsx +3 -3
  338. package/src/__actions__/Menu/v1/_docs/Menu.stories.tsx +3 -3
  339. package/src/__actions__/Menu/v1/_docs/MenuContentExample.tsx +6 -6
  340. package/src/__actions__/Menu/v1/_docs/examples.tsx +5 -5
  341. package/src/__actions__/Menu/v2/_docs/Menu.stories.tsx +3 -3
  342. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +1 -3
  343. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +46 -45
  344. package/src/__actions__/Menu/v3/_docs/Menu.mdx +1 -1
  345. package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +21 -23
  346. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +12 -15
  347. package/src/__future__/Icon/Icon.module.css +35 -0
  348. package/src/__future__/Icon/Icon.spec.tsx +36 -0
  349. package/src/__future__/Icon/Icon.tsx +85 -0
  350. package/src/__future__/Icon/_docs/Icon--api-specification.mdx +98 -0
  351. package/src/__future__/Icon/_docs/Icon--usage-guidelines.mdx +145 -0
  352. package/src/__future__/Icon/_docs/Icon.docs.module.css +17 -0
  353. package/src/__future__/Icon/_docs/Icon.docs.stories.tsx +524 -0
  354. package/src/__future__/Icon/_docs/Icon.stickersheet.stories.tsx +126 -0
  355. package/src/__future__/Icon/_docs/assets/interface-dont.png +0 -0
  356. package/src/__future__/Icon/_docs/assets/tooltip-dont.png +0 -0
  357. package/src/__future__/Icon/constants.ts +149 -0
  358. package/src/__future__/Icon/index.ts +1 -0
  359. package/src/__future__/Icon/material-symbols-metadata.json +3370 -0
  360. package/src/__future__/Icon/types.ts +11 -0
  361. package/src/__future__/Select/_docs/Select.stories.tsx +1 -2
  362. package/src/__future__/Select/subcomponents/ListBox/ListBox.tsx +3 -4
  363. package/src/__future__/Select/subcomponents/Option/Option.tsx +2 -2
  364. package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.module.scss +1 -1
  365. package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.tsx +6 -9
  366. package/src/__future__/Tabs/Tabs.tsx +18 -0
  367. package/src/__future__/Tabs/_docs/Tabs--api-specification.mdx +43 -0
  368. package/src/__future__/Tabs/_docs/Tabs--migration-guide.mdx +93 -0
  369. package/src/__future__/Tabs/_docs/Tabs.stories.tsx +74 -0
  370. package/src/__future__/Tabs/index.ts +2 -0
  371. package/src/__future__/Tabs/subcomponents/Tab/Tab.module.css +94 -0
  372. package/src/__future__/Tabs/subcomponents/Tab/Tab.tsx +58 -0
  373. package/src/__future__/Tabs/subcomponents/Tab/index.ts +1 -0
  374. package/src/__future__/Tabs/subcomponents/TabList/TabList.module.css +8 -0
  375. package/src/__future__/Tabs/subcomponents/TabList/TabList.tsx +45 -0
  376. package/src/__future__/Tabs/subcomponents/TabList/index.ts +1 -0
  377. package/src/__future__/Tabs/subcomponents/TabPanel/TabPanel.module.css +12 -0
  378. package/src/__future__/Tabs/subcomponents/TabPanel/TabPanel.tsx +20 -0
  379. package/src/__future__/Tabs/subcomponents/TabPanel/index.ts +1 -0
  380. package/src/__future__/Tabs/subcomponents/index.ts +3 -0
  381. package/src/__future__/Tag/RemovableTag/_docs/RemovableTag.stories.tsx +0 -77
  382. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.module.scss +1 -58
  383. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveButton.tsx +2 -12
  384. package/src/__future__/Tag/Tag/Tag.module.scss +1 -1
  385. package/src/__future__/Tag/Tag/_docs/Tag-migration-guide.stories.tsx +6 -17
  386. package/src/__future__/Tag/Tag/_docs/Tag.stickersheet.stories.tsx +5 -2
  387. package/src/__future__/Tag/Tag/_docs/Tag.stories.tsx +13 -6
  388. package/src/__future__/index.ts +2 -0
  389. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stickersheet.stories.tsx +10 -10
  390. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stories.tsx +7 -4
  391. package/src/__overlays__/Tooltip/v1/utils/isSemanticElement.spec.tsx +4 -11
  392. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.docs.stories.tsx +10 -10
  393. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +3 -3
  394. package/codemods/utils/getTagName.spec.ts +0 -24
  395. package/codemods/utils/getTagName.ts +0 -32
  396. package/dist/cjs/Loading/LoadingSpinner/LoadingSpinner.module.scss.cjs +0 -7
  397. package/dist/cjs/TextArea/TextArea.module.scss.cjs +0 -13
  398. package/dist/cjs/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.cjs +0 -23
  399. package/dist/esm/Loading/LoadingSpinner/LoadingSpinner.module.scss.mjs +0 -5
  400. package/dist/esm/TextArea/TextArea.module.scss.mjs +0 -11
  401. package/dist/esm/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.mjs +0 -15
  402. package/dist/types/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.d.ts +0 -2
  403. package/src/Loading/LoadingSpinner/LoadingSpinner.module.scss +0 -16
  404. package/src/TextArea/TextArea.module.scss +0 -137
  405. package/src/__future__/Tag/RemovableTag/subcomponents/RemoveTagIcon.tsx +0 -21
  406. /package/dist/cjs/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.cjs +0 -0
  407. /package/dist/esm/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.mjs +0 -0
  408. /package/dist/types/__utilities__/{isClientReady → useIsClientReady}/index.d.ts +0 -0
  409. /package/dist/types/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.d.ts +0 -0
  410. /package/src/__utilities__/{isClientReady → useIsClientReady}/index.ts +0 -0
  411. /package/src/__utilities__/{isClientReady → useIsClientReady}/useIsClientReady.tsx +0 -0
@@ -2,15 +2,8 @@ import React, { FunctionComponent } from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
3
  import isChromatic from "chromatic"
4
4
  import { Popover } from "react-aria-components"
5
- import {
6
- ArrowDownIcon,
7
- ArrowUpIcon,
8
- BookmarkOffIcon,
9
- EditIcon,
10
- MeatballsIcon,
11
- TrashIcon,
12
- } from "~components/Icon"
13
5
  import { Button } from "~components/__actions__/v3"
6
+ import { Icon } from "~components/__future__/Icon"
14
7
  import { Menu, MenuTrigger, MenuItem } from "../index"
15
8
  import * as testStories from "./Menu.spec.stories"
16
9
 
@@ -32,22 +25,26 @@ export const Playground: Story = {
32
25
  render: ({ defaultOpen: _, ...args }) => (
33
26
  <MenuTrigger {...args}>
34
27
  {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
35
- <Button>
36
- <MeatballsIcon role="img" aria-label="Additional actions" />
28
+ <Button className="[--icon-size:24]">
29
+ <Icon name="more_horiz" alt="Additional actions" />
37
30
  </Button>
38
31
  <Popover>
39
32
  <Menu>
40
- <MenuItem icon={<BookmarkOffIcon role="presentation" />}>
33
+ <MenuItem icon={<Icon name="bookmark" isPresentational />}>
41
34
  Save
42
35
  </MenuItem>
43
- <MenuItem icon={<EditIcon role="presentation" />}>Edit</MenuItem>
44
- <MenuItem icon={<ArrowUpIcon role="presentation" />}>
36
+ <MenuItem icon={<Icon name="edit" isPresentational isFilled />}>
37
+ Edit
38
+ </MenuItem>
39
+ <MenuItem icon={<Icon name="arrow_upward" isPresentational />}>
45
40
  Move up
46
41
  </MenuItem>
47
- <MenuItem icon={<ArrowDownIcon role="presentation" />}>
42
+ <MenuItem icon={<Icon name="arrow_downward" isPresentational />}>
48
43
  Move down
49
44
  </MenuItem>
50
- <MenuItem icon={<TrashIcon role="presentation" />}>Delete</MenuItem>
45
+ <MenuItem icon={<Icon name="delete" isPresentational isFilled />}>
46
+ Delete
47
+ </MenuItem>
51
48
  </Menu>
52
49
  </Popover>
53
50
  </MenuTrigger>
@@ -0,0 +1,35 @@
1
+ .icon {
2
+ font-size: calc(1px * var(--icon-size, 20));
3
+ font-weight: var(--icon-font-weight, 400);
4
+ vertical-align: var(--icon-vertical-align);
5
+
6
+ /* Must use vars otherwise whole attribute must be set again */
7
+ font-variation-settings:
8
+ "FILL" var(--icon-fill, 0),
9
+ "GRAD" var(--icon-grade, 0),
10
+ "opsz" var(--icon-optical-size, var(--icon-size, 20));
11
+ }
12
+
13
+ .filled {
14
+ --icon-fill: 1;
15
+ }
16
+
17
+ .shouldMirrorInRTL {
18
+ [dir="rtl"] & {
19
+ transform: scale(-1, 1);
20
+ }
21
+ }
22
+
23
+ .iconLTR {
24
+ [dir="rtl"] & {
25
+ display: none;
26
+ }
27
+ }
28
+
29
+ .iconRTL {
30
+ display: none;
31
+
32
+ [dir="rtl"] & {
33
+ display: inherit;
34
+ }
35
+ }
@@ -0,0 +1,36 @@
1
+ import React from "react"
2
+ import { render, screen } from "@testing-library/react"
3
+ import { Icon } from "./Icon"
4
+
5
+ describe("<Icon />", () => {
6
+ it("sets required attributes for a presentational icon", () => {
7
+ render(<Icon data-testid="test__icon" name="star" isPresentational />)
8
+ const icon = screen.getByTestId("test__icon")
9
+
10
+ expect(icon).toHaveAttribute("aria-hidden", "true")
11
+ expect(icon).not.toHaveAttribute("role")
12
+ expect(icon).not.toHaveAttribute("aria-label")
13
+ })
14
+
15
+ it("sets required attributes for a meaningful icon", () => {
16
+ render(<Icon data-testid="test__icon" name="star" alt="Favourite" />)
17
+ const icon = screen.getByTestId("test__icon")
18
+
19
+ expect(icon).not.toHaveAttribute("aria-hidden")
20
+ expect(icon).toHaveAttribute("role", "img")
21
+ expect(icon).toHaveAttribute("aria-label", "Favourite")
22
+ })
23
+
24
+ describe("shouldMirrorInRTL", () => {
25
+ it("does not show icon name in accessible name for switched icons", () => {
26
+ render(
27
+ <button type="button">
28
+ <Icon name="format_list_numbered" shouldMirrorInRTL alt="Pancakes" />
29
+ </button>
30
+ )
31
+ const button = screen.getByRole("button")
32
+
33
+ expect(button).toHaveAccessibleName("Pancakes")
34
+ })
35
+ })
36
+ })
@@ -0,0 +1,85 @@
1
+ import React, { HTMLAttributes } from "react"
2
+ import classNames from "classnames"
3
+ import { StringSuggestions } from "~components/types/StringSuggestions"
4
+ import { handledRtlIcons } from "./constants"
5
+ import { IconNames } from "./types"
6
+ import styles from "./Icon.module.css"
7
+
8
+ type PresentationalIcon = {
9
+ isPresentational: true
10
+ alt?: never
11
+ }
12
+
13
+ type MeaningfulIcon = {
14
+ isPresentational?: false
15
+ alt: string
16
+ }
17
+
18
+ type BaseIconProps = {
19
+ isFilled?: boolean
20
+ } & HTMLAttributes<HTMLSpanElement> &
21
+ (PresentationalIcon | MeaningfulIcon)
22
+
23
+ type MaterialIconProps = BaseIconProps & {
24
+ children: React.ReactNode
25
+ }
26
+
27
+ const MaterialIcon = ({
28
+ children,
29
+ isFilled,
30
+ isPresentational,
31
+ alt,
32
+ className,
33
+ ...restProps
34
+ }: MaterialIconProps): JSX.Element => (
35
+ <span
36
+ className={classNames(
37
+ "material-symbols-outlined",
38
+ styles.icon,
39
+ isFilled && styles.filled,
40
+ className
41
+ )}
42
+ aria-hidden={isPresentational}
43
+ role={isPresentational ? undefined : "img"}
44
+ aria-label={alt}
45
+ {...restProps}
46
+ >
47
+ {children}
48
+ </span>
49
+ )
50
+
51
+ export type IconProps = BaseIconProps & {
52
+ /** Options available at https://fonts.google.com/icons */
53
+ name: StringSuggestions<IconNames>
54
+ shouldMirrorInRTL?: boolean
55
+ }
56
+
57
+ export const Icon = ({
58
+ name,
59
+ shouldMirrorInRTL,
60
+ ...restProps
61
+ }: IconProps): JSX.Element => {
62
+ if (!shouldMirrorInRTL) {
63
+ return <MaterialIcon {...restProps}>{name}</MaterialIcon>
64
+ }
65
+
66
+ if (Object.keys(handledRtlIcons).includes(name)) {
67
+ return (
68
+ <MaterialIcon {...restProps}>
69
+ <span className={styles.iconLTR}>{name}</span>
70
+ <span className={styles.iconRTL}>
71
+ {handledRtlIcons[name as keyof typeof handledRtlIcons]}
72
+ </span>
73
+ </MaterialIcon>
74
+ )
75
+ }
76
+
77
+ return (
78
+ <MaterialIcon
79
+ {...restProps}
80
+ className={classNames(styles.shouldMirrorInRTL, restProps.className)}
81
+ >
82
+ {name}
83
+ </MaterialIcon>
84
+ )
85
+ }
@@ -0,0 +1,98 @@
1
+ import { Canvas, Meta, Controls, Story } from "@storybook/blocks"
2
+ import { ResourceLinks, KAIOInstallation } from "~storybook/components"
3
+ import * as IconStories from "./Icon.docs.stories"
4
+
5
+ <Meta title="Illustrations/Icon/Icon (Future)/API Specification" />
6
+
7
+ # Icon API Specification (Future)
8
+
9
+ Updated September 4, 2024
10
+
11
+ <ResourceLinks
12
+ sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__v2__/Icon"
13
+ designGuidelines="/?path=/docs/illustrations-icon-v2-usage-guidelines--docs"
14
+ />
15
+
16
+ <KAIOInstallation exportNames="Icon" isFuture />
17
+
18
+ ### Set up
19
+
20
+ Add the following (CDN for the variable icon font) to your Storybook `preview-head.html` and to the `<head>` of your apps.
21
+
22
+ ```html
23
+ <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
24
+ <link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,400,0..1,0&display=block" />
25
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,400,0..1,0&display=block" />
26
+ ```
27
+
28
+ ## Overview
29
+
30
+ Icon extends [Material Symbols](https://fonts.google.com/icons), utilising the CDN.
31
+
32
+ <Canvas of={IconStories.Playground} />
33
+ <Controls of={IconStories.Playground} />
34
+
35
+ ## API
36
+
37
+ ### Name
38
+
39
+ See [Material Symbols](https://fonts.google.com/icons) for all valid options.
40
+
41
+ ### Filled
42
+
43
+ <Canvas of={IconStories.Filled} />
44
+
45
+ ### Mirror in RTL
46
+
47
+ The `shouldMirrorInRTL` prop mirrors the Icon in `dir="rtl"`.
48
+
49
+ Use this for directional icons based on your usage context (eg. forwards in LTR will point right, whilst in RTL will point left).
50
+
51
+ Read more about bidirectionality from [Material Design](https://m2.material.io/design/usability/bidirectionality.html#mirroring-elements).
52
+
53
+ <Canvas of={IconStories.MirrorInRTL} />
54
+
55
+ ### Accessibility
56
+
57
+ #### Meaningful icon
58
+
59
+ Icons without accompanying text need to convey their intent to the screen reader.
60
+ Add `alt` text for these use cases.
61
+
62
+ <Canvas of={IconStories.MeaningfulIcon} />
63
+
64
+ #### Presentational icon
65
+
66
+ For icons which are purely presentational, add `isPresentational` to hide it from the screen reader.
67
+
68
+ <Canvas of={IconStories.PresentationalIcon} />
69
+
70
+ ### Customisation
71
+
72
+ #### Color
73
+
74
+ The Icon component inherits the color from its parent by default. You may also change the color using `className`.
75
+
76
+ <Canvas of={IconStories.Color} />
77
+
78
+ #### Size
79
+
80
+ There are two ways to change the size of the icon:
81
+
82
+ 1. (Recommended) Change the value of the `--icon-size` CSS variable (eg. in Tailwind - `[--icon-size:48]`).
83
+ This option will also scale the [optical size](https://m3.material.io/styles/icons/applying-icons#b41cbc01-9b49-4a44-a525-d153d1ea1425) of the icon.
84
+ Note that the value must be a whole number value without units.
85
+
86
+ 2. Override the `font-size` CSS attribute (eg. in Tailwind - `text-[1em]`).
87
+ This option will not scale the optical size of the icon for you, so you will need to combine it with also
88
+ overriding the `--icon-optical-size` CSS variable (eg. in Tailwind - `[--icon-optical-size:48]`).
89
+
90
+ <Canvas of={IconStories.Size} />
91
+
92
+ ## Default icon set
93
+
94
+ Whilst you have access to all Material Symbols, the following icons match the default set we have in Figma.
95
+
96
+ Tip: Click on the icon you want for a quick copy!
97
+
98
+ <Story of={IconStories.DefaultIconSet} />
@@ -0,0 +1,145 @@
1
+ import { Canvas, Meta, Controls, Story } from "@storybook/blocks"
2
+ import { ResourceLinks, KAIOInstallation, DosAndDonts, DoOrDont } from "~storybook/components"
3
+ import * as IconStories from "./Icon.docs.stories"
4
+
5
+ <Meta title="Illustrations/Icon/Icon (Future)/Usage Guidelines" />
6
+
7
+ # Icon (Future)
8
+
9
+ Updated September 13, 2024
10
+
11
+ <ResourceLinks
12
+ sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__illustrations__/Icon/v3"
13
+ apiSpecification="/?path=/docs/illustrations-icon-v3-api-specification--docs"
14
+ figma="https://www.figma.com/design/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-Heart-UI-Kit?node-id=1929-3974"
15
+ />
16
+
17
+ <KAIOInstallation exportNames="Icon" isFuture />
18
+
19
+ ## Overview
20
+
21
+ Icons are simplified visual symbols that represent ideas, objects, or actions. They improve comprehension, guide interactivity, and draw attention to important information.
22
+
23
+ <Canvas of={IconStories.Playground} />
24
+ <Controls of={IconStories.Playground} include={["name", "isFilled"]} />
25
+
26
+ ### When to use
27
+
28
+ - To support comprehension of an idea, object, or action.
29
+ - To provide visual cues and improving navigation.
30
+
31
+ ### When not to use
32
+
33
+ - When the meaning of the icon is not immediately clear or could be misinterpreted.
34
+ - When text is necessary to convey specific or detailed information.
35
+ - When using too many icons could clutter the interface and overwhelm the user.
36
+ - When accessibility is a concern and the icon does not have appropriate alternative text or support.
37
+ - When the icon does not align with the overall design language or style of the application.
38
+
39
+ ### Specs
40
+
41
+ When you need a new icon, use [Google's Material Symbols set](https://fonts.google.com/icons) via the [Figma plugin](https://www.figma.com/community/plugin/1088610476491668236/material-symbols) to add the relevant icons in:
42
+ - **Outlined**
43
+ - **Weight**: 400
44
+ - **Grade**: Normal (0)
45
+ - **Fill**: On or Off
46
+
47
+ #### Do use icons consistently
48
+
49
+ Consistent use of icons helps users quickly recognize and understand their function, improving overall usability.
50
+ Refer to the [default set](#default-icon-set) for icons commonly used across the platform.
51
+
52
+ <DosAndDonts>
53
+ <DoOrDont story={IconStories.ConsistentDo} />
54
+ </DosAndDonts>
55
+
56
+ #### Do use the appropriate fill for the icon context and state
57
+
58
+ Filled icons can indicate an active state or selection. Unfilled icons often represent a default or inactive state. Not all icons change appearance when toggled between filled and unfilled, so use this distinction thoughtfully.
59
+
60
+ <DosAndDonts>
61
+ <DoOrDont story={IconStories.FilledUnfilledDo} />
62
+ </DosAndDonts>
63
+
64
+ #### Do use the correct optical size
65
+
66
+ Scale the optical size to match the size of the icon - do not mix icon sizes with a different optical size.
67
+
68
+ <DosAndDonts>
69
+ <DoOrDont story={IconStories.OpticalSizeDo} />
70
+ <DoOrDont story={IconStories.OpticalSizeDont} isDont />
71
+ </DosAndDonts>
72
+
73
+ #### Do align the icon vertically
74
+
75
+ Vertically center the icon by shifting down the baseline of symbols to approximately 11.5% of the type size.
76
+
77
+ <DosAndDonts>
78
+ <DoOrDont story={IconStories.AlignmentDo} />
79
+ <DoOrDont story={IconStories.AlignmentDont} isDont />
80
+ </DosAndDonts>
81
+
82
+ #### Do use icon colors that meet 3:1 contrast ratios with their background
83
+
84
+ Icons should be easily distinguishable and clearly visible against their background to ensure they are accessible to all users, including those with visual impairments.
85
+
86
+ <DosAndDonts>
87
+ <DoOrDont story={IconStories.ContrastDo} />
88
+ <DoOrDont story={IconStories.ContrastDont} isDont />
89
+ </DosAndDonts>
90
+
91
+ #### Do use color purposefully
92
+
93
+ Where suitable, color can be used to highlight an icon or reinforce its meaning, such as using green for success or red for errors.
94
+
95
+ <DosAndDonts>
96
+ <DoOrDont story={IconStories.ColorPurposefulDo} />
97
+ </DosAndDonts>
98
+
99
+ #### Don't rely on color alone
100
+
101
+ Ensure that icons are distinguishable by varying the icon, fill, or labels. Relying only on color can make the interface less accessible to colorblind users.
102
+
103
+ <DosAndDonts>
104
+ <DoOrDont story={IconStories.DistinguishDo} />
105
+ <DoOrDont story={IconStories.DistinguishDont} isDont />
106
+ </DosAndDonts>
107
+
108
+ #### Don't overload your interface with too many icons
109
+
110
+ Overusing icons can create visual clutter and overwhelm users. Use them sparingly to highlight important actions or information.
111
+
112
+ <DosAndDonts>
113
+ <DoOrDont story={IconStories.InterfaceDont} isDont />
114
+ </DosAndDonts>
115
+
116
+ #### Don't rely on icons alone for conveying important information
117
+
118
+ Icons should support, not replace, text labels, especially for accessibility. Screen readers and other assistive technologies may not always interpret icons correctly.
119
+
120
+ <DosAndDonts>
121
+ <DoOrDont story={IconStories.ImportantInformationDo} />
122
+ <DoOrDont story={IconStories.ImportantInformationDont} isDont />
123
+ </DosAndDonts>
124
+
125
+ #### Do use appropriate states on interactive icons
126
+
127
+ If the icon is interactive, it should have a base, hover, and focus state.
128
+
129
+ <DosAndDonts>
130
+ <DoOrDont story={IconStories.InteractiveStatesDo} />
131
+ </DosAndDonts>
132
+
133
+ #### Don't rely on tooltips to covey icon meaning
134
+
135
+ Important information can be hidden if it's only explained in tooltips, leading to poor user experience. Whenever possible, include a text label or other contextual information alongside the icon to clearly convey its meaning.
136
+
137
+ <DosAndDonts>
138
+ <DoOrDont story={IconStories.TooltipDont} isDont />
139
+ </DosAndDonts>
140
+
141
+ ## Default icon set
142
+
143
+ Whilst you have access to all Material Symbols, the following icons match the default set we have in Figma.
144
+
145
+ <Story of={IconStories.DefaultIconSet} />
@@ -0,0 +1,17 @@
1
+ .interactiveIcon {
2
+ position: relative;
3
+ background: none;
4
+ padding: 0;
5
+ color: var(--color-blue-500);
6
+
7
+ &:hover {
8
+ color: var(--color-blue-400);
9
+ }
10
+ }
11
+
12
+ .interactiveIcon:focus::after {
13
+ position: absolute;
14
+ content: "";
15
+ border: var(--border-focus-ring-border-width) solid var(--color-blue-500);
16
+ inset: -2px;
17
+ }