beez-ui 2.5.0 → 2.6.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 (92) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/components/alert-dialog.d.ts +15 -4
  4. package/dist/components/alert-dialog.js +84 -44
  5. package/dist/components/alert.d.ts +30 -9
  6. package/dist/components/alert.js +360 -39
  7. package/dist/components/avatar.d.ts +33 -10
  8. package/dist/components/avatar.js +110 -30
  9. package/dist/components/badge.d.ts +39 -7
  10. package/dist/components/badge.js +348 -24
  11. package/dist/components/calendar.d.ts +29 -2
  12. package/dist/components/calendar.js +1035 -223
  13. package/dist/components/card.d.ts +17 -1
  14. package/dist/components/card.js +34 -8
  15. package/dist/components/carousel.d.ts +29 -2
  16. package/dist/components/carousel.js +471 -90
  17. package/dist/components/checkbox.d.ts +13 -2
  18. package/dist/components/checkbox.js +301 -41
  19. package/dist/components/dialog-surface.d.ts +27 -0
  20. package/dist/components/dialog-surface.js +137 -0
  21. package/dist/components/dialog.d.ts +21 -4
  22. package/dist/components/dialog.js +163 -96
  23. package/dist/components/dropdown-menu.d.ts +30 -16
  24. package/dist/components/dropdown-menu.js +139 -83
  25. package/dist/components/hover-card.d.ts +46 -3
  26. package/dist/components/hover-card.js +423 -60
  27. package/dist/components/pagination.d.ts +32 -14
  28. package/dist/components/pagination.js +136 -59
  29. package/dist/components/popover.d.ts +14 -5
  30. package/dist/components/popover.js +78 -36
  31. package/dist/components/radio-group.d.ts +19 -3
  32. package/dist/components/radio-group.js +400 -57
  33. package/dist/components/select.d.ts +17 -6
  34. package/dist/components/select.js +83 -71
  35. package/dist/components/sheet.js +37 -26
  36. package/dist/components/sidebar.js +11 -0
  37. package/dist/components/skeleton.d.ts +19 -5
  38. package/dist/components/skeleton.js +434 -14
  39. package/dist/components/switch.d.ts +14 -4
  40. package/dist/components/switch.js +424 -40
  41. package/dist/components/tabs.d.ts +38 -5
  42. package/dist/components/tabs.js +564 -97
  43. package/dist/components/themed-toaster.d.ts +6 -2
  44. package/dist/components/themed-toaster.js +80 -50
  45. package/dist/components/tooltip.d.ts +33 -2
  46. package/dist/components/tooltip.js +197 -69
  47. package/dist/constants/alert.d.ts +12 -0
  48. package/dist/constants/alert.js +9 -0
  49. package/dist/constants/avatar.d.ts +10 -0
  50. package/dist/constants/avatar.js +7 -0
  51. package/dist/constants/badge.d.ts +6 -0
  52. package/dist/constants/badge.js +6 -0
  53. package/dist/constants/calendar.d.ts +24 -0
  54. package/dist/constants/calendar.js +22 -0
  55. package/dist/constants/carousel.d.ts +37 -0
  56. package/dist/constants/carousel.js +53 -0
  57. package/dist/constants/checkbox.d.ts +17 -0
  58. package/dist/constants/checkbox.js +17 -0
  59. package/dist/constants/dialog.d.ts +6 -0
  60. package/dist/constants/dialog.js +6 -0
  61. package/dist/constants/dropdown-menu.d.ts +5 -0
  62. package/dist/constants/dropdown-menu.js +5 -0
  63. package/dist/constants/hover-card.d.ts +37 -0
  64. package/dist/constants/hover-card.js +85 -0
  65. package/dist/constants/pagination.d.ts +9 -0
  66. package/dist/constants/pagination.js +9 -0
  67. package/dist/constants/popover.d.ts +7 -0
  68. package/dist/constants/popover.js +39 -0
  69. package/dist/constants/radio-group.d.ts +10 -0
  70. package/dist/constants/radio-group.js +10 -0
  71. package/dist/constants/select.d.ts +3 -0
  72. package/dist/constants/select.js +3 -0
  73. package/dist/constants/skeleton.d.ts +17 -0
  74. package/dist/constants/skeleton.js +17 -0
  75. package/dist/constants/switch.d.ts +44 -0
  76. package/dist/constants/switch.js +49 -0
  77. package/dist/constants/tabs.d.ts +17 -0
  78. package/dist/constants/tabs.js +17 -0
  79. package/dist/constants/toast.d.ts +3 -0
  80. package/dist/constants/toast.js +3 -0
  81. package/dist/constants/tooltip.d.ts +13 -0
  82. package/dist/constants/tooltip.js +52 -0
  83. package/dist/lib/toast-layer.d.ts +24 -0
  84. package/dist/lib/toast-layer.js +76 -0
  85. package/dist/motion/arc-floating-slot.d.ts +40 -0
  86. package/dist/motion/arc-floating-slot.js +167 -0
  87. package/dist/motion/glide-indicator.d.ts +6 -7
  88. package/dist/motion/glide-indicator.js +5 -3
  89. package/dist/motion/overlay-warmth.d.ts +24 -0
  90. package/dist/motion/overlay-warmth.js +70 -0
  91. package/dist/styles.css +1 -1
  92. package/package.json +1 -1
