@slipstream-ui/core 0.6.1 → 0.8.0

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 (386) hide show
  1. package/dist/index.d.mts +470 -30
  2. package/dist/index.d.ts +470 -30
  3. package/dist/index.js +1455 -750
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1442 -744
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/accordion.manifest.json +7 -1
  8. package/dist/manifests/alert.manifest.json +1 -1
  9. package/dist/manifests/announcement-bar.manifest.json +1 -1
  10. package/dist/manifests/app-shell.manifest.json +1 -1
  11. package/dist/manifests/applied-filters.manifest.json +1 -1
  12. package/dist/manifests/article-card.manifest.json +1 -1
  13. package/dist/manifests/auth-layout.manifest.json +19 -1
  14. package/dist/manifests/autocomplete.manifest.json +1 -1
  15. package/dist/manifests/avatar.manifest.json +1 -1
  16. package/dist/manifests/badge.manifest.json +13 -1
  17. package/dist/manifests/block.manifest.json +1 -1
  18. package/dist/manifests/bottom-nav.manifest.json +130 -0
  19. package/dist/manifests/breadcrumb.manifest.json +1 -1
  20. package/dist/manifests/button-group.manifest.json +1 -1
  21. package/dist/manifests/button.manifest.json +1 -1
  22. package/dist/manifests/card.manifest.json +1 -1
  23. package/dist/manifests/checkbox.manifest.json +1 -1
  24. package/dist/manifests/comparison-table.manifest.json +1 -1
  25. package/dist/manifests/confirm-dialog.manifest.json +1 -1
  26. package/dist/manifests/contact-strip.manifest.json +1 -1
  27. package/dist/manifests/container.manifest.json +1 -1
  28. package/dist/manifests/cta-section.manifest.json +1 -1
  29. package/dist/manifests/data-table.manifest.json +1 -1
  30. package/dist/manifests/date-picker.manifest.json +1 -1
  31. package/dist/manifests/date-range-picker.manifest.json +1 -1
  32. package/dist/manifests/deal-card.manifest.json +158 -0
  33. package/dist/manifests/dialog.manifest.json +1 -1
  34. package/dist/manifests/document-card.manifest.json +108 -0
  35. package/dist/manifests/drawer.manifest.json +48 -2
  36. package/dist/manifests/empty-state.manifest.json +1 -1
  37. package/dist/manifests/entity-card.manifest.json +114 -0
  38. package/dist/manifests/feature-grid.manifest.json +1 -1
  39. package/dist/manifests/feature-row.manifest.json +1 -1
  40. package/dist/manifests/fieldset.manifest.json +1 -1
  41. package/dist/manifests/file-upload.manifest.json +1 -1
  42. package/dist/manifests/filter-bar.manifest.json +1 -1
  43. package/dist/manifests/filter-chips.manifest.json +1 -1
  44. package/dist/manifests/filter-panel.manifest.json +1 -1
  45. package/dist/manifests/flex.manifest.json +1 -1
  46. package/dist/manifests/form-field.manifest.json +1 -1
  47. package/dist/manifests/form-layout.manifest.json +1 -1
  48. package/dist/manifests/form.manifest.json +1 -1
  49. package/dist/manifests/grid.manifest.json +1 -1
  50. package/dist/manifests/heading.manifest.json +1 -1
  51. package/dist/manifests/hero.manifest.json +40 -8
  52. package/dist/manifests/input-group.manifest.json +1 -1
  53. package/dist/manifests/input.manifest.json +1 -1
  54. package/dist/manifests/label.manifest.json +1 -1
  55. package/dist/manifests/link-tabs.manifest.json +1 -1
  56. package/dist/manifests/link.manifest.json +1 -1
  57. package/dist/manifests/list.manifest.json +1 -1
  58. package/dist/manifests/load-more.manifest.json +88 -0
  59. package/dist/manifests/logo-cloud.manifest.json +1 -1
  60. package/dist/manifests/menu.manifest.json +1 -1
  61. package/dist/manifests/metric-card.manifest.json +36 -4
  62. package/dist/manifests/multi-select.manifest.json +1 -1
  63. package/dist/manifests/newsletter.manifest.json +1 -1
  64. package/dist/manifests/page-header.manifest.json +7 -1
  65. package/dist/manifests/pagination.manifest.json +1 -1
  66. package/dist/manifests/password-input.manifest.json +1 -1
  67. package/dist/manifests/popover.manifest.json +1 -1
  68. package/dist/manifests/process-steps.manifest.json +1 -1
  69. package/dist/manifests/progress.manifest.json +1 -1
  70. package/dist/manifests/prose.manifest.json +1 -1
  71. package/dist/manifests/radio.manifest.json +1 -1
  72. package/dist/manifests/range-slider.manifest.json +1 -1
  73. package/dist/manifests/search.manifest.json +1 -1
  74. package/dist/manifests/section-heading.manifest.json +1 -1
  75. package/dist/manifests/section.manifest.json +1 -1
  76. package/dist/manifests/segmented-control.manifest.json +1 -1
  77. package/dist/manifests/select-menu.manifest.json +2 -2
  78. package/dist/manifests/select.manifest.json +1 -1
  79. package/dist/manifests/separator.manifest.json +1 -1
  80. package/dist/manifests/site-footer.manifest.json +1 -1
  81. package/dist/manifests/site-header.manifest.json +1 -1
  82. package/dist/manifests/skeleton.manifest.json +1 -1
  83. package/dist/manifests/spinner.manifest.json +1 -1
  84. package/dist/manifests/stat-band.manifest.json +1 -1
  85. package/dist/manifests/stepper.manifest.json +69 -5
  86. package/dist/manifests/switch.manifest.json +1 -1
  87. package/dist/manifests/table-card.manifest.json +1 -1
  88. package/dist/manifests/table-of-contents.manifest.json +26 -5
  89. package/dist/manifests/table.manifest.json +1 -1
  90. package/dist/manifests/tabs.manifest.json +1 -1
  91. package/dist/manifests/testimonial.manifest.json +1 -1
  92. package/dist/manifests/text.manifest.json +1 -1
  93. package/dist/manifests/textarea.manifest.json +1 -1
  94. package/dist/manifests/theme-toggle.manifest.json +1 -1
  95. package/dist/manifests/time-picker.manifest.json +1 -1
  96. package/dist/manifests/timeline.manifest.json +1 -1
  97. package/dist/manifests/toast.manifest.json +1 -1
  98. package/dist/manifests/tombstone-card.manifest.json +97 -0
  99. package/dist/manifests/tooltip.manifest.json +1 -1
  100. package/dist/src/components/accordion/Accordion.d.ts +17 -1
  101. package/dist/src/components/accordion/Accordion.js +5 -1
  102. package/dist/src/components/accordion/Accordion.js.map +1 -1
  103. package/dist/src/components/accordion/Accordion.mjs +5 -1
  104. package/dist/src/components/accordion/Accordion.mjs.map +1 -1
  105. package/dist/src/components/auth-layout/AuthLayout.d.ts +14 -2
  106. package/dist/src/components/auth-layout/AuthLayout.js +10 -2
  107. package/dist/src/components/auth-layout/AuthLayout.js.map +1 -1
  108. package/dist/src/components/auth-layout/AuthLayout.mjs +10 -2
  109. package/dist/src/components/auth-layout/AuthLayout.mjs.map +1 -1
  110. package/dist/src/components/badge/Badge.d.ts +2 -0
  111. package/dist/src/components/badge/Badge.js +9 -3
  112. package/dist/src/components/badge/Badge.js.map +1 -1
  113. package/dist/src/components/badge/Badge.mjs +9 -3
  114. package/dist/src/components/badge/Badge.mjs.map +1 -1
  115. package/dist/src/components/bottom-nav/BottomNav.d.ts +36 -0
  116. package/dist/src/components/bottom-nav/BottomNav.js +90 -0
  117. package/dist/src/components/bottom-nav/BottomNav.js.map +1 -0
  118. package/dist/src/components/bottom-nav/BottomNav.mjs +66 -0
  119. package/dist/src/components/bottom-nav/BottomNav.mjs.map +1 -0
  120. package/dist/src/components/bottom-nav/index.d.ts +1 -0
  121. package/dist/src/components/bottom-nav/index.js +23 -0
  122. package/dist/src/components/bottom-nav/index.js.map +1 -0
  123. package/dist/src/components/bottom-nav/index.mjs +2 -0
  124. package/dist/src/components/bottom-nav/index.mjs.map +1 -0
  125. package/dist/src/components/date-picker/DatePicker.js +1 -1
  126. package/dist/src/components/date-picker/DatePicker.js.map +1 -1
  127. package/dist/src/components/date-picker/DatePicker.mjs +1 -1
  128. package/dist/src/components/date-picker/DatePicker.mjs.map +1 -1
  129. package/dist/src/components/deal-card/DealCard.d.ts +72 -0
  130. package/dist/src/components/deal-card/DealCard.js +108 -0
  131. package/dist/src/components/deal-card/DealCard.js.map +1 -0
  132. package/dist/src/components/deal-card/DealCard.mjs +74 -0
  133. package/dist/src/components/deal-card/DealCard.mjs.map +1 -0
  134. package/dist/src/components/deal-card/index.d.ts +2 -0
  135. package/dist/src/components/deal-card/index.js +29 -0
  136. package/dist/src/components/deal-card/index.js.map +1 -0
  137. package/dist/src/components/deal-card/index.mjs +5 -0
  138. package/dist/src/components/deal-card/index.mjs.map +1 -0
  139. package/dist/src/components/document-card/DocumentCard.d.ts +42 -0
  140. package/dist/src/components/document-card/DocumentCard.js +84 -0
  141. package/dist/src/components/document-card/DocumentCard.js.map +1 -0
  142. package/dist/src/components/document-card/DocumentCard.mjs +50 -0
  143. package/dist/src/components/document-card/DocumentCard.mjs.map +1 -0
  144. package/dist/src/components/document-card/index.d.ts +2 -0
  145. package/dist/src/components/document-card/index.js +29 -0
  146. package/dist/src/components/document-card/index.js.map +1 -0
  147. package/dist/src/components/document-card/index.mjs +5 -0
  148. package/dist/src/components/document-card/index.mjs.map +1 -0
  149. package/dist/src/components/drawer/Drawer.d.ts +25 -2
  150. package/dist/src/components/drawer/Drawer.js +97 -6
  151. package/dist/src/components/drawer/Drawer.js.map +1 -1
  152. package/dist/src/components/drawer/Drawer.mjs +97 -6
  153. package/dist/src/components/drawer/Drawer.mjs.map +1 -1
  154. package/dist/src/components/empty-state/EmptyState.d.ts +13 -4
  155. package/dist/src/components/empty-state/EmptyState.js +13 -1
  156. package/dist/src/components/empty-state/EmptyState.js.map +1 -1
  157. package/dist/src/components/empty-state/EmptyState.mjs +13 -1
  158. package/dist/src/components/empty-state/EmptyState.mjs.map +1 -1
  159. package/dist/src/components/entity-card/EntityCard.d.ts +78 -0
  160. package/dist/src/components/entity-card/EntityCard.js +95 -0
  161. package/dist/src/components/entity-card/EntityCard.js.map +1 -0
  162. package/dist/src/components/entity-card/EntityCard.mjs +60 -0
  163. package/dist/src/components/entity-card/EntityCard.mjs.map +1 -0
  164. package/dist/src/components/entity-card/index.d.ts +2 -0
  165. package/dist/src/components/entity-card/index.js +31 -0
  166. package/dist/src/components/entity-card/index.js.map +1 -0
  167. package/dist/src/components/entity-card/index.mjs +6 -0
  168. package/dist/src/components/entity-card/index.mjs.map +1 -0
  169. package/dist/src/components/hero/Hero.d.ts +25 -13
  170. package/dist/src/components/hero/Hero.js +116 -12
  171. package/dist/src/components/hero/Hero.js.map +1 -1
  172. package/dist/src/components/hero/Hero.mjs +116 -12
  173. package/dist/src/components/hero/Hero.mjs.map +1 -1
  174. package/dist/src/components/load-more/LoadMore.d.ts +34 -0
  175. package/dist/src/components/load-more/LoadMore.js +55 -0
  176. package/dist/src/components/load-more/LoadMore.js.map +1 -0
  177. package/dist/src/components/load-more/LoadMore.mjs +21 -0
  178. package/dist/src/components/load-more/LoadMore.mjs.map +1 -0
  179. package/dist/src/components/load-more/index.d.ts +2 -0
  180. package/dist/src/components/load-more/index.js +29 -0
  181. package/dist/src/components/load-more/index.js.map +1 -0
  182. package/dist/src/components/load-more/index.mjs +5 -0
  183. package/dist/src/components/load-more/index.mjs.map +1 -0
  184. package/dist/src/components/metric-card/MetricCard.d.ts +23 -4
  185. package/dist/src/components/metric-card/MetricCard.js +32 -5
  186. package/dist/src/components/metric-card/MetricCard.js.map +1 -1
  187. package/dist/src/components/metric-card/MetricCard.mjs +32 -5
  188. package/dist/src/components/metric-card/MetricCard.mjs.map +1 -1
  189. package/dist/src/components/page-header/PageHeader.d.ts +4 -0
  190. package/dist/src/components/page-header/PageHeader.js +3 -2
  191. package/dist/src/components/page-header/PageHeader.js.map +1 -1
  192. package/dist/src/components/page-header/PageHeader.mjs +3 -2
  193. package/dist/src/components/page-header/PageHeader.mjs.map +1 -1
  194. package/dist/src/components/range-slider/RangeSlider.js +6 -6
  195. package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
  196. package/dist/src/components/range-slider/RangeSlider.mjs +6 -6
  197. package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
  198. package/dist/src/components/select-menu/SelectMenu.js +2 -0
  199. package/dist/src/components/select-menu/SelectMenu.js.map +1 -1
  200. package/dist/src/components/select-menu/SelectMenu.mjs +2 -0
  201. package/dist/src/components/select-menu/SelectMenu.mjs.map +1 -1
  202. package/dist/src/components/separator/Separator.d.ts +3 -3
  203. package/dist/src/components/separator/Separator.js +1 -1
  204. package/dist/src/components/separator/Separator.js.map +1 -1
  205. package/dist/src/components/separator/Separator.mjs +1 -1
  206. package/dist/src/components/separator/Separator.mjs.map +1 -1
  207. package/dist/src/components/stepper/Stepper.d.ts +35 -0
  208. package/dist/src/components/stepper/Stepper.js +118 -25
  209. package/dist/src/components/stepper/Stepper.js.map +1 -1
  210. package/dist/src/components/stepper/Stepper.mjs +118 -25
  211. package/dist/src/components/stepper/Stepper.mjs.map +1 -1
  212. package/dist/src/components/table-of-contents/TableOfContents.d.ts +10 -2
  213. package/dist/src/components/table-of-contents/TableOfContents.js +13 -0
  214. package/dist/src/components/table-of-contents/TableOfContents.js.map +1 -1
  215. package/dist/src/components/table-of-contents/TableOfContents.mjs +13 -0
  216. package/dist/src/components/table-of-contents/TableOfContents.mjs.map +1 -1
  217. package/dist/src/components/tabs/Tabs.js +43 -3
  218. package/dist/src/components/tabs/Tabs.js.map +1 -1
  219. package/dist/src/components/tabs/Tabs.mjs +43 -3
  220. package/dist/src/components/tabs/Tabs.mjs.map +1 -1
  221. package/dist/src/components/time-picker/TimePicker.js +1 -1
  222. package/dist/src/components/time-picker/TimePicker.js.map +1 -1
  223. package/dist/src/components/time-picker/TimePicker.mjs +1 -1
  224. package/dist/src/components/time-picker/TimePicker.mjs.map +1 -1
  225. package/dist/src/components/timeline/Timeline.js +2 -2
  226. package/dist/src/components/timeline/Timeline.js.map +1 -1
  227. package/dist/src/components/timeline/Timeline.mjs +2 -2
  228. package/dist/src/components/timeline/Timeline.mjs.map +1 -1
  229. package/dist/src/components/tombstone-card/TombstoneCard.d.ts +39 -0
  230. package/dist/src/components/tombstone-card/TombstoneCard.js +86 -0
  231. package/dist/src/components/tombstone-card/TombstoneCard.js.map +1 -0
  232. package/dist/src/components/tombstone-card/TombstoneCard.mjs +52 -0
  233. package/dist/src/components/tombstone-card/TombstoneCard.mjs.map +1 -0
  234. package/dist/src/components/tombstone-card/index.d.ts +2 -0
  235. package/dist/src/components/tombstone-card/index.js +29 -0
  236. package/dist/src/components/tombstone-card/index.js.map +1 -0
  237. package/dist/src/components/tombstone-card/index.mjs +5 -0
  238. package/dist/src/components/tombstone-card/index.mjs.map +1 -0
  239. package/dist/src/index.d.ts +6 -0
  240. package/dist/styles-full.css +1 -1
  241. package/dist/styles.css +1 -1
  242. package/package.json +3 -3
  243. package/src/components/accordion/Accordion.test.tsx +31 -0
  244. package/src/components/accordion/Accordion.tsx +27 -2
  245. package/src/components/auth-layout/AuthLayout.test.tsx +36 -0
  246. package/src/components/auth-layout/AuthLayout.tsx +20 -3
  247. package/src/components/badge/Badge.test.tsx +7 -0
  248. package/src/components/badge/Badge.tsx +8 -2
  249. package/src/components/bottom-nav/BottomNav.test.tsx +48 -0
  250. package/src/components/bottom-nav/BottomNav.tsx +117 -0
  251. package/src/components/bottom-nav/index.ts +1 -0
  252. package/src/components/date-picker/DatePicker.tsx +1 -1
  253. package/src/components/deal-card/DealCard.test.tsx +54 -0
  254. package/src/components/deal-card/DealCard.tsx +138 -0
  255. package/src/components/deal-card/index.ts +2 -0
  256. package/src/components/document-card/DocumentCard.test.tsx +41 -0
  257. package/src/components/document-card/DocumentCard.tsx +82 -0
  258. package/src/components/document-card/index.ts +2 -0
  259. package/src/components/drawer/Drawer.test.tsx +86 -1
  260. package/src/components/drawer/Drawer.tsx +135 -7
  261. package/src/components/empty-state/EmptyState.test.tsx +26 -1
  262. package/src/components/empty-state/EmptyState.tsx +40 -3
  263. package/src/components/entity-card/EntityCard.test.tsx +38 -0
  264. package/src/components/entity-card/EntityCard.tsx +133 -0
  265. package/src/components/entity-card/index.ts +2 -0
  266. package/src/components/hero/Hero.test.tsx +14 -0
  267. package/src/components/hero/Hero.tsx +111 -19
  268. package/src/components/load-more/LoadMore.test.tsx +28 -0
  269. package/src/components/load-more/LoadMore.tsx +53 -0
  270. package/src/components/load-more/index.ts +2 -0
  271. package/src/components/metric-card/MetricCard.test.tsx +32 -0
  272. package/src/components/metric-card/MetricCard.tsx +45 -7
  273. package/src/components/page-header/PageHeader.test.tsx +13 -0
  274. package/src/components/page-header/PageHeader.tsx +5 -2
  275. package/src/components/range-slider/RangeSlider.test.tsx +8 -0
  276. package/src/components/range-slider/RangeSlider.tsx +10 -6
  277. package/src/components/select-menu/SelectMenu.test.tsx +20 -10
  278. package/src/components/select-menu/SelectMenu.tsx +2 -0
  279. package/src/components/separator/Separator.test.tsx +9 -1
  280. package/src/components/separator/Separator.tsx +1 -1
  281. package/src/components/stepper/Stepper.test.tsx +19 -0
  282. package/src/components/stepper/Stepper.tsx +169 -37
  283. package/src/components/table-of-contents/TableOfContents.test.tsx +12 -1
  284. package/src/components/table-of-contents/TableOfContents.tsx +25 -1
  285. package/src/components/tabs/Tabs.test.tsx +12 -0
  286. package/src/components/tabs/Tabs.tsx +48 -4
  287. package/src/components/time-picker/TimePicker.tsx +1 -1
  288. package/src/components/timeline/Timeline.tsx +2 -2
  289. package/src/components/tombstone-card/TombstoneCard.test.tsx +26 -0
  290. package/src/components/tombstone-card/TombstoneCard.tsx +77 -0
  291. package/src/components/tombstone-card/index.ts +2 -0
  292. package/src/index.ts +6 -0
  293. package/src/manifests/accordion.manifest.json +7 -1
  294. package/src/manifests/alert.manifest.json +1 -1
  295. package/src/manifests/announcement-bar.manifest.json +1 -1
  296. package/src/manifests/app-shell.manifest.json +1 -1
  297. package/src/manifests/applied-filters.manifest.json +1 -1
  298. package/src/manifests/article-card.manifest.json +1 -1
  299. package/src/manifests/auth-layout.manifest.json +19 -1
  300. package/src/manifests/autocomplete.manifest.json +1 -1
  301. package/src/manifests/avatar.manifest.json +1 -1
  302. package/src/manifests/badge.manifest.json +13 -1
  303. package/src/manifests/block.manifest.json +1 -1
  304. package/src/manifests/bottom-nav.manifest.json +130 -0
  305. package/src/manifests/breadcrumb.manifest.json +1 -1
  306. package/src/manifests/button-group.manifest.json +1 -1
  307. package/src/manifests/button.manifest.json +1 -1
  308. package/src/manifests/card.manifest.json +1 -1
  309. package/src/manifests/checkbox.manifest.json +1 -1
  310. package/src/manifests/comparison-table.manifest.json +1 -1
  311. package/src/manifests/confirm-dialog.manifest.json +1 -1
  312. package/src/manifests/contact-strip.manifest.json +1 -1
  313. package/src/manifests/container.manifest.json +1 -1
  314. package/src/manifests/cta-section.manifest.json +1 -1
  315. package/src/manifests/data-table.manifest.json +1 -1
  316. package/src/manifests/date-picker.manifest.json +1 -1
  317. package/src/manifests/date-range-picker.manifest.json +1 -1
  318. package/src/manifests/deal-card.manifest.json +158 -0
  319. package/src/manifests/dialog.manifest.json +1 -1
  320. package/src/manifests/document-card.manifest.json +108 -0
  321. package/src/manifests/drawer.manifest.json +48 -2
  322. package/src/manifests/empty-state.manifest.json +1 -1
  323. package/src/manifests/entity-card.manifest.json +114 -0
  324. package/src/manifests/feature-grid.manifest.json +1 -1
  325. package/src/manifests/feature-row.manifest.json +1 -1
  326. package/src/manifests/fieldset.manifest.json +1 -1
  327. package/src/manifests/file-upload.manifest.json +1 -1
  328. package/src/manifests/filter-bar.manifest.json +1 -1
  329. package/src/manifests/filter-chips.manifest.json +1 -1
  330. package/src/manifests/filter-panel.manifest.json +1 -1
  331. package/src/manifests/flex.manifest.json +1 -1
  332. package/src/manifests/form-field.manifest.json +1 -1
  333. package/src/manifests/form-layout.manifest.json +1 -1
  334. package/src/manifests/form.manifest.json +1 -1
  335. package/src/manifests/grid.manifest.json +1 -1
  336. package/src/manifests/heading.manifest.json +1 -1
  337. package/src/manifests/hero.manifest.json +40 -8
  338. package/src/manifests/input-group.manifest.json +1 -1
  339. package/src/manifests/input.manifest.json +1 -1
  340. package/src/manifests/label.manifest.json +1 -1
  341. package/src/manifests/link-tabs.manifest.json +1 -1
  342. package/src/manifests/link.manifest.json +1 -1
  343. package/src/manifests/list.manifest.json +1 -1
  344. package/src/manifests/load-more.manifest.json +88 -0
  345. package/src/manifests/logo-cloud.manifest.json +1 -1
  346. package/src/manifests/menu.manifest.json +1 -1
  347. package/src/manifests/metric-card.manifest.json +36 -4
  348. package/src/manifests/multi-select.manifest.json +1 -1
  349. package/src/manifests/newsletter.manifest.json +1 -1
  350. package/src/manifests/page-header.manifest.json +7 -1
  351. package/src/manifests/pagination.manifest.json +1 -1
  352. package/src/manifests/password-input.manifest.json +1 -1
  353. package/src/manifests/popover.manifest.json +1 -1
  354. package/src/manifests/process-steps.manifest.json +1 -1
  355. package/src/manifests/progress.manifest.json +1 -1
  356. package/src/manifests/prose.manifest.json +1 -1
  357. package/src/manifests/radio.manifest.json +1 -1
  358. package/src/manifests/range-slider.manifest.json +1 -1
  359. package/src/manifests/search.manifest.json +1 -1
  360. package/src/manifests/section-heading.manifest.json +1 -1
  361. package/src/manifests/section.manifest.json +1 -1
  362. package/src/manifests/segmented-control.manifest.json +1 -1
  363. package/src/manifests/select-menu.manifest.json +2 -2
  364. package/src/manifests/select.manifest.json +1 -1
  365. package/src/manifests/separator.manifest.json +1 -1
  366. package/src/manifests/site-footer.manifest.json +1 -1
  367. package/src/manifests/site-header.manifest.json +1 -1
  368. package/src/manifests/skeleton.manifest.json +1 -1
  369. package/src/manifests/spinner.manifest.json +1 -1
  370. package/src/manifests/stat-band.manifest.json +1 -1
  371. package/src/manifests/stepper.manifest.json +69 -5
  372. package/src/manifests/switch.manifest.json +1 -1
  373. package/src/manifests/table-card.manifest.json +1 -1
  374. package/src/manifests/table-of-contents.manifest.json +26 -5
  375. package/src/manifests/table.manifest.json +1 -1
  376. package/src/manifests/tabs.manifest.json +1 -1
  377. package/src/manifests/testimonial.manifest.json +1 -1
  378. package/src/manifests/text.manifest.json +1 -1
  379. package/src/manifests/textarea.manifest.json +1 -1
  380. package/src/manifests/theme-toggle.manifest.json +1 -1
  381. package/src/manifests/time-picker.manifest.json +1 -1
  382. package/src/manifests/timeline.manifest.json +1 -1
  383. package/src/manifests/toast.manifest.json +1 -1
  384. package/src/manifests/tombstone-card.manifest.json +97 -0
  385. package/src/manifests/tooltip.manifest.json +1 -1
  386. package/src/test/jest-axe.d.ts +6 -1
