@happyvertical/smrt-ui 0.55.17 → 0.55.19

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 (90) hide show
  1. package/README.md +7 -0
  2. package/dist/components/calendar/CalendarView.svelte +2 -2
  3. package/dist/components/chat/ReactionPicker.svelte +2 -2
  4. package/dist/components/data/CollectionList.svelte +1 -1
  5. package/dist/components/data/CollectionToolbar.svelte +1 -1
  6. package/dist/components/data/DataTable.svelte +44 -32
  7. package/dist/components/data/SortableHeader.svelte +2 -2
  8. package/dist/components/feedback/Alert.svelte +4 -3
  9. package/dist/components/feedback/LoadingOverlay.svelte +2 -2
  10. package/dist/components/feedback/Modal.svelte +11 -9
  11. package/dist/components/feedback/PhoneSheet.svelte +2 -2
  12. package/dist/components/feedback/ToastViewport.svelte +1 -1
  13. package/dist/components/forms/CameraCapture.svelte +2 -2
  14. package/dist/components/forms/Checkbox.svelte +1 -1
  15. package/dist/components/forms/Combobox.svelte +1 -1
  16. package/dist/components/forms/FilePicker.svelte +1 -1
  17. package/dist/components/forms/Input.svelte +11 -7
  18. package/dist/components/forms/InputGroup.svelte +1 -1
  19. package/dist/components/forms/Listbox.svelte +1 -1
  20. package/dist/components/forms/Radio.svelte +1 -1
  21. package/dist/components/forms/RangeSlider.svelte +1 -1
  22. package/dist/components/forms/SearchInput.svelte +2 -2
  23. package/dist/components/forms/SegmentedControl.svelte +1 -1
  24. package/dist/components/forms/Select.svelte +11 -7
  25. package/dist/components/forms/SignaturePad.svelte +2 -2
  26. package/dist/components/forms/Slider.svelte +1 -1
  27. package/dist/components/forms/StagedControlReview.svelte +1 -1
  28. package/dist/components/forms/Switch.svelte +1 -1
  29. package/dist/components/forms/TagsInput.svelte +1 -1
  30. package/dist/components/forms/Textarea.svelte +10 -6
  31. package/dist/components/forms/Toggle.svelte +2 -2
  32. package/dist/components/forms/ToggleButton.svelte +1 -1
  33. package/dist/components/layout/PageHeader.svelte +2 -2
  34. package/dist/components/nav/Tabs.svelte +47 -17
  35. package/dist/components/permissions/PermissionPicker.svelte +1 -1
  36. package/dist/components/roles/RoleSelector.svelte +2 -2
  37. package/dist/components/ui/AccordionItem.svelte +1 -1
  38. package/dist/components/ui/Badge.svelte +2 -1
  39. package/dist/components/ui/Button.svelte +38 -29
  40. package/dist/components/ui/Card.svelte +11 -10
  41. package/dist/components/ui/Chip.svelte +31 -7
  42. package/dist/components/ui/Disclosure.svelte +1 -1
  43. package/dist/components/ui/Dropdown.svelte +20 -15
  44. package/dist/components/ui/IconToggle.svelte +2 -2
  45. package/dist/components/ui/Popover.svelte +4 -4
  46. package/dist/components/ui/Tooltip.svelte +1 -0
  47. package/dist/components/ui/Tree.svelte +2 -2
  48. package/dist/themes/CUSTOM_THEME_GUIDE.md +16 -1
  49. package/dist/themes/README.md +126 -0
  50. package/dist/themes/ThemeProvider.svelte +173 -13
  51. package/dist/themes/ThemeProvider.svelte.d.ts +7 -2
  52. package/dist/themes/ThemeProvider.svelte.d.ts.map +1 -1
  53. package/dist/themes/create-theme.d.ts +22 -1
  54. package/dist/themes/create-theme.d.ts.map +1 -1
  55. package/dist/themes/create-theme.js +93 -5
  56. package/dist/themes/css-generator.d.ts.map +1 -1
  57. package/dist/themes/css-generator.js +15 -16
  58. package/dist/themes/derive.d.ts +31 -0
  59. package/dist/themes/derive.d.ts.map +1 -0
  60. package/dist/themes/derive.js +183 -0
  61. package/dist/themes/glass/index.d.ts.map +1 -1
  62. package/dist/themes/glass/index.js +127 -14
  63. package/dist/themes/happyvertical/index.d.ts.map +1 -1
  64. package/dist/themes/happyvertical/index.js +101 -20
  65. package/dist/themes/index.d.ts +2 -2
  66. package/dist/themes/index.d.ts.map +1 -1
  67. package/dist/themes/index.js +1 -1
  68. package/dist/themes/material/index.d.ts.map +1 -1
  69. package/dist/themes/material/index.js +129 -28
  70. package/dist/themes/required-tokens.generated.json +31 -0
  71. package/dist/themes/shared.d.ts +35 -0
  72. package/dist/themes/shared.d.ts.map +1 -1
  73. package/dist/themes/shared.js +32 -0
  74. package/dist/themes/smrt/index.d.ts +3 -0
  75. package/dist/themes/smrt/index.d.ts.map +1 -1
  76. package/dist/themes/smrt/index.js +108 -26
  77. package/dist/themes/studio/index.d.ts.map +1 -1
  78. package/dist/themes/studio/index.js +116 -40
  79. package/dist/themes/styles/base.css +225 -0
  80. package/dist/themes/styles/glass.css +103 -19
  81. package/dist/themes/styles/happyvertical.css +104 -12
  82. package/dist/themes/styles/material.css +127 -35
  83. package/dist/themes/styles/smrt.css +122 -30
  84. package/dist/themes/styles/studio.css +128 -36
  85. package/dist/themes/theme-script.d.ts +3 -1
  86. package/dist/themes/theme-script.d.ts.map +1 -1
  87. package/dist/themes/theme-script.js +7 -2
  88. package/dist/themes/types.d.ts +118 -6
  89. package/dist/themes/types.d.ts.map +1 -1
  90. package/package.json +3 -3