@@ -1,67 +1,451 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
- import * as React from "react";
3
+ /**
4
+ * Arc's Switch (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a pill track that crossfades between its
5
+ * two fills while the thumb glides on a critically damped spring. Held down, the thumb widens toward the other side
6
+ * with its far edge anchored, like a finger on it. With a `label` the text sits inside the control; without it the
7
+ * switch renders the bare track, for rows that place their own label.
8
+ */
9
+ import { useEffect, useRef, useState } from "react";
4
10
  import { Switch as SwitchPrimitive } from "radix-ui";
5
- import { MotionSlot } from "../motion/motion-slot.js";
11
+ import { animate, frameData, motion, useMotionValue } from "motion/react";
12
+ import { SWITCH_CHANGE_STRETCH, SWITCH_PRESS_RELEASE_WINDOW_MS, SWITCH_PRESS_STRETCH_PX, SWITCH_PRIMARY_POINTER_BUTTON, SWITCH_THUMB_GEOMETRY_PX, SWITCH_THUMB_GLIDE_SPRING, SWITCH_TOGGLE_KEY } from "../constants/switch.js";
13
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
6
14
  import { cn } from "../lib/utils.js";
7
- import { jsx as _jsx } from "react/jsx-runtime";
15
+ import { ARC_SPRING_SNAPPY } from "../motion/arc-tokens.js";
16
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
+ /**
18
+ * Arc's control recipe. The bare switch keeps the track's own box and widens its hit area with a pseudo-element, so
19
+ * rows that already lay it out do not grow; with a label it takes Arc's full control height. Hover only answers on
20
+ * hover-capable fine pointers, and keyboard focus uses the theme's focus outline.
21
+ */
22
+ const switchClassName = "peer group/switch relative inline-flex shrink-0 cursor-pointer items-center gap-(--space-3) rounded-(--radius-pill) border-0 bg-transparent p-0 font-sans text-sm text-foreground [-webkit-tap-highlight-color:transparent] after:absolute after:-inset-x-2 after:-inset-y-2.5 disabled:cursor-not-allowed disabled:opacity-50 data-[labelled]:min-h-(--control-height-md) data-[labelled]:rounded-(--radius-control) data-[labelled]:after:hidden hover-fine:data-[state=unchecked]:not-disabled:[&_[data-slot=switch-track]]:bg-(--control-track-hover)";
23
+ /** Fixed box: the thumb moves inside it with transforms, so nothing around the switch shifts. */
24
+ const trackClassName = "relative isolate box-border flex flex-none items-center rounded-(--radius-pill) bg-(--control-track) transition-[background-color] duration-(--duration-fast) ease-(--ease-standard) before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:bg-(--control-on) before:opacity-0 before:transition-opacity before:duration-(--duration-standard) before:ease-(--ease-standard) group-data-[state=checked]/switch:before:opacity-100 group-aria-invalid/switch:shadow-[0_0_0_1px_var(--danger)] group-data-[size=default]/switch:h-6 group-data-[size=default]/switch:w-[42px] group-data-[size=default]/switch:p-[3px] group-data-[size=sm]/switch:h-[18px] group-data-[size=sm]/switch:w-8 group-data-[size=sm]/switch:p-[2px] motion-reduce:transition-none motion-reduce:before:transition-none";
25
+ const thumbClassName = "pointer-events-none block flex-none rounded-(--radius-pill) bg-(--control-thumb) shadow-(--control-thumb-shadow) will-change-transform transition-[background-color] duration-(--duration-standard) ease-(--ease-standard) group-data-[state=checked]/switch:bg-(--control-thumb-on) group-data-[size=default]/switch:h-[18px] group-data-[size=sm]/switch:h-[14px] motion-reduce:transition-none";
26
+ /**
27
+ * Springs a thumb value to its target from where it was last painted, carrying its velocity. Motion samples a stopped
28
+ * animation at the current time, ahead of the last painted frame, and renders that sample right after the commit, so
29
+ * a reversed glide would otherwise jump by up to a frame of travel, more when frames run long.
30
+ * @param value - The motion value to animate.
31
+ * @param paintedValue - The value last written to the screen.
32
+ * @param target - Where the value should settle.
33
+ * @param transition - Spring to travel on.
34
+ * @returns The running animation, or `undefined` when the value already rests on its target.
35
+ */
36
+ function glideFromPainted(value, paintedValue, target, transition) {
37
+ if (!value.isAnimating() && value.get() === target) return undefined;
38
+ const velocity = value.getVelocity();
39
+ value.jump(paintedValue);
40
+ return animate(value, [paintedValue, target], {
41
+ ...transition,
42
+ velocity
43
+ });
44
+ }
45
+ /**
46
+ * A binary setting that applies at once, controlled or uncontrolled like Radix's switch.
47
+ * @param switchProps - Every Radix switch prop, including `ref`, plus the Arc `size` and `label`.
48
+ * @returns The switch button, with its label inside when one is passed.
49
+ */
8
50
  function Switch(t0) {
9
- const $ = _c(11);
51
+ const $ = _c(85);
52
+ let ariaLabel;
53
+ let checked;
10
54
  let className;
55
+ let defaultChecked;
56
+ let disabled;
57
+ let label;
58
+ let onBlur;
59
+ let onCheckedChange;
60
+ let onKeyDown;
61
+ let onKeyUp;
62
+ let onPointerCancel;
63
+ let onPointerDown;
64
+ let onPointerLeave;
65
+ let onPointerUp;
11
66
  let props;
12
67
  let t1;
13
68
  if ($[0] !== t0) {
14
- ({className, size: t1, ...props} = t0);
69
+ ({className, size: t1, label, checked, defaultChecked, onCheckedChange, onPointerDown, onPointerUp, onPointerLeave, onPointerCancel, onKeyDown, onKeyUp, onBlur, disabled, "aria-label": ariaLabel, ...props} = t0);
15
70
  $[0] = t0;
16
- $[1] = className;
17
- $[2] = props;
18
- $[3] = t1;
71
+ $[1] = ariaLabel;
72
+ $[2] = checked;
73
+ $[3] = className;
74
+ $[4] = defaultChecked;
75
+ $[5] = disabled;
76
+ $[6] = label;
77
+ $[7] = onBlur;
78
+ $[8] = onCheckedChange;
79
+ $[9] = onKeyDown;
80
+ $[10] = onKeyUp;
81
+ $[11] = onPointerCancel;
82
+ $[12] = onPointerDown;
83
+ $[13] = onPointerLeave;
84
+ $[14] = onPointerUp;
85
+ $[15] = props;
86
+ $[16] = t1;
19
87
  } else {
20
- className = $[1];
21
- props = $[2];
22
- t1 = $[3];
88
+ ariaLabel = $[1];
89
+ checked = $[2];
90
+ className = $[3];
91
+ defaultChecked = $[4];
92
+ disabled = $[5];
93
+ label = $[6];
94
+ onBlur = $[7];
95
+ onCheckedChange = $[8];
96
+ onKeyDown = $[9];
97
+ onKeyUp = $[10];
98
+ onPointerCancel = $[11];
99
+ onPointerDown = $[12];
100
+ onPointerLeave = $[13];
101
+ onPointerUp = $[14];
102
+ props = $[15];
103
+ t1 = $[16];
23
104
  }
24
105
  const size = t1 === undefined ? "default" : t1;
106
+ const reduceMotion = usePrefersReducedMotion();
107
+ const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked ?? false);
108
+ const [isPressed, setIsPressed] = useState(false);
109
+ const isChecked = checked ?? uncontrolledChecked;
110
+ const geometry = SWITCH_THUMB_GEOMETRY_PX[size];
111
+ const stretch = isPressed && !reduceMotion && !disabled ? SWITCH_PRESS_STRETCH_PX[size] : 0;
112
+ const targetX = isChecked ? geometry.travel - stretch : 0;
113
+ const targetWidth = geometry.size + stretch;
114
+ const x = useMotionValue(targetX);
115
+ const width = useMotionValue(targetWidth);
116
+ const scaleX = useMotionValue(1);
25
117
  let t2;
