@kaizen/components 1.55.2 → 1.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) 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/__actions__/Menu/v1/subcomponents/MenuItem/MenuItem.module.scss.cjs +12 -0
  32. package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.module.scss.cjs +1 -1
  33. package/dist/cjs/__actions__/Menu/v1/subcomponents/StatelessMenu/StatelessMenu.module.scss.cjs +6 -0
  34. package/dist/cjs/__actions__/Menu/v3/Menu.cjs +26 -0
  35. package/dist/cjs/__actions__/Menu/v3/Menu.module.scss.cjs +6 -0
  36. package/dist/cjs/__actions__/Menu/v3/MenuItem.cjs +30 -0
  37. package/dist/cjs/__actions__/Menu/v3/MenuItem.module.scss.cjs +7 -0
  38. package/dist/cjs/__actions__/Menu/v3/MenuTrigger.cjs +19 -0
  39. package/dist/cjs/actionsV1.cjs +12 -0
  40. package/dist/cjs/actionsV2.cjs +18 -0
  41. package/dist/cjs/actionsV3.cjs +10 -0
  42. package/dist/cjs/index.cjs +10 -14
  43. package/dist/esm/BrandMoment/BrandMoment.mjs +1 -2
  44. package/dist/esm/Collapsible/Collapsible/Collapsible.mjs +1 -2
  45. package/dist/esm/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.mjs +4 -7
  46. package/dist/esm/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.mjs +1 -2
  47. package/dist/esm/Filter/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.mjs +1 -1
  48. package/dist/esm/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.mjs +1 -2
  49. package/dist/esm/GuidanceBlock/GuidanceBlock.mjs +1 -2
  50. package/dist/esm/Icon/subcomponents/SVG/SVG.mjs +3 -2
  51. package/dist/esm/Illustration/subcomponents/VideoPlayer/VideoPlayer.mjs +1 -2
  52. package/dist/esm/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.mjs +1 -2
  53. package/dist/esm/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.mjs +1 -2
  54. package/dist/esm/Pagination/subcomponents/DirectionalLink/DirectionalLink.mjs +1 -1
  55. package/dist/esm/Pagination/subcomponents/PaginationLink/PaginationLink.mjs +1 -1
  56. package/dist/esm/RichTextEditor/utils/core/createRichTextEditor.mjs +2 -1
  57. package/dist/esm/SplitButton/SplitButton.mjs +1 -5
  58. package/dist/esm/Tile/subcomponents/GenericTile/Action.mjs +1 -2
  59. package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +1 -2
  60. package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +1 -2
  61. package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs +4 -7
  62. package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs +3 -5
  63. package/dist/esm/TitleBlockZen/subcomponents/SecondaryActions.mjs +4 -7
  64. package/dist/esm/TitleBlockZen/subcomponents/TitleBlockMenuItem.mjs +1 -5
  65. package/dist/esm/{Button → __actions__/Button/v1}/GenericButton/GenericButton.mjs +6 -6
  66. package/dist/esm/__actions__/Button/v1/GenericButton/GenericButton.module.scss.mjs +26 -0
  67. package/dist/esm/__actions__/Button/v3/Button.mjs +20 -0
  68. package/dist/esm/__actions__/Button/v3/Button.module.scss.mjs +7 -0
  69. package/dist/esm/__actions__/Menu/v1/index.mjs +14 -0
  70. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuDropdown/MenuDropdown.module.scss.mjs +5 -0
  71. package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.mjs +1 -1
  72. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuHeading/MenuHeading.module.scss.mjs +4 -0
  73. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuItem/MenuItem.module.scss.mjs +10 -0
  74. package/dist/esm/__actions__/Menu/v1/subcomponents/MenuList/MenuList.module.scss.mjs +4 -0
  75. package/dist/esm/__actions__/Menu/v1/subcomponents/StatelessMenu/StatelessMenu.module.scss.mjs +4 -0
  76. package/dist/esm/__actions__/Menu/v3/Menu.mjs +18 -0
  77. package/dist/esm/__actions__/Menu/v3/Menu.module.scss.mjs +4 -0
  78. package/dist/esm/__actions__/Menu/v3/MenuItem.mjs +22 -0
  79. package/dist/esm/__actions__/Menu/v3/MenuItem.module.scss.mjs +5 -0
  80. package/dist/esm/__actions__/Menu/v3/MenuTrigger.mjs +11 -0
  81. package/dist/esm/actionsV1.mjs +3 -0
  82. package/dist/esm/actionsV2.mjs +8 -0
  83. package/dist/esm/actionsV3.mjs +4 -0
  84. package/dist/esm/index.mjs +3 -7
  85. package/dist/styles.css +12 -9
  86. package/dist/types/BrandMoment/BrandMoment.d.ts +1 -1
  87. package/dist/types/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.d.ts +1 -1
  88. package/dist/types/GuidanceBlock/GuidanceBlock.d.ts +1 -1
  89. package/dist/types/Icon/subcomponents/SVG/SVG.d.ts +2 -1
  90. package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +1 -1
  91. package/dist/types/Pagination/subcomponents/DirectionalLink/DirectionalLink.d.ts +1 -1
  92. package/dist/types/Pagination/subcomponents/PaginationLink/PaginationLink.d.ts +1 -1
  93. package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +1 -1
  94. package/dist/types/TitleBlockZen/subcomponents/MobileActions.d.ts +1 -1
  95. package/dist/types/TitleBlockZen/subcomponents/Toolbar.d.ts +1 -2
  96. package/dist/types/TitleBlockZen/types.d.ts +1 -2
  97. package/dist/types/__actions__/Button/v2/Button/index.d.ts +1 -0
  98. package/dist/types/__actions__/Button/v2/GenericButton/index.d.ts +1 -0
  99. package/dist/types/__actions__/Button/v2/IconButton/index.d.ts +1 -0
  100. package/dist/types/__actions__/Button/v2/index.d.ts +3 -0
  101. package/dist/types/__actions__/Button/v3/Button.d.ts +11 -0
  102. package/dist/types/__actions__/Button/v3/index.d.ts +1 -0
  103. package/dist/types/{Menu → __actions__/Menu/v1}/Menu.d.ts +1 -1
  104. package/dist/types/__actions__/Menu/v1/index.d.ts +30 -0
  105. package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/MenuHeading.d.ts +1 -1
  106. package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.d.ts +1 -1
  107. package/dist/types/__actions__/Menu/v2/index.d.ts +6 -0
  108. package/dist/types/__actions__/Menu/v3/Menu.d.ts +7 -0
  109. package/dist/types/__actions__/Menu/v3/MenuItem.d.ts +17 -0
  110. package/dist/types/__actions__/Menu/v3/MenuTrigger.d.ts +6 -0
  111. package/dist/types/__actions__/Menu/v3/SubmenuTrigger.d.ts +8 -0
  112. package/dist/types/__actions__/Menu/v3/index.d.ts +3 -0
  113. package/dist/types/__actions__/v1.d.ts +2 -0
  114. package/dist/types/__actions__/v2.d.ts +2 -0
  115. package/dist/types/__actions__/v3.d.ts +2 -0
  116. package/dist/types/index.d.ts +2 -2
  117. package/package.json +29 -29
  118. package/src/BrandMoment/BrandMoment.tsx +1 -1
  119. package/src/BrandMoment/_docs/ExampleHeaders.tsx +1 -1
  120. package/src/Collapsible/Collapsible/Collapsible.tsx +1 -1
  121. package/src/DatePicker/_docs/DatePicker.stories.tsx +1 -1
  122. package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +1 -1
  123. package/src/EmptyState/_docs/EmptyState.stories.tsx +1 -1
  124. package/src/ErrorPage/ErrorPage.spec.tsx +142 -0
  125. package/src/ErrorPage/_docs/ErrorPage.stickersheet.stories.tsx +8 -26
  126. package/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx +1 -2
  127. package/src/Filter/FilterBar/subcomponents/ClearAllButton/ClearAllButton.tsx +1 -1
  128. package/src/Filter/FilterMultiSelect/subcomponents/LoadMoreButton/LoadMoreButton.tsx +1 -1
  129. package/src/GuidanceBlock/GuidanceBlock.tsx +1 -1
  130. package/src/Icon/subcomponents/SVG/SVG.tsx +4 -1
  131. package/src/Illustration/subcomponents/VideoPlayer/VideoPlayer.tsx +1 -1
  132. package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +1 -1
  133. package/src/Modal/ContextModal/ContextModal.tsx +1 -1
  134. package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +1 -1
  135. package/src/Modal/GenericModal/subcomponents/ModalHeader/ModalHeader.tsx +1 -1
  136. package/src/Modal/InputEditModal/InputEditModal.tsx +1 -1
  137. package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +1 -1
  138. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.module.scss +2 -2
  139. package/src/Pagination/subcomponents/DirectionalLink/DirectionalLink.tsx +4 -1
  140. package/src/Pagination/subcomponents/PaginationLink/PaginationLink.module.scss +2 -2
  141. package/src/Pagination/subcomponents/PaginationLink/PaginationLink.tsx +4 -1
  142. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stories.tsx +1 -1
  143. package/src/RichTextEditor/utils/core/createRichTextEditor.ts +3 -1
  144. package/src/SplitButton/SplitButton.spec.tsx +1 -1
  145. package/src/SplitButton/SplitButton.tsx +1 -1
  146. package/src/SplitButton/_docs/SplitButton.stickersheet.stories.tsx +1 -1
  147. package/src/SplitButton/_docs/SplitButton.stories.tsx +1 -1
  148. package/src/Tabs/_docs/Tabs.stories.tsx +1 -1
  149. package/src/Tile/subcomponents/GenericTile/Action.tsx +1 -1
  150. package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +2 -2
  151. package/src/TitleBlockZen/TitleBlockZen.tsx +1 -1
  152. package/src/TitleBlockZen/subcomponents/MainActions.tsx +1 -2
  153. package/src/TitleBlockZen/subcomponents/MobileActions.tsx +6 -2
  154. package/src/TitleBlockZen/subcomponents/SecondaryActions.tsx +1 -2
  155. package/src/TitleBlockZen/subcomponents/TitleBlockMenuItem.tsx +1 -1
  156. package/src/TitleBlockZen/subcomponents/Toolbar.tsx +1 -2
  157. package/src/TitleBlockZen/types.ts +5 -2
  158. package/src/Workflow/_docs/Workflow.stories.tsx +1 -1
  159. package/src/Workflow/_docs/WorkflowFooter.stories.tsx +1 -1
  160. package/src/Workflow/_docs/WorkflowHeader.stories.tsx +1 -1
  161. package/src/Workflow/_docs/controls/controls.tsx +1 -1
  162. package/src/{Button → __actions__/Button/v1}/Button/Button.module.scss +1 -1
  163. package/src/{Button → __actions__/Button/v1}/Button/_docs/Button.mdx +2 -2
  164. package/src/{Button → __actions__/Button/v1}/Button/_docs/Button.stickersheet.stories.tsx +1 -1
  165. package/src/{Button → __actions__/Button/v1}/Button/_docs/Button.stories.tsx +1 -1
  166. package/src/{Button → __actions__/Button/v1}/GenericButton/GenericButton.module.scss +2 -2
  167. package/src/{Button → __actions__/Button/v1}/IconButton/_docs/IconButton.mdx +2 -2
  168. package/src/{Button → __actions__/Button/v1}/IconButton/_docs/IconButton.stickersheet.stories.tsx +2 -2
  169. package/src/{Button → __actions__/Button/v1}/IconButton/_docs/IconButton.stories.tsx +1 -1
  170. package/src/{Button → __actions__/Button/v1}/utils/_variables.scss +2 -2
  171. package/src/__actions__/Button/v2/Button/_docs/Button.mdx +98 -0
  172. package/src/__actions__/Button/v2/Button/_docs/Button.stories.tsx +170 -0
  173. package/src/__actions__/Button/v2/Button/index.ts +1 -0
  174. package/src/__actions__/Button/v2/GenericButton/index.ts +1 -0
  175. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.mdx +24 -0
  176. package/src/__actions__/Button/v2/IconButton/_docs/IconButton.stories.tsx +37 -0
  177. package/src/__actions__/Button/v2/IconButton/index.ts +1 -0
  178. package/src/__actions__/Button/v2/index.ts +3 -0
  179. package/src/__actions__/Button/v3/Button.module.scss +104 -0
  180. package/src/__actions__/Button/v3/Button.tsx +44 -0
  181. package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +173 -0
  182. package/src/__actions__/Button/v3/_docs/Button.docs.stories.tsx +76 -0
  183. package/src/__actions__/Button/v3/_docs/Button.mdx +41 -0
  184. package/src/__actions__/Button/v3/_docs/Button.spec.stories.tsx +193 -0
  185. package/src/__actions__/Button/v3/_docs/Button.stickersheet.stories.tsx +135 -0
  186. package/src/__actions__/Button/v3/_docs/Button.stories.tsx +98 -0
  187. package/src/__actions__/Button/v3/index.ts +1 -0
  188. package/src/{Menu → __actions__/Menu/v1}/Menu.spec.tsx +1 -1
  189. package/src/{Menu → __actions__/Menu/v1}/Menu.tsx +1 -1
  190. package/src/__actions__/Menu/v1/_docs/Menu.mdx +29 -0
  191. package/src/{Menu → __actions__/Menu/v1}/_docs/Menu.stickersheet.stories.tsx +2 -2
  192. package/src/{Menu → __actions__/Menu/v1}/_docs/Menu.stories.tsx +2 -2
  193. package/src/{Menu → __actions__/Menu/v1}/_docs/examples.tsx +1 -1
  194. package/src/__actions__/Menu/v1/index.ts +35 -0
  195. package/src/{Menu → __actions__/Menu/v2}/_docs/Menu.mdx +2 -2
  196. package/src/__actions__/Menu/v2/_docs/Menu.stories.tsx +54 -0
  197. package/src/__actions__/Menu/v2/index.ts +6 -0
  198. package/src/__actions__/Menu/v3/Menu.module.scss +32 -0
  199. package/src/__actions__/Menu/v3/Menu.tsx +28 -0
  200. package/src/__actions__/Menu/v3/MenuItem.module.scss +34 -0
  201. package/src/__actions__/Menu/v3/MenuItem.tsx +32 -0
  202. package/src/__actions__/Menu/v3/MenuTrigger.tsx +14 -0
  203. package/src/__actions__/Menu/v3/SubmenuTrigger.tsx +18 -0
  204. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +98 -0
  205. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +280 -0
  206. package/src/__actions__/Menu/v3/_docs/Menu.mdx +202 -0
  207. package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +269 -0
  208. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +69 -0
  209. package/src/__actions__/Menu/v3/index.ts +3 -0
  210. package/src/__actions__/v1.ts +2 -0
  211. package/src/__actions__/v2.ts +2 -0
  212. package/src/__actions__/v3.ts +2 -0
  213. package/src/__future__/Workflow/_docs/Workflow.stories.tsx +1 -1
  214. package/src/__future__/Workflow/_docs/WorkflowFooter.stories.tsx +1 -1
  215. package/src/__future__/Workflow/_docs/WorkflowHeader.stories.tsx +1 -1
  216. package/src/__future__/Workflow/_docs/controls/controls.tsx +1 -1
  217. package/src/__overlays__/Tooltip/v1/Tooltip.spec.tsx +1 -1
  218. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stickersheet.stories.tsx +1 -1
  219. package/src/__overlays__/Tooltip/v1/_docs/Tooltip.stories.tsx +1 -1
  220. package/src/__overlays__/Tooltip/v1/utils/isSemanticElement.spec.tsx +1 -1
  221. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.docs.stories.tsx +1 -1
  222. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.spec.stories.tsx +1 -1
  223. package/src/__overlays__/Tooltip/v3/_docs/Tooltip.stories.tsx +1 -1
  224. package/src/index.ts +2 -2
  225. package/v1/actions/package.json +5 -0
  226. package/v2/actions/package.json +5 -0
  227. package/v3/actions/package.json +5 -0
  228. package/v3/utilities/package.json +5 -0
  229. package/dist/cjs/Button/GenericButton/GenericButton.module.scss.cjs +0 -28
  230. package/dist/cjs/Menu/subcomponents/MenuDropdown/MenuDropdown.module.scss.cjs +0 -7
  231. package/dist/cjs/Menu/subcomponents/MenuItem/MenuItem.module.scss.cjs +0 -12
  232. package/dist/cjs/Menu/subcomponents/StatelessMenu/StatelessMenu.module.scss.cjs +0 -6
  233. package/dist/esm/Button/GenericButton/GenericButton.module.scss.mjs +0 -26
  234. package/dist/esm/Menu/subcomponents/MenuDropdown/MenuDropdown.module.scss.mjs +0 -5
  235. package/dist/esm/Menu/subcomponents/MenuHeading/MenuHeading.module.scss.mjs +0 -4
  236. package/dist/esm/Menu/subcomponents/MenuItem/MenuItem.module.scss.mjs +0 -10
  237. package/dist/esm/Menu/subcomponents/MenuList/MenuList.module.scss.mjs +0 -4
  238. package/dist/esm/Menu/subcomponents/StatelessMenu/StatelessMenu.module.scss.mjs +0 -4
  239. package/dist/types/Menu/index.d.ts +0 -5
  240. package/src/Menu/index.ts +0 -5
  241. /package/dist/cjs/{Button → __actions__/Button/v1}/Button/Button.cjs +0 -0
  242. /package/dist/cjs/{Button → __actions__/Button/v1}/IconButton/IconButton.cjs +0 -0
  243. /package/dist/cjs/{Menu → __actions__/Menu/v1}/Menu.cjs +0 -0
  244. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.cjs +0 -0
  245. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.cjs +0 -0
  246. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.cjs +0 -0
  247. /package/dist/cjs/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.cjs +0 -0
  248. /package/dist/esm/{Button → __actions__/Button/v1}/Button/Button.mjs +0 -0
  249. /package/dist/esm/{Button → __actions__/Button/v1}/IconButton/IconButton.mjs +0 -0
  250. /package/dist/esm/{Menu → __actions__/Menu/v1}/Menu.mjs +0 -0
  251. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.mjs +0 -0
  252. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.mjs +0 -0
  253. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.mjs +0 -0
  254. /package/dist/esm/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.mjs +0 -0
  255. /package/dist/types/{Button → __actions__/Button/v1}/Button/Button.d.ts +0 -0
  256. /package/dist/types/{Button → __actions__/Button/v1}/Button/index.d.ts +0 -0
  257. /package/dist/types/{Button → __actions__/Button/v1}/GenericButton/GenericButton.d.ts +0 -0
  258. /package/dist/types/{Button → __actions__/Button/v1}/GenericButton/index.d.ts +0 -0
  259. /package/dist/types/{Button → __actions__/Button/v1}/IconButton/IconButton.d.ts +0 -0
  260. /package/dist/types/{Button → __actions__/Button/v1}/IconButton/index.d.ts +0 -0
  261. /package/dist/types/{Button → __actions__/Button/v1}/index.d.ts +0 -0
  262. /package/dist/types/{Menu → __actions__/Menu/v1}/_docs/MenuContentExample.d.ts +0 -0
  263. /package/dist/types/{Menu → __actions__/Menu/v1}/_docs/examples.d.ts +0 -0
  264. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/MenuDropdown.d.ts +0 -0
  265. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuDropdown/index.d.ts +0 -0
  266. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuHeading/index.d.ts +0 -0
  267. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/MenuItem.d.ts +0 -0
  268. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/index.d.ts +0 -0
  269. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/index.d.ts +0 -0
  270. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.d.ts +0 -0
  271. /package/dist/types/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/index.d.ts +0 -0
  272. /package/src/{Button → __actions__/Button/v1}/Button/Button.tsx +0 -0
  273. /package/src/{Button → __actions__/Button/v1}/Button/index.ts +0 -0
  274. /package/src/{Button → __actions__/Button/v1}/GenericButton/GenericButton.spec.tsx +0 -0
  275. /package/src/{Button → __actions__/Button/v1}/GenericButton/GenericButton.tsx +0 -0
  276. /package/src/{Button → __actions__/Button/v1}/GenericButton/index.ts +0 -0
  277. /package/src/{Button → __actions__/Button/v1}/IconButton/IconButton.module.scss +0 -0
  278. /package/src/{Button → __actions__/Button/v1}/IconButton/IconButton.spec.tsx +0 -0
  279. /package/src/{Button → __actions__/Button/v1}/IconButton/IconButton.tsx +0 -0
  280. /package/src/{Button → __actions__/Button/v1}/IconButton/index.ts +0 -0
  281. /package/src/{Button → __actions__/Button/v1}/index.ts +0 -0
  282. /package/src/{Button → __actions__/Button/v1}/utils/_mixins.scss +0 -0
  283. /package/src/{Menu → __actions__/Menu/v1}/_docs/MenuContentExample.tsx +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/MenuItem.tsx +0 -0
  292. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuItem/index.ts +0 -0
  293. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.module.scss +0 -0
  294. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.spec.tsx +0 -0
  295. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/MenuList.tsx +0 -0
  296. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/MenuList/index.ts +0 -0
  297. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.module.scss +0 -0
  298. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/StatelessMenu.tsx +0 -0
  299. /package/src/{Menu → __actions__/Menu/v1}/subcomponents/StatelessMenu/index.ts +0 -0
