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,51 +1,117 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Arc's Hover Card (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a read-only preview of a person or
|
|
5
|
+
* link that opens after half a second of hover or on keyboard focus, grows from the trigger edge on a smooth spring
|
|
6
|
+
* and closes fast on leave. While a card is open, and briefly after it closes, moving to another trigger opens its
|
|
7
|
+
* card almost at once and only fades. It keeps the Radix composition and adds Arc's `HoverCardProfile` preset.
|
|
8
|
+
*/
|
|
3
9
|
import * as React from "react";
|
|
4
10
|
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
|
5
|
-
import {
|
|
11
|
+
import { motion } from "motion/react";
|
|
12
|
+
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
13
|
+
import { ArcFloatingSlot } from "../motion/arc-floating-slot.js";
|
|
14
|
+
import { ARC_DURATION, ARC_EASE } from "../motion/arc-tokens.js";
|
|
15
|
+
import { createOverlayWarmth, useOpenedWhileWarm } from "../motion/overlay-warmth.js";
|
|
6
16
|
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
|
|
7
17
|
import { cn } from "../lib/utils.js";
|
|
8
|
-
import {
|
|
18
|
+
import { HOVER_CARD_CLOSE_DELAY_MS, HOVER_CARD_COLLISION_PADDING_PX, HOVER_CARD_INSTANT_MOTION, HOVER_CARD_MOTION, HOVER_CARD_OPEN_DELAY_MS, HOVER_CARD_PROFILE_INITIALS_LENGTH, HOVER_CARD_PROFILE_PORTRAIT_SIZE_PX, HOVER_CARD_PROFILE_ROW_ORDER, HOVER_CARD_PROFILE_SETTLE_DELAY_S, HOVER_CARD_PROFILE_SETTLE_DISTANCE_PX, HOVER_CARD_PROFILE_STAGGER_S, HOVER_CARD_SIDE_OFFSET_PX, HOVER_CARD_SKIP_WINDOW_MS, HOVER_CARD_WARM_OPEN_DELAY_MS } from "../constants/hover-card.js";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
/** Every hover card on the page shares one skip window. */
|
|
21
|
+
const hoverCardWarmth = createOverlayWarmth(HOVER_CARD_SKIP_WINDOW_MS);
|
|
22
|
+
/** Whether the page was already warm when the surrounding layer opened, so its entrance only fades. */
|
|
23
|
+
const HoverCardOpenedWhileWarmContext = React.createContext(false);
|
|
24
|
+
/**
|
|
25
|
+
* Owns the open state and timing of one hover card.
|
|
26
|
+
* @param props - Radix root properties. `openDelay` defaults to Arc's 500ms and `closeDelay` to 140ms; within the
|
|
27
|
+
* skip window the card waits at most 80ms.
|
|
28
|
+
* @returns The hover card root.
|
|
29
|
+
*/
|
|
9
30
|
function HoverCard(t0) {
|
|
10
|
-
const $ = _c(
|
|
31
|
+
const $ = _c(19);
|
|
11
32
|
let props;
|
|
33
|
+
let t1;
|
|
34
|
+
let t2;
|
|
12
35
|
if ($[0] !== t0) {
|
|
13
|
-
({...props} = t0);
|
|
36
|
+
({openDelay: t1, closeDelay: t2, ...props} = t0);
|
|
14
37
|
$[0] = t0;
|
|
15
38
|
$[1] = props;
|
|
39
|
+
$[2] = t1;
|
|
40
|
+
$[3] = t2;
|
|
16
41
|
} else {
|
|
17
42
|
props = $[1];
|
|
43
|
+
t1 = $[2];
|
|
44
|
+
t2 = $[3];
|
|
18
45
|
}
|
|
46
|
+
const openDelay = t1 === undefined ? HOVER_CARD_OPEN_DELAY_MS : t1;
|
|
47
|
+
const closeDelay = t2 === undefined ? HOVER_CARD_CLOSE_DELAY_MS : t2;
|
|
19
48
|
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
49
|
+
const isWarm = React.useSyncExternalStore(hoverCardWarmth.subscribe, hoverCardWarmth.isWarm, hoverCardWarmth.isWarmOnServer);
|
|
50
|
+
const openedWhileWarm = useOpenedWhileWarm(motionOpen, isWarm);
|
|
51
|
+
let t3;
|
|
52
|
+
let t4;
|
|
53
|
+
if ($[4] !== motionOpen) {
|
|
54
|
+
t3 = () => {
|
|
55
|
+
if (!motionOpen) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
return hoverCardWarmth.open();
|
|
59
|
+
};
|
|
60
|
+
t4 = [motionOpen];
|
|
61
|
+
$[4] = motionOpen;
|
|
62
|
+
$[5] = t3;
|
|
63
|
+
$[6] = t4;
|
|
64
|
+
} else {
|
|
65
|
+
t3 = $[5];
|
|
66
|
+
t4 = $[6];
|
|
67
|
+
}
|
|
68
|
+
React.useEffect(t3, t4);
|
|
69
|
+
const t5 = isWarm ? Math.min(openDelay, HOVER_CARD_WARM_OPEN_DELAY_MS) : openDelay;
|
|
70
|
+
let t6;
|
|
71
|
+
if ($[7] !== closeDelay || $[8] !== motionOpen || $[9] !== props || $[10] !== setMotionOpen || $[11] !== t5) {
|
|
72
|
+
t6 = /* @__PURE__ */ _jsx(HoverCardPrimitive.Root, {
|
|
23
73
|
"data-slot": "hover-card",
|
|
24
74
|
...props,
|
|
75
|
+
openDelay: t5,
|
|
76
|
+
closeDelay,
|
|
25
77
|
open: motionOpen,
|
|
26
78
|
onOpenChange: setMotionOpen
|
|
27
79
|
});
|
|
28
|
-
$[
|
|
29
|
-
$[
|
|
30
|
-
$[
|
|
31
|
-
$[
|
|
80
|
+
$[7] = closeDelay;
|
|
81
|
+
$[8] = motionOpen;
|
|
82
|
+
$[9] = props;
|
|
83
|
+
$[10] = setMotionOpen;
|
|
84
|
+
$[11] = t5;
|
|
85
|
+
$[12] = t6;
|
|
86
|
+
} else {
|
|
87
|
+
t6 = $[12];
|
|
88
|
+
}
|
|
89
|
+
let t7;
|
|
90
|
+
if ($[13] !== openedWhileWarm || $[14] !== t6) {
|
|
91
|
+
t7 = /* @__PURE__ */ _jsx(HoverCardOpenedWhileWarmContext.Provider, {
|
|
92
|
+
value: openedWhileWarm,
|
|
93
|
+
children: t6
|
|
94
|
+
});
|
|
95
|
+
$[13] = openedWhileWarm;
|
|
96
|
+
$[14] = t6;
|
|
97
|
+
$[15] = t7;
|
|
32
98
|
} else {
|
|
33
|
-
|
|
99
|
+
t7 = $[15];
|
|
34
100
|
}
|
|
35
|
-
let
|
|
36
|
-
if ($[
|
|
37
|
-
|
|
101
|
+
let t8;
|
|
102
|
+
if ($[16] !== motionOpen || $[17] !== t7) {
|
|
103
|
+
t8 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
38
104
|
scope: "hover-card",
|
|
39
105
|
open: motionOpen,
|
|
40
|
-
children:
|
|
106
|
+
children: t7
|
|
41
107
|
});
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
108
|
+
$[16] = motionOpen;
|
|
109
|
+
$[17] = t7;
|
|
110
|
+
$[18] = t8;
|
|
45
111
|
} else {
|
|
46
|
-
|
|
112
|
+
t8 = $[18];
|
|
47
113
|
}
|
|
48
|
-
return
|
|
114
|
+
return t8;
|
|
49
115
|
}
|
|
50
116
|
function HoverCardTrigger(t0) {
|
|
51
117
|
const $ = _c(4);
|
|
@@ -70,74 +136,371 @@ function HoverCardTrigger(t0) {
|
|
|
70
136
|
}
|
|
71
137
|
return t1;
|
|
72
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Renders Arc's card: raised surface, hairline border, panel radius and floating shadow, 18.5rem wide at most.
|
|
141
|
+
* @param props - Radix content properties. `align` defaults to `center`, `sideOffset` to 8px and `collisionPadding`
|
|
142
|
+
* to 12px.
|
|
143
|
+
* @returns The portaled card.
|
|
144
|
+
*/
|
|
73
145
|
function HoverCardContent(t0) {
|
|
74
|
-
const $ = _c(
|
|
146
|
+
const $ = _c(22);
|
|
75
147
|
let className;
|
|
76
148
|
let props;
|
|
77
149
|
let t1;
|
|
78
150
|
let t2;
|
|
151
|
+
let t3;
|
|
79
152
|
if ($[0] !== t0) {
|
|
80
|
-
({className, align: t1, sideOffset: t2, ...props} = t0);
|
|
153
|
+
({className, align: t1, sideOffset: t2, collisionPadding: t3, ...props} = t0);
|
|
81
154
|
$[0] = t0;
|
|
82
155
|
$[1] = className;
|
|
83
156
|
$[2] = props;
|
|
84
157
|
$[3] = t1;
|
|
85
158
|
$[4] = t2;
|
|
159
|
+
$[5] = t3;
|
|
86
160
|
} else {
|
|
87
161
|
className = $[1];
|
|
88
162
|
props = $[2];
|
|
89
163
|
t1 = $[3];
|
|
90
164
|
t2 = $[4];
|
|
165
|
+
t3 = $[5];
|
|
91
166
|
}
|
|
92
167
|
const align = t1 === undefined ? "center" : t1;
|
|
93
|
-
const sideOffset = t2 === undefined ?
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
168
|
+
const sideOffset = t2 === undefined ? HOVER_CARD_SIDE_OFFSET_PX : t2;
|
|
169
|
+
const collisionPadding = t3 === undefined ? HOVER_CARD_COLLISION_PADDING_PX : t3;
|
|
170
|
+
const openedWhileWarm = React.useContext(HoverCardOpenedWhileWarmContext);
|
|
171
|
+
const t4 = props.forceMount;
|
|
172
|
+
let t5;
|
|
173
|
+
if ($[6] !== openedWhileWarm) {
|
|
174
|
+
t5 = () => openedWhileWarm ? HOVER_CARD_INSTANT_MOTION : HOVER_CARD_MOTION;
|
|
175
|
+
$[6] = openedWhileWarm;
|
|
176
|
+
$[7] = t5;
|
|
100
177
|
} else {
|
|
101
|
-
|
|
178
|
+
t5 = $[7];
|
|
102
179
|
}
|
|
103
|
-
let
|
|
104
|
-
if ($[
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
180
|
+
let t6;
|
|
181
|
+
if ($[8] !== className) {
|
|
182
|
+
t6 = cn("z-50 box-border w-74 max-w-[min(18.5rem,var(--radix-hover-card-content-available-width,calc(100vw-24px)))] origin-(--radix-hover-card-content-transform-origin) rounded-(--radius-panel) border border-border bg-surface-raised p-(--space-4) font-sans text-sm leading-(--leading-body) tracking-(--tracking-body) text-foreground shadow-(--shadow-floating) outline-hidden", className);
|
|
183
|
+
$[8] = className;
|
|
184
|
+
$[9] = t6;
|
|
185
|
+
} else {
|
|
186
|
+
t6 = $[9];
|
|
187
|
+
}
|
|
188
|
+
let t7;
|
|
189
|
+
if ($[10] !== align || $[11] !== collisionPadding || $[12] !== props || $[13] !== sideOffset || $[14] !== t6) {
|
|
190
|
+
t7 = /* @__PURE__ */ _jsx(HoverCardPrimitive.Content, {
|
|
191
|
+
forceMount: true,
|
|
192
|
+
"data-slot": "hover-card-content",
|
|
193
|
+
align,
|
|
194
|
+
sideOffset,
|
|
195
|
+
collisionPadding,
|
|
196
|
+
className: t6,
|
|
197
|
+
...props
|
|
115
198
|
});
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
199
|
+
$[10] = align;
|
|
200
|
+
$[11] = collisionPadding;
|
|
201
|
+
$[12] = props;
|
|
202
|
+
$[13] = sideOffset;
|
|
203
|
+
$[14] = t6;
|
|
204
|
+
$[15] = t7;
|
|
121
205
|
} else {
|
|
122
|
-
|
|
206
|
+
t7 = $[15];
|
|
123
207
|
}
|
|
124
|
-
let
|
|
125
|
-
if ($[
|
|
126
|
-
|
|
208
|
+
let t8;
|
|
209
|
+
if ($[16] !== t5 || $[17] !== t7) {
|
|
210
|
+
t8 = /* @__PURE__ */ _jsx(ArcFloatingSlot, {
|
|
211
|
+
motion: t5,
|
|
212
|
+
children: t7
|
|
213
|
+
});
|
|
214
|
+
$[16] = t5;
|
|
215
|
+
$[17] = t7;
|
|
216
|
+
$[18] = t8;
|
|
217
|
+
} else {
|
|
218
|
+
t8 = $[18];
|
|
219
|
+
}
|
|
220
|
+
let t9;
|
|
221
|
+
if ($[19] !== props.forceMount || $[20] !== t8) {
|
|
222
|
+
t9 = /* @__PURE__ */ _jsx(HoverCardPrimitive.Portal, {
|
|
127
223
|
"data-slot": "hover-card-portal",
|
|
128
224
|
forceMount: true,
|
|
129
225
|
children: /* @__PURE__ */ _jsx(MotionPresence, {
|
|
130
226
|
scope: "hover-card",
|
|
131
|
-
forceMount:
|
|
132
|
-
children:
|
|
227
|
+
forceMount: t4,
|
|
228
|
+
children: t8
|
|
133
229
|
})
|
|
134
230
|
});
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
231
|
+
$[19] = props.forceMount;
|
|
232
|
+
$[20] = t8;
|
|
233
|
+
$[21] = t9;
|
|
234
|
+
} else {
|
|
235
|
+
t9 = $[21];
|
|
236
|
+
}
|
|
237
|
+
return t9;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Shows a portrait that fades in from a soft blur while it downloads, and at once when it is cached.
|
|
241
|
+
* @param props.source - Portrait URL.
|
|
242
|
+
* @returns The decorative portrait image.
|
|
243
|
+
*/
|
|
244
|
+
function HoverCardPortrait(t0) {
|
|
245
|
+
const $ = _c(7);
|
|
246
|
+
const { source } = t0;
|
|
247
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
248
|
+
const imageRef = React.useRef(null);
|
|
249
|
+
let t1;
|
|
250
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
251
|
+
t1 = () => {
|
|
252
|
+
const image = imageRef.current;
|
|
253
|
+
setIsLoading(Boolean(image && !image.complete));
|
|
254
|
+
};
|
|
255
|
+
$[0] = t1;
|
|
256
|
+
} else {
|
|
257
|
+
t1 = $[0];
|
|
258
|
+
}
|
|
259
|
+
let t2;
|
|
260
|
+
if ($[1] !== source) {
|
|
261
|
+
t2 = [source];
|
|
262
|
+
$[1] = source;
|
|
263
|
+
$[2] = t2;
|
|
264
|
+
} else {
|
|
265
|
+
t2 = $[2];
|
|
266
|
+
}
|
|
267
|
+
React.useLayoutEffect(t1, t2);
|
|
268
|
+
const t3 = isLoading || undefined;
|
|
269
|
+
let t4;
|
|
270
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
271
|
+
t4 = () => setIsLoading(false);
|
|
272
|
+
$[3] = t4;
|
|
138
273
|
} else {
|
|
139
|
-
|
|
274
|
+
t4 = $[3];
|
|
140
275
|
}
|
|
141
|
-
|
|
276
|
+
let t5;
|
|
277
|
+
if ($[4] !== source || $[5] !== t3) {
|
|
278
|
+
t5 = /* @__PURE__ */ _jsx("img", {
|
|
279
|
+
ref: imageRef,
|
|
280
|
+
src: source,
|
|
281
|
+
alt: "",
|
|
282
|
+
width: HOVER_CARD_PROFILE_PORTRAIT_SIZE_PX,
|
|
283
|
+
height: HOVER_CARD_PROFILE_PORTRAIT_SIZE_PX,
|
|
284
|
+
decoding: "async",
|
|
285
|
+
"data-loading": t3,
|
|
286
|
+
onLoad: t4,
|
|
287
|
+
className: "block size-full object-cover transition-[opacity,filter] duration-(--duration-standard) ease-(--ease-enter) data-loading:opacity-0 data-loading:blur-xs data-loading:transition-none motion-reduce:transition-none motion-reduce:data-loading:blur-none"
|
|
288
|
+
});
|
|
289
|
+
$[4] = source;
|
|
290
|
+
$[5] = t3;
|
|
291
|
+
$[6] = t5;
|
|
292
|
+
} else {
|
|
293
|
+
t5 = $[6];
|
|
294
|
+
}
|
|
295
|
+
return t5;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Builds the initials shown when the profile has no portrait.
|
|
299
|
+
* @param name - The person's name.
|
|
300
|
+
* @returns Up to two uppercase initials.
|
|
301
|
+
*/
|
|
302
|
+
function initialsOf(name) {
|
|
303
|
+
return name.trim().split(/\s+/).slice(0, HOVER_CARD_PROFILE_INITIALS_LENGTH).map((word) => word[0]?.toUpperCase() ?? "").join("");
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Arc's person preview: portrait, name, role, a short bio, a couple of numbers and a quiet footer line. Its rows
|
|
307
|
+
* settle in with a tiny stagger, and stay still when the user prefers reduced motion.
|
|
308
|
+
* @param props - The person's details.
|
|
309
|
+
* @returns The profile, meant as the child of `HoverCardContent`.
|
|
310
|
+
*/
|
|
311
|
+
function HoverCardProfile(t0) {
|
|
312
|
+
const $ = _c(39);
|
|
313
|
+
const { name, role, avatar, bio, stats: t1, meta, className } = t0;
|
|
314
|
+
let t2;
|
|
315
|
+
if ($[0] !== t1) {
|
|
316
|
+
t2 = t1 === undefined ? [] : t1;
|
|
317
|
+
$[0] = t1;
|
|
318
|
+
$[1] = t2;
|
|
319
|
+
} else {
|
|
320
|
+
t2 = $[1];
|
|
321
|
+
}
|
|
322
|
+
const stats = t2;
|
|
323
|
+
const reduceMotion = usePrefersReducedMotion();
|
|
324
|
+
let t3;
|
|
325
|
+
if ($[2] !== reduceMotion) {
|
|
326
|
+
t3 = (order) => reduceMotion ? {} : {
|
|
327
|
+
initial: {
|
|
328
|
+
opacity: 0,
|
|
329
|
+
y: HOVER_CARD_PROFILE_SETTLE_DISTANCE_PX
|
|
330
|
+
},
|
|
331
|
+
animate: {
|
|
332
|
+
opacity: 1,
|
|
333
|
+
y: 0
|
|
334
|
+
},
|
|
335
|
+
transition: {
|
|
336
|
+
duration: ARC_DURATION.standard,
|
|
337
|
+
ease: [...ARC_EASE.enter],
|
|
338
|
+
delay: HOVER_CARD_PROFILE_SETTLE_DELAY_S + order * HOVER_CARD_PROFILE_STAGGER_S
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
$[2] = reduceMotion;
|
|
342
|
+
$[3] = t3;
|
|
343
|
+
} else {
|
|
344
|
+
t3 = $[3];
|
|
345
|
+
}
|
|
346
|
+
const settle = t3;
|
|
347
|
+
let t4;
|
|
348
|
+
if ($[4] !== className) {
|
|
349
|
+
t4 = cn("grid gap-(--space-3)", className);
|
|
350
|
+
$[4] = className;
|
|
351
|
+
$[5] = t4;
|
|
352
|
+
} else {
|
|
353
|
+
t4 = $[5];
|
|
354
|
+
}
|
|
355
|
+
let t5;
|
|
356
|
+
if ($[6] !== settle) {
|
|
357
|
+
t5 = settle(HOVER_CARD_PROFILE_ROW_ORDER.head);
|
|
358
|
+
$[6] = settle;
|
|
359
|
+
$[7] = t5;
|
|
360
|
+
} else {
|
|
361
|
+
t5 = $[7];
|
|
362
|
+
}
|
|
363
|
+
let t6;
|
|
364
|
+
if ($[8] !== avatar || $[9] !== name) {
|
|
365
|
+
t6 = typeof avatar === "string" ? /* @__PURE__ */ _jsx(HoverCardPortrait, { source: avatar }) : avatar ?? initialsOf(name);
|
|
366
|
+
$[8] = avatar;
|
|
367
|
+
$[9] = name;
|
|
368
|
+
$[10] = t6;
|
|
369
|
+
} else {
|
|
370
|
+
t6 = $[10];
|
|
371
|
+
}
|
|
372
|
+
let t7;
|
|
373
|
+
if ($[11] !== t6) {
|
|
374
|
+
t7 = /* @__PURE__ */ _jsx("span", {
|
|
375
|
+
"aria-hidden": "true",
|
|
376
|
+
className: "relative grid size-12 flex-none place-items-center overflow-hidden rounded-full border border-border bg-surface-muted text-sm font-medium text-foreground",
|
|
377
|
+
children: t6
|
|
378
|
+
});
|
|
379
|
+
$[11] = t6;
|
|
380
|
+
$[12] = t7;
|
|
381
|
+
} else {
|
|
382
|
+
t7 = $[12];
|
|
383
|
+
}
|
|
384
|
+
let t8;
|
|
385
|
+
if ($[13] !== name) {
|
|
386
|
+
t8 = /* @__PURE__ */ _jsx("span", {
|
|
387
|
+
className: "truncate text-base leading-(--leading-body) font-medium text-foreground",
|
|
388
|
+
children: name
|
|
389
|
+
});
|
|
390
|
+
$[13] = name;
|
|
391
|
+
$[14] = t8;
|
|
392
|
+
} else {
|
|
393
|
+
t8 = $[14];
|
|
394
|
+
}
|
|
395
|
+
let t9;
|
|
396
|
+
if ($[15] !== role) {
|
|
397
|
+
t9 = role ? /* @__PURE__ */ _jsx("span", {
|
|
398
|
+
className: "truncate text-sm leading-(--leading-body) text-text-secondary",
|
|
399
|
+
children: role
|
|
400
|
+
}) : null;
|
|
401
|
+
$[15] = role;
|
|
402
|
+
$[16] = t9;
|
|
403
|
+
} else {
|
|
404
|
+
t9 = $[16];
|
|
405
|
+
}
|
|
406
|
+
let t10;
|
|
407
|
+
if ($[17] !== t8 || $[18] !== t9) {
|
|
408
|
+
t10 = /* @__PURE__ */ _jsxs("span", {
|
|
409
|
+
className: "grid min-w-0",
|
|
410
|
+
children: [t8, t9]
|
|
411
|
+
});
|
|
412
|
+
$[17] = t8;
|
|
413
|
+
$[18] = t9;
|
|
414
|
+
$[19] = t10;
|
|
415
|
+
} else {
|
|
416
|
+
t10 = $[19];
|
|
417
|
+
}
|
|
418
|
+
let t11;
|
|
419
|
+
if ($[20] !== t10 || $[21] !== t5 || $[22] !== t7) {
|
|
420
|
+
t11 = /* @__PURE__ */ _jsxs(motion.div, {
|
|
421
|
+
className: "flex min-w-0 items-center gap-(--space-3)",
|
|
422
|
+
...t5,
|
|
423
|
+
children: [t7, t10]
|
|
424
|
+
});
|
|
425
|
+
$[20] = t10;
|
|
426
|
+
$[21] = t5;
|
|
427
|
+
$[22] = t7;
|
|
428
|
+
$[23] = t11;
|
|
429
|
+
} else {
|
|
430
|
+
t11 = $[23];
|
|
431
|
+
}
|
|
432
|
+
let t12;
|
|
433
|
+
if ($[24] !== bio || $[25] !== settle) {
|
|
434
|
+
t12 = bio ? /* @__PURE__ */ _jsx(motion.p, {
|
|
435
|
+
className: "m-0 text-sm leading-(--leading-body) text-text-secondary",
|
|
436
|
+
...settle(HOVER_CARD_PROFILE_ROW_ORDER.bio),
|
|
437
|
+
children: bio
|
|
438
|
+
}) : null;
|
|
439
|
+
$[24] = bio;
|
|
440
|
+
$[25] = settle;
|
|
441
|
+
$[26] = t12;
|
|
442
|
+
} else {
|
|
443
|
+
t12 = $[26];
|
|
444
|
+
}
|
|
445
|
+
let t13;
|
|
446
|
+
if ($[27] !== settle || $[28] !== stats) {
|
|
447
|
+
t13 = stats.length > 0 ? /* @__PURE__ */ _jsx(motion.dl, {
|
|
448
|
+
className: "m-0 flex flex-wrap gap-x-(--space-6) gap-y-(--space-2) border-t border-border-subtle pt-(--space-3)",
|
|
449
|
+
...settle(HOVER_CARD_PROFILE_ROW_ORDER.stats),
|
|
450
|
+
children: stats.map(_temp)
|
|
451
|
+
}) : null;
|
|
452
|
+
$[27] = settle;
|
|
453
|
+
$[28] = stats;
|
|
454
|
+
$[29] = t13;
|
|
455
|
+
} else {
|
|
456
|
+
t13 = $[29];
|
|
457
|
+
}
|
|
458
|
+
let t14;
|
|
459
|
+
if ($[30] !== meta || $[31] !== settle) {
|
|
460
|
+
t14 = meta ? /* @__PURE__ */ _jsx(motion.div, {
|
|
461
|
+
className: "flex items-center gap-1.5 text-xs leading-(--leading-body) text-text-muted [&_svg]:flex-none",
|
|
462
|
+
...settle(HOVER_CARD_PROFILE_ROW_ORDER.meta),
|
|
463
|
+
children: meta
|
|
464
|
+
}) : null;
|
|
465
|
+
$[30] = meta;
|
|
466
|
+
$[31] = settle;
|
|
467
|
+
$[32] = t14;
|
|
468
|
+
} else {
|
|
469
|
+
t14 = $[32];
|
|
470
|
+
}
|
|
471
|
+
let t15;
|
|
472
|
+
if ($[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t4) {
|
|
473
|
+
t15 = /* @__PURE__ */ _jsxs("div", {
|
|
474
|
+
"data-slot": "hover-card-profile",
|
|
475
|
+
className: t4,
|
|
476
|
+
children: [
|
|
477
|
+
t11,
|
|
478
|
+
t12,
|
|
479
|
+
t13,
|
|
480
|
+
t14
|
|
481
|
+
]
|
|
482
|
+
});
|
|
483
|
+
$[33] = t11;
|
|
484
|
+
$[34] = t12;
|
|
485
|
+
$[35] = t13;
|
|
486
|
+
$[36] = t14;
|
|
487
|
+
$[37] = t4;
|
|
488
|
+
$[38] = t15;
|
|
489
|
+
} else {
|
|
490
|
+
t15 = $[38];
|
|
491
|
+
}
|
|
492
|
+
return t15;
|
|
493
|
+
}
|
|
494
|
+
function _temp(stat) {
|
|
495
|
+
return /* @__PURE__ */ _jsxs("div", {
|
|
496
|
+
className: "flex flex-col-reverse",
|
|
497
|
+
children: [/* @__PURE__ */ _jsx("dt", {
|
|
498
|
+
className: "text-xs leading-(--leading-body) text-text-muted",
|
|
499
|
+
children: stat.label
|
|
500
|
+
}), /* @__PURE__ */ _jsx("dd", {
|
|
501
|
+
className: "m-0 text-base leading-(--leading-body) font-medium text-foreground tabular-nums",
|
|
502
|
+
children: stat.value
|
|
503
|
+
})]
|
|
504
|
+
}, stat.label);
|
|
142
505
|
}
|
|
143
|
-
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
506
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardProfile };
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Arc's Pagination (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): compact page controls on Arc's
|
|
3
|
+
* tokens with tabular numbers, a current-page mark that glides to the newly selected page with Arc's morph spring,
|
|
4
|
+
* hover only on fine pointers and arrows that press in. Unlike Arc's stateful component it stays composable: every
|
|
5
|
+
* page is a link rendered through the provider's `Link` adapter (Next.js, TanStack Router or a native anchor).
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentProps } from "react";
|
|
8
|
+
import type { ControlButton } from "./control-button.js";
|
|
2
9
|
import { type LinkProps } from "./link.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Landmark that holds the page controls.
|
|
12
|
+
* @param props - Native `nav` attributes; `aria-label` defaults to Spanish copy.
|
|
13
|
+
* @returns The navigation landmark.
|
|
14
|
+
*/
|
|
15
|
+
declare function Pagination({ className, ...props }: ComponentProps<"nav">): import("react").JSX.Element;
|
|
16
|
+
/** Lists page links; the current page's mark glides to the newly selected page. */
|
|
17
|
+
declare function PaginationContent({ className, ...props }: ComponentProps<"ul">): import("react").JSX.Element;
|
|
18
|
+
declare function PaginationItem({ ...props }: ComponentProps<"li">): import("react").JSX.Element;
|
|
8
19
|
export type PaginationLinkProps = {
|
|
9
20
|
isActive?: boolean;
|
|
10
|
-
} & Pick<
|
|
11
|
-
|
|
12
|
-
|
|
21
|
+
} & Pick<ComponentProps<typeof ControlButton>, "size"> & LinkProps;
|
|
22
|
+
/**
|
|
23
|
+
* One page, rendered through the provider's `Link` adapter or the `component` passed to it.
|
|
24
|
+
* @param props - `isActive` marks the current page (`aria-current="page"`); `size` keeps the previous size names
|
|
25
|
+
* and only changes the horizontal padding; every other prop reaches the link. With `aria-disabled` the link
|
|
26
|
+
* stays visible but never navigates, whether clicked or activated with Enter, and `onClick` is not called.
|
|
27
|
+
* @returns The page link.
|
|
28
|
+
*/
|
|
29
|
+
declare function PaginationLink({ className, isActive, size, onClick, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
30
|
+
/** Previous and next links accept an optional visible label, hidden on small screens. */
|
|
31
|
+
type PaginationStepProps = PaginationLinkProps & {
|
|
13
32
|
text?: string;
|
|
14
|
-
}
|
|
15
|
-
declare function
|
|
16
|
-
|
|
17
|
-
}):
|
|
18
|
-
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
declare function PaginationPrevious({ className, text, ...props }: PaginationStepProps): import("react").JSX.Element;
|
|
35
|
+
declare function PaginationNext({ className, text, ...props }: PaginationStepProps): import("react").JSX.Element;
|
|
36
|
+
declare function PaginationEllipsis({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
19
37
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
|