@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,6 +1,275 @@
1
+ "use client";
2
+ function _array_like_to_array(arr, len) {
3
+ if (len == null || len > arr.length) len = arr.length;
4
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
+ return arr2;
6
+ }
7
+ function _array_with_holes(arr) {
8
+ if (Array.isArray(arr)) return arr;
9
+ }
10
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
11
+ try {
12
+ var info = gen[key](arg);
13
+ var value = info.value;
14
+ } catch (error) {
15
+ reject(error);
16
+ return;
17
+ }
18
+ if (info.done) {
19
+ resolve(value);
20
+ } else {
21
+ Promise.resolve(value).then(_next, _throw);
22
+ }
23
+ }
24
+ function _async_to_generator(fn) {
25
+ return function() {
26
+ var self = this, args = arguments;
27
+ return new Promise(function(resolve, reject) {
28
+ var gen = fn.apply(self, args);
29
+ function _next(value) {
30
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
31
+ }
32
+ function _throw(err) {
33
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
34
+ }
35
+ _next(undefined);
36
+ });
37
+ };
38
+ }
39
+ function _define_property(obj, key, value) {
40
+ if (key in obj) {
41
+ Object.defineProperty(obj, key, {
42
+ value: value,
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true
46
+ });
47
+ } else {
48
+ obj[key] = value;
49
+ }
50
+ return obj;
51
+ }
52
+ function _iterable_to_array_limit(arr, i) {
53
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
54
+ if (_i == null) return;
55
+ var _arr = [];
56
+ var _n = true;
57
+ var _d = false;
58
+ var _s, _e;
59
+ try {
60
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
61
+ _arr.push(_s.value);
62
+ if (i && _arr.length === i) break;
63
+ }
64
+ } catch (err) {
65
+ _d = true;
66
+ _e = err;
67
+ } finally{
68
+ try {
69
+ if (!_n && _i["return"] != null) _i["return"]();
70
+ } finally{
71
+ if (_d) throw _e;
72
+ }
73
+ }
74
+ return _arr;
75
+ }
76
+ function _non_iterable_rest() {
77
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
78
+ }
79
+ function _object_spread(target) {
80
+ for(var i = 1; i < arguments.length; i++){
81
+ var source = arguments[i] != null ? arguments[i] : {};
82
+ var ownKeys = Object.keys(source);
83
+ if (typeof Object.getOwnPropertySymbols === "function") {
84
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
85
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
86
+ }));
87
+ }
88
+ ownKeys.forEach(function(key) {
89
+ _define_property(target, key, source[key]);
90
+ });
91
+ }
92
+ return target;
93
+ }
94
+ function ownKeys(object, enumerableOnly) {
95
+ var keys = Object.keys(object);
96
+ if (Object.getOwnPropertySymbols) {
97
+ var symbols = Object.getOwnPropertySymbols(object);
98
+ if (enumerableOnly) {
99
+ symbols = symbols.filter(function(sym) {
100
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
101
+ });
102
+ }
103
+ keys.push.apply(keys, symbols);
104
+ }
105
+ return keys;
106
+ }
107
+ function _object_spread_props(target, source) {
108
+ source = source != null ? source : {};
109
+ if (Object.getOwnPropertyDescriptors) {
110
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
111
+ } else {
112
+ ownKeys(Object(source)).forEach(function(key) {
113
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
114
+ });
115
+ }
116
+ return target;
117
+ }
118
+ function _sliced_to_array(arr, i) {
119
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
120
+ }
121
+ function _type_of(obj) {
122
+ "@swc/helpers - typeof";
123
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
124
+ }
125
+ function _unsupported_iterable_to_array(o, minLen) {
126
+ if (!o) return;
127
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
128
+ var n = Object.prototype.toString.call(o).slice(8, -1);
129
+ if (n === "Object" && o.constructor) n = o.constructor.name;
130
+ if (n === "Map" || n === "Set") return Array.from(n);
131
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
132
+ }
133
+ function _ts_generator(thisArg, body) {
134
+ var f, y, t, _ = {
135
+ label: 0,
136
+ sent: function() {
137
+ if (t[0] & 1) throw t[1];
138
+ return t[1];
139
+ },
140
+ trys: [],
141
+ ops: []
142
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
143
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
144
+ return this;
145
+ }), g;
146
+ function verb(n) {
147
+ return function(v) {
148
+ return step([
149
+ n,
150
+ v
151
+ ]);
152
+ };
153
+ }
154
+ function step(op) {
155
+ if (f) throw new TypeError("Generator is already executing.");
156
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
157
+ 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;
158
+ if (y = 0, t) op = [
159
+ op[0] & 2,
160
+ t.value
161
+ ];
162
+ switch(op[0]){
163
+ case 0:
164
+ case 1:
165
+ t = op;
166
+ break;
167
+ case 4:
168
+ _.label++;
169
+ return {
170
+ value: op[1],
171
+ done: false
172
+ };
173
+ case 5:
174
+ _.label++;
175
+ y = op[1];
176
+ op = [
177
+ 0
178
+ ];
179
+ continue;
180
+ case 7:
181
+ op = _.ops.pop();
182
+ _.trys.pop();
183
+ continue;
184
+ default:
185
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
186
+ _ = 0;
187
+ continue;
188
+ }
189
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
190
+ _.label = op[1];
191
+ break;
192
+ }
193
+ if (op[0] === 6 && _.label < t[1]) {
194
+ _.label = t[1];
195
+ t = op;
196
+ break;
197
+ }
198
+ if (t && _.label < t[2]) {
199
+ _.label = t[2];
200
+ _.ops.push(op);
201
+ break;
202
+ }
203
+ if (t[2]) _.ops.pop();
204
+ _.trys.pop();
205
+ continue;
206
+ }
207
+ op = body.call(thisArg, _);
208
+ } catch (e) {
209
+ op = [
210
+ 6,
211
+ e
212
+ ];
213
+ y = 0;
214
+ } finally{
215
+ f = t = 0;
216
+ }
217
+ if (op[0] & 5) throw op[1];
218
+ return {
219
+ value: op[0] ? op[1] : void 0,
220
+ done: true
221
+ };
222
+ }
223
+ }
1
224
  import { jsx as _jsx } from "react/jsx-runtime";
