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.
- package/CHANGELOG.md +63 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/alert-dialog.d.ts +15 -4
- package/dist/components/alert-dialog.js +84 -44
- package/dist/components/alert.d.ts +30 -9
- package/dist/components/alert.js +360 -39
- package/dist/components/avatar.d.ts +33 -10
- package/dist/components/avatar.js +110 -30
- package/dist/components/badge.d.ts +39 -7
- package/dist/components/badge.js +348 -24
- package/dist/components/calendar.d.ts +29 -2
- package/dist/components/calendar.js +1035 -223
- package/dist/components/card.d.ts +17 -1
- package/dist/components/card.js +34 -8
- package/dist/components/carousel.d.ts +29 -2
- package/dist/components/carousel.js +471 -90
- package/dist/components/checkbox.d.ts +13 -2
- package/dist/components/checkbox.js +301 -41
- package/dist/components/dialog-surface.d.ts +27 -0
- package/dist/components/dialog-surface.js +137 -0
- package/dist/components/dialog.d.ts +21 -4
- package/dist/components/dialog.js +163 -96
- package/dist/components/dropdown-menu.d.ts +30 -16
- package/dist/components/dropdown-menu.js +139 -83
- package/dist/components/hover-card.d.ts +46 -3
- package/dist/components/hover-card.js +423 -60
- package/dist/components/pagination.d.ts +32 -14
- package/dist/components/pagination.js +136 -59
- package/dist/components/popover.d.ts +14 -5
- package/dist/components/popover.js +78 -36
- package/dist/components/radio-group.d.ts +19 -3
- package/dist/components/radio-group.js +400 -57
- package/dist/components/select.d.ts +17 -6
- package/dist/components/select.js +83 -71
- package/dist/components/sheet.js +37 -26
- package/dist/components/sidebar.js +11 -0
- package/dist/components/skeleton.d.ts +19 -5
- package/dist/components/skeleton.js +434 -14
- package/dist/components/switch.d.ts +14 -4
- package/dist/components/switch.js +424 -40
- package/dist/components/tabs.d.ts +38 -5
- package/dist/components/tabs.js +564 -97
- package/dist/components/themed-toaster.d.ts +6 -2
- package/dist/components/themed-toaster.js +80 -50
- package/dist/components/tooltip.d.ts +33 -2
- package/dist/components/tooltip.js +197 -69
- package/dist/constants/alert.d.ts +12 -0
- package/dist/constants/alert.js +9 -0
- package/dist/constants/avatar.d.ts +10 -0
- package/dist/constants/avatar.js +7 -0
- package/dist/constants/badge.d.ts +6 -0
- package/dist/constants/badge.js +6 -0
- package/dist/constants/calendar.d.ts +24 -0
- package/dist/constants/calendar.js +22 -0
- package/dist/constants/carousel.d.ts +37 -0
- package/dist/constants/carousel.js +53 -0
- package/dist/constants/checkbox.d.ts +17 -0
- package/dist/constants/checkbox.js +17 -0
- package/dist/constants/dialog.d.ts +6 -0
- package/dist/constants/dialog.js +6 -0
- package/dist/constants/dropdown-menu.d.ts +5 -0
- package/dist/constants/dropdown-menu.js +5 -0
- package/dist/constants/hover-card.d.ts +37 -0
- package/dist/constants/hover-card.js +85 -0
- package/dist/constants/pagination.d.ts +9 -0
- package/dist/constants/pagination.js +9 -0
- package/dist/constants/popover.d.ts +7 -0
- package/dist/constants/popover.js +39 -0
- package/dist/constants/radio-group.d.ts +10 -0
- package/dist/constants/radio-group.js +10 -0
- package/dist/constants/select.d.ts +3 -0
- package/dist/constants/select.js +3 -0
- package/dist/constants/skeleton.d.ts +17 -0
- package/dist/constants/skeleton.js +17 -0
- package/dist/constants/switch.d.ts +44 -0
- package/dist/constants/switch.js +49 -0
- package/dist/constants/tabs.d.ts +17 -0
- package/dist/constants/tabs.js +17 -0
- package/dist/constants/toast.d.ts +3 -0
- package/dist/constants/toast.js +3 -0
- package/dist/constants/tooltip.d.ts +13 -0
- package/dist/constants/tooltip.js +52 -0
- package/dist/lib/toast-layer.d.ts +24 -0
- package/dist/lib/toast-layer.js +76 -0
- package/dist/motion/arc-floating-slot.d.ts +40 -0
- package/dist/motion/arc-floating-slot.js +167 -0
- package/dist/motion/glide-indicator.d.ts +6 -7
- package/dist/motion/glide-indicator.js +5 -3
- package/dist/motion/overlay-warmth.d.ts +24 -0
- package/dist/motion/overlay-warmth.js +70 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Arc's Dialog (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a focused surface for decisions that need
|
|
5
|
+
* attention, on Arc's overlay, raised panel, title and description type and bordered close button, with Arc's swap of
|
|
6
|
+
* a title or description changed while open. It keeps beez-ui's composable parts, the center morph entrance and the
|
|
7
|
+
* viewport close button placement instead of Arc's single `title`/`description` content and rise entrance.
|
|
8
|
+
*/
|
|
3
9
|
import * as React from "react";
|
|
4
10
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
5
11
|
import { MotionSlot } from "../motion/motion-slot.js";
|
|
6
12
|
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
|
|
7
13
|
import { cn } from "../lib/utils.js";
|
|
14
|
+
import { keepOpenOnToastInteraction } from "../lib/toast-layer.js";
|
|
8
15
|
import { Button } from "./button.js";
|
|
9
16
|
import { ControlButton } from "./control-button.js";
|
|
10
17
|
import { XIcon } from "lucide-react";
|
|
18
|
+
import { withDialogSwapText, dialogCloseButtonClassName, dialogDescriptionClassName, dialogFooterClassName, dialogOverlayClassName, dialogSurfaceClassName, dialogTitleClassName } from "./dialog-surface.js";
|
|
11
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
20
|
function Dialog(t0) {
|
|
13
21
|
const $ = _c(9);
|
|
@@ -134,7 +142,7 @@ function DialogOverlay(t0) {
|
|
|
134
142
|
}
|
|
135
143
|
let t1;
|
|
136
144
|
if ($[3] !== className) {
|
|
137
|
-
t1 = cn(
|
|
145
|
+
t1 = cn(dialogOverlayClassName, className);
|
|
138
146
|
$[3] = className;
|
|
139
147
|
$[4] = t1;
|
|
140
148
|
} else {
|
|
@@ -164,15 +172,22 @@ function DialogOverlay(t0) {
|
|
|
164
172
|
* @returns The close control for wide layouts that keep the panel clear of controls.
|
|
165
173
|
*/
|
|
166
174
|
function DialogViewportCloseButton() {
|
|
167
|
-
const $ = _c(
|
|
175
|
+
const $ = _c(2);
|
|
168
176
|
let t0;
|
|
169
177
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
170
|
-
t0 =
|
|
178
|
+
t0 = cn(dialogCloseButtonClassName, "fixed top-4 right-4 transition-opacity duration-200 ease-out in-data-motion-entering:invisible in-data-motion-entering:opacity-0 in-data-motion-entering:transition-none in-data-[state=closed]:invisible in-data-[state=closed]:opacity-0 in-data-[state=closed]:transition-none motion-reduce:transition-none");
|
|
179
|
+
$[0] = t0;
|
|
180
|
+
} else {
|
|
181
|
+
t0 = $[0];
|
|
182
|
+
}
|
|
183
|
+
let t1;
|
|
184
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
+
t1 = /* @__PURE__ */ _jsx(DialogPrimitive.Close, {
|
|
171
186
|
"data-slot": "dialog-close",
|
|
172
187
|
asChild: true,
|
|
173
188
|
children: /* @__PURE__ */ _jsxs(ControlButton, {
|
|
174
189
|
variant: "ghost",
|
|
175
|
-
className:
|
|
190
|
+
className: t0,
|
|
176
191
|
size: "icon-sm",
|
|
177
192
|
children: [/* @__PURE__ */ _jsx(XIcon, {}), /* @__PURE__ */ _jsx("span", {
|
|
178
193
|
className: "sr-only",
|
|
@@ -180,11 +195,11 @@ function DialogViewportCloseButton() {
|
|
|
180
195
|
})]
|
|
181
196
|
})
|
|
182
197
|
});
|
|
183
|
-
$[
|
|
198
|
+
$[1] = t1;
|
|
184
199
|
} else {
|
|
185
|
-
|
|
200
|
+
t1 = $[1];
|
|
186
201
|
}
|
|
187
|
-
return
|
|
202
|
+
return t1;
|
|
188
203
|
}
|
|
189
204
|
/**
|
|
190
205
|
* Renders compact dialog content with viewport-safe scrolling. The panel unfolds from its
|
|
@@ -196,7 +211,7 @@ function DialogViewportCloseButton() {
|
|
|
196
211
|
* @returns The styled primitive with its original interaction contract.
|
|
197
212
|
*/
|
|
198
213
|
function DialogContent(t0) {
|
|
199
|
-
const $ = _c(
|
|
214
|
+
const $ = _c(29);
|
|
200
215
|
let children;
|
|
201
216
|
let className;
|
|
202
217
|
let props;
|
|
@@ -230,35 +245,44 @@ function DialogContent(t0) {
|
|
|
230
245
|
} else {
|
|
231
246
|
t4 = $[6];
|
|
232
247
|
}
|
|
233
|
-
const t5 =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
248
|
+
const t5 = showCloseButton ? closeButtonPlacement : undefined;
|
|
249
|
+
const t6 = closeButtonPlacement === "viewport" ? "inset-0 m-auto h-fit" : "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2";
|
|
250
|
+
let t7;
|
|
251
|
+
if ($[7] !== className || $[8] !== t6) {
|
|
252
|
+
t7 = cn(dialogSurfaceClassName, "fixed grid w-full max-w-[calc(100%-2rem)] max-h-[calc(100svh-2rem)] overflow-y-auto overscroll-contain sm:max-w-[440px]", t6, className);
|
|
237
253
|
$[7] = className;
|
|
238
|
-
$[8] =
|
|
239
|
-
$[9] =
|
|
254
|
+
$[8] = t6;
|
|
255
|
+
$[9] = t7;
|
|
240
256
|
} else {
|
|
241
|
-
|
|
257
|
+
t7 = $[9];
|
|
242
258
|
}
|
|
243
|
-
let
|
|
244
|
-
if ($[10] !==
|
|
245
|
-
|
|
246
|
-
$[10] =
|
|
247
|
-
$[11] =
|
|
248
|
-
$[12] = t7;
|
|
259
|
+
let t8;
|
|
260
|
+
if ($[10] !== props.onInteractOutside) {
|
|
261
|
+
t8 = keepOpenOnToastInteraction(props.onInteractOutside);
|
|
262
|
+
$[10] = props.onInteractOutside;
|
|
263
|
+
$[11] = t8;
|
|
249
264
|
} else {
|
|
250
|
-
|
|
265
|
+
t8 = $[11];
|
|
251
266
|
}
|
|
252
|
-
let
|
|
253
|
-
if ($[
|
|
254
|
-
|
|
267
|
+
let t9;
|
|
268
|
+
if ($[12] !== closeButtonPlacement || $[13] !== showCloseButton) {
|
|
269
|
+
t9 = showCloseButton && closeButtonPlacement === "viewport" && /* @__PURE__ */ _jsx(DialogViewportCloseButton, {});
|
|
270
|
+
$[12] = closeButtonPlacement;
|
|
271
|
+
$[13] = showCloseButton;
|
|
272
|
+
$[14] = t9;
|
|
273
|
+
} else {
|
|
274
|
+
t9 = $[14];
|
|
275
|
+
}
|
|
276
|
+
let t10;
|
|
277
|
+
if ($[15] !== closeButtonPlacement || $[16] !== showCloseButton) {
|
|
278
|
+
t10 = showCloseButton && closeButtonPlacement === "content" && /* @__PURE__ */ _jsx(DialogPrimitive.Close, {
|
|
255
279
|
"data-slot": "dialog-close",
|
|
256
280
|
asChild: true,
|
|
257
281
|
children: /* @__PURE__ */ _jsx(MotionSlot, {
|
|
258
282
|
kind: "delayed-pop",
|
|
259
283
|
children: /* @__PURE__ */ _jsxs(ControlButton, {
|
|
260
284
|
variant: "ghost",
|
|
261
|
-
className: "absolute top-2 right-
|
|
285
|
+
className: cn(dialogCloseButtonClassName, "absolute top-[calc(var(--space-6)+(var(--text-lg)*var(--leading-body)-var(--space-8))/2)] right-(--space-6)"),
|
|
262
286
|
size: "icon-sm",
|
|
263
287
|
children: [/* @__PURE__ */ _jsx(XIcon, {}), /* @__PURE__ */ _jsx("span", {
|
|
264
288
|
className: "sr-only",
|
|
@@ -267,55 +291,65 @@ function DialogContent(t0) {
|
|
|
267
291
|
})
|
|
268
292
|
})
|
|
269
293
|
});
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
294
|
+
$[15] = closeButtonPlacement;
|
|
295
|
+
$[16] = showCloseButton;
|
|
296
|
+
$[17] = t10;
|
|
273
297
|
} else {
|
|
274
|
-
|
|
298
|
+
t10 = $[17];
|
|
275
299
|
}
|
|
276
|
-
let
|
|
277
|
-
if ($[
|
|
278
|
-
|
|
300
|
+
let t11;
|
|
301
|
+
if ($[18] !== children || $[19] !== props || $[20] !== t10 || $[21] !== t5 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9) {
|
|
302
|
+
t11 = /* @__PURE__ */ _jsxs(React.Fragment, { children: [t4, /* @__PURE__ */ _jsx(MotionSlot, {
|
|
279
303
|
kind: "center-morph",
|
|
280
304
|
children: /* @__PURE__ */ _jsxs(DialogPrimitive.Content, {
|
|
281
305
|
forceMount: true,
|
|
282
306
|
"data-slot": "dialog-content",
|
|
283
|
-
|
|
307
|
+
"data-close-button-placement": t5,
|
|
308
|
+
className: t7,
|
|
284
309
|
...props,
|
|
310
|
+
onInteractOutside: t8,
|
|
285
311
|
children: [
|
|
286
312
|
children,
|
|
287
|
-
|
|
288
|
-
|
|
313
|
+
t9,
|
|
314
|
+
t10
|
|
289
315
|
]
|
|
290
316
|
})
|
|
291
317
|
})] });
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
318
|
+
$[18] = children;
|
|
319
|
+
$[19] = props;
|
|
320
|
+
$[20] = t10;
|
|
321
|
+
$[21] = t5;
|
|
322
|
+
$[22] = t7;
|
|
323
|
+
$[23] = t8;
|
|
324
|
+
$[24] = t9;
|
|
325
|
+
$[25] = t11;
|
|
326
|
+
} else {
|
|
327
|
+
t11 = $[25];
|
|
328
|
+
}
|
|
329
|
+
let t12;
|
|
330
|
+
if ($[26] !== props.forceMount || $[27] !== t11) {
|
|
331
|
+
t12 = /* @__PURE__ */ _jsx(DialogPortal, {
|
|
304
332
|
forceMount: true,
|
|
305
333
|
children: /* @__PURE__ */ _jsx(MotionPresence, {
|
|
306
334
|
scope: "dialog",
|
|
307
335
|
forceMount: t3,
|
|
308
|
-
children:
|
|
336
|
+
children: t11
|
|
309
337
|
})
|
|
310
338
|
});
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
339
|
+
$[26] = props.forceMount;
|
|
340
|
+
$[27] = t11;
|
|
341
|
+
$[28] = t12;
|
|
314
342
|
} else {
|
|
315
|
-
|
|
343
|
+
t12 = $[28];
|
|
316
344
|
}
|
|
317
|
-
return
|
|
345
|
+
return t12;
|
|
318
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Stacks the title and description. While the panel shows its own close button, the header keeps Arc's gap to it so
|
|
349
|
+
* long copy never runs under the button.
|
|
350
|
+
* @param props - Native div properties and optional consumer overrides.
|
|
351
|
+
* @returns The header block.
|
|
352
|
+
*/
|
|
319
353
|
function DialogHeader(t0) {
|
|
320
354
|
const $ = _c(8);
|
|
321
355
|
let className;
|
|
@@ -331,7 +365,7 @@ function DialogHeader(t0) {
|
|
|
331
365
|
}
|
|
332
366
|
let t1;
|
|
333
367
|
if ($[3] !== className) {
|
|
334
|
-
t1 = cn("flex flex-col gap-2", className);
|
|
368
|
+
t1 = cn("flex flex-col gap-(--space-2) in-data-[close-button-placement=content]:pr-[calc(var(--space-8)+var(--space-5))]", className);
|
|
335
369
|
$[3] = className;
|
|
336
370
|
$[4] = t1;
|
|
337
371
|
} else {
|
|
@@ -353,7 +387,7 @@ function DialogHeader(t0) {
|
|
|
353
387
|
return t2;
|
|
354
388
|
}
|
|
355
389
|
/**
|
|
356
|
-
* Separates dialog actions with
|
|
390
|
+
* Separates dialog actions with an edge-to-edge footer under a hairline, bleeding through the panel padding.
|
|
357
391
|
* @param props - Primitive properties and optional consumer overrides.
|
|
358
392
|
* @returns The styled primitive with its original interaction contract.
|
|
359
393
|
*/
|
|
@@ -379,7 +413,7 @@ function DialogFooter(t0) {
|
|
|
379
413
|
const showCloseButton = t1 === undefined ? false : t1;
|
|
380
414
|
let t2;
|
|
381
415
|
if ($[5] !== className) {
|
|
382
|
-
t2 = cn(
|
|
416
|
+
t2 = cn(dialogFooterClassName, className);
|
|
383
417
|
$[5] = className;
|
|
384
418
|
$[6] = t2;
|
|
385
419
|
} else {
|
|
@@ -418,80 +452,113 @@ function DialogFooter(t0) {
|
|
|
418
452
|
return t4;
|
|
419
453
|
}
|
|
420
454
|
/**
|
|
421
|
-
* Renders dialog
|
|
455
|
+
* Renders the dialog heading in Arc's title type. Plain text that changes while open swaps with Arc's rise.
|
|
422
456
|
* @param props - Primitive properties and optional consumer overrides.
|
|
423
457
|
* @returns The styled primitive with its original interaction contract.
|
|
424
458
|
*/
|
|
425
459
|
function DialogTitle(t0) {
|
|
426
|
-
const $ = _c(
|
|
460
|
+
const $ = _c(13);
|
|
461
|
+
let children;
|
|
427
462
|
let className;
|
|
428
463
|
let props;
|
|
429
464
|
if ($[0] !== t0) {
|
|
430
|
-
({className, ...props} = t0);
|
|
465
|
+
({className, children, ...props} = t0);
|
|
431
466
|
$[0] = t0;
|
|
432
|
-
$[1] =
|
|
433
|
-
$[2] =
|
|
467
|
+
$[1] = children;
|
|
468
|
+
$[2] = className;
|
|
469
|
+
$[3] = props;
|
|
434
470
|
} else {
|
|
435
|
-
|
|
436
|
-
|
|
471
|
+
children = $[1];
|
|
472
|
+
className = $[2];
|
|
473
|
+
props = $[3];
|
|
437
474
|
}
|
|
438
475
|
let t1;
|
|
439
|
-
if ($[
|
|
440
|
-
t1 = cn(
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
476
|
+
if ($[4] !== className) {
|
|
477
|
+
t1 = cn(dialogTitleClassName, className);
|
|
478
|
+
$[4] = className;
|
|
479
|
+
$[5] = t1;
|
|
443
480
|
} else {
|
|
444
|
-
t1 = $[
|
|
481
|
+
t1 = $[5];
|
|
445
482
|
}
|
|
446
483
|
let t2;
|
|
447
|
-
if ($[
|
|
448
|
-
t2 =
|
|
484
|
+
if ($[6] !== children || $[7] !== props.asChild) {
|
|
485
|
+
t2 = withDialogSwapText(children, props.asChild);
|
|
486
|
+
$[6] = children;
|
|
487
|
+
$[7] = props.asChild;
|
|
488
|
+
$[8] = t2;
|
|
489
|
+
} else {
|
|
490
|
+
t2 = $[8];
|
|
491
|
+
}
|
|
492
|
+
let t3;
|
|
493
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
|
|
494
|
+
t3 = /* @__PURE__ */ _jsx(DialogPrimitive.Title, {
|
|
449
495
|
"data-slot": "dialog-title",
|
|
450
496
|
className: t1,
|
|
451
|
-
...props
|
|
497
|
+
...props,
|
|
498
|
+
children: t2
|
|
452
499
|
});
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
500
|
+
$[9] = props;
|
|
501
|
+
$[10] = t1;
|
|
502
|
+
$[11] = t2;
|
|
503
|
+
$[12] = t3;
|
|
456
504
|
} else {
|
|
457
|
-
|
|
505
|
+
t3 = $[12];
|
|
458
506
|
}
|
|
459
|
-
return
|
|
507
|
+
return t3;
|
|
460
508
|
}
|
|
509
|
+
/**
|
|
510
|
+
* Renders the dialog description in Arc's secondary text. Plain text that changes while open swaps with Arc's rise.
|
|
511
|
+
* @param props - Primitive properties and optional consumer overrides.
|
|
512
|
+
* @returns The styled primitive with its original interaction contract.
|
|
513
|
+
*/
|
|
461
514
|
function DialogDescription(t0) {
|
|
462
|
-
const $ = _c(
|
|
515
|
+
const $ = _c(13);
|
|
516
|
+
let children;
|
|
463
517
|
let className;
|
|
464
518
|
let props;
|
|
465
519
|
if ($[0] !== t0) {
|
|
466
|
-
({className, ...props} = t0);
|
|
520
|
+
({className, children, ...props} = t0);
|
|
467
521
|
$[0] = t0;
|
|
468
|
-
$[1] =
|
|
469
|
-
$[2] =
|
|
522
|
+
$[1] = children;
|
|
523
|
+
$[2] = className;
|
|
524
|
+
$[3] = props;
|
|
470
525
|
} else {
|
|
471
|
-
|
|
472
|
-
|
|
526
|
+
children = $[1];
|
|
527
|
+
className = $[2];
|
|
528
|
+
props = $[3];
|
|
473
529
|
}
|
|
474
530
|
let t1;
|
|
475
|
-
if ($[
|
|
476
|
-
t1 = cn(
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
531
|
+
if ($[4] !== className) {
|
|
532
|
+
t1 = cn(dialogDescriptionClassName, className);
|
|
533
|
+
$[4] = className;
|
|
534
|
+
$[5] = t1;
|
|
479
535
|
} else {
|
|
480
|
-
t1 = $[
|
|
536
|
+
t1 = $[5];
|
|
481
537
|
}
|
|
482
538
|
let t2;
|
|
483
|
-
if ($[
|
|
484
|
-
t2 =
|
|
539
|
+
if ($[6] !== children || $[7] !== props.asChild) {
|
|
540
|
+
t2 = withDialogSwapText(children, props.asChild);
|
|
541
|
+
$[6] = children;
|
|
542
|
+
$[7] = props.asChild;
|
|
543
|
+
$[8] = t2;
|
|
544
|
+
} else {
|
|
545
|
+
t2 = $[8];
|
|
546
|
+
}
|
|
547
|
+
let t3;
|
|
548
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
|
|
549
|
+
t3 = /* @__PURE__ */ _jsx(DialogPrimitive.Description, {
|
|
485
550
|
"data-slot": "dialog-description",
|
|
486
551
|
className: t1,
|
|
487
|
-
...props
|
|
552
|
+
...props,
|
|
553
|
+
children: t2
|
|
488
554
|
});
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
555
|
+
$[9] = props;
|
|
556
|
+
$[10] = t1;
|
|
557
|
+
$[11] = t2;
|
|
558
|
+
$[12] = t3;
|
|
492
559
|
} else {
|
|
493
|
-
|
|
560
|
+
t3 = $[12];
|
|
494
561
|
}
|
|
495
|
-
return
|
|
562
|
+
return t3;
|
|
496
563
|
}
|
|
497
564
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arc's Dropdown menu (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md) as beez-ui's composable Radix
|
|
3
|
+
* menu: Arc's raised panel, item rows, danger tone, separators, placement defaults and staggered item entrance on its
|
|
4
|
+
* tokens, keeping every subcomponent, prop and `data-slot` of the previous API. The surface keeps beez-ui's reveal
|
|
5
|
+
* from the trigger edge and the highlight that glides between items with the keyboard.
|
|
6
|
+
*/
|
|
1
7
|
import * as React from "react";
|
|
2
8
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
9
|
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
10
|
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
11
|
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
-
/**
|
|
7
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Arc's menu panel. It sizes action menus by their content, at least 12rem unless the viewport is narrower, instead
|
|
14
|
+
* of narrowing them to an icon trigger.
|
|
15
|
+
* @param props - Primitive properties. Arc's defaults: `align="start"`, a 6px `sideOffset`, a 12px
|
|
16
|
+
* `collisionPadding` and `loop`, so arrow keys wrap from the last item to the first.
|
|
17
|
+
* @returns The portaled menu, animated in and out with its open state.
|
|
18
|
+
*/
|
|
19
|
+
declare function DropdownMenuContent({ className, align, sideOffset, collisionPadding, loop, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
8
20
|
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
9
21
|
/**
|
|
10
|
-
* Renders an action
|
|
11
|
-
*
|
|
22
|
+
* Renders an action row. `destructive` draws Arc's danger tone: danger text and icon over a faint danger fill when
|
|
23
|
+
* highlighted.
|
|
24
|
+
* @param props - Primitive properties, `inset` to align with rows that carry an icon, and the `variant`.
|
|
12
25
|
* @returns The styled primitive with its original interaction contract.
|
|
13
26
|
*/
|
|
14
27
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
@@ -16,8 +29,8 @@ declare function DropdownMenuItem({ className, inset, variant, ...props }: React
|
|
|
16
29
|
variant?: "default" | "destructive";
|
|
17
30
|
}): React.JSX.Element;
|
|
18
31
|
/**
|
|
19
|
-
* Renders a
|
|
20
|
-
* @param props - Primitive properties and
|
|
32
|
+
* Renders a selectable checkbox action with its check at the end of the row.
|
|
33
|
+
* @param props - Primitive properties and `inset` to align with rows that carry an icon.
|
|
21
34
|
* @returns The styled primitive with its original interaction contract.
|
|
22
35
|
*/
|
|
23
36
|
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
@@ -25,16 +38,16 @@ declare function DropdownMenuCheckboxItem({ className, children, checked, inset,
|
|
|
25
38
|
}): React.JSX.Element;
|
|
26
39
|
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
27
40
|
/**
|
|
28
|
-
* Renders a
|
|
29
|
-
* @param props - Primitive properties and
|
|
41
|
+
* Renders a mutually exclusive action with its check at the end of the row.
|
|
42
|
+
* @param props - Primitive properties and `inset` to align with rows that carry an icon.
|
|
30
43
|
* @returns The styled primitive with its original interaction contract.
|
|
31
44
|
*/
|
|
32
45
|
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
33
46
|
inset?: boolean;
|
|
34
47
|
}): React.JSX.Element;
|
|
35
48
|
/**
|
|
36
|
-
* Renders a
|
|
37
|
-
* @param props - Primitive properties and
|
|
49
|
+
* Renders a muted group label aligned with the item text.
|
|
50
|
+
* @param props - Primitive properties and `inset` to align with rows that carry an icon.
|
|
38
51
|
* @returns The styled primitive with its original interaction contract.
|
|
39
52
|
*/
|
|
40
53
|
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
@@ -44,17 +57,18 @@ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentP
|
|
|
44
57
|
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
45
58
|
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
46
59
|
/**
|
|
47
|
-
* Renders
|
|
48
|
-
*
|
|
60
|
+
* Renders the row that opens a nested menu. It keeps the highlight fill while its submenu is open and nudges its
|
|
61
|
+
* chevron toward it.
|
|
62
|
+
* @param props - Primitive properties and `inset` to align with rows that carry an icon.
|
|
49
63
|
* @returns The styled primitive with its original interaction contract.
|
|
50
64
|
*/
|
|
51
65
|
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
52
66
|
inset?: boolean;
|
|
53
67
|
}): React.JSX.Element;
|
|
54
68
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @param props - Primitive properties
|
|
57
|
-
* @returns The
|
|
69
|
+
* Renders a nested menu on the same raised panel, at least 12rem wide.
|
|
70
|
+
* @param props - Primitive properties. Arc's defaults: a 12px `collisionPadding` and `loop`.
|
|
71
|
+
* @returns The submenu, animated in and out with its open state.
|
|
58
72
|
*/
|
|
59
|
-
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
73
|
+
declare function DropdownMenuSubContent({ className, collisionPadding, loop, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
60
74
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|