@udixio/theme 1.2.0 → 1.3.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bin.cjs +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/browser.cjs +3 -4
  5. package/dist/browser.js +11 -12
  6. package/dist/color/color.manager.d.ts.map +1 -1
  7. package/dist/color/default-color.d.ts.map +1 -1
  8. package/dist/{define-config-CGG8l3fb.js → define-config-B1QPKKY_.js} +32 -2
  9. package/dist/{define-config-BFo7Sy7c.cjs → define-config-BGgVazsr.cjs} +32 -2
  10. package/dist/{load-from-path-CFpw2P_Y.js → load-from-path-BSrT4DOj.js} +1 -1
  11. package/dist/{load-from-path-BvdfXUD0.cjs → load-from-path-BuN8RpOs.cjs} +2 -2
  12. package/dist/loader/loader.d.ts.map +1 -1
  13. package/dist/{loader-C_BIrsO2.js → loader-Bc0bstAD.js} +129 -119
  14. package/dist/{loader-TksB6_mM.cjs → loader-YNN5hAF3.cjs} +121 -111
  15. package/dist/material-color-utilities/dynamic_color.d.ts +9 -15
  16. package/dist/material-color-utilities/dynamic_color.d.ts.map +1 -1
  17. package/dist/material-color-utilities/toneDeltaPair.d.ts +9 -2
  18. package/dist/material-color-utilities/toneDeltaPair.d.ts.map +1 -1
  19. package/dist/node.cjs +4 -5
  20. package/dist/node.js +13 -14
  21. package/dist/theme/scheme.d.ts +1 -1
  22. package/dist/theme/scheme.d.ts.map +1 -1
  23. package/dist/theme/variants/fidelity.variant.d.ts +3 -0
  24. package/dist/theme/variants/fidelity.variant.d.ts.map +1 -0
  25. package/dist/theme/variants/index.d.ts +1 -0
  26. package/dist/theme/variants/index.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/color/color.manager.ts +10 -8
  29. package/src/color/default-color.ts +82 -34
  30. package/src/loader/loader.ts +1 -5
  31. package/src/material-color-utilities/dynamic_color.ts +18 -120
  32. package/src/material-color-utilities/toneDeltaPair.ts +91 -2
  33. package/src/theme/scheme.ts +7 -1
  34. package/src/theme/variants/fidelity.variant.ts +38 -0
  35. package/src/theme/variants/index.ts +2 -0