@@ -6,12 +6,16 @@
6
6
  * accent (`#ff7a1a`), hairline outlines, deep low shadows, and a
7
7
  * Space Grotesk / Inter / JetBrains Mono type stack.
8
8
  *
9
+ * Depth is calm: two-layer shadows (contact + short ambient) and graphite surface
10
+ * lightness, never far-spread or glowing shadows.
11
+ *
9
12
  * The token palette restyles every existing smrt-ui component; the signature
10
13
  * motifs (engineering-grid background, glow, oscilloscope hairline, instrument
11
14
  * readouts, monospace technical labels) ship as opt-in utility classes in
12
15
  * `styles/smrt.css`, and the fonts in `styles/fonts.css`.
13
16
  */
14
- import { borderRadiusScale, durationScale, spacingScale } from '../shared.js';
17
+ import { baselineTokens, opaqueGlass } from '../derive.js';
18
+ import { borderRadiusScale, darkInsetHighlight, durationScale, hairlineInset, hairlineMix, noInsetHighlight, noShadow, shadow, spacingScale, } from '../shared.js';
15
19
  /** Display family (headings) — falls back gracefully when fonts.css is absent. */
16
20
  const DISPLAY_FONT = '"Space Grotesk", system-ui, -apple-system, sans-serif';
17
21
  /**
@@ -37,6 +41,11 @@ const lightColors = {
37
41
  onTertiary: '#ffffff',
38
42
  tertiaryContainer: '#e7e0ff',
39
43
  onTertiaryContainer: '#3a2b8c',
44
+ // Info - Steel blue, distinct from the amber signal and the violet tertiary
45
+ info: '#2c6a96',
46
+ onInfo: '#ffffff',
47
+ infoContainer: '#dcebf5',
48
+ onInfoContainer: '#0f3149',
40
49
  // Error
41
50
  error: '#c0362c',
42
51
  onError: '#ffffff',
@@ -104,6 +113,11 @@ const darkColors = {
104
113
  onTertiary: '#241a4d',
105
114
  tertiaryContainer: '#2a2350',
106
115
  onTertiaryContainer: '#ddd4ff',
116
+ // Info - Steel blue, distinct from the amber signal and the violet tertiary
117
+ info: '#6fa8d6',
118
+ onInfo: '#08202f',
119
+ infoContainer: '#162a39',
120
+ onInfoContainer: '#b5d6ee',
107
121
  // Error
108
122
  error: '#ff6b6b',
109
123
  onError: '#2a0a0a',
@@ -241,52 +255,76 @@ const typography = {
241
255
  labelLarge: {
242
256
  size: '0.8125rem',
243
257
  lineHeight: '1.4',
244
- weight: '600',
245
- tracking: '0.04em',
258
+ weight: '500',
259
+ tracking: '0.01em',
246
260
  fontFamily: 'var(--smrt-font-family)',
247
261
  },
248
262
  labelMedium: {
249
263
  size: '0.6875rem',
250
264
  lineHeight: '1.4',
251
- weight: '600',
252
- tracking: '0.08em',
265
+ weight: '500',
266
+ tracking: '0.03em',
253
267
  fontFamily: 'var(--smrt-font-family)',
254
268
  },
255
269
  labelSmall: {
256
270
  size: '0.625rem',
257
271
  lineHeight: '1.4',
258
- weight: '600',
259
- tracking: '0.1em',
272
+ weight: '500',
273
+ tracking: '0.05em',
260
274
  fontFamily: 'var(--smrt-font-family)',
261
275
  },
262
276
  };
263
277
  /**
264
- * SMRT elevation (light) — deep, soft, low-spread shadows.
265
- *
266
- * The workbench panels sit on big diffuse drop shadows with a tight inset
267
- * hairline at level 1. Light scheme tints the shadow with the cool ink grey.
278
+ * SMRT elevation (light) — calm, visible two-layer shadows. Level 1 is the
279
+ * hairline; the former far-spread drop shadows (44-90px blur, -28 to -50px
280
+ * spread, which disappeared on paper) are replaced by a contact shadow plus a
281
+ * short ambient layer.
268
282
  */
