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.
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 +267 -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 +2 -2
  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 +24 -1
  82. package/dist/constants/avatar.js +19 -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
@@ -1,325 +1,40 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
- /**
4
- * Arc's Popover (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a raised panel with Arc's panel radius
5
- * and floating shadow that starts a few pixels toward its trigger and settles on a spring, leaving faster than it
6
- * arrives. It keeps the Radix composition and adds Arc's `PopoverClose`.
7
- */
8
- import * as React from "react";
9
- import { Popover as PopoverPrimitive } from "radix-ui";
10
- import { ArcFloatingSlot } from "../motion/arc-floating-slot.js";
11
- import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
12
- import { cn } from "../lib/utils.js";
13
- import { POPOVER_COLLISION_PADDING_PX, POPOVER_MOTION, POPOVER_SIDE_OFFSET_PX } from "../constants/popover.js";
3
+ import { Popover, PopoverClose, PopoverContent as PopoverContentPrimitive, PopoverTrigger } from "./primitives/popover.js";
14
4
  import { jsx as _jsx } from "react/jsx-runtime";
15
- function Popover(t0) {
16
- const $ = _c(9);
17
- let props;
18
- if ($[0] !== t0) {
19
- ({...props} = t0);
20
- $[0] = t0;
21
- $[1] = props;
22
- } else {
23
- props = $[1];
24
- }
25
- const [motionOpen, setMotionOpen] = useMotionOpenState(props);
26
- let t1;
27
- if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
28
- t1 = /* @__PURE__ */ _jsx(PopoverPrimitive.Root, {
29
- "data-slot": "popover",
30
- ...props,
31
- open: motionOpen,
32
- onOpenChange: setMotionOpen
33
- });
34
- $[2] = motionOpen;
35
- $[3] = props;
36
- $[4] = setMotionOpen;
37
- $[5] = t1;
38
- } else {
39
- t1 = $[5];
40
- }
41
- let t2;
42
- if ($[6] !== motionOpen || $[7] !== t1) {
43
- t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
44
- scope: "popover",
45
- open: motionOpen,
46
- children: t1
47
- });
48
- $[6] = motionOpen;
49
- $[7] = t1;
50
- $[8] = t2;
51
- } else {
52
- t2 = $[8];
53
- }
54
- return t2;
55
- }
56
- function PopoverTrigger(t0) {
57
- const $ = _c(4);
58
- let props;
59
- if ($[0] !== t0) {
60
- ({...props} = t0);
61
- $[0] = t0;
62
- $[1] = props;
63
- } else {
64
- props = $[1];
65
- }
66
- let t1;
67
- if ($[2] !== props) {
68
- t1 = /* @__PURE__ */ _jsx(PopoverPrimitive.Trigger, {
69
- "data-slot": "popover-trigger",
70
- ...props
71
- });
72
- $[2] = props;
73
- $[3] = t1;
74
- } else {
75
- t1 = $[3];
76
- }
77
- return t1;
78
- }
79
- /** Closes the popover that contains it, such as a "Listo" or "Cancelar" button inside the panel. */
80
- function PopoverClose(t0) {
81
- const $ = _c(4);
82
- let props;
83
- if ($[0] !== t0) {
84
- ({...props} = t0);
85
- $[0] = t0;
86
- $[1] = props;
87
- } else {
88
- props = $[1];
89
- }
90
- let t1;
91
- if ($[2] !== props) {
92
- t1 = /* @__PURE__ */ _jsx(PopoverPrimitive.Close, {
93
- "data-slot": "popover-close",
94
- ...props
95
- });
96
- $[2] = props;
97
- $[3] = t1;
98
- } else {
99
- t1 = $[3];
100
- }
101
- return t1;
102
- }
103
- /** Every popover enters and leaves on the same path. */
104
- function resolvePopoverMotion() {
105
- return POPOVER_MOTION;
106
- }
107
5
  /**
108
- * Renders Arc's panel: raised surface, hairline border, panel radius and floating shadow, kept inside the viewport.
109
- * Content taller than the room left on the placed side scrolls inside the panel instead of running off screen.
110
- * @param props - Radix content properties. `align` defaults to `center`, `sideOffset` to 6px and `collisionPadding`
111
- * to 10px.
112
- * @returns The portaled panel.
6
+ * Renders the portaled panel anchored to the trigger, kept inside the viewport; content taller than the room left
7
+ * scrolls inside the panel.
8
+ * @param props - Radix content properties. Arc's defaults: `align="start"`, a 6px `sideOffset` and a 10px
9
+ * `collisionPadding`.
10
+ * @returns The panel.
113
11
  */
