hextimator 0.6.0 → 0.7.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 +25 -1
- package/README.md +5 -2
- package/dist/{HextimatePaletteBuilder-BH1jrzj7.d.ts → HextimatePaletteBuilder-Bc-GHsBy.d.ts} +35 -1
- package/dist/{chunk-QQZBI4SO.js → chunk-4WWRI5QJ.js} +44 -6
- package/dist/{chunk-KFR2LTS2.js → chunk-NTF3K3U3.js} +4 -4
- package/dist/cli.js +48 -10
- package/dist/{index-Cd9eX-1l.d.ts → index-B9eHpF-F.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/llms.txt +2 -2
- package/package.json +3 -1
- package/tailwind-inverted.css +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
## 0.
|
|
1
|
+
## 0.7.0 (Latest)
|
|
2
|
+
|
|
3
|
+
- Adds an opt-in `invertedVariants: true` format option that emits an -inverted copy of every token holding the opposite mode's value, plus a companion hextimator/tailwind-inverted.css so utilities like `bg-surface-inverted` just work.
|
|
4
|
+
|
|
5
|
+
- Renamed `ThemeAdjustments.lightness` → `baseLightness` to disambiguate it from the _relative_ `lightness` offset used by `addToken({ from, lightness })`. Same word was doing two different jobs (absolute theme anchor vs. relative offset), which made the API confusing.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
// Before (0.6)
|
|
9
|
+
hextimate(color).style({
|
|
10
|
+
light: { lightness: 0.7 },
|
|
11
|
+
dark: { lightness: 0.6 },
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// After (0.7)
|
|
15
|
+
hextimate(color).style({
|
|
16
|
+
light: { baseLightness: 0.7 },
|
|
17
|
+
dark: { baseLightness: 0.6 },
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The old `lightness` field still works as a deprecated alias and emits a one-time `console.warn`.
|
|
22
|
+
|
|
23
|
+
Migration checklist: [migration.md](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/migration.md).
|
|
24
|
+
|
|
25
|
+
## 0.6.0
|
|
2
26
|
|
|
3
27
|
- [#114](https://github.com/fgrgic/hextimator/pull/114) **Breaking**. Uses `surface` instead of `base` for the background tokens (e.g. `base-strong` → `surface-strong`). This avoids a class-name collision with Tailwind's built-in text-base font-size utility and makes the token name match its semantic purpose (the surface behind your content).
|
|
4
28
|
|
package/README.md
CHANGED
|
@@ -262,16 +262,19 @@ Does not match **preset-only** token names (e.g. shadcn); use the CLI to generat
|
|
|
262
262
|
|
|
263
263
|
## Documentation
|
|
264
264
|
|
|
265
|
-
- [
|
|
265
|
+
- [Customization](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/customization.md) — style and format options reference
|
|
266
266
|
- [Extending the palette](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/extending-the-palette.md) — `addRole`, `addVariant`, `addToken`
|
|
267
267
|
- [Presets](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/presets.md) — drop-in configs for shadcn/ui, or create your own
|
|
268
268
|
- [Multiple themes](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/multiple-themes.md) — dynamic theming and `.fork()`
|
|
269
|
-
- [Customization](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/customization.md) — style and format options reference
|
|
270
269
|
- [Color vision deficiency](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/color-vision-deficiency.md) — simulate and adapt for CVD
|
|
271
270
|
- [React](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/react.md) — hook, `HextimatorStyle`, provider, scoped themes, dark mode
|
|
272
271
|
- [Tailwind CSS v4](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/tailwind.md) — setup and usage with Tailwind
|
|
273
272
|
- [Real-world examples](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/examples.md) — shadcn/ui, Stripe, Slack configurations
|
|
274
273
|
|
|
274
|
+
### For migrating from previous versions
|
|
275
|
+
|
|
276
|
+
- [Migration guide](https://github.com/fgrgic/hextimator/blob/main/packages/hextimator/docs/migration.md) — breaking changes by version
|
|
277
|
+
|
|
275
278
|
## Contributing
|
|
276
279
|
|
|
277
280
|
Issues and PRs are welcome at [github.com/fgrgic/hextimator](https://github.com/fgrgic/hextimator/issues).
|
package/dist/{HextimatePaletteBuilder-BH1jrzj7.d.ts → HextimatePaletteBuilder-Bc-GHsBy.d.ts}
RENAMED
|
@@ -75,10 +75,19 @@ type ColorInput = HexString | CSSColorString | ColorTuple | Color | number;
|
|
|
75
75
|
*/
|
|
76
76
|
interface ThemeAdjustments {
|
|
77
77
|
/**
|
|
78
|
-
* Absolute OKLCH lightness for this theme (0–1).
|
|
78
|
+
* Absolute OKLCH lightness anchor for this theme's accent color (0–1).
|
|
79
|
+
*
|
|
80
|
+
* This is the *baseline* the palette is generated around — distinct from
|
|
81
|
+
* the *relative* `lightness` offsets used by `addToken({ from, lightness })`.
|
|
79
82
|
*
|
|
80
83
|
* Default: 0.7 for light, 0.6 for dark.
|
|
81
84
|
*/
|
|
85
|
+
baseLightness?: number;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Renamed to `baseLightness` in 0.7.0 to disambiguate it from
|
|
88
|
+
* the relative `lightness` offset used by `addToken({ from, lightness })`.
|
|
89
|
+
* Still works as a fallback. Will be removed in a future release.
|
|
90
|
+
*/
|
|
82
91
|
lightness?: number;
|
|
83
92
|
/**
|
|
84
93
|
* Maximum chroma for accent/semantic colors in this theme.
|
|
@@ -306,6 +315,30 @@ interface HextimateFormatOptions {
|
|
|
306
315
|
* Example: `['strong', 'weak']` removes those variants from all roles.
|
|
307
316
|
*/
|
|
308
317
|
excludeVariants?: string[];
|
|
318
|
+
/**
|
|
319
|
+
* Emit an extra `-inverted` copy of every token whose value is the
|
|
320
|
+
* opposite mode's value (light tokens get dark values, dark tokens get
|
|
321
|
+
* light values). Inverted tokens flip with the active mode, just like
|
|
322
|
+
* regular tokens.
|
|
323
|
+
*
|
|
324
|
+
* Use for sections that intentionally contrast with the surrounding
|
|
325
|
+
* theme: testimonials, alternating stripes, hero callouts, "spotlight"
|
|
326
|
+
* panels. One class (`bg-surface-inverted`) flips both ways.
|
|
327
|
+
*
|
|
328
|
+
* For "always this mode" sections, compose with the dark-mode variant:
|
|
329
|
+
* - Always dark: `bg-surface-inverted dark:bg-surface`
|
|
330
|
+
* - Always light: `bg-surface dark:bg-surface-inverted`
|
|
331
|
+
*
|
|
332
|
+
* Example output (flat keys):
|
|
333
|
+
* - `accent-inverted`, `accent-strong-inverted`, `accent-foreground-inverted`
|
|
334
|
+
*
|
|
335
|
+
* Tailwind users need to pair this with the companion stylesheet:
|
|
336
|
+
* `@import "hextimator/tailwind-inverted.css";` to get utilities like
|
|
337
|
+
* `bg-accent-inverted`, `text-accent-foreground-inverted`.
|
|
338
|
+
*
|
|
339
|
+
* Default: `false`.
|
|
340
|
+
*/
|
|
341
|
+
invertedVariants?: boolean;
|
|
309
342
|
}
|
|
310
343
|
/**
|
|
311
344
|
* Combined options for the convenience API.
|
|
@@ -552,6 +585,7 @@ declare class HextimatePaletteBuilder {
|
|
|
552
585
|
as: 'object' | 'scss';
|
|
553
586
|
}): HextimateResult<FlatTokenMap>;
|
|
554
587
|
format(options?: HextimateFormatOptions): HextimateResult | string;
|
|
588
|
+
private buildInvertedEntries;
|
|
555
589
|
private applyRole;
|
|
556
590
|
private applyVariant;
|
|
557
591
|
private applyToken;
|
|
@@ -856,6 +856,12 @@ function buildTokenEntries(palette, options) {
|
|
|
856
856
|
}
|
|
857
857
|
return entries;
|
|
858
858
|
}
|
|
859
|
+
function withInvertedSuffix(entry, sep) {
|
|
860
|
+
if (entry.isDefault && entry.variant === "DEFAULT") {
|
|
861
|
+
return { ...entry, isDefault: false, variant: "inverted" };
|
|
862
|
+
}
|
|
863
|
+
return { ...entry, variant: `${entry.variant}${sep}inverted` };
|
|
864
|
+
}
|
|
859
865
|
|
|
860
866
|
// src/format/formatters.ts
|
|
861
867
|
function toFlatKey(entry, sep) {
|
|
@@ -1164,11 +1170,19 @@ function expandColorToScale(color, themeType, options) {
|
|
|
1164
1170
|
}
|
|
1165
1171
|
var LIGHT_THEME_LIGHTNESS_RANGE = [0.4, 0.99];
|
|
1166
1172
|
var DARK_THEME_LIGHTNESS_RANGE = [0.2, 0.8];
|
|
1173
|
+
var warnedLegacyLightness = false;
|
|
1167
1174
|
function resolveThemeLightness(themeType, options) {
|
|
1168
1175
|
const themeAdjustments = themeType === "light" ? options?.light : options?.dark;
|
|
1169
1176
|
const range = themeType === "light" ? LIGHT_THEME_LIGHTNESS_RANGE : DARK_THEME_LIGHTNESS_RANGE;
|
|
1170
|
-
|
|
1171
|
-
|
|
1177
|
+
const value = themeAdjustments?.baseLightness ?? themeAdjustments?.lightness;
|
|
1178
|
+
if (themeAdjustments?.baseLightness === void 0 && themeAdjustments?.lightness !== void 0 && !warnedLegacyLightness && typeof console !== "undefined") {
|
|
1179
|
+
warnedLegacyLightness = true;
|
|
1180
|
+
console.warn(
|
|
1181
|
+
"[hextimator] `style({ light/dark: { lightness } })` is deprecated. Rename to `baseLightness` to disambiguate from the relative `lightness` offset used by `addToken({ from, lightness })`. Will be removed in a future release."
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
if (value !== void 0) {
|
|
1185
|
+
return Math.min(Math.max(value, range[0]), range[1]);
|
|
1172
1186
|
}
|
|
1173
1187
|
return themeType === "light" ? DEFAULT_LIGHT_THEME_LIGHTNESS : DEFAULT_DARK_THEME_LIGHTNESS;
|
|
1174
1188
|
}
|
|
@@ -1751,18 +1765,42 @@ var HextimatePaletteBuilder = class _HextimatePaletteBuilder {
|
|
|
1751
1765
|
this.darkPalette,
|
|
1752
1766
|
colorFormat
|
|
1753
1767
|
);
|
|
1768
|
+
const inverted = mergedOptions?.invertedVariants ? this.buildInvertedEntries(mergedOptions, lightTokens, darkTokens) : { lightBlock: [], darkBlock: [] };
|
|
1754
1769
|
if (mergedOptions?.as === "css" || mergedOptions?.as === "tailwind-css") {
|
|
1755
1770
|
return formatStylesheet(
|
|
1756
1771
|
this.lightPalette,
|
|
1757
1772
|
this.darkPalette,
|
|
1758
1773
|
mergedOptions,
|
|
1759
|
-
lightTokens,
|
|
1760
|
-
darkTokens
|
|
1774
|
+
[...lightTokens, ...inverted.lightBlock],
|
|
1775
|
+
[...darkTokens, ...inverted.darkBlock]
|
|
1761
1776
|
);
|
|
1762
1777
|
}
|
|
1763
1778
|
return {
|
|
1764
|
-
light: format(this.lightPalette, mergedOptions,
|
|
1765
|
-
|
|
1779
|
+
light: format(this.lightPalette, mergedOptions, [
|
|
1780
|
+
...lightTokens,
|
|
1781
|
+
...inverted.lightBlock
|
|
1782
|
+
]),
|
|
1783
|
+
dark: format(this.darkPalette, mergedOptions, [
|
|
1784
|
+
...darkTokens,
|
|
1785
|
+
...inverted.darkBlock
|
|
1786
|
+
])
|
|
1787
|
+
};
|
|
1788
|
+
}
|
|
1789
|
+
buildInvertedEntries(options, lightStandalone, darkStandalone) {
|
|
1790
|
+
const sep = options.separator ?? "-";
|
|
1791
|
+
const lightBase = buildTokenEntries(this.lightPalette, options);
|
|
1792
|
+
const darkBase = buildTokenEntries(this.darkPalette, options);
|
|
1793
|
+
return {
|
|
1794
|
+
// Light block carries dark values under -inverted suffix.
|
|
1795
|
+
lightBlock: [
|
|
1796
|
+
...darkBase.map((e) => withInvertedSuffix(e, sep)),
|
|
1797
|
+
...darkStandalone.map((e) => withInvertedSuffix(e, sep))
|
|
1798
|
+
],
|
|
1799
|
+
// Dark block carries light values under -inverted suffix.
|
|
1800
|
+
darkBlock: [
|
|
1801
|
+
...lightBase.map((e) => withInvertedSuffix(e, sep)),
|
|
1802
|
+
...lightStandalone.map((e) => withInvertedSuffix(e, sep))
|
|
1803
|
+
]
|
|
1766
1804
|
};
|
|
1767
1805
|
}
|
|
1768
1806
|
applyRole(name, color) {
|
|
@@ -18,8 +18,8 @@ __export(presets_exports, {
|
|
|
18
18
|
// src/presets/bold.ts
|
|
19
19
|
var bold = {
|
|
20
20
|
style: {
|
|
21
|
-
light: {
|
|
22
|
-
dark: {
|
|
21
|
+
light: { baseLightness: 0.5 },
|
|
22
|
+
dark: { baseLightness: 0.8 },
|
|
23
23
|
surfaceMaxChroma: 0.06,
|
|
24
24
|
foregroundMaxChroma: 0.02
|
|
25
25
|
}
|
|
@@ -164,8 +164,8 @@ var tinted = {
|
|
|
164
164
|
// src/presets/vibrant.ts
|
|
165
165
|
var vibrant = {
|
|
166
166
|
style: {
|
|
167
|
-
light: { maxChroma: 0.2,
|
|
168
|
-
dark: { maxChroma: 0.18,
|
|
167
|
+
light: { maxChroma: 0.2, baseLightness: 0.6 },
|
|
168
|
+
dark: { maxChroma: 0.18, baseLightness: 0.65 },
|
|
169
169
|
hueShift: 5,
|
|
170
170
|
surfaceHueShift: 180,
|
|
171
171
|
surfaceMaxChroma: 0.08
|
package/dist/cli.js
CHANGED
|
@@ -864,6 +864,12 @@ function buildTokenEntries(palette, options) {
|
|
|
864
864
|
}
|
|
865
865
|
return entries;
|
|
866
866
|
}
|
|
867
|
+
function withInvertedSuffix(entry, sep) {
|
|
868
|
+
if (entry.isDefault && entry.variant === "DEFAULT") {
|
|
869
|
+
return { ...entry, isDefault: false, variant: "inverted" };
|
|
870
|
+
}
|
|
871
|
+
return { ...entry, variant: `${entry.variant}${sep}inverted` };
|
|
872
|
+
}
|
|
867
873
|
|
|
868
874
|
// src/format/formatters.ts
|
|
869
875
|
function toFlatKey(entry, sep) {
|
|
@@ -1172,11 +1178,19 @@ function expandColorToScale(color, themeType, options) {
|
|
|
1172
1178
|
}
|
|
1173
1179
|
var LIGHT_THEME_LIGHTNESS_RANGE = [0.4, 0.99];
|
|
1174
1180
|
var DARK_THEME_LIGHTNESS_RANGE = [0.2, 0.8];
|
|
1181
|
+
var warnedLegacyLightness = false;
|
|
1175
1182
|
function resolveThemeLightness(themeType, options) {
|
|
1176
1183
|
const themeAdjustments = themeType === "light" ? options?.light : options?.dark;
|
|
1177
1184
|
const range = themeType === "light" ? LIGHT_THEME_LIGHTNESS_RANGE : DARK_THEME_LIGHTNESS_RANGE;
|
|
1178
|
-
|
|
1179
|
-
|
|
1185
|
+
const value = themeAdjustments?.baseLightness ?? themeAdjustments?.lightness;
|
|
1186
|
+
if (themeAdjustments?.baseLightness === void 0 && themeAdjustments?.lightness !== void 0 && !warnedLegacyLightness && typeof console !== "undefined") {
|
|
1187
|
+
warnedLegacyLightness = true;
|
|
1188
|
+
console.warn(
|
|
1189
|
+
"[hextimator] `style({ light/dark: { lightness } })` is deprecated. Rename to `baseLightness` to disambiguate from the relative `lightness` offset used by `addToken({ from, lightness })`. Will be removed in a future release."
|
|
1190
|
+
);
|
|
1191
|
+
}
|
|
1192
|
+
if (value !== void 0) {
|
|
1193
|
+
return Math.min(Math.max(value, range[0]), range[1]);
|
|
1180
1194
|
}
|
|
1181
1195
|
return themeType === "light" ? DEFAULT_LIGHT_THEME_LIGHTNESS : DEFAULT_DARK_THEME_LIGHTNESS;
|
|
1182
1196
|
}
|
|
@@ -1759,18 +1773,42 @@ var HextimatePaletteBuilder = class _HextimatePaletteBuilder {
|
|
|
1759
1773
|
this.darkPalette,
|
|
1760
1774
|
colorFormat
|
|
1761
1775
|
);
|
|
1776
|
+
const inverted = mergedOptions?.invertedVariants ? this.buildInvertedEntries(mergedOptions, lightTokens, darkTokens) : { lightBlock: [], darkBlock: [] };
|
|
1762
1777
|
if (mergedOptions?.as === "css" || mergedOptions?.as === "tailwind-css") {
|
|
1763
1778
|
return formatStylesheet(
|
|
1764
1779
|
this.lightPalette,
|
|
1765
1780
|
this.darkPalette,
|
|
1766
1781
|
mergedOptions,
|
|
1767
|
-
lightTokens,
|
|
1768
|
-
darkTokens
|
|
1782
|
+
[...lightTokens, ...inverted.lightBlock],
|
|
1783
|
+
[...darkTokens, ...inverted.darkBlock]
|
|
1769
1784
|
);
|
|
1770
1785
|
}
|
|
1771
1786
|
return {
|
|
1772
|
-
light: format(this.lightPalette, mergedOptions,
|
|
1773
|
-
|
|
1787
|
+
light: format(this.lightPalette, mergedOptions, [
|
|
1788
|
+
...lightTokens,
|
|
1789
|
+
...inverted.lightBlock
|
|
1790
|
+
]),
|
|
1791
|
+
dark: format(this.darkPalette, mergedOptions, [
|
|
1792
|
+
...darkTokens,
|
|
1793
|
+
...inverted.darkBlock
|
|
1794
|
+
])
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
buildInvertedEntries(options, lightStandalone, darkStandalone) {
|
|
1798
|
+
const sep = options.separator ?? "-";
|
|
1799
|
+
const lightBase = buildTokenEntries(this.lightPalette, options);
|
|
1800
|
+
const darkBase = buildTokenEntries(this.darkPalette, options);
|
|
1801
|
+
return {
|
|
1802
|
+
// Light block carries dark values under -inverted suffix.
|
|
1803
|
+
lightBlock: [
|
|
1804
|
+
...darkBase.map((e) => withInvertedSuffix(e, sep)),
|
|
1805
|
+
...darkStandalone.map((e) => withInvertedSuffix(e, sep))
|
|
1806
|
+
],
|
|
1807
|
+
// Dark block carries light values under -inverted suffix.
|
|
1808
|
+
darkBlock: [
|
|
1809
|
+
...lightBase.map((e) => withInvertedSuffix(e, sep)),
|
|
1810
|
+
...lightStandalone.map((e) => withInvertedSuffix(e, sep))
|
|
1811
|
+
]
|
|
1774
1812
|
};
|
|
1775
1813
|
}
|
|
1776
1814
|
applyRole(name, color) {
|
|
@@ -2238,8 +2276,8 @@ var tinted = {
|
|
|
2238
2276
|
// src/presets/vibrant.ts
|
|
2239
2277
|
var vibrant = {
|
|
2240
2278
|
style: {
|
|
2241
|
-
light: { maxChroma: 0.2,
|
|
2242
|
-
dark: { maxChroma: 0.18,
|
|
2279
|
+
light: { maxChroma: 0.2, baseLightness: 0.6 },
|
|
2280
|
+
dark: { maxChroma: 0.18, baseLightness: 0.65 },
|
|
2243
2281
|
hueShift: 5,
|
|
2244
2282
|
surfaceHueShift: 180,
|
|
2245
2283
|
surfaceMaxChroma: 0.08
|
|
@@ -2412,14 +2450,14 @@ function run() {
|
|
|
2412
2450
|
if (values["light-lightness"] || values["light-max-chroma"]) {
|
|
2413
2451
|
styleOptions.light = {};
|
|
2414
2452
|
if (values["light-lightness"])
|
|
2415
|
-
styleOptions.light.
|
|
2453
|
+
styleOptions.light.baseLightness = Number(values["light-lightness"]);
|
|
2416
2454
|
if (values["light-max-chroma"])
|
|
2417
2455
|
styleOptions.light.maxChroma = Number(values["light-max-chroma"]);
|
|
2418
2456
|
}
|
|
2419
2457
|
if (values["dark-lightness"] || values["dark-max-chroma"]) {
|
|
2420
2458
|
styleOptions.dark = {};
|
|
2421
2459
|
if (values["dark-lightness"])
|
|
2422
|
-
styleOptions.dark.
|
|
2460
|
+
styleOptions.dark.baseLightness = Number(values["dark-lightness"]);
|
|
2423
2461
|
if (values["dark-max-chroma"])
|
|
2424
2462
|
styleOptions.dark.maxChroma = Number(values["dark-max-chroma"]);
|
|
2425
2463
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, e as FormatResult, f as HextimateFormatOptions, g as HextimateOptions, h as HextimatePreset, i as HextimateResult, j as HextimateStyleOptions, N as NestedTokenMap, T as ThemeAdjustments, k as TokenValue, V as VariantPlacement } from './HextimatePaletteBuilder-
|
|
3
|
-
export { i as presets } from './index-
|
|
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-Bc-GHsBy.js';
|
|
2
|
+
export { D as DerivedToken, F as FlatTokenMap, e as FormatResult, f as HextimateFormatOptions, g as HextimateOptions, h as HextimatePreset, i as HextimateResult, j as HextimateStyleOptions, N as NestedTokenMap, T as ThemeAdjustments, k as TokenValue, V as VariantPlacement } from './HextimatePaletteBuilder-Bc-GHsBy.js';
|
|
3
|
+
export { i as presets } from './index-B9eHpF-F.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Daltonize a color for a specific type of color vision deficiency (CVD).
|
|
@@ -80,7 +80,7 @@ declare class HextimateError extends Error {
|
|
|
80
80
|
* @example
|
|
81
81
|
* // Extended: add roles and variants before formatting
|
|
82
82
|
* const theme = hextimate('#ff6600')
|
|
83
|
-
* .style({ light: {
|
|
83
|
+
* .style({ light: { baseLightness: 0.5 }, dark: { baseLightness: 0.65, maxChroma: 0.1 } })
|
|
84
84
|
* .addRole('cta', '#ee2244')
|
|
85
85
|
* .addVariant('hover', { from: 'strong' })
|
|
86
86
|
* .format({ as: 'tailwind' });
|
package/dist/index.js
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
hextimate,
|
|
7
7
|
parse,
|
|
8
8
|
simulateColor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4WWRI5QJ.js";
|
|
10
10
|
import {
|
|
11
11
|
presets_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NTF3K3U3.js";
|
|
13
13
|
export {
|
|
14
14
|
HextimateError,
|
|
15
15
|
HextimatePaletteBuilder,
|
package/dist/presets.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { b as bold, m as mui, a as muted, s as shadcn, t as tinted, v as vibrant } from './index-
|
|
2
|
-
export { h as HextimatePreset } from './HextimatePaletteBuilder-
|
|
1
|
+
export { b as bold, m as mui, a as muted, s as shadcn, t as tinted, v as vibrant } from './index-B9eHpF-F.js';
|
|
2
|
+
export { h as HextimatePreset } from './HextimatePaletteBuilder-Bc-GHsBy.js';
|
package/dist/presets.js
CHANGED
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as HextimateStyleOptions, h as HextimatePreset, H as HextimatePaletteBuilder, i as HextimateResult, F as FlatTokenMap, f as HextimateFormatOptions } from './HextimatePaletteBuilder-
|
|
1
|
+
import { j as HextimateStyleOptions, h as HextimatePreset, H as HextimatePaletteBuilder, i as HextimateResult, F as FlatTokenMap, f as HextimateFormatOptions } from './HextimatePaletteBuilder-Bc-GHsBy.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { PropsWithChildren, RefObject, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
|
package/dist/react.js
CHANGED
package/llms.txt
CHANGED
|
@@ -83,8 +83,8 @@ Pick the dark wrapper with `darkMode`: `"media"` (default) wraps dark tokens in
|
|
|
83
83
|
| `semanticColorRanges` | `{ positive?: [start,end], ... }` | greens, reds, ambers | Hue ranges for semantic detection |
|
|
84
84
|
| `surfaceMaxChroma` | number | `0.01` | Max chroma for surface colors |
|
|
85
85
|
| `foregroundMaxChroma` | number | `0.01` | Max chroma for foreground colors |
|
|
86
|
-
| `light` | `{
|
|
87
|
-
| `dark` | `{
|
|
86
|
+
| `light` | `{ baseLightness?, maxChroma? }` | `{ baseLightness: 0.7 }` | Light theme adjustments. `baseLightness` is the absolute OKLCH anchor for the accent (distinct from the relative `lightness` offset on derived tokens) |
|
|
87
|
+
| `dark` | `{ baseLightness?, maxChroma? }` | `{ baseLightness: 0.6 }` | Dark theme adjustments |
|
|
88
88
|
| `minContrastRatio` | `"AAA"`, `"AA"`, or number | `"AAA"` | WCAG contrast target (AAA=7, AA=4.5) |
|
|
89
89
|
| `hueShift` | degrees | `0` | Per-variant hue rotation |
|
|
90
90
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hextimator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Runtime theming for multi-tenant apps: per-tenant branded themes from a single brand color, with WCAG contrast guarantees.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"runtime-theming",
|
|
@@ -63,11 +63,13 @@
|
|
|
63
63
|
},
|
|
64
64
|
"./cli": "./dist/cli.js",
|
|
65
65
|
"./tailwind.css": "./tailwind.css",
|
|
66
|
+
"./tailwind-inverted.css": "./tailwind-inverted.css",
|
|
66
67
|
"./fallback.css": "./fallback.css"
|
|
67
68
|
},
|
|
68
69
|
"files": [
|
|
69
70
|
"dist",
|
|
70
71
|
"tailwind.css",
|
|
72
|
+
"tailwind-inverted.css",
|
|
71
73
|
"fallback.css",
|
|
72
74
|
"llms.txt",
|
|
73
75
|
"CHANGELOG.md"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@theme inline {
|
|
2
|
+
--color-accent-inverted: var(--accent-inverted);
|
|
3
|
+
--color-accent-strong-inverted: var(--accent-strong-inverted);
|
|
4
|
+
--color-accent-weak-inverted: var(--accent-weak-inverted);
|
|
5
|
+
--color-accent-foreground-inverted: var(--accent-foreground-inverted);
|
|
6
|
+
--color-surface-inverted: var(--surface-inverted);
|
|
7
|
+
--color-surface-strong-inverted: var(--surface-strong-inverted);
|
|
8
|
+
--color-surface-weak-inverted: var(--surface-weak-inverted);
|
|
9
|
+
--color-surface-foreground-inverted: var(--surface-foreground-inverted);
|
|
10
|
+
--color-positive-inverted: var(--positive-inverted);
|
|
11
|
+
--color-positive-strong-inverted: var(--positive-strong-inverted);
|
|
12
|
+
--color-positive-weak-inverted: var(--positive-weak-inverted);
|
|
13
|
+
--color-positive-foreground-inverted: var(--positive-foreground-inverted);
|
|
14
|
+
--color-negative-inverted: var(--negative-inverted);
|
|
15
|
+
--color-negative-strong-inverted: var(--negative-strong-inverted);
|
|
16
|
+
--color-negative-weak-inverted: var(--negative-weak-inverted);
|
|
17
|
+
--color-negative-foreground-inverted: var(--negative-foreground-inverted);
|
|
18
|
+
--color-warning-inverted: var(--warning-inverted);
|
|
19
|
+
--color-warning-strong-inverted: var(--warning-strong-inverted);
|
|
20
|
+
--color-warning-weak-inverted: var(--warning-weak-inverted);
|
|
21
|
+
--color-warning-foreground-inverted: var(--warning-foreground-inverted);
|
|
22
|
+
}
|