beez-ui 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/alert-dialog.d.ts +15 -4
- package/dist/components/alert-dialog.js +84 -44
- package/dist/components/alert.d.ts +30 -9
- package/dist/components/alert.js +360 -39
- package/dist/components/avatar.d.ts +33 -10
- package/dist/components/avatar.js +110 -30
- package/dist/components/badge.d.ts +39 -7
- package/dist/components/badge.js +348 -24
- package/dist/components/calendar.d.ts +29 -2
- package/dist/components/calendar.js +1035 -223
- package/dist/components/card.d.ts +17 -1
- package/dist/components/card.js +34 -8
- package/dist/components/carousel.d.ts +29 -2
- package/dist/components/carousel.js +471 -90
- package/dist/components/checkbox.d.ts +13 -2
- package/dist/components/checkbox.js +301 -41
- package/dist/components/dialog-surface.d.ts +27 -0
- package/dist/components/dialog-surface.js +137 -0
- package/dist/components/dialog.d.ts +21 -4
- package/dist/components/dialog.js +163 -96
- package/dist/components/dropdown-menu.d.ts +30 -16
- package/dist/components/dropdown-menu.js +139 -83
- package/dist/components/hover-card.d.ts +46 -3
- package/dist/components/hover-card.js +423 -60
- package/dist/components/pagination.d.ts +32 -14
- package/dist/components/pagination.js +136 -59
- package/dist/components/popover.d.ts +14 -5
- package/dist/components/popover.js +78 -36
- package/dist/components/radio-group.d.ts +19 -3
- package/dist/components/radio-group.js +400 -57
- package/dist/components/select.d.ts +17 -6
- package/dist/components/select.js +83 -71
- package/dist/components/sheet.js +37 -26
- package/dist/components/sidebar.js +11 -0
- package/dist/components/skeleton.d.ts +19 -5
- package/dist/components/skeleton.js +434 -14
- package/dist/components/switch.d.ts +14 -4
- package/dist/components/switch.js +424 -40
- package/dist/components/tabs.d.ts +38 -5
- package/dist/components/tabs.js +564 -97
- package/dist/components/themed-toaster.d.ts +6 -2
- package/dist/components/themed-toaster.js +80 -50
- package/dist/components/tooltip.d.ts +33 -2
- package/dist/components/tooltip.js +197 -69
- package/dist/constants/alert.d.ts +12 -0
- package/dist/constants/alert.js +9 -0
- package/dist/constants/avatar.d.ts +10 -0
- package/dist/constants/avatar.js +7 -0
- package/dist/constants/badge.d.ts +6 -0
- package/dist/constants/badge.js +6 -0
- package/dist/constants/calendar.d.ts +24 -0
- package/dist/constants/calendar.js +22 -0
- package/dist/constants/carousel.d.ts +37 -0
- package/dist/constants/carousel.js +53 -0
- package/dist/constants/checkbox.d.ts +17 -0
- package/dist/constants/checkbox.js +17 -0
- package/dist/constants/dialog.d.ts +6 -0
- package/dist/constants/dialog.js +6 -0
- package/dist/constants/dropdown-menu.d.ts +5 -0
- package/dist/constants/dropdown-menu.js +5 -0
- package/dist/constants/hover-card.d.ts +37 -0
- package/dist/constants/hover-card.js +85 -0
- package/dist/constants/pagination.d.ts +9 -0
- package/dist/constants/pagination.js +9 -0
- package/dist/constants/popover.d.ts +7 -0
- package/dist/constants/popover.js +39 -0
- package/dist/constants/radio-group.d.ts +10 -0
- package/dist/constants/radio-group.js +10 -0
- package/dist/constants/select.d.ts +3 -0
- package/dist/constants/select.js +3 -0
- package/dist/constants/skeleton.d.ts +17 -0
- package/dist/constants/skeleton.js +17 -0
- package/dist/constants/switch.d.ts +44 -0
- package/dist/constants/switch.js +49 -0
- package/dist/constants/tabs.d.ts +17 -0
- package/dist/constants/tabs.js +17 -0
- package/dist/constants/toast.d.ts +3 -0
- package/dist/constants/toast.js +3 -0
- package/dist/constants/tooltip.d.ts +13 -0
- package/dist/constants/tooltip.js +52 -0
- package/dist/lib/toast-layer.d.ts +24 -0
- package/dist/lib/toast-layer.js +76 -0
- package/dist/motion/arc-floating-slot.d.ts +40 -0
- package/dist/motion/arc-floating-slot.js +167 -0
- package/dist/motion/glide-indicator.d.ts +6 -7
- package/dist/motion/glide-indicator.js +5 -3
- package/dist/motion/overlay-warmth.d.ts +24 -0
- package/dist/motion/overlay-warmth.js +70 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,69 @@ Todos los cambios relevantes de beez-ui se documentan en este archivo con el for
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [2.6.1] - 2026-10-16
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Los botones de un toast de `ThemedToaster` (acción, cancelar o cerrar) responden mientras hay un `Dialog`, `AlertDialog` o `Sheet` abierto, y presionarlos ya no cierra el `Dialog` o el `Sheet`. También se alcanzan con el teclado mediante el atajo de Sonner (Alt+T), que ya no queda bloqueado por la trampa de foco del modal; si el control enfocado cierra su toast, el foco vuelve al modal en lugar de perderse.
|
|
12
|
+
- Presionar Escape en un menú, select o diálogo abierto desde el `Sidebar` en mobile cierra solo esa capa y deja el sidebar abierto.
|
|
13
|
+
- Abrir el `Sidebar` en mobile en una ventana de escritorio angosta ya no desplaza la página de costado cuando desaparece la barra de scroll.
|
|
14
|
+
- El contenido de `PopoverContent` más alto que el espacio disponible en pantalla se desplaza dentro del panel en lugar de quedar cortado fuera del viewport.
|
|
15
|
+
|
|
16
|
+
## [2.6.0] - 2026-10-15
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `Switch` acepta `label` para mostrar el texto dentro del control con la altura táctil de Arc.
|
|
21
|
+
- `Checkbox` acepta `label` y `description` para mostrar el campo con etiqueta de Arc, con la descripción vinculada por `aria-describedby`.
|
|
22
|
+
- `RadioGroupItem` acepta `label` y `description` para mostrar las filas de opción de Arc, con un resaltado que se desliza hacia la opción elegida, también con las flechas del teclado.
|
|
23
|
+
- `Badge` acepta `tone` (`neutral`, `success`, `info`, `warning`, `danger`), `size` (`sm`, `md`) e `icon`; cuando cambia el texto, el nuevo entra animado y el ancho se ajusta con un resorte.
|
|
24
|
+
- `Avatar` acepta `size="xl"` (88 px) y `status` (`online`, `offline`) con un punto de presencia animado y un texto accesible configurable con `statusLabel`; si el avatar también tiene un `AvatarBadge`, el punto pasa a la esquina superior.
|
|
25
|
+
- `Skeleton` acepta `lines`, `avatar` y `label` para dibujar el placeholder completo de Arc, y `loading` para pasar del placeholder al contenido con una transición.
|
|
26
|
+
- `CardMedia` agrega un marco para fotos en `Card` con un zoom suave al pasar el puntero.
|
|
27
|
+
- `Alert` acepta `tone` con su ícono y rol accesible, `icon`, `onDismiss` con `dismissLabel` para descartarlo, y `open` para ocultarlo colapsando su altura.
|
|
28
|
+
- `Tooltip` acepta `content` y `side` para envolver directamente su trigger, y funciona sin `TooltipProvider`.
|
|
29
|
+
- `PopoverClose` cierra el popover desde un control dentro del panel.
|
|
30
|
+
- `HoverCardProfile` muestra una vista previa de persona (retrato o iniciales, nombre, rol, bio, números y pie) dentro de `HoverCardContent`.
|
|
31
|
+
- `DialogTitle`, `DialogDescription`, `AlertDialogTitle` y `AlertDialogDescription` animan el cambio de texto mientras el diálogo está abierto, sin animar el primer render y sin movimiento con `prefers-reduced-motion`.
|
|
32
|
+
- `DialogHeader` deja espacio al botón de cerrar del panel para que un título largo no quede debajo.
|
|
33
|
+
- Los enlaces de `Pagination` con `aria-disabled` se muestran atenuados y no navegan ni con clic ni con el teclado.
|
|
34
|
+
- `Calendar` acepta `showToday` y `todayLabel` para mostrar un botón "Hoy" que vuelve al mes actual y selecciona el día de hoy.
|
|
35
|
+
- `CarouselIndicators` muestra un grupo de botones de puntos, con el activo marcado por `aria-current`, cuyo punto activo se estira en una píldora que acompaña el desplazamiento.
|
|
36
|
+
- `Carousel` responde a `Home` y `End` para ir a la primera y la última diapositiva.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- `Switch` adopta el diseño de Arc: pista de 42×24 (la variante `sm` pasa a 32×18) y thumb que se desliza con un resorte y se estira mientras se mantiene presionado.
|
|
41
|
+
- `Checkbox` adopta el diseño de Arc: cuadrado de 18 px con relleno animado, tilde que se dibuja y se transforma en guion en el estado indeterminado, y zona táctil de 44 px.
|
|
42
|
+
- `RadioGroupItem` adopta la marca de Arc: 17 px, rellena con el color de selección y con un punto que aparece con un resorte al elegirla.
|
|
43
|
+
- `Badge` adopta el diseño de Arc: altura de 26 px por defecto, borde y fondo según el tono; las variantes actuales se dibujan con los tonos de Arc.
|
|
44
|
+
- `Avatar`, `Card` y `Alert` adoptan los tokens de Arc: borde visible, superficie, radios, espaciado de 20 px en `Card` y descripción más chica en `Alert`.
|
|
45
|
+
- `Card` con enlaces o botones se eleva levemente al pasar el puntero, y su footer ya no tiene banda de fondo.
|
|
46
|
+
- `Skeleton` reemplaza el brillo deslizante por el pulso escalonado de Arc, que se detiene a los 20 segundos aproximadamente.
|
|
47
|
+
- `Tooltip`, `Popover` y `HoverCard` adoptan el diseño de Arc: superficies con radio, borde y sombra de Arc; el tooltip pierde la flecha. Las tres capas entran desde su trigger y, con movimiento reducido, solo se desvanecen.
|
|
48
|
+
- Los tooltips esperan 250 ms antes de abrir (`TooltipProvider` por defecto) y los hover cards abren a los 500 ms y cierran a los 140 ms; tras cerrar uno, el siguiente abre al instante.
|
|
49
|
+
- `sideOffset` y `collisionPadding` por defecto pasan a 8/12 px en tooltip y hover card, y a 6/10 px en popover; el popover usa más padding y el hover card mide 18.5rem.
|
|
50
|
+
- `DropdownMenu` adopta el diseño de Arc: panel sólido elevado (sin el efecto translúcido), filas de 36 px, tono de peligro en los ítems destructivos, ítems deshabilitados más tenues y entrada escalonada de las filas que respeta `prefers-reduced-motion`.
|
|
51
|
+
- `DropdownMenuContent` usa por defecto `sideOffset` 6, `collisionPadding` 12 y `loop`, así que las flechas del teclado vuelven del último ítem al primero; `DropdownMenuSubContent` también usa `collisionPadding` 12 y `loop`. Se pueden sobrescribir.
|
|
52
|
+
- `Select` adopta el diseño de Arc: el trigger usa las alturas de control de Arc (`default` igual que `Input`, `sm` de 36 px), responde al hover solo con puntero fino y marca `aria-invalid` con el borde de peligro; la lista tiene panel elevado, filas de 36 px y, con `position="popper"`, `collisionPadding` 12 y una altura máxima de 20rem.
|
|
53
|
+
- `Tabs` adopta el diseño y la motion de Arc: lista segmentada con superficie elevada en el tab activo, resaltado que se desliza con el resorte de Arc y paneles que entran desde el lado del tab elegido ajustando su altura.
|
|
54
|
+
- La lista de `Tabs` se desplaza de costado cuando no entra en pantalla y mantiene visible el tab activo o enfocado.
|
|
55
|
+
- `Pagination` adopta el diseño de Arc: controles compactos con números tabulares, marca de la página actual que se desliza y flechas que responden al presionarlas; sigue navegando con el `Link` del provider.
|
|
56
|
+
- `Pagination` usa textos por defecto en español ("Paginación", "Anterior", "Siguiente", "Ir a la página anterior", "Ir a la página siguiente", "Más páginas").
|
|
57
|
+
- `Dialog` y `AlertDialog` adoptan la superficie del Dialog de Arc: velo más oscuro con desenfoque, panel elevado con radio de superficie, borde fino, sombra flotante y padding de 24 px; conservan el despliegue desde el centro.
|
|
58
|
+
- El ancho máximo de `DialogContent` pasa de 384 px a 440 px, los títulos de los diálogos usan Inter a 18 px y las descripciones el color de texto secundario de Arc.
|
|
59
|
+
- El botón de cerrar de `DialogContent` pasa a 32 px, con borde y fondo suave, alineado con la primera línea del título.
|
|
60
|
+
- `DialogFooter` y `AlertDialogFooter` sobresalen 24 px hacia los costados y abajo, acompañando el nuevo padding.
|
|
61
|
+
- El texto plano de títulos y descripciones de los diálogos se renderiza dentro de un `span` con `data-slot="dialog-swap-text"`.
|
|
62
|
+
- `Calendar` adopta el diseño de Arc: días redondos de 36 px, título a la izquierda, punto bajo el día de hoy y un disco de selección que se desliza entre días.
|
|
63
|
+
- Los controles anterior y siguiente de `Carousel` adoptan el diseño de Arc (redondos, con borde, 36 px) y el carrusel muestra el cursor de arrastre.
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- Las flechas del teclado dentro de un campo de texto de una diapositiva ya no mueven el `Carousel`.
|
|
68
|
+
- El día elegido de `Calendar` ya no pierde su color al pasar el puntero.
|
|
69
|
+
|
|
7
70
|
## [2.5.0] - 2026-10-15
|
|
8
71
|
|
|
9
72
|
### Added
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,7 +4,7 @@ beez-ui includes code adapted from the following projects.
|
|
|
4
4
|
|
|
5
5
|
## Arc
|
|
6
6
|
|
|
7
|
-
The theme tokens (`theme.css`, from Arc's `foundation.css`) and the `Button` API, styles and motion (`src/components/button.tsx`, `src/components/button-label.tsx`, `src/components/control-button.tsx`, `src/motion/arc-press.ts`, `src/motion/arc-tokens.ts`, `src/motion/use-morph-width.ts`), and the `ActionButton` and `SplitButton` components and their label morph (`src/components/action-button.tsx`, `src/components/split-button.tsx`, `src/components/morph-text.tsx`),
|
|
7
|
+
The theme tokens (`theme.css`, from Arc's `foundation.css`) and the `Button` API, styles and motion (`src/components/button.tsx`, `src/components/button-label.tsx`, `src/components/control-button.tsx`, `src/motion/arc-press.ts`, `src/motion/arc-tokens.ts`, `src/motion/use-morph-width.ts`), and the `ActionButton` and `SplitButton` components and their label morph (`src/components/action-button.tsx`, `src/components/split-button.tsx`, `src/components/morph-text.tsx`), the `Input` and `Textarea` fields with their animated helper and error rows (`src/components/input.tsx`, `src/components/textarea.tsx`, `src/components/field.tsx`), the `Switch`, `Checkbox` and `RadioGroup` controls (`src/components/switch.tsx`, `src/components/checkbox.tsx`, `src/components/radio-group.tsx`, `src/constants/switch.ts`, `src/constants/checkbox.ts`, `src/constants/radio-group.ts`), the `Badge`, `Avatar`, `Skeleton`, `Card` and `Alert` displays (`src/components/badge.tsx`, `src/components/avatar.tsx`, `src/components/skeleton.tsx`, `src/components/card.tsx`, `src/components/alert.tsx`), the `Tooltip`, `Popover` and `HoverCard` overlays and their motion (`src/components/tooltip.tsx`, `src/components/popover.tsx`, `src/components/hover-card.tsx`, `src/motion/arc-floating-slot.tsx`, `src/motion/overlay-warmth.ts`, `src/constants/tooltip.ts`, `src/constants/popover.ts`, `src/constants/hover-card.ts`), the `DropdownMenu` and `Select` menus (`src/components/dropdown-menu.tsx`, `src/components/select.tsx`), the `Tabs` and `Pagination` navigation (`src/components/tabs.tsx`, `src/components/pagination.tsx`, `src/constants/tabs.ts`), the `Dialog` and `AlertDialog` surfaces (`src/components/dialog.tsx`, `src/components/alert-dialog.tsx`, `src/components/dialog-surface.tsx`), and the `Calendar` and `Carousel` (`src/components/calendar.tsx`, `src/components/carousel.tsx`, `src/constants/calendar.ts`, `src/constants/carousel.ts`) are adapted from the free Arc library: https://uiarc.dev, https://github.com/kuratlielia/arc-library
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
MIT License
|
|
@@ -1,3 +1,8 @@
|
|
|
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 as `Dialog`, so both read as one family. It keeps beez-ui's center
|
|
4
|
+
* morph entrance, media slot and Arc `Button` actions.
|
|
5
|
+
*/
|
|
1
6
|
import * as React from "react";
|
|
2
7
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
3
8
|
import { Button } from "./button.js";
|
|
@@ -20,7 +25,7 @@ declare function AlertDialogContent({ className, size, ...props }: React.Compone
|
|
|
20
25
|
*/
|
|
21
26
|
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
22
27
|
/**
|
|
23
|
-
* Separates confirmation actions with an edge-to-edge
|
|
28
|
+
* Separates confirmation actions with an edge-to-edge footer under a hairline, bleeding through the panel padding.
|
|
24
29
|
* @param props - Primitive properties and optional consumer overrides.
|
|
25
30
|
* @returns The styled primitive with its original interaction contract.
|
|
26
31
|
*/
|
|
@@ -32,12 +37,18 @@ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps
|
|
|
32
37
|
*/
|
|
33
38
|
declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
34
39
|
/**
|
|
35
|
-
* Renders confirmation
|
|
40
|
+
* Renders the confirmation heading in Arc's title type. Plain text that changes while open swaps with Arc's rise.
|
|
41
|
+
* @param props - Primitive properties and optional consumer overrides.
|
|
42
|
+
* @returns The styled primitive with its original interaction contract.
|
|
43
|
+
*/
|
|
44
|
+
declare function AlertDialogTitle({ className, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* Renders the confirmation description in Arc's secondary text. Plain text that changes while open swaps with Arc's
|
|
47
|
+
* rise.
|
|
36
48
|
* @param props - Primitive properties and optional consumer overrides.
|
|
37
49
|
* @returns The styled primitive with its original interaction contract.
|
|
38
50
|
*/
|
|
39
|
-
declare function
|
|
40
|
-
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
51
|
+
declare function AlertDialogDescription({ className, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
41
52
|
/** Confirms the dialog with an Arc `Button`; Radix merges its behavior onto the button through `asChild`. */
|
|
42
53
|
declare function AlertDialogAction({ className, variant, size, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
43
54
|
/** Dismisses the dialog with an Arc secondary `Button` by default. */
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
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 as `Dialog`, so both read as one family. It keeps beez-ui's center
|
|
6
|
+
* morph entrance, media slot and Arc `Button` actions.
|
|
7
|
+
*/
|
|
3
8
|
import * as React from "react";
|
|
4
9
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
5
10
|
import { MotionSlot } from "../motion/motion-slot.js";
|
|
6
11
|
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
|
|
7
12
|
import { cn } from "../lib/utils.js";
|
|
8
13
|
import { Button } from "./button.js";
|
|
14
|
+
import { withDialogSwapText, dialogDescriptionClassName, dialogFooterClassName, dialogOverlayClassName, dialogSurfaceClassName, dialogTitleClassName } from "./dialog-surface.js";
|
|
9
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
16
|
function AlertDialog(t0) {
|
|
11
17
|
const $ = _c(9);
|
|
@@ -109,7 +115,7 @@ function AlertDialogOverlay(t0) {
|
|
|
109
115
|
}
|
|
110
116
|
let t1;
|
|
111
117
|
if ($[3] !== className) {
|
|
112
|
-
t1 = cn(
|
|
118
|
+
t1 = cn(dialogOverlayClassName, className);
|
|
113
119
|
$[3] = className;
|
|
114
120
|
$[4] = t1;
|
|
115
121
|
} else {
|
|
@@ -165,7 +171,7 @@ function AlertDialogContent(t0) {
|
|
|
165
171
|
}
|
|
166
172
|
let t4;
|
|
167
173
|
if ($[5] !== className) {
|
|
168
|
-
t4 = cn("group/alert-dialog-content fixed top-1/2 left-1/2
|
|
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);
|
|
169
175
|
$[5] = className;
|
|
170
176
|
$[6] = t4;
|
|
171
177
|
} else {
|
|
@@ -228,7 +234,7 @@ function AlertDialogHeader(t0) {
|
|
|
228
234
|
}
|
|
229
235
|
let t1;
|
|
230
236
|
if ($[3] !== className) {
|
|
231
|
-
t1 = cn("grid grid-rows-[auto_1fr] place-items-center gap-
|
|
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);
|
|
232
238
|
$[3] = className;
|
|
233
239
|
$[4] = t1;
|
|
234
240
|
} else {
|
|
@@ -250,7 +256,7 @@ function AlertDialogHeader(t0) {
|
|
|
250
256
|
return t2;
|
|
251
257
|
}
|
|
252
258
|
/**
|
|
253
|
-
* Separates confirmation actions with an edge-to-edge
|
|
259
|
+
* Separates confirmation actions with an edge-to-edge footer under a hairline, bleeding through the panel padding.
|
|
254
260
|
* @param props - Primitive properties and optional consumer overrides.
|
|
255
261
|
* @returns The styled primitive with its original interaction contract.
|
|
256
262
|
*/
|
|
@@ -269,7 +275,7 @@ function AlertDialogFooter(t0) {
|
|
|
269
275
|
}
|
|
270
276
|
let t1;
|
|
271
277
|
if ($[3] !== className) {
|
|
272
|
-
t1 = cn("
|
|
278
|
+
t1 = cn(dialogFooterClassName, "group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2", className);
|
|
273
279
|
$[3] = className;
|
|
274
280
|
$[4] = t1;
|
|
275
281
|
} else {
|
|
@@ -332,81 +338,115 @@ function AlertDialogMedia(t0) {
|
|
|
332
338
|
return t2;
|
|
333
339
|
}
|
|
334
340
|
/**
|
|
335
|
-
* Renders confirmation
|
|
341
|
+
* Renders the confirmation heading in Arc's title type. Plain text that changes while open swaps with Arc's rise.
|
|
336
342
|
* @param props - Primitive properties and optional consumer overrides.
|
|
337
343
|
* @returns The styled primitive with its original interaction contract.
|
|
338
344
|
*/
|
|
339
345
|
function AlertDialogTitle(t0) {
|
|
340
|
-
const $ = _c(
|
|
346
|
+
const $ = _c(13);
|
|
347
|
+
let children;
|
|
341
348
|
let className;
|
|
342
349
|
let props;
|
|
343
350
|
if ($[0] !== t0) {
|
|
344
|
-
({className, ...props} = t0);
|
|
351
|
+
({className, children, ...props} = t0);
|
|
345
352
|
$[0] = t0;
|
|
346
|
-
$[1] =
|
|
347
|
-
$[2] =
|
|
353
|
+
$[1] = children;
|
|
354
|
+
$[2] = className;
|
|
355
|
+
$[3] = props;
|
|
348
356
|
} else {
|
|
349
|
-
|
|
350
|
-
|
|
357
|
+
children = $[1];
|
|
358
|
+
className = $[2];
|
|
359
|
+
props = $[3];
|
|
351
360
|
}
|
|
352
361
|
let t1;
|
|
353
|
-
if ($[
|
|
354
|
-
t1 = cn("
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
362
|
+
if ($[4] !== className) {
|
|
363
|
+
t1 = cn(dialogTitleClassName, "sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className);
|
|
364
|
+
$[4] = className;
|
|
365
|
+
$[5] = t1;
|
|
357
366
|
} else {
|
|
358
|
-
t1 = $[
|
|
367
|
+
t1 = $[5];
|
|
359
368
|
}
|
|
360
369
|
let t2;
|
|
361
|
-
if ($[
|
|
362
|
-
t2 =
|
|
370
|
+
if ($[6] !== children || $[7] !== props.asChild) {
|
|
371
|
+
t2 = withDialogSwapText(children, props.asChild);
|
|
372
|
+
$[6] = children;
|
|
373
|
+
$[7] = props.asChild;
|
|
374
|
+
$[8] = t2;
|
|
375
|
+
} else {
|
|
376
|
+
t2 = $[8];
|
|
377
|
+
}
|
|
378
|
+
let t3;
|
|
379
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
|
|
380
|
+
t3 = /* @__PURE__ */ _jsx(AlertDialogPrimitive.Title, {
|
|
363
381
|
"data-slot": "alert-dialog-title",
|
|
364
382
|
className: t1,
|
|
365
|
-
...props
|
|
383
|
+
...props,
|
|
384
|
+
children: t2
|
|
366
385
|
});
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
386
|
+
$[9] = props;
|
|
387
|
+
$[10] = t1;
|
|
388
|
+
$[11] = t2;
|
|
389
|
+
$[12] = t3;
|
|
370
390
|
} else {
|
|
371
|
-
|
|
391
|
+
t3 = $[12];
|
|
372
392
|
}
|
|
373
|
-
return
|
|
393
|
+
return t3;
|
|
374
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* Renders the confirmation description in Arc's secondary text. Plain text that changes while open swaps with Arc's
|
|
397
|
+
* rise.
|
|
398
|
+
* @param props - Primitive properties and optional consumer overrides.
|
|
399
|
+
* @returns The styled primitive with its original interaction contract.
|
|
400
|
+
*/
|
|
375
401
|
function AlertDialogDescription(t0) {
|
|
376
|
-
const $ = _c(
|
|
402
|
+
const $ = _c(13);
|
|
403
|
+
let children;
|
|
377
404
|
let className;
|
|
378
405
|
let props;
|
|
379
406
|
if ($[0] !== t0) {
|
|
380
|
-
({className, ...props} = t0);
|
|
407
|
+
({className, children, ...props} = t0);
|
|
381
408
|
$[0] = t0;
|
|
382
|
-
$[1] =
|
|
383
|
-
$[2] =
|
|
409
|
+
$[1] = children;
|
|
410
|
+
$[2] = className;
|
|
411
|
+
$[3] = props;
|
|
384
412
|
} else {
|
|
385
|
-
|
|
386
|
-
|
|
413
|
+
children = $[1];
|
|
414
|
+
className = $[2];
|
|
415
|
+
props = $[3];
|
|
387
416
|
}
|
|
388
417
|
let t1;
|
|
389
|
-
if ($[
|
|
390
|
-
t1 = cn("text-
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
418
|
+
if ($[4] !== className) {
|
|
419
|
+
t1 = cn(dialogDescriptionClassName, "text-balance md:text-pretty", className);
|
|
420
|
+
$[4] = className;
|
|
421
|
+
$[5] = t1;
|
|
393
422
|
} else {
|
|
394
|
-
t1 = $[
|
|
423
|
+
t1 = $[5];
|
|
395
424
|
}
|
|
396
425
|
let t2;
|
|
397
|
-
if ($[
|
|
398
|
-
t2 =
|
|
426
|
+
if ($[6] !== children || $[7] !== props.asChild) {
|
|
427
|
+
t2 = withDialogSwapText(children, props.asChild);
|
|
428
|
+
$[6] = children;
|
|
429
|
+
$[7] = props.asChild;
|
|
430
|
+
$[8] = t2;
|
|
431
|
+
} else {
|
|
432
|
+
t2 = $[8];
|
|
433
|
+
}
|
|
434
|
+
let t3;
|
|
435
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
|
|
436
|
+
t3 = /* @__PURE__ */ _jsx(AlertDialogPrimitive.Description, {
|
|
399
437
|
"data-slot": "alert-dialog-description",
|
|
400
438
|
className: t1,
|
|
401
|
-
...props
|
|
439
|
+
...props,
|
|
440
|
+
children: t2
|
|
402
441
|
});
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
442
|
+
$[9] = props;
|
|
443
|
+
$[10] = t1;
|
|
444
|
+
$[11] = t2;
|
|
445
|
+
$[12] = t3;
|
|
406
446
|
} else {
|
|
407
|
-
|
|
447
|
+
t3 = $[12];
|
|
408
448
|
}
|
|
409
|
-
return
|
|
449
|
+
return t3;
|
|
410
450
|
}
|
|
411
451
|
/** Confirms the dialog with an Arc `Button`; Radix merges its behavior onto the button through `asChild`. */
|
|
412
452
|
function AlertDialogAction(t0) {
|
|
@@ -1,10 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { AlertTone } from "../constants/alert.js";
|
|
3
|
+
export type { AlertTone };
|
|
4
|
+
/** shadcn-compatible variants; `destructive` is drawn with Arc's danger tone. */
|
|
5
|
+
export type AlertVariant = "default" | "destructive";
|
|
6
|
+
export type AlertProps = ComponentProps<"div"> & {
|
|
7
|
+
variant?: AlertVariant | null;
|
|
8
|
+
/**
|
|
9
|
+
* Arc's semantic tone: tints and picks the icon, and sets the live-region role (`alert` for danger, `status` for
|
|
10
|
+
* the rest). Without a tone the alert keeps `role="alert"`.
|
|
11
|
+
*/
|
|
12
|
+
tone?: AlertTone;
|
|
13
|
+
/** Replaces the tone icon, or hides it with `false`. Without a tone, place an svg as the first child instead. */
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
/** Controls presence: hiding the alert collapses its height while it fades out. */
|
|
16
|
+
open?: boolean;
|
|
17
|
+
/** Shows a dismiss button. An uncontrolled alert collapses first and then calls this. */
|
|
18
|
+
onDismiss?: () => void;
|
|
19
|
+
/** Accessible name of the dismiss button; defaults to "Descartar aviso". */
|
|
20
|
+
dismissLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A persistent message. Compose it with `AlertTitle`, `AlertDescription` and `AlertAction`.
|
|
24
|
+
* @param props - Variant, Arc tone and icon, optional presence and dismissal, plus native div attributes.
|
|
25
|
+
* @returns The alert; with `open` or `onDismiss` it collapses its own height when hidden.
|
|
26
|
+
*/
|
|
27
|
+
declare function Alert({ open, onDismiss, ref: consumerRef, ...props }: AlertProps): import("react").JSX.Element;
|
|
28
|
+
declare function AlertTitle({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
29
|
+
declare function AlertDescription({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
30
|
+
declare function AlertAction({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
10
31
|
export { Alert, AlertTitle, AlertDescription, AlertAction };
|