orbital-ds 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/contract.json +38 -0
  2. package/dist/styles.css +89 -9
  3. package/dist/themes/zyro.css +189 -0
  4. package/dist/ui/accordion.d.ts +9 -0
  5. package/dist/ui/accordion.js +79 -0
  6. package/dist/ui/alert-dialog.d.ts +23 -0
  7. package/dist/ui/alert-dialog.js +173 -0
  8. package/dist/ui/alert.d.ts +13 -0
  9. package/dist/ui/alert.js +77 -0
  10. package/dist/ui/aspect-ratio.d.ts +7 -0
  11. package/dist/ui/aspect-ratio.js +22 -0
  12. package/dist/ui/attachment.d.ts +26 -0
  13. package/dist/ui/attachment.js +197 -0
  14. package/dist/ui/avatar.js +1 -1
  15. package/dist/ui/badge.d.ts +1 -1
  16. package/dist/ui/badge.js +1 -1
  17. package/dist/ui/bubble.d.ts +19 -0
  18. package/dist/ui/bubble.js +115 -0
  19. package/dist/ui/button-group.d.ts +15 -0
  20. package/dist/ui/button-group.js +82 -0
  21. package/dist/ui/button.d.ts +5 -3
  22. package/dist/ui/button.js +9 -6
  23. package/dist/ui/calendar.d.ts +15 -0
  24. package/dist/ui/calendar.js +190 -0
  25. package/dist/ui/card.js +4 -4
  26. package/dist/ui/carousel.d.ts +33 -0
  27. package/dist/ui/carousel.js +199 -0
  28. package/dist/ui/checkbox.js +1 -1
  29. package/dist/ui/combobox.d.ts +26 -0
  30. package/dist/ui/combobox.js +281 -0
  31. package/dist/ui/command.d.ts +22 -0
  32. package/dist/ui/command.js +183 -0
  33. package/dist/ui/context-menu.d.ts +31 -0
  34. package/dist/ui/context-menu.js +242 -0
  35. package/dist/ui/dialog.js +2 -2
  36. package/dist/ui/direction.d.ts +1 -0
  37. package/dist/ui/direction.js +8 -0
  38. package/dist/ui/drawer.d.ts +18 -0
  39. package/dist/ui/drawer.js +208 -0
  40. package/dist/ui/dropdown-menu.d.ts +1 -1
  41. package/dist/ui/dropdown-menu.js +13 -9
  42. package/dist/ui/empty.d.ts +15 -0
  43. package/dist/ui/empty.js +102 -0
  44. package/dist/ui/field.d.ts +28 -0
  45. package/dist/ui/field.js +217 -0
  46. package/dist/ui/hover-card.d.ts +8 -0
  47. package/dist/ui/hover-card.js +45 -0
  48. package/dist/ui/input-group.d.ts +22 -0
  49. package/dist/ui/input-group.js +145 -0
  50. package/dist/ui/input-otp.d.ts +13 -0
  51. package/dist/ui/input-otp.js +82 -0
  52. package/dist/ui/input.js +1 -1
  53. package/dist/ui/item.d.ts +26 -0
  54. package/dist/ui/item.js +195 -0
  55. package/dist/ui/kbd.d.ts +6 -0
  56. package/dist/ui/kbd.js +29 -0
  57. package/dist/ui/marker.d.ts +13 -0
  58. package/dist/ui/marker.js +71 -0
  59. package/dist/ui/menubar.d.ts +31 -0
  60. package/dist/ui/menubar.js +259 -0
  61. package/dist/ui/message-scroller.d.ts +16 -0
  62. package/dist/ui/message-scroller.js +120 -0
  63. package/dist/ui/message.d.ts +12 -0
  64. package/dist/ui/message.js +90 -0
  65. package/dist/ui/native-select.d.ts +10 -0
  66. package/dist/ui/native-select.js +63 -0
  67. package/dist/ui/navigation-menu.d.ts +15 -0
  68. package/dist/ui/navigation-menu.js +162 -0
  69. package/dist/ui/pagination.d.ts +22 -0
  70. package/dist/ui/pagination.js +128 -0
  71. package/dist/ui/popover.js +2 -2
  72. package/dist/ui/questionnaire.d.ts +24 -0
  73. package/dist/ui/questionnaire.js +331 -0
  74. package/dist/ui/radio-group.d.ts +8 -0
  75. package/dist/ui/radio-group.js +39 -0
  76. package/dist/ui/resizable.d.ts +10 -0
  77. package/dist/ui/resizable.js +46 -0
  78. package/dist/ui/scroll-area.js +1 -1
  79. package/dist/ui/select.js +5 -5
  80. package/dist/ui/sheet.js +4 -4
  81. package/dist/ui/sidebar.js +4 -4
  82. package/dist/ui/slider.d.ts +6 -0
  83. package/dist/ui/slider.js +53 -0
  84. package/dist/ui/spinner.d.ts +5 -0
  85. package/dist/ui/spinner.js +9 -0
  86. package/dist/ui/switch.d.ts +8 -0
  87. package/dist/ui/switch.js +32 -0
  88. package/dist/ui/table.js +2 -2
  89. package/dist/ui/tabs.js +1 -1
  90. package/dist/ui/textarea.js +1 -1
  91. package/dist/ui/toast.d.ts +19 -0
  92. package/dist/ui/toast.js +193 -0
  93. package/dist/ui/toggle-group.d.ts +14 -0
  94. package/dist/ui/toggle-group.js +77 -0
  95. package/dist/ui/toggle.d.ts +12 -0
  96. package/dist/ui/toggle.js +43 -0
  97. package/dist/ui/tooltip.js +3 -3
  98. package/docs/CONTRACT.md +113 -0
  99. package/package.json +133 -95
  100. package/scripts/doctor.mjs +142 -0
