orbital-ds 0.8.0 → 0.10.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 (159) hide show
  1. package/AGENTS.md +162 -80
  2. package/components.manifest.json +1713 -1267
  3. package/contract.json +231 -168
  4. package/dist/hooks/use-ds-messages.d.ts +94 -0
  5. package/dist/hooks/use-ds-messages.js +18 -0
  6. package/dist/hooks/use-ds-motion.d.ts +17 -0
  7. package/dist/hooks/use-ds-motion.js +50 -0
  8. package/dist/lib/echarts-presets.d.ts +153 -0
  9. package/dist/lib/echarts-presets.js +311 -0
  10. package/dist/lib/echarts-server.d.ts +15 -0
  11. package/dist/lib/echarts-server.js +15 -0
  12. package/dist/lib/echarts-setup.d.ts +4 -0
  13. package/dist/lib/echarts-setup.js +60 -0
  14. package/dist/lib/echarts-theme.d.ts +36 -0
  15. package/dist/lib/echarts-theme.js +142 -0
  16. package/dist/lib/i18n.d.ts +102 -0
  17. package/dist/lib/i18n.js +275 -0
  18. package/dist/lib/motion.d.ts +74 -0
  19. package/dist/lib/motion.js +97 -0
  20. package/dist/styles.css +914 -528
  21. package/dist/themes/friendly.css +364 -318
  22. package/dist/themes/friendly.meta.json +75 -14
  23. package/dist/themes/friendly.scoped.css +364 -318
  24. package/dist/themes/friendly.tokens.json +45 -0
  25. package/dist/themes/qratia.meta.json +42 -12
  26. package/dist/themes/qratia.tokens.json +49 -0
  27. package/dist/themes/tactile.css +577 -430
  28. package/dist/themes/tactile.fonts.css +3 -2
  29. package/dist/themes/tactile.guide.md +82 -49
  30. package/dist/themes/tactile.meta.json +175 -82
  31. package/dist/themes/tactile.scoped.css +577 -430
  32. package/dist/themes/tactile.tokens.json +42 -0
  33. package/dist/themes/twitter.css +356 -298
  34. package/dist/themes/twitter.meta.json +83 -61
  35. package/dist/themes/twitter.scoped.css +356 -298
  36. package/dist/themes/twitter.tokens.json +45 -0
  37. package/dist/themes/zyro.css +445 -389
  38. package/dist/themes/zyro.meta.json +67 -14
  39. package/dist/themes/zyro.scoped.css +445 -389
  40. package/dist/themes/zyro.tokens.json +46 -0
  41. package/dist/ui/accordion.js +5 -5
  42. package/dist/ui/alert-dialog.js +3 -3
  43. package/dist/ui/alert.d.ts +1 -1
  44. package/dist/ui/alert.js +9 -3
  45. package/dist/ui/attachment.d.ts +1 -1
  46. package/dist/ui/attachment.js +4 -4
  47. package/dist/ui/avatar.js +6 -6
  48. package/dist/ui/ayuda.js +3 -2
  49. package/dist/ui/badge.d.ts +1 -1
  50. package/dist/ui/badge.js +9 -3
  51. package/dist/ui/banner.d.ts +14 -0
  52. package/dist/ui/banner.js +88 -0
  53. package/dist/ui/breadcrumb.js +7 -3
  54. package/dist/ui/bubble.js +6 -6
  55. package/dist/ui/button-group.js +4 -4
  56. package/dist/ui/button.d.ts +1 -1
  57. package/dist/ui/button.js +5 -5
  58. package/dist/ui/calendar.js +37 -6
  59. package/dist/ui/card.js +4 -4
  60. package/dist/ui/carousel.js +15 -8
  61. package/dist/ui/chart.js +7 -3
  62. package/dist/ui/checkbox.js +1 -1
  63. package/dist/ui/code-block.d.ts +14 -0
  64. package/dist/ui/code-block.js +106 -0
  65. package/dist/ui/combobox.js +7 -7
  66. package/dist/ui/command.js +13 -11
  67. package/dist/ui/context-menu.js +8 -8
  68. package/dist/ui/data-table.d.ts +185 -0
  69. package/dist/ui/data-table.js +714 -0
  70. package/dist/ui/date-picker.d.ts +65 -0
  71. package/dist/ui/date-picker.js +362 -0
  72. package/dist/ui/dialog.js +10 -6
  73. package/dist/ui/drawer.js +9 -9
  74. package/dist/ui/dropdown-menu.js +8 -8
  75. package/dist/ui/dropzone.d.ts +42 -0
  76. package/dist/ui/dropzone.js +220 -0
  77. package/dist/ui/echart.d.ts +31 -0
  78. package/dist/ui/echart.js +88 -0
  79. package/dist/ui/empty.js +3 -3
  80. package/dist/ui/eyebrow.d.ts +7 -0
  81. package/dist/ui/eyebrow.js +16 -0
  82. package/dist/ui/field.js +2 -2
  83. package/dist/ui/filter-bar.d.ts +36 -0
  84. package/dist/ui/filter-bar.js +193 -0
  85. package/dist/ui/heatmap-grid.d.ts +39 -0
  86. package/dist/ui/heatmap-grid.js +195 -0
  87. package/dist/ui/hover-card.js +1 -1
  88. package/dist/ui/i18n-provider.d.ts +11 -0
  89. package/dist/ui/i18n-provider.js +18 -0
  90. package/dist/ui/icon-tile.d.ts +1 -1
  91. package/dist/ui/input-group.d.ts +1 -1
  92. package/dist/ui/input-group.js +11 -9
  93. package/dist/ui/input-otp.js +3 -3
  94. package/dist/ui/input.js +1 -1
  95. package/dist/ui/item.d.ts +1 -1
  96. package/dist/ui/item.js +3 -3
  97. package/dist/ui/kbd.js +1 -1
  98. package/dist/ui/label.js +1 -1
  99. package/dist/ui/legend.d.ts +30 -0
  100. package/dist/ui/legend.js +124 -0
  101. package/dist/ui/marker.d.ts +1 -1
  102. package/dist/ui/marker.js +2 -2
  103. package/dist/ui/menubar.js +9 -9
  104. package/dist/ui/message-scroller.js +5 -2
  105. package/dist/ui/message.js +2 -2
  106. package/dist/ui/motion-provider.d.ts +11 -0
  107. package/dist/ui/motion-provider.js +16 -0
  108. package/dist/ui/native-select.js +4 -4
  109. package/dist/ui/navigation-menu.js +7 -6
  110. package/dist/ui/notifications.d.ts +69 -0
  111. package/dist/ui/notifications.js +335 -0
  112. package/dist/ui/page-header.d.ts +19 -0
  113. package/dist/ui/page-header.js +132 -0
  114. package/dist/ui/pagination.js +19 -11
  115. package/dist/ui/panel.d.ts +12 -0
  116. package/dist/ui/panel.js +41 -0
  117. package/dist/ui/popover.js +2 -2
  118. package/dist/ui/progress.js +2 -2
  119. package/dist/ui/proportion-bar.d.ts +27 -0
  120. package/dist/ui/proportion-bar.js +92 -0
  121. package/dist/ui/questionnaire.js +20 -15
  122. package/dist/ui/radio-group.js +2 -2
  123. package/dist/ui/resizable.js +2 -2
  124. package/dist/ui/scroll-area.js +3 -3
  125. package/dist/ui/select.js +6 -6
  126. package/dist/ui/separator.js +1 -1
  127. package/dist/ui/sheet.js +6 -4
  128. package/dist/ui/sidebar.js +42 -30
  129. package/dist/ui/skeleton.js +1 -1
  130. package/dist/ui/slider.js +6 -6
  131. package/dist/ui/sonner.js +25 -8
  132. package/dist/ui/sparkline.d.ts +26 -0
  133. package/dist/ui/sparkline.js +97 -0
  134. package/dist/ui/spinner.js +4 -1
  135. package/dist/ui/stat.d.ts +61 -0
  136. package/dist/ui/stat.js +238 -0
  137. package/dist/ui/status-badge.d.ts +38 -0
  138. package/dist/ui/status-badge.js +153 -0
  139. package/dist/ui/stepper.d.ts +20 -0
  140. package/dist/ui/stepper.js +152 -0
  141. package/dist/ui/switch.js +2 -2
  142. package/dist/ui/table.js +3 -3
  143. package/dist/ui/tabs.js +5 -5
  144. package/dist/ui/textarea.js +1 -1
  145. package/dist/ui/timeline.d.ts +29 -0
  146. package/dist/ui/timeline.js +157 -0
  147. package/dist/ui/toast.js +15 -12
  148. package/dist/ui/toggle-group.js +2 -2
  149. package/dist/ui/toggle.js +6 -4
  150. package/dist/ui/tooltip.js +2 -2
  151. package/docs/CONTRACT.md +183 -153
  152. package/docs/GRAFICOS.md +125 -0
  153. package/docs/adr/0001-rtl-clases-logicas.md +78 -0
  154. package/package.json +58 -29
  155. package/scripts/brand-core.mjs +153 -0
  156. package/scripts/doctor.mjs +128 -7
  157. package/scripts/i18n.mjs +111 -0
  158. package/scripts/init.mjs +327 -351
  159. package/scripts/setup.mjs +99 -0
