@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
@@ -51,7 +51,44 @@ import { MobileAcceptMajor } from "@shopify/polaris-icons";
51
51
  import { tv } from "tailwind-variants";
52
52
  import Icon from "./Icon.js";
53
53
  import { useFrame } from "./Frame.js";
54
- var styles = tv({
54
+ /**
55
+ * @component Listbox
56
+ *
57
+ * @description A selectable list component that renders options as interactive items with optional icons and descriptions.
58
+ *
59
+ * @usage
60
+ * - DO: Use for custom-styled selection lists with full keyboard navigation.
61
+ * - DON'T: Use for simple dropdowns (use Select).
62
+ *
63
+ * @accessibility
64
+ * - Implements listbox ARIA pattern with keyboard arrow navigation and selection.
65
+ *
66
+ * @alternative
67
+ * - If you need a native dropdown, use `Select`. If you need a searchable list, use `Autocomplete`.
68
+ *
69
+ * @param {Object} props - The properties object.
70
+ * @param {Array<Object>} props.options - Array of options to render in the listbox.
71
+ * Each option should be an object with the following properties:
72
+ * - `label` {string}: The display label of the option.
73
+ * - `value` {string | number}: The unique value of the option.
74
+ * - `icon` {React.ComponentType | string} [optional]: Icon source (Polaris, Lucide component, or string) rendered via `<Icon>`. Colors automatically based on selected state.
75
+ * - `showIconOnMobile` {boolean} [optional, default: true]: When false, the option icon is hidden on mobile and only shown at md (≥800px) breakpoint.
76
+ * - `selected` {boolean}: Whether the option is currently selected.
77
+ * - `onAction` {function}: A callback function invoked when the option is clicked or "Enter" is pressed.
78
+ * @param {boolean} [props.showIcon=false] - Determines whether to display an icon next to selected options.
79
+ * @param {React.ReactNode} [props.icon=MobileAcceptMajor] - The icon to display for selected options (default is `MobileAcceptMajor`).
80
+ * @param {boolean} [props.displayHorizontallyOnMobile=false] - Determines whether to display the listbox horizontally on mobile.
81
+ *
82
+ * @example
83
+ * const options = [
84
+ * { label: "Option 1", value: "opt1", selected: false, onAction: () => console.log("Option 1 clicked") },
85
+ * { label: "Option 2", value: "opt2", selected: true, onAction: () => console.log("Option 2 clicked") },
86
+ * ];
87
+ *
88
+ * <Listbox options={options} showIcon={true} icon={CustomIcon} />
89
+ *
90
+ * @returns {JSX.Element} The rendered Listbox component.
91
+ */ var styles = tv({
55
92
  base: "Litho-Listbox__Option rounded-md cursor-pointer min-h-8 py-1 flex items-center justify-between pl-3 focus:outline-hidden active:ring-0",
56
93
  variants: {
57
94
  showIcon: {
@@ -80,32 +117,7 @@ var containerStyles = tv({
80
117
  displayHorizontallyOnMobile: false
81
118
  }
82
119
  });
83
- /**
84
- * A customizable Listbox component for displaying a list of options with selectable states.
85
- * The component supports keyboard navigation and optional icons for selected items.
86
- *
87
- * @component
88
- * @param {Object} props - The properties object.
89
- * @param {Array<Object>} props.options - Array of options to render in the listbox.
90
- * Each option should be an object with the following properties:
91
- * - `label` {string}: The display label of the option.
92
- * - `value` {string | number}: The unique value of the option.
93
- * - `selected` {boolean}: Whether the option is currently selected.
94
- * - `onAction` {function}: A callback function invoked when the option is clicked or "Enter" is pressed.
95
- * @param {boolean} [props.showIcon=false] - Determines whether to display an icon next to selected options.
96
- * @param {React.ReactNode} [props.icon=MobileAcceptMajor] - The icon to display for selected options (default is `MobileAcceptMajor`).
97
- * @param {boolean} [props.displayHorizontallyOnMobile=false] - Determines whether to display the listbox horizontally on mobile.
98
- *
99
- * @example
100
- * const options = [
101
- * { label: "Option 1", value: "opt1", selected: false, onAction: () => console.log("Option 1 clicked") },
102
- * { label: "Option 2", value: "opt2", selected: true, onAction: () => console.log("Option 2 clicked") },
103
- * ];
104
- *
105
- * <Listbox options={options} showIcon={true} icon={CustomIcon} />
106
- *
107
- * @returns {JSX.Element} The rendered Listbox component.
108
- */ function Listbox() {
120
+ function Listbox() {
109
121
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
110
122
  var options = props.options, _props_showIcon = props.showIcon, showIcon = _props_showIcon === void 0 ? false : _props_showIcon, _props_displayHorizontallyOnMobile = props.displayHorizontallyOnMobile, displayHorizontallyOnMobile = _props_displayHorizontallyOnMobile === void 0 ? false : _props_displayHorizontallyOnMobile, _props_icon = props.icon, icon = _props_icon === void 0 ? MobileAcceptMajor : _props_icon;
111
123
  var screenSizes = useFrame().screenSizes;
@@ -161,7 +173,7 @@ var containerStyles = tv({
161
173
  displayHorizontallyOnMobile: displayHorizontallyOnMobile
162
174
  }),
163
175
  children: options.map(function(option, index) {
164
- var selected = option.selected, label = option.label, value = option.value, onAction = option.onAction;
176
+ var selected = option.selected, label = option.label, value = option.value, optionIcon = option.icon, _option_showIconOnMobile = option.showIconOnMobile, showIconOnMobile = _option_showIconOnMobile === void 0 ? true : _option_showIconOnMobile, onAction = option.onAction;
165
177
  var classes = styles({
166
178
  selected: selected,
167
179
  showIcon: showIcon,
@@ -182,9 +194,19 @@ var containerStyles = tv({
182
194
  return handleKeyDown(e, index);
183
195
  },
184
196
  children: [
185
- /*#__PURE__*/ _jsx("div", {
186
- className: "whitespace-nowrap pointer-events-none w-full",
187
- children: label
197
+ /*#__PURE__*/ _jsxs("div", {
198
+ className: "flex items-center gap-2 whitespace-nowrap pointer-events-none w-full",
199
+ children: [
200
+ optionIcon && /*#__PURE__*/ _jsx("span", {
201
+ className: showIconOnMobile ? "" : "hidden @md:inline-flex",
202
+ children: /*#__PURE__*/ _jsx(Icon, {
203
+ source: optionIcon,
204
+ color: selected ? "active" : "subdued",
205
+ size: "sm"
206
+ })
207
+ }),
208
+ label
209
+ ]
188
210
  }),
189
211
  showIcon && /*#__PURE__*/ _jsx("div", {
190
212
  className: "w-5 h-5 pointer-events-none",
@@ -48,9 +48,21 @@ function _unsupported_iterable_to_array(o, minLen) {
48
48
  import { jsx as _jsx } from "react/jsx-runtime";
49
49
  import { useEffect, useState } from "react";
50
50
  /**
51
- * A loading progress bar component that animates over a specified duration.
51
+ * @component Loading
52
+ *
53
+ * @description A page-level progress bar that animates across the top of the viewport during navigation or data fetching.
54
+ *
55
+ * @usage
56
+ * - DO: Use as a page-level loading indicator at the top of the viewport during navigation or data fetching.
57
+ * - DON'T: Use for inline or localized loading states; use `Spinner` for those cases.
58
+ *
59
+ * @accessibility
60
+ * - The progress bar is purely visual; pair with `aria-busy` on the loading container if screen reader announcements are needed.
61
+ *
62
+ * @alternative
63
+ * - If you need an inline loading indicator, use `Spinner` instead.
64
+ * - If you need placeholder content while data loads, use `SkeletonText` instead.
52
65
  *
53
- * @component
54
66
  * @param {Object} props - The props object.
55
67
  * @param {number} [props.maxDuration=10000] - The maximum duration (in milliseconds) for the loading progress bar to reach 100%.
56
68
  * @returns {JSX.Element} A fixed progress bar displayed at the top of the page.
@@ -61,9 +61,69 @@ import Text from "./Text.js";
61
61
  import Tooltip from "./Tooltip.js";
62
62
  import { useFrame } from "./Frame.js";
63
63
  import { useBodyScrollLock } from "../utilities/useBodyScrollLock.js";
64
- export var ModalContext = /*#__PURE__*/ createContext(false);
64
+ /**
65
+ * @component Modal
66
+ *
67
+ * @description A dialog overlay that focuses the user on a specific task or confirmation, with header, body sections, and footer actions.
68
+ *
69
+ * @usage
70
+ * - DO: Use for focused tasks that require user attention or input, like confirmations or forms.
71
+ * - DON'T: Use for content that should remain accessible while reading the page (use Pane).
72
+ *
73
+ * @accessibility
74
+ * - Traps focus within the modal when open; supports Escape key dismissal.
75
+ * - Ensure `title` provides context for screen readers.
76
+ *
77
+ * @alternative
78
+ * - If you need a side panel that doesn't block the page, use `Pane`.
79
+ * - If you need inline messaging, use `Banner`.
80
+ *
81
+ * @param {Object} props - The component props.
82
+ * @param {React.ReactNode} [props.children] - The content of the modal.
83
+ * @param {string} [props.title] - The title of the modal.
84
+ * @param {string} [props.subtitle] - The subtitle of the modal.
85
+ * @param {boolean} [props.open=false] - Whether the modal is open.
86
+ * @param {Function} [props.onClose] - Callback function for closing the modal.
87
+ * @param {boolean} [props.sectioned=false] - Whether the modal content should be sectioned.
88
+ * @param {Object} [props.primaryAction] - The primary action for the modal.
89
+ * @param {string} [props.primaryAction.content] - Content of the primary action button.
90
+ * @param {Function} [props.primaryAction.onAction] - Callback for the primary action.
91
+ * @param {boolean} [props.primaryAction.loading=false] - Whether the primary action is loading.
92
+ * @param {boolean} [props.primaryAction.disabled=false] - Whether the primary action is disabled.
93
+ * @param {boolean} [props.primaryAction.destructive=false] - Whether the primary action is destructive.
94
+ * @param {Object} [props.secondaryAction] - The secondary action for the modal.
95
+ * @param {string} [props.secondaryAction.content] - Content of the secondary action button.
96
+ * @param {Function} [props.secondaryAction.onAction] - Callback for the secondary action.
97
+ * @param {boolean} [props.secondaryAction.disabled=false] - Whether the secondary action is disabled.
98
+ * @param {Object[]} [props.secondaryActions=[]] - Additional secondary actions.
99
+ * @param {Object} [props.destructiveAction] - A destructive action for the modal.
100
+ * @param {boolean} [props.loading=false] - Whether the modal is in a loading state.
101
+ * @param {string} [props.size="default"] - The size of the modal (default, large, or full).
102
+ * @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
103
+ * @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
104
+ * @param {Function} [props.backAction] - Callback function for the back button. When provided, displays a back button next to the title.
105
+ * @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
106
+ * @param {boolean} [props.autoFocusFirstInput=true] - Whether to focus the first input when the modal opens.
107
+ * @param {boolean} [props.pinToTop=false] - Whether to pin the modal to the top of the viewport instead of centering it vertically. Useful when modal content changes height dynamically.
108
+ * @param {string} [props.bodyClassName] - Additional CSS classes to apply to the modal body.
109
+ * @returns {React.ReactPortal|null} The rendered modal component or null if not open.
110
+ */ export var ModalContext = /*#__PURE__*/ createContext(false);
65
111
  var containerStyles = tv({
66
- base: "Litho-ModalContainer fixed inset-0 block flex flex-col justify-end md:justify-center items-center pointer-events-none"
112
+ base: "Litho-ModalContainer fixed inset-0 block flex flex-col justify-end items-center pointer-events-none",
113
+ variants: {
114
+ hidden: {
115
+ true: "hidden opacity-0 pointer-events-none",
116
+ false: ""
117
+ },
118
+ pinToTop: {
119
+ true: "md:justify-start md:py-5",
120
+ false: "md:justify-center"
121
+ }
122
+ },
123
+ defaultVariants: {
124
+ hidden: false,
125
+ pinToTop: false
126
+ }
67
127
  });
68
128
  var styles = tv({
69
129
  base: "Litho-Modal relative bg-surface-highest shadow-modal dark:shadow-modal-dark w-full mx-auto pointer-events-auto flex flex-col overflow-hidden",
@@ -109,40 +169,9 @@ var sectionStyles = tv({
109
169
  flush: false
110
170
  }
111
171
  });
112
- /**
113
- * Modal component for displaying a customizable dialog.
114
- *
115
- * @param {Object} props - The component props.
116
- * @param {React.ReactNode} [props.children] - The content of the modal.
117
- * @param {string} [props.title] - The title of the modal.
118
- * @param {string} [props.subtitle] - The subtitle of the modal.
119
- * @param {boolean} [props.open=false] - Whether the modal is open.
120
- * @param {Function} [props.onClose] - Callback function for closing the modal.
121
- * @param {boolean} [props.sectioned=false] - Whether the modal content should be sectioned.
122
- * @param {Object} [props.primaryAction] - The primary action for the modal.
123
- * @param {string} [props.primaryAction.content] - Content of the primary action button.
124
- * @param {Function} [props.primaryAction.onAction] - Callback for the primary action.
125
- * @param {boolean} [props.primaryAction.loading=false] - Whether the primary action is loading.
126
- * @param {boolean} [props.primaryAction.disabled=false] - Whether the primary action is disabled.
127
- * @param {boolean} [props.primaryAction.destructive=false] - Whether the primary action is destructive.
128
- * @param {Object} [props.secondaryAction] - The secondary action for the modal.
129
- * @param {string} [props.secondaryAction.content] - Content of the secondary action button.
130
- * @param {Function} [props.secondaryAction.onAction] - Callback for the secondary action.
131
- * @param {boolean} [props.secondaryAction.disabled=false] - Whether the secondary action is disabled.
132
- * @param {Object[]} [props.secondaryActions=[]] - Additional secondary actions.
133
- * @param {Object} [props.destructiveAction] - A destructive action for the modal.
134
- * @param {boolean} [props.loading=false] - Whether the modal is in a loading state.
135
- * @param {string} [props.size="default"] - The size of the modal (default, large, or full).
136
- * @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
137
- * @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
138
- * @param {Function} [props.backAction] - Callback function for the back button. When provided, displays a back button next to the title.
139
- * @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
140
- * @param {boolean} [props.autoFocusFirstInput=true] - Whether to focus the first input when the modal opens.
141
- * @param {string} [props.bodyClassName] - Additional CSS classes to apply to the modal body.
142
- * @returns {React.ReactPortal|null} The rendered modal component or null if not open.
143
- */ function Modal() {
172
+ function Modal() {
144
173
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
145
- var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride, _props_autoFocusFirstInput = props.autoFocusFirstInput, autoFocusFirstInput = _props_autoFocusFirstInput === void 0 ? true : _props_autoFocusFirstInput, bodyClassName = props.bodyClassName;
174
+ var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, _props_hidden = props.hidden, hidden = _props_hidden === void 0 ? false : _props_hidden, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride, _props_autoFocusFirstInput = props.autoFocusFirstInput, autoFocusFirstInput = _props_autoFocusFirstInput === void 0 ? true : _props_autoFocusFirstInput, _props_pinToTop = props.pinToTop, pinToTop = _props_pinToTop === void 0 ? false : _props_pinToTop, bodyClassName = props.bodyClassName;
146
175
  var setModalIsOpen = useFrame().setModalIsOpen;
147
176
  var modalContentRef = useRef(null);
148
177
  var hasChildren = !!children;
@@ -150,7 +179,10 @@ var sectionStyles = tv({
150
179
  sectioned: sectioned,
151
180
  size: size
152
181
  });
153
- var containerClasses = containerStyles();
182
+ var containerClasses = containerStyles({
183
+ hidden: hidden,
184
+ pinToTop: pinToTop
185
+ });
154
186
  var headerClasses = headerStyles({
155
187
  hasChildren: hasChildren
156
188
  });
@@ -159,7 +191,7 @@ var sectionStyles = tv({
159
191
  var _useState = _sliced_to_array(useState(null), 2), container = _useState[0], setContainer = _useState[1];
160
192
  useEffect(function() {
161
193
  var div = document.createElement("div");
162
- div.className = "@container Litho-ModalPortal";
194
+ div.className = "@container/main Litho-ModalPortal";
163
195
  setContainer(div);
164
196
  document.body.appendChild(div);
165
197
  return function() {
@@ -302,6 +334,7 @@ var sectionStyles = tv({
302
334
  onClick: primaryAction.onAction,
303
335
  loading: primaryAction.loading,
304
336
  disabled: primaryAction.disabled,
337
+ insight: primaryAction.insight,
305
338
  destructive: primaryAction.destructive,
306
339
  url: primaryAction.url,
307
340
  tooltip: primaryAction.tooltip,
@@ -318,6 +351,7 @@ var sectionStyles = tv({
318
351
  /*#__PURE__*/ _jsx("div", {
319
352
  className: overlayClasses,
320
353
  onClick: onClose,
354
+ "aria-hidden": "true",
321
355
  style: zIndexOverride ? {
322
356
  zIndex: zIndexOverride - 1
323
357
  } : {}
@@ -326,19 +360,24 @@ var sectionStyles = tv({
326
360
  }), container);
327
361
  }
328
362
  /**
329
- * Section component for use within the Modal.
363
+ * @component Modal.Section
364
+ *
365
+ * @usage
366
+ * - DO: Divide modal content into bordered sections for visual separation.
330
367
  *
331
368
  * @param {Object} props - The component props.
332
369
  * @param {React.ReactNode} [props.children] - The content of the section.
333
370
  * @param {boolean} [props.flush=false] - Whether the section should be flush with no padding.
371
+ * @param {string} [props.className] - Additional CSS classes to apply to the section.
334
372
  * @returns {JSX.Element} The rendered section.
335
373
  */ function Section() {
336
374
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
337
- var children = props.children, flush = props.flush, title = props.title, _props_titleVariant = props.titleVariant, titleVariant = _props_titleVariant === void 0 ? "headingSm" : _props_titleVariant, description = props.description, action = props.action, icon = props.icon, accessory = props.accessory, tooltip = props.tooltip;
375
+ var children = props.children, flush = props.flush, title = props.title, _props_titleVariant = props.titleVariant, titleVariant = _props_titleVariant === void 0 ? "headingSm" : _props_titleVariant, description = props.description, action = props.action, icon = props.icon, accessory = props.accessory, tooltip = props.tooltip, className = props.className;
338
376
  var showHeader = !!(title || action);
339
377
  var sectionClasses = sectionStyles({
340
378
  flush: flush,
341
- showHeader: showHeader
379
+ showHeader: showHeader,
380
+ className: className
342
381
  });
343
382
  return /*#__PURE__*/ _jsxs("div", {
344
383
  className: sectionClasses,
@@ -26,6 +26,30 @@ function _object_spread(target) {
26
26
  }
27
27
  return target;
28
28
  }
29
+ function ownKeys(object, enumerableOnly) {
30
+ var keys = Object.keys(object);
31
+ if (Object.getOwnPropertySymbols) {
32
+ var symbols = Object.getOwnPropertySymbols(object);
33
+ if (enumerableOnly) {
34
+ symbols = symbols.filter(function(sym) {
35
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
36
+ });
37
+ }
38
+ keys.push.apply(keys, symbols);
39
+ }
40
+ return keys;
41
+ }
42
+ function _object_spread_props(target, source) {
43
+ source = source != null ? source : {};
44
+ if (Object.getOwnPropertyDescriptors) {
45
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
46
+ } else {
47
+ ownKeys(Object(source)).forEach(function(key) {
48
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
49
+ });
50
+ }
51
+ return target;
52
+ }
29
53
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
30
54
  import React from "react";
31
55
  import { tv } from "tailwind-variants";
@@ -34,7 +58,34 @@ import Icon from "./Icon.js";
34
58
  import Text from "./Text.js";
35
59
  import { ChevronLeftMinor, ChevronRightMinor, ExternalMinor } from "@shopify/polaris-icons";
36
60
  import { useFrame } from "./Frame.js";
37
- var styles = tv({
61
+ /**
62
+ * @component Navigation
63
+ *
64
+ * @description A sidebar navigation component that renders a vertical list of links and sections for primary app navigation within a Frame.
65
+ *
66
+ * @usage
67
+ * - DO: Use as the primary navigation sidebar within a Frame layout.
68
+ * - DON'T: Use for in-page content tabs (use Tabs).
69
+ *
70
+ * @accessibility
71
+ * - Renders as a `<nav>` element; ensure navigation items have descriptive labels.
72
+ *
73
+ * @alternative
74
+ * - If you need in-page tab switching, use `Tabs`. If you need a top bar, use `TopBar`.
75
+ *
76
+ * @param {Object} props - Component properties.
77
+ * @param {Object} [props.breadcrumb] - Breadcrumb navigation item.
78
+ * @param {string} [props.breadcrumb.content] - Label for the breadcrumb.
79
+ * @param {Function} [props.breadcrumb.onAction] - Callback for breadcrumb action.
80
+ * @param {Array<Object>} [props.sections] - Array of navigation sections.
81
+ * @param {Object} [props.sections[].title] - Section title configuration.
82
+ * @param {string} [props.sections[].title.label] - Title label.
83
+ * @param {boolean} [props.sections[].title.selected] - Whether the title is selected.
84
+ * @param {Function} [props.sections[].title.onAction] - Callback for title action.
85
+ * @param {Array<Object>} [props.sections[].links] - Array of link configurations for the section.
86
+ * @param {Array<Object>} [props.footerLinks] - Array of footer link configurations.
87
+ * @returns {JSX.Element} The rendered Navigation component.
88
+ */ var styles = tv({
38
89
  base: "Litho-Navigation h-full w-full pt-12 @md:pt-0 pr-2.5 pb-3 @md:pb-0 flex flex-col gap-2 justify-between bg-surface-normal"
39
90
  });
40
91
  var sectionStyles = tv({
@@ -51,24 +102,7 @@ var titleStyles = tv({
51
102
  }
52
103
  }
53
104
  });
54
- /**
55
- * Navigation component.
56
- * A sidebar navigation component for displaying links, sections, and footer links.
57
- *
58
- * @component
59
- * @param {Object} props - Component properties.
60
- * @param {Object} [props.breadcrumb] - Breadcrumb navigation item.
61
- * @param {string} [props.breadcrumb.content] - Label for the breadcrumb.
62
- * @param {Function} [props.breadcrumb.onAction] - Callback for breadcrumb action.
63
- * @param {Array<Object>} [props.sections] - Array of navigation sections.
64
- * @param {Object} [props.sections[].title] - Section title configuration.
65
- * @param {string} [props.sections[].title.label] - Title label.
66
- * @param {boolean} [props.sections[].title.selected] - Whether the title is selected.
67
- * @param {Function} [props.sections[].title.onAction] - Callback for title action.
68
- * @param {Array<Object>} [props.sections[].links] - Array of link configurations for the section.
69
- * @param {Array<Object>} [props.footerLinks] - Array of footer link configurations.
70
- * @returns {JSX.Element} The rendered Navigation component.
71
- */ function Navigation() {
105
+ function Navigation() {
72
106
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
73
107
  var breadcrumb = props.breadcrumb, sections = props.sections, footerLinks = props.footerLinks;
74
108
  var setShowMobileNavigation = useFrame().setShowMobileNavigation;
@@ -90,7 +124,7 @@ var titleStyles = tv({
90
124
  })
91
125
  }),
92
126
  sections && sections.map(function(section, index) {
93
- var _section_title, _section_title1;
127
+ var _section_title, _section_title1, _section_title2;
94
128
  if (!section.links) return null;
95
129
  var titleClasses = titleStyles({
96
130
  selected: (_section_title = section.title) === null || _section_title === void 0 ? void 0 : _section_title.selected,
@@ -106,17 +140,34 @@ var titleStyles = tv({
106
140
  return /*#__PURE__*/ _jsxs("div", {
107
141
  className: sectionClasses,
108
142
  children: [
109
- section.title && /*#__PURE__*/ _jsx("div", {
143
+ section.title && /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
110
144
  className: titleClasses,
111
- onClick: handleTitleClick,
112
- children: /*#__PURE__*/ _jsx(Text, {
113
- color: section.title.selected ? "link" : "normal",
114
- fontWeight: "medium",
115
- variant: "bodySm",
116
- truncate: true,
117
- children: section.title.label
118
- })
119
- }),
145
+ onClick: handleTitleClick
146
+ }, ((_section_title2 = section.title) === null || _section_title2 === void 0 ? void 0 : _section_title2.onAction) ? {
147
+ role: "button",
148
+ tabIndex: 0,
149
+ onKeyDown: function(e) {
150
+ if (e.key === "Enter" || e.key === " ") {
151
+ e.preventDefault();
152
+ handleTitleClick();
153
+ }
154
+ }
155
+ } : {}), {
156
+ children: [
157
+ /*#__PURE__*/ _jsx(Text, {
158
+ color: section.title.selected ? "link" : "normal",
159
+ fontWeight: "medium",
160
+ variant: "bodySm",
161
+ truncate: true,
162
+ children: section.title.label
163
+ }),
164
+ section.title.onAction && /*#__PURE__*/ _jsx(Icon, {
165
+ source: ChevronRightMinor,
166
+ color: "subdued",
167
+ className: "opacity-50"
168
+ })
169
+ ]
170
+ })),
120
171
  section.links.map(function(link, index) {
121
172
  return /*#__PURE__*/ _jsx(Navigation.Link, _object_spread({}, link), "navigation-link-".concat(index));
122
173
  })
@@ -206,9 +257,19 @@ var linkStyles = tv({
206
257
  showDividerAbove && /*#__PURE__*/ _jsx("div", {
207
258
  className: "h-px w-full bg-tint-3 dark:bg-tint-alt-3 my-3"
208
259
  }),
209
- /*#__PURE__*/ _jsxs("div", {
260
+ /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
210
261
  className: linkClasses,
211
- onClick: handleClick,
262
+ onClick: handleClick
263
+ }, onAction ? {
264
+ role: "link",
265
+ tabIndex: 0,
266
+ onKeyDown: function(e) {
267
+ if (e.key === "Enter") {
268
+ e.preventDefault();
269
+ handleClick();
270
+ }
271
+ }
272
+ } : {}), {
212
273
  children: [
213
274
  /*#__PURE__*/ _jsxs("div", {
214
275
  className: "flex items-center gap-2 truncate",
@@ -238,7 +299,7 @@ var linkStyles = tv({
238
299
  className: "opacity-50"
239
300
  }) : accessory ? accessory : null
240
301
  ]
241
- }),
302
+ })),
242
303
  (expanded || selected || subLinkIsSelected || grandChildLinkIsSelected) && !disclosure && subLinks && /*#__PURE__*/ _jsx("div", {
243
304
  className: "flex flex-col mb-3",
244
305
  children: subLinks.map(function(subLink, index) {
@@ -296,9 +357,19 @@ var subLinkStyles = tv({
296
357
  setShowMobileNavigation(false);
297
358
  }
298
359
  };
299
- return /*#__PURE__*/ _jsxs("div", {
360
+ return /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
300
361
  className: subLinkClasses,
301
- onClick: handleClick,
362
+ onClick: handleClick
363
+ }, onAction ? {
364
+ role: "link",
365
+ tabIndex: 0,
366
+ onKeyDown: function(e) {
367
+ if (e.key === "Enter") {
368
+ e.preventDefault();
369
+ handleClick();
370
+ }
371
+ }
372
+ } : {}), {
302
373
  children: [
303
374
  /*#__PURE__*/ _jsxs("div", {
304
375
  className: "flex items-center gap-2",
@@ -321,7 +392,7 @@ var subLinkStyles = tv({
321
392
  })),
322
393
  accessory
323
394
  ]
324
- });
395
+ }));
325
396
  }
326
397
  Navigation.SubLink = SubLink;
327
398
  export default Navigation;
@@ -106,7 +106,46 @@ import Popover from "./Popover.js";
106
106
  import ActionList from "./ActionList.js";
107
107
  import { ArrowLeftMinor, MobileHorizontalDotsMajor } from "@shopify/polaris-icons";
108
108
  import { useFrame } from "./Frame.js";
109
- var styles = tv({
109
+ /**
110
+ * @component Page
111
+ *
112
+ * @description A top-level page container that renders a title bar with heading, breadcrumbs, actions, and a content area.
113
+ *
114
+ * @usage
115
+ * - DO: Use as the root container for each page view with title and primary/secondary actions.
116
+ * - DON'T: Nest Page inside another Page.
117
+ *
118
+ * @accessibility
119
+ * - Page title renders as the main heading; ensure it accurately describes the page content.
120
+ *
121
+ * @alternative
122
+ * - If you need a simple container without page-level chrome, use `Card` or `Layout`.
123
+ *
124
+ * @param {Object} props - Props for the component.
125
+ * @param {string|React.ReactNode} props.title - The title of the page. Can be a string or React element.
126
+ * @param {string|React.ReactNode} props.subtitle - The subtitle of the page. Can be a string or React element.
127
+ * @param {Object} [props.backAction] - Configuration for the back action button.
128
+ * @param {Function} [props.backAction.onAction] - Callback when the back action is triggered.
129
+ * @param {string} [props.backAction.accessibilityLabel] - Accessibility label for the back action button.
130
+ * @param {boolean} [props.narrowWidth=false] - Whether to use a narrow width layout.
131
+ * @param {boolean} [props.fullWidth=false] - Whether to use a full-width layout.
132
+ * @param {boolean} [props.showTitleInTopBar=true] - Whether to show the title in the top bar area.
133
+ * @param {boolean} [props.wrapInContentContainer=true] - Whether to wrap the content in a container with padding.
134
+ * @param {Object} [props.primaryAction] - Configuration for the primary action button.
135
+ * @param {Function} [props.primaryAction.onAction] - Callback when the primary action is triggered.
136
+ * @param {boolean} [props.primaryAction.loading] - Whether the primary action button is in a loading state.
137
+ * @param {boolean} [props.primaryAction.disabled] - Whether the primary action button is disabled.
138
+ * @param {boolean} [props.primaryAction.destructive] - Whether the primary action button is styled as destructive.
139
+ * @param {string} [props.primaryAction.tooltip] - Tooltip to show when hovering over the primary action button.
140
+ * @param {React.ReactNode} [props.primaryAction.content="Save"] - Content for the primary action button.
141
+ * @param {Object[]} [props.secondaryActions=[]] - List of secondary actions.
142
+ * @param {string} [props.moreActionsLabel="Actions"] - Label for the "More Actions" button in mobile view.
143
+ * @param {React.ReactNode} [props.titleMetadata] - Metadata displayed alongside the title.
144
+ * @param {React.ReactNode} [props.children] - Content for the main section of the page.
145
+ * @param {Object} [props.footerActions] - Configuration for the footer actions.
146
+ * @param {string} [props.className] - Additional CSS classes for the Page.
147
+ * @returns {React.ReactElement} Rendered Page component.
148
+ */ var styles = tv({
110
149
  base: "Litho-Page w-full mx-auto",
111
150
  variants: {
112
151
  narrowWidth: {
@@ -178,36 +217,7 @@ var contentStyles = tv({
178
217
  wrapInContentContainer: true
179
218
  }
180
219
  });
181
- /**
182
- * Page component that provides a structured layout with a header, primary and secondary actions, and content.
183
- *
184
- * @component
185
- *
186
- * @param {Object} props - Props for the component.
187
- * @param {string|React.ReactNode} props.title - The title of the page. Can be a string or React element.
188
- * @param {string|React.ReactNode} props.subtitle - The subtitle of the page. Can be a string or React element.
189
- * @param {Object} [props.backAction] - Configuration for the back action button.
190
- * @param {Function} [props.backAction.onAction] - Callback when the back action is triggered.
191
- * @param {string} [props.backAction.accessibilityLabel] - Accessibility label for the back action button.
192
- * @param {boolean} [props.narrowWidth=false] - Whether to use a narrow width layout.
193
- * @param {boolean} [props.fullWidth=false] - Whether to use a full-width layout.
194
- * @param {boolean} [props.showTitleInTopBar=true] - Whether to show the title in the top bar area.
195
- * @param {boolean} [props.wrapInContentContainer=true] - Whether to wrap the content in a container with padding.
196
- * @param {Object} [props.primaryAction] - Configuration for the primary action button.
197
- * @param {Function} [props.primaryAction.onAction] - Callback when the primary action is triggered.
198
- * @param {boolean} [props.primaryAction.loading] - Whether the primary action button is in a loading state.
199
- * @param {boolean} [props.primaryAction.disabled] - Whether the primary action button is disabled.
200
- * @param {boolean} [props.primaryAction.destructive] - Whether the primary action button is styled as destructive.
201
- * @param {string} [props.primaryAction.tooltip] - Tooltip to show when hovering over the primary action button.
202
- * @param {React.ReactNode} [props.primaryAction.content="Save"] - Content for the primary action button.
203
- * @param {Object[]} [props.secondaryActions=[]] - List of secondary actions.
204
- * @param {string} [props.moreActionsLabel="Actions"] - Label for the "More Actions" button in mobile view.
205
- * @param {React.ReactNode} [props.titleMetadata] - Metadata displayed alongside the title.
206
- * @param {React.ReactNode} [props.children] - Content for the main section of the page.
207
- * @param {Object} [props.footerActions] - Configuration for the footer actions.
208
- * @param {string} [props.className] - Additional CSS classes for the Page.
209
- * @returns {React.ReactElement} Rendered Page component.
210
- */ function Page() {
220
+ function Page() {
211
221
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
212
222
  var title = props.title, subtitle = props.subtitle, _props_showTitleInTopBar = props.showTitleInTopBar, showTitleInTopBar = _props_showTitleInTopBar === void 0 ? true : _props_showTitleInTopBar, tmp = props.backAction, _backAction = tmp === void 0 ? null : tmp, children = props.children, narrowWidth = props.narrowWidth, fullWidth = props.fullWidth, primaryAction = props.primaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, titleMetadata = props.titleMetadata, _props_moreActionsLabel = props.moreActionsLabel, moreActionsLabel = _props_moreActionsLabel === void 0 ? "Actions" : _props_moreActionsLabel, _props_wrapInContentContainer = props.wrapInContentContainer, wrapInContentContainer = _props_wrapInContentContainer === void 0 ? true : _props_wrapInContentContainer, footerActions = props.footerActions, className = props.className;
213
223
  var paneIsOpen = useFrame().paneIsOpen;
@@ -368,6 +378,7 @@ var contentStyles = tv({
368
378
  disclosure: true,
369
379
  insight: action.insight,
370
380
  icon: action.icon,
381
+ pressed: action.pressed,
371
382
  onClick: function() {
372
383
  return togglePopover(index);
373
384
  },
@@ -384,6 +395,7 @@ var contentStyles = tv({
384
395
  return /*#__PURE__*/ _jsx(Button, {
385
396
  plain: !action.destructive && !action.insight,
386
397
  onClick: action.onAction || action.onClick,
398
+ pressed: action.pressed,
387
399
  disabled: action.disabled,
388
400
  icon: action.icon,
389
401
  loading: action.loading,
@@ -406,6 +418,7 @@ var contentStyles = tv({
406
418
  url: primaryAction.url,
407
419
  loading: primaryAction.loading,
408
420
  disabled: primaryAction.disabled,
421
+ pressed: primaryAction.pressed,
409
422
  destructive: primaryAction.destructive,
410
423
  tooltip: primaryAction.tooltip,
411
424
  connectedDisclosure: primaryAction.connectedDisclosure,