beez-ui 2.7.0 → 3.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 +78 -0
- package/README.md +43 -13
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/account-menu.d.ts +4 -3
- package/dist/components/account-menu.js +63 -54
- package/dist/components/alert.d.ts +15 -15
- package/dist/components/alert.js +289 -270
- package/dist/components/animated-theme-toggler.js +1 -1
- package/dist/components/avatar.d.ts +56 -31
- package/dist/components/avatar.js +394 -277
- package/dist/components/badge.d.ts +8 -28
- package/dist/components/badge.js +55 -108
- package/dist/components/calendar.d.ts +36 -26
- package/dist/components/calendar.js +132 -1227
- package/dist/components/card.d.ts +36 -25
- package/dist/components/card.js +895 -72
- package/dist/components/carousel.d.ts +63 -47
- package/dist/components/carousel.js +496 -777
- package/dist/components/data-table.d.ts +5 -4
- package/dist/components/data-table.js +7 -6
- package/dist/components/dialog-surface.d.ts +23 -1
- package/dist/components/dialog-surface.js +99 -3
- package/dist/components/dialog.d.ts +80 -45
- package/dist/components/dialog.js +258 -503
- package/dist/components/dropdown-menu.d.ts +56 -73
- package/dist/components/dropdown-menu.js +79 -714
- package/dist/components/field.d.ts +3 -1
- package/dist/components/field.js +49 -39
- package/dist/components/filter-presets-bar.js +2 -2
- package/dist/components/filter-query-bar.js +1 -1
- package/dist/components/hover-card.d.ts +42 -41
- package/dist/components/hover-card.js +57 -483
- package/dist/components/pagination.d.ts +53 -31
- package/dist/components/pagination.js +176 -412
- package/dist/components/popover.d.ts +11 -23
- package/dist/components/popover.js +19 -304
- package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
- package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +267 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +557 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +36 -0
- package/dist/components/primitives/select.js +407 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/radio-group.d.ts +30 -17
- package/dist/components/radio-group.js +266 -315
- package/dist/components/rich-link-editor.js +2 -2
- package/dist/components/select.d.ts +51 -42
- package/dist/components/select.js +163 -495
- package/dist/components/skeleton.d.ts +16 -15
- package/dist/components/skeleton.js +99 -205
- package/dist/components/split-button.js +1 -1
- package/dist/components/switch.d.ts +3 -6
- package/dist/components/switch.js +163 -170
- package/dist/components/tabs.d.ts +3 -11
- package/dist/components/tabs.js +61 -75
- package/dist/components/themed-toaster.d.ts +1 -1
- package/dist/components/themed-toaster.js +1 -1
- package/dist/components/toaster.d.ts +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/tooltip.d.ts +36 -31
- package/dist/components/tooltip.js +44 -284
- package/dist/constants/alert.d.ts +5 -1
- package/dist/constants/alert.js +5 -1
- package/dist/constants/avatar.d.ts +24 -1
- package/dist/constants/avatar.js +19 -0
- package/dist/constants/calendar.d.ts +12 -0
- package/dist/constants/calendar.js +12 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +31 -13
- package/dist/constants/carousel.js +32 -11
- package/dist/constants/dialog.d.ts +6 -1
- package/dist/constants/dialog.js +5 -1
- package/dist/constants/dropdown-menu.d.ts +2 -2
- package/dist/constants/dropdown-menu.js +2 -2
- package/dist/constants/pagination.d.ts +13 -2
- package/dist/constants/pagination.js +13 -2
- package/dist/constants/select.d.ts +4 -2
- package/dist/constants/select.js +4 -2
- package/dist/constants/switch.d.ts +5 -16
- package/dist/constants/switch.js +6 -14
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/motion/glide-indicator.d.ts +1 -1
- package/dist/motion/glide-indicator.js +1 -1
- package/dist/motion/presence.d.ts +0 -1
- package/dist/motion/presence.js +0 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -6
package/dist/components/card.js
CHANGED
|
@@ -1,84 +1,907 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
3
|
/**
|
|
2
4
|
* Arc's Card (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a contained group of related content on
|
|
3
|
-
* Arc's surface, panel radius and spacing
|
|
4
|
-
* and
|
|
5
|
-
*
|
|
5
|
+
* Arc's surface, panel radius and spacing, with optional media, an owner byline whose status rolls in word by word, a
|
|
6
|
+
* trailing action and Arc's quick look. A card holding a link or button floats a little on fine-pointer hover and its
|
|
7
|
+
* media drifts in slowly. With `details`, the title becomes the trigger of a dialog that grows out of the card: the
|
|
8
|
+
* surface, photo, title and byline travel on one spring while the details settle in beneath them.
|
|
6
9
|
*/
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
10
|
+
import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
11
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
12
|
+
import { AnimatePresence, LayoutGroup, motion } from "motion/react";
|
|
13
|
+
import { X } from "lucide-react";
|
|
14
|
+
import { CARD_CLOSE_HIDDEN_SCALE, CARD_CLOSE_LABEL, CARD_CLOSE_PRESS_SCALE, CARD_DEFAULT_HEADING_LEVEL, CARD_DETAILS_OFFSET_PX, CARD_GROW_DURATION_S, CARD_RETURN_MS, CARD_SETTLE_DURATION_S, CARD_STATUS_OFFSET_EM, CARD_STATUS_WORD_STAGGER_S } from "../constants/card.js";
|
|
15
|
+
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
9
16
|
import { cn } from "../lib/utils.js";
|
|
10
|
-
import {
|
|
17
|
+
import { ARC_BLUR, ARC_DURATION, ARC_EASE, ARC_SPRING_SMOOTH, ARC_SPRING_SNAPPY } from "../motion/arc-tokens.js";
|
|
18
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
19
|
+
import { useAttachedElement } from "../motion/use-attached-element.js";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
/** One critically damped spring carries the surface both ways, so it never overshoots and can reverse mid-flight. */
|
|
22
|
+
const grow = {
|
|
23
|
+
...ARC_SPRING_SMOOTH,
|
|
24
|
+
visualDuration: CARD_GROW_DURATION_S
|
|
25
|
+
};
|
|
26
|
+
const settle = {
|
|
27
|
+
...ARC_SPRING_SMOOTH,
|
|
28
|
+
visualDuration: CARD_SETTLE_DURATION_S
|
|
29
|
+
};
|
|
30
|
+
const fade = { duration: ARC_DURATION.instant };
|
|
31
|
+
/** Quick look extras arrive once the surface has mostly grown, so they never ride the stretch. */
|
|
32
|
+
const reveal = {
|
|
33
|
+
delay: ARC_DURATION.instant,
|
|
34
|
+
duration: ARC_DURATION.standard,
|
|
35
|
+
ease: [...ARC_EASE.enter]
|
|
36
|
+
};
|
|
37
|
+
const closeIn = {
|
|
38
|
+
delay: ARC_DURATION.instant,
|
|
39
|
+
duration: ARC_DURATION.fast,
|
|
40
|
+
ease: [...ARC_EASE.enter]
|
|
41
|
+
};
|
|
42
|
+
/** A new status replaces the whole line: the old one lifts away quickly while the new words rise in one after another. */
|
|
43
|
+
const statusLineMotion = {
|
|
44
|
+
enter: {},
|
|
45
|
+
center: {},
|
|
46
|
+
exit: {
|
|
47
|
+
opacity: 0,
|
|
48
|
+
y: `${-CARD_STATUS_OFFSET_EM}em`,
|
|
49
|
+
filter: `blur(${ARC_BLUR.subtle}px)`,
|
|
50
|
+
transition: {
|
|
51
|
+
duration: ARC_DURATION.fast,
|
|
52
|
+
ease: [...ARC_EASE.standard]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const statusWordMotion = {
|
|
57
|
+
enter: {
|
|
58
|
+
opacity: 0,
|
|
59
|
+
y: `${CARD_STATUS_OFFSET_EM}em`,
|
|
60
|
+
filter: `blur(${ARC_BLUR.soft}px)`
|
|
61
|
+
},
|
|
62
|
+
center: (order) => ({
|
|
63
|
+
opacity: 1,
|
|
64
|
+
y: 0,
|
|
65
|
+
filter: "blur(0px)",
|
|
66
|
+
transition: {
|
|
67
|
+
duration: ARC_DURATION.standard,
|
|
68
|
+
ease: [...ARC_EASE.enter],
|
|
69
|
+
delay: order * CARD_STATUS_WORD_STAGGER_S
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
/** The animated heading element of each title level. */
|
|
74
|
+
const MOTION_HEADING = {
|
|
75
|
+
2: motion.h2,
|
|
76
|
+
3: motion.h3,
|
|
77
|
+
4: motion.h4
|
|
78
|
+
};
|
|
79
|
+
/** Splits a status into words and the spaces between them, so each word can rise on its own. */
|
|
80
|
+
const STATUS_WORD_SEPARATOR = /(\s+)/;
|
|
81
|
+
/** Card surface. The outline is a 1px ring in the border token, so the hover shadow can stack on it, and isolation
|
|
82
|
+
* keeps the rounded clip on media while the card lifts (Safari drops it otherwise). */
|
|
83
|
+
const cardClassName = "group/card relative isolate flex min-w-0 flex-col overflow-hidden rounded-(--radius-panel) bg-surface text-sm text-foreground ring-1 ring-border has-[[data-slot=card-trigger]:focus-visible]:ring-border-strong motion-safe:transition-[translate] motion-safe:duration-(--duration-spring) motion-safe:ease-(--ease-spring) hover-fine:has-[a,button]:motion-safe:-translate-y-0.5";
|
|
84
|
+
const titleClassName = "m-0 w-fit max-w-full font-sans text-lg leading-[1.3] font-medium tracking-(--tracking-body) text-balance";
|
|
85
|
+
const descriptionClassName = "m-0 mt-(--space-2) max-w-[34ch] text-sm leading-(--leading-body) text-pretty text-text-secondary";
|
|
11
86
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
87
|
+
* Arc's status line: the full text for assistive technology, and a decorative copy whose words rise in when it changes.
|
|
88
|
+
* @param props - The status text and whether motion is reduced.
|
|
89
|
+
* @returns The polite status region.
|
|
14
90
|
*/
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className:
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
|
|
91
|
+
function CardStatus(t0) {
|
|
92
|
+
const $ = _c(12);
|
|
93
|
+
const { text, reduceMotion } = t0;
|
|
94
|
+
let t1;
|
|
95
|
+
if ($[0] !== text) {
|
|
96
|
+
t1 = /* @__PURE__ */ _jsx("span", {
|
|
97
|
+
className: "sr-only",
|
|
98
|
+
children: text
|
|
99
|
+
});
|
|
100
|
+
$[0] = text;
|
|
101
|
+
$[1] = t1;
|
|
102
|
+
} else {
|
|
103
|
+
t1 = $[1];
|
|
104
|
+
}
|
|
105
|
+
const t2 = reduceMotion ? false : "enter";
|
|
106
|
+
const t3 = reduceMotion ? undefined : "exit";
|
|
107
|
+
let t4;
|
|
108
|
+
if ($[2] !== text) {
|
|
109
|
+
t4 = text.split(STATUS_WORD_SEPARATOR).map(_temp);
|
|
110
|
+
$[2] = text;
|
|
111
|
+
$[3] = t4;
|
|
112
|
+
} else {
|
|
113
|
+
t4 = $[3];
|
|
114
|
+
}
|
|
115
|
+
let t5;
|
|
116
|
+
if ($[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== text) {
|
|
117
|
+
t5 = /* @__PURE__ */ _jsx("span", {
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
className: "relative block",
|
|
120
|
+
children: /* @__PURE__ */ _jsx(AnimatePresence, {
|
|
121
|
+
mode: "popLayout",
|
|
122
|
+
initial: false,
|
|
123
|
+
children: /* @__PURE__ */ _jsx(motion.span, {
|
|
124
|
+
className: "block overflow-x-clip text-ellipsis",
|
|
125
|
+
variants: statusLineMotion,
|
|
126
|
+
initial: t2,
|
|
127
|
+
animate: "center",
|
|
128
|
+
exit: t3,
|
|
129
|
+
children: t4
|
|
130
|
+
}, text)
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
$[4] = t2;
|
|
134
|
+
$[5] = t3;
|
|
135
|
+
$[6] = t4;
|
|
136
|
+
$[7] = text;
|
|
137
|
+
$[8] = t5;
|
|
138
|
+
} else {
|
|
139
|
+
t5 = $[8];
|
|
140
|
+
}
|
|
141
|
+
let t6;
|
|
142
|
+
if ($[9] !== t1 || $[10] !== t5) {
|
|
143
|
+
t6 = /* @__PURE__ */ _jsxs("span", {
|
|
144
|
+
"data-slot": "card-status",
|
|
145
|
+
role: "status",
|
|
146
|
+
className: "relative overflow-x-clip text-text-muted tabular-nums whitespace-nowrap",
|
|
147
|
+
children: [t1, t5]
|
|
148
|
+
});
|
|
149
|
+
$[9] = t1;
|
|
150
|
+
$[10] = t5;
|
|
151
|
+
$[11] = t6;
|
|
152
|
+
} else {
|
|
153
|
+
t6 = $[11];
|
|
154
|
+
}
|
|
155
|
+
return t6;
|
|
156
|
+
}
|
|
157
|
+
function _temp(part, index) {
|
|
158
|
+
return /* @__PURE__ */ _jsx(motion.span, {
|
|
159
|
+
className: "inline-block whitespace-pre",
|
|
160
|
+
custom: index / 2,
|
|
161
|
+
variants: statusWordMotion,
|
|
162
|
+
children: part
|
|
163
|
+
}, index);
|
|
25
164
|
}
|
|
26
165
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
166
|
+
* Reads a radius back in pixels: Motion only scale-corrects pixel radii, so token radii are converted for the morph.
|
|
167
|
+
* @param node - Element whose document gives the root font size.
|
|
168
|
+
* @param value - Computed radius, in pixels or rem.
|
|
169
|
+
* @returns The radius in pixels, or `undefined` when it is not a length.
|
|
29
170
|
*/
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
...props,
|
|
35
|
-
children: /* @__PURE__ */ _jsx("div", {
|
|
36
|
-
className: "grid min-h-28 place-items-center transition-transform duration-(--duration-considered) ease-(--ease-standard) motion-reduce:transition-none pointer-fine:group-hover/card:scale-[1.04] pointer-fine:group-hover/card:duration-[calc(var(--duration-considered)*2)] motion-reduce:scale-100! [&>img]:size-full [&>img]:object-cover",
|
|
37
|
-
children
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function CardHeader({ className, ...props }) {
|
|
42
|
-
return /* @__PURE__ */ _jsx("div", {
|
|
43
|
-
"data-slot": "card-header",
|
|
44
|
-
className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-(--space-2) px-(--space-5) group-data-[size=sm]/card:px-(--space-4) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--space-5) group-data-[size=sm]/card:[.border-b]:pb-(--space-4)", className),
|
|
45
|
-
...props
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function CardTitle({ className, ...props }) {
|
|
49
|
-
return /* @__PURE__ */ _jsx("div", {
|
|
50
|
-
"data-slot": "card-title",
|
|
51
|
-
className: cn("font-sans text-lg leading-[1.3] font-medium tracking-(--tracking-body) text-balance group-data-[size=sm]/card:text-base", className),
|
|
52
|
-
...props
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function CardDescription({ className, ...props }) {
|
|
56
|
-
return /* @__PURE__ */ _jsx("div", {
|
|
57
|
-
"data-slot": "card-description",
|
|
58
|
-
className: cn("text-sm leading-(--leading-body) text-pretty text-text-secondary", className),
|
|
59
|
-
...props
|
|
60
|
-
});
|
|
171
|
+
function toPixels(node, value) {
|
|
172
|
+
const amount = parseFloat(value);
|
|
173
|
+
if (!Number.isFinite(amount)) return undefined;
|
|
174
|
+
return value.trim().endsWith("rem") ? amount * parseFloat(getComputedStyle(node.ownerDocument.documentElement).fontSize) : amount;
|
|
61
175
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
function CardContent({ className, ...props }) {
|
|
70
|
-
return /* @__PURE__ */ _jsx("div", {
|
|
71
|
-
"data-slot": "card-content",
|
|
72
|
-
className: cn("px-(--space-5) group-data-[size=sm]/card:px-(--space-4)", className),
|
|
73
|
-
...props
|
|
74
|
-
});
|
|
176
|
+
/**
|
|
177
|
+
* Tells whether an optional slot was given: `0` and `""` are content, while `undefined`, `null` and `false` leave it out.
|
|
178
|
+
* @param node - Slot content.
|
|
179
|
+
* @returns Whether the slot renders.
|
|
180
|
+
*/
|
|
181
|
+
function hasContent(node) {
|
|
182
|
+
return node !== undefined && node !== null && node !== false;
|
|
75
183
|
}
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
184
|
+
/**
|
|
185
|
+
* A content card with optional media, byline, action and footer that can grow into a quick look dialog.
|
|
186
|
+
* @param props - Arc's card content and quick look state, the heading level, a footer and native article attributes.
|
|
187
|
+
* @returns The card article, wrapped in its quick look dialog when `details` is set.
|
|
188
|
+
*/
|
|
189
|
+
function Card(t0) {
|
|
190
|
+
const $ = _c(131);
|
|
191
|
+
let action;
|
|
192
|
+
let avatar;
|
|
193
|
+
let children;
|
|
194
|
+
let className;
|
|
195
|
+
let description;
|
|
196
|
+
let details;
|
|
197
|
+
let footer;
|
|
198
|
+
let media;
|
|
199
|
+
let meta;
|
|
200
|
+
let onOpenChange;
|
|
201
|
+
let openProp;
|
|
202
|
+
let props;
|
|
203
|
+
let ref;
|
|
204
|
+
let status;
|
|
205
|
+
let style;
|
|
206
|
+
let t1;
|
|
207
|
+
let t2;
|
|
208
|
+
let title;
|
|
209
|
+
if ($[0] !== t0) {
|
|
210
|
+
({title, description, media, action, avatar, meta, status, details, open: openProp, defaultOpen: t1, onOpenChange, footer, headingLevel: t2, children, className, style, ref, ...props} = t0);
|
|
211
|
+
$[0] = t0;
|
|
212
|
+
$[1] = action;
|
|
213
|
+
$[2] = avatar;
|
|
214
|
+
$[3] = children;
|
|
215
|
+
$[4] = className;
|
|
216
|
+
$[5] = description;
|
|
217
|
+
$[6] = details;
|
|
218
|
+
$[7] = footer;
|
|
219
|
+
$[8] = media;
|
|
220
|
+
$[9] = meta;
|
|
221
|
+
$[10] = onOpenChange;
|
|
222
|
+
$[11] = openProp;
|
|
223
|
+
$[12] = props;
|
|
224
|
+
$[13] = ref;
|
|
225
|
+
$[14] = status;
|
|
226
|
+
$[15] = style;
|
|
227
|
+
$[16] = t1;
|
|
228
|
+
$[17] = t2;
|
|
229
|
+
$[18] = title;
|
|
230
|
+
} else {
|
|
231
|
+
action = $[1];
|
|
232
|
+
avatar = $[2];
|
|
233
|
+
children = $[3];
|
|
234
|
+
className = $[4];
|
|
235
|
+
description = $[5];
|
|
236
|
+
details = $[6];
|
|
237
|
+
footer = $[7];
|
|
238
|
+
media = $[8];
|
|
239
|
+
meta = $[9];
|
|
240
|
+
onOpenChange = $[10];
|
|
241
|
+
openProp = $[11];
|
|
242
|
+
props = $[12];
|
|
243
|
+
ref = $[13];
|
|
244
|
+
status = $[14];
|
|
245
|
+
style = $[15];
|
|
246
|
+
t1 = $[16];
|
|
247
|
+
t2 = $[17];
|
|
248
|
+
title = $[18];
|
|
249
|
+
}
|
|
250
|
+
const defaultOpen = t1 === undefined ? false : t1;
|
|
251
|
+
const headingLevel = t2 === undefined ? CARD_DEFAULT_HEADING_LEVEL : t2;
|
|
252
|
+
const reduceMotion = usePrefersReducedMotion();
|
|
253
|
+
const layoutGroupId = useId();
|
|
254
|
+
const [cardNode, attachCard] = useAttachedElement(ref);
|
|
255
|
+
const descriptionRef = useRef(null);
|
|
256
|
+
const quickLookRef = useRef(null);
|
|
257
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
258
|
+
let t3;
|
|
259
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
260
|
+
t3 = {};
|
|
261
|
+
$[19] = t3;
|
|
262
|
+
} else {
|
|
263
|
+
t3 = $[19];
|
|
264
|
+
}
|
|
265
|
+
const [geometry, setGeometry] = useState(t3);
|
|
266
|
+
const [landing, setLanding] = useState(null);
|
|
267
|
+
let t4;
|
|
268
|
+
if ($[20] !== details || $[21] !== title) {
|
|
269
|
+
t4 = hasContent(details) && hasContent(title);
|
|
270
|
+
$[20] = details;
|
|
271
|
+
$[21] = title;
|
|
272
|
+
$[22] = t4;
|
|
273
|
+
} else {
|
|
274
|
+
t4 = $[22];
|
|
275
|
+
}
|
|
276
|
+
const hasQuickLook = t4;
|
|
277
|
+
const isOpen = hasQuickLook ? openProp ?? uncontrolledOpen : false;
|
|
278
|
+
const shouldMorph = hasQuickLook && !reduceMotion;
|
|
279
|
+
const isReturning = !isOpen && landing !== null;
|
|
280
|
+
let t5;
|
|
281
|
+
if ($[23] !== description) {
|
|
282
|
+
t5 = hasContent(description);
|
|
283
|
+
$[23] = description;
|
|
284
|
+
$[24] = t5;
|
|
285
|
+
} else {
|
|
286
|
+
t5 = $[24];
|
|
287
|
+
}
|
|
288
|
+
const hasDescription = t5;
|
|
289
|
+
const MotionHeading = MOTION_HEADING[headingLevel];
|
|
290
|
+
let t6;
|
|
291
|
+
if ($[25] !== onOpenChange || $[26] !== openProp) {
|
|
292
|
+
t6 = (nextOpen) => {
|
|
293
|
+
if (openProp === undefined) {
|
|
294
|
+
setUncontrolledOpen(nextOpen);
|
|
295
|
+
}
|
|
296
|
+
onOpenChange?.(nextOpen);
|
|
297
|
+
};
|
|
298
|
+
$[25] = onOpenChange;
|
|
299
|
+
$[26] = openProp;
|
|
300
|
+
$[27] = t6;
|
|
301
|
+
} else {
|
|
302
|
+
t6 = $[27];
|
|
303
|
+
}
|
|
304
|
+
const setOpen = t6;
|
|
305
|
+
let t7;
|
|
306
|
+
if ($[28] !== cardNode || $[29] !== shouldMorph) {
|
|
307
|
+
t7 = () => {
|
|
308
|
+
const node = cardNode;
|
|
309
|
+
const text = descriptionRef.current;
|
|
310
|
+
if (!shouldMorph || !node || typeof ResizeObserver === "undefined") {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
const observer = new ResizeObserver(() => {
|
|
314
|
+
const computed = getComputedStyle(node);
|
|
315
|
+
const cardRadius = toPixels(node, computed.borderTopLeftRadius);
|
|
316
|
+
const panelRadius = toPixels(node, computed.getPropertyValue("--radius-surface"));
|
|
317
|
+
const measure = text?.offsetWidth || undefined;
|
|
318
|
+
setGeometry((current) => current.card !== undefined && current.measure === measure ? current : {
|
|
319
|
+
card: current.card ?? cardRadius,
|
|
320
|
+
panel: current.panel ?? panelRadius,
|
|
321
|
+
measure
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
observer.observe(node);
|
|
325
|
+
if (text) {
|
|
326
|
+
observer.observe(text);
|
|
327
|
+
}
|
|
328
|
+
return () => observer.disconnect();
|
|
329
|
+
};
|
|
330
|
+
$[28] = cardNode;
|
|
331
|
+
$[29] = shouldMorph;
|
|
332
|
+
$[30] = t7;
|
|
333
|
+
} else {
|
|
334
|
+
t7 = $[30];
|
|
335
|
+
}
|
|
336
|
+
let t8;
|
|
337
|
+
if ($[31] !== cardNode || $[32] !== hasDescription || $[33] !== shouldMorph) {
|
|
338
|
+
t8 = [
|
|
339
|
+
shouldMorph,
|
|
340
|
+
hasDescription,
|
|
341
|
+
cardNode
|
|
342
|
+
];
|
|
343
|
+
$[31] = cardNode;
|
|
344
|
+
$[32] = hasDescription;
|
|
345
|
+
$[33] = shouldMorph;
|
|
346
|
+
$[34] = t8;
|
|
347
|
+
} else {
|
|
348
|
+
t8 = $[34];
|
|
349
|
+
}
|
|
350
|
+
useEffect(t7, t8);
|
|
351
|
+
const wasOpen = useRef(isOpen);
|
|
352
|
+
let t10;
|
|
353
|
+
let t9;
|
|
354
|
+
if ($[35] !== cardNode || $[36] !== isOpen || $[37] !== shouldMorph) {
|
|
355
|
+
t9 = () => {
|
|
356
|
+
const hasClosed = wasOpen.current && !isOpen;
|
|
357
|
+
wasOpen.current = isOpen;
|
|
358
|
+
const node_0 = cardNode;
|
|
359
|
+
if (isOpen) {
|
|
360
|
+
setLanding(null);
|
|
361
|
+
} else {
|
|
362
|
+
if (hasClosed && shouldMorph && node_0) {
|
|
363
|
+
const box = node_0.getBoundingClientRect();
|
|
364
|
+
setLanding({
|
|
365
|
+
top: box.top,
|
|
366
|
+
left: box.left,
|
|
367
|
+
width: box.width,
|
|
368
|
+
height: box.height
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
t10 = [
|
|
374
|
+
isOpen,
|
|
375
|
+
shouldMorph,
|
|
376
|
+
cardNode
|
|
377
|
+
];
|
|
378
|
+
$[35] = cardNode;
|
|
379
|
+
$[36] = isOpen;
|
|
380
|
+
$[37] = shouldMorph;
|
|
381
|
+
$[38] = t10;
|
|
382
|
+
$[39] = t9;
|
|
383
|
+
} else {
|
|
384
|
+
t10 = $[38];
|
|
385
|
+
t9 = $[39];
|
|
386
|
+
}
|
|
387
|
+
useLayoutEffect(t9, t10);
|
|
388
|
+
let t11;
|
|
389
|
+
let t12;
|
|
390
|
+
if ($[40] !== isOpen) {
|
|
391
|
+
t11 = () => {
|
|
392
|
+
const panel = quickLookRef.current;
|
|
393
|
+
if (!panel) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
panel.toggleAttribute("inert", !isOpen);
|
|
397
|
+
if (isOpen) {
|
|
398
|
+
panel.removeAttribute("aria-hidden");
|
|
399
|
+
} else {
|
|
400
|
+
panel.setAttribute("aria-hidden", "true");
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
t12 = [isOpen];
|
|
404
|
+
$[40] = isOpen;
|
|
405
|
+
$[41] = t11;
|
|
406
|
+
$[42] = t12;
|
|
407
|
+
} else {
|
|
408
|
+
t11 = $[41];
|
|
409
|
+
t12 = $[42];
|
|
410
|
+
}
|
|
411
|
+
useLayoutEffect(t11, t12);
|
|
412
|
+
let t13;
|
|
413
|
+
let t14;
|
|
414
|
+
if ($[43] !== isReturning) {
|
|
415
|
+
t13 = () => {
|
|
416
|
+
if (!isReturning) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const timer = window.setTimeout(() => setLanding(null), CARD_RETURN_MS);
|
|
420
|
+
return () => window.clearTimeout(timer);
|
|
421
|
+
};
|
|
422
|
+
t14 = [isReturning];
|
|
423
|
+
$[43] = isReturning;
|
|
424
|
+
$[44] = t13;
|
|
425
|
+
$[45] = t14;
|
|
426
|
+
} else {
|
|
427
|
+
t13 = $[44];
|
|
428
|
+
t14 = $[45];
|
|
429
|
+
}
|
|
430
|
+
useEffect(t13, t14);
|
|
431
|
+
let t15;
|
|
432
|
+
if ($[46] !== isOpen || $[47] !== isReturning || $[48] !== shouldMorph) {
|
|
433
|
+
t15 = (id, side, t16) => {
|
|
434
|
+
const layout = t16 === undefined ? true : t16;
|
|
435
|
+
return shouldMorph ? {
|
|
436
|
+
layoutId: id,
|
|
437
|
+
layout,
|
|
438
|
+
layoutCrossfade: false,
|
|
439
|
+
layoutDependency: side === "card" ? isOpen : isReturning ? "return" : "panel",
|
|
440
|
+
transition: { layout: side === "card" ? settle : grow }
|
|
441
|
+
} : {};
|
|
442
|
+
};
|
|
443
|
+
$[46] = isOpen;
|
|
444
|
+
$[47] = isReturning;
|
|
445
|
+
$[48] = shouldMorph;
|
|
446
|
+
$[49] = t15;
|
|
447
|
+
} else {
|
|
448
|
+
t15 = $[49];
|
|
449
|
+
}
|
|
450
|
+
const shared = t15;
|
|
451
|
+
let t16;
|
|
452
|
+
if ($[50] !== action || $[51] !== avatar || $[52] !== meta || $[53] !== reduceMotion || $[54] !== shared || $[55] !== status) {
|
|
453
|
+
t16 = (side_0) => {
|
|
454
|
+
const bylineAvatar = side_0 === "card" ? avatar : null;
|
|
455
|
+
const bylineAction = side_0 === "card" ? action : null;
|
|
456
|
+
return bylineAvatar || meta || status || bylineAction ? /* @__PURE__ */ _jsxs("div", {
|
|
457
|
+
"data-slot": "card-byline",
|
|
458
|
+
className: "mt-(--space-5) flex items-center justify-between gap-(--space-3)",
|
|
459
|
+
children: [bylineAvatar || meta || status ? /* @__PURE__ */ _jsxs(motion.div, {
|
|
460
|
+
className: "flex min-w-0 flex-auto items-center gap-(--space-3)",
|
|
461
|
+
...shared("byline", side_0, "position"),
|
|
462
|
+
children: [bylineAvatar ? /* @__PURE__ */ _jsx("span", {
|
|
463
|
+
className: "grid size-(--space-8) flex-none overflow-hidden rounded-(--radius-pill) bg-surface-muted *:size-full *:object-cover",
|
|
464
|
+
children: bylineAvatar
|
|
465
|
+
}) : null, /* @__PURE__ */ _jsxs("span", {
|
|
466
|
+
className: "grid min-w-0 grid-cols-[minmax(0,1fr)] text-xs leading-(--leading-body)",
|
|
467
|
+
children: [meta ? /* @__PURE__ */ _jsx("span", {
|
|
468
|
+
className: "overflow-hidden font-medium text-ellipsis whitespace-nowrap text-foreground",
|
|
469
|
+
children: meta
|
|
470
|
+
}) : null, status ? /* @__PURE__ */ _jsx(CardStatus, {
|
|
471
|
+
text: status,
|
|
472
|
+
reduceMotion
|
|
473
|
+
}) : null]
|
|
474
|
+
})]
|
|
475
|
+
}) : null, bylineAction ? /* @__PURE__ */ _jsx(motion.div, {
|
|
476
|
+
"data-slot": "card-action",
|
|
477
|
+
className: "relative z-1 flex flex-none flex-wrap gap-(--space-3)",
|
|
478
|
+
...shared("action", side_0, "position"),
|
|
479
|
+
children: bylineAction
|
|
480
|
+
}) : null]
|
|
481
|
+
}) : null;
|
|
482
|
+
};
|
|
483
|
+
$[50] = action;
|
|
484
|
+
$[51] = avatar;
|
|
485
|
+
$[52] = meta;
|
|
486
|
+
$[53] = reduceMotion;
|
|
487
|
+
$[54] = shared;
|
|
488
|
+
$[55] = status;
|
|
489
|
+
$[56] = t16;
|
|
490
|
+
} else {
|
|
491
|
+
t16 = $[56];
|
|
492
|
+
}
|
|
493
|
+
const byline = t16;
|
|
494
|
+
let t17;
|
|
495
|
+
if ($[57] !== footer) {
|
|
496
|
+
t17 = footer ? /* @__PURE__ */ _jsx("div", {
|
|
497
|
+
"data-slot": "card-footer",
|
|
498
|
+
className: "relative z-1 mt-(--space-5) flex items-center justify-between gap-(--space-3)",
|
|
499
|
+
children: footer
|
|
500
|
+
}) : null;
|
|
501
|
+
$[57] = footer;
|
|
502
|
+
$[58] = t17;
|
|
503
|
+
} else {
|
|
504
|
+
t17 = $[58];
|
|
505
|
+
}
|
|
506
|
+
const footerRow = t17;
|
|
507
|
+
const t18 = props;
|
|
508
|
+
let t19;
|
|
509
|
+
if ($[59] !== className) {
|
|
510
|
+
t19 = cn(cardClassName, className);
|
|
511
|
+
$[59] = className;
|
|
512
|
+
$[60] = t19;
|
|
513
|
+
} else {
|
|
514
|
+
t19 = $[60];
|
|
515
|
+
}
|
|
516
|
+
const t20 = geometry.card ?? style?.borderRadius;
|
|
517
|
+
let t21;
|
|
518
|
+
if ($[61] !== style || $[62] !== t20) {
|
|
519
|
+
t21 = {
|
|
520
|
+
...style,
|
|
521
|
+
borderRadius: t20
|
|
522
|
+
};
|
|
523
|
+
$[61] = style;
|
|
524
|
+
$[62] = t20;
|
|
525
|
+
$[63] = t21;
|
|
526
|
+
} else {
|
|
527
|
+
t21 = $[63];
|
|
528
|
+
}
|
|
529
|
+
let t22;
|
|
530
|
+
if ($[64] !== shared) {
|
|
531
|
+
t22 = shared("card", "card");
|
|
532
|
+
$[64] = shared;
|
|
533
|
+
$[65] = t22;
|
|
534
|
+
} else {
|
|
535
|
+
t22 = $[65];
|
|
536
|
+
}
|
|
537
|
+
let t23;
|
|
538
|
+
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
|
539
|
+
t23 = {
|
|
540
|
+
default: ARC_SPRING_SNAPPY,
|
|
541
|
+
layout: settle
|
|
542
|
+
};
|
|
543
|
+
$[66] = t23;
|
|
544
|
+
} else {
|
|
545
|
+
t23 = $[66];
|
|
546
|
+
}
|
|
547
|
+
let t24;
|
|
548
|
+
if ($[67] !== media || $[68] !== shared) {
|
|
549
|
+
t24 = media ? /* @__PURE__ */ _jsx(motion.div, {
|
|
550
|
+
"data-slot": "card-media",
|
|
551
|
+
className: "relative overflow-hidden bg-surface-muted",
|
|
552
|
+
...shared("media", "card"),
|
|
553
|
+
children: /* @__PURE__ */ _jsx("div", {
|
|
554
|
+
className: "grid min-h-28 place-items-center transition-transform duration-(--duration-considered) ease-(--ease-standard) motion-reduce:transition-none pointer-fine:group-hover/card:scale-[1.04] pointer-fine:group-hover/card:duration-[calc(var(--duration-considered)*2)] motion-reduce:scale-100! [&>img]:size-full [&>img]:object-cover",
|
|
555
|
+
children: media
|
|
556
|
+
})
|
|
557
|
+
}) : null;
|
|
558
|
+
$[67] = media;
|
|
559
|
+
$[68] = shared;
|
|
560
|
+
$[69] = t24;
|
|
561
|
+
} else {
|
|
562
|
+
t24 = $[69];
|
|
563
|
+
}
|
|
564
|
+
let t25;
|
|
565
|
+
if ($[70] !== MotionHeading || $[71] !== hasQuickLook || $[72] !== shared || $[73] !== title) {
|
|
566
|
+
t25 = title !== undefined && title !== null ? /* @__PURE__ */ _jsx(MotionHeading, {
|
|
567
|
+
"data-slot": "card-title",
|
|
568
|
+
className: titleClassName,
|
|
569
|
+
...shared("title", "card"),
|
|
570
|
+
children: hasQuickLook ? /* @__PURE__ */ _jsx(DialogPrimitive.Trigger, {
|
|
571
|
+
asChild: true,
|
|
572
|
+
children: /* @__PURE__ */ _jsx("button", {
|
|
573
|
+
type: "button",
|
|
574
|
+
"data-slot": "card-trigger",
|
|
575
|
+
className: "cursor-pointer border-0 bg-transparent p-0 text-left [font:inherit] [letter-spacing:inherit] text-inherit [-webkit-tap-highlight-color:transparent] after:absolute after:inset-0 after:content-[''] focus-visible:outline-none",
|
|
576
|
+
children: title
|
|
577
|
+
})
|
|
578
|
+
}) : title
|
|
579
|
+
}) : null;
|
|
580
|
+
$[70] = MotionHeading;
|
|
581
|
+
$[71] = hasQuickLook;
|
|
582
|
+
$[72] = shared;
|
|
583
|
+
$[73] = title;
|
|
584
|
+
$[74] = t25;
|
|
585
|
+
} else {
|
|
586
|
+
t25 = $[74];
|
|
587
|
+
}
|
|
588
|
+
let t26;
|
|
589
|
+
if ($[75] !== description || $[76] !== hasDescription || $[77] !== shared) {
|
|
590
|
+
t26 = hasDescription ? /* @__PURE__ */ _jsx(motion.p, {
|
|
591
|
+
ref: descriptionRef,
|
|
592
|
+
"data-slot": "card-description",
|
|
593
|
+
className: descriptionClassName,
|
|
594
|
+
...shared("description", "card", "position"),
|
|
595
|
+
children: description
|
|
596
|
+
}) : null;
|
|
597
|
+
$[75] = description;
|
|
598
|
+
$[76] = hasDescription;
|
|
599
|
+
$[77] = shared;
|
|
600
|
+
$[78] = t26;
|
|
601
|
+
} else {
|
|
602
|
+
t26 = $[78];
|
|
603
|
+
}
|
|
604
|
+
let t27;
|
|
605
|
+
if ($[79] !== children || $[80] !== hasQuickLook) {
|
|
606
|
+
t27 = hasQuickLook && children ? /* @__PURE__ */ _jsx("div", {
|
|
607
|
+
"data-slot": "card-body",
|
|
608
|
+
className: "pointer-events-none relative z-1 [&_:is(a,button,input,select,textarea,label,summary,iframe,video,audio,[tabindex],[contenteditable])]:pointer-events-auto",
|
|
609
|
+
children
|
|
610
|
+
}) : children;
|
|
611
|
+
$[79] = children;
|
|
612
|
+
$[80] = hasQuickLook;
|
|
613
|
+
$[81] = t27;
|
|
614
|
+
} else {
|
|
615
|
+
t27 = $[81];
|
|
616
|
+
}
|
|
617
|
+
let t28;
|
|
618
|
+
if ($[82] !== byline) {
|
|
619
|
+
t28 = byline("card");
|
|
620
|
+
$[82] = byline;
|
|
621
|
+
$[83] = t28;
|
|
622
|
+
} else {
|
|
623
|
+
t28 = $[83];
|
|
624
|
+
}
|
|
625
|
+
let t29;
|
|
626
|
+
if ($[84] !== footerRow || $[85] !== t25 || $[86] !== t26 || $[87] !== t27 || $[88] !== t28) {
|
|
627
|
+
t29 = /* @__PURE__ */ _jsxs("div", {
|
|
628
|
+
"data-slot": "card-content",
|
|
629
|
+
className: "p-(--space-5)",
|
|
630
|
+
children: [
|
|
631
|
+
t25,
|
|
632
|
+
t26,
|
|
633
|
+
t27,
|
|
634
|
+
t28,
|
|
635
|
+
footerRow
|
|
636
|
+
]
|
|
637
|
+
});
|
|
638
|
+
$[84] = footerRow;
|
|
639
|
+
$[85] = t25;
|
|
640
|
+
$[86] = t26;
|
|
641
|
+
$[87] = t27;
|
|
642
|
+
$[88] = t28;
|
|
643
|
+
$[89] = t29;
|
|
644
|
+
} else {
|
|
645
|
+
t29 = $[89];
|
|
646
|
+
}
|
|
647
|
+
let t30;
|
|
648
|
+
if ($[90] !== attachCard || $[91] !== t18 || $[92] !== t19 || $[93] !== t21 || $[94] !== t22 || $[95] !== t24 || $[96] !== t29) {
|
|
649
|
+
t30 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
650
|
+
kind: "card",
|
|
651
|
+
children: /* @__PURE__ */ _jsxs(motion.article, {
|
|
652
|
+
...t18,
|
|
653
|
+
ref: attachCard,
|
|
654
|
+
"data-slot": "card",
|
|
655
|
+
className: t19,
|
|
656
|
+
style: t21,
|
|
657
|
+
...t22,
|
|
658
|
+
transition: t23,
|
|
659
|
+
children: [t24, t29]
|
|
660
|
+
})
|
|
661
|
+
});
|
|
662
|
+
$[90] = attachCard;
|
|
663
|
+
$[91] = t18;
|
|
664
|
+
$[92] = t19;
|
|
665
|
+
$[93] = t21;
|
|
666
|
+
$[94] = t22;
|
|
667
|
+
$[95] = t24;
|
|
668
|
+
$[96] = t29;
|
|
669
|
+
$[97] = t30;
|
|
670
|
+
} else {
|
|
671
|
+
t30 = $[97];
|
|
672
|
+
}
|
|
673
|
+
const card = t30;
|
|
674
|
+
if (!hasQuickLook) {
|
|
675
|
+
return card;
|
|
676
|
+
}
|
|
677
|
+
const t31 = geometry.measure ? `${geometry.measure}px` : undefined;
|
|
678
|
+
let t32;
|
|
679
|
+
if ($[98] !== isReturning || $[99] !== landing) {
|
|
680
|
+
t32 = landing && isReturning ? {
|
|
681
|
+
"--landing-top": `${landing.top}px`,
|
|
682
|
+
"--landing-left": `${landing.left}px`,
|
|
683
|
+
"--landing-width": `${landing.width}px`,
|
|
684
|
+
"--landing-height": `${landing.height}px`
|
|
685
|
+
} : {};
|
|
686
|
+
$[98] = isReturning;
|
|
687
|
+
$[99] = landing;
|
|
688
|
+
$[100] = t32;
|
|
689
|
+
} else {
|
|
690
|
+
t32 = $[100];
|
|
691
|
+
}
|
|
692
|
+
let t33;
|
|
693
|
+
if ($[101] !== geometry.panel || $[102] !== t31 || $[103] !== t32) {
|
|
694
|
+
t33 = {
|
|
695
|
+
borderRadius: geometry.panel,
|
|
696
|
+
"--card-measure": t31,
|
|
697
|
+
...t32
|
|
698
|
+
};
|
|
699
|
+
$[101] = geometry.panel;
|
|
700
|
+
$[102] = t31;
|
|
701
|
+
$[103] = t32;
|
|
702
|
+
$[104] = t33;
|
|
703
|
+
} else {
|
|
704
|
+
t33 = $[104];
|
|
705
|
+
}
|
|
706
|
+
const panelStyle = t33;
|
|
707
|
+
let t34;
|
|
708
|
+
if ($[105] !== byline || $[106] !== description || $[107] !== details || $[108] !== geometry.card || $[109] !== geometry.panel || $[110] !== hasDescription || $[111] !== isOpen || $[112] !== isReturning || $[113] !== layoutGroupId || $[114] !== media || $[115] !== panelStyle || $[116] !== reduceMotion || $[117] !== shared || $[118] !== shouldMorph || $[119] !== title) {
|
|
709
|
+
t34 = isOpen || isReturning ? /* @__PURE__ */ _jsxs(DialogPrimitive.Portal, {
|
|
710
|
+
forceMount: true,
|
|
711
|
+
children: [/* @__PURE__ */ _jsx(AnimatePresence, { children: isOpen ? /* @__PURE__ */ _jsx(DialogPrimitive.Overlay, {
|
|
712
|
+
asChild: true,
|
|
713
|
+
forceMount: true,
|
|
714
|
+
children: /* @__PURE__ */ _jsx(motion.div, {
|
|
715
|
+
"data-slot": "card-quick-look-overlay",
|
|
716
|
+
className: "fixed inset-0 z-50 bg-[oklch(10%_0_0/0.46)] supports-backdrop-filter:backdrop-blur-[7px]",
|
|
717
|
+
initial: { opacity: 0 },
|
|
718
|
+
animate: { opacity: 1 },
|
|
719
|
+
exit: {
|
|
720
|
+
opacity: 0,
|
|
721
|
+
transition: reduceMotion ? fade : {
|
|
722
|
+
duration: ARC_DURATION.exit,
|
|
723
|
+
ease: [...ARC_EASE.standard]
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
transition: reduceMotion ? fade : {
|
|
727
|
+
duration: ARC_DURATION.standard,
|
|
728
|
+
ease: [...ARC_EASE.enter]
|
|
729
|
+
}
|
|
730
|
+
})
|
|
731
|
+
}, "overlay") : null }), /* @__PURE__ */ _jsx(DialogPrimitive.Content, {
|
|
732
|
+
asChild: true,
|
|
733
|
+
forceMount: true,
|
|
734
|
+
...hasDescription ? {} : { "aria-describedby": undefined },
|
|
735
|
+
children: /* @__PURE__ */ _jsxs(motion.div, {
|
|
736
|
+
ref: quickLookRef,
|
|
737
|
+
"data-slot": "card-quick-look",
|
|
738
|
+
"data-returning": isReturning || undefined,
|
|
739
|
+
className: "group/quick-look fixed inset-0 z-50 m-auto h-fit max-h-[calc(100dvh-var(--space-8))] w-[min(calc(100vw-var(--space-8)),30rem)] overflow-x-hidden overflow-y-auto overscroll-contain rounded-(--radius-surface) border border-border bg-surface-raised text-sm text-foreground shadow-(--shadow-floating) transition-[background-color,box-shadow] duration-(--duration-standard) ease-(--ease-standard) focus:outline-none data-returning:pointer-events-none data-returning:inset-auto data-returning:top-(--landing-top) data-returning:left-(--landing-left) data-returning:m-0 data-returning:h-(--landing-height) data-returning:max-h-none data-returning:w-(--landing-width) data-returning:overflow-hidden data-returning:bg-surface data-returning:shadow-none",
|
|
740
|
+
"data-framer-portal-id": layoutGroupId,
|
|
741
|
+
layoutScroll: true,
|
|
742
|
+
style: panelStyle,
|
|
743
|
+
...shouldMorph ? {
|
|
744
|
+
...shared("card", "panel"),
|
|
745
|
+
initial: false,
|
|
746
|
+
animate: geometry.card !== undefined && geometry.panel !== undefined ? { borderRadius: isReturning ? geometry.card : geometry.panel } : undefined,
|
|
747
|
+
transition: {
|
|
748
|
+
layout: isReturning ? settle : grow,
|
|
749
|
+
borderRadius: isReturning ? settle : grow
|
|
750
|
+
},
|
|
751
|
+
exit: {
|
|
752
|
+
opacity: 0,
|
|
753
|
+
transition: { duration: 0 }
|
|
754
|
+
}
|
|
755
|
+
} : {
|
|
756
|
+
initial: { opacity: 0 },
|
|
757
|
+
animate: { opacity: 1 },
|
|
758
|
+
exit: {
|
|
759
|
+
opacity: 0,
|
|
760
|
+
transition: fade
|
|
761
|
+
},
|
|
762
|
+
transition: fade
|
|
763
|
+
},
|
|
764
|
+
children: [
|
|
765
|
+
media ? /* @__PURE__ */ _jsx(motion.div, {
|
|
766
|
+
className: "relative overflow-hidden bg-surface-muted",
|
|
767
|
+
...shared("media", "panel"),
|
|
768
|
+
children: /* @__PURE__ */ _jsx("div", {
|
|
769
|
+
className: "grid min-h-28 place-items-center [&>img]:size-full [&>img]:object-cover",
|
|
770
|
+
children: media
|
|
771
|
+
})
|
|
772
|
+
}) : null,
|
|
773
|
+
/* @__PURE__ */ _jsx(motion.span, {
|
|
774
|
+
className: "absolute top-(--space-4) right-(--space-4) z-2 grid",
|
|
775
|
+
initial: reduceMotion ? { opacity: 0 } : {
|
|
776
|
+
opacity: 0,
|
|
777
|
+
scale: CARD_CLOSE_HIDDEN_SCALE
|
|
778
|
+
},
|
|
779
|
+
animate: isReturning ? {
|
|
780
|
+
opacity: 0,
|
|
781
|
+
scale: CARD_CLOSE_HIDDEN_SCALE
|
|
782
|
+
} : {
|
|
783
|
+
opacity: 1,
|
|
784
|
+
scale: 1
|
|
785
|
+
},
|
|
786
|
+
transition: isReturning || reduceMotion ? fade : closeIn,
|
|
787
|
+
children: /* @__PURE__ */ _jsx(DialogPrimitive.Close, {
|
|
788
|
+
asChild: true,
|
|
789
|
+
children: /* @__PURE__ */ _jsx(motion.button, {
|
|
790
|
+
type: "button",
|
|
791
|
+
"data-slot": "card-quick-look-close",
|
|
792
|
+
"aria-label": CARD_CLOSE_LABEL,
|
|
793
|
+
className: "grid size-(--space-8) cursor-pointer place-items-center rounded-(--radius-pill) border border-[color-mix(in_oklab,var(--border)_70%,transparent)] bg-[color-mix(in_oklab,var(--surface-raised)_74%,transparent)] p-0 text-foreground [-webkit-tap-highlight-color:transparent] backdrop-blur-[12px] transition-[background-color] duration-(--duration-fast) ease-(--ease-standard) hover-fine:bg-surface-raised",
|
|
794
|
+
whileTap: reduceMotion ? undefined : { scale: CARD_CLOSE_PRESS_SCALE },
|
|
795
|
+
transition: ARC_SPRING_SNAPPY,
|
|
796
|
+
children: /* @__PURE__ */ _jsx(X, {
|
|
797
|
+
className: "size-4",
|
|
798
|
+
strokeWidth: 1.75,
|
|
799
|
+
"aria-hidden": "true"
|
|
800
|
+
})
|
|
801
|
+
})
|
|
802
|
+
})
|
|
803
|
+
}),
|
|
804
|
+
/* @__PURE__ */ _jsxs("div", {
|
|
805
|
+
className: "p-(--space-6) group-data-returning/quick-look:p-(--space-5)",
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ _jsx(DialogPrimitive.Title, {
|
|
808
|
+
asChild: true,
|
|
809
|
+
children: /* @__PURE__ */ _jsx(motion.h2, {
|
|
810
|
+
className: cn(titleClassName, "text-xl group-data-returning/quick-look:text-lg"),
|
|
811
|
+
...shared("title", "panel"),
|
|
812
|
+
children: title
|
|
813
|
+
})
|
|
814
|
+
}),
|
|
815
|
+
hasDescription ? /* @__PURE__ */ _jsx(DialogPrimitive.Description, {
|
|
816
|
+
asChild: true,
|
|
817
|
+
children: /* @__PURE__ */ _jsx(motion.p, {
|
|
818
|
+
className: cn(descriptionClassName, "max-w-[var(--card-measure,34ch)]"),
|
|
819
|
+
...shared("description", "panel", "position"),
|
|
820
|
+
children: description
|
|
821
|
+
})
|
|
822
|
+
}) : null,
|
|
823
|
+
byline("panel"),
|
|
824
|
+
/* @__PURE__ */ _jsx(motion.div, {
|
|
825
|
+
"data-slot": "card-details",
|
|
826
|
+
className: "mt-(--space-6) border-t border-border pt-(--space-5) text-sm leading-(--leading-body) text-text-secondary",
|
|
827
|
+
initial: reduceMotion ? false : {
|
|
828
|
+
opacity: 0,
|
|
829
|
+
y: CARD_DETAILS_OFFSET_PX
|
|
830
|
+
},
|
|
831
|
+
animate: isReturning ? {
|
|
832
|
+
opacity: 0,
|
|
833
|
+
y: 0
|
|
834
|
+
} : {
|
|
835
|
+
opacity: 1,
|
|
836
|
+
y: 0
|
|
837
|
+
},
|
|
838
|
+
exit: {
|
|
839
|
+
opacity: 0,
|
|
840
|
+
transition: fade
|
|
841
|
+
},
|
|
842
|
+
transition: isReturning || reduceMotion ? fade : reveal,
|
|
843
|
+
children: details
|
|
844
|
+
})
|
|
845
|
+
]
|
|
846
|
+
})
|
|
847
|
+
]
|
|
848
|
+
})
|
|
849
|
+
})]
|
|
850
|
+
}, "quick-look") : null;
|
|
851
|
+
$[105] = byline;
|
|
852
|
+
$[106] = description;
|
|
853
|
+
$[107] = details;
|
|
854
|
+
$[108] = geometry.card;
|
|
855
|
+
$[109] = geometry.panel;
|
|
856
|
+
$[110] = hasDescription;
|
|
857
|
+
$[111] = isOpen;
|
|
858
|
+
$[112] = isReturning;
|
|
859
|
+
$[113] = layoutGroupId;
|
|
860
|
+
$[114] = media;
|
|
861
|
+
$[115] = panelStyle;
|
|
862
|
+
$[116] = reduceMotion;
|
|
863
|
+
$[117] = shared;
|
|
864
|
+
$[118] = shouldMorph;
|
|
865
|
+
$[119] = title;
|
|
866
|
+
$[120] = t34;
|
|
867
|
+
} else {
|
|
868
|
+
t34 = $[120];
|
|
869
|
+
}
|
|
870
|
+
let t35;
|
|
871
|
+
if ($[121] !== t34) {
|
|
872
|
+
t35 = /* @__PURE__ */ _jsx(AnimatePresence, { children: t34 });
|
|
873
|
+
$[121] = t34;
|
|
874
|
+
$[122] = t35;
|
|
875
|
+
} else {
|
|
876
|
+
t35 = $[122];
|
|
877
|
+
}
|
|
878
|
+
let t36;
|
|
879
|
+
if ($[123] !== card || $[124] !== layoutGroupId || $[125] !== t35) {
|
|
880
|
+
t36 = /* @__PURE__ */ _jsxs(LayoutGroup, {
|
|
881
|
+
id: layoutGroupId,
|
|
882
|
+
children: [card, t35]
|
|
883
|
+
});
|
|
884
|
+
$[123] = card;
|
|
885
|
+
$[124] = layoutGroupId;
|
|
886
|
+
$[125] = t35;
|
|
887
|
+
$[126] = t36;
|
|
888
|
+
} else {
|
|
889
|
+
t36 = $[126];
|
|
890
|
+
}
|
|
891
|
+
let t37;
|
|
892
|
+
if ($[127] !== isOpen || $[128] !== setOpen || $[129] !== t36) {
|
|
893
|
+
t37 = /* @__PURE__ */ _jsx(DialogPrimitive.Root, {
|
|
894
|
+
open: isOpen,
|
|
895
|
+
onOpenChange: setOpen,
|
|
896
|
+
children: t36
|
|
897
|
+
});
|
|
898
|
+
$[127] = isOpen;
|
|
899
|
+
$[128] = setOpen;
|
|
900
|
+
$[129] = t36;
|
|
901
|
+
$[130] = t37;
|
|
902
|
+
} else {
|
|
903
|
+
t37 = $[130];
|
|
904
|
+
}
|
|
905
|
+
return t37;
|
|
83
906
|
}
|
|
84
|
-
export { Card
|
|
907
|
+
export { Card };
|