@phcdevworks/spectre-tokens 0.0.1

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.css ADDED
@@ -0,0 +1,226 @@
1
+ :root {
2
+ --sp-color-brand-50: #f5f0ff;
3
+ --sp-color-brand-100: #ebe2ff;
4
+ --sp-color-brand-200: #d7c6ff;
5
+ --sp-color-brand-300: #bfa1ff;
6
+ --sp-color-brand-400: #a37aff;
7
+ --sp-color-brand-500: #8652ff;
8
+ --sp-color-brand-600: #6c32e6;
9
+ --sp-color-brand-700: #5626b4;
10
+ --sp-color-brand-800: #3d1b7f;
11
+ --sp-color-brand-900: #241147;
12
+ --sp-color-neutral-50: #f8fafc;
13
+ --sp-color-neutral-100: #f1f5f9;
14
+ --sp-color-neutral-200: #e2e8f0;
15
+ --sp-color-neutral-300: #cbd5f5;
16
+ --sp-color-neutral-400: #94a3b8;
17
+ --sp-color-neutral-500: #64748b;
18
+ --sp-color-neutral-600: #475569;
19
+ --sp-color-neutral-700: #334155;
20
+ --sp-color-neutral-800: #1e293b;
21
+ --sp-color-neutral-900: #0f172a;
22
+ --sp-color-accent-50: #e5fff8;
23
+ --sp-color-accent-100: #b8ffed;
24
+ --sp-color-accent-200: #89ffe1;
25
+ --sp-color-accent-300: #59ffd6;
26
+ --sp-color-accent-400: #29ffca;
27
+ --sp-color-accent-500: #03e6b3;
28
+ --sp-color-accent-600: #00b389;
29
+ --sp-color-accent-700: #008060;
30
+ --sp-color-accent-800: #004d38;
31
+ --sp-color-accent-900: #002a20;
32
+ --sp-color-success-50: #f0fdf4;
33
+ --sp-color-success-100: #dcfce7;
34
+ --sp-color-success-200: #bbf7d0;
35
+ --sp-color-success-300: #86efac;
36
+ --sp-color-success-400: #4ade80;
37
+ --sp-color-success-500: #22c55e;
38
+ --sp-color-success-600: #16a34a;
39
+ --sp-color-success-700: #15803d;
40
+ --sp-color-success-800: #166534;
41
+ --sp-color-success-900: #14532d;
42
+ --sp-color-warning-50: #fffbeb;
43
+ --sp-color-warning-100: #fef3c7;
44
+ --sp-color-warning-200: #fde68a;
45
+ --sp-color-warning-300: #fcd34d;
46
+ --sp-color-warning-400: #fbbf24;
47
+ --sp-color-warning-500: #f59e0b;
48
+ --sp-color-warning-600: #d97706;
49
+ --sp-color-warning-700: #b45309;
50
+ --sp-color-warning-800: #92400e;
51
+ --sp-color-warning-900: #78350f;
52
+ --sp-color-error-50: #fef2f2;
53
+ --sp-color-error-100: #fee2e2;
54
+ --sp-color-error-200: #fecaca;
55
+ --sp-color-error-300: #fca5a5;
56
+ --sp-color-error-400: #f87171;
57
+ --sp-color-error-500: #ef4444;
58
+ --sp-color-error-600: #dc2626;
59
+ --sp-color-error-700: #b91c1c;
60
+ --sp-color-error-800: #991b1b;
61
+ --sp-color-error-900: #7f1d1d;
62
+ --sp-color-info-50: #eff6ff;
63
+ --sp-color-info-100: #dbeafe;
64
+ --sp-color-info-200: #bfdbfe;
65
+ --sp-color-info-300: #93c5fd;
66
+ --sp-color-info-400: #60a5fa;
67
+ --sp-color-info-500: #3b82f6;
68
+ --sp-color-info-600: #2563eb;
69
+ --sp-color-info-700: #1d4ed8;
70
+ --sp-color-info-800: #1e40af;
71
+ --sp-color-info-900: #1e3a8a;
72
+ --sp-color-focus-primary: #8652ff;
73
+ --sp-color-focus-error: #ef4444;
74
+ --sp-color-focus-info: #3b82f6;
75
+ --sp-space-none: 0rem;
76
+ --sp-space-3xs: 0.125rem;
77
+ --sp-space-2xs: 0.25rem;
78
+ --sp-space-xs: 0.5rem;
79
+ --sp-space-sm: 0.75rem;
80
+ --sp-space-md: 1rem;
81
+ --sp-space-lg: 1.5rem;
82
+ --sp-space-xl: 2rem;
83
+ --sp-space-2xl: 3rem;
84
+ --sp-space-3xl: 4rem;
85
+ --sp-radius-none: 0;
86
+ --sp-radius-sm: 2px;
87
+ --sp-radius-md: 4px;
88
+ --sp-radius-lg: 8px;
89
+ --sp-radius-pill: 999px;
90
+ --sp-font-family-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
91
+ --sp-font-family-serif: 'Spectre Serif', 'Georgia', serif;
92
+ --sp-font-family-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
93
+ --sp-font-xs-size: 0.75rem;
94
+ --sp-font-xs-line-height: 1.25rem;
95
+ --sp-font-xs-weight: 400;
96
+ --sp-font-xs-letter-spacing: 0.02em;
97
+ --sp-font-sm-size: 0.875rem;
98
+ --sp-font-sm-line-height: 1.5rem;
99
+ --sp-font-sm-weight: 400;
100
+ --sp-font-md-size: 1rem;
101
+ --sp-font-md-line-height: 1.75rem;
102
+ --sp-font-md-weight: 500;
103
+ --sp-font-lg-size: 1.25rem;
104
+ --sp-font-lg-line-height: 2rem;
105
+ --sp-font-lg-weight: 600;
106
+ --sp-font-xl-size: 1.5rem;
107
+ --sp-font-xl-line-height: 2.125rem;
108
+ --sp-font-xl-weight: 600;
109
+ --sp-font-2xl-size: 1.875rem;
110
+ --sp-font-2xl-line-height: 2.5rem;
111
+ --sp-font-2xl-weight: 700;
112
+ --sp-font-3xl-size: 2.25rem;
113
+ --sp-font-3xl-line-height: 2.75rem;
114
+ --sp-font-3xl-weight: 700;
115
+ --sp-shadow-none: none;
116
+ --sp-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.08);
117
+ --sp-shadow-md: 0 3px 8px -1px rgba(15, 23, 42, 0.1);
118
+ --sp-shadow-lg: 0 8px 20px -4px rgba(15, 23, 42, 0.18);
119
+ --sp-breakpoint-sm: 640px;
120
+ --sp-breakpoint-md: 768px;
121
+ --sp-breakpoint-lg: 1024px;
122
+ --sp-breakpoint-xl: 1280px;
123
+ --sp-breakpoint-2xl: 1536px;
124
+ --sp-z-index-base: 0;
125
+ --sp-z-index-dropdown: 1000;
126
+ --sp-z-index-sticky: 1100;
127
+ --sp-z-index-fixed: 1200;
128
+ --sp-z-index-overlay: 1300;
129
+ --sp-z-index-modal: 1400;
130
+ --sp-z-index-popover: 1500;
131
+ --sp-z-index-tooltip: 1600;
132
+ --sp-duration-instant: 75ms;
133
+ --sp-duration-fast: 150ms;
134
+ --sp-duration-base: 200ms;
135
+ --sp-duration-moderate: 300ms;
136
+ --sp-duration-slow: 500ms;
137
+ --sp-duration-slower: 700ms;
138
+ --sp-easing-linear: linear;
139
+ --sp-easing-in: cubic-bezier(0.4, 0, 1, 1);
140
+ --sp-easing-out: cubic-bezier(0, 0, 0.2, 1);
141
+ --sp-easing-inout: cubic-bezier(0.4, 0, 0.2, 1);
142
+ --sp-easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
143
+ --sp-opacity-disabled: 0.38;
144
+ --sp-opacity-hover: 0.92;
145
+ --sp-opacity-active: 0.84;
146
+ --sp-opacity-focus: 1;
147
+ --sp-opacity-overlay: 0.5;
148
+ --sp-opacity-tooltip: 0.95;
149
+ --sp-focus-ring-width: 2px;
150
+ --sp-focus-ring-offset: 2px;
151
+ --sp-focus-ring-style: solid;
152
+ --sp-min-touch-target: 44px;
153
+ --sp-min-text-size: 16px;
154
+ --sp-button-primary-bg: #8652ff;
155
+ --sp-button-primary-bghover: #6c32e6;
156
+ --sp-button-primary-bgactive: #5626b4;
157
+ --sp-button-primary-bgdisabled: #cbd5f5;
158
+ --sp-button-primary-text: #ffffff;
159
+ --sp-button-primary-textdisabled: #94a3b8;
160
+ --sp-button-secondary-bg: #ffffff;
161
+ --sp-button-secondary-bghover: #f1f5f9;
162
+ --sp-button-secondary-bgactive: #e2e8f0;
163
+ --sp-button-secondary-bgdisabled: #f8fafc;
164
+ --sp-button-secondary-text: #8652ff;
165
+ --sp-button-secondary-textdisabled: #94a3b8;
166
+ --sp-button-secondary-border: #8652ff;
167
+ --sp-button-secondary-borderdisabled: #cbd5f5;
168
+ --sp-button-ghost-bg: transparent;
169
+ --sp-button-ghost-bghover: #f5f0ff;
170
+ --sp-button-ghost-bgactive: #ebe2ff;
171
+ --sp-button-ghost-bgdisabled: transparent;
172
+ --sp-button-ghost-text: #8652ff;
173
+ --sp-button-ghost-textdisabled: #94a3b8;
174
+ --sp-button-danger-bg: #ef4444;
175
+ --sp-button-danger-bghover: #dc2626;
176
+ --sp-button-danger-bgactive: #b91c1c;
177
+ --sp-button-danger-bgdisabled: #fecaca;
178
+ --sp-button-danger-text: #ffffff;
179
+ --sp-button-danger-textdisabled: #94a3b8;
180
+ --sp-button-success-bg: #22c55e;
181
+ --sp-button-success-bghover: #16a34a;
182
+ --sp-button-success-bgactive: #15803d;
183
+ --sp-button-success-bgdisabled: #bbf7d0;
184
+ --sp-button-success-text: #ffffff;
185
+ --sp-button-success-textdisabled: #94a3b8;
186
+ --sp-form-default-bg: #ffffff;
187
+ --sp-form-default-border: #cbd5f5;
188
+ --sp-form-default-text: #0f172a;
189
+ --sp-form-default-placeholder: #94a3b8;
190
+ --sp-form-hover-border: #8652ff;
191
+ --sp-form-focus-border: #8652ff;
192
+ --sp-form-focus-ring: #8652ff;
193
+ --sp-form-valid-border: #22c55e;
194
+ --sp-form-valid-bg: #f0fdf4;
195
+ --sp-form-valid-text: #15803d;
196
+ --sp-form-invalid-border: #ef4444;
197
+ --sp-form-invalid-bg: #fef2f2;
198
+ --sp-form-invalid-text: #b91c1c;
199
+ --sp-form-disabled-bg: #f8fafc;
200
+ --sp-form-disabled-border: #e2e8f0;
201
+ --sp-form-disabled-text: #94a3b8;
202
+ --sp-animation-fadein-duration: 200ms;
203
+ --sp-animation-fadein-easing: cubic-bezier(0, 0, 0.2, 1);
204
+ --sp-animation-fadein-keyframes: fade-in;
205
+ --sp-animation-fadeout-duration: 150ms;
206
+ --sp-animation-fadeout-easing: cubic-bezier(0.4, 0, 1, 1);
207
+ --sp-animation-fadeout-keyframes: fade-out;
208
+ --sp-animation-slideup-duration: 300ms;
209
+ --sp-animation-slideup-easing: cubic-bezier(0, 0, 0.2, 1);
210
+ --sp-animation-slideup-keyframes: slide-up;
211
+ --sp-animation-slidedown-duration: 300ms;
212
+ --sp-animation-slidedown-easing: cubic-bezier(0, 0, 0.2, 1);
213
+ --sp-animation-slidedown-keyframes: slide-down;
214
+ --sp-animation-scalein-duration: 200ms;
215
+ --sp-animation-scalein-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
216
+ --sp-animation-scalein-keyframes: scale-in;
217
+ --sp-animation-bounce-duration: 500ms;
218
+ --sp-animation-bounce-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
219
+ --sp-animation-bounce-keyframes: bounce;
220
+ --sp-animation-shake-duration: 400ms;
221
+ --sp-animation-shake-easing: cubic-bezier(0.4, 0, 0.2, 1);
222
+ --sp-animation-shake-keyframes: shake;
223
+ --sp-animation-pulse-duration: 1500ms;
224
+ --sp-animation-pulse-easing: cubic-bezier(0.4, 0, 0.2, 1);
225
+ --sp-animation-pulse-keyframes: pulse;
226
+ }
@@ -0,0 +1,96 @@
1
+ type ColorScale = Record<string, string>;
2
+ type TokenScale = Record<string, string>;
3
+ interface TypographyScaleEntry {
4
+ fontSize: string;
5
+ lineHeight: string;
6
+ fontWeight?: number;
7
+ letterSpacing?: string;
8
+ }
9
+ interface TypographyTokens {
10
+ families: Record<string, string>;
11
+ scale: Record<string, TypographyScaleEntry>;
12
+ }
13
+ interface TransitionTokens {
14
+ duration: TokenScale;
15
+ easing: TokenScale;
16
+ }
17
+ interface AnimationEntry {
18
+ duration: string;
19
+ easing: string;
20
+ keyframes: string;
21
+ }
22
+ interface AccessibilityTokens {
23
+ focusRing: {
24
+ width: string;
25
+ offset: string;
26
+ style: string;
27
+ };
28
+ minTouchTarget: string;
29
+ minTextSize: string;
30
+ }
31
+ interface ButtonStateTokens {
32
+ bg: string;
33
+ bgHover: string;
34
+ bgActive: string;
35
+ bgDisabled: string;
36
+ text: string;
37
+ textDisabled: string;
38
+ border?: string;
39
+ borderDisabled?: string;
40
+ }
41
+ interface FormStateTokens {
42
+ bg?: string;
43
+ border: string;
44
+ text?: string;
45
+ placeholder?: string;
46
+ ring?: string;
47
+ }
48
+ interface Tokens {
49
+ colors: Record<string, ColorScale>;
50
+ opacity: TokenScale;
51
+ accessibility: AccessibilityTokens;
52
+ buttons: Record<string, ButtonStateTokens>;
53
+ forms: Record<string, FormStateTokens>;
54
+ spacing: TokenScale;
55
+ radii: TokenScale;
56
+ typography: TypographyTokens;
57
+ shadows: TokenScale;
58
+ breakpoints: TokenScale;
59
+ zIndex: TokenScale;
60
+ transitions: TransitionTokens;
61
+ animations: Record<string, AnimationEntry>;
62
+ }
63
+ type CssVariableMap = Record<string, string>;
64
+ interface CssVariableOptions {
65
+ selector?: string;
66
+ prefix?: string;
67
+ }
68
+ interface TailwindTheme {
69
+ colors: Record<string, string | Record<string, string>>;
70
+ spacing: TokenScale;
71
+ borderRadius: TokenScale;
72
+ fontFamily: Record<string, string[]>;
73
+ fontSize: Record<string, [string, {
74
+ lineHeight: string;
75
+ fontWeight?: number;
76
+ letterSpacing?: string;
77
+ }]>;
78
+ boxShadow: TokenScale;
79
+ screens: TokenScale;
80
+ zIndex: TokenScale;
81
+ transitionDuration: TokenScale;
82
+ transitionTimingFunction: TokenScale;
83
+ opacity: TokenScale;
84
+ }
85
+
86
+ declare const createCssVariableMap: (tokens: Tokens, options?: CssVariableOptions) => CssVariableMap;
87
+ declare const generateCssVariables: (tokens: Tokens, options?: CssVariableOptions) => string;
88
+
89
+ declare const tokens: Tokens;
90
+ declare const createTailwindTheme: (source?: Tokens) => TailwindTheme;
91
+ declare const tailwindTheme: TailwindTheme;
92
+ declare const tailwindPreset: {
93
+ theme: TailwindTheme;
94
+ };
95
+
96
+ export { type AccessibilityTokens, type AnimationEntry, type ButtonStateTokens, type ColorScale, type FormStateTokens, type TailwindTheme, type TokenScale, type Tokens, type TransitionTokens, type TypographyTokens, createCssVariableMap, createTailwindTheme, tokens as default, generateCssVariables, tailwindPreset, tailwindTheme, tokens };
@@ -0,0 +1,96 @@
1
+ type ColorScale = Record<string, string>;
2
+ type TokenScale = Record<string, string>;
3
+ interface TypographyScaleEntry {
4
+ fontSize: string;
5
+ lineHeight: string;
6
+ fontWeight?: number;
7
+ letterSpacing?: string;
8
+ }
9
+ interface TypographyTokens {
10
+ families: Record<string, string>;
11
+ scale: Record<string, TypographyScaleEntry>;
12
+ }
13
+ interface TransitionTokens {
14
+ duration: TokenScale;
15
+ easing: TokenScale;
16
+ }
17
+ interface AnimationEntry {
18
+ duration: string;
19
+ easing: string;
20
+ keyframes: string;
21
+ }
22
+ interface AccessibilityTokens {
23
+ focusRing: {
24
+ width: string;
25
+ offset: string;
26
+ style: string;
27
+ };
28
+ minTouchTarget: string;
29
+ minTextSize: string;
30
+ }
31
+ interface ButtonStateTokens {
32
+ bg: string;
33
+ bgHover: string;
34
+ bgActive: string;
35
+ bgDisabled: string;
36
+ text: string;
37
+ textDisabled: string;
38
+ border?: string;
39
+ borderDisabled?: string;
40
+ }
41
+ interface FormStateTokens {
42
+ bg?: string;
43
+ border: string;
44
+ text?: string;
45
+ placeholder?: string;
46
+ ring?: string;
47
+ }
48
+ interface Tokens {
49
+ colors: Record<string, ColorScale>;
50
+ opacity: TokenScale;
51
+ accessibility: AccessibilityTokens;
52
+ buttons: Record<string, ButtonStateTokens>;
53
+ forms: Record<string, FormStateTokens>;
54
+ spacing: TokenScale;
55
+ radii: TokenScale;
56
+ typography: TypographyTokens;
57
+ shadows: TokenScale;
58
+ breakpoints: TokenScale;
59
+ zIndex: TokenScale;
60
+ transitions: TransitionTokens;
61
+ animations: Record<string, AnimationEntry>;
62
+ }
63
+ type CssVariableMap = Record<string, string>;
64
+ interface CssVariableOptions {
65
+ selector?: string;
66
+ prefix?: string;
67
+ }
68
+ interface TailwindTheme {
69
+ colors: Record<string, string | Record<string, string>>;
70
+ spacing: TokenScale;
71
+ borderRadius: TokenScale;
72
+ fontFamily: Record<string, string[]>;
73
+ fontSize: Record<string, [string, {
74
+ lineHeight: string;
75
+ fontWeight?: number;
76
+ letterSpacing?: string;
77
+ }]>;
78
+ boxShadow: TokenScale;
79
+ screens: TokenScale;
80
+ zIndex: TokenScale;
81
+ transitionDuration: TokenScale;
82
+ transitionTimingFunction: TokenScale;
83
+ opacity: TokenScale;
84
+ }
85
+
86
+ declare const createCssVariableMap: (tokens: Tokens, options?: CssVariableOptions) => CssVariableMap;
87
+ declare const generateCssVariables: (tokens: Tokens, options?: CssVariableOptions) => string;
88
+
89
+ declare const tokens: Tokens;
90
+ declare const createTailwindTheme: (source?: Tokens) => TailwindTheme;
91
+ declare const tailwindTheme: TailwindTheme;
92
+ declare const tailwindPreset: {
93
+ theme: TailwindTheme;
94
+ };
95
+
96
+ export { type AccessibilityTokens, type AnimationEntry, type ButtonStateTokens, type ColorScale, type FormStateTokens, type TailwindTheme, type TokenScale, type Tokens, type TransitionTokens, type TypographyTokens, createCssVariableMap, createTailwindTheme, tokens as default, generateCssVariables, tailwindPreset, tailwindTheme, tokens };