@heymantle/litho 0.0.15 → 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 (371) 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/dist/cjs/components/ActionList.js +33 -25
  6. package/dist/cjs/components/AnnouncementBar.js +115 -18
  7. package/dist/cjs/components/AnnouncementCard.js +269 -0
  8. package/dist/cjs/components/AppProvider.js +15 -2
  9. package/dist/cjs/components/Autocomplete.js +58 -36
  10. package/dist/cjs/components/Badge.js +28 -14
  11. package/dist/cjs/components/Banner.js +37 -27
  12. package/dist/cjs/components/Box.js +50 -38
  13. package/dist/cjs/components/Button.js +338 -109
  14. package/dist/cjs/components/ButtonGroup.js +27 -14
  15. package/dist/cjs/components/Card.js +311 -143
  16. package/dist/cjs/components/Checkbox.js +55 -47
  17. package/dist/cjs/components/CheckboxCard.js +222 -0
  18. package/dist/cjs/components/CheckboxCardGroup.js +384 -0
  19. package/dist/cjs/components/ChoiceList.js +21 -11
  20. package/dist/cjs/components/Code.js +22 -8
  21. package/dist/cjs/components/Collapsible.js +24 -11
  22. package/dist/cjs/components/ColorField.js +163 -38
  23. package/dist/cjs/components/ContextualSaveBar.js +13 -6
  24. package/dist/cjs/components/DatePicker.js +48 -37
  25. package/dist/cjs/components/Disclosure.js +35 -22
  26. package/dist/cjs/components/Divider.js +82 -18
  27. package/dist/cjs/components/DropZone.js +111 -37
  28. package/dist/cjs/components/EmptyState.js +18 -6
  29. package/dist/cjs/components/Filters.js +84 -36
  30. package/dist/cjs/components/FooterHelp.js +14 -4
  31. package/dist/cjs/components/Form.js +13 -2
  32. package/dist/cjs/components/Frame.js +57 -22
  33. package/dist/cjs/components/FrameSaveBar.js +37 -6
  34. package/dist/cjs/components/Grid.js +31 -15
  35. package/dist/cjs/components/HorizontalStack.js +38 -25
  36. package/dist/cjs/components/Icon.js +683 -61
  37. package/dist/cjs/components/Image.js +35 -22
  38. package/dist/cjs/components/InlineError.js +19 -10
  39. package/dist/cjs/components/Label.js +21 -12
  40. package/dist/cjs/components/Layout.js +33 -24
  41. package/dist/cjs/components/LayoutSection.js +84 -22
  42. package/dist/cjs/components/Link.js +35 -22
  43. package/dist/cjs/components/List.js +28 -12
  44. package/dist/cjs/components/Listbox.js +53 -31
  45. package/dist/cjs/components/Loading.js +14 -2
  46. package/dist/cjs/components/Modal.js +22 -40
  47. package/dist/cjs/components/Navigation.js +107 -36
  48. package/dist/cjs/components/Page.js +44 -31
  49. package/dist/cjs/components/Pagination.js +20 -5
  50. package/dist/cjs/components/Pane.js +67 -4
  51. package/dist/cjs/components/Popover.js +37 -21
  52. package/dist/cjs/components/PopoverManager.js +14 -1
  53. package/dist/cjs/components/ProgressBar.js +28 -15
  54. package/dist/cjs/components/RadioButton.js +32 -24
  55. package/dist/cjs/components/RadioButtonCard.js +92 -67
  56. package/dist/cjs/components/RadioButtonCardGroup.js +379 -0
  57. package/dist/cjs/components/RangeSlider.js +34 -26
  58. package/dist/cjs/components/ResourceList.js +28 -14
  59. package/dist/cjs/components/Select.js +38 -26
  60. package/dist/cjs/components/SkeletonText.js +33 -18
  61. package/dist/cjs/components/Spinner.js +24 -12
  62. package/dist/cjs/components/Stack.js +131 -71
  63. package/dist/cjs/components/TabNavigation.js +27 -1
  64. package/dist/cjs/components/Table.js +58 -18
  65. package/dist/cjs/components/Tabs.js +52 -23
  66. package/dist/cjs/components/Tag.js +37 -16
  67. package/dist/cjs/components/Text.js +32 -18
  68. package/dist/cjs/components/TextField.js +119 -69
  69. package/dist/cjs/components/Thumbnail.js +25 -11
  70. package/dist/cjs/components/TimePicker.js +22 -1
  71. package/dist/cjs/components/Tip.js +140 -25
  72. package/dist/cjs/components/ToastNotification.js +107 -34
  73. package/dist/cjs/components/ToastProvider.js +13 -3
  74. package/dist/cjs/components/Tooltip.js +50 -41
  75. package/dist/cjs/components/TopBar.js +83 -9
  76. package/dist/cjs/components/VerticalStack.js +31 -16
  77. package/dist/cjs/index.js +24 -0
  78. package/dist/cjs/stories/Autocomplete.stories.js +10 -10
  79. package/dist/cjs/stories/Checkbox.stories.js +6 -8
  80. package/dist/cjs/stories/CheckboxCardGroup.stories.js +459 -0
  81. package/dist/cjs/stories/Collapsible.stories.js +11 -11
  82. package/dist/cjs/stories/ColorField.stories.js +2 -3
  83. package/dist/cjs/stories/ComplexExamples.stories.js +48 -77
  84. package/dist/cjs/stories/ContextualSaveBar.stories.js +1 -1
  85. package/dist/cjs/stories/Divider.stories.js +15 -16
  86. package/dist/cjs/stories/DropZone.stories.js +3 -3
  87. package/dist/cjs/stories/FooterHelp.stories.js +3 -4
  88. package/dist/cjs/stories/Form.stories.js +2 -4
  89. package/dist/cjs/stories/Grid.stories.js +24 -33
  90. package/dist/cjs/stories/Icon.stories.js +22 -23
  91. package/dist/cjs/stories/Image.stories.js +12 -15
  92. package/dist/cjs/stories/InlineError.stories.js +0 -1
  93. package/dist/cjs/stories/Layout.stories.js +96 -2
  94. package/dist/cjs/stories/LayoutSection.stories.js +13 -18
  95. package/dist/cjs/stories/List.stories.js +24 -28
  96. package/dist/cjs/stories/Listbox.stories.js +2 -2
  97. package/dist/cjs/stories/Loading.stories.js +21 -25
  98. package/dist/cjs/stories/Modal.stories.js +0 -1
  99. package/dist/cjs/stories/Pagination.stories.js +4 -4
  100. package/dist/cjs/stories/Pane.stories.js +10 -18
  101. package/dist/cjs/stories/Popover.stories.js +7 -7
  102. package/dist/cjs/stories/PopoverManager.stories.js +9 -9
  103. package/dist/cjs/stories/ProgressBar.stories.js +8 -8
  104. package/dist/cjs/stories/RadioButton.stories.js +2 -2
  105. package/dist/cjs/stories/RadioButtonCard.stories.js +2 -2
  106. package/dist/cjs/stories/RadioButtonCardGroup.stories.js +502 -0
  107. package/dist/cjs/stories/RangeSlider.stories.js +1 -3
  108. package/dist/cjs/stories/ResourceList.stories.js +13 -13
  109. package/dist/cjs/stories/Spinner.stories.js +9 -9
  110. package/dist/cjs/stories/Stack.stories.js +233 -51
  111. package/dist/cjs/stories/Tabs.stories.js +2 -2
  112. package/dist/cjs/stories/Tag.stories.js +1 -1
  113. package/dist/cjs/stories/Thumbnail.stories.js +17 -18
  114. package/dist/cjs/stories/TimePicker.stories.js +0 -5
  115. package/dist/cjs/stories/Tip.stories.js +1 -1
  116. package/dist/esm/components/ActionList.js +33 -25
  117. package/dist/esm/components/AnnouncementBar.js +115 -18
  118. package/dist/esm/components/AnnouncementCard.js +254 -0
  119. package/dist/esm/components/AppProvider.js +15 -2
  120. package/dist/esm/components/Autocomplete.js +58 -36
  121. package/dist/esm/components/Badge.js +28 -14
  122. package/dist/esm/components/Banner.js +37 -27
  123. package/dist/esm/components/Box.js +50 -38
  124. package/dist/esm/components/Button.js +338 -109
  125. package/dist/esm/components/ButtonGroup.js +27 -14
  126. package/dist/esm/components/Card.js +300 -140
  127. package/dist/esm/components/Checkbox.js +55 -47
  128. package/dist/esm/components/CheckboxCard.js +207 -0
  129. package/dist/esm/components/CheckboxCardGroup.js +370 -0
  130. package/dist/esm/components/ChoiceList.js +21 -11
  131. package/dist/esm/components/Code.js +22 -8
  132. package/dist/esm/components/Collapsible.js +24 -11
  133. package/dist/esm/components/ColorField.js +165 -40
  134. package/dist/esm/components/ContextualSaveBar.js +13 -6
  135. package/dist/esm/components/DatePicker.js +48 -37
  136. package/dist/esm/components/Disclosure.js +35 -22
  137. package/dist/esm/components/Divider.js +78 -20
  138. package/dist/esm/components/DropZone.js +111 -37
  139. package/dist/esm/components/EmptyState.js +18 -6
  140. package/dist/esm/components/Filters.js +84 -36
  141. package/dist/esm/components/FooterHelp.js +14 -4
  142. package/dist/esm/components/Form.js +13 -2
  143. package/dist/esm/components/Frame.js +57 -22
  144. package/dist/esm/components/FrameSaveBar.js +37 -6
  145. package/dist/esm/components/Grid.js +31 -15
  146. package/dist/esm/components/HorizontalStack.js +38 -25
  147. package/dist/esm/components/Icon.js +681 -62
  148. package/dist/esm/components/Image.js +35 -22
  149. package/dist/esm/components/InlineError.js +19 -10
  150. package/dist/esm/components/Label.js +21 -12
  151. package/dist/esm/components/Layout.js +58 -25
  152. package/dist/esm/components/LayoutSection.js +84 -22
  153. package/dist/esm/components/Link.js +35 -22
  154. package/dist/esm/components/List.js +28 -12
  155. package/dist/esm/components/Listbox.js +53 -31
  156. package/dist/esm/components/Loading.js +14 -2
  157. package/dist/esm/components/Modal.js +69 -41
  158. package/dist/esm/components/Navigation.js +107 -36
  159. package/dist/esm/components/Page.js +44 -31
  160. package/dist/esm/components/Pagination.js +20 -5
  161. package/dist/esm/components/Pane.js +67 -4
  162. package/dist/esm/components/Popover.js +37 -21
  163. package/dist/esm/components/PopoverManager.js +14 -1
  164. package/dist/esm/components/ProgressBar.js +28 -15
  165. package/dist/esm/components/RadioButton.js +32 -24
  166. package/dist/esm/components/RadioButtonCard.js +92 -67
  167. package/dist/esm/components/RadioButtonCardGroup.js +364 -0
  168. package/dist/esm/components/RangeSlider.js +34 -26
  169. package/dist/esm/components/ResourceList.js +28 -14
  170. package/dist/esm/components/Select.js +38 -26
  171. package/dist/esm/components/SkeletonText.js +33 -18
  172. package/dist/esm/components/Spinner.js +24 -12
  173. package/dist/esm/components/Stack.js +131 -71
  174. package/dist/esm/components/TabNavigation.js +27 -1
  175. package/dist/esm/components/Table.js +58 -18
  176. package/dist/esm/components/Tabs.js +52 -23
  177. package/dist/esm/components/Tag.js +37 -16
  178. package/dist/esm/components/Text.js +32 -18
  179. package/dist/esm/components/TextField.js +119 -69
  180. package/dist/esm/components/Thumbnail.js +25 -11
  181. package/dist/esm/components/TimePicker.js +22 -1
  182. package/dist/esm/components/Tip.js +140 -25
  183. package/dist/esm/components/ToastNotification.js +107 -34
  184. package/dist/esm/components/ToastProvider.js +13 -3
  185. package/dist/esm/components/Tooltip.js +50 -41
  186. package/dist/esm/components/TopBar.js +83 -9
  187. package/dist/esm/components/VerticalStack.js +31 -16
  188. package/dist/esm/index.js +6 -0
  189. package/dist/esm/stories/Autocomplete.stories.js +10 -10
  190. package/dist/esm/stories/Checkbox.stories.js +6 -8
  191. package/dist/esm/stories/CheckboxCardGroup.stories.js +421 -0
  192. package/dist/esm/stories/Collapsible.stories.js +11 -11
  193. package/dist/esm/stories/ColorField.stories.js +2 -3
  194. package/dist/esm/stories/ComplexExamples.stories.js +48 -77
  195. package/dist/esm/stories/ContextualSaveBar.stories.js +1 -1
  196. package/dist/esm/stories/Divider.stories.js +15 -16
  197. package/dist/esm/stories/DropZone.stories.js +3 -3
  198. package/dist/esm/stories/FooterHelp.stories.js +3 -4
  199. package/dist/esm/stories/Form.stories.js +2 -4
  200. package/dist/esm/stories/Grid.stories.js +24 -33
  201. package/dist/esm/stories/Icon.stories.js +22 -23
  202. package/dist/esm/stories/Image.stories.js +12 -15
  203. package/dist/esm/stories/InlineError.stories.js +0 -1
  204. package/dist/esm/stories/Layout.stories.js +93 -2
  205. package/dist/esm/stories/LayoutSection.stories.js +13 -18
  206. package/dist/esm/stories/List.stories.js +24 -28
  207. package/dist/esm/stories/Listbox.stories.js +2 -2
  208. package/dist/esm/stories/Loading.stories.js +21 -25
  209. package/dist/esm/stories/Modal.stories.js +0 -1
  210. package/dist/esm/stories/Pagination.stories.js +4 -4
  211. package/dist/esm/stories/Pane.stories.js +10 -18
  212. package/dist/esm/stories/Popover.stories.js +7 -7
  213. package/dist/esm/stories/PopoverManager.stories.js +9 -9
  214. package/dist/esm/stories/ProgressBar.stories.js +8 -8
  215. package/dist/esm/stories/RadioButton.stories.js +2 -2
  216. package/dist/esm/stories/RadioButtonCard.stories.js +2 -2
  217. package/dist/esm/stories/RadioButtonCardGroup.stories.js +461 -0
  218. package/dist/esm/stories/RangeSlider.stories.js +1 -3
  219. package/dist/esm/stories/ResourceList.stories.js +13 -13
  220. package/dist/esm/stories/Spinner.stories.js +9 -9
  221. package/dist/esm/stories/Stack.stories.js +224 -51
  222. package/dist/esm/stories/Tabs.stories.js +2 -2
  223. package/dist/esm/stories/Tag.stories.js +1 -1
  224. package/dist/esm/stories/Thumbnail.stories.js +17 -18
  225. package/dist/esm/stories/TimePicker.stories.js +0 -5
  226. package/dist/esm/stories/Tip.stories.js +1 -1
  227. package/dist/types/components/ActionList.d.ts +1 -31
  228. package/dist/types/components/ActionList.d.ts.map +1 -1
  229. package/dist/types/components/AnnouncementBar.d.ts +1 -19
  230. package/dist/types/components/AnnouncementBar.d.ts.map +1 -1
  231. package/dist/types/components/AnnouncementCard.d.ts +3 -0
  232. package/dist/types/components/AnnouncementCard.d.ts.map +1 -0
  233. package/dist/types/components/AppProvider.d.ts +14 -1
  234. package/dist/types/components/AppProvider.d.ts.map +1 -1
  235. package/dist/types/components/Autocomplete.d.ts +1 -71
  236. package/dist/types/components/Autocomplete.d.ts.map +1 -1
  237. package/dist/types/components/Badge.d.ts +1 -19
  238. package/dist/types/components/Badge.d.ts.map +1 -1
  239. package/dist/types/components/Banner.d.ts +1 -37
  240. package/dist/types/components/Banner.d.ts.map +1 -1
  241. package/dist/types/components/Box.d.ts +1 -68
  242. package/dist/types/components/Box.d.ts.map +1 -1
  243. package/dist/types/components/Button.d.ts +1 -131
  244. package/dist/types/components/Button.d.ts.map +1 -1
  245. package/dist/types/components/ButtonGroup.d.ts +1 -22
  246. package/dist/types/components/ButtonGroup.d.ts.map +1 -1
  247. package/dist/types/components/Card.d.ts +54 -59
  248. package/dist/types/components/Card.d.ts.map +1 -1
  249. package/dist/types/components/Checkbox.d.ts +1 -63
  250. package/dist/types/components/Checkbox.d.ts.map +1 -1
  251. package/dist/types/components/CheckboxCard.d.ts +3 -0
  252. package/dist/types/components/CheckboxCard.d.ts.map +1 -0
  253. package/dist/types/components/CheckboxCardGroup.d.ts +3 -0
  254. package/dist/types/components/CheckboxCardGroup.d.ts.map +1 -0
  255. package/dist/types/components/ChoiceList.d.ts +1 -42
  256. package/dist/types/components/ChoiceList.d.ts.map +1 -1
  257. package/dist/types/components/Code.d.ts +1 -26
  258. package/dist/types/components/Code.d.ts.map +1 -1
  259. package/dist/types/components/Collapsible.d.ts +1 -15
  260. package/dist/types/components/Collapsible.d.ts.map +1 -1
  261. package/dist/types/components/ColorField.d.ts +13 -34
  262. package/dist/types/components/ColorField.d.ts.map +1 -1
  263. package/dist/types/components/ContextualSaveBar.d.ts +13 -6
  264. package/dist/types/components/ContextualSaveBar.d.ts.map +1 -1
  265. package/dist/types/components/DatePicker.d.ts +1 -64
  266. package/dist/types/components/DatePicker.d.ts.map +1 -1
  267. package/dist/types/components/Disclosure.d.ts +1 -25
  268. package/dist/types/components/Disclosure.d.ts.map +1 -1
  269. package/dist/types/components/Divider.d.ts +1 -19
  270. package/dist/types/components/Divider.d.ts.map +1 -1
  271. package/dist/types/components/DropZone.d.ts +1 -62
  272. package/dist/types/components/DropZone.d.ts.map +1 -1
  273. package/dist/types/components/EmptyState.d.ts +1 -50
  274. package/dist/types/components/EmptyState.d.ts.map +1 -1
  275. package/dist/types/components/Filters.d.ts +13 -68
  276. package/dist/types/components/Filters.d.ts.map +1 -1
  277. package/dist/types/components/FooterHelp.d.ts +14 -4
  278. package/dist/types/components/FooterHelp.d.ts.map +1 -1
  279. package/dist/types/components/Form.d.ts +13 -2
  280. package/dist/types/components/Form.d.ts.map +1 -1
  281. package/dist/types/components/Frame.d.ts +15 -36
  282. package/dist/types/components/Frame.d.ts.map +1 -1
  283. package/dist/types/components/FrameSaveBar.d.ts +3 -6
  284. package/dist/types/components/FrameSaveBar.d.ts.map +1 -1
  285. package/dist/types/components/Grid.d.ts +5 -21
  286. package/dist/types/components/Grid.d.ts.map +1 -1
  287. package/dist/types/components/HorizontalStack.d.ts +1 -34
  288. package/dist/types/components/HorizontalStack.d.ts.map +1 -1
  289. package/dist/types/components/Icon.d.ts +1 -41
  290. package/dist/types/components/Icon.d.ts.map +1 -1
  291. package/dist/types/components/Image.d.ts +1 -43
  292. package/dist/types/components/Image.d.ts.map +1 -1
  293. package/dist/types/components/InlineError.d.ts +1 -20
  294. package/dist/types/components/InlineError.d.ts.map +1 -1
  295. package/dist/types/components/Label.d.ts +1 -26
  296. package/dist/types/components/Label.d.ts.map +1 -1
  297. package/dist/types/components/Layout.d.ts +24 -15
  298. package/dist/types/components/Layout.d.ts.map +1 -1
  299. package/dist/types/components/LayoutSection.d.ts +1 -19
  300. package/dist/types/components/LayoutSection.d.ts.map +1 -1
  301. package/dist/types/components/Link.d.ts +1 -37
  302. package/dist/types/components/Link.d.ts.map +1 -1
  303. package/dist/types/components/List.d.ts +5 -17
  304. package/dist/types/components/List.d.ts.map +1 -1
  305. package/dist/types/components/Listbox.d.ts +1 -32
  306. package/dist/types/components/Listbox.d.ts.map +1 -1
  307. package/dist/types/components/Loading.d.ts +14 -2
  308. package/dist/types/components/Loading.d.ts.map +1 -1
  309. package/dist/types/components/Modal.d.ts +26 -35
  310. package/dist/types/components/Modal.d.ts.map +1 -1
  311. package/dist/types/components/Navigation.d.ts +1 -25
  312. package/dist/types/components/Navigation.d.ts.map +1 -1
  313. package/dist/types/components/Page.d.ts +1 -57
  314. package/dist/types/components/Page.d.ts.map +1 -1
  315. package/dist/types/components/Pagination.d.ts +13 -3
  316. package/dist/types/components/Pagination.d.ts.map +1 -1
  317. package/dist/types/components/Pane.d.ts +55 -3
  318. package/dist/types/components/Pane.d.ts.map +1 -1
  319. package/dist/types/components/Popover.d.ts +5 -37
  320. package/dist/types/components/Popover.d.ts.map +1 -1
  321. package/dist/types/components/PopoverManager.d.ts.map +1 -1
  322. package/dist/types/components/ProgressBar.d.ts +1 -22
  323. package/dist/types/components/ProgressBar.d.ts.map +1 -1
  324. package/dist/types/components/RadioButton.d.ts +1 -37
  325. package/dist/types/components/RadioButton.d.ts.map +1 -1
  326. package/dist/types/components/RadioButtonCard.d.ts +1 -39
  327. package/dist/types/components/RadioButtonCard.d.ts.map +1 -1
  328. package/dist/types/components/RadioButtonCardGroup.d.ts +3 -0
  329. package/dist/types/components/RadioButtonCardGroup.d.ts.map +1 -0
  330. package/dist/types/components/RangeSlider.d.ts +1 -42
  331. package/dist/types/components/RangeSlider.d.ts.map +1 -1
  332. package/dist/types/components/ResourceList.d.ts +5 -30
  333. package/dist/types/components/ResourceList.d.ts.map +1 -1
  334. package/dist/types/components/Select.d.ts +1 -46
  335. package/dist/types/components/Select.d.ts.map +1 -1
  336. package/dist/types/components/SkeletonText.d.ts +1 -26
  337. package/dist/types/components/SkeletonText.d.ts.map +1 -1
  338. package/dist/types/components/Spinner.d.ts +1 -16
  339. package/dist/types/components/Spinner.d.ts.map +1 -1
  340. package/dist/types/components/Stack.d.ts +1 -47
  341. package/dist/types/components/Stack.d.ts.map +1 -1
  342. package/dist/types/components/TabNavigation.d.ts.map +1 -1
  343. package/dist/types/components/Table.d.ts +13 -58
  344. package/dist/types/components/Table.d.ts.map +1 -1
  345. package/dist/types/components/Tabs.d.ts +3 -41
  346. package/dist/types/components/Tabs.d.ts.map +1 -1
  347. package/dist/types/components/Tag.d.ts +1 -24
  348. package/dist/types/components/Tag.d.ts.map +1 -1
  349. package/dist/types/components/Text.d.ts +1 -30
  350. package/dist/types/components/Text.d.ts.map +1 -1
  351. package/dist/types/components/TextField.d.ts +1 -109
  352. package/dist/types/components/TextField.d.ts.map +1 -1
  353. package/dist/types/components/Thumbnail.d.ts +1 -16
  354. package/dist/types/components/Thumbnail.d.ts.map +1 -1
  355. package/dist/types/components/TimePicker.d.ts +28 -1
  356. package/dist/types/components/TimePicker.d.ts.map +1 -1
  357. package/dist/types/components/Tip.d.ts +1 -21
  358. package/dist/types/components/Tip.d.ts.map +1 -1
  359. package/dist/types/components/ToastNotification.d.ts +1 -34
  360. package/dist/types/components/ToastNotification.d.ts.map +1 -1
  361. package/dist/types/components/ToastProvider.d.ts +13 -3
  362. package/dist/types/components/ToastProvider.d.ts.map +1 -1
  363. package/dist/types/components/Tooltip.d.ts +1 -54
  364. package/dist/types/components/Tooltip.d.ts.map +1 -1
  365. package/dist/types/components/TopBar.d.ts +1 -19
  366. package/dist/types/components/TopBar.d.ts.map +1 -1
  367. package/dist/types/components/VerticalStack.d.ts +1 -25
  368. package/dist/types/components/VerticalStack.d.ts.map +1 -1
  369. package/dist/types/index.d.ts +6 -0
  370. package/index.css +76 -14
  371. package/package.json +4 -3
