@sviy/ui 0.0.0-stage → 0.0.9
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/README.md +142 -2
- package/index.ts +61 -0
- package/package.json +44 -4
- package/src/components/ui/alert/Alert.vue +21 -0
- package/src/components/ui/alert/AlertAction.vue +17 -0
- package/src/components/ui/alert/AlertDescription.vue +17 -0
- package/src/components/ui/alert/AlertTitle.vue +17 -0
- package/src/components/ui/alert/index.ts +21 -0
- package/src/components/ui/avatar/Avatar.vue +22 -0
- package/src/components/ui/avatar/AvatarBadge.vue +23 -0
- package/src/components/ui/avatar/AvatarFallback.vue +21 -0
- package/src/components/ui/avatar/AvatarGroup.vue +20 -0
- package/src/components/ui/avatar/AvatarGroupCount.vue +20 -0
- package/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/src/components/ui/avatar/index.ts +27 -0
- package/src/components/ui/badge/Badge.vue +27 -0
- package/src/components/ui/badge/index.ts +24 -0
- package/src/components/ui/button/Button.vue +31 -0
- package/src/components/ui/button/index.ts +35 -0
- package/src/components/ui/card/Card.vue +21 -0
- package/src/components/ui/card/CardAction.vue +17 -0
- package/src/components/ui/card/CardContent.vue +17 -0
- package/src/components/ui/card/CardDescription.vue +17 -0
- package/src/components/ui/card/CardFooter.vue +17 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +17 -0
- package/src/components/ui/card/index.ts +7 -0
- package/src/components/ui/checkbox/Checkbox.vue +34 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +15 -0
- package/src/components/ui/dialog/DialogContent.vue +53 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +27 -0
- package/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/src/components/ui/dialog/DialogOverlay.vue +21 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +60 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +15 -0
- package/src/components/ui/dialog/index.ts +10 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +43 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +44 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +32 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/src/components/ui/dropdown-menu/index.ts +16 -0
- package/src/components/ui/input/Input.vue +31 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/label/Label.vue +26 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/progress/Progress.vue +38 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +58 -0
- package/src/components/ui/select/SelectGroup.vue +21 -0
- package/src/components/ui/select/SelectItem.vue +45 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +27 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +27 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +34 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +29 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/sonner/Sonner.vue +62 -0
- package/src/components/ui/sonner/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +44 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +16 -0
- package/src/components/ui/table/TableBody.vue +17 -0
- package/src/components/ui/table/TableCaption.vue +17 -0
- package/src/components/ui/table/TableCell.vue +17 -0
- package/src/components/ui/table/TableEmpty.vue +34 -0
- package/src/components/ui/table/TableFooter.vue +17 -0
- package/src/components/ui/table/TableHead.vue +17 -0
- package/src/components/ui/table/TableHeader.vue +17 -0
- package/src/components/ui/table/TableRow.vue +17 -0
- package/src/components/ui/table/index.ts +9 -0
- package/src/components/ui/tabs/Tabs.vue +25 -0
- package/src/components/ui/tabs/TabsContent.vue +21 -0
- package/src/components/ui/tabs/TabsList.vue +29 -0
- package/src/components/ui/tabs/TabsTrigger.vue +29 -0
- package/src/components/ui/tabs/index.ts +24 -0
- package/src/components/ui/textarea/Textarea.vue +28 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +34 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/lib/utils.ts +1 -0
- package/theme.css +223 -0
package/theme.css
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @sviy/ui — house theme.
|
|
3
|
+
*
|
|
4
|
+
* Consumers import this ONCE, immediately after Tailwind:
|
|
5
|
+
*
|
|
6
|
+
* @import "tailwindcss";
|
|
7
|
+
* @import "@sviy/ui/theme.css";
|
|
8
|
+
* @source "../node_modules/@sviy/ui";
|
|
9
|
+
*
|
|
10
|
+
* This file deliberately does NOT import tailwindcss — the consuming app owns
|
|
11
|
+
* that, so it controls the Tailwind version and the scan roots.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/* House typeface, self-hosted. Fonts must not come from a third-party CDN: a
|
|
15
|
+
Cloudron app should make no external request at runtime, so the faces are
|
|
16
|
+
vendored via @fontsource and bundled. */
|
|
17
|
+
@import "@fontsource/ibm-plex-sans/latin-400.css";
|
|
18
|
+
@import "@fontsource/ibm-plex-sans/latin-500.css";
|
|
19
|
+
@import "@fontsource/ibm-plex-sans/latin-600.css";
|
|
20
|
+
|
|
21
|
+
/* Component enter/leave animations (Dialog, Select, ...). Owned by the kit
|
|
22
|
+
because the kit's components are what depend on it. */
|
|
23
|
+
@import "tw-animate-css";
|
|
24
|
+
|
|
25
|
+
/* Base stylesheet for the Toaster (sonner). Same reasoning: the kit does not
|
|
26
|
+
make the app remember a second CSS import for one component. */
|
|
27
|
+
@import "vue-sonner/style.css";
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* Scan the kit's own component source for utility classes. Tailwind does not
|
|
31
|
+
* look inside node_modules by default, and this file lives at the package
|
|
32
|
+
* root, so `./src` resolves to the installed copy wherever it lands. Keeping
|
|
33
|
+
* the directive here means a consuming app needs only two CSS lines and cannot
|
|
34
|
+
* forget it.
|
|
35
|
+
*/
|
|
36
|
+
@source "./src";
|
|
37
|
+
|
|
38
|
+
/* Dark mode is CLASS-based, not `prefers-color-scheme`. One switch, no media
|
|
39
|
+
queries: an agent editing a component's light styling cannot silently break
|
|
40
|
+
dark mode, because `dark:` variants sit next to the light classes. The app
|
|
41
|
+
toggles `.dark` on <html>. */
|
|
42
|
+
@custom-variant dark (&:is(.dark *));
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* Reka attribute variants.
|
|
46
|
+
*
|
|
47
|
+
* Tailwind v4 has no bare `data-*` variant: `data-open:` compiles to the
|
|
48
|
+
* literal attribute selector `[data-open]`. Reka never writes those attribute
|
|
49
|
+
* names — it signals state through `data-state` and orientation through
|
|
50
|
+
* `data-orientation`. So without the declarations below, every `data-open:` /
|
|
51
|
+
* `data-closed:` / `data-checked:` / `data-unchecked:` / `data-horizontal:` /
|
|
52
|
+
* `data-vertical:` class in the kit is dead styling, and it fails SILENTLY:
|
|
53
|
+
* the build succeeds and the CSS is simply never matched.
|
|
54
|
+
*
|
|
55
|
+
* These registrations cover `group-` / `peer-` forms too, so
|
|
56
|
+
* `group-data-vertical/tabs:flex-col` resolves as well.
|
|
57
|
+
*
|
|
58
|
+
* Every other bare variant the components use (`data-active:`, `data-disabled:`,
|
|
59
|
+
* `data-inset:`, `data-placeholder:`, `data-slot:`, `data-variant:`, ...) is
|
|
60
|
+
* backed by an attribute that Reka or the kit's own template actually writes,
|
|
61
|
+
* which is why those work unregistered. See README §3 before adding one.
|
|
62
|
+
*/
|
|
63
|
+
@custom-variant data-open (&[data-state="open"]);
|
|
64
|
+
@custom-variant data-closed (&[data-state="closed"]);
|
|
65
|
+
@custom-variant data-checked (&[data-state="checked"]);
|
|
66
|
+
@custom-variant data-unchecked (&[data-state="unchecked"]);
|
|
67
|
+
@custom-variant data-horizontal (&[data-orientation="horizontal"]);
|
|
68
|
+
@custom-variant data-vertical (&[data-orientation="vertical"]);
|
|
69
|
+
|
|
70
|
+
@theme {
|
|
71
|
+
/* The house typeface. Tailwind v4's preflight sets `font-family` on <html>
|
|
72
|
+
from `--default-font-family`, which defaults to `var(--font-sans)` — so
|
|
73
|
+
this single declaration re-fonts every component in the kit. */
|
|
74
|
+
--font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
|
|
75
|
+
"Segoe UI", Roboto, sans-serif;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@theme inline {
|
|
79
|
+
--font-heading: var(--font-sans);
|
|
80
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
81
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
82
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
83
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
84
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
85
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
86
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
87
|
+
--color-sidebar: var(--sidebar);
|
|
88
|
+
--color-chart-5: var(--chart-5);
|
|
89
|
+
--color-chart-4: var(--chart-4);
|
|
90
|
+
--color-chart-3: var(--chart-3);
|
|
91
|
+
--color-chart-2: var(--chart-2);
|
|
92
|
+
--color-chart-1: var(--chart-1);
|
|
93
|
+
--color-ring: var(--ring);
|
|
94
|
+
--color-input: var(--input);
|
|
95
|
+
--color-border: var(--border);
|
|
96
|
+
--color-destructive: var(--destructive);
|
|
97
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
98
|
+
--color-accent: var(--accent);
|
|
99
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
100
|
+
--color-muted: var(--muted);
|
|
101
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
102
|
+
--color-secondary: var(--secondary);
|
|
103
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
104
|
+
--color-primary: var(--primary);
|
|
105
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
106
|
+
--color-popover: var(--popover);
|
|
107
|
+
--color-card-foreground: var(--card-foreground);
|
|
108
|
+
--color-card: var(--card);
|
|
109
|
+
--color-foreground: var(--foreground);
|
|
110
|
+
--color-background: var(--background);
|
|
111
|
+
--radius-sm: calc(var(--radius) * 0.6);
|
|
112
|
+
--radius-md: calc(var(--radius) * 0.8);
|
|
113
|
+
--radius-lg: var(--radius);
|
|
114
|
+
--radius-xl: calc(var(--radius) * 1.4);
|
|
115
|
+
--radius-2xl: calc(var(--radius) * 1.8);
|
|
116
|
+
--radius-3xl: calc(var(--radius) * 2.2);
|
|
117
|
+
--radius-4xl: calc(var(--radius) * 2.6);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
* Section 1 — house brand. Rebranding is editing these values; nothing else in
|
|
122
|
+
* the kit or in any app needs to change.
|
|
123
|
+
*/
|
|
124
|
+
:root {
|
|
125
|
+
--radius: 0.5rem;
|
|
126
|
+
|
|
127
|
+
--background: oklch(1 0 0);
|
|
128
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
129
|
+
--card: oklch(1 0 0);
|
|
130
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
131
|
+
--popover: oklch(1 0 0);
|
|
132
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
133
|
+
--primary: oklch(0.45 0.06 240);
|
|
134
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
135
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
136
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
137
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
138
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
139
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
140
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
141
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
142
|
+
--border: oklch(0.92 0.004 286.32);
|
|
143
|
+
--input: oklch(0.92 0.004 286.32);
|
|
144
|
+
--ring: oklch(0.705 0.015 286.067);
|
|
145
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
146
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
147
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
148
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
149
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
150
|
+
--sidebar: oklch(0.985 0 0);
|
|
151
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
152
|
+
--sidebar-primary: oklch(0.45 0.06 240);
|
|
153
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
154
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
155
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
156
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
157
|
+
--sidebar-ring: oklch(0.705 0.015 286.067);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/*
|
|
161
|
+
* Section 2 — the dark counterparts. Class-based, so these are plain overrides
|
|
162
|
+
* of the same token names: there is exactly one place to look for any colour.
|
|
163
|
+
*/
|
|
164
|
+
.dark {
|
|
165
|
+
--background: oklch(0.141 0.005 285.823);
|
|
166
|
+
--foreground: oklch(0.985 0 0);
|
|
167
|
+
--card: oklch(0.21 0.006 285.885);
|
|
168
|
+
--card-foreground: oklch(0.985 0 0);
|
|
169
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
170
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
171
|
+
--primary: oklch(0.7 0.07 240);
|
|
172
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
|
173
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
174
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
175
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
176
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
177
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
178
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
179
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
180
|
+
--border: oklch(1 0 0 / 10%);
|
|
181
|
+
--input: oklch(1 0 0 / 15%);
|
|
182
|
+
--ring: oklch(0.552 0.016 285.938);
|
|
183
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
184
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
185
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
186
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
187
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
188
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
189
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
190
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
191
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
192
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
193
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
194
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
195
|
+
--sidebar-ring: oklch(0.552 0.016 285.938);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@layer base {
|
|
199
|
+
* {
|
|
200
|
+
@apply border-border outline-ring/50;
|
|
201
|
+
}
|
|
202
|
+
body {
|
|
203
|
+
@apply bg-background text-foreground;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
* Section 3 — third-party corrections.
|
|
209
|
+
*
|
|
210
|
+
* The Toaster's own stylesheet declares `font-family` on the toaster container.
|
|
211
|
+
* A declaration beats inheritance, so `<body>` being re-fonted is not enough:
|
|
212
|
+
* the toast silently falls back to `ui-sans-serif` and every notification looks
|
|
213
|
+
* like it came from a different product. Re-declaring the token here is the
|
|
214
|
+
* only override the kit needs — this rule is deliberately unlayered and last,
|
|
215
|
+
* so it wins on source order against the imported stylesheet without a
|
|
216
|
+
* specificity fight.
|
|
217
|
+
*
|
|
218
|
+
* If a future component ships its own hardcoded colour or font, fix it here
|
|
219
|
+
* rather than in every app.
|
|
220
|
+
*/
|
|
221
|
+
[data-sonner-toaster] {
|
|
222
|
+
font-family: var(--font-sans);
|
|
223
|
+
}
|