225
+ import { useState, useEffect, isValidElement } from "react";
2
226
  import { tv } from "tailwind-variants";
3
227
  import * as PolarisIcons from "@shopify/polaris-icons";
228
+ /**
229
+ * @component Icon
230
+ *
231
+ * @description Renders an icon with configurable size, color, and display style. Supports Polaris icons (fill-based),
232
+ * Lucide icons (stroke-based), and custom SVG components. Polaris icons are detected automatically via displayName lookup;
233
+ * any unrecognized component is treated as a stroke-based (Lucide) icon. String sources are resolved in order: Polaris → internal Litho icons → dynamic Lucide import.
234
+ *
235
+ * @usage
236
+ * - DO: Use with Polaris or Lucide icon sources to add visual cues alongside text labels or inside buttons.
237
+ * - DON'T: Use icons as the sole means of conveying meaning without an accompanying text label or accessible name.
238
+ *
239
+ * @accessibility
240
+ * - Icons are decorative by default; pair with visible text or an `accessibilityLabel` on the parent component.
241
+ * - When used standalone (e.g., icon-only button), ensure the parent element provides an `aria-label`.
242
+ *
243
+ * @alternative
244
+ * - If you need a clickable icon, wrap in a `Button` with the `icon` prop instead of using Icon directly.
245
+ * - If you need a small image preview, use `Thumbnail` instead.
246
+ *
247
+ * @param {Object} props - The properties for configuring the Component.
248
+ * @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).
249
+ * @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.
250
+ * @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).
251
+ * @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
252
+ * @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.
253
+ * @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill (for Polaris icons with stroke paths).
254
+ * @param {number} [props.strokeWidth=2] - SVG stroke width for Lucide icons. 0.5–3 in 0.25 increments. Ignored for Polaris icons.
255
+ * @param {number} [props.opacity=100] - Container opacity 0–100 in steps of 10.
256
+ * @param {Function} [props.onClick] - Click handler for the icon.
257
+ * @param {string} [props.className] - Additional CSS classes to apply.
258
+ * @returns {JSX.Element} The rendered icon component with the specified styles.
259
+ *
260
+ * @example
261
+ * // Polaris icon
262
+ * <Icon source={TickMinor} color="success" size="lg" />
263
+ *
264
+ * // Lucide icon (direct import)
265
+ * import { Cable } from "lucide-react";
266
+ * <Icon source={Cable} color="info-alt-icon" size={12} opacity={70} />
267
+ *
268
+ * // Lucide icon (string-based dynamic loading)
269
+ * <Icon source="cable" color="info-alt-icon" size={12} />
270
+ */ // ---------------------------------------------------------------------------
271
+ // Styles (container)
272
+ // ---------------------------------------------------------------------------
4
273
  var styles = tv({
5
274
  base: "Litho-Icon",
6
275
  variants: {
@@ -10,21 +279,15 @@ var styles = tv({
10
279
  inline: "inline",
11
280
  "inline-block": "inline-block",
12
281
  "inline-flex": "inline-flex items-center justify-center"
13
- },
14
- size: {
15
- xs: "h-3 w-3 min-w-3",
16
- sm: "h-4 w-4 min-w-4",
17
- default: "h-5 w-5 min-w-5",
18
- lg: "h-6 w-6 min-w-6",
19
- xl: "h-7 w-7 min-w-7",
20
- "2xl": "h-8 w-8 min-w-8"
21
282
  }
22
283
  },
23
284
  defaultVariants: {
24
- display: "block",
25
- size: "default"
285
+ display: "block"
26
286
  }
27
287
  });
288
+ // ---------------------------------------------------------------------------
289
+ // Fill-based color styles (Polaris icons)
290
+ // ---------------------------------------------------------------------------
28
291
  var iconStyles = tv({
29
292
  base: "",
30
293
  variants: {
@@ -67,6 +330,7 @@ var iconStyles = tv({
67
330
  "info-icon": "fill-info-icon",
68
331
  "highlight-icon": "fill-highlight-icon",
69
332
  "insight-icon": "fill-insight-icon",
333
+ "btn-insight-icon": "fill-btn-insight-icon",
70
334
  "neutral-icon": "fill-neutral-icon",
71
335
  "success-alt-icon": "fill-success-alt-icon",
72
336
  "critical-alt-icon": "fill-critical-alt-icon",
@@ -76,7 +340,14 @@ var iconStyles = tv({
76
340
  "highlight-alt-icon": "fill-highlight-alt-icon",
77
341
  "insight-alt-icon": "fill-insight-alt-icon",
78
342
  "neutral-alt-icon": "fill-neutral-alt-icon",
79
- "FrameSaveBar": "fill-alternate dark:fill-black"
343
+ "FrameSaveBar": "fill-alternate dark:fill-black",
344
+ "brand": "fill-brand",
345
+ "brand-low": "fill-brand-low",
346
+ "brand-lower": "fill-brand-lower",
347
+ "brand-alternate": "fill-brand-alternate",
348
+ "brand-saturated": "fill-brand-saturated",
349
+ "brand-subdued": "fill-brand-subdued",
350
+ "brand-chat": "fill-brand-chat"
80
351
  },
81
352
  hoverColor: {
82
353
  white: "hover:fill-white group-hover/LithoIcon:fill-white",
@@ -155,6 +426,274 @@ var iconStyles = tv({
155
426
  color: "default"
156
427
  }
157
428
  });
429
+ // ---------------------------------------------------------------------------
430
+ // Stroke-based color map (Lucide / generic stroke icons)
431
+ // Mirrors iconStyles.color keys but uses text-* instead of fill-*
432
+ // Lucide SVGs use stroke="currentColor", so text-* classes set the icon color.
433
+ // ---------------------------------------------------------------------------
434
+ var STROKE_COLOR_MAP = {
435
+ // Core
436
+ white: "text-white",
437
+ default: "text-higher",
438
+ base: "text-higher",
439
+ subdued: "text-low",
440
+ lower: "text-lower",
441
+ link: "text-link",
442
+ primary: "text-link",
443
+ alternate: "text-alternate",
444
+ high: "text-high",
445
+ low: "text-low",
446
+ currentColor: "text-current",
447
+ // Status foreground
448
+ successFgAlternate: "text-fg-success-alternate",
449
+ success: "text-fg-success",
450
+ "fg-success": "text-fg-success",
451
+ critical: "text-fg-critical",
452
+ "fg-critical": "text-fg-critical",
453
+ criticalFgAlternate: "text-fg-critical-alternate",
454
+ warning: "text-attention-alt-icon",
455
+ info: "text-info-alt-icon",
456
+ caution: "text-fg-caution-alternate",
457
+ attention: "text-attention-alt-icon",
458
+ highlight: "text-highlight-alt-icon",
459
+ neutral: "text-neutral-alt-icon",
460
+ normal: "text-normal",
461
+ disabled: "text-lowest",
462
+ active: "text-tab-active-fg",
463
+ // Button-specific
464
+ "btn-primary-icon": "text-btn-primary-icon",
465
+ "btn-secondary-icon": "text-btn-secondary-icon",
466
+ "btn-plain-icon": "text-btn-plain-icon",
467
+ "btn-link-icon": "text-btn-link-icon",
468
+ "btn-destructive-icon": "text-btn-destructive-icon",
469
+ "btn-highlight-icon": "text-btn-highlight-icon",
470
+ // Input
471
+ inputFg: "text-form-input-fg",
472
+ inputFgDisabled: "text-form-input-fg-disabled",
473
+ // Status icons
474
+ "success-icon": "text-success-icon",
475
+ "critical-icon": "text-critical-icon",
476
+ "warning-icon": "text-warning-icon",
477
+ "attention-icon": "text-attention-icon",
478
+ "info-icon": "text-info-icon",
479
+ "highlight-icon": "text-highlight-icon",
480
+ "insight-icon": "text-insight-icon",
481
+ "btn-insight-icon": "text-btn-insight-icon",
482
+ "neutral-icon": "text-neutral-icon",
483
+ // Status alt icons
484
+ "success-alt-icon": "text-success-alt-icon",
485
+ "critical-alt-icon": "text-critical-alt-icon",
486
+ "warning-alt-icon": "text-attention-alt-icon",
487
+ "attention-alt-icon": "text-attention-alt-icon",
488
+ "info-alt-icon": "text-info-alt-icon",
489
+ "highlight-alt-icon": "text-highlight-alt-icon",
490
+ "insight-alt-icon": "text-insight-alt-icon",
491
+ "neutral-alt-icon": "text-neutral-alt-icon",
492
+ // Brand
493
+ "brand": "text-brand",
494
+ "brand-low": "text-brand-low",
495
+ "brand-lower": "text-brand-lower",
496
+ "brand-alternate": "text-brand-alternate",
497
+ "brand-saturated": "text-brand-saturated",
498
+ "brand-subdued": "text-brand-subdued",
499
+ "brand-chat": "text-brand-chat"
500
+ };
501
+ // ---------------------------------------------------------------------------
502
+ // Size system (extended to support Lucide's larger size range)
503
+ // ---------------------------------------------------------------------------
504
+ /** Map semantic size names to numeric tokens. */ var SEMANTIC_TO_TOKEN = {
505
+ xs: 3,
506
+ sm: 4,
507
+ default: 5,
508
+ lg: 6,
509
+ xl: 7,
510
+ "2xl": 8
511
+ };
512
+ /** Map numeric tokens (3-20) to pixel values. */ var TOKEN_TO_PX = {
513
+ 3: 12,
514
+ 4: 16,
515
+ 5: 20,
516
+ 6: 24,
517
+ 7: 28,
518
+ 8: 32,
519
+ 9: 36,
520
+ 10: 40,
521
+ 11: 44,
522
+ 12: 48,
523
+ 13: 52,
524
+ 14: 56,
525
+ 15: 60,
526
+ 16: 64,
527
+ 17: 68,
528
+ 18: 72,
529
+ 19: 76,
530
+ 20: 80
531
+ };
532
+ /** Static Tailwind classes for container sizing (avoids purge issues). Tokens without entries use inline styles. */ var SIZE_CLASSES = {
533
+ 3: "h-3 w-3 min-w-3",
534
+ 4: "h-4 w-4 min-w-4",
535
+ 5: "h-5 w-5 min-w-5",
536
+ 6: "h-6 w-6 min-w-6",
537
+ 7: "h-7 w-7 min-w-7",
538
+ 8: "h-8 w-8 min-w-8",
539
+ 9: "h-9 w-9 min-w-9",
540
+ 10: "h-10 w-10 min-w-10",
541
+ 11: "h-11 w-11 min-w-11",
542
+ 12: "h-12 w-12 min-w-12",
543
+ 14: "h-14 w-14 min-w-14",
544
+ 16: "h-16 w-16 min-w-16",
545
+ 20: "h-20 w-20 min-w-20"
546
+ };
547
+ var LITHO_TOKENS = [
548
+ 3,
549
+ 4,
550
+ 5,
551
+ 6,
552
+ 7,
553
+ 8,
554
+ 9,
555
+ 10,
556
+ 11,
557
+ 12,
558
+ 13,
559
+ 14,
560
+ 15,
561
+ 16,
562
+ 17,
563
+ 18,
564
+ 19,
565
+ 20
566
+ ];
567
+ /**
568
+ * Resolve the size prop to { px, sizeClass, sizeStyle }.
569
+ * Accepts: semantic string, numeric token (3-20), or raw px number.
570
+ */ var resolveSize = function(size) {
571
+ // Semantic name → token → px
572
+ if (typeof size === "string" && SEMANTIC_TO_TOKEN[size] !== undefined) {
573
+ var token = SEMANTIC_TO_TOKEN[size];
574
+ var px = TOKEN_TO_PX[token];
575
+ var sizeClass = SIZE_CLASSES[token] || null;
576
+ var sizeStyle = sizeClass ? null : {
577
+ width: px,
578
+ height: px,
579
+ minWidth: px
580
+ };
581
+ return {
582
+ px: px,
583
+ sizeClass: sizeClass,
584
+ sizeStyle: sizeStyle
585
+ };
586
+ }
587
+ // Numeric token → px
588
+ if (typeof size === "number" && LITHO_TOKENS.includes(size)) {
589
+ var px1 = TOKEN_TO_PX[size];
590
+ var sizeClass1 = SIZE_CLASSES[size] || null;
591
+ var sizeStyle1 = sizeClass1 ? null : {
592
+ width: px1,
593
+ height: px1,
594
+ minWidth: px1
595
+ };
596
+ return {
597
+ px: px1,
598
+ sizeClass: sizeClass1,
599
+ sizeStyle: sizeStyle1
600
+ };
601
+ }
602
+ // Raw px number (not a token)
603
+ if (typeof size === "number") {
604
+ return {
605
+ px: size,
606
+ sizeClass: null,
607
+ sizeStyle: {
608
+ width: size,
609
+ height: size,
610
+ minWidth: size
611
+ }
612
+ };
613
+ }
614
+ // Fallback to default
615
+ var px2 = TOKEN_TO_PX[5];
616
+ return {
617
+ px: px2,
618
+ sizeClass: SIZE_CLASSES[5],
619
+ sizeStyle: null
620
+ };
621
+ };
622
+ // ---------------------------------------------------------------------------
623
+ // Lucide dynamic loading
624
+ // ---------------------------------------------------------------------------
625
+ var lucideCache = new Map();
626
+ var toPascalCase = function(name) {
627
+ return name.split("-").map(function(p) {
628
+ return p[0].toUpperCase() + p.slice(1);
629
+ }).join("");
630
+ };
631
+ var loadLucideIcon = function(name) {
632
+ return _async_to_generator(function() {
633
+ var key, mod, icon, e;
634
+ return _ts_generator(this, function(_state) {
635
+ switch(_state.label){
636
+ case 0:
637
+ key = toPascalCase(name);
638
+ if (lucideCache.has(key)) return [
639
+ 2,
640
+ lucideCache.get(key)
641
+ ];
642
+ _state.label = 1;
643
+ case 1:
644
+ _state.trys.push([
645
+ 1,
646
+ 3,
647
+ ,
648
+ 4
649
+ ]);
650
+ return [
651
+ 4,
652
+ import("lucide-react")
653
+ ];
654
+ case 2:
655
+ mod = _state.sent();
656
+ icon = mod[key] || null;
657
+ lucideCache.set(key, icon);
658
+ return [
659
+ 2,
660
+ icon
661
+ ];
662
+ case 3:
663
+ e = _state.sent();
664
+ lucideCache.set(key, null);
665
+ return [
666
+ 2,
667
+ null
668
+ ];
669
+ case 4:
670
+ return [
671
+ 2
672
+ ];
673
+ }
674
+ });
675
+ })();
676
+ };
677
+ // ---------------------------------------------------------------------------
678
+ // StrokeWidth / Opacity helpers
679
+ // ---------------------------------------------------------------------------
680
+ var resolveStrokeWidth = function(strokeWidth) {
681
+ if (strokeWidth === undefined || strokeWidth === null) return undefined;
682
+ var n = Number(strokeWidth);
683
+ if (Number.isNaN(n)) return undefined;
684
+ var rounded = Math.round(n / 0.25) * 0.25;
685
+ return Math.round(Math.min(3, Math.max(0.5, rounded)) * 100) / 100;
686
+ };
687
+ var resolveOpacity = function(opacity) {
688
+ if (opacity === undefined || opacity === null) return 100;
689
+ var n = Number(opacity);
690
+ if (Number.isNaN(n)) return 100;
691
+ var rounded = Math.round(n / 10) * 10;
692
+ return Math.min(100, Math.max(0, rounded));
693
+ };
694
+ // ---------------------------------------------------------------------------
695
+ // Internal Litho icons (custom SVGs)
696
+ // ---------------------------------------------------------------------------
158
697
  var LithoIcons = function(param) {
159
698
  var className = param.className;
160
699
  return {
@@ -232,66 +771,146 @@ var LithoIcons = function(param) {
232
771
  })
233
772
  };
234
773
  };
774
+ // ---------------------------------------------------------------------------
775
+ // Component detection
776
+ // ---------------------------------------------------------------------------
235
777
  /**
236
- * A Component that renders an icon with customizable size, color, and display style, using Shopify Polaris icons.
237
- * The icon adapts styling based on the provided props and supports a range of color schemes and sizes.
238
- *
239
- * @component
240
- *
241
- * @param {Object} props - The properties for configuring the Component.
242
- * @param {Object} props.source - The source icon component from `@shopify/polaris-icons`. Should be a valid Polaris icon component.
243
- * @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.
244
- * @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.
245
- * @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
246
- * @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl')} [props.size="default"] - Sets the icon size.
247
- * - 'xs': Extra small (12px)
248
- * - 'sm': Small (16px)
249
- * - 'default': Medium (20px)
250
- * - 'lg': Large (24px)
251
- * - 'xl': Extra large (28px)
252
- * - '2xl': Double extra large (32px)
253
- * @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill.
254
- * @param {Function} [props.onClick] - Click handler for the icon.
255
- * @param {string} [props.className] - Additional CSS classes to apply.
256
- * @returns {JSX.Element} The rendered icon component with the specified styles.
257
- *
258
- * @example
259
- * <Icon
260
- * source={PolarisIcons.TickMinor}
261
- * color="success"
262
- * display="inline"
263
- * size="lg"
264
- * />
265
- */ function Icon() {
778
+ * Check if a value is a renderable React component (function, class, or forwardRef).
779
+ * Lucide icons are forwardRef objects (typeof "object" with a .render function).
780
+ * Polaris icons are plain functions.
781
+ */ var isComponent = function(value) {
782
+ return typeof value === "function" || (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null && typeof value.render === "function";
783
+ };
784
+ // ---------------------------------------------------------------------------
785
+ // Component
786
+ // ---------------------------------------------------------------------------
787
+ function Icon() {
266
788
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
267
- 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;
268
- var IconComponent = typeof source === "string" ? PolarisIcons[source] : PolarisIcons[source === null || source === void 0 ? void 0 : source.displayName];
269
- var classes = styles({
270
- display: display,
271
- size: size
272
- });
273
- var iconClasses = iconStyles({
789
+ 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;
790
+ // --- Resolve size ---
791
+ var resolved = resolveSize(size);
792
+ var resolvedStrokeWidth = resolveStrokeWidth(strokeWidth);
793
+ var resolvedOpacity = resolveOpacity(opacity);
794
+ // --- Detect icon type ---
795
+ // 1. Try Polaris lookup (by displayName for components, by string key for strings)
796
+ var polarisIcon = typeof source === "string" ? PolarisIcons[source] : isComponent(source) ? PolarisIcons[source === null || source === void 0 ? void 0 : source.displayName] : null;
797
+ // 2. Check for Litho internal icons (string sources only)
798
+ var fillClasses = iconStyles({
274
799
  color: color,
275
800
  stroke: stroke,
276
801
  hoverColor: hoverColor
277
802
  });
278
803
  var LithoIconComponents = LithoIcons({
279
- className: iconClasses
804
+ className: fillClasses
280
805
  });
281
- if (typeof source === "string" && LithoIconComponents[source]) {
282
- return /*#__PURE__*/ _jsx("div", {
283
- className: "".concat(classes).concat(className ? " ".concat(className) : ""),
284
- onClick: onClick,
285
- children: LithoIconComponents[source]
806
+ var lithoIcon = typeof source === "string" ? LithoIconComponents[source] : null;
807
+ // 3. If not Polaris and not Litho, treat function sources as Lucide/generic stroke icons
808
+ var isLucideComponent = !polarisIcon && !lithoIcon && isComponent(source);
809
+ // 4. If string not found in Polaris/Litho, try dynamic Lucide load
810
+ var needsDynamicLoad = !polarisIcon && !lithoIcon && typeof source === "string";
811
+ var _useState = _sliced_to_array(useState(null), 2), dynamicIcon = _useState[0], setDynamicIcon = _useState[1];
812
+ useEffect(function() {
813
+ if (!needsDynamicLoad) {
814
+ setDynamicIcon(null);
815
+ return;
816
+ }
817
+ var isMounted = true;
818
+ loadLucideIcon(source).then(function(icon) {
819
+ if (isMounted && icon) {
820
+ setDynamicIcon(function() {
821
+ return icon;
822
+ });
823
+ }
286
824
  });
287
- }
288
- return /*#__PURE__*/ _jsx("div", {
289
- className: "".concat(classes).concat(className ? " ".concat(className) : ""),
290
- onClick: onClick,
291
- children: IconComponent ? /*#__PURE__*/ _jsx(IconComponent, {
292
- className: iconClasses
293
- }) : source
825
+ return function() {
826
+ isMounted = false;
827
+ };
828
+ }, [
829
+ source,
830
+ needsDynamicLoad
831
+ ]);
832
+ // --- Build container classes ---
833
+ var displayClass = styles({
834
+ display: display
294
835
  });
836
+ var sizeClass = resolved.sizeClass || "";
837
+ var containerClasses = "".concat(displayClass).concat(sizeClass ? " ".concat(sizeClass) : "").concat(className ? " ".concat(className) : "");
838
+ var containerStyle = _object_spread({}, resolved.sizeStyle || {}, resolvedOpacity < 100 ? {
839
+ opacity: resolvedOpacity / 100
840
+ } : {});
841
+ var hasContainerStyle = Object.keys(containerStyle).length > 0;
842
+ // --- Shared interactive props for onClick ---
843
+ var interactiveProps = onClick ? {
844
+ role: "button",
845
+ tabIndex: 0,
846
+ onKeyDown: function(e) {
847
+ if (e.key === "Enter" || e.key === " ") {
848
+ e.preventDefault();
849
+ onClick(e);
850
+ }
851
+ }
852
+ } : {};
853
+ // --- Render: Litho internal icon ---
854
+ if (lithoIcon) {
855
+ return /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({
856
+ className: containerClasses,
857
+ style: hasContainerStyle ? containerStyle : undefined,
858
+ onClick: onClick
859
+ }, interactiveProps), {
860
+ children: lithoIcon
861
+ }));
862
+ }
863
+ // --- Render: Polaris icon ---
864
+ if (polarisIcon) {
865
+ var PolarisComponent = polarisIcon;
866
+ return /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({
867
+ className: containerClasses,
868
+ style: hasContainerStyle ? containerStyle : undefined,
869
+ onClick: onClick
870
+ }, interactiveProps), {
871
+ children: /*#__PURE__*/ _jsx(PolarisComponent, {
872
+ className: fillClasses
873
+ })
874
+ }));
875
+ }
876
+ // --- Render: Lucide icon (direct component or dynamically loaded) ---
877
+ var LucideComponent = isLucideComponent ? source : dynamicIcon;
878
+ if (LucideComponent) {
879
+ var strokeColorClass = color ? STROKE_COLOR_MAP[color] || "" : "";
880
+ // Lucide uses a 24x24 viewBox vs Polaris's 20x20, so render the SVG 4px
881
+ // smaller than the container to visually match Polaris icon sizing.
882
+ var lucideIconSize = Math.max(resolved.px - 3, 8);
883
+ var lucideProps = {
884
+ size: lucideIconSize
885
+ };
886
+ if (resolvedStrokeWidth !== undefined) {
887
+ lucideProps.strokeWidth = resolvedStrokeWidth;
888
+ }
889
+ // Override container to flex/inline-flex to center the smaller SVG
890
+ var lucideDisplay = display === "inline" || display === "inline-block" || display === "inline-flex" ? "inline-flex" : "flex";
891
+ var lucideContainerClasses = "".concat(styles({
892
+ display: lucideDisplay
893
+ })).concat(sizeClass ? " ".concat(sizeClass) : "").concat(className ? " ".concat(className) : "");
894
+ return /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({
895
+ className: lucideContainerClasses,
896
+ style: hasContainerStyle ? containerStyle : undefined,
897
+ onClick: onClick
898
+ }, interactiveProps), {
899
+ children: /*#__PURE__*/ _jsx(LucideComponent, _object_spread_props(_object_spread({}, lucideProps), {
900
+ className: strokeColorClass || undefined
901
+ }))
902
+ }));
903
+ }
904
+ // --- Render: JSX passthrough (ReactNode) or fallback ---
905
+ if (source && /*#__PURE__*/ isValidElement(source)) {
906
+ return /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({
907
+ className: containerClasses,
908
+ style: hasContainerStyle ? containerStyle : undefined,
909
+ onClick: onClick
910
+ }, interactiveProps), {
911
+ children: source
912
+ }));
913
+ }
914
+ return null;
295
915
  }
296
- ;
297
916
  export default Icon;