react-better-html 1.1.289 → 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 +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +54 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -223,6 +223,8 @@ type PageHeaderProps = {
|
|
|
223
223
|
rightElement?: React.ReactNode;
|
|
224
224
|
/** @default false */
|
|
225
225
|
lightMode?: boolean;
|
|
226
|
+
width?: React.CSSProperties["width"];
|
|
227
|
+
flex?: React.CSSProperties["flex"];
|
|
226
228
|
} & Pick<ComponentMarginProps, "marginBottom">;
|
|
227
229
|
type PageHeaderComponentType = {
|
|
228
230
|
(props: ComponentPropWithRef<HTMLDivElement, PageHeaderProps>): React.ReactElement;
|
|
@@ -392,6 +394,10 @@ type InternalToggleInputProps<Value> = {
|
|
|
392
394
|
errorText?: string;
|
|
393
395
|
infoText?: string;
|
|
394
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"];
|
|
395
401
|
/** @default 26 */
|
|
396
402
|
size?: number;
|
|
397
403
|
value?: Value;
|
package/dist/index.d.ts
CHANGED
|
@@ -223,6 +223,8 @@ type PageHeaderProps = {
|
|
|
223
223
|
rightElement?: React.ReactNode;
|
|
224
224
|
/** @default false */
|
|
225
225
|
lightMode?: boolean;
|
|
226
|
+
width?: React.CSSProperties["width"];
|
|
227
|
+
flex?: React.CSSProperties["flex"];
|
|
226
228
|
} & Pick<ComponentMarginProps, "marginBottom">;
|
|
227
229
|
type PageHeaderComponentType = {
|
|
228
230
|
(props: ComponentPropWithRef<HTMLDivElement, PageHeaderProps>): React.ReactElement;
|
|
@@ -392,6 +394,10 @@ type InternalToggleInputProps<Value> = {
|
|
|
392
394
|
errorText?: string;
|
|
393
395
|
infoText?: string;
|
|
394
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"];
|
|
395
401
|
/** @default 26 */
|
|
396
402
|
size?: number;
|
|
397
403
|
value?: Value;
|
package/dist/index.js
CHANGED
|
@@ -1693,6 +1693,8 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1693
1693
|
textAlign,
|
|
1694
1694
|
rightElement,
|
|
1695
1695
|
lightMode,
|
|
1696
|
+
width,
|
|
1697
|
+
flex,
|
|
1696
1698
|
marginBottom
|
|
1697
1699
|
}, ref) {
|
|
1698
1700
|
const theme2 = (0, import_react_better_core6.useTheme)();
|
|
@@ -1703,6 +1705,8 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1703
1705
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1704
1706
|
Div_default.row,
|
|
1705
1707
|
{
|
|
1708
|
+
width,
|
|
1709
|
+
flex,
|
|
1706
1710
|
alignItems: "center",
|
|
1707
1711
|
gap: imageGap ?? theme2.styles.space,
|
|
1708
1712
|
marginBottom: marginBottom ?? theme2.styles.space * 2,
|
|
@@ -2223,6 +2227,7 @@ var ButtonComponent = function Button({
|
|
|
2223
2227
|
value,
|
|
2224
2228
|
download,
|
|
2225
2229
|
target,
|
|
2230
|
+
gap,
|
|
2226
2231
|
icon,
|
|
2227
2232
|
iconPosition = "left",
|
|
2228
2233
|
iconColor,
|
|
@@ -2314,7 +2319,7 @@ var ButtonComponent = function Button({
|
|
|
2314
2319
|
height: href ? "100%" : void 0,
|
|
2315
2320
|
alignItems: "center",
|
|
2316
2321
|
justifyContent: "center",
|
|
2317
|
-
gap:
|
|
2322
|
+
gap: gap ?? (theme2.styles.gap + theme2.styles.space) / 2,
|
|
2318
2323
|
pointerEvents: "none",
|
|
2319
2324
|
opacity: isLoadingElement ? 0 : 1,
|
|
2320
2325
|
transition: theme2.styles.transition,
|
|
@@ -2399,13 +2404,16 @@ ButtonComponent.text = function Text3(buttonProps) {
|
|
|
2399
2404
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2400
2405
|
ButtonComponent,
|
|
2401
2406
|
{
|
|
2407
|
+
fontWeight: 700,
|
|
2402
2408
|
color: readyColor,
|
|
2403
2409
|
colorHover: (0, import_react_better_core9.lightenColor)(readyColor, 0.3),
|
|
2404
2410
|
backgroundColor: "transparent",
|
|
2405
2411
|
backgroundColorHover: "transparent",
|
|
2406
2412
|
borderRadius: 0,
|
|
2407
2413
|
loaderSize: 12,
|
|
2408
|
-
|
|
2414
|
+
gap: theme2.styles.gap,
|
|
2415
|
+
paddingInline: theme2.styles.gap,
|
|
2416
|
+
paddingBlock: theme2.styles.gap / 2,
|
|
2409
2417
|
...fromSubcomponentProps,
|
|
2410
2418
|
...props
|
|
2411
2419
|
}
|
|
@@ -3905,6 +3913,8 @@ var DropdownComponent = (0, import_react19.forwardRef)(function Dropdown(dropdow
|
|
|
3905
3913
|
withMultiselect,
|
|
3906
3914
|
id,
|
|
3907
3915
|
textAlign,
|
|
3916
|
+
backgroundColor,
|
|
3917
|
+
borderRadius,
|
|
3908
3918
|
...props
|
|
3909
3919
|
} = useComponentsPropsMerger(
|
|
3910
3920
|
betterHtmlContextInternal.components.dropdown?.style?.default,
|
|
@@ -4130,6 +4140,8 @@ var DropdownComponent = (0, import_react19.forwardRef)(function Dropdown(dropdow
|
|
|
4130
4140
|
infoTextColor,
|
|
4131
4141
|
required: withMultiselect ? (Array.isArray(value) ? value.length > 0 : value !== void 0) ? false : required : required,
|
|
4132
4142
|
textAlign,
|
|
4143
|
+
backgroundColor,
|
|
4144
|
+
borderRadius,
|
|
4133
4145
|
name,
|
|
4134
4146
|
disabled,
|
|
4135
4147
|
readOnly: !withSearch,
|
|
@@ -5842,13 +5854,24 @@ var componentSize = 26;
|
|
|
5842
5854
|
var switchComponentBallGap = 3;
|
|
5843
5855
|
var switchComponentMouseDownDifference = 4;
|
|
5844
5856
|
var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
5845
|
-
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)
|
|
5846
5869
|
})`
|
|
5847
5870
|
position: relative;
|
|
5848
5871
|
appearance: none;
|
|
5849
5872
|
width: ${(props) => props.size ?? componentSize}px;
|
|
5850
5873
|
height: ${(props) => props.size ?? componentSize}px;
|
|
5851
|
-
background-color: ${(props) => props.theme.colors.backgroundContent};
|
|
5874
|
+
background-color: ${(props) => props.inactiveBackgroundColor ?? props.theme.colors.backgroundContent};
|
|
5852
5875
|
border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
|
|
5853
5876
|
border-radius: ${(props) => props.theme.styles.borderRadius / 2}px;
|
|
5854
5877
|
cursor: pointer;
|
|
@@ -5860,8 +5883,8 @@ var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
|
5860
5883
|
}
|
|
5861
5884
|
|
|
5862
5885
|
&:checked {
|
|
5863
|
-
background-color: ${(props) => props.theme.colors.primary};
|
|
5864
|
-
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};
|
|
5865
5888
|
}
|
|
5866
5889
|
|
|
5867
5890
|
&:disabled {
|
|
@@ -5882,7 +5905,18 @@ var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
|
5882
5905
|
}
|
|
5883
5906
|
`;
|
|
5884
5907
|
var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
5885
|
-
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)
|
|
5886
5920
|
})`
|
|
5887
5921
|
--width: ${(props) => componentSize * 2 - props.theme.styles.gap / 2}px;
|
|
5888
5922
|
--ball-size: ${componentSize - switchComponentBallGap * 2}px;
|
|
@@ -5890,7 +5924,7 @@ var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
|
5890
5924
|
position: relative;
|
|
5891
5925
|
width: var(--width);
|
|
5892
5926
|
height: ${componentSize}px;
|
|
5893
|
-
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};
|
|
5894
5928
|
border-radius: 999px;
|
|
5895
5929
|
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
5896
5930
|
opacity: ${(props) => props.disabled ? 0.5 : 1};
|
|
@@ -5901,7 +5935,7 @@ var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
|
5901
5935
|
position: absolute;
|
|
5902
5936
|
width: ${(props) => componentSize - switchComponentBallGap * 2 + (props.isMouseDown ? switchComponentMouseDownDifference : 0)}px;
|
|
5903
5937
|
height: ${componentSize - switchComponentBallGap * 2}px;
|
|
5904
|
-
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};
|
|
5905
5939
|
border-radius: 999px;
|
|
5906
5940
|
top: ${switchComponentBallGap}px;
|
|
5907
5941
|
left: ${switchComponentBallGap}px;
|
|
@@ -5917,7 +5951,7 @@ var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
|
5917
5951
|
position: absolute;
|
|
5918
5952
|
width: ${(props) => componentSize - switchComponentBallGap * 2 + (props.isMouseDown ? switchComponentMouseDownDifference : 0)}px;
|
|
5919
5953
|
height: ${componentSize - switchComponentBallGap * 2}px;
|
|
5920
|
-
background-color: ${(props) => props.checked ? props.theme.colors.primary : "transparent"};
|
|
5954
|
+
background-color: ${(props) => props.checked ? props.activeBackgroundColor ?? props.theme.colors.primary : "transparent"};
|
|
5921
5955
|
border-radius: 999px;
|
|
5922
5956
|
top: ${switchComponentBallGap}px;
|
|
5923
5957
|
left: ${switchComponentBallGap}px;
|
|
@@ -5951,6 +5985,10 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
5951
5985
|
errorText,
|
|
5952
5986
|
infoText,
|
|
5953
5987
|
infoTextColor,
|
|
5988
|
+
inactiveColor,
|
|
5989
|
+
activeColor,
|
|
5990
|
+
inactiveBackgroundColor,
|
|
5991
|
+
activeBackgroundColor,
|
|
5954
5992
|
size = componentSize,
|
|
5955
5993
|
value,
|
|
5956
5994
|
onChange,
|
|
@@ -6006,6 +6044,10 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
6006
6044
|
colorTheme,
|
|
6007
6045
|
size,
|
|
6008
6046
|
withNoBorder: theme2.styles.borderWidth === 0,
|
|
6047
|
+
inactiveColor,
|
|
6048
|
+
activeColor,
|
|
6049
|
+
inactiveBackgroundColor,
|
|
6050
|
+
activeBackgroundColor,
|
|
6009
6051
|
type: props.type ?? "checkbox",
|
|
6010
6052
|
checked,
|
|
6011
6053
|
onChange: onChangeElement,
|
|
@@ -6024,7 +6066,7 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
6024
6066
|
position: "absolute",
|
|
6025
6067
|
top: "50%",
|
|
6026
6068
|
left: "50%",
|
|
6027
|
-
color: theme2.colors.base,
|
|
6069
|
+
color: activeColor ?? theme2.colors.base,
|
|
6028
6070
|
size: size / 1.8,
|
|
6029
6071
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
6030
6072
|
opacity: checked ? 1 : 0,
|
|
@@ -6039,7 +6081,7 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
|
|
|
6039
6081
|
height: size / 2,
|
|
6040
6082
|
top: "50%",
|
|
6041
6083
|
left: "50%",
|
|
6042
|
-
backgroundColor: theme2.colors.base,
|
|
6084
|
+
backgroundColor: activeColor ?? theme2.colors.base,
|
|
6043
6085
|
borderRadius: 999,
|
|
6044
6086
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
6045
6087
|
opacity: checked ? 1 : 0,
|