@@ -0,0 +1,82 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../utils/cn';
3
+ import { Badge } from '../badge/Badge';
4
+ import { Button } from '../button/Button';
5
+ import { Card, CardContent } from '../card/Card';
6
+
7
+ export type DocumentStatus = 'available' | 'restricted' | 'pending';
8
+
9
+ export type DocumentCardProps = React.HTMLAttributes<HTMLElement> & {
10
+ /** File name. */
11
+ name: string;
12
+ /** Short file type label, such as PDF or XLSX. */
13
+ fileType: string;
14
+ /** Human-readable file size. */
15
+ size?: string;
16
+ /** Updated date or relative time. */
17
+ updatedAt?: string;
18
+ /** Access state. Default 'available'. */
19
+ status?: DocumentStatus;
20
+ /** Download handler. Omit to render a display-only row. */
21
+ onDownload?: () => void;
22
+ /** Download button label. Default "Download". */
23
+ downloadLabel?: string;
24
+ /** Custom file icon slot. */
25
+ icon?: React.ReactNode;
26
+ };
27
+
28
+ const statusConfig: Record<DocumentStatus, { label: string; variant: 'success' | 'warning' | 'info' }> = {
29
+ available: { label: 'Available', variant: 'success' },
30
+ restricted: { label: 'Restricted', variant: 'warning' },
31
+ pending: { label: 'Pending', variant: 'info' },
32
+ };
33
+
34
+ /**
35
+ * Document row for a deal room or diligence list. The row states the access
36
+ * status and only exposes the download action when a handler is provided.
37
+ */
38
+ export const DocumentCard = React.forwardRef<HTMLElement, DocumentCardProps>(function DocumentCard(
39
+ {
40
+ name,
41
+ fileType,
42
+ size,
43
+ updatedAt,
44
+ status = 'available',
45
+ onDownload,
46
+ downloadLabel = 'Download',
47
+ icon,
48
+ className,
49
+ ...props
50
+ },
51
+ ref
52
+ ) {
53
+ const statusInfo = statusConfig[status];
54
+ const meta = [fileType, size, updatedAt].filter(Boolean).join(' · ');
55
+
56
+ return (
57
+ <Card ref={ref as never} className={cn('w-full', className)} {...props}>
58
+ <CardContent className="flex items-center gap-3 p-4">
59
+ <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5">
60
+ {icon ?? <span className="text-[10px] font-bold uppercase tracking-wide">{fileType}</span>}
61
+ </span>
62
+ <div className="min-w-0 flex-1">
63
+ <p className="truncate text-sm font-medium">{name}</p>
64
+ {meta && <p className="mt-0.5 truncate text-xs text-muted-foreground">{meta}</p>}
65
+ </div>
66
+ <Badge variant={statusInfo.variant}>{statusInfo.label}</Badge>
67
+ {onDownload && (
68
+ <Button
69
+ type="button"
70
+ variant="outline"
71
+ size="sm"
72
+ onClick={onDownload}
73
+ disabled={status !== 'available'}
74
+ aria-label={`${downloadLabel} ${name}`}
75
+ >
76
+ {downloadLabel}
77
+ </Button>
78
+ )}
79
+ </CardContent>
80
+ </Card>
81
+ );
82
+ });
@@ -0,0 +1,2 @@
1
+ export { DocumentCard } from './DocumentCard';
2
+ export type { DocumentCardProps, DocumentStatus } from './DocumentCard';
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import { render, screen, waitFor } from '@testing-library/react';
2
+ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import { axe } from 'jest-axe';
5
5
  import { describe, expect, it, vi } from 'vitest';
