beez-ui 2.7.1 → 3.0.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +43 -13
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/dist/components/account-menu.d.ts +4 -3
  5. package/dist/components/account-menu.js +63 -54
  6. package/dist/components/alert.d.ts +15 -15
  7. package/dist/components/alert.js +289 -270
  8. package/dist/components/animated-theme-toggler.js +1 -1
  9. package/dist/components/avatar.d.ts +56 -31
  10. package/dist/components/avatar.js +394 -277
  11. package/dist/components/badge.d.ts +8 -28
  12. package/dist/components/badge.js +55 -108
  13. package/dist/components/calendar.d.ts +36 -26
  14. package/dist/components/calendar.js +132 -1227
  15. package/dist/components/card.d.ts +36 -25
  16. package/dist/components/card.js +895 -72
  17. package/dist/components/carousel.d.ts +63 -47
  18. package/dist/components/carousel.js +496 -777
  19. package/dist/components/data-table.d.ts +5 -4
  20. package/dist/components/data-table.js +7 -6
  21. package/dist/components/dialog-surface.d.ts +23 -1
  22. package/dist/components/dialog-surface.js +99 -3
  23. package/dist/components/dialog.d.ts +80 -45
  24. package/dist/components/dialog.js +258 -503
  25. package/dist/components/dropdown-menu.d.ts +56 -73
  26. package/dist/components/dropdown-menu.js +79 -714
  27. package/dist/components/field.d.ts +3 -1
  28. package/dist/components/field.js +49 -39
  29. package/dist/components/filter-presets-bar.js +2 -2
  30. package/dist/components/filter-query-bar.js +1 -1
  31. package/dist/components/hover-card.d.ts +42 -41
  32. package/dist/components/hover-card.js +57 -483
  33. package/dist/components/pagination.d.ts +53 -31
  34. package/dist/components/pagination.js +176 -412
  35. package/dist/components/popover.d.ts +11 -23
  36. package/dist/components/popover.js +19 -304
  37. package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
  38. package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
  39. package/dist/components/primitives/avatar.d.ts +46 -0
  40. package/dist/components/primitives/avatar.js +268 -0
  41. package/dist/components/primitives/calendar.d.ts +37 -0
  42. package/dist/components/primitives/calendar.js +1250 -0
  43. package/dist/components/primitives/carousel.d.ts +106 -0
  44. package/dist/components/primitives/carousel.js +928 -0
  45. package/dist/components/primitives/dialog.d.ts +62 -0
  46. package/dist/components/primitives/dialog.js +490 -0
  47. package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
  48. package/dist/components/primitives/dropdown-menu-items.js +265 -0
  49. package/dist/components/primitives/dropdown-menu.d.ts +64 -0
  50. package/dist/components/primitives/dropdown-menu.js +557 -0
  51. package/dist/components/primitives/hover-card.d.ts +50 -0
  52. package/dist/components/primitives/hover-card.js +507 -0
  53. package/dist/components/primitives/pagination.d.ts +65 -0
  54. package/dist/components/primitives/pagination.js +373 -0
  55. package/dist/components/primitives/popover.d.ts +22 -0
  56. package/dist/components/primitives/popover.js +213 -0
  57. package/dist/components/primitives/select.d.ts +36 -0
  58. package/dist/components/primitives/select.js +407 -0
  59. package/dist/components/primitives/tooltip.d.ts +30 -0
  60. package/dist/components/primitives/tooltip.js +277 -0
  61. package/dist/components/radio-group.d.ts +30 -17
  62. package/dist/components/radio-group.js +266 -315
  63. package/dist/components/rich-link-editor.js +1 -1
  64. package/dist/components/select.d.ts +51 -42
  65. package/dist/components/select.js +163 -495
  66. package/dist/components/skeleton.d.ts +16 -15
  67. package/dist/components/skeleton.js +99 -205
  68. package/dist/components/split-button.js +1 -1
  69. package/dist/components/switch.d.ts +3 -6
  70. package/dist/components/switch.js +163 -170
  71. package/dist/components/tabs.d.ts +3 -11
  72. package/dist/components/tabs.js +61 -75
  73. package/dist/components/themed-toaster.d.ts +1 -1
  74. package/dist/components/themed-toaster.js +1 -1
  75. package/dist/components/toaster.d.ts +1 -1
  76. package/dist/components/toaster.js +1 -1
  77. package/dist/components/tooltip.d.ts +36 -31
  78. package/dist/components/tooltip.js +44 -284
  79. package/dist/constants/alert.d.ts +5 -1
  80. package/dist/constants/alert.js +5 -1
  81. package/dist/constants/avatar.d.ts +29 -1
  82. package/dist/constants/avatar.js +25 -0
  83. package/dist/constants/calendar.d.ts +12 -0
  84. package/dist/constants/calendar.js +12 -0
  85. package/dist/constants/card.d.ts +23 -0
  86. package/dist/constants/card.js +20 -0
  87. package/dist/constants/carousel.d.ts +31 -13
  88. package/dist/constants/carousel.js +32 -11
  89. package/dist/constants/dialog.d.ts +6 -1
  90. package/dist/constants/dialog.js +5 -1
  91. package/dist/constants/dropdown-menu.d.ts +2 -2
  92. package/dist/constants/dropdown-menu.js +2 -2
  93. package/dist/constants/pagination.d.ts +13 -2
  94. package/dist/constants/pagination.js +13 -2
  95. package/dist/constants/select.d.ts +4 -2
  96. package/dist/constants/select.js +4 -2
  97. package/dist/constants/switch.d.ts +5 -16
  98. package/dist/constants/switch.js +6 -14
  99. package/dist/hooks/use-today.d.ts +7 -0
  100. package/dist/hooks/use-today.js +50 -0
  101. package/dist/hooks.d.ts +1 -0
  102. package/dist/hooks.js +1 -0
  103. package/dist/index.d.ts +0 -1
  104. package/dist/index.js +0 -1
  105. package/dist/motion/glide-indicator.d.ts +1 -1
  106. package/dist/motion/glide-indicator.js +1 -1
  107. package/dist/motion/presence.d.ts +0 -1
  108. package/dist/motion/presence.js +0 -1
  109. package/dist/styles.css +1 -1
  110. package/package.json +1 -6
