@doitrix/tokens 1.0.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/LICENSE +21 -0
- package/README.md +78 -0
- package/css/tailwind.css +296 -0
- package/css/tokens.css +284 -0
- package/dist/contrast.d.ts +4 -0
- package/dist/css.d.ts +54 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +559 -0
- package/dist/palette.d.ts +39 -0
- package/dist/scales.d.ts +210 -0
- package/dist/theme.d.ts +29 -0
- package/package.json +65 -0
package/dist/scales.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/** One 4px base unit; every step is a multiple of it. */
|
|
2
|
+
export declare const space: {
|
|
3
|
+
readonly 0: "0";
|
|
4
|
+
readonly 1: "0.25rem";
|
|
5
|
+
readonly 2: "0.5rem";
|
|
6
|
+
readonly 3: "0.75rem";
|
|
7
|
+
readonly 4: "1rem";
|
|
8
|
+
readonly 5: "1.25rem";
|
|
9
|
+
readonly 6: "1.5rem";
|
|
10
|
+
readonly 8: "2rem";
|
|
11
|
+
readonly 10: "2.5rem";
|
|
12
|
+
readonly 12: "3rem";
|
|
13
|
+
readonly 16: "4rem";
|
|
14
|
+
readonly 20: "5rem";
|
|
15
|
+
readonly 24: "6rem";
|
|
16
|
+
};
|
|
17
|
+
export declare const radius: {
|
|
18
|
+
readonly none: "0";
|
|
19
|
+
readonly sm: "0.25rem";
|
|
20
|
+
readonly md: "0.5rem";
|
|
21
|
+
readonly lg: "0.75rem";
|
|
22
|
+
readonly xl: "1rem";
|
|
23
|
+
readonly full: "9999px";
|
|
24
|
+
};
|
|
25
|
+
/** Google Sans for reading, Montserrat for headlines, Geist Mono for figures. */
|
|
26
|
+
export declare const font: {
|
|
27
|
+
readonly sans: "'Google Sans Variable', 'Google Sans', ui-sans-serif, system-ui, sans-serif";
|
|
28
|
+
readonly mono: "'Geist Mono Variable', 'Geist Mono', ui-monospace, monospace";
|
|
29
|
+
readonly display: "'Montserrat Variable', 'Montserrat', 'Google Sans Variable', ui-sans-serif, system-ui, sans-serif";
|
|
30
|
+
};
|
|
31
|
+
/** Medium is the floor: no text in the system is set lighter than 500. */
|
|
32
|
+
export declare const weight: {
|
|
33
|
+
readonly medium: 500;
|
|
34
|
+
readonly semibold: 600;
|
|
35
|
+
readonly bold: 700;
|
|
36
|
+
readonly extrabold: 800;
|
|
37
|
+
};
|
|
38
|
+
type WeightName = keyof typeof weight;
|
|
39
|
+
export interface TypeRole {
|
|
40
|
+
readonly size: string;
|
|
41
|
+
readonly lineHeight: string;
|
|
42
|
+
readonly weight: WeightName;
|
|
43
|
+
readonly tracking?: string;
|
|
44
|
+
readonly family?: keyof typeof font;
|
|
45
|
+
}
|
|
46
|
+
/** Size and line height are always paired and addressed by role, never by number. */
|
|
47
|
+
export declare const text: {
|
|
48
|
+
readonly 'display-lg': {
|
|
49
|
+
readonly size: "3.5625rem";
|
|
50
|
+
readonly lineHeight: "4rem";
|
|
51
|
+
readonly weight: "bold";
|
|
52
|
+
readonly tracking: "-0.015625rem";
|
|
53
|
+
readonly family: "display";
|
|
54
|
+
};
|
|
55
|
+
readonly 'display-md': {
|
|
56
|
+
readonly size: "2.8125rem";
|
|
57
|
+
readonly lineHeight: "3.25rem";
|
|
58
|
+
readonly weight: "bold";
|
|
59
|
+
readonly family: "display";
|
|
60
|
+
};
|
|
61
|
+
readonly 'display-sm': {
|
|
62
|
+
readonly size: "2.25rem";
|
|
63
|
+
readonly lineHeight: "2.75rem";
|
|
64
|
+
readonly weight: "bold";
|
|
65
|
+
readonly family: "display";
|
|
66
|
+
};
|
|
67
|
+
readonly 'headline-lg': {
|
|
68
|
+
readonly size: "2rem";
|
|
69
|
+
readonly lineHeight: "2.5rem";
|
|
70
|
+
readonly weight: "bold";
|
|
71
|
+
readonly family: "display";
|
|
72
|
+
};
|
|
73
|
+
readonly 'headline-md': {
|
|
74
|
+
readonly size: "1.75rem";
|
|
75
|
+
readonly lineHeight: "2.25rem";
|
|
76
|
+
readonly weight: "bold";
|
|
77
|
+
readonly family: "display";
|
|
78
|
+
};
|
|
79
|
+
readonly 'headline-sm': {
|
|
80
|
+
readonly size: "1.5rem";
|
|
81
|
+
readonly lineHeight: "2rem";
|
|
82
|
+
readonly weight: "bold";
|
|
83
|
+
readonly family: "display";
|
|
84
|
+
};
|
|
85
|
+
readonly 'title-lg': {
|
|
86
|
+
readonly size: "1.375rem";
|
|
87
|
+
readonly lineHeight: "1.75rem";
|
|
88
|
+
readonly weight: "semibold";
|
|
89
|
+
};
|
|
90
|
+
readonly 'title-md': {
|
|
91
|
+
readonly size: "1rem";
|
|
92
|
+
readonly lineHeight: "1.5rem";
|
|
93
|
+
readonly weight: "semibold";
|
|
94
|
+
readonly tracking: "0.009375rem";
|
|
95
|
+
};
|
|
96
|
+
readonly 'title-sm': {
|
|
97
|
+
readonly size: "0.875rem";
|
|
98
|
+
readonly lineHeight: "1.25rem";
|
|
99
|
+
readonly weight: "semibold";
|
|
100
|
+
readonly tracking: "0.00625rem";
|
|
101
|
+
};
|
|
102
|
+
readonly 'body-lg': {
|
|
103
|
+
readonly size: "1rem";
|
|
104
|
+
readonly lineHeight: "1.5rem";
|
|
105
|
+
readonly weight: "medium";
|
|
106
|
+
};
|
|
107
|
+
readonly 'body-md': {
|
|
108
|
+
readonly size: "0.875rem";
|
|
109
|
+
readonly lineHeight: "1.25rem";
|
|
110
|
+
readonly weight: "medium";
|
|
111
|
+
};
|
|
112
|
+
readonly 'body-sm': {
|
|
113
|
+
readonly size: "0.75rem";
|
|
114
|
+
readonly lineHeight: "1rem";
|
|
115
|
+
readonly weight: "medium";
|
|
116
|
+
};
|
|
117
|
+
readonly 'label-lg': {
|
|
118
|
+
readonly size: "0.875rem";
|
|
119
|
+
readonly lineHeight: "1.25rem";
|
|
120
|
+
readonly weight: "medium";
|
|
121
|
+
readonly tracking: "0.00625rem";
|
|
122
|
+
};
|
|
123
|
+
readonly 'label-md': {
|
|
124
|
+
readonly size: "0.75rem";
|
|
125
|
+
readonly lineHeight: "1rem";
|
|
126
|
+
readonly weight: "medium";
|
|
127
|
+
readonly tracking: "0.03125rem";
|
|
128
|
+
};
|
|
129
|
+
readonly overline: {
|
|
130
|
+
readonly size: "0.75rem";
|
|
131
|
+
readonly lineHeight: "1rem";
|
|
132
|
+
readonly weight: "semibold";
|
|
133
|
+
readonly tracking: "0.16em";
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export type TextRole = keyof typeof text;
|
|
137
|
+
/**
|
|
138
|
+
* Durations sit on a 40ms step so they stay related. Seconds, because GSAP
|
|
139
|
+
* and the rAF fallback both consume seconds; the CSS output converts to ms.
|
|
140
|
+
*/
|
|
141
|
+
export declare const duration: {
|
|
142
|
+
readonly press: 0.12;
|
|
143
|
+
readonly fast: 0.16;
|
|
144
|
+
readonly micro: 0.2;
|
|
145
|
+
readonly state: 0.28;
|
|
146
|
+
readonly morph: 0.36;
|
|
147
|
+
readonly enter: 0.44;
|
|
148
|
+
readonly overlay: 0.56;
|
|
149
|
+
readonly travel: 0.72;
|
|
150
|
+
};
|
|
151
|
+
export type DurationName = keyof typeof duration;
|
|
152
|
+
/** Each curve with its GSAP equivalent, so CSS and JS motion never disagree. */
|
|
153
|
+
export declare const ease: {
|
|
154
|
+
readonly standard: {
|
|
155
|
+
readonly css: "cubic-bezier(0.2, 0, 0, 1)";
|
|
156
|
+
readonly gsap: "power4.out";
|
|
157
|
+
};
|
|
158
|
+
readonly out: {
|
|
159
|
+
readonly css: "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
160
|
+
readonly gsap: "power3.out";
|
|
161
|
+
};
|
|
162
|
+
readonly 'in-out': {
|
|
163
|
+
readonly css: "cubic-bezier(0.65, 0, 0.35, 1)";
|
|
164
|
+
readonly gsap: "power3.inOut";
|
|
165
|
+
};
|
|
166
|
+
readonly in: {
|
|
167
|
+
readonly css: "cubic-bezier(0.11, 0, 0.5, 0)";
|
|
168
|
+
readonly gsap: "power2.in";
|
|
169
|
+
};
|
|
170
|
+
/** A long, settling deceleration for things arriving on screen: dialogs, sheets, popovers. */
|
|
171
|
+
readonly emphasized: {
|
|
172
|
+
readonly css: "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
173
|
+
readonly gsap: "expo.out";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export type EaseToken = keyof typeof ease;
|
|
177
|
+
export declare const zIndex: {
|
|
178
|
+
readonly base: 0;
|
|
179
|
+
readonly dropdown: 1000;
|
|
180
|
+
readonly sticky: 1100;
|
|
181
|
+
readonly overlay: 1200;
|
|
182
|
+
readonly modal: 1300;
|
|
183
|
+
readonly popover: 1400;
|
|
184
|
+
readonly toast: 1500;
|
|
185
|
+
readonly guide: 9999;
|
|
186
|
+
};
|
|
187
|
+
export declare const blur: {
|
|
188
|
+
readonly sm: "4px";
|
|
189
|
+
readonly md: "12px";
|
|
190
|
+
readonly lg: "24px";
|
|
191
|
+
};
|
|
192
|
+
export declare const container: {
|
|
193
|
+
readonly prose: "42rem";
|
|
194
|
+
readonly page: "72rem";
|
|
195
|
+
};
|
|
196
|
+
/** Interaction constants shared by every control. */
|
|
197
|
+
export declare const interaction: {
|
|
198
|
+
readonly 'target-min': "44px";
|
|
199
|
+
readonly 'focus-ring-width': "2px";
|
|
200
|
+
readonly 'focus-ring-offset': "2px";
|
|
201
|
+
readonly 'press-scale': "0.97";
|
|
202
|
+
readonly 'border-width': "1px";
|
|
203
|
+
/** Where floating content starts its entrance from; set per side by the component. */
|
|
204
|
+
readonly 'float-x': "0";
|
|
205
|
+
readonly 'float-y': "0";
|
|
206
|
+
/** A disclosure's measured size, written by CollapsibleContent so height can animate. */
|
|
207
|
+
readonly 'collapsible-height': "auto";
|
|
208
|
+
readonly 'collapsible-width': "auto";
|
|
209
|
+
};
|
|
210
|
+
export {};
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PaletteKey } from './palette';
|
|
2
|
+
/** Tier 2 — semantic roles. A theme is a complete remapping of these and nothing else. */
|
|
3
|
+
export declare const SEMANTIC_COLORS: readonly ["surface", "surface-raised", "surface-sunken", "surface-tonal", "surface-strong", "fg", "fg-muted", "fg-subtle", "fg-on-accent", "fg-on-strong", "line", "line-strong", "accent", "accent-hover", "accent-active", "accent-subtle", "accent-ink", "success-subtle", "success-ink", "warning-subtle", "warning-ink", "danger", "danger-subtle", "danger-ink", "focus-ring", "scrim", "surface-brand", "fg-on-brand"];
|
|
4
|
+
export type SemanticColor = (typeof SEMANTIC_COLORS)[number];
|
|
5
|
+
export type Theme = Readonly<Record<SemanticColor, PaletteKey>>;
|
|
6
|
+
export declare const THEMES: readonly ["light", "dark"];
|
|
7
|
+
export type ThemeName = (typeof THEMES)[number];
|
|
8
|
+
export declare const light: Theme;
|
|
9
|
+
export declare const dark: Theme;
|
|
10
|
+
export declare const themes: Readonly<Record<ThemeName, Theme>>;
|
|
11
|
+
/**
|
|
12
|
+
* Derived tokens are declared on every themed element rather than once on
|
|
13
|
+
* :root, so a `[data-theme]` subtree re-resolves them against its own roles.
|
|
14
|
+
*/
|
|
15
|
+
export declare const derived: {
|
|
16
|
+
readonly 'color-hover': "color-mix(in oklch, var(--doitrix-color-fg) 8%, transparent)";
|
|
17
|
+
readonly 'color-pressed': "color-mix(in oklch, var(--doitrix-color-fg) 12%, transparent)";
|
|
18
|
+
readonly 'color-disabled': "color-mix(in oklch, var(--doitrix-color-fg) 12%, transparent)";
|
|
19
|
+
readonly 'color-fg-disabled': "color-mix(in oklch, var(--doitrix-color-fg) 38%, transparent)";
|
|
20
|
+
readonly 'color-overlay': "color-mix(in oklch, var(--doitrix-color-scrim) 12%, transparent)";
|
|
21
|
+
readonly 'color-backdrop': "color-mix(in oklch, var(--doitrix-color-scrim) 48%, transparent)";
|
|
22
|
+
readonly 'color-shadow-key': "color-mix(in oklch, var(--doitrix-color-scrim) 30%, transparent)";
|
|
23
|
+
readonly 'color-shadow-ambient': "color-mix(in oklch, var(--doitrix-color-scrim) 15%, transparent)";
|
|
24
|
+
readonly 'shadow-sm': "0 1px 2px 0 var(--doitrix-color-shadow-key), 0 1px 3px 1px var(--doitrix-color-shadow-ambient)";
|
|
25
|
+
readonly 'shadow-md': "0 1px 2px 0 var(--doitrix-color-shadow-key), 0 2px 6px 2px var(--doitrix-color-shadow-ambient)";
|
|
26
|
+
readonly 'shadow-lg': "0 1px 3px 0 var(--doitrix-color-shadow-key), 0 4px 8px 3px var(--doitrix-color-shadow-ambient)";
|
|
27
|
+
readonly 'shadow-xl': "0 4px 4px 0 var(--doitrix-color-shadow-key), 0 8px 12px 6px var(--doitrix-color-shadow-ambient)";
|
|
28
|
+
readonly 'focus-ring': "var(--doitrix-focus-ring-width) solid var(--doitrix-color-focus-ring)";
|
|
29
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@doitrix/tokens",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Design tokens for the Doitrix design system — one source, emitted as CSS custom properties, a Tailwind v4 theme and typed TS constants.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Doitrix Tech Labs",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"design-tokens",
|
|
10
|
+
"design-system",
|
|
11
|
+
"css-variables",
|
|
12
|
+
"tailwindcss",
|
|
13
|
+
"theme",
|
|
14
|
+
"dark-mode"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/DOITRIX-TECH-LABS/ui_packages.git",
|
|
19
|
+
"directory": "packages/tokens"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/DOITRIX-TECH-LABS/ui_packages#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/DOITRIX-TECH-LABS/ui_packages/issues"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"css",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"module": "./dist/index.js",
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./tokens.css": "./css/tokens.css",
|
|
40
|
+
"./tailwind.css": "./css/tailwind.css",
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"sideEffects": [
|
|
44
|
+
"**/*.css"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"generate": "bun scripts/generate.ts",
|
|
48
|
+
"build": "bun run generate && vite build",
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18"
|
|
53
|
+
},
|
|
54
|
+
"browserslist": [
|
|
55
|
+
"last 2 Chrome versions",
|
|
56
|
+
"last 2 Edge versions",
|
|
57
|
+
"last 2 Firefox versions",
|
|
58
|
+
"last 2 Safari versions",
|
|
59
|
+
"iOS >= 16.4",
|
|
60
|
+
"not dead"
|
|
61
|
+
],
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
65
|
+
}
|