@skdx/tokens 0.28.0 → 0.30.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 +16 -13
- package/dist/foundation.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/themes/AntDark.cjs +1 -1
- package/dist/themes/AntDark.d.cts +3 -8
- package/dist/themes/AntDark.d.ts +3 -8
- package/dist/themes/AntDark.js +1 -1
- package/dist/themes/{AntBrand.cjs → AntLight.cjs} +1 -1
- package/dist/themes/{AntBrand.d.cts → AntLight.d.cts} +1 -1
- package/dist/themes/{AntBrand.d.ts → AntLight.d.ts} +1 -1
- package/dist/themes/{AntBrand.js → AntLight.js} +1 -1
- package/dist/themes/CatppuccinLatte.cjs +1 -1
- package/dist/themes/CatppuccinLatte.d.cts +1 -7
- package/dist/themes/CatppuccinLatte.d.ts +1 -7
- package/dist/themes/CatppuccinLatte.js +1 -1
- package/dist/themes/CatppuccinMocha.cjs +1 -1
- package/dist/themes/CatppuccinMocha.d.cts +1 -7
- package/dist/themes/CatppuccinMocha.d.ts +1 -7
- package/dist/themes/CatppuccinMocha.js +1 -1
- package/dist/themes/ChakraDark.cjs +1 -1
- package/dist/themes/ChakraDark.d.cts +3 -8
- package/dist/themes/ChakraDark.d.ts +3 -8
- package/dist/themes/ChakraDark.js +1 -1
- package/dist/themes/{ChakraBrand.cjs → ChakraLight.cjs} +1 -1
- package/dist/themes/{ChakraBrand.d.cts → ChakraLight.d.cts} +1 -1
- package/dist/themes/{ChakraBrand.d.ts → ChakraLight.d.ts} +1 -1
- package/dist/themes/{ChakraBrand.js → ChakraLight.js} +1 -1
- package/dist/themes/CupcakeDark.cjs +1 -1
- package/dist/themes/CupcakeDark.d.cts +3 -5
- package/dist/themes/CupcakeDark.d.ts +3 -5
- package/dist/themes/CupcakeLight.cjs +1 -1
- package/dist/themes/CupcakeLight.d.cts +1 -8
- package/dist/themes/CupcakeLight.d.ts +1 -8
- package/dist/themes/CupcakeLight.js +1 -1
- package/dist/themes/DefaultTheme.cjs +1 -1
- package/dist/themes/DefaultTheme.d.cts +3 -14
- package/dist/themes/DefaultTheme.d.ts +3 -14
- package/dist/themes/DefaultTheme.js +1 -1
- package/dist/themes/DraculaLight.cjs +1 -1
- package/dist/themes/DraculaLight.d.cts +2 -1
- package/dist/themes/DraculaLight.d.ts +2 -1
- package/dist/themes/DraculaLight.js +1 -1
- package/dist/themes/EmeraldDark.cjs +1 -1
- package/dist/themes/EmeraldDark.d.cts +3 -8
- package/dist/themes/EmeraldDark.d.ts +3 -8
- package/dist/themes/EmeraldDark.js +1 -1
- package/dist/themes/{EmeraldBrand.cjs → EmeraldLight.cjs} +1 -1
- package/dist/themes/{EmeraldBrand.d.cts → EmeraldLight.d.cts} +1 -1
- package/dist/themes/{EmeraldBrand.d.ts → EmeraldLight.d.ts} +1 -1
- package/dist/themes/{EmeraldBrand.js → EmeraldLight.js} +1 -1
- package/dist/themes/EverforestDark.cjs +1 -1
- package/dist/themes/EverforestDark.js +1 -1
- package/dist/themes/EverforestLight.cjs +1 -1
- package/dist/themes/EverforestLight.d.cts +3 -5
- package/dist/themes/EverforestLight.d.ts +3 -5
- package/dist/themes/FluentDark.cjs +1 -1
- package/dist/themes/FluentDark.d.cts +3 -7
- package/dist/themes/FluentDark.d.ts +3 -7
- package/dist/themes/FluentDark.js +1 -1
- package/dist/themes/{FluentBrand.cjs → FluentLight.cjs} +1 -1
- package/dist/themes/{FluentBrand.d.cts → FluentLight.d.cts} +1 -1
- package/dist/themes/{FluentBrand.d.ts → FluentLight.d.ts} +1 -1
- package/dist/themes/{FluentBrand.js → FluentLight.js} +1 -1
- package/dist/themes/GraphiteDark.cjs +1 -1
- package/dist/themes/GraphiteDark.d.cts +3 -8
- package/dist/themes/GraphiteDark.d.ts +3 -8
- package/dist/themes/GraphiteDark.js +1 -1
- package/dist/themes/{GraphiteBrand.cjs → GraphiteLight.cjs} +1 -1
- package/dist/themes/{GraphiteBrand.d.cts → GraphiteLight.d.cts} +1 -1
- package/dist/themes/{GraphiteBrand.d.ts → GraphiteLight.d.ts} +1 -1
- package/dist/themes/{GraphiteBrand.js → GraphiteLight.js} +1 -1
- package/dist/themes/GruvboxDark.cjs +1 -1
- package/dist/themes/GruvboxDark.d.cts +1 -7
- package/dist/themes/GruvboxDark.d.ts +1 -7
- package/dist/themes/GruvboxDark.js +1 -1
- package/dist/themes/GruvboxLight.cjs +1 -1
- package/dist/themes/GruvboxLight.d.cts +3 -12
- package/dist/themes/GruvboxLight.d.ts +3 -12
- package/dist/themes/GruvboxLight.js +1 -1
- package/dist/themes/MaterialDark.cjs +1 -1
- package/dist/themes/MaterialDark.d.cts +3 -8
- package/dist/themes/MaterialDark.d.ts +3 -8
- package/dist/themes/MaterialDark.js +1 -1
- package/dist/themes/{MaterialBrand.cjs → MaterialLight.cjs} +1 -1
- package/dist/themes/{MaterialBrand.d.cts → MaterialLight.d.cts} +1 -1
- package/dist/themes/{MaterialBrand.d.ts → MaterialLight.d.ts} +1 -1
- package/dist/themes/{MaterialBrand.js → MaterialLight.js} +1 -1
- package/dist/themes/MidnightDark.cjs +1 -0
- package/dist/themes/MidnightDark.d.cts +3 -0
- package/dist/themes/MidnightDark.d.ts +3 -0
- package/dist/themes/{MidnightBrand.js → MidnightDark.js} +1 -1
- package/dist/themes/MidnightLight.cjs +1 -1
- package/dist/themes/MidnightLight.d.cts +2 -1
- package/dist/themes/MidnightLight.d.ts +2 -1
- package/dist/themes/MidnightLight.js +1 -1
- package/dist/themes/NordDark.cjs +1 -1
- package/dist/themes/NordDark.js +1 -1
- package/dist/themes/NordLight.cjs +1 -1
- package/dist/themes/NordLight.d.cts +3 -12
- package/dist/themes/NordLight.d.ts +3 -12
- package/dist/themes/NordLight.js +1 -1
- package/dist/themes/OneDark.cjs +1 -1
- package/dist/themes/OneDark.d.cts +1 -7
- package/dist/themes/OneDark.d.ts +1 -7
- package/dist/themes/OneDark.js +1 -1
- package/dist/themes/OneLight.cjs +1 -1
- package/dist/themes/OneLight.d.cts +3 -5
- package/dist/themes/OneLight.d.ts +3 -5
- package/dist/themes/OneLight.js +1 -1
- package/dist/themes/PrimerDark.cjs +1 -1
- package/dist/themes/PrimerDark.js +1 -1
- package/dist/themes/PrimerLight.d.cts +1 -7
- package/dist/themes/PrimerLight.d.ts +1 -7
- package/dist/themes/RosePine.cjs +1 -1
- package/dist/themes/RosePine.d.cts +1 -7
- package/dist/themes/RosePine.d.ts +1 -7
- package/dist/themes/RosePine.js +1 -1
- package/dist/themes/RosePineDawn.cjs +1 -1
- package/dist/themes/RosePineDawn.d.cts +3 -5
- package/dist/themes/RosePineDawn.d.ts +3 -5
- package/dist/themes/RosePineDawn.js +1 -1
- package/dist/themes/SkandaDark.cjs +1 -1
- package/dist/themes/SkandaDark.d.cts +2 -1
- package/dist/themes/SkandaDark.d.ts +2 -1
- package/dist/themes/SkandaDark.js +1 -1
- package/dist/themes/SkandaLight.cjs +1 -1
- package/dist/themes/SkandaLight.js +1 -1
- package/dist/themes/SolarizedDark.d.cts +1 -7
- package/dist/themes/SolarizedDark.d.ts +1 -7
- package/dist/themes/SolarizedLight.cjs +1 -1
- package/dist/themes/SolarizedLight.d.cts +1 -7
- package/dist/themes/SolarizedLight.d.ts +1 -7
- package/dist/themes/SolarizedLight.js +1 -1
- package/dist/themes/SynthwaveDark.d.cts +1 -7
- package/dist/themes/SynthwaveDark.d.ts +1 -7
- package/dist/themes/SynthwaveLight.cjs +1 -1
- package/dist/themes/SynthwaveLight.d.cts +3 -8
- package/dist/themes/SynthwaveLight.d.ts +3 -8
- package/dist/themes/SynthwaveLight.js +1 -1
- package/dist/themes/brands.cjs +1 -1
- package/dist/themes/brands.d.cts +3 -19
- package/dist/themes/brands.d.ts +3 -19
- package/dist/themes/brands.js +1 -1
- package/dist/themes/createBrandTheme.cjs +1 -1
- package/dist/themes/createBrandTheme.d.cts +3 -7
- package/dist/themes/createBrandTheme.d.ts +3 -7
- package/dist/themes/createBrandTheme.js +1 -1
- package/dist/themes/index.cjs +1 -1
- package/dist/themes/index.d.cts +10 -9
- package/dist/themes/index.d.ts +10 -9
- package/dist/themes/index.js +1 -1
- package/dist/themes.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/tokens.dtcg.json +14246 -0
- package/dist/utils/aliases.cjs +9 -3
- package/dist/utils/aliases.d.cts +13 -23
- package/dist/utils/aliases.d.ts +13 -23
- package/dist/utils/aliases.js +9 -3
- package/dist/utils/cssVars.cjs +2 -2
- package/dist/utils/cssVars.d.cts +11 -14
- package/dist/utils/cssVars.d.ts +11 -14
- package/dist/utils/cssVars.js +2 -2
- package/dist/utils/foundation.cjs +4 -4
- package/dist/utils/foundation.d.cts +19 -76
- package/dist/utils/foundation.d.ts +19 -76
- package/dist/utils/foundation.js +3 -3
- package/dist/utils/mode.cjs +1 -1
- package/dist/utils/mode.d.cts +7 -34
- package/dist/utils/mode.d.ts +7 -34
- package/dist/utils/mode.js +1 -1
- package/dist/utils/theme.cjs +1 -1
- package/dist/utils/theme.d.cts +24 -91
- package/dist/utils/theme.d.ts +24 -91
- package/dist/utils/toCss.cjs +5 -5
- package/dist/utils/toCss.d.cts +5 -4
- package/dist/utils/toCss.d.ts +5 -4
- package/dist/utils/toCss.js +5 -5
- package/package.json +5 -4
- package/dist/themes/MidnightBrand.cjs +0 -1
- package/dist/themes/MidnightBrand.d.cts +0 -8
- package/dist/themes/MidnightBrand.d.ts +0 -8
|
@@ -1,42 +1,17 @@
|
|
|
1
|
+
import { type CssVar } from './cssVars.js';
|
|
1
2
|
import { type ThemeControls, type ThemeControlsCoarse, type ThemeMotion, type ThemeRadii, type ThemeShadows, type ThemeSpace, type ThemeTypography } from './theme.js';
|
|
2
|
-
/**
|
|
3
|
-
* The type system: one font stack, scale, weight set, line-heights and
|
|
4
|
-
* tracking steps, shared by every theme. Only the font stacks are
|
|
5
|
-
* per-theme overridable, via {@link ThemeTypographyDeviation}.
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
3
|
+
/** The shared type system — font stacks, scale, weights, line-heights, tracking — with only stacks overridable via {@link ThemeTypographyDeviation}. @public */
|
|
8
4
|
export declare const typography: ThemeTypography;
|
|
9
|
-
/**
|
|
10
|
-
* The spacing scale — a 4px base, structural rather than per-brand: gap and
|
|
11
|
-
* padding are rhythm, a property of the system, not the brand on top of it.
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
5
|
+
/** The spacing scale — a 4px base, structural rather than per-brand. @public */
|
|
14
6
|
export declare const space: ThemeSpace;
|
|
15
|
-
/**
|
|
16
|
-
* The corner-radius scale, structural like {@link space}: a component's
|
|
17
|
-
* silhouette is part of the system's shape language, not the brand's.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
7
|
+
/** The corner-radius scale, structural like {@link space} rather than per-brand. @public */
|
|
20
8
|
export declare const radii: ThemeRadii;
|
|
21
|
-
/**
|
|
22
|
-
* The elevation scale — geometry only. Every value defers its color to
|
|
23
|
-
* `var(--skdx-shadow-color)` and scales its alpha by
|
|
24
|
-
* `var(--skdx-shadow-strength)`, both supplied by a theme (see
|
|
25
|
-
* {@link ThemeShadowColor}), so 38 themes share one set of offsets instead of
|
|
26
|
-
* each restating them to vary only the color.
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
9
|
+
/** The elevation scale (geometry only); color and alpha come from theme-supplied `--skdx-shadow-color`/`-strength` (see {@link ThemeShadowColor}). @public */
|
|
29
10
|
export declare const shadows: ThemeShadows;
|
|
30
|
-
/**
|
|
31
|
-
* The shared animation timing, re-exported from {@link defaultMotion}. See
|
|
32
|
-
* {@link ThemeMotion} for why motion is theme-invariant.
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
11
|
+
/** The shared animation timing, re-exported from {@link defaultMotion} and invariant per {@link ThemeMotion}. @public */
|
|
35
12
|
export declare const motion: Required<ThemeMotion>;
|
|
36
13
|
/**
|
|
37
|
-
*
|
|
38
|
-
* headers, dialog/popover backdrops, floating content, toasts) — every theme
|
|
39
|
-
* stacks the same way, so it's exported once rather than duplicated per theme.
|
|
14
|
+
* Structural stacking-order scale for overlay-class UI (dropdowns, headers, dialogs, toasts), shared by every theme.
|
|
40
15
|
*
|
|
41
16
|
* @example
|
|
42
17
|
* ```css
|
|
@@ -63,8 +38,7 @@ export declare const zIndex: {
|
|
|
63
38
|
/** The shape of the {@link zIndex} scale — a map of named stacking layers (`sticky`, `overlay`, `popover`, `toast`, …) to their numeric `z-index`. @public */
|
|
64
39
|
export type ZIndexScale = typeof zIndex;
|
|
65
40
|
/**
|
|
66
|
-
* Structural focus-ring geometry (width/offset)
|
|
67
|
-
* per brand ({@link SemanticColors.focusRing}); thickness/offset are shared.
|
|
41
|
+
* Structural focus-ring geometry (width/offset); color is themed separately via {@link SemanticColors.focusRing}.
|
|
68
42
|
*
|
|
69
43
|
* @example
|
|
70
44
|
* ```css
|
|
@@ -79,18 +53,13 @@ export type ZIndexScale = typeof zIndex;
|
|
|
79
53
|
export declare const focusRing: {
|
|
80
54
|
readonly width: "2px";
|
|
81
55
|
readonly offset: "2px";
|
|
82
|
-
/**
|
|
83
|
-
* Offset for clipping containers; moves ring inside border-box so overflow
|
|
84
|
-
* doesn't clip. Negative ring width, flush inside edge.
|
|
85
|
-
*/
|
|
56
|
+
/** Offset for clipping containers: moves the ring inside the border-box so overflow doesn't clip it. */
|
|
86
57
|
readonly offsetInset: "calc(-1 * var(--skdx-focus-ring-width))";
|
|
87
58
|
};
|
|
88
59
|
/** The shape of the {@link focusRing} geometry — the structural `width`/`offset` of the focus ring (its color is themed separately). @public */
|
|
89
60
|
export type FocusRingScale = typeof focusRing;
|
|
90
61
|
/**
|
|
91
|
-
* Border thicknesses, structural like {@link focusRing}:
|
|
92
|
-
* border *color* ({@link SemanticColors.border}), not hairline width. No `0`
|
|
93
|
-
* step — that's `border: none`, not a token.
|
|
62
|
+
* Border thicknesses, structural like {@link focusRing}: brand changes border color via {@link SemanticColors.border}, not width; no `0` step exists.
|
|
94
63
|
*
|
|
95
64
|
* @example
|
|
96
65
|
* ```css
|
|
@@ -107,14 +76,7 @@ export declare const borderWidth: {
|
|
|
107
76
|
};
|
|
108
77
|
/** The shape of the {@link borderWidth} scale — `thin`/`thick`/`thicker` border thicknesses. @public */
|
|
109
78
|
export type BorderWidthScale = typeof borderWidth;
|
|
110
|
-
/**
|
|
111
|
-
* The shared control geometry — heights, paddings, icon boxes, row heights
|
|
112
|
-
* and overlay insets. See {@link ThemeControls} for why this is structural
|
|
113
|
-
* rather than per-brand, and for the retuning escape hatch. Values are
|
|
114
|
-
* `var()` references where they equal a {@link space} step, so the two can't
|
|
115
|
-
* drift; the few off-scale exceptions are documented where declared.
|
|
116
|
-
* @public
|
|
117
|
-
*/
|
|
79
|
+
/** The shared control geometry (heights, paddings, icon boxes, insets); see {@link ThemeControls} for the retuning escape hatch, and values reference {@link space} steps where they align. @public */
|
|
118
80
|
export declare const controls: ThemeControls;
|
|
119
81
|
/**
|
|
120
82
|
* What a coarse pointer overrides, emitted as a `@media (pointer: coarse)`
|
|
@@ -124,9 +86,7 @@ export declare const controls: ThemeControls;
|
|
|
124
86
|
*/
|
|
125
87
|
export declare const controlsCoarse: ThemeControlsCoarse;
|
|
126
88
|
/**
|
|
127
|
-
* The two opacities
|
|
128
|
-
* modal scrim dim — not an arbitrary 0–100 ramp. Scrim *color* is themed
|
|
129
|
-
* ({@link SemanticColors.overlay}); this is the structural dim strength.
|
|
89
|
+
* The two intentional opacities — disabled fade and modal scrim dim — not an arbitrary ramp; scrim color is themed via {@link SemanticColors.overlay}.
|
|
130
90
|
*
|
|
131
91
|
* @example
|
|
132
92
|
* ```css
|
|
@@ -143,9 +103,7 @@ export declare const opacity: {
|
|
|
143
103
|
/** The shape of the {@link opacity} scale — the `disabled` and `scrim` opacities. @public */
|
|
144
104
|
export type OpacityScale = typeof opacity;
|
|
145
105
|
/**
|
|
146
|
-
* Viewport widths
|
|
147
|
-
* CSS custom properties, since `@media (min-width: var(--x))` is invalid CSS.
|
|
148
|
-
* Consume from JS/TS or inline into your own media queries.
|
|
106
|
+
* Viewport widths in pixels, as TypeScript exports only — `@media (min-width: var(--x))` is invalid CSS.
|
|
149
107
|
*
|
|
150
108
|
* @example
|
|
151
109
|
* ```ts
|
|
@@ -165,32 +123,17 @@ export declare const breakpoints: {
|
|
|
165
123
|
/** The shape of the {@link breakpoints} scale — named viewport widths in pixels. @public */
|
|
166
124
|
export type BreakpointScale = typeof breakpoints;
|
|
167
125
|
/**
|
|
168
|
-
* Flattens every shared token into
|
|
169
|
-
* values — the foundation's counterpart to `themeToCssVars`. Together they
|
|
170
|
-
* are the complete `--skdx-*` surface, and never overlap. {@link breakpoints}
|
|
171
|
-
* is excluded, since a breakpoint can't be a CSS custom property.
|
|
126
|
+
* Flattens every shared token into `--skdx-*` custom property values, the foundation's counterpart to `themeToCssVars`; excludes {@link breakpoints}, which can't be a CSS custom property.
|
|
172
127
|
*
|
|
173
128
|
* @returns A plain object keyed by CSS custom property name (e.g. `'--skdx-space-4'`), unprefixed by any selector.
|
|
174
129
|
* @public
|
|
175
130
|
*/
|
|
176
|
-
export declare function foundationToCssVars(): Record<
|
|
131
|
+
export declare function foundationToCssVars(): Record<CssVar, string>;
|
|
132
|
+
/** The control metrics a coarse pointer overrides, as a var map — the `@media (pointer: coarse)` counterpart to {@link foundationToCssVars}. @public */
|
|
133
|
+
export declare function coarsePointerToCssVars(): Record<CssVar, string>;
|
|
177
134
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* Exported so `@skdx/skins` can render its fallback copy from these
|
|
181
|
-
* functions instead of restating the values.
|
|
182
|
-
* @public
|
|
183
|
-
*/
|
|
184
|
-
export declare function coarsePointerToCssVars(): Record<string, string>;
|
|
185
|
-
/**
|
|
186
|
-
* Renders every shared token as a `:root`-scoped `--skdx-*` rule block — the
|
|
187
|
-
* theme-invariant counterpart to {@link themeToCss}. **Inject this exactly
|
|
188
|
-
* once**, then `themeToCss(theme)` per theme alongside it.
|
|
189
|
-
*
|
|
190
|
-
* Also emits a `@media (prefers-reduced-motion: reduce)` block zeroing every
|
|
191
|
-
* motion duration/stagger at the definition site (WCAG 2.3.3 for free at every
|
|
192
|
-
* call site, no per-consumer media query), and a `@media (pointer: coarse)`
|
|
193
|
-
* block re-declaring the hit sizes from {@link controlsCoarse} the same way.
|
|
135
|
+
* Renders every shared token as a `:root`-scoped `--skdx-*` rule block, plus `prefers-reduced-motion` and `pointer: coarse` override blocks.
|
|
136
|
+
* Inject this exactly once, then {@link themeToCss} per theme.
|
|
194
137
|
*
|
|
195
138
|
* @example
|
|
196
139
|
* ```ts
|
package/dist/utils/foundation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{reducedMotionVarNames as
|
|
1
|
+
import{PREFIX as e,reducedMotionVarNames as i,sectionsToCssVars as a,varsToDeclarations as s}from"./cssVars.js";import{defaultMotion as p}from"./theme.js";var c={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontFamilyMono:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem"},fontWeight:{regular:400,medium:500,semibold:600,bold:700},lineHeight:{tight:"1.25",snug:"1.43",normal:"1.5",relaxed:"1.75"},letterSpacing:{tight:"-0.015em",normal:"0em",wide:"0.025em",wider:"0.05em"}},d={1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem"},l={sm:"0.25rem",inner:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",full:"9999px"},x={sm:`0 1px 2px 0 ${t(.05)}`,md:`0 4px 6px -1px ${t(.1)}, 0 2px 4px -2px ${t(.1)}`,lg:`0 10px 15px -3px ${t(.1)}, 0 4px 6px -4px ${t(.1)}`,overlay:`0 25px 50px -12px ${t(.25)}`};function t(r){return`rgb(var(--${e}-shadow-color) / calc(${r} * var(--${e}-shadow-strength)))`}var g=p,h={base:0,dropdown:10,sticky:20,overlay:30,modal:35,popover:40,toast:50,max:9999},y={width:"2px",offset:"2px",offsetInset:"calc(-1 * var(--skdx-focus-ring-width))"},f={thin:"1px",thick:"2px",thicker:"4px"},u={control:{height:{sm:"1.875rem",md:"2.25rem",lg:"2.625rem",compact:"2rem"},padding:{sm:"0.625rem",md:`var(--${e}-space-3)`,lg:`var(--${e}-space-4)`},gap:{sm:`var(--${e}-space-1)`,md:`var(--${e}-space-2)`,lg:`var(--${e}-space-2)`}},iconSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},indicatorSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},item:{height:{sm:"1.75rem",md:"2.25rem",lg:"2.5rem"},gap:"2px"},overlay:{padding:`var(--${e}-space-1)`,radius:`var(--${e}-radius-lg)`,minWidth:"7.5rem"},field:{gap:`var(--${e}-space-1)`,labelGap:`var(--${e}-space-1)`},target:{min:"24px"}},T={control:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem",compact:"2.75rem"}},item:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem"}},target:{min:"44px"}},C={disabled:"0.5",scrim:"0.6"},w={sm:640,md:768,lg:1024,xl:1280};function S(){return a([["font",c],["space",d],["radius",l],["shadow",x],["motion",g],["z-index",h],["focus-ring",y],["border-width",f],["opacity",C],...m(u)])}function m(r){let o=n=>r[n];return[["control",o("control")],["icon-size",o("iconSize")],["indicator-size",o("indicatorSize")],["item",o("item")],["overlay",o("overlay")],["field",o("field")],["target",o("target")]]}function $(){return a(m(T))}function R(){let r=S(),o=i(r).map(n=>` ${n}: 0ms;`);return`:root {
|
|
2
2
|
${s(r)}
|
|
3
3
|
}
|
|
4
4
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -9,7 +9,7 @@ ${o.join(`
|
|
|
9
9
|
}
|
|
10
10
|
@media (pointer: coarse) {
|
|
11
11
|
:root {
|
|
12
|
-
${s(
|
|
12
|
+
${s($()," ")}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
`}export{
|
|
15
|
+
`}export{f as borderWidth,w as breakpoints,$ as coarsePointerToCssVars,u as controls,T as controlsCoarse,y as focusRing,R as foundationToCss,S as foundationToCssVars,g as motion,C as opacity,l as radii,x as shadows,d as space,c as typography,h as zIndex};
|
package/dist/utils/mode.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!k.call(t,r)&&r!==n&&l(t,r,{get:()=>e[r],enumerable:!(a=O(e,r))||a.enumerable});return t};var M=t=>x(l({},"__esModule",{value:!0}),t);var I={};v(I,{BRAND_STORAGE_KEY:()=>S,MODE_STORAGE_KEY:()=>h,getThemeInitScript:()=>K,watchSystemMode:()=>T});module.exports=M(I);var o=require("../themes/brands.cjs"),y=require("./toCss.cjs"),h="skdx-mode",S="skdx-brand",b="(prefers-color-scheme: dark)";function T(t={}){let{brand:e,element:n,persist:a=!1,storageKey:r=h}=t,i=(e===void 0?void 0:(0,o.getBrand)(e))??o.defaultBrand,d=window.matchMedia(b),g,p=m=>{let s=null;try{s=localStorage.getItem(r)}catch{}let u=s==="light"||s==="dark"?s:void 0,c=(u!==g?u:void 0)??(m?"dark":"light");if((0,y.applyTheme)(i.themes[c],n),!!a)try{localStorage.setItem(r,c),g=c}catch{}};p(d.matches);let f=m=>p(m.matches);return d.addEventListener("change",f),()=>d.removeEventListener("change",f)}function K(t={}){let{brandKey:e=S,modeKey:n=h,brand:a=o.defaultBrand.name}=t,r=Object.fromEntries(o.brands.map(i=>[i.name,[i.themes.light.name,i.themes.dark.name]]));return`(function(){try{var t=${JSON.stringify(r)},f=${JSON.stringify(a)};var b=localStorage.getItem(${JSON.stringify(e)})||f;var m=localStorage.getItem(${JSON.stringify(n)});if(m!=="light"&&m!=="dark")m=matchMedia(${JSON.stringify(b)}).matches?"dark":"light";var p=t[b]||t[f];if(!p)return;var e=document.documentElement;e.setAttribute("data-skdx-theme",p[m==="dark"?1:0]);e.setAttribute("data-skdx-mode",m);}catch(e){}})();`}0&&(module.exports={BRAND_STORAGE_KEY,MODE_STORAGE_KEY,getThemeInitScript,watchSystemMode});
|
package/dist/utils/mode.d.cts
CHANGED
|
@@ -14,9 +14,9 @@ export interface WatchSystemModeOptions {
|
|
|
14
14
|
storageKey?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Follows OS color-scheme, applying and re-applying the theme on change; browser-only, guard behind a mounted effect in SSR.
|
|
18
|
+
* Pair with {@link getThemeInitScript} so first paint matches. A persisted explicit `'light'`/`'dark'` under
|
|
19
|
+
* `storageKey` takes precedence over the OS preference until a `'system'` value is stored again.
|
|
20
20
|
*
|
|
21
21
|
* @returns Unsubscribe function (detaches listener).
|
|
22
22
|
* @example
|
|
@@ -26,27 +26,6 @@ export interface WatchSystemModeOptions {
|
|
|
26
26
|
* stop();
|
|
27
27
|
* ```
|
|
28
28
|
* @public
|
|
29
|
-
*
|
|
30
|
-
* @example Next.js (App Router, `app/layout.tsx`)
|
|
31
|
-
* ```tsx
|
|
32
|
-
* <head>
|
|
33
|
-
* <script dangerouslySetInnerHTML={{ __html: getThemeInitScript() }} />
|
|
34
|
-
* </head>
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @example Nuxt (`nuxt.config.ts`)
|
|
38
|
-
* ```ts
|
|
39
|
-
* app: { head: { script: [{ innerHTML: getThemeInitScript(), tagPosition: 'head' }] } }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @example SvelteKit (`src/app.html`) — write the string into the template at
|
|
43
|
-
* build time, e.g. from a Vite plugin replacing a `%skdx.themeInit%` token:
|
|
44
|
-
* ```html
|
|
45
|
-
* <head>
|
|
46
|
-
* %sveltekit.head%
|
|
47
|
-
* <script>%skdx.themeInit%</script>
|
|
48
|
-
* </head>
|
|
49
|
-
* ```
|
|
50
29
|
*/
|
|
51
30
|
export declare function watchSystemMode(options?: WatchSystemModeOptions): () => void;
|
|
52
31
|
/** Options for {@link getThemeInitScript}. @public */
|
|
@@ -55,23 +34,17 @@ export interface ThemeInitScriptOptions {
|
|
|
55
34
|
brandKey?: string;
|
|
56
35
|
/** `localStorage` key for mode. @default MODE_STORAGE_KEY */
|
|
57
36
|
modeKey?: string;
|
|
58
|
-
/**
|
|
59
|
-
|
|
37
|
+
/** Brand to fall back to when nothing is persisted or the persisted name is unknown. @default 'skanda' */
|
|
38
|
+
brand?: string;
|
|
60
39
|
}
|
|
61
40
|
/**
|
|
62
|
-
* Blocking snippet that stamps `data-skdx-theme`
|
|
63
|
-
*
|
|
64
|
-
* through `prefers-color-scheme`. Returns bare JS (no `<script>` wrapper);
|
|
65
|
-
* your CSS must have `[data-skdx-theme="…"]` blocks.
|
|
41
|
+
* Blocking snippet that stamps `data-skdx-theme`/`-mode` on `<html>` before first paint, resolving `'system'` via `prefers-color-scheme`.
|
|
42
|
+
* Returns bare JS (no `<script>` wrapper); your CSS needs `[data-skdx-theme="…"]` blocks.
|
|
66
43
|
*
|
|
67
44
|
* @example Next.js
|
|
68
45
|
* ```tsx
|
|
69
46
|
* <script dangerouslySetInnerHTML={{ __html: getThemeInitScript() }} />
|
|
70
47
|
* ```
|
|
71
|
-
* @example Astro
|
|
72
|
-
* ```astro
|
|
73
|
-
* <script is:inline set:html={getThemeInitScript()} />
|
|
74
|
-
* ```
|
|
75
48
|
* @public
|
|
76
49
|
*/
|
|
77
50
|
export declare function getThemeInitScript(options?: ThemeInitScriptOptions): string;
|
package/dist/utils/mode.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export interface WatchSystemModeOptions {
|
|
|
14
14
|
storageKey?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Follows OS color-scheme, applying and re-applying the theme on change; browser-only, guard behind a mounted effect in SSR.
|
|
18
|
+
* Pair with {@link getThemeInitScript} so first paint matches. A persisted explicit `'light'`/`'dark'` under
|
|
19
|
+
* `storageKey` takes precedence over the OS preference until a `'system'` value is stored again.
|
|
20
20
|
*
|
|
21
21
|
* @returns Unsubscribe function (detaches listener).
|
|
22
22
|
* @example
|
|
@@ -26,27 +26,6 @@ export interface WatchSystemModeOptions {
|
|
|
26
26
|
* stop();
|
|
27
27
|
* ```
|
|
28
28
|
* @public
|
|
29
|
-
*
|
|
30
|
-
* @example Next.js (App Router, `app/layout.tsx`)
|
|
31
|
-
* ```tsx
|
|
32
|
-
* <head>
|
|
33
|
-
* <script dangerouslySetInnerHTML={{ __html: getThemeInitScript() }} />
|
|
34
|
-
* </head>
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @example Nuxt (`nuxt.config.ts`)
|
|
38
|
-
* ```ts
|
|
39
|
-
* app: { head: { script: [{ innerHTML: getThemeInitScript(), tagPosition: 'head' }] } }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @example SvelteKit (`src/app.html`) — write the string into the template at
|
|
43
|
-
* build time, e.g. from a Vite plugin replacing a `%skdx.themeInit%` token:
|
|
44
|
-
* ```html
|
|
45
|
-
* <head>
|
|
46
|
-
* %sveltekit.head%
|
|
47
|
-
* <script>%skdx.themeInit%</script>
|
|
48
|
-
* </head>
|
|
49
|
-
* ```
|
|
50
29
|
*/
|
|
51
30
|
export declare function watchSystemMode(options?: WatchSystemModeOptions): () => void;
|
|
52
31
|
/** Options for {@link getThemeInitScript}. @public */
|
|
@@ -55,23 +34,17 @@ export interface ThemeInitScriptOptions {
|
|
|
55
34
|
brandKey?: string;
|
|
56
35
|
/** `localStorage` key for mode. @default MODE_STORAGE_KEY */
|
|
57
36
|
modeKey?: string;
|
|
58
|
-
/**
|
|
59
|
-
|
|
37
|
+
/** Brand to fall back to when nothing is persisted or the persisted name is unknown. @default 'skanda' */
|
|
38
|
+
brand?: string;
|
|
60
39
|
}
|
|
61
40
|
/**
|
|
62
|
-
* Blocking snippet that stamps `data-skdx-theme`
|
|
63
|
-
*
|
|
64
|
-
* through `prefers-color-scheme`. Returns bare JS (no `<script>` wrapper);
|
|
65
|
-
* your CSS must have `[data-skdx-theme="…"]` blocks.
|
|
41
|
+
* Blocking snippet that stamps `data-skdx-theme`/`-mode` on `<html>` before first paint, resolving `'system'` via `prefers-color-scheme`.
|
|
42
|
+
* Returns bare JS (no `<script>` wrapper); your CSS needs `[data-skdx-theme="…"]` blocks.
|
|
66
43
|
*
|
|
67
44
|
* @example Next.js
|
|
68
45
|
* ```tsx
|
|
69
46
|
* <script dangerouslySetInnerHTML={{ __html: getThemeInitScript() }} />
|
|
70
47
|
* ```
|
|
71
|
-
* @example Astro
|
|
72
|
-
* ```astro
|
|
73
|
-
* <script is:inline set:html={getThemeInitScript()} />
|
|
74
|
-
* ```
|
|
75
48
|
* @public
|
|
76
49
|
*/
|
|
77
50
|
export declare function getThemeInitScript(options?: ThemeInitScriptOptions): string;
|
package/dist/utils/mode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{brands as
|
|
1
|
+
import{brands as y,defaultBrand as p,getBrand as S}from"../themes/brands.js";import{applyTheme as b}from"./toCss.js";var f="skdx-mode",O="skdx-brand",u="(prefers-color-scheme: dark)";function x(o={}){let{brand:t,element:a,persist:i=!1,storageKey:r=f}=o,e=(t===void 0?void 0:S(t))??p,s=window.matchMedia(u),c,l=d=>{let n=null;try{n=localStorage.getItem(r)}catch{}let g=n==="light"||n==="dark"?n:void 0,m=(g!==c?g:void 0)??(d?"dark":"light");if(b(e.themes[m],a),!!i)try{localStorage.setItem(r,m),c=m}catch{}};l(s.matches);let h=d=>l(d.matches);return s.addEventListener("change",h),()=>s.removeEventListener("change",h)}function M(o={}){let{brandKey:t=O,modeKey:a=f,brand:i=p.name}=o,r=Object.fromEntries(y.map(e=>[e.name,[e.themes.light.name,e.themes.dark.name]]));return`(function(){try{var t=${JSON.stringify(r)},f=${JSON.stringify(i)};var b=localStorage.getItem(${JSON.stringify(t)})||f;var m=localStorage.getItem(${JSON.stringify(a)});if(m!=="light"&&m!=="dark")m=matchMedia(${JSON.stringify(u)}).matches?"dark":"light";var p=t[b]||t[f];if(!p)return;var e=document.documentElement;e.setAttribute("data-skdx-theme",p[m==="dark"?1:0]);e.setAttribute("data-skdx-mode",m);}catch(e){}})();`}export{O as BRAND_STORAGE_KEY,f as MODE_STORAGE_KEY,M as getThemeInitScript,x as watchSystemMode};
|
package/dist/utils/theme.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var m=(r,t)=>{for(var n in t)e(r,n,{get:t[n],enumerable:!0})},l=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of o(t))!a.call(r,i)&&i!==n&&e(r,i,{get:()=>t[i],enumerable:!(s=g(t,i))||s.enumerable});return r};var d=r=>l(e({},"__esModule",{value:!0}),r);var h={};m(h,{defaultMotion:()=>c});module.exports=d(h);var c={durationInstant:"0ms",durationFast:"100ms",durationNormal:"200ms",durationSlow:"300ms",easing:"cubic-bezier(0.16, 1, 0.3, 1)",easingExit:"cubic-bezier(0.4, 0, 1, 1)",easingSteady:"cubic-bezier(0.4, 0, 0.2, 1)",easingLinear:"linear",staggerTight:"4ms",staggerLoose:"40ms"};0&&(module.exports={defaultMotion});
|
package/dist/utils/theme.d.cts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A theme is a plain JSON-serializable object; `themeToCss()` turns it into CSS custom properties.
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* The two resolved color modes a theme renders in (resolved via `prefers-color-scheme`).
|
|
6
3
|
* @public
|
|
@@ -64,11 +61,7 @@ export interface ThemeColors {
|
|
|
64
61
|
/** Role-based colors from scales; components prefer these over raw steps. */
|
|
65
62
|
semantic: SemanticColors;
|
|
66
63
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Font stacks, type scale, weight/line-height tokens, rendered as `--skdx-font-*`.
|
|
69
|
-
* Theme-invariant except the two font stacks (see {@link ThemeTypographyDeviation}).
|
|
70
|
-
* @public
|
|
71
|
-
*/
|
|
64
|
+
/** Font stacks, type scale, weight/line-height tokens, rendered as `--skdx-font-*`; theme-invariant except the two font stacks (see {@link ThemeTypographyDeviation}). @public */
|
|
72
65
|
export interface ThemeTypography {
|
|
73
66
|
/** Body font stack. */
|
|
74
67
|
fontFamily: string;
|
|
@@ -106,10 +99,7 @@ export interface ThemeTypography {
|
|
|
106
99
|
wider: string;
|
|
107
100
|
};
|
|
108
101
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Spacing scale (margin, padding, gap), rendered as `--skdx-space-<step>`.
|
|
111
|
-
* Lives once in `foundation.ts` (see {@link space}). @public
|
|
112
|
-
*/
|
|
102
|
+
/** Spacing scale (margin, padding, gap), rendered as `--skdx-space-<step>`; lives once in `foundation.ts` (see {@link space}). @public */
|
|
113
103
|
export interface ThemeSpace {
|
|
114
104
|
'1': string;
|
|
115
105
|
'2': string;
|
|
@@ -122,10 +112,7 @@ export interface ThemeSpace {
|
|
|
122
112
|
'12': string;
|
|
123
113
|
'16': string;
|
|
124
114
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Border-radius scale, rendered as `--skdx-radius-<size>`.
|
|
127
|
-
* Lives once in `foundation.ts` (see {@link radii}). @public
|
|
128
|
-
*/
|
|
115
|
+
/** Border-radius scale, rendered as `--skdx-radius-<size>`; lives once in `foundation.ts` (see {@link radii}). @public */
|
|
129
116
|
export interface ThemeRadii {
|
|
130
117
|
sm: string;
|
|
131
118
|
/** Nested box radius (relationship between `sm` and `md`, not a size step). */
|
|
@@ -136,10 +123,7 @@ export interface ThemeRadii {
|
|
|
136
123
|
/** Fully round, for pills and circular avatars. */
|
|
137
124
|
full: string;
|
|
138
125
|
}
|
|
139
|
-
/**
|
|
140
|
-
* Control geometry: metrics Button, Input and Select snap to.
|
|
141
|
-
* Lives once in `foundation.ts` (see {@link controls}). @public
|
|
142
|
-
*/
|
|
126
|
+
/** Control geometry: metrics Button, Input and Select snap to, living once in `foundation.ts` (see {@link controls}). @public */
|
|
143
127
|
export interface ThemeControls {
|
|
144
128
|
/** Vertical rhythm, inline padding and icon gap. */
|
|
145
129
|
control: {
|
|
@@ -198,10 +182,7 @@ export interface ThemeControls {
|
|
|
198
182
|
min: string;
|
|
199
183
|
};
|
|
200
184
|
}
|
|
201
|
-
/**
|
|
202
|
-
* {@link ThemeControls} overrides for coarse pointers. Only hit-target sizes;
|
|
203
|
-
* padding, gaps, radii, icons unchanged. @public
|
|
204
|
-
*/
|
|
185
|
+
/** {@link ThemeControls} overrides for coarse pointers — only hit-target sizes; padding, gaps, radii, icons unchanged. @public */
|
|
205
186
|
export interface ThemeControlsCoarse {
|
|
206
187
|
control: {
|
|
207
188
|
height: {
|
|
@@ -222,11 +203,7 @@ export interface ThemeControlsCoarse {
|
|
|
222
203
|
min: string;
|
|
223
204
|
};
|
|
224
205
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Box-shadow scale, rendered as `--skdx-shadow-<size>`. Geometry lives once
|
|
227
|
-
* in `foundation.ts` (see {@link shadows}); color defers to {@link ThemeShadowColor}.
|
|
228
|
-
* @public
|
|
229
|
-
*/
|
|
206
|
+
/** Box-shadow scale, rendered as `--skdx-shadow-<size>`; geometry lives once in `foundation.ts` (see {@link shadows}), color defers to {@link ThemeShadowColor}. @public */
|
|
230
207
|
export interface ThemeShadows {
|
|
231
208
|
sm: string;
|
|
232
209
|
md: string;
|
|
@@ -234,40 +211,20 @@ export interface ThemeShadows {
|
|
|
234
211
|
/** Elevated overlay surfaces (dialogs, popovers, dropdowns). */
|
|
235
212
|
overlay: string;
|
|
236
213
|
}
|
|
237
|
-
/**
|
|
238
|
-
* Shadow color: the only part of {@link shadows} a theme owns;
|
|
239
|
-
* geometry lives in the base. @public
|
|
240
|
-
*/
|
|
214
|
+
/** Shadow color: the only part of {@link shadows} a theme owns; geometry lives in the base. @public */
|
|
241
215
|
export interface ThemeShadowColor {
|
|
242
216
|
/** sRGB channels (e.g. `'2 6 23'`), substituted into `rgb(<color> / <alpha>)`. */
|
|
243
217
|
color: string;
|
|
244
|
-
/**
|
|
245
|
-
* Multiplier for base alphas in {@link shadows}. `'1'` for light themes;
|
|
246
|
-
* dark themes ~`'5'` (shadow must work on dark surface).
|
|
247
|
-
*/
|
|
218
|
+
/** Multiplier for base alphas in {@link shadows}: `'1'` for light themes, ~`'5'` for dark. */
|
|
248
219
|
strength: string;
|
|
249
220
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Font stacks a theme may override (only part of {@link typography} not fixed).
|
|
252
|
-
* Only `fluent` and `material-you` declare it. @public
|
|
253
|
-
*/
|
|
221
|
+
/** Font stacks a theme may override — the only part of {@link typography} not fixed; only `fluent` and `material-you` declare it. @public */
|
|
254
222
|
export type ThemeTypographyDeviation = Partial<Pick<ThemeTypography, 'fontFamily' | 'fontFamilyMono'>>;
|
|
255
|
-
/**
|
|
256
|
-
* Motion tokens a theme may retune. Optional ones (exit, staggers) stay uniform.
|
|
257
|
-
* Only `material-you`, `fluent` and `ant-daybreak` declare. @public
|
|
258
|
-
*/
|
|
223
|
+
/** Motion tokens a theme may retune; only `material-you`, `fluent` and `ant-daybreak` declare. @public */
|
|
259
224
|
export type ThemeMotionDeviation = Partial<Pick<ThemeMotion, 'durationFast' | 'durationNormal' | 'durationSlow' | 'easing'>>;
|
|
260
|
-
/**
|
|
261
|
-
* Animation durations, easing curves, and staggers rendered as `--skdx-motion-*`.
|
|
262
|
-
* Theme-invariant by default (timing shift reads as bug, affects vestibular users).
|
|
263
|
-
* Lives once in `foundation.ts` (see {@link motion}). `materialBrand`, `antBrand`,
|
|
264
|
-
* `fluentBrand` retune via {@link ThemeMotionDeviation}. @public
|
|
265
|
-
*/
|
|
225
|
+
/** Animation durations, easing curves, and staggers rendered as `--skdx-motion-*`; theme-invariant by default, lives once in `foundation.ts` (see {@link motion}). @public */
|
|
266
226
|
export interface ThemeMotion {
|
|
267
|
-
/**
|
|
268
|
-
* Zero for state changes that feel like data, not animation (value updates).
|
|
269
|
-
* @default '0ms'
|
|
270
|
-
*/
|
|
227
|
+
/** Zero for state changes that feel like data, not animation (value updates). @default '0ms' */
|
|
271
228
|
durationInstant?: string;
|
|
272
229
|
/** Hover/focus/press micro-interactions (direct manipulation). */
|
|
273
230
|
durationFast: string;
|
|
@@ -277,43 +234,20 @@ export interface ThemeMotion {
|
|
|
277
234
|
durationSlow: string;
|
|
278
235
|
/** Default curve: fast start, soft landing (for entering/opening). */
|
|
279
236
|
easing: string;
|
|
280
|
-
/**
|
|
281
|
-
* Mirror of {@link ThemeMotion.easing} (slow start, accelerates). For exits.
|
|
282
|
-
* @default 'cubic-bezier(0.4, 0, 1, 1)'
|
|
283
|
-
*/
|
|
237
|
+
/** Mirror of {@link ThemeMotion.easing} (slow start, accelerates), for exits. @default 'cubic-bezier(0.4, 0, 1, 1)' */
|
|
284
238
|
easingExit?: string;
|
|
285
|
-
/**
|
|
286
|
-
* Symmetric ease-in-out, no overshoot (in-place: color swaps, toggles).
|
|
287
|
-
* @default 'cubic-bezier(0.4, 0, 0.2, 1)'
|
|
288
|
-
*/
|
|
239
|
+
/** Symmetric ease-in-out, no overshoot (in-place: color swaps, toggles). @default 'cubic-bezier(0.4, 0, 0.2, 1)' */
|
|
289
240
|
easingSteady?: string;
|
|
290
|
-
/**
|
|
291
|
-
* Constant rate (indeterminate loops: spinner, shimmer).
|
|
292
|
-
* @default 'linear'
|
|
293
|
-
*/
|
|
241
|
+
/** Constant rate for indeterminate loops (spinner, shimmer). @default 'linear' */
|
|
294
242
|
easingLinear?: string;
|
|
295
|
-
/**
|
|
296
|
-
* Per-item sweep delay (reads as one gesture for large/unbounded lists).
|
|
297
|
-
* @default '4ms'
|
|
298
|
-
*/
|
|
243
|
+
/** Per-item sweep delay, reads as one gesture for large/unbounded lists. @default '4ms' */
|
|
299
244
|
staggerTight?: string;
|
|
300
|
-
/**
|
|
301
|
-
* Per-item sequence delay (distinct arrival, short/bounded lists only).
|
|
302
|
-
* @default '40ms'
|
|
303
|
-
*/
|
|
245
|
+
/** Per-item sequence delay, for distinct arrival on short/bounded lists only. @default '40ms' */
|
|
304
246
|
staggerLoose?: string;
|
|
305
247
|
}
|
|
306
|
-
/**
|
|
307
|
-
* Default motion values; merged under a theme's `motion` so every theme
|
|
308
|
-
* emits the complete `--skdx-motion-*` surface.
|
|
309
|
-
*/
|
|
248
|
+
/** Default motion values, merged under a theme's `motion` so every theme emits the complete `--skdx-motion-*` surface. */
|
|
310
249
|
export declare const defaultMotion: Required<ThemeMotion>;
|
|
311
|
-
/**
|
|
312
|
-
* Complete theme object flowing through {@link createTheme}, {@link themeToCss},
|
|
313
|
-
* and {@link applyTheme}. Contains only colors; type scale, spacing, radii,
|
|
314
|
-
* shadow, motion are theme-invariant (see `foundation.ts`). `typography` and
|
|
315
|
-
* `motion` are escape hatches for impersonating design languages. @public
|
|
316
|
-
*/
|
|
250
|
+
/** Complete theme object flowing through {@link createTheme}, {@link themeToCss} and {@link applyTheme}; contains only colors, since the rest is theme-invariant (see `foundation.ts`). @public */
|
|
317
251
|
export interface Theme {
|
|
318
252
|
/** Unique theme name (e.g. `"skanda-light"`), used as `[data-skdx-theme="..."]` selector. */
|
|
319
253
|
name: string;
|
|
@@ -328,8 +262,7 @@ export interface Theme {
|
|
|
328
262
|
motion?: ThemeMotionDeviation;
|
|
329
263
|
}
|
|
330
264
|
/**
|
|
331
|
-
* Partial {@link Theme} describing only what a brand changes
|
|
332
|
-
* {@link createTheme}, which deep-merges onto a base theme.
|
|
265
|
+
* Partial {@link Theme} describing only what a brand changes, passed to {@link createTheme} which deep-merges it onto a base theme.
|
|
333
266
|
* @example
|
|
334
267
|
* ```ts
|
|
335
268
|
* const override: ThemeOverride = {
|
|
@@ -339,8 +272,8 @@ export interface Theme {
|
|
|
339
272
|
* ```
|
|
340
273
|
* @public
|
|
341
274
|
*/
|
|
342
|
-
export type ThemeOverride =
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
} : Theme[K];
|
|
275
|
+
export type ThemeOverride = DeepPartial<Theme>;
|
|
276
|
+
type DeepPartial<T> = {
|
|
277
|
+
[K in keyof T]?: (T[K] extends object ? DeepPartial<T[K]> : T[K]) | undefined;
|
|
346
278
|
};
|
|
279
|
+
export {};
|