orbital-ds 0.29.1 → 0.30.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 (89) hide show
  1. package/AGENTS.md +14 -0
  2. package/components.manifest.json +117 -6
  3. package/dist/hooks/use-ds-messages.d.ts +9 -0
  4. package/dist/lib/auth-flow.d.ts +26 -2
  5. package/dist/lib/auth-flow.js +20 -3
  6. package/dist/lib/header-control.d.ts +4 -0
  7. package/dist/lib/header-control.js +14 -0
  8. package/dist/lib/i18n.d.ts +9 -0
  9. package/dist/lib/i18n.js +27 -0
  10. package/dist/ui/app-bar.d.ts +10 -0
  11. package/dist/ui/app-bar.js +51 -0
  12. package/dist/ui/attachment.js +1 -1
  13. package/dist/ui/auth-form.d.ts +5 -1
  14. package/dist/ui/auth-form.js +5 -0
  15. package/dist/ui/badge.js +2 -2
  16. package/dist/ui/button.js +1 -1
  17. package/dist/ui/content-card.d.ts +6 -2
  18. package/dist/ui/content-card.js +27 -3
  19. package/dist/ui/dropzone.js +1 -1
  20. package/dist/ui/item.js +1 -1
  21. package/dist/ui/legend.js +1 -1
  22. package/dist/ui/locale-switcher.d.ts +19 -0
  23. package/dist/ui/locale-switcher.js +54 -0
  24. package/dist/ui/menubar.js +1 -1
  25. package/dist/ui/message-scroller.js +1 -1
  26. package/dist/ui/navigation-menu.js +2 -2
  27. package/dist/ui/notice-review.d.ts +1 -0
  28. package/dist/ui/notifications.d.ts +12 -2
  29. package/dist/ui/notifications.js +28 -5
  30. package/dist/ui/sidebar.d.ts +17 -3
  31. package/dist/ui/sidebar.js +25 -10
  32. package/dist/ui/theme-toggle.d.ts +14 -0
  33. package/dist/ui/theme-toggle.js +112 -0
  34. package/dist/ui/toggle.js +2 -2
  35. package/dist/ui/week-strip.js +1 -1
  36. package/docs/CONTRACT.md +1 -1
  37. package/docs/designer/patrones.md +6 -0
  38. package/package.json +188 -187
  39. package/scripts/cli.mjs +452 -452
  40. package/dist/motion.css +0 -146
  41. package/dist/styles.css +0 -1656
  42. package/dist/themes/fractalia.css +0 -549
  43. package/dist/themes/fractalia.fonts.css +0 -3
  44. package/dist/themes/fractalia.guide.md +0 -86
  45. package/dist/themes/fractalia.meta.json +0 -112
  46. package/dist/themes/fractalia.scoped.css +0 -549
  47. package/dist/themes/fractalia.tokens.json +0 -39
  48. package/dist/themes/friendly.css +0 -367
  49. package/dist/themes/friendly.fonts.css +0 -2
  50. package/dist/themes/friendly.guide.md +0 -38
  51. package/dist/themes/friendly.meta.json +0 -82
  52. package/dist/themes/friendly.scoped.css +0 -367
  53. package/dist/themes/friendly.tokens.json +0 -45
  54. package/dist/themes/lagoon.css +0 -348
  55. package/dist/themes/lagoon.fonts.css +0 -2
  56. package/dist/themes/lagoon.guide.md +0 -47
  57. package/dist/themes/lagoon.meta.json +0 -85
  58. package/dist/themes/lagoon.scoped.css +0 -348
  59. package/dist/themes/lagoon.tokens.json +0 -49
  60. package/dist/themes/liquid.css +0 -502
  61. package/dist/themes/liquid.fonts.css +0 -7
  62. package/dist/themes/liquid.guide.md +0 -82
  63. package/dist/themes/liquid.meta.json +0 -134
  64. package/dist/themes/liquid.scoped.css +0 -502
  65. package/dist/themes/liquid.tokens.json +0 -47
  66. package/dist/themes/qratia.css +0 -260
  67. package/dist/themes/qratia.fonts.css +0 -2
  68. package/dist/themes/qratia.guide.md +0 -34
  69. package/dist/themes/qratia.meta.json +0 -49
  70. package/dist/themes/qratia.scoped.css +0 -260
  71. package/dist/themes/qratia.tokens.json +0 -49
  72. package/dist/themes/tactile.css +0 -588
  73. package/dist/themes/tactile.fonts.css +0 -3
  74. package/dist/themes/tactile.guide.md +0 -82
  75. package/dist/themes/tactile.meta.json +0 -182
  76. package/dist/themes/tactile.scoped.css +0 -588
  77. package/dist/themes/tactile.tokens.json +0 -42
  78. package/dist/themes/twitter.css +0 -357
  79. package/dist/themes/twitter.fonts.css +0 -6
  80. package/dist/themes/twitter.guide.md +0 -35
  81. package/dist/themes/twitter.meta.json +0 -90
  82. package/dist/themes/twitter.scoped.css +0 -357
  83. package/dist/themes/twitter.tokens.json +0 -45
  84. package/dist/themes/zyro.css +0 -434
  85. package/dist/themes/zyro.fonts.css +0 -2
  86. package/dist/themes/zyro.guide.md +0 -33
  87. package/dist/themes/zyro.meta.json +0 -74
  88. package/dist/themes/zyro.scoped.css +0 -434
  89. package/dist/themes/zyro.tokens.json +0 -46
