@buffcore/tokens 0.8.39 → 0.8.41
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/dist/index.d.ts +7 -1
- package/dist/index.js +8 -2
- package/dist/themes/bold.d.ts +6 -0
- package/dist/themes/bold.js +93 -0
- package/dist/themes/clear.d.ts +7 -0
- package/dist/themes/clear.js +102 -0
- package/dist/themes/warm.d.ts +7 -0
- package/dist/themes/warm.js +110 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,14 @@ export { toCss } from './outputs/css.ts';
|
|
|
5
5
|
export { type NativeTheme, scaleNative, toNative } from './outputs/native.ts';
|
|
6
6
|
export * from './semantic.ts';
|
|
7
7
|
export type { Bezier, Colors, ContrastCheck, Faces, Font, NumberValues, PerMode, ProductColorToken, Shadows, Theme, ThemeAllowance, ThemeTokenNames, } from './theme.ts';
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The starter themes. A product theme extends one of them with `extendTheme`. Clear, Warm and Bold
|
|
10
|
+
* are the directions a new product is offered first; Neutral and Soft stay for products built on them.
|
|
11
|
+
*/
|
|
9
12
|
export declare const themes: {
|
|
10
13
|
neutral: import("./theme.ts").Theme;
|
|
11
14
|
soft: import("./theme.ts").Theme;
|
|
15
|
+
clear: import("./theme.ts").Theme;
|
|
16
|
+
warm: import("./theme.ts").Theme;
|
|
17
|
+
bold: import("./theme.ts").Theme;
|
|
12
18
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { bold } from './themes/bold.js';
|
|
2
|
+
import { clear } from './themes/clear.js';
|
|
1
3
|
import { neutral } from './themes/neutral.js';
|
|
2
4
|
import { soft } from './themes/soft.js';
|
|
5
|
+
import { warm } from './themes/warm.js';
|
|
3
6
|
export { checkTheme, contrastRatio, setAsideWords } from './checks.js';
|
|
4
7
|
export { extendTheme } from './extend.js';
|
|
5
8
|
export { cssFontFamily, isSystemFont } from './fonts.js';
|
|
6
9
|
export { toCss } from './outputs/css.js';
|
|
7
10
|
export { scaleNative, toNative } from './outputs/native.js';
|
|
8
11
|
export * from './semantic.js';
|
|
9
|
-
/**
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The starter themes. A product theme extends one of them with `extendTheme`. Clear, Warm and Bold
|
|
14
|
+
* are the directions a new product is offered first; Neutral and Soft stay for products built on them.
|
|
15
|
+
*/
|
|
16
|
+
export const themes = { neutral, soft, clear, warm, bold };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { neutral } from './neutral.js';
|
|
2
|
+
/**
|
|
3
|
+
* The dark ground Bold keeps in both light and dark mode: it is a dark-first look, so a phone in
|
|
4
|
+
* light mode still shows it. Status colors are Neutral's dark ones, except success, moved to teal
|
|
5
|
+
* so the lime main action never reads as "correct".
|
|
6
|
+
*/
|
|
7
|
+
const night = {
|
|
8
|
+
...neutral.color.dark,
|
|
9
|
+
'surface-canvas': '#08090f',
|
|
10
|
+
'surface-page': '#0e0f1a',
|
|
11
|
+
'surface-panel': '#15172a',
|
|
12
|
+
'surface-sunken': '#0a0b14',
|
|
13
|
+
'surface-hover': '#23253a',
|
|
14
|
+
'surface-pressed': '#2c2f47',
|
|
15
|
+
'surface-selected': '#222a12',
|
|
16
|
+
'surface-inverse': '#f4f4f8',
|
|
17
|
+
'surface-overlay': '#1b1d2e',
|
|
18
|
+
'text-strong': '#f4f4f8',
|
|
19
|
+
'text-body': '#e4e4ec',
|
|
20
|
+
'text-muted': '#b4b6c8',
|
|
21
|
+
'text-subtle': '#a3a5bb',
|
|
22
|
+
'text-disabled': '#9c9eb4',
|
|
23
|
+
'text-inverse': '#0e0f1a',
|
|
24
|
+
'text-link': '#c6f432',
|
|
25
|
+
'border-hairline': '#23253a',
|
|
26
|
+
'border-default': '#2a2c40',
|
|
27
|
+
'border-control': '#7c7f99',
|
|
28
|
+
'border-strong': '#c9cadb',
|
|
29
|
+
'focus-ring': '#c6f432',
|
|
30
|
+
'focus-ring-offset': '#0e0f1a',
|
|
31
|
+
'brand-solid': '#c6f432',
|
|
32
|
+
'brand-hover': '#d4f86a',
|
|
33
|
+
'brand-pressed': '#e1fb98',
|
|
34
|
+
'brand-on-solid': '#0e0f1a',
|
|
35
|
+
'brand-tint': '#222a12',
|
|
36
|
+
'brand-tint-strong': '#33401a',
|
|
37
|
+
'brand-ink': '#d4f86a',
|
|
38
|
+
'brand-border': '#8fb51f',
|
|
39
|
+
'success-tint': '#0f2a2c',
|
|
40
|
+
'success-tint-strong': '#123a3d',
|
|
41
|
+
'success-border': '#2a7a80',
|
|
42
|
+
'success-solid': '#4fd8e0',
|
|
43
|
+
'success-on-solid': '#062226',
|
|
44
|
+
'success-ink': '#a8eef2',
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Bold, a starter theme: short, fast, a little bold. A dark ground, heavy tight headings, a lime
|
|
48
|
+
* pill button. Anything not set here is Neutral's.
|
|
49
|
+
*/
|
|
50
|
+
export const bold = {
|
|
51
|
+
...neutral,
|
|
52
|
+
key: 'bold',
|
|
53
|
+
label: 'Bold',
|
|
54
|
+
style: { controls: 'pill', surfaces: 'raised', density: 'comfortable', motion: 'lively' },
|
|
55
|
+
color: {
|
|
56
|
+
light: night,
|
|
57
|
+
dark: night,
|
|
58
|
+
contrast: {
|
|
59
|
+
...neutral.color.contrast,
|
|
60
|
+
'surface-selected': '#f2f8dc',
|
|
61
|
+
'text-link': '#334400',
|
|
62
|
+
'focus-ring': '#3d5200',
|
|
63
|
+
'brand-solid': '#334400',
|
|
64
|
+
'brand-hover': '#283600',
|
|
65
|
+
'brand-pressed': '#1d2700',
|
|
66
|
+
'brand-on-solid': '#ffffff',
|
|
67
|
+
'brand-tint': '#f6fbe4',
|
|
68
|
+
'brand-tint-strong': '#e6f3b8',
|
|
69
|
+
'brand-ink': '#283600',
|
|
70
|
+
'brand-border': '#4f6a00',
|
|
71
|
+
'success-tint': '#ebfbfc',
|
|
72
|
+
'success-tint-strong': '#cdf1f3',
|
|
73
|
+
'success-border': '#005a60',
|
|
74
|
+
'success-solid': '#00474d',
|
|
75
|
+
'success-on-solid': '#ffffff',
|
|
76
|
+
'success-ink': '#002e33',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
shadow: {
|
|
80
|
+
...neutral.shadow,
|
|
81
|
+
light: neutral.shadow.dark,
|
|
82
|
+
},
|
|
83
|
+
radius: {
|
|
84
|
+
...neutral.radius,
|
|
85
|
+
'radius-control': 999,
|
|
86
|
+
'radius-chip': 999,
|
|
87
|
+
'radius-panel': 16,
|
|
88
|
+
'radius-overlay': 24,
|
|
89
|
+
},
|
|
90
|
+
border: { ...neutral.border, 'border-width-panel': 0 },
|
|
91
|
+
weight: { ...neutral.weight, 'weight-heading': 800 },
|
|
92
|
+
tracking: { ...neutral.tracking, 'tracking-tight': -0.03 },
|
|
93
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Theme } from '../theme.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Clear, a starter theme: says what happened, then stops. White and ink, a blue main button,
|
|
4
|
+
* Public Sans with semibold headings, 8 px corners. Status colors and anything not set here are
|
|
5
|
+
* Neutral's.
|
|
6
|
+
*/
|
|
7
|
+
export declare const clear: Theme;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { neutral } from './neutral.js';
|
|
2
|
+
/**
|
|
3
|
+
* Clear, a starter theme: says what happened, then stops. White and ink, a blue main button,
|
|
4
|
+
* Public Sans with semibold headings, 8 px corners. Status colors and anything not set here are
|
|
5
|
+
* Neutral's.
|
|
6
|
+
*/
|
|
7
|
+
export const clear = {
|
|
8
|
+
...neutral,
|
|
9
|
+
key: 'clear',
|
|
10
|
+
label: 'Clear',
|
|
11
|
+
style: { controls: 'rounded', surfaces: 'outlined', density: 'comfortable', motion: 'calm' },
|
|
12
|
+
color: {
|
|
13
|
+
light: {
|
|
14
|
+
...neutral.color.light,
|
|
15
|
+
'surface-canvas': '#f9fafb',
|
|
16
|
+
'surface-page': '#ffffff',
|
|
17
|
+
'surface-panel': '#ffffff',
|
|
18
|
+
'surface-sunken': '#f3f4f6',
|
|
19
|
+
'surface-hover': '#f3f4f6',
|
|
20
|
+
'surface-pressed': '#e5e7eb',
|
|
21
|
+
'surface-selected': '#eff6ff',
|
|
22
|
+
'surface-inverse': '#111827',
|
|
23
|
+
'surface-overlay': '#ffffff',
|
|
24
|
+
'text-strong': '#111827',
|
|
25
|
+
'text-body': '#1f2937',
|
|
26
|
+
'text-muted': '#4b5563',
|
|
27
|
+
'text-subtle': '#5f6672',
|
|
28
|
+
'text-disabled': '#5f6672',
|
|
29
|
+
'text-inverse': '#ffffff',
|
|
30
|
+
'text-link': '#1d4ed8',
|
|
31
|
+
'border-hairline': '#e5e7eb',
|
|
32
|
+
'border-default': '#d1d5db',
|
|
33
|
+
'border-control': '#6b7280',
|
|
34
|
+
'border-strong': '#374151',
|
|
35
|
+
'focus-ring': '#2563eb',
|
|
36
|
+
'focus-ring-offset': '#ffffff',
|
|
37
|
+
'brand-solid': '#2563eb',
|
|
38
|
+
'brand-hover': '#1d4ed8',
|
|
39
|
+
'brand-pressed': '#1e40af',
|
|
40
|
+
'brand-on-solid': '#ffffff',
|
|
41
|
+
'brand-tint': '#eff6ff',
|
|
42
|
+
'brand-tint-strong': '#dbeafe',
|
|
43
|
+
'brand-ink': '#1e40af',
|
|
44
|
+
'brand-border': '#93c5fd',
|
|
45
|
+
},
|
|
46
|
+
dark: {
|
|
47
|
+
...neutral.color.dark,
|
|
48
|
+
'surface-canvas': '#030712',
|
|
49
|
+
'surface-page': '#0b1120',
|
|
50
|
+
'surface-panel': '#111827',
|
|
51
|
+
'surface-sunken': '#070b16',
|
|
52
|
+
'surface-hover': '#1f2937',
|
|
53
|
+
'surface-pressed': '#273244',
|
|
54
|
+
'surface-selected': '#172554',
|
|
55
|
+
'surface-inverse': '#f9fafb',
|
|
56
|
+
'surface-overlay': '#1f2937',
|
|
57
|
+
'text-strong': '#f9fafb',
|
|
58
|
+
'text-body': '#e5e7eb',
|
|
59
|
+
'text-muted': '#c0c5cd',
|
|
60
|
+
'text-subtle': '#a7adb7',
|
|
61
|
+
'text-disabled': '#a1a7b1',
|
|
62
|
+
'text-inverse': '#111827',
|
|
63
|
+
'text-link': '#93c5fd',
|
|
64
|
+
'border-hairline': '#1f2937',
|
|
65
|
+
'border-default': '#374151',
|
|
66
|
+
'border-control': '#8b93a1',
|
|
67
|
+
'border-strong': '#d1d5db',
|
|
68
|
+
'focus-ring': '#60a5fa',
|
|
69
|
+
'focus-ring-offset': '#0b1120',
|
|
70
|
+
'brand-solid': '#60a5fa',
|
|
71
|
+
'brand-hover': '#93c5fd',
|
|
72
|
+
'brand-pressed': '#bfdbfe',
|
|
73
|
+
'brand-on-solid': '#0b1120',
|
|
74
|
+
'brand-tint': '#172554',
|
|
75
|
+
'brand-tint-strong': '#1e3a8a',
|
|
76
|
+
'brand-ink': '#bfdbfe',
|
|
77
|
+
'brand-border': '#3b82f6',
|
|
78
|
+
},
|
|
79
|
+
contrast: {
|
|
80
|
+
...neutral.color.contrast,
|
|
81
|
+
'surface-selected': '#e0ecff',
|
|
82
|
+
'text-link': '#1e3a8a',
|
|
83
|
+
'focus-ring': '#1e40af',
|
|
84
|
+
'brand-solid': '#1e3a8a',
|
|
85
|
+
'brand-hover': '#172554',
|
|
86
|
+
'brand-pressed': '#0f1d4a',
|
|
87
|
+
'brand-on-solid': '#ffffff',
|
|
88
|
+
'brand-tint': '#eff6ff',
|
|
89
|
+
'brand-tint-strong': '#dbeafe',
|
|
90
|
+
'brand-ink': '#172554',
|
|
91
|
+
'brand-border': '#1d4ed8',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
radius: {
|
|
95
|
+
...neutral.radius,
|
|
96
|
+
'radius-control': 8,
|
|
97
|
+
'radius-chip': 6,
|
|
98
|
+
'radius-panel': 12,
|
|
99
|
+
'radius-overlay': 16,
|
|
100
|
+
},
|
|
101
|
+
weight: { ...neutral.weight, 'weight-heading': 600 },
|
|
102
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Theme } from '../theme.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Warm, a starter theme: friendly and sure, like a good host. Cream grounds, dark brown ink, a
|
|
4
|
+
* rust main button, serif headings (the platform's Georgia or serif, nothing to download) over
|
|
5
|
+
* Public Sans, 14 px corners. Status colors and anything not set here are Neutral's.
|
|
6
|
+
*/
|
|
7
|
+
export declare const warm: Theme;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { neutral } from './neutral.js';
|
|
2
|
+
/**
|
|
3
|
+
* Warm, a starter theme: friendly and sure, like a good host. Cream grounds, dark brown ink, a
|
|
4
|
+
* rust main button, serif headings (the platform's Georgia or serif, nothing to download) over
|
|
5
|
+
* Public Sans, 14 px corners. Status colors and anything not set here are Neutral's.
|
|
6
|
+
*/
|
|
7
|
+
export const warm = {
|
|
8
|
+
...neutral,
|
|
9
|
+
key: 'warm',
|
|
10
|
+
label: 'Warm',
|
|
11
|
+
style: { controls: 'rounded', surfaces: 'raised', density: 'comfortable', motion: 'calm' },
|
|
12
|
+
color: {
|
|
13
|
+
light: {
|
|
14
|
+
...neutral.color.light,
|
|
15
|
+
'surface-canvas': '#f6efe3',
|
|
16
|
+
'surface-page': '#fbf6ee',
|
|
17
|
+
'surface-panel': '#fffaf3',
|
|
18
|
+
'surface-sunken': '#f4ebdd',
|
|
19
|
+
'surface-hover': '#efe4d3',
|
|
20
|
+
'surface-pressed': '#e6d8c3',
|
|
21
|
+
'surface-selected': '#f8e6dc',
|
|
22
|
+
'surface-inverse': '#2a1e14',
|
|
23
|
+
'surface-overlay': '#fffaf3',
|
|
24
|
+
'text-strong': '#2a1e14',
|
|
25
|
+
'text-body': '#3a2a1d',
|
|
26
|
+
'text-muted': '#664630',
|
|
27
|
+
'text-subtle': '#6f5039',
|
|
28
|
+
'text-disabled': '#6f5039',
|
|
29
|
+
'text-inverse': '#fbf6ee',
|
|
30
|
+
'text-link': '#9a3412',
|
|
31
|
+
'border-hairline': '#eadcc6',
|
|
32
|
+
'border-default': '#dfcdb2',
|
|
33
|
+
'border-control': '#8a6e55',
|
|
34
|
+
'border-strong': '#5a4330',
|
|
35
|
+
'focus-ring': '#b4441f',
|
|
36
|
+
'focus-ring-offset': '#fbf6ee',
|
|
37
|
+
'brand-solid': '#b4441f',
|
|
38
|
+
'brand-hover': '#963719',
|
|
39
|
+
'brand-pressed': '#7a2c13',
|
|
40
|
+
'brand-on-solid': '#ffffff',
|
|
41
|
+
'brand-tint': '#f8e6dc',
|
|
42
|
+
'brand-tint-strong': '#f1d2c1',
|
|
43
|
+
'brand-ink': '#8a2f12',
|
|
44
|
+
'brand-border': '#e0a58a',
|
|
45
|
+
},
|
|
46
|
+
dark: {
|
|
47
|
+
...neutral.color.dark,
|
|
48
|
+
'surface-canvas': '#120d09',
|
|
49
|
+
'surface-page': '#1a140f',
|
|
50
|
+
'surface-panel': '#211912',
|
|
51
|
+
'surface-sunken': '#150f0b',
|
|
52
|
+
'surface-hover': '#2c2219',
|
|
53
|
+
'surface-pressed': '#382b20',
|
|
54
|
+
'surface-selected': '#3a2116',
|
|
55
|
+
'surface-inverse': '#fbf6ee',
|
|
56
|
+
'surface-overlay': '#2a2018',
|
|
57
|
+
'text-strong': '#fbf6ee',
|
|
58
|
+
'text-body': '#f1e6d6',
|
|
59
|
+
'text-muted': '#d2bea4',
|
|
60
|
+
'text-subtle': '#bfa88f',
|
|
61
|
+
'text-disabled': '#b39c84',
|
|
62
|
+
'text-inverse': '#2a1e14',
|
|
63
|
+
'text-link': '#f4a683',
|
|
64
|
+
'border-hairline': '#2f241b',
|
|
65
|
+
'border-default': '#433426',
|
|
66
|
+
'border-control': '#9a8168',
|
|
67
|
+
'border-strong': '#e0cdb3',
|
|
68
|
+
'focus-ring': '#f08a5d',
|
|
69
|
+
'focus-ring-offset': '#1a140f',
|
|
70
|
+
'brand-solid': '#f08a5d',
|
|
71
|
+
'brand-hover': '#f5a785',
|
|
72
|
+
'brand-pressed': '#f9c4ab',
|
|
73
|
+
'brand-on-solid': '#2a1209',
|
|
74
|
+
'brand-tint': '#3a2116',
|
|
75
|
+
'brand-tint-strong': '#52301f',
|
|
76
|
+
'brand-ink': '#f9c4ab',
|
|
77
|
+
'brand-border': '#b4441f',
|
|
78
|
+
},
|
|
79
|
+
contrast: {
|
|
80
|
+
...neutral.color.contrast,
|
|
81
|
+
'surface-selected': '#fbe9e0',
|
|
82
|
+
'text-link': '#6b240c',
|
|
83
|
+
'focus-ring': '#7a2c13',
|
|
84
|
+
'brand-solid': '#6b240c',
|
|
85
|
+
'brand-hover': '#541c09',
|
|
86
|
+
'brand-pressed': '#3f1506',
|
|
87
|
+
'brand-on-solid': '#ffffff',
|
|
88
|
+
'brand-tint': '#fdf3ee',
|
|
89
|
+
'brand-tint-strong': '#f9ddd0',
|
|
90
|
+
'brand-ink': '#541c09',
|
|
91
|
+
'brand-border': '#9a3412',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
shadow: {
|
|
95
|
+
...neutral.shadow,
|
|
96
|
+
light: {
|
|
97
|
+
...neutral.shadow.light,
|
|
98
|
+
'shadow-panel': '0 1px 2px rgba(60,35,15,0.06), 0 6px 18px rgba(60,35,15,0.07)',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
font: { ...neutral.font, display: ['Georgia', 'ui-serif', 'serif'] },
|
|
102
|
+
radius: {
|
|
103
|
+
...neutral.radius,
|
|
104
|
+
'radius-control': 14,
|
|
105
|
+
'radius-chip': 999,
|
|
106
|
+
'radius-panel': 18,
|
|
107
|
+
'radius-overlay': 22,
|
|
108
|
+
},
|
|
109
|
+
border: { ...neutral.border, 'border-width-panel': 0 },
|
|
110
|
+
};
|