@angular/material 18.2.0-next.3 → 18.2.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 (116) hide show
  1. package/button/testing/index.d.ts +1 -1
  2. package/button-toggle/index.d.ts +14 -2
  3. package/card/testing/index.d.ts +1 -1
  4. package/checkbox/_checkbox-common.scss +16 -0
  5. package/core/testing/index.d.ts +2 -2
  6. package/core/tokens/m2/mat/_standard-button-toggle.scss +1 -1
  7. package/core/tokens/m2/mdc/_checkbox.scss +2 -0
  8. package/core/tokens/m3/mdc/_chip.scss +4 -0
  9. package/esm2022/button/testing/button-harness.mjs +2 -2
  10. package/esm2022/button-toggle/button-toggle.mjs +33 -4
  11. package/esm2022/button-toggle/testing/button-toggle-harness.mjs +3 -3
  12. package/esm2022/card/testing/card-harness.mjs +2 -2
  13. package/esm2022/checkbox/checkbox.mjs +3 -3
  14. package/esm2022/checkbox/testing/checkbox-harness.mjs +7 -3
  15. package/esm2022/core/datetime/native-date-adapter.mjs +2 -2
  16. package/esm2022/core/testing/optgroup-harness.mjs +2 -2
  17. package/esm2022/core/testing/option-harness.mjs +2 -2
  18. package/esm2022/core/version.mjs +1 -1
  19. package/esm2022/expansion/expansion-animations.mjs +2 -2
  20. package/esm2022/form-field/form-field.mjs +18 -6
  21. package/esm2022/form-field/testing/error-harness.mjs +2 -2
  22. package/esm2022/list/list-option.mjs +3 -3
  23. package/esm2022/list/testing/action-list-harness.mjs +2 -2
  24. package/esm2022/list/testing/list-harness.mjs +2 -2
  25. package/esm2022/list/testing/list-item-harness-base.mjs +2 -2
  26. package/esm2022/list/testing/nav-list-harness.mjs +3 -3
  27. package/esm2022/list/testing/selection-list-harness.mjs +2 -2
  28. package/esm2022/menu/testing/menu-harness.mjs +2 -2
  29. package/esm2022/progress-bar/testing/progress-bar-harness.mjs +2 -2
  30. package/esm2022/radio/testing/radio-harness.mjs +9 -5
  31. package/esm2022/select/testing/select-harness.mjs +2 -2
  32. package/esm2022/sidenav/drawer.mjs +2 -2
  33. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  34. package/esm2022/slide-toggle/testing/slide-toggle-harness.mjs +7 -3
  35. package/esm2022/snack-bar/testing/snack-bar-harness.mjs +2 -2
  36. package/esm2022/tabs/tab-group.mjs +10 -4
  37. package/esm2022/tabs/tab-header.mjs +9 -3
  38. package/esm2022/tabs/testing/tab-group-harness.mjs +2 -2
  39. package/esm2022/tabs/testing/tab-link-harness.mjs +2 -2
  40. package/esm2022/tabs/testing/tab-nav-bar-harness.mjs +2 -2
  41. package/esm2022/tooltip/tooltip.mjs +34 -18
  42. package/expansion/index.d.ts +1 -1
  43. package/fesm2022/button/testing.mjs +1 -1
  44. package/fesm2022/button/testing.mjs.map +1 -1
  45. package/fesm2022/button-toggle/testing.mjs +2 -2
  46. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  47. package/fesm2022/button-toggle.mjs +32 -3
  48. package/fesm2022/button-toggle.mjs.map +1 -1
  49. package/fesm2022/card/testing.mjs +1 -1
  50. package/fesm2022/card/testing.mjs.map +1 -1
  51. package/fesm2022/checkbox/testing.mjs +6 -2
  52. package/fesm2022/checkbox/testing.mjs.map +1 -1
  53. package/fesm2022/checkbox.mjs +2 -2
  54. package/fesm2022/checkbox.mjs.map +1 -1
  55. package/fesm2022/core/testing.mjs +2 -2
  56. package/fesm2022/core/testing.mjs.map +1 -1
  57. package/fesm2022/core.mjs +2 -2
  58. package/fesm2022/core.mjs.map +1 -1
  59. package/fesm2022/expansion.mjs +1 -1
  60. package/fesm2022/expansion.mjs.map +1 -1
  61. package/fesm2022/form-field/testing.mjs +1 -1
  62. package/fesm2022/form-field/testing.mjs.map +1 -1
  63. package/fesm2022/form-field.mjs +17 -5
  64. package/fesm2022/form-field.mjs.map +1 -1
  65. package/fesm2022/list/testing.mjs +6 -6
  66. package/fesm2022/list/testing.mjs.map +1 -1
  67. package/fesm2022/list.mjs +2 -2
  68. package/fesm2022/list.mjs.map +1 -1
  69. package/fesm2022/menu/testing.mjs +1 -1
  70. package/fesm2022/menu/testing.mjs.map +1 -1
  71. package/fesm2022/progress-bar/testing.mjs +1 -1
  72. package/fesm2022/progress-bar/testing.mjs.map +1 -1
  73. package/fesm2022/radio/testing.mjs +8 -4
  74. package/fesm2022/radio/testing.mjs.map +1 -1
  75. package/fesm2022/select/testing.mjs +1 -1
  76. package/fesm2022/select/testing.mjs.map +1 -1
  77. package/fesm2022/sidenav.mjs +1 -1
  78. package/fesm2022/sidenav.mjs.map +1 -1
  79. package/fesm2022/slide-toggle/testing.mjs +6 -2
  80. package/fesm2022/slide-toggle/testing.mjs.map +1 -1
  81. package/fesm2022/slide-toggle.mjs +2 -2
  82. package/fesm2022/slide-toggle.mjs.map +1 -1
  83. package/fesm2022/snack-bar/testing.mjs +1 -1
  84. package/fesm2022/snack-bar/testing.mjs.map +1 -1
  85. package/fesm2022/tabs/testing.mjs +3 -3
  86. package/fesm2022/tabs/testing.mjs.map +1 -1
  87. package/fesm2022/tabs.mjs +17 -5
  88. package/fesm2022/tabs.mjs.map +1 -1
  89. package/fesm2022/tooltip.mjs +33 -17
  90. package/fesm2022/tooltip.mjs.map +1 -1
  91. package/form-field/_form-field-native-select.scss +1 -1
  92. package/form-field/index.d.ts +3 -0
  93. package/form-field/testing/index.d.ts +1 -1
  94. package/list/index.d.ts +1 -1
  95. package/list/testing/index.d.ts +6 -6
  96. package/menu/testing/index.d.ts +1 -1
  97. package/package.json +7 -7
  98. package/prebuilt-themes/azure-blue.css +1 -1
  99. package/prebuilt-themes/cyan-orange.css +1 -1
  100. package/prebuilt-themes/deeppurple-amber.css +1 -1
  101. package/prebuilt-themes/indigo-pink.css +1 -1
  102. package/prebuilt-themes/magenta-violet.css +1 -1
  103. package/prebuilt-themes/pink-bluegrey.css +1 -1
  104. package/prebuilt-themes/purple-green.css +1 -1
  105. package/prebuilt-themes/rose-red.css +1 -1
  106. package/progress-bar/testing/index.d.ts +1 -1
  107. package/radio/testing/index.d.ts +2 -2
  108. package/schematics/ng-add/index.js +2 -2
  109. package/schematics/ng-add/index.mjs +2 -2
  110. package/schematics/ng-generate/m3-theme/index_bundled.js +218 -315
  111. package/schematics/ng-generate/m3-theme/index_bundled.js.map +4 -4
  112. package/select/testing/index.d.ts +1 -1
  113. package/snack-bar/testing/index.d.ts +1 -1
  114. package/tabs/index.d.ts +10 -2
  115. package/tabs/testing/index.d.ts +3 -3
  116. package/tooltip/index.d.ts +3 -0