269
283
  const elevation = {
270
- 0: 'none',
271
- 1: 'inset 0 0 0 1px rgba(20, 26, 36, 0.08)',
272
- 2: '0 18px 44px -28px rgba(20, 26, 36, 0.18)',
273
- 3: '0 24px 56px -34px rgba(20, 26, 36, 0.22)',
274
- 4: '0 30px 70px -40px rgba(20, 26, 36, 0.28)',
275
- 5: '0 40px 90px -50px rgba(20, 26, 36, 0.3)',
284
+ 0: noShadow,
285
+ 1: hairlineInset,
286
+ 2: shadow([
287
+ [1, 2, 0, 10],
288
+ [4, 10, -4, 10],
289
+ ]),
290
+ 3: shadow([
291
+ [1, 3, 0, 12],
292
+ [8, 18, -6, 14],
293
+ ]),
294
+ 4: shadow([
295
+ [2, 4, 0, 14],
296
+ [14, 28, -8, 16],
297
+ ]),
298
+ 5: shadow([
299
+ [2, 6, 0, 16],
300
+ [24, 48, -12, 20],
301
+ ]),
276
302
  };
277
303
  /**
278
- * SMRT elevation (dark) — black drop shadows with a white inset hairline.
279
- *
280
- * Defined here (not only in the static `styles/smrt.css`) so the JS
304
+ * SMRT elevation (dark) — the hairline at level 1; above it graphite surface
305
+ * lightness carries altitude, with the inset top highlight and black shadows in
306
+ * support. Defined here (not only in the static `styles/smrt.css`) so the JS
281
307
  * ThemeProvider output and the static dark CSS stay in lockstep (#1586).
282
308
  */
283
309
  const darkElevation = {
284
- 0: 'none',
285
- 1: 'inset 0 0 0 1px rgba(255, 255, 255, 0.06)',
286
- 2: '0 18px 44px -28px rgba(0, 0, 0, 0.6)',
287
- 3: '0 24px 56px -34px rgba(0, 0, 0, 0.72)',
288
- 4: '0 30px 66px -40px rgba(0, 0, 0, 0.82)',
289
- 5: '0 40px 90px -50px rgba(0, 0, 0, 0.88)',
310
+ 0: noShadow,
311
+ 1: hairlineInset,
312
+ 2: shadow([
313
+ [1, 2, 0, 36],
314
+ [4, 10, -4, 28],
315
+ ], 'var(--smrt-inset-highlight)'),
316
+ 3: shadow([
317
+ [1, 3, 0, 40],
318
+ [8, 18, -6, 36],
319
+ ], 'var(--smrt-inset-highlight)'),
320
+ 4: shadow([
321
+ [2, 4, 0, 44],
322
+ [14, 28, -8, 42],
323
+ ], 'var(--smrt-inset-highlight)'),
324
+ 5: shadow([
325
+ [2, 6, 0, 48],
326
+ [24, 48, -12, 50],
327
+ ], 'var(--smrt-inset-highlight)'),
290
328
  };
291
329
  /**
292
330
  * SMRT easings — the workbench reveal curve as the emphasized easing.
@@ -314,6 +352,50 @@ export const smrtTheme = {
314
352
  borderRadius: borderRadiusScale,
315
353
  duration: durationScale,
316
354
  easing: smrtEasing,
355
+ glass: { ...opaqueGlass },
356
+ ...baselineTokens(lightColors, darkColors),
357
+ shadowColor: { light: 'rgb(20 26 36)', dark: 'rgb(0 0 0)' },
358
+ // Instrument ladder: deep ground, graphite panels, then control and raised
359
+ // tiers that step up in lightness (dark); paper panels on a cool ground (light).
360
+ surfaces: {
361
+ light: {
362
+ ground: lightColors.background,
363
+ panel: lightColors.surface,
364
+ control: lightColors.surfaceContainer,
365
+ raised: lightColors.surfaceContainerLowest,
366
+ sunken: lightColors.surfaceContainerHighest,
367
+ overlay: lightColors.scrim,
368
+ },
369
+ dark: {
370
+ ground: darkColors.background,
371
+ panel: darkColors.surface,
372
+ control: darkColors.surfaceContainerHigh,
373
+ raised: '#1d2126',
374
+ sunken: '#08090b',
375
+ overlay: darkColors.scrim,
376
+ },
377
+ },
378
+ hairlines: {
379
+ light: hairlineMix(12, 30, noInsetHighlight),
380
+ dark: hairlineMix(9, 24, darkInsetHighlight(0.05)),
381
+ },
382
+ states: {
383
+ hover: '0.10',
384
+ pressed: '0.16',
385
+ selected: '0.14',
386
+ focus: '0.16',
387
+ dragged: '0.20',
388
+ disabled: '0.38',
389
+ },
390
+ controls: {
391
+ radius: 'var(--smrt-radius-sm)',
392
+ radiusSmall: 'var(--smrt-radius-sm)',
393
+ height: '2.5rem',
394
+ heightSmall: '2rem',
395
+ weight: '500',
396
+ },
397
+ // Inter: tabular figures and the flat-topped 1 keep columns of numbers aligned.
398
+ fontFeatureSettings: '"tnum" 1, "cv11" 1',
317
399
  fontFamily: '"Inter", system-ui, -apple-system, "Segoe UI", sans-serif',
318
400
  };
319
401
  export default smrtTheme;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/studio/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAGV,KAAK,EAEN,MAAM,aAAa,CAAC;AAqSrB;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/studio/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,OAAO,KAAK,EAGV,KAAK,EAEN,MAAM,aAAa,CAAC;AAmVrB;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAwDzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -5,7 +5,8 @@
5
5
  * Minimal shadows, monochromatic base with vibrant accents,
6
6
  * clean lines, and a focus on content clarity.
7
7
  */
