@trops/dash-react 1.0.58 → 1.0.59

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
@@ -1166,18 +1166,32 @@ function deriveShades(hex) {
1166
1166
  s = _rgbToHsl.s,
1167
1167
  l = _rgbToHsl.l;
1168
1168
  var baseL = l < 0.2 || l > 0.8 ? 0.5 : l;
1169
+ // Anchor every stop to the input's lightness so the scale always darkens
1170
+ // 50 → 950 with the input at 500. Lighter stops sit a fixed fraction of
1171
+ // the way from the input up to near-white; darker stops a fixed fraction
1172
+ // of the way down to near-black. (Fixed absolute targets put light inputs
1173
+ // above 400 and dark inputs below 600 — an inverted scale.) For a
1174
+ // mid-lightness input (0.5) these land close to the previous curve.
1175
+ var LIGHTEST = 0.975;
1176
+ var DARKEST = 0.03;
1177
+ var lighter = function lighter(f) {
1178
+ return baseL + (LIGHTEST - baseL) * f;
1179
+ };
1180
+ var darker = function darker(f) {
1181
+ return baseL - (baseL - DARKEST) * f;
1182
+ };
1169
1183
  var targets = {
1170
- 50: 0.96,
1171
- 100: 0.9,
1172
- 200: 0.8,
1173
- 300: 0.68,
1174
- 400: 0.55,
1184
+ 50: lighter(0.96),
1185
+ 100: lighter(0.85),
1186
+ 200: lighter(0.66),
1187
+ 300: lighter(0.45),
1188
+ 400: lighter(0.22),
1175
1189
  500: baseL,
1176
- 600: 0.42,
1177
- 700: 0.32,
1178
- 800: 0.22,
1179
- 900: 0.13,
1180
- 950: 0.08
1190
+ 600: darker(0.14),
1191
+ 700: darker(0.28),
1192
+ 800: darker(0.48),
1193
+ 900: darker(0.7),
1194
+ 950: darker(0.9)
1181
1195
  };
1182
1196
  // Slight saturation curve: lighter shades fade saturation toward
1183
1197
  // white-ish; darker shades fade toward black-ish. Mirrors how