orbital-ds 0.6.2 → 0.7.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.
@@ -421,7 +421,7 @@ function SidebarMenuItem({ className, ...props }) {
421
421
  );
422
422
  }
423
423
  const sidebarMenuButtonVariants = cva(
424
- "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-(--ds-sidebar-item-radius) px-3 py-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
424
+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-(--ds-sidebar-item-radius) px-3 py-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
425
425
  {
426
426
  variants: {
427
427
  variant: {
@@ -48,7 +48,7 @@ function TooltipContent({
48
48
  ...props,
49
49
  children: [
50
50
  children,
51
- /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "z-(--ds-z-overlay) size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]" })
51
+ /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { "data-slot": "tooltip-arrow", className: "z-(--ds-z-overlay) size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]" })
52
52
  ]
53
53
  }
54
54
  )
package/docs/CONTRACT.md CHANGED
@@ -77,7 +77,7 @@ Los define la estructura con un valor neutro; un tema los sobrescribe si quiere.
77
77
  | Capas | `--ds-z-raised`, `--ds-z-sticky`, `--ds-z-sidebar` (sobre la cabecera sticky), `--ds-z-overlay` |
78
78
  | Movimiento | `--ds-motion-fast`, `--ds-motion-base`, `--ds-motion-slow`, `--ds-motion-blink` |
79
79
  | Foco | `--ds-ring-width` |
80
- | Sidebar | `--ds-sidebar-rail-w` (ancho del lateral contraído; por defecto `4rem`) |
80
+ | Lateral | `--ds-sidebar-icon`, `--ds-sidebar-icon-stroke` (iconos), `--ds-sidebar-rail-w` (ancho contraído), `--ds-sidebar-rail-item` (tecla del raíl), `--ds-sidebar-logo` (logo y avatar), `--ds-sidebar-sep-inset` (separadores; negativo = de borde a borde). **Todo tema los define** (contrato) |
81
81
  | Velo | `--color-scrim` |
82
82
  | **Materiales** | `--ds-card-backdrop`, `--ds-overlay-backdrop`, `--ds-field-backdrop`, `--ds-sidebar-backdrop` (un `backdrop-filter` completo; por defecto `none`) y `--ds-page-backdrop` (un `background-image` para el fondo de la página; por defecto `none`) |
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbital-ds",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "Sistema de diseño genérico: estructura común + temas con personalidad (qratia, zyro) + ~60 componentes sobre Base UI y Tailwind v4, con contrato verificable y legible por agentes.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -49,14 +49,6 @@
49
49
  "./contract.json": "./contract.json",
50
50
  "./components.manifest.json": "./components.manifest.json"
51
51
  },
52
- "scripts": {
53
- "build": "tsup && node scripts/build-css.mjs",
54
- "dev": "tsup --watch --onSuccess \"node scripts/copy-css.mjs\"",
55
- "typecheck": "tsc --noEmit",
56
- "verify": "pnpm check:ds && pnpm typecheck && pnpm build",
57
- "manifest": "node scripts/manifest.mjs",
58
- "check:ds": "node scripts/doctor.mjs"
59
- },
60
52
  "peerDependencies": {
61
53
  "@base-ui/react": ">=1.9",
62
54
  "class-variance-authority": ">=0.7",
@@ -138,5 +130,13 @@
138
130
  "bin": {
139
131
  "orbital-ds-doctor": "./scripts/doctor.mjs",
140
132
  "orbital-ds-init": "./scripts/init.mjs"
133
+ },
134
+ "scripts": {
135
+ "build": "tsup && node scripts/build-css.mjs",
136
+ "dev": "tsup --watch --onSuccess \"node scripts/copy-css.mjs\"",
137
+ "typecheck": "tsc --noEmit",
138
+ "verify": "pnpm check:ds && pnpm typecheck && pnpm build",
139
+ "manifest": "node scripts/manifest.mjs",
140
+ "check:ds": "node scripts/doctor.mjs"
141
141
  }
142
- }
142
+ }
@@ -207,6 +207,35 @@ for (const f of themeFiles) {
207
207
  const r = ratio(over(fg, fondo), fondo);
208
208
  if (r < 4.5) errors.push(`tema ${tema} (${piel}): ${estado} sobre ${estado}-soft = ${r.toFixed(2)}:1 (mínimo 4.5:1)`);
209
209
  }
210
+
211
+ // Pares principales de texto sobre su superficie. AA (4.5:1) es el mínimo exigible; las
212
+ // excepciones deben estar declaradas en `<tema>.meta.json` → `a11y.exceptions` ("fg/bg").
213
+ // AAA (7:1) es el objetivo del texto del cuerpo: solo avisa, y solo con `--aaa`.
214
+ const PARES = [
215
+ ['foreground', 'background'], ['card-foreground', 'card'], ['popover-foreground', 'popover'],
216
+ ['primary-foreground', 'primary'], ['secondary-foreground', 'secondary'],
217
+ ['muted-foreground', 'background'], ['muted-foreground', 'card'],
218
+ ['sidebar-foreground', 'sidebar'], ['sidebar-primary-foreground', 'sidebar-primary'],
219
+ ['destructive-foreground', 'destructive'],
220
+ ];
221
+ let excepciones = [];
222
+ try { excepciones = JSON.parse(read(join(themesDir, `${tema}.meta.json`))).a11y?.exceptions ?? []; } catch { /* sin ficha: lo avisa 1b */ }
223
+ const blanco = { r: 255, g: 255, b: 255, a: 1 };
224
+ for (const [fgName, bgName] of PARES) {
225
+ const fgRaw = vars[fgName] && parseColor(vars[fgName]);
226
+ const bgRaw = vars[bgName] && parseColor(vars[bgName]);
227
+ if (!fgRaw || !bgRaw) continue;
228
+ const bg = over(bgRaw, over(lienzo, blanco));
229
+ const r = ratio(over(fgRaw, bg), bg);
230
+ const par = `${fgName}/${bgName}`;
231
+ if (r < 4.5) {
232
+ const msg = `tema ${tema} (${piel}): ${par} = ${r.toFixed(2)}:1 (mínimo AA 4.5:1)`;
233
+ if (excepciones.includes(par)) warnings.push(`${msg} — excepción declarada en la ficha`);
234
+ else errors.push(`${msg}; corrígelo o decláralo en ${tema}.meta.json → a11y.exceptions`);
235
+ } else if (process.argv.includes('--aaa') && r < 7 && (par === 'foreground/background' || par === 'card-foreground/card')) {
236
+ warnings.push(`tema ${tema} (${piel}): ${par} = ${r.toFixed(2)}:1 (objetivo AAA 7:1 para el texto del cuerpo)`);
237
+ }
238
+ }
210
239
  }
211
240
  }
212
241
  }
package/scripts/init.mjs CHANGED
File without changes