@jfrader/ui 0.4.0 → 0.5.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 (257) hide show
  1. package/README.md +2 -0
  2. package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
  3. package/dist/accordion.js +1 -1
  4. package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/announcement-bar-B58xempt.js +382 -0
  7. package/dist/announcement-bar.js +2 -0
  8. package/dist/avatar-group-DOQQuV51.js +138 -0
  9. package/dist/avatar-group.js +2 -0
  10. package/dist/bottom-sheet-DPJBFkie.js +673 -0
  11. package/dist/bottom-sheet.js +2 -0
  12. package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
  13. package/dist/breadcrumbs.js +1 -1
  14. package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
  15. package/dist/button.js +1 -1
  16. package/dist/calendar-B3Svu0X2.js +447 -0
  17. package/dist/calendar.js +1 -1
  18. package/dist/carousel-IvPqN-oM.js +472 -0
  19. package/dist/carousel.js +2 -0
  20. package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
  21. package/dist/checkbox.js +1 -1
  22. package/dist/chip-group-DTQd_M-G.js +289 -0
  23. package/dist/chip-group.js +2 -0
  24. package/dist/code-block/shiki.js +147 -0
  25. package/dist/code-block-ahnRi-g8.js +292 -0
  26. package/dist/code-block.js +2 -0
  27. package/dist/collection-registry-k6JcD3Jr.js +44 -0
  28. package/dist/combobox-Bhzvu9ma.js +334 -0
  29. package/dist/combobox.js +1 -1
  30. package/dist/command-palette-BQ5LleGb.js +384 -0
  31. package/dist/command-palette.js +1 -1
  32. package/dist/copy-button-ByiA6D3R.js +252 -0
  33. package/dist/copy-button.js +2 -0
  34. package/dist/countdown-Dp_TD1VP.js +293 -0
  35. package/dist/countdown.js +2 -0
  36. package/dist/date-picker-5zKSSuFF.js +255 -0
  37. package/dist/date-picker.js +1 -1
  38. package/dist/date-range-picker-B5uFWsm-.js +562 -0
  39. package/dist/date-range-picker.js +2 -0
  40. package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
  41. package/dist/dialog.js +1 -1
  42. package/dist/drawer-DsASTiP-.js +553 -0
  43. package/dist/drawer.js +2 -0
  44. package/dist/empty-state-CDgrjPPf.js +142 -0
  45. package/dist/empty-state.js +2 -0
  46. package/dist/expandable-card-C-qJcZ14.js +340 -0
  47. package/dist/expandable-card.js +2 -0
  48. package/dist/field-anatomy-COVdNpf5.js +84 -0
  49. package/dist/file-dropzone-pR4v7owg.js +457 -0
  50. package/dist/file-dropzone.js +2 -0
  51. package/dist/filter-toolbar-D5KEKTSe.js +312 -0
  52. package/dist/filter-toolbar.js +2 -0
  53. package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
  54. package/dist/hold-to-confirm.js +2 -0
  55. package/dist/hover-card-B-nrCIy2.js +347 -0
  56. package/dist/hover-card.js +2 -0
  57. package/dist/image-compare-ciuhPtQZ.js +415 -0
  58. package/dist/image-compare.js +2 -0
  59. package/dist/index.js +79 -38
  60. package/dist/inline-edit-C0eeml65.js +535 -0
  61. package/dist/inline-edit.js +2 -0
  62. package/dist/input-control-DmMuAuPS.js +34 -0
  63. package/dist/json-viewer-BcySQfjZ.js +798 -0
  64. package/dist/json-viewer.js +2 -0
  65. package/dist/listbox-style-WX-RASp1.js +59 -0
  66. package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
  67. package/dist/mention-input-BcQKX2EJ.js +599 -0
  68. package/dist/mention-input.js +2 -0
  69. package/dist/menu-xwOOUtWP.js +275 -0
  70. package/dist/menu.js +1 -1
  71. package/dist/metric-card-Bh9K4fZs.js +118 -0
  72. package/dist/metric-card.js +2 -0
  73. package/dist/multi-select-Pce_IYnz.js +590 -0
  74. package/dist/multi-select.js +2 -0
  75. package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
  76. package/dist/navigation.js +1 -1
  77. package/dist/overlay-layer-SeUyyEPD.js +64 -0
  78. package/dist/overlay-portal-C4JZFq2M.js +15 -0
  79. package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
  80. package/dist/pagination.js +1 -1
  81. package/dist/password-field-03pWRkuY.js +250 -0
  82. package/dist/password-field.js +2 -0
  83. package/dist/popover-QHcEvf9c.js +119 -0
  84. package/dist/popover.js +1 -1
  85. package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
  86. package/dist/progress.js +1 -1
  87. package/dist/radio-cards-D2QZENI_.js +455 -0
  88. package/dist/radio-cards.js +2 -0
  89. package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
  90. package/dist/radio-group.js +1 -1
  91. package/dist/resizable-panels-BhjUVXZZ.js +519 -0
  92. package/dist/resizable-panels.js +2 -0
  93. package/dist/scroll-area-CcZyiSOQ.js +371 -0
  94. package/dist/scroll-area.js +2 -0
  95. package/dist/search-field-IxF0IJXm.js +274 -0
  96. package/dist/search-field.js +2 -0
  97. package/dist/segmented-control-yO1K1nbi.js +326 -0
  98. package/dist/segmented-control.js +2 -0
  99. package/dist/select-n_H52W1Z.js +292 -0
  100. package/dist/select.js +1 -1
  101. package/dist/signature-pad-q2SAsrdD.js +640 -0
  102. package/dist/signature-pad.js +2 -0
  103. package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
  104. package/dist/skeleton.js +1 -1
  105. package/dist/slider-t0B5cecO.js +477 -0
  106. package/dist/slider.js +2 -0
  107. package/dist/sortable-data-table-tirqlLY2.js +365 -0
  108. package/dist/sortable-data-table.js +2 -0
  109. package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
  110. package/dist/spinner.js +1 -1
  111. package/dist/split-button-Cb3EHs64.js +268 -0
  112. package/dist/split-button.js +2 -0
  113. package/dist/stepper-CruHbXxX.js +480 -0
  114. package/dist/stepper.js +2 -0
  115. package/dist/swipe-actions-DiZC57-3.js +418 -0
  116. package/dist/swipe-actions.js +2 -0
  117. package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
  118. package/dist/switch.js +1 -1
  119. package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
  120. package/dist/tabs.js +1 -1
  121. package/dist/tag-input-DSRCyrX2.js +418 -0
  122. package/dist/tag-input.js +2 -0
  123. package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
  124. package/dist/text-field.js +1 -1
  125. package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
  126. package/dist/textarea.js +1 -1
  127. package/dist/time-picker-Db8D49cP.js +305 -0
  128. package/dist/time-picker.js +2 -0
  129. package/dist/timeline-k3nURuCP.js +618 -0
  130. package/dist/timeline.js +2 -0
  131. package/dist/toast-BHxI32ZA.js +352 -0
  132. package/dist/toast-stack-DqrAzdg5.js +183 -0
  133. package/dist/toast-stack.js +2 -0
  134. package/dist/toast.js +1 -1
  135. package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
  136. package/dist/toggle-group.js +1 -1
  137. package/dist/tooltip-CkeiW9C1.js +113 -0
  138. package/dist/tooltip.js +1 -1
  139. package/dist/tree-view-C2liIxqy.js +360 -0
  140. package/dist/tree-view.js +2 -0
  141. package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
  142. package/dist/types/components/announcement-bar/index.d.ts +2 -0
  143. package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
  144. package/dist/types/components/avatar-group/index.d.ts +2 -0
  145. package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
  146. package/dist/types/components/bottom-sheet/index.d.ts +2 -0
  147. package/dist/types/components/calendar/calendar.d.ts +25 -1
  148. package/dist/types/components/calendar/index.d.ts +1 -1
  149. package/dist/types/components/carousel/carousel.d.ts +73 -0
  150. package/dist/types/components/carousel/index.d.ts +2 -0
  151. package/dist/types/components/chip-group/chip-group.d.ts +54 -0
  152. package/dist/types/components/chip-group/index.d.ts +1 -0
  153. package/dist/types/components/code-block/code-block.d.ts +58 -0
  154. package/dist/types/components/code-block/index.d.ts +1 -0
  155. package/dist/types/components/code-block/shiki.d.ts +3 -0
  156. package/dist/types/components/combobox/combobox.d.ts +1 -1
  157. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  158. package/dist/types/components/copy-button/copy-button.d.ts +49 -0
  159. package/dist/types/components/copy-button/index.d.ts +2 -0
  160. package/dist/types/components/countdown/countdown.d.ts +37 -0
  161. package/dist/types/components/countdown/index.d.ts +1 -0
  162. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  163. package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
  164. package/dist/types/components/date-range-picker/index.d.ts +2 -0
  165. package/dist/types/components/drawer/drawer.d.ts +59 -0
  166. package/dist/types/components/drawer/index.d.ts +2 -0
  167. package/dist/types/components/empty-state/empty-state.d.ts +36 -0
  168. package/dist/types/components/empty-state/index.d.ts +2 -0
  169. package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
  170. package/dist/types/components/expandable-card/index.d.ts +2 -0
  171. package/dist/types/components/field/field-anatomy.d.ts +4 -2
  172. package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
  173. package/dist/types/components/file-dropzone/index.d.ts +2 -0
  174. package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
  175. package/dist/types/components/filter-toolbar/index.d.ts +1 -0
  176. package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
  177. package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
  178. package/dist/types/components/hover-card/hover-card.d.ts +97 -0
  179. package/dist/types/components/hover-card/index.d.ts +2 -0
  180. package/dist/types/components/image-compare/image-compare.d.ts +54 -0
  181. package/dist/types/components/image-compare/index.d.ts +1 -0
  182. package/dist/types/components/inline-edit/index.d.ts +2 -0
  183. package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
  184. package/dist/types/components/json-viewer/index.d.ts +2 -0
  185. package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
  186. package/dist/types/components/mention-input/index.d.ts +2 -0
  187. package/dist/types/components/mention-input/mention-input.d.ts +87 -0
  188. package/dist/types/components/menu/menu.d.ts +23 -5
  189. package/dist/types/components/metric-card/index.d.ts +1 -0
  190. package/dist/types/components/metric-card/metric-card.d.ts +37 -0
  191. package/dist/types/components/multi-select/index.d.ts +2 -0
  192. package/dist/types/components/multi-select/multi-select.d.ts +73 -0
  193. package/dist/types/components/password-field/index.d.ts +2 -0
  194. package/dist/types/components/password-field/password-field.d.ts +34 -0
  195. package/dist/types/components/popover/popover.d.ts +1 -1
  196. package/dist/types/components/radio-cards/index.d.ts +1 -0
  197. package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
  198. package/dist/types/components/resizable-panels/index.d.ts +2 -0
  199. package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
  200. package/dist/types/components/scroll-area/index.d.ts +2 -0
  201. package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
  202. package/dist/types/components/search-field/index.d.ts +1 -0
  203. package/dist/types/components/search-field/search-field.d.ts +31 -0
  204. package/dist/types/components/segmented-control/index.d.ts +2 -0
  205. package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
  206. package/dist/types/components/select/select.d.ts +1 -1
  207. package/dist/types/components/signature-pad/index.d.ts +2 -0
  208. package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
  209. package/dist/types/components/slider/index.d.ts +1 -0
  210. package/dist/types/components/slider/slider.d.ts +70 -0
  211. package/dist/types/components/sortable-data-table/index.d.ts +1 -0
  212. package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
  213. package/dist/types/components/split-button/index.d.ts +2 -0
  214. package/dist/types/components/split-button/split-button.d.ts +55 -0
  215. package/dist/types/components/stepper/index.d.ts +2 -0
  216. package/dist/types/components/stepper/stepper.d.ts +85 -0
  217. package/dist/types/components/swipe-actions/index.d.ts +2 -0
  218. package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
  219. package/dist/types/components/tag-input/index.d.ts +2 -0
  220. package/dist/types/components/tag-input/tag-input.d.ts +66 -0
  221. package/dist/types/components/time-picker/index.d.ts +2 -0
  222. package/dist/types/components/time-picker/time-picker.d.ts +48 -0
  223. package/dist/types/components/timeline/index.d.ts +2 -0
  224. package/dist/types/components/timeline/timeline.d.ts +66 -0
  225. package/dist/types/components/toast/toast.d.ts +37 -2
  226. package/dist/types/components/toast-stack/index.d.ts +2 -0
  227. package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
  228. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  229. package/dist/types/components/tree-view/index.d.ts +1 -0
  230. package/dist/types/components/tree-view/tree-view.d.ts +47 -0
  231. package/dist/types/components/usage-meter/index.d.ts +2 -0
  232. package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
  233. package/dist/types/index.d.ts +40 -0
  234. package/dist/types/overlay/overlay-layer.d.ts +33 -0
  235. package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
  236. package/dist/types/styling/media.d.ts +1 -0
  237. package/dist/types/styling/theme.d.ts +12 -0
  238. package/dist/types/utils/use-controlled-state.d.ts +2 -1
  239. package/dist/usage-meter-qyQ3rYVv.js +463 -0
  240. package/dist/usage-meter.js +2 -0
  241. package/dist/use-controlled-state-DpeVQZNR.js +20 -0
  242. package/dist/use-latest-callback-cj1OOQL6.js +11 -0
  243. package/dist/use-overlay-floating-DvJifLpF.js +31 -0
  244. package/package.json +175 -3
  245. package/dist/calendar-C9Yad_-w.js +0 -394
  246. package/dist/collection-registry-BTYi6zGh.js +0 -98
  247. package/dist/combobox-DiMC2g_u.js +0 -327
  248. package/dist/command-palette-V_2pEay7.js +0 -379
  249. package/dist/date-picker-C29Uo4Tx.js +0 -250
  250. package/dist/field-anatomy-D2ToMeRa.js +0 -109
  251. package/dist/menu-CGPTNRnF.js +0 -216
  252. package/dist/popover-CdRXjQqI.js +0 -113
  253. package/dist/select-BgG7WgSh.js +0 -286
  254. package/dist/toast-CjmELMZZ.js +0 -283
  255. package/dist/tooltip-CaL3rKbV.js +0 -108
  256. package/dist/use-controlled-state-CVXDa-qM.js +0 -21
  257. package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