@@ -181,3 +181,88 @@ describe('localized labels', () => {
181
181
  expect(screen.getByRole('button', { name: 'Fermer' })).toBeInTheDocument();
182
182
  });
183
183
  });
184
+
185
+ describe('onClose alias', () => {
186
+ it('closes through onClose when onOpenChange is absent', async () => {
187
+ const user = userEvent.setup();
188
+ const onClose = vi.fn();
189
+ render(<Drawer open title="Filters" onClose={onClose}>Body</Drawer>);
190
+ await user.keyboard('{Escape}');
191
+ expect(onClose).toHaveBeenCalledTimes(1);
192
+ await user.click(screen.getByRole('button', { name: 'Close drawer' }));
193
+ expect(onClose).toHaveBeenCalledTimes(2);
194
+ });
195
+
196
+ it('prefers onOpenChange when both handlers are passed', async () => {
197
+ const user = userEvent.setup();
198
+ const onOpenChange = vi.fn();
199
+ const onClose = vi.fn();
200
+ render(<Drawer open title="Filters" onOpenChange={onOpenChange} onClose={onClose}>Body</Drawer>);
201
+ await user.click(screen.getByRole('button', { name: 'Close drawer' }));
202
+ expect(onOpenChange).toHaveBeenCalledWith(false);
203
+ expect(onClose).not.toHaveBeenCalled();
204
+ });
205
+ });
206
+
207
+ describe('resizable', () => {
208
+ it('renders a separator with the width bounds and seeds the size preset', () => {
209
+ render(<Drawer open onOpenChange={vi.fn()} title="Details" resizable>Body</Drawer>);
210
+ const handle = screen.getByRole('separator', { name: 'Resize drawer' });
211
+ expect(handle).toHaveAttribute('aria-valuenow', '384');
212
+ expect(handle).toHaveAttribute('aria-valuemin', '240');
213
+ expect(handle).toHaveAttribute('aria-valuemax', '960');
214
+ expect(screen.getByRole('dialog')).toHaveStyle({ width: '384px' });
215
+ });
216
+
217
+ it('honours defaultWidth and clamps it to the bounds', () => {
218
+ render(
219
+ <Drawer open onOpenChange={vi.fn()} title="Details" resizable defaultWidth={100}>
220
+ Body
221
+ </Drawer>
222
+ );
223
+ expect(screen.getByRole('separator')).toHaveAttribute('aria-valuenow', '240');
224
+ });
225
+
226
+ it('grows and shrinks from the keyboard, with Home/End jumps', () => {
227
+ const onWidthChange = vi.fn();
228
+ render(
229
+ <Drawer open onOpenChange={vi.fn()} title="Details" resizable onWidthChange={onWidthChange}>
230
+ Body
231
+ </Drawer>
232
+ );
233
+ const handle = screen.getByRole('separator');
234
+ fireEvent.keyDown(handle, { key: 'ArrowLeft' });
235
+ expect(handle).toHaveAttribute('aria-valuenow', '400');
236
+ fireEvent.keyDown(handle, { key: 'ArrowLeft', shiftKey: true });
237
+ expect(handle).toHaveAttribute('aria-valuenow', '464');
238
+ fireEvent.keyDown(handle, { key: 'End' });
239
+ expect(handle).toHaveAttribute('aria-valuenow', '960');
240
+ fireEvent.keyDown(handle, { key: 'Home' });
241
+ expect(handle).toHaveAttribute('aria-valuenow', '240');
242
+ expect(onWidthChange).toHaveBeenLastCalledWith(240);
243
+ });
244
+
245
+ it('resizes while dragging the handle', () => {
246
+ const onWidthChange = vi.fn();
247
+ render(
248
+ <Drawer open onOpenChange={vi.fn()} title="Details" resizable onWidthChange={onWidthChange}>
249
+ Body
250
+ </Drawer>
251
+ );
252
+ const handle = screen.getByRole('separator');
253
+ fireEvent.pointerDown(handle, { button: 0, clientX: 500 });
254
+ fireEvent.pointerMove(window, { clientX: 400 });
255
+ expect(handle).toHaveAttribute('aria-valuenow', '484');
256
+ fireEvent.pointerUp(window);
257
+ expect(onWidthChange).toHaveBeenCalledWith(484);
258
+ });
259
+
260
+ it('does not render a handle for top/bottom drawers or when resizable is false', () => {
261
+ const { rerender } = render(
262
+ <Drawer open onOpenChange={vi.fn()} title="Sheet" side="bottom" resizable>Body</Drawer>
263
+ );
264
+ expect(screen.queryByRole('separator')).not.toBeInTheDocument();
265
+ rerender(<Drawer open onOpenChange={vi.fn()} title="Sheet">Body</Drawer>);
266
+ expect(screen.queryByRole('separator')).not.toBeInTheDocument();
267
+ });
268
+ });
@@ -11,7 +11,14 @@ export type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
11
11
 
