@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
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -9,8 +10,59 @@ Object.defineProperty(exports, "default", {
9
10
  }
10
11
  });
11
12
  var _jsxruntime = require("react/jsx-runtime");
13
+ var _react = require("react");
12
14
  var _tailwindvariants = require("tailwind-variants");
13
15
  var _polarisicons = /*#__PURE__*/ _interop_require_wildcard(require("@shopify/polaris-icons"));
16
+ function _array_like_to_array(arr, len) {
17
+ if (len == null || len > arr.length) len = arr.length;
18
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
19
+ return arr2;
20
+ }
21
+ function _array_with_holes(arr) {
22
+ if (Array.isArray(arr)) return arr;
23
+ }
24
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
25
+ try {
26
+ var info = gen[key](arg);
27
+ var value = info.value;
28
+ } catch (error) {
29
+ reject(error);
30
+ return;
31
+ }
32
+ if (info.done) {
33
+ resolve(value);
34
+ } else {
35
+ Promise.resolve(value).then(_next, _throw);
36
+ }
37
+ }
38
+ function _async_to_generator(fn) {
39
+ return function() {
40
+ var self = this, args = arguments;
41
+ return new Promise(function(resolve, reject) {
42
+ var gen = fn.apply(self, args);
43
+ function _next(value) {
44
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
45
+ }
46
+ function _throw(err) {
47
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
48
+ }
49
+ _next(undefined);
50
+ });
51
+ };
52
+ }
53
+ function _define_property(obj, key, value) {
54
+ if (key in obj) {
55
+ Object.defineProperty(obj, key, {
56
+ value: value,
57
+ enumerable: true,
58
+ configurable: true,
59
+ writable: true
60
+ });
61
+ } else {
62
+ obj[key] = value;
63
+ }
64
+ return obj;
65
+ }
14
66
  function _getRequireWildcardCache(nodeInterop) {
15
67
  if (typeof WeakMap !== "function") return null;
16
68
  var cacheBabelInterop = new WeakMap();
@@ -52,6 +104,223 @@ function _interop_require_wildcard(obj, nodeInterop) {
52
104
  }
53
105
  return newObj;
54
106
  }