package/contract.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "version": 1,
3
+ "descripcion": "Contrato de tema de orbital-ds: todo tema (themes/*.css) debe definir estos tokens en :root. Nombres en inglés estándar; los de shadcn sin prefijo.",
4
+ "root": [
5
+ "radius",
6
+ "background", "foreground",
7
+ "card", "card-foreground",
8
+ "popover", "popover-foreground",
9
+ "primary", "primary-foreground",
10
+ "secondary", "secondary-foreground",
11
+ "muted", "muted-foreground",
12
+ "accent", "accent-foreground",
13
+ "destructive", "destructive-foreground",
14
+ "border", "input", "ring",
15
+ "chart-1", "chart-2", "chart-3", "chart-4", "chart-5",
16
+ "sidebar", "sidebar-foreground",
17
+ "sidebar-primary", "sidebar-primary-foreground",
18
+ "sidebar-accent", "sidebar-accent-foreground",
19
+ "sidebar-border", "sidebar-ring",
20
+ "danger", "danger-soft",
21
+ "warning", "warning-soft",
22
+ "success", "success-soft",
23
+ "info", "info-soft",
24
+ "neutral", "neutral-soft",
25
+ "link", "link-hover",
26
+ "inset", "inset-foreground",
27
+ "brand", "brand-bright"
28
+ ],
29
+ "fonts": ["font-sans"],
30
+ "dark": {
31
+ "descripcion": "Recomendados en .dark (si faltan, el tema hereda el valor claro y doctor avisa).",
32
+ "avisar_si_falta": [
33
+ "background", "foreground", "card", "card-foreground", "popover", "popover-foreground",
34
+ "primary", "primary-foreground", "muted", "muted-foreground", "border", "input", "ring",
35
+ "danger", "warning", "success", "info", "link"
36
+ ]
37
+ }
38
+ }
package/dist/styles.css CHANGED
@@ -60,9 +60,9 @@
60
60
  * ALTURA DE CONTROLES — una escala para botón, campo y select, así alineados
61
61
  * en una misma fila. Densidad distinta = cambiar estos tres valores.
62
62
  */
63
- --control-h-sm: 2rem;
64
- --control-h-md: 2.25rem;
65
- --control-h-lg: 2.5rem;
63
+ --ds-control-h-sm: 2rem;
64
+ --ds-control-h-md: 2.25rem;
65
+ --ds-control-h-lg: 2.5rem;
66
66
 
