design-zystem 1.0.236 → 1.0.238
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +91 -69
- package/dist/index.mjs +99 -77
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -641,10 +641,12 @@ interface TableCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
641
641
|
}
|
|
642
642
|
declare const TableCell: (props: TableCellProps) => react_jsx_runtime.JSX.Element;
|
|
643
643
|
|
|
644
|
+
type SortOrder = 'asc' | 'desc' | null;
|
|
644
645
|
interface TableHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
645
646
|
children?: ReactNode;
|
|
646
647
|
useSort?: boolean;
|
|
647
648
|
isSort?: boolean;
|
|
649
|
+
sortOrder?: SortOrder;
|
|
648
650
|
flexGrow?: string | number;
|
|
649
651
|
flexShrink?: string | number;
|
|
650
652
|
width?: string;
|
|
@@ -932,4 +934,4 @@ interface OptimizeImageOptions {
|
|
|
932
934
|
}
|
|
933
935
|
declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
|
|
934
936
|
|
|
935
|
-
export { Accordion, type AccordionItem, Avatar, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, Divider, Drawer, FileUploadZone, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Tooltip, colors, formatDate, formatDistance, formatDuration, optimizeImage, truncateFileName, truncateText };
|
|
937
|
+
export { Accordion, type AccordionItem, Avatar, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, Divider, Drawer, FileUploadZone, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Tooltip, colors, formatDate, formatDistance, formatDuration, optimizeImage, truncateFileName, truncateText };
|
package/dist/index.d.ts
CHANGED
|
@@ -641,10 +641,12 @@ interface TableCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
641
641
|
}
|
|
642
642
|
declare const TableCell: (props: TableCellProps) => react_jsx_runtime.JSX.Element;
|
|
643
643
|
|
|
644
|
+
type SortOrder = 'asc' | 'desc' | null;
|
|
644
645
|
interface TableHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
645
646
|
children?: ReactNode;
|
|
646
647
|
useSort?: boolean;
|
|
647
648
|
isSort?: boolean;
|
|
649
|
+
sortOrder?: SortOrder;
|
|
648
650
|
flexGrow?: string | number;
|
|
649
651
|
flexShrink?: string | number;
|
|
650
652
|
width?: string;
|
|
@@ -932,4 +934,4 @@ interface OptimizeImageOptions {
|
|
|
932
934
|
}
|
|
933
935
|
declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
|
|
934
936
|
|
|
935
|
-
export { Accordion, type AccordionItem, Avatar, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, Divider, Drawer, FileUploadZone, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Tooltip, colors, formatDate, formatDistance, formatDuration, optimizeImage, truncateFileName, truncateText };
|
|
937
|
+
export { Accordion, type AccordionItem, Avatar, Box, Bubble, Bulk, Button, CardSkeleton, Checkbox, Col, Collapse, ColorPicker, DatePicker, Divider, Drawer, FileUploadZone, Grid, Icon, IconTabs, Image, Input, Link, List, ListItem, MetricCard, Modal, ModalConfirmation, MultiSelect, NewModal, Options, PageContainer, Pagination, Popover, Radio, Row, Select, type SelectOption, type SelectProps, SkeletonRow, SliderInput, type SortOrder, Spinner, Stepper, Switch, Table, TableBody, TableCell, TableFooter, TableFooterCell, TableFooterRow, TableHeader, TableHeaderCell, type TableHeaderCellProps, TableHeaderRow, TableRow, Tabs, TagBubble, Text, Tooltip, colors, formatDate, formatDistance, formatDuration, optimizeImage, truncateFileName, truncateText };
|
package/dist/index.js
CHANGED
|
@@ -3363,6 +3363,7 @@ var TableCell = (props) => {
|
|
|
3363
3363
|
};
|
|
3364
3364
|
|
|
3365
3365
|
// src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
|
|
3366
|
+
var import_react16 = require("react");
|
|
3366
3367
|
var import_styled_components31 = __toESM(require("styled-components"));
|
|
3367
3368
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3368
3369
|
var shouldForwardPropTableHeaderCell = (prop) => !["useSort", "isSort", "flexGrow", "flexShrink", "width"].includes(prop);
|
|
@@ -3382,24 +3383,45 @@ var StyledTableHeaderCell = import_styled_components31.default.div.withConfig({
|
|
|
3382
3383
|
font-weight: bold;
|
|
3383
3384
|
max-width: ${(props) => props.width || "auto"};
|
|
3384
3385
|
min-width: ${(props) => props.width || "auto"};
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3386
|
+
`;
|
|
3387
|
+
var SortingButton = import_styled_components31.default.span`
|
|
3388
|
+
display: inline-flex;
|
|
3389
|
+
align-items: center;
|
|
3390
|
+
gap: 8px;
|
|
3391
|
+
cursor: pointer;
|
|
3392
|
+
`;
|
|
3393
|
+
var SortArrow = import_styled_components31.default.span`
|
|
3394
|
+
font-style: normal;
|
|
3395
|
+
font-size: 0.9em;
|
|
3396
|
+
line-height: 1;
|
|
3397
|
+
transition: opacity 0.15s;
|
|
3398
|
+
opacity: ${(props) => props.$opacity};
|
|
3394
3399
|
`;
|
|
3395
3400
|
var TableHeaderCell = (props) => {
|
|
3396
|
-
const _a = props, { children, useSort, isSort } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort"]);
|
|
3401
|
+
const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
|
|
3402
|
+
const [hovered, setHovered] = (0, import_react16.useState)(false);
|
|
3403
|
+
const showArrow = useSort && (isSort || hovered);
|
|
3404
|
+
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
3405
|
+
const arrowOpacity = isSort ? 1 : 0.35;
|
|
3397
3406
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3398
3407
|
StyledTableHeaderCell,
|
|
3399
3408
|
__spreadProps(__spreadValues({}, otherProps), {
|
|
3400
3409
|
useSort,
|
|
3401
3410
|
isSort,
|
|
3402
|
-
|
|
3411
|
+
onMouseEnter: (e) => {
|
|
3412
|
+
var _a2;
|
|
3413
|
+
if (useSort) setHovered(true);
|
|
3414
|
+
(_a2 = otherProps.onMouseEnter) == null ? void 0 : _a2.call(otherProps, e);
|
|
3415
|
+
},
|
|
3416
|
+
onMouseLeave: (e) => {
|
|
3417
|
+
var _a2;
|
|
3418
|
+
if (useSort) setHovered(false);
|
|
3419
|
+
(_a2 = otherProps.onMouseLeave) == null ? void 0 : _a2.call(otherProps, e);
|
|
3420
|
+
},
|
|
3421
|
+
children: useSort ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(SortingButton, { children: [
|
|
3422
|
+
children,
|
|
3423
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SortArrow, { $opacity: arrowOpacity, children: arrowChar })
|
|
3424
|
+
] }) : children
|
|
3403
3425
|
})
|
|
3404
3426
|
);
|
|
3405
3427
|
};
|
|
@@ -3525,7 +3547,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime40.
|
|
|
3525
3547
|
] });
|
|
3526
3548
|
|
|
3527
3549
|
// src/Components/Switch/Switch.tsx
|
|
3528
|
-
var
|
|
3550
|
+
var import_react17 = require("react");
|
|
3529
3551
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
3530
3552
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3531
3553
|
var BASE = {
|
|
@@ -3606,7 +3628,7 @@ var Knob = import_styled_components36.default.span`
|
|
|
3606
3628
|
transform: translateY(-50%) scale(0.96);
|
|
3607
3629
|
}
|
|
3608
3630
|
`;
|
|
3609
|
-
var Switch = (0,
|
|
3631
|
+
var Switch = (0, import_react17.forwardRef)(
|
|
3610
3632
|
(_a, ref) => {
|
|
3611
3633
|
var _b = _a, {
|
|
3612
3634
|
checked,
|
|
@@ -3662,7 +3684,7 @@ var CardSkeleton = () => {
|
|
|
3662
3684
|
};
|
|
3663
3685
|
|
|
3664
3686
|
// src/Components/Options/Options.tsx
|
|
3665
|
-
var
|
|
3687
|
+
var import_react18 = require("react");
|
|
3666
3688
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3667
3689
|
var Options = ({
|
|
3668
3690
|
icon,
|
|
@@ -3672,8 +3694,8 @@ var Options = ({
|
|
|
3672
3694
|
onChange,
|
|
3673
3695
|
disabled = false
|
|
3674
3696
|
}) => {
|
|
3675
|
-
const [state, setState] = (0,
|
|
3676
|
-
(0,
|
|
3697
|
+
const [state, setState] = (0, import_react18.useState)(0);
|
|
3698
|
+
(0, import_react18.useEffect)(() => {
|
|
3677
3699
|
if (defaultId) {
|
|
3678
3700
|
const defaultIndex = options.findIndex(
|
|
3679
3701
|
(option) => option.id === defaultId
|
|
@@ -3731,7 +3753,7 @@ var Options = ({
|
|
|
3731
3753
|
};
|
|
3732
3754
|
|
|
3733
3755
|
// src/Components/Stepper/Stepper.tsx
|
|
3734
|
-
var
|
|
3756
|
+
var import_react19 = require("react");
|
|
3735
3757
|
var import_styled_components37 = __toESM(require("styled-components"));
|
|
3736
3758
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3737
3759
|
var Wrapper4 = import_styled_components37.default.nav`
|
|
@@ -3770,7 +3792,7 @@ var Stepper = ({
|
|
|
3770
3792
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Wrapper4, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
3771
3793
|
const isActive = i === current;
|
|
3772
3794
|
const isCompleted = i < current;
|
|
3773
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react19.Fragment, { children: [
|
|
3774
3796
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3775
3797
|
Circle,
|
|
3776
3798
|
{
|
|
@@ -3787,7 +3809,7 @@ var Stepper = ({
|
|
|
3787
3809
|
};
|
|
3788
3810
|
|
|
3789
3811
|
// src/Components/Tabs/Tabs.tsx
|
|
3790
|
-
var
|
|
3812
|
+
var import_react20 = require("react");
|
|
3791
3813
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
3792
3814
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3793
3815
|
var TOKENS = {
|
|
@@ -3937,13 +3959,13 @@ var Tabs = (_a) => {
|
|
|
3937
3959
|
"baselineColor",
|
|
3938
3960
|
"children"
|
|
3939
3961
|
]);
|
|
3940
|
-
const rootRef = (0,
|
|
3941
|
-
const refsMap = (0,
|
|
3942
|
-
const [bar, setBar] = (0,
|
|
3962
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
3963
|
+
const refsMap = (0, import_react20.useRef)(/* @__PURE__ */ new Map());
|
|
3964
|
+
const [bar, setBar] = (0, import_react20.useState)({ left: 0, width: 0 });
|
|
3943
3965
|
const setTabRef = (id) => (el) => {
|
|
3944
3966
|
if (el) refsMap.current.set(id, el);
|
|
3945
3967
|
};
|
|
3946
|
-
const updateBar = (0,
|
|
3968
|
+
const updateBar = (0, import_react20.useCallback)(() => {
|
|
3947
3969
|
const root = rootRef.current;
|
|
3948
3970
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
3949
3971
|
if (!root || !activeEl) return;
|
|
@@ -3951,7 +3973,7 @@ var Tabs = (_a) => {
|
|
|
3951
3973
|
const box = activeEl.getBoundingClientRect();
|
|
3952
3974
|
setBar({ left: box.left - rootBox.left, width: box.width });
|
|
3953
3975
|
}, [value]);
|
|
3954
|
-
(0,
|
|
3976
|
+
(0, import_react20.useEffect)(() => {
|
|
3955
3977
|
updateBar();
|
|
3956
3978
|
const ro = new ResizeObserver(updateBar);
|
|
3957
3979
|
const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
|
|
@@ -3959,14 +3981,14 @@ var Tabs = (_a) => {
|
|
|
3959
3981
|
if (activeEl) ro.observe(activeEl);
|
|
3960
3982
|
return () => ro.disconnect();
|
|
3961
3983
|
}, [value, updateBar]);
|
|
3962
|
-
const handleSelect = (0,
|
|
3984
|
+
const handleSelect = (0, import_react20.useCallback)(
|
|
3963
3985
|
(id) => {
|
|
3964
3986
|
if (id !== value && onChange) onChange(id);
|
|
3965
3987
|
},
|
|
3966
3988
|
[onChange, value]
|
|
3967
3989
|
);
|
|
3968
3990
|
const isPillsFullWidth = variant === "pills" && align === "start";
|
|
3969
|
-
const rendered = (0,
|
|
3991
|
+
const rendered = (0, import_react20.useMemo)(() => {
|
|
3970
3992
|
if (items && items.length) {
|
|
3971
3993
|
return items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3972
3994
|
Tab,
|
|
@@ -3983,12 +4005,12 @@ var Tabs = (_a) => {
|
|
|
3983
4005
|
it.id
|
|
3984
4006
|
));
|
|
3985
4007
|
}
|
|
3986
|
-
return
|
|
4008
|
+
return import_react20.Children.map(children, (child) => {
|
|
3987
4009
|
var _a2;
|
|
3988
|
-
if (!(0,
|
|
4010
|
+
if (!(0, import_react20.isValidElement)(child)) return child;
|
|
3989
4011
|
const id = (_a2 = child.props.id) != null ? _a2 : child.key;
|
|
3990
4012
|
const active = id === value;
|
|
3991
|
-
return (0,
|
|
4013
|
+
return (0, import_react20.cloneElement)(child, {
|
|
3992
4014
|
active,
|
|
3993
4015
|
variant,
|
|
3994
4016
|
fullWidth: isPillsFullWidth,
|
|
@@ -4016,7 +4038,7 @@ var Tabs = (_a) => {
|
|
|
4016
4038
|
};
|
|
4017
4039
|
|
|
4018
4040
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
4019
|
-
var
|
|
4041
|
+
var import_react21 = require("react");
|
|
4020
4042
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
4021
4043
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4022
4044
|
var Container5 = import_styled_components39.default.div`
|
|
@@ -4059,8 +4081,8 @@ var MultiSelect = ({
|
|
|
4059
4081
|
width,
|
|
4060
4082
|
align = "left"
|
|
4061
4083
|
}) => {
|
|
4062
|
-
const [isOpen, setIsOpen] = (0,
|
|
4063
|
-
const dropdownRef = (0,
|
|
4084
|
+
const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
|
|
4085
|
+
const dropdownRef = (0, import_react21.useRef)(null);
|
|
4064
4086
|
const toggleOption = (value) => {
|
|
4065
4087
|
if (!onChange) return;
|
|
4066
4088
|
if (selectedValues.includes(value)) {
|
|
@@ -4070,7 +4092,7 @@ var MultiSelect = ({
|
|
|
4070
4092
|
onChange([...selectedValues, value]);
|
|
4071
4093
|
}
|
|
4072
4094
|
};
|
|
4073
|
-
(0,
|
|
4095
|
+
(0, import_react21.useEffect)(() => {
|
|
4074
4096
|
const handleClickOutside = (e) => {
|
|
4075
4097
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
4076
4098
|
setIsOpen(false);
|
|
@@ -4112,15 +4134,15 @@ var MultiSelect = ({
|
|
|
4112
4134
|
};
|
|
4113
4135
|
|
|
4114
4136
|
// src/Components/DatePicker/DatePicker.tsx
|
|
4115
|
-
var
|
|
4137
|
+
var import_react22 = require("react");
|
|
4116
4138
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4117
4139
|
var DatePicker = ({ onChange, size = "s" }) => {
|
|
4118
|
-
const [isOpen, setIsOpen] = (0,
|
|
4119
|
-
const [startDate, setStartDate] = (0,
|
|
4120
|
-
const [endDate, setEndDate] = (0,
|
|
4121
|
-
const [currentMonth, setCurrentMonth] = (0,
|
|
4122
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
4123
|
-
const ref = (0,
|
|
4140
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
|
|
4141
|
+
const [startDate, setStartDate] = (0, import_react22.useState)(null);
|
|
4142
|
+
const [endDate, setEndDate] = (0, import_react22.useState)(null);
|
|
4143
|
+
const [currentMonth, setCurrentMonth] = (0, import_react22.useState)(/* @__PURE__ */ new Date());
|
|
4144
|
+
const [isSelectingEnd, setIsSelectingEnd] = (0, import_react22.useState)(false);
|
|
4145
|
+
const ref = (0, import_react22.useRef)(null);
|
|
4124
4146
|
const isFiltered = !!startDate && !!endDate;
|
|
4125
4147
|
const toggleCalendar = () => setIsOpen((prev) => !prev);
|
|
4126
4148
|
const resetDates = () => {
|
|
@@ -4180,7 +4202,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4180
4202
|
};
|
|
4181
4203
|
const isDateStart = (date) => !!startDate && date.getTime() === startDate.getTime();
|
|
4182
4204
|
const isDateEnd = (date) => !!endDate && date.getTime() === endDate.getTime();
|
|
4183
|
-
(0,
|
|
4205
|
+
(0, import_react22.useEffect)(() => {
|
|
4184
4206
|
const handleClickOutside = (event) => {
|
|
4185
4207
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
4186
4208
|
setIsOpen(false);
|
|
@@ -4330,7 +4352,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4330
4352
|
};
|
|
4331
4353
|
|
|
4332
4354
|
// src/Components/IconTabs/IconTabs.tsx
|
|
4333
|
-
var
|
|
4355
|
+
var import_react23 = require("react");
|
|
4334
4356
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
4335
4357
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4336
4358
|
var TabsContainer = import_styled_components40.default.div`
|
|
@@ -4392,10 +4414,10 @@ var IconTabs = ({
|
|
|
4392
4414
|
defaultTabIndex = 0
|
|
4393
4415
|
}) => {
|
|
4394
4416
|
var _a;
|
|
4395
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
4396
|
-
const sliderRef = (0,
|
|
4397
|
-
const tabRefs = (0,
|
|
4398
|
-
(0,
|
|
4417
|
+
const [selectedTab, setSelectedTab] = (0, import_react23.useState)(defaultTabIndex);
|
|
4418
|
+
const sliderRef = (0, import_react23.useRef)(null);
|
|
4419
|
+
const tabRefs = (0, import_react23.useRef)([]);
|
|
4420
|
+
(0, import_react23.useEffect)(() => {
|
|
4399
4421
|
if (defaultTabIndex >= 0 && defaultTabIndex !== selectedTab) {
|
|
4400
4422
|
setSelectedTab(defaultTabIndex);
|
|
4401
4423
|
}
|
|
@@ -4406,7 +4428,7 @@ var IconTabs = ({
|
|
|
4406
4428
|
onTabChange(index);
|
|
4407
4429
|
}
|
|
4408
4430
|
};
|
|
4409
|
-
(0,
|
|
4431
|
+
(0, import_react23.useEffect)(() => {
|
|
4410
4432
|
if (sliderRef.current && tabRefs.current[selectedTab]) {
|
|
4411
4433
|
const selectedTabRect = tabRefs.current[selectedTab].getBoundingClientRect();
|
|
4412
4434
|
const parentRect = tabRefs.current[selectedTab].parentElement.getBoundingClientRect();
|
|
@@ -4445,7 +4467,7 @@ var IconTabs = ({
|
|
|
4445
4467
|
};
|
|
4446
4468
|
|
|
4447
4469
|
// src/Components/Popover/Popover.tsx
|
|
4448
|
-
var
|
|
4470
|
+
var import_react24 = require("react");
|
|
4449
4471
|
var import_react_dom2 = require("react-dom");
|
|
4450
4472
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
4451
4473
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -4481,11 +4503,11 @@ var PopoverItem = import_styled_components41.default.div`
|
|
|
4481
4503
|
}
|
|
4482
4504
|
`;
|
|
4483
4505
|
var Popover = ({ items = [], children }) => {
|
|
4484
|
-
const [open, setOpen] = (0,
|
|
4485
|
-
const ref = (0,
|
|
4486
|
-
const menuRef = (0,
|
|
4487
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
4488
|
-
const updatePosition = (0,
|
|
4506
|
+
const [open, setOpen] = (0, import_react24.useState)(false);
|
|
4507
|
+
const ref = (0, import_react24.useRef)(null);
|
|
4508
|
+
const menuRef = (0, import_react24.useRef)(null);
|
|
4509
|
+
const [menuPosition, setMenuPosition] = (0, import_react24.useState)({ top: 0, left: 0 });
|
|
4510
|
+
const updatePosition = (0, import_react24.useCallback)(() => {
|
|
4489
4511
|
var _a;
|
|
4490
4512
|
if (!ref.current) {
|
|
4491
4513
|
return;
|
|
@@ -4505,7 +4527,7 @@ var Popover = ({ items = [], children }) => {
|
|
|
4505
4527
|
left: rect.right
|
|
4506
4528
|
});
|
|
4507
4529
|
}, [items.length]);
|
|
4508
|
-
(0,
|
|
4530
|
+
(0, import_react24.useEffect)(() => {
|
|
4509
4531
|
const handleClickOutside = (event) => {
|
|
4510
4532
|
var _a, _b;
|
|
4511
4533
|
const isInTrigger = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
|
@@ -4610,7 +4632,7 @@ var MetricCard = ({
|
|
|
4610
4632
|
};
|
|
4611
4633
|
|
|
4612
4634
|
// src/Components/Tooltip/Tooltip.tsx
|
|
4613
|
-
var
|
|
4635
|
+
var import_react25 = require("react");
|
|
4614
4636
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
4615
4637
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4616
4638
|
var StyledTooltipWrapper = import_styled_components42.default.div`
|
|
@@ -4714,7 +4736,7 @@ var Tooltip = ({
|
|
|
4714
4736
|
direction = "top",
|
|
4715
4737
|
children
|
|
4716
4738
|
}) => {
|
|
4717
|
-
const [isVisible, setIsVisible] = (0,
|
|
4739
|
+
const [isVisible, setIsVisible] = (0, import_react25.useState)(false);
|
|
4718
4740
|
const handleMouseEnter = () => setIsVisible(true);
|
|
4719
4741
|
const handleMouseLeave = () => setIsVisible(false);
|
|
4720
4742
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
@@ -4741,7 +4763,7 @@ var Tooltip = ({
|
|
|
4741
4763
|
};
|
|
4742
4764
|
|
|
4743
4765
|
// src/Components/Pagination/Pagination.tsx
|
|
4744
|
-
var
|
|
4766
|
+
var import_react26 = require("react");
|
|
4745
4767
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4746
4768
|
var getPageNumbers = (current, total) => {
|
|
4747
4769
|
if (total <= 5) {
|
|
@@ -4765,7 +4787,7 @@ var Pagination = ({
|
|
|
4765
4787
|
summaryLabel
|
|
4766
4788
|
}) => {
|
|
4767
4789
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
4768
|
-
const pages = (0,
|
|
4790
|
+
const pages = (0, import_react26.useMemo)(
|
|
4769
4791
|
() => getPageNumbers(currentPage, totalPages),
|
|
4770
4792
|
[currentPage, totalPages]
|
|
4771
4793
|
);
|
|
@@ -4819,7 +4841,7 @@ var Pagination = ({
|
|
|
4819
4841
|
};
|
|
4820
4842
|
|
|
4821
4843
|
// src/Components/FileUploadZone/FileUploadZone.tsx
|
|
4822
|
-
var
|
|
4844
|
+
var import_react27 = require("react");
|
|
4823
4845
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
4824
4846
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4825
4847
|
var ACCEPT_MAP = {
|
|
@@ -4906,19 +4928,19 @@ var FileUploadZone = ({
|
|
|
4906
4928
|
icon = "cloud-arrow-up",
|
|
4907
4929
|
showFileName = false
|
|
4908
4930
|
}) => {
|
|
4909
|
-
const [isDragging, setIsDragging] = (0,
|
|
4910
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
4931
|
+
const [isDragging, setIsDragging] = (0, import_react27.useState)(false);
|
|
4932
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react27.useState)(
|
|
4911
4933
|
null
|
|
4912
4934
|
);
|
|
4913
|
-
const [fileType, setFileType] = (0,
|
|
4914
|
-
const [fileName, setFileName] = (0,
|
|
4915
|
-
const [inlineError, setInlineError] = (0,
|
|
4916
|
-
const inputRef = (0,
|
|
4935
|
+
const [fileType, setFileType] = (0, import_react27.useState)(null);
|
|
4936
|
+
const [fileName, setFileName] = (0, import_react27.useState)(null);
|
|
4937
|
+
const [inlineError, setInlineError] = (0, import_react27.useState)(null);
|
|
4938
|
+
const inputRef = (0, import_react27.useRef)(null);
|
|
4917
4939
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
4918
4940
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
4919
4941
|
const acceptString = mimeTypes.join(",");
|
|
4920
4942
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
4921
|
-
const emitError = (0,
|
|
4943
|
+
const emitError = (0, import_react27.useCallback)(
|
|
4922
4944
|
(message) => {
|
|
4923
4945
|
if (onError) {
|
|
4924
4946
|
onError(message);
|
|
@@ -4928,7 +4950,7 @@ var FileUploadZone = ({
|
|
|
4928
4950
|
},
|
|
4929
4951
|
[onError]
|
|
4930
4952
|
);
|
|
4931
|
-
const validateFile = (0,
|
|
4953
|
+
const validateFile = (0, import_react27.useCallback)(
|
|
4932
4954
|
(file) => {
|
|
4933
4955
|
if (!mimeTypes.includes(file.type)) {
|
|
4934
4956
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -4943,7 +4965,7 @@ var FileUploadZone = ({
|
|
|
4943
4965
|
},
|
|
4944
4966
|
[mimeTypes, maxSizeMB]
|
|
4945
4967
|
);
|
|
4946
|
-
const processFile = (0,
|
|
4968
|
+
const processFile = (0, import_react27.useCallback)(
|
|
4947
4969
|
(file) => {
|
|
4948
4970
|
setInlineError(null);
|
|
4949
4971
|
const result = validateFile(file);
|
|
@@ -4961,7 +4983,7 @@ var FileUploadZone = ({
|
|
|
4961
4983
|
},
|
|
4962
4984
|
[validateFile, onSave, showPreview, emitError]
|
|
4963
4985
|
);
|
|
4964
|
-
const processFiles = (0,
|
|
4986
|
+
const processFiles = (0, import_react27.useCallback)(
|
|
4965
4987
|
(files) => {
|
|
4966
4988
|
setInlineError(null);
|
|
4967
4989
|
for (const file of files) {
|
package/dist/index.mjs
CHANGED
|
@@ -3276,8 +3276,9 @@ var TableCell = (props) => {
|
|
|
3276
3276
|
};
|
|
3277
3277
|
|
|
3278
3278
|
// src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
|
|
3279
|
+
import { useState as useState9 } from "react";
|
|
3279
3280
|
import styled31 from "styled-components";
|
|
3280
|
-
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3281
|
+
import { jsx as jsx35, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3281
3282
|
var shouldForwardPropTableHeaderCell = (prop) => !["useSort", "isSort", "flexGrow", "flexShrink", "width"].includes(prop);
|
|
3282
3283
|
var StyledTableHeaderCell = styled31.div.withConfig({
|
|
3283
3284
|
shouldForwardProp: shouldForwardPropTableHeaderCell
|
|
@@ -3295,24 +3296,45 @@ var StyledTableHeaderCell = styled31.div.withConfig({
|
|
|
3295
3296
|
font-weight: bold;
|
|
3296
3297
|
max-width: ${(props) => props.width || "auto"};
|
|
3297
3298
|
min-width: ${(props) => props.width || "auto"};
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3299
|
+
`;
|
|
3300
|
+
var SortingButton = styled31.span`
|
|
3301
|
+
display: inline-flex;
|
|
3302
|
+
align-items: center;
|
|
3303
|
+
gap: 8px;
|
|
3304
|
+
cursor: pointer;
|
|
3305
|
+
`;
|
|
3306
|
+
var SortArrow = styled31.span`
|
|
3307
|
+
font-style: normal;
|
|
3308
|
+
font-size: 0.9em;
|
|
3309
|
+
line-height: 1;
|
|
3310
|
+
transition: opacity 0.15s;
|
|
3311
|
+
opacity: ${(props) => props.$opacity};
|
|
3307
3312
|
`;
|
|
3308
3313
|
var TableHeaderCell = (props) => {
|
|
3309
|
-
const _a = props, { children, useSort, isSort } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort"]);
|
|
3314
|
+
const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
|
|
3315
|
+
const [hovered, setHovered] = useState9(false);
|
|
3316
|
+
const showArrow = useSort && (isSort || hovered);
|
|
3317
|
+
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
3318
|
+
const arrowOpacity = isSort ? 1 : 0.35;
|
|
3310
3319
|
return /* @__PURE__ */ jsx35(
|
|
3311
3320
|
StyledTableHeaderCell,
|
|
3312
3321
|
__spreadProps(__spreadValues({}, otherProps), {
|
|
3313
3322
|
useSort,
|
|
3314
3323
|
isSort,
|
|
3315
|
-
|
|
3324
|
+
onMouseEnter: (e) => {
|
|
3325
|
+
var _a2;
|
|
3326
|
+
if (useSort) setHovered(true);
|
|
3327
|
+
(_a2 = otherProps.onMouseEnter) == null ? void 0 : _a2.call(otherProps, e);
|
|
3328
|
+
},
|
|
3329
|
+
onMouseLeave: (e) => {
|
|
3330
|
+
var _a2;
|
|
3331
|
+
if (useSort) setHovered(false);
|
|
3332
|
+
(_a2 = otherProps.onMouseLeave) == null ? void 0 : _a2.call(otherProps, e);
|
|
3333
|
+
},
|
|
3334
|
+
children: useSort ? /* @__PURE__ */ jsxs15(SortingButton, { children: [
|
|
3335
|
+
children,
|
|
3336
|
+
showArrow && /* @__PURE__ */ jsx35(SortArrow, { $opacity: arrowOpacity, children: arrowChar })
|
|
3337
|
+
] }) : children
|
|
3316
3338
|
})
|
|
3317
3339
|
);
|
|
3318
3340
|
};
|
|
@@ -3413,7 +3435,7 @@ var TableFooterCell = (props) => {
|
|
|
3413
3435
|
};
|
|
3414
3436
|
|
|
3415
3437
|
// src/Components/Table/SkeletonRow/SkeletonRow.tsx
|
|
3416
|
-
import { Fragment as Fragment4, jsx as jsx40, jsxs as
|
|
3438
|
+
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3417
3439
|
var style = `
|
|
3418
3440
|
.skeleton-loader {
|
|
3419
3441
|
width: 100%;
|
|
@@ -3432,7 +3454,7 @@ var style = `
|
|
|
3432
3454
|
}
|
|
3433
3455
|
}
|
|
3434
3456
|
`;
|
|
3435
|
-
var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */
|
|
3457
|
+
var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
3436
3458
|
/* @__PURE__ */ jsx40("style", { children: style }),
|
|
3437
3459
|
/* @__PURE__ */ jsx40(TableRow, { children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx40(TableCell, { children: /* @__PURE__ */ jsx40("div", { className: "skeleton-loader" }) }, index)) })
|
|
3438
3460
|
] });
|
|
@@ -3440,7 +3462,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs15(Fragment4, { child
|
|
|
3440
3462
|
// src/Components/Switch/Switch.tsx
|
|
3441
3463
|
import { forwardRef as forwardRef7 } from "react";
|
|
3442
3464
|
import styled36, { css } from "styled-components";
|
|
3443
|
-
import { jsx as jsx41, jsxs as
|
|
3465
|
+
import { jsx as jsx41, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3444
3466
|
var BASE = {
|
|
3445
3467
|
s: { w: 36, h: 20, knob: 16, pad: 2 },
|
|
3446
3468
|
m: { w: 48, h: 28, knob: 24, pad: 2 },
|
|
@@ -3541,7 +3563,7 @@ var Switch = forwardRef7(
|
|
|
3541
3563
|
if (disabled) return;
|
|
3542
3564
|
onChange == null ? void 0 : onChange(!!e.target.checked, e);
|
|
3543
3565
|
};
|
|
3544
|
-
return /* @__PURE__ */
|
|
3566
|
+
return /* @__PURE__ */ jsxs17(Container4, { $disabled: disabled, htmlFor: id, children: [
|
|
3545
3567
|
/* @__PURE__ */ jsx41(
|
|
3546
3568
|
HiddenCheckbox,
|
|
3547
3569
|
__spreadValues({
|
|
@@ -3575,8 +3597,8 @@ var CardSkeleton = () => {
|
|
|
3575
3597
|
};
|
|
3576
3598
|
|
|
3577
3599
|
// src/Components/Options/Options.tsx
|
|
3578
|
-
import { useState as
|
|
3579
|
-
import { jsx as jsx43, jsxs as
|
|
3600
|
+
import { useState as useState10, useEffect as useEffect8 } from "react";
|
|
3601
|
+
import { jsx as jsx43, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3580
3602
|
var Options = ({
|
|
3581
3603
|
icon,
|
|
3582
3604
|
options,
|
|
@@ -3585,7 +3607,7 @@ var Options = ({
|
|
|
3585
3607
|
onChange,
|
|
3586
3608
|
disabled = false
|
|
3587
3609
|
}) => {
|
|
3588
|
-
const [state, setState] =
|
|
3610
|
+
const [state, setState] = useState10(0);
|
|
3589
3611
|
useEffect8(() => {
|
|
3590
3612
|
if (defaultId) {
|
|
3591
3613
|
const defaultIndex = options.findIndex(
|
|
@@ -3635,7 +3657,7 @@ var Options = ({
|
|
|
3635
3657
|
e.currentTarget.style.transform = "translateY(0px)";
|
|
3636
3658
|
}
|
|
3637
3659
|
},
|
|
3638
|
-
children: /* @__PURE__ */
|
|
3660
|
+
children: /* @__PURE__ */ jsxs18(Row_default, { gap: "8", alignItems: "center", justifyContent: "center", children: [
|
|
3639
3661
|
/* @__PURE__ */ jsx43(Col_default, { children: /* @__PURE__ */ jsx43(Icon_default, { name: icon, type: "regular", color: "#414652" }) }),
|
|
3640
3662
|
/* @__PURE__ */ jsx43(Col_default, { children: label })
|
|
3641
3663
|
] })
|
|
@@ -3646,7 +3668,7 @@ var Options = ({
|
|
|
3646
3668
|
// src/Components/Stepper/Stepper.tsx
|
|
3647
3669
|
import { Fragment as Fragment5 } from "react";
|
|
3648
3670
|
import styled37 from "styled-components";
|
|
3649
|
-
import { jsx as jsx44, jsxs as
|
|
3671
|
+
import { jsx as jsx44, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3650
3672
|
var Wrapper4 = styled37.nav`
|
|
3651
3673
|
width: 100%;
|
|
3652
3674
|
display: flex;
|
|
@@ -3683,7 +3705,7 @@ var Stepper = ({
|
|
|
3683
3705
|
return /* @__PURE__ */ jsx44(Wrapper4, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
3684
3706
|
const isActive = i === current;
|
|
3685
3707
|
const isCompleted = i < current;
|
|
3686
|
-
return /* @__PURE__ */
|
|
3708
|
+
return /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
3687
3709
|
/* @__PURE__ */ jsx44(
|
|
3688
3710
|
Circle,
|
|
3689
3711
|
{
|
|
@@ -3705,13 +3727,13 @@ import {
|
|
|
3705
3727
|
useEffect as useEffect9,
|
|
3706
3728
|
useMemo,
|
|
3707
3729
|
useRef as useRef8,
|
|
3708
|
-
useState as
|
|
3730
|
+
useState as useState11,
|
|
3709
3731
|
Children,
|
|
3710
3732
|
isValidElement,
|
|
3711
3733
|
cloneElement
|
|
3712
3734
|
} from "react";
|
|
3713
3735
|
import styled38 from "styled-components";
|
|
3714
|
-
import { jsx as jsx45, jsxs as
|
|
3736
|
+
import { jsx as jsx45, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3715
3737
|
var TOKENS = {
|
|
3716
3738
|
fontFamily: '"Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif'
|
|
3717
3739
|
};
|
|
@@ -3861,7 +3883,7 @@ var Tabs = (_a) => {
|
|
|
3861
3883
|
]);
|
|
3862
3884
|
const rootRef = useRef8(null);
|
|
3863
3885
|
const refsMap = useRef8(/* @__PURE__ */ new Map());
|
|
3864
|
-
const [bar, setBar] =
|
|
3886
|
+
const [bar, setBar] = useState11({ left: 0, width: 0 });
|
|
3865
3887
|
const setTabRef = (id) => (el) => {
|
|
3866
3888
|
if (el) refsMap.current.set(id, el);
|
|
3867
3889
|
};
|
|
@@ -3919,7 +3941,7 @@ var Tabs = (_a) => {
|
|
|
3919
3941
|
});
|
|
3920
3942
|
});
|
|
3921
3943
|
}, [items, children, value, variant, isPillsFullWidth, handleSelect]);
|
|
3922
|
-
return /* @__PURE__ */
|
|
3944
|
+
return /* @__PURE__ */ jsxs20(
|
|
3923
3945
|
TabsRoot,
|
|
3924
3946
|
__spreadProps(__spreadValues({
|
|
3925
3947
|
ref: rootRef,
|
|
@@ -3938,9 +3960,9 @@ var Tabs = (_a) => {
|
|
|
3938
3960
|
};
|
|
3939
3961
|
|
|
3940
3962
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
3941
|
-
import { useState as
|
|
3963
|
+
import { useState as useState12, useRef as useRef9, useEffect as useEffect10 } from "react";
|
|
3942
3964
|
import styled39 from "styled-components";
|
|
3943
|
-
import { jsx as jsx46, jsxs as
|
|
3965
|
+
import { jsx as jsx46, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3944
3966
|
var Container5 = styled39.div`
|
|
3945
3967
|
position: relative;
|
|
3946
3968
|
display: inline-block;
|
|
@@ -3981,7 +4003,7 @@ var MultiSelect = ({
|
|
|
3981
4003
|
width,
|
|
3982
4004
|
align = "left"
|
|
3983
4005
|
}) => {
|
|
3984
|
-
const [isOpen, setIsOpen] =
|
|
4006
|
+
const [isOpen, setIsOpen] = useState12(false);
|
|
3985
4007
|
const dropdownRef = useRef9(null);
|
|
3986
4008
|
const toggleOption = (value) => {
|
|
3987
4009
|
if (!onChange) return;
|
|
@@ -4001,7 +4023,7 @@ var MultiSelect = ({
|
|
|
4001
4023
|
document.addEventListener("mousedown", handleClickOutside);
|
|
4002
4024
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
4003
4025
|
}, []);
|
|
4004
|
-
return /* @__PURE__ */
|
|
4026
|
+
return /* @__PURE__ */ jsxs21(Container5, { ref: dropdownRef, children: [
|
|
4005
4027
|
/* @__PURE__ */ jsx46(
|
|
4006
4028
|
Button,
|
|
4007
4029
|
{
|
|
@@ -4012,10 +4034,10 @@ var MultiSelect = ({
|
|
|
4012
4034
|
disabled
|
|
4013
4035
|
}
|
|
4014
4036
|
),
|
|
4015
|
-
isOpen && /* @__PURE__ */
|
|
4037
|
+
isOpen && /* @__PURE__ */ jsxs21(Dropdown2, { $width: width, $align: align, children: [
|
|
4016
4038
|
options.map(({ label: optLabel, value }) => {
|
|
4017
4039
|
const active = selectedValues.includes(value);
|
|
4018
|
-
return /* @__PURE__ */
|
|
4040
|
+
return /* @__PURE__ */ jsxs21(Item, { onClick: () => toggleOption(value), children: [
|
|
4019
4041
|
/* @__PURE__ */ jsx46(
|
|
4020
4042
|
Icon,
|
|
4021
4043
|
{
|
|
@@ -4034,14 +4056,14 @@ var MultiSelect = ({
|
|
|
4034
4056
|
};
|
|
4035
4057
|
|
|
4036
4058
|
// src/Components/DatePicker/DatePicker.tsx
|
|
4037
|
-
import { useState as
|
|
4038
|
-
import { jsx as jsx47, jsxs as
|
|
4059
|
+
import { useState as useState13, useRef as useRef10, useEffect as useEffect11 } from "react";
|
|
4060
|
+
import { jsx as jsx47, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4039
4061
|
var DatePicker = ({ onChange, size = "s" }) => {
|
|
4040
|
-
const [isOpen, setIsOpen] =
|
|
4041
|
-
const [startDate, setStartDate] =
|
|
4042
|
-
const [endDate, setEndDate] =
|
|
4043
|
-
const [currentMonth, setCurrentMonth] =
|
|
4044
|
-
const [isSelectingEnd, setIsSelectingEnd] =
|
|
4062
|
+
const [isOpen, setIsOpen] = useState13(false);
|
|
4063
|
+
const [startDate, setStartDate] = useState13(null);
|
|
4064
|
+
const [endDate, setEndDate] = useState13(null);
|
|
4065
|
+
const [currentMonth, setCurrentMonth] = useState13(/* @__PURE__ */ new Date());
|
|
4066
|
+
const [isSelectingEnd, setIsSelectingEnd] = useState13(false);
|
|
4045
4067
|
const ref = useRef10(null);
|
|
4046
4068
|
const isFiltered = !!startDate && !!endDate;
|
|
4047
4069
|
const toggleCalendar = () => setIsOpen((prev) => !prev);
|
|
@@ -4126,7 +4148,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4126
4148
|
"D\xE9cembre"
|
|
4127
4149
|
];
|
|
4128
4150
|
const dayNames = ["Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"];
|
|
4129
|
-
return /* @__PURE__ */
|
|
4151
|
+
return /* @__PURE__ */ jsxs22("div", { className: "date-picker-container", ref, children: [
|
|
4130
4152
|
/* @__PURE__ */ jsx47(Button, { onClick: toggleCalendar, size, iconLeft: "calendar" }),
|
|
4131
4153
|
isFiltered && /* @__PURE__ */ jsx47(
|
|
4132
4154
|
"span",
|
|
@@ -4149,8 +4171,8 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4149
4171
|
children: /* @__PURE__ */ jsx47(Icon, { name: "xmark", size: "s", color: colors.white })
|
|
4150
4172
|
}
|
|
4151
4173
|
),
|
|
4152
|
-
isOpen && /* @__PURE__ */ jsx47("div", { className: "date-picker-popup", children: /* @__PURE__ */ jsx47("div", { className: "date-picker-content", children: /* @__PURE__ */
|
|
4153
|
-
/* @__PURE__ */
|
|
4174
|
+
isOpen && /* @__PURE__ */ jsx47("div", { className: "date-picker-popup", children: /* @__PURE__ */ jsx47("div", { className: "date-picker-content", children: /* @__PURE__ */ jsxs22("div", { className: "calendar-container", children: [
|
|
4175
|
+
/* @__PURE__ */ jsxs22("div", { className: "calendar-header", children: [
|
|
4154
4176
|
/* @__PURE__ */ jsx47(
|
|
4155
4177
|
"button",
|
|
4156
4178
|
{
|
|
@@ -4177,7 +4199,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4177
4199
|
)
|
|
4178
4200
|
}
|
|
4179
4201
|
),
|
|
4180
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ jsxs22("h3", { className: "calendar-month-title", children: [
|
|
4181
4203
|
monthNames[currentMonth.getMonth()],
|
|
4182
4204
|
" ",
|
|
4183
4205
|
currentMonth.getFullYear()
|
|
@@ -4232,7 +4254,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4232
4254
|
index
|
|
4233
4255
|
);
|
|
4234
4256
|
}) }),
|
|
4235
|
-
startDate && /* @__PURE__ */ jsx47("div", { className: "selected-dates-display", children: /* @__PURE__ */ jsx47("div", { className: "selected-dates-text", children: endDate ? /* @__PURE__ */
|
|
4257
|
+
startDate && /* @__PURE__ */ jsx47("div", { className: "selected-dates-display", children: /* @__PURE__ */ jsx47("div", { className: "selected-dates-text", children: endDate ? /* @__PURE__ */ jsxs22("span", { children: [
|
|
4236
4258
|
/* @__PURE__ */ jsx47("strong", { children: "Du:" }),
|
|
4237
4259
|
" ",
|
|
4238
4260
|
formatDate(startDate, "weekday", "fr"),
|
|
@@ -4240,7 +4262,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4240
4262
|
/* @__PURE__ */ jsx47("strong", { children: "Au:" }),
|
|
4241
4263
|
" ",
|
|
4242
4264
|
formatDate(endDate, "weekday", "fr")
|
|
4243
|
-
] }) : /* @__PURE__ */
|
|
4265
|
+
] }) : /* @__PURE__ */ jsxs22("span", { children: [
|
|
4244
4266
|
/* @__PURE__ */ jsx47("strong", { children: "D\xE9but:" }),
|
|
4245
4267
|
" ",
|
|
4246
4268
|
formatDate(startDate, "weekday", "fr"),
|
|
@@ -4252,9 +4274,9 @@ var DatePicker = ({ onChange, size = "s" }) => {
|
|
|
4252
4274
|
};
|
|
4253
4275
|
|
|
4254
4276
|
// src/Components/IconTabs/IconTabs.tsx
|
|
4255
|
-
import { useState as
|
|
4277
|
+
import { useState as useState14, useEffect as useEffect12, useRef as useRef11 } from "react";
|
|
4256
4278
|
import styled40, { css as css2 } from "styled-components";
|
|
4257
|
-
import { jsx as jsx48, jsxs as
|
|
4279
|
+
import { jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4258
4280
|
var TabsContainer = styled40.div`
|
|
4259
4281
|
display: flex;
|
|
4260
4282
|
flex-direction: column;
|
|
@@ -4314,7 +4336,7 @@ var IconTabs = ({
|
|
|
4314
4336
|
defaultTabIndex = 0
|
|
4315
4337
|
}) => {
|
|
4316
4338
|
var _a;
|
|
4317
|
-
const [selectedTab, setSelectedTab] =
|
|
4339
|
+
const [selectedTab, setSelectedTab] = useState14(defaultTabIndex);
|
|
4318
4340
|
const sliderRef = useRef11(null);
|
|
4319
4341
|
const tabRefs = useRef11([]);
|
|
4320
4342
|
useEffect12(() => {
|
|
@@ -4337,8 +4359,8 @@ var IconTabs = ({
|
|
|
4337
4359
|
sliderRef.current.style.backgroundColor = colors[selectedColor];
|
|
4338
4360
|
}
|
|
4339
4361
|
}, [selectedTab, selectedColor]);
|
|
4340
|
-
return /* @__PURE__ */
|
|
4341
|
-
/* @__PURE__ */
|
|
4362
|
+
return /* @__PURE__ */ jsxs23(TabsContainer, { children: [
|
|
4363
|
+
/* @__PURE__ */ jsxs23(IconsRow, { children: [
|
|
4342
4364
|
items.map((item, index) => /* @__PURE__ */ jsx48(
|
|
4343
4365
|
Tab2,
|
|
4344
4366
|
{
|
|
@@ -4367,10 +4389,10 @@ var IconTabs = ({
|
|
|
4367
4389
|
};
|
|
4368
4390
|
|
|
4369
4391
|
// src/Components/Popover/Popover.tsx
|
|
4370
|
-
import { useState as
|
|
4392
|
+
import { useState as useState15, useRef as useRef12, useEffect as useEffect13, useCallback as useCallback4 } from "react";
|
|
4371
4393
|
import { createPortal } from "react-dom";
|
|
4372
4394
|
import styled41 from "styled-components";
|
|
4373
|
-
import { jsx as jsx49, jsxs as
|
|
4395
|
+
import { jsx as jsx49, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4374
4396
|
var PopoverWrapper = styled41.div`
|
|
4375
4397
|
position: relative;
|
|
4376
4398
|
display: inline-block;
|
|
@@ -4403,10 +4425,10 @@ var PopoverItem = styled41.div`
|
|
|
4403
4425
|
}
|
|
4404
4426
|
`;
|
|
4405
4427
|
var Popover = ({ items = [], children }) => {
|
|
4406
|
-
const [open, setOpen] =
|
|
4428
|
+
const [open, setOpen] = useState15(false);
|
|
4407
4429
|
const ref = useRef12(null);
|
|
4408
4430
|
const menuRef = useRef12(null);
|
|
4409
|
-
const [menuPosition, setMenuPosition] =
|
|
4431
|
+
const [menuPosition, setMenuPosition] = useState15({ top: 0, left: 0 });
|
|
4410
4432
|
const updatePosition = useCallback4(() => {
|
|
4411
4433
|
var _a;
|
|
4412
4434
|
if (!ref.current) {
|
|
@@ -4448,7 +4470,7 @@ var Popover = ({ items = [], children }) => {
|
|
|
4448
4470
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
4449
4471
|
};
|
|
4450
4472
|
}, [open, updatePosition]);
|
|
4451
|
-
return /* @__PURE__ */
|
|
4473
|
+
return /* @__PURE__ */ jsxs24(PopoverWrapper, { ref, children: [
|
|
4452
4474
|
/* @__PURE__ */ jsx49(PopoverTrigger, { onClick: () => setOpen((o) => !o), children }),
|
|
4453
4475
|
open && createPortal(
|
|
4454
4476
|
/* @__PURE__ */ jsx49(
|
|
@@ -4481,7 +4503,7 @@ var Popover = ({ items = [], children }) => {
|
|
|
4481
4503
|
};
|
|
4482
4504
|
|
|
4483
4505
|
// src/Components/MetricCard/MetricCard.tsx
|
|
4484
|
-
import { jsx as jsx50, jsxs as
|
|
4506
|
+
import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4485
4507
|
var MetricCard = ({
|
|
4486
4508
|
icon,
|
|
4487
4509
|
title,
|
|
@@ -4504,7 +4526,7 @@ var MetricCard = ({
|
|
|
4504
4526
|
cursor: onClick ? "pointer" : "default"
|
|
4505
4527
|
},
|
|
4506
4528
|
onClick,
|
|
4507
|
-
children: /* @__PURE__ */
|
|
4529
|
+
children: /* @__PURE__ */ jsxs25(Row, { alignItems: "center", gap: "12", fullWidth: true, children: [
|
|
4508
4530
|
/* @__PURE__ */ jsx50(
|
|
4509
4531
|
Box,
|
|
4510
4532
|
{
|
|
@@ -4519,10 +4541,10 @@ var MetricCard = ({
|
|
|
4519
4541
|
children: /* @__PURE__ */ jsx50(Icon, { name: icon, size: "m", color: iconColor, family: "regular" })
|
|
4520
4542
|
}
|
|
4521
4543
|
),
|
|
4522
|
-
contentLayout === "row" ? /* @__PURE__ */
|
|
4544
|
+
contentLayout === "row" ? /* @__PURE__ */ jsxs25(Row, { gap: "6", alignItems: "center", children: [
|
|
4523
4545
|
/* @__PURE__ */ jsx50(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value }),
|
|
4524
4546
|
/* @__PURE__ */ jsx50(Text, { size: "s", variant: "grey_600", children: title })
|
|
4525
|
-
] }) : /* @__PURE__ */
|
|
4547
|
+
] }) : /* @__PURE__ */ jsxs25(Col, { gap: "4", children: [
|
|
4526
4548
|
/* @__PURE__ */ jsx50(Text, { size: "s", variant: "grey_600", children: title }),
|
|
4527
4549
|
/* @__PURE__ */ jsx50(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value })
|
|
4528
4550
|
] })
|
|
@@ -4532,9 +4554,9 @@ var MetricCard = ({
|
|
|
4532
4554
|
};
|
|
4533
4555
|
|
|
4534
4556
|
// src/Components/Tooltip/Tooltip.tsx
|
|
4535
|
-
import { useState as
|
|
4557
|
+
import { useState as useState16 } from "react";
|
|
4536
4558
|
import styled42 from "styled-components";
|
|
4537
|
-
import { jsx as jsx51, jsxs as
|
|
4559
|
+
import { jsx as jsx51, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4538
4560
|
var StyledTooltipWrapper = styled42.div`
|
|
4539
4561
|
position: relative;
|
|
4540
4562
|
display: inline-block;
|
|
@@ -4636,10 +4658,10 @@ var Tooltip = ({
|
|
|
4636
4658
|
direction = "top",
|
|
4637
4659
|
children
|
|
4638
4660
|
}) => {
|
|
4639
|
-
const [isVisible, setIsVisible] =
|
|
4661
|
+
const [isVisible, setIsVisible] = useState16(false);
|
|
4640
4662
|
const handleMouseEnter = () => setIsVisible(true);
|
|
4641
4663
|
const handleMouseLeave = () => setIsVisible(false);
|
|
4642
|
-
return /* @__PURE__ */
|
|
4664
|
+
return /* @__PURE__ */ jsxs26(
|
|
4643
4665
|
StyledTooltipWrapper,
|
|
4644
4666
|
{
|
|
4645
4667
|
onMouseEnter: handleMouseEnter,
|
|
@@ -4664,7 +4686,7 @@ var Tooltip = ({
|
|
|
4664
4686
|
|
|
4665
4687
|
// src/Components/Pagination/Pagination.tsx
|
|
4666
4688
|
import { useMemo as useMemo2 } from "react";
|
|
4667
|
-
import { jsx as jsx52, jsxs as
|
|
4689
|
+
import { jsx as jsx52, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4668
4690
|
var getPageNumbers = (current, total) => {
|
|
4669
4691
|
if (total <= 5) {
|
|
4670
4692
|
return Array.from({ length: total }, (_, i) => i + 1);
|
|
@@ -4694,14 +4716,14 @@ var Pagination = ({
|
|
|
4694
4716
|
const startItem = (currentPage - 1) * itemsPerPage + 1;
|
|
4695
4717
|
const endItem = Math.min(currentPage * itemsPerPage, totalItems);
|
|
4696
4718
|
const summary = summaryLabel || defaultSummary(startItem, endItem, totalItems);
|
|
4697
|
-
return /* @__PURE__ */
|
|
4719
|
+
return /* @__PURE__ */ jsxs27(
|
|
4698
4720
|
Row,
|
|
4699
4721
|
{
|
|
4700
4722
|
justifyContent: showSummary ? "space-between" : "flex-end",
|
|
4701
4723
|
alignItems: "center",
|
|
4702
4724
|
children: [
|
|
4703
4725
|
showSummary && /* @__PURE__ */ jsx52(Text, { size: "s", color: colors.grey_500, children: summary }),
|
|
4704
|
-
/* @__PURE__ */
|
|
4726
|
+
/* @__PURE__ */ jsxs27(Row, { gap: "4", alignItems: "center", style: { width: "fit-content" }, children: [
|
|
4705
4727
|
/* @__PURE__ */ jsx52(
|
|
4706
4728
|
Button,
|
|
4707
4729
|
{
|
|
@@ -4741,9 +4763,9 @@ var Pagination = ({
|
|
|
4741
4763
|
};
|
|
4742
4764
|
|
|
4743
4765
|
// src/Components/FileUploadZone/FileUploadZone.tsx
|
|
4744
|
-
import { useState as
|
|
4766
|
+
import { useState as useState17, useRef as useRef13, useCallback as useCallback5 } from "react";
|
|
4745
4767
|
import styled43 from "styled-components";
|
|
4746
|
-
import { jsx as jsx53, jsxs as
|
|
4768
|
+
import { jsx as jsx53, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4747
4769
|
var ACCEPT_MAP = {
|
|
4748
4770
|
png: "image/png",
|
|
4749
4771
|
jpg: "image/jpeg",
|
|
@@ -4828,13 +4850,13 @@ var FileUploadZone = ({
|
|
|
4828
4850
|
icon = "cloud-arrow-up",
|
|
4829
4851
|
showFileName = false
|
|
4830
4852
|
}) => {
|
|
4831
|
-
const [isDragging, setIsDragging] =
|
|
4832
|
-
const [internalPreviewUrl, setInternalPreviewUrl] =
|
|
4853
|
+
const [isDragging, setIsDragging] = useState17(false);
|
|
4854
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = useState17(
|
|
4833
4855
|
null
|
|
4834
4856
|
);
|
|
4835
|
-
const [fileType, setFileType] =
|
|
4836
|
-
const [fileName, setFileName] =
|
|
4837
|
-
const [inlineError, setInlineError] =
|
|
4857
|
+
const [fileType, setFileType] = useState17(null);
|
|
4858
|
+
const [fileName, setFileName] = useState17(null);
|
|
4859
|
+
const [inlineError, setInlineError] = useState17(null);
|
|
4838
4860
|
const inputRef = useRef13(null);
|
|
4839
4861
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
4840
4862
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
@@ -4941,7 +4963,7 @@ var FileUploadZone = ({
|
|
|
4941
4963
|
onRemove == null ? void 0 : onRemove();
|
|
4942
4964
|
};
|
|
4943
4965
|
if (previewUrl) {
|
|
4944
|
-
return /* @__PURE__ */
|
|
4966
|
+
return /* @__PURE__ */ jsxs28(StyledPreview, { $fullWidth: fullWidth, children: [
|
|
4945
4967
|
fileType && isPdf(fileType) ? /* @__PURE__ */ jsx53(StyledEmbed, { src: previewUrl, type: "application/pdf" }) : /* @__PURE__ */ jsx53(StyledImage2, { src: previewUrl, alt: "Aper\xE7u du fichier" }),
|
|
4946
4968
|
/* @__PURE__ */ jsx53(Row, { gap: "8", justifyContent: "center", children: /* @__PURE__ */ jsx53(
|
|
4947
4969
|
Button,
|
|
@@ -4957,8 +4979,8 @@ var FileUploadZone = ({
|
|
|
4957
4979
|
}
|
|
4958
4980
|
const showIcon = icon !== false;
|
|
4959
4981
|
const showBrowse = !compact && browseLabel !== false;
|
|
4960
|
-
return /* @__PURE__ */
|
|
4961
|
-
/* @__PURE__ */
|
|
4982
|
+
return /* @__PURE__ */ jsxs28(Col, { gap: "4", children: [
|
|
4983
|
+
/* @__PURE__ */ jsxs28(
|
|
4962
4984
|
StyledDropZone,
|
|
4963
4985
|
{
|
|
4964
4986
|
$isDragging: isDragging,
|
|
@@ -5008,7 +5030,7 @@ var FileUploadZone = ({
|
|
|
5008
5030
|
]
|
|
5009
5031
|
}
|
|
5010
5032
|
),
|
|
5011
|
-
showFileName && fileName && /* @__PURE__ */
|
|
5033
|
+
showFileName && fileName && /* @__PURE__ */ jsxs28(Row, { gap: "8", alignItems: "center", justifyContent: "center", children: [
|
|
5012
5034
|
/* @__PURE__ */ jsx53(Icon, { name: "file", size: "s", color: "green_700" }),
|
|
5013
5035
|
/* @__PURE__ */ jsx53(Text, { size: "s", color: "green_700", children: fileName })
|
|
5014
5036
|
] }),
|