@tenphi/glaze 0.10.1 → 0.11.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/README.md +19 -1384
- package/dist/index.cjs +714 -575
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -20
- package/dist/index.d.mts +20 -20
- package/dist/index.mjs +714 -575
- package/dist/index.mjs.map +1 -1
- package/docs/api.md +1074 -0
- package/docs/methodology.md +330 -0
- package/docs/migration.md +237 -0
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -376,16 +376,17 @@ interface GlazeColorOverrides {
|
|
|
376
376
|
/** Saturation multiplier on the seed (0–1). Default: 1. */
|
|
377
377
|
saturationFactor?: number;
|
|
378
378
|
/**
|
|
379
|
-
* Adaptation mode. Defaults
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
379
|
+
* Adaptation mode. Defaults to `'auto'` for every input form, so
|
|
380
|
+
* colors automatically adapt between light and dark like an ordinary
|
|
381
|
+
* theme color. The default *scaling* snapshot differs by input form:
|
|
382
|
+
* string inputs preserve their light lightness and extend the dark
|
|
383
|
+
* window to `[lo, 100]` (`#000` ↔ `#fff` flip), while `OkhslColor`
|
|
384
|
+
* and `[r, g, b]` tuple inputs snapshot the full `globalConfig.
|
|
385
|
+
* lightLightness` / `globalConfig.darkLightness` windows.
|
|
385
386
|
*
|
|
386
|
-
* Pass `'fixed'` explicitly to opt
|
|
387
|
-
*
|
|
388
|
-
*
|
|
387
|
+
* Pass `'fixed'` explicitly to opt back into the legacy linear, non-
|
|
388
|
+
* inverting mapping; pass `'static'` to pin the same lightness
|
|
389
|
+
* across every variant.
|
|
389
390
|
*/
|
|
390
391
|
mode?: AdaptationMode;
|
|
391
392
|
/**
|
|
@@ -442,8 +443,9 @@ interface GlazeColorOverrides {
|
|
|
442
443
|
* the way up to white.
|
|
443
444
|
*
|
|
444
445
|
* - **`OkhslColor` / `[r, g, b]` tuple / structured inputs**:
|
|
445
|
-
* - `lightLightness:
|
|
446
|
-
*
|
|
446
|
+
* - `lightLightness: globalConfig.lightLightness` — same light window
|
|
447
|
+
* theme colors use, snapshotted at create time.
|
|
448
|
+
* - `darkLightness: globalConfig.darkLightness` — same dark window
|
|
447
449
|
* theme colors use, snapshotted at create time.
|
|
448
450
|
*
|
|
449
451
|
* Passing this object replaces both fields at once. To keep one
|
|
@@ -451,7 +453,12 @@ interface GlazeColorOverrides {
|
|
|
451
453
|
* explicitly.
|
|
452
454
|
*/
|
|
453
455
|
interface GlazeColorScaling {
|
|
454
|
-
/**
|
|
456
|
+
/**
|
|
457
|
+
* Light-mode lightness window. Snapshotted from `globalConfig` at
|
|
458
|
+
* create time: `false` (preserve input) for string inputs, plain
|
|
459
|
+
* `globalConfig.lightLightness` for object / tuple / structured
|
|
460
|
+
* inputs. Pass `false` to preserve input lightness in light mode.
|
|
461
|
+
*/
|
|
455
462
|
lightLightness?: false | [number, number];
|
|
456
463
|
/**
|
|
457
464
|
* Dark-mode lightness window. Snapshotted from `globalConfig` at
|
|
@@ -714,14 +721,7 @@ declare function glaze(hueOrOptions: number | {
|
|
|
714
721
|
}, saturation?: number): GlazeTheme;
|
|
715
722
|
declare namespace glaze {
|
|
716
723
|
var configure: (config: GlazeConfig) => void;
|
|
717
|
-
var palette: (themes: PaletteInput, options?: GlazePaletteOptions) =>
|
|
718
|
-
tokens(options?: GlazeJsonOptions & GlazePaletteExportOptions): Record<string, Record<string, string>>;
|
|
719
|
-
tasty(options?: GlazeTokenOptions & GlazePaletteExportOptions): Record<string, Record<string, string>>;
|
|
720
|
-
json(options?: GlazeJsonOptions & {
|
|
721
|
-
prefix?: boolean | Record<string, string>;
|
|
722
|
-
}): Record<string, Record<string, Record<string, string>>>;
|
|
723
|
-
css(options?: GlazeCssOptions & GlazePaletteExportOptions): GlazeCssResult;
|
|
724
|
-
};
|
|
724
|
+
var palette: (themes: PaletteInput, options?: GlazePaletteOptions) => GlazePalette;
|
|
725
725
|
var from: (data: GlazeThemeExport) => GlazeTheme;
|
|
726
726
|
var color: {
|
|
727
727
|
(input: GlazeColorInput, scaling?: GlazeColorScaling): GlazeColorToken;
|
package/dist/index.d.mts
CHANGED
|
@@ -376,16 +376,17 @@ interface GlazeColorOverrides {
|
|
|
376
376
|
/** Saturation multiplier on the seed (0–1). Default: 1. */
|
|
377
377
|
saturationFactor?: number;
|
|
378
378
|
/**
|
|
379
|
-
* Adaptation mode. Defaults
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
379
|
+
* Adaptation mode. Defaults to `'auto'` for every input form, so
|
|
380
|
+
* colors automatically adapt between light and dark like an ordinary
|
|
381
|
+
* theme color. The default *scaling* snapshot differs by input form:
|
|
382
|
+
* string inputs preserve their light lightness and extend the dark
|
|
383
|
+
* window to `[lo, 100]` (`#000` ↔ `#fff` flip), while `OkhslColor`
|
|
384
|
+
* and `[r, g, b]` tuple inputs snapshot the full `globalConfig.
|
|
385
|
+
* lightLightness` / `globalConfig.darkLightness` windows.
|
|
385
386
|
*
|
|
386
|
-
* Pass `'fixed'` explicitly to opt
|
|
387
|
-
*
|
|
388
|
-
*
|
|
387
|
+
* Pass `'fixed'` explicitly to opt back into the legacy linear, non-
|
|
388
|
+
* inverting mapping; pass `'static'` to pin the same lightness
|
|
389
|
+
* across every variant.
|
|
389
390
|
*/
|
|
390
391
|
mode?: AdaptationMode;
|
|
391
392
|
/**
|
|
@@ -442,8 +443,9 @@ interface GlazeColorOverrides {
|
|
|
442
443
|
* the way up to white.
|
|
443
444
|
*
|
|
444
445
|
* - **`OkhslColor` / `[r, g, b]` tuple / structured inputs**:
|
|
445
|
-
* - `lightLightness:
|
|
446
|
-
*
|
|
446
|
+
* - `lightLightness: globalConfig.lightLightness` — same light window
|
|
447
|
+
* theme colors use, snapshotted at create time.
|
|
448
|
+
* - `darkLightness: globalConfig.darkLightness` — same dark window
|
|
447
449
|
* theme colors use, snapshotted at create time.
|
|
448
450
|
*
|
|
449
451
|
* Passing this object replaces both fields at once. To keep one
|
|
@@ -451,7 +453,12 @@ interface GlazeColorOverrides {
|
|
|
451
453
|
* explicitly.
|
|
452
454
|
*/
|
|
453
455
|
interface GlazeColorScaling {
|
|
454
|
-
/**
|
|
456
|
+
/**
|
|
457
|
+
* Light-mode lightness window. Snapshotted from `globalConfig` at
|
|
458
|
+
* create time: `false` (preserve input) for string inputs, plain
|
|
459
|
+
* `globalConfig.lightLightness` for object / tuple / structured
|
|
460
|
+
* inputs. Pass `false` to preserve input lightness in light mode.
|
|
461
|
+
*/
|
|
455
462
|
lightLightness?: false | [number, number];
|
|
456
463
|
/**
|
|
457
464
|
* Dark-mode lightness window. Snapshotted from `globalConfig` at
|
|
@@ -714,14 +721,7 @@ declare function glaze(hueOrOptions: number | {
|
|
|
714
721
|
}, saturation?: number): GlazeTheme;
|
|
715
722
|
declare namespace glaze {
|
|
716
723
|
var configure: (config: GlazeConfig) => void;
|
|
717
|
-
var palette: (themes: PaletteInput, options?: GlazePaletteOptions) =>
|
|
718
|
-
tokens(options?: GlazeJsonOptions & GlazePaletteExportOptions): Record<string, Record<string, string>>;
|
|
719
|
-
tasty(options?: GlazeTokenOptions & GlazePaletteExportOptions): Record<string, Record<string, string>>;
|
|
720
|
-
json(options?: GlazeJsonOptions & {
|
|
721
|
-
prefix?: boolean | Record<string, string>;
|
|
722
|
-
}): Record<string, Record<string, Record<string, string>>>;
|
|
723
|
-
css(options?: GlazeCssOptions & GlazePaletteExportOptions): GlazeCssResult;
|
|
724
|
-
};
|
|
724
|
+
var palette: (themes: PaletteInput, options?: GlazePaletteOptions) => GlazePalette;
|
|
725
725
|
var from: (data: GlazeThemeExport) => GlazeTheme;
|
|
726
726
|
var color: {
|
|
727
727
|
(input: GlazeColorInput, scaling?: GlazeColorScaling): GlazeColorToken;
|