@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
@@ -55,7 +55,78 @@ import InlineError from "./InlineError.js";
55
55
  import Label from "./Label.js";
56
56
  import Link from "./Link.js";
57
57
  import Text from "./Text.js";
58
- var styles = tv({
58
+ /**
59
+ * @component TextField
60
+ *
61
+ * @description A text input component with label, help text, error handling, prefix/suffix, and character count support.
62
+ *
63
+ * @usage
64
+ * - DO: Use for single-line or multi-line text input with built-in labeling and validation.
65
+ * - DON'T: Use for selection from a fixed list (use Select or Autocomplete).
66
+ *
67
+ * @accessibility
68
+ * - Always provide a `label` prop; the label is programmatically associated with the input via `htmlFor`.
69
+ *
70
+ * @alternative
71
+ * - If you need a dropdown selection, use `Select`. If you need searchable selection, use `Autocomplete`.
72
+ *
73
+ * @param {Object} props - The properties for the TextField component.
74
+ * @param {string} [props.prefix] - Text content to display before the input.
75
+ * @param {string} [props.suffix] - Text content to display after the input.
76
+ * @param {string} [props.placeholder] - Placeholder text for the input.
77
+ * @param {string} [props.value=''] - The current value of the input.
78
+ * @param {string} [props.helpText] - Helper text to display below the input.
79
+ * @param {string} [props.label] - Label text for the input field.
80
+ * @param {string} [props.labelVariant='bodyMd'] - Visual variant for the label text.
81
+ * @param {Object} [props.labelAction] - Action button to display next to the label.
82
+ * @param {boolean} [props.labelHidden] - Whether to visually hide the label.
83
+ * @param {boolean} [props.disabled=false] - Whether the input is disabled. Defaults to false.
84
+ * @param {boolean} [props.clearButton] - Whether to show a clear button.
85
+ * @param {boolean} [props.readOnly] - Whether the input is read-only.
86
+ * @param {boolean} [props.autoFocus] - Whether to focus the input on mount.
87
+ * @param {boolean} [props.focused] - Whether the input is focused.
88
+ * @param {number} [props.multiline=1] - Number of lines for multiline input (1 for single line). Defaults to 1.
89
+ * @param {boolean} [props.autoGrow=false] - Whether textarea should automatically grow with content. Only applies when multiline > 1.
90
+ * @param {number} [props.maxHeight] - Maximum height in pixels before scrolling starts. Only applies when autoGrow is true.
91
+ * @param {string} [props.error] - Error message to display.
92
+ * @param {ReactNode} [props.connectedRight] - React element to connect to the right of the input.
93
+ * @param {ReactNode} [props.connectedLeft] - React element to connect to the left of the input.
94
+ * @param {string} [props.type='text'] - HTML input type. Defaults to 'text'.
95
+ * @param {boolean} [props.subdued=false] - Whether to use subdued styling.
96
+ * @param {string} [props.name] - Name attribute for the input.
97
+ * @param {string} [props.id] - ID for the input element.
98
+ * @param {string} [props.role] - ARIA role.
99
+ * @param {number} [props.step] - Step value for number inputs.
100
+ * @param {number} [props.largeStep=10] - Large step value when using shift + arrows.
101
+ * @param {string} [props.autoComplete] - HTML autocomplete attribute.
102
+ * @param {number} [props.max] - Maximum value for number inputs.
103
+ * @param {number} [props.maxLength] - Maximum length for text input.
104
+ * @param {number} [props.min] - Minimum value for number inputs.
105
+ * @param {number} [props.minLength] - Minimum length for text input.
106
+ * @param {string} [props.pattern] - Input validation pattern.
107
+ * @param {boolean} [props.spellCheck] - Whether to enable spell checking.
108
+ * @param {string} [props.ariaOwns] - ARIA owns attribute.
109
+ * @param {string} [props.ariaControls] - ARIA controls attribute.
110
+ * @param {boolean} [props.ariaExpanded] - ARIA expanded attribute.
111
+ * @param {string} [props.ariaActiveDescendant] - ARIA active descendant attribute.
112
+ * @param {string} [props.ariaAutocomplete] - ARIA autocomplete attribute.
113
+ * @param {('left'|'center'|'right')} [props.align='left'] - Text alignment within the input.
114
+ * @param {boolean} [props.requiredIndicator] - Whether to show a required field indicator.
115
+ * @param {boolean} [props.selectTextOnFocus] - Whether to select all text when focused.
116
+ * @param {Function} [props.onClearButtonClick] - Handler for clear button click.
117
+ * @param {Function} [props.onChange] - Handler for value changes.
118
+ * @param {Function} [props.onFocus] - Handler for input focus.
119
+ * @param {Function} [props.onBlur] - Handler for input blur.
120
+ * @param {Function} [props.onKeyDown] - Handler for key down.
121
+ * @param {ReactNode} [props.tooltip] - Tooltip content for the label.
122
+ * @param {string} [props.className] - Additional CSS classes.
123
+ * @param {string} [props.containerClassName] - Additional CSS classes for the outer container (Litho-TextFieldContainer).
124
+ * @param {ReactNode} [props.icon] - Icon to display before the input.
125
+ * @param {string} [props.iconColor='subdued'] - Color of the icon. Defaults to 'subdued'.
126
+ * @param {boolean} [props.disableFocusStyles=false] - Whether to disable focused styles when the input is focused.
127
+ * @param {boolean} [props.insight=false] - Whether to use insight/AI styling with insight-alt background, border, and text colors.
128
+ * @returns {JSX.Element} The rendered TextField component.
129
+ */ var styles = tv({
59
130
  base: "Litho-TextField group relative rounded-md border min-h-8 cursor-text",
60
131
  variants: {
61
132
  disabled: {
@@ -72,6 +143,10 @@ var styles = tv({
72
143
  transparent: {
73
144
  true: "border-transparent",
74
145
  false: ""
146
+ },
147
+ insight: {
148
+ true: "",
149
+ false: ""
75
150
  }
76
151
  },
77
152
  compoundVariants: [
@@ -119,12 +194,27 @@ var styles = tv({
119
194
  hasError: false,
120
195
  subdued: true,
121
196
  class: "bg-form-bg"
197
+ },
198
+ {
199
+ focused: false,
200
+ disabled: false,
201
+ hasError: false,
202
+ insight: true,
203
+ class: "bg-form-bg-insight border-form-border-insight"
204
+ },
205
+ {
206
+ focused: true,
207
+ disabled: false,
208
+ hasError: false,
209
+ insight: true,
210
+ class: "bg-form-bg-insight-low border-form-border-insight ring ring-form-focus-insight"
122
211
  }
123
212
  ],
124
213
  defaultVariants: {
125
214
  disabled: false,
126
215
  hasError: false,
127
- focused: false
216
+ focused: false,
217
+ insight: false
128
218
  }
129
219
  });
130
220
  var inputStyles = tv({
@@ -155,13 +245,23 @@ var inputStyles = tv({
155
245
  true: "placeholder-form-placeholder-error",
156
246
  false: "placeholder-form-placeholder"
157
247
  },
248
+ insight: {
249
+ true: "text-insight-alt-fg placeholder-insight-alt-fg/50",
250
+ false: ""
251
+ },
158
252
  type: {
159
253
  time: "hide-time-picker"
160
254
  }
161
255
  }
162
256
  });
163
257
  var iconStyles = tv({
164
- base: "Litho-TextField__Icon pl-0.5"
258
+ base: "Litho-TextField__Icon pl-0.5",
259
+ variants: {
260
+ hasMultiline: {
261
+ true: "self-start pt-1",
262
+ false: ""
263
+ }
264
+ }
165
265
  });
166
266
  var clearButtonStyles = tv({
167
267
  base: "Litho-TextField__ClearButton mr-1 rounded-md h-6 w-6 flex self-center items-center justify-center cursor-pointer bg-btn-outline hover:bg-btn-outline-low active:bg-btn-outline-lower",
@@ -172,65 +272,11 @@ var clearButtonStyles = tv({
172
272
  }
173
273
  }
174
274
  });
175
- /**
176
- * Renders a TextField component.
177
- *
178
- * @function TextField
179
- * @param {Object} props - The properties for the TextField component.
180
- * @param {string} [props.prefix] - Text content to display before the input.
181
- * @param {string} [props.suffix] - Text content to display after the input.
182
- * @param {string} [props.placeholder] - Placeholder text for the input.
183
- * @param {string} [props.value=''] - The current value of the input.
184
- * @param {string} [props.helpText] - Helper text to display below the input.
185
- * @param {string} [props.label] - Label text for the input field.
186
- * @param {string} [props.labelVariant='bodyMd'] - Visual variant for the label text.
187
- * @param {Object} [props.labelAction] - Action button to display next to the label.
188
- * @param {boolean} [props.labelHidden] - Whether to visually hide the label.
189
- * @param {boolean} [props.disabled=false] - Whether the input is disabled. Defaults to false.
190
- * @param {boolean} [props.clearButton] - Whether to show a clear button.
191
- * @param {boolean} [props.readOnly] - Whether the input is read-only.
192
- * @param {boolean} [props.autoFocus] - Whether to focus the input on mount.
193
- * @param {boolean} [props.focused] - Whether the input is focused.
194
- * @param {number} [props.multiline=1] - Number of lines for multiline input (1 for single line). Defaults to 1.
195
- * @param {boolean} [props.autoGrow=false] - Whether textarea should automatically grow with content. Only applies when multiline > 1.
196
- * @param {number} [props.maxHeight] - Maximum height in pixels before scrolling starts. Only applies when autoGrow is true.
197
- * @param {string} [props.error] - Error message to display.
198
- * @param {ReactNode} [props.connectedRight] - React element to connect to the right of the input.
199
- * @param {ReactNode} [props.connectedLeft] - React element to connect to the left of the input.
200
- * @param {string} [props.type='text'] - HTML input type. Defaults to 'text'.
201
- * @param {boolean} [props.subdued=false] - Whether to use subdued styling.
202
- * @param {string} [props.name] - Name attribute for the input.
203
- * @param {string} [props.id] - ID for the input element.
204
- * @param {string} [props.role] - ARIA role.
205
- * @param {number} [props.step] - Step value for number inputs.
206
- * @param {number} [props.largeStep=10] - Large step value when using shift + arrows.
207
- * @param {string} [props.autoComplete] - HTML autocomplete attribute.
208
- * @param {number} [props.max] - Maximum value for number inputs.
209
- * @param {number} [props.maxLength] - Maximum length for text input.
210
- * @param {number} [props.min] - Minimum value for number inputs.
211
- * @param {number} [props.minLength] - Minimum length for text input.
212
- * @param {string} [props.pattern] - Input validation pattern.
213
- * @param {boolean} [props.spellCheck] - Whether to enable spell checking.
214
- * @param {string} [props.ariaOwns] - ARIA owns attribute.
215
- * @param {string} [props.ariaControls] - ARIA controls attribute.
216
- * @param {boolean} [props.ariaExpanded] - ARIA expanded attribute.
217
- * @param {string} [props.ariaActiveDescendant] - ARIA active descendant attribute.
218
- * @param {string} [props.ariaAutocomplete] - ARIA autocomplete attribute.
219
- * @param {('left'|'center'|'right')} [props.align='left'] - Text alignment within the input.
220
- * @param {boolean} [props.requiredIndicator] - Whether to show a required field indicator.
221
- * @param {boolean} [props.selectTextOnFocus] - Whether to select all text when focused.
222
- * @param {Function} [props.onClearButtonClick] - Handler for clear button click.
223
- * @param {Function} [props.onChange] - Handler for value changes.
224
- * @param {Function} [props.onFocus] - Handler for input focus.
225
- * @param {Function} [props.onBlur] - Handler for input blur.
226
- * @param {Function} [props.onKeyDown] - Handler for key down.
227
- * @param {ReactNode} [props.tooltip] - Tooltip content for the label.
228
- * @param {string} [props.className] - Additional CSS classes.
229
- * @param {boolean} [props.disableFocusStyles=false] - Whether to disable focused styles when the input is focused.
230
- * @returns {JSX.Element} The rendered TextField component.
231
- */ function TextField() {
275
+ function TextField() {
232
276
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
233
- var prefix = props.prefix, _suffix = props.suffix, placeholder = props.placeholder, _props_value = props.value, value = _props_value === void 0 ? "" : _props_value, helpText = props.helpText, label = props.label, _props_labelVariant = props.labelVariant, labelVariant = _props_labelVariant === void 0 ? "bodyMd" : _props_labelVariant, labelAction = props.labelAction, labelHidden = props.labelHidden, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, clearButton = props.clearButton, readOnly = props.readOnly, autoFocus = props.autoFocus, _focused = props.focused, _props_multiline = props.multiline, multiline = _props_multiline === void 0 ? 1 : _props_multiline, _props_autoGrow = props.autoGrow, autoGrow = _props_autoGrow === void 0 ? false : _props_autoGrow, maxHeight = props.maxHeight, error = props.error, connectedRight = props.connectedRight, connectedLeft = props.connectedLeft, _props_type = props.type, type = _props_type === void 0 ? "text" : _props_type, _props_subdued = props.subdued, subdued = _props_subdued === void 0 ? false : _props_subdued, name = props.name, _id = props.id, role = props.role, step = props.step, _props_largeStep = props.largeStep, largeStep = _props_largeStep === void 0 ? 10 : _props_largeStep, autoComplete = props.autoComplete, max = props.max, maxLength = props.maxLength, min = props.min, minLength = props.minLength, _props_showCharacterCount = props.showCharacterCount, showCharacterCount = _props_showCharacterCount === void 0 ? false : _props_showCharacterCount, pattern = props.pattern, spellCheck = props.spellCheck, ariaOwns = props.ariaOwns, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaActiveDescendant = props.ariaActiveDescendant, ariaAutocomplete = props.ariaAutocomplete, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, requiredIndicator = props.requiredIndicator, selectTextOnFocus = props.selectTextOnFocus, onClearButtonClick = props.onClearButtonClick, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, tooltip = props.tooltip, className = props.className, _inputRef = props.inputRef, icon = props.icon, _props_transparent = props.transparent, transparent = _props_transparent === void 0 ? false : _props_transparent, _props_showNumberSteppers = props.showNumberSteppers, showNumberSteppers = _props_showNumberSteppers === void 0 ? true : _props_showNumberSteppers, onKeyDown = props.onKeyDown, _props_disableFocusStyles = props.disableFocusStyles, disableFocusStyles = _props_disableFocusStyles === void 0 ? false : _props_disableFocusStyles;
277
+ var prefix = props.prefix, _suffix = props.suffix, placeholder = props.placeholder, _props_value = props.value, value = _props_value === void 0 ? "" : _props_value, helpText = props.helpText, label = props.label, _props_labelVariant = props.labelVariant, labelVariant = _props_labelVariant === void 0 ? "bodyMd" : _props_labelVariant, labelAction = props.labelAction, labelHidden = props.labelHidden, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, clearButton = props.clearButton, readOnly = props.readOnly, autoFocus = props.autoFocus, _focused = props.focused, _props_multiline = props.multiline, multiline = _props_multiline === void 0 ? 1 : _props_multiline, _props_autoGrow = props.autoGrow, autoGrow = _props_autoGrow === void 0 ? false : _props_autoGrow, maxHeight = props.maxHeight, error = props.error, connectedRight = props.connectedRight, connectedLeft = props.connectedLeft, _props_type = props.type, type = _props_type === void 0 ? "text" : _props_type, _props_subdued = props.subdued, subdued = _props_subdued === void 0 ? false : _props_subdued, name = props.name, _id = props.id, role = props.role, step = props.step, _props_largeStep = props.largeStep, largeStep = _props_largeStep === void 0 ? 10 : _props_largeStep, autoComplete = props.autoComplete, max = props.max, maxLength = props.maxLength, min = props.min, minLength = props.minLength, _props_showCharacterCount = props.showCharacterCount, showCharacterCount = _props_showCharacterCount === void 0 ? false : _props_showCharacterCount, pattern = props.pattern, spellCheck = props.spellCheck, ariaOwns = props.ariaOwns, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaActiveDescendant = props.ariaActiveDescendant, ariaAutocomplete = props.ariaAutocomplete, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, requiredIndicator = props.requiredIndicator, selectTextOnFocus = props.selectTextOnFocus, onClearButtonClick = props.onClearButtonClick, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, tooltip = props.tooltip, className = props.className, containerClassName = props.containerClassName, _inputRef = props.inputRef, icon = props.icon, _iconColor = props.iconColor, _props_transparent = props.transparent, transparent = _props_transparent === void 0 ? false : _props_transparent, _props_insight = props.insight, insight = _props_insight === void 0 ? false : _props_insight, _props_showNumberSteppers = props.showNumberSteppers, showNumberSteppers = _props_showNumberSteppers === void 0 ? true : _props_showNumberSteppers, onKeyDown = props.onKeyDown, _props_disableFocusStyles = props.disableFocusStyles, disableFocusStyles = _props_disableFocusStyles === void 0 ? false : _props_disableFocusStyles;
278
+ var effectiveIcon = insight && !icon ? MagicMajor : icon;
279
+ var effectiveIconColor = insight ? _iconColor || "insight-icon" : _iconColor || "subdued";
234
280
  var suffix = maxLength && showCharacterCount ? "".concat(value.length, " / ").concat(maxLength) : _suffix;
235
281
  var _internalRef = useRef(null);
236
282
  var inputRef = _inputRef || _internalRef;
@@ -238,7 +284,7 @@ var clearButtonStyles = tv({
238
284
  var _useState1 = _sliced_to_array(useState(_focused), 2), focused = _useState1[0], setFocused = _useState1[1];
239
285
  var hasError = !!error;
240
286
  var hasSuffix = !!suffix || maxLength && showCharacterCount;
241
- var hasPrefix = !!prefix || !!icon;
287
+ var hasPrefix = !!prefix || !!effectiveIcon;
242
288
  var hasMultiline = multiline > 1;
243
289
  var hasConnectedLeft = !!connectedLeft;
244
290
  var hasConnectedRight = !!connectedRight;
@@ -291,9 +337,12 @@ var clearButtonStyles = tv({
291
337
  hasError: hasError,
292
338
  focused: Boolean(focused && !readOnly && !disableFocusStyles),
293
339
  subdued: subdued,
294
- transparent: transparent
340
+ transparent: transparent,
341
+ insight: insight
342
+ });
343
+ var iconClasses = iconStyles({
344
+ hasMultiline: hasMultiline
295
345
  });
296
- var iconClasses = iconStyles();
297
346
  var inputClasses = inputStyles({
298
347
  hasSuffix: hasSuffix,
299
348
  hasPrefix: hasPrefix,
@@ -302,7 +351,8 @@ var clearButtonStyles = tv({
302
351
  hasError: hasError,
303
352
  readOnly: readOnly,
304
353
  align: align,
305
- type: type
354
+ type: type,
355
+ insight: insight
306
356
  });
307
357
  var clearButtonClasses = clearButtonStyles({
308
358
  visible: (value === null || value === void 0 ? void 0 : value.length) > 0 && !readOnly && !disabled
@@ -333,9 +383,9 @@ var clearButtonStyles = tv({
333
383
  }
334
384
  };
335
385
  var memoizedIcon = useMemo(function() {
336
- return icon;
386
+ return effectiveIcon;
337
387
  }, [
338
- icon
388
+ effectiveIcon
339
389
  ]);
340
390
  useEffect(function() {
341
391
  // Handle auto-growing textarea
@@ -387,7 +437,7 @@ var clearButtonStyles = tv({
387
437
  className: iconClasses,
388
438
  children: /*#__PURE__*/ _jsx(Icon, {
389
439
  source: memoizedIcon,
390
- color: "subdued"
440
+ color: effectiveIconColor
391
441
  })
392
442
  }),
393
443
  /*#__PURE__*/ _jsx(InputElement, {
@@ -493,7 +543,7 @@ var clearButtonStyles = tv({
493
543
  })
494
544
  });
495
545
  return /*#__PURE__*/ _jsxs("div", {
496
- className: "Litho-TextFieldContainer flex flex-col gap-1",
546
+ className: "Litho-TextFieldContainer flex flex-col gap-1".concat(containerClassName ? " ".concat(containerClassName) : ""),
497
547
  children: [
498
548
  label && !labelHidden && /*#__PURE__*/ _jsxs("div", {
499
549
  className: "flex justify-between items-end",
@@ -2,7 +2,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { tv } from "tailwind-variants";
3
3
  import Icon from "./Icon.js";
4
4
  import { ImageMajor } from "@shopify/polaris-icons";
5
- var imageContainerStyles = tv({
5
+ /**
6
+ * @component Thumbnail
7
+ *
8
+ * @description A small, fixed-size image preview component with automatic placeholder fallback when no source is provided.
9
+ *
10
+ * @usage
11
+ * - DO: Use for small, fixed-size image previews in lists, tables, or resource items.
12
+ * - DON'T: Use for large content images or hero banners; use `Image` for those cases.
13
+ *
14
+ * @accessibility
15
+ * - Always provide an `alt` prop describing the image content for screen readers.
16
+ * - When no image is available, the component renders a placeholder icon automatically.
17
+ *
18
+ * @alternative
19
+ * - If you need a full-size responsive image, use `Image` instead.
20
+ * - If you need an icon without an image container, use `Icon` instead.
21
+ *
22
+ * @param {Object} props - The component props.
23
+ * @param {string} [props.src] - The image source URL.
24
+ * @param {string} [props.alt] - The alternative text for the image.
25
+ * @param {("small"|"medium"|"large"|number)} [props.size="medium"] - The size of the thumbnail. Can be "small", "medium", "large", or a numeric pixel value.
26
+ * @param {boolean} [props.skeleton=false] - Whether to show a skeleton loader instead of the image.
27
+ * @returns {JSX.Element} The rendered Thumbnail component.
28
+ */ var imageContainerStyles = tv({
6
29
  base: "relative flex items-center justify-center overflow-hidden rounded-lg border border-tint-4 bg-surface-higher group",
7
30
  variants: {
8
31
  size: {
@@ -21,16 +44,7 @@ var imageStyles = tv({
21
44
  size: "medium"
22
45
  }
23
46
  });
24
- /**
25
- * Thumbnail component to display an image or a placeholder icon.
26
- *
27
- * @param {Object} props - The component props.
28
- * @param {string} [props.src] - The image source URL.
29
- * @param {string} [props.alt] - The alternative text for the image.
30
- * @param {("small"|"medium"|"large"|number)} [props.size="medium"] - The size of the thumbnail. Can be "small", "medium", "large", or a numeric pixel value.
31
- * @param {boolean} [props.skeleton=false] - Whether to show a skeleton loader instead of the image.
32
- * @returns {JSX.Element} The rendered Thumbnail component.
33
- */ function Thumbnail() {
47
+ function Thumbnail() {
34
48
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
35
49
  var src = props.src, alt = props.alt, _props_size = props.size, size = _props_size === void 0 ? "medium" : _props_size, _props_skeleton = props.skeleton, skeleton = _props_skeleton === void 0 ? false : _props_skeleton;
36
50
  var sizeIsInteger = Number.isInteger(size);
@@ -1,6 +1,27 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import TextField from "./TextField.js";
3
- function TimePicker() {
3
+ /**
4
+ * @component TimePicker
5
+ *
6
+ * @description A time selection input that wraps a TextField with type='time' for picking specific times.
7
+ *
8
+ * @usage
9
+ * - DO: Use for selecting specific times in scheduling or event forms.
10
+ * - DON'T: Use for date selection (use DatePicker).
11
+ *
12
+ * @accessibility
13
+ * - Wraps a TextField with type="time" for native keyboard and screen reader support; always provide a label.
14
+ *
15
+ * @alternative
16
+ * - If you need date selection, use `DatePicker`. If you need freeform text input, use `TextField`.
17
+ *
18
+ * @param {Object} [props={}] - The properties for the TimePicker component.
19
+ * @param {string} [props.label="Time:"] - The label text for the time input.
20
+ * @param {boolean} [props.labelInline=true] - Whether to display the label inline as a prefix.
21
+ * @param {string} [props.value] - The current time value (in HH:mm format).
22
+ * @param {Function} [props.onChange] - Callback function invoked when the time value changes.
23
+ * @returns {JSX.Element} The rendered TimePicker component.
24
+ */ function TimePicker() {
4
25
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
5
26
  var _props_label = props.label, label = _props_label === void 0 ? "Time:" : _props_label, _props_labelInline = props.labelInline, labelInline = _props_labelInline === void 0 ? true : _props_labelInline, value = props.value, onChange = props.onChange;
6
27
  return /*#__PURE__*/ _jsx(TextField, {
@@ -1,10 +1,91 @@
1
+ "use client";
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ function ownKeys(object, enumerableOnly) {
31
+ var keys = Object.keys(object);
32
+ if (Object.getOwnPropertySymbols) {
33
+ var symbols = Object.getOwnPropertySymbols(object);
34
+ if (enumerableOnly) {
35
+ symbols = symbols.filter(function(sym) {
36
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
+ });
38
+ }
39
+ keys.push.apply(keys, symbols);
40
+ }
41
+ return keys;
42
+ }
43
+ function _object_spread_props(target, source) {
44
+ source = source != null ? source : {};
45
+ if (Object.getOwnPropertyDescriptors) {
46
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
47
+ } else {
48
+ ownKeys(Object(source)).forEach(function(key) {
49
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
+ });
51
+ }
52
+ return target;
53
+ }
1
54
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
55
  import React, { cloneElement, isValidElement, useMemo } from "react";
3
56
  import { tv } from "tailwind-variants";
4
57
  import Icon from "./Icon.js";
58
+ import Button from "./Button.js";
59
+ import Text from "./Text.js";
5
60
  import { AlertMinor, CancelMinor, InfoMinor, MagicMajor } from "@shopify/polaris-icons";
6
- var styles = tv({
7
- base: "Litho-Tip relative flex rounded-md p-2",
61
+ /**
62
+ * @component Tip
63
+ *
64
+ * @description A subtle inline hint component that displays contextual guidance or tips within a page section.
65
+ *
66
+ * @usage
67
+ * - DO: Provide helpful, non-critical contextual hints or best practices inline.
68
+ * - DON'T: Use for important alerts or errors (use Banner).
69
+ *
70
+ * @accessibility
71
+ * - Tip content is read as regular page content; ensure the tip text is meaningful without relying on its icon.
72
+ *
73
+ * @alternative
74
+ * - If you need a prominent alert with actions, use `Banner`.
75
+ * - If you need a global notification bar, use `AnnouncementBar`.
76
+ *
77
+ * @param {Object} props - The component props.
78
+ * @param {"info" | "critical" | "success" | "warning" | "attention" | "highlight" | "neutral" | "plain" | "minimal"} [props.status="info"] - The status type of the tip.
79
+ * @param {Function} [props.onDismiss] - Function to call when the dismiss button is clicked.
80
+ * @param {Function} [props.onClick] - Function to call when the tip is clicked.
81
+ * @param {React.ReactNode} props.children - The content of the tip.
82
+ * @param {React.ElementType} [props.icon] - Custom icon for the tip.
83
+ * @param {"left" | "right" | "center"} [props.align="left"] - The alignment of the tip.
84
+ * @param {Array<{content: string, onAction: Function}>} [props.actions] - Array of action objects to show as buttons at the bottom.
85
+ * @param {string | React.ReactNode} [props.title=null] - Optional title shown above the tip content.
86
+ * @returns {JSX.Element} The rendered Tip component.
87
+ */ var styles = tv({
88
+ base: "Litho-Tip relative flex rounded-md",
8
89
  variants: {
9
90
  status: {
10
91
  success: "bg-success-alt text-success-alt-fg",
@@ -14,7 +95,8 @@ var styles = tv({
14
95
  highlight: "bg-highlight-alt text-highlight-alt-fg",
15
96
  insight: "bg-insight-alt text-insight-alt-fg",
16
97
  info: "bg-info-alt text-info-alt-fg",
17
- plain: "bg-transparent text-subdued px-0!"
98
+ plain: "bg-transparent text-high border border-border-subdued rounded-lg",
99
+ minimal: "bg-transparent text-high"
18
100
  },
19
101
  dismissible: {
20
102
  true: "pr-8"
@@ -24,19 +106,29 @@ var styles = tv({
24
106
  },
25
107
  border: {
26
108
  true: "border border-tint-2"
109
+ },
110
+ padding: {
111
+ default: "p-2",
112
+ md: "p-3",
113
+ lg: "p-4"
27
114
  }
28
115
  },
29
116
  defaultVariants: {
30
117
  status: "info",
31
118
  dismissible: false,
32
119
  clickable: false,
33
- border: false
120
+ border: false,
121
+ padding: "default"
34
122
  },
35
123
  compoundVariants: [
36
124
  {
37
125
  clickable: true,
38
126
  status: "info",
39
127
  className: "hover:outline hover:outline-info-alt-lower"
128
+ },
129
+ {
130
+ status: "minimal",
131
+ className: "!p-0"
40
132
  }
41
133
  ]
42
134
  });
@@ -81,29 +173,20 @@ var statusHelpers = {
81
173
  insight: {
82
174
  icon: MagicMajor
83
175
  },
84
- neutral: {}
176
+ neutral: {},
177
+ minimal: {}
85
178
  };
86
- /**
87
- * Tip component for displaying informational messages with optional dismiss functionality.
88
- *
89
- * @param {Object} props - The component props.
90
- * @param {"info" | "critical" | "success" | "warning" | "attention" | "highlight" | "neutral"} [props.status="info"] - The status type of the tip.
91
- * @param {Function} [props.onDismiss] - Function to call when the dismiss button is clicked.
92
- * @param {Function} [props.onClick] - Function to call when the tip is clicked.
93
- * @param {React.ReactNode} props.children - The content of the tip.
94
- * @param {React.ElementType} [props.icon] - Custom icon for the tip.
95
- * @param {"left" | "right" | "center"} [props.align="left"] - The alignment of the tip.
96
- * @returns {JSX.Element} The rendered Tip component.
97
- */ function Tip() {
179
+ function Tip() {
98
180
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
99
181
  var _statusHelpers_status;
100
- var _props_status = props.status, status = _props_status === void 0 ? "info" : _props_status, onClick = props.onClick, onDismiss = props.onDismiss, children = props.children, _icon = props.icon, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, border = props.border;
182
+ var _props_status = props.status, status = _props_status === void 0 ? "info" : _props_status, onClick = props.onClick, onDismiss = props.onDismiss, children = props.children, _icon = props.icon, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, border = props.border, actions = props.actions, _props_title = props.title, title = _props_title === void 0 ? null : _props_title, _props_padding = props.padding, padding = _props_padding === void 0 ? "default" : _props_padding;
101
183
  var icon = _icon === null ? null : _icon || ((_statusHelpers_status = statusHelpers[status]) === null || _statusHelpers_status === void 0 ? void 0 : _statusHelpers_status.icon) || InfoMinor;
102
184
  var classes = styles({
103
185
  status: status,
104
186
  dismissible: !!onDismiss,
105
187
  clickable: !!onClick,
106
- border: border
188
+ border: border,
189
+ padding: padding
107
190
  });
108
191
  var base = "-alt-icon";
109
192
  var iconColorMap = {
@@ -115,7 +198,9 @@ var statusHelpers = {
115
198
  highlight: "highlight".concat(base),
116
199
  insight: "insight".concat(base),
117
200
  neutral: "neutral".concat(base),
118
- default: "info".concat(base)
201
+ default: "info".concat(base),
202
+ plain: "subdued",
203
+ minimal: "subdued"
119
204
  };
120
205
  var iconColor = iconColorMap[status] || iconColorMap.default;
121
206
  var processedChildren = useMemo(function() {
@@ -139,9 +224,19 @@ var statusHelpers = {
139
224
  children,
140
225
  status
141
226
  ]);
142
- return /*#__PURE__*/ _jsxs("div", {
227
+ return /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
143
228
  className: classes,
144
- onClick: onClick,
229
+ onClick: onClick
230
+ }, onClick ? {
231
+ role: "button",
232
+ tabIndex: 0,
233
+ onKeyDown: function(e) {
234
+ if (e.key === "Enter" || e.key === " ") {
235
+ e.preventDefault();
236
+ onClick(e);
237
+ }
238
+ }
239
+ } : {}), {
145
240
  children: [
146
241
  /*#__PURE__*/ _jsxs("div", {
147
242
  className: innerStyles({
@@ -152,8 +247,28 @@ var statusHelpers = {
152
247
  source: icon,
153
248
  color: iconColor
154
249
  }),
155
- /*#__PURE__*/ _jsx("div", {
156
- children: processedChildren
250
+ /*#__PURE__*/ _jsxs("div", {
251
+ className: "flex flex-col gap-1 flex-1",
252
+ children: [
253
+ title != null && title !== "" && /*#__PURE__*/ _jsx(Text, {
254
+ fontWeight: "medium",
255
+ children: title
256
+ }),
257
+ /*#__PURE__*/ _jsx("div", {
258
+ children: processedChildren
259
+ }),
260
+ (actions === null || actions === void 0 ? void 0 : actions.length) > 0 && /*#__PURE__*/ _jsx("div", {
261
+ className: "relative -left-3 flex items-center",
262
+ children: actions.map(function(action, i) {
263
+ return /*#__PURE__*/ _jsx(Button, {
264
+ plain: true,
265
+ size: "small",
266
+ onClick: action.onAction,
267
+ children: action.content
268
+ }, i);
269
+ })
270
+ })
271
+ ]
157
272
  })
158
273
  ]
159
274
  }),
@@ -168,6 +283,6 @@ var statusHelpers = {
168
283
  })
169
284
  })
170
285
  ]
171
- });
286
+ }));
172
287
  }
173
288
  export default Tip;