@jfrader/ui 0.5.0 → 0.5.1

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 (179) hide show
  1. package/dist/accordion-DLul6vIl.js +205 -0
  2. package/dist/accordion.js +1 -1
  3. package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
  4. package/dist/announcement-bar.js +1 -1
  5. package/dist/avatar-CaGJHy1N.js +145 -0
  6. package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
  7. package/dist/avatar-group.js +1 -1
  8. package/dist/avatar.js +1 -1
  9. package/dist/badge-CjM5Agqk.js +119 -0
  10. package/dist/badge.js +1 -1
  11. package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
  12. package/dist/bottom-sheet.js +1 -1
  13. package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
  14. package/dist/breadcrumbs.js +1 -1
  15. package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
  16. package/dist/button.js +1 -1
  17. package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
  18. package/dist/calendar.js +1 -1
  19. package/dist/card-Ca4KQKYQ.js +154 -0
  20. package/dist/card.js +1 -1
  21. package/dist/carousel-B7OrvD6J.js +474 -0
  22. package/dist/carousel.js +1 -1
  23. package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
  24. package/dist/checkbox.js +1 -1
  25. package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
  26. package/dist/chip-group.js +1 -1
  27. package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
  28. package/dist/code-block.js +1 -1
  29. package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
  30. package/dist/combobox.js +1 -1
  31. package/dist/command-palette-BmQu2w4H.js +391 -0
  32. package/dist/command-palette.js +1 -1
  33. package/dist/comment-thread-ASaXDcGo.js +1410 -0
  34. package/dist/comment-thread.js +2 -0
  35. package/dist/context-menu-__1c2Dk9.js +370 -0
  36. package/dist/context-menu.js +2 -0
  37. package/dist/{copy-button-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
  38. package/dist/copy-button.js +1 -1
  39. package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
  40. package/dist/date-picker.js +1 -1
  41. package/dist/date-range-picker-DQpUeKqV.js +570 -0
  42. package/dist/date-range-picker.js +1 -1
  43. package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
  44. package/dist/dialog.js +1 -1
  45. package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
  46. package/dist/divider.js +1 -1
  47. package/dist/elastic-slider-BG6K019r.js +395 -0
  48. package/dist/elastic-slider.js +2 -0
  49. package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
  50. package/dist/expandable-card.js +1 -1
  51. package/dist/expanding-search-BxOwtdwt.js +238 -0
  52. package/dist/expanding-search.js +2 -0
  53. package/dist/file-dropzone-BuXm3Tea.js +457 -0
  54. package/dist/file-dropzone.js +1 -1
  55. package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
  56. package/dist/filter-toolbar.js +1 -1
  57. package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
  58. package/dist/hover-card.js +1 -1
  59. package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
  60. package/dist/image-compare.js +1 -1
  61. package/dist/index.js +81 -76
  62. package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
  63. package/dist/json-viewer.js +1 -1
  64. package/dist/mention-input-sq61si9L.js +600 -0
  65. package/dist/mention-input.js +1 -1
  66. package/dist/menu-DDKgmK2F.js +295 -0
  67. package/dist/menu.js +1 -1
  68. package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
  69. package/dist/metric-card.js +1 -1
  70. package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
  71. package/dist/multi-select.js +1 -1
  72. package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
  73. package/dist/navigation.js +1 -1
  74. package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
  75. package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
  76. package/dist/pagination.js +1 -1
  77. package/dist/pill-BaS-uIbn.js +58 -0
  78. package/dist/pill.js +1 -1
  79. package/dist/popover-CErIw2q3.js +125 -0
  80. package/dist/popover.js +1 -1
  81. package/dist/{progress-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
  82. package/dist/progress.js +1 -1
  83. package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
  84. package/dist/radio-cards.js +1 -1
  85. package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
  86. package/dist/radio-group.js +1 -1
  87. package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
  88. package/dist/resizable-panels.js +1 -1
  89. package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
  90. package/dist/search-field.js +1 -1
  91. package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
  92. package/dist/segmented-control.js +1 -1
  93. package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
  94. package/dist/select.js +1 -1
  95. package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
  96. package/dist/signature-pad.js +1 -1
  97. package/dist/slider-DVG6-Awh.js +308 -0
  98. package/dist/slider.js +1 -1
  99. package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
  100. package/dist/sortable-data-table.js +1 -1
  101. package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
  102. package/dist/split-button.js +1 -1
  103. package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
  104. package/dist/swipe-actions.js +1 -1
  105. package/dist/switch-C1WrKrf-.js +145 -0
  106. package/dist/switch.js +1 -1
  107. package/dist/tabs-XluwRjgg.js +210 -0
  108. package/dist/tabs.js +1 -1
  109. package/dist/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
  110. package/dist/text-field.js +1 -1
  111. package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
  112. package/dist/textarea.js +1 -1
  113. package/dist/theme-root.js +1 -1
  114. package/dist/theme-switch-C505TtU8.js +166 -0
  115. package/dist/theme-switch.js +2 -0
  116. package/dist/{time-picker-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
  117. package/dist/time-picker.js +1 -1
  118. package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
  119. package/dist/timeline.js +1 -1
  120. package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
  121. package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
  122. package/dist/toast-stack.js +1 -1
  123. package/dist/toast.js +1 -1
  124. package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
  125. package/dist/toggle-group.js +1 -1
  126. package/dist/tooltip-BvgVTCTN.js +120 -0
  127. package/dist/tooltip.js +1 -1
  128. package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
  129. package/dist/tree-view.js +1 -1
  130. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  131. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  132. package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
  133. package/dist/types/components/comment-thread/index.d.ts +1 -0
  134. package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
  135. package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
  136. package/dist/types/components/context-menu/context-menu.d.ts +55 -0
  137. package/dist/types/components/context-menu/index.d.ts +2 -0
  138. package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
  139. package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
  140. package/dist/types/components/elastic-slider/index.d.ts +1 -0
  141. package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
  142. package/dist/types/components/expanding-search/index.d.ts +1 -0
  143. package/dist/types/components/menu/menu.d.ts +50 -7
  144. package/dist/types/components/pagination/pagination.d.ts +1 -1
  145. package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
  146. package/dist/types/components/radio-group/radio-group.d.ts +1 -1
  147. package/dist/types/components/slider/slider-style.d.ts +14 -0
  148. package/dist/types/components/slider/slider.d.ts +2 -10
  149. package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
  150. package/dist/types/components/split-button/split-button.d.ts +2 -2
  151. package/dist/types/components/tabs/tabs.d.ts +1 -1
  152. package/dist/types/components/text-field/text-field.d.ts +1 -1
  153. package/dist/types/components/textarea/textarea.d.ts +1 -1
  154. package/dist/types/components/theme-switch/index.d.ts +1 -0
  155. package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
  156. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  157. package/dist/types/index.d.ts +5 -0
  158. package/dist/types/overlay/overlay-layer.d.ts +20 -0
  159. package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
  160. package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
  161. package/dist/use-slider-interaction-ChL-208h.js +234 -0
  162. package/package.json +22 -2
  163. package/dist/accordion-xCI_u0BV.js +0 -198
  164. package/dist/avatar-BahDVO9t.js +0 -132
  165. package/dist/badge-B_sLygxU.js +0 -108
  166. package/dist/card-D-aI2QHx.js +0 -158
  167. package/dist/carousel-IvPqN-oM.js +0 -472
  168. package/dist/command-palette-BQ5LleGb.js +0 -384
  169. package/dist/date-range-picker-B5uFWsm-.js +0 -562
  170. package/dist/file-dropzone-pR4v7owg.js +0 -457
  171. package/dist/mention-input-BcQKX2EJ.js +0 -599
  172. package/dist/menu-xwOOUtWP.js +0 -275
  173. package/dist/pill-DO2gHzMb.js +0 -56
  174. package/dist/popover-QHcEvf9c.js +0 -119
  175. package/dist/slider-t0B5cecO.js +0 -477
  176. package/dist/switch-qwv8jQnR.js +0 -142
  177. package/dist/tabs-CAVJndX1.js +0 -203
  178. package/dist/tooltip-CkeiW9C1.js +0 -113
  179. package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
@@ -0,0 +1,395 @@
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, t as o } from "./media-8yrN85VT.js";
5
+ import { a as ee, c as te, d as ne, f as re, g as ie, h as ae, i as oe, l as se, m as s, n as c, o as ce, p as le, r as l, s as ue, t as u, u as de } from "./use-slider-interaction-ChL-208h.js";
6
+ import { useEffect as d, useRef as f, useState as fe } from "react";
7
+ import { vars as p } from "@jfrader/tokens/vars";
8
+ import { createElement as m } from "@emotion/react";
9
+ import { jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
10
+ import { MotionConfig as pe, motion as me, useMotionValue as he, useMotionValueEvent as _, useReducedMotion as ge, useSpring as v, useTransform as _e, useVelocity as ve } from "motion/react";
11
+ //#region src/components/elastic-slider/elastic-slider.tsx
12
+ var y = 26, ye = 1.15, be = 7, xe = 10, Se = 6, Ce = .02, we = 10, Te = {
13
+ stiffness: 380,
14
+ damping: 26
15
+ }, Ee = {
16
+ stiffness: 300,
17
+ damping: 20
18
+ }, De = {
19
+ type: "spring",
20
+ stiffness: 420,
21
+ damping: 28
22
+ }, b = "--elastic-slider-stretch-start", x = "--elastic-slider-stretch-end", S = "--elastic-slider-squash", C = "--elastic-slider-shift", w = "--elastic-slider-tilt", T = e({
23
+ "0%": { scale: "1" },
24
+ "45%": { scale: "1.8" },
25
+ "100%": { scale: "1" }
26
+ }), Oe = t(s, { label: "elastic-slider" }), ke = t({ marginInline: p.space[6] }), Ae = t({
27
+ position: "absolute",
28
+ insetInline: 0,
29
+ insetBlock: 0,
30
+ marginBlock: "auto",
31
+ blockSize: p.space[2],
32
+ borderRadius: p.radius.full,
33
+ background: p.color.surfaceInset,
34
+ pointerEvents: "none",
35
+ [i]: {
36
+ forcedColorAdjust: "none",
37
+ background: "Canvas"
38
+ }
39
+ }), je = t({
40
+ position: "absolute",
41
+ insetInlineStart: `calc(-1 * var(${b}, 0px))`,
42
+ insetInlineEnd: `calc(-1 * var(${x}, 0px))`,
43
+ insetBlock: 0,
44
+ marginBlock: "auto",
45
+ blockSize: p.space[2],
46
+ boxSizing: "border-box",
47
+ overflow: "hidden",
48
+ border: `1px solid ${p.color.borderControl}`,
49
+ borderRadius: p.radius.full,
50
+ scale: `1 var(${S}, 1)`,
51
+ pointerEvents: "none",
52
+ [a]: {
53
+ insetInline: 0,
54
+ scale: "none"
55
+ },
56
+ [i]: {
57
+ forcedColorAdjust: "none",
58
+ borderColor: "CanvasText"
59
+ }
60
+ }), Me = t({
61
+ position: "absolute",
62
+ insetBlock: 0,
63
+ insetInlineStart: 0,
64
+ background: p.color.accent,
65
+ [i]: { background: "Highlight" }
66
+ }), Ne = t({
67
+ position: "absolute",
68
+ insetBlock: 0,
69
+ marginBlock: "auto",
70
+ marginInlineStart: `calc(${p.space[1]} / -2)`,
71
+ inlineSize: p.space[1],
72
+ blockSize: p.space[3],
73
+ boxSizing: "border-box",
74
+ border: `1px solid ${p.color.borderControl}`,
75
+ borderRadius: p.radius.full,
76
+ background: p.color.surfaceRaised,
77
+ pointerEvents: "none",
78
+ "&[data-latched]": {
79
+ blockSize: p.space[4],
80
+ background: p.color.accent,
81
+ animation: `${T} ${p.motion.duration.slow} ${p.motion.easeStandard}`
82
+ },
83
+ [a]: { "&[data-latched]": { animation: "none" } },
84
+ [i]: {
85
+ forcedColorAdjust: "none",
86
+ background: "Canvas",
87
+ borderColor: "CanvasText",
88
+ "&[data-latched]": { background: "Highlight" }
89
+ }
90
+ }), Pe = t({
91
+ position: "absolute",
92
+ insetBlock: 0,
93
+ marginBlock: "auto",
94
+ marginInlineStart: `calc(${p.space[8]} / -2)`,
95
+ inlineSize: p.space[8],
96
+ blockSize: p.space[8],
97
+ display: "grid",
98
+ placeItems: "center",
99
+ borderRadius: p.radius.full,
100
+ translate: `var(${C}, 0px)`,
101
+ cursor: "grab",
102
+ "&:focus-visible": {
103
+ ...r,
104
+ zIndex: 2
105
+ },
106
+ [a]: { translate: "none" },
107
+ "&[data-dragging]": {
108
+ cursor: "grabbing",
109
+ zIndex: 3
110
+ },
111
+ "&[aria-disabled=\"true\"]": { cursor: "default" }
112
+ }), Fe = t({
113
+ inlineSize: p.space[6],
114
+ blockSize: p.space[6],
115
+ boxSizing: "border-box",
116
+ border: `2px solid ${p.color.borderControl}`,
117
+ borderRadius: p.radius.full,
118
+ background: p.color.surfaceRaised,
119
+ boxShadow: p.shadow.raised,
120
+ pointerEvents: "none",
121
+ [i]: {
122
+ forcedColorAdjust: "none",
123
+ background: "Canvas",
124
+ borderColor: "CanvasText",
125
+ boxShadow: "none"
126
+ }
127
+ }), Ie = t({
128
+ position: "absolute",
129
+ insetBlockEnd: `calc(100% + ${p.space[2]})`,
130
+ paddingInline: p.space[2],
131
+ paddingBlock: p.space[1],
132
+ inlineSize: "max-content",
133
+ maxInlineSize: "min(24rem, 80vw)",
134
+ overflowWrap: "anywhere",
135
+ border: `1px solid ${p.color.borderControl}`,
136
+ borderRadius: p.radius.md,
137
+ background: p.color.surfaceRaised,
138
+ color: p.color.text,
139
+ boxShadow: p.shadow.raised,
140
+ fontSize: p.textSize.xs,
141
+ fontVariantNumeric: "tabular-nums",
142
+ pointerEvents: "none",
143
+ transformOrigin: "bottom center",
144
+ rotate: `var(${w}, 0deg)`,
145
+ opacity: 0,
146
+ transition: `opacity ${p.motion.duration.fast} ${p.motion.easeStandard}`,
147
+ "[data-dragging] > &, [data-slider-thumb]:focus-visible > &": { opacity: 1 },
148
+ [o]: { insetBlockEnd: `calc(100% + ${p.space[4]})` },
149
+ [a]: { rotate: "none" },
150
+ [i]: {
151
+ borderColor: "CanvasText",
152
+ boxShadow: "none"
153
+ }
154
+ });
155
+ function Le(e) {
156
+ return Math.sign(e) * y * (1 - Math.exp(-Math.abs(e) / y));
157
+ }
158
+ function E(e) {
159
+ let { ref: t, value: r, defaultValue: i, onValueChange: a, onValueCommit: o, label: s, description: p, error: T, invalid: E = !1, disabled: D = !1, min: O = 0, max: k = 100, step: A = 1, largeStep: Re, marks: ze = [], locale: Be, formatOptions: Ve, formatValue: He, showValue: j = !0, start: M, end: N, haptics: Ue = !1, name: P, size: We = "md", slotProps: F, className: Ge, sx: Ke, onKeyDown: qe, "aria-label": Je, "aria-labelledby": Ye, "aria-describedby": Xe, "aria-invalid": Ze, ...Qe } = e, I = ge() ?? !1, L = v(0, Te), R = f(null), z = f(!1), [$e, B] = fe(null), V = (e) => {
160
+ R.current = e, B(e);
161
+ }, et = (e) => {
162
+ if (!Ue || I || e !== "touch") return;
163
+ let t = H.controlRef.current?.ownerDocument.defaultView?.navigator;
164
+ if (typeof t?.vibrate == "function") try {
165
+ t.vibrate(Se);
166
+ } catch {}
167
+ }, H = ee({
168
+ component: "ElasticSlider",
169
+ range: !1,
170
+ value: r,
171
+ defaultValue: i,
172
+ min: O,
173
+ max: k,
174
+ step: A,
175
+ largeStep: Re,
176
+ minStepsBetweenThumbs: 0,
177
+ disabled: D,
178
+ onValueChange: (e) => a?.(e),
179
+ onValueCommit: (e) => o?.(e),
180
+ onPointerSample: ({ raw: e, low: t, high: n, pxPerUnit: r, rtl: i }) => {
181
+ z.current = i, L.set(I ? 0 : Le((e - Math.max(t, Math.min(n, e))) * r));
182
+ },
183
+ resolvePointer: ({ raw: e, pxPerUnit: t, pointerType: n }) => {
184
+ let r = (n) => Math.abs(e - n) * t, i = R.current;
185
+ if (i !== null && r(i) > xe && (i = null), i === null) {
186
+ for (let e of Y) r(e) <= be && (i === null || r(e) < r(i)) && (i = e);
187
+ i !== null && et(n);
188
+ }
189
+ return i !== R.current && V(i), i ?? e;
190
+ },
191
+ onGestureEnd: () => {
192
+ L.set(0), V(null);
193
+ }
194
+ }), { id: U, controlRef: W, current: tt, percent: G } = H, K = tt, { format: q } = oe(Be, Ve, He), J = H.normalizeMarks(ze), Y = J.map((e) => e.value).sort((e, t) => e - t), nt = [
195
+ O,
196
+ k,
197
+ A,
198
+ ...Y
199
+ ].join(" ");
200
+ d(() => {
201
+ R.current = null, B(null), L.jump(0);
202
+ }, [nt]);
203
+ let rt = he(G(K));
204
+ d(() => rt.set(G(K)), [
205
+ K,
206
+ O,
207
+ k
208
+ ]);
209
+ let it = v(_e(ve(rt), (e) => {
210
+ let t = W.current?.matches(":dir(rtl)") ? e : -e;
211
+ return Math.max(-10, Math.min(we, t * Ce));
212
+ }), Ee), X = (e, t) => W.current?.style.setProperty(e, t);
213
+ _(L, "change", (e) => {
214
+ X(b, `${Math.max(0, -e)}px`), X(x, `${Math.max(0, e)}px`), X(S, String(1 - .4 * Math.min(1, Math.abs(e) / y))), X(C, `${z.current ? -e : e}px`);
215
+ }), _(it, "change", (e) => X(w, `${I ? 0 : e}deg`));
216
+ let Z = u(s), at = u(p), Q = u(T), $ = F?.thumb, ot = H.active === 0;
217
+ return /* @__PURE__ */ h(pe, {
218
+ reducedMotion: "user",
219
+ children: /* @__PURE__ */ h(n, {
220
+ className: Ge,
221
+ styles: Oe,
222
+ sx: Ke,
223
+ children: (e) => /* @__PURE__ */ g("div", {
224
+ ...Qe,
225
+ ref: t,
226
+ className: e,
227
+ "data-ui": "elastic-slider",
228
+ "data-disabled": D || void 0,
229
+ onKeyDown: (e) => {
230
+ qe?.(e), H.handleRootKeyDown(e);
231
+ },
232
+ children: [
233
+ (Z || j) && /* @__PURE__ */ g("div", {
234
+ css: se,
235
+ children: [Z && /* @__PURE__ */ h("span", {
236
+ ...F?.label,
237
+ id: `${U}-label`,
238
+ css: [de, F?.label?.css],
239
+ children: s
240
+ }), j && /* @__PURE__ */ h("span", {
241
+ ...F?.readout,
242
+ "aria-hidden": "true",
243
+ "data-ui": "elastic-slider-readout",
244
+ css: [le, F?.readout?.css],
245
+ children: q(K)
246
+ })]
247
+ }),
248
+ at && /* @__PURE__ */ h("div", {
249
+ ...F?.description,
250
+ id: `${U}-description`,
251
+ css: [ue, F?.description?.css],
252
+ children: p
253
+ }),
254
+ Q && /* @__PURE__ */ h("div", {
255
+ ...F?.error,
256
+ id: `${U}-error`,
257
+ role: "alert",
258
+ css: [te, F?.error?.css],
259
+ children: T
260
+ }),
261
+ /* @__PURE__ */ g("div", {
262
+ css: ae,
263
+ children: [
264
+ u(M) && /* @__PURE__ */ h("div", {
265
+ ...F?.start,
266
+ children: M
267
+ }),
268
+ /* @__PURE__ */ g("div", {
269
+ ...F?.control,
270
+ ...H.controlHandlers(F?.control),
271
+ css: [
272
+ ce,
273
+ ke,
274
+ ie[We],
275
+ F?.control?.css
276
+ ],
277
+ "data-ui": "elastic-slider-control",
278
+ "data-disabled": D || void 0,
279
+ children: [
280
+ /* @__PURE__ */ h("div", {
281
+ ...F?.rail,
282
+ "data-ui": "elastic-slider-rail",
283
+ "aria-hidden": "true",
284
+ css: [Ae, F?.rail?.css]
285
+ }),
286
+ /* @__PURE__ */ h("div", {
287
+ ...F?.track,
288
+ "data-ui": "elastic-slider-track",
289
+ "aria-hidden": "true",
290
+ css: [je, F?.track?.css],
291
+ children: /* @__PURE__ */ h("div", {
292
+ ...F?.fill,
293
+ "data-ui": "elastic-slider-fill",
294
+ css: [Me, F?.fill?.css],
295
+ style: {
296
+ ...F?.fill?.style,
297
+ inlineSize: `${G(K)}%`
298
+ }
299
+ })
300
+ }),
301
+ J.map((e, t) => {
302
+ let n = c(F?.tick, t);
303
+ return /* @__PURE__ */ m("span", {
304
+ ...n,
305
+ key: e.value,
306
+ "data-ui": "elastic-slider-tick",
307
+ "data-latched": $e === e.value || void 0,
308
+ "aria-hidden": "true",
309
+ css: [Ne, n?.css],
310
+ style: {
311
+ ...n?.style,
312
+ insetInlineStart: `${G(e.value)}%`
313
+ }
314
+ });
315
+ }),
316
+ /* @__PURE__ */ g("div", {
317
+ ...$,
318
+ id: `${U}-thumb`,
319
+ "data-slider-thumb": 0,
320
+ "data-dragging": ot || void 0,
321
+ role: "slider",
322
+ tabIndex: D ? -1 : 0,
323
+ "aria-orientation": "horizontal",
324
+ "aria-disabled": D,
325
+ "aria-invalid": Q || E ? !0 : $?.["aria-invalid"] ?? Ze,
326
+ "aria-valuemin": O,
327
+ "aria-valuemax": k,
328
+ "aria-valuenow": K,
329
+ "aria-valuetext": q(K),
330
+ "aria-label": $?.["aria-label"] ?? Je,
331
+ "aria-labelledby": l(Ye, $?.["aria-labelledby"], Z && `${U}-label`),
332
+ "aria-describedby": l(Xe, $?.["aria-describedby"], at && `${U}-description`, Q && `${U}-error`),
333
+ css: [Pe, $?.css],
334
+ style: {
335
+ ...$?.style,
336
+ insetInlineStart: `${G(K)}%`
337
+ },
338
+ children: [/* @__PURE__ */ h(me.span, {
339
+ "aria-hidden": "true",
340
+ "data-ui": "elastic-slider-thumb-visual",
341
+ css: Fe,
342
+ animate: { scale: !I && ot ? ye : 1 },
343
+ transition: I ? { duration: 0 } : De
344
+ }), /* @__PURE__ */ h("span", {
345
+ ...F?.bubble,
346
+ "data-ui": "elastic-slider-bubble",
347
+ "aria-hidden": "true",
348
+ css: [Ie, F?.bubble?.css],
349
+ style: {
350
+ ...F?.bubble?.style,
351
+ ...G(K) <= 50 ? { insetInlineStart: 0 } : { insetInlineEnd: 0 }
352
+ },
353
+ children: q(K)
354
+ })]
355
+ })
356
+ ]
357
+ }),
358
+ u(N) && /* @__PURE__ */ h("div", {
359
+ ...F?.end,
360
+ children: N
361
+ })
362
+ ]
363
+ }),
364
+ J.some((e) => u(e.label)) && /* @__PURE__ */ h("div", {
365
+ css: re,
366
+ children: J.map((e, t) => {
367
+ if (!u(e.label)) return null;
368
+ let n = c(F?.mark, t);
369
+ return /* @__PURE__ */ m("button", {
370
+ ...n,
371
+ key: e.value,
372
+ type: "button",
373
+ disabled: D,
374
+ "data-ui": "elastic-slider-mark",
375
+ css: [ne, n?.css],
376
+ onClick: (t) => {
377
+ n?.onClick?.(t), t.defaultPrevented || H.selectMark(e.value);
378
+ }
379
+ }, e.label);
380
+ })
381
+ }),
382
+ P !== void 0 && /* @__PURE__ */ h("input", {
383
+ type: "hidden",
384
+ disabled: D,
385
+ name: P,
386
+ value: K
387
+ })
388
+ ]
389
+ })
390
+ })
391
+ });
392
+ }
393
+ E.displayName = "ElasticSlider";
394
+ //#endregion
395
+ export { E as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as ElasticSlider } from "./elastic-slider-BG6K019r.js";
@@ -85,7 +85,14 @@ var O = {
85
85
  padding: _.space[3]
86
86
  },
87
87
  [a]: { "&::after": { transitionDuration: "0s" } },
88
- [i]: { "&:focus-visible": { outlineColor: "Highlight" } }
88
+ [i]: {
89
+ "&:focus-visible": { outlineColor: "Highlight" },
90
+ "&::after": {
91
+ forcedColorAdjust: "none",
92
+ borderInlineStartColor: "ButtonText"
93
+ },
94
+ "&:disabled::after": { borderInlineStartColor: "GrayText" }
95
+ }
89
96
  }), P = e({
90
97
  fontSize: _.textSize.md,
91
98
  fontWeight: _.fontWeight.medium
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as ExpandableCard } from "./expandable-card-C-qJcZ14.js";
2
+ export { t as ExpandableCard } from "./expandable-card-rUATve0o.js";
@@ -0,0 +1,238 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n } from "./media-8yrN85VT.js";
4
+ import { t as r } from "./use-controlled-state-DpeVQZNR.js";
5
+ import { t as i } from "./renderable-DzcIj1Lo.js";
6
+ import { t as a } from "./button-NLY0h6EJ.js";
7
+ import { t as o } from "./search-field-DMvho0KQ.js";
8
+ import { useId as ee, useLayoutEffect as s, useRef as c, useState as te } from "react";
9
+ import { vars as l } from "@jfrader/tokens/vars";
10
+ import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
11
+ import { useMergeRefs as f } from "@floating-ui/react";
12
+ import { animate as p, useMotionValue as m } from "motion/react";
13
+ import { base as h } from "@jfrader/tokens";
14
+ //#region src/components/expanding-search/expanding-search.tsx
15
+ var g = {
16
+ type: "spring",
17
+ visualDuration: Number.parseFloat(h.motion.duration.slow) / 1e3,
18
+ bounce: 0
19
+ }, ne = "(prefers-reduced-motion: reduce)", re = e({
20
+ position: "relative",
21
+ inlineSize: "100%",
22
+ minInlineSize: 0,
23
+ minBlockSize: "var(--expanding-search-size)",
24
+ pointerEvents: "none"
25
+ }), ie = {
26
+ sm: e({ "--expanding-search-size": l.space[8] }),
27
+ md: e({ "--expanding-search-size": l.space[10] }),
28
+ lg: e({ "--expanding-search-size": l.space[12] })
29
+ }, _ = e({
30
+ position: "relative",
31
+ marginInlineStart: "auto",
32
+ inlineSize: "var(--expanding-search-size)",
33
+ "--expanding-search-radius": l.radius.full,
34
+ minInlineSize: 0,
35
+ maxInlineSize: "100%",
36
+ pointerEvents: "auto",
37
+ overflow: "clip",
38
+ overflowClipMargin: l.space[1],
39
+ "&[data-state=\"open\"]": {
40
+ inlineSize: "var(--expanding-search-width)",
41
+ "--expanding-search-radius": l.radius.sm
42
+ },
43
+ "&[data-anchor=\"start\"]": {
44
+ marginInlineStart: 0,
45
+ marginInlineEnd: "auto"
46
+ }
47
+ }), v = e({
48
+ position: "absolute",
49
+ insetBlockStart: 0,
50
+ insetInline: 0
51
+ }), ae = e({
52
+ position: "absolute",
53
+ inlineSize: "var(--expanding-search-width)",
54
+ maxInlineSize: "100%",
55
+ blockSize: "var(--expanding-search-size)",
56
+ borderStartStartRadius: l.radius.sm,
57
+ visibility: "hidden",
58
+ pointerEvents: "none"
59
+ }), oe = e({
60
+ inlineSize: "100%",
61
+ paddingInline: 0,
62
+ borderRadius: "var(--expanding-search-radius)",
63
+ borderColor: l.color.borderControl,
64
+ backgroundColor: l.color.surfaceRaised,
65
+ [n]: {
66
+ borderColor: "ButtonText",
67
+ color: "ButtonText"
68
+ }
69
+ }), se = e({
70
+ borderRadius: "var(--expanding-search-radius)",
71
+ overflow: "clip"
72
+ }), ce = e({
73
+ display: "flex",
74
+ inlineSize: l.space[4],
75
+ blockSize: l.space[4],
76
+ "& > svg": {
77
+ inlineSize: "100%",
78
+ blockSize: "100%"
79
+ }
80
+ }), y = /* @__PURE__ */ d("svg", {
81
+ viewBox: "0 0 24 24",
82
+ fill: "none",
83
+ stroke: "currentColor",
84
+ strokeWidth: "2",
85
+ children: [/* @__PURE__ */ u("circle", {
86
+ cx: "10.5",
87
+ cy: "10.5",
88
+ r: "6.5"
89
+ }), /* @__PURE__ */ u("path", { d: "m16 16 5 5" })]
90
+ }), le = (e, t) => e?.expanded === t.expanded && e.size === t.size && e.radius === t.radius;
91
+ function b({ ref: e, inputRef: n, triggerLabel: h, open: b, defaultOpen: ue = !1, onOpenChange: x, anchor: S = "end", expandedWidth: C = `calc(${l.space[12]} * 8)`, size: w = "md", disabled: T, value: de, defaultValue: fe, onValueChange: pe, label: E, description: D, error: O, clearable: k, messages: A, searchIcon: j = y, clearIcon: M, slotProps: N, inputProps: P, className: F, sx: I, dir: L, style: R, onKeyDown: z, onBlur: B, ...me }) {
92
+ let [V = !1, H] = r(b, ue, x), U = c(null), W = c(null), G = c(null), K = c(null), q = c(null), he = f([U, e]), ge = f([G, n]), J = ee(), Y = c(null), [X, _e] = te(), Z = m(0), Q = m(0), $ = c(void 0);
93
+ s(() => {
94
+ let e = U.current, t = q.current;
95
+ if (!e || !t) return;
96
+ let n = () => {
97
+ let e = t.getBoundingClientRect(), n = {
98
+ expanded: e.width,
99
+ size: e.height,
100
+ radius: Number.parseFloat(getComputedStyle(t).borderStartStartRadius)
101
+ };
102
+ _e((e) => le(e, n) ? e : n);
103
+ };
104
+ n();
105
+ let r = e.ownerDocument.defaultView?.ResizeObserver;
106
+ if (!r) return;
107
+ let i = new r(n);
108
+ return i.observe(e), i.observe(t), () => i.disconnect();
109
+ }, [C]), s(() => {
110
+ let e = W.current;
111
+ if (!e || !X) return;
112
+ let t = V ? {
113
+ width: X.expanded,
114
+ radius: X.radius
115
+ } : {
116
+ width: X.size,
117
+ radius: X.size / 2
118
+ }, n = () => {
119
+ e.style.inlineSize = `${Z.get()}px`, e.style.setProperty("--expanding-search-radius", `${Q.get()}px`);
120
+ }, r = () => {
121
+ Z.jump(t.width), Q.jump(t.radius), n();
122
+ }, i = [Z.on("change", n), Q.on("change", n)], a = e.ownerDocument.defaultView?.matchMedia(ne);
123
+ $.current === void 0 || $.current === V || a?.matches ? r() : (p(Z, t.width, g), p(Q, t.radius, g)), $.current = V;
124
+ let o = () => {
125
+ a?.matches && r();
126
+ };
127
+ return a?.addEventListener("change", o), () => {
128
+ i.forEach((e) => e()), a?.removeEventListener("change", o), Z.stop(), Q.stop();
129
+ };
130
+ }, [
131
+ V,
132
+ X,
133
+ Z,
134
+ Q
135
+ ]), s(() => {
136
+ let e = U.current;
137
+ if (!e) return;
138
+ let t = e.ownerDocument.activeElement;
139
+ V && Y.current === "input" ? (Y.current = null, (e.contains(t) || t === e.ownerDocument.body) && G.current?.focus()) : !V && Y.current === "trigger" && (Y.current = null, (e.contains(t) || t === e.ownerDocument.body) && K.current?.focus());
140
+ }, [V]);
141
+ let ve = P?.["aria-label"] ?? (!i(E) || E === "" ? h : void 0);
142
+ return /* @__PURE__ */ u(t, {
143
+ className: F,
144
+ styles: [re, ie[w]],
145
+ sx: I,
146
+ children: (e) => /* @__PURE__ */ d("div", {
147
+ ...me,
148
+ ref: he,
149
+ className: e,
150
+ dir: L,
151
+ "data-ui": "expanding-search",
152
+ "data-state": V ? "open" : "closed",
153
+ style: {
154
+ "--expanding-search-width": C,
155
+ ...R
156
+ },
157
+ onKeyDown: (e) => {
158
+ z?.(e), !(e.defaultPrevented || !V || T || e.key !== "Escape" || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) && (e.preventDefault(), Y.current = "trigger", H(!1));
159
+ },
160
+ onBlur: (e) => {
161
+ if (B?.(e), e.defaultPrevented || !V) return;
162
+ let t = e.currentTarget, n = e.relatedTarget;
163
+ n && !t.contains(n) ? (Y.current = null, H(!1)) : n || queueMicrotask(() => {
164
+ t.isConnected && t.ownerDocument.hasFocus() && !t.contains(t.ownerDocument.activeElement) && (Y.current = null, H(!1));
165
+ });
166
+ },
167
+ children: [/* @__PURE__ */ u("span", {
168
+ ref: q,
169
+ "aria-hidden": !0,
170
+ css: ae
171
+ }), /* @__PURE__ */ d("div", {
172
+ ref: W,
173
+ css: _,
174
+ "data-anchor": S,
175
+ "data-state": V ? "open" : "closed",
176
+ children: [/* @__PURE__ */ u("div", {
177
+ hidden: V,
178
+ inert: V,
179
+ css: v,
180
+ children: /* @__PURE__ */ u(a, {
181
+ ref: K,
182
+ size: w,
183
+ variant: "outline",
184
+ disabled: T,
185
+ "aria-label": h,
186
+ "aria-expanded": V,
187
+ "aria-controls": J,
188
+ css: oe,
189
+ onClick: () => {
190
+ Y.current = "input", H(!0);
191
+ },
192
+ children: /* @__PURE__ */ u("span", {
193
+ "aria-hidden": !0,
194
+ css: ce,
195
+ children: j
196
+ })
197
+ })
198
+ }), /* @__PURE__ */ u("div", {
199
+ id: J,
200
+ "aria-hidden": !V || void 0,
201
+ inert: !V,
202
+ style: { visibility: V ? "visible" : "hidden" },
203
+ children: /* @__PURE__ */ u(o, {
204
+ ...P,
205
+ ref: ge,
206
+ size: w,
207
+ dir: L,
208
+ disabled: T,
209
+ value: de,
210
+ defaultValue: fe,
211
+ onValueChange: pe,
212
+ label: E,
213
+ description: D,
214
+ error: O,
215
+ clearable: k,
216
+ messages: A,
217
+ searchIcon: j,
218
+ clearIcon: M,
219
+ "aria-label": ve,
220
+ slotProps: {
221
+ ...N,
222
+ shell: {
223
+ ...N?.shell,
224
+ css: [se, N?.shell?.css]
225
+ }
226
+ },
227
+ onKeyDown: (e) => {
228
+ P?.onKeyDown?.(e), !(e.defaultPrevented || T || e.key !== "Escape" || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) && (e.preventDefault(), Y.current = "trigger", H(!1));
229
+ }
230
+ })
231
+ })]
232
+ })]
233
+ })
234
+ });
235
+ }
236
+ b.displayName = "ExpandingSearch";
237
+ //#endregion
238
+ export { b as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as ExpandingSearch } from "./expanding-search-BxOwtdwt.js";