@@ -101,10 +101,6 @@ function sanitizeDegreesDouble(degrees) {
101
101
  }
102
102
  return degrees;
103
103
  }
104
- function rotationDirection(from, to) {
105
- const increasingDifference = sanitizeDegreesDouble(to - from);
106
- return increasingDifference <= 180 ? 1 : -1;
107
- }
108
104
  function differenceDegrees(a, b) {
109
105
  return 180 - Math.abs(Math.abs(a - b) - 180);
110
106
  }
@@ -173,6 +169,26 @@ function xyzFromArgb(argb) {
173
169
  const b = linearized(blueFromArgb(argb));
174
170
  return matrixMultiply([r, g, b], SRGB_TO_XYZ);
175
171
  }
172
+ function labFromArgb(argb) {
173
+ const linearR = linearized(redFromArgb(argb));
174
+ const linearG = linearized(greenFromArgb(argb));
175
+ const linearB = linearized(blueFromArgb(argb));
176
+ const matrix = SRGB_TO_XYZ;
177
+ const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;
178
+ const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;
179
+ const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;
180
+ const whitePoint = WHITE_POINT_D65;
181
+ const xNormalized = x / whitePoint[0];
182
+ const yNormalized = y / whitePoint[1];
183
+ const zNormalized = z / whitePoint[2];
184
+ const fx = labF(xNormalized);
185
+ const fy = labF(yNormalized);
186
+ const fz = labF(zNormalized);
187
+ const l = 116 * fy - 16;
188
+ const a = 500 * (fx - fy);
189
+ const b = 200 * (fy - fz);
190
+ return [l, a, b];
191
+ }
176
192
  function argbFromLstar(lstar) {
177
193
  const y = yFromLstar(lstar);
178
194
  const component = delinearized(y);
@@ -1071,39 +1087,6 @@ var Hct = class {
1071
1087
  }
1072
1088
  };
