@wistia/ui 0.13.4-beta.2b044a7a.db3308f → 0.13.4-beta.2cd63f74.6c81112
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 +241 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +285 -194
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.13.4-beta.
|
|
3
|
+
* @license @wistia/ui v0.13.4-beta.2cd63f74.6c81112
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -9647,50 +9647,41 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
9647
9647
|
] }) });
|
|
9648
9648
|
};
|
|
9649
9649
|
|
|
9650
|
-
// src/components/ColorPicker/ColorGrid.tsx
|
|
9651
|
-
var import_react42 = require("react");
|
|
9652
|
-
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9653
|
-
var import_react_radio_group = require("@radix-ui/react-radio-group");
|
|
9654
|
-
|
|
9655
|
-
// src/components/ColorPicker/ColorPickerContext.tsx
|
|
9656
|
-
var import_react41 = require("react");
|
|
9657
|
-
var import_fn4 = require("culori/fn");
|
|
9658
|
-
|
|
9659
9650
|
// src/components/ColorPicker/color-conversion-utils.ts
|
|
9660
9651
|
var import_fn = require("culori/fn");
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
(0, import_fn.useMode)(import_fn.modeLrgb);
|
|
9652
|
+
(0, import_fn.useMode)(import_fn.modeRgb);
|
|
9653
|
+
(0, import_fn.useMode)(import_fn.modeHsv);
|
|
9664
9654
|
var convertToHsv = (color) => {
|
|
9665
|
-
|
|
9666
|
-
if (
|
|
9667
|
-
|
|
9668
|
-
if (rgb == null) {
|
|
9669
|
-
throw new Error(`Invalid hex color value: ${color}`);
|
|
9670
|
-
}
|
|
9671
|
-
result = convertToHsvRaw(rgb);
|
|
9672
|
-
}
|
|
9673
|
-
result = convertToHsvRaw(color);
|
|
9674
|
-
if (result == null) {
|
|
9675
|
-
throw new Error(`Invalid color value: ${JSON.stringify(color)}`);
|
|
9655
|
+
const rgb = (0, import_fn.parseHex)(color);
|
|
9656
|
+
if (rgb == null) {
|
|
9657
|
+
throw new Error(`Invalid hex color value: ${color}`);
|
|
9676
9658
|
}
|
|
9677
|
-
return
|
|
9659
|
+
return (0, import_fn.convertRgbToHsv)(rgb);
|
|
9678
9660
|
};
|
|
9679
|
-
var
|
|
9661
|
+
var convertToLrgb = (color) => {
|
|
9680
9662
|
let result;
|
|
9681
9663
|
if (typeof color === "string") {
|
|
9682
9664
|
const rgb = (0, import_fn.parseHex)(color);
|
|
9683
9665
|
if (rgb == null) {
|
|
9684
9666
|
throw new Error(`Invalid hex color value: ${color}`);
|
|
9685
9667
|
}
|
|
9686
|
-
result =
|
|
9687
|
-
}
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
throw new Error(`Invalid color value: ${JSON.stringify(color)}`);
|
|
9668
|
+
result = (0, import_fn.convertRgbToLrgb)(rgb);
|
|
9669
|
+
} else {
|
|
9670
|
+
const rgb = (0, import_fn.convertHsvToRgb)(color);
|
|
9671
|
+
result = (0, import_fn.convertRgbToLrgb)(rgb);
|
|
9691
9672
|
}
|
|
9692
9673
|
return result;
|
|
9693
9674
|
};
|
|
9675
|
+
var convertToRgb = (hsv) => (0, import_fn.convertHsvToRgb)(hsv);
|
|
9676
|
+
|
|
9677
|
+
// src/components/ColorPicker/ColorGrid.tsx
|
|
9678
|
+
var import_react42 = require("react");
|
|
9679
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9680
|
+
var import_react_radio_group = require("@radix-ui/react-radio-group");
|
|
9681
|
+
|
|
9682
|
+
// src/components/ColorPicker/ColorPickerContext.tsx
|
|
9683
|
+
var import_react41 = require("react");
|
|
9684
|
+
var import_fn4 = require("culori/fn");
|
|
9694
9685
|
|
|
9695
9686
|
// src/components/ColorPicker/transitionBetweenColors.ts
|
|
9696
9687
|
var import_fn2 = require("culori/fn");
|
|
@@ -9772,7 +9763,7 @@ var updateSearchBounds = (searchingBrighter, contrast, minContrast, midValue, se
|
|
|
9772
9763
|
};
|
|
9773
9764
|
var getAccessibleColorByValueChannelChange = ({
|
|
9774
9765
|
originalHsv,
|
|
9775
|
-
|
|
9766
|
+
colorForComparisonAsLrgb,
|
|
9776
9767
|
minContrast,
|
|
9777
9768
|
maxIterations = 50,
|
|
9778
9769
|
direction
|
|
@@ -9787,7 +9778,8 @@ var getAccessibleColorByValueChannelChange = ({
|
|
|
9787
9778
|
v: extremeValue,
|
|
9788
9779
|
mode: "hsv"
|
|
9789
9780
|
};
|
|
9790
|
-
const
|
|
9781
|
+
const extremeVariantAsLrgb = convertToLrgb(extremeVariant);
|
|
9782
|
+
const extremeContrast = (0, import_fn3.wcagContrast)(extremeVariantAsLrgb, colorForComparisonAsLrgb);
|
|
9791
9783
|
if (extremeContrast < minContrast) {
|
|
9792
9784
|
return null;
|
|
9793
9785
|
}
|
|
@@ -9803,7 +9795,7 @@ var getAccessibleColorByValueChannelChange = ({
|
|
|
9803
9795
|
v: midValue,
|
|
9804
9796
|
mode: "hsv"
|
|
9805
9797
|
};
|
|
9806
|
-
const contrast = (0, import_fn3.wcagContrast)(candidateHsv,
|
|
9798
|
+
const contrast = (0, import_fn3.wcagContrast)(convertToLrgb(candidateHsv), colorForComparisonAsLrgb);
|
|
9807
9799
|
if (contrast >= minContrast) {
|
|
9808
9800
|
bestSoFar = candidateHsv;
|
|
9809
9801
|
}
|
|
@@ -9846,7 +9838,7 @@ var chooseClosestDerivativeToOriginal = (brighterOption, darkerOption, originalH
|
|
|
9846
9838
|
};
|
|
9847
9839
|
var getAccessibleColorBySaturationAndValueChange = ({
|
|
9848
9840
|
originalHsv,
|
|
9849
|
-
|
|
9841
|
+
colorForComparisonAsLrgb,
|
|
9850
9842
|
minContrast,
|
|
9851
9843
|
direction
|
|
9852
9844
|
}) => {
|
|
@@ -9875,7 +9867,7 @@ var getAccessibleColorBySaturationAndValueChange = ({
|
|
|
9875
9867
|
};
|
|
9876
9868
|
};
|
|
9877
9869
|
const checkContrast = (hsv) => {
|
|
9878
|
-
return (0, import_fn3.wcagContrast)(hsv,
|
|
9870
|
+
return (0, import_fn3.wcagContrast)(convertToLrgb(hsv), colorForComparisonAsLrgb);
|
|
9879
9871
|
};
|
|
9880
9872
|
const extremeHsv = getHsvForStep(highStep);
|
|
9881
9873
|
if (checkContrast(extremeHsv) < minContrast) {
|
|
@@ -9905,14 +9897,14 @@ var getAccessibleColorBySaturationAndValueChange = ({
|
|
|
9905
9897
|
};
|
|
9906
9898
|
var getAccessibleColorInDirection = ({
|
|
9907
9899
|
originalHsv,
|
|
9908
|
-
|
|
9900
|
+
colorForComparisonAsLrgb,
|
|
9909
9901
|
minContrast,
|
|
9910
9902
|
maxIterations = 50,
|
|
9911
9903
|
direction
|
|
9912
9904
|
}) => {
|
|
9913
9905
|
const valueResult = getAccessibleColorByValueChannelChange({
|
|
9914
9906
|
originalHsv,
|
|
9915
|
-
|
|
9907
|
+
colorForComparisonAsLrgb,
|
|
9916
9908
|
minContrast,
|
|
9917
9909
|
maxIterations,
|
|
9918
9910
|
direction
|
|
@@ -9922,31 +9914,31 @@ var getAccessibleColorInDirection = ({
|
|
|
9922
9914
|
}
|
|
9923
9915
|
return getAccessibleColorBySaturationAndValueChange({
|
|
9924
9916
|
originalHsv,
|
|
9925
|
-
|
|
9917
|
+
colorForComparisonAsLrgb,
|
|
9926
9918
|
minContrast,
|
|
9927
9919
|
direction
|
|
9928
9920
|
});
|
|
9929
9921
|
};
|
|
9930
9922
|
var getAccessibleColor = ({
|
|
9931
9923
|
originalHsv,
|
|
9932
|
-
|
|
9924
|
+
colorForComparisonAsLrgb,
|
|
9933
9925
|
minContrast = DEFAULT_MIN_CONTRAST,
|
|
9934
9926
|
maxIterations = 50
|
|
9935
9927
|
}) => {
|
|
9936
|
-
const originalContrast = (0, import_fn3.wcagContrast)(originalHsv,
|
|
9928
|
+
const originalContrast = (0, import_fn3.wcagContrast)(convertToLrgb(originalHsv), colorForComparisonAsLrgb);
|
|
9937
9929
|
if (originalContrast >= minContrast) {
|
|
9938
9930
|
return originalHsv;
|
|
9939
9931
|
}
|
|
9940
9932
|
const brighterOption = getAccessibleColorInDirection({
|
|
9941
9933
|
originalHsv,
|
|
9942
|
-
|
|
9934
|
+
colorForComparisonAsLrgb,
|
|
9943
9935
|
minContrast,
|
|
9944
9936
|
maxIterations,
|
|
9945
9937
|
direction: "brighter"
|
|
9946
9938
|
});
|
|
9947
9939
|
const darkerOption = getAccessibleColorInDirection({
|
|
9948
9940
|
originalHsv,
|
|
9949
|
-
|
|
9941
|
+
colorForComparisonAsLrgb,
|
|
9950
9942
|
minContrast,
|
|
9951
9943
|
maxIterations,
|
|
9952
9944
|
direction: "darker"
|
|
@@ -9961,22 +9953,22 @@ var getAccessibleColor = ({
|
|
|
9961
9953
|
};
|
|
9962
9954
|
var hasAccessibleDerivatives = ({
|
|
9963
9955
|
originalHsv,
|
|
9964
|
-
|
|
9956
|
+
colorForComparisonAsLrgb,
|
|
9965
9957
|
minContrast = DEFAULT_MIN_CONTRAST
|
|
9966
9958
|
}) => {
|
|
9967
|
-
const originalContrast = (0, import_fn3.wcagContrast)(originalHsv,
|
|
9959
|
+
const originalContrast = (0, import_fn3.wcagContrast)(convertToLrgb(originalHsv), colorForComparisonAsLrgb);
|
|
9968
9960
|
if (originalContrast >= minContrast) {
|
|
9969
9961
|
return true;
|
|
9970
9962
|
}
|
|
9971
9963
|
const brighterOption = getAccessibleColorInDirection({
|
|
9972
9964
|
originalHsv,
|
|
9973
|
-
|
|
9965
|
+
colorForComparisonAsLrgb,
|
|
9974
9966
|
minContrast,
|
|
9975
9967
|
direction: "brighter"
|
|
9976
9968
|
});
|
|
9977
9969
|
const darkerOption = getAccessibleColorInDirection({
|
|
9978
9970
|
originalHsv,
|
|
9979
|
-
|
|
9971
|
+
colorForComparisonAsLrgb,
|
|
9980
9972
|
minContrast,
|
|
9981
9973
|
direction: "darker"
|
|
9982
9974
|
});
|
|
@@ -9985,100 +9977,190 @@ var hasAccessibleDerivatives = ({
|
|
|
9985
9977
|
|
|
9986
9978
|
// src/components/ColorPicker/ColorPickerContext.tsx
|
|
9987
9979
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9980
|
+
var createInitialState = ({
|
|
9981
|
+
valueAsHex,
|
|
9982
|
+
shouldEnforceMinContrast,
|
|
9983
|
+
colorForComparisonAsHex,
|
|
9984
|
+
minimumContrastRatio
|
|
9985
|
+
}) => {
|
|
9986
|
+
const valueAsHsv = convertToHsv(valueAsHex);
|
|
9987
|
+
const colorForComparisonAsLrgb = convertToLrgb(colorForComparisonAsHex);
|
|
9988
|
+
return {
|
|
9989
|
+
nonDerivedValueAsHsv: valueAsHsv,
|
|
9990
|
+
nonDerivedValueAsHex: valueAsHex,
|
|
9991
|
+
valueAsHsv,
|
|
9992
|
+
shouldEnforceMinContrast,
|
|
9993
|
+
colorForComparisonAsLrgb,
|
|
9994
|
+
minimumContrastRatio,
|
|
9995
|
+
isTransitioning: false
|
|
9996
|
+
};
|
|
9997
|
+
};
|
|
9998
|
+
var colorPickerReducer = (state, action) => {
|
|
9999
|
+
switch (action.type) {
|
|
10000
|
+
case "SET_VALUE_AS_HSV":
|
|
10001
|
+
const result = {
|
|
10002
|
+
...state,
|
|
10003
|
+
...action.payload
|
|
10004
|
+
};
|
|
10005
|
+
if (action.payload.nonDerivedValueAsHsv != null) {
|
|
10006
|
+
result.nonDerivedValueAsHex = (0, import_fn4.formatHex)(action.payload.nonDerivedValueAsHsv);
|
|
10007
|
+
}
|
|
10008
|
+
return result;
|
|
10009
|
+
case "SET_SHOULD_ENFORCE_MIN_CONTRAST":
|
|
10010
|
+
return {
|
|
10011
|
+
...state,
|
|
10012
|
+
shouldEnforceMinContrast: action.payload
|
|
10013
|
+
};
|
|
10014
|
+
case "SET_MINIMUM_CONTRAST_RATIO":
|
|
10015
|
+
return {
|
|
10016
|
+
...state,
|
|
10017
|
+
minimumContrastRatio: action.payload,
|
|
10018
|
+
valueAsHsv: state.shouldEnforceMinContrast ? getAccessibleColor({
|
|
10019
|
+
originalHsv: state.valueAsHsv,
|
|
10020
|
+
colorForComparisonAsLrgb: state.colorForComparisonAsLrgb,
|
|
10021
|
+
minContrast: action.payload
|
|
10022
|
+
}) : state.valueAsHsv
|
|
10023
|
+
};
|
|
10024
|
+
case "SET_COLOR_FOR_COMPARISON":
|
|
10025
|
+
return {
|
|
10026
|
+
...state,
|
|
10027
|
+
colorForComparisonAsLrgb: action.payload,
|
|
10028
|
+
valueAsHsv: state.shouldEnforceMinContrast ? getAccessibleColor({
|
|
10029
|
+
originalHsv: state.valueAsHsv,
|
|
10030
|
+
colorForComparisonAsLrgb: action.payload,
|
|
10031
|
+
minContrast: state.minimumContrastRatio
|
|
10032
|
+
}) : state.valueAsHsv
|
|
10033
|
+
};
|
|
10034
|
+
case "SET_IS_TRANSITIONING":
|
|
10035
|
+
return {
|
|
10036
|
+
...state,
|
|
10037
|
+
isTransitioning: action.payload
|
|
10038
|
+
};
|
|
10039
|
+
default:
|
|
10040
|
+
return state;
|
|
10041
|
+
}
|
|
10042
|
+
};
|
|
9988
10043
|
var ColorPickerContext = (0, import_react41.createContext)(null);
|
|
9989
10044
|
var ColorPickerProvider = ({
|
|
9990
10045
|
children,
|
|
9991
10046
|
value: valueAsHex,
|
|
9992
10047
|
onValueChange,
|
|
10048
|
+
shouldEnforceMinContrast = false,
|
|
9993
10049
|
minimumContrastRatio = DEFAULT_MIN_CONTRAST,
|
|
9994
|
-
colorForComparison = DEFAULT_COLOR_FOR_COMPARISON
|
|
10050
|
+
colorForComparison: colorForComparisonAsHex = DEFAULT_COLOR_FOR_COMPARISON
|
|
9995
10051
|
}) => {
|
|
9996
|
-
const [
|
|
9997
|
-
|
|
9998
|
-
|
|
10052
|
+
const [state, dispatch] = (0, import_react41.useReducer)(
|
|
10053
|
+
colorPickerReducer,
|
|
10054
|
+
createInitialState({
|
|
10055
|
+
valueAsHex,
|
|
10056
|
+
shouldEnforceMinContrast,
|
|
10057
|
+
colorForComparisonAsHex,
|
|
10058
|
+
minimumContrastRatio
|
|
10059
|
+
})
|
|
10060
|
+
);
|
|
10061
|
+
const valueAsLrgb = (0, import_react41.useMemo)(() => convertToLrgb(state.valueAsHsv), [state.valueAsHsv]);
|
|
10062
|
+
const colorForComparisonAsLrgb = (0, import_react41.useMemo)(
|
|
10063
|
+
() => convertToLrgb(colorForComparisonAsHex),
|
|
10064
|
+
[colorForComparisonAsHex]
|
|
10065
|
+
);
|
|
10066
|
+
const currentContrastRatio = (0, import_react41.useMemo)(() => {
|
|
10067
|
+
return (0, import_fn4.wcagContrast)(valueAsLrgb, colorForComparisonAsLrgb);
|
|
10068
|
+
}, [valueAsLrgb, colorForComparisonAsLrgb]);
|
|
10069
|
+
const hasAccessibleDerivativesValue = (0, import_react41.useMemo)(() => {
|
|
10070
|
+
return hasAccessibleDerivatives({
|
|
10071
|
+
originalHsv: state.valueAsHsv,
|
|
10072
|
+
colorForComparisonAsLrgb,
|
|
10073
|
+
minContrast: minimumContrastRatio
|
|
10074
|
+
});
|
|
10075
|
+
}, [state.valueAsHsv, colorForComparisonAsLrgb, minimumContrastRatio]);
|
|
9999
10076
|
const getAccessibleDerivativeColor = (0, import_react41.useCallback)(
|
|
10000
10077
|
(originalHsv) => getAccessibleColor({
|
|
10001
10078
|
originalHsv,
|
|
10002
|
-
|
|
10079
|
+
colorForComparisonAsLrgb,
|
|
10003
10080
|
minContrast: minimumContrastRatio
|
|
10004
10081
|
}),
|
|
10005
|
-
[minimumContrastRatio,
|
|
10082
|
+
[minimumContrastRatio, colorForComparisonAsLrgb]
|
|
10083
|
+
);
|
|
10084
|
+
const onValueAsHsvChange = (0, import_react41.useCallback)(
|
|
10085
|
+
(rawNewValueAsHsv) => {
|
|
10086
|
+
const hsvToSet = state.shouldEnforceMinContrast ? getAccessibleDerivativeColor(rawNewValueAsHsv) : rawNewValueAsHsv;
|
|
10087
|
+
const hexToSet = (0, import_fn4.formatHex)(hsvToSet);
|
|
10088
|
+
onValueChange(hexToSet);
|
|
10089
|
+
dispatch({
|
|
10090
|
+
type: "SET_VALUE_AS_HSV",
|
|
10091
|
+
payload: { valueAsHsv: hsvToSet, nonDerivedValueAsHsv: rawNewValueAsHsv }
|
|
10092
|
+
});
|
|
10093
|
+
},
|
|
10094
|
+
[getAccessibleDerivativeColor, state.shouldEnforceMinContrast, onValueChange]
|
|
10006
10095
|
);
|
|
10007
|
-
const valueAsHsv = shouldEnforceMinContrast ? getAccessibleDerivativeColor(nonDerivedValueAsHsv) : nonDerivedValueAsHsv;
|
|
10008
|
-
const currentContrastRatio = (0, import_fn4.wcagContrast)(valueAsHsv, colorForComparison);
|
|
10009
|
-
const hasAccessibleDerivativesValue = (0, import_react41.useMemo)(() => {
|
|
10010
|
-
return hasAccessibleDerivatives({
|
|
10011
|
-
originalHsv: valueAsHsv,
|
|
10012
|
-
colorForComparison,
|
|
10013
|
-
minContrast: minimumContrastRatio
|
|
10014
|
-
});
|
|
10015
|
-
}, [valueAsHsv, colorForComparison, minimumContrastRatio]);
|
|
10016
|
-
const onChangeNonDerivedValueAsHsv = (0, import_react41.useCallback)((nonDerivedValue) => {
|
|
10017
|
-
setNonDerivedValueAsHsv(nonDerivedValue);
|
|
10018
|
-
}, []);
|
|
10019
10096
|
const changeValueSmoothly = (0, import_react41.useCallback)(
|
|
10020
10097
|
(toHsv) => {
|
|
10021
|
-
|
|
10098
|
+
dispatch({ type: "SET_IS_TRANSITIONING", payload: true });
|
|
10022
10099
|
transitionBetweenColors(
|
|
10023
|
-
valueAsHsv,
|
|
10100
|
+
state.valueAsHsv,
|
|
10024
10101
|
toHsv,
|
|
10025
10102
|
(colorForStepAsHsv) => {
|
|
10026
10103
|
const hexValue = (0, import_fn4.formatHex)(colorForStepAsHsv);
|
|
10027
10104
|
onValueChange(hexValue);
|
|
10105
|
+
dispatch({ type: "SET_VALUE_AS_HSV", payload: { valueAsHsv: colorForStepAsHsv } });
|
|
10028
10106
|
},
|
|
10029
10107
|
() => {
|
|
10030
|
-
|
|
10108
|
+
dispatch({ type: "SET_IS_TRANSITIONING", payload: false });
|
|
10031
10109
|
}
|
|
10032
10110
|
);
|
|
10033
10111
|
},
|
|
10034
|
-
[valueAsHsv, onValueChange]
|
|
10112
|
+
[state.valueAsHsv, onValueChange]
|
|
10035
10113
|
);
|
|
10036
|
-
const
|
|
10114
|
+
const setShouldEnforceMinContrast = (0, import_react41.useCallback)(
|
|
10037
10115
|
(newShouldEnforceMinContrast) => {
|
|
10038
|
-
|
|
10039
|
-
const newColorAsHsv = newShouldEnforceMinContrast ? getAccessibleDerivativeColor(valueAsHsv) : nonDerivedValueAsHsv;
|
|
10040
|
-
const currentHsv = valueAsHsv;
|
|
10116
|
+
dispatch({ type: "SET_SHOULD_ENFORCE_MIN_CONTRAST", payload: newShouldEnforceMinContrast });
|
|
10117
|
+
const newColorAsHsv = newShouldEnforceMinContrast ? getAccessibleDerivativeColor(state.valueAsHsv) : state.nonDerivedValueAsHsv;
|
|
10118
|
+
const currentHsv = state.valueAsHsv;
|
|
10041
10119
|
if (currentHsv.h !== newColorAsHsv.h || currentHsv.s !== newColorAsHsv.s || currentHsv.v !== newColorAsHsv.v) {
|
|
10042
10120
|
changeValueSmoothly(newColorAsHsv);
|
|
10043
10121
|
}
|
|
10044
10122
|
},
|
|
10045
|
-
[
|
|
10123
|
+
[
|
|
10124
|
+
changeValueSmoothly,
|
|
10125
|
+
getAccessibleDerivativeColor,
|
|
10126
|
+
state.nonDerivedValueAsHsv,
|
|
10127
|
+
state.valueAsHsv
|
|
10128
|
+
]
|
|
10046
10129
|
);
|
|
10047
|
-
const whatValuePropShouldBe = shouldEnforceMinContrast ? (0, import_fn4.formatHex)(getAccessibleDerivativeColor(nonDerivedValueAsHsv)) : (0, import_fn4.formatHex)(nonDerivedValueAsHsv);
|
|
10048
10130
|
(0, import_react41.useEffect)(() => {
|
|
10049
|
-
if (valueAsHex
|
|
10050
|
-
|
|
10131
|
+
if (valueAsHex === (0, import_fn4.formatHex)(state.valueAsHsv)) {
|
|
10132
|
+
return;
|
|
10051
10133
|
}
|
|
10052
|
-
|
|
10134
|
+
const newValueAsHsv = convertToHsv(valueAsHex);
|
|
10135
|
+
dispatch({
|
|
10136
|
+
type: "SET_VALUE_AS_HSV",
|
|
10137
|
+
payload: { valueAsHsv: newValueAsHsv }
|
|
10138
|
+
});
|
|
10139
|
+
}, [getAccessibleDerivativeColor, state.valueAsHsv, valueAsHex]);
|
|
10053
10140
|
const contextValue = (0, import_react41.useMemo)(
|
|
10054
10141
|
() => ({
|
|
10055
|
-
|
|
10142
|
+
...state,
|
|
10143
|
+
valueAsLrgb,
|
|
10056
10144
|
currentContrastRatio,
|
|
10057
|
-
getAccessibleDerivativeColor,
|
|
10058
10145
|
hasAccessibleDerivatives: hasAccessibleDerivativesValue,
|
|
10059
|
-
isTransitioning,
|
|
10060
|
-
minimumContrastRatio,
|
|
10061
|
-
nonDerivedValueAsHex: (0, import_fn4.formatHex)(nonDerivedValueAsHsv),
|
|
10062
|
-
nonDerivedValueAsHsv,
|
|
10063
|
-
onChangeNonDerivedValueAsHsv,
|
|
10064
|
-
setShouldEnforceMinContrast: setShouldEnforceMinContrastWrapped,
|
|
10065
|
-
shouldEnforceMinContrast,
|
|
10066
10146
|
valueAsHex,
|
|
10067
|
-
|
|
10147
|
+
colorForComparisonAsHex,
|
|
10148
|
+
minimumContrastRatio,
|
|
10149
|
+
onValueAsHsvChange,
|
|
10150
|
+
setShouldEnforceMinContrast,
|
|
10151
|
+
getAccessibleDerivativeColor
|
|
10068
10152
|
}),
|
|
10069
10153
|
[
|
|
10070
|
-
|
|
10154
|
+
state,
|
|
10155
|
+
valueAsLrgb,
|
|
10071
10156
|
currentContrastRatio,
|
|
10072
|
-
getAccessibleDerivativeColor,
|
|
10073
10157
|
hasAccessibleDerivativesValue,
|
|
10074
|
-
isTransitioning,
|
|
10075
|
-
minimumContrastRatio,
|
|
10076
|
-
nonDerivedValueAsHsv,
|
|
10077
|
-
onChangeNonDerivedValueAsHsv,
|
|
10078
|
-
setShouldEnforceMinContrastWrapped,
|
|
10079
|
-
shouldEnforceMinContrast,
|
|
10080
10158
|
valueAsHex,
|
|
10081
|
-
|
|
10159
|
+
colorForComparisonAsHex,
|
|
10160
|
+
minimumContrastRatio,
|
|
10161
|
+
onValueAsHsvChange,
|
|
10162
|
+
setShouldEnforceMinContrast,
|
|
10163
|
+
getAccessibleDerivativeColor
|
|
10082
10164
|
]
|
|
10083
10165
|
);
|
|
10084
10166
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(ColorPickerContext.Provider, { value: contextValue, children });
|
|
@@ -10102,13 +10184,13 @@ var Container = (0, import_styled_components47.default)(import_react_radio_group
|
|
|
10102
10184
|
gap: var(--wui-space-02);
|
|
10103
10185
|
`;
|
|
10104
10186
|
var ColorGrid = ({ children }) => {
|
|
10105
|
-
const { valueAsHex,
|
|
10187
|
+
const { valueAsHex, onValueAsHsvChange } = useColorPickerState();
|
|
10106
10188
|
const onValueChange = (0, import_react42.useCallback)(
|
|
10107
10189
|
(value) => {
|
|
10108
10190
|
const hsv = convertToHsv(value);
|
|
10109
|
-
|
|
10191
|
+
onValueAsHsvChange(hsv);
|
|
10110
10192
|
},
|
|
10111
|
-
[
|
|
10193
|
+
[onValueAsHsvChange]
|
|
10112
10194
|
);
|
|
10113
10195
|
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
10114
10196
|
Container,
|
|
@@ -10385,16 +10467,16 @@ var Container3 = (0, import_styled_components51.default)(import_react_toggle_gro
|
|
|
10385
10467
|
padding: var(--wui-space-02);
|
|
10386
10468
|
`;
|
|
10387
10469
|
var ColorList = ({ children }) => {
|
|
10388
|
-
const { valueAsHex,
|
|
10470
|
+
const { valueAsHex, onValueAsHsvChange } = useColorPickerState();
|
|
10389
10471
|
const onValueChange = (0, import_react43.useCallback)(
|
|
10390
10472
|
(value) => {
|
|
10391
10473
|
if (value === "") {
|
|
10392
10474
|
return;
|
|
10393
10475
|
}
|
|
10394
10476
|
const hsv = convertToHsv(value);
|
|
10395
|
-
|
|
10477
|
+
onValueAsHsvChange(hsv);
|
|
10396
10478
|
},
|
|
10397
|
-
[
|
|
10479
|
+
[onValueAsHsvChange]
|
|
10398
10480
|
);
|
|
10399
10481
|
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
10400
10482
|
Container3,
|
|
@@ -10537,11 +10619,12 @@ ColorListOption.displayName = "ColorListOption_UI";
|
|
|
10537
10619
|
var import_react_popover = require("@radix-ui/react-popover");
|
|
10538
10620
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10539
10621
|
var ColorPicker = ({
|
|
10622
|
+
value,
|
|
10623
|
+
onValueChange,
|
|
10540
10624
|
children,
|
|
10541
|
-
|
|
10625
|
+
shouldEnforceMinContrast = false,
|
|
10542
10626
|
minimumContrastRatio = DEFAULT_MIN_CONTRAST,
|
|
10543
|
-
|
|
10544
|
-
value
|
|
10627
|
+
colorForComparison = DEFAULT_COLOR_FOR_COMPARISON
|
|
10545
10628
|
}) => {
|
|
10546
10629
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_react_popover.Root, { modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
10547
10630
|
ColorPickerProvider,
|
|
@@ -10549,6 +10632,7 @@ var ColorPicker = ({
|
|
|
10549
10632
|
colorForComparison,
|
|
10550
10633
|
minimumContrastRatio,
|
|
10551
10634
|
onValueChange,
|
|
10635
|
+
shouldEnforceMinContrast,
|
|
10552
10636
|
value,
|
|
10553
10637
|
children
|
|
10554
10638
|
}
|
|
@@ -10909,13 +10993,13 @@ var ContrastEnforcerSwitch = () => {
|
|
|
10909
10993
|
// src/components/ColorPicker/ContrastPreview.tsx
|
|
10910
10994
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10911
10995
|
var ContrastPreview = () => {
|
|
10912
|
-
const { valueAsHex,
|
|
10996
|
+
const { valueAsHex, colorForComparisonAsHex } = useColorPickerState();
|
|
10913
10997
|
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10914
10998
|
ColorSwatch,
|
|
10915
10999
|
{
|
|
10916
11000
|
diameterPx: 36,
|
|
10917
11001
|
value: valueAsHex,
|
|
10918
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Text, { style: { color:
|
|
11002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Text, { style: { color: colorForComparisonAsHex }, children: "Aa" })
|
|
10919
11003
|
}
|
|
10920
11004
|
);
|
|
10921
11005
|
};
|
|
@@ -11166,7 +11250,7 @@ var normalizeHexInput = (input) => {
|
|
|
11166
11250
|
return cleaned.slice(0, SIX_DIGIT_HEX_CODE_LENGTH).toLocaleLowerCase();
|
|
11167
11251
|
};
|
|
11168
11252
|
var HexColorInput = ({ autoFocus = true }) => {
|
|
11169
|
-
const { valueAsHex, nonDerivedValueAsHsv,
|
|
11253
|
+
const { valueAsHex, nonDerivedValueAsHsv, onValueAsHsvChange } = useColorPickerState();
|
|
11170
11254
|
const inputRef = (0, import_react48.useRef)(null);
|
|
11171
11255
|
const [textInputValue, setTextInputValue] = (0, import_react48.useState)(valueAsHex);
|
|
11172
11256
|
const onChangeInputValue = (0, import_react48.useCallback)(
|
|
@@ -11181,9 +11265,9 @@ var HexColorInput = ({ autoFocus = true }) => {
|
|
|
11181
11265
|
return;
|
|
11182
11266
|
}
|
|
11183
11267
|
const newValueAsHsv = convertToHsv(newValue);
|
|
11184
|
-
|
|
11268
|
+
onValueAsHsvChange(newValueAsHsv);
|
|
11185
11269
|
},
|
|
11186
|
-
[
|
|
11270
|
+
[onValueAsHsvChange]
|
|
11187
11271
|
);
|
|
11188
11272
|
const onCopy = (0, import_react48.useCallback)((event) => {
|
|
11189
11273
|
const inputElem = inputRef.current;
|
|
@@ -11234,7 +11318,7 @@ var HexColorInput = ({ autoFocus = true }) => {
|
|
|
11234
11318
|
...nonDerivedValueAsHsv,
|
|
11235
11319
|
s: newSaturation
|
|
11236
11320
|
};
|
|
11237
|
-
|
|
11321
|
+
onValueAsHsvChange(newHsv);
|
|
11238
11322
|
return;
|
|
11239
11323
|
}
|
|
11240
11324
|
if (key.length > 1) {
|
|
@@ -11248,7 +11332,7 @@ var HexColorInput = ({ autoFocus = true }) => {
|
|
|
11248
11332
|
event.preventDefault();
|
|
11249
11333
|
}
|
|
11250
11334
|
},
|
|
11251
|
-
[valueAsHex,
|
|
11335
|
+
[valueAsHex, onValueAsHsvChange, nonDerivedValueAsHsv]
|
|
11252
11336
|
);
|
|
11253
11337
|
const onPaste = (0, import_react48.useCallback)(
|
|
11254
11338
|
(event) => {
|
|
@@ -11261,9 +11345,9 @@ var HexColorInput = ({ autoFocus = true }) => {
|
|
|
11261
11345
|
return;
|
|
11262
11346
|
}
|
|
11263
11347
|
const newValueAsHsv = convertToHsv(normalizedValue);
|
|
11264
|
-
|
|
11348
|
+
onValueAsHsvChange(newValueAsHsv);
|
|
11265
11349
|
},
|
|
11266
|
-
[
|
|
11350
|
+
[onValueAsHsvChange]
|
|
11267
11351
|
);
|
|
11268
11352
|
const selectAllButTheHash = (0, import_react48.useCallback)(() => {
|
|
11269
11353
|
const inputElem = inputRef.current;
|
|
@@ -11405,7 +11489,7 @@ var ThumbInner = import_styled_components62.default.div`
|
|
|
11405
11489
|
}
|
|
11406
11490
|
`;
|
|
11407
11491
|
var HueSlider = () => {
|
|
11408
|
-
const { nonDerivedValueAsHsv,
|
|
11492
|
+
const { nonDerivedValueAsHsv, onValueAsHsvChange, valueAsHsv } = useColorPickerState();
|
|
11409
11493
|
const containerStyle = (0, import_react50.useMemo)(() => {
|
|
11410
11494
|
return {
|
|
11411
11495
|
backgroundColor: (0, import_fn7.formatHex)({
|
|
@@ -11423,12 +11507,12 @@ var HueSlider = () => {
|
|
|
11423
11507
|
const onHueChange = (0, import_react50.useCallback)(
|
|
11424
11508
|
(values) => {
|
|
11425
11509
|
const newHue = values[0] ?? 0;
|
|
11426
|
-
|
|
11510
|
+
onValueAsHsvChange({
|
|
11427
11511
|
...nonDerivedValueAsHsv,
|
|
11428
11512
|
h: newHue
|
|
11429
11513
|
});
|
|
11430
11514
|
},
|
|
11431
|
-
[nonDerivedValueAsHsv,
|
|
11515
|
+
[nonDerivedValueAsHsv, onValueAsHsvChange]
|
|
11432
11516
|
);
|
|
11433
11517
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(Container7, { style: containerStyle, children: [
|
|
11434
11518
|
/* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
@@ -11491,14 +11575,14 @@ var Canvas2 = import_styled_components63.default.canvas`
|
|
|
11491
11575
|
display: block;
|
|
11492
11576
|
width: 100%;
|
|
11493
11577
|
`;
|
|
11494
|
-
var calculateContrastCurve = (width, height, hue, minimumContrastRatio,
|
|
11578
|
+
var calculateContrastCurve = (width, height, hue, minimumContrastRatio, colorForComparisonAsLrgb, limit) => {
|
|
11495
11579
|
const contrastPoints = [];
|
|
11496
11580
|
for (let x = 0; x < width; x += 1) {
|
|
11497
11581
|
const saturationChanel = x / (width - 1);
|
|
11498
11582
|
const initialValueChannelForSearch = limit === "upper" ? 0 : 1;
|
|
11499
11583
|
const colorForXAsHsv = getAccessibleColorByValueChannelChange({
|
|
11500
11584
|
originalHsv: { h: hue, s: saturationChanel, v: initialValueChannelForSearch, mode: "hsv" },
|
|
11501
|
-
|
|
11585
|
+
colorForComparisonAsLrgb,
|
|
11502
11586
|
minContrast: minimumContrastRatio,
|
|
11503
11587
|
direction: limit === "upper" ? "brighter" : "darker"
|
|
11504
11588
|
});
|
|
@@ -11540,7 +11624,7 @@ var HSVSaturationValueCanvas = ({
|
|
|
11540
11624
|
hue,
|
|
11541
11625
|
shouldShowContrastCurve = false,
|
|
11542
11626
|
minimumContrastRatio = DEFAULT_MIN_CONTRAST,
|
|
11543
|
-
|
|
11627
|
+
colorForComparisonAsLrgb
|
|
11544
11628
|
}) => {
|
|
11545
11629
|
const canvasRef = (0, import_react51.useRef)(null);
|
|
11546
11630
|
(0, import_react51.useEffect)(() => {
|
|
@@ -11555,7 +11639,7 @@ var HSVSaturationValueCanvas = ({
|
|
|
11555
11639
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
11556
11640
|
const { width, height } = canvas;
|
|
11557
11641
|
drawGradientBackground(ctx, width, height, hue);
|
|
11558
|
-
if (shouldShowContrastCurve &&
|
|
11642
|
+
if (shouldShowContrastCurve && colorForComparisonAsLrgb) {
|
|
11559
11643
|
ctx.lineWidth = 1.5;
|
|
11560
11644
|
ctx.strokeStyle = "white";
|
|
11561
11645
|
const maxHsvValueChannelCurve = calculateContrastCurve(
|
|
@@ -11563,7 +11647,7 @@ var HSVSaturationValueCanvas = ({
|
|
|
11563
11647
|
height,
|
|
11564
11648
|
hue,
|
|
11565
11649
|
minimumContrastRatio,
|
|
11566
|
-
|
|
11650
|
+
colorForComparisonAsLrgb,
|
|
11567
11651
|
"upper"
|
|
11568
11652
|
);
|
|
11569
11653
|
const minHsvValueChannelCurve = calculateContrastCurve(
|
|
@@ -11571,7 +11655,7 @@ var HSVSaturationValueCanvas = ({
|
|
|
11571
11655
|
height,
|
|
11572
11656
|
hue,
|
|
11573
11657
|
minimumContrastRatio,
|
|
11574
|
-
|
|
11658
|
+
colorForComparisonAsLrgb,
|
|
11575
11659
|
"lower"
|
|
11576
11660
|
);
|
|
11577
11661
|
if (minHsvValueChannelCurve.length > 0) {
|
|
@@ -11581,7 +11665,7 @@ var HSVSaturationValueCanvas = ({
|
|
|
11581
11665
|
drawSmoothCurve(ctx, maxHsvValueChannelCurve);
|
|
11582
11666
|
}
|
|
11583
11667
|
}
|
|
11584
|
-
}, [hue, shouldShowContrastCurve, minimumContrastRatio,
|
|
11668
|
+
}, [hue, shouldShowContrastCurve, minimumContrastRatio, colorForComparisonAsLrgb]);
|
|
11585
11669
|
return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
11586
11670
|
Canvas2,
|
|
11587
11671
|
{
|
|
@@ -11627,25 +11711,39 @@ var SaturationAndValuePicker = ({
|
|
|
11627
11711
|
}) => {
|
|
11628
11712
|
const {
|
|
11629
11713
|
valueAsHex,
|
|
11630
|
-
|
|
11714
|
+
onValueAsHsvChange,
|
|
11631
11715
|
valueAsHsv,
|
|
11632
11716
|
isTransitioning,
|
|
11633
11717
|
minimumContrastRatio,
|
|
11634
|
-
|
|
11718
|
+
colorForComparisonAsLrgb,
|
|
11635
11719
|
shouldEnforceMinContrast,
|
|
11636
|
-
nonDerivedValueAsHsv
|
|
11720
|
+
nonDerivedValueAsHsv,
|
|
11721
|
+
getAccessibleDerivativeColor
|
|
11637
11722
|
} = useColorPickerState();
|
|
11638
11723
|
const containerRef = (0, import_react52.useRef)(null);
|
|
11639
11724
|
const thumbRef = (0, import_react52.useRef)(null);
|
|
11640
11725
|
const uuid = (0, import_react52.useMemo)(() => crypto.randomUUID(), []);
|
|
11641
11726
|
const instructionsId = `sv-instructions-${uuid}`;
|
|
11642
|
-
const valueAsHexConvertedToHsv = convertToHsv(valueAsHex);
|
|
11643
11727
|
const thumbPositionHsv = (0, import_react52.useMemo)(() => {
|
|
11644
|
-
if (
|
|
11728
|
+
if (isTransitioning) {
|
|
11645
11729
|
return valueAsHsv;
|
|
11646
11730
|
}
|
|
11647
|
-
|
|
11648
|
-
|
|
11731
|
+
if (!shouldEnforceMinContrast) {
|
|
11732
|
+
return nonDerivedValueAsHsv;
|
|
11733
|
+
}
|
|
11734
|
+
const accessibleHsv = getAccessibleDerivativeColor(nonDerivedValueAsHsv);
|
|
11735
|
+
return {
|
|
11736
|
+
...nonDerivedValueAsHsv,
|
|
11737
|
+
s: accessibleHsv.s,
|
|
11738
|
+
v: accessibleHsv.v
|
|
11739
|
+
};
|
|
11740
|
+
}, [
|
|
11741
|
+
isTransitioning,
|
|
11742
|
+
shouldEnforceMinContrast,
|
|
11743
|
+
nonDerivedValueAsHsv,
|
|
11744
|
+
valueAsHsv,
|
|
11745
|
+
getAccessibleDerivativeColor
|
|
11746
|
+
]);
|
|
11649
11747
|
const [thumbStyle, setThumbStyle] = (0, import_react52.useState)({
|
|
11650
11748
|
backgroundColor: valueAsHex
|
|
11651
11749
|
});
|
|
@@ -11666,19 +11764,19 @@ var SaturationAndValuePicker = ({
|
|
|
11666
11764
|
(channel, delta) => {
|
|
11667
11765
|
if (channel === "s") {
|
|
11668
11766
|
const newSaturation = Math.max(0, Math.min(1, nonDerivedValueAsHsv.s + delta));
|
|
11669
|
-
|
|
11767
|
+
onValueAsHsvChange({
|
|
11670
11768
|
...nonDerivedValueAsHsv,
|
|
11671
11769
|
s: newSaturation
|
|
11672
11770
|
});
|
|
11673
11771
|
return;
|
|
11674
11772
|
}
|
|
11675
11773
|
const newValue = Math.max(0, Math.min(1, nonDerivedValueAsHsv.v + delta));
|
|
11676
|
-
|
|
11774
|
+
onValueAsHsvChange({
|
|
11677
11775
|
...nonDerivedValueAsHsv,
|
|
11678
11776
|
v: newValue
|
|
11679
11777
|
});
|
|
11680
11778
|
},
|
|
11681
|
-
[nonDerivedValueAsHsv,
|
|
11779
|
+
[nonDerivedValueAsHsv, onValueAsHsvChange]
|
|
11682
11780
|
);
|
|
11683
11781
|
const [isDragging, setIsDragging] = (0, import_react52.useState)(false);
|
|
11684
11782
|
const updateSaturationAndValueFromCoordinates = (0, import_react52.useCallback)(
|
|
@@ -11692,13 +11790,13 @@ var SaturationAndValuePicker = ({
|
|
|
11692
11790
|
const y = Math.max(0, Math.min(1, (clientY - rect.top) / rect.height));
|
|
11693
11791
|
const saturation = x;
|
|
11694
11792
|
const value = 1 - y;
|
|
11695
|
-
|
|
11793
|
+
onValueAsHsvChange({
|
|
11696
11794
|
...nonDerivedValueAsHsv,
|
|
11697
11795
|
s: saturation,
|
|
11698
11796
|
v: value
|
|
11699
11797
|
});
|
|
11700
11798
|
},
|
|
11701
|
-
[
|
|
11799
|
+
[onValueAsHsvChange, nonDerivedValueAsHsv]
|
|
11702
11800
|
);
|
|
11703
11801
|
const onContainerMouseDown = (0, import_react52.useCallback)(
|
|
11704
11802
|
(event) => {
|
|
@@ -11783,7 +11881,7 @@ var SaturationAndValuePicker = ({
|
|
|
11783
11881
|
/* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
|
|
11784
11882
|
HSVSaturationValueCanvas,
|
|
11785
11883
|
{
|
|
11786
|
-
|
|
11884
|
+
colorForComparisonAsLrgb,
|
|
11787
11885
|
hue: nonDerivedValueAsHsv.h ?? 0,
|
|
11788
11886
|
minimumContrastRatio,
|
|
11789
11887
|
shouldShowContrastCurve: shouldEnforceMinContrast
|
|
@@ -12234,11 +12332,6 @@ var StyledDataCard = import_styled_components67.default.div`
|
|
|
12234
12332
|
position: relative;
|
|
12235
12333
|
transition: background var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
12236
12334
|
|
|
12237
|
-
&:has([data-wui-data-card-subtitle]) {
|
|
12238
|
-
grid-template-areas: 'label slot' 'value value' 'subtitle subtitle';
|
|
12239
|
-
grid-template-rows: auto auto auto;
|
|
12240
|
-
}
|
|
12241
|
-
|
|
12242
12335
|
&[data-click-region] {
|
|
12243
12336
|
[data-wui-data-card-hover-icon] {
|
|
12244
12337
|
opacity: 0;
|
|
@@ -12325,9 +12418,6 @@ var StyledDataCardTrendContainer = import_styled_components67.default.div`
|
|
|
12325
12418
|
bottom: var(--wui-space-01);
|
|
12326
12419
|
right: var(--wui-space-01);
|
|
12327
12420
|
`;
|
|
12328
|
-
var StyledSubtitle = (0, import_styled_components67.default)(Text)`
|
|
12329
|
-
grid-area: subtitle;
|
|
12330
|
-
`;
|
|
12331
12421
|
var DataCardInner = ({
|
|
12332
12422
|
label,
|
|
12333
12423
|
value,
|
|
@@ -12335,7 +12425,6 @@ var DataCardInner = ({
|
|
|
12335
12425
|
colorScheme = "inherit",
|
|
12336
12426
|
isLoading = false,
|
|
12337
12427
|
trend,
|
|
12338
|
-
subtitle,
|
|
12339
12428
|
...props
|
|
12340
12429
|
}) => /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
12341
12430
|
StyledDataCard,
|
|
@@ -12359,16 +12448,8 @@ var DataCardInner = ({
|
|
|
12359
12448
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledLoadingValue, {}) : value
|
|
12360
12449
|
}
|
|
12361
12450
|
),
|
|
12362
|
-
(0, import_type_guards37.
|
|
12363
|
-
(0, import_type_guards37.
|
|
12364
|
-
StyledSubtitle,
|
|
12365
|
-
{
|
|
12366
|
-
"data-wui-data-card-subtitle": true,
|
|
12367
|
-
variant: "label4",
|
|
12368
|
-
children: subtitle
|
|
12369
|
-
}
|
|
12370
|
-
),
|
|
12371
|
-
(0, import_type_guards37.isNotNil)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
12451
|
+
(0, import_type_guards37.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
12452
|
+
(0, import_type_guards37.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
12372
12453
|
]
|
|
12373
12454
|
}
|
|
12374
12455
|
);
|
|
@@ -12430,7 +12511,6 @@ var DataCards = ({
|
|
|
12430
12511
|
...props,
|
|
12431
12512
|
$cardMaxWidth: cardMaxWidth,
|
|
12432
12513
|
$colorScheme: colorScheme,
|
|
12433
|
-
alignItems: "stretch",
|
|
12434
12514
|
direction: "row",
|
|
12435
12515
|
fill: "horizontal",
|
|
12436
12516
|
gap: "space-02",
|
|
@@ -16798,6 +16878,9 @@ var ContextMenu = ({
|
|
|
16798
16878
|
}
|
|
16799
16879
|
) : null;
|
|
16800
16880
|
};
|
|
16881
|
+
|
|
16882
|
+
// src/index.ts
|
|
16883
|
+
console.log("trigger new package build for UI");
|
|
16801
16884
|
// Annotate the CommonJS export names for ESM import in node:
|
|
16802
16885
|
0 && (module.exports = {
|
|
16803
16886
|
ActionButton,
|