beez-ui 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +45 -47
- package/dist/components/account-menu.js +1 -1
- package/dist/components/alert.js +3 -7
- package/dist/components/animated-collapse.js +51 -38
- package/dist/components/animated-list-item.js +33 -34
- package/dist/components/animated-theme-toggler.d.ts +5 -1
- package/dist/components/animated-theme-toggler.js +75 -120
- package/dist/components/badge.js +7 -11
- package/dist/components/card.js +13 -16
- package/dist/components/dialog-surface.js +8 -21
- package/dist/components/filter-query-bar.js +7 -11
- package/dist/components/input-group.js +5 -9
- package/dist/components/input.js +8 -12
- package/dist/components/label.js +4 -8
- package/dist/components/link.d.ts +1 -0
- package/dist/components/link.js +2 -16
- package/dist/components/presence-swap.d.ts +1 -1
- package/dist/components/presence-swap.js +44 -32
- package/dist/components/primitives/avatar.js +8 -10
- package/dist/components/primitives/dropdown-menu.d.ts +2 -2
- package/dist/components/primitives/dropdown-menu.js +8 -5
- package/dist/components/primitives/select.d.ts +2 -1
- package/dist/components/primitives/select.js +104 -83
- package/dist/components/reaction-button.d.ts +5 -6
- package/dist/components/reaction-button.js +139 -75
- package/dist/components/rich-link-editor.js +1 -1
- package/dist/components/separator.js +5 -9
- package/dist/components/sheet.js +8 -11
- package/dist/components/sidebar.d.ts +6 -6
- package/dist/components/sidebar.js +221 -184
- package/dist/components/svgs/whatsappIcon.js +10 -14
- package/dist/components/table.js +4 -8
- package/dist/components/textarea.js +7 -11
- package/dist/components/themed-toaster.js +28 -62
- package/dist/constants/avatar.d.ts +6 -1
- package/dist/constants/avatar.js +6 -0
- package/dist/constants/dropdown-menu.d.ts +6 -1
- package/dist/constants/dropdown-menu.js +33 -1
- package/dist/constants/popover.js +2 -8
- package/dist/constants/select.d.ts +3 -1
- package/dist/constants/select.js +30 -1
- package/dist/motion/arc-tokens.d.ts +6 -0
- package/dist/motion/arc-tokens.js +6 -0
- package/dist/motion/glide-indicator.d.ts +6 -21
- package/dist/motion/glide-indicator.js +8 -17
- package/dist/motion/motion-slot.d.ts +6 -3
- package/dist/motion/motion-slot.js +100 -411
- package/dist/motion/presence.d.ts +8 -0
- package/dist/motion/presence.js +11 -1
- package/dist/motion/surface-keyframes.d.ts +2 -2
- package/dist/motion/surface-keyframes.js +40 -141
- package/dist/motion/tokens.d.ts +10 -114
- package/dist/motion/tokens.js +11 -116
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/motion/shared-layout-bg.d.ts +0 -16
- package/dist/motion/shared-layout-bg.js +0 -181
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,38 @@ Todos los cambios relevantes de beez-ui se documentan en este archivo con el for
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [4.0.0] - 2026-10-18
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- El movimiento de todos los componentes queda alineado únicamente con Arc: se quitan las entradas al montar de `Card`, `Badge`, `Separator`, las filas de `Table`, `Alert` estático y la raíz de `Avatar`; el hover de `Link` y del ícono de WhatsApp; la reacción al foco de `Input`, `Textarea`, `InputGroup`, `Label` y el trigger de `Select`; el pop demorado de los botones de cierre de `Dialog` y `Sheet`; el pop de los íconos de las toasts; la presión de los ítems de `Sidebar` y del avatar de `AccountMenu`; y el giro del botón de `AnimatedThemeToggler`.
|
|
12
|
+
- `DropdownMenu` entra y sale y `Select` entra en cada apertura como en Arc (escala y desplazamiento desde el trigger) en lugar de revelarse con un clip; las opciones de `Select` ya no se animan por separado y su check, igual que el de los ítems con check de `DropdownMenu`, aparece desde 0.6 con un desenfoque breve.
|
|
13
|
+
- El resaltado de `DropdownMenu` se desliza con el puntero y salta al instante con el teclado, como en Arc; `Select` y las sugerencias de `FilterQueryBar` ya no tienen resaltado deslizante.
|
|
14
|
+
- `Sidebar` sigue al sidebar rail de Arc: el hover solo cambia el color (sin la píldora compartida con desenfoque), los submenús abren su altura con el spring `smooth` sin escalonar ítems, las etiquetas se desplazan 6 px y la hoja móvil se desliza con `smooth`.
|
|
15
|
+
- `Sheet` sale con la curva estándar y se desvanece al final, como el drawer de Arc; `Card` interactiva suma el borde fuerte y la sombra `--shadow-raised` de Arc a su elevación de hover en lugar de la sombra animada anterior.
|
|
16
|
+
- `FormMessage` aparece subiendo desde un desenfoque; la foto de `Avatar` aparece desde un desenfoque de 4 px sin zoom; el ícono de `AnimatedThemeToggler` crece desde 0.7 con un desenfoque breve; `ReactionButton` usa el impulso de las reacciones de Arc.
|
|
17
|
+
- `AnimatedCollapse` abre y cierra su altura con el spring `smooth`, `PresenceSwap` usa el swap de Arc (sube 0.3 em desde un desenfoque) y `AnimatedListItem` entra 4 px desde un desenfoque leve sin escala y se reordena con `smooth`.
|
|
18
|
+
- `MOTION_TIMING.checkDraw` pasa a 0.24 s y `MOTION_LIST_STAGGER_LIMIT` a 4, los valores de Arc.
|
|
19
|
+
|
|
20
|
+
### Deprecated
|
|
21
|
+
|
|
22
|
+
- La prop `duration` de `AnimatedThemeToggler` se ignora: el botón ya no gira al cambiar el tema.
|
|
23
|
+
|
|
24
|
+
### Removed
|
|
25
|
+
|
|
26
|
+
- Se quitan los tokens de movimiento que no son de Arc: `MOTION_EASE_DRAWER`, `MOTION_EASE_UNFOLD`, `SPRING_HIGHLIGHT`, `SPRING_TABS`, `SPRING_TOOLTIP`, `SPRING_THUMB`, `MOTION_SUBTLE_PRESS_SCALE`, `MOTION_TOGGLE_PRESS_SCALE`, `MOTION_HOVER_SCALE`, `MOTION_THUMB_SQUISH_SCALE`, `MOTION_ITEM_CHECK_SCALE`, `MOTION_ICON_SWAP_SCALE`, `MOTION_CLOSE_BUTTON_SCALE`, `MOTION_LIST_ITEM_DISTANCE`, `MOTION_ITEM_ENTER_SCALE`, `MOTION_REVEAL_SCALE`, `MOTION_REVEAL_BLUR_PX`, `MOTION_SHIMMER_TRANSLATE`, `MOTION_CARD_SHADOW_LIFT`, `MOTION_CARD_SHADOW_REST`, `MOTION_SURFACE_CLIP_PERCENT`, `MOTION_SURFACE_CLIP_BLEED_PX`, `MOTION_TOOLTIP_DISTANCE`, `MOTION_TOOLTIP_SCALE`, `MOTION_CENTER_MORPH_FOLDED_PERCENT`, `MOTION_CONTENT_DISTANCE` y `MOTION_INVALID_SHAKE_PX`.
|
|
27
|
+
- `MOTION_TIMING` pierde `message`, `surfaceClip`, `shake`, `checkDrawDelay`, `iconSwap`, `listItem`, `listDelay`, `closeEnter`, `closeDelay`, `centerMorph`, `centerMorphFold`, `reveal`, `pop`, `collapse`, `monthSwap` y `skeleton`, y `MotionKind` queda con los tipos que usa la biblioteca (`rotate`, `item-check`, `icon-swap`, `message`, `reveal`, `dialog`, `sheet` y `overlay`).
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- Los submenús de `Sidebar` recortan su contenido solo mientras abren o cierran: una vez abiertos, el anillo de foco de sus ítems se ve completo.
|
|
32
|
+
|
|
33
|
+
## [3.0.1] - 2026-10-16
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Las fotos de `Avatar`, `AvatarGroup` y `AccountMenu` se piden sin `Referer` (`referrerPolicy="no-referrer"`), así cargan las fotos de perfil de Google que antes se rechazaban y quedaban las iniciales.
|
|
38
|
+
|
|
7
39
|
## [3.0.0] - 2026-10-16
|
|
8
40
|
|
|
9
41
|
### Added
|
package/README.md
CHANGED
|
@@ -110,64 +110,62 @@ keyframes CSS para estas animaciones.
|
|
|
110
110
|
|
|
111
111
|
`MotionSlot` anima el nodo original del primitive mediante refs compuestos,
|
|
112
112
|
sin agregar wrappers al DOM ni reemplazar sus handlers. Los tokens exportados en
|
|
113
|
-
`beez-ui/motion-tokens`
|
|
113
|
+
`beez-ui/motion-tokens` son únicamente los presets de Arc
|
|
114
114
|
(`components/arc/lib/motion-tokens.ts`):
|
|
115
115
|
|
|
116
116
|
- Springs: `snappy` (0.26 s, rebote 0.12) para presiones, indicadores chicos y cambios de
|
|
117
|
-
ícono (`SPRING_PRESS`, `SPRING_POP`, `SPRING_CHEVRON
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
(`SPRING_LAYOUT`, `SPRING_TABS`).
|
|
117
|
+
ícono (`SPRING_PRESS`, `SPRING_POP`, `SPRING_CHEVRON`); `smooth` (0.4 s, sin rebote) para
|
|
118
|
+
paneles, alturas y todo lo que informa un estado (`SPRING_PANEL`); `morph` (0.42 s, rebote
|
|
119
|
+
0.16) para resaltados compartidos (`SPRING_LAYOUT`).
|
|
121
120
|
- Duraciones: `instant` 0.12 s, `fast` 0.16 s, `exit` 0.18 s, `enter`/`standard` 0.24 s y
|
|
122
121
|
`considered` 0.48 s. Las salidas son más cortas que las entradas.
|
|
123
122
|
- Curvas: `MOTION_EASE` (entrada), `MOTION_EASE_EXIT`, `MOTION_EASE_STANDARD` y
|
|
124
123
|
`MOTION_EASE_IN_OUT`.
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
Ningún componente agrega movimiento que Arc no tenga: no hay entradas al montar en cards,
|
|
126
|
+
badges, separadores, filas de tabla ni alertas estáticas; no hay hovers con escala,
|
|
127
|
+
rotación u opacidad en enlaces e íconos; los campos no reaccionan al foco con movimiento y
|
|
128
|
+
no tiemblan al pasar a `aria-invalid="true"`.
|
|
129
|
+
|
|
130
|
+
- `Button`, `ControlButton` y los pasos de `Pagination` usan la presión de Arc: se comprimen
|
|
131
|
+
a 0.97 (un poco más los de solo ícono y menos los anchos) y vuelven con `snappy`; los
|
|
132
|
+
disparadores de menús, popovers y diálogos responden solo con color.
|
|
133
|
+
- `Checkbox`, `RadioGroup`, `Switch`, `Tabs`, `Calendar`, `Carousel`, `Card`, `Avatar`,
|
|
134
|
+
`AvatarGroup`, `Badge`, `Alert`, `ActionButton` y `SplitButton` usan el movimiento de sus
|
|
135
|
+
componentes de Arc.
|
|
136
|
+
- Una `Card` interactiva se eleva 2 px con el borde fuerte y la sombra `--shadow-raised` de
|
|
137
|
+
Arc al pasar un puntero fino.
|
|
138
|
+
- `Tooltip`, `Popover` y `HoverCard` se acercan desde su trigger con escala y fundido.
|
|
139
|
+
`DropdownMenu` crece 5 px desde su trigger y desde 0.97 con el spring de Arc y sale en
|
|
140
|
+
130 ms; sus ítems entran escalonados. `Select` crece 6 px desde 0.97 en 0.24 s; sus
|
|
141
|
+
opciones no se animan por separado y el check de la opción elegida aparece desde 0.6 con
|
|
142
|
+
un desenfoque breve, igual que el de los ítems con check de `DropdownMenu`.
|
|
141
143
|
- `Dialog`, también en su modo `alert`, entra como el diálogo de Arc: el fondo se oscurece en 0.24 s y el
|
|
142
144
|
panel sube 8 px y crece desde 0.96 con el spring `smooth` mientras aparece en 0.16 s; al
|
|
143
145
|
cerrar baja 4 px hasta 0.98 y se desvanece en 0.16 s, y una reapertura parte de donde
|
|
144
|
-
está. `Sheet` entra desde su borde con
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
sin trabajo por frame en JavaScript.
|
|
168
|
-
- `Calendar` desliza el mes entrante desde el lado de la navegación (invertido en RTL).
|
|
169
|
-
- La foto de `Avatar` se revela con blur y un zoom de 1.06 al terminar de cargar; las imágenes
|
|
170
|
-
ya cargadas al montar no se animan.
|
|
146
|
+
está. `Sheet` entra desde su borde con `smooth` y sale en 0.24 s con la curva estándar,
|
|
147
|
+
desvaneciéndose al final como el drawer de Arc. Los botones de cierre no tienen animación
|
|
148
|
+
de entrada.
|
|
149
|
+
- `GlideSlot` desliza el indicador activo entre ítems como un `layoutId` compartido: la
|
|
150
|
+
pestaña activa de `Tabs`, la página actual de `Pagination` y el resaltado de `DropdownMenu`,
|
|
151
|
+
que se desliza con el puntero y salta al instante con el teclado. `Select` y las
|
|
152
|
+
sugerencias de `FilterQueryBar` no tienen resaltado deslizante.
|
|
153
|
+
- El chevron del trigger de `Select` gira 180° con el spring CSS de Arc y los chevrons de
|
|
154
|
+
`DataTable` (grupos y columnas) giran con `snappy`; CSS define el ángulo final.
|
|
155
|
+
- `FormMessage` sube un tercio de línea desde un desenfoque al aparecer, como las filas de
|
|
156
|
+
ayuda y error de Arc.
|
|
157
|
+
- El ancho de `Sidebar` cambia con `smooth` entre el panel y el riel de íconos, las
|
|
158
|
+
etiquetas se desvanecen y se desplazan 6 px al colapsar, el resaltado del ítem activo se
|
|
159
|
+
desliza con `morph`, el hover solo cambia el color, los submenús abren su altura con
|
|
160
|
+
`smooth` y en pantallas chicas se abre como hoja con foco atrapado.
|
|
161
|
+
- El ícono de `AnimatedThemeToggler` crece desde 0.7 desde un desenfoque con `snappy`; el
|
|
162
|
+
botón no gira ni se desvanece al cambiar el tema.
|
|
163
|
+
- La foto de `Avatar` aparece desde un desenfoque de 4 px al terminar de cargar; las
|
|
164
|
+
imágenes ya cargadas al montar no se animan.
|
|
165
|
+
- `ReactionButton` le da al ícono el impulso de las reacciones de Arc al activarse.
|
|
166
|
+
- `AnimatedCollapse` abre y cierra su altura con `smooth`; `PresenceSwap` usa el swap de
|
|
167
|
+
Arc (sube 0.3 em desde un desenfoque y la versión anterior sale hacia arriba);
|
|
168
|
+
`AnimatedListItem` entra 4 px desde un desenfoque leve y se reordena con `smooth`.
|
|
171
169
|
- El cursor de `TypingAnimation` queda fijo mientras escribe y parpadea en reposo. Las animaciones especializadas
|
|
172
170
|
existentes de Embla, Sonner y rough-notation se conservan.
|
|
173
171
|
|
|
@@ -168,7 +168,7 @@ export function AccountMenu(t0) {
|
|
|
168
168
|
const t14 = classNames?.trigger;
|
|
169
169
|
let t15;
|
|
170
170
|
if ($[12] !== t12 || $[13] !== t13 || $[14] !== t14) {
|
|
171
|
-
t15 = cn("inline-flex items-center rounded-full outline-none [-webkit-tap-highlight-color:transparent] transition-[box-shadow,opacity
|
|
171
|
+
t15 = cn("inline-flex items-center rounded-full outline-none [-webkit-tap-highlight-color:transparent] transition-[box-shadow,opacity] hover:opacity-90 focus-visible:shadow-[0_0_0_2px_var(--background),0_0_0_4px_var(--ring)] data-[state=open]:shadow-[0_0_0_2px_var(--background),0_0_0_4px_var(--ring)]", t12, t13, t14);
|
|
172
172
|
$[12] = t12;
|
|
173
173
|
$[13] = t13;
|
|
174
174
|
$[14] = t14;
|
package/dist/components/alert.js
CHANGED
|
@@ -14,7 +14,6 @@ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js"
|
|
|
14
14
|
import { cn } from "../lib/utils.js";
|
|
15
15
|
import { ARC_BLUR, ARC_DURATION, ARC_EASE, ARC_SPRING_SMOOTH } from "../motion/arc-tokens.js";
|
|
16
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";
|
|
17
|
-
import { MotionSlot } from "../motion/motion-slot.js";
|
|
18
17
|
import { useAttachedElement } from "../motion/use-attached-element.js";
|
|
19
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
19
|
/** The icon each tone shows unless `icon` replaces it. */
|
|
@@ -432,12 +431,9 @@ function AlertBox(t0) {
|
|
|
432
431
|
}
|
|
433
432
|
let t14;
|
|
434
433
|
if ($[57] !== content || $[58] !== rootProps) {
|
|
435
|
-
t14 = /* @__PURE__ */ _jsx(
|
|
436
|
-
|
|
437
|
-
children:
|
|
438
|
-
...rootProps,
|
|
439
|
-
children: content
|
|
440
|
-
})
|
|
434
|
+
t14 = /* @__PURE__ */ _jsx("div", {
|
|
435
|
+
...rootProps,
|
|
436
|
+
children: content
|
|
441
437
|
});
|
|
442
438
|
$[57] = content;
|
|
443
439
|
$[58] = rootProps;
|
|
@@ -5,18 +5,24 @@ import { useState } from "react";
|
|
|
5
5
|
import { AnimatePresence, motion, useIsPresent } from "motion/react";
|
|
6
6
|
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
7
7
|
import { cn } from "../lib/utils.js";
|
|
8
|
-
import { MOTION_EASE,
|
|
8
|
+
import { MOTION_EASE, MOTION_EASE_STANDARD, MOTION_TIMING, SPRING_PANEL } from "../motion/tokens.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/** Arc's accordion: the height springs without overshoot while the content fades in. */
|
|
10
11
|
const COLLAPSE_TRANSITION = {
|
|
11
|
-
height:
|
|
12
|
-
duration: MOTION_TIMING.collapse,
|
|
13
|
-
ease: MOTION_EASE_IN_OUT
|
|
14
|
-
},
|
|
12
|
+
height: SPRING_PANEL,
|
|
15
13
|
opacity: {
|
|
16
14
|
duration: MOTION_TIMING.panel,
|
|
17
15
|
ease: MOTION_EASE
|
|
18
16
|
}
|
|
19
17
|
};
|
|
18
|
+
/** Arc's accordion closes on the same spring and fades out faster than it came in. */
|
|
19
|
+
const COLLAPSE_EXIT_TRANSITION = {
|
|
20
|
+
height: SPRING_PANEL,
|
|
21
|
+
opacity: {
|
|
22
|
+
duration: MOTION_TIMING.fast,
|
|
23
|
+
ease: MOTION_EASE_STANDARD
|
|
24
|
+
}
|
|
25
|
+
};
|
|
20
26
|
/** Reduced motion applies the height at once but keeps the short fade, so exits always settle. */
|
|
21
27
|
const REDUCED_MOTION_COLLAPSE_TRANSITION = {
|
|
22
28
|
height: { duration: 0 },
|
|
@@ -32,7 +38,7 @@ const REDUCED_MOTION_COLLAPSE_TRANSITION = {
|
|
|
32
38
|
* @returns The animated region.
|
|
33
39
|
*/
|
|
34
40
|
function AnimatedCollapseRegion(t0) {
|
|
35
|
-
const $ = _c(
|
|
41
|
+
const $ = _c(17);
|
|
36
42
|
const { children, className, id, isEntering } = t0;
|
|
37
43
|
const [isSettled, setIsSettled] = useState(!isEntering);
|
|
38
44
|
const isPresent = useIsPresent();
|
|
@@ -51,7 +57,6 @@ function AnimatedCollapseRegion(t0) {
|
|
|
51
57
|
}
|
|
52
58
|
let t5;
|
|
53
59
|
let t6;
|
|
54
|
-
let t7;
|
|
55
60
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56
61
|
t5 = {
|
|
57
62
|
height: 0,
|
|
@@ -61,33 +66,40 @@ function AnimatedCollapseRegion(t0) {
|
|
|
61
66
|
height: "auto",
|
|
62
67
|
opacity: 1
|
|
63
68
|
};
|
|
64
|
-
t7 = {
|
|
65
|
-
height: 0,
|
|
66
|
-
opacity: 0
|
|
67
|
-
};
|
|
68
69
|
$[3] = t5;
|
|
69
70
|
$[4] = t6;
|
|
70
|
-
$[5] = t7;
|
|
71
71
|
} else {
|
|
72
72
|
t5 = $[3];
|
|
73
73
|
t6 = $[4];
|
|
74
|
-
t7 = $[5];
|
|
75
74
|
}
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
const t7 = shouldReduceMotion ? REDUCED_MOTION_COLLAPSE_TRANSITION : COLLAPSE_EXIT_TRANSITION;
|
|
76
|
+
let t8;
|
|
77
|
+
if ($[5] !== t7) {
|
|
78
|
+
t8 = {
|
|
79
|
+
height: 0,
|
|
80
|
+
opacity: 0,
|
|
81
|
+
transition: t7
|
|
82
|
+
};
|
|
83
|
+
$[5] = t7;
|
|
84
|
+
$[6] = t8;
|
|
84
85
|
} else {
|
|
85
|
-
|
|
86
|
-
t9 = $[7];
|
|
86
|
+
t8 = $[6];
|
|
87
87
|
}
|
|
88
|
+
const t9 = shouldReduceMotion ? REDUCED_MOTION_COLLAPSE_TRANSITION : COLLAPSE_TRANSITION;
|
|
89
|
+
let t10;
|
|
88
90
|
let t11;
|
|
89
|
-
if ($[
|
|
90
|
-
|
|
91
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t10 = () => setIsSettled(false);
|
|
93
|
+
t11 = () => setIsSettled(true);
|
|
94
|
+
$[7] = t10;
|
|
95
|
+
$[8] = t11;
|
|
96
|
+
} else {
|
|
97
|
+
t10 = $[7];
|
|
98
|
+
t11 = $[8];
|
|
99
|
+
}
|
|
100
|
+
let t12;
|
|
101
|
+
if ($[9] !== children || $[10] !== id || $[11] !== t1 || $[12] !== t2 || $[13] !== t4 || $[14] !== t8 || $[15] !== t9) {
|
|
102
|
+
t12 = /* @__PURE__ */ _jsx(motion.div, {
|
|
91
103
|
"data-slot": "animated-collapse",
|
|
92
104
|
id,
|
|
93
105
|
"aria-hidden": t1,
|
|
@@ -95,23 +107,24 @@ function AnimatedCollapseRegion(t0) {
|
|
|
95
107
|
className: t4,
|
|
96
108
|
initial: t5,
|
|
97
109
|
animate: t6,
|
|
98
|
-
exit:
|
|
99
|
-
transition:
|
|
100
|
-
onAnimationStart:
|
|
101
|
-
onAnimationComplete:
|
|
110
|
+
exit: t8,
|
|
111
|
+
transition: t9,
|
|
112
|
+
onAnimationStart: t10,
|
|
113
|
+
onAnimationComplete: t11,
|
|
102
114
|
children
|
|
103
115
|
});
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
116
|
+
$[9] = children;
|
|
117
|
+
$[10] = id;
|
|
118
|
+
$[11] = t1;
|
|
119
|
+
$[12] = t2;
|
|
120
|
+
$[13] = t4;
|
|
121
|
+
$[14] = t8;
|
|
122
|
+
$[15] = t9;
|
|
123
|
+
$[16] = t12;
|
|
111
124
|
} else {
|
|
112
|
-
|
|
125
|
+
t12 = $[16];
|
|
113
126
|
}
|
|
114
|
-
return
|
|
127
|
+
return t12;
|
|
115
128
|
}
|
|
116
129
|
/**
|
|
117
130
|
* Renders `children` only while `isOpen`, animating height and opacity.
|
|
@@ -3,21 +3,26 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
3
3
|
import { motion, useIsPresent } from "motion/react";
|
|
4
4
|
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
import {
|
|
6
|
+
import { ARC_BLUR } from "../motion/arc-tokens.js";
|
|
7
|
+
import { MOTION_EASE, MOTION_EASE_STANDARD, MOTION_TIMING, SPRING_PANEL } from "../motion/tokens.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
/** Arc's rows settle 4px into place out of a subtle blur. */
|
|
10
|
+
const LIST_ITEM_RISE_PX = 4;
|
|
11
|
+
const LIST_ITEM_BLUR = `blur(${ARC_BLUR.subtle}px)`;
|
|
8
12
|
const ANIMATED_LIST_ITEM_ELEMENTS = {
|
|
9
13
|
li: motion.li,
|
|
10
14
|
div: motion.div,
|
|
11
15
|
article: motion.article
|
|
12
16
|
};
|
|
17
|
+
/** Arc's rows enter on the standard tween and reorder on the smooth spring, without overshoot. */
|
|
13
18
|
const LIST_ITEM_TRANSITION = {
|
|
14
|
-
duration: MOTION_TIMING.
|
|
19
|
+
duration: MOTION_TIMING.standard,
|
|
15
20
|
ease: MOTION_EASE,
|
|
16
|
-
layout:
|
|
21
|
+
layout: SPRING_PANEL
|
|
17
22
|
};
|
|
18
23
|
const LIST_ITEM_EXIT_TRANSITION = {
|
|
19
24
|
duration: MOTION_TIMING.exit,
|
|
20
|
-
ease:
|
|
25
|
+
ease: MOTION_EASE_STANDARD
|
|
21
26
|
};
|
|
22
27
|
/**
|
|
23
28
|
* Wrap the list in `<AnimatePresence initial={false}>` so only items added after the
|
|
@@ -28,7 +33,7 @@ const LIST_ITEM_EXIT_TRANSITION = {
|
|
|
28
33
|
* @returns The animated item.
|
|
29
34
|
*/
|
|
30
35
|
export function AnimatedListItem(t0) {
|
|
31
|
-
const $ = _c(
|
|
36
|
+
const $ = _c(22);
|
|
32
37
|
let children;
|
|
33
38
|
let className;
|
|
34
39
|
let elementProps;
|
|
@@ -54,8 +59,8 @@ export function AnimatedListItem(t0) {
|
|
|
54
59
|
const MotionElement = ANIMATED_LIST_ITEM_ELEMENTS[as];
|
|
55
60
|
const isPresent = useIsPresent();
|
|
56
61
|
const shouldReduceMotion = usePrefersReducedMotion();
|
|
57
|
-
const distance = shouldReduceMotion ? 0 :
|
|
58
|
-
const
|
|
62
|
+
const distance = shouldReduceMotion ? 0 : LIST_ITEM_RISE_PX;
|
|
63
|
+
const blur = shouldReduceMotion ? "blur(0px)" : LIST_ITEM_BLUR;
|
|
59
64
|
const t3 = isPresent ? elementProps["aria-hidden"] : true;
|
|
60
65
|
const t4 = !isPresent || undefined;
|
|
61
66
|
let t5;
|
|
@@ -68,43 +73,38 @@ export function AnimatedListItem(t0) {
|
|
|
68
73
|
}
|
|
69
74
|
const t6 = layout && !shouldReduceMotion ? "position" : false;
|
|
70
75
|
let t7;
|
|
71
|
-
if ($[8] !==
|
|
76
|
+
if ($[8] !== blur || $[9] !== distance) {
|
|
72
77
|
t7 = {
|
|
73
78
|
opacity: 0,
|
|
74
79
|
y: distance,
|
|
75
|
-
|
|
80
|
+
filter: blur
|
|
76
81
|
};
|
|
77
|
-
$[8] =
|
|
78
|
-
$[9] =
|
|
82
|
+
$[8] = blur;
|
|
83
|
+
$[9] = distance;
|
|
79
84
|
$[10] = t7;
|
|
80
85
|
} else {
|
|
81
86
|
t7 = $[10];
|
|
82
87
|
}
|
|
83
88
|
let t8;
|
|
89
|
+
let t9;
|
|
84
90
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
85
91
|
t8 = {
|
|
86
92
|
opacity: 1,
|
|
87
93
|
y: 0,
|
|
88
|
-
|
|
94
|
+
filter: "blur(0px)"
|
|
89
95
|
};
|
|
90
|
-
$[11] = t8;
|
|
91
|
-
} else {
|
|
92
|
-
t8 = $[11];
|
|
93
|
-
}
|
|
94
|
-
let t9;
|
|
95
|
-
if ($[12] !== enterScale) {
|
|
96
96
|
t9 = {
|
|
97
97
|
opacity: 0,
|
|
98
|
-
scale: enterScale,
|
|
99
98
|
transition: LIST_ITEM_EXIT_TRANSITION
|
|
100
99
|
};
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
100
|
+
$[11] = t8;
|
|
101
|
+
$[12] = t9;
|
|
103
102
|
} else {
|
|
104
|
-
|
|
103
|
+
t8 = $[11];
|
|
104
|
+
t9 = $[12];
|
|
105
105
|
}
|
|
106
106
|
let t10;
|
|
107
|
-
if ($[
|
|
107
|
+
if ($[13] !== MotionElement || $[14] !== children || $[15] !== elementProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== t7) {
|
|
108
108
|
t10 = /* @__PURE__ */ _jsx(MotionElement, {
|
|
109
109
|
"data-slot": "animated-list-item",
|
|
110
110
|
...elementProps,
|
|
@@ -118,18 +118,17 @@ export function AnimatedListItem(t0) {
|
|
|
118
118
|
transition: LIST_ITEM_TRANSITION,
|
|
119
119
|
children
|
|
120
120
|
});
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[23] = t10;
|
|
121
|
+
$[13] = MotionElement;
|
|
122
|
+
$[14] = children;
|
|
123
|
+
$[15] = elementProps;
|
|
124
|
+
$[16] = t3;
|
|
125
|
+
$[17] = t4;
|
|
126
|
+
$[18] = t5;
|
|
127
|
+
$[19] = t6;
|
|
128
|
+
$[20] = t7;
|
|
129
|
+
$[21] = t10;
|
|
131
130
|
} else {
|
|
132
|
-
t10 = $[
|
|
131
|
+
t10 = $[21];
|
|
133
132
|
}
|
|
134
133
|
return t10;
|
|
135
134
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { ThemeMode, ResolvedTheme } from "../theme.js";
|
|
2
2
|
export interface AnimatedThemeTogglerProps extends React.ComponentPropsWithoutRef<"button"> {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The trigger no longer turns when the theme changes: like Arc's theme switch, only its icon swaps.
|
|
5
|
+
* The value is ignored.
|
|
6
|
+
*/
|
|
3
7
|
duration?: number;
|
|
4
8
|
theme?: ThemeMode;
|
|
5
9
|
resolvedTheme?: ResolvedTheme;
|
|
6
10
|
onThemeChange?: (theme: ThemeMode) => void;
|
|
7
11
|
}
|
|
8
|
-
export declare const AnimatedThemeToggler: ({ className, duration, disabled, theme: controlledTheme, resolvedTheme: controlledResolvedTheme, onThemeChange: controlledOnThemeChange, ...props }: AnimatedThemeTogglerProps) => import("react").JSX.Element;
|
|
12
|
+
export declare const AnimatedThemeToggler: ({ className, duration: _duration, disabled, theme: controlledTheme, resolvedTheme: controlledResolvedTheme, onThemeChange: controlledOnThemeChange, ...props }: AnimatedThemeTogglerProps) => import("react").JSX.Element;
|