orbital-ds 0.41.0 → 0.48.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.
- package/AGENTS.md +54 -12
- package/CHANGELOG.md +458 -0
- package/README.md +2 -2
- package/components.manifest.json +6630 -3569
- package/dist/hooks/use-esc-close-stack.js +38 -0
- package/dist/hooks/use-simulated-progress.js +30 -0
- package/dist/lib/brand-allowlist.js +703 -0
- package/dist/lib/brand-runtime.js +85 -0
- package/dist/lib/echarts-presets.js +152 -1
- package/dist/lib/echarts-setup.js +2 -0
- package/dist/lib/format.js +177 -0
- package/dist/lib/i18n.js +35 -2
- package/dist/lib/locales/de.js +536 -0
- package/dist/lib/locales/fr.js +536 -0
- package/dist/lib/locales/he.js +536 -0
- package/dist/lib/locales/it.js +536 -0
- package/dist/ui/auth-form.js +13 -6
- package/dist/ui/ayuda.js +4 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/calendar.js +3 -0
- package/dist/ui/carousel.js +10 -5
- package/dist/ui/context-menu.js +3 -3
- package/dist/ui/cta-banner.js +63 -0
- package/dist/ui/date-time.js +55 -0
- package/dist/ui/description-list.js +86 -0
- package/dist/ui/detail-panel.js +2 -2
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/faq.js +25 -0
- package/dist/ui/feature-grid.js +40 -0
- package/dist/ui/hero.js +145 -0
- package/dist/ui/landing-section.js +59 -0
- package/dist/ui/mfa-challenge.js +1 -1
- package/dist/ui/next-step-card.js +92 -0
- package/dist/ui/page-header.js +20 -11
- package/dist/ui/pagination.js +2 -2
- package/dist/ui/pricing-table.js +86 -0
- package/dist/ui/quantity.js +27 -0
- package/dist/ui/sheet.js +6 -2
- package/dist/ui/sidebar.js +7 -3
- package/dist/ui/tag-input.js +169 -0
- package/dist/ui/testimonial.js +61 -0
- package/dist/ui/textarea.js +7 -1
- package/dist/ui/usage-meter.js +116 -0
- package/dist/ui/week-strip.js +2 -2
- package/docs/adr/0001-rtl-clases-logicas.md +14 -1
- package/docs/designer/flujo.md +1 -1
- package/docs/designer/patrones.md +45 -1
- package/manifest/actions.json +364 -0
- package/manifest/agents.json +399 -0
- package/manifest/ai.json +128 -0
- package/manifest/auth.json +1547 -0
- package/manifest/chat.json +612 -0
- package/manifest/content.json +2793 -0
- package/manifest/data.json +2802 -0
- package/manifest/feedback.json +1005 -0
- package/manifest/forms.json +1954 -0
- package/manifest/motion.json +196 -0
- package/manifest/navigation.json +1792 -0
- package/manifest/overlays.json +934 -0
- package/package.json +240 -238
- package/scripts/cli.mjs +124 -8
- package/scripts/doctor.mjs +153 -2
- package/scripts/eslint-plugin.mjs +125 -0
- package/scripts/i18n.mjs +1 -1
- package/scripts/manifest.mjs +179 -7
- package/scripts/upgrade.mjs +126 -0
- package/skill/SKILL.md +8 -3
- package/dist/hooks/use-ds-messages.d.ts +0 -537
- package/dist/hooks/use-ds-motion.d.ts +0 -17
- package/dist/hooks/use-in-view.d.ts +0 -9
- package/dist/hooks/use-mobile.d.ts +0 -3
- package/dist/lib/a2ui-catalog.d.ts +0 -42
- package/dist/lib/a2ui.d.ts +0 -289
- package/dist/lib/ai-events.d.ts +0 -15
- package/dist/lib/auth-better-auth.d.ts +0 -29
- package/dist/lib/auth-flow.d.ts +0 -85
- package/dist/lib/auth-providers.d.ts +0 -194
- package/dist/lib/auth.d.ts +0 -68
- package/dist/lib/echarts-presets.d.ts +0 -227
- package/dist/lib/echarts-server.d.ts +0 -15
- package/dist/lib/echarts-setup.d.ts +0 -8
- package/dist/lib/echarts-theme.d.ts +0 -36
- package/dist/lib/header-control.d.ts +0 -4
- package/dist/lib/i18n.d.ts +0 -545
- package/dist/lib/image-upload.d.ts +0 -41
- package/dist/lib/motion.d.ts +0 -74
- package/dist/lib/presets.d.ts +0 -8
- package/dist/lib/template-syntax.d.ts +0 -22
- package/dist/lib/utils.d.ts +0 -5
- package/dist/motion.css +0 -146
- package/dist/styles.css +0 -1737
- package/dist/themes/chocolate.css +0 -259
- package/dist/themes/chocolate.fonts.css +0 -2
- package/dist/themes/chocolate.guide.md +0 -30
- package/dist/themes/chocolate.meta.json +0 -61
- package/dist/themes/chocolate.scoped.css +0 -259
- package/dist/themes/chocolate.tokens.json +0 -49
- package/dist/themes/fractalia.css +0 -556
- package/dist/themes/fractalia.fonts.css +0 -3
- package/dist/themes/fractalia.guide.md +0 -86
- package/dist/themes/fractalia.meta.json +0 -112
- package/dist/themes/fractalia.scoped.css +0 -556
- package/dist/themes/fractalia.tokens.json +0 -39
- package/dist/themes/friendly.css +0 -375
- package/dist/themes/friendly.fonts.css +0 -2
- package/dist/themes/friendly.guide.md +0 -38
- package/dist/themes/friendly.meta.json +0 -82
- package/dist/themes/friendly.scoped.css +0 -375
- package/dist/themes/friendly.tokens.json +0 -45
- package/dist/themes/lagoon.css +0 -362
- package/dist/themes/lagoon.fonts.css +0 -2
- package/dist/themes/lagoon.guide.md +0 -47
- package/dist/themes/lagoon.meta.json +0 -85
- package/dist/themes/lagoon.scoped.css +0 -362
- package/dist/themes/lagoon.tokens.json +0 -49
- package/dist/themes/liquid.css +0 -510
- package/dist/themes/liquid.fonts.css +0 -7
- package/dist/themes/liquid.guide.md +0 -82
- package/dist/themes/liquid.meta.json +0 -134
- package/dist/themes/liquid.scoped.css +0 -510
- package/dist/themes/liquid.tokens.json +0 -47
- package/dist/themes/matcha.css +0 -259
- package/dist/themes/matcha.fonts.css +0 -2
- package/dist/themes/matcha.guide.md +0 -30
- package/dist/themes/matcha.meta.json +0 -61
- package/dist/themes/matcha.scoped.css +0 -259
- package/dist/themes/matcha.tokens.json +0 -49
- package/dist/themes/qratia.css +0 -264
- package/dist/themes/qratia.fonts.css +0 -2
- package/dist/themes/qratia.guide.md +0 -34
- package/dist/themes/qratia.meta.json +0 -49
- package/dist/themes/qratia.scoped.css +0 -264
- package/dist/themes/qratia.tokens.json +0 -49
- package/dist/themes/stone.css +0 -263
- package/dist/themes/stone.fonts.css +0 -2
- package/dist/themes/stone.guide.md +0 -30
- package/dist/themes/stone.meta.json +0 -47
- package/dist/themes/stone.scoped.css +0 -263
- package/dist/themes/stone.tokens.json +0 -49
- package/dist/themes/tactile.css +0 -596
- package/dist/themes/tactile.fonts.css +0 -3
- package/dist/themes/tactile.guide.md +0 -82
- package/dist/themes/tactile.meta.json +0 -182
- package/dist/themes/tactile.scoped.css +0 -596
- package/dist/themes/tactile.tokens.json +0 -42
- package/dist/themes/twitter.css +0 -364
- package/dist/themes/twitter.fonts.css +0 -6
- package/dist/themes/twitter.guide.md +0 -35
- package/dist/themes/twitter.meta.json +0 -90
- package/dist/themes/twitter.scoped.css +0 -364
- package/dist/themes/twitter.tokens.json +0 -45
- package/dist/themes/y2k.css +0 -259
- package/dist/themes/y2k.fonts.css +0 -2
- package/dist/themes/y2k.guide.md +0 -30
- package/dist/themes/y2k.meta.json +0 -59
- package/dist/themes/y2k.scoped.css +0 -259
- package/dist/themes/y2k.tokens.json +0 -49
- package/dist/themes/zyro.css +0 -442
- package/dist/themes/zyro.fonts.css +0 -2
- package/dist/themes/zyro.guide.md +0 -33
- package/dist/themes/zyro.meta.json +0 -74
- package/dist/themes/zyro.scoped.css +0 -442
- package/dist/themes/zyro.tokens.json +0 -46
- package/dist/ui/a2ui-renderer.d.ts +0 -33
- package/dist/ui/accordion.d.ts +0 -9
- package/dist/ui/agent-events.d.ts +0 -32
- package/dist/ui/ai-tag.d.ts +0 -8
- package/dist/ui/alert-dialog.d.ts +0 -23
- package/dist/ui/alert.d.ts +0 -13
- package/dist/ui/animated-number.d.ts +0 -9
- package/dist/ui/app-bar.d.ts +0 -10
- package/dist/ui/aspect-ratio.d.ts +0 -7
- package/dist/ui/attachment.d.ts +0 -26
- package/dist/ui/auth-backdrop.d.ts +0 -20
- package/dist/ui/auth-form.d.ts +0 -113
- package/dist/ui/auth-layout.d.ts +0 -72
- package/dist/ui/auth-parts.d.ts +0 -43
- package/dist/ui/auth-status.d.ts +0 -23
- package/dist/ui/avatar.d.ts +0 -16
- package/dist/ui/ayuda.d.ts +0 -22
- package/dist/ui/badge.d.ts +0 -15
- package/dist/ui/banner.d.ts +0 -14
- package/dist/ui/bottom-nav.d.ts +0 -15
- package/dist/ui/breadcrumb.d.ts +0 -12
- package/dist/ui/bubble.d.ts +0 -19
- package/dist/ui/button-group.d.ts +0 -15
- package/dist/ui/button.d.ts +0 -14
- package/dist/ui/calendar.d.ts +0 -15
- package/dist/ui/card-stack.d.ts +0 -9
- package/dist/ui/card.d.ts +0 -28
- package/dist/ui/carousel.d.ts +0 -33
- package/dist/ui/chain-of-thought.d.ts +0 -19
- package/dist/ui/chart-card.d.ts +0 -28
- package/dist/ui/chart.d.ts +0 -46
- package/dist/ui/chart.js +0 -254
- package/dist/ui/chat-composer.d.ts +0 -39
- package/dist/ui/checkbox.d.ts +0 -6
- package/dist/ui/choice-card.d.ts +0 -16
- package/dist/ui/code-block.d.ts +0 -14
- package/dist/ui/collapsible.d.ts +0 -8
- package/dist/ui/combobox.d.ts +0 -26
- package/dist/ui/command-palette.d.ts +0 -36
- package/dist/ui/command.d.ts +0 -22
- package/dist/ui/confirm-action.d.ts +0 -18
- package/dist/ui/confirm-dialog.d.ts +0 -21
- package/dist/ui/connected-accounts.d.ts +0 -25
- package/dist/ui/content-card.d.ts +0 -52
- package/dist/ui/context-menu.d.ts +0 -31
- package/dist/ui/conversation-list.d.ts +0 -24
- package/dist/ui/copy-button.d.ts +0 -14
- package/dist/ui/data-table.d.ts +0 -198
- package/dist/ui/date-picker.d.ts +0 -65
- package/dist/ui/detail-panel.d.ts +0 -16
- package/dist/ui/dialog.d.ts +0 -19
- package/dist/ui/direction.d.ts +0 -1
- package/dist/ui/dock.d.ts +0 -13
- package/dist/ui/drawer.d.ts +0 -18
- package/dist/ui/dropdown-menu.d.ts +0 -31
- package/dist/ui/dropzone.d.ts +0 -44
- package/dist/ui/echart.d.ts +0 -31
- package/dist/ui/empty-state.d.ts +0 -26
- package/dist/ui/empty.d.ts +0 -15
- package/dist/ui/entity-list.d.ts +0 -25
- package/dist/ui/error-page.d.ts +0 -28
- package/dist/ui/error-state.d.ts +0 -16
- package/dist/ui/eyebrow.d.ts +0 -7
- package/dist/ui/field.d.ts +0 -28
- package/dist/ui/file-upload.d.ts +0 -42
- package/dist/ui/filter-bar.d.ts +0 -38
- package/dist/ui/form-layout.d.ts +0 -19
- package/dist/ui/gauge.d.ts +0 -40
- package/dist/ui/generated-image.d.ts +0 -14
- package/dist/ui/generated-table.d.ts +0 -11
- package/dist/ui/heatmap-grid.d.ts +0 -39
- package/dist/ui/hover-card.d.ts +0 -8
- package/dist/ui/i18n-provider.d.ts +0 -11
- package/dist/ui/icon-tile.d.ts +0 -11
- package/dist/ui/input-group.d.ts +0 -22
- package/dist/ui/input-otp.d.ts +0 -13
- package/dist/ui/input.d.ts +0 -5
- package/dist/ui/instruction-editor.d.ts +0 -64
- package/dist/ui/item.d.ts +0 -26
- package/dist/ui/kbd.d.ts +0 -6
- package/dist/ui/label.d.ts +0 -5
- package/dist/ui/legend.d.ts +0 -32
- package/dist/ui/level-meter.d.ts +0 -16
- package/dist/ui/load-more.d.ts +0 -19
- package/dist/ui/loading-state.d.ts +0 -14
- package/dist/ui/locale-switcher.d.ts +0 -19
- package/dist/ui/markdown.d.ts +0 -14
- package/dist/ui/marker.d.ts +0 -13
- package/dist/ui/media-card.d.ts +0 -13
- package/dist/ui/menubar.d.ts +0 -31
- package/dist/ui/message-actions.d.ts +0 -12
- package/dist/ui/message-scroller.d.ts +0 -16
- package/dist/ui/message.d.ts +0 -12
- package/dist/ui/mfa-challenge.d.ts +0 -33
- package/dist/ui/mfa-setup.d.ts +0 -29
- package/dist/ui/mosaic.d.ts +0 -15
- package/dist/ui/motion-provider.d.ts +0 -11
- package/dist/ui/native-select.d.ts +0 -10
- package/dist/ui/navigation-menu.d.ts +0 -15
- package/dist/ui/notice-review.d.ts +0 -32
- package/dist/ui/notifications.d.ts +0 -81
- package/dist/ui/oauth-consent.d.ts +0 -54
- package/dist/ui/page-header.d.ts +0 -22
- package/dist/ui/page-loader.d.ts +0 -23
- package/dist/ui/page-shell.d.ts +0 -8
- package/dist/ui/pagination.d.ts +0 -22
- package/dist/ui/panel.d.ts +0 -12
- package/dist/ui/passkey-list.d.ts +0 -17
- package/dist/ui/password-input.d.ts +0 -5
- package/dist/ui/password-strength.d.ts +0 -14
- package/dist/ui/popover.d.ts +0 -12
- package/dist/ui/progress.d.ts +0 -9
- package/dist/ui/proportion-bar.d.ts +0 -27
- package/dist/ui/questionnaire.d.ts +0 -24
- package/dist/ui/radio-group.d.ts +0 -8
- package/dist/ui/reasoning.d.ts +0 -10
- package/dist/ui/resizable.d.ts +0 -10
- package/dist/ui/reveal.d.ts +0 -11
- package/dist/ui/scroll-area.d.ts +0 -7
- package/dist/ui/search-box.d.ts +0 -32
- package/dist/ui/select.d.ts +0 -19
- package/dist/ui/separator.d.ts +0 -6
- package/dist/ui/session-list.d.ts +0 -19
- package/dist/ui/session-timeout.d.ts +0 -13
- package/dist/ui/sheet.d.ts +0 -16
- package/dist/ui/shield.d.ts +0 -21
- package/dist/ui/show-more.d.ts +0 -12
- package/dist/ui/sidebar.d.ts +0 -90
- package/dist/ui/sign-out-dialog.d.ts +0 -17
- package/dist/ui/skeleton.d.ts +0 -10
- package/dist/ui/slider.d.ts +0 -23
- package/dist/ui/sonner.d.ts +0 -6
- package/dist/ui/sparkline.d.ts +0 -26
- package/dist/ui/spinner.d.ts +0 -5
- package/dist/ui/stat-group.d.ts +0 -8
- package/dist/ui/stat.d.ts +0 -90
- package/dist/ui/status-badge.d.ts +0 -39
- package/dist/ui/status-hero.d.ts +0 -12
- package/dist/ui/step-dots.d.ts +0 -10
- package/dist/ui/step-flow.d.ts +0 -48
- package/dist/ui/step-ring.d.ts +0 -12
- package/dist/ui/stepper.d.ts +0 -20
- package/dist/ui/suggestions.d.ts +0 -8
- package/dist/ui/switch.d.ts +0 -8
- package/dist/ui/table.d.ts +0 -12
- package/dist/ui/tabs.d.ts +0 -14
- package/dist/ui/task-loader.d.ts +0 -14
- package/dist/ui/task-progress.d.ts +0 -18
- package/dist/ui/textarea.d.ts +0 -11
- package/dist/ui/theme-toggle.d.ts +0 -14
- package/dist/ui/timeline.d.ts +0 -29
- package/dist/ui/toast.d.ts +0 -19
- package/dist/ui/toggle-group.d.ts +0 -14
- package/dist/ui/toggle.d.ts +0 -12
- package/dist/ui/tool-call.d.ts +0 -15
- package/dist/ui/tooltip.d.ts +0 -9
- package/dist/ui/week-strip.d.ts +0 -12
- package/dist/ui/workflow-run.d.ts +0 -23
package/scripts/manifest.mjs
CHANGED
|
@@ -9,18 +9,43 @@
|
|
|
9
9
|
*
|
|
10
10
|
* node scripts/manifest.mjs # regenera components.manifest.json
|
|
11
11
|
*/
|
|
12
|
-
import { readFileSync, readdirSync, writeFileSync, existsSync } from 'node:fs';
|
|
12
|
+
import { readFileSync, readdirSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
13
13
|
import { join, dirname, resolve } from 'node:path';
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import ts from 'typescript';
|
|
15
16
|
|
|
16
17
|
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
17
18
|
const UI = join(ROOT, 'src/ui');
|
|
19
|
+
const EOL = '\n';
|
|
18
20
|
|
|
19
21
|
// Dependencias que SIEMPRE están (peers obligatorios): no se listan como opcionales.
|
|
20
22
|
const REQUIRED = new Set([
|
|
21
23
|
'react', 'react-dom', 'class-variance-authority', 'clsx', 'tailwind-merge', 'lucide-react',
|
|
22
24
|
]);
|
|
23
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Dominios de los componentes: el `@group` de cada fichero de `src/ui` (obligatorio, uno de estos) y la sección
|
|
28
|
+
* de su demo en el escaparate (`label`). Un agente pide solo el dominio que necesita en vez de leer los 150+.
|
|
29
|
+
*/
|
|
30
|
+
export const GROUPS = {
|
|
31
|
+
actions: { label: 'Acciones', about: 'Botones y acciones sueltas.' },
|
|
32
|
+
forms: { label: 'Formularios', about: 'Campos, selectores y envío de datos.' },
|
|
33
|
+
feedback: { label: 'Avisos', about: 'Alertas, toasts, progreso y esperas.' },
|
|
34
|
+
overlays: { label: 'Capas', about: 'Diálogos, menús, popovers y paneles que se superponen.' },
|
|
35
|
+
navigation: { label: 'Navegación', about: 'Cabecera, lateral, pestañas, pasos, paginación y búsqueda de destinos.' },
|
|
36
|
+
data: { label: 'Datos', about: 'Tablas, gráficos, métricas, listas de entidades y estados de carga.' },
|
|
37
|
+
content: { label: 'Contenido', about: 'Tarjetas, texto, media y piezas de maquetación.' },
|
|
38
|
+
motion: { label: 'Movimiento', about: 'Animación y cargadores de página.' },
|
|
39
|
+
chat: { label: 'Chat', about: 'Conversación: mensajes, compositor, adjuntos y sugerencias.' },
|
|
40
|
+
agents: { label: 'Agentes', about: 'Lo que hace un agente: razonamiento, herramientas, eventos, flujos y A2UI.' },
|
|
41
|
+
ai: { label: 'IA', about: 'Piezas de contenido generado.' },
|
|
42
|
+
auth: { label: 'Acceso', about: 'Inicio de sesión, MFA, passkeys, sesiones y consentimiento.' },
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function parseGroup(src) {
|
|
46
|
+
return src.match(/@group\s+([a-z-]+)/)?.[1] ?? null;
|
|
47
|
+
}
|
|
48
|
+
|
|
24
49
|
function parseExports(src) {
|
|
25
50
|
const names = new Set();
|
|
26
51
|
for (const m of src.matchAll(/export\s*\{([^}]*)\}/g)) {
|
|
@@ -34,7 +59,58 @@ function parseExports(src) {
|
|
|
34
59
|
}
|
|
35
60
|
|
|
36
61
|
function parseSlots(src) {
|
|
37
|
-
|
|
62
|
+
// `data-slot="x"` en JSX, `"data-slot": "x"` en un objeto de props y `state: { slot: "x" }` de useRender.
|
|
63
|
+
const re = /(?:data-slot"?\s*[=:]\s*|\bslot:\s*)"([a-z0-9-]+)"/g;
|
|
64
|
+
return [...new Set([...src.matchAll(re)].map((m) => m[1]))].sort();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Ficha para agentes escrita en la cabecera del componente (JSDoc, en español):
|
|
69
|
+
*
|
|
70
|
+
* @summary <una línea: qué es y cuándo usarlo>
|
|
71
|
+
* @see <otro-componente> — <cuándo usar ese en su lugar>
|
|
72
|
+
* @example <título: una sola idea>
|
|
73
|
+
* <JSX mínimo, en las líneas siguientes, hasta la próxima etiqueta o el fin del comentario>
|
|
74
|
+
*
|
|
75
|
+
* Todo en UN bloque `/** … *\/` (el de `@group`). En el JSX de un ejemplo no caben comentarios `{/* … *\/}`.
|
|
76
|
+
*
|
|
77
|
+
* Es lo primero que lee un agente para ELEGIR (summary y see van al índice) y para COPIAR bien (examples).
|
|
78
|
+
*/
|
|
79
|
+
export function parseDoc(src) {
|
|
80
|
+
const out = { summary: null, see: [], examples: [] };
|
|
81
|
+
for (const block of src.matchAll(/\/\*\*?([\s\S]*?)\*\//g)) {
|
|
82
|
+
// Solo el bloque de la ficha (el que lleva @summary): un @see o @example en el JSDoc de una prop no cuenta.
|
|
83
|
+
if (!/@summary\b/.test(block[1])) continue;
|
|
84
|
+
const lines = block[1].split(/\r?\n/).map((l) => l.replace(/^\s*\*\s?/, ''));
|
|
85
|
+
let cur = null;
|
|
86
|
+
const flush = () => {
|
|
87
|
+
if (cur?.kind === 'example') {
|
|
88
|
+
while (cur.code.length && !cur.code.at(-1).trim()) cur.code.pop();
|
|
89
|
+
while (cur.code.length && !cur.code[0].trim()) cur.code.shift();
|
|
90
|
+
const indent = Math.min(...cur.code.filter((l) => l.trim()).map((l) => l.match(/^\s*/)[0].length));
|
|
91
|
+
out.examples.push({ title: cur.title, code: cur.code.map((l) => l.slice(indent)).join('\n') });
|
|
92
|
+
}
|
|
93
|
+
cur = null;
|
|
94
|
+
};
|
|
95
|
+
for (const line of lines) {
|
|
96
|
+
const tag = line.match(/^\s*@(\w+)\s*(.*)$/);
|
|
97
|
+
if (tag) {
|
|
98
|
+
flush();
|
|
99
|
+
const [, name, rest] = tag;
|
|
100
|
+
if (name === 'summary') { out.summary = rest.trim(); cur = { kind: 'summary' }; }
|
|
101
|
+
else if (name === 'see') {
|
|
102
|
+
const m = rest.match(/^([a-z0-9-]+)\s*(?:—|-{1,2}|:)?\s*(.*)$/);
|
|
103
|
+
if (m) out.see.push({ component: m[1], when: m[2].trim() });
|
|
104
|
+
} else if (name === 'example') cur = { kind: 'example', title: rest.trim(), code: [] };
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (cur?.kind === 'example') cur.code.push(line);
|
|
108
|
+
else if (cur?.kind === 'summary' && line.trim()) out.summary += ` ${line.trim()}`;
|
|
109
|
+
else cur = null;
|
|
110
|
+
}
|
|
111
|
+
flush();
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
38
114
|
}
|
|
39
115
|
|
|
40
116
|
/** Reglas de uso escritas en el componente con `@note …` (una por línea): van al manifiesto. */
|
|
@@ -68,18 +144,74 @@ function parseOptionalPeers(src) {
|
|
|
68
144
|
return [...peers].sort();
|
|
69
145
|
}
|
|
70
146
|
|
|
71
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Props PROPIAS de cada componente exportado (las declaradas en `src/`, no las del elemento nativo ni las de
|
|
149
|
+
* Base UI): nombre, tipo, si es obligatoria, valores si es una unión de literales y su comentario.
|
|
150
|
+
* Lee los tipos con el compilador de TypeScript, así que nunca se desfasa del código.
|
|
151
|
+
*/
|
|
152
|
+
function extractProps() {
|
|
153
|
+
const cfgPath = join(ROOT, 'tsconfig.json');
|
|
154
|
+
const cfg = ts.getParsedCommandLineOfConfigFile(cfgPath, {}, { ...ts.sys, onUnRecoverableConfigFileDiagnostic: () => {} });
|
|
155
|
+
const files = readdirSync(UI).filter((n) => n.endsWith('.tsx')).map((n) => join(UI, n));
|
|
156
|
+
const program = ts.createProgram(files, cfg.options);
|
|
157
|
+
const checker = program.getTypeChecker();
|
|
158
|
+
const own = (sym) => (sym.declarations ?? []).length > 0 && sym.declarations.every((d) => !d.getSourceFile().fileName.includes('node_modules'));
|
|
159
|
+
const out = {};
|
|
160
|
+
for (const file of files) {
|
|
161
|
+
const sf = program.getSourceFile(file);
|
|
162
|
+
const mod = sf && checker.getSymbolAtLocation(sf);
|
|
163
|
+
if (!mod) continue;
|
|
164
|
+
const name = file.slice(UI.length + 1).replace(/\.tsx$/, '').replaceAll('\\', '/');
|
|
165
|
+
const byExport = {};
|
|
166
|
+
for (const exp of checker.getExportsOfModule(mod)) {
|
|
167
|
+
if (!/^[A-Z]/.test(exp.name)) continue;
|
|
168
|
+
const target = exp.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(exp) : exp;
|
|
169
|
+
const decl = target.valueDeclaration ?? target.declarations?.[0];
|
|
170
|
+
if (!decl) continue;
|
|
171
|
+
const sig = checker.getTypeOfSymbolAtLocation(target, decl).getCallSignatures()[0];
|
|
172
|
+
const param = sig?.parameters[0];
|
|
173
|
+
if (!param) continue;
|
|
174
|
+
const props = {};
|
|
175
|
+
for (const p of checker.getTypeOfSymbolAtLocation(param, decl).getProperties()) {
|
|
176
|
+
if (!own(p)) continue;
|
|
177
|
+
const optional = (p.flags & ts.SymbolFlags.Optional) !== 0;
|
|
178
|
+
const type = checker.getNonNullableType(checker.getTypeOfSymbolAtLocation(p, decl));
|
|
179
|
+
const text = checker.typeToString(type, decl, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope);
|
|
180
|
+
const lits = type.isUnion() ? type.types.filter((t) => t.isStringLiteral()).map((t) => t.value) : [];
|
|
181
|
+
const doc = ts.displayPartsToString(p.getDocumentationComment(checker)).replace(/\s+/g, ' ').trim();
|
|
182
|
+
props[p.name] = {
|
|
183
|
+
type: text.length > 160 ? text.slice(0, 157) + '…' : text,
|
|
184
|
+
...(optional ? {} : { required: true }),
|
|
185
|
+
...(lits.length > 1 && lits.length === type.types.length ? { values: lits } : {}),
|
|
186
|
+
...(doc ? { doc } : {}),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (Object.keys(props).length) byExport[exp.name] = props;
|
|
190
|
+
}
|
|
191
|
+
if (Object.keys(byExport).length) out[name] = byExport;
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function buildManifest({ props = false } = {}) {
|
|
197
|
+
const propsByFile = props ? extractProps() : {};
|
|
72
198
|
const components = {};
|
|
73
199
|
for (const f of readdirSync(UI).filter((n) => n.endsWith('.tsx')).sort()) {
|
|
74
200
|
const src = readFileSync(join(UI, f), 'utf8');
|
|
75
201
|
const name = f.replace(/\.tsx$/, '');
|
|
202
|
+
const doc = parseDoc(src);
|
|
76
203
|
components[name] = {
|
|
77
204
|
import: `orbital-ds/ui/${name}`,
|
|
205
|
+
group: parseGroup(src),
|
|
206
|
+
...(doc.summary ? { summary: doc.summary } : {}),
|
|
207
|
+
...(doc.see.length ? { see: doc.see } : {}),
|
|
78
208
|
exports: parseExports(src),
|
|
79
209
|
slots: parseSlots(src),
|
|
80
210
|
optionalPeers: parseOptionalPeers(src),
|
|
211
|
+
...(propsByFile[name] ? { props: propsByFile[name] } : {}),
|
|
81
212
|
...(parsePresets(src) ? { presets: parsePresets(src) } : {}),
|
|
82
213
|
...(parseNotes(src).length ? { notes: parseNotes(src) } : {}),
|
|
214
|
+
...(doc.examples.length ? { examples: doc.examples } : {}),
|
|
83
215
|
};
|
|
84
216
|
}
|
|
85
217
|
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8'));
|
|
@@ -87,14 +219,54 @@ export function buildManifest() {
|
|
|
87
219
|
package: pkg.name,
|
|
88
220
|
version: pkg.version,
|
|
89
221
|
engine: '@base-ui/react',
|
|
222
|
+
groups: Object.fromEntries(Object.entries(GROUPS).map(([k, v]) => [k, v.about])),
|
|
90
223
|
docs: ['README.md', 'docs/CONTRACT.md', 'AGENTS.md', 'contract.json'],
|
|
91
224
|
components,
|
|
92
225
|
};
|
|
93
226
|
}
|
|
94
227
|
|
|
228
|
+
/** Carpeta de las páginas por dominio (`manifest/<dominio>.json`): componentes con sus props tipadas. */
|
|
229
|
+
export const PAGES_DIR = 'manifest';
|
|
230
|
+
|
|
231
|
+
/** Separa el manifiesto completo en el índice (sin props, ligero) y una página por dominio (con props). */
|
|
232
|
+
export function splitManifest(full) {
|
|
233
|
+
const index = { ...full, pages: Object.fromEntries(Object.keys(GROUPS).map((g) => [g, `${PAGES_DIR}/${g}.json`])), components: {} };
|
|
234
|
+
const pages = {};
|
|
235
|
+
for (const g of Object.keys(GROUPS)) pages[g] = { package: full.package, version: full.version, group: g, about: GROUPS[g].about, components: {} };
|
|
236
|
+
for (const [name, c] of Object.entries(full.components)) {
|
|
237
|
+
// El índice sirve para ELEGIR (resumen, alternativas, notas); las props y los ejemplos, en la página del dominio.
|
|
238
|
+
const { props, examples, ...light } = c;
|
|
239
|
+
index.components[name] = light;
|
|
240
|
+
if (pages[c.group]) pages[c.group].components[name] = c;
|
|
241
|
+
}
|
|
242
|
+
return { index, pages };
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Fichero generado con los nombres públicos que una marca puede fijar en tiempo de ejecución (brand-runtime). */
|
|
246
|
+
export const ALLOWLIST_FILE = 'src/lib/brand-allowlist.ts';
|
|
247
|
+
|
|
248
|
+
/** Nombres públicos (sin `--`): los del contrato y todo `--ds-*` que declara la estructura (src/styles.css). */
|
|
249
|
+
export function buildBrandAllowlist() {
|
|
250
|
+
const contract = JSON.parse(readFileSync(join(ROOT, 'contract.json'), 'utf8'));
|
|
251
|
+
const css = readFileSync(join(ROOT, 'src', 'styles.css'), 'utf8');
|
|
252
|
+
const ds = [...css.matchAll(/(?:^|[\s;{])--(ds-[a-z0-9-]+)\s*:/g)].map((m) => m[1]);
|
|
253
|
+
const names = [...new Set([...contract.root, ...contract.brand.tokens.map((t) => t.name), ...ds])].sort();
|
|
254
|
+
return [
|
|
255
|
+
'// GENERADO por scripts/manifest.mjs (pnpm manifest): no se edita a mano.',
|
|
256
|
+
'// Variables públicas que una marca puede fijar en tiempo de ejecución (contrato + --ds-* de la estructura).',
|
|
257
|
+
'export const BRAND_PUBLIC_TOKENS: ReadonlySet<string> = new Set([',
|
|
258
|
+
...names.map((n) => `\t"${n}",`),
|
|
259
|
+
']);',
|
|
260
|
+
'',
|
|
261
|
+
].join('\n');
|
|
262
|
+
}
|
|
263
|
+
|
|
95
264
|
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
writeFileSync(
|
|
99
|
-
|
|
265
|
+
const full = buildManifest({ props: true });
|
|
266
|
+
const { index, pages } = splitManifest(full);
|
|
267
|
+
writeFileSync(join(ROOT, 'components.manifest.json'), JSON.stringify(index, null, 2) + EOL);
|
|
268
|
+
mkdirSync(join(ROOT, PAGES_DIR), { recursive: true });
|
|
269
|
+
for (const [g, page] of Object.entries(pages)) writeFileSync(join(ROOT, PAGES_DIR, `${g}.json`), JSON.stringify(page, null, 2) + EOL);
|
|
270
|
+
writeFileSync(join(ROOT, ALLOWLIST_FILE), buildBrandAllowlist());
|
|
271
|
+
console.log(`manifest: ${Object.keys(full.components).length} componentes → components.manifest.json + ${PAGES_DIR}/ (${Object.keys(pages).length} dominios)`);
|
|
100
272
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* orbital-ds upgrade — qué cambió entre la versión que tenía la app y la instalada, y qué revisar.
|
|
3
|
+
*
|
|
4
|
+
* orbital-ds upgrade detecta la versión anterior (último commit, sello del skill) y resume
|
|
5
|
+
* orbital-ds upgrade --from 0.41.0 desde una versión concreta
|
|
6
|
+
* orbital-ds upgrade --json lo mismo en JSON (para un agente)
|
|
7
|
+
*
|
|
8
|
+
* Lee el CHANGELOG.md del paquete instalado (viaja en el paquete). No toca nada de la app: dice qué cambió,
|
|
9
|
+
* señala lo que puede pedir un ajuste (versiones mayores, valores por defecto que cambian, retiradas) y
|
|
10
|
+
* recuerda las comprobaciones que hay que volver a pasar.
|
|
11
|
+
*/
|
|
12
|
+
import { execFileSync } from 'node:child_process';
|
|
13
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
14
|
+
import { dirname, join, resolve } from 'node:path';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
|
|
17
|
+
import { estadoSkill, raizApp } from './skill.mjs';
|
|
18
|
+
|
|
19
|
+
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
20
|
+
const SEMVER = /\b(\d+)\.(\d+)\.(\d+)\b/;
|
|
21
|
+
|
|
22
|
+
/** Compara dos versiones x.y.z: <0, 0 o >0. */
|
|
23
|
+
export function compararVersiones(a, b) {
|
|
24
|
+
const pa = a.split('.').map(Number);
|
|
25
|
+
const pb = b.split('.').map(Number);
|
|
26
|
+
for (let i = 0; i < 3; i++) if (pa[i] !== pb[i]) return pa[i] - pb[i];
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Entradas del CHANGELOG: [{ version, fecha, tipo, cuerpo }]. */
|
|
31
|
+
export function leerChangelog(texto) {
|
|
32
|
+
const entradas = [];
|
|
33
|
+
const partes = texto.replace(/\r\n/g, '\n').split(/^## /m).slice(1);
|
|
34
|
+
for (const p of partes) {
|
|
35
|
+
const [cabecera, ...resto] = p.split('\n');
|
|
36
|
+
const m = cabecera.match(SEMVER);
|
|
37
|
+
if (!m) continue;
|
|
38
|
+
const cuerpo = resto.join('\n').trim();
|
|
39
|
+
const tipo = /^(mayor|menor|parche)/im.exec(cuerpo)?.[1]?.toLowerCase() ?? null;
|
|
40
|
+
entradas.push({ version: m[0], fecha: cabecera.split('—')[1]?.trim() ?? '', tipo, cuerpo });
|
|
41
|
+
}
|
|
42
|
+
return entradas;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Viñetas que pueden pedir un ajuste en la app (por su redacción). */
|
|
46
|
+
const AJUSTE = /(?:\bmayor\b|\brompe|\bse quita\b|\bquitad[oa]s?\b|\bse retira\b|\bretirad[oa]s?\b|\brenombrad[oa]s?\b|\bse renombra\b|\(antes |\bobsolet|\bdeprecad|\bpasa de `|\bpor defecto pasa|\bya no\b|\bsustituye)/i;
|
|
47
|
+
|
|
48
|
+
export function puntosDeAjuste(cuerpo) {
|
|
49
|
+
return cuerpo
|
|
50
|
+
.split('\n')
|
|
51
|
+
.filter((l) => /^\s*-\s/.test(l) && AJUSTE.test(l))
|
|
52
|
+
.map((l) => l.replace(/^\s*-\s*/, '').trim());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Versión de orbital-ds que tenía la app en su último commit (lockfile o package.json en HEAD). */
|
|
56
|
+
function versionEnHead(raiz) {
|
|
57
|
+
for (const f of ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock', 'package.json']) {
|
|
58
|
+
let txt;
|
|
59
|
+
try {
|
|
60
|
+
txt = execFileSync('git', ['show', `HEAD:${f}`], { cwd: raiz, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
|
|
61
|
+
} catch {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const lineas = txt.split(/\r?\n/);
|
|
65
|
+
for (let i = 0; i < lineas.length; i++) {
|
|
66
|
+
if (!/orbital-ds/.test(lineas[i])) continue;
|
|
67
|
+
for (let k = i; k < Math.min(i + 8, lineas.length); k++) {
|
|
68
|
+
const m = lineas[k].match(SEMVER);
|
|
69
|
+
if (m) return { version: m[0], fuente: `${f} del último commit` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function ordenUpgrade(args) {
|
|
77
|
+
const json = args.includes('--json');
|
|
78
|
+
const actual = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).version;
|
|
79
|
+
const cl = join(ROOT, 'CHANGELOG.md');
|
|
80
|
+
if (!existsSync(cl)) {
|
|
81
|
+
console.error('orbital-ds upgrade: este paquete no trae CHANGELOG.md.');
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
const raiz = raizApp();
|
|
85
|
+
const i = args.indexOf('--from');
|
|
86
|
+
let desde = i > -1 && args[i + 1] ? { version: args[i + 1].replace(/^v/, ''), fuente: '--from' } : null;
|
|
87
|
+
if (!desde) desde = versionEnHead(raiz);
|
|
88
|
+
if (!desde || compararVersiones(desde.version, actual) >= 0) {
|
|
89
|
+
const s = estadoSkill(raiz);
|
|
90
|
+
if (s.version && compararVersiones(s.version, actual) < 0) desde = { version: s.version, fuente: 'sello del skill orbital-ds-designer' };
|
|
91
|
+
}
|
|
92
|
+
if (!desde || !SEMVER.test(desde.version)) {
|
|
93
|
+
console.error(`orbital-ds upgrade: no sé desde qué versión vienes. Indícalo: orbital-ds upgrade --from 0.41.0 (instalada: ${actual}).`);
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const entradas = leerChangelog(readFileSync(cl, 'utf8')).filter(
|
|
98
|
+
(e) => compararVersiones(e.version, desde.version) > 0 && compararVersiones(e.version, actual) <= 0,
|
|
99
|
+
);
|
|
100
|
+
const resumen = entradas.map((e) => ({ ...e, ajustes: puntosDeAjuste(e.cuerpo) }));
|
|
101
|
+
const mayores = resumen.filter((e) => e.tipo === 'mayor').map((e) => e.version);
|
|
102
|
+
const comprobar = [
|
|
103
|
+
'pnpm exec orbital-ds doctor --css src/brand.css --ui src',
|
|
104
|
+
'pnpm exec orbital-ds i18n --check',
|
|
105
|
+
'pnpm exec orbital-ds skill',
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
if (json) {
|
|
109
|
+
console.log(JSON.stringify({ desde: desde.version, fuente: desde.fuente, hasta: actual, mayores, versiones: resumen, comprobar }, null, 2));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!resumen.length) {
|
|
113
|
+
console.log(`orbital-ds ${actual}: ya estabas en esta versión o no hay entradas entre ${desde.version} y ${actual}.`);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
console.log(`orbital-ds ${desde.version} → ${actual} (desde: ${desde.fuente}) · ${resumen.length} versión(es)\n`);
|
|
117
|
+
if (mayores.length) console.log(`⚠ Versiones MAYORES (quitan o renombran algo público): ${mayores.join(', ')}. Lee su entrada entera.\n`);
|
|
118
|
+
for (const e of resumen) {
|
|
119
|
+
const titulo = e.cuerpo.split('\n')[0];
|
|
120
|
+
console.log(`## ${e.version}${e.fecha ? ` — ${e.fecha}` : ''} ${titulo}`);
|
|
121
|
+
for (const a of e.ajustes) console.log(` revisa → ${a.length > 220 ? `${a.slice(0, 217)}…` : a}`);
|
|
122
|
+
}
|
|
123
|
+
console.log(`\nDetalle completo: node_modules/orbital-ds/CHANGELOG.md`);
|
|
124
|
+
console.log('Después de actualizar, vuelve a pasar:');
|
|
125
|
+
for (const c of comprobar) console.log(` ${c}`);
|
|
126
|
+
}
|
package/skill/SKILL.md
CHANGED
|
@@ -27,8 +27,13 @@ mismos componentes, el aspecto del tema y de la marca de la app.
|
|
|
27
27
|
2. **Modo:** dar forma · construir · revisar · robustecer → `node_modules/orbital-ds/docs/designer/flujo.md` §1.
|
|
28
28
|
3. **Mapa del flujo y modelo mental de la persona** → `flujo.md` §2. Reduce pasos y deja una acción principal.
|
|
29
29
|
4. **Patrones** para cada paso → `node_modules/orbital-ds/docs/designer/patrones.md`.
|
|
30
|
-
5. **Componer** con los componentes del
|
|
31
|
-
|
|
30
|
+
5. **Componer** con los componentes del sistema. Para ELEGIR, busca por intención: `pnpm exec orbital-ds components --search
|
|
31
|
+
<qué necesitas>` (resumen y alternativas de cada uno). Antes de usar uno, lee su **ficha** con
|
|
32
|
+
`orbital-ds components <nombre>`: cuándo usar otro, props, notas y **ejemplos mínimos**; parte de un ejemplo en vez de
|
|
33
|
+
escribir de memoria. Por dominio: `pnpm exec orbital-ds components` lista los 12
|
|
34
|
+
dominios; `orbital-ds components --group <dominio>` da sus componentes con **props tipadas** (valores permitidos,
|
|
35
|
+
obligatorias), presets y `notes`; `orbital-ds components <nombre>` uno solo. No inventes props: si no está ahí, no
|
|
36
|
+
existe. Reglas en `node_modules/orbital-ds/AGENTS.md`.
|
|
32
37
|
6. **Criterio visual: analiza y elige el elemento** → `node_modules/orbital-ds/docs/designer/criterio.md` (los 8 pasos
|
|
33
38
|
de análisis puntuados, el árbol «¿tarjeta, ítem, bento, imagen, efecto?», armonía y referentes: Apple, Material,
|
|
34
39
|
Nielsen, Polaris/GOV.UK). Antes de elegir un elemento, lee el `@note` de las dos piezas candidatas. Puntúa la
|
|
@@ -37,7 +42,7 @@ mismos componentes, el aspecto del tema y de la marca de la app.
|
|
|
37
42
|
formularios, textos, accesibilidad WCAG 2.2 AA, responsivo).
|
|
38
43
|
8. **Verificar** → `node_modules/orbital-ds/docs/designer/revision.md`, y además:
|
|
39
44
|
`pnpm exec orbital-ds doctor --css src/brand.css --ui src` (la parte mecánica: valores fijos, paleta de
|
|
40
|
-
Tailwind, `!important`, controles nativos sueltos) y el verify de la app. Recorre cada estado, con teclado, en
|
|
45
|
+
Tailwind, `!important`, controles nativos sueltos, `asChild`, props y valores que no existen en el componente) y el verify de la app. Recorre cada estado, con teclado, en
|
|
41
46
|
móvil, claro/oscuro y con textos largos.
|
|
42
47
|
|
|
43
48
|
## Orden de autoridad
|