@tirox-ui/preset 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/README.md +19 -0
- package/dist/conformance.d.ts +26 -0
- package/dist/conformance.js +21 -0
- package/dist/contrast.d.ts +15 -0
- package/dist/contrast.js +29 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +6 -0
- package/dist/panda.d.ts +7 -0
- package/dist/panda.js +46 -0
- package/dist/recipes.d.ts +299 -0
- package/dist/recipes.js +158 -0
- package/dist/theme.d.ts +14 -0
- package/dist/theme.js +28 -0
- package/dist/tokens.d.ts +118 -0
- package/dist/tokens.js +78 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @tirox-ui/preset
|
|
2
|
+
|
|
3
|
+
Framework-neutral Panda CSS inputs for Tirox UI.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createThemeCssVariables, slotRecipes } from '@tirox-ui/preset';
|
|
7
|
+
|
|
8
|
+
const themeCss = createThemeCssVariables();
|
|
9
|
+
const buttonRecipe = slotRecipes.button;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The preset is the single source of truth for primitive and semantic tokens,
|
|
13
|
+
themes, slot recipes, contrast validation, and preset conformance. It uses
|
|
14
|
+
Radix-inspired 12-step scales by default but custom presets may use another
|
|
15
|
+
scale after mapping to the shared semantic contract.
|
|
16
|
+
|
|
17
|
+
Consumers own the final Panda configuration, static extraction, and CSS
|
|
18
|
+
generation. Solid and future framework adapters consume this package without
|
|
19
|
+
owning renderer-specific styling.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const presetConformance: {
|
|
2
|
+
readonly requiredTokenGroups: readonly ['colors', 'spacing', 'radii', 'shadows', 'motion', 'layers'];
|
|
3
|
+
readonly requiredSemanticGroups: readonly ['text', 'surface', 'border', 'action', 'focus'];
|
|
4
|
+
readonly requiredRecipes: readonly ['button', 'input', 'checkbox', 'select', 'dialog', 'tooltip'];
|
|
5
|
+
};
|
|
6
|
+
export interface TiroxPresetShape {
|
|
7
|
+
primitiveTokens: {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
semanticTokens: {
|
|
11
|
+
colors: {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
slotRecipes: {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface PresetConformanceResult {
|
|
20
|
+
passes: boolean;
|
|
21
|
+
missingTokenGroups: string[];
|
|
22
|
+
missingSemanticGroups: string[];
|
|
23
|
+
missingRecipes: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function validatePresetConformance(preset?: TiroxPresetShape): PresetConformanceResult;
|
|
26
|
+
export declare function conformsToTiroxPreset(preset?: TiroxPresetShape): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { primitiveTokens, semanticTokens } from './tokens';
|
|
2
|
+
import { slotRecipes } from './recipes';
|
|
3
|
+
export const presetConformance = {
|
|
4
|
+
requiredTokenGroups: ['colors', 'spacing', 'radii', 'shadows', 'motion', 'layers'],
|
|
5
|
+
requiredSemanticGroups: ['text', 'surface', 'border', 'action', 'focus'],
|
|
6
|
+
requiredRecipes: ['button', 'input', 'checkbox', 'select', 'dialog', 'tooltip'],
|
|
7
|
+
};
|
|
8
|
+
export function validatePresetConformance(preset = { primitiveTokens, semanticTokens, slotRecipes }) {
|
|
9
|
+
const missingTokenGroups = presetConformance.requiredTokenGroups.filter((key) => !(key in preset.primitiveTokens));
|
|
10
|
+
const missingSemanticGroups = presetConformance.requiredSemanticGroups.filter((key) => !(key in preset.semanticTokens.colors));
|
|
11
|
+
const missingRecipes = presetConformance.requiredRecipes.filter((key) => !(key in preset.slotRecipes));
|
|
12
|
+
return {
|
|
13
|
+
passes: !missingTokenGroups.length && !missingSemanticGroups.length && !missingRecipes.length,
|
|
14
|
+
missingTokenGroups,
|
|
15
|
+
missingSemanticGroups,
|
|
16
|
+
missingRecipes,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function conformsToTiroxPreset(preset = { primitiveTokens, semanticTokens, slotRecipes }) {
|
|
20
|
+
return validatePresetConformance(preset).passes;
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ContrastCheck {
|
|
2
|
+
name: string;
|
|
3
|
+
foreground: string;
|
|
4
|
+
background: string;
|
|
5
|
+
ratio: number;
|
|
6
|
+
passes: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ContrastInput {
|
|
9
|
+
name: string;
|
|
10
|
+
foreground: string;
|
|
11
|
+
background: string;
|
|
12
|
+
minimumRatio?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function contrastRatio(foreground: string, background: string): number;
|
|
15
|
+
export declare function validateSemanticContrast(checks?: readonly ContrastInput[]): ContrastCheck[];
|
package/dist/contrast.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const defaultContrastInputs = [
|
|
2
|
+
{ name: 'text-on-surface', foreground: '#1f2024', background: '#fcfcfd' },
|
|
3
|
+
{ name: 'inverse-on-action', foreground: '#fcfcfd', background: '#0d74ce' },
|
|
4
|
+
{ name: 'danger-on-surface', foreground: '#ce2c31', background: '#fcfcfd' },
|
|
5
|
+
];
|
|
6
|
+
function luminance(hex) {
|
|
7
|
+
const value = hex.replace('#', '');
|
|
8
|
+
if (!/^[0-9a-f]{6}$/i.test(value))
|
|
9
|
+
throw new Error(`Expected a six-digit hex color: ${hex}`);
|
|
10
|
+
const channels = [0, 2, 4].map((index) => Number.parseInt(value.slice(index, index + 2), 16) / 255);
|
|
11
|
+
const linear = channels.map((channel) => channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4);
|
|
12
|
+
return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2];
|
|
13
|
+
}
|
|
14
|
+
export function contrastRatio(foreground, background) {
|
|
15
|
+
const foregroundLuminance = luminance(foreground);
|
|
16
|
+
const backgroundLuminance = luminance(background);
|
|
17
|
+
const lighter = Math.max(foregroundLuminance, backgroundLuminance);
|
|
18
|
+
const darker = Math.min(foregroundLuminance, backgroundLuminance);
|
|
19
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
20
|
+
}
|
|
21
|
+
export function validateSemanticContrast(checks = defaultContrastInputs) {
|
|
22
|
+
return checks.map(({ name, foreground, background, minimumRatio = 4.5 }) => ({
|
|
23
|
+
name,
|
|
24
|
+
foreground,
|
|
25
|
+
background,
|
|
26
|
+
ratio: contrastRatio(foreground, background),
|
|
27
|
+
passes: contrastRatio(foreground, background) >= minimumRatio,
|
|
28
|
+
}));
|
|
29
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { primitiveTokens, semanticTokens, themes } from './tokens';
|
|
2
|
+
export { slotRecipes } from './recipes';
|
|
3
|
+
export type { ButtonSize, ButtonVariant } from './recipes';
|
|
4
|
+
export { defineTiroxPandaConfig, tiroxPandaConfig } from './panda';
|
|
5
|
+
export { conformsToTiroxPreset, presetConformance, validatePresetConformance } from './conformance';
|
|
6
|
+
export type { PresetConformanceResult, TiroxPresetShape } from './conformance';
|
|
7
|
+
export { contrastRatio, validateSemanticContrast } from './contrast';
|
|
8
|
+
export type { ContrastCheck, ContrastInput } from './contrast';
|
|
9
|
+
export { createThemeCssVariables, defaultThemeVariables, resolveSystemTheme, resolveTheme, } from './theme';
|
|
10
|
+
export type { ResolvedTheme, ThemeMode, ThemeVariables } from './theme';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { primitiveTokens, semanticTokens, themes } from './tokens';
|
|
2
|
+
export { slotRecipes } from './recipes';
|
|
3
|
+
export { defineTiroxPandaConfig, tiroxPandaConfig } from './panda';
|
|
4
|
+
export { conformsToTiroxPreset, presetConformance, validatePresetConformance } from './conformance';
|
|
5
|
+
export { contrastRatio, validateSemanticContrast } from './contrast';
|
|
6
|
+
export { createThemeCssVariables, defaultThemeVariables, resolveSystemTheme, resolveTheme, } from './theme';
|
package/dist/panda.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { defineConfig } from '@pandacss/dev';
|
|
2
|
+
export declare const tiroxPandaConfig: import("@pandacss/dev").Config & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const defineTiroxPandaConfig: (config?: Parameters<typeof defineConfig>[0]) => import("@pandacss/dev").Config & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
package/dist/panda.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineConfig } from '@pandacss/dev';
|
|
2
|
+
import { primitiveTokens, semanticTokens } from './tokens';
|
|
3
|
+
import { slotRecipes } from './recipes';
|
|
4
|
+
export const tiroxPandaConfig = defineConfig({
|
|
5
|
+
theme: {
|
|
6
|
+
tokens: {
|
|
7
|
+
colors: Object.fromEntries(Object.entries(primitiveTokens.colors).map(([scale, values]) => [
|
|
8
|
+
scale,
|
|
9
|
+
Object.fromEntries(Object.entries(values).map(([step, value]) => [step, { value }])),
|
|
10
|
+
])),
|
|
11
|
+
spacing: Object.fromEntries(Object.entries(primitiveTokens.spacing).map(([key, value]) => [key, { value }])),
|
|
12
|
+
radii: Object.fromEntries(Object.entries(primitiveTokens.radii).map(([key, value]) => [key, { value }])),
|
|
13
|
+
shadows: Object.fromEntries(Object.entries(primitiveTokens.shadows).map(([key, value]) => [key, { value }])),
|
|
14
|
+
durations: Object.fromEntries(Object.entries(primitiveTokens.motion).map(([key, value]) => [key, { value }])),
|
|
15
|
+
zIndex: Object.fromEntries(Object.entries(primitiveTokens.layers).map(([key, value]) => [key, { value }])),
|
|
16
|
+
},
|
|
17
|
+
semanticTokens: {
|
|
18
|
+
colors: Object.fromEntries(Object.entries(semanticTokens.colors).map(([group, values]) => [
|
|
19
|
+
group,
|
|
20
|
+
Object.fromEntries(Object.entries(values).map(([key, value]) => [key, { value }])),
|
|
21
|
+
])),
|
|
22
|
+
shadows: Object.fromEntries(Object.entries(semanticTokens.shadows).map(([key, value]) => [key, { value }])),
|
|
23
|
+
},
|
|
24
|
+
slotRecipes: Object.fromEntries(Object.entries(slotRecipes).map(([name, recipe]) => [
|
|
25
|
+
name,
|
|
26
|
+
{ className: `tx-${name}`, ...recipe },
|
|
27
|
+
])),
|
|
28
|
+
},
|
|
29
|
+
conditions: { reducedMotion: '@media (prefers-reduced-motion: reduce)' },
|
|
30
|
+
globalCss: {
|
|
31
|
+
':root': { color: '{colors.text.default}', background: '{colors.surface.default}' },
|
|
32
|
+
'[data-theme="dark"]': {
|
|
33
|
+
color: '{colors.gray.1}',
|
|
34
|
+
background: '{colors.gray.12}',
|
|
35
|
+
},
|
|
36
|
+
'.dark': {
|
|
37
|
+
color: '{colors.gray.1}',
|
|
38
|
+
background: '{colors.gray.12}',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export const defineTiroxPandaConfig = (config = {}) => defineConfig({
|
|
43
|
+
...tiroxPandaConfig,
|
|
44
|
+
...config,
|
|
45
|
+
theme: { ...tiroxPandaConfig.theme, ...config.theme },
|
|
46
|
+
});
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
export declare const slotRecipes: {
|
|
2
|
+
readonly button: {
|
|
3
|
+
readonly slots: readonly ['root', 'icon'];
|
|
4
|
+
readonly base: {
|
|
5
|
+
readonly root: {
|
|
6
|
+
readonly alignItems: 'center';
|
|
7
|
+
readonly display: 'inline-flex';
|
|
8
|
+
readonly justifyContent: 'center';
|
|
9
|
+
readonly borderRadius: 'md';
|
|
10
|
+
readonly fontWeight: '600';
|
|
11
|
+
readonly transition: 'background 180ms ease, color 180ms ease';
|
|
12
|
+
readonly _reducedMotion: {
|
|
13
|
+
readonly transition: 'none';
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly icon: {
|
|
17
|
+
readonly flexShrink: 0;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly variants: {
|
|
21
|
+
readonly variant: {
|
|
22
|
+
readonly solid: {
|
|
23
|
+
readonly root: {
|
|
24
|
+
readonly background: 'action.primary';
|
|
25
|
+
readonly color: 'text.inverse';
|
|
26
|
+
readonly _hover: {
|
|
27
|
+
readonly background: 'action.primaryHover';
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly outline: {
|
|
32
|
+
readonly root: {
|
|
33
|
+
readonly borderWidth: '1px';
|
|
34
|
+
readonly borderColor: 'border.default';
|
|
35
|
+
readonly color: 'text.default';
|
|
36
|
+
readonly _hover: {
|
|
37
|
+
readonly background: 'surface.subtle';
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly ghost: {
|
|
42
|
+
readonly root: {
|
|
43
|
+
readonly color: 'text.default';
|
|
44
|
+
readonly _hover: {
|
|
45
|
+
readonly background: 'surface.subtle';
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly size: {
|
|
51
|
+
readonly sm: {
|
|
52
|
+
readonly root: {
|
|
53
|
+
readonly minHeight: '2rem';
|
|
54
|
+
readonly paddingInline: '0.75rem';
|
|
55
|
+
readonly fontSize: '0.875rem';
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly md: {
|
|
59
|
+
readonly root: {
|
|
60
|
+
readonly minHeight: '2.5rem';
|
|
61
|
+
readonly paddingInline: '1rem';
|
|
62
|
+
readonly fontSize: '1rem';
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly lg: {
|
|
66
|
+
readonly root: {
|
|
67
|
+
readonly minHeight: '3rem';
|
|
68
|
+
readonly paddingInline: '1.25rem';
|
|
69
|
+
readonly fontSize: '1.125rem';
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly defaultVariants: {
|
|
75
|
+
readonly variant: 'solid';
|
|
76
|
+
readonly size: 'md';
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
readonly input: {
|
|
80
|
+
readonly slots: readonly ['root'];
|
|
81
|
+
readonly className: 'tx-input';
|
|
82
|
+
readonly base: {
|
|
83
|
+
readonly root: {
|
|
84
|
+
readonly appearance: 'none';
|
|
85
|
+
readonly borderWidth: '1px';
|
|
86
|
+
readonly borderColor: 'border.default';
|
|
87
|
+
readonly borderRadius: 'md';
|
|
88
|
+
readonly color: 'text.default';
|
|
89
|
+
readonly background: 'surface.default';
|
|
90
|
+
readonly minHeight: '2.5rem';
|
|
91
|
+
readonly paddingInline: '0.75rem';
|
|
92
|
+
readonly transition: 'border-color 180ms ease, box-shadow 180ms ease';
|
|
93
|
+
readonly _reducedMotion: {
|
|
94
|
+
readonly transition: 'none';
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
readonly variants: {
|
|
99
|
+
readonly invalid: {
|
|
100
|
+
readonly true: {
|
|
101
|
+
readonly root: {
|
|
102
|
+
readonly borderColor: 'action.danger';
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
readonly false: {
|
|
106
|
+
readonly root: {};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly defaultVariants: {
|
|
111
|
+
readonly invalid: 'false';
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
readonly checkbox: {
|
|
115
|
+
readonly slots: readonly ['root', 'control', 'indicator', 'label'];
|
|
116
|
+
readonly className: 'tx-checkbox';
|
|
117
|
+
readonly base: {
|
|
118
|
+
readonly root: {
|
|
119
|
+
readonly alignItems: 'center';
|
|
120
|
+
readonly display: 'inline-flex';
|
|
121
|
+
readonly gap: '0.5rem';
|
|
122
|
+
};
|
|
123
|
+
readonly control: {
|
|
124
|
+
readonly alignItems: 'center';
|
|
125
|
+
readonly borderWidth: '1px';
|
|
126
|
+
readonly borderColor: 'border.default';
|
|
127
|
+
readonly borderRadius: 'sm';
|
|
128
|
+
readonly display: 'inline-flex';
|
|
129
|
+
readonly height: '1.25rem';
|
|
130
|
+
readonly justifyContent: 'center';
|
|
131
|
+
readonly width: '1.25rem';
|
|
132
|
+
};
|
|
133
|
+
readonly indicator: {
|
|
134
|
+
readonly color: 'text.inverse';
|
|
135
|
+
readonly fontSize: '0.875rem';
|
|
136
|
+
};
|
|
137
|
+
readonly label: {
|
|
138
|
+
readonly color: 'text.default';
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
readonly variants: {
|
|
142
|
+
readonly disabled: {
|
|
143
|
+
readonly true: {
|
|
144
|
+
readonly root: {
|
|
145
|
+
readonly opacity: '0.5';
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly false: {
|
|
149
|
+
readonly root: {};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
readonly defaultVariants: {
|
|
154
|
+
readonly disabled: 'false';
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
readonly select: {
|
|
158
|
+
readonly slots: readonly ['root', 'trigger', 'content', 'item', 'value'];
|
|
159
|
+
readonly className: 'tx-select';
|
|
160
|
+
readonly base: {
|
|
161
|
+
readonly root: {
|
|
162
|
+
readonly appearance: 'none';
|
|
163
|
+
readonly background: 'surface.default';
|
|
164
|
+
readonly borderWidth: '1px';
|
|
165
|
+
readonly borderColor: 'border.default';
|
|
166
|
+
readonly borderRadius: 'md';
|
|
167
|
+
readonly color: 'text.default';
|
|
168
|
+
readonly minHeight: '2.5rem';
|
|
169
|
+
readonly paddingInline: '0.75rem';
|
|
170
|
+
};
|
|
171
|
+
readonly trigger: {
|
|
172
|
+
readonly width: '100%';
|
|
173
|
+
};
|
|
174
|
+
readonly content: {
|
|
175
|
+
readonly background: 'surface.elevated';
|
|
176
|
+
readonly color: 'text.default';
|
|
177
|
+
};
|
|
178
|
+
readonly item: {
|
|
179
|
+
readonly padding: '0.5rem';
|
|
180
|
+
};
|
|
181
|
+
readonly value: {
|
|
182
|
+
readonly color: 'text.default';
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
readonly variants: {
|
|
186
|
+
readonly invalid: {
|
|
187
|
+
readonly true: {
|
|
188
|
+
readonly root: {
|
|
189
|
+
readonly borderColor: 'action.danger';
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
readonly false: {
|
|
193
|
+
readonly root: {};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
readonly defaultVariants: {
|
|
198
|
+
readonly invalid: 'false';
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
readonly dialog: {
|
|
202
|
+
readonly slots: readonly ['root', 'content', 'title', 'description', 'close'];
|
|
203
|
+
readonly className: 'tx-dialog';
|
|
204
|
+
readonly base: {
|
|
205
|
+
readonly root: {
|
|
206
|
+
readonly borderWidth: '0';
|
|
207
|
+
readonly borderRadius: 'lg';
|
|
208
|
+
readonly background: 'surface.elevated';
|
|
209
|
+
readonly color: 'text.default';
|
|
210
|
+
readonly boxShadow: 'md';
|
|
211
|
+
readonly padding: '1.5rem';
|
|
212
|
+
readonly transition: 'opacity 180ms ease';
|
|
213
|
+
readonly _reducedMotion: {
|
|
214
|
+
readonly transition: 'none';
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
readonly content: {
|
|
218
|
+
readonly display: 'grid';
|
|
219
|
+
readonly gap: '1rem';
|
|
220
|
+
};
|
|
221
|
+
readonly title: {
|
|
222
|
+
readonly fontSize: '1.25rem';
|
|
223
|
+
readonly fontWeight: '600';
|
|
224
|
+
};
|
|
225
|
+
readonly description: {
|
|
226
|
+
readonly color: 'text.muted';
|
|
227
|
+
};
|
|
228
|
+
readonly close: {
|
|
229
|
+
readonly color: 'text.muted';
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
readonly variants: {
|
|
233
|
+
readonly state: {
|
|
234
|
+
readonly open: {
|
|
235
|
+
readonly root: {
|
|
236
|
+
readonly opacity: '1';
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly closed: {
|
|
240
|
+
readonly root: {
|
|
241
|
+
readonly opacity: '0';
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
readonly defaultVariants: {
|
|
247
|
+
readonly state: 'closed';
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly tooltip: {
|
|
251
|
+
readonly slots: readonly ['root', 'trigger', 'content', 'arrow'];
|
|
252
|
+
readonly className: 'tx-tooltip';
|
|
253
|
+
readonly base: {
|
|
254
|
+
readonly root: {
|
|
255
|
+
readonly display: 'inline-flex';
|
|
256
|
+
readonly position: 'relative';
|
|
257
|
+
};
|
|
258
|
+
readonly trigger: {
|
|
259
|
+
readonly display: 'inline-flex';
|
|
260
|
+
};
|
|
261
|
+
readonly content: {
|
|
262
|
+
readonly background: 'gray.12';
|
|
263
|
+
readonly borderRadius: 'sm';
|
|
264
|
+
readonly boxShadow: 'md';
|
|
265
|
+
readonly color: 'gray.1';
|
|
266
|
+
readonly padding: '0.5rem 0.75rem';
|
|
267
|
+
readonly fontSize: '0.875rem';
|
|
268
|
+
readonly transition: 'opacity 120ms ease';
|
|
269
|
+
readonly _reducedMotion: {
|
|
270
|
+
readonly transition: 'none';
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
readonly arrow: {
|
|
274
|
+
readonly background: 'gray.12';
|
|
275
|
+
readonly height: '0.5rem';
|
|
276
|
+
readonly width: '0.5rem';
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
readonly variants: {
|
|
280
|
+
readonly state: {
|
|
281
|
+
readonly open: {
|
|
282
|
+
readonly content: {
|
|
283
|
+
readonly opacity: '1';
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
readonly closed: {
|
|
287
|
+
readonly content: {
|
|
288
|
+
readonly opacity: '0';
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
readonly defaultVariants: {
|
|
294
|
+
readonly state: 'closed';
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
export type ButtonVariant = keyof typeof slotRecipes.button.variants.variant;
|
|
299
|
+
export type ButtonSize = keyof typeof slotRecipes.button.variants.size;
|
package/dist/recipes.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export const slotRecipes = {
|
|
2
|
+
button: {
|
|
3
|
+
slots: ['root', 'icon'],
|
|
4
|
+
base: {
|
|
5
|
+
root: {
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
display: 'inline-flex',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
borderRadius: 'md',
|
|
10
|
+
fontWeight: '600',
|
|
11
|
+
transition: 'background 180ms ease, color 180ms ease',
|
|
12
|
+
_reducedMotion: { transition: 'none' },
|
|
13
|
+
},
|
|
14
|
+
icon: { flexShrink: 0 },
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
solid: {
|
|
19
|
+
root: {
|
|
20
|
+
background: 'action.primary',
|
|
21
|
+
color: 'text.inverse',
|
|
22
|
+
_hover: { background: 'action.primaryHover' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
outline: {
|
|
26
|
+
root: {
|
|
27
|
+
borderWidth: '1px',
|
|
28
|
+
borderColor: 'border.default',
|
|
29
|
+
color: 'text.default',
|
|
30
|
+
_hover: { background: 'surface.subtle' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
ghost: { root: { color: 'text.default', _hover: { background: 'surface.subtle' } } },
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
sm: { root: { minHeight: '2rem', paddingInline: '0.75rem', fontSize: '0.875rem' } },
|
|
37
|
+
md: { root: { minHeight: '2.5rem', paddingInline: '1rem', fontSize: '1rem' } },
|
|
38
|
+
lg: { root: { minHeight: '3rem', paddingInline: '1.25rem', fontSize: '1.125rem' } },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: { variant: 'solid', size: 'md' },
|
|
42
|
+
},
|
|
43
|
+
input: {
|
|
44
|
+
slots: ['root'],
|
|
45
|
+
className: 'tx-input',
|
|
46
|
+
base: {
|
|
47
|
+
root: {
|
|
48
|
+
appearance: 'none',
|
|
49
|
+
borderWidth: '1px',
|
|
50
|
+
borderColor: 'border.default',
|
|
51
|
+
borderRadius: 'md',
|
|
52
|
+
color: 'text.default',
|
|
53
|
+
background: 'surface.default',
|
|
54
|
+
minHeight: '2.5rem',
|
|
55
|
+
paddingInline: '0.75rem',
|
|
56
|
+
transition: 'border-color 180ms ease, box-shadow 180ms ease',
|
|
57
|
+
_reducedMotion: { transition: 'none' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
variants: {
|
|
61
|
+
invalid: {
|
|
62
|
+
true: { root: { borderColor: 'action.danger' } },
|
|
63
|
+
false: { root: {} },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: { invalid: 'false' },
|
|
67
|
+
},
|
|
68
|
+
checkbox: {
|
|
69
|
+
slots: ['root', 'control', 'indicator', 'label'],
|
|
70
|
+
className: 'tx-checkbox',
|
|
71
|
+
base: {
|
|
72
|
+
root: { alignItems: 'center', display: 'inline-flex', gap: '0.5rem' },
|
|
73
|
+
control: {
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
borderWidth: '1px',
|
|
76
|
+
borderColor: 'border.default',
|
|
77
|
+
borderRadius: 'sm',
|
|
78
|
+
display: 'inline-flex',
|
|
79
|
+
height: '1.25rem',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
width: '1.25rem',
|
|
82
|
+
},
|
|
83
|
+
indicator: { color: 'text.inverse', fontSize: '0.875rem' },
|
|
84
|
+
label: { color: 'text.default' },
|
|
85
|
+
},
|
|
86
|
+
variants: { disabled: { true: { root: { opacity: '0.5' } }, false: { root: {} } } },
|
|
87
|
+
defaultVariants: { disabled: 'false' },
|
|
88
|
+
},
|
|
89
|
+
select: {
|
|
90
|
+
slots: ['root', 'trigger', 'content', 'item', 'value'],
|
|
91
|
+
className: 'tx-select',
|
|
92
|
+
base: {
|
|
93
|
+
root: {
|
|
94
|
+
appearance: 'none',
|
|
95
|
+
background: 'surface.default',
|
|
96
|
+
borderWidth: '1px',
|
|
97
|
+
borderColor: 'border.default',
|
|
98
|
+
borderRadius: 'md',
|
|
99
|
+
color: 'text.default',
|
|
100
|
+
minHeight: '2.5rem',
|
|
101
|
+
paddingInline: '0.75rem',
|
|
102
|
+
},
|
|
103
|
+
trigger: { width: '100%' },
|
|
104
|
+
content: { background: 'surface.elevated', color: 'text.default' },
|
|
105
|
+
item: { padding: '0.5rem' },
|
|
106
|
+
value: { color: 'text.default' },
|
|
107
|
+
},
|
|
108
|
+
variants: {
|
|
109
|
+
invalid: { true: { root: { borderColor: 'action.danger' } }, false: { root: {} } },
|
|
110
|
+
},
|
|
111
|
+
defaultVariants: { invalid: 'false' },
|
|
112
|
+
},
|
|
113
|
+
dialog: {
|
|
114
|
+
slots: ['root', 'content', 'title', 'description', 'close'],
|
|
115
|
+
className: 'tx-dialog',
|
|
116
|
+
base: {
|
|
117
|
+
root: {
|
|
118
|
+
borderWidth: '0',
|
|
119
|
+
borderRadius: 'lg',
|
|
120
|
+
background: 'surface.elevated',
|
|
121
|
+
color: 'text.default',
|
|
122
|
+
boxShadow: 'md',
|
|
123
|
+
padding: '1.5rem',
|
|
124
|
+
transition: 'opacity 180ms ease',
|
|
125
|
+
_reducedMotion: { transition: 'none' },
|
|
126
|
+
},
|
|
127
|
+
content: { display: 'grid', gap: '1rem' },
|
|
128
|
+
title: { fontSize: '1.25rem', fontWeight: '600' },
|
|
129
|
+
description: { color: 'text.muted' },
|
|
130
|
+
close: { color: 'text.muted' },
|
|
131
|
+
},
|
|
132
|
+
variants: { state: { open: { root: { opacity: '1' } }, closed: { root: { opacity: '0' } } } },
|
|
133
|
+
defaultVariants: { state: 'closed' },
|
|
134
|
+
},
|
|
135
|
+
tooltip: {
|
|
136
|
+
slots: ['root', 'trigger', 'content', 'arrow'],
|
|
137
|
+
className: 'tx-tooltip',
|
|
138
|
+
base: {
|
|
139
|
+
root: { display: 'inline-flex', position: 'relative' },
|
|
140
|
+
trigger: { display: 'inline-flex' },
|
|
141
|
+
content: {
|
|
142
|
+
background: 'gray.12',
|
|
143
|
+
borderRadius: 'sm',
|
|
144
|
+
boxShadow: 'md',
|
|
145
|
+
color: 'gray.1',
|
|
146
|
+
padding: '0.5rem 0.75rem',
|
|
147
|
+
fontSize: '0.875rem',
|
|
148
|
+
transition: 'opacity 120ms ease',
|
|
149
|
+
_reducedMotion: { transition: 'none' },
|
|
150
|
+
},
|
|
151
|
+
arrow: { background: 'gray.12', height: '0.5rem', width: '0.5rem' },
|
|
152
|
+
},
|
|
153
|
+
variants: {
|
|
154
|
+
state: { open: { content: { opacity: '1' } }, closed: { content: { opacity: '0' } } },
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: { state: 'closed' },
|
|
157
|
+
},
|
|
158
|
+
};
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ThemeMode = 'light' | 'dark' | 'system';
|
|
2
|
+
export type ResolvedTheme = 'light' | 'dark';
|
|
3
|
+
export type ThemeVariables = Readonly<Record<string, string>>;
|
|
4
|
+
export declare const defaultThemeVariables: Readonly<Record<ResolvedTheme, ThemeVariables>>;
|
|
5
|
+
/** Resolves a persisted theme without reading browser globals, so it is SSR-safe. */
|
|
6
|
+
export declare function resolveTheme(mode: ThemeMode, systemTheme?: ResolvedTheme): ResolvedTheme;
|
|
7
|
+
/** Reads system preference only when the caller provides a browser matchMedia implementation. */
|
|
8
|
+
export declare function resolveSystemTheme(matchMedia?: (query: string) => {
|
|
9
|
+
matches: boolean;
|
|
10
|
+
}): ResolvedTheme;
|
|
11
|
+
export declare function createThemeCssVariables(variables?: Readonly<Record<ResolvedTheme, ThemeVariables>>, options?: {
|
|
12
|
+
rootSelector?: string;
|
|
13
|
+
darkSelector?: string;
|
|
14
|
+
}): string;
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const defaultThemeVariables = {
|
|
2
|
+
light: {
|
|
3
|
+
'--tx-color-surface-default': '#fcfcfd',
|
|
4
|
+
'--tx-color-text-default': '#1f2024',
|
|
5
|
+
},
|
|
6
|
+
dark: {
|
|
7
|
+
'--tx-color-surface-default': '#1f2024',
|
|
8
|
+
'--tx-color-text-default': '#fcfcfd',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
/** Resolves a persisted theme without reading browser globals, so it is SSR-safe. */
|
|
12
|
+
export function resolveTheme(mode, systemTheme = 'light') {
|
|
13
|
+
if (mode === 'light' || mode === 'dark')
|
|
14
|
+
return mode;
|
|
15
|
+
return systemTheme;
|
|
16
|
+
}
|
|
17
|
+
/** Reads system preference only when the caller provides a browser matchMedia implementation. */
|
|
18
|
+
export function resolveSystemTheme(matchMedia) {
|
|
19
|
+
return matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
20
|
+
}
|
|
21
|
+
export function createThemeCssVariables(variables = defaultThemeVariables, options = {}) {
|
|
22
|
+
const rootSelector = options.rootSelector ?? ':root';
|
|
23
|
+
const darkSelector = options.darkSelector ?? '[data-theme="dark"]';
|
|
24
|
+
const render = (theme) => Object.entries(theme)
|
|
25
|
+
.map(([name, value]) => ` ${name}: ${value};`)
|
|
26
|
+
.join('\n');
|
|
27
|
+
return `${rootSelector} {\n${render(variables.light)}\n}\n\n${darkSelector} {\n${render(variables.dark)}\n}`;
|
|
28
|
+
}
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export declare const primitiveTokens: {
|
|
2
|
+
readonly colors: {
|
|
3
|
+
readonly gray: {
|
|
4
|
+
readonly 1: '#fcfcfd';
|
|
5
|
+
readonly 2: '#f9f9fb';
|
|
6
|
+
readonly 3: '#f0f0f3';
|
|
7
|
+
readonly 4: '#e8e8ec';
|
|
8
|
+
readonly 5: '#e0e1e6';
|
|
9
|
+
readonly 6: '#d9d9e0';
|
|
10
|
+
readonly 7: '#ceced8';
|
|
11
|
+
readonly 8: '#b9b9c8';
|
|
12
|
+
readonly 9: '#8b8d98';
|
|
13
|
+
readonly 10: '#80818b';
|
|
14
|
+
readonly 11: '#62636c';
|
|
15
|
+
readonly 12: '#1f2024';
|
|
16
|
+
};
|
|
17
|
+
readonly blue: {
|
|
18
|
+
readonly 1: '#fbfdff';
|
|
19
|
+
readonly 2: '#f4faff';
|
|
20
|
+
readonly 3: '#e6f4fe';
|
|
21
|
+
readonly 4: '#d5efff';
|
|
22
|
+
readonly 5: '#c2e5ff';
|
|
23
|
+
readonly 6: '#acd8fc';
|
|
24
|
+
readonly 7: '#91c8f6';
|
|
25
|
+
readonly 8: '#74b0ec';
|
|
26
|
+
readonly 9: '#0090ff';
|
|
27
|
+
readonly 10: '#0585e5';
|
|
28
|
+
readonly 11: '#0d74ce';
|
|
29
|
+
readonly 12: '#113264';
|
|
30
|
+
};
|
|
31
|
+
readonly red: {
|
|
32
|
+
readonly 1: '#fffcfc';
|
|
33
|
+
readonly 2: '#fff8f8';
|
|
34
|
+
readonly 3: '#ffebec';
|
|
35
|
+
readonly 4: '#ffdbdc';
|
|
36
|
+
readonly 5: '#ffcdce';
|
|
37
|
+
readonly 6: '#fdbdbe';
|
|
38
|
+
readonly 7: '#f5a9aa';
|
|
39
|
+
readonly 8: '#eb8e90';
|
|
40
|
+
readonly 9: '#e5484d';
|
|
41
|
+
readonly 10: '#dc3e42';
|
|
42
|
+
readonly 11: '#ce2c31';
|
|
43
|
+
readonly 12: '#641723';
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly spacing: {
|
|
47
|
+
readonly 1: '0.25rem';
|
|
48
|
+
readonly 2: '0.5rem';
|
|
49
|
+
readonly 3: '0.75rem';
|
|
50
|
+
readonly 4: '1rem';
|
|
51
|
+
readonly 5: '1.25rem';
|
|
52
|
+
readonly 6: '1.5rem';
|
|
53
|
+
readonly 8: '2rem';
|
|
54
|
+
readonly 10: '2.5rem';
|
|
55
|
+
};
|
|
56
|
+
readonly radii: {
|
|
57
|
+
readonly sm: '0.25rem';
|
|
58
|
+
readonly md: '0.5rem';
|
|
59
|
+
readonly lg: '0.75rem';
|
|
60
|
+
readonly full: '9999px';
|
|
61
|
+
};
|
|
62
|
+
readonly shadows: {
|
|
63
|
+
readonly sm: '0 1px 2px rgb(0 0 0 / 0.08)';
|
|
64
|
+
readonly md: '0 4px 12px rgb(0 0 0 / 0.12)';
|
|
65
|
+
};
|
|
66
|
+
readonly motion: {
|
|
67
|
+
readonly fast: '120ms';
|
|
68
|
+
readonly normal: '180ms';
|
|
69
|
+
readonly slow: '260ms';
|
|
70
|
+
readonly ease: 'cubic-bezier(0.2, 0, 0, 1)';
|
|
71
|
+
};
|
|
72
|
+
readonly layers: {
|
|
73
|
+
readonly base: 0;
|
|
74
|
+
readonly dropdown: 1000;
|
|
75
|
+
readonly dialog: 1100;
|
|
76
|
+
readonly toast: 1200;
|
|
77
|
+
readonly tooltip: 1300;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export declare const semanticTokens: {
|
|
81
|
+
readonly colors: {
|
|
82
|
+
readonly text: {
|
|
83
|
+
readonly default: '{colors.gray.12}';
|
|
84
|
+
readonly muted: '{colors.gray.11}';
|
|
85
|
+
readonly inverse: '{colors.gray.1}';
|
|
86
|
+
};
|
|
87
|
+
readonly surface: {
|
|
88
|
+
readonly default: '{colors.gray.1}';
|
|
89
|
+
readonly subtle: '{colors.gray.2}';
|
|
90
|
+
readonly elevated: '#ffffff';
|
|
91
|
+
};
|
|
92
|
+
readonly border: {
|
|
93
|
+
readonly default: '{colors.gray.6}';
|
|
94
|
+
readonly strong: '{colors.gray.8}';
|
|
95
|
+
};
|
|
96
|
+
readonly action: {
|
|
97
|
+
readonly primary: '{colors.blue.11}';
|
|
98
|
+
readonly primaryHover: '{colors.blue.12}';
|
|
99
|
+
readonly danger: '{colors.red.9}';
|
|
100
|
+
};
|
|
101
|
+
readonly focus: {
|
|
102
|
+
readonly ring: '{colors.blue.8}';
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
readonly shadows: {
|
|
106
|
+
readonly focus: '0 0 0 3px {colors.blue.5}';
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export declare const themes: {
|
|
110
|
+
readonly light: {
|
|
111
|
+
readonly surface: '{colors.gray.1}';
|
|
112
|
+
readonly text: '{colors.gray.12}';
|
|
113
|
+
};
|
|
114
|
+
readonly dark: {
|
|
115
|
+
readonly surface: '{colors.gray.12}';
|
|
116
|
+
readonly text: '{colors.gray.1}';
|
|
117
|
+
};
|
|
118
|
+
};
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const primitiveTokens = {
|
|
2
|
+
colors: {
|
|
3
|
+
gray: {
|
|
4
|
+
1: '#fcfcfd',
|
|
5
|
+
2: '#f9f9fb',
|
|
6
|
+
3: '#f0f0f3',
|
|
7
|
+
4: '#e8e8ec',
|
|
8
|
+
5: '#e0e1e6',
|
|
9
|
+
6: '#d9d9e0',
|
|
10
|
+
7: '#ceced8',
|
|
11
|
+
8: '#b9b9c8',
|
|
12
|
+
9: '#8b8d98',
|
|
13
|
+
10: '#80818b',
|
|
14
|
+
11: '#62636c',
|
|
15
|
+
12: '#1f2024',
|
|
16
|
+
},
|
|
17
|
+
blue: {
|
|
18
|
+
1: '#fbfdff',
|
|
19
|
+
2: '#f4faff',
|
|
20
|
+
3: '#e6f4fe',
|
|
21
|
+
4: '#d5efff',
|
|
22
|
+
5: '#c2e5ff',
|
|
23
|
+
6: '#acd8fc',
|
|
24
|
+
7: '#91c8f6',
|
|
25
|
+
8: '#74b0ec',
|
|
26
|
+
9: '#0090ff',
|
|
27
|
+
10: '#0585e5',
|
|
28
|
+
11: '#0d74ce',
|
|
29
|
+
12: '#113264',
|
|
30
|
+
},
|
|
31
|
+
red: {
|
|
32
|
+
1: '#fffcfc',
|
|
33
|
+
2: '#fff8f8',
|
|
34
|
+
3: '#ffebec',
|
|
35
|
+
4: '#ffdbdc',
|
|
36
|
+
5: '#ffcdce',
|
|
37
|
+
6: '#fdbdbe',
|
|
38
|
+
7: '#f5a9aa',
|
|
39
|
+
8: '#eb8e90',
|
|
40
|
+
9: '#e5484d',
|
|
41
|
+
10: '#dc3e42',
|
|
42
|
+
11: '#ce2c31',
|
|
43
|
+
12: '#641723',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
spacing: {
|
|
47
|
+
1: '0.25rem',
|
|
48
|
+
2: '0.5rem',
|
|
49
|
+
3: '0.75rem',
|
|
50
|
+
4: '1rem',
|
|
51
|
+
5: '1.25rem',
|
|
52
|
+
6: '1.5rem',
|
|
53
|
+
8: '2rem',
|
|
54
|
+
10: '2.5rem',
|
|
55
|
+
},
|
|
56
|
+
radii: { sm: '0.25rem', md: '0.5rem', lg: '0.75rem', full: '9999px' },
|
|
57
|
+
shadows: { sm: '0 1px 2px rgb(0 0 0 / 0.08)', md: '0 4px 12px rgb(0 0 0 / 0.12)' },
|
|
58
|
+
motion: { fast: '120ms', normal: '180ms', slow: '260ms', ease: 'cubic-bezier(0.2, 0, 0, 1)' },
|
|
59
|
+
layers: { base: 0, dropdown: 1000, dialog: 1100, toast: 1200, tooltip: 1300 },
|
|
60
|
+
};
|
|
61
|
+
export const semanticTokens = {
|
|
62
|
+
colors: {
|
|
63
|
+
text: { default: '{colors.gray.12}', muted: '{colors.gray.11}', inverse: '{colors.gray.1}' },
|
|
64
|
+
surface: { default: '{colors.gray.1}', subtle: '{colors.gray.2}', elevated: '#ffffff' },
|
|
65
|
+
border: { default: '{colors.gray.6}', strong: '{colors.gray.8}' },
|
|
66
|
+
action: {
|
|
67
|
+
primary: '{colors.blue.11}',
|
|
68
|
+
primaryHover: '{colors.blue.12}',
|
|
69
|
+
danger: '{colors.red.9}',
|
|
70
|
+
},
|
|
71
|
+
focus: { ring: '{colors.blue.8}' },
|
|
72
|
+
},
|
|
73
|
+
shadows: { focus: '0 0 0 3px {colors.blue.5}' },
|
|
74
|
+
};
|
|
75
|
+
export const themes = {
|
|
76
|
+
light: { surface: '{colors.gray.1}', text: '{colors.gray.12}' },
|
|
77
|
+
dark: { surface: '{colors.gray.12}', text: '{colors.gray.1}' },
|
|
78
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tirox-ui/preset",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/tanangular/tirox-ui.git"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./tokens": {
|
|
20
|
+
"types": "./dist/tokens.d.ts",
|
|
21
|
+
"import": "./dist/tokens.js"
|
|
22
|
+
},
|
|
23
|
+
"./recipes": {
|
|
24
|
+
"types": "./dist/recipes.d.ts",
|
|
25
|
+
"import": "./dist/recipes.js"
|
|
26
|
+
},
|
|
27
|
+
"./panda": {
|
|
28
|
+
"types": "./dist/panda.d.ts",
|
|
29
|
+
"import": "./dist/panda.js"
|
|
30
|
+
},
|
|
31
|
+
"./conformance": {
|
|
32
|
+
"types": "./dist/conformance.d.ts",
|
|
33
|
+
"import": "./dist/conformance.js"
|
|
34
|
+
},
|
|
35
|
+
"./contrast": {
|
|
36
|
+
"types": "./dist/contrast.d.ts",
|
|
37
|
+
"import": "./dist/contrast.js"
|
|
38
|
+
},
|
|
39
|
+
"./theme": {
|
|
40
|
+
"types": "./dist/theme.d.ts",
|
|
41
|
+
"import": "./dist/theme.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"provenance": true
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "node ../../scripts/clean-dist.mjs dist && tsc -p tsconfig.build.json",
|
|
50
|
+
"prepublishOnly": "pnpm build",
|
|
51
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
52
|
+
"test": "vitest run"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@pandacss/dev": "^1.12.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"vitest": "^4.1.11"
|
|
59
|
+
}
|
|
60
|
+
}
|