beez-ui 0.5.2 → 0.5.4

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 (51) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +66 -3
  3. package/dist/components/alert-dialog.js +72 -28
  4. package/dist/components/alert.js +9 -5
  5. package/dist/components/animated-theme-toggler.js +113 -97
  6. package/dist/components/avatar.js +22 -15
  7. package/dist/components/badge.js +9 -5
  8. package/dist/components/button.js +11 -7
  9. package/dist/components/card.js +9 -5
  10. package/dist/components/carousel.js +59 -55
  11. package/dist/components/checkbox.js +16 -9
  12. package/dist/components/dialog.js +77 -33
  13. package/dist/components/dropdown-menu.js +126 -49
  14. package/dist/components/form.js +16 -9
  15. package/dist/components/highlighter.js +18 -12
  16. package/dist/components/hover-card.js +60 -21
  17. package/dist/components/input-group.js +9 -5
  18. package/dist/components/input.js +9 -5
  19. package/dist/components/label.js +8 -4
  20. package/dist/components/link.d.ts +0 -1
  21. package/dist/components/link.js +28 -20
  22. package/dist/components/popover.js +66 -25
  23. package/dist/components/radio-group.js +16 -9
  24. package/dist/components/select.js +34 -24
  25. package/dist/components/separator.js +9 -5
  26. package/dist/components/sheet.js +78 -34
  27. package/dist/components/sidebar.js +21 -14
  28. package/dist/components/skeleton.js +8 -4
  29. package/dist/components/svgs/whatsappIcon.js +14 -9
  30. package/dist/components/switch.js +16 -9
  31. package/dist/components/table.js +8 -4
  32. package/dist/components/tabs.js +15 -8
  33. package/dist/components/textarea.js +8 -4
  34. package/dist/components/themed-toaster.js +61 -27
  35. package/dist/components/tooltip.js +70 -29
  36. package/dist/components/typing-animation.js +80 -58
  37. package/dist/constants/motion.d.ts +2 -0
  38. package/dist/constants/motion.js +2 -0
  39. package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
  40. package/dist/hooks/use-prefers-reduced-motion.js +27 -0
  41. package/dist/lib/utils.d.ts +1 -1
  42. package/dist/lib/utils.js +1 -1
  43. package/dist/motion/motion-slot.d.ts +9 -0
  44. package/dist/motion/motion-slot.js +353 -0
  45. package/dist/motion/presence.d.ts +33 -0
  46. package/dist/motion/presence.js +92 -0
  47. package/dist/motion/tokens.d.ts +13 -0
  48. package/dist/motion/tokens.js +17 -0
  49. package/dist/providers/beez-ui-provider.js +7 -3
  50. package/dist/styles.css +1 -1
  51. package/package.json +13 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Cambios
2
2
 
3
+ ## 0.5.4 - 2026-09-09
4
+
5
+ - Actualiza el paquete a la versión 0.5.4.
6
+
7
+ ## 0.5.3 - 2026-09-09
8
+
9
+ - Actualiza el paquete a la versión 0.5.3.
10
+
3
11
  ## 0.5.2 - 2026-09-09
4
12
 
5
13
  - Actualiza el paquete a la versión 0.5.2.
package/README.md CHANGED
@@ -2,13 +2,44 @@
2
2
 
3
3
  Biblioteca de componentes React reutilizables, con adaptadores opcionales por framework y tema compartido. Reúne los componentes de LaTribu y las funcionalidades reutilizables de agenda-mensual.
4
4
 
