beez-ui 2.7.1 → 3.0.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.
- package/CHANGELOG.md +78 -0
- package/README.md +43 -13
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/account-menu.d.ts +4 -3
- package/dist/components/account-menu.js +63 -54
- package/dist/components/alert.d.ts +15 -15
- package/dist/components/alert.js +289 -270
- package/dist/components/animated-theme-toggler.js +1 -1
- package/dist/components/avatar.d.ts +56 -31
- package/dist/components/avatar.js +394 -277
- package/dist/components/badge.d.ts +8 -28
- package/dist/components/badge.js +55 -108
- package/dist/components/calendar.d.ts +36 -26
- package/dist/components/calendar.js +132 -1227
- package/dist/components/card.d.ts +36 -25
- package/dist/components/card.js +895 -72
- package/dist/components/carousel.d.ts +63 -47
- package/dist/components/carousel.js +496 -777
- package/dist/components/data-table.d.ts +5 -4
- package/dist/components/data-table.js +7 -6
- package/dist/components/dialog-surface.d.ts +23 -1
- package/dist/components/dialog-surface.js +99 -3
- package/dist/components/dialog.d.ts +80 -45
- package/dist/components/dialog.js +258 -503
- package/dist/components/dropdown-menu.d.ts +56 -73
- package/dist/components/dropdown-menu.js +79 -714
- package/dist/components/field.d.ts +3 -1
- package/dist/components/field.js +49 -39
- package/dist/components/filter-presets-bar.js +2 -2
- package/dist/components/filter-query-bar.js +1 -1
- package/dist/components/hover-card.d.ts +42 -41
- package/dist/components/hover-card.js +57 -483
- package/dist/components/pagination.d.ts +53 -31
- package/dist/components/pagination.js +176 -412
- package/dist/components/popover.d.ts +11 -23
- package/dist/components/popover.js +19 -304
- package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
- package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +268 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +557 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +36 -0
- package/dist/components/primitives/select.js +407 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/radio-group.d.ts +30 -17
- package/dist/components/radio-group.js +266 -315
- package/dist/components/rich-link-editor.js +1 -1
- package/dist/components/select.d.ts +51 -42
- package/dist/components/select.js +163 -495
- package/dist/components/skeleton.d.ts +16 -15
- package/dist/components/skeleton.js +99 -205
- package/dist/components/split-button.js +1 -1
- package/dist/components/switch.d.ts +3 -6
- package/dist/components/switch.js +163 -170
- package/dist/components/tabs.d.ts +3 -11
- package/dist/components/tabs.js +61 -75
- package/dist/components/themed-toaster.d.ts +1 -1
- package/dist/components/themed-toaster.js +1 -1
- package/dist/components/toaster.d.ts +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/tooltip.d.ts +36 -31
- package/dist/components/tooltip.js +44 -284
- package/dist/constants/alert.d.ts +5 -1
- package/dist/constants/alert.js +5 -1
- package/dist/constants/avatar.d.ts +29 -1
- package/dist/constants/avatar.js +25 -0
- package/dist/constants/calendar.d.ts +12 -0
- package/dist/constants/calendar.js +12 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +31 -13
- package/dist/constants/carousel.js +32 -11
- package/dist/constants/dialog.d.ts +6 -1
- package/dist/constants/dialog.js +5 -1
- package/dist/constants/dropdown-menu.d.ts +2 -2
- package/dist/constants/dropdown-menu.js +2 -2
- package/dist/constants/pagination.d.ts +13 -2
- package/dist/constants/pagination.js +13 -2
- package/dist/constants/select.d.ts +4 -2
- package/dist/constants/select.js +4 -2
- package/dist/constants/switch.d.ts +5 -16
- package/dist/constants/switch.js +6 -14
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/motion/glide-indicator.d.ts +1 -1
- package/dist/motion/glide-indicator.js +1 -1
- package/dist/motion/presence.d.ts +0 -1
- package/dist/motion/presence.js +0 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -6
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type SkeletonProps =
|
|
3
|
-
/**
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type SkeletonProps = {
|
|
3
|
+
/** Accessible name of the loading status; defaults to "Cargando contenido". */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Number of text lines, clamped to 1-6; defaults to 3. */
|
|
4
6
|
lines?: number;
|
|
5
|
-
/** Adds a round avatar block before the lines
|
|
7
|
+
/** Adds a round avatar block before the lines. */
|
|
6
8
|
avatar?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Turns the skeleton into Arc's reveal: while true it shows the composed placeholder, and once false it crossfades
|
|
11
|
-
* into `children` while the height springs to the content's size.
|
|
12
|
-
*/
|
|
9
|
+
/** Content to reveal once loading finishes; with children the placeholder crossfades into them. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Keeps the placeholder visible while true (the default). Only used together with `children`. */
|
|
13
12
|
loading?: boolean;
|
|
13
|
+
/** Classes for the outer element: the placeholder, or the reveal frame when there are children. */
|
|
14
|
+
className?: string;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
|
-
* Reserves space while content loads. Without Arc's
|
|
17
|
-
*
|
|
18
|
-
* @param props -
|
|
19
|
-
* @returns The placeholder, or the reveal frame when
|
|
17
|
+
* Reserves space while content loads. Without children it draws Arc's placeholder, three text lines by default; with
|
|
18
|
+
* children it shows that placeholder while `loading` and then crossfades into them.
|
|
19
|
+
* @param props - Placeholder shape, accessible label, loading state and classes.
|
|
20
|
+
* @returns The placeholder, or the reveal frame when there are children.
|
|
20
21
|
*/
|
|
21
|
-
declare function Skeleton({ lines, avatar,
|
|
22
|
+
declare function Skeleton({ label, lines, avatar, children, loading, className, }: SkeletonProps): import("react").JSX.Element;
|
|
22
23
|
export { Skeleton };
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
/**
|
|
4
4
|
* Arc's Skeleton (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): placeholders that reserve space while
|
|
5
|
-
* content loads, with a calm, finite pulse that ripples down the blocks and rests after about 20 seconds.
|
|
6
|
-
*
|
|
7
|
-
* content while the height springs to its new size
|
|
5
|
+
* content loads, with a calm, finite pulse that ripples down the blocks and rests after about 20 seconds. It draws
|
|
6
|
+
* Arc's placeholder of text lines and an optional avatar, and with children its reveal, which crossfades into the
|
|
7
|
+
* content while the height springs to its new size. Like Arc, it only draws lines and an avatar: other shapes are
|
|
8
|
+
* built by the consumer.
|
|
8
9
|
*/
|
|
9
10
|
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
10
11
|
import { AnimatePresence, animate, motion, useIsPresent } from "motion/react";
|
|
@@ -75,93 +76,72 @@ function useMorphHeight(contentRef, busy, reduceMotion) {
|
|
|
75
76
|
}
|
|
76
77
|
/** Arc's composed placeholder: an optional avatar and a column of lines, announced once as a busy status. */
|
|
77
78
|
function SkeletonPlaceholder(t0) {
|
|
78
|
-
const $ = _c(
|
|
79
|
-
|
|
80
|
-
let className;
|
|
81
|
-
let label;
|
|
82
|
-
let lines;
|
|
83
|
-
let props;
|
|
84
|
-
if ($[0] !== t0) {
|
|
85
|
-
({lines, avatar, label, className, ...props} = t0);
|
|
86
|
-
$[0] = t0;
|
|
87
|
-
$[1] = avatar;
|
|
88
|
-
$[2] = className;
|
|
89
|
-
$[3] = label;
|
|
90
|
-
$[4] = lines;
|
|
91
|
-
$[5] = props;
|
|
92
|
-
} else {
|
|
93
|
-
avatar = $[1];
|
|
94
|
-
className = $[2];
|
|
95
|
-
label = $[3];
|
|
96
|
-
lines = $[4];
|
|
97
|
-
props = $[5];
|
|
98
|
-
}
|
|
79
|
+
const $ = _c(14);
|
|
80
|
+
const { lines, avatar, label, className } = t0;
|
|
99
81
|
const lineCount = Math.min(Math.max(Math.floor(lines), SKELETON_LINE_LIMITS.min), SKELETON_LINE_LIMITS.max);
|
|
100
82
|
const firstLineIndex = avatar ? 1 : 0;
|
|
101
83
|
let t1;
|
|
102
|
-
if ($[
|
|
84
|
+
if ($[0] !== className) {
|
|
103
85
|
t1 = cn("flex w-full min-w-0 items-start gap-(--space-4)", className);
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
86
|
+
$[0] = className;
|
|
87
|
+
$[1] = t1;
|
|
106
88
|
} else {
|
|
107
|
-
t1 = $[
|
|
89
|
+
t1 = $[1];
|
|
108
90
|
}
|
|
109
91
|
let t2;
|
|
110
|
-
if ($[
|
|
92
|
+
if ($[2] !== avatar) {
|
|
111
93
|
t2 = avatar ? /* @__PURE__ */ _jsx("span", {
|
|
112
94
|
"data-slot": "skeleton",
|
|
113
95
|
"aria-hidden": "true",
|
|
114
96
|
className: cn(blockClassName, "size-(--control-height-md) flex-none rounded-(--radius-pill)")
|
|
115
97
|
}) : null;
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
98
|
+
$[2] = avatar;
|
|
99
|
+
$[3] = t2;
|
|
118
100
|
} else {
|
|
119
|
-
t2 = $[
|
|
101
|
+
t2 = $[3];
|
|
120
102
|
}
|
|
121
103
|
let t3;
|
|
122
|
-
if ($[
|
|
104
|
+
if ($[4] !== firstLineIndex || $[5] !== lineCount) {
|
|
123
105
|
let t4;
|
|
124
|
-
if ($[
|
|
106
|
+
if ($[7] !== firstLineIndex) {
|
|
125
107
|
t4 = (_, lineIndex) => /* @__PURE__ */ _jsx("span", {
|
|
126
108
|
"data-slot": "skeleton",
|
|
127
109
|
className: cn(blockClassName, "h-(--space-3) w-full first:h-(--space-4) first:w-[48%] last:not-first:w-[72%]"),
|
|
128
110
|
style: { "--index": lineIndex + firstLineIndex }
|
|
129
111
|
}, lineIndex);
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
112
|
+
$[7] = firstLineIndex;
|
|
113
|
+
$[8] = t4;
|
|
132
114
|
} else {
|
|
133
|
-
t4 = $[
|
|
115
|
+
t4 = $[8];
|
|
134
116
|
}
|
|
135
117
|
t3 = /* @__PURE__ */ _jsx("span", {
|
|
136
118
|
"aria-hidden": "true",
|
|
137
119
|
className: "grid flex-1 gap-(--space-3) pt-(--space-1)",
|
|
138
120
|
children: Array.from({ length: lineCount }, t4)
|
|
139
121
|
});
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
122
|
+
$[4] = firstLineIndex;
|
|
123
|
+
$[5] = lineCount;
|
|
124
|
+
$[6] = t3;
|
|
143
125
|
} else {
|
|
144
|
-
t3 = $[
|
|
126
|
+
t3 = $[6];
|
|
145
127
|
}
|
|
146
128
|
let t4;
|
|
147
|
-
if ($[
|
|
129
|
+
if ($[9] !== label || $[10] !== t1 || $[11] !== t2 || $[12] !== t3) {
|
|
148
130
|
t4 = /* @__PURE__ */ _jsxs("div", {
|
|
149
131
|
"data-slot": "skeleton-placeholder",
|
|
150
132
|
role: "status",
|
|
151
133
|
"aria-label": label,
|
|
152
134
|
"aria-busy": "true",
|
|
153
135
|
className: t1,
|
|
154
|
-
...props,
|
|
155
136
|
children: [t2, t3]
|
|
156
137
|
});
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[20] = t4;
|
|
138
|
+
$[9] = label;
|
|
139
|
+
$[10] = t1;
|
|
140
|
+
$[11] = t2;
|
|
141
|
+
$[12] = t3;
|
|
142
|
+
$[13] = t4;
|
|
163
143
|
} else {
|
|
164
|
-
t4 = $[
|
|
144
|
+
t4 = $[13];
|
|
165
145
|
}
|
|
166
146
|
return t4;
|
|
167
147
|
}
|
|
@@ -205,47 +185,24 @@ function SkeletonBranch(t0) {
|
|
|
205
185
|
}
|
|
206
186
|
/** Arc's reveal: the placeholder crossfades into the content while the frame springs to the new height. */
|
|
207
187
|
function SkeletonReveal(t0) {
|
|
208
|
-
const $ = _c(
|
|
209
|
-
|
|
210
|
-
let className;
|
|
211
|
-
let loading;
|
|
212
|
-
let placeholder;
|
|
213
|
-
let props;
|
|
214
|
-
let style;
|
|
215
|
-
if ($[0] !== t0) {
|
|
216
|
-
({loading, placeholder, children, className, style, ...props} = t0);
|
|
217
|
-
$[0] = t0;
|
|
218
|
-
$[1] = children;
|
|
219
|
-
$[2] = className;
|
|
220
|
-
$[3] = loading;
|
|
221
|
-
$[4] = placeholder;
|
|
222
|
-
$[5] = props;
|
|
223
|
-
$[6] = style;
|
|
224
|
-
} else {
|
|
225
|
-
children = $[1];
|
|
226
|
-
className = $[2];
|
|
227
|
-
loading = $[3];
|
|
228
|
-
placeholder = $[4];
|
|
229
|
-
props = $[5];
|
|
230
|
-
style = $[6];
|
|
231
|
-
}
|
|
188
|
+
const $ = _c(12);
|
|
189
|
+
const { loading, placeholder, children, className } = t0;
|
|
232
190
|
const reduceMotion = usePrefersReducedMotion();
|
|
233
191
|
const contentRef = useRef(null);
|
|
234
192
|
useMorphHeight(contentRef, loading, reduceMotion);
|
|
235
193
|
const t1 = reduceMotion ? ARC_DURATION.instant : ARC_DURATION.fast;
|
|
236
194
|
let t2;
|
|
237
|
-
if ($[
|
|
195
|
+
if ($[0] !== t1) {
|
|
238
196
|
t2 = { duration: t1 };
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
197
|
+
$[0] = t1;
|
|
198
|
+
$[1] = t2;
|
|
241
199
|
} else {
|
|
242
|
-
t2 = $[
|
|
200
|
+
t2 = $[1];
|
|
243
201
|
}
|
|
244
202
|
const exitTransition = t2;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
t4 = /* @__PURE__ */ _jsx("div", {
|
|
203
|
+
let t3;
|
|
204
|
+
if ($[2] !== children || $[3] !== exitTransition || $[4] !== loading || $[5] !== placeholder || $[6] !== reduceMotion) {
|
|
205
|
+
t3 = /* @__PURE__ */ _jsx("div", {
|
|
249
206
|
ref: contentRef,
|
|
250
207
|
className: "relative flow-root",
|
|
251
208
|
children: /* @__PURE__ */ _jsx(AnimatePresence, {
|
|
@@ -284,156 +241,93 @@ function SkeletonReveal(t0) {
|
|
|
284
241
|
}, "content")
|
|
285
242
|
})
|
|
286
243
|
});
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
244
|
+
$[2] = children;
|
|
245
|
+
$[3] = exitTransition;
|
|
246
|
+
$[4] = loading;
|
|
247
|
+
$[5] = placeholder;
|
|
248
|
+
$[6] = reduceMotion;
|
|
249
|
+
$[7] = t3;
|
|
293
250
|
} else {
|
|
294
|
-
|
|
251
|
+
t3 = $[7];
|
|
295
252
|
}
|
|
296
|
-
let
|
|
297
|
-
if ($[
|
|
298
|
-
|
|
253
|
+
let t4;
|
|
254
|
+
if ($[8] !== className || $[9] !== loading || $[10] !== t3) {
|
|
255
|
+
t4 = /* @__PURE__ */ _jsx("div", {
|
|
299
256
|
"data-slot": "skeleton-reveal",
|
|
300
257
|
"aria-busy": loading,
|
|
301
258
|
className,
|
|
302
|
-
|
|
303
|
-
style,
|
|
304
|
-
children: t4
|
|
259
|
+
children: t3
|
|
305
260
|
});
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[19] = t4;
|
|
311
|
-
$[20] = t5;
|
|
261
|
+
$[8] = className;
|
|
262
|
+
$[9] = loading;
|
|
263
|
+
$[10] = t3;
|
|
264
|
+
$[11] = t4;
|
|
312
265
|
} else {
|
|
313
|
-
|
|
266
|
+
t4 = $[11];
|
|
314
267
|
}
|
|
315
|
-
return
|
|
268
|
+
return t4;
|
|
316
269
|
}
|
|
317
270
|
/**
|
|
318
|
-
* Reserves space while content loads. Without Arc's
|
|
319
|
-
*
|
|
320
|
-
* @param props -
|
|
321
|
-
* @returns The placeholder, or the reveal frame when
|
|
271
|
+
* Reserves space while content loads. Without children it draws Arc's placeholder, three text lines by default; with
|
|
272
|
+
* children it shows that placeholder while `loading` and then crossfades into them.
|
|
273
|
+
* @param props - Placeholder shape, accessible label, loading state and classes.
|
|
274
|
+
* @returns The placeholder, or the reveal frame when there are children.
|
|
322
275
|
*/
|
|
323
276
|
function Skeleton(t0) {
|
|
324
|
-
const $ = _c(
|
|
325
|
-
|
|
326
|
-
let children;
|
|
327
|
-
let className;
|
|
328
|
-
let lines;
|
|
329
|
-
let loading;
|
|
330
|
-
let props;
|
|
331
|
-
let t1;
|
|
332
|
-
if ($[0] !== t0) {
|
|
333
|
-
({lines, avatar, label: t1, loading, className, children, ...props} = t0);
|
|
334
|
-
$[0] = t0;
|
|
335
|
-
$[1] = avatar;
|
|
336
|
-
$[2] = children;
|
|
337
|
-
$[3] = className;
|
|
338
|
-
$[4] = lines;
|
|
339
|
-
$[5] = loading;
|
|
340
|
-
$[6] = props;
|
|
341
|
-
$[7] = t1;
|
|
342
|
-
} else {
|
|
343
|
-
avatar = $[1];
|
|
344
|
-
children = $[2];
|
|
345
|
-
className = $[3];
|
|
346
|
-
lines = $[4];
|
|
347
|
-
loading = $[5];
|
|
348
|
-
props = $[6];
|
|
349
|
-
t1 = $[7];
|
|
350
|
-
}
|
|
277
|
+
const $ = _c(14);
|
|
278
|
+
const { label: t1, lines: t2, avatar: t3, children, loading: t4, className } = t0;
|
|
351
279
|
const label = t1 === undefined ? SKELETON_DEFAULT_LABEL : t1;
|
|
352
|
-
const
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
if (
|
|
356
|
-
t4 = {
|
|
357
|
-
lines: t2,
|
|
358
|
-
avatar: t3,
|
|
359
|
-
label
|
|
360
|
-
};
|
|
361
|
-
$[8] = label;
|
|
362
|
-
$[9] = t2;
|
|
363
|
-
$[10] = t3;
|
|
364
|
-
$[11] = t4;
|
|
365
|
-
} else {
|
|
366
|
-
t4 = $[11];
|
|
367
|
-
}
|
|
368
|
-
const shape = t4;
|
|
369
|
-
if (loading !== undefined) {
|
|
280
|
+
const lines = t2 === undefined ? SKELETON_DEFAULT_LINES : t2;
|
|
281
|
+
const avatar = t3 === undefined ? false : t3;
|
|
282
|
+
const loading = t4 === undefined ? true : t4;
|
|
283
|
+
if (children === undefined) {
|
|
370
284
|
let t5;
|
|
371
|
-
if ($[
|
|
372
|
-
t5 = /* @__PURE__ */ _jsx(SkeletonPlaceholder, { ...shape });
|
|
373
|
-
$[12] = shape;
|
|
374
|
-
$[13] = t5;
|
|
375
|
-
} else {
|
|
376
|
-
t5 = $[13];
|
|
377
|
-
}
|
|
378
|
-
let t6;
|
|
379
|
-
if ($[14] !== children || $[15] !== className || $[16] !== loading || $[17] !== props || $[18] !== t5) {
|
|
380
|
-
t6 = /* @__PURE__ */ _jsx(SkeletonReveal, {
|
|
381
|
-
loading,
|
|
382
|
-
placeholder: t5,
|
|
383
|
-
className,
|
|
384
|
-
...props,
|
|
385
|
-
children
|
|
386
|
-
});
|
|
387
|
-
$[14] = children;
|
|
388
|
-
$[15] = className;
|
|
389
|
-
$[16] = loading;
|
|
390
|
-
$[17] = props;
|
|
391
|
-
$[18] = t5;
|
|
392
|
-
$[19] = t6;
|
|
393
|
-
} else {
|
|
394
|
-
t6 = $[19];
|
|
395
|
-
}
|
|
396
|
-
return t6;
|
|
397
|
-
}
|
|
398
|
-
if (lines !== undefined || avatar) {
|
|
399
|
-
let t5;
|
|
400
|
-
if ($[20] !== className || $[21] !== props || $[22] !== shape) {
|
|
285
|
+
if ($[0] !== avatar || $[1] !== className || $[2] !== label || $[3] !== lines) {
|
|
401
286
|
t5 = /* @__PURE__ */ _jsx(SkeletonPlaceholder, {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
287
|
+
lines,
|
|
288
|
+
avatar,
|
|
289
|
+
label,
|
|
290
|
+
className
|
|
405
291
|
});
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
292
|
+
$[0] = avatar;
|
|
293
|
+
$[1] = className;
|
|
294
|
+
$[2] = label;
|
|
295
|
+
$[3] = lines;
|
|
296
|
+
$[4] = t5;
|
|
410
297
|
} else {
|
|
411
|
-
t5 = $[
|
|
298
|
+
t5 = $[4];
|
|
412
299
|
}
|
|
413
300
|
return t5;
|
|
414
301
|
}
|
|
415
302
|
let t5;
|
|
416
|
-
if ($[
|
|
417
|
-
t5 =
|
|
418
|
-
|
|
419
|
-
|
|
303
|
+
if ($[5] !== avatar || $[6] !== label || $[7] !== lines) {
|
|
304
|
+
t5 = /* @__PURE__ */ _jsx(SkeletonPlaceholder, {
|
|
305
|
+
lines,
|
|
306
|
+
avatar,
|
|
307
|
+
label
|
|
308
|
+
});
|
|
309
|
+
$[5] = avatar;
|
|
310
|
+
$[6] = label;
|
|
311
|
+
$[7] = lines;
|
|
312
|
+
$[8] = t5;
|
|
420
313
|
} else {
|
|
421
|
-
t5 = $[
|
|
314
|
+
t5 = $[8];
|
|
422
315
|
}
|
|
423
316
|
let t6;
|
|
424
|
-
if ($[
|
|
425
|
-
t6 = /* @__PURE__ */ _jsx(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
317
|
+
if ($[9] !== children || $[10] !== className || $[11] !== loading || $[12] !== t5) {
|
|
318
|
+
t6 = /* @__PURE__ */ _jsx(SkeletonReveal, {
|
|
319
|
+
loading,
|
|
320
|
+
placeholder: t5,
|
|
321
|
+
className,
|
|
429
322
|
children
|
|
430
323
|
});
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
324
|
+
$[9] = children;
|
|
325
|
+
$[10] = className;
|
|
326
|
+
$[11] = loading;
|
|
327
|
+
$[12] = t5;
|
|
328
|
+
$[13] = t6;
|
|
435
329
|
} else {
|
|
436
|
-
t6 = $[
|
|
330
|
+
t6 = $[13];
|
|
437
331
|
}
|
|
438
332
|
return t6;
|
|
439
333
|
}
|
|
@@ -14,7 +14,7 @@ import { cn } from "../lib/utils.js";
|
|
|
14
14
|
import { ARC_ICON_ENTER as iconEnter, ARC_ICON_EXIT as iconExit, ARC_ICON_TRANSITION as iconTransition, ARC_REDUCED_ENTER as reducedEnter, ARC_REDUCED_EXIT as reducedExit, ARC_REDUCED_TRANSITION as reducedTransition, ARC_SWAP_REST as restState } from "../motion/arc-swap.js";
|
|
15
15
|
import { useMorphWidth } from "../motion/use-morph-width.js";
|
|
16
16
|
import { Button } from "./button.js";
|
|
17
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
17
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
|
|
18
18
|
import { MorphText } from "./morph-text.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
/**
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
2
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3
|
-
import type { SwitchSize } from "../constants/switch.js";
|
|
4
3
|
export type SwitchProps = ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
5
|
-
/**
|
|
6
|
-
size?: SwitchSize;
|
|
7
|
-
/** Visible text rendered inside the control, after the track; it also names the switch. */
|
|
4
|
+
/** Visible text rendered inside the control, after the track; also its `aria-label` when none is passed. */
|
|
8
5
|
label?: string;
|
|
9
6
|
};
|
|
10
7
|
/**
|
|
11
8
|
* A binary setting that applies at once, controlled or uncontrolled like Radix's switch.
|
|
12
|
-
* @param switchProps - Every Radix switch prop, including `ref`, plus
|
|
9
|
+
* @param switchProps - Every Radix switch prop, including `ref`, plus Arc's `label`.
|
|
13
10
|
* @returns The switch button, with its label inside when one is passed.
|
|
14
11
|
*/
|
|
15
|
-
declare function Switch({ className,
|
|
12
|
+
declare function Switch({ className, label, checked, defaultChecked, onCheckedChange, onPointerDown, onPointerUp, onPointerLeave, onPointerCancel, onKeyDown, onKeyUp, onBlur, disabled, "aria-label": ariaLabel, ...props }: SwitchProps): import("react").JSX.Element;
|
|
16
13
|
export { Switch };
|