26
- if ($[4] !== className) {
27
- t2 = cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className);
28
- $[4] = className;
29
- $[5] = t2;
118
+ if ($[17] !== targetWidth || $[18] !== targetX) {
119
+ t2 = {
120
+ x: targetX,
121
+ width: targetWidth,
122
+ scaleX: 1
123
+ };
124
+ $[17] = targetWidth;
125
+ $[18] = targetX;
126
+ $[19] = t2;
30
127
  } else {
31
- t2 = $[5];
128
+ t2 = $[19];
32
129
  }
130
+ const painted = useRef(t2);
131
+ const shownChecked = useRef(isChecked);
132
+ const releasedAt = useRef(-Infinity);
33
133
  let t3;
34
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
35
- t3 = /* @__PURE__ */ _jsx(MotionSlot, {
36
- kind: "thumb",
134
+ let t4;
135
+ if ($[20] !== scaleX || $[21] !== width || $[22] !== x) {
136
+ t3 = () => {
137
+ const trackPainted = (key) => (value) => {
138
+ if (frameData.isProcessing) {
139
+ painted.current[key] = value;
140
+ }
141
+ };
142
+ const unsubscribes = [
143
+ x.on("change", trackPainted("x")),
144
+ width.on("change", trackPainted("width")),
145
+ scaleX.on("change", trackPainted("scaleX"))
146
+ ];
147
+ return () => unsubscribes.forEach(_temp);
148
+ };
149
+ t4 = [
150
+ x,
151
+ width,
152
+ scaleX
153
+ ];
154
+ $[20] = scaleX;
155
+ $[21] = width;
156
+ $[22] = x;
157
+ $[23] = t3;
158
+ $[24] = t4;
159
+ } else {
160
+ t3 = $[23];
161
+ t4 = $[24];
162
+ }
163
+ useEffect(t3, t4);
164
+ let t5;
165
+ let t6;
166
+ if ($[25] !== reduceMotion || $[26] !== targetWidth || $[27] !== targetX || $[28] !== width || $[29] !== x) {
167
+ t5 = () => {
168
+ if (reduceMotion) {
169
+ x.jump(targetX);
170
+ width.jump(targetWidth);
171
+ painted.current = {
172
+ ...painted.current,
173
+ x: targetX,
174
+ width: targetWidth
175
+ };
176
+ return;
177
+ }
178
+ const xControls = glideFromPainted(x, painted.current.x, targetX, SWITCH_THUMB_GLIDE_SPRING);
179
+ const widthControls = glideFromPainted(width, painted.current.width, targetWidth, ARC_SPRING_SNAPPY);
180
+ return () => {
181
+ xControls?.stop();
182
+ widthControls?.stop();
183
+ };
184
+ };
185
+ t6 = [
186
+ targetX,
187
+ targetWidth,
188
+ reduceMotion,
189
+ x,
190
+ width
191
+ ];
192
+ $[25] = reduceMotion;
193
+ $[26] = targetWidth;
194
+ $[27] = targetX;
195
+ $[28] = width;
196
+ $[29] = x;
197
+ $[30] = t5;
198
+ $[31] = t6;
199
+ } else {
200
+ t5 = $[30];
201
+ t6 = $[31];
202
+ }
203
+ useEffect(t5, t6);
204
+ let t7;
205
+ let t8;
206
+ if ($[32] !== isChecked || $[33] !== reduceMotion || $[34] !== scaleX) {
207
+ t7 = () => {
208
+ if (shownChecked.current === isChecked) {
209
+ return;
210
+ }
211
+ shownChecked.current = isChecked;
212
+ const isFromPress = performance.now() - releasedAt.current < SWITCH_PRESS_RELEASE_WINDOW_MS;
213
+ if (reduceMotion || isFromPress) {
214
+ return;
215
+ }
216
+ const { scaleX: keyframes, ...transition } = SWITCH_CHANGE_STRETCH;
217
+ const [, peakScale, restingScale] = keyframes;
218
+ scaleX.jump(painted.current.scaleX);
219
+ const controls = animate(scaleX, [
220
+ painted.current.scaleX,
221
+ peakScale,
222
+ restingScale
223
+ ], {
224
+ ...transition,
225
+ times: [...transition.times],
226
+ ease: [...transition.ease]
227
+ });
228
+ return () => controls.stop();
229
+ };
230
+ t8 = [
231
+ isChecked,
232
+ reduceMotion,
233
+ scaleX
234
+ ];
235
+ $[32] = isChecked;
236
+ $[33] = reduceMotion;
237
+ $[34] = scaleX;
238
+ $[35] = t7;
239
+ $[36] = t8;
240
+ } else {
241
+ t7 = $[35];
242
+ t8 = $[36];
243
+ }
244
+ useEffect(t7, t8);
245
+ let t9;
246
+ if ($[37] !== disabled || $[38] !== isPressed) {
247
+ t9 = () => {
248
+ if (isPressed && !disabled) {
249
+ releasedAt.current = performance.now();
250
+ }
251
+ setIsPressed(false);
252
+ };
253
+ $[37] = disabled;
254
+ $[38] = isPressed;
255
+ $[39] = t9;
256
+ } else {
257
+ t9 = $[39];
258
+ }
259
+ const release = t9;
260
+ const t10 = label ? "" : undefined;
261
+ let t11;
262
+ if ($[40] !== className) {
263
+ t11 = cn(switchClassName, className);
264
+ $[40] = className;
265
+ $[41] = t11;
266
+ } else {
267
+ t11 = $[41];
268
+ }
269
+ const t12 = ariaLabel ?? label;
270
+ let t13;
271
+ if ($[42] !== checked || $[43] !== onCheckedChange) {
272
+ t13 = (nextChecked) => {
273
+ if (checked === undefined) {
274
+ setUncontrolledChecked(nextChecked);
275
+ }
276
+ onCheckedChange?.(nextChecked);
277
+ };
278
+ $[42] = checked;
279
+ $[43] = onCheckedChange;
280
+ $[44] = t13;
281
+ } else {
282
+ t13 = $[44];
283
+ }
284
+ let t14;
285
+ if ($[45] !== onPointerDown) {
286
+ t14 = (event) => {
287
+ onPointerDown?.(event);
288
+ if (event.button === SWITCH_PRIMARY_POINTER_BUTTON) {
289
+ setIsPressed(true);
290
+ }
291
+ };
292
+ $[45] = onPointerDown;
293
+ $[46] = t14;
294
+ } else {
295
+ t14 = $[46];
296
+ }
297
+ let t15;
298
+ if ($[47] !== onPointerUp || $[48] !== release) {
299
+ t15 = (event_0) => {
300
+ onPointerUp?.(event_0);
301
+ release();
302
+ };
303
+ $[47] = onPointerUp;
304
+ $[48] = release;
305
+ $[49] = t15;
306
+ } else {
307
+ t15 = $[49];
308
+ }
309
+ let t16;
310
+ if ($[50] !== onPointerLeave) {
311
+ t16 = (event_1) => {
312
+ onPointerLeave?.(event_1);
313
+ setIsPressed(false);
314
+ };
315
+ $[50] = onPointerLeave;
316
+ $[51] = t16;
317
+ } else {
318
+ t16 = $[51];
319
+ }
320
+ let t17;
321
+ if ($[52] !== onPointerCancel) {
322
+ t17 = (event_2) => {
323
+ onPointerCancel?.(event_2);
324
+ setIsPressed(false);
325
+ };
326
+ $[52] = onPointerCancel;
327
+ $[53] = t17;
328
+ } else {
329
+ t17 = $[53];
330
+ }
331
+ let t18;
332
+ if ($[54] !== onKeyDown) {
333
+ t18 = (event_3) => {
334
+ onKeyDown?.(event_3);
335
+ if (event_3.key === SWITCH_TOGGLE_KEY) {
336
+ setIsPressed(true);
337
+ }
338
+ };
339
+ $[54] = onKeyDown;
340
+ $[55] = t18;
341
+ } else {
342
+ t18 = $[55];
343
+ }
344
+ let t19;
345
+ if ($[56] !== onKeyUp || $[57] !== release) {
346
+ t19 = (event_4) => {
347
+ onKeyUp?.(event_4);
348
+ release();
349
+ };
350
+ $[56] = onKeyUp;
351
+ $[57] = release;
352
+ $[58] = t19;
353
+ } else {
354
+ t19 = $[58];
355
+ }
356
+ let t20;
357
+ if ($[59] !== onBlur) {
358
+ t20 = (event_5) => {
359
+ onBlur?.(event_5);
360
+ setIsPressed(false);
361
+ };
362
+ $[59] = onBlur;
363
+ $[60] = t20;
364
+ } else {
365
+ t20 = $[60];
366
+ }
367
+ let t21;
368
+ if ($[61] !== scaleX || $[62] !== width || $[63] !== x) {
369
+ t21 = /* @__PURE__ */ _jsx("span", {
370
+ "data-slot": "switch-track",
371
+ className: trackClassName,
37
372
  children: /* @__PURE__ */ _jsx(SwitchPrimitive.Thumb, {
38
- "data-slot": "switch-thumb",
39
- className: "pointer-events-none block rounded-full bg-background shadow-sm ring-0 group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
373
+ asChild: true,
374
+ children: /* @__PURE__ */ _jsx(motion.span, {
375
+ "data-slot": "switch-thumb",
376
+ className: thumbClassName,
377
+ style: {
378
+ x,
379
+ width,
380
+ scaleX
381
+ }
382
+ })
40
383
  })
41
384
  });
42
- $[6] = t3;
385
+ $[61] = scaleX;
386
+ $[62] = width;
387
+ $[63] = x;
388
+ $[64] = t21;
43
389
  } else {
44
- t3 = $[6];
390
+ t21 = $[64];
45
391
  }
46
- let t4;
47
- if ($[7] !== props || $[8] !== size || $[9] !== t2) {
48
- t4 = /* @__PURE__ */ _jsx(MotionSlot, {
49
- kind: "field",
50
- children: /* @__PURE__ */ _jsx(SwitchPrimitive.Root, {
51
- "data-slot": "switch",
52
- "data-size": size,
53
- className: t2,
54
- ...props,
55
- children: t3
56
- })
392
+ let t22;
393
+ if ($[65] !== label) {
394
+ t22 = label ? /* @__PURE__ */ _jsx("span", {
395
+ "data-slot": "switch-label",
396
+ className: "leading-(--leading-body)",
397
+ children: label
398
+ }) : null;
399
+ $[65] = label;
400
+ $[66] = t22;
401
+ } else {
402
+ t22 = $[66];
403
+ }
404
+ let t23;
405
+ if ($[67] !== disabled || $[68] !== isChecked || $[69] !== props || $[70] !== size || $[71] !== t10 || $[72] !== t11 || $[73] !== t12 || $[74] !== t13 || $[75] !== t14 || $[76] !== t15 || $[77] !== t16 || $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t20 || $[82] !== t21 || $[83] !== t22) {
406
+ t23 = /* @__PURE__ */ _jsxs(SwitchPrimitive.Root, {
407
+ "data-slot": "switch",
408
+ "data-size": size,
409
+ "data-labelled": t10,
410
+ className: t11,
411
+ ...props,
412
+ disabled,
413
+ checked: isChecked,
414
+ "aria-label": t12,
415
+ onCheckedChange: t13,
416
+ onPointerDown: t14,
417
+ onPointerUp: t15,
418
+ onPointerLeave: t16,
419
+ onPointerCancel: t17,
420
+ onKeyDown: t18,
421
+ onKeyUp: t19,
422
+ onBlur: t20,
423
+ children: [t21, t22]
57
424
  });
58
- $[7] = props;
59
- $[8] = size;
60
- $[9] = t2;
61
- $[10] = t4;
425
+ $[67] = disabled;
426
+ $[68] = isChecked;
427
+ $[69] = props;
428
+ $[70] = size;
429
+ $[71] = t10;
430
+ $[72] = t11;
431
+ $[73] = t12;
432
+ $[74] = t13;
433
+ $[75] = t14;
434
+ $[76] = t15;
435
+ $[77] = t16;
436
+ $[78] = t17;
437
+ $[79] = t18;
438
+ $[80] = t19;
439
+ $[81] = t20;
440
+ $[82] = t21;
441
+ $[83] = t22;
442
+ $[84] = t23;
62
443
  } else {
63
- t4 = $[10];
444
+ t23 = $[84];
64
445
  }
65
- return t4;
446
+ return t23;
447
+ }
448
+ function _temp(unsubscribe) {
449
+ return unsubscribe();
66
450
  }
67
451
  export { Switch };
@@ -1,11 +1,44 @@
1
- import * as React from "react";
1
+ /**
2
+ * Arc's Tabs (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): its segmented list on Arc's tokens, a
3
+ * highlight that glides between triggers with Arc's morph spring, a list that scrolls sideways and keeps the active
4
+ * tab in view, and panels that slide in from the side of the chosen tab while their height morphs from the previous
5
+ * panel. Radix keeps the roles, keyboard navigation and controlled or uncontrolled value.
6
+ */
7
+ import { type ComponentProps } from "react";
2
8
  import { type VariantProps } from "class-variance-authority";
3
9
  import { Tabs as TabsPrimitive } from "radix-ui";
4
- declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
10
+ /**
11
+ * Groups a tab list with its panels. Accepts Radix's `value`/`defaultValue`/`onValueChange` contract unchanged.
12
+ * @param props - Radix root props, including `orientation` and `ref`.
13
+ * @returns The tabs root.
14
+ */
15
+ declare function Tabs({ className, orientation, value, defaultValue, onValueChange, ref, ...props }: ComponentProps<typeof TabsPrimitive.Root>): import("react").JSX.Element;
16
+ /**
17
+ * Arc's segmented list (`default`): a muted track whose active trigger is a raised surface. `line` keeps the
18
+ * underline variant on the same tokens. Horizontal lists scroll sideways without a visible scrollbar.
19
+ */
5
20
  declare const tabsListVariants: (props?: ({
6
21
  variant?: "default" | "line" | null | undefined;
7
22
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
- declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
9
- declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
10
- declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
23
+ /**
24
+ * Holds the triggers. The active highlight glides to the newly selected trigger and the list scrolls to keep the
25
+ * active or focused trigger visible.
26
+ * @param props - Radix list props, the `variant` and `ref`.
27
+ * @returns The tab list.
28
+ */
29
+ declare function TabsList({ className, variant, ref, onFocusCapture, ...props }: ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): import("react").JSX.Element;
30
+ /**
31
+ * Selects a panel. Arc's trigger: muted label, accent label once active, hover only on fine pointers and the
32
+ * shared keyboard focus outline.
33
+ * @param props - Radix trigger props, including `value`.
34
+ * @returns The tab.
35
+ */
36
+ declare function TabsTrigger({ className, value, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>): import("react").JSX.Element;
37
+ /**
38
+ * Content of one tab. Inside `Tabs` it animates between panels; with `forceMount` it stays mounted and switches
39
+ * without motion, as Radix renders it. With `asChild` the consumer's element is the panel in both cases.
40
+ * @param props - Radix content props, including `value` and `forceMount`.
41
+ * @returns The tab panel, or nothing while another tab is active.
42
+ */
43
+ declare function TabsContent({ className, value, forceMount, asChild, children, ...props }: ComponentProps<typeof TabsPrimitive.Content>): import("react").JSX.Element;
11
44
  export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };