@slipstream-ui/core 0.7.0 → 0.9.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 (383) hide show
  1. package/dist/index.d.mts +317 -21
  2. package/dist/index.d.ts +317 -21
  3. package/dist/index.js +2004 -1069
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1998 -1068
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/accordion.manifest.json +8 -2
  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/calendar.manifest.json +175 -0
  23. package/dist/manifests/card.manifest.json +1 -1
  24. package/dist/manifests/checkbox.manifest.json +1 -1
  25. package/dist/manifests/comparison-table.manifest.json +1 -1
  26. package/dist/manifests/confirm-dialog.manifest.json +1 -1
  27. package/dist/manifests/contact-strip.manifest.json +1 -1
  28. package/dist/manifests/container.manifest.json +1 -1
  29. package/dist/manifests/cta-section.manifest.json +1 -1
  30. package/dist/manifests/data-table.manifest.json +8 -1
  31. package/dist/manifests/date-picker-popover.manifest.json +202 -0
  32. package/dist/manifests/date-picker.manifest.json +1 -1
  33. package/dist/manifests/date-range-picker.manifest.json +1 -1
  34. package/dist/manifests/deal-card.manifest.json +1 -1
  35. package/dist/manifests/dialog.manifest.json +1 -1
  36. package/dist/manifests/document-card.manifest.json +1 -1
  37. package/dist/manifests/drawer.manifest.json +48 -2
  38. package/dist/manifests/empty-state.manifest.json +1 -1
  39. package/dist/manifests/entity-card.manifest.json +1 -1
  40. package/dist/manifests/feature-grid.manifest.json +1 -1
  41. package/dist/manifests/feature-row.manifest.json +1 -1
  42. package/dist/manifests/fieldset.manifest.json +1 -1
  43. package/dist/manifests/file-upload.manifest.json +1 -1
  44. package/dist/manifests/filter-bar.manifest.json +1 -1
  45. package/dist/manifests/filter-chips.manifest.json +1 -1
  46. package/dist/manifests/filter-panel.manifest.json +1 -1
  47. package/dist/manifests/flex.manifest.json +1 -1
  48. package/dist/manifests/form-field.manifest.json +1 -1
  49. package/dist/manifests/form-layout.manifest.json +1 -1
  50. package/dist/manifests/form.manifest.json +1 -1
  51. package/dist/manifests/grid.manifest.json +1 -1
  52. package/dist/manifests/heading.manifest.json +1 -1
  53. package/dist/manifests/hero.manifest.json +1 -1
  54. package/dist/manifests/image.manifest.json +142 -0
  55. package/dist/manifests/input-group.manifest.json +1 -1
  56. package/dist/manifests/input.manifest.json +1 -1
  57. package/dist/manifests/label.manifest.json +1 -1
  58. package/dist/manifests/link-tabs.manifest.json +1 -1
  59. package/dist/manifests/link.manifest.json +1 -1
  60. package/dist/manifests/list.manifest.json +1 -1
  61. package/dist/manifests/load-more.manifest.json +1 -1
  62. package/dist/manifests/logo-cloud.manifest.json +1 -1
  63. package/dist/manifests/menu.manifest.json +1 -1
  64. package/dist/manifests/metric-card.manifest.json +36 -4
  65. package/dist/manifests/multi-select.manifest.json +1 -1
  66. package/dist/manifests/newsletter.manifest.json +1 -1
  67. package/dist/manifests/page-header.manifest.json +7 -1
  68. package/dist/manifests/pagination.manifest.json +1 -1
  69. package/dist/manifests/password-input.manifest.json +1 -1
  70. package/dist/manifests/popover.manifest.json +86 -4
  71. package/dist/manifests/process-steps.manifest.json +1 -1
  72. package/dist/manifests/progress.manifest.json +1 -1
  73. package/dist/manifests/prose.manifest.json +1 -1
  74. package/dist/manifests/radio.manifest.json +1 -1
  75. package/dist/manifests/range-slider.manifest.json +1 -1
  76. package/dist/manifests/search.manifest.json +1 -1
  77. package/dist/manifests/section-heading.manifest.json +1 -1
  78. package/dist/manifests/section.manifest.json +1 -1
  79. package/dist/manifests/segmented-control.manifest.json +1 -1
  80. package/dist/manifests/select-menu.manifest.json +1 -1
  81. package/dist/manifests/select.manifest.json +1 -1
  82. package/dist/manifests/separator.manifest.json +1 -1
  83. package/dist/manifests/site-footer.manifest.json +1 -1
  84. package/dist/manifests/site-header.manifest.json +13 -3
  85. package/dist/manifests/skeleton.manifest.json +1 -1
  86. package/dist/manifests/spinner.manifest.json +1 -1
  87. package/dist/manifests/stat-band.manifest.json +1 -1
  88. package/dist/manifests/stepper.manifest.json +7 -1
  89. package/dist/manifests/switch.manifest.json +1 -1
  90. package/dist/manifests/table-card.manifest.json +1 -1
  91. package/dist/manifests/table-of-contents.manifest.json +1 -1
  92. package/dist/manifests/table.manifest.json +1 -1
  93. package/dist/manifests/tabs.manifest.json +1 -1
  94. package/dist/manifests/testimonial.manifest.json +1 -1
  95. package/dist/manifests/text.manifest.json +1 -1
  96. package/dist/manifests/textarea.manifest.json +1 -1
  97. package/dist/manifests/theme-toggle.manifest.json +1 -1
  98. package/dist/manifests/time-picker.manifest.json +1 -1
  99. package/dist/manifests/timeline.manifest.json +1 -1
  100. package/dist/manifests/toast.manifest.json +1 -1
  101. package/dist/manifests/tombstone-card.manifest.json +1 -1
  102. package/dist/manifests/tooltip.manifest.json +1 -1
  103. package/dist/src/components/accordion/Accordion.d.ts +17 -1
  104. package/dist/src/components/accordion/Accordion.js +5 -1
  105. package/dist/src/components/accordion/Accordion.js.map +1 -1
  106. package/dist/src/components/accordion/Accordion.mjs +5 -1
  107. package/dist/src/components/accordion/Accordion.mjs.map +1 -1
  108. package/dist/src/components/alert/Alert.js +1 -1
  109. package/dist/src/components/alert/Alert.js.map +1 -1
  110. package/dist/src/components/alert/Alert.mjs +1 -1
  111. package/dist/src/components/alert/Alert.mjs.map +1 -1
  112. package/dist/src/components/app-shell/AppShell.js +1 -1
  113. package/dist/src/components/app-shell/AppShell.js.map +1 -1
  114. package/dist/src/components/app-shell/AppShell.mjs +1 -1
  115. package/dist/src/components/app-shell/AppShell.mjs.map +1 -1
  116. package/dist/src/components/article-card/ArticleCard.js +2 -2
  117. package/dist/src/components/article-card/ArticleCard.js.map +1 -1
  118. package/dist/src/components/article-card/ArticleCard.mjs +2 -2
  119. package/dist/src/components/article-card/ArticleCard.mjs.map +1 -1
  120. package/dist/src/components/auth-layout/AuthLayout.d.ts +14 -2
  121. package/dist/src/components/auth-layout/AuthLayout.js +10 -2
  122. package/dist/src/components/auth-layout/AuthLayout.js.map +1 -1
  123. package/dist/src/components/auth-layout/AuthLayout.mjs +10 -2
  124. package/dist/src/components/auth-layout/AuthLayout.mjs.map +1 -1
  125. package/dist/src/components/badge/Badge.d.ts +2 -0
  126. package/dist/src/components/badge/Badge.js +9 -3
  127. package/dist/src/components/badge/Badge.js.map +1 -1
  128. package/dist/src/components/badge/Badge.mjs +9 -3
  129. package/dist/src/components/badge/Badge.mjs.map +1 -1
  130. package/dist/src/components/bottom-nav/BottomNav.d.ts +36 -0
  131. package/dist/src/components/bottom-nav/BottomNav.js +90 -0
  132. package/dist/src/components/bottom-nav/BottomNav.js.map +1 -0
  133. package/dist/src/components/bottom-nav/BottomNav.mjs +66 -0
  134. package/dist/src/components/bottom-nav/BottomNav.mjs.map +1 -0
  135. package/dist/src/components/bottom-nav/index.d.ts +1 -0
  136. package/dist/src/components/bottom-nav/index.js +23 -0
  137. package/dist/src/components/bottom-nav/index.js.map +1 -0
  138. package/dist/src/components/bottom-nav/index.mjs +2 -0
  139. package/dist/src/components/bottom-nav/index.mjs.map +1 -0
  140. package/dist/src/components/calendar/Calendar.d.ts +34 -0
  141. package/dist/src/components/calendar/Calendar.js +233 -0
  142. package/dist/src/components/calendar/Calendar.js.map +1 -0
  143. package/dist/src/components/calendar/Calendar.mjs +208 -0
  144. package/dist/src/components/calendar/Calendar.mjs.map +1 -0
  145. package/dist/src/components/calendar/index.d.ts +1 -0
  146. package/dist/src/components/calendar/index.js +23 -0
  147. package/dist/src/components/calendar/index.js.map +1 -0
  148. package/dist/src/components/calendar/index.mjs +2 -0
  149. package/dist/src/components/calendar/index.mjs.map +1 -0
  150. package/dist/src/components/comparison-table/ComparisonTable.js +1 -1
  151. package/dist/src/components/comparison-table/ComparisonTable.js.map +1 -1
  152. package/dist/src/components/comparison-table/ComparisonTable.mjs +1 -1
  153. package/dist/src/components/comparison-table/ComparisonTable.mjs.map +1 -1
  154. package/dist/src/components/cta-section/CTASection.js +1 -1
  155. package/dist/src/components/cta-section/CTASection.js.map +1 -1
  156. package/dist/src/components/cta-section/CTASection.mjs +1 -1
  157. package/dist/src/components/cta-section/CTASection.mjs.map +1 -1
  158. package/dist/src/components/data-table/DataTable.d.ts +3 -1
  159. package/dist/src/components/data-table/DataTable.js +2 -4
  160. package/dist/src/components/data-table/DataTable.js.map +1 -1
  161. package/dist/src/components/data-table/DataTable.mjs +2 -4
  162. package/dist/src/components/data-table/DataTable.mjs.map +1 -1
  163. package/dist/src/components/date-picker-popover/DatePickerPopover.d.ts +33 -0
  164. package/dist/src/components/date-picker-popover/DatePickerPopover.js +117 -0
  165. package/dist/src/components/date-picker-popover/DatePickerPopover.js.map +1 -0
  166. package/dist/src/components/date-picker-popover/DatePickerPopover.mjs +83 -0
  167. package/dist/src/components/date-picker-popover/DatePickerPopover.mjs.map +1 -0
  168. package/dist/src/components/date-picker-popover/index.d.ts +1 -0
  169. package/dist/src/components/date-picker-popover/index.js +23 -0
  170. package/dist/src/components/date-picker-popover/index.js.map +1 -0
  171. package/dist/src/components/date-picker-popover/index.mjs +2 -0
  172. package/dist/src/components/date-picker-popover/index.mjs.map +1 -0
  173. package/dist/src/components/drawer/Drawer.d.ts +25 -2
  174. package/dist/src/components/drawer/Drawer.js +97 -6
  175. package/dist/src/components/drawer/Drawer.js.map +1 -1
  176. package/dist/src/components/drawer/Drawer.mjs +97 -6
  177. package/dist/src/components/drawer/Drawer.mjs.map +1 -1
  178. package/dist/src/components/empty-state/EmptyState.d.ts +13 -4
  179. package/dist/src/components/empty-state/EmptyState.js +13 -1
  180. package/dist/src/components/empty-state/EmptyState.js.map +1 -1
  181. package/dist/src/components/empty-state/EmptyState.mjs +13 -1
  182. package/dist/src/components/empty-state/EmptyState.mjs.map +1 -1
  183. package/dist/src/components/image/Image.d.ts +34 -0
  184. package/dist/src/components/image/Image.js +75 -0
  185. package/dist/src/components/image/Image.js.map +1 -0
  186. package/dist/src/components/image/Image.mjs +41 -0
  187. package/dist/src/components/image/Image.mjs.map +1 -0
  188. package/dist/src/components/image/index.d.ts +1 -0
  189. package/dist/src/components/image/index.js +29 -0
  190. package/dist/src/components/image/index.js.map +1 -0
  191. package/dist/src/components/image/index.mjs +5 -0
  192. package/dist/src/components/image/index.mjs.map +1 -0
  193. package/dist/src/components/link/Link.js +4 -4
  194. package/dist/src/components/link/Link.js.map +1 -1
  195. package/dist/src/components/link/Link.mjs +4 -4
  196. package/dist/src/components/link/Link.mjs.map +1 -1
  197. package/dist/src/components/metric-card/MetricCard.d.ts +23 -4
  198. package/dist/src/components/metric-card/MetricCard.js +32 -5
  199. package/dist/src/components/metric-card/MetricCard.js.map +1 -1
  200. package/dist/src/components/metric-card/MetricCard.mjs +32 -5
  201. package/dist/src/components/metric-card/MetricCard.mjs.map +1 -1
  202. package/dist/src/components/page-header/PageHeader.d.ts +4 -0
  203. package/dist/src/components/page-header/PageHeader.js +4 -3
  204. package/dist/src/components/page-header/PageHeader.js.map +1 -1
  205. package/dist/src/components/page-header/PageHeader.mjs +4 -3
  206. package/dist/src/components/page-header/PageHeader.mjs.map +1 -1
  207. package/dist/src/components/popover/Popover.d.ts +36 -3
  208. package/dist/src/components/popover/Popover.js +118 -22
  209. package/dist/src/components/popover/Popover.js.map +1 -1
  210. package/dist/src/components/popover/Popover.mjs +117 -22
  211. package/dist/src/components/popover/Popover.mjs.map +1 -1
  212. package/dist/src/components/section-heading/SectionHeading.js +1 -1
  213. package/dist/src/components/section-heading/SectionHeading.js.map +1 -1
  214. package/dist/src/components/section-heading/SectionHeading.mjs +1 -1
  215. package/dist/src/components/section-heading/SectionHeading.mjs.map +1 -1
  216. package/dist/src/components/separator/Separator.d.ts +3 -3
  217. package/dist/src/components/site-header/SiteHeader.d.ts +25 -3
  218. package/dist/src/components/site-header/SiteHeader.js +141 -6
  219. package/dist/src/components/site-header/SiteHeader.js.map +1 -1
  220. package/dist/src/components/site-header/SiteHeader.mjs +141 -6
  221. package/dist/src/components/site-header/SiteHeader.mjs.map +1 -1
  222. package/dist/src/components/stepper/Stepper.d.ts +18 -0
  223. package/dist/src/components/stepper/Stepper.js +2 -1
  224. package/dist/src/components/stepper/Stepper.js.map +1 -1
  225. package/dist/src/components/stepper/Stepper.mjs +2 -1
  226. package/dist/src/components/stepper/Stepper.mjs.map +1 -1
  227. package/dist/src/index.d.ts +4 -0
  228. package/dist/src/utils/date.d.ts +32 -0
  229. package/dist/src/utils/date.js +171 -0
  230. package/dist/src/utils/date.js.map +1 -0
  231. package/dist/src/utils/date.mjs +134 -0
  232. package/dist/src/utils/date.mjs.map +1 -0
  233. package/dist/src/utils/position.d.ts +42 -0
  234. package/dist/src/utils/position.js +91 -0
  235. package/dist/src/utils/position.js.map +1 -0
  236. package/dist/src/utils/position.mjs +67 -0
  237. package/dist/src/utils/position.mjs.map +1 -0
  238. package/dist/styles-full.css +1 -1
  239. package/dist/styles.css +1 -1
  240. package/package.json +3 -3
  241. package/src/components/accordion/Accordion.test.tsx +31 -0
  242. package/src/components/accordion/Accordion.tsx +27 -2
  243. package/src/components/alert/Alert.tsx +1 -1
  244. package/src/components/app-shell/AppShell.tsx +1 -1
  245. package/src/components/article-card/ArticleCard.tsx +2 -2
  246. package/src/components/auth-layout/AuthLayout.test.tsx +36 -0
  247. package/src/components/auth-layout/AuthLayout.tsx +20 -3
  248. package/src/components/badge/Badge.test.tsx +7 -0
  249. package/src/components/badge/Badge.tsx +8 -2
  250. package/src/components/bottom-nav/BottomNav.test.tsx +48 -0
  251. package/src/components/bottom-nav/BottomNav.tsx +117 -0
  252. package/src/components/bottom-nav/index.ts +1 -0
  253. package/src/components/calendar/Calendar.test.tsx +277 -0
  254. package/src/components/calendar/Calendar.tsx +273 -0
  255. package/src/components/calendar/index.ts +1 -0
  256. package/src/components/comparison-table/ComparisonTable.tsx +1 -1
  257. package/src/components/cta-section/CTASection.tsx +1 -1
  258. package/src/components/data-table/DataTable.test.tsx +21 -0
  259. package/src/components/data-table/DataTable.tsx +4 -1
  260. package/src/components/date-picker-popover/DatePickerPopover.test.tsx +223 -0
  261. package/src/components/date-picker-popover/DatePickerPopover.tsx +117 -0
  262. package/src/components/date-picker-popover/index.ts +1 -0
  263. package/src/components/drawer/Drawer.test.tsx +86 -1
  264. package/src/components/drawer/Drawer.tsx +135 -7
  265. package/src/components/empty-state/EmptyState.test.tsx +26 -1
  266. package/src/components/empty-state/EmptyState.tsx +40 -3
  267. package/src/components/image/Image.test.tsx +94 -0
  268. package/src/components/image/Image.tsx +71 -0
  269. package/src/components/image/index.ts +1 -0
  270. package/src/components/link/Link.test.tsx +2 -1
  271. package/src/components/link/Link.tsx +4 -4
  272. package/src/components/metric-card/MetricCard.test.tsx +32 -0
  273. package/src/components/metric-card/MetricCard.tsx +45 -7
  274. package/src/components/page-header/PageHeader.test.tsx +13 -0
  275. package/src/components/page-header/PageHeader.tsx +6 -3
  276. package/src/components/popover/Popover.test.tsx +307 -3
  277. package/src/components/popover/Popover.tsx +228 -91
  278. package/src/components/section-heading/SectionHeading.tsx +1 -1
  279. package/src/components/site-header/SiteHeader.test.tsx +103 -1
  280. package/src/components/site-header/SiteHeader.tsx +220 -16
  281. package/src/components/stepper/Stepper.test.tsx +12 -0
  282. package/src/components/stepper/Stepper.tsx +15 -1
  283. package/src/index.ts +4 -0
  284. package/src/manifests/accordion.manifest.json +8 -2
  285. package/src/manifests/alert.manifest.json +1 -1
  286. package/src/manifests/announcement-bar.manifest.json +1 -1
  287. package/src/manifests/app-shell.manifest.json +1 -1
  288. package/src/manifests/applied-filters.manifest.json +1 -1
  289. package/src/manifests/article-card.manifest.json +1 -1
  290. package/src/manifests/auth-layout.manifest.json +19 -1
  291. package/src/manifests/autocomplete.manifest.json +1 -1
  292. package/src/manifests/avatar.manifest.json +1 -1
  293. package/src/manifests/badge.manifest.json +13 -1
  294. package/src/manifests/block.manifest.json +1 -1
  295. package/src/manifests/bottom-nav.manifest.json +130 -0
  296. package/src/manifests/breadcrumb.manifest.json +1 -1
  297. package/src/manifests/button-group.manifest.json +1 -1
  298. package/src/manifests/button.manifest.json +1 -1
  299. package/src/manifests/calendar.manifest.json +175 -0
  300. package/src/manifests/card.manifest.json +1 -1
  301. package/src/manifests/checkbox.manifest.json +1 -1
  302. package/src/manifests/comparison-table.manifest.json +1 -1
  303. package/src/manifests/confirm-dialog.manifest.json +1 -1
  304. package/src/manifests/contact-strip.manifest.json +1 -1
  305. package/src/manifests/container.manifest.json +1 -1
  306. package/src/manifests/cta-section.manifest.json +1 -1
  307. package/src/manifests/data-table.manifest.json +8 -1
  308. package/src/manifests/date-picker-popover.manifest.json +202 -0
  309. package/src/manifests/date-picker.manifest.json +1 -1
  310. package/src/manifests/date-range-picker.manifest.json +1 -1
  311. package/src/manifests/deal-card.manifest.json +1 -1
  312. package/src/manifests/dialog.manifest.json +1 -1
  313. package/src/manifests/document-card.manifest.json +1 -1
  314. package/src/manifests/drawer.manifest.json +48 -2
  315. package/src/manifests/empty-state.manifest.json +1 -1
  316. package/src/manifests/entity-card.manifest.json +1 -1
  317. package/src/manifests/feature-grid.manifest.json +1 -1
  318. package/src/manifests/feature-row.manifest.json +1 -1
  319. package/src/manifests/fieldset.manifest.json +1 -1
  320. package/src/manifests/file-upload.manifest.json +1 -1
  321. package/src/manifests/filter-bar.manifest.json +1 -1
  322. package/src/manifests/filter-chips.manifest.json +1 -1
  323. package/src/manifests/filter-panel.manifest.json +1 -1
  324. package/src/manifests/flex.manifest.json +1 -1
  325. package/src/manifests/form-field.manifest.json +1 -1
  326. package/src/manifests/form-layout.manifest.json +1 -1
  327. package/src/manifests/form.manifest.json +1 -1
  328. package/src/manifests/grid.manifest.json +1 -1
  329. package/src/manifests/heading.manifest.json +1 -1
  330. package/src/manifests/hero.manifest.json +1 -1
  331. package/src/manifests/image.manifest.json +142 -0
  332. package/src/manifests/input-group.manifest.json +1 -1
  333. package/src/manifests/input.manifest.json +1 -1
  334. package/src/manifests/label.manifest.json +1 -1
  335. package/src/manifests/link-tabs.manifest.json +1 -1
  336. package/src/manifests/link.manifest.json +1 -1
  337. package/src/manifests/list.manifest.json +1 -1
  338. package/src/manifests/load-more.manifest.json +1 -1
  339. package/src/manifests/logo-cloud.manifest.json +1 -1
  340. package/src/manifests/menu.manifest.json +1 -1
  341. package/src/manifests/metric-card.manifest.json +36 -4
  342. package/src/manifests/multi-select.manifest.json +1 -1
  343. package/src/manifests/newsletter.manifest.json +1 -1
  344. package/src/manifests/page-header.manifest.json +7 -1
  345. package/src/manifests/pagination.manifest.json +1 -1
  346. package/src/manifests/password-input.manifest.json +1 -1
  347. package/src/manifests/popover.manifest.json +86 -4
  348. package/src/manifests/process-steps.manifest.json +1 -1
  349. package/src/manifests/progress.manifest.json +1 -1
  350. package/src/manifests/prose.manifest.json +1 -1
  351. package/src/manifests/radio.manifest.json +1 -1
  352. package/src/manifests/range-slider.manifest.json +1 -1
  353. package/src/manifests/search.manifest.json +1 -1
  354. package/src/manifests/section-heading.manifest.json +1 -1
  355. package/src/manifests/section.manifest.json +1 -1
  356. package/src/manifests/segmented-control.manifest.json +1 -1
  357. package/src/manifests/select-menu.manifest.json +1 -1
  358. package/src/manifests/select.manifest.json +1 -1
  359. package/src/manifests/separator.manifest.json +1 -1
  360. package/src/manifests/site-footer.manifest.json +1 -1
  361. package/src/manifests/site-header.manifest.json +13 -3
  362. package/src/manifests/skeleton.manifest.json +1 -1
  363. package/src/manifests/spinner.manifest.json +1 -1
  364. package/src/manifests/stat-band.manifest.json +1 -1
  365. package/src/manifests/stepper.manifest.json +7 -1
  366. package/src/manifests/switch.manifest.json +1 -1
  367. package/src/manifests/table-card.manifest.json +1 -1
  368. package/src/manifests/table-of-contents.manifest.json +1 -1
  369. package/src/manifests/table.manifest.json +1 -1
  370. package/src/manifests/tabs.manifest.json +1 -1
  371. package/src/manifests/testimonial.manifest.json +1 -1
  372. package/src/manifests/text.manifest.json +1 -1
  373. package/src/manifests/textarea.manifest.json +1 -1
  374. package/src/manifests/theme-toggle.manifest.json +1 -1
  375. package/src/manifests/time-picker.manifest.json +1 -1
  376. package/src/manifests/timeline.manifest.json +1 -1
  377. package/src/manifests/toast.manifest.json +1 -1
  378. package/src/manifests/tombstone-card.manifest.json +1 -1
  379. package/src/manifests/tooltip.manifest.json +1 -1
  380. package/src/utils/date.test.ts +190 -0
  381. package/src/utils/date.ts +162 -0
  382. package/src/utils/position.test.ts +227 -0
  383. package/src/utils/position.ts +129 -0
@@ -39,21 +39,48 @@ const trendClasses = {
39
39
  down: "text-destructive",
40
40
  flat: "text-muted-foreground"
41
41
  };
42
+ const toneClasses = {
43
+ default: "",
44
+ success: "text-success",
45
+ warning: "text-warning-ink",
46
+ destructive: "text-destructive"
47
+ };
42
48
  const trendGlyph = { up: "\u2191", down: "\u2193", flat: "\u2192" };
43
- const MetricCard = React.forwardRef(function MetricCard2({ label, value, hint, delta, trend = "flat", icon, className, ...props }, ref) {
49
+ const MetricCard = React.forwardRef(function MetricCard2({ label, value, hint, title, description, delta, trend = "flat", tone = "default", loading = false, icon, className, ...props }, ref) {
50
+ const heading = label ?? title;
51
+ const supporting = hint ?? description;
52
+ if (loading) {
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
54
+ "div",
55
+ {
56
+ ref,
57
+ "aria-busy": "true",
58
+ className: (0, import_cn.cn)("rounded-xl border border-border bg-card p-5", className),
59
+ ...props,
60
+ children: [
61
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
62
+ heading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: heading }),
63
+ icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground [&_svg]:size-4", children: icon })
64
+ ] }),
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", className: "mt-3 block h-7 w-24 animate-pulse rounded-md bg-muted" }),
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Loading" })
67
+ ]
68
+ }
69
+ );
70
+ }
44
71
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: (0, import_cn.cn)("rounded-xl border border-border bg-card p-5", className), ...props, children: [
45
72
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: label }),
73
+ heading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: heading }),
47
74
  icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground [&_svg]:size-4", children: icon })