114
12
  function PopoverContent(t0) {
115
- const $ = _c(17);
116
- let className;
13
+ const $ = _c(6);
117
14
  let props;
118
15
  let t1;
119
- let t2;
120
- let t3;
121
16
  if ($[0] !== t0) {
122
- ({className, align: t1, sideOffset: t2, collisionPadding: t3, ...props} = t0);
123
- $[0] = t0;
124
- $[1] = className;
125
- $[2] = props;
126
- $[3] = t1;
127
- $[4] = t2;
128
- $[5] = t3;
129
- } else {
130
- className = $[1];
131
- props = $[2];
132
- t1 = $[3];
133
- t2 = $[4];
134
- t3 = $[5];
135
- }
136
- const align = t1 === undefined ? "center" : t1;
137
- const sideOffset = t2 === undefined ? POPOVER_SIDE_OFFSET_PX : t2;
138
- const collisionPadding = t3 === undefined ? POPOVER_COLLISION_PADDING_PX : t3;
139
- const t4 = props.forceMount;
140
- let t5;
141
- if ($[6] !== className) {
142
- t5 = cn("z-50 flex max-h-(--radix-popover-content-available-height) w-72 max-w-[calc(100vw-20px)] origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 overflow-y-auto overscroll-contain *:shrink-0 rounded-(--radius-panel) border border-border bg-surface-raised p-(--space-4) text-sm leading-(--leading-body) text-foreground shadow-(--shadow-floating) outline-hidden", className);
143
- $[6] = className;
144
- $[7] = t5;
145
- } else {
146
- t5 = $[7];
147
- }
148
- let t6;
149
- if ($[8] !== align || $[9] !== collisionPadding || $[10] !== props || $[11] !== sideOffset || $[12] !== t5) {
150
- t6 = /* @__PURE__ */ _jsx(ArcFloatingSlot, {
151
- motion: resolvePopoverMotion,
152
- children: /* @__PURE__ */ _jsx(PopoverPrimitive.Content, {
153
- forceMount: true,
154
- "data-slot": "popover-content",
155
- align,
156
- sideOffset,
157
- collisionPadding,
158
- className: t5,
159
- ...props
160
- })
161
- });
162
- $[8] = align;
163
- $[9] = collisionPadding;
164
- $[10] = props;
165
- $[11] = sideOffset;
166
- $[12] = t5;
167
- $[13] = t6;
168
- } else {
169
- t6 = $[13];
170
- }
171
- let t7;
172
- if ($[14] !== props.forceMount || $[15] !== t6) {
173
- t7 = /* @__PURE__ */ _jsx(PopoverPrimitive.Portal, {
174
- forceMount: true,
175
- children: /* @__PURE__ */ _jsx(MotionPresence, {
176
- scope: "popover",
177
- forceMount: t4,
178
- children: t6
179
- })
180
- });
181
- $[14] = props.forceMount;
182
- $[15] = t6;
183
- $[16] = t7;
184
- } else {
185
- t7 = $[16];
186
- }
187
- return t7;
188
- }
189
- function PopoverAnchor(t0) {
190
- const $ = _c(4);
191
- let props;
192
- if ($[0] !== t0) {
193
- ({...props} = t0);
17
+ ({align: t1, ...props} = t0);
194
18
  $[0] = t0;
195
19
  $[1] = props;
20
+ $[2] = t1;
196
21
  } else {
197
22
  props = $[1];
23
+ t1 = $[2];
198
24
  }
199
- let t1;
200
- if ($[2] !== props) {
201
- t1 = /* @__PURE__ */ _jsx(PopoverPrimitive.Anchor, {
202
- "data-slot": "popover-anchor",
203
- ...props
204
- });
205
- $[2] = props;
206
- $[3] = t1;
207
- } else {
208
- t1 = $[3];
209
- }
210
- return t1;
211
- }
212
- /**
213
- * Groups popover headings with compact spacing.
214
- * @param props - Primitive properties and optional consumer overrides.
215
- * @returns The styled primitive with its original interaction contract.
216
- */
217
- function PopoverHeader(t0) {
218
- const $ = _c(8);
219
- let className;
220
- let props;
221
- if ($[0] !== t0) {
222
- ({className, ...props} = t0);
223
- $[0] = t0;
224
- $[1] = className;
225
- $[2] = props;
226
- } else {
227
- className = $[1];
228
- props = $[2];
229
- }
230
- let t1;
231
- if ($[3] !== className) {
232
- t1 = cn("flex flex-col gap-0.5 text-sm", className);
233
- $[3] = className;
234
- $[4] = t1;
235
- } else {
236
- t1 = $[4];
237
- }
238
- let t2;
239
- if ($[5] !== props || $[6] !== t1) {
240
- t2 = /* @__PURE__ */ _jsx("div", {
241
- "data-slot": "popover-header",
242
- className: t1,
243
- ...props
244
- });
245
- $[5] = props;
246
- $[6] = t1;
247
- $[7] = t2;
248
- } else {
249
- t2 = $[7];
250
- }
251
- return t2;
252
- }
253
- function PopoverTitle(t0) {
254
- const $ = _c(8);
255
- let className;
256
- let props;
257
- if ($[0] !== t0) {
258
- ({className, ...props} = t0);
259
- $[0] = t0;
260
- $[1] = className;
261
- $[2] = props;
262
- } else {
263
- className = $[1];
264
- props = $[2];
265
- }
266
- let t1;
267
- if ($[3] !== className) {
268
- t1 = cn("font-medium", className);
269
- $[3] = className;
270
- $[4] = t1;
271
- } else {
272
- t1 = $[4];
273
- }
274
- let t2;
275
- if ($[5] !== props || $[6] !== t1) {
276
- t2 = /* @__PURE__ */ _jsx("div", {
277
- "data-slot": "popover-title",
278
- className: t1,
279
- ...props
280
- });
281
- $[5] = props;
282
- $[6] = t1;
283
- $[7] = t2;
284
- } else {
285
- t2 = $[7];
286
- }
287
- return t2;
288
- }
289
- function PopoverDescription(t0) {
290
- const $ = _c(8);
291
- let className;
292
- let props;
293
- if ($[0] !== t0) {
294
- ({className, ...props} = t0);
295
- $[0] = t0;
296
- $[1] = className;
297
- $[2] = props;
298
- } else {
299
- className = $[1];
300
- props = $[2];
301
- }
302
- let t1;
303
- if ($[3] !== className) {
304
- t1 = cn("text-muted-foreground", className);
305
- $[3] = className;
306
- $[4] = t1;
307
- } else {
308
- t1 = $[4];
309
- }
25
+ const align = t1 === undefined ? "start" : t1;
310
26
  let t2;
311
- if ($[5] !== props || $[6] !== t1) {
312
- t2 = /* @__PURE__ */ _jsx("p", {
313
- "data-slot": "popover-description",
314
- className: t1,
27
+ if ($[3] !== align || $[4] !== props) {
28
+ t2 = /* @__PURE__ */ _jsx(PopoverContentPrimitive, {
29
+ align,
315
30
  ...props
316
31
  });
317
- $[5] = props;
318
- $[6] = t1;
319
- $[7] = t2;
32
+ $[3] = align;
33
+ $[4] = props;
34
+ $[5] = t2;
320
35
  } else {
321
- t2 = $[7];
36
+ t2 = $[5];
322
37
  }
323
38
  return t2;
324
39
  }
325
- export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
40
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
@@ -1,11 +1,13 @@
1
1
  /**
2
- * Confirmation dialog on Arc's Dialog surface (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): the same
3
- * overlay, raised panel, title and description type and dialog transition as `Dialog`, so both read as one family. It
4
- * keeps beez-ui's media slot and Arc `Button` actions.
2
+ * Internal confirmation composition on Arc's Dialog surface (https://uiarc.dev, MIT License, see
3
+ * THIRD_PARTY_NOTICES.md): Radix's alert dialog parts on the same overlay, raised panel, title and description type as
4
+ * the dialog primitive, so both read as one family, with Arc's dialog transition, media slot and Arc `Button`
5
+ * actions. Not exported from the package: the public `Dialog` uses it for its `alert` mode.
5
6
  */
6
7
  import * as React from "react";
7
8
  import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
8
- import { Button } from "./button.js";
9
+ import { Button } from "../button.js";
10
+ import { type DialogCloseButtonPlacement } from "../dialog-surface.js";
9
11
  declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
10
12
  declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
11
13
  declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
@@ -13,10 +15,20 @@ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProp
13
15
  /**
14
16
  * Renders a compact confirmation while preserving the shared theme and viewport bound.
15
17
  * @param props - Primitive properties and optional consumer overrides.
18
+ * @param props.showCloseButton - Whether the confirmation renders a close button, which cancels it. Off by default:
19
+ * a confirmation is answered with its actions.
20
+ * @param props.closeButtonPlacement - `viewport` pins the close button to the viewport corner; `content` (default)
21
+ * keeps it in the panel.
22
+ * @param props.closeLabel - Accessible name of the close button.
23
+ * @param props.closeButtonRef - Ref of the close button, when it is rendered.
16
24
  * @returns The styled primitive with its original interaction contract.
17
25
  */
18
- declare function AlertDialogContent({ className, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
26
+ declare function AlertDialogContent({ className, size, children, showCloseButton, closeButtonPlacement, closeLabel, closeButtonRef, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
19
27
  size?: "default" | "sm";
28
+ showCloseButton?: boolean;
29
+ closeButtonPlacement?: DialogCloseButtonPlacement;
30
+ closeLabel?: string;
31
+ closeButtonRef?: React.Ref<HTMLButtonElement>;
20
32
  }): React.JSX.Element;
21
33
  /**
22
34
  * Aligns confirmation headings and media with compact spacing.
@@ -1,17 +1,18 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
3
  /**
4
- * Confirmation dialog on Arc's Dialog surface (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): the same
5
- * overlay, raised panel, title and description type and dialog transition as `Dialog`, so both read as one family. It
6
- * keeps beez-ui's media slot and Arc `Button` actions.
4
+ * Internal confirmation composition on Arc's Dialog surface (https://uiarc.dev, MIT License, see
5
+ * THIRD_PARTY_NOTICES.md): Radix's alert dialog parts on the same overlay, raised panel, title and description type as
6
+ * the dialog primitive, so both read as one family, with Arc's dialog transition, media slot and Arc `Button`
7
+ * actions. Not exported from the package: the public `Dialog` uses it for its `alert` mode.
7
8
  */
8
9
  import * as React from "react";
9
10
  import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
10
- import { MotionSlot } from "../motion/motion-slot.js";
11
- import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
12
- import { cn } from "../lib/utils.js";
13
- import { Button } from "./button.js";
14
- import { withDialogSwapText, dialogDescriptionClassName, dialogFooterClassName, dialogOverlayClassName, dialogSurfaceClassName, dialogTitleClassName } from "./dialog-surface.js";
11
+ import { MotionSlot } from "../../motion/motion-slot.js";
12
+ import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../../motion/presence.js";
13
+ import { cn } from "../../lib/utils.js";
14
+ import { Button } from "../button.js";
15
+ import { DialogSurfaceCloseButton, withDialogSwapText, dialogDescriptionClassName, dialogFooterClassName, dialogOverlayClassName, dialogSurfaceClassName, dialogTitleClassName } from "../dialog-surface.js";
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  function AlertDialog(t0) {
17
18
  const $ = _c(9);
@@ -139,80 +140,127 @@ function AlertDialogOverlay(t0) {
139
140
  /**
140
141
  * Renders a compact confirmation while preserving the shared theme and viewport bound.
141
142
  * @param props - Primitive properties and optional consumer overrides.
143
+ * @param props.showCloseButton - Whether the confirmation renders a close button, which cancels it. Off by default:
144
+ * a confirmation is answered with its actions.
145
+ * @param props.closeButtonPlacement - `viewport` pins the close button to the viewport corner; `content` (default)
146
+ * keeps it in the panel.
147
+ * @param props.closeLabel - Accessible name of the close button.
148
+ * @param props.closeButtonRef - Ref of the close button, when it is rendered.
142
149
  * @returns The styled primitive with its original interaction contract.
143
150
  */
144
151
  function AlertDialogContent(t0) {
145
- const $ = _c(14);
152
+ const $ = _c(28);
153
+ let children;
146
154
  let className;
155
+ let closeButtonRef;
156
+ let closeLabel;
147
157
  let props;
148
158
  let t1;
159
+ let t2;
160
+ let t3;
149
161
  if ($[0] !== t0) {
150
- ({className, size: t1, ...props} = t0);
162
+ ({className, size: t1, children, showCloseButton: t2, closeButtonPlacement: t3, closeLabel, closeButtonRef, ...props} = t0);
151
163
  $[0] = t0;
152
- $[1] = className;
153
- $[2] = props;
154
- $[3] = t1;
164
+ $[1] = children;
165
+ $[2] = className;
166
+ $[3] = closeButtonRef;
167
+ $[4] = closeLabel;
168
+ $[5] = props;
169
+ $[6] = t1;
170
+ $[7] = t2;
171
+ $[8] = t3;
155
172
  } else {
156
- className = $[1];
157
- props = $[2];
158
- t1 = $[3];
173
+ children = $[1];
174
+ className = $[2];
175
+ closeButtonRef = $[3];
176
+ closeLabel = $[4];
177
+ props = $[5];
178
+ t1 = $[6];
179
+ t2 = $[7];
180
+ t3 = $[8];
159
181
  }
160
182
  const size = t1 === undefined ? "default" : t1;
161
- const t2 = props.forceMount;
162
- let t3;
163
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
164
- t3 = /* @__PURE__ */ _jsx(MotionSlot, {
183
+ const showCloseButton = t2 === undefined ? false : t2;
184
+ const closeButtonPlacement = t3 === undefined ? "content" : t3;
185
+ const t4 = props.forceMount;
186
+ let t5;
187
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
188
+ t5 = /* @__PURE__ */ _jsx(MotionSlot, {
165
189
  kind: "overlay",
166
190
  children: /* @__PURE__ */ _jsx(AlertDialogOverlay, { forceMount: true })
167
191
  });
168
- $[4] = t3;
169
- } else {
170
- t3 = $[4];
171
- }
172
- let t4;
173
- if ($[5] !== className) {
174
- t4 = cn(dialogSurfaceClassName, "group/alert-dialog-content fixed top-1/2 left-1/2 grid max-h-[calc(100svh-2rem)] overflow-y-auto overscroll-contain w-full -translate-x-1/2 -translate-y-1/2 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm", className);
175
- $[5] = className;
176
- $[6] = t4;
192
+ $[9] = t5;
193
+ } else {
194
+ t5 = $[9];
195
+ }
196
+ const t6 = showCloseButton ? closeButtonPlacement : undefined;
197
+ const t7 = showCloseButton && closeButtonPlacement === "viewport" ? "inset-0 m-auto h-fit" : "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2";
198
+ let t8;
199
+ if ($[10] !== className || $[11] !== t7) {
200
+ t8 = cn(dialogSurfaceClassName, "group/alert-dialog-content fixed grid max-h-[calc(100svh-2rem)] overflow-y-auto overscroll-contain w-full data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm", t7, className);
201
+ $[10] = className;
202
+ $[11] = t7;
203
+ $[12] = t8;
204
+ } else {
205
+ t8 = $[12];
206
+ }
207
+ let t9;
208
+ if ($[13] !== closeButtonPlacement || $[14] !== closeButtonRef || $[15] !== closeLabel || $[16] !== showCloseButton) {
209
+ t9 = showCloseButton && /* @__PURE__ */ _jsx(DialogSurfaceCloseButton, {
210
+ kind: "alert",
211
+ placement: closeButtonPlacement,
212
+ label: closeLabel,
213
+ buttonRef: closeButtonRef
214
+ });
215
+ $[13] = closeButtonPlacement;
216
+ $[14] = closeButtonRef;
217
+ $[15] = closeLabel;
218
+ $[16] = showCloseButton;
219
+ $[17] = t9;
177
220
  } else {
178
- t4 = $[6];
221
+ t9 = $[17];
179
222
  }
180
- let t5;
181
- if ($[7] !== props || $[8] !== size || $[9] !== t4) {
182
- t5 = /* @__PURE__ */ _jsxs(React.Fragment, { children: [t3, /* @__PURE__ */ _jsx(MotionSlot, {
223
+ let t10;
224
+ if ($[18] !== children || $[19] !== props || $[20] !== size || $[21] !== t6 || $[22] !== t8 || $[23] !== t9) {
225
+ t10 = /* @__PURE__ */ _jsxs(React.Fragment, { children: [t5, /* @__PURE__ */ _jsx(MotionSlot, {
183
226
  kind: "dialog",
184
- children: /* @__PURE__ */ _jsx(AlertDialogPrimitive.Content, {
227
+ children: /* @__PURE__ */ _jsxs(AlertDialogPrimitive.Content, {
185
228
  forceMount: true,
186
229
  "data-slot": "alert-dialog-content",
187
230
  "data-size": size,
188
- className: t4,
189
- ...props
231
+ "data-close-button-placement": t6,
232
+ className: t8,
233
+ ...props,
234
+ children: [children, t9]
190
235
  })
191
236
  })] });
192
- $[7] = props;
193
- $[8] = size;
194
- $[9] = t4;
195
- $[10] = t5;
196
- } else {
197
- t5 = $[10];
198
- }
199
- let t6;
200
- if ($[11] !== props.forceMount || $[12] !== t5) {
201
- t6 = /* @__PURE__ */ _jsx(AlertDialogPortal, {
237
+ $[18] = children;
238
+ $[19] = props;
239
+ $[20] = size;
240
+ $[21] = t6;
241
+ $[22] = t8;
242
+ $[23] = t9;
243
+ $[24] = t10;
244
+ } else {
245
+ t10 = $[24];
246
+ }
247
+ let t11;
248
+ if ($[25] !== props.forceMount || $[26] !== t10) {
249
+ t11 = /* @__PURE__ */ _jsx(AlertDialogPortal, {
202
250
  forceMount: true,
203
251
  children: /* @__PURE__ */ _jsx(MotionPresence, {
204
252
  scope: "alert-dialog",
205
- forceMount: t2,
206
- children: t5
253
+ forceMount: t4,
254
+ children: t10
207
255
  })
208
256
  });
209
- $[11] = props.forceMount;
210
- $[12] = t5;
211
- $[13] = t6;
257
+ $[25] = props.forceMount;
258
+ $[26] = t10;
259
+ $[27] = t11;
212
260
  } else {
213
- t6 = $[13];
261
+ t11 = $[27];
214
262
  }
215
- return t6;
263
+ return t11;
216
264
  }
217
265
  /**
218
266
  * Aligns confirmation headings and media with compact spacing.
@@ -234,7 +282,7 @@ function AlertDialogHeader(t0) {
234
282
  }
235
283
  let t1;
236
284
  if ($[3] !== className) {
237
- t1 = cn("grid grid-rows-[auto_1fr] place-items-center gap-(--space-2) text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className);
285
+ t1 = cn("grid grid-rows-[auto_1fr] place-items-center gap-(--space-2) text-center in-data-[close-button-placement=content]:pr-[calc(var(--space-8)+var(--space-5))] has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className);
238
286
  $[3] = className;
239
287
  $[4] = t1;
240
288
  } else {
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Internal composition behind Arc's Avatar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a compact
3
+ * identity marker on Arc's tokens, with a hairline border, a muted fill behind the initials and an optional presence
4
+ * dot that pops in and out. Loading, failure and fallback stay on the Base UI avatar primitive. Not part of the public
5
+ * API: consumers use the closed `Avatar` from `../avatar.js`, while beez-ui components such as the account menu compose
6
+ * these parts directly.
7
+ */
8
+ import type { ComponentProps } from "react";
9
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
10
+ import type { AvatarSize, AvatarStatus } from "../../constants/avatar.js";
11
+ /** Accepts native image props and nullable image sources from application results. */
12
+ export type AvatarImageProps = Omit<ComponentProps<"img">, "src"> & {
13
+ src?: string | null;
14
+ };
15
+ export type AvatarRootProps = AvatarPrimitive.Root.Props & {
16
+ /** Diameter: 24px (`sm`), 32px (`md`, default), 40px (`lg`) or Arc's 88px profile size (`xl`). */
17
+ size?: AvatarSize;
18
+ /** Shows Arc's presence dot in the bottom corner, or the top corner when an `AvatarBadge` holds the bottom one. */
19
+ status?: AvatarStatus;
20
+ };
21
+ /**
22
+ * The avatar circle with its optional presence dot.
23
+ * @param props - Size, optional presence and the Base UI avatar root props.
24
+ * @returns The avatar root.
25
+ */
26
+ declare function AvatarRoot({ className, size, status, children, ...props }: AvatarRootProps): import("react").JSX.Element;
27
+ /**
28
+ * The photo. Delegates loading, failure and fallback synchronization to the avatar primitive and renders through the
29
+ * provider's `Image` adapter; loaded images develop in place.
30
+ * @param props - Native image props with a nullable source.
31
+ * @returns The image, mounted while it loads so the fallback can stay until it is ready.
32
+ */
33
+ declare function AvatarImage({ alt, className, src, ...props }: AvatarImageProps): import("react").JSX.Element;
34
+ /**
35
+ * Initials or another stand-in, shown until the photo loads or when it fails.
36
+ * @param props - Base UI fallback props.
37
+ * @returns The fallback.
38
+ */
39
+ declare function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props): import("react").JSX.Element;
40
+ /**
41
+ * A custom corner badge, drawn with the same ring as Arc's presence dot.
42
+ * @param props - Native span props.
43
+ * @returns The badge.
44
+ */
45
+ declare function AvatarBadge({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
46
+ export { AvatarRoot, AvatarImage, AvatarFallback, AvatarBadge };