@thl-ui/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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 thl-ui contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,35 @@
1
- # Temporary Holding Version
1
+ # @thl-ui/tokens
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ thl-ui design tokens: skin colors, palette and breakpoints as TypeScript and CSS variables.
4
+
5
+ Part of [thl-ui](https://thl.tandd.dev): one UI kit for React, Vue and Angular with a headless TypeScript core, global config, 12 skins, dark mode and i18n (en, ja, vi, zh).
6
+
7
+ Design tokens shared by `@thl-ui/styles` and the framework adapters.
8
+
9
+ ```bash
10
+ npm i @thl-ui/tokens
11
+ ```
12
+
13
+ ```ts
14
+ import { skins, skinNames, palette, breakpoints } from '@thl-ui/tokens';
15
+ import '@thl-ui/tokens/tokens.css'; // the same values as --thl-* CSS variables
16
+ ```
17
+
18
+ ## Live demos
19
+
20
+ | Framework | Package | Live demo |
21
+ |---|---|---|
22
+ | React ≥ 18 | [`@thl-ui/react`](https://www.npmjs.com/package/@thl-ui/react) | [thl-react.tandd.dev](https://thl-react.tandd.dev) |
23
+ | Vue ≥ 3.5 | [`@thl-ui/vue`](https://www.npmjs.com/package/@thl-ui/vue) | [thl-vue.tandd.dev](https://thl-vue.tandd.dev) |
24
+ | Angular ≥ 20 | [`@thl-ui/angular`](https://www.npmjs.com/package/@thl-ui/angular) | [thl-angular.tandd.dev](https://thl-angular.tandd.dev) |
25
+
26
+ Each demo is the full 74-page admin template, built with the packages installed from npm. Open the ⚙ panel to switch skin, layout, dark mode and language.
27
+
28
+ ## Links
29
+
30
+ - Docs: [thl.tandd.dev/guide/theming](https://thl.tandd.dev/guide/theming) (English, 日本語, Tiếng Việt, 简体中文)
31
+ - Source and issues: [GitLab](https://gitlab.com/tandd.packages/thl-ui)
32
+
33
+ ## License
34
+
35
+ MIT
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @thl-ui/tokens — design tokens: palette, 12 skins and a full dark color mode.
3
+ */
4
+ export declare const palette: {
5
+ /** Primary blue, dark enough that white text meets WCAG AA (4.5:1). */
6
+ readonly primary: "#0277b9";
7
+ readonly success: "#2ecc71";
8
+ readonly info: "#00bbd9";
9
+ readonly warning: "#ffb136";
10
+ /** Danger red, dark enough for AA with white text. */
11
+ readonly danger: "#d6411d";
12
+ readonly default: "#dbe8eb";
13
+ readonly inverse: "#282f32";
14
+ readonly dark: "#2b2b2b";
15
+ readonly purple: "#4a23ad";
16
+ readonly red: "#d93c17";
17
+ readonly blue: "#0078bc";
18
+ readonly light: "#e5ebec";
19
+ readonly extralight: "#f7fafc";
20
+ readonly white: "#ffffff";
21
+ readonly muted: "#8d9498";
22
+ };
23
+ export type ThlColor = keyof typeof palette;
24
+ export declare const semanticColors: readonly ["default", "primary", "success", "info", "warning", "danger", "inverse", "purple", "dark", "red"];
25
+ export type ThlSemanticColor = (typeof semanticColors)[number];
26
+ export declare const onColors: Record<string, string>;
27
+ export declare const textColorsLight: Record<string, string>;
28
+ export declare const textColorsDark: Record<string, string>;
29
+ /** Light-mode base tokens. Keys become `--{prefix}-{key}` custom properties. */
30
+ export declare const lightTokens: Record<string, string>;
31
+ /** Dark color mode — overrides surface/text tokens (adminhub-style, but complete). */
32
+ export declare const darkTokens: Record<string, string>;
33
+ export interface SkinDef {
34
+ topbar1: string;
35
+ topbar2: string;
36
+ theme: string;
37
+ /** text on a theme fill (active tab/page, chips…) */
38
+ onTheme: string;
39
+ /** theme color used as text on light / dark surfaces */
40
+ textLight: string;
41
+ textDark: string;
42
+ }
43
+ /** The 6 base skins. Each also has a `-dark` sidebar variant. */
44
+ export declare const skins: {
45
+ default: {
46
+ topbar1: string;
47
+ topbar2: string;
48
+ theme: string;
49
+ onTheme: string;
50
+ textLight: string;
51
+ textDark: string;
52
+ };
53
+ green: {
54
+ topbar1: string;
55
+ topbar2: string;
56
+ theme: string;
57
+ onTheme: string;
58
+ textLight: string;
59
+ textDark: string;
60
+ };
61
+ yellow: {
62
+ topbar1: string;
63
+ topbar2: string;
64
+ theme: string;
65
+ onTheme: string;
66
+ textLight: string;
67
+ textDark: string;
68
+ };
69
+ red: {
70
+ topbar1: string;
71
+ topbar2: string;
72
+ theme: string;
73
+ onTheme: string;
74
+ textLight: string;
75
+ textDark: string;
76
+ };
77
+ purple: {
78
+ topbar1: string;
79
+ topbar2: string;
80
+ theme: string;
81
+ onTheme: string;
82
+ textLight: string;
83
+ textDark: string;
84
+ };
85
+ black: {
86
+ topbar1: string;
87
+ topbar2: string;
88
+ theme: string;
89
+ onTheme: string;
90
+ textLight: string;
91
+ textDark: string;
92
+ };
93
+ };
94
+ export type ThlSkinBase = keyof typeof skins;
95
+ export type ThlSkin = ThlSkinBase | `${ThlSkinBase}-dark`;
96
+ export declare const skinNames: ThlSkin[];
97
+ /** `-dark` skins: sidebar #4F5467 with light active text. */
98
+ export declare const darkSidebarTokens: Record<string, string>;
99
+ export declare const breakpoints: {
100
+ readonly xs: 480;
101
+ readonly sm: 768;
102
+ readonly md: 1024;
103
+ readonly lg: 1170;
104
+ readonly xl: 1367;
105
+ };
106
+ export declare function skinTokens(skin: ThlSkin): Record<string, string>;
107
+ /** Build the full tokens stylesheet (root tokens, 12 skins, dark color mode, auto mode). */
108
+ export declare function buildTokensCss(prefix?: string): string;
109
+ /** Helper: CSS var reference, e.g. cssVar('color-primary') → var(--thl-color-primary) */
110
+ export declare const cssVar: (name: string, prefix?: string) => string;
package/dist/index.js ADDED
@@ -0,0 +1,225 @@
1
+ /**
2
+ * @thl-ui/tokens — design tokens: palette, 12 skins and a full dark color mode.
3
+ */
4
+ export const palette = {
5
+ /** Primary blue, dark enough that white text meets WCAG AA (4.5:1). */
6
+ primary: '#0277b9',
7
+ success: '#2ecc71',
8
+ info: '#00bbd9',
9
+ warning: '#ffb136',
10
+ /** Danger red, dark enough for AA with white text. */
11
+ danger: '#d6411d',
12
+ default: '#dbe8eb',
13
+ inverse: '#282f32',
14
+ dark: '#2b2b2b',
15
+ purple: '#4a23ad',
16
+ red: '#d93c17',
17
+ blue: '#0078bc',
18
+ light: '#e5ebec',
19
+ extralight: '#f7fafc',
20
+ white: '#ffffff',
21
+ muted: '#8d9498',
22
+ };
23
+ export const semanticColors = ['default', 'primary', 'success', 'info', 'warning', 'danger', 'inverse', 'purple', 'dark', 'red'];
24
+ /**
25
+ * Accessible companions for every semantic color (WCAG 2.1 AA, ≥ 4.5:1):
26
+ * - `on-{c}` text/icon color drawn ON a `color-{c}` fill (buttons, badges, filled alerts…)
27
+ * - `color-{c}-text` the color used AS text on light surfaces (outline buttons, soft alerts, values…)
28
+ * Bright fills (success/info/warning/default) take dark text.
29
+ */
30
+ const DARK_INK = '#1d2326';
31
+ export const onColors = {
32
+ default: '#333b3f',
33
+ primary: '#ffffff',
34
+ success: DARK_INK,
35
+ info: DARK_INK,
36
+ warning: DARK_INK,
37
+ danger: '#ffffff',
38
+ inverse: '#ffffff',
39
+ dark: '#ffffff',
40
+ purple: '#ffffff',
41
+ red: '#ffffff',
42
+ muted: DARK_INK,
43
+ };
44
+ export const textColorsLight = {
45
+ default: '#4f5a5e',
46
+ primary: '#026aa7',
47
+ success: '#18713d',
48
+ info: '#0a6f82',
49
+ warning: '#8a5700',
50
+ danger: '#b5361a',
51
+ inverse: '#282f32',
52
+ dark: '#2b2b2b',
53
+ purple: '#4a23ad',
54
+ red: '#b5361a',
55
+ muted: '#6b7377',
56
+ };
57
+ export const textColorsDark = {
58
+ default: '#c3c9cd',
59
+ primary: '#45a4da',
60
+ success: '#2ecc71',
61
+ info: '#00bbd9',
62
+ warning: '#ffb136',
63
+ danger: '#ff7a5c',
64
+ inverse: '#c3c9cd',
65
+ dark: '#c3c9cd',
66
+ purple: '#a58cf0',
67
+ red: '#ff7a5c',
68
+ muted: '#a6adb4',
69
+ };
70
+ /** Light-mode base tokens. Keys become `--{prefix}-{key}` custom properties. */
71
+ export const lightTokens = {
72
+ // brand / semantic
73
+ ...Object.fromEntries(Object.entries(palette).map(([k, v]) => [`color-${k}`, v])),
74
+ ...Object.fromEntries(Object.entries(onColors).map(([k, v]) => [`on-${k}`, v])),
75
+ ...Object.fromEntries(Object.entries(textColorsLight).map(([k, v]) => [`color-${k}-text`, v])),
76
+ // surfaces & text
77
+ 'body-bg': '#f4f8f9',
78
+ surface: '#ffffff',
79
+ 'surface-muted': '#f7fafc',
80
+ 'border-color': '#e5ebec',
81
+ // Body text and link colors chosen to meet AA (≥ 4.5:1) on white.
82
+ text: '#6b7377',
83
+ 'text-strong': '#333b3f',
84
+ heading: '#333b3f',
85
+ link: '#026aa7',
86
+ // theme (overridden per skin)
87
+ theme: '#0277b9',
88
+ 'on-theme': '#ffffff',
89
+ 'theme-text': '#026aa7',
90
+ 'topbar-1': '#0078bc',
91
+ 'topbar-2': '#00beda',
92
+ 'topbar-text': '#ffffff',
93
+ 'topbar-border': 'rgba(255,255,255,0.2)',
94
+ 'sidebar-bg': '#ffffff',
95
+ 'sidebar-text': '#6b7377',
96
+ 'sidebar-active': '#333b3f',
97
+ 'sidebar-border': '#e5ebec',
98
+ // typography
99
+ 'font-family': "'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', sans-serif",
100
+ 'font-size': '14px',
101
+ 'font-size-sm': '12px',
102
+ 'font-size-lg': '16px',
103
+ 'line-height': '1.6',
104
+ h1: '36px',
105
+ h2: '24px',
106
+ h3: '21px',
107
+ h4: '18px',
108
+ h5: '16px',
109
+ h6: '14px',
110
+ // radius
111
+ 'radius-sm': '2px',
112
+ radius: '4px',
113
+ 'radius-lg': '8px',
114
+ 'radius-pill': '60px',
115
+ 'radius-circle': '50%',
116
+ // shadows
117
+ 'shadow-sm': '0 1px 2px rgba(0,0,0,0.1)',
118
+ shadow: '0 2px 6px rgba(0,0,0,0.05)',
119
+ 'shadow-lg': '0 10px 20px rgba(0,0,0,0.09)',
120
+ 'shadow-modal': '0 5px 15px rgba(0,0,0,0.1)',
121
+ // spacing
122
+ 'space-1': '4px',
123
+ 'space-2': '8px',
124
+ 'space-3': '12px',
125
+ 'space-4': '16px',
126
+ 'space-5': '20px',
127
+ 'space-6': '25px',
128
+ 'space-7': '30px',
129
+ // layout
130
+ 'topbar-height': '60px',
131
+ 'sidebar-width': '265px',
132
+ 'sidebar-mini-width': '60px',
133
+ 'right-sidebar-width': '240px',
134
+ 'container-padding': '30px',
135
+ // control sizes
136
+ 'control-height-sm': '30px',
137
+ 'control-height': '38px',
138
+ 'control-height-lg': '46px',
139
+ // motion
140
+ transition: '0.2s ease-in',
141
+ // z-index (base from config.zIndex)
142
+ 'z-dropdown': '1000',
143
+ 'z-sidebar': '1001',
144
+ 'z-overlay': '1040',
145
+ 'z-modal': '1050',
146
+ 'z-popover': '1060',
147
+ 'z-toast': '1080',
148
+ 'z-preloader': '99999',
149
+ };
150
+ /** Dark color mode — overrides surface/text tokens (adminhub-style, but complete). */
151
+ export const darkTokens = {
152
+ 'body-bg': '#14161c',
153
+ surface: '#1d2027',
154
+ 'surface-muted': '#252932',
155
+ 'border-color': '#323743',
156
+ text: '#a6adb4',
157
+ 'text-strong': '#e8ebee',
158
+ heading: '#f1f3f5',
159
+ link: '#6cbbe8',
160
+ 'color-default': '#3a404c',
161
+ 'on-default': '#e8ebee',
162
+ ...Object.fromEntries(Object.entries(textColorsDark).map(([k, v]) => [`color-${k}-text`, v])),
163
+ 'color-light': '#2c313b',
164
+ 'color-extralight': '#252932',
165
+ 'sidebar-bg': '#1a1d23',
166
+ 'sidebar-text': '#9aa1a9',
167
+ 'sidebar-active': '#ffffff',
168
+ 'sidebar-border': '#2a2e37',
169
+ 'shadow-sm': '0 1px 2px rgba(0,0,0,0.4)',
170
+ shadow: '0 2px 6px rgba(0,0,0,0.35)',
171
+ 'shadow-lg': '0 10px 20px rgba(0,0,0,0.45)',
172
+ 'shadow-modal': '0 5px 15px rgba(0,0,0,0.5)',
173
+ };
174
+ /** The 6 base skins. Each also has a `-dark` sidebar variant. */
175
+ export const skins = {
176
+ default: { topbar1: '#0078bc', topbar2: '#00beda', theme: '#0277b9', onTheme: '#ffffff', textLight: '#026aa7', textDark: '#45a4da' },
177
+ green: { topbar1: '#25bf67', topbar2: '#3fdd82', theme: '#2ecc71', onTheme: DARK_INK, textLight: '#18713d', textDark: '#2ecc71' },
178
+ yellow: { topbar1: '#f2a225', topbar2: '#ffbb51', theme: '#ffb136', onTheme: DARK_INK, textLight: '#8a5700', textDark: '#ffb136' },
179
+ red: { topbar1: '#d93c17', topbar2: '#ff704f', theme: '#d6411d', onTheme: '#ffffff', textLight: '#b5361a', textDark: '#ff7a5c' },
180
+ purple: { topbar1: '#4a23ad', topbar2: '#693fd5', theme: '#4a23ad', onTheme: '#ffffff', textLight: '#4a23ad', textDark: '#a58cf0' },
181
+ black: { topbar1: '#282f32', topbar2: '#4b555b', theme: '#282f32', onTheme: '#ffffff', textLight: '#282f32', textDark: '#c3c9cd' },
182
+ };
183
+ export const skinNames = Object.keys(skins).flatMap((s) => [s, `${s}-dark`]);
184
+ /** `-dark` skins: sidebar #4F5467 with light active text. */
185
+ export const darkSidebarTokens = {
186
+ 'sidebar-bg': '#4f5467',
187
+ 'sidebar-text': '#dcdfe5',
188
+ 'sidebar-active': '#ffffff',
189
+ 'sidebar-border': '#727685',
190
+ };
191
+ export const breakpoints = { xs: 480, sm: 768, md: 1024, lg: 1170, xl: 1367 };
192
+ const decl = (prefix, tokens, indent = ' ') => Object.entries(tokens)
193
+ .map(([k, v]) => `${indent}--${prefix}-${k}: ${v};`)
194
+ .join('\n');
195
+ export function skinTokens(skin) {
196
+ const base = skin.replace(/-dark$/, '');
197
+ const s = skins[base];
198
+ const t = { theme: s.theme, 'topbar-1': s.topbar1, 'topbar-2': s.topbar2, 'on-theme': s.onTheme, 'theme-text': s.textLight };
199
+ return skin.endsWith('-dark') ? { ...t, ...darkSidebarTokens } : t;
200
+ }
201
+ /** Build the full tokens stylesheet (root tokens, 12 skins, dark color mode, auto mode). */
202
+ export function buildTokensCss(prefix = 'thl') {
203
+ const out = [];
204
+ out.push(`/* @thl-ui/tokens — generated, do not edit */`);
205
+ out.push(`:root {\n${decl(prefix, lightTokens)}\n color-scheme: light;\n}`);
206
+ for (const skin of skinNames) {
207
+ out.push(`[data-${prefix}-theme="${skin}"] {\n${decl(prefix, skinTokens(skin))}\n}`);
208
+ }
209
+ out.push(`[data-${prefix}-color-mode="dark"] {\n${decl(prefix, darkTokens)}\n color-scheme: dark;\n}`);
210
+ out.push(`@media (prefers-color-scheme: dark) {\n [data-${prefix}-color-mode="auto"] {\n${decl(prefix, darkTokens, ' ')}\n color-scheme: dark;\n }\n}`);
211
+ // theme color as text needs a lighter tone on dark surfaces (per skin)
212
+ for (const [name, s] of Object.entries(skins)) {
213
+ const sel = `[data-${prefix}-theme^="${name}"]`;
214
+ out.push(`[data-${prefix}-color-mode="dark"]${sel} {\n --${prefix}-theme-text: ${s.textDark};\n}`);
215
+ out.push(`@media (prefers-color-scheme: dark) {\n [data-${prefix}-color-mode="auto"]${sel} {\n --${prefix}-theme-text: ${s.textDark};\n }\n}`);
216
+ }
217
+ // dark color mode keeps the -dark skin sidebar slightly lifted
218
+ out.push(`[data-${prefix}-color-mode="dark"][data-${prefix}-theme$="-dark"] {\n --${prefix}-sidebar-bg: #22262e;\n}`);
219
+ out.push(`[data-${prefix}-radius="sharp"] {\n --${prefix}-radius-sm: 0;\n --${prefix}-radius: 0;\n --${prefix}-radius-lg: 0;\n}`);
220
+ out.push(`[data-${prefix}-size="sm"] {\n --${prefix}-font-size: 13px;\n --${prefix}-control-height: 32px;\n}`);
221
+ out.push(`[data-${prefix}-size="lg"] {\n --${prefix}-font-size: 15px;\n --${prefix}-control-height: 44px;\n}`);
222
+ return out.join('\n\n') + '\n';
223
+ }
224
+ /** Helper: CSS var reference, e.g. cssVar('color-primary') → var(--thl-color-primary) */
225
+ export const cssVar = (name, prefix = 'thl') => `var(--${prefix}-${name})`;
@@ -0,0 +1,376 @@
1
+ /* @thl-ui/tokens — generated, do not edit */
2
+
3
+ :root {
4
+ --thl-color-primary: #0277b9;
5
+ --thl-color-success: #2ecc71;
6
+ --thl-color-info: #00bbd9;
7
+ --thl-color-warning: #ffb136;
8
+ --thl-color-danger: #d6411d;
9
+ --thl-color-default: #dbe8eb;
10
+ --thl-color-inverse: #282f32;
11
+ --thl-color-dark: #2b2b2b;
12
+ --thl-color-purple: #4a23ad;
13
+ --thl-color-red: #d93c17;
14
+ --thl-color-blue: #0078bc;
15
+ --thl-color-light: #e5ebec;
16
+ --thl-color-extralight: #f7fafc;
17
+ --thl-color-white: #ffffff;
18
+ --thl-color-muted: #8d9498;
19
+ --thl-on-default: #333b3f;
20
+ --thl-on-primary: #ffffff;
21
+ --thl-on-success: #1d2326;
22
+ --thl-on-info: #1d2326;
23
+ --thl-on-warning: #1d2326;
24
+ --thl-on-danger: #ffffff;
25
+ --thl-on-inverse: #ffffff;
26
+ --thl-on-dark: #ffffff;
27
+ --thl-on-purple: #ffffff;
28
+ --thl-on-red: #ffffff;
29
+ --thl-on-muted: #1d2326;
30
+ --thl-color-default-text: #4f5a5e;
31
+ --thl-color-primary-text: #026aa7;
32
+ --thl-color-success-text: #18713d;
33
+ --thl-color-info-text: #0a6f82;
34
+ --thl-color-warning-text: #8a5700;
35
+ --thl-color-danger-text: #b5361a;
36
+ --thl-color-inverse-text: #282f32;
37
+ --thl-color-dark-text: #2b2b2b;
38
+ --thl-color-purple-text: #4a23ad;
39
+ --thl-color-red-text: #b5361a;
40
+ --thl-color-muted-text: #6b7377;
41
+ --thl-body-bg: #f4f8f9;
42
+ --thl-surface: #ffffff;
43
+ --thl-surface-muted: #f7fafc;
44
+ --thl-border-color: #e5ebec;
45
+ --thl-text: #6b7377;
46
+ --thl-text-strong: #333b3f;
47
+ --thl-heading: #333b3f;
48
+ --thl-link: #026aa7;
49
+ --thl-theme: #0277b9;
50
+ --thl-on-theme: #ffffff;
51
+ --thl-theme-text: #026aa7;
52
+ --thl-topbar-1: #0078bc;
53
+ --thl-topbar-2: #00beda;
54
+ --thl-topbar-text: #ffffff;
55
+ --thl-topbar-border: rgba(255,255,255,0.2);
56
+ --thl-sidebar-bg: #ffffff;
57
+ --thl-sidebar-text: #6b7377;
58
+ --thl-sidebar-active: #333b3f;
59
+ --thl-sidebar-border: #e5ebec;
60
+ --thl-font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', sans-serif;
61
+ --thl-font-size: 14px;
62
+ --thl-font-size-sm: 12px;
63
+ --thl-font-size-lg: 16px;
64
+ --thl-line-height: 1.6;
65
+ --thl-h1: 36px;
66
+ --thl-h2: 24px;
67
+ --thl-h3: 21px;
68
+ --thl-h4: 18px;
69
+ --thl-h5: 16px;
70
+ --thl-h6: 14px;
71
+ --thl-radius-sm: 2px;
72
+ --thl-radius: 4px;
73
+ --thl-radius-lg: 8px;
74
+ --thl-radius-pill: 60px;
75
+ --thl-radius-circle: 50%;
76
+ --thl-shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
77
+ --thl-shadow: 0 2px 6px rgba(0,0,0,0.05);
78
+ --thl-shadow-lg: 0 10px 20px rgba(0,0,0,0.09);
79
+ --thl-shadow-modal: 0 5px 15px rgba(0,0,0,0.1);
80
+ --thl-space-1: 4px;
81
+ --thl-space-2: 8px;
82
+ --thl-space-3: 12px;
83
+ --thl-space-4: 16px;
84
+ --thl-space-5: 20px;
85
+ --thl-space-6: 25px;
86
+ --thl-space-7: 30px;
87
+ --thl-topbar-height: 60px;
88
+ --thl-sidebar-width: 265px;
89
+ --thl-sidebar-mini-width: 60px;
90
+ --thl-right-sidebar-width: 240px;
91
+ --thl-container-padding: 30px;
92
+ --thl-control-height-sm: 30px;
93
+ --thl-control-height: 38px;
94
+ --thl-control-height-lg: 46px;
95
+ --thl-transition: 0.2s ease-in;
96
+ --thl-z-dropdown: 1000;
97
+ --thl-z-sidebar: 1001;
98
+ --thl-z-overlay: 1040;
99
+ --thl-z-modal: 1050;
100
+ --thl-z-popover: 1060;
101
+ --thl-z-toast: 1080;
102
+ --thl-z-preloader: 99999;
103
+ color-scheme: light;
104
+ }
105
+
106
+ [data-thl-theme="default"] {
107
+ --thl-theme: #0277b9;
108
+ --thl-topbar-1: #0078bc;
109
+ --thl-topbar-2: #00beda;
110
+ --thl-on-theme: #ffffff;
111
+ --thl-theme-text: #026aa7;
112
+ }
113
+
114
+ [data-thl-theme="default-dark"] {
115
+ --thl-theme: #0277b9;
116
+ --thl-topbar-1: #0078bc;
117
+ --thl-topbar-2: #00beda;
118
+ --thl-on-theme: #ffffff;
119
+ --thl-theme-text: #026aa7;
120
+ --thl-sidebar-bg: #4f5467;
121
+ --thl-sidebar-text: #dcdfe5;
122
+ --thl-sidebar-active: #ffffff;
123
+ --thl-sidebar-border: #727685;
124
+ }
125
+
126
+ [data-thl-theme="green"] {
127
+ --thl-theme: #2ecc71;
128
+ --thl-topbar-1: #25bf67;
129
+ --thl-topbar-2: #3fdd82;
130
+ --thl-on-theme: #1d2326;
131
+ --thl-theme-text: #18713d;
132
+ }
133
+
134
+ [data-thl-theme="green-dark"] {
135
+ --thl-theme: #2ecc71;
136
+ --thl-topbar-1: #25bf67;
137
+ --thl-topbar-2: #3fdd82;
138
+ --thl-on-theme: #1d2326;
139
+ --thl-theme-text: #18713d;
140
+ --thl-sidebar-bg: #4f5467;
141
+ --thl-sidebar-text: #dcdfe5;
142
+ --thl-sidebar-active: #ffffff;
143
+ --thl-sidebar-border: #727685;
144
+ }
145
+
146
+ [data-thl-theme="yellow"] {
147
+ --thl-theme: #ffb136;
148
+ --thl-topbar-1: #f2a225;
149
+ --thl-topbar-2: #ffbb51;
150
+ --thl-on-theme: #1d2326;
151
+ --thl-theme-text: #8a5700;
152
+ }
153
+
154
+ [data-thl-theme="yellow-dark"] {
155
+ --thl-theme: #ffb136;
156
+ --thl-topbar-1: #f2a225;
157
+ --thl-topbar-2: #ffbb51;
158
+ --thl-on-theme: #1d2326;
159
+ --thl-theme-text: #8a5700;
160
+ --thl-sidebar-bg: #4f5467;
161
+ --thl-sidebar-text: #dcdfe5;
162
+ --thl-sidebar-active: #ffffff;
163
+ --thl-sidebar-border: #727685;
164
+ }
165
+
166
+ [data-thl-theme="red"] {
167
+ --thl-theme: #d6411d;
168
+ --thl-topbar-1: #d93c17;
169
+ --thl-topbar-2: #ff704f;
170
+ --thl-on-theme: #ffffff;
171
+ --thl-theme-text: #b5361a;
172
+ }
173
+
174
+ [data-thl-theme="red-dark"] {
175
+ --thl-theme: #d6411d;
176
+ --thl-topbar-1: #d93c17;
177
+ --thl-topbar-2: #ff704f;
178
+ --thl-on-theme: #ffffff;
179
+ --thl-theme-text: #b5361a;
180
+ --thl-sidebar-bg: #4f5467;
181
+ --thl-sidebar-text: #dcdfe5;
182
+ --thl-sidebar-active: #ffffff;
183
+ --thl-sidebar-border: #727685;
184
+ }
185
+
186
+ [data-thl-theme="purple"] {
187
+ --thl-theme: #4a23ad;
188
+ --thl-topbar-1: #4a23ad;
189
+ --thl-topbar-2: #693fd5;
190
+ --thl-on-theme: #ffffff;
191
+ --thl-theme-text: #4a23ad;
192
+ }
193
+
194
+ [data-thl-theme="purple-dark"] {
195
+ --thl-theme: #4a23ad;
196
+ --thl-topbar-1: #4a23ad;
197
+ --thl-topbar-2: #693fd5;
198
+ --thl-on-theme: #ffffff;
199
+ --thl-theme-text: #4a23ad;
200
+ --thl-sidebar-bg: #4f5467;
201
+ --thl-sidebar-text: #dcdfe5;
202
+ --thl-sidebar-active: #ffffff;
203
+ --thl-sidebar-border: #727685;
204
+ }
205
+
206
+ [data-thl-theme="black"] {
207
+ --thl-theme: #282f32;
208
+ --thl-topbar-1: #282f32;
209
+ --thl-topbar-2: #4b555b;
210
+ --thl-on-theme: #ffffff;
211
+ --thl-theme-text: #282f32;
212
+ }
213
+
214
+ [data-thl-theme="black-dark"] {
215
+ --thl-theme: #282f32;
216
+ --thl-topbar-1: #282f32;
217
+ --thl-topbar-2: #4b555b;
218
+ --thl-on-theme: #ffffff;
219
+ --thl-theme-text: #282f32;
220
+ --thl-sidebar-bg: #4f5467;
221
+ --thl-sidebar-text: #dcdfe5;
222
+ --thl-sidebar-active: #ffffff;
223
+ --thl-sidebar-border: #727685;
224
+ }
225
+
226
+ [data-thl-color-mode="dark"] {
227
+ --thl-body-bg: #14161c;
228
+ --thl-surface: #1d2027;
229
+ --thl-surface-muted: #252932;
230
+ --thl-border-color: #323743;
231
+ --thl-text: #a6adb4;
232
+ --thl-text-strong: #e8ebee;
233
+ --thl-heading: #f1f3f5;
234
+ --thl-link: #6cbbe8;
235
+ --thl-color-default: #3a404c;
236
+ --thl-on-default: #e8ebee;
237
+ --thl-color-default-text: #c3c9cd;
238
+ --thl-color-primary-text: #45a4da;
239
+ --thl-color-success-text: #2ecc71;
240
+ --thl-color-info-text: #00bbd9;
241
+ --thl-color-warning-text: #ffb136;
242
+ --thl-color-danger-text: #ff7a5c;
243
+ --thl-color-inverse-text: #c3c9cd;
244
+ --thl-color-dark-text: #c3c9cd;
245
+ --thl-color-purple-text: #a58cf0;
246
+ --thl-color-red-text: #ff7a5c;
247
+ --thl-color-muted-text: #a6adb4;
248
+ --thl-color-light: #2c313b;
249
+ --thl-color-extralight: #252932;
250
+ --thl-sidebar-bg: #1a1d23;
251
+ --thl-sidebar-text: #9aa1a9;
252
+ --thl-sidebar-active: #ffffff;
253
+ --thl-sidebar-border: #2a2e37;
254
+ --thl-shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
255
+ --thl-shadow: 0 2px 6px rgba(0,0,0,0.35);
256
+ --thl-shadow-lg: 0 10px 20px rgba(0,0,0,0.45);
257
+ --thl-shadow-modal: 0 5px 15px rgba(0,0,0,0.5);
258
+ color-scheme: dark;
259
+ }
260
+
261
+ @media (prefers-color-scheme: dark) {
262
+ [data-thl-color-mode="auto"] {
263
+ --thl-body-bg: #14161c;
264
+ --thl-surface: #1d2027;
265
+ --thl-surface-muted: #252932;
266
+ --thl-border-color: #323743;
267
+ --thl-text: #a6adb4;
268
+ --thl-text-strong: #e8ebee;
269
+ --thl-heading: #f1f3f5;
270
+ --thl-link: #6cbbe8;
271
+ --thl-color-default: #3a404c;
272
+ --thl-on-default: #e8ebee;
273
+ --thl-color-default-text: #c3c9cd;
274
+ --thl-color-primary-text: #45a4da;
275
+ --thl-color-success-text: #2ecc71;
276
+ --thl-color-info-text: #00bbd9;
277
+ --thl-color-warning-text: #ffb136;
278
+ --thl-color-danger-text: #ff7a5c;
279
+ --thl-color-inverse-text: #c3c9cd;
280
+ --thl-color-dark-text: #c3c9cd;
281
+ --thl-color-purple-text: #a58cf0;
282
+ --thl-color-red-text: #ff7a5c;
283
+ --thl-color-muted-text: #a6adb4;
284
+ --thl-color-light: #2c313b;
285
+ --thl-color-extralight: #252932;
286
+ --thl-sidebar-bg: #1a1d23;
287
+ --thl-sidebar-text: #9aa1a9;
288
+ --thl-sidebar-active: #ffffff;
289
+ --thl-sidebar-border: #2a2e37;
290
+ --thl-shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
291
+ --thl-shadow: 0 2px 6px rgba(0,0,0,0.35);
292
+ --thl-shadow-lg: 0 10px 20px rgba(0,0,0,0.45);
293
+ --thl-shadow-modal: 0 5px 15px rgba(0,0,0,0.5);
294
+ color-scheme: dark;
295
+ }
296
+ }
297
+
298
+ [data-thl-color-mode="dark"][data-thl-theme^="default"] {
299
+ --thl-theme-text: #45a4da;
300
+ }
301
+
302
+ @media (prefers-color-scheme: dark) {
303
+ [data-thl-color-mode="auto"][data-thl-theme^="default"] {
304
+ --thl-theme-text: #45a4da;
305
+ }
306
+ }
307
+
308
+ [data-thl-color-mode="dark"][data-thl-theme^="green"] {
309
+ --thl-theme-text: #2ecc71;
310
+ }
311
+
312
+ @media (prefers-color-scheme: dark) {
313
+ [data-thl-color-mode="auto"][data-thl-theme^="green"] {
314
+ --thl-theme-text: #2ecc71;
315
+ }
316
+ }
317
+
318
+ [data-thl-color-mode="dark"][data-thl-theme^="yellow"] {
319
+ --thl-theme-text: #ffb136;
320
+ }
321
+
322
+ @media (prefers-color-scheme: dark) {
323
+ [data-thl-color-mode="auto"][data-thl-theme^="yellow"] {
324
+ --thl-theme-text: #ffb136;
325
+ }
326
+ }
327
+
328
+ [data-thl-color-mode="dark"][data-thl-theme^="red"] {
329
+ --thl-theme-text: #ff7a5c;
330
+ }
331
+
332
+ @media (prefers-color-scheme: dark) {
333
+ [data-thl-color-mode="auto"][data-thl-theme^="red"] {
334
+ --thl-theme-text: #ff7a5c;
335
+ }
336
+ }
337
+
338
+ [data-thl-color-mode="dark"][data-thl-theme^="purple"] {
339
+ --thl-theme-text: #a58cf0;
340
+ }
341
+
342
+ @media (prefers-color-scheme: dark) {
343
+ [data-thl-color-mode="auto"][data-thl-theme^="purple"] {
344
+ --thl-theme-text: #a58cf0;
345
+ }
346
+ }
347
+
348
+ [data-thl-color-mode="dark"][data-thl-theme^="black"] {
349
+ --thl-theme-text: #c3c9cd;
350
+ }
351
+
352
+ @media (prefers-color-scheme: dark) {
353
+ [data-thl-color-mode="auto"][data-thl-theme^="black"] {
354
+ --thl-theme-text: #c3c9cd;
355
+ }
356
+ }
357
+
358
+ [data-thl-color-mode="dark"][data-thl-theme$="-dark"] {
359
+ --thl-sidebar-bg: #22262e;
360
+ }
361
+
362
+ [data-thl-radius="sharp"] {
363
+ --thl-radius-sm: 0;
364
+ --thl-radius: 0;
365
+ --thl-radius-lg: 0;
366
+ }
367
+
368
+ [data-thl-size="sm"] {
369
+ --thl-font-size: 13px;
370
+ --thl-control-height: 32px;
371
+ }
372
+
373
+ [data-thl-size="lg"] {
374
+ --thl-font-size: 15px;
375
+ --thl-control-height: 44px;
376
+ }
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@thl-ui/tokens",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "thl-ui design tokens: skin colors, palette and breakpoints as TypeScript and CSS variables.",
5
+ "keywords": [
6
+ "thl-ui",
7
+ "ui",
8
+ "components",
9
+ "admin",
10
+ "dashboard",
11
+ "design-tokens",
12
+ "theme"
13
+ ],
14
+ "license": "MIT",
15
+ "homepage": "https://thl.tandd.dev/guide/theming",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://gitlab.com/tandd.packages/thl-ui.git",
19
+ "directory": "packages/tokens"
20
+ },
21
+ "bugs": {
22
+ "url": "https://gitlab.com/tandd.packages/thl-ui/-/issues"
23
+ },
24
+ "type": "module",
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ },
32
+ "./tokens.css": "./dist/tokens.css"
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "sideEffects": [
38
+ "*.css"
39
+ ],
40
+ "scripts": {
41
+ "build": "tsc -p tsconfig.json && node ./scripts/build-css.mjs",
42
+ "typecheck": "tsc -p tsconfig.json --noEmit"
43
+ }
44
+ }