48
75
  ] }),
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-2 text-2xl font-semibold tabular-nums", children: value }),
50
- (delta || hint) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "mt-1 flex items-center gap-2 text-sm", children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: (0, import_cn.cn)("mt-2 text-2xl font-semibold tabular-nums", toneClasses[tone]), children: value }),
77
+ (delta || supporting) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "mt-1 flex items-center gap-2 text-sm", children: [
51
78
  delta && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: (0, import_cn.cn)("font-medium tabular-nums", trendClasses[trend]), children: [
52
79
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", children: trendGlyph[trend] }),
53
80
  " ",
54
81
  delta
55
82
  ] }),
56
- hint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground", children: hint })
83
+ supporting && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground", children: supporting })
57
84
  ] })
58
85
  ] });
59
86
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/metric-card/MetricCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type MetricTrend = 'up' | 'down' | 'flat';\n\nexport type MetricCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n label: string;\n value: string | number;\n /** Secondary line under the value. */\n hint?: React.ReactNode;\n /** Signed change, e.g. \"+12.4%\" or \"-3\". */\n delta?: string;\n /** Direction colors the delta (green up / red down / muted flat). */\n trend?: MetricTrend;\n icon?: React.ReactNode;\n};\n\nconst trendClasses: Record<MetricTrend, string> = {\n up: 'text-success',\n down: 'text-destructive',\n flat: 'text-muted-foreground',\n};\n\nconst trendGlyph: Record<MetricTrend, string> = { up: '↑', down: '↓', flat: '→' };\n\n/**\n * Compact KPI tile: label, value, optional delta with direction color and a\n * supporting hint. Deltas always carry an arrow glyph so the direction is\n * never communicated by color alone.\n */\nexport const MetricCard = React.forwardRef<HTMLDivElement, MetricCardProps>(function MetricCard(\n { label, value, hint, delta, trend = 'flat', icon, className, ...props },\n ref\n) {\n return (\n <div ref={ref} className={cn('rounded-xl border border-border bg-card p-5', className)} {...props}>\n <div className=\"flex items-start justify-between gap-3\">\n <p className=\"text-sm text-muted-foreground\">{label}</p>\n {icon && <span className=\"text-muted-foreground [&_svg]:size-4\">{icon}</span>}\n </div>\n <p className=\"mt-2 text-2xl font-semibold tabular-nums\">{value}</p>\n {(delta || hint) && (\n <p className=\"mt-1 flex items-center gap-2 text-sm\">\n {delta && (\n <span className={cn('font-medium tabular-nums', trendClasses[trend])}>\n <span aria-hidden=\"true\">{trendGlyph[trend]}</span> {delta}\n </span>\n )}\n {hint && <span className=\"text-muted-foreground\">{hint}</span>}\n </p>\n )}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCM;AApCN,YAAuB;AACvB,gBAAmB;AAgBnB,MAAM,eAA4C;AAAA,EAChD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,aAA0C,EAAE,IAAI,UAAK,MAAM,UAAK,MAAM,SAAI;AAOzE,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,OAAO,MAAM,OAAO,QAAQ,QAAQ,MAAM,WAAW,GAAG,MAAM,GACvE,KACA;AACA,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,+CAA+C,SAAS,GAAI,GAAG,OAC1F;AAAA,iDAAC,SAAI,WAAU,0CACb;AAAA,kDAAC,OAAE,WAAU,iCAAiC,iBAAM;AAAA,MACnD,QAAQ,4CAAC,UAAK,WAAU,wCAAwC,gBAAK;AAAA,OACxE;AAAA,IACA,4CAAC,OAAE,WAAU,4CAA4C,iBAAM;AAAA,KAC7D,SAAS,SACT,6CAAC,OAAE,WAAU,wCACV;AAAA,eACC,6CAAC,UAAK,eAAW,cAAG,4BAA4B,aAAa,KAAK,CAAC,GACjE;AAAA,oDAAC,UAAK,eAAY,QAAQ,qBAAW,KAAK,GAAE;AAAA,QAAO;AAAA,QAAE;AAAA,SACvD;AAAA,MAED,QAAQ,4CAAC,UAAK,WAAU,yBAAyB,gBAAK;AAAA,OACzD;AAAA,KAEJ;AAEJ,CAAC;","names":["MetricCard"]}
1
+ {"version":3,"sources":["../../../../src/components/metric-card/MetricCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type MetricTrend = 'up' | 'down' | 'flat';\nexport type MetricTone = 'default' | 'success' | 'warning' | 'destructive';\n\nexport type MetricCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** Metric name. Alias: title. */\n label?: string;\n value: string | number;\n /** Secondary line under the value. Alias: description. */\n hint?: React.ReactNode;\n /** Alias for `label` (migration-friendly). */\n title?: string;\n /** Alias for `hint` (migration-friendly). */\n description?: React.ReactNode;\n /** Signed change, e.g. \"+12.4%\" or \"-3\". */\n delta?: string;\n /** Direction colors the delta (green up / red down / muted flat). */\n trend?: MetricTrend;\n /** Semantic color for the value (not the delta). */\n tone?: MetricTone;\n /** Renders a skeleton instead of the value; sets aria-busy while true. */\n loading?: boolean;\n icon?: React.ReactNode;\n};\n\nconst trendClasses: Record<MetricTrend, string> = {\n up: 'text-success',\n down: 'text-destructive',\n flat: 'text-muted-foreground',\n};\n\nconst toneClasses: Record<MetricTone, string> = {\n default: '',\n success: 'text-success',\n warning: 'text-warning-ink',\n destructive: 'text-destructive',\n};\n\nconst trendGlyph: Record<MetricTrend, string> = { up: '↑', down: '↓', flat: '→' };\n\n/**\n * Compact KPI tile: label, value, optional delta with direction color and a\n * supporting hint. Deltas always carry an arrow glyph so the direction is\n * never communicated by color alone.\n */\nexport const MetricCard = React.forwardRef<HTMLDivElement, MetricCardProps>(function MetricCard(\n { label, value, hint, title, description, delta, trend = 'flat', tone = 'default', loading = false, icon, className, ...props },\n ref\n) {\n const heading = label ?? title;\n const supporting = hint ?? description;\n\n if (loading) {\n return (\n <div\n ref={ref}\n aria-busy=\"true\"\n className={cn('rounded-xl border border-border bg-card p-5', className)}\n {...props}\n >\n <div className=\"flex items-start justify-between gap-3\">\n {heading && <p className=\"text-sm text-muted-foreground\">{heading}</p>}\n {icon && <span className=\"text-muted-foreground [&_svg]:size-4\">{icon}</span>}\n </div>\n <span aria-hidden=\"true\" className=\"mt-3 block h-7 w-24 animate-pulse rounded-md bg-muted\" />\n <span className=\"sr-only\">Loading</span>\n </div>\n );\n }\n\n return (\n <div ref={ref} className={cn('rounded-xl border border-border bg-card p-5', className)} {...props}>\n <div className=\"flex items-start justify-between gap-3\">\n {heading && <p className=\"text-sm text-muted-foreground\">{heading}</p>}\n {icon && <span className=\"text-muted-foreground [&_svg]:size-4\">{icon}</span>}\n </div>\n <p className={cn('mt-2 text-2xl font-semibold tabular-nums', toneClasses[tone])}>{value}</p>\n {(delta || supporting) && (\n <p className=\"mt-1 flex items-center gap-2 text-sm\">\n {delta && (\n <span className={cn('font-medium tabular-nums', trendClasses[trend])}>\n <span aria-hidden=\"true\">{trendGlyph[trend]}</span> {delta}\n </span>\n )}\n {supporting && <span className=\"text-muted-foreground\">{supporting}</span>}\n </p>\n )}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DQ;AA9DR,YAAuB;AACvB,gBAAmB;AA0BnB,MAAM,eAA4C;AAAA,EAChD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,cAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf;AAEA,MAAM,aAA0C,EAAE,IAAI,UAAK,MAAM,UAAK,MAAM,SAAI;AAOzE,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,OAAO,MAAM,OAAO,aAAa,OAAO,QAAQ,QAAQ,OAAO,WAAW,UAAU,OAAO,MAAM,WAAW,GAAG,MAAM,GAC9H,KACA;AACA,QAAM,UAAU,SAAS;AACzB,QAAM,aAAa,QAAQ;AAE3B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,aAAU;AAAA,QACV,eAAW,cAAG,+CAA+C,SAAS;AAAA,QACrE,GAAG;AAAA,QAEJ;AAAA,uDAAC,SAAI,WAAU,0CACZ;AAAA,uBAAW,4CAAC,OAAE,WAAU,iCAAiC,mBAAQ;AAAA,YACjE,QAAQ,4CAAC,UAAK,WAAU,wCAAwC,gBAAK;AAAA,aACxE;AAAA,UACA,4CAAC,UAAK,eAAY,QAAO,WAAU,yDAAwD;AAAA,UAC3F,4CAAC,UAAK,WAAU,WAAU,qBAAO;AAAA;AAAA;AAAA,IACnC;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,+CAA+C,SAAS,GAAI,GAAG,OAC1F;AAAA,iDAAC,SAAI,WAAU,0CACZ;AAAA,iBAAW,4CAAC,OAAE,WAAU,iCAAiC,mBAAQ;AAAA,MACjE,QAAQ,4CAAC,UAAK,WAAU,wCAAwC,gBAAK;AAAA,OACxE;AAAA,IACA,4CAAC,OAAE,eAAW,cAAG,4CAA4C,YAAY,IAAI,CAAC,GAAI,iBAAM;AAAA,KACtF,SAAS,eACT,6CAAC,OAAE,WAAU,wCACV;AAAA,eACC,6CAAC,UAAK,eAAW,cAAG,4BAA4B,aAAa,KAAK,CAAC,GACjE;AAAA,oDAAC,UAAK,eAAY,QAAQ,qBAAW,KAAK,GAAE;AAAA,QAAO;AAAA,QAAE;AAAA,SACvD;AAAA,MAED,cAAc,4CAAC,UAAK,WAAU,yBAAyB,sBAAW;AAAA,OACrE;AAAA,KAEJ;AAEJ,CAAC;","names":["MetricCard"]}
@@ -6,21 +6,48 @@ const trendClasses = {
6
6
  down: "text-destructive",
7
7
  flat: "text-muted-foreground"
8
8
  };
9
+ const toneClasses = {
10
+ default: "",
11
+ success: "text-success",
12
+ warning: "text-warning-ink",
13
+ destructive: "text-destructive"
14
+ };
9
15
  const trendGlyph = { up: "\u2191", down: "\u2193", flat: "\u2192" };
10
- const MetricCard = React.forwardRef(function MetricCard2({ label, value, hint, delta, trend = "flat", icon, className, ...props }, ref) {
16
+ const MetricCard = React.forwardRef(function MetricCard2({ label, value, hint, title, description, delta, trend = "flat", tone = "default", loading = false, icon, className, ...props }, ref) {
17
+ const heading = label ?? title;
18
+ const supporting = hint ?? description;
19
+ if (loading) {
20
+ return /* @__PURE__ */ jsxs(
21
+ "div",
22
+ {
23
+ ref,
24
+ "aria-busy": "true",
25
+ className: cn("rounded-xl border border-border bg-card p-5", className),
26
+ ...props,
27
+ children: [
28
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
29
+ heading && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: heading }),
30
+ icon && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground [&_svg]:size-4", children: icon })
31
+ ] }),
32
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "mt-3 block h-7 w-24 animate-pulse rounded-md bg-muted" }),
33
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading" })
34
+ ]
35
+ }
36
+ );
37
+ }
11
38
  return /* @__PURE__ */ jsxs("div", { ref, className: cn("rounded-xl border border-border bg-card p-5", className), ...props, children: [
12
39
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
13
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: label }),
40
+ heading && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: heading }),
14
41
  icon && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground [&_svg]:size-4", children: icon })
