react-better-html 1.1.217 → 1.1.218
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/README.md +1 -1
- package/dist/index.d.mts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +1019 -911
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1022 -914
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
} from "react-better-core";
|
|
22
22
|
|
|
23
23
|
// src/components/BetterHtmlProvider.tsx
|
|
24
|
-
import { createContext, memo as
|
|
24
|
+
import { createContext, memo as memo12, useCallback as useCallback6, useContext, useEffect as useEffect5, useMemo as useMemo3, useState as useState4 } from "react";
|
|
25
25
|
import {
|
|
26
26
|
useBooleanState as useBooleanState2,
|
|
27
27
|
colorThemeControls,
|
|
28
|
-
useTheme as
|
|
28
|
+
useTheme as useTheme13,
|
|
29
29
|
BetterCoreProvider,
|
|
30
|
-
useBetterCoreContext as
|
|
30
|
+
useBetterCoreContext as useBetterCoreContext5
|
|
31
31
|
} from "react-better-core";
|
|
32
32
|
import { createGlobalStyle } from "styled-components";
|
|
33
33
|
|
|
@@ -38,6 +38,9 @@ var appConfig = {
|
|
|
38
38
|
var defaultAlertDuration = 2.3 * 1e3;
|
|
39
39
|
var defaultSideMenuWidth = 300;
|
|
40
40
|
|
|
41
|
+
// src/constants/theme.ts
|
|
42
|
+
var theme = {};
|
|
43
|
+
|
|
41
44
|
// src/constants/icons.ts
|
|
42
45
|
var icons = {
|
|
43
46
|
uploadCloud: {
|
|
@@ -116,13 +119,13 @@ var icons = {
|
|
|
116
119
|
var assets = {};
|
|
117
120
|
|
|
118
121
|
// src/components/alerts/AlertsHolder.tsx
|
|
119
|
-
import { memo as
|
|
120
|
-
import { useTheme as
|
|
122
|
+
import { memo as memo11 } from "react";
|
|
123
|
+
import { useTheme as useTheme12 } from "react-better-core";
|
|
121
124
|
|
|
122
125
|
// src/components/Div.tsx
|
|
123
|
-
import { forwardRef as
|
|
124
|
-
import { useTheme as
|
|
125
|
-
import
|
|
126
|
+
import { forwardRef as forwardRef6, memo as memo6, useCallback as useCallback2 } from "react";
|
|
127
|
+
import { useTheme as useTheme7 } from "react-better-core";
|
|
128
|
+
import styled4 from "styled-components";
|
|
126
129
|
|
|
127
130
|
// src/constants.ts
|
|
128
131
|
var isMobileDevice = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
@@ -804,7 +807,7 @@ var cssPropsToExclude = /* @__PURE__ */ new Set([
|
|
|
804
807
|
|
|
805
808
|
// src/utils/hooks.ts
|
|
806
809
|
function useComponentPropsGrouper(props, excludeStyleProps) {
|
|
807
|
-
const
|
|
810
|
+
const theme2 = useTheme();
|
|
808
811
|
return useMemo(() => {
|
|
809
812
|
const style = {};
|
|
810
813
|
const hoverStyle = {};
|
|
@@ -831,8 +834,8 @@ function useComponentPropsGrouper(props, excludeStyleProps) {
|
|
|
831
834
|
}
|
|
832
835
|
}
|
|
833
836
|
if (haveHover && !style.transition) {
|
|
834
|
-
style.transition =
|
|
835
|
-
style.WebkitTransition =
|
|
837
|
+
style.transition = theme2.styles.transition;
|
|
838
|
+
style.WebkitTransition = theme2.styles.transition;
|
|
836
839
|
}
|
|
837
840
|
return {
|
|
838
841
|
style,
|
|
@@ -854,7 +857,7 @@ function useComponentPropsWithPrefix(props, prefix) {
|
|
|
854
857
|
}, [props, prefix]);
|
|
855
858
|
}
|
|
856
859
|
function useComponentInputFieldDateProps(props, holderRef, disabled) {
|
|
857
|
-
const
|
|
860
|
+
const theme2 = useTheme();
|
|
858
861
|
const [isOpen, setIsOpen] = useBooleanState();
|
|
859
862
|
const [isOpenLate, setIsOpenLate] = useBooleanState();
|
|
860
863
|
const [isFocused, setIsFocused] = useBooleanState();
|
|
@@ -885,13 +888,13 @@ function useComponentInputFieldDateProps(props, holderRef, disabled) {
|
|
|
885
888
|
);
|
|
886
889
|
const insideInputFieldComponentProps = useMemo(
|
|
887
890
|
() => ({
|
|
888
|
-
border: `1px solid ${isFocused ?
|
|
891
|
+
border: `1px solid ${isFocused ? theme2.colors.primary : theme2.colors.border}`,
|
|
889
892
|
borderTop: "none",
|
|
890
893
|
opacity: !isOpen ? 0 : void 0,
|
|
891
894
|
pointerEvents: !isOpen ? "none" : void 0,
|
|
892
895
|
transform: `translateY(${!isOpen ? -10 : 0}px)`,
|
|
893
896
|
zIndex: 1e3,
|
|
894
|
-
transition:
|
|
897
|
+
transition: theme2.styles.transition
|
|
895
898
|
}),
|
|
896
899
|
[isOpen, isFocused]
|
|
897
900
|
);
|
|
@@ -1311,8 +1314,8 @@ var TextComponent = forwardRef(function Text({ htmlContentTranslate, children, .
|
|
|
1311
1314
|
);
|
|
1312
1315
|
});
|
|
1313
1316
|
TextComponent.unknown = forwardRef(function Unknown(props, ref) {
|
|
1314
|
-
const
|
|
1315
|
-
return /* @__PURE__ */ jsx(TextComponent, { fontStyle: "italic", textAlign: "center", color:
|
|
1317
|
+
const theme2 = useTheme2();
|
|
1318
|
+
return /* @__PURE__ */ jsx(TextComponent, { fontStyle: "italic", textAlign: "center", color: theme2.colors.textSecondary, ref, ...props });
|
|
1316
1319
|
});
|
|
1317
1320
|
TextComponent.oneLine = forwardRef(function OneLine(props, ref) {
|
|
1318
1321
|
return /* @__PURE__ */ jsx(TextComponent, { textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden", ref, ...props });
|
|
@@ -1327,14 +1330,14 @@ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
|
1327
1330
|
var Divider_default = {
|
|
1328
1331
|
vertical: memo2(
|
|
1329
1332
|
forwardRef2(function Divider({ width = 1, backgroundColor, height, ...props }, ref) {
|
|
1330
|
-
const
|
|
1333
|
+
const theme2 = useTheme3();
|
|
1331
1334
|
return /* @__PURE__ */ jsx2(
|
|
1332
1335
|
Div_default,
|
|
1333
1336
|
{
|
|
1334
1337
|
width,
|
|
1335
1338
|
height: height ?? "100%",
|
|
1336
1339
|
flexShrink: 0,
|
|
1337
|
-
backgroundColor: backgroundColor ??
|
|
1340
|
+
backgroundColor: backgroundColor ?? theme2.colors.border,
|
|
1338
1341
|
...props,
|
|
1339
1342
|
ref
|
|
1340
1343
|
}
|
|
@@ -1343,19 +1346,19 @@ var Divider_default = {
|
|
|
1343
1346
|
),
|
|
1344
1347
|
horizontal: memo2(
|
|
1345
1348
|
forwardRef2(function Divider2({ width = 1, backgroundColor, text, textFontSize, textColor, ...props }, ref) {
|
|
1346
|
-
const
|
|
1347
|
-
return /* @__PURE__ */ jsxs(Div_default.row, { width: "100%", alignItems: "center", gap: text ?
|
|
1348
|
-
/* @__PURE__ */ jsx2(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ??
|
|
1349
|
-
text && /* @__PURE__ */ jsx2(Text_default, { fontSize: textFontSize, color: textColor ??
|
|
1350
|
-
/* @__PURE__ */ jsx2(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ??
|
|
1349
|
+
const theme2 = useTheme3();
|
|
1350
|
+
return /* @__PURE__ */ jsxs(Div_default.row, { width: "100%", alignItems: "center", gap: text ? theme2.styles.space : void 0, ...props, ref, children: [
|
|
1351
|
+
/* @__PURE__ */ jsx2(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border }),
|
|
1352
|
+
text && /* @__PURE__ */ jsx2(Text_default, { fontSize: textFontSize, color: textColor ?? theme2.colors.textSecondary, children: text }),
|
|
1353
|
+
/* @__PURE__ */ jsx2(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border })
|
|
1351
1354
|
] });
|
|
1352
1355
|
})
|
|
1353
1356
|
)
|
|
1354
1357
|
};
|
|
1355
1358
|
|
|
1356
1359
|
// src/components/PageHeader.tsx
|
|
1357
|
-
import { forwardRef as
|
|
1358
|
-
import { useTheme as
|
|
1360
|
+
import { forwardRef as forwardRef5, memo as memo5 } from "react";
|
|
1361
|
+
import { useTheme as useTheme6 } from "react-better-core";
|
|
1359
1362
|
|
|
1360
1363
|
// src/components/Image.tsx
|
|
1361
1364
|
import { forwardRef as forwardRef3, memo as memo3, useEffect as useEffect2 } from "react";
|
|
@@ -1401,19 +1404,19 @@ var Image = forwardRef3(function Image2({ name, src, ...props }, ref) {
|
|
|
1401
1404
|
);
|
|
1402
1405
|
});
|
|
1403
1406
|
Image.profileImage = forwardRef3(function ProfileImage({ size = 40, letters, backgroundColor, ...props }, ref) {
|
|
1404
|
-
const
|
|
1407
|
+
const theme2 = useTheme4();
|
|
1405
1408
|
return letters ? /* @__PURE__ */ jsx3(
|
|
1406
1409
|
Div_default.row,
|
|
1407
1410
|
{
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
backgroundColor: backgroundColor ?? theme.colors.backgroundSecondary,
|
|
1411
|
-
border: `solid 1px ${theme.colors.border}`,
|
|
1411
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundSecondary,
|
|
1412
|
+
border: `solid 1px ${theme2.colors.border}`,
|
|
1412
1413
|
borderRadius: 999,
|
|
1413
1414
|
alignItems: "center",
|
|
1414
1415
|
justifyContent: "center",
|
|
1415
1416
|
ref,
|
|
1416
1417
|
...props,
|
|
1418
|
+
width: size,
|
|
1419
|
+
height: size,
|
|
1417
1420
|
children: /* @__PURE__ */ jsx3(Text_default, { fontSize: size / 2.5, fontWeight: 700, children: letters.toUpperCase().slice(0, 2) })
|
|
1418
1421
|
}
|
|
1419
1422
|
) : /* @__PURE__ */ jsx3(
|
|
@@ -1421,7 +1424,7 @@ Image.profileImage = forwardRef3(function ProfileImage({ size = 40, letters, bac
|
|
|
1421
1424
|
{
|
|
1422
1425
|
width: size,
|
|
1423
1426
|
height: size,
|
|
1424
|
-
border: `solid 1px ${
|
|
1427
|
+
border: `solid 1px ${theme2.colors.border}`,
|
|
1425
1428
|
borderRadius: 999,
|
|
1426
1429
|
objectFit: "cover",
|
|
1427
1430
|
ref,
|
|
@@ -1433,11 +1436,89 @@ var MemoizedImage = memo3(Image);
|
|
|
1433
1436
|
MemoizedImage.profileImage = Image.profileImage;
|
|
1434
1437
|
var Image_default = { Image: MemoizedImage }.Image;
|
|
1435
1438
|
|
|
1439
|
+
// src/components/Icon.tsx
|
|
1440
|
+
import { forwardRef as forwardRef4, memo as memo4, useEffect as useEffect3 } from "react";
|
|
1441
|
+
import { useBetterCoreContext as useBetterCoreContext2, useTheme as useTheme5 } from "react-better-core";
|
|
1442
|
+
import styled3 from "styled-components";
|
|
1443
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1444
|
+
import { createElement } from "react";
|
|
1445
|
+
var IconElement = styled3.svg.withConfig({
|
|
1446
|
+
shouldForwardProp: (prop) => !["theme", "style", "hoverStyle", "hoverColor"].includes(prop)
|
|
1447
|
+
})`
|
|
1448
|
+
${(props) => props.style}
|
|
1449
|
+
|
|
1450
|
+
path {
|
|
1451
|
+
${(props) => props.hoverColor ? `transition: ${props.theme.styles.transition};` : ""}
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
&:hover {
|
|
1455
|
+
path.react-better-html-icon-path-with-fill {
|
|
1456
|
+
fill: ${(props) => props.hoverColor};
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
path.react-better-html-icon-path-with-stroke {
|
|
1460
|
+
stroke: ${(props) => props.hoverColor};
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
&:hover {
|
|
1465
|
+
${(props) => props.hoverStyle}
|
|
1466
|
+
}
|
|
1467
|
+
`;
|
|
1468
|
+
var Icon = forwardRef4(function Icon2({ name, size = 16, ...props }, ref) {
|
|
1469
|
+
const theme2 = useTheme5();
|
|
1470
|
+
const { icons: icons2 } = useBetterCoreContext2();
|
|
1471
|
+
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
1472
|
+
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
1473
|
+
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
1474
|
+
const svgColor = props.color ?? theme2.colors.textPrimary;
|
|
1475
|
+
const svgHoverColorColor = props.colorHover;
|
|
1476
|
+
useEffect3(() => {
|
|
1477
|
+
if (!icons2[name.toString()])
|
|
1478
|
+
console.warn(
|
|
1479
|
+
`The icon \`${name}\` you are trying to use does not exist. Make sure to add it to the \`icons\` object in \`<BetterHtmlProvider>\` config value prop.`
|
|
1480
|
+
);
|
|
1481
|
+
}, [icons2, name]);
|
|
1482
|
+
return /* @__PURE__ */ jsx4(
|
|
1483
|
+
IconElement,
|
|
1484
|
+
{
|
|
1485
|
+
width: size,
|
|
1486
|
+
height: size,
|
|
1487
|
+
viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
|
|
1488
|
+
fill: "none",
|
|
1489
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1490
|
+
theme: theme2,
|
|
1491
|
+
hoverColor: svgHoverColorColor,
|
|
1492
|
+
style,
|
|
1493
|
+
hoverStyle,
|
|
1494
|
+
...restProps,
|
|
1495
|
+
...dataProps,
|
|
1496
|
+
...ariaProps,
|
|
1497
|
+
ref,
|
|
1498
|
+
children: icons2[name.toString()]?.paths.map((path) => /* @__PURE__ */ createElement(
|
|
1499
|
+
"path",
|
|
1500
|
+
{
|
|
1501
|
+
...path,
|
|
1502
|
+
className: path.type === "fill" ? "react-better-html-icon-path-with-fill" : "react-better-html-icon-path-with-stroke",
|
|
1503
|
+
fill: path.type === "fill" ? svgColor : void 0,
|
|
1504
|
+
stroke: path.type === "stroke" ? svgColor : void 0,
|
|
1505
|
+
key: path.d
|
|
1506
|
+
}
|
|
1507
|
+
))
|
|
1508
|
+
}
|
|
1509
|
+
);
|
|
1510
|
+
});
|
|
1511
|
+
var MemoizedIcon = memo4(Icon);
|
|
1512
|
+
var Icon_default = { Icon: MemoizedIcon }.Icon;
|
|
1513
|
+
|
|
1436
1514
|
// src/components/PageHeader.tsx
|
|
1437
|
-
import { jsx as
|
|
1438
|
-
var PageHeaderComponent =
|
|
1515
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1516
|
+
var PageHeaderComponent = forwardRef5(function PageHeader({
|
|
1517
|
+
icon,
|
|
1518
|
+
image,
|
|
1439
1519
|
imageUrl,
|
|
1440
1520
|
imageSize = 60,
|
|
1521
|
+
imageAzProfileImage,
|
|
1441
1522
|
title,
|
|
1442
1523
|
titleAs = "h1",
|
|
1443
1524
|
titleColor,
|
|
@@ -1449,38 +1530,51 @@ var PageHeaderComponent = forwardRef4(function PageHeader({
|
|
|
1449
1530
|
lightMode,
|
|
1450
1531
|
marginBottom
|
|
1451
1532
|
}, ref) {
|
|
1452
|
-
const
|
|
1533
|
+
const theme2 = useTheme6();
|
|
1453
1534
|
const { app } = useBetterHtmlContextInternal();
|
|
1454
1535
|
const mediaQuery = useMediaQuery();
|
|
1536
|
+
const ImageTag = imageAzProfileImage ? Image_default.profileImage : Image_default;
|
|
1537
|
+
const readyImageSize = imageSize ?? (mediaQuery.size600 ? 46 : 60);
|
|
1455
1538
|
return /* @__PURE__ */ jsxs2(
|
|
1456
1539
|
Div_default.row,
|
|
1457
1540
|
{
|
|
1458
1541
|
alignItems: "center",
|
|
1459
|
-
gap:
|
|
1460
|
-
marginBottom: marginBottom ??
|
|
1542
|
+
gap: theme2.styles.space,
|
|
1543
|
+
marginBottom: marginBottom ?? theme2.styles.space * 2,
|
|
1461
1544
|
ref,
|
|
1462
1545
|
children: [
|
|
1463
|
-
|
|
1546
|
+
icon && /* @__PURE__ */ jsx5(Icon_default, { name: icon, size: 20, flexShrink: 0 }),
|
|
1547
|
+
(image || imageUrl) && /* @__PURE__ */ jsx5(
|
|
1548
|
+
ImageTag,
|
|
1549
|
+
{
|
|
1550
|
+
name: image,
|
|
1551
|
+
src: imageUrl,
|
|
1552
|
+
width: readyImageSize,
|
|
1553
|
+
height: readyImageSize,
|
|
1554
|
+
size: readyImageSize,
|
|
1555
|
+
flexShrink: 0
|
|
1556
|
+
}
|
|
1557
|
+
),
|
|
1464
1558
|
/* @__PURE__ */ jsxs2(
|
|
1465
1559
|
Div_default.column,
|
|
1466
1560
|
{
|
|
1467
1561
|
alignItems: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
|
|
1468
1562
|
flex: 1,
|
|
1469
|
-
gap:
|
|
1563
|
+
gap: theme2.styles.gap / 2,
|
|
1470
1564
|
children: [
|
|
1471
1565
|
/* @__PURE__ */ jsxs2(
|
|
1472
1566
|
Div_default.row,
|
|
1473
1567
|
{
|
|
1474
1568
|
alignItems: "center",
|
|
1475
1569
|
justifyContent: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
|
|
1476
|
-
gap:
|
|
1570
|
+
gap: theme2.styles.space,
|
|
1477
1571
|
children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ jsx5(
|
|
1479
1573
|
Text_default,
|
|
1480
1574
|
{
|
|
1481
1575
|
as: titleAs,
|
|
1482
1576
|
textAlign,
|
|
1483
|
-
color: titleColor ?? (lightMode ?
|
|
1577
|
+
color: titleColor ?? (lightMode ? theme2.colors.base : theme2.colors.textPrimary),
|
|
1484
1578
|
children: title
|
|
1485
1579
|
}
|
|
1486
1580
|
),
|
|
@@ -1488,12 +1582,12 @@ var PageHeaderComponent = forwardRef4(function PageHeader({
|
|
|
1488
1582
|
]
|
|
1489
1583
|
}
|
|
1490
1584
|
),
|
|
1491
|
-
description && /* @__PURE__ */
|
|
1585
|
+
description && /* @__PURE__ */ jsx5(
|
|
1492
1586
|
Text_default,
|
|
1493
1587
|
{
|
|
1494
1588
|
maxWidth: !mediaQuery.size600 ? app.contentMaxWidth * 0.6 : void 0,
|
|
1495
1589
|
textAlign,
|
|
1496
|
-
color: descriptionColor ?? (lightMode ?
|
|
1590
|
+
color: descriptionColor ?? (lightMode ? theme2.colors.base : theme2.colors.textSecondary),
|
|
1497
1591
|
opacity: lightMode ? 0.7 : void 0,
|
|
1498
1592
|
children: description
|
|
1499
1593
|
}
|
|
@@ -1506,12 +1600,12 @@ var PageHeaderComponent = forwardRef4(function PageHeader({
|
|
|
1506
1600
|
}
|
|
1507
1601
|
);
|
|
1508
1602
|
});
|
|
1509
|
-
var PageHeader2 =
|
|
1603
|
+
var PageHeader2 = memo5(PageHeaderComponent);
|
|
1510
1604
|
var PageHeader_default = PageHeader2;
|
|
1511
1605
|
|
|
1512
1606
|
// src/components/Div.tsx
|
|
1513
|
-
import { jsx as
|
|
1514
|
-
var DivStyledComponent =
|
|
1607
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1608
|
+
var DivStyledComponent = styled4.div.withConfig({
|
|
1515
1609
|
shouldForwardProp: (prop) => !["style", "hoverStyle"].includes(prop)
|
|
1516
1610
|
})`
|
|
1517
1611
|
${(props) => props.style}
|
|
@@ -1520,7 +1614,7 @@ var DivStyledComponent = styled3.div.withConfig({
|
|
|
1520
1614
|
${(props) => props.hoverStyle}
|
|
1521
1615
|
}
|
|
1522
1616
|
`;
|
|
1523
|
-
var DivComponent =
|
|
1617
|
+
var DivComponent = forwardRef6(function Div({
|
|
1524
1618
|
as = "div",
|
|
1525
1619
|
value,
|
|
1526
1620
|
isTabAccessed,
|
|
@@ -1553,7 +1647,7 @@ var DivComponent = forwardRef5(function Div({
|
|
|
1553
1647
|
},
|
|
1554
1648
|
[onKeyDown, isTabAccessed]
|
|
1555
1649
|
);
|
|
1556
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ jsx6(
|
|
1557
1651
|
DivStyledComponent,
|
|
1558
1652
|
{
|
|
1559
1653
|
as,
|
|
@@ -1572,9 +1666,9 @@ var DivComponent = forwardRef5(function Div({
|
|
|
1572
1666
|
}
|
|
1573
1667
|
);
|
|
1574
1668
|
});
|
|
1575
|
-
DivComponent.row =
|
|
1669
|
+
DivComponent.row = forwardRef6(function Row({ flexReverse, invertFlexDirection, ...props }, ref) {
|
|
1576
1670
|
const reverseSuffix = flexReverse ? "-reverse" : "";
|
|
1577
|
-
return /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ jsx6(
|
|
1578
1672
|
DivComponent,
|
|
1579
1673
|
{
|
|
1580
1674
|
display: "flex",
|
|
@@ -1584,9 +1678,9 @@ DivComponent.row = forwardRef5(function Row({ flexReverse, invertFlexDirection,
|
|
|
1584
1678
|
}
|
|
1585
1679
|
);
|
|
1586
1680
|
});
|
|
1587
|
-
DivComponent.column =
|
|
1681
|
+
DivComponent.column = forwardRef6(function Column({ flexReverse, invertFlexDirection, ...props }, ref) {
|
|
1588
1682
|
const reverseSuffix = flexReverse ? "-reverse" : "";
|
|
1589
|
-
return /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ jsx6(
|
|
1590
1684
|
DivComponent,
|
|
1591
1685
|
{
|
|
1592
1686
|
display: "flex",
|
|
@@ -1596,10 +1690,10 @@ DivComponent.column = forwardRef5(function Column({ flexReverse, invertFlexDirec
|
|
|
1596
1690
|
}
|
|
1597
1691
|
);
|
|
1598
1692
|
});
|
|
1599
|
-
DivComponent.grid =
|
|
1600
|
-
return /* @__PURE__ */
|
|
1693
|
+
DivComponent.grid = forwardRef6(function Grid(props, ref) {
|
|
1694
|
+
return /* @__PURE__ */ jsx6(DivComponent, { display: "grid", ref, ...props });
|
|
1601
1695
|
});
|
|
1602
|
-
DivComponent.box =
|
|
1696
|
+
DivComponent.box = forwardRef6(function Box({
|
|
1603
1697
|
imageUrl,
|
|
1604
1698
|
imageSize,
|
|
1605
1699
|
title,
|
|
@@ -1616,20 +1710,20 @@ DivComponent.box = forwardRef5(function Box({
|
|
|
1616
1710
|
children,
|
|
1617
1711
|
...props
|
|
1618
1712
|
}, ref) {
|
|
1619
|
-
const
|
|
1713
|
+
const theme2 = useTheme7();
|
|
1620
1714
|
const withClick = props.onClick || props.onClickWithValue;
|
|
1621
1715
|
return /* @__PURE__ */ jsxs3(
|
|
1622
1716
|
DivComponent,
|
|
1623
1717
|
{
|
|
1624
|
-
color: isActive ?
|
|
1625
|
-
backgroundColor: isActive ?
|
|
1626
|
-
border: `1px solid ${isActive ?
|
|
1627
|
-
borderRadius:
|
|
1628
|
-
borderColorHover: withClick && !isActive ?
|
|
1718
|
+
color: isActive ? theme2.colors.base : void 0,
|
|
1719
|
+
backgroundColor: isActive ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
1720
|
+
border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
|
|
1721
|
+
borderRadius: theme2.styles.borderRadius,
|
|
1722
|
+
borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
|
|
1629
1723
|
filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
|
|
1630
1724
|
cursor: withClick ? "pointer" : void 0,
|
|
1631
|
-
paddingBlock: title ?
|
|
1632
|
-
paddingInline:
|
|
1725
|
+
paddingBlock: title ? theme2.styles.space : theme2.styles.gap,
|
|
1726
|
+
paddingInline: theme2.styles.space,
|
|
1633
1727
|
ref,
|
|
1634
1728
|
...props,
|
|
1635
1729
|
children: [
|
|
@@ -1637,15 +1731,15 @@ DivComponent.box = forwardRef5(function Box({
|
|
|
1637
1731
|
Div2,
|
|
1638
1732
|
{
|
|
1639
1733
|
backgroundColor: headerBackgroundColor,
|
|
1640
|
-
borderTopLeftRadius: props.borderTopLeftRadius ?? props.borderRadius ??
|
|
1641
|
-
borderTopRightRadius: props.borderTopRightRadius ?? props.borderRadius ??
|
|
1642
|
-
marginInline: -
|
|
1643
|
-
marginTop: -
|
|
1644
|
-
marginBottom:
|
|
1645
|
-
paddingInline:
|
|
1646
|
-
paddingTop:
|
|
1734
|
+
borderTopLeftRadius: props.borderTopLeftRadius ?? props.borderRadius ?? theme2.styles.borderRadius - 1,
|
|
1735
|
+
borderTopRightRadius: props.borderTopRightRadius ?? props.borderRadius ?? theme2.styles.borderRadius - 1,
|
|
1736
|
+
marginInline: -theme2.styles.space,
|
|
1737
|
+
marginTop: -theme2.styles.space,
|
|
1738
|
+
marginBottom: theme2.styles.space,
|
|
1739
|
+
paddingInline: theme2.styles.space,
|
|
1740
|
+
paddingTop: theme2.styles.space,
|
|
1647
1741
|
children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1742
|
+
/* @__PURE__ */ jsx6(
|
|
1649
1743
|
PageHeader_default,
|
|
1650
1744
|
{
|
|
1651
1745
|
imageUrl,
|
|
@@ -1659,10 +1753,10 @@ DivComponent.box = forwardRef5(function Box({
|
|
|
1659
1753
|
textAlign,
|
|
1660
1754
|
rightElement,
|
|
1661
1755
|
lightMode,
|
|
1662
|
-
marginBottom:
|
|
1756
|
+
marginBottom: theme2.styles.space
|
|
1663
1757
|
}
|
|
1664
1758
|
),
|
|
1665
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ jsx6(Div2, { width: `calc(100% + ${theme2.styles.space * 2}px)`, marginLeft: -theme2.styles.space, children: /* @__PURE__ */ jsx6(Divider_default.horizontal, {}) })
|
|
1666
1760
|
]
|
|
1667
1761
|
}
|
|
1668
1762
|
),
|
|
@@ -1671,7 +1765,7 @@ DivComponent.box = forwardRef5(function Box({
|
|
|
1671
1765
|
}
|
|
1672
1766
|
);
|
|
1673
1767
|
});
|
|
1674
|
-
var Div2 =
|
|
1768
|
+
var Div2 = memo6(DivComponent);
|
|
1675
1769
|
Div2.row = DivComponent.row;
|
|
1676
1770
|
Div2.column = DivComponent.column;
|
|
1677
1771
|
Div2.grid = DivComponent.grid;
|
|
@@ -1679,9 +1773,9 @@ Div2.box = DivComponent.box;
|
|
|
1679
1773
|
var Div_default = Div2;
|
|
1680
1774
|
|
|
1681
1775
|
// src/components/alerts/Alert.tsx
|
|
1682
|
-
import { memo as
|
|
1683
|
-
import { useTheme as
|
|
1684
|
-
import
|
|
1776
|
+
import { memo as memo10, useCallback as useCallback5, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState3 } from "react";
|
|
1777
|
+
import { useTheme as useTheme11 } from "react-better-core";
|
|
1778
|
+
import styled8 from "styled-components";
|
|
1685
1779
|
|
|
1686
1780
|
// src/plugins/alerts.ts
|
|
1687
1781
|
var defaultAlertsPluginOptions = {
|
|
@@ -1738,81 +1832,6 @@ var localStoragePlugin = (options) => ({
|
|
|
1738
1832
|
})
|
|
1739
1833
|
});
|
|
1740
1834
|
|
|
1741
|
-
// src/components/Icon.tsx
|
|
1742
|
-
import { forwardRef as forwardRef6, memo as memo6, useEffect as useEffect3 } from "react";
|
|
1743
|
-
import { useBetterCoreContext as useBetterCoreContext2, useTheme as useTheme7 } from "react-better-core";
|
|
1744
|
-
import styled4 from "styled-components";
|
|
1745
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1746
|
-
import { createElement } from "react";
|
|
1747
|
-
var IconElement = styled4.svg.withConfig({
|
|
1748
|
-
shouldForwardProp: (prop) => !["theme", "style", "hoverStyle", "hoverColor"].includes(prop)
|
|
1749
|
-
})`
|
|
1750
|
-
${(props) => props.style}
|
|
1751
|
-
|
|
1752
|
-
path {
|
|
1753
|
-
${(props) => props.hoverColor ? `transition: ${props.theme.styles.transition};` : ""}
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
&:hover {
|
|
1757
|
-
path.react-better-html-icon-path-with-fill {
|
|
1758
|
-
fill: ${(props) => props.hoverColor};
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
path.react-better-html-icon-path-with-stroke {
|
|
1762
|
-
stroke: ${(props) => props.hoverColor};
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
&:hover {
|
|
1767
|
-
${(props) => props.hoverStyle}
|
|
1768
|
-
}
|
|
1769
|
-
`;
|
|
1770
|
-
var Icon = forwardRef6(function Icon2({ name, size = 16, ...props }, ref) {
|
|
1771
|
-
const theme = useTheme7();
|
|
1772
|
-
const { icons: icons2 } = useBetterCoreContext2();
|
|
1773
|
-
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
1774
|
-
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
1775
|
-
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
1776
|
-
const svgColor = props.color ?? theme.colors.textPrimary;
|
|
1777
|
-
const svgHoverColorColor = props.colorHover;
|
|
1778
|
-
useEffect3(() => {
|
|
1779
|
-
if (!icons2[name.toString()])
|
|
1780
|
-
console.warn(
|
|
1781
|
-
`The icon \`${name}\` you are trying to use does not exist. Make sure to add it to the \`icons\` object in \`<BetterHtmlProvider>\` config value prop.`
|
|
1782
|
-
);
|
|
1783
|
-
}, [icons2, name]);
|
|
1784
|
-
return /* @__PURE__ */ jsx6(
|
|
1785
|
-
IconElement,
|
|
1786
|
-
{
|
|
1787
|
-
width: size,
|
|
1788
|
-
height: size,
|
|
1789
|
-
viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
|
|
1790
|
-
fill: "none",
|
|
1791
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1792
|
-
theme,
|
|
1793
|
-
hoverColor: svgHoverColorColor,
|
|
1794
|
-
style,
|
|
1795
|
-
hoverStyle,
|
|
1796
|
-
...restProps,
|
|
1797
|
-
...dataProps,
|
|
1798
|
-
...ariaProps,
|
|
1799
|
-
ref,
|
|
1800
|
-
children: icons2[name.toString()]?.paths.map((path) => /* @__PURE__ */ createElement(
|
|
1801
|
-
"path",
|
|
1802
|
-
{
|
|
1803
|
-
...path,
|
|
1804
|
-
className: path.type === "fill" ? "react-better-html-icon-path-with-fill" : "react-better-html-icon-path-with-stroke",
|
|
1805
|
-
fill: path.type === "fill" ? svgColor : void 0,
|
|
1806
|
-
stroke: path.type === "stroke" ? svgColor : void 0,
|
|
1807
|
-
key: path.d
|
|
1808
|
-
}
|
|
1809
|
-
))
|
|
1810
|
-
}
|
|
1811
|
-
);
|
|
1812
|
-
});
|
|
1813
|
-
var MemoizedIcon = memo6(Icon);
|
|
1814
|
-
var Icon_default = { Icon: MemoizedIcon }.Icon;
|
|
1815
|
-
|
|
1816
1835
|
// src/components/Button.tsx
|
|
1817
1836
|
import { memo as memo8, useCallback as useCallback3 } from "react";
|
|
1818
1837
|
import {
|
|
@@ -1847,8 +1866,8 @@ var LoaderComponent = function Loader({
|
|
|
1847
1866
|
disabled,
|
|
1848
1867
|
...props
|
|
1849
1868
|
}) {
|
|
1850
|
-
const
|
|
1851
|
-
const readyColor = color ??
|
|
1869
|
+
const theme2 = useTheme8();
|
|
1870
|
+
const readyColor = color ?? theme2.colors.textPrimary;
|
|
1852
1871
|
const readyWidth = width ?? size / 3;
|
|
1853
1872
|
const mask = `radial-gradient(farthest-side, #0000 calc(100% - ${readyWidth}px), #000 0)`;
|
|
1854
1873
|
return /* @__PURE__ */ jsx7(StyledDiv, { children: /* @__PURE__ */ jsx7(
|
|
@@ -1867,17 +1886,17 @@ var LoaderComponent = function Loader({
|
|
|
1867
1886
|
) });
|
|
1868
1887
|
};
|
|
1869
1888
|
LoaderComponent.box = function Box2({ text = "Loading...", size = 20, ...props }) {
|
|
1870
|
-
const
|
|
1871
|
-
return /* @__PURE__ */ jsxs4(Div_default.column, { width: "100%", alignItems: "center", gap:
|
|
1889
|
+
const theme2 = useTheme8();
|
|
1890
|
+
return /* @__PURE__ */ jsxs4(Div_default.column, { width: "100%", alignItems: "center", gap: theme2.styles.gap, children: [
|
|
1872
1891
|
/* @__PURE__ */ jsx7(Loader2, { size, ...props }),
|
|
1873
|
-
text && /* @__PURE__ */ jsx7(Text_default, { textAlign: "center", color: props.color ??
|
|
1892
|
+
text && /* @__PURE__ */ jsx7(Text_default, { textAlign: "center", color: props.color ?? theme2.colors.textSecondary, children: text })
|
|
1874
1893
|
] });
|
|
1875
1894
|
};
|
|
1876
1895
|
LoaderComponent.text = function LoaderText({ text = "Loading...", size = 14, ...props }) {
|
|
1877
|
-
const
|
|
1878
|
-
return /* @__PURE__ */ jsxs4(Div_default.row, { alignItems: "center", gap:
|
|
1896
|
+
const theme2 = useTheme8();
|
|
1897
|
+
return /* @__PURE__ */ jsxs4(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
1879
1898
|
/* @__PURE__ */ jsx7(Loader2, { size, ...props }),
|
|
1880
|
-
text && /* @__PURE__ */ jsx7(Text_default, { textAlign: "center", color: props.color ??
|
|
1899
|
+
text && /* @__PURE__ */ jsx7(Text_default, { textAlign: "center", color: props.color ?? theme2.colors.textSecondary, children: text })
|
|
1881
1900
|
] });
|
|
1882
1901
|
};
|
|
1883
1902
|
var Loader2 = memo7(LoaderComponent);
|
|
@@ -1961,7 +1980,7 @@ var ButtonComponent = function Button({
|
|
|
1961
1980
|
onClickWithValue,
|
|
1962
1981
|
...props
|
|
1963
1982
|
}) {
|
|
1964
|
-
const
|
|
1983
|
+
const theme2 = useTheme9();
|
|
1965
1984
|
const isLoadingHook = useLoader(loaderName);
|
|
1966
1985
|
const { components } = useBetterHtmlContextInternal();
|
|
1967
1986
|
const { colorTheme } = useBetterCoreContext3();
|
|
@@ -1983,7 +2002,7 @@ var ButtonComponent = function Button({
|
|
|
1983
2002
|
Icon_default,
|
|
1984
2003
|
{
|
|
1985
2004
|
name: icon,
|
|
1986
|
-
color: iconColor ?? props.color ??
|
|
2005
|
+
color: iconColor ?? props.color ?? theme2.colors.base,
|
|
1987
2006
|
size: iconSize ?? parseInt(style.fontSize?.toString() ?? "16")
|
|
1988
2007
|
}
|
|
1989
2008
|
) }) : void 0;
|
|
@@ -1991,7 +2010,7 @@ var ButtonComponent = function Button({
|
|
|
1991
2010
|
Image_default,
|
|
1992
2011
|
{
|
|
1993
2012
|
name: image,
|
|
1994
|
-
color: iconColor ?? props.color ??
|
|
2013
|
+
color: iconColor ?? props.color ?? theme2.colors.base,
|
|
1995
2014
|
width: imageWidth ?? parseInt(style.fontSize?.toString() ?? "16"),
|
|
1996
2015
|
height: imageHeight
|
|
1997
2016
|
}
|
|
@@ -2002,7 +2021,7 @@ var ButtonComponent = function Button({
|
|
|
2002
2021
|
ButtonElement,
|
|
2003
2022
|
{
|
|
2004
2023
|
as: href ? linkComponentTag : buttonComponentTag,
|
|
2005
|
-
theme,
|
|
2024
|
+
theme: theme2,
|
|
2006
2025
|
colorTheme,
|
|
2007
2026
|
isSmall,
|
|
2008
2027
|
withText: text !== void 0,
|
|
@@ -2028,7 +2047,7 @@ var ButtonComponent = function Button({
|
|
|
2028
2047
|
gap: 10,
|
|
2029
2048
|
pointerEvents: "none",
|
|
2030
2049
|
opacity: isLoadingElement ? 0 : 1,
|
|
2031
|
-
transition:
|
|
2050
|
+
transition: theme2.styles.transition,
|
|
2032
2051
|
children: [
|
|
2033
2052
|
iconPosition === "left" && iconComponent,
|
|
2034
2053
|
imagePosition === "left" && imageComponent,
|
|
@@ -2050,11 +2069,11 @@ var ButtonComponent = function Button({
|
|
|
2050
2069
|
alignItems: "center",
|
|
2051
2070
|
justifyContent: "center",
|
|
2052
2071
|
opacity: isLoadingElement ? 1 : 0,
|
|
2053
|
-
transition:
|
|
2072
|
+
transition: theme2.styles.transition,
|
|
2054
2073
|
children: /* @__PURE__ */ jsx8(
|
|
2055
2074
|
Loader_default,
|
|
2056
2075
|
{
|
|
2057
|
-
color: props.color ??
|
|
2076
|
+
color: props.color ?? theme2.colors.base,
|
|
2058
2077
|
size: loaderSize,
|
|
2059
2078
|
disabled: !isLoadingElement
|
|
2060
2079
|
}
|
|
@@ -2066,43 +2085,43 @@ var ButtonComponent = function Button({
|
|
|
2066
2085
|
);
|
|
2067
2086
|
};
|
|
2068
2087
|
ButtonComponent.secondary = function Secondary({ className, ...props }) {
|
|
2069
|
-
const
|
|
2088
|
+
const theme2 = useTheme9();
|
|
2070
2089
|
const betterHtmlContext2 = useBetterHtmlContextInternal();
|
|
2071
2090
|
return /* @__PURE__ */ jsx8(
|
|
2072
2091
|
ButtonComponent,
|
|
2073
2092
|
{
|
|
2074
2093
|
...betterHtmlContext2.components.button?.style?.secondary,
|
|
2075
2094
|
className: `secondary${className ? ` ${className}` : ""}`,
|
|
2076
|
-
color:
|
|
2095
|
+
color: theme2.colors.textPrimary,
|
|
2077
2096
|
...props
|
|
2078
2097
|
}
|
|
2079
2098
|
);
|
|
2080
2099
|
};
|
|
2081
2100
|
ButtonComponent.destructive = function Destructive(props) {
|
|
2082
|
-
const
|
|
2101
|
+
const theme2 = useTheme9();
|
|
2083
2102
|
const betterHtmlContext2 = useBetterHtmlContextInternal();
|
|
2084
2103
|
return /* @__PURE__ */ jsx8(
|
|
2085
2104
|
ButtonComponent,
|
|
2086
2105
|
{
|
|
2087
2106
|
...betterHtmlContext2.components.button?.style?.destructive,
|
|
2088
|
-
backgroundColor:
|
|
2089
|
-
color:
|
|
2107
|
+
backgroundColor: theme2.colors.error,
|
|
2108
|
+
color: theme2.colors.base,
|
|
2090
2109
|
...props
|
|
2091
2110
|
}
|
|
2092
2111
|
);
|
|
2093
2112
|
};
|
|
2094
2113
|
ButtonComponent.icon = function Icon3({ size = 16, backgroundButtonColor, ...props }) {
|
|
2095
|
-
const
|
|
2114
|
+
const theme2 = useTheme9();
|
|
2096
2115
|
const betterHtmlContext2 = useBetterHtmlContextInternal();
|
|
2097
|
-
const buttonSize = size +
|
|
2098
|
-
const backgroundButtonColorReady = backgroundButtonColor ??
|
|
2116
|
+
const buttonSize = size + theme2.styles.space;
|
|
2117
|
+
const backgroundButtonColorReady = backgroundButtonColor ?? theme2.colors.textPrimary;
|
|
2099
2118
|
return /* @__PURE__ */ jsx8(
|
|
2100
2119
|
ButtonComponent,
|
|
2101
2120
|
{
|
|
2102
2121
|
...betterHtmlContext2.components.button?.style?.icon,
|
|
2103
2122
|
width: buttonSize,
|
|
2104
2123
|
height: buttonSize,
|
|
2105
|
-
color:
|
|
2124
|
+
color: theme2.colors.textPrimary,
|
|
2106
2125
|
backgroundColor: backgroundButtonColorReady + "00",
|
|
2107
2126
|
backgroundImage: "none",
|
|
2108
2127
|
backgroundColorHover: backgroundButtonColorReady + "20",
|
|
@@ -2146,108 +2165,440 @@ Button2.icon = ButtonComponent.icon;
|
|
|
2146
2165
|
Button2.upload = ButtonComponent.upload;
|
|
2147
2166
|
var Button_default = Button2;
|
|
2148
2167
|
|
|
2149
|
-
// src/components/
|
|
2150
|
-
import {
|
|
2151
|
-
|
|
2152
|
-
|
|
2168
|
+
// src/components/Modal.tsx
|
|
2169
|
+
import { memo as memo9, useCallback as useCallback4, forwardRef as forwardRef7, useImperativeHandle, useRef as useRef2, useState as useState2 } from "react";
|
|
2170
|
+
import { createPortal } from "react-dom";
|
|
2171
|
+
import {
|
|
2172
|
+
useBetterCoreContext as useBetterCoreContext4,
|
|
2173
|
+
useTheme as useTheme10
|
|
2174
|
+
} from "react-better-core";
|
|
2175
|
+
import styled7 from "styled-components";
|
|
2176
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2177
|
+
var DialogStylesElement = styled7.dialog.withConfig({
|
|
2178
|
+
shouldForwardProp: (prop) => !["theme", "colorTheme", "opacity"].includes(prop)
|
|
2153
2179
|
})`
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
from {
|
|
2167
|
-
opacity: 0;
|
|
2168
|
-
transform: translateX(${(props) => props.theme.styles.space}px);
|
|
2169
|
-
}
|
|
2170
|
-
to {
|
|
2171
|
-
opacity: 1;
|
|
2172
|
-
transform: translateX(0px);
|
|
2173
|
-
}
|
|
2174
|
-
}
|
|
2180
|
+
width: 100%;
|
|
2181
|
+
max-width: none;
|
|
2182
|
+
height: 100%;
|
|
2183
|
+
max-height: none;
|
|
2184
|
+
color: ${(props) => props.theme.colors.textPrimary};
|
|
2185
|
+
border: none;
|
|
2186
|
+
outline: none;
|
|
2187
|
+
background-color: transparent;
|
|
2188
|
+
margin: auto auto;
|
|
2189
|
+
padding-inline: ${(props) => props.theme.styles.gap}px;
|
|
2190
|
+
opacity: ${(props) => props.opacity};
|
|
2191
|
+
transition: ${(props) => props.theme.styles.transition};
|
|
2175
2192
|
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
}
|
|
2181
|
-
to {
|
|
2182
|
-
opacity: 1;
|
|
2183
|
-
transform: translateX(0px);
|
|
2184
|
-
}
|
|
2193
|
+
&::backdrop {
|
|
2194
|
+
background-color: ${(props) => props.colorTheme === "light" ? "#000000a0" : "#222222e0"};
|
|
2195
|
+
opacity: ${(props) => props.opacity};
|
|
2196
|
+
transition: ${(props) => props.theme.styles.transition};
|
|
2185
2197
|
}
|
|
2186
2198
|
|
|
2187
|
-
@keyframes
|
|
2199
|
+
@keyframes fadeInAnimation {
|
|
2188
2200
|
from {
|
|
2189
|
-
opacity: 0;
|
|
2190
2201
|
transform: translateY(${(props) => props.theme.styles.space}px);
|
|
2191
2202
|
}
|
|
2192
2203
|
to {
|
|
2193
|
-
opacity: 1;
|
|
2194
|
-
transform: translateY(0px);
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
@keyframes fadeOutToLeft {
|
|
2199
|
-
from {
|
|
2200
|
-
opacity: 1;
|
|
2201
|
-
transform: translateX(0px);
|
|
2202
|
-
}
|
|
2203
|
-
to {
|
|
2204
|
-
opacity: 0;
|
|
2205
|
-
transform: translateX(-${(props) => props.theme.styles.space}px);
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
@keyframes fadeOutToRight {
|
|
2210
|
-
from {
|
|
2211
|
-
opacity: 1;
|
|
2212
|
-
transform: translateX(0px);
|
|
2213
|
-
}
|
|
2214
|
-
to {
|
|
2215
|
-
opacity: 0;
|
|
2216
|
-
transform: translateX(${(props) => props.theme.styles.space}px);
|
|
2217
|
-
}
|
|
2218
|
-
}
|
|
2219
|
-
|
|
2220
|
-
@keyframes fadeOutToTop {
|
|
2221
|
-
from {
|
|
2222
|
-
opacity: 1;
|
|
2223
2204
|
transform: translateY(0px);
|
|
2224
2205
|
}
|
|
2225
|
-
to {
|
|
2226
|
-
opacity: 0;
|
|
2227
|
-
transform: translateY(-${(props) => props.theme.styles.space}px);
|
|
2228
|
-
}
|
|
2229
2206
|
}
|
|
2230
2207
|
|
|
2231
|
-
@keyframes
|
|
2208
|
+
@keyframes fadeOutAnimation {
|
|
2232
2209
|
from {
|
|
2233
|
-
opacity: 1;
|
|
2234
2210
|
transform: translateY(0px);
|
|
2235
2211
|
}
|
|
2236
2212
|
to {
|
|
2237
|
-
opacity: 0;
|
|
2238
2213
|
transform: translateY(${(props) => props.theme.styles.space}px);
|
|
2239
2214
|
}
|
|
2240
2215
|
}
|
|
2241
2216
|
`;
|
|
2242
|
-
var
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2217
|
+
var ModalComponent = forwardRef7(function Modal({
|
|
2218
|
+
maxWidth,
|
|
2219
|
+
icon,
|
|
2220
|
+
title,
|
|
2221
|
+
titleColor,
|
|
2222
|
+
description,
|
|
2223
|
+
descriptionColor,
|
|
2224
|
+
headerTextAlign,
|
|
2225
|
+
headerBackgroundColor,
|
|
2226
|
+
backgroundColor,
|
|
2227
|
+
name,
|
|
2228
|
+
overflow,
|
|
2229
|
+
withoutCloseButton,
|
|
2230
|
+
onOpen,
|
|
2231
|
+
onClose,
|
|
2232
|
+
children
|
|
2233
|
+
}, ref) {
|
|
2234
|
+
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
2235
|
+
const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
|
|
2236
|
+
const theme2 = useTheme10();
|
|
2237
|
+
const { app } = useBetterHtmlContextInternal();
|
|
2238
|
+
const { colorTheme } = useBetterCoreContext4();
|
|
2239
|
+
const dialogRef = useRef2(null);
|
|
2240
|
+
const [isOpened, setIsOpened] = useState2(false);
|
|
2241
|
+
const [isOpenedLate, setIsOpenedLate] = useState2(false);
|
|
2242
|
+
const onClickOpen = useCallback4(() => {
|
|
2243
|
+
dialogRef.current?.showModal();
|
|
2244
|
+
setIsOpened(true);
|
|
2245
|
+
setIsOpenedLate(true);
|
|
2246
|
+
if (urlQuery && name) {
|
|
2247
|
+
urlQuery.setQuery(
|
|
2248
|
+
{
|
|
2249
|
+
[`${name}-modal`]: "opened"
|
|
2250
|
+
},
|
|
2251
|
+
false
|
|
2252
|
+
);
|
|
2253
|
+
}
|
|
2254
|
+
onOpen?.();
|
|
2255
|
+
}, [onOpen, urlQuery, name]);
|
|
2256
|
+
const onClickClose = useCallback4(() => {
|
|
2257
|
+
setIsOpened(false);
|
|
2258
|
+
onClose?.();
|
|
2259
|
+
if (urlQuery && name) urlQuery.removeQuery(`${name}-modal`, false);
|
|
2260
|
+
setTimeout(() => {
|
|
2261
|
+
dialogRef.current?.close();
|
|
2262
|
+
setIsOpenedLate(false);
|
|
2263
|
+
}, 0.2 * 1e3);
|
|
2264
|
+
}, [onClose, urlQuery, name]);
|
|
2265
|
+
const onKeyDown = useCallback4(
|
|
2266
|
+
(event) => {
|
|
2267
|
+
if (event.key === "Escape") {
|
|
2268
|
+
if (!withoutCloseButton) return;
|
|
2269
|
+
event.preventDefault();
|
|
2270
|
+
}
|
|
2271
|
+
},
|
|
2272
|
+
[withoutCloseButton]
|
|
2273
|
+
);
|
|
2274
|
+
useImperativeHandle(
|
|
2275
|
+
ref,
|
|
2276
|
+
() => {
|
|
2277
|
+
return {
|
|
2278
|
+
open: onClickOpen,
|
|
2279
|
+
close: onClickClose,
|
|
2280
|
+
isOpened
|
|
2281
|
+
};
|
|
2282
|
+
},
|
|
2283
|
+
[onClickOpen, onClickClose, isOpened]
|
|
2284
|
+
);
|
|
2285
|
+
const headerVertical = headerTextAlign === "center";
|
|
2286
|
+
return createPortal(
|
|
2287
|
+
/* @__PURE__ */ jsx9(
|
|
2288
|
+
DialogStylesElement,
|
|
2289
|
+
{
|
|
2290
|
+
theme: theme2,
|
|
2291
|
+
colorTheme,
|
|
2292
|
+
opacity: !isOpened ? 0 : 1,
|
|
2293
|
+
onClose: onClickClose,
|
|
2294
|
+
onKeyDown,
|
|
2295
|
+
ref: dialogRef,
|
|
2296
|
+
children: isOpenedLate ? /* @__PURE__ */ jsx9(
|
|
2297
|
+
Div_default.column,
|
|
2298
|
+
{
|
|
2299
|
+
position: "relative",
|
|
2300
|
+
width: "100%",
|
|
2301
|
+
maxWidth: maxWidth ?? app.contentMaxWidth / 1.3,
|
|
2302
|
+
minHeight: `calc(100% - ${theme2.styles.space * 2}px)`,
|
|
2303
|
+
alignItems: "center",
|
|
2304
|
+
justifyContent: "center",
|
|
2305
|
+
marginBlock: theme2.styles.space,
|
|
2306
|
+
marginInline: "auto",
|
|
2307
|
+
transform: `translateY(${theme2.styles.space}px)`,
|
|
2308
|
+
transition: theme2.styles.transition,
|
|
2309
|
+
animation: isOpened ? "fadeInAnimation 0.2s ease forwards" : "fadeOutAnimation 0.2s ease forwards",
|
|
2310
|
+
children: /* @__PURE__ */ jsxs6(
|
|
2311
|
+
Div_default,
|
|
2312
|
+
{
|
|
2313
|
+
position: "relative",
|
|
2314
|
+
width: "100%",
|
|
2315
|
+
minHeight: 32 + theme2.styles.space * 2,
|
|
2316
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundBase,
|
|
2317
|
+
borderRadius: theme2.styles.borderRadius * 2,
|
|
2318
|
+
padding: !title ? theme2.styles.space : void 0,
|
|
2319
|
+
overflow,
|
|
2320
|
+
children: [
|
|
2321
|
+
title ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
2322
|
+
/* @__PURE__ */ jsxs6(
|
|
2323
|
+
Div_default.row,
|
|
2324
|
+
{
|
|
2325
|
+
alignItems: "center",
|
|
2326
|
+
gap: theme2.styles.gap,
|
|
2327
|
+
backgroundColor: headerBackgroundColor,
|
|
2328
|
+
borderTopLeftRadius: theme2.styles.borderRadius * 2 - 1,
|
|
2329
|
+
borderTopRightRadius: theme2.styles.borderRadius * 2 - 1,
|
|
2330
|
+
paddingInline: theme2.styles.space,
|
|
2331
|
+
paddingBlock: theme2.styles.space,
|
|
2332
|
+
transition: theme2.styles.transition,
|
|
2333
|
+
children: [
|
|
2334
|
+
/* @__PURE__ */ jsxs6(
|
|
2335
|
+
Div_default.row,
|
|
2336
|
+
{
|
|
2337
|
+
flex: 1,
|
|
2338
|
+
alignItems: "center",
|
|
2339
|
+
gap: headerVertical ? theme2.styles.space * 2 : theme2.styles.space,
|
|
2340
|
+
invertFlexDirection: headerVertical,
|
|
2341
|
+
children: [
|
|
2342
|
+
icon && (headerVertical ? /* @__PURE__ */ jsx9(
|
|
2343
|
+
Div_default.row,
|
|
2344
|
+
{
|
|
2345
|
+
width: 76,
|
|
2346
|
+
height: 76,
|
|
2347
|
+
alignItems: "center",
|
|
2348
|
+
justifyContent: "center",
|
|
2349
|
+
backgroundColor: titleColor ?? theme2.colors.textPrimary,
|
|
2350
|
+
borderRadius: 999,
|
|
2351
|
+
children: /* @__PURE__ */ jsx9(
|
|
2352
|
+
Icon_default,
|
|
2353
|
+
{
|
|
2354
|
+
name: icon,
|
|
2355
|
+
size: 36,
|
|
2356
|
+
color: headerBackgroundColor ?? theme2.colors.backgroundBase,
|
|
2357
|
+
flexShrink: 0
|
|
2358
|
+
}
|
|
2359
|
+
)
|
|
2360
|
+
}
|
|
2361
|
+
) : /* @__PURE__ */ jsx9(
|
|
2362
|
+
Icon_default,
|
|
2363
|
+
{
|
|
2364
|
+
name: icon,
|
|
2365
|
+
size: 24,
|
|
2366
|
+
color: titleColor ?? theme2.colors.textPrimary,
|
|
2367
|
+
flexShrink: 0
|
|
2368
|
+
}
|
|
2369
|
+
)),
|
|
2370
|
+
/* @__PURE__ */ jsxs6(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
2371
|
+
/* @__PURE__ */ jsx9(
|
|
2372
|
+
Text_default,
|
|
2373
|
+
{
|
|
2374
|
+
as: "h1",
|
|
2375
|
+
textAlign: headerTextAlign,
|
|
2376
|
+
color: titleColor ?? theme2.colors.textPrimary,
|
|
2377
|
+
transition: theme2.styles.transition,
|
|
2378
|
+
children: title
|
|
2379
|
+
}
|
|
2380
|
+
),
|
|
2381
|
+
description && /* @__PURE__ */ jsx9(
|
|
2382
|
+
Text_default,
|
|
2383
|
+
{
|
|
2384
|
+
textAlign: headerTextAlign,
|
|
2385
|
+
color: descriptionColor ?? theme2.colors.textSecondary,
|
|
2386
|
+
transition: theme2.styles.transition,
|
|
2387
|
+
children: description
|
|
2388
|
+
}
|
|
2389
|
+
)
|
|
2390
|
+
] })
|
|
2391
|
+
]
|
|
2392
|
+
}
|
|
2393
|
+
),
|
|
2394
|
+
!withoutCloseButton && /* @__PURE__ */ jsx9(
|
|
2395
|
+
Button_default.icon,
|
|
2396
|
+
{
|
|
2397
|
+
icon: "XMark",
|
|
2398
|
+
marginTop: 1,
|
|
2399
|
+
iconColor: titleColor,
|
|
2400
|
+
onClick: onClickClose,
|
|
2401
|
+
transition: theme2.styles.transition,
|
|
2402
|
+
zIndex: 10
|
|
2403
|
+
}
|
|
2404
|
+
)
|
|
2405
|
+
]
|
|
2406
|
+
}
|
|
2407
|
+
),
|
|
2408
|
+
/* @__PURE__ */ jsx9(Divider_default.horizontal, {})
|
|
2409
|
+
] }) : /* @__PURE__ */ jsx9(Fragment, { children: !withoutCloseButton && /* @__PURE__ */ jsx9(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, zIndex: 10, children: /* @__PURE__ */ jsx9(Button_default.icon, { icon: "XMark", iconColor: titleColor, onClick: onClickClose }) }) }),
|
|
2410
|
+
/* @__PURE__ */ jsx9(Div_default, { padding: title ? theme2.styles.space : void 0, children })
|
|
2411
|
+
]
|
|
2412
|
+
}
|
|
2413
|
+
)
|
|
2414
|
+
}
|
|
2415
|
+
) : void 0
|
|
2416
|
+
}
|
|
2417
|
+
),
|
|
2418
|
+
document.body
|
|
2419
|
+
);
|
|
2420
|
+
});
|
|
2421
|
+
ModalComponent.confirmation = forwardRef7(function Confirmation({ message, continueButtonText = "Continue", continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
|
|
2422
|
+
const theme2 = useTheme10();
|
|
2423
|
+
const modalRef = useRef2(null);
|
|
2424
|
+
const onCancelElement = useCallback4(() => {
|
|
2425
|
+
onCancel?.();
|
|
2426
|
+
modalRef.current?.close();
|
|
2427
|
+
}, [onCancel]);
|
|
2428
|
+
const onContinueElement = useCallback4(() => {
|
|
2429
|
+
onContinue?.();
|
|
2430
|
+
modalRef.current?.close();
|
|
2431
|
+
}, [onContinue]);
|
|
2432
|
+
useImperativeHandle(ref, () => modalRef.current, []);
|
|
2433
|
+
return /* @__PURE__ */ jsxs6(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
|
|
2434
|
+
/* @__PURE__ */ jsx9(Text_default, { color: theme2.colors.textSecondary, children: message ?? "Do you really want to continue? This action may be irreversible." }),
|
|
2435
|
+
/* @__PURE__ */ jsxs6(
|
|
2436
|
+
Div_default.row,
|
|
2437
|
+
{
|
|
2438
|
+
alignItems: "center",
|
|
2439
|
+
justifyContent: "flex-end",
|
|
2440
|
+
gap: theme2.styles.gap,
|
|
2441
|
+
marginTop: theme2.styles.space * 2,
|
|
2442
|
+
children: [
|
|
2443
|
+
/* @__PURE__ */ jsx9(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
|
|
2444
|
+
/* @__PURE__ */ jsx9(Button_default, { text: continueButtonText, loaderName: continueButtonLoaderName, onClick: onContinueElement })
|
|
2445
|
+
]
|
|
2446
|
+
}
|
|
2447
|
+
)
|
|
2448
|
+
] });
|
|
2449
|
+
});
|
|
2450
|
+
ModalComponent.destructive = forwardRef7(function Destructive2({
|
|
2451
|
+
message,
|
|
2452
|
+
deleteButtonText = "Delete",
|
|
2453
|
+
deleteButtonIconName = "trash",
|
|
2454
|
+
deleteButtonLoaderName,
|
|
2455
|
+
onDelete,
|
|
2456
|
+
onCancel,
|
|
2457
|
+
...props
|
|
2458
|
+
}, ref) {
|
|
2459
|
+
const theme2 = useTheme10();
|
|
2460
|
+
const modalRef = useRef2(null);
|
|
2461
|
+
const onCancelElement = useCallback4(() => {
|
|
2462
|
+
onCancel?.();
|
|
2463
|
+
modalRef.current?.close();
|
|
2464
|
+
}, [onCancel]);
|
|
2465
|
+
const onDeleteElement = useCallback4(() => {
|
|
2466
|
+
onDelete?.();
|
|
2467
|
+
modalRef.current?.close();
|
|
2468
|
+
}, [onDelete]);
|
|
2469
|
+
useImperativeHandle(ref, () => modalRef.current, []);
|
|
2470
|
+
return /* @__PURE__ */ jsxs6(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
|
|
2471
|
+
/* @__PURE__ */ jsx9(Text_default, { color: theme2.colors.textSecondary, children: message ?? "Do you really want to continue with the deleting of the item? This action may be irreversible." }),
|
|
2472
|
+
/* @__PURE__ */ jsxs6(
|
|
2473
|
+
Div_default.row,
|
|
2474
|
+
{
|
|
2475
|
+
alignItems: "center",
|
|
2476
|
+
justifyContent: "flex-end",
|
|
2477
|
+
gap: theme2.styles.gap,
|
|
2478
|
+
marginTop: theme2.styles.space * 2,
|
|
2479
|
+
children: [
|
|
2480
|
+
/* @__PURE__ */ jsx9(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
|
|
2481
|
+
/* @__PURE__ */ jsx9(
|
|
2482
|
+
Button_default.destructive,
|
|
2483
|
+
{
|
|
2484
|
+
icon: deleteButtonIconName,
|
|
2485
|
+
text: deleteButtonText,
|
|
2486
|
+
loaderName: deleteButtonLoaderName,
|
|
2487
|
+
onClick: onDeleteElement
|
|
2488
|
+
}
|
|
2489
|
+
)
|
|
2490
|
+
]
|
|
2491
|
+
}
|
|
2492
|
+
)
|
|
2493
|
+
] });
|
|
2494
|
+
});
|
|
2495
|
+
var Modal2 = memo9(ModalComponent);
|
|
2496
|
+
Modal2.confirmation = ModalComponent.confirmation;
|
|
2497
|
+
Modal2.destructive = ModalComponent.destructive;
|
|
2498
|
+
var Modal_default = Modal2;
|
|
2499
|
+
|
|
2500
|
+
// src/components/alerts/Alert.tsx
|
|
2501
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2502
|
+
var StyledDiv2 = styled8.div.withConfig({
|
|
2503
|
+
shouldForwardProp: (prop) => !["theme"].includes(prop)
|
|
2504
|
+
})`
|
|
2505
|
+
@keyframes fadeInFromLeft {
|
|
2506
|
+
from {
|
|
2507
|
+
opacity: 0;
|
|
2508
|
+
transform: translateX(-${(props) => props.theme.styles.space}px);
|
|
2509
|
+
}
|
|
2510
|
+
to {
|
|
2511
|
+
opacity: 1;
|
|
2512
|
+
transform: translateX(0px);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
@keyframes fadeInFromRight {
|
|
2517
|
+
from {
|
|
2518
|
+
opacity: 0;
|
|
2519
|
+
transform: translateX(${(props) => props.theme.styles.space}px);
|
|
2520
|
+
}
|
|
2521
|
+
to {
|
|
2522
|
+
opacity: 1;
|
|
2523
|
+
transform: translateX(0px);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
@keyframes fadeInFromTop {
|
|
2528
|
+
from {
|
|
2529
|
+
opacity: 0;
|
|
2530
|
+
transform: translateY(-${(props) => props.theme.styles.space}px);
|
|
2531
|
+
}
|
|
2532
|
+
to {
|
|
2533
|
+
opacity: 1;
|
|
2534
|
+
transform: translateX(0px);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
@keyframes fadeInFromBottom {
|
|
2539
|
+
from {
|
|
2540
|
+
opacity: 0;
|
|
2541
|
+
transform: translateY(${(props) => props.theme.styles.space}px);
|
|
2542
|
+
}
|
|
2543
|
+
to {
|
|
2544
|
+
opacity: 1;
|
|
2545
|
+
transform: translateY(0px);
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
@keyframes fadeOutToLeft {
|
|
2550
|
+
from {
|
|
2551
|
+
opacity: 1;
|
|
2552
|
+
transform: translateX(0px);
|
|
2553
|
+
}
|
|
2554
|
+
to {
|
|
2555
|
+
opacity: 0;
|
|
2556
|
+
transform: translateX(-${(props) => props.theme.styles.space}px);
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
@keyframes fadeOutToRight {
|
|
2561
|
+
from {
|
|
2562
|
+
opacity: 1;
|
|
2563
|
+
transform: translateX(0px);
|
|
2564
|
+
}
|
|
2565
|
+
to {
|
|
2566
|
+
opacity: 0;
|
|
2567
|
+
transform: translateX(${(props) => props.theme.styles.space}px);
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
@keyframes fadeOutToTop {
|
|
2572
|
+
from {
|
|
2573
|
+
opacity: 1;
|
|
2574
|
+
transform: translateY(0px);
|
|
2575
|
+
}
|
|
2576
|
+
to {
|
|
2577
|
+
opacity: 0;
|
|
2578
|
+
transform: translateY(-${(props) => props.theme.styles.space}px);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
@keyframes fadeOutToBottom {
|
|
2583
|
+
from {
|
|
2584
|
+
opacity: 1;
|
|
2585
|
+
transform: translateY(0px);
|
|
2586
|
+
}
|
|
2587
|
+
to {
|
|
2588
|
+
opacity: 0;
|
|
2589
|
+
transform: translateY(${(props) => props.theme.styles.space}px);
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
`;
|
|
2593
|
+
var minWidth = 250;
|
|
2594
|
+
var updateInterval = 20;
|
|
2595
|
+
var getAnimationInName = (position) => ({
|
|
2596
|
+
left: "fadeInFromLeft",
|
|
2597
|
+
right: "fadeInFromRight",
|
|
2598
|
+
center: position === "top" ? "fadeInFromTop" : "fadeInFromBottom"
|
|
2599
|
+
});
|
|
2600
|
+
var getAnimationOutName = (position) => ({
|
|
2601
|
+
left: "fadeOutToLeft",
|
|
2251
2602
|
right: "fadeOutToRight",
|
|
2252
2603
|
center: position === "top" ? "fadeOutToTop" : "fadeOutToBottom"
|
|
2253
2604
|
});
|
|
@@ -2260,22 +2611,23 @@ var getAlertDurationFromAuto = (duration, alert) => {
|
|
|
2260
2611
|
return duration;
|
|
2261
2612
|
};
|
|
2262
2613
|
function Alert2({ alert }) {
|
|
2263
|
-
const
|
|
2614
|
+
const theme2 = useTheme11();
|
|
2264
2615
|
const alertControls2 = useAlertControls();
|
|
2265
2616
|
const alertsPlugin2 = usePlugin("alerts");
|
|
2266
2617
|
const pluginConfig = alertsPlugin2?.getConfig() ?? {};
|
|
2618
|
+
const modalRef = useRef3(null);
|
|
2267
2619
|
const defaultAlertDurationNumber = getAlertDurationFromAuto(
|
|
2268
2620
|
alert.duration ?? pluginConfig.defaultDuration ?? defaultAlertsPluginOptions.defaultDuration,
|
|
2269
2621
|
alert
|
|
2270
2622
|
);
|
|
2271
|
-
const intervalRef =
|
|
2272
|
-
const startTimeRef =
|
|
2273
|
-
const remainingTimeRef =
|
|
2274
|
-
const calledOnCloseRef =
|
|
2275
|
-
const [isPaused, setIsPaused] =
|
|
2276
|
-
const [progress, setProgress] =
|
|
2277
|
-
const [isRemoved, setIsRemoved] =
|
|
2278
|
-
const startProgressTimer =
|
|
2623
|
+
const intervalRef = useRef3(void 0);
|
|
2624
|
+
const startTimeRef = useRef3(Date.now());
|
|
2625
|
+
const remainingTimeRef = useRef3(defaultAlertDurationNumber);
|
|
2626
|
+
const calledOnCloseRef = useRef3(false);
|
|
2627
|
+
const [isPaused, setIsPaused] = useState3(false);
|
|
2628
|
+
const [progress, setProgress] = useState3(100);
|
|
2629
|
+
const [isRemoved, setIsRemoved] = useState3(false);
|
|
2630
|
+
const startProgressTimer = useCallback5(() => {
|
|
2279
2631
|
if (intervalRef.current) {
|
|
2280
2632
|
clearInterval(intervalRef.current);
|
|
2281
2633
|
}
|
|
@@ -2287,6 +2639,7 @@ function Alert2({ alert }) {
|
|
|
2287
2639
|
setProgress(newProgress);
|
|
2288
2640
|
if (newProgress <= 0) {
|
|
2289
2641
|
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
2642
|
+
if (alert.display === "prominent") return;
|
|
2290
2643
|
setIsRemoved(true);
|
|
2291
2644
|
setTimeout(() => {
|
|
2292
2645
|
alertControls2.removeAlert(alert.id);
|
|
@@ -2298,7 +2651,7 @@ function Alert2({ alert }) {
|
|
|
2298
2651
|
}
|
|
2299
2652
|
}, updateInterval);
|
|
2300
2653
|
}, [alert, progress]);
|
|
2301
|
-
const onClickCloseAlert =
|
|
2654
|
+
const onClickCloseAlert = useCallback5(() => {
|
|
2302
2655
|
setIsRemoved(true);
|
|
2303
2656
|
setTimeout(() => {
|
|
2304
2657
|
alertControls2.removeAlert(alert.id);
|
|
@@ -2308,7 +2661,7 @@ function Alert2({ alert }) {
|
|
|
2308
2661
|
}
|
|
2309
2662
|
}, 0.2 * 1e3 - 10);
|
|
2310
2663
|
}, [alert]);
|
|
2311
|
-
const onMouseEnter =
|
|
2664
|
+
const onMouseEnter = useCallback5(() => {
|
|
2312
2665
|
setIsPaused(true);
|
|
2313
2666
|
if (intervalRef.current) {
|
|
2314
2667
|
clearInterval(intervalRef.current);
|
|
@@ -2316,35 +2669,53 @@ function Alert2({ alert }) {
|
|
|
2316
2669
|
}
|
|
2317
2670
|
remainingTimeRef.current = defaultAlertDurationNumber * (progress / 100);
|
|
2318
2671
|
}, [defaultAlertDurationNumber, progress]);
|
|
2319
|
-
const onMouseLeave =
|
|
2672
|
+
const onMouseLeave = useCallback5(() => {
|
|
2320
2673
|
setIsPaused(false);
|
|
2321
2674
|
startProgressTimer();
|
|
2322
2675
|
}, [startProgressTimer]);
|
|
2676
|
+
const onClickAlertModalDone = useCallback5(() => {
|
|
2677
|
+
setIsRemoved(true);
|
|
2678
|
+
modalRef.current?.close();
|
|
2679
|
+
setTimeout(() => {
|
|
2680
|
+
alertControls2.removeAlert(alert.id);
|
|
2681
|
+
if (!calledOnCloseRef.current) {
|
|
2682
|
+
alert.onClose?.(alert);
|
|
2683
|
+
calledOnCloseRef.current = true;
|
|
2684
|
+
}
|
|
2685
|
+
}, 0.2 * 1e3 - 10);
|
|
2686
|
+
}, [alert]);
|
|
2323
2687
|
const alertData = useMemo2(
|
|
2324
2688
|
() => ({
|
|
2325
2689
|
info: {
|
|
2326
2690
|
icon: "infoI",
|
|
2327
|
-
backgroundColor:
|
|
2691
|
+
backgroundColor: theme2.colors.info,
|
|
2328
2692
|
title: "Info"
|
|
2329
2693
|
},
|
|
2330
2694
|
success: {
|
|
2331
2695
|
icon: "check",
|
|
2332
|
-
backgroundColor:
|
|
2696
|
+
backgroundColor: theme2.colors.success,
|
|
2333
2697
|
title: "Success"
|
|
2334
2698
|
},
|
|
2335
2699
|
warning: {
|
|
2336
2700
|
icon: "warningTriangle",
|
|
2337
|
-
backgroundColor:
|
|
2701
|
+
backgroundColor: theme2.colors.warn,
|
|
2338
2702
|
title: "Warning"
|
|
2339
2703
|
},
|
|
2340
2704
|
error: {
|
|
2341
2705
|
icon: "XMark",
|
|
2342
|
-
backgroundColor:
|
|
2706
|
+
backgroundColor: theme2.colors.error,
|
|
2343
2707
|
title: "Error"
|
|
2344
2708
|
}
|
|
2345
2709
|
}),
|
|
2346
|
-
[
|
|
2710
|
+
[theme2]
|
|
2347
2711
|
);
|
|
2712
|
+
useEffect4(() => {
|
|
2713
|
+
if (alert.display === "prominent") {
|
|
2714
|
+
setTimeout(() => {
|
|
2715
|
+
modalRef.current?.open();
|
|
2716
|
+
}, 0.1 * 1e3);
|
|
2717
|
+
}
|
|
2718
|
+
}, []);
|
|
2348
2719
|
useEffect4(() => {
|
|
2349
2720
|
startTimeRef.current = Date.now();
|
|
2350
2721
|
remainingTimeRef.current = defaultAlertDurationNumber;
|
|
@@ -2353,8 +2724,30 @@ function Alert2({ alert }) {
|
|
|
2353
2724
|
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
2354
2725
|
};
|
|
2355
2726
|
}, [defaultAlertDurationNumber, startProgressTimer]);
|
|
2356
|
-
const animation = `${isRemoved ? getAnimationOutName(pluginConfig.position ?? defaultAlertsPluginOptions.position)[pluginConfig.align ?? defaultAlertsPluginOptions.align] : getAnimationInName(pluginConfig.position ?? defaultAlertsPluginOptions.position)[pluginConfig.align ?? defaultAlertsPluginOptions.align]} ${
|
|
2357
|
-
|
|
2727
|
+
const animation = `${isRemoved ? getAnimationOutName(pluginConfig.position ?? defaultAlertsPluginOptions.position)[pluginConfig.align ?? defaultAlertsPluginOptions.align] : getAnimationInName(pluginConfig.position ?? defaultAlertsPluginOptions.position)[pluginConfig.align ?? defaultAlertsPluginOptions.align]} ${theme2.styles.transition}`;
|
|
2728
|
+
const alertTitle = alert.title ?? alertData[alert.type].title;
|
|
2729
|
+
return alert.display === "prominent" ? /* @__PURE__ */ jsx10(
|
|
2730
|
+
Modal_default,
|
|
2731
|
+
{
|
|
2732
|
+
icon: alertData[alert.type].icon,
|
|
2733
|
+
title: alertTitle,
|
|
2734
|
+
description: alert.message,
|
|
2735
|
+
titleColor: theme2.colors.base,
|
|
2736
|
+
descriptionColor: theme2.colors.base + "a0",
|
|
2737
|
+
headerTextAlign: "center",
|
|
2738
|
+
headerBackgroundColor: alertData[alert.type].backgroundColor,
|
|
2739
|
+
withoutCloseButton: true,
|
|
2740
|
+
ref: modalRef,
|
|
2741
|
+
children: /* @__PURE__ */ jsx10(Div_default.row, { width: "100%", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx10(
|
|
2742
|
+
Button_default,
|
|
2743
|
+
{
|
|
2744
|
+
text: "Close",
|
|
2745
|
+
backgroundColor: alertData[alert.type].backgroundColor,
|
|
2746
|
+
onClick: onClickAlertModalDone
|
|
2747
|
+
}
|
|
2748
|
+
) })
|
|
2749
|
+
}
|
|
2750
|
+
) : /* @__PURE__ */ jsx10(StyledDiv2, { theme: theme2, children: /* @__PURE__ */ jsx10(
|
|
2358
2751
|
Div_default.box,
|
|
2359
2752
|
{
|
|
2360
2753
|
width: "fit-content",
|
|
@@ -2365,9 +2758,9 @@ function Alert2({ alert }) {
|
|
|
2365
2758
|
onMouseMove: onMouseEnter,
|
|
2366
2759
|
onMouseLeave,
|
|
2367
2760
|
animation,
|
|
2368
|
-
children: /* @__PURE__ */
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2761
|
+
children: /* @__PURE__ */ jsxs7(Div_default.column, { gap: theme2.styles.space, children: [
|
|
2762
|
+
/* @__PURE__ */ jsxs7(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
2763
|
+
/* @__PURE__ */ jsx10(
|
|
2371
2764
|
Div_default.row,
|
|
2372
2765
|
{
|
|
2373
2766
|
width: 36,
|
|
@@ -2376,32 +2769,32 @@ function Alert2({ alert }) {
|
|
|
2376
2769
|
justifyContent: "center",
|
|
2377
2770
|
backgroundColor: alertData[alert.type].backgroundColor,
|
|
2378
2771
|
borderRadius: 999,
|
|
2379
|
-
marginTop:
|
|
2380
|
-
children: /* @__PURE__ */
|
|
2772
|
+
marginTop: theme2.styles.gap / 2,
|
|
2773
|
+
children: /* @__PURE__ */ jsx10(
|
|
2381
2774
|
Icon_default,
|
|
2382
2775
|
{
|
|
2383
2776
|
name: alertData[alert.type].icon,
|
|
2384
2777
|
size: 18,
|
|
2385
|
-
color: alertData[alert.type].iconColor ??
|
|
2778
|
+
color: alertData[alert.type].iconColor ?? theme2.colors.base
|
|
2386
2779
|
}
|
|
2387
2780
|
)
|
|
2388
2781
|
}
|
|
2389
2782
|
),
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsxs7(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
2784
|
+
/* @__PURE__ */ jsx10(Text_default, { fontSize: 18, fontWeight: 700, children: alertTitle }),
|
|
2785
|
+
/* @__PURE__ */ jsx10(Text_default, { color: theme2.colors.textSecondary, children: alert.message })
|
|
2393
2786
|
] }),
|
|
2394
|
-
pluginConfig.withCloseButton && /* @__PURE__ */
|
|
2787
|
+
pluginConfig.withCloseButton && /* @__PURE__ */ jsx10(Button_default.icon, { icon: "XMark", alignSelf: "flex-start", onClick: onClickCloseAlert })
|
|
2395
2788
|
] }),
|
|
2396
|
-
pluginConfig.withLoaderBar && /* @__PURE__ */
|
|
2789
|
+
pluginConfig.withLoaderBar && /* @__PURE__ */ jsx10(
|
|
2397
2790
|
Div_default,
|
|
2398
2791
|
{
|
|
2399
2792
|
width: "100%",
|
|
2400
2793
|
height: 5,
|
|
2401
|
-
backgroundColor:
|
|
2794
|
+
backgroundColor: theme2.colors.backgroundBase,
|
|
2402
2795
|
borderRadius: 999,
|
|
2403
2796
|
overflow: "hidden",
|
|
2404
|
-
children: /* @__PURE__ */
|
|
2797
|
+
children: /* @__PURE__ */ jsx10(
|
|
2405
2798
|
Div_default,
|
|
2406
2799
|
{
|
|
2407
2800
|
width: `${progress}%`,
|
|
@@ -2417,20 +2810,20 @@ function Alert2({ alert }) {
|
|
|
2417
2810
|
}
|
|
2418
2811
|
) });
|
|
2419
2812
|
}
|
|
2420
|
-
var Alert_default =
|
|
2813
|
+
var Alert_default = memo10(Alert2);
|
|
2421
2814
|
|
|
2422
2815
|
// src/components/alerts/AlertsHolder.tsx
|
|
2423
|
-
import { jsx as
|
|
2816
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2424
2817
|
function AlertsHolder() {
|
|
2425
|
-
const
|
|
2818
|
+
const theme2 = useTheme12();
|
|
2426
2819
|
const alertsPlugin2 = usePlugin("alerts");
|
|
2427
2820
|
const { alerts } = useBetterHtmlContextInternal();
|
|
2428
2821
|
const pluginConfig = alertsPlugin2?.getConfig() ?? {};
|
|
2429
|
-
const top = pluginConfig.position === "top" ?
|
|
2430
|
-
const bottom = pluginConfig.position === "bottom" ?
|
|
2431
|
-
const left = pluginConfig.align === "left" ?
|
|
2432
|
-
const right = pluginConfig.align === "right" ?
|
|
2433
|
-
return /* @__PURE__ */
|
|
2822
|
+
const top = pluginConfig.position === "top" ? theme2.styles.gap : void 0;
|
|
2823
|
+
const bottom = pluginConfig.position === "bottom" ? theme2.styles.gap : void 0;
|
|
2824
|
+
const left = pluginConfig.align === "left" ? theme2.styles.space : pluginConfig.align === "center" ? "50%" : void 0;
|
|
2825
|
+
const right = pluginConfig.align === "right" ? theme2.styles.space : void 0;
|
|
2826
|
+
return /* @__PURE__ */ jsx11(
|
|
2434
2827
|
Div_default.column,
|
|
2435
2828
|
{
|
|
2436
2829
|
position: "fixed",
|
|
@@ -2438,18 +2831,18 @@ function AlertsHolder() {
|
|
|
2438
2831
|
bottom,
|
|
2439
2832
|
left,
|
|
2440
2833
|
right,
|
|
2441
|
-
gap:
|
|
2834
|
+
gap: theme2.styles.gap,
|
|
2442
2835
|
alignItems: pluginConfig.align === "center" ? "center" : pluginConfig.align === "right" ? "flex-end" : void 0,
|
|
2443
2836
|
transform: pluginConfig.align === "center" ? "translateX(-50%)" : void 0,
|
|
2444
2837
|
zIndex: 1e3,
|
|
2445
|
-
children: alerts.map((alert) => /* @__PURE__ */
|
|
2838
|
+
children: alerts.map((alert) => /* @__PURE__ */ jsx11(Alert_default, { alert }, alert.id))
|
|
2446
2839
|
}
|
|
2447
2840
|
);
|
|
2448
2841
|
}
|
|
2449
|
-
var AlertsHolder_default =
|
|
2842
|
+
var AlertsHolder_default = memo11(AlertsHolder);
|
|
2450
2843
|
|
|
2451
2844
|
// src/components/BetterHtmlProvider.tsx
|
|
2452
|
-
import { Fragment, jsx as
|
|
2845
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2453
2846
|
var GlobalStyle = createGlobalStyle`
|
|
2454
2847
|
html {
|
|
2455
2848
|
background-color: ${(props) => props.backgroundColor};
|
|
@@ -2481,7 +2874,7 @@ var betterHtmlContext = createContext(void 0);
|
|
|
2481
2874
|
var externalBetterCoreContextValue;
|
|
2482
2875
|
var externalBetterHtmlContextValue;
|
|
2483
2876
|
var useBetterHtmlContext = () => {
|
|
2484
|
-
const coreContext =
|
|
2877
|
+
const coreContext = useBetterCoreContext5();
|
|
2485
2878
|
const context = useContext(betterHtmlContext);
|
|
2486
2879
|
if (context === void 0)
|
|
2487
2880
|
throw new Error(
|
|
@@ -2507,7 +2900,7 @@ var useAlertControls = () => {
|
|
|
2507
2900
|
throw new Error(
|
|
2508
2901
|
"`useAlertControls()` must be used within a `<BetterHtmlProvider>`. Make sure to add one at the root of your component tree."
|
|
2509
2902
|
);
|
|
2510
|
-
const createAlert =
|
|
2903
|
+
const createAlert = useCallback6((alert) => {
|
|
2511
2904
|
const readyAlert = {
|
|
2512
2905
|
id: crypto.randomUUID(),
|
|
2513
2906
|
...alert
|
|
@@ -2515,7 +2908,7 @@ var useAlertControls = () => {
|
|
|
2515
2908
|
context.setAlerts((oldValue) => [...oldValue, readyAlert]);
|
|
2516
2909
|
return readyAlert;
|
|
2517
2910
|
}, []);
|
|
2518
|
-
const removeAlert =
|
|
2911
|
+
const removeAlert = useCallback6((alertId) => {
|
|
2519
2912
|
context.setAlerts((oldValue) => oldValue.filter((alert) => alert.id !== alertId));
|
|
2520
2913
|
}, []);
|
|
2521
2914
|
return {
|
|
@@ -2536,28 +2929,28 @@ var usePlugin = (pluginName) => {
|
|
|
2536
2929
|
);
|
|
2537
2930
|
};
|
|
2538
2931
|
function BetterHtmlProviderInternalContent({ children }) {
|
|
2539
|
-
const
|
|
2932
|
+
const theme2 = useTheme13();
|
|
2540
2933
|
const alertsPlugin2 = usePlugin("alerts");
|
|
2541
|
-
return /* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2934
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
2935
|
+
/* @__PURE__ */ jsx12(
|
|
2543
2936
|
GlobalStyle,
|
|
2544
2937
|
{
|
|
2545
|
-
fontFamily:
|
|
2546
|
-
color:
|
|
2547
|
-
backgroundColor:
|
|
2938
|
+
fontFamily: theme2.styles.fontFamily,
|
|
2939
|
+
color: theme2.colors.textPrimary,
|
|
2940
|
+
backgroundColor: theme2.colors.backgroundBase
|
|
2548
2941
|
}
|
|
2549
2942
|
),
|
|
2550
2943
|
children,
|
|
2551
|
-
alertsPlugin2 && /* @__PURE__ */
|
|
2944
|
+
alertsPlugin2 && /* @__PURE__ */ jsx12(AlertsHolder_default, {})
|
|
2552
2945
|
] });
|
|
2553
2946
|
}
|
|
2554
2947
|
function BetterHtmlProviderInternal({ config, plugins, children }) {
|
|
2555
|
-
const betterCoreContext =
|
|
2556
|
-
const [alerts, setAlerts] =
|
|
2948
|
+
const betterCoreContext = useBetterCoreContext5();
|
|
2949
|
+
const [alerts, setAlerts] = useState4([]);
|
|
2557
2950
|
const [sideMenuIsCollapsed, setSideMenuIsCollapsed] = useBooleanState2();
|
|
2558
2951
|
const [sideMenuIsOpenMobile, setSideMenuIsOpenMobile] = useBooleanState2();
|
|
2559
|
-
const [tabGroups, setTabGroups] =
|
|
2560
|
-
const [tabsWithDots, setTabsWithDots] =
|
|
2952
|
+
const [tabGroups, setTabGroups] = useState4([]);
|
|
2953
|
+
const [tabsWithDots, setTabsWithDots] = useState4([]);
|
|
2561
2954
|
const readyConfig = useMemo3(
|
|
2562
2955
|
() => ({
|
|
2563
2956
|
app: {
|
|
@@ -2593,12 +2986,15 @@ function BetterHtmlProviderInternal({ config, plugins, children }) {
|
|
|
2593
2986
|
}, []);
|
|
2594
2987
|
externalBetterCoreContextValue = betterCoreContext;
|
|
2595
2988
|
externalBetterHtmlContextValue = readyConfig;
|
|
2596
|
-
return /* @__PURE__ */
|
|
2989
|
+
return /* @__PURE__ */ jsx12(betterHtmlContext.Provider, { value: readyConfig, children: /* @__PURE__ */ jsx12(BetterHtmlProviderInternalContent, { children }) });
|
|
2597
2990
|
}
|
|
2598
2991
|
function BetterHtmlProvider({ config, ...props }) {
|
|
2599
2992
|
const coreConfig = useMemo3(
|
|
2600
2993
|
() => ({
|
|
2601
|
-
theme:
|
|
2994
|
+
theme: {
|
|
2995
|
+
...theme,
|
|
2996
|
+
...config?.theme
|
|
2997
|
+
},
|
|
2602
2998
|
colorTheme: config?.colorTheme ?? (localStorage.getItem("theme") === "dark" ? "dark" : "light"),
|
|
2603
2999
|
icons: {
|
|
2604
3000
|
...icons,
|
|
@@ -2642,9 +3038,9 @@ function BetterHtmlProvider({ config, ...props }) {
|
|
|
2642
3038
|
observer.disconnect();
|
|
2643
3039
|
};
|
|
2644
3040
|
}, []);
|
|
2645
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ jsx12(BetterCoreProvider, { config: coreConfig, children: /* @__PURE__ */ jsx12(BetterHtmlProviderInternal, { config: htmlConfig, ...props }) });
|
|
2646
3042
|
}
|
|
2647
|
-
var BetterHtmlProvider_default =
|
|
3043
|
+
var BetterHtmlProvider_default = memo12(BetterHtmlProvider);
|
|
2648
3044
|
|
|
2649
3045
|
// src/utils/functions.ts
|
|
2650
3046
|
import CryptoJS from "crypto-js";
|
|
@@ -2831,300 +3227,12 @@ function generateLocalStorage() {
|
|
|
2831
3227
|
};
|
|
2832
3228
|
}
|
|
2833
3229
|
|
|
2834
|
-
// src/components/Modal.tsx
|
|
2835
|
-
import { memo as memo12, useCallback as useCallback6, forwardRef as forwardRef7, useImperativeHandle, useRef as useRef3, useState as useState4 } from "react";
|
|
2836
|
-
import { createPortal } from "react-dom";
|
|
2837
|
-
import {
|
|
2838
|
-
useBetterCoreContext as useBetterCoreContext5,
|
|
2839
|
-
useTheme as useTheme13
|
|
2840
|
-
} from "react-better-core";
|
|
2841
|
-
import styled8 from "styled-components";
|
|
2842
|
-
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2843
|
-
var DialogStylesElement = styled8.dialog.withConfig({
|
|
2844
|
-
shouldForwardProp: (prop) => !["theme", "colorTheme", "opacity"].includes(prop)
|
|
2845
|
-
})`
|
|
2846
|
-
width: 100%;
|
|
2847
|
-
max-width: none;
|
|
2848
|
-
height: 100%;
|
|
2849
|
-
max-height: none;
|
|
2850
|
-
color: ${(props) => props.theme.colors.textPrimary};
|
|
2851
|
-
border: none;
|
|
2852
|
-
outline: none;
|
|
2853
|
-
background-color: transparent;
|
|
2854
|
-
margin: auto auto;
|
|
2855
|
-
padding-inline: ${(props) => props.theme.styles.gap}px;
|
|
2856
|
-
opacity: ${(props) => props.opacity};
|
|
2857
|
-
transition: ${(props) => props.theme.styles.transition};
|
|
2858
|
-
|
|
2859
|
-
&::backdrop {
|
|
2860
|
-
background-color: ${(props) => props.colorTheme === "light" ? "#000000a0" : "#222222e0"};
|
|
2861
|
-
opacity: ${(props) => props.opacity};
|
|
2862
|
-
transition: ${(props) => props.theme.styles.transition};
|
|
2863
|
-
}
|
|
2864
|
-
|
|
2865
|
-
@keyframes fadeInAnimation {
|
|
2866
|
-
from {
|
|
2867
|
-
transform: translateY(${(props) => props.theme.styles.space}px);
|
|
2868
|
-
}
|
|
2869
|
-
to {
|
|
2870
|
-
transform: translateY(0px);
|
|
2871
|
-
}
|
|
2872
|
-
}
|
|
2873
|
-
|
|
2874
|
-
@keyframes fadeOutAnimation {
|
|
2875
|
-
from {
|
|
2876
|
-
transform: translateY(0px);
|
|
2877
|
-
}
|
|
2878
|
-
to {
|
|
2879
|
-
transform: translateY(${(props) => props.theme.styles.space}px);
|
|
2880
|
-
}
|
|
2881
|
-
}
|
|
2882
|
-
`;
|
|
2883
|
-
var ModalComponent = forwardRef7(function Modal({
|
|
2884
|
-
maxWidth,
|
|
2885
|
-
title,
|
|
2886
|
-
titleColor,
|
|
2887
|
-
description,
|
|
2888
|
-
descriptionColor,
|
|
2889
|
-
headerBackgroundColor,
|
|
2890
|
-
backgroundColor,
|
|
2891
|
-
name,
|
|
2892
|
-
overflow,
|
|
2893
|
-
withoutCloseButton,
|
|
2894
|
-
onOpen,
|
|
2895
|
-
onClose,
|
|
2896
|
-
children
|
|
2897
|
-
}, ref) {
|
|
2898
|
-
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
2899
|
-
const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
|
|
2900
|
-
const theme = useTheme13();
|
|
2901
|
-
const { app } = useBetterHtmlContextInternal();
|
|
2902
|
-
const { colorTheme } = useBetterCoreContext5();
|
|
2903
|
-
const dialogRef = useRef3(null);
|
|
2904
|
-
const [isOpened, setIsOpened] = useState4(false);
|
|
2905
|
-
const [isOpenedLate, setIsOpenedLate] = useState4(false);
|
|
2906
|
-
const onClickOpen = useCallback6(() => {
|
|
2907
|
-
dialogRef.current?.showModal();
|
|
2908
|
-
setIsOpened(true);
|
|
2909
|
-
setIsOpenedLate(true);
|
|
2910
|
-
if (urlQuery && name) {
|
|
2911
|
-
urlQuery.setQuery(
|
|
2912
|
-
{
|
|
2913
|
-
[`${name}-modal`]: "opened"
|
|
2914
|
-
},
|
|
2915
|
-
false
|
|
2916
|
-
);
|
|
2917
|
-
}
|
|
2918
|
-
onOpen?.();
|
|
2919
|
-
}, [onOpen, urlQuery, name]);
|
|
2920
|
-
const onClickClose = useCallback6(() => {
|
|
2921
|
-
setIsOpened(false);
|
|
2922
|
-
onClose?.();
|
|
2923
|
-
if (urlQuery && name) urlQuery.removeQuery(`${name}-modal`, false);
|
|
2924
|
-
setTimeout(() => {
|
|
2925
|
-
dialogRef.current?.close();
|
|
2926
|
-
setIsOpenedLate(false);
|
|
2927
|
-
}, 0.2 * 1e3);
|
|
2928
|
-
}, [onClose, urlQuery, name]);
|
|
2929
|
-
const onKeyDown = useCallback6(
|
|
2930
|
-
(event) => {
|
|
2931
|
-
if (event.key === "Escape") {
|
|
2932
|
-
if (!withoutCloseButton) return;
|
|
2933
|
-
event.preventDefault();
|
|
2934
|
-
}
|
|
2935
|
-
},
|
|
2936
|
-
[withoutCloseButton]
|
|
2937
|
-
);
|
|
2938
|
-
useImperativeHandle(
|
|
2939
|
-
ref,
|
|
2940
|
-
() => {
|
|
2941
|
-
return {
|
|
2942
|
-
open: onClickOpen,
|
|
2943
|
-
close: onClickClose,
|
|
2944
|
-
isOpened
|
|
2945
|
-
};
|
|
2946
|
-
},
|
|
2947
|
-
[onClickOpen, onClickClose, isOpened]
|
|
2948
|
-
);
|
|
2949
|
-
return createPortal(
|
|
2950
|
-
/* @__PURE__ */ jsx12(
|
|
2951
|
-
DialogStylesElement,
|
|
2952
|
-
{
|
|
2953
|
-
theme,
|
|
2954
|
-
colorTheme,
|
|
2955
|
-
opacity: !isOpened ? 0 : 1,
|
|
2956
|
-
onClose: onClickClose,
|
|
2957
|
-
onKeyDown,
|
|
2958
|
-
ref: dialogRef,
|
|
2959
|
-
children: isOpenedLate ? /* @__PURE__ */ jsx12(
|
|
2960
|
-
Div_default.column,
|
|
2961
|
-
{
|
|
2962
|
-
position: "relative",
|
|
2963
|
-
width: "100%",
|
|
2964
|
-
maxWidth: maxWidth ?? app.contentMaxWidth / 1.3,
|
|
2965
|
-
minHeight: `calc(100% - ${theme.styles.space * 2}px)`,
|
|
2966
|
-
alignItems: "center",
|
|
2967
|
-
justifyContent: "center",
|
|
2968
|
-
marginBlock: theme.styles.space,
|
|
2969
|
-
marginInline: "auto",
|
|
2970
|
-
transform: `translateY(${theme.styles.space}px)`,
|
|
2971
|
-
transition: theme.styles.transition,
|
|
2972
|
-
animation: isOpened ? "fadeInAnimation 0.2s ease forwards" : "fadeOutAnimation 0.2s ease forwards",
|
|
2973
|
-
children: /* @__PURE__ */ jsxs8(
|
|
2974
|
-
Div_default,
|
|
2975
|
-
{
|
|
2976
|
-
position: "relative",
|
|
2977
|
-
width: "100%",
|
|
2978
|
-
minHeight: 32 + theme.styles.space * 2,
|
|
2979
|
-
backgroundColor: backgroundColor ?? theme.colors.backgroundBase,
|
|
2980
|
-
borderRadius: theme.styles.borderRadius * 2,
|
|
2981
|
-
padding: !title ? theme.styles.space : void 0,
|
|
2982
|
-
overflow,
|
|
2983
|
-
children: [
|
|
2984
|
-
title ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
2985
|
-
/* @__PURE__ */ jsxs8(
|
|
2986
|
-
Div_default.row,
|
|
2987
|
-
{
|
|
2988
|
-
alignItems: "center",
|
|
2989
|
-
gap: theme.styles.gap,
|
|
2990
|
-
backgroundColor: headerBackgroundColor,
|
|
2991
|
-
borderTopLeftRadius: theme.styles.borderRadius * 2 - 1,
|
|
2992
|
-
borderTopRightRadius: theme.styles.borderRadius * 2 - 1,
|
|
2993
|
-
paddingInline: theme.styles.space,
|
|
2994
|
-
paddingBlock: theme.styles.space,
|
|
2995
|
-
transition: theme.styles.transition,
|
|
2996
|
-
children: [
|
|
2997
|
-
/* @__PURE__ */ jsxs8(Div_default.column, { flex: 1, gap: theme.styles.gap / 2, children: [
|
|
2998
|
-
/* @__PURE__ */ jsx12(
|
|
2999
|
-
Text_default,
|
|
3000
|
-
{
|
|
3001
|
-
as: "h1",
|
|
3002
|
-
color: titleColor ?? theme.colors.textPrimary,
|
|
3003
|
-
transition: theme.styles.transition,
|
|
3004
|
-
children: title
|
|
3005
|
-
}
|
|
3006
|
-
),
|
|
3007
|
-
description && /* @__PURE__ */ jsx12(
|
|
3008
|
-
Text_default,
|
|
3009
|
-
{
|
|
3010
|
-
color: descriptionColor ?? theme.colors.textSecondary,
|
|
3011
|
-
transition: theme.styles.transition,
|
|
3012
|
-
children: description
|
|
3013
|
-
}
|
|
3014
|
-
)
|
|
3015
|
-
] }),
|
|
3016
|
-
!withoutCloseButton && /* @__PURE__ */ jsx12(
|
|
3017
|
-
Button_default.icon,
|
|
3018
|
-
{
|
|
3019
|
-
icon: "XMark",
|
|
3020
|
-
marginTop: 1,
|
|
3021
|
-
iconColor: titleColor,
|
|
3022
|
-
onClick: onClickClose,
|
|
3023
|
-
transition: theme.styles.transition,
|
|
3024
|
-
zIndex: 10
|
|
3025
|
-
}
|
|
3026
|
-
)
|
|
3027
|
-
]
|
|
3028
|
-
}
|
|
3029
|
-
),
|
|
3030
|
-
/* @__PURE__ */ jsx12(Divider_default.horizontal, {})
|
|
3031
|
-
] }) : /* @__PURE__ */ jsx12(Fragment2, { children: !withoutCloseButton && /* @__PURE__ */ jsx12(Div_default, { position: "absolute", top: theme.styles.space, right: theme.styles.space, zIndex: 10, children: /* @__PURE__ */ jsx12(Button_default.icon, { icon: "XMark", iconColor: titleColor, onClick: onClickClose }) }) }),
|
|
3032
|
-
/* @__PURE__ */ jsx12(Div_default, { padding: title ? theme.styles.space : void 0, children })
|
|
3033
|
-
]
|
|
3034
|
-
}
|
|
3035
|
-
)
|
|
3036
|
-
}
|
|
3037
|
-
) : void 0
|
|
3038
|
-
}
|
|
3039
|
-
),
|
|
3040
|
-
document.body
|
|
3041
|
-
);
|
|
3042
|
-
});
|
|
3043
|
-
ModalComponent.confirmation = forwardRef7(function Confirmation({ message, continueButtonText = "Continue", continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
|
|
3044
|
-
const theme = useTheme13();
|
|
3045
|
-
const modalRef = useRef3(null);
|
|
3046
|
-
const onCancelElement = useCallback6(() => {
|
|
3047
|
-
onCancel?.();
|
|
3048
|
-
modalRef.current?.close();
|
|
3049
|
-
}, [onCancel]);
|
|
3050
|
-
const onContinueElement = useCallback6(() => {
|
|
3051
|
-
onContinue?.();
|
|
3052
|
-
modalRef.current?.close();
|
|
3053
|
-
}, [onContinue]);
|
|
3054
|
-
useImperativeHandle(ref, () => modalRef.current, []);
|
|
3055
|
-
return /* @__PURE__ */ jsxs8(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
|
|
3056
|
-
/* @__PURE__ */ jsx12(Text_default, { color: theme.colors.textSecondary, children: message ?? "Do you really want to continue? This action may be irreversible." }),
|
|
3057
|
-
/* @__PURE__ */ jsxs8(
|
|
3058
|
-
Div_default.row,
|
|
3059
|
-
{
|
|
3060
|
-
alignItems: "center",
|
|
3061
|
-
justifyContent: "flex-end",
|
|
3062
|
-
gap: theme.styles.gap,
|
|
3063
|
-
marginTop: theme.styles.space * 2,
|
|
3064
|
-
children: [
|
|
3065
|
-
/* @__PURE__ */ jsx12(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
|
|
3066
|
-
/* @__PURE__ */ jsx12(Button_default, { text: continueButtonText, loaderName: continueButtonLoaderName, onClick: onContinueElement })
|
|
3067
|
-
]
|
|
3068
|
-
}
|
|
3069
|
-
)
|
|
3070
|
-
] });
|
|
3071
|
-
});
|
|
3072
|
-
ModalComponent.destructive = forwardRef7(function Destructive2({
|
|
3073
|
-
message,
|
|
3074
|
-
deleteButtonText = "Delete",
|
|
3075
|
-
deleteButtonIconName = "trash",
|
|
3076
|
-
deleteButtonLoaderName,
|
|
3077
|
-
onDelete,
|
|
3078
|
-
onCancel,
|
|
3079
|
-
...props
|
|
3080
|
-
}, ref) {
|
|
3081
|
-
const theme = useTheme13();
|
|
3082
|
-
const modalRef = useRef3(null);
|
|
3083
|
-
const onCancelElement = useCallback6(() => {
|
|
3084
|
-
onCancel?.();
|
|
3085
|
-
modalRef.current?.close();
|
|
3086
|
-
}, [onCancel]);
|
|
3087
|
-
const onDeleteElement = useCallback6(() => {
|
|
3088
|
-
onDelete?.();
|
|
3089
|
-
modalRef.current?.close();
|
|
3090
|
-
}, [onDelete]);
|
|
3091
|
-
useImperativeHandle(ref, () => modalRef.current, []);
|
|
3092
|
-
return /* @__PURE__ */ jsxs8(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
|
|
3093
|
-
/* @__PURE__ */ jsx12(Text_default, { color: theme.colors.textSecondary, children: message ?? "Do you really want to continue with the deleting of the item? This action may be irreversible." }),
|
|
3094
|
-
/* @__PURE__ */ jsxs8(
|
|
3095
|
-
Div_default.row,
|
|
3096
|
-
{
|
|
3097
|
-
alignItems: "center",
|
|
3098
|
-
justifyContent: "flex-end",
|
|
3099
|
-
gap: theme.styles.gap,
|
|
3100
|
-
marginTop: theme.styles.space * 2,
|
|
3101
|
-
children: [
|
|
3102
|
-
/* @__PURE__ */ jsx12(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
|
|
3103
|
-
/* @__PURE__ */ jsx12(
|
|
3104
|
-
Button_default.destructive,
|
|
3105
|
-
{
|
|
3106
|
-
icon: deleteButtonIconName,
|
|
3107
|
-
text: deleteButtonText,
|
|
3108
|
-
loaderName: deleteButtonLoaderName,
|
|
3109
|
-
onClick: onDeleteElement
|
|
3110
|
-
}
|
|
3111
|
-
)
|
|
3112
|
-
]
|
|
3113
|
-
}
|
|
3114
|
-
)
|
|
3115
|
-
] });
|
|
3116
|
-
});
|
|
3117
|
-
var Modal2 = memo12(ModalComponent);
|
|
3118
|
-
Modal2.confirmation = ModalComponent.confirmation;
|
|
3119
|
-
Modal2.destructive = ModalComponent.destructive;
|
|
3120
|
-
var Modal_default = Modal2;
|
|
3121
|
-
|
|
3122
3230
|
// src/components/PageHolder.tsx
|
|
3123
3231
|
import { forwardRef as forwardRef8, memo as memo13 } from "react";
|
|
3124
3232
|
import { useTheme as useTheme14 } from "react-better-core";
|
|
3125
3233
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3126
3234
|
var PageHolderComponent = forwardRef8(function PageHolder({ noMaxContentWidth, children, ...props }, ref) {
|
|
3127
|
-
const
|
|
3235
|
+
const theme2 = useTheme14();
|
|
3128
3236
|
const { app } = useBetterHtmlContextInternal();
|
|
3129
3237
|
return /* @__PURE__ */ jsx13(
|
|
3130
3238
|
Div_default,
|
|
@@ -3133,7 +3241,7 @@ var PageHolderComponent = forwardRef8(function PageHolder({ noMaxContentWidth, c
|
|
|
3133
3241
|
width: "100%",
|
|
3134
3242
|
maxWidth: !noMaxContentWidth ? app.contentMaxWidth : void 0,
|
|
3135
3243
|
margin: "0px auto",
|
|
3136
|
-
padding:
|
|
3244
|
+
padding: theme2.styles.space,
|
|
3137
3245
|
...props,
|
|
3138
3246
|
ref,
|
|
3139
3247
|
children
|
|
@@ -3152,7 +3260,7 @@ PageHolderComponent.center = forwardRef8(function Center({
|
|
|
3152
3260
|
children,
|
|
3153
3261
|
...props
|
|
3154
3262
|
}, ref) {
|
|
3155
|
-
const
|
|
3263
|
+
const theme2 = useTheme14();
|
|
3156
3264
|
const mediaQuery = useMediaQuery();
|
|
3157
3265
|
const { app } = useBetterHtmlContextInternal();
|
|
3158
3266
|
const breakingPoint = mediaQuery.size1000;
|
|
@@ -3186,10 +3294,10 @@ PageHolderComponent.center = forwardRef8(function Center({
|
|
|
3186
3294
|
/* @__PURE__ */ jsx13(Div_default.column, { position: "relative", width: `${withSideComponent ? 50 : 100}%`, alignItems: "center", zIndex: 2, children: /* @__PURE__ */ jsx13(
|
|
3187
3295
|
ContentTag,
|
|
3188
3296
|
{
|
|
3189
|
-
width: `calc(100% - ${
|
|
3297
|
+
width: `calc(100% - ${theme2.styles.space * 2}px)`,
|
|
3190
3298
|
maxWidth: !noMaxContentWidth ? contentMaxWidth ?? app.contentMaxWidth / 2 : void 0,
|
|
3191
|
-
marginInline:
|
|
3192
|
-
marginBlock:
|
|
3299
|
+
marginInline: theme2.styles.space,
|
|
3300
|
+
marginBlock: theme2.styles.space,
|
|
3193
3301
|
...props,
|
|
3194
3302
|
ref,
|
|
3195
3303
|
children
|
|
@@ -3232,7 +3340,7 @@ var ChipComponent = forwardRef9(function Chip({
|
|
|
3232
3340
|
onClickWithValue,
|
|
3233
3341
|
...props
|
|
3234
3342
|
}, ref) {
|
|
3235
|
-
const
|
|
3343
|
+
const theme2 = useTheme15();
|
|
3236
3344
|
const onClickElement = useCallback7(
|
|
3237
3345
|
(event) => {
|
|
3238
3346
|
onClick?.(event);
|
|
@@ -3244,23 +3352,23 @@ var ChipComponent = forwardRef9(function Chip({
|
|
|
3244
3352
|
Div_default,
|
|
3245
3353
|
{
|
|
3246
3354
|
width: "fit-content",
|
|
3247
|
-
backgroundColor: backgroundColor ??
|
|
3248
|
-
borderRadius: isCircle ? 999 : borderRadius ??
|
|
3249
|
-
paddingBlock:
|
|
3250
|
-
paddingInline:
|
|
3355
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundSecondary,
|
|
3356
|
+
borderRadius: isCircle ? 999 : borderRadius ?? theme2.styles.borderRadius / borderRadiusOffset,
|
|
3357
|
+
paddingBlock: theme2.styles.gap / 2,
|
|
3358
|
+
paddingInline: theme2.styles.space / 1.5,
|
|
3251
3359
|
filterHover: onClick || onClickWithValue ? filterHover().z1 : void 0,
|
|
3252
3360
|
onClick: onClickElement,
|
|
3253
3361
|
cursor: onClick || onClickWithValue ? "pointer" : void 0,
|
|
3254
3362
|
...props,
|
|
3255
3363
|
ref,
|
|
3256
|
-
children: /* @__PURE__ */ jsx14(Text_default, { color: color ??
|
|
3364
|
+
children: /* @__PURE__ */ jsx14(Text_default, { color: color ?? theme2.colors.textPrimary, children: text })
|
|
3257
3365
|
}
|
|
3258
3366
|
);
|
|
3259
3367
|
});
|
|
3260
3368
|
ChipComponent.colored = forwardRef9(function Colored({ color, withWhiteBackground, ...props }, ref) {
|
|
3261
|
-
const
|
|
3369
|
+
const theme2 = useTheme15();
|
|
3262
3370
|
const { colorTheme } = useBetterCoreContext6();
|
|
3263
|
-
const readyColor = color ??
|
|
3371
|
+
const readyColor = color ?? theme2.colors.textSecondary;
|
|
3264
3372
|
const chip = /* @__PURE__ */ jsx14(
|
|
3265
3373
|
ChipComponent,
|
|
3266
3374
|
{
|
|
@@ -3276,7 +3384,7 @@ ChipComponent.colored = forwardRef9(function Colored({ color, withWhiteBackgroun
|
|
|
3276
3384
|
{
|
|
3277
3385
|
width: "fit-content",
|
|
3278
3386
|
backgroundColor: withWhiteBackground ? colorTheme === "light" ? "#ffffff" : "#000000" : void 0,
|
|
3279
|
-
borderRadius: withWhiteBackground ? props.borderRadius ??
|
|
3387
|
+
borderRadius: withWhiteBackground ? props.borderRadius ?? theme2.styles.borderRadius / borderRadiusOffset + 0.3 : void 0,
|
|
3280
3388
|
children: chip
|
|
3281
3389
|
}
|
|
3282
3390
|
) : chip;
|
|
@@ -3303,7 +3411,7 @@ import { memo as memo15 } from "react";
|
|
|
3303
3411
|
import { useTheme as useTheme16 } from "react-better-core";
|
|
3304
3412
|
import { jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3305
3413
|
function Label({ text, required, isError, color, htmlFor }) {
|
|
3306
|
-
const
|
|
3414
|
+
const theme2 = useTheme16();
|
|
3307
3415
|
return /* @__PURE__ */ jsxs10(
|
|
3308
3416
|
Text_default,
|
|
3309
3417
|
{
|
|
@@ -3311,12 +3419,12 @@ function Label({ text, required, isError, color, htmlFor }) {
|
|
|
3311
3419
|
width: "fit-content",
|
|
3312
3420
|
height: 16,
|
|
3313
3421
|
fontSize: 14,
|
|
3314
|
-
color: isError ?
|
|
3422
|
+
color: isError ? theme2.colors.error : color ?? theme2.colors.textSecondary,
|
|
3315
3423
|
htmlFor,
|
|
3316
3424
|
"aria-required": required,
|
|
3317
3425
|
children: [
|
|
3318
3426
|
text,
|
|
3319
|
-
required && /* @__PURE__ */ jsxs10(Text_default, { as: "span", fontSize: 16, color:
|
|
3427
|
+
required && /* @__PURE__ */ jsxs10(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
|
|
3320
3428
|
" ",
|
|
3321
3429
|
"*"
|
|
3322
3430
|
] })
|
|
@@ -3366,7 +3474,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3366
3474
|
id,
|
|
3367
3475
|
...props
|
|
3368
3476
|
}, ref) {
|
|
3369
|
-
const
|
|
3477
|
+
const theme2 = useTheme17();
|
|
3370
3478
|
const inputFieldHolderRef = useRef4(null);
|
|
3371
3479
|
const buttonsRef = useRef4(null);
|
|
3372
3480
|
const inputRef = useRef4(null);
|
|
@@ -3496,12 +3604,12 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3496
3604
|
/* @__PURE__ */ jsx15(
|
|
3497
3605
|
Div_default,
|
|
3498
3606
|
{
|
|
3499
|
-
color: isDisabled ?
|
|
3500
|
-
backgroundColor: isSelected ?
|
|
3607
|
+
color: isDisabled ? theme2.colors.textSecondary + "80" : isSelected ? theme2.colors.base : theme2.colors.textPrimary,
|
|
3608
|
+
backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
3501
3609
|
filter: isFocused2 ? isDisabled ? "brightness(0.95)" : "brightness(0.9)" : void 0,
|
|
3502
3610
|
filterHover: focusedOptionIndex === void 0 && !isDisabled ? "brightness(0.9)" : void 0,
|
|
3503
3611
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
3504
|
-
padding: `${
|
|
3612
|
+
padding: `${theme2.styles.gap}px ${theme2.styles.space}px`,
|
|
3505
3613
|
value: option,
|
|
3506
3614
|
onClickWithValue: onClickOption,
|
|
3507
3615
|
onMouseMove: () => setFocusedOptionIndex(void 0),
|
|
@@ -3525,7 +3633,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3525
3633
|
filteredOptions,
|
|
3526
3634
|
value,
|
|
3527
3635
|
focusedOptionIndex,
|
|
3528
|
-
|
|
3636
|
+
theme2.colors,
|
|
3529
3637
|
onClickOption,
|
|
3530
3638
|
renderOption,
|
|
3531
3639
|
renderOptionDivider
|
|
@@ -3597,16 +3705,16 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3597
3705
|
Div_default,
|
|
3598
3706
|
{
|
|
3599
3707
|
width: "100%",
|
|
3600
|
-
backgroundColor:
|
|
3601
|
-
border: `solid 1px ${
|
|
3602
|
-
borderColor: isFocused ?
|
|
3708
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
3709
|
+
border: `solid 1px ${theme2.colors.border}`,
|
|
3710
|
+
borderColor: isFocused ? theme2.colors.primary : void 0,
|
|
3603
3711
|
borderBottom: "none",
|
|
3604
|
-
borderTopLeftRadius:
|
|
3605
|
-
borderTopRightRadius:
|
|
3606
|
-
paddingBlock:
|
|
3607
|
-
paddingInline: (
|
|
3608
|
-
transition:
|
|
3609
|
-
children: /* @__PURE__ */ jsx15(Div_default.row, { width: "100%", flexWrap: "wrap", gap:
|
|
3712
|
+
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
3713
|
+
borderTopRightRadius: theme2.styles.borderRadius,
|
|
3714
|
+
paddingBlock: theme2.styles.gap,
|
|
3715
|
+
paddingInline: (theme2.styles.space + theme2.styles.gap) / 2,
|
|
3716
|
+
transition: theme2.styles.transition,
|
|
3717
|
+
children: /* @__PURE__ */ jsx15(Div_default.row, { width: "100%", flexWrap: "wrap", gap: theme2.styles.gap, children: selectedOption.map((option) => {
|
|
3610
3718
|
const ChipComponentTag = !option.renderType || option.renderType === "default" || option.renderType === "chip" ? Chip_default : option.renderType === "chip.colored" ? Chip_default.colored : Chip_default;
|
|
3611
3719
|
return /* @__PURE__ */ createElement2(
|
|
3612
3720
|
ChipComponentTag,
|
|
@@ -3629,21 +3737,21 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3629
3737
|
left: 0,
|
|
3630
3738
|
width: "100%",
|
|
3631
3739
|
maxHeight: 300,
|
|
3632
|
-
backgroundColor:
|
|
3633
|
-
border: `1px solid ${isFocused ?
|
|
3740
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
3741
|
+
border: `1px solid ${isFocused ? theme2.colors.primary : theme2.colors.border}`,
|
|
3634
3742
|
borderTop: "none",
|
|
3635
|
-
borderBottomLeftRadius:
|
|
3636
|
-
borderBottomRightRadius:
|
|
3743
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
3744
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
3637
3745
|
boxShadow: "0px 10px 20px #00000020",
|
|
3638
3746
|
zIndex: 1e3,
|
|
3639
3747
|
overflowY: "auto",
|
|
3640
3748
|
opacity: !isOpen ? 0 : void 0,
|
|
3641
3749
|
pointerEvents: !isOpen ? "none" : void 0,
|
|
3642
3750
|
transform: `translateY(${!isOpen ? -10 : 0}px)`,
|
|
3643
|
-
transition:
|
|
3751
|
+
transition: theme2.styles.transition,
|
|
3644
3752
|
role: "listbox",
|
|
3645
3753
|
"aria-label": label,
|
|
3646
|
-
children: isLoadingDebouncedSearchQuery || debounceIsLoading ? /* @__PURE__ */ jsx15(Div_default, { padding: `${
|
|
3754
|
+
children: isLoadingDebouncedSearchQuery || debounceIsLoading ? /* @__PURE__ */ jsx15(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx15(Loader_default.text, {}) }) : filteredOptions.length ? /* @__PURE__ */ jsx15(Fragment4, { children: (withoutRenderingOptionsWhenClosed ? isOpen || isOpenLate : true) ? renderedOptions : void 0 }) : /* @__PURE__ */ jsx15(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx15(Text_default.unknown, { textAlign: "left", children: debounceMinimumSymbolsRequired !== void 0 && searchQuery.length < debounceMinimumSymbolsRequired ? `Enter at least ${debounceMinimumSymbolsRequired} characters` : "No options" }) })
|
|
3647
3755
|
}
|
|
3648
3756
|
),
|
|
3649
3757
|
/* @__PURE__ */ jsxs11(
|
|
@@ -3651,9 +3759,9 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3651
3759
|
{
|
|
3652
3760
|
position: "absolute",
|
|
3653
3761
|
top: 46 / 2,
|
|
3654
|
-
right:
|
|
3762
|
+
right: theme2.styles.space + 1,
|
|
3655
3763
|
alignItems: "center",
|
|
3656
|
-
gap:
|
|
3764
|
+
gap: theme2.styles.gap,
|
|
3657
3765
|
transform: "translateY(-50%)",
|
|
3658
3766
|
pointerEvents: "none",
|
|
3659
3767
|
filter: disabled ? "brightness(0.9)" : void 0,
|
|
@@ -3680,9 +3788,9 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3680
3788
|
name: "chevronDown",
|
|
3681
3789
|
position: "relative",
|
|
3682
3790
|
size: 16,
|
|
3683
|
-
color:
|
|
3791
|
+
color: theme2.colors.textSecondary,
|
|
3684
3792
|
transform: `rotate(${isOpen ? 180 : 0}deg)`,
|
|
3685
|
-
transition:
|
|
3793
|
+
transition: theme2.styles.transition,
|
|
3686
3794
|
pointerEvents: "none",
|
|
3687
3795
|
"aria-hidden": true
|
|
3688
3796
|
}
|
|
@@ -3703,9 +3811,9 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
3703
3811
|
) });
|
|
3704
3812
|
});
|
|
3705
3813
|
DropdownComponent.countries = forwardRef10(function Countries({ ...props }, ref) {
|
|
3706
|
-
const
|
|
3814
|
+
const theme2 = useTheme17();
|
|
3707
3815
|
const renderOption = useCallback8(
|
|
3708
|
-
(option, index, isSelected) => /* @__PURE__ */ jsxs11(Div_default.row, { alignItems: "center", gap:
|
|
3816
|
+
(option, index, isSelected) => /* @__PURE__ */ jsxs11(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
3709
3817
|
/* @__PURE__ */ jsx15(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
|
|
3710
3818
|
/* @__PURE__ */ jsx15(Text_default, { children: option.label })
|
|
3711
3819
|
] }),
|
|
@@ -3792,7 +3900,7 @@ var SelectComponent = styled9.select.withConfig({
|
|
|
3792
3900
|
opacity: 0;
|
|
3793
3901
|
`;
|
|
3794
3902
|
function Calendar({ value, minDate, maxDate, onChange }) {
|
|
3795
|
-
const
|
|
3903
|
+
const theme2 = useTheme18();
|
|
3796
3904
|
const internalYearSelectId = useId();
|
|
3797
3905
|
const [currentDate, setCurrentDate] = useState6(value ? new Date(value) : void 0);
|
|
3798
3906
|
const [currentMonth, setCurrentMonth] = useState6(currentDate?.getMonth() ?? (/* @__PURE__ */ new Date()).getMonth());
|
|
@@ -3856,7 +3964,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3856
3964
|
setCurrentMonth(date.getMonth());
|
|
3857
3965
|
setCurrentYear(date.getFullYear());
|
|
3858
3966
|
}, [value]);
|
|
3859
|
-
return /* @__PURE__ */ jsxs12(Div_default.column, { width: "100%", maxWidth: 320, gap:
|
|
3967
|
+
return /* @__PURE__ */ jsxs12(Div_default.column, { width: "100%", maxWidth: 320, gap: theme2.styles.gap, padding: theme2.styles.space / 2, userSelect: "none", children: [
|
|
3860
3968
|
/* @__PURE__ */ jsxs12(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
|
|
3861
3969
|
/* @__PURE__ */ jsx16(Button_default.icon, { icon: "chevronLeft", onClick: onClickPreviousMonthButton }),
|
|
3862
3970
|
/* @__PURE__ */ jsxs12(Div_default.row, { alignItems: "center", gap: 4, children: [
|
|
@@ -3867,7 +3975,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3867
3975
|
/* @__PURE__ */ jsx16(
|
|
3868
3976
|
SelectComponent,
|
|
3869
3977
|
{
|
|
3870
|
-
theme,
|
|
3978
|
+
theme: theme2,
|
|
3871
3979
|
value: currentYear,
|
|
3872
3980
|
onChange: onChangeYearSelect,
|
|
3873
3981
|
id: internalYearSelectId,
|
|
@@ -3878,7 +3986,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3878
3986
|
] }),
|
|
3879
3987
|
/* @__PURE__ */ jsx16(Button_default.icon, { icon: "chevronRight", onClick: onClickNextMonthButton })
|
|
3880
3988
|
] }),
|
|
3881
|
-
/* @__PURE__ */ jsxs12(Div_default.grid, { width: "100%", gridTemplateColumns: "repeat(7, 1fr)", gap:
|
|
3989
|
+
/* @__PURE__ */ jsxs12(Div_default.grid, { width: "100%", gridTemplateColumns: "repeat(7, 1fr)", gap: theme2.styles.gap / 2, children: [
|
|
3882
3990
|
weekDaysIndex.map((day) => /* @__PURE__ */ jsx16(Div_default.row, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx16(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", children: getWeekDayName(day, true) }) }, day)),
|
|
3883
3991
|
days.map((day, index) => {
|
|
3884
3992
|
const thisDayDate = new Date(currentYear, currentMonth, day);
|
|
@@ -3894,11 +4002,11 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3894
4002
|
aspectRatio: "1",
|
|
3895
4003
|
alignItems: "center",
|
|
3896
4004
|
justifyContent: "center",
|
|
3897
|
-
backgroundColor: isSelected ?
|
|
4005
|
+
backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
3898
4006
|
filterHover: day && !isDisabled ? "brightness(0.9)" : void 0,
|
|
3899
|
-
border: `1px solid ${isToday ?
|
|
3900
|
-
borderRadius:
|
|
3901
|
-
padding:
|
|
4007
|
+
border: `1px solid ${isToday ? theme2.colors.primary : theme2.colors.primary + "00"}`,
|
|
4008
|
+
borderRadius: theme2.styles.borderRadius / 2,
|
|
4009
|
+
padding: theme2.styles.space / 2,
|
|
3902
4010
|
cursor: day ? !isDisabled ? "pointer" : "not-allowed" : void 0,
|
|
3903
4011
|
value: day,
|
|
3904
4012
|
onClickWithValue: !isDisabled ? onClickDay : void 0,
|
|
@@ -3908,7 +4016,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3908
4016
|
{
|
|
3909
4017
|
fontSize: 14,
|
|
3910
4018
|
textAlign: "center",
|
|
3911
|
-
color: isDisabled ?
|
|
4019
|
+
color: isDisabled ? theme2.colors.textSecondary + "80" : isSelected ? theme2.colors.base : isWeekend ? theme2.colors.textSecondary : void 0,
|
|
3912
4020
|
children: day
|
|
3913
4021
|
}
|
|
3914
4022
|
),
|
|
@@ -3920,7 +4028,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3920
4028
|
height: 1,
|
|
3921
4029
|
top: "50%",
|
|
3922
4030
|
left: "50%",
|
|
3923
|
-
backgroundColor:
|
|
4031
|
+
backgroundColor: theme2.colors.textSecondary,
|
|
3924
4032
|
borderRadius: 999,
|
|
3925
4033
|
transform: "translate(-50%, -50%) rotate(45deg)"
|
|
3926
4034
|
}
|
|
@@ -3937,8 +4045,8 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3937
4045
|
{
|
|
3938
4046
|
fontSize: 14,
|
|
3939
4047
|
textDecorationHover: "underline",
|
|
3940
|
-
color:
|
|
3941
|
-
colorHover:
|
|
4048
|
+
color: theme2.colors.textSecondary,
|
|
4049
|
+
colorHover: theme2.colors.textPrimary,
|
|
3942
4050
|
children: "Clear"
|
|
3943
4051
|
}
|
|
3944
4052
|
) }),
|
|
@@ -3947,8 +4055,8 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
3947
4055
|
{
|
|
3948
4056
|
fontSize: 14,
|
|
3949
4057
|
textDecorationHover: "underline",
|
|
3950
|
-
color:
|
|
3951
|
-
colorHover:
|
|
4058
|
+
color: theme2.colors.textSecondary,
|
|
4059
|
+
colorHover: theme2.colors.textPrimary,
|
|
3952
4060
|
children: "Today"
|
|
3953
4061
|
}
|
|
3954
4062
|
) })
|
|
@@ -4145,7 +4253,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4145
4253
|
id,
|
|
4146
4254
|
...props
|
|
4147
4255
|
}, ref) {
|
|
4148
|
-
const
|
|
4256
|
+
const theme2 = useTheme19();
|
|
4149
4257
|
const internalId = useId2();
|
|
4150
4258
|
const { colorTheme } = useBetterCoreContext7();
|
|
4151
4259
|
const [_, debouncedValue, setDebouncedValue] = useDebounceState2(
|
|
@@ -4179,7 +4287,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4179
4287
|
onChangeValue?.(debouncedValue);
|
|
4180
4288
|
}, [withDebounce, onChangeValue, debouncedValue]);
|
|
4181
4289
|
const readyId = id ?? internalId;
|
|
4182
|
-
return /* @__PURE__ */ jsxs13(Div_default.column, { width: "100%", gap:
|
|
4290
|
+
return /* @__PURE__ */ jsxs13(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, ...excludeStyle, children: [
|
|
4183
4291
|
label && /* @__PURE__ */ jsx17(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
|
|
4184
4292
|
/* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "stretch", width: "100%", children: [
|
|
4185
4293
|
prefix && /* @__PURE__ */ jsx17(
|
|
@@ -4187,12 +4295,12 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4187
4295
|
{
|
|
4188
4296
|
alignItems: "center",
|
|
4189
4297
|
justifyContent: "center",
|
|
4190
|
-
border: `1px solid ${
|
|
4298
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
4191
4299
|
borderRight: "none",
|
|
4192
|
-
backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(
|
|
4193
|
-
borderTopLeftRadius:
|
|
4194
|
-
borderBottomLeftRadius:
|
|
4195
|
-
paddingInline:
|
|
4300
|
+
backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) : lightenColor2(theme2.colors.backgroundContent, 0.1)),
|
|
4301
|
+
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
4302
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
4303
|
+
paddingInline: theme2.styles.space,
|
|
4196
4304
|
children: prefix
|
|
4197
4305
|
}
|
|
4198
4306
|
),
|
|
@@ -4205,7 +4313,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4205
4313
|
name: leftIcon,
|
|
4206
4314
|
position: "absolute",
|
|
4207
4315
|
top: (props.type === "date" || props.type === "time" || props.type === "datetime-local" ? 48 : 46) / 2,
|
|
4208
|
-
left:
|
|
4316
|
+
left: theme2.styles.space + 1,
|
|
4209
4317
|
transform: "translateY(-50%)",
|
|
4210
4318
|
pointerEvents: "none",
|
|
4211
4319
|
zIndex: leftIconZIndex
|
|
@@ -4214,7 +4322,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4214
4322
|
/* @__PURE__ */ jsx17(
|
|
4215
4323
|
InputElement,
|
|
4216
4324
|
{
|
|
4217
|
-
theme,
|
|
4325
|
+
theme: theme2,
|
|
4218
4326
|
withLeftIcon: leftIcon !== void 0,
|
|
4219
4327
|
withRightIcon: rightIcon !== void 0,
|
|
4220
4328
|
withPrefix: prefix !== void 0,
|
|
@@ -4237,7 +4345,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4237
4345
|
icon: rightIcon,
|
|
4238
4346
|
position: "absolute",
|
|
4239
4347
|
top: 46 / 2,
|
|
4240
|
-
right:
|
|
4348
|
+
right: theme2.styles.space + 1 - theme2.styles.space / 2,
|
|
4241
4349
|
transform: "translateY(-50%)",
|
|
4242
4350
|
onClick: onClickRightIcon
|
|
4243
4351
|
}
|
|
@@ -4247,7 +4355,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4247
4355
|
name: rightIcon,
|
|
4248
4356
|
position: "absolute",
|
|
4249
4357
|
top: 46 / 2,
|
|
4250
|
-
right:
|
|
4358
|
+
right: theme2.styles.space + 1,
|
|
4251
4359
|
transform: "translateY(-50%)",
|
|
4252
4360
|
pointerEvents: "none"
|
|
4253
4361
|
}
|
|
@@ -4260,12 +4368,12 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4260
4368
|
{
|
|
4261
4369
|
alignItems: "center",
|
|
4262
4370
|
justifyContent: "center",
|
|
4263
|
-
border: `1px solid ${
|
|
4371
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
4264
4372
|
borderLeft: "none",
|
|
4265
|
-
backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(
|
|
4266
|
-
borderTopRightRadius:
|
|
4267
|
-
borderBottomRightRadius:
|
|
4268
|
-
paddingInline:
|
|
4373
|
+
backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) : lightenColor2(theme2.colors.backgroundContent, 0.1)),
|
|
4374
|
+
borderTopRightRadius: theme2.styles.borderRadius,
|
|
4375
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
4376
|
+
paddingInline: theme2.styles.space,
|
|
4269
4377
|
children: suffix
|
|
4270
4378
|
}
|
|
4271
4379
|
)
|
|
@@ -4276,7 +4384,7 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
4276
4384
|
as: "span",
|
|
4277
4385
|
display: "block",
|
|
4278
4386
|
fontSize: 14,
|
|
4279
|
-
color: errorText ?
|
|
4387
|
+
color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
|
|
4280
4388
|
children: errorText || infoText
|
|
4281
4389
|
}
|
|
4282
4390
|
)
|
|
@@ -4296,7 +4404,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4296
4404
|
id,
|
|
4297
4405
|
...props
|
|
4298
4406
|
}, ref) {
|
|
4299
|
-
const
|
|
4407
|
+
const theme2 = useTheme19();
|
|
4300
4408
|
const internalId = useId2();
|
|
4301
4409
|
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
4302
4410
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
@@ -4309,7 +4417,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4309
4417
|
[onChange, onChangeValue]
|
|
4310
4418
|
);
|
|
4311
4419
|
const readyId = id ?? internalId;
|
|
4312
|
-
return /* @__PURE__ */ jsxs13(Div_default.column, { gap:
|
|
4420
|
+
return /* @__PURE__ */ jsxs13(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
4313
4421
|
label && /* @__PURE__ */ jsx17(Label_default, { text: label, required, isError: !!errorText, htmlFor: readyId }),
|
|
4314
4422
|
/* @__PURE__ */ jsxs13(Div_default, { position: "relative", width: "100%", children: [
|
|
4315
4423
|
leftIcon && /* @__PURE__ */ jsx17(
|
|
@@ -4318,7 +4426,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4318
4426
|
name: leftIcon,
|
|
4319
4427
|
position: "absolute",
|
|
4320
4428
|
top: 46 / 2,
|
|
4321
|
-
left:
|
|
4429
|
+
left: theme2.styles.space + 1,
|
|
4322
4430
|
transform: "translateY(-50%)",
|
|
4323
4431
|
pointerEvents: "none"
|
|
4324
4432
|
}
|
|
@@ -4326,7 +4434,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4326
4434
|
/* @__PURE__ */ jsx17(
|
|
4327
4435
|
TextareaElement,
|
|
4328
4436
|
{
|
|
4329
|
-
theme,
|
|
4437
|
+
theme: theme2,
|
|
4330
4438
|
withLeftIcon: leftIcon !== void 0,
|
|
4331
4439
|
withRightIcon: rightIcon !== void 0,
|
|
4332
4440
|
required,
|
|
@@ -4347,7 +4455,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4347
4455
|
icon: rightIcon,
|
|
4348
4456
|
position: "absolute",
|
|
4349
4457
|
top: 46 / 2,
|
|
4350
|
-
right:
|
|
4458
|
+
right: theme2.styles.space + 1 - theme2.styles.space / 2,
|
|
4351
4459
|
transform: "translateY(-50%)",
|
|
4352
4460
|
onClick: onClickRightIcon
|
|
4353
4461
|
}
|
|
@@ -4357,7 +4465,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4357
4465
|
name: rightIcon,
|
|
4358
4466
|
position: "absolute",
|
|
4359
4467
|
top: 46 / 2,
|
|
4360
|
-
right:
|
|
4468
|
+
right: theme2.styles.space + 1,
|
|
4361
4469
|
transform: "translateY(-50%)",
|
|
4362
4470
|
pointerEvents: "none"
|
|
4363
4471
|
}
|
|
@@ -4368,8 +4476,8 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
|
|
|
4368
4476
|
{
|
|
4369
4477
|
as: "span",
|
|
4370
4478
|
display: "block",
|
|
4371
|
-
marginTop:
|
|
4372
|
-
color: errorText ?
|
|
4479
|
+
marginTop: theme2.styles.gap / 2,
|
|
4480
|
+
color: errorText ? theme2.colors.error : props.labelColor ?? theme2.colors.textSecondary,
|
|
4373
4481
|
fontSize: 14,
|
|
4374
4482
|
children: errorText || infoText
|
|
4375
4483
|
}
|
|
@@ -4451,12 +4559,12 @@ InputFieldComponent.search = forwardRef11(function Search({ value, onChangeValue
|
|
|
4451
4559
|
);
|
|
4452
4560
|
});
|
|
4453
4561
|
InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, value, onChangeValue, labelColor, id, ...props }, ref) {
|
|
4454
|
-
const
|
|
4562
|
+
const theme2 = useTheme19();
|
|
4455
4563
|
const internalId = useId2();
|
|
4456
4564
|
const [dropdownValue, setDropdownValue] = useState7();
|
|
4457
4565
|
const [inputFieldValue, setInputFieldValue] = useState7(value?.toString() ?? "");
|
|
4458
4566
|
const renderOption = useCallback10(
|
|
4459
|
-
(option, index, isSelected) => /* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "center", gap:
|
|
4567
|
+
(option, index, isSelected) => /* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
4460
4568
|
/* @__PURE__ */ jsx17(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
|
|
4461
4569
|
/* @__PURE__ */ jsx17(Text_default, { children: option.label })
|
|
4462
4570
|
] }),
|
|
@@ -4508,7 +4616,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
4508
4616
|
setInputFieldValue(newValue.slice(country?.phoneNumberExtension.length + 1));
|
|
4509
4617
|
}, [value]);
|
|
4510
4618
|
const readyId = id ?? internalId;
|
|
4511
|
-
return /* @__PURE__ */ jsxs13(Div_default.column, { width: "100%", gap:
|
|
4619
|
+
return /* @__PURE__ */ jsxs13(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, children: [
|
|
4512
4620
|
label && /* @__PURE__ */ jsx17(
|
|
4513
4621
|
Label_default,
|
|
4514
4622
|
{
|
|
@@ -4554,7 +4662,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
4554
4662
|
] });
|
|
4555
4663
|
});
|
|
4556
4664
|
InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...props }, ref) {
|
|
4557
|
-
const
|
|
4665
|
+
const theme2 = useTheme19();
|
|
4558
4666
|
const holderRef = useRef5(null);
|
|
4559
4667
|
const isMobileIOS = isMobileDevice && getBrowser() === "safari";
|
|
4560
4668
|
const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps } = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
|
|
@@ -4576,9 +4684,9 @@ InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...pr
|
|
|
4576
4684
|
top: "100%",
|
|
4577
4685
|
left: 0,
|
|
4578
4686
|
width: "fit-content",
|
|
4579
|
-
backgroundColor:
|
|
4580
|
-
borderBottomLeftRadius:
|
|
4581
|
-
borderBottomRightRadius:
|
|
4687
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
4688
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
4689
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
4582
4690
|
boxShadow: "0px 10px 20px #00000020",
|
|
4583
4691
|
userSelect: "none",
|
|
4584
4692
|
...insideInputFieldComponentProps,
|
|
@@ -4593,7 +4701,7 @@ InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...pr
|
|
|
4593
4701
|
);
|
|
4594
4702
|
});
|
|
4595
4703
|
InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate, defaultDateAfterTimePick, defaultTimeAfterDatePick = "00:00", ...props }, ref) {
|
|
4596
|
-
const
|
|
4704
|
+
const theme2 = useTheme19();
|
|
4597
4705
|
const holderRef = useRef5(null);
|
|
4598
4706
|
const selectedHourRef = useRef5(null);
|
|
4599
4707
|
const selectedMinuteRef = useRef5(null);
|
|
@@ -4635,7 +4743,7 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
|
|
|
4635
4743
|
}, [isOpen]);
|
|
4636
4744
|
const valueHour = parseInt(internalValue?.toString().split("T")?.[1]?.split(":")?.[0]).toString();
|
|
4637
4745
|
const valueMinute = parseInt(internalValue?.toString().split("T")?.[1]?.split(":")?.[1]).toString();
|
|
4638
|
-
const topSpacing = 32 +
|
|
4746
|
+
const topSpacing = 32 + theme2.styles.space / 2 + theme2.styles.gap;
|
|
4639
4747
|
return /* @__PURE__ */ jsx17(
|
|
4640
4748
|
InputFieldComponent,
|
|
4641
4749
|
{
|
|
@@ -4647,32 +4755,32 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
|
|
|
4647
4755
|
top: "100%",
|
|
4648
4756
|
left: 0,
|
|
4649
4757
|
width: "fit-content",
|
|
4650
|
-
backgroundColor:
|
|
4651
|
-
borderBottomLeftRadius:
|
|
4652
|
-
borderBottomRightRadius:
|
|
4758
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
4759
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
4760
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
4653
4761
|
boxShadow: "0px 10px 20px #00000020",
|
|
4654
4762
|
overflow: "hidden",
|
|
4655
4763
|
userSelect: "none",
|
|
4656
4764
|
...insideInputFieldComponentProps,
|
|
4657
|
-
children: /* @__PURE__ */ jsxs13(Div_default.row, { gap:
|
|
4765
|
+
children: /* @__PURE__ */ jsxs13(Div_default.row, { gap: theme2.styles.space, children: [
|
|
4658
4766
|
/* @__PURE__ */ jsx17(Calendar_default, { value: internalValue, minDate, maxDate, onChange }),
|
|
4659
4767
|
/* @__PURE__ */ jsxs13(
|
|
4660
4768
|
Div_default.row,
|
|
4661
4769
|
{
|
|
4662
4770
|
height: 276,
|
|
4663
|
-
gap:
|
|
4771
|
+
gap: theme2.styles.gap / 2,
|
|
4664
4772
|
paddingTop: topSpacing,
|
|
4665
|
-
paddingBottom:
|
|
4666
|
-
paddingRight:
|
|
4773
|
+
paddingBottom: theme2.styles.space / 2,
|
|
4774
|
+
paddingRight: theme2.styles.space / 2,
|
|
4667
4775
|
children: [
|
|
4668
4776
|
/* @__PURE__ */ jsxs13(Div_default, { height: "100%", children: [
|
|
4669
|
-
/* @__PURE__ */ jsx17(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom:
|
|
4777
|
+
/* @__PURE__ */ jsx17(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom: theme2.styles.gap / 2, children: "H" }),
|
|
4670
4778
|
/* @__PURE__ */ jsx17(
|
|
4671
4779
|
Div_default,
|
|
4672
4780
|
{
|
|
4673
4781
|
className: "react-better-html-no-scrollbar",
|
|
4674
4782
|
width: buttonWidth,
|
|
4675
|
-
height: `calc(100% - ${16 +
|
|
4783
|
+
height: `calc(100% - ${16 + theme2.styles.gap / 2}px)`,
|
|
4676
4784
|
overflowY: "auto",
|
|
4677
4785
|
tabIndex: -1,
|
|
4678
4786
|
children: hours.map((hour) => {
|
|
@@ -4682,12 +4790,12 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
|
|
|
4682
4790
|
{
|
|
4683
4791
|
alignItems: "center",
|
|
4684
4792
|
justifyContent: "center",
|
|
4685
|
-
color: isSelected ?
|
|
4686
|
-
backgroundColor: isSelected ?
|
|
4687
|
-
borderRadius:
|
|
4793
|
+
color: isSelected ? theme2.colors.base : theme2.colors.textPrimary,
|
|
4794
|
+
backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
4795
|
+
borderRadius: theme2.styles.borderRadius / 2,
|
|
4688
4796
|
filterHover: "brightness(0.9)",
|
|
4689
4797
|
cursor: "pointer",
|
|
4690
|
-
padding: `${
|
|
4798
|
+
padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`,
|
|
4691
4799
|
value: hour,
|
|
4692
4800
|
onClickWithValue: onClickHour,
|
|
4693
4801
|
ref: isSelected ? selectedHourRef : void 0,
|
|
@@ -4700,13 +4808,13 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
|
|
|
4700
4808
|
)
|
|
4701
4809
|
] }),
|
|
4702
4810
|
/* @__PURE__ */ jsxs13(Div_default, { height: "100%", children: [
|
|
4703
|
-
/* @__PURE__ */ jsx17(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom:
|
|
4811
|
+
/* @__PURE__ */ jsx17(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom: theme2.styles.gap / 2, children: "M" }),
|
|
4704
4812
|
/* @__PURE__ */ jsx17(
|
|
4705
4813
|
Div_default,
|
|
4706
4814
|
{
|
|
4707
4815
|
className: "react-better-html-no-scrollbar",
|
|
4708
4816
|
width: buttonWidth,
|
|
4709
|
-
height: `calc(100% - ${16 +
|
|
4817
|
+
height: `calc(100% - ${16 + theme2.styles.gap / 2}px)`,
|
|
4710
4818
|
overflowY: "auto",
|
|
4711
4819
|
tabIndex: -1,
|
|
4712
4820
|
children: minutes.map((minute) => {
|
|
@@ -4716,12 +4824,12 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
|
|
|
4716
4824
|
{
|
|
4717
4825
|
alignItems: "center",
|
|
4718
4826
|
justifyContent: "center",
|
|
4719
|
-
color: isSelected ?
|
|
4720
|
-
backgroundColor: isSelected ?
|
|
4721
|
-
borderRadius:
|
|
4827
|
+
color: isSelected ? theme2.colors.base : theme2.colors.textPrimary,
|
|
4828
|
+
backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
4829
|
+
borderRadius: theme2.styles.borderRadius / 2,
|
|
4722
4830
|
filterHover: "brightness(0.9)",
|
|
4723
4831
|
cursor: "pointer",
|
|
4724
|
-
padding: `${
|
|
4832
|
+
padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`,
|
|
4725
4833
|
value: minute,
|
|
4726
4834
|
onClickWithValue: onClickMinute,
|
|
4727
4835
|
ref: isSelected ? selectedMinuteRef : void 0,
|
|
@@ -4747,7 +4855,7 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
|
|
|
4747
4855
|
);
|
|
4748
4856
|
});
|
|
4749
4857
|
InputFieldComponent.time = forwardRef11(function Time({ ...props }, ref) {
|
|
4750
|
-
const
|
|
4858
|
+
const theme2 = useTheme19();
|
|
4751
4859
|
const holderRef = useRef5(null);
|
|
4752
4860
|
const selectedHourRef = useRef5(null);
|
|
4753
4861
|
const selectedMinuteRef = useRef5(null);
|
|
@@ -4789,9 +4897,9 @@ InputFieldComponent.time = forwardRef11(function Time({ ...props }, ref) {
|
|
|
4789
4897
|
left: 0,
|
|
4790
4898
|
width: buttonWidth * 2 + 2,
|
|
4791
4899
|
height: 300,
|
|
4792
|
-
backgroundColor:
|
|
4793
|
-
borderBottomLeftRadius:
|
|
4794
|
-
borderBottomRightRadius:
|
|
4900
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
4901
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
4902
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
4795
4903
|
boxShadow: "0px 10px 20px #00000020",
|
|
4796
4904
|
overflowY: "auto",
|
|
4797
4905
|
userSelect: "none",
|
|
@@ -4812,11 +4920,11 @@ InputFieldComponent.time = forwardRef11(function Time({ ...props }, ref) {
|
|
|
4812
4920
|
{
|
|
4813
4921
|
alignItems: "center",
|
|
4814
4922
|
justifyContent: "center",
|
|
4815
|
-
color: isSelected ?
|
|
4816
|
-
backgroundColor: isSelected ?
|
|
4923
|
+
color: isSelected ? theme2.colors.base : theme2.colors.textPrimary,
|
|
4924
|
+
backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
4817
4925
|
filterHover: "brightness(0.9)",
|
|
4818
4926
|
cursor: "pointer",
|
|
4819
|
-
padding: `${
|
|
4927
|
+
padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`,
|
|
4820
4928
|
value: hour,
|
|
4821
4929
|
onClickWithValue: onClickHour,
|
|
4822
4930
|
ref: isSelected ? selectedHourRef : void 0,
|
|
@@ -4842,11 +4950,11 @@ InputFieldComponent.time = forwardRef11(function Time({ ...props }, ref) {
|
|
|
4842
4950
|
{
|
|
4843
4951
|
alignItems: "center",
|
|
4844
4952
|
justifyContent: "center",
|
|
4845
|
-
color: isSelected ?
|
|
4846
|
-
backgroundColor: isSelected ?
|
|
4953
|
+
color: isSelected ? theme2.colors.base : theme2.colors.textPrimary,
|
|
4954
|
+
backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
4847
4955
|
filterHover: "brightness(0.9)",
|
|
4848
4956
|
cursor: "pointer",
|
|
4849
|
-
padding: `${
|
|
4957
|
+
padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`,
|
|
4850
4958
|
value: minute,
|
|
4851
4959
|
onClickWithValue: onClickMinute,
|
|
4852
4960
|
ref: isSelected ? selectedMinuteRef : void 0,
|
|
@@ -5031,7 +5139,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5031
5139
|
id,
|
|
5032
5140
|
...props
|
|
5033
5141
|
}, ref) {
|
|
5034
|
-
const
|
|
5142
|
+
const theme2 = useTheme20();
|
|
5035
5143
|
const internalId = useId3();
|
|
5036
5144
|
const { style, hoverStyle, excludeStyle, restProps } = useComponentPropsGrouper(props, true);
|
|
5037
5145
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
@@ -5052,14 +5160,14 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5052
5160
|
onChange?.(newIsChecked, value);
|
|
5053
5161
|
}, [checked, controlledChecked, onChange, value]);
|
|
5054
5162
|
const readyId = id ?? internalId;
|
|
5055
|
-
return /* @__PURE__ */ jsxs14(Div_default.column, { gap:
|
|
5163
|
+
return /* @__PURE__ */ jsxs14(Div_default.column, { gap: theme2.styles.gap, ...excludeStyle, children: [
|
|
5056
5164
|
label && /* @__PURE__ */ jsx18(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
|
|
5057
|
-
/* @__PURE__ */ jsxs14(Div_default.row, { alignItems: "center", gap:
|
|
5165
|
+
/* @__PURE__ */ jsxs14(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
5058
5166
|
/* @__PURE__ */ jsxs14(Div_default.row, { position: "relative", alignItems: "center", children: [
|
|
5059
5167
|
/* @__PURE__ */ jsx18(
|
|
5060
5168
|
InputElement2,
|
|
5061
5169
|
{
|
|
5062
|
-
theme,
|
|
5170
|
+
theme: theme2,
|
|
5063
5171
|
type: props.type ?? "checkbox",
|
|
5064
5172
|
checked,
|
|
5065
5173
|
onChange: onChangeElement,
|
|
@@ -5078,12 +5186,12 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5078
5186
|
position: "absolute",
|
|
5079
5187
|
top: "50%",
|
|
5080
5188
|
left: "50%",
|
|
5081
|
-
color:
|
|
5189
|
+
color: theme2.colors.base,
|
|
5082
5190
|
size: 14,
|
|
5083
5191
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
5084
5192
|
opacity: checked ? 1 : 0,
|
|
5085
5193
|
pointerEvents: "none",
|
|
5086
|
-
transition:
|
|
5194
|
+
transition: theme2.styles.transition
|
|
5087
5195
|
}
|
|
5088
5196
|
) : props.type === "radio" ? /* @__PURE__ */ jsx18(
|
|
5089
5197
|
Div_default,
|
|
@@ -5093,7 +5201,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5093
5201
|
height: 10,
|
|
5094
5202
|
top: "50%",
|
|
5095
5203
|
left: "50%",
|
|
5096
|
-
backgroundColor:
|
|
5204
|
+
backgroundColor: theme2.colors.base,
|
|
5097
5205
|
borderRadius: 999,
|
|
5098
5206
|
transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
|
|
5099
5207
|
opacity: checked ? 1 : 0,
|
|
@@ -5103,13 +5211,13 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5103
5211
|
] }),
|
|
5104
5212
|
text ? /* @__PURE__ */ jsxs14(Text_default, { color, userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
|
|
5105
5213
|
text,
|
|
5106
|
-
required && !label && /* @__PURE__ */ jsxs14(Text_default, { as: "span", fontSize: 16, color:
|
|
5214
|
+
required && !label && /* @__PURE__ */ jsxs14(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
|
|
5107
5215
|
" ",
|
|
5108
5216
|
"*"
|
|
5109
5217
|
] })
|
|
5110
5218
|
] }) : textAdvanced ? /* @__PURE__ */ jsxs14(Div_default.row, { userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
|
|
5111
5219
|
textAdvanced,
|
|
5112
|
-
required && !label && /* @__PURE__ */ jsxs14(Text_default, { as: "span", fontSize: 16, color:
|
|
5220
|
+
required && !label && /* @__PURE__ */ jsxs14(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, marginLeft: 4, children: [
|
|
5113
5221
|
" ",
|
|
5114
5222
|
"*"
|
|
5115
5223
|
] })
|
|
@@ -5121,7 +5229,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5121
5229
|
as: "span",
|
|
5122
5230
|
display: "block",
|
|
5123
5231
|
fontSize: 14,
|
|
5124
|
-
color: errorText ?
|
|
5232
|
+
color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
|
|
5125
5233
|
children: errorText || infoText
|
|
5126
5234
|
}
|
|
5127
5235
|
)
|
|
@@ -5147,7 +5255,7 @@ var ToggleInput_default = {
|
|
|
5147
5255
|
id,
|
|
5148
5256
|
...props
|
|
5149
5257
|
}, ref) {
|
|
5150
|
-
const
|
|
5258
|
+
const theme2 = useTheme20();
|
|
5151
5259
|
const internalId = useId3();
|
|
5152
5260
|
const { style, hoverStyle, excludeStyle, restProps } = useComponentPropsGrouper(props, true);
|
|
5153
5261
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
@@ -5162,13 +5270,13 @@ var ToggleInput_default = {
|
|
|
5162
5270
|
onChange?.(newIsChecked, value);
|
|
5163
5271
|
}, [disabled, checked, onChange, controlledChecked, value]);
|
|
5164
5272
|
const readyId = id ?? internalId;
|
|
5165
|
-
return /* @__PURE__ */ jsxs14(Div_default.column, { width: "fit-content", gap:
|
|
5273
|
+
return /* @__PURE__ */ jsxs14(Div_default.column, { width: "fit-content", gap: theme2.styles.gap, ...excludeStyle, children: [
|
|
5166
5274
|
label && /* @__PURE__ */ jsx18(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
|
|
5167
5275
|
/* @__PURE__ */ jsx18(
|
|
5168
5276
|
Div_default.row,
|
|
5169
5277
|
{
|
|
5170
5278
|
alignItems: "center",
|
|
5171
|
-
gap:
|
|
5279
|
+
gap: theme2.styles.gap,
|
|
5172
5280
|
borderRadius: 999,
|
|
5173
5281
|
isTabAccessed: true,
|
|
5174
5282
|
onClick: onClickElement,
|
|
@@ -5181,7 +5289,7 @@ var ToggleInput_default = {
|
|
|
5181
5289
|
children: /* @__PURE__ */ jsx18(
|
|
5182
5290
|
SwitchElement,
|
|
5183
5291
|
{
|
|
5184
|
-
theme,
|
|
5292
|
+
theme: theme2,
|
|
5185
5293
|
checked,
|
|
5186
5294
|
disabled: disabled ?? false,
|
|
5187
5295
|
isMouseDown,
|
|
@@ -5204,7 +5312,7 @@ var ToggleInput_default = {
|
|
|
5204
5312
|
as: "span",
|
|
5205
5313
|
display: "block",
|
|
5206
5314
|
fontSize: 14,
|
|
5207
|
-
color: errorText ?
|
|
5315
|
+
color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
|
|
5208
5316
|
children: errorText || infoText
|
|
5209
5317
|
}
|
|
5210
5318
|
)
|
|
@@ -5239,7 +5347,7 @@ var FormComponent = forwardRef13(function Form({
|
|
|
5239
5347
|
children,
|
|
5240
5348
|
...props
|
|
5241
5349
|
}, ref) {
|
|
5242
|
-
const
|
|
5350
|
+
const theme2 = useTheme21();
|
|
5243
5351
|
const submitButtonIsDisabledInternal = useMemo7(() => {
|
|
5244
5352
|
if (!form || !form.requiredFields) return false;
|
|
5245
5353
|
return Object.entries(form.values).some(
|
|
@@ -5249,7 +5357,7 @@ var FormComponent = forwardRef13(function Form({
|
|
|
5249
5357
|
const SubmitButtonTag = isDestructive ? Button_default.destructive : Button_default;
|
|
5250
5358
|
const submitButtonIsDisabledFinal = submitButtonIsDisabled || submitButtonIsDisabledInternal;
|
|
5251
5359
|
return /* @__PURE__ */ jsx19(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs15("form", { name, onSubmit: onSubmit ?? form?.onSubmit, ref, children: [
|
|
5252
|
-
gap !== void 0 || withDividers ? /* @__PURE__ */ jsx19(Div_default.column, { gap: gap ?? (withDividers ?
|
|
5360
|
+
gap !== void 0 || withDividers ? /* @__PURE__ */ jsx19(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
5253
5361
|
child,
|
|
5254
5362
|
index < Children.toArray(children).length - 1 && /* @__PURE__ */ jsx19(Divider_default.horizontal, {})
|
|
5255
5363
|
] }, index)) : children }) : children,
|
|
@@ -5258,8 +5366,8 @@ var FormComponent = forwardRef13(function Form({
|
|
|
5258
5366
|
{
|
|
5259
5367
|
alignItems: "center",
|
|
5260
5368
|
justifyContent: actionButtonsLocation === "left" ? "flex-start" : actionButtonsLocation === "center" ? "center" : "flex-end",
|
|
5261
|
-
gap:
|
|
5262
|
-
marginTop:
|
|
5369
|
+
gap: theme2.styles.gap,
|
|
5370
|
+
marginTop: theme2.styles.space,
|
|
5263
5371
|
children: [
|
|
5264
5372
|
renderActionButtons,
|
|
5265
5373
|
onClickCancel && /* @__PURE__ */ jsx19(
|
|
@@ -5297,10 +5405,10 @@ import { forwardRef as forwardRef14, memo as memo20 } from "react";
|
|
|
5297
5405
|
import { useTheme as useTheme22 } from "react-better-core";
|
|
5298
5406
|
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5299
5407
|
var FormRowComponent = forwardRef14(function FormRow({ oneItemOnly, noBreakingPoint, asColumn, gap, children, ...props }, ref) {
|
|
5300
|
-
const
|
|
5408
|
+
const theme2 = useTheme22();
|
|
5301
5409
|
const mediaQuery = useMediaQuery();
|
|
5302
5410
|
const breakingPoint = asColumn ?? (!noBreakingPoint ? mediaQuery.size900 : false);
|
|
5303
|
-
const readyGap = breakingPoint || noBreakingPoint && mediaQuery.size900 ?
|
|
5411
|
+
const readyGap = breakingPoint || noBreakingPoint && mediaQuery.size900 ? theme2.styles.gap : theme2.styles.space * 2;
|
|
5304
5412
|
return /* @__PURE__ */ jsxs16(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
|
|
5305
5413
|
children,
|
|
5306
5414
|
oneItemOnly && /* @__PURE__ */ jsx20(Div_default, { width: "100%" })
|
|
@@ -5324,21 +5432,21 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
|
|
|
5324
5432
|
children,
|
|
5325
5433
|
...props
|
|
5326
5434
|
}, ref) {
|
|
5327
|
-
const
|
|
5435
|
+
const theme2 = useTheme22();
|
|
5328
5436
|
const mediaQuery = useMediaQuery();
|
|
5329
|
-
const titleGap =
|
|
5437
|
+
const titleGap = theme2.styles.space;
|
|
5330
5438
|
return /* @__PURE__ */ jsxs16(FormRowComponent, { ...props, ref, children: [
|
|
5331
5439
|
/* @__PURE__ */ jsxs16(Div_default.row, { width: "100%", alignItems: "center", gap: titleGap, children: [
|
|
5332
5440
|
icon && /* @__PURE__ */ jsx20(Icon_default, { name: icon }),
|
|
5333
|
-
/* @__PURE__ */ jsxs16(Div_default.column, { flex: 1, gap:
|
|
5441
|
+
/* @__PURE__ */ jsxs16(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
5334
5442
|
/* @__PURE__ */ jsxs16(Text_default, { as: titleAs, fontSize: titleFontSize, children: [
|
|
5335
5443
|
title,
|
|
5336
|
-
required && /* @__PURE__ */ jsxs16(Text_default, { as: "span", fontSize: 16, color:
|
|
5444
|
+
required && /* @__PURE__ */ jsxs16(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
|
|
5337
5445
|
" ",
|
|
5338
5446
|
"*"
|
|
5339
5447
|
] })
|
|
5340
5448
|
] }),
|
|
5341
|
-
description && /* @__PURE__ */ jsx20(Text_default, { fontSize: descriptionFontSize, color:
|
|
5449
|
+
description && /* @__PURE__ */ jsx20(Text_default, { fontSize: descriptionFontSize, color: theme2.colors.textSecondary, children: description })
|
|
5342
5450
|
] }),
|
|
5343
5451
|
isLoading && /* @__PURE__ */ jsx20(Div_default, { width: 26 - titleGap })
|
|
5344
5452
|
] }),
|
|
@@ -5349,14 +5457,14 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
|
|
|
5349
5457
|
width: props.noBreakingPoint && mediaQuery.size900 ? void 0 : "100%",
|
|
5350
5458
|
alignItems: "center",
|
|
5351
5459
|
justifyContent: alignChildren,
|
|
5352
|
-
gap:
|
|
5460
|
+
gap: theme2.styles.gap,
|
|
5353
5461
|
children: [
|
|
5354
5462
|
/* @__PURE__ */ jsx20(
|
|
5355
5463
|
Div_default,
|
|
5356
5464
|
{
|
|
5357
5465
|
position: "absolute",
|
|
5358
5466
|
top: "50%",
|
|
5359
|
-
right: `calc(100% + ${
|
|
5467
|
+
right: `calc(100% + ${theme2.styles.space}px)`,
|
|
5360
5468
|
transform: "translateY(-50%)",
|
|
5361
5469
|
opacity: !isLoading ? 0 : void 0,
|
|
5362
5470
|
pointerEvents: !isLoading ? "none" : void 0,
|
|
@@ -5364,7 +5472,7 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
|
|
|
5364
5472
|
}
|
|
5365
5473
|
),
|
|
5366
5474
|
children,
|
|
5367
|
-
withActions && /* @__PURE__ */ jsxs16(Div_default.row, { alignItems: "center", gap:
|
|
5475
|
+
withActions && /* @__PURE__ */ jsxs16(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
5368
5476
|
onClickReset && /* @__PURE__ */ jsx20(Button_default.icon, { icon: "XMark", loaderName: resetButtonLoaderName, onClick: onClickReset }),
|
|
5369
5477
|
/* @__PURE__ */ jsx20(Button_default.icon, { icon: "check", loaderName: saveButtonLoaderName, onClick: onClickSave })
|
|
5370
5478
|
] })
|
|
@@ -5420,8 +5528,8 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
|
|
|
5420
5528
|
);
|
|
5421
5529
|
};
|
|
5422
5530
|
ColorThemeSwitchComponent.withText = function WithText({ withMoon, className, ...props }) {
|
|
5423
|
-
const
|
|
5424
|
-
return /* @__PURE__ */ jsxs17(Div_default.row, { width: "fit-content", alignItems: "center", gap:
|
|
5531
|
+
const theme2 = useTheme23();
|
|
5532
|
+
return /* @__PURE__ */ jsxs17(Div_default.row, { width: "fit-content", alignItems: "center", gap: theme2.styles.gap, userSelect: "none", ...props, children: [
|
|
5425
5533
|
/* @__PURE__ */ jsx21(Text_default, { children: "Light" }),
|
|
5426
5534
|
/* @__PURE__ */ jsx21(ColorThemeSwitchComponent, { withMoon, className }),
|
|
5427
5535
|
/* @__PURE__ */ jsx21(Text_default, { children: "Dark" })
|
|
@@ -5460,7 +5568,7 @@ var PaginationComponent = function Pagination({
|
|
|
5460
5568
|
onClickNextPage,
|
|
5461
5569
|
onChangePage
|
|
5462
5570
|
}) {
|
|
5463
|
-
const
|
|
5571
|
+
const theme2 = useTheme24();
|
|
5464
5572
|
const mediaQuery = useMediaQuery();
|
|
5465
5573
|
const [currentPageInternal, setCurrentPage] = useState10(currentPage);
|
|
5466
5574
|
const pageCountInternal = pageCount ?? (itemsPerPage !== void 0 ? Math.ceil(itemsLength / itemsPerPage) : 1);
|
|
@@ -5496,7 +5604,7 @@ var PaginationComponent = function Pagination({
|
|
|
5496
5604
|
setCurrentPage(currentPage);
|
|
5497
5605
|
}, [currentPage]);
|
|
5498
5606
|
const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages2 / 1.4;
|
|
5499
|
-
return /* @__PURE__ */ jsxs18(Div_default.row, { alignItems: "center", justifyContent: "center", gap:
|
|
5607
|
+
return /* @__PURE__ */ jsxs18(Div_default.row, { alignItems: "center", justifyContent: "center", gap: theme2.styles.gap * 2, children: [
|
|
5500
5608
|
pageCountInternal > maximumVisiblePages2 && /* @__PURE__ */ jsx22(
|
|
5501
5609
|
Button_default.icon,
|
|
5502
5610
|
{
|
|
@@ -5513,7 +5621,7 @@ var PaginationComponent = function Pagination({
|
|
|
5513
5621
|
alignItems: "center",
|
|
5514
5622
|
justifyContent: "center",
|
|
5515
5623
|
flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
|
|
5516
|
-
gap:
|
|
5624
|
+
gap: theme2.styles.gap,
|
|
5517
5625
|
children: paginationItems.map((pageIndex) => {
|
|
5518
5626
|
const isActive = currentPageInternal === pageIndex;
|
|
5519
5627
|
return /* @__PURE__ */ jsx22(
|
|
@@ -5527,8 +5635,8 @@ var PaginationComponent = function Pagination({
|
|
|
5527
5635
|
Text_default,
|
|
5528
5636
|
{
|
|
5529
5637
|
fontWeight: isActive ? 700 : 400,
|
|
5530
|
-
color: isActive ?
|
|
5531
|
-
transition:
|
|
5638
|
+
color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
5639
|
+
transition: theme2.styles.transition,
|
|
5532
5640
|
children: pageIndex
|
|
5533
5641
|
}
|
|
5534
5642
|
)
|
|
@@ -5730,7 +5838,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
5730
5838
|
onChangeFilterDataValue,
|
|
5731
5839
|
...props
|
|
5732
5840
|
}, ref) {
|
|
5733
|
-
const
|
|
5841
|
+
const theme2 = useTheme25();
|
|
5734
5842
|
const mediaQuery = useMediaQuery();
|
|
5735
5843
|
const { colorTheme } = useBetterCoreContext8();
|
|
5736
5844
|
const filterModalRef = useRef6(null);
|
|
@@ -5794,7 +5902,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
5794
5902
|
}
|
|
5795
5903
|
case "image": {
|
|
5796
5904
|
const imageProps = (typeof column.getImageProps === "function" ? column.getImageProps?.(item, itemIndex) : column.getImageProps) ?? {};
|
|
5797
|
-
return /* @__PURE__ */ jsx23(Image_default, { width: "100%", borderRadius:
|
|
5905
|
+
return /* @__PURE__ */ jsx23(Image_default, { width: "100%", borderRadius: theme2.styles.borderRadius / 2, ...imageProps });
|
|
5798
5906
|
}
|
|
5799
5907
|
case "checkbox": {
|
|
5800
5908
|
const { onChange, ...toggleInputProps } = (typeof column.getToggleInputProps === "function" ? column.getToggleInputProps?.(item, itemIndex) : column.getToggleInputProps) ?? {};
|
|
@@ -5825,7 +5933,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
5825
5933
|
{
|
|
5826
5934
|
name: "chevronDown",
|
|
5827
5935
|
transform: `rotate(${expandedRows[itemIndex] ? 180 : 0}deg)`,
|
|
5828
|
-
transition:
|
|
5936
|
+
transition: theme2.styles.transition
|
|
5829
5937
|
}
|
|
5830
5938
|
) });
|
|
5831
5939
|
}
|
|
@@ -5834,7 +5942,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
5834
5942
|
}
|
|
5835
5943
|
}
|
|
5836
5944
|
},
|
|
5837
|
-
[
|
|
5945
|
+
[theme2, checkedItems, expandedRows]
|
|
5838
5946
|
);
|
|
5839
5947
|
const onClickRowElement = useCallback14(
|
|
5840
5948
|
(item, index) => {
|
|
@@ -6091,8 +6199,8 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6091
6199
|
/* @__PURE__ */ jsx23(
|
|
6092
6200
|
Div_default,
|
|
6093
6201
|
{
|
|
6094
|
-
border: `1px solid ${
|
|
6095
|
-
borderRadius:
|
|
6202
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
6203
|
+
borderRadius: theme2.styles.borderRadius * 2,
|
|
6096
6204
|
overflow: !containsOverflowComponents ? "auto" : void 0,
|
|
6097
6205
|
...props,
|
|
6098
6206
|
ref: wrapperComponentRef,
|
|
@@ -6103,7 +6211,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6103
6211
|
withHover: onClickRow !== void 0 || expandColumn !== void 0,
|
|
6104
6212
|
withStickyHeader,
|
|
6105
6213
|
colorTheme,
|
|
6106
|
-
theme,
|
|
6214
|
+
theme: theme2,
|
|
6107
6215
|
containsOverflowComponents,
|
|
6108
6216
|
withFooter,
|
|
6109
6217
|
children: [
|
|
@@ -6120,7 +6228,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6120
6228
|
width: "100%",
|
|
6121
6229
|
alignItems: "center",
|
|
6122
6230
|
justifyContent: column.filter ? "space-between" : column.align === "center" ? "center" : column.align === "right" ? "flex-end" : "flex-start",
|
|
6123
|
-
gap:
|
|
6231
|
+
gap: theme2.styles.gap,
|
|
6124
6232
|
children: [
|
|
6125
6233
|
column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx23(
|
|
6126
6234
|
ToggleInput_default.checkbox,
|
|
@@ -6134,7 +6242,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6134
6242
|
Button_default.icon,
|
|
6135
6243
|
{
|
|
6136
6244
|
icon: "filter",
|
|
6137
|
-
color: filterData[index] ?
|
|
6245
|
+
color: filterData[index] ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
6138
6246
|
value: index,
|
|
6139
6247
|
onClickWithValue: onClickFilterButton
|
|
6140
6248
|
}
|
|
@@ -6177,14 +6285,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6177
6285
|
width: "100%",
|
|
6178
6286
|
justifyContent: "center",
|
|
6179
6287
|
flexReverse: true,
|
|
6180
|
-
gap:
|
|
6288
|
+
gap: theme2.styles.gap / 2,
|
|
6181
6289
|
children: [
|
|
6182
6290
|
/* @__PURE__ */ jsxs19(
|
|
6183
6291
|
Text_default,
|
|
6184
6292
|
{
|
|
6185
6293
|
position: mobileFooterBreakingPoint ? "relative" : "absolute",
|
|
6186
6294
|
top: !mobileFooterBreakingPoint ? "50%" : void 0,
|
|
6187
|
-
color:
|
|
6295
|
+
color: theme2.colors.textSecondary,
|
|
6188
6296
|
transform: !mobileFooterBreakingPoint ? "translateY(-50%)" : void 0,
|
|
6189
6297
|
userSelect: "none",
|
|
6190
6298
|
children: [
|
|
@@ -6236,7 +6344,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6236
6344
|
Form_default,
|
|
6237
6345
|
{
|
|
6238
6346
|
form: filterForm,
|
|
6239
|
-
gap:
|
|
6347
|
+
gap: theme2.styles.gap,
|
|
6240
6348
|
submitButtonText: "Filter",
|
|
6241
6349
|
cancelButtonText: "Clear",
|
|
6242
6350
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
@@ -6248,9 +6356,9 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6248
6356
|
/* @__PURE__ */ jsx23(InputField_default.dateTime, { label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
6249
6357
|
/* @__PURE__ */ jsx23(InputField_default.dateTime, { label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
6250
6358
|
] }) }),
|
|
6251
|
-
openedFilterColumn.presets && /* @__PURE__ */ jsxs19(Div_default.column, { gap:
|
|
6359
|
+
openedFilterColumn.presets && /* @__PURE__ */ jsxs19(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
6252
6360
|
/* @__PURE__ */ jsx23(Label_default, { text: "Presets" }),
|
|
6253
|
-
/* @__PURE__ */ jsx23(Div_default.row, { alignItems: "center", flexWrap: "wrap", gap:
|
|
6361
|
+
/* @__PURE__ */ jsx23(Div_default.row, { alignItems: "center", flexWrap: "wrap", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) => /* @__PURE__ */ jsx23(
|
|
6254
6362
|
Button_default.secondary,
|
|
6255
6363
|
{
|
|
6256
6364
|
text: filterPresetsText[preset],
|
|
@@ -6266,10 +6374,10 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6266
6374
|
) : openedFilterColumn.filter === "list" ? /* @__PURE__ */ jsxs19(
|
|
6267
6375
|
Form_default,
|
|
6268
6376
|
{
|
|
6269
|
-
gap:
|
|
6377
|
+
gap: theme2.styles.space,
|
|
6270
6378
|
submitButtonText: "Filter",
|
|
6271
6379
|
cancelButtonText: "Clear",
|
|
6272
|
-
renderActionButtons: /* @__PURE__ */ jsxs19(Div_default.row, { marginRight: "auto", alignItems: "center", gap:
|
|
6380
|
+
renderActionButtons: /* @__PURE__ */ jsxs19(Div_default.row, { marginRight: "auto", alignItems: "center", gap: theme2.styles.gap, children: [
|
|
6273
6381
|
/* @__PURE__ */ jsx23(
|
|
6274
6382
|
Button_default.secondary,
|
|
6275
6383
|
{
|
|
@@ -6300,9 +6408,9 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6300
6408
|
...filterForm.getInputFieldProps("search")
|
|
6301
6409
|
}
|
|
6302
6410
|
) }),
|
|
6303
|
-
/* @__PURE__ */ jsxs19(Div_default.column, { gap:
|
|
6411
|
+
/* @__PURE__ */ jsxs19(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
6304
6412
|
/* @__PURE__ */ jsx23(Label_default, { text: "Possible values" }),
|
|
6305
|
-
/* @__PURE__ */ jsx23(Div_default.row, { flexWrap: "wrap", gap:
|
|
6413
|
+
/* @__PURE__ */ jsx23(Div_default.row, { flexWrap: "wrap", gap: theme2.styles.gap, children: possibleFilterListValues.length > 0 ? possibleFilterListValues.map((value) => {
|
|
6306
6414
|
const isActive = filterListSelectedItems?.includes(value.value);
|
|
6307
6415
|
return /* @__PURE__ */ jsx23(
|
|
6308
6416
|
Div_default.box,
|
|
@@ -6310,13 +6418,13 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6310
6418
|
isActive,
|
|
6311
6419
|
value: value.value,
|
|
6312
6420
|
onClickWithValue: onClickFilterListItem,
|
|
6313
|
-
children: /* @__PURE__ */ jsxs19(Div_default.row, { alignItems: "center", gap:
|
|
6421
|
+
children: /* @__PURE__ */ jsxs19(Div_default.row, { alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
6314
6422
|
/* @__PURE__ */ jsx23(Text_default, { children: value.label || value.value }),
|
|
6315
6423
|
openedFilterColumn.withTotalNumber && /* @__PURE__ */ jsxs19(
|
|
6316
6424
|
Text_default,
|
|
6317
6425
|
{
|
|
6318
6426
|
fontSize: 14,
|
|
6319
|
-
color: isActive ?
|
|
6427
|
+
color: isActive ? theme2.colors.base + "c0" : theme2.colors.textSecondary,
|
|
6320
6428
|
children: [
|
|
6321
6429
|
"(",
|
|
6322
6430
|
value.count,
|
|
@@ -6448,14 +6556,14 @@ var arrowStyle = (props, borderWidth) => ({
|
|
|
6448
6556
|
}
|
|
6449
6557
|
});
|
|
6450
6558
|
var Arrow = memo24(function Arrow2(props) {
|
|
6451
|
-
const
|
|
6559
|
+
const theme2 = useTheme26();
|
|
6452
6560
|
const { position, size } = props;
|
|
6453
6561
|
const outerProps = useMemo10(
|
|
6454
6562
|
() => ({
|
|
6455
6563
|
...props,
|
|
6456
|
-
color:
|
|
6564
|
+
color: theme2.colors.border
|
|
6457
6565
|
}),
|
|
6458
|
-
[props,
|
|
6566
|
+
[props, theme2]
|
|
6459
6567
|
);
|
|
6460
6568
|
const borderWidth = 1;
|
|
6461
6569
|
return /* @__PURE__ */ jsx24(
|
|
@@ -6499,16 +6607,16 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
6499
6607
|
onClose,
|
|
6500
6608
|
children
|
|
6501
6609
|
}, ref) {
|
|
6502
|
-
const
|
|
6610
|
+
const theme2 = useTheme26();
|
|
6503
6611
|
const triggerHolderRef = useRef7(null);
|
|
6504
6612
|
const contentRef = useRef7(null);
|
|
6505
6613
|
const tooltipContainerRef = useRef7(null);
|
|
6506
6614
|
const closeTimerRef = useRef7(void 0);
|
|
6507
6615
|
const [isOpen, setIsOpen] = useState12(false);
|
|
6508
6616
|
const [isOpenLate, setIsOpenLate] = useState12(false);
|
|
6509
|
-
const arrowSize = withArrow ?
|
|
6510
|
-
const gap =
|
|
6511
|
-
const outsideScreenGap =
|
|
6617
|
+
const arrowSize = withArrow ? theme2.styles.gap : 0;
|
|
6618
|
+
const gap = theme2.styles.gap / 2;
|
|
6619
|
+
const outsideScreenGap = theme2.styles.gap / 2;
|
|
6512
6620
|
const totalGap = arrowSize + gap;
|
|
6513
6621
|
const openTooltip = useCallback15(() => {
|
|
6514
6622
|
if (disabled) return;
|
|
@@ -6611,7 +6719,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
6611
6719
|
/* @__PURE__ */ jsx24(
|
|
6612
6720
|
TooltipContainer,
|
|
6613
6721
|
{
|
|
6614
|
-
theme,
|
|
6722
|
+
theme: theme2,
|
|
6615
6723
|
position,
|
|
6616
6724
|
align,
|
|
6617
6725
|
pointerEvents: contentPointerEvents,
|
|
@@ -6628,10 +6736,10 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
6628
6736
|
position: "relative",
|
|
6629
6737
|
width: contentWidth,
|
|
6630
6738
|
minWidth: contentMinWidth,
|
|
6631
|
-
backgroundColor: backgroundColor ??
|
|
6739
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundContent,
|
|
6632
6740
|
boxShadow: "0px 10px 20px #00000020",
|
|
6633
|
-
paddingBlock: isSmall ?
|
|
6634
|
-
paddingInline: asContextMenu ? 0 : isSmall ?
|
|
6741
|
+
paddingBlock: isSmall ? theme2.styles.gap / 2 : theme2.styles.gap,
|
|
6742
|
+
paddingInline: asContextMenu ? 0 : isSmall ? theme2.styles.space / 2 : theme2.styles.space,
|
|
6635
6743
|
overflow: asContextMenu ? "hidden" : void 0,
|
|
6636
6744
|
children: content
|
|
6637
6745
|
}
|
|
@@ -6655,9 +6763,9 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
6655
6763
|
{
|
|
6656
6764
|
position,
|
|
6657
6765
|
align,
|
|
6658
|
-
sideSpace:
|
|
6766
|
+
sideSpace: theme2.styles.borderRadius,
|
|
6659
6767
|
size: arrowSize,
|
|
6660
|
-
color: backgroundColor ??
|
|
6768
|
+
color: backgroundColor ?? theme2.colors.backgroundContent,
|
|
6661
6769
|
isOpen
|
|
6662
6770
|
}
|
|
6663
6771
|
)
|
|
@@ -6681,16 +6789,16 @@ TooltipComponent.item = forwardRef16(function Item({
|
|
|
6681
6789
|
onClick,
|
|
6682
6790
|
onClickWithValue
|
|
6683
6791
|
}, ref) {
|
|
6684
|
-
const
|
|
6792
|
+
const theme2 = useTheme26();
|
|
6685
6793
|
return /* @__PURE__ */ jsxs20(
|
|
6686
6794
|
Div_default.row,
|
|
6687
6795
|
{
|
|
6688
6796
|
alignItems: "center",
|
|
6689
|
-
gap:
|
|
6690
|
-
backgroundColor:
|
|
6797
|
+
gap: theme2.styles.space,
|
|
6798
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
6691
6799
|
filterHover: !disabled ? "brightness(0.9)" : "brightness(0.94)",
|
|
6692
|
-
paddingBlock:
|
|
6693
|
-
paddingInline:
|
|
6800
|
+
paddingBlock: theme2.styles.gap,
|
|
6801
|
+
paddingInline: theme2.styles.space,
|
|
6694
6802
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
6695
6803
|
isTabAccessed: true,
|
|
6696
6804
|
id,
|
|
@@ -6700,29 +6808,29 @@ TooltipComponent.item = forwardRef16(function Item({
|
|
|
6700
6808
|
onClickWithValue: !disabled ? onClickWithValue : void 0,
|
|
6701
6809
|
ref,
|
|
6702
6810
|
children: [
|
|
6703
|
-
icon && /* @__PURE__ */ jsx24(Icon_default, { name: icon, color: iconColor ?? (!isActive ?
|
|
6704
|
-
/* @__PURE__ */ jsxs20(Div_default.column, { flex: 1, gap:
|
|
6705
|
-
/* @__PURE__ */ jsx24(Text_default, { fontWeight: isActive ? 700 : void 0, color: textColor ??
|
|
6706
|
-
description && /* @__PURE__ */ jsx24(Text_default, { fontSize: 14, color:
|
|
6811
|
+
icon && /* @__PURE__ */ jsx24(Icon_default, { name: icon, color: iconColor ?? (!isActive ? theme2.colors.textSecondary : void 0) }),
|
|
6812
|
+
/* @__PURE__ */ jsxs20(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
6813
|
+
/* @__PURE__ */ jsx24(Text_default, { fontWeight: isActive ? 700 : void 0, color: textColor ?? theme2.colors.textPrimary, children: text }),
|
|
6814
|
+
description && /* @__PURE__ */ jsx24(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: description })
|
|
6707
6815
|
] })
|
|
6708
6816
|
]
|
|
6709
6817
|
}
|
|
6710
6818
|
);
|
|
6711
6819
|
});
|
|
6712
6820
|
TooltipComponent.divider = forwardRef16(function DividerComponent(props, ref) {
|
|
6713
|
-
const
|
|
6714
|
-
return /* @__PURE__ */ jsx24(Divider_default.horizontal, { marginBlock:
|
|
6821
|
+
const theme2 = useTheme26();
|
|
6822
|
+
return /* @__PURE__ */ jsx24(Divider_default.horizontal, { marginBlock: theme2.styles.gap, ...props, ref });
|
|
6715
6823
|
});
|
|
6716
6824
|
TooltipComponent.sectionTitle = forwardRef16(function SectionTitle({ text, ...props }, ref) {
|
|
6717
|
-
const
|
|
6825
|
+
const theme2 = useTheme26();
|
|
6718
6826
|
return /* @__PURE__ */ jsx24(
|
|
6719
6827
|
Text_default,
|
|
6720
6828
|
{
|
|
6721
6829
|
fontSize: 12,
|
|
6722
6830
|
fontWeight: 700,
|
|
6723
6831
|
textTransform: "uppercase",
|
|
6724
|
-
marginBlock:
|
|
6725
|
-
marginInline:
|
|
6832
|
+
marginBlock: theme2.styles.gap / 2,
|
|
6833
|
+
marginInline: theme2.styles.space,
|
|
6726
6834
|
...props,
|
|
6727
6835
|
ref,
|
|
6728
6836
|
children: text
|
|
@@ -6744,7 +6852,7 @@ var tabDotSize = 6;
|
|
|
6744
6852
|
var defaultTabName = "tab";
|
|
6745
6853
|
var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style = "default", onChange, children, ...props }, ref) {
|
|
6746
6854
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
6747
|
-
const
|
|
6855
|
+
const theme2 = useTheme27();
|
|
6748
6856
|
const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
|
|
6749
6857
|
const { componentsState } = useBetterHtmlContextInternal();
|
|
6750
6858
|
const { colorTheme } = useBetterCoreContext9();
|
|
@@ -6760,7 +6868,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
6760
6868
|
return selectedTabValue;
|
|
6761
6869
|
});
|
|
6762
6870
|
const [rerenderState, setRerenderState] = useState13(0);
|
|
6763
|
-
const tabsGap = style === "box" ?
|
|
6871
|
+
const tabsGap = style === "box" ? theme2.styles.gap / 2 : 0;
|
|
6764
6872
|
const onClickTab = useCallback16(
|
|
6765
6873
|
(tab) => {
|
|
6766
6874
|
setSelectedTab(tab);
|
|
@@ -6838,7 +6946,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
6838
6946
|
},
|
|
6839
6947
|
[selectedTab, onClickTab]
|
|
6840
6948
|
);
|
|
6841
|
-
return /* @__PURE__ */ jsxs21(Div_default.column, { width: "100%", gap:
|
|
6949
|
+
return /* @__PURE__ */ jsxs21(Div_default.column, { width: "100%", gap: theme2.styles.space, ...props, children: [
|
|
6842
6950
|
/* @__PURE__ */ jsxs21(Div_default, { position: "relative", className: "react-better-html-no-scrollbar", overflowY: "auto", children: [
|
|
6843
6951
|
/* @__PURE__ */ jsx25(Div_default.row, { position: "relative", width: "fit-content", gap: tabsGap, userSelect: "none", children: tabs.map((tab) => {
|
|
6844
6952
|
const selected = tab === selectedTab;
|
|
@@ -6847,14 +6955,14 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
6847
6955
|
{
|
|
6848
6956
|
position: "relative",
|
|
6849
6957
|
width: "fit-content",
|
|
6850
|
-
backgroundColor: style === "box" ? selected ?
|
|
6851
|
-
borderRadius: style === "box" ?
|
|
6852
|
-
borderTopLeftRadius: style === "borderRadiusTop" ?
|
|
6853
|
-
borderTopRightRadius: style === "borderRadiusTop" ?
|
|
6854
|
-
border: style === "box" ? `1px solid ${selected ? "transparent" :
|
|
6958
|
+
backgroundColor: style === "box" ? selected ? theme2.colors.primary : theme2.colors.backgroundContent : theme2.colors.backgroundBase,
|
|
6959
|
+
borderRadius: style === "box" ? theme2.styles.borderRadius : void 0,
|
|
6960
|
+
borderTopLeftRadius: style === "borderRadiusTop" ? theme2.styles.borderRadius : void 0,
|
|
6961
|
+
borderTopRightRadius: style === "borderRadiusTop" ? theme2.styles.borderRadius : void 0,
|
|
6962
|
+
border: style === "box" ? `1px solid ${selected ? "transparent" : theme2.colors.border}` : void 0,
|
|
6855
6963
|
filterHover: colorTheme === "dark" ? style === "box" ? "brightness(1.2)" : "brightness(2)" : "brightness(0.9)",
|
|
6856
|
-
paddingInline:
|
|
6857
|
-
paddingBlock:
|
|
6964
|
+
paddingInline: theme2.styles.space,
|
|
6965
|
+
paddingBlock: theme2.styles.gap,
|
|
6858
6966
|
value: tab,
|
|
6859
6967
|
cursor: "pointer",
|
|
6860
6968
|
isTabAccessed: true,
|
|
@@ -6867,21 +6975,21 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
6867
6975
|
Div_default,
|
|
6868
6976
|
{
|
|
6869
6977
|
position: "absolute",
|
|
6870
|
-
top: (
|
|
6871
|
-
right: (
|
|
6978
|
+
top: (theme2.styles.space - tabDotSize) / 2,
|
|
6979
|
+
right: (theme2.styles.space - tabDotSize) / 2,
|
|
6872
6980
|
width: tabDotSize,
|
|
6873
6981
|
height: tabDotSize,
|
|
6874
|
-
backgroundColor: style === "box" && selected ?
|
|
6982
|
+
backgroundColor: style === "box" && selected ? theme2.colors.base : theme2.colors.primary,
|
|
6875
6983
|
borderRadius: 999,
|
|
6876
|
-
transition:
|
|
6984
|
+
transition: theme2.styles.transition
|
|
6877
6985
|
}
|
|
6878
6986
|
),
|
|
6879
6987
|
/* @__PURE__ */ jsx25(
|
|
6880
6988
|
Text_default,
|
|
6881
6989
|
{
|
|
6882
6990
|
fontWeight: 700,
|
|
6883
|
-
color: !selected ?
|
|
6884
|
-
transition:
|
|
6991
|
+
color: !selected ? theme2.colors.textSecondary : style === "box" ? theme2.colors.base : void 0,
|
|
6992
|
+
transition: theme2.styles.transition,
|
|
6885
6993
|
whiteSpace: "nowrap",
|
|
6886
6994
|
children: tab
|
|
6887
6995
|
}
|
|
@@ -6899,8 +7007,8 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
6899
7007
|
height: tabBottomLineWidth,
|
|
6900
7008
|
bottom: 0,
|
|
6901
7009
|
left: leftSpacing,
|
|
6902
|
-
backgroundColor: accentColor ??
|
|
6903
|
-
transition: firstRenderPassedRef.current ?
|
|
7010
|
+
backgroundColor: accentColor ?? theme2.colors.primary,
|
|
7011
|
+
transition: firstRenderPassedRef.current ? theme2.styles.transition : "none"
|
|
6904
7012
|
}
|
|
6905
7013
|
)
|
|
6906
7014
|
] }),
|
|
@@ -6953,7 +7061,7 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
6953
7061
|
children,
|
|
6954
7062
|
...props
|
|
6955
7063
|
}, ref) {
|
|
6956
|
-
const
|
|
7064
|
+
const theme2 = useTheme28();
|
|
6957
7065
|
const bodyRef = useRef9(null);
|
|
6958
7066
|
const [internalIsOpen, setInternalIsOpen] = useBooleanState6(defaultOpen);
|
|
6959
7067
|
const [bodyVirtualHeight, setBodyVirtualHeight] = useState14();
|
|
@@ -7011,31 +7119,31 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
7011
7119
|
{
|
|
7012
7120
|
width: "100%",
|
|
7013
7121
|
alignItems: "center",
|
|
7014
|
-
gap:
|
|
7015
|
-
paddingBlock: headerPaddingBlock ??
|
|
7122
|
+
gap: theme2.styles.space,
|
|
7123
|
+
paddingBlock: headerPaddingBlock ?? theme2.styles.gap,
|
|
7016
7124
|
paddingInline: headerPaddingInline,
|
|
7017
7125
|
cursor: "pointer",
|
|
7018
7126
|
onClick: toggleOpen,
|
|
7019
7127
|
userSelect: "none",
|
|
7020
7128
|
children: [
|
|
7021
|
-
/* @__PURE__ */ jsxs22(Div_default.row, { flex: 1, alignItems: "center", gap:
|
|
7129
|
+
/* @__PURE__ */ jsxs22(Div_default.row, { flex: 1, alignItems: "center", gap: theme2.styles.space, children: [
|
|
7022
7130
|
icon && /* @__PURE__ */ jsx26(Icon_default, { name: icon, size: 20, flexShrink: 0 }),
|
|
7023
7131
|
image && /* @__PURE__ */ jsx26(Image_default.profileImage, { name: image, size: 24, flexShrink: 0 }),
|
|
7024
|
-
/* @__PURE__ */ jsxs22(Div_default.column, { gap:
|
|
7025
|
-
title && /* @__PURE__ */ jsxs22(Div_default.row, { alignItems: "center", gap:
|
|
7132
|
+
/* @__PURE__ */ jsxs22(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
7133
|
+
title && /* @__PURE__ */ jsxs22(Div_default.row, { alignItems: "center", gap: theme2.styles.space, children: [
|
|
7026
7134
|
/* @__PURE__ */ jsx26(
|
|
7027
7135
|
Text_default,
|
|
7028
7136
|
{
|
|
7029
7137
|
as: titleAs,
|
|
7030
7138
|
fontWeight: 700,
|
|
7031
7139
|
lineHeight: "20px",
|
|
7032
|
-
color: titleColor ??
|
|
7140
|
+
color: titleColor ?? theme2.colors.textPrimary,
|
|
7033
7141
|
children: title
|
|
7034
7142
|
}
|
|
7035
7143
|
),
|
|
7036
7144
|
titleRightElement
|
|
7037
7145
|
] }),
|
|
7038
|
-
description && /* @__PURE__ */ jsx26(Text_default, { color: descriptionColor ??
|
|
7146
|
+
description && /* @__PURE__ */ jsx26(Text_default, { color: descriptionColor ?? theme2.colors.textSecondary, children: description })
|
|
7039
7147
|
] })
|
|
7040
7148
|
] }),
|
|
7041
7149
|
rightElement,
|
|
@@ -7044,37 +7152,37 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
7044
7152
|
{
|
|
7045
7153
|
name: "chevronDown",
|
|
7046
7154
|
transform: `rotate(${isOpen ? 180 : 0}deg)`,
|
|
7047
|
-
transition:
|
|
7155
|
+
transition: theme2.styles.transition
|
|
7048
7156
|
}
|
|
7049
7157
|
)
|
|
7050
7158
|
]
|
|
7051
7159
|
}
|
|
7052
7160
|
),
|
|
7053
|
-
/* @__PURE__ */ jsx26(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition:
|
|
7161
|
+
/* @__PURE__ */ jsx26(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ jsx26(Divider_default.horizontal, {}) }),
|
|
7054
7162
|
/* @__PURE__ */ jsx26(
|
|
7055
7163
|
Div_default,
|
|
7056
7164
|
{
|
|
7057
7165
|
maxHeight: isOpen ? bodyVirtualHeight : 0,
|
|
7058
7166
|
opacity: !isOpen ? 0 : void 0,
|
|
7059
|
-
transition: `max-height ${isOpen ? animationDurationOpen : animationDurationClose}s ease, opacity ${
|
|
7167
|
+
transition: `max-height ${isOpen ? animationDurationOpen : animationDurationClose}s ease, opacity ${theme2.styles.transition}`,
|
|
7060
7168
|
overflow: !isOpen ? "hidden" : void 0,
|
|
7061
7169
|
pointerEvents: !isOpen ? "none" : void 0,
|
|
7062
7170
|
ref: bodyRef,
|
|
7063
|
-
children: /* @__PURE__ */ jsx26(Div_default, { paddingBlock:
|
|
7171
|
+
children: /* @__PURE__ */ jsx26(Div_default, { paddingBlock: theme2.styles.gap, paddingInline: headerPaddingInline, children })
|
|
7064
7172
|
}
|
|
7065
7173
|
)
|
|
7066
7174
|
] });
|
|
7067
7175
|
});
|
|
7068
7176
|
FoldableComponent.box = forwardRef18(function Box3({ ...props }, ref) {
|
|
7069
|
-
const
|
|
7177
|
+
const theme2 = useTheme28();
|
|
7070
7178
|
return /* @__PURE__ */ jsx26(
|
|
7071
7179
|
FoldableComponent,
|
|
7072
7180
|
{
|
|
7073
|
-
backgroundColor:
|
|
7074
|
-
border: `1px solid ${
|
|
7075
|
-
borderRadius:
|
|
7076
|
-
headerPaddingBlock: (
|
|
7077
|
-
headerPaddingInline:
|
|
7181
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
7182
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
7183
|
+
borderRadius: theme2.styles.borderRadius,
|
|
7184
|
+
headerPaddingBlock: (theme2.styles.gap + theme2.styles.space) / 2,
|
|
7185
|
+
headerPaddingInline: theme2.styles.space,
|
|
7078
7186
|
...props,
|
|
7079
7187
|
ref
|
|
7080
7188
|
}
|
|
@@ -7110,7 +7218,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7110
7218
|
);
|
|
7111
7219
|
}
|
|
7112
7220
|
const reactRouterDomPluginConfig = reactRouterDomPlugin2.getConfig();
|
|
7113
|
-
const
|
|
7221
|
+
const theme2 = useTheme29();
|
|
7114
7222
|
const mediaQuery = useMediaQuery();
|
|
7115
7223
|
const location = reactRouterDomPluginConfig.useLocation();
|
|
7116
7224
|
const { components, sideMenuIsCollapsed, setSideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
@@ -7131,20 +7239,20 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7131
7239
|
}
|
|
7132
7240
|
}, [onClick, item, isCollapsed]);
|
|
7133
7241
|
const isActive = activeItem && item.href && activeItem.href === item.href;
|
|
7134
|
-
const readyBackgroundColor = backgroundColor ??
|
|
7242
|
+
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
7135
7243
|
const iconSize = 16;
|
|
7136
|
-
const paddingBlock =
|
|
7137
|
-
const paddingLeft =
|
|
7138
|
-
const iconGap =
|
|
7244
|
+
const paddingBlock = theme2.styles.gap;
|
|
7245
|
+
const paddingLeft = theme2.styles.gap + 2;
|
|
7246
|
+
const iconGap = theme2.styles.gap;
|
|
7139
7247
|
const lineHeight = 20;
|
|
7140
7248
|
const lineWidth = 2;
|
|
7141
7249
|
const lineEndRadius = iconSize / 2 + iconGap * 2;
|
|
7142
7250
|
const content = /* @__PURE__ */ jsx27(
|
|
7143
7251
|
Tooltip_default,
|
|
7144
7252
|
{
|
|
7145
|
-
content: /* @__PURE__ */ jsxs23(Div_default.row, { alignItems: "center", gap:
|
|
7253
|
+
content: /* @__PURE__ */ jsxs23(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
7146
7254
|
/* @__PURE__ */ jsx27(Text_default, { whiteSpace: "nowrap", children: item.text }),
|
|
7147
|
-
item.children && /* @__PURE__ */ jsx27(Icon_default, { name: "chevronDown", color:
|
|
7255
|
+
item.children && /* @__PURE__ */ jsx27(Icon_default, { name: "chevronDown", color: theme2.colors.textSecondary, size: 14 })
|
|
7148
7256
|
] }),
|
|
7149
7257
|
contentPointerEvents: "none",
|
|
7150
7258
|
withArrow: true,
|
|
@@ -7157,26 +7265,26 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7157
7265
|
alignItems: "center",
|
|
7158
7266
|
gap: iconGap,
|
|
7159
7267
|
whiteSpace: "nowrap",
|
|
7160
|
-
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor3(
|
|
7161
|
-
borderRadius:
|
|
7268
|
+
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor3(theme2.colors.primary, 0.7) : lightenColor3(theme2.colors.primary, 0.85) : readyBackgroundColor,
|
|
7269
|
+
borderRadius: theme2.styles.borderRadius,
|
|
7162
7270
|
paddingBlock,
|
|
7163
|
-
paddingLeft: isCollapsed ?
|
|
7164
|
-
paddingRight:
|
|
7271
|
+
paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
|
|
7272
|
+
paddingRight: theme2.styles.space,
|
|
7165
7273
|
filterHover: `brightness(${colorTheme === "dark" ? isActive ? 0.8 : 1.3 : isActive ? 0.8 : 0.95})`,
|
|
7166
7274
|
overflow: isCollapsed ? "hidden" : void 0,
|
|
7167
7275
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
7168
7276
|
opacity: item.disabled ? 0.6 : void 0,
|
|
7169
7277
|
onClick: onClickElement,
|
|
7170
7278
|
children: [
|
|
7171
|
-
/* @__PURE__ */ jsx27(Icon_default, { name: item.iconName, color:
|
|
7279
|
+
/* @__PURE__ */ jsx27(Icon_default, { name: item.iconName, color: theme2.colors.primary, size: iconSize, flexShrink: 0 }),
|
|
7172
7280
|
/* @__PURE__ */ jsx27(
|
|
7173
7281
|
Text_default,
|
|
7174
7282
|
{
|
|
7175
7283
|
flex: 1,
|
|
7176
7284
|
lineHeight: `${lineHeight}px`,
|
|
7177
|
-
color: isActive ?
|
|
7285
|
+
color: isActive ? theme2.colors.primary : theme2.colors.textPrimary,
|
|
7178
7286
|
opacity: isCollapsed ? 0 : void 0,
|
|
7179
|
-
transition:
|
|
7287
|
+
transition: theme2.styles.transition,
|
|
7180
7288
|
children: item.text
|
|
7181
7289
|
}
|
|
7182
7290
|
),
|
|
@@ -7184,10 +7292,10 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7184
7292
|
Icon_default,
|
|
7185
7293
|
{
|
|
7186
7294
|
name: "chevronDown",
|
|
7187
|
-
color:
|
|
7295
|
+
color: theme2.colors.textSecondary,
|
|
7188
7296
|
size: 14,
|
|
7189
7297
|
transform: isOpened ? "rotate(180deg)" : void 0,
|
|
7190
|
-
transition:
|
|
7298
|
+
transition: theme2.styles.transition
|
|
7191
7299
|
}
|
|
7192
7300
|
)
|
|
7193
7301
|
]
|
|
@@ -7225,11 +7333,11 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7225
7333
|
{
|
|
7226
7334
|
position: "relative",
|
|
7227
7335
|
maxHeight: isOpened ? 1e3 : 0,
|
|
7228
|
-
gap:
|
|
7229
|
-
marginTop: isOpened ?
|
|
7336
|
+
gap: theme2.styles.gap / 2,
|
|
7337
|
+
marginTop: isOpened ? theme2.styles.gap / 2 : void 0,
|
|
7230
7338
|
paddingLeft: paddingLeft + iconSize + iconGap,
|
|
7231
7339
|
overflow: "hidden",
|
|
7232
|
-
transition: `max-height ${
|
|
7340
|
+
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
7233
7341
|
children: [
|
|
7234
7342
|
item.children.map((child) => /* @__PURE__ */ jsx27(
|
|
7235
7343
|
MenuItemComponent2,
|
|
@@ -7255,7 +7363,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7255
7363
|
position: "relative",
|
|
7256
7364
|
width: lineWidth,
|
|
7257
7365
|
height: "100%",
|
|
7258
|
-
backgroundColor:
|
|
7366
|
+
backgroundColor: theme2.colors.border,
|
|
7259
7367
|
zIndex: 1
|
|
7260
7368
|
}
|
|
7261
7369
|
),
|
|
@@ -7267,7 +7375,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
7267
7375
|
height: lineEndRadius,
|
|
7268
7376
|
top: `calc(100% - ${lineEndRadius / 2}px)`,
|
|
7269
7377
|
left: 0,
|
|
7270
|
-
border: `${lineWidth}px solid ${
|
|
7378
|
+
border: `${lineWidth}px solid ${theme2.colors.border}`,
|
|
7271
7379
|
borderRadius: 999,
|
|
7272
7380
|
borderTopColor: readyBackgroundColor,
|
|
7273
7381
|
borderLeftColor: readyBackgroundColor,
|
|
@@ -7300,7 +7408,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
7300
7408
|
backgroundColor,
|
|
7301
7409
|
paddingTop
|
|
7302
7410
|
}) {
|
|
7303
|
-
const
|
|
7411
|
+
const theme2 = useTheme29();
|
|
7304
7412
|
const mediaQuery = useMediaQuery();
|
|
7305
7413
|
const { components, sideMenuIsCollapsed, setSideMenuIsCollapsed, sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
7306
7414
|
const [activeItem, setActiveItem] = useState15();
|
|
@@ -7320,9 +7428,9 @@ var SideMenuComponent = function SideMenu({
|
|
|
7320
7428
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
7321
7429
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
7322
7430
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
7323
|
-
const sideMenuCollapsedWidth =
|
|
7324
|
-
const readyBackgroundColor = backgroundColor ??
|
|
7325
|
-
const logoSize = sideMenuCollapsedWidth -
|
|
7431
|
+
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
7432
|
+
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
7433
|
+
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
7326
7434
|
return /* @__PURE__ */ jsx27(SideMenuContextProvider, { value: contextValue, children: /* @__PURE__ */ jsxs23(
|
|
7327
7435
|
Div_default.column,
|
|
7328
7436
|
{
|
|
@@ -7332,15 +7440,15 @@ var SideMenuComponent = function SideMenu({
|
|
|
7332
7440
|
top: topSpace,
|
|
7333
7441
|
left: 0,
|
|
7334
7442
|
backgroundColor: readyBackgroundColor,
|
|
7335
|
-
borderRight: `solid 1px ${
|
|
7443
|
+
borderRight: `solid 1px ${theme2.colors.border}`,
|
|
7336
7444
|
transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
|
|
7337
|
-
paddingTop: paddingTop ?? (logoAssetName || logoUrl ?
|
|
7338
|
-
transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${
|
|
7445
|
+
paddingTop: paddingTop ?? (logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space),
|
|
7446
|
+
transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${theme2.styles.transition}` : "none" : theme2.styles.transition,
|
|
7339
7447
|
userSelect: "none",
|
|
7340
7448
|
zIndex: 10,
|
|
7341
7449
|
children: [
|
|
7342
|
-
/* @__PURE__ */ jsxs23(Div_default.column, { width: "100%", height: "100%", gap:
|
|
7343
|
-
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ jsxs23(Div_default.row, { alignItems: "center", paddingInline:
|
|
7450
|
+
/* @__PURE__ */ jsxs23(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
|
|
7451
|
+
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ jsxs23(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
|
|
7344
7452
|
(logoAssetName || logoUrl) && /* @__PURE__ */ jsx27(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ jsxs23(
|
|
7345
7453
|
Div_default.row,
|
|
7346
7454
|
{
|
|
@@ -7348,7 +7456,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
7348
7456
|
width: sideMenuCollapsedWidth ? logoSize : void 0,
|
|
7349
7457
|
height: logoSize,
|
|
7350
7458
|
whiteSpace: "nowrap",
|
|
7351
|
-
gap:
|
|
7459
|
+
gap: theme2.styles.gap,
|
|
7352
7460
|
children: [
|
|
7353
7461
|
/* @__PURE__ */ jsx27(
|
|
7354
7462
|
Image_default,
|
|
@@ -7367,7 +7475,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
7367
7475
|
fontSize: 22,
|
|
7368
7476
|
fontWeight: 800,
|
|
7369
7477
|
opacity: !isCollapsed ? 1 : 0,
|
|
7370
|
-
transition:
|
|
7478
|
+
transition: theme2.styles.transition,
|
|
7371
7479
|
userSelect: "none",
|
|
7372
7480
|
children: logoText
|
|
7373
7481
|
}
|
|
@@ -7384,9 +7492,9 @@ var SideMenuComponent = function SideMenu({
|
|
|
7384
7492
|
width: "100%",
|
|
7385
7493
|
height: "100%",
|
|
7386
7494
|
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7387
|
-
paddingInline:
|
|
7388
|
-
paddingBottom: !isCollapsable && !readyBottomItems ?
|
|
7389
|
-
children: /* @__PURE__ */ jsx27(Div_default.column, { gap:
|
|
7495
|
+
paddingInline: theme2.styles.space,
|
|
7496
|
+
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
7497
|
+
children: /* @__PURE__ */ jsx27(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx27(
|
|
7390
7498
|
MenuItemComponent,
|
|
7391
7499
|
{
|
|
7392
7500
|
item,
|
|
@@ -7400,12 +7508,12 @@ var SideMenuComponent = function SideMenu({
|
|
|
7400
7508
|
readyBottomItems && /* @__PURE__ */ jsx27(
|
|
7401
7509
|
Div_default.column,
|
|
7402
7510
|
{
|
|
7403
|
-
borderTop: mediaQuery.size1000 ? `solid 1px ${
|
|
7404
|
-
gap:
|
|
7511
|
+
borderTop: mediaQuery.size1000 ? `solid 1px ${theme2.colors.border}` : void 0,
|
|
7512
|
+
gap: theme2.styles.gap / 2,
|
|
7405
7513
|
marginTop: "auto",
|
|
7406
|
-
paddingTop: mediaQuery.size1000 ?
|
|
7407
|
-
paddingInline:
|
|
7408
|
-
paddingBottom: !isCollapsable ?
|
|
7514
|
+
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7515
|
+
paddingInline: theme2.styles.space,
|
|
7516
|
+
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
7409
7517
|
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx27(
|
|
7410
7518
|
MenuItemComponent,
|
|
7411
7519
|
{
|
|
@@ -7422,30 +7530,30 @@ var SideMenuComponent = function SideMenu({
|
|
|
7422
7530
|
isCollapsable && /* @__PURE__ */ jsx27(
|
|
7423
7531
|
Div_default,
|
|
7424
7532
|
{
|
|
7425
|
-
borderTop: `solid 1px ${
|
|
7533
|
+
borderTop: `solid 1px ${theme2.colors.border}`,
|
|
7426
7534
|
marginTop: !readyBottomItems ? "auto" : void 0,
|
|
7427
|
-
paddingInline:
|
|
7428
|
-
paddingBlock:
|
|
7535
|
+
paddingInline: theme2.styles.space,
|
|
7536
|
+
paddingBlock: theme2.styles.space,
|
|
7429
7537
|
children: /* @__PURE__ */ jsx27(
|
|
7430
7538
|
Div_default.row,
|
|
7431
7539
|
{
|
|
7432
7540
|
alignItems: "center",
|
|
7433
7541
|
justifyContent: "center",
|
|
7434
7542
|
backgroundColor: readyBackgroundColor,
|
|
7435
|
-
borderRadius:
|
|
7543
|
+
borderRadius: theme2.styles.borderRadius,
|
|
7436
7544
|
cursor: "pointer",
|
|
7437
7545
|
filterHover: filterHover().z1,
|
|
7438
7546
|
isTabAccessed: true,
|
|
7439
|
-
paddingBlock:
|
|
7547
|
+
paddingBlock: theme2.styles.gap,
|
|
7440
7548
|
onClick: setSideMenuIsCollapsed.toggle,
|
|
7441
7549
|
children: /* @__PURE__ */ jsx27(
|
|
7442
7550
|
Icon_default,
|
|
7443
7551
|
{
|
|
7444
7552
|
name: "chevronRight",
|
|
7445
7553
|
size: 20,
|
|
7446
|
-
color:
|
|
7554
|
+
color: theme2.colors.textSecondary,
|
|
7447
7555
|
transform: `rotate(${isCollapsed ? 0 : 180}deg)`,
|
|
7448
|
-
transition:
|
|
7556
|
+
transition: theme2.styles.transition
|
|
7449
7557
|
}
|
|
7450
7558
|
)
|
|
7451
7559
|
}
|
|
@@ -7457,30 +7565,30 @@ var SideMenuComponent = function SideMenu({
|
|
|
7457
7565
|
Div_default.row,
|
|
7458
7566
|
{
|
|
7459
7567
|
position: "absolute",
|
|
7460
|
-
top:
|
|
7568
|
+
top: theme2.styles.space,
|
|
7461
7569
|
left: "100%",
|
|
7462
7570
|
backgroundColor: readyBackgroundColor,
|
|
7463
|
-
border: `solid 1px ${
|
|
7571
|
+
border: `solid 1px ${theme2.colors.border}`,
|
|
7464
7572
|
borderLeft: "none",
|
|
7465
|
-
borderTopRightRadius:
|
|
7466
|
-
borderBottomRightRadius:
|
|
7573
|
+
borderTopRightRadius: theme2.styles.borderRadius,
|
|
7574
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
7467
7575
|
alignItems: "center",
|
|
7468
7576
|
cursor: "pointer",
|
|
7469
7577
|
opacity: !mediaQuery.size1000 ? 0 : void 0,
|
|
7470
7578
|
pointerEvents: !mediaQuery.size1000 ? "none" : void 0,
|
|
7471
|
-
padding:
|
|
7472
|
-
paddingRight: (
|
|
7579
|
+
padding: theme2.styles.gap,
|
|
7580
|
+
paddingRight: (theme2.styles.space + theme2.styles.gap) / 2,
|
|
7473
7581
|
transform: !mediaQuery.size1000 ? "translateX(-100%)" : void 0,
|
|
7474
|
-
transition:
|
|
7582
|
+
transition: theme2.styles.transition,
|
|
7475
7583
|
onClick: setSideMenuIsOpenMobile.toggle,
|
|
7476
7584
|
children: /* @__PURE__ */ jsx27(
|
|
7477
7585
|
Icon_default,
|
|
7478
7586
|
{
|
|
7479
7587
|
name: "chevronRight",
|
|
7480
7588
|
size: 20,
|
|
7481
|
-
color:
|
|
7589
|
+
color: theme2.colors.textSecondary,
|
|
7482
7590
|
transform: sideMenuIsOpenMobile ? "rotate(180deg)" : void 0,
|
|
7483
|
-
transition:
|
|
7591
|
+
transition: theme2.styles.transition
|
|
7484
7592
|
}
|
|
7485
7593
|
)
|
|
7486
7594
|
}
|
|
@@ -7491,18 +7599,18 @@ var SideMenuComponent = function SideMenu({
|
|
|
7491
7599
|
) });
|
|
7492
7600
|
};
|
|
7493
7601
|
SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, ...props }) {
|
|
7494
|
-
const
|
|
7602
|
+
const theme2 = useTheme29();
|
|
7495
7603
|
const mediaQuery = useMediaQuery();
|
|
7496
7604
|
const { components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
7497
7605
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
7498
|
-
const sideMenuCollapsedWidth =
|
|
7606
|
+
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
7499
7607
|
return /* @__PURE__ */ jsxs23(
|
|
7500
7608
|
Div_default,
|
|
7501
7609
|
{
|
|
7502
7610
|
position: "relative",
|
|
7503
7611
|
width: "100%",
|
|
7504
7612
|
paddingLeft: !mediaQuery.size1000 ? !sideMenuIsCollapsed ? sideMenuWidth : sideMenuCollapsedWidth : void 0,
|
|
7505
|
-
transition:
|
|
7613
|
+
transition: theme2.styles.transition,
|
|
7506
7614
|
children: [
|
|
7507
7615
|
outsideComponent,
|
|
7508
7616
|
/* @__PURE__ */ jsx27(PageHolder_default, { ...props })
|
|
@@ -7511,7 +7619,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
7511
7619
|
);
|
|
7512
7620
|
};
|
|
7513
7621
|
SideMenuComponent.burgerButton = function BurgerButton() {
|
|
7514
|
-
const
|
|
7622
|
+
const theme2 = useTheme29();
|
|
7515
7623
|
const { sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
7516
7624
|
const [isHovered, setIsHovered] = useBooleanState7();
|
|
7517
7625
|
const width = 2;
|
|
@@ -7535,10 +7643,10 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
7535
7643
|
height: width,
|
|
7536
7644
|
top: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
|
|
7537
7645
|
left: 0,
|
|
7538
|
-
backgroundColor:
|
|
7646
|
+
backgroundColor: theme2.colors.border,
|
|
7539
7647
|
borderRadius: 999,
|
|
7540
7648
|
transform: sideMenuIsOpenMobile ? "rotate(45deg)" : void 0,
|
|
7541
|
-
transition:
|
|
7649
|
+
transition: theme2.styles.transition
|
|
7542
7650
|
}
|
|
7543
7651
|
),
|
|
7544
7652
|
/* @__PURE__ */ jsx27(
|
|
@@ -7549,11 +7657,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
7549
7657
|
height: width,
|
|
7550
7658
|
top: "50%",
|
|
7551
7659
|
left: 0,
|
|
7552
|
-
backgroundColor:
|
|
7660
|
+
backgroundColor: theme2.colors.border,
|
|
7553
7661
|
borderRadius: 999,
|
|
7554
7662
|
transform: "translateY(-50%)",
|
|
7555
7663
|
opacity: sideMenuIsOpenMobile ? 0 : void 0,
|
|
7556
|
-
transition:
|
|
7664
|
+
transition: theme2.styles.transition
|
|
7557
7665
|
}
|
|
7558
7666
|
),
|
|
7559
7667
|
/* @__PURE__ */ jsx27(
|
|
@@ -7564,10 +7672,10 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
7564
7672
|
height: width,
|
|
7565
7673
|
bottom: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
|
|
7566
7674
|
left: 0,
|
|
7567
|
-
backgroundColor:
|
|
7675
|
+
backgroundColor: theme2.colors.border,
|
|
7568
7676
|
borderRadius: 999,
|
|
7569
7677
|
transform: sideMenuIsOpenMobile ? "rotate(-45deg)" : void 0,
|
|
7570
|
-
transition:
|
|
7678
|
+
transition: theme2.styles.transition
|
|
7571
7679
|
}
|
|
7572
7680
|
)
|
|
7573
7681
|
]
|