8
- import { borderRadiusScale, durationScale, spacingScale, studioEasing, } from '../shared.js';
8
+ import { baselineTokens, opaqueGlass } from '../derive.js';
9
+ import { borderRadiusScale, darkInsetHighlight, durationScale, hairlineInset, hairlineMix, noInsetHighlight, noShadow, shadow, spacingScale, studioEasing, } from '../shared.js';
9
10
  /**
10
11
  * Studio light color palette
11
12
  * Monochromatic base with vibrant accent colors
@@ -26,6 +27,11 @@ const lightColors = {
26
27
  onTertiary: '#ffffff',
27
28
  tertiaryContainer: '#f3e8fd',
28
29
  onTertiaryContainer: '#6b12b8',
30
+ // Info - Shares the tertiary hue (no distinct info hue in this preset)
31
+ info: '#9334e6',
32
+ onInfo: '#ffffff',
33
+ infoContainer: '#f3e8fd',
34
+ onInfoContainer: '#6b12b8',
29
35
  // Error - Google red
30
36
  error: '#d93025',
31
37
  onError: '#ffffff',
@@ -91,6 +97,11 @@ const darkColors = {
91
97
  onTertiary: '#3e1385',
92
98
  tertiaryContainer: '#6b12b8',
93
99
  onTertiaryContainer: '#f3e8fd',
100
+ // Info - Shares the tertiary hue (no distinct info hue in this preset)
101
+ info: '#c58af9',
102
+ onInfo: '#3e1385',
103
+ infoContainer: '#6b12b8',
104
+ onInfoContainer: '#f3e8fd',
94
105
  // Error
95
106
  error: '#f28b82',
96
107
  onError: '#5c150c',
@@ -106,20 +117,20 @@ const darkColors = {
106
117
  onSuccess: '#0d3b1f',
107
118
  successContainer: '#137333',
108
119
  onSuccessContainer: '#e6f4ea',
109
- // Surface - Near black
110
- surface: '#0e0e0e',
120
+ // Surface - Cool flat greys; panel equals ground and is separated by a hairline
121
+ surface: '#131416',
111
122
  onSurface: '#e8eaed',
112
- surfaceVariant: '#1f1f1f',
123
+ surfaceVariant: '#1c1d20',
113
124
  onSurfaceVariant: '#9aa0a6',
114
- surfaceContainer: '#1f1f1f',
115
- surfaceContainerLow: '#141414',
116
- surfaceContainerHigh: '#2d2d2d',
117
- surfaceContainerHighest: '#3c4043',
118
- surfaceContainerLowest: '#0a0a0a',
119
- surfaceDim: '#141414',
120
- surfaceBright: '#2d2d2d',
125
+ surfaceContainer: '#1a1b1e',
126
+ surfaceContainerLow: '#16171a',
127
+ surfaceContainerHigh: '#202124',
128
+ surfaceContainerHighest: '#292a2d',
129
+ surfaceContainerLowest: '#0e0f10',
130
+ surfaceDim: '#0e0f10',
131
+ surfaceBright: '#2b2c2f',
121
132
  // Background
122
- background: '#0e0e0e',
133
+ background: '#131416',
123
134
  onBackground: '#e8eaed',
124
135
  // Outline
125
136
  outline: '#8c8e92',
@@ -141,35 +152,35 @@ const typography = {
141
152
  size: '3rem',
142
153
  lineHeight: '1.1',
143
154
  weight: '400',
144
- tracking: '-0.01em',
155
+ tracking: '-0.02em',
145
156
  fontFamily: 'var(--smrt-font-family)',
146
157
  },
147
158
  displayMedium: {
148
159
  size: '2.5rem',
149
160
  lineHeight: '1.15',
150
161
  weight: '400',
151
- tracking: '-0.008em',
162
+ tracking: '-0.015em',
152
163
  fontFamily: 'var(--smrt-font-family)',
153
164
  },
154
165
  displaySmall: {
155
166
  size: '2rem',
156
167
  lineHeight: '1.2',
157
168
  weight: '400',
158
- tracking: '-0.005em',
169
+ tracking: '-0.01em',
159
170
  fontFamily: 'var(--smrt-font-family)',
160
171
  },
161
172
  headlineLarge: {
162
173
  size: '1.75rem',
163
174
  lineHeight: '1.25',
164
175
  weight: '400',
165
- tracking: '0',
176
+ tracking: '-0.01em',
166
177
  fontFamily: 'var(--smrt-font-family)',
167
178
  },
168
179
  headlineMedium: {
169
180
  size: '1.5rem',
170
181
  lineHeight: '1.3',
171
182
  weight: '400',
172
- tracking: '0',
183
+ tracking: '-0.005em',
173
184
  fontFamily: 'var(--smrt-font-family)',
174
185
  },
175
186
  headlineSmall: {
@@ -225,14 +236,14 @@ const typography = {
225
236
  size: '0.875rem',
226
237
  lineHeight: '1.5',
227
238
  weight: '500',
228
- tracking: '0.02em',
239
+ tracking: '0.01em',
229
240
  fontFamily: 'var(--smrt-font-family)',
230
241
  },
231
242
  labelMedium: {
232
243
  size: '0.75rem',
233
244
  lineHeight: '1.5',
234
245
  weight: '500',
235
- tracking: '0.025em',
246
+ tracking: '0.02em',
236
247
  fontFamily: 'var(--smrt-font-family)',
237
248
  },
238
249
  labelSmall: {
@@ -244,33 +255,55 @@ const typography = {
244
255
  },
245
256
  };
246
257
  /**
247
- * Studio elevation (light) - Minimal, subtle shadows
248
- * Flat design philosophy with only slight depth indication
258
+ * Studio elevation (light) — flat. Level 1 is the hairline itself; the rest are
259
+ * crisp two-layer shadows (tight contact, short ambient) so overlays separate
260
+ * without softness.
249
261
  */