15
42
  ] }),
16
- /* @__PURE__ */ jsx("p", { className: "mt-2 text-2xl font-semibold tabular-nums", children: value }),
17
- (delta || hint) && /* @__PURE__ */ jsxs("p", { className: "mt-1 flex items-center gap-2 text-sm", children: [
43
+ /* @__PURE__ */ jsx("p", { className: cn("mt-2 text-2xl font-semibold tabular-nums", toneClasses[tone]), children: value }),
44
+ (delta || supporting) && /* @__PURE__ */ jsxs("p", { className: "mt-1 flex items-center gap-2 text-sm", children: [
18
45
  delta && /* @__PURE__ */ jsxs("span", { className: cn("font-medium tabular-nums", trendClasses[trend]), children: [
19
46
  /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: trendGlyph[trend] }),
20
47
  " ",
21
48
  delta
22
49
  ] }),
23
- hint && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: hint })
50
+ supporting && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: supporting })
24
51
  ] })
25
52
  ] });
26
53
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/metric-card/MetricCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type MetricTrend = 'up' | 'down' | 'flat';\n\nexport type MetricCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n label: string;\n value: string | number;\n /** Secondary line under the value. */\n hint?: React.ReactNode;\n /** Signed change, e.g. \"+12.4%\" or \"-3\". */\n delta?: string;\n /** Direction colors the delta (green up / red down / muted flat). */\n trend?: MetricTrend;\n icon?: React.ReactNode;\n};\n\nconst trendClasses: Record<MetricTrend, string> = {\n up: 'text-success',\n down: 'text-destructive',\n flat: 'text-muted-foreground',\n};\n\nconst trendGlyph: Record<MetricTrend, string> = { up: '↑', down: '↓', flat: '→' };\n\n/**\n * Compact KPI tile: label, value, optional delta with direction color and a\n * supporting hint. Deltas always carry an arrow glyph so the direction is\n * never communicated by color alone.\n */\nexport const MetricCard = React.forwardRef<HTMLDivElement, MetricCardProps>(function MetricCard(\n { label, value, hint, delta, trend = 'flat', icon, className, ...props },\n ref\n) {\n return (\n <div ref={ref} className={cn('rounded-xl border border-border bg-card p-5', className)} {...props}>\n <div className=\"flex items-start justify-between gap-3\">\n <p className=\"text-sm text-muted-foreground\">{label}</p>\n {icon && <span className=\"text-muted-foreground [&_svg]:size-4\">{icon}</span>}\n </div>\n <p className=\"mt-2 text-2xl font-semibold tabular-nums\">{value}</p>\n {(delta || hint) && (\n <p className=\"mt-1 flex items-center gap-2 text-sm\">\n {delta && (\n <span className={cn('font-medium tabular-nums', trendClasses[trend])}>\n <span aria-hidden=\"true\">{trendGlyph[trend]}</span> {delta}\n </span>\n )}\n {hint && <span className=\"text-muted-foreground\">{hint}</span>}\n </p>\n )}\n </div>\n );\n});\n"],"mappings":"AAoCM,SACE,KADF;AApCN,YAAY,WAAW;AACvB,SAAS,UAAU;AAgBnB,MAAM,eAA4C;AAAA,EAChD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,aAA0C,EAAE,IAAI,UAAK,MAAM,UAAK,MAAM,SAAI;AAOzE,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,OAAO,MAAM,OAAO,QAAQ,QAAQ,MAAM,WAAW,GAAG,MAAM,GACvE,KACA;AACA,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,+CAA+C,SAAS,GAAI,GAAG,OAC1F;AAAA,yBAAC,SAAI,WAAU,0CACb;AAAA,0BAAC,OAAE,WAAU,iCAAiC,iBAAM;AAAA,MACnD,QAAQ,oBAAC,UAAK,WAAU,wCAAwC,gBAAK;AAAA,OACxE;AAAA,IACA,oBAAC,OAAE,WAAU,4CAA4C,iBAAM;AAAA,KAC7D,SAAS,SACT,qBAAC,OAAE,WAAU,wCACV;AAAA,eACC,qBAAC,UAAK,WAAW,GAAG,4BAA4B,aAAa,KAAK,CAAC,GACjE;AAAA,4BAAC,UAAK,eAAY,QAAQ,qBAAW,KAAK,GAAE;AAAA,QAAO;AAAA,QAAE;AAAA,SACvD;AAAA,MAED,QAAQ,oBAAC,UAAK,WAAU,yBAAyB,gBAAK;AAAA,OACzD;AAAA,KAEJ;AAEJ,CAAC;","names":["MetricCard"]}
1
+ {"version":3,"sources":["../../../../src/components/metric-card/MetricCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type MetricTrend = 'up' | 'down' | 'flat';\nexport type MetricTone = 'default' | 'success' | 'warning' | 'destructive';\n\nexport type MetricCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** Metric name. Alias: title. */\n label?: string;\n value: string | number;\n /** Secondary line under the value. Alias: description. */\n hint?: React.ReactNode;\n /** Alias for `label` (migration-friendly). */\n title?: string;\n /** Alias for `hint` (migration-friendly). */\n description?: React.ReactNode;\n /** Signed change, e.g. \"+12.4%\" or \"-3\". */\n delta?: string;\n /** Direction colors the delta (green up / red down / muted flat). */\n trend?: MetricTrend;\n /** Semantic color for the value (not the delta). */\n tone?: MetricTone;\n /** Renders a skeleton instead of the value; sets aria-busy while true. */\n loading?: boolean;\n icon?: React.ReactNode;\n};\n\nconst trendClasses: Record<MetricTrend, string> = {\n up: 'text-success',\n down: 'text-destructive',\n flat: 'text-muted-foreground',\n};\n\nconst toneClasses: Record<MetricTone, string> = {\n default: '',\n success: 'text-success',\n warning: 'text-warning-ink',\n destructive: 'text-destructive',\n};\n\nconst trendGlyph: Record<MetricTrend, string> = { up: '↑', down: '↓', flat: '→' };\n\n/**\n * Compact KPI tile: label, value, optional delta with direction color and a\n * supporting hint. Deltas always carry an arrow glyph so the direction is\n * never communicated by color alone.\n */\nexport const MetricCard = React.forwardRef<HTMLDivElement, MetricCardProps>(function MetricCard(\n { label, value, hint, title, description, delta, trend = 'flat', tone = 'default', loading = false, icon, className, ...props },\n ref\n) {\n const heading = label ?? title;\n const supporting = hint ?? description;\n\n if (loading) {\n return (\n <div\n ref={ref}\n aria-busy=\"true\"\n className={cn('rounded-xl border border-border bg-card p-5', className)}\n {...props}\n >\n <div className=\"flex items-start justify-between gap-3\">\n {heading && <p className=\"text-sm text-muted-foreground\">{heading}</p>}\n {icon && <span className=\"text-muted-foreground [&_svg]:size-4\">{icon}</span>}\n </div>\n <span aria-hidden=\"true\" className=\"mt-3 block h-7 w-24 animate-pulse rounded-md bg-muted\" />\n <span className=\"sr-only\">Loading</span>\n </div>\n );\n }\n\n return (\n <div ref={ref} className={cn('rounded-xl border border-border bg-card p-5', className)} {...props}>\n <div className=\"flex items-start justify-between gap-3\">\n {heading && <p className=\"text-sm text-muted-foreground\">{heading}</p>}\n {icon && <span className=\"text-muted-foreground [&_svg]:size-4\">{icon}</span>}\n </div>\n <p className={cn('mt-2 text-2xl font-semibold tabular-nums', toneClasses[tone])}>{value}</p>\n {(delta || supporting) && (\n <p className=\"mt-1 flex items-center gap-2 text-sm\">\n {delta && (\n <span className={cn('font-medium tabular-nums', trendClasses[trend])}>\n <span aria-hidden=\"true\">{trendGlyph[trend]}</span> {delta}\n </span>\n )}\n {supporting && <span className=\"text-muted-foreground\">{supporting}</span>}\n </p>\n )}\n </div>\n );\n});\n"],"mappings":"AA8DQ,SACc,KADd;AA9DR,YAAY,WAAW;AACvB,SAAS,UAAU;AA0BnB,MAAM,eAA4C;AAAA,EAChD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,cAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf;AAEA,MAAM,aAA0C,EAAE,IAAI,UAAK,MAAM,UAAK,MAAM,SAAI;AAOzE,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,OAAO,MAAM,OAAO,aAAa,OAAO,QAAQ,QAAQ,OAAO,WAAW,UAAU,OAAO,MAAM,WAAW,GAAG,MAAM,GAC9H,KACA;AACA,QAAM,UAAU,SAAS;AACzB,QAAM,aAAa,QAAQ;AAE3B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,aAAU;AAAA,QACV,WAAW,GAAG,+CAA+C,SAAS;AAAA,QACrE,GAAG;AAAA,QAEJ;AAAA,+BAAC,SAAI,WAAU,0CACZ;AAAA,uBAAW,oBAAC,OAAE,WAAU,iCAAiC,mBAAQ;AAAA,YACjE,QAAQ,oBAAC,UAAK,WAAU,wCAAwC,gBAAK;AAAA,aACxE;AAAA,UACA,oBAAC,UAAK,eAAY,QAAO,WAAU,yDAAwD;AAAA,UAC3F,oBAAC,UAAK,WAAU,WAAU,qBAAO;AAAA;AAAA;AAAA,IACnC;AAAA,EAEJ;AAEA,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,+CAA+C,SAAS,GAAI,GAAG,OAC1F;AAAA,yBAAC,SAAI,WAAU,0CACZ;AAAA,iBAAW,oBAAC,OAAE,WAAU,iCAAiC,mBAAQ;AAAA,MACjE,QAAQ,oBAAC,UAAK,WAAU,wCAAwC,gBAAK;AAAA,OACxE;AAAA,IACA,oBAAC,OAAE,WAAW,GAAG,4CAA4C,YAAY,IAAI,CAAC,GAAI,iBAAM;AAAA,KACtF,SAAS,eACT,qBAAC,OAAE,WAAU,wCACV;AAAA,eACC,qBAAC,UAAK,WAAW,GAAG,4BAA4B,aAAa,KAAK,CAAC,GACjE;AAAA,4BAAC,UAAK,eAAY,QAAQ,qBAAW,KAAK,GAAE;AAAA,QAAO;AAAA,QAAE;AAAA,SACvD;AAAA,MAED,cAAc,oBAAC,UAAK,WAAU,yBAAyB,sBAAW;AAAA,OACrE;AAAA,KAEJ;AAEJ,CAAC;","names":["MetricCard"]}
@@ -2,6 +2,8 @@ import * as React from 'react';
2
2
  export type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
3
3
  title: string;
4
4
  description?: string;
5
+ /** Alias for `description` (migration-friendly). */
6
+ subtitle?: string;
5
7
  /** Breadcrumbs/eyebrow above the title. */
6
8
  breadcrumbs?: React.ReactNode;
7
9
  /** Right-aligned actions (buttons, menus). */
@@ -29,6 +31,8 @@ export type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
29
31
  export declare const PageHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
30
32
  title: string;
31
33
  description?: string;
34
+ /** Alias for `description` (migration-friendly). */
35
+ subtitle?: string;
32
36
  /** Breadcrumbs/eyebrow above the title. */
33
37
  breadcrumbs?: React.ReactNode;
34
38
  /** Right-aligned actions (buttons, menus). */
@@ -40,14 +40,15 @@ const sizeClasses = {
40
40
  lg: "text-3xl",
41
41
  hero: "text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]"
42
42
  };
43
- const PageHeader = React.forwardRef(function PageHeader2({ title, description, breadcrumbs, actions, eyebrow, size = "md", align = "left", titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props }, ref) {
43
+ const PageHeader = React.forwardRef(function PageHeader2({ title, description, subtitle, breadcrumbs, actions, eyebrow, size = "md", align = "left", titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props }, ref) {
44
+ const supporting = description ?? subtitle;
44
45
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: (0, import_cn.cn)("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
45
46
  breadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
46
- eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("text-xs font-medium uppercase tracking-wide text-primary", eyebrowClassName), children: eyebrow }),
47
+ eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("text-xs font-medium uppercase tracking-wide text-primary-ink", eyebrowClassName), children: eyebrow }),
47
48
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
48
49
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("min-w-0", align === "center" && "flex flex-col items-center"), children: [
49
50
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: (0, import_cn.cn)("font-semibold tracking-tight", sizeClasses[size], titleClassName), children: title }),
50
- description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: (0, import_cn.cn)("mt-2 max-w-2xl text-base text-muted-foreground", descriptionClassName), children: description })
51
+ supporting && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: (0, import_cn.cn)("mt-2 max-w-2xl text-base text-muted-foreground", descriptionClassName), children: supporting })
51
52
  ] }),
