react-better-html 1.1.243 → 1.1.245
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 +30 -22
- package/dist/index.d.ts +30 -22
- package/dist/index.js +120 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -104
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1308,6 +1308,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
1308
1308
|
var TextStyledComponent = styled.p.withConfig({
|
|
1309
1309
|
shouldForwardProp: (prop) => !["style", "hoverStyle"].includes(prop)
|
|
1310
1310
|
})`
|
|
1311
|
+
font-size: ${(props) => props.theme.styles.fontSize}px;
|
|
1312
|
+
|
|
1311
1313
|
${(props) => props.style}
|
|
1312
1314
|
|
|
1313
1315
|
&:hover {
|
|
@@ -1315,6 +1317,7 @@ var TextStyledComponent = styled.p.withConfig({
|
|
|
1315
1317
|
}
|
|
1316
1318
|
`;
|
|
1317
1319
|
var TextComponent = forwardRef(function Text({ htmlContentTranslate, children, ...props }, ref) {
|
|
1320
|
+
const theme2 = useTheme2();
|
|
1318
1321
|
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
1319
1322
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
1320
1323
|
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
@@ -1322,6 +1325,7 @@ var TextComponent = forwardRef(function Text({ htmlContentTranslate, children, .
|
|
|
1322
1325
|
TextStyledComponent,
|
|
1323
1326
|
{
|
|
1324
1327
|
as: props.as,
|
|
1328
|
+
theme: theme2,
|
|
1325
1329
|
translate: htmlContentTranslate,
|
|
1326
1330
|
style,
|
|
1327
1331
|
hoverStyle,
|
|
@@ -1429,7 +1433,12 @@ var ImageElement = styled2.img.withConfig({
|
|
|
1429
1433
|
${(props) => props.hoverStyle}
|
|
1430
1434
|
}
|
|
1431
1435
|
`;
|
|
1432
|
-
var Image = forwardRef3(function Image2(
|
|
1436
|
+
var Image = forwardRef3(function Image2(ImageProps3, ref) {
|
|
1437
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
1438
|
+
const { name, src, ...props } = useComponentsPropsMerger(
|
|
1439
|
+
betterHtmlContextInternal.components.image?.style?.default,
|
|
1440
|
+
ImageProps3
|
|
1441
|
+
);
|
|
1433
1442
|
const { assets: assets2 } = useBetterCoreContext();
|
|
1434
1443
|
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
1435
1444
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
@@ -1454,7 +1463,9 @@ var Image = forwardRef3(function Image2({ name, src, ...props }, ref) {
|
|
|
1454
1463
|
}
|
|
1455
1464
|
);
|
|
1456
1465
|
});
|
|
1457
|
-
Image.profileImage = forwardRef3(function ProfileImage({ size = 40, letters, letterColor, backgroundColor, ...
|
|
1466
|
+
Image.profileImage = forwardRef3(function ProfileImage({ size = 40, letters, letterColor, backgroundColor, ...ImageProps3 }, ref) {
|
|
1467
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
1468
|
+
const props = useComponentsPropsMerger(betterHtmlContextInternal.components.image?.style?.default, ImageProps3);
|
|
1458
1469
|
const theme2 = useTheme4();
|
|
1459
1470
|
return letters ? /* @__PURE__ */ jsx3(
|
|
1460
1471
|
Div_default.row,
|
|
@@ -1901,6 +1912,75 @@ import {
|
|
|
1901
1912
|
} from "react-better-core";
|
|
1902
1913
|
import styled6, { css } from "styled-components";
|
|
1903
1914
|
|
|
1915
|
+
// src/utils/variableFunctions.ts
|
|
1916
|
+
var checkBetterCoreContextValue = (value, functionsName) => {
|
|
1917
|
+
if (value === void 0) {
|
|
1918
|
+
throw new Error(
|
|
1919
|
+
`\`${functionsName}()\` must be used within a \`<BetterCoreProvider>\`. Make sure to add one at the root of your component tree.`
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1922
|
+
return value !== void 0;
|
|
1923
|
+
};
|
|
1924
|
+
var checkBetterHtmlContextValue = (value, functionsName) => {
|
|
1925
|
+
if (value === void 0) {
|
|
1926
|
+
throw new Error(
|
|
1927
|
+
`\`${functionsName}()\` must be used within a \`<BetterHtmlProvider>\`. Make sure to add one at the root of your component tree.`
|
|
1928
|
+
);
|
|
1929
|
+
}
|
|
1930
|
+
return value !== void 0;
|
|
1931
|
+
};
|
|
1932
|
+
var alertControls = {
|
|
1933
|
+
createAlert: (alert) => {
|
|
1934
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.createAlert"))
|
|
1935
|
+
return void 0;
|
|
1936
|
+
const readyAlert = {
|
|
1937
|
+
id: crypto.randomUUID(),
|
|
1938
|
+
...alert
|
|
1939
|
+
};
|
|
1940
|
+
externalBetterHtmlContextValue.setAlerts((oldValue) => [...oldValue, readyAlert]);
|
|
1941
|
+
return readyAlert;
|
|
1942
|
+
},
|
|
1943
|
+
removeAlert: (alertId) => {
|
|
1944
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.removeAlert")) return;
|
|
1945
|
+
externalBetterHtmlContextValue.setAlerts((oldValue) => oldValue.filter((alert) => alert.id !== alertId));
|
|
1946
|
+
}
|
|
1947
|
+
};
|
|
1948
|
+
var sideMenuControls = {
|
|
1949
|
+
expand: () => {
|
|
1950
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.expand")) return;
|
|
1951
|
+
externalBetterHtmlContextValue.setSideMenuIsCollapsed.setFalse();
|
|
1952
|
+
},
|
|
1953
|
+
collapse: () => {
|
|
1954
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.collapse")) return;
|
|
1955
|
+
externalBetterHtmlContextValue.setSideMenuIsCollapsed.setTrue();
|
|
1956
|
+
},
|
|
1957
|
+
toggleExpanded: () => {
|
|
1958
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleExpanded")) return;
|
|
1959
|
+
externalBetterHtmlContextValue.setSideMenuIsCollapsed.toggle();
|
|
1960
|
+
},
|
|
1961
|
+
open: () => {
|
|
1962
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.open")) return;
|
|
1963
|
+
externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setTrue();
|
|
1964
|
+
},
|
|
1965
|
+
close: () => {
|
|
1966
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.close")) return;
|
|
1967
|
+
externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setFalse();
|
|
1968
|
+
},
|
|
1969
|
+
toggleOpened: () => {
|
|
1970
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleOpened")) return;
|
|
1971
|
+
externalBetterHtmlContextValue.setSideMenuIsOpenMobile.toggle();
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
var filterHover = () => {
|
|
1975
|
+
if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "filterHover")) return void 0;
|
|
1976
|
+
return {
|
|
1977
|
+
z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
|
|
1978
|
+
z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
|
|
1979
|
+
z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
|
|
1980
|
+
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
|
|
1981
|
+
};
|
|
1982
|
+
};
|
|
1983
|
+
|
|
1904
1984
|
// src/components/Loader.tsx
|
|
1905
1985
|
import { memo as memo7 } from "react";
|
|
1906
1986
|
import { useTheme as useTheme8 } from "react-better-core";
|
|
@@ -1976,8 +2056,8 @@ var ButtonElement = styled6.button.withConfig({
|
|
|
1976
2056
|
width: fit-content;
|
|
1977
2057
|
min-width: max-content;
|
|
1978
2058
|
font-family: ${(props) => props.theme.styles.fontFamily};
|
|
1979
|
-
font-size:
|
|
1980
|
-
line-height:
|
|
2059
|
+
font-size: ${(props) => props.theme.styles.fontSize}px;
|
|
2060
|
+
line-height: ${(props) => props.theme.styles.fontSize + 4}px;
|
|
1981
2061
|
text-decoration: none;
|
|
1982
2062
|
color: ${(props) => props.theme.colors.base};
|
|
1983
2063
|
background-color: ${(props) => props.theme.colors.primary};
|
|
@@ -1995,12 +2075,12 @@ var ButtonElement = styled6.button.withConfig({
|
|
|
1995
2075
|
cursor: pointer;
|
|
1996
2076
|
|
|
1997
2077
|
&:not(.secondary):hover {
|
|
1998
|
-
filter: ${props.
|
|
2078
|
+
filter: ${props.hoverStyle.filter ?? filterHover().z1};
|
|
1999
2079
|
}
|
|
2000
2080
|
|
|
2001
2081
|
&.secondary:hover {
|
|
2002
2082
|
${props.withNoBorder ? css`
|
|
2003
|
-
filter: ${props.
|
|
2083
|
+
filter: ${props.hoverStyle.filter ?? filterHover().z1};
|
|
2004
2084
|
` : css`
|
|
2005
2085
|
border-color: ${props.theme.colors.primary};
|
|
2006
2086
|
`}
|
|
@@ -2068,7 +2148,7 @@ var ButtonComponent = function Button(buttonProps) {
|
|
|
2068
2148
|
const iconComponent = icon ? /* @__PURE__ */ jsx8(
|
|
2069
2149
|
Div_default.row,
|
|
2070
2150
|
{
|
|
2071
|
-
height: iconSize ?? parseInt(style.fontSize?.toString() ??
|
|
2151
|
+
height: iconSize ?? parseInt(style.fontSize?.toString() ?? theme2.styles.fontSize.toString()),
|
|
2072
2152
|
alignItems: "center",
|
|
2073
2153
|
justifyContent: "center",
|
|
2074
2154
|
children: /* @__PURE__ */ jsx8(
|
|
@@ -2076,7 +2156,7 @@ var ButtonComponent = function Button(buttonProps) {
|
|
|
2076
2156
|
{
|
|
2077
2157
|
name: icon,
|
|
2078
2158
|
color: iconColor ?? props.color ?? theme2.colors.base,
|
|
2079
|
-
size: iconSize ?? parseInt(style.fontSize?.toString() ??
|
|
2159
|
+
size: iconSize ?? parseInt(style.fontSize?.toString() ?? theme2.styles.fontSize.toString())
|
|
2080
2160
|
}
|
|
2081
2161
|
)
|
|
2082
2162
|
}
|
|
@@ -2086,7 +2166,7 @@ var ButtonComponent = function Button(buttonProps) {
|
|
|
2086
2166
|
{
|
|
2087
2167
|
name: image,
|
|
2088
2168
|
color: iconColor ?? props.color ?? theme2.colors.base,
|
|
2089
|
-
width: imageWidth ?? parseInt(style.fontSize?.toString() ??
|
|
2169
|
+
width: imageWidth ?? parseInt(style.fontSize?.toString() ?? theme2.styles.fontSize.toString()),
|
|
2090
2170
|
height: imageHeight
|
|
2091
2171
|
}
|
|
2092
2172
|
) : void 0;
|
|
@@ -2875,7 +2955,7 @@ function Alert2({ alert }) {
|
|
|
2875
2955
|
),
|
|
2876
2956
|
/* @__PURE__ */ jsxs7(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
2877
2957
|
/* @__PURE__ */ jsx10(Text_default, { fontSize: 18, fontWeight: 700, children: alertTitle }),
|
|
2878
|
-
alert.message && /* @__PURE__ */ jsx10(Text_default, { color: theme2.colors.textSecondary, children: alert.message })
|
|
2958
|
+
alert.message && /* @__PURE__ */ jsx10(Text_default, { fontSize: theme2.styles.fontSize, color: theme2.colors.textSecondary, children: alert.message })
|
|
2879
2959
|
] }),
|
|
2880
2960
|
pluginConfig.withCloseButton && /* @__PURE__ */ jsx10(Button_default.icon, { icon: "XMark", alignSelf: "flex-start", onClick: onClickCloseAlert })
|
|
2881
2961
|
] }),
|
|
@@ -3138,77 +3218,6 @@ var BetterHtmlProvider_default = memo12(BetterHtmlProvider);
|
|
|
3138
3218
|
|
|
3139
3219
|
// src/utils/functions.ts
|
|
3140
3220
|
import CryptoJS from "crypto-js";
|
|
3141
|
-
|
|
3142
|
-
// src/utils/variableFunctions.ts
|
|
3143
|
-
var checkBetterCoreContextValue = (value, functionsName) => {
|
|
3144
|
-
if (value === void 0) {
|
|
3145
|
-
throw new Error(
|
|
3146
|
-
`\`${functionsName}()\` must be used within a \`<BetterCoreProvider>\`. Make sure to add one at the root of your component tree.`
|
|
3147
|
-
);
|
|
3148
|
-
}
|
|
3149
|
-
return value !== void 0;
|
|
3150
|
-
};
|
|
3151
|
-
var checkBetterHtmlContextValue = (value, functionsName) => {
|
|
3152
|
-
if (value === void 0) {
|
|
3153
|
-
throw new Error(
|
|
3154
|
-
`\`${functionsName}()\` must be used within a \`<BetterHtmlProvider>\`. Make sure to add one at the root of your component tree.`
|
|
3155
|
-
);
|
|
3156
|
-
}
|
|
3157
|
-
return value !== void 0;
|
|
3158
|
-
};
|
|
3159
|
-
var alertControls = {
|
|
3160
|
-
createAlert: (alert) => {
|
|
3161
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.createAlert"))
|
|
3162
|
-
return void 0;
|
|
3163
|
-
const readyAlert = {
|
|
3164
|
-
id: crypto.randomUUID(),
|
|
3165
|
-
...alert
|
|
3166
|
-
};
|
|
3167
|
-
externalBetterHtmlContextValue.setAlerts((oldValue) => [...oldValue, readyAlert]);
|
|
3168
|
-
return readyAlert;
|
|
3169
|
-
},
|
|
3170
|
-
removeAlert: (alertId) => {
|
|
3171
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.removeAlert")) return;
|
|
3172
|
-
externalBetterHtmlContextValue.setAlerts((oldValue) => oldValue.filter((alert) => alert.id !== alertId));
|
|
3173
|
-
}
|
|
3174
|
-
};
|
|
3175
|
-
var sideMenuControls = {
|
|
3176
|
-
expand: () => {
|
|
3177
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.expand")) return;
|
|
3178
|
-
externalBetterHtmlContextValue.setSideMenuIsCollapsed.setFalse();
|
|
3179
|
-
},
|
|
3180
|
-
collapse: () => {
|
|
3181
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.collapse")) return;
|
|
3182
|
-
externalBetterHtmlContextValue.setSideMenuIsCollapsed.setTrue();
|
|
3183
|
-
},
|
|
3184
|
-
toggleExpanded: () => {
|
|
3185
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleExpanded")) return;
|
|
3186
|
-
externalBetterHtmlContextValue.setSideMenuIsCollapsed.toggle();
|
|
3187
|
-
},
|
|
3188
|
-
open: () => {
|
|
3189
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.open")) return;
|
|
3190
|
-
externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setTrue();
|
|
3191
|
-
},
|
|
3192
|
-
close: () => {
|
|
3193
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.close")) return;
|
|
3194
|
-
externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setFalse();
|
|
3195
|
-
},
|
|
3196
|
-
toggleOpened: () => {
|
|
3197
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleOpened")) return;
|
|
3198
|
-
externalBetterHtmlContextValue.setSideMenuIsOpenMobile.toggle();
|
|
3199
|
-
}
|
|
3200
|
-
};
|
|
3201
|
-
var filterHover = () => {
|
|
3202
|
-
if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "filterHover")) return void 0;
|
|
3203
|
-
return {
|
|
3204
|
-
z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
|
|
3205
|
-
z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
|
|
3206
|
-
z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
|
|
3207
|
-
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
|
|
3208
|
-
};
|
|
3209
|
-
};
|
|
3210
|
-
|
|
3211
|
-
// src/utils/functions.ts
|
|
3212
3221
|
var getBrowser = () => {
|
|
3213
3222
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
3214
3223
|
if (userAgent.includes("firefox")) return "firefox";
|
|
@@ -4263,8 +4272,8 @@ var InputElement = styled10.input.withConfig({
|
|
|
4263
4272
|
position: relative;
|
|
4264
4273
|
width: 100%;
|
|
4265
4274
|
font-family: ${(props) => props.theme.styles.fontFamily};
|
|
4266
|
-
font-size:
|
|
4267
|
-
line-height:
|
|
4275
|
+
font-size: ${(props) => props.theme.styles.fontSize}px;
|
|
4276
|
+
line-height: ${(props) => props.theme.styles.fontSize + 4}px;
|
|
4268
4277
|
color: ${(props) => props.theme.colors.textPrimary};
|
|
4269
4278
|
background: ${(props) => props.theme.colors.backgroundContent};
|
|
4270
4279
|
border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
|
|
@@ -4285,7 +4294,7 @@ var InputElement = styled10.input.withConfig({
|
|
|
4285
4294
|
|
|
4286
4295
|
&:focus {
|
|
4287
4296
|
${(props) => props.withNoBorder ? css2`
|
|
4288
|
-
filter: ${props.
|
|
4297
|
+
filter: ${props.hoverStyle.filter ?? filterHover().z1};
|
|
4289
4298
|
` : css2`
|
|
4290
4299
|
border-color: ${props.theme.colors.primary};
|
|
4291
4300
|
`}
|
|
@@ -4390,8 +4399,8 @@ var TextareaElement = styled10.textarea.withConfig({
|
|
|
4390
4399
|
min-height: 3lh;
|
|
4391
4400
|
max-height: 8lh;
|
|
4392
4401
|
font-family: ${(props) => props.theme.styles.fontFamily};
|
|
4393
|
-
font-size:
|
|
4394
|
-
line-height:
|
|
4402
|
+
font-size: ${(props) => props.theme.styles.fontSize}px;
|
|
4403
|
+
line-height: ${(props) => props.theme.styles.fontSize + 4}px;
|
|
4395
4404
|
color: ${(props) => props.theme.colors.textPrimary};
|
|
4396
4405
|
background: ${(props) => props.theme.colors.backgroundContent};
|
|
4397
4406
|
border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
|
|
@@ -4408,7 +4417,7 @@ var TextareaElement = styled10.textarea.withConfig({
|
|
|
4408
4417
|
}
|
|
4409
4418
|
|
|
4410
4419
|
${(props) => props.withNoBorder ? css2`
|
|
4411
|
-
filter: ${props.
|
|
4420
|
+
filter: ${props.hoverStyle.filter ?? filterHover().z1};
|
|
4412
4421
|
` : css2`
|
|
4413
4422
|
border-color: ${props.theme.colors.primary};
|
|
4414
4423
|
`}
|
|
@@ -5473,7 +5482,7 @@ var InputElement2 = styled11.input.withConfig({
|
|
|
5473
5482
|
|
|
5474
5483
|
&:hover {
|
|
5475
5484
|
${(props) => props.withNoBorder ? css3`
|
|
5476
|
-
filter: ${props.
|
|
5485
|
+
filter: ${props.hoverStyle.filter ?? filterHover().z1};
|
|
5477
5486
|
` : css3`
|
|
5478
5487
|
border-color: ${props.theme.colors.primary};
|
|
5479
5488
|
`}
|
|
@@ -5550,7 +5559,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5550
5559
|
textAdvanced,
|
|
5551
5560
|
errorText,
|
|
5552
5561
|
infoText,
|
|
5553
|
-
size,
|
|
5562
|
+
size = componentSize,
|
|
5554
5563
|
value,
|
|
5555
5564
|
onChange,
|
|
5556
5565
|
checked: controlledChecked,
|
|
@@ -5624,7 +5633,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5624
5633
|
top: "50%",
|
|
5625
5634
|
left: "50%",
|
|
5626
5635
|
color: theme2.colors.base,
|
|
5627
|
-
size:
|
|
5636
|
+
size: size / 1.8,
|
|
5628
5637
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
5629
5638
|
opacity: checked ? 1 : 0,
|
|
5630
5639
|
pointerEvents: "none",
|
|
@@ -5634,8 +5643,8 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5634
5643
|
Div_default,
|
|
5635
5644
|
{
|
|
5636
5645
|
position: "absolute",
|
|
5637
|
-
width:
|
|
5638
|
-
height:
|
|
5646
|
+
width: size / 2,
|
|
5647
|
+
height: size / 2,
|
|
5639
5648
|
top: "50%",
|
|
5640
5649
|
left: "50%",
|
|
5641
5650
|
backgroundColor: theme2.colors.base,
|
|
@@ -5659,7 +5668,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5659
5668
|
onClick: onClickText,
|
|
5660
5669
|
children: [
|
|
5661
5670
|
text,
|
|
5662
|
-
required && !label && /* @__PURE__ */ jsxs15(Text_default, { as: "span", fontSize:
|
|
5671
|
+
required && !label && /* @__PURE__ */ jsxs15(Text_default, { as: "span", fontSize: theme2.styles.fontSize, color: theme2.colors.error, children: [
|
|
5663
5672
|
" ",
|
|
5664
5673
|
"*"
|
|
5665
5674
|
] })
|
|
@@ -5667,7 +5676,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5667
5676
|
}
|
|
5668
5677
|
) : textAdvanced ? /* @__PURE__ */ jsxs15(Div_default.row, { userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
|
|
5669
5678
|
textAdvanced,
|
|
5670
|
-
required && !label && /* @__PURE__ */ jsxs15(Text_default, { as: "span", fontSize:
|
|
5679
|
+
required && !label && /* @__PURE__ */ jsxs15(Text_default, { as: "span", fontSize: theme2.styles.fontSize, color: theme2.colors.error, marginLeft: 4, children: [
|
|
5671
5680
|
" ",
|
|
5672
5681
|
"*"
|
|
5673
5682
|
] })
|
|
@@ -5928,12 +5937,12 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
|
|
|
5928
5937
|
/* @__PURE__ */ jsxs17(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
5929
5938
|
/* @__PURE__ */ jsxs17(Text_default, { as: titleAs, fontSize: titleFontSize, children: [
|
|
5930
5939
|
title,
|
|
5931
|
-
required && /* @__PURE__ */ jsxs17(Text_default, { as: "span", fontSize:
|
|
5940
|
+
required && /* @__PURE__ */ jsxs17(Text_default, { as: "span", fontSize: theme2.styles.fontSize, color: theme2.colors.error, children: [
|
|
5932
5941
|
" ",
|
|
5933
5942
|
"*"
|
|
5934
5943
|
] })
|
|
5935
5944
|
] }),
|
|
5936
|
-
description && /* @__PURE__ */ jsx20(Text_default, { fontSize: descriptionFontSize, color: theme2.colors.textSecondary, children: description })
|
|
5945
|
+
description && /* @__PURE__ */ jsx20(Text_default, { fontSize: descriptionFontSize ?? theme2.styles.fontSize, color: theme2.colors.textSecondary, children: description })
|
|
5937
5946
|
] }),
|
|
5938
5947
|
isLoading && /* @__PURE__ */ jsx20(Div_default, { width: 26 - titleGap })
|
|
5939
5948
|
] }),
|
|
@@ -8152,10 +8161,14 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
8152
8161
|
}
|
|
8153
8162
|
);
|
|
8154
8163
|
};
|
|
8155
|
-
SideMenuComponent.burgerButton = function BurgerButton() {
|
|
8164
|
+
SideMenuComponent.burgerButton = function BurgerButton({ position = "left", onClick }) {
|
|
8156
8165
|
const theme2 = useTheme29();
|
|
8157
8166
|
const { sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
8158
8167
|
const [isHovered, setIsHovered] = useBooleanState8();
|
|
8168
|
+
const onClickElement = useCallback18(() => {
|
|
8169
|
+
setSideMenuIsOpenMobile.toggle();
|
|
8170
|
+
onClick?.(!sideMenuIsOpenMobile);
|
|
8171
|
+
}, [onClick, sideMenuIsOpenMobile]);
|
|
8159
8172
|
const width = 2;
|
|
8160
8173
|
return /* @__PURE__ */ jsxs24(
|
|
8161
8174
|
Div_default,
|
|
@@ -8167,7 +8180,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
8167
8180
|
onMouseOver: setIsHovered.setTrue,
|
|
8168
8181
|
onMouseLeave: setIsHovered.setFalse,
|
|
8169
8182
|
onMouseOut: setIsHovered.setFalse,
|
|
8170
|
-
onClick:
|
|
8183
|
+
onClick: onClickElement,
|
|
8171
8184
|
children: [
|
|
8172
8185
|
/* @__PURE__ */ jsx27(
|
|
8173
8186
|
Div_default,
|
|
@@ -8176,10 +8189,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
8176
8189
|
width: isHovered || sideMenuIsOpenMobile ? "100%" : "50%",
|
|
8177
8190
|
height: width,
|
|
8178
8191
|
top: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
|
|
8179
|
-
left: 0,
|
|
8192
|
+
left: position === "left" ? 0 : position === "center" ? sideMenuIsOpenMobile ? 0 : "50%" : "auto",
|
|
8193
|
+
right: position === "right" ? 0 : void 0,
|
|
8180
8194
|
backgroundColor: theme2.colors.border,
|
|
8181
8195
|
borderRadius: 999,
|
|
8182
|
-
transform: sideMenuIsOpenMobile ? "rotate(45deg)" : void 0,
|
|
8196
|
+
transform: sideMenuIsOpenMobile ? "rotate(45deg)" : position === "center" ? "translateX(-50%)" : void 0,
|
|
8183
8197
|
transition: theme2.styles.transition
|
|
8184
8198
|
}
|
|
8185
8199
|
),
|
|
@@ -8190,10 +8204,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
8190
8204
|
width: isHovered ? "100%" : "100%",
|
|
8191
8205
|
height: width,
|
|
8192
8206
|
top: "50%",
|
|
8193
|
-
left: 0,
|
|
8207
|
+
left: position === "left" ? 0 : position === "center" ? "50%" : "auto",
|
|
8208
|
+
right: position === "right" ? 0 : void 0,
|
|
8194
8209
|
backgroundColor: theme2.colors.border,
|
|
8195
8210
|
borderRadius: 999,
|
|
8196
|
-
transform:
|
|
8211
|
+
transform: `translateY(-50%)${position === "center" ? " translateX(-50%)" : ""}`,
|
|
8197
8212
|
opacity: sideMenuIsOpenMobile ? 0 : void 0,
|
|
8198
8213
|
transition: theme2.styles.transition
|
|
8199
8214
|
}
|
|
@@ -8205,10 +8220,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
8205
8220
|
width: isHovered || sideMenuIsOpenMobile ? "100%" : "75%",
|
|
8206
8221
|
height: width,
|
|
8207
8222
|
bottom: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
|
|
8208
|
-
left: 0,
|
|
8223
|
+
left: position === "left" ? 0 : position === "center" ? sideMenuIsOpenMobile ? 0 : "50%" : "auto",
|
|
8224
|
+
right: position === "right" ? 0 : void 0,
|
|
8209
8225
|
backgroundColor: theme2.colors.border,
|
|
8210
8226
|
borderRadius: 999,
|
|
8211
|
-
transform: sideMenuIsOpenMobile ? "rotate(-45deg)" : void 0,
|
|
8227
|
+
transform: sideMenuIsOpenMobile ? "rotate(-45deg)" : position === "center" ? "translateX(-50%)" : void 0,
|
|
8212
8228
|
transition: theme2.styles.transition
|
|
8213
8229
|
}
|
|
8214
8230
|
)
|