250
262
  const elevation = {
251
- 0: 'none',
252
- 1: 'inset 0 0 0 1px rgba(60, 64, 67, 0.08)',
253
- 2: '0 1px 2px 0 rgba(60, 64, 67, 0.08), 0 1px 3px 0 rgba(60, 64, 67, 0.04)',
254
- 3: '0 2px 4px 0 rgba(60, 64, 67, 0.1), 0 1px 2px 0 rgba(60, 64, 67, 0.06)',
255
- 4: '0 4px 8px 0 rgba(60, 64, 67, 0.1), 0 2px 4px 0 rgba(60, 64, 67, 0.06)',
256
- 5: '0 8px 16px 0 rgba(60, 64, 67, 0.12), 0 4px 8px 0 rgba(60, 64, 67, 0.06)',
263
+ 0: noShadow,
264
+ 1: hairlineInset,
265
+ 2: shadow([
266
+ [1, 2, 0, 10],
267
+ [2, 4, -2, 8],
268
+ ]),
269
+ 3: shadow([
270
+ [1, 2, 0, 12],
271
+ [4, 8, -3, 10],
272
+ ]),
273
+ 4: shadow([
274
+ [2, 3, 0, 12],
275
+ [8, 16, -4, 12],
276
+ ]),
277
+ 5: shadow([
278
+ [2, 4, 0, 14],
279
+ [16, 32, -8, 16],
280
+ ]),
257
281
  };
258
282
  /**
259
- * Studio elevation (dark) - Tuned for a near-black surface.
260
- *
261
- * The flat light shadows (tinted with the light surface color, very low alpha)
262
- * read as invisible on a dark surface, so dark mode uses a white inset hairline
263
- * at level 1 and deeper black shadows above it. Defining this here — rather than
264
- * only in the static `styles/studio.css` — keeps the JS ThemeProvider output and
265
- * the static dark CSS in lockstep (#1586).
283
+ * Studio elevation (dark) — the hairline at level 1, tighter shadows above it
284
+ * with the inset top highlight. Defined here (not only in the static
285
+ * `styles/studio.css`) so the JS ThemeProvider output and the static dark CSS
286
+ * stay in lockstep (#1586).
266
287
  */
