orbital-ds 0.29.1 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -0
- package/components.manifest.json +117 -6
- package/dist/hooks/use-ds-messages.d.ts +9 -0
- package/dist/lib/auth-flow.d.ts +26 -2
- package/dist/lib/auth-flow.js +20 -3
- package/dist/lib/header-control.d.ts +4 -0
- package/dist/lib/header-control.js +14 -0
- package/dist/lib/i18n.d.ts +9 -0
- package/dist/lib/i18n.js +27 -0
- package/dist/styles.css +1678 -1656
- package/dist/themes/chocolate.css +259 -0
- package/dist/themes/chocolate.fonts.css +2 -0
- package/dist/themes/chocolate.guide.md +30 -0
- package/dist/themes/chocolate.meta.json +61 -0
- package/dist/themes/chocolate.scoped.css +259 -0
- package/dist/themes/chocolate.tokens.json +49 -0
- package/dist/themes/fractalia.css +7 -0
- package/dist/themes/fractalia.scoped.css +7 -0
- package/dist/themes/friendly.css +38 -30
- package/dist/themes/friendly.scoped.css +38 -30
- package/dist/themes/friendly.tokens.json +10 -10
- package/dist/themes/lagoon.css +41 -30
- package/dist/themes/lagoon.scoped.css +41 -30
- package/dist/themes/lagoon.tokens.json +10 -10
- package/dist/themes/liquid.css +38 -30
- package/dist/themes/liquid.scoped.css +38 -30
- package/dist/themes/liquid.tokens.json +10 -10
- package/dist/themes/matcha.css +259 -0
- package/dist/themes/matcha.fonts.css +2 -0
- package/dist/themes/matcha.guide.md +30 -0
- package/dist/themes/matcha.meta.json +61 -0
- package/dist/themes/matcha.scoped.css +259 -0
- package/dist/themes/matcha.tokens.json +49 -0
- package/dist/themes/qratia.css +38 -34
- package/dist/themes/qratia.scoped.css +38 -34
- package/dist/themes/qratia.tokens.json +10 -10
- package/dist/themes/stone.css +263 -0
- package/dist/themes/stone.fonts.css +2 -0
- package/dist/themes/stone.guide.md +30 -0
- package/dist/themes/stone.meta.json +47 -0
- package/dist/themes/stone.scoped.css +263 -0
- package/dist/themes/stone.tokens.json +49 -0
- package/dist/themes/tactile.css +596 -588
- package/dist/themes/tactile.scoped.css +596 -588
- package/dist/themes/tactile.tokens.json +10 -10
- package/dist/themes/twitter.css +7 -0
- package/dist/themes/twitter.scoped.css +7 -0
- package/dist/themes/y2k.css +259 -0
- package/dist/themes/y2k.fonts.css +2 -0
- package/dist/themes/y2k.guide.md +30 -0
- package/dist/themes/y2k.meta.json +59 -0
- package/dist/themes/y2k.scoped.css +259 -0
- package/dist/themes/y2k.tokens.json +49 -0
- package/dist/themes/zyro.css +38 -30
- package/dist/themes/zyro.scoped.css +38 -30
- package/dist/themes/zyro.tokens.json +10 -10
- package/dist/ui/app-bar.d.ts +10 -0
- package/dist/ui/app-bar.js +51 -0
- package/dist/ui/attachment.js +1 -1
- package/dist/ui/auth-form.d.ts +5 -1
- package/dist/ui/auth-form.js +5 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.js +2 -2
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/content-card.d.ts +6 -2
- package/dist/ui/content-card.js +27 -3
- package/dist/ui/dropzone.js +1 -1
- package/dist/ui/item.d.ts +1 -1
- package/dist/ui/item.js +1 -1
- package/dist/ui/legend.js +1 -1
- package/dist/ui/locale-switcher.d.ts +19 -0
- package/dist/ui/locale-switcher.js +54 -0
- package/dist/ui/marker.d.ts +1 -1
- package/dist/ui/menubar.js +1 -1
- package/dist/ui/message-scroller.js +1 -1
- package/dist/ui/navigation-menu.js +2 -2
- package/dist/ui/notice-review.d.ts +1 -0
- package/dist/ui/notifications.d.ts +12 -2
- package/dist/ui/notifications.js +28 -5
- package/dist/ui/sidebar.d.ts +17 -3
- package/dist/ui/sidebar.js +25 -10
- package/dist/ui/sparkline.d.ts +1 -1
- package/dist/ui/status-badge.d.ts +2 -2
- package/dist/ui/tabs.d.ts +1 -1
- package/dist/ui/theme-toggle.d.ts +14 -0
- package/dist/ui/theme-toggle.js +112 -0
- package/dist/ui/toggle.js +2 -2
- package/dist/ui/week-strip.js +1 -1
- package/docs/CONTRACT.md +1 -1
- package/docs/designer/patrones.md +6 -0
- package/package.json +188 -187
- package/scripts/brand-core.mjs +20 -1
- package/scripts/cli.mjs +452 -452
- package/scripts/init.mjs +1 -1
package/AGENTS.md
CHANGED
|
@@ -65,6 +65,20 @@ adivinar. Lee antes: `README.md`, `docs/CONTRACT.md`, `contract.json` y
|
|
|
65
65
|
ni capa se escribe a mano (el doctor lo comprueba también dentro de valores arbitrarios).
|
|
66
66
|
- Otras librerías: `readDsTransition()` (`orbital-ds/lib/motion`) da duración y curva CSS.
|
|
67
67
|
|
|
68
|
+
## Cabecera, lateral y hover (0.30)
|
|
69
|
+
|
|
70
|
+
- **`AppBar`** (`app` · `compact` · `transparent`) con `AppBarTitle` y `AppBarActions`; en la derecha, siempre
|
|
71
|
+
campana (`NotificationCenter`), idioma (`LocaleSwitcher`: `compact` · `menu`) y tema (`ThemeToggle`: `icon` · `cycle` ·
|
|
72
|
+
`segmented`). Los tres comparten `tone` (`neutral` · `brand` · `soft`) y se ajustan a la marca solo con
|
|
73
|
+
`--ds-header-control-*` (`-fg`, `-bg`, `-hover-bg`, `-active-bg`, `-radius`, `-brand-*`, `-badge-bg/-fg`) en `brand.css`.
|
|
74
|
+
- **`NotificationCenter`**: presets `count` · `dot` · `compact`; ejes `indicator` (count · dot · none) y `density`.
|
|
75
|
+
- **`Sidebar`**: ejes `tone` (`default` · `brand` · `contrast`, por `--ds-sidebar-brand-*` / `-contrast-*`) e
|
|
76
|
+
`indicator` (`fill` · `bar`, `--ds-sidebar-bar-w`); en el raíl de iconos todo queda centrado.
|
|
77
|
+
- **Hover unificado**: `--ds-hover-bg`, `--ds-active-bg`, `--ds-row-hover`. Un componente nunca pone `hover:bg-muted/…`.
|
|
78
|
+
- **Gris estándar**: `scripts/neutral.mjs` deriva la escalera de neutros de la semilla `--ds-neutral-h/-c`;
|
|
79
|
+
`pnpm check:neutral` (dentro de `verify`) comprueba que el tema la cumple. En la escalera: `lagoon`, `friendly`, `liquid`, `qratia`, `tactile` y `zyro`. Exentos con `/* @neutral off */` (fieles a su sistema de origen): `fractalia` y `twitter`.
|
|
80
|
+
- **Sin subrayado en títulos**: se retiró el «rotulador» de los títulos; `--ds-marker*` se conserva para los temas que lo usan.
|
|
81
|
+
|
|
68
82
|
## Gráficos e informes (Apache ECharts)
|
|
69
83
|
|
|
70
84
|
- **Librería oficial: ECharts** (dependencia opcional). `chart.tsx` (Recharts) se mantiene por compatibilidad,
|
package/components.manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "orbital-ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"engine": "@base-ui/react",
|
|
5
5
|
"docs": [
|
|
6
6
|
"README.md",
|
|
@@ -109,6 +109,36 @@
|
|
|
109
109
|
"Pasa siempre `format` si el número lleva unidad (horas, %, moneda): la unidad no rueda."
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
|
+
"app-bar": {
|
|
113
|
+
"import": "orbital-ds/ui/app-bar",
|
|
114
|
+
"exports": [
|
|
115
|
+
"AppBar",
|
|
116
|
+
"AppBarActions",
|
|
117
|
+
"AppBarTitle"
|
|
118
|
+
],
|
|
119
|
+
"slots": [
|
|
120
|
+
"app-bar",
|
|
121
|
+
"app-bar-actions",
|
|
122
|
+
"app-bar-title"
|
|
123
|
+
],
|
|
124
|
+
"optionalPeers": [],
|
|
125
|
+
"presets": {
|
|
126
|
+
"values": [
|
|
127
|
+
"app",
|
|
128
|
+
"compact",
|
|
129
|
+
"transparent"
|
|
130
|
+
],
|
|
131
|
+
"default": "app",
|
|
132
|
+
"intent": {
|
|
133
|
+
"app": "barra normal: fondo propio y filete inferior",
|
|
134
|
+
"compact": "barra baja, para vistas densas o paneles",
|
|
135
|
+
"transparent": "hereda el fondo del lienzo, sin filete: el panel se lee como una sola pieza"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"notes": [
|
|
139
|
+
"Una por pantalla, arriba del lienzo; `transparent` con lienzo flotante para no partir el panel en dos fondos."
|
|
140
|
+
]
|
|
141
|
+
},
|
|
112
142
|
"aspect-ratio": {
|
|
113
143
|
"import": "orbital-ds/ui/aspect-ratio",
|
|
114
144
|
"exports": [
|
|
@@ -176,6 +206,8 @@
|
|
|
176
206
|
],
|
|
177
207
|
"slots": [
|
|
178
208
|
"auth-form",
|
|
209
|
+
"auth-form-access",
|
|
210
|
+
"auth-form-audience",
|
|
179
211
|
"auth-form-code",
|
|
180
212
|
"auth-form-field",
|
|
181
213
|
"auth-form-field-error",
|
|
@@ -822,7 +854,9 @@
|
|
|
822
854
|
],
|
|
823
855
|
"slots": [
|
|
824
856
|
"content-card",
|
|
825
|
-
"content-card-
|
|
857
|
+
"content-card-dot",
|
|
858
|
+
"content-card-media",
|
|
859
|
+
"content-card-value"
|
|
826
860
|
],
|
|
827
861
|
"optionalPeers": [],
|
|
828
862
|
"presets": {
|
|
@@ -830,18 +864,22 @@
|
|
|
830
864
|
"basic",
|
|
831
865
|
"feature",
|
|
832
866
|
"media",
|
|
833
|
-
"horizontal"
|
|
867
|
+
"horizontal",
|
|
868
|
+
"metric",
|
|
869
|
+
"status"
|
|
834
870
|
],
|
|
835
871
|
"default": "basic",
|
|
836
872
|
"intent": {
|
|
837
873
|
"basic": "título, descripción, contenido y pie",
|
|
838
874
|
"feature": "icono arriba, título y descripción (una capacidad, un atajo, un paso)",
|
|
839
875
|
"media": "portada arriba (imagen o vídeo) y texto debajo",
|
|
840
|
-
"horizontal": "portada a un lado; apila en un contenedor estrecho (container query)"
|
|
876
|
+
"horizontal": "portada a un lado; apila en un contenedor estrecho (container query)",
|
|
877
|
+
"metric": "un dato grande (`value`, con `delta` opcional) bajo el título: un KPI suelto",
|
|
878
|
+
"status": "una línea con punto de estado (`tone`) y texto: el estado de un sistema o un proceso"
|
|
841
879
|
}
|
|
842
880
|
},
|
|
843
881
|
"notes": [
|
|
844
|
-
"Tarjeta de contenido para rejillas: `basic` (texto), `feature` (icono + capacidad), `media` (portada arriba), `horizontal` (portada al lado). El énfasis (`elevated`, `outlined`, `filled`, `ghost`) cambia la prominencia, no la estructura.",
|
|
882
|
+
"Tarjeta de contenido para rejillas: `basic` (texto), `feature` (icono + capacidad), `media` (portada arriba), `horizontal` (portada al lado), `metric` (un dato grande: `value` y `delta`), `status` (punto de estado con `tone` + texto). El énfasis (`elevated`, `outlined`, `filled`, `ghost`) cambia la prominencia, no la estructura.",
|
|
845
883
|
"Interactiva con `href` (navega) o `onSelect` (acción): toda la tarjeta es el objetivo y el título el enlace; no metas botones dentro de un enlace ni tarjetas dentro de tarjetas. Para filas de entidades usa Item variant=\"card\"; para cifras, Stat.",
|
|
846
884
|
"Para disponer varias, Mosaic (even · bento · trio)."
|
|
847
885
|
]
|
|
@@ -1682,6 +1720,30 @@
|
|
|
1682
1720
|
"Mientras carga, pinta la forma de lo que vendrá: `list` para filas, `card` para una tarjeta, `table` para una tabla, `detail` para una ficha."
|
|
1683
1721
|
]
|
|
1684
1722
|
},
|
|
1723
|
+
"locale-switcher": {
|
|
1724
|
+
"import": "orbital-ds/ui/locale-switcher",
|
|
1725
|
+
"exports": [
|
|
1726
|
+
"LocaleSwitcher"
|
|
1727
|
+
],
|
|
1728
|
+
"slots": [
|
|
1729
|
+
"locale-switcher"
|
|
1730
|
+
],
|
|
1731
|
+
"optionalPeers": [],
|
|
1732
|
+
"presets": {
|
|
1733
|
+
"values": [
|
|
1734
|
+
"compact",
|
|
1735
|
+
"menu"
|
|
1736
|
+
],
|
|
1737
|
+
"default": "compact",
|
|
1738
|
+
"intent": {
|
|
1739
|
+
"compact": "icono y código corto («ES») en la barra superior; abre un menú con los nombres",
|
|
1740
|
+
"menu": "icono y nombre completo del idioma activo, para zonas con más sitio"
|
|
1741
|
+
}
|
|
1742
|
+
},
|
|
1743
|
+
"notes": [
|
|
1744
|
+
"Siempre visible en la barra superior, junto a ThemeToggle; el nombre de cada idioma se escribe en ese idioma, no traducido."
|
|
1745
|
+
]
|
|
1746
|
+
},
|
|
1685
1747
|
"marker": {
|
|
1686
1748
|
"import": "orbital-ds/ui/marker",
|
|
1687
1749
|
"exports": [
|
|
@@ -1984,6 +2046,8 @@
|
|
|
1984
2046
|
"NotificationTabs",
|
|
1985
2047
|
"NotificationTabsContent",
|
|
1986
2048
|
"formatRelativeTime",
|
|
2049
|
+
"type NotificationCenterPreset",
|
|
2050
|
+
"type NotificationIndicator",
|
|
1987
2051
|
"type NotificationState",
|
|
1988
2052
|
"type NotificationTab",
|
|
1989
2053
|
"type NotificationTone"
|
|
@@ -1992,6 +2056,7 @@
|
|
|
1992
2056
|
"notification-actions",
|
|
1993
2057
|
"notification-center",
|
|
1994
2058
|
"notification-count",
|
|
2059
|
+
"notification-count-dot",
|
|
1995
2060
|
"notification-dot",
|
|
1996
2061
|
"notification-empty",
|
|
1997
2062
|
"notification-header",
|
|
@@ -2011,7 +2076,23 @@
|
|
|
2011
2076
|
"notification-trigger",
|
|
2012
2077
|
"notification-unread"
|
|
2013
2078
|
],
|
|
2014
|
-
"optionalPeers": []
|
|
2079
|
+
"optionalPeers": [],
|
|
2080
|
+
"presets": {
|
|
2081
|
+
"values": [
|
|
2082
|
+
"count",
|
|
2083
|
+
"dot",
|
|
2084
|
+
"compact"
|
|
2085
|
+
],
|
|
2086
|
+
"default": "count",
|
|
2087
|
+
"intent": {
|
|
2088
|
+
"count": "contador numérico sobre la campana, panel normal (por defecto)",
|
|
2089
|
+
"dot": "solo un punto: avisos poco frecuentes, barra discreta",
|
|
2090
|
+
"compact": "contador y panel estrecho (--ds-notifications-w-compact): barras bajas, móvil"
|
|
2091
|
+
}
|
|
2092
|
+
},
|
|
2093
|
+
"notes": [
|
|
2094
|
+
"Un solo centro por app, en AppBarActions junto a LocaleSwitcher y ThemeToggle; `dot` si los avisos son raros, `compact` en móvil."
|
|
2095
|
+
]
|
|
2015
2096
|
},
|
|
2016
2097
|
"oauth-consent": {
|
|
2017
2098
|
"import": "orbital-ds/ui/oauth-consent",
|
|
@@ -2523,7 +2604,10 @@
|
|
|
2523
2604
|
"SidebarRail",
|
|
2524
2605
|
"SidebarSeparator",
|
|
2525
2606
|
"SidebarTrigger",
|
|
2607
|
+
"type SidebarIndicator",
|
|
2526
2608
|
"type SidebarPreset",
|
|
2609
|
+
"type SidebarSurface",
|
|
2610
|
+
"type SidebarTone",
|
|
2527
2611
|
"useSidebar"
|
|
2528
2612
|
],
|
|
2529
2613
|
"slots": [
|
|
@@ -2566,6 +2650,7 @@
|
|
|
2566
2650
|
}
|
|
2567
2651
|
},
|
|
2568
2652
|
"notes": [
|
|
2653
|
+
"`glass` solo luce si hay algo detrás (fondo de la app o imagen); en el resto, `floating` o `flat`.",
|
|
2569
2654
|
"Elige el lateral por intención con `preset`: `app` (dock flotante, raíl de iconos) para un producto; `workspace` (contenido como hoja) para una herramienta de uso diario; `admin` (fijo y denso) para un backoffice con muchos destinos; `focus` (se oculta) para editores, mapas y lienzos. Las props sueltas (variant, collapsible, density) lo ajustan.",
|
|
2570
2655
|
"Con `collapsible=\"icon\"` cada SidebarMenuButton necesita su icono y su `tooltip`: plegado solo se ve el icono."
|
|
2571
2656
|
]
|
|
@@ -2931,6 +3016,32 @@
|
|
|
2931
3016
|
],
|
|
2932
3017
|
"optionalPeers": []
|
|
2933
3018
|
},
|
|
3019
|
+
"theme-toggle": {
|
|
3020
|
+
"import": "orbital-ds/ui/theme-toggle",
|
|
3021
|
+
"exports": [
|
|
3022
|
+
"ThemeToggle"
|
|
3023
|
+
],
|
|
3024
|
+
"slots": [
|
|
3025
|
+
"theme-toggle"
|
|
3026
|
+
],
|
|
3027
|
+
"optionalPeers": [],
|
|
3028
|
+
"presets": {
|
|
3029
|
+
"values": [
|
|
3030
|
+
"icon",
|
|
3031
|
+
"cycle",
|
|
3032
|
+
"segmented"
|
|
3033
|
+
],
|
|
3034
|
+
"default": "icon",
|
|
3035
|
+
"intent": {
|
|
3036
|
+
"icon": "botón de icono en la barra superior: abre un menú con las tres opciones",
|
|
3037
|
+
"cycle": "botón de icono que pasa de uno a otro al pulsarlo (sin menú)",
|
|
3038
|
+
"segmented": "tres opciones a la vista, para Configuración"
|
|
3039
|
+
}
|
|
3040
|
+
},
|
|
3041
|
+
"notes": [
|
|
3042
|
+
"En la barra superior, `icon` junto a LocaleSwitcher; `segmented` solo donde la persona elige su preferencia con calma (Configuración)."
|
|
3043
|
+
]
|
|
3044
|
+
},
|
|
2934
3045
|
"timeline": {
|
|
2935
3046
|
"import": "orbital-ds/ui/timeline",
|
|
2936
3047
|
"exports": [
|
|
@@ -30,6 +30,11 @@ declare const DsMessagesContext: React.Context<{
|
|
|
30
30
|
sidebarToggle: string;
|
|
31
31
|
sidebarTitle: string;
|
|
32
32
|
sidebarDescription: string;
|
|
33
|
+
themeToggleLabel: string;
|
|
34
|
+
themeLight: string;
|
|
35
|
+
themeDark: string;
|
|
36
|
+
themeSystem: string;
|
|
37
|
+
localeSwitcherLabel: string;
|
|
33
38
|
questionnairePrevious: string;
|
|
34
39
|
questionnaireSkip: string;
|
|
35
40
|
questionnaireNext: string;
|
|
@@ -251,6 +256,10 @@ declare const DsMessagesContext: React.Context<{
|
|
|
251
256
|
authSignUpLink: string;
|
|
252
257
|
authNoAccess: string;
|
|
253
258
|
authRequestAccessLink: string;
|
|
259
|
+
authAudienceMixed: string;
|
|
260
|
+
authAudienceInternal: string;
|
|
261
|
+
authAccessInternal: string;
|
|
262
|
+
authAccessExternal: string;
|
|
254
263
|
authHaveAccount: string;
|
|
255
264
|
authSignInLink: string;
|
|
256
265
|
authMfaTitle: string;
|
package/dist/lib/auth-flow.d.ts
CHANGED
|
@@ -7,6 +7,13 @@ type AuthFlowPreset = "standard" | "social" | "passwordless" | "partner" | "ente
|
|
|
7
7
|
type AuthAudience = "internal" | "external" | "mixed";
|
|
8
8
|
type AuthSignUp = "open" | "invite" | "none";
|
|
9
9
|
type AuthSignInMethod = "password" | "social" | "passkey" | "magic-link" | "email-code" | "sso";
|
|
10
|
+
/** Por qué puerta entra una persona: plantilla de la organización o gente de fuera. */
|
|
11
|
+
type AuthAccessKind = "internal" | "external";
|
|
12
|
+
type AuthAccessRule = {
|
|
13
|
+
methods: AuthSignInMethod[];
|
|
14
|
+
mfaRequired: boolean;
|
|
15
|
+
signUp: AuthSignUp;
|
|
16
|
+
};
|
|
10
17
|
type AuthFlowConfig = {
|
|
11
18
|
preset: AuthFlowPreset;
|
|
12
19
|
/** Para quién es la puerta: plantilla (internal), gente de fuera (external) o las dos (mixed). */
|
|
@@ -27,6 +34,11 @@ type AuthFlowConfig = {
|
|
|
27
34
|
required: boolean;
|
|
28
35
|
methods: MfaMethod[];
|
|
29
36
|
};
|
|
37
|
+
/** Reglas por tipo de persona; lo que falte se deduce del flujo (ver `resolveAuthAccess`). */
|
|
38
|
+
access?: {
|
|
39
|
+
internal?: Partial<AuthAccessRule>;
|
|
40
|
+
external?: Partial<AuthAccessRule>;
|
|
41
|
+
};
|
|
30
42
|
/** Props de AuthLayout. */
|
|
31
43
|
layout: {
|
|
32
44
|
preset?: "centered" | "split" | "cover" | "banner" | "minimal";
|
|
@@ -45,15 +57,27 @@ declare const AUTH_FLOW_PRESETS: Record<AuthFlowPreset, FlowDefaults>;
|
|
|
45
57
|
declare function defineAuthFlow(preset: AuthFlowPreset, overrides?: Partial<Omit<AuthFlowConfig, "preset">>): AuthFlowConfig;
|
|
46
58
|
/** ¿Es de la plantilla? Compara el dominio del correo (y sus subdominios) con `internalDomains`. */
|
|
47
59
|
declare function isInternalIdentifier(flow: Pick<AuthFlowConfig, "internalDomains">, identifier: string): boolean;
|
|
60
|
+
type AccessFlow = Pick<AuthFlowConfig, "audience" | "methods" | "internalDomains" | "signUp" | "mfa" | "access">;
|
|
61
|
+
/** Regla efectiva de cada puerta: lo explícito de `access` manda; el resto se deduce del flujo. */
|
|
62
|
+
declare function authAccessRule(flow: AccessFlow, kind: AuthAccessKind): AuthAccessRule;
|
|
63
|
+
/**
|
|
64
|
+
* ¿Por qué puerta entra este correo y qué se le exigirá? `internal` si el flujo es interno o el dominio es de
|
|
65
|
+
* la plantilla; `external` en el resto. Devuelve la regla de esa puerta y el método con el que seguir.
|
|
66
|
+
*/
|
|
67
|
+
declare function resolveAuthAccess(flow: AccessFlow, identifier: string): AuthAccessRule & {
|
|
68
|
+
kind: AuthAccessKind;
|
|
69
|
+
method: AuthSignInMethod;
|
|
70
|
+
};
|
|
48
71
|
/**
|
|
49
72
|
* Ruta por defecto para `AuthForm onIdentify`: la plantilla (o una puerta interna) va al SSO; el
|
|
50
73
|
* resto, al primer método de cuenta propia del flujo. Para dominios de clientes con su propio SSO
|
|
51
74
|
* (enterprise, partner), la app consulta antes a su proveedor y cae aquí si no lo encuentra.
|
|
52
75
|
*/
|
|
53
|
-
declare function routeAuthIdentifier(flow: Pick<AuthFlowConfig, "audience" | "methods" | "internalDomains"
|
|
76
|
+
declare function routeAuthIdentifier(flow: Pick<AuthFlowConfig, "audience" | "methods" | "internalDomains"> & Partial<Pick<AuthFlowConfig, "signUp" | "mfa" | "access">>, identifier: string): {
|
|
54
77
|
method: "password" | "sso" | "passkey" | "email-code" | "magic-link";
|
|
78
|
+
access: AuthAccessKind;
|
|
55
79
|
};
|
|
56
80
|
/** Problemas de un flujo (vacío = válido). Mensajes en inglés, como `dsWarn`. */
|
|
57
81
|
declare function validateAuthFlow(flow: AuthFlowConfig): string[];
|
|
58
82
|
|
|
59
|
-
export { AUTH_FLOW_PRESETS, type AuthAudience, type AuthFlowConfig, type AuthFlowPreset, type AuthSignInMethod, type AuthSignUp, defineAuthFlow, isInternalIdentifier, routeAuthIdentifier, validateAuthFlow };
|
|
83
|
+
export { AUTH_FLOW_PRESETS, type AuthAccessKind, type AuthAccessRule, type AuthAudience, type AuthFlowConfig, type AuthFlowPreset, type AuthSignInMethod, type AuthSignUp, authAccessRule, defineAuthFlow, isInternalIdentifier, resolveAuthAccess, routeAuthIdentifier, validateAuthFlow };
|
package/dist/lib/auth-flow.js
CHANGED
|
@@ -84,6 +84,7 @@ function defineAuthFlow(preset, overrides = {}) {
|
|
|
84
84
|
...overrides,
|
|
85
85
|
preset,
|
|
86
86
|
mfa: { ...base.mfa, ...overrides.mfa },
|
|
87
|
+
access: { internal: { ...overrides.access?.internal }, external: { ...overrides.access?.external } },
|
|
87
88
|
layout: { ...base.layout, ...overrides.layout }
|
|
88
89
|
};
|
|
89
90
|
}
|
|
@@ -95,12 +96,24 @@ function isInternalIdentifier(flow, identifier) {
|
|
|
95
96
|
return domain === base || domain.endsWith(`.${base}`);
|
|
96
97
|
});
|
|
97
98
|
}
|
|
99
|
+
function authAccessRule(flow, kind) {
|
|
100
|
+
const own = flow.methods.filter((m) => m !== "sso");
|
|
101
|
+
const sso = flow.methods.includes("sso");
|
|
102
|
+
const base = kind === "internal" ? { methods: sso ? ["sso"] : own, mfaRequired: sso ? false : flow.mfa.required, signUp: "none" } : { methods: own.length ? own : flow.methods, mfaRequired: flow.mfa.required, signUp: flow.signUp };
|
|
103
|
+
return { ...base, ...flow.access?.[kind] };
|
|
104
|
+
}
|
|
105
|
+
function resolveAuthAccess(flow, identifier) {
|
|
106
|
+
const kind = flow.audience === "internal" || flow.audience === "mixed" && isInternalIdentifier(flow, identifier) ? "internal" : "external";
|
|
107
|
+
const rule = authAccessRule(flow, kind);
|
|
108
|
+
return { ...rule, kind, method: rule.methods[0] ?? "password" };
|
|
109
|
+
}
|
|
98
110
|
function routeAuthIdentifier(flow, identifier) {
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
const r = resolveAuthAccess({ signUp: "open", mfa: { required: false, methods: [] }, ...flow }, identifier);
|
|
112
|
+
if (r.methods.includes("sso") && r.kind === "internal") return { method: "sso", access: r.kind };
|
|
113
|
+
const own = r.methods.find(
|
|
101
114
|
(m) => m === "password" || m === "email-code" || m === "magic-link" || m === "passkey"
|
|
102
115
|
);
|
|
103
|
-
return { method: own ?? "sso" };
|
|
116
|
+
return { method: own ?? "sso", access: r.kind };
|
|
104
117
|
}
|
|
105
118
|
function validateAuthFlow(flow) {
|
|
106
119
|
const issues = [];
|
|
@@ -123,13 +136,17 @@ function validateAuthFlow(flow) {
|
|
|
123
136
|
if (!flow.internalDomains.length) issues.push("Mixed audience without `internalDomains`: staff cannot be routed to SSO.");
|
|
124
137
|
if (!flow.identifierFirst) issues.push("Mixed audience works best with identifierFirst: the email decides the door.");
|
|
125
138
|
}
|
|
139
|
+
if (flow.access?.internal?.signUp && flow.access.internal.signUp !== "none") issues.push('`access.internal.signUp` should be "none": staff accounts come from the directory.');
|
|
140
|
+
if (flow.access?.external?.methods?.includes("sso") && flow.audience !== "external") issues.push('`access.external.methods` with "sso": SSO is the staff door; external SSO goes through `onIdentify` (their own company).');
|
|
126
141
|
if (flow.audience === "external" && flow.internalDomains.length) issues.push('`internalDomains` on an external audience: use "mixed" if staff also sign in here.');
|
|
127
142
|
return issues;
|
|
128
143
|
}
|
|
129
144
|
export {
|
|
130
145
|
AUTH_FLOW_PRESETS,
|
|
146
|
+
authAccessRule,
|
|
131
147
|
defineAuthFlow,
|
|
132
148
|
isInternalIdentifier,
|
|
149
|
+
resolveAuthAccess,
|
|
133
150
|
routeAuthIdentifier,
|
|
134
151
|
validateAuthFlow
|
|
135
152
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const TONES = {
|
|
2
|
+
neutral: "",
|
|
3
|
+
brand: "[--ds-header-control-fg:var(--ds-header-control-brand-fg)] [--ds-header-control-bg:var(--ds-header-control-brand-bg)] [--ds-header-control-hover-bg:var(--ds-header-control-brand-hover-bg)]",
|
|
4
|
+
soft: "[--ds-header-control-bg:var(--muted)]"
|
|
5
|
+
};
|
|
6
|
+
function headerControlClass(tone = "neutral") {
|
|
7
|
+
return [
|
|
8
|
+
"rounded-(--ds-header-control-radius) bg-(--ds-header-control-bg) text-(--ds-header-control-fg) hover:bg-(--ds-header-control-hover-bg) aria-expanded:bg-(--ds-header-control-hover-bg) active:bg-(--ds-header-control-active-bg)",
|
|
9
|
+
TONES[tone]
|
|
10
|
+
].join(" ");
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
headerControlClass
|
|
14
|
+
};
|
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ declare const en: {
|
|
|
29
29
|
sidebarToggle: string;
|
|
30
30
|
sidebarTitle: string;
|
|
31
31
|
sidebarDescription: string;
|
|
32
|
+
themeToggleLabel: string;
|
|
33
|
+
themeLight: string;
|
|
34
|
+
themeDark: string;
|
|
35
|
+
themeSystem: string;
|
|
36
|
+
localeSwitcherLabel: string;
|
|
32
37
|
questionnairePrevious: string;
|
|
33
38
|
questionnaireSkip: string;
|
|
34
39
|
questionnaireNext: string;
|
|
@@ -250,6 +255,10 @@ declare const en: {
|
|
|
250
255
|
authSignUpLink: string;
|
|
251
256
|
authNoAccess: string;
|
|
252
257
|
authRequestAccessLink: string;
|
|
258
|
+
authAudienceMixed: string;
|
|
259
|
+
authAudienceInternal: string;
|
|
260
|
+
authAccessInternal: string;
|
|
261
|
+
authAccessExternal: string;
|
|
253
262
|
authHaveAccount: string;
|
|
254
263
|
authSignInLink: string;
|
|
255
264
|
authMfaTitle: string;
|
package/dist/lib/i18n.js
CHANGED
|
@@ -28,6 +28,11 @@ const en = {
|
|
|
28
28
|
sidebarToggle: "Toggle sidebar",
|
|
29
29
|
sidebarTitle: "Sidebar",
|
|
30
30
|
sidebarDescription: "Displays the mobile sidebar.",
|
|
31
|
+
themeToggleLabel: "Theme",
|
|
32
|
+
themeLight: "Light",
|
|
33
|
+
themeDark: "Dark",
|
|
34
|
+
themeSystem: "System",
|
|
35
|
+
localeSwitcherLabel: "Language",
|
|
31
36
|
questionnairePrevious: "Previous",
|
|
32
37
|
questionnaireSkip: "Skip",
|
|
33
38
|
questionnaireNext: "Next",
|
|
@@ -250,6 +255,10 @@ const en = {
|
|
|
250
255
|
authSignUpLink: "Sign up",
|
|
251
256
|
authNoAccess: "Need access?",
|
|
252
257
|
authRequestAccessLink: "Request it",
|
|
258
|
+
authAudienceMixed: "Staff: enter your work email and we will take you to single sign-on. External users: use your own account.",
|
|
259
|
+
authAudienceInternal: "Access for the organization's staff, with their work account (single sign-on).",
|
|
260
|
+
authAccessInternal: "Staff",
|
|
261
|
+
authAccessExternal: "External",
|
|
253
262
|
authHaveAccount: "Already have an account?",
|
|
254
263
|
authSignInLink: "Sign in",
|
|
255
264
|
authMfaTitle: "Two-step verification",
|
|
@@ -400,6 +409,11 @@ const es = {
|
|
|
400
409
|
sidebarToggle: "Mostrar u ocultar el lateral",
|
|
401
410
|
sidebarTitle: "Lateral",
|
|
402
411
|
sidebarDescription: "Muestra el lateral en el m\xF3vil.",
|
|
412
|
+
themeToggleLabel: "Tema",
|
|
413
|
+
themeLight: "Claro",
|
|
414
|
+
themeDark: "Oscuro",
|
|
415
|
+
themeSystem: "Sistema",
|
|
416
|
+
localeSwitcherLabel: "Idioma",
|
|
403
417
|
questionnairePrevious: "Anterior",
|
|
404
418
|
questionnaireSkip: "Omitir",
|
|
405
419
|
questionnaireNext: "Siguiente",
|
|
@@ -622,6 +636,10 @@ const es = {
|
|
|
622
636
|
authSignUpLink: "Reg\xEDstrate",
|
|
623
637
|
authNoAccess: "\xBFNo tienes acceso?",
|
|
624
638
|
authRequestAccessLink: "Solic\xEDtalo",
|
|
639
|
+
authAudienceMixed: "Personal de la organizaci\xF3n: escribe tu correo de trabajo y te llevamos al SSO. Personas externas: usa tu propia cuenta.",
|
|
640
|
+
authAudienceInternal: "Acceso para el personal de la organizaci\xF3n, con su cuenta de trabajo (SSO).",
|
|
641
|
+
authAccessInternal: "Personal",
|
|
642
|
+
authAccessExternal: "Externo",
|
|
625
643
|
authHaveAccount: "\xBFYa tienes cuenta?",
|
|
626
644
|
authSignInLink: "Inicia sesi\xF3n",
|
|
627
645
|
authMfaTitle: "Verificaci\xF3n en dos pasos",
|
|
@@ -772,6 +790,11 @@ const ptBR = {
|
|
|
772
790
|
sidebarToggle: "Mostrar ou ocultar a barra lateral",
|
|
773
791
|
sidebarTitle: "Barra lateral",
|
|
774
792
|
sidebarDescription: "Mostra a barra lateral no celular.",
|
|
793
|
+
themeToggleLabel: "Tema",
|
|
794
|
+
themeLight: "Claro",
|
|
795
|
+
themeDark: "Escuro",
|
|
796
|
+
themeSystem: "Sistema",
|
|
797
|
+
localeSwitcherLabel: "Idioma",
|
|
775
798
|
questionnairePrevious: "Anterior",
|
|
776
799
|
questionnaireSkip: "Pular",
|
|
777
800
|
questionnaireNext: "Pr\xF3xima",
|
|
@@ -994,6 +1017,10 @@ const ptBR = {
|
|
|
994
1017
|
authSignUpLink: "Cadastre-se",
|
|
995
1018
|
authNoAccess: "N\xE3o tem acesso?",
|
|
996
1019
|
authRequestAccessLink: "Solicite",
|
|
1020
|
+
authAudienceMixed: "Equipe da organiza\xE7\xE3o: informe seu e-mail de trabalho e levaremos voc\xEA ao SSO. Pessoas externas: use sua pr\xF3pria conta.",
|
|
1021
|
+
authAudienceInternal: "Acesso para a equipe da organiza\xE7\xE3o, com a conta de trabalho (SSO).",
|
|
1022
|
+
authAccessInternal: "Equipe",
|
|
1023
|
+
authAccessExternal: "Externo",
|
|
997
1024
|
authHaveAccount: "J\xE1 tem uma conta?",
|
|
998
1025
|
authSignInLink: "Entrar",
|
|
999
1026
|
authMfaTitle: "Verifica\xE7\xE3o em duas etapas",
|