67
67
  /*
68
68
  * SOMBRAS SEMÁNTICAS — un hueco por tipo de pieza. `control` vale `none` hoy:
@@ -80,20 +80,58 @@
80
80
  * número. raised: pieza que sobresale de su fila · sticky: barras fijas ·
81
81
  * overlay: menús, diálogos, paneles y tooltips.
82
82
  */
83
- --z-raised: 10;
84
- --z-sticky: 20;
85
- --z-overlay: 50;
83
+ --ds-z-raised: 10;
84
+ --ds-z-sticky: 20;
85
+ --ds-z-overlay: 50;
86
86
 
87
87
  /* MOVIMIENTO — dos duraciones; `reduced-motion` ya se respeta en la capa base. */
88
- --motion-fast: 100ms;
89
- --motion-base: 200ms;
88
+ --ds-motion-fast: 100ms;
89
+ --ds-motion-base: 200ms;
90
+ --ds-motion-slow: 300ms;
91
+ --ds-motion-blink: 1s;
90
92
 
91
93
  /* FOCO — grosor del anillo de foco/error de todos los controles. */
92
- --ring-width: 3px;
94
+ --ds-ring-width: 3px;
93
95
 
94
96
  /* Velo tras diálogos y paneles. Un tema puede cambiar su tinte u opacidad. */
95
97
  --color-scrim: oklch(0 0 0 / 0.8);
96
98
 
