@tenphi/glaze 0.16.1 → 0.16.2

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.d.cts CHANGED
@@ -739,7 +739,7 @@ interface GlazeColorCssOptions {
739
739
  * `name: 'brand'` → `--brand-color: …`.
740
740
  */
741
741
  name: string;
742
- /** Output color format. Default: 'rgb' (matches `theme.css` default). */
742
+ /** Output color format. Default: 'oklch'. */
743
743
  format?: GlazeColorFormat;
744
744
  /**
745
745
  * Suffix appended to the name. Default: '-color' (matches
@@ -944,7 +944,7 @@ interface GlazeTokenOptions {
944
944
  };
945
945
  /** Override which scheme variants to include. */
946
946
  modes?: GlazeOutputModes;
947
- /** Output color format. Default: 'okhsl'. */
947
+ /** Output color format. Default: 'oklch'. */
948
948
  format?: GlazeColorFormat;
949
949
  /**
950
950
  * Emit hue as a separate custom property, referenced via `var()`.
@@ -960,11 +960,11 @@ interface GlazeTokenOptions {
960
960
  interface GlazeJsonOptions {
961
961
  /** Override which scheme variants to include. */
962
962
  modes?: GlazeOutputModes;
963
- /** Output color format. Default: 'okhsl'. */
963
+ /** Output color format. Default: 'oklch'. */
964
964
  format?: GlazeColorFormat;
965
965
  }
