react-better-html 1.1.239 → 1.1.240
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 +441 -404
- package/dist/index.d.ts +441 -404
- package/dist/index.js +435 -188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +435 -188
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -861,6 +861,21 @@ function useComponentPropsWithPrefix(props, prefix) {
|
|
|
861
861
|
return returnValue;
|
|
862
862
|
}, [props, prefix]);
|
|
863
863
|
}
|
|
864
|
+
function useComponentsPropsMerger(...props) {
|
|
865
|
+
return useMemo(
|
|
866
|
+
() => props.filter((props2) => props2 !== void 0).reduce(
|
|
867
|
+
(previousValue, currentValue) => ({
|
|
868
|
+
...previousValue,
|
|
869
|
+
...Object.entries(currentValue).reduce((pv, [key, value]) => {
|
|
870
|
+
if (value !== void 0) pv[key] = value;
|
|
871
|
+
return pv;
|
|
872
|
+
}, {})
|
|
873
|
+
}),
|
|
874
|
+
{}
|
|
875
|
+
),
|
|
876
|
+
[props]
|
|
877
|
+
);
|
|
878
|
+
}
|
|
864
879
|
function useComponentInputFieldDateProps(props, holderRef, disabled) {
|
|
865
880
|
const theme2 = useTheme();
|
|
866
881
|
const [isOpen, setIsOpen] = useBooleanState();
|
|
@@ -1334,7 +1349,14 @@ var Text_default = Text2;
|
|
|
1334
1349
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1335
1350
|
var Divider_default = {
|
|
1336
1351
|
vertical: memo2(
|
|
1337
|
-
forwardRef2(function Divider(
|
|
1352
|
+
forwardRef2(function Divider(dividerProps, ref) {
|
|
1353
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
1354
|
+
const {
|
|
1355
|
+
width = 1,
|
|
1356
|
+
backgroundColor,
|
|
1357
|
+
height,
|
|
1358
|
+
...props
|
|
1359
|
+
} = useComponentsPropsMerger(betterHtmlContextInternal.components.divider?.style?.vertical, dividerProps);
|
|
1338
1360
|
const theme2 = useTheme3();
|
|
1339
1361
|
return /* @__PURE__ */ jsx2(
|
|
1340
1362
|
Div_default,
|
|
@@ -1350,11 +1372,35 @@ var Divider_default = {
|
|
|
1350
1372
|
})
|
|
1351
1373
|
),
|
|
1352
1374
|
horizontal: memo2(
|
|
1353
|
-
forwardRef2(function Divider2(
|
|
1375
|
+
forwardRef2(function Divider2(dividerProps, ref) {
|
|
1376
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
1377
|
+
const {
|
|
1378
|
+
width = 1,
|
|
1379
|
+
backgroundColor,
|
|
1380
|
+
text,
|
|
1381
|
+
textFontFamily,
|
|
1382
|
+
textFontSize,
|
|
1383
|
+
textFontWeight,
|
|
1384
|
+
textTransform,
|
|
1385
|
+
textLetterSpacing,
|
|
1386
|
+
textColor,
|
|
1387
|
+
...props
|
|
1388
|
+
} = useComponentsPropsMerger(betterHtmlContextInternal.components.divider?.style?.horizontal, dividerProps);
|
|
1354
1389
|
const theme2 = useTheme3();
|
|
1355
1390
|
return /* @__PURE__ */ jsxs(Div_default.row, { width: "100%", alignItems: "center", gap: text ? theme2.styles.space : void 0, ...props, ref, children: [
|
|
1356
1391
|
/* @__PURE__ */ jsx2(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border }),
|
|
1357
|
-
text && /* @__PURE__ */ jsx2(
|
|
1392
|
+
text && /* @__PURE__ */ jsx2(
|
|
1393
|
+
Text_default,
|
|
1394
|
+
{
|
|
1395
|
+
fontFamily: textFontFamily,
|
|
1396
|
+
fontSize: textFontSize,
|
|
1397
|
+
fontWeight: textFontWeight,
|
|
1398
|
+
textTransform,
|
|
1399
|
+
letterSpacing: textLetterSpacing,
|
|
1400
|
+
color: textColor ?? theme2.colors.textSecondary,
|
|
1401
|
+
children: text
|
|
1402
|
+
}
|
|
1403
|
+
),
|
|
1358
1404
|
/* @__PURE__ */ jsx2(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border })
|
|
1359
1405
|
] });
|
|
1360
1406
|
})
|
|
@@ -1970,39 +2016,40 @@ var ButtonElement = styled6.button.withConfig({
|
|
|
1970
2016
|
${(props) => props.hoverStyle}
|
|
1971
2017
|
}
|
|
1972
2018
|
`;
|
|
1973
|
-
var ButtonComponent = function Button({
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2019
|
+
var ButtonComponent = function Button(buttonProps) {
|
|
2020
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2021
|
+
const {
|
|
2022
|
+
href,
|
|
2023
|
+
text,
|
|
2024
|
+
value,
|
|
2025
|
+
download,
|
|
2026
|
+
target,
|
|
2027
|
+
icon,
|
|
2028
|
+
iconPosition = "left",
|
|
2029
|
+
iconColor,
|
|
2030
|
+
iconSize,
|
|
2031
|
+
image,
|
|
2032
|
+
imagePosition = "left",
|
|
2033
|
+
imageWidth,
|
|
2034
|
+
imageHeight,
|
|
2035
|
+
loaderName,
|
|
2036
|
+
loaderSize,
|
|
2037
|
+
isLoading,
|
|
2038
|
+
disabled,
|
|
2039
|
+
isSmall,
|
|
2040
|
+
isSubmit,
|
|
2041
|
+
onClick,
|
|
2042
|
+
onClickWithValue,
|
|
2043
|
+
...props
|
|
2044
|
+
} = useComponentsPropsMerger(
|
|
2045
|
+
betterHtmlContextInternal.components.button?.style?.default,
|
|
2046
|
+
buttonProps
|
|
2047
|
+
);
|
|
1997
2048
|
const theme2 = useTheme9();
|
|
1998
2049
|
const isLoadingHook = useLoader(loaderName);
|
|
1999
|
-
const { components } = useBetterHtmlContextInternal();
|
|
2000
2050
|
const { colorTheme } = useBetterCoreContext3();
|
|
2001
2051
|
const isLoadingElement = isLoading || isLoadingHook;
|
|
2002
|
-
const { style, hoverStyle, restProps } = useComponentPropsGrouper(
|
|
2003
|
-
...components.button?.style?.default,
|
|
2004
|
-
...props
|
|
2005
|
-
});
|
|
2052
|
+
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
2006
2053
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
2007
2054
|
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
2008
2055
|
const onClickElement = useCallback3(
|
|
@@ -2037,8 +2084,8 @@ var ButtonComponent = function Button({
|
|
|
2037
2084
|
height: imageHeight
|
|
2038
2085
|
}
|
|
2039
2086
|
) : void 0;
|
|
2040
|
-
const linkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
2041
|
-
const buttonComponentTag = components.button?.tagReplacement?.buttonComponent ?? "button";
|
|
2087
|
+
const linkComponentTag = betterHtmlContextInternal.components.button?.tagReplacement?.linkComponent ?? "a";
|
|
2088
|
+
const buttonComponentTag = betterHtmlContextInternal.components.button?.tagReplacement?.buttonComponent ?? "button";
|
|
2042
2089
|
return /* @__PURE__ */ jsxs5(
|
|
2043
2090
|
ButtonElement,
|
|
2044
2091
|
{
|
|
@@ -2106,41 +2153,44 @@ var ButtonComponent = function Button({
|
|
|
2106
2153
|
}
|
|
2107
2154
|
);
|
|
2108
2155
|
};
|
|
2109
|
-
ButtonComponent.secondary = function Secondary(
|
|
2156
|
+
ButtonComponent.secondary = function Secondary(buttonProps) {
|
|
2157
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2158
|
+
const { className, ...props } = useComponentsPropsMerger(
|
|
2159
|
+
betterHtmlContextInternal.components.button?.style?.secondary,
|
|
2160
|
+
buttonProps
|
|
2161
|
+
);
|
|
2110
2162
|
const theme2 = useTheme9();
|
|
2111
|
-
const betterHtmlContext2 = useBetterHtmlContextInternal();
|
|
2112
2163
|
return /* @__PURE__ */ jsx8(
|
|
2113
2164
|
ButtonComponent,
|
|
2114
2165
|
{
|
|
2115
|
-
...betterHtmlContext2.components.button?.style?.secondary,
|
|
2116
2166
|
className: `secondary${className ? ` ${className}` : ""}`,
|
|
2117
2167
|
color: theme2.colors.textPrimary,
|
|
2118
2168
|
...props
|
|
2119
2169
|
}
|
|
2120
2170
|
);
|
|
2121
2171
|
};
|
|
2122
|
-
ButtonComponent.destructive = function Destructive(
|
|
2123
|
-
const
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
{
|
|
2128
|
-
...betterHtmlContext2.components.button?.style?.destructive,
|
|
2129
|
-
backgroundColor: theme2.colors.error,
|
|
2130
|
-
color: theme2.colors.base,
|
|
2131
|
-
...props
|
|
2132
|
-
}
|
|
2172
|
+
ButtonComponent.destructive = function Destructive(buttonProps) {
|
|
2173
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2174
|
+
const props = useComponentsPropsMerger(
|
|
2175
|
+
betterHtmlContextInternal.components.button?.style?.destructive,
|
|
2176
|
+
buttonProps
|
|
2133
2177
|
);
|
|
2178
|
+
const theme2 = useTheme9();
|
|
2179
|
+
return /* @__PURE__ */ jsx8(ButtonComponent, { backgroundColor: theme2.colors.error, color: theme2.colors.base, ...props });
|
|
2134
2180
|
};
|
|
2135
|
-
ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonColor, ...
|
|
2181
|
+
ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonColor, ...buttonProps }) {
|
|
2182
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2183
|
+
const { ...props } = useComponentsPropsMerger(
|
|
2184
|
+
betterHtmlContextInternal.components.button?.style?.icon,
|
|
2185
|
+
buttonProps
|
|
2186
|
+
);
|
|
2136
2187
|
const theme2 = useTheme9();
|
|
2137
|
-
const betterHtmlContext2 = useBetterHtmlContextInternal();
|
|
2138
2188
|
const readyButtonSize = buttonSize ?? size + theme2.styles.space;
|
|
2139
2189
|
const backgroundButtonColorReady = backgroundButtonColor ?? theme2.colors.textPrimary;
|
|
2140
2190
|
return /* @__PURE__ */ jsx8(
|
|
2141
2191
|
ButtonComponent,
|
|
2142
2192
|
{
|
|
2143
|
-
...
|
|
2193
|
+
...betterHtmlContextInternal.components.button?.style?.icon,
|
|
2144
2194
|
width: readyButtonSize,
|
|
2145
2195
|
height: readyButtonSize,
|
|
2146
2196
|
color: theme2.colors.textPrimary,
|
|
@@ -2157,8 +2207,12 @@ ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonC
|
|
|
2157
2207
|
}
|
|
2158
2208
|
);
|
|
2159
2209
|
};
|
|
2160
|
-
ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...
|
|
2161
|
-
const
|
|
2210
|
+
ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...buttonProps }) {
|
|
2211
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2212
|
+
const { ...props } = useComponentsPropsMerger(
|
|
2213
|
+
betterHtmlContextInternal.components.button?.style?.upload,
|
|
2214
|
+
buttonProps
|
|
2215
|
+
);
|
|
2162
2216
|
const onClickElement = useCallback3(() => {
|
|
2163
2217
|
const input = document.createElement("input");
|
|
2164
2218
|
input.setAttribute("type", "file");
|
|
@@ -2172,7 +2226,7 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...props
|
|
|
2172
2226
|
return /* @__PURE__ */ jsx8(
|
|
2173
2227
|
ButtonComponent,
|
|
2174
2228
|
{
|
|
2175
|
-
...
|
|
2229
|
+
...betterHtmlContextInternal.components.button?.style?.upload,
|
|
2176
2230
|
text: "Upload",
|
|
2177
2231
|
icon: "uploadCloud",
|
|
2178
2232
|
onClick: onClickElement,
|
|
@@ -3463,7 +3517,9 @@ import styled10 from "styled-components";
|
|
|
3463
3517
|
import { memo as memo15 } from "react";
|
|
3464
3518
|
import { useTheme as useTheme16 } from "react-better-core";
|
|
3465
3519
|
import { jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3466
|
-
function Label(
|
|
3520
|
+
function Label(labelProps) {
|
|
3521
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
3522
|
+
const { text, required, isError, fontFamily, letterSpacing, textTransform, color, htmlFor } = useComponentsPropsMerger(betterHtmlContextInternal.components.label?.style?.default, labelProps);
|
|
3467
3523
|
const theme2 = useTheme16();
|
|
3468
3524
|
return /* @__PURE__ */ jsxs11(
|
|
3469
3525
|
Text_default,
|
|
@@ -3471,8 +3527,11 @@ function Label({ text, required, isError, color, htmlFor }) {
|
|
|
3471
3527
|
as: "label",
|
|
3472
3528
|
width: "fit-content",
|
|
3473
3529
|
height: 16,
|
|
3530
|
+
fontFamily,
|
|
3474
3531
|
fontSize: 14,
|
|
3475
3532
|
color: isError ? theme2.colors.error : color ?? theme2.colors.textSecondary,
|
|
3533
|
+
letterSpacing,
|
|
3534
|
+
textTransform,
|
|
3476
3535
|
htmlFor,
|
|
3477
3536
|
"aria-required": required,
|
|
3478
3537
|
children: [
|
|
@@ -3498,35 +3557,43 @@ import {
|
|
|
3498
3557
|
} from "react-better-core";
|
|
3499
3558
|
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3500
3559
|
import { createElement as createElement2 } from "react";
|
|
3501
|
-
var DropdownComponent = forwardRef10(function Dropdown({
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3560
|
+
var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
|
|
3561
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
3562
|
+
const {
|
|
3563
|
+
label,
|
|
3564
|
+
labelFontFamily,
|
|
3565
|
+
labelLetterSpacing,
|
|
3566
|
+
labelTextTransform,
|
|
3567
|
+
labelColor,
|
|
3568
|
+
errorText,
|
|
3569
|
+
infoText,
|
|
3570
|
+
required,
|
|
3571
|
+
name,
|
|
3572
|
+
disabled,
|
|
3573
|
+
options,
|
|
3574
|
+
value: controlledValue,
|
|
3575
|
+
defaultValue,
|
|
3576
|
+
placeholder,
|
|
3577
|
+
leftIcon,
|
|
3578
|
+
inputFieldClassName,
|
|
3579
|
+
withSearch,
|
|
3580
|
+
withDebounce,
|
|
3581
|
+
debounceDelay = 0.5,
|
|
3582
|
+
debounceIsLoading,
|
|
3583
|
+
debounceMinimumSymbolsRequired,
|
|
3584
|
+
withoutClearButton,
|
|
3585
|
+
withoutRenderingOptionsWhenClosed,
|
|
3586
|
+
onChange,
|
|
3587
|
+
onChangeSearch,
|
|
3588
|
+
renderOption,
|
|
3589
|
+
renderOptionDivider,
|
|
3590
|
+
withMultiselect,
|
|
3591
|
+
id,
|
|
3592
|
+
...props
|
|
3593
|
+
} = useComponentsPropsMerger(
|
|
3594
|
+
betterHtmlContextInternal.components.dropdown?.style?.default,
|
|
3595
|
+
dropdownProps
|
|
3596
|
+
);
|
|
3530
3597
|
const theme2 = useTheme17();
|
|
3531
3598
|
const inputFieldHolderRef = useRef4(null);
|
|
3532
3599
|
const buttonsRef = useRef4(null);
|
|
@@ -3736,6 +3803,9 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3736
3803
|
InputField_default,
|
|
3737
3804
|
{
|
|
3738
3805
|
label,
|
|
3806
|
+
labelFontFamily,
|
|
3807
|
+
labelLetterSpacing,
|
|
3808
|
+
labelTextTransform,
|
|
3739
3809
|
labelColor,
|
|
3740
3810
|
errorText,
|
|
3741
3811
|
infoText,
|
|
@@ -3879,7 +3949,12 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3879
3949
|
}
|
|
3880
3950
|
) });
|
|
3881
3951
|
});
|
|
3882
|
-
DropdownComponent.countries = forwardRef10(function Countries(
|
|
3952
|
+
DropdownComponent.countries = forwardRef10(function Countries(dropdownProps, ref) {
|
|
3953
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
3954
|
+
const props = useComponentsPropsMerger(
|
|
3955
|
+
betterHtmlContextInternal.components.dropdown?.style?.countries,
|
|
3956
|
+
dropdownProps
|
|
3957
|
+
);
|
|
3883
3958
|
const theme2 = useTheme17();
|
|
3884
3959
|
const renderOption = useCallback8(
|
|
3885
3960
|
(option, index, isSelected) => /* @__PURE__ */ jsxs12(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
@@ -4298,30 +4373,35 @@ var TextareaElement = styled10.textarea.withConfig({
|
|
|
4298
4373
|
`;
|
|
4299
4374
|
var hours = Array.from({ length: 24 }, (_, index) => index);
|
|
4300
4375
|
var minutes = Array.from({ length: 60 }, (_, index) => index);
|
|
4301
|
-
var InputFieldComponent = forwardRef11(function InputField({
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4376
|
+
var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref) {
|
|
4377
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4378
|
+
const {
|
|
4379
|
+
label,
|
|
4380
|
+
labelFontFamily,
|
|
4381
|
+
labelLetterSpacing,
|
|
4382
|
+
labelTextTransform,
|
|
4383
|
+
labelColor,
|
|
4384
|
+
errorText,
|
|
4385
|
+
infoText,
|
|
4386
|
+
leftIcon,
|
|
4387
|
+
rightIcon,
|
|
4388
|
+
prefix,
|
|
4389
|
+
prefixBackgroundColor,
|
|
4390
|
+
suffix,
|
|
4391
|
+
suffixBackgroundColor,
|
|
4392
|
+
insideInputFieldBeforeComponent,
|
|
4393
|
+
insideInputFieldAfterComponent,
|
|
4394
|
+
withDebounce,
|
|
4395
|
+
debounceDelay = 0.5,
|
|
4396
|
+
onChange,
|
|
4397
|
+
onChangeValue,
|
|
4398
|
+
onClickRightIcon,
|
|
4399
|
+
holderRef,
|
|
4400
|
+
required,
|
|
4401
|
+
placeholder,
|
|
4402
|
+
id,
|
|
4403
|
+
...props
|
|
4404
|
+
} = useComponentsPropsMerger(betterHtmlContextInternal.components.inputField?.style?.default, inputFieldProps);
|
|
4325
4405
|
const theme2 = useTheme19();
|
|
4326
4406
|
const internalId = useId2();
|
|
4327
4407
|
const { colorTheme } = useBetterCoreContext7();
|
|
@@ -4357,7 +4437,19 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4357
4437
|
}, [withDebounce, onChangeValue, debouncedValue]);
|
|
4358
4438
|
const readyId = id ?? internalId;
|
|
4359
4439
|
return /* @__PURE__ */ jsxs14(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, ...excludeStyle, children: [
|
|
4360
|
-
label && /* @__PURE__ */ jsx17(
|
|
4440
|
+
label && /* @__PURE__ */ jsx17(
|
|
4441
|
+
Label_default,
|
|
4442
|
+
{
|
|
4443
|
+
text: label,
|
|
4444
|
+
fontFamily: labelFontFamily,
|
|
4445
|
+
letterSpacing: labelLetterSpacing,
|
|
4446
|
+
textTransform: labelTextTransform,
|
|
4447
|
+
color: labelColor,
|
|
4448
|
+
required,
|
|
4449
|
+
isError: !!errorText,
|
|
4450
|
+
htmlFor: readyId
|
|
4451
|
+
}
|
|
4452
|
+
),
|
|
4361
4453
|
/* @__PURE__ */ jsxs14(Div_default.row, { alignItems: "stretch", width: "100%", children: [
|
|
4362
4454
|
prefix && /* @__PURE__ */ jsx17(
|
|
4363
4455
|
Div_default.row,
|
|
@@ -4459,20 +4551,29 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4459
4551
|
)
|
|
4460
4552
|
] });
|
|
4461
4553
|
});
|
|
4462
|
-
InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4554
|
+
InputFieldComponent.multiline = forwardRef11(function Multiline(inputFieldProps, ref) {
|
|
4555
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4556
|
+
const {
|
|
4557
|
+
label,
|
|
4558
|
+
labelFontFamily,
|
|
4559
|
+
labelLetterSpacing,
|
|
4560
|
+
labelTextTransform,
|
|
4561
|
+
labelColor,
|
|
4562
|
+
placeholder,
|
|
4563
|
+
errorText,
|
|
4564
|
+
infoText,
|
|
4565
|
+
leftIcon,
|
|
4566
|
+
rightIcon,
|
|
4567
|
+
onChange,
|
|
4568
|
+
onChangeValue,
|
|
4569
|
+
onClickRightIcon,
|
|
4570
|
+
required,
|
|
4571
|
+
id,
|
|
4572
|
+
...props
|
|
4573
|
+
} = useComponentsPropsMerger(
|
|
4574
|
+
betterHtmlContextInternal.components.inputField?.style?.multiline,
|
|
4575
|
+
inputFieldProps
|
|
4576
|
+
);
|
|
4476
4577
|
const theme2 = useTheme19();
|
|
4477
4578
|
const internalId = useId2();
|
|
4478
4579
|
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
@@ -4487,7 +4588,19 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4487
4588
|
);
|
|
4488
4589
|
const readyId = id ?? internalId;
|
|
4489
4590
|
return /* @__PURE__ */ jsxs14(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
4490
|
-
label && /* @__PURE__ */ jsx17(
|
|
4591
|
+
label && /* @__PURE__ */ jsx17(
|
|
4592
|
+
Label_default,
|
|
4593
|
+
{
|
|
4594
|
+
text: label,
|
|
4595
|
+
fontFamily: labelFontFamily,
|
|
4596
|
+
letterSpacing: labelLetterSpacing,
|
|
4597
|
+
textTransform: labelTextTransform,
|
|
4598
|
+
color: labelColor,
|
|
4599
|
+
required,
|
|
4600
|
+
isError: !!errorText,
|
|
4601
|
+
htmlFor: readyId
|
|
4602
|
+
}
|
|
4603
|
+
),
|
|
4491
4604
|
/* @__PURE__ */ jsxs14(Div_default, { position: "relative", width: "100%", children: [
|
|
4492
4605
|
leftIcon && /* @__PURE__ */ jsx17(
|
|
4493
4606
|
Icon_default,
|
|
@@ -4546,14 +4659,19 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4546
4659
|
as: "span",
|
|
4547
4660
|
display: "block",
|
|
4548
4661
|
marginTop: theme2.styles.gap / 2,
|
|
4549
|
-
color: errorText ? theme2.colors.error :
|
|
4662
|
+
color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
|
|
4550
4663
|
fontSize: 14,
|
|
4551
4664
|
children: errorText || infoText
|
|
4552
4665
|
}
|
|
4553
4666
|
)
|
|
4554
4667
|
] });
|
|
4555
4668
|
});
|
|
4556
|
-
InputFieldComponent.email = forwardRef11(function Email(
|
|
4669
|
+
InputFieldComponent.email = forwardRef11(function Email(inputFieldProps, ref) {
|
|
4670
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4671
|
+
const props = useComponentsPropsMerger(
|
|
4672
|
+
betterHtmlContextInternal.components.inputField?.style?.email,
|
|
4673
|
+
inputFieldProps
|
|
4674
|
+
);
|
|
4557
4675
|
return /* @__PURE__ */ jsx17(
|
|
4558
4676
|
InputFieldComponent,
|
|
4559
4677
|
{
|
|
@@ -4567,7 +4685,12 @@ InputFieldComponent.email = forwardRef11(function Email({ ...props }, ref) {
|
|
|
4567
4685
|
}
|
|
4568
4686
|
);
|
|
4569
4687
|
});
|
|
4570
|
-
InputFieldComponent.password = forwardRef11(function Password(
|
|
4688
|
+
InputFieldComponent.password = forwardRef11(function Password(inputFieldProps, ref) {
|
|
4689
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4690
|
+
const props = useComponentsPropsMerger(
|
|
4691
|
+
betterHtmlContextInternal.components.inputField?.style?.password,
|
|
4692
|
+
inputFieldProps
|
|
4693
|
+
);
|
|
4571
4694
|
const [isPassword, setIsPassword] = useBooleanState5(true);
|
|
4572
4695
|
return /* @__PURE__ */ jsx17(
|
|
4573
4696
|
InputFieldComponent,
|
|
@@ -4584,7 +4707,12 @@ InputFieldComponent.password = forwardRef11(function Password({ ...props }, ref)
|
|
|
4584
4707
|
}
|
|
4585
4708
|
);
|
|
4586
4709
|
});
|
|
4587
|
-
InputFieldComponent.search = forwardRef11(function Search(
|
|
4710
|
+
InputFieldComponent.search = forwardRef11(function Search(inputFieldProps, ref) {
|
|
4711
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4712
|
+
const { value, onChangeValue, onFocus, onBlur, ...props } = useComponentsPropsMerger(
|
|
4713
|
+
betterHtmlContextInternal.components.inputField?.style?.search,
|
|
4714
|
+
inputFieldProps
|
|
4715
|
+
);
|
|
4588
4716
|
const [inputFieldValue, setInputFieldValue] = useState7(value?.toString() ?? "");
|
|
4589
4717
|
const [inputFieldFocused, setInputFieldFocused] = useBooleanState5();
|
|
4590
4718
|
const onChangeValueElement = useCallback10(
|
|
@@ -4627,7 +4755,19 @@ InputFieldComponent.search = forwardRef11(function Search({ value, onChangeValue
|
|
|
4627
4755
|
}
|
|
4628
4756
|
);
|
|
4629
4757
|
});
|
|
4630
|
-
InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber(
|
|
4758
|
+
InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber(inputFieldProps, ref) {
|
|
4759
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4760
|
+
const {
|
|
4761
|
+
label,
|
|
4762
|
+
labelFontFamily,
|
|
4763
|
+
labelLetterSpacing,
|
|
4764
|
+
labelTextTransform,
|
|
4765
|
+
labelColor,
|
|
4766
|
+
value,
|
|
4767
|
+
onChangeValue,
|
|
4768
|
+
id,
|
|
4769
|
+
...props
|
|
4770
|
+
} = useComponentsPropsMerger(betterHtmlContextInternal.components.inputField?.style?.phoneNumber, inputFieldProps);
|
|
4631
4771
|
const theme2 = useTheme19();
|
|
4632
4772
|
const internalId = useId2();
|
|
4633
4773
|
const [dropdownValue, setDropdownValue] = useState7();
|
|
@@ -4685,12 +4825,16 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
4685
4825
|
setInputFieldValue(newValue.slice(country.phoneNumberExtension.length + 1));
|
|
4686
4826
|
}, [value]);
|
|
4687
4827
|
const readyId = id ?? internalId;
|
|
4828
|
+
const readyLabel = betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.label ?? label;
|
|
4688
4829
|
return /* @__PURE__ */ jsxs14(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, children: [
|
|
4689
|
-
|
|
4830
|
+
readyLabel && /* @__PURE__ */ jsx17(
|
|
4690
4831
|
Label_default,
|
|
4691
4832
|
{
|
|
4692
|
-
text:
|
|
4693
|
-
|
|
4833
|
+
text: readyLabel,
|
|
4834
|
+
fontFamily: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelFontFamily ?? labelFontFamily,
|
|
4835
|
+
letterSpacing: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelLetterSpacing ?? labelLetterSpacing,
|
|
4836
|
+
textTransform: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelTextTransform ?? labelTextTransform,
|
|
4837
|
+
color: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelColor ?? labelColor,
|
|
4694
4838
|
required: props.required,
|
|
4695
4839
|
isError: !!props.errorText,
|
|
4696
4840
|
htmlFor: readyId
|
|
@@ -4718,7 +4862,9 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
4718
4862
|
/* @__PURE__ */ jsx17(
|
|
4719
4863
|
InputFieldComponent,
|
|
4720
4864
|
{
|
|
4721
|
-
|
|
4865
|
+
...betterHtmlContextInternal.components.inputField?.style?.phoneNumber,
|
|
4866
|
+
label: void 0,
|
|
4867
|
+
placeholder: readyLabel ?? "Phone number",
|
|
4722
4868
|
className: "react-better-html-phone-number",
|
|
4723
4869
|
value: inputFieldValue,
|
|
4724
4870
|
onChangeValue: onChangeValueElement,
|
|
@@ -4730,21 +4876,32 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
4730
4876
|
] })
|
|
4731
4877
|
] });
|
|
4732
4878
|
});
|
|
4733
|
-
InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...
|
|
4879
|
+
InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...inputFieldProps }, ref) {
|
|
4880
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4881
|
+
const props = useComponentsPropsMerger(
|
|
4882
|
+
betterHtmlContextInternal.components.inputField?.style?.date,
|
|
4883
|
+
inputFieldProps
|
|
4884
|
+
);
|
|
4734
4885
|
const theme2 = useTheme19();
|
|
4735
4886
|
const holderRef = useRef5(null);
|
|
4736
4887
|
const isMobileIOS = isMobileDevice && getBrowser() === "safari";
|
|
4737
|
-
const {
|
|
4888
|
+
const {
|
|
4889
|
+
internalValue,
|
|
4890
|
+
setInternalValue,
|
|
4891
|
+
inputFieldProps: restInputFieldProps,
|
|
4892
|
+
insideInputFieldComponentProps
|
|
4893
|
+
} = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
|
|
4738
4894
|
const onChange = useCallback10(
|
|
4739
4895
|
(date) => {
|
|
4740
|
-
|
|
4896
|
+
restInputFieldProps.onChangeValue?.(date ?? "");
|
|
4741
4897
|
setInternalValue(date ?? "");
|
|
4742
4898
|
},
|
|
4743
|
-
[
|
|
4899
|
+
[restInputFieldProps.onChangeValue]
|
|
4744
4900
|
);
|
|
4745
4901
|
return /* @__PURE__ */ jsx17(
|
|
4746
4902
|
InputFieldComponent,
|
|
4747
4903
|
{
|
|
4904
|
+
...betterHtmlContextInternal.components.inputField?.style?.date,
|
|
4748
4905
|
type: "date",
|
|
4749
4906
|
insideInputFieldAfterComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
|
|
4750
4907
|
Div_default,
|
|
@@ -4765,7 +4922,7 @@ InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...pr
|
|
|
4765
4922
|
holderRef,
|
|
4766
4923
|
ref,
|
|
4767
4924
|
...props,
|
|
4768
|
-
...
|
|
4925
|
+
...restInputFieldProps
|
|
4769
4926
|
}
|
|
4770
4927
|
);
|
|
4771
4928
|
});
|
|
@@ -4776,14 +4933,25 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4776
4933
|
maxDate,
|
|
4777
4934
|
defaultDateAfterTimePick,
|
|
4778
4935
|
defaultTimeAfterDatePick = "00:00",
|
|
4779
|
-
...
|
|
4936
|
+
...inputFieldProps
|
|
4780
4937
|
}, ref) {
|
|
4938
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
4939
|
+
const props = useComponentsPropsMerger(
|
|
4940
|
+
betterHtmlContextInternal.components.inputField?.style?.dateTime,
|
|
4941
|
+
inputFieldProps
|
|
4942
|
+
);
|
|
4781
4943
|
const theme2 = useTheme19();
|
|
4782
4944
|
const holderRef = useRef5(null);
|
|
4783
4945
|
const selectedHourRef = useRef5(null);
|
|
4784
4946
|
const selectedMinuteRef = useRef5(null);
|
|
4785
4947
|
const isMobileIOS = isMobileDevice && getBrowser() === "safari";
|
|
4786
|
-
const {
|
|
4948
|
+
const {
|
|
4949
|
+
internalValue,
|
|
4950
|
+
setInternalValue,
|
|
4951
|
+
inputFieldProps: restInputFieldProps,
|
|
4952
|
+
insideInputFieldComponentProps,
|
|
4953
|
+
isOpen
|
|
4954
|
+
} = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
|
|
4787
4955
|
const readyHours = useMemo6(
|
|
4788
4956
|
() => hoursToRender?.filter((hour) => hour >= 0 && hour <= 23) ?? hours,
|
|
4789
4957
|
[hoursToRender]
|
|
@@ -4795,10 +4963,10 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4795
4963
|
const onChange = useCallback10(
|
|
4796
4964
|
(date) => {
|
|
4797
4965
|
const newValue = date ? `${date}T${internalValue?.toString().split("T")[1] ?? defaultTimeAfterDatePick}` : "";
|
|
4798
|
-
|
|
4966
|
+
restInputFieldProps.onChangeValue?.(newValue);
|
|
4799
4967
|
setInternalValue(newValue);
|
|
4800
4968
|
},
|
|
4801
|
-
[internalValue, defaultTimeAfterDatePick,
|
|
4969
|
+
[internalValue, defaultTimeAfterDatePick, restInputFieldProps.onChangeValue]
|
|
4802
4970
|
);
|
|
4803
4971
|
const onBlur = useCallback10(
|
|
4804
4972
|
(event) => {
|
|
@@ -4811,9 +4979,9 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4811
4979
|
const newTime = `${readyHour.toString().padStart(2, "0")}:${readyMinute.toString().padStart(2, "0")}`;
|
|
4812
4980
|
const today = defaultDateAfterTimePick ?? `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
|
|
4813
4981
|
const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
|
|
4814
|
-
|
|
4982
|
+
restInputFieldProps.onChangeValue?.(newValue);
|
|
4815
4983
|
}
|
|
4816
|
-
|
|
4984
|
+
restInputFieldProps.onBlur?.(event);
|
|
4817
4985
|
},
|
|
4818
4986
|
[
|
|
4819
4987
|
defaultDateAfterTimePick,
|
|
@@ -4822,8 +4990,8 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4822
4990
|
minutesToRender,
|
|
4823
4991
|
readyHours,
|
|
4824
4992
|
readyMinutes,
|
|
4825
|
-
|
|
4826
|
-
|
|
4993
|
+
restInputFieldProps.onChangeValue,
|
|
4994
|
+
restInputFieldProps.onBlur
|
|
4827
4995
|
]
|
|
4828
4996
|
);
|
|
4829
4997
|
const onClickHour = useCallback10(
|
|
@@ -4831,20 +4999,20 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4831
4999
|
const newTime = `${hour.toString().padStart(2, "0")}:${internalValue?.toString().split(":")[1] || "00"}`;
|
|
4832
5000
|
const today = defaultDateAfterTimePick ?? `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
|
|
4833
5001
|
const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
|
|
4834
|
-
|
|
5002
|
+
restInputFieldProps.onChangeValue?.(newValue);
|
|
4835
5003
|
setInternalValue(newValue);
|
|
4836
5004
|
},
|
|
4837
|
-
[defaultDateAfterTimePick, internalValue,
|
|
5005
|
+
[defaultDateAfterTimePick, internalValue, restInputFieldProps.onChangeValue]
|
|
4838
5006
|
);
|
|
4839
5007
|
const onClickMinute = useCallback10(
|
|
4840
5008
|
(minute) => {
|
|
4841
5009
|
const newTime = `${internalValue?.toString().split("T")?.[1]?.split(":")[0] || "00"}:${minute.toString().padStart(2, "0")}`;
|
|
4842
5010
|
const today = defaultDateAfterTimePick ?? `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
|
|
4843
5011
|
const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
|
|
4844
|
-
|
|
5012
|
+
restInputFieldProps.onChangeValue?.(newValue);
|
|
4845
5013
|
setInternalValue(newValue);
|
|
4846
5014
|
},
|
|
4847
|
-
[defaultDateAfterTimePick, internalValue,
|
|
5015
|
+
[defaultDateAfterTimePick, internalValue, restInputFieldProps.onChangeValue]
|
|
4848
5016
|
);
|
|
4849
5017
|
useEffect9(() => {
|
|
4850
5018
|
if (isOpen && selectedHourRef.current)
|
|
@@ -4858,6 +5026,7 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4858
5026
|
return /* @__PURE__ */ jsx17(
|
|
4859
5027
|
InputFieldComponent,
|
|
4860
5028
|
{
|
|
5029
|
+
...betterHtmlContextInternal.components.inputField?.style?.dateTime,
|
|
4861
5030
|
type: "datetime-local",
|
|
4862
5031
|
insideInputFieldAfterComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
|
|
4863
5032
|
Div_default,
|
|
@@ -4961,12 +5130,17 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({
|
|
|
4961
5130
|
holderRef,
|
|
4962
5131
|
ref,
|
|
4963
5132
|
...props,
|
|
4964
|
-
...
|
|
5133
|
+
...restInputFieldProps,
|
|
4965
5134
|
onBlur
|
|
4966
5135
|
}
|
|
4967
5136
|
);
|
|
4968
5137
|
});
|
|
4969
|
-
InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesToRender, minTime, maxTime, ...
|
|
5138
|
+
InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesToRender, minTime, maxTime, ...inputFieldProps }, ref) {
|
|
5139
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
5140
|
+
const props = useComponentsPropsMerger(
|
|
5141
|
+
betterHtmlContextInternal.components.inputField?.style?.time,
|
|
5142
|
+
inputFieldProps
|
|
5143
|
+
);
|
|
4970
5144
|
const theme2 = useTheme19();
|
|
4971
5145
|
const holderRef = useRef5(null);
|
|
4972
5146
|
const selectedHourRef = useRef5(null);
|
|
@@ -4976,7 +5150,13 @@ InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesTo
|
|
|
4976
5150
|
const minMinutes = minTime ? parseInt(minTime.split(":")[1]) : void 0;
|
|
4977
5151
|
const maxHours = maxTime ? parseInt(maxTime.split(":")[0]) : void 0;
|
|
4978
5152
|
const maxMinutes = maxTime ? parseInt(maxTime.split(":")[1]) : void 0;
|
|
4979
|
-
const {
|
|
5153
|
+
const {
|
|
5154
|
+
internalValue,
|
|
5155
|
+
setInternalValue,
|
|
5156
|
+
inputFieldProps: restInputFieldProps,
|
|
5157
|
+
insideInputFieldComponentProps,
|
|
5158
|
+
isOpen
|
|
5159
|
+
} = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
|
|
4980
5160
|
const readyHours = useMemo6(
|
|
4981
5161
|
() => hoursToRender?.filter((hour) => hour >= 0 && hour <= 23) ?? hours,
|
|
4982
5162
|
[hoursToRender]
|
|
@@ -4996,9 +5176,9 @@ InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesTo
|
|
|
4996
5176
|
const finalHour = minHours && readyHour < minHours ? minHours : maxHours && readyHour > maxHours ? maxHours : readyHour;
|
|
4997
5177
|
const finalMinute = !!minHours && !!minMinutes && finalHour === minHours && readyMinute < minMinutes ? minMinutes : !!maxHours && !!maxMinutes && finalHour === maxHours && readyMinute > maxMinutes ? maxMinutes : readyMinute;
|
|
4998
5178
|
const newValue = `${finalHour.toString().padStart(2, "0")}:${finalMinute.toString().padStart(2, "0")}`;
|
|
4999
|
-
|
|
5179
|
+
restInputFieldProps.onChangeValue?.(newValue);
|
|
5000
5180
|
}
|
|
5001
|
-
|
|
5181
|
+
restInputFieldProps.onBlur?.(event);
|
|
5002
5182
|
},
|
|
5003
5183
|
[
|
|
5004
5184
|
minHours,
|
|
@@ -5009,25 +5189,25 @@ InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesTo
|
|
|
5009
5189
|
minutesToRender,
|
|
5010
5190
|
readyHours,
|
|
5011
5191
|
readyMinutes,
|
|
5012
|
-
|
|
5013
|
-
|
|
5192
|
+
restInputFieldProps.onChangeValue,
|
|
5193
|
+
restInputFieldProps.onBlur
|
|
5014
5194
|
]
|
|
5015
5195
|
);
|
|
5016
5196
|
const onClickHour = useCallback10(
|
|
5017
5197
|
(hour) => {
|
|
5018
5198
|
const value = `${hour.toString().padStart(2, "0")}:${internalValue?.toString().split(":")[1] || "00"}`;
|
|
5019
|
-
|
|
5199
|
+
restInputFieldProps.onChangeValue?.(value);
|
|
5020
5200
|
setInternalValue(value);
|
|
5021
5201
|
},
|
|
5022
|
-
[internalValue,
|
|
5202
|
+
[internalValue, restInputFieldProps.onChangeValue]
|
|
5023
5203
|
);
|
|
5024
5204
|
const onClickMinute = useCallback10(
|
|
5025
5205
|
(minute) => {
|
|
5026
5206
|
const value = `${internalValue?.toString().split(":")[0] || "00"}:${minute.toString().padStart(2, "0")}`;
|
|
5027
|
-
|
|
5207
|
+
restInputFieldProps.onChangeValue?.(value);
|
|
5028
5208
|
setInternalValue(value);
|
|
5029
5209
|
},
|
|
5030
|
-
[internalValue,
|
|
5210
|
+
[internalValue, restInputFieldProps.onChangeValue]
|
|
5031
5211
|
);
|
|
5032
5212
|
useEffect9(() => {
|
|
5033
5213
|
if (isOpen && selectedHourRef.current)
|
|
@@ -5040,6 +5220,7 @@ InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesTo
|
|
|
5040
5220
|
return /* @__PURE__ */ jsx17(
|
|
5041
5221
|
InputFieldComponent,
|
|
5042
5222
|
{
|
|
5223
|
+
...betterHtmlContextInternal.components.inputField?.style?.time,
|
|
5043
5224
|
type: "time",
|
|
5044
5225
|
insideInputFieldAfterComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
|
|
5045
5226
|
Div_default,
|
|
@@ -5128,13 +5309,18 @@ InputFieldComponent.time = forwardRef11(function Time({ hoursToRender, minutesTo
|
|
|
5128
5309
|
holderRef,
|
|
5129
5310
|
ref,
|
|
5130
5311
|
...props,
|
|
5131
|
-
...
|
|
5312
|
+
...restInputFieldProps,
|
|
5132
5313
|
minWidth: buttonWidth * 2 + 2,
|
|
5133
5314
|
onBlur
|
|
5134
5315
|
}
|
|
5135
5316
|
);
|
|
5136
5317
|
});
|
|
5137
|
-
InputFieldComponent.color = forwardRef11(function Color4(
|
|
5318
|
+
InputFieldComponent.color = forwardRef11(function Color4(inputFieldProps, ref) {
|
|
5319
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
5320
|
+
const { value, onChangeValue, ...props } = useComponentsPropsMerger(
|
|
5321
|
+
betterHtmlContextInternal.components.inputField?.style?.time,
|
|
5322
|
+
inputFieldProps
|
|
5323
|
+
);
|
|
5138
5324
|
const [inputFieldValue, setInputFieldValue] = useState7(value ?? "#000000");
|
|
5139
5325
|
const onChangeValueElement = useCallback10(
|
|
5140
5326
|
(value2) => {
|
|
@@ -5150,6 +5336,7 @@ InputFieldComponent.color = forwardRef11(function Color4({ value, onChangeValue,
|
|
|
5150
5336
|
return /* @__PURE__ */ jsx17(
|
|
5151
5337
|
InputFieldComponent,
|
|
5152
5338
|
{
|
|
5339
|
+
...betterHtmlContextInternal.components.inputField?.style?.color,
|
|
5153
5340
|
type: "color",
|
|
5154
5341
|
insideInputFieldAfterComponent: /* @__PURE__ */ jsx17(
|
|
5155
5342
|
Div_default.row,
|
|
@@ -5284,8 +5471,14 @@ var SwitchElement = styled11.div.withConfig({
|
|
|
5284
5471
|
`;
|
|
5285
5472
|
var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
5286
5473
|
label,
|
|
5474
|
+
labelFontFamily,
|
|
5475
|
+
labelLetterSpacing,
|
|
5476
|
+
labelTextTransform,
|
|
5287
5477
|
labelColor,
|
|
5288
5478
|
text,
|
|
5479
|
+
textFontFamily,
|
|
5480
|
+
textLetterSpacing,
|
|
5481
|
+
textTextTransform,
|
|
5289
5482
|
textAdvanced,
|
|
5290
5483
|
errorText,
|
|
5291
5484
|
infoText,
|
|
@@ -5319,7 +5512,19 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5319
5512
|
}, [checked, controlledChecked, onChange, value]);
|
|
5320
5513
|
const readyId = id ?? internalId;
|
|
5321
5514
|
return /* @__PURE__ */ jsxs15(Div_default.column, { gap: theme2.styles.gap, ...excludeStyle, children: [
|
|
5322
|
-
label && /* @__PURE__ */ jsx18(
|
|
5515
|
+
label && /* @__PURE__ */ jsx18(
|
|
5516
|
+
Label_default,
|
|
5517
|
+
{
|
|
5518
|
+
text: label,
|
|
5519
|
+
fontFamily: labelFontFamily,
|
|
5520
|
+
letterSpacing: labelLetterSpacing,
|
|
5521
|
+
textTransform: labelTextTransform,
|
|
5522
|
+
color: labelColor,
|
|
5523
|
+
required,
|
|
5524
|
+
isError: !!errorText,
|
|
5525
|
+
htmlFor: readyId
|
|
5526
|
+
}
|
|
5527
|
+
),
|
|
5323
5528
|
/* @__PURE__ */ jsxs15(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
5324
5529
|
/* @__PURE__ */ jsxs15(Div_default.row, { position: "relative", alignItems: "center", children: [
|
|
5325
5530
|
/* @__PURE__ */ jsx18(
|
|
@@ -5367,13 +5572,25 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5367
5572
|
}
|
|
5368
5573
|
) : void 0
|
|
5369
5574
|
] }),
|
|
5370
|
-
text ? /* @__PURE__ */ jsxs15(
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5575
|
+
text ? /* @__PURE__ */ jsxs15(
|
|
5576
|
+
Text_default,
|
|
5577
|
+
{
|
|
5578
|
+
fontFamily: textFontFamily,
|
|
5579
|
+
letterSpacing: textLetterSpacing,
|
|
5580
|
+
textTransform: textTextTransform,
|
|
5581
|
+
color,
|
|
5582
|
+
userSelect: "none",
|
|
5583
|
+
cursor: "pointer",
|
|
5584
|
+
onClick: onClickText,
|
|
5585
|
+
children: [
|
|
5586
|
+
text,
|
|
5587
|
+
required && !label && /* @__PURE__ */ jsxs15(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
|
|
5588
|
+
" ",
|
|
5589
|
+
"*"
|
|
5590
|
+
] })
|
|
5591
|
+
]
|
|
5592
|
+
}
|
|
5593
|
+
) : textAdvanced ? /* @__PURE__ */ jsxs15(Div_default.row, { userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
|
|
5377
5594
|
textAdvanced,
|
|
5378
5595
|
required && !label && /* @__PURE__ */ jsxs15(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, marginLeft: 4, children: [
|
|
5379
5596
|
" ",
|
|
@@ -5394,25 +5611,43 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5394
5611
|
] });
|
|
5395
5612
|
});
|
|
5396
5613
|
var ToggleInput_default = {
|
|
5397
|
-
checkbox: forwardRef12(function Checkbox(
|
|
5614
|
+
checkbox: forwardRef12(function Checkbox(checkboxProps, ref) {
|
|
5615
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
5616
|
+
const props = useComponentsPropsMerger(
|
|
5617
|
+
betterHtmlContextInternal.components.toggleInput?.style?.checkbox,
|
|
5618
|
+
checkboxProps
|
|
5619
|
+
);
|
|
5398
5620
|
return /* @__PURE__ */ jsx18(ToggleInputComponent, { type: "checkbox", ref, ...props });
|
|
5399
5621
|
}),
|
|
5400
|
-
radiobutton: forwardRef12(function RadioButton(
|
|
5622
|
+
radiobutton: forwardRef12(function RadioButton(radiobuttonProps, ref) {
|
|
5623
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
5624
|
+
const props = useComponentsPropsMerger(
|
|
5625
|
+
betterHtmlContextInternal.components.toggleInput?.style?.radiobutton,
|
|
5626
|
+
radiobuttonProps
|
|
5627
|
+
);
|
|
5401
5628
|
return /* @__PURE__ */ jsx18(ToggleInputComponent, { type: "radio", ref, ...props });
|
|
5402
5629
|
}),
|
|
5403
|
-
switch: forwardRef12(function Switch({
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5630
|
+
switch: forwardRef12(function Switch(switchProps, ref) {
|
|
5631
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
5632
|
+
const {
|
|
5633
|
+
label,
|
|
5634
|
+
labelFontFamily,
|
|
5635
|
+
labelLetterSpacing,
|
|
5636
|
+
labelTextTransform,
|
|
5637
|
+
labelColor,
|
|
5638
|
+
errorText,
|
|
5639
|
+
infoText,
|
|
5640
|
+
disabled,
|
|
5641
|
+
value,
|
|
5642
|
+
onChange,
|
|
5643
|
+
checked: controlledChecked,
|
|
5644
|
+
required,
|
|
5645
|
+
id,
|
|
5646
|
+
...props
|
|
5647
|
+
} = useComponentsPropsMerger(
|
|
5648
|
+
betterHtmlContextInternal.components.toggleInput?.style?.switch,
|
|
5649
|
+
switchProps
|
|
5650
|
+
);
|
|
5416
5651
|
const theme2 = useTheme20();
|
|
5417
5652
|
const internalId = useId3();
|
|
5418
5653
|
const { style, hoverStyle, excludeStyle, restProps } = useComponentPropsGrouper(props, true);
|
|
@@ -5429,7 +5664,19 @@ var ToggleInput_default = {
|
|
|
5429
5664
|
}, [disabled, checked, onChange, controlledChecked, value]);
|
|
5430
5665
|
const readyId = id ?? internalId;
|
|
5431
5666
|
return /* @__PURE__ */ jsxs15(Div_default.column, { width: "fit-content", gap: theme2.styles.gap, ...excludeStyle, children: [
|
|
5432
|
-
label && /* @__PURE__ */ jsx18(
|
|
5667
|
+
label && /* @__PURE__ */ jsx18(
|
|
5668
|
+
Label_default,
|
|
5669
|
+
{
|
|
5670
|
+
text: label,
|
|
5671
|
+
fontFamily: labelFontFamily,
|
|
5672
|
+
letterSpacing: labelLetterSpacing,
|
|
5673
|
+
textTransform: labelTextTransform,
|
|
5674
|
+
color: labelColor,
|
|
5675
|
+
required,
|
|
5676
|
+
isError: !!errorText,
|
|
5677
|
+
htmlFor: readyId
|
|
5678
|
+
}
|
|
5679
|
+
),
|
|
5433
5680
|
/* @__PURE__ */ jsx18(
|
|
5434
5681
|
Div_default.row,
|
|
5435
5682
|
{
|