1073
1089
 
1074
- // node_modules/@material/material-color-utilities/blend/blend.js
1075
- var Blend = class {
1076
- static harmonize(designColor, sourceColor) {
1077
- const fromHct = Hct.fromInt(designColor);
1078
- const toHct = Hct.fromInt(sourceColor);
1079
- const differenceDegrees2 = differenceDegrees(fromHct.hue, toHct.hue);
1080
- const rotationDegrees = Math.min(differenceDegrees2 * 0.5, 15);
1081
- const outputHue = sanitizeDegreesDouble(fromHct.hue + rotationDegrees * rotationDirection(fromHct.hue, toHct.hue));
1082
- return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();
1083
- }
1084
- static hctHue(from, to, amount) {
1085
- const ucs = Blend.cam16Ucs(from, to, amount);
1086
- const ucsCam = Cam16.fromInt(ucs);
1087
- const fromCam = Cam16.fromInt(from);
1088
- const blended = Hct.from(ucsCam.hue, fromCam.chroma, lstarFromArgb(from));
1089
- return blended.toInt();
1090
- }
1091
- static cam16Ucs(from, to, amount) {
1092
- const fromCam = Cam16.fromInt(from);
1093
- const toCam = Cam16.fromInt(to);
1094
- const fromJ = fromCam.jstar;
1095
- const fromA = fromCam.astar;
1096
- const fromB = fromCam.bstar;
1097
- const toJ = toCam.jstar;
1098
- const toA = toCam.astar;
1099
- const toB = toCam.bstar;
1100
- const jstar = fromJ + (toJ - fromJ) * amount;
1101
- const astar = fromA + (toA - fromA) * amount;
1102
- const bstar = fromB + (toB - fromB) * amount;
1103
- return Cam16.fromUcs(jstar, astar, bstar).toInt();
1104
- }
1105
- };
1106
-
1107
1090
  // node_modules/@material/material-color-utilities/contrast/contrast.js