@@ -0,0 +1,618 @@
1
+ 'use client';
2
+ import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
3
+ import { t as r } from "./disclosure-caret-C5T3fcl6.js";
4
+ import { t as i } from "./focus-ring-BK5W5_NY.js";
5
+ import { n as a, r as o } from "./media-8yrN85VT.js";
6
+ import { r as s } from "./roving-focus-CYlo_Kf8.js";
7
+ import { t as c } from "./use-controlled-state-DpeVQZNR.js";
8
+ import { t as l } from "./visually-hidden-BJdvqqvn.js";
9
+ import { t as u } from "./renderable-DzcIj1Lo.js";
10
+ import { t as d } from "./icon-wrapper-stN8sD7R.js";
11
+ import { t as f } from "./avatar-BahDVO9t.js";
12
+ import { t as p } from "./part-id-D0zksy32.js";
13
+ import { useEffect as ee, useId as te, useLayoutEffect as ne, useMemo as m, useRef as h, useState as re } from "react";
14
+ import { vars as g } from "@jfrader/tokens/vars";
15
+ import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
16
+ import { useMergeRefs as ie } from "@floating-ui/react";
17
+ //#region src/components/timeline/timeline.tsx
18
+ var y = "UTC", b = "invalid", ae = [], x = 864e13, oe = 1e3, S = 864e5, se = [
19
+ ["second", 60],
20
+ ["minute", 60],
21
+ ["hour", 24]
22
+ ], ce = /^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:\d{2})$/, C = "en-US", w = {
23
+ itemSelector: "[data-ui=\"timeline-item\"]",
24
+ ownerSelector: "[data-ui=\"timeline\"]"
25
+ }, T = {
26
+ itemSelector: "[data-ui=\"timeline-trigger\"]",
27
+ ownerSelector: "[data-ui=\"timeline\"]"
28
+ }, le = {
29
+ ArrowDown: (e, t) => Math.min(e + 1, t - 1),
30
+ ArrowUp: (e) => Math.max(e - 1, 0),
31
+ Home: () => 0,
32
+ End: (e, t) => t - 1
33
+ }, E = (e) => u(e) && e !== "", D = (e) => Number.isFinite(e) && Math.abs(e) <= x;
34
+ function O(e) {
35
+ if (typeof e == "number") return D(e) ? e : null;
36
+ if (e instanceof Date) return D(e.getTime()) ? e.getTime() : null;
37
+ let t = ce.exec(e);
38
+ if (!t) return null;
39
+ let [n, r, i] = t.slice(1, 4).map(Number), a = new Date(Date.UTC(n, r - 1, i));
40
+ if (a.getUTCMonth() !== r - 1 || a.getUTCDate() !== i) return null;
41
+ let o = Date.parse(e);
42
+ return D(o) ? o : null;
43
+ }
44
+ function k(e, t) {
45
+ return {
46
+ dayParts: new Intl.DateTimeFormat(C, {
47
+ timeZone: t,
48
+ calendar: "gregory",
49
+ numberingSystem: "latn",
50
+ year: "numeric",
51
+ month: "2-digit",
52
+ day: "2-digit"
53
+ }),
54
+ day: new Intl.DateTimeFormat(e, {
55
+ timeZone: t,
56
+ dateStyle: "full"
57
+ }),
58
+ full: new Intl.DateTimeFormat(e, {
59
+ timeZone: t,
60
+ dateStyle: "full",
61
+ timeStyle: "long"
62
+ }),
63
+ clock: new Intl.DateTimeFormat(e, {
64
+ timeZone: t,
65
+ timeStyle: "short"
66
+ }),
67
+ relative: new Intl.RelativeTimeFormat(e, { numeric: "auto" }),
68
+ number: new Intl.NumberFormat(e),
69
+ plural: new Intl.PluralRules(e)
70
+ };
71
+ }
72
+ function ue(e, t) {
73
+ let n = [], r = e;
74
+ try {
75
+ Intl.getCanonicalLocales(e);
76
+ } catch {
77
+ n.push(`Timeline: locale ${JSON.stringify(String(e))} is not a valid language tag; using the default locale.`), r = void 0;
78
+ }
79
+ let i = t;
80
+ try {
81
+ new Intl.DateTimeFormat(C, { timeZone: t });
82
+ } catch {
83
+ n.push(`Timeline: timeZone ${JSON.stringify(t)} is not a valid IANA time zone; using ${y}.`), i = y;
84
+ }
85
+ return {
86
+ formatters: k(r, i),
87
+ problems: n
88
+ };
89
+ }
90
+ function A(e, t) {
91
+ let n = Object.fromEntries(e.formatToParts(t).map(({ type: e, value: t }) => [e, t]));
92
+ return `${n.year.padStart(4, "0")}-${n.month}-${n.day}`;
93
+ }
94
+ var j = (e) => Date.parse(`${e}T00:00:00Z`) / S;
95
+ function de(e, t, n) {
96
+ let r = e.map((e, t) => ({
97
+ event: e,
98
+ order: t,
99
+ epoch: O(e.at)
100
+ }));
101
+ r.sort((e, t) => e.epoch === null || t.epoch === null ? e.epoch === t.epoch ? e.order - t.order : e.epoch === null ? 1 : -1 : t.epoch - e.epoch || e.order - t.order);
102
+ let i = n === null ? null : j(A(t, n)), a = [];
103
+ for (let e of r) {
104
+ let n = e.epoch === null ? b : A(t, e.epoch), r = a.at(-1);
105
+ if (r?.key === n) {
106
+ r.rows.push(e);
107
+ continue;
108
+ }
109
+ let o = e.epoch === null || i === null ? null : j(n) - i;
110
+ a.push({
111
+ key: n,
112
+ distance: o,
113
+ epoch: e.epoch,
114
+ rows: [e]
115
+ });
116
+ }
117
+ return a;
118
+ }
119
+ function fe(e) {
120
+ let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
121
+ for (let r of e) (t.has(r) ? n : t).add(r);
122
+ return [...n];
123
+ }
124
+ var pe = (e) => JSON.stringify([...new Set(e)].sort());
125
+ function me(e, t, n, r) {
126
+ let i = (e - t) / oe;
127
+ for (let [e, t] of se) {
128
+ if (Math.abs(i) < t) return r.relative.format(Math.trunc(i), e);
129
+ i /= t;
130
+ }
131
+ return r.relative.format(n, "day");
132
+ }
133
+ function he(e, t, n) {
134
+ return e.epoch === null ? n.invalidTime : e.distance !== null && Math.abs(e.distance) <= 1 ? t.relative.format(e.distance, "day") : t.day.format(e.epoch);
135
+ }
136
+ function ge(e) {
137
+ let t = (t, n, r) => `${e.number.format(t)} ${e.plural.select(t) === "one" ? n : r}`;
138
+ return {
139
+ region: "Activity",
140
+ empty: "No activity yet",
141
+ invalidTime: "Unknown time",
142
+ newEvents: (e) => t(e, "new event", "new events"),
143
+ dayCount: (e) => t(e, "event", "events")
144
+ };
145
+ }
146
+ var M = "(prefers-reduced-motion: reduce)", _e = (e) => e.ownerDocument.defaultView?.matchMedia(M).matches ?? !1, N = e({
147
+ from: { opacity: 0 },
148
+ to: { opacity: 1 }
149
+ }), ve = t({
150
+ position: "relative",
151
+ minInlineSize: 0,
152
+ fontFamily: g.font.sans,
153
+ fontSize: g.textSize.sm,
154
+ lineHeight: g.lineHeight.base,
155
+ color: g.color.text
156
+ }), ye = {
157
+ sm: t({
158
+ "--timeline-row-gap": g.space[2],
159
+ "--timeline-heading-pad": g.space[1],
160
+ "--timeline-trigger-pad": g.space[1]
161
+ }),
162
+ md: t({
163
+ "--timeline-row-gap": g.space[4],
164
+ "--timeline-heading-pad": g.space[2],
165
+ "--timeline-trigger-pad": g.space[2]
166
+ })
167
+ }, be = t({
168
+ "&[data-bounded]": {
169
+ overflowY: "auto",
170
+ overscrollBehavior: "contain",
171
+ overflowAnchor: "none",
172
+ scrollPaddingBlockStart: g.space[10]
173
+ },
174
+ "&:focus-visible": { ...i }
175
+ }), xe = t({ "& + &": { marginBlockStart: "var(--timeline-row-gap)" } }), Se = t({
176
+ position: "sticky",
177
+ insetBlockStart: 0,
178
+ zIndex: 1,
179
+ display: "flex",
180
+ flexWrap: "wrap",
181
+ alignItems: "baseline",
182
+ columnGap: g.space[2],
183
+ margin: 0,
184
+ marginBlockEnd: g.space[2],
185
+ paddingBlock: "var(--timeline-heading-pad)",
186
+ backgroundColor: g.color.surface,
187
+ fontSize: g.textSize.sm,
188
+ fontWeight: g.fontWeight.semibold,
189
+ color: g.color.text
190
+ }), Ce = t({
191
+ fontSize: g.textSize.xs,
192
+ fontWeight: g.fontWeight.regular,
193
+ color: g.color.textMuted
194
+ }), we = t({
195
+ listStyle: "none",
196
+ margin: 0,
197
+ padding: 0
198
+ }), Te = t({
199
+ position: "relative",
200
+ display: "grid",
201
+ gridTemplateColumns: `${g.space[6]} minmax(0, 1fr)`,
202
+ columnGap: g.space[3],
203
+ paddingBlockEnd: "var(--timeline-row-gap)",
204
+ "&::before": {
205
+ content: "\"\"",
206
+ position: "absolute",
207
+ insetBlockStart: g.space[6],
208
+ insetBlockEnd: 0,
209
+ insetInlineStart: `calc(${g.space[6]} / 2 - 1px)`,
210
+ borderInlineStart: `2px solid ${g.color.border}`
211
+ },
212
+ "&:last-child::before": { content: "none" },
213
+ "&[data-new]": {
214
+ animationName: N,
215
+ animationDuration: g.motion.duration.base,
216
+ animationTimingFunction: g.motion.easeStandard
217
+ },
218
+ [o]: { "&[data-new]": { animation: "none" } },
219
+ [a]: { "&::before": { borderInlineStartColor: "GrayText" } }
220
+ }), P = t({
221
+ boxSizing: "border-box",
222
+ display: "flex",
223
+ alignItems: "center",
224
+ justifyContent: "center",
225
+ inlineSize: g.space[6],
226
+ blockSize: g.space[6],
227
+ borderRadius: g.radius.full,
228
+ border: `1px solid ${g.color.borderStrong}`,
229
+ backgroundColor: g.color.surface,
230
+ color: g.color.textMuted,
231
+ overflow: "hidden",
232
+ fontSize: g.textSize.xs,
233
+ "&[data-kind=\"avatar\"]": { border: 0 },
234
+ [a]: {
235
+ borderColor: "CanvasText",
236
+ color: "CanvasText"
237
+ }
238
+ }), F = {
239
+ neutral: t({}),
240
+ success: t({
241
+ borderColor: g.color.success,
242
+ color: g.color.success
243
+ }),
244
+ danger: t({
245
+ borderColor: g.color.dangerText,
246
+ color: g.color.dangerText
247
+ })
248
+ }, I = t({
249
+ inlineSize: g.space[2],
250
+ blockSize: g.space[2],
251
+ borderRadius: g.radius.full,
252
+ backgroundColor: "currentColor",
253
+ [a]: {
254
+ backgroundColor: "CanvasText",
255
+ forcedColorAdjust: "none"
256
+ }
257
+ }), Ee = t({
258
+ minInlineSize: 0,
259
+ display: "flex",
260
+ flexWrap: "wrap",
261
+ alignItems: "baseline",
262
+ columnGap: g.space[3],
263
+ rowGap: g.space[1]
264
+ }), De = t({
265
+ flex: "1 1 0",
266
+ minInlineSize: "fit-content",
267
+ maxInlineSize: "100%",
268
+ display: "grid",
269
+ rowGap: g.space[1],
270
+ overflowWrap: "anywhere"
271
+ }), Oe = t({
272
+ display: "flex",
273
+ flexWrap: "wrap",
274
+ alignItems: "baseline",
275
+ columnGap: g.space[1],
276
+ minBlockSize: g.space[6]
277
+ }), ke = t({ fontWeight: g.fontWeight.semibold }), Ae = t({ fontWeight: g.fontWeight.medium }), je = t({
278
+ appearance: "none",
279
+ boxSizing: "border-box",
280
+ display: "inline-flex",
281
+ alignItems: "center",
282
+ gap: g.space[2],
283
+ maxInlineSize: "100%",
284
+ minBlockSize: g.space[8],
285
+ margin: 0,
286
+ paddingBlock: g.space[1],
287
+ paddingInline: "var(--timeline-trigger-pad)",
288
+ border: "1px solid transparent",
289
+ borderRadius: g.radius.sm,
290
+ background: "transparent",
291
+ font: "inherit",
292
+ fontWeight: g.fontWeight.medium,
293
+ color: g.color.text,
294
+ textAlign: "start",
295
+ overflowWrap: "anywhere",
296
+ cursor: "pointer",
297
+ transitionProperty: "background-color",
298
+ transitionDuration: g.motion.duration.fast,
299
+ transitionTimingFunction: g.motion.easeStandard,
300
+ "&::after": {
301
+ ...r,
302
+ transitionDuration: g.motion.duration.fast
303
+ },
304
+ "&[aria-expanded=\"true\"]::after": { transform: "rotate(90deg)" },
305
+ "&[aria-expanded=\"true\"]:dir(rtl)::after": { transform: "rotate(-90deg)" },
306
+ "&:hover": { backgroundColor: g.color.surfaceHover },
307
+ "&:focus-visible": { ...i },
308
+ [o]: {
309
+ transitionDuration: "0s",
310
+ "&::after": { transitionDuration: "0s" }
311
+ },
312
+ [a]: { "&:focus-visible": { outlineColor: "Highlight" } }
313
+ }), Me = t({
314
+ fontSize: g.textSize.xs,
315
+ color: g.color.textMuted
316
+ }), Ne = t({
317
+ flexShrink: 0,
318
+ fontSize: g.textSize.xs,
319
+ color: g.color.textMuted,
320
+ fontVariantNumeric: "tabular-nums",
321
+ whiteSpace: "nowrap"
322
+ }), Pe = t({
323
+ gridColumn: 2,
324
+ marginBlockStart: g.space[2],
325
+ paddingBlock: g.space[3],
326
+ paddingInline: g.space[3],
327
+ border: `1px solid ${g.color.border}`,
328
+ borderRadius: g.radius.md,
329
+ backgroundColor: g.color.surface,
330
+ color: g.color.text,
331
+ lineHeight: g.lineHeight.relaxed,
332
+ overflowWrap: "anywhere",
333
+ "&[hidden]": { display: "none" }
334
+ }), Fe = t({
335
+ margin: 0,
336
+ paddingBlock: g.space[4],
337
+ color: g.color.textMuted
338
+ });
339
+ function Ie({ event: e, part: t }) {
340
+ let n = e.tone ?? "neutral", r = e.avatar ? "avatar" : E(e.icon) ? "icon" : e.actor ? "avatar" : "dot", i = {
341
+ avatar: /* @__PURE__ */ _(f, {
342
+ name: e.actor ?? "",
343
+ src: e.avatar,
344
+ size: "sm"
345
+ }),
346
+ icon: /* @__PURE__ */ _("span", {
347
+ css: d,
348
+ children: e.icon
349
+ }),
350
+ dot: /* @__PURE__ */ _("span", { css: I })
351
+ }[r];
352
+ return /* @__PURE__ */ _("span", {
353
+ "aria-hidden": "true",
354
+ "data-ui": "timeline-marker",
355
+ "data-kind": r,
356
+ "data-tone": n,
357
+ className: t?.className,
358
+ css: [
359
+ P,
360
+ F[n],
361
+ t?.css
362
+ ],
363
+ children: i
364
+ });
365
+ }
366
+ function L({ ref: e, events: t, now: r, value: i, defaultValue: a, onValueChange: o, locale: u, timeZone: d = y, headingLevel: f = 3, maxHeight: g, scrollToNew: b = !1, size: x = "md", labels: oe, slotProps: S, className: se, sx: ce, onKeyDown: C, onFocus: O, onBlur: k, "aria-label": A, "aria-labelledby": j, "aria-describedby": M, ...N }) {
367
+ let P = te(), F = h(null), I = h(null), L = ie([e, F]), R = g !== void 0, z = D(r) ? r : null, { formatters: B, problems: Le } = m(() => ue(u, d), [u, d]), V = {
368
+ ...ge(B),
369
+ ...oe
370
+ }, H = m(() => de(t, B.dayParts, z), [
371
+ t,
372
+ B,
373
+ z
374
+ ]), U = m(() => H.flatMap((e) => e.rows.map((e) => e.event.id)), [H]), W = H[0]?.epoch ?? null, [G = ae, Re] = c(i, a ?? ae, (e) => o?.([...e])), ze = new Set(G), Be = pe(G), K = h(null);
375
+ ne(() => {
376
+ K.current = null;
377
+ }, [Be]);
378
+ let Ve = (e) => {
379
+ let t = ze.has(e) ? G.filter((t) => t !== e) : [...G, e], n = pe(t);
380
+ n !== Be && n !== K.current && (K.current = n, Re(t));
381
+ }, q = h(null), J = h(null), Y = h(null), [X, He] = re({
382
+ text: "",
383
+ key: 0
384
+ }), Ue = m(() => {
385
+ let e = q.current?.ids;
386
+ return new Set(e ? U.filter((t) => !e.has(t)) : []);
387
+ }, [U]), We = () => F.current ? s(F.current, w) : [], Z = () => {
388
+ let e = I.current;
389
+ if (!R || !e) {
390
+ J.current = null;
391
+ return;
392
+ }
393
+ let t = e.getBoundingClientRect().top, n = e.ownerDocument.activeElement, r = (n && e.contains(n) ? n.closest(w.itemSelector) : null) ?? (e.scrollTop > 0 ? We().find((e) => e.getBoundingClientRect().bottom > t) : void 0);
394
+ J.current = r ? {
395
+ id: r.dataset.eventId,
396
+ top: r.getBoundingClientRect().top - t
397
+ } : null;
398
+ };
399
+ ne(() => {
400
+ let e = F.current, t = I.current, n = q.current;
401
+ if (q.current = {
402
+ ids: new Set(U),
403
+ order: U,
404
+ newestEpoch: W
405
+ }, !e || !t || !n) {
406
+ Z();
407
+ return;
408
+ }
409
+ let r = We(), i = (e) => r.find((t) => t.dataset.eventId === e), a = e.ownerDocument, o = Y.current, c = a.activeElement;
410
+ if (o && !o.element.isConnected && !q.current.ids.has(o.id) && (!c || c === a.body)) {
411
+ Y.current = null;
412
+ let t = new Set(s(e, T)), r = n.order.indexOf(o.id), a = (e) => {
413
+ let n = e === void 0 ? void 0 : i(e)?.querySelector(T.itemSelector);
414
+ return n && t.has(n) ? n : void 0;
415
+ };
416
+ for (let e = 1; e < n.order.length; e++) {
417
+ let t = a(n.order[r + e]) ?? a(n.order[r - e]);
418
+ if (t) {
419
+ t.focus();
420
+ break;
421
+ }
422
+ }
423
+ }
424
+ let l = e.contains(a.activeElement), u = W !== null && (n.newestEpoch === null || W > n.newestEpoch);
425
+ if (b && u && !l) i(U[0])?.closest("[data-ui=\"timeline-group\"]")?.scrollIntoView({
426
+ block: "nearest",
427
+ behavior: _e(e) ? "instant" : "smooth"
428
+ });
429
+ else if (R && J.current) {
430
+ let e = i(J.current.id);
431
+ if (e) {
432
+ let n = e.getBoundingClientRect().top - t.getBoundingClientRect().top - J.current.top;
433
+ n !== 0 && (t.scrollTop += n);
434
+ }
435
+ }
436
+ Z();
437
+ let d = U.filter((e) => !n.ids.has(e));
438
+ d.length > 0 && He((e) => ({
439
+ text: V.newEvents(d.length),
440
+ key: e.key + 1
441
+ }));
442
+ }, [U, R]);
443
+ let Ge = fe(U), Q = [
444
+ ...Le,
445
+ ...z === null ? [`Timeline: now ${String(r)} is not a finite epoch-ms value; showing absolute times.`] : [],
446
+ ...Ge.length > 0 ? [`Timeline: duplicate event ids ${JSON.stringify(Ge)}.`] : []
447
+ ].join("\n");
448
+ ee(() => {
449
+ process.env.NODE_ENV !== "production" && Q !== "" && console.error(Q);
450
+ }, [Q]);
451
+ let Ke = (e) => {
452
+ if (C?.(e), e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
453
+ let t = le[e.key];
454
+ if (!t) return;
455
+ let n = s(e.currentTarget, T), r = n.indexOf(e.target);
456
+ r !== -1 && (e.preventDefault(), n[t(r, n.length)]?.focus());
457
+ }, qe = (e) => {
458
+ O?.(e);
459
+ let t = e.target.closest(w.itemSelector);
460
+ Y.current = t?.closest(w.ownerSelector) === e.currentTarget ? {
461
+ element: e.target,
462
+ id: t.dataset.eventId
463
+ } : null, Z();
464
+ }, Je = (e) => {
465
+ if (k?.(e), e.currentTarget.contains(e.relatedTarget)) return;
466
+ let { target: t } = e;
467
+ queueMicrotask(() => {
468
+ t.isConnected && Y.current?.element === t && (Y.current = null);
469
+ });
470
+ }, Ye = t.length === 0, Xe = `${P}-empty`, Ze = `h${f}`, $ = {
471
+ "aria-label": A ?? (j ? void 0 : V.region),
472
+ "aria-labelledby": j
473
+ }, Qe = [M, Ye ? Xe : void 0].filter(Boolean).join(" ") || void 0;
474
+ return /* @__PURE__ */ _(n, {
475
+ className: se,
476
+ styles: [ve, ye[x]],
477
+ sx: ce,
478
+ children: (e) => /* @__PURE__ */ v("div", {
479
+ ...N,
480
+ ref: L,
481
+ role: "region",
482
+ ...$,
483
+ "aria-describedby": Qe,
484
+ "data-ui": "timeline",
485
+ "data-size": x,
486
+ onKeyDown: Ke,
487
+ onFocus: qe,
488
+ onBlur: Je,
489
+ className: e,
490
+ children: [/* @__PURE__ */ _("div", {
491
+ ref: I,
492
+ "data-ui": "timeline-scroller",
493
+ "data-bounded": R ? "" : void 0,
494
+ ...R ? {
495
+ tabIndex: 0,
496
+ role: "group",
497
+ ...$
498
+ } : void 0,
499
+ style: R ? { maxBlockSize: g } : void 0,
500
+ onScroll: Z,
501
+ className: S?.scroller?.className,
502
+ css: [be, S?.scroller?.css],
503
+ children: Ye ? /* @__PURE__ */ _("p", {
504
+ id: Xe,
505
+ "data-ui": "timeline-empty",
506
+ css: Fe,
507
+ children: V.empty
508
+ }) : H.map((e) => {
509
+ let t = p(P, "day", e.key);
510
+ return /* @__PURE__ */ v("section", {
511
+ role: "group",
512
+ "aria-labelledby": t,
513
+ "data-ui": "timeline-group",
514
+ "data-day": e.key,
515
+ className: S?.group?.className,
516
+ css: [xe, S?.group?.css],
517
+ children: [/* @__PURE__ */ v(Ze, {
518
+ id: t,
519
+ "data-ui": "timeline-heading",
520
+ className: S?.heading?.className,
521
+ css: [Se, S?.heading?.css],
522
+ children: [e.epoch === null ? /* @__PURE__ */ _("span", { children: he(e, B, V) }) : /* @__PURE__ */ _("time", {
523
+ dateTime: e.key,
524
+ children: he(e, B, V)
525
+ }), /* @__PURE__ */ _("span", {
526
+ css: Ce,
527
+ children: V.dayCount(e.rows.length)
528
+ })]
529
+ }), /* @__PURE__ */ _("ol", {
530
+ "data-ui": "timeline-list",
531
+ className: S?.list?.className,
532
+ css: [we, S?.list?.css],
533
+ children: e.rows.map(({ event: t, epoch: n }) => {
534
+ let r = E(t.detail), i = r && ze.has(t.id), a = p(P, "detail", t.id), o = p(P, "when", t.id), s = r ? /* @__PURE__ */ _("button", {
535
+ type: "button",
536
+ "data-ui": "timeline-trigger",
537
+ "aria-expanded": i,
538
+ "aria-controls": a,
539
+ "aria-describedby": n === null ? void 0 : o,
540
+ onClick: () => Ve(t.id),
541
+ className: S?.trigger?.className,
542
+ css: [je, S?.trigger?.css],
543
+ children: t.title
544
+ }) : /* @__PURE__ */ _("span", {
545
+ "data-ui": "timeline-title",
546
+ css: Ae,
547
+ children: t.title
548
+ });
549
+ return /* @__PURE__ */ v("li", {
550
+ "data-ui": "timeline-item",
551
+ "data-event-id": t.id,
552
+ "data-tone": t.tone ?? "neutral",
553
+ "data-state": r ? i ? "open" : "closed" : void 0,
554
+ "data-new": Ue.has(t.id) ? "" : void 0,
555
+ className: S?.item?.className,
556
+ css: [Te, S?.item?.css],
557
+ children: [
558
+ /* @__PURE__ */ _(Ie, {
559
+ event: t,
560
+ part: S?.marker
561
+ }),
562
+ /* @__PURE__ */ v("div", {
563
+ css: Ee,
564
+ children: [/* @__PURE__ */ v("div", {
565
+ css: De,
566
+ children: [/* @__PURE__ */ v("div", {
567
+ css: Oe,
568
+ children: [t.actor ? /* @__PURE__ */ _("span", {
569
+ "data-ui": "timeline-actor",
570
+ css: ke,
571
+ children: t.actor
572
+ }) : null, s]
573
+ }), E(t.meta) ? /* @__PURE__ */ _("div", {
574
+ "data-ui": "timeline-meta",
575
+ css: Me,
576
+ children: t.meta
577
+ }) : null]
578
+ }), n === null ? null : /* @__PURE__ */ v("time", {
579
+ dateTime: new Date(n).toISOString(),
580
+ "data-ui": "timeline-time",
581
+ className: S?.time?.className,
582
+ css: [Ne, S?.time?.css],
583
+ children: [z === null ? B.clock.format(n) : me(n, z, e.distance ?? 0, B), /* @__PURE__ */ _("span", {
584
+ id: o,
585
+ css: l,
586
+ children: B.full.format(n)
587
+ })]
588
+ })]
589
+ }),
590
+ r ? /* @__PURE__ */ _("div", {
591
+ id: a,
592
+ hidden: !i,
593
+ "data-ui": "timeline-detail",
594
+ "data-state": i ? "open" : "closed",
595
+ className: S?.detail?.className,
596
+ css: [Pe, S?.detail?.css],
597
+ children: t.detail
598
+ }) : null
599
+ ]
600
+ }, t.id);
601
+ })
602
+ })]
603
+ }, e.key);
604
+ })
605
+ }), /* @__PURE__ */ _("div", {
606
+ role: "status",
607
+ "aria-atomic": "true",
608
+ "data-ui": "timeline-status",
609
+ className: S?.status?.className,
610
+ css: [l, S?.status?.css],
611
+ children: X.text ? /* @__PURE__ */ _("span", { children: X.text }, X.key) : null
612
+ })]
613
+ })
614
+ });
615
+ }
616
+ L.displayName = "Timeline";
617
+ //#endregion
618
+ export { L as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as Timeline } from "./timeline-k3nURuCP.js";