orbital-ds 0.1.1 → 0.2.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 (100) hide show
  1. package/contract.json +38 -0
  2. package/dist/styles.css +89 -9
  3. package/dist/themes/zyro.css +189 -0
  4. package/dist/ui/accordion.d.ts +9 -0
  5. package/dist/ui/accordion.js +79 -0
  6. package/dist/ui/alert-dialog.d.ts +23 -0
  7. package/dist/ui/alert-dialog.js +173 -0
  8. package/dist/ui/alert.d.ts +13 -0
  9. package/dist/ui/alert.js +77 -0
  10. package/dist/ui/aspect-ratio.d.ts +7 -0
  11. package/dist/ui/aspect-ratio.js +22 -0
  12. package/dist/ui/attachment.d.ts +26 -0
  13. package/dist/ui/attachment.js +197 -0
  14. package/dist/ui/avatar.js +1 -1
  15. package/dist/ui/badge.d.ts +1 -1
  16. package/dist/ui/badge.js +1 -1
  17. package/dist/ui/bubble.d.ts +19 -0
  18. package/dist/ui/bubble.js +115 -0
  19. package/dist/ui/button-group.d.ts +15 -0
  20. package/dist/ui/button-group.js +82 -0
  21. package/dist/ui/button.d.ts +5 -3
  22. package/dist/ui/button.js +9 -6
  23. package/dist/ui/calendar.d.ts +15 -0
  24. package/dist/ui/calendar.js +190 -0
  25. package/dist/ui/card.js +4 -4
  26. package/dist/ui/carousel.d.ts +33 -0
  27. package/dist/ui/carousel.js +199 -0
  28. package/dist/ui/checkbox.js +1 -1
  29. package/dist/ui/combobox.d.ts +26 -0
  30. package/dist/ui/combobox.js +281 -0
  31. package/dist/ui/command.d.ts +22 -0
  32. package/dist/ui/command.js +183 -0
  33. package/dist/ui/context-menu.d.ts +31 -0
  34. package/dist/ui/context-menu.js +242 -0
  35. package/dist/ui/dialog.js +2 -2
  36. package/dist/ui/direction.d.ts +1 -0
  37. package/dist/ui/direction.js +8 -0
  38. package/dist/ui/drawer.d.ts +18 -0
  39. package/dist/ui/drawer.js +208 -0
  40. package/dist/ui/dropdown-menu.d.ts +1 -1
  41. package/dist/ui/dropdown-menu.js +13 -9
  42. package/dist/ui/empty.d.ts +15 -0
  43. package/dist/ui/empty.js +102 -0
  44. package/dist/ui/field.d.ts +28 -0
  45. package/dist/ui/field.js +217 -0
  46. package/dist/ui/hover-card.d.ts +8 -0
  47. package/dist/ui/hover-card.js +45 -0
  48. package/dist/ui/input-group.d.ts +22 -0
  49. package/dist/ui/input-group.js +145 -0
  50. package/dist/ui/input-otp.d.ts +13 -0
  51. package/dist/ui/input-otp.js +82 -0
  52. package/dist/ui/input.js +1 -1
  53. package/dist/ui/item.d.ts +26 -0
  54. package/dist/ui/item.js +195 -0
  55. package/dist/ui/kbd.d.ts +6 -0
  56. package/dist/ui/kbd.js +29 -0
  57. package/dist/ui/marker.d.ts +13 -0
  58. package/dist/ui/marker.js +71 -0
  59. package/dist/ui/menubar.d.ts +31 -0
  60. package/dist/ui/menubar.js +259 -0
  61. package/dist/ui/message-scroller.d.ts +16 -0
  62. package/dist/ui/message-scroller.js +120 -0
  63. package/dist/ui/message.d.ts +12 -0
  64. package/dist/ui/message.js +90 -0
  65. package/dist/ui/native-select.d.ts +10 -0
  66. package/dist/ui/native-select.js +63 -0
  67. package/dist/ui/navigation-menu.d.ts +15 -0
  68. package/dist/ui/navigation-menu.js +162 -0
  69. package/dist/ui/pagination.d.ts +22 -0
  70. package/dist/ui/pagination.js +128 -0
  71. package/dist/ui/popover.js +2 -2
  72. package/dist/ui/questionnaire.d.ts +24 -0
  73. package/dist/ui/questionnaire.js +331 -0
  74. package/dist/ui/radio-group.d.ts +8 -0
  75. package/dist/ui/radio-group.js +39 -0
  76. package/dist/ui/resizable.d.ts +10 -0
  77. package/dist/ui/resizable.js +46 -0
  78. package/dist/ui/scroll-area.js +1 -1
  79. package/dist/ui/select.js +5 -5
  80. package/dist/ui/sheet.js +4 -4
  81. package/dist/ui/sidebar.js +4 -4
  82. package/dist/ui/slider.d.ts +6 -0
  83. package/dist/ui/slider.js +53 -0
  84. package/dist/ui/spinner.d.ts +5 -0
  85. package/dist/ui/spinner.js +9 -0
  86. package/dist/ui/switch.d.ts +8 -0
  87. package/dist/ui/switch.js +32 -0
  88. package/dist/ui/table.js +2 -2
  89. package/dist/ui/tabs.js +1 -1
  90. package/dist/ui/textarea.js +1 -1
  91. package/dist/ui/toast.d.ts +19 -0
  92. package/dist/ui/toast.js +193 -0
  93. package/dist/ui/toggle-group.d.ts +14 -0
  94. package/dist/ui/toggle-group.js +77 -0
  95. package/dist/ui/toggle.d.ts +12 -0
  96. package/dist/ui/toggle.js +43 -0
  97. package/dist/ui/tooltip.js +3 -3
  98. package/docs/CONTRACT.md +113 -0
  99. package/package.json +133 -95
  100. package/scripts/doctor.mjs +142 -0
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
4
+ import { cn } from "../lib/utils";
5
+ function Switch({
6
+ className,
7
+ size = "default",
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(
11
+ SwitchPrimitive.Root,
12
+ {
13
+ "data-slot": "switch",
14
+ "data-size": size,
15
+ className: cn(
16
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
17
+ className
18
+ ),
19
+ ...props,
20
+ children: /* @__PURE__ */ jsx(
21
+ SwitchPrimitive.Thumb,
22
+ {
23
+ "data-slot": "switch-thumb",
24
+ className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
25
+ }
26
+ )
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ Switch
32
+ };
package/dist/ui/table.js CHANGED
@@ -69,7 +69,7 @@ function TableHead({ className, ...props }) {
69
69
  {
70
70
  "data-slot": "table-head",
71
71
  className: cn(
72
- "h-12 px-3 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
72
+ "h-12 px-(--ds-cell-p) text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
73
73
  className
74
74
  ),
75
75
  ...props
@@ -82,7 +82,7 @@ function TableCell({ className, ...props }) {
82
82
  {
83
83
  "data-slot": "table-cell",
84
84
  className: cn(
85
- "p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
85
+ "p-(--ds-cell-p) align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
86
86
  className
87
87
  ),
88
88
  ...props
package/dist/ui/tabs.js CHANGED
@@ -56,7 +56,7 @@ function TabsTrigger({ className, ...props }) {
56
56
  {
57
57
  "data-slot": "tabs-trigger",
58
58
  className: cn(
59
- "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start group-data-[orientation=vertical]/tabs:px-2.5 group-data-[orientation=vertical]/tabs:py-1.5 hover:text-foreground focus-visible:border-ring focus-visible:ring-(length:--ring-width) focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
59
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start group-data-[orientation=vertical]/tabs:px-2.5 group-data-[orientation=vertical]/tabs:py-1.5 hover:text-foreground focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
60
60
  "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
61
61
  "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
62
62
  "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
@@ -6,7 +6,7 @@ function Textarea({ className, ...props }) {
6
6
  {
7
7
  "data-slot": "textarea",
8
8
  className: cn(
9
- "min-h-16 w-full min-w-0 rounded-md border border-input bg-input/30 px-3 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-(length:--ring-width) focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-(length:--ring-width) aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
9
+ "min-h-16 w-full min-w-0 rounded-md border border-input bg-input/30 px-(--ds-field-px) py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
10
10
  className
11
11
  ),
12
12
  ...props
@@ -0,0 +1,19 @@
1
+ import * as _base_ui_react from '@base-ui/react';
2
+ import * as React from 'react';
3
+ import { Toast as Toast$1 } from '@base-ui/react/toast';
4
+
5
+ declare const toast: _base_ui_react.ToastManager<any>;
6
+ declare function ToastProvider({ ...props }: Toast$1.Provider.Props): React.JSX.Element;
7
+ declare function ToastPortal({ ...props }: Toast$1.Portal.Props): React.JSX.Element;
8
+ declare function ToastViewport({ className, ...props }: Toast$1.Viewport.Props): React.JSX.Element;
9
+ declare function Toast({ className, ...props }: Toast$1.Root.Props): React.JSX.Element;
10
+ declare function ToastContent({ className, ...props }: Toast$1.Content.Props): React.JSX.Element;
11
+ declare function ToastTitle({ className, ...props }: Toast$1.Title.Props): React.JSX.Element;
12
+ declare function ToastDescription({ className, ...props }: Toast$1.Description.Props): React.JSX.Element;
13
+ declare function ToastAction({ className, render, ...props }: Toast$1.Action.Props): React.JSX.Element;
14
+ declare function ToastClose({ className, children, render, ...props }: Toast$1.Close.Props): React.JSX.Element;
15
+ declare function Toaster({ children, toastManager, ...props }: Toast$1.Provider.Props): React.JSX.Element;
16
+ declare const createToastManager: typeof Toast$1.createToastManager;
17
+ declare const useToastManager: typeof Toast$1.useToastManager;
18
+
19
+ export { Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, createToastManager, toast, useToastManager };
@@ -0,0 +1,193 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
4
+ import { cn } from "../lib/utils";
5
+ import { Button } from "./button";
6
+ import { XIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react";
7
+ const toast = ToastPrimitive.createToastManager();
8
+ function ToastProvider({ ...props }) {
9
+ return /* @__PURE__ */ jsx(ToastPrimitive.Provider, { ...props });
10
+ }
11
+ function ToastPortal({ ...props }) {
12
+ return /* @__PURE__ */ jsx(ToastPrimitive.Portal, { "data-slot": "toast-portal", ...props });
13
+ }
14
+ function ToastViewport({ className, ...props }) {
15
+ return /* @__PURE__ */ jsx(
16
+ ToastPrimitive.Viewport,
17
+ {
18
+ "data-slot": "toast-viewport",
19
+ className: cn(
20
+ "pointer-events-none fixed inset-x-4 bottom-4 z-(--ds-z-overlay) mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",
21
+ className
22
+ ),
23
+ ...props
24
+ }
25
+ );
26
+ }
27
+ function Toast({ className, ...props }) {
28
+ return /* @__PURE__ */ jsx(
29
+ ToastPrimitive.Root,
30
+ {
31
+ "data-slot": "toast",
32
+ className: cn(
33
+ "group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border bg-popover text-popover-foreground shadow-overlay will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50",
34
+ "[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]",
35
+ "h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]",
36
+ "after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']",
37
+ "data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]",
38
+ "data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]",
39
+ "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]",
40
+ "data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]",
41
+ "data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]",
42
+ "data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]",
43
+ "data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",
44
+ "data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]",
45
+ "data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]",
46
+ "data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]",
47
+ "data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",
48
+ className
49
+ ),
50
+ ...props
51
+ }
52
+ );
53
+ }
54
+ function ToastContent({ className, ...props }) {
55
+ return /* @__PURE__ */ jsx(
56
+ ToastPrimitive.Content,
57
+ {
58
+ "data-slot": "toast-content",
59
+ className: cn(
60
+ "flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-(--ds-motion-base) ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",
61
+ className
62
+ ),
63
+ ...props
64
+ }
65
+ );
66
+ }
67
+ function ToastTitle({ className, ...props }) {
68
+ return /* @__PURE__ */ jsx(
69
+ ToastPrimitive.Title,
70
+ {
71
+ "data-slot": "toast-title",
72
+ className: cn("text-sm font-medium", className),
73
+ ...props
74
+ }
75
+ );
76
+ }
77
+ function ToastDescription({
78
+ className,
79
+ ...props
80
+ }) {
81
+ return /* @__PURE__ */ jsx(
82
+ ToastPrimitive.Description,
83
+ {
84
+ "data-slot": "toast-description",
85
+ className: cn("text-sm text-muted-foreground", className),
86
+ ...props
87
+ }
88
+ );
89
+ }
90
+ function ToastAction({
91
+ className,
92
+ render = /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm" }),
93
+ ...props
94
+ }) {
95
+ return /* @__PURE__ */ jsx(
96
+ ToastPrimitive.Action,
97
+ {
98
+ "data-slot": "toast-action",
99
+ render,
100
+ className: cn("shrink-0", className),
101
+ ...props
102
+ }
103
+ );
104
+ }
105
+ function ToastClose({
106
+ className,
107
+ children,
108
+ render = /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm" }),
109
+ ...props
110
+ }) {
111
+ return /* @__PURE__ */ jsx(
112
+ ToastPrimitive.Close,
113
+ {
114
+ "data-slot": "toast-close",
115
+ "aria-label": "Close toast",
116
+ render,
117
+ className: cn(
118
+ "relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",
119
+ className
120
+ ),
121
+ ...props,
122
+ children: children ?? /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" })
123
+ }
124
+ );
125
+ }
126
+ function ToastIcon({ type }) {
127
+ let icon = null;
128
+ if (type === "success") {
129
+ icon = /* @__PURE__ */ jsx(CircleCheckIcon, { "aria-hidden": "true" });
130
+ }
131
+ if (type === "info") {
132
+ icon = /* @__PURE__ */ jsx(InfoIcon, { "aria-hidden": "true" });
133
+ }
134
+ if (type === "warning") {
135
+ icon = /* @__PURE__ */ jsx(TriangleAlertIcon, { "aria-hidden": "true" });
136
+ }
137
+ if (type === "error") {
138
+ icon = /* @__PURE__ */ jsx(OctagonXIcon, { className: "text-destructive", "aria-hidden": "true" });
139
+ }
140
+ if (type === "loading") {
141
+ icon = /* @__PURE__ */ jsx(Loader2Icon, { className: "animate-spin", "aria-hidden": "true" });
142
+ }
143
+ if (!icon) {
144
+ return null;
145
+ }
146
+ return /* @__PURE__ */ jsx(
147
+ "span",
148
+ {
149
+ "data-slot": "toast-icon",
150
+ className: "shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
151
+ children: icon
152
+ }
153
+ );
154
+ }
155
+ function ToastList() {
156
+ const { toasts } = ToastPrimitive.useToastManager();
157
+ return toasts.map((toastItem) => /* @__PURE__ */ jsx(Toast, { toast: toastItem, children: /* @__PURE__ */ jsxs(ToastContent, { children: [
158
+ /* @__PURE__ */ jsx(ToastIcon, { type: toastItem.type }),
159
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
160
+ /* @__PURE__ */ jsx(ToastTitle, {}),
161
+ /* @__PURE__ */ jsx(ToastDescription, {})
162
+ ] }),
163
+ /* @__PURE__ */ jsx(ToastAction, {}),
164
+ /* @__PURE__ */ jsx(ToastClose, {})
165
+ ] }) }, toastItem.id));
166
+ }
167
+ function Toaster({
168
+ children,
169
+ toastManager = toast,
170
+ ...props
171
+ }) {
172
+ return /* @__PURE__ */ jsxs(ToastProvider, { toastManager, ...props, children: [
173
+ children,
174
+ /* @__PURE__ */ jsx(ToastPortal, { children: /* @__PURE__ */ jsx(ToastViewport, { children: /* @__PURE__ */ jsx(ToastList, {}) }) })
175
+ ] });
176
+ }
177
+ const createToastManager = ToastPrimitive.createToastManager;
178
+ const useToastManager = ToastPrimitive.useToastManager;
179
+ export {
180
+ Toast,
181
+ ToastAction,
182
+ ToastClose,
183
+ ToastContent,
184
+ ToastDescription,
185
+ ToastPortal,
186
+ ToastProvider,
187
+ ToastTitle,
188
+ ToastViewport,
189
+ Toaster,
190
+ createToastManager,
191
+ toast,
192
+ useToastManager
193
+ };
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { Toggle } from '@base-ui/react/toggle';
3
+ import { ToggleGroup as ToggleGroup$1 } from '@base-ui/react/toggle-group';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { toggleVariants } from './toggle.js';
6
+ import 'class-variance-authority/types';
7
+
8
+ declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroup$1.Props & VariantProps<typeof toggleVariants> & {
9
+ spacing?: number;
10
+ orientation?: "horizontal" | "vertical";
11
+ }): React.JSX.Element;
12
+ declare function ToggleGroupItem({ className, children, variant, size, ...props }: Toggle.Props & VariantProps<typeof toggleVariants>): React.JSX.Element;
13
+
14
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,77 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
4
+ import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
5
+ import { cn } from "../lib/utils";
6
+ import { toggleVariants } from "./toggle";
7
+ const ToggleGroupContext = React.createContext({
8
+ size: "default",
9
+ variant: "default",
10
+ spacing: 2,
11
+ orientation: "horizontal"
12
+ });
13
+ function ToggleGroup({
14
+ className,
15
+ variant,
16
+ size,
17
+ spacing = 2,
18
+ orientation = "horizontal",
19
+ children,
20
+ ...props
21
+ }) {
22
+ return /* @__PURE__ */ jsx(
23
+ ToggleGroupPrimitive,
24
+ {
25
+ "data-slot": "toggle-group",
26
+ "data-variant": variant,
27
+ "data-size": size,
28
+ "data-spacing": spacing,
29
+ "data-orientation": orientation,
30
+ style: { "--gap": spacing },
31
+ className: cn(
32
+ "group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[spacing=0]:data-[variant=outline]:rounded-control data-vertical:flex-col data-vertical:items-stretch",
33
+ className
34
+ ),
35
+ ...props,
36
+ children: /* @__PURE__ */ jsx(
37
+ ToggleGroupContext.Provider,
38
+ {
39
+ value: { variant, size, spacing, orientation },
40
+ children
41
+ }
42
+ )
43
+ }
44
+ );
45
+ }
46
+ function ToggleGroupItem({
47
+ className,
48
+ children,
49
+ variant = "default",
50
+ size = "default",
51
+ ...props
52
+ }) {
53
+ const context = React.useContext(ToggleGroupContext);
54
+ return /* @__PURE__ */ jsx(
55
+ TogglePrimitive,
56
+ {
57
+ "data-slot": "toggle-group-item",
58
+ "data-variant": context.variant || variant,
59
+ "data-size": context.size || size,
60
+ "data-spacing": context.spacing,
61
+ className: cn(
62
+ "shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-3 group-data-[spacing=0]/toggle-group:shadow-none focus:z-(--ds-z-raised) focus-visible:z-(--ds-z-raised) group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-2.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-2.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-3xl group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-3xl group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-3xl group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-3xl data-[state=on]:bg-muted group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
63
+ toggleVariants({
64
+ variant: context.variant || variant,
65
+ size: context.size || size
66
+ }),
67
+ className
68
+ ),
69
+ ...props,
70
+ children
71
+ }
72
+ );
73
+ }
74
+ export {
75
+ ToggleGroup,
76
+ ToggleGroupItem
77
+ };
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { Toggle as Toggle$1 } from '@base-ui/react/toggle';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const toggleVariants: (props?: ({
7
+ variant?: "default" | "outline" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Toggle({ className, variant, size, ...props }: Toggle$1.Props & VariantProps<typeof toggleVariants>): React.JSX.Element;
11
+
12
+ export { Toggle, toggleVariants };
@@ -0,0 +1,43 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../lib/utils";
5
+ const toggleVariants = cva(
6
+ "group/toggle inline-flex items-center justify-center gap-1 rounded-control text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-transparent",
11
+ outline: "border border-input bg-transparent hover:bg-muted"
12
+ },
13
+ size: {
14
+ default: "h-9 min-w-9 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
15
+ sm: "h-8 min-w-8 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
16
+ lg: "h-10 min-w-10 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3"
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "default",
21
+ size: "default"
22
+ }
23
+ }
24
+ );
25
+ function Toggle({
26
+ className,
27
+ variant = "default",
28
+ size = "default",
29
+ ...props
30
+ }) {
31
+ return /* @__PURE__ */ jsx(
32
+ TogglePrimitive,
33
+ {
34
+ "data-slot": "toggle",
35
+ className: cn(toggleVariants({ variant, size, className })),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ Toggle,
42
+ toggleVariants
43
+ };
@@ -36,19 +36,19 @@ function TooltipContent({
36
36
  alignOffset,
37
37
  side,
38
38
  sideOffset,
39
- className: "isolate z-(--z-overlay)",
39
+ className: "isolate z-(--ds-z-overlay)",
40
40
  children: /* @__PURE__ */ jsxs(
41
41
  TooltipPrimitive.Popup,
42
42
  {
43
43
  "data-slot": "tooltip-content",
44
44
  className: cn(
45
- "z-(--z-overlay) inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-2xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-(--z-overlay) **:data-[slot=kbd]:rounded-control data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
45
+ "z-(--ds-z-overlay) inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-2xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-(--ds-z-overlay) **:data-[slot=kbd]:rounded-control data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
46
46
  className
47
47
  ),
48
48
  ...props,
49
49
  children: [
50
50
  children,
51
- /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "z-(--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, { 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
  )
@@ -0,0 +1,113 @@
1
+ # Contrato de tema de orbital-ds
2
+
3
+ Un **tema** es un fichero CSS (`themes/<nombre>.css`) que da valores a un conjunto
4
+ cerrado de variables. Los componentes **solo** leen esas variables: ninguno lleva
5
+ colores, medidas, sombras, capas ni duraciones escritos a mano. Por eso cambiar de
6
+ tema cambia todo el aspecto sin tocar un componente.
7
+
8
+ El contrato vive en [`contract.json`](../contract.json) y lo comprueba
9
+ `pnpm doctor` (que forma parte de `pnpm verify`): si a un tema le falta un token
10
+ obligatorio, el build falla.
11
+
12
+ ## Cómo se usa
13
+
14
+ ```css
15
+ @import 'tailwindcss';
16
+ @import 'tw-animate-css';
17
+
18
+ @import 'orbital-ds/styles.css'; /* 1. la ESTRUCTURA común */
19
+ @import 'orbital-ds/themes/qratia.css'; /* 2. un TEMA (después, para poder sobrescribir) */
20
+
21
+ @source '../node_modules/orbital-ds/dist'; /* que Tailwind vea las clases del paquete */
22
+ ```
23
+
24
+ El tema se importa **después** de la estructura: así puede sobrescribir también la
25
+ escala de radios y las sombras, que viven en `@theme`.
26
+
27
+ Para ajustar un valor sin crear un tema, se sobrescribe la variable al final:
28
+
29
+ ```css
30
+ :root { --primary: oklch(0.55 0.2 260); }
31
+ ```
32
+
33
+ ## Tokens obligatorios (todo tema, en `:root`)
34
+
35
+ | Grupo | Tokens |
36
+ |---|---|
37
+ | Forma | `--radius` |
38
+ | Superficies y texto | `--background`, `--foreground`, `--card`, `--card-foreground`, `--popover`, `--popover-foreground` |
39
+ | Acción | `--primary`, `--primary-foreground`, `--secondary`, `--secondary-foreground`, `--accent`, `--accent-foreground` |
40
+ | Atenuado | `--muted`, `--muted-foreground` |
41
+ | Destructivo | `--destructive`, `--destructive-foreground` |
42
+ | Líneas y foco | `--border`, `--input`, `--ring` |
43
+ | Gráficos | `--chart-1` … `--chart-5` |
44
+ | Sidebar | `--sidebar`, `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-primary-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring` |
45
+ | Estados | `--danger`, `--warning`, `--success`, `--info`, `--neutral` y cada uno con su `-soft` |
46
+ | Texto acentuado | `--link`, `--link-hover` |
47
+ | Superficie hundida | `--inset`, `--inset-foreground` |
48
+ | Marca | `--brand`, `--brand-bright` |
49
+ | Tipografía | `--font-sans` (en `:root` o en `@theme`) |
50
+
51
+ En `.dark` se redefine lo que cambie; `doctor` avisa (no falla) de los tokens
52
+ principales que se hereden de la piel clara.
53
+
54
+ `--destructive` es el rojo de **acciones** (botón de borrar); `--danger` es el rojo
55
+ de **estado** (etiqueta de nivel crítico). Pueden coincidir, pero son huecos distintos.
56
+
57
+ ## Tokens con valor por defecto (el tema los puede cambiar)
58
+
59
+ Los define la estructura con un valor neutro; un tema los sobrescribe si quiere.
60
+
61
+ | Hueco | Variables |
62
+ |---|---|
63
+ | Radios semánticos | `--radius-control`, `--radius-overlay` (y la rampa `--radius-sm … 2xl`, derivada de `--radius`) |
64
+ | Sombras | `--shadow-card`, `--shadow-card-hover`, `--shadow-control`, `--shadow-raised`, `--shadow-overlay`, `--shadow-popover` |
65
+ | Altura de controles | `--ds-control-h-sm`, `-md`, `-lg` |
66
+ | Espaciado interno | `--ds-card-spacing`, `--ds-card-spacing-sm`, `--ds-field-px`, `--ds-cell-p`, `--ds-overlay-p`, `--ds-overlay-gap`, `--ds-popover-p`, `--ds-menu-p`, `--ds-menu-item-px`, `--ds-menu-item-py`, `--ds-button-px-sm/md/lg`, `--ds-badge-px` |
67
+ | Capas | `--ds-z-raised`, `--ds-z-sticky`, `--ds-z-overlay` |
68
+ | Movimiento | `--ds-motion-fast`, `--ds-motion-base`, `--ds-motion-slow`, `--ds-motion-blink` |
69
+ | Foco | `--ds-ring-width` |
70
+ | Velo | `--color-scrim` |
71
+ | **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`) |
72
+
73
+ Los **materiales** son lo que hace posible un tema de cristal como `zyro`: con valores
74
+ neutros no hay efecto ni coste; con `blur(28px) saturate(180%)` las superficies se
75
+ vuelven translúcidas.
76
+
77
+ ## Reglas de nombres
78
+
79
+ - Todo en **inglés**: tokens, props y valores de variantes.
80
+ - Los nombres que Tailwind convierte en utilidades (`--color-*`, `--radius-*`,
81
+ `--shadow-*`) siguen su convención y **no llevan prefijo**. El resto de variables
82
+ propias llevan el prefijo **`--ds-`** para no chocar con las de una app.
83
+ - Un componente que necesite un hueco nuevo **añade el token** con un valor que deje
84
+ el aspecto como estaba; nunca escribe el valor en el componente.
85
+
86
+ ## Qué comprueba `pnpm doctor`
87
+
88
+ 1. **Contrato**: cada tema define todos los tokens obligatorios.
89
+ 2. **Repetidos**: ninguna variable se define dos veces en el mismo bloque.
90
+ 3. **Valores fijos** en `src/ui/*.tsx`: colores literales (hex, `rgb()`, `oklch()`
91
+ salvo derivados de un token), `z-<n>`, `duration-<n>`, `bg-black`/`bg-white`,
92
+ sombras de la escala de Tailwind, `text-[<n>px]`, radios fuera de la rampa y
93
+ colores de la paleta de Tailwind.
94
+
95
+ También se puede pasar el CSS de una app: `orbital-ds-doctor --css src/styles.css`
96
+ (detecta variables repetidas).
97
+
98
+ ## Crear un tema nuevo
99
+
100
+ 1. Copia `themes/qratia.css` (o `zyro.css`) a `themes/<nombre>.css`.
101
+ 2. Cambia los valores; no quites ninguno.
102
+ 3. `pnpm doctor`: te dice qué falta.
103
+ 4. Opcional: usa los materiales para dar cristal, relieve o un fondo propio.
104
+
105
+ Se puede partir de un tema de shadcn (por ejemplo exportado desde tweakcn): usa los
106
+ mismos nombres estándar (`--background`, `--primary`…). Habrá que añadir los tokens
107
+ propios (`danger`, `warning`, `success`, `info`, `neutral`, `link`, `inset`, `brand`).
108
+
109
+ ## Cosas que un tema NO puede cambiar
110
+
111
+ La **anatomía** de un componente (otro diseño de sidebar o de tarjeta) no es un valor,
112
+ es estructura: se resuelve con variantes del componente. Un fondo animado (como la
113
+ malla WebGL de zyro) es código, no una variable: se ofrece como componente opcional.