@heymantle/litho 0.0.14 → 0.0.16

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 (381) hide show
  1. package/AI_COMPONENTS_GUIDE.md +28 -15
  2. package/AI_INTEGRATION_GUIDE.md +3 -3
  3. package/AI_PATTERNS_GUIDE.md +59 -25
  4. package/COMPONENT_QUICK_REFERENCE.md +3 -3
  5. package/README.md +52 -0
  6. package/dist/cjs/components/ActionList.js +33 -25
  7. package/dist/cjs/components/AnnouncementBar.js +115 -18
  8. package/dist/cjs/components/AnnouncementCard.js +269 -0
  9. package/dist/cjs/components/AppProvider.js +15 -2
  10. package/dist/cjs/components/Autocomplete.js +58 -36
  11. package/dist/cjs/components/Badge.js +28 -14
  12. package/dist/cjs/components/Banner.js +37 -27
  13. package/dist/cjs/components/Box.js +50 -38
  14. package/dist/cjs/components/Button.js +338 -109
  15. package/dist/cjs/components/ButtonGroup.js +27 -14
  16. package/dist/cjs/components/Card.js +311 -143
  17. package/dist/cjs/components/Checkbox.js +55 -47
  18. package/dist/cjs/components/CheckboxCard.js +222 -0
  19. package/dist/cjs/components/CheckboxCardGroup.js +384 -0
  20. package/dist/cjs/components/ChoiceList.js +21 -11
  21. package/dist/cjs/components/Code.js +22 -8
  22. package/dist/cjs/components/Collapsible.js +24 -11
  23. package/dist/cjs/components/ColorField.js +163 -38
  24. package/dist/cjs/components/ContextualSaveBar.js +13 -6
  25. package/dist/cjs/components/DatePicker.js +48 -37
  26. package/dist/cjs/components/Disclosure.js +57 -13
  27. package/dist/cjs/components/Divider.js +82 -18
  28. package/dist/cjs/components/DropZone.js +194 -68
  29. package/dist/cjs/components/EmptyState.js +18 -6
  30. package/dist/cjs/components/Filters.js +84 -36
  31. package/dist/cjs/components/FooterHelp.js +14 -4
  32. package/dist/cjs/components/Form.js +13 -2
  33. package/dist/cjs/components/Frame.js +57 -22
  34. package/dist/cjs/components/FrameSaveBar.js +37 -6
  35. package/dist/cjs/components/Grid.js +31 -15
  36. package/dist/cjs/components/HorizontalStack.js +38 -25
  37. package/dist/cjs/components/Icon.js +683 -61
  38. package/dist/cjs/components/Image.js +35 -22
  39. package/dist/cjs/components/InlineError.js +19 -10
  40. package/dist/cjs/components/Label.js +21 -12
  41. package/dist/cjs/components/Layout.js +37 -26
  42. package/dist/cjs/components/LayoutSection.js +84 -22
  43. package/dist/cjs/components/Link.js +35 -22
  44. package/dist/cjs/components/List.js +28 -12
  45. package/dist/cjs/components/Listbox.js +53 -31
  46. package/dist/cjs/components/Loading.js +14 -2
  47. package/dist/cjs/components/Modal.js +32 -39
  48. package/dist/cjs/components/Navigation.js +107 -36
  49. package/dist/cjs/components/Page.js +44 -31
  50. package/dist/cjs/components/Pagination.js +20 -5
  51. package/dist/cjs/components/Pane.js +67 -4
  52. package/dist/cjs/components/Popover.js +63 -30
  53. package/dist/cjs/components/PopoverManager.js +14 -1
  54. package/dist/cjs/components/ProgressBar.js +28 -15
  55. package/dist/cjs/components/RadioButton.js +32 -24
  56. package/dist/cjs/components/RadioButtonCard.js +92 -67
  57. package/dist/cjs/components/RadioButtonCardGroup.js +379 -0
  58. package/dist/cjs/components/RangeSlider.js +34 -26
  59. package/dist/cjs/components/ResourceList.js +28 -14
  60. package/dist/cjs/components/Select.js +38 -26
  61. package/dist/cjs/components/SkeletonText.js +33 -18
  62. package/dist/cjs/components/Spinner.js +24 -12
  63. package/dist/cjs/components/Stack.js +131 -71
  64. package/dist/cjs/components/TabNavigation.js +27 -1
  65. package/dist/cjs/components/Table.js +85 -29
  66. package/dist/cjs/components/Tabs.js +84 -24
  67. package/dist/cjs/components/Tag.js +37 -16
  68. package/dist/cjs/components/Text.js +32 -18
  69. package/dist/cjs/components/TextField.js +119 -69
  70. package/dist/cjs/components/Thumbnail.js +25 -11
  71. package/dist/cjs/components/TimePicker.js +22 -1
  72. package/dist/cjs/components/Tip.js +140 -25
  73. package/dist/cjs/components/ToastNotification.js +107 -34
  74. package/dist/cjs/components/ToastProvider.js +13 -3
  75. package/dist/cjs/components/Tooltip.js +50 -41
  76. package/dist/cjs/components/TopBar.js +83 -9
  77. package/dist/cjs/components/VerticalStack.js +31 -16
  78. package/dist/cjs/index.js +24 -0
  79. package/dist/cjs/playwright.config.js +114 -0
  80. package/dist/cjs/stories/Autocomplete.stories.js +10 -10
  81. package/dist/cjs/stories/Checkbox.stories.js +6 -8
  82. package/dist/cjs/stories/CheckboxCardGroup.stories.js +459 -0
  83. package/dist/cjs/stories/Collapsible.stories.js +11 -11
  84. package/dist/cjs/stories/ColorField.stories.js +2 -3
  85. package/dist/cjs/stories/ComplexExamples.stories.js +48 -77
  86. package/dist/cjs/stories/ContextualSaveBar.stories.js +1 -1
  87. package/dist/cjs/stories/Divider.stories.js +15 -16
  88. package/dist/cjs/stories/DropZone.stories.js +3 -3
  89. package/dist/cjs/stories/FooterHelp.stories.js +3 -4
  90. package/dist/cjs/stories/Form.stories.js +2 -4
  91. package/dist/cjs/stories/Grid.stories.js +24 -33
  92. package/dist/cjs/stories/Icon.stories.js +22 -23
  93. package/dist/cjs/stories/Image.stories.js +12 -15
  94. package/dist/cjs/stories/InlineError.stories.js +0 -1
  95. package/dist/cjs/stories/Layout.stories.js +96 -2
  96. package/dist/cjs/stories/LayoutSection.stories.js +13 -18
  97. package/dist/cjs/stories/List.stories.js +24 -28
  98. package/dist/cjs/stories/Listbox.stories.js +2 -2
  99. package/dist/cjs/stories/Loading.stories.js +21 -25
  100. package/dist/cjs/stories/Modal.stories.js +0 -1
  101. package/dist/cjs/stories/Pagination.stories.js +4 -4
  102. package/dist/cjs/stories/Pane.stories.js +10 -18
  103. package/dist/cjs/stories/Popover.stories.js +7 -7
  104. package/dist/cjs/stories/PopoverManager.stories.js +9 -9
  105. package/dist/cjs/stories/ProgressBar.stories.js +8 -8
  106. package/dist/cjs/stories/RadioButton.stories.js +2 -2
  107. package/dist/cjs/stories/RadioButtonCard.stories.js +2 -2
  108. package/dist/cjs/stories/RadioButtonCardGroup.stories.js +502 -0
  109. package/dist/cjs/stories/RangeSlider.stories.js +1 -3
  110. package/dist/cjs/stories/ResourceList.stories.js +13 -13
  111. package/dist/cjs/stories/Spinner.stories.js +9 -9
  112. package/dist/cjs/stories/Stack.stories.js +233 -51
  113. package/dist/cjs/stories/Tabs.stories.js +2 -2
  114. package/dist/cjs/stories/Tag.stories.js +1 -1
  115. package/dist/cjs/stories/Thumbnail.stories.js +17 -18
  116. package/dist/cjs/stories/TimePicker.stories.js +0 -5
  117. package/dist/cjs/stories/Tip.stories.js +1 -1
  118. package/dist/cjs/styles/Table.js +2 -7
  119. package/dist/cjs/tests/visual/stories.spec.js +637 -0
  120. package/dist/cjs/utilities/dates.js +7 -7
  121. package/dist/esm/components/ActionList.js +33 -25
  122. package/dist/esm/components/AnnouncementBar.js +115 -18
  123. package/dist/esm/components/AnnouncementCard.js +254 -0
  124. package/dist/esm/components/AppProvider.js +15 -2
  125. package/dist/esm/components/Autocomplete.js +58 -36
  126. package/dist/esm/components/Badge.js +28 -14
  127. package/dist/esm/components/Banner.js +37 -27
  128. package/dist/esm/components/Box.js +50 -38
  129. package/dist/esm/components/Button.js +338 -109
  130. package/dist/esm/components/ButtonGroup.js +27 -14
  131. package/dist/esm/components/Card.js +300 -140
  132. package/dist/esm/components/Checkbox.js +55 -47
  133. package/dist/esm/components/CheckboxCard.js +207 -0
  134. package/dist/esm/components/CheckboxCardGroup.js +370 -0
  135. package/dist/esm/components/ChoiceList.js +21 -11
  136. package/dist/esm/components/Code.js +22 -8
  137. package/dist/esm/components/Collapsible.js +24 -11
  138. package/dist/esm/components/ColorField.js +165 -40
  139. package/dist/esm/components/ContextualSaveBar.js +13 -6
  140. package/dist/esm/components/DatePicker.js +48 -37
  141. package/dist/esm/components/Disclosure.js +50 -6
  142. package/dist/esm/components/Divider.js +78 -20
  143. package/dist/esm/components/DropZone.js +194 -68
  144. package/dist/esm/components/EmptyState.js +18 -6
  145. package/dist/esm/components/Filters.js +84 -36
  146. package/dist/esm/components/FooterHelp.js +14 -4
  147. package/dist/esm/components/Form.js +13 -2
  148. package/dist/esm/components/Frame.js +57 -22
  149. package/dist/esm/components/FrameSaveBar.js +37 -6
  150. package/dist/esm/components/Grid.js +31 -15
  151. package/dist/esm/components/HorizontalStack.js +38 -25
  152. package/dist/esm/components/Icon.js +681 -62
  153. package/dist/esm/components/Image.js +35 -22
  154. package/dist/esm/components/InlineError.js +19 -10
  155. package/dist/esm/components/Label.js +21 -12
  156. package/dist/esm/components/Layout.js +62 -27
  157. package/dist/esm/components/LayoutSection.js +84 -22
  158. package/dist/esm/components/Link.js +35 -22
  159. package/dist/esm/components/List.js +28 -12
  160. package/dist/esm/components/Listbox.js +53 -31
  161. package/dist/esm/components/Loading.js +14 -2
  162. package/dist/esm/components/Modal.js +79 -40
  163. package/dist/esm/components/Navigation.js +107 -36
  164. package/dist/esm/components/Page.js +44 -31
  165. package/dist/esm/components/Pagination.js +20 -5
  166. package/dist/esm/components/Pane.js +67 -4
  167. package/dist/esm/components/Popover.js +63 -30
  168. package/dist/esm/components/PopoverManager.js +14 -1
  169. package/dist/esm/components/ProgressBar.js +28 -15
  170. package/dist/esm/components/RadioButton.js +32 -24
  171. package/dist/esm/components/RadioButtonCard.js +92 -67
  172. package/dist/esm/components/RadioButtonCardGroup.js +364 -0
  173. package/dist/esm/components/RangeSlider.js +34 -26
  174. package/dist/esm/components/ResourceList.js +28 -14
  175. package/dist/esm/components/Select.js +38 -26
  176. package/dist/esm/components/SkeletonText.js +33 -18
  177. package/dist/esm/components/Spinner.js +24 -12
  178. package/dist/esm/components/Stack.js +131 -71
  179. package/dist/esm/components/TabNavigation.js +27 -1
  180. package/dist/esm/components/Table.js +85 -29
  181. package/dist/esm/components/Tabs.js +84 -24
  182. package/dist/esm/components/Tag.js +37 -16
  183. package/dist/esm/components/Text.js +32 -18
  184. package/dist/esm/components/TextField.js +119 -69
  185. package/dist/esm/components/Thumbnail.js +25 -11
  186. package/dist/esm/components/TimePicker.js +22 -1
  187. package/dist/esm/components/Tip.js +140 -25
  188. package/dist/esm/components/ToastNotification.js +107 -34
  189. package/dist/esm/components/ToastProvider.js +13 -3
  190. package/dist/esm/components/Tooltip.js +50 -41
  191. package/dist/esm/components/TopBar.js +83 -9
  192. package/dist/esm/components/VerticalStack.js +31 -16
  193. package/dist/esm/index.js +6 -0
  194. package/dist/esm/playwright.config.js +104 -0
  195. package/dist/esm/stories/Autocomplete.stories.js +10 -10
  196. package/dist/esm/stories/Checkbox.stories.js +6 -8
  197. package/dist/esm/stories/CheckboxCardGroup.stories.js +421 -0
  198. package/dist/esm/stories/Collapsible.stories.js +11 -11
  199. package/dist/esm/stories/ColorField.stories.js +2 -3
  200. package/dist/esm/stories/ComplexExamples.stories.js +48 -77
  201. package/dist/esm/stories/ContextualSaveBar.stories.js +1 -1
  202. package/dist/esm/stories/Divider.stories.js +15 -16
  203. package/dist/esm/stories/DropZone.stories.js +3 -3
  204. package/dist/esm/stories/FooterHelp.stories.js +3 -4
  205. package/dist/esm/stories/Form.stories.js +2 -4
  206. package/dist/esm/stories/Grid.stories.js +24 -33
  207. package/dist/esm/stories/Icon.stories.js +22 -23
  208. package/dist/esm/stories/Image.stories.js +12 -15
  209. package/dist/esm/stories/InlineError.stories.js +0 -1
  210. package/dist/esm/stories/Layout.stories.js +93 -2
  211. package/dist/esm/stories/LayoutSection.stories.js +13 -18
  212. package/dist/esm/stories/List.stories.js +24 -28
  213. package/dist/esm/stories/Listbox.stories.js +2 -2
  214. package/dist/esm/stories/Loading.stories.js +21 -25
  215. package/dist/esm/stories/Modal.stories.js +0 -1
  216. package/dist/esm/stories/Pagination.stories.js +4 -4
  217. package/dist/esm/stories/Pane.stories.js +10 -18
  218. package/dist/esm/stories/Popover.stories.js +7 -7
  219. package/dist/esm/stories/PopoverManager.stories.js +9 -9
  220. package/dist/esm/stories/ProgressBar.stories.js +8 -8
  221. package/dist/esm/stories/RadioButton.stories.js +2 -2
  222. package/dist/esm/stories/RadioButtonCard.stories.js +2 -2
  223. package/dist/esm/stories/RadioButtonCardGroup.stories.js +461 -0
  224. package/dist/esm/stories/RangeSlider.stories.js +1 -3
  225. package/dist/esm/stories/ResourceList.stories.js +13 -13
  226. package/dist/esm/stories/Spinner.stories.js +9 -9
  227. package/dist/esm/stories/Stack.stories.js +224 -51
  228. package/dist/esm/stories/Tabs.stories.js +2 -2
  229. package/dist/esm/stories/Tag.stories.js +1 -1
  230. package/dist/esm/stories/Thumbnail.stories.js +17 -18
  231. package/dist/esm/stories/TimePicker.stories.js +0 -5
  232. package/dist/esm/stories/Tip.stories.js +1 -1
  233. package/dist/esm/styles/Table.js +2 -7
  234. package/dist/esm/tests/visual/stories.spec.js +633 -0
  235. package/dist/esm/utilities/dates.js +7 -7
  236. package/dist/types/components/ActionList.d.ts +1 -31
  237. package/dist/types/components/ActionList.d.ts.map +1 -1
  238. package/dist/types/components/AnnouncementBar.d.ts +1 -19
  239. package/dist/types/components/AnnouncementBar.d.ts.map +1 -1
  240. package/dist/types/components/AnnouncementCard.d.ts +3 -0
  241. package/dist/types/components/AnnouncementCard.d.ts.map +1 -0
  242. package/dist/types/components/AppProvider.d.ts +14 -1
  243. package/dist/types/components/AppProvider.d.ts.map +1 -1
  244. package/dist/types/components/Autocomplete.d.ts +1 -71
  245. package/dist/types/components/Autocomplete.d.ts.map +1 -1
  246. package/dist/types/components/Badge.d.ts +1 -19
  247. package/dist/types/components/Badge.d.ts.map +1 -1
  248. package/dist/types/components/Banner.d.ts +1 -37
  249. package/dist/types/components/Banner.d.ts.map +1 -1
  250. package/dist/types/components/Box.d.ts +1 -68
  251. package/dist/types/components/Box.d.ts.map +1 -1
  252. package/dist/types/components/Button.d.ts +1 -131
  253. package/dist/types/components/Button.d.ts.map +1 -1
  254. package/dist/types/components/ButtonGroup.d.ts +1 -22
  255. package/dist/types/components/ButtonGroup.d.ts.map +1 -1
  256. package/dist/types/components/Card.d.ts +54 -59
  257. package/dist/types/components/Card.d.ts.map +1 -1
  258. package/dist/types/components/Checkbox.d.ts +1 -63
  259. package/dist/types/components/Checkbox.d.ts.map +1 -1
  260. package/dist/types/components/CheckboxCard.d.ts +3 -0
  261. package/dist/types/components/CheckboxCard.d.ts.map +1 -0
  262. package/dist/types/components/CheckboxCardGroup.d.ts +3 -0
  263. package/dist/types/components/CheckboxCardGroup.d.ts.map +1 -0
  264. package/dist/types/components/ChoiceList.d.ts +1 -42
  265. package/dist/types/components/ChoiceList.d.ts.map +1 -1
  266. package/dist/types/components/Code.d.ts +1 -26
  267. package/dist/types/components/Code.d.ts.map +1 -1
  268. package/dist/types/components/Collapsible.d.ts +1 -15
  269. package/dist/types/components/Collapsible.d.ts.map +1 -1
  270. package/dist/types/components/ColorField.d.ts +13 -34
  271. package/dist/types/components/ColorField.d.ts.map +1 -1
  272. package/dist/types/components/ContextualSaveBar.d.ts +13 -6
  273. package/dist/types/components/ContextualSaveBar.d.ts.map +1 -1
  274. package/dist/types/components/DatePicker.d.ts +1 -64
  275. package/dist/types/components/DatePicker.d.ts.map +1 -1
  276. package/dist/types/components/Disclosure.d.ts +1 -25
  277. package/dist/types/components/Disclosure.d.ts.map +1 -1
  278. package/dist/types/components/Divider.d.ts +1 -19
  279. package/dist/types/components/Divider.d.ts.map +1 -1
  280. package/dist/types/components/DropZone.d.ts +3 -62
  281. package/dist/types/components/DropZone.d.ts.map +1 -1
  282. package/dist/types/components/EmptyState.d.ts +1 -50
  283. package/dist/types/components/EmptyState.d.ts.map +1 -1
  284. package/dist/types/components/Filters.d.ts +13 -68
  285. package/dist/types/components/Filters.d.ts.map +1 -1
  286. package/dist/types/components/FooterHelp.d.ts +14 -4
  287. package/dist/types/components/FooterHelp.d.ts.map +1 -1
  288. package/dist/types/components/Form.d.ts +13 -2
  289. package/dist/types/components/Form.d.ts.map +1 -1
  290. package/dist/types/components/Frame.d.ts +15 -36
  291. package/dist/types/components/Frame.d.ts.map +1 -1
  292. package/dist/types/components/FrameSaveBar.d.ts +3 -6
  293. package/dist/types/components/FrameSaveBar.d.ts.map +1 -1
  294. package/dist/types/components/Grid.d.ts +5 -21
  295. package/dist/types/components/Grid.d.ts.map +1 -1
  296. package/dist/types/components/HorizontalStack.d.ts +1 -34
  297. package/dist/types/components/HorizontalStack.d.ts.map +1 -1
  298. package/dist/types/components/Icon.d.ts +1 -41
  299. package/dist/types/components/Icon.d.ts.map +1 -1
  300. package/dist/types/components/Image.d.ts +1 -43
  301. package/dist/types/components/Image.d.ts.map +1 -1
  302. package/dist/types/components/InlineError.d.ts +1 -20
  303. package/dist/types/components/InlineError.d.ts.map +1 -1
  304. package/dist/types/components/Label.d.ts +1 -26
  305. package/dist/types/components/Label.d.ts.map +1 -1
  306. package/dist/types/components/Layout.d.ts +24 -15
  307. package/dist/types/components/Layout.d.ts.map +1 -1
  308. package/dist/types/components/LayoutSection.d.ts +1 -19
  309. package/dist/types/components/LayoutSection.d.ts.map +1 -1
  310. package/dist/types/components/Link.d.ts +1 -37
  311. package/dist/types/components/Link.d.ts.map +1 -1
  312. package/dist/types/components/List.d.ts +5 -17
  313. package/dist/types/components/List.d.ts.map +1 -1
  314. package/dist/types/components/Listbox.d.ts +1 -32
  315. package/dist/types/components/Listbox.d.ts.map +1 -1
  316. package/dist/types/components/Loading.d.ts +14 -2
  317. package/dist/types/components/Loading.d.ts.map +1 -1
  318. package/dist/types/components/Modal.d.ts +26 -35
  319. package/dist/types/components/Modal.d.ts.map +1 -1
  320. package/dist/types/components/Navigation.d.ts +1 -25
  321. package/dist/types/components/Navigation.d.ts.map +1 -1
  322. package/dist/types/components/Page.d.ts +1 -57
  323. package/dist/types/components/Page.d.ts.map +1 -1
  324. package/dist/types/components/Pagination.d.ts +13 -3
  325. package/dist/types/components/Pagination.d.ts.map +1 -1
  326. package/dist/types/components/Pane.d.ts +55 -3
  327. package/dist/types/components/Pane.d.ts.map +1 -1
  328. package/dist/types/components/Popover.d.ts +5 -35
  329. package/dist/types/components/Popover.d.ts.map +1 -1
  330. package/dist/types/components/PopoverManager.d.ts.map +1 -1
  331. package/dist/types/components/ProgressBar.d.ts +1 -22
  332. package/dist/types/components/ProgressBar.d.ts.map +1 -1
  333. package/dist/types/components/RadioButton.d.ts +1 -37
  334. package/dist/types/components/RadioButton.d.ts.map +1 -1
  335. package/dist/types/components/RadioButtonCard.d.ts +1 -39
  336. package/dist/types/components/RadioButtonCard.d.ts.map +1 -1
  337. package/dist/types/components/RadioButtonCardGroup.d.ts +3 -0
  338. package/dist/types/components/RadioButtonCardGroup.d.ts.map +1 -0
  339. package/dist/types/components/RangeSlider.d.ts +1 -42
  340. package/dist/types/components/RangeSlider.d.ts.map +1 -1
  341. package/dist/types/components/ResourceList.d.ts +5 -30
  342. package/dist/types/components/ResourceList.d.ts.map +1 -1
  343. package/dist/types/components/Select.d.ts +1 -46
  344. package/dist/types/components/Select.d.ts.map +1 -1
  345. package/dist/types/components/SkeletonText.d.ts +1 -26
  346. package/dist/types/components/SkeletonText.d.ts.map +1 -1
  347. package/dist/types/components/Spinner.d.ts +1 -16
  348. package/dist/types/components/Spinner.d.ts.map +1 -1
  349. package/dist/types/components/Stack.d.ts +1 -47
  350. package/dist/types/components/Stack.d.ts.map +1 -1
  351. package/dist/types/components/TabNavigation.d.ts.map +1 -1
  352. package/dist/types/components/Table.d.ts +13 -58
  353. package/dist/types/components/Table.d.ts.map +1 -1
  354. package/dist/types/components/Tabs.d.ts +40 -34
  355. package/dist/types/components/Tabs.d.ts.map +1 -1
  356. package/dist/types/components/Tag.d.ts +1 -24
  357. package/dist/types/components/Tag.d.ts.map +1 -1
  358. package/dist/types/components/Text.d.ts +1 -30
  359. package/dist/types/components/Text.d.ts.map +1 -1
  360. package/dist/types/components/TextField.d.ts +1 -109
  361. package/dist/types/components/TextField.d.ts.map +1 -1
  362. package/dist/types/components/Thumbnail.d.ts +1 -16
  363. package/dist/types/components/Thumbnail.d.ts.map +1 -1
  364. package/dist/types/components/TimePicker.d.ts +28 -1
  365. package/dist/types/components/TimePicker.d.ts.map +1 -1
  366. package/dist/types/components/Tip.d.ts +1 -21
  367. package/dist/types/components/Tip.d.ts.map +1 -1
  368. package/dist/types/components/ToastNotification.d.ts +1 -34
  369. package/dist/types/components/ToastNotification.d.ts.map +1 -1
  370. package/dist/types/components/ToastProvider.d.ts +13 -3
  371. package/dist/types/components/ToastProvider.d.ts.map +1 -1
  372. package/dist/types/components/Tooltip.d.ts +1 -54
  373. package/dist/types/components/Tooltip.d.ts.map +1 -1
  374. package/dist/types/components/TopBar.d.ts +1 -19
  375. package/dist/types/components/TopBar.d.ts.map +1 -1
  376. package/dist/types/components/VerticalStack.d.ts +1 -25
  377. package/dist/types/components/VerticalStack.d.ts.map +1 -1
  378. package/dist/types/index.d.ts +6 -0
  379. package/dist/types/styles/Table.d.ts.map +1 -1
  380. package/index.css +76 -14
  381. package/package.json +15 -5
