@bilursag/solidui-tokens 0.0.0-stage → 0.1.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.
@@ -0,0 +1,159 @@
1
+ /**
2
+ * SolidUI design tokens — the single source of truth for @bilursag/solidui-react (web)
3
+ * and @bilursag/solidui-native (React Native).
4
+ *
5
+ * Look and feel inspired by Plush UI (https://plush-ui.pages.dev, MIT): light
6
+ * surfaces with soft shadows instead of borders, pill-shaped controls, rounded
7
+ * type and spring motion.
8
+ *
9
+ * Colors live in a *theme* (see ./theme.ts): neutrals and states are fixed and
10
+ * WCAG-checked; the brand group is derived from one color with `createTheme`.
11
+ */
12
+ export type ColorScheme = 'light' | 'dark';
13
+ /** Radii (px). A pill is half the control height. */
14
+ export declare const radius: {
15
+ readonly item: 10;
16
+ readonly check: 8;
17
+ readonly row: 16;
18
+ readonly card: 24;
19
+ readonly sheet: 32;
20
+ readonly panel: 40;
21
+ readonly pill: 9999;
22
+ };
23
+ /** Control heights (px): buttons, inputs, tabs, chips. */
24
+ export declare const size: {
25
+ readonly 'control-xs': 36;
26
+ readonly 'control-sm': 44;
27
+ readonly 'control-md': 52;
28
+ readonly 'control-lg': 56;
29
+ readonly 'control-xl': 64;
30
+ };
31
+ /** CSS shadows. A shadow is invisible on dark backgrounds, so dark mode adds a 1 px light ring. */
32
+ export declare const shadows: Record<ColorScheme, {
33
+ soft: string;
34
+ raised: string;
35
+ overlay: string;
36
+ }>;
37
+ /**
38
+ * Two families, both under the SIL Open Font License 1.1:
39
+ * - Text (`rounded`): Open Runde, for everything except large titles.
40
+ * - Titles (`heading`): Montserrat, only from ~22 px up and at 600–800 —
41
+ * it is wide and looks cramped at small sizes.
42
+ * React Native does not synthesize weights for custom fonts, so native has one family per weight.
43
+ */
44
+ export declare const font: {
45
+ readonly web: {
46
+ readonly rounded: "\"Open Runde\", ui-rounded, \"SF Pro Rounded\", system-ui, sans-serif";
47
+ readonly heading: "\"Montserrat Variable\", \"Montserrat\", ui-sans-serif, system-ui, sans-serif";
48
+ };
49
+ readonly native: {
50
+ readonly rounded: {
51
+ readonly regular: "OpenRunde-Regular";
52
+ readonly medium: "OpenRunde-Medium";
53
+ readonly semibold: "OpenRunde-Semibold";
54
+ readonly bold: "OpenRunde-Bold";
55
+ };
56
+ readonly heading: {
57
+ readonly semibold: "Montserrat-SemiBold";
58
+ readonly bold: "Montserrat-Bold";
59
+ readonly extrabold: "Montserrat-ExtraBold";
60
+ };
61
+ };
62
+ /** Montserrat is wide: large titles are tightened slightly. */
63
+ readonly headingTracking: "-0.02em";
64
+ };
65
+ export type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold' | 'extrabold';
66
+ /**
67
+ * Semantic type scale: size and line height travel together.
68
+ * Web: `text-display`, `text-title`… (Tailwind v4). Native: the same classes
69
+ * (NativeWind) or the numbers for StyleSheet.
70
+ * Coexists with Tailwind's numeric scale; the large steps match it:
71
+ * title = 2xl, heading = xl, body = base, label = sm.
72
+ * `family` and `weight` are each style's default (used by <Text> on native).
73
+ */
74
+ export declare const typeScale: {
75
+ readonly display: {
76
+ readonly size: 34;
77
+ readonly lineHeight: 40;
78
+ readonly family: "heading";
79
+ readonly weight: "extrabold";
80
+ readonly tracking: "heading";
81
+ };
82
+ readonly title: {
83
+ readonly size: 24;
84
+ readonly lineHeight: 32;
85
+ readonly family: "heading";
86
+ readonly weight: "bold";
87
+ readonly tracking: "heading";
88
+ };
89
+ readonly heading: {
90
+ readonly size: 20;
91
+ readonly lineHeight: 28;
92
+ readonly family: "rounded";
93
+ readonly weight: "semibold";
94
+ };
95
+ readonly body: {
96
+ readonly size: 16;
97
+ readonly lineHeight: 24;
98
+ readonly family: "rounded";
99
+ readonly weight: "medium";
100
+ };
101
+ readonly 'body-sm': {
102
+ readonly size: 15;
103
+ readonly lineHeight: 21;
104
+ readonly family: "rounded";
105
+ readonly weight: "medium";
106
+ };
107
+ readonly label: {
108
+ readonly size: 14;
109
+ readonly lineHeight: 20;
110
+ readonly family: "rounded";
111
+ readonly weight: "semibold";
112
+ };
113
+ readonly caption: {
114
+ readonly size: 13;
115
+ readonly lineHeight: 18;
116
+ readonly family: "rounded";
117
+ readonly weight: "medium";
118
+ };
119
+ /** Counters and tiny badges. Not for running text. */
120
+ readonly micro: {
121
+ readonly size: 11;
122
+ readonly lineHeight: 14;
123
+ readonly family: "rounded";
124
+ readonly weight: "semibold";
125
+ };
126
+ readonly btn: {
127
+ readonly size: 17;
128
+ readonly lineHeight: 22;
129
+ readonly family: "rounded";
130
+ readonly weight: "semibold";
131
+ };
132
+ };
133
+ export type TypeStyleName = keyof typeof typeScale;
134
+ /** Size, line height and tracking in px for React Native StyleSheet (the family is per weight, separately). */
135
+ export declare function textMetrics(name: TypeStyleName): {
136
+ letterSpacing?: number | undefined;
137
+ fontSize: number;
138
+ lineHeight: number;
139
+ };
140
+ export declare const motion: {
141
+ readonly durationFast: 150;
142
+ readonly durationFade: 220;
143
+ readonly durationSpring: 600;
144
+ /** Spring curve with ~3 % overshoot (from Plush UI) for CSS `transition`. */
145
+ readonly easeSpring: "linear(0, 0.062, 0.203, 0.372, 0.538, 0.683, 0.801, 0.89, 0.952, 0.993, 1.016, 1.028, 1.031, 1.029, 1.025, 1.02, 1.015, 1.01, 1.006, 1.004, 1.002, 1)";
146
+ readonly easeFade: "cubic-bezier(0.2, 0, 0, 1)";
147
+ /** Press scale: pills give a little, round buttons more. */
148
+ readonly pressScale: {
149
+ readonly pill: 0.97;
150
+ readonly icon: 0.92;
151
+ };
152
+ /** Reanimated equivalent (`withSpring`). */
153
+ readonly spring: {
154
+ readonly damping: 15;
155
+ readonly stiffness: 320;
156
+ readonly mass: 1;
157
+ };
158
+ };
159
+ //# sourceMappingURL=scales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../src/scales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,qDAAqD;AACrD,eAAO,MAAM,MAAM;;;;;;;;CAQT,CAAC;AAEX,0DAA0D;AAC1D,eAAO,MAAM,IAAI;;;;;;CAMP,CAAC;AAEX,mGAAmG;AACnG,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAW1F,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;IAkBf,+DAA+D;;CAEvD,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAYlF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQpB,sDAAsD;;;;;;;;;;;;;CAGV,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,SAAS,CAAC;AAEnD,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa;;;;EAO9C;AAED,eAAO,MAAM,MAAM;;;;IAIjB,6EAA6E;;;IAI7E,4DAA4D;;;;;IAE5D,4CAA4C;;;;;;CAEpC,CAAC"}
package/dist/scales.js ADDED
@@ -0,0 +1,112 @@
1
+ /**
2
+ * SolidUI design tokens — the single source of truth for @bilursag/solidui-react (web)
3
+ * and @bilursag/solidui-native (React Native).
4
+ *
5
+ * Look and feel inspired by Plush UI (https://plush-ui.pages.dev, MIT): light
6
+ * surfaces with soft shadows instead of borders, pill-shaped controls, rounded
7
+ * type and spring motion.
8
+ *
9
+ * Colors live in a *theme* (see ./theme.ts): neutrals and states are fixed and
10
+ * WCAG-checked; the brand group is derived from one color with `createTheme`.
11
+ */
12
+ /** Radii (px). A pill is half the control height. */
13
+ export const radius = {
14
+ item: 10,
15
+ check: 8,
16
+ row: 16,
17
+ card: 24,
18
+ sheet: 32,
19
+ panel: 40,
20
+ pill: 9999,
21
+ };
22
+ /** Control heights (px): buttons, inputs, tabs, chips. */
23
+ export const size = {
24
+ 'control-xs': 36,
25
+ 'control-sm': 44,
26
+ 'control-md': 52,
27
+ 'control-lg': 56,
28
+ 'control-xl': 64,
29
+ };
30
+ /** CSS shadows. A shadow is invisible on dark backgrounds, so dark mode adds a 1 px light ring. */
31
+ export const shadows = {
32
+ light: {
33
+ soft: '0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.05)',
34
+ raised: '0 1px 3px rgba(20, 20, 20, 0.14), 0 4px 12px rgba(20, 20, 20, 0.08)',
35
+ overlay: '0 2px 8px rgba(20, 20, 20, 0.08), 0 24px 64px rgba(20, 20, 20, 0.16)',
36
+ },
37
+ dark: {
38
+ soft: '0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.35)',
39
+ raised: '0 0 0 1px rgba(255, 255, 255, 0.10), 0 4px 12px rgba(0, 0, 0, 0.45)',
40
+ overlay: '0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 64px rgba(0, 0, 0, 0.6)',
41
+ },
42
+ };
43
+ /**
44
+ * Two families, both under the SIL Open Font License 1.1:
45
+ * - Text (`rounded`): Open Runde, for everything except large titles.
46
+ * - Titles (`heading`): Montserrat, only from ~22 px up and at 600–800 —
47
+ * it is wide and looks cramped at small sizes.
48
+ * React Native does not synthesize weights for custom fonts, so native has one family per weight.
49
+ */
50
+ export const font = {
51
+ web: {
52
+ rounded: '"Open Runde", ui-rounded, "SF Pro Rounded", system-ui, sans-serif',
53
+ heading: '"Montserrat Variable", "Montserrat", ui-sans-serif, system-ui, sans-serif',
54
+ },
55
+ native: {
56
+ rounded: {
57
+ regular: 'OpenRunde-Regular',
58
+ medium: 'OpenRunde-Medium',
59
+ semibold: 'OpenRunde-Semibold',
60
+ bold: 'OpenRunde-Bold',
61
+ },
62
+ heading: {
63
+ semibold: 'Montserrat-SemiBold',
64
+ bold: 'Montserrat-Bold',
65
+ extrabold: 'Montserrat-ExtraBold',
66
+ },
67
+ },
68
+ /** Montserrat is wide: large titles are tightened slightly. */
69
+ headingTracking: '-0.02em',
70
+ };
71
+ /**
72
+ * Semantic type scale: size and line height travel together.
73
+ * Web: `text-display`, `text-title`… (Tailwind v4). Native: the same classes
74
+ * (NativeWind) or the numbers for StyleSheet.
75
+ * Coexists with Tailwind's numeric scale; the large steps match it:
76
+ * title = 2xl, heading = xl, body = base, label = sm.
77
+ * `family` and `weight` are each style's default (used by <Text> on native).
78
+ */
79
+ export const typeScale = {
80
+ display: { size: 34, lineHeight: 40, family: 'heading', weight: 'extrabold', tracking: 'heading' },
81
+ title: { size: 24, lineHeight: 32, family: 'heading', weight: 'bold', tracking: 'heading' },
82
+ heading: { size: 20, lineHeight: 28, family: 'rounded', weight: 'semibold' },
83
+ body: { size: 16, lineHeight: 24, family: 'rounded', weight: 'medium' },
84
+ 'body-sm': { size: 15, lineHeight: 21, family: 'rounded', weight: 'medium' },
85
+ label: { size: 14, lineHeight: 20, family: 'rounded', weight: 'semibold' },
86
+ caption: { size: 13, lineHeight: 18, family: 'rounded', weight: 'medium' },
87
+ /** Counters and tiny badges. Not for running text. */
88
+ micro: { size: 11, lineHeight: 14, family: 'rounded', weight: 'semibold' },
89
+ btn: { size: 17, lineHeight: 22, family: 'rounded', weight: 'semibold' },
90
+ };
91
+ /** Size, line height and tracking in px for React Native StyleSheet (the family is per weight, separately). */
92
+ export function textMetrics(name) {
93
+ const t = typeScale[name];
94
+ return {
95
+ fontSize: t.size,
96
+ lineHeight: t.lineHeight,
97
+ ...(t.tracking ? { letterSpacing: Math.round(t.size * parseFloat(font.headingTracking) * 100) / 100 } : null),
98
+ };
99
+ }
100
+ export const motion = {
101
+ durationFast: 150,
102
+ durationFade: 220,
103
+ durationSpring: 600,
104
+ /** Spring curve with ~3 % overshoot (from Plush UI) for CSS `transition`. */
105
+ easeSpring: 'linear(0, 0.062, 0.203, 0.372, 0.538, 0.683, 0.801, 0.89, 0.952, 0.993, 1.016, 1.028, 1.031, 1.029, 1.025, 1.02, 1.015, 1.01, 1.006, 1.004, 1.002, 1)',
106
+ easeFade: 'cubic-bezier(0.2, 0, 0, 1)',
107
+ /** Press scale: pills give a little, round buttons more. */
108
+ pressScale: { pill: 0.97, icon: 0.92 },
109
+ /** Reanimated equivalent (`withSpring`). */
110
+ spring: { damping: 15, stiffness: 320, mass: 1 },
111
+ };
112
+ //# sourceMappingURL=scales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scales.js","sourceRoot":"","sources":["../src/scales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,qDAAqD;AACrD,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,IAAI;CACF,CAAC;AAEX,0DAA0D;AAC1D,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;CACR,CAAC;AAEX,mGAAmG;AACnG,MAAM,CAAC,MAAM,OAAO,GAA2E;IAC7F,KAAK,EAAE;QACL,IAAI,EAAE,qEAAqE;QAC3E,MAAM,EAAE,qEAAqE;QAC7E,OAAO,EAAE,sEAAsE;KAChF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,qEAAqE;QAC3E,MAAM,EAAE,qEAAqE;QAC7E,OAAO,EAAE,qEAAqE;KAC/E;CACF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,GAAG,EAAE;QACH,O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ui-tokens — do not edit.
2
+ module.exports = {
3
+ "theme": {
4
+ "extend": {
5
+ "colors": {
6
+ "canvas": "rgb(var(--sui-canvas) / <alpha-value>)",
7
+ "panel": "rgb(var(--sui-panel) / <alpha-value>)",
8
+ "surface": "rgb(var(--sui-surface) / <alpha-value>)",
9
+ "surface-hover": "rgb(var(--sui-surface-hover) / <alpha-value>)",
10
+ "surface-press": "rgb(var(--sui-surface-press) / <alpha-value>)",
11
+ "fill": "rgb(var(--sui-fill) / <alpha-value>)",
12
+ "fill-strong": "rgb(var(--sui-fill-strong) / <alpha-value>)",
13
+ "fill-press": "rgb(var(--sui-fill-press) / <alpha-value>)",
14
+ "line": "rgb(var(--sui-line) / <alpha-value>)",
15
+ "ink": "rgb(var(--sui-ink) / <alpha-value>)",
16
+ "ink-2": "rgb(var(--sui-ink-2) / <alpha-value>)",
17
+ "ink-3": "rgb(var(--sui-ink-3) / <alpha-value>)",
18
+ "success": "rgb(var(--sui-success) / <alpha-value>)",
19
+ "success-tint": "rgb(var(--sui-success-tint) / <alpha-value>)",
20
+ "success-ink": "rgb(var(--sui-success-ink) / <alpha-value>)",
21
+ "danger": "rgb(var(--sui-danger) / <alpha-value>)",
22
+ "danger-hover": "rgb(var(--sui-danger-hover) / <alpha-value>)",
23
+ "on-danger": "rgb(var(--sui-on-danger) / <alpha-value>)",
24
+ "danger-tint": "rgb(var(--sui-danger-tint) / <alpha-value>)",
25
+ "danger-ink": "rgb(var(--sui-danger-ink) / <alpha-value>)",
26
+ "warning": "rgb(var(--sui-warning) / <alpha-value>)",
27
+ "warning-tint": "rgb(var(--sui-warning-tint) / <alpha-value>)",
28
+ "warning-ink": "rgb(var(--sui-warning-ink) / <alpha-value>)",
29
+ "brand": "rgb(var(--sui-brand) / <alpha-value>)",
30
+ "brand-hover": "rgb(var(--sui-brand-hover) / <alpha-value>)",
31
+ "brand-press": "rgb(var(--sui-brand-press) / <alpha-value>)",
32
+ "on-brand": "rgb(var(--sui-on-brand) / <alpha-value>)",
33
+ "brand-tint": "rgb(var(--sui-brand-tint) / <alpha-value>)",
34
+ "brand-ink": "rgb(var(--sui-brand-ink) / <alpha-value>)",
35
+ "brand-2": "rgb(var(--sui-brand-2) / <alpha-value>)",
36
+ "focus": "rgb(var(--sui-focus) / <alpha-value>)"
37
+ },
38
+ "borderRadius": {
39
+ "item": "10px",
40
+ "check": "8px",
41
+ "row": "16px",
42
+ "card": "24px",
43
+ "sheet": "32px",
44
+ "panel": "40px",
45
+ "pill": "9999px"
46
+ },
47
+ "spacing": {
48
+ "control-xs": "36px",
49
+ "control-sm": "44px",
50
+ "control-md": "52px",
51
+ "control-lg": "56px",
52
+ "control-xl": "64px"
53
+ },
54
+ "fontFamily": {
55
+ "rounded": [
56
+ "OpenRunde-Medium"
57
+ ],
58
+ "rounded-regular": [
59
+ "OpenRunde-Regular"
60
+ ],
61
+ "rounded-medium": [
62
+ "OpenRunde-Medium"
63
+ ],
64
+ "rounded-semibold": [
65
+ "OpenRunde-Semibold"
66
+ ],
67
+ "rounded-bold": [
68
+ "OpenRunde-Bold"
69
+ ],
70
+ "heading": [
71
+ "Montserrat-Bold"
72
+ ],
73
+ "heading-semibold": [
74
+ "Montserrat-SemiBold"
75
+ ],
76
+ "heading-bold": [
77
+ "Montserrat-Bold"
78
+ ],
79
+ "heading-extrabold": [
80
+ "Montserrat-ExtraBold"
81
+ ]
82
+ },
83
+ "letterSpacing": {
84
+ "heading": "-0.02em"
85
+ },
86
+ "fontSize": {
87
+ "display": [
88
+ "34px",
89
+ {
90
+ "lineHeight": "40px"
91
+ }
92
+ ],
93
+ "title": [
94
+ "24px",
95
+ {
96
+ "lineHeight": "32px"
97
+ }
98
+ ],
99
+ "heading": [
100
+ "20px",
101
+ {
102
+ "lineHeight": "28px"
103
+ }
104
+ ],
105
+ "body": [
106
+ "16px",
107
+ {
108
+ "lineHeight": "24px"
109
+ }
110
+ ],
111
+ "body-sm": [
112
+ "15px",
113
+ {
114
+ "lineHeight": "21px"
115
+ }
116
+ ],
117
+ "label": [
118
+ "14px",
119
+ {
120
+ "lineHeight": "20px"
121
+ }
122
+ ],
123
+ "caption": [
124
+ "13px",
125
+ {
126
+ "lineHeight": "18px"
127
+ }
128
+ ],
129
+ "micro": [
130
+ "11px",
131
+ {
132
+ "lineHeight": "14px"
133
+ }
134
+ ],
135
+ "btn": [
136
+ "17px",
137
+ {
138
+ "lineHeight": "22px"
139
+ }
140
+ ]
141
+ }
142
+ }
143
+ }
144
+ };
@@ -0,0 +1,84 @@
1
+ import { shadows, type ColorScheme } from './scales.js';
2
+ declare const neutralsLight: {
3
+ canvas: string;
4
+ panel: string;
5
+ surface: string;
6
+ 'surface-hover': string;
7
+ 'surface-press': string;
8
+ fill: string;
9
+ 'fill-strong': string;
10
+ 'fill-press': string;
11
+ line: string;
12
+ ink: string;
13
+ 'ink-2': string;
14
+ 'ink-3': string;
15
+ success: string;
16
+ 'success-tint': string;
17
+ 'success-ink': string;
18
+ danger: string;
19
+ 'danger-hover': string;
20
+ 'on-danger': string;
21
+ 'danger-tint': string;
22
+ 'danger-ink': string;
23
+ warning: string;
24
+ 'warning-tint': string;
25
+ 'warning-ink': string;
26
+ scrim: string;
27
+ };
28
+ type Neutrals = typeof neutralsLight;
29
+ declare const brandKeys: readonly ["brand", "brand-hover", "brand-press", "on-brand", "brand-tint", "brand-ink", "brand-2", "focus"];
30
+ type BrandGroup = Record<(typeof brandKeys)[number], string>;
31
+ export type Palette = Neutrals & BrandGroup;
32
+ export type ColorToken = keyof Palette;
33
+ /** Every color token, in a stable order (neutrals, then brand). */
34
+ export declare const colorNames: ColorToken[];
35
+ export interface Theme {
36
+ colors: Record<ColorScheme, Palette>;
37
+ gradients: Record<ColorScheme, {
38
+ brand: [string, string];
39
+ }>;
40
+ shadows: typeof shadows;
41
+ /** CSS font stacks (web). Native fonts are configured in the Tailwind preset. */
42
+ fonts: {
43
+ rounded: string;
44
+ heading: string;
45
+ };
46
+ }
47
+ type PerScheme<T> = T | {
48
+ light: T;
49
+ dark: T;
50
+ };
51
+ export interface ThemeOptions {
52
+ /** The brand color (6-digit hex). One value derives both schemes; pass `{ light, dark }` to pick each. */
53
+ brand?: PerScheme<string>;
54
+ /** Second color of the brand gradient. Defaults to the hue 45° ahead (45° back for reds), adjusted so on-brand stays legible. */
55
+ accent?: PerScheme<string>;
56
+ /** Exact overrides per token, applied after derivation (escape hatch). */
57
+ colors?: Partial<Record<ColorScheme, Partial<Palette>>>;
58
+ /** CSS font stacks for the web. */
59
+ fonts?: Partial<Theme['fonts']>;
60
+ }
61
+ export declare const DEFAULT_BRAND = "#4b48e0";
62
+ /** Builds a complete theme from a brand color. Check it with `checkContrast(theme)`. */
63
+ export declare function createTheme(options?: ThemeOptions): Theme;
64
+ /** The theme SolidUI ships with. */
65
+ export declare const defaultTheme: Theme;
66
+ /** Shortcuts to the default theme (handy in JS: icon colors, charts…). */
67
+ export declare const colors: Record<ColorScheme, Palette>;
68
+ export declare const gradients: Record<ColorScheme, {
69
+ brand: [string, string];
70
+ }>;
71
+ /** Text/background pairs checked against WCAG (4.5 = AA body text, 3 = icons and large text). */
72
+ export declare const contrastChecks: Array<[ColorToken, ColorToken, number]>;
73
+ export interface ContrastResult {
74
+ scheme: ColorScheme;
75
+ fg: ColorToken;
76
+ bg: ColorToken;
77
+ ratio: number;
78
+ min: number;
79
+ pass: boolean;
80
+ }
81
+ /** Runs every pair in `contrastChecks` on both schemes. */
82
+ export declare function checkContrast(theme?: Theme): ContrastResult[];
83
+ export {};
84
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAMA,OAAO,EAAQ,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;CAgClB,CAAC;AAEF,KAAK,QAAQ,GAAG,OAAO,aAAa,CAAC;AAiCrC,QAAA,MAA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