orbital-ds 0.7.0 → 0.9.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 (109) hide show
  1. package/AGENTS.md +145 -80
  2. package/README.md +87 -73
  3. package/components.manifest.json +1326 -1267
  4. package/contract.json +226 -168
  5. package/dist/hooks/use-ds-messages.d.ts +36 -0
  6. package/dist/hooks/use-ds-messages.js +12 -0
  7. package/dist/hooks/use-ds-motion.d.ts +17 -0
  8. package/dist/hooks/use-ds-motion.js +50 -0
  9. package/dist/lib/i18n.d.ts +46 -0
  10. package/dist/lib/i18n.js +109 -0
  11. package/dist/lib/motion.d.ts +74 -0
  12. package/dist/lib/motion.js +97 -0
  13. package/dist/styles.css +876 -528
  14. package/dist/themes/friendly.css +362 -318
  15. package/dist/themes/friendly.meta.json +75 -14
  16. package/dist/themes/friendly.scoped.css +362 -318
  17. package/dist/themes/qratia.meta.json +42 -12
  18. package/dist/themes/tactile.css +575 -429
  19. package/dist/themes/tactile.fonts.css +3 -2
  20. package/dist/themes/tactile.guide.md +82 -49
  21. package/dist/themes/tactile.meta.json +175 -16
  22. package/dist/themes/tactile.scoped.css +575 -429
  23. package/dist/themes/twitter.css +354 -298
  24. package/dist/themes/twitter.meta.json +83 -61
  25. package/dist/themes/twitter.scoped.css +354 -298
  26. package/dist/themes/zyro.css +443 -389
  27. package/dist/themes/zyro.meta.json +67 -14
  28. package/dist/themes/zyro.scoped.css +443 -389
  29. package/dist/ui/accordion.js +5 -5
  30. package/dist/ui/alert-dialog.js +3 -3
  31. package/dist/ui/alert.d.ts +1 -1
  32. package/dist/ui/alert.js +9 -3
  33. package/dist/ui/attachment.d.ts +1 -1
  34. package/dist/ui/attachment.js +4 -4
  35. package/dist/ui/avatar.js +6 -6
  36. package/dist/ui/ayuda.js +3 -2
  37. package/dist/ui/badge.d.ts +1 -1
  38. package/dist/ui/badge.js +9 -3
  39. package/dist/ui/banner.d.ts +14 -0
  40. package/dist/ui/banner.js +88 -0
  41. package/dist/ui/breadcrumb.js +7 -3
  42. package/dist/ui/bubble.js +6 -6
  43. package/dist/ui/button-group.js +4 -4
  44. package/dist/ui/button.d.ts +1 -1
  45. package/dist/ui/button.js +5 -5
  46. package/dist/ui/calendar.js +33 -6
  47. package/dist/ui/card.js +4 -4
  48. package/dist/ui/carousel.js +15 -8
  49. package/dist/ui/chart.js +7 -3
  50. package/dist/ui/checkbox.js +1 -1
  51. package/dist/ui/combobox.js +7 -7
  52. package/dist/ui/command.js +13 -11
  53. package/dist/ui/context-menu.js +8 -8
  54. package/dist/ui/dialog.js +10 -6
  55. package/dist/ui/drawer.js +9 -9
  56. package/dist/ui/dropdown-menu.js +8 -8
  57. package/dist/ui/empty.js +3 -3
  58. package/dist/ui/field.js +2 -2
  59. package/dist/ui/hover-card.js +1 -1
  60. package/dist/ui/i18n-provider.d.ts +11 -0
  61. package/dist/ui/i18n-provider.js +18 -0
  62. package/dist/ui/icon-tile.d.ts +1 -1
  63. package/dist/ui/input-group.d.ts +1 -1
  64. package/dist/ui/input-group.js +11 -9
  65. package/dist/ui/input-otp.js +3 -3
  66. package/dist/ui/input.js +1 -1
  67. package/dist/ui/item.d.ts +1 -1
  68. package/dist/ui/item.js +3 -3
  69. package/dist/ui/kbd.js +1 -1
  70. package/dist/ui/label.js +1 -1
  71. package/dist/ui/marker.d.ts +1 -1
  72. package/dist/ui/marker.js +2 -2
  73. package/dist/ui/menubar.js +9 -9
  74. package/dist/ui/message-scroller.js +5 -2
  75. package/dist/ui/message.js +2 -2
  76. package/dist/ui/motion-provider.d.ts +11 -0
  77. package/dist/ui/motion-provider.js +16 -0
  78. package/dist/ui/native-select.js +4 -4
  79. package/dist/ui/navigation-menu.js +7 -6
  80. package/dist/ui/pagination.js +19 -11
  81. package/dist/ui/popover.js +2 -2
  82. package/dist/ui/progress.js +2 -2
  83. package/dist/ui/questionnaire.js +20 -15
  84. package/dist/ui/radio-group.js +2 -2
  85. package/dist/ui/resizable.js +2 -2
  86. package/dist/ui/scroll-area.js +3 -3
  87. package/dist/ui/select.js +6 -6
  88. package/dist/ui/separator.js +1 -1
  89. package/dist/ui/sheet.js +6 -4
  90. package/dist/ui/sidebar.js +42 -30
  91. package/dist/ui/skeleton.js +1 -1
  92. package/dist/ui/slider.js +6 -6
  93. package/dist/ui/sonner.js +25 -8
  94. package/dist/ui/spinner.js +4 -1
  95. package/dist/ui/switch.js +2 -2
  96. package/dist/ui/table.js +3 -3
  97. package/dist/ui/tabs.js +5 -5
  98. package/dist/ui/textarea.js +1 -1
  99. package/dist/ui/toast.js +15 -12
  100. package/dist/ui/toggle-group.js +2 -2
  101. package/dist/ui/toggle.js +6 -4
  102. package/dist/ui/tooltip.js +2 -2
  103. package/docs/CONTRACT.md +183 -153
  104. package/package.json +160 -142
  105. package/scripts/brand-core.mjs +153 -0
  106. package/scripts/doctor.mjs +128 -7
  107. package/scripts/i18n.mjs +111 -0
  108. package/scripts/init.mjs +294 -57
  109. package/scripts/setup.mjs +99 -0
