@leodamours/ds-components 0.2.10 → 0.3.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.
@@ -1,5 +1,8 @@
1
1
  declare const defaultTheme: {
2
2
  colors: Record<string, string>;
3
+ zIndex: Record<string, string>;
4
+ duration: Record<string, string>;
5
+ easing: Record<string, string>;
3
6
  fontFamily: {
4
7
  sans: string;
5
8
  mono: string;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Automatic palette generation from base colors.
3
+ *
4
+ * Algorithm derived from designer-provided token formulas:
5
+ * given a base color in HSL, the lightness gap (100 - L) determines
6
+ * how far each variant shifts toward white, while darkening multiplies
7
+ * the base lightness downward. Hue and saturation are preserved.
8
+ */
9
+ interface HSL {
10
+ h: number;
11
+ s: number;
12
+ l: number;
13
+ }
14
+ export declare function hexToHSL(hex: string): HSL;
15
+ export declare function hslToHex(h: number, s: number, l: number): string;
16
+ export interface SemanticPalette {
17
+ base: string;
18
+ hover: string;
19
+ active: string;
20
+ disabled: string;
21
+ soft: string;
22
+ 'soft-hover': string;
23
+ 'soft-active': string;
24
+ 'on-solid': string;
25
+ 'on-soft': string;
26
+ border: string;
27
+ 'border-hover': string;
28
+ 'border-strong': string;
29
+ }
30
+ /**
31
+ * Generate a full semantic palette from a single base hex color.
32
+ *
33
+ * The algorithm preserves hue and saturation, deriving all variants
34
+ * by shifting lightness using the gap between the base L and white.
35
+ */
36
+ export declare function generatePalette(baseHex: string): SemanticPalette;
37
+ /** The semantic color roles that accept a base hex for palette derivation. */
38
+ declare const SEMANTIC_ROLES: readonly ["brand", "error", "success", "warning", "info", "processing", "neutral"];
39
+ export type SemanticRole = (typeof SEMANTIC_ROLES)[number];
40
+ export interface ThemeBases {
41
+ brand: string;
42
+ error: string;
43
+ success: string;
44
+ warning: string;
45
+ info: string;
46
+ processing: string;
47
+ neutral: string;
48
+ }
49
+ /**
50
+ * Expand a set of base colors into a flat token map with all semantic variants.
51
+ *
52
+ * @example
53
+ * expandBases({ brand: '#8B5CF6', error: '#E11D48', ... })
54
+ * // => { brand: '#8B5CF6', 'brand-hover': '#7639D4', ... }
55
+ */
56
+ export declare function expandBases(bases: ThemeBases): Record<string, string>;
57
+ /**
58
+ * Generate a complete CSS theme from just base colors.
59
+ *
60
+ * Only requires one hex per semantic role. All hover, soft, border,
61
+ * and contrast variants are derived automatically.
62
+ *
63
+ * @example
64
+ * const css = generateFullTheme(
65
+ * { brand: '#8B5CF6', error: '#E11D48', success: '#059669',
66
+ * warning: '#EA580C', info: '#6366F1', processing: '#D946EF',
67
+ * neutral: '#6B5F7D' },
68
+ * '[data-theme="purple"]'
69
+ * )
70
+ * // Inject into a <style> tag
71
+ */
72
+ export declare function generateFullTheme(bases: ThemeBases, selector?: string): string;
73
+ export {};
@@ -35,6 +35,9 @@ export declare const colorTokens: {
35
35
  readonly 'brand-soft-active': "#B7E6FD";
36
36
  readonly 'brand-on-solid': "#FFFFFF";
37
37
  readonly 'brand-on-soft': "#0EA5E9";
38
+ readonly 'brand-border': "#B7E6FD";
39
+ readonly 'brand-border-hover': "#7DD3FC";
40
+ readonly 'brand-border-strong': "#0369A1";
38
41
  readonly 'brand-secondary': "#6366F1";
39
42
  readonly neutral: "#64748B";
40
43
  readonly 'neutral-soft': "#F8FAFC";
@@ -77,6 +80,7 @@ export declare const colorTokens: {
77
80
  readonly 'warning-on-soft': "#92400E";
78
81
  readonly 'warning-border': "#F3E6A5";
79
82
  readonly 'warning-border-hover': "#E6D378";
83
+ readonly 'warning-border-strong': "#B45309";
80
84
  readonly info: "#3B82F6";
81
85
  readonly 'info-hover': "#2563EB";
82
86
  readonly 'info-active': "#1D4ED8";
@@ -87,6 +91,7 @@ export declare const colorTokens: {
87
91
  readonly 'info-on-soft': "#1E40AF";
88
92
  readonly 'info-border': "#C5D7F5";
89
93
  readonly 'info-border-hover': "#A8CCF2";
94
+ readonly 'info-border-strong': "#1D4ED8";
90
95
  readonly processing: "#06B6D4";
91
96
  readonly 'processing-hover': "#0891B2";
92
97
  readonly 'processing-active': "#0E7490";
@@ -97,10 +102,9 @@ export declare const colorTokens: {
97
102
  readonly 'processing-on-soft': "#155E75";
98
103
  readonly 'processing-border': "#B3F0FC";
99
104
  readonly 'processing-border-hover': "#7FE8F5";
100
- readonly 'transcript-bg': "#FEFCE8";
101
- readonly 'transcript-highlight': "#FEF3C7";
102
- readonly 'transcript-speaker': "#EDE9FE";
103
- readonly 'transcript-timestamp': "#F3F4F6";
105
+ readonly 'processing-border-strong': "#0E7490";
106
+ readonly overlay: "rgba(15, 23, 42, 0.15)";
107
+ readonly 'focus-ring': "#0EA5E9";
104
108
  };
105
109
  export declare const spacingTokens: {
106
110
  readonly 'space-1': "4px";
@@ -123,17 +127,57 @@ export declare const shadowTokens: {
123
127
  readonly 'shadow-sm': "0 1px 2px 0 rgba(0, 0, 0, 0.05)";
124
128
  readonly 'shadow-md': "0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.1)";
125
129
  readonly 'shadow-lg': "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)";
130
+ readonly 'shadow-thumb': "0 1px 3px rgba(0, 0, 0, 0.15)";
131
+ readonly 'shadow-card': "0 4px 2px 0 rgba(69, 89, 114, 0.02), 0 6px 14px 0 rgba(69, 89, 114, 0.06)";
132
+ readonly 'shadow-elevated': "0px 2px 2px 0px rgba(69, 89, 114, 0.06), 0px 6px 6px 0px rgba(69, 89, 114, 0.04)";
133
+ readonly 'shadow-focus': "0 0 0 0.125rem rgba(14, 165, 233, 0.2)";
134
+ };
135
+ export declare const zIndexTokens: {
136
+ readonly 'z-sticky': "10";
137
+ readonly 'z-dropdown': "40";
138
+ readonly 'z-overlay': "50";
139
+ readonly 'z-modal': "50";
140
+ readonly 'z-toast': "60";
141
+ readonly 'z-tooltip': "70";
142
+ };
143
+ export declare const transitionTokens: {
144
+ readonly 'duration-fast': "150ms";
145
+ readonly 'duration-normal': "200ms";
146
+ readonly 'duration-slow': "300ms";
147
+ readonly 'ease-default': "cubic-bezier(0.4, 0, 0.2, 1)";
148
+ readonly 'ease-in': "cubic-bezier(0.4, 0, 1, 1)";
149
+ readonly 'ease-out': "cubic-bezier(0, 0, 0.2, 1)";
150
+ readonly 'ease-in-out': "cubic-bezier(0.4, 0, 0.2, 1)";
126
151
  };
127
152
  export type ColorToken = keyof typeof colorTokens;
128
153
  export type SpacingToken = keyof typeof spacingTokens;
129
154
  export type RadiusToken = keyof typeof radiusTokens;
130
155
  export type ShadowToken = keyof typeof shadowTokens;
131
- export type ThemeOverride = Partial<Record<ColorToken | SpacingToken | RadiusToken | ShadowToken, string>>;
156
+ export type ZIndexToken = keyof typeof zIndexTokens;
157
+ export type TransitionToken = keyof typeof transitionTokens;
158
+ export type ThemeOverride = Partial<Record<ColorToken | SpacingToken | RadiusToken | ShadowToken | ZIndexToken | TransitionToken, string>>;
132
159
  /** All tokens combined for iteration. */
133
160
  export declare const allTokens: {
161
+ readonly 'duration-fast': "150ms";
162
+ readonly 'duration-normal': "200ms";
163
+ readonly 'duration-slow': "300ms";
164
+ readonly 'ease-default': "cubic-bezier(0.4, 0, 0.2, 1)";
165
+ readonly 'ease-in': "cubic-bezier(0.4, 0, 1, 1)";
166
+ readonly 'ease-out': "cubic-bezier(0, 0, 0.2, 1)";
167
+ readonly 'ease-in-out': "cubic-bezier(0.4, 0, 0.2, 1)";
168
+ readonly 'z-sticky': "10";
169
+ readonly 'z-dropdown': "40";
170
+ readonly 'z-overlay': "50";
171
+ readonly 'z-modal': "50";
172
+ readonly 'z-toast': "60";
173
+ readonly 'z-tooltip': "70";
134
174
  readonly 'shadow-sm': "0 1px 2px 0 rgba(0, 0, 0, 0.05)";
135
175
  readonly 'shadow-md': "0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.1)";
136
176
  readonly 'shadow-lg': "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)";
177
+ readonly 'shadow-thumb': "0 1px 3px rgba(0, 0, 0, 0.15)";
178
+ readonly 'shadow-card': "0 4px 2px 0 rgba(69, 89, 114, 0.02), 0 6px 14px 0 rgba(69, 89, 114, 0.06)";
179
+ readonly 'shadow-elevated': "0px 2px 2px 0px rgba(69, 89, 114, 0.06), 0px 6px 6px 0px rgba(69, 89, 114, 0.04)";
180
+ readonly 'shadow-focus': "0 0 0 0.125rem rgba(14, 165, 233, 0.2)";
137
181
  readonly 'radius-sm': "4px";
138
182
  readonly 'radius-md': "6px";
139
183
  readonly 'radius-lg': "8px";
@@ -179,6 +223,9 @@ export declare const allTokens: {
179
223
  readonly 'brand-soft-active': "#B7E6FD";
180
224
  readonly 'brand-on-solid': "#FFFFFF";
181
225
  readonly 'brand-on-soft': "#0EA5E9";
226
+ readonly 'brand-border': "#B7E6FD";
227
+ readonly 'brand-border-hover': "#7DD3FC";
228
+ readonly 'brand-border-strong': "#0369A1";
182
229
  readonly 'brand-secondary': "#6366F1";
183
230
  readonly neutral: "#64748B";
184
231
  readonly 'neutral-soft': "#F8FAFC";
@@ -221,6 +268,7 @@ export declare const allTokens: {
221
268
  readonly 'warning-on-soft': "#92400E";
222
269
  readonly 'warning-border': "#F3E6A5";
223
270
  readonly 'warning-border-hover': "#E6D378";
271
+ readonly 'warning-border-strong': "#B45309";
224
272
  readonly info: "#3B82F6";
225
273
  readonly 'info-hover': "#2563EB";
226
274
  readonly 'info-active': "#1D4ED8";
@@ -231,6 +279,7 @@ export declare const allTokens: {
231
279
  readonly 'info-on-soft': "#1E40AF";
232
280
  readonly 'info-border': "#C5D7F5";
233
281
  readonly 'info-border-hover': "#A8CCF2";
282
+ readonly 'info-border-strong': "#1D4ED8";
234
283
  readonly processing: "#06B6D4";
235
284
  readonly 'processing-hover': "#0891B2";
236
285
  readonly 'processing-active': "#0E7490";
@@ -241,10 +290,9 @@ export declare const allTokens: {
241
290
  readonly 'processing-on-soft': "#155E75";
242
291
  readonly 'processing-border': "#B3F0FC";
243
292
  readonly 'processing-border-hover': "#7FE8F5";
244
- readonly 'transcript-bg': "#FEFCE8";
245
- readonly 'transcript-highlight': "#FEF3C7";
246
- readonly 'transcript-speaker': "#EDE9FE";
247
- readonly 'transcript-timestamp': "#F3F4F6";
293
+ readonly 'processing-border-strong': "#0E7490";
294
+ readonly overlay: "rgba(15, 23, 42, 0.15)";
295
+ readonly 'focus-ring': "#0EA5E9";
248
296
  };
249
297
  /** Convert a token name to its CSS custom property name. */
250
298
  export declare function tokenToCssVar(token: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leodamours/ds-components",
3
- "version": "0.2.10",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",