1108
1091
  var Contrast = class {
1109
1092
  static ratioOfTones(toneA, toneB) {
@@ -1970,65 +1953,6 @@ var TonalPalette = class {
1970
1953
  }
1971
1954
  };
1972
1955
 
1973
- // node_modules/@material/material-color-utilities/palettes/core_palette.js
1974
- var CorePalette = class {
1975
- static of(argb) {
1976
- return new CorePalette(argb, false);
1977
- }
1978
- static contentOf(argb) {
1979
- return new CorePalette(argb, true);
1980
- }
1981
- static fromColors(colors) {
1982
- return CorePalette.createPaletteFromColors(false, colors);
1983
- }
1984
- static contentFromColors(colors) {
1985
- return CorePalette.createPaletteFromColors(true, colors);
1986
- }
1987
- static createPaletteFromColors(content, colors) {
1988
- const palette = new CorePalette(colors.primary, content);
1989
- if (colors.secondary) {
1990
- const p = new CorePalette(colors.secondary, content);
1991
- palette.a2 = p.a1;
1992
- }
1993
- if (colors.tertiary) {
1994
- const p = new CorePalette(colors.tertiary, content);
1995
- palette.a3 = p.a1;
1996
- }
1997
- if (colors.error) {
1998
- const p = new CorePalette(colors.error, content);
1999
- palette.error = p.a1;
2000
- }
2001
- if (colors.neutral) {
2002
- const p = new CorePalette(colors.neutral, content);
2003
- palette.n1 = p.n1;
2004
- }
2005
- if (colors.neutralVariant) {
2006
- const p = new CorePalette(colors.neutralVariant, content);
2007
- palette.n2 = p.n2;
2008
- }
2009
- return palette;
2010
- }
2011
- constructor(argb, isContent) {
2012
- const hct = Hct.fromInt(argb);
2013
- const hue = hct.hue;
2014
- const chroma = hct.chroma;
2015
- if (isContent) {
2016
- this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);
2017
- this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);
2018
- this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);
2019
- this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));
2020
- this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));
2021
- } else {
2022
- this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));
2023
- this.a2 = TonalPalette.fromHueAndChroma(hue, 16);
2024
- this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);
2025
- this.n1 = TonalPalette.fromHueAndChroma(hue, 4);
2026
- this.n2 = TonalPalette.fromHueAndChroma(hue, 8);
2027
- }
2028
- this.error = TonalPalette.fromHueAndChroma(25, 84);
2029
- }
2030
- };
2031
-
2032
1956
  // node_modules/@material/material-color-utilities/scheme/dynamic_scheme.js
