hextimator 0.14.3 → 0.15.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/CHANGELOG.md +20 -0
- package/README.md +84 -39
- package/dist/{HextimatePaletteBuilder-CPmTYcEY.d.ts → HextimatePaletteBuilder-2hj-zvnW.d.ts} +105 -4
- package/dist/{chunk-FEOOTCAG.js → chunk-3JIC7LRE.js} +249 -46
- package/dist/chunk-Q6KJLMLM.js +251 -0
- package/dist/cli.js +366 -158
- package/dist/index-B1LYbLO5.d.ts +365 -0
- package/dist/index.d.ts +28 -15
- package/dist/index.js +10 -4
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/react.d.ts +26 -11
- package/dist/react.js +24 -9
- package/fallback.css +12 -0
- package/llms.txt +44 -20
- package/package.json +2 -2
- package/tailwind-inverted.css +17 -0
- package/tailwind.css +5 -0
- package/dist/chunk-23UBW2KU.js +0 -184
- package/dist/index-An21acU4.d.ts +0 -93
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { g as HextimatePreset, d as ColorInput, H as HextimatePaletteBuilder, n as TokenValue } from './HextimatePaletteBuilder-2hj-zvnW.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Darker accents on light themes, lighter accents on dark themes.
|
|
5
|
+
* Higher chroma for neutrals.
|
|
6
|
+
*/
|
|
7
|
+
declare const boldTheme: {
|
|
8
|
+
style: {
|
|
9
|
+
light: {
|
|
10
|
+
baseLightness: number;
|
|
11
|
+
};
|
|
12
|
+
dark: {
|
|
13
|
+
baseLightness: number;
|
|
14
|
+
};
|
|
15
|
+
surfaceMaxChroma: number;
|
|
16
|
+
foregroundMaxChroma: number;
|
|
17
|
+
};
|
|
18
|
+
roles: {
|
|
19
|
+
surface: {
|
|
20
|
+
generate: "surface";
|
|
21
|
+
};
|
|
22
|
+
accent: {
|
|
23
|
+
generate: "accent";
|
|
24
|
+
};
|
|
25
|
+
positive: {
|
|
26
|
+
generate: "positive";
|
|
27
|
+
};
|
|
28
|
+
negative: {
|
|
29
|
+
generate: "negative";
|
|
30
|
+
};
|
|
31
|
+
caution: {
|
|
32
|
+
generate: "caution";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
tokens: ({
|
|
36
|
+
name: string;
|
|
37
|
+
value: {
|
|
38
|
+
generate: "brand-exact";
|
|
39
|
+
};
|
|
40
|
+
} | {
|
|
41
|
+
name: string;
|
|
42
|
+
value: {
|
|
43
|
+
generate: "brand-exact-foreground";
|
|
44
|
+
};
|
|
45
|
+
})[];
|
|
46
|
+
};
|
|
47
|
+
declare const bold: HextimatePreset;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Accent color plus optional presets - plain, serializable theme input.
|
|
51
|
+
*
|
|
52
|
+
* Shared vocabulary between app code and tooling: the same object an app runs
|
|
53
|
+
* is the object a design-tool plugin runs.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Store a `ThemeDefinition` and call `hextimate(color, theme)`.
|
|
56
|
+
* See the {@link https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/migration.md#014x--0150-themes | Migration guide}.
|
|
57
|
+
*/
|
|
58
|
+
type HextimateConfig = {
|
|
59
|
+
color: ColorInput;
|
|
60
|
+
presets?: HextimatePreset[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Apply a {@link HextimateConfig}: `hextimate(color)` then each preset in order.
|
|
64
|
+
*
|
|
65
|
+
* @deprecated Use `hextimate(color, theme)` with a `ThemeDefinition`.
|
|
66
|
+
* See the {@link https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/migration.md#014x--0150-themes | Migration guide}.
|
|
67
|
+
*/
|
|
68
|
+
declare function fromConfig(c: HextimateConfig): HextimatePaletteBuilder;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Preset for Material UI (MUI) projects.
|
|
72
|
+
*
|
|
73
|
+
* Generates palette tokens matching MUI's theme structure:
|
|
74
|
+
* `primary`, `secondary`, `error`, `warning`, `info`, `success` —
|
|
75
|
+
* each with `main`, `light`, `dark`, and `contrastText` variants.
|
|
76
|
+
*
|
|
77
|
+
* Also generates `background` (`default`, `paper`), `text` (`primary`,
|
|
78
|
+
* `secondary`, `disabled`), `divider`, and `action` tokens.
|
|
79
|
+
*
|
|
80
|
+
* Defaults to `object` format for use with `createTheme()`. Override with
|
|
81
|
+
* `.format({ as: 'css' })` for MUI's CSS variables mode.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* import { hextimate, presets } from 'hextimator';
|
|
85
|
+
* import { createTheme } from '@mui/material/styles';
|
|
86
|
+
*
|
|
87
|
+
* const palette = hextimate('#6366F1')
|
|
88
|
+
* .preset(presets.mui)
|
|
89
|
+
* .format();
|
|
90
|
+
*
|
|
91
|
+
* const theme = createTheme({ palette: palette.light });
|
|
92
|
+
*/
|
|
93
|
+
declare const mui: HextimatePreset;
|
|
94
|
+
declare const muiTheme: {
|
|
95
|
+
roles: {
|
|
96
|
+
info: {
|
|
97
|
+
color: string;
|
|
98
|
+
};
|
|
99
|
+
secondary: {
|
|
100
|
+
from: string;
|
|
101
|
+
hue: number;
|
|
102
|
+
};
|
|
103
|
+
surface: {
|
|
104
|
+
generate: "surface";
|
|
105
|
+
};
|
|
106
|
+
accent: {
|
|
107
|
+
generate: "accent";
|
|
108
|
+
};
|
|
109
|
+
positive: {
|
|
110
|
+
generate: "positive";
|
|
111
|
+
};
|
|
112
|
+
negative: {
|
|
113
|
+
generate: "negative";
|
|
114
|
+
};
|
|
115
|
+
caution: {
|
|
116
|
+
generate: "caution";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
tokens: ({
|
|
120
|
+
name: string;
|
|
121
|
+
value: {
|
|
122
|
+
generate: "brand-exact";
|
|
123
|
+
};
|
|
124
|
+
} | {
|
|
125
|
+
name: string;
|
|
126
|
+
value: {
|
|
127
|
+
generate: "brand-exact-foreground";
|
|
128
|
+
};
|
|
129
|
+
} | {
|
|
130
|
+
name: string;
|
|
131
|
+
value: TokenValue;
|
|
132
|
+
})[];
|
|
133
|
+
variantNames: {
|
|
134
|
+
DEFAULT: string;
|
|
135
|
+
weak: string;
|
|
136
|
+
strong: string;
|
|
137
|
+
foreground: string;
|
|
138
|
+
};
|
|
139
|
+
format: {
|
|
140
|
+
as: "object";
|
|
141
|
+
colors: "hex";
|
|
142
|
+
separator: string;
|
|
143
|
+
roleNames: {
|
|
144
|
+
accent: string;
|
|
145
|
+
negative: string;
|
|
146
|
+
positive: string;
|
|
147
|
+
caution: string;
|
|
148
|
+
};
|
|
149
|
+
excludeRoles: string[];
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** Desaturated, restrained palette. Low chroma across the board. */
|
|
154
|
+
declare const mutedTheme: {
|
|
155
|
+
style: {
|
|
156
|
+
light: {
|
|
157
|
+
maxChroma: number;
|
|
158
|
+
};
|
|
159
|
+
dark: {
|
|
160
|
+
maxChroma: number;
|
|
161
|
+
};
|
|
162
|
+
surfaceMaxChroma: number;
|
|
163
|
+
foregroundMaxChroma: number;
|
|
164
|
+
};
|
|
165
|
+
roles: {
|
|
166
|
+
surface: {
|
|
167
|
+
generate: "surface";
|
|
168
|
+
};
|
|
169
|
+
accent: {
|
|
170
|
+
generate: "accent";
|
|
171
|
+
};
|
|
172
|
+
positive: {
|
|
173
|
+
generate: "positive";
|
|
174
|
+
};
|
|
175
|
+
negative: {
|
|
176
|
+
generate: "negative";
|
|
177
|
+
};
|
|
178
|
+
caution: {
|
|
179
|
+
generate: "caution";
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
tokens: ({
|
|
183
|
+
name: string;
|
|
184
|
+
value: {
|
|
185
|
+
generate: "brand-exact";
|
|
186
|
+
};
|
|
187
|
+
} | {
|
|
188
|
+
name: string;
|
|
189
|
+
value: {
|
|
190
|
+
generate: "brand-exact-foreground";
|
|
191
|
+
};
|
|
192
|
+
})[];
|
|
193
|
+
};
|
|
194
|
+
declare const muted: HextimatePreset;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Preset for shadcn/ui projects.
|
|
198
|
+
*
|
|
199
|
+
* Generates all CSS variables that shadcn/ui components expect:
|
|
200
|
+
* `--background`, `--foreground`, `--primary`, `--secondary`, `--muted`,
|
|
201
|
+
* `--accent`, `--destructive`, `--card`, `--popover`, `--border`, `--input`, `--ring`,
|
|
202
|
+
* plus their `-foreground` counterparts.
|
|
203
|
+
*
|
|
204
|
+
* Defaults to `oklch` color format (modern shadcn). Override with
|
|
205
|
+
* `.format({ colors: 'hsl-raw' })` for older shadcn setups.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* import { hextimate, presets } from 'hextimator';
|
|
209
|
+
*
|
|
210
|
+
* const theme = hextimate('#6366F1')
|
|
211
|
+
* .preset(presets.shadcn)
|
|
212
|
+
* .format();
|
|
213
|
+
*
|
|
214
|
+
* // Use with React hook:
|
|
215
|
+
* const palette = useHextimator('#6366F1', {
|
|
216
|
+
* configure: (b) => b.preset(presets.shadcn),
|
|
217
|
+
* });
|
|
218
|
+
*/
|
|
219
|
+
declare const shadcn: HextimatePreset;
|
|
220
|
+
declare const shadcnTheme: {
|
|
221
|
+
tokens: ({
|
|
222
|
+
name: string;
|
|
223
|
+
value: {
|
|
224
|
+
generate: "brand-exact";
|
|
225
|
+
};
|
|
226
|
+
} | {
|
|
227
|
+
name: string;
|
|
228
|
+
value: {
|
|
229
|
+
generate: "brand-exact-foreground";
|
|
230
|
+
};
|
|
231
|
+
} | {
|
|
232
|
+
name: string;
|
|
233
|
+
value: TokenValue;
|
|
234
|
+
})[];
|
|
235
|
+
variantNames: {
|
|
236
|
+
foreground: string;
|
|
237
|
+
};
|
|
238
|
+
format: {
|
|
239
|
+
as: "css";
|
|
240
|
+
colors: "oklch";
|
|
241
|
+
roleNames: {
|
|
242
|
+
surface: string;
|
|
243
|
+
accent: string;
|
|
244
|
+
negative: string;
|
|
245
|
+
positive: string;
|
|
246
|
+
};
|
|
247
|
+
excludeRoles: string[];
|
|
248
|
+
excludeVariants: string[];
|
|
249
|
+
};
|
|
250
|
+
roles: {
|
|
251
|
+
surface: {
|
|
252
|
+
generate: "surface";
|
|
253
|
+
};
|
|
254
|
+
accent: {
|
|
255
|
+
generate: "accent";
|
|
256
|
+
};
|
|
257
|
+
positive: {
|
|
258
|
+
generate: "positive";
|
|
259
|
+
};
|
|
260
|
+
negative: {
|
|
261
|
+
generate: "negative";
|
|
262
|
+
};
|
|
263
|
+
caution: {
|
|
264
|
+
generate: "caution";
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/** Neutrals pick up the accent hue for a cohesive, branded feel. */
|
|
270
|
+
declare const tintedTheme: {
|
|
271
|
+
style: {
|
|
272
|
+
surfaceMaxChroma: number;
|
|
273
|
+
surfaceHueShift: number;
|
|
274
|
+
foregroundMaxChroma: number;
|
|
275
|
+
};
|
|
276
|
+
roles: {
|
|
277
|
+
surface: {
|
|
278
|
+
generate: "surface";
|
|
279
|
+
};
|
|
280
|
+
accent: {
|
|
281
|
+
generate: "accent";
|
|
282
|
+
};
|
|
283
|
+
positive: {
|
|
284
|
+
generate: "positive";
|
|
285
|
+
};
|
|
286
|
+
negative: {
|
|
287
|
+
generate: "negative";
|
|
288
|
+
};
|
|
289
|
+
caution: {
|
|
290
|
+
generate: "caution";
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
tokens: ({
|
|
294
|
+
name: string;
|
|
295
|
+
value: {
|
|
296
|
+
generate: "brand-exact";
|
|
297
|
+
};
|
|
298
|
+
} | {
|
|
299
|
+
name: string;
|
|
300
|
+
value: {
|
|
301
|
+
generate: "brand-exact-foreground";
|
|
302
|
+
};
|
|
303
|
+
})[];
|
|
304
|
+
};
|
|
305
|
+
declare const tinted: HextimatePreset;
|
|
306
|
+
|
|
307
|
+
/** High-saturation palette. Colors that pop. */
|
|
308
|
+
declare const vibrantTheme: {
|
|
309
|
+
style: {
|
|
310
|
+
light: {
|
|
311
|
+
maxChroma: number;
|
|
312
|
+
baseLightness: number;
|
|
313
|
+
};
|
|
314
|
+
dark: {
|
|
315
|
+
maxChroma: number;
|
|
316
|
+
baseLightness: number;
|
|
317
|
+
};
|
|
318
|
+
hueShift: number;
|
|
319
|
+
surfaceHueShift: number;
|
|
320
|
+
surfaceMaxChroma: number;
|
|
321
|
+
};
|
|
322
|
+
roles: {
|
|
323
|
+
surface: {
|
|
324
|
+
generate: "surface";
|
|
325
|
+
};
|
|
326
|
+
accent: {
|
|
327
|
+
generate: "accent";
|
|
328
|
+
};
|
|
329
|
+
positive: {
|
|
330
|
+
generate: "positive";
|
|
331
|
+
};
|
|
332
|
+
negative: {
|
|
333
|
+
generate: "negative";
|
|
334
|
+
};
|
|
335
|
+
caution: {
|
|
336
|
+
generate: "caution";
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
tokens: ({
|
|
340
|
+
name: string;
|
|
341
|
+
value: {
|
|
342
|
+
generate: "brand-exact";
|
|
343
|
+
};
|
|
344
|
+
} | {
|
|
345
|
+
name: string;
|
|
346
|
+
value: {
|
|
347
|
+
generate: "brand-exact-foreground";
|
|
348
|
+
};
|
|
349
|
+
})[];
|
|
350
|
+
};
|
|
351
|
+
declare const vibrant: HextimatePreset;
|
|
352
|
+
|
|
353
|
+
type index_HextimateConfig = HextimateConfig;
|
|
354
|
+
declare const index_HextimatePreset: typeof HextimatePreset;
|
|
355
|
+
declare const index_bold: typeof bold;
|
|
356
|
+
declare const index_mui: typeof mui;
|
|
357
|
+
declare const index_muted: typeof muted;
|
|
358
|
+
declare const index_shadcn: typeof shadcn;
|
|
359
|
+
declare const index_tinted: typeof tinted;
|
|
360
|
+
declare const index_vibrant: typeof vibrant;
|
|
361
|
+
declare namespace index {
|
|
362
|
+
export { type index_HextimateConfig as HextimateConfig, index_HextimatePreset as HextimatePreset, index_bold as bold, index_mui as mui, index_muted as muted, index_shadcn as shadcn, index_tinted as tinted, index_vibrant as vibrant };
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export { type HextimateConfig as H, mutedTheme as a, boldTheme as b, bold as c, mui as d, muted as e, fromConfig as f, shadcn as g, tinted as h, index as i, vibrant as j, muiTheme as m, shadcnTheme as s, tintedTheme as t, vibrantTheme as v };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { C as Color, a as CVDType, O as OKLCH, b as ColorSpace, c as ColorInSpace, d as ColorInput, H as HextimatePaletteBuilder } from './HextimatePaletteBuilder-
|
|
2
|
-
export { D as DerivedToken, F as FlatTokenMap,
|
|
3
|
-
|
|
1
|
+
import { C as Color, a as CVDType, O as OKLCH, b as ColorSpace, c as ColorInSpace, d as ColorInput, T as ThemeDefinition, H as HextimatePaletteBuilder, e as HextimateFormatOptions } from './HextimatePaletteBuilder-2hj-zvnW.js';
|
|
2
|
+
export { D as DerivedToken, F as FlatTokenMap, f as FormatResult, g as HextimatePreset, h as HextimateResult, i as HextimateStyleOptions, N as NestedTokenMap, R as RoleDefinition, j as RoleGenerator, k as ThemeAdjustments, l as ThemeTokenValue, m as TokenGenerator, n as TokenValue, V as VariantPlacement, o as baseTheme } from './HextimatePaletteBuilder-2hj-zvnW.js';
|
|
3
|
+
import { b as boldTheme, m as muiTheme, a as mutedTheme, s as shadcnTheme, t as tintedTheme, v as vibrantTheme } from './index-B1LYbLO5.js';
|
|
4
|
+
export { H as HextimateConfig, f as fromConfig, i as presets } from './index-B1LYbLO5.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Daltonize a color for a specific type of color vision deficiency (CVD).
|
|
@@ -49,22 +50,23 @@ declare class HextimateError extends Error {
|
|
|
49
50
|
constructor(input: ColorInput, message?: string);
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
|
-
* Creates a palette builder from an accent/brand color.
|
|
53
|
+
* Creates a palette builder from an accent/brand color and an optional theme.
|
|
54
|
+
* Without a theme it uses `baseTheme`.
|
|
53
55
|
*
|
|
54
56
|
* @example
|
|
55
|
-
*
|
|
56
|
-
* const theme = hextimate('#ff6600')
|
|
57
|
-
* .format({ as: 'css', colors: 'oklch' });
|
|
57
|
+
* const css = hextimate('#ff6600').format({ as: 'css' });
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* .
|
|
64
|
-
*
|
|
65
|
-
*
|
|
60
|
+
* const theme = {
|
|
61
|
+
* ...baseTheme,
|
|
62
|
+
* style: { minContrastRatio: 'AA' },
|
|
63
|
+
* roles: { ...baseTheme.roles, cta: { color: '#ee2244' } },
|
|
64
|
+
* variants: [{ name: 'hover', placement: { from: 'strong' } }],
|
|
65
|
+
* } satisfies ThemeDefinition;
|
|
66
|
+
*
|
|
67
|
+
* const css = hextimate('#ff6600', theme).format({ as: 'css' });
|
|
66
68
|
*/
|
|
67
|
-
declare function hextimate(color: ColorInput): HextimatePaletteBuilder;
|
|
69
|
+
declare function hextimate(color: ColorInput, theme?: ThemeDefinition): HextimatePaletteBuilder;
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
* Parse a ColorInput into a Color.
|
|
@@ -87,4 +89,15 @@ declare function hextimate(color: ColorInput): HextimatePaletteBuilder;
|
|
|
87
89
|
*/
|
|
88
90
|
declare function parse(input: ColorInput, assumeSpace?: ColorSpace): Color;
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
type TailwindAliasOptions = Pick<HextimateFormatOptions, 'separator' | 'keyPrefix' | 'roleNames' | 'variantNames' | 'excludeRoles' | 'excludeVariants'> & {
|
|
93
|
+
as?: 'object' | 'css';
|
|
94
|
+
inverted?: boolean;
|
|
95
|
+
};
|
|
96
|
+
/** Builds Tailwind v4 aliases for the theme's runtime CSS variables. */
|
|
97
|
+
declare function tailwindAliases(theme: ThemeDefinition, { as: runtimeFormat, inverted, ...names }?: TailwindAliasOptions): string;
|
|
98
|
+
|
|
99
|
+
declare namespace themes {
|
|
100
|
+
export { boldTheme as bold, muiTheme as mui, mutedTheme as muted, shadcnTheme as shadcn, tintedTheme as tinted, vibrantTheme as vibrant };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { CVDType, HextimateError, HextimateFormatOptions, HextimatePaletteBuilder, ThemeDefinition, convert as convertColor, daltonizeColor, hextimate, parse as parseColor, simulateColor, tailwindAliases, themes };
|
package/dist/index.js
CHANGED
|
@@ -6,19 +6,25 @@ import {
|
|
|
6
6
|
fromConfig,
|
|
7
7
|
hextimate,
|
|
8
8
|
parse,
|
|
9
|
-
simulateColor
|
|
10
|
-
|
|
9
|
+
simulateColor,
|
|
10
|
+
tailwindAliases,
|
|
11
|
+
themes_exports
|
|
12
|
+
} from "./chunk-3JIC7LRE.js";
|
|
11
13
|
import {
|
|
14
|
+
baseTheme,
|
|
12
15
|
presets_exports
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Q6KJLMLM.js";
|
|
14
17
|
export {
|
|
15
18
|
HextimateError,
|
|
16
19
|
HextimatePaletteBuilder,
|
|
20
|
+
baseTheme,
|
|
17
21
|
convert as convertColor,
|
|
18
22
|
daltonizeColor,
|
|
19
23
|
fromConfig,
|
|
20
24
|
hextimate,
|
|
21
25
|
parse as parseColor,
|
|
22
26
|
presets_exports as presets,
|
|
23
|
-
simulateColor
|
|
27
|
+
simulateColor,
|
|
28
|
+
tailwindAliases,
|
|
29
|
+
themes_exports as themes
|
|
24
30
|
};
|
package/dist/presets.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { H as HextimateConfig,
|
|
2
|
-
export { g as HextimatePreset } from './HextimatePaletteBuilder-
|
|
1
|
+
export { H as HextimateConfig, c as bold, d as mui, e as muted, g as shadcn, h as tinted, j as vibrant } from './index-B1LYbLO5.js';
|
|
2
|
+
export { g as HextimatePreset } from './HextimatePaletteBuilder-2hj-zvnW.js';
|
package/dist/presets.js
CHANGED
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as HextimateStyleOptions, g as HextimatePreset, H as HextimatePaletteBuilder, h as HextimateResult, F as FlatTokenMap,
|
|
1
|
+
import { i as HextimateStyleOptions, g as HextimatePreset, H as HextimatePaletteBuilder, h as HextimateResult, F as FlatTokenMap, T as ThemeDefinition, e as HextimateFormatOptions } from './HextimatePaletteBuilder-2hj-zvnW.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { PropsWithChildren, RefObject, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
|
|
@@ -64,7 +64,11 @@ interface HextimatorProviderProps {
|
|
|
64
64
|
defaultMode?: ModePreference;
|
|
65
65
|
/** Called when the mode changes. */
|
|
66
66
|
onModePreferenceChange?: (mode: ModePreference) => void;
|
|
67
|
+
/** Theme to build with, as in `hextimate(color, theme)`. Defaults to `baseTheme`. */
|
|
68
|
+
theme?: ThemeDefinition;
|
|
69
|
+
/** @deprecated Set `style` on the `theme`: `theme={{ ...baseTheme, style }}`. */
|
|
67
70
|
style?: HextimateStyleOptions;
|
|
71
|
+
/** @deprecated Pass a `theme` instead: `theme={themes.shadcn}`. */
|
|
68
72
|
presets?: HextimatePreset[];
|
|
69
73
|
format?: Omit<HextimateFormatOptions, 'as'>;
|
|
70
74
|
configure?: (builder: HextimatePaletteBuilder) => void;
|
|
@@ -82,14 +86,18 @@ interface HextimatorProviderProps {
|
|
|
82
86
|
* </HextimatorProvider>
|
|
83
87
|
* ```
|
|
84
88
|
*/
|
|
85
|
-
declare function HextimatorProvider({ children, defaultColor, onColorChange, defaultMode: initialMode, onModePreferenceChange, style: initialStyle, presets: initialPresets, format: formatOpts, configure: initialConfigure, darkMode, cssPrefix, target, }: PropsWithChildren<HextimatorProviderProps>): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function HextimatorProvider({ children, defaultColor, onColorChange, defaultMode: initialMode, onModePreferenceChange, theme, style: initialStyle, presets: initialPresets, format: formatOpts, configure: initialConfigure, darkMode, cssPrefix, target, }: PropsWithChildren<HextimatorProviderProps>): react_jsx_runtime.JSX.Element;
|
|
86
90
|
|
|
87
91
|
interface HextimatorScopeProps {
|
|
88
92
|
/** Brand color for this subtree. String sets the same color for both modes; object sets a different color for each mode. */
|
|
89
93
|
defaultColor: ColorInputProp;
|
|
90
94
|
/** When true, ignores any parent provider/scope and builds the theme from scratch. */
|
|
91
95
|
isolated?: boolean;
|
|
96
|
+
/** Theme for this subtree. When set, the scope builds with `hextimate(color, theme)` instead of forking the parent. */
|
|
97
|
+
theme?: ThemeDefinition;
|
|
98
|
+
/** @deprecated Set `style` on the `theme`: `theme={{ ...baseTheme, style }}`. */
|
|
92
99
|
style?: HextimateStyleOptions;
|
|
100
|
+
/** @deprecated Pass a `theme` instead: `theme={themes.shadcn}`. */
|
|
93
101
|
presets?: HextimatePreset[];
|
|
94
102
|
format?: Omit<HextimateFormatOptions, 'as'>;
|
|
95
103
|
configure?: (builder: HextimatePaletteBuilder) => void;
|
|
@@ -101,8 +109,9 @@ interface HextimatorScopeProps {
|
|
|
101
109
|
children?: ReactNode;
|
|
102
110
|
}
|
|
103
111
|
/**
|
|
104
|
-
* Themes a single subtree with its own brand color. Inherits the shape (
|
|
105
|
-
*
|
|
112
|
+
* Themes a single subtree with its own brand color. Inherits the shape (theme,
|
|
113
|
+
* roles, variants) of any parent provider or scope unless `isolated` or its
|
|
114
|
+
* own `theme` is set.
|
|
106
115
|
*
|
|
107
116
|
* @example
|
|
108
117
|
* ```tsx
|
|
@@ -111,7 +120,7 @@ interface HextimatorScopeProps {
|
|
|
111
120
|
* </HextimatorScope>
|
|
112
121
|
* ```
|
|
113
122
|
*/
|
|
114
|
-
declare function HextimatorScope({ defaultColor, isolated, style: initialStyle, presets: initialPresets, format: formatOpts, configure: initialConfigure, darkMode, cssPrefix, className, wrapperStyle, children, }: HextimatorScopeProps): react_jsx_runtime.JSX.Element;
|
|
123
|
+
declare function HextimatorScope({ defaultColor, isolated, theme, style: initialStyle, presets: initialPresets, format: formatOpts, configure: initialConfigure, darkMode, cssPrefix, className, wrapperStyle, children, }: HextimatorScopeProps): react_jsx_runtime.JSX.Element;
|
|
115
124
|
|
|
116
125
|
/**
|
|
117
126
|
* Props for the `HextimatorStyle` component, a declarative alternative to
|
|
@@ -123,16 +132,19 @@ declare function HextimatorScope({ defaultColor, isolated, style: initialStyle,
|
|
|
123
132
|
* multiple subtrees can carry different themes via CSS cascade.
|
|
124
133
|
*
|
|
125
134
|
* - `color`: The accent color to generate the palette from.
|
|
126
|
-
* - `
|
|
135
|
+
* - `theme`: The `ThemeDefinition` to build with. Defaults to `baseTheme`.
|
|
127
136
|
* - `format`: Options for how the generated palette is formatted.
|
|
128
|
-
* - `configure`: A callback to further customize the palette builder
|
|
137
|
+
* - `configure`: A callback to further customize the palette builder after the theme is applied.
|
|
129
138
|
* - `darkMode`: Strategy for handling dark mode variants.
|
|
130
139
|
* - `cssPrefix`: A prefix applied to all generated CSS variable names.
|
|
131
140
|
* - `selector`: CSS selector the variables are scoped to. Defaults to `:root`.
|
|
132
141
|
*/
|
|
133
142
|
interface HextimatorStyleProps {
|
|
134
143
|
color: string;
|
|
144
|
+
theme?: ThemeDefinition;
|
|
145
|
+
/** @deprecated Set `style` on the `theme`: `theme={{ ...baseTheme, style }}`. */
|
|
135
146
|
style?: HextimateStyleOptions;
|
|
147
|
+
/** @deprecated Pass a `theme` instead: `theme={themes.shadcn}`. */
|
|
136
148
|
presets?: HextimatePreset[];
|
|
137
149
|
format?: Omit<HextimateFormatOptions, 'as'>;
|
|
138
150
|
configure?: (builder: HextimatePaletteBuilder) => void;
|
|
@@ -157,20 +169,23 @@ interface HextimatorStyleProps {
|
|
|
157
169
|
* </div>
|
|
158
170
|
* ```
|
|
159
171
|
*/
|
|
160
|
-
declare function HextimatorStyle({ color, style: styleOptions, presets, format: formatOpts, configure, darkMode, cssPrefix, selector, }: HextimatorStyleProps): react_jsx_runtime.JSX.Element;
|
|
172
|
+
declare function HextimatorStyle({ color, theme, style: styleOptions, presets, format: formatOpts, configure, darkMode, cssPrefix, selector, }: HextimatorStyleProps): react_jsx_runtime.JSX.Element;
|
|
161
173
|
|
|
162
174
|
/**
|
|
163
175
|
* Options for the `useHextimator` hook, which generates a color palette and injects CSS variables based on a given color and configuration.
|
|
164
|
-
* - `
|
|
176
|
+
* - `theme`: The `ThemeDefinition` to build with, as in `hextimate(color, theme)`. Defaults to `baseTheme`.
|
|
165
177
|
* - `format`: Options for how the generated palette is formatted (e.g., output format).
|
|
166
|
-
* - `configure`: A callback to further customize the palette builder
|
|
178
|
+
* - `configure`: A callback to further customize the palette builder after the theme is applied.
|
|
167
179
|
* - `darkMode`: Strategy for handling dark mode variants in CSS variable injection.
|
|
168
180
|
* - `cssPrefix`: A prefix to apply to all generated CSS variable names.
|
|
169
181
|
* - `target`: An optional ref to a specific DOM element where CSS variables should be injected instead of the document root.
|
|
170
182
|
*
|
|
171
183
|
*/
|
|
172
184
|
interface UseHextimatorOptions {
|
|
185
|
+
theme?: ThemeDefinition;
|
|
186
|
+
/** @deprecated Set `style` on the `theme`: `{ theme: { ...baseTheme, style } }`. */
|
|
173
187
|
style?: HextimateStyleOptions;
|
|
188
|
+
/** @deprecated Pass a `theme` instead: `{ theme: themes.shadcn }`. */
|
|
174
189
|
presets?: HextimatePreset[];
|
|
175
190
|
format?: Omit<HextimateFormatOptions, 'as'>;
|
|
176
191
|
configure?: (builder: HextimatePaletteBuilder) => void;
|
|
@@ -187,7 +202,7 @@ interface UseHextimatorOptions {
|
|
|
187
202
|
* Example usage:
|
|
188
203
|
* ```tsx
|
|
189
204
|
* const palette = useHextimator('#ff6600', {
|
|
190
|
-
*
|
|
205
|
+
* theme: themes.shadcn,
|
|
191
206
|
* darkMode: { type: 'class', className: 'dark' },
|
|
192
207
|
* cssPrefix: '--myapp-',
|
|
193
208
|
* });
|