@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
@@ -125,7 +125,35 @@ function _unsupported_iterable_to_array(o, minLen) {
125
125
  if (n === "Map" || n === "Set") return Array.from(n);
126
126
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
127
127
  }
128
- // Reference counter for pane open state (shared across all Pane components)
128
+ /**
129
+ * @component Pane
130
+ *
131
+ * @description A slide-in side panel overlay for displaying supplementary content, detail views, or multi-tab workflows alongside the main page.
132
+ *
133
+ * @usage
134
+ * - DO: Use for secondary content panels that slide in from the side without blocking the main page.
135
+ * - DON'T: Use for focused tasks requiring full attention (use Modal).
136
+ *
137
+ * @accessibility
138
+ * - Manages focus within the pane when open; supports keyboard dismissal via Escape key. Ensure title provides context.
139
+ *
140
+ * @alternative
141
+ * - If you need a blocking dialog, use `Modal`. If you need inline expandable content, use `Collapsible`.
142
+ *
143
+ * @param {Object} props - Component properties.
144
+ * @param {boolean} props.open - Whether the pane is open.
145
+ * @param {Function} [props.onClose] - Callback fired when the pane is closed.
146
+ * @param {Function} [props.onOpen] - Callback fired when the pane should be opened (for auto-open functionality).
147
+ * @param {React.ReactNode} props.children - Content to render inside the pane.
148
+ * @param {Object} [props.tabStorage] - Shared tab storage object for managing pane tabs.
149
+ * @param {Function} [props.onTabRemove] - Callback when a tab is removed, receives (tabId, tab).
150
+ * @param {Object} [props.onExpandRef] - Ref to expose the expand function to the parent.
151
+ * @param {string} [props.tabId] - Optional tab ID; if provided, will reuse an existing tab with this ID.
152
+ * @param {string} [props.tabTitle] - Tab title to display.
153
+ * @param {string} [props.tabKey] - Optional stable key for tab deduplication.
154
+ * @param {string} [props.orgId] - Optional organization ID to scope the pane state.
155
+ * @returns {JSX.Element|null} The rendered Pane component, or null if not open.
156
+ */ // Reference counter for pane open state (shared across all Pane components)
129
157
  var paneOpenCount = 0;
130
158
  var MIN_PANE_WIDTH = 360;
131
159
  var MAX_PANE_WIDTH = 800;
@@ -727,7 +755,21 @@ function Pane() {
727
755
  })
728
756
  });
729
757
  }
730
- function Header() {
758
+ /**
759
+ * @component Pane.Header
760
+ *
761
+ * @usage
762
+ * - DO: Provide title and close action for the pane.
763
+ *
764
+ * @param {Object} props - Component properties.
765
+ * @param {string|React.ReactNode} [props.title] - Title text or custom element for the header.
766
+ * @param {string|React.ReactNode} [props.subtitle] - Subtitle text or custom element.
767
+ * @param {Array<Object>} [props.actions=[]] - Array of action button configurations.
768
+ * @param {boolean} [props.bottomBorder=true] - Whether to show a bottom border.
769
+ * @param {React.ReactNode} [props.subHeader] - Additional content rendered below the header row.
770
+ * @param {Object} [props.backAction] - Back navigation action with onAction callback and accessibilityLabel.
771
+ * @returns {JSX.Element} The rendered Pane.Header component.
772
+ */ function Header() {
731
773
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
732
774
  var title = props.title, subtitle = props.subtitle, _props_actions = props.actions, actions = _props_actions === void 0 ? [] : _props_actions, _props_bottomBorder = props.bottomBorder, bottomBorder = _props_bottomBorder === void 0 ? true : _props_bottomBorder, subHeader = props.subHeader, tmp = props.backAction, _backAction = tmp === void 0 ? null : tmp;
733
775
  var _useState = _sliced_to_array((0, _react.useState)(null), 2), showActionsPopover = _useState[0], setShowActionsPopover = _useState[1];
@@ -819,7 +861,18 @@ function Header() {
819
861
  });
820
862
  }
821
863
  Pane.Header = Header;
822
- function Content() {
864
+ /**
865
+ * @component Pane.Content
866
+ *
867
+ * @usage
868
+ * - DO: Wrap scrollable content within the pane.
869
+ *
870
+ * @param {Object} props - Component properties.
871
+ * @param {React.ReactNode} props.children - Content to render inside the pane body.
872
+ * @param {boolean} [props.padded=true] - Whether to apply padding to the content area.
873
+ * @param {string} [props.className] - Additional CSS class names.
874
+ * @returns {JSX.Element} The rendered Pane.Content component.
875
+ */ function Content() {
823
876
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
824
877
  var children = props.children, _props_padded = props.padded, padded = _props_padded === void 0 ? true : _props_padded, className = props.className;
825
878
  return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
@@ -828,7 +881,17 @@ function Content() {
828
881
  });
829
882
  }
