orbital-ds 0.17.0 → 0.18.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.
@@ -0,0 +1,348 @@
1
+ /*
2
+ * TEMA lagoon — pino profundo, jade vivo y un único acento cálido (albaricoque).
3
+ *
4
+ * Personalidad: lienzo verde muy claro (día) / casi negro verdoso (noche), tarjetas
5
+ * grandes y redondeadas con sombra larga y suave, y un LATERAL («dock») de pino oscuro
6
+ * que lo es en las dos pieles. Aurora de fondo en tres manchas. Movimiento con muelle:
7
+ * las superficies llegan primero y su contenido sube después.
8
+ *
9
+ * Estructura del fichero:
10
+ * 1. Variables claras (:root) y oscuras (.dark) — el CONTRATO del tema.
11
+ * 2. Variables de la personalidad (movimiento, sombras compuestas).
12
+ * 3. Capa de PERSONALIDAD — reglas sobre `data-slot`/`data-variant`… escritas solo
13
+ * con variables. Va SIN capa para ganar a las utilidades de los componentes.
14
+ *
15
+ * Variables `--lg-*`: privadas de este tema (no son contrato).
16
+ * Importar DESPUÉS de la estructura. Fuentes: `lagoon.fonts.css`, lo primero del CSS.
17
+ *
18
+ * Pendiente (necesita añadir huecos al núcleo; ver la guía del tema): grano, palabra
19
+ * en serif cursiva, entrada con perspectiva, borde luminoso y variante `cta` del botón.
20
+ */
21
+
22
+ /* ── 1. VARIABLES · PIEL CLARA ───────────────────────────────────────────── */
23
+ :root:where([data-theme='lagoon']) {
24
+ /* Movimiento automático (orbital-ds/motion.css): tipo de entrada por grupo; lo describe la ficha (motion.auto) */
25
+ --ds-enter-surfaces: ds-auto-enter;
26
+ --ds-enter-notices: ds-auto-pop;
27
+ --ds-enter-headers: ds-auto-enter;
28
+ --ds-enter-rows: ds-auto-enter;
29
+ --radius: 18px;
30
+
31
+ /* Tipografía: Geist en todo */
32
+ --ds-font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
33
+ --ds-font-display: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
34
+ --ds-font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
35
+ --ds-title-weight: 600;
36
+ --ds-button-weight: 600;
37
+ --ds-heading-tracking: -0.02em;
38
+
39
+ /* Lateral: raíl de iconos, flotante */
40
+ --ds-sidebar-icon: 1.25rem;
41
+ --ds-sidebar-icon-stroke: 1.75;
42
+ --ds-sidebar-rail-w: 5rem;
43
+ --ds-sidebar-rail-item: 3rem;
44
+ --ds-sidebar-logo: 2.5rem;
45
+ --ds-sidebar-sep-inset: 0.75rem;
46
+
47
+ /* Color */
48
+ --background: #f3f6f4;
49
+ --foreground: #0b211c;
50
+
51
+ --card: #fdfefd;
52
+ --card-foreground: #0b211c;
53
+ --popover: #fdfefd;
54
+ --popover-foreground: #0b211c;
55
+
56
+ --primary: #0d2f28;
57
+ --primary-foreground: #f1fff9;
58
+ --secondary: #eef3f0;
59
+ --secondary-foreground: #0b211c;
60
+ --muted: #eef3f0;
61
+ --muted-foreground: #526860;
62
+ --accent: #dbf6ec;
63
+ --accent-foreground: #0a6a57;
64
+ --destructive: #b52a2f;
65
+ --destructive-foreground: #ffffff;
66
+
67
+ --border: #d7e1dc;
68
+ --input: #c3d2ca;
69
+ --ring: #0b8a70;
70
+
71
+ --chart-1: #00846f;
72
+ --chart-2: #34c29b;
73
+ --chart-3: #ee7f45;
74
+ --chart-4: #b6c6bf;
75
+ --chart-5: #3d78c4;
76
+
77
+ /* Lateral: pino oscuro también en la piel clara */
78
+ --sidebar: #0b2b24;
79
+ --sidebar-foreground: #d9f5ea;
80
+ --sidebar-primary: #8fe3c8;
81
+ --sidebar-primary-foreground: #06201a;
82
+ --sidebar-accent: rgba(143, 227, 200, 0.14);
83
+ --sidebar-accent-foreground: #eafff6;
84
+ --sidebar-border: rgba(190, 255, 230, 0.13);
85
+ --sidebar-ring: #8fe3c8;
86
+
87
+ --danger: #b52a2f;
88
+ --danger-soft: #fde8e8;
89
+ --warning: #8f6900;
90
+ --warning-soft: #fdf3d8;
91
+ --success: #0f6e41;
92
+ --success-soft: #dcf4e6;
93
+ --info: #1d6a9f;
94
+ --info-soft: #e1eff8;
95
+ --neutral: #4a625a;
96
+ --neutral-soft: #e6eeea;
97
+
98
+ --link: #0a6a57;
99
+ --link-hover: #07463a;
100
+ --inset: #e3ebe7;
101
+ --inset-foreground: #0b211c;
102
+ --brand: #0b8a70;
103
+ --brand-bright: #34c29b;
104
+
105
+ /* Formas: tarjetas de 24, contenedores de 36, controles en píldora */
106
+ --ds-radius-sm: 10px;
107
+ --ds-radius-md: 14px;
108
+ --ds-radius-lg: 18px;
109
+ --ds-radius-xl: 24px;
110
+ --ds-radius-2xl: 36px;
111
+ --ds-radius-control: 18px;
112
+ --ds-radius-overlay: 28px;
113
+ --ds-radius-button: var(--ds-radius-pill);
114
+ --ds-radius-button-icon: var(--ds-radius-pill);
115
+ --ds-radius-badge: var(--ds-radius-pill);
116
+ --ds-radius-tabs-list: var(--ds-radius-pill);
117
+ --ds-radius-tab: var(--ds-radius-pill);
118
+
119
+ /* Sombras largas y suaves */
120
+ --ds-shadow-card: 0 22px 44px -36px rgba(8, 42, 35, 0.45);
121
+ --ds-shadow-card-hover: 0 28px 50px -34px rgba(8, 42, 35, 0.55);
122
+ --ds-shadow-raised: 0 16px 34px -26px rgba(8, 42, 35, 0.5);
123
+ --ds-shadow-overlay: 0 30px 70px -30px rgba(8, 42, 35, 0.55);
124
+ --ds-shadow-popover: 0 24px 56px -28px rgba(8, 42, 35, 0.55);
125
+
126
+ /* Medidas: controles holgados */
127
+ --ds-control-h-sm: 2.25rem;
128
+ --ds-control-h-md: 2.75rem;
129
+ --ds-control-h-lg: 3rem;
130
+ --ds-button-px-sm: 1rem;
131
+ --ds-button-px-md: 1.375rem;
132
+ --ds-button-px-lg: 1.75rem;
133
+ --ds-field-px: 1.125rem;
134
+
135
+ /* Materiales: sin cristal en las tarjetas; aurora de fondo */
136
+ --ds-card-backdrop: none;
137
+ --ds-page-backdrop:
138
+ radial-gradient(48% 42% at 12% 4%, rgba(47, 207, 164, 0.3), transparent 72%),
139
+ radial-gradient(44% 40% at 96% 30%, rgba(255, 176, 124, 0.26), transparent 72%),
140
+ radial-gradient(52% 46% at 52% 108%, rgba(43, 143, 196, 0.14), transparent 72%);
141
+
142
+ /* Variante cta del botón, palabra de énfasis, grano de fondo */
143
+ --ds-cta-bg: var(--lg-cta);
144
+ --ds-cta-fg: var(--lg-on-cta);
145
+ --ds-cta-hover: color-mix(in oklch, var(--lg-cta) 88%, white);
146
+ --ds-accent-font: 'Instrument Serif', Georgia, serif;
147
+ --ds-accent-style: italic;
148
+ --ds-page-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
149
+ --ds-page-grain-size: 160px;
150
+
151
+ /* Lateral flotante (dock) */
152
+ --ds-sidebar-pad: 0.75rem;
153
+ --ds-sidebar-radius: var(--ds-radius-2xl);
154
+ --ds-sidebar-shadow: var(--lg-dock-shadow);
155
+ --ds-sidebar-ring: 0px;
156
+ --ds-sidebar-edge: 1px solid var(--sidebar-border);
157
+ --ds-sidebar-item-radius: var(--ds-radius-pill);
158
+
159
+ /* Privadas de lagoon */
160
+ --lg-dock-g: linear-gradient(170deg, color-mix(in oklch, var(--sidebar) 88%, white) 0%, var(--sidebar) 55%, color-mix(in oklch, var(--sidebar) 72%, black) 100%);
161
+ --lg-dock-shadow: 0 24px 48px -28px rgba(3, 26, 20, 0.7), inset 0 1px 0 rgba(190, 255, 230, 0.16);
162
+ --lg-cta: #ffb07c;
163
+ --lg-on-cta: #2b1305;
164
+ --lg-accent-word: #ffc39b;
165
+ --lg-hover-lift: -2px;
166
+ }
167
+
168
+ /* ── 1b. VARIABLES · PIEL OSCURA ─────────────────────────────────────────── */
169
+ :where(:root[data-theme='lagoon']).dark {
170
+ --background: #040b09;
171
+ --foreground: #e6f5ef;
172
+
173
+ --card: #111e1a;
174
+ --card-foreground: #e6f5ef;
175
+ --popover: #111e1a;
176
+ --popover-foreground: #e6f5ef;
177
+
178
+ --primary: #b5f2dc;
179
+ --primary-foreground: #06201a;
180
+ --secondary: #192924;
181
+ --secondary-foreground: #e6f5ef;
182
+ --muted: #192924;
183
+ --muted-foreground: #96aba2;
184
+ --accent: #173b32;
185
+ --accent-foreground: #7deac9;
186
+ --destructive: #ff7a7f;
187
+ --destructive-foreground: #2a0a0b;
188
+
189
+ --border: #263c35;
190
+ --input: #2d463e;
191
+ --ring: #4fdcb6;
192
+
193
+ --chart-1: #5b96e6;
194
+ --chart-2: #14a688;
195
+ --chart-3: #dc7240;
196
+ --chart-4: #4b615a;
197
+ --chart-5: #5fdcb9;
198
+
199
+ --sidebar: #0b2b24;
200
+ --sidebar-foreground: #d9f5ea;
201
+ --sidebar-primary: #8fe3c8;
202
+ --sidebar-primary-foreground: #06201a;
203
+ --sidebar-accent: rgba(143, 227, 200, 0.14);
204
+ --sidebar-accent-foreground: #eafff6;
205
+ --sidebar-border: rgba(190, 255, 230, 0.13);
206
+ --sidebar-ring: #8fe3c8;
207
+
208
+ --danger: #ff7a7f;
209
+ --danger-soft: #3a1618;
210
+ --warning: #f3c44f;
211
+ --warning-soft: #352a0e;
212
+ --success: #55d795;
213
+ --success-soft: #12301f;
214
+ --info: #7db8e8;
215
+ --info-soft: #14283a;
216
+ --neutral: #a3b8af;
217
+ --neutral-soft: #1f302a;
218
+
219
+ --link: #7deac9;
220
+ --link-hover: #b5f2dc;
221
+ --inset: #0a1512;
222
+ --inset-foreground: #e6f5ef;
223
+ --brand: #4fdcb6;
224
+ --brand-bright: #8fe9cf;
225
+
226
+ --ds-shadow-card: 0 26px 44px -34px #000000;
227
+ --ds-shadow-card-hover: 0 30px 52px -32px #000000;
228
+ --ds-shadow-raised: 0 18px 36px -26px #000000;
229
+ --ds-shadow-overlay: 0 34px 72px -28px #000000;
230
+ --ds-shadow-popover: 0 28px 58px -26px #000000;
231
+
232
+ --ds-page-backdrop:
233
+ radial-gradient(48% 42% at 12% 4%, rgba(47, 207, 164, 0.17), transparent 72%),
234
+ radial-gradient(44% 40% at 96% 30%, rgba(255, 154, 99, 0.1), transparent 72%),
235
+ radial-gradient(52% 46% at 52% 108%, rgba(91, 150, 230, 0.1), transparent 72%);
236
+
237
+ --lg-dock-shadow: 0 26px 48px -28px #000000, inset 0 1px 0 rgba(190, 255, 230, 0.12);
238
+ }
239
+
240
+ /* ── 2. VARIABLES DE LA PERSONALIDAD ─────────────────────────────────────────
241
+ * Lo que las reglas de abajo piden: cámbialo aquí (o en el brand.css de la app),
242
+ * nunca en las reglas. Las `--lg-*` son privadas del tema.
243
+ */
244
+ :root:where([data-theme='lagoon']) {
245
+ /* Movimiento: muelle con rebote; las superficies tardan, el resto responde rápido */
246
+ --ds-motion-fast: 160ms;
247
+ --ds-motion-base: 320ms;
248
+ --ds-motion-slow: 700ms;
249
+ --ds-ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
250
+ --ds-ease-enter: cubic-bezier(0.22, 1.12, 0.36, 1);
251
+ --ds-ease-exit: cubic-bezier(0.62, 0, 0.18, 1);
252
+ --ds-ease-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
253
+ --ds-motion-distance: 24px;
254
+ --ds-motion-scale: 0.96;
255
+ --ds-motion-blur: 0px;
256
+ --ds-spring-bounce: 0.3;
257
+ --ds-motion-stagger: 75ms;
258
+ --ds-motion-press-scale: 0.96;
259
+ --ds-rule-w: 1px;
260
+
261
+ --ds-shadow-button: 0 0 #0000;
262
+ --ds-shadow-button-hover: 0 14px 28px -18px var(--lg-button-glow);
263
+ --lg-button-glow: rgba(8, 42, 35, 0.75);
264
+ --lg-press-scale: 0.96;
265
+ }
266
+
267
+ :where(:root[data-theme='lagoon']).dark {
268
+ --lg-button-glow: rgba(95, 220, 185, 0.6);
269
+ }
270
+
271
+ /* Muelles reales (curvas `linear()`) donde el navegador las dibuja; si no, quedan las de arriba */
272
+ @supports (animation-timing-function: linear(0, 1)) {
273
+ :root {
274
+ --ds-ease-enter: linear(0, 0.052, 0.173, 0.326, 0.482, 0.626, 0.749, 0.847, 0.92, 0.972, 1.007, 1.027, 1.036, 1.038, 1.036, 1.031, 1.025, 1.019, 1.014, 1.009, 1.006, 1.003, 1.001, 1, 0.999, 0.999, 1);
275
+ --ds-ease-overshoot: linear(0, 0.046, 0.164, 0.321, 0.493, 0.661, 0.81, 0.934, 1.028, 1.093, 1.131, 1.147, 1.145, 1.131, 1.109, 1.084, 1.059, 1.036, 1.016, 1.001, 0.989, 0.982, 0.979, 0.978, 0.98, 0.983, 0.986, 0.99, 0.993, 0.997, 0.999, 1.001, 1.002, 1.003, 1);
276
+ }
277
+ }
278
+
279
+ /* ── 3. PERSONALIDAD ─────────────────────────────────────────────────────────
280
+ * Sin capa: gana a las utilidades de los componentes. Solo variables (lo comprueba
281
+ * el doctor: tema `conformance: strict`). Familias completas.
282
+ */
283
+ :root:where([data-theme='lagoon']) {
284
+ /* Botones: píldora que se eleva al pasar y se aplasta al pulsar */
285
+ [data-slot='button'] {
286
+ transition: all var(--ds-motion-base) var(--ds-ease-overshoot);
287
+ }
288
+ [data-slot='button']:hover:not(:disabled) {
289
+ transform: translateY(var(--lg-hover-lift));
290
+ }
291
+ [data-slot='button']:active:not(:disabled) {
292
+ transform: scale(var(--lg-press-scale));
293
+ }
294
+ [data-slot='button'][data-variant='default']:hover:not(:disabled) {
295
+ box-shadow: var(--ds-shadow-button-hover);
296
+ }
297
+
298
+ /* Tarjetas: filete fino; se elevan con el muelle */
299
+ [data-slot='card'],
300
+ [data-slot='panel'][data-variant='default'],
301
+ [data-slot='stat'][data-variant='card'],
302
+ [data-slot='item'][data-variant='card'] {
303
+ border: var(--ds-rule-w) solid var(--border);
304
+ transition:
305
+ transform var(--ds-motion-slow) var(--ds-ease-enter),
306
+ box-shadow var(--ds-motion-slow) var(--ds-ease-enter);
307
+ }
308
+ [data-slot='card']:hover,
309
+ [data-slot='panel'][data-variant='default']:hover,
310
+ [data-slot='stat'][data-variant='card']:hover,
311
+ [data-slot='item'][data-variant='card']:hover {
312
+ transform: translateY(var(--lg-hover-lift));
313
+ box-shadow: var(--ds-shadow-card-hover);
314
+ }
315
+
316
+ /* Lateral (dock): degradado de pino oscuro en las dos pieles */
317
+ [data-slot='sidebar-inner'] {
318
+ background-image: var(--lg-dock-g);
319
+ color: var(--sidebar-foreground);
320
+ }
321
+ [data-sidebar='menu-button'][data-active='true'] {
322
+ background: var(--sidebar-primary);
323
+ color: var(--sidebar-primary-foreground);
324
+ }
325
+ [data-sidebar='menu-button']:hover:not([data-active='true']) {
326
+ background: var(--sidebar-accent);
327
+ }
328
+
329
+ /* Conmutadores (familia «toggle»): píldora con el activo relleno */
330
+ [data-slot='toggle'],
331
+ [data-slot='toggle-group-item'] {
332
+ border-radius: var(--ds-radius-pill);
333
+ }
334
+ [data-slot='tabs-list'] {
335
+ border: var(--ds-rule-w) solid var(--border);
336
+ }
337
+ [data-slot='tabs-trigger'][data-active],
338
+ [data-slot='toggle'][aria-pressed='true'],
339
+ [data-slot='toggle-group-item'][aria-pressed='true'] {
340
+ background: var(--primary);
341
+ color: var(--primary-foreground);
342
+ }
343
+
344
+ /* Esqueletos: visibles sobre la tarjeta casi blanca */
345
+ [data-slot='skeleton'] {
346
+ background: color-mix(in oklch, var(--foreground) 9%, transparent);
347
+ }
348
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "lagoon",
3
+ "light": {
4
+ "palette": [
5
+ "#00846f",
6
+ "#34c29b",
7
+ "#ee7f45",
8
+ "#b6c6bf",
9
+ "#3d78c4",
10
+ "#1d6a9f",
11
+ "#0f6e41",
12
+ "#8f6900",
13
+ "#b52a2f",
14
+ "#0b8a70"
15
+ ],
16
+ "foreground": "#0b211c",
17
+ "muted": "#526860",
18
+ "border": "#d7e1dc",
19
+ "surface": "#fdfefd",
20
+ "surfaceForeground": "#0b211c",
21
+ "fontSans": "'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
22
+ "fontDisplay": "'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
23
+ "motionBaseMs": 200,
24
+ "motionSlowMs": 300
25
+ },
26
+ "dark": {
27
+ "palette": [
28
+ "#5b96e6",
29
+ "#14a688",
30
+ "#dc7240",
31
+ "#4b615a",
32
+ "#5fdcb9",
33
+ "#7db8e8",
34
+ "#55d795",
35
+ "#f3c44f",
36
+ "#ff7a7f",
37
+ "#4fdcb6"
38
+ ],
39
+ "foreground": "#e6f5ef",
40
+ "muted": "#96aba2",
41
+ "border": "#263c35",
42
+ "surface": "#111e1a",
43
+ "surfaceForeground": "#e6f5ef",
44
+ "fontSans": "'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
45
+ "fontDisplay": "'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
46
+ "motionBaseMs": 200,
47
+ "motionSlowMs": 300
48
+ }
49
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+
3
+ declare function AnimatedNumber({ value, format, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
4
+ value: number;
5
+ /** Cómo escribir el número. Por defecto, `Intl.NumberFormat` del idioma activo. */
6
+ format?: (value: number) => string;
7
+ }): React.JSX.Element;
8
+
9
+ export { AnimatedNumber };
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useDsLocale } from "../hooks/use-ds-messages.js";
5
+ import { cn } from "../lib/utils.js";
6
+ const DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
7
+ function AnimatedNumber({
8
+ value,
9
+ format,
10
+ className,
11
+ ...props
12
+ }) {
13
+ const locale = useDsLocale();
14
+ const [live, setLive] = React.useState(false);
15
+ React.useEffect(() => {
16
+ const id = window.requestAnimationFrame(() => setLive(true));
17
+ return () => window.cancelAnimationFrame(id);
18
+ }, []);
19
+ const text = format ? format(value) : new Intl.NumberFormat(locale).format(value);
20
+ const chars = [...live ? text : text.replace(/\d/g, "0")];
21
+ return /* @__PURE__ */ jsxs("span", { "data-slot": "animated-number", className: cn("inline-flex tabular-nums", className), ...props, children: [
22
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: text }),
23
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex", children: chars.map((ch, i) => {
24
+ const fromRight = chars.length - 1 - i;
25
+ if (!/\d/.test(ch)) {
26
+ return /* @__PURE__ */ jsx("span", { "data-slot": "animated-number-symbol", children: ch }, `s${fromRight}`);
27
+ }
28
+ return /* @__PURE__ */ jsxs(
29
+ "span",
30
+ {
31
+ "data-slot": "animated-number-wheel",
32
+ className: "relative inline-block overflow-hidden",
33
+ style: { "--v": Number(ch), "--k": fromRight },
34
+ children: [
35
+ /* @__PURE__ */ jsx("span", { className: "invisible", children: "0" }),
36
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-x-0 top-0 flex translate-y-[calc(var(--v)*-10%)] flex-col transition-transform duration-(--ds-odometer-duration) ease-(--ds-odometer-ease) [transition-delay:calc(var(--k)*var(--ds-odometer-stagger))] motion-reduce:transition-none", children: DIGITS.map((d) => /* @__PURE__ */ jsx("span", { children: d }, d)) })
37
+ ]
38
+ },
39
+ `d${fromRight}`
40
+ );
41
+ }) })
42
+ ] });
43
+ }
44
+ export {
45
+ AnimatedNumber
46
+ };
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
7
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | "cta" | null | undefined;
8
8
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function Button({ className, variant, size, render, nativeButton: _nativeButton, ...props }: useRender.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
package/dist/ui/button.js CHANGED
@@ -12,6 +12,7 @@ const buttonVariants = cva(
12
12
  secondary: "border-(--ds-button-secondary-border) bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground disabled:bg-[color:var(--ds-button-disabled-bg,var(--secondary))] disabled:text-[color:var(--ds-button-disabled-fg,var(--secondary-foreground))] disabled:border-[color:var(--ds-button-disabled-border,var(--ds-button-secondary-border))]",
13
13
  ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 disabled:bg-[color:var(--ds-button-disabled-bg,transparent)] disabled:text-[color:var(--ds-button-disabled-fg,currentColor)]",
14
14
  destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40 disabled:bg-[color:var(--ds-button-disabled-bg,color-mix(in_oklab,var(--destructive)_10%,transparent))] disabled:text-[color:var(--ds-button-disabled-fg,var(--destructive))] dark:disabled:bg-[color:var(--ds-button-disabled-bg,color-mix(in_oklab,var(--destructive)_20%,transparent))]",
15
+ cta: "bg-[color:var(--ds-cta-bg,var(--primary))] text-[color:var(--ds-cta-fg,var(--primary-foreground))] hover:bg-[color:var(--ds-cta-hover,var(--ds-cta-bg,var(--primary)))] disabled:bg-[color:var(--ds-button-disabled-bg,var(--ds-cta-bg,var(--primary)))] disabled:text-[color:var(--ds-button-disabled-fg,var(--ds-cta-fg,var(--primary-foreground)))]",
15
16
  link: "text-primary underline-offset-4 hover:underline disabled:bg-[color:var(--ds-button-disabled-bg,transparent)] disabled:text-[color:var(--ds-button-disabled-fg,var(--primary))]"
16
17
  },
17
18
  size: {
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+
3
+ declare function CardStack({ index, className, style, children, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
4
+ /** Posición de la tarjeta de delante (se envuelve: pasado el final vuelve a la primera). */
5
+ index: number;
6
+ children: React.ReactNode;
7
+ }): React.JSX.Element;
8
+
9
+ export { CardStack };
@@ -0,0 +1,47 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../lib/utils.js";
4
+ function CardStack({
5
+ index,
6
+ className,
7
+ style,
8
+ children,
9
+ ...props
10
+ }) {
11
+ const items = React.Children.toArray(children);
12
+ const n = items.length;
13
+ const current = n ? (Math.round(index) % n + n) % n : 0;
14
+ return /* @__PURE__ */ jsx(
15
+ "div",
16
+ {
17
+ "data-slot": "card-stack",
18
+ className: cn("grid pb-[calc(var(--ds-stack-offset)*2)] [&>*]:col-start-1 [&>*]:row-start-1", className),
19
+ style,
20
+ ...props,
21
+ children: items.map((child, i) => {
22
+ const pos = (i - current + n) % n;
23
+ const depth = Math.min(pos, 2);
24
+ const leaving = n > 3 && pos === n - 1;
25
+ return /* @__PURE__ */ jsx(
26
+ "div",
27
+ {
28
+ "data-slot": "card-stack-item",
29
+ "data-pos": leaving ? "out" : depth,
30
+ inert: pos !== 0 || void 0,
31
+ style: { "--p": depth },
32
+ className: cn(
33
+ "origin-bottom translate-y-[calc(var(--ds-stack-offset)*var(--p))] scale-[calc(1-var(--ds-stack-scale-step)*var(--p))] transition-[translate,scale,opacity] duration-(--ds-motion-base) ease-(--ds-ease-enter) motion-reduce:transition-none",
34
+ pos > 2 && !leaving && "pointer-events-none opacity-0",
35
+ leaving && "pointer-events-none -translate-y-full opacity-0"
36
+ ),
37
+ children: child
38
+ },
39
+ React.isValidElement(child) && child.key || i
40
+ );
41
+ })
42
+ }
43
+ );
44
+ }
45
+ export {
46
+ CardStack
47
+ };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+
4
+ declare function Dock({ orientation, className, onPointerMove, onPointerLeave, ...props }: React.ComponentProps<"nav"> & {
5
+ orientation?: "vertical" | "horizontal";
6
+ }): React.JSX.Element;
7
+ declare function DockItem({ label, active, className, render, ...props }: useRender.ComponentProps<"button"> & {
8
+ /** Nombre del acceso (accesible y tooltip nativo). Obligatorio: el botón solo lleva icono. */
9
+ label: string;
10
+ active?: boolean;
11
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
12
+
13
+ export { Dock, DockItem };
@@ -0,0 +1,103 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { mergeProps } from "@base-ui/react/merge-props";
5
+ import { useRender } from "@base-ui/react/use-render";
6
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
7
+ import { cn } from "../lib/utils.js";
8
+ const DockContext = React.createContext("vertical");
9
+ function readNumber(el, name, fallback) {
10
+ const n = Number.parseFloat(getComputedStyle(el).getPropertyValue(name));
11
+ return Number.isFinite(n) ? n : fallback;
12
+ }
13
+ function Dock({
14
+ orientation = "vertical",
15
+ className,
16
+ onPointerMove,
17
+ onPointerLeave,
18
+ ...props
19
+ }) {
20
+ const t = useDsMessages();
21
+ const ref = React.useRef(null);
22
+ const vertical = orientation === "vertical";
23
+ const reset = React.useCallback(() => {
24
+ ref.current?.querySelectorAll("[data-slot='dock-item']").forEach((el) => {
25
+ el.style.removeProperty("--dock-s");
26
+ el.style.removeProperty("--dock-push");
27
+ });
28
+ }, []);
29
+ const magnify = (e) => {
30
+ const root = ref.current;
31
+ if (!root || !window.matchMedia("(hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference)").matches) return;
32
+ const items = [...root.querySelectorAll("[data-slot='dock-item']")];
33
+ if (items.length < 2) return;
34
+ const max = readNumber(root, "--ds-dock-max-scale", 1);
35
+ const pitch = vertical ? items[1].offsetTop - items[0].offsetTop : items[1].offsetLeft - items[0].offsetLeft;
36
+ const reach = Math.abs(pitch) * readNumber(root, "--ds-dock-reach", 2.3);
37
+ const box = root.getBoundingClientRect();
38
+ const pointer = vertical ? e.clientY - box.top : e.clientX - box.left;
39
+ for (const el of items) {
40
+ const centre = vertical ? el.offsetTop + el.offsetHeight / 2 : el.offsetLeft + el.offsetWidth / 2;
41
+ const gap = pointer - centre;
42
+ const away = Math.abs(gap);
43
+ const s = away < reach ? 1 + (max - 1) * ((Math.cos(Math.PI * away / reach) + 1) / 2) : 1;
44
+ const push = -Math.sign(gap) * (vertical ? el.offsetHeight : el.offsetWidth) * 0.14 * Math.sin(Math.PI * Math.min(away / (reach * 1.35), 1));
45
+ el.style.setProperty("--dock-s", String(s));
46
+ el.style.setProperty("--dock-push", `${push}px`);
47
+ }
48
+ };
49
+ return /* @__PURE__ */ jsx(DockContext.Provider, { value: orientation, children: /* @__PURE__ */ jsx(
50
+ "nav",
51
+ {
52
+ ref,
53
+ "aria-label": t.dockLabel,
54
+ "data-slot": "dock",
55
+ "data-orientation": orientation,
56
+ className: cn(
57
+ "relative inline-flex items-center gap-(--ds-dock-gap) rounded-(--ds-dock-radius) bg-(--ds-dock-bg) p-(--ds-dock-pad) text-(--ds-dock-fg) shadow-(--ds-dock-shadow)",
58
+ vertical ? "flex-col" : "flex-row",
59
+ className
60
+ ),
61
+ onPointerMove: (e) => {
62
+ onPointerMove?.(e);
63
+ magnify(e);
64
+ },
65
+ onPointerLeave: (e) => {
66
+ onPointerLeave?.(e);
67
+ reset();
68
+ },
69
+ ...props
70
+ }
71
+ ) });
72
+ }
73
+ function DockItem({
74
+ label,
75
+ active,
76
+ className,
77
+ render,
78
+ ...props
79
+ }) {
80
+ const orientation = React.useContext(DockContext);
81
+ return useRender({
82
+ defaultTagName: "button",
83
+ props: mergeProps(
84
+ {
85
+ "aria-label": label,
86
+ title: label,
87
+ "aria-current": active ? "page" : void 0,
88
+ className: cn(
89
+ "grid size-(--ds-dock-item) shrink-0 place-items-center rounded-(--ds-dock-item-radius) text-inherit outline-none transition-[scale,translate,background-color,color] duration-(--ds-motion-fast) ease-(--ds-ease-standard) [scale:var(--dock-s,1)] hover:bg-[color-mix(in_oklch,currentColor_12%,transparent)] focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) data-active:bg-(--ds-dock-active-bg) data-active:text-(--ds-dock-active-fg) motion-reduce:transition-none [&_svg]:size-5",
90
+ orientation === "vertical" ? "[translate:0_var(--dock-push,0px)]" : "[translate:var(--dock-push,0px)_0]",
91
+ className
92
+ )
93
+ },
94
+ props
95
+ ),
96
+ render,
97
+ state: { slot: "dock-item", active: Boolean(active) }
98
+ });
99
+ }
100
+ export {
101
+ Dock,
102
+ DockItem
103
+ };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+
3
+ declare function MediaCard({ src, alt, title, meta, badge, action, className, children, ...props }: Omit<React.ComponentProps<"article">, "title"> & {
4
+ src?: string;
5
+ /** Texto alternativo de la imagen; vacío si es decorativa (por defecto). */
6
+ alt?: string;
7
+ title: React.ReactNode;
8
+ meta?: React.ReactNode;
9
+ badge?: React.ReactNode;
10
+ action?: React.ReactNode;
11
+ }): React.JSX.Element;
12
+
13
+ export { MediaCard };