@terrazzo/plugin-css 0.9.0 → 0.9.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/dist/index.js CHANGED
@@ -255,28 +255,28 @@ const modes = {};
255
255
  const parsers = [];
256
256
  const colorProfiles = {};
257
257
  const identity = (v) => v;
258
- const useMode = (definition$15) => {
259
- converters$1[definition$15.mode] = {
260
- ...converters$1[definition$15.mode],
261
- ...definition$15.toMode
258
+ const useMode = (definition$16) => {
259
+ converters$1[definition$16.mode] = {
260
+ ...converters$1[definition$16.mode],
261
+ ...definition$16.toMode
262
262
  };
263
- Object.keys(definition$15.fromMode || {}).forEach((k$2) => {
264
- if (!converters$1[k$2]) converters$1[k$2] = {};
265
- converters$1[k$2][definition$15.mode] = definition$15.fromMode[k$2];
263
+ Object.keys(definition$16.fromMode || {}).forEach((k$3) => {
264
+ if (!converters$1[k$3]) converters$1[k$3] = {};
265
+ converters$1[k$3][definition$16.mode] = definition$16.fromMode[k$3];
266
266
  });
267
- if (!definition$15.ranges) definition$15.ranges = {};
268
- if (!definition$15.difference) definition$15.difference = {};
269
- definition$15.channels.forEach((channel) => {
270
- if (definition$15.ranges[channel] === void 0) definition$15.ranges[channel] = [0, 1];
271
- if (!definition$15.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
272
- if (typeof definition$15.interpolate[channel] === "function") definition$15.interpolate[channel] = { use: definition$15.interpolate[channel] };
273
- if (!definition$15.interpolate[channel].fixup) definition$15.interpolate[channel].fixup = identity;
267
+ if (!definition$16.ranges) definition$16.ranges = {};
268
+ if (!definition$16.difference) definition$16.difference = {};
269
+ definition$16.channels.forEach((channel) => {
270
+ if (definition$16.ranges[channel] === void 0) definition$16.ranges[channel] = [0, 1];
271
+ if (!definition$16.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
272
+ if (typeof definition$16.interpolate[channel] === "function") definition$16.interpolate[channel] = { use: definition$16.interpolate[channel] };
273
+ if (!definition$16.interpolate[channel].fixup) definition$16.interpolate[channel].fixup = identity;
274
274
  });
275
- modes[definition$15.mode] = definition$15;
276
- (definition$15.parse || []).forEach((parser) => {
277
- useParser(parser, definition$15.mode);
275
+ modes[definition$16.mode] = definition$16;
276
+ (definition$16.parse || []).forEach((parser) => {
277
+ useParser(parser, definition$16.mode);
278
278
  });
279
- return converter_default(definition$15.mode);
279
+ return converter_default(definition$16.mode);
280
280
  };
281
281
  const getMode = (mode) => modes[mode];
282
282
  const useParser = (parser, mode) => {
@@ -615,7 +615,7 @@ const fixupAlpha = (arr) => {
615
615
 
616
616
  //#endregion
617
617
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/definition.js
618
- const definition$14 = {
618
+ const definition$15 = {
619
619
  mode: "rgb",
620
620
  channels: [
621
621
  "r",
@@ -653,7 +653,7 @@ const definition$14 = {
653
653
  b: 0
654
654
  }
655
655
  };
656
- var definition_default$12 = definition$14;
656
+ var definition_default$13 = definition$15;
657
657
 
658
658
  //#endregion
659
659
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/convertA98ToXyz65.js
@@ -693,7 +693,7 @@ var convertXyz65ToA98_default = convertXyz65ToA98;
693
693
 
694
694
  //#endregion
695
695
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/convertRgbToLrgb.js
696
- const fn$2 = (c$1 = 0) => {
696
+ const fn$3 = (c$1 = 0) => {
697
697
  const abs = Math.abs(c$1);
698
698
  if (abs <= .04045) return c$1 / 12.92;
699
699
  return (Math.sign(c$1) || 1) * Math.pow((abs + .055) / 1.055, 2.4);
@@ -701,9 +701,9 @@ const fn$2 = (c$1 = 0) => {
701
701
  const convertRgbToLrgb = ({ r: r$1, g, b, alpha }) => {
702
702
  let res = {
703
703
  mode: "lrgb",
704
- r: fn$2(r$1),
705
- g: fn$2(g),
706
- b: fn$2(b)
704
+ r: fn$3(r$1),
705
+ g: fn$3(g),
706
+ b: fn$3(b)
707
707
  };
708
708
  if (alpha !== void 0) res.alpha = alpha;
709
709
  return res;
@@ -727,7 +727,7 @@ var convertRgbToXyz65_default = convertRgbToXyz65;
727
727
 
728
728
  //#endregion
729
729
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/convertLrgbToRgb.js
730
- const fn$1 = (c$1 = 0) => {
730
+ const fn$2 = (c$1 = 0) => {
731
731
  const abs = Math.abs(c$1);
732
732
  if (abs > .0031308) return (Math.sign(c$1) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
733
733
  return c$1 * 12.92;
@@ -735,9 +735,9 @@ const fn$1 = (c$1 = 0) => {
735
735
  const convertLrgbToRgb = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
736
736
  let res = {
737
737
  mode,
738
- r: fn$1(r$1),
739
- g: fn$1(g),
740
- b: fn$1(b)
738
+ r: fn$2(r$1),
739
+ g: fn$2(g),
740
+ b: fn$2(b)
741
741
  };
742
742
  if (alpha !== void 0) res.alpha = alpha;
743
743
  return res;
@@ -762,8 +762,8 @@ var convertXyz65ToRgb_default = convertXyz65ToRgb;
762
762
 
763
763
  //#endregion
764
764
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/definition.js
765
- const definition$13 = {
766
- ...definition_default$12,
765
+ const definition$14 = {
766
+ ...definition_default$13,
767
767
  mode: "a98",
768
768
  parse: ["a98-rgb"],
769
769
  serialize: "a98-rgb",
@@ -776,7 +776,7 @@ const definition$13 = {
776
776
  xyz65: convertA98ToXyz65_default
777
777
  }
778
778
  };
779
- var definition_default = definition$13;
779
+ var definition_default = definition$14;
780
780
 
781
781
  //#endregion
782
782
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/util/normalizeHue.js
@@ -917,12 +917,12 @@ var parseHsl_default = parseHsl;
917
917
 
918
918
  //#endregion
919
919
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/fixup/hue.js
920
- const hue = (hues, fn$3) => {
920
+ const hue = (hues, fn$4) => {
921
921
  return hues.map((hue$2, idx, arr) => {
922
922
  if (hue$2 === void 0) return hue$2;
923
923
  let normalized = normalizeHue_default(hue$2);
924
924
  if (idx === 0 || hues[idx - 1] === void 0) return normalized;
925
- return fn$3(normalized - normalizeHue_default(arr[idx - 1]));
925
+ return fn$4(normalized - normalizeHue_default(arr[idx - 1]));
926
926
  }).reduce((acc, curr) => {
927
927
  if (!acc.length || curr === void 0 || acc[acc.length - 1] === void 0) {
928
928
  acc.push(curr);
@@ -970,8 +970,8 @@ const differenceEuclidean = (mode = "rgb", weights = [
970
970
  return (std, smp) => {
971
971
  let ConvStd = conv(std);
972
972
  let ConvSmp = conv(smp);
973
- return Math.sqrt(channels.reduce((sum, k$2, idx) => {
974
- let delta = diffs[k$2] ? diffs[k$2](ConvStd, ConvSmp) : ConvStd[k$2] - ConvSmp[k$2];
973
+ return Math.sqrt(channels.reduce((sum, k$3, idx) => {
974
+ let delta = diffs[k$3] ? diffs[k$3](ConvStd, ConvSmp) : ConvStd[k$3] - ConvSmp[k$3];
975
975
  return sum + (weights[idx] || 0) * Math.pow(isNaN(delta) ? 0 : delta, 2);
976
976
  }, 0));
977
977
  };
@@ -997,7 +997,7 @@ const averageAngle = (val) => {
997
997
 
998
998
  //#endregion
999
999
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsl/definition.js
1000
- const definition$12 = {
1000
+ const definition$13 = {
1001
1001
  mode: "hsl",
1002
1002
  toMode: { rgb: convertHslToRgb },
1003
1003
  fromMode: { rgb: convertRgbToHsl },
@@ -1026,7 +1026,7 @@ const definition$12 = {
1026
1026
  difference: { h: differenceHueSaturation },
1027
1027
  average: { h: averageAngle }
1028
1028
  };
1029
- var definition_default$1 = definition$12;
1029
+ var definition_default$1 = definition$13;
1030
1030
 
1031
1031
  //#endregion
1032
1032
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsv/convertHsvToRgb.js
@@ -1034,19 +1034,19 @@ function convertHsvToRgb({ h, s, v, alpha }) {
1034
1034
  h = normalizeHue_default(h !== void 0 ? h : 0);
1035
1035
  if (s === void 0) s = 0;
1036
1036
  if (v === void 0) v = 0;
1037
- let f$1 = Math.abs(h / 60 % 2 - 1);
1037
+ let f$2 = Math.abs(h / 60 % 2 - 1);
1038
1038
  let res;
1039
1039
  switch (Math.floor(h / 60)) {
1040
1040
  case 0:
1041
1041
  res = {
1042
1042
  r: v,
1043
- g: v * (1 - s * f$1),
1043
+ g: v * (1 - s * f$2),
1044
1044
  b: v * (1 - s)
1045
1045
  };
1046
1046
  break;
1047
1047
  case 1:
1048
1048
  res = {
1049
- r: v * (1 - s * f$1),
1049
+ r: v * (1 - s * f$2),
1050
1050
  g: v,
1051
1051
  b: v * (1 - s)
1052
1052
  };
@@ -1055,19 +1055,19 @@ function convertHsvToRgb({ h, s, v, alpha }) {
1055
1055
  res = {
1056
1056
  r: v * (1 - s),
1057
1057
  g: v,
1058
- b: v * (1 - s * f$1)
1058
+ b: v * (1 - s * f$2)
1059
1059
  };
1060
1060
  break;
1061
1061
  case 3:
1062
1062
  res = {
1063
1063
  r: v * (1 - s),
1064
- g: v * (1 - s * f$1),
1064
+ g: v * (1 - s * f$2),
1065
1065
  b: v
1066
1066
  };
1067
1067
  break;
1068
1068
  case 4:
1069
1069
  res = {
1070
- r: v * (1 - s * f$1),
1070
+ r: v * (1 - s * f$2),
1071
1071
  g: v * (1 - s),
1072
1072
  b: v
1073
1073
  };
@@ -1076,7 +1076,7 @@ function convertHsvToRgb({ h, s, v, alpha }) {
1076
1076
  res = {
1077
1077
  r: v,
1078
1078
  g: v * (1 - s),
1079
- b: v * (1 - s * f$1)
1079
+ b: v * (1 - s * f$2)
1080
1080
  };
1081
1081
  break;
1082
1082
  default: res = {
@@ -1109,7 +1109,7 @@ function convertRgbToHsv({ r: r$1, g, b, alpha }) {
1109
1109
 
1110
1110
  //#endregion
1111
1111
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsv/definition.js
1112
- const definition$11 = {
1112
+ const definition$12 = {
1113
1113
  mode: "hsv",
1114
1114
  toMode: { rgb: convertHsvToRgb },
1115
1115
  parse: ["--hsv"],
@@ -1138,7 +1138,7 @@ const definition$11 = {
1138
1138
  difference: { h: differenceHueSaturation },
1139
1139
  average: { h: averageAngle }
1140
1140
  };
1141
- var definition_default$2 = definition$11;
1141
+ var definition_default$2 = definition$12;
1142
1142
 
1143
1143
  //#endregion
1144
1144
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/convertHwbToRgb.js
@@ -1200,7 +1200,7 @@ var parseHwb_default = ParseHwb;
1200
1200
 
1201
1201
  //#endregion
1202
1202
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/definition.js
1203
- const definition$10 = {
1203
+ const definition$11 = {
1204
1204
  mode: "hwb",
1205
1205
  toMode: { rgb: convertHwbToRgb },
1206
1206
  fromMode: { rgb: convertRgbToHwb },
@@ -1229,12 +1229,12 @@ const definition$10 = {
1229
1229
  difference: { h: differenceHueNaive },
1230
1230
  average: { h: averageAngle }
1231
1231
  };
1232
- var definition_default$3 = definition$10;
1232
+ var definition_default$3 = definition$11;
1233
1233
 
1234
1234
  //#endregion
1235
1235
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/constants.js
1236
- const k = Math.pow(29, 3) / Math.pow(3, 3);
1237
- const e = Math.pow(6, 3) / Math.pow(29, 3);
1236
+ const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1237
+ const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
1238
1238
 
1239
1239
  //#endregion
1240
1240
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/constants.js
@@ -1248,12 +1248,12 @@ const D65 = {
1248
1248
  Y: 1,
1249
1249
  Z: .3583 / .329
1250
1250
  };
1251
- const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1252
- const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
1251
+ const k$2 = Math.pow(29, 3) / Math.pow(3, 3);
1252
+ const e$2 = Math.pow(6, 3) / Math.pow(29, 3);
1253
1253
 
1254
1254
  //#endregion
1255
1255
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/convertLabToXyz50.js
1256
- let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1256
+ let fn$1 = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
1257
1257
  const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1258
1258
  if (l === void 0) l = 0;
1259
1259
  if (a === void 0) a = 0;
@@ -1263,9 +1263,9 @@ const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1263
1263
  let fz = fy - b / 200;
1264
1264
  let res = {
1265
1265
  mode: "xyz50",
1266
- x: fn(fx) * D50.X,
1267
- y: fn(fy) * D50.Y,
1268
- z: fn(fz) * D50.Z
1266
+ x: fn$1(fx) * D50.X,
1267
+ y: fn$1(fy) * D50.Y,
1268
+ z: fn$1(fz) * D50.Z
1269
1269
  };
1270
1270
  if (alpha !== void 0) res.alpha = alpha;
1271
1271
  return res;
@@ -1310,14 +1310,14 @@ var convertRgbToXyz50_default = convertRgbToXyz50;
1310
1310
 
1311
1311
  //#endregion
1312
1312
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/convertXyz50ToLab.js
1313
- const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1313
+ const f$1 = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
1314
1314
  const convertXyz50ToLab = ({ x, y, z, alpha }) => {
1315
1315
  if (x === void 0) x = 0;
1316
1316
  if (y === void 0) y = 0;
1317
1317
  if (z === void 0) z = 0;
1318
- let f0 = f(x / D50.X);
1319
- let f1 = f(y / D50.Y);
1320
- let f2 = f(z / D50.Z);
1318
+ let f0 = f$1(x / D50.X);
1319
+ let f1 = f$1(y / D50.Y);
1320
+ let f2 = f$1(z / D50.Z);
1321
1321
  let res = {
1322
1322
  mode: "lab",
1323
1323
  l: 116 * f1 - 16,
@@ -1355,7 +1355,7 @@ var parseLab_default = parseLab;
1355
1355
 
1356
1356
  //#endregion
1357
1357
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/definition.js
1358
- const definition$9 = {
1358
+ const definition$10 = {
1359
1359
  mode: "lab",
1360
1360
  toMode: {
1361
1361
  xyz50: convertLabToXyz50_default,
@@ -1388,7 +1388,91 @@ const definition$9 = {
1388
1388
  }
1389
1389
  }
1390
1390
  };
1391
- var definition_default$4 = definition$9;
1391
+ var definition_default$4 = definition$10;
1392
+
1393
+ //#endregion
1394
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/constants.js
1395
+ const k = Math.pow(29, 3) / Math.pow(3, 3);
1396
+ const e = Math.pow(6, 3) / Math.pow(29, 3);
1397
+
1398
+ //#endregion
1399
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertLab65ToXyz65.js
1400
+ let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1401
+ const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
1402
+ if (l === void 0) l = 0;
1403
+ if (a === void 0) a = 0;
1404
+ if (b === void 0) b = 0;
1405
+ let fy = (l + 16) / 116;
1406
+ let fx = a / 500 + fy;
1407
+ let fz = fy - b / 200;
1408
+ let res = {
1409
+ mode: "xyz65",
1410
+ x: fn(fx) * D65.X,
1411
+ y: fn(fy) * D65.Y,
1412
+ z: fn(fz) * D65.Z
1413
+ };
1414
+ if (alpha !== void 0) res.alpha = alpha;
1415
+ return res;
1416
+ };
1417
+ var convertLab65ToXyz65_default = convertLab65ToXyz65;
1418
+
1419
+ //#endregion
1420
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertLab65ToRgb.js
1421
+ const convertLab65ToRgb = (lab) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab));
1422
+ var convertLab65ToRgb_default = convertLab65ToRgb;
1423
+
1424
+ //#endregion
1425
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertXyz65ToLab65.js
1426
+ const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1427
+ const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
1428
+ if (x === void 0) x = 0;
1429
+ if (y === void 0) y = 0;
1430
+ if (z === void 0) z = 0;
1431
+ let f0 = f(x / D65.X);
1432
+ let f1 = f(y / D65.Y);
1433
+ let f2 = f(z / D65.Z);
1434
+ let res = {
1435
+ mode: "lab65",
1436
+ l: 116 * f1 - 16,
1437
+ a: 500 * (f0 - f1),
1438
+ b: 200 * (f1 - f2)
1439
+ };
1440
+ if (alpha !== void 0) res.alpha = alpha;
1441
+ return res;
1442
+ };
1443
+ var convertXyz65ToLab65_default = convertXyz65ToLab65;
1444
+
1445
+ //#endregion
1446
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertRgbToLab65.js
1447
+ const convertRgbToLab65 = (rgb$2) => {
1448
+ let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));
1449
+ if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
1450
+ return res;
1451
+ };
1452
+ var convertRgbToLab65_default = convertRgbToLab65;
1453
+
1454
+ //#endregion
1455
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/definition.js
1456
+ const definition$9 = {
1457
+ ...definition_default$4,
1458
+ mode: "lab65",
1459
+ parse: ["--lab-d65"],
1460
+ serialize: "--lab-d65",
1461
+ toMode: {
1462
+ xyz65: convertLab65ToXyz65_default,
1463
+ rgb: convertLab65ToRgb_default
1464
+ },
1465
+ fromMode: {
1466
+ xyz65: convertXyz65ToLab65_default,
1467
+ rgb: convertRgbToLab65_default
1468
+ },
1469
+ ranges: {
1470
+ l: [0, 100],
1471
+ a: [-86.182, 98.234],
1472
+ b: [-107.86, 94.477]
1473
+ }
1474
+ };
1475
+ var definition_default$5 = definition$9;
1392
1476
 
1393
1477
  //#endregion
1394
1478
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lch/convertLabToLch.js
@@ -1482,19 +1566,19 @@ const definition$8 = {
1482
1566
  difference: { h: differenceHueChroma },
1483
1567
  average: { h: averageAngle }
1484
1568
  };
1485
- var definition_default$5 = definition$8;
1569
+ var definition_default$6 = definition$8;
1486
1570
 
1487
1571
  //#endregion
1488
1572
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/definition.js
1489
1573
  const definition$7 = {
1490
- ...definition_default$12,
1574
+ ...definition_default$13,
1491
1575
  mode: "lrgb",
1492
1576
  toMode: { rgb: convertLrgbToRgb_default },
1493
1577
  fromMode: { rgb: convertRgbToLrgb_default },
1494
1578
  parse: ["srgb-linear"],
1495
1579
  serialize: "srgb-linear"
1496
1580
  };
1497
- var definition_default$6 = definition$7;
1581
+ var definition_default$7 = definition$7;
1498
1582
 
1499
1583
  //#endregion
1500
1584
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertOklabToLrgb.js
@@ -1586,7 +1670,7 @@ const definition$6 = {
1586
1670
  parse: [parseOklab_default],
1587
1671
  serialize: (c$1) => `oklab(${c$1.l !== void 0 ? c$1.l : "none"} ${c$1.a !== void 0 ? c$1.a : "none"} ${c$1.b !== void 0 ? c$1.b : "none"}${c$1.alpha < 1 ? ` / ${c$1.alpha}` : ""})`
1588
1672
  };
1589
- var definition_default$7 = definition$6;
1673
+ var definition_default$8 = definition$6;
1590
1674
 
1591
1675
  //#endregion
1592
1676
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/parseOklch.js
@@ -1611,7 +1695,7 @@ var parseOklch_default = parseOklch;
1611
1695
  //#endregion
1612
1696
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/definition.js
1613
1697
  const definition$5 = {
1614
- ...definition_default$5,
1698
+ ...definition_default$6,
1615
1699
  mode: "oklch",
1616
1700
  toMode: {
1617
1701
  oklab: (c$1) => convertLchToLab_default(c$1, "oklab"),
@@ -1629,7 +1713,7 @@ const definition$5 = {
1629
1713
  h: [0, 360]
1630
1714
  }
1631
1715
  };
1632
- var definition_default$8 = definition$5;
1716
+ var definition_default$9 = definition$5;
1633
1717
 
1634
1718
  //#endregion
1635
1719
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/convertP3ToXyz65.js
@@ -1665,7 +1749,7 @@ var convertXyz65ToP3_default = convertXyz65ToP3;
1665
1749
  //#endregion
1666
1750
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/definition.js
1667
1751
  const definition$4 = {
1668
- ...definition_default$12,
1752
+ ...definition_default$13,
1669
1753
  mode: "p3",
1670
1754
  parse: ["display-p3"],
1671
1755
  serialize: "display-p3",
@@ -1678,7 +1762,7 @@ const definition$4 = {
1678
1762
  xyz65: convertP3ToXyz65_default
1679
1763
  }
1680
1764
  };
1681
- var definition_default$9 = definition$4;
1765
+ var definition_default$10 = definition$4;
1682
1766
 
1683
1767
  //#endregion
1684
1768
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
@@ -1727,7 +1811,7 @@ var convertProphotoToXyz50_default = convertProphotoToXyz50;
1727
1811
  //#endregion
1728
1812
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/definition.js
1729
1813
  const definition$3 = {
1730
- ...definition_default$12,
1814
+ ...definition_default$13,
1731
1815
  mode: "prophoto",
1732
1816
  parse: ["prophoto-rgb"],
1733
1817
  serialize: "prophoto-rgb",
@@ -1740,7 +1824,7 @@ const definition$3 = {
1740
1824
  rgb: (color) => convertXyz50ToRgb_default(convertProphotoToXyz50_default(color))
1741
1825
  }
1742
1826
  };
1743
- var definition_default$10 = definition$3;
1827
+ var definition_default$11 = definition$3;
1744
1828
 
1745
1829
  //#endregion
1746
1830
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
@@ -1793,7 +1877,7 @@ var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
1793
1877
  //#endregion
1794
1878
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/definition.js
1795
1879
  const definition$2 = {
1796
- ...definition_default$12,
1880
+ ...definition_default$13,
1797
1881
  mode: "rec2020",
1798
1882
  fromMode: {
1799
1883
  xyz65: convertXyz65ToRec2020_default,
@@ -1806,7 +1890,7 @@ const definition$2 = {
1806
1890
  parse: ["rec2020"],
1807
1891
  serialize: "rec2020"
1808
1892
  };
1809
- var definition_default$11 = definition$2;
1893
+ var definition_default$12 = definition$2;
1810
1894
 
1811
1895
  //#endregion
1812
1896
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/definition.js
@@ -1843,7 +1927,7 @@ const definition$1 = {
1843
1927
  }
1844
1928
  }
1845
1929
  };
1846
- var definition_default$13 = definition$1;
1930
+ var definition_default$14 = definition$1;
1847
1931
 
1848
1932
  //#endregion
1849
1933
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
@@ -1916,7 +2000,7 @@ const definition = {
1916
2000
  }
1917
2001
  }
1918
2002
  };
1919
- var definition_default$14 = definition;
2003
+ var definition_default$15 = definition;
1920
2004
 
1921
2005
  //#endregion
1922
2006
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/round.js
@@ -2048,7 +2132,7 @@ function toGamut(dest = "rgb", mode = "oklch", delta = differenceEuclidean("oklc
2048
2132
  }
2049
2133
 
2050
2134
  //#endregion
2051
- //#region ../token-tools/dist/string-BZ5Le1WD.js
2135
+ //#region ../token-tools/dist/string-Cq7Oa0sE.js
2052
2136
  const HEX_RE = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
2053
2137
  const CULORI_TO_CSS = {
2054
2138
  a98: "a98",
@@ -2056,6 +2140,7 @@ const CULORI_TO_CSS = {
2056
2140
  hsv: "hsv",
2057
2141
  hwb: "hwb",
2058
2142
  lab: "lab",
2143
+ lab65: "lab-d65",
2059
2144
  lch: "lch",
2060
2145
  lrgb: "srgb-linear",
2061
2146
  oklab: "oklab",
@@ -2074,6 +2159,7 @@ const CSS_TO_CULORI = {
2074
2159
  hsv: "hsv",
2075
2160
  hwb: "hwb",
2076
2161
  lab: "lab",
2162
+ "lab-d65": "lab65",
2077
2163
  lch: "lch",
2078
2164
  oklab: "oklab",
2079
2165
  oklch: "oklch",
@@ -2134,6 +2220,7 @@ function parseColor(color) {
2134
2220
  break;
2135
2221
  }
2136
2222
  case "lab":
2223
+ case "lab65":
2137
2224
  case "oklab": {
2138
2225
  components = [
2139
2226
  result.l,
@@ -2218,10 +2305,12 @@ function tokenToCulori(value) {
2218
2305
  };
2219
2306
  }
2220
2307
  case "lab":
2308
+ case "lab-d65":
2221
2309
  case "oklab": {
2222
2310
  const [l, a, b] = value.components;
2311
+ const mode = value.colorSpace === "lab-d65" ? "lab65" : value.colorSpace;
2223
2312
  return {
2224
- mode: value.colorSpace,
2313
+ mode,
2225
2314
  l,
2226
2315
  a,
2227
2316
  b,
@@ -2259,6 +2348,7 @@ function tokenToCulori(value) {
2259
2348
  alpha: value.alpha
2260
2349
  };
2261
2350
  }
2351
+ default: throw new Error(`Invalid colorSpace "${value.colorSpace}". Expected one of ${Object.keys(CSS_TO_CULORI).join(", ")}`);
2262
2352
  }
2263
2353
  }
2264
2354
  /** Turn a string into kebab-case */
@@ -2385,11 +2475,11 @@ function wildcardMatch(pattern, options) {
2385
2475
  if (options.separator === "\\") throw new Error("\\ is not a valid separator because it is used for escaping. Try setting the separator to `true` instead");
2386
2476
  var regexpPattern = transform(pattern, options.separator);
2387
2477
  var regexp = new RegExp("^".concat(regexpPattern, "$"), options.flags);
2388
- var fn$3 = isMatch.bind(null, regexp);
2389
- fn$3.options = options;
2390
- fn$3.pattern = pattern;
2391
- fn$3.regexp = regexp;
2392
- return fn$3;
2478
+ var fn$4 = isMatch.bind(null, regexp);
2479
+ fn$4.options = options;
2480
+ fn$4.pattern = pattern;
2481
+ fn$4.regexp = regexp;
2482
+ return fn$4;
2393
2483
  }
2394
2484
 
2395
2485
  //#endregion
@@ -2465,16 +2555,17 @@ const converters = {
2465
2555
  hsv: useMode(definition_default$2),
2466
2556
  hwb: useMode(definition_default$3),
2467
2557
  lab: useMode(definition_default$4),
2468
- lch: useMode(definition_default$5),
2469
- lrgb: useMode(definition_default$6),
2470
- oklab: useMode(definition_default$7),
2471
- oklch: useMode(definition_default$8),
2472
- p3: useMode(definition_default$9),
2473
- prophoto: useMode(definition_default$10),
2474
- rec2020: useMode(definition_default$11),
2475
- rgb: useMode(definition_default$12),
2476
- xyz50: useMode(definition_default$13),
2477
- xyz65: useMode(definition_default$14)
2558
+ lab65: useMode(definition_default$5),
2559
+ lch: useMode(definition_default$6),
2560
+ lrgb: useMode(definition_default$7),
2561
+ oklab: useMode(definition_default$8),
2562
+ oklch: useMode(definition_default$9),
2563
+ p3: useMode(definition_default$10),
2564
+ prophoto: useMode(definition_default$11),
2565
+ rec2020: useMode(definition_default$12),
2566
+ rgb: useMode(definition_default$13),
2567
+ xyz50: useMode(definition_default$14),
2568
+ xyz65: useMode(definition_default$15)
2478
2569
  };
2479
2570
  /**
2480
2571
  * Downsample color to sRGB/Display P3/Rec2020 colorspaces.
@@ -2483,13 +2574,19 @@ const converters = {
2483
2574
  * we’re just preserving the original colorspace.
2484
2575
  */
2485
2576
  function downsample($value, culoriColor) {
2577
+ if (!($value.colorSpace in CSS_TO_CULORI)) throw new Error(`Invalid colorSpace "${$value.colorSpace}". Expected one of: ${Object.keys(CSS_TO_CULORI).join(", ")}`);
2486
2578
  const conversionSpace = CSS_TO_CULORI[$value.colorSpace] || "oklab";
2487
- const converter$1 = converters[conversionSpace];
2579
+ let gamutSpace = conversionSpace;
2580
+ if (gamutSpace === "lab" || gamutSpace === "lab65") gamutSpace = "lch";
2581
+ else if (gamutSpace === "oklab") gamutSpace = "oklch";
2582
+ const srgb = converters[conversionSpace](toGamut("rgb", gamutSpace)(culoriColor));
2583
+ const p3 = converters[conversionSpace](toGamut("p3", gamutSpace)(culoriColor));
2584
+ const rec2020 = converters[conversionSpace](toGamut("rec2020", gamutSpace)(culoriColor));
2488
2585
  return {
2489
2586
  ".": formatCss(culoriColor),
2490
- srgb: formatCss(converter$1(toGamut("rgb", conversionSpace)(culoriColor))),
2491
- p3: formatCss(converter$1(toGamut("p3", conversionSpace)(culoriColor))),
2492
- rec2020: formatCss(converter$1(toGamut("rec2020", conversionSpace)(culoriColor)))
2587
+ srgb: formatCss(srgb),
2588
+ p3: formatCss(p3),
2589
+ rec2020: formatCss(rec2020)
2493
2590
  };
2494
2591
  }
2495
2592
  /** Convert dimension value to CSS */
@@ -2746,7 +2843,7 @@ function _printRule(rule) {
2746
2843
  }
2747
2844
  const declarations = Object.entries(rule.declarations);
2748
2845
  declarations.sort((a, b) => a[0].localeCompare(b[0], "en-us", { numeric: true }));
2749
- for (const [k$2, v] of declarations) output.push(`${indent}${k$2}: ${v};`);
2846
+ for (const [k$3, v] of declarations) output.push(`${indent}${k$3}: ${v};`);
2750
2847
  while (indent !== "") {
2751
2848
  indent = indent.substring(0, indent.length - 2);
2752
2849
  output.push(`${indent}}`);
@@ -2841,7 +2938,7 @@ function generateUtilityCSS(groups, tokens) {
2841
2938
  const selector = makeSelector(token, "font");
2842
2939
  if (token.token.$type === "typography" && token.type === "MULTI_VALUE") {
2843
2940
  const declarations = {};
2844
- for (const k$2 of Object.keys(token.value)) declarations[k$2] = makeCSSVar(`${token.localID ?? token.token.id}-${k$2}`, { wrapVar: true });
2941
+ for (const k$3 of Object.keys(token.value)) declarations[k$3] = makeCSSVar(`${token.localID ?? token.token.id}-${k$3}`, { wrapVar: true });
2845
2942
  output.push({
2846
2943
  selectors: [selector],
2847
2944
  declarations