design-zystem 1.0.281 → 1.0.283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +138 -134
- package/dist/index.mjs +23 -19
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -87,7 +87,7 @@ interface ColProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
87
87
|
style?: CSSProperties;
|
|
88
88
|
className?: string;
|
|
89
89
|
}
|
|
90
|
-
declare const Col:
|
|
90
|
+
declare const Col: react.ForwardRefExoticComponent<ColProps & react.RefAttributes<HTMLDivElement>>;
|
|
91
91
|
|
|
92
92
|
interface BulkSection {
|
|
93
93
|
title: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ interface ColProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
87
87
|
style?: CSSProperties;
|
|
88
88
|
className?: string;
|
|
89
89
|
}
|
|
90
|
-
declare const Col:
|
|
90
|
+
declare const Col: react.ForwardRefExoticComponent<ColProps & react.RefAttributes<HTMLDivElement>>;
|
|
91
91
|
|
|
92
92
|
interface BulkSection {
|
|
93
93
|
title: string;
|
package/dist/index.js
CHANGED
|
@@ -493,6 +493,7 @@ Row.displayName = "Row";
|
|
|
493
493
|
var Row_default = Row;
|
|
494
494
|
|
|
495
495
|
// src/Components/Col/Col.tsx
|
|
496
|
+
var import_react2 = require("react");
|
|
496
497
|
var import_styled_components5 = __toESM(require("styled-components"));
|
|
497
498
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
498
499
|
var shouldForwardPropCol = (prop) => ![
|
|
@@ -528,10 +529,11 @@ var StyledCol = import_styled_components5.default.div.withConfig({
|
|
|
528
529
|
align-items: ${(props) => props.alignItems || "flex-start"};
|
|
529
530
|
box-sizing: border-box;
|
|
530
531
|
`;
|
|
531
|
-
var Col = (props) => {
|
|
532
|
+
var Col = (0, import_react2.forwardRef)((props, ref) => {
|
|
532
533
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
533
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledCol, __spreadProps(__spreadValues({}, otherProps), { children }));
|
|
534
|
-
};
|
|
534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledCol, __spreadProps(__spreadValues({ ref }, otherProps), { children }));
|
|
535
|
+
});
|
|
536
|
+
Col.displayName = "Col";
|
|
535
537
|
var Col_default = Col;
|
|
536
538
|
|
|
537
539
|
// src/Components/Text/Text.tsx
|
|
@@ -687,6 +689,8 @@ var Icon_default = Icon;
|
|
|
687
689
|
// src/Components/Divider/Divider.tsx
|
|
688
690
|
var import_styled_components7 = __toESM(require("styled-components"));
|
|
689
691
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
692
|
+
var isColorToken = (value) => Object.prototype.hasOwnProperty.call(colors, value);
|
|
693
|
+
var resolveColor = (value) => isColorToken(value) ? colors[value] : value;
|
|
690
694
|
var StyledDivider = import_styled_components7.default.div`
|
|
691
695
|
background-color: ${({ $color }) => $color || "#DCDCDC"};
|
|
692
696
|
${({ $orientation, $thickness }) => $orientation === "vertical" ? `
|
|
@@ -719,7 +723,7 @@ var Divider = (_a) => {
|
|
|
719
723
|
StyledDivider,
|
|
720
724
|
__spreadValues({
|
|
721
725
|
$orientation: orientation,
|
|
722
|
-
$color: color,
|
|
726
|
+
$color: resolveColor(color),
|
|
723
727
|
$thickness: thickness,
|
|
724
728
|
$ySpacing: ySpacing,
|
|
725
729
|
className,
|
|
@@ -824,7 +828,7 @@ var Bulk = ({
|
|
|
824
828
|
};
|
|
825
829
|
|
|
826
830
|
// src/Components/Collapse/Collapse.tsx
|
|
827
|
-
var
|
|
831
|
+
var import_react3 = require("react");
|
|
828
832
|
var import_styled_components8 = __toESM(require("styled-components"));
|
|
829
833
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
830
834
|
var Wrapper = import_styled_components8.default.div`
|
|
@@ -837,9 +841,9 @@ var Inner = import_styled_components8.default.div`
|
|
|
837
841
|
overflow-y: ${(p) => p.$maxHeight ? "auto" : "visible"};
|
|
838
842
|
`;
|
|
839
843
|
var Collapse = ({ open, children, maxHeight }) => {
|
|
840
|
-
const innerRef = (0,
|
|
841
|
-
const [height, setHeight] = (0,
|
|
842
|
-
const recalc = (0,
|
|
844
|
+
const innerRef = (0, import_react3.useRef)(null);
|
|
845
|
+
const [height, setHeight] = (0, import_react3.useState)(0);
|
|
846
|
+
const recalc = (0, import_react3.useCallback)(() => {
|
|
843
847
|
if (open && innerRef.current) {
|
|
844
848
|
const full = innerRef.current.scrollHeight;
|
|
845
849
|
setHeight(maxHeight ? Math.min(full, maxHeight) : full);
|
|
@@ -847,8 +851,8 @@ var Collapse = ({ open, children, maxHeight }) => {
|
|
|
847
851
|
setHeight(0);
|
|
848
852
|
}
|
|
849
853
|
}, [open, maxHeight]);
|
|
850
|
-
(0,
|
|
851
|
-
(0,
|
|
854
|
+
(0, import_react3.useEffect)(recalc, [recalc]);
|
|
855
|
+
(0, import_react3.useEffect)(() => {
|
|
852
856
|
if (!open || !innerRef.current) return;
|
|
853
857
|
const observer = new ResizeObserver(recalc);
|
|
854
858
|
observer.observe(innerRef.current);
|
|
@@ -858,7 +862,7 @@ var Collapse = ({ open, children, maxHeight }) => {
|
|
|
858
862
|
};
|
|
859
863
|
|
|
860
864
|
// src/Components/Button/Button.tsx
|
|
861
|
-
var
|
|
865
|
+
var import_react4 = require("react");
|
|
862
866
|
var import_styled_components9 = __toESM(require("styled-components"));
|
|
863
867
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
864
868
|
var defaultSizes = {
|
|
@@ -1029,7 +1033,7 @@ var Button = (_a) => {
|
|
|
1029
1033
|
"disabled",
|
|
1030
1034
|
"noHover"
|
|
1031
1035
|
]);
|
|
1032
|
-
const ref = (0,
|
|
1036
|
+
const ref = (0, import_react4.useRef)(null);
|
|
1033
1037
|
const sizeConfig = defaultSizes[size];
|
|
1034
1038
|
const renderIconSlot = (icon) => typeof icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1035
1039
|
Icon,
|
|
@@ -1078,7 +1082,7 @@ var Button = (_a) => {
|
|
|
1078
1082
|
};
|
|
1079
1083
|
|
|
1080
1084
|
// src/Components/Modal/Modal.tsx
|
|
1081
|
-
var
|
|
1085
|
+
var import_react5 = require("react");
|
|
1082
1086
|
var import_styled_components10 = __toESM(require("styled-components"));
|
|
1083
1087
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1084
1088
|
var shouldForwardProp5 = (prop) => !["width", "height", "minHeight", "padding", "backgroundColor"].includes(prop);
|
|
@@ -1154,7 +1158,7 @@ var Modal = (props) => {
|
|
|
1154
1158
|
const hideModal = () => {
|
|
1155
1159
|
closeModal == null ? void 0 : closeModal();
|
|
1156
1160
|
};
|
|
1157
|
-
(0,
|
|
1161
|
+
(0, import_react5.useEffect)(() => {
|
|
1158
1162
|
if (showModal) {
|
|
1159
1163
|
document.body.classList.add("modal-open");
|
|
1160
1164
|
} else {
|
|
@@ -1201,7 +1205,7 @@ var ModalConfirmation = (props) => {
|
|
|
1201
1205
|
};
|
|
1202
1206
|
|
|
1203
1207
|
// src/Components/NewModal/NewModal.tsx
|
|
1204
|
-
var
|
|
1208
|
+
var import_react6 = require("react");
|
|
1205
1209
|
|
|
1206
1210
|
// src/Components/Bubble/Bubble.tsx
|
|
1207
1211
|
var import_styled_components11 = __toESM(require("styled-components"));
|
|
@@ -1284,11 +1288,11 @@ var NewModal = ({
|
|
|
1284
1288
|
}) => {
|
|
1285
1289
|
const mainColor = colors[variant] || colors.blue_700;
|
|
1286
1290
|
const showHeader = Boolean(title || showCloseButton);
|
|
1287
|
-
const [isDragging, setIsDragging] = (0,
|
|
1288
|
-
const [offset, setOffset] = (0,
|
|
1289
|
-
const lastPointRef = (0,
|
|
1290
|
-
const headerRef = (0,
|
|
1291
|
-
(0,
|
|
1291
|
+
const [isDragging, setIsDragging] = (0, import_react6.useState)(false);
|
|
1292
|
+
const [offset, setOffset] = (0, import_react6.useState)({ x: 0, y: 0 });
|
|
1293
|
+
const lastPointRef = (0, import_react6.useRef)({ x: 0, y: 0 });
|
|
1294
|
+
const headerRef = (0, import_react6.useRef)(null);
|
|
1295
|
+
(0, import_react6.useEffect)(() => {
|
|
1292
1296
|
if (!isDraggable) return;
|
|
1293
1297
|
const onPointerMove = (e) => {
|
|
1294
1298
|
if (!isDragging) return;
|
|
@@ -1324,7 +1328,7 @@ var NewModal = ({
|
|
|
1324
1328
|
if (isDragging) return;
|
|
1325
1329
|
closeModal == null ? void 0 : closeModal(e);
|
|
1326
1330
|
};
|
|
1327
|
-
(0,
|
|
1331
|
+
(0, import_react6.useEffect)(() => {
|
|
1328
1332
|
if (showModal === true) setOffset({ x: 0, y: 0 });
|
|
1329
1333
|
}, [showModal]);
|
|
1330
1334
|
if (!showModal) return null;
|
|
@@ -1507,7 +1511,7 @@ var NewModal = ({
|
|
|
1507
1511
|
};
|
|
1508
1512
|
|
|
1509
1513
|
// src/Components/Drawer/Drawer.tsx
|
|
1510
|
-
var
|
|
1514
|
+
var import_react7 = require("react");
|
|
1511
1515
|
var import_styled_components12 = __toESM(require("styled-components"));
|
|
1512
1516
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1513
1517
|
var StyledOverlay = import_styled_components12.default.div`
|
|
@@ -1565,10 +1569,10 @@ var Drawer = ({
|
|
|
1565
1569
|
rightOutline = false,
|
|
1566
1570
|
footer
|
|
1567
1571
|
}) => {
|
|
1568
|
-
const [isRendered, setIsRendered] = (0,
|
|
1569
|
-
const [isVisible, setIsVisible] = (0,
|
|
1570
|
-
const panelRef = (0,
|
|
1571
|
-
(0,
|
|
1572
|
+
const [isRendered, setIsRendered] = (0, import_react7.useState)(showDrawer);
|
|
1573
|
+
const [isVisible, setIsVisible] = (0, import_react7.useState)(false);
|
|
1574
|
+
const panelRef = (0, import_react7.useRef)(null);
|
|
1575
|
+
(0, import_react7.useEffect)(() => {
|
|
1572
1576
|
if (showDrawer) {
|
|
1573
1577
|
setIsRendered(true);
|
|
1574
1578
|
requestAnimationFrame(() => setIsVisible(true));
|
|
@@ -1637,12 +1641,12 @@ var Drawer = ({
|
|
|
1637
1641
|
};
|
|
1638
1642
|
|
|
1639
1643
|
// src/Components/Toast/Toaster.tsx
|
|
1640
|
-
var
|
|
1644
|
+
var import_react9 = require("react");
|
|
1641
1645
|
var import_react_dom = require("react-dom");
|
|
1642
1646
|
var import_styled_components14 = __toESM(require("styled-components"));
|
|
1643
1647
|
|
|
1644
1648
|
// src/Components/Toast/ToastCard.tsx
|
|
1645
|
-
var
|
|
1649
|
+
var import_react8 = require("react");
|
|
1646
1650
|
var import_styled_components13 = __toESM(require("styled-components"));
|
|
1647
1651
|
|
|
1648
1652
|
// src/Components/Toast/toastStore.ts
|
|
@@ -1690,12 +1694,12 @@ var dismissToast = (id) => {
|
|
|
1690
1694
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1691
1695
|
var EXIT_DURATION = 180;
|
|
1692
1696
|
var ToastCard = ({ toastItem }) => {
|
|
1693
|
-
const [isExiting, setIsExiting] = (0,
|
|
1694
|
-
const handleDismiss = (0,
|
|
1697
|
+
const [isExiting, setIsExiting] = (0, import_react8.useState)(false);
|
|
1698
|
+
const handleDismiss = (0, import_react8.useCallback)(() => {
|
|
1695
1699
|
setIsExiting(true);
|
|
1696
1700
|
setTimeout(() => dismissToast(toastItem.id), EXIT_DURATION);
|
|
1697
1701
|
}, [toastItem.id]);
|
|
1698
|
-
(0,
|
|
1702
|
+
(0, import_react8.useEffect)(() => {
|
|
1699
1703
|
const dismissTimer = setTimeout(handleDismiss, toastItem.timeOut);
|
|
1700
1704
|
return () => clearTimeout(dismissTimer);
|
|
1701
1705
|
}, [handleDismiss, toastItem.timeOut]);
|
|
@@ -1812,7 +1816,7 @@ var ProgressBar = import_styled_components13.default.div`
|
|
|
1812
1816
|
// src/Components/Toast/Toaster.tsx
|
|
1813
1817
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1814
1818
|
var Toaster = () => {
|
|
1815
|
-
const toasts2 = (0,
|
|
1819
|
+
const toasts2 = (0, import_react9.useSyncExternalStore)(subscribeToasts, getToastsSnapshot);
|
|
1816
1820
|
if (toasts2.length === 0) return null;
|
|
1817
1821
|
return (0, import_react_dom.createPortal)(
|
|
1818
1822
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Stack, { "aria-live": "polite", children: toasts2.map((toastItem) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToastCard, { toastItem }, toastItem.id)) }),
|
|
@@ -2048,7 +2052,7 @@ var Link = (_a) => {
|
|
|
2048
2052
|
};
|
|
2049
2053
|
|
|
2050
2054
|
// src/Components/Avatar/Avatar.tsx
|
|
2051
|
-
var
|
|
2055
|
+
var import_react10 = require("react");
|
|
2052
2056
|
var import_styled_components18 = __toESM(require("styled-components"));
|
|
2053
2057
|
|
|
2054
2058
|
// src/Components/Image/Image.tsx
|
|
@@ -2141,7 +2145,7 @@ var Initials = import_styled_components18.default.span`
|
|
|
2141
2145
|
line-height: 1;
|
|
2142
2146
|
user-select: none;
|
|
2143
2147
|
`;
|
|
2144
|
-
var
|
|
2148
|
+
var resolveColor2 = (token, fallback) => {
|
|
2145
2149
|
if (!token) return fallback;
|
|
2146
2150
|
return colors[token] || token;
|
|
2147
2151
|
};
|
|
@@ -2156,9 +2160,9 @@ var Avatar = ({
|
|
|
2156
2160
|
badge
|
|
2157
2161
|
}) => {
|
|
2158
2162
|
var _a, _b, _c;
|
|
2159
|
-
const [hasImageError, setHasImageError] = (0,
|
|
2160
|
-
const resolvedBackground =
|
|
2161
|
-
const resolvedText =
|
|
2163
|
+
const [hasImageError, setHasImageError] = (0, import_react10.useState)(false);
|
|
2164
|
+
const resolvedBackground = resolveColor2(backgroundColor, colors.grey_300);
|
|
2165
|
+
const resolvedText = resolveColor2(textColor, colors.dark);
|
|
2162
2166
|
const initials = getInitials(name);
|
|
2163
2167
|
const sizePx = `${size}px`;
|
|
2164
2168
|
const borderRadius = shape === "circle" ? "50%" : "4px";
|
|
@@ -2194,7 +2198,7 @@ var Avatar = ({
|
|
|
2194
2198
|
};
|
|
2195
2199
|
|
|
2196
2200
|
// src/Components/Select/Select.tsx
|
|
2197
|
-
var
|
|
2201
|
+
var import_react11 = require("react");
|
|
2198
2202
|
var import_react_dom2 = __toESM(require("react-dom"));
|
|
2199
2203
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
2200
2204
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -2307,13 +2311,13 @@ var Select = ({
|
|
|
2307
2311
|
hideSearchBar,
|
|
2308
2312
|
noFlex
|
|
2309
2313
|
}) => {
|
|
2310
|
-
const [isOpen, setIsOpen] = (0,
|
|
2311
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2312
|
-
const [dropdownPosition, setDropdownPosition] = (0,
|
|
2313
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
2314
|
-
const containerRef = (0,
|
|
2315
|
-
const dropdownRef = (0,
|
|
2316
|
-
const searchInputRef = (0,
|
|
2314
|
+
const [isOpen, setIsOpen] = (0, import_react11.useState)(false);
|
|
2315
|
+
const [searchTerm, setSearchTerm] = (0, import_react11.useState)("");
|
|
2316
|
+
const [dropdownPosition, setDropdownPosition] = (0, import_react11.useState)({});
|
|
2317
|
+
const [activeIndex, setActiveIndex] = (0, import_react11.useState)(0);
|
|
2318
|
+
const containerRef = (0, import_react11.useRef)(null);
|
|
2319
|
+
const dropdownRef = (0, import_react11.useRef)(null);
|
|
2320
|
+
const searchInputRef = (0, import_react11.useRef)(null);
|
|
2317
2321
|
const selectedOption = options.find((option) => option.value === value);
|
|
2318
2322
|
const handleSelect = (option) => {
|
|
2319
2323
|
onChange == null ? void 0 : onChange(option.value);
|
|
@@ -2366,7 +2370,7 @@ var Select = ({
|
|
|
2366
2370
|
}
|
|
2367
2371
|
}
|
|
2368
2372
|
};
|
|
2369
|
-
(0,
|
|
2373
|
+
(0, import_react11.useEffect)(() => {
|
|
2370
2374
|
const handleClickOutside = (event) => {
|
|
2371
2375
|
if (containerRef.current && !containerRef.current.contains(event.target) && dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2372
2376
|
setSearchTerm("");
|
|
@@ -2461,7 +2465,7 @@ var Select = ({
|
|
|
2461
2465
|
};
|
|
2462
2466
|
|
|
2463
2467
|
// src/Components/Input/Input.tsx
|
|
2464
|
-
var
|
|
2468
|
+
var import_react12 = require("react");
|
|
2465
2469
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
2466
2470
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2467
2471
|
var shouldForwardProp8 = (prop) => ![
|
|
@@ -2667,7 +2671,7 @@ var displayToIso = (displayValue) => {
|
|
|
2667
2671
|
const isoDay = String(day).padStart(2, "0");
|
|
2668
2672
|
return `${yearStr}-${isoMonth}-${isoDay}`;
|
|
2669
2673
|
};
|
|
2670
|
-
var Input = (0,
|
|
2674
|
+
var Input = (0, import_react12.forwardRef)((props, ref) => {
|
|
2671
2675
|
const _a = props, {
|
|
2672
2676
|
label,
|
|
2673
2677
|
value,
|
|
@@ -2706,11 +2710,11 @@ var Input = (0, import_react11.forwardRef)((props, ref) => {
|
|
|
2706
2710
|
const inputName = otherProps == null ? void 0 : otherProps.name;
|
|
2707
2711
|
const { min, max, step } = otherProps || {};
|
|
2708
2712
|
const _b = otherProps || {}, { name } = _b, forwardProps = __objRest(_b, ["name"]);
|
|
2709
|
-
const [showPassword, setShowPassword] = (0,
|
|
2710
|
-
const [displayDateValue, setDisplayDateValue] = (0,
|
|
2711
|
-
const nativeDateRef = (0,
|
|
2712
|
-
const innerRef = (0,
|
|
2713
|
-
(0,
|
|
2713
|
+
const [showPassword, setShowPassword] = (0, import_react12.useState)(false);
|
|
2714
|
+
const [displayDateValue, setDisplayDateValue] = (0, import_react12.useState)("");
|
|
2715
|
+
const nativeDateRef = (0, import_react12.useRef)(null);
|
|
2716
|
+
const innerRef = (0, import_react12.useRef)(null);
|
|
2717
|
+
(0, import_react12.useImperativeHandle)(
|
|
2714
2718
|
ref,
|
|
2715
2719
|
() => innerRef.current
|
|
2716
2720
|
);
|
|
@@ -2728,7 +2732,7 @@ var Input = (0, import_react11.forwardRef)((props, ref) => {
|
|
|
2728
2732
|
const computedStyle = isSearch ? __spreadValues(__spreadValues({
|
|
2729
2733
|
paddingLeft: "34px"
|
|
2730
2734
|
}, hasSearchValue && onClear ? { paddingRight: "34px" } : {}), style2) : style2;
|
|
2731
|
-
(0,
|
|
2735
|
+
(0, import_react12.useEffect)(() => {
|
|
2732
2736
|
if (isDate) {
|
|
2733
2737
|
const formatted = formatIsoToDisplay(isoValue);
|
|
2734
2738
|
setDisplayDateValue((prev) => formatted !== prev ? formatted : prev);
|
|
@@ -2948,7 +2952,7 @@ var Checkbox = ({
|
|
|
2948
2952
|
};
|
|
2949
2953
|
|
|
2950
2954
|
// src/Components/Radio/Radio.tsx
|
|
2951
|
-
var
|
|
2955
|
+
var import_react13 = require("react");
|
|
2952
2956
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
2953
2957
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2954
2958
|
var RadioContainer = import_styled_components22.default.div`
|
|
@@ -3005,7 +3009,7 @@ var Radio = ({
|
|
|
3005
3009
|
value
|
|
3006
3010
|
}) => {
|
|
3007
3011
|
const color = colors[variant] || colors.blue_950;
|
|
3008
|
-
const generatedId = (0,
|
|
3012
|
+
const generatedId = (0, import_react13.useId)();
|
|
3009
3013
|
const uniqueId = `radio-${generatedId}`;
|
|
3010
3014
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(StyledLabel2, { htmlFor: uniqueId, disabled, children: [
|
|
3011
3015
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -3025,7 +3029,7 @@ var Radio = ({
|
|
|
3025
3029
|
};
|
|
3026
3030
|
|
|
3027
3031
|
// src/Components/Accordion/Accordion.tsx
|
|
3028
|
-
var
|
|
3032
|
+
var import_react14 = require("react");
|
|
3029
3033
|
var import_styled_components23 = __toESM(require("styled-components"));
|
|
3030
3034
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3031
3035
|
var Wrapper4 = import_styled_components23.default.div`
|
|
@@ -3086,8 +3090,8 @@ var Accordion = ({
|
|
|
3086
3090
|
backgroundHeader = colors.white
|
|
3087
3091
|
}) => {
|
|
3088
3092
|
const resolvedBackgroundHeader = typeof backgroundHeader === "string" && backgroundHeader in colors ? colors[backgroundHeader] : backgroundHeader;
|
|
3089
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3090
|
-
const [internalOpenId, setInternalOpenId] = (0,
|
|
3093
|
+
const [internalOpen, setInternalOpen] = (0, import_react14.useState)(defaultOpen);
|
|
3094
|
+
const [internalOpenId, setInternalOpenId] = (0, import_react14.useState)(
|
|
3091
3095
|
null
|
|
3092
3096
|
);
|
|
3093
3097
|
const isControlled = controlledOpen !== void 0;
|
|
@@ -3102,7 +3106,7 @@ var Accordion = ({
|
|
|
3102
3106
|
setInternalOpen((prev) => !prev);
|
|
3103
3107
|
}
|
|
3104
3108
|
};
|
|
3105
|
-
const toggleItem = (0,
|
|
3109
|
+
const toggleItem = (0, import_react14.useCallback)(
|
|
3106
3110
|
(id) => {
|
|
3107
3111
|
if (disabled) return;
|
|
3108
3112
|
const nextId2 = activeItemId === id ? null : id;
|
|
@@ -3169,7 +3173,7 @@ var Accordion = ({
|
|
|
3169
3173
|
};
|
|
3170
3174
|
|
|
3171
3175
|
// src/Components/ColorPicker/ColorPicker.tsx
|
|
3172
|
-
var
|
|
3176
|
+
var import_react15 = require("react");
|
|
3173
3177
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
3174
3178
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3175
3179
|
var SIZES = {
|
|
@@ -3246,7 +3250,7 @@ var TEXT_SIZE_MAP = {
|
|
|
3246
3250
|
m: "xs",
|
|
3247
3251
|
l: "s"
|
|
3248
3252
|
};
|
|
3249
|
-
var ColorPicker = (0,
|
|
3253
|
+
var ColorPicker = (0, import_react15.forwardRef)(
|
|
3250
3254
|
({
|
|
3251
3255
|
label,
|
|
3252
3256
|
value,
|
|
@@ -3255,11 +3259,11 @@ var ColorPicker = (0, import_react14.forwardRef)(
|
|
|
3255
3259
|
disabled = false,
|
|
3256
3260
|
size = "m"
|
|
3257
3261
|
}, ref) => {
|
|
3258
|
-
const innerRef = (0,
|
|
3259
|
-
const [internalColor, setInternalColor] = (0,
|
|
3262
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
3263
|
+
const [internalColor, setInternalColor] = (0, import_react15.useState)(defaultValue);
|
|
3260
3264
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
3261
3265
|
const dims = SIZES[size];
|
|
3262
|
-
(0,
|
|
3266
|
+
(0, import_react15.useEffect)(() => {
|
|
3263
3267
|
if (!ref) return;
|
|
3264
3268
|
if (typeof ref === "function") {
|
|
3265
3269
|
ref(innerRef.current);
|
|
@@ -3305,7 +3309,7 @@ var ColorPicker = (0, import_react14.forwardRef)(
|
|
|
3305
3309
|
ColorPicker.displayName = "ColorPicker";
|
|
3306
3310
|
|
|
3307
3311
|
// src/Components/SliderInput/SliderInput.tsx
|
|
3308
|
-
var
|
|
3312
|
+
var import_react16 = require("react");
|
|
3309
3313
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
3310
3314
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3311
3315
|
var Container3 = import_styled_components25.default.label`
|
|
@@ -3387,7 +3391,7 @@ var MinMaxRow = import_styled_components25.default.span`
|
|
|
3387
3391
|
justify-content: space-between;
|
|
3388
3392
|
align-items: center;
|
|
3389
3393
|
`;
|
|
3390
|
-
var SliderInput = (0,
|
|
3394
|
+
var SliderInput = (0, import_react16.forwardRef)(
|
|
3391
3395
|
({
|
|
3392
3396
|
value,
|
|
3393
3397
|
onChange,
|
|
@@ -3522,7 +3526,7 @@ var ListItem = (props) => {
|
|
|
3522
3526
|
};
|
|
3523
3527
|
|
|
3524
3528
|
// src/Components/Table/Table.tsx
|
|
3525
|
-
var
|
|
3529
|
+
var import_react17 = require("react");
|
|
3526
3530
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
3527
3531
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3528
3532
|
var shouldForwardPropTable = (prop) => ![
|
|
@@ -3558,7 +3562,7 @@ var StyledContainer3 = import_styled_components28.default.div.withConfig({
|
|
|
3558
3562
|
border: 1.4px solid ${colors.grey_200};
|
|
3559
3563
|
box-shadow: ${(props) => props.hasShadow ? "0 2px 12px 0 rgba(198, 198, 198, 0.25)" : "none"};
|
|
3560
3564
|
`;
|
|
3561
|
-
var Table = (0,
|
|
3565
|
+
var Table = (0, import_react17.forwardRef)((props, ref) => {
|
|
3562
3566
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3563
3567
|
const safeChildren = children;
|
|
3564
3568
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(StyledContainer3, __spreadProps(__spreadValues({}, otherProps), { ref, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(StyledTable, __spreadProps(__spreadValues({}, otherProps), { children: safeChildren })) }));
|
|
@@ -3588,7 +3592,7 @@ var TableHeader = (props) => {
|
|
|
3588
3592
|
};
|
|
3589
3593
|
|
|
3590
3594
|
// src/Components/Table/TableBody/TableBody.tsx
|
|
3591
|
-
var
|
|
3595
|
+
var import_react18 = require("react");
|
|
3592
3596
|
var import_styled_components30 = __toESM(require("styled-components"));
|
|
3593
3597
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3594
3598
|
var shouldForwardPropTableBody = (prop) => !["backgroundColor", "useEvenBackground", "fixedHeight", "color"].includes(
|
|
@@ -3607,7 +3611,7 @@ var StyledTableBody = import_styled_components30.default.div.withConfig({
|
|
|
3607
3611
|
background-color: ${(props) => props.useEvenBackground ? "#f2f2f2" : ""};
|
|
3608
3612
|
}
|
|
3609
3613
|
`;
|
|
3610
|
-
var TableBody = (0,
|
|
3614
|
+
var TableBody = (0, import_react18.forwardRef)(
|
|
3611
3615
|
(props, ref) => {
|
|
3612
3616
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3613
3617
|
const safeChildren = children;
|
|
@@ -3682,7 +3686,7 @@ var TableCell = (props) => {
|
|
|
3682
3686
|
};
|
|
3683
3687
|
|
|
3684
3688
|
// src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
|
|
3685
|
-
var
|
|
3689
|
+
var import_react19 = require("react");
|
|
3686
3690
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
3687
3691
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3688
3692
|
var shouldForwardPropTableHeaderCell = (prop) => !["useSort", "isSort", "flexGrow", "flexShrink", "width"].includes(prop);
|
|
@@ -3718,7 +3722,7 @@ var SortArrow = import_styled_components33.default.span`
|
|
|
3718
3722
|
`;
|
|
3719
3723
|
var TableHeaderCell = (props) => {
|
|
3720
3724
|
const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
|
|
3721
|
-
const [hovered, setHovered] = (0,
|
|
3725
|
+
const [hovered, setHovered] = (0, import_react19.useState)(false);
|
|
3722
3726
|
const showArrow = useSort && (isSort || hovered);
|
|
3723
3727
|
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
3724
3728
|
const arrowOpacity = isSort ? 1 : 0.35;
|
|
@@ -3866,7 +3870,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime42.
|
|
|
3866
3870
|
] });
|
|
3867
3871
|
|
|
3868
3872
|
// src/Components/Switch/Switch.tsx
|
|
3869
|
-
var
|
|
3873
|
+
var import_react20 = require("react");
|
|
3870
3874
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
3871
3875
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3872
3876
|
var BASE = {
|
|
@@ -3947,7 +3951,7 @@ var Knob = import_styled_components38.default.span`
|
|
|
3947
3951
|
transform: translateY(-50%) scale(0.96);
|
|
3948
3952
|
}
|
|
3949
3953
|
`;
|
|
3950
|
-
var Switch = (0,
|
|
3954
|
+
var Switch = (0, import_react20.forwardRef)(
|
|
3951
3955
|
(_a, ref) => {
|
|
3952
3956
|
var _b = _a, {
|
|
3953
3957
|
checked,
|
|
@@ -4003,7 +4007,7 @@ var CardSkeleton = () => {
|
|
|
4003
4007
|
};
|
|
4004
4008
|
|
|
4005
4009
|
// src/Components/Options/Options.tsx
|
|
4006
|
-
var
|
|
4010
|
+
var import_react21 = require("react");
|
|
4007
4011
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4008
4012
|
var Options = ({
|
|
4009
4013
|
icon,
|
|
@@ -4013,8 +4017,8 @@ var Options = ({
|
|
|
4013
4017
|
onChange,
|
|
4014
4018
|
disabled = false
|
|
4015
4019
|
}) => {
|
|
4016
|
-
const [state, setState] = (0,
|
|
4017
|
-
(0,
|
|
4020
|
+
const [state, setState] = (0, import_react21.useState)(0);
|
|
4021
|
+
(0, import_react21.useEffect)(() => {
|
|
4018
4022
|
if (defaultId) {
|
|
4019
4023
|
const defaultIndex = options.findIndex(
|
|
4020
4024
|
(option) => option.id === defaultId
|
|
@@ -4072,7 +4076,7 @@ var Options = ({
|
|
|
4072
4076
|
};
|
|
4073
4077
|
|
|
4074
4078
|
// src/Components/Stepper/Stepper.tsx
|
|
4075
|
-
var
|
|
4079
|
+
var import_react22 = require("react");
|
|
4076
4080
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
4077
4081
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4078
4082
|
var Wrapper5 = import_styled_components39.default.nav`
|
|
@@ -4111,7 +4115,7 @@ var Stepper = ({
|
|
|
4111
4115
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Wrapper5, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
4112
4116
|
const isActive = i === current;
|
|
4113
4117
|
const isCompleted = i < current;
|
|
4114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react22.Fragment, { children: [
|
|
4115
4119
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4116
4120
|
Circle,
|
|
4117
4121
|
{
|
|
@@ -4128,7 +4132,7 @@ var Stepper = ({
|
|
|
4128
4132
|
};
|
|
4129
4133
|
|
|
4130
4134
|
// src/Components/Tabs/Tabs.tsx
|
|
4131
|
-
var
|
|
4135
|
+
var import_react23 = require("react");
|
|
4132
4136
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
4133
4137
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4134
4138
|
var TOKENS = {
|
|
@@ -4299,13 +4303,13 @@ var Tabs = (_a) => {
|
|
|
4299
4303
|
"baselineColor",
|
|
4300
4304
|
"children"
|
|
4301
4305
|
]);
|
|
4302
|
-
const rootRef = (0,
|
|
4303
|
-
const refsMap = (0,
|
|
4304
|
-
const [bar, setBar] = (0,
|
|
4306
|
+
const rootRef = (0, import_react23.useRef)(null);
|
|
4307
|
+
const refsMap = (0, import_react23.useRef)(/* @__PURE__ */ new Map());
|
|
4308
|
+
const [bar, setBar] = (0, import_react23.useState)({ left: 0, width: 0 });
|
|
4305
4309
|
const setTabRef = (id) => (el) => {
|
|
4306
4310
|
if (el) refsMap.current.set(id, el);
|
|
4307
4311
|
};
|
|
4308
|
-
const updateBar = (0,
|
|
4312
|
+
const updateBar = (0, import_react23.useCallback)(() => {
|
|
4309
4313
|
const root = rootRef.current;
|
|
4310
4314
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
4311
4315
|
if (!root || !activeEl) return;
|
|
@@ -4313,7 +4317,7 @@ var Tabs = (_a) => {
|
|
|
4313
4317
|
const box = activeEl.getBoundingClientRect();
|
|
4314
4318
|
setBar({ left: box.left - rootBox.left, width: box.width });
|
|
4315
4319
|
}, [value]);
|
|
4316
|
-
(0,
|
|
4320
|
+
(0, import_react23.useEffect)(() => {
|
|
4317
4321
|
updateBar();
|
|
4318
4322
|
const ro = new ResizeObserver(updateBar);
|
|
4319
4323
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
@@ -4321,14 +4325,14 @@ var Tabs = (_a) => {
|
|
|
4321
4325
|
if (activeEl) ro.observe(activeEl);
|
|
4322
4326
|
return () => ro.disconnect();
|
|
4323
4327
|
}, [value, updateBar]);
|
|
4324
|
-
const handleSelect = (0,
|
|
4328
|
+
const handleSelect = (0, import_react23.useCallback)(
|
|
4325
4329
|
(id) => {
|
|
4326
4330
|
if (id !== value && onChange) onChange(id);
|
|
4327
4331
|
},
|
|
4328
4332
|
[onChange, value]
|
|
4329
4333
|
);
|
|
4330
4334
|
const isPillsFullWidth = variant === "pills" && align === "start";
|
|
4331
|
-
const rendered = (0,
|
|
4335
|
+
const rendered = (0, import_react23.useMemo)(() => {
|
|
4332
4336
|
if (items && items.length) {
|
|
4333
4337
|
return items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4334
4338
|
Tab,
|
|
@@ -4358,12 +4362,12 @@ var Tabs = (_a) => {
|
|
|
4358
4362
|
it.id
|
|
4359
4363
|
));
|
|
4360
4364
|
}
|
|
4361
|
-
return
|
|
4365
|
+
return import_react23.Children.map(children, (child) => {
|
|
4362
4366
|
var _a2;
|
|
4363
|
-
if (!(0,
|
|
4367
|
+
if (!(0, import_react23.isValidElement)(child)) return child;
|
|
4364
4368
|
const id = (_a2 = child.props.id) != null ? _a2 : child.key;
|
|
4365
4369
|
const active = id === value;
|
|
4366
|
-
return (0,
|
|
4370
|
+
return (0, import_react23.cloneElement)(child, {
|
|
4367
4371
|
active,
|
|
4368
4372
|
variant,
|
|
4369
4373
|
fullWidth: isPillsFullWidth,
|
|
@@ -4391,7 +4395,7 @@ var Tabs = (_a) => {
|
|
|
4391
4395
|
};
|
|
4392
4396
|
|
|
4393
4397
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
4394
|
-
var
|
|
4398
|
+
var import_react24 = require("react");
|
|
4395
4399
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
4396
4400
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4397
4401
|
var Container5 = import_styled_components41.default.div`
|
|
@@ -4434,8 +4438,8 @@ var MultiSelect = ({
|
|
|
4434
4438
|
width,
|
|
4435
4439
|
align = "left"
|
|
4436
4440
|
}) => {
|
|
4437
|
-
const [isOpen, setIsOpen] = (0,
|
|
4438
|
-
const dropdownRef = (0,
|
|
4441
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
4442
|
+
const dropdownRef = (0, import_react24.useRef)(null);
|
|
4439
4443
|
const toggleOption = (value) => {
|
|
4440
4444
|
if (!onChange) return;
|
|
4441
4445
|
if (selectedValues.includes(value)) {
|
|
@@ -4445,7 +4449,7 @@ var MultiSelect = ({
|
|
|
4445
4449
|
onChange([...selectedValues, value]);
|
|
4446
4450
|
}
|
|
4447
4451
|
};
|
|
4448
|
-
(0,
|
|
4452
|
+
(0, import_react24.useEffect)(() => {
|
|
4449
4453
|
const handleClickOutside = (e) => {
|
|
4450
4454
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
4451
4455
|
setIsOpen(false);
|
|
@@ -4487,7 +4491,7 @@ var MultiSelect = ({
|
|
|
4487
4491
|
};
|
|
4488
4492
|
|
|
4489
4493
|
// src/Components/DatePicker/DatePicker.tsx
|
|
4490
|
-
var
|
|
4494
|
+
var import_react25 = require("react");
|
|
4491
4495
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4492
4496
|
var LOCALE_MAP = {
|
|
4493
4497
|
fr: "fr-FR",
|
|
@@ -4558,28 +4562,28 @@ var DatePicker = (props) => {
|
|
|
4558
4562
|
const resolvedLocale = resolveLocale(locale);
|
|
4559
4563
|
const monthNames = getMonthNames(resolvedLocale);
|
|
4560
4564
|
const dayNames = getDayNames(resolvedLocale);
|
|
4561
|
-
const [isOpen, setIsOpen] = (0,
|
|
4562
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
4563
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
4564
|
-
const [singleDate, setSingleDate] = (0,
|
|
4565
|
+
const [isOpen, setIsOpen] = (0, import_react25.useState)(defaultOpen);
|
|
4566
|
+
const [currentMonth, setCurrentMonth] = (0, import_react25.useState)(/* @__PURE__ */ new Date());
|
|
4567
|
+
const [isSelectingEnd, setIsSelectingEnd] = (0, import_react25.useState)(false);
|
|
4568
|
+
const [singleDate, setSingleDate] = (0, import_react25.useState)(
|
|
4565
4569
|
isSingle ? (_a = props.value) != null ? _a : null : null
|
|
4566
4570
|
);
|
|
4567
|
-
const [startDate, setStartDate] = (0,
|
|
4571
|
+
const [startDate, setStartDate] = (0, import_react25.useState)(
|
|
4568
4572
|
!isSingle ? (_c = (_b = props.value) == null ? void 0 : _b.start) != null ? _c : null : null
|
|
4569
4573
|
);
|
|
4570
|
-
const [endDate, setEndDate] = (0,
|
|
4574
|
+
const [endDate, setEndDate] = (0, import_react25.useState)(
|
|
4571
4575
|
!isSingle ? (_e = (_d = props.value) == null ? void 0 : _d.end) != null ? _e : null : null
|
|
4572
4576
|
);
|
|
4573
|
-
const ref = (0,
|
|
4577
|
+
const ref = (0, import_react25.useRef)(null);
|
|
4574
4578
|
const singleValueMs = isSingle ? (_f = props.value) == null ? void 0 : _f.getTime() : void 0;
|
|
4575
4579
|
const rangeStartMs = !isSingle ? (_h = (_g = props.value) == null ? void 0 : _g.start) == null ? void 0 : _h.getTime() : void 0;
|
|
4576
4580
|
const rangeEndMs = !isSingle ? (_j = (_i = props.value) == null ? void 0 : _i.end) == null ? void 0 : _j.getTime() : void 0;
|
|
4577
|
-
(0,
|
|
4581
|
+
(0, import_react25.useEffect)(() => {
|
|
4578
4582
|
if (!isSingle) return;
|
|
4579
4583
|
const v = props.value;
|
|
4580
4584
|
if (v !== void 0) setSingleDate(v);
|
|
4581
4585
|
}, [singleValueMs]);
|
|
4582
|
-
(0,
|
|
4586
|
+
(0, import_react25.useEffect)(() => {
|
|
4583
4587
|
var _a2, _b2;
|
|
4584
4588
|
if (isSingle) return;
|
|
4585
4589
|
const v = props.value;
|
|
@@ -4587,7 +4591,7 @@ var DatePicker = (props) => {
|
|
|
4587
4591
|
setStartDate((_a2 = v == null ? void 0 : v.start) != null ? _a2 : null);
|
|
4588
4592
|
setEndDate((_b2 = v == null ? void 0 : v.end) != null ? _b2 : null);
|
|
4589
4593
|
}, [rangeStartMs, rangeEndMs]);
|
|
4590
|
-
(0,
|
|
4594
|
+
(0, import_react25.useEffect)(() => {
|
|
4591
4595
|
const handleClickOutside = (e) => {
|
|
4592
4596
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
4593
4597
|
setIsOpen(false);
|
|
@@ -4871,7 +4875,7 @@ var DatePicker = (props) => {
|
|
|
4871
4875
|
};
|
|
4872
4876
|
|
|
4873
4877
|
// src/Components/IconTabs/IconTabs.tsx
|
|
4874
|
-
var
|
|
4878
|
+
var import_react26 = require("react");
|
|
4875
4879
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
4876
4880
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4877
4881
|
var TabsContainer = import_styled_components42.default.div`
|
|
@@ -4933,10 +4937,10 @@ var IconTabs = ({
|
|
|
4933
4937
|
defaultTabIndex = 0
|
|
4934
4938
|
}) => {
|
|
4935
4939
|
var _a;
|
|
4936
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
4937
|
-
const sliderRef = (0,
|
|
4938
|
-
const tabRefs = (0,
|
|
4939
|
-
(0,
|
|
4940
|
+
const [selectedTab, setSelectedTab] = (0, import_react26.useState)(defaultTabIndex);
|
|
4941
|
+
const sliderRef = (0, import_react26.useRef)(null);
|
|
4942
|
+
const tabRefs = (0, import_react26.useRef)([]);
|
|
4943
|
+
(0, import_react26.useEffect)(() => {
|
|
4940
4944
|
if (defaultTabIndex >= 0 && defaultTabIndex !== selectedTab) {
|
|
4941
4945
|
setSelectedTab(defaultTabIndex);
|
|
4942
4946
|
}
|
|
@@ -4947,7 +4951,7 @@ var IconTabs = ({
|
|
|
4947
4951
|
onTabChange(index);
|
|
4948
4952
|
}
|
|
4949
4953
|
};
|
|
4950
|
-
(0,
|
|
4954
|
+
(0, import_react26.useEffect)(() => {
|
|
4951
4955
|
if (sliderRef.current && tabRefs.current[selectedTab]) {
|
|
4952
4956
|
const selectedTabRect = tabRefs.current[selectedTab].getBoundingClientRect();
|
|
4953
4957
|
const parentRect = tabRefs.current[selectedTab].parentElement.getBoundingClientRect();
|
|
@@ -4986,7 +4990,7 @@ var IconTabs = ({
|
|
|
4986
4990
|
};
|
|
4987
4991
|
|
|
4988
4992
|
// src/Components/Popover/Popover.tsx
|
|
4989
|
-
var
|
|
4993
|
+
var import_react27 = require("react");
|
|
4990
4994
|
var import_react_dom3 = require("react-dom");
|
|
4991
4995
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
4992
4996
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
@@ -5032,15 +5036,15 @@ var Popover = ({
|
|
|
5032
5036
|
align = "right",
|
|
5033
5037
|
fullWidth = false
|
|
5034
5038
|
}) => {
|
|
5035
|
-
const [open, setOpen] = (0,
|
|
5036
|
-
const ref = (0,
|
|
5037
|
-
const menuRef = (0,
|
|
5038
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
5039
|
+
const [open, setOpen] = (0, import_react27.useState)(false);
|
|
5040
|
+
const ref = (0, import_react27.useRef)(null);
|
|
5041
|
+
const menuRef = (0, import_react27.useRef)(null);
|
|
5042
|
+
const [menuPosition, setMenuPosition] = (0, import_react27.useState)({
|
|
5039
5043
|
mode: "default",
|
|
5040
5044
|
top: 0,
|
|
5041
5045
|
left: 0
|
|
5042
5046
|
});
|
|
5043
|
-
const updatePosition = (0,
|
|
5047
|
+
const updatePosition = (0, import_react27.useCallback)(() => {
|
|
5044
5048
|
var _a;
|
|
5045
5049
|
if (!ref.current) return;
|
|
5046
5050
|
if (anchorRef == null ? void 0 : anchorRef.current) {
|
|
@@ -5069,7 +5073,7 @@ var Popover = ({
|
|
|
5069
5073
|
});
|
|
5070
5074
|
}
|
|
5071
5075
|
}, [items.length, anchorRef, offsetY, align]);
|
|
5072
|
-
(0,
|
|
5076
|
+
(0, import_react27.useEffect)(() => {
|
|
5073
5077
|
const handleClickOutside = (event) => {
|
|
5074
5078
|
var _a, _b;
|
|
5075
5079
|
const isInTrigger = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
|
@@ -5394,7 +5398,7 @@ var Banner = ({
|
|
|
5394
5398
|
};
|
|
5395
5399
|
|
|
5396
5400
|
// src/Components/Tooltip/Tooltip.tsx
|
|
5397
|
-
var
|
|
5401
|
+
var import_react28 = require("react");
|
|
5398
5402
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
5399
5403
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5400
5404
|
var StyledTooltipWrapper = import_styled_components46.default.div`
|
|
@@ -5498,7 +5502,7 @@ var Tooltip = ({
|
|
|
5498
5502
|
direction = "top",
|
|
5499
5503
|
children
|
|
5500
5504
|
}) => {
|
|
5501
|
-
const [isVisible, setIsVisible] = (0,
|
|
5505
|
+
const [isVisible, setIsVisible] = (0, import_react28.useState)(false);
|
|
5502
5506
|
const handleMouseEnter = () => setIsVisible(true);
|
|
5503
5507
|
const handleMouseLeave = () => setIsVisible(false);
|
|
5504
5508
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
@@ -5525,7 +5529,7 @@ var Tooltip = ({
|
|
|
5525
5529
|
};
|
|
5526
5530
|
|
|
5527
5531
|
// src/Components/Pagination/Pagination.tsx
|
|
5528
|
-
var
|
|
5532
|
+
var import_react29 = require("react");
|
|
5529
5533
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5530
5534
|
var getPageNumbers = (current, total) => {
|
|
5531
5535
|
if (total <= 5) {
|
|
@@ -5549,7 +5553,7 @@ var Pagination = ({
|
|
|
5549
5553
|
summaryLabel
|
|
5550
5554
|
}) => {
|
|
5551
5555
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
5552
|
-
const pages = (0,
|
|
5556
|
+
const pages = (0, import_react29.useMemo)(
|
|
5553
5557
|
() => getPageNumbers(currentPage, totalPages),
|
|
5554
5558
|
[currentPage, totalPages]
|
|
5555
5559
|
);
|
|
@@ -5603,7 +5607,7 @@ var Pagination = ({
|
|
|
5603
5607
|
};
|
|
5604
5608
|
|
|
5605
5609
|
// src/Components/FileUploadZone/FileUploadZone.tsx
|
|
5606
|
-
var
|
|
5610
|
+
var import_react30 = require("react");
|
|
5607
5611
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
5608
5612
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5609
5613
|
var ACCEPT_MAP = {
|
|
@@ -5690,19 +5694,19 @@ var FileUploadZone = ({
|
|
|
5690
5694
|
icon = "cloud-arrow-up",
|
|
5691
5695
|
showFileName = false
|
|
5692
5696
|
}) => {
|
|
5693
|
-
const [isDragging, setIsDragging] = (0,
|
|
5694
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
5697
|
+
const [isDragging, setIsDragging] = (0, import_react30.useState)(false);
|
|
5698
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react30.useState)(
|
|
5695
5699
|
null
|
|
5696
5700
|
);
|
|
5697
|
-
const [fileType, setFileType] = (0,
|
|
5698
|
-
const [fileName, setFileName] = (0,
|
|
5699
|
-
const [inlineError, setInlineError] = (0,
|
|
5700
|
-
const inputRef = (0,
|
|
5701
|
+
const [fileType, setFileType] = (0, import_react30.useState)(null);
|
|
5702
|
+
const [fileName, setFileName] = (0, import_react30.useState)(null);
|
|
5703
|
+
const [inlineError, setInlineError] = (0, import_react30.useState)(null);
|
|
5704
|
+
const inputRef = (0, import_react30.useRef)(null);
|
|
5701
5705
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
5702
5706
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
5703
5707
|
const acceptString = mimeTypes.join(",");
|
|
5704
5708
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
5705
|
-
const emitError = (0,
|
|
5709
|
+
const emitError = (0, import_react30.useCallback)(
|
|
5706
5710
|
(message) => {
|
|
5707
5711
|
if (onError) {
|
|
5708
5712
|
onError(message);
|
|
@@ -5712,7 +5716,7 @@ var FileUploadZone = ({
|
|
|
5712
5716
|
},
|
|
5713
5717
|
[onError]
|
|
5714
5718
|
);
|
|
5715
|
-
const validateFile = (0,
|
|
5719
|
+
const validateFile = (0, import_react30.useCallback)(
|
|
5716
5720
|
(file) => {
|
|
5717
5721
|
if (!mimeTypes.includes(file.type)) {
|
|
5718
5722
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -5727,7 +5731,7 @@ var FileUploadZone = ({
|
|
|
5727
5731
|
},
|
|
5728
5732
|
[mimeTypes, maxSizeMB]
|
|
5729
5733
|
);
|
|
5730
|
-
const processFile = (0,
|
|
5734
|
+
const processFile = (0, import_react30.useCallback)(
|
|
5731
5735
|
(file) => {
|
|
5732
5736
|
setInlineError(null);
|
|
5733
5737
|
const result = validateFile(file);
|
|
@@ -5745,7 +5749,7 @@ var FileUploadZone = ({
|
|
|
5745
5749
|
},
|
|
5746
5750
|
[validateFile, onSave, showPreview, emitError]
|
|
5747
5751
|
);
|
|
5748
|
-
const processFiles = (0,
|
|
5752
|
+
const processFiles = (0, import_react30.useCallback)(
|
|
5749
5753
|
(files) => {
|
|
5750
5754
|
setInlineError(null);
|
|
5751
5755
|
for (const file of files) {
|
package/dist/index.mjs
CHANGED
|
@@ -354,6 +354,7 @@ Row.displayName = "Row";
|
|
|
354
354
|
var Row_default = Row;
|
|
355
355
|
|
|
356
356
|
// src/Components/Col/Col.tsx
|
|
357
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
357
358
|
import styled5 from "styled-components";
|
|
358
359
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
359
360
|
var shouldForwardPropCol = (prop) => ![
|
|
@@ -389,10 +390,11 @@ var StyledCol = styled5.div.withConfig({
|
|
|
389
390
|
align-items: ${(props) => props.alignItems || "flex-start"};
|
|
390
391
|
box-sizing: border-box;
|
|
391
392
|
`;
|
|
392
|
-
var Col = (props) => {
|
|
393
|
+
var Col = forwardRef2((props, ref) => {
|
|
393
394
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
394
|
-
return /* @__PURE__ */ jsx5(StyledCol, __spreadProps(__spreadValues({}, otherProps), { children }));
|
|
395
|
-
};
|
|
395
|
+
return /* @__PURE__ */ jsx5(StyledCol, __spreadProps(__spreadValues({ ref }, otherProps), { children }));
|
|
396
|
+
});
|
|
397
|
+
Col.displayName = "Col";
|
|
396
398
|
var Col_default = Col;
|
|
397
399
|
|
|
398
400
|
// src/Components/Text/Text.tsx
|
|
@@ -548,6 +550,8 @@ var Icon_default = Icon;
|
|
|
548
550
|
// src/Components/Divider/Divider.tsx
|
|
549
551
|
import styled7 from "styled-components";
|
|
550
552
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
553
|
+
var isColorToken = (value) => Object.prototype.hasOwnProperty.call(colors, value);
|
|
554
|
+
var resolveColor = (value) => isColorToken(value) ? colors[value] : value;
|
|
551
555
|
var StyledDivider = styled7.div`
|
|
552
556
|
background-color: ${({ $color }) => $color || "#DCDCDC"};
|
|
553
557
|
${({ $orientation, $thickness }) => $orientation === "vertical" ? `
|
|
@@ -580,7 +584,7 @@ var Divider = (_a) => {
|
|
|
580
584
|
StyledDivider,
|
|
581
585
|
__spreadValues({
|
|
582
586
|
$orientation: orientation,
|
|
583
|
-
$color: color,
|
|
587
|
+
$color: resolveColor(color),
|
|
584
588
|
$thickness: thickness,
|
|
585
589
|
$ySpacing: ySpacing,
|
|
586
590
|
className,
|
|
@@ -2002,7 +2006,7 @@ var Initials = styled18.span`
|
|
|
2002
2006
|
line-height: 1;
|
|
2003
2007
|
user-select: none;
|
|
2004
2008
|
`;
|
|
2005
|
-
var
|
|
2009
|
+
var resolveColor2 = (token, fallback) => {
|
|
2006
2010
|
if (!token) return fallback;
|
|
2007
2011
|
return colors[token] || token;
|
|
2008
2012
|
};
|
|
@@ -2018,8 +2022,8 @@ var Avatar = ({
|
|
|
2018
2022
|
}) => {
|
|
2019
2023
|
var _a, _b, _c;
|
|
2020
2024
|
const [hasImageError, setHasImageError] = useState5(false);
|
|
2021
|
-
const resolvedBackground =
|
|
2022
|
-
const resolvedText =
|
|
2025
|
+
const resolvedBackground = resolveColor2(backgroundColor, colors.grey_300);
|
|
2026
|
+
const resolvedText = resolveColor2(textColor, colors.dark);
|
|
2023
2027
|
const initials = getInitials(name);
|
|
2024
2028
|
const sizePx = `${size}px`;
|
|
2025
2029
|
const borderRadius = shape === "circle" ? "50%" : "4px";
|
|
@@ -2323,7 +2327,7 @@ var Select = ({
|
|
|
2323
2327
|
|
|
2324
2328
|
// src/Components/Input/Input.tsx
|
|
2325
2329
|
import {
|
|
2326
|
-
forwardRef as
|
|
2330
|
+
forwardRef as forwardRef3,
|
|
2327
2331
|
useEffect as useEffect7,
|
|
2328
2332
|
useImperativeHandle,
|
|
2329
2333
|
useRef as useRef6,
|
|
@@ -2534,7 +2538,7 @@ var displayToIso = (displayValue) => {
|
|
|
2534
2538
|
const isoDay = String(day).padStart(2, "0");
|
|
2535
2539
|
return `${yearStr}-${isoMonth}-${isoDay}`;
|
|
2536
2540
|
};
|
|
2537
|
-
var Input =
|
|
2541
|
+
var Input = forwardRef3((props, ref) => {
|
|
2538
2542
|
const _a = props, {
|
|
2539
2543
|
label,
|
|
2540
2544
|
value,
|
|
@@ -3036,7 +3040,7 @@ var Accordion = ({
|
|
|
3036
3040
|
};
|
|
3037
3041
|
|
|
3038
3042
|
// src/Components/ColorPicker/ColorPicker.tsx
|
|
3039
|
-
import { forwardRef as
|
|
3043
|
+
import { forwardRef as forwardRef4, useState as useState9, useRef as useRef7, useEffect as useEffect8 } from "react";
|
|
3040
3044
|
import styled24 from "styled-components";
|
|
3041
3045
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3042
3046
|
var SIZES = {
|
|
@@ -3113,7 +3117,7 @@ var TEXT_SIZE_MAP = {
|
|
|
3113
3117
|
m: "xs",
|
|
3114
3118
|
l: "s"
|
|
3115
3119
|
};
|
|
3116
|
-
var ColorPicker =
|
|
3120
|
+
var ColorPicker = forwardRef4(
|
|
3117
3121
|
({
|
|
3118
3122
|
label,
|
|
3119
3123
|
value,
|
|
@@ -3172,7 +3176,7 @@ var ColorPicker = forwardRef3(
|
|
|
3172
3176
|
ColorPicker.displayName = "ColorPicker";
|
|
3173
3177
|
|
|
3174
3178
|
// src/Components/SliderInput/SliderInput.tsx
|
|
3175
|
-
import { forwardRef as
|
|
3179
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
3176
3180
|
import styled25 from "styled-components";
|
|
3177
3181
|
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3178
3182
|
var Container3 = styled25.label`
|
|
@@ -3254,7 +3258,7 @@ var MinMaxRow = styled25.span`
|
|
|
3254
3258
|
justify-content: space-between;
|
|
3255
3259
|
align-items: center;
|
|
3256
3260
|
`;
|
|
3257
|
-
var SliderInput =
|
|
3261
|
+
var SliderInput = forwardRef5(
|
|
3258
3262
|
({
|
|
3259
3263
|
value,
|
|
3260
3264
|
onChange,
|
|
@@ -3389,7 +3393,7 @@ var ListItem = (props) => {
|
|
|
3389
3393
|
};
|
|
3390
3394
|
|
|
3391
3395
|
// src/Components/Table/Table.tsx
|
|
3392
|
-
import { forwardRef as
|
|
3396
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
3393
3397
|
import styled28 from "styled-components";
|
|
3394
3398
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3395
3399
|
var shouldForwardPropTable = (prop) => ![
|
|
@@ -3425,7 +3429,7 @@ var StyledContainer3 = styled28.div.withConfig({
|
|
|
3425
3429
|
border: 1.4px solid ${colors.grey_200};
|
|
3426
3430
|
box-shadow: ${(props) => props.hasShadow ? "0 2px 12px 0 rgba(198, 198, 198, 0.25)" : "none"};
|
|
3427
3431
|
`;
|
|
3428
|
-
var Table =
|
|
3432
|
+
var Table = forwardRef6((props, ref) => {
|
|
3429
3433
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3430
3434
|
const safeChildren = children;
|
|
3431
3435
|
return /* @__PURE__ */ jsx32(StyledContainer3, __spreadProps(__spreadValues({}, otherProps), { ref, children: /* @__PURE__ */ jsx32(StyledTable, __spreadProps(__spreadValues({}, otherProps), { children: safeChildren })) }));
|
|
@@ -3455,7 +3459,7 @@ var TableHeader = (props) => {
|
|
|
3455
3459
|
};
|
|
3456
3460
|
|
|
3457
3461
|
// src/Components/Table/TableBody/TableBody.tsx
|
|
3458
|
-
import { forwardRef as
|
|
3462
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
3459
3463
|
import styled30 from "styled-components";
|
|
3460
3464
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3461
3465
|
var shouldForwardPropTableBody = (prop) => !["backgroundColor", "useEvenBackground", "fixedHeight", "color"].includes(
|
|
@@ -3474,7 +3478,7 @@ var StyledTableBody = styled30.div.withConfig({
|
|
|
3474
3478
|
background-color: ${(props) => props.useEvenBackground ? "#f2f2f2" : ""};
|
|
3475
3479
|
}
|
|
3476
3480
|
`;
|
|
3477
|
-
var TableBody =
|
|
3481
|
+
var TableBody = forwardRef7(
|
|
3478
3482
|
(props, ref) => {
|
|
3479
3483
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3480
3484
|
const safeChildren = children;
|
|
@@ -3733,7 +3737,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs18(Fragment4, { child
|
|
|
3733
3737
|
] });
|
|
3734
3738
|
|
|
3735
3739
|
// src/Components/Switch/Switch.tsx
|
|
3736
|
-
import { forwardRef as
|
|
3740
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
3737
3741
|
import styled38, { css } from "styled-components";
|
|
3738
3742
|
import { jsx as jsx43, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3739
3743
|
var BASE = {
|
|
@@ -3814,7 +3818,7 @@ var Knob = styled38.span`
|
|
|
3814
3818
|
transform: translateY(-50%) scale(0.96);
|
|
3815
3819
|
}
|
|
3816
3820
|
`;
|
|
3817
|
-
var Switch =
|
|
3821
|
+
var Switch = forwardRef8(
|
|
3818
3822
|
(_a, ref) => {
|
|
3819
3823
|
var _b = _a, {
|
|
3820
3824
|
checked,
|