@wistia/ui 0.13.6 → 0.13.8-beta.3631de1a.e2e0ac7

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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.13.6
3
+ * @license @wistia/ui v0.13.8-beta.3631de1a.e2e0ac7
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -148,6 +148,7 @@ __export(index_exports, {
148
148
  ValueNameOrHexCode: () => ValueNameOrHexCode,
149
149
  ValueSwatch: () => ValueSwatch,
150
150
  WistiaLogo: () => WistiaLogo,
151
+ calculateContrast: () => calculateContrast,
151
152
  colorSchemeOptions: () => colorSchemeOptions,
152
153
  copyToClipboard: () => copyToClipboard,
153
154
  dateTime: () => dateTime,
@@ -1453,8 +1454,9 @@ var import_styled_components7 = require("styled-components");
1453
1454
  var zIndexTokens = import_styled_components7.css`
1454
1455
  --wui-zindex-under: -1;
1455
1456
  --wui-zindex-backdrop: 500;
1456
- --wui-zindex-modal: 500;
1457
1457
  --wui-zindex-menu: 500;
1458
+ --wui-zindex-modal: 500;
1459
+ --wui-zindex-popover: 500;
1458
1460
  --wui-zindex-select: 500;
1459
1461
  --wui-zindex-tooltip: 500;
1460
1462
  `;
@@ -9760,6 +9762,16 @@ var compositeOverWhite = (color, alpha = 1) => {
9760
9762
  b: compositeChannel(colorAsRgb.b)
9761
9763
  };
9762
9764
  };
9765
+ var calculateContrast = ({
9766
+ backgroundColor,
9767
+ foregroundColor = DEFAULT_COLOR_FOR_COMPARISON,
9768
+ backgroundOpacity = DEFAULT_OPACITY_FOR_CONTRAST_CALCULATION
9769
+ }) => {
9770
+ const backgroundColorAsRgb = convertToRgb(backgroundColor);
9771
+ const foregroundColorAsRgb = convertToRgb(foregroundColor);
9772
+ const compositeBackground = compositeOverWhite(backgroundColorAsRgb, backgroundOpacity);
9773
+ return (0, import_fn3.wcagContrast)(compositeBackground, foregroundColorAsRgb);
9774
+ };
9763
9775
  var snapValueToEdges = (value) => {
9764
9776
  if (value > 1 - VALUE_CHANNEL_SNAP_EPSILON) {
9765
9777
  return 1;
@@ -9782,13 +9794,15 @@ var updateSearchBounds = (searchingBrighter, contrast, minContrast, midValue, se
9782
9794
  return { newSearchLow: searchLow, newSearchHigh: midValue };
9783
9795
  };
9784
9796
  var getAccessibleColorByValueChannelChange = ({
9785
- originalHsv,
9797
+ originalColor,
9786
9798
  colorForComparison,
9787
9799
  minContrast,
9788
9800
  maxIterations = 50,
9789
9801
  direction,
9790
- opacityForContrastCalculation
9802
+ opacityForContrastCalculation,
9803
+ shouldConvertToHex = true
9791
9804
  }) => {
9805
+ const originalHsv = convertToHsv(originalColor);
9792
9806
  const searchingBrighter = direction === "brighter";
9793
9807
  const lowValue = searchingBrighter ? originalHsv.v : 0;
9794
9808
  const highValue = searchingBrighter ? 1 : originalHsv.v;
@@ -9799,10 +9813,11 @@ var getAccessibleColorByValueChannelChange = ({
9799
9813
  v: extremeValue,
9800
9814
  mode: "hsv"
9801
9815
  };
9802
- const extremeContrast = (0, import_fn3.wcagContrast)(
9803
- compositeOverWhite(extremeVariant, opacityForContrastCalculation),
9804
- colorForComparison
9805
- );
9816
+ const extremeContrast = calculateContrast({
9817
+ backgroundColor: shouldConvertToHex ? (0, import_fn3.formatHex)(extremeVariant) : extremeVariant,
9818
+ foregroundColor: colorForComparison,
9819
+ backgroundOpacity: opacityForContrastCalculation
9820
+ });
9806
9821
  if (extremeContrast < minContrast) {
9807
9822
  return null;
9808
9823
  }
@@ -9818,10 +9833,11 @@ var getAccessibleColorByValueChannelChange = ({
9818
9833
  v: midValue,
9819
9834
  mode: "hsv"
9820
9835
  };
9821
- const contrast = (0, import_fn3.wcagContrast)(
9822
- compositeOverWhite(candidateHsv, opacityForContrastCalculation),
9823
- colorForComparison
9824
- );
9836
+ const contrast = calculateContrast({
9837
+ backgroundColor: shouldConvertToHex ? (0, import_fn3.formatHex)(candidateHsv) : candidateHsv,
9838
+ foregroundColor: colorForComparison,
9839
+ backgroundOpacity: opacityForContrastCalculation
9840
+ });
9825
9841
  if (contrast >= minContrast) {
9826
9842
  bestSoFar = candidateHsv;
9827
9843
  }
@@ -9841,7 +9857,7 @@ var getAccessibleColorByValueChannelChange = ({
9841
9857
  }
9842
9858
  return bestSoFar;
9843
9859
  };
9844
- var chooseClosestDerivativeToOriginal = (brighterOption, darkerOption, originalHsv) => {
9860
+ var chooseClosestDerivativeToOriginal = (brighterOption, darkerOption, originalColor) => {
9845
9861
  const hsvDifference = (0, import_fn3.differenceEuclidean)("hsv");
9846
9862
  if (!brighterOption && !darkerOption) {
9847
9863
  return null;
@@ -9852,8 +9868,8 @@ var chooseClosestDerivativeToOriginal = (brighterOption, darkerOption, originalH
9852
9868
  if (!darkerOption && brighterOption != null) {
9853
9869
  return brighterOption;
9854
9870
  }
9855
- const brighterDifference = brighterOption === null ? Infinity : hsvDifference(originalHsv, brighterOption);
9856
- const darkerDifference = darkerOption === null ? Infinity : hsvDifference(originalHsv, darkerOption);
9871
+ const brighterDifference = brighterOption === null ? Infinity : hsvDifference(originalColor, brighterOption);
9872
+ const darkerDifference = darkerOption === null ? Infinity : hsvDifference(originalColor, darkerOption);
9857
9873
  if (brighterDifference <= darkerDifference && brighterOption != null) {
9858
9874
  return brighterOption;
9859
9875
  }
@@ -9863,12 +9879,13 @@ var chooseClosestDerivativeToOriginal = (brighterOption, darkerOption, originalH
9863
9879
  throw new Error("Unable to determine the best accessible color variant");
9864
9880
  };
9865
9881
  var getAccessibleColorBySaturationAndValueChange = ({
9866
- originalHsv,
9882
+ originalColor,
9867
9883
  colorForComparison,
9868
9884
  minContrast,
9869
9885
  direction,
9870
9886
  opacityForContrastCalculation
9871
9887
  }) => {
9888
+ const originalHsv = convertToHsv(originalColor);
9872
9889
  const hsvDifference = (0, import_fn3.differenceEuclidean)("hsv");
9873
9890
  const maxIterations = 50;
9874
9891
  let lowStep = 0;
@@ -9894,7 +9911,11 @@ var getAccessibleColorBySaturationAndValueChange = ({
9894
9911
  };
9895
9912
  };
9896
9913
  const checkContrast = (hsv) => {
9897
- return (0, import_fn3.wcagContrast)(compositeOverWhite(hsv, opacityForContrastCalculation), colorForComparison);
9914
+ return calculateContrast({
9915
+ backgroundColor: (0, import_fn3.formatHex)(hsv),
9916
+ foregroundColor: colorForComparison,
9917
+ backgroundOpacity: opacityForContrastCalculation
9918
+ });
9898
9919
  };
9899
9920
  const extremeHsv = getHsvForStep(highStep);
9900
9921
  if (checkContrast(extremeHsv) < minContrast) {
@@ -9923,7 +9944,7 @@ var getAccessibleColorBySaturationAndValueChange = ({
9923
9944
  return bestCandidate;
9924
9945
  };
9925
9946
  var getAccessibleColorInDirection = ({
9926
- originalHsv,
9947
+ originalColor,
9927
9948
  colorForComparison,
9928
9949
  minContrast,
9929
9950
  maxIterations = 50,
@@ -9931,7 +9952,7 @@ var getAccessibleColorInDirection = ({
9931
9952
  opacityForContrastCalculation
9932
9953
  }) => {
9933
9954
  const valueResult = getAccessibleColorByValueChannelChange({
9934
- originalHsv,
9955
+ originalColor,
9935
9956
  colorForComparison,
9936
9957
  minContrast,
9937
9958
  maxIterations,
@@ -9942,7 +9963,7 @@ var getAccessibleColorInDirection = ({
9942
9963
  return valueResult;
9943
9964
  }
9944
9965
  return getAccessibleColorBySaturationAndValueChange({
9945
- originalHsv,
9966
+ originalColor,
9946
9967
  colorForComparison,
9947
9968
  minContrast,
9948
9969
  direction,
@@ -9950,21 +9971,23 @@ var getAccessibleColorInDirection = ({
9950
9971
  });
9951
9972
  };
9952
9973
  var getAccessibleColor = ({
9953
- originalHsv,
9974
+ originalColor,
9954
9975
  colorForComparison,
9955
9976
  minContrast = DEFAULT_MIN_CONTRAST,
9956
9977
  maxIterations = 50,
9957
9978
  opacityForContrastCalculation
9958
9979
  }) => {
9959
- const originalContrast = (0, import_fn3.wcagContrast)(
9960
- compositeOverWhite(originalHsv, opacityForContrastCalculation),
9961
- colorForComparison
9962
- );
9980
+ const originalColorAsHsv = convertToHsv(originalColor);
9981
+ const originalContrast = calculateContrast({
9982
+ backgroundColor: (0, import_fn3.formatHex)(originalColorAsHsv),
9983
+ foregroundColor: colorForComparison,
9984
+ backgroundOpacity: opacityForContrastCalculation
9985
+ });
9963
9986
  if (originalContrast >= minContrast) {
9964
- return originalHsv;
9987
+ return convertToHsv(originalColor);
9965
9988
  }
9966
9989
  const brighterOption = getAccessibleColorInDirection({
9967
- originalHsv,
9990
+ originalColor,
9968
9991
  colorForComparison,
9969
9992
  minContrast,
9970
9993
  maxIterations,
@@ -9972,43 +9995,45 @@ var getAccessibleColor = ({
9972
9995
  opacityForContrastCalculation
9973
9996
  });
9974
9997
  const darkerOption = getAccessibleColorInDirection({
9975
- originalHsv,
9998
+ originalColor,
9976
9999
  colorForComparison,
9977
10000
  minContrast,
9978
10001
  maxIterations,
9979
10002
  direction: "darker",
9980
10003
  opacityForContrastCalculation
9981
10004
  });
9982
- const result = chooseClosestDerivativeToOriginal(brighterOption, darkerOption, originalHsv);
10005
+ const result = chooseClosestDerivativeToOriginal(brighterOption, darkerOption, originalColor);
9983
10006
  if (result == null) {
9984
10007
  throw new Error(
9985
- `Unable to get accessible derivative for ${(0, import_fn3.formatHex)(originalHsv)} at minimum contrast ratio ${minContrast}`
10008
+ `Unable to get accessible derivative for ${(0, import_fn3.formatHex)(originalColor)} at minimum contrast ratio ${minContrast}`
9986
10009
  );
9987
10010
  }
9988
10011
  return result;
9989
10012
  };
9990
10013
  var hasAccessibleDerivatives = ({
9991
- originalHsv,
10014
+ originalColor,
9992
10015
  colorForComparison,
9993
10016
  minContrast = DEFAULT_MIN_CONTRAST,
9994
10017
  opacityForContrastCalculation
9995
10018
  }) => {
9996
- const originalContrast = (0, import_fn3.wcagContrast)(
9997
- compositeOverWhite(originalHsv, opacityForContrastCalculation),
9998
- colorForComparison
9999
- );
10019
+ const originalColorAsHsv = convertToHsv(originalColor);
10020
+ const originalContrast = calculateContrast({
10021
+ backgroundColor: (0, import_fn3.formatHex)(originalColorAsHsv),
10022
+ foregroundColor: colorForComparison,
10023
+ backgroundOpacity: opacityForContrastCalculation
10024
+ });
10000
10025
  if (originalContrast >= minContrast) {
10001
10026
  return true;
10002
10027
  }
10003
10028
  const brighterOption = getAccessibleColorInDirection({
10004
- originalHsv,
10029
+ originalColor,
10005
10030
  colorForComparison,
10006
10031
  minContrast,
10007
10032
  direction: "brighter",
10008
10033
  opacityForContrastCalculation
10009
10034
  });
10010
10035
  const darkerOption = getAccessibleColorInDirection({
10011
- originalHsv,
10036
+ originalColor,
10012
10037
  colorForComparison,
10013
10038
  minContrast,
10014
10039
  direction: "darker",
@@ -10032,27 +10057,28 @@ var ColorPickerProvider = ({
10032
10057
  const [nonDerivedValueAsHsv, setNonDerivedValueAsHsv] = (0, import_react41.useState)(convertToHsv(valueAsHex));
10033
10058
  const [shouldEnforceMinContrast, setShouldEnforceMinContrast] = (0, import_react41.useState)(false);
10034
10059
  const getAccessibleDerivativeColor = (0, import_react41.useCallback)(
10035
- (originalHsv) => getAccessibleColor({
10036
- originalHsv,
10060
+ (originalColor) => getAccessibleColor({
10061
+ originalColor,
10037
10062
  colorForComparison,
10038
10063
  minContrast: minimumContrastRatio,
10039
10064
  opacityForContrastCalculation
10040
10065
  }),
10041
10066
  [colorForComparison, minimumContrastRatio, opacityForContrastCalculation]
10042
10067
  );
10043
- const valueAsHsv = shouldEnforceMinContrast ? getAccessibleDerivativeColor(nonDerivedValueAsHsv) : nonDerivedValueAsHsv;
10044
- const currentContrastRatio = (0, import_fn4.wcagContrast)(
10045
- compositeOverWhite(valueAsHsv, opacityForContrastCalculation),
10046
- colorForComparison
10047
- );
10068
+ const valueAsHsv = shouldEnforceMinContrast ? getAccessibleDerivativeColor((0, import_fn4.formatHex)(nonDerivedValueAsHsv)) : nonDerivedValueAsHsv;
10069
+ const currentContrastRatio = calculateContrast({
10070
+ backgroundColor: valueAsHex,
10071
+ foregroundColor: colorForComparison,
10072
+ backgroundOpacity: opacityForContrastCalculation
10073
+ });
10048
10074
  const hasAccessibleDerivativesValue = (0, import_react41.useMemo)(() => {
10049
10075
  return hasAccessibleDerivatives({
10050
- originalHsv: valueAsHsv,
10076
+ originalColor: valueAsHex,
10051
10077
  colorForComparison,
10052
10078
  minContrast: minimumContrastRatio,
10053
10079
  opacityForContrastCalculation
10054
10080
  });
10055
- }, [valueAsHsv, colorForComparison, minimumContrastRatio, opacityForContrastCalculation]);
10081
+ }, [valueAsHex, colorForComparison, minimumContrastRatio, opacityForContrastCalculation]);
10056
10082
  const onChangeNonDerivedValueAsHsv = (0, import_react41.useCallback)((nonDerivedValue) => {
10057
10083
  setNonDerivedValueAsHsv(nonDerivedValue);
10058
10084
  }, []);
@@ -10076,15 +10102,21 @@ var ColorPickerProvider = ({
10076
10102
  const setShouldEnforceMinContrastWrapped = (0, import_react41.useCallback)(
10077
10103
  (newShouldEnforceMinContrast) => {
10078
10104
  setShouldEnforceMinContrast(newShouldEnforceMinContrast);
10079
- const newColorAsHsv = newShouldEnforceMinContrast ? getAccessibleDerivativeColor(valueAsHsv) : nonDerivedValueAsHsv;
10105
+ const newColorAsHsv = newShouldEnforceMinContrast ? getAccessibleDerivativeColor(valueAsHex) : nonDerivedValueAsHsv;
10080
10106
  const currentHsv = valueAsHsv;
10081
10107
  if (currentHsv.h !== newColorAsHsv.h || currentHsv.s !== newColorAsHsv.s || currentHsv.v !== newColorAsHsv.v) {
10082
10108
  changeValueSmoothly(newColorAsHsv);
10083
10109
  }
10084
10110
  },
10085
- [changeValueSmoothly, getAccessibleDerivativeColor, nonDerivedValueAsHsv, valueAsHsv]
10111
+ [
10112
+ changeValueSmoothly,
10113
+ getAccessibleDerivativeColor,
10114
+ nonDerivedValueAsHsv,
10115
+ valueAsHex,
10116
+ valueAsHsv
10117
+ ]
10086
10118
  );
10087
- const whatValuePropShouldBe = shouldEnforceMinContrast ? (0, import_fn4.formatHex)(getAccessibleDerivativeColor(nonDerivedValueAsHsv)) : (0, import_fn4.formatHex)(nonDerivedValueAsHsv);
10119
+ const whatValuePropShouldBe = shouldEnforceMinContrast ? (0, import_fn4.formatHex)(getAccessibleDerivativeColor((0, import_fn4.formatHex)(nonDerivedValueAsHsv))) : (0, import_fn4.formatHex)(nonDerivedValueAsHsv);
10088
10120
  (0, import_react41.useEffect)(() => {
10089
10121
  if (valueAsHex !== whatValuePropShouldBe && !isTransitioning) {
10090
10122
  onValueChange(whatValuePropShouldBe);
@@ -10166,6 +10198,7 @@ ColorGrid.displayName = "ColorGrid_UI";
10166
10198
  // src/components/ColorPicker/ColorGridOption.tsx
10167
10199
  var import_styled_components50 = __toESM(require("styled-components"));
10168
10200
  var import_react_radio_group2 = require("@radix-ui/react-radio-group");
10201
+ var import_fn5 = require("culori/fn");
10169
10202
 
10170
10203
  // src/components/ColorPicker/ColorSwatch.tsx
10171
10204
  var import_styled_components48 = __toESM(require("styled-components"));
@@ -10386,7 +10419,8 @@ var Container2 = (0, import_styled_components50.default)(import_react_radio_grou
10386
10419
  user-select: none;
10387
10420
  `;
10388
10421
  var ColorGridOption = ({ value, name }) => {
10389
- const { valueAsHex, nonDerivedValueAsHex } = useColorPickerState();
10422
+ const { valueAsHsv, nonDerivedValueAsHex } = useColorPickerState();
10423
+ const valueAsHex = (0, import_fn5.formatHex)(valueAsHsv);
10390
10424
  const isSelected = valueAsHex === value;
10391
10425
  const derivativeIsSelected = !isSelected && nonDerivedValueAsHex === value;
10392
10426
  return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
@@ -10483,6 +10517,7 @@ ColorListGroup.displayName = "ColorListGroup_UI";
10483
10517
  // src/components/ColorPicker/ColorListOption.tsx
10484
10518
  var import_styled_components53 = __toESM(require("styled-components"));
10485
10519
  var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
10520
+ var import_fn6 = require("culori/fn");
10486
10521
 
10487
10522
  // src/components/ColorPicker/ColorNameOrHexCode.tsx
10488
10523
  var import_jsx_runtime232 = require("react/jsx-runtime");
@@ -10542,7 +10577,8 @@ var Container4 = (0, import_styled_components53.default)(import_react_toggle_gro
10542
10577
  }
10543
10578
  `;
10544
10579
  var ColorListOption = ({ value, name }) => {
10545
- const { valueAsHex, nonDerivedValueAsHex } = useColorPickerState();
10580
+ const { valueAsHsv, nonDerivedValueAsHex } = useColorPickerState();
10581
+ const valueAsHex = (0, import_fn6.formatHex)(valueAsHsv);
10546
10582
  const isSelected = valueAsHex === value;
10547
10583
  const derivativeIsSelected = !isSelected && nonDerivedValueAsHex === value;
10548
10584
  return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(
@@ -10614,6 +10650,7 @@ var StyledPopoverContent = (0, import_styled_components54.default)(import_react_
10614
10650
  flex-direction: column;
10615
10651
  max-width: ${COLOR_PICKER_POPOVER_MAX_WIDTH_PX}px;
10616
10652
  overflow: hidden;
10653
+ z-index: var(--wui-zindex-select);
10617
10654
  `;
10618
10655
  var ColorPickerPopoverContent = ({
10619
10656
  children
@@ -10710,6 +10747,9 @@ var Container6 = import_styled_components57.default.div`
10710
10747
  justify-content: end;
10711
10748
  align-items: center;
10712
10749
  `;
10750
+ var floorToTenth = (value) => {
10751
+ return Math.floor(value * 10) / 10;
10752
+ };
10713
10753
  var ContrastIndicator = () => {
10714
10754
  const { currentContrastRatio, minimumContrastRatio } = useColorPickerState();
10715
10755
  const isContrastSufficient = currentContrastRatio >= minimumContrastRatio;
@@ -10729,7 +10769,7 @@ var ContrastIndicator = () => {
10729
10769
  renderAs: "span",
10730
10770
  variant: "body4Mono",
10731
10771
  children: [
10732
- currentContrastRatio.toFixed(2),
10772
+ floorToTenth(currentContrastRatio).toFixed(1),
10733
10773
  ":1"
10734
10774
  ]
10735
10775
  }
@@ -10987,7 +11027,7 @@ ContrastControls.displayName = "ContrastControls_UI";
10987
11027
 
10988
11028
  // src/components/ColorPicker/HexColorInput.tsx
10989
11029
  var import_react48 = require("react");
10990
- var import_fn5 = require("culori/fn");
11030
+ var import_fn7 = require("culori/fn");
10991
11031
 
10992
11032
  // src/components/Input/Input.tsx
10993
11033
  var import_react47 = require("react");
@@ -11217,7 +11257,7 @@ var HexColorInput = ({ autoFocus = true }) => {
11217
11257
  (event) => {
11218
11258
  const newValue = (event.target.value || "#").trim().toLocaleLowerCase();
11219
11259
  setTextInputValue(newValue);
11220
- const isValidHexValue = Boolean((0, import_fn5.parseHex)(newValue));
11260
+ const isValidHexValue = Boolean((0, import_fn7.parseHex)(newValue));
11221
11261
  if (!isValidHexValue) {
11222
11262
  return;
11223
11263
  }
@@ -11299,7 +11339,7 @@ var HexColorInput = ({ autoFocus = true }) => {
11299
11339
  event.preventDefault();
11300
11340
  const pastedText = event.clipboardData.getData("text");
11301
11341
  const normalizedValue = normalizeHexInput(pastedText);
11302
- const isValidHexValue = Boolean((0, import_fn5.parseHex)(normalizedValue));
11342
+ const isValidHexValue = Boolean((0, import_fn7.parseHex)(normalizedValue));
11303
11343
  setTextInputValue(normalizedValue);
11304
11344
  if (!isValidHexValue) {
11305
11345
  return;
@@ -11362,12 +11402,12 @@ HexColorInput.displayName = "HexColorInput_UI";
11362
11402
  var import_react50 = require("react");
11363
11403
  var import_react_slider = require("@radix-ui/react-slider");
11364
11404
  var import_styled_components62 = __toESM(require("styled-components"));
11365
- var import_fn7 = require("culori/fn");
11405
+ var import_fn9 = require("culori/fn");
11366
11406
 
11367
11407
  // src/components/ColorPicker/HSVHueCanvas.tsx
11368
11408
  var import_react49 = require("react");
11369
11409
  var import_styled_components61 = __toESM(require("styled-components"));
11370
- var import_fn6 = require("culori/fn");
11410
+ var import_fn8 = require("culori/fn");
11371
11411
  var import_jsx_runtime247 = require("react/jsx-runtime");
11372
11412
  var Canvas = import_styled_components61.default.canvas`
11373
11413
  display: block;
@@ -11389,7 +11429,7 @@ var HSVHueCanvas = ({ hsv }) => {
11389
11429
  const gradient = ctx.createLinearGradient(0, 0, width, 0);
11390
11430
  for (let i = 0; i <= THREE_SIXTY; i++) {
11391
11431
  const hue = i;
11392
- const hexColor = (0, import_fn6.formatHex)({ h: hue, s: hsv.s, v: hsv.v, mode: "hsv" });
11432
+ const hexColor = (0, import_fn8.formatHex)({ h: hue, s: hsv.s, v: hsv.v, mode: "hsv" });
11393
11433
  if (hexColor) {
11394
11434
  gradient.addColorStop(i / THREE_SIXTY, hexColor);
11395
11435
  }
@@ -11452,7 +11492,7 @@ var HueSlider = () => {
11452
11492
  const { nonDerivedValueAsHsv, onChangeNonDerivedValueAsHsv, valueAsHsv } = useColorPickerState();
11453
11493
  const containerStyle = (0, import_react50.useMemo)(() => {
11454
11494
  return {
11455
- backgroundColor: (0, import_fn7.formatHex)({
11495
+ backgroundColor: (0, import_fn9.formatHex)({
11456
11496
  h: 0,
11457
11497
  // red
11458
11498
  s: valueAsHsv.s,
@@ -11462,7 +11502,7 @@ var HueSlider = () => {
11462
11502
  };
11463
11503
  }, [valueAsHsv.s, valueAsHsv.v]);
11464
11504
  const thumbInnerStyle = (0, import_react50.useMemo)(() => {
11465
- return { backgroundColor: (0, import_fn7.formatHex)(valueAsHsv) };
11505
+ return { backgroundColor: (0, import_fn9.formatHex)(valueAsHsv) };
11466
11506
  }, [valueAsHsv]);
11467
11507
  const onHueChange = (0, import_react50.useCallback)(
11468
11508
  (values) => {
@@ -11541,11 +11581,13 @@ var calculateContrastCurve = (width, height, hue, minimumContrastRatio, colorFor
11541
11581
  const saturationChanel = x / (width - 1);
11542
11582
  const initialValueChannelForSearch = limit === "upper" ? 0 : 1;
11543
11583
  const colorForXAsHsv = getAccessibleColorByValueChannelChange({
11544
- originalHsv: { h: hue, s: saturationChanel, v: initialValueChannelForSearch, mode: "hsv" },
11584
+ originalColor: { h: hue, s: saturationChanel, v: initialValueChannelForSearch, mode: "hsv" },
11545
11585
  colorForComparison,
11546
11586
  minContrast: minimumContrastRatio,
11547
11587
  direction: limit === "upper" ? "brighter" : "darker",
11548
- opacityForContrastCalculation
11588
+ opacityForContrastCalculation,
11589
+ // We set shouldConvertToHex to false to make the curve smoother.
11590
+ shouldConvertToHex: false
11549
11591
  });
11550
11592
  if (colorForXAsHsv != null) {
11551
11593
  const point = {
@@ -14518,6 +14560,7 @@ PopoverArrow.displayName = "PopoverArrow_UI";
14518
14560
  // src/components/Popover/Popover.tsx
14519
14561
  var import_jsx_runtime282 = require("react/jsx-runtime");
14520
14562
  var StyledContent2 = (0, import_styled_components90.default)(import_react_popover5.Content)`
14563
+ z-index: var(--wui-zindex-popover);
14521
14564
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
14522
14565
  ${({ $unstyled }) => !$unstyled && import_styled_components90.css`
14523
14566
  border-radius: var(--wui-border-radius-02);
@@ -16965,6 +17008,7 @@ var ContextMenu = ({
16965
17008
  ValueNameOrHexCode,
16966
17009
  ValueSwatch,
16967
17010
  WistiaLogo,
17011
+ calculateContrast,
16968
17012
  colorSchemeOptions,
16969
17013
  copyToClipboard,
16970
17014
  dateTime,