@@ -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; `onDismiss` adds a dismiss button and `open` collapses the alert's height while it
7
- * fades, so the content below closes the gap. The compound title, description and action parts are kept.
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
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
- * Arc's alert recipe. The icon column (a direct svg or the tone icon) spans the title and description rows, and
30
- * `--alert-color` tints it by tone.
31
- */
32
- const alertVariants = cva("group/alert relative grid w-full items-start gap-x-(--space-3) gap-y-(--space-1) rounded-(--radius-control) border border-border bg-surface p-(--space-4) text-left text-sm text-foreground shadow-(--shadow-resting) [--alert-color:currentColor] has-[>svg]:grid-cols-[auto_1fr] has-data-[slot=alert-icon]:grid-cols-[auto_1fr] has-data-[slot=alert-action]:pr-18 has-data-[slot=alert-dismiss]:pr-12 has-data-[slot=alert-action]:has-data-[slot=alert-dismiss]:pr-36 *:[svg]:row-span-2 *:[svg]:mt-px *:[svg]:text-(--alert-color) *:[svg:not([class*='size-'])]:size-[18px]", {
33
- variants: {
34
- variant: {
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 icons are hidden from assistive technology while they fade. */
94
- function AlertIconSwap(props) {
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
- /** The tone icon column: a new tone morphs its icon in place. */
113
- function AlertIcon(t0) {
114
- const $ = _c(6);
115
- const { icon, iconKey, reduceMotion } = t0;
116
- const t1 = reduceMotion ? reducedEnter : ARC_ICON_ENTER;
117
- const t2 = reduceMotion ? ARC_REDUCED_EXIT : ARC_ICON_EXIT;
118
- const t3 = reduceMotion ? ARC_REDUCED_TRANSITION : ARC_ICON_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] !== icon || $[1] !== iconKey || $[2] !== t1 || $[3] !== t2 || $[4] !== t3) {
121
- t4 = /* @__PURE__ */ _jsx("span", {
122
- "data-slot": "alert-icon",
123
- "aria-hidden": "true",
124
- className: "relative row-span-2 mt-px grid size-[18px] flex-none place-items-center text-(--alert-color) [&_svg]:block [&_svg:not([class*='size-'])]:size-[18px]",
125
- children: /* @__PURE__ */ _jsx(AnimatePresence, {
126
- mode: "popLayout",
127
- initial: false,
128
- children: /* @__PURE__ */ _jsx(AlertIconSwap, {
129
- className: "relative grid place-items-center",
130
- initial: t1,
131
- animate: ARC_SWAP_REST,
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] = icon;
139
- $[1] = iconKey;
140
- $[2] = t1;
141
- $[3] = t2;
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
- t4 = $[5];
183
+ t6 = $[7];
146
184
  }
147
- return t4;
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(44);
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 tone;
161
- let variant;
216
+ let title;
162
217
  if ($[0] !== t0) {
163
- ({className, variant, tone, icon, onDismiss, dismissLabel: t1, reduceMotion, presence, children, ...props} = t0);
218
+ ({className, title, tone: t1, icon, action, onDismiss, dismissLabel, reduceMotion, presence, children, ...props} = t0);
164
219
  $[0] = t0;
165
- $[1] = children;
166
- $[2] = className;
167
- $[3] = icon;
168
- $[4] = onDismiss;
169
- $[5] = presence;
170
- $[6] = props;
171
- $[7] = reduceMotion;
172
- $[8] = t1;
173
- $[9] = tone;
174
- $[10] = variant;
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
- children = $[1];
177
- className = $[2];
178
- icon = $[3];
179
- onDismiss = $[4];
180
- presence = $[5];
181
- props = $[6];
182
- reduceMotion = $[7];
183
- t1 = $[8];
184
- tone = $[9];
185
- variant = $[10];
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 dismissLabel = t1 === undefined ? ALERT_DISMISS_LABEL : t1;
244
+ const tone = t1 === undefined ? "info" : t1;
188
245
  const isPresent = useIsPresent();
189
- const ToneIcon = tone ? TONE_ICON[tone] : null;
246
+ const ToneIcon = TONE_ICON[tone];
190
247
  let t2;
191
- if ($[11] !== ToneIcon || $[12] !== icon) {
192
- t2 = icon === false ? null : icon ?? (ToneIcon ? /* @__PURE__ */ _jsx(ToneIcon, { "aria-hidden": "true" }) : null);
193
- $[11] = ToneIcon;
194
- $[12] = icon;
195
- $[13] = t2;
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 = $[13];
254
+ t2 = $[14];
198
255
  }
199
256
  const resolvedIcon = t2;
200
- const t3 = tone ? ALERT_TONE_ROLE[tone] : "alert";
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 ($[14] !== className || $[15] !== tone || $[16] !== variant) {
203
- t4 = cn(alertVariants({
204
- variant,
205
- tone
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 = $[17];
266
+ t4 = $[16];
213
267
  }
214
268
  let t5;
215
- if ($[18] !== props || $[19] !== t3 || $[20] !== t4 || $[21] !== tone) {
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
- $[18] = props;
224
- $[19] = t3;
225
- $[20] = t4;
226
- $[21] = tone;
227
- $[22] = t5;
277
+ $[17] = props;
278
+ $[18] = t3;
279
+ $[19] = t4;
280
+ $[20] = tone;
281
+ $[21] = t5;
228
282
  } else {
229
- t5 = $[22];
283
+ t5 = $[21];
230
284
  }
231
285
  const rootProps = t5;
232
286
  let t6;
233
- if ($[23] !== icon || $[24] !== reduceMotion || $[25] !== resolvedIcon || $[26] !== tone) {
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 ?? "custom",
290
+ iconKey: icon ? "custom" : tone,
291
+ tone,
237
292
  reduceMotion
238
293
  }) : null;
239
- $[23] = icon;
240
- $[24] = reduceMotion;
241
- $[25] = resolvedIcon;
242
- $[26] = tone;
243
- $[27] = t6;
294
+ $[22] = icon;
295
+ $[23] = reduceMotion;
296
+ $[24] = resolvedIcon;
297
+ $[25] = tone;
298
+ $[26] = t6;
244
299
  } else {
245
- t6 = $[27];
300
+ t6 = $[26];
246
301
  }
247
302
  let t7;
248
- if ($[28] !== dismissLabel || $[29] !== onDismiss) {
249
- t7 = onDismiss ? /* @__PURE__ */ _jsx("button", {
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: "absolute top-(--space-3) right-(--space-3) grid size-7 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",
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
- $[28] = dismissLabel;
262
- $[29] = onDismiss;
263
- $[30] = t7;
387
+ $[43] = dismissLabel;
388
+ $[44] = onDismiss;
389
+ $[45] = title;
390
+ $[46] = t12;
264
391
  } else {
265
- t7 = $[30];
392
+ t12 = $[46];
266
393
  }
267
- let t8;
268
- if ($[31] !== children || $[32] !== t6 || $[33] !== t7) {
269
- t8 = /* @__PURE__ */ _jsxs(_Fragment, { children: [
394
+ let t13;
395
+ if ($[47] !== t11 || $[48] !== t12 || $[49] !== t6) {
396
+ t13 = /* @__PURE__ */ _jsxs(_Fragment, { children: [
270
397
  t6,
271
- children,
272
- t7
398
+ t11,
399
+ t12
273
400
  ] });
274
- $[31] = children;
275
- $[32] = t6;
276
- $[33] = t7;
277
- $[34] = t8;
401
+ $[47] = t11;
402
+ $[48] = t12;
403
+ $[49] = t6;
404
+ $[50] = t13;
278
405
  } else {
279
- t8 = $[34];
406
+ t13 = $[50];
280
407
  }
281
- const content = t8;
408
+ const content = t13;
282
409
  if (presence) {
283
- const t9 = rootProps;
284
- const t10 = isPresent ? rootProps["aria-hidden"] : true;
285
- const t11 = !isPresent || rootProps.inert;
286
- let t12;
287
- if ($[35] !== content || $[36] !== presence || $[37] !== t10 || $[38] !== t11 || $[39] !== t9) {
288
- t12 = /* @__PURE__ */ _jsx(motion.div, {
289
- ...t9,
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": t10,
292
- inert: t11,
418
+ "aria-hidden": t15,
419
+ inert: t16,
293
420
  children: content
294
421
  });
295
- $[35] = content;
296
- $[36] = presence;
297
- $[37] = t10;
298
- $[38] = t11;
299
- $[39] = t9;
300
- $[40] = t12;
422
+ $[51] = content;
423
+ $[52] = presence;
424
+ $[53] = t14;
425
+ $[54] = t15;
426
+ $[55] = t16;
427
+ $[56] = t17;
301
428
  } else {
302
- t12 = $[40];
429
+ t17 = $[56];
303
430
  }
304
- return t12;
431
+ return t17;
305
432
  }
306
- let t9;
307
- if ($[41] !== content || $[42] !== rootProps) {
308
- t9 = /* @__PURE__ */ _jsx(MotionSlot, {
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
- $[41] = content;
316
- $[42] = rootProps;
317
- $[43] = t9;
442
+ $[57] = content;
443
+ $[58] = rootProps;
444
+ $[59] = t14;
318
445
  } else {
319
- t9 = $[43];
446
+ t14 = $[59];
320
447
  }
321
- return t9;
448
+ return t14;
322
449
  }
323
450
  /**
324
- * A persistent message. Compose it with `AlertTitle`, `AlertDescription` and `AlertAction`.
325
- * @param props - Variant, Arc tone and icon, optional presence and dismissal, plus native div attributes.
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
- function AlertTitle(t0) {
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 };