design-zystem 1.0.282 → 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 +132 -130
- package/dist/index.mjs +17 -15
- 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
|
|
@@ -826,7 +828,7 @@ var Bulk = ({
|
|
|
826
828
|
};
|
|
827
829
|
|
|
828
830
|
// src/Components/Collapse/Collapse.tsx
|
|
829
|
-
var
|
|
831
|
+
var import_react3 = require("react");
|
|
830
832
|
var import_styled_components8 = __toESM(require("styled-components"));
|
|
831
833
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
832
834
|
var Wrapper = import_styled_components8.default.div`
|
|
@@ -839,9 +841,9 @@ var Inner = import_styled_components8.default.div`
|
|
|
839
841
|
overflow-y: ${(p) => p.$maxHeight ? "auto" : "visible"};
|
|
840
842
|
`;
|
|
841
843
|
var Collapse = ({ open, children, maxHeight }) => {
|
|
842
|
-
const innerRef = (0,
|
|
843
|
-
const [height, setHeight] = (0,
|
|
844
|
-
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)(() => {
|
|
845
847
|
if (open && innerRef.current) {
|
|
846
848
|
const full = innerRef.current.scrollHeight;
|
|
847
849
|
setHeight(maxHeight ? Math.min(full, maxHeight) : full);
|
|
@@ -849,8 +851,8 @@ var Collapse = ({ open, children, maxHeight }) => {
|
|
|
849
851
|
setHeight(0);
|
|
850
852
|
}
|
|
851
853
|
}, [open, maxHeight]);
|
|
852
|
-
(0,
|
|
853
|
-
(0,
|
|
854
|
+
(0, import_react3.useEffect)(recalc, [recalc]);
|
|
855
|
+
(0, import_react3.useEffect)(() => {
|
|
854
856
|
if (!open || !innerRef.current) return;
|
|
855
857
|
const observer = new ResizeObserver(recalc);
|
|
856
858
|
observer.observe(innerRef.current);
|
|
@@ -860,7 +862,7 @@ var Collapse = ({ open, children, maxHeight }) => {
|
|
|
860
862
|
};
|
|
861
863
|
|
|
862
864
|
// src/Components/Button/Button.tsx
|
|
863
|
-
var
|
|
865
|
+
var import_react4 = require("react");
|
|
864
866
|
var import_styled_components9 = __toESM(require("styled-components"));
|
|
865
867
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
866
868
|
var defaultSizes = {
|
|
@@ -1031,7 +1033,7 @@ var Button = (_a) => {
|
|
|
1031
1033
|
"disabled",
|
|
1032
1034
|
"noHover"
|
|
1033
1035
|
]);
|
|
1034
|
-
const ref = (0,
|
|
1036
|
+
const ref = (0, import_react4.useRef)(null);
|
|
1035
1037
|
const sizeConfig = defaultSizes[size];
|
|
1036
1038
|
const renderIconSlot = (icon) => typeof icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1037
1039
|
Icon,
|
|
@@ -1080,7 +1082,7 @@ var Button = (_a) => {
|
|
|
1080
1082
|
};
|
|
1081
1083
|
|
|
1082
1084
|
// src/Components/Modal/Modal.tsx
|
|
1083
|
-
var
|
|
1085
|
+
var import_react5 = require("react");
|
|
1084
1086
|
var import_styled_components10 = __toESM(require("styled-components"));
|
|
1085
1087
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1086
1088
|
var shouldForwardProp5 = (prop) => !["width", "height", "minHeight", "padding", "backgroundColor"].includes(prop);
|
|
@@ -1156,7 +1158,7 @@ var Modal = (props) => {
|
|
|
1156
1158
|
const hideModal = () => {
|
|
1157
1159
|
closeModal == null ? void 0 : closeModal();
|
|
1158
1160
|
};
|
|
1159
|
-
(0,
|
|
1161
|
+
(0, import_react5.useEffect)(() => {
|
|
1160
1162
|
if (showModal) {
|
|
1161
1163
|
document.body.classList.add("modal-open");
|
|
1162
1164
|
} else {
|
|
@@ -1203,7 +1205,7 @@ var ModalConfirmation = (props) => {
|
|
|
1203
1205
|
};
|
|
1204
1206
|
|
|
1205
1207
|
// src/Components/NewModal/NewModal.tsx
|
|
1206
|
-
var
|
|
1208
|
+
var import_react6 = require("react");
|
|
1207
1209
|
|
|
1208
1210
|
// src/Components/Bubble/Bubble.tsx
|
|
1209
1211
|
var import_styled_components11 = __toESM(require("styled-components"));
|
|
@@ -1286,11 +1288,11 @@ var NewModal = ({
|
|
|
1286
1288
|
}) => {
|
|
1287
1289
|
const mainColor = colors[variant] || colors.blue_700;
|
|
1288
1290
|
const showHeader = Boolean(title || showCloseButton);
|
|
1289
|
-
const [isDragging, setIsDragging] = (0,
|
|
1290
|
-
const [offset, setOffset] = (0,
|
|
1291
|
-
const lastPointRef = (0,
|
|
1292
|
-
const headerRef = (0,
|
|
1293
|
-
(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)(() => {
|
|
1294
1296
|
if (!isDraggable) return;
|
|
1295
1297
|
const onPointerMove = (e) => {
|
|
1296
1298
|
if (!isDragging) return;
|
|
@@ -1326,7 +1328,7 @@ var NewModal = ({
|
|
|
1326
1328
|
if (isDragging) return;
|
|
1327
1329
|
closeModal == null ? void 0 : closeModal(e);
|
|
1328
1330
|
};
|
|
1329
|
-
(0,
|
|
1331
|
+
(0, import_react6.useEffect)(() => {
|
|
1330
1332
|
if (showModal === true) setOffset({ x: 0, y: 0 });
|
|
1331
1333
|
}, [showModal]);
|
|
1332
1334
|
if (!showModal) return null;
|
|
@@ -1509,7 +1511,7 @@ var NewModal = ({
|
|
|
1509
1511
|
};
|
|
1510
1512
|
|
|
1511
1513
|
// src/Components/Drawer/Drawer.tsx
|
|
1512
|
-
var
|
|
1514
|
+
var import_react7 = require("react");
|
|
1513
1515
|
var import_styled_components12 = __toESM(require("styled-components"));
|
|
1514
1516
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1515
1517
|
var StyledOverlay = import_styled_components12.default.div`
|
|
@@ -1567,10 +1569,10 @@ var Drawer = ({
|
|
|
1567
1569
|
rightOutline = false,
|
|
1568
1570
|
footer
|
|
1569
1571
|
}) => {
|
|
1570
|
-
const [isRendered, setIsRendered] = (0,
|
|
1571
|
-
const [isVisible, setIsVisible] = (0,
|
|
1572
|
-
const panelRef = (0,
|
|
1573
|
-
(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)(() => {
|
|
1574
1576
|
if (showDrawer) {
|
|
1575
1577
|
setIsRendered(true);
|
|
1576
1578
|
requestAnimationFrame(() => setIsVisible(true));
|
|
@@ -1639,12 +1641,12 @@ var Drawer = ({
|
|
|
1639
1641
|
};
|
|
1640
1642
|
|
|
1641
1643
|
// src/Components/Toast/Toaster.tsx
|
|
1642
|
-
var
|
|
1644
|
+
var import_react9 = require("react");
|
|
1643
1645
|
var import_react_dom = require("react-dom");
|
|
1644
1646
|
var import_styled_components14 = __toESM(require("styled-components"));
|
|
1645
1647
|
|
|
1646
1648
|
// src/Components/Toast/ToastCard.tsx
|
|
1647
|
-
var
|
|
1649
|
+
var import_react8 = require("react");
|
|
1648
1650
|
var import_styled_components13 = __toESM(require("styled-components"));
|
|
1649
1651
|
|
|
1650
1652
|
// src/Components/Toast/toastStore.ts
|
|
@@ -1692,12 +1694,12 @@ var dismissToast = (id) => {
|
|
|
1692
1694
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1693
1695
|
var EXIT_DURATION = 180;
|
|
1694
1696
|
var ToastCard = ({ toastItem }) => {
|
|
1695
|
-
const [isExiting, setIsExiting] = (0,
|
|
1696
|
-
const handleDismiss = (0,
|
|
1697
|
+
const [isExiting, setIsExiting] = (0, import_react8.useState)(false);
|
|
1698
|
+
const handleDismiss = (0, import_react8.useCallback)(() => {
|
|
1697
1699
|
setIsExiting(true);
|
|
1698
1700
|
setTimeout(() => dismissToast(toastItem.id), EXIT_DURATION);
|
|
1699
1701
|
}, [toastItem.id]);
|
|
1700
|
-
(0,
|
|
1702
|
+
(0, import_react8.useEffect)(() => {
|
|
1701
1703
|
const dismissTimer = setTimeout(handleDismiss, toastItem.timeOut);
|
|
1702
1704
|
return () => clearTimeout(dismissTimer);
|
|
1703
1705
|
}, [handleDismiss, toastItem.timeOut]);
|
|
@@ -1814,7 +1816,7 @@ var ProgressBar = import_styled_components13.default.div`
|
|
|
1814
1816
|
// src/Components/Toast/Toaster.tsx
|
|
1815
1817
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1816
1818
|
var Toaster = () => {
|
|
1817
|
-
const toasts2 = (0,
|
|
1819
|
+
const toasts2 = (0, import_react9.useSyncExternalStore)(subscribeToasts, getToastsSnapshot);
|
|
1818
1820
|
if (toasts2.length === 0) return null;
|
|
1819
1821
|
return (0, import_react_dom.createPortal)(
|
|
1820
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)) }),
|
|
@@ -2050,7 +2052,7 @@ var Link = (_a) => {
|
|
|
2050
2052
|
};
|
|
2051
2053
|
|
|
2052
2054
|
// src/Components/Avatar/Avatar.tsx
|
|
2053
|
-
var
|
|
2055
|
+
var import_react10 = require("react");
|
|
2054
2056
|
var import_styled_components18 = __toESM(require("styled-components"));
|
|
2055
2057
|
|
|
2056
2058
|
// src/Components/Image/Image.tsx
|
|
@@ -2158,7 +2160,7 @@ var Avatar = ({
|
|
|
2158
2160
|
badge
|
|
2159
2161
|
}) => {
|
|
2160
2162
|
var _a, _b, _c;
|
|
2161
|
-
const [hasImageError, setHasImageError] = (0,
|
|
2163
|
+
const [hasImageError, setHasImageError] = (0, import_react10.useState)(false);
|
|
2162
2164
|
const resolvedBackground = resolveColor2(backgroundColor, colors.grey_300);
|
|
2163
2165
|
const resolvedText = resolveColor2(textColor, colors.dark);
|
|
2164
2166
|
const initials = getInitials(name);
|
|
@@ -2196,7 +2198,7 @@ var Avatar = ({
|
|
|
2196
2198
|
};
|
|
2197
2199
|
|
|
2198
2200
|
// src/Components/Select/Select.tsx
|
|
2199
|
-
var
|
|
2201
|
+
var import_react11 = require("react");
|
|
2200
2202
|
var import_react_dom2 = __toESM(require("react-dom"));
|
|
2201
2203
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
2202
2204
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -2309,13 +2311,13 @@ var Select = ({
|
|
|
2309
2311
|
hideSearchBar,
|
|
2310
2312
|
noFlex
|
|
2311
2313
|
}) => {
|
|
2312
|
-
const [isOpen, setIsOpen] = (0,
|
|
2313
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2314
|
-
const [dropdownPosition, setDropdownPosition] = (0,
|
|
2315
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
2316
|
-
const containerRef = (0,
|
|
2317
|
-
const dropdownRef = (0,
|
|
2318
|
-
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);
|
|
2319
2321
|
const selectedOption = options.find((option) => option.value === value);
|
|
2320
2322
|
const handleSelect = (option) => {
|
|
2321
2323
|
onChange == null ? void 0 : onChange(option.value);
|
|
@@ -2368,7 +2370,7 @@ var Select = ({
|
|
|
2368
2370
|
}
|
|
2369
2371
|
}
|
|
2370
2372
|
};
|
|
2371
|
-
(0,
|
|
2373
|
+
(0, import_react11.useEffect)(() => {
|
|
2372
2374
|
const handleClickOutside = (event) => {
|
|
2373
2375
|
if (containerRef.current && !containerRef.current.contains(event.target) && dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2374
2376
|
setSearchTerm("");
|
|
@@ -2463,7 +2465,7 @@ var Select = ({
|
|
|
2463
2465
|
};
|
|
2464
2466
|
|
|
2465
2467
|
// src/Components/Input/Input.tsx
|
|
2466
|
-
var
|
|
2468
|
+
var import_react12 = require("react");
|
|
2467
2469
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
2468
2470
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2469
2471
|
var shouldForwardProp8 = (prop) => ![
|
|
@@ -2669,7 +2671,7 @@ var displayToIso = (displayValue) => {
|
|
|
2669
2671
|
const isoDay = String(day).padStart(2, "0");
|
|
2670
2672
|
return `${yearStr}-${isoMonth}-${isoDay}`;
|
|
2671
2673
|
};
|
|
2672
|
-
var Input = (0,
|
|
2674
|
+
var Input = (0, import_react12.forwardRef)((props, ref) => {
|
|
2673
2675
|
const _a = props, {
|
|
2674
2676
|
label,
|
|
2675
2677
|
value,
|
|
@@ -2708,11 +2710,11 @@ var Input = (0, import_react11.forwardRef)((props, ref) => {
|
|
|
2708
2710
|
const inputName = otherProps == null ? void 0 : otherProps.name;
|
|
2709
2711
|
const { min, max, step } = otherProps || {};
|
|
2710
2712
|
const _b = otherProps || {}, { name } = _b, forwardProps = __objRest(_b, ["name"]);
|
|
2711
|
-
const [showPassword, setShowPassword] = (0,
|
|
2712
|
-
const [displayDateValue, setDisplayDateValue] = (0,
|
|
2713
|
-
const nativeDateRef = (0,
|
|
2714
|
-
const innerRef = (0,
|
|
2715
|
-
(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)(
|
|
2716
2718
|
ref,
|
|
2717
2719
|
() => innerRef.current
|
|
2718
2720
|
);
|
|
@@ -2730,7 +2732,7 @@ var Input = (0, import_react11.forwardRef)((props, ref) => {
|
|
|
2730
2732
|
const computedStyle = isSearch ? __spreadValues(__spreadValues({
|
|
2731
2733
|
paddingLeft: "34px"
|
|
2732
2734
|
}, hasSearchValue && onClear ? { paddingRight: "34px" } : {}), style2) : style2;
|
|
2733
|
-
(0,
|
|
2735
|
+
(0, import_react12.useEffect)(() => {
|
|
2734
2736
|
if (isDate) {
|
|
2735
2737
|
const formatted = formatIsoToDisplay(isoValue);
|
|
2736
2738
|
setDisplayDateValue((prev) => formatted !== prev ? formatted : prev);
|
|
@@ -2950,7 +2952,7 @@ var Checkbox = ({
|
|
|
2950
2952
|
};
|
|
2951
2953
|
|
|
2952
2954
|
// src/Components/Radio/Radio.tsx
|
|
2953
|
-
var
|
|
2955
|
+
var import_react13 = require("react");
|
|
2954
2956
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
2955
2957
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2956
2958
|
var RadioContainer = import_styled_components22.default.div`
|
|
@@ -3007,7 +3009,7 @@ var Radio = ({
|
|
|
3007
3009
|
value
|
|
3008
3010
|
}) => {
|
|
3009
3011
|
const color = colors[variant] || colors.blue_950;
|
|
3010
|
-
const generatedId = (0,
|
|
3012
|
+
const generatedId = (0, import_react13.useId)();
|
|
3011
3013
|
const uniqueId = `radio-${generatedId}`;
|
|
3012
3014
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(StyledLabel2, { htmlFor: uniqueId, disabled, children: [
|
|
3013
3015
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -3027,7 +3029,7 @@ var Radio = ({
|
|
|
3027
3029
|
};
|
|
3028
3030
|
|
|
3029
3031
|
// src/Components/Accordion/Accordion.tsx
|
|
3030
|
-
var
|
|
3032
|
+
var import_react14 = require("react");
|
|
3031
3033
|
var import_styled_components23 = __toESM(require("styled-components"));
|
|
3032
3034
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3033
3035
|
var Wrapper4 = import_styled_components23.default.div`
|
|
@@ -3088,8 +3090,8 @@ var Accordion = ({
|
|
|
3088
3090
|
backgroundHeader = colors.white
|
|
3089
3091
|
}) => {
|
|
3090
3092
|
const resolvedBackgroundHeader = typeof backgroundHeader === "string" && backgroundHeader in colors ? colors[backgroundHeader] : backgroundHeader;
|
|
3091
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3092
|
-
const [internalOpenId, setInternalOpenId] = (0,
|
|
3093
|
+
const [internalOpen, setInternalOpen] = (0, import_react14.useState)(defaultOpen);
|
|
3094
|
+
const [internalOpenId, setInternalOpenId] = (0, import_react14.useState)(
|
|
3093
3095
|
null
|
|
3094
3096
|
);
|
|
3095
3097
|
const isControlled = controlledOpen !== void 0;
|
|
@@ -3104,7 +3106,7 @@ var Accordion = ({
|
|
|
3104
3106
|
setInternalOpen((prev) => !prev);
|
|
3105
3107
|
}
|
|
3106
3108
|
};
|
|
3107
|
-
const toggleItem = (0,
|
|
3109
|
+
const toggleItem = (0, import_react14.useCallback)(
|
|
3108
3110
|
(id) => {
|
|
3109
3111
|
if (disabled) return;
|
|
3110
3112
|
const nextId2 = activeItemId === id ? null : id;
|
|
@@ -3171,7 +3173,7 @@ var Accordion = ({
|
|
|
3171
3173
|
};
|
|
3172
3174
|
|
|
3173
3175
|
// src/Components/ColorPicker/ColorPicker.tsx
|
|
3174
|
-
var
|
|
3176
|
+
var import_react15 = require("react");
|
|
3175
3177
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
3176
3178
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3177
3179
|
var SIZES = {
|
|
@@ -3248,7 +3250,7 @@ var TEXT_SIZE_MAP = {
|
|
|
3248
3250
|
m: "xs",
|
|
3249
3251
|
l: "s"
|
|
3250
3252
|
};
|
|
3251
|
-
var ColorPicker = (0,
|
|
3253
|
+
var ColorPicker = (0, import_react15.forwardRef)(
|
|
3252
3254
|
({
|
|
3253
3255
|
label,
|
|
3254
3256
|
value,
|
|
@@ -3257,11 +3259,11 @@ var ColorPicker = (0, import_react14.forwardRef)(
|
|
|
3257
3259
|
disabled = false,
|
|
3258
3260
|
size = "m"
|
|
3259
3261
|
}, ref) => {
|
|
3260
|
-
const innerRef = (0,
|
|
3261
|
-
const [internalColor, setInternalColor] = (0,
|
|
3262
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
3263
|
+
const [internalColor, setInternalColor] = (0, import_react15.useState)(defaultValue);
|
|
3262
3264
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
3263
3265
|
const dims = SIZES[size];
|
|
3264
|
-
(0,
|
|
3266
|
+
(0, import_react15.useEffect)(() => {
|
|
3265
3267
|
if (!ref) return;
|
|
3266
3268
|
if (typeof ref === "function") {
|
|
3267
3269
|
ref(innerRef.current);
|
|
@@ -3307,7 +3309,7 @@ var ColorPicker = (0, import_react14.forwardRef)(
|
|
|
3307
3309
|
ColorPicker.displayName = "ColorPicker";
|
|
3308
3310
|
|
|
3309
3311
|
// src/Components/SliderInput/SliderInput.tsx
|
|
3310
|
-
var
|
|
3312
|
+
var import_react16 = require("react");
|
|
3311
3313
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
3312
3314
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3313
3315
|
var Container3 = import_styled_components25.default.label`
|
|
@@ -3389,7 +3391,7 @@ var MinMaxRow = import_styled_components25.default.span`
|
|
|
3389
3391
|
justify-content: space-between;
|
|
3390
3392
|
align-items: center;
|
|
3391
3393
|
`;
|
|
3392
|
-
var SliderInput = (0,
|
|
3394
|
+
var SliderInput = (0, import_react16.forwardRef)(
|
|
3393
3395
|
({
|
|
3394
3396
|
value,
|
|
3395
3397
|
onChange,
|
|
@@ -3524,7 +3526,7 @@ var ListItem = (props) => {
|
|
|
3524
3526
|
};
|
|
3525
3527
|
|
|
3526
3528
|
// src/Components/Table/Table.tsx
|
|
3527
|
-
var
|
|
3529
|
+
var import_react17 = require("react");
|
|
3528
3530
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
3529
3531
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3530
3532
|
var shouldForwardPropTable = (prop) => ![
|
|
@@ -3560,7 +3562,7 @@ var StyledContainer3 = import_styled_components28.default.div.withConfig({
|
|
|
3560
3562
|
border: 1.4px solid ${colors.grey_200};
|
|
3561
3563
|
box-shadow: ${(props) => props.hasShadow ? "0 2px 12px 0 rgba(198, 198, 198, 0.25)" : "none"};
|
|
3562
3564
|
`;
|
|
3563
|
-
var Table = (0,
|
|
3565
|
+
var Table = (0, import_react17.forwardRef)((props, ref) => {
|
|
3564
3566
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3565
3567
|
const safeChildren = children;
|
|
3566
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 })) }));
|
|
@@ -3590,7 +3592,7 @@ var TableHeader = (props) => {
|
|
|
3590
3592
|
};
|
|
3591
3593
|
|
|
3592
3594
|
// src/Components/Table/TableBody/TableBody.tsx
|
|
3593
|
-
var
|
|
3595
|
+
var import_react18 = require("react");
|
|
3594
3596
|
var import_styled_components30 = __toESM(require("styled-components"));
|
|
3595
3597
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3596
3598
|
var shouldForwardPropTableBody = (prop) => !["backgroundColor", "useEvenBackground", "fixedHeight", "color"].includes(
|
|
@@ -3609,7 +3611,7 @@ var StyledTableBody = import_styled_components30.default.div.withConfig({
|
|
|
3609
3611
|
background-color: ${(props) => props.useEvenBackground ? "#f2f2f2" : ""};
|
|
3610
3612
|
}
|
|
3611
3613
|
`;
|
|
3612
|
-
var TableBody = (0,
|
|
3614
|
+
var TableBody = (0, import_react18.forwardRef)(
|
|
3613
3615
|
(props, ref) => {
|
|
3614
3616
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3615
3617
|
const safeChildren = children;
|
|
@@ -3684,7 +3686,7 @@ var TableCell = (props) => {
|
|
|
3684
3686
|
};
|
|
3685
3687
|
|
|
3686
3688
|
// src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
|
|
3687
|
-
var
|
|
3689
|
+
var import_react19 = require("react");
|
|
3688
3690
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
3689
3691
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3690
3692
|
var shouldForwardPropTableHeaderCell = (prop) => !["useSort", "isSort", "flexGrow", "flexShrink", "width"].includes(prop);
|
|
@@ -3720,7 +3722,7 @@ var SortArrow = import_styled_components33.default.span`
|
|
|
3720
3722
|
`;
|
|
3721
3723
|
var TableHeaderCell = (props) => {
|
|
3722
3724
|
const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
|
|
3723
|
-
const [hovered, setHovered] = (0,
|
|
3725
|
+
const [hovered, setHovered] = (0, import_react19.useState)(false);
|
|
3724
3726
|
const showArrow = useSort && (isSort || hovered);
|
|
3725
3727
|
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
3726
3728
|
const arrowOpacity = isSort ? 1 : 0.35;
|
|
@@ -3868,7 +3870,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime42.
|
|
|
3868
3870
|
] });
|
|
3869
3871
|
|
|
3870
3872
|
// src/Components/Switch/Switch.tsx
|
|
3871
|
-
var
|
|
3873
|
+
var import_react20 = require("react");
|
|
3872
3874
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
3873
3875
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3874
3876
|
var BASE = {
|
|
@@ -3949,7 +3951,7 @@ var Knob = import_styled_components38.default.span`
|
|
|
3949
3951
|
transform: translateY(-50%) scale(0.96);
|
|
3950
3952
|
}
|
|
3951
3953
|
`;
|
|
3952
|
-
var Switch = (0,
|
|
3954
|
+
var Switch = (0, import_react20.forwardRef)(
|
|
3953
3955
|
(_a, ref) => {
|
|
3954
3956
|
var _b = _a, {
|
|
3955
3957
|
checked,
|
|
@@ -4005,7 +4007,7 @@ var CardSkeleton = () => {
|
|
|
4005
4007
|
};
|
|
4006
4008
|
|
|
4007
4009
|
// src/Components/Options/Options.tsx
|
|
4008
|
-
var
|
|
4010
|
+
var import_react21 = require("react");
|
|
4009
4011
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4010
4012
|
var Options = ({
|
|
4011
4013
|
icon,
|
|
@@ -4015,8 +4017,8 @@ var Options = ({
|
|
|
4015
4017
|
onChange,
|
|
4016
4018
|
disabled = false
|
|
4017
4019
|
}) => {
|
|
4018
|
-
const [state, setState] = (0,
|
|
4019
|
-
(0,
|
|
4020
|
+
const [state, setState] = (0, import_react21.useState)(0);
|
|
4021
|
+
(0, import_react21.useEffect)(() => {
|
|
4020
4022
|
if (defaultId) {
|
|
4021
4023
|
const defaultIndex = options.findIndex(
|
|
4022
4024
|
(option) => option.id === defaultId
|
|
@@ -4074,7 +4076,7 @@ var Options = ({
|
|
|
4074
4076
|
};
|
|
4075
4077
|
|
|
4076
4078
|
// src/Components/Stepper/Stepper.tsx
|
|
4077
|
-
var
|
|
4079
|
+
var import_react22 = require("react");
|
|
4078
4080
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
4079
4081
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4080
4082
|
var Wrapper5 = import_styled_components39.default.nav`
|
|
@@ -4113,7 +4115,7 @@ var Stepper = ({
|
|
|
4113
4115
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Wrapper5, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
4114
4116
|
const isActive = i === current;
|
|
4115
4117
|
const isCompleted = i < current;
|
|
4116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react22.Fragment, { children: [
|
|
4117
4119
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4118
4120
|
Circle,
|
|
4119
4121
|
{
|
|
@@ -4130,7 +4132,7 @@ var Stepper = ({
|
|
|
4130
4132
|
};
|
|
4131
4133
|
|
|
4132
4134
|
// src/Components/Tabs/Tabs.tsx
|
|
4133
|
-
var
|
|
4135
|
+
var import_react23 = require("react");
|
|
4134
4136
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
4135
4137
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4136
4138
|
var TOKENS = {
|
|
@@ -4301,13 +4303,13 @@ var Tabs = (_a) => {
|
|
|
4301
4303
|
"baselineColor",
|
|
4302
4304
|
"children"
|
|
4303
4305
|
]);
|
|
4304
|
-
const rootRef = (0,
|
|
4305
|
-
const refsMap = (0,
|
|
4306
|
-
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 });
|
|
4307
4309
|
const setTabRef = (id) => (el) => {
|
|
4308
4310
|
if (el) refsMap.current.set(id, el);
|
|
4309
4311
|
};
|
|
4310
|
-
const updateBar = (0,
|
|
4312
|
+
const updateBar = (0, import_react23.useCallback)(() => {
|
|
4311
4313
|
const root = rootRef.current;
|
|
4312
4314
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
4313
4315
|
if (!root || !activeEl) return;
|
|
@@ -4315,7 +4317,7 @@ var Tabs = (_a) => {
|
|
|
4315
4317
|
const box = activeEl.getBoundingClientRect();
|
|
4316
4318
|
setBar({ left: box.left - rootBox.left, width: box.width });
|
|
4317
4319
|
}, [value]);
|
|
4318
|
-
(0,
|
|
4320
|
+
(0, import_react23.useEffect)(() => {
|
|
4319
4321
|
updateBar();
|
|
4320
4322
|
const ro = new ResizeObserver(updateBar);
|
|
4321
4323
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
@@ -4323,14 +4325,14 @@ var Tabs = (_a) => {
|
|
|
4323
4325
|
if (activeEl) ro.observe(activeEl);
|
|
4324
4326
|
return () => ro.disconnect();
|
|
4325
4327
|
}, [value, updateBar]);
|
|
4326
|
-
const handleSelect = (0,
|
|
4328
|
+
const handleSelect = (0, import_react23.useCallback)(
|
|
4327
4329
|
(id) => {
|
|
4328
4330
|
if (id !== value && onChange) onChange(id);
|
|
4329
4331
|
},
|
|
4330
4332
|
[onChange, value]
|
|
4331
4333
|
);
|
|
4332
4334
|
const isPillsFullWidth = variant === "pills" && align === "start";
|
|
4333
|
-
const rendered = (0,
|
|
4335
|
+
const rendered = (0, import_react23.useMemo)(() => {
|
|
4334
4336
|
if (items && items.length) {
|
|
4335
4337
|
return items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4336
4338
|
Tab,
|
|
@@ -4360,12 +4362,12 @@ var Tabs = (_a) => {
|
|
|
4360
4362
|
it.id
|
|
4361
4363
|
));
|
|
4362
4364
|
}
|
|
4363
|
-
return
|
|
4365
|
+
return import_react23.Children.map(children, (child) => {
|
|
4364
4366
|
var _a2;
|
|
4365
|
-
if (!(0,
|
|
4367
|
+
if (!(0, import_react23.isValidElement)(child)) return child;
|
|
4366
4368
|
const id = (_a2 = child.props.id) != null ? _a2 : child.key;
|
|
4367
4369
|
const active = id === value;
|
|
4368
|
-
return (0,
|
|
4370
|
+
return (0, import_react23.cloneElement)(child, {
|
|
4369
4371
|
active,
|
|
4370
4372
|
variant,
|
|
4371
4373
|
fullWidth: isPillsFullWidth,
|
|
@@ -4393,7 +4395,7 @@ var Tabs = (_a) => {
|
|
|
4393
4395
|
};
|
|
4394
4396
|
|
|
4395
4397
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
4396
|
-
var
|
|
4398
|
+
var import_react24 = require("react");
|
|
4397
4399
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
4398
4400
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4399
4401
|
var Container5 = import_styled_components41.default.div`
|
|
@@ -4436,8 +4438,8 @@ var MultiSelect = ({
|
|
|
4436
4438
|
width,
|
|
4437
4439
|
align = "left"
|
|
4438
4440
|
}) => {
|
|
4439
|
-
const [isOpen, setIsOpen] = (0,
|
|
4440
|
-
const dropdownRef = (0,
|
|
4441
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
4442
|
+
const dropdownRef = (0, import_react24.useRef)(null);
|
|
4441
4443
|
const toggleOption = (value) => {
|
|
4442
4444
|
if (!onChange) return;
|
|
4443
4445
|
if (selectedValues.includes(value)) {
|
|
@@ -4447,7 +4449,7 @@ var MultiSelect = ({
|
|
|
4447
4449
|
onChange([...selectedValues, value]);
|
|
4448
4450
|
}
|
|
4449
4451
|
};
|
|
4450
|
-
(0,
|
|
4452
|
+
(0, import_react24.useEffect)(() => {
|
|
4451
4453
|
const handleClickOutside = (e) => {
|
|
4452
4454
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
4453
4455
|
setIsOpen(false);
|
|
@@ -4489,7 +4491,7 @@ var MultiSelect = ({
|
|
|
4489
4491
|
};
|
|
4490
4492
|
|
|
4491
4493
|
// src/Components/DatePicker/DatePicker.tsx
|
|
4492
|
-
var
|
|
4494
|
+
var import_react25 = require("react");
|
|
4493
4495
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4494
4496
|
var LOCALE_MAP = {
|
|
4495
4497
|
fr: "fr-FR",
|
|
@@ -4560,28 +4562,28 @@ var DatePicker = (props) => {
|
|
|
4560
4562
|
const resolvedLocale = resolveLocale(locale);
|
|
4561
4563
|
const monthNames = getMonthNames(resolvedLocale);
|
|
4562
4564
|
const dayNames = getDayNames(resolvedLocale);
|
|
4563
|
-
const [isOpen, setIsOpen] = (0,
|
|
4564
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
4565
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
4566
|
-
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)(
|
|
4567
4569
|
isSingle ? (_a = props.value) != null ? _a : null : null
|
|
4568
4570
|
);
|
|
4569
|
-
const [startDate, setStartDate] = (0,
|
|
4571
|
+
const [startDate, setStartDate] = (0, import_react25.useState)(
|
|
4570
4572
|
!isSingle ? (_c = (_b = props.value) == null ? void 0 : _b.start) != null ? _c : null : null
|
|
4571
4573
|
);
|
|
4572
|
-
const [endDate, setEndDate] = (0,
|
|
4574
|
+
const [endDate, setEndDate] = (0, import_react25.useState)(
|
|
4573
4575
|
!isSingle ? (_e = (_d = props.value) == null ? void 0 : _d.end) != null ? _e : null : null
|
|
4574
4576
|
);
|
|
4575
|
-
const ref = (0,
|
|
4577
|
+
const ref = (0, import_react25.useRef)(null);
|
|
4576
4578
|
const singleValueMs = isSingle ? (_f = props.value) == null ? void 0 : _f.getTime() : void 0;
|
|
4577
4579
|
const rangeStartMs = !isSingle ? (_h = (_g = props.value) == null ? void 0 : _g.start) == null ? void 0 : _h.getTime() : void 0;
|
|
4578
4580
|
const rangeEndMs = !isSingle ? (_j = (_i = props.value) == null ? void 0 : _i.end) == null ? void 0 : _j.getTime() : void 0;
|
|
4579
|
-
(0,
|
|
4581
|
+
(0, import_react25.useEffect)(() => {
|
|
4580
4582
|
if (!isSingle) return;
|
|
4581
4583
|
const v = props.value;
|
|
4582
4584
|
if (v !== void 0) setSingleDate(v);
|
|
4583
4585
|
}, [singleValueMs]);
|
|
4584
|
-
(0,
|
|
4586
|
+
(0, import_react25.useEffect)(() => {
|
|
4585
4587
|
var _a2, _b2;
|
|
4586
4588
|
if (isSingle) return;
|
|
4587
4589
|
const v = props.value;
|
|
@@ -4589,7 +4591,7 @@ var DatePicker = (props) => {
|
|
|
4589
4591
|
setStartDate((_a2 = v == null ? void 0 : v.start) != null ? _a2 : null);
|
|
4590
4592
|
setEndDate((_b2 = v == null ? void 0 : v.end) != null ? _b2 : null);
|
|
4591
4593
|
}, [rangeStartMs, rangeEndMs]);
|
|
4592
|
-
(0,
|
|
4594
|
+
(0, import_react25.useEffect)(() => {
|
|
4593
4595
|
const handleClickOutside = (e) => {
|
|
4594
4596
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
4595
4597
|
setIsOpen(false);
|
|
@@ -4873,7 +4875,7 @@ var DatePicker = (props) => {
|
|
|
4873
4875
|
};
|
|
4874
4876
|
|
|
4875
4877
|
// src/Components/IconTabs/IconTabs.tsx
|
|
4876
|
-
var
|
|
4878
|
+
var import_react26 = require("react");
|
|
4877
4879
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
4878
4880
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4879
4881
|
var TabsContainer = import_styled_components42.default.div`
|
|
@@ -4935,10 +4937,10 @@ var IconTabs = ({
|
|
|
4935
4937
|
defaultTabIndex = 0
|
|
4936
4938
|
}) => {
|
|
4937
4939
|
var _a;
|
|
4938
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
4939
|
-
const sliderRef = (0,
|
|
4940
|
-
const tabRefs = (0,
|
|
4941
|
-
(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)(() => {
|
|
4942
4944
|
if (defaultTabIndex >= 0 && defaultTabIndex !== selectedTab) {
|
|
4943
4945
|
setSelectedTab(defaultTabIndex);
|
|
4944
4946
|
}
|
|
@@ -4949,7 +4951,7 @@ var IconTabs = ({
|
|
|
4949
4951
|
onTabChange(index);
|
|
4950
4952
|
}
|
|
4951
4953
|
};
|
|
4952
|
-
(0,
|
|
4954
|
+
(0, import_react26.useEffect)(() => {
|
|
4953
4955
|
if (sliderRef.current && tabRefs.current[selectedTab]) {
|
|
4954
4956
|
const selectedTabRect = tabRefs.current[selectedTab].getBoundingClientRect();
|
|
4955
4957
|
const parentRect = tabRefs.current[selectedTab].parentElement.getBoundingClientRect();
|
|
@@ -4988,7 +4990,7 @@ var IconTabs = ({
|
|
|
4988
4990
|
};
|
|
4989
4991
|
|
|
4990
4992
|
// src/Components/Popover/Popover.tsx
|
|
4991
|
-
var
|
|
4993
|
+
var import_react27 = require("react");
|
|
4992
4994
|
var import_react_dom3 = require("react-dom");
|
|
4993
4995
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
4994
4996
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
@@ -5034,15 +5036,15 @@ var Popover = ({
|
|
|
5034
5036
|
align = "right",
|
|
5035
5037
|
fullWidth = false
|
|
5036
5038
|
}) => {
|
|
5037
|
-
const [open, setOpen] = (0,
|
|
5038
|
-
const ref = (0,
|
|
5039
|
-
const menuRef = (0,
|
|
5040
|
-
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)({
|
|
5041
5043
|
mode: "default",
|
|
5042
5044
|
top: 0,
|
|
5043
5045
|
left: 0
|
|
5044
5046
|
});
|
|
5045
|
-
const updatePosition = (0,
|
|
5047
|
+
const updatePosition = (0, import_react27.useCallback)(() => {
|
|
5046
5048
|
var _a;
|
|
5047
5049
|
if (!ref.current) return;
|
|
5048
5050
|
if (anchorRef == null ? void 0 : anchorRef.current) {
|
|
@@ -5071,7 +5073,7 @@ var Popover = ({
|
|
|
5071
5073
|
});
|
|
5072
5074
|
}
|
|
5073
5075
|
}, [items.length, anchorRef, offsetY, align]);
|
|
5074
|
-
(0,
|
|
5076
|
+
(0, import_react27.useEffect)(() => {
|
|
5075
5077
|
const handleClickOutside = (event) => {
|
|
5076
5078
|
var _a, _b;
|
|
5077
5079
|
const isInTrigger = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
|
@@ -5396,7 +5398,7 @@ var Banner = ({
|
|
|
5396
5398
|
};
|
|
5397
5399
|
|
|
5398
5400
|
// src/Components/Tooltip/Tooltip.tsx
|
|
5399
|
-
var
|
|
5401
|
+
var import_react28 = require("react");
|
|
5400
5402
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
5401
5403
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5402
5404
|
var StyledTooltipWrapper = import_styled_components46.default.div`
|
|
@@ -5500,7 +5502,7 @@ var Tooltip = ({
|
|
|
5500
5502
|
direction = "top",
|
|
5501
5503
|
children
|
|
5502
5504
|
}) => {
|
|
5503
|
-
const [isVisible, setIsVisible] = (0,
|
|
5505
|
+
const [isVisible, setIsVisible] = (0, import_react28.useState)(false);
|
|
5504
5506
|
const handleMouseEnter = () => setIsVisible(true);
|
|
5505
5507
|
const handleMouseLeave = () => setIsVisible(false);
|
|
5506
5508
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
@@ -5527,7 +5529,7 @@ var Tooltip = ({
|
|
|
5527
5529
|
};
|
|
5528
5530
|
|
|
5529
5531
|
// src/Components/Pagination/Pagination.tsx
|
|
5530
|
-
var
|
|
5532
|
+
var import_react29 = require("react");
|
|
5531
5533
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5532
5534
|
var getPageNumbers = (current, total) => {
|
|
5533
5535
|
if (total <= 5) {
|
|
@@ -5551,7 +5553,7 @@ var Pagination = ({
|
|
|
5551
5553
|
summaryLabel
|
|
5552
5554
|
}) => {
|
|
5553
5555
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
5554
|
-
const pages = (0,
|
|
5556
|
+
const pages = (0, import_react29.useMemo)(
|
|
5555
5557
|
() => getPageNumbers(currentPage, totalPages),
|
|
5556
5558
|
[currentPage, totalPages]
|
|
5557
5559
|
);
|
|
@@ -5605,7 +5607,7 @@ var Pagination = ({
|
|
|
5605
5607
|
};
|
|
5606
5608
|
|
|
5607
5609
|
// src/Components/FileUploadZone/FileUploadZone.tsx
|
|
5608
|
-
var
|
|
5610
|
+
var import_react30 = require("react");
|
|
5609
5611
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
5610
5612
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5611
5613
|
var ACCEPT_MAP = {
|
|
@@ -5692,19 +5694,19 @@ var FileUploadZone = ({
|
|
|
5692
5694
|
icon = "cloud-arrow-up",
|
|
5693
5695
|
showFileName = false
|
|
5694
5696
|
}) => {
|
|
5695
|
-
const [isDragging, setIsDragging] = (0,
|
|
5696
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
5697
|
+
const [isDragging, setIsDragging] = (0, import_react30.useState)(false);
|
|
5698
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react30.useState)(
|
|
5697
5699
|
null
|
|
5698
5700
|
);
|
|
5699
|
-
const [fileType, setFileType] = (0,
|
|
5700
|
-
const [fileName, setFileName] = (0,
|
|
5701
|
-
const [inlineError, setInlineError] = (0,
|
|
5702
|
-
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);
|
|
5703
5705
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
5704
5706
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
5705
5707
|
const acceptString = mimeTypes.join(",");
|
|
5706
5708
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
5707
|
-
const emitError = (0,
|
|
5709
|
+
const emitError = (0, import_react30.useCallback)(
|
|
5708
5710
|
(message) => {
|
|
5709
5711
|
if (onError) {
|
|
5710
5712
|
onError(message);
|
|
@@ -5714,7 +5716,7 @@ var FileUploadZone = ({
|
|
|
5714
5716
|
},
|
|
5715
5717
|
[onError]
|
|
5716
5718
|
);
|
|
5717
|
-
const validateFile = (0,
|
|
5719
|
+
const validateFile = (0, import_react30.useCallback)(
|
|
5718
5720
|
(file) => {
|
|
5719
5721
|
if (!mimeTypes.includes(file.type)) {
|
|
5720
5722
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -5729,7 +5731,7 @@ var FileUploadZone = ({
|
|
|
5729
5731
|
},
|
|
5730
5732
|
[mimeTypes, maxSizeMB]
|
|
5731
5733
|
);
|
|
5732
|
-
const processFile = (0,
|
|
5734
|
+
const processFile = (0, import_react30.useCallback)(
|
|
5733
5735
|
(file) => {
|
|
5734
5736
|
setInlineError(null);
|
|
5735
5737
|
const result = validateFile(file);
|
|
@@ -5747,7 +5749,7 @@ var FileUploadZone = ({
|
|
|
5747
5749
|
},
|
|
5748
5750
|
[validateFile, onSave, showPreview, emitError]
|
|
5749
5751
|
);
|
|
5750
|
-
const processFiles = (0,
|
|
5752
|
+
const processFiles = (0, import_react30.useCallback)(
|
|
5751
5753
|
(files) => {
|
|
5752
5754
|
setInlineError(null);
|
|
5753
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
|
|
@@ -2325,7 +2327,7 @@ var Select = ({
|
|
|
2325
2327
|
|
|
2326
2328
|
// src/Components/Input/Input.tsx
|
|
2327
2329
|
import {
|
|
2328
|
-
forwardRef as
|
|
2330
|
+
forwardRef as forwardRef3,
|
|
2329
2331
|
useEffect as useEffect7,
|
|
2330
2332
|
useImperativeHandle,
|
|
2331
2333
|
useRef as useRef6,
|
|
@@ -2536,7 +2538,7 @@ var displayToIso = (displayValue) => {
|
|
|
2536
2538
|
const isoDay = String(day).padStart(2, "0");
|
|
2537
2539
|
return `${yearStr}-${isoMonth}-${isoDay}`;
|
|
2538
2540
|
};
|
|
2539
|
-
var Input =
|
|
2541
|
+
var Input = forwardRef3((props, ref) => {
|
|
2540
2542
|
const _a = props, {
|
|
2541
2543
|
label,
|
|
2542
2544
|
value,
|
|
@@ -3038,7 +3040,7 @@ var Accordion = ({
|
|
|
3038
3040
|
};
|
|
3039
3041
|
|
|
3040
3042
|
// src/Components/ColorPicker/ColorPicker.tsx
|
|
3041
|
-
import { forwardRef as
|
|
3043
|
+
import { forwardRef as forwardRef4, useState as useState9, useRef as useRef7, useEffect as useEffect8 } from "react";
|
|
3042
3044
|
import styled24 from "styled-components";
|
|
3043
3045
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3044
3046
|
var SIZES = {
|
|
@@ -3115,7 +3117,7 @@ var TEXT_SIZE_MAP = {
|
|
|
3115
3117
|
m: "xs",
|
|
3116
3118
|
l: "s"
|
|
3117
3119
|
};
|
|
3118
|
-
var ColorPicker =
|
|
3120
|
+
var ColorPicker = forwardRef4(
|
|
3119
3121
|
({
|
|
3120
3122
|
label,
|
|
3121
3123
|
value,
|
|
@@ -3174,7 +3176,7 @@ var ColorPicker = forwardRef3(
|
|
|
3174
3176
|
ColorPicker.displayName = "ColorPicker";
|
|
3175
3177
|
|
|
3176
3178
|
// src/Components/SliderInput/SliderInput.tsx
|
|
3177
|
-
import { forwardRef as
|
|
3179
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
3178
3180
|
import styled25 from "styled-components";
|
|
3179
3181
|
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3180
3182
|
var Container3 = styled25.label`
|
|
@@ -3256,7 +3258,7 @@ var MinMaxRow = styled25.span`
|
|
|
3256
3258
|
justify-content: space-between;
|
|
3257
3259
|
align-items: center;
|
|
3258
3260
|
`;
|
|
3259
|
-
var SliderInput =
|
|
3261
|
+
var SliderInput = forwardRef5(
|
|
3260
3262
|
({
|
|
3261
3263
|
value,
|
|
3262
3264
|
onChange,
|
|
@@ -3391,7 +3393,7 @@ var ListItem = (props) => {
|
|
|
3391
3393
|
};
|
|
3392
3394
|
|
|
3393
3395
|
// src/Components/Table/Table.tsx
|
|
3394
|
-
import { forwardRef as
|
|
3396
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
3395
3397
|
import styled28 from "styled-components";
|
|
3396
3398
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3397
3399
|
var shouldForwardPropTable = (prop) => ![
|
|
@@ -3427,7 +3429,7 @@ var StyledContainer3 = styled28.div.withConfig({
|
|
|
3427
3429
|
border: 1.4px solid ${colors.grey_200};
|
|
3428
3430
|
box-shadow: ${(props) => props.hasShadow ? "0 2px 12px 0 rgba(198, 198, 198, 0.25)" : "none"};
|
|
3429
3431
|
`;
|
|
3430
|
-
var Table =
|
|
3432
|
+
var Table = forwardRef6((props, ref) => {
|
|
3431
3433
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3432
3434
|
const safeChildren = children;
|
|
3433
3435
|
return /* @__PURE__ */ jsx32(StyledContainer3, __spreadProps(__spreadValues({}, otherProps), { ref, children: /* @__PURE__ */ jsx32(StyledTable, __spreadProps(__spreadValues({}, otherProps), { children: safeChildren })) }));
|
|
@@ -3457,7 +3459,7 @@ var TableHeader = (props) => {
|
|
|
3457
3459
|
};
|
|
3458
3460
|
|
|
3459
3461
|
// src/Components/Table/TableBody/TableBody.tsx
|
|
3460
|
-
import { forwardRef as
|
|
3462
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
3461
3463
|
import styled30 from "styled-components";
|
|
3462
3464
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3463
3465
|
var shouldForwardPropTableBody = (prop) => !["backgroundColor", "useEvenBackground", "fixedHeight", "color"].includes(
|
|
@@ -3476,7 +3478,7 @@ var StyledTableBody = styled30.div.withConfig({
|
|
|
3476
3478
|
background-color: ${(props) => props.useEvenBackground ? "#f2f2f2" : ""};
|
|
3477
3479
|
}
|
|
3478
3480
|
`;
|
|
3479
|
-
var TableBody =
|
|
3481
|
+
var TableBody = forwardRef7(
|
|
3480
3482
|
(props, ref) => {
|
|
3481
3483
|
const _a = props, { children } = _a, otherProps = __objRest(_a, ["children"]);
|
|
3482
3484
|
const safeChildren = children;
|
|
@@ -3735,7 +3737,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs18(Fragment4, { child
|
|
|
3735
3737
|
] });
|
|
3736
3738
|
|
|
3737
3739
|
// src/Components/Switch/Switch.tsx
|
|
3738
|
-
import { forwardRef as
|
|
3740
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
3739
3741
|
import styled38, { css } from "styled-components";
|
|
3740
3742
|
import { jsx as jsx43, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3741
3743
|
var BASE = {
|
|
@@ -3816,7 +3818,7 @@ var Knob = styled38.span`
|
|
|
3816
3818
|
transform: translateY(-50%) scale(0.96);
|
|
3817
3819
|
}
|
|
3818
3820
|
`;
|
|
3819
|
-
var Switch =
|
|
3821
|
+
var Switch = forwardRef8(
|
|
3820
3822
|
(_a, ref) => {
|
|
3821
3823
|
var _b = _a, {
|
|
3822
3824
|
checked,
|