beez-ui 0.5.3 → 0.5.4
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 +4 -0
- package/README.md +63 -2
- package/dist/components/alert-dialog.js +72 -28
- package/dist/components/alert.js +9 -5
- package/dist/components/animated-theme-toggler.js +113 -97
- package/dist/components/avatar.js +22 -15
- package/dist/components/badge.js +9 -5
- package/dist/components/button.js +11 -7
- package/dist/components/card.js +9 -5
- package/dist/components/carousel.js +59 -55
- package/dist/components/checkbox.js +16 -9
- package/dist/components/dialog.js +77 -33
- package/dist/components/dropdown-menu.js +126 -49
- package/dist/components/form.js +16 -9
- package/dist/components/highlighter.js +18 -12
- package/dist/components/hover-card.js +60 -21
- package/dist/components/input-group.js +9 -5
- package/dist/components/input.js +9 -5
- package/dist/components/label.js +8 -4
- package/dist/components/link.d.ts +0 -1
- package/dist/components/link.js +28 -20
- package/dist/components/popover.js +66 -25
- package/dist/components/radio-group.js +16 -9
- package/dist/components/select.js +34 -24
- package/dist/components/separator.js +9 -5
- package/dist/components/sheet.js +78 -34
- package/dist/components/sidebar.js +21 -14
- package/dist/components/skeleton.js +8 -4
- package/dist/components/svgs/whatsappIcon.js +14 -9
- package/dist/components/switch.js +16 -9
- package/dist/components/table.js +8 -4
- package/dist/components/tabs.js +15 -8
- package/dist/components/textarea.js +8 -4
- package/dist/components/themed-toaster.js +61 -27
- package/dist/components/tooltip.js +70 -29
- package/dist/components/typing-animation.js +80 -58
- package/dist/constants/motion.d.ts +2 -0
- package/dist/constants/motion.js +2 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.js +27 -0
- package/dist/motion/motion-slot.d.ts +9 -0
- package/dist/motion/motion-slot.js +353 -0
- package/dist/motion/presence.d.ts +33 -0
- package/dist/motion/presence.js +92 -0
- package/dist/motion/tokens.d.ts +13 -0
- package/dist/motion/tokens.js +17 -0
- package/dist/providers/beez-ui-provider.js +7 -3
- package/dist/styles.css +1 -1
- package/package.json +12 -4
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
5
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
6
|
+
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
|
|
5
7
|
import { cn } from "../lib/utils.js";
|
|
6
8
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
7
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
10
|
function DropdownMenu(t0) {
|
|
9
|
-
const $ = _c(
|
|
11
|
+
const $ = _c(9);
|
|
10
12
|
let props;
|
|
11
13
|
if ($[0] !== t0) {
|
|
12
14
|
({...props} = t0);
|
|
@@ -15,18 +17,36 @@ function DropdownMenu(t0) {
|
|
|
15
17
|
} else {
|
|
16
18
|
props = $[1];
|
|
17
19
|
}
|
|
20
|
+
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
18
21
|
let t1;
|
|
19
|
-
if ($[2] !== props) {
|
|
22
|
+
if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
|
|
20
23
|
t1 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Root, {
|
|
21
24
|
"data-slot": "dropdown-menu",
|
|
22
|
-
...props
|
|
25
|
+
...props,
|
|
26
|
+
open: motionOpen,
|
|
27
|
+
onOpenChange: setMotionOpen
|
|
23
28
|
});
|
|
24
|
-
$[2] =
|
|
25
|
-
$[3] =
|
|
29
|
+
$[2] = motionOpen;
|
|
30
|
+
$[3] = props;
|
|
31
|
+
$[4] = setMotionOpen;
|
|
32
|
+
$[5] = t1;
|
|
26
33
|
} else {
|
|
27
|
-
t1 = $[
|
|
34
|
+
t1 = $[5];
|
|
28
35
|
}
|
|
29
|
-
|
|
36
|
+
let t2;
|
|
37
|
+
if ($[6] !== motionOpen || $[7] !== t1) {
|
|
38
|
+
t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
39
|
+
scope: "dropdown-menu",
|
|
40
|
+
open: motionOpen,
|
|
41
|
+
children: t1
|
|
42
|
+
});
|
|
43
|
+
$[6] = motionOpen;
|
|
44
|
+
$[7] = t1;
|
|
45
|
+
$[8] = t2;
|
|
46
|
+
} else {
|
|
47
|
+
t2 = $[8];
|
|
48
|
+
}
|
|
49
|
+
return t2;
|
|
30
50
|
}
|
|
31
51
|
function DropdownMenuPortal(t0) {
|
|
32
52
|
const $ = _c(4);
|
|
@@ -76,7 +96,7 @@ function DropdownMenuTrigger(t0) {
|
|
|
76
96
|
}
|
|
77
97
|
/** Sizes action menus by their content instead of narrowing them to an icon trigger. */
|
|
78
98
|
function DropdownMenuContent(t0) {
|
|
79
|
-
const $ = _c(
|
|
99
|
+
const $ = _c(15);
|
|
80
100
|
let className;
|
|
81
101
|
let props;
|
|
82
102
|
let t1;
|
|
@@ -96,32 +116,53 @@ function DropdownMenuContent(t0) {
|
|
|
96
116
|
}
|
|
97
117
|
const align = t1 === undefined ? "start" : t1;
|
|
98
118
|
const sideOffset = t2 === undefined ? 4 : t2;
|
|
99
|
-
|
|
119
|
+
const t3 = props.forceMount;
|
|
120
|
+
let t4;
|
|
100
121
|
if ($[5] !== className) {
|
|
101
|
-
|
|
122
|
+
t4 = cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-48 max-w-(--radix-dropdown-menu-content-available-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-destructive/10!", className);
|
|
102
123
|
$[5] = className;
|
|
103
|
-
$[6] =
|
|
104
|
-
} else {
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
let
|
|
108
|
-
if ($[7] !== align || $[8] !== props || $[9] !== sideOffset || $[10] !==
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
124
|
+
$[6] = t4;
|
|
125
|
+
} else {
|
|
126
|
+
t4 = $[6];
|
|
127
|
+
}
|
|
128
|
+
let t5;
|
|
129
|
+
if ($[7] !== align || $[8] !== props || $[9] !== sideOffset || $[10] !== t4) {
|
|
130
|
+
t5 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
131
|
+
kind: "surface",
|
|
132
|
+
children: /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Content, {
|
|
133
|
+
forceMount: true,
|
|
134
|
+
"data-slot": "dropdown-menu-content",
|
|
135
|
+
sideOffset,
|
|
136
|
+
align,
|
|
137
|
+
className: t4,
|
|
138
|
+
...props
|
|
139
|
+
})
|
|
140
|
+
});
|
|
116
141
|
$[7] = align;
|
|
117
142
|
$[8] = props;
|
|
118
143
|
$[9] = sideOffset;
|
|
119
|
-
$[10] =
|
|
120
|
-
$[11] =
|
|
144
|
+
$[10] = t4;
|
|
145
|
+
$[11] = t5;
|
|
146
|
+
} else {
|
|
147
|
+
t5 = $[11];
|
|
148
|
+
}
|
|
149
|
+
let t6;
|
|
150
|
+
if ($[12] !== props.forceMount || $[13] !== t5) {
|
|
151
|
+
t6 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Portal, {
|
|
152
|
+
forceMount: true,
|
|
153
|
+
children: /* @__PURE__ */ _jsx(MotionPresence, {
|
|
154
|
+
scope: "dropdown-menu",
|
|
155
|
+
forceMount: t3,
|
|
156
|
+
children: t5
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
$[12] = props.forceMount;
|
|
160
|
+
$[13] = t5;
|
|
161
|
+
$[14] = t6;
|
|
121
162
|
} else {
|
|
122
|
-
|
|
163
|
+
t6 = $[14];
|
|
123
164
|
}
|
|
124
|
-
return
|
|
165
|
+
return t6;
|
|
125
166
|
}
|
|
126
167
|
function DropdownMenuGroup(t0) {
|
|
127
168
|
const $ = _c(4);
|
|
@@ -469,7 +510,7 @@ function DropdownMenuShortcut(t0) {
|
|
|
469
510
|
return t2;
|
|
470
511
|
}
|
|
471
512
|
function DropdownMenuSub(t0) {
|
|
472
|
-
const $ = _c(
|
|
513
|
+
const $ = _c(9);
|
|
473
514
|
let props;
|
|
474
515
|
if ($[0] !== t0) {
|
|
475
516
|
({...props} = t0);
|
|
@@ -478,18 +519,36 @@ function DropdownMenuSub(t0) {
|
|
|
478
519
|
} else {
|
|
479
520
|
props = $[1];
|
|
480
521
|
}
|
|
522
|
+
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
481
523
|
let t1;
|
|
482
|
-
if ($[2] !== props) {
|
|
524
|
+
if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
|
|
483
525
|
t1 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Sub, {
|
|
484
526
|
"data-slot": "dropdown-menu-sub",
|
|
485
|
-
...props
|
|
527
|
+
...props,
|
|
528
|
+
open: motionOpen,
|
|
529
|
+
onOpenChange: setMotionOpen
|
|
486
530
|
});
|
|
487
|
-
$[2] =
|
|
488
|
-
$[3] =
|
|
531
|
+
$[2] = motionOpen;
|
|
532
|
+
$[3] = props;
|
|
533
|
+
$[4] = setMotionOpen;
|
|
534
|
+
$[5] = t1;
|
|
489
535
|
} else {
|
|
490
|
-
t1 = $[
|
|
536
|
+
t1 = $[5];
|
|
491
537
|
}
|
|
492
|
-
|
|
538
|
+
let t2;
|
|
539
|
+
if ($[6] !== motionOpen || $[7] !== t1) {
|
|
540
|
+
t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
541
|
+
scope: "dropdown-sub",
|
|
542
|
+
open: motionOpen,
|
|
543
|
+
children: t1
|
|
544
|
+
});
|
|
545
|
+
$[6] = motionOpen;
|
|
546
|
+
$[7] = t1;
|
|
547
|
+
$[8] = t2;
|
|
548
|
+
} else {
|
|
549
|
+
t2 = $[8];
|
|
550
|
+
}
|
|
551
|
+
return t2;
|
|
493
552
|
}
|
|
494
553
|
/**
|
|
495
554
|
* Renders a compact trigger for a nested menu.
|
|
@@ -555,7 +614,7 @@ function DropdownMenuSubTrigger(t0) {
|
|
|
555
614
|
* @returns The styled primitive with its original interaction contract.
|
|
556
615
|
*/
|
|
557
616
|
function DropdownMenuSubContent(t0) {
|
|
558
|
-
const $ = _c(
|
|
617
|
+
const $ = _c(11);
|
|
559
618
|
let className;
|
|
560
619
|
let props;
|
|
561
620
|
if ($[0] !== t0) {
|
|
@@ -567,27 +626,45 @@ function DropdownMenuSubContent(t0) {
|
|
|
567
626
|
className = $[1];
|
|
568
627
|
props = $[2];
|
|
569
628
|
}
|
|
570
|
-
|
|
629
|
+
const t1 = props.forceMount;
|
|
630
|
+
let t2;
|
|
571
631
|
if ($[3] !== className) {
|
|
572
|
-
|
|
632
|
+
t2 = cn("z-50 min-w-48 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-destructive/10!", className);
|
|
573
633
|
$[3] = className;
|
|
574
|
-
$[4] =
|
|
634
|
+
$[4] = t2;
|
|
575
635
|
} else {
|
|
576
|
-
|
|
636
|
+
t2 = $[4];
|
|
577
637
|
}
|
|
578
|
-
let
|
|
579
|
-
if ($[5] !== props || $[6] !==
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
638
|
+
let t3;
|
|
639
|
+
if ($[5] !== props || $[6] !== t2) {
|
|
640
|
+
t3 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
641
|
+
kind: "surface",
|
|
642
|
+
children: /* @__PURE__ */ _jsx(DropdownMenuPrimitive.SubContent, {
|
|
643
|
+
forceMount: true,
|
|
644
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
645
|
+
className: t2,
|
|
646
|
+
...props
|
|
647
|
+
})
|
|
584
648
|
});
|
|
585
649
|
$[5] = props;
|
|
586
|
-
$[6] =
|
|
587
|
-
$[7] =
|
|
650
|
+
$[6] = t2;
|
|
651
|
+
$[7] = t3;
|
|
588
652
|
} else {
|
|
589
|
-
|
|
653
|
+
t3 = $[7];
|
|
590
654
|
}
|
|
591
|
-
|
|
655
|
+
let t4;
|
|
656
|
+
if ($[8] !== props.forceMount || $[9] !== t3) {
|
|
657
|
+
t4 = /* @__PURE__ */ _jsx(MotionPresence, {
|
|
658
|
+
scope: "dropdown-sub",
|
|
659
|
+
forceMount: t1,
|
|
660
|
+
children: t3
|
|
661
|
+
});
|
|
662
|
+
$[8] = props.forceMount;
|
|
663
|
+
$[9] = t3;
|
|
664
|
+
$[10] = t4;
|
|
665
|
+
} else {
|
|
666
|
+
t4 = $[10];
|
|
667
|
+
}
|
|
668
|
+
return t4;
|
|
592
669
|
}
|
|
593
670
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent };
|
package/dist/components/form.js
CHANGED
|
@@ -3,6 +3,7 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Slot } from "radix-ui";
|
|
5
5
|
import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
|
|
6
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
6
7
|
import { cn } from "../lib/utils.js";
|
|
7
8
|
import { Label } from "./label.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -148,9 +149,12 @@ function FormItem(t0) {
|
|
|
148
149
|
}
|
|
149
150
|
let t4;
|
|
150
151
|
if ($[10] !== t1 || $[11] !== t3) {
|
|
151
|
-
t4 = /* @__PURE__ */ _jsx(
|
|
152
|
-
|
|
153
|
-
children:
|
|
152
|
+
t4 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
153
|
+
kind: "field",
|
|
154
|
+
children: /* @__PURE__ */ _jsx(FormItemContext.Provider, {
|
|
155
|
+
value: t1,
|
|
156
|
+
children: t3
|
|
157
|
+
})
|
|
154
158
|
});
|
|
155
159
|
$[10] = t1;
|
|
156
160
|
$[11] = t3;
|
|
@@ -301,12 +305,15 @@ function FormMessage(t0) {
|
|
|
301
305
|
}
|
|
302
306
|
let t2;
|
|
303
307
|
if ($[5] !== body || $[6] !== formMessageId || $[7] !== props || $[8] !== t1) {
|
|
304
|
-
t2 = /* @__PURE__ */ _jsx(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
t2 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
309
|
+
kind: "fade",
|
|
310
|
+
children: /* @__PURE__ */ _jsx("p", {
|
|
311
|
+
"data-slot": "form-message",
|
|
312
|
+
id: formMessageId,
|
|
313
|
+
className: t1,
|
|
314
|
+
...props,
|
|
315
|
+
children: body
|
|
316
|
+
})
|
|
310
317
|
});
|
|
311
318
|
$[5] = body;
|
|
312
319
|
$[6] = formMessageId;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
4
5
|
import { annotate } from "rough-notation";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
export function Highlighter(t0) {
|
|
7
|
-
const $ = _c(
|
|
8
|
+
const $ = _c(18);
|
|
8
9
|
const { children, action: t1, color: t2, strokeWidth: t3, animationDuration: t4, iterations: t5, padding: t6, multiline: t7, isView: t8 } = t0;
|
|
9
10
|
const action = t1 === undefined ? "highlight" : t1;
|
|
10
11
|
const color = t2 === undefined ? "#ffd1dc" : t2;
|
|
@@ -14,6 +15,7 @@ export function Highlighter(t0) {
|
|
|
14
15
|
const padding = t6 === undefined ? 2 : t6;
|
|
15
16
|
const multiline = t7 === undefined ? true : t7;
|
|
16
17
|
const isView = t8 === undefined ? false : t8;
|
|
18
|
+
const shouldReduceMotion = usePrefersReducedMotion();
|
|
17
19
|
const elementRef = useRef(null);
|
|
18
20
|
const annotationRef = useRef(null);
|
|
19
21
|
let t9;
|
|
@@ -60,7 +62,7 @@ export function Highlighter(t0) {
|
|
|
60
62
|
const shouldShow = !isView || isInView;
|
|
61
63
|
let t12;
|
|
62
64
|
let t13;
|
|
63
|
-
if ($[5] !== action || $[6] !== animationDuration || $[7] !== color || $[8] !== iterations || $[9] !== multiline || $[10] !== padding || $[11] !==
|
|
65
|
+
if ($[5] !== action || $[6] !== animationDuration || $[7] !== color || $[8] !== iterations || $[9] !== multiline || $[10] !== padding || $[11] !== shouldReduceMotion || $[12] !== shouldShow || $[13] !== strokeWidth) {
|
|
64
66
|
t12 = () => {
|
|
65
67
|
const element_0 = elementRef.current;
|
|
66
68
|
let resizeObserver = null;
|
|
@@ -71,6 +73,7 @@ export function Highlighter(t0) {
|
|
|
71
73
|
color,
|
|
72
74
|
strokeWidth,
|
|
73
75
|
animationDuration,
|
|
76
|
+
animate: !shouldReduceMotion,
|
|
74
77
|
iterations,
|
|
75
78
|
padding,
|
|
76
79
|
multiline
|
|
@@ -107,6 +110,7 @@ export function Highlighter(t0) {
|
|
|
107
110
|
};
|
|
108
111
|
t13 = [
|
|
109
112
|
shouldShow,
|
|
113
|
+
shouldReduceMotion,
|
|
110
114
|
action,
|
|
111
115
|
color,
|
|
112
116
|
strokeWidth,
|
|
@@ -121,26 +125,28 @@ export function Highlighter(t0) {
|
|
|
121
125
|
$[8] = iterations;
|
|
122
126
|
$[9] = multiline;
|
|
123
127
|
$[10] = padding;
|
|
124
|
-
$[11] =
|
|
125
|
-
$[12] =
|
|
126
|
-
$[13] =
|
|
127
|
-
$[14] =
|
|
128
|
+
$[11] = shouldReduceMotion;
|
|
129
|
+
$[12] = shouldShow;
|
|
130
|
+
$[13] = strokeWidth;
|
|
131
|
+
$[14] = t12;
|
|
132
|
+
$[15] = t13;
|
|
128
133
|
} else {
|
|
129
|
-
t12 = $[
|
|
130
|
-
t13 = $[
|
|
134
|
+
t12 = $[14];
|
|
135
|
+
t13 = $[15];
|
|
131
136
|
}
|
|
132
137
|
useEffect(t12, t13);
|
|
133
138
|
let t14;
|
|
134
|
-
if ($[
|
|
139
|
+
if ($[16] !== children) {
|
|
135
140
|
t14 = /* @__PURE__ */ _jsx("span", {
|
|
141
|
+
"data-slot": "highlighter",
|
|
136
142
|
ref: elementRef,
|
|
137
143
|
className: "relative inline-block bg-transparent",
|
|
138
144
|
children
|
|
139
145
|
});
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
146
|
+
$[16] = children;
|
|
147
|
+
$[17] = t14;
|
|
142
148
|
} else {
|
|
143
|
-
t14 = $[
|
|
149
|
+
t14 = $[17];
|
|
144
150
|
}
|
|
145
151
|
return t14;
|
|
146
152
|
}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
|
5
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
6
|
+
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
|
|
5
7
|
import { cn } from "../lib/utils.js";
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
9
|
function HoverCard(t0) {
|
|
8
|
-
const $ = _c(
|
|
10
|
+
const $ = _c(9);
|
|
9
11
|
let props;
|
|
10
12
|
if ($[0] !== t0) {
|
|
11
13
|
({...props} = t0);
|
|
@@ -14,18 +16,36 @@ function HoverCard(t0) {
|
|
|
14
16
|
} else {
|
|
15
17
|
props = $[1];
|
|
16
18
|
}
|
|
19
|
+
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
17
20
|
let t1;
|
|
18
|
-
if ($[2] !== props) {
|
|
21
|
+
if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
|
|
19
22
|
t1 = /* @__PURE__ */ _jsx(HoverCardPrimitive.Root, {
|
|
20
23
|
"data-slot": "hover-card",
|
|
21
|
-
...props
|
|
24
|
+
...props,
|
|
25
|
+
open: motionOpen,
|
|
26
|
+
onOpenChange: setMotionOpen
|
|
22
27
|
});
|
|
23
|
-
$[2] =
|
|
24
|
-
$[3] =
|
|
28
|
+
$[2] = motionOpen;
|
|
29
|
+
$[3] = props;
|
|
30
|
+
$[4] = setMotionOpen;
|
|
31
|
+
$[5] = t1;
|
|
25
32
|
} else {
|
|
26
|
-
t1 = $[
|
|
33
|
+
t1 = $[5];
|
|
27
34
|
}
|
|
28
|
-
|
|
35
|
+
let t2;
|
|
36
|
+
if ($[6] !== motionOpen || $[7] !== t1) {
|
|
37
|
+
t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
38
|
+
scope: "hover-card",
|
|
39
|
+
open: motionOpen,
|
|
40
|
+
children: t1
|
|
41
|
+
});
|
|
42
|
+
$[6] = motionOpen;
|
|
43
|
+
$[7] = t1;
|
|
44
|
+
$[8] = t2;
|
|
45
|
+
} else {
|
|
46
|
+
t2 = $[8];
|
|
47
|
+
}
|
|
48
|
+
return t2;
|
|
29
49
|
}
|
|
30
50
|
function HoverCardTrigger(t0) {
|
|
31
51
|
const $ = _c(4);
|
|
@@ -51,7 +71,7 @@ function HoverCardTrigger(t0) {
|
|
|
51
71
|
return t1;
|
|
52
72
|
}
|
|
53
73
|
function HoverCardContent(t0) {
|
|
54
|
-
const $ = _c(
|
|
74
|
+
const $ = _c(15);
|
|
55
75
|
let className;
|
|
56
76
|
let props;
|
|
57
77
|
let t1;
|
|
@@ -71,34 +91,53 @@ function HoverCardContent(t0) {
|
|
|
71
91
|
}
|
|
72
92
|
const align = t1 === undefined ? "center" : t1;
|
|
73
93
|
const sideOffset = t2 === undefined ? 4 : t2;
|
|
74
|
-
|
|
94
|
+
const t3 = props.forceMount;
|
|
95
|
+
let t4;
|
|
75
96
|
if ($[5] !== className) {
|
|
76
|
-
|
|
97
|
+
t4 = cn("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden ", className);
|
|
77
98
|
$[5] = className;
|
|
78
|
-
$[6] =
|
|
99
|
+
$[6] = t4;
|
|
79
100
|
} else {
|
|
80
|
-
|
|
101
|
+
t4 = $[6];
|
|
81
102
|
}
|
|
82
|
-
let
|
|
83
|
-
if ($[7] !== align || $[8] !== props || $[9] !== sideOffset || $[10] !==
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
let t5;
|
|
104
|
+
if ($[7] !== align || $[8] !== props || $[9] !== sideOffset || $[10] !== t4) {
|
|
105
|
+
t5 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
106
|
+
kind: "surface",
|
|
86
107
|
children: /* @__PURE__ */ _jsx(HoverCardPrimitive.Content, {
|
|
108
|
+
forceMount: true,
|
|
87
109
|
"data-slot": "hover-card-content",
|
|
88
110
|
align,
|
|
89
111
|
sideOffset,
|
|
90
|
-
className:
|
|
112
|
+
className: t4,
|
|
91
113
|
...props
|
|
92
114
|
})
|
|
93
115
|
});
|
|
94
116
|
$[7] = align;
|
|
95
117
|
$[8] = props;
|
|
96
118
|
$[9] = sideOffset;
|
|
97
|
-
$[10] =
|
|
98
|
-
$[11] =
|
|
119
|
+
$[10] = t4;
|
|
120
|
+
$[11] = t5;
|
|
121
|
+
} else {
|
|
122
|
+
t5 = $[11];
|
|
123
|
+
}
|
|
124
|
+
let t6;
|
|
125
|
+
if ($[12] !== props.forceMount || $[13] !== t5) {
|
|
126
|
+
t6 = /* @__PURE__ */ _jsx(HoverCardPrimitive.Portal, {
|
|
127
|
+
"data-slot": "hover-card-portal",
|
|
128
|
+
forceMount: true,
|
|
129
|
+
children: /* @__PURE__ */ _jsx(MotionPresence, {
|
|
130
|
+
scope: "hover-card",
|
|
131
|
+
forceMount: t3,
|
|
132
|
+
children: t5
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
$[12] = props.forceMount;
|
|
136
|
+
$[13] = t5;
|
|
137
|
+
$[14] = t6;
|
|
99
138
|
} else {
|
|
100
|
-
|
|
139
|
+
t6 = $[14];
|
|
101
140
|
}
|
|
102
|
-
return
|
|
141
|
+
return t6;
|
|
103
142
|
}
|
|
104
143
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
import { Button } from "./button.js";
|
|
7
8
|
import { Input } from "./input.js";
|
|
@@ -30,11 +31,14 @@ function InputGroup(t0) {
|
|
|
30
31
|
}
|
|
31
32
|
let t2;
|
|
32
33
|
if ($[5] !== props || $[6] !== t1) {
|
|
33
|
-
t2 = /* @__PURE__ */ _jsx(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
t2 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
35
|
+
kind: "field",
|
|
36
|
+
children: /* @__PURE__ */ _jsx("div", {
|
|
37
|
+
"data-slot": "input-group",
|
|
38
|
+
role: "group",
|
|
39
|
+
className: t1,
|
|
40
|
+
...props
|
|
41
|
+
})
|
|
38
42
|
});
|
|
39
43
|
$[5] = props;
|
|
40
44
|
$[6] = t1;
|
package/dist/components/input.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
3
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
3
4
|
import { cn } from "../lib/utils.js";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
function Input({ className, type, ...props }) {
|
|
6
|
-
return /* @__PURE__ */ _jsx(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
return /* @__PURE__ */ _jsx(MotionSlot, {
|
|
8
|
+
kind: "field",
|
|
9
|
+
children: /* @__PURE__ */ _jsx(InputPrimitive, {
|
|
10
|
+
type,
|
|
11
|
+
"data-slot": "input",
|
|
12
|
+
className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
13
|
+
...props
|
|
14
|
+
})
|
|
11
15
|
});
|
|
12
16
|
}
|
|
13
17
|
export { Input };
|
package/dist/components/label.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Label as LabelPrimitive } from "radix-ui";
|
|
5
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
function Label(t0) {
|
|
@@ -27,10 +28,13 @@ function Label(t0) {
|
|
|
27
28
|
}
|
|
28
29
|
let t2;
|
|
29
30
|
if ($[5] !== props || $[6] !== t1) {
|
|
30
|
-
t2 = /* @__PURE__ */ _jsx(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
t2 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
32
|
+
kind: "field",
|
|
33
|
+
children: /* @__PURE__ */ _jsx(LabelPrimitive.Root, {
|
|
34
|
+
"data-slot": "label",
|
|
35
|
+
className: t1,
|
|
36
|
+
...props
|
|
37
|
+
})
|
|
34
38
|
});
|
|
35
39
|
$[5] = props;
|
|
36
40
|
$[6] = t1;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** Selects the configured routing adapter while keeping a native anchor fallback. */
|
|
2
1
|
import type { ComponentType } from "react";
|
|
3
2
|
import { type BeezLinkProps } from "../providers/beez-ui-provider.js";
|
|
4
3
|
/** Shares native link props and explicit per-link navigation overrides. */
|
package/dist/components/link.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/** Selects the configured routing adapter while keeping a native anchor fallback. */
|
|
4
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
3
5
|
import { useBeezUIComponents } from "../providers/beez-ui-provider.js";
|
|
4
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
7
|
/** Uses the provider's adapter and excludes framework hints from native DOM attributes. */
|
|
6
8
|
export function Link(t0) {
|
|
7
|
-
const $ = _c(
|
|
9
|
+
const $ = _c(11);
|
|
8
10
|
let component;
|
|
9
11
|
let prefetch;
|
|
10
12
|
let props;
|
|
@@ -21,29 +23,35 @@ export function Link(t0) {
|
|
|
21
23
|
}
|
|
22
24
|
const adapters = useBeezUIComponents();
|
|
23
25
|
const Component = component ?? adapters.Link;
|
|
24
|
-
if (!Component || Component === "a") {
|
|
25
|
-
let t1;
|
|
26
|
-
if ($[4] !== props) {
|
|
27
|
-
t1 = /* @__PURE__ */ _jsx("a", { ...props });
|
|
28
|
-
$[4] = props;
|
|
29
|
-
$[5] = t1;
|
|
30
|
-
} else {
|
|
31
|
-
t1 = $[5];
|
|
32
|
-
}
|
|
33
|
-
return t1;
|
|
34
|
-
}
|
|
35
26
|
let t1;
|
|
36
|
-
if ($[
|
|
37
|
-
t1 = /* @__PURE__ */ _jsx(
|
|
27
|
+
if ($[4] !== Component || $[5] !== prefetch || $[6] !== props) {
|
|
28
|
+
t1 = !Component || Component === "a" ? /* @__PURE__ */ _jsx("a", {
|
|
29
|
+
"data-slot": "link",
|
|
30
|
+
...props
|
|
31
|
+
}) : /* @__PURE__ */ _jsx(Component, {
|
|
32
|
+
"data-slot": "link",
|
|
38
33
|
...props,
|
|
39
34
|
prefetch
|
|
40
35
|
});
|
|
41
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
36
|
+
$[4] = Component;
|
|
37
|
+
$[5] = prefetch;
|
|
38
|
+
$[6] = props;
|
|
39
|
+
$[7] = t1;
|
|
40
|
+
} else {
|
|
41
|
+
t1 = $[7];
|
|
42
|
+
}
|
|
43
|
+
const link = t1;
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[8] !== link || $[9] !== props) {
|
|
46
|
+
t2 = "data-slot" in props ? link : /* @__PURE__ */ _jsx(MotionSlot, {
|
|
47
|
+
kind: "link",
|
|
48
|
+
children: link
|
|
49
|
+
});
|
|
50
|
+
$[8] = link;
|
|
51
|
+
$[9] = props;
|
|
52
|
+
$[10] = t2;
|
|
45
53
|
} else {
|
|
46
|
-
|
|
54
|
+
t2 = $[10];
|
|
47
55
|
}
|
|
48
|
-
return
|
|
56
|
+
return t2;
|
|
49
57
|
}
|