2033
1957
  var DynamicScheme = class {
2034
1958
  constructor(args) {
@@ -2064,179 +1988,200 @@ var DynamicScheme = class {
2064
1988
  }
2065
1989
  };
2066
1990
 
2067
- // node_modules/@material/material-color-utilities/scheme/scheme.js
2068
- var Scheme = class {
2069
- get primary() {
2070
- return this.props.primary;
2071
- }
2072
- get onPrimary() {
2073
- return this.props.onPrimary;
2074
- }
2075
- get primaryContainer() {
2076
- return this.props.primaryContainer;
2077
- }
2078
- get onPrimaryContainer() {
2079
- return this.props.onPrimaryContainer;
2080
- }
2081
- get secondary() {
2082
- return this.props.secondary;
2083
- }
2084
- get onSecondary() {
2085
- return this.props.onSecondary;
2086
- }
2087
- get secondaryContainer() {
2088
- return this.props.secondaryContainer;
2089
- }
2090
- get onSecondaryContainer() {
2091
- return this.props.onSecondaryContainer;
2092
- }
2093
- get tertiary() {
2094
- return this.props.tertiary;
2095
- }
2096
- get onTertiary() {
2097
- return this.props.onTertiary;
2098
- }
2099
- get tertiaryContainer() {
2100
- return this.props.tertiaryContainer;
2101
- }
2102
- get onTertiaryContainer() {
2103
- return this.props.onTertiaryContainer;
2104
- }
2105
- get error() {
2106
- return this.props.error;
2107
- }
2108
- get onError() {
2109
- return this.props.onError;
2110
- }
2111
- get errorContainer() {
2112
- return this.props.errorContainer;
2113
- }
2114
- get onErrorContainer() {
2115
- return this.props.onErrorContainer;
2116
- }
2117
- get background() {
2118
- return this.props.background;
2119
- }
2120
- get onBackground() {
2121
- return this.props.onBackground;
2122
- }
2123
- get surface() {
2124
- return this.props.surface;
2125
- }
2126
- get onSurface() {
2127
- return this.props.onSurface;
2128
- }
2129
- get surfaceVariant() {
2130
- return this.props.surfaceVariant;
2131
- }
2132
- get onSurfaceVariant() {
2133
- return this.props.onSurfaceVariant;
2134
- }
2135
- get outline() {
2136
- return this.props.outline;
2137
- }
2138
- get outlineVariant() {
2139
- return this.props.outlineVariant;
2140
- }
2141
- get shadow() {
2142
- return this.props.shadow;
2143
- }
2144
- get scrim() {
2145
- return this.props.scrim;
2146
- }
2147
- get inverseSurface() {
2148
- return this.props.inverseSurface;
2149
- }
2150
- get inverseOnSurface() {
2151
- return this.props.inverseOnSurface;
1991
+ // node_modules/@material/material-color-utilities/temperature/temperature_cache.js
1992
+ var TemperatureCache = class {
1993
+ constructor(input) {
1994
+ this.input = input;
1995
+ this.hctsByTempCache = [];
1996
+ this.hctsByHueCache = [];
1997
+ this.tempsByHctCache = /* @__PURE__ */ new Map();
1998
+ this.inputRelativeTemperatureCache = -1;
1999
+ this.complementCache = null;
2000
+ }
2001
+ get hctsByTemp() {
2002
+ if (this.hctsByTempCache.length > 0) {
2003
+ return this.hctsByTempCache;
2004
+ }
2005
+ const hcts = this.hctsByHue.concat([this.input]);
2006
+ const temperaturesByHct = this.tempsByHct;
2007
+ hcts.sort((a, b) => temperaturesByHct.get(a) - temperaturesByHct.get(b));
2008
+ this.hctsByTempCache = hcts;
2009
+ return hcts;
2010
+ }
2011
+ get warmest() {
2012
+ return this.hctsByTemp[this.hctsByTemp.length - 1];
2013
+ }
2014
+ get coldest() {
2015
+ return this.hctsByTemp[0];
2016
+ }
2017
+ analogous(count = 5, divisions = 12) {
2018
+ const startHue = Math.round(this.input.hue);
2019
+ const startHct = this.hctsByHue[startHue];
2020
+ let lastTemp = this.relativeTemperature(startHct);
2021
+ const allColors = [startHct];
2022
+ let absoluteTotalTempDelta = 0;
2023
+ for (let i = 0; i < 360; i++) {
2024
+ const hue = sanitizeDegreesInt(startHue + i);
2025
+ const hct = this.hctsByHue[hue];
2026
+ const temp = this.relativeTemperature(hct);
2027
+ const tempDelta = Math.abs(temp - lastTemp);
2028
+ lastTemp = temp;
2029
+ absoluteTotalTempDelta += tempDelta;
2030
+ }
2031
+ let hueAddend = 1;
2032
+ const tempStep = absoluteTotalTempDelta / divisions;
2033
+ let totalTempDelta = 0;
2034
+ lastTemp = this.relativeTemperature(startHct);
2035
+ while (allColors.length < divisions) {
2036
+ const hue = sanitizeDegreesInt(startHue + hueAddend);
2037
+ const hct = this.hctsByHue[hue];
2038
+ const temp = this.relativeTemperature(hct);
2039
+ const tempDelta = Math.abs(temp - lastTemp);
2040
+ totalTempDelta += tempDelta;
2041
+ const desiredTotalTempDeltaForIndex = allColors.length * tempStep;
2042
+ let indexSatisfied = totalTempDelta >= desiredTotalTempDeltaForIndex;
2043
+ let indexAddend = 1;
2044
+ while (indexSatisfied && allColors.length < divisions) {
2045
+ allColors.push(hct);
2046
+ const desiredTotalTempDeltaForIndex2 = (allColors.length + indexAddend) * tempStep;
2047
+ indexSatisfied = totalTempDelta >= desiredTotalTempDeltaForIndex2;
2048
+ indexAddend++;
2049
+ }
2050
+ lastTemp = temp;
2051
+ hueAddend++;
2052
+ if (hueAddend > 360) {
2053
+ while (allColors.length < divisions) {
2054
+ allColors.push(hct);
2055
+ }
2056
+ break;
2057
+ }
2058
+ }
2059
+ const answers = [this.input];
2060
+ const increaseHueCount = Math.floor((count - 1) / 2);
2061
+ for (let i = 1; i < increaseHueCount + 1; i++) {
2062
+ let index = 0 - i;
2063
+ while (index < 0) {
2064
+ index = allColors.length + index;
2065
+ }
2066
+ if (index >= allColors.length) {
2067
+ index = index % allColors.length;
2068
+ }
2069
+ answers.splice(0, 0, allColors[index]);
2070
+ }
2071
+ const decreaseHueCount = count - increaseHueCount - 1;
2072
+ for (let i = 1; i < decreaseHueCount + 1; i++) {
2073
+ let index = i;
2074
+ while (index < 0) {
2075
+ index = allColors.length + index;
2076
+ }
2077
+ if (index >= allColors.length) {
2078
+ index = index % allColors.length;
2079
+ }
2080
+ answers.push(allColors[index]);
2081
+ }
2082
+ return answers;
2083
+ }
2084
+ get complement() {
2085
+ if (this.complementCache != null) {
2086
+ return this.complementCache;
2087
+ }
2088
+ const coldestHue = this.coldest.hue;
2089
+ const coldestTemp = this.tempsByHct.get(this.coldest);
2090
+ const warmestHue = this.warmest.hue;
2091
+ const warmestTemp = this.tempsByHct.get(this.warmest);
2092
+ const range = warmestTemp - coldestTemp;
2093
+ const startHueIsColdestToWarmest = TemperatureCache.isBetween(this.input.hue, coldestHue, warmestHue);
2094
+ const startHue = startHueIsColdestToWarmest ? warmestHue : coldestHue;
2095
+ const endHue = startHueIsColdestToWarmest ? coldestHue : warmestHue;
2096
+ const directionOfRotation = 1;
2097
+ let smallestError = 1e3;
2098
+ let answer = this.hctsByHue[Math.round(this.input.hue)];
2099
+ const complementRelativeTemp = 1 - this.inputRelativeTemperature;
2100
+ for (let hueAddend = 0; hueAddend <= 360; hueAddend += 1) {
2101
+ const hue = sanitizeDegreesDouble(startHue + directionOfRotation * hueAddend);
2102
+ if (!TemperatureCache.isBetween(hue, startHue, endHue)) {
2103
+ continue;
2104
+ }
2105
+ const possibleAnswer = this.hctsByHue[Math.round(hue)];
2106
+ const relativeTemp = (this.tempsByHct.get(possibleAnswer) - coldestTemp) / range;
2107
+ const error = Math.abs(complementRelativeTemp - relativeTemp);
2108
+ if (error < smallestError) {
2109
+ smallestError = error;
2110
+ answer = possibleAnswer;
2111
+ }
2112
+ }
2113
+ this.complementCache = answer;
2114
+ return this.complementCache;
2152
2115
  }
2153
- get inversePrimary() {
2154
- return this.props.inversePrimary;
2116
+ relativeTemperature(hct) {
2117
+ const range = this.tempsByHct.get(this.warmest) - this.tempsByHct.get(this.coldest);
2118
+ const differenceFromColdest = this.tempsByHct.get(hct) - this.tempsByHct.get(this.coldest);
2119
+ if (range === 0) {
2120
+ return 0.5;
2121
+ }
2122
+ return differenceFromColdest / range;
2155
2123
  }
2156
- static light(argb) {
2157
- return Scheme.lightFromCorePalette(CorePalette.of(argb));
2124
+ get inputRelativeTemperature() {
2125
+ if (this.inputRelativeTemperatureCache >= 0) {
2126
+ return this.inputRelativeTemperatureCache;
2127
+ }
2128
+ this.inputRelativeTemperatureCache = this.relativeTemperature(this.input);
2129
+ return this.inputRelativeTemperatureCache;
2158
2130
  }
2159
- static dark(argb) {
2160
- return Scheme.darkFromCorePalette(CorePalette.of(argb));
2131
+ get tempsByHct() {
2132
+ if (this.tempsByHctCache.size > 0) {
2133
+ return this.tempsByHctCache;
2134
+ }
2135
+ const allHcts = this.hctsByHue.concat([this.input]);
2136
+ const temperaturesByHct = /* @__PURE__ */ new Map();
2137
+ for (const e of allHcts) {
2138
+ temperaturesByHct.set(e, TemperatureCache.rawTemperature(e));
2139
+ }
2140
+ this.tempsByHctCache = temperaturesByHct;
2141
+ return temperaturesByHct;
2161
2142
  }
2162
- static lightContent(argb) {
2163
- return Scheme.lightFromCorePalette(CorePalette.contentOf(argb));
2143
+ get hctsByHue() {
2144
+ if (this.hctsByHueCache.length > 0) {
2145
+ return this.hctsByHueCache;
2146
+ }
2147
+ const hcts = [];
2148
+ for (let hue = 0; hue <= 360; hue += 1) {
2149
+ const colorAtHue = Hct.from(hue, this.input.chroma, this.input.tone);
2150
+ hcts.push(colorAtHue);
2151
+ }
2152
+ this.hctsByHueCache = hcts;
2153
+ return this.hctsByHueCache;
2164
2154
  }
2165
- static darkContent(argb) {
2166
- return Scheme.darkFromCorePalette(CorePalette.contentOf(argb));
2155
+ static isBetween(angle, a, b) {
2156
+ if (a < b) {
2157
+ return a <= angle && angle <= b;
2158
+ }
2159
+ return a <= angle || angle <= b;
2167
2160
  }
2168
- static lightFromCorePalette(core) {
2169
- return new Scheme({
2170
- primary: core.a1.tone(40),
2171
- onPrimary: core.a1.tone(100),
2172
- primaryContainer: core.a1.tone(90),
2173
- onPrimaryContainer: core.a1.tone(10),
2174
- secondary: core.a2.tone(40),
2175
- onSecondary: core.a2.tone(100),
2176
- secondaryContainer: core.a2.tone(90),
2177
- onSecondaryContainer: core.a2.tone(10),
2178
- tertiary: core.a3.tone(40),
2179
- onTertiary: core.a3.tone(100),
2180
- tertiaryContainer: core.a3.tone(90),
2181
- onTertiaryContainer: core.a3.tone(10),
2182
- error: core.error.tone(40),
2183
- onError: core.error.tone(100),
2184
- errorContainer: core.error.tone(90),
2185
- onErrorContainer: core.error.tone(10),
2186
- background: core.n1.tone(99),
2187
- onBackground: core.n1.tone(10),
2188
- surface: core.n1.tone(99),
2189
- onSurface: core.n1.tone(10),
2190
- surfaceVariant: core.n2.tone(90),
2191
- onSurfaceVariant: core.n2.tone(30),
2192
- outline: core.n2.tone(50),
2193
- outlineVariant: core.n2.tone(80),
2194
- shadow: core.n1.tone(0),
2195
- scrim: core.n1.tone(0),
2196
- inverseSurface: core.n1.tone(20),
2197
- inverseOnSurface: core.n1.tone(95),
2198
- inversePrimary: core.a1.tone(80)
2199
- });
2161
+ static rawTemperature(color) {
2162
+ const lab = labFromArgb(color.toInt());
2163
+ const hue = sanitizeDegreesDouble(Math.atan2(lab[2], lab[1]) * 180 / Math.PI);
2164
+ const chroma = Math.sqrt(lab[1] * lab[1] + lab[2] * lab[2]);
2165
+ const temperature = -0.5 + 0.02 * Math.pow(chroma, 1.07) * Math.cos(sanitizeDegreesDouble(hue - 50) * Math.PI / 180);
2166
+ return temperature;
2200
2167
  }
2201
- static darkFromCorePalette(core) {
2202
- return new Scheme({
2203
- primary: core.a1.tone(80),
2204
- onPrimary: core.a1.tone(20),
2205
- primaryContainer: core.a1.tone(30),
2206
- onPrimaryContainer: core.a1.tone(90),
2207
- secondary: core.a2.tone(80),
2208
- onSecondary: core.a2.tone(20),
2209
- secondaryContainer: core.a2.tone(30),
2210
- onSecondaryContainer: core.a2.tone(90),
2211
- tertiary: core.a3.tone(80),
2212
- onTertiary: core.a3.tone(20),
2213
- tertiaryContainer: core.a3.tone(30),
2214
- onTertiaryContainer: core.a3.tone(90),
2215
- error: core.error.tone(80),
2216
- onError: core.error.tone(20),
2217
- errorContainer: core.error.tone(30),
2218
- onErrorContainer: core.error.tone(80),
2219
- background: core.n1.tone(10),
2220
- onBackground: core.n1.tone(90),
2221
- surface: core.n1.tone(10),
2222
- onSurface: core.n1.tone(90),
2223
- surfaceVariant: core.n2.tone(30),
2224
- onSurfaceVariant: core.n2.tone(80),
2225
- outline: core.n2.tone(60),
2226
- outlineVariant: core.n2.tone(30),
2227
- shadow: core.n1.tone(0),
2228
- scrim: core.n1.tone(0),
2229
- inverseSurface: core.n1.tone(90),
2230
- inverseOnSurface: core.n1.tone(20),
2231
- inversePrimary: core.a1.tone(40)
2168
+ };
2169
+
2170
+ // node_modules/@material/material-color-utilities/scheme/scheme_content.js
2171
+ var SchemeContent = class extends DynamicScheme {
2172
+ constructor(sourceColorHct, isDark, contrastLevel) {
2173
+ super({
2174
+ sourceColorArgb: sourceColorHct.toInt(),
2175
+ variant: Variant.CONTENT,
2176
+ contrastLevel,
2177
+ isDark,
2178
+ primaryPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma),
2179
+ secondaryPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, Math.max(sourceColorHct.chroma - 32, sourceColorHct.chroma * 0.5)),
2180
+ tertiaryPalette: TonalPalette.fromInt(DislikeAnalyzer.fixIfDisliked(new TemperatureCache(sourceColorHct).analogous(3, 6)[2]).toInt()),
2181
+ neutralPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma / 8),
2182
+ neutralVariantPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma / 8 + 4)
2232
2183
  });
2233
2184
  }
2234
- constructor(props) {
2235
- this.props = props;
2236
- }
2237
- toJSON() {
2238
- return __spreadValues({}, this.props);
2239
- }
2240
2185
  };
2241
2186
 
2242
2187
  // node_modules/@material/material-color-utilities/scheme/scheme_expressive.js
@@ -2466,53 +2411,6 @@ function parseIntHex(value) {
2466
2411
  return parseInt(value, 16);
2467
2412
  }
2468
2413
 
2469
- // node_modules/@material/material-color-utilities/utils/theme_utils.js
2470
- function themeFromSourceColor(source, customColors = []) {
2471
- const palette = CorePalette.of(source);
2472
- return {
2473
- source,
2474
- schemes: {
2475
- light: Scheme.light(source),
2476
- dark: Scheme.dark(source)
2477
- },
2478
- palettes: {
2479
- primary: palette.a1,
2480
- secondary: palette.a2,
2481
- tertiary: palette.a3,
2482
- neutral: palette.n1,
2483
- neutralVariant: palette.n2,
2484
- error: palette.error
2485
- },
2486
- customColors: customColors.map((c) => customColor(source, c))
2487
- };
2488
- }
2489
- function customColor(source, color) {
2490
- let value = color.value;
2491
- const from = value;
2492
- const to = source;
2493
- if (color.blend) {
2494
- value = Blend.harmonize(from, to);
2495
- }
2496
- const palette = CorePalette.of(value);
2497
- const tones = palette.a1;
2498
- return {
2499
- color,
2500
- value,
2501
- light: {
2502
- color: tones.tone(40),
2503
- onColor: tones.tone(100),
2504
- colorContainer: tones.tone(90),
2505
- onColorContainer: tones.tone(10)
2506
- },
2507
- dark: {
2508
- color: tones.tone(80),
2509
- onColor: tones.tone(20),
2510
- colorContainer: tones.tone(30),
2511
- onColorContainer: tones.tone(90)
2512
- }
2513
- };
2514
- }
2515
-
2516
2414
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
2517
2415
  var HUE_TONES = [0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
2518
2416
  var NEUTRAL_HUES = /* @__PURE__ */ new Map([
@@ -2531,14 +2429,19 @@ var NEUTRAL_HUE_TONES = [...HUE_TONES, ...NEUTRAL_HUES.keys()];
2531
2429
  function getMaterialTonalPalettes(color) {
2532
2430
  try {
2533
2431
  let argbColor = argbFromHex(color);
2534
- const theme = themeFromSourceColor(argbColor, [
2535
- {
2536
- name: "m3-theme",
2537
- value: argbColor,
2538
- blend: true
2539
- }
2540
- ]);
2541
- return theme.palettes;
2432
+ const scheme = new SchemeContent(
2433
+ Hct.fromInt(argbColor),
2434
+ false,
2435
+ 0
2436
+ );
2437
+ return {
2438
+ primary: scheme.primaryPalette,
2439
+ secondary: scheme.secondaryPalette,
2440
+ tertiary: scheme.tertiaryPalette,
2441
+ neutral: scheme.neutralPalette,
2442
+ neutralVariant: scheme.neutralVariantPalette,
2443
+ error: scheme.errorPalette
2444
+ };
2542
2445
  } catch (e) {
2543
2446
  throw new Error("Cannot parse the specified color " + color + ". Please verify it is a hex color (ex. #ffffff or ffffff).");
2544
2447
  }