267
288
  const darkElevation = {
268
- 0: 'none',
269
- 1: 'inset 0 0 0 1px rgba(255, 255, 255, 0.08)',
270
- 2: '0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.1)',
271
- 3: '0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 2px 0 rgba(0, 0, 0, 0.1)',
272
- 4: '0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1)',
273
- 5: '0 8px 16px 0 rgba(0, 0, 0, 0.25), 0 4px 8px 0 rgba(0, 0, 0, 0.1)',
289
+ 0: noShadow,
290
+ 1: hairlineInset,
291
+ 2: shadow([
292
+ [1, 2, 0, 28],
293
+ [2, 4, -2, 20],
294
+ ], 'var(--smrt-inset-highlight)'),
295
+ 3: shadow([
296
+ [1, 2, 0, 30],
297
+ [4, 8, -3, 24],
298
+ ], 'var(--smrt-inset-highlight)'),
299
+ 4: shadow([
300
+ [2, 3, 0, 32],
301
+ [8, 16, -4, 28],
302
+ ], 'var(--smrt-inset-highlight)'),
303
+ 5: shadow([
304
+ [2, 4, 0, 34],
305
+ [16, 32, -8, 32],
306
+ ], 'var(--smrt-inset-highlight)'),
274
307
  };
275
308
  /**
276
309
  * Studio theme definition
@@ -287,6 +320,49 @@ export const studioTheme = {
287
320
  borderRadius: borderRadiusScale,
288
321
  duration: durationScale,
289
322
  easing: studioEasing,
323
+ glass: { ...opaqueGlass },
324
+ ...baselineTokens(lightColors, darkColors),
325
+ shadowColor: { light: 'rgb(60 64 67)', dark: 'rgb(0 0 0)' },
326
+ // Flat: panel equals ground (a hairline separates them); controls sit a hair
327
+ // darker in light and a step lighter in dark; overlays are the highest tier.
328
+ surfaces: {
329
+ light: {
330
+ ground: lightColors.background,
331
+ panel: lightColors.surface,
332
+ control: '#f6f7f8',
333
+ raised: lightColors.surfaceContainerLowest,
334
+ sunken: lightColors.surfaceContainer,
335
+ overlay: lightColors.scrim,
336
+ },
337
+ dark: {
338
+ ground: darkColors.background,
339
+ panel: darkColors.surface,
340
+ control: '#1c1d20',
341
+ raised: darkColors.surfaceContainerHighest,
342
+ sunken: darkColors.surfaceContainerLowest,
343
+ overlay: darkColors.scrim,
344
+ },
345
+ },
346
+ hairlines: {
347
+ light: hairlineMix(12, 32, noInsetHighlight),
348
+ dark: hairlineMix(14, 32, darkInsetHighlight(0.05)),
349
+ },
350
+ states: {
351
+ hover: '0.06',
352
+ pressed: '0.10',
353
+ selected: '0.10',
354
+ focus: '0.10',
355
+ dragged: '0.14',
356
+ disabled: '0.38',
357
+ },
358
+ // Crisp: a 6px radius and a denser control height.
359
+ controls: {
360
+ radius: '0.375rem',
361
+ radiusSmall: 'var(--smrt-radius-sm)',
362
+ height: '2.5rem',
363
+ heightSmall: '2rem',
364
+ weight: '500',
365
+ },
290
366
  fontFamily: '"Google Sans Text", "Roboto", "Segoe UI", system-ui, sans-serif',
291
367
  };
292
368
  export default studioTheme;
@@ -32,3 +32,228 @@ textarea {
32
32
  font: inherit;
33
33
  }
34
34
  }
35
+
36
+ /*
37
+ * Typography (#3868). Headings and utilities consume the theme's type roles,
38
+ * so a preset's display face, tracking and weight reach plain markup. Hosts
39
+ * restyle with unlayered CSS; component styles in smrt.theme still win.
40
+ */
41
+ @layer smrt.structure {
42
+ :is(body, .smrt-theme-root) {
43
+ font-feature-settings: var(--smrt-font-feature-settings);
44
+ }
45
+
46
+ :is(body, .smrt-theme-root) h1 {
47
+ font-family: var(--smrt-typography-display-small-font-family);
48
+ font-size: var(--smrt-typography-display-small-size);
49
+ line-height: var(--smrt-typography-display-small-line-height);
50
+ font-weight: var(--smrt-typography-display-small-weight);
51
+ letter-spacing: var(--smrt-typography-display-small-tracking);
52
+ margin-block: var(--smrt-spacing-5) var(--smrt-spacing-3);
53
+ }
54
+
55
+ :is(body, .smrt-theme-root) h2 {
56
+ font-family: var(--smrt-typography-headline-large-font-family);
57
+ font-size: var(--smrt-typography-headline-large-size);
58
+ line-height: var(--smrt-typography-headline-large-line-height);
59
+ font-weight: var(--smrt-typography-headline-large-weight);
60
+ letter-spacing: var(--smrt-typography-headline-large-tracking);
61
+ margin-block: var(--smrt-spacing-5) var(--smrt-spacing-3);
62
+ }
63
+
64
+ :is(body, .smrt-theme-root) h3 {
65
+ font-family: var(--smrt-typography-headline-medium-font-family);
66
+ font-size: var(--smrt-typography-headline-medium-size);
67
+ line-height: var(--smrt-typography-headline-medium-line-height);
68
+ font-weight: var(--smrt-typography-headline-medium-weight);
69
+ letter-spacing: var(--smrt-typography-headline-medium-tracking);
70
+ margin-block: var(--smrt-spacing-4) var(--smrt-spacing-2);
71
+ }
72
+
73
+ :is(body, .smrt-theme-root) h4 {
74
+ font-family: var(--smrt-typography-headline-small-font-family);
75
+ font-size: var(--smrt-typography-headline-small-size);
76
+ line-height: var(--smrt-typography-headline-small-line-height);
77
+ font-weight: var(--smrt-typography-headline-small-weight);
78
+ letter-spacing: var(--smrt-typography-headline-small-tracking);
79
+ margin-block: var(--smrt-spacing-4) var(--smrt-spacing-2);
80
+ }
81
+
82
+ :is(body, .smrt-theme-root) h5 {
83
+ font-family: var(--smrt-typography-title-large-font-family);
84
+ font-size: var(--smrt-typography-title-large-size);
85
+ line-height: var(--smrt-typography-title-large-line-height);
86
+ font-weight: var(--smrt-typography-title-large-weight);
87
+ letter-spacing: var(--smrt-typography-title-large-tracking);
88
+ margin-block: var(--smrt-spacing-4) var(--smrt-spacing-2);
89
+ }
90
+
91
+ :is(body, .smrt-theme-root) h6 {
92
+ font-family: var(--smrt-typography-title-medium-font-family);
93
+ font-size: var(--smrt-typography-title-medium-size);
94
+ line-height: var(--smrt-typography-title-medium-line-height);
95
+ font-weight: var(--smrt-typography-title-medium-weight);
96
+ letter-spacing: var(--smrt-typography-title-medium-tracking);
97
+ margin-block: var(--smrt-spacing-4) var(--smrt-spacing-2);
98
+ }
99
+
100
+ :is(body, .smrt-theme-root) :is(h1, h2, h3, h4, h5, h6):first-child {
101
+ margin-block-start: 0;
102
+ }
103
+
104
+ .smrt-display-large {
105
+ font-family: var(--smrt-typography-display-large-font-family);
106
+ font-size: var(--smrt-typography-display-large-size);
107
+ line-height: var(--smrt-typography-display-large-line-height);
108
+ font-weight: var(--smrt-typography-display-large-weight);
109
+ letter-spacing: var(--smrt-typography-display-large-tracking);
110
+ }
111
+
112
+ .smrt-display-medium {
113
+ font-family: var(--smrt-typography-display-medium-font-family);
114
+ font-size: var(--smrt-typography-display-medium-size);
115
+ line-height: var(--smrt-typography-display-medium-line-height);
116
+ font-weight: var(--smrt-typography-display-medium-weight);
117
+ letter-spacing: var(--smrt-typography-display-medium-tracking);
118
+ }
119
+
120
+ .smrt-display-small {
121
+ font-family: var(--smrt-typography-display-small-font-family);
122
+ font-size: var(--smrt-typography-display-small-size);
123
+ line-height: var(--smrt-typography-display-small-line-height);
124
+ font-weight: var(--smrt-typography-display-small-weight);
125
+ letter-spacing: var(--smrt-typography-display-small-tracking);
126
+ }
127
+
128
+ .smrt-headline-large {
129
+ font-family: var(--smrt-typography-headline-large-font-family);
130
+ font-size: var(--smrt-typography-headline-large-size);
131
+ line-height: var(--smrt-typography-headline-large-line-height);
132
+ font-weight: var(--smrt-typography-headline-large-weight);
133
+ letter-spacing: var(--smrt-typography-headline-large-tracking);
134
+ }
135
+
136
+ .smrt-headline-medium {
137
+ font-family: var(--smrt-typography-headline-medium-font-family);
138
+ font-size: var(--smrt-typography-headline-medium-size);
139
+ line-height: var(--smrt-typography-headline-medium-line-height);
140
+ font-weight: var(--smrt-typography-headline-medium-weight);
141
+ letter-spacing: var(--smrt-typography-headline-medium-tracking);
142
+ }
143
+
144
+ .smrt-headline-small {
145
+ font-family: var(--smrt-typography-headline-small-font-family);
146
+ font-size: var(--smrt-typography-headline-small-size);
147
+ line-height: var(--smrt-typography-headline-small-line-height);
148
+ font-weight: var(--smrt-typography-headline-small-weight);
149
+ letter-spacing: var(--smrt-typography-headline-small-tracking);
150
+ }
151
+
152
+ .smrt-title-large {
153
+ font-family: var(--smrt-typography-title-large-font-family);
154
+ font-size: var(--smrt-typography-title-large-size);
155
+ line-height: var(--smrt-typography-title-large-line-height);
156
+ font-weight: var(--smrt-typography-title-large-weight);
157
+ letter-spacing: var(--smrt-typography-title-large-tracking);
158
+ }
159
+
160
+ .smrt-title-medium {
161
+ font-family: var(--smrt-typography-title-medium-font-family);
162
+ font-size: var(--smrt-typography-title-medium-size);
163
+ line-height: var(--smrt-typography-title-medium-line-height);
164
+ font-weight: var(--smrt-typography-title-medium-weight);
165
+ letter-spacing: var(--smrt-typography-title-medium-tracking);
166
+ }
167
+
168
+ .smrt-title-small {
169
+ font-family: var(--smrt-typography-title-small-font-family);
170
+ font-size: var(--smrt-typography-title-small-size);
171
+ line-height: var(--smrt-typography-title-small-line-height);
172
+ font-weight: var(--smrt-typography-title-small-weight);
173
+ letter-spacing: var(--smrt-typography-title-small-tracking);
174
+ }
175
+
176
+ .smrt-body-large {
177
+ font-family: var(--smrt-typography-body-large-font-family);
178
+ font-size: var(--smrt-typography-body-large-size);
179
+ line-height: var(--smrt-typography-body-large-line-height);
180
+ font-weight: var(--smrt-typography-body-large-weight);
181
+ letter-spacing: var(--smrt-typography-body-large-tracking);
182
+ }
183
+
184
+ .smrt-body-medium {
185
+ font-family: var(--smrt-typography-body-medium-font-family);
186
+ font-size: var(--smrt-typography-body-medium-size);
187
+ line-height: var(--smrt-typography-body-medium-line-height);
188
+ font-weight: var(--smrt-typography-body-medium-weight);
189
+ letter-spacing: var(--smrt-typography-body-medium-tracking);
190
+ }
191
+
192
+ .smrt-body-small {
193
+ font-family: var(--smrt-typography-body-small-font-family);
194
+ font-size: var(--smrt-typography-body-small-size);
195
+ line-height: var(--smrt-typography-body-small-line-height);
196
+ font-weight: var(--smrt-typography-body-small-weight);
197
+ letter-spacing: var(--smrt-typography-body-small-tracking);
198
+ }
199
+
200
+ .smrt-label-large {
201
+ font-family: var(--smrt-typography-label-large-font-family);
202
+ font-size: var(--smrt-typography-label-large-size);
203
+ line-height: var(--smrt-typography-label-large-line-height);
204
+ font-weight: var(--smrt-typography-label-large-weight);
205
+ letter-spacing: var(--smrt-typography-label-large-tracking);
206
+ }
207
+
208
+ .smrt-label-medium {
209
+ font-family: var(--smrt-typography-label-medium-font-family);
210
+ font-size: var(--smrt-typography-label-medium-size);
211
+ line-height: var(--smrt-typography-label-medium-line-height);
212
+ font-weight: var(--smrt-typography-label-medium-weight);
213
+ letter-spacing: var(--smrt-typography-label-medium-tracking);
214
+ }
215
+
216
+ .smrt-label-small {
217
+ font-family: var(--smrt-typography-label-small-font-family);
218
+ font-size: var(--smrt-typography-label-small-size);
219
+ line-height: var(--smrt-typography-label-small-line-height);
220
+ font-weight: var(--smrt-typography-label-small-weight);
221
+ letter-spacing: var(--smrt-typography-label-small-tracking);
222
+ }
223
+
224
+ table,
225
+ time,
226
+ [data-smrt-component="DataTable"],
227
+ [data-smrt-component="Badge"],
228
+ .smrt-tabular {
229
+ font-variant-numeric: tabular-nums;
230
+ }
231
+ }
232
+
233
+ /* Native chrome and scheme crossfade (premium baseline, #3867). */
234
+ @layer smrt.theme {
235
+ :root,
236
+ .smrt-theme-root {
237
+ accent-color: var(--smrt-accent-color);
238
+ caret-color: var(--smrt-caret-color);
239
+ scrollbar-color: var(--smrt-scrollbar-thumb) var(--smrt-scrollbar-track);
240
+ }
241
+
242
+ ::selection {
243
+ background: var(--smrt-selection-background);
244
+ color: var(--smrt-selection-color);
245
+ }
246
+
247
+ /* ThemeProvider sets data-smrt-theme-changing for the length of a scheme switch. */
248
+ @media (prefers-reduced-motion: no-preference) {
249
+ .smrt-theme-root[data-smrt-theme-changing],
250
+ .smrt-theme-root[data-smrt-theme-changing] * {
251
+ transition:
252
+ background-color var(--smrt-duration-scheme) var(--smrt-easing-standard),
253
+ color var(--smrt-duration-scheme) var(--smrt-easing-standard),
254
+ border-color var(--smrt-duration-scheme) var(--smrt-easing-standard),
255
+ fill var(--smrt-duration-scheme) var(--smrt-easing-standard),
256
+ stroke var(--smrt-duration-scheme) var(--smrt-easing-standard);
257
+ }
258
+ }
259
+ }