@@ -135,7 +135,107 @@ import Spinner from "./Spinner.js";
135
135
  import Tooltip from "./Tooltip.js";
136
136
  import { CaretDownMinor } from "@shopify/polaris-icons";
137
137
  import { useDarkMode } from "./AppProvider.js";
138
- var styles = tv({
138
+ /**
139
+ * @component Button
140
+ *
141
+ * @description A versatile action trigger that renders as a button or link with support for variants, icons, loading states, and size options.
142
+ *
143
+ * @usage
144
+ * - DO: Use for triggering actions like save, delete, or submit.
145
+ * - DON'T: Use for navigation-only links (use Link component).
146
+ *
147
+ * @accessibility
148
+ * - Renders as `<button>` or `<a>` with proper roles; always provide `accessibilityLabel` for icon-only buttons.
149
+ *
150
+ * @alternative
151
+ * - If you need navigation-only text, use `Link`.
152
+ * - If you need a group of related actions, use `ButtonGroup`.
153
+ *
154
+ * @param {Object} props - The properties for configuring the Button component.
155
+ * @param {string} [props.id] - Unique identifier for the button.
156
+ * @param {React.ReactNode} [props.children] - The content to display within the button.
157
+ * @param {string} [props.url] - URL to navigate to when clicked. If provided, renders as an anchor tag.
158
+ * @param {boolean} [props.disabled=false] - Whether the button is disabled.
159
+ * @param {boolean} [props.external] - Whether the URL should open in a new tab.
160
+ * @param {string} [props.target] - Target attribute for the anchor tag when URL is provided.
161
+ * @param {boolean} [props.submit] - Whether the button should act as a form submit button.
162
+ * @param {boolean} [props.loading=false] - Whether to show a loading spinner.
163
+ * @param {boolean} [props.pressed=false] - Whether the button appears pressed.
164
+ * @param {string} [props.accessibilityLabel] - Accessible label for screen readers.
165
+ * @param {string} [props.role] - ARIA role for the button.
166
+ * @param {string} [props.ariaControls] - ID of the element controlled by the button.
167
+ * @param {boolean} [props.ariaExpanded] - Whether the controlled element is expanded.
168
+ * @param {string} [props.ariaDescribedBy] - ID of the element that describes the button.
169
+ * @param {boolean} [props.ariaChecked] - Whether the button is checked (for toggle buttons).
170
+ * @param {boolean} [props.hasIcon] - Override icon-presence detection for padding. Use when the button contains an icon not passed via the `icon` prop.
171
+ * @param {React.Component} [props.icon] - Icon component to display within the button.
172
+ * @param {"default" | "primary" | "secondary" | "plain" | "link" | "destructive" | "highlight"} [props.iconColor='default'] - Color of the icon.
173
+ * @param {"default" | "sm" | "lg" | "xl"} [props.iconSize='default'] - Size of the icon.
174
+ * @param {"left" | "right"} [props.iconPosition='left'] - Position of the icon ('left' or 'right').
175
+ * @param {boolean} [props.primary=false] - Whether to show the primary button style.
176
+ * @param {boolean} [props.highlight=false] - Whether to show the highlight button style.
177
+ * @param {boolean} [props.link=false] - Whether to show a link style.
178
+ * @param {boolean} [props.destructive=false] - Whether to show destructive styling.
179
+ * @param {boolean} [props.disclosure=false] - Whether to show a disclosure arrow.
180
+ * @param {boolean} [props.disclosureRight=false] - Whether to show the disclosure on the right.
181
+ * @param {boolean} [props.plain=false] - Whether to show plain styling without background.
182
+ * @param {boolean} [props.naked=false] - Whether to show the naked styling.
183
+ * @param {boolean} [props.outline=false] - Whether to show the outline variant. Styled like plain with a 1px outline border.
184
+ * @param {"mini" | "small" | "medium" | "large" | "stepper"} [props.size='medium'] - Size of the button ('mini', 'small', 'medium', 'large', 'stepper').
185
+ * @param {boolean} [props.fullWidth] - Whether the button should take full width.
186
+ * @param {"left" | "center"} [props.fullWidthAlignment='left'] - Alignment of the label text when fullWidth and disclosure are both active ('left', 'center').
187
+ * @param {"left" | "center" | "right"} [props.align='center'] - Alignment of the button content ('left', 'center', 'right').
188
+ * @param {string} [props.tooltip] - Tooltip to show when hovering over the button.
189
+ * @param {"left" | "center" | "right"} [props.tooltipAlignment='right'] - Alignment of the tooltip ('left', 'center', 'right').
190
+ * @param {"above" | "below" | "left" | "right"} [props.tooltipPosition='above'] - Position of the tooltip ('above', 'below', 'left', 'right').
191
+ * @param {"inline-block" | "block" | "inline"} [props.tooltipDisplay='inline-block'] - Display type of the tooltip ('inline-block', 'block', 'inline').
192
+ * @param {Object} [props.connectedDisclosure] - Configuration for connected disclosure menu.
193
+ * @param {Array<import("./ActionList").ActionListItem>} [props.connectedDisclosure.actions] - Actions to show in the disclosure menu.
194
+ * @param {Array<{title?: string, items: Array<import("./ActionList").ActionListItem>}>} [props.connectedDisclosure.sections] - Sections with optional titles to show in the disclosure menu. Use instead of actions for grouped items.
195
+ * @param {string} [props.className] - Additional CSS classes for the button.
196
+ * @param {string} [props.contentClassName] - Additional CSS classes for the button content.
197
+ * @param {boolean} [props.rounded] - Whether to show fully rounded corners.
198
+ * @param {Function} [props.onClick] - Callback when the button is clicked.
199
+ * @param {Function} [props.onMouseDown] - Callback when the mouse is pressed on the button.
200
+ *
201
+ * @returns {JSX.Element} The rendered Button component.
202
+ *
203
+ * @example
204
+ * ```js
205
+ * // Basic button
206
+ * <Button onClick={() => console.log('Clicked')}>
207
+ * Click me
208
+ * </Button>
209
+ * ```
210
+ *
211
+ * @example
212
+ * ```js
213
+ * // Primary button with icon and loading state
214
+ * <Button
215
+ * primary
216
+ * loading={isLoading}
217
+ * icon={SaveMinor}
218
+ * onClick={handleSave}
219
+ * >
220
+ * Save changes
221
+ * </Button>
222
+ * ```
223
+ *
224
+ * @example
225
+ * ```js
226
+ * // Button with connected disclosure
227
+ * <Button
228
+ * connectedDisclosure={{
229
+ * actions: [
230
+ * { content: 'Option 1', onAction: () => {} },
231
+ * { content: 'Option 2', onAction: () => {} }
232
+ * ]
233
+ * }}
234
+ * >
235
+ * More actions
236
+ * </Button>
237
+ * ```
238
+ */ var styles = tv({
139
239
  base: "Litho-Button relative flex items-center justify-center rounded-md border border-transparent overflow-hidden",
140
240
  variants: {
141
241
  disabled: {
@@ -197,6 +297,10 @@ var styles = tv({
197
297
  naked: {
198
298
  true: "border-none bg-transparent p-0 hover:bg-transparent w-auto justify-start",
199
299
  false: ""
300
+ },
301
+ outline: {
302
+ true: "",
303
+ false: ""
200
304
  }
201
305
  },
202
306
  compoundVariants: [
@@ -205,10 +309,16 @@ var styles = tv({
205
309
  plain: true,
206
310
  class: "border-tint-2 dark:border-tint-alt-4"
207
311
  },
312
+ {
313
+ bordered: true,
314
+ outline: true,
315
+ class: "border-tint-2 dark:border-tint-alt-4"
316
+ },
208
317
  {
209
318
  disabled: true,
210
319
  plain: false,
211
320
  link: false,
321
+ outline: false,
212
322
  highlight: false,
213
323
  class: "border-btn-secondary-border"
214
324
  },
@@ -216,6 +326,7 @@ var styles = tv({
216
326
  loading: true,
217
327
  plain: false,
218
328
  link: false,
329
+ outline: false,
219
330
  highlight: false,
220
331
  class: "border-btn-secondary-border"
221
332
  },
@@ -256,6 +367,7 @@ var styles = tv({
256
367
  primary: false,
257
368
  plain: false,
258
369
  link: false,
370
+ outline: false,
259
371
  destructive: false,
260
372
  highlight: false,
261
373
  class: "rounded-l-none border-l border-l-tint-4!"
@@ -278,6 +390,7 @@ var styles = tv({
278
390
  primary: false,
279
391
  plain: false,
280
392
  link: false,
393
+ outline: false,
281
394
  destructive: false,
282
395
  highlight: false,
283
396
  class: "rounded-l-none border-l border-l-tint-alt-4!"
@@ -318,6 +431,7 @@ var styles = tv({
318
431
  primary: false,
319
432
  plain: false,
320
433
  link: false,
434
+ outline: false,
321
435
  destructive: false,
322
436
  highlight: false,
323
437
  pressed: false,
@@ -330,6 +444,7 @@ var styles = tv({
330
444
  primary: false,
331
445
  plain: false,
332
446
  link: false,
447
+ outline: false,
333
448
  destructive: false,
334
449
  highlight: false,
335
450
  pressed: true,
@@ -341,6 +456,7 @@ var styles = tv({
341
456
  primary: false,
342
457
  plain: false,
343
458
  link: false,
459
+ outline: false,
344
460
  destructive: false,
345
461
  highlight: false,
346
462
  class: "bg-btn-secondary-disabled text-btn-secondary-disabled-fg"
@@ -350,6 +466,7 @@ var styles = tv({
350
466
  primary: false,
351
467
  plain: false,
352
468
  link: false,
469
+ outline: false,
353
470
  destructive: false,
354
471
  highlight: false,
355
472
  class: "bg-btn-secondary-disabled text-btn-secondary-disabled-fg"
@@ -379,6 +496,31 @@ var styles = tv({
379
496
  loading: true,
380
497
  class: "bg-btn-plain-disabled text-btn-plain-disabled-fg"
381
498
  },
499
+ // Outline buttons
500
+ {
501
+ outline: true,
502
+ disabled: false,
503
+ loading: false,
504
+ bordered: false,
505
+ class: "border-edge-light bg-btn-plain hover:bg-btn-plain-low active:bg-btn-plain-lower text-btn-plain-fg hover:text-btn-plain-fg-alt"
506
+ },
507
+ {
508
+ outline: true,
509
+ disabled: false,
510
+ loading: false,
511
+ bordered: true,
512
+ class: "border-edge-light bg-btn-plain hover:bg-btn-plain-low active:bg-btn-plain-lower text-btn-plain-fg hover:text-btn-plain-fg-alt"
513
+ },
514
+ {
515
+ outline: true,
516
+ disabled: true,
517
+ class: "border-edge-light bg-btn-plain-disabled text-btn-plain-disabled-fg"
518
+ },
519
+ {
520
+ outline: true,
521
+ loading: true,
522
+ class: "border-edge-light bg-btn-plain-disabled text-btn-plain-disabled-fg"
523
+ },
382
524
  // Link buttons
383
525
  {
384
526
  link: true,
@@ -458,7 +600,8 @@ var styles = tv({
458
600
  shadow: false,
459
601
  darkMode: false,
460
602
  bordered: false,
461
- insight: false
603
+ insight: false,
604
+ outline: false
462
605
  }
463
606
  });
464
607
  var contentStyles = tv({
@@ -477,7 +620,7 @@ var contentStyles = tv({
477
620
  false: ""
478
621
  },
479
622
  size: {
480
- mini: "p-0",
623
+ mini: "py-0 text-sm",
481
624
  small: "py-0.5",
482
625
  large: "py-3",
483
626
  medium: "py-1"
@@ -485,13 +628,57 @@ var contentStyles = tv({
485
628
  naked: {
486
629
  true: "px-2",
487
630
  false: ""
631
+ },
632
+ iconPosition: {
633
+ left: "",
634
+ right: ""
635
+ },
636
+ fullWidth: {
637
+ true: "",
638
+ false: ""
639
+ },
640
+ fullWidthAlignment: {
641
+ left: "",
642
+ center: ""
488
643
  }
489
644
  },
490
645
  compoundVariants: [
646
+ {
647
+ fullWidth: true,
648
+ disclosure: true,
649
+ fullWidthAlignment: "left",
650
+ class: "w-full justify-start"
651
+ },
652
+ {
653
+ fullWidth: true,
654
+ disclosure: true,
655
+ fullWidthAlignment: "center",
656
+ class: "w-full justify-center"
657
+ },
491
658
  {
492
659
  size: "mini",
493
660
  iconOnly: true,
494
- class: "!px-0"
661
+ class: "!px-0.5"
662
+ },
663
+ {
664
+ size: "mini",
665
+ hasIcon: false,
666
+ iconOnly: false,
667
+ class: "px-1.5"
668
+ },
669
+ {
670
+ size: "mini",
671
+ hasIcon: true,
672
+ iconOnly: false,
673
+ iconPosition: "left",
674
+ class: "pl-0.5 pr-1.5"
675
+ },
676
+ {
677
+ size: "mini",
678
+ hasIcon: true,
679
+ iconOnly: false,
680
+ iconPosition: "right",
681
+ class: "pl-1.5 pr-0.5"
495
682
  },
496
683
  {
497
684
  size: "small",
@@ -508,8 +695,16 @@ var contentStyles = tv({
508
695
  size: "small",
509
696
  hasIcon: true,
510
697
  iconOnly: false,
698
+ iconPosition: "left",
511
699
  class: "pl-1.5 pr-2"
512
700
  },
701
+ {
702
+ size: "small",
703
+ hasIcon: true,
704
+ iconOnly: false,
705
+ iconPosition: "right",
706
+ class: "pl-2 pr-1.5"
707
+ },
513
708
  {
514
709
  size: "medium",
515
710
  iconOnly: true,
@@ -525,8 +720,17 @@ var contentStyles = tv({
525
720
  hasChildren: true,
526
721
  disclosure: false,
527
722
  size: "large",
723
+ iconPosition: "left",
528
724
  class: "pl-3 pr-4"
529
725
  },
726
+ {
727
+ hasIcon: true,
728
+ hasChildren: true,
729
+ disclosure: false,
730
+ size: "large",
731
+ iconPosition: "right",
732
+ class: "pl-4 pr-3"
733
+ },
530
734
  {
531
735
  hasIcon: true,
532
736
  hasChildren: true,
@@ -538,13 +742,28 @@ var contentStyles = tv({
538
742
  hasChildren: true,
539
743
  disclosure: false,
540
744
  size: "medium",
745
+ iconPosition: "left",
541
746
  class: "pl-2 pr-3"
542
747
  },
748
+ {
749
+ hasIcon: true,
750
+ hasChildren: true,
751
+ disclosure: false,
752
+ size: "medium",
753
+ iconPosition: "right",
754
+ class: "pl-3 pr-2"
755
+ },
543
756
  {
544
757
  hasIcon: false,
545
758
  hasChildren: true,
546
759
  disclosure: false,
547
760
  naked: false,
761
+ size: [
762
+ "small",
763
+ "medium",
764
+ "large",
765
+ "stepper"
766
+ ],
548
767
  class: "px-3"
549
768
  },
550
769
  {
@@ -559,15 +778,27 @@ var contentStyles = tv({
559
778
  hasIcon: false,
560
779
  iconOnly: false,
561
780
  hasChildren: true,
562
- size: "medium"
781
+ size: "medium",
782
+ iconPosition: "left"
563
783
  }
564
784
  });
565
785
  var iconStyles = tv({
566
- base: "Litho-Button__Icon"
786
+ base: "Litho-Button__Icon",
787
+ variants: {
788
+ loading: {
789
+ true: "invisible"
790
+ }
791
+ }
567
792
  });
568
793
  var textStyles = tv({
569
- base: "Litho-Button__Text whitespace-nowrap leading-5 font-medium",
794
+ base: "Litho-Button__Text whitespace-nowrap leading-5",
570
795
  variants: {
796
+ size: {
797
+ mini: "font-normal",
798
+ small: "font-medium",
799
+ medium: "font-medium",
800
+ large: "font-medium"
801
+ },
571
802
  loading: {
572
803
  true: "invisible"
573
804
  },
@@ -591,6 +822,10 @@ var textStyles = tv({
591
822
  true: "",
592
823
  false: ""
593
824
  },
825
+ outline: {
826
+ true: "",
827
+ false: ""
828
+ },
594
829
  highlight: {
595
830
  true: "",
596
831
  false: ""
@@ -602,9 +837,33 @@ var textStyles = tv({
602
837
  naked: {
603
838
  true: "",
604
839
  false: ""
840
+ },
841
+ fullWidth: {
842
+ true: "",
843
+ false: ""
844
+ },
845
+ disclosure: {
846
+ true: "",
847
+ false: ""
848
+ },
849
+ fullWidthAlignment: {
850
+ left: "",
851
+ center: ""
605
852
  }
606
853
  },
607
854
  compoundVariants: [
855
+ {
856
+ fullWidth: true,
857
+ disclosure: true,
858
+ fullWidthAlignment: "left",
859
+ class: "flex-grow text-left"
860
+ },
861
+ {
862
+ fullWidth: true,
863
+ disclosure: true,
864
+ fullWidthAlignment: "center",
865
+ class: "flex-grow text-center"
866
+ },
608
867
  {
609
868
  primary: true,
610
869
  loading: false,
@@ -628,6 +887,7 @@ var textStyles = tv({
628
887
  primary: false,
629
888
  plain: false,
630
889
  link: false,
890
+ outline: false,
631
891
  naked: false,
632
892
  insight: false,
633
893
  class: "text-btn-secondary-fg"
@@ -639,6 +899,7 @@ var textStyles = tv({
639
899
  primary: false,
640
900
  plain: false,
641
901
  link: false,
902
+ outline: false,
642
903
  class: "text-btn-secondary-disabled-fg"
643
904
  },
644
905
  {
@@ -648,6 +909,7 @@ var textStyles = tv({
648
909
  primary: false,
649
910
  plain: false,
650
911
  link: false,
912
+ outline: false,
651
913
  class: "text-btn-secondary-disabled-fg"
652
914
  },
653
915
  {
@@ -666,6 +928,22 @@ var textStyles = tv({
666
928
  disabled: true,
667
929
  class: "text-btn-plain-disabled-fg"
668
930
  },
931
+ {
932
+ outline: true,
933
+ loading: false,
934
+ disabled: false,
935
+ class: "text-btn-plain-fg"
936
+ },
937
+ {
938
+ outline: true,
939
+ loading: true,
940
+ class: "text-btn-plain-disabled-fg"
941
+ },
942
+ {
943
+ outline: true,
944
+ disabled: true,
945
+ class: "text-btn-plain-disabled-fg"
946
+ },
669
947
  {
670
948
  link: true,
671
949
  loading: false,
@@ -723,108 +1001,24 @@ var textStyles = tv({
723
1001
  defaultVariants: {
724
1002
  primary: false,
725
1003
  plain: false,
1004
+ outline: false,
726
1005
  link: false,
727
1006
  destructive: false,
728
1007
  highlight: false,
729
1008
  loading: false,
730
1009
  disabled: false,
731
- rounded: false
1010
+ rounded: false,
1011
+ size: "medium"
732
1012
  }
733
1013
  });
734
1014
  var connectedDisclosureStyles = tv({
735
1015
  base: "Litho-Button__ConnectedDisclosure flex flex-wrap-nowrap"
736
1016
  });
737
- /**
738
- * A Button component that renders a customizable button or link with various styles and states.
739
- * The button can be configured with different variants, sizes, and can include icons, loading states,
740
- * and connected disclosure actions.
741
- *
742
- * @component
743
- *
744
- * @param {Object} props - The properties for configuring the Button component.
745
- * @param {string} [props.id] - Unique identifier for the button.
746
- * @param {React.ReactNode} [props.children] - The content to display within the button.
747
- * @param {string} [props.url] - URL to navigate to when clicked. If provided, renders as an anchor tag.
748
- * @param {boolean} [props.disabled=false] - Whether the button is disabled.
749
- * @param {boolean} [props.external] - Whether the URL should open in a new tab.
750
- * @param {string} [props.target] - Target attribute for the anchor tag when URL is provided.
751
- * @param {boolean} [props.submit] - Whether the button should act as a form submit button.
752
- * @param {boolean} [props.loading=false] - Whether to show a loading spinner.
753
- * @param {boolean} [props.pressed=false] - Whether the button appears pressed.
754
- * @param {string} [props.accessibilityLabel] - Accessible label for screen readers.
755
- * @param {string} [props.role] - ARIA role for the button.
756
- * @param {string} [props.ariaControls] - ID of the element controlled by the button.
757
- * @param {boolean} [props.ariaExpanded] - Whether the controlled element is expanded.
758
- * @param {string} [props.ariaDescribedBy] - ID of the element that describes the button.
759
- * @param {boolean} [props.ariaChecked] - Whether the button is checked (for toggle buttons).
760
- * @param {React.Component} [props.icon] - Icon component to display within the button.
761
- * @param {"default" | "primary" | "secondary" | "plain" | "link" | "destructive" | "highlight"} [props.iconColor='default'] - Color of the icon.
762
- * @param {"default" | "sm" | "lg" | "xl"} [props.iconSize='default'] - Size of the icon.
763
- * @param {boolean} [props.primary=false] - Whether to show the primary button style.
764
- * @param {boolean} [props.highlight=false] - Whether to show the highlight button style.
765
- * @param {boolean} [props.link=false] - Whether to show a link style.
766
- * @param {boolean} [props.destructive=false] - Whether to show destructive styling.
767
- * @param {boolean} [props.disclosure=false] - Whether to show a disclosure arrow.
768
- * @param {boolean} [props.disclosureRight=false] - Whether to show the disclosure on the right.
769
- * @param {boolean} [props.plain=false] - Whether to show plain styling without background.
770
- * @param {boolean} [props.naked=false] - Whether to show the naked styling.
771
- * @param {"mini" | "small" | "medium" | "large" | "stepper"} [props.size='medium'] - Size of the button ('mini', 'small', 'medium', 'large', 'stepper').
772
- * @param {boolean} [props.fullWidth] - Whether the button should take full width.
773
- * @param {"left" | "center" | "right"} [props.align='center'] - Alignment of the button content ('left', 'center', 'right').
774
- * @param {string} [props.tooltip] - Tooltip to show when hovering over the button.
775
- * @param {"left" | "center" | "right"} [props.tooltipAlignment='right'] - Alignment of the tooltip ('left', 'center', 'right').
776
- * @param {"above" | "below" | "left" | "right"} [props.tooltipPosition='above'] - Position of the tooltip ('above', 'below', 'left', 'right').
777
- * @param {"inline-block" | "block" | "inline"} [props.tooltipDisplay='inline-block'] - Display type of the tooltip ('inline-block', 'block', 'inline').
778
- * @param {Object} [props.connectedDisclosure] - Configuration for connected disclosure menu.
779
- * @param {Array<import("./ActionList").ActionListItem>} [props.connectedDisclosure.actions] - Actions to show in the disclosure menu.
780
- * @param {string} [props.className] - Additional CSS classes for the button.
781
- * @param {string} [props.contentClassName] - Additional CSS classes for the button content.
782
- * @param {boolean} [props.rounded] - Whether to show fully rounded corners.
783
- * @param {Function} [props.onClick] - Callback when the button is clicked.
784
- * @param {Function} [props.onMouseDown] - Callback when the mouse is pressed on the button.
785
- *
786
- * @returns {JSX.Element} The rendered Button component.
787
- *
788
- * @example
789
- * ```js
790
- * // Basic button
791
- * <Button onClick={() => console.log('Clicked')}>
792
- * Click me
793
- * </Button>
794
- * ```
795
- *
796
- * @example
797
- * ```js
798
- * // Primary button with icon and loading state
799
- * <Button
800
- * primary
801
- * loading={isLoading}
802
- * icon={SaveMinor}
803
- * onClick={handleSave}
804
- * >
805
- * Save changes
806
- * </Button>
807
- * ```
808
- *
809
- * @example
810
- * ```js
811
- * // Button with connected disclosure
812
- * <Button
813
- * connectedDisclosure={{
814
- * actions: [
815
- * { content: 'Option 1', onAction: () => {} },
816
- * { content: 'Option 2', onAction: () => {} }
817
- * ]
818
- * }}
819
- * >
820
- * More actions
821
- * </Button>
822
- * ```
823
- */ function Button() {
1017
+ function Button() {
824
1018
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
825
1019
  var darkMode = useDarkMode().darkMode;
826
1020
  var _useState = _sliced_to_array(useState(false), 2), showConnectedDisclosurePopover = _useState[0], setShowConnectedDisclosurePopover = _useState[1];
827
- var id = props.id, children = props.children, url = props.url, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, external = props.external, target = props.target, submit = props.submit, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, _props_pressed = props.pressed, pressed = _props_pressed === void 0 ? false : _props_pressed, accessibilityLabel = props.accessibilityLabel, role = props.role, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaDescribedBy = props.ariaDescribedBy, ariaChecked = props.ariaChecked, icon = props.icon, _iconColor = props.iconColor, _props_iconSize = props.iconSize, iconSize = _props_iconSize === void 0 ? "default" : _props_iconSize, _props_bordered = props.bordered, bordered = _props_bordered === void 0 ? false : _props_bordered, _props_primary = props.primary, primary = _props_primary === void 0 ? false : _props_primary, _props_highlight = props.highlight, highlight = _props_highlight === void 0 ? false : _props_highlight, _props_link = props.link, link = _props_link === void 0 ? false : _props_link, _props_destructive = props.destructive, destructive = _props_destructive === void 0 ? false : _props_destructive, _props_disclosure = props.disclosure, disclosure = _props_disclosure === void 0 ? false : _props_disclosure, _props_disclosureRight = props.disclosureRight, disclosureRight = _props_disclosureRight === void 0 ? false : _props_disclosureRight, _props_insight = props.insight, insight = _props_insight === void 0 ? false : _props_insight, _props_plain = props.plain, plain = _props_plain === void 0 ? false : _props_plain, _props_naked = props.naked, naked = _props_naked === void 0 ? false : _props_naked, _props_size = props.size, size = _props_size === void 0 ? "medium" : _props_size, fullWidth = props.fullWidth, _props_align = props.align, align = _props_align === void 0 ? "center" : _props_align, connectedDisclosure = props.connectedDisclosure, className = props.className, contentClassName = props.contentClassName, rounded = props.rounded, onClick = props.onClick, onMouseDown = props.onMouseDown, tooltip = props.tooltip, _props_tooltipAlignment = props.tooltipAlignment, tooltipAlignment = _props_tooltipAlignment === void 0 ? "right" : _props_tooltipAlignment, _props_tooltipPosition = props.tooltipPosition, tooltipPosition = _props_tooltipPosition === void 0 ? "above" : _props_tooltipPosition, _props_tooltipDisplay = props.tooltipDisplay, tooltipDisplay = _props_tooltipDisplay === void 0 ? "inline-block" : _props_tooltipDisplay, shadow = props.shadow, restProps = _object_without_properties(props, [
1021
+ var id = props.id, children = props.children, url = props.url, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, external = props.external, target = props.target, submit = props.submit, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, _props_pressed = props.pressed, pressed = _props_pressed === void 0 ? false : _props_pressed, accessibilityLabel = props.accessibilityLabel, role = props.role, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaDescribedBy = props.ariaDescribedBy, ariaChecked = props.ariaChecked, hasIconProp = props.hasIcon, icon = props.icon, _iconColor = props.iconColor, _props_iconSize = props.iconSize, iconSize = _props_iconSize === void 0 ? "default" : _props_iconSize, _props_iconPosition = props.iconPosition, iconPosition = _props_iconPosition === void 0 ? "left" : _props_iconPosition, _props_bordered = props.bordered, bordered = _props_bordered === void 0 ? false : _props_bordered, _props_primary = props.primary, primary = _props_primary === void 0 ? false : _props_primary, _props_highlight = props.highlight, highlight = _props_highlight === void 0 ? false : _props_highlight, _props_link = props.link, link = _props_link === void 0 ? false : _props_link, _props_destructive = props.destructive, destructive = _props_destructive === void 0 ? false : _props_destructive, _props_disclosure = props.disclosure, disclosure = _props_disclosure === void 0 ? false : _props_disclosure, _props_disclosureRight = props.disclosureRight, disclosureRight = _props_disclosureRight === void 0 ? false : _props_disclosureRight, _props_insight = props.insight, insight = _props_insight === void 0 ? false : _props_insight, _props_plain = props.plain, plain = _props_plain === void 0 ? false : _props_plain, _props_naked = props.naked, naked = _props_naked === void 0 ? false : _props_naked, _props_outline = props.outline, outline = _props_outline === void 0 ? false : _props_outline, _props_size = props.size, size = _props_size === void 0 ? "medium" : _props_size, fullWidth = props.fullWidth, _props_fullWidthAlignment = props.fullWidthAlignment, fullWidthAlignment = _props_fullWidthAlignment === void 0 ? "left" : _props_fullWidthAlignment, _props_align = props.align, align = _props_align === void 0 ? "center" : _props_align, connectedDisclosure = props.connectedDisclosure, className = props.className, contentClassName = props.contentClassName, rounded = props.rounded, onClick = props.onClick, onMouseDown = props.onMouseDown, tooltip = props.tooltip, _props_tooltipAlignment = props.tooltipAlignment, tooltipAlignment = _props_tooltipAlignment === void 0 ? "right" : _props_tooltipAlignment, _props_tooltipPosition = props.tooltipPosition, tooltipPosition = _props_tooltipPosition === void 0 ? "above" : _props_tooltipPosition, _props_tooltipDisplay = props.tooltipDisplay, tooltipDisplay = _props_tooltipDisplay === void 0 ? "inline-block" : _props_tooltipDisplay, shadow = props.shadow, restProps = _object_without_properties(props, [
828
1022
  "id",
829
1023
  "children",
830
1024
  "url",
@@ -840,9 +1034,11 @@ var connectedDisclosureStyles = tv({
840
1034
  "ariaExpanded",
841
1035
  "ariaDescribedBy",
842
1036
  "ariaChecked",
1037
+ "hasIcon",
843
1038
  "icon",
844
1039
  "iconColor",
845
1040
  "iconSize",
1041
+ "iconPosition",
846
1042
  "bordered",
847
1043
  "primary",
848
1044
  "highlight",
@@ -853,8 +1049,10 @@ var connectedDisclosureStyles = tv({
853
1049
  "insight",
854
1050
  "plain",
855
1051
  "naked",
1052
+ "outline",
856
1053
  "size",
857
1054
  "fullWidth",
1055
+ "fullWidthAlignment",
858
1056
  "align",
859
1057
  "connectedDisclosure",
860
1058
  "className",
@@ -868,7 +1066,7 @@ var connectedDisclosureStyles = tv({
868
1066
  "tooltipDisplay",
869
1067
  "shadow"
870
1068
  ]);
871
- var hasIcon = !!icon;
1069
+ var hasIcon = hasIconProp !== null && hasIconProp !== void 0 ? hasIconProp : !!icon;
872
1070
  var hasChildren = !!children;
873
1071
  var insideButtonGroup = useContext(ButtonGroupContext);
874
1072
  var base = disabled || loading ? "-disabled-icon" : "-icon";
@@ -882,10 +1080,11 @@ var connectedDisclosureStyles = tv({
882
1080
  insight: "btn-insight".concat(base),
883
1081
  default: "btn-secondary".concat(base)
884
1082
  };
885
- var iconColor = iconColorMap[primary ? "primary" : plain ? "plain" : link ? "link" : destructive ? "destructive" : highlight ? "highlight" : insight ? "insight" : "default"];
1083
+ var iconColor = iconColorMap[primary ? "primary" : plain ? "plain" : outline ? "plain" : link ? "link" : destructive ? "destructive" : highlight ? "highlight" : insight ? "insight" : "default"];
886
1084
  var iconOnly = hasIcon && !hasChildren;
887
1085
  var connectedDisclosureActions = (connectedDisclosure === null || connectedDisclosure === void 0 ? void 0 : connectedDisclosure.actions) || [];
888
- var showConnectedDisclosure = connectedDisclosure && connectedDisclosureActions.length > 0;
1086
+ var connectedDisclosureSections = (connectedDisclosure === null || connectedDisclosure === void 0 ? void 0 : connectedDisclosure.sections) || null;
1087
+ var showConnectedDisclosure = connectedDisclosure && (connectedDisclosureActions.length > 0 || (connectedDisclosureSections === null || connectedDisclosureSections === void 0 ? void 0 : connectedDisclosureSections.length) > 0);
889
1088
  var classes = styles({
890
1089
  primary: primary,
891
1090
  plain: plain,
@@ -906,7 +1105,8 @@ var connectedDisclosureStyles = tv({
906
1105
  darkMode: darkMode,
907
1106
  bordered: bordered,
908
1107
  align: align,
909
- naked: naked
1108
+ naked: naked,
1109
+ outline: outline
910
1110
  });
911
1111
  var contentClasses = contentStyles({
912
1112
  disclosure: disclosure,
@@ -914,12 +1114,18 @@ var connectedDisclosureStyles = tv({
914
1114
  hasChildren: hasChildren,
915
1115
  size: size,
916
1116
  iconOnly: iconOnly,
917
- naked: naked
1117
+ naked: naked,
1118
+ iconPosition: iconPosition,
1119
+ fullWidth: fullWidth,
1120
+ fullWidthAlignment: fullWidthAlignment
1121
+ });
1122
+ var iconClasses = iconStyles({
1123
+ loading: loading
918
1124
  });
919
- var iconClasses = iconStyles();
920
1125
  var textClasses = textStyles({
921
1126
  primary: primary,
922
1127
  plain: plain,
1128
+ outline: outline,
923
1129
  link: link,
924
1130
  destructive: destructive,
925
1131
  highlight: highlight,
@@ -927,7 +1133,11 @@ var connectedDisclosureStyles = tv({
927
1133
  pressed: pressed,
928
1134
  loading: loading,
929
1135
  disabled: disabled,
930
- naked: naked
1136
+ naked: naked,
1137
+ fullWidth: fullWidth,
1138
+ disclosure: disclosure,
1139
+ fullWidthAlignment: fullWidthAlignment,
1140
+ size: size
931
1141
  });
932
1142
  var connectedDisclosureClasses = connectedDisclosureStyles({
933
1143
  primary: primary,
@@ -972,7 +1182,7 @@ var connectedDisclosureStyles = tv({
972
1182
  color: "subdued"
973
1183
  })
974
1184
  }),
975
- memoizedIcon && /*#__PURE__*/ _jsx("span", {
1185
+ iconPosition === "left" && memoizedIcon && /*#__PURE__*/ _jsx("span", {
976
1186
  className: iconClasses,
977
1187
  children: /*#__PURE__*/ _jsx(Icon, {
978
1188
  source: memoizedIcon,
@@ -984,8 +1194,16 @@ var connectedDisclosureStyles = tv({
984
1194
  className: textClasses,
985
1195
  children: children
986
1196
  }),
1197
+ iconPosition === "right" && memoizedIcon && /*#__PURE__*/ _jsx("span", {
1198
+ className: iconClasses,
1199
+ children: /*#__PURE__*/ _jsx(Icon, {
1200
+ source: memoizedIcon,
1201
+ color: disabled ? "disabled" : _iconColor || iconColor,
1202
+ size: iconSize
1203
+ })
1204
+ }),
987
1205
  disclosure && /*#__PURE__*/ _jsx("span", {
988
- className: "Litho-Button__DisclosureIcon relative -left-0.5",
1206
+ className: "Litho-Button__DisclosureIcon relative -left-0.5".concat(loading ? " invisible" : ""),
989
1207
  children: /*#__PURE__*/ _jsx(Icon, {
990
1208
  source: CaretDownMinor,
991
1209
  color: disabled ? "disabled" : _iconColor || iconColor,
@@ -1013,6 +1231,7 @@ var connectedDisclosureStyles = tv({
1013
1231
  },
1014
1232
  preferredAlignment: "right",
1015
1233
  preferredPosition: "below",
1234
+ activatorDisplayType: "flex",
1016
1235
  activator: /*#__PURE__*/ _jsx(Button, {
1017
1236
  primary: primary,
1018
1237
  plain: plain,
@@ -1020,20 +1239,30 @@ var connectedDisclosureStyles = tv({
1020
1239
  destructive: destructive,
1021
1240
  highlight: highlight,
1022
1241
  insight: insight,
1242
+ size: size,
1023
1243
  icon: CaretDownMinor,
1024
1244
  disclosureRight: true,
1025
1245
  iconColor: _iconColor,
1246
+ disabled: disabled || (connectedDisclosure === null || connectedDisclosure === void 0 ? void 0 : connectedDisclosure.disabled),
1026
1247
  className: primary ? "border-l border-l-tint-alt-6!" : undefined,
1248
+ onMouseDown: function(e) {
1249
+ return e.preventDefault();
1250
+ },
1027
1251
  onClick: function() {
1028
- return setShowConnectedDisclosurePopover(!showConnectedDisclosurePopover);
1252
+ return setShowConnectedDisclosurePopover(function(prev) {
1253
+ return !prev;
1254
+ });
1029
1255
  }
1030
1256
  }),
1031
- children: /*#__PURE__*/ _jsx(ActionList, {
1032
- items: connectedDisclosureActions,
1257
+ children: /*#__PURE__*/ _jsx(ActionList, _object_spread_props(_object_spread({}, connectedDisclosureSections ? {
1258
+ sections: connectedDisclosureSections
1259
+ } : {
1260
+ items: connectedDisclosureActions
1261
+ }), {
1033
1262
  onActionAnyItem: function() {
1034
1263
  return setShowConnectedDisclosurePopover(false);
1035
1264
  }
1036
- })
1265
+ }))
1037
1266
  })
1038
1267
  ]
1039
1268
  });