830
883
  Pane.Content = Content;
831
- function Footer() {
884
+ /**
885
+ * @component Pane.Footer
886
+ *
887
+ * @usage
888
+ * - DO: Place action buttons at the bottom of the pane.
889
+ *
890
+ * @param {Object} props - Component properties.
891
+ * @param {React.ReactNode} props.children - Content to render inside the footer.
892
+ * @param {boolean} [props.topBorder=true] - Whether to show a top border.
893
+ * @returns {JSX.Element} The rendered Pane.Footer component.
894
+ */ function Footer() {
832
895
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
833
896
  var children = props.children, _props_topBorder = props.topBorder, topBorder = _props_topBorder === void 0 ? true : _props_topBorder;
834
897
  var isMobile = (0, _useMobile.useMobile)(MOBILE_BREAKPOINT);
@@ -158,24 +158,21 @@ function _unsupported_iterable_to_array(o, minLen) {
158
158
  if (n === "Map" || n === "Set") return Array.from(n);
159
159
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
160
160
  }
161
- var TOP_SPACING = 4;
162
- var EDGE_SPACING = 16;
163
- var styles = (0, _tailwindvariants.tv)({
164
- base: "Litho-Popover bg-surface-highest rounded-sm max-h-100 overflow-y-auto overflow-x-hidden shadow-popover dark:shadow-popover-dark outline outline-tint-3 min-w-32 overscroll-contain dark:outline-hidden dark:border-t dark:border-tint-alt-2",
165
- variants: {
166
- maxWidth: {
167
- default: "max-w-80",
168
- datePicker: "max-w-75 @sm:max-w-full",
169
- none: ""
170
- },
171
- sectioned: {
172
- true: "Litho-Popover--Sectioned p-4",
173
- false: ""
174
- }
175
- }
176
- });
177
161
  /**
178
- * Popover component for displaying an overlay near an activator.
162
+ * @component Popover
163
+ *
164
+ * @description An anchored floating panel that displays interactive content like menus, forms, or action lists when triggered.
165
+ *
166
+ * @usage
167
+ * - DO: Display interactive content (menus, forms, pickers) anchored to a trigger.
168
+ * - DON'T: Use for simple text hints (use Tooltip).
169
+ *
170
+ * @accessibility
171
+ * - Manages focus trap and keyboard dismissal (Escape key); ensure the trigger has `aria-expanded` and `aria-haspopup`.
172
+ *
173
+ * @alternative
174
+ * - If you need non-interactive supplementary text, use `Tooltip`.
175
+ * - If you need a full dialog, use `Modal`.
179
176
  *
180
177
  * @param {Object} props - The component props.
181
178
  * @param {string|React.ComponentType} [props.activatorWrapper="div"] - The wrapper element for the activator.
@@ -189,18 +186,39 @@ var styles = (0, _tailwindvariants.tv)({
189
186
  * @param {boolean} [props.sectioned=false] - Whether the popover content is sectioned with padding.
190
187
  * @param {string} [props.preferredAlignment="center"] - Preferred alignment for the popover (left, center, right).
191
188
  * @param {string} [props.preferredPosition="below"] - Preferred position for the popover (above, below, cover, left, right).
189
+ * @param {number} [props.horizontalOffset] - Custom horizontal offset in pixels to adjust the popover position.
192
190
  * @param {string} [props.className] - Additional class name for the popover.
193
191
  * @param {string} [props.containerClassName] - Additional class name for the popover container.
194
192
  * @returns {JSX.Element} The rendered popover component.
195
- */ function Popover() {
193
+ */ var TOP_SPACING = 4;
194
+ var EDGE_SPACING = 16;
195
+ var styles = (0, _tailwindvariants.tv)({
196
+ base: "Litho-Popover bg-surface-highest rounded-sm max-h-100 overflow-y-auto overflow-x-hidden shadow-popover dark:shadow-popover-dark outline outline-tint-3 min-w-32 overscroll-contain dark:outline-hidden dark:border-t dark:border-tint-alt-2",
197
+ variants: {
198
+ maxWidth: {
199
+ default: "max-w-80",
200
+ datePicker: "max-w-75 @sm:max-w-full",
201
+ none: ""
202
+ },
203
+ sectioned: {
204
+ true: "Litho-Popover--Sectioned p-4",
205
+ false: ""
206
+ }
207
+ }
208
+ });
209
+ function Popover() {
196
210
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
197
- var activatorWrapper = props.activatorWrapper, _props_activatorDisplayType = props.activatorDisplayType, activatorDisplayType = _props_activatorDisplayType === void 0 ? "inline-block" : _props_activatorDisplayType, activator = props.activator, children = props.children, onClose = props.onClose, active = props.active, fixed = props.fixed, zIndexOverride = props.zIndexOverride, _props_sectioned = props.sectioned, sectioned = _props_sectioned === void 0 ? false : _props_sectioned, _props_preferredAlignment = props.preferredAlignment, preferredAlignment = _props_preferredAlignment === void 0 ? "center" : _props_preferredAlignment, _props_preferredPosition = props.preferredPosition, preferredPosition = _props_preferredPosition === void 0 ? "below" : _props_preferredPosition, _props_matchActivatorWidth = props.matchActivatorWidth, matchActivatorWidth = _props_matchActivatorWidth === void 0 ? false : _props_matchActivatorWidth, _props_maxWidth = props.maxWidth, maxWidth = _props_maxWidth === void 0 ? "default" : _props_maxWidth, className = props.className, containerClassName = props.containerClassName, _props_closeOnResize = props.closeOnResize, closeOnResize = _props_closeOnResize === void 0 ? true : _props_closeOnResize, _props_debounceResizeObserver = props.debounceResizeObserver, debounceResizeObserver = _props_debounceResizeObserver === void 0 ? false : _props_debounceResizeObserver, _props_usePortal = props.usePortal, usePortal = _props_usePortal === void 0 ? true : _props_usePortal;
211
+ var activatorWrapper = props.activatorWrapper, _props_activatorDisplayType = props.activatorDisplayType, activatorDisplayType = _props_activatorDisplayType === void 0 ? "inline-block" : _props_activatorDisplayType, activator = props.activator, children = props.children, onClose = props.onClose, activeProp = props.active, fixed = props.fixed, zIndexOverride = props.zIndexOverride, _props_sectioned = props.sectioned, sectioned = _props_sectioned === void 0 ? false : _props_sectioned, _props_preferredAlignment = props.preferredAlignment, preferredAlignment = _props_preferredAlignment === void 0 ? "center" : _props_preferredAlignment, _props_preferredPosition = props.preferredPosition, preferredPosition = _props_preferredPosition === void 0 ? "below" : _props_preferredPosition, _props_horizontalOffset = props.horizontalOffset, horizontalOffset = _props_horizontalOffset === void 0 ? 0 : _props_horizontalOffset, _props_matchActivatorWidth = props.matchActivatorWidth, matchActivatorWidth = _props_matchActivatorWidth === void 0 ? false : _props_matchActivatorWidth, _props_maxWidth = props.maxWidth, maxWidth = _props_maxWidth === void 0 ? "default" : _props_maxWidth, className = props.className, containerClassName = props.containerClassName, _props_closeOnResize = props.closeOnResize, closeOnResize = _props_closeOnResize === void 0 ? true : _props_closeOnResize, _props_debounceResizeObserver = props.debounceResizeObserver, debounceResizeObserver = _props_debounceResizeObserver === void 0 ? false : _props_debounceResizeObserver, _props_usePortal = props.usePortal, usePortal = _props_usePortal === void 0 ? true : _props_usePortal;
198
212
  var ActivatorWrapper = activatorWrapper || "div";
199
213
  var idValue = (0, _react.useId)();
200
214
  var idRef = (0, _react.useRef)(idValue);
201
215
  var initialWidthRef = (0, _react.useRef)(null);
202
216
  var popoverRef = (0, _react.useRef)(null);
203
217
  var activatorRef = (0, _react.useRef)(null);
218
+ // Check if the activator is inside an inert element (e.g., table cells covered by fixed columns)
219
+ var isActivatorInert = activatorRef.current ? activatorRef.current.closest('[inert]') !== null : false;
220
+ // When disabled, prevent popover from opening
221
+ var active = isActivatorInert ? false : activeProp;
204
222
  var _useState = _sliced_to_array((0, _react.useState)(_object_spread({
205
223
  visibility: "hidden",
206
224
  opacity: 0,
@@ -283,7 +301,7 @@ var styles = (0, _tailwindvariants.tv)({
283
301
  } else if (preferredAlignment === "right") {
284
302
  left = fixed ? activatorRect.right - popoverRect.width : activatorRect.right + window.scrollX - popoverRect.width;
285
303
  } else if (preferredAlignment === "center") {
286
- left = fixed ? activatorRect.left + activatorRect.width / 2 - popoverRect.width / 2 : activatorRect.left + window.scrollX + activatorRect.width / 2 - popoverRect.width / 2;
304
+ left = fixed ? activatorRect.left + activatorRect.width / 2 - popoverRect.width / 2 + horizontalOffset : activatorRect.left + window.scrollX + activatorRect.width / 2 - popoverRect.width / 2 + horizontalOffset;
287
305
  }
288
306
  } else if (position === "above") {
289
307
  top = fixed ? activatorRect.top - popoverRect.height - TOP_SPACING : activatorRect.top + window.scrollY - popoverRect.height - TOP_SPACING;
@@ -292,7 +310,7 @@ var styles = (0, _tailwindvariants.tv)({
292
310
  } else if (preferredAlignment === "right") {
293
311
  left = fixed ? activatorRect.right - popoverRect.width : activatorRect.right + window.scrollX - popoverRect.width;
294
312
  } else if (preferredAlignment === "center") {
295
- left = fixed ? activatorRect.left + activatorRect.width / 2 - popoverRect.width / 2 : activatorRect.left + window.scrollX + activatorRect.width / 2 - popoverRect.width / 2;
313
+ left = fixed ? activatorRect.left + activatorRect.width / 2 - popoverRect.width / 2 + horizontalOffset : activatorRect.left + window.scrollX + activatorRect.width / 2 - popoverRect.width / 2 + horizontalOffset;
296
314
  }
297
315
  } else if (position === "cover") {
298
316
  top = fixed ? activatorRect.top : activatorRect.top + window.scrollY;
@@ -301,7 +319,7 @@ var styles = (0, _tailwindvariants.tv)({
301
319
  } else if (preferredAlignment === "right") {
302
320
  left = fixed ? activatorRect.right - popoverRect.width : activatorRect.right + window.scrollX - popoverRect.width;
303
321
  } else if (preferredAlignment === "center") {
304
- left = fixed ? activatorRect.left + activatorRect.width / 2 - popoverRect.width / 2 : activatorRect.left + window.scrollX + activatorRect.width / 2 - popoverRect.width / 2;
322
+ left = fixed ? activatorRect.left + activatorRect.width / 2 - popoverRect.width / 2 + horizontalOffset : activatorRect.left + window.scrollX + activatorRect.width / 2 - popoverRect.width / 2 + horizontalOffset;
305
323
  }
306
324
  }
307
325
  // Fallback adjustments for vertical positioning (when not in left/right mode)
@@ -314,11 +332,23 @@ var styles = (0, _tailwindvariants.tv)({
314
332
  }
315
333
  }
316
334
  // Fallback adjustments for horizontal positioning
317
- if (left + popoverRect.width > windowWidth) {
318
- left = windowWidth - popoverRect.width - EDGE_SPACING;
319
- }
320
- if (left < 0) {
321
- left = EDGE_SPACING;
335
+ // Only apply edge constraints if we're not using center alignment with custom offset
336
+ // This allows center alignment to work even near edges
337
+ if (preferredAlignment !== "center" || horizontalOffset === 0) {
338
+ if (left + popoverRect.width > windowWidth) {
339
+ left = windowWidth - popoverRect.width - EDGE_SPACING;
340
+ }
341
+ if (left < 0) {
342
+ left = EDGE_SPACING;
343
+ }
344
+ } else {
345
+ // For center alignment with offset, still respect edges but try to maintain centering
346
+ if (left + popoverRect.width > windowWidth) {
347
+ left = Math.max(EDGE_SPACING, windowWidth - popoverRect.width - EDGE_SPACING);
348
+ }
349
+ if (left < 0) {
350
+ left = EDGE_SPACING;
351
+ }
322
352
  }
323
353
  // Fallback adjustments for vertical positioning (when in left/right mode)
324
354
  if (position === "left" || position === "right") {
@@ -448,7 +478,7 @@ var styles = (0, _tailwindvariants.tv)({
448
478
  children: memoizedActivator
449
479
  }),
450
480
  active && typeof children !== "undefined" && (usePortal ? /*#__PURE__*/ (0, _reactdom.createPortal)(/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
451
- className: "@container",
481
+ className: "@container/main",
452
482
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
453
483
  ref: popoverRef,
454
484
  style: popoverStyle,
@@ -456,7 +486,7 @@ var styles = (0, _tailwindvariants.tv)({
456
486
  children: children
457
487
  })
458
488
  }), document.body) : /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
459
- className: "@container",
489
+ className: "@container/main",
460
490
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
461
491
  ref: popoverRef,
462
492
  style: popoverStyle,
@@ -481,7 +511,10 @@ var sectionStyles = (0, _tailwindvariants.tv)({
481
511
  }
482
512
  });
483
513
  /**
484
- * Section component for use within the Popover.
514
+ * @component Popover.Section
515
+ *
516
+ * @usage
517
+ * - DO: Use to divide Popover content into logical segments with borders.
485
518
  *
486
519
  * @param {Object} props - The component props.
487
520
  * @param {React.ReactNode} [props.children] - The content of the section.
@@ -1,4 +1,17 @@
1
- "use strict";
1
+ /**
2
+ * @component PopoverManager
3
+ *
4
+ * @description An internal event-based coordination utility that tracks active popovers and emits change events to manage open/close state.
5
+ *
6
+ * @usage
7
+ * - DO: Use to coordinate popover open/close state across multiple Popover instances.
8
+ * - DON'T: Import directly in most cases; Popover uses it internally.
9
+ *
10
+ * @alternative
11
+ * - If you need to render a popover, use `Popover` directly. PopoverManager is an internal coordination utility.
12
+ *
13
+ * @module PopoverManager
14
+ */ "use strict";
2
15
  Object.defineProperty(exports, "__esModule", {
3
16
  value: true
4
17
  });
@@ -10,7 +10,33 @@ Object.defineProperty(exports, "default", {
10
10
  });
11
11
  var _jsxruntime = require("react/jsx-runtime");
12
12
  var _tailwindvariants = require("tailwind-variants");
13
- var styles = (0, _tailwindvariants.tv)({
13
+ /**
14
+ * @component ProgressBar
15
+ *
16
+ * @description A horizontal bar that visually represents completion progress as a percentage with configurable size and color.
17
+ *
18
+ * @usage
19
+ * - DO: Show completion percentage or progress of a task.
20
+ * - DON'T: Use for indeterminate loading (use Spinner or Loading).
21
+ *
22
+ * @accessibility
23
+ * - Include an accessible label describing the progress context.
24
+ * - Consider adding visible percentage text.
25
+ *
26
+ * @alternative
27
+ * - If you need an indeterminate loading indicator, use `Spinner`.
28
+ * - If you need a status label, use `Badge`.
29
+ *
30
+ * @param {Object} props - Properties to configure the progress bar.
31
+ * @param {number} [props.progress=0] - The progress percentage (0-100).
32
+ * @param {number} [props.previousProgress] - The previous period's progress percentage (0-100).
33
+ * @param {boolean} [props.comparisonMode=false] - Whether to show comparison between current and previous period.
34
+ * @param {("small"|"medium"|"large")} [props.size="medium"] - The size of the progress bar.
35
+ * @param {("attention"|"highlight"|"success"|"warning"|"critical"|"neutral"|"positive"|"negative")} [props.color="attention"] - The color of the progress indicator.
36
+ * @param {boolean} [props.animated=true] - Whether the progress bar should animate width changes.
37
+ *
38
+ * @returns {JSX.Element} The rendered progress bar component.
39
+ */ var styles = (0, _tailwindvariants.tv)({
14
40
  base: "Litho-ProgressBar relative bg-tint-2 dark:bg-tint-alt-2 rounded-full overflow-hidden min-w-12",
15
41
  variants: {
16
42
  size: {
@@ -49,20 +75,7 @@ var barStyles = (0, _tailwindvariants.tv)({
49
75
  animated: true
50
76
  }
51
77
  });
52
- /**
53
- * A progress bar component with configurable size, color, and animation.
54
- * Can be used in single or comparison mode to show progress changes.
55
- *
56
- * @param {Object} props - Properties to configure the progress bar.
57
- * @param {number} [props.progress=0] - The progress percentage (0-100).
58
- * @param {number} [props.previousProgress] - The previous period's progress percentage (0-100).
59
- * @param {boolean} [props.comparisonMode=false] - Whether to show comparison between current and previous period.
60
- * @param {("small"|"medium"|"large")} [props.size="medium"] - The size of the progress bar.
61
- * @param {("attention"|"highlight"|"success"|"warning"|"critical"|"neutral"|"positive"|"negative")} [props.color="attention"] - The color of the progress indicator.
62
- * @param {boolean} [props.animated=true] - Whether the progress bar should animate width changes.
63
- *
64
- * @returns {JSX.Element} The rendered progress bar component.
65
- */ function ProgressBar() {
78
+ function ProgressBar() {
66
79
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
67
80
  var _props_progress = props.progress, progress = _props_progress === void 0 ? 0 : _props_progress, previousProgress = props.previousProgress, _props_comparisonMode = props.comparisonMode, comparisonMode = _props_comparisonMode === void 0 ? false : _props_comparisonMode, _props_size = props.size, size = _props_size === void 0 ? "medium" : _props_size, _props_color = props.color, color = _props_color === void 0 ? "attention" : _props_color, _props_animated = props.animated, animated = _props_animated === void 0 ? true : _props_animated, className = props.className;
68
81
  var classes = styles({
@@ -17,7 +17,37 @@ function _interop_require_default(obj) {
17
17
  default: obj
18
18
  };
19
19
  }
20
- var styles = (0, _tailwindvariants.tv)({
20
+ /**
21
+ * @component RadioButton
22
+ *
23
+ * @description A single radio input for selecting one option from a mutually exclusive group.
24
+ *
25
+ * @usage
26
+ * - DO: Use for selecting one option from a mutually exclusive group.
27
+ * - DON'T: Use for multi-select (use Checkbox).
28
+ *
29
+ * @accessibility
30
+ * - Group radio buttons with a shared `name` prop; ensure each has a descriptive `label`.
31
+ *
32
+ * @alternative
33
+ * - If you need a rich card-style radio, use `RadioButtonCard`. If you need grouped options with a label, use `ChoiceList`.
34
+ *
35
+ * @param {Object} props - Props for the RadioButton component.
36
+ * @param {string} [props.label] - The text label for the radio button.
37
+ * @param {boolean} [props.labelHidden=false] - If true, hides the label visually but keeps it available for screen readers.
38
+ * @param {string} [props.id] - The unique identifier for the radio input.
39
+ * @param {string} [props.name] - The name attribute for the radio input (must be the same for grouped buttons).
40
+ * @param {string} [props.value] - The value attribute for the radio input.
41
+ * @param {string} [props.error] - An error message associated with the radio button, if any.
42
+ * @param {boolean} [props.checked=false] - Indicates whether the radio button is checked.
43
+ * @param {boolean} [props.disabled=false] - Indicates whether the radio button is disabled.
44
+ * @param {string} [props.helpText] - Additional descriptive text for the radio button.
45
+ * @param {function} [props.onChange] - Callback function called when the radio button state changes.
46
+ * @param {function} [props.onFocus] - Callback function called when the radio button gains focus.
47
+ * @param {function} [props.onBlur] - Callback function called when the radio button loses focus.
48
+ *
49
+ * @returns {JSX.Element} The rendered RadioButton component.
50
+ */ var styles = (0, _tailwindvariants.tv)({
21
51
  base: "Litho-RadioButton group flex gap-2",
22
52
  variants: {
23
53
  disabled: {
@@ -66,29 +96,7 @@ var radioStyles = (0, _tailwindvariants.tv)({
66
96
  }
67
97
  ]
68
98
  });
69
- /**
70
- * RadioButton Component
71
- *
72
- * A custom radio button component with support for labels, help text, and extensive styling using Tailwind Variants (tv).
73
- *
74
- * @component
75
- *
76
- * @param {Object} props - Props for the RadioButton component.
77
- * @param {string} [props.label] - The text label for the radio button.
78
- * @param {boolean} [props.labelHidden=false] - If true, hides the label visually but keeps it available for screen readers.
79
- * @param {string} [props.id] - The unique identifier for the radio input.
80
- * @param {string} [props.name] - The name attribute for the radio input (must be the same for grouped buttons).
81
- * @param {string} [props.value] - The value attribute for the radio input.
82
- * @param {string} [props.error] - An error message associated with the radio button, if any.
83
- * @param {boolean} [props.checked=false] - Indicates whether the radio button is checked.
84
- * @param {boolean} [props.disabled=false] - Indicates whether the radio button is disabled.
85
- * @param {string} [props.helpText] - Additional descriptive text for the radio button.
86
- * @param {function} [props.onChange] - Callback function called when the radio button state changes.
87
- * @param {function} [props.onFocus] - Callback function called when the radio button gains focus.
88
- * @param {function} [props.onBlur] - Callback function called when the radio button loses focus.
89
- *
90
- * @returns {JSX.Element} The rendered RadioButton component.
91
- */ function RadioButton() {
99
+ function RadioButton() {
92
100
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
93
101
  var label = props.label, tooltip = props.tooltip, labelHidden = props.labelHidden, id = props.id, name = props.name, value = props.value, error = props.error, _props_checked = props.checked, checked = _props_checked === void 0 ? false : _props_checked, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, helpText = props.helpText, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, _props_alignItems = props.alignItems, alignItems = _props_alignItems === void 0 ? "stretch" : _props_alignItems;
94
102
  var hasError = !!error;
@@ -17,8 +17,42 @@ function _interop_require_default(obj) {
17
17
  default: obj
18
18
  };
19
19
  }
20
- var styles = (0, _tailwindvariants.tv)({
21
- base: "Litho-RadioButtonCardContainer border border-transparent rounded-lg p-3 pl-4 flex justify-between gap-2",
20
+ /**
21
+ * @component RadioButtonCard
22
+ *
23
+ * @description A card-styled radio input that displays a title and description within a selectable card container.
24
+ *
25
+ * @usage
26
+ * - DO: Use for visually prominent single-choice selections with descriptive content.
27
+ * - DON'T: Use for simple inline radio inputs (use RadioButton).
28
+ *
29
+ * @accessibility
30
+ * - The entire card is clickable and keyboard accessible; ensure title clearly describes the option.
31
+ *
32
+ * @alternative
33
+ * - If you need a simple inline radio button, use `RadioButton`. If you need a checkbox-style card, use `CheckboxCard`.
34
+ *
35
+ * @param {Object} props - Props for the RadioButtonCard component.
36
+ * @param {string} [props.label] - The text label for the radio button.
37
+ * @param {boolean} [props.labelHidden=false] - If true, hides the label visually but keeps it available for screen readers.
38
+ * @param {string} [props.id] - The unique identifier for the radio input.
39
+ * @param {string} [props.name] - The name attribute for the radio input (must be the same for grouped buttons).
40
+ * @param {string} [props.description] - A description of the radio button.
41
+ * @param {string} [props.value] - The value attribute for the radio input.
42
+ * @param {string} [props.error] - An error message associated with the radio button, if any.
43
+ * @param {boolean} [props.checked=false] - Indicates whether the radio button is checked.
44
+ * @param {boolean} [props.disabled=false] - Indicates whether the radio button is disabled.
45
+ * @param {string} [props.helpText] - Additional descriptive text for the radio button.
46
+ * @param {function} [props.onChange] - Callback function called when the radio button state changes.
47
+ * @param {function} [props.onFocus] - Callback function called when the radio button gains focus.
48
+ * @param {function} [props.onBlur] - Callback function called when the radio button loses focus.
49
+ * @param {boolean} [props.hideRadioButton=false] - When true, hides the visual radio button control.
50
+ * @param {React.ReactNode} [props.icon=null] - Optional icon JSX to display in the card.
51
+ * @param {boolean} [props.allowDeselect=true] - When true, clicking an already-selected card deselects it by calling onChange with a synthetic event where target.value is null.
52
+ *
53
+ * @returns {JSX.Element} The rendered RadioButton component.
54
+ */ var styles = (0, _tailwindvariants.tv)({
55
+ base: "Litho-RadioButtonCardContainer border border-transparent rounded-lg p-3 pl-4 flex justify-between gap-2 hover:border-form-border-focus hover:ring hover:ring-form-focus",
22
56
  variants: {
23
57
  disabled: {
24
58
  true: "bg-tint-1",
@@ -33,12 +67,12 @@ var styles = (0, _tailwindvariants.tv)({
33
67
  {
34
68
  disabled: false,
35
69
  checked: true,
36
- class: "border-form-border-focus ring-1 ring-inset ring-form-border-focus"
70
+ class: "border-form-border-focus bg-surface-selected"
37
71
  },
38
72
  {
39
73
  disabled: false,
40
74
  checked: false,
41
- class: "hover:border-edge-default"
75
+ class: ""
42
76
  }
43
77
  ]
44
78
  });
@@ -76,32 +110,9 @@ var radioStyles = (0, _tailwindvariants.tv)({
76
110
  }
77
111
  ]
78
112
  });
79
- /**
80
- * RadioButton Component
81
- *
82
- * A custom radio button component with support for labels, help text, and extensive styling using Tailwind Variants (tv).
83
- *
84
- * @component
85
- *
86
- * @param {Object} props - Props for the RadioButton component.
87
- * @param {string} [props.label] - The text label for the radio button.
88
- * @param {boolean} [props.labelHidden=false] - If true, hides the label visually but keeps it available for screen readers.
89
- * @param {string} [props.id] - The unique identifier for the radio input.
90
- * @param {string} [props.name] - The name attribute for the radio input (must be the same for grouped buttons).
91
- * @param {string} [props.description] - A description of the radio button.
92
- * @param {string} [props.value] - The value attribute for the radio input.
93
- * @param {string} [props.error] - An error message associated with the radio button, if any.
94
- * @param {boolean} [props.checked=false] - Indicates whether the radio button is checked.
95
- * @param {boolean} [props.disabled=false] - Indicates whether the radio button is disabled.
96
- * @param {string} [props.helpText] - Additional descriptive text for the radio button.
97
- * @param {function} [props.onChange] - Callback function called when the radio button state changes.
98
- * @param {function} [props.onFocus] - Callback function called when the radio button gains focus.
99
- * @param {function} [props.onBlur] - Callback function called when the radio button loses focus.
100
- *
101
- * @returns {JSX.Element} The rendered RadioButton component.
102
- */ function RadioButtonCard() {
113
+ function RadioButtonCard() {
103
114
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
104
- var label = props.label, tooltip = props.tooltip, labelHidden = props.labelHidden, id = props.id, name = props.name, description = props.description, value = props.value, error = props.error, _props_checked = props.checked, checked = _props_checked === void 0 ? false : _props_checked, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, helpText = props.helpText, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur;
115
+ var label = props.label, tooltip = props.tooltip, labelHidden = props.labelHidden, id = props.id, name = props.name, description = props.description, value = props.value, error = props.error, _props_checked = props.checked, checked = _props_checked === void 0 ? false : _props_checked, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, helpText = props.helpText, _props_hideRadioButton = props.hideRadioButton, hideRadioButton = _props_hideRadioButton === void 0 ? false : _props_hideRadioButton, _props_icon = props.icon, icon = _props_icon === void 0 ? null : _props_icon, _props_allowDeselect = props.allowDeselect, allowDeselect = _props_allowDeselect === void 0 ? true : _props_allowDeselect, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, _props_labelFontWeight = props.labelFontWeight, labelFontWeight = _props_labelFontWeight === void 0 ? "semibold" : _props_labelFontWeight;
105
116
  var hasError = !!error;
106
117
  var classes = styles({
107
118
  checked: checked,
@@ -128,57 +139,71 @@ var radioStyles = (0, _tailwindvariants.tv)({
128
139
  onBlur(event);
129
140
  }
130
141
  };
142
+ var handleLabelClick = function() {
143
+ if (allowDeselect && checked && !disabled) {
144
+ onChange === null || onChange === void 0 ? void 0 : onChange({
145
+ target: {
146
+ value: null
147
+ }
148
+ });
149
+ }
150
+ };
131
151
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
132
152
  className: "flex flex-col gap-1",
133
153
  children: [
134
154
  /*#__PURE__*/ (0, _jsxruntime.jsxs)("label", {
135
155
  className: classes,
156
+ onClick: handleLabelClick,
136
157
  children: [
137
158
  /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
138
- className: "flex flex-col gap-1",
159
+ className: "flex items-center gap-4",
139
160
  children: [
140
- label && !labelHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
141
- tooltip: tooltip,
142
- disabled: disabled,
143
- fontWeight: "semibold",
144
- as: "p",
145
- children: label
161
+ icon && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
162
+ className: "flex-shrink-0",
163
+ children: icon
146
164
  }),
147
- description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
148
- color: disabled ? "disabled" : "subdued",
149
- children: description
165
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
166
+ children: [
167
+ label && !labelHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
168
+ tooltip: tooltip,
169
+ disabled: disabled,
170
+ fontWeight: labelFontWeight,
171
+ as: "p",
172
+ children: label
173
+ }),
174
+ description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
175
+ color: disabled ? "disabled" : "subdued",
176
+ children: description
177
+ })
178
+ ]
150
179
  })
151
180
  ]
152
181
  }),
153
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
154
- children: [
155
- /*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
156
- type: "radio",
157
- id: id,
158
- name: name,
159
- value: value,
160
- checked: checked,
161
- disabled: disabled,
162
- onChange: handleChange,
163
- onFocus: handleFocus,
164
- onBlur: handleBlur,
165
- className: "sr-only"
166
- }),
167
- /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
168
- className: "Litho-RadioButton__ControlContainer w-5 h-5 flex items-center",
169
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
170
- className: radioClasses,
171
- children: [
172
- checked && !hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
173
- className: "rounded-full w-1.5 h-1.5 ".concat(disabled ? "bg-form-input-fg-disabled" : "bg-form-input-fg-light")
174
- }),
175
- checked && hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
176
- className: "rounded-full w-1.5 h-1.5 ".concat(disabled ? "bg-form-input-fg-disabled" : "bg-form-bg")
177
- })
178
- ]
182
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
183
+ type: "radio",
184
+ id: id,
185
+ name: name,
186
+ value: value,
187
+ checked: checked,
188
+ disabled: disabled,
189
+ onChange: handleChange,
190
+ onFocus: handleFocus,
191
+ onBlur: handleBlur,
192
+ className: "sr-only"
193
+ }),
194
+ !hideRadioButton && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
195
+ className: "Litho-RadioButton__ControlContainer w-5 h-5 flex items-center",
196
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
197
+ className: radioClasses,
198
+ children: [
199
+ checked && !hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
200
+ className: "rounded-full w-1.5 h-1.5 ".concat(disabled ? "bg-form-input-fg-disabled" : "bg-form-input-fg-light")
201
+ }),
202
+ checked && hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
203
+ className: "rounded-full w-1.5 h-1.5 ".concat(disabled ? "bg-form-input-fg-disabled" : "bg-form-bg")
179
204
  })
180
- })
181
- ]
205
+ ]
206
+ })
182
207
  })
183
208
  ]
184
209
  }),