@adea-ai/ui 0.18.0 → 0.18.1
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
CHANGED
|
@@ -3,3 +3,41 @@
|
|
|
3
3
|
Reusable Base UI/shadcn primitives and React controls for the HQ shell, scene
|
|
4
4
|
controls, room authoring, themes, drawers, loading states, and overlays. Scene
|
|
5
5
|
branding and Three.js runtime behavior stay in their owning packages.
|
|
6
|
+
|
|
7
|
+
## Theming contract: CSS custom properties are the only color surface
|
|
8
|
+
|
|
9
|
+
Components in this package never contain a color literal. Colors come from the
|
|
10
|
+
token layer (`src/styles/theme.css` for the shadcn tokens, `workspace-shell.css`
|
|
11
|
+
for the HQ shell tokens, `auth-shell.css` for the auth shell), and a component
|
|
12
|
+
that needs a new color adds a token instead of a value.
|
|
13
|
+
|
|
14
|
+
A color literal is legal in exactly one place: the **declaration** of a custom
|
|
15
|
+
property.
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
/* A new token, declared once. */
|
|
19
|
+
--hq-shell-notice: #d97706;
|
|
20
|
+
|
|
21
|
+
/* Then used everywhere it is needed. */
|
|
22
|
+
.notice {
|
|
23
|
+
color: var(--hq-shell-notice);
|
|
24
|
+
border-color: color-mix(in srgb, var(--hq-shell-notice) 45%, transparent);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`scripts/check-theme-colors.mjs` enforces the rule across `packages/ui`,
|
|
29
|
+
`packages/workspace-ui`, `apps/desktop/src`, and `apps/web/src`;
|
|
30
|
+
`scripts/theme-color-boundary.test.ts` runs the scan in the validation lane.
|
|
31
|
+
|
|
32
|
+
The rule is a gate with a burn-down, not a rewrite:
|
|
33
|
+
|
|
34
|
+
- Files in `BASELINE` may carry an exact number of literals, each entry with a
|
|
35
|
+
reason. Adding a literal fails the build, and so does removing one without
|
|
36
|
+
updating the count — so the list only shrinks.
|
|
37
|
+
- `TOKEN_FILES` are the declared token layers, where a literal _is_ the theme.
|
|
38
|
+
- Named colors (`white`, `transparent`) are out of scope; the gate targets
|
|
39
|
+
explicit literals.
|
|
40
|
+
|
|
41
|
+
Why it is worth a gate: with it, restyling is a token swap and dark mode is a
|
|
42
|
+
second set of declarations. Without it, every hardcoded value is a small rewrite
|
|
43
|
+
that nobody schedules.
|
|
@@ -10,7 +10,7 @@ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justi
|
|
|
10
10
|
secondary: 'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
11
11
|
ghost: 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
12
12
|
destructive: 'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
13
|
-
success: 'bg-
|
|
13
|
+
success: 'bg-success/10 text-success hover:bg-success/20 focus-visible:border-success/40 focus-visible:ring-success/20 dark:bg-success/20 dark:hover:bg-success/30 dark:focus-visible:ring-success/40',
|
|
14
14
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
15
15
|
},
|
|
16
16
|
size: {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ const buttonVariants = cva(
|
|
|
18
18
|
destructive:
|
|
19
19
|
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
20
20
|
success:
|
|
21
|
-
'bg-
|
|
21
|
+
'bg-success/10 text-success hover:bg-success/20 focus-visible:border-success/40 focus-visible:ring-success/20 dark:bg-success/20 dark:hover:bg-success/30 dark:focus-visible:ring-success/40',
|
|
22
22
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
--auth-accent: var(--hq-shell-accent);
|
|
11
11
|
--auth-accent-hover: var(--hq-shell-accent-strong);
|
|
12
12
|
--auth-accent-foreground: var(--hq-shell-accent-foreground);
|
|
13
|
+
--auth-grid-line: rgb(255 255 255 / 4%);
|
|
14
|
+
--auth-panel-shadow: 0 1.5rem 4rem rgb(0 0 0 / 24%);
|
|
13
15
|
|
|
14
16
|
display: grid;
|
|
15
17
|
min-height: 100svh;
|
|
16
18
|
place-items: center;
|
|
17
19
|
padding: 1.5rem;
|
|
18
20
|
background:
|
|
19
|
-
linear-gradient(90deg,
|
|
21
|
+
linear-gradient(90deg, var(--auth-grid-line) 1px, transparent 1px) 0 0 / 4rem 4rem,
|
|
20
22
|
var(--auth-background);
|
|
21
23
|
color: var(--auth-foreground);
|
|
22
24
|
}
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
border: 1px solid var(--auth-border);
|
|
28
30
|
border-radius: 0.75rem;
|
|
29
31
|
background: var(--auth-surface);
|
|
30
|
-
box-shadow:
|
|
32
|
+
box-shadow: var(--auth-panel-shadow);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
.auth-eyebrow {
|
package/src/styles/theme.css
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
--color-accent: var(--accent);
|
|
22
22
|
--color-accent-foreground: var(--accent-foreground);
|
|
23
23
|
--color-destructive: var(--destructive);
|
|
24
|
+
--color-success: var(--success);
|
|
24
25
|
--color-border: var(--border);
|
|
25
26
|
--color-input: var(--input);
|
|
26
27
|
--color-ring: var(--ring);
|
|
@@ -47,6 +48,8 @@
|
|
|
47
48
|
--accent: oklch(0.97 0 0);
|
|
48
49
|
--accent-foreground: oklch(0.205 0 0);
|
|
49
50
|
--destructive: oklch(0.577 0.245 27.325);
|
|
51
|
+
/* Mirrors the literals the success button variant used to carry. */
|
|
52
|
+
--success: #1a7f37;
|
|
50
53
|
--border: oklch(0.922 0 0);
|
|
51
54
|
--input: oklch(0.922 0 0);
|
|
52
55
|
--ring: oklch(0.708 0 0);
|
|
@@ -68,6 +71,7 @@
|
|
|
68
71
|
--accent: oklch(0.269 0 0);
|
|
69
72
|
--accent-foreground: oklch(0.985 0 0);
|
|
70
73
|
--destructive: oklch(0.704 0.191 22.216);
|
|
74
|
+
--success: #3fb950;
|
|
71
75
|
--border: oklch(1 0 0 / 10%);
|
|
72
76
|
--input: oklch(1 0 0 / 15%);
|
|
73
77
|
--ring: oklch(0.556 0 0);
|