@@ -4,9 +4,9 @@ import { IconTile } from './icon-tile.js';
4
4
  import 'class-variance-authority/types';
5
5
  import 'class-variance-authority';
6
6
 
7
- type ContentCardPreset = "basic" | "feature" | "media" | "horizontal";
7
+ type ContentCardPreset = "basic" | "feature" | "media" | "horizontal" | "metric" | "status";
8
8
  type ContentCardEmphasis = "elevated" | "outlined" | "filled" | "ghost";
9
- declare function ContentCard({ preset, emphasis, tone, density, icon, media, title, description, action, footer, href, onSelect, children, className, }: {
9
+ declare function ContentCard({ preset, emphasis, tone, density, icon, media, value, delta, title, description, action, footer, href, onSelect, children, className, }: {
10
10
  preset?: ContentCardPreset;
11
11
  emphasis?: ContentCardEmphasis;
12
12
  tone?: React.ComponentProps<typeof IconTile>["tone"];
@@ -15,6 +15,10 @@ declare function ContentCard({ preset, emphasis, tone, density, icon, media, tit
15
15
  icon?: React.ReactNode;
16
16
  /** Portada (preset media y horizontal): imagen, vídeo o cualquier nodo. */
17
17
  media?: React.ReactNode;
18
+ /** Dato grande (preset metric). */
19
+ value?: React.ReactNode;
20
+ /** Variación junto al dato (preset metric): «+4,2 %». */
21
+ delta?: React.ReactNode;
18
22
  title: React.ReactNode;
19
23
  description?: React.ReactNode;
20
24
  /** Acción de la cabecera (menú, botón de icono); sigue pulsable en una tarjeta interactiva. */
@@ -11,6 +11,15 @@ const EMPHASIS = {
11
11
  filled: "border-transparent bg-muted shadow-none hover:shadow-none",
12
12
  ghost: "border-transparent bg-transparent shadow-none hover:shadow-none"
13
13
  };
14
+ const STATUS_DOT = {
15
+ neutral: "bg-muted-foreground",
16
+ primary: "bg-primary",
17
+ accent: "bg-primary",
18
+ info: "bg-info",
19
+ success: "bg-success",
20
+ warning: "bg-warning",
21
+ danger: "bg-danger"
22
+ };
14
23
  const DENSITY = {
15
24
  compact: "[--ds-card-spacing:var(--ds-card-spacing-sm)] gap-2",
16
25
  default: "",
@@ -23,6 +32,8 @@ function ContentCard({
23
32
  density = "default",
24
33
  icon,
25
34
  media,
35
+ value,
36
+ delta,
26
37
  title,
27
38
  description,
28
39
  action,
@@ -36,12 +47,13 @@ function ContentCard({
36
47
  if (href && onSelect) dsWarn("ContentCard", "use either `href` or `onSelect`, not both.");
37
48
  if ((preset === "media" || preset === "horizontal") && !media)
38
49
  dsWarn("ContentCard", `preset="${preset}" needs the \`media\` prop.`);
39
- }, [href, onSelect, preset, media]);
50
+ if (preset === "metric" && value == null) dsWarn("ContentCard", 'preset="metric" needs the `value` prop.');
51
+ }, [href, onSelect, preset, media, value]);
40
52
  const interactive = Boolean(href || onSelect);
41
53
  const stretch = "after:absolute after:inset-0 after:content-[''] outline-none after:rounded-card focus-visible:after:ring-(length:--ds-ring-width) focus-visible:after:ring-(--ds-ring-color)";
42
54
  const titleNode = href ? /* @__PURE__ */ jsx("a", { href, className: stretch, children: title }) : onSelect ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onSelect, className: cn("text-start", stretch), children: title }) : title;
43
55
  const horizontal = preset === "horizontal";
44
- const showIcon = icon && preset !== "media" && preset !== "horizontal";
56
+ const showIcon = icon && preset !== "media" && preset !== "horizontal" && preset !== "metric" && preset !== "status";
45
57
  return /* @__PURE__ */ jsxs(
46
58
  Card,
47
59
  {
@@ -54,7 +66,7 @@ function ContentCard({
54
66
  "@container/content-card relative",
55
67
  EMPHASIS[emphasis],
56
68
  DENSITY[density],
57
- interactive && "cursor-pointer hover:bg-muted/40",
69
+ interactive && "cursor-pointer hover:bg-(--ds-row-hover)",
58
70
  horizontal && "@md/content-card:flex-row @md/content-card:py-0",
59
71
  className
60
72
  ),
@@ -73,10 +85,22 @@ function ContentCard({
73
85
  /* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-1 flex-col gap-(--ds-card-spacing)", horizontal && "@md/content-card:py-(--ds-card-spacing)"), children: [
74
86
  /* @__PURE__ */ jsxs(CardHeader, { children: [
75
87
  showIcon ? /* @__PURE__ */ jsx(IconTile, { tone, size: "md", className: "mb-1", children: icon }) : null,
88
+ preset === "status" ? /* @__PURE__ */ jsx(
89
+ "span",
90
+ {
91
+ "data-slot": "content-card-dot",
92
+ "aria-hidden": "true",
93
+ className: cn("mb-1 block size-(--ds-status-dot) rounded-full", STATUS_DOT[tone ?? "neutral"])
94
+ }
95
+ ) : null,
76
96
  /* @__PURE__ */ jsx(CardTitle, { children: titleNode }),
77
97
  description ? /* @__PURE__ */ jsx(CardDescription, { children: description }) : null,
78
98
  action ? /* @__PURE__ */ jsx(CardAction, { className: "relative z-(--ds-z-raised)", children: action }) : null
79
99
  ] }),
100
+ preset === "metric" && value != null ? /* @__PURE__ */ jsxs(CardContent, { "data-slot": "content-card-value", className: "flex items-baseline gap-2", children: [
101
+ /* @__PURE__ */ jsx("span", { className: "text-3xl font-(--ds-stat-value-weight) tracking-tight tabular-nums", children: value }),
102
+ delta ? /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-muted-foreground tabular-nums", children: delta }) : null
103
+ ] }) : null,
80
104
  children ? /* @__PURE__ */ jsx(CardContent, { children }) : null,
81
105
  footer ? /* @__PURE__ */ jsx(CardFooter, { className: "relative z-(--ds-z-raised) gap-2", children: footer }) : null
82
106
  ] })
@@ -142,7 +142,7 @@ function Dropzone({
142
142
  handle(e.dataTransfer.files);
143
143
  },
144
144
  className: cn(
145
- "flex cursor-pointer flex-col items-center justify-center gap-2 rounded-card border-(length:--ds-rule-w) border-dashed border-border bg-(--ds-field-bg) p-(--ds-dropzone-p) text-center text-sm transition-colors duration-(--ds-motion-snap) hover:bg-muted/50",
145
+ "flex cursor-pointer flex-col items-center justify-center gap-2 rounded-card border-(length:--ds-rule-w) border-dashed border-border bg-(--ds-field-bg) p-(--ds-dropzone-p) text-center text-sm transition-colors duration-(--ds-motion-snap) hover:bg-(--ds-row-hover)",
146
146
  "has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-(length:--ds-ring-width) has-[input:focus-visible]:ring-(--ds-ring-color)",
147
147
  "data-[state=drag-over]:border-primary data-[state=drag-over]:bg-accent data-[state=drag-over]:text-accent-foreground",
148
148
  "data-[state=error]:border-danger data-[state=error]:bg-danger-soft",
package/dist/ui/item.js CHANGED
@@ -37,7 +37,7 @@ function ItemSeparator({
37
37
  );
38
38
  }
39
39
  const itemVariants = cva(
40
- "group/item flex w-full flex-wrap items-center rounded-panel border text-sm transition-colors duration-(--ds-motion-fast) outline-none focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) [a]:transition-colors [a]:hover:bg-muted",
40
+ "group/item flex w-full flex-wrap items-center rounded-panel border text-sm transition-colors duration-(--ds-motion-fast) outline-none focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) [a]:transition-colors [a]:hover:bg-(--ds-hover-bg)",
41
41
  {
42
42
  variants: {
43
43
  variant: {
package/dist/ui/legend.js CHANGED
@@ -119,7 +119,7 @@ function LegendItem({
119
119
  "aria-pressed": active,
120
120
  onClick: () => onToggle(!active),
121
121
  className: cn(
122
- "-mx-1 flex min-w-0 flex-1 items-center gap-2 rounded-xs px-1 outline-hidden transition-opacity duration-(--ds-motion-fast) hover:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) motion-reduce:transition-none",
122
+ "-mx-1 flex min-w-0 flex-1 items-center gap-2 rounded-xs px-1 outline-hidden transition-opacity duration-(--ds-motion-fast) hover:bg-(--ds-hover-bg) focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) motion-reduce:transition-none",
123
123
  !active && "opacity-(--ds-disabled-opacity) [&_[data-slot=legend-label]]:line-through"
124
124
  ),
125
125
  children: content
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { HeaderControlTone } from '../lib/header-control.js';
3
+
4
+ type LocaleOption = {
5
+ value: string;
6
+ label: string;
7
+ short?: string;
8
+ };
9
+ type LocaleSwitcherPreset = "compact" | "menu";
10
+ declare function LocaleSwitcher({ locales, value, onValueChange, preset, tone, className, }: {
11
+ locales: LocaleOption[];
12
+ value: string;
13
+ onValueChange?: (value: string) => void;
14
+ preset?: LocaleSwitcherPreset;
15
+ tone?: HeaderControlTone;
16
+ className?: string;
17
+ }): React.JSX.Element;
18
+
19
+ export { type LocaleOption, LocaleSwitcher, type LocaleSwitcherPreset };
@@ -0,0 +1,54 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { LanguagesIcon } from "lucide-react";
3
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
4
+ import { headerControlClass } from "../lib/header-control.js";
5
+ import { cn } from "../lib/utils.js";
6
+ import { Button } from "./button.js";
7
+ import {
8
+ DropdownMenu,
9
+ DropdownMenuContent,
10
+ DropdownMenuRadioGroup,
11
+ DropdownMenuRadioItem,
12
+ DropdownMenuTrigger
13
+ } from "./dropdown-menu.js";
14
+ function LocaleSwitcher({
15
+ locales,
16
+ value,
17
+ onValueChange,
18
+ preset = "compact",
19
+ tone = "neutral",
20
+ className
21
+ }) {
22
+ const t = useDsMessages();
23
+ const base = value.split("-")[0];
24
+ const current = locales.find((l) => l.value === value) ?? locales.find((l) => l.value === base) ?? locales[0];
25
+ const short = current?.short ?? (current?.value ?? value).slice(0, 2).toUpperCase();
26
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
27
+ /* @__PURE__ */ jsxs(
28
+ DropdownMenuTrigger,
29
+ {
30
+ render: /* @__PURE__ */ jsx(
31
+ Button,
32
+ {
33
+ type: "button",
34
+ variant: "ghost",
35
+ size: "sm",
36
+ "data-slot": "locale-switcher",
37
+ "data-preset": preset,
38
+ "data-value": current?.value ?? value,
39
+ "aria-label": `${t.localeSwitcherLabel}: ${current?.label ?? value}`,
40
+ className: cn(headerControlClass(tone), className)
41
+ }
42
+ ),
43
+ children: [
44
+ /* @__PURE__ */ jsx(LanguagesIcon, {}),
45
+ preset === "menu" ? current?.label : short
46
+ ]
47
+ }
48
+ ),
49
+ /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: current?.value ?? value, onValueChange: (v) => onValueChange?.(v), children: locales.map((l) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: l.value, lang: l.value, children: l.label }, l.value)) }) })
50
+ ] });
51
+ }
52
+ export {
53
+ LocaleSwitcher
54
+ };
@@ -51,7 +51,7 @@ function MenubarTrigger({
51
51
  {
52
52
  "data-slot": "menubar-trigger",
53
53
  className: cn(
54
- "flex items-center rounded-item px-2 py-0.75 text-sm font-(--ds-medium-weight) outline-hidden select-none hover:bg-muted aria-expanded:bg-muted",
54
+ "flex items-center rounded-item px-2 py-0.75 text-sm font-(--ds-medium-weight) outline-hidden select-none hover:bg-(--ds-hover-bg) aria-expanded:bg-muted",
55
55
  className
56
56
  ),
57
57
  ...props
@@ -95,7 +95,7 @@ function MessageScrollerButton({
95
95
  "data-size": size,
96
96
  direction,
97
97
  className: cn(
98
- "absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-(--ds-motion-base) hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-(--ds-motion-slow) data-[active=false]:ease-(--ds-ease-exit) data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-(--ds-ease-enter) data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",
98
+ "absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-(--ds-motion-base) hover:bg-(--ds-hover-bg) hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-(--ds-motion-slow) data-[active=false]:ease-(--ds-ease-exit) data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-(--ds-ease-enter) data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",
99
99
  className
100
100
  ),
101
101
  render: render ?? /* @__PURE__ */ jsx(Button, { variant, size }),
@@ -55,7 +55,7 @@ function NavigationMenuItem({
55
55
  );
56
56
  }
57
57
  const navigationMenuTriggerStyle = cva(
58
- "group/navigation-menu-trigger inline-flex h-(--ds-control-h-md) w-max items-center justify-center rounded-2xl px-4.5 py-2.5 text-sm font-(--ds-medium-weight) transition-all duration-(--ds-motion-snap) outline-none hover:bg-muted focus:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-(--ds-disabled-opacity) data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted"
58
+ "group/navigation-menu-trigger inline-flex h-(--ds-control-h-md) w-max items-center justify-center rounded-2xl px-4.5 py-2.5 text-sm font-(--ds-medium-weight) transition-all duration-(--ds-motion-snap) outline-none hover:bg-(--ds-hover-bg) focus:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-(--ds-disabled-opacity) data-popup-open:bg-muted/50 data-popup-open:hover:bg-(--ds-hover-bg) data-open:bg-muted/50 data-open:hover:bg-(--ds-hover-bg) data-open:focus:bg-muted"
59
59
  );
60
60
  function NavigationMenuTrigger({
61
61
  className,
@@ -126,7 +126,7 @@ function NavigationMenuLink({
126
126
  {
127
127
  "data-slot": "navigation-menu-link",
128
128
  className: cn(
129
- "flex items-center gap-1.5 rounded-item p-3 text-sm transition-all duration-(--ds-motion-snap) outline-none hover:bg-muted focus:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) focus-visible:outline-1 data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-muted data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
129
+ "flex items-center gap-1.5 rounded-item p-3 text-sm transition-all duration-(--ds-motion-snap) outline-none hover:bg-(--ds-hover-bg) focus:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) focus-visible:outline-1 data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-(--ds-hover-bg) data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
130
130
  className
131
131
  ),
132
132
  ...props
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DsPresentation } from '../lib/presets.js';
3
3
  import { NotificationTone, NotificationState } from './notifications.js';
4
+ import '../lib/header-control.js';
4
5
  import './tabs.js';
5
6
  import 'class-variance-authority/types';
6
7
  import '@base-ui/react/tabs';
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { HeaderControlTone } from '../lib/header-control.js';
2
3
  import { Tabs, TabsContent } from './tabs.js';
3
4
  import 'class-variance-authority/types';
4
5
  import '@base-ui/react/tabs';
@@ -7,7 +8,16 @@ import 'class-variance-authority';
7
8
  type NotificationTone = "info" | "success" | "warning" | "danger" | "neutral";
8
9
  type NotificationState = "new" | "acknowledged" | "resolved" | (string & {});
9
10
  type NotificationTab = "for-you" | "general" | "history";
10
- declare function NotificationCenter({ unreadCount, onMarkAllRead, title, open, defaultOpen, onOpenChange, align, className, triggerClassName, children, }: {
11
+ type NotificationCenterPreset = "count" | "dot" | "compact";
12
+ type NotificationIndicator = "count" | "dot" | "none";
13
+ declare function NotificationCenter({ preset, indicator, density, tone, unreadCount, onMarkAllRead, title, open, defaultOpen, onOpenChange, align, className, triggerClassName, children, }: {
14
+ preset?: NotificationCenterPreset;
15
+ /** Cómo se anuncian los avisos sin leer sobre la campana. */
16
+ indicator?: NotificationIndicator;
17
+ /** Ancho del panel: default (--ds-notifications-w) o compact. */
18
+ density?: "default" | "compact";
19
+ /** Color de la campana: neutral, con la marca o con fondo suave. */
20
+ tone?: HeaderControlTone;
11
21
  /** Avisos sin leer: contador de la campana y nombre accesible. */
12
22
  unreadCount?: number;
13
23
  /** Si se pasa, la cabecera muestra «Marcar todo como leído». */
@@ -68,4 +78,4 @@ declare function NotificationEmpty({ className, children, icon, ...props }: Reac
68
78
  icon?: React.ReactNode;
69
79
  }): React.JSX.Element;
70
80
 
71
- export { NotificationCenter, NotificationEmpty, NotificationItem, NotificationList, type NotificationState, type NotificationTab, NotificationTabs, NotificationTabsContent, type NotificationTone, formatRelativeTime };
81
+ export { NotificationCenter, type NotificationCenterPreset, NotificationEmpty, type NotificationIndicator, NotificationItem, NotificationList, type NotificationState, type NotificationTab, NotificationTabs, NotificationTabsContent, type NotificationTone, formatRelativeTime };
@@ -3,6 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { BellIcon, BellOffIcon } from "lucide-react";
4
4
  import * as React from "react";
5
5
  import { useDsLocale, useDsMessages } from "../hooks/use-ds-messages.js";
6
+ import { headerControlClass } from "../lib/header-control.js";
6
7
  import { dsFormat } from "../lib/i18n.js";
7
8
  import { cn } from "../lib/utils.js";
8
9
  import { Badge } from "./badge.js";
@@ -10,7 +11,16 @@ import { Button } from "./button.js";
10
11
  import { IconTile } from "./icon-tile.js";
11
12
  import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
12
13
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
14
+ const CENTER_PRESETS = {
15
+ count: { indicator: "count", density: "default" },
16
+ dot: { indicator: "dot", density: "default" },
17
+ compact: { indicator: "count", density: "compact" }
18
+ };
13
19
  function NotificationCenter({
20
+ preset = "count",
21
+ indicator,
22
+ density,
23
+ tone = "neutral",
14
24
  unreadCount = 0,
15
25
  onMarkAllRead,
16
26
  title,
@@ -23,6 +33,8 @@ function NotificationCenter({
23
33
  children
24
34
  }) {
25
35
  const t = useDsMessages();
36
+ const ind = indicator ?? CENTER_PRESETS[preset].indicator;
37
+ const dens = density ?? CENTER_PRESETS[preset].density;
26
38
  const unreadText = dsFormat(t.notificationsUnread, { n: unreadCount });
27
39
  const label = unreadCount > 0 ? `${t.notifications}, ${unreadText}` : t.notifications;
28
40
  return /* @__PURE__ */ jsxs(
@@ -36,25 +48,34 @@ function NotificationCenter({
36
48
  PopoverTrigger,
37
49
  {
38
50
  "data-slot": "notification-trigger",
51
+ "data-preset": preset,
39
52
  render: /* @__PURE__ */ jsx(
40
53
  Button,
41
54
  {
42
55
  variant: "ghost",
43
56
  size: "icon",
44
57
  "aria-label": label,
45
- className: cn("relative", triggerClassName)
58
+ className: cn("relative", headerControlClass(tone), triggerClassName)
46
59
  }
47
60
  ),
48
61
  children: [
49
62
  /* @__PURE__ */ jsx(BellIcon, {}),
50
- unreadCount > 0 ? /* @__PURE__ */ jsx(
63
+ unreadCount > 0 && ind === "count" ? /* @__PURE__ */ jsx(
51
64
  Badge,
52
65
  {
53
66
  "data-slot": "notification-count",
54
67
  "aria-hidden": "true",
55
- className: "pointer-events-none absolute -top-1 -end-1 min-w-5 justify-center px-1 py-0 tabular-nums",
68
+ className: "pointer-events-none absolute -top-1 -end-1 min-w-5 justify-center bg-(--ds-header-control-badge-bg) px-1 py-0 text-(--ds-header-control-badge-fg) tabular-nums",
56
69
  children: unreadCount > 99 ? "99+" : unreadCount
57
70
  }
71
+ ) : null,
72
+ unreadCount > 0 && ind === "dot" ? /* @__PURE__ */ jsx(
73
+ "span",
74
+ {
75
+ "data-slot": "notification-count-dot",
76
+ "aria-hidden": "true",
77
+ className: "pointer-events-none absolute top-1.5 end-1.5 size-(--ds-status-dot) rounded-full bg-(--ds-header-control-badge-bg)"
78
+ }
58
79
  ) : null
59
80
  ]
60
81
  }
@@ -63,10 +84,12 @@ function NotificationCenter({
63
84
  PopoverContent,
64
85
  {
65
86
  "data-slot": "notification-center",
87
+ "data-preset": preset,
88
+ "data-density": dens,
66
89
  align,
67
90
  "aria-label": t.notifications,
68
91
  className: cn(
69
- "w-(--ds-notifications-w) max-w-(--available-width) gap-0 p-0",
92
+ "w-(--ds-notifications-w) max-w-(--available-width) gap-0 p-0 data-[density=compact]:w-(--ds-notifications-w-compact)",
70
93
  className
71
94
  ),
72
95
  children: [
@@ -263,7 +286,7 @@ function NotificationItem({
263
286
  "span",
264
287
  {
265
288
  "data-slot": "notification-dot",
266
- className: "mt-1.5 size-(--ds-status-dot) shrink-0 rounded-full bg-primary",
289
+ className: "mt-1.5 size-(--ds-status-dot) shrink-0 rounded-full bg-(--ds-header-control-badge-bg)",
267
290
  children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: t.notificationUnread })
268
291
  }
269
292
  ) : null
@@ -13,6 +13,8 @@ import '@base-ui/react/tooltip';
13
13
  type SidebarPreset = "app" | "workspace" | "admin" | "focus";
14
14
  type SidebarVariant = "sidebar" | "floating" | "inset";
15
15
  type SidebarCollapsible = "offcanvas" | "icon" | "none";
16
+ type SidebarTone = "default" | "brand" | "contrast";
17
+ type SidebarIndicator = "fill" | "bar";
16
18
  type SidebarContextProps = {
17
19
  state: "expanded" | "collapsed";
18
20
  open: boolean;
@@ -28,7 +30,7 @@ declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: se
28
30
  open?: boolean;
29
31
  onOpenChange?: (open: boolean) => void;
30
32
  }): React.JSX.Element;
31
- declare function Sidebar({ side, preset, variant: variantProp, collapsible: collapsibleProp, density: densityProp, className, children, dir, ...props }: React.ComponentProps<"div"> & {
33
+ declare function Sidebar({ side, preset, variant: variantProp, collapsible: collapsibleProp, density: densityProp, tone, indicator, className, children, dir, ...props }: React.ComponentProps<"div"> & {
32
34
  side?: "left" | "right";
33
35
  /** Intención: fija variant, collapsible y density por defecto (las props explícitas mandan). */
34
36
  preset?: SidebarPreset;
@@ -36,10 +38,22 @@ declare function Sidebar({ side, preset, variant: variantProp, collapsible: coll
36
38
  collapsible?: SidebarCollapsible;
37
39
  /** Altura de las filas: compact (backoffice), default o comfortable. */
38
40
  density?: DsDensity;
41
+ /** Color del lateral: el del tema, el de la marca o invertido. */
42
+ tone?: SidebarTone;
43
+ /** Cómo se marca el destino activo: fondo o fondo y barra al inicio. */
44
+ indicator?: SidebarIndicator;
39
45
  }): React.JSX.Element;
40
46
  declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
41
47
  declare function SidebarRail({ className, ...props }: React.ComponentProps<"button">): React.JSX.Element;
42
- declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
48
+ type SidebarSurface = "floating" | "flat" | "glass";
49
+ /**
50
+ * Lienzo del contenido junto al lateral. Con `variant="inset"` flota con margen, radio y sombra.
51
+ * `surface`: floating (por defecto) · flat (sin sombra, con filete) · glass (translúcido con desenfoque).
52
+ * @note `glass` solo luce si hay algo detrás (fondo de la app o imagen); en el resto, `floating` o `flat`.
53
+ */
54
+ declare function SidebarInset({ className, surface, ...props }: React.ComponentProps<"main"> & {
55
+ surface?: SidebarSurface;
56
+ }): React.JSX.Element;
43
57
  declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
44
58
  declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
45
59
  declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
@@ -73,4 +87,4 @@ declare function SidebarMenuSubButton({ size, isActive, className, render, ...pr
73
87
  isActive?: boolean;
74
88
  }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
75
89
 
76
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, type SidebarPreset, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
90
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, type SidebarIndicator, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, type SidebarPreset, SidebarProvider, SidebarRail, SidebarSeparator, type SidebarSurface, type SidebarTone, SidebarTrigger, useSidebar };
@@ -31,6 +31,11 @@ const SIDEBAR_WIDTH = "var(--ds-sidebar-w)";
31
31
  const SIDEBAR_WIDTH_MOBILE = "var(--ds-sidebar-w-mobile)";
32
32
  const SIDEBAR_WIDTH_ICON = "var(--ds-sidebar-rail-w, 4rem)";
33
33
  const SIDEBAR_KEYBOARD_SHORTCUT = "b";
34
+ const SIDEBAR_TONE = {
35
+ default: "",
36
+ brand: "[--sidebar:var(--ds-sidebar-brand-bg)] [--sidebar-foreground:var(--ds-sidebar-brand-fg)] [--sidebar-accent:var(--ds-sidebar-brand-accent)] [--sidebar-accent-foreground:var(--ds-sidebar-brand-fg)] [--sidebar-border:var(--ds-sidebar-brand-border)] [--sidebar-primary:var(--ds-sidebar-brand-fg)] [--sidebar-primary-foreground:var(--ds-sidebar-brand-bg)] [--ds-sidebar-label:var(--ds-sidebar-brand-label)]",
37
+ contrast: "[--sidebar:var(--ds-sidebar-contrast-bg)] [--sidebar-foreground:var(--ds-sidebar-contrast-fg)] [--sidebar-accent:var(--ds-sidebar-contrast-accent)] [--sidebar-accent-foreground:var(--ds-sidebar-contrast-fg)] [--sidebar-border:var(--ds-sidebar-contrast-border)] [--sidebar-primary:var(--ds-sidebar-contrast-fg)] [--sidebar-primary-foreground:var(--ds-sidebar-contrast-bg)] [--ds-sidebar-label:var(--ds-sidebar-contrast-label)]"
38
+ };
34
39
  const SIDEBAR_PRESETS = {
35
40
  app: { variant: "floating", collapsible: "icon", density: "default" },
36
41
  workspace: { variant: "inset", collapsible: "icon", density: "default" },
@@ -126,6 +131,8 @@ function Sidebar({
126
131
  variant: variantProp,
127
132
  collapsible: collapsibleProp,
128
133
  density: densityProp,
134
+ tone = "default",
135
+ indicator = "fill",
129
136
  className,
130
137
  children,
131
138
  dir,
@@ -137,7 +144,8 @@ function Sidebar({
137
144
  const variant = variantProp ?? base.variant;
138
145
  const collapsible = collapsibleProp ?? base.collapsible;
139
146
  const density = densityProp ?? base.density;
140
- const hooks = { "data-preset": preset, "data-density": density };
147
+ const hooks = { "data-preset": preset, "data-density": density, "data-tone": tone, "data-indicator": indicator };
148
+ const look = cn(SIDEBAR_DENSITY[density], SIDEBAR_TONE[tone]);
141
149
  React.useEffect(() => {
142
150
  if (collapsible === "none" && variant !== "sidebar")
143
151
  dsWarn("Sidebar", `variant="${variant}" has no effect with collapsible="none" (a fixed panel is always flat).`);
@@ -151,8 +159,8 @@ function Sidebar({
151
159
  "data-slot": "sidebar",
152
160
  ...hooks,
153
161
  className: cn(
154
- "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
155
- SIDEBAR_DENSITY[density],
162
+ "group flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
163
+ look,
156
164
  className
157
165
  ),
158
166
  ...props,
@@ -170,7 +178,7 @@ function Sidebar({
170
178
  "data-slot": "sidebar",
171
179
  "data-mobile": "true",
172
180
  ...hooks,
173
- className: cn("w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", SIDEBAR_DENSITY[density]),
181
+ className: cn("group w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", look),
174
182
  style: {
175
183
  "--sidebar-width": SIDEBAR_WIDTH_MOBILE
176
184
  },
@@ -188,7 +196,7 @@ function Sidebar({
188
196
  return /* @__PURE__ */ jsxs(
189
197
  "div",
190
198
  {
191
- className: cn("group peer hidden text-sidebar-foreground md:block", SIDEBAR_DENSITY[density]),
199
+ className: cn("group peer hidden text-sidebar-foreground md:block", look),
192
200
  ...hooks,
193
201
  "data-state": state,
194
202
  "data-collapsible": state === "collapsed" ? collapsible : "",
@@ -287,13 +295,20 @@ function SidebarRail({ className, ...props }) {
287
295
  }
288
296
  );
289
297
  }
290
- function SidebarInset({ className, ...props }) {
298
+ const SIDEBAR_SURFACE = {
299
+ floating: "",
300
+ flat: "[--ds-canvas-shadow:var(--ds-canvas-flat-shadow)]",
301
+ glass: "[--ds-canvas-bg:var(--ds-canvas-glass-bg)] [--ds-canvas-blur:var(--ds-canvas-glass-blur)]"
302
+ };
303
+ function SidebarInset({ className, surface = "floating", ...props }) {
291
304
  return /* @__PURE__ */ jsx(
292
305
  "main",
293
306
  {
294
307
  "data-slot": "sidebar-inset",
308
+ "data-surface": surface,
295
309
  className: cn(
296
- "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-(--ds-sidebar-pad) md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-inset md:peer-data-[variant=inset]:shadow-raised md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-(--ds-sidebar-pad)",
310
+ "relative flex w-full flex-1 flex-col bg-(--ds-canvas-bg) backdrop-blur-(--ds-canvas-blur) md:peer-data-[variant=inset]:m-(--ds-sidebar-pad) md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-(--ds-canvas-radius) md:peer-data-[variant=inset]:shadow-(--ds-canvas-shadow) md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-(--ds-sidebar-pad)",
311
+ SIDEBAR_SURFACE[surface],
297
312
  className
298
313
  ),
299
314
  ...props
@@ -321,7 +336,7 @@ function SidebarHeader({ className, ...props }) {
321
336
  "data-slot": "sidebar-header",
322
337
  "data-sidebar": "header",
323
338
  className: cn(
324
- "flex flex-col gap-2 p-2",
339
+ "flex flex-col gap-2 p-2 group-data-[collapsible=icon]:items-center",
325
340
  className
326
341
  ),
327
342
  ...props
@@ -334,7 +349,7 @@ function SidebarFooter({ className, ...props }) {
334
349
  {
335
350
  "data-slot": "sidebar-footer",
336
351
  "data-sidebar": "footer",
337
- className: cn("flex flex-col gap-2 p-2", className),
352
+ className: cn("flex flex-col gap-2 p-2 group-data-[collapsible=icon]:items-center", className),
338
353
  ...props
339
354
  }
340
355
  );
@@ -459,7 +474,7 @@ function SidebarMenuItem({ className, ...props }) {
459
474
  );
460
475
  }
461
476
  const sidebarMenuButtonVariants = cva(
462
- "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,background-color,color] duration-(--ds-motion-snap) ease-(--ds-ease-standard) group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:mx-auto hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-(length:--ds-ring-width) active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-(--ds-disabled-opacity) aria-disabled:pointer-events-none aria-disabled:opacity-(--ds-disabled-opacity) data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-(--ds-nav-active-weight) data-[active=true]:text-sidebar-accent-foreground [&_svg]:shrink-0 [&>span:last-child]:truncate",
477
+ "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,background-color,color] duration-(--ds-motion-snap) ease-(--ds-ease-standard) group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:group-has-data-[sidebar=menu-action]/menu-item:pr-0 group-data-[collapsible=icon]:[&>div]:hidden group-data-[collapsible=icon]:[&>span:last-child:not([data-slot=avatar]):not([data-slot=icon-tile])]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-(length:--ds-ring-width) active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-(--ds-disabled-opacity) aria-disabled:pointer-events-none aria-disabled:opacity-(--ds-disabled-opacity) data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-(--ds-nav-active-weight) data-[active=true]:text-sidebar-accent-foreground group-data-[indicator=bar]:data-[active=true]:shadow-[inset_var(--ds-sidebar-bar-w)_0_0_0_var(--sidebar-primary)] [&_svg]:shrink-0 [&>span:last-child]:truncate",
463
478
  {
464
479
  variants: {
465
480
  variant: {
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { HeaderControlTone } from '../lib/header-control.js';
3
+
4
+ type ThemeMode = "light" | "dark" | "system";
5
+ type ThemeTogglePreset = "icon" | "cycle" | "segmented";
6
+ declare function ThemeToggle({ value, onValueChange, preset, tone, className, }: {
7
+ value?: ThemeMode;
8
+ onValueChange?: (value: ThemeMode) => void;
9
+ preset?: ThemeTogglePreset;
10
+ tone?: HeaderControlTone;
11
+ className?: string;
12
+ }): React.JSX.Element;
13
+
14
+ export { type ThemeMode, ThemeToggle, type ThemeTogglePreset };