react-better-html 1.1.290 → 1.1.291
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.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +44 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -394,6 +394,10 @@ type InternalToggleInputProps<Value> = {
|
|
|
394
394
|
errorText?: string;
|
|
395
395
|
infoText?: string;
|
|
396
396
|
infoTextColor?: React.CSSProperties["color"];
|
|
397
|
+
inactiveColor?: React.CSSProperties["color"];
|
|
398
|
+
activeColor?: React.CSSProperties["color"];
|
|
399
|
+
inactiveBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
400
|
+
activeBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
397
401
|
/** @default 26 */
|
|
398
402
|
size?: number;
|
|
399
403
|
value?: Value;
|
package/dist/index.d.ts
CHANGED
|
@@ -394,6 +394,10 @@ type InternalToggleInputProps<Value> = {
|
|
|
394
394
|
errorText?: string;
|
|
395
395
|
infoText?: string;
|
|
396
396
|
infoTextColor?: React.CSSProperties["color"];
|
|
397
|
+
inactiveColor?: React.CSSProperties["color"];
|
|
398
|
+
activeColor?: React.CSSProperties["color"];
|
|
399
|
+
inactiveBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
400
|
+
activeBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
397
401
|
/** @default 26 */
|
|
398
402
|
size?: number;
|
|
399
403
|
value?: Value;
|
package/dist/index.js
CHANGED
|
@@ -3913,6 +3913,8 @@ var DropdownComponent = (0, import_react19.forwardRef)(function Dropdown(dropdow
|
|
|
3913
3913
|
withMultiselect,
|
|
3914
3914
|
id,
|
|
3915
3915
|
textAlign,
|
|
3916
|
+
backgroundColor,
|
|
3917
|
+
borderRadius,
|
|
3916
3918
|
...props
|
|
3917
3919
|
} = useComponentsPropsMerger(
|
|
3918
3920
|
betterHtmlContextInternal.components.dropdown?.style?.default,
|
|
@@ -4138,6 +4140,8 @@ var DropdownComponent = (0, import_react19.forwardRef)(function Dropdown(dropdow
|
|
|
4138
4140
|
infoTextColor,
|
|
4139
4141
|
required: withMultiselect ? (Array.isArray(value) ? value.length > 0 : value !== void 0) ? false : required : required,
|
|
4140
4142
|
textAlign,
|
|
4143
|
+
backgroundColor,
|
|
4144
|
+
borderRadius,
|
|
4141
4145
|
name,
|
|
4142
4146
|
disabled,
|
|
4143
4147
|
readOnly: !withSearch,
|
|
@@ -5850,13 +5854,24 @@ var componentSize = 26;
|
|
|
5850
5854
|
var switchComponentBallGap = 3;
|
|
5851
5855
|
var switchComponentMouseDownDifference = 4;
|
|
5852
5856
|
var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
5853
|
-
shouldForwardProp: (prop) => ![
|
|
5857
|
+
shouldForwardProp: (prop) => ![
|
|
5858
|
+
"theme",
|
|
5859
|
+
"colorTheme",
|
|
5860
|
+
"style",
|
|
5861
|
+
"hoverStyle",
|
|
5862
|
+
"size",
|
|
5863
|
+
"withNoBorder",
|
|
5864
|
+
"inactiveColor",
|
|
5865
|
+
"activeColor",
|
|
5866
|
+
"inactiveBackgroundColor",
|
|
5867
|
+
"activeBackgroundColor"
|
|
5868
|
+
].includes(prop)
|
|
5854
5869
|
})`
|
|
5855
5870
|
position: relative;
|
|
5856
5871
|
appearance: none;
|
|
5857
5872
|
width: ${(props) => props.size ?? componentSize}px;
|
|
5858
5873
|
height: ${(props) => props.size ?? componentSize}px;
|
|
5859
|
-
background-color: ${(props) => props.theme.colors.backgroundContent};
|
|
5874
|
+
background-color: ${(props) => props.inactiveBackgroundColor ?? props.theme.colors.backgroundContent};
|
|
5860
5875
|
border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
|
|
5861
5876
|
border-radius: ${(props) => props.theme.styles.borderRadius / 2}px;
|
|
5862
5877
|
cursor: pointer;
|
|
@@ -5868,8 +5883,8 @@ var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
|
5868
5883
|
}
|
|
5869
5884
|
|
|
5870
5885
|
&:checked {
|
|
5871
|
-
background-color: ${(props) => props.theme.colors.primary};
|
|
5872
|
-
border-color: ${(props) => props.theme.colors.primary};
|
|
5886
|
+
background-color: ${(props) => props.activeBackgroundColor ?? props.theme.colors.primary};
|
|
5887
|
+
border-color: ${(props) => props.activeBackgroundColor ?? props.theme.colors.primary};
|
|
5873
5888
|
}
|
|
5874
5889
|
|
|
5875
5890
|
&:disabled {
|
|
@@ -5890,7 +5905,18 @@ var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
|
5890
5905
|
}
|
|
5891
5906
|
`;
|
|
5892
5907
|
var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
5893
|
-
shouldForwardProp: (prop) => ![
|
|
5908
|
+
shouldForwardProp: (prop) => ![
|
|
5909
|
+
"theme",
|
|
5910
|
+
"checked",
|
|
5911
|
+
"disabled",
|
|
5912
|
+
"isMouseDown",
|
|
5913
|
+
"style",
|
|
5914
|
+
"hoverStyle",
|
|
5915
|
+
"activeColor",
|
|
5916
|
+
"inactiveColor",
|
|
5917
|
+
"inactiveBackgroundColor",
|
|
5918
|
+
"activeBackgroundColor"
|
|
5919
|
+
].includes(prop)
|
|
5894
5920
|
})`
|
|
5895
5921
|
--width: ${(props) => componentSize * 2 - props.theme.styles.gap / 2}px;
|
|
5896
5922
|
--ball-size: ${componentSize - switchComponentBallGap * 2}px;
|
|
@@ -5898,7 +5924,7 @@ var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
|
5898
5924
|
position: relative;
|
|
5899
5925
|
width: var(--width);
|
|
5900
5926
|
height: ${componentSize}px;
|
|
5901
|
-
background-color: ${(props) => props.checked ? props.theme.colors.primary : props.theme.colors.border};
|
|
5927
|
+
background-color: ${(props) => props.checked ? props.activeBackgroundColor ?? props.theme.colors.primary : props.inactiveBackgroundColor ?? props.theme.colors.border};
|
|
5902
5928
|
border-radius: 999px;
|
|
5903
5929
|
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
5904
5930
|
opacity: ${(props) => props.disabled ? 0.5 : 1};
|
|
@@ -5909,7 +5935,7 @@ var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
|
5909
5935
|
position: absolute;
|
|
5910
5936
|
width: ${(props) => componentSize - switchComponentBallGap * 2 + (props.isMouseDown ? switchComponentMouseDownDifference : 0)}px;
|
|
5911
5937
|
height: ${componentSize - switchComponentBallGap * 2}px;
|
|
5912
|
-
background-color: ${(props) => props.theme.colors.base};
|
|
5938
|
+
background-color: ${(props) => props.checked ? props.activeColor ?? props.theme.colors.base : props.inactiveColor ?? props.theme.colors.base};
|
|
5913
5939
|
border-radius: 999px;
|
|
5914
5940
|
top: ${switchComponentBallGap}px;
|
|
5915
5941
|
left: ${switchComponentBallGap}px;
|
|
@@ -5925,7 +5951,7 @@ var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
|
5925
5951
|
position: absolute;
|
|
5926
5952
|
width: ${(props) => componentSize - switchComponentBallGap * 2 + (props.isMouseDown ? switchComponentMouseDownDifference : 0)}px;
|
|
5927
5953
|
height: ${componentSize - switchComponentBallGap * 2}px;
|
|
5928
|
-
background-color: ${(props) => props.checked ? props.theme.colors.primary : "transparent"};
|
|
5954
|
+
background-color: ${(props) => props.checked ? props.activeBackgroundColor ?? props.theme.colors.primary : "transparent"};
|
|
5929
5955
|
border-radius: 999px;
|
|
5930
5956
|
top: ${switchComponentBallGap}px;
|
|
5931
5957
|
left: ${switchComponentBallGap}px;
|
|
@@ -5959,6 +5985,10 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
5959
5985
|
errorText,
|
|
5960
5986
|
infoText,
|
|
5961
5987
|
infoTextColor,
|
|
5988
|
+
inactiveColor,
|
|
5989
|
+
activeColor,
|
|
5990
|
+
inactiveBackgroundColor,
|
|
5991
|
+
activeBackgroundColor,
|
|
5962
5992
|
size = componentSize,
|
|
5963
5993
|
value,
|
|
5964
5994
|
onChange,
|
|
@@ -6014,6 +6044,10 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
6014
6044
|
colorTheme,
|
|
6015
6045
|
size,
|
|
6016
6046
|
withNoBorder: theme2.styles.borderWidth === 0,
|
|
6047
|
+
inactiveColor,
|
|
6048
|
+
activeColor,
|
|
6049
|
+
inactiveBackgroundColor,
|
|
6050
|
+
activeBackgroundColor,
|
|
6017
6051
|
type: props.type ?? "checkbox",
|
|
6018
6052
|
checked,
|
|
6019
6053
|
onChange: onChangeElement,
|
|
@@ -6032,7 +6066,7 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
6032
6066
|
position: "absolute",
|
|
6033
6067
|
top: "50%",
|
|
6034
6068
|
left: "50%",
|
|
6035
|
-
color: theme2.colors.base,
|
|
6069
|
+
color: activeColor ?? theme2.colors.base,
|
|
6036
6070
|
size: size / 1.8,
|
|
6037
6071
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
6038
6072
|
opacity: checked ? 1 : 0,
|
|
@@ -6047,7 +6081,7 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
6047
6081
|
height: size / 2,
|
|
6048
6082
|
top: "50%",
|
|
6049
6083
|
left: "50%",
|
|
6050
|
-
backgroundColor: theme2.colors.base,
|
|
6084
|
+
backgroundColor: activeColor ?? theme2.colors.base,
|
|
6051
6085
|
borderRadius: 999,
|
|
6052
6086
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
6053
6087
|
opacity: checked ? 1 : 0,
|