beez-ui 0.5.3 → 0.5.5
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 +8 -0
- package/README.md +66 -3
- 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/filter-query-bar.js +61 -48
- 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 };
|
|
@@ -317,7 +317,7 @@ function renderHighlightedQuery(value, ranges) {
|
|
|
317
317
|
* La navegación es virtual: el foco real nunca abandona el input.
|
|
318
318
|
*/
|
|
319
319
|
export function FilterQueryBar(t0) {
|
|
320
|
-
const $ = _c(
|
|
320
|
+
const $ = _c(98);
|
|
321
321
|
const { configs, value, onValueChange, placeholder: t1, ariaLabel: t2, className, onFocusChange, trailingAction } = t0;
|
|
322
322
|
const placeholder = t1 === undefined ? DEFAULT_PLACEHOLDER : t1;
|
|
323
323
|
const ariaLabel = t2 === undefined ? DEFAULT_ARIA_LABEL : t2;
|
|
@@ -754,10 +754,21 @@ export function FilterQueryBar(t0) {
|
|
|
754
754
|
} else {
|
|
755
755
|
t33 = $[76];
|
|
756
756
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
757
|
+
let t34;
|
|
758
|
+
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
|
759
|
+
t34 = (event_2) => {
|
|
760
|
+
if (event_2.target === inputRef.current) {
|
|
761
|
+
event_2.preventDefault();
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
$[77] = t34;
|
|
765
|
+
} else {
|
|
766
|
+
t34 = $[77];
|
|
767
|
+
}
|
|
768
|
+
const t35 = suggestions.some(_temp3) ? VALUE_GROUP_LABEL : KEY_GROUP_LABEL;
|
|
769
|
+
let t36;
|
|
770
|
+
if ($[78] !== activeIndex || $[79] !== applySuggestion || $[80] !== instanceId || $[81] !== suggestions) {
|
|
771
|
+
t36 = suggestions.map((suggestion_1, index) => {
|
|
761
772
|
const SuggestionIcon = suggestion_1.icon;
|
|
762
773
|
const showSeparator = index > 0 && suggestions[index - 1].group !== suggestion_1.group;
|
|
763
774
|
return /* @__PURE__ */ _jsxs(React.Fragment, { children: [showSeparator ? /* @__PURE__ */ _jsx("li", {
|
|
@@ -768,8 +779,9 @@ export function FilterQueryBar(t0) {
|
|
|
768
779
|
"aria-selected": index === activeIndex,
|
|
769
780
|
className: cn("flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm", index === activeIndex ? "bg-accent text-accent-foreground" : "text-foreground"),
|
|
770
781
|
id: `${instanceId}-${suggestion_1.id}`,
|
|
771
|
-
|
|
772
|
-
|
|
782
|
+
onPointerMove: () => setActiveIndex(index),
|
|
783
|
+
onMouseDown: (event_4) => {
|
|
784
|
+
event_4.preventDefault();
|
|
773
785
|
applySuggestion(suggestion_1);
|
|
774
786
|
},
|
|
775
787
|
role: "option",
|
|
@@ -782,85 +794,86 @@ export function FilterQueryBar(t0) {
|
|
|
782
794
|
})]
|
|
783
795
|
})] }, suggestion_1.id);
|
|
784
796
|
});
|
|
785
|
-
$[
|
|
786
|
-
$[
|
|
787
|
-
$[
|
|
788
|
-
$[
|
|
789
|
-
$[
|
|
797
|
+
$[78] = activeIndex;
|
|
798
|
+
$[79] = applySuggestion;
|
|
799
|
+
$[80] = instanceId;
|
|
800
|
+
$[81] = suggestions;
|
|
801
|
+
$[82] = t36;
|
|
790
802
|
} else {
|
|
791
|
-
|
|
803
|
+
t36 = $[82];
|
|
792
804
|
}
|
|
793
|
-
let
|
|
794
|
-
if ($[
|
|
795
|
-
|
|
805
|
+
let t37;
|
|
806
|
+
if ($[83] !== listboxId || $[84] !== t35 || $[85] !== t36) {
|
|
807
|
+
t37 = /* @__PURE__ */ _jsx(PopoverContent, {
|
|
796
808
|
align: "start",
|
|
797
809
|
className: "w-[250px] max-h-[280px] gap-0 overflow-y-auto p-1",
|
|
798
810
|
onCloseAutoFocus: _temp,
|
|
811
|
+
onInteractOutside: t34,
|
|
799
812
|
onOpenAutoFocus: _temp2,
|
|
800
813
|
children: /* @__PURE__ */ _jsx("ul", {
|
|
801
|
-
"aria-label":
|
|
814
|
+
"aria-label": t35,
|
|
802
815
|
className: "grid gap-0.5",
|
|
803
816
|
id: listboxId,
|
|
804
817
|
role: "listbox",
|
|
805
|
-
children:
|
|
818
|
+
children: t36
|
|
806
819
|
})
|
|
807
820
|
});
|
|
808
|
-
$[
|
|
809
|
-
$[83] = t34;
|
|
821
|
+
$[83] = listboxId;
|
|
810
822
|
$[84] = t35;
|
|
811
823
|
$[85] = t36;
|
|
824
|
+
$[86] = t37;
|
|
812
825
|
} else {
|
|
813
|
-
|
|
826
|
+
t37 = $[86];
|
|
814
827
|
}
|
|
815
|
-
let
|
|
816
|
-
if ($[
|
|
817
|
-
|
|
828
|
+
let t38;
|
|
829
|
+
if ($[87] !== isPopoverOpen || $[88] !== t33 || $[89] !== t37) {
|
|
830
|
+
t38 = /* @__PURE__ */ _jsxs(Popover, {
|
|
818
831
|
onOpenChange: setIsOpen,
|
|
819
832
|
open: isPopoverOpen,
|
|
820
|
-
children: [t33,
|
|
833
|
+
children: [t33, t37]
|
|
821
834
|
});
|
|
822
|
-
$[
|
|
823
|
-
$[
|
|
824
|
-
$[88] = t36;
|
|
835
|
+
$[87] = isPopoverOpen;
|
|
836
|
+
$[88] = t33;
|
|
825
837
|
$[89] = t37;
|
|
838
|
+
$[90] = t38;
|
|
826
839
|
} else {
|
|
827
|
-
|
|
840
|
+
t38 = $[90];
|
|
828
841
|
}
|
|
829
|
-
const
|
|
830
|
-
const
|
|
831
|
-
let
|
|
832
|
-
if ($[
|
|
833
|
-
|
|
842
|
+
const t39 = isPopoverOpen ? `${suggestions.length} sugerencias disponibles` : "";
|
|
843
|
+
const t40 = invalidTokenCount > 0 ? ` ${invalidTokenCount} filtros no aplicados` : "";
|
|
844
|
+
let t41;
|
|
845
|
+
if ($[91] !== t39 || $[92] !== t40) {
|
|
846
|
+
t41 = /* @__PURE__ */ _jsxs("span", {
|
|
834
847
|
"aria-live": "polite",
|
|
835
848
|
className: "sr-only",
|
|
836
|
-
children: [
|
|
849
|
+
children: [t39, t40]
|
|
837
850
|
});
|
|
838
|
-
$[90] = t38;
|
|
839
851
|
$[91] = t39;
|
|
840
852
|
$[92] = t40;
|
|
853
|
+
$[93] = t41;
|
|
841
854
|
} else {
|
|
842
|
-
|
|
855
|
+
t41 = $[93];
|
|
843
856
|
}
|
|
844
|
-
let
|
|
845
|
-
if ($[
|
|
846
|
-
|
|
857
|
+
let t42;
|
|
858
|
+
if ($[94] !== t17 || $[95] !== t38 || $[96] !== t41) {
|
|
859
|
+
t42 = /* @__PURE__ */ _jsxs("div", {
|
|
847
860
|
className: t17,
|
|
848
|
-
children: [
|
|
861
|
+
children: [t38, t41]
|
|
849
862
|
});
|
|
850
|
-
$[
|
|
851
|
-
$[
|
|
852
|
-
$[95] = t40;
|
|
863
|
+
$[94] = t17;
|
|
864
|
+
$[95] = t38;
|
|
853
865
|
$[96] = t41;
|
|
866
|
+
$[97] = t42;
|
|
854
867
|
} else {
|
|
855
|
-
|
|
868
|
+
t42 = $[97];
|
|
856
869
|
}
|
|
857
|
-
return
|
|
870
|
+
return t42;
|
|
858
871
|
}
|
|
859
872
|
function _temp3(suggestion_0) {
|
|
860
873
|
return suggestion_0.group === "value";
|
|
861
874
|
}
|
|
862
|
-
function _temp2(
|
|
863
|
-
return
|
|
875
|
+
function _temp2(event_3) {
|
|
876
|
+
return event_3.preventDefault();
|
|
864
877
|
}
|
|
865
878
|
function _temp(event_1) {
|
|
866
879
|
return event_1.preventDefault();
|
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
|
}
|