beez-ui 0.11.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/README.md +62 -15
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/assets/fonts/ibmplexmono-LICENSE.txt +93 -93
- package/assets/fonts/{poppins-LICENSE.txt → inter-LICENSE.txt} +2 -2
- package/assets/fonts/inter-latin-variable.woff2 +0 -0
- package/dist/components/account-menu.js +2 -2
- package/dist/components/alert-dialog.d.ts +4 -2
- package/dist/components/alert-dialog.js +78 -66
- package/dist/components/animated-collapse.js +106 -36
- package/dist/components/button-interaction.d.ts +23 -0
- package/dist/components/button-interaction.js +22 -0
- package/dist/components/button-label.d.ts +8 -0
- package/dist/components/button-label.js +322 -0
- package/dist/components/button.d.ts +23 -10
- package/dist/components/button.js +111 -64
- package/dist/components/calendar.d.ts +2 -2
- package/dist/components/calendar.js +4 -4
- package/dist/components/carousel.d.ts +3 -3
- package/dist/components/carousel.js +3 -3
- package/dist/components/control-button.d.ts +16 -0
- package/dist/components/control-button.js +215 -0
- package/dist/components/data-table.js +7 -7
- package/dist/components/dialog.js +3 -2
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/file-upload.js +5 -5
- package/dist/components/filter-presets-bar.js +6 -6
- package/dist/components/filter-query-bar.js +2 -2
- package/dist/components/input-group.d.ts +2 -2
- package/dist/components/input-group.js +2 -2
- package/dist/components/pagination.d.ts +2 -2
- package/dist/components/pagination.js +2 -2
- package/dist/components/reaction-button.js +2 -2
- package/dist/components/rich-link-editor.js +7 -7
- package/dist/components/rich-text-content.js +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sidebar.js +3 -3
- package/dist/components/typing-animation.js +1 -1
- package/dist/constants/button.d.ts +16 -0
- package/dist/constants/button.js +16 -0
- package/dist/motion/arc-press.d.ts +6 -0
- package/dist/motion/arc-press.js +59 -0
- package/dist/motion/arc-tokens.d.ts +32 -0
- package/dist/motion/arc-tokens.js +42 -0
- package/dist/providers/beez-ui-provider.d.ts +1 -1
- package/dist/providers/beez-ui-provider.js +6 -1
- package/dist/styles.css +1 -1
- package/fonts.css +5 -5
- package/package.json +3 -2
- package/styles.css +4 -4
- package/theme.css +248 -87
- package/assets/fonts/poppins-latin-600.woff2 +0 -0
|
@@ -408,121 +408,133 @@ function AlertDialogDescription(t0) {
|
|
|
408
408
|
}
|
|
409
409
|
return t2;
|
|
410
410
|
}
|
|
411
|
+
/** Confirms the dialog with an Arc `Button`; Radix merges its behavior onto the button through `asChild`. */
|
|
411
412
|
function AlertDialogAction(t0) {
|
|
412
|
-
const $ = _c(
|
|
413
|
+
const $ = _c(16);
|
|
414
|
+
let children;
|
|
413
415
|
let className;
|
|
414
416
|
let props;
|
|
415
417
|
let t1;
|
|
416
418
|
let t2;
|
|
417
419
|
if ($[0] !== t0) {
|
|
418
|
-
({className, variant: t1, size: t2, ...props} = t0);
|
|
420
|
+
({className, variant: t1, size: t2, children, ...props} = t0);
|
|
419
421
|
$[0] = t0;
|
|
420
|
-
$[1] =
|
|
421
|
-
$[2] =
|
|
422
|
-
$[3] =
|
|
423
|
-
$[4] =
|
|
422
|
+
$[1] = children;
|
|
423
|
+
$[2] = className;
|
|
424
|
+
$[3] = props;
|
|
425
|
+
$[4] = t1;
|
|
426
|
+
$[5] = t2;
|
|
424
427
|
} else {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
428
|
+
children = $[1];
|
|
429
|
+
className = $[2];
|
|
430
|
+
props = $[3];
|
|
431
|
+
t1 = $[4];
|
|
432
|
+
t2 = $[5];
|
|
429
433
|
}
|
|
430
|
-
const variant = t1 === undefined ? "
|
|
431
|
-
const size = t2 === undefined ? "
|
|
434
|
+
const variant = t1 === undefined ? "primary" : t1;
|
|
435
|
+
const size = t2 === undefined ? "md" : t2;
|
|
432
436
|
let t3;
|
|
433
|
-
if ($[
|
|
437
|
+
if ($[6] !== className) {
|
|
434
438
|
t3 = cn(className);
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
439
|
+
$[6] = className;
|
|
440
|
+
$[7] = t3;
|
|
437
441
|
} else {
|
|
438
|
-
t3 = $[
|
|
442
|
+
t3 = $[7];
|
|
439
443
|
}
|
|
440
444
|
let t4;
|
|
441
|
-
if ($[
|
|
442
|
-
t4 = /* @__PURE__ */ _jsx(
|
|
443
|
-
|
|
445
|
+
if ($[8] !== children || $[9] !== size || $[10] !== t3 || $[11] !== variant) {
|
|
446
|
+
t4 = /* @__PURE__ */ _jsx(Button, {
|
|
447
|
+
variant,
|
|
448
|
+
size,
|
|
444
449
|
className: t3,
|
|
445
|
-
|
|
450
|
+
children
|
|
446
451
|
});
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
452
|
+
$[8] = children;
|
|
453
|
+
$[9] = size;
|
|
454
|
+
$[10] = t3;
|
|
455
|
+
$[11] = variant;
|
|
456
|
+
$[12] = t4;
|
|
450
457
|
} else {
|
|
451
|
-
t4 = $[
|
|
458
|
+
t4 = $[12];
|
|
452
459
|
}
|
|
453
460
|
let t5;
|
|
454
|
-
if ($[
|
|
455
|
-
t5 = /* @__PURE__ */ _jsx(
|
|
456
|
-
|
|
457
|
-
size,
|
|
461
|
+
if ($[13] !== props || $[14] !== t4) {
|
|
462
|
+
t5 = /* @__PURE__ */ _jsx(AlertDialogPrimitive.Action, {
|
|
463
|
+
"data-slot": "alert-dialog-action",
|
|
458
464
|
asChild: true,
|
|
465
|
+
...props,
|
|
459
466
|
children: t4
|
|
460
467
|
});
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[13] = t5;
|
|
468
|
+
$[13] = props;
|
|
469
|
+
$[14] = t4;
|
|
470
|
+
$[15] = t5;
|
|
465
471
|
} else {
|
|
466
|
-
t5 = $[
|
|
472
|
+
t5 = $[15];
|
|
467
473
|
}
|
|
468
474
|
return t5;
|
|
469
475
|
}
|
|
476
|
+
/** Dismisses the dialog with an Arc secondary `Button` by default. */
|
|
470
477
|
function AlertDialogCancel(t0) {
|
|
471
|
-
const $ = _c(
|
|
478
|
+
const $ = _c(16);
|
|
479
|
+
let children;
|
|
472
480
|
let className;
|
|
473
481
|
let props;
|
|
474
482
|
let t1;
|
|
475
483
|
let t2;
|
|
476
484
|
if ($[0] !== t0) {
|
|
477
|
-
({className, variant: t1, size: t2, ...props} = t0);
|
|
485
|
+
({className, variant: t1, size: t2, children, ...props} = t0);
|
|
478
486
|
$[0] = t0;
|
|
479
|
-
$[1] =
|
|
480
|
-
$[2] =
|
|
481
|
-
$[3] =
|
|
482
|
-
$[4] =
|
|
487
|
+
$[1] = children;
|
|
488
|
+
$[2] = className;
|
|
489
|
+
$[3] = props;
|
|
490
|
+
$[4] = t1;
|
|
491
|
+
$[5] = t2;
|
|
483
492
|
} else {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
493
|
+
children = $[1];
|
|
494
|
+
className = $[2];
|
|
495
|
+
props = $[3];
|
|
496
|
+
t1 = $[4];
|
|
497
|
+
t2 = $[5];
|
|
488
498
|
}
|
|
489
|
-
const variant = t1 === undefined ? "
|
|
490
|
-
const size = t2 === undefined ? "
|
|
499
|
+
const variant = t1 === undefined ? "secondary" : t1;
|
|
500
|
+
const size = t2 === undefined ? "md" : t2;
|
|
491
501
|
let t3;
|
|
492
|
-
if ($[
|
|
502
|
+
if ($[6] !== className) {
|
|
493
503
|
t3 = cn(className);
|
|
494
|
-
$[
|
|
495
|
-
$[
|
|
504
|
+
$[6] = className;
|
|
505
|
+
$[7] = t3;
|
|
496
506
|
} else {
|
|
497
|
-
t3 = $[
|
|
507
|
+
t3 = $[7];
|
|
498
508
|
}
|
|
499
509
|
let t4;
|
|
500
|
-
if ($[
|
|
501
|
-
t4 = /* @__PURE__ */ _jsx(
|
|
502
|
-
|
|
510
|
+
if ($[8] !== children || $[9] !== size || $[10] !== t3 || $[11] !== variant) {
|
|
511
|
+
t4 = /* @__PURE__ */ _jsx(Button, {
|
|
512
|
+
variant,
|
|
513
|
+
size,
|
|
503
514
|
className: t3,
|
|
504
|
-
|
|
515
|
+
children
|
|
505
516
|
});
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
517
|
+
$[8] = children;
|
|
518
|
+
$[9] = size;
|
|
519
|
+
$[10] = t3;
|
|
520
|
+
$[11] = variant;
|
|
521
|
+
$[12] = t4;
|
|
509
522
|
} else {
|
|
510
|
-
t4 = $[
|
|
523
|
+
t4 = $[12];
|
|
511
524
|
}
|
|
512
525
|
let t5;
|
|
513
|
-
if ($[
|
|
514
|
-
t5 = /* @__PURE__ */ _jsx(
|
|
515
|
-
|
|
516
|
-
size,
|
|
526
|
+
if ($[13] !== props || $[14] !== t4) {
|
|
527
|
+
t5 = /* @__PURE__ */ _jsx(AlertDialogPrimitive.Cancel, {
|
|
528
|
+
"data-slot": "alert-dialog-cancel",
|
|
517
529
|
asChild: true,
|
|
530
|
+
...props,
|
|
518
531
|
children: t4
|
|
519
532
|
});
|
|
520
|
-
$[
|
|
521
|
-
$[
|
|
522
|
-
$[
|
|
523
|
-
$[13] = t5;
|
|
533
|
+
$[13] = props;
|
|
534
|
+
$[14] = t4;
|
|
535
|
+
$[15] = t5;
|
|
524
536
|
} else {
|
|
525
|
-
t5 = $[
|
|
537
|
+
t5 = $[15];
|
|
526
538
|
}
|
|
527
539
|
return t5;
|
|
528
540
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
/** Expands and collapses a region by animating its height, then releases overflow. */
|
|
4
4
|
import { useState } from "react";
|
|
5
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
5
|
+
import { AnimatePresence, motion, useIsPresent } from "motion/react";
|
|
6
6
|
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
7
7
|
import { cn } from "../lib/utils.js";
|
|
8
8
|
import { MOTION_EASE, MOTION_EASE_IN_OUT, MOTION_TIMING } from "../motion/tokens.js";
|
|
@@ -26,6 +26,94 @@ const REDUCED_MOTION_COLLAPSE_TRANSITION = {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
+
* The animated region. While it collapses out it turns inert and hidden from assistive
|
|
30
|
+
* technology, so stale controls cannot be clicked, focused or announced during the fade.
|
|
31
|
+
* @param props - Content, optional wrapper attributes and whether it mounts with an entrance.
|
|
32
|
+
* @returns The animated region.
|
|
33
|
+
*/
|
|
34
|
+
function AnimatedCollapseRegion(t0) {
|
|
35
|
+
const $ = _c(15);
|
|
36
|
+
const { children, className, id, isEntering } = t0;
|
|
37
|
+
const [isSettled, setIsSettled] = useState(!isEntering);
|
|
38
|
+
const isPresent = useIsPresent();
|
|
39
|
+
const shouldReduceMotion = usePrefersReducedMotion();
|
|
40
|
+
const t1 = isPresent ? undefined : true;
|
|
41
|
+
const t2 = !isPresent || undefined;
|
|
42
|
+
const t3 = isSettled ? "overflow-visible" : "overflow-hidden";
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[0] !== className || $[1] !== t3) {
|
|
45
|
+
t4 = cn(t3, className);
|
|
46
|
+
$[0] = className;
|
|
47
|
+
$[1] = t3;
|
|
48
|
+
$[2] = t4;
|
|
49
|
+
} else {
|
|
50
|
+
t4 = $[2];
|
|
51
|
+
}
|
|
52
|
+
let t5;
|
|
53
|
+
let t6;
|
|
54
|
+
let t7;
|
|
55
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56
|
+
t5 = {
|
|
57
|
+
height: 0,
|
|
58
|
+
opacity: 0
|
|
59
|
+
};
|
|
60
|
+
t6 = {
|
|
61
|
+
height: "auto",
|
|
62
|
+
opacity: 1
|
|
63
|
+
};
|
|
64
|
+
t7 = {
|
|
65
|
+
height: 0,
|
|
66
|
+
opacity: 0
|
|
67
|
+
};
|
|
68
|
+
$[3] = t5;
|
|
69
|
+
$[4] = t6;
|
|
70
|
+
$[5] = t7;
|
|
71
|
+
} else {
|
|
72
|
+
t5 = $[3];
|
|
73
|
+
t6 = $[4];
|
|
74
|
+
t7 = $[5];
|
|
75
|
+
}
|
|
76
|
+
const t8 = shouldReduceMotion ? REDUCED_MOTION_COLLAPSE_TRANSITION : COLLAPSE_TRANSITION;
|
|
77
|
+
let t10;
|
|
78
|
+
let t9;
|
|
79
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
+
t9 = () => setIsSettled(false);
|
|
81
|
+
t10 = () => setIsSettled(true);
|
|
82
|
+
$[6] = t10;
|
|
83
|
+
$[7] = t9;
|
|
84
|
+
} else {
|
|
85
|
+
t10 = $[6];
|
|
86
|
+
t9 = $[7];
|
|
87
|
+
}
|
|
88
|
+
let t11;
|
|
89
|
+
if ($[8] !== children || $[9] !== id || $[10] !== t1 || $[11] !== t2 || $[12] !== t4 || $[13] !== t8) {
|
|
90
|
+
t11 = /* @__PURE__ */ _jsx(motion.div, {
|
|
91
|
+
"data-slot": "animated-collapse",
|
|
92
|
+
id,
|
|
93
|
+
"aria-hidden": t1,
|
|
94
|
+
inert: t2,
|
|
95
|
+
className: t4,
|
|
96
|
+
initial: t5,
|
|
97
|
+
animate: t6,
|
|
98
|
+
exit: t7,
|
|
99
|
+
transition: t8,
|
|
100
|
+
onAnimationStart: t9,
|
|
101
|
+
onAnimationComplete: t10,
|
|
102
|
+
children
|
|
103
|
+
});
|
|
104
|
+
$[8] = children;
|
|
105
|
+
$[9] = id;
|
|
106
|
+
$[10] = t1;
|
|
107
|
+
$[11] = t2;
|
|
108
|
+
$[12] = t4;
|
|
109
|
+
$[13] = t8;
|
|
110
|
+
$[14] = t11;
|
|
111
|
+
} else {
|
|
112
|
+
t11 = $[14];
|
|
113
|
+
}
|
|
114
|
+
return t11;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
29
117
|
* Renders `children` only while `isOpen`, animating height and opacity.
|
|
30
118
|
* Keep padding inside `children`: the animated wrapper collapses to zero height.
|
|
31
119
|
* Overflow is clipped only while animating, so focus rings and popovers are not cut once settled.
|
|
@@ -33,55 +121,37 @@ const REDUCED_MOTION_COLLAPSE_TRANSITION = {
|
|
|
33
121
|
* @returns The animated region, or nothing when closed.
|
|
34
122
|
*/
|
|
35
123
|
export function AnimatedCollapse(t0) {
|
|
36
|
-
const $ = _c(
|
|
124
|
+
const $ = _c(9);
|
|
37
125
|
const { isOpen, children, className, id, animateOnMount: t1 } = t0;
|
|
38
126
|
const animateOnMount = t1 === undefined ? false : t1;
|
|
39
|
-
const [isSettled, setIsSettled] = useState(!animateOnMount);
|
|
40
|
-
const shouldReduceMotion = usePrefersReducedMotion();
|
|
41
127
|
let t2;
|
|
42
|
-
if ($[0] !==
|
|
43
|
-
t2 = isOpen ? /* @__PURE__ */ _jsx(
|
|
44
|
-
|
|
128
|
+
if ($[0] !== animateOnMount || $[1] !== children || $[2] !== className || $[3] !== id || $[4] !== isOpen) {
|
|
129
|
+
t2 = isOpen ? /* @__PURE__ */ _jsx(AnimatedCollapseRegion, {
|
|
130
|
+
className,
|
|
45
131
|
id,
|
|
46
|
-
|
|
47
|
-
initial: {
|
|
48
|
-
height: 0,
|
|
49
|
-
opacity: 0
|
|
50
|
-
},
|
|
51
|
-
animate: {
|
|
52
|
-
height: "auto",
|
|
53
|
-
opacity: 1
|
|
54
|
-
},
|
|
55
|
-
exit: {
|
|
56
|
-
height: 0,
|
|
57
|
-
opacity: 0
|
|
58
|
-
},
|
|
59
|
-
transition: shouldReduceMotion ? REDUCED_MOTION_COLLAPSE_TRANSITION : COLLAPSE_TRANSITION,
|
|
60
|
-
onAnimationStart: () => setIsSettled(false),
|
|
61
|
-
onAnimationComplete: () => setIsSettled(true),
|
|
132
|
+
isEntering: animateOnMount,
|
|
62
133
|
children
|
|
63
134
|
}, "animated-collapse") : null;
|
|
64
|
-
$[0] =
|
|
65
|
-
$[1] =
|
|
66
|
-
$[2] =
|
|
67
|
-
$[3] =
|
|
68
|
-
$[4] =
|
|
69
|
-
$[5] =
|
|
70
|
-
$[6] = t2;
|
|
135
|
+
$[0] = animateOnMount;
|
|
136
|
+
$[1] = children;
|
|
137
|
+
$[2] = className;
|
|
138
|
+
$[3] = id;
|
|
139
|
+
$[4] = isOpen;
|
|
140
|
+
$[5] = t2;
|
|
71
141
|
} else {
|
|
72
|
-
t2 = $[
|
|
142
|
+
t2 = $[5];
|
|
73
143
|
}
|
|
74
144
|
let t3;
|
|
75
|
-
if ($[
|
|
145
|
+
if ($[6] !== animateOnMount || $[7] !== t2) {
|
|
76
146
|
t3 = /* @__PURE__ */ _jsx(AnimatePresence, {
|
|
77
147
|
initial: animateOnMount,
|
|
78
148
|
children: t2
|
|
79
149
|
});
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
150
|
+
$[6] = animateOnMount;
|
|
151
|
+
$[7] = t2;
|
|
152
|
+
$[8] = t3;
|
|
83
153
|
} else {
|
|
84
|
-
t3 = $[
|
|
154
|
+
t3 = $[8];
|
|
85
155
|
}
|
|
86
156
|
return t3;
|
|
87
157
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Interaction states shared by `Button` and the internal `ControlButton`. */
|
|
2
|
+
import type { MouseEvent } from "react";
|
|
3
|
+
/** Swallows activation while loading, keeping the button focusable instead of disabling it. */
|
|
4
|
+
declare function preventActivation(event: MouseEvent<HTMLElement>): void;
|
|
5
|
+
/**
|
|
6
|
+
* While loading, these handlers are dropped: Radix triggers open their layer from pointer and key handlers they
|
|
7
|
+
* inject through `asChild`, so swallowing only the click would leave a busy trigger able to open it. Keyboard focus
|
|
8
|
+
* stays, since nothing here touches focusability.
|
|
9
|
+
*/
|
|
10
|
+
export declare const LOADING_INERT_HANDLERS: {
|
|
11
|
+
readonly onClick: typeof preventActivation;
|
|
12
|
+
readonly onPointerDown: undefined;
|
|
13
|
+
readonly onKeyDown: undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Applied while a parent `AnimatePresence` removes the button, so a stale control can be neither clicked, focused
|
|
17
|
+
* nor announced during the exit animation.
|
|
18
|
+
*/
|
|
19
|
+
export declare const LEAVING_ATTRIBUTES: {
|
|
20
|
+
readonly inert: true;
|
|
21
|
+
readonly "aria-hidden": true;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Swallows activation while loading, keeping the button focusable instead of disabling it. */
|
|
2
|
+
function preventActivation(event) {
|
|
3
|
+
event.preventDefault();
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* While loading, these handlers are dropped: Radix triggers open their layer from pointer and key handlers they
|
|
7
|
+
* inject through `asChild`, so swallowing only the click would leave a busy trigger able to open it. Keyboard focus
|
|
8
|
+
* stays, since nothing here touches focusability.
|
|
9
|
+
*/
|
|
10
|
+
export const LOADING_INERT_HANDLERS = {
|
|
11
|
+
onClick: preventActivation,
|
|
12
|
+
onPointerDown: undefined,
|
|
13
|
+
onKeyDown: undefined
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Applied while a parent `AnimatePresence` removes the button, so a stale control can be neither clicked, focused
|
|
17
|
+
* nor announced during the exit animation.
|
|
18
|
+
*/
|
|
19
|
+
export const LEAVING_ATTRIBUTES = {
|
|
20
|
+
inert: true,
|
|
21
|
+
"aria-hidden": true
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type ButtonLabelProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
reduceMotion: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** Button content: a spinner while loading and a label whose width springs when it changes. */
|
|
8
|
+
export declare function ButtonLabel({ children, loading, reduceMotion }: ButtonLabelProps): import("react").JSX.Element;
|