package/contract.json CHANGED
@@ -1,168 +1,226 @@
1
- {
2
- "version": 4,
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; los propios con --ds-. baseTheme es el tema aplicado siempre (los demás se aplican encima, con ámbito).",
4
- "root": [
5
- "radius",
6
- "background",
7
- "foreground",
8
- "card",
9
- "card-foreground",
10
- "popover",
11
- "popover-foreground",
12
- "primary",
13
- "primary-foreground",
14
- "secondary",
15
- "secondary-foreground",
16
- "muted",
17
- "muted-foreground",
18
- "accent",
19
- "accent-foreground",
20
- "destructive",
21
- "destructive-foreground",
22
- "border",
23
- "input",
24
- "ring",
25
- "chart-1",
26
- "chart-2",
27
- "chart-3",
28
- "chart-4",
29
- "chart-5",
30
- "sidebar",
31
- "sidebar-foreground",
32
- "sidebar-primary",
33
- "sidebar-primary-foreground",
34
- "sidebar-accent",
35
- "sidebar-accent-foreground",
36
- "sidebar-border",
37
- "sidebar-ring",
38
- "danger",
39
- "danger-soft",
40
- "warning",
41
- "warning-soft",
42
- "success",
43
- "success-soft",
44
- "info",
45
- "info-soft",
46
- "neutral",
47
- "neutral-soft",
48
- "link",
49
- "link-hover",
50
- "inset",
51
- "inset-foreground",
52
- "brand",
53
- "brand-bright",
54
- "ds-sidebar-icon",
55
- "ds-sidebar-icon-stroke",
56
- "ds-sidebar-rail-w",
57
- "ds-sidebar-rail-item",
58
- "ds-sidebar-logo",
59
- "ds-sidebar-sep-inset"
60
- ],
61
- "fonts": [
62
- "ds-font-sans"
63
- ],
64
- "dark": {
65
- "descripcion": "Recomendados en .dark (si faltan, el tema hereda el valor claro y doctor avisa).",
66
- "avisar_si_falta": [
67
- "background",
68
- "foreground",
69
- "card",
70
- "card-foreground",
71
- "popover",
72
- "popover-foreground",
73
- "primary",
74
- "primary-foreground",
75
- "muted",
76
- "muted-foreground",
77
- "border",
78
- "input",
79
- "ring",
80
- "danger",
81
- "warning",
82
- "success",
83
- "info",
84
- "link"
85
- ]
86
- },
87
- "baseTheme": "qratia",
88
- "brand": {
89
- "descripcion": "Grupo ESTABLE de variables que una app suele personalizar en su fichero de marca (brand.css). Renombrar o quitar una es versión MAYOR. Todas están también en `root` salvo las --ds-*.",
90
- "tokens": [
91
- {
92
- "name": "primary",
93
- "example": "oklch(0.55 0.2 260)",
94
- "about": "color de acción principal (botones, foco)"
95
- },
96
- {
97
- "name": "primary-foreground",
98
- "example": "#ffffff",
99
- "about": "texto sobre el color principal (comprueba el contraste)"
100
- },
101
- {
102
- "name": "ring",
103
- "example": "oklch(0.55 0.2 260)",
104
- "about": "anillo de foco; suele ir igual que primary"
105
- },
106
- {
107
- "name": "link",
108
- "example": "oklch(0.5 0.15 260)",
109
- "about": "texto de enlace: más oscuro que primary para tener contraste"
110
- },
111
- {
112
- "name": "link-hover",
113
- "example": "oklch(0.42 0.13 260)",
114
- "about": "enlace al pasar el ratón"
115
- },
116
- {
117
- "name": "brand",
118
- "example": "oklch(0.7 0.13 220)",
119
- "about": "acento de marca (detalles, selección)"
120
- },
121
- {
122
- "name": "brand-bright",
123
- "example": "oklch(0.8 0.13 220)",
124
- "about": "acento de marca sobre fondos oscuros"
125
- },
126
- {
127
- "name": "sidebar-primary",
128
- "example": "oklch(0.8 0.13 220)",
129
- "about": "acento dentro del sidebar"
130
- },
131
- {
132
- "name": "sidebar-primary-foreground",
133
- "example": "#04121c",
134
- "about": "texto sobre el acento del sidebar"
135
- },
136
- {
137
- "name": "sidebar-accent-foreground",
138
- "example": "oklch(0.85 0.1 220)",
139
- "about": "texto del destino activo del sidebar"
140
- },
141
- {
142
- "name": "accent-foreground",
143
- "example": "oklch(0.5 0.15 260)",
144
- "about": "texto sobre superficies de acento suave"
145
- },
146
- {
147
- "name": "chart-1",
148
- "example": "oklch(0.55 0.2 260)",
149
- "about": "primera serie de las gráficas: la marca"
150
- },
151
- {
152
- "name": "radius",
153
- "example": "12px",
154
- "about": "redondez base (en temas cuya rampa deriva de ella)"
155
- },
156
- {
157
- "name": "ds-font-sans",
158
- "example": "'Inter', system-ui, sans-serif",
159
- "about": "fuente del cuerpo (carga la fuente en tu app)"
160
- },
161
- {
162
- "name": "ds-font-display",
163
- "example": "'Sora', system-ui, sans-serif",
164
- "about": "fuente de los titulares"
165
- }
166
- ]
167
- }
168
- }
1
+ {
2
+ "version": 5,
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; los propios con --ds-. baseTheme es el tema aplicado siempre (los demás se aplican encima, con ámbito).",
4
+ "root": [
5
+ "radius",
6
+ "background",
7
+ "foreground",
8
+ "card",
9
+ "card-foreground",
10
+ "popover",
11
+ "popover-foreground",
12
+ "primary",
13
+ "primary-foreground",
14
+ "secondary",
15
+ "secondary-foreground",
16
+ "muted",
17
+ "muted-foreground",
18
+ "accent",
19
+ "accent-foreground",
20
+ "destructive",
21
+ "destructive-foreground",
22
+ "border",
23
+ "input",
24
+ "ring",
25
+ "chart-1",
26
+ "chart-2",
27
+ "chart-3",
28
+ "chart-4",
29
+ "chart-5",
30
+ "sidebar",
31
+ "sidebar-foreground",
32
+ "sidebar-primary",
33
+ "sidebar-primary-foreground",
34
+ "sidebar-accent",
35
+ "sidebar-accent-foreground",
36
+ "sidebar-border",
37
+ "sidebar-ring",
38
+ "danger",
39
+ "danger-soft",
40
+ "warning",
41
+ "warning-soft",
42
+ "success",
43
+ "success-soft",
44
+ "info",
45
+ "info-soft",
46
+ "neutral",
47
+ "neutral-soft",
48
+ "link",
49
+ "link-hover",
50
+ "inset",
51
+ "inset-foreground",
52
+ "brand",
53
+ "brand-bright",
54
+ "ds-sidebar-icon",
55
+ "ds-sidebar-icon-stroke",
56
+ "ds-sidebar-rail-w",
57
+ "ds-sidebar-rail-item",
58
+ "ds-sidebar-logo",
59
+ "ds-sidebar-sep-inset"
60
+ ],
61
+ "fonts": [
62
+ "ds-font-sans"
63
+ ],
64
+ "dark": {
65
+ "descripcion": "Recomendados en .dark (si faltan, el tema hereda el valor claro y doctor avisa).",
66
+ "avisar_si_falta": [
67
+ "background",
68
+ "foreground",
69
+ "card",
70
+ "card-foreground",
71
+ "popover",
72
+ "popover-foreground",
73
+ "primary",
74
+ "primary-foreground",
75
+ "muted",
76
+ "muted-foreground",
77
+ "border",
78
+ "input",
79
+ "ring",
80
+ "danger",
81
+ "warning",
82
+ "success",
83
+ "info",
84
+ "link"
85
+ ]
86
+ },
87
+ "baseTheme": "qratia",
88
+ "slotFamilies": {
89
+ "descripcion": "Piezas hermanas: si la PERSONALIDAD de un tema estiliza una, debe estilizar todas, o se verán distintas en la misma pantalla. Error en temas con «conformance»: «strict» en su ficha; aviso en los demás.",
90
+ "families": {
91
+ "choice": [
92
+ "checkbox",
93
+ "radio-group-item"
94
+ ],
95
+ "field": [
96
+ "input",
97
+ "textarea",
98
+ "select-trigger",
99
+ "native-select",
100
+ "input-group",
101
+ "input-otp-slot"
102
+ ],
103
+ "modal": [
104
+ "dialog-content",
105
+ "sheet-content",
106
+ "alert-dialog-content",
107
+ "drawer-popup"
108
+ ],
109
+ "floating": [
110
+ "popover-content",
111
+ "dropdown-menu-content",
112
+ "dropdown-menu-sub-content",
113
+ "select-content",
114
+ "context-menu-content",
115
+ "context-menu-sub-content",
116
+ "menubar-content",
117
+ "menubar-sub-content",
118
+ "hover-card-content",
119
+ "combobox-content",
120
+ "navigation-menu-popup"
121
+ ],
122
+ "title": [
123
+ "card-title",
124
+ "dialog-title",
125
+ "sheet-title",
126
+ "alert-dialog-title",
127
+ "drawer-title",
128
+ "empty-title"
129
+ ],
130
+ "toggle": [
131
+ "tabs-trigger",
132
+ "toggle",
133
+ "toggle-group-item"
134
+ ],
135
+ "track": [
136
+ "progress",
137
+ "slider-track"
138
+ ],
139
+ "notice": [
140
+ "alert",
141
+ "banner",
142
+ "toast"
143
+ ]
144
+ }
145
+ },
146
+ "brand": {
147
+ "descripcion": "Grupo ESTABLE de variables que una app suele personalizar en su fichero de marca (brand.css). Renombrar o quitar una es versión MAYOR. Todas están también en `root` salvo las --ds-*.",
148
+ "tokens": [
149
+ {
150
+ "name": "primary",
151
+ "example": "oklch(0.55 0.2 260)",
152
+ "about": "color de acción principal (botones, foco)"
153
+ },
154
+ {
155
+ "name": "primary-foreground",
156
+ "example": "#ffffff",
157
+ "about": "texto sobre el color principal (comprueba el contraste)"
158
+ },
159
+ {
160
+ "name": "ring",
161
+ "example": "oklch(0.55 0.2 260)",
162
+ "about": "anillo de foco; suele ir igual que primary"
163
+ },
164
+ {
165
+ "name": "link",
166
+ "example": "oklch(0.5 0.15 260)",
167
+ "about": "texto de enlace: más oscuro que primary para tener contraste"
168
+ },
169
+ {
170
+ "name": "link-hover",
171
+ "example": "oklch(0.42 0.13 260)",
172
+ "about": "enlace al pasar el ratón"
173
+ },
174
+ {
175
+ "name": "brand",
176
+ "example": "oklch(0.7 0.13 220)",
177
+ "about": "acento de marca (detalles, selección)"
178
+ },
179
+ {
180
+ "name": "brand-bright",
181
+ "example": "oklch(0.8 0.13 220)",
182
+ "about": "acento de marca sobre fondos oscuros"
183
+ },
184
+ {
185
+ "name": "sidebar-primary",
186
+ "example": "oklch(0.8 0.13 220)",
187
+ "about": "acento dentro del sidebar"
188
+ },
189
+ {
190
+ "name": "sidebar-primary-foreground",
191
+ "example": "#04121c",
192
+ "about": "texto sobre el acento del sidebar"
193
+ },
194
+ {
195
+ "name": "sidebar-accent-foreground",
196
+ "example": "oklch(0.85 0.1 220)",
197
+ "about": "texto del destino activo del sidebar"
198
+ },
199
+ {
200
+ "name": "accent-foreground",
201
+ "example": "oklch(0.5 0.15 260)",
202
+ "about": "texto sobre superficies de acento suave"
203
+ },
204
+ {
205
+ "name": "chart-1",
206
+ "example": "oklch(0.55 0.2 260)",
207
+ "about": "primera serie de las gráficas: la marca"
208
+ },
209
+ {
210
+ "name": "radius",
211
+ "example": "12px",
212
+ "about": "redondez base (en temas cuya rampa deriva de ella)"
213
+ },
214
+ {
215
+ "name": "ds-font-sans",
216
+ "example": "'Inter', system-ui, sans-serif",
217
+ "about": "fuente del cuerpo (carga la fuente en tu app)"
218
+ },
219
+ {
220
+ "name": "ds-font-display",
221
+ "example": "'Sora', system-ui, sans-serif",
222
+ "about": "fuente de los titulares"
223
+ }
224
+ ]
225
+ }
226
+ }
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { DsMessages } from '../lib/i18n.js';
3
+
4
+ /** Textos activos de orbital-ds (los fija `DsI18nProvider`; sin él, inglés). */
5
+ declare const DsMessagesContext: React.Context<{
6
+ close: string;
7
+ closeNotification: string;
8
+ loading: string;
9
+ breadcrumb: string;
10
+ breadcrumbMore: string;
11
+ pagination: string;
12
+ paginationPrevious: string;
13
+ paginationNext: string;
14
+ paginationPreviousLabel: string;
15
+ paginationNextLabel: string;
16
+ paginationMore: string;
17
+ carousel: string;
18
+ carouselSlide: string;
19
+ carouselPrevious: string;
20
+ carouselNext: string;
21
+ commandTitle: string;
22
+ commandDescription: string;
23
+ scrollToEnd: string;
24
+ scrollToStart: string;
25
+ sidebarToggle: string;
26
+ sidebarTitle: string;
27
+ sidebarDescription: string;
28
+ questionnairePrevious: string;
29
+ questionnaireSkip: string;
30
+ questionnaireNext: string;
31
+ questionnaireSubmit: string;
32
+ }>;
33
+ /** Textos de los componentes en el idioma activo. */
34
+ declare function useDsMessages(): DsMessages;
35
+
36
+ export { DsMessagesContext, useDsMessages };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { dsCatalogs, DS_DEFAULT_LOCALE } from "../lib/i18n";
3
+ const DsMessagesContext = React.createContext(
4
+ dsCatalogs[DS_DEFAULT_LOCALE]
5
+ );
6
+ function useDsMessages() {
7
+ return React.useContext(DsMessagesContext);
8
+ }
9
+ export {
10
+ DsMessagesContext,
11
+ useDsMessages
12
+ };
@@ -0,0 +1,17 @@
1
+ import { DsMotion, DsDuration, DsEase, DsTransition } from '../lib/motion.js';
2
+
3
+ /**
4
+ * Transición del tema activo para Motion (u otra librería): se recalcula al cambiar
5
+ * de tema o de piel (atributos `class`, `data-theme` y `style` de <html>) y al
6
+ * cambiar la preferencia de movimiento reducido.
7
+ */
8
+ declare function useDsTransition(duration?: DsDuration, ease?: DsEase): DsTransition;
9
+ /**
10
+ * Sistema de movimiento completo del tema activo, con presets para Motion:
11
+ * const m = useDsMotion()
12
+ * <motion.ul variants={...} {...m.list}> <motion.li {...m.fadeUp} /> </motion.ul>
13
+ * <motion.button {...m.press} />
14
+ */
15
+ declare function useDsMotion(): DsMotion;
16
+
17
+ export { useDsMotion, useDsTransition };
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ import {
3
+ readDsTransition,
4
+ readDsMotion
5
+ } from "../lib/motion";
6
+ function useDsTransition(duration = "base", ease = "standard") {
7
+ const [transition, setTransition] = React.useState(
8
+ () => readDsTransition(duration, ease)
9
+ );
10
+ React.useEffect(() => {
11
+ const update = () => setTransition(readDsTransition(duration, ease));
12
+ update();
13
+ const root = document.documentElement;
14
+ const observer = new MutationObserver(update);
15
+ observer.observe(root, {
16
+ attributes: true,
17
+ attributeFilter: ["class", "data-theme", "style"]
18
+ });
19
+ const mql = window.matchMedia("(prefers-reduced-motion: reduce)");
20
+ mql.addEventListener("change", update);
21
+ return () => {
22
+ observer.disconnect();
23
+ mql.removeEventListener("change", update);
24
+ };
25
+ }, [duration, ease]);
26
+ return transition;
27
+ }
28
+ function useDsMotion() {
29
+ const [motion, setMotion] = React.useState(() => readDsMotion());
30
+ React.useEffect(() => {
31
+ const update = () => setMotion(readDsMotion());
32
+ update();
33
+ const observer = new MutationObserver(update);
34
+ observer.observe(document.documentElement, {
35
+ attributes: true,
36
+ attributeFilter: ["class", "data-theme", "style"]
37
+ });
38
+ const mql = window.matchMedia("(prefers-reduced-motion: reduce)");
39
+ mql.addEventListener("change", update);
40
+ return () => {
41
+ observer.disconnect();
42
+ mql.removeEventListener("change", update);
43
+ };
44
+ }, []);
45
+ return motion;
46
+ }
47
+ export {
48
+ useDsMotion,
49
+ useDsTransition
50
+ };
@@ -0,0 +1,46 @@
1
+ declare const DS_LOCALES: readonly ["en", "es", "pt-BR"];
2
+ type DsLocale = (typeof DS_LOCALES)[number];
3
+ declare const DS_DEFAULT_LOCALE: DsLocale;
4
+ declare const en: {
5
+ close: string;
6
+ closeNotification: string;
7
+ loading: string;
8
+ breadcrumb: string;
9
+ breadcrumbMore: string;
10
+ pagination: string;
11
+ paginationPrevious: string;
12
+ paginationNext: string;
13
+ paginationPreviousLabel: string;
14
+ paginationNextLabel: string;
15
+ paginationMore: string;
16
+ carousel: string;
17
+ carouselSlide: string;
18
+ carouselPrevious: string;
19
+ carouselNext: string;
20
+ commandTitle: string;
21
+ commandDescription: string;
22
+ scrollToEnd: string;
23
+ scrollToStart: string;
24
+ sidebarToggle: string;
25
+ sidebarTitle: string;
26
+ sidebarDescription: string;
27
+ questionnairePrevious: string;
28
+ questionnaireSkip: string;
29
+ questionnaireNext: string;
30
+ questionnaireSubmit: string;
31
+ };
32
+ type DsMessages = typeof en;
33
+ type DsMessageKey = keyof DsMessages;
34
+ /** Catálogos incluidos. Una app puede usarlos para sembrar los suyos (p. ej. en i18next). */
35
+ declare const dsCatalogs: Record<DsLocale, DsMessages>;
36
+ /**
37
+ * Resuelve una etiqueta BCP 47 (`es-CO`, `pt-PT`, `fr`…) contra los idiomas incluidos:
38
+ * coincidencia exacta → mismo idioma base → inglés. Misma regla que la plantilla.
39
+ */
40
+ declare function resolveDsLocale(tag: string | null | undefined): DsLocale;
41
+ /** Textos para un idioma, con sobrescrituras opcionales. */
42
+ declare function dsMessagesFor(tag?: string | null, overrides?: Partial<DsMessages>): DsMessages;
43
+ declare const DS_RTL_LANGS: readonly ["ar", "he", "fa", "ur", "ps", "sd", "ug", "yi", "dv", "ckb"];
44
+ declare function dsDirection(tag: string | null | undefined): "ltr" | "rtl";
45
+
46
+ export { DS_DEFAULT_LOCALE, DS_LOCALES, DS_RTL_LANGS, type DsLocale, type DsMessageKey, type DsMessages, dsCatalogs, dsDirection, dsMessagesFor, resolveDsLocale };
@@ -0,0 +1,109 @@
1
+ const DS_LOCALES = ["en", "es", "pt-BR"];
2
+ const DS_DEFAULT_LOCALE = "en";
3
+ const en = {
4
+ close: "Close",
5
+ closeNotification: "Close notification",
6
+ loading: "Loading",
7
+ breadcrumb: "Breadcrumb",
8
+ breadcrumbMore: "More",
9
+ pagination: "Pagination",
10
+ paginationPrevious: "Previous",
11
+ paginationNext: "Next",
12
+ paginationPreviousLabel: "Go to previous page",
13
+ paginationNextLabel: "Go to next page",
14
+ paginationMore: "More pages",
15
+ carousel: "carousel",
16
+ carouselSlide: "slide",
17
+ carouselPrevious: "Previous slide",
18
+ carouselNext: "Next slide",
19
+ commandTitle: "Command palette",
20
+ commandDescription: "Search for a command to run\u2026",
21
+ scrollToEnd: "Scroll to end",
22
+ scrollToStart: "Scroll to start",
23
+ sidebarToggle: "Toggle sidebar",
24
+ sidebarTitle: "Sidebar",
25
+ sidebarDescription: "Displays the mobile sidebar.",
26
+ questionnairePrevious: "Previous",
27
+ questionnaireSkip: "Skip",
28
+ questionnaireNext: "Next",
29
+ questionnaireSubmit: "Submit"
30
+ };
31
+ const es = {
32
+ close: "Cerrar",
33
+ closeNotification: "Cerrar aviso",
34
+ loading: "Cargando",
35
+ breadcrumb: "Ruta de navegaci\xF3n",
36
+ breadcrumbMore: "M\xE1s",
37
+ pagination: "Paginaci\xF3n",
38
+ paginationPrevious: "Anterior",
39
+ paginationNext: "Siguiente",
40
+ paginationPreviousLabel: "Ir a la p\xE1gina anterior",
41
+ paginationNextLabel: "Ir a la p\xE1gina siguiente",
42
+ paginationMore: "M\xE1s p\xE1ginas",
43
+ carousel: "carrusel",
44
+ carouselSlide: "diapositiva",
45
+ carouselPrevious: "Diapositiva anterior",
46
+ carouselNext: "Diapositiva siguiente",
47
+ commandTitle: "Paleta de comandos",
48
+ commandDescription: "Busca un comando para ejecutar\u2026",
49
+ scrollToEnd: "Ir al final",
50
+ scrollToStart: "Ir al principio",
51
+ sidebarToggle: "Mostrar u ocultar el lateral",
52
+ sidebarTitle: "Lateral",
53
+ sidebarDescription: "Muestra el lateral en el m\xF3vil.",
54
+ questionnairePrevious: "Anterior",
55
+ questionnaireSkip: "Omitir",
56
+ questionnaireNext: "Siguiente",
57
+ questionnaireSubmit: "Enviar"
58
+ };
59
+ const ptBR = {
60
+ close: "Fechar",
61
+ closeNotification: "Fechar aviso",
62
+ loading: "Carregando",
63
+ breadcrumb: "Trilha de navega\xE7\xE3o",
64
+ breadcrumbMore: "Mais",
65
+ pagination: "Pagina\xE7\xE3o",
66
+ paginationPrevious: "Anterior",
67
+ paginationNext: "Pr\xF3xima",
68
+ paginationPreviousLabel: "Ir para a p\xE1gina anterior",
69
+ paginationNextLabel: "Ir para a pr\xF3xima p\xE1gina",
70
+ paginationMore: "Mais p\xE1ginas",
71
+ carousel: "carrossel",
72
+ carouselSlide: "slide",
73
+ carouselPrevious: "Slide anterior",
74
+ carouselNext: "Pr\xF3ximo slide",
75
+ commandTitle: "Paleta de comandos",
76
+ commandDescription: "Pesquise um comando para executar\u2026",
77
+ scrollToEnd: "Ir para o final",
78
+ scrollToStart: "Ir para o in\xEDcio",
79
+ sidebarToggle: "Mostrar ou ocultar a barra lateral",
80
+ sidebarTitle: "Barra lateral",
81
+ sidebarDescription: "Mostra a barra lateral no celular.",
82
+ questionnairePrevious: "Anterior",
83
+ questionnaireSkip: "Pular",
84
+ questionnaireNext: "Pr\xF3xima",
85
+ questionnaireSubmit: "Enviar"
86
+ };
87
+ const dsCatalogs = { en, es, "pt-BR": ptBR };
88
+ function resolveDsLocale(tag) {
89
+ if (!tag) return DS_DEFAULT_LOCALE;
90
+ const base = tag.split("-")[0];
91
+ return DS_LOCALES.find((l) => l === tag) ?? DS_LOCALES.find((l) => l.split("-")[0] === base) ?? DS_DEFAULT_LOCALE;
92
+ }
93
+ function dsMessagesFor(tag, overrides) {
94
+ return { ...dsCatalogs[resolveDsLocale(tag)], ...overrides };
95
+ }
96
+ const DS_RTL_LANGS = ["ar", "he", "fa", "ur", "ps", "sd", "ug", "yi", "dv", "ckb"];
97
+ function dsDirection(tag) {
98
+ const base = (tag ?? "").toLowerCase().split("-")[0];
99
+ return DS_RTL_LANGS.includes(base) ? "rtl" : "ltr";
100
+ }
101
+ export {
102
+ DS_DEFAULT_LOCALE,
103
+ DS_LOCALES,
104
+ DS_RTL_LANGS,
105
+ dsCatalogs,
106
+ dsDirection,
107
+ dsMessagesFor,
108
+ resolveDsLocale
109
+ };