hextimator 0.10.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.10.1
2
+
3
+ ### Patch Changes
4
+
5
+ - [#135](https://github.com/fgrgic/hextimator/pull/135) [`90b3920`](https://github.com/fgrgic/hextimator/commit/90b3920ba60580dfd038bd0e46d0796feffdf718) Thanks [@fgrgic](https://github.com/fgrgic)! - fix wrong priority of parameters for style. `baseLightness` should always take priority if set when calculating the lightness.
6
+
1
7
  ## 0.10.0
2
8
 
3
9
  ### Minor Changes
@@ -1139,6 +1139,17 @@ function constrainAccentVariantVsSurface(themeType, variant, foreground, contras
1139
1139
  }
1140
1140
  return v;
1141
1141
  }
1142
+ function hasExplicitBaseLightnessAnchor(themeType, options) {
1143
+ if (!options) return false;
1144
+ const global = extractGlobalThemeAdjustments(
1145
+ options
1146
+ );
1147
+ if (global.baseLightness !== void 0 || global.lightness !== void 0) {
1148
+ return true;
1149
+ }
1150
+ const branch = themeType === "light" ? options.light : options.dark;
1151
+ return branch?.baseLightness !== void 0 || branch?.lightness !== void 0;
1152
+ }
1142
1153
  function expandColorToScale(color, themeType, options) {
1143
1154
  const {
1144
1155
  baselineLValueDark,
@@ -1168,7 +1179,7 @@ function expandColorToScale(color, themeType, options) {
1168
1179
  const isSurfaceScale = baselineLValueLight !== void 0 || baselineLValueDark !== void 0;
1169
1180
  const rawHueShift = themeAdjustments.hueShift ?? 0;
1170
1181
  let useExactChip = false;
1171
- if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0) {
1182
+ if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0 && !hasExplicitBaseLightnessAnchor(themeType, options)) {
1172
1183
  const range = resolveBaseLightnessClampRange(themeType, options);
1173
1184
  if (chipOKLCH.l >= range[0] && chipOKLCH.l <= range[1]) {
1174
1185
  const chipFg = pickAccentForegroundPair(
package/dist/cli.js CHANGED
@@ -1147,6 +1147,17 @@ function constrainAccentVariantVsSurface(themeType, variant, foreground, contras
1147
1147
  }
1148
1148
  return v;
1149
1149
  }
1150
+ function hasExplicitBaseLightnessAnchor(themeType, options) {
1151
+ if (!options) return false;
1152
+ const global = extractGlobalThemeAdjustments(
1153
+ options
1154
+ );
1155
+ if (global.baseLightness !== void 0 || global.lightness !== void 0) {
1156
+ return true;
1157
+ }
1158
+ const branch = themeType === "light" ? options.light : options.dark;
1159
+ return branch?.baseLightness !== void 0 || branch?.lightness !== void 0;
1160
+ }
1150
1161
  function expandColorToScale(color, themeType, options) {
1151
1162
  const {
1152
1163
  baselineLValueDark,
@@ -1176,7 +1187,7 @@ function expandColorToScale(color, themeType, options) {
1176
1187
  const isSurfaceScale = baselineLValueLight !== void 0 || baselineLValueDark !== void 0;
1177
1188
  const rawHueShift = themeAdjustments.hueShift ?? 0;
1178
1189
  let useExactChip = false;
1179
- if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0) {
1190
+ if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0 && !hasExplicitBaseLightnessAnchor(themeType, options)) {
1180
1191
  const range = resolveBaseLightnessClampRange(themeType, options);
1181
1192
  if (chipOKLCH.l >= range[0] && chipOKLCH.l <= range[1]) {
1182
1193
  const chipFg = pickAccentForegroundPair(
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  hextimate,
7
7
  parse,
8
8
  simulateColor
9
- } from "./chunk-ZUOHHUCY.js";
9
+ } from "./chunk-64DBUA5U.js";
10
10
  import {
11
11
  presets_exports
12
12
  } from "./chunk-TEZ2I4CJ.js";
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hextimate
3
- } from "./chunk-ZUOHHUCY.js";
3
+ } from "./chunk-64DBUA5U.js";
4
4
  import "./chunk-TEZ2I4CJ.js";
5
5
 
6
6
  // src/react/hextimator-provider.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hextimator",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
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",