99
+ /*
100
+ * ESPACIADO INTERNO — un hueco por tipo de pieza. Los valores por defecto son
101
+ * los de siempre; un tema que quiera más aire (o más densidad) los cambia aquí,
102
+ * sin tocar ningún componente.
103
+ * card tarjeta (md / sm) · field campos y selects · cell celdas de tabla
104
+ * overlay diálogos y paneles · popover · menu / menu-item menús
105
+ * button botones por tamaño · badge etiquetas
106
+ */
107
+ --ds-card-spacing: 1.5rem;
108
+ --ds-card-spacing-sm: 1rem;
109
+ --ds-field-px: 0.75rem;
110
+ --ds-cell-p: 0.75rem;
111
+ --ds-overlay-p: 1.5rem;
112
+ --ds-overlay-gap: 1.5rem;
113
+ --ds-popover-p: 1rem;
114
+ --ds-menu-p: 0.25rem;
115
+ --ds-menu-item-px: 0.75rem;
116
+ --ds-menu-item-py: 0.5rem;
117
+ --ds-button-px-sm: 0.75rem;
118
+ --ds-button-px-md: 1rem;
119
+ --ds-button-px-lg: 1rem;
120
+ --ds-badge-px: 0.625rem;
121
+
122
+ /*
123
+ * MATERIALES — cómo es la superficie, más allá del color. Cada valor es un
124
+ * `backdrop-filter` completo (p. ej. `blur(28px) saturate(180%)`). Por defecto
125
+ * `none`: sin efecto y sin coste. Un tema de cristal (zyro) les da valores.
126
+ * El fondo de la página (`page-backdrop`) es un `background-image`: degradado,
127
+ * imagen o `none`.
128
+ */
129
+ --ds-card-backdrop: none;
130
+ --ds-overlay-backdrop: none;
131
+ --ds-field-backdrop: none;
132
+ --ds-sidebar-backdrop: none;
133
+ --ds-page-backdrop: none;
134
+
97
135
  /*
98
136
  * Dos sombras y no más: reposo y realce al señalar. Una tarjeta que no se
99
137
  * puede pulsar no necesita la segunda.
@@ -345,3 +383,45 @@
345
383
  }
346
384
  }
347
385
  }
386
+
387
+
388
+ /*
389
+ * Aplicación de los MATERIALES. Va en la capa base para que cualquier utilidad
390
+ * explícita la gane, y por `data-slot` para que lo hereden todos los
391
+ * componentes del paquete sin que ninguno escriba un efecto propio.
392
+ */
393
+ @layer base {
394
+ body {
395
+ background-image: var(--ds-page-backdrop);
396
+ background-attachment: fixed;
397
+ background-size: cover;
398
+ }
399
+
400
+ [data-slot='card'] {
401
+ -webkit-backdrop-filter: var(--ds-card-backdrop);
402
+ backdrop-filter: var(--ds-card-backdrop);
403
+ }
404
+
405
+ [data-slot='popover-content'],
406
+ [data-slot='dropdown-menu-content'],
407
+ [data-slot='dropdown-menu-sub-content'],
408
+ [data-slot='select-content'],
409
+ [data-slot='dialog-content'],
410
+ [data-slot='sheet-content'],
411
+ [data-slot='tooltip-content'] {
412
+ -webkit-backdrop-filter: var(--ds-overlay-backdrop);
413
+ backdrop-filter: var(--ds-overlay-backdrop);
414
+ }
415
+
416
+ [data-slot='input'],
417
+ [data-slot='textarea'],
418
+ [data-slot='select-trigger'] {
419
+ -webkit-backdrop-filter: var(--ds-field-backdrop);
420
+ backdrop-filter: var(--ds-field-backdrop);
421
+ }
422
+
423
+ [data-slot='sidebar-inner'] {
424
+ -webkit-backdrop-filter: var(--ds-sidebar-backdrop);
425
+ backdrop-filter: var(--ds-sidebar-backdrop);
426
+ }
427
+ }
@@ -0,0 +1,189 @@
1
+ /*
2
+ * TEMA zyro — «liquid glass» (traducido de faro-orbital-zyro-ui/global.css).
3
+ *
4
+ * Identidad: lienzo lavanda claro / azul muy oscuro, acento azul profundo
5
+ * (claro) y cian (oscuro), cristal traslúcido con desenfoque y saturación, y
6
+ * un fondo vivo. Cumple el MISMO contrato de tema que `qratia` (ver
7
+ * `contract.json`): todo lo que cambia respecto a qratia es aspecto, no API.
8
+ *
9
+ * Importar DESPUÉS de la estructura (`orbital-ds/styles.css`), para que este
10
+ * tema pueda sobrescribir también la escala de radios y las sombras:
11
+ *
12
+ * @import 'orbital-ds/styles.css';
13
+ * @import 'orbital-ds/themes/zyro.css';
14
+ *
15
+ * Valores derivados (no vienen tal cual de zyro-ui): danger, danger-soft,
16
+ * neutral(-soft), link-hover, brand-bright y inset, que zyro no define con
17
+ * esos nombres; y el texto sobre el primario en oscuro, que se oscurece para
18
+ * alcanzar contraste AA.
19
+ *
20
+ * Tipografía: Montserrat (titulares) + Roboto (cuerpo). Cárgalas en la app
21
+ * (<link> a Google Fonts o self-host).
22
+ */
23
+
24
+ @theme inline {
25
+ /* Tipografía */
26
+ --font-sans: 'Roboto', system-ui, -apple-system, sans-serif;
27
+ --font-display: 'Montserrat', system-ui, -apple-system, sans-serif;
28
+ --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
29
+
30
+ /* Escala de radios Zyro: el radio crece con el tamaño del contenedor. */
31
+ --radius-sm: 7px;
32
+ --radius-md: 10px;
33
+ --radius-lg: 14px;
34
+ --radius-xl: 18px;
35
+ --radius-2xl: 22px;
36
+ --radius-control: 10px;
37
+ --radius-overlay: 22px;
38
+
39
+ /* Sombras de cristal: capa tensa + difusa y brillo interior en el borde. */
40
+ --shadow-card: 0 2px 14px rgba(28, 48, 100, 0.07);
41
+ --shadow-card-hover:
42
+ 0 4px 30px rgba(28, 48, 100, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
43
+ --shadow-raised:
44
+ 0 4px 30px rgba(28, 48, 100, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
45
+ --shadow-overlay:
46
+ 0 14px 52px rgba(28, 48, 100, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
47
+ --shadow-popover:
48
+ 0 14px 52px rgba(28, 48, 100, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
49
+ }
50
+
51
+ /* ── PIEL CLARA ─────────────────────────────────────────────────────────── */
52
+ :root {
53
+ --radius: 18px;
54
+
55
+ --background: #eaeefb;
56
+ --foreground: rgba(14, 22, 48, 0.92);
57
+
58
+ --card: rgba(255, 255, 255, 0.98);
59
+ --card-foreground: rgba(14, 22, 48, 0.92);
60
+ --popover: #ffffff;
61
+ --popover-foreground: rgba(14, 22, 48, 0.92);
62
+
63
+ --primary: #0349fe;
64
+ --primary-foreground: #ffffff;
65
+ --secondary: rgba(243, 246, 253, 0.9);
66
+ --secondary-foreground: rgba(14, 22, 48, 0.92);
67
+ --muted: rgba(243, 246, 253, 0.9);
68
+ --muted-foreground: rgba(14, 22, 48, 0.66);
69
+ --accent: rgba(3, 73, 254, 0.09);
70
+ --accent-foreground: #0349fe;
71
+ --destructive: #eb1919;
72
+ --destructive-foreground: #ffffff;
73
+
74
+ --border: rgba(168, 190, 235, 0.3);
75
+ --input: rgba(168, 190, 235, 0.55);
76
+ --ring: #0349fe;
77
+
78
+ --chart-1: #0349fe;
79
+ --chart-2: #14bd44;
80
+ --chart-3: #ffb300;
81
+ --chart-4: #eb1919;
82
+ --chart-5: #9747ff;
83
+
84
+ --sidebar: rgba(255, 255, 255, 0.4);
85
+ --sidebar-foreground: rgba(14, 22, 48, 0.66);
86
+ --sidebar-primary: #0349fe;
87
+ --sidebar-primary-foreground: #ffffff;
88
+ --sidebar-accent: rgba(3, 73, 254, 0.09);
89
+ --sidebar-accent-foreground: #0349fe;
90
+ --sidebar-border: rgba(168, 190, 235, 0.3);
91
+ --sidebar-ring: #0349fe;
92
+
93
+ /* Estados (variante oscura para texto sobre claro) */
94
+ --danger: #c21414;
95
+ --danger-soft: rgba(235, 25, 25, 0.1);
96
+ --warning: #9a6e00;
97
+ --warning-soft: rgba(255, 179, 0, 0.16);
98
+ --success: #0e8f34;
99
+ --success-soft: rgba(20, 189, 68, 0.12);
100
+ --info: #136ba8;
101
+ --info-soft: rgba(42, 147, 213, 0.12);
102
+ --neutral: rgba(14, 22, 48, 0.6);
103
+ --neutral-soft: rgba(14, 22, 48, 0.06);
104
+
105
+ --link: #0349fe;
106
+ --link-hover: #0236c0;
107
+ --inset: rgba(243, 246, 253, 0.9);
108
+ --inset-foreground: rgba(14, 22, 48, 0.92);
109
+ --brand: #0349fe;
110
+ --brand-bright: #36b3ed;
111
+
112
+ /* Materiales: cristal. El fondo vivo (malla WebGL en zyro-ui) se aproxima
113
+ aquí con degradados; el componente de malla es opcional. */
114
+ --ds-sidebar-backdrop: blur(28px) saturate(180%);
115
+ --ds-overlay-backdrop: blur(28px) saturate(180%);
116
+ --ds-field-backdrop: blur(12px) saturate(160%);
117
+ --ds-card-backdrop: none;
118
+ --ds-page-backdrop:
119
+ radial-gradient(60% 50% at 12% 8%, rgba(54, 179, 237, 0.4), transparent 70%),
120
+ radial-gradient(55% 45% at 88% 18%, rgba(3, 73, 254, 0.24), transparent 70%),
121
+ radial-gradient(50% 55% at 55% 100%, rgba(151, 71, 255, 0.2), transparent 70%);
122
+ }
123
+
124
+ /* ── PIEL OSCURA ────────────────────────────────────────────────────────── */
125
+ .dark {
126
+ --background: #0e3148;
127
+ --foreground: rgba(255, 255, 255, 0.94);
128
+
129
+ --card: rgba(16, 24, 54, 0.94);
130
+ --card-foreground: rgba(255, 255, 255, 0.94);
131
+ --popover: rgba(22, 32, 68, 0.97);
132
+ --popover-foreground: rgba(255, 255, 255, 0.94);
133
+
134
+ --primary: #36b3ed;
135
+ --primary-foreground: #04121c;
136
+ --secondary: rgba(255, 255, 255, 0.05);
137
+ --secondary-foreground: rgba(255, 255, 255, 0.94);
138
+ --muted: rgba(255, 255, 255, 0.05);
139
+ --muted-foreground: rgba(255, 255, 255, 0.68);
140
+ --accent: rgba(54, 179, 237, 0.16);
141
+ --accent-foreground: #36b3ed;
142
+ --destructive: #eb1919;
143
+ --destructive-foreground: #ffffff;
144
+
145
+ --border: rgba(255, 255, 255, 0.07);
146
+ --input: rgba(255, 255, 255, 0.12);
147
+ --ring: #36b3ed;
148
+
149
+ --chart-1: #36b3ed;
150
+ --chart-2: #14bd44;
151
+ --chart-3: #ffb300;
152
+ --chart-4: #eb1919;
153
+ --chart-5: #9747ff;
154
+
155
+ --sidebar: rgba(255, 255, 255, 0.04);
156
+ --sidebar-foreground: rgba(255, 255, 255, 0.68);
157
+ --sidebar-primary: #36b3ed;
158
+ --sidebar-primary-foreground: #04121c;
159
+ --sidebar-accent: rgba(54, 179, 237, 0.16);
160
+ --sidebar-accent-foreground: #36b3ed;
161
+ --sidebar-border: rgba(255, 255, 255, 0.07);
162
+ --sidebar-ring: #36b3ed;
163
+
164
+ --danger: #ff6b6b;
165
+ --danger-soft: rgba(235, 25, 25, 0.2);
166
+ --warning: #ffb300;
167
+ --warning-soft: rgba(255, 179, 0, 0.18);
168
+ --success: #14bd44;
169
+ --success-soft: rgba(20, 189, 68, 0.18);
170
+ --info: #2a93d5;
171
+ --info-soft: rgba(42, 147, 213, 0.2);
172
+ --neutral: rgba(255, 255, 255, 0.6);
173
+ --neutral-soft: rgba(255, 255, 255, 0.08);
174
+
175
+ --link: #36b3ed;
176
+ --link-hover: #7fd0f5;
177
+ --inset: rgba(255, 255, 255, 0.05);
178
+ --inset-foreground: rgba(255, 255, 255, 0.94);
179
+ --brand: #36b3ed;
180
+ --brand-bright: #7fd0f5;
181
+
182
+ --ds-sidebar-backdrop: blur(24px) saturate(180%);
183
+ --ds-overlay-backdrop: blur(24px) saturate(180%);
184
+ --ds-field-backdrop: blur(12px) saturate(160%);
185
+ --ds-page-backdrop:
186
+ radial-gradient(60% 50% at 12% 8%, rgba(54, 179, 237, 0.3), transparent 70%),
187
+ radial-gradient(55% 45% at 88% 18%, rgba(3, 73, 254, 0.28), transparent 70%),
188
+ radial-gradient(50% 55% at 55% 100%, rgba(151, 71, 255, 0.22), transparent 70%);
189
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
3
+
4
+ declare function Accordion({ className, ...props }: Accordion$1.Root.Props): React.JSX.Element;
5
+ declare function AccordionItem({ className, ...props }: Accordion$1.Item.Props): React.JSX.Element;
6
+ declare function AccordionTrigger({ className, children, ...props }: Accordion$1.Trigger.Props): React.JSX.Element;
7
+ declare function AccordionContent({ className, children, ...props }: Accordion$1.Panel.Props): React.JSX.Element;
8
+
9
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
@@ -0,0 +1,79 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
3
+ import { cn } from "../lib/utils";
4
+ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
5
+ function Accordion({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx(
7
+ AccordionPrimitive.Root,
8
+ {
9
+ "data-slot": "accordion",
10
+ className: cn(
11
+ "flex w-full flex-col overflow-hidden rounded-2xl border",
12
+ className
13
+ ),
14
+ ...props
15
+ }
16
+ );
17
+ }
18
+ function AccordionItem({ className, ...props }) {
19
+ return /* @__PURE__ */ jsx(
20
+ AccordionPrimitive.Item,
21
+ {
22
+ "data-slot": "accordion-item",
23
+ className: cn("not-last:border-b data-open:bg-muted/50", className),
24
+ ...props
25
+ }
26
+ );
27
+ }
28
+ function AccordionTrigger({
29
+ className,
30
+ children,
31
+ ...props
32
+ }) {
33
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
34
+ AccordionPrimitive.Trigger,
35
+ {
36
+ "data-slot": "accordion-trigger",
37
+ className: cn(
38
+ "group/accordion-trigger relative flex flex-1 items-start justify-between gap-6 border border-transparent p-4 text-left text-sm font-medium transition-all outline-none hover:underline aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
39
+ className
40
+ ),
41
+ ...props,
42
+ children: [
43
+ children,
44
+ /* @__PURE__ */ jsx(ChevronDownIcon, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" }),
45
+ /* @__PURE__ */ jsx(ChevronUpIcon, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" })
46
+ ]
47
+ }
48
+ ) });
49
+ }
50
+ function AccordionContent({
51
+ className,
52
+ children,
53
+ ...props
54
+ }) {
55
+ return /* @__PURE__ */ jsx(
56
+ AccordionPrimitive.Panel,
57
+ {
58
+ "data-slot": "accordion-content",
59
+ className: "overflow-hidden px-4 text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",
60
+ ...props,
61
+ children: /* @__PURE__ */ jsx(
62
+ "div",
63
+ {
64
+ className: cn(
65
+ "h-(--accordion-panel-height) pt-0 pb-4 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
66
+ className
67
+ ),
68
+ children
69
+ }
70
+ )
71
+ }
72
+ );
73
+ }
74
+ export {
75
+ Accordion,
76
+ AccordionContent,
77
+ AccordionItem,
78
+ AccordionTrigger
79
+ };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
3
+ import { Button } from './button.js';
4
+ import 'class-variance-authority/types';
5
+ import '@base-ui/react/use-render';
6
+ import 'class-variance-authority';
7
+
8
+ declare function AlertDialog({ ...props }: AlertDialog$1.Root.Props): React.JSX.Element;
9
+ declare function AlertDialogTrigger({ ...props }: AlertDialog$1.Trigger.Props): React.JSX.Element;
10
+ declare function AlertDialogPortal({ ...props }: AlertDialog$1.Portal.Props): React.JSX.Element;
11
+ declare function AlertDialogOverlay({ className, ...props }: AlertDialog$1.Backdrop.Props): React.JSX.Element;
12
+ declare function AlertDialogContent({ className, size, ...props }: AlertDialog$1.Popup.Props & {
13
+ size?: "default" | "sm";
14
+ }): React.JSX.Element;
15
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
16
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
17
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
18
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Title>): React.JSX.Element;
19
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Description>): React.JSX.Element;
20
+ declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
21
+ declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialog$1.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
22
+
23
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
@@ -0,0 +1,173 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
3
+ import { cn } from "../lib/utils";
4
+ import { Button } from "./button";
5
+ function AlertDialog({ ...props }) {
6
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
7
+ }
8
+ function AlertDialogTrigger({ ...props }) {
9
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
10
+ }
11
+ function AlertDialogPortal({ ...props }) {
12
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
13
+ }
14
+ function AlertDialogOverlay({
15
+ className,
16
+ ...props
17
+ }) {
18
+ return /* @__PURE__ */ jsx(
19
+ AlertDialogPrimitive.Backdrop,
20
+ {
21
+ "data-slot": "alert-dialog-overlay",
22
+ className: cn(
23
+ "fixed inset-0 isolate z-(--ds-z-overlay) bg-scrim duration-(--ds-motion-fast) supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
24
+ className
25
+ ),
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+ function AlertDialogContent({
31
+ className,
32
+ size = "default",
33
+ ...props
34
+ }) {
35
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
36
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
37
+ /* @__PURE__ */ jsx(
38
+ AlertDialogPrimitive.Popup,
39
+ {
40
+ "data-slot": "alert-dialog-content",
41
+ "data-size": size,
42
+ className: cn(
43
+ "group/alert-dialog-content fixed top-1/2 left-1/2 z-(--ds-z-overlay) grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-control bg-popover p-6 text-popover-foreground ring-1 ring-foreground/5 duration-(--ds-motion-fast) outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md 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",
44
+ className
45
+ ),
46
+ ...props
47
+ }
48
+ )
49
+ ] });
50
+ }
51
+ function AlertDialogHeader({
52
+ className,
53
+ ...props
54
+ }) {
55
+ return /* @__PURE__ */ jsx(
56
+ "div",
57
+ {
58
+ "data-slot": "alert-dialog-header",
59
+ className: cn(
60
+ "grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 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]",
61
+ className
62
+ ),
63
+ ...props
64
+ }
65
+ );
66
+ }
67
+ function AlertDialogFooter({
68
+ className,
69
+ ...props
70
+ }) {
71
+ return /* @__PURE__ */ jsx(
72
+ "div",
73
+ {
74
+ "data-slot": "alert-dialog-footer",
75
+ className: cn(
76
+ "flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
77
+ className
78
+ ),
79
+ ...props
80
+ }
81
+ );
82
+ }
83
+ function AlertDialogMedia({
84
+ className,
85
+ ...props
86
+ }) {
87
+ return /* @__PURE__ */ jsx(
88
+ "div",
89
+ {
90
+ "data-slot": "alert-dialog-media",
91
+ className: cn(
92
+ "mb-2 inline-flex size-16 items-center justify-center rounded-full bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
93
+ className
94
+ ),
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ function AlertDialogTitle({
100
+ className,
101
+ ...props
102
+ }) {
103
+ return /* @__PURE__ */ jsx(
104
+ AlertDialogPrimitive.Title,
105
+ {
106
+ "data-slot": "alert-dialog-title",
107
+ className: cn(
108
+ "text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
109
+ className
110
+ ),
111
+ ...props
112
+ }
113
+ );
114
+ }
115
+ function AlertDialogDescription({
116
+ className,
117
+ ...props
118
+ }) {
119
+ return /* @__PURE__ */ jsx(
120
+ AlertDialogPrimitive.Description,
121
+ {
122
+ "data-slot": "alert-dialog-description",
123
+ className: cn(
124
+ "text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
125
+ className
126
+ ),
127
+ ...props
128
+ }
129
+ );
130
+ }
131
+ function AlertDialogAction({
132
+ className,
133
+ ...props
134
+ }) {
135
+ return /* @__PURE__ */ jsx(
136
+ Button,
137
+ {
138
+ "data-slot": "alert-dialog-action",
139
+ className: cn(className),
140
+ ...props
141
+ }
142
+ );
143
+ }
144
+ function AlertDialogCancel({
145
+ className,
146
+ variant = "outline",
147
+ size = "default",
148
+ ...props
149
+ }) {
150
+ return /* @__PURE__ */ jsx(
151
+ AlertDialogPrimitive.Close,
152
+ {
153
+ "data-slot": "alert-dialog-cancel",
154
+ className: cn(className),
155
+ render: /* @__PURE__ */ jsx(Button, { variant, size }),
156
+ ...props
157
+ }
158
+ );
159
+ }
160
+ export {
161
+ AlertDialog,
162
+ AlertDialogAction,
163
+ AlertDialogCancel,
164
+ AlertDialogContent,
165
+ AlertDialogDescription,
166
+ AlertDialogFooter,
167
+ AlertDialogHeader,
168
+ AlertDialogMedia,
169
+ AlertDialogOverlay,
170
+ AlertDialogPortal,
171
+ AlertDialogTitle,
172
+ AlertDialogTrigger
173
+ };
@@ -0,0 +1,13 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const alertVariants: (props?: ({
6
+ variant?: "default" | "destructive" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
9
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+
13
+ export { Alert, AlertAction, AlertDescription, AlertTitle };