@kaizen/components 1.55.1 → 1.56.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 (298) hide show
  1. package/dist/cjs/BrandMoment/BrandMoment.cjs +1 -2
  2. package/dist/cjs/Collapsible/Collapsible/Collapsible.cjs +1 -2
  3. package/dist/cjs/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.cjs +4 -7
  4. package/dist/cjs/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.cjs +1 -2
  5. package/dist/cjs/Filter/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.cjs +1 -1
  6. package/dist/cjs/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.cjs +1 -2
  7. package/dist/cjs/GuidanceBlock/GuidanceBlock.cjs +1 -2
  8. package/dist/cjs/Icon/subcomponents/SVG/SVG.cjs +3 -2
  9. package/dist/cjs/Illustration/subcomponents/VideoPlayer/VideoPlayer.cjs +1 -2
  10. package/dist/cjs/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.cjs +1 -2
  11. package/dist/cjs/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.cjs +1 -2
  12. package/dist/cjs/Pagination/subcomponents/DirectionalLink/DirectionalLink.cjs +1 -1
  13. package/dist/cjs/Pagination/subcomponents/PaginationLink/PaginationLink.cjs +1 -1
  14. package/dist/cjs/RichTextEditor/utils/core/createRichTextEditor.cjs +2 -1
  15. package/dist/cjs/SplitButton/SplitButton.cjs +1 -5
  16. package/dist/cjs/Tile/subcomponents/GenericTile/Action.cjs +1 -2
  17. package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +1 -2
  18. package/dist/cjs/TitleBlockZen/TitleBlockZen.cjs +1 -2
  19. package/dist/cjs/TitleBlockZen/subcomponents/MainActions.cjs +4 -7
  20. package/dist/cjs/TitleBlockZen/subcomponents/MobileActions.cjs +3 -5
  21. package/dist/cjs/TitleBlockZen/subcomponents/SecondaryActions.cjs +4 -7
  22. package/dist/cjs/TitleBlockZen/subcomponents/TitleBlockMenuItem.cjs +1 -5
  23. package/dist/cjs/{Button → __actions__/Button/v1}/GenericButton/GenericButton.cjs +6 -6
  24. package/dist/cjs/__actions__/Button/v1/GenericButton/GenericButton.module.scss.cjs +28 -0
  25. package/dist/cjs/__actions__/Button/v3/Button.cjs +28 -0
  26. package/dist/cjs/__actions__/Button/v3/Button.module.scss.cjs +9 -0
  27. package/dist/cjs/__actions__/Menu/v1/index.cjs +20 -0
  28. package/dist/cjs/__actions__/Menu/v1/subcomponents/MenuDropdown/MenuDropdown.module.scss.cjs +7 -0
  29. package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.cjs +1 -1
  30. package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.module.scss.cjs +1 -1
  31. package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.cjs +1 -0
  32. package/dist/cjs/__actions__/Menu/v1/subcomponents/MenuItem/MenuItem.module.scss.cjs +12 -0
  33. package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.module.scss.cjs +1 -1
  34. package/dist/cjs/__actions__/Menu/v1/subcomponents/StatelessMenu/StatelessMenu.module.scss.cjs +6 -0
  35. package/dist/cjs/__actions__/Menu/v3/Menu.cjs +26 -0
  36. package/dist/cjs/__actions__/Menu/v3/Menu.module.scss.cjs +6 -0
  37. package/dist/cjs/__actions__/Menu/v3/MenuItem.cjs +30 -0
  38. package/dist/cjs/__actions__/Menu/v3/MenuItem.module.scss.cjs +7 -0
  39. package/dist/cjs/__actions__/Menu/v3/MenuTrigger.cjs +19 -0
  40. package/dist/cjs/actionsV1.cjs +12 -0
  41. package/dist/cjs/actionsV2.cjs +18 -0
  42. package/dist/cjs/actionsV3.cjs +10 -0
  43. package/dist/cjs/index.cjs +10 -14
  44. package/dist/esm/BrandMoment/BrandMoment.mjs +1 -2
  45. package/dist/esm/Collapsible/Collapsible/Collapsible.mjs +1 -2
  46. package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +4 -7
  47. package/dist/esm/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.mjs +1 -2
  48. package/dist/esm/Filter/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.mjs +1 -1
  49. package/dist/esm/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.mjs +1 -2
  50. package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +1 -2
  51. package/dist/esm/Icon/subcomponents/SVG/SVG.mjs +3 -2
  52. package/dist/esm/Illustration/subcomponents/VideoPlayer/VideoPlayer.mjs +1 -2
  53. package/dist/esm/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.mjs +1 -2
  54. package/dist/esm/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.mjs +1 -2
  55. package/dist/esm/Pagination/subcomponents/DirectionalLink/DirectionalLink.mjs +1 -1
  56. package/dist/esm/Pagination/subcomponents/PaginationLink/PaginationLink.mjs +1 -1
  57. package/dist/esm/RichTextEditor/utils/core/createRichTextEditor.mjs +2 -1
  58. package/dist/esm/SplitButton/SplitButton.mjs +1 -5
  59. package/dist/esm/Tile/subcomponents/GenericTile/Action.mjs +1 -2
  60. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +1 -2
  61. package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +1 -2
  62. package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs +4 -7
  63. package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs +3 -5
  64. package/dist/esm/TitleBlockZen/subcomponents/SecondaryActions.mjs +4 -7
  65. package/dist/esm/TitleBlockZen/subcomponents/TitleBlockMenuItem.mjs +1 -5
  66. package/dist/esm/{Button → __actions__/Button/v1}/GenericButton/GenericButton.mjs +6 -6
  67. package/dist/esm/__actions__/Button/v1/GenericButton/GenericButton.module.scss.mjs +26 -0
  68. package/dist/esm/__actions__/Button/v3/Button.mjs +20 -0
  69. package/dist/esm/__actions__/Button/v3/Button.module.scss.mjs +7 -0
  70. package/dist/esm/__actions__/Menu/v1/index.mjs +14 -0
  71. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuDropdown/MenuDropdown.module.scss.mjs +5 -0
  72. package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.mjs +1 -1
  73. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuHeading/MenuHeading.module.scss.mjs +4 -0
  74. package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.mjs +1 -0
  75. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuItem/MenuItem.module.scss.mjs +10 -0
  76. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuList/MenuList.module.scss.mjs +4 -0
  77. package/dist/esm/__actions__/Menu/v1/subcomponents/StatelessMenu/StatelessMenu.module.scss.mjs +4 -0
  78. package/dist/esm/__actions__/Menu/v3/Menu.mjs +18 -0
  79. package/dist/esm/__actions__/Menu/v3/Menu.module.scss.mjs +4 -0
  80. package/dist/esm/__actions__/Menu/v3/MenuItem.mjs +22 -0
  81. package/dist/esm/__actions__/Menu/v3/MenuItem.module.scss.mjs +5 -0
  82. package/dist/esm/__actions__/Menu/v3/MenuTrigger.mjs +11 -0
  83. package/dist/esm/actionsV1.mjs +3 -0
  84. package/dist/esm/actionsV2.mjs +8 -0
  85. package/dist/esm/actionsV3.mjs +4 -0
  86. package/dist/esm/index.mjs +3 -7
  87. package/dist/styles.css +11 -8
  88. package/dist/types/BrandMoment/BrandMoment.d.ts +1 -1
  89. package/dist/types/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.d.ts +1 -1
  90. package/dist/types/GuidanceBlock/GuidanceBlock.d.ts +1 -1
  91. package/dist/types/Icon/subcomponents/SVG/SVG.d.ts +2 -1
  92. package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +1 -1
  93. package/dist/types/Pagination/subcomponents/DirectionalLink/DirectionalLink.d.ts +1 -1
  94. package/dist/types/Pagination/subcomponents/PaginationLink/PaginationLink.d.ts +1 -1
  95. package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +1 -1
  96. package/dist/types/TitleBlockZen/subcomponents/MobileActions.d.ts +1 -1
  97. package/dist/types/TitleBlockZen/subcomponents/Toolbar.d.ts +1 -2
  98. package/dist/types/TitleBlockZen/types.d.ts +1 -2
  99. package/dist/types/__actions__/Button/v2/Button/index.d.ts +1 -0
  100. package/dist/types/__actions__/Button/v2/GenericButton/index.d.ts +1 -0
  101. package/dist/types/__actions__/Button/v2/IconButton/index.d.ts +1 -0
  102. package/dist/types/__actions__/Button/v2/index.d.ts +3 -0
  103. package/dist/types/__actions__/Button/v3/Button.d.ts +11 -0
  104. package/dist/types/__actions__/Button/v3/index.d.ts +1 -0
  105. package/dist/types/{Menu → __actions__/Menu/v1}/Menu.d.ts +1 -1
  106. package/dist/types/__actions__/Menu/v1/index.d.ts +30 -0
  107. package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.d.ts +1 -1
  108. package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.d.ts +1 -1
  109. package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.d.ts +1 -1
  110. package/dist/types/__actions__/Menu/v2/index.d.ts +6 -0
  111. package/dist/types/__actions__/Menu/v3/Menu.d.ts +7 -0
  112. package/dist/types/__actions__/Menu/v3/MenuItem.d.ts +17 -0
  113. package/dist/types/__actions__/Menu/v3/MenuTrigger.d.ts +6 -0
  114. package/dist/types/__actions__/Menu/v3/SubmenuTrigger.d.ts +8 -0
  115. package/dist/types/__actions__/Menu/v3/index.d.ts +3 -0
  116. package/dist/types/__actions__/v1.d.ts +2 -0
  117. package/dist/types/__actions__/v2.d.ts +2 -0
  118. package/dist/types/__actions__/v3.d.ts +2 -0
  119. package/dist/types/index.d.ts +2 -2
  120. package/package.json +30 -30
  121. package/src/BrandMoment/BrandMoment.tsx +1 -1
  122. package/src/BrandMoment/_docs/ExampleHeaders.tsx +1 -1
  123. package/src/Collapsible/Collapsible/Collapsible.tsx +1 -1
  124. package/src/DatePicker/_docs/DatePicker.stories.tsx +1 -1
  125. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +1 -1
  126. package/src/EmptyState/_docs/EmptyState.stories.tsx +1 -1
  127. package/src/ErrorPage/ErrorPage.spec.tsx +142 -0
  128. package/src/ErrorPage/_docs/ErrorPage.stickersheet.stories.tsx +8 -26
  129. package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +1 -2
  130. package/src/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.tsx +1 -1
  131. package/src/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.tsx +1 -1
  132. package/src/GuidanceBlock/GuidanceBlock.tsx +1 -1
  133. package/src/Icon/subcomponents/SVG/SVG.tsx +4 -1
  134. package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.tsx +1 -1
  135. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +1 -1
  136. package/src/Modal/ContextModal/ContextModal.tsx +1 -1
  137. package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +1 -1
  138. package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.tsx +1 -1
  139. package/src/Modal/InputEditModal/InputEditModal.tsx +1 -1
  140. package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +1 -1
  141. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.module.scss +2 -2
  142. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.tsx +4 -1
  143. package/src/Pagination/subcomponents/PaginationLink/PaginationLink.module.scss +2 -2
  144. package/src/Pagination/subcomponents/PaginationLink/PaginationLink.tsx +4 -1
  145. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stories.tsx +1 -1
  146. package/src/RichTextEditor/utils/core/createRichTextEditor.ts +3 -1
  147. package/src/SplitButton/SplitButton.spec.tsx +1 -1
  148. package/src/SplitButton/SplitButton.tsx +1 -1
  149. package/src/SplitButton/_docs/SplitButton.stickersheet.stories.tsx +1 -1
  150. package/src/SplitButton/_docs/SplitButton.stories.tsx +1 -1
  151. package/src/Tabs/_docs/Tabs.stories.tsx +1 -1
  152. package/src/Tile/subcomponents/GenericTile/Action.tsx +1 -1
  153. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +2 -2
  154. package/src/TitleBlockZen/TitleBlockZen.tsx +1 -1
  155. package/src/TitleBlockZen/subcomponents/MainActions.tsx +1 -2
  156. package/src/TitleBlockZen/subcomponents/MobileActions.tsx +6 -2
  157. package/src/TitleBlockZen/subcomponents/SecondaryActions.tsx +1 -2
  158. package/src/TitleBlockZen/subcomponents/TitleBlockMenuItem.tsx +1 -1
  159. package/src/TitleBlockZen/subcomponents/Toolbar.tsx +1 -2
  160. package/src/TitleBlockZen/types.ts +5 -2
  161. package/src/Workflow/_docs/Workflow.stories.tsx +1 -1
  162. package/src/Workflow/_docs/WorkflowFooter.stories.tsx +1 -1
  163. package/src/Workflow/_docs/WorkflowHeader.stories.tsx +1 -1
  164. package/src/Workflow/_docs/controls/controls.tsx +1 -1
  165. package/src/{Button → __actions__/Button/v1}/Button/Button.module.scss +1 -1
  166. package/src/{Button → __actions__/Button/v1}/Button/_docs/Button.mdx +2 -2
  167. package/src/{Button → __actions__/Button/v1}/Button/_docs/Button.stickersheet.stories.tsx +1 -1
  168. package/src/{Button → __actions__/Button/v1}/Button/_docs/Button.stories.tsx +1 -1
  169. package/src/{Button → __actions__/Button/v1}/GenericButton/GenericButton.module.scss +2 -2
  170. package/src/{Button → __actions__/Button/v1}/IconButton/_docs/IconButton.mdx +2 -2
  171. package/src/{Button → __actions__/Button/v1}/IconButton/_docs/IconButton.stickersheet.stories.tsx +2 -2
  172. package/src/{Button → __actions__/Button/v1}/IconButton/_docs/IconButton.stories.tsx +1 -1
  173. package/src/{Button → __actions__/Button/v1}/utils/_variables.scss +2 -2
  174. package/src/__actions__/Button/v2/Button/_docs/Button.mdx +98 -0
  175. package/src/__actions__/Button/v2/Button/_docs/Button.stories.tsx +170 -0
  176. package/src/__actions__/Button/v2/Button/index.ts +1 -0
  177. package/src/__actions__/Button/v2/GenericButton/index.ts +1 -0
  178. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.mdx +24 -0
  179. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.stories.tsx +37 -0
  180. package/src/__actions__/Button/v2/IconButton/index.ts +1 -0
  181. package/src/__actions__/Button/v2/index.ts +3 -0
  182. package/src/__actions__/Button/v3/Button.module.scss +104 -0
  183. package/src/__actions__/Button/v3/Button.tsx +44 -0
  184. package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +173 -0
  185. package/src/__actions__/Button/v3/_docs/Button.docs.stories.tsx +76 -0
  186. package/src/__actions__/Button/v3/_docs/Button.mdx +41 -0
  187. package/src/__actions__/Button/v3/_docs/Button.spec.stories.tsx +193 -0
  188. package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +135 -0
  189. package/src/__actions__/Button/v3/_docs/Button.stories.tsx +98 -0
  190. package/src/__actions__/Button/v3/index.ts +1 -0
  191. package/src/{Menu → __actions__/Menu/v1}/Menu.spec.tsx +1 -1
  192. package/src/{Menu → __actions__/Menu/v1}/Menu.tsx +1 -1
  193. package/src/__actions__/Menu/v1/_docs/Menu.mdx +29 -0
  194. package/src/{Menu → __actions__/Menu/v1}/_docs/Menu.stickersheet.stories.tsx +2 -2
  195. package/src/{Menu → __actions__/Menu/v1}/_docs/Menu.stories.tsx +2 -2
  196. package/src/{Menu → __actions__/Menu/v1}/_docs/MenuContentExample.tsx +28 -7
  197. package/src/{Menu → __actions__/Menu/v1}/_docs/examples.tsx +1 -1
  198. package/src/__actions__/Menu/v1/index.ts +35 -0
  199. package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.tsx +2 -1
  200. package/src/{Menu → __actions__/Menu/v2}/_docs/Menu.mdx +2 -2
  201. package/src/__actions__/Menu/v2/_docs/Menu.stories.tsx +54 -0
  202. package/src/__actions__/Menu/v2/index.ts +6 -0
  203. package/src/__actions__/Menu/v3/Menu.module.scss +32 -0
  204. package/src/__actions__/Menu/v3/Menu.tsx +28 -0
  205. package/src/__actions__/Menu/v3/MenuItem.module.scss +34 -0
  206. package/src/__actions__/Menu/v3/MenuItem.tsx +32 -0
  207. package/src/__actions__/Menu/v3/MenuTrigger.tsx +14 -0
  208. package/src/__actions__/Menu/v3/SubmenuTrigger.tsx +18 -0
  209. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +98 -0
  210. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +280 -0
  211. package/src/__actions__/Menu/v3/_docs/Menu.mdx +202 -0
  212. package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +269 -0
  213. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +69 -0
  214. package/src/__actions__/Menu/v3/index.ts +3 -0
  215. package/src/__actions__/v1.ts +2 -0
  216. package/src/__actions__/v2.ts +2 -0
  217. package/src/__actions__/v3.ts +2 -0
  218. package/src/__future__/Workflow/_docs/Workflow.stories.tsx +1 -1
  219. package/src/__future__/Workflow/_docs/WorkflowFooter.stories.tsx +1 -1
  220. package/src/__future__/Workflow/_docs/WorkflowHeader.stories.tsx +1 -1
  221. package/src/__future__/Workflow/_docs/controls/controls.tsx +1 -1
  222. package/src/__overlays__/Tooltip/v1/Tooltip.spec.tsx +1 -1
  223. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stickersheet.stories.tsx +1 -1
  224. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stories.tsx +1 -1
  225. package/src/__overlays__/Tooltip/v1/utils/isSemanticElement.spec.tsx +1 -1
  226. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.docs.stories.tsx +1 -1
  227. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +1 -1
  228. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.stories.tsx +1 -1
  229. package/src/index.ts +2 -2
  230. package/v1/actions/package.json +5 -0
  231. package/v2/actions/package.json +5 -0
  232. package/v3/actions/package.json +5 -0
  233. package/dist/cjs/Button/GenericButton/GenericButton.module.scss.cjs +0 -28
  234. package/dist/cjs/Menu/subcomponents/MenuDropdown/MenuDropdown.module.scss.cjs +0 -7
  235. package/dist/cjs/Menu/subcomponents/MenuItem/MenuItem.module.scss.cjs +0 -12
  236. package/dist/cjs/Menu/subcomponents/StatelessMenu/StatelessMenu.module.scss.cjs +0 -6
  237. package/dist/esm/Button/GenericButton/GenericButton.module.scss.mjs +0 -26
  238. package/dist/esm/Menu/subcomponents/MenuDropdown/MenuDropdown.module.scss.mjs +0 -5
  239. package/dist/esm/Menu/subcomponents/MenuHeading/MenuHeading.module.scss.mjs +0 -4
  240. package/dist/esm/Menu/subcomponents/MenuItem/MenuItem.module.scss.mjs +0 -10
  241. package/dist/esm/Menu/subcomponents/MenuList/MenuList.module.scss.mjs +0 -4
  242. package/dist/esm/Menu/subcomponents/StatelessMenu/StatelessMenu.module.scss.mjs +0 -4
  243. package/dist/types/Menu/index.d.ts +0 -5
  244. package/src/Menu/index.ts +0 -5
  245. /package/dist/cjs/{Button → __actions__/Button/v1}/Button/Button.cjs +0 -0
  246. /package/dist/cjs/{Button → __actions__/Button/v1}/IconButton/IconButton.cjs +0 -0
  247. /package/dist/cjs/{Menu → __actions__/Menu/v1}/Menu.cjs +0 -0
  248. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.cjs +0 -0
  249. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.cjs +0 -0
  250. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.cjs +0 -0
  251. /package/dist/esm/{Button → __actions__/Button/v1}/Button/Button.mjs +0 -0
  252. /package/dist/esm/{Button → __actions__/Button/v1}/IconButton/IconButton.mjs +0 -0
  253. /package/dist/esm/{Menu → __actions__/Menu/v1}/Menu.mjs +0 -0
  254. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.mjs +0 -0
  255. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.mjs +0 -0
  256. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.mjs +0 -0
  257. /package/dist/types/{Button → __actions__/Button/v1}/Button/Button.d.ts +0 -0
  258. /package/dist/types/{Button → __actions__/Button/v1}/Button/index.d.ts +0 -0
  259. /package/dist/types/{Button → __actions__/Button/v1}/GenericButton/GenericButton.d.ts +0 -0
  260. /package/dist/types/{Button → __actions__/Button/v1}/GenericButton/index.d.ts +0 -0
  261. /package/dist/types/{Button → __actions__/Button/v1}/IconButton/IconButton.d.ts +0 -0
  262. /package/dist/types/{Button → __actions__/Button/v1}/IconButton/index.d.ts +0 -0
  263. /package/dist/types/{Button → __actions__/Button/v1}/index.d.ts +0 -0
  264. /package/dist/types/{Menu → __actions__/Menu/v1}/_docs/MenuContentExample.d.ts +0 -0
  265. /package/dist/types/{Menu → __actions__/Menu/v1}/_docs/examples.d.ts +0 -0
  266. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.d.ts +0 -0
  267. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/index.d.ts +0 -0
  268. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/index.d.ts +0 -0
  269. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/index.d.ts +0 -0
  270. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/index.d.ts +0 -0
  271. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.d.ts +0 -0
  272. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/index.d.ts +0 -0
  273. /package/src/{Button → __actions__/Button/v1}/Button/Button.tsx +0 -0
  274. /package/src/{Button → __actions__/Button/v1}/Button/index.ts +0 -0
  275. /package/src/{Button → __actions__/Button/v1}/GenericButton/GenericButton.spec.tsx +0 -0
  276. /package/src/{Button → __actions__/Button/v1}/GenericButton/GenericButton.tsx +0 -0
  277. /package/src/{Button → __actions__/Button/v1}/GenericButton/index.ts +0 -0
  278. /package/src/{Button → __actions__/Button/v1}/IconButton/IconButton.module.scss +0 -0
  279. /package/src/{Button → __actions__/Button/v1}/IconButton/IconButton.spec.tsx +0 -0
  280. /package/src/{Button → __actions__/Button/v1}/IconButton/IconButton.tsx +0 -0
  281. /package/src/{Button → __actions__/Button/v1}/IconButton/index.ts +0 -0
  282. /package/src/{Button → __actions__/Button/v1}/index.ts +0 -0
  283. /package/src/{Button → __actions__/Button/v1}/utils/_mixins.scss +0 -0
  284. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.module.scss +0 -0
  285. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.tsx +0 -0
  286. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/index.ts +0 -0
  287. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.module.scss +0 -0
  288. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.tsx +0 -0
  289. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/index.ts +0 -0
  290. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.module.scss +0 -0
  291. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/index.ts +0 -0
  292. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.module.scss +0 -0
  293. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.spec.tsx +0 -0
  294. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.tsx +0 -0
  295. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/index.ts +0 -0
  296. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.module.scss +0 -0
  297. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.tsx +0 -0
  298. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/index.ts +0 -0
