beez-ui 3.0.1 → 4.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 +26 -0
- package/README.md +45 -47
- package/dist/components/account-menu.js +1 -1
- package/dist/components/alert.js +3 -7
- package/dist/components/animated-collapse.js +51 -38
- package/dist/components/animated-list-item.js +33 -34
- package/dist/components/animated-theme-toggler.d.ts +5 -1
- package/dist/components/animated-theme-toggler.js +75 -120
- package/dist/components/badge.js +7 -11
- package/dist/components/card.js +13 -16
- package/dist/components/dialog-surface.js +8 -21
- package/dist/components/filter-query-bar.js +7 -11
- package/dist/components/input-group.js +5 -9
- package/dist/components/input.js +8 -12
- package/dist/components/label.js +4 -8
- package/dist/components/link.d.ts +1 -0
- package/dist/components/link.js +2 -16
- package/dist/components/presence-swap.d.ts +1 -1
- package/dist/components/presence-swap.js +44 -32
- package/dist/components/primitives/avatar.js +6 -9
- package/dist/components/primitives/dropdown-menu.d.ts +2 -2
- package/dist/components/primitives/dropdown-menu.js +8 -5
- package/dist/components/primitives/select.d.ts +2 -1
- package/dist/components/primitives/select.js +104 -83
- package/dist/components/reaction-button.d.ts +5 -6
- package/dist/components/reaction-button.js +139 -75
- package/dist/components/rich-link-editor.js +1 -1
- package/dist/components/separator.js +5 -9
- package/dist/components/sheet.js +8 -11
- package/dist/components/sidebar.d.ts +6 -6
- package/dist/components/sidebar.js +221 -184
- package/dist/components/svgs/whatsappIcon.js +10 -14
- package/dist/components/table.js +4 -8
- package/dist/components/textarea.js +7 -11
- package/dist/components/themed-toaster.js +28 -62
- package/dist/constants/dropdown-menu.d.ts +6 -1
- package/dist/constants/dropdown-menu.js +33 -1
- package/dist/constants/popover.js +2 -8
- package/dist/constants/select.d.ts +3 -1
- package/dist/constants/select.js +30 -1
- package/dist/motion/arc-tokens.d.ts +6 -0
- package/dist/motion/arc-tokens.js +6 -0
- package/dist/motion/glide-indicator.d.ts +6 -21
- package/dist/motion/glide-indicator.js +8 -17
- package/dist/motion/motion-slot.d.ts +6 -3
- package/dist/motion/motion-slot.js +100 -411
- package/dist/motion/presence.d.ts +8 -0
- package/dist/motion/presence.js +11 -1
- package/dist/motion/surface-keyframes.d.ts +2 -2
- package/dist/motion/surface-keyframes.js +40 -141
- package/dist/motion/tokens.d.ts +10 -114
- package/dist/motion/tokens.js +11 -116
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/motion/shared-layout-bg.d.ts +0 -16
- package/dist/motion/shared-layout-bg.js +0 -181
|
@@ -5,8 +5,13 @@ import { useState } from "react";
|
|
|
5
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
|
-
import {
|
|
8
|
+
import { ARC_BLUR } from "../motion/arc-tokens.js";
|
|
9
|
+
import { MOTION_EASE, MOTION_EASE_STANDARD, MOTION_TIMING } from "../motion/tokens.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
/** Arc's swap: new content rises a third of a line out of a soft blur; old content leaves upward. */
|
|
12
|
+
const SWAP_RISE = "0.3em";
|
|
13
|
+
const SWAP_ENTER_BLUR = `blur(${ARC_BLUR.soft}px)`;
|
|
14
|
+
const SWAP_EXIT_BLUR = `blur(${ARC_BLUR.subtle}px)`;
|
|
10
15
|
const PRESENCE_SWAP_ELEMENTS = {
|
|
11
16
|
div: motion.div,
|
|
12
17
|
span: motion.span
|
|
@@ -18,68 +23,75 @@ const PRESENCE_SWAP_ELEMENTS = {
|
|
|
18
23
|
* @returns The animated state.
|
|
19
24
|
*/
|
|
20
25
|
function PresenceSwapItem(t0) {
|
|
21
|
-
const $ = _c(
|
|
26
|
+
const $ = _c(16);
|
|
22
27
|
const { as, className, children } = t0;
|
|
23
28
|
const MotionElement = PRESENCE_SWAP_ELEMENTS[as];
|
|
24
29
|
const isPresent = useIsPresent();
|
|
25
30
|
const [isMountedExiting] = useState(!isPresent);
|
|
26
31
|
const shouldReduceMotion = usePrefersReducedMotion();
|
|
27
|
-
const
|
|
32
|
+
const rise = shouldReduceMotion ? 0 : SWAP_RISE;
|
|
33
|
+
const enterBlur = shouldReduceMotion ? "blur(0px)" : SWAP_ENTER_BLUR;
|
|
34
|
+
const exitBlur = shouldReduceMotion ? "blur(0px)" : SWAP_EXIT_BLUR;
|
|
28
35
|
if (isMountedExiting) {
|
|
29
36
|
return null;
|
|
30
37
|
}
|
|
31
38
|
const t1 = isPresent ? undefined : true;
|
|
32
39
|
const t2 = !isPresent || undefined;
|
|
33
40
|
let t3;
|
|
34
|
-
if ($[0] !==
|
|
41
|
+
if ($[0] !== enterBlur || $[1] !== rise) {
|
|
35
42
|
t3 = {
|
|
36
43
|
opacity: 0,
|
|
37
|
-
y:
|
|
44
|
+
y: rise,
|
|
45
|
+
filter: enterBlur
|
|
38
46
|
};
|
|
39
|
-
$[0] =
|
|
40
|
-
$[1] =
|
|
47
|
+
$[0] = enterBlur;
|
|
48
|
+
$[1] = rise;
|
|
49
|
+
$[2] = t3;
|
|
41
50
|
} else {
|
|
42
|
-
t3 = $[
|
|
51
|
+
t3 = $[2];
|
|
43
52
|
}
|
|
44
53
|
let t4;
|
|
45
|
-
if ($[
|
|
54
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
46
55
|
t4 = {
|
|
47
56
|
opacity: 1,
|
|
48
57
|
y: 0,
|
|
58
|
+
filter: "blur(0px)",
|
|
49
59
|
transition: {
|
|
50
60
|
duration: MOTION_TIMING.enter,
|
|
51
61
|
ease: MOTION_EASE
|
|
52
62
|
}
|
|
53
63
|
};
|
|
54
|
-
$[
|
|
64
|
+
$[3] = t4;
|
|
55
65
|
} else {
|
|
56
|
-
t4 = $[
|
|
66
|
+
t4 = $[3];
|
|
57
67
|
}
|
|
58
|
-
const t5 =
|
|
68
|
+
const t5 = shouldReduceMotion ? 0 : `-${SWAP_RISE}`;
|
|
59
69
|
let t6;
|
|
60
|
-
if ($[
|
|
70
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
61
71
|
t6 = {
|
|
62
|
-
duration: MOTION_TIMING.
|
|
63
|
-
ease:
|
|
72
|
+
duration: MOTION_TIMING.fast,
|
|
73
|
+
ease: MOTION_EASE_STANDARD
|
|
64
74
|
};
|
|
65
|
-
$[
|
|
75
|
+
$[4] = t6;
|
|
66
76
|
} else {
|
|
67
|
-
t6 = $[
|
|
77
|
+
t6 = $[4];
|
|
68
78
|
}
|
|
69
79
|
let t7;
|
|
70
|
-
if ($[
|
|
80
|
+
if ($[5] !== exitBlur || $[6] !== t5) {
|
|
71
81
|
t7 = {
|
|
72
82
|
opacity: 0,
|
|
73
83
|
y: t5,
|
|
84
|
+
filter: exitBlur,
|
|
74
85
|
transition: t6
|
|
75
86
|
};
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
87
|
+
$[5] = exitBlur;
|
|
88
|
+
$[6] = t5;
|
|
89
|
+
$[7] = t7;
|
|
78
90
|
} else {
|
|
79
|
-
t7 = $[
|
|
91
|
+
t7 = $[7];
|
|
80
92
|
}
|
|
81
93
|
let t8;
|
|
82
|
-
if ($[
|
|
94
|
+
if ($[8] !== MotionElement || $[9] !== children || $[10] !== className || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t7) {
|
|
83
95
|
t8 = /* @__PURE__ */ _jsx(MotionElement, {
|
|
84
96
|
"data-slot": "presence-swap",
|
|
85
97
|
"aria-hidden": t1,
|
|
@@ -90,16 +102,16 @@ function PresenceSwapItem(t0) {
|
|
|
90
102
|
exit: t7,
|
|
91
103
|
children
|
|
92
104
|
});
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
105
|
+
$[8] = MotionElement;
|
|
106
|
+
$[9] = children;
|
|
107
|
+
$[10] = className;
|
|
108
|
+
$[11] = t1;
|
|
109
|
+
$[12] = t2;
|
|
110
|
+
$[13] = t3;
|
|
111
|
+
$[14] = t7;
|
|
112
|
+
$[15] = t8;
|
|
101
113
|
} else {
|
|
102
|
-
t8 = $[
|
|
114
|
+
t8 = $[15];
|
|
103
115
|
}
|
|
104
116
|
return t8;
|
|
105
117
|
}
|
|
@@ -145,7 +157,7 @@ function usePresenceSwapKey(presenceKey) {
|
|
|
145
157
|
return `${current.generation}:${presenceKey}`;
|
|
146
158
|
}
|
|
147
159
|
/**
|
|
148
|
-
* Swaps keyed content with a short
|
|
160
|
+
* Swaps keyed content with Arc's swap (a short rise out of a blur); the first render is not animated.
|
|
149
161
|
* @param props - Key identifying the current state and its content.
|
|
150
162
|
* @returns The animated content.
|
|
151
163
|
*/
|
|
@@ -89,15 +89,12 @@ function AvatarRoot(t0) {
|
|
|
89
89
|
}
|
|
90
90
|
let t5;
|
|
91
91
|
if ($[13] !== children || $[14] !== props || $[15] !== size || $[16] !== t2 || $[17] !== t4) {
|
|
92
|
-
t5 = /* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
...props,
|
|
99
|
-
children: [children, t4]
|
|
100
|
-
})
|
|
92
|
+
t5 = /* @__PURE__ */ _jsxs(AvatarPrimitive.Root, {
|
|
93
|
+
"data-slot": "avatar",
|
|
94
|
+
"data-size": size,
|
|
95
|
+
className: t2,
|
|
96
|
+
...props,
|
|
97
|
+
children: [children, t4]
|
|
101
98
|
});
|
|
102
99
|
$[13] = children;
|
|
103
100
|
$[14] = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal primitive of Arc's Dropdown menu (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): Arc's raised
|
|
3
|
-
* panel, item rows, danger tone, separators, placement defaults and
|
|
4
|
-
*
|
|
3
|
+
* panel, item rows, danger tone, separators, placement defaults and Arc's motion: the panel grows from the trigger
|
|
4
|
+
* edge, items rise in staggered, and the highlight glides for the pointer and jumps for the keyboard. Internal: the
|
|
5
5
|
* Radix composition behind the public closed `DropdownMenu` and beez-ui's composite components; the package does not
|
|
6
6
|
* export it.
|
|
7
7
|
*/
|
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
/**
|
|
4
4
|
* Internal primitive of Arc's Dropdown menu (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): Arc's raised
|
|
5
|
-
* panel, item rows, danger tone, separators, placement defaults and
|
|
6
|
-
*
|
|
5
|
+
* panel, item rows, danger tone, separators, placement defaults and Arc's motion: the panel grows from the trigger
|
|
6
|
+
* edge, items rise in staggered, and the highlight glides for the pointer and jumps for the keyboard. Internal: the
|
|
7
7
|
* Radix composition behind the public closed `DropdownMenu` and beez-ui's composite components; the package does not
|
|
8
8
|
* export it.
|
|
9
9
|
*/
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
12
|
-
import { DROPDOWN_MENU_COLLISION_PADDING_PX, DROPDOWN_MENU_SIDE_OFFSET_PX } from "../../constants/dropdown-menu.js";
|
|
12
|
+
import { DROPDOWN_MENU_COLLISION_PADDING_PX, DROPDOWN_MENU_MOTION, DROPDOWN_MENU_SIDE_OFFSET_PX } from "../../constants/dropdown-menu.js";
|
|
13
13
|
import { GlideSlot } from "../../motion/glide-slot.js";
|
|
14
|
+
import { ArcFloatingSlot } from "../../motion/arc-floating-slot.js";
|
|
14
15
|
import { MotionSlot } from "../../motion/motion-slot.js";
|
|
15
16
|
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../../motion/presence.js";
|
|
16
17
|
import { cn } from "../../lib/utils.js";
|
|
17
18
|
import { CheckIcon } from "lucide-react";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
/** Arc's menu always enters and leaves the same way. */
|
|
21
|
+
const resolveDropdownMenuMotion = () => DROPDOWN_MENU_MOTION;
|
|
19
22
|
/**
|
|
20
23
|
* Arc's menu panel on its tokens. It also sets the direction its items rise in from (`--menu-item-offset-*`, toward
|
|
21
24
|
* the trigger).
|
|
@@ -162,8 +165,8 @@ function DropdownMenuContent(t0) {
|
|
|
162
165
|
}
|
|
163
166
|
let t8;
|
|
164
167
|
if ($[12] !== align || $[13] !== collisionPadding || $[14] !== loop || $[15] !== props || $[16] !== sideOffset || $[17] !== stopClickAtPanel || $[18] !== t7) {
|
|
165
|
-
t8 = /* @__PURE__ */ _jsx(
|
|
166
|
-
|
|
168
|
+
t8 = /* @__PURE__ */ _jsx(ArcFloatingSlot, {
|
|
169
|
+
motion: resolveDropdownMenuMotion,
|
|
167
170
|
children: /* @__PURE__ */ _jsx(GlideSlot, {
|
|
168
171
|
preset: "menu",
|
|
169
172
|
children: /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Content, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal primitive of Arc's Select (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): Arc's trigger, whose
|
|
3
3
|
* hover, press and open states answer in color only so the anchored list never shifts, and its raised list with
|
|
4
|
-
* option rows and an end check, on Arc's tokens
|
|
4
|
+
* option rows and an end check, on Arc's tokens and Arc's motion: the list grows from the trigger edge, the check
|
|
5
|
+
* of the chosen option sharpens in, and the chevron turns on the CSS spring.
|
|
5
6
|
* Internal: the Radix composition behind the public closed `Select`; the package does not export it.
|
|
6
7
|
*/
|
|
7
8
|
import * as React from "react";
|
|
@@ -3,19 +3,23 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
3
3
|
/**
|
|
4
4
|
* Internal primitive of Arc's Select (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): Arc's trigger, whose
|
|
5
5
|
* hover, press and open states answer in color only so the anchored list never shifts, and its raised list with
|
|
6
|
-
* option rows and an end check, on Arc's tokens
|
|
6
|
+
* option rows and an end check, on Arc's tokens and Arc's motion: the list grows from the trigger edge, the check
|
|
7
|
+
* of the chosen option sharpens in, and the chevron turns on the CSS spring.
|
|
7
8
|
* Internal: the Radix composition behind the public closed `Select`; the package does not export it.
|
|
8
9
|
*/
|
|
9
10
|
import * as React from "react";
|
|
10
11
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
11
|
-
import { SELECT_COLLISION_PADDING_PX } from "../../constants/select.js";
|
|
12
|
-
import {
|
|
12
|
+
import { SELECT_COLLISION_PADDING_PX, SELECT_MOTION } from "../../constants/select.js";
|
|
13
|
+
import { ArcFloatingSlot } from "../../motion/arc-floating-slot.js";
|
|
13
14
|
import { MotionSlot } from "../../motion/motion-slot.js";
|
|
15
|
+
import { MotionOpenProvider, useMotionOpen, useMotionOpenState } from "../../motion/presence.js";
|
|
14
16
|
import { cn } from "../../lib/utils.js";
|
|
15
17
|
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
16
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
/** Arc's option list always enters and leaves the same way. */
|
|
20
|
+
const resolveSelectMotion = () => SELECT_MOTION;
|
|
17
21
|
function Select(t0) {
|
|
18
|
-
const $ = _c(
|
|
22
|
+
const $ = _c(9);
|
|
19
23
|
let props;
|
|
20
24
|
if ($[0] !== t0) {
|
|
21
25
|
({...props} = t0);
|
|
@@ -24,18 +28,36 @@ function Select(t0) {
|
|
|
24
28
|
} else {
|
|
25
29
|
props = $[1];
|
|
26
30
|
}
|
|
31
|
+
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
27
32
|
let t1;
|
|
28
|
-
if ($[2] !== props) {
|
|
33
|
+
if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
|
|
29
34
|
t1 = /* @__PURE__ */ _jsx(SelectPrimitive.Root, {
|
|
30
35
|
"data-slot": "select",
|
|
31
|
-
...props
|
|
36
|
+
...props,
|
|
37
|
+
open: motionOpen,
|
|
38
|
+
onOpenChange: setMotionOpen
|
|
32
39
|
});
|
|
33
|
-
$[2] =
|
|
34
|
-
$[3] =
|
|
40
|
+
$[2] = motionOpen;
|
|
41
|
+
$[3] = props;
|
|
42
|
+
$[4] = setMotionOpen;
|
|
43
|
+
$[5] = t1;
|
|
35
44
|
} else {
|
|
36
|
-
t1 = $[
|
|
45
|
+
t1 = $[5];
|
|
37
46
|
}
|
|
38
|
-
|
|
47
|
+
let t2;
|
|
48
|
+
if ($[6] !== motionOpen || $[7] !== t1) {
|
|
49
|
+
t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
50
|
+
scope: "select",
|
|
51
|
+
open: motionOpen,
|
|
52
|
+
children: t1
|
|
53
|
+
});
|
|
54
|
+
$[6] = motionOpen;
|
|
55
|
+
$[7] = t1;
|
|
56
|
+
$[8] = t2;
|
|
57
|
+
} else {
|
|
58
|
+
t2 = $[8];
|
|
59
|
+
}
|
|
60
|
+
return t2;
|
|
39
61
|
}
|
|
40
62
|
function SelectValue(t0) {
|
|
41
63
|
const $ = _c(4);
|
|
@@ -99,13 +121,10 @@ function SelectTrigger(t0) {
|
|
|
99
121
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
122
|
t3 = /* @__PURE__ */ _jsx(SelectPrimitive.Icon, {
|
|
101
123
|
asChild: true,
|
|
102
|
-
children: /* @__PURE__ */ _jsx(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
strokeWidth: 1.75,
|
|
107
|
-
className: "pointer-events-none size-4 text-text-muted"
|
|
108
|
-
})
|
|
124
|
+
children: /* @__PURE__ */ _jsx(ChevronDownIcon, {
|
|
125
|
+
"data-slot": "select-icon",
|
|
126
|
+
strokeWidth: 1.75,
|
|
127
|
+
className: "pointer-events-none size-4 text-text-muted transition-[rotate] duration-(--duration-spring) ease-(--ease-spring) motion-reduce:transition-none"
|
|
109
128
|
})
|
|
110
129
|
});
|
|
111
130
|
$[7] = t3;
|
|
@@ -114,15 +133,12 @@ function SelectTrigger(t0) {
|
|
|
114
133
|
}
|
|
115
134
|
let t4;
|
|
116
135
|
if ($[8] !== children || $[9] !== props || $[10] !== size || $[11] !== t2) {
|
|
117
|
-
t4 = /* @__PURE__ */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
...props,
|
|
124
|
-
children: [children, t3]
|
|
125
|
-
})
|
|
136
|
+
t4 = /* @__PURE__ */ _jsxs(SelectPrimitive.Trigger, {
|
|
137
|
+
"data-slot": "select-trigger",
|
|
138
|
+
"data-size": size,
|
|
139
|
+
className: t2,
|
|
140
|
+
...props,
|
|
141
|
+
children: [children, t3]
|
|
126
142
|
});
|
|
127
143
|
$[8] = children;
|
|
128
144
|
$[9] = props;
|
|
@@ -142,7 +158,7 @@ function SelectTrigger(t0) {
|
|
|
142
158
|
* @returns The styled primitive with its original interaction contract.
|
|
143
159
|
*/
|
|
144
160
|
function SelectContent(t0) {
|
|
145
|
-
const $ = _c(
|
|
161
|
+
const $ = _c(26);
|
|
146
162
|
let children;
|
|
147
163
|
let className;
|
|
148
164
|
let props;
|
|
@@ -169,78 +185,86 @@ function SelectContent(t0) {
|
|
|
169
185
|
const position = t1 === undefined ? "item-aligned" : t1;
|
|
170
186
|
const align = t2 === undefined ? "center" : t2;
|
|
171
187
|
const collisionPadding = t3 === undefined ? SELECT_COLLISION_PADDING_PX : t3;
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
188
|
+
const open = useMotionOpen("select");
|
|
189
|
+
const t4 = open ? "open" : "closed";
|
|
190
|
+
const t5 = position === "item-aligned";
|
|
191
|
+
const t6 = position === "popper" && "w-(--radix-select-trigger-width) max-w-[min(24rem,calc(100vw-20px))] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";
|
|
192
|
+
let t7;
|
|
193
|
+
if ($[7] !== className || $[8] !== t6) {
|
|
194
|
+
t7 = cn("relative z-50 max-h-[min(20rem,var(--radix-select-content-available-height))] min-w-48 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[calc(var(--radius-control)+2px)] border border-border bg-surface-raised p-1.5 text-foreground shadow-(--shadow-floating)", t6, className);
|
|
177
195
|
$[7] = className;
|
|
178
|
-
$[8] =
|
|
179
|
-
$[9] =
|
|
196
|
+
$[8] = t6;
|
|
197
|
+
$[9] = t7;
|
|
180
198
|
} else {
|
|
181
|
-
|
|
199
|
+
t7 = $[9];
|
|
182
200
|
}
|
|
183
|
-
let
|
|
201
|
+
let t8;
|
|
184
202
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
-
|
|
186
|
-
$[10] =
|
|
203
|
+
t8 = /* @__PURE__ */ _jsx(SelectScrollUpButton, {});
|
|
204
|
+
$[10] = t8;
|
|
187
205
|
} else {
|
|
188
|
-
|
|
206
|
+
t8 = $[10];
|
|
189
207
|
}
|
|
190
|
-
let
|
|
208
|
+
let t9;
|
|
191
209
|
if ($[11] !== children || $[12] !== position) {
|
|
192
|
-
|
|
210
|
+
t9 = /* @__PURE__ */ _jsx(SelectPrimitive.Viewport, {
|
|
193
211
|
"data-position": position,
|
|
194
212
|
className: "py-0.5 data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full",
|
|
195
213
|
children
|
|
196
214
|
});
|
|
197
215
|
$[11] = children;
|
|
198
216
|
$[12] = position;
|
|
199
|
-
$[13] =
|
|
217
|
+
$[13] = t9;
|
|
200
218
|
} else {
|
|
201
|
-
|
|
219
|
+
t9 = $[13];
|
|
202
220
|
}
|
|
203
|
-
let
|
|
221
|
+
let t10;
|
|
204
222
|
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
205
|
-
|
|
206
|
-
$[14] =
|
|
223
|
+
t10 = /* @__PURE__ */ _jsx(SelectScrollDownButton, {});
|
|
224
|
+
$[14] = t10;
|
|
207
225
|
} else {
|
|
208
|
-
|
|
226
|
+
t10 = $[14];
|
|
209
227
|
}
|
|
210
|
-
let
|
|
211
|
-
if ($[15] !== align || $[16] !== collisionPadding || $[17] !== position || $[18] !== props || $[19] !==
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
t8,
|
|
227
|
-
t9
|
|
228
|
-
]
|
|
229
|
-
})
|
|
230
|
-
})
|
|
231
|
-
}) });
|
|
228
|
+
let t11;
|
|
229
|
+
if ($[15] !== align || $[16] !== collisionPadding || $[17] !== position || $[18] !== props || $[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
|
|
230
|
+
t11 = /* @__PURE__ */ _jsxs(SelectPrimitive.Content, {
|
|
231
|
+
"data-slot": "select-content",
|
|
232
|
+
"data-align-trigger": t5,
|
|
233
|
+
className: t7,
|
|
234
|
+
position,
|
|
235
|
+
align,
|
|
236
|
+
collisionPadding,
|
|
237
|
+
...props,
|
|
238
|
+
children: [
|
|
239
|
+
t8,
|
|
240
|
+
t9,
|
|
241
|
+
t10
|
|
242
|
+
]
|
|
243
|
+
});
|
|
232
244
|
$[15] = align;
|
|
233
245
|
$[16] = collisionPadding;
|
|
234
246
|
$[17] = position;
|
|
235
247
|
$[18] = props;
|
|
236
|
-
$[19] =
|
|
237
|
-
$[20] =
|
|
238
|
-
$[21] =
|
|
239
|
-
$[22] =
|
|
248
|
+
$[19] = t5;
|
|
249
|
+
$[20] = t7;
|
|
250
|
+
$[21] = t9;
|
|
251
|
+
$[22] = t11;
|
|
240
252
|
} else {
|
|
241
|
-
|
|
253
|
+
t11 = $[22];
|
|
242
254
|
}
|
|
243
|
-
|
|
255
|
+
let t12;
|
|
256
|
+
if ($[23] !== t11 || $[24] !== t4) {
|
|
257
|
+
t12 = /* @__PURE__ */ _jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ _jsx(ArcFloatingSlot, {
|
|
258
|
+
motion: resolveSelectMotion,
|
|
259
|
+
children: t11
|
|
260
|
+
}, t4) });
|
|
261
|
+
$[23] = t11;
|
|
262
|
+
$[24] = t4;
|
|
263
|
+
$[25] = t12;
|
|
264
|
+
} else {
|
|
265
|
+
t12 = $[25];
|
|
266
|
+
}
|
|
267
|
+
return t12;
|
|
244
268
|
}
|
|
245
269
|
/**
|
|
246
270
|
* Renders Arc's option row: 36px tall, a muted fill when highlighted and the check of the chosen option at the end,
|
|
@@ -298,14 +322,11 @@ function SelectItem(t0) {
|
|
|
298
322
|
}
|
|
299
323
|
let t4;
|
|
300
324
|
if ($[9] !== props || $[10] !== t1 || $[11] !== t3) {
|
|
301
|
-
t4 = /* @__PURE__ */
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
...props,
|
|
307
|
-
children: [t2, t3]
|
|
308
|
-
})
|
|
325
|
+
t4 = /* @__PURE__ */ _jsxs(SelectPrimitive.Item, {
|
|
326
|
+
"data-slot": "select-item",
|
|
327
|
+
className: t1,
|
|
328
|
+
...props,
|
|
329
|
+
children: [t2, t3]
|
|
309
330
|
});
|
|
310
331
|
$[9] = props;
|
|
311
332
|
$[10] = t1;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Toggle for likes and similar reactions: the icon
|
|
3
|
-
* rolls in the direction of the change. The (optimistic) reaction state is owned by the caller.
|
|
2
|
+
* Toggle for likes and similar reactions: the icon gets Arc's kick (https://uiarc.dev, MIT License, see
|
|
3
|
+
* THIRD_PARTY_NOTICES.md) when the viewer reacts and the counter rolls in the direction of the change. The (optimistic) reaction state is owned by the caller.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type ComponentType, type MouseEvent, type SVGProps } from "react";
|
|
6
6
|
export interface ReactionButtonProps {
|
|
7
7
|
/** Accessible name, including the current count (for example "Me gusta 3"). */
|
|
8
8
|
ariaLabel: string;
|
|
@@ -22,9 +22,8 @@ export interface ReactionButtonProps {
|
|
|
22
22
|
className?: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Renders an outline toggle button exposing its state with `aria-pressed`.
|
|
26
|
-
*
|
|
27
|
-
* only a change to active does, and not at all with reduced motion.
|
|
25
|
+
* Renders an outline toggle button exposing its state with `aria-pressed`. Server-rendered and already-active
|
|
26
|
+
* reactions never kick on load; only a change to active does, and not at all with reduced motion.
|
|
28
27
|
* @param props - Accessible name, state, count, click handler and optional icon.
|
|
29
28
|
* @returns The reaction button.
|
|
30
29
|
*/
|