beez-ui 2.7.1 → 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 +72 -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 +1 -1
- 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/alert.js
CHANGED
|
@@ -3,21 +3,20 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
3
3
|
/**
|
|
4
4
|
* Arc's Alert (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a persistent message that helps people
|
|
5
5
|
* recover or continue, on Arc's surface with a resting shadow. A `tone` tints and picks its icon, which morphs in
|
|
6
|
-
* place when the tone changes
|
|
7
|
-
* fades, so the content below closes the gap.
|
|
6
|
+
* place when the tone changes, and a new title or string detail rises in over the old one. `onDismiss` adds a dismiss
|
|
7
|
+
* button and `open` collapses the alert's height while it fades, so the content below closes the gap.
|
|
8
8
|
*/
|
|
9
9
|
import { useRef, useState } from "react";
|
|
10
|
-
import { cva } from "class-variance-authority";
|
|
11
10
|
import { AnimatePresence, motion, useIsPresent } from "motion/react";
|
|
12
11
|
import { Check, CircleX, Info, TriangleAlert, X } from "lucide-react";
|
|
13
|
-
import { ALERT_DISMISS_LABEL, ALERT_TONE_ROLE } from "../constants/alert.js";
|
|
12
|
+
import { ALERT_DISMISS_LABEL, ALERT_DISMISS_LABEL_SEPARATOR, ALERT_TEXT_OFFSET_EM, ALERT_TONE_ROLE } from "../constants/alert.js";
|
|
14
13
|
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
15
14
|
import { cn } from "../lib/utils.js";
|
|
16
|
-
import { ARC_DURATION, ARC_EASE, ARC_SPRING_SMOOTH } from "../motion/arc-tokens.js";
|
|
15
|
+
import { ARC_BLUR, ARC_DURATION, ARC_EASE, ARC_SPRING_SMOOTH } from "../motion/arc-tokens.js";
|
|
17
16
|
import { ARC_ICON_ENTER, ARC_ICON_EXIT, ARC_ICON_TRANSITION, ARC_REDUCED_EXIT, ARC_REDUCED_TRANSITION, ARC_SWAP_EXIT_TRANSITION, ARC_SWAP_REST } from "../motion/arc-swap.js";
|
|
18
17
|
import { MotionSlot } from "../motion/motion-slot.js";
|
|
19
18
|
import { useAttachedElement } from "../motion/use-attached-element.js";
|
|
20
|
-
import { jsx as _jsx,
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
20
|
/** The icon each tone shows unless `icon` replaces it. */
|
|
22
21
|
const TONE_ICON = {
|
|
23
22
|
info: Info,
|
|
@@ -25,26 +24,30 @@ const TONE_ICON = {
|
|
|
25
24
|
warning: TriangleAlert,
|
|
26
25
|
danger: CircleX
|
|
27
26
|
};
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
default: "",
|
|
36
|
-
destructive: "[--alert-color:var(--danger)] *:data-[slot=alert-title]:text-danger"
|
|
37
|
-
},
|
|
38
|
-
tone: {
|
|
39
|
-
info: "[--alert-color:var(--accent)]",
|
|
40
|
-
success: "[--alert-color:var(--success)]",
|
|
41
|
-
warning: "[--alert-color:var(--warning)]",
|
|
42
|
-
danger: "[--alert-color:var(--danger)]"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
defaultVariants: { variant: "default" }
|
|
46
|
-
});
|
|
27
|
+
/** Colour of the icon for each tone. */
|
|
28
|
+
const TONE_ICON_CLASS_NAME = {
|
|
29
|
+
info: "text-(--accent)",
|
|
30
|
+
success: "text-success",
|
|
31
|
+
warning: "text-warning",
|
|
32
|
+
danger: "text-danger"
|
|
33
|
+
};
|
|
47
34
|
const reducedEnter = { opacity: 0 };
|
|
35
|
+
/** A new title or detail rises out of a soft blur; the old one lifts away faster. */
|
|
36
|
+
const textEnter = {
|
|
37
|
+
opacity: 0,
|
|
38
|
+
y: `${ALERT_TEXT_OFFSET_EM}em`,
|
|
39
|
+
filter: `blur(${ARC_BLUR.soft}px)`
|
|
40
|
+
};
|
|
41
|
+
const textExit = {
|
|
42
|
+
opacity: 0,
|
|
43
|
+
y: `${-ALERT_TEXT_OFFSET_EM}em`,
|
|
44
|
+
filter: `blur(${ARC_BLUR.subtle}px)`,
|
|
45
|
+
transition: ARC_SWAP_EXIT_TRANSITION
|
|
46
|
+
};
|
|
47
|
+
const textTransition = {
|
|
48
|
+
duration: ARC_DURATION.standard,
|
|
49
|
+
ease: [...ARC_EASE.enter]
|
|
50
|
+
};
|
|
48
51
|
const presenceTransition = {
|
|
49
52
|
height: ARC_SPRING_SMOOTH,
|
|
50
53
|
opacity: {
|
|
@@ -90,8 +93,8 @@ function toInlineStyleValue(value, unit = "") {
|
|
|
90
93
|
if (value === undefined) return "";
|
|
91
94
|
return typeof value === "number" ? `${value}${unit}` : value;
|
|
92
95
|
}
|
|
93
|
-
/** Outgoing
|
|
94
|
-
function
|
|
96
|
+
/** Outgoing copies are hidden from assistive technology while they fade, so the live region reads only the current one. */
|
|
97
|
+
function AlertSwap(props) {
|
|
95
98
|
const $ = _c(3);
|
|
96
99
|
const isPresent = useIsPresent();
|
|
97
100
|
const t0 = isPresent ? props["aria-hidden"] : true;
|
|
@@ -109,110 +112,161 @@ function AlertIconSwap(props) {
|
|
|
109
112
|
}
|
|
110
113
|
return t1;
|
|
111
114
|
}
|
|
112
|
-
/**
|
|
113
|
-
function
|
|
114
|
-
const $ = _c(
|
|
115
|
-
const {
|
|
116
|
-
const t1 = reduceMotion ? reducedEnter :
|
|
117
|
-
const t2 = reduceMotion ? ARC_REDUCED_EXIT :
|
|
118
|
-
const t3 = reduceMotion ? ARC_REDUCED_TRANSITION :
|
|
115
|
+
/** A line of copy that rises in over the previous one when it changes. */
|
|
116
|
+
function AlertText(t0) {
|
|
117
|
+
const $ = _c(5);
|
|
118
|
+
const { text, reduceMotion } = t0;
|
|
119
|
+
const t1 = reduceMotion ? reducedEnter : textEnter;
|
|
120
|
+
const t2 = reduceMotion ? ARC_REDUCED_EXIT : textExit;
|
|
121
|
+
const t3 = reduceMotion ? ARC_REDUCED_TRANSITION : textTransition;
|
|
119
122
|
let t4;
|
|
120
|
-
if ($[0] !==
|
|
121
|
-
t4 = /* @__PURE__ */ _jsx(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
exit: t2,
|
|
133
|
-
transition: t3,
|
|
134
|
-
children: icon
|
|
135
|
-
}, iconKey)
|
|
136
|
-
})
|
|
123
|
+
if ($[0] !== t1 || $[1] !== t2 || $[2] !== t3 || $[3] !== text) {
|
|
124
|
+
t4 = /* @__PURE__ */ _jsx(AnimatePresence, {
|
|
125
|
+
mode: "popLayout",
|
|
126
|
+
initial: false,
|
|
127
|
+
children: /* @__PURE__ */ _jsx(AlertSwap, {
|
|
128
|
+
className: "relative block",
|
|
129
|
+
initial: t1,
|
|
130
|
+
animate: ARC_SWAP_REST,
|
|
131
|
+
exit: t2,
|
|
132
|
+
transition: t3,
|
|
133
|
+
children: text
|
|
134
|
+
}, text)
|
|
137
135
|
});
|
|
138
|
-
$[0] =
|
|
139
|
-
$[1] =
|
|
140
|
-
$[2] =
|
|
141
|
-
$[3] =
|
|
136
|
+
$[0] = t1;
|
|
137
|
+
$[1] = t2;
|
|
138
|
+
$[2] = t3;
|
|
139
|
+
$[3] = text;
|
|
140
|
+
$[4] = t4;
|
|
141
|
+
} else {
|
|
142
|
+
t4 = $[4];
|
|
143
|
+
}
|
|
144
|
+
return t4;
|
|
145
|
+
}
|
|
146
|
+
/** The tone icon: a new tone morphs its icon in place. */
|
|
147
|
+
function AlertIcon(t0) {
|
|
148
|
+
const $ = _c(11);
|
|
149
|
+
const { icon, iconKey, tone, reduceMotion } = t0;
|
|
150
|
+
const t1 = TONE_ICON_CLASS_NAME[tone];
|
|
151
|
+
let t2;
|
|
152
|
+
if ($[0] !== t1) {
|
|
153
|
+
t2 = cn("relative mt-px grid size-[18px] flex-none place-items-center [&_svg]:block [&_svg:not([class*='size-'])]:size-[18px]", t1);
|
|
154
|
+
$[0] = t1;
|
|
155
|
+
$[1] = t2;
|
|
156
|
+
} else {
|
|
157
|
+
t2 = $[1];
|
|
158
|
+
}
|
|
159
|
+
const t3 = reduceMotion ? reducedEnter : ARC_ICON_ENTER;
|
|
160
|
+
const t4 = reduceMotion ? ARC_REDUCED_EXIT : ARC_ICON_EXIT;
|
|
161
|
+
const t5 = reduceMotion ? ARC_REDUCED_TRANSITION : ARC_ICON_TRANSITION;
|
|
162
|
+
let t6;
|
|
163
|
+
if ($[2] !== icon || $[3] !== iconKey || $[4] !== t3 || $[5] !== t4 || $[6] !== t5) {
|
|
164
|
+
t6 = /* @__PURE__ */ _jsx(AnimatePresence, {
|
|
165
|
+
mode: "popLayout",
|
|
166
|
+
initial: false,
|
|
167
|
+
children: /* @__PURE__ */ _jsx(AlertSwap, {
|
|
168
|
+
className: "relative grid place-items-center",
|
|
169
|
+
initial: t3,
|
|
170
|
+
animate: ARC_SWAP_REST,
|
|
171
|
+
exit: t4,
|
|
172
|
+
transition: t5,
|
|
173
|
+
children: icon
|
|
174
|
+
}, iconKey)
|
|
175
|
+
});
|
|
176
|
+
$[2] = icon;
|
|
177
|
+
$[3] = iconKey;
|
|
142
178
|
$[4] = t3;
|
|
143
179
|
$[5] = t4;
|
|
180
|
+
$[6] = t5;
|
|
181
|
+
$[7] = t6;
|
|
144
182
|
} else {
|
|
145
|
-
|
|
183
|
+
t6 = $[7];
|
|
146
184
|
}
|
|
147
|
-
|
|
185
|
+
let t7;
|
|
186
|
+
if ($[8] !== t2 || $[9] !== t6) {
|
|
187
|
+
t7 = /* @__PURE__ */ _jsx("span", {
|
|
188
|
+
"data-slot": "alert-icon",
|
|
189
|
+
"aria-hidden": "true",
|
|
190
|
+
className: t2,
|
|
191
|
+
children: t6
|
|
192
|
+
});
|
|
193
|
+
$[8] = t2;
|
|
194
|
+
$[9] = t6;
|
|
195
|
+
$[10] = t7;
|
|
196
|
+
} else {
|
|
197
|
+
t7 = $[10];
|
|
198
|
+
}
|
|
199
|
+
return t7;
|
|
148
200
|
}
|
|
201
|
+
/** Arc's alert surface: icon, copy column, optional action and dismiss button in one row. */
|
|
202
|
+
const alertClassName = "group/alert relative flex w-full min-w-0 items-start gap-(--space-3) rounded-(--radius-control) border border-border bg-surface p-(--space-4) text-left text-sm text-foreground shadow-(--shadow-resting)";
|
|
149
203
|
/** The alert surface itself. */
|
|
150
204
|
function AlertBox(t0) {
|
|
151
|
-
const $ = _c(
|
|
205
|
+
const $ = _c(60);
|
|
206
|
+
let action;
|
|
152
207
|
let children;
|
|
153
208
|
let className;
|
|
209
|
+
let dismissLabel;
|
|
154
210
|
let icon;
|
|
155
211
|
let onDismiss;
|
|
156
212
|
let presence;
|
|
157
213
|
let props;
|
|
158
214
|
let reduceMotion;
|
|
159
215
|
let t1;
|
|
160
|
-
let
|
|
161
|
-
let variant;
|
|
216
|
+
let title;
|
|
162
217
|
if ($[0] !== t0) {
|
|
163
|
-
({className,
|
|
218
|
+
({className, title, tone: t1, icon, action, onDismiss, dismissLabel, reduceMotion, presence, children, ...props} = t0);
|
|
164
219
|
$[0] = t0;
|
|
165
|
-
$[1] =
|
|
166
|
-
$[2] =
|
|
167
|
-
$[3] =
|
|
168
|
-
$[4] =
|
|
169
|
-
$[5] =
|
|
170
|
-
$[6] =
|
|
171
|
-
$[7] =
|
|
172
|
-
$[8] =
|
|
173
|
-
$[9] =
|
|
174
|
-
$[10] =
|
|
220
|
+
$[1] = action;
|
|
221
|
+
$[2] = children;
|
|
222
|
+
$[3] = className;
|
|
223
|
+
$[4] = dismissLabel;
|
|
224
|
+
$[5] = icon;
|
|
225
|
+
$[6] = onDismiss;
|
|
226
|
+
$[7] = presence;
|
|
227
|
+
$[8] = props;
|
|
228
|
+
$[9] = reduceMotion;
|
|
229
|
+
$[10] = t1;
|
|
230
|
+
$[11] = title;
|
|
175
231
|
} else {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
232
|
+
action = $[1];
|
|
233
|
+
children = $[2];
|
|
234
|
+
className = $[3];
|
|
235
|
+
dismissLabel = $[4];
|
|
236
|
+
icon = $[5];
|
|
237
|
+
onDismiss = $[6];
|
|
238
|
+
presence = $[7];
|
|
239
|
+
props = $[8];
|
|
240
|
+
reduceMotion = $[9];
|
|
241
|
+
t1 = $[10];
|
|
242
|
+
title = $[11];
|
|
186
243
|
}
|
|
187
|
-
const
|
|
244
|
+
const tone = t1 === undefined ? "info" : t1;
|
|
188
245
|
const isPresent = useIsPresent();
|
|
189
|
-
const ToneIcon =
|
|
246
|
+
const ToneIcon = TONE_ICON[tone];
|
|
190
247
|
let t2;
|
|
191
|
-
if ($[
|
|
192
|
-
t2 = icon === false ? null : icon ??
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
248
|
+
if ($[12] !== ToneIcon || $[13] !== icon) {
|
|
249
|
+
t2 = icon === false ? null : icon ?? /* @__PURE__ */ _jsx(ToneIcon, { "aria-hidden": "true" });
|
|
250
|
+
$[12] = ToneIcon;
|
|
251
|
+
$[13] = icon;
|
|
252
|
+
$[14] = t2;
|
|
196
253
|
} else {
|
|
197
|
-
t2 = $[
|
|
254
|
+
t2 = $[14];
|
|
198
255
|
}
|
|
199
256
|
const resolvedIcon = t2;
|
|
200
|
-
const
|
|
257
|
+
const details = typeof children === "string" || typeof children === "number" ? String(children) : null;
|
|
258
|
+
const hasDetails = children !== undefined && children !== null && children !== false && children !== "";
|
|
259
|
+
const t3 = ALERT_TONE_ROLE[tone];
|
|
201
260
|
let t4;
|
|
202
|
-
if ($[
|
|
203
|
-
t4 = cn(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}), className);
|
|
207
|
-
$[14] = className;
|
|
208
|
-
$[15] = tone;
|
|
209
|
-
$[16] = variant;
|
|
210
|
-
$[17] = t4;
|
|
261
|
+
if ($[15] !== className) {
|
|
262
|
+
t4 = cn(alertClassName, className);
|
|
263
|
+
$[15] = className;
|
|
264
|
+
$[16] = t4;
|
|
211
265
|
} else {
|
|
212
|
-
t4 = $[
|
|
266
|
+
t4 = $[16];
|
|
213
267
|
}
|
|
214
268
|
let t5;
|
|
215
|
-
if ($[
|
|
269
|
+
if ($[17] !== props || $[18] !== t3 || $[19] !== t4 || $[20] !== tone) {
|
|
216
270
|
t5 = {
|
|
217
271
|
"data-slot": "alert",
|
|
218
272
|
"data-tone": tone,
|
|
@@ -220,109 +274,182 @@ function AlertBox(t0) {
|
|
|
220
274
|
className: t4,
|
|
221
275
|
...props
|
|
222
276
|
};
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
277
|
+
$[17] = props;
|
|
278
|
+
$[18] = t3;
|
|
279
|
+
$[19] = t4;
|
|
280
|
+
$[20] = tone;
|
|
281
|
+
$[21] = t5;
|
|
228
282
|
} else {
|
|
229
|
-
t5 = $[
|
|
283
|
+
t5 = $[21];
|
|
230
284
|
}
|
|
231
285
|
const rootProps = t5;
|
|
232
286
|
let t6;
|
|
233
|
-
if ($[
|
|
287
|
+
if ($[22] !== icon || $[23] !== reduceMotion || $[24] !== resolvedIcon || $[25] !== tone) {
|
|
234
288
|
t6 = resolvedIcon ? /* @__PURE__ */ _jsx(AlertIcon, {
|
|
235
289
|
icon: resolvedIcon,
|
|
236
|
-
iconKey: icon ? "custom" : tone
|
|
290
|
+
iconKey: icon ? "custom" : tone,
|
|
291
|
+
tone,
|
|
237
292
|
reduceMotion
|
|
238
293
|
}) : null;
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
294
|
+
$[22] = icon;
|
|
295
|
+
$[23] = reduceMotion;
|
|
296
|
+
$[24] = resolvedIcon;
|
|
297
|
+
$[25] = tone;
|
|
298
|
+
$[26] = t6;
|
|
244
299
|
} else {
|
|
245
|
-
t6 = $[
|
|
300
|
+
t6 = $[26];
|
|
246
301
|
}
|
|
247
302
|
let t7;
|
|
248
|
-
if ($[
|
|
249
|
-
t7 =
|
|
303
|
+
if ($[27] !== reduceMotion || $[28] !== title) {
|
|
304
|
+
t7 = /* @__PURE__ */ _jsx("strong", {
|
|
305
|
+
"data-slot": "alert-title",
|
|
306
|
+
className: "relative block text-sm font-medium",
|
|
307
|
+
children: /* @__PURE__ */ _jsx(AlertText, {
|
|
308
|
+
text: title,
|
|
309
|
+
reduceMotion
|
|
310
|
+
})
|
|
311
|
+
});
|
|
312
|
+
$[27] = reduceMotion;
|
|
313
|
+
$[28] = title;
|
|
314
|
+
$[29] = t7;
|
|
315
|
+
} else {
|
|
316
|
+
t7 = $[29];
|
|
317
|
+
}
|
|
318
|
+
let t8;
|
|
319
|
+
if ($[30] !== children || $[31] !== details || $[32] !== hasDetails || $[33] !== reduceMotion) {
|
|
320
|
+
t8 = hasDetails ? /* @__PURE__ */ _jsx("div", {
|
|
321
|
+
"data-slot": "alert-description",
|
|
322
|
+
className: "relative text-xs leading-(--leading-body) text-pretty text-text-secondary [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover-fine:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
323
|
+
children: details === null ? children : /* @__PURE__ */ _jsx(AlertText, {
|
|
324
|
+
text: details,
|
|
325
|
+
reduceMotion
|
|
326
|
+
})
|
|
327
|
+
}) : null;
|
|
328
|
+
$[30] = children;
|
|
329
|
+
$[31] = details;
|
|
330
|
+
$[32] = hasDetails;
|
|
331
|
+
$[33] = reduceMotion;
|
|
332
|
+
$[34] = t8;
|
|
333
|
+
} else {
|
|
334
|
+
t8 = $[34];
|
|
335
|
+
}
|
|
336
|
+
let t9;
|
|
337
|
+
if ($[35] !== t7 || $[36] !== t8) {
|
|
338
|
+
t9 = /* @__PURE__ */ _jsxs("div", {
|
|
339
|
+
"data-slot": "alert-copy",
|
|
340
|
+
className: "grid min-w-0 flex-[1_1_8rem] gap-(--space-1)",
|
|
341
|
+
children: [t7, t8]
|
|
342
|
+
});
|
|
343
|
+
$[35] = t7;
|
|
344
|
+
$[36] = t8;
|
|
345
|
+
$[37] = t9;
|
|
346
|
+
} else {
|
|
347
|
+
t9 = $[37];
|
|
348
|
+
}
|
|
349
|
+
let t10;
|
|
350
|
+
if ($[38] !== action) {
|
|
351
|
+
t10 = action ? /* @__PURE__ */ _jsx("div", {
|
|
352
|
+
"data-slot": "alert-action",
|
|
353
|
+
className: "flex flex-none flex-wrap items-center gap-(--space-2) self-start",
|
|
354
|
+
children: action
|
|
355
|
+
}) : null;
|
|
356
|
+
$[38] = action;
|
|
357
|
+
$[39] = t10;
|
|
358
|
+
} else {
|
|
359
|
+
t10 = $[39];
|
|
360
|
+
}
|
|
361
|
+
let t11;
|
|
362
|
+
if ($[40] !== t10 || $[41] !== t9) {
|
|
363
|
+
t11 = /* @__PURE__ */ _jsxs("div", {
|
|
364
|
+
className: "flex min-w-0 flex-1 flex-wrap items-start gap-(--space-3)",
|
|
365
|
+
children: [t9, t10]
|
|
366
|
+
});
|
|
367
|
+
$[40] = t10;
|
|
368
|
+
$[41] = t9;
|
|
369
|
+
$[42] = t11;
|
|
370
|
+
} else {
|
|
371
|
+
t11 = $[42];
|
|
372
|
+
}
|
|
373
|
+
let t12;
|
|
374
|
+
if ($[43] !== dismissLabel || $[44] !== onDismiss || $[45] !== title) {
|
|
375
|
+
t12 = onDismiss ? /* @__PURE__ */ _jsx("button", {
|
|
250
376
|
type: "button",
|
|
251
377
|
"data-slot": "alert-dismiss",
|
|
252
|
-
"aria-label": dismissLabel
|
|
378
|
+
"aria-label": dismissLabel ?? `${ALERT_DISMISS_LABEL}${ALERT_DISMISS_LABEL_SEPARATOR}${title}`,
|
|
253
379
|
onClick: onDismiss,
|
|
254
|
-
className: "
|
|
380
|
+
className: "-my-[5px] -mr-1.5 grid size-7 flex-none cursor-pointer place-items-center rounded-(--radius-pill) border-0 bg-transparent text-text-muted [-webkit-tap-highlight-color:transparent] transition-[scale,background-color,color] duration-(--duration-fast) ease-(--ease-standard) hover-fine:bg-surface-muted hover-fine:text-foreground active:scale-[.96] motion-reduce:transition-none motion-reduce:active:scale-100",
|
|
255
381
|
children: /* @__PURE__ */ _jsx(X, {
|
|
256
382
|
className: "size-4",
|
|
257
383
|
strokeWidth: 1.75,
|
|
258
384
|
"aria-hidden": "true"
|
|
259
385
|
})
|
|
260
386
|
}) : null;
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
387
|
+
$[43] = dismissLabel;
|
|
388
|
+
$[44] = onDismiss;
|
|
389
|
+
$[45] = title;
|
|
390
|
+
$[46] = t12;
|
|
264
391
|
} else {
|
|
265
|
-
|
|
392
|
+
t12 = $[46];
|
|
266
393
|
}
|
|
267
|
-
let
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
394
|
+
let t13;
|
|
395
|
+
if ($[47] !== t11 || $[48] !== t12 || $[49] !== t6) {
|
|
396
|
+
t13 = /* @__PURE__ */ _jsxs(_Fragment, { children: [
|
|
270
397
|
t6,
|
|
271
|
-
|
|
272
|
-
|
|
398
|
+
t11,
|
|
399
|
+
t12
|
|
273
400
|
] });
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
401
|
+
$[47] = t11;
|
|
402
|
+
$[48] = t12;
|
|
403
|
+
$[49] = t6;
|
|
404
|
+
$[50] = t13;
|
|
278
405
|
} else {
|
|
279
|
-
|
|
406
|
+
t13 = $[50];
|
|
280
407
|
}
|
|
281
|
-
const content =
|
|
408
|
+
const content = t13;
|
|
282
409
|
if (presence) {
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
let
|
|
287
|
-
if ($[
|
|
288
|
-
|
|
289
|
-
...
|
|
410
|
+
const t14 = rootProps;
|
|
411
|
+
const t15 = isPresent ? rootProps["aria-hidden"] : true;
|
|
412
|
+
const t16 = !isPresent || rootProps.inert;
|
|
413
|
+
let t17;
|
|
414
|
+
if ($[51] !== content || $[52] !== presence || $[53] !== t14 || $[54] !== t15 || $[55] !== t16) {
|
|
415
|
+
t17 = /* @__PURE__ */ _jsx(motion.div, {
|
|
416
|
+
...t14,
|
|
290
417
|
...presence,
|
|
291
|
-
"aria-hidden":
|
|
292
|
-
inert:
|
|
418
|
+
"aria-hidden": t15,
|
|
419
|
+
inert: t16,
|
|
293
420
|
children: content
|
|
294
421
|
});
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
422
|
+
$[51] = content;
|
|
423
|
+
$[52] = presence;
|
|
424
|
+
$[53] = t14;
|
|
425
|
+
$[54] = t15;
|
|
426
|
+
$[55] = t16;
|
|
427
|
+
$[56] = t17;
|
|
301
428
|
} else {
|
|
302
|
-
|
|
429
|
+
t17 = $[56];
|
|
303
430
|
}
|
|
304
|
-
return
|
|
431
|
+
return t17;
|
|
305
432
|
}
|
|
306
|
-
let
|
|
307
|
-
if ($[
|
|
308
|
-
|
|
433
|
+
let t14;
|
|
434
|
+
if ($[57] !== content || $[58] !== rootProps) {
|
|
435
|
+
t14 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
309
436
|
kind: "message",
|
|
310
437
|
children: /* @__PURE__ */ _jsx("div", {
|
|
311
438
|
...rootProps,
|
|
312
439
|
children: content
|
|
313
440
|
})
|
|
314
441
|
});
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
442
|
+
$[57] = content;
|
|
443
|
+
$[58] = rootProps;
|
|
444
|
+
$[59] = t14;
|
|
318
445
|
} else {
|
|
319
|
-
|
|
446
|
+
t14 = $[59];
|
|
320
447
|
}
|
|
321
|
-
return
|
|
448
|
+
return t14;
|
|
322
449
|
}
|
|
323
450
|
/**
|
|
324
|
-
* A persistent message
|
|
325
|
-
* @param props -
|
|
451
|
+
* A persistent, in-flow message with a tone icon, a title and optional details, action and dismissal.
|
|
452
|
+
* @param props - Title, tone, details, presence and dismissal, extensions and native div attributes.
|
|
326
453
|
* @returns The alert; with `open` or `onDismiss` it collapses its own height when hidden.
|
|
327
454
|
*/
|
|
328
455
|
function Alert({ open, onDismiss, ref: consumerRef, ...props }) {
|
|
@@ -377,112 +504,4 @@ function Alert({ open, onDismiss, ref: consumerRef, ...props }) {
|
|
|
377
504
|
}, "alert") : null
|
|
378
505
|
});
|
|
379
506
|
}
|
|
380
|
-
|
|
381
|
-
const $ = _c(8);
|
|
382
|
-
let className;
|
|
383
|
-
let props;
|
|
384
|
-
if ($[0] !== t0) {
|
|
385
|
-
({className, ...props} = t0);
|
|
386
|
-
$[0] = t0;
|
|
387
|
-
$[1] = className;
|
|
388
|
-
$[2] = props;
|
|
389
|
-
} else {
|
|
390
|
-
className = $[1];
|
|
391
|
-
props = $[2];
|
|
392
|
-
}
|
|
393
|
-
let t1;
|
|
394
|
-
if ($[3] !== className) {
|
|
395
|
-
t1 = cn("text-sm font-medium group-has-[>svg]/alert:col-start-2 group-has-data-[slot=alert-icon]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover-fine:text-foreground", className);
|
|
396
|
-
$[3] = className;
|
|
397
|
-
$[4] = t1;
|
|
398
|
-
} else {
|
|
399
|
-
t1 = $[4];
|
|
400
|
-
}
|
|
401
|
-
let t2;
|
|
402
|
-
if ($[5] !== props || $[6] !== t1) {
|
|
403
|
-
t2 = /* @__PURE__ */ _jsx("div", {
|
|
404
|
-
"data-slot": "alert-title",
|
|
405
|
-
className: t1,
|
|
406
|
-
...props
|
|
407
|
-
});
|
|
408
|
-
$[5] = props;
|
|
409
|
-
$[6] = t1;
|
|
410
|
-
$[7] = t2;
|
|
411
|
-
} else {
|
|
412
|
-
t2 = $[7];
|
|
413
|
-
}
|
|
414
|
-
return t2;
|
|
415
|
-
}
|
|
416
|
-
function AlertDescription(t0) {
|
|
417
|
-
const $ = _c(8);
|
|
418
|
-
let className;
|
|
419
|
-
let props;
|
|
420
|
-
if ($[0] !== t0) {
|
|
421
|
-
({className, ...props} = t0);
|
|
422
|
-
$[0] = t0;
|
|
423
|
-
$[1] = className;
|
|
424
|
-
$[2] = props;
|
|
425
|
-
} else {
|
|
426
|
-
className = $[1];
|
|
427
|
-
props = $[2];
|
|
428
|
-
}
|
|
429
|
-
let t1;
|
|
430
|
-
if ($[3] !== className) {
|
|
431
|
-
t1 = cn("text-xs leading-(--leading-body) text-pretty text-text-secondary group-has-[>svg]/alert:col-start-2 group-has-data-[slot=alert-icon]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover-fine:text-foreground [&_p:not(:last-child)]:mb-4", className);
|
|
432
|
-
$[3] = className;
|
|
433
|
-
$[4] = t1;
|
|
434
|
-
} else {
|
|
435
|
-
t1 = $[4];
|
|
436
|
-
}
|
|
437
|
-
let t2;
|
|
438
|
-
if ($[5] !== props || $[6] !== t1) {
|
|
439
|
-
t2 = /* @__PURE__ */ _jsx("div", {
|
|
440
|
-
"data-slot": "alert-description",
|
|
441
|
-
className: t1,
|
|
442
|
-
...props
|
|
443
|
-
});
|
|
444
|
-
$[5] = props;
|
|
445
|
-
$[6] = t1;
|
|
446
|
-
$[7] = t2;
|
|
447
|
-
} else {
|
|
448
|
-
t2 = $[7];
|
|
449
|
-
}
|
|
450
|
-
return t2;
|
|
451
|
-
}
|
|
452
|
-
function AlertAction(t0) {
|
|
453
|
-
const $ = _c(8);
|
|
454
|
-
let className;
|
|
455
|
-
let props;
|
|
456
|
-
if ($[0] !== t0) {
|
|
457
|
-
({className, ...props} = t0);
|
|
458
|
-
$[0] = t0;
|
|
459
|
-
$[1] = className;
|
|
460
|
-
$[2] = props;
|
|
461
|
-
} else {
|
|
462
|
-
className = $[1];
|
|
463
|
-
props = $[2];
|
|
464
|
-
}
|
|
465
|
-
let t1;
|
|
466
|
-
if ($[3] !== className) {
|
|
467
|
-
t1 = cn("absolute top-(--space-3) right-(--space-3) group-has-data-[slot=alert-dismiss]/alert:right-12", className);
|
|
468
|
-
$[3] = className;
|
|
469
|
-
$[4] = t1;
|
|
470
|
-
} else {
|
|
471
|
-
t1 = $[4];
|
|
472
|
-
}
|
|
473
|
-
let t2;
|
|
474
|
-
if ($[5] !== props || $[6] !== t1) {
|
|
475
|
-
t2 = /* @__PURE__ */ _jsx("div", {
|
|
476
|
-
"data-slot": "alert-action",
|
|
477
|
-
className: t1,
|
|
478
|
-
...props
|
|
479
|
-
});
|
|
480
|
-
$[5] = props;
|
|
481
|
-
$[6] = t1;
|
|
482
|
-
$[7] = t2;
|
|
483
|
-
} else {
|
|
484
|
-
t2 = $[7];
|
|
485
|
-
}
|
|
486
|
-
return t2;
|
|
487
|
-
}
|
|
488
|
-
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
|
507
|
+
export { Alert };
|