@@ -899,34 +899,6 @@ class Hct {
899
899
  * See the License for the specific language governing permissions and
900
900
  * limitations under the License.
901
901
  */
902
- function extendSpecVersion(originlColor, extendedColor) {
903
- return DynamicColor.fromPalette({
904
- name: originlColor.name,
905
- palette: (s) => extendedColor.palette(s),
906
- tone: (s) => extendedColor.tone(s),
907
- isBackground: originlColor.isBackground,
908
- chromaMultiplier: (s) => {
909
- const chromaMultiplier = extendedColor.chromaMultiplier;
910
- return chromaMultiplier !== void 0 ? chromaMultiplier(s) : 1;
911
- },
912
- background: (s) => {
913
- const background = extendedColor.background;
914
- return background !== void 0 ? background(s) : void 0;
915
- },
916
- secondBackground: (s) => {
917
- const secondBackground = extendedColor.secondBackground;
918
- return secondBackground !== void 0 ? secondBackground(s) : void 0;
919
- },
920
- contrastCurve: (s) => {
921
- const contrastCurve = extendedColor.contrastCurve;
922
- return contrastCurve !== void 0 ? contrastCurve(s) : void 0;
923
- },
924
- toneDeltaPair: (s) => {
925
- const toneDeltaPair = extendedColor.toneDeltaPair;
926
- return toneDeltaPair !== void 0 ? toneDeltaPair(s) : void 0;
927
- }
928
- });
929
- }
930
902
  class DynamicColor {
931
903
  /**
932
904
  * The base constructor for DynamicColor.
@@ -957,11 +929,11 @@ class DynamicColor {
957
929
  * @param contrastCurve A `ContrastCurve` object specifying how its contrast
958
930
  * against its background should behave in various contrast levels
959
931
  * options.
960
- * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
932
+ * @param adjustTone A `AdjustTone` object specifying a tone delta
961
933
  * constraint between two colors. One of them must be the color being
962
934
  * constructed.
963
935
  */
964
- constructor(name, palette, tone, isBackground, chromaMultiplier, background, secondBackground, contrastCurve, toneDeltaPair) {
936
+ constructor(name, palette, tone, isBackground, chromaMultiplier, background, secondBackground, contrastCurve, adjustTone) {
965
937
  __publicField(this, "hctCache", /* @__PURE__ */ new Map());
966
938
  this.name = name;
967
939
  this.palette = palette;
@@ -971,7 +943,7 @@ class DynamicColor {
971
943
  this.background = background;
972
944
  this.secondBackground = secondBackground;
973
945
  this.contrastCurve = contrastCurve;
974
- this.toneDeltaPair = toneDeltaPair;
946
+ this.adjustTone = adjustTone;
975
947
  if (!background && secondBackground) {
976
948
  throw new Error(
977
949
  `Color ${name} has secondBackgrounddefined, but background is not defined.`
@@ -1004,7 +976,7 @@ class DynamicColor {
1004
976
  args.background,
1005
977
  args.secondBackground,
1006
978
  args.contrastCurve,
1007
- args.toneDeltaPair
979
+ args.adjustTone
1008
980
  );
1009
981
  }
1010
982
  static getInitialToneFromBackground(background) {
@@ -1079,7 +1051,7 @@ class DynamicColor {
1079
1051
  background: this.background,
1080
1052
  secondBackground: this.secondBackground,
1081
1053
  contrastCurve: this.contrastCurve,
1082
- toneDeltaPair: this.toneDeltaPair
1054
+ adjustTone: this.adjustTone
1083
1055
  });
1084
1056
  }
1085
1057
  /**
@@ -1123,59 +1095,9 @@ class DynamicColor {
1123
1095
  * contrast level is.
1124
1096
  */
1125
1097
  getTone(scheme) {
1126
- const toneDeltaPair = this.toneDeltaPair ? this.toneDeltaPair(scheme) : void 0;
1127
- if (toneDeltaPair) {
1128
- const roleA = toneDeltaPair.roleA;
1129
- const roleB = toneDeltaPair.roleB;
1130
- const polarity = toneDeltaPair.polarity;
1131
- const constraint = toneDeltaPair.constraint;
1132
- const absoluteDelta = polarity === "darker" || polarity === "relative_lighter" && scheme.isDark || polarity === "relative_darker" && !scheme.isDark ? -toneDeltaPair.delta : toneDeltaPair.delta;
1133
- const amRoleA = this.name === roleA.name;
1134
- const selfRole = amRoleA ? roleA : roleB;
1135
- const refRole = amRoleA ? roleB : roleA;
1136
- let selfTone = selfRole.tone(scheme);
1137
- const refTone = refRole.getTone(scheme);
1138
- const relativeDelta = absoluteDelta * (amRoleA ? 1 : -1);
1139
- if (constraint === "exact") {
1140
- selfTone = materialColorUtilities.clampDouble(0, 100, refTone + relativeDelta);
1141
- } else if (constraint === "nearer") {
1142
- if (relativeDelta > 0) {
1143
- selfTone = materialColorUtilities.clampDouble(
1144
- 0,
1145
- 100,
1146
- materialColorUtilities.clampDouble(refTone, refTone + relativeDelta, selfTone)
1147
- );
1148
- } else {
1149
- selfTone = materialColorUtilities.clampDouble(
1150
- 0,
1151
- 100,
1152
- materialColorUtilities.clampDouble(refTone + relativeDelta, refTone, selfTone)
1153
- );
1154
- }
1155
- } else if (constraint === "farther") {
1156
- if (relativeDelta > 0) {
1157
- selfTone = materialColorUtilities.clampDouble(refTone + relativeDelta, 100, selfTone);
1158
- } else {
1159
- selfTone = materialColorUtilities.clampDouble(0, refTone + relativeDelta, selfTone);
1160
- }
1161
- }
1162
- if (this.background && this.contrastCurve) {
1163
- const background = this.background(scheme);
1164
- const contrastCurve = this.contrastCurve(scheme);
1165
- if (background && contrastCurve) {
1166
- const bgTone = background.getTone(scheme);
1167
- const selfContrast = contrastCurve.get(scheme.contrastLevel);
1168
- selfTone = materialColorUtilities.Contrast.ratioOfTones(bgTone, selfTone) >= selfContrast && scheme.contrastLevel >= 0 ? selfTone : DynamicColor.foregroundTone(bgTone, selfContrast);
1169
- }
1170
- }
1171
- if (this.isBackground && !this.name.endsWith("_fixed_dim")) {
1172
- if (selfTone >= 57) {
1173
- selfTone = materialColorUtilities.clampDouble(65, 100, selfTone);
1174
- } else {
1175
- selfTone = materialColorUtilities.clampDouble(0, 49, selfTone);
1176
- }
1177
- }
1178
- return selfTone;
1098
+ const adjustTone = this.adjustTone ? this.adjustTone(scheme) : void 0;
1099
+ if (adjustTone) {
1100
+ return adjustTone({ scheme, dynamicColor: this });
1179
1101
  } else {
1180
1102
  let answer = this.tone(scheme);
1181
1103
  if (this.background == void 0 || this.background(scheme) === void 0 || this.contrastCurve == void 0 || this.contrastCurve(scheme) === void 0) {
@@ -1275,7 +1197,66 @@ class ToneDeltaPair {
1275
1197
  this.constraint = constraint;
1276
1198
  this.constraint = constraint ?? "exact";
1277
1199
  }
1200
+ adjustedTone({
1201
+ scheme,
1202
+ dynamicColor
1203
+ }) {
1204
+ const roleA = this.roleA;
1205
+ const roleB = this.roleB;
1206
+ const polarity = this.polarity;
1207
+ const constraint = this.constraint;
1208
+ const absoluteDelta = polarity === "darker" || polarity === "relative_lighter" && scheme.isDark || polarity === "relative_darker" && !scheme.isDark ? -this.delta : this.delta;
1209
+ const amRoleA = dynamicColor.name === roleA.name;
1210
+ const selfRole = amRoleA ? roleA : roleB;
1211
+ const refRole = amRoleA ? roleB : roleA;
1212
+ let selfTone = selfRole.tone(scheme);
1213
+ const refTone = refRole.getTone(scheme);
1214
+ const relativeDelta = absoluteDelta * (amRoleA ? 1 : -1);
1215
+ if (constraint === "exact") {
1216
+ selfTone = materialColorUtilities.clampDouble(0, 100, refTone + relativeDelta);
1217
+ } else if (constraint === "nearer") {
1218
+ if (relativeDelta > 0) {
1219
+ selfTone = materialColorUtilities.clampDouble(
1220
+ 0,
1221
+ 100,
1222
+ materialColorUtilities.clampDouble(refTone, refTone + relativeDelta, selfTone)
1223
+ );
1224
+ } else {
1225
+ selfTone = materialColorUtilities.clampDouble(
1226
+ 0,
1227
+ 100,
1228
+ materialColorUtilities.clampDouble(refTone + relativeDelta, refTone, selfTone)
1229
+ );
1230
+ }
1231
+ } else if (constraint === "farther") {
1232
+ if (relativeDelta > 0) {
1233
+ selfTone = materialColorUtilities.clampDouble(refTone + relativeDelta, 100, selfTone);
1234
+ } else {
1235
+ selfTone = materialColorUtilities.clampDouble(0, refTone + relativeDelta, selfTone);
1236
+ }
1237
+ }
1238
+ if (dynamicColor.background && dynamicColor.contrastCurve) {
1239
+ const background = dynamicColor.background(scheme);
1240
+ const contrastCurve = dynamicColor.contrastCurve(scheme);
1241
+ if (background && contrastCurve) {
1242
+ const bgTone = background.getTone(scheme);
1243
+ const selfContrast = contrastCurve.get(scheme.contrastLevel);
1244
+ selfTone = materialColorUtilities.Contrast.ratioOfTones(bgTone, selfTone) >= selfContrast && scheme.contrastLevel >= 0 ? selfTone : DynamicColor.foregroundTone(bgTone, selfContrast);
1245
+ }
1246
+ }
1247
+ if (dynamicColor.isBackground && !dynamicColor.name.endsWith("_fixed_dim")) {
1248
+ if (selfTone >= 57) {
1249
+ selfTone = materialColorUtilities.clampDouble(65, 100, selfTone);
1250
+ } else {
1251
+ selfTone = materialColorUtilities.clampDouble(0, 49, selfTone);
1252
+ }
1253
+ }
1254
+ return selfTone;
1255
+ }
1278
1256
  }
1257
+ const toneDeltaPair = (...params) => {
1258
+ return (args) => new ToneDeltaPair(...params).adjustedTone(args);
1259
+ };
1279
1260
  function argbToRgb(argb) {
1280
1261
  return {
1281
1262
  r: argb >> 16 & 255,
@@ -1454,7 +1435,7 @@ class ColorManager {
1454
1435
  isBackground: true,
1455
1436
  background: (s) => highestSurface(s, this),
1456
1437
  contrastCurve: (s) => getCurve(4.5),
1457
- toneDeltaPair: (s) => new ToneDeltaPair(
1438
+ adjustTone: (s) => toneDeltaPair(
1458
1439
  this.get(colorContainerKey).getMaterialColor(),
1459
1440
  this.get(colorKey).getMaterialColor(),
1460
1441
  5,
@@ -1475,7 +1456,7 @@ class ColorManager {
1475
1456
  isBackground: true,
1476
1457
  background: (s) => this.get("surfaceContainerHigh").getMaterialColor(),
1477
1458
  contrastCurve: (s) => getCurve(4.5),
1478
- toneDeltaPair: (s) => new ToneDeltaPair(
1459
+ adjustTone: (s) => toneDeltaPair(
1479
1460
  this.get(colorDimKey).getMaterialColor(),
1480
1461
  this.get(colorKey).getMaterialColor(),
1481
1462
  5,
@@ -1502,7 +1483,7 @@ class ColorManager {
1502
1483
  },
1503
1484
  isBackground: true,
1504
1485
  background: (s) => highestSurface(s, this),
1505
- toneDeltaPair: (s) => void 0,
1486
+ adjustTone: (s) => void 0,
1506
1487
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
1507
1488
  });
1508
1489
  this.createOrUpdate(onColorContainerKey, {
@@ -1524,7 +1505,7 @@ class ColorManager {
1524
1505
  palette: (s) => s.getPalette(colorKey),
1525
1506
  tone: (s) => this.get(colorFixedKey).getMaterialColor().getTone(s),
1526
1507
  isBackground: true,
1527
- toneDeltaPair: (s) => new ToneDeltaPair(
1508
+ adjustTone: (s) => toneDeltaPair(
1528
1509
  this.get(colorFixedDimKey).getMaterialColor(),
1529
1510
  this.get(colorFixedKey).getMaterialColor(),
1530
1511
  5,
@@ -1791,6 +1772,9 @@ const tonalSpotVariant = {
1791
1772
  },
1792
1773
  customPalettes: ({ colorHct }) => materialColorUtilities.TonalPalette.fromHueAndChroma(colorHct.hue, 16)
1793
1774
  };
1775
+ const inverseTone = (tone) => {
1776
+ return 100 - tone;
1777
+ };
1794
1778
  const defaultColors = (colorService) => {
1795
1779
  const getColor = (key) => {
1796
1780
  return colorService.getColor(key).getMaterialColor();
@@ -1805,6 +1789,9 @@ const defaultColors = (colorService) => {
1805
1789
  if (s.isDark) {
1806
1790
  return 4;
1807
1791
  } else {
1792
+ if (s.variant == "fidelity") {
1793
+ return 100;
1794
+ }
1808
1795
  if (Hct.isYellow(s.getPalette("neutral").hue)) {
1809
1796
  return 99;
1810
1797
  } else if (s.variant === "vibrant") {
@@ -2100,6 +2087,8 @@ const defaultColors = (colorService) => {
2100
2087
  0,
2101
2088
  Hct.isYellow(s.getPalette("primary").hue) ? 25 : Hct.isCyan(s.getPalette("primary").hue) ? 88 : 98
2102
2089
  );
2090
+ } else if (s.variant == "fidelity") {
2091
+ return s.sourceColorHct.tone;
2103
2092
  } else {
2104
2093
  return tMaxC(
2105
2094
  s.getPalette("primary"),
@@ -2111,7 +2100,18 @@ const defaultColors = (colorService) => {
2111
2100
  isBackground: true,
2112
2101
  background: (s) => highestSurface(s, colorService),
2113
2102
  contrastCurve: (s) => getCurve(4.5),
2114
- toneDeltaPair: (s) => new ToneDeltaPair(
2103
+ adjustTone: (s) => s.variant == "fidelity" ? () => {
2104
+ const surfaceTone = colorService.getColor("surface").getMaterialColor().tone(s);
2105
+ const primaryTone = colorService.getColor("primary").getMaterialColor().tone(s);
2106
+ let selfTone = primaryTone;
2107
+ if (materialColorUtilities.Contrast.ratioOfTones(surfaceTone, selfTone) < 3) {
2108
+ const result = inverseTone(primaryTone);
2109
+ if (materialColorUtilities.Contrast.ratioOfTones(surfaceTone, result) >= 3) {
2110
+ selfTone = result;
2111
+ }
2112
+ }
2113
+ return selfTone;
2114
+ } : toneDeltaPair(
2115
2115
  colorService.getColor("primaryContainer").getMaterialColor(),
2116
2116
  colorService.getColor("primary").getMaterialColor(),
2117
2117
  5,
@@ -2134,7 +2134,7 @@ const defaultColors = (colorService) => {
2134
2134
  isBackground: true,
2135
2135
  background: (s) => getColor("surfaceContainerHigh"),
2136
2136
  contrastCurve: (s) => getCurve(4.5),
2137
- toneDeltaPair: (s) => new ToneDeltaPair(
2137
+ adjustTone: (s) => toneDeltaPair(
2138
2138
  colorService.getColor("primaryDim").getMaterialColor(),
2139
2139
  colorService.getColor("primary").getMaterialColor(),
2140
2140
  5,
@@ -2161,6 +2161,13 @@ const defaultColors = (colorService) => {
2161
2161
  78,
2162
2162
  Hct.isCyan(s.getPalette("primary").hue) ? 88 : 90
2163
2163
  );
2164
+ }
2165
+ if (s.variant == "fidelity") {
2166
+ return s.isDark ? tMaxC(s.getPalette("primary"), 30, 93) : tMaxC(
2167
+ s.getPalette("primary"),
2168
+ 78,
2169
+ Hct.isCyan(s.getPalette("primary").hue) ? 88 : 90
2170
+ );
2164
2171
  } else {
2165
2172
  return s.isDark ? tMinC(s.getPalette("primary"), 66, 93) : tMaxC(
2166
2173
  s.getPalette("primary"),
@@ -2171,7 +2178,14 @@ const defaultColors = (colorService) => {
2171
2178
  },
2172
2179
  isBackground: true,
2173
2180
  background: (s) => highestSurface(s, colorService),
2174
- toneDeltaPair: (s) => void 0,
2181
+ adjustTone: (s) => s.variant == "fidelity" ? toneDeltaPair(
2182
+ colorService.getColor("primary").getMaterialColor(),
2183
+ colorService.getColor("primaryContainer").getMaterialColor(),
2184
+ 15,
2185
+ "relative_darker",
2186
+ true,
2187
+ "farther"
2188
+ ) : void 0,
2175
2189
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2176
2190
  },
2177
2191
  onPrimaryContainer: {
@@ -2197,7 +2211,7 @@ const defaultColors = (colorService) => {
2197
2211
  palette: (s) => s.getPalette("primary"),
2198
2212
  tone: (s) => colorService.getColor("primaryFixed").getMaterialColor().getTone(s),
2199
2213
  isBackground: true,
2200
- toneDeltaPair: (s) => new ToneDeltaPair(
2214
+ adjustTone: (s) => toneDeltaPair(
2201
2215
  getColor("primaryFixedDim"),
2202
2216
  getColor("primaryFixed"),
2203
2217
  5,
@@ -2239,7 +2253,7 @@ const defaultColors = (colorService) => {
2239
2253
  isBackground: true,
2240
2254
  background: (s) => highestSurface(s, colorService),
2241
2255
  contrastCurve: (s) => getCurve(4.5),
2242
- toneDeltaPair: (s) => new ToneDeltaPair(
2256
+ adjustTone: (s) => toneDeltaPair(
2243
2257
  getColor("secondaryContainer"),
2244
2258
  getColor("secondary"),
2245
2259
  5,
@@ -2260,7 +2274,7 @@ const defaultColors = (colorService) => {
2260
2274
  isBackground: true,
2261
2275
  background: (s) => getColor("surfaceContainerHigh"),
2262
2276
  contrastCurve: (s) => getCurve(4.5),
2263
- toneDeltaPair: (s) => new ToneDeltaPair(
2277
+ adjustTone: (s) => toneDeltaPair(
2264
2278
  getColor("secondaryDim"),
2265
2279
  getColor("secondary"),
2266
2280
  5,
@@ -2287,7 +2301,7 @@ const defaultColors = (colorService) => {
2287
2301
  },
2288
2302
  isBackground: true,
2289
2303
  background: (s) => highestSurface(s, colorService),
2290
- toneDeltaPair: (s) => void 0,
2304
+ adjustTone: (s) => void 0,
2291
2305
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2292
2306
  },
2293
2307
  onSecondaryContainer: {
@@ -2313,7 +2327,7 @@ const defaultColors = (colorService) => {
2313
2327
  palette: (s) => s.getPalette("secondary"),
2314
2328
  tone: (s) => getColor("secondaryFixed").getTone(s),
2315
2329
  isBackground: true,
2316
- toneDeltaPair: (s) => new ToneDeltaPair(
2330
+ adjustTone: (s) => toneDeltaPair(
2317
2331
  getColor("secondaryFixedDim"),
2318
2332
  getColor("secondaryFixed"),
2319
2333
  5,
@@ -2351,7 +2365,7 @@ const defaultColors = (colorService) => {
2351
2365
  isBackground: true,
2352
2366
  background: (s) => highestSurface(s, colorService),
2353
2367
  contrastCurve: (s) => getCurve(4.5),
2354
- toneDeltaPair: (s) => new ToneDeltaPair(
2368
+ adjustTone: (s) => toneDeltaPair(
2355
2369
  getColor("tertiaryContainer"),
2356
2370
  getColor("tertiary"),
2357
2371
  5,
@@ -2372,7 +2386,7 @@ const defaultColors = (colorService) => {
2372
2386
  isBackground: true,
2373
2387
  background: (s) => getColor("surfaceContainerHigh"),
2374
2388
  contrastCurve: (s) => getCurve(4.5),
2375
- toneDeltaPair: (s) => new ToneDeltaPair(
2389
+ adjustTone: (s) => toneDeltaPair(
2376
2390
  getColor("tertiaryDim"),
2377
2391
  getColor("tertiary"),
2378
2392
  5,
@@ -2405,7 +2419,7 @@ const defaultColors = (colorService) => {
2405
2419
  },
2406
2420
  isBackground: true,
2407
2421
  background: (s) => highestSurface(s, colorService),
2408
- toneDeltaPair: (s) => void 0,
2422
+ adjustTone: (s) => void 0,
2409
2423
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2410
2424
  },
2411
2425
  onTertiaryContainer: {
@@ -2431,7 +2445,7 @@ const defaultColors = (colorService) => {
2431
2445
  palette: (s) => s.getPalette("tertiary"),
2432
2446
  tone: (s) => getColor("tertiaryFixed").getTone(s),
2433
2447
  isBackground: true,
2434
- toneDeltaPair: (s) => new ToneDeltaPair(
2448
+ adjustTone: (s) => toneDeltaPair(
2435
2449
  getColor("tertiaryFixedDim"),
2436
2450
  getColor("tertiaryFixed"),
2437
2451
  5,
@@ -2461,7 +2475,7 @@ const defaultColors = (colorService) => {
2461
2475
  isBackground: true,
2462
2476
  background: (s) => highestSurface(s, colorService),
2463
2477
  contrastCurve: (s) => getCurve(4.5),
2464
- toneDeltaPair: (s) => new ToneDeltaPair(
2478
+ adjustTone: (s) => toneDeltaPair(
2465
2479
  colorService.getColor("errorContainer").getMaterialColor(),
2466
2480
  colorService.getColor("error").getMaterialColor(),
2467
2481
  5,
@@ -2476,7 +2490,7 @@ const defaultColors = (colorService) => {
2476
2490
  isBackground: true,
2477
2491
  background: (s) => getColor("surfaceContainerHigh"),
2478
2492
  contrastCurve: (s) => getCurve(4.5),
2479
- toneDeltaPair: (s) => new ToneDeltaPair(
2493
+ adjustTone: (s) => toneDeltaPair(
2480
2494
  getColor("errorDim"),
2481
2495
  getColor("error"),
2482
2496
  5,
@@ -2497,7 +2511,7 @@ const defaultColors = (colorService) => {
2497
2511
  },
2498
2512
  isBackground: true,
2499
2513
  background: (s) => highestSurface(s, colorService),
2500
- toneDeltaPair: (s) => void 0,
2514
+ adjustTone: (s) => void 0,
2501
2515
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2502
2516
  },
2503
2517
  onErrorContainer: {
@@ -2647,11 +2661,8 @@ const loader = async (config) => {
2647
2661
  api.plugins.initPlugins(api);
2648
2662
  }
2649
2663
  };
2650
- const load = async () => {
2651
- await api.plugins.loadPlugins();
2652
- };
2653
2664
  init();
2654
- await load();
2665
+ await api.load();
2655
2666
  return api;
2656
2667
  };
2657
2668
  exports.API = API;
@@ -2670,15 +2681,14 @@ exports.Scheme = Scheme;
2670
2681
  exports.SchemeManager = SchemeManager;
2671
2682
  exports.ThemeApi = ThemeApi;
2672
2683
  exports.ThemeModule = ThemeModule;
2673
- exports.ToneDeltaPair = ToneDeltaPair;
2674
2684
  exports.Variant = Variant;
2675
2685
  exports.VariantManager = VariantManager;
2676
2686
  exports.bootstrap = bootstrap;
2677
2687
  exports.defaultColors = defaultColors;
2678
- exports.extendSpecVersion = extendSpecVersion;
2679
2688
  exports.getPiecewiseHue = getPiecewiseHue;
2680
2689
  exports.getRotatedHue = getRotatedHue;
2681
2690
  exports.highestSurface = highestSurface;
2682
2691
  exports.loader = loader;
2683
2692
  exports.registerModule = registerModule;
2684
2693
  exports.tonalSpotVariant = tonalSpotVariant;
2694
+ exports.toneDeltaPair = toneDeltaPair;
@@ -1,6 +1,5 @@
1
1
  import { TonalPalette } from '@material/material-color-utilities';
2
2
  import { ContrastCurve } from './contrastCurve';
3
- import { ToneDeltaPair } from './toneDeltaPair';
4
3
  import { Scheme } from '../theme/scheme';
5
4
  import { Hct } from './htc';
6
5
  /**
@@ -24,7 +23,7 @@ import { Hct } from './htc';
24
23
  * against its background should behave in various contrast levels options.
25
24
  * Must used together with `background`. When not provided or resolved as
26
25
  * undefined, the contrast curve is calculated based on other constraints.
27
- * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
26
+ * @param adjustTone A `AdjustTone` object specifying a tone delta
28
27
  * constraint between two colors. One of them must be the color being
29
28
  * constructed. When not provided or resolved as undefined, the tone is
30
29
  * calculated based on other constraints.
@@ -38,17 +37,12 @@ export interface FromPaletteOptions {
38
37
  background?: (scheme: Scheme) => DynamicColor | undefined;
39
38
  secondBackground?: (scheme: Scheme) => DynamicColor | undefined;
40
39
  contrastCurve?: (scheme: Scheme) => ContrastCurve | undefined;
41
- toneDeltaPair?: (scheme: Scheme) => ToneDeltaPair | undefined;
40
+ adjustTone?: (scheme: Scheme) => AdjustTone | undefined;
42
41
  }
43
- /**
44
- * Returns a new DynamicColor that is the same as the original color, but with
45
- * the extended dynamic color's constraints for the given spec version.
46
- *
47
- * @param originlColor The original color.
48
- * @param specVersion The spec version to extend.
49
- * @param extendedColor The color with the values to extend.
50
- */
51
- export declare function extendSpecVersion(originlColor: DynamicColor, extendedColor: DynamicColor): DynamicColor;
42
+ export type AdjustTone = (args: {
43
+ scheme: Scheme;
44
+ dynamicColor: DynamicColor;
45
+ }) => number;
52
46
  /**
53
47
  * A color that adjusts itself based on UI state provided by DynamicScheme.
54
48
  *
@@ -69,7 +63,7 @@ export declare class DynamicColor {
69
63
  readonly background?: ((scheme: Scheme) => DynamicColor | undefined) | undefined;
70
64
  readonly secondBackground?: ((scheme: Scheme) => DynamicColor | undefined) | undefined;
71
65
  readonly contrastCurve?: ((scheme: Scheme) => ContrastCurve | undefined) | undefined;
72
- readonly toneDeltaPair?: ((scheme: Scheme) => ToneDeltaPair | undefined) | undefined;
66
+ readonly adjustTone?: ((scheme: Scheme) => AdjustTone | undefined) | undefined;
73
67
  private readonly hctCache;
74
68
  /**
75
69
  * The base constructor for DynamicColor.
@@ -100,11 +94,11 @@ export declare class DynamicColor {
100
94
  * @param contrastCurve A `ContrastCurve` object specifying how its contrast
101
95
  * against its background should behave in various contrast levels
102
96
  * options.
103
- * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
97
+ * @param adjustTone A `AdjustTone` object specifying a tone delta
104
98
  * constraint between two colors. One of them must be the color being
105
99
  * constructed.
106
100
  */
107
- constructor(name: string, palette: (scheme: Scheme) => TonalPalette, tone: (scheme: Scheme) => number, isBackground: boolean, chromaMultiplier?: ((scheme: Scheme) => number) | undefined, background?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, secondBackground?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, contrastCurve?: ((scheme: Scheme) => ContrastCurve | undefined) | undefined, toneDeltaPair?: ((scheme: Scheme) => ToneDeltaPair | undefined) | undefined);
101
+ constructor(name: string, palette: (scheme: Scheme) => TonalPalette, tone: (scheme: Scheme) => number, isBackground: boolean, chromaMultiplier?: ((scheme: Scheme) => number) | undefined, background?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, secondBackground?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, contrastCurve?: ((scheme: Scheme) => ContrastCurve | undefined) | undefined, adjustTone?: ((scheme: Scheme) => AdjustTone | undefined) | undefined);
108
102
  /**
109
103
  * Create a DynamicColor defined by a TonalPalette and HCT tone.
110
104
  *
@@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D;;;OAGG;IACH,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIvD;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAUlD;;OAEG;IACH,KAAK,IAAI,YAAY;IAcrB;;;OAGG;IACH,UAAU;IAIV;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI/B;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;IAW3B;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CA6FhC"}
@@ -1,4 +1,5 @@
1
- import { DynamicColor } from './dynamic_color';
1
+ import { AdjustTone, DynamicColor } from './dynamic_color';
2
+ import { Scheme } from '../theme';
2
3
  /**
3
4
  * Describes the different in tone between colors.
4
5
  *
@@ -17,7 +18,7 @@ export type DeltaConstraint = 'exact' | 'nearer' | 'farther';
17
18
  * designers want tonal distance, literally contrast, between two colors that
18
19
  * don't have a background / foreground relationship or a contrast guarantee.
19
20
  */
20
- export declare class ToneDeltaPair {
21
+ declare class ToneDeltaPair {
21
22
  readonly roleA: DynamicColor;
22
23
  readonly roleB: DynamicColor;
23
24
  readonly delta: number;
@@ -50,5 +51,11 @@ export declare class ToneDeltaPair {
50
51
  * one role has two backgrounds.
51
52
  */
52
53
  constructor(roleA: DynamicColor, roleB: DynamicColor, delta: number, polarity: TonePolarity, stayTogether: boolean, constraint?: DeltaConstraint | undefined);
54
+ adjustedTone({ scheme, dynamicColor, }: {
55
+ scheme: Scheme;
56
+ dynamicColor: DynamicColor;
57
+ }): number;
53
58
  }
59
+ export declare const toneDeltaPair: (...params: ConstructorParameters<typeof ToneDeltaPair>) => AdjustTone;
60
+ export {};
54
61
  //# sourceMappingURL=toneDeltaPair.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toneDeltaPair.d.ts","sourceRoot":"","sources":["../../src/material-color-utilities/toneDeltaPair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D;;;;;;;GAOG;AACH,qBAAa,aAAa;IA2BtB,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAC/B,QAAQ,CAAC,YAAY,EAAE,OAAO;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe;IA/BvC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;gBAEQ,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,OAAO,EACrB,UAAU,CAAC,EAAE,eAAe,YAAA;CAIxC"}
1
+ {"version":3,"file":"toneDeltaPair.d.ts","sourceRoot":"","sources":["../../src/material-color-utilities/toneDeltaPair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D;;;;;;;GAOG;AACH,cAAM,aAAa;IA2Bf,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAC/B,QAAQ,CAAC,YAAY,EAAE,OAAO;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe;IA/BvC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;gBAEQ,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,OAAO,EACrB,UAAU,CAAC,EAAE,eAAe,YAAA;IAKvC,YAAY,CAAC,EACX,MAAM,EACN,YAAY,GACb,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,YAAY,CAAC;KAC5B;CA0EF;AAED,eAAO,MAAM,aAAa,GACxB,GAAG,QAAQ,qBAAqB,CAAC,OAAO,aAAa,CAAC,KACrD,UAEF,CAAC"}
package/dist/node.cjs CHANGED
@@ -22,9 +22,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const loader = require("./loader-TksB6_mM.cjs");
26
- const defineConfig = require("./define-config-BFo7Sy7c.cjs");
27
- const loadFromPath = require("./load-from-path-BvdfXUD0.cjs");
25
+ const loader = require("./loader-YNN5hAF3.cjs");
26
+ const defineConfig = require("./define-config-BGgVazsr.cjs");
27
+ const loadFromPath = require("./load-from-path-BuN8RpOs.cjs");
28
28
  let unpluginInstance = null;
29
29
  const createUnpluginTheme = async () => {
30
30
  if (unpluginInstance) {
@@ -162,18 +162,17 @@ exports.Scheme = loader.Scheme;
162
162
  exports.SchemeManager = loader.SchemeManager;
163
163
  exports.ThemeApi = loader.ThemeApi;
164
164
  exports.ThemeModule = loader.ThemeModule;
165
- exports.ToneDeltaPair = loader.ToneDeltaPair;
166
165
  exports.Variant = loader.Variant;
167
166
  exports.VariantManager = loader.VariantManager;
168
167
  exports.bootstrap = loader.bootstrap;
169
168
  exports.defaultColors = loader.defaultColors;
170
- exports.extendSpecVersion = loader.extendSpecVersion;
171
169
  exports.getPiecewiseHue = loader.getPiecewiseHue;
172
170
  exports.getRotatedHue = loader.getRotatedHue;
173
171
  exports.highestSurface = loader.highestSurface;
174
172
  exports.loader = loader.loader;
175
173
  exports.registerModule = loader.registerModule;
176
174
  exports.tonalSpotVariant = loader.tonalSpotVariant;
175
+ exports.toneDeltaPair = loader.toneDeltaPair;
177
176
  exports.FontFamily = defineConfig.FontFamily;
178
177
  exports.FontPlugin = defineConfig.FontPlugin;
179
178
  exports.PluginAbstract = defineConfig.PluginAbstract;
package/dist/node.js CHANGED
@@ -1,7 +1,7 @@
1
- import { b, A, a, C, c, d, e, i, D, k, P, n, S, o, m, T, V, s, g, f, j, p, q, h, l, r, t } from "./loader-C_BIrsO2.js";
2
- import { F, b as b2, P as P2, a as a2, V as V2, d as d2, e as e2, n as n2, v } from "./define-config-CGG8l3fb.js";
3
- import { l as loadFromPath } from "./load-from-path-CFpw2P_Y.js";
4
- import { r as r2 } from "./load-from-path-CFpw2P_Y.js";
1
+ import { b, A, a, C, c, d, e, i, D, j, P, m, S, n, T, V, q, g, f, o, p, h, l, r, k, t } from "./loader-Bc0bstAD.js";
2
+ import { F, b as b2, P as P2, a as a2, V as V2, d as d2, e as e2, n as n2, v } from "./define-config-B1QPKKY_.js";
3
+ import { l as loadFromPath } from "./load-from-path-BSrT4DOj.js";
4
+ import { r as r2 } from "./load-from-path-BSrT4DOj.js";
5
5
  let unpluginInstance = null;
6
6
  const createUnpluginTheme = async () => {
7
7
  if (unpluginInstance) {
@@ -137,25 +137,23 @@ export {
137
137
  F as FontFamily,
138
138
  b2 as FontPlugin,
139
139
  P2 as PluginAbstract,
140
- k as PluginApi,
140
+ j as PluginApi,
141
141
  a2 as PluginImplAbstract,
142
142
  P as PluginModule,
143
- n as Scheme,
143
+ m as Scheme,
144
144
  S as SchemeManager,
145
- o as ThemeApi,
146
- m as ThemeModule,
147
- T as ToneDeltaPair,
145
+ n as ThemeApi,
146
+ T as ThemeModule,
148
147
  V as Variant,
149
- s as VariantManager,
148
+ q as VariantManager,
150
149
  V2 as Variants,
151
150
  g as bootstrap,
152
151
  f as defaultColors,
153
152
  d2 as defineConfig,
154
153
  esbuildPlugin,
155
154
  e2 as expressiveVariant,
156
- j as extendSpecVersion,
157
- p as getPiecewiseHue,
158
- q as getRotatedHue,
155
+ o as getPiecewiseHue,
156
+ p as getRotatedHue,
159
157
  h as highestSurface,
160
158
  loadFromPath,
161
159
  l as loader,
@@ -163,7 +161,8 @@ export {
163
161
  r as registerModule,
164
162
  r2 as resolveConfig,
165
163
  rollupPlugin,
166
- t as tonalSpotVariant,
164
+ k as tonalSpotVariant,
165
+ t as toneDeltaPair,
167
166
  unpluginUdixioTheme,
168
167
  v as vibrantVariant,
169
168
  vitePlugin,
@@ -11,7 +11,7 @@ export interface SchemeOptions {
11
11
  export declare class Scheme {
12
12
  readonly options: SchemeOptions;
13
13
  constructor(options: SchemeOptions);
14
- get variant(): 'expressive' | 'neutral' | 'tonalSpot' | 'vibrant' | string;
14
+ get variant(): 'expressive' | 'neutral' | 'tonalSpot' | 'vibrant' | 'fidelity' | string;
15
15
  get contrastLevel(): number;
16
16
  get isDark(): boolean;
17
17
  get sourceColorHct(): Hct;