12
12
  export type DrawerProps = {
13
13
  open: boolean;
14
- onOpenChange: (open: boolean) => void;
14
+ /** Called with the next open state. Alias: onClose (close requests only). */
15
+ onOpenChange?: (open: boolean) => void;
16
+ /**
17
+ * Called when the drawer asks to close: Escape, backdrop click or the close
18
+ * button. Alias for `onOpenChange(false)`, used when only a close handler is
19
+ * passed.
20
+ */
21
+ onClose?: () => void;
15
22
  title: string;
16
23
  description?: string;
17
24
  children?: React.ReactNode;
@@ -29,6 +36,22 @@ export type DrawerProps = {
29
36
  * ("60vh"). Overrides `size`.
30
37
  */
31
38
  height?: number | string;
39
+ /**
40
+ * Drag the inner edge to resize a left/right drawer. Keyboard: Arrow keys
41
+ * nudge 16px, Shift+Arrow 64px, Home/End jump to the bounds. Ignored for
42
+ * top/bottom drawers.
43
+ */
44
+ resizable?: boolean;
45
+ /** Lower bound in pixels while resizable (default 240). */
46
+ minWidth?: number;
47
+ /** Upper bound in pixels while resizable (default 960). */
48
+ maxWidth?: number;
49
+ /** Initial width in pixels while resizable; defaults to the `size` preset. */
50
+ defaultWidth?: number;
51
+ /** Fired with the next width in pixels when a resize commits. */
52
+ onWidthChange?: (width: number) => void;
53
+ /** Accessible label for the resize handle (default "Resize drawer"). */
54
+ resizeLabel?: string;
32
55
  /** Clicking the backdrop closes (default true). */
33
56
  closeOnBackdrop?: boolean;
34
57
  /** Hide the close (✕) button in the header (default true). */
@@ -80,6 +103,15 @@ const sizeClasses: Record<DrawerSide, Record<DrawerSize, string>> = {
80
103
  bottom: sideHeights,
81
104
  };
82
105
 
106
+ /** Pixel equivalents of the width presets, used as the resize starting point. */
107
+ const sizePx: Record<DrawerSize, number> = {
108
+ sm: 288,
109
+ md: 384,
110
+ lg: 512,
111
+ xl: 640,
112
+ '2xl': 768,
113
+ };
114
+
83
115
  /** Custom extent wins over the preset; numbers are pixels. */
84
116
  function extentStyle(value: number | string | undefined): string | undefined {
85
117
  if (value === undefined) return undefined;
@@ -110,6 +142,7 @@ const slideOut: Record<DrawerSide, string> = {
110
142
  export function Drawer({
111
143
  open,
112
144
  onOpenChange,
145
+ onClose,
113
146
  title,
114
147
  description,
115
148
  children,
@@ -117,6 +150,12 @@ export function Drawer({
117
150
  size = 'md',
118
151
  width,
119
152
  height,
153
+ resizable = false,
154
+ minWidth = 240,
155
+ maxWidth = 960,
156
+ defaultWidth,
157
+ onWidthChange,
158
+ resizeLabel = 'Resize drawer',
120
159
  closeOnBackdrop = true,
121
160
  showClose = true,
122
161
  closeLabel = 'Close drawer',
@@ -131,6 +170,74 @@ export function Drawer({
131
170
  const { present, exiting } = usePresence(open, animate);
132
171
  const isTopLayer = useModalLayer(open);
133
172
 
173
+ // Prefer onOpenChange; fall back to the onClose alias so a migration code
174
+ // path that only passes onClose still dismisses without double-firing.
175
+ const requestClose = React.useCallback(() => {
176
+ if (onOpenChange) onOpenChange(false);
177
+ else onClose?.();
178
+ }, [onOpenChange, onClose]);
179
+
180
+ // Resizable left/right drawers. Width is state-local so dragging stays
181
+ // smooth; `onWidthChange` fires once a drag commits or a key is pressed.
182
+ const isVerticalSide = side === 'top' || side === 'bottom';
183
+ const canResize = resizable && !isVerticalSide;
184
+ const clampWidth = React.useCallback(
185
+ (next: number) => Math.min(maxWidth, Math.max(minWidth, Math.round(next))),
186
+ [minWidth, maxWidth]
187
+ );
188
+ const [resizedWidth, setResizedWidth] = React.useState<number | null>(null);
189
+ const initialWidth = clampWidth(
190
+ defaultWidth ?? (typeof width === 'number' ? width : sizePx[size])
191
+ );
192
+ const resizeWidth = resizedWidth ?? initialWidth;
193
+ const widthRef = React.useRef(resizeWidth);
194
+ widthRef.current = resizeWidth;
195
+ const onWidthChangeRef = React.useRef(onWidthChange);
196
+ onWidthChangeRef.current = onWidthChange;
197
+
198
+ const commitWidth = (next: number) => {
199
+ const clamped = clampWidth(next);
200
+ setResizedWidth(clamped);
201
+ onWidthChangeRef.current?.(clamped);
202
+ };
203
+
204
+ const onResizePointerDown = (event: React.PointerEvent<HTMLDivElement>) => {
205
+ if (event.button !== 0) return;
206
+ event.preventDefault();
207
+ const startX = event.clientX;
208
+ const startWidth = resizeWidth;
209
+ const onMove = (moveEvent: PointerEvent) => {
210
+ const delta = side === 'right' ? startX - moveEvent.clientX : moveEvent.clientX - startX;
211
+ setResizedWidth(clampWidth(startWidth + delta));
212
+ };
213
+ const onUp = () => {
214
+ window.removeEventListener('pointermove', onMove);
215
+ window.removeEventListener('pointerup', onUp);
216
+ onWidthChangeRef.current?.(widthRef.current);
217
+ };
218
+ window.addEventListener('pointermove', onMove);
219
+ window.addEventListener('pointerup', onUp);
220
+ };
221
+
222
+ const onResizeKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
223
+ const step = event.shiftKey ? 64 : 16;
224
+ const grow = side === 'right' ? 'ArrowLeft' : 'ArrowRight';
225
+ const shrink = side === 'right' ? 'ArrowRight' : 'ArrowLeft';
226
+ if (event.key === grow) {
227
+ event.preventDefault();
228
+ commitWidth(resizeWidth + step);
229
+ } else if (event.key === shrink) {
230
+ event.preventDefault();
231
+ commitWidth(resizeWidth - step);
232
+ } else if (event.key === 'Home') {
233
+ event.preventDefault();
234
+ commitWidth(minWidth);
235
+ } else if (event.key === 'End') {
236
+ event.preventDefault();
237
+ commitWidth(maxWidth);
238
+ }
239
+ };
240
+
134
241
  // Capture the opener before the panel takes focus; restore the moment
135
242
  // open flips false — even while an exit animation keeps the DOM up.
136
243
  React.useEffect(() => {
@@ -158,7 +265,7 @@ export function Drawer({
158
265
  if (event.key === 'Escape') {
159
266
  if (!isTopLayer()) return;
160
267
  event.stopPropagation();
161
- onOpenChange(false);
268
+ requestClose();
162
269
  return;
163
270
  }
164
271
  if (event.key !== 'Tab') return;
@@ -182,12 +289,15 @@ export function Drawer({
182
289
  };
183
290
  document.addEventListener('keydown', onKeyDown);
184
291
  return () => document.removeEventListener('keydown', onKeyDown);
185
- }, [open, onOpenChange, isTopLayer]);
292
+ }, [open, requestClose, isTopLayer]);
186
293
 
187
294
  if (!present || typeof document === 'undefined') return null;
188
295
 
189
- const isVerticalSide = side === 'top' || side === 'bottom';
190
- const customExtent = isVerticalSide ? extentStyle(height) : extentStyle(width);
296
+ const customExtent = canResize
297
+ ? `${resizeWidth}px`
298
+ : isVerticalSide
299
+ ? extentStyle(height)
300
+ : extentStyle(width);
191
301
 
192
302
  const motion = animate
193
303
  ? cn(
@@ -200,7 +310,7 @@ export function Drawer({
200
310
  <div
201
311
  className="fixed inset-0 z-50"
202
312
  onMouseDown={(event) => {
203
- if (closeOnBackdrop && event.target === event.currentTarget) onOpenChange(false);
313
+ if (closeOnBackdrop && event.target === event.currentTarget) requestClose();
204
314
  }}
205
315
  >
206
316
  <div
@@ -219,6 +329,24 @@ export function Drawer({
219
329
  )}
220
330
  style={customExtent ? { [isVerticalSide ? 'height' : 'width']: customExtent } : undefined}
221
331
  >
332
+ {canResize && (
333
+ <div
334
+ role="separator"
335
+ aria-orientation="vertical"
336
+ aria-label={resizeLabel}
337
+ aria-valuenow={resizeWidth}
338
+ aria-valuemin={minWidth}
339
+ aria-valuemax={maxWidth}
340
+ tabIndex={0}
341
+ onPointerDown={onResizePointerDown}
342
+ onKeyDown={onResizeKeyDown}
343
+ className={cn(
344
+ 'absolute inset-y-0 z-10 w-2 cursor-col-resize touch-none rounded-sm bg-transparent',
345
+ 'hover:bg-primary/20 focus-visible:bg-primary/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
346
+ side === 'right' ? '-left-1' : '-right-1'
347
+ )}
348
+ />
349
+ )}
222
350
  <div className="flex items-start justify-between gap-4 border-b border-border px-5 py-4">
223
351
  <div>
224
352
  <h2 id={titleId} className="text-base font-semibold leading-tight">
@@ -233,7 +361,7 @@ export function Drawer({
233
361
  {showClose && (
234
362
  <button
235
363
  type="button"
236
- onClick={() => onOpenChange(false)}
364
+ onClick={requestClose}
237
365
  aria-label={closeLabel}
238
366
  className="-me-1 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
239
367
  >
@@ -1,6 +1,7 @@
1
1
  import { render, screen } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
2
3
  import { axe } from 'jest-axe';
3
- import { describe, expect, it } from 'vitest';
4
+ import { describe, expect, it, vi } from 'vitest';
4
5
  import { EmptyState } from './EmptyState';
5
6
 
6
7
  describe('EmptyState', () => {
@@ -40,3 +41,27 @@ describe('EmptyState', () => {
40
41
  expect(await axe(container)).toHaveNoViolations();
41
42
  });
42
43
  });
44
+
45
+ describe('action object form', () => {
46
+ it('renders a button from { label, onClick }', async () => {
47
+ const user = userEvent.setup();
48
+ const onClick = vi.fn();
49
+ render(<EmptyState title="No results" action={{ label: 'Clear filters', onClick, variant: 'outline' }} />);
50
+ const button = screen.getByRole('button', { name: 'Clear filters' });
51
+ expect(button).toHaveClass('border');
52
+ await user.click(button);
53
+ expect(onClick).toHaveBeenCalledTimes(1);
54
+ });
55
+
56
+ it('renders a link when href is provided', () => {
57
+ render(<EmptyState title="No results" action={{ label: 'Create one', href: '/new' }} />);
58
+ const link = screen.getByRole('link', { name: 'Create one' });
59
+ expect(link).toHaveAttribute('href', '/new');
60
+ expect(screen.queryByRole('button', { name: 'Create one' })).not.toBeInTheDocument();
61
+ });
62
+
63
+ it('still accepts a rendered node', () => {
64
+ render(<EmptyState title="No results" action={<button type="button">Custom</button>} />);
65
+ expect(screen.getByRole('button', { name: 'Custom' })).toBeInTheDocument();
66
+ });
67
+ });
@@ -1,13 +1,23 @@
1
1
  import * as React from 'react';
2
2
  import { cn } from '../../utils/cn';
3
+ import { Button, type ButtonProps } from '../button/Button';
4
+
5
+ /** Object form of `action`: EmptyState renders the button/link for you. */
6
+ export type EmptyStateAction = {
7
+ label: React.ReactNode;
8
+ onClick?: () => void;
9
+ /** Renders an anchor (styled as a button) instead of a button. */
10
+ href?: string;
11
+ variant?: ButtonProps['variant'];
12
+ };
3
13
 
4
14
  export type EmptyStateProps = React.HTMLAttributes<HTMLDivElement> & {
5
15
  /** Icon or illustration shown above the title. */
6
16
  icon?: React.ReactNode;
7
17
  title: string;
8
18
  description?: string;
9
- /** Primary action (button/link). */
10
- action?: React.ReactNode;
19
+ /** Primary action: a rendered node, or an action object. */
20
+ action?: React.ReactNode | EmptyStateAction;
11
21
  /** Alias for `action` for codebases that pass a list of actions. */
12
22
  actions?: React.ReactNode;
13
23
  /** Secondary action shown beside the primary one. */
@@ -18,6 +28,33 @@ export type EmptyStateProps = React.HTMLAttributes<HTMLDivElement> & {
18
28
  size?: 'sm' | 'md';
19
29
  };
20
30
 
31
+ function isActionObject(value: unknown): value is EmptyStateAction {
32
+ return (
33
+ typeof value === 'object' &&
34
+ value !== null &&
35
+ !React.isValidElement(value) &&
36
+ 'label' in value
37
+ );
38
+ }
39
+
40
+ /** Normalizes the node and object forms into a single element. */
41
+ function renderAction(action: React.ReactNode | EmptyStateAction | undefined): React.ReactNode {
42
+ if (!isActionObject(action)) return action;
43
+ const { label, onClick, href, variant } = action;
44
+ if (href) {
45
+ return (
46
+ <Button variant={variant} asChild>
47
+ <a href={href}>{label}</a>
48
+ </Button>
49
+ );
50
+ }
51
+ return (
52
+ <Button variant={variant} onClick={onClick}>
53
+ {label}
54
+ </Button>
55
+ );
56
+ }
57
+
21
58
  /**
22
59
  * Placeholder for empty collections, zero-result searches and unconfigured
23
60
  * features. Keeps the title/description/action hierarchy consistent across
@@ -39,7 +76,7 @@ export const EmptyState = React.forwardRef<HTMLDivElement, EmptyStateProps>(func
39
76
  },
40
77
  ref
41
78
  ) {
42
- const primaryAction = action ?? actions;
79
+ const primaryAction = renderAction(action) ?? actions;
43
80
  return (
44
81
  <div
45
82
  ref={ref}
@@ -0,0 +1,38 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EntityCard, ProfileCard } from './EntityCard';
5
+
6
+ describe('EntityCard', () => {
7
+ it('renders name, type, stats and tags', () => {
8
+ render(
9
+ <EntityCard
10
+ name="Peakstone Group"
11
+ entityType="Investment bank"
12
+ location="New York, NY"
13
+ description="M&A advisory for middle market clients."
14
+ stats={[
15
+ { label: 'Closed deals', value: '60' },
16
+ { label: 'Via Axial', value: '3' },
17
+ ]}
18
+ tags={['Industrials', 'Healthcare']}
19
+ href="/members/peakstone"
20
+ />
21
+ );
22
+ expect(screen.getByRole('heading', { level: 3, name: 'Peakstone Group' })).toBeInTheDocument();
23
+ expect(screen.getByText('Investment bank')).toBeInTheDocument();
24
+ expect(screen.getByText('60')).toBeInTheDocument();
25
+ expect(screen.getByText('Industrials')).toBeInTheDocument();
26
+ expect(screen.getByRole('link', { name: 'Peakstone Group' })).toHaveAttribute('href', '/members/peakstone');
27
+ });
28
+
29
+ it('falls back to initials and exposes the ProfileCard alias', () => {
30
+ render(<ProfileCard name="North Park" entityType="Private equity" />);
31
+ expect(screen.getByText('NP')).toBeInTheDocument();
32
+ });
33
+
34
+ it('has no accessibility violations', async () => {
35
+ const { container } = render(<EntityCard name="Firm" entityType="Advisor" />);
36
+ expect(await axe(container)).toHaveNoViolations();
37
+ });
38
+ });
@@ -0,0 +1,133 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../utils/cn';
3
+ import { Avatar, AvatarFallback } from '../avatar/Avatar';
4
+ import { Badge } from '../badge/Badge';
5
+ import { Card, CardContent, CardFooter, CardHeader } from '../card/Card';
6
+
7
+ export type EntityStat = {
8
+ label: string;
9
+ value: string;
10
+ };
11
+
12
+ export type EntityCardProps = React.HTMLAttributes<HTMLElement> & {
13
+ /** Firm or member name. */
14
+ name: string;
15
+ /** Firm type, role or member category. */
16
+ entityType: string;
17
+ /** Region or office location. */
18
+ location?: string;
19
+ /** Short firm description. */
20
+ description?: string;
21
+ /** Logo slot. Falls back to initials when omitted. */
22
+ logo?: React.ReactNode;
23
+ /** Small stats such as closed deals or active mandates. */
24
+ stats?: EntityStat[];
25
+ /** Sector or service tags. */
26
+ tags?: string[];
27
+ /** Profile destination. */
28
+ href?: string;
29
+ /** Custom link element for routers. */
30
+ linkComponent?: React.ElementType;
31
+ /** Extra footer actions. */
32
+ actions?: React.ReactNode;
33
+ };
34
+
35
+ function initials(name: string): string {
36
+ return name
37
+ .split(/\s+/)
38
+ .filter(Boolean)
39
+ .slice(0, 2)
40
+ .map((part) => part[0]?.toUpperCase() ?? '')
41
+ .join('');
42
+ }
43
+
44
+ /**
45
+ * Firm or member profile card for a directory. Use the logo slot for a brand
46
+ * mark; when absent, initials keep the card identifiable. Stats and tags are
47
+ * optional, so the same card works in compact and detailed directory views.
48
+ */
49
+ export const EntityCard = React.forwardRef<HTMLElement, EntityCardProps>(function EntityCard(
50
+ {
51
+ name,
52
+ entityType,
53
+ location,
54
+ description,
55
+ logo,
56
+ stats,
57
+ tags,
58
+ href,
59
+ linkComponent,
60
+ actions,
61
+ className,
62
+ ...props
63
+ },
64
+ ref
65
+ ) {
66
+ const Link = linkComponent ?? 'a';
67
+
68
+ return (
69
+ <Card ref={ref as never} className={cn('flex h-full flex-col', className)} {...props}>
70
+ <CardHeader className="flex-row items-start gap-3 p-5 pb-3">
71
+ <div className="shrink-0">
72
+ {logo ?? (
73
+ <Avatar>
74
+ <AvatarFallback>{initials(name)}</AvatarFallback>
75
+ </Avatar>
76
+ )}
77
+ </div>
78
+ <div className="min-w-0 flex-1">
79
+ <h3 className="truncate text-base font-semibold tracking-tight">
80
+ {href ? (
81
+ <Link href={href} className="rounded-sm hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
82
+ {name}
83
+ </Link>
84
+ ) : (
85
+ name
86
+ )}
87
+ </h3>
88
+ <p className="mt-0.5 truncate text-xs text-muted-foreground">{entityType}</p>
89
+ {location && <p className="mt-0.5 truncate text-xs text-muted-foreground">{location}</p>}
90
+ </div>
91
+ </CardHeader>
92
+ <CardContent className="flex-1 px-5 pb-3">
93
+ {description && <p className="line-clamp-3 text-sm leading-relaxed text-muted-foreground">{description}</p>}
94
+ {tags && tags.length > 0 && (
95
+ <div className="mt-3 flex flex-wrap gap-1.5">
96
+ {tags.map((tag) => (
97
+ <Badge key={tag} variant="secondary">
98
+ {tag}
99
+ </Badge>
100
+ ))}
101
+ </div>
102
+ )}
103
+ {stats && stats.length > 0 && (
104
+ <dl className="mt-4 grid grid-cols-2 gap-3">
105
+ {stats.map((stat) => (
106
+ <div key={stat.label} className="min-w-0">
107
+ <dt className="text-xs text-muted-foreground">{stat.label}</dt>
108
+ <dd className="mt-0.5 truncate text-sm font-semibold tabular-nums">{stat.value}</dd>
109
+ </div>
110
+ ))}
111
+ </dl>
112
+ )}
113
+ </CardContent>
114
+ {(href || actions) && (
115
+ <CardFooter className="flex flex-wrap items-center gap-2 border-t border-border px-5 py-3">
116
+ {href && (
117
+ <Link
118
+ href={href}
119
+ className="text-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
120
+ >
121
+ View profile
122
+ </Link>
123
+ )}
124
+ {actions && <div className="ml-auto flex items-center gap-2">{actions}</div>}
125
+ </CardFooter>
126
+ )}
127
+ </Card>
128
+ );
129
+ });
130
+
131
+ /** Alias for profile-oriented directory surfaces. */
132
+ export const ProfileCard = EntityCard;
133
+ export type ProfileCardProps = EntityCardProps;
@@ -0,0 +1,2 @@
1
+ export { EntityCard, ProfileCard } from './EntityCard';
2
+ export type { EntityCardProps, EntityStat, ProfileCardProps } from './EntityCard';