@happyvertical/smrt-ui 0.55.16 → 0.55.18
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/AGENTS.md +14 -0
- package/README.md +75 -0
- package/dist/components/calendar/Calendar.svelte +59 -56
- package/dist/components/calendar/CalendarView.svelte +80 -77
- package/dist/components/calendar/DayView.svelte +39 -36
- package/dist/components/chat/MessageBubble.svelte +26 -23
- package/dist/components/chat/ReactionPicker.svelte +12 -9
- package/dist/components/chat/TypingIndicator.svelte +12 -9
- package/dist/components/data/CollectionList.svelte +11 -8
- package/dist/components/data/CollectionToolbar.svelte +5 -2
- package/dist/components/data/DataTable.svelte +74 -59
- package/dist/components/data/ListSortSelect.svelte +8 -5
- package/dist/components/data/SortableHeader.svelte +10 -7
- package/dist/components/display/ConfidenceBadge.svelte +11 -8
- package/dist/components/display/CurrencyDisplay.svelte +7 -4
- package/dist/components/display/DateDisplay.svelte +6 -3
- package/dist/components/display/Icon.svelte +4 -1
- package/dist/components/display/StatusBadge.svelte +9 -6
- package/dist/components/feedback/Alert.svelte +12 -8
- package/dist/components/feedback/ConfirmDialog.svelte +13 -10
- package/dist/components/feedback/LoadingOverlay.svelte +37 -34
- package/dist/components/feedback/Meter.svelte +4 -1
- package/dist/components/feedback/Modal.svelte +26 -21
- package/dist/components/feedback/PhoneSheet.svelte +6 -3
- package/dist/components/feedback/Progress.svelte +8 -5
- package/dist/components/feedback/ProgressBar.svelte +13 -10
- package/dist/components/feedback/Spinner.svelte +4 -1
- package/dist/components/feedback/ToastViewport.svelte +18 -15
- package/dist/components/feedback/WorkingStrip.svelte +6 -3
- package/dist/components/forms/CameraCapture.svelte +8 -5
- package/dist/components/forms/Checkbox.svelte +11 -8
- package/dist/components/forms/Combobox.svelte +5 -2
- package/dist/components/forms/DatePicker.svelte +7 -2
- package/dist/components/forms/DictationButton.svelte +17 -14
- package/dist/components/forms/DictationStatus.svelte +12 -9
- package/dist/components/forms/ErrorSummary.svelte +4 -1
- package/dist/components/forms/FieldLabel.svelte +9 -6
- package/dist/components/forms/Fieldset.svelte +4 -1
- package/dist/components/forms/FilePicker.svelte +5 -2
- package/dist/components/forms/Form.svelte +1 -1
- package/dist/components/forms/FormActionBar.svelte +4 -1
- package/dist/components/forms/FormGroup.svelte +6 -3
- package/dist/components/forms/Input.svelte +22 -15
- package/dist/components/forms/InputGroup.svelte +6 -3
- package/dist/components/forms/Listbox.svelte +5 -2
- package/dist/components/forms/MultiSelect.svelte +4 -1
- package/dist/components/forms/Radio.svelte +9 -6
- package/dist/components/forms/RadioGroup.svelte +5 -2
- package/dist/components/forms/RangeSlider.svelte +5 -2
- package/dist/components/forms/RelationInput.svelte +7 -4
- package/dist/components/forms/SearchInput.svelte +7 -4
- package/dist/components/forms/SegmentedControl.svelte +6 -3
- package/dist/components/forms/Select.svelte +20 -13
- package/dist/components/forms/SignaturePad.svelte +8 -5
- package/dist/components/forms/Slider.svelte +5 -2
- package/dist/components/forms/StagedControlReview.svelte +15 -12
- package/dist/components/forms/Switch.svelte +8 -5
- package/dist/components/forms/TagsInput.svelte +5 -2
- package/dist/components/forms/Textarea.svelte +20 -13
- package/dist/components/forms/TimePicker.svelte +7 -2
- package/dist/components/forms/Toggle.svelte +14 -11
- package/dist/components/forms/ToggleButton.svelte +5 -2
- package/dist/components/layout/ActionGroup.svelte +4 -1
- package/dist/components/layout/Container.svelte +4 -1
- package/dist/components/layout/EmptyState.svelte +11 -8
- package/dist/components/layout/Footer.svelte +4 -1
- package/dist/components/layout/Grid.svelte +13 -10
- package/dist/components/layout/Header.svelte +4 -1
- package/dist/components/layout/Masthead.svelte +4 -1
- package/dist/components/layout/PageHeader.svelte +12 -9
- package/dist/components/layout/PageLayout.svelte +3 -0
- package/dist/components/layout/SummaryCard.svelte +9 -6
- package/dist/components/memberships/MembershipCard.svelte +5 -2
- package/dist/components/memberships/MembershipList.svelte +5 -2
- package/dist/components/nav/FilterChips.svelte +13 -10
- package/dist/components/nav/Tabs.svelte +75 -41
- package/dist/components/permissions/PermissionPicker.svelte +5 -2
- package/dist/components/roles/RoleBadge.svelte +8 -5
- package/dist/components/roles/RoleSelector.svelte +22 -19
- package/dist/components/theme/ThemeProvider.svelte +7 -4
- package/dist/components/ui/Accordion.svelte +4 -1
- package/dist/components/ui/AccordionItem.svelte +5 -2
- package/dist/components/ui/Avatar.svelte +10 -7
- package/dist/components/ui/Badge.svelte +6 -2
- package/dist/components/ui/Button.svelte +49 -37
- package/dist/components/ui/Card.svelte +18 -14
- package/dist/components/ui/Chip.svelte +41 -14
- package/dist/components/ui/Disclosure.svelte +5 -2
- package/dist/components/ui/Dropdown.svelte +33 -25
- package/dist/components/ui/IconToggle.svelte +12 -9
- package/dist/components/ui/IconToggle.svelte.d.ts +1 -1
- package/dist/components/ui/IconToggle.svelte.d.ts.map +1 -1
- package/dist/components/ui/IconToggleGroup.svelte +8 -5
- package/dist/components/ui/Pagination.svelte +11 -8
- package/dist/components/ui/Popover.svelte +9 -6
- package/dist/components/ui/Skeleton.svelte +10 -7
- package/dist/components/ui/Tooltip.svelte +13 -9
- package/dist/components/ui/Tree.svelte +12 -9
- package/dist/styles/layers.css +8 -0
- package/dist/styles/layers.d.ts +9 -0
- package/dist/styles/layers.d.ts.map +1 -0
- package/dist/styles/layers.js +8 -0
- package/dist/styles/tokens.css +27 -69
- package/dist/styles/unstyled.css +65 -0
- package/dist/svelte/playground/BaseControlsPreview.svelte +3 -0
- package/dist/svelte/playground/CalendarPreview.svelte +5 -2
- package/dist/svelte/playground/CapturePreview.svelte +3 -0
- package/dist/svelte/playground/CodeSelectorsPreview.svelte +3 -0
- package/dist/svelte/playground/CollectionsPreview.svelte +3 -0
- package/dist/svelte/playground/DataTablePreview.svelte +3 -0
- package/dist/svelte/playground/FeedbackPreview.svelte +3 -0
- package/dist/svelte/playground/InteractiveControlsPreview.svelte +3 -0
- package/dist/svelte/playground/StylelessPreview.svelte +110 -0
- package/dist/svelte/playground/StylelessPreview.svelte.d.ts +4 -0
- package/dist/svelte/playground/StylelessPreview.svelte.d.ts.map +1 -0
- package/dist/svelte/playground.d.ts.map +1 -1
- package/dist/svelte/playground.js +10 -0
- package/dist/test-support/setup.js +9 -0
- package/dist/theme/ThemeProvider.svelte +3 -0
- package/dist/themes/CUSTOM_THEME_GUIDE.md +40 -0
- package/dist/themes/README.md +151 -0
- package/dist/themes/ThemeProvider.svelte +181 -12
- package/dist/themes/ThemeProvider.svelte.d.ts +7 -2
- package/dist/themes/ThemeProvider.svelte.d.ts.map +1 -1
- package/dist/themes/components/ColorSchemeToggle.svelte +17 -14
- package/dist/themes/components/ThemeSwitcher.svelte +14 -11
- package/dist/themes/create-theme.d.ts +22 -1
- package/dist/themes/create-theme.d.ts.map +1 -1
- package/dist/themes/create-theme.js +100 -9
- package/dist/themes/css-generator.d.ts.map +1 -1
- package/dist/themes/css-generator.js +20 -20
- package/dist/themes/derive.d.ts +31 -0
- package/dist/themes/derive.d.ts.map +1 -0
- package/dist/themes/derive.js +183 -0
- package/dist/themes/glass/index.d.ts.map +1 -1
- package/dist/themes/glass/index.js +127 -14
- package/dist/themes/happyvertical/index.d.ts.map +1 -1
- package/dist/themes/happyvertical/index.js +101 -20
- package/dist/themes/index.d.ts +2 -2
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +1 -1
- package/dist/themes/material/index.d.ts.map +1 -1
- package/dist/themes/material/index.js +129 -28
- package/dist/themes/required-tokens.generated.json +201 -0
- package/dist/themes/shared.d.ts +35 -0
- package/dist/themes/shared.d.ts.map +1 -1
- package/dist/themes/shared.js +32 -0
- package/dist/themes/smrt/index.d.ts +3 -0
- package/dist/themes/smrt/index.d.ts.map +1 -1
- package/dist/themes/smrt/index.js +108 -26
- package/dist/themes/studio/index.d.ts.map +1 -1
- package/dist/themes/studio/index.js +116 -40
- package/dist/themes/styles/base.css +229 -1
- package/dist/themes/styles/glass.css +107 -20
- package/dist/themes/styles/happyvertical.css +111 -15
- package/dist/themes/styles/material.css +127 -35
- package/dist/themes/styles/smrt.css +126 -31
- package/dist/themes/styles/studio.css +132 -37
- package/dist/themes/theme-script.d.ts +3 -1
- package/dist/themes/theme-script.d.ts.map +1 -1
- package/dist/themes/theme-script.js +7 -2
- package/dist/themes/types.d.ts +118 -6
- package/dist/themes/types.d.ts.map +1 -1
- package/dist/utils/theme/typography.d.ts +21 -21
- package/dist/utils/theme/typography.js +21 -21
- package/package.json +8 -2
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* translucency, and layered depth. Features frosted glass surfaces
|
|
6
6
|
* and vibrant material effects.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { baselineTokens } from '../derive.js';
|
|
9
|
+
import { appleEasing, borderRadiusScale, darkInsetHighlight, durationScale, hairlineMix, noInsetHighlight, noShadow, shadow, spacingScale, } from '../shared.js';
|
|
9
10
|
/**
|
|
10
11
|
* Glass light color palette
|
|
11
12
|
* Translucent whites with subtle color tints
|
|
@@ -26,6 +27,11 @@ const lightColors = {
|
|
|
26
27
|
onTertiary: '#ffffff',
|
|
27
28
|
tertiaryContainer: 'rgba(88, 86, 214, 0.15)',
|
|
28
29
|
onTertiaryContainer: '#2a2866',
|
|
30
|
+
// Info - Shares the tertiary hue (no distinct info hue in this preset)
|
|
31
|
+
info: '#5856d6',
|
|
32
|
+
onInfo: '#ffffff',
|
|
33
|
+
infoContainer: 'rgba(88, 86, 214, 0.15)',
|
|
34
|
+
onInfoContainer: '#2a2866',
|
|
29
35
|
// Error - System red
|
|
30
36
|
error: '#ff3b30',
|
|
31
37
|
onError: '#ffffff',
|
|
@@ -96,6 +102,11 @@ const darkColors = {
|
|
|
96
102
|
onTertiary: '#ffffff',
|
|
97
103
|
tertiaryContainer: 'rgba(94, 92, 230, 0.25)',
|
|
98
104
|
onTertiaryContainer: '#d4d3ff',
|
|
105
|
+
// Info - Shares the tertiary hue (no distinct info hue in this preset)
|
|
106
|
+
info: '#5e5ce6',
|
|
107
|
+
onInfo: '#ffffff',
|
|
108
|
+
infoContainer: 'rgba(94, 92, 230, 0.25)',
|
|
109
|
+
onInfoContainer: '#d4d3ff',
|
|
99
110
|
// Error
|
|
100
111
|
error: '#ff453a',
|
|
101
112
|
onError: '#000000',
|
|
@@ -112,7 +123,7 @@ const darkColors = {
|
|
|
112
123
|
successContainer: 'rgba(48, 209, 88, 0.25)',
|
|
113
124
|
onSuccessContainer: '#b8f5c9',
|
|
114
125
|
// Surface - Translucent darks
|
|
115
|
-
surface: 'rgba(
|
|
126
|
+
surface: 'rgba(29, 29, 38, 0.72)',
|
|
116
127
|
onSurface: '#ffffff',
|
|
117
128
|
surfaceVariant: 'rgba(44, 44, 46, 0.65)',
|
|
118
129
|
onSurfaceVariant: '#8e8e93',
|
|
@@ -124,7 +135,7 @@ const darkColors = {
|
|
|
124
135
|
surfaceDim: 'rgba(0, 0, 0, 0.3)',
|
|
125
136
|
surfaceBright: 'rgba(58, 58, 60, 0.9)',
|
|
126
137
|
// Background - Deep dark with subtle tint
|
|
127
|
-
background: '#
|
|
138
|
+
background: '#0b0b0f',
|
|
128
139
|
onBackground: '#ffffff',
|
|
129
140
|
// Outline — see the light-scheme note. Composited over the dark frosted
|
|
130
141
|
// surface the original rgba(84, 84, 88, 0.65) measured 1.70:1; lightening the
|
|
@@ -139,7 +150,7 @@ const darkColors = {
|
|
|
139
150
|
shadow: 'rgba(0, 0, 0, 0.4)',
|
|
140
151
|
scrim: 'rgba(0, 0, 0, 0.6)',
|
|
141
152
|
// Glass-specific
|
|
142
|
-
glassBackdrop: 'rgba(
|
|
153
|
+
glassBackdrop: 'rgba(29, 29, 38, 0.72)',
|
|
143
154
|
glassBorder: 'rgba(255, 255, 255, 0.1)',
|
|
144
155
|
};
|
|
145
156
|
/**
|
|
@@ -248,31 +259,88 @@ const typography = {
|
|
|
248
259
|
labelSmall: {
|
|
249
260
|
size: '0.6875rem',
|
|
250
261
|
lineHeight: '1.3',
|
|
251
|
-
weight: '
|
|
262
|
+
weight: '500',
|
|
252
263
|
tracking: '-0.004em',
|
|
253
264
|
fontFamily: 'var(--smrt-font-family)',
|
|
254
265
|
},
|
|
255
266
|
};
|
|
256
267
|
/**
|
|
257
|
-
* Glass elevation
|
|
258
|
-
*
|
|
268
|
+
* Glass elevation (light) — soft, diffuse two-layer shadows: a faint contact
|
|
269
|
+
* line and a wide ambient layer with negative spread so panels float without a
|
|
270
|
+
* hard edge.
|
|
259
271
|
*/
|
|
260
272
|
const elevation = {
|
|
261
|
-
0:
|
|
262
|
-
1:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
273
|
+
0: noShadow,
|
|
274
|
+
1: shadow([
|
|
275
|
+
[1, 2, 0, 5],
|
|
276
|
+
[2, 6, -2, 5],
|
|
277
|
+
]),
|
|
278
|
+
2: shadow([
|
|
279
|
+
[1, 3, 0, 6],
|
|
280
|
+
[6, 14, -4, 8],
|
|
281
|
+
]),
|
|
282
|
+
3: shadow([
|
|
283
|
+
[2, 4, 0, 7],
|
|
284
|
+
[12, 24, -8, 10],
|
|
285
|
+
]),
|
|
286
|
+
4: shadow([
|
|
287
|
+
[2, 6, 0, 8],
|
|
288
|
+
[20, 40, -12, 12],
|
|
289
|
+
]),
|
|
290
|
+
5: shadow([
|
|
291
|
+
[4, 8, 0, 8],
|
|
292
|
+
[32, 64, -16, 16],
|
|
293
|
+
]),
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Glass elevation (dark) — translucency and the inset top highlight carry the
|
|
297
|
+
* depth; the shadows only support it.
|
|
298
|
+
*/
|
|
299
|
+
const darkElevation = {
|
|
300
|
+
0: noShadow,
|
|
301
|
+
1: shadow([
|
|
302
|
+
[1, 2, 0, 20],
|
|
303
|
+
[2, 6, -2, 14],
|
|
304
|
+
]),
|
|
305
|
+
2: shadow([
|
|
306
|
+
[1, 3, 0, 24],
|
|
307
|
+
[6, 14, -4, 18],
|
|
308
|
+
], 'var(--smrt-inset-highlight)'),
|
|
309
|
+
3: shadow([
|
|
310
|
+
[2, 4, 0, 26],
|
|
311
|
+
[12, 24, -8, 22],
|
|
312
|
+
], 'var(--smrt-inset-highlight)'),
|
|
313
|
+
4: shadow([
|
|
314
|
+
[2, 6, 0, 28],
|
|
315
|
+
[20, 40, -12, 26],
|
|
316
|
+
], 'var(--smrt-inset-highlight)'),
|
|
317
|
+
5: shadow([
|
|
318
|
+
[4, 8, 0, 30],
|
|
319
|
+
[32, 64, -16, 30],
|
|
320
|
+
], 'var(--smrt-inset-highlight)'),
|
|
267
321
|
};
|
|
268
322
|
/**
|
|
269
323
|
* Glass effect configuration
|
|
270
324
|
*/
|
|
271
325
|
const glassEffects = {
|
|
272
326
|
blur: '20px',
|
|
273
|
-
|
|
327
|
+
// Deprecated aliases, still emitted for consumers of the old opacity tokens.
|
|
274
328
|
borderOpacity: '0.3',
|
|
275
329
|
backgroundOpacity: '0.72',
|
|
330
|
+
saturation: '180%',
|
|
331
|
+
// Translucent frosted surfaces; the opacity is part of each colour.
|
|
332
|
+
surfaces: {
|
|
333
|
+
light: {
|
|
334
|
+
surface: 'color-mix(in srgb, #ffffff 72%, transparent)',
|
|
335
|
+
surfaceStrong: 'color-mix(in srgb, #ffffff 88%, transparent)',
|
|
336
|
+
border: 'var(--smrt-hairline-color)',
|
|
337
|
+
},
|
|
338
|
+
dark: {
|
|
339
|
+
surface: 'color-mix(in srgb, #1d1d26 72%, transparent)',
|
|
340
|
+
surfaceStrong: 'color-mix(in srgb, #1d1d26 88%, transparent)',
|
|
341
|
+
border: 'color-mix(in srgb, #ffffff 10%, transparent)',
|
|
342
|
+
},
|
|
343
|
+
},
|
|
276
344
|
};
|
|
277
345
|
/**
|
|
278
346
|
* Glass theme definition
|
|
@@ -284,10 +352,55 @@ export const glassTheme = {
|
|
|
284
352
|
dark: darkColors,
|
|
285
353
|
typography,
|
|
286
354
|
elevation,
|
|
355
|
+
darkElevation,
|
|
287
356
|
spacing: spacingScale,
|
|
288
357
|
borderRadius: borderRadiusScale,
|
|
289
358
|
duration: durationScale,
|
|
290
359
|
easing: appleEasing,
|
|
360
|
+
...baselineTokens(lightColors, darkColors),
|
|
361
|
+
shadowColor: { light: 'rgb(0 0 0)', dark: 'rgb(0 0 0)' },
|
|
362
|
+
// The ladder is expressed through translucency over the ground. Panels are
|
|
363
|
+
// frosted glass (72%), inputs are recessed glass (a tinted well that reads as
|
|
364
|
+
// pressed into the panel), and popovers are thicker glass (88%).
|
|
365
|
+
surfaces: {
|
|
366
|
+
light: {
|
|
367
|
+
ground: lightColors.background,
|
|
368
|
+
panel: 'color-mix(in srgb, #ffffff 72%, transparent)',
|
|
369
|
+
control: 'color-mix(in srgb, #767680 12%, transparent)',
|
|
370
|
+
raised: 'color-mix(in srgb, #ffffff 88%, transparent)',
|
|
371
|
+
sunken: 'color-mix(in srgb, #767680 8%, transparent)',
|
|
372
|
+
overlay: lightColors.scrim,
|
|
373
|
+
},
|
|
374
|
+
dark: {
|
|
375
|
+
ground: darkColors.background,
|
|
376
|
+
panel: 'color-mix(in srgb, #1d1d26 72%, transparent)',
|
|
377
|
+
control: 'color-mix(in srgb, #000000 28%, transparent)',
|
|
378
|
+
raised: 'color-mix(in srgb, #2a2a34 88%, transparent)',
|
|
379
|
+
sunken: 'color-mix(in srgb, #000000 38%, transparent)',
|
|
380
|
+
overlay: darkColors.scrim,
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
hairlines: {
|
|
384
|
+
light: hairlineMix(10, 26, noInsetHighlight),
|
|
385
|
+
dark: hairlineMix(12, 28, darkInsetHighlight(0.1)),
|
|
386
|
+
},
|
|
387
|
+
// Slightly stronger than Material: translucent fills need a firmer response.
|
|
388
|
+
states: {
|
|
389
|
+
hover: '0.10',
|
|
390
|
+
pressed: '0.14',
|
|
391
|
+
selected: '0.14',
|
|
392
|
+
focus: '0.14',
|
|
393
|
+
dragged: '0.18',
|
|
394
|
+
disabled: '0.38',
|
|
395
|
+
},
|
|
396
|
+
// Pill-ish controls: radius lg.
|
|
397
|
+
controls: {
|
|
398
|
+
radius: 'var(--smrt-radius-lg)',
|
|
399
|
+
radiusSmall: 'var(--smrt-radius-md)',
|
|
400
|
+
height: '2.75rem',
|
|
401
|
+
heightSmall: '2.25rem',
|
|
402
|
+
weight: '500',
|
|
403
|
+
},
|
|
291
404
|
glass: glassEffects,
|
|
292
405
|
fontFamily: '-apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif',
|
|
293
406
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/happyvertical/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/happyvertical/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAUH,OAAO,KAAK,EAMV,KAAK,EAEN,MAAM,aAAa,CAAC;AA2YrB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAkEhC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
* lifting the top of the ramp past the bezel, which drops `on-surface-variant`
|
|
60
60
|
* below AA on those surfaces — the wrong trade.
|
|
61
61
|
*/
|
|
62
|
-
import {
|
|
62
|
+
import { baselineTokens, opaqueGlass } from '../derive.js';
|
|
63
|
+
import { hairlineInset, noInsetHighlight, noShadow, shadow, spacingScale, } from '../shared.js';
|
|
63
64
|
/** Display family (headings, titles) — falls back when the fonts are absent. */
|
|
64
65
|
const DISPLAY_FONT = '"Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif';
|
|
65
66
|
/** Body/UI family. */
|
|
@@ -89,6 +90,11 @@ const lightColors = {
|
|
|
89
90
|
onTertiary: '#ffffff',
|
|
90
91
|
tertiaryContainer: '#d7e4ea',
|
|
91
92
|
onTertiaryContainer: '#1b333e',
|
|
93
|
+
// Info - Shares the tertiary hue (no distinct info hue in this preset)
|
|
94
|
+
info: '#3c5a68',
|
|
95
|
+
onInfo: '#ffffff',
|
|
96
|
+
infoContainer: '#d7e4ea',
|
|
97
|
+
onInfoContainer: '#1b333e',
|
|
92
98
|
// Error - Muted enamel-compatible red
|
|
93
99
|
error: '#9b3b32',
|
|
94
100
|
onError: '#ffffff',
|
|
@@ -154,6 +160,11 @@ const darkColors = {
|
|
|
154
160
|
onTertiary: '#10262e',
|
|
155
161
|
tertiaryContainer: '#1e313a',
|
|
156
162
|
onTertiaryContainer: '#c6dee8',
|
|
163
|
+
// Info - Shares the tertiary hue (no distinct info hue in this preset)
|
|
164
|
+
info: '#9cbecc',
|
|
165
|
+
onInfo: '#10262e',
|
|
166
|
+
infoContainer: '#1e313a',
|
|
167
|
+
onInfoContainer: '#c6dee8',
|
|
157
168
|
// Error
|
|
158
169
|
error: '#e89b92',
|
|
159
170
|
onError: '#3b120d',
|
|
@@ -313,31 +324,49 @@ const typography = {
|
|
|
313
324
|
/**
|
|
314
325
|
* Day Shift elevation (light) — flat with hairline bezels.
|
|
315
326
|
*
|
|
316
|
-
* Level 1 is the hairline itself; levels 2+ add the minimum
|
|
317
|
-
* still separates an overlay from the panel underneath. Closer to
|
|
318
|
-
* to material — a raised faceplate, not a floating card.
|
|
327
|
+
* Level 1 is the bezel hairline itself; levels 2+ add the minimum two-layer
|
|
328
|
+
* shadow that still separates an overlay from the panel underneath. Closer to
|
|
329
|
+
* studio than to material — a raised faceplate, not a floating card.
|
|
319
330
|
*/
|
|
320
331
|
const elevation = {
|
|
321
|
-
0:
|
|
322
|
-
1:
|
|
323
|
-
2:
|
|
324
|
-
3:
|
|
325
|
-
|
|
326
|
-
|
|
332
|
+
0: noShadow,
|
|
333
|
+
1: hairlineInset,
|
|
334
|
+
2: shadow([[1, 2, 0, 8]]),
|
|
335
|
+
3: shadow([
|
|
336
|
+
[1, 2, 0, 8],
|
|
337
|
+
[2, 6, -2, 8],
|
|
338
|
+
]),
|
|
339
|
+
4: shadow([
|
|
340
|
+
[1, 3, 0, 10],
|
|
341
|
+
[6, 16, -6, 12],
|
|
342
|
+
]),
|
|
343
|
+
5: shadow([
|
|
344
|
+
[2, 4, 0, 10],
|
|
345
|
+
[12, 28, -12, 16],
|
|
346
|
+
]),
|
|
327
347
|
};
|
|
328
348
|
/**
|
|
329
|
-
* Day Shift elevation (dark) —
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
349
|
+
* Day Shift elevation (dark) — the bezel hairline at level 1; above it the
|
|
350
|
+
* inset top highlight over black two-layer shadows. Defined here (not only in
|
|
351
|
+
* `styles/happyvertical.css`) so the JS ThemeProvider output and the static dark
|
|
352
|
+
* CSS stay in lockstep (#1586).
|
|
333
353
|
*/
|
|
334
354
|
const darkElevation = {
|
|
335
|
-
0:
|
|
336
|
-
1:
|
|
337
|
-
2:
|
|
338
|
-
3:
|
|
339
|
-
|
|
340
|
-
|
|
355
|
+
0: noShadow,
|
|
356
|
+
1: hairlineInset,
|
|
357
|
+
2: shadow([[1, 2, 0, 40]], 'var(--smrt-inset-highlight)'),
|
|
358
|
+
3: shadow([
|
|
359
|
+
[1, 2, 0, 40],
|
|
360
|
+
[2, 6, -2, 36],
|
|
361
|
+
], 'var(--smrt-inset-highlight)'),
|
|
362
|
+
4: shadow([
|
|
363
|
+
[1, 3, 0, 44],
|
|
364
|
+
[6, 16, -6, 44],
|
|
365
|
+
], 'var(--smrt-inset-highlight)'),
|
|
366
|
+
5: shadow([
|
|
367
|
+
[2, 4, 0, 46],
|
|
368
|
+
[12, 28, -12, 52],
|
|
369
|
+
], 'var(--smrt-inset-highlight)'),
|
|
341
370
|
};
|
|
342
371
|
/**
|
|
343
372
|
* Day Shift radii — the mock's restrained geometry: 6px controls, 8px panels.
|
|
@@ -396,6 +425,58 @@ export const happyverticalTheme = {
|
|
|
396
425
|
borderRadius,
|
|
397
426
|
duration,
|
|
398
427
|
easing: calmEasing,
|
|
428
|
+
glass: { ...opaqueGlass },
|
|
429
|
+
...baselineTokens(lightColors, darkColors),
|
|
430
|
+
// Day Shift roles: enamel ground, faceplate panels, bezel hairlines. The
|
|
431
|
+
// strong edge is the a11y `outline` (3:1), never the decorative bezel.
|
|
432
|
+
surfaces: {
|
|
433
|
+
light: {
|
|
434
|
+
ground: lightColors.background, // enamel
|
|
435
|
+
panel: lightColors.surface, // faceplate
|
|
436
|
+
control: lightColors.surfaceContainerLowest,
|
|
437
|
+
raised: lightColors.surface, // faceplate; the bezel hairline lifts it
|
|
438
|
+
sunken: lightColors.surfaceDim,
|
|
439
|
+
overlay: lightColors.scrim,
|
|
440
|
+
},
|
|
441
|
+
dark: {
|
|
442
|
+
ground: darkColors.background,
|
|
443
|
+
panel: darkColors.surface,
|
|
444
|
+
control: darkColors.surfaceContainerHigh,
|
|
445
|
+
raised: darkColors.surface,
|
|
446
|
+
sunken: darkColors.surfaceContainerLowest,
|
|
447
|
+
overlay: darkColors.scrim,
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
hairlines: {
|
|
451
|
+
light: {
|
|
452
|
+
color: 'var(--smrt-color-outline-variant)', // bezel
|
|
453
|
+
strongColor: 'var(--smrt-color-outline)',
|
|
454
|
+
insetHighlight: noInsetHighlight,
|
|
455
|
+
},
|
|
456
|
+
dark: {
|
|
457
|
+
color: 'var(--smrt-color-outline-variant)',
|
|
458
|
+
strongColor: 'var(--smrt-color-outline)',
|
|
459
|
+
insetHighlight: 'inset 0 1px 0 rgb(255 255 255 / 0.04)',
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
shadowColor: { light: 'rgb(32 39 43)', dark: 'rgb(0 0 0)' },
|
|
463
|
+
// Minimal state layers: calm is less to process.
|
|
464
|
+
states: {
|
|
465
|
+
hover: '0.06',
|
|
466
|
+
pressed: '0.10',
|
|
467
|
+
selected: '0.10',
|
|
468
|
+
focus: '0.10',
|
|
469
|
+
dragged: '0.12',
|
|
470
|
+
disabled: '0.38',
|
|
471
|
+
},
|
|
472
|
+
// The mock's 6px controls (radius md); small controls take the 4px step.
|
|
473
|
+
controls: {
|
|
474
|
+
radius: 'var(--smrt-radius-md)',
|
|
475
|
+
radiusSmall: 'var(--smrt-radius-sm)',
|
|
476
|
+
height: '2.5rem',
|
|
477
|
+
heightSmall: '2rem',
|
|
478
|
+
weight: '500',
|
|
479
|
+
},
|
|
399
480
|
fontFamily: BODY_FONT,
|
|
400
481
|
fontFamilyMono: MONO_FONT,
|
|
401
482
|
};
|
package/dist/themes/index.d.ts
CHANGED
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
export { ColorSchemeToggle, ThemeSwitcher } from './components/index.js';
|
|
20
20
|
export { getThemeContext, hasThemeContext, setThemeContext, tryGetThemeContext, } from './context.svelte.js';
|
|
21
21
|
export type { CreateThemeOptions } from './create-theme.js';
|
|
22
|
-
export { createTheme, createThemeFromColor, getRegisteredTheme, isThemeRegistered, preloadThemeRegistry, registerTheme, } from './create-theme.js';
|
|
22
|
+
export { createTheme, createThemeFromColor, derivePrimaryOverrides, getRegisteredTheme, isThemeRegistered, preloadThemeRegistry, registerTheme, } from './create-theme.js';
|
|
23
23
|
export { generateAllThemesCSS, generateThemeCSS, generateThemeVariables, variablesToStyleString, } from './css-generator.js';
|
|
24
24
|
export { availablePresets, getAllThemes, getTheme, getThemeName, getThemeOptions, glassTheme, happyverticalTheme, isValidPreset, materialTheme, smrtTheme, studioTheme, type ThemePresetSummary, themePresets, themes, } from './presets.js';
|
|
25
25
|
export { appleEasing, borderRadiusScale, durationScale, materialEasing, spacingScale, studioEasing, } from './shared.js';
|
|
26
26
|
export { default as ThemeProvider } from './ThemeProvider.svelte';
|
|
27
27
|
export { type ThemeScriptOptions, themeScript } from './theme-script.js';
|
|
28
|
-
export type { BorderRadius, BorderRadiusScale, ColorPalette, ColorScheme, CSSVariableOptions, DurationScale, EasingScale, ElevationScale, GlassEffects, ResolvedScheme, SpacingScale, Theme, ThemeConfig, ThemeContext, ThemePreset, ThemeState, TypographyScale, TypographyToken, } from './types.js';
|
|
28
|
+
export type { BorderRadius, BorderRadiusScale, ColorPalette, ColorScheme, ContrastPreference, CSSVariableOptions, DurationScale, EasingScale, ElevationScale, GlassEffects, ResolvedContrast, ResolvedScheme, SpacingScale, Theme, ThemeConfig, ThemeContext, ThemeDensity, ThemePreset, ThemeState, TypographyScale, TypographyToken, } from './types.js';
|
|
29
29
|
export { defaultThemeConfig } from './types.js';
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,EACX,KAAK,kBAAkB,EACvB,YAAY,EACZ,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEzE,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,EACX,KAAK,kBAAkB,EACvB,YAAY,EACZ,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEzE,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/themes/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export { ColorSchemeToggle, ThemeSwitcher } from './components/index.js';
|
|
|
21
21
|
// Context
|
|
22
22
|
export { getThemeContext, hasThemeContext, setThemeContext, tryGetThemeContext, } from './context.svelte.js';
|
|
23
23
|
// Custom theme creation
|
|
24
|
-
export { createTheme, createThemeFromColor, getRegisteredTheme, isThemeRegistered, preloadThemeRegistry, registerTheme, } from './create-theme.js';
|
|
24
|
+
export { createTheme, createThemeFromColor, derivePrimaryOverrides, getRegisteredTheme, isThemeRegistered, preloadThemeRegistry, registerTheme, } from './create-theme.js';
|
|
25
25
|
// CSS generation
|
|
26
26
|
export { generateAllThemesCSS, generateThemeCSS, generateThemeVariables, variablesToStyleString, } from './css-generator.js';
|
|
27
27
|
// Preset data and registry (single source: ./presets.ts, Node-safe)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/material/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/material/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,KAAK,EAGV,KAAK,EAEN,MAAM,aAAa,CAAC;AAoVrB;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KA0D3B,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Improved Material Design 3 theme with modern Google product aesthetics.
|
|
5
5
|
* Features refined colors, updated typography, and polished elevation.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { baselineTokens, opaqueGlass } from '../derive.js';
|
|
8
|
+
import { borderRadiusScale, darkInsetHighlight, durationScale, hairlineMix, materialEasing, noInsetHighlight, noShadow, shadow, spacingScale, } from '../shared.js';
|
|
8
9
|
/**
|
|
9
10
|
* Material light color palette
|
|
10
11
|
* Refined M3 colors with slightly more vibrant accents
|
|
@@ -25,6 +26,11 @@ const lightColors = {
|
|
|
25
26
|
onTertiary: '#ffffff',
|
|
26
27
|
tertiaryContainer: '#e8ddff',
|
|
27
28
|
onTertiaryContainer: '#1e005f',
|
|
29
|
+
// Info - Shares the tertiary hue (no distinct info hue in this preset)
|
|
30
|
+
info: '#7c4dff',
|
|
31
|
+
onInfo: '#ffffff',
|
|
32
|
+
infoContainer: '#e8ddff',
|
|
33
|
+
onInfoContainer: '#1e005f',
|
|
28
34
|
// Error - Google red
|
|
29
35
|
error: '#b3261e',
|
|
30
36
|
onError: '#ffffff',
|
|
@@ -53,7 +59,7 @@ const lightColors = {
|
|
|
53
59
|
surfaceDim: '#dadce0',
|
|
54
60
|
surfaceBright: '#f8f9fa',
|
|
55
61
|
// Background
|
|
56
|
-
background: '#
|
|
62
|
+
background: '#f6f8fc',
|
|
57
63
|
onBackground: '#1f1f1f',
|
|
58
64
|
// Outline
|
|
59
65
|
outline: '#747775',
|
|
@@ -68,7 +74,7 @@ const lightColors = {
|
|
|
68
74
|
};
|
|
69
75
|
/**
|
|
70
76
|
* Material dark color palette
|
|
71
|
-
*
|
|
77
|
+
* M3 tonal dark mode: a #121316 ground with stepped container tiers
|
|
72
78
|
*/
|
|
73
79
|
const darkColors = {
|
|
74
80
|
// Primary - Lighter blue for dark mode
|
|
@@ -86,6 +92,11 @@ const darkColors = {
|
|
|
86
92
|
onTertiary: '#3e1e96',
|
|
87
93
|
tertiaryContainer: '#5e3fc0',
|
|
88
94
|
onTertiaryContainer: '#e8ddff',
|
|
95
|
+
// Info - Shares the tertiary hue (no distinct info hue in this preset)
|
|
96
|
+
info: '#cbb7ff',
|
|
97
|
+
onInfo: '#3e1e96',
|
|
98
|
+
infoContainer: '#5e3fc0',
|
|
99
|
+
onInfoContainer: '#e8ddff',
|
|
89
100
|
// Error
|
|
90
101
|
error: '#f2b8b5',
|
|
91
102
|
onError: '#601410',
|
|
@@ -101,20 +112,21 @@ const darkColors = {
|
|
|
101
112
|
onSuccess: '#0d522d',
|
|
102
113
|
successContainer: '#1e4620',
|
|
103
114
|
onSuccessContainer: '#e6f4ea',
|
|
104
|
-
// Surface -
|
|
105
|
-
|
|
115
|
+
// Surface - M3 tonal ladder (ground < panel < control < raised), each tier a
|
|
116
|
+
// visible step so depth reads from lightness and needs no borders
|
|
117
|
+
surface: '#1b1c20',
|
|
106
118
|
onSurface: '#e3e3e3',
|
|
107
|
-
surfaceVariant: '#
|
|
119
|
+
surfaceVariant: '#26282c',
|
|
108
120
|
onSurfaceVariant: '#c4c7c5',
|
|
109
|
-
surfaceContainer: '#
|
|
110
|
-
surfaceContainerLow: '#
|
|
111
|
-
surfaceContainerHigh: '#
|
|
112
|
-
surfaceContainerHighest: '#
|
|
113
|
-
surfaceContainerLowest: '#
|
|
114
|
-
surfaceDim: '#
|
|
115
|
-
surfaceBright: '#
|
|
121
|
+
surfaceContainer: '#1f2024',
|
|
122
|
+
surfaceContainerLow: '#17181c',
|
|
123
|
+
surfaceContainerHigh: '#26282c',
|
|
124
|
+
surfaceContainerHighest: '#34363a',
|
|
125
|
+
surfaceContainerLowest: '#0d0e11',
|
|
126
|
+
surfaceDim: '#121316',
|
|
127
|
+
surfaceBright: '#393b3f',
|
|
116
128
|
// Background
|
|
117
|
-
background: '#
|
|
129
|
+
background: '#121316',
|
|
118
130
|
onBackground: '#e3e3e3',
|
|
119
131
|
// Outline
|
|
120
132
|
outline: '#8e918f',
|
|
@@ -143,28 +155,28 @@ const typography = {
|
|
|
143
155
|
size: '2.75rem',
|
|
144
156
|
lineHeight: '1.15',
|
|
145
157
|
weight: '400',
|
|
146
|
-
tracking: '-0.
|
|
158
|
+
tracking: '-0.015em',
|
|
147
159
|
fontFamily: 'var(--smrt-font-family)',
|
|
148
160
|
},
|
|
149
161
|
displaySmall: {
|
|
150
162
|
size: '2.25rem',
|
|
151
163
|
lineHeight: '1.2',
|
|
152
164
|
weight: '400',
|
|
153
|
-
tracking: '0',
|
|
165
|
+
tracking: '-0.01em',
|
|
154
166
|
fontFamily: 'var(--smrt-font-family)',
|
|
155
167
|
},
|
|
156
168
|
headlineLarge: {
|
|
157
169
|
size: '2rem',
|
|
158
170
|
lineHeight: '1.25',
|
|
159
171
|
weight: '400',
|
|
160
|
-
tracking: '0',
|
|
172
|
+
tracking: '-0.01em',
|
|
161
173
|
fontFamily: 'var(--smrt-font-family)',
|
|
162
174
|
},
|
|
163
175
|
headlineMedium: {
|
|
164
176
|
size: '1.75rem',
|
|
165
177
|
lineHeight: '1.3',
|
|
166
178
|
weight: '400',
|
|
167
|
-
tracking: '0',
|
|
179
|
+
tracking: '-0.005em',
|
|
168
180
|
fontFamily: 'var(--smrt-font-family)',
|
|
169
181
|
},
|
|
170
182
|
headlineSmall: {
|
|
@@ -227,28 +239,71 @@ const typography = {
|
|
|
227
239
|
size: '0.75rem',
|
|
228
240
|
lineHeight: '1.4',
|
|
229
241
|
weight: '500',
|
|
230
|
-
tracking: '0.
|
|
242
|
+
tracking: '0.02em',
|
|
231
243
|
fontFamily: 'var(--smrt-font-family)',
|
|
232
244
|
},
|
|
233
245
|
labelSmall: {
|
|
234
246
|
size: '0.6875rem',
|
|
235
247
|
lineHeight: '1.4',
|
|
236
248
|
weight: '500',
|
|
237
|
-
tracking: '0.
|
|
249
|
+
tracking: '0.03em',
|
|
238
250
|
fontFamily: 'var(--smrt-font-family)',
|
|
239
251
|
},
|
|
240
252
|
};
|
|
241
253
|
/**
|
|
242
|
-
* Material elevation
|
|
243
|
-
*
|
|
254
|
+
* Material elevation (light) — two layers per level: a contact shadow plus an
|
|
255
|
+
* ambient shadow with negative spread, tinted by `--smrt-shadow-color`.
|
|
244
256
|
*/
|
|
245
257
|
const elevation = {
|
|
246
|
-
0:
|
|
247
|
-
1:
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
258
|
+
0: noShadow,
|
|
259
|
+
1: shadow([
|
|
260
|
+
[1, 2, 0, 8],
|
|
261
|
+
[2, 4, -1, 6],
|
|
262
|
+
]),
|
|
263
|
+
2: shadow([
|
|
264
|
+
[1, 2, 0, 10],
|
|
265
|
+
[4, 8, -2, 10],
|
|
266
|
+
]),
|
|
267
|
+
3: shadow([
|
|
268
|
+
[1, 3, 0, 12],
|
|
269
|
+
[8, 16, -4, 12],
|
|
270
|
+
]),
|
|
271
|
+
4: shadow([
|
|
272
|
+
[2, 4, 0, 12],
|
|
273
|
+
[12, 24, -6, 14],
|
|
274
|
+
]),
|
|
275
|
+
5: shadow([
|
|
276
|
+
[2, 6, 0, 14],
|
|
277
|
+
[20, 40, -10, 18],
|
|
278
|
+
]),
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Material elevation (dark) — altitude is carried by the tonal ladder, so the
|
|
282
|
+
* shadows are tighter and lower in reach and every level adds the inset top
|
|
283
|
+
* highlight.
|
|
284
|
+
*/
|
|
285
|
+
const darkElevation = {
|
|
286
|
+
0: noShadow,
|
|
287
|
+
1: shadow([
|
|
288
|
+
[1, 2, 0, 24],
|
|
289
|
+
[1, 3, -1, 16],
|
|
290
|
+
]),
|
|
291
|
+
2: shadow([
|
|
292
|
+
[1, 2, 0, 28],
|
|
293
|
+
[3, 6, -2, 20],
|
|
294
|
+
], 'var(--smrt-inset-highlight)'),
|
|
295
|
+
3: shadow([
|
|
296
|
+
[1, 3, 0, 30],
|
|
297
|
+
[6, 12, -3, 24],
|
|
298
|
+
], 'var(--smrt-inset-highlight)'),
|
|
299
|
+
4: shadow([
|
|
300
|
+
[2, 4, 0, 32],
|
|
301
|
+
[10, 20, -5, 28],
|
|
302
|
+
], 'var(--smrt-inset-highlight)'),
|
|
303
|
+
5: shadow([
|
|
304
|
+
[2, 6, 0, 34],
|
|
305
|
+
[16, 32, -8, 32],
|
|
306
|
+
], 'var(--smrt-inset-highlight)'),
|
|
252
307
|
};
|
|
253
308
|
/**
|
|
254
309
|
* Material theme definition
|
|
@@ -260,10 +315,56 @@ export const materialTheme = {
|
|
|
260
315
|
dark: darkColors,
|
|
261
316
|
typography,
|
|
262
317
|
elevation,
|
|
318
|
+
darkElevation,
|
|
263
319
|
spacing: spacingScale,
|
|
264
320
|
borderRadius: borderRadiusScale,
|
|
265
321
|
duration: durationScale,
|
|
266
322
|
easing: materialEasing,
|
|
323
|
+
glass: { ...opaqueGlass },
|
|
324
|
+
...baselineTokens(lightColors, darkColors),
|
|
325
|
+
shadowColor: { light: 'rgb(0 0 0)', dark: 'rgb(0 0 0)' },
|
|
326
|
+
// Tonal ladder: ground < panel < control < raised in dark. Light recesses the
|
|
327
|
+
// filled control into the white panel (M3 filled field) and lifts overlays.
|
|
328
|
+
surfaces: {
|
|
329
|
+
light: {
|
|
330
|
+
ground: lightColors.background,
|
|
331
|
+
panel: lightColors.surface,
|
|
332
|
+
control: lightColors.surfaceContainerHigh,
|
|
333
|
+
raised: lightColors.surfaceContainerLowest,
|
|
334
|
+
sunken: '#eef1f6',
|
|
335
|
+
overlay: lightColors.scrim,
|
|
336
|
+
},
|
|
337
|
+
dark: {
|
|
338
|
+
ground: darkColors.background,
|
|
339
|
+
panel: darkColors.surface,
|
|
340
|
+
control: darkColors.surfaceContainerHigh,
|
|
341
|
+
raised: darkColors.surfaceContainerHighest,
|
|
342
|
+
sunken: darkColors.surfaceContainerLowest,
|
|
343
|
+
overlay: darkColors.scrim,
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
hairlines: {
|
|
347
|
+
light: hairlineMix(10, 30, noInsetHighlight),
|
|
348
|
+
dark: hairlineMix(10, 30, darkInsetHighlight(0.05)),
|
|
349
|
+
},
|
|
350
|
+
// M3 state layers.
|
|
351
|
+
states: {
|
|
352
|
+
hover: '0.08',
|
|
353
|
+
pressed: '0.12',
|
|
354
|
+
selected: '0.12',
|
|
355
|
+
focus: '0.12',
|
|
356
|
+
dragged: '0.16',
|
|
357
|
+
disabled: '0.38',
|
|
358
|
+
},
|
|
359
|
+
// Filled controls separate by tier, not by an edge.
|
|
360
|
+
controls: {
|
|
361
|
+
radius: 'var(--smrt-radius-md)',
|
|
362
|
+
radiusSmall: 'var(--smrt-radius-sm)',
|
|
363
|
+
height: '2.75rem',
|
|
364
|
+
heightSmall: '2.25rem',
|
|
365
|
+
weight: '500',
|
|
366
|
+
border: '1px solid transparent',
|
|
367
|
+
},
|
|
267
368
|
fontFamily: '"Google Sans", "Roboto", system-ui, -apple-system, sans-serif',
|
|
268
369
|
};
|
|
269
370
|
export default materialTheme;
|