@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,312 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as r } from "./media-8yrN85VT.js";
5
+ import { t as i } from "./use-controlled-state-DpeVQZNR.js";
6
+ import { t as a } from "./renderable-DzcIj1Lo.js";
7
+ import { t as o } from "./button-C92uYFJW.js";
8
+ import { createContext as s, useContext as c, useLayoutEffect as l, useMemo as u, useRef as d } from "react";
9
+ import { vars as f } from "@jfrader/tokens/vars";
10
+ import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
11
+ import { useMergeRefs as h } from "@floating-ui/react";
12
+ //#region src/components/filter-toolbar/filter-toolbar.tsx
13
+ var g = [], _ = [
14
+ "button:not(:disabled)",
15
+ "input:not(:disabled)",
16
+ "select:not(:disabled)",
17
+ "textarea:not(:disabled)",
18
+ "a[href]",
19
+ "[tabindex]"
20
+ ].map((e) => `[data-ui="filter-toolbar-controls"] ${e}`).join(", "), v = {
21
+ remove: (e) => `Remove ${e.label}: ${e.valueLabel ?? e.value}`,
22
+ clear: "Clear all"
23
+ }, y = new Intl.PluralRules("en"), b = (e, t) => `${t} ${y.select(e) === "one" ? "result" : "results"}`;
24
+ function x(e) {
25
+ return Array.from(new Map(e.map((e) => [e.id, e])).values());
26
+ }
27
+ function S(e, t) {
28
+ return e.length === t.length && e.every((e, n) => {
29
+ let r = t[n];
30
+ return r !== void 0 && e.id === r.id && e.value === r.value && e.label === r.label && e.valueLabel === r.valueLabel;
31
+ });
32
+ }
33
+ var C = s(null);
34
+ function w(e) {
35
+ let t = c(C);
36
+ if (!t) throw Error(`FilterToolbar.${e} must be rendered inside <FilterToolbar>.`);
37
+ return t;
38
+ }
39
+ var T = e({
40
+ display: "flex",
41
+ flexWrap: "wrap",
42
+ alignItems: "center",
43
+ gap: f.space[2],
44
+ minInlineSize: 0,
45
+ "& > *": {
46
+ minInlineSize: 0,
47
+ maxInlineSize: "100%"
48
+ }
49
+ }), E = e({
50
+ display: "flex",
51
+ flexDirection: "column",
52
+ gap: f.space[3],
53
+ minInlineSize: 0,
54
+ padding: f.space[4],
55
+ border: `1px solid ${f.color.border}`,
56
+ borderRadius: f.radius.md,
57
+ backgroundColor: f.color.surface,
58
+ color: f.color.text,
59
+ fontFamily: f.font.sans,
60
+ fontSize: f.textSize.sm,
61
+ "&:focus": n,
62
+ [r]: {
63
+ borderColor: "CanvasText",
64
+ backgroundColor: "Canvas",
65
+ color: "CanvasText"
66
+ }
67
+ }), D = e({
68
+ margin: 0,
69
+ padding: 0,
70
+ listStyle: "none"
71
+ }), O = e({
72
+ display: "inline-flex",
73
+ alignItems: "center",
74
+ gap: f.space[2],
75
+ minInlineSize: 0,
76
+ maxInlineSize: "100%",
77
+ paddingInlineStart: f.space[3],
78
+ border: `1px solid ${f.color.borderControl}`,
79
+ borderRadius: f.radius.full,
80
+ backgroundColor: f.color.surfaceHover,
81
+ color: f.color.text,
82
+ [r]: {
83
+ borderColor: "CanvasText",
84
+ backgroundColor: "Canvas",
85
+ color: "CanvasText"
86
+ }
87
+ }), k = e({
88
+ minInlineSize: 0,
89
+ overflowWrap: "anywhere"
90
+ }), A = e({ color: f.color.textMuted }), j = e({ fontWeight: f.fontWeight.medium }), M = e({
91
+ flexShrink: 0,
92
+ minInlineSize: f.space[8],
93
+ minBlockSize: f.space[8],
94
+ blockSize: "auto",
95
+ padding: 0,
96
+ borderRadius: f.radius.full,
97
+ color: f.color.text,
98
+ [r]: { borderColor: "ButtonText" }
99
+ }), N = e({
100
+ alignSelf: "flex-start",
101
+ maxInlineSize: "100%",
102
+ blockSize: "auto",
103
+ minBlockSize: f.space[8],
104
+ paddingBlock: f.space[2],
105
+ whiteSpace: "normal",
106
+ overflowWrap: "anywhere",
107
+ borderColor: f.color.borderControl,
108
+ [r]: { borderColor: "ButtonText" }
109
+ }), P = e({
110
+ margin: 0,
111
+ minInlineSize: 0,
112
+ overflowWrap: "anywhere",
113
+ color: f.color.textMuted,
114
+ fontSize: f.textSize.sm,
115
+ lineHeight: f.lineHeight.base
116
+ });
117
+ function F({ ref: e, value: n, defaultValue: r = g, onValueChange: a, disabled: o = !1, label: s = "Filters", messages: c, className: f, sx: m, children: y, "aria-label": b, "aria-labelledby": w, tabIndex: T = -1, ...D }) {
118
+ let [O = g, k] = i(n, r, a), A = u(() => x(O), [O]), j = d(null), M = h([j, e]), N = d(null), P = u(() => ({
119
+ ...v,
120
+ ...c
121
+ }), [c]), F = u(() => {
122
+ let e = (e) => {
123
+ if (o) return;
124
+ let t = x(e);
125
+ S(A, t) || k(t);
126
+ }, t = (e, t) => {
127
+ if (N.current = null, e.ownerDocument.activeElement !== e) return;
128
+ let n = A.findIndex((e) => e.id === t);
129
+ N.current = {
130
+ source: e,
131
+ removedId: t,
132
+ neighbors: t === void 0 ? [] : [...A.slice(n + 1).map((e) => e.id), ...A.slice(0, n).reverse().map((e) => e.id)]
133
+ };
134
+ };
135
+ return {
136
+ value: A,
137
+ disabled: o,
138
+ messages: P,
139
+ onValueChange: e,
140
+ remove: (n, r) => {
141
+ o || (t(r, n.id), e(A.filter((e) => e.id !== n.id)));
142
+ },
143
+ clear: (n) => {
144
+ o || (t(n), e(g));
145
+ }
146
+ };
147
+ }, [
148
+ A,
149
+ o,
150
+ P,
151
+ k
152
+ ]);
153
+ return l(() => {
154
+ let e = N.current, t = j.current;
155
+ if (!e || !t) return;
156
+ let n = t.ownerDocument.activeElement;
157
+ if (n !== e.source && n !== t.ownerDocument.body) {
158
+ N.current = null;
159
+ return;
160
+ }
161
+ if (!(e.removedId === void 0 ? A.length === 0 : !A.some((t) => t.id === e.removedId))) return;
162
+ N.current = null;
163
+ let r = (e) => e.closest("[data-ui=\"filter-toolbar\"]") === t, i = Array.from(t.querySelectorAll("[data-ui~=\"filter-toolbar-remove\"]:not(:disabled)")).filter(r), a = e.neighbors.map((e) => i.find((t) => t.dataset.filterId === e)).find((e) => e !== void 0), o = Array.from(t.querySelectorAll(_)).find((e) => r(e) && e.tabIndex >= 0 && e.getAttribute("aria-disabled") !== "true" && !e.closest("[hidden], [inert]") && e.getClientRects().length > 0);
164
+ (a ?? o ?? t).focus();
165
+ }, [A]), /* @__PURE__ */ p(C.Provider, {
166
+ value: F,
167
+ children: /* @__PURE__ */ p(t, {
168
+ className: f,
169
+ styles: E,
170
+ sx: m,
171
+ children: (e) => /* @__PURE__ */ p("div", {
172
+ ...D,
173
+ ref: M,
174
+ role: "group",
175
+ "data-ui": "filter-toolbar",
176
+ className: e,
177
+ tabIndex: T,
178
+ "aria-label": b ?? (w ? void 0 : s),
179
+ "aria-labelledby": w,
180
+ "aria-disabled": o || D["aria-disabled"],
181
+ children: y
182
+ })
183
+ })
184
+ });
185
+ }
186
+ F.displayName = "FilterToolbar";
187
+ function I({ children: e, className: n, sx: r, ...i }) {
188
+ let { value: a, disabled: o, onValueChange: s } = w("Controls");
189
+ return /* @__PURE__ */ p(t, {
190
+ className: n,
191
+ styles: T,
192
+ sx: r,
193
+ children: (t) => /* @__PURE__ */ p("div", {
194
+ ...i,
195
+ "data-ui": "filter-toolbar-controls",
196
+ className: t,
197
+ children: typeof e == "function" ? e({
198
+ value: a,
199
+ disabled: o,
200
+ onValueChange: s
201
+ }) : e
202
+ })
203
+ });
204
+ }
205
+ I.displayName = "FilterToolbar.Controls";
206
+ function L({ empty: e, slotProps: n, className: r, sx: i, ...s }) {
207
+ let { value: c, disabled: l, messages: u, remove: d } = w("ActiveFilters");
208
+ return /* @__PURE__ */ p(t, {
209
+ className: r,
210
+ styles: T,
211
+ sx: i,
212
+ children: (t) => /* @__PURE__ */ p("div", {
213
+ ...s,
214
+ "data-ui": "filter-toolbar-active-filters",
215
+ className: t,
216
+ children: c.length > 0 ? /* @__PURE__ */ p("ul", {
217
+ className: n?.list?.className,
218
+ css: [
219
+ T,
220
+ D,
221
+ n?.list?.css
222
+ ],
223
+ children: c.map((e) => /* @__PURE__ */ m("li", {
224
+ className: n?.chip?.className,
225
+ css: [O, n?.chip?.css],
226
+ children: [/* @__PURE__ */ m("span", {
227
+ className: n?.label?.className,
228
+ css: [k, n?.label?.css],
229
+ children: [/* @__PURE__ */ m("span", {
230
+ css: A,
231
+ children: [e.label, ": "]
232
+ }), /* @__PURE__ */ p("span", {
233
+ css: j,
234
+ children: e.valueLabel ?? e.value
235
+ })]
236
+ }), /* @__PURE__ */ p(o, {
237
+ variant: "ghost",
238
+ size: "sm",
239
+ disabled: l,
240
+ "aria-label": u.remove(e),
241
+ "data-ui": "filter-toolbar-remove",
242
+ "data-filter-id": e.id,
243
+ className: n?.remove?.className,
244
+ css: [M, n?.remove?.css],
245
+ onClick: (t) => d(e, t.currentTarget),
246
+ render: (e) => /* @__PURE__ */ p("button", {
247
+ ...e,
248
+ type: "button",
249
+ disabled: l,
250
+ children: /* @__PURE__ */ p("span", {
251
+ "aria-hidden": "true",
252
+ children: "×"
253
+ })
254
+ })
255
+ })]
256
+ }, e.id))
257
+ }) : a(e) ? e : null
258
+ })
259
+ });
260
+ }
261
+ L.displayName = "FilterToolbar.ActiveFilters";
262
+ function R({ children: e, onClick: t, disabled: n = !1, css: r, ...i }) {
263
+ let { value: a, disabled: s, messages: c, clear: l } = w("Clear");
264
+ if (!a.length) return null;
265
+ let u = s || n;
266
+ return /* @__PURE__ */ p(o, {
267
+ variant: "outline",
268
+ size: "sm",
269
+ ...i,
270
+ disabled: u,
271
+ "data-ui": "filter-toolbar-clear",
272
+ css: [N, r],
273
+ onClick: (e) => {
274
+ t?.(e), e.defaultPrevented || l(e.currentTarget);
275
+ },
276
+ render: (e) => /* @__PURE__ */ p("button", {
277
+ ...e,
278
+ type: "button",
279
+ disabled: u
280
+ }),
281
+ children: e === void 0 ? c.clear : e
282
+ });
283
+ }
284
+ R.displayName = "FilterToolbar.Clear";
285
+ function z({ count: e, locale: n, formatCount: r = b, loading: i = !1, loadingLabel: a = "Loading results", unknownLabel: o = "Results unavailable", className: s, sx: c, ...l }) {
286
+ w("ResultCount");
287
+ let u = e !== null && Number.isFinite(e) && Number.isInteger(e) && e >= 0 ? r(e, new Intl.NumberFormat(n).format(e)) : o;
288
+ return /* @__PURE__ */ p(t, {
289
+ className: s,
290
+ styles: P,
291
+ sx: c,
292
+ children: (e) => /* @__PURE__ */ p("p", {
293
+ "aria-live": "polite",
294
+ "aria-atomic": "true",
295
+ ...l,
296
+ role: "status",
297
+ "aria-busy": i || l["aria-busy"],
298
+ "data-ui": "filter-toolbar-result-count",
299
+ className: e,
300
+ children: i ? a : u
301
+ })
302
+ });
303
+ }
304
+ z.displayName = "FilterToolbar.ResultCount";
305
+ var B = Object.assign(F, {
306
+ Controls: I,
307
+ ActiveFilters: L,
308
+ Clear: R,
309
+ ResultCount: z
310
+ });
311
+ //#endregion
312
+ export { B as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as FilterToolbar } from "./filter-toolbar-D5KEKTSe.js";
@@ -0,0 +1,294 @@
1
+ 'use client';
2
+ import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
3
+ import { n as r } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as i, r as a } from "./media-8yrN85VT.js";
5
+ import { t as o } from "./use-latest-callback-cj1OOQL6.js";
6
+ import { t as s } from "./use-controlled-state-DpeVQZNR.js";
7
+ import { t as c } from "./visually-hidden-BJdvqqvn.js";
8
+ import { t as l } from "./renderable-DzcIj1Lo.js";
9
+ import { t as u } from "./icon-wrapper-stN8sD7R.js";
10
+ import { useEffect as d, useId as f, useRef as p, useState as m } from "react";
11
+ import { vars as h } from "@jfrader/tokens/vars";
12
+ import { Fragment as g, jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
13
+ import { useMergeRefs as ee } from "@floating-ui/react";
14
+ //#region src/components/hold-to-confirm/hold-to-confirm.tsx
15
+ var te = 1200, y = 24, ne = 1e3, b = 2 ** 31 - 1, x = "--hold-progress", re = t({
16
+ label: "hold-to-confirm",
17
+ position: "relative",
18
+ display: "inline-grid",
19
+ boxSizing: "border-box",
20
+ maxInlineSize: "100%",
21
+ overflow: "hidden",
22
+ padding: 0,
23
+ border: `1px solid ${h.color.borderControl}`,
24
+ borderRadius: h.radius.md,
25
+ backgroundColor: h.color.surface,
26
+ color: h.color.text,
27
+ fontFamily: h.font.sans,
28
+ fontWeight: h.fontWeight.medium,
29
+ lineHeight: h.lineHeight.base,
30
+ cursor: "pointer",
31
+ touchAction: "none",
32
+ userSelect: "none",
33
+ "&:hover:not(:disabled):not([aria-disabled=\"true\"])": { backgroundColor: h.color.surfaceHover },
34
+ "&:focus-visible": r,
35
+ "&:disabled": {
36
+ cursor: "not-allowed",
37
+ opacity: .55
38
+ },
39
+ "&[aria-disabled=\"true\"]": { cursor: "default" },
40
+ "&[data-state=\"holding\"] > [data-ui=\"hold-to-confirm-fill\"]": {
41
+ visibility: "visible",
42
+ transitionDuration: "0s"
43
+ },
44
+ "&[data-state=\"confirmed\"] > [data-ui=\"hold-to-confirm-fill\"]": {
45
+ visibility: "visible",
46
+ clipPath: "inset(0)"
47
+ },
48
+ [i]: {
49
+ borderColor: "ButtonText",
50
+ "&:focus-visible": { outlineColor: "Highlight" },
51
+ "&[data-state=\"holding\"]": { borderStyle: "double" }
52
+ }
53
+ }), ie = {
54
+ sm: t({
55
+ minBlockSize: h.space[8],
56
+ fontSize: h.textSize.sm,
57
+ "--hold-padding": h.space[3]
58
+ }),
59
+ md: t({
60
+ minBlockSize: h.space[10],
61
+ fontSize: h.textSize.sm,
62
+ "--hold-padding": h.space[4]
63
+ }),
64
+ lg: t({
65
+ minBlockSize: h.space[12],
66
+ fontSize: h.textSize.md,
67
+ "--hold-padding": h.space[5]
68
+ })
69
+ }, ae = {
70
+ accent: t({
71
+ "--hold-fill": h.color.accent,
72
+ "--hold-ink": h.color.accentContrast
73
+ }),
74
+ danger: t({
75
+ color: h.color.dangerText,
76
+ "--hold-fill": h.color.danger,
77
+ "--hold-ink": h.color.dangerContrast
78
+ }),
79
+ neutral: t({
80
+ "--hold-fill": h.color.text,
81
+ "--hold-ink": h.color.bg
82
+ })
83
+ }, S = t({
84
+ display: "flex",
85
+ alignItems: "center",
86
+ justifyContent: "center",
87
+ gap: h.space[2],
88
+ paddingInline: "var(--hold-padding)",
89
+ paddingBlock: h.space[2],
90
+ overflowWrap: "anywhere"
91
+ }), C = e({
92
+ from: { opacity: 0 },
93
+ to: { opacity: 1 }
94
+ }), w = t({
95
+ animation: `${C} ${h.motion.duration.fast} ${h.motion.easeStandard}`,
96
+ [a]: { animation: "none" }
97
+ }), oe = t({
98
+ position: "absolute",
99
+ inset: 0,
100
+ backgroundColor: "var(--hold-fill)",
101
+ color: "var(--hold-ink)",
102
+ pointerEvents: "none",
103
+ visibility: "hidden",
104
+ clipPath: "inset(0 calc(100% - var(--hold-progress, 0%)) 0 0)",
105
+ transitionProperty: "clip-path, visibility",
106
+ transitionDuration: h.motion.duration.base,
107
+ transitionTimingFunction: h.motion.easeStandard,
108
+ "&:dir(rtl)": { clipPath: "inset(0 0 0 calc(100% - var(--hold-progress, 0%)))" },
109
+ [a]: { transitionDuration: "0s" },
110
+ [i]: {
111
+ forcedColorAdjust: "none",
112
+ backgroundColor: "Highlight",
113
+ color: "HighlightText"
114
+ }
115
+ }), se = t([c, { [i]: { "&[data-holding=\"true\"]": {
116
+ position: "static",
117
+ inlineSize: "auto",
118
+ blockSize: "auto",
119
+ overflow: "visible",
120
+ clip: "auto",
121
+ clipPath: "none",
122
+ whiteSpace: "normal",
123
+ marginInlineStart: h.space[2]
124
+ } } }]);
125
+ function T({ ref: e, label: t, confirmedLabel: r, confirmationAnnouncement: i, getHoldDescription: a, locale: h, duration: C = te, value: T, defaultValue: ce = !1, onValueChange: le, onConfirm: ue, onHoldChange: de, tone: fe = "accent", size: pe = "md", icon: me, confirmedIcon: he = "✓", disabled: E = !1, slotProps: D, className: ge, sx: _e, onPointerDown: ve, onPointerMove: ye, onPointerUp: O, onPointerCancel: k, onLostPointerCapture: A, onKeyDown: j, onKeyUp: M, onBlur: N, onClick: P, onContextMenu: be, "aria-describedby": F, ...I }) {
126
+ if (!Number.isFinite(C) || C <= 0) throw Error("HoldToConfirm: duration must be a finite positive number of milliseconds.");
127
+ let L = `${f()}-hint`, [R, xe] = s(T, ce, le), [z, B] = m(!1), [Se, V] = m(""), H = p(!1), U = p(null), Ce = ee([e]), W = o(de), we = o(ue), G = I["aria-disabled"] === !0 || I["aria-disabled"] === "true", K = (e = !0) => {
128
+ let t = U.current;
129
+ t && (U.current = null, t.stop(), t.button.style.setProperty(x, "0%"), B(!1), !t.completed && e && W(!1), "pointerId" in t.origin && t.button.hasPointerCapture(t.origin.pointerId) && t.button.releasePointerCapture(t.origin.pointerId));
130
+ }, q = o(K);
131
+ d(() => {
132
+ H.current && (H.current = !1, R && V(i)), R || V("");
133
+ }, [
134
+ R,
135
+ z,
136
+ i
137
+ ]), d(() => {
138
+ q();
139
+ }, [
140
+ C,
141
+ E,
142
+ G,
143
+ q
144
+ ]), d(() => {
145
+ R && U.current && !U.current.completed && q();
146
+ }, [R, q]), d(() => () => q(!1), [q]);
147
+ let J = E || R || G, Y = (e, t) => {
148
+ let n = e.ownerDocument, r = n.defaultView;
149
+ if (J || U.current || !r || n.hidden) return;
150
+ let i = r.performance.now(), a = 0, o = 0, s = {
151
+ origin: t,
152
+ button: e,
153
+ completed: !1,
154
+ stop: () => {}
155
+ }, c = () => q(), l = () => {
156
+ n.hidden && c();
157
+ }, u = (n) => {
158
+ "pointerId" in t && n.pointerId === t.pointerId && !e.contains(n.target) && c();
159
+ }, d = (n) => {
160
+ if (!("pointerId" in t) || t.pointerId !== n.pointerId) return;
161
+ let r = e.getBoundingClientRect();
162
+ (n.clientX < r.left - y || n.clientX > r.right + y || n.clientY < r.top - y || n.clientY > r.bottom + y) && c();
163
+ }, f = () => {
164
+ r.clearTimeout(a), r.cancelAnimationFrame(o);
165
+ };
166
+ s.stop = () => {
167
+ f(), n.removeEventListener("visibilitychange", l), n.removeEventListener("pointerup", u, !0), n.removeEventListener("pointercancel", u, !0), n.removeEventListener("pointermove", d), r.removeEventListener("blur", c);
168
+ };
169
+ let p = () => {
170
+ if (U.current !== s || s.completed) return;
171
+ if (n.hidden || !e.isConnected || e.disabled || e.getAttribute("aria-disabled") === "true") {
172
+ c();
173
+ return;
174
+ }
175
+ let t = C - (r.performance.now() - i);
176
+ t > 0 ? a = r.setTimeout(p, Math.min(t, b)) : (s.completed = !0, f(), e.style.setProperty(x, "0%"), H.current = !0, B(!1), W(!1), xe(!0), we());
177
+ }, m = () => {
178
+ U.current !== s || s.completed || (e.style.setProperty(x, `${Math.min(100, (r.performance.now() - i) / C * 100)}%`), o = r.requestAnimationFrame(m));
179
+ };
180
+ U.current = s, e.style.setProperty(x, "0%"), B(!0), V(""), n.addEventListener("visibilitychange", l), n.addEventListener("pointerup", u, !0), n.addEventListener("pointercancel", u, !0), n.addEventListener("pointermove", d), r.addEventListener("blur", c), a = r.setTimeout(p, Math.min(C, b)), o = r.requestAnimationFrame(m), W(!0);
181
+ }, X = (e) => {
182
+ let t = U.current?.origin;
183
+ t && "pointerId" in t && t.pointerId === e && K();
184
+ }, Z = R ? r : t, Q = R ? he : me, $ = /* @__PURE__ */ v(g, { children: [l(Q) && /* @__PURE__ */ _("span", {
185
+ "aria-hidden": "true",
186
+ className: D?.icon?.className,
187
+ css: [
188
+ u,
189
+ w,
190
+ D?.icon?.css
191
+ ],
192
+ children: Q
193
+ }, `icon-${R}`), l(Z) && /* @__PURE__ */ _("span", {
194
+ className: D?.label?.className,
195
+ css: [w, D?.label?.css],
196
+ children: Z
197
+ }, `label-${R}`)] }), Te = new Intl.NumberFormat(h, {
198
+ style: "unit",
199
+ unit: "second",
200
+ unitDisplay: "long",
201
+ maximumFractionDigits: 3,
202
+ ...C < 1 ? { maximumSignificantDigits: 3 } : void 0
203
+ }).format(C / ne);
204
+ return /* @__PURE__ */ v(g, { children: [
205
+ /* @__PURE__ */ _(n, {
206
+ className: ge,
207
+ styles: [
208
+ re,
209
+ ie[pe],
210
+ ae[fe]
211
+ ],
212
+ sx: _e,
213
+ children: (e) => /* @__PURE__ */ v("button", {
214
+ ...I,
215
+ ref: Ce,
216
+ className: e,
217
+ type: "button",
218
+ disabled: E,
219
+ "data-ui": "hold-to-confirm",
220
+ "data-state": R ? "confirmed" : z ? "holding" : "idle",
221
+ "aria-disabled": R ? !0 : I["aria-disabled"],
222
+ "aria-describedby": [F, L].filter(Boolean).join(" "),
223
+ onPointerDown: (e) => {
224
+ if (ve?.(e), !(e.defaultPrevented || !e.isPrimary || e.button !== 0 || J || U.current) && (e.preventDefault(), e.currentTarget.focus({ preventScroll: !0 }), Y(e.currentTarget, { pointerId: e.pointerId }), U.current)) try {
225
+ e.currentTarget.setPointerCapture(e.pointerId);
226
+ } catch {}
227
+ },
228
+ onPointerMove: (e) => {
229
+ ye?.(e);
230
+ },
231
+ onPointerUp: (e) => {
232
+ O?.(e), X(e.pointerId);
233
+ },
234
+ onPointerCancel: (e) => {
235
+ k?.(e), X(e.pointerId);
236
+ },
237
+ onLostPointerCapture: (e) => {
238
+ A?.(e), X(e.pointerId);
239
+ },
240
+ onKeyDown: (e) => {
241
+ j?.(e), e.key === "Escape" || e.key === "Tab" ? K() : (e.key === " " || e.key === "Enter") && (e.defaultPrevented || (e.preventDefault(), e.repeat || Y(e.currentTarget, { key: e.key })));
242
+ },
243
+ onKeyUp: (e) => {
244
+ M?.(e);
245
+ let t = U.current?.origin;
246
+ t && "key" in t && e.key === t.key && K(), (e.key === " " || e.key === "Enter") && e.preventDefault();
247
+ },
248
+ onBlur: (e) => {
249
+ N?.(e), K();
250
+ },
251
+ onClick: (e) => {
252
+ P?.(e), e.preventDefault();
253
+ },
254
+ onContextMenu: (e) => {
255
+ be?.(e), U.current && "pointerId" in U.current.origin && !U.current.completed && e.preventDefault();
256
+ },
257
+ children: [/* @__PURE__ */ _("span", {
258
+ className: D?.face?.className,
259
+ css: [S, D?.face?.css],
260
+ children: $
261
+ }), /* @__PURE__ */ _("span", {
262
+ "data-ui": "hold-to-confirm-fill",
263
+ "aria-hidden": "true",
264
+ className: [D?.face?.className, D?.fill?.className].filter(Boolean).join(" ") || void 0,
265
+ css: [
266
+ S,
267
+ D?.face?.css,
268
+ oe,
269
+ D?.fill?.css
270
+ ],
271
+ children: $
272
+ })]
273
+ })
274
+ }),
275
+ /* @__PURE__ */ _("span", {
276
+ id: L,
277
+ "data-holding": z || void 0,
278
+ className: D?.hint?.className,
279
+ css: [se, D?.hint?.css],
280
+ children: a(Te)
281
+ }),
282
+ /* @__PURE__ */ _("span", {
283
+ role: "status",
284
+ "aria-live": "polite",
285
+ "aria-atomic": "true",
286
+ className: D?.status?.className,
287
+ css: [c, D?.status?.css],
288
+ children: Se
289
+ })
290
+ ] });
291
+ }
292
+ T.displayName = "HoldToConfirm";
293
+ //#endregion
294
+ export { T as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as HoldToConfirm } from "./hold-to-confirm-DjB2EVjM.js";