107
+ function _iterable_to_array_limit(arr, i) {
108
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
109
+ if (_i == null) return;
110
+ var _arr = [];
111
+ var _n = true;
112
+ var _d = false;
113
+ var _s, _e;
114
+ try {
115
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
116
+ _arr.push(_s.value);
117
+ if (i && _arr.length === i) break;
118
+ }
119
+ } catch (err) {
120
+ _d = true;
121
+ _e = err;
122
+ } finally{
123
+ try {
124
+ if (!_n && _i["return"] != null) _i["return"]();
125
+ } finally{
126
+ if (_d) throw _e;
127
+ }
128
+ }
129
+ return _arr;
130
+ }
131
+ function _non_iterable_rest() {
132
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
133
+ }
134
+ function _object_spread(target) {
135
+ for(var i = 1; i < arguments.length; i++){
136
+ var source = arguments[i] != null ? arguments[i] : {};
137
+ var ownKeys = Object.keys(source);
138
+ if (typeof Object.getOwnPropertySymbols === "function") {
139
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
140
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
141
+ }));
142
+ }
143
+ ownKeys.forEach(function(key) {
144
+ _define_property(target, key, source[key]);
145
+ });
146
+ }
147
+ return target;
148
+ }
149
+ function ownKeys(object, enumerableOnly) {
150
+ var keys = Object.keys(object);
151
+ if (Object.getOwnPropertySymbols) {
152
+ var symbols = Object.getOwnPropertySymbols(object);
153
+ if (enumerableOnly) {
154
+ symbols = symbols.filter(function(sym) {
155
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
156
+ });
157
+ }
158
+ keys.push.apply(keys, symbols);
159
+ }
160
+ return keys;
161
+ }
162
+ function _object_spread_props(target, source) {
163
+ source = source != null ? source : {};
164
+ if (Object.getOwnPropertyDescriptors) {
165
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
166
+ } else {
167
+ ownKeys(Object(source)).forEach(function(key) {
168
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
169
+ });
170
+ }
171
+ return target;
172
+ }
173
+ function _sliced_to_array(arr, i) {
174
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
175
+ }
176
+ function _type_of(obj) {
177
+ "@swc/helpers - typeof";
178
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
179
+ }
180
+ function _unsupported_iterable_to_array(o, minLen) {
181
+ if (!o) return;
182
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
183
+ var n = Object.prototype.toString.call(o).slice(8, -1);
184
+ if (n === "Object" && o.constructor) n = o.constructor.name;
185
+ if (n === "Map" || n === "Set") return Array.from(n);
186
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
187
+ }
188
+ function _ts_generator(thisArg, body) {
189
+ var f, y, t, _ = {
190
+ label: 0,
191
+ sent: function() {
192
+ if (t[0] & 1) throw t[1];
193
+ return t[1];
194
+ },
195
+ trys: [],
196
+ ops: []
197
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
198
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
199
+ return this;
200
+ }), g;
201
+ function verb(n) {
202
+ return function(v) {
203
+ return step([
204
+ n,
205
+ v
206
+ ]);
207
+ };
208
+ }
209
+ function step(op) {
210
+ if (f) throw new TypeError("Generator is already executing.");
211
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
212
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
213
+ if (y = 0, t) op = [
214
+ op[0] & 2,
215
+ t.value
216
+ ];
217
+ switch(op[0]){
218
+ case 0:
219
+ case 1:
220
+ t = op;
221
+ break;
222
+ case 4:
223
+ _.label++;
224
+ return {
225
+ value: op[1],
226
+ done: false
227
+ };
228
+ case 5:
229
+ _.label++;
230
+ y = op[1];
231
+ op = [
232
+ 0
233
+ ];
234
+ continue;
235
+ case 7:
236
+ op = _.ops.pop();
237
+ _.trys.pop();
238
+ continue;
239
+ default:
240
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
241
+ _ = 0;
242
+ continue;
243
+ }
244
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
245
+ _.label = op[1];
246
+ break;
247
+ }
248
+ if (op[0] === 6 && _.label < t[1]) {
249
+ _.label = t[1];
250
+ t = op;
251
+ break;
252
+ }
253
+ if (t && _.label < t[2]) {
254
+ _.label = t[2];
255
+ _.ops.push(op);
256
+ break;
257
+ }
258
+ if (t[2]) _.ops.pop();
259
+ _.trys.pop();
260
+ continue;
261
+ }
262
+ op = body.call(thisArg, _);
263
+ } catch (e) {
264
+ op = [
265
+ 6,
266
+ e
267
+ ];
268
+ y = 0;
269
+ } finally{
270
+ f = t = 0;
271
+ }
272
+ if (op[0] & 5) throw op[1];
273
+ return {
274
+ value: op[0] ? op[1] : void 0,
275
+ done: true
276
+ };
277
+ }
278
+ }
279
+ /**
280
+ * @component Icon
281
+ *
282
+ * @description Renders an icon with configurable size, color, and display style. Supports Polaris icons (fill-based),
283
+ * Lucide icons (stroke-based), and custom SVG components. Polaris icons are detected automatically via displayName lookup;
284
+ * any unrecognized component is treated as a stroke-based (Lucide) icon. String sources are resolved in order: Polaris → internal Litho icons → dynamic Lucide import.
285
+ *
286
+ * @usage
287
+ * - DO: Use with Polaris or Lucide icon sources to add visual cues alongside text labels or inside buttons.
288
+ * - DON'T: Use icons as the sole means of conveying meaning without an accompanying text label or accessible name.
289
+ *
290
+ * @accessibility
291
+ * - Icons are decorative by default; pair with visible text or an `accessibilityLabel` on the parent component.
292
+ * - When used standalone (e.g., icon-only button), ensure the parent element provides an `aria-label`.
293
+ *
294
+ * @alternative
295
+ * - If you need a clickable icon, wrap in a `Button` with the `icon` prop instead of using Icon directly.
296
+ * - If you need a small image preview, use `Thumbnail` instead.
297
+ *
298
+ * @param {Object} props - The properties for configuring the Component.
299
+ * @param {React.ElementType|string} props.source - The icon source. A Polaris icon component, a Lucide icon component, or a string name (resolved as Polaris → Litho → Lucide dynamic import).
300
+ * @param {('white'|'default'|'base'|'subdued'|'lower'|'link'|'primary'|'alternate'|'high'|'low'|'currentColor'|'successFgAlternate'|'success'|'fg-success'|'critical'|'fg-critical'|'criticalFgAlternate'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active'|'btn-primary-icon'|'btn-secondary-icon'|'btn-plain-icon'|'btn-link-icon'|'btn-destructive-icon'|'btn-highlight-icon'|'inputFg'|'inputFgDisabled'|'success-icon'|'critical-icon'|'warning-icon'|'attention-icon'|'info-icon'|'highlight-icon'|'insight-icon'|'neutral-icon'|'success-alt-icon'|'critical-alt-icon'|'warning-alt-icon'|'attention-alt-icon'|'info-alt-icon'|'highlight-alt-icon'|'insight-alt-icon'|'neutral-alt-icon')} [props.color="default"] - The color variant for the icon.
301
+ * @param {('white'|'default'|'base'|'subdued'|'link'|'primary'|'alternate'|'success'|'critical'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active')} [props.hoverColor] - The hover color variant for the icon (Polaris only).
302
+ * @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
303
+ * @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl'|number)} [props.size="default"] - Sets the icon size. Semantic: 'xs' (12px), 'sm' (16px), 'default' (20px), 'lg' (24px), 'xl' (28px), '2xl' (32px). Numeric token: 3–20 (maps to 12–80px). Raw pixel number also accepted.
304
+ * @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill (for Polaris icons with stroke paths).
305
+ * @param {number} [props.strokeWidth=2] - SVG stroke width for Lucide icons. 0.5–3 in 0.25 increments. Ignored for Polaris icons.
306
+ * @param {number} [props.opacity=100] - Container opacity 0–100 in steps of 10.
307
+ * @param {Function} [props.onClick] - Click handler for the icon.
308
+ * @param {string} [props.className] - Additional CSS classes to apply.
309
+ * @returns {JSX.Element} The rendered icon component with the specified styles.
310
+ *
311
+ * @example
312
+ * // Polaris icon
313
+ * <Icon source={TickMinor} color="success" size="lg" />
314
+ *
315
+ * // Lucide icon (direct import)
316
+ * import { Cable } from "lucide-react";
317
+ * <Icon source={Cable} color="info-alt-icon" size={12} opacity={70} />
318
+ *
319
+ * // Lucide icon (string-based dynamic loading)
320
+ * <Icon source="cable" color="info-alt-icon" size={12} />
321
+ */ // ---------------------------------------------------------------------------
322
+ // Styles (container)
323
+ // ---------------------------------------------------------------------------
55
324
  var styles = (0, _tailwindvariants.tv)({
56
325
  base: "Litho-Icon",
57
326
  variants: {
@@ -61,21 +330,15 @@ var styles = (0, _tailwindvariants.tv)({
61
330
  inline: "inline",
62
331
  "inline-block": "inline-block",
63
332
  "inline-flex": "inline-flex items-center justify-center"
64
- },
65
- size: {
66
- xs: "h-3 w-3 min-w-3",
67
- sm: "h-4 w-4 min-w-4",
68
- default: "h-5 w-5 min-w-5",
69
- lg: "h-6 w-6 min-w-6",
70
- xl: "h-7 w-7 min-w-7",
71
- "2xl": "h-8 w-8 min-w-8"
72
333
  }
73
334
  },
74
335
  defaultVariants: {
75
- display: "block",
76
- size: "default"
336
+ display: "block"
77
337
  }
78
338
  });
339
+ // ---------------------------------------------------------------------------
340
+ // Fill-based color styles (Polaris icons)
341
+ // ---------------------------------------------------------------------------
79
342
  var iconStyles = (0, _tailwindvariants.tv)({
80
343
  base: "",
81
344
  variants: {
@@ -118,6 +381,7 @@ var iconStyles = (0, _tailwindvariants.tv)({
118
381
  "info-icon": "fill-info-icon",
119
382
  "highlight-icon": "fill-highlight-icon",
120
383
  "insight-icon": "fill-insight-icon",
384
+ "btn-insight-icon": "fill-btn-insight-icon",
121
385
  "neutral-icon": "fill-neutral-icon",
122
386
  "success-alt-icon": "fill-success-alt-icon",
123
387
  "critical-alt-icon": "fill-critical-alt-icon",
@@ -127,7 +391,14 @@ var iconStyles = (0, _tailwindvariants.tv)({
127
391
  "highlight-alt-icon": "fill-highlight-alt-icon",
128
392
  "insight-alt-icon": "fill-insight-alt-icon",
129
393
  "neutral-alt-icon": "fill-neutral-alt-icon",
130
- "FrameSaveBar": "fill-alternate dark:fill-black"
394
+ "FrameSaveBar": "fill-alternate dark:fill-black",
395
+ "brand": "fill-brand",
396
+ "brand-low": "fill-brand-low",
397
+ "brand-lower": "fill-brand-lower",
398
+ "brand-alternate": "fill-brand-alternate",
399
+ "brand-saturated": "fill-brand-saturated",
400
+ "brand-subdued": "fill-brand-subdued",
401
+ "brand-chat": "fill-brand-chat"
131
402
  },
132
403
  hoverColor: {
133
404
  white: "hover:fill-white group-hover/LithoIcon:fill-white",
@@ -206,6 +477,276 @@ var iconStyles = (0, _tailwindvariants.tv)({
206
477
  color: "default"
207
478
  }
208
479
  });
480
+ // ---------------------------------------------------------------------------
481
+ // Stroke-based color map (Lucide / generic stroke icons)
482
+ // Mirrors iconStyles.color keys but uses text-* instead of fill-*
483
+ // Lucide SVGs use stroke="currentColor", so text-* classes set the icon color.
484
+ // ---------------------------------------------------------------------------
485
+ var STROKE_COLOR_MAP = {
486
+ // Core
487
+ white: "text-white",
488
+ default: "text-higher",
489
+ base: "text-higher",
490
+ subdued: "text-low",
491
+ lower: "text-lower",
492
+ link: "text-link",
493
+ primary: "text-link",
494
+ alternate: "text-alternate",
495
+ high: "text-high",
496
+ low: "text-low",
497
+ currentColor: "text-current",
498
+ // Status foreground
499
+ successFgAlternate: "text-fg-success-alternate",
500
+ success: "text-fg-success",
501
+ "fg-success": "text-fg-success",
502
+ critical: "text-fg-critical",
503
+ "fg-critical": "text-fg-critical",
504
+ criticalFgAlternate: "text-fg-critical-alternate",
505
+ warning: "text-attention-alt-icon",
506
+ info: "text-info-alt-icon",
507
+ caution: "text-fg-caution-alternate",
508
+ attention: "text-attention-alt-icon",
509
+ highlight: "text-highlight-alt-icon",
510
+ neutral: "text-neutral-alt-icon",
511
+ normal: "text-normal",
512
+ disabled: "text-lowest",
513
+ active: "text-tab-active-fg",
514
+ // Button-specific
515
+ "btn-primary-icon": "text-btn-primary-icon",
516
+ "btn-secondary-icon": "text-btn-secondary-icon",
517
+ "btn-plain-icon": "text-btn-plain-icon",
518
+ "btn-link-icon": "text-btn-link-icon",
519
+ "btn-destructive-icon": "text-btn-destructive-icon",
520
+ "btn-highlight-icon": "text-btn-highlight-icon",
521
+ // Input
522
+ inputFg: "text-form-input-fg",
523
+ inputFgDisabled: "text-form-input-fg-disabled",
524
+ // Status icons
525
+ "success-icon": "text-success-icon",
526
+ "critical-icon": "text-critical-icon",
527
+ "warning-icon": "text-warning-icon",
528
+ "attention-icon": "text-attention-icon",
529
+ "info-icon": "text-info-icon",
530
+ "highlight-icon": "text-highlight-icon",
531
+ "insight-icon": "text-insight-icon",
532
+ "btn-insight-icon": "text-btn-insight-icon",
533
+ "neutral-icon": "text-neutral-icon",
534
+ // Status alt icons
535
+ "success-alt-icon": "text-success-alt-icon",
536
+ "critical-alt-icon": "text-critical-alt-icon",
537
+ "warning-alt-icon": "text-attention-alt-icon",
538
+ "attention-alt-icon": "text-attention-alt-icon",
539
+ "info-alt-icon": "text-info-alt-icon",
540
+ "highlight-alt-icon": "text-highlight-alt-icon",
541
+ "insight-alt-icon": "text-insight-alt-icon",
542
+ "neutral-alt-icon": "text-neutral-alt-icon",
543
+ // Brand
544
+ "brand": "text-brand",
545
+ "brand-low": "text-brand-low",
546
+ "brand-lower": "text-brand-lower",
547
+ "brand-alternate": "text-brand-alternate",
548
+ "brand-saturated": "text-brand-saturated",
549
+ "brand-subdued": "text-brand-subdued",
550
+ "brand-chat": "text-brand-chat"
551
+ };
552
+ // ---------------------------------------------------------------------------
553
+ // Size system (extended to support Lucide's larger size range)
554
+ // ---------------------------------------------------------------------------
555
+ /** Map semantic size names to numeric tokens. */ var SEMANTIC_TO_TOKEN = {
556
+ xs: 3,
557
+ sm: 4,
558
+ default: 5,
559
+ lg: 6,
560
+ xl: 7,
561
+ "2xl": 8
562
+ };
563
+ /** Map numeric tokens (3-20) to pixel values. */ var TOKEN_TO_PX = {
564
+ 3: 12,
565
+ 4: 16,
566
+ 5: 20,
567
+ 6: 24,
568
+ 7: 28,
569
+ 8: 32,
570
+ 9: 36,
571
+ 10: 40,
572
+ 11: 44,
573
+ 12: 48,
574
+ 13: 52,
575
+ 14: 56,
576
+ 15: 60,
577
+ 16: 64,
578
+ 17: 68,
579
+ 18: 72,
580
+ 19: 76,
581
+ 20: 80
582
+ };
583
+ /** Static Tailwind classes for container sizing (avoids purge issues). Tokens without entries use inline styles. */ var SIZE_CLASSES = {
584
+ 3: "h-3 w-3 min-w-3",
585
+ 4: "h-4 w-4 min-w-4",
586
+ 5: "h-5 w-5 min-w-5",
587
+ 6: "h-6 w-6 min-w-6",
588
+ 7: "h-7 w-7 min-w-7",
589
+ 8: "h-8 w-8 min-w-8",
590
+ 9: "h-9 w-9 min-w-9",
591
+ 10: "h-10 w-10 min-w-10",
592
+ 11: "h-11 w-11 min-w-11",
593
+ 12: "h-12 w-12 min-w-12",
594
+ 14: "h-14 w-14 min-w-14",
595
+ 16: "h-16 w-16 min-w-16",
596
+ 20: "h-20 w-20 min-w-20"
597
+ };
598
+ var LITHO_TOKENS = [
599
+ 3,
600
+ 4,
601
+ 5,
602
+ 6,
603
+ 7,
604
+ 8,
605
+ 9,
606
+ 10,
607
+ 11,
608
+ 12,
609
+ 13,
610
+ 14,
611
+ 15,
612
+ 16,
613
+ 17,
614
+ 18,
615
+ 19,
616
+ 20
617
+ ];
618
+ /**
619
+ * Resolve the size prop to { px, sizeClass, sizeStyle }.
620
+ * Accepts: semantic string, numeric token (3-20), or raw px number.
621
+ */ var resolveSize = function(size) {
622
+ // Semantic name → token → px
623
+ if (typeof size === "string" && SEMANTIC_TO_TOKEN[size] !== undefined) {
624
+ var token = SEMANTIC_TO_TOKEN[size];
625
+ var px = TOKEN_TO_PX[token];
626
+ var sizeClass = SIZE_CLASSES[token] || null;
627
+ var sizeStyle = sizeClass ? null : {
628
+ width: px,
629
+ height: px,
630
+ minWidth: px
631
+ };
632
+ return {
633
+ px: px,
634
+ sizeClass: sizeClass,
635
+ sizeStyle: sizeStyle
636
+ };
637
+ }
638
+ // Numeric token → px
639
+ if (typeof size === "number" && LITHO_TOKENS.includes(size)) {
640
+ var px1 = TOKEN_TO_PX[size];
641
+ var sizeClass1 = SIZE_CLASSES[size] || null;
642
+ var sizeStyle1 = sizeClass1 ? null : {
643
+ width: px1,
644
+ height: px1,
645
+ minWidth: px1
646
+ };
647
+ return {
648
+ px: px1,
649
+ sizeClass: sizeClass1,
650
+ sizeStyle: sizeStyle1
651
+ };
652
+ }
653
+ // Raw px number (not a token)
654
+ if (typeof size === "number") {
655
+ return {
656
+ px: size,
657
+ sizeClass: null,
658
+ sizeStyle: {
659
+ width: size,
660
+ height: size,
661
+ minWidth: size
662
+ }
663
+ };
664
+ }
665
+ // Fallback to default
666
+ var px2 = TOKEN_TO_PX[5];
667
+ return {
668
+ px: px2,
669
+ sizeClass: SIZE_CLASSES[5],
670
+ sizeStyle: null
671
+ };
672
+ };
673
+ // ---------------------------------------------------------------------------
674
+ // Lucide dynamic loading
675
+ // ---------------------------------------------------------------------------
676
+ var lucideCache = new Map();
677
+ var toPascalCase = function(name) {
678
+ return name.split("-").map(function(p) {
679
+ return p[0].toUpperCase() + p.slice(1);
680
+ }).join("");
681
+ };
682
+ var loadLucideIcon = function(name) {
683
+ return _async_to_generator(function() {
684
+ var key, mod, icon, e;
685
+ return _ts_generator(this, function(_state) {
686
+ switch(_state.label){
687
+ case 0:
688
+ key = toPascalCase(name);
689
+ if (lucideCache.has(key)) return [
690
+ 2,
691
+ lucideCache.get(key)
692
+ ];
693
+ _state.label = 1;
694
+ case 1:
695
+ _state.trys.push([
696
+ 1,
697
+ 3,
698
+ ,
699
+ 4
700
+ ]);
701
+ return [
702
+ 4,
703
+ Promise.resolve().then(function() {
704
+ return /*#__PURE__*/ _interop_require_wildcard(require("lucide-react"));
705
+ })
706
+ ];
707
+ case 2:
708
+ mod = _state.sent();
709
+ icon = mod[key] || null;
710
+ lucideCache.set(key, icon);
711
+ return [
712
+ 2,
713
+ icon
714
+ ];
715
+ case 3:
716
+ e = _state.sent();
717
+ lucideCache.set(key, null);
718
+ return [
719
+ 2,
720
+ null
721
+ ];
722
+ case 4:
723
+ return [
724
+ 2
725
+ ];
726
+ }
727
+ });
728
+ })();
729
+ };
730
+ // ---------------------------------------------------------------------------
731
+ // StrokeWidth / Opacity helpers
732
+ // ---------------------------------------------------------------------------
733
+ var resolveStrokeWidth = function(strokeWidth) {
734
+ if (strokeWidth === undefined || strokeWidth === null) return undefined;
735
+ var n = Number(strokeWidth);
736
+ if (Number.isNaN(n)) return undefined;
737
+ var rounded = Math.round(n / 0.25) * 0.25;
738
+ return Math.round(Math.min(3, Math.max(0.5, rounded)) * 100) / 100;
739
+ };
740
+ var resolveOpacity = function(opacity) {
741
+ if (opacity === undefined || opacity === null) return 100;
742
+ var n = Number(opacity);
743
+ if (Number.isNaN(n)) return 100;
744
+ var rounded = Math.round(n / 10) * 10;
745
+ return Math.min(100, Math.max(0, rounded));
746
+ };
747
+ // ---------------------------------------------------------------------------
748
+ // Internal Litho icons (custom SVGs)
749
+ // ---------------------------------------------------------------------------
209
750
  var LithoIcons = function(param) {
210
751
  var className = param.className;
211
752
  return {
@@ -283,65 +824,146 @@ var LithoIcons = function(param) {
283
824
  })
284
825
  };
285
826
  };
827
+ // ---------------------------------------------------------------------------
828
+ // Component detection
829
+ // ---------------------------------------------------------------------------
286
830
  /**
287
- * A Component that renders an icon with customizable size, color, and display style, using Shopify Polaris icons.
288
- * The icon adapts styling based on the provided props and supports a range of color schemes and sizes.
289
- *
290
- * @component
291
- *
292
- * @param {Object} props - The properties for configuring the Component.
293
- * @param {Object} props.source - The source icon component from `@shopify/polaris-icons`. Should be a valid Polaris icon component.
294
- * @param {('white'|'default'|'base'|'subdued'|'link'|'primary'|'alternate'|'successFgAlternate'|'success'|'fg-success'|'critical'|'fg-critical'|'criticalFgAlternate'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active'|'btn-primary-icon'|'btn-secondary-icon'|'btn-plain-icon'|'btn-link-icon'|'btn-destructive-icon'|'btn-highlight-icon'|'inputFg'|'inputFgDisabled'|'success-icon'|'critical-icon'|'warning-icon'|'attention-icon'|'info-icon'|'highlight-icon'|'insight-icon'|'neutral-icon'|'success-alt-icon'|'critical-alt-icon'|'warning-alt-icon'|'attention-alt-icon'|'info-alt-icon'|'highlight-alt-icon'|'insight-alt-icon'|'neutral-alt-icon')} [props.color="default"] - The color variant for the icon.
295
- * @param {('white'|'default'|'base'|'subdued'|'link'|'primary'|'alternate'|'success'|'critical'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active'|'btn-primary-icon'|'btn-secondary-icon'|'btn-plain-icon'|'btn-link-icon'|'btn-destructive-icon'|'btn-highlight-icon'|'inputFg'|'inputFgDisabled'|'success-icon'|'critical-icon'|'warning-icon'|'attention-icon'|'info-icon'|'highlight-icon'|'insight-icon'|'neutral-icon'|'success-alt-icon'|'critical-alt-icon'|'warning-alt-icon'|'attention-alt-icon'|'info-alt-icon'|'highlight-alt-icon'|'insight-alt-icon'|'neutral-alt-icon')} [props.hoverColor] - The hover color variant for the icon.
296
- * @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
297
- * @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl')} [props.size="default"] - Sets the icon size.
298
- * - 'xs': Extra small (12px)
299
- * - 'sm': Small (16px)
300
- * - 'default': Medium (20px)
301
- * - 'lg': Large (24px)
302
- * - 'xl': Extra large (28px)
303
- * - '2xl': Double extra large (32px)
304
- * @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill.
305
- * @param {Function} [props.onClick] - Click handler for the icon.
306
- * @param {string} [props.className] - Additional CSS classes to apply.
307
- * @returns {JSX.Element} The rendered icon component with the specified styles.
308
- *
309
- * @example
310
- * <Icon
311
- * source={PolarisIcons.TickMinor}
312
- * color="success"
313
- * display="inline"
314
- * size="lg"
315
- * />
316
- */ function Icon() {
831
+ * Check if a value is a renderable React component (function, class, or forwardRef).
832
+ * Lucide icons are forwardRef objects (typeof "object" with a .render function).
833
+ * Polaris icons are plain functions.
834
+ */ var isComponent = function(value) {
835
+ return typeof value === "function" || (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null && typeof value.render === "function";
836
+ };
837
+ // ---------------------------------------------------------------------------
838
+ // Component
839
+ // ---------------------------------------------------------------------------
840
+ function Icon() {
317
841
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
318
- var source = props.source, color = props.color, hoverColor = props.hoverColor, _props_display = props.display, display = _props_display === void 0 ? "block" : _props_display, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, _props_stroke = props.stroke, stroke = _props_stroke === void 0 ? false : _props_stroke, onClick = props.onClick, className = props.className;
319
- var IconComponent = typeof source === "string" ? _polarisicons[source] : _polarisicons[source === null || source === void 0 ? void 0 : source.displayName];
320
- var classes = styles({
321
- display: display,
322
- size: size
323
- });
324
- var iconClasses = iconStyles({
842
+ var source = props.source, color = props.color, hoverColor = props.hoverColor, _props_display = props.display, display = _props_display === void 0 ? "block" : _props_display, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, _props_stroke = props.stroke, stroke = _props_stroke === void 0 ? false : _props_stroke, _props_strokeWidth = props.strokeWidth, strokeWidth = _props_strokeWidth === void 0 ? 2 : _props_strokeWidth, _props_opacity = props.opacity, opacity = _props_opacity === void 0 ? 100 : _props_opacity, onClick = props.onClick, className = props.className;
843
+ // --- Resolve size ---
844
+ var resolved = resolveSize(size);
845
+ var resolvedStrokeWidth = resolveStrokeWidth(strokeWidth);
846
+ var resolvedOpacity = resolveOpacity(opacity);
847
+ // --- Detect icon type ---
848
+ // 1. Try Polaris lookup (by displayName for components, by string key for strings)
849
+ var polarisIcon = typeof source === "string" ? _polarisicons[source] : isComponent(source) ? _polarisicons[source === null || source === void 0 ? void 0 : source.displayName] : null;
850
+ // 2. Check for Litho internal icons (string sources only)
851
+ var fillClasses = iconStyles({
325
852
  color: color,
326
853
  stroke: stroke,
327
854
  hoverColor: hoverColor
328
855
  });
329
856
  var LithoIconComponents = LithoIcons({
330
- className: iconClasses
857
+ className: fillClasses
331
858
  });
332
- if (typeof source === "string" && LithoIconComponents[source]) {
333
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
334
- className: "".concat(classes).concat(className ? " ".concat(className) : ""),
335
- onClick: onClick,
336
- children: LithoIconComponents[source]
859
+ var lithoIcon = typeof source === "string" ? LithoIconComponents[source] : null;
860
+ // 3. If not Polaris and not Litho, treat function sources as Lucide/generic stroke icons
861
+ var isLucideComponent = !polarisIcon && !lithoIcon && isComponent(source);
862
+ // 4. If string not found in Polaris/Litho, try dynamic Lucide load
863
+ var needsDynamicLoad = !polarisIcon && !lithoIcon && typeof source === "string";
864
+ var _useState = _sliced_to_array((0, _react.useState)(null), 2), dynamicIcon = _useState[0], setDynamicIcon = _useState[1];
865
+ (0, _react.useEffect)(function() {
866
+ if (!needsDynamicLoad) {
867
+ setDynamicIcon(null);
868
+ return;
869
+ }
870
+ var isMounted = true;
871
+ loadLucideIcon(source).then(function(icon) {
872
+ if (isMounted && icon) {
873
+ setDynamicIcon(function() {
874
+ return icon;
875
+ });
876
+ }
337
877
  });
338
- }
339
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
340
- className: "".concat(classes).concat(className ? " ".concat(className) : ""),
341
- onClick: onClick,
342
- children: IconComponent ? /*#__PURE__*/ (0, _jsxruntime.jsx)(IconComponent, {
343
- className: iconClasses
344
- }) : source
878
+ return function() {
879
+ isMounted = false;
880
+ };
881
+ }, [
882
+ source,
883
+ needsDynamicLoad
884
+ ]);
885
+ // --- Build container classes ---
886
+ var displayClass = styles({
887
+ display: display
345
888
  });
889
+ var sizeClass = resolved.sizeClass || "";
890
+ var containerClasses = "".concat(displayClass).concat(sizeClass ? " ".concat(sizeClass) : "").concat(className ? " ".concat(className) : "");
891
+ var containerStyle = _object_spread({}, resolved.sizeStyle || {}, resolvedOpacity < 100 ? {
892
+ opacity: resolvedOpacity / 100
893
+ } : {});
894
+ var hasContainerStyle = Object.keys(containerStyle).length > 0;
895
+ // --- Shared interactive props for onClick ---
896
+ var interactiveProps = onClick ? {
897
+ role: "button",
898
+ tabIndex: 0,
899
+ onKeyDown: function(e) {
900
+ if (e.key === "Enter" || e.key === " ") {
901
+ e.preventDefault();
902
+ onClick(e);
903
+ }
904
+ }
905
+ } : {};
906
+ // --- Render: Litho internal icon ---
907
+ if (lithoIcon) {
908
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
909
+ className: containerClasses,
910
+ style: hasContainerStyle ? containerStyle : undefined,
911
+ onClick: onClick
912
+ }, interactiveProps), {
913
+ children: lithoIcon
914
+ }));
915
+ }
916
+ // --- Render: Polaris icon ---
917
+ if (polarisIcon) {
918
+ var PolarisComponent = polarisIcon;
919
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
920
+ className: containerClasses,
921
+ style: hasContainerStyle ? containerStyle : undefined,
922
+ onClick: onClick
923
+ }, interactiveProps), {
924
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(PolarisComponent, {
925
+ className: fillClasses
926
+ })
927
+ }));
928
+ }
929
+ // --- Render: Lucide icon (direct component or dynamically loaded) ---
930
+ var LucideComponent = isLucideComponent ? source : dynamicIcon;
931
+ if (LucideComponent) {
932
+ var strokeColorClass = color ? STROKE_COLOR_MAP[color] || "" : "";
933
+ // Lucide uses a 24x24 viewBox vs Polaris's 20x20, so render the SVG 4px
934
+ // smaller than the container to visually match Polaris icon sizing.
935
+ var lucideIconSize = Math.max(resolved.px - 3, 8);
936
+ var lucideProps = {
937
+ size: lucideIconSize
938
+ };
939
+ if (resolvedStrokeWidth !== undefined) {
940
+ lucideProps.strokeWidth = resolvedStrokeWidth;
941
+ }
942
+ // Override container to flex/inline-flex to center the smaller SVG
943
+ var lucideDisplay = display === "inline" || display === "inline-block" || display === "inline-flex" ? "inline-flex" : "flex";
944
+ var lucideContainerClasses = "".concat(styles({
945
+ display: lucideDisplay
946
+ })).concat(sizeClass ? " ".concat(sizeClass) : "").concat(className ? " ".concat(className) : "");
947
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
948
+ className: lucideContainerClasses,
949
+ style: hasContainerStyle ? containerStyle : undefined,
950
+ onClick: onClick
951
+ }, interactiveProps), {
952
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(LucideComponent, _object_spread_props(_object_spread({}, lucideProps), {
953
+ className: strokeColorClass || undefined
954
+ }))
955
+ }));
956
+ }
957
+ // --- Render: JSX passthrough (ReactNode) or fallback ---
958
+ if (source && /*#__PURE__*/ (0, _react.isValidElement)(source)) {
959
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
960
+ className: containerClasses,
961
+ style: hasContainerStyle ? containerStyle : undefined,
962
+ onClick: onClick
963
+ }, interactiveProps), {
964
+ children: source
965
+ }));
966
+ }
967
+ return null;
346
968
  }
347
969
  var _default = Icon;