package/contract.json CHANGED
@@ -1,168 +1,231 @@
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
+ "surface": [
145
+ "card",
146
+ "panel",
147
+ "stat"
148
+ ]
149
+ }
150
+ },
151
+ "brand": {
152
+ "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-*.",
153
+ "tokens": [
154
+ {
155
+ "name": "primary",
156
+ "example": "oklch(0.55 0.2 260)",
157
+ "about": "color de acción principal (botones, foco)"
158
+ },
159
+ {
160
+ "name": "primary-foreground",
161
+ "example": "#ffffff",
162
+ "about": "texto sobre el color principal (comprueba el contraste)"
163
+ },
164
+ {
165
+ "name": "ring",
166
+ "example": "oklch(0.55 0.2 260)",
167
+ "about": "anillo de foco; suele ir igual que primary"
168
+ },
169
+ {
170
+ "name": "link",
171
+ "example": "oklch(0.5 0.15 260)",
172
+ "about": "texto de enlace: más oscuro que primary para tener contraste"
173
+ },
174
+ {
175
+ "name": "link-hover",
176
+ "example": "oklch(0.42 0.13 260)",
177
+ "about": "enlace al pasar el ratón"
178
+ },
179
+ {
180
+ "name": "brand",
181
+ "example": "oklch(0.7 0.13 220)",
182
+ "about": "acento de marca (detalles, selección)"
183
+ },
184
+ {
185
+ "name": "brand-bright",
186
+ "example": "oklch(0.8 0.13 220)",
187
+ "about": "acento de marca sobre fondos oscuros"
188
+ },
189
+ {
190
+ "name": "sidebar-primary",
191
+ "example": "oklch(0.8 0.13 220)",
192
+ "about": "acento dentro del sidebar"
193
+ },
194
+ {
195
+ "name": "sidebar-primary-foreground",
196
+ "example": "#04121c",
197
+ "about": "texto sobre el acento del sidebar"
198
+ },
199
+ {
200
+ "name": "sidebar-accent-foreground",
201
+ "example": "oklch(0.85 0.1 220)",
202
+ "about": "texto del destino activo del sidebar"
203
+ },
204
+ {
205
+ "name": "accent-foreground",
206
+ "example": "oklch(0.5 0.15 260)",
207
+ "about": "texto sobre superficies de acento suave"
208
+ },
209
+ {
210
+ "name": "chart-1",
211
+ "example": "oklch(0.55 0.2 260)",
212
+ "about": "primera serie de las gráficas: la marca"
213
+ },
214
+ {
215
+ "name": "radius",
216
+ "example": "12px",
217
+ "about": "redondez base (en temas cuya rampa deriva de ella)"
218
+ },
219
+ {
220
+ "name": "ds-font-sans",
221
+ "example": "'Inter', system-ui, sans-serif",
222
+ "about": "fuente del cuerpo (carga la fuente en tu app)"
223
+ },
224
+ {
225
+ "name": "ds-font-display",
226
+ "example": "'Sora', system-ui, sans-serif",
227
+ "about": "fuente de los titulares"
228
+ }
229
+ ]
230
+ }
231
+ }
@@ -0,0 +1,94 @@
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
+ codeCopy: string;
33
+ codeCopied: string;
34
+ notifications: string;
35
+ notificationsMarkAllRead: string;
36
+ notificationsEmpty: string;
37
+ notificationsUnread: string;
38
+ datePickerPlaceholder: string;
39
+ dateRangePlaceholder: string;
40
+ dropzoneTitle: string;
41
+ dropzoneHint: string;
42
+ dropzoneTooLarge: string;
43
+ dropzoneWrongType: string;
44
+ dataTableSearch: string;
45
+ dataTableColumns: string;
46
+ dataTableNoResults: string;
47
+ dataTableSelected: string;
48
+ dataTableRowsPerPage: string;
49
+ dataTablePage: string;
50
+ dataTableSortAsc: string;
51
+ dataTableSortDesc: string;
52
+ dataTableHideColumn: string;
53
+ chartExportSvg: string;
54
+ chartExportPng: string;
55
+ chartNoData: string;
56
+ stepperStep: string;
57
+ stepperCompleted: string;
58
+ stepperCurrent: string;
59
+ stepperError: string;
60
+ statIncrease: string;
61
+ statDecrease: string;
62
+ statNoChange: string;
63
+ notificationsForYou: string;
64
+ notificationsGeneral: string;
65
+ notificationsHistory: string;
66
+ datePresetToday: string;
67
+ datePresetYesterday: string;
68
+ datePresetLastDays: string;
69
+ dateApply: string;
70
+ dateClear: string;
71
+ dateMaxSpan: string;
72
+ filterAll: string;
73
+ filterClear: string;
74
+ statNoData: string;
75
+ heatmapLow: string;
76
+ heatmapHigh: string;
77
+ dataTableFilter: string;
78
+ dataTableLoading: string;
79
+ dropzoneTooMany: string;
80
+ calendarPrevious: string;
81
+ calendarNext: string;
82
+ notificationUnread: string;
83
+ statusMeaning: string;
84
+ statusCause: string;
85
+ statusAction: string;
86
+ }>;
87
+ /** Textos de los componentes en el idioma activo. */
88
+ declare function useDsMessages(): DsMessages;
89
+ /** Idioma activo (etiqueta BCP 47 de la app, p. ej. "es-CO"): para formatear fechas y números con Intl. */
90
+ declare const DsLocaleContext: React.Context<string>;
91
+ /** Idioma activo para Intl (DateTimeFormat, NumberFormat…). */
92
+ declare function useDsLocale(): string;
93
+
94
+ export { DsLocaleContext, DsMessagesContext, useDsLocale, useDsMessages };
@@ -0,0 +1,18 @@
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
+ const DsLocaleContext = React.createContext(DS_DEFAULT_LOCALE);
10
+ function useDsLocale() {
11
+ return React.useContext(DsLocaleContext);
12
+ }
13
+ export {
14
+ DsLocaleContext,
15
+ DsMessagesContext,
16
+ useDsLocale,
17
+ useDsMessages
18
+ };
@@ -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
+ };