@mich8060/unified-design-system 0.1.10

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 (454) hide show
  1. package/LICENSE +21 -0
  2. package/README.lib.md +103 -0
  3. package/README.md +265 -0
  4. package/dist/LICENSE +21 -0
  5. package/dist/README.md +103 -0
  6. package/dist/package.json +49 -0
  7. package/dist/styles.css +20544 -0
  8. package/dist/uds-components.es.js +67031 -0
  9. package/dist/uds-components.es.js.map +1 -0
  10. package/dist/uds-components.umd.js +67048 -0
  11. package/dist/uds-components.umd.js.map +1 -0
  12. package/package.json +158 -0
  13. package/src/styles/_typography.scss +932 -0
  14. package/src/styles/_utilities.scss +3738 -0
  15. package/src/styles/_variables.scss +620 -0
  16. package/src/styles/prism-custom.css +204 -0
  17. package/src/styles/prism-custom.scss +205 -0
  18. package/src/styles/tokens.css +1463 -0
  19. package/src/styles/tokens.scss +1116 -0
  20. package/src/ui/Accordion/Accordion.ai.md +69 -0
  21. package/src/ui/Accordion/Accordion.scss +87 -0
  22. package/src/ui/Accordion/Accordion.spec.ts +25 -0
  23. package/src/ui/Accordion/Accordion.stories.tsx +46 -0
  24. package/src/ui/Accordion/Accordion.test.tsx +54 -0
  25. package/src/ui/Accordion/Accordion.tsx +73 -0
  26. package/src/ui/Accordion/Accordion.types.ts +15 -0
  27. package/src/ui/Accordion/index.js +1 -0
  28. package/src/ui/ActionMenu/ActionMenu.ai.md +106 -0
  29. package/src/ui/ActionMenu/ActionMenu.jsx +437 -0
  30. package/src/ui/ActionMenu/ActionMenu.scss +252 -0
  31. package/src/ui/ActionMenu/ActionMenu.spec.ts +12 -0
  32. package/src/ui/ActionMenu/ActionMenu.stories.jsx +14 -0
  33. package/src/ui/ActionMenu/ActionMenu.stories.tsx +124 -0
  34. package/src/ui/ActionMenu/ActionMenu.test.tsx +1 -0
  35. package/src/ui/ActionMenu/ActionMenu.tsx +6 -0
  36. package/src/ui/ActionMenu/ActionMenu.types.ts +3 -0
  37. package/src/ui/ActionMenu/index.js +1 -0
  38. package/src/ui/Avatar/Avatar.ai.md +54 -0
  39. package/src/ui/Avatar/Avatar.jsx +49 -0
  40. package/src/ui/Avatar/Avatar.scss +87 -0
  41. package/src/ui/Avatar/Avatar.spec.ts +12 -0
  42. package/src/ui/Avatar/Avatar.stories.jsx +14 -0
  43. package/src/ui/Avatar/Avatar.stories.tsx +14 -0
  44. package/src/ui/Avatar/Avatar.test.tsx +1 -0
  45. package/src/ui/Avatar/Avatar.tsx +6 -0
  46. package/src/ui/Avatar/Avatar.types.ts +3 -0
  47. package/src/ui/Avatar/index.js +1 -0
  48. package/src/ui/Badge/Badge.ai.md +37 -0
  49. package/src/ui/Badge/Badge.jsx +64 -0
  50. package/src/ui/Badge/Badge.scss +84 -0
  51. package/src/ui/Badge/Badge.spec.ts +12 -0
  52. package/src/ui/Badge/Badge.stories.jsx +14 -0
  53. package/src/ui/Badge/Badge.stories.tsx +14 -0
  54. package/src/ui/Badge/Badge.test.tsx +1 -0
  55. package/src/ui/Badge/Badge.tsx +6 -0
  56. package/src/ui/Badge/Badge.types.ts +3 -0
  57. package/src/ui/Badge/index.js +1 -0
  58. package/src/ui/Branding/Branding.ai.md +81 -0
  59. package/src/ui/Branding/Branding.jsx +127 -0
  60. package/src/ui/Branding/Branding.scss +57 -0
  61. package/src/ui/Branding/Branding.spec.ts +12 -0
  62. package/src/ui/Branding/Branding.stories.jsx +14 -0
  63. package/src/ui/Branding/Branding.stories.tsx +14 -0
  64. package/src/ui/Branding/Branding.test.tsx +1 -0
  65. package/src/ui/Branding/Branding.tsx +6 -0
  66. package/src/ui/Branding/Branding.types.ts +3 -0
  67. package/src/ui/Branding/index.js +1 -0
  68. package/src/ui/Breadcrumb/Breadcrumb.ai.md +50 -0
  69. package/src/ui/Breadcrumb/Breadcrumb.jsx +167 -0
  70. package/src/ui/Breadcrumb/Breadcrumb.scss +46 -0
  71. package/src/ui/Breadcrumb/Breadcrumb.spec.ts +12 -0
  72. package/src/ui/Breadcrumb/Breadcrumb.stories.jsx +26 -0
  73. package/src/ui/Breadcrumb/Breadcrumb.stories.tsx +14 -0
  74. package/src/ui/Breadcrumb/Breadcrumb.test.tsx +1 -0
  75. package/src/ui/Breadcrumb/Breadcrumb.tsx +6 -0
  76. package/src/ui/Breadcrumb/Breadcrumb.types.ts +3 -0
  77. package/src/ui/Breadcrumb/index.js +2 -0
  78. package/src/ui/Button/Button.ai.md +122 -0
  79. package/src/ui/Button/Button.figma.tsx +49 -0
  80. package/src/ui/Button/Button.scss +188 -0
  81. package/src/ui/Button/Button.spec.ts +52 -0
  82. package/src/ui/Button/Button.stories.tsx +199 -0
  83. package/src/ui/Button/Button.test.tsx +85 -0
  84. package/src/ui/Button/Button.tsx +131 -0
  85. package/src/ui/Button/Button.types.ts +32 -0
  86. package/src/ui/Button/index.js +1 -0
  87. package/src/ui/Calendar/Calendar.ai.md +151 -0
  88. package/src/ui/Calendar/Calendar.jsx +504 -0
  89. package/src/ui/Calendar/Calendar.scss +451 -0
  90. package/src/ui/Calendar/Calendar.spec.ts +12 -0
  91. package/src/ui/Calendar/Calendar.stories.jsx +14 -0
  92. package/src/ui/Calendar/Calendar.stories.tsx +14 -0
  93. package/src/ui/Calendar/Calendar.test.tsx +1 -0
  94. package/src/ui/Calendar/Calendar.tsx +6 -0
  95. package/src/ui/Calendar/Calendar.types.ts +3 -0
  96. package/src/ui/Calendar/index.js +1 -0
  97. package/src/ui/Card/Card.ai.md +41 -0
  98. package/src/ui/Card/Card.jsx +25 -0
  99. package/src/ui/Card/Card.scss +47 -0
  100. package/src/ui/Card/Card.spec.ts +12 -0
  101. package/src/ui/Card/Card.stories.jsx +28 -0
  102. package/src/ui/Card/Card.stories.tsx +14 -0
  103. package/src/ui/Card/Card.test.tsx +1 -0
  104. package/src/ui/Card/Card.tsx +6 -0
  105. package/src/ui/Card/Card.types.ts +3 -0
  106. package/src/ui/Card/index.js +1 -0
  107. package/src/ui/Checkbox/Checkbox.ai.md +50 -0
  108. package/src/ui/Checkbox/Checkbox.jsx +73 -0
  109. package/src/ui/Checkbox/Checkbox.scss +115 -0
  110. package/src/ui/Checkbox/Checkbox.spec.ts +12 -0
  111. package/src/ui/Checkbox/Checkbox.stories.jsx +14 -0
  112. package/src/ui/Checkbox/Checkbox.stories.tsx +14 -0
  113. package/src/ui/Checkbox/Checkbox.test.tsx +1 -0
  114. package/src/ui/Checkbox/Checkbox.tsx +6 -0
  115. package/src/ui/Checkbox/Checkbox.types.ts +3 -0
  116. package/src/ui/Checkbox/index.js +1 -0
  117. package/src/ui/Chip/Chip.ai.md +43 -0
  118. package/src/ui/Chip/Chip.jsx +102 -0
  119. package/src/ui/Chip/Chip.scss +118 -0
  120. package/src/ui/Chip/Chip.spec.ts +12 -0
  121. package/src/ui/Chip/Chip.stories.jsx +14 -0
  122. package/src/ui/Chip/Chip.stories.tsx +14 -0
  123. package/src/ui/Chip/Chip.test.tsx +1 -0
  124. package/src/ui/Chip/Chip.tsx +6 -0
  125. package/src/ui/Chip/Chip.types.ts +3 -0
  126. package/src/ui/Chip/index.js +1 -0
  127. package/src/ui/Datepicker/Datepicker.ai.md +45 -0
  128. package/src/ui/Datepicker/Datepicker.jsx +330 -0
  129. package/src/ui/Datepicker/Datepicker.scss +206 -0
  130. package/src/ui/Datepicker/Datepicker.spec.ts +12 -0
  131. package/src/ui/Datepicker/Datepicker.stories.jsx +14 -0
  132. package/src/ui/Datepicker/Datepicker.stories.tsx +14 -0
  133. package/src/ui/Datepicker/Datepicker.test.tsx +1 -0
  134. package/src/ui/Datepicker/Datepicker.tsx +6 -0
  135. package/src/ui/Datepicker/Datepicker.types.ts +3 -0
  136. package/src/ui/Datepicker/index.js +2 -0
  137. package/src/ui/Divider/Divider.ai.md +34 -0
  138. package/src/ui/Divider/Divider.jsx +89 -0
  139. package/src/ui/Divider/Divider.scss +116 -0
  140. package/src/ui/Divider/Divider.spec.ts +12 -0
  141. package/src/ui/Divider/Divider.stories.jsx +14 -0
  142. package/src/ui/Divider/Divider.stories.tsx +14 -0
  143. package/src/ui/Divider/Divider.test.tsx +1 -0
  144. package/src/ui/Divider/Divider.tsx +6 -0
  145. package/src/ui/Divider/Divider.types.ts +3 -0
  146. package/src/ui/Divider/index.js +1 -0
  147. package/src/ui/DotStatus/DotStatus.ai.md +36 -0
  148. package/src/ui/DotStatus/DotStatus.jsx +64 -0
  149. package/src/ui/DotStatus/DotStatus.scss +87 -0
  150. package/src/ui/DotStatus/DotStatus.spec.ts +12 -0
  151. package/src/ui/DotStatus/DotStatus.stories.jsx +14 -0
  152. package/src/ui/DotStatus/DotStatus.stories.tsx +14 -0
  153. package/src/ui/DotStatus/DotStatus.test.tsx +1 -0
  154. package/src/ui/DotStatus/DotStatus.tsx +6 -0
  155. package/src/ui/DotStatus/DotStatus.types.ts +3 -0
  156. package/src/ui/DotStatus/index.js +1 -0
  157. package/src/ui/Dropdown/Dropdown.ai.md +118 -0
  158. package/src/ui/Dropdown/Dropdown.scss +129 -0
  159. package/src/ui/Dropdown/Dropdown.spec.ts +54 -0
  160. package/src/ui/Dropdown/Dropdown.stories.tsx +59 -0
  161. package/src/ui/Dropdown/Dropdown.test.tsx +37 -0
  162. package/src/ui/Dropdown/Dropdown.tsx +119 -0
  163. package/src/ui/Dropdown/Dropdown.types.ts +25 -0
  164. package/src/ui/Dropdown/index.js +1 -0
  165. package/src/ui/EventCard/EventCard.ai.md +101 -0
  166. package/src/ui/EventCard/EventCard.jsx +92 -0
  167. package/src/ui/EventCard/EventCard.scss +186 -0
  168. package/src/ui/EventCard/EventCard.spec.ts +12 -0
  169. package/src/ui/EventCard/EventCard.stories.jsx +14 -0
  170. package/src/ui/EventCard/EventCard.stories.tsx +14 -0
  171. package/src/ui/EventCard/EventCard.test.tsx +1 -0
  172. package/src/ui/EventCard/EventCard.tsx +6 -0
  173. package/src/ui/EventCard/EventCard.types.ts +3 -0
  174. package/src/ui/EventCard/index.js +1 -0
  175. package/src/ui/Field/Field.ai.md +69 -0
  176. package/src/ui/Field/Field.jsx +89 -0
  177. package/src/ui/Field/Field.scss +76 -0
  178. package/src/ui/Field/Field.spec.ts +12 -0
  179. package/src/ui/Field/Field.stories.jsx +14 -0
  180. package/src/ui/Field/Field.stories.tsx +14 -0
  181. package/src/ui/Field/Field.test.tsx +1 -0
  182. package/src/ui/Field/Field.tsx +6 -0
  183. package/src/ui/Field/Field.types.ts +3 -0
  184. package/src/ui/Field/index.js +1 -0
  185. package/src/ui/FileUpload/FileUpload.ai.md +38 -0
  186. package/src/ui/FileUpload/FileUpload.figma.tsx +28 -0
  187. package/src/ui/FileUpload/FileUpload.jsx +153 -0
  188. package/src/ui/FileUpload/FileUpload.scss +78 -0
  189. package/src/ui/FileUpload/FileUpload.spec.ts +12 -0
  190. package/src/ui/FileUpload/FileUpload.stories.jsx +14 -0
  191. package/src/ui/FileUpload/FileUpload.stories.tsx +14 -0
  192. package/src/ui/FileUpload/FileUpload.test.tsx +1 -0
  193. package/src/ui/FileUpload/FileUpload.tsx +6 -0
  194. package/src/ui/FileUpload/FileUpload.types.ts +3 -0
  195. package/src/ui/FileUpload/index.js +2 -0
  196. package/src/ui/Flex/Flex.ai.md +130 -0
  197. package/src/ui/Flex/Flex.jsx +53 -0
  198. package/src/ui/Flex/Flex.scss +119 -0
  199. package/src/ui/Flex/Flex.spec.ts +12 -0
  200. package/src/ui/Flex/Flex.stories.jsx +14 -0
  201. package/src/ui/Flex/Flex.stories.tsx +14 -0
  202. package/src/ui/Flex/Flex.test.tsx +1 -0
  203. package/src/ui/Flex/Flex.tsx +6 -0
  204. package/src/ui/Flex/Flex.types.ts +3 -0
  205. package/src/ui/Flex/index.js +1 -0
  206. package/src/ui/Icon/Icon.ai.md +46 -0
  207. package/src/ui/Icon/Icon.figma.tsx +22 -0
  208. package/src/ui/Icon/Icon.jsx +47 -0
  209. package/src/ui/Icon/Icon.scss +1 -0
  210. package/src/ui/Icon/Icon.spec.ts +12 -0
  211. package/src/ui/Icon/Icon.stories.jsx +14 -0
  212. package/src/ui/Icon/Icon.stories.tsx +14 -0
  213. package/src/ui/Icon/Icon.test.tsx +1 -0
  214. package/src/ui/Icon/Icon.tsx +6 -0
  215. package/src/ui/Icon/Icon.types.ts +3 -0
  216. package/src/ui/Icon/index.js +1 -0
  217. package/src/ui/ImageAspect/ImageAspect.ai.md +37 -0
  218. package/src/ui/ImageAspect/ImageAspect.jsx +56 -0
  219. package/src/ui/ImageAspect/ImageAspect.scss +62 -0
  220. package/src/ui/ImageAspect/ImageAspect.spec.ts +12 -0
  221. package/src/ui/ImageAspect/ImageAspect.stories.jsx +14 -0
  222. package/src/ui/ImageAspect/ImageAspect.stories.tsx +14 -0
  223. package/src/ui/ImageAspect/ImageAspect.test.tsx +1 -0
  224. package/src/ui/ImageAspect/ImageAspect.tsx +6 -0
  225. package/src/ui/ImageAspect/ImageAspect.types.ts +3 -0
  226. package/src/ui/ImageAspect/index.js +1 -0
  227. package/src/ui/Input/Input.ai.md +89 -0
  228. package/src/ui/Input/Input.figma.tsx +35 -0
  229. package/src/ui/Input/Input.scss +126 -0
  230. package/src/ui/Input/Input.spec.ts +54 -0
  231. package/src/ui/Input/Input.stories.tsx +72 -0
  232. package/src/ui/Input/Input.test.tsx +70 -0
  233. package/src/ui/Input/Input.tsx +91 -0
  234. package/src/ui/Input/Input.types.ts +22 -0
  235. package/src/ui/Input/index.js +2 -0
  236. package/src/ui/Key/Key.ai.md +31 -0
  237. package/src/ui/Key/Key.jsx +37 -0
  238. package/src/ui/Key/Key.scss +31 -0
  239. package/src/ui/Key/Key.spec.ts +12 -0
  240. package/src/ui/Key/Key.stories.jsx +14 -0
  241. package/src/ui/Key/Key.stories.tsx +14 -0
  242. package/src/ui/Key/Key.test.tsx +1 -0
  243. package/src/ui/Key/Key.tsx +6 -0
  244. package/src/ui/Key/Key.types.ts +3 -0
  245. package/src/ui/Key/index.js +1 -0
  246. package/src/ui/Menu/Menu.jsx +232 -0
  247. package/src/ui/Menu/Menu.scss +370 -0
  248. package/src/ui/Menu/Menu.spec.ts +12 -0
  249. package/src/ui/Menu/Menu.stories.jsx +41 -0
  250. package/src/ui/Menu/Menu.stories.tsx +14 -0
  251. package/src/ui/Menu/Menu.test.tsx +1 -0
  252. package/src/ui/Menu/Menu.tsx +6 -0
  253. package/src/ui/Menu/Menu.types.ts +3 -0
  254. package/src/ui/Menu/index.js +1 -0
  255. package/src/ui/MicroCalendar/MicroCalendar.ai.md +35 -0
  256. package/src/ui/MicroCalendar/MicroCalendar.jsx +393 -0
  257. package/src/ui/MicroCalendar/MicroCalendar.scss +289 -0
  258. package/src/ui/MicroCalendar/MicroCalendar.spec.ts +12 -0
  259. package/src/ui/MicroCalendar/MicroCalendar.stories.jsx +14 -0
  260. package/src/ui/MicroCalendar/MicroCalendar.stories.tsx +14 -0
  261. package/src/ui/MicroCalendar/MicroCalendar.test.tsx +1 -0
  262. package/src/ui/MicroCalendar/MicroCalendar.tsx +6 -0
  263. package/src/ui/MicroCalendar/MicroCalendar.types.ts +3 -0
  264. package/src/ui/MicroCalendar/index.js +1 -0
  265. package/src/ui/Modal/Modal.ai.md +150 -0
  266. package/src/ui/Modal/Modal.jsx +173 -0
  267. package/src/ui/Modal/Modal.scss +179 -0
  268. package/src/ui/Modal/Modal.spec.ts +12 -0
  269. package/src/ui/Modal/Modal.stories.jsx +14 -0
  270. package/src/ui/Modal/Modal.stories.tsx +14 -0
  271. package/src/ui/Modal/Modal.test.tsx +1 -0
  272. package/src/ui/Modal/Modal.tsx +6 -0
  273. package/src/ui/Modal/Modal.types.ts +3 -0
  274. package/src/ui/Modal/index.js +1 -0
  275. package/src/ui/Pagination/Pagination.ai.md +30 -0
  276. package/src/ui/Pagination/Pagination.jsx +237 -0
  277. package/src/ui/Pagination/Pagination.scss +182 -0
  278. package/src/ui/Pagination/Pagination.spec.ts +12 -0
  279. package/src/ui/Pagination/Pagination.stories.jsx +14 -0
  280. package/src/ui/Pagination/Pagination.stories.tsx +14 -0
  281. package/src/ui/Pagination/Pagination.test.tsx +1 -0
  282. package/src/ui/Pagination/Pagination.tsx +6 -0
  283. package/src/ui/Pagination/Pagination.types.ts +3 -0
  284. package/src/ui/Pagination/index.js +1 -0
  285. package/src/ui/PillToggle/PillToggle.ai.md +44 -0
  286. package/src/ui/PillToggle/PillToggle.jsx +56 -0
  287. package/src/ui/PillToggle/PillToggle.scss +84 -0
  288. package/src/ui/PillToggle/PillToggle.spec.ts +12 -0
  289. package/src/ui/PillToggle/PillToggle.stories.jsx +14 -0
  290. package/src/ui/PillToggle/PillToggle.stories.tsx +14 -0
  291. package/src/ui/PillToggle/PillToggle.test.tsx +1 -0
  292. package/src/ui/PillToggle/PillToggle.tsx +6 -0
  293. package/src/ui/PillToggle/PillToggle.types.ts +3 -0
  294. package/src/ui/PillToggle/index.js +1 -0
  295. package/src/ui/Playground/Playground.ai.md +96 -0
  296. package/src/ui/Playground/Playground.jsx +524 -0
  297. package/src/ui/Playground/Playground.scss +310 -0
  298. package/src/ui/Playground/Playground.spec.ts +12 -0
  299. package/src/ui/Playground/Playground.stories.jsx +14 -0
  300. package/src/ui/Playground/Playground.stories.tsx +14 -0
  301. package/src/ui/Playground/Playground.test.tsx +1 -0
  302. package/src/ui/Playground/Playground.tsx +6 -0
  303. package/src/ui/Playground/Playground.types.ts +3 -0
  304. package/src/ui/Playground/index.js +2 -0
  305. package/src/ui/ProgressCircle/ProgressCircle.ai.md +36 -0
  306. package/src/ui/ProgressCircle/ProgressCircle.jsx +147 -0
  307. package/src/ui/ProgressCircle/ProgressCircle.scss +143 -0
  308. package/src/ui/ProgressCircle/ProgressCircle.spec.ts +12 -0
  309. package/src/ui/ProgressCircle/ProgressCircle.stories.jsx +14 -0
  310. package/src/ui/ProgressCircle/ProgressCircle.stories.tsx +14 -0
  311. package/src/ui/ProgressCircle/ProgressCircle.test.tsx +1 -0
  312. package/src/ui/ProgressCircle/ProgressCircle.tsx +6 -0
  313. package/src/ui/ProgressCircle/ProgressCircle.types.ts +3 -0
  314. package/src/ui/ProgressCircle/index.js +1 -0
  315. package/src/ui/ProgressIndicator/ProgressIndicator.ai.md +27 -0
  316. package/src/ui/ProgressIndicator/ProgressIndicator.jsx +92 -0
  317. package/src/ui/ProgressIndicator/ProgressIndicator.scss +133 -0
  318. package/src/ui/ProgressIndicator/ProgressIndicator.spec.ts +12 -0
  319. package/src/ui/ProgressIndicator/ProgressIndicator.stories.jsx +14 -0
  320. package/src/ui/ProgressIndicator/ProgressIndicator.stories.tsx +14 -0
  321. package/src/ui/ProgressIndicator/ProgressIndicator.test.tsx +1 -0
  322. package/src/ui/ProgressIndicator/ProgressIndicator.tsx +6 -0
  323. package/src/ui/ProgressIndicator/ProgressIndicator.types.ts +3 -0
  324. package/src/ui/ProgressIndicator/index.js +1 -0
  325. package/src/ui/Radio/Radio.ai.md +53 -0
  326. package/src/ui/Radio/Radio.jsx +57 -0
  327. package/src/ui/Radio/Radio.scss +89 -0
  328. package/src/ui/Radio/Radio.spec.ts +12 -0
  329. package/src/ui/Radio/Radio.stories.jsx +14 -0
  330. package/src/ui/Radio/Radio.stories.tsx +14 -0
  331. package/src/ui/Radio/Radio.test.tsx +1 -0
  332. package/src/ui/Radio/Radio.tsx +6 -0
  333. package/src/ui/Radio/Radio.types.ts +3 -0
  334. package/src/ui/Radio/index.js +1 -0
  335. package/src/ui/Slider/Slider.ai.md +33 -0
  336. package/src/ui/Slider/Slider.jsx +283 -0
  337. package/src/ui/Slider/Slider.scss +156 -0
  338. package/src/ui/Slider/Slider.spec.ts +12 -0
  339. package/src/ui/Slider/Slider.stories.jsx +14 -0
  340. package/src/ui/Slider/Slider.stories.tsx +14 -0
  341. package/src/ui/Slider/Slider.test.tsx +1 -0
  342. package/src/ui/Slider/Slider.tsx +6 -0
  343. package/src/ui/Slider/Slider.types.ts +3 -0
  344. package/src/ui/Slider/index.js +1 -0
  345. package/src/ui/Status/Status.ai.md +36 -0
  346. package/src/ui/Status/Status.jsx +66 -0
  347. package/src/ui/Status/Status.scss +90 -0
  348. package/src/ui/Status/Status.spec.ts +12 -0
  349. package/src/ui/Status/Status.stories.jsx +14 -0
  350. package/src/ui/Status/Status.stories.tsx +14 -0
  351. package/src/ui/Status/Status.test.tsx +1 -0
  352. package/src/ui/Status/Status.tsx +6 -0
  353. package/src/ui/Status/Status.types.ts +3 -0
  354. package/src/ui/Status/index.js +1 -0
  355. package/src/ui/Steps/Steps.ai.md +56 -0
  356. package/src/ui/Steps/Steps.jsx +201 -0
  357. package/src/ui/Steps/Steps.scss +240 -0
  358. package/src/ui/Steps/Steps.spec.ts +12 -0
  359. package/src/ui/Steps/Steps.stories.jsx +14 -0
  360. package/src/ui/Steps/Steps.stories.tsx +14 -0
  361. package/src/ui/Steps/Steps.test.tsx +1 -0
  362. package/src/ui/Steps/Steps.tsx +6 -0
  363. package/src/ui/Steps/Steps.types.ts +3 -0
  364. package/src/ui/Steps/index.js +1 -0
  365. package/src/ui/Table/Table.ai.md +108 -0
  366. package/src/ui/Table/Table.jsx +143 -0
  367. package/src/ui/Table/Table.scss +90 -0
  368. package/src/ui/Table/Table.spec.ts +12 -0
  369. package/src/ui/Table/Table.stories.jsx +14 -0
  370. package/src/ui/Table/Table.stories.tsx +14 -0
  371. package/src/ui/Table/Table.test.tsx +1 -0
  372. package/src/ui/Table/Table.tsx +6 -0
  373. package/src/ui/Table/Table.types.ts +3 -0
  374. package/src/ui/Table/index.js +1 -0
  375. package/src/ui/Tabs/TabItem.jsx +80 -0
  376. package/src/ui/Tabs/Tabs.ai.md +52 -0
  377. package/src/ui/Tabs/Tabs.figma.tsx +30 -0
  378. package/src/ui/Tabs/Tabs.jsx +318 -0
  379. package/src/ui/Tabs/Tabs.scss +164 -0
  380. package/src/ui/Tabs/Tabs.spec.ts +12 -0
  381. package/src/ui/Tabs/Tabs.stories.jsx +18 -0
  382. package/src/ui/Tabs/Tabs.stories.tsx +14 -0
  383. package/src/ui/Tabs/Tabs.test.tsx +1 -0
  384. package/src/ui/Tabs/Tabs.tsx +6 -0
  385. package/src/ui/Tabs/Tabs.types.ts +3 -0
  386. package/src/ui/Tabs/index.js +3 -0
  387. package/src/ui/Tag/Tag.ai.md +59 -0
  388. package/src/ui/Tag/Tag.figma.tsx +29 -0
  389. package/src/ui/Tag/Tag.jsx +93 -0
  390. package/src/ui/Tag/Tag.scss +258 -0
  391. package/src/ui/Tag/Tag.spec.ts +12 -0
  392. package/src/ui/Tag/Tag.stories.jsx +14 -0
  393. package/src/ui/Tag/Tag.stories.tsx +14 -0
  394. package/src/ui/Tag/Tag.test.tsx +1 -0
  395. package/src/ui/Tag/Tag.tsx +6 -0
  396. package/src/ui/Tag/Tag.types.ts +3 -0
  397. package/src/ui/Tag/index.js +2 -0
  398. package/src/ui/Textarea/Textarea.ai.md +40 -0
  399. package/src/ui/Textarea/Textarea.figma.tsx +35 -0
  400. package/src/ui/Textarea/Textarea.jsx +68 -0
  401. package/src/ui/Textarea/Textarea.scss +71 -0
  402. package/src/ui/Textarea/Textarea.spec.ts +12 -0
  403. package/src/ui/Textarea/Textarea.stories.jsx +14 -0
  404. package/src/ui/Textarea/Textarea.stories.tsx +14 -0
  405. package/src/ui/Textarea/Textarea.test.tsx +1 -0
  406. package/src/ui/Textarea/Textarea.tsx +6 -0
  407. package/src/ui/Textarea/Textarea.types.ts +3 -0
  408. package/src/ui/Textarea/index.js +2 -0
  409. package/src/ui/Toast/Toast.ai.md +47 -0
  410. package/src/ui/Toast/Toast.jsx +75 -0
  411. package/src/ui/Toast/Toast.scss +132 -0
  412. package/src/ui/Toast/Toast.spec.ts +12 -0
  413. package/src/ui/Toast/Toast.stories.jsx +14 -0
  414. package/src/ui/Toast/Toast.stories.tsx +14 -0
  415. package/src/ui/Toast/Toast.test.tsx +1 -0
  416. package/src/ui/Toast/Toast.tsx +6 -0
  417. package/src/ui/Toast/Toast.types.ts +3 -0
  418. package/src/ui/Toast/index.js +2 -0
  419. package/src/ui/Toggle/Toggle.ai.md +37 -0
  420. package/src/ui/Toggle/Toggle.jsx +73 -0
  421. package/src/ui/Toggle/Toggle.scss +139 -0
  422. package/src/ui/Toggle/Toggle.spec.ts +12 -0
  423. package/src/ui/Toggle/Toggle.stories.jsx +14 -0
  424. package/src/ui/Toggle/Toggle.stories.tsx +14 -0
  425. package/src/ui/Toggle/Toggle.test.tsx +1 -0
  426. package/src/ui/Toggle/Toggle.tsx +6 -0
  427. package/src/ui/Toggle/Toggle.types.ts +3 -0
  428. package/src/ui/Toggle/index.js +1 -0
  429. package/src/ui/Tooltip/Tooltip.ai.md +33 -0
  430. package/src/ui/Tooltip/Tooltip.figma.tsx +24 -0
  431. package/src/ui/Tooltip/Tooltip.jsx +125 -0
  432. package/src/ui/Tooltip/Tooltip.scss +80 -0
  433. package/src/ui/Tooltip/Tooltip.spec.ts +12 -0
  434. package/src/ui/Tooltip/Tooltip.stories.jsx +14 -0
  435. package/src/ui/Tooltip/Tooltip.stories.tsx +14 -0
  436. package/src/ui/Tooltip/Tooltip.test.tsx +1 -0
  437. package/src/ui/Tooltip/Tooltip.tsx +6 -0
  438. package/src/ui/Tooltip/Tooltip.types.ts +3 -0
  439. package/src/ui/Tooltip/index.js +2 -0
  440. package/src/ui/UDS/UDS.jsx +52 -0
  441. package/src/ui/UDS/UDS.scss +49 -0
  442. package/src/ui/UDS/UDS.spec.ts +12 -0
  443. package/src/ui/UDS/UDS.stories.jsx +22 -0
  444. package/src/ui/UDS/UDS.stories.tsx +14 -0
  445. package/src/ui/UDS/UDS.test.tsx +1 -0
  446. package/src/ui/UDS/UDS.tsx +6 -0
  447. package/src/ui/UDS/UDS.types.ts +3 -0
  448. package/src/ui/UDS/index.js +1 -0
  449. package/src/ui/_spec/createMetaFromSpec.ts +35 -0
  450. package/src/ui/_spec/createStoryArgsFromSpec.ts +8 -0
  451. package/src/ui/_spec/generated/spec-props-reference.md +55 -0
  452. package/src/ui/_spec/specStorySync.test.ts +73 -0
  453. package/src/ui/_spec/types.ts +21 -0
  454. package/src/ui/index.js +66 -0
