@asteby/metacore-theme 2.12.2 → 2.21.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.
package/README.md CHANGED
@@ -50,6 +50,22 @@ If you already have your own Tailwind entry and only want the tokens:
50
50
  @import '@asteby/metacore-theme/tokens.css';
51
51
  ```
52
52
 
53
+ ### Glass theme pack
54
+
55
+ A translucent skin (floating panels, blur + saturation, hairline rim, soft
56
+ layered shadows) activated with `<html data-ui-theme="glass">`. It styles the
57
+ `data-slot` primitives of `@asteby/metacore-ui` (sidebar, dialogs, sheets,
58
+ popovers, selects, inputs, tables) and only sets surfaces — the accent stays
59
+ the brand painted by `applyBranding`. Import it after your tokens:
60
+
61
+ ```css
62
+ @import '@asteby/metacore-theme/tokens.css';
63
+ @import '@asteby/metacore-theme/glass.css';
64
+ ```
65
+
66
+ It includes a near-opaque fallback for browsers without `backdrop-filter`
67
+ and for `prefers-reduced-transparency`.
68
+
53
69
  ## Usage from JS/TS
54
70
 
55
71
  For programmatic access (Storybook, charts, PDF):
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { fonts, fontFamilies } from './fonts.js';
2
2
  export type { FontFamily } from './fonts.js';
3
- export { colorTokens, chartTokens, radiusTokens, shadowTokens, fontTokens, trackingTokens, themeConfig, } from './preset.js';
3
+ export { colorTokens, chartTokens, radiusTokens, shadowTokens, fontTokens, trackingTokens, motionTokens, themeConfig, } from './preset.js';
4
4
  export type { ThemeConfig } from './preset.js';
5
5
  export { ThemeProvider, useTheme } from './provider.js';
6
6
  export type { ThemeProviderProps, ThemeProviderState } from './provider.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { fonts, fontFamilies } from './fonts.js';
2
- export { colorTokens, chartTokens, radiusTokens, shadowTokens, fontTokens, trackingTokens, themeConfig, } from './preset.js';
2
+ export { colorTokens, chartTokens, radiusTokens, shadowTokens, fontTokens, trackingTokens, motionTokens, themeConfig, } from './preset.js';
3
3
  export { ThemeProvider, useTheme } from './provider.js';
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
package/dist/preset.d.ts CHANGED
@@ -96,6 +96,26 @@ export declare const fontTokens: {
96
96
  export declare const trackingTokens: {
97
97
  readonly normal: "-0.025em";
98
98
  };
99
+ /**
100
+ * Motion tokens. Durations follow a small scale (feedback → layout moves);
101
+ * easings are "standard" (enter/move), "emphasized" (larger travel) and
102
+ * "exit". CSS: `--motion-duration-*` / `--motion-ease-*` in tokens.css.
103
+ * Consumers must honour prefers-reduced-motion (tokens.css zeroes the
104
+ * durations under `reduce`).
105
+ */
106
+ export declare const motionTokens: {
107
+ readonly duration: {
108
+ readonly instant: "100ms";
109
+ readonly fast: "150ms";
110
+ readonly moderate: "220ms";
111
+ readonly slow: "320ms";
112
+ };
113
+ readonly easing: {
114
+ readonly standard: "cubic-bezier(0.2, 0, 0, 1)";
115
+ readonly emphasized: "cubic-bezier(0.3, 0, 0, 1)";
116
+ readonly exit: "cubic-bezier(0.4, 0, 1, 1)";
117
+ };
118
+ };
99
119
  export declare const themeConfig: {
100
120
  readonly colors: {
101
121
  readonly light: {
@@ -182,6 +202,19 @@ export declare const themeConfig: {
182
202
  readonly tracking: {
183
203
  readonly normal: "-0.025em";
184
204
  };
205
+ readonly motion: {
206
+ readonly duration: {
207
+ readonly instant: "100ms";
208
+ readonly fast: "150ms";
209
+ readonly moderate: "220ms";
210
+ readonly slow: "320ms";
211
+ };
212
+ readonly easing: {
213
+ readonly standard: "cubic-bezier(0.2, 0, 0, 1)";
214
+ readonly emphasized: "cubic-bezier(0.3, 0, 0, 1)";
215
+ readonly exit: "cubic-bezier(0.4, 0, 1, 1)";
216
+ };
217
+ };
185
218
  };
186
219
  export type ThemeConfig = typeof themeConfig;
187
220
  //# sourceMappingURL=preset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cd,CAAA;AAEV,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;CAed,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;CAMf,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAA;AAEV,eAAO,MAAM,UAAU;;;;CAIb,CAAA;AAEV,eAAO,MAAM,cAAc;;CAEjB,CAAA;AAEV,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOd,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAA"}
1
+ {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cd,CAAA;AAEV,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;CAed,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;CAMf,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAA;AAEV,eAAO,MAAM,UAAU;;;;CAIb,CAAA;AAEV,eAAO,MAAM,cAAc;;CAEjB,CAAA;AAEV;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYf,CAAA;AAEV,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQd,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAA"}
package/dist/preset.js CHANGED
@@ -96,6 +96,26 @@ export const fontTokens = {
96
96
  export const trackingTokens = {
97
97
  normal: '-0.025em',
98
98
  };
99
+ /**
100
+ * Motion tokens. Durations follow a small scale (feedback → layout moves);
101
+ * easings are "standard" (enter/move), "emphasized" (larger travel) and
102
+ * "exit". CSS: `--motion-duration-*` / `--motion-ease-*` in tokens.css.
103
+ * Consumers must honour prefers-reduced-motion (tokens.css zeroes the
104
+ * durations under `reduce`).
105
+ */
106
+ export const motionTokens = {
107
+ duration: {
108
+ instant: '100ms',
109
+ fast: '150ms',
110
+ moderate: '220ms',
111
+ slow: '320ms',
112
+ },
113
+ easing: {
114
+ standard: 'cubic-bezier(0.2, 0, 0, 1)',
115
+ emphasized: 'cubic-bezier(0.3, 0, 0, 1)',
116
+ exit: 'cubic-bezier(0.4, 0, 1, 1)',
117
+ },
118
+ };
99
119
  export const themeConfig = {
100
120
  colors: colorTokens,
101
121
  charts: chartTokens,
@@ -103,5 +123,6 @@ export const themeConfig = {
103
123
  shadows: shadowTokens,
104
124
  fonts: fontTokens,
105
125
  tracking: trackingTokens,
126
+ motion: motionTokens,
106
127
  };
107
128
  //# sourceMappingURL=preset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"preset.js","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE;QACL,UAAU,EAAE,mBAAmB;QAC/B,UAAU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QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;CACZ,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-theme",
3
- "version": "2.12.2",
3
+ "version": "2.21.0",
4
4
  "description": "Metacore design tokens + Tailwind 4 preset (oklch, shadows, fonts, dark mode)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "./tokens.css": "./styles/tokens.css",
25
25
  "./index.css": "./styles/index.css",
26
+ "./glass.css": "./styles/glass.css",
26
27
  "./fonts": {
27
28
  "types": "./dist/fonts.d.ts",
28
29
  "import": "./dist/fonts.js"
@@ -0,0 +1,372 @@
1
+ /**
2
+ * Glass theme pack — translucent surfaces over a soft gradient, in the
3
+ * iOS / visionOS idiom: floating panels with a hairline rim, an inner top
4
+ * highlight, layered soft shadows and blur + saturation behind them.
5
+ *
6
+ * Activated with <html data-ui-theme="glass">. The pack only brings
7
+ * surfaces, borders, blur and shadows: it never sets --primary (nor ring /
8
+ * sidebar-primary). The accent is always the brand, painted by
9
+ * @asteby/metacore-app-providers' applyBranding.
10
+ *
11
+ * Targets the `data-slot` attributes of @asteby/metacore-ui primitives, so
12
+ * every app built on them (sidebar, dialogs, sheets, popovers, selects,
13
+ * inputs, tables) picks it up without per-component classes. Import it after
14
+ * the app's base tokens:
15
+ *
16
+ * @import '@asteby/metacore-theme/glass.css';
17
+ *
18
+ * Plain (unlayered) CSS on purpose: it must win over Tailwind utilities
19
+ * such as `bg-card` or `hover:bg-muted/50` in `@layer utilities`.
20
+ */
21
+
22
+ /* ─── Tokens ─── */
23
+ [data-ui-theme='glass'] {
24
+ --radius: 1.1rem;
25
+ --font-sans: Manrope, Inter, sans-serif;
26
+
27
+ --background: oklch(0.985 0.01 250 / 0.5);
28
+ --foreground: oklch(0.22 0.03 250);
29
+ --card: oklch(1 0 0 / 0.5);
30
+ --card-foreground: oklch(0.22 0.03 250);
31
+ --popover: oklch(0.995 0.004 250 / 0.74);
32
+ --popover-foreground: oklch(0.22 0.03 250);
33
+ --secondary: oklch(1 0 0 / 0.55);
34
+ --secondary-foreground: oklch(0.28 0.04 250);
35
+ --muted: oklch(0.95 0.015 250 / 0.6);
36
+ --muted-foreground: oklch(0.44 0.03 250);
37
+ --accent: oklch(1 0 0 / 0.6);
38
+ --accent-foreground: oklch(0.24 0.04 250);
39
+ /* Inner separators: a dark hairline reads on white glass, a white one doesn't. */
40
+ --border: oklch(0.35 0.03 250 / 0.12);
41
+ --input: oklch(0.35 0.03 250 / 0.14);
42
+ --sidebar: oklch(1 0 0 / 0.45);
43
+ --sidebar-foreground: oklch(0.26 0.03 250);
44
+ --sidebar-accent: oklch(1 0 0 / 0.6);
45
+ --sidebar-accent-foreground: oklch(0.22 0.04 250);
46
+ --sidebar-border: oklch(0.35 0.03 250 / 0.1);
47
+
48
+ --glass-blur: 24px;
49
+ --glass-saturate: 1.8;
50
+ --glass-radius: calc(var(--radius) + 4px);
51
+ /* Outer rim of a floating panel. */
52
+ --glass-rim: oklch(1 0 0 / 0.55);
53
+ --glass-highlight: inset 0 1px 0 0 oklch(1 0 0 / 0.75);
54
+ --glass-shadow:
55
+ 0 1px 2px oklch(0.25 0.04 260 / 0.06),
56
+ 0 8px 24px -8px oklch(0.25 0.04 260 / 0.14),
57
+ 0 24px 56px -16px oklch(0.25 0.04 260 / 0.16);
58
+ --glass-shadow-float:
59
+ 0 2px 6px oklch(0.25 0.04 260 / 0.08),
60
+ 0 18px 48px -12px oklch(0.25 0.04 260 / 0.24),
61
+ 0 48px 96px -24px oklch(0.25 0.04 260 / 0.22);
62
+ --glass-field: oklch(1 0 0 / 0.55);
63
+ --glass-field-hover: oklch(1 0 0 / 0.7);
64
+ --glass-overlay: oklch(0.3 0.03 260 / 0.16);
65
+ --glass-row-hover: oklch(1 0 0 / 0.4);
66
+ --glass-thead: oklch(1 0 0 / 0.62);
67
+
68
+ /* Semantic surfaces (see tokens.css) mapped onto the glass recipe. */
69
+ --surface-panel: var(--card);
70
+ --surface-raised: var(--card);
71
+ --surface-field: var(--glass-field);
72
+ --border-rim: var(--glass-rim);
73
+ --elevation-raised: var(--glass-highlight), 0 1px 2px oklch(0.25 0.04 260 / 0.06);
74
+ --elevation-panel: var(--glass-highlight), var(--glass-shadow);
75
+ --elevation-float: var(--glass-highlight), var(--glass-shadow-float);
76
+ --backdrop-panel: blur(var(--glass-blur)) saturate(var(--glass-saturate));
77
+ --radius-panel: var(--glass-radius);
78
+ --radius-field: calc(var(--radius) + 10px);
79
+
80
+ --shadow-md: var(--glass-shadow);
81
+ --ui-surface-blur: var(--glass-blur);
82
+ --ui-card-alpha: 0.5;
83
+
84
+ background-color: oklch(0.93 0.035 270);
85
+ background-image:
86
+ radial-gradient(48rem 34rem at 10% -8%, oklch(0.8 0.11 250 / 0.9), transparent 70%),
87
+ radial-gradient(40rem 30rem at 105% 20%, oklch(0.78 0.12 295 / 0.75), transparent 68%),
88
+ radial-gradient(38rem 28rem at 60% 115%, oklch(0.9 0.12 90 / 0.7), transparent 70%);
89
+ background-attachment: fixed;
90
+ }
91
+
92
+ .dark[data-ui-theme='glass'] {
93
+ --background: oklch(0.22 0.03 255 / 0.5);
94
+ --foreground: oklch(0.96 0.01 250);
95
+ --card: oklch(0.27 0.03 255 / 0.45);
96
+ --card-foreground: oklch(0.96 0.01 250);
97
+ --popover: oklch(0.23 0.03 255 / 0.78);
98
+ --popover-foreground: oklch(0.96 0.01 250);
99
+ --secondary: oklch(1 0 0 / 0.08);
100
+ --secondary-foreground: oklch(0.96 0.01 250);
101
+ --muted: oklch(1 0 0 / 0.06);
102
+ --muted-foreground: oklch(0.76 0.03 250);
103
+ --accent: oklch(1 0 0 / 0.1);
104
+ --accent-foreground: oklch(0.97 0.01 250);
105
+ --border: oklch(1 0 0 / 0.1);
106
+ --input: oklch(1 0 0 / 0.12);
107
+ --sidebar: oklch(0.2 0.03 255 / 0.5);
108
+ --sidebar-foreground: oklch(0.94 0.01 250);
109
+ --sidebar-accent: oklch(1 0 0 / 0.1);
110
+ --sidebar-accent-foreground: oklch(0.97 0.01 250);
111
+ --sidebar-border: oklch(1 0 0 / 0.08);
112
+
113
+ --glass-rim: oklch(1 0 0 / 0.1);
114
+ --glass-highlight: inset 0 1px 0 0 oklch(1 0 0 / 0.09);
115
+ --glass-shadow:
116
+ 0 1px 2px oklch(0 0 0 / 0.3),
117
+ 0 8px 24px -8px oklch(0 0 0 / 0.4),
118
+ 0 24px 56px -16px oklch(0 0 0 / 0.45);
119
+ --glass-shadow-float:
120
+ 0 2px 6px oklch(0 0 0 / 0.35),
121
+ 0 18px 48px -12px oklch(0 0 0 / 0.55),
122
+ 0 48px 96px -24px oklch(0 0 0 / 0.5);
123
+ --glass-field: oklch(1 0 0 / 0.06);
124
+ --glass-field-hover: oklch(1 0 0 / 0.1);
125
+ --glass-overlay: oklch(0.08 0.02 260 / 0.45);
126
+ --glass-row-hover: oklch(1 0 0 / 0.05);
127
+ --glass-thead: oklch(0.25 0.03 255 / 0.7);
128
+
129
+ background-color: oklch(0.16 0.03 260);
130
+ background-image:
131
+ radial-gradient(42rem 28rem at 8% -8%, oklch(0.45 0.16 250 / 0.7), transparent 70%),
132
+ radial-gradient(32rem 24rem at 100% 0%, oklch(0.4 0.12 200 / 0.55), transparent 68%),
133
+ radial-gradient(28rem 22rem at 70% 100%, oklch(0.42 0.14 300 / 0.45), transparent 70%);
134
+ background-attachment: fixed;
135
+ }
136
+
137
+ /* ─── Blur behind every translucent surface ─── */
138
+ [data-ui-theme='glass'] .bg-background,
139
+ [data-ui-theme='glass'] .bg-card,
140
+ [data-ui-theme='glass'] .bg-popover,
141
+ [data-ui-theme='glass'] .bg-sidebar,
142
+ [data-ui-theme='glass'] [data-slot='sidebar-inner'],
143
+ [data-ui-theme='glass'] [data-slot='popover-content'],
144
+ [data-ui-theme='glass'] [data-slot='select-content'],
145
+ [data-ui-theme='glass'] [data-slot='dropdown-menu-content'],
146
+ [data-ui-theme='glass'] [data-slot='dropdown-menu-sub-content'],
147
+ [data-ui-theme='glass'] [data-slot='context-menu-content'] {
148
+ -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
149
+ backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
150
+ }
151
+
152
+ /*
153
+ * Only the leaf surfaces are glass. body and the sidebar wrapper are pure
154
+ * layout, yet they also paint --background / --sidebar (inset variant):
155
+ * stacked under the panels those alphas compound to a flat fill.
156
+ */
157
+ [data-ui-theme='glass'] body,
158
+ [data-ui-theme='glass'] [data-slot='sidebar-wrapper'] {
159
+ background-color: transparent;
160
+ }
161
+
162
+ /* ─── Floating panels: sidebar + main inset ─── */
163
+ [data-ui-theme='glass'] [data-slot='sidebar-inner'],
164
+ [data-ui-theme='glass'] [data-slot='sidebar-inset'] {
165
+ border: 1px solid var(--glass-rim);
166
+ border-radius: var(--glass-radius);
167
+ box-shadow: var(--glass-highlight), var(--glass-shadow);
168
+ background-clip: padding-box;
169
+ }
170
+
171
+ [data-ui-theme='glass'] [data-slot='sidebar-inner'] {
172
+ overflow: hidden;
173
+ }
174
+
175
+ /*
176
+ * The plain `sidebar` variant is flush to the viewport edge with a border:
177
+ * give it the same 0.5rem gutter the floating/inset variants have, and the
178
+ * icon-collapsed width room for that gutter.
179
+ */
180
+ [data-ui-theme='glass'] [data-slot='sidebar'][data-variant='sidebar'] [data-slot='sidebar-container'] {
181
+ padding: 0.5rem;
182
+ border-inline: 0;
183
+ }
184
+
185
+ [data-ui-theme='glass'] [data-slot='sidebar'][data-variant='sidebar'][data-collapsible='icon'] [data-slot='sidebar-container'] {
186
+ width: calc(var(--sidebar-width-icon) + 1rem + 2px);
187
+ }
188
+
189
+ [data-ui-theme='glass'] [data-slot='sidebar'][data-variant='sidebar'][data-collapsible='icon'] [data-slot='sidebar-gap'] {
190
+ width: calc(var(--sidebar-width-icon) + 1rem);
191
+ }
192
+
193
+ @media (min-width: 768px) {
194
+ [data-ui-theme='glass'] [data-slot='sidebar'][data-variant='sidebar'] ~ [data-slot='sidebar-inset'] {
195
+ margin: 0.5rem;
196
+ margin-inline-start: 0;
197
+ }
198
+ }
199
+
200
+ @media (max-width: 767px) {
201
+ /* No sidebar panel beside it on phones: the inset is the whole screen. */
202
+ [data-ui-theme='glass'] [data-slot='sidebar-inset'] {
203
+ border: 0;
204
+ border-radius: 0;
205
+ box-shadow: none;
206
+ }
207
+ }
208
+
209
+ /*
210
+ * Mobile sidebar: a Sheet whose content carries data-slot="sidebar" +
211
+ * data-mobile="true" (not sheet-content). Float it as a card with the same
212
+ * gutter, over the dimmed overlay, so it takes the denser popover glass.
213
+ */
214
+ [data-ui-theme='glass'] [data-mobile='true'][data-slot='sidebar'] {
215
+ inset-block: 0.5rem;
216
+ inset-inline-start: 0.5rem;
217
+ height: auto;
218
+ background-color: var(--popover);
219
+ border: 1px solid var(--glass-rim);
220
+ border-radius: var(--glass-radius);
221
+ box-shadow: var(--glass-highlight), var(--glass-shadow-float);
222
+ background-clip: padding-box;
223
+ overflow: hidden;
224
+ -webkit-backdrop-filter: blur(40px) saturate(var(--glass-saturate));
225
+ backdrop-filter: blur(40px) saturate(var(--glass-saturate));
226
+ }
227
+
228
+ /* ─── Floating layers: dialogs, sheets, menus ─── */
229
+ [data-ui-theme='glass'] [data-slot='dialog-overlay'],
230
+ [data-ui-theme='glass'] [data-slot='alert-dialog-overlay'],
231
+ [data-ui-theme='glass'] [data-slot='sheet-overlay'] {
232
+ background-color: var(--glass-overlay);
233
+ -webkit-backdrop-filter: blur(6px) saturate(1.2);
234
+ backdrop-filter: blur(6px) saturate(1.2);
235
+ }
236
+
237
+ [data-ui-theme='glass'] [data-slot='dialog-content'],
238
+ [data-ui-theme='glass'] [data-slot='alert-dialog-content'],
239
+ [data-ui-theme='glass'] [data-slot='sheet-content'] {
240
+ background-color: var(--popover);
241
+ color: var(--popover-foreground);
242
+ border: 1px solid var(--glass-rim);
243
+ box-shadow: var(--glass-highlight), var(--glass-shadow-float);
244
+ background-clip: padding-box;
245
+ -webkit-backdrop-filter: blur(40px) saturate(var(--glass-saturate));
246
+ backdrop-filter: blur(40px) saturate(var(--glass-saturate));
247
+ }
248
+
249
+ [data-ui-theme='glass'] [data-slot='dialog-content'],
250
+ [data-ui-theme='glass'] [data-slot='alert-dialog-content'] {
251
+ border-radius: calc(var(--radius) + 6px);
252
+ }
253
+
254
+ [data-ui-theme='glass'] [data-slot='dialog-footer'],
255
+ [data-ui-theme='glass'] [data-slot='sheet-footer'] {
256
+ border-color: var(--border);
257
+ }
258
+
259
+ /* A footer bar that sits on a separator gets a faint frosted band. */
260
+ [data-ui-theme='glass'] [data-slot='dialog-footer'].border-t {
261
+ background-color: color-mix(in oklch, var(--popover) 55%, transparent);
262
+ }
263
+
264
+ [data-ui-theme='glass'] [data-slot='popover-content'],
265
+ [data-ui-theme='glass'] [data-slot='select-content'],
266
+ [data-ui-theme='glass'] [data-slot='dropdown-menu-content'],
267
+ [data-ui-theme='glass'] [data-slot='dropdown-menu-sub-content'],
268
+ [data-ui-theme='glass'] [data-slot='context-menu-content'] {
269
+ background-color: var(--popover);
270
+ border-color: var(--glass-rim);
271
+ box-shadow: var(--glass-highlight), var(--glass-shadow);
272
+ background-clip: padding-box;
273
+ }
274
+
275
+ /* ─── Fields ─── */
276
+ [data-ui-theme='glass'] [data-slot='input'],
277
+ [data-ui-theme='glass'] [data-slot='textarea'],
278
+ [data-ui-theme='glass'] [data-slot='select-trigger'],
279
+ [data-ui-theme='glass'] [data-slot='command-input-wrapper'] {
280
+ background-color: var(--glass-field);
281
+ border-color: var(--input);
282
+ box-shadow: var(--glass-highlight);
283
+ transition:
284
+ background-color 150ms ease,
285
+ border-color 150ms ease,
286
+ box-shadow 150ms ease;
287
+ }
288
+
289
+ [data-ui-theme='glass'] [data-slot='input']:hover:not(:disabled),
290
+ [data-ui-theme='glass'] [data-slot='textarea']:hover:not(:disabled),
291
+ [data-ui-theme='glass'] [data-slot='select-trigger']:hover:not(:disabled) {
292
+ background-color: var(--glass-field-hover);
293
+ }
294
+
295
+ [data-ui-theme='glass'] [data-slot='input']:focus-visible,
296
+ [data-ui-theme='glass'] [data-slot='textarea']:focus-visible,
297
+ [data-ui-theme='glass'] [data-slot='select-trigger']:focus-visible,
298
+ [data-ui-theme='glass'] [data-slot='select-trigger'][data-state='open'] {
299
+ background-color: var(--glass-field-hover);
300
+ border-color: var(--primary);
301
+ box-shadow:
302
+ var(--glass-highlight),
303
+ 0 0 0 3px color-mix(in oklch, var(--primary) 28%, transparent);
304
+ outline: none;
305
+ }
306
+
307
+ /* ─── Tables (DynamicTable and any metacore-ui <Table>) ─── */
308
+ [data-ui-theme='glass'] [data-slot='table-head'] {
309
+ background-color: var(--glass-thead);
310
+ border-bottom: 1px solid var(--border);
311
+ -webkit-backdrop-filter: blur(16px) saturate(var(--glass-saturate));
312
+ backdrop-filter: blur(16px) saturate(var(--glass-saturate));
313
+ }
314
+
315
+ [data-ui-theme='glass'] [data-slot='table-row'] {
316
+ border-color: var(--border);
317
+ transition: background-color 120ms ease;
318
+ }
319
+
320
+ [data-ui-theme='glass'] [data-slot='table-body'] [data-slot='table-row']:hover {
321
+ background-color: var(--glass-row-hover);
322
+ }
323
+
324
+ [data-ui-theme='glass'] [data-slot='table-row'][data-state='selected'] {
325
+ background-color: color-mix(in oklch, var(--primary) 10%, transparent);
326
+ }
327
+
328
+ /* Sticky cells (actions column, totals footer) must not show rows through. */
329
+ [data-ui-theme='glass'] [data-slot='table-cell'].sticky {
330
+ background-color: var(--glass-thead);
331
+ -webkit-backdrop-filter: blur(16px) saturate(var(--glass-saturate));
332
+ backdrop-filter: blur(16px) saturate(var(--glass-saturate));
333
+ }
334
+
335
+ /* ─── Without backdrop-filter translucency just muddies text ─── */
336
+ @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
337
+ [data-ui-theme='glass'] {
338
+ --background: oklch(0.97 0.02 250 / 0.92);
339
+ --card: oklch(1 0 0 / 0.94);
340
+ --popover: oklch(1 0 0 / 0.98);
341
+ --sidebar: oklch(0.99 0.008 250 / 0.92);
342
+ --glass-thead: oklch(0.98 0.01 250);
343
+ --glass-field: oklch(1 0 0 / 0.9);
344
+ --glass-overlay: oklch(0.3 0.03 260 / 0.4);
345
+ }
346
+
347
+ .dark[data-ui-theme='glass'] {
348
+ --background: oklch(0.2 0.03 250 / 0.94);
349
+ --card: oklch(0.24 0.03 250 / 0.94);
350
+ --popover: oklch(0.22 0.03 250 / 0.98);
351
+ --sidebar: oklch(0.17 0.03 250 / 0.94);
352
+ --glass-thead: oklch(0.24 0.03 250);
353
+ --glass-field: oklch(0.26 0.03 250);
354
+ --glass-overlay: oklch(0.05 0.02 260 / 0.7);
355
+ }
356
+ }
357
+
358
+ @media (prefers-reduced-transparency: reduce) {
359
+ [data-ui-theme='glass'] {
360
+ --background: oklch(0.97 0.02 250 / 0.94);
361
+ --card: oklch(1 0 0 / 0.95);
362
+ --popover: oklch(1 0 0 / 0.98);
363
+ --sidebar: oklch(0.99 0.008 250 / 0.94);
364
+ }
365
+
366
+ .dark[data-ui-theme='glass'] {
367
+ --background: oklch(0.2 0.03 250 / 0.95);
368
+ --card: oklch(0.24 0.03 250 / 0.95);
369
+ --popover: oklch(0.22 0.03 250 / 0.98);
370
+ --sidebar: oklch(0.17 0.03 250 / 0.95);
371
+ }
372
+ }
package/styles/tokens.css CHANGED
@@ -1,4 +1,26 @@
1
1
  :root {
2
+ /* Status hues for chips and badges (text-safe on --background). */
3
+ --success: oklch(0.56 0.14 155);
4
+ --warning: oklch(0.6 0.15 65);
5
+ --info: oklch(0.55 0.13 235);
6
+
7
+ /*
8
+ * Semantic surfaces for floating UI outside the metacore-ui primitives
9
+ * (chat panels, composers, result cards). Defaults are the plain tokens;
10
+ * a theme pack (glass.css) redefines them, so screens that paint with
11
+ * these never need to know which theme is active.
12
+ */
13
+ --surface-panel: var(--card);
14
+ --surface-raised: var(--card);
15
+ --surface-field: var(--background);
16
+ --border-rim: var(--border);
17
+ --elevation-raised: 0 1px 2px oklch(0 0 0 / 0.05);
18
+ --elevation-panel: 0 1px 2px oklch(0 0 0 / 0.05), 0 12px 32px -16px oklch(0 0 0 / 0.18);
19
+ --elevation-float: 0 2px 6px oklch(0 0 0 / 0.08), 0 24px 56px -20px oklch(0 0 0 / 0.3);
20
+ --backdrop-panel: none;
21
+ --radius-panel: calc(var(--radius) + 4px);
22
+ --radius-field: calc(var(--radius) + 10px);
23
+
2
24
  --background: oklch(0.9940 0 0);
3
25
  --foreground: oklch(0 0 0);
4
26
  --card: oklch(0.9940 0 0);
@@ -51,6 +73,14 @@
51
73
  --shadow-2xl: 0px 2px 3px 0px hsl(0 0% 0% / 0.40);
52
74
  --tracking-normal: -0.025em;
53
75
  --spacing: 0.27rem;
76
+ /* Motion (see motionTokens in src/preset.ts) */
77
+ --motion-duration-instant: 100ms;
78
+ --motion-duration-fast: 150ms;
79
+ --motion-duration-moderate: 220ms;
80
+ --motion-duration-slow: 320ms;
81
+ --motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
82
+ --motion-ease-emphasized: cubic-bezier(0.3, 0, 0, 1);
83
+ --motion-ease-exit: cubic-bezier(0.4, 0, 1, 1);
54
84
  }
55
85
 
56
86
  .dark {
@@ -102,6 +132,9 @@
102
132
  --shadow-lg: 0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 4px 6px -1px hsl(0 0% 0% / 0.16);
103
133
  --shadow-xl: 0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 8px 10px -1px hsl(0 0% 0% / 0.16);
104
134
  --shadow-2xl: 0px 2px 3px 0px hsl(0 0% 0% / 0.40);
135
+ --success: oklch(0.78 0.14 155);
136
+ --warning: oklch(0.82 0.14 80);
137
+ --info: oklch(0.78 0.11 235);
105
138
  }
106
139
 
107
140
  @theme inline {
@@ -169,3 +202,12 @@ body {
169
202
  -webkit-font-smoothing: antialiased;
170
203
  -moz-osx-font-smoothing: grayscale;
171
204
  }
205
+
206
+ @media (prefers-reduced-motion: reduce) {
207
+ :root {
208
+ --motion-duration-instant: 0ms;
209
+ --motion-duration-fast: 0ms;
210
+ --motion-duration-moderate: 0ms;
211
+ --motion-duration-slow: 0ms;
212
+ }
213
+ }