@@ -0,0 +1,202 @@
1
+ import { Canvas, Meta, Controls } from "@storybook/blocks"
2
+ import { ResourceLinks, SbContent, Installation, DosAndDonts, DoOrDont } from "~storybook/components"
3
+ import * as MenuDocsStories from "./Menu.docs.stories"
4
+ import * as MenuStories from "./Menu.stories"
5
+
6
+ <Meta title="Actions/Menu/v3/Usage Guidelines" />
7
+
8
+ <SbContent>
9
+ # Menu (v3)
10
+
11
+ Updated July 6, 2024
12
+ </SbContent>
13
+
14
+ <ResourceLinks
15
+ sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/__actions__/Menu"
16
+ figma="https://www.figma.com/design/eZKEE5kXbEMY3lx84oz8iN/%F0%9F%92%9C-Heart-UI-Kit?m=auto&node-id=6262-0&t=I4H23jCrCJz4O2nf-1"
17
+ ariaComponentPage="https://react-spectrum.adobe.com/react-aria/Menu.html"
18
+ apiSpecification="/?path=/docs/actions-menu-v3-api-specification--docs"
19
+ />
20
+
21
+ <SbContent>
22
+ <Installation
23
+ installCommand="pnpm add @kaizen/components"
24
+ importStatement='import { MenuTrigger, Menu, MenuItem } from "@kaizen/components/v3/actions"'
25
+ />
26
+
27
+ ## Overview
28
+
29
+ A menu displays a list of actions in a popover, toggled opened with a button.
30
+ </SbContent>
31
+
32
+ <Canvas
33
+ of={MenuStories.Playground}
34
+ source={{code: `
35
+ <TooltipTrigger>
36
+ <Button>
37
+ <MeatballsIcon role="img" aria-label="Additional actions" />
38
+ </Button>
39
+ <Popover>
40
+ <Menu>
41
+ <MenuItem>Save</MenuItem>
42
+ <MenuItem>Edit</MenuItem>
43
+ <MenuItem>Delete</MenuItem>
44
+ </Menu>
45
+ </Popover>
46
+ </TooltipTrigger>
47
+ `}}
48
+ />
49
+ <Controls of={MenuStories.Playground} include={["placement", "isOpen"]} className="mb-64" />
50
+
51
+
52
+ <SbContent className="mb-64">
53
+ ### Anatomy
54
+
55
+ - A Menu is made up of:
56
+ - A trigger button
57
+ - A popover
58
+ - A list of menu items
59
+ - Menu items may be organised into sections, with a heading for each section.
60
+ - The menu trigger button, which may be any variation of a button.
61
+ </SbContent>
62
+
63
+
64
+ <SbContent className="mb-64">
65
+ ### When to use
66
+
67
+ - When you have a group of related actions for a page or item on the page.
68
+ - The actions either:
69
+ - Cause an action on the page (e.g. delete), or
70
+ - Navigate somewhere
71
+ </SbContent>
72
+
73
+ <SbContent className="mb-64">
74
+ ### When not to use
75
+
76
+ - When you want to persist a user selection.
77
+ - Use a Select/Multi-Select or Combobox/Multi-Combobox component instead.
78
+ - When you want additional elements beyond a list of menu items (e.g. a search input)
79
+ - Use a Modal, or construct your own pattern with a Popover.
80
+ - It's recommended that you avoid this because of the complexity it adds for accessibility.
81
+ - Inside a navigation bar
82
+ - Different DOM elements and behaviour is required for a dropdown menu in a navigation bar.
83
+ </SbContent>
84
+
85
+ <div className="flex flex-col mt-16 gap-40 mb-64">
86
+ <div className="flex flex-col m-0 gap-16">
87
+ <SbContent>
88
+ #### Do use a menu for an overflow of actions
89
+ Menus work well as an overflow for a list of actions on a page or section. Try to avoid using menus for a single action, favouring an inline button/link instead.
90
+
91
+ </SbContent>
92
+ <DosAndDonts>
93
+ <DoOrDont story={MenuDocsStories.ItemsDo} />
94
+ <DoOrDont story={MenuDocsStories.ItemsDont} isDont />
95
+ </DosAndDonts>
96
+ </div>
97
+ </div>
98
+
99
+ <div className="flex flex-col mt-16 gap-40 mb-64">
100
+ <div className="flex flex-col m-0 gap-16">
101
+ <SbContent>
102
+ #### Don't use Menus to persist a user selection
103
+
104
+ Menus are not intended for a list of options where a user selection persists. Use a Select/Multi-Select or Combobox/Multi-Combobox component instead.
105
+
106
+ </SbContent>
107
+ <DosAndDonts>
108
+ <DoOrDont story={MenuDocsStories.SelectionDont} isDont />
109
+ </DosAndDonts>
110
+ </div>
111
+ </div>
112
+
113
+
114
+ <div className="flex flex-col mt-16 gap-40 mb-64">
115
+ <div className="flex flex-col m-0 gap-16">
116
+ <SbContent>
117
+ #### Do use a chevron icon when using a text label
118
+ Providing this icon is an important part of visually communicating that the button triggers a menu.
119
+
120
+ </SbContent>
121
+ <DosAndDonts>
122
+ <DoOrDont story={MenuDocsStories.LabelChevronDo} />
123
+ <DoOrDont story={MenuDocsStories.LabelChevronDont} isDont />
124
+ </DosAndDonts>
125
+ </div>
126
+ </div>
127
+
128
+ <div className="flex flex-col mt-16 gap-40 mb-64">
129
+ <div className="flex flex-col m-0 gap-16">
130
+ <SbContent>
131
+ #### Do give the trigger button a concise and unique label
132
+ The label of the trigger button will be important for screen reader users to understand the purpose of the menu.
133
+
134
+ Menu button labels are often too generic and need context added. E.g. a label of &ldquo;Actions&rdquo; is too generic if you have multiple menus on a single page.
135
+
136
+ Avoid using the words &ldquo;Open/close&rdquo; or &ldquo;Menu&rdquo; in the label, both of these things are communicated to screen reader users already with ARIA properties.
137
+
138
+ The following examples show you the verbose labels. In practice you will either want to use visually hidden text (when using a text-based trigger button), or an aria-label (when using an icon-based trigger button) to create the label.
139
+ </SbContent>
140
+ <DosAndDonts>
141
+ <DoOrDont story={MenuDocsStories.LabelDo} />
142
+ <DoOrDont story={MenuDocsStories.LabelDont} isDont />
143
+ </DosAndDonts>
144
+ </div>
145
+ </div>
146
+
147
+ <div className="flex flex-col mt-16 gap-40 mb-64">
148
+ <div className="flex flex-col m-0 gap-16">
149
+ <SbContent>
150
+ #### Do use icons in menu items for common actions
151
+ Icons beside items make sense for common actions (pencil for edit, trash can for delete, etc).
152
+
153
+ Avoid using icons when:
154
+ - The action is unique and doesn't have a commonly known icon associated.
155
+ - Not all menu items will have an icon
156
+ - You will have duplicates of icons in the list
157
+
158
+ </SbContent>
159
+ <DosAndDonts>
160
+ <DoOrDont story={MenuDocsStories.ItemsDo} />
161
+ <DoOrDont story={MenuDocsStories.IconsDont} isDont />
162
+ </DosAndDonts>
163
+ </div>
164
+ </div>
165
+
166
+ <div className="flex flex-col mt-16 gap-40 mb-64">
167
+ <div className="flex flex-col m-0 gap-16">
168
+ <SbContent>
169
+ #### Don't repeat the same word in the menu item labels
170
+ Context may be useful in some cases, but avoid adding context if it will be repeated in every menu item label.
171
+ </SbContent>
172
+ <DosAndDonts>
173
+ <DoOrDont story={MenuDocsStories.MenuItemLabelsDont} isDont />
174
+ </DosAndDonts>
175
+ </div>
176
+ </div>
177
+
178
+ <div className="flex flex-col mt-16 gap-40 mb-64">
179
+ <div className="flex flex-col m-0 gap-16">
180
+ <SbContent>
181
+ #### Do use sentence case for menu items
182
+ Write menu items in sentence case unless they contain words that are branded terms.
183
+ </SbContent>
184
+ <DosAndDonts>
185
+ <DoOrDont story={MenuDocsStories.SentenceCaseDo}/>
186
+ <DoOrDont story={MenuDocsStories.SentenceCaseDont} isDont />
187
+ </DosAndDonts>
188
+ </div>
189
+ </div>
190
+
191
+ <div className="flex flex-col mt-16 gap-40 mb-64">
192
+ <div className="flex flex-col m-0 gap-16">
193
+ <SbContent>
194
+ #### Don't use elipses in menu items
195
+ Avoid using ellipses (…) in menu item names within products whenever possible. An ellipsis often implies that the action for a menu item will open in a new view, or that a user will be taken elsewhere.
196
+ </SbContent>
197
+ <DosAndDonts>
198
+ <DoOrDont story={MenuDocsStories.ElipsesDo}/>
199
+ <DoOrDont story={MenuDocsStories.ElipsesDont} isDont />
200
+ </DosAndDonts>
201
+ </div>
202
+ </div>
@@ -0,0 +1,269 @@
1
+ import React, { useState } from "react"
2
+ import { Meta, StoryObj } from "@storybook/react"
3
+ import { expect, userEvent, waitFor, within, fn } from "@storybook/test"
4
+ import isChromatic from "chromatic"
5
+ import { Popover, Header, Section } from "react-aria-components"
6
+ import {
7
+ ArrowDownIcon,
8
+ ArrowUpIcon,
9
+ BookmarkOffIcon,
10
+ CautionIcon,
11
+ EditIcon,
12
+ ExternalLinkIcon,
13
+ MeatballsIcon,
14
+ TrashIcon,
15
+ } from "~components/Icon"
16
+ import { Button } from "~components/__actions__/v3"
17
+ import { Menu, MenuItem, MenuTrigger } from "../index"
18
+
19
+ const meta = {
20
+ title: "Actions/Menu/v3/Tests",
21
+ component: MenuTrigger,
22
+ args: {
23
+ defaultOpen: isChromatic(),
24
+ children: <></>,
25
+ },
26
+ } satisfies Meta<typeof MenuTrigger>
27
+
28
+ export default meta
29
+
30
+ type Story = StoryObj<typeof meta>
31
+
32
+ export const KitchenSink: Story = {
33
+ parameters: {
34
+ chromatic: { disable: false },
35
+ },
36
+ args: {
37
+ defaultOpen: true,
38
+ },
39
+ decorators: [
40
+ Story => (
41
+ <div style={{ height: "500px" }}>
42
+ <Story />
43
+ </div>
44
+ ),
45
+ ],
46
+ render: ({ defaultOpen, ...args }) => (
47
+ <MenuTrigger defaultOpen={defaultOpen} {...args}>
48
+ <Button>
49
+ <MeatballsIcon role="img" aria-label="Additional actions" />
50
+ </Button>
51
+ <Popover>
52
+ <Menu>
53
+ <Section>
54
+ <Header>Section One</Header>
55
+ <MenuItem
56
+ icon={<BookmarkOffIcon role="presentation" />}
57
+ href="https://cultureamp.com"
58
+ >
59
+ Save
60
+ </MenuItem>
61
+ <MenuItem icon={<EditIcon role="presentation" />}>Edit</MenuItem>
62
+ </Section>
63
+ <Section>
64
+ <MenuItem icon={<ArrowUpIcon role="presentation" />}>
65
+ Move Up
66
+ </MenuItem>
67
+ <MenuItem icon={<ArrowDownIcon role="presentation" />}>
68
+ Menu item with a longer label
69
+ </MenuItem>
70
+ </Section>
71
+ <Section>
72
+ <MenuItem icon={<TrashIcon role="presentation" />}>Delete</MenuItem>
73
+ <MenuItem icon={<TrashIcon role="presentation" />} isDisabled>
74
+ Delete but disabled
75
+ </MenuItem>
76
+ <MenuItem>Other action</MenuItem>
77
+ <MenuItem>Other action</MenuItem>
78
+ <MenuItem>Other action</MenuItem>
79
+ </Section>
80
+ </Menu>
81
+ </Popover>
82
+ </MenuTrigger>
83
+ ),
84
+ }
85
+
86
+ export const Basic: Story = {
87
+ render: ({ defaultOpen, ...args }) => (
88
+ <MenuTrigger defaultOpen={defaultOpen} {...args}>
89
+ <Button>
90
+ <MeatballsIcon role="img" aria-label="Additional actions" />
91
+ </Button>
92
+ <Popover>
93
+ <Menu>
94
+ <MenuItem
95
+ icon={<CautionIcon role="presentation" />}
96
+ onAction={() => alert("Menu item pressed")}
97
+ >
98
+ Trigger an alert
99
+ </MenuItem>
100
+ <MenuItem
101
+ icon={<ExternalLinkIcon role="presentation" />}
102
+ href="https://cultureamp.com"
103
+ target="_blank"
104
+ >
105
+ Go to cultureamp.com
106
+ </MenuItem>
107
+ <MenuItem>Item 3</MenuItem>
108
+ <MenuItem>Item 4</MenuItem>
109
+ <MenuItem>Item 5</MenuItem>
110
+ </Menu>
111
+ </Popover>
112
+ </MenuTrigger>
113
+ ),
114
+ play: async ({ canvasElement, step }) => {
115
+ const canvas = within(canvasElement.parentElement!)
116
+ const menuButton = canvas.getByRole("button")
117
+
118
+ await step("Menu opens on click", async () => {
119
+ await userEvent.click(menuButton)
120
+ await waitFor(() => expect(canvas.getByRole("menu")).toBeVisible())
121
+ })
122
+
123
+ await step("Arrow keys adjust focus", async () => {
124
+ await userEvent.keyboard("[ArrowDown]")
125
+ await waitFor(() =>
126
+ expect(
127
+ canvas.getByRole("menuitem", { name: "Go to cultureamp.com" })
128
+ ).toHaveFocus()
129
+ )
130
+ })
131
+
132
+ await step("Esc closes menu", async () => {
133
+ await userEvent.keyboard("[Escape]")
134
+ await waitFor(() =>
135
+ expect(canvas.queryByRole("menu")).not.toBeInTheDocument()
136
+ )
137
+ })
138
+
139
+ await step("Menu opens on enter press", async () => {
140
+ await userEvent.keyboard("[Enter]")
141
+ await waitFor(() =>
142
+ expect(
143
+ canvas.getByRole("menuitem", { name: "Trigger an alert" })
144
+ ).toHaveFocus()
145
+ )
146
+ await userEvent.keyboard("[Escape]")
147
+ })
148
+
149
+ await step("Menu opens on arrow up/down", async () => {
150
+ await userEvent.keyboard("[ArrowDown]")
151
+ await waitFor(() =>
152
+ expect(
153
+ canvas.getByRole("menuitem", { name: "Trigger an alert" })
154
+ ).toHaveFocus()
155
+ )
156
+ await userEvent.keyboard("[Escape]")
157
+
158
+ await userEvent.keyboard("[ArrowUp]")
159
+ await waitFor(() =>
160
+ expect(canvas.getByRole("menuitem", { name: "Item 5" })).toHaveFocus()
161
+ )
162
+ })
163
+ },
164
+ }
165
+
166
+ const mockOnClick = fn()
167
+ export const DisabledItems: Story = {
168
+ render: () => (
169
+ <MenuTrigger>
170
+ <Button>
171
+ <MeatballsIcon role="img" aria-label="Additional actions" />
172
+ </Button>
173
+ <Popover>
174
+ <Menu>
175
+ <MenuItem isDisabled onAction={mockOnClick}>
176
+ Item 1
177
+ </MenuItem>
178
+ <MenuItem>Item 2</MenuItem>
179
+ <MenuItem isDisabled>Item 3</MenuItem>
180
+ <MenuItem>Item 4</MenuItem>
181
+ <MenuItem>Item 5</MenuItem>
182
+ </Menu>
183
+ </Popover>
184
+ </MenuTrigger>
185
+ ),
186
+ play: async ({ canvasElement, step }) => {
187
+ const canvas = within(canvasElement.parentElement!)
188
+ const menuButton = canvas.getByRole("button")
189
+
190
+ await step("Disabled items are unable to be focused", async () => {
191
+ await userEvent.click(menuButton)
192
+ expect(canvas.getByRole("menuitem", { name: "Item 2" })).toHaveFocus()
193
+ await userEvent.keyboard("[ArrowDown]")
194
+ await userEvent.keyboard("[ArrowDown]")
195
+ expect(canvas.getByRole("menuitem", { name: "Item 5" })).toHaveFocus()
196
+ await userEvent.keyboard("[Escape]")
197
+ })
198
+
199
+ await step("Clicking a disabled item doesn't trigger onClick", async () => {
200
+ await userEvent.click(menuButton)
201
+ await userEvent.click(canvas.getByRole("menuitem", { name: "Item 1" }))
202
+ await waitFor(() => expect(mockOnClick).not.toBeCalled())
203
+ })
204
+ },
205
+ }
206
+
207
+ export const WithSections: Story = {
208
+ render: () => (
209
+ <MenuTrigger>
210
+ <Button>
211
+ <MeatballsIcon role="img" aria-label="Additional actions" />
212
+ </Button>
213
+ <Popover>
214
+ <Menu>
215
+ <Section>
216
+ <Header>Section One</Header>
217
+ <MenuItem>Item 1</MenuItem>
218
+ <MenuItem>Item 2</MenuItem>
219
+ </Section>
220
+
221
+ <Section>
222
+ <Header>Section Two</Header>
223
+ <MenuItem>Item 3</MenuItem>
224
+ <MenuItem>Item 4</MenuItem>
225
+ <MenuItem>Item 5</MenuItem>
226
+ </Section>
227
+ </Menu>
228
+ </Popover>
229
+ </MenuTrigger>
230
+ ),
231
+ }
232
+
233
+ export const Controlled: Story = {
234
+ render: () => {
235
+ const [isOpen, setOpen] = useState<boolean>(false)
236
+ return (
237
+ <>
238
+ <button type="button" onClick={() => setOpen(!isOpen)} className="mb-6">
239
+ Toggle open
240
+ </button>
241
+ <MenuTrigger isOpen={isOpen} onOpenChange={setOpen}>
242
+ <Button>
243
+ <MeatballsIcon role="img" aria-label="Additional actions" />
244
+ </Button>
245
+ <Popover>
246
+ <Menu>
247
+ <MenuItem>Item 1</MenuItem>
248
+ <MenuItem onAction={() => setOpen(true)}>Item 2</MenuItem>
249
+ <MenuItem>Item 3</MenuItem>
250
+ <MenuItem>Item 4</MenuItem>
251
+ <MenuItem>Item 5</MenuItem>
252
+ </Menu>
253
+ </Popover>
254
+ </MenuTrigger>
255
+ </>
256
+ )
257
+ },
258
+ play: async ({ canvasElement, step }) => {
259
+ const canvas = within(canvasElement.parentElement!)
260
+ const externalButton = await canvas.findByRole("button", {
261
+ name: "Toggle open",
262
+ })
263
+
264
+ await step("Menu opens on external button click", async () => {
265
+ await userEvent.click(externalButton)
266
+ await waitFor(() => expect(canvas.getByRole("menu")).toBeVisible())
267
+ })
268
+ },
269
+ }
@@ -0,0 +1,69 @@
1
+ import React, { FunctionComponent } from "react"
2
+ import { Meta, StoryObj } from "@storybook/react"
3
+ import isChromatic from "chromatic"
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
+ import { Button } from "~components/__actions__/v3"
14
+ import { Menu, MenuTrigger, MenuItem } from "../index"
15
+ import * as testStories from "./Menu.spec.stories"
16
+
17
+ const meta = {
18
+ title: "Actions/Menu/v3",
19
+ component: MenuTrigger,
20
+ args: {
21
+ defaultOpen: isChromatic(),
22
+ children: <></>,
23
+ },
24
+ subcomponents: { Menu, MenuItem } as Record<string, FunctionComponent<any>>,
25
+ } satisfies Meta<typeof MenuTrigger>
26
+
27
+ export default meta
28
+
29
+ type Story = StoryObj<typeof meta>
30
+
31
+ export const Playground: Story = {
32
+ render: ({ defaultOpen: _, ...args }) => (
33
+ <MenuTrigger {...args}>
34
+ {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
35
+ <Button>
36
+ <MeatballsIcon role="img" aria-label="Additional actions" />
37
+ </Button>
38
+ <Popover>
39
+ <Menu>
40
+ <MenuItem icon={<BookmarkOffIcon role="presentation" />}>
41
+ Save
42
+ </MenuItem>
43
+ <MenuItem icon={<EditIcon role="presentation" />}>Edit</MenuItem>
44
+ <MenuItem icon={<ArrowUpIcon role="presentation" />}>
45
+ Move up
46
+ </MenuItem>
47
+ <MenuItem icon={<ArrowDownIcon role="presentation" />}>
48
+ Move down
49
+ </MenuItem>
50
+ <MenuItem icon={<TrashIcon role="presentation" />}>Delete</MenuItem>
51
+ </Menu>
52
+ </Popover>
53
+ </MenuTrigger>
54
+ ),
55
+ }
56
+
57
+ export const Basic: Story = { ...testStories.Basic, play: undefined }
58
+ export const DisabledItems: Story = {
59
+ ...testStories.DisabledItems,
60
+ play: undefined,
61
+ }
62
+ export const WithSections: Story = {
63
+ ...testStories.WithSections,
64
+ play: undefined,
65
+ }
66
+ export const Controlled: Story = {
67
+ ...testStories.Controlled,
68
+ play: undefined,
69
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./Menu"
2
+ export * from "./MenuItem"
3
+ export * from "./MenuTrigger"
@@ -0,0 +1,2 @@
1
+ export * from "./Menu/v1"
2
+ export * from "./Button/v1"
@@ -0,0 +1,2 @@
1
+ export * from "./Menu/v2"
2
+ export * from "./Button/v2"
@@ -0,0 +1,2 @@
1
+ export * from "./Menu/v3"
2
+ export * from "./Button/v3"
@@ -1,8 +1,8 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { Button } from "~components/Button"
4
3
  import { CloseIcon, VisibleIcon } from "~components/Icon"
5
4
  import { TextField } from "~components/TextField"
5
+ import { Button } from "~components/__actions__/v2"
6
6
  import { Workflow } from "../"
7
7
  import { WorkflowControls } from "./controls"
8
8
 
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { Button } from "~components/Button"
3
+ import { Button } from "~components/__actions__/v2"
4
4
  import { Workflow } from "../"
5
5
  import { WorkflowControls } from "./controls"
6
6
 
@@ -1,7 +1,7 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { Button } from "~components/Button"
4
3
  import { CloseIcon, VisibleIcon } from "~components/Icon"
4
+ import { Button } from "~components/__actions__/v2"
5
5
  import { Workflow } from "../"
6
6
  import { WorkflowControls } from "./controls"
7
7
 
@@ -1,7 +1,7 @@
1
1
  import React from "react"
2
2
  import { ArgTypes } from "@storybook/react"
3
- import { Button } from "~components/Button"
4
3
  import { CloseIcon, VisibleIcon } from "~components/Icon"
4
+ import { Button } from "~components/__actions__/v2"
5
5
 
6
6
  export const WorkflowControls: Partial<ArgTypes> = {
7
7
  headerActions: {
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import { render, screen, waitFor } from "@testing-library/react"
3
- import { Button } from "~components/Button"
3
+ import { Button } from "~components/__actions__/v2"
4
4
  import { Tooltip } from "./index"
5
5
 
6
6
  describe("<Tooltip />", () => {
@@ -1,8 +1,8 @@
1
1
  import React from "react"
2
2
  import { Decorator, Meta } from "@storybook/react"
3
3
  import isChromatic from "chromatic/isChromatic"
4
- import { IconButton } from "~components/Button"
5
4
  import { MeatballsIcon } from "~components/Icon"
5
+ import { IconButton } from "~components/__actions__/v2"
6
6
  import {
7
7
  StickerSheet,
8
8
  StickerSheetStory,
@@ -1,6 +1,5 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
- import { Button, IconButton } from "~components/Button"
4
3
  import { ButtonGroup } from "~components/ButtonGroup"
5
4
  import { CheckboxField } from "~components/Checkbox"
6
5
  import { FilterButtonBase } from "~components/Filter/FilterButton/subcomponents/FilterButtonBase"
@@ -12,6 +11,7 @@ import {
12
11
  TableRow,
13
12
  } from "~components/Table"
14
13
  import { Text } from "~components/Text"
14
+ import { Button, IconButton } from "~components/__actions__/v2"
15
15
  import { Tag } from "~components/__future__/Tag"
16
16
  import { Tooltip } from "../index"
17
17
 
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
- import { Button, IconButton } from "~components/Button"
3
2
  import { ArrowRightIcon } from "~components/Icon"
3
+ import { Button, IconButton } from "~components/__actions__/v2"
4
4
  import { isSemanticElement } from "./isSemanticElement"
5
5
 
6
6
  describe("isSemanticElement", () => {
@@ -1,12 +1,12 @@
1
1
  import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
3
  import isChromatic from "chromatic"
4
- import { Button, IconButton } from "~components/Button"
5
4
  import { FieldMessage } from "~components/FieldMessage"
6
5
  import { AddIcon, QuestionIcon } from "~components/Icon"
7
6
  import { Input } from "~components/Input"
8
7
  import { Label } from "~components/Label"
9
8
  import { Text } from "~components/Text"
9
+ import { Button, IconButton } from "~components/__actions__/v2"
10
10
  import { Focusable } from "~components/__overlays__/v3"
11
11
  import { Tooltip, TooltipTrigger } from "../index"
12
12
  import * as TestStories from "./Tooltip.spec.stories"
@@ -2,10 +2,10 @@ import React from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
3
  import { expect, userEvent, waitFor, within } from "@storybook/test"
4
4
  import isChromatic from "chromatic"
5
- import { Button, IconButton } from "~components/Button"
6
5
  import { AddIcon } from "~components/Icon"
7
6
  import { Tab, TabList, TabPanel, TabPanels, Tabs } from "~components/Tabs"
8
7
  import { Text } from "~components/Text"
8
+ import { Button, IconButton } from "~components/__actions__/v2"
9
9
  import { Tag } from "~components/__future__/Tag"
10
10
  import { Focusable } from "~components/__overlays__/v3"
11
11
  import { Tooltip, TooltipTrigger } from "../index"
@@ -1,7 +1,7 @@
1
1
  import React, { FunctionComponent } from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
3
  import isChromatic from "chromatic"
4
- import { Button } from "~components/Button"
4
+ import { Button } from "~components/__actions__/v2"
5
5
  import { Tag } from "~components/__future__"
6
6
  import { Focusable } from "~components/__overlays__/v3"
7
7
  import { Tooltip, TooltipTrigger } from "../index"