52
53
  actions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
53
54
  ] }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {description && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{description}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CsB;AA5CtB,YAAuB;AACvB,gBAAmB;AAyBnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GACxK,KACA;AACA,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,4CAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,4CAAC,SAAI,eAAW,cAAG,4DAA4D,gBAAgB,GAAI,mBAAQ;AAAA,IAE7G,6CAAC,SAAI,eAAW,cAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,mDAAC,SAAI,eAAW,cAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,oDAAC,QAAG,eAAW,cAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,eAAe,4CAAC,OAAE,eAAW,cAAG,kDAAkD,oBAAoB,GAAI,uBAAY;AAAA,SACzH;AAAA,MACC,WAAW,4CAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,4CAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
1
+ {"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary-ink', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CsB;AA/CtB,YAAuB;AACvB,gBAAmB;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,4CAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,4CAAC,SAAI,eAAW,cAAG,gEAAgE,gBAAgB,GAAI,mBAAQ;AAAA,IAEjH,6CAAC,SAAI,eAAW,cAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,mDAAC,SAAI,eAAW,cAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,oDAAC,QAAG,eAAW,cAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,cAAc,4CAAC,OAAE,eAAW,cAAG,kDAAkD,oBAAoB,GAAI,sBAAW;AAAA,SACvH;AAAA,MACC,WAAW,4CAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,4CAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
@@ -7,14 +7,15 @@ const sizeClasses = {
7
7
  lg: "text-3xl",
8
8
  hero: "text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]"
9
9
  };
10
- const PageHeader = React.forwardRef(function PageHeader2({ title, description, breadcrumbs, actions, eyebrow, size = "md", align = "left", titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props }, ref) {
10
+ const PageHeader = React.forwardRef(function PageHeader2({ title, description, subtitle, breadcrumbs, actions, eyebrow, size = "md", align = "left", titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props }, ref) {
11
+ const supporting = description ?? subtitle;
11
12
  return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
12
13
  breadcrumbs && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
13
- eyebrow && /* @__PURE__ */ jsx("div", { className: cn("text-xs font-medium uppercase tracking-wide text-primary", eyebrowClassName), children: eyebrow }),
14
+ eyebrow && /* @__PURE__ */ jsx("div", { className: cn("text-xs font-medium uppercase tracking-wide text-primary-ink", eyebrowClassName), children: eyebrow }),
14
15
  /* @__PURE__ */ jsxs("div", { className: cn("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
15
16
  /* @__PURE__ */ jsxs("div", { className: cn("min-w-0", align === "center" && "flex flex-col items-center"), children: [
16
17
  /* @__PURE__ */ jsx("h1", { className: cn("font-semibold tracking-tight", sizeClasses[size], titleClassName), children: title }),
17
- description && /* @__PURE__ */ jsx("p", { className: cn("mt-2 max-w-2xl text-base text-muted-foreground", descriptionClassName), children: description })
18
+ supporting && /* @__PURE__ */ jsx("p", { className: cn("mt-2 max-w-2xl text-base text-muted-foreground", descriptionClassName), children: supporting })
18
19
  ] }),
19
20
  actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })
20
21
  ] }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {description && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{description}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":"AA4CsB,cAKd,YALc;AA5CtB,YAAY,WAAW;AACvB,SAAS,UAAU;AAyBnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GACxK,KACA;AACA,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,oBAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,oBAAC,SAAI,WAAW,GAAG,4DAA4D,gBAAgB,GAAI,mBAAQ;AAAA,IAE7G,qBAAC,SAAI,WAAW,GAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,2BAAC,SAAI,WAAW,GAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,4BAAC,QAAG,WAAW,GAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,eAAe,oBAAC,OAAE,WAAW,GAAG,kDAAkD,oBAAoB,GAAI,uBAAY;AAAA,SACzH;AAAA,MACC,WAAW,oBAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,oBAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
1
+ {"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary-ink', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":"AA+CsB,cAKd,YALc;AA/CtB,YAAY,WAAW;AACvB,SAAS,UAAU;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,oBAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,oBAAC,SAAI,WAAW,GAAG,gEAAgE,gBAAgB,GAAI,mBAAQ;AAAA,IAEjH,qBAAC,SAAI,WAAW,GAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,2BAAC,SAAI,WAAW,GAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,4BAAC,QAAG,WAAW,GAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,cAAc,oBAAC,OAAE,WAAW,GAAG,kDAAkD,oBAAoB,GAAI,sBAAW;AAAA,SACvH;AAAA,MACC,WAAW,oBAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,oBAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { type Align, type Side } from '../../utils/position';
2
3
  export type PopoverProps = {
3
4
  /** Controlled open state. */
4
5
  open?: boolean;
@@ -16,7 +17,39 @@ declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefA
16
17
  export type PopoverTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
17
18
  /** The button that toggles the popover. */
18
19
  declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
19
- export type PopoverContentProps = React.HTMLAttributes<HTMLDivElement>;
20
+ export type PopoverAnchorProps = React.HTMLAttributes<HTMLSpanElement>;
21
+ /**
22
+ * Anchors the panel to this element instead of the trigger. Useful when the
23
+ * panel belongs to a field that is not itself the button opening it.
24
+ */
25
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLSpanElement>>;
26
+ export type PopoverContentProps = React.HTMLAttributes<HTMLDivElement> & {
27
+ /** Preferred side of the anchor. Flips when it cannot fit. */
28
+ side?: Side;
29
+ /** Cross-axis alignment against the anchor. */
30
+ align?: Align;
31
+ /** Gap between anchor and panel. */
32
+ sideOffset?: number;
33
+ /** Nudge along the cross axis. */
34
+ alignOffset?: number;
35
+ /** Minimum distance kept from the viewport edges. */
36
+ collisionPadding?: number;
37
+ /** Match the panel width to the anchor width (select-like panels). */
38
+ matchTriggerWidth?: boolean;
39
+ };
20
40
  /** The floating panel with interactive content. */
21
- declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
22
- export { Popover, PopoverTrigger, PopoverContent };
41
+ declare const PopoverContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
42
+ /** Preferred side of the anchor. Flips when it cannot fit. */
43
+ side?: Side;
44
+ /** Cross-axis alignment against the anchor. */
45
+ align?: Align;
46
+ /** Gap between anchor and panel. */
47
+ sideOffset?: number;
48
+ /** Nudge along the cross axis. */
49
+ alignOffset?: number;
50
+ /** Minimum distance kept from the viewport edges. */
51
+ collisionPadding?: number;
52
+ /** Match the panel width to the anchor width (select-like panels). */
53
+ matchTriggerWidth?: boolean;
54
+ } & React.RefAttributes<HTMLDivElement>>;
55
+ export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var Popover_exports = {};
31
31
  __export(Popover_exports, {
32
32
  Popover: () => Popover,
33
+ PopoverAnchor: () => PopoverAnchor,
33
34
  PopoverContent: () => PopoverContent,
34
35
  PopoverTrigger: () => PopoverTrigger
35
36
  });
@@ -38,13 +39,16 @@ var import_jsx_runtime = require("react/jsx-runtime");
38
39
  var React = __toESM(require("react"));
39
40
  var import_react_dom = require("react-dom");
40
41
  var import_cn = require("../../utils/cn.js");
42
+ var import_position = require("../../utils/position.js");
41
43
  const PopoverContext = React.createContext({
42
44
  open: false,
43
45
  setOpen: () => {
44
46
  },
45
47
  triggerId: "",
46
48
  contentId: "",
47
- wrapperRef: { current: null }
49
+ wrapperRef: { current: null },
50
+ anchorRef: { current: null },
51
+ triggerRef: { current: null }
48
52
  });
49
53
  const Popover = React.forwardRef(
50
54
  ({ open, onOpenChange, className, children }, ref) => {
@@ -53,6 +57,8 @@ const Popover = React.forwardRef(
53
57
  const triggerId = React.useId();
54
58
  const contentId = React.useId();
55
59
  const wrapperRef = React.useRef(null);
60
+ const anchorRef = React.useRef(null);
61
+ const triggerRef = React.useRef(null);
56
62
  const setRefs = React.useCallback(
57
63
  (node) => {
58
64
  wrapperRef.current = node;
@@ -71,7 +77,7 @@ const Popover = React.forwardRef(
71
77
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: setRefs, className: (0, import_cn.cn)("relative inline-block", className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
78
  PopoverContext.Provider,
73
79
  {
74
- value: { open: current, setOpen, triggerId, contentId, wrapperRef },
80
+ value: { open: current, setOpen, triggerId, contentId, wrapperRef, anchorRef, triggerRef },
75
81
  children
76
82
  }
77
83
  ) });
@@ -79,13 +85,21 @@ const Popover = React.forwardRef(
79
85
  );
80
86
  Popover.displayName = "Popover";
81
87
  const PopoverTrigger = React.forwardRef(
82
- ({ className, children, onClick, ...props }, ref) => {
83
- const { open, setOpen, triggerId, contentId } = React.useContext(PopoverContext);
88
+ ({ className, children, onClick, id, ...props }, ref) => {
89
+ const { open, setOpen, triggerId, contentId, triggerRef } = React.useContext(PopoverContext);
90
+ const setRefs = React.useCallback(
91
+ (node) => {
92
+ triggerRef.current = node;
93
+ if (typeof ref === "function") ref(node);
94
+ else if (ref) ref.current = node;
95
+ },
96
+ [ref, triggerRef]
97
+ );
84
98
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
99
  "button",
86
100
  {
87
- ref,
88
- id: triggerId,
101
+ ref: setRefs,
102
+ id: id ?? triggerId,
89
103
  type: "button",
90
104
  "aria-haspopup": "dialog",
91
105
  "aria-expanded": open,
@@ -106,31 +120,102 @@ const PopoverTrigger = React.forwardRef(
106
120
  }
107
121
  );
108
122
  PopoverTrigger.displayName = "PopoverTrigger";
123
+ const PopoverAnchor = React.forwardRef(
124
+ ({ className, children, ...props }, ref) => {
125
+ const { anchorRef } = React.useContext(PopoverContext);
126
+ const setRefs = React.useCallback(
127
+ (node) => {
128
+ anchorRef.current = node;
129
+ if (typeof ref === "function") ref(node);
130
+ else if (ref) ref.current = node;
131
+ },
132
+ [anchorRef, ref]
133
+ );
134
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: setRefs, className: (0, import_cn.cn)("inline-block", className), ...props, children });
135
+ }
136
+ );
137
+ PopoverAnchor.displayName = "PopoverAnchor";
138
+ function rectOf(element) {
139
+ const rect = element.getBoundingClientRect();
140
+ return {
141
+ top: rect.top,
142
+ left: rect.left,
143
+ width: rect.width || element.offsetWidth || 0,
144
+ height: rect.height || element.offsetHeight || 0
145
+ };
146
+ }
109
147
  const PopoverContent = React.forwardRef(
110
- ({ className, children, onKeyDown, ...props }, ref) => {
111
- const { open, setOpen, triggerId, contentId, wrapperRef } = React.useContext(PopoverContext);
148
+ ({
149
+ className,
150
+ children,
151
+ onKeyDown,
152
+ style,
153
+ side = "bottom",
154
+ align = "start",
155
+ sideOffset = 8,
156
+ alignOffset = 0,
157
+ collisionPadding = 8,
158
+ matchTriggerWidth = false,
159
+ ...props
160
+ }, ref) => {
161
+ const { open, setOpen, contentId, wrapperRef, anchorRef, triggerRef } = React.useContext(PopoverContext);
162
+ const labelledBy = triggerRef.current?.id || void 0;
112
163
  const contentRef = React.useRef(null);
113
164
  const [pos, setPos] = React.useState(null);
165
+ const [width, setWidth] = React.useState(void 0);
166
+ const updatePosition = React.useCallback(() => {
167
+ const anchorEl = anchorRef.current ?? wrapperRef.current;
168
+ const panel = contentRef.current;
169
+ if (!anchorEl || !panel) return;
170
+ const anchor = rectOf(anchorEl);
171
+ const measured = rectOf(panel);
172
+ setWidth(matchTriggerWidth ? anchor.width : void 0);
173
+ setPos(
174
+ (0, import_position.computePosition)({
175
+ anchor,
176
+ content: { width: measured.width, height: measured.height },
177
+ viewport: { width: window.innerWidth, height: window.innerHeight },
178
+ side,
179
+ align,
180
+ sideOffset,
181
+ alignOffset,
182
+ collisionPadding
183
+ })
184
+ );
185
+ }, [
186
+ align,
187
+ alignOffset,
188
+ anchorRef,
189
+ collisionPadding,
190
+ matchTriggerWidth,
191
+ side,
192
+ sideOffset,
193
+ wrapperRef
194
+ ]);
114
195
  React.useLayoutEffect(() => {
115
196
  if (!open) {
116
197
  setPos(null);
117
198
  return;
118
199
  }
119
- const GAP = 8;
120
- const measure = () => {
121
- const rect = wrapperRef.current?.getBoundingClientRect();
122
- if (!rect) return;
123
- setPos({ top: rect.bottom + GAP, right: Math.max(8, window.innerWidth - rect.right) });
124
- };
125
- measure();
126
- const onScroll = () => setOpen(false);
200
+ updatePosition();
201
+ }, [open, updatePosition]);
202
+ React.useEffect(() => {
203
+ if (open && !pos) updatePosition();
204
+ }, [open, pos, updatePosition]);
205
+ React.useEffect(() => {
206
+ if (!open) return;
207
+ const onScroll = () => updatePosition();
127
208
  window.addEventListener("scroll", onScroll, true);
128
- window.addEventListener("resize", measure);
209
+ window.addEventListener("resize", onScroll);
210
+ const panel = contentRef.current;
211
+ const observer = typeof ResizeObserver === "undefined" || !panel ? null : new ResizeObserver(onScroll);
212
+ if (panel && observer) observer.observe(panel);
129
213
  return () => {
130
214
  window.removeEventListener("scroll", onScroll, true);
131
- window.removeEventListener("resize", measure);
215
+ window.removeEventListener("resize", onScroll);
216
+ observer?.disconnect();
132
217
  };
133
- }, [open, setOpen, wrapperRef]);
218
+ }, [open, updatePosition]);
134
219
  React.useEffect(() => {
135
220
  if (!open) return;
136
221
  function onPointerDown(event) {
@@ -144,7 +229,7 @@ const PopoverContent = React.forwardRef(
144
229
  contentRef.current.focus();
145
230
  }
146
231
  }, [open, pos]);
147
- if (!open || !pos || typeof document === "undefined") return null;
232
+ if (!open || typeof document === "undefined") return null;
148
233
  return (0, import_react_dom.createPortal)(
149
234
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
150
235
  "div",
@@ -156,16 +241,26 @@ const PopoverContent = React.forwardRef(
156
241
  },
157
242
  id: contentId,
158
243
  role: "dialog",
159
- "aria-labelledby": triggerId,
244
+ "aria-labelledby": labelledBy,
160
245
  tabIndex: -1,
246
+ "data-side": pos?.side ?? side,
161
247
  onKeyDown: (event) => {
162
248
  onKeyDown?.(event);
163
249
  if (event.key === "Escape") {
164
250
  event.stopPropagation();
165
251
  setOpen(false);
252
+ (triggerRef.current ?? anchorRef.current)?.focus();
166
253
  }
167
254
  },
168
- style: { position: "fixed", top: pos.top, right: pos.right, zIndex: 50 },
255
+ style: {
256
+ position: "fixed",
257
+ top: pos?.top ?? 0,
258
+ left: pos?.left ?? 0,
259
+ width,
260
+ visibility: pos ? "visible" : "hidden",
261
+ zIndex: 50,
262
+ ...style
263
+ },
169
264
  className: (0, import_cn.cn)(
170
265
  "w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none",
171
266
  className
@@ -182,6 +277,7 @@ PopoverContent.displayName = "PopoverContent";
182
277
  // Annotate the CommonJS export names for ESM import in node:
183
278
  0 && (module.exports = {
184
279
  Popover,
280
+ PopoverAnchor,
185
281
  PopoverContent,
186
282
  PopoverTrigger
187
283
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\n\ntype PopoverContextValue = {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerId: string;\n contentId: string;\n /** The relative wrapper the popover is anchored to (measured for portal positioning). */\n wrapperRef: React.MutableRefObject<HTMLDivElement | null>;\n};\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n open: false,\n setOpen: () => {},\n triggerId: '',\n contentId: '',\n wrapperRef: { current: null },\n});\n\nexport type PopoverProps = {\n /** Controlled open state. */\n open?: boolean;\n /** Called when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * Floating panel anchored to a trigger. Unlike Tooltip, the content is\n * interactive (links, buttons, forms). Closes on outside click and Escape.\n * Renders as a non-modal dialog with proper aria wiring.\n */\nconst Popover = React.forwardRef<HTMLDivElement, PopoverProps>(\n ({ open, onOpenChange, className, children }, ref) => {\n const [internalOpen, setInternalOpen] = React.useState(false);\n const current = open ?? internalOpen;\n const triggerId = React.useId();\n const contentId = React.useId();\n const wrapperRef = React.useRef<HTMLDivElement | null>(null);\n const setRefs = React.useCallback(\n (node: HTMLDivElement | null) => {\n wrapperRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref]\n );\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [open, onOpenChange]\n );\n\n return (\n <div ref={setRefs} className={cn('relative inline-block', className)}>\n <PopoverContext.Provider\n value={{ open: current, setOpen, triggerId, contentId, wrapperRef }}\n >\n {children}\n </PopoverContext.Provider>\n </div>\n );\n }\n);\nPopover.displayName = 'Popover';\n\nexport type PopoverTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n/** The button that toggles the popover. */\nconst PopoverTrigger = React.forwardRef<HTMLButtonElement, PopoverTriggerProps>(\n ({ className, children, onClick, ...props }, ref) => {\n const { open, setOpen, triggerId, contentId } = React.useContext(PopoverContext);\n return (\n <button\n ref={ref}\n id={triggerId}\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-controls={open ? contentId : undefined}\n onClick={(event) => {\n onClick?.(event);\n setOpen(!open);\n }}\n className={cn(\n 'inline-flex items-center justify-center rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium transition-colors',\n 'hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className\n )}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\nPopoverTrigger.displayName = 'PopoverTrigger';\n\nexport type PopoverContentProps = React.HTMLAttributes<HTMLDivElement>;\n\n /** The floating panel with interactive content. */\n const PopoverContent = React.forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ className, children, onKeyDown, ...props }, ref) => {\n const { open, setOpen, triggerId, contentId, wrapperRef } =\n React.useContext(PopoverContext);\n const contentRef = React.useRef<HTMLDivElement | null>(null);\n // Viewport coordinates measured from the wrapper; the panel portals to\n // document.body with position:fixed so ancestor overflow (scrollable\n // demo frames, clipped containers) can never cut it off.\n const [pos, setPos] = React.useState<{ top: number; right: number } | null>(null);\n\n React.useLayoutEffect(() => {\n if (!open) {\n setPos(null);\n return;\n }\n const GAP = 8; // matches the previous mt-2 spacing\n const measure = () => {\n const rect = wrapperRef.current?.getBoundingClientRect();\n if (!rect) return;\n setPos({ top: rect.bottom + GAP, right: Math.max(8, window.innerWidth - rect.right) });\n };\n measure();\n const onScroll = () => setOpen(false);\n window.addEventListener('scroll', onScroll, true);\n window.addEventListener('resize', measure);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n window.removeEventListener('resize', measure);\n };\n }, [open, setOpen, wrapperRef]);\n\n // Close on outside click.\n React.useEffect(() => {\n if (!open) return;\n function onPointerDown(event: PointerEvent) {\n if (!contentRef.current?.contains(event.target as Node)) setOpen(false);\n }\n document.addEventListener('pointerdown', onPointerDown);\n return () => document.removeEventListener('pointerdown', onPointerDown);\n }, [open, setOpen]);\n\n // Focus the content when it opens so Escape reaches it. Depends on\n // `pos` because the panel only mounts once measured.\n React.useEffect(() => {\n if (open && pos && contentRef.current) {\n contentRef.current.focus();\n }\n }, [open, pos]);\n\n if (!open || !pos || typeof document === 'undefined') return null;\n\n return createPortal(\n <div\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n id={contentId}\n role=\"dialog\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.key === 'Escape') {\n event.stopPropagation();\n setOpen(false);\n }\n }}\n style={{ position: 'fixed', top: pos.top, right: pos.right, zIndex: 50 }}\n className={cn(\n 'w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n className\n )}\n {...props}\n >\n {children}\n </div>,\n document.body\n );\n }\n );\nPopoverContent.displayName = 'PopoverContent';\n\nexport { Popover, PopoverTrigger, PopoverContent };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+DQ;AA7DR,YAAuB;AACvB,uBAA6B;AAC7B,gBAAmB;AAWnB,MAAM,iBAAiB,MAAM,cAAmC;AAAA,EAC9D,MAAM;AAAA,EACN,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY,EAAE,SAAS,KAAK;AAC9B,CAAC;AAgBD,MAAM,UAAU,MAAM;AAAA,EACpB,CAAC,EAAE,MAAM,cAAc,WAAW,SAAS,GAAG,QAAQ;AACpD,UAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,KAAK;AAC5D,UAAM,UAAU,QAAQ;AACxB,UAAM,YAAY,MAAM,MAAM;AAC9B,UAAM,YAAY,MAAM,MAAM;AAC9B,UAAM,aAAa,MAAM,OAA8B,IAAI;AAC3D,UAAM,UAAU,MAAM;AAAA,MACpB,CAAC,SAAgC;AAC/B,mBAAW,UAAU;AACrB,YAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,iBAC9B,IAAK,KAAI,UAAU;AAAA,MAC9B;AAAA,MACA,CAAC,GAAG;AAAA,IACN;AAEA,UAAM,UAAU,MAAM;AAAA,MACpB,CAAC,SAAkB;AACjB,YAAI,SAAS,OAAW,iBAAgB,IAAI;AAC5C,uBAAe,IAAI;AAAA,MACrB;AAAA,MACA,CAAC,MAAM,YAAY;AAAA,IACrB;AAEA,WACE,4CAAC,SAAI,KAAK,SAAS,eAAW,cAAG,yBAAyB,SAAS,GACjE;AAAA,MAAC,eAAe;AAAA,MAAf;AAAA,QACC,OAAO,EAAE,MAAM,SAAS,SAAS,WAAW,WAAW,WAAW;AAAA,QAEjE;AAAA;AAAA,IACH,GACF;AAAA,EAEJ;AAC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AAAA,EACF;AACF;AACF,eAAe,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\nimport { computePosition, type Align, type PositionResult, type Side } from '../../utils/position';\n\ntype PopoverContextValue = {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerId: string;\n contentId: string;\n /** The relative wrapper the popover is anchored to by default. */\n wrapperRef: React.MutableRefObject<HTMLDivElement | null>;\n /** Optional explicit anchor, rendered by PopoverAnchor. */\n anchorRef: React.MutableRefObject<HTMLElement | null>;\n /** The rendered trigger, so Escape can restore focus and labels stay valid. */\n triggerRef: React.MutableRefObject<HTMLButtonElement | null>;\n};\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n open: false,\n setOpen: () => {},\n triggerId: '',\n contentId: '',\n wrapperRef: { current: null },\n anchorRef: { current: null },\n triggerRef: { current: null },\n});\n\nexport type PopoverProps = {\n /** Controlled open state. */\n open?: boolean;\n /** Called when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * Floating panel anchored to a trigger. Unlike Tooltip, the content is\n * interactive (links, buttons, forms). Closes on outside click and Escape.\n * Renders as a non-modal dialog with proper aria wiring.\n */\nconst Popover = React.forwardRef<HTMLDivElement, PopoverProps>(\n ({ open, onOpenChange, className, children }, ref) => {\n const [internalOpen, setInternalOpen] = React.useState(false);\n const current = open ?? internalOpen;\n const triggerId = React.useId();\n const contentId = React.useId();\n const wrapperRef = React.useRef<HTMLDivElement | null>(null);\n const anchorRef = React.useRef<HTMLElement | null>(null);\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const setRefs = React.useCallback(\n (node: HTMLDivElement | null) => {\n wrapperRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref]\n );\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [open, onOpenChange]\n );\n\n return (\n <div ref={setRefs} className={cn('relative inline-block', className)}>\n <PopoverContext.Provider\n value={{ open: current, setOpen, triggerId, contentId, wrapperRef, anchorRef, triggerRef }}\n >\n {children}\n </PopoverContext.Provider>\n </div>\n );\n }\n);\nPopover.displayName = 'Popover';\n\nexport type PopoverTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n/** The button that toggles the popover. */\nconst PopoverTrigger = React.forwardRef<HTMLButtonElement, PopoverTriggerProps>(\n ({ className, children, onClick, id, ...props }, ref) => {\n const { open, setOpen, triggerId, contentId, triggerRef } = React.useContext(PopoverContext);\n const setRefs = React.useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref, triggerRef]\n );\n return (\n <button\n ref={setRefs}\n id={id ?? triggerId}\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-controls={open ? contentId : undefined}\n onClick={(event) => {\n onClick?.(event);\n setOpen(!open);\n }}\n className={cn(\n 'inline-flex items-center justify-center rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium transition-colors',\n 'hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className\n )}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\nPopoverTrigger.displayName = 'PopoverTrigger';\n\nexport type PopoverAnchorProps = React.HTMLAttributes<HTMLSpanElement>;\n\n/**\n * Anchors the panel to this element instead of the trigger. Useful when the\n * panel belongs to a field that is not itself the button opening it.\n */\nconst PopoverAnchor = React.forwardRef<HTMLSpanElement, PopoverAnchorProps>(\n ({ className, children, ...props }, ref) => {\n const { anchorRef } = React.useContext(PopoverContext);\n const setRefs = React.useCallback(\n (node: HTMLSpanElement | null) => {\n anchorRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [anchorRef, ref]\n );\n return (\n <span ref={setRefs} className={cn('inline-block', className)} {...props}>\n {children}\n </span>\n );\n }\n);\nPopoverAnchor.displayName = 'PopoverAnchor';\n\nexport type PopoverContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Preferred side of the anchor. Flips when it cannot fit. */\n side?: Side;\n /** Cross-axis alignment against the anchor. */\n align?: Align;\n /** Gap between anchor and panel. */\n sideOffset?: number;\n /** Nudge along the cross axis. */\n alignOffset?: number;\n /** Minimum distance kept from the viewport edges. */\n collisionPadding?: number;\n /** Match the panel width to the anchor width (select-like panels). */\n matchTriggerWidth?: boolean;\n};\n\nfunction rectOf(element: Element) {\n const rect = element.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n width: rect.width || (element as HTMLElement).offsetWidth || 0,\n height: rect.height || (element as HTMLElement).offsetHeight || 0,\n };\n}\n\n/** The floating panel with interactive content. */\nconst PopoverContent = React.forwardRef<HTMLDivElement, PopoverContentProps>(\n (\n {\n className,\n children,\n onKeyDown,\n style,\n side = 'bottom',\n align = 'start',\n sideOffset = 8,\n alignOffset = 0,\n collisionPadding = 8,\n matchTriggerWidth = false,\n ...props\n },\n ref\n ) => {\n const { open, setOpen, contentId, wrapperRef, anchorRef, triggerRef } =\n React.useContext(PopoverContext);\n // The trigger may carry a consumer `id`; read the rendered element so the\n // dialog's label always points at something that exists.\n const labelledBy = triggerRef.current?.id || undefined;\n const contentRef = React.useRef<HTMLDivElement | null>(null);\n // Viewport coordinates measured from the anchor; the panel portals to\n // document.body with position:fixed so ancestor overflow can never clip it.\n const [pos, setPos] = React.useState<PositionResult | null>(null);\n const [width, setWidth] = React.useState<number | undefined>(undefined);\n\n const updatePosition = React.useCallback(() => {\n const anchorEl = anchorRef.current ?? wrapperRef.current;\n const panel = contentRef.current;\n if (!anchorEl || !panel) return;\n const anchor = rectOf(anchorEl);\n const measured = rectOf(panel);\n setWidth(matchTriggerWidth ? anchor.width : undefined);\n setPos(\n computePosition({\n anchor,\n content: { width: measured.width, height: measured.height },\n viewport: { width: window.innerWidth, height: window.innerHeight },\n side,\n align,\n sideOffset,\n alignOffset,\n collisionPadding,\n })\n );\n }, [\n align,\n alignOffset,\n anchorRef,\n collisionPadding,\n matchTriggerWidth,\n side,\n sideOffset,\n wrapperRef,\n ]);\n\n React.useLayoutEffect(() => {\n if (!open) {\n setPos(null);\n return;\n }\n updatePosition();\n }, [open, updatePosition]);\n\n // A panel that is already open on first mount measures before the wrapper's\n // ref is attached (child layout effects run first), so measure once more\n // when the refs exist.\n React.useEffect(() => {\n if (open && !pos) updatePosition();\n }, [open, pos, updatePosition]);\n\n // Keep the panel anchored while the page moves: reposition on scroll and\n // resize, and re-measure when the content itself changes size.\n React.useEffect(() => {\n if (!open) return;\n const onScroll = () => updatePosition();\n window.addEventListener('scroll', onScroll, true);\n window.addEventListener('resize', onScroll);\n const panel = contentRef.current;\n const observer =\n typeof ResizeObserver === 'undefined' || !panel ? null : new ResizeObserver(onScroll);\n if (panel && observer) observer.observe(panel);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n window.removeEventListener('resize', onScroll);\n observer?.disconnect();\n };\n }, [open, updatePosition]);\n\n // Close on outside click.\n React.useEffect(() => {\n if (!open) return;\n function onPointerDown(event: PointerEvent) {\n if (!contentRef.current?.contains(event.target as Node)) setOpen(false);\n }\n document.addEventListener('pointerdown', onPointerDown);\n return () => document.removeEventListener('pointerdown', onPointerDown);\n }, [open, setOpen]);\n\n // Focus the content when it opens so Escape reaches it. Depends on `pos`\n // because the panel only mounts once measured.\n React.useEffect(() => {\n if (open && pos && contentRef.current) {\n contentRef.current.focus();\n }\n }, [open, pos]);\n\n if (!open || typeof document === 'undefined') return null;\n\n return createPortal(\n <div\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n id={contentId}\n role=\"dialog\"\n aria-labelledby={labelledBy}\n tabIndex={-1}\n data-side={pos?.side ?? side}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.key === 'Escape') {\n event.stopPropagation();\n setOpen(false);\n // Escape must hand focus back, or it lands on <body>.\n (triggerRef.current ?? anchorRef.current)?.focus();\n }\n }}\n style={{\n position: 'fixed',\n top: pos?.top ?? 0,\n left: pos?.left ?? 0,\n width,\n visibility: pos ? 'visible' : 'hidden',\n zIndex: 50,\n ...style,\n }}\n className={cn(\n 'w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n className\n )}\n {...props}\n >\n {children}\n </div>,\n document.body\n );\n }\n);\nPopoverContent.displayName = 'PopoverContent';\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwEQ;AAtER,YAAuB;AACvB,uBAA6B;AAC7B,gBAAmB;AACnB,sBAA4E;AAe5E,MAAM,iBAAiB,MAAM,cAAmC;AAAA,EAC9D,MAAM;AAAA,EACN,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY,EAAE,SAAS,KAAK;AAAA,EAC5B,WAAW,EAAE,SAAS,KAAK;AAAA,EAC3B,YAAY,EAAE,SAAS,KAAK;AAC9B,CAAC;AAgBD,MAAM,UAAU,MAAM;AAAA,EACpB,CAAC,EAAE,MAAM,cAAc,WAAW,SAAS,GAAG,QAAQ;AACpD,UAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,KAAK;AAC5D,UAAM,UAAU,QAAQ;AACxB,UAAM,YAAY,MAAM,MAAM;AAC9B,UAAM,YAAY,MAAM,MAAM;AAC9B,UAAM,aAAa,MAAM,OAA8B,IAAI;AAC3D,UAAM,YAAY,MAAM,OAA2B,IAAI;AACvD,UAAM,aAAa,MAAM,OAAiC,IAAI;AAC9D,UAAM,UAAU,MAAM;AAAA,MACpB,CAAC,SAAgC;AAC/B,mBAAW,UAAU;AACrB,YAAI,OAAO,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