@@ -0,0 +1,437 @@
1
+ import React, { useState, useRef, useEffect } from "react";
2
+ import Icon from "../Icon/Icon";
3
+ import Divider from "../Divider/Divider";
4
+ import Key from "../Key/Key";
5
+ import Toggle from "../Toggle/Toggle";
6
+ import "./ActionMenu.scss";
7
+
8
+ const BASE_CLASS = "uds-action-menu";
9
+
10
+ /**
11
+ * Submenu component for nested menu items
12
+ */
13
+ function Submenu({ item, onItemClick, parentRef }) {
14
+ const [isOpen, setIsOpen] = useState(false);
15
+ const submenuRef = useRef(null);
16
+ const itemRef = useRef(null);
17
+ const timeoutRef = useRef(null);
18
+
19
+ const handleMouseEnter = () => {
20
+ clearTimeout(timeoutRef.current);
21
+ setIsOpen(true);
22
+ };
23
+
24
+ const handleMouseLeave = () => {
25
+ timeoutRef.current = setTimeout(() => {
26
+ setIsOpen(false);
27
+ }, 150);
28
+ };
29
+
30
+ const handleSubmenuMouseEnter = () => {
31
+ clearTimeout(timeoutRef.current);
32
+ };
33
+
34
+ const handleSubmenuMouseLeave = () => {
35
+ timeoutRef.current = setTimeout(() => {
36
+ setIsOpen(false);
37
+ }, 150);
38
+ };
39
+
40
+ useEffect(() => {
41
+ return () => {
42
+ clearTimeout(timeoutRef.current);
43
+ };
44
+ }, []);
45
+
46
+ return (
47
+ <div
48
+ className={`${BASE_CLASS}__item-wrapper`}
49
+ onMouseEnter={handleMouseEnter}
50
+ onMouseLeave={handleMouseLeave}
51
+ ref={itemRef}
52
+ >
53
+ <button
54
+ className={`${BASE_CLASS}__item ${BASE_CLASS}__item--has-submenu ${item.disabled ? `${BASE_CLASS}__item--disabled` : ""}`}
55
+ role="menuitem"
56
+ disabled={item.disabled}
57
+ aria-haspopup="true"
58
+ aria-expanded={isOpen}
59
+ aria-label={item.label}
60
+ >
61
+ {item.icon && (
62
+ <Icon
63
+ name={item.icon}
64
+ size={16}
65
+ appearance="regular"
66
+ className={`${BASE_CLASS}__item-icon`}
67
+ />
68
+ )}
69
+ <span className={`${BASE_CLASS}__item-label`}>{item.label}</span>
70
+ <Icon
71
+ name="CaretRight"
72
+ size={12}
73
+ appearance="regular"
74
+ className={`${BASE_CLASS}__item-arrow`}
75
+ />
76
+ </button>
77
+ {isOpen && item.items && (
78
+ <div
79
+ ref={submenuRef}
80
+ className={`${BASE_CLASS}__submenu`}
81
+ role="menu"
82
+ aria-orientation="vertical"
83
+ onMouseEnter={handleSubmenuMouseEnter}
84
+ onMouseLeave={handleSubmenuMouseLeave}
85
+ >
86
+ {item.items.map((subItem, subIndex) => {
87
+ if (subItem.divider) {
88
+ return (
89
+ <div key={`divider-${subIndex}`} className={`${BASE_CLASS}__divider`}>
90
+ <Divider />
91
+ </div>
92
+ );
93
+ }
94
+
95
+ // Recursive submenu support
96
+ if (subItem.items && subItem.items.length > 0) {
97
+ return (
98
+ <Submenu
99
+ key={subItem.id || subIndex}
100
+ item={subItem}
101
+ onItemClick={onItemClick}
102
+ parentRef={submenuRef}
103
+ />
104
+ );
105
+ }
106
+
107
+ return (
108
+ <button
109
+ key={subItem.id || subIndex}
110
+ className={`${BASE_CLASS}__item ${subItem.disabled ? `${BASE_CLASS}__item--disabled` : ""} ${subItem.active ? `${BASE_CLASS}__item--active` : ""} ${subItem.destructive ? `${BASE_CLASS}__item--destructive` : ""}`}
111
+ role="menuitem"
112
+ disabled={subItem.disabled}
113
+ onClick={(e) => onItemClick(subItem, e)}
114
+ aria-label={subItem.label}
115
+ >
116
+ {subItem.icon && (
117
+ <Icon
118
+ name={subItem.icon}
119
+ size={16}
120
+ appearance="regular"
121
+ className={`${BASE_CLASS}__item-icon`}
122
+ />
123
+ )}
124
+ <span className={`${BASE_CLASS}__item-label`}>{subItem.label}</span>
125
+ {subItem.shortcut && (
126
+ <Key label={subItem.shortcut} appearance="light" className={`${BASE_CLASS}__item-shortcut`} />
127
+ )}
128
+ </button>
129
+ );
130
+ })}
131
+ </div>
132
+ )}
133
+ </div>
134
+ );
135
+ }
136
+
137
+ /**
138
+ * ActionMenu component - A dropdown menu for actions
139
+ * @param {React.ReactNode} trigger - Required trigger element (use Button component)
140
+ * @param {array} items - Array of menu items: { label, icon, onClick, disabled, destructive, divider, items (for submenus) }
141
+ * @param {string} placement - Menu placement: 'bottom-start', 'bottom-end', 'top-start', 'top-end'
142
+ * @param {boolean} fullWidth - When true, the menu matches the trigger width
143
+ * @param {boolean} disabled - Whether the menu is disabled
144
+ * @param {function} onOpenChange - Callback when open state changes: (isOpen: boolean) => void
145
+ * @param {string} className - Additional CSS classes
146
+ * @param {string} menuClassName - Additional CSS classes for the menu panel
147
+ * @param {object} props - Additional props
148
+ */
149
+ export default function ActionMenu({
150
+ trigger,
151
+ items = [],
152
+ placement = "bottom-end",
153
+ fullWidth = false,
154
+ disabled = false,
155
+ onOpenChange,
156
+ className = "",
157
+ menuClassName = "",
158
+ ...props
159
+ }) {
160
+ const [isOpen, setIsOpen] = useState(false);
161
+ const menuRef = useRef(null);
162
+ const triggerRef = useRef(null);
163
+
164
+ // Wrapper that also fires the onOpenChange callback
165
+ const updateOpen = (nextOpen) => {
166
+ setIsOpen(nextOpen);
167
+ if (onOpenChange) onOpenChange(nextOpen);
168
+ };
169
+
170
+ // Close menu when clicking outside
171
+ useEffect(() => {
172
+ const handleClickOutside = (event) => {
173
+ if (
174
+ menuRef.current &&
175
+ triggerRef.current &&
176
+ !menuRef.current.contains(event.target) &&
177
+ !triggerRef.current.contains(event.target)
178
+ ) {
179
+ updateOpen(false);
180
+ }
181
+ };
182
+
183
+ if (isOpen) {
184
+ document.addEventListener("mousedown", handleClickOutside);
185
+ document.addEventListener("keydown", handleEscape);
186
+ }
187
+
188
+ return () => {
189
+ document.removeEventListener("mousedown", handleClickOutside);
190
+ document.removeEventListener("keydown", handleEscape);
191
+ };
192
+ }, [isOpen]); // eslint-disable-line react-hooks/exhaustive-deps
193
+
194
+ // Handle keyboard navigation
195
+ useEffect(() => {
196
+ if (!isOpen) return;
197
+
198
+ const handleKeyDown = (event) => {
199
+ const menuItems = menuRef.current?.querySelectorAll(
200
+ '[role="menuitem"]:not([disabled])',
201
+ );
202
+ if (!menuItems || menuItems.length === 0) return;
203
+
204
+ const currentIndex = Array.from(menuItems).findIndex(
205
+ (item) => item === document.activeElement,
206
+ );
207
+
208
+ switch (event.key) {
209
+ case "ArrowDown":
210
+ event.preventDefault();
211
+ const nextIndex =
212
+ currentIndex < menuItems.length - 1 ? currentIndex + 1 : 0;
213
+ menuItems[nextIndex]?.focus();
214
+ break;
215
+ case "ArrowUp":
216
+ event.preventDefault();
217
+ const prevIndex =
218
+ currentIndex > 0 ? currentIndex - 1 : menuItems.length - 1;
219
+ menuItems[prevIndex]?.focus();
220
+ break;
221
+ case "Home":
222
+ event.preventDefault();
223
+ menuItems[0]?.focus();
224
+ break;
225
+ case "End":
226
+ event.preventDefault();
227
+ menuItems[menuItems.length - 1]?.focus();
228
+ break;
229
+ case "Enter":
230
+ case " ":
231
+ event.preventDefault();
232
+ if (document.activeElement) {
233
+ document.activeElement.click();
234
+ }
235
+ break;
236
+ default:
237
+ break;
238
+ }
239
+ };
240
+
241
+ document.addEventListener("keydown", handleKeyDown);
242
+ return () => {
243
+ document.removeEventListener("keydown", handleKeyDown);
244
+ };
245
+ }, [isOpen]);
246
+
247
+ const handleEscape = (event) => {
248
+ if (event.key === "Escape") {
249
+ updateOpen(false);
250
+ triggerRef.current?.focus();
251
+ }
252
+ };
253
+
254
+ const handleToggle = (e) => {
255
+ if (!disabled) {
256
+ updateOpen(!isOpen);
257
+ }
258
+ };
259
+
260
+ const handleItemClick = (item, event) => {
261
+ if (item.disabled) {
262
+ event.preventDefault();
263
+ return;
264
+ }
265
+ if (item.onClick) {
266
+ item.onClick(item, event);
267
+ }
268
+ updateOpen(false);
269
+ };
270
+
271
+ const renderTrigger = () => {
272
+ if (!trigger) {
273
+ return null;
274
+ }
275
+
276
+ // Clone the trigger element and add onClick handler
277
+ if (React.isValidElement(trigger)) {
278
+ const originalOnClick = trigger.props?.onClick;
279
+ const triggerElement = React.cloneElement(trigger, {
280
+ onClick: (e) => {
281
+ e.preventDefault();
282
+ e.stopPropagation();
283
+ // Call the trigger's original onClick if it exists
284
+ if (originalOnClick) {
285
+ originalOnClick(e);
286
+ }
287
+ // Always call our toggle handler
288
+ handleToggle(e);
289
+ },
290
+ "aria-haspopup": "true",
291
+ "aria-expanded": isOpen,
292
+ });
293
+
294
+ return (
295
+ <div ref={triggerRef}>
296
+ {triggerElement}
297
+ </div>
298
+ );
299
+ }
300
+
301
+ // Fallback for non-React elements
302
+ return (
303
+ <div ref={triggerRef} onClick={handleToggle}>
304
+ {trigger}
305
+ </div>
306
+ );
307
+ };
308
+
309
+ const getPlacementClass = () => {
310
+ const placementMap = {
311
+ "bottom-start": "bottom-start",
312
+ "bottom-end": "bottom-end",
313
+ "top-start": "top-start",
314
+ "top-end": "top-end",
315
+ "right-start": "right-start",
316
+ "right-end": "right-end",
317
+ "left-start": "left-start",
318
+ "left-end": "left-end",
319
+ };
320
+ return placementMap[placement] || "bottom-end";
321
+ };
322
+
323
+ const classNames = [
324
+ BASE_CLASS,
325
+ isOpen && `${BASE_CLASS}--open`,
326
+ fullWidth && `${BASE_CLASS}--full-width`,
327
+ disabled && `${BASE_CLASS}--disabled`,
328
+ className,
329
+ ]
330
+ .filter(Boolean)
331
+ .join(" ");
332
+
333
+ const menuClassNames = [
334
+ `${BASE_CLASS}__menu`,
335
+ `${BASE_CLASS}__menu--${getPlacementClass()}`,
336
+ fullWidth && `${BASE_CLASS}__menu--full-width`,
337
+ menuClassName,
338
+ ]
339
+ .filter(Boolean)
340
+ .join(" ");
341
+
342
+ return (
343
+ <div className={classNames} {...props}>
344
+ {renderTrigger()}
345
+ {isOpen && !disabled && (
346
+ <div
347
+ ref={menuRef}
348
+ className={menuClassNames}
349
+ role="menu"
350
+ aria-orientation="vertical"
351
+ >
352
+ {items.map((item, index) => {
353
+ if (item.divider) {
354
+ return (
355
+ <div key={`divider-${index}`} className={`${BASE_CLASS}__divider`}>
356
+ <Divider />
357
+ </div>
358
+ );
359
+ }
360
+
361
+ // Check if item has submenu
362
+ if (item.items && item.items.length > 0) {
363
+ return (
364
+ <Submenu
365
+ key={item.id || index}
366
+ item={item}
367
+ onItemClick={handleItemClick}
368
+ parentRef={menuRef}
369
+ />
370
+ );
371
+ }
372
+
373
+ // Toggle item type
374
+ if (item.type === "toggle") {
375
+ return (
376
+ <div
377
+ key={item.id || index}
378
+ className={`${BASE_CLASS}__item ${BASE_CLASS}__item--toggle ${item.disabled ? `${BASE_CLASS}__item--disabled` : ""}`}
379
+ role="menuitemcheckbox"
380
+ aria-checked={!!item.checked}
381
+ aria-label={item.label}
382
+ >
383
+ {item.icon && (
384
+ <Icon
385
+ name={item.icon}
386
+ size={16}
387
+ appearance="regular"
388
+ className={`${BASE_CLASS}__item-icon`}
389
+ />
390
+ )}
391
+ <span className={`${BASE_CLASS}__item-label`}>
392
+ {item.label}
393
+ </span>
394
+ <Toggle
395
+ checked={!!item.checked}
396
+ size="small"
397
+ disabled={item.disabled}
398
+ onChange={(checked) => {
399
+ if (item.onChange) item.onChange(checked);
400
+ }}
401
+ className={`${BASE_CLASS}__item-toggle`}
402
+ />
403
+ </div>
404
+ );
405
+ }
406
+
407
+ return (
408
+ <button
409
+ key={item.id || index}
410
+ className={`${BASE_CLASS}__item ${item.disabled ? `${BASE_CLASS}__item--disabled` : ""} ${item.active ? `${BASE_CLASS}__item--active` : ""} ${item.destructive ? `${BASE_CLASS}__item--destructive` : ""}`}
411
+ role="menuitem"
412
+ disabled={item.disabled}
413
+ onClick={(e) => handleItemClick(item, e)}
414
+ aria-label={item.label}
415
+ >
416
+ {item.icon && (
417
+ <Icon
418
+ name={item.icon}
419
+ size={16}
420
+ appearance="regular"
421
+ className={`${BASE_CLASS}__item-icon`}
422
+ />
423
+ )}
424
+ <span className={`${BASE_CLASS}__item-label`}>
425
+ {item.label}
426
+ </span>
427
+ {item.shortcut && (
428
+ <Key label={item.shortcut} appearance="light" className={`${BASE_CLASS}__item-shortcut`} />
429
+ )}
430
+ </button>
431
+ );
432
+ })}
433
+ </div>
434
+ )}
435
+ </div>
436
+ );
437
+ }
@@ -0,0 +1,252 @@
1
+ @use "../../styles/typography" as *;
2
+
3
+ .uds-action-menu {
4
+ position: relative;
5
+ display: inline-block;
6
+
7
+ &--full-width {
8
+ width: 100%;
9
+ }
10
+
11
+ &--disabled {
12
+ opacity: 0.5;
13
+ pointer-events: none;
14
+ }
15
+
16
+ &__menu {
17
+ position: absolute;
18
+ z-index: 1100; /* above sidebar (1000) */
19
+ min-width: 280px;
20
+ background: var(--uds-surface-primary);
21
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
22
+ border-radius: var(--uds-radius-8);
23
+ box-shadow: var(--uds-shadow-lg);
24
+ padding: var(--uds-spacing-4);
25
+ margin-top: var(--uds-gap-4);
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: var(--uds-gap-0);
29
+
30
+ &--bottom-start {
31
+ top: 100%;
32
+ left: 0;
33
+ margin-top: var(--uds-gap-4);
34
+ }
35
+
36
+ &--bottom-end {
37
+ top: 100%;
38
+ right: 0;
39
+ margin-top: var(--uds-gap-4);
40
+ }
41
+
42
+ &--top-start {
43
+ bottom: 100%;
44
+ left: 0;
45
+ margin-bottom: var(--uds-gap-4);
46
+ margin-top: 0;
47
+ }
48
+
49
+ &--top-end {
50
+ bottom: 100%;
51
+ right: 0;
52
+ margin-bottom: var(--uds-gap-4);
53
+ margin-top: 0;
54
+ }
55
+
56
+ &--right-start {
57
+ left: 100%;
58
+ top: 0;
59
+ margin-left: var(--uds-gap-4);
60
+ margin-top: 0;
61
+ }
62
+
63
+ &--right-end {
64
+ left: 100%;
65
+ bottom: 0;
66
+ margin-left: var(--uds-gap-4);
67
+ margin-top: 0;
68
+ }
69
+
70
+ &--left-start {
71
+ right: 100%;
72
+ top: 0;
73
+ margin-right: var(--uds-gap-4);
74
+ margin-top: 0;
75
+ }
76
+
77
+ &--left-end {
78
+ right: 100%;
79
+ bottom: 0;
80
+ margin-right: var(--uds-gap-4);
81
+ margin-top: 0;
82
+ }
83
+
84
+ &--full-width {
85
+ width: 100%;
86
+ min-width: unset;
87
+ }
88
+ }
89
+
90
+ &__item {
91
+ @include uds-body-14-medium;
92
+ display: flex;
93
+ align-items: center;
94
+ gap: var(--uds-gap-8);
95
+ padding: var(--uds-spacing-8) var(--uds-spacing-12);
96
+ border: none;
97
+ background: transparent;
98
+ color: var(--uds-text-primary);
99
+ text-align: left;
100
+ width: 100%;
101
+ border-radius: var(--uds-radius-4);
102
+ cursor: pointer;
103
+ transition:
104
+ background-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard),
105
+ color var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
106
+
107
+ &:hover:not(&--disabled) {
108
+ background-color: var(--uds-surface-tertiary);
109
+ }
110
+
111
+ &:focus {
112
+ outline: none;
113
+ background-color: var(--uds-surface-tertiary);
114
+ box-shadow: 0 0 0 var(--uds-focus-ring-width) var(--uds-focus-ring-border);
115
+ }
116
+
117
+ &--disabled {
118
+ opacity: 0.5;
119
+ cursor: not-allowed;
120
+ pointer-events: none;
121
+ }
122
+
123
+ &--active {
124
+ background-color: var(--uds-surface-brand-tertiary);
125
+ color: var(--uds-text-inverse);
126
+
127
+ .uds-action-menu__item-icon {
128
+ color: var(--uds-text-inverse);
129
+ }
130
+
131
+ .uds-action-menu__item-label {
132
+ color: var(--uds-text-inverse);
133
+ }
134
+
135
+ &:hover:not(.uds-action-menu__item--disabled) {
136
+ background-color: var(--uds-surface-brand-tertiary);
137
+ }
138
+ }
139
+
140
+ &--destructive {
141
+ color: var(--uds-system-destructive-primary);
142
+ transition: background-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard), color var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
143
+
144
+ .uds-action-menu__item-icon {
145
+ color: var(--uds-system-destructive-primary);
146
+ }
147
+
148
+ .uds-action-menu__item-label {
149
+ color: var(--uds-system-destructive-primary);
150
+ }
151
+
152
+ &:hover:not(.uds-action-menu__item--disabled) {
153
+ background-color: var(--uds-system-destructive-primary);
154
+
155
+ .uds-action-menu__item-label {
156
+ color: var(--uds-color-white);
157
+ }
158
+
159
+ .uds-action-menu__item-icon {
160
+ color: var(--uds-color-white);
161
+ }
162
+ }
163
+
164
+ &:focus {
165
+ background-color: var(--uds-system-destructive-secondary);
166
+ }
167
+ }
168
+ }
169
+
170
+ &__item-icon {
171
+ flex-shrink: 0;
172
+ color: var(--uds-text-secondary);
173
+ }
174
+
175
+ &__item-label {
176
+ flex: 1;
177
+ color: var(--uds-text-primary);
178
+ }
179
+
180
+ &__item--toggle {
181
+ cursor: default;
182
+
183
+ &:hover:not(.uds-action-menu__item--disabled) {
184
+ background-color: var(--uds-surface-tertiary);
185
+ }
186
+ }
187
+
188
+ &__item-toggle {
189
+ flex-shrink: 0;
190
+ margin-left: auto;
191
+ }
192
+
193
+ &__item-shortcut {
194
+ margin-left: auto;
195
+ padding-left: var(--uds-spacing-16);
196
+ }
197
+
198
+ &__divider {
199
+ padding: 0 var(--uds-spacing-4);
200
+ }
201
+
202
+ &__item-arrow {
203
+ flex-shrink: 0;
204
+ color: var(--uds-text-secondary);
205
+ margin-left: auto;
206
+ }
207
+
208
+ &__item--has-submenu {
209
+ position: relative;
210
+ }
211
+
212
+ &__item-wrapper {
213
+ position: relative;
214
+ }
215
+
216
+ &__submenu {
217
+ position: absolute;
218
+ left: 100%;
219
+ top: 0;
220
+ margin-left: var(--uds-spacing-4);
221
+ min-width: 200px;
222
+ background: var(--uds-surface-primary);
223
+ border: var(--uds-border-width-1) solid var(--uds-border-primary);
224
+ border-radius: var(--uds-radius-8);
225
+ box-shadow: var(--uds-shadow-lg);
226
+ padding: var(--uds-spacing-4);
227
+ display: flex;
228
+ flex-direction: column;
229
+ gap: var(--uds-gap-0);
230
+ z-index: 1100; /* above sidebar (1000) */
231
+ animation: submenu-fade-in 0.15s ease-out;
232
+
233
+ // If submenu would overflow right edge, position to left instead
234
+ &--left {
235
+ left: auto;
236
+ right: 100%;
237
+ margin-left: 0;
238
+ margin-right: var(--uds-spacing-4);
239
+ }
240
+ }
241
+
242
+ @keyframes submenu-fade-in {
243
+ from {
244
+ opacity: 0;
245
+ transform: translateX(-4px);
246
+ }
247
+ to {
248
+ opacity: 1;
249
+ transform: translateX(0);
250
+ }
251
+ }
252
+ }
@@ -0,0 +1,12 @@
1
+ export const ACTION_MENU_DEFAULTS = {
2
+ className: "",
3
+ } as const;
4
+
5
+ export const ACTION_MENU_STORY_SPEC = {
6
+ defaults: {
7
+ className: ACTION_MENU_DEFAULTS.className,
8
+ },
9
+ stories: {
10
+ default: {},
11
+ },
12
+ } as const;
@@ -0,0 +1,14 @@
1
+ import ActionMenu from "./ActionMenu";
2
+
3
+ export default {
4
+ title: "Components/ActionMenu",
5
+ component: ActionMenu,
6
+ tags: ["autodocs"],
7
+ parameters: {
8
+ layout: "padded",
9
+ },
10
+ };
11
+
12
+ export const Default = {
13
+ args: {},
14
+ };