966
966
  interface GlazeCssOptions {
967
- /** Output color format. Default: 'rgb'. */
967
+ /** Output color format. Default: 'oklch'. */
968
968
  format?: GlazeColorFormat;
969
969
  /** Suffix appended to each CSS custom property name. Default: '-color'. */
970
970
  suffix?: string;
package/dist/index.d.mts CHANGED
@@ -739,7 +739,7 @@ interface GlazeColorCssOptions {
739
739
  * `name: 'brand'` → `--brand-color: …`.
740
740
  */
741
741
  name: string;
742
- /** Output color format. Default: 'rgb' (matches `theme.css` default). */
742
+ /** Output color format. Default: 'oklch'. */
743
743
  format?: GlazeColorFormat;
744
744
  /**
745
745
  * Suffix appended to the name. Default: '-color' (matches
@@ -944,7 +944,7 @@ interface GlazeTokenOptions {
944
944
  };
945
945
  /** Override which scheme variants to include. */
946
946
  modes?: GlazeOutputModes;
947
- /** Output color format. Default: 'okhsl'. */
947
+ /** Output color format. Default: 'oklch'. */
948
948
  format?: GlazeColorFormat;
949
949
  /**
950
950
  * Emit hue as a separate custom property, referenced via `var()`.
@@ -960,11 +960,11 @@ interface GlazeTokenOptions {
960
960
  interface GlazeJsonOptions {
961
961
  /** Override which scheme variants to include. */
962
962
  modes?: GlazeOutputModes;
963
- /** Output color format. Default: 'okhsl'. */
963
+ /** Output color format. Default: 'oklch'. */
964
964
  format?: GlazeColorFormat;
965
965
  }
966
966
  interface GlazeCssOptions {
967
- /** Output color format. Default: 'rgb'. */
967
+ /** Output color format. Default: 'oklch'. */
968
968
  format?: GlazeColorFormat;
969
969
  /** Suffix appended to each CSS custom property name. Default: '-color'. */
970
970
  suffix?: string;
package/dist/index.mjs CHANGED
@@ -2284,7 +2284,7 @@ const formatters = {
2284
2284
  function fmt(value, decimals) {
2285
2285
  return parseFloat(value.toFixed(decimals)).toString();
2286
2286
  }
2287
- function formatVariant(v, format = "okhsl", pastel = false) {
2287
+ function formatVariant(v, format = "oklch", pastel = false) {
2288
2288
  const effectivePastel = v.pastel ?? pastel;
2289
2289
  let base;
2290
2290
  if (format === "okhst") base = formatOkhst(v.h, v.s * 100, v.t * 100, effectivePastel);
@@ -2323,7 +2323,7 @@ function resolveModes(override) {
2323
2323
  highContrast: override?.highContrast ?? cfg.modes.highContrast
2324
2324
  };
2325
2325
  }
2326
- function buildTokenMap(resolved, prefix, states, modes, format = "okhsl", pastel = false, channelCtx) {
2326
+ function buildTokenMap(resolved, prefix, states, modes, format = "oklch", pastel = false, channelCtx) {
2327
2327
  const tokens = {};
2328
2328
  const huePlans = channelCtx !== void 0 && format === "oklch" ? buildHuePlans(resolved, channelCtx) : void 0;
2329
2329
  if (huePlans !== void 0 && channelCtx !== void 0) {
@@ -2353,7 +2353,7 @@ function buildTokenEntry(color, states, modes, format, pastel, huePlan) {
2353
2353
  if (modes.dark && modes.highContrast) entry[`${states.dark} & ${states.highContrast}`] = formatColorValue(color.darkContrast, format, pastel, huePlan);
2354
2354
  return entry;
2355
2355
  }
2356
- function buildFlatTokenMap(resolved, prefix, modes, format = "okhsl", pastel = false) {
2356
+ function buildFlatTokenMap(resolved, prefix, modes, format = "oklch", pastel = false) {
2357
2357
  const result = { light: {} };
2358
2358
  if (modes.dark) result.dark = {};
2359
2359
  if (modes.highContrast) result.lightContrast = {};
@@ -2367,7 +2367,7 @@ function buildFlatTokenMap(resolved, prefix, modes, format = "okhsl", pastel = f
2367
2367
  }
2368
2368
  return result;
2369
2369
  }
2370
- function buildJsonMap(resolved, modes, format = "okhsl", pastel = false) {
2370
+ function buildJsonMap(resolved, modes, format = "oklch", pastel = false) {
2371
2371
  const result = {};
2372
2372
  for (const [name, color] of resolved) {
2373
2373
  const entry = { light: formatVariant(color.light, format, pastel) };
@@ -2965,7 +2965,7 @@ function createColorTokenFromDefs(seedHue, seedSaturation, defs, primary, effect
2965
2965
  };
2966
2966
  };
2967
2967
  const tokenLike = (options) => {
2968
- return buildTokenMap(resolveOnce(), "", resolveStates(options), resolveModes(options?.modes), options?.format, effectiveConfig.pastel)[`#${primary}`];
2968
+ return buildTokenMap(resolveOnce(), "", resolveStates(options), resolveModes(options?.modes), options?.format ?? "oklch", effectiveConfig.pastel)[`#${primary}`];
2969
2969
  };
2970
2970
  return {
2971
2971
  resolve() {
@@ -2979,7 +2979,7 @@ function createColorTokenFromDefs(seedHue, seedSaturation, defs, primary, effect
2979
2979
  return buildJsonMap(resolveOnce(), resolveModes(options?.modes), format, effectiveConfig.pastel)[primary];
2980
2980
  },
2981
2981
  css(options) {
2982
- const format = options.format ?? "rgb";
2982
+ const format = options.format ?? "oklch";
2983
2983
  assertNativeFormat(format, "css");
2984
2984
  const resolved = resolveOnce().get(primary);
2985
2985
  const renamed = new Map([[options.name, resolved]]);
@@ -3316,7 +3316,7 @@ function createPalette(themes, paletteOptions) {
3316
3316
  highContrast: options?.states?.highContrast ?? cfg.states.highContrast
3317
3317
  };
3318
3318
  const modes = resolveModes(options?.modes);
3319
- const format = options?.format ?? "okhsl";
3319
+ const format = options?.format ?? "oklch";
3320
3320
  return buildPaletteOutput(themes, paletteOptions, options, (filtered, prefix, pastel, themeName, theme) => {
3321
3321
  return buildTokenMap(filtered, prefix, states, modes, format, pastel, channelCtxForTheme(theme, themeName, prefix, resolvePrefix(options, themeName, true), options?.splitHue, format, modes, filtered));
3322
3322
  }, (acc, part) => Object.assign(acc, part), () => ({}));
@@ -3331,7 +3331,7 @@ function createPalette(themes, paletteOptions) {
3331
3331
  },
3332
3332
  css(options) {
3333
3333
  const suffix = options?.suffix ?? "-color";
3334
- const format = options?.format ?? "rgb";
3334
+ const format = options?.format ?? "oklch";
3335
3335
  assertNativeFormat(format, "css");
3336
3336
  const modes = resolveModes();
3337
3337
  const lines = buildPaletteOutput(themes, paletteOptions, options, (filtered, prefix, pastel, themeName, theme) => {
@@ -3498,8 +3498,8 @@ function createTheme(hue, saturation, initialColors, configOverride) {
3498
3498
  highContrast: options?.states?.highContrast ?? cfg.states.highContrast
3499
3499
  };
3500
3500
  const modes = resolveModes(options?.modes);
3501
- const format = options?.format ?? "okhsl";
3502
- const channelCtx = channelCtxFor(options, "okhsl", "");
3501
+ const format = options?.format ?? "oklch";
3502
+ const channelCtx = channelCtxFor(options, "oklch", "");
3503
3503
  return buildTokenMap(resolveCached(), "", states, modes, format, cfg.pastel, channelCtx);
3504
3504
  },
3505
3505
  json(options) {
@@ -3509,9 +3509,9 @@ function createTheme(hue, saturation, initialColors, configOverride) {
3509
3509
  return buildJsonMap(resolveCached(), modes, format, getEffectiveConfig().pastel);
3510
3510
  },
3511
3511
  css(options) {
3512
- const format = options?.format ?? "rgb";
3512
+ const format = options?.format ?? "oklch";
3513
3513
  assertNativeFormat(format, "css");
3514
- const channelCtx = channelCtxFor(options, "rgb", "");
3514
+ const channelCtx = channelCtxFor(options, "oklch", "");
3515
3515
  return buildCssMap(resolveCached(), "", options?.suffix ?? "-color", format, getEffectiveConfig().pastel, channelCtx);
3516
3516
  },
3517
3517
  dtcg(options) {