5
- ## Consumo
5
+ ## Storybook
6
+
7
+ ```bash
8
+ pnpm storybook
9
+ ```
10
+
11
+ Abre `http://localhost:6006` para explorar los componentes con controles de texto,
12
+ variantes, tamaños, estados y comportamiento. El selector de la barra permite
13
+ probar el tema claro, oscuro o del sistema. Las stories de componentes compuestos
14
+ incluyen sus piezas en ejemplos completos; los campos editables y selectores
15
+ sincronizan sus interacciones con Controls. `BeezUIProvider` configura el preview
16
+ y no forma parte del catálogo. Las notificaciones se exploran en `ThemedToaster`,
17
+ sin duplicar una story de `Toaster`; `WhatsappIcon` está en la sección `Icons`.
18
+
19
+ ```bash
20
+ pnpm build-storybook # Genera storybook-static para servirlo o publicarlo
21
+ pnpm typecheck:stories # Comprueba stories y configuración con TypeScript
22
+ pnpm test:storybook # Build y navegación/interacciones en Chromium y WebKit
23
+ ```
24
+
25
+ El catálogo consume los exports públicos y el CSS compilado de la librería. Los
26
+ scripts compilan `beez-ui` antes de arrancar; si editás sus fuentes con Storybook
27
+ abierto, ejecutá `pnpm build` para actualizar el paquete que muestra el preview.
28
+ Los cambios en las stories se actualizan durante el desarrollo. Storybook y sus
29
+ addons son dependencias de desarrollo y no se incluyen en el paquete publicado.
30
+
31
+ Configuración basada en [React con Vite](https://storybook.js.org/docs/get-started/frameworks/react-vite)
32
+ y [Controls](https://storybook.js.org/docs/essentials/controls).
33
+
34
+ ## Uso del paquete
6
35
 
7
36
  ```tsx
8
37
  import { Button, Avatar, AvatarImage, DataTable, Calendar } from "beez-ui";
9
38
  ```
10
39
 
11
- Agrupar los imports de componentes desde la raíz. El paquete publica JavaScript ESM y declaraciones TypeScript en `dist`; el consumidor no necesita transpilar el código fuente de la librería. La gramática de filtros y los helpers de mes-año son independientes de React.
40
+ Agrupar los imports de componentes desde la raíz. El paquete publica JavaScript ESM y declaraciones TypeScript en `dist`; el consumidor no necesita transpilar el código fuente de la librería. La gramática de filtros y los helpers de mes-año son independientes de React.
41
+
42
+ La utilidad `cn`, también exportada desde `beez-ui`, usa el paquete `cn` para combinar clases condicionales y resolver conflictos de Tailwind.
12
43
 
13
44
  ```css
14
45
  @import "beez-ui/styles.css";
@@ -24,7 +55,39 @@ Los componentes usan por defecto los espaciados compactos de Agenda: `Select` mi
24
55
 
25
56
  Los `Sheet` superiores e inferiores limitan su altura al viewport dinámico (`100dvh`) y permiten desplazar el contenido para mantener accesibles las acciones de paneles largos.
26
57
 
27
- ## Providers de UI
58
+ ## Movimiento
59
+
60
+ Las nuevas animaciones usan la dependencia `motion`: `animate` controla la
61
+ reproducción, `hover` y `press` los gestos, y `AnimatePresence` / `usePresence`
62
+ retienen los overlays durante su salida. Los presets y tiempos viven en
63
+ `src/motion/`. No se usan keyframes CSS para estas animaciones.
64
+
65
+ `MotionSlot` anima el nodo original del primitive mediante refs compuestos,
66
+ sin agregar wrappers al DOM ni reemplazar sus handlers. Las pulsaciones reducen
67
+ la escala a 0.98; cards y enlaces responden al hover; campos e indicadores
68
+ responden al foco y la selección. Menús, popovers, diálogos y sheets usan entradas
69
+ cortas y salidas de 120 ms. El skeleton pulsa con Motion. Las animaciones
70
+ especializadas existentes de Embla, Sonner y rough-notation se conservan.
71
+
72
+ El contenido que está saliendo deja de ser interactivo y accesible de inmediato.
73
+ Cada familia de overlays tiene un contexto de visibilidad independiente para
74
+ soportar composiciones anidadas; los portales sin nodo visible no bloquean el
75
+ cierre del padre. `Select` conserva su desmontaje nativo y usa Motion en la entrada.
76
+ La elección explícita de `forceMount` permanece bajo control del consumidor.
77
+
78
+ Se respeta `prefers-reduced-motion`: las nuevas animaciones se cancelan y se
79
+ restauran los estilos; las anotaciones se dibujan sin animación y el texto aparece
80
+ completo, incluidas todas las palabras de una secuencia. Los controles del carrusel
81
+ avanzan directamente. El CSS solo aporta el fallback de movimiento reducido para
82
+ los efectos heredados. `BeezUIProvider` configura `MotionConfig` con
83
+ `reducedMotion="user"`. El primer render conserva el contrato de SSR.
84
+
85
+ El selector aplica el tema inmediatamente y anima su icono con Motion; no depende
86
+ de View Transitions nativas ni de una animación para completar el cambio. Los estilos temporales se liberan al terminar
87
+ la reproducción. Las stories permiten probar los gestos y estados reales; el
88
+ selector de tema de la story y la barra de Storybook se mantienen sincronizados.
89
+
90
+ ## Providers de UI
28
91
 
29
92
  Elegir un único `BeezUIProvider` según el framework. Los componentes y `useTheme` siempre se importan desde `beez-ui`.
30
93
 
@@ -2,11 +2,13 @@
2
2
  import { c as _c } from "react/compiler-runtime";
3
3
  import * as React from "react";
4
4
  import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
5
+ import { MotionSlot } from "../motion/motion-slot.js";
6
+ import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
5
7
  import { cn } from "../lib/utils.js";
6
8
  import { Button } from "./button.js";
7
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
10
  function AlertDialog(t0) {
9
- const $ = _c(4);
11
+ const $ = _c(9);
10
12
  let props;
11
13
  if ($[0] !== t0) {
12
14
  ({...props} = t0);
@@ -15,18 +17,36 @@ function AlertDialog(t0) {
15
17
  } else {
16
18
  props = $[1];
17
19
  }
20
+ const [motionOpen, setMotionOpen] = useMotionOpenState(props);
18
21
  let t1;
19
- if ($[2] !== props) {
22
+ if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
20
23
  t1 = /* @__PURE__ */ _jsx(AlertDialogPrimitive.Root, {
21
24
  "data-slot": "alert-dialog",
22
- ...props
25
+ ...props,
26
+ open: motionOpen,
27
+ onOpenChange: setMotionOpen
23
28
  });
24
- $[2] = props;
25
- $[3] = t1;
29
+ $[2] = motionOpen;
30
+ $[3] = props;
31
+ $[4] = setMotionOpen;
32
+ $[5] = t1;
26
33
  } else {
27
- t1 = $[3];
34
+ t1 = $[5];
28
35
  }
29
- return t1;
36
+ let t2;
37
+ if ($[6] !== motionOpen || $[7] !== t1) {
38
+ t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
39
+ scope: "alert-dialog",
40
+ open: motionOpen,
41
+ children: t1
42
+ });
43
+ $[6] = motionOpen;
44
+ $[7] = t1;
45
+ $[8] = t2;
46
+ } else {
47
+ t2 = $[8];
48
+ }
49
+ return t2;
30
50
  }
31
51
  function AlertDialogTrigger(t0) {
32
52
  const $ = _c(4);
@@ -89,7 +109,7 @@ function AlertDialogOverlay(t0) {
89
109
  }
90
110
  let t1;
91
111
  if ($[3] !== className) {
92
- t1 = cn("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className);
112
+ t1 = cn("fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs ", className);
93
113
  $[3] = className;
94
114
  $[4] = t1;
95
115
  } else {
@@ -116,7 +136,7 @@ function AlertDialogOverlay(t0) {
116
136
  * @returns The styled primitive with its original interaction contract.
117
137
  */
118
138
  function AlertDialogContent(t0) {
119
- const $ = _c(11);
139
+ const $ = _c(14);
120
140
  let className;
121
141
  let props;
122
142
  let t1;
@@ -132,37 +152,61 @@ function AlertDialogContent(t0) {
132
152
  t1 = $[3];
133
153
  }
134
154
  const size = t1 === undefined ? "default" : t1;
135
- let t2;
155
+ const t2 = props.forceMount;
156
+ let t3;
136
157
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
137
- t2 = /* @__PURE__ */ _jsx(AlertDialogOverlay, {});
138
- $[4] = t2;
158
+ t3 = /* @__PURE__ */ _jsx(MotionSlot, {
159
+ kind: "overlay",
160
+ children: /* @__PURE__ */ _jsx(AlertDialogOverlay, { forceMount: true })
161
+ });
162
+ $[4] = t3;
139
163
  } else {
140
- t2 = $[4];
164
+ t3 = $[4];
141
165
  }
142
- let t3;
166
+ let t4;
143
167
  if ($[5] !== className) {
144
- t3 = cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100svh-2rem)] overflow-y-auto overscroll-contain w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className);
168
+ t4 = cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100svh-2rem)] overflow-y-auto overscroll-contain w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm ", className);
145
169
  $[5] = className;
146
- $[6] = t3;
170
+ $[6] = t4;
147
171
  } else {
148
- t3 = $[6];
172
+ t4 = $[6];
149
173
  }
150
- let t4;
151
- if ($[7] !== props || $[8] !== size || $[9] !== t3) {
152
- t4 = /* @__PURE__ */ _jsxs(AlertDialogPortal, { children: [t2, /* @__PURE__ */ _jsx(AlertDialogPrimitive.Content, {
153
- "data-slot": "alert-dialog-content",
154
- "data-size": size,
155
- className: t3,
156
- ...props
174
+ let t5;
175
+ if ($[7] !== props || $[8] !== size || $[9] !== t4) {
176
+ t5 = /* @__PURE__ */ _jsxs(React.Fragment, { children: [t3, /* @__PURE__ */ _jsx(MotionSlot, {
177
+ kind: "dialog",
178
+ children: /* @__PURE__ */ _jsx(AlertDialogPrimitive.Content, {
179
+ forceMount: true,
180
+ "data-slot": "alert-dialog-content",
181
+ "data-size": size,
182
+ className: t4,
183
+ ...props
184
+ })
157
185
  })] });
158
186
  $[7] = props;
159
187
  $[8] = size;
160
- $[9] = t3;
161
- $[10] = t4;
188
+ $[9] = t4;
189
+ $[10] = t5;
190
+ } else {
191
+ t5 = $[10];
192
+ }
193
+ let t6;
194
+ if ($[11] !== props.forceMount || $[12] !== t5) {
195
+ t6 = /* @__PURE__ */ _jsx(AlertDialogPortal, {
196
+ forceMount: true,
197
+ children: /* @__PURE__ */ _jsx(MotionPresence, {
198
+ scope: "alert-dialog",
199
+ forceMount: t2,
200
+ children: t5
201
+ })
202
+ });
203
+ $[11] = props.forceMount;
204
+ $[12] = t5;
205
+ $[13] = t6;
162
206
  } else {
163
- t4 = $[10];
207
+ t6 = $[13];
164
208
  }
165
- return t4;
209
+ return t6;
166
210
  }
167
211
  /**
168
212
  * Aligns confirmation headings and media with compact spacing.
@@ -2,6 +2,7 @@
2
2
  import { c as _c } from "react/compiler-runtime";
3
3
  import * as React from "react";
4
4
  import { cva } from "class-variance-authority";
5
+ import { MotionSlot } from "../motion/motion-slot.js";
5
6
  import { cn } from "../lib/utils.js";
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  const alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
@@ -38,11 +39,14 @@ function Alert(t0) {
38
39
  }
39
40
  let t2;
40
41
  if ($[7] !== props || $[8] !== t1) {
41
- t2 = /* @__PURE__ */ _jsx("div", {
42
- "data-slot": "alert",
43
- role: "alert",
44
- className: t1,
45
- ...props
42
+ t2 = /* @__PURE__ */ _jsx(MotionSlot, {
43
+ kind: "fade",
44
+ children: /* @__PURE__ */ _jsx("div", {
45
+ "data-slot": "alert",
46
+ role: "alert",
47
+ className: t1,
48
+ ...props
49
+ })
46
50
  });
47
51
  $[7] = props;
48
52
  $[8] = t1;
@@ -1,10 +1,12 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
- import { useRef, useSyncExternalStore } from "react";
3
+ import { useEffect, useRef, useSyncExternalStore } from "react";
4
4
  import { Monitor, Moon, Sun, SunMoon } from "lucide-react";
5
- import { flushSync } from "react-dom";
5
+ import { animate, frame } from "motion/react";
6
+ import { MOTION_EASE } from "../motion/tokens.js";
6
7
  import { useTheme } from "next-themes";
7
8
  import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
9
+ import { REDUCED_MOTION_QUERY } from "../constants/motion.js";
8
10
  import { cn } from "../lib/utils.js";
9
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
12
  const THEME_OPTIONS = [
@@ -24,12 +26,10 @@ const THEME_OPTIONS = [
24
26
  value: "system"
25
27
  }
26
28
  ];
27
- /** Restricts transition styling to theme changes initiated by this component. */
28
- const THEME_TRANSITION_CLASS = "BeezThemeTransition";
29
- /** Respects user preferences when deciding whether to animate a theme change. */
30
- const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
29
+ /** Converts the public duration (milliseconds) to Motion seconds. */
30
+ const MILLISECONDS_PER_SECOND = 1e3;
31
31
  export const AnimatedThemeToggler = (t0) => {
32
- const $ = _c(32);
32
+ const $ = _c(34);
33
33
  let className;
34
34
  let controlledOnThemeChange;
35
35
  let controlledResolvedTheme;
@@ -62,143 +62,163 @@ export const AnimatedThemeToggler = (t0) => {
62
62
  const resolvedTheme = controlledResolvedTheme ?? providerTheme.resolvedTheme;
63
63
  const onThemeChange = controlledOnThemeChange ?? providerTheme.setTheme;
64
64
  const buttonRef = useRef(null);
65
+ const animationRef = useRef(null);
66
+ let t2;
67
+ let t3;
68
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
69
+ t2 = () => () => {
70
+ animationRef.current?.cancel();
71
+ animationRef.current = null;
72
+ };
73
+ t3 = [];
74
+ $[8] = t2;
75
+ $[9] = t3;
76
+ } else {
77
+ t2 = $[8];
78
+ t3 = $[9];
79
+ }
80
+ useEffect(t2, t3);
65
81
  const isHydrated = useSyncExternalStore(_temp2, _temp3, _temp4);
66
82
  const isThemeReady = isHydrated && (resolvedTheme === "light" || resolvedTheme === "dark");
67
83
  const isDark = resolvedTheme === "dark";
68
84
  const selectedTheme = theme === "light" || theme === "dark" || theme === "system" ? theme : "system";
69
85
  const isDisabled = !isThemeReady || disabled;
70
- let t2;
71
- if ($[8] !== duration || $[9] !== isDisabled || $[10] !== onThemeChange) {
72
- t2 = (nextTheme) => {
86
+ let t4;
87
+ if ($[10] !== duration || $[11] !== isDisabled || $[12] !== onThemeChange) {
88
+ t4 = (nextTheme) => {
73
89
  const button = buttonRef.current;
74
90
  if (!button || typeof document === "undefined" || isDisabled) {
75
91
  return;
76
92
  }
77
- const { top, left, width, height } = button.getBoundingClientRect();
78
- const x = left + width / 2;
79
- const y = top + height / 2;
80
- const viewportWidth = window.visualViewport?.width ?? window.innerWidth;
81
- const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
82
- const maxRadius = Math.hypot(Math.max(x, viewportWidth - x), Math.max(y, viewportHeight - y));
83
- const applyTheme = () => {
84
- onThemeChange(nextTheme);
85
- };
86
- if (typeof document.startViewTransition !== "function" || typeof document.documentElement.animate !== "function" || window.matchMedia?.(REDUCED_MOTION_QUERY).matches) {
87
- applyTheme();
93
+ onThemeChange(nextTheme);
94
+ animationRef.current?.cancel();
95
+ if (window.matchMedia?.(REDUCED_MOTION_QUERY).matches || !Number.isFinite(duration) || duration <= 0) {
88
96
  return;
89
97
  }
90
- document.documentElement.classList.add(THEME_TRANSITION_CLASS);
91
- const transition = document.startViewTransition(() => {
92
- flushSync(applyTheme);
98
+ const original = {
99
+ transform: button.style.transform,
100
+ opacity: button.style.opacity
101
+ };
102
+ const animation = animate(button, {
103
+ transform: ["rotate(-8deg)", "rotate(0deg)"],
104
+ opacity: [.65, 1]
105
+ }, {
106
+ duration: duration / MILLISECONDS_PER_SECOND,
107
+ ease: [...MOTION_EASE]
93
108
  });
94
- transition.ready.then(() => document.documentElement.animate({ clipPath: [`circle(0px at ${x}px ${y}px)`, `circle(${maxRadius}px at ${x}px ${y}px)`] }, {
95
- duration,
96
- easing: "ease-in-out",
97
- pseudoElement: "::view-transition-new(root)"
98
- }).finished).catch(_temp5).finally(_temp6);
109
+ animationRef.current = animation;
110
+ animation.then(() => frame.postRender(() => {
111
+ if (animationRef.current !== animation) {
112
+ return;
113
+ }
114
+ button.style.transform = original.transform;
115
+ button.style.opacity = original.opacity;
116
+ animationRef.current = null;
117
+ }));
99
118
  };
100
- $[8] = duration;
101
- $[9] = isDisabled;
102
- $[10] = onThemeChange;
103
- $[11] = t2;
119
+ $[10] = duration;
120
+ $[11] = isDisabled;
121
+ $[12] = onThemeChange;
122
+ $[13] = t4;
104
123
  } else {
105
- t2 = $[11];
124
+ t4 = $[13];
106
125
  }
107
- const selectTheme = t2;
108
- let t3;
109
- if ($[12] !== className) {
110
- t3 = cn(className);
111
- $[12] = className;
112
- $[13] = t3;
126
+ const selectTheme = t4;
127
+ let t5;
128
+ if ($[14] !== className) {
129
+ t5 = cn(className);
130
+ $[14] = className;
131
+ $[15] = t5;
113
132
  } else {
114
- t3 = $[13];
133
+ t5 = $[15];
115
134
  }
116
- let t4;
117
- if ($[14] !== isDark || $[15] !== isThemeReady) {
118
- t4 = !isThemeReady ? /* @__PURE__ */ _jsx(SunMoon, { "aria-hidden": "true" }) : isDark ? /* @__PURE__ */ _jsx(Moon, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsx(Sun, { "aria-hidden": "true" });
119
- $[14] = isDark;
120
- $[15] = isThemeReady;
121
- $[16] = t4;
135
+ let t6;
136
+ if ($[16] !== isDark || $[17] !== isThemeReady) {
137
+ t6 = !isThemeReady ? /* @__PURE__ */ _jsx(SunMoon, { "aria-hidden": "true" }) : isDark ? /* @__PURE__ */ _jsx(Moon, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsx(Sun, { "aria-hidden": "true" });
138
+ $[16] = isDark;
139
+ $[17] = isThemeReady;
140
+ $[18] = t6;
122
141
  } else {
123
- t4 = $[16];
142
+ t6 = $[18];
124
143
  }
125
- let t5;
126
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
127
- t5 = /* @__PURE__ */ _jsx("span", {
144
+ let t7;
145
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
146
+ t7 = /* @__PURE__ */ _jsx("span", {
128
147
  className: "sr-only",
129
148
  children: "Alternar tema"
130
149
  });
131
- $[17] = t5;
150
+ $[19] = t7;
132
151
  } else {
133
- t5 = $[17];
152
+ t7 = $[19];
134
153
  }
135
- let t6;
136
- if ($[18] !== isDisabled || $[19] !== props || $[20] !== t3 || $[21] !== t4) {
137
- t6 = /* @__PURE__ */ _jsx(DropdownMenuTrigger, {
154
+ let t8;
155
+ if ($[20] !== isDisabled || $[21] !== props || $[22] !== t5 || $[23] !== t6) {
156
+ t8 = /* @__PURE__ */ _jsx(DropdownMenuTrigger, {
138
157
  asChild: true,
139
158
  children: /* @__PURE__ */ _jsxs("button", {
140
159
  type: "button",
141
160
  ref: buttonRef,
142
161
  disabled: isDisabled,
143
- className: t3,
162
+ className: t5,
144
163
  ...props,
145
- children: [t4, t5]
164
+ children: [t6, t7]
146
165
  })
147
166
  });
148
- $[18] = isDisabled;
149
- $[19] = props;
150
- $[20] = t3;
151
- $[21] = t4;
152
- $[22] = t6;
167
+ $[20] = isDisabled;
168
+ $[21] = props;
169
+ $[22] = t5;
170
+ $[23] = t6;
171
+ $[24] = t8;
153
172
  } else {
154
- t6 = $[22];
173
+ t8 = $[24];
155
174
  }
156
- let t7;
157
- if ($[23] !== selectTheme) {
158
- t7 = (nextTheme_0) => {
175
+ let t9;
176
+ if ($[25] !== selectTheme) {
177
+ t9 = (nextTheme_0) => {
159
178
  selectTheme(nextTheme_0);
160
179
  };
161
- $[23] = selectTheme;
162
- $[24] = t7;
180
+ $[25] = selectTheme;
181
+ $[26] = t9;
163
182
  } else {
164
- t7 = $[24];
183
+ t9 = $[26];
165
184
  }
166
- let t8;
167
- if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
168
- t8 = THEME_OPTIONS.map(_temp7);
169
- $[25] = t8;
185
+ let t10;
186
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
187
+ t10 = THEME_OPTIONS.map(_temp5);
188
+ $[27] = t10;
170
189
  } else {
171
- t8 = $[25];
190
+ t10 = $[27];
172
191
  }
173
- let t9;
174
- if ($[26] !== selectedTheme || $[27] !== t7) {
175
- t9 = /* @__PURE__ */ _jsx(DropdownMenuContent, {
192
+ let t11;
193
+ if ($[28] !== selectedTheme || $[29] !== t9) {
194
+ t11 = /* @__PURE__ */ _jsx(DropdownMenuContent, {
195
+ "data-beez-theme-menu": true,
176
196
  align: "end",
177
197
  className: "w-44 rounded-xl p-2",
178
198
  side: "bottom",
179
199
  sideOffset: 8,
180
200
  children: /* @__PURE__ */ _jsx(DropdownMenuRadioGroup, {
181
- onValueChange: t7,
201
+ onValueChange: t9,
182
202
  value: selectedTheme,
183
- children: t8
203
+ children: t10
184
204
  })
185
205
  });
186
- $[26] = selectedTheme;
187
- $[27] = t7;
188
- $[28] = t9;
206
+ $[28] = selectedTheme;
207
+ $[29] = t9;
208
+ $[30] = t11;
189
209
  } else {
190
- t9 = $[28];
210
+ t11 = $[30];
191
211
  }
192
- let t10;
193
- if ($[29] !== t6 || $[30] !== t9) {
194
- t10 = /* @__PURE__ */ _jsxs(DropdownMenu, { children: [t6, t9] });
195
- $[29] = t6;
196
- $[30] = t9;
197
- $[31] = t10;
212
+ let t12;
213
+ if ($[31] !== t11 || $[32] !== t8) {
214
+ t12 = /* @__PURE__ */ _jsxs(DropdownMenu, { children: [t8, t11] });
215
+ $[31] = t11;
216
+ $[32] = t8;
217
+ $[33] = t12;
198
218
  } else {
199
- t10 = $[31];
219
+ t12 = $[33];
200
220
  }
201
- return t10;
221
+ return t12;
202
222
  };
203
223
  function _temp() {}
204
224
  function _temp2() {
@@ -210,11 +230,7 @@ function _temp3() {
210
230
  function _temp4() {
211
231
  return false;
212
232
  }
213
- function _temp5() {}
214
- function _temp6() {
215
- document.documentElement.classList.remove(THEME_TRANSITION_CLASS);
216
- }
217
- function _temp7(t0) {
233
+ function _temp5(t0) {
218
234
  const { icon: Icon, label, value } = t0;
219
235
  return /* @__PURE__ */ _jsxs(DropdownMenuRadioItem, {
220
236
  className: "h-11 gap-3 px-3 pr-9 text-base",
@@ -2,6 +2,7 @@
2
2
  import { c as _c } from "react/compiler-runtime";
3
3
  import * as React from "react";
4
4
  import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
5
+ import { MotionSlot } from "../motion/motion-slot.js";
5
6
  import { cn } from "../lib/utils.js";
6
7
  import { useBeezUIComponents } from "../providers/beez-ui-provider.js";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -32,11 +33,14 @@ function Avatar(t0) {
32
33
  }
33
34
  let t3;
34
35
  if ($[6] !== props || $[7] !== size || $[8] !== t2) {
35
- t3 = /* @__PURE__ */ _jsx(AvatarPrimitive.Root, {
36
- "data-slot": "avatar",
37
- "data-size": size,
38
- className: t2,
39
- ...props
36
+ t3 = /* @__PURE__ */ _jsx(MotionSlot, {
37
+ kind: "fade",
38
+ children: /* @__PURE__ */ _jsx(AvatarPrimitive.Root, {
39
+ "data-slot": "avatar",
40
+ "data-size": size,
41
+ className: t2,
42
+ ...props
43
+ })
40
44
  });
41
45
  $[6] = props;
42
46
  $[7] = size;
@@ -89,16 +93,19 @@ function AvatarImage(t0) {
89
93
  const t5 = src ?? undefined;
90
94
  let t6;
91
95
  if ($[9] !== alt || $[10] !== props || $[11] !== t3 || $[12] !== t4 || $[13] !== t5) {
92
- t6 = /* @__PURE__ */ _jsx(AvatarPrimitive.Image, {
93
- render: t3,
94
- keepMounted: true,
95
- alt,
96
- "data-slot": "avatar-image",
97
- className: t4,
98
- src: t5,
99
- loading: "lazy",
100
- decoding: "async",
101
- ...props
96
+ t6 = /* @__PURE__ */ _jsx(MotionSlot, {
97
+ kind: "field",
98
+ children: /* @__PURE__ */ _jsx(AvatarPrimitive.Image, {
99
+ render: t3,
100
+ keepMounted: true,
101
+ alt,
102
+ "data-slot": "avatar-image",
103
+ className: t4,
104
+ src: t5,
105
+ loading: "lazy",
106
+ decoding: "async",
107
+ ...props
108
+ })
102
109
  });
103
110
  $[9] = alt;
104
111
  $[10] = props;
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { cva } from "class-variance-authority";
3
3
  import { Slot } from "radix-ui";
4
+ import { MotionSlot } from "../motion/motion-slot.js";
4
5
  import { cn } from "../lib/utils.js";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
@@ -16,11 +17,14 @@ const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-cent
16
17
  });
17
18
  function Badge({ className, variant = "default", asChild = false, ...props }) {
18
19
  const Comp = asChild ? Slot.Root : "span";
19
- return /* @__PURE__ */ _jsx(Comp, {
20
- "data-slot": "badge",
21
- "data-variant": variant,
22
- className: cn(badgeVariants({ variant }), className),
23
- ...props
20
+ return /* @__PURE__ */ _jsx(MotionSlot, {
21
+ kind: "fade",
22
+ children: /* @__PURE__ */ _jsx(Comp, {
23
+ "data-slot": "badge",
24
+ "data-variant": variant,
25
+ className: cn(badgeVariants({ variant }), className),
26
+ ...props
27
+ })
24
28
  });
25
29
  }
26
30
  export { Badge, badgeVariants };