@@ -1,4 +1,56 @@
1
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
+ }
2
54
  function _type_of(obj) {
3
55
  "@swc/helpers - typeof";
4
56
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
@@ -12,6 +64,58 @@ import Spinner from "./Spinner.js";
12
64
  import Text from "./Text.js";
13
65
  import Tooltip from "./Tooltip.js";
14
66
  import { useFrame } from "./Frame.js";
67
+ import { ModalContext } from "./Modal.js";
68
+ /**
69
+ * @component Card
70
+ *
71
+ * @description A bordered container component that groups related content into a visually distinct section with optional header, sections, and actions.
72
+ *
73
+ * @usage
74
+ * - DO: Group related content into a visually distinct, bordered container.
75
+ * - DON'T: Nest Cards inside other Cards.
76
+ *
77
+ * @accessibility
78
+ * - Card uses semantic grouping; ensure heading props render appropriate heading levels.
79
+ *
80
+ * @alternative
81
+ * - If you need a plain container without borders, use `Box`.
82
+ * - If you need a full-page layout, use `Layout`.
83
+ *
84
+ * @param {Object} props - Props for the Card component.
85
+ * @param {boolean} [props.allowOverflow=false] - Allows content to overflow the Card boundaries.
86
+ * @param {React.ReactNode} [props.children] - Child elements to render inside the Card.
87
+ * @param {boolean} [props.hideOnPrint] - Hides the Card when printing.
88
+ * @param {string|React.ReactNode} [props.title] - Title of the Card.
89
+ * @param {string} [props.titleVariant='headingMd'] - Typography variant for the Card title.
90
+ * @param {string} [props.description] - Description of the Card.
91
+ * @param {string} [props.descriptionVariant='bodyMd'] - Typography variant for the Card description.
92
+ * @param {React.ElementType|Object} [props.icon] - Icon to render alongside the title.
93
+ * @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the title.
94
+ * @param {string} [props.tooltipPreferredPosition='above'] - Preferred position for the tooltip.
95
+ * @param {boolean} [props.outlined=false] - Applies outlined styling to the Card.
96
+ * @param {string} [props.shadow='default'] - Applies a shadow to the Card. Can be 'default', or 'none'.
97
+ * @param {boolean} [props.highlighted=false] - Applies highlighted styling to the Card.
98
+ * @param {boolean} [props.subdued=false] - Applies subdued styling to the Card.
99
+ * @param {boolean} [props.alternate=false] - Applies alternate styling to the Card.
100
+ * @param {boolean} [props.padded=false] - Adds padding to the Card body.
101
+ * @param {boolean} [props.loading=false] - Shows a loading spinner in place of the title.
102
+ * @param {boolean} [props.paddedHalf=false] - Adds half padding to the Card body.
103
+ * @param {boolean} [props.removeHeaderBottomPadding=false] - Removes bottom padding from the header.
104
+ * @param {Function} [props.onClick] - Click handler for the Card, making it clickable.
105
+ * @param {Object} [props.emptyState={}] - Configures the empty state of the Card.
106
+ * @param {Object} [props.action] - Action button or configuration to render in the Card header.
107
+ * @param {string} [props.className] - Additional classes to apply to the Card.
108
+ * @param {string} [props.headerClassName] - Additional classes to apply to the Card header.
109
+ * @param {React.ReactNode} [props.accessory] - Accessory element to render in the header.
110
+ * @param {boolean} [props.fullWidthOnMobile] - Makes the Card full width on mobile. Defaults to `true` for top-level cards, `false` for nested cards.
111
+ * @param {boolean} [props.roundedOnMobile] - Makes the Card rounded on mobile. Defaults to `false` for top-level cards, `true` for nested cards.
112
+ * @returns {React.ReactElement} The rendered Card component.
113
+ */ var CardContext = /*#__PURE__*/ React.createContext({
114
+ nested: false
115
+ });
116
+ var NESTED_CONTEXT = {
117
+ nested: true
118
+ };
15
119
  var styles = tv({
16
120
  base: "Litho-Card relative",
17
121
  variants: {
@@ -48,7 +152,7 @@ var styles = tv({
48
152
  false: ""
49
153
  },
50
154
  highlighted: {
51
- true: "cursor-pointer ring ring-form-focus outline outline-form-border-focus",
155
+ true: "cursor-pointer outline outline-form-border-focus",
52
156
  false: ""
53
157
  },
54
158
  shadow: {
@@ -59,6 +163,10 @@ var styles = tv({
59
163
  embedded: {
60
164
  true: "",
61
165
  false: ""
166
+ },
167
+ nested: {
168
+ true: "",
169
+ false: ""
62
170
  }
63
171
  },
64
172
  compoundVariants: [
@@ -82,7 +190,14 @@ var styles = tv({
82
190
  subdued: false,
83
191
  alternate: false,
84
192
  highlighted: true,
85
- className: "bg-surface-highest dark:border-t dark:border-tint-alt-2"
193
+ className: "bg-surface-selected hover:bg-surface-selected dark:border-t dark:border-tint-alt-2"
194
+ },
195
+ {
196
+ nested: true,
197
+ subdued: false,
198
+ alternate: false,
199
+ highlighted: false,
200
+ className: "outline-edge-light @md:outline-edge-light"
86
201
  }
87
202
  ],
88
203
  defaultVariants: {
@@ -92,7 +207,8 @@ var styles = tv({
92
207
  outlined: false,
93
208
  highlighted: false,
94
209
  shadow: "default",
95
- embedded: false
210
+ embedded: false,
211
+ nested: false
96
212
  }
97
213
  });
98
214
  var headerStyles = tv({
@@ -139,41 +255,14 @@ var bodyStyles = tv({
139
255
  }
140
256
  ]
141
257
  });
142
- /**
143
- * Card component for creating styled containers with optional headers, actions, and children.
144
- *
145
- * @component
146
- * @param {Object} props - Props for the Card component.
147
- * @param {boolean} [props.allowOverflow=false] - Allows content to overflow the Card boundaries.
148
- * @param {React.ReactNode} [props.children] - Child elements to render inside the Card.
149
- * @param {boolean} [props.hideOnPrint] - Hides the Card when printing.
150
- * @param {string|React.ReactNode} [props.title] - Title of the Card.
151
- * @param {string} [props.titleVariant='headingMd'] - Typography variant for the Card title.
152
- * @param {string} [props.description] - Description of the Card.
153
- * @param {React.ElementType|Object} [props.icon] - Icon to render alongside the title.
154
- * @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the title.
155
- * @param {string} [props.tooltipPreferredPosition='above'] - Preferred position for the tooltip.
156
- * @param {boolean} [props.outlined=false] - Applies outlined styling to the Card.
157
- * @param {string} [props.shadow='default'] - Applies a shadow to the Card. Can be 'default', or 'none'.
158
- * @param {boolean} [props.highlighted=false] - Applies highlighted styling to the Card.
159
- * @param {boolean} [props.subdued=false] - Applies subdued styling to the Card.
160
- * @param {boolean} [props.alternate=false] - Applies alternate styling to the Card.
161
- * @param {boolean} [props.padded=false] - Adds padding to the Card body.
162
- * @param {boolean} [props.loading=false] - Shows a loading spinner in place of the title.
163
- * @param {boolean} [props.paddedHalf=false] - Adds half padding to the Card body.
164
- * @param {boolean} [props.removeHeaderBottomPadding=false] - Removes bottom padding from the header.
165
- * @param {Function} [props.onClick] - Click handler for the Card, making it clickable.
166
- * @param {Object} [props.emptyState={}] - Configures the empty state of the Card.
167
- * @param {Object} [props.action] - Action button or configuration to render in the Card header.
168
- * @param {string} [props.className] - Additional classes to apply to the Card.
169
- * @param {string} [props.headerClassName] - Additional classes to apply to the Card header.
170
- * @param {React.ReactNode} [props.accessory] - Accessory element to render in the header.
171
- * @param {boolean} [props.fullWidthOnMobile=true] - Makes the Card full width on mobile.
172
- * @param {boolean} [props.roundedOnMobile=false] - Makes the Card rounded on mobile.
173
- * @returns {React.ReactElement} The rendered Card component.
174
- */ var Card = function(param) {
175
- var _param_allowOverflow = param.allowOverflow, allowOverflow = _param_allowOverflow === void 0 ? false : _param_allowOverflow, _param_roundedOnMobile = param.roundedOnMobile, roundedOnMobile = _param_roundedOnMobile === void 0 ? false : _param_roundedOnMobile, children = param.children, hideOnPrint = param.hideOnPrint, title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingMd" : _param_titleVariant, description = param.description, icon = param.icon, tooltip = param.tooltip, _param_tooltipPreferredPosition = param.tooltipPreferredPosition, tooltipPreferredPosition = _param_tooltipPreferredPosition === void 0 ? "above" : _param_tooltipPreferredPosition, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? false : _param_outlined, _param_highlighted = param.highlighted, highlighted = _param_highlighted === void 0 ? false : _param_highlighted, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_alternate = param.alternate, alternate = _param_alternate === void 0 ? false : _param_alternate, _param_padded = param.padded, padded = _param_padded === void 0 ? false : _param_padded, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_removeHeaderBottomPadding = param.removeHeaderBottomPadding, removeHeaderBottomPadding = _param_removeHeaderBottomPadding === void 0 ? false : _param_removeHeaderBottomPadding, onClick = param.onClick, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, action = param.action, className = param.className, headerClassName = param.headerClassName, accessory = param.accessory, _param_fullHeightBody = param.fullHeightBody, fullHeightBody = _param_fullHeightBody === void 0 ? false : _param_fullHeightBody, _param_fullWidthOnMobile = param.fullWidthOnMobile, fullWidthOnMobile = _param_fullWidthOnMobile === void 0 ? true : _param_fullWidthOnMobile, _param_shadow = param.shadow, shadow = _param_shadow === void 0 ? "default" : _param_shadow;
258
+ var Card = function(param) {
259
+ var _param_allowOverflow = param.allowOverflow, allowOverflow = _param_allowOverflow === void 0 ? false : _param_allowOverflow, roundedOnMobile = param.roundedOnMobile, children = param.children, hideOnPrint = param.hideOnPrint, title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingMd" : _param_titleVariant, description = param.description, _param_descriptionVariant = param.descriptionVariant, descriptionVariant = _param_descriptionVariant === void 0 ? "bodyMd" : _param_descriptionVariant, icon = param.icon, tooltip = param.tooltip, _param_tooltipPreferredPosition = param.tooltipPreferredPosition, tooltipPreferredPosition = _param_tooltipPreferredPosition === void 0 ? "above" : _param_tooltipPreferredPosition, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? false : _param_outlined, _param_highlighted = param.highlighted, highlighted = _param_highlighted === void 0 ? false : _param_highlighted, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_alternate = param.alternate, alternate = _param_alternate === void 0 ? false : _param_alternate, _param_padded = param.padded, padded = _param_padded === void 0 ? false : _param_padded, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_removeHeaderBottomPadding = param.removeHeaderBottomPadding, removeHeaderBottomPadding = _param_removeHeaderBottomPadding === void 0 ? false : _param_removeHeaderBottomPadding, onClick = param.onClick, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, action = param.action, className = param.className, headerClassName = param.headerClassName, accessory = param.accessory, _param_fullHeightBody = param.fullHeightBody, fullHeightBody = _param_fullHeightBody === void 0 ? false : _param_fullHeightBody, fullWidthOnMobile = param.fullWidthOnMobile, _param_shadow = param.shadow, shadow = _param_shadow === void 0 ? "default" : _param_shadow, nestedProp = param.nested;
176
260
  var embedded = useFrame().embedded;
261
+ var _React_useContext = React.useContext(CardContext), cardNested = _React_useContext.nested;
262
+ var isInModal = React.useContext(ModalContext);
263
+ var nested = nestedProp !== null && nestedProp !== void 0 ? nestedProp : cardNested || isInModal;
264
+ var resolvedFullWidthOnMobile = fullWidthOnMobile !== null && fullWidthOnMobile !== void 0 ? fullWidthOnMobile : nested ? false : true;
265
+ var resolvedRoundedOnMobile = roundedOnMobile !== null && roundedOnMobile !== void 0 ? roundedOnMobile : nested ? true : false;
177
266
  var showHeader = !!(title || action);
178
267
  var isClickable = !!onClick;
179
268
  var classes = styles({
@@ -182,12 +271,13 @@ var bodyStyles = tv({
182
271
  alternate: alternate,
183
272
  allowOverflow: allowOverflow,
184
273
  isClickable: isClickable,
185
- fullWidthOnMobile: fullWidthOnMobile,
186
- roundedOnMobile: roundedOnMobile,
274
+ fullWidthOnMobile: resolvedFullWidthOnMobile,
275
+ roundedOnMobile: resolvedRoundedOnMobile,
187
276
  outlined: outlined,
188
- shadow: shadow,
277
+ shadow: nested ? "none" : shadow,
189
278
  highlighted: highlighted,
190
- embedded: embedded
279
+ embedded: embedded,
280
+ nested: nested
191
281
  });
192
282
  var headerClasses = headerStyles({
193
283
  padded: padded,
@@ -217,89 +307,103 @@ var bodyStyles = tv({
217
307
  }
218
308
  return React.Children.toArray(children).map(process);
219
309
  };
220
- return /*#__PURE__*/ _jsxs("div", {
221
- className: "".concat(classes).concat(className ? " ".concat(className) : ""),
222
- onClick: isClickable ? onClick : undefined,
223
- children: [
224
- showHeader && /*#__PURE__*/ _jsxs("div", {
225
- className: "".concat(headerClasses).concat(headerClassName ? " ".concat(headerClassName) : ""),
226
- children: [
227
- /*#__PURE__*/ _jsxs("div", {
228
- className: "w-full flex gap-2 justify-between items-center",
229
- children: [
230
- /*#__PURE__*/ _jsxs("div", {
231
- className: "Litho-Card__HeaderTitle flex items-center gap-2",
232
- children: [
233
- loading ? /*#__PURE__*/ _jsx(Spinner, {
234
- size: "small"
235
- }) : /*#__PURE__*/ _jsxs(_Fragment, {
236
- children: [
237
- icon && typeof icon === "function" && /*#__PURE__*/ _jsx(Icon, {
238
- source: icon,
239
- color: "subdued"
240
- }),
241
- icon && (typeof icon === "undefined" ? "undefined" : _type_of(icon)) === "object" && icon
242
- ]
243
- }),
244
- /*#__PURE__*/ _jsxs("div", {
245
- children: [
246
- title && typeof title === "string" ? /*#__PURE__*/ _jsx(Text, {
247
- variant: titleVariant,
248
- children: title
249
- }) : title,
250
- description && /*#__PURE__*/ _jsx(Text, {
251
- color: "subdued",
252
- children: description
253
- })
254
- ]
255
- }),
256
- tooltip && /*#__PURE__*/ _jsx(Tooltip, {
257
- content: tooltip,
258
- preferredPosition: tooltipPreferredPosition
259
- })
260
- ]
261
- }),
262
- action && /*#__PURE__*/ _jsx("div", {
263
- className: "Litho-Card__HeaderAction self-start",
264
- children: action.content ? /*#__PURE__*/ _jsx(Button, {
265
- link: true,
266
- onClick: action.onAction || action.onClick,
267
- primary: action.primary,
268
- destructive: action.destructive,
269
- icon: action.icon,
270
- loading: action.loading,
271
- disabled: action.disabled,
272
- connectedDisclosure: action.connectedDisclosure,
273
- children: action.content
274
- }) : action
275
- })
276
- ]
310
+ return /*#__PURE__*/ _jsx(CardContext.Provider, {
311
+ value: NESTED_CONTEXT,
312
+ children: /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
313
+ className: "".concat(classes).concat(className ? " ".concat(className) : ""),
314
+ onClick: isClickable ? onClick : undefined
315
+ }, isClickable ? {
316
+ role: "button",
317
+ tabIndex: 0,
318
+ onKeyDown: function(e) {
319
+ if (e.key === "Enter" || e.key === " ") {
320
+ e.preventDefault();
321
+ onClick();
322
+ }
323
+ }
324
+ } : {}), {
325
+ children: [
326
+ showHeader && /*#__PURE__*/ _jsxs("div", {
327
+ className: "".concat(headerClasses).concat(headerClassName ? " ".concat(headerClassName) : ""),
328
+ children: [
329
+ /*#__PURE__*/ _jsxs("div", {
330
+ className: "w-full flex gap-2 justify-between items-center",
331
+ children: [
332
+ /*#__PURE__*/ _jsxs("div", {
333
+ className: "Litho-Card__HeaderTitle flex items-center gap-2",
334
+ children: [
335
+ loading ? /*#__PURE__*/ _jsx(Spinner, {
336
+ size: "small"
337
+ }) : /*#__PURE__*/ _jsxs(_Fragment, {
338
+ children: [
339
+ icon && typeof icon === "function" && /*#__PURE__*/ _jsx(Icon, {
340
+ source: icon,
341
+ color: "subdued"
342
+ }),
343
+ icon && (typeof icon === "undefined" ? "undefined" : _type_of(icon)) === "object" && icon
344
+ ]
345
+ }),
346
+ /*#__PURE__*/ _jsxs("div", {
347
+ children: [
348
+ title && typeof title === "string" ? /*#__PURE__*/ _jsx(Text, {
349
+ variant: titleVariant,
350
+ children: title
351
+ }) : title,
352
+ description && /*#__PURE__*/ _jsx(Text, {
353
+ color: "subdued",
354
+ variant: descriptionVariant,
355
+ children: description
356
+ })
357
+ ]
358
+ }),
359
+ tooltip && /*#__PURE__*/ _jsx(Tooltip, {
360
+ content: tooltip,
361
+ preferredPosition: tooltipPreferredPosition
362
+ })
363
+ ]
364
+ }),
365
+ action && /*#__PURE__*/ _jsx("div", {
366
+ className: "Litho-Card__HeaderAction self-start",
367
+ children: action.content ? /*#__PURE__*/ _jsx(Button, {
368
+ link: true,
369
+ onClick: action.onAction || action.onClick,
370
+ primary: action.primary,
371
+ destructive: action.destructive,
372
+ icon: action.icon,
373
+ loading: action.loading,
374
+ disabled: action.disabled,
375
+ connectedDisclosure: action.connectedDisclosure,
376
+ children: action.content
377
+ }) : action
378
+ })
379
+ ]
380
+ }),
381
+ accessory && /*#__PURE__*/ _jsx("div", {
382
+ className: "Litho-Card__HeaderAccessory pr-2",
383
+ children: accessory
384
+ })
385
+ ]
386
+ }),
387
+ emptyState.showIf ? /*#__PURE__*/ _jsx("div", {
388
+ className: bodyStyles({
389
+ padding: "full",
390
+ showHeader: showHeader,
391
+ fullHeight: fullHeightBody
277
392
  }),
278
- accessory && /*#__PURE__*/ _jsx("div", {
279
- className: "Litho-Card__HeaderAccessory pr-2",
280
- children: accessory
393
+ children: /*#__PURE__*/ _jsx(Text, {
394
+ color: "subdued",
395
+ children: emptyState.text
281
396
  })
282
- ]
283
- }),
284
- emptyState.showIf ? /*#__PURE__*/ _jsx("div", {
285
- className: bodyStyles({
286
- padding: "full",
287
- showHeader: showHeader,
288
- fullHeight: fullHeightBody
289
- }),
290
- children: /*#__PURE__*/ _jsx(Text, {
291
- color: "subdued",
292
- children: emptyState.text
397
+ }) : /*#__PURE__*/ _jsx("div", {
398
+ className: bodyStyles({
399
+ padding: padded ? "full" : paddedHalf ? "half" : "none",
400
+ showHeader: showHeader,
401
+ fullHeight: fullHeightBody
402
+ }),
403
+ children: processCardChildren(children)
293
404
  })
294
- }) : /*#__PURE__*/ _jsx("div", {
295
- className: bodyStyles({
296
- padding: padded ? "full" : paddedHalf ? "half" : "none",
297
- showHeader: showHeader,
298
- fullHeight: fullHeightBody
299
- }),
300
- children: processCardChildren(children)
301
- })
302
- ]
405
+ ]
406
+ }))
303
407
  });
304
408
  };
305
409
  var sectionStyles = tv({
@@ -389,9 +493,12 @@ var sectionBodyStyles = tv({
389
493
  ]
390
494
  });
391
495
  /**
392
- * Section component for dividing the Card into segments.
496
+ * @component Card.Section
497
+ *
498
+ * @usage
499
+ * - DO: Divide a Card into logical content segments.
500
+ * - DON'T: Nest sections within sections.
393
501
  *
394
- * @component
395
502
  * @param {Object} props - Props for the Section component.
396
503
  * @param {string|React.ReactNode} [props.title] - Title of the Section.
397
504
  * @param {string} [props.titleVariant='headingSm'] - Typography variant for the Section title.
@@ -409,12 +516,13 @@ var sectionBodyStyles = tv({
409
516
  * @param {React.ElementType|Object} [props.icon] - Icon to render alongside the title.
410
517
  * @param {string} [props.tooltip] - Tooltip content for the title.
411
518
  * @param {string} [props.description] - Description text for the Section.
519
+ * @param {string} [props.descriptionVariant='bodyMd'] - Typography variant for the Section description.
412
520
  * @param {React.ReactNode} [props.accessory] - Accessory element to render in the Section header.
413
521
  * @param {Object} [props.emptyState={}] - Configures the empty state of the Section.
414
522
  *
415
523
  * @returns {React.ReactElement} The rendered Section component.
416
524
  */ Card.Section = function(param) {
417
- var title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingSm" : _param_titleVariant, action = param.action, children = param.children, _param_padded = param.padded, padded = _param_padded === void 0 ? true : _param_padded, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_isFirst = param.isFirst, isFirst = _param_isFirst === void 0 ? false : _param_isFirst, _param_cardHasHeader = param.cardHasHeader, cardHasHeader = _param_cardHasHeader === void 0 ? false : _param_cardHasHeader, _param_borderBottom = param.borderBottom, borderBottom = _param_borderBottom === void 0 ? true : _param_borderBottom, _param_borderTop = param.borderTop, borderTop = _param_borderTop === void 0 ? false : _param_borderTop, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_headerGap = param.headerGap, headerGap = _param_headerGap === void 0 ? "0" : _param_headerGap, _param_gap = param.gap, gap = _param_gap === void 0 ? "0" : _param_gap, icon = param.icon, tooltip = param.tooltip, description = param.description, accessory = param.accessory, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, className = param.className, sectionBodyClassName = param.sectionBodyClassName;
525
+ var title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingSm" : _param_titleVariant, action = param.action, children = param.children, _param_padded = param.padded, padded = _param_padded === void 0 ? true : _param_padded, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_isFirst = param.isFirst, isFirst = _param_isFirst === void 0 ? false : _param_isFirst, _param_cardHasHeader = param.cardHasHeader, cardHasHeader = _param_cardHasHeader === void 0 ? false : _param_cardHasHeader, _param_borderBottom = param.borderBottom, borderBottom = _param_borderBottom === void 0 ? true : _param_borderBottom, _param_borderTop = param.borderTop, borderTop = _param_borderTop === void 0 ? false : _param_borderTop, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_headerGap = param.headerGap, headerGap = _param_headerGap === void 0 ? "0" : _param_headerGap, _param_gap = param.gap, gap = _param_gap === void 0 ? "0" : _param_gap, icon = param.icon, tooltip = param.tooltip, description = param.description, _param_descriptionVariant = param.descriptionVariant, descriptionVariant = _param_descriptionVariant === void 0 ? "bodyMd" : _param_descriptionVariant, accessory = param.accessory, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, className = param.className, sectionBodyClassName = param.sectionBodyClassName;
418
526
  var showHeader = !!(title || action);
419
527
  var sectionClasses = sectionStyles({
420
528
  borderBottom: borderBottom,
@@ -424,7 +532,7 @@ var sectionBodyStyles = tv({
424
532
  });
425
533
  var sectionHeaderClasses = sectionHeaderStyles();
426
534
  var sectionBodyClasses = sectionBodyStyles({
427
- padding: paddedHalf ? "half" : padded ? "full" : "none",
535
+ padding: paddedHalf || padded === "half" ? "half" : padded ? "full" : "none",
428
536
  showHeader: showHeader,
429
537
  cardHasHeader: cardHasHeader,
430
538
  isFirst: isFirst,
@@ -479,6 +587,7 @@ var sectionBodyStyles = tv({
479
587
  }),
480
588
  description && /*#__PURE__*/ _jsx(Text, {
481
589
  color: "subdued",
590
+ variant: descriptionVariant,
482
591
  children: description
483
592
  })
484
593
  ]
@@ -501,17 +610,28 @@ var sectionBodyStyles = tv({
501
610
  };
502
611
  Card.Section.displayName = "Card.Section";
503
612
  var clickableRowStyles = tv({
504
- base: "Litho-Card__Row py-1.5 px-2.5 @md:px-3 cursor-pointer rounded-md hover:bg-tint-2 active:bg-tint-3",
613
+ base: "Litho-Card__Row py-1.5 px-2 @md:px-2.5 rounded-md",
505
614
  variants: {
615
+ interactive: {
616
+ true: "cursor-pointer hover:bg-tint-2 active:bg-tint-3"
617
+ },
506
618
  disabled: {
507
619
  true: "opacity-50 cursor-not-allowed pointer-events-none"
508
620
  }
621
+ },
622
+ defaultVariants: {
623
+ interactive: true
509
624
  }
510
625
  });
511
626
  /**
512
- * ClickableRow component for creating clickable rows inside the Card.
627
+ * @component Card.ClickableRow
628
+ *
629
+ * @usage
630
+ * - DO: Use for rows that navigate or trigger actions.
631
+ *
632
+ * @accessibility
633
+ * - Renders as a clickable element; ensure it is keyboard accessible and has a clear action label.
513
634
  *
514
- * @component
515
635
  * @param {Object} props - Props for the ClickableRow component.
516
636
  * @param {React.ReactNode} [props.children] - Child elements to render inside the row.
517
637
  * @param {Function} [props.onClick] - Click handler for the row.
@@ -519,24 +639,43 @@ var clickableRowStyles = tv({
519
639
  * @param {string} [props.url] - URL to open when the row is clicked.
520
640
  * @param {string} [props.className] - Additional classes to apply to the row.
521
641
  * @param {boolean} [props.disabled=false] - Disables interaction with the row.
642
+ * @param {string} [props.accessibilityLabel] - Accessible label for the row (aria-label).
522
643
  *
523
644
  * @returns {React.ReactElement} The rendered ClickableRow component.
524
645
  */ Card.ClickableRow = function(param) {
525
- var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className;
646
+ var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className, accessibilityLabel = param.accessibilityLabel;
526
647
  var classes = clickableRowStyles({
527
648
  disabled: disabled
528
649
  });
650
+ var handleClick = url ? function() {
651
+ return window.open(url, "_blank");
652
+ } : onClick;
653
+ var handleKeyDown = function(e) {
654
+ if (disabled) return;
655
+ if (e.key === "Enter" || e.key === " ") {
656
+ e.preventDefault();
657
+ handleClick === null || handleClick === void 0 ? void 0 : handleClick(e);
658
+ }
659
+ };
529
660
  return /*#__PURE__*/ _jsx("div", {
530
661
  id: id,
531
- onClick: url ? function() {
532
- return window.open(url, "_blank");
533
- } : onClick,
662
+ role: "button",
663
+ tabIndex: disabled ? -1 : 0,
664
+ "aria-disabled": disabled || undefined,
665
+ "aria-label": accessibilityLabel,
666
+ onClick: disabled ? undefined : handleClick,
667
+ onKeyDown: handleKeyDown,
534
668
  className: "".concat(classes).concat(className ? " ".concat(className) : ""),
535
669
  children: children
536
670
  });
537
671
  };
538
672
  Card.ClickableRow.displayName = "Card.ClickableRow";
539
- Card.Rows = function(param) {
673
+ /**
674
+ * Rows container component for grouping multiple Card.Row elements.
675
+ *
676
+ * @usage
677
+ * - DO: Use to group multiple `Card.Row` elements with consistent spacing.
678
+ */ Card.Rows = function(param) {
540
679
  var children = param.children;
541
680
  return /*#__PURE__*/ _jsx("div", {
542
681
  className: "px-1.5 pb-1.5 @md:pb-2 @md:px-2",
@@ -545,9 +684,11 @@ Card.Rows = function(param) {
545
684
  };
546
685
  Card.Rows.displayName = "Card.Rows";
547
686
  /**
548
- * Row component for creating clickable rows inside the Card.
687
+ * @component Card.Row
688
+ *
689
+ * @usage
690
+ * - DO: Use for individual data rows within `Card.Rows`.
549
691
  *
550
- * @component
551
692
  * @param {Object} props - Props for the Row component.
552
693
  * @param {React.ReactNode} [props.children] - Child elements to render inside the row.
553
694
  * @param {Function} [props.onClick] - Click handler for the row.
@@ -555,21 +696,40 @@ Card.Rows.displayName = "Card.Rows";
555
696
  * @param {string} [props.url] - URL to open when the row is clicked.
556
697
  * @param {string} [props.className] - Additional classes to apply to the row.
557
698
  * @param {boolean} [props.disabled=false] - Disables interaction with the row.
699
+ * @param {string} [props.accessibilityLabel] - Accessible label for the row (aria-label).
558
700
  *
559
701
  * @returns {React.ReactElement} The rendered Row component.
560
702
  */ Card.Row = function(param) {
561
- var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className;
703
+ var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className, accessibilityLabel = param.accessibilityLabel;
704
+ var isInteractive = !!(onClick || url);
562
705
  var classes = clickableRowStyles({
563
- disabled: disabled
706
+ disabled: isInteractive ? disabled : false,
707
+ interactive: isInteractive
564
708
  });
709
+ var handleClick = url ? function() {
710
+ return window.open(url, "_blank");
711
+ } : onClick;
712
+ var handleKeyDown = function(e) {
713
+ if (!isInteractive || disabled) return;
714
+ if (e.key === "Enter" || e.key === " ") {
715
+ e.preventDefault();
716
+ handleClick === null || handleClick === void 0 ? void 0 : handleClick(e);
717
+ }
718
+ };
565
719
  return /*#__PURE__*/ _jsx("div", {
566
720
  id: id,
567
- onClick: url ? function() {
568
- return window.open(url, "_blank");
569
- } : onClick,
721
+ role: isInteractive ? "button" : undefined,
722
+ tabIndex: isInteractive ? disabled ? -1 : 0 : undefined,
723
+ "aria-disabled": isInteractive && disabled ? true : undefined,
724
+ "aria-label": accessibilityLabel,
725
+ onClick: isInteractive && !disabled ? handleClick : undefined,
726
+ onKeyDown: isInteractive ? handleKeyDown : undefined,
570
727
  className: "".concat(classes).concat(className ? " ".concat(className) : ""),
571
728
  children: children
572
729
  });
573
730
  };
574
731
  Card.Row.displayName = "Card.Row";
732
+ export var useCard = function() {
733
+ return React.useContext(CardContext);
734
+ };
575
735
  export default Card;