@@ -0,0 +1,170 @@
1
+ import React, { useState } from "react"
2
+ import { StoryObj, Meta } from "@storybook/react"
3
+ import { ArrowForwardIcon, ArrowRightIcon } from "~components/Icon"
4
+ import { LoadingInput } from "~components/Loading"
5
+ import { TextField } from "~components/TextField"
6
+ import { Button } from "../index"
7
+
8
+ const meta = {
9
+ title: "Actions/Button/v2",
10
+ component: Button,
11
+ args: {
12
+ label: "Label",
13
+ },
14
+ } satisfies Meta<typeof Button>
15
+
16
+ export default meta
17
+
18
+ type Story = StoryObj<typeof meta>
19
+
20
+ export const Playground: Story = {
21
+ parameters: {
22
+ docs: {
23
+ canvas: {
24
+ sourceState: "shown",
25
+ },
26
+ },
27
+ },
28
+ }
29
+
30
+ export const Variants: Story = {
31
+ render: ({ reversed }) => (
32
+ <>
33
+ <Button label="Default" reversed={reversed} />
34
+ <Button label="Primary" primary reversed={reversed} />
35
+ <Button label="Destructive" destructive reversed={reversed} />
36
+ <Button label="Secondary" secondary reversed={reversed} />
37
+ {!reversed && (
38
+ <Button label="Secondary Destructive" secondary destructive />
39
+ )}
40
+ </>
41
+ ),
42
+ decorators: [
43
+ Story => (
44
+ <div style={{ display: "flex", gap: "1rem" }}>
45
+ <Story />
46
+ </div>
47
+ ),
48
+ ],
49
+ parameters: { controls: { disable: true } },
50
+ }
51
+
52
+ export const Reversed: Story = {
53
+ ...Variants,
54
+ args: { reversed: true },
55
+ parameters: {
56
+ ...Variants.parameters,
57
+ backgrounds: { default: "Purple 700" },
58
+ },
59
+ }
60
+
61
+ export const Disabled: Story = {
62
+ args: { disabled: true },
63
+ }
64
+
65
+ const sourceCodeIcon = `
66
+ import { Button, ArrowForwardIcon } from "@kaizen/components"
67
+
68
+ <Button label="Label" icon={<ArrowForwardIcon role="presentation" />} />
69
+ `
70
+
71
+ export const Icon: Story = {
72
+ args: {
73
+ icon: <ArrowForwardIcon role="presentation" />,
74
+ },
75
+ parameters: {
76
+ docs: { source: { code: sourceCodeIcon } },
77
+ },
78
+ }
79
+
80
+ export const IconPosition: Story = {
81
+ args: {
82
+ icon: <ArrowRightIcon role="presentation" />,
83
+ iconPosition: "end",
84
+ },
85
+ }
86
+
87
+ export const Badge: Story = {
88
+ args: {
89
+ badge: { text: "3", variant: "active" },
90
+ secondary: true,
91
+ },
92
+ }
93
+
94
+ export const FullWidth: Story = {
95
+ args: { fullWidth: true },
96
+ }
97
+
98
+ export const Working: Story = {
99
+ render: () => (
100
+ <>
101
+ <Button label="Label" working workingLabel="Submitting" />
102
+ <Button
103
+ label="Label"
104
+ working
105
+ workingLabel="Submitting"
106
+ workingLabelHidden
107
+ />
108
+ </>
109
+ ),
110
+ decorators: [
111
+ Story => (
112
+ <div style={{ display: "flex", gap: "1rem" }}>
113
+ <Story />
114
+ </div>
115
+ ),
116
+ ],
117
+ parameters: { controls: { disable: true } },
118
+ }
119
+
120
+ export const Loading: Story = {
121
+ render: () => <LoadingInput isAnimated width={13} />,
122
+ parameters: { controls: { disable: true } },
123
+ }
124
+
125
+ export const NativeFormButton: Story = {
126
+ render: () => (
127
+ <>
128
+ <form className="mb-6" id="unique-form-id">
129
+ <TextField labelText="Sample text field" defaultValue="content" />
130
+ </form>
131
+ <Button
132
+ label="Submit"
133
+ type="submit"
134
+ form="unique-form-id"
135
+ formTarget="_blank"
136
+ formAction="/"
137
+ formMethod="get"
138
+ formEncType="text/plain"
139
+ formNoValidate={false}
140
+ />
141
+ </>
142
+ ),
143
+ parameters: { controls: { disable: true } },
144
+ }
145
+
146
+ export const ResolveWorking: Story = {
147
+ render: () => {
148
+ const [state, setState] = useState<"Ready" | "Working" | "Completed">(
149
+ "Ready"
150
+ )
151
+ const handleClick = (): void => {
152
+ if (state === "Ready") {
153
+ setState("Working")
154
+ setTimeout(() => setState("Completed"), 3000)
155
+ } else {
156
+ setState("Ready")
157
+ }
158
+ }
159
+
160
+ return (
161
+ <Button
162
+ label={state}
163
+ working={state === "Working"}
164
+ workingLabel="Button is doing some work"
165
+ workingLabelHidden
166
+ onClick={handleClick}
167
+ />
168
+ )
169
+ },
170
+ }
@@ -0,0 +1 @@
1
+ export * from "../../v1/Button"
@@ -0,0 +1 @@
1
+ export * from "../../v1/GenericButton"
@@ -0,0 +1,24 @@
1
+ import { Canvas, Controls, Meta } from "@storybook/blocks"
2
+ import { ResourceLinks, KAIOInstallation, LinkTo } from "~storybook/components"
3
+ import * as IconButtonStories from "./IconButton.stories"
4
+
5
+ <Meta of={IconButtonStories} />
6
+
7
+ # IconButton (v2)
8
+
9
+ <ResourceLinks
10
+ sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Button/IconButton"
11
+ figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%F0%9F%96%BC%EF%B8%8F-Component-Gallery?type=design&node-id=5-539&mode=design&t=HKGcnRVyIDipQ2OI-0"
12
+ designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3062890984/Button"
13
+
14
+ />
15
+
16
+ <KAIOInstallation exportNames="IconButton" family="actions" version="2" />
17
+
18
+ ## Overview
19
+
20
+ A button with an icon and no visible text (a label is required for accessibility).
21
+ Use any <LinkTo pageId="components-icons">Icon</LinkTo> component in the `icon` prop.
22
+
23
+ <Canvas of={IconButtonStories.Playground} />
24
+ <Controls of={IconButtonStories.Playground} />
@@ -0,0 +1,37 @@
1
+ import React from "react"
2
+ import { Meta, StoryObj } from "@storybook/react"
3
+ import { AddIcon, MeatballsIcon } from "~components/Icon"
4
+ import { IconButton } from "../index"
5
+
6
+ const meta = {
7
+ title: "Actions/IconButton/v2",
8
+ component: IconButton,
9
+ argTypes: {
10
+ icon: {
11
+ options: ["MeatballsIcon", "AddIcon"],
12
+ control: { type: "radio" },
13
+ mapping: {
14
+ MeatballsIcon: <MeatballsIcon role="presentation" />,
15
+ AddIcon: <AddIcon role="presentation" />,
16
+ },
17
+ },
18
+ },
19
+ args: {
20
+ label: "icon button",
21
+ icon: <MeatballsIcon role="presentation" />,
22
+ },
23
+ } satisfies Meta<typeof IconButton>
24
+
25
+ export default meta
26
+
27
+ type Story = StoryObj<typeof meta>
28
+
29
+ export const Playground: Story = {
30
+ parameters: {
31
+ docs: {
32
+ canvas: {
33
+ sourceState: "shown",
34
+ },
35
+ },
36
+ },
37
+ }
@@ -0,0 +1 @@
1
+ export * from "../../v1/IconButton"
@@ -0,0 +1,3 @@
1
+ export type { CustomButtonProps } from "./GenericButton"
2
+ export * from "../v1/Button"
3
+ export * from "../v1/IconButton"
@@ -0,0 +1,104 @@
1
+ .button {
2
+ --button-min-height-width: var(--spacing-48);
3
+ --button-padding-x: calc(
4
+ #{var(--spacing-12)} - #{var(--border-solid-border-width)}
5
+ );
6
+ --button-padding-y: calc(
7
+ #{var(--spacing-8)} - #{var(--border-solid-border-width)}
8
+ );
9
+ --button-icon-size: var(--spacing-24);
10
+
11
+ // RESET
12
+ appearance: none;
13
+ background: transparent;
14
+ color: inherit;
15
+ font: inherit;
16
+ margin: 0;
17
+ border: none;
18
+ // RESET
19
+ border: var(--border-solid-border-width) var(--border-solid-border-style);
20
+ border-radius: var(--border-solid-border-radius);
21
+ box-sizing: border-box;
22
+ display: inline-flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ text-align: left;
26
+ gap: var(--spacing-8);
27
+ font-family: var(--typography-button-primary-font-family);
28
+ font-weight: var(--typography-button-primary-font-weight);
29
+ font-size: var(--typography-button-primary-font-size);
30
+ line-height: var(--typography-button-primary-line-height);
31
+ min-height: var(--button-min-height-width);
32
+ min-width: var(--button-min-height-width);
33
+ outline: none;
34
+ position: relative;
35
+ padding: var(--button-padding-y) var(--button-padding-x);
36
+ -webkit-font-smoothing: antialiased;
37
+ -moz-osx-font-smoothing: grayscale;
38
+
39
+ &[data-focus-visible]::after {
40
+ content: "";
41
+ position: absolute;
42
+ background: transparent;
43
+ border-color: var(--color-blue-500);
44
+ border-radius: var(--border-focus-ring-border-radius);
45
+ border-width: var(--border-focus-ring-border-width);
46
+ border-style: var(--border-focus-ring-border-style);
47
+ inset: calc(-1 * ((#{var(--border-focus-ring-border-width)} * 2) + 1px));
48
+ }
49
+
50
+ svg {
51
+ height: var(--button-icon-size);
52
+ width: var(--button-icon-size);
53
+ }
54
+ }
55
+
56
+ .default {
57
+ border-color: var(--color-gray-500);
58
+ color: var(--color-purple-800);
59
+
60
+ &[data-hovered],
61
+ &[data-focus-visible],
62
+ &[data-pressed] {
63
+ background-color: var(--color-gray-200);
64
+ border-color: var(--color-purple-800);
65
+ }
66
+
67
+ &[data-disabled] {
68
+ opacity: 0.3;
69
+ }
70
+
71
+ &.reversed {
72
+ background-color: transparent;
73
+ border-color: rgba(var(--color-white-rgb), 0.65);
74
+ color: var(--color-white);
75
+
76
+ &[data-hovered],
77
+ &[data-focus-visible] {
78
+ background-color: rgba(var(--color-white-rgb), 0.1);
79
+ border-color: var(--color-white);
80
+ }
81
+
82
+ &[data-focus-visible]::after {
83
+ border-color: var(--color-blue-300);
84
+ }
85
+
86
+ &[data-disabled]::after {
87
+ border-color: var(--color-gray-400);
88
+ }
89
+ }
90
+ }
91
+
92
+ .small {
93
+ // spacing-40 does not currently exist. Holding on adding this until the button rfc has been signed off
94
+ --button-min-height-width: 2.5rem;
95
+ --button-padding-x: calc(
96
+ #{var(--spacing-8)} - #{var(--border-solid-border-width)}
97
+ );
98
+ --button-padding-y: calc(
99
+ #{var(--spacing-8)} - #{var(--border-solid-border-width)}
100
+ );
101
+ --button-icon-size: var(--spacing-16);
102
+
103
+ gap: var(--spacing-8);
104
+ }
@@ -0,0 +1,44 @@
1
+ import React from "react"
2
+ import {
3
+ Button as RACButton,
4
+ ButtonProps as RACButtonProps,
5
+ } from "react-aria-components"
6
+ import { useReversedColors } from "~components/__utilities__/v3"
7
+ import { mergeClassNames } from "~utils/mergeClassNames"
8
+ import styles from "./Button.module.scss"
9
+
10
+ export type ButtonVariants = "default"
11
+
12
+ export type ButtonProps = RACButtonProps & {
13
+ /** The visual style of the button.
14
+ * @default "default" */
15
+ variant?: ButtonVariants
16
+ /** The visual size of the button. `medium` was formerly `regular`
17
+ * @default "medium" */
18
+ size?: "small" | "medium"
19
+ }
20
+
21
+ export const Button = ({
22
+ variant = "default",
23
+ className,
24
+ size = "medium",
25
+ children,
26
+ ...otherProps
27
+ }: ButtonProps): JSX.Element => {
28
+ const isReversed = useReversedColors()
29
+
30
+ return (
31
+ <RACButton
32
+ className={mergeClassNames(
33
+ styles.button,
34
+ styles[variant],
35
+ styles[size],
36
+ isReversed && styles.reversed,
37
+ className
38
+ )}
39
+ {...otherProps}
40
+ >
41
+ {children}
42
+ </RACButton>
43
+ )
44
+ }
@@ -0,0 +1,173 @@
1
+ import { Canvas, Meta, Controls } from "@storybook/blocks"
2
+ import { ResourceLinks, SbContent, KAIOInstallation } from "~storybook/components"
3
+ import * as docsStories from "./Button.docs.stories"
4
+ import * as exampleStories from "./Button.stories"
5
+
6
+ <Meta title="Actions/Button/v3/API specification" />
7
+
8
+ <SbContent>
9
+ # Button API Specification (v3)
10
+
11
+
12
+ Updated July 15, 2024
13
+ </SbContent>
14
+
15
+ <ResourceLinks
16
+ sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__actions__/Button/v3"
17
+ figma="https://www.figma.com/design/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-Heart-UI-Kit?m=auto&t=a6VcoKBJx6snn0ut-1"
18
+ ariaComponentPage="https://react-spectrum.adobe.com/react-aria/Button.html"
19
+ designGuidelines="/?path=/docs/actions-button-v3-usage-guidelines--docs"
20
+ />
21
+
22
+ <SbContent className="mb-24">
23
+ <div className="bg-yellow-100 border-default border-yellow-400 rounded px-24">
24
+ ### Disclaimer
25
+
26
+ The `v3` of `Button` is a partial rebuild to support [Menu v3](/docs/actions-menu-v3-api-specification--docs). As the changes to the API between `v1/v2` to `v3` is significant, our recommendation is to hold on adopting this outside of `Menu` `v3` as it will have a limited set of options.
27
+ </div>
28
+ </SbContent>
29
+
30
+ <SbContent>
31
+ <KAIOInstallation exportNames={["Tooltip", "TooltipTrigger" ]} family="actions" version="3" />
32
+
33
+
34
+ ## Overview
35
+
36
+ </SbContent>
37
+
38
+ <Canvas of={exampleStories.Playground} />
39
+
40
+ <SbContent className="mb-64">
41
+ ### React Aria
42
+
43
+ This component is built using the react-aria-components library and extends the [Button](https://react-spectrum.adobe.com/react-aria/Button.html) component.
44
+
45
+ As this shares the same core [anatomy](https://react-spectrum.adobe.com/react-aria/Button.html#anatomy), [props types](https://react-spectrum.adobe.com/react-aria/Button.html#anatomy) and [event handlers](https://react-spectrum.adobe.com/react-aria/Button.html#events), the guidance below is tailored to our implementation and should cover most known use cases of the Button.
46
+
47
+ For more scenarios that may not be present below, we recommend checkout out React Aria&apos;s documentation on the [Button's available hooks](https://react-spectrum.adobe.com/react-aria/Button.html#hooks) or [advanced customization](https://react-spectrum.adobe.com/react-aria/Button.html#advanced-customization) options.
48
+ </SbContent>
49
+
50
+ <SbContent>
51
+ ## API
52
+ </SbContent>
53
+
54
+
55
+ <Controls of={exampleStories.Playground} className="mb-64" />
56
+
57
+ <SbContent className="mb-64">
58
+ ### onPress vs onClick
59
+
60
+ One key change to the `Button`&apos;s API is the shift from `onClick` to `onPress`. This will not require a change to the implementation of `onClick` logic, ie:
61
+ ```
62
+ <Button label="Submit" onClick={(e) => sumbit(e)}/>
63
+ // can safely be migrated to:
64
+ <Button onPress={(e) => submit(e)}>
65
+ Submit
66
+ </Button>
67
+ ```
68
+
69
+ React Aria&apos;s implementation of `onPress` provides better support for consistent touch events across device types, such mobile, desktop and tablet. You can read more about the development and reason behind this pattern [here](https://react-spectrum.adobe.com/blog/building-a-button-part-1.html#touch-interactions).
70
+ </SbContent>
71
+
72
+ <SbContent>
73
+
74
+ ### Interactive states and styling pseudo-classes
75
+
76
+ Psuedo classes, such as `hover`, `focus` or `focus-visible`, are now targeted and styled with HTML data attributes that reflect the internal state of the React Aria Button (ie: `isHovered`, `isFocusVisible`).
77
+
78
+ When styling in CSS, it is recommended to use [data attributes](https://react-spectrum.adobe.com/react-aria/Button.html#styling), such as `:[data-hovered]` or `:[data-focus-visible]`, instead of using pseudo selectors like `:hover` or `:focus-visible`.
79
+
80
+ ```css
81
+ .button {
82
+ background-color: $color-white;
83
+ &:hover {
84
+ background-color: $color-gray-200;
85
+ }
86
+ }
87
+ // becomes
88
+ .button {
89
+ background-color: $color-white;
90
+ &:[data-hovered] {
91
+ background-color: $color-gray-200;
92
+ }
93
+ }
94
+ ```
95
+
96
+ #### Dynamic styles with ButtonRenderProps
97
+
98
+ As `Button` extends React Aria&apos;s functionality, `className` can now accept either a `string` or function that receives the `Button`&apos;s state for styling, such as `isPressed` or `isHovered`. This useful for add dynamic styling tweaks with Tailwind or other CSS-in-JS libraries.
99
+ </SbContent>
100
+
101
+ <Canvas of={docsStories.ButtonClassModifierWithRenderProps} sourceState="shown" />
102
+
103
+ <SbContent className="mb-64">
104
+ This can also be styled in directly with Tailwind targeting the data attributes, ie:
105
+
106
+ ```tsx
107
+ <Button className="[&[data-focused='true']]:bg-blue-300">Label</Button>
108
+ ```
109
+
110
+ React Aria also offers a [Tailwind plugin](https://react-spectrum.adobe.com/react-aria/styling.html#plugin) that exposes the styling states of React Aria Components into Tailwind. This can make classes and allows you to leverage intellisense when working with React Aria components, ie:
111
+
112
+ ```tsx
113
+ <Button className="pressed:bg-blue-300">Label</Button>
114
+ ```
115
+
116
+
117
+ For more on styling with React Aria and other ways to extend the `Button`&apos;s styles, we recommend checking out the [docs here](https://react-spectrum.adobe.com/react-aria/Button.html#styling).
118
+ </SbContent>
119
+
120
+ <SbContent>
121
+ ### Icons, labels and content as children
122
+
123
+ In `v3`, labels, icons and their positions are controlled by the consumer as `children`. The immediate children of `Button` are spaced using `flex-gap` to ensure `RTL` can be supported out of the box for most cases.
124
+ </ SbContent>
125
+
126
+ <Canvas of={exampleStories.ButtonWithIcon} />
127
+
128
+ <SbContent>
129
+ While the expected default is that `children` will be a `ReactNode`, it also accepts a render function that takes `ButtonRenderProps`. Similar to the className, this exposes the internal state (`isPressed`, `isHovered`, etc) of the button and can be used for conditional rendering.
130
+
131
+ ```tsx
132
+ <Button>
133
+ {({isPressed}) => (
134
+ <>
135
+ {isPressed && <PressHighlight />}
136
+ Press me
137
+ </>
138
+ )}
139
+ </Button>
140
+ ```
141
+ </ SbContent>
142
+
143
+
144
+ <SbContent>
145
+ ### Icon only buttons
146
+
147
+ To achieve the `IconButton` pattern in `v3`, we recommend passing an icon in as a the sole child. The label should be added to the icon&apos;s `aria-label` prop in the SVG Icon.
148
+ </ SbContent>
149
+
150
+ <Canvas of={exampleStories.IconButton} className="mb-32" />
151
+
152
+ <SbContent className="mb-64">
153
+ We recommend against setting the `aria-label` on the `Button` itself, and letting the accessible label be [determined by the children](https://cultureamp.atlassian.net/wiki/spaces/PA/pages/3833331831/Accessible+button+and+link+labels). You can achieve this by using visually hidden elements as children, which will create an accessible label based off the contents of the button.
154
+ </SbContent>
155
+
156
+ <SbContent className="mb-64">
157
+ ### Reversed Colors
158
+
159
+ The `Button` uses the `useReversedColors` hook and `ReversedColors` provider to control the dark and light theme.
160
+
161
+ <Canvas className="bg-purple-600 mb-24" of={exampleStories.OnReversed} />
162
+
163
+ To enable the reversed theme, you will need to the component or application in the ReversedColors provider.
164
+ </ SbContent>
165
+
166
+ <SbContent>
167
+ ### Buttons and links
168
+
169
+ `v3` of the `Button` component does not support the `href` prop. While a `Link` component will be coming to Kaizen, we recommend using the `v2` of button if a `anchor` or routing link is needed.
170
+
171
+ We do not advise passing in an `anchor` tag as a child of the `Button` as this can lead to accessibility issues.
172
+ </ SbContent>
173
+
@@ -0,0 +1,76 @@
1
+ import React from "react"
2
+ import { action } from "@storybook/addon-actions"
3
+ import { Meta, StoryObj } from "@storybook/react"
4
+ import { ChevronDownIcon, ChevronUpIcon } from "~components/Icon"
5
+ import { Button } from "../index"
6
+
7
+ const meta = {
8
+ title: "Actions/Button/v3/Doc Assets",
9
+ component: Button,
10
+ args: {
11
+ children: "Label",
12
+ onPress: action("Button onPress event"),
13
+ },
14
+ } satisfies Meta<typeof Button>
15
+
16
+ export default meta
17
+
18
+ type Story = StoryObj<typeof meta>
19
+
20
+ export const ButtonClassModifierWithRenderProps: Story = {
21
+ render: ({ children, ...otherArgs }) => (
22
+ <Button
23
+ {...otherArgs}
24
+ className={({ isPressed }) => (isPressed ? "!bg-gray-300" : "")}
25
+ >
26
+ {children}
27
+ </Button>
28
+ ),
29
+ parameters: {
30
+ docs: {
31
+ source: {
32
+ code: `
33
+ <Button
34
+ {...otherArgs}
35
+ className={({ isPressed }) => (isPressed ? "!bg-gray-300" : "")}
36
+ >
37
+ {children}
38
+ </Button>
39
+ `,
40
+ },
41
+ },
42
+ },
43
+ }
44
+
45
+ export const ButtonContentWithRenderProps: Story = {
46
+ render: ({ children, ...otherArgs }) => (
47
+ <Button {...otherArgs}>
48
+ {({ isPressed }) => (
49
+ <>
50
+ {children}
51
+ {isPressed ? (
52
+ <ChevronDownIcon role="presentation" />
53
+ ) : (
54
+ <ChevronUpIcon role="presentation" />
55
+ )}
56
+ </>
57
+ )}
58
+ </Button>
59
+ ),
60
+ parameters: {
61
+ docs: {
62
+ source: {
63
+ code: `
64
+ <Button {...otherArgs}>
65
+ {({isPressed}) => (
66
+ <>
67
+ {children}
68
+ {isPressed ? <ChevronDownIcon role="presentation" /> : <ChevronUpIcon role="presentation" />}
69
+ </>
70
+ )}
71
+ </Button>
72
+ `,
73
+ },
74
+ },
75
+ },
76
+ }
@@ -0,0 +1,41 @@
1
+ import { Canvas, Meta, Controls } from "@storybook/blocks"
2
+ import { ResourceLinks, SbContent, Installation } from "~storybook/components"
3
+ import * as Button from "./Button.stories"
4
+
5
+ <Meta title="Actions/Button/v3/Usage Guidelines" />
6
+
7
+ <SbContent>
8
+ # Button (v3)
9
+
10
+ Updated July 12, 2024
11
+ </SbContent>
12
+
13
+ <ResourceLinks
14
+ sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__actions__/Button/v3"
15
+ figma="https://www.figma.com/design/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-Heart-UI-Kit?m=auto&t=a6VcoKBJx6snn0ut-1"
16
+ ariaComponentPage="https://react-spectrum.adobe.com/react-aria/Menu.html"
17
+ apiSpecification="/?path=/docs/actions-button-v3-api-specification--docs"
18
+ />
19
+
20
+ <SbContent className="mb-24">
21
+ <div className="bg-yellow-100 border-default border-yellow-400 rounded px-24">
22
+ ### Disclaimer
23
+
24
+ The `v3` of `Button` is a partial rebuild to support [Menu v3](/docs/actions-menu-v3-api-specification--docs). As the changes to the API between `v1/v2` to `v3` is significant, our recommendation is to hold on adopting this outside of `Menu` `v3` as it will have a limited set of options.
25
+ </div>
26
+ </SbContent>
27
+
28
+ <SbContent>
29
+ <Installation
30
+ installCommand="pnpm add @kaizen/components"
31
+ importStatement='import { Button } from "@kaizen/components/v3/actions"'
32
+ />
33
+
34
+ ## Overview
35
+
36
+ This is the rebuild of the Button component - the main changes present in `v3` will relate to an updated API. More guidance will be provided following the completion of the Button RFC.
37
+ </SbContent>
38
+
39
+ <Canvas of={Button.Playground} />
40
+ <Controls of={Button.Playground} include={["children", "variant", "isDisabled"]} className="mb-64" />
41
+