design-zystem 1.0.235 → 1.0.237

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 CHANGED
@@ -186,8 +186,9 @@ interface DrawerProps {
186
186
  isLoading?: boolean;
187
187
  leftVariant?: string;
188
188
  variant?: string;
189
+ footer?: ReactNode;
189
190
  }
190
- declare const Drawer: ({ showDrawer, closeDrawer, title, width, children, leftButtonLabel, leftButtonAction, rightButtonLabel, rightButtonAction, isLoading, leftVariant, variant, }: DrawerProps) => react_jsx_runtime.JSX.Element | null;
191
+ declare const Drawer: ({ showDrawer, closeDrawer, title, width, children, leftButtonLabel, leftButtonAction, rightButtonLabel, rightButtonAction, isLoading, leftVariant, variant, footer, }: DrawerProps) => react_jsx_runtime.JSX.Element | null;
191
192
 
192
193
  type SizeKey = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
193
194
  interface TagBubbleProps extends HTMLAttributes<HTMLDivElement> {
@@ -224,6 +225,7 @@ interface BubbleProps {
224
225
  maxChars?: number;
225
226
  borderRadius?: string;
226
227
  width?: string;
228
+ style?: CSSProperties;
227
229
  }
228
230
  declare const Bubble: ({ children, ...otherProps }: BubbleProps) => react_jsx_runtime.JSX.Element;
229
231
 
@@ -639,10 +641,12 @@ interface TableCellProps extends HTMLAttributes<HTMLDivElement> {
639
641
  }
640
642
  declare const TableCell: (props: TableCellProps) => react_jsx_runtime.JSX.Element;
641
643
 
644
+ type SortOrder = 'asc' | 'desc' | null;
642
645
  interface TableHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
643
646
  children?: ReactNode;
644
647
  useSort?: boolean;
645
648
  isSort?: boolean;
649
+ sortOrder?: SortOrder;
646
650
  flexGrow?: string | number;
647
651
  flexShrink?: string | number;
648
652
  width?: string;
@@ -930,4 +934,4 @@ interface OptimizeImageOptions {
930
934
  }
931
935
  declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
932
936
 
933
- 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
@@ -186,8 +186,9 @@ interface DrawerProps {
186
186
  isLoading?: boolean;
187
187
  leftVariant?: string;
188
188
  variant?: string;
189
+ footer?: ReactNode;
189
190
  }
190
- declare const Drawer: ({ showDrawer, closeDrawer, title, width, children, leftButtonLabel, leftButtonAction, rightButtonLabel, rightButtonAction, isLoading, leftVariant, variant, }: DrawerProps) => react_jsx_runtime.JSX.Element | null;
191
+ declare const Drawer: ({ showDrawer, closeDrawer, title, width, children, leftButtonLabel, leftButtonAction, rightButtonLabel, rightButtonAction, isLoading, leftVariant, variant, footer, }: DrawerProps) => react_jsx_runtime.JSX.Element | null;
191
192
 
192
193
  type SizeKey = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
193
194
  interface TagBubbleProps extends HTMLAttributes<HTMLDivElement> {
@@ -224,6 +225,7 @@ interface BubbleProps {
224
225
  maxChars?: number;
225
226
  borderRadius?: string;
226
227
  width?: string;
228
+ style?: CSSProperties;
227
229
  }
228
230
  declare const Bubble: ({ children, ...otherProps }: BubbleProps) => react_jsx_runtime.JSX.Element;
229
231
 
@@ -639,10 +641,12 @@ interface TableCellProps extends HTMLAttributes<HTMLDivElement> {
639
641
  }
640
642
  declare const TableCell: (props: TableCellProps) => react_jsx_runtime.JSX.Element;
641
643
 
644
+ type SortOrder = 'asc' | 'desc' | null;
642
645
  interface TableHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
643
646
  children?: ReactNode;
644
647
  useSort?: boolean;
645
648
  isSort?: boolean;
649
+ sortOrder?: SortOrder;
646
650
  flexGrow?: string | number;
647
651
  flexShrink?: string | number;
648
652
  width?: string;
@@ -930,4 +934,4 @@ interface OptimizeImageOptions {
930
934
  }
931
935
  declare const optimizeImage: (file: File | null | undefined, desiredBaseName: string, opts?: OptimizeImageOptions) => Promise<OptimizeImageResult>;
932
936
 
933
- 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
@@ -1493,7 +1493,8 @@ var Drawer = ({
1493
1493
  rightButtonAction,
1494
1494
  isLoading = false,
1495
1495
  leftVariant,
1496
- variant = "blue_700"
1496
+ variant = "blue_700",
1497
+ footer
1497
1498
  }) => {
1498
1499
  const [isRendered, setIsRendered] = (0, import_react6.useState)(showDrawer);
1499
1500
  const [isVisible, setIsVisible] = (0, import_react6.useState)(false);
@@ -1535,6 +1536,7 @@ var Drawer = ({
1535
1536
  title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Divider, { orientation: "horizontal", thickness: "1px" }),
1536
1537
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScrollableContent, { children: children && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Col, { fullWidth: true, children }) }),
1537
1538
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Divider, { orientation: "horizontal", thickness: "1px" }),
1539
+ footer,
1538
1540
  (leftButtonLabel || rightButtonLabel) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Row, { gap: "12", fullWidth: true, children: [
1539
1541
  leftButtonLabel && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1540
1542
  Button,
@@ -3361,6 +3363,7 @@ var TableCell = (props) => {
3361
3363
  };
3362
3364
 
3363
3365
  // src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
3366
+ var import_react16 = require("react");
3364
3367
  var import_styled_components31 = __toESM(require("styled-components"));
3365
3368
  var import_jsx_runtime35 = require("react/jsx-runtime");
3366
3369
  var shouldForwardPropTableHeaderCell = (prop) => !["useSort", "isSort", "flexGrow", "flexShrink", "width"].includes(prop);
@@ -3380,24 +3383,48 @@ var StyledTableHeaderCell = import_styled_components31.default.div.withConfig({
3380
3383
  font-weight: bold;
3381
3384
  max-width: ${(props) => props.width || "auto"};
3382
3385
  min-width: ${(props) => props.width || "auto"};
3383
-
3384
- .sortingButton {
3385
- display: ${(props) => props.useSort ? "inline-flex" : "block"};
3386
- align-items: center;
3387
- padding: ${(props) => props.useSort ? "2px 10px" : "none"};
3388
- background: ${(props) => props.useSort ? props.isSort ? "#f8af2d" : "#FFF5" : "none"};
3389
- border-radius: ${(props) => props.useSort ? "20px" : "0"};
3390
- gap: ${(props) => props.useSort ? "8px" : "0"};
3391
- }
3386
+ `;
3387
+ var SortingButton = import_styled_components31.default.span`
3388
+ display: inline-flex;
3389
+ align-items: center;
3390
+ padding: 2px 10px;
3391
+ background: ${(props) => props.$isSort ? "#f8af2d" : "#FFF5"};
3392
+ border-radius: 20px;
3393
+ gap: 8px;
3394
+ cursor: pointer;
3395
+ `;
3396
+ var SortArrow = import_styled_components31.default.span`
3397
+ font-style: normal;
3398
+ font-size: 0.9em;
3399
+ line-height: 1;
3400
+ transition: opacity 0.15s;
3401
+ opacity: ${(props) => props.$opacity};
3392
3402
  `;
3393
3403
  var TableHeaderCell = (props) => {
3394
- const _a = props, { children, useSort, isSort } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort"]);
3404
+ const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
3405
+ const [hovered, setHovered] = (0, import_react16.useState)(false);
3406
+ const showArrow = useSort && (isSort || hovered);
3407
+ const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
3408
+ const arrowOpacity = isSort ? 1 : 0.35;
3395
3409
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3396
3410
  StyledTableHeaderCell,
3397
3411
  __spreadProps(__spreadValues({}, otherProps), {
3398
3412
  useSort,
3399
3413
  isSort,
3400
- children: useSort ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "sortingButton", children }) : children
3414
+ onMouseEnter: (e) => {
3415
+ var _a2;
3416
+ if (useSort) setHovered(true);
3417
+ (_a2 = otherProps.onMouseEnter) == null ? void 0 : _a2.call(otherProps, e);
3418
+ },
3419
+ onMouseLeave: (e) => {
3420
+ var _a2;
3421
+ if (useSort) setHovered(false);
3422
+ (_a2 = otherProps.onMouseLeave) == null ? void 0 : _a2.call(otherProps, e);
3423
+ },
3424
+ children: useSort ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(SortingButton, { $isSort: isSort, children: [
3425
+ children,
3426
+ showArrow && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SortArrow, { $opacity: arrowOpacity, children: arrowChar })
3427
+ ] }) : children
3401
3428
  })
3402
3429
  );
3403
3430
  };
@@ -3523,7 +3550,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime40.
3523
3550
  ] });
3524
3551
 
3525
3552
  // src/Components/Switch/Switch.tsx
3526
- var import_react16 = require("react");
3553
+ var import_react17 = require("react");
3527
3554
  var import_styled_components36 = __toESM(require("styled-components"));
3528
3555
  var import_jsx_runtime41 = require("react/jsx-runtime");
3529
3556
  var BASE = {
@@ -3604,7 +3631,7 @@ var Knob = import_styled_components36.default.span`
3604
3631
  transform: translateY(-50%) scale(0.96);
3605
3632
  }
3606
3633
  `;
3607
- var Switch = (0, import_react16.forwardRef)(
3634
+ var Switch = (0, import_react17.forwardRef)(
3608
3635
  (_a, ref) => {
3609
3636
  var _b = _a, {
3610
3637
  checked,
@@ -3660,7 +3687,7 @@ var CardSkeleton = () => {
3660
3687
  };
3661
3688
 
3662
3689
  // src/Components/Options/Options.tsx
3663
- var import_react17 = require("react");
3690
+ var import_react18 = require("react");
3664
3691
  var import_jsx_runtime43 = require("react/jsx-runtime");
3665
3692
  var Options = ({
3666
3693
  icon,
@@ -3670,8 +3697,8 @@ var Options = ({
3670
3697
  onChange,
3671
3698
  disabled = false
3672
3699
  }) => {
3673
- const [state, setState] = (0, import_react17.useState)(0);
3674
- (0, import_react17.useEffect)(() => {
3700
+ const [state, setState] = (0, import_react18.useState)(0);
3701
+ (0, import_react18.useEffect)(() => {
3675
3702
  if (defaultId) {
3676
3703
  const defaultIndex = options.findIndex(
3677
3704
  (option) => option.id === defaultId
@@ -3729,7 +3756,7 @@ var Options = ({
3729
3756
  };
3730
3757
 
3731
3758
  // src/Components/Stepper/Stepper.tsx
3732
- var import_react18 = require("react");
3759
+ var import_react19 = require("react");
3733
3760
  var import_styled_components37 = __toESM(require("styled-components"));
3734
3761
  var import_jsx_runtime44 = require("react/jsx-runtime");
3735
3762
  var Wrapper4 = import_styled_components37.default.nav`
@@ -3768,7 +3795,7 @@ var Stepper = ({
3768
3795
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Wrapper4, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
3769
3796
  const isActive = i === current;
3770
3797
  const isCompleted = i < current;
3771
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react18.Fragment, { children: [
3798
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react19.Fragment, { children: [
3772
3799
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3773
3800
  Circle,
3774
3801
  {
@@ -3785,7 +3812,7 @@ var Stepper = ({
3785
3812
  };
3786
3813
 
3787
3814
  // src/Components/Tabs/Tabs.tsx
3788
- var import_react19 = require("react");
3815
+ var import_react20 = require("react");
3789
3816
  var import_styled_components38 = __toESM(require("styled-components"));
3790
3817
  var import_jsx_runtime45 = require("react/jsx-runtime");
3791
3818
  var TOKENS = {
@@ -3935,13 +3962,13 @@ var Tabs = (_a) => {
3935
3962
  "baselineColor",
3936
3963
  "children"
3937
3964
  ]);
3938
- const rootRef = (0, import_react19.useRef)(null);
3939
- const refsMap = (0, import_react19.useRef)(/* @__PURE__ */ new Map());
3940
- const [bar, setBar] = (0, import_react19.useState)({ left: 0, width: 0 });
3965
+ const rootRef = (0, import_react20.useRef)(null);
3966
+ const refsMap = (0, import_react20.useRef)(/* @__PURE__ */ new Map());
3967
+ const [bar, setBar] = (0, import_react20.useState)({ left: 0, width: 0 });
3941
3968
  const setTabRef = (id) => (el) => {
3942
3969
  if (el) refsMap.current.set(id, el);
3943
3970
  };
3944
- const updateBar = (0, import_react19.useCallback)(() => {
3971
+ const updateBar = (0, import_react20.useCallback)(() => {
3945
3972
  const root = rootRef.current;
3946
3973
  const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
3947
3974
  if (!root || !activeEl) return;
@@ -3949,7 +3976,7 @@ var Tabs = (_a) => {
3949
3976
  const box = activeEl.getBoundingClientRect();
3950
3977
  setBar({ left: box.left - rootBox.left, width: box.width });
3951
3978
  }, [value]);
3952
- (0, import_react19.useEffect)(() => {
3979
+ (0, import_react20.useEffect)(() => {
3953
3980
  updateBar();
3954
3981
  const ro = new ResizeObserver(updateBar);
3955
3982
  const activeEl = value !== void 0 ? refsMap.current.get(value) : void 0;
@@ -3957,14 +3984,14 @@ var Tabs = (_a) => {
3957
3984
  if (activeEl) ro.observe(activeEl);
3958
3985
  return () => ro.disconnect();
3959
3986
  }, [value, updateBar]);
3960
- const handleSelect = (0, import_react19.useCallback)(
3987
+ const handleSelect = (0, import_react20.useCallback)(
3961
3988
  (id) => {
3962
3989
  if (id !== value && onChange) onChange(id);
3963
3990
  },
3964
3991
  [onChange, value]
3965
3992
  );
3966
3993
  const isPillsFullWidth = variant === "pills" && align === "start";
3967
- const rendered = (0, import_react19.useMemo)(() => {
3994
+ const rendered = (0, import_react20.useMemo)(() => {
3968
3995
  if (items && items.length) {
3969
3996
  return items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3970
3997
  Tab,
@@ -3981,12 +4008,12 @@ var Tabs = (_a) => {
3981
4008
  it.id
3982
4009
  ));
3983
4010
  }
3984
- return import_react19.Children.map(children, (child) => {
4011
+ return import_react20.Children.map(children, (child) => {
3985
4012
  var _a2;
3986
- if (!(0, import_react19.isValidElement)(child)) return child;
4013
+ if (!(0, import_react20.isValidElement)(child)) return child;
3987
4014
  const id = (_a2 = child.props.id) != null ? _a2 : child.key;
3988
4015
  const active = id === value;
3989
- return (0, import_react19.cloneElement)(child, {
4016
+ return (0, import_react20.cloneElement)(child, {
3990
4017
  active,
3991
4018
  variant,
3992
4019
  fullWidth: isPillsFullWidth,
@@ -4014,7 +4041,7 @@ var Tabs = (_a) => {
4014
4041
  };
4015
4042
 
4016
4043
  // src/Components/MultiSelect/MultiSelect.tsx
4017
- var import_react20 = require("react");
4044
+ var import_react21 = require("react");
4018
4045
  var import_styled_components39 = __toESM(require("styled-components"));
4019
4046
  var import_jsx_runtime46 = require("react/jsx-runtime");
4020
4047
  var Container5 = import_styled_components39.default.div`
@@ -4057,8 +4084,8 @@ var MultiSelect = ({
4057
4084
  width,
4058
4085
  align = "left"
4059
4086
  }) => {
4060
- const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
4061
- const dropdownRef = (0, import_react20.useRef)(null);
4087
+ const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
4088
+ const dropdownRef = (0, import_react21.useRef)(null);
4062
4089
  const toggleOption = (value) => {
4063
4090
  if (!onChange) return;
4064
4091
  if (selectedValues.includes(value)) {
@@ -4068,7 +4095,7 @@ var MultiSelect = ({
4068
4095
  onChange([...selectedValues, value]);
4069
4096
  }
4070
4097
  };
4071
- (0, import_react20.useEffect)(() => {
4098
+ (0, import_react21.useEffect)(() => {
4072
4099
  const handleClickOutside = (e) => {
4073
4100
  if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
4074
4101
  setIsOpen(false);
@@ -4110,15 +4137,15 @@ var MultiSelect = ({
4110
4137
  };
4111
4138
 
4112
4139
  // src/Components/DatePicker/DatePicker.tsx
4113
- var import_react21 = require("react");
4140
+ var import_react22 = require("react");
4114
4141
  var import_jsx_runtime47 = require("react/jsx-runtime");
4115
4142
  var DatePicker = ({ onChange, size = "s" }) => {
4116
- const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
4117
- const [startDate, setStartDate] = (0, import_react21.useState)(null);
4118
- const [endDate, setEndDate] = (0, import_react21.useState)(null);
4119
- const [currentMonth, setCurrentMonth] = (0, import_react21.useState)(/* @__PURE__ */ new Date());
4120
- const [isSelectingEnd, setIsSelectingEnd] = (0, import_react21.useState)(false);
4121
- const ref = (0, import_react21.useRef)(null);
4143
+ const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
4144
+ const [startDate, setStartDate] = (0, import_react22.useState)(null);
4145
+ const [endDate, setEndDate] = (0, import_react22.useState)(null);
4146
+ const [currentMonth, setCurrentMonth] = (0, import_react22.useState)(/* @__PURE__ */ new Date());
4147
+ const [isSelectingEnd, setIsSelectingEnd] = (0, import_react22.useState)(false);
4148
+ const ref = (0, import_react22.useRef)(null);
4122
4149
  const isFiltered = !!startDate && !!endDate;
4123
4150
  const toggleCalendar = () => setIsOpen((prev) => !prev);
4124
4151
  const resetDates = () => {
@@ -4178,7 +4205,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
4178
4205
  };
4179
4206
  const isDateStart = (date) => !!startDate && date.getTime() === startDate.getTime();
4180
4207
  const isDateEnd = (date) => !!endDate && date.getTime() === endDate.getTime();
4181
- (0, import_react21.useEffect)(() => {
4208
+ (0, import_react22.useEffect)(() => {
4182
4209
  const handleClickOutside = (event) => {
4183
4210
  if (ref.current && !ref.current.contains(event.target)) {
4184
4211
  setIsOpen(false);
@@ -4328,7 +4355,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
4328
4355
  };
4329
4356
 
4330
4357
  // src/Components/IconTabs/IconTabs.tsx
4331
- var import_react22 = require("react");
4358
+ var import_react23 = require("react");
4332
4359
  var import_styled_components40 = __toESM(require("styled-components"));
4333
4360
  var import_jsx_runtime48 = require("react/jsx-runtime");
4334
4361
  var TabsContainer = import_styled_components40.default.div`
@@ -4390,10 +4417,10 @@ var IconTabs = ({
4390
4417
  defaultTabIndex = 0
4391
4418
  }) => {
4392
4419
  var _a;
4393
- const [selectedTab, setSelectedTab] = (0, import_react22.useState)(defaultTabIndex);
4394
- const sliderRef = (0, import_react22.useRef)(null);
4395
- const tabRefs = (0, import_react22.useRef)([]);
4396
- (0, import_react22.useEffect)(() => {
4420
+ const [selectedTab, setSelectedTab] = (0, import_react23.useState)(defaultTabIndex);
4421
+ const sliderRef = (0, import_react23.useRef)(null);
4422
+ const tabRefs = (0, import_react23.useRef)([]);
4423
+ (0, import_react23.useEffect)(() => {
4397
4424
  if (defaultTabIndex >= 0 && defaultTabIndex !== selectedTab) {
4398
4425
  setSelectedTab(defaultTabIndex);
4399
4426
  }
@@ -4404,7 +4431,7 @@ var IconTabs = ({
4404
4431
  onTabChange(index);
4405
4432
  }
4406
4433
  };
4407
- (0, import_react22.useEffect)(() => {
4434
+ (0, import_react23.useEffect)(() => {
4408
4435
  if (sliderRef.current && tabRefs.current[selectedTab]) {
4409
4436
  const selectedTabRect = tabRefs.current[selectedTab].getBoundingClientRect();
4410
4437
  const parentRect = tabRefs.current[selectedTab].parentElement.getBoundingClientRect();
@@ -4443,7 +4470,7 @@ var IconTabs = ({
4443
4470
  };
4444
4471
 
4445
4472
  // src/Components/Popover/Popover.tsx
4446
- var import_react23 = require("react");
4473
+ var import_react24 = require("react");
4447
4474
  var import_react_dom2 = require("react-dom");
4448
4475
  var import_styled_components41 = __toESM(require("styled-components"));
4449
4476
  var import_jsx_runtime49 = require("react/jsx-runtime");
@@ -4479,11 +4506,11 @@ var PopoverItem = import_styled_components41.default.div`
4479
4506
  }
4480
4507
  `;
4481
4508
  var Popover = ({ items = [], children }) => {
4482
- const [open, setOpen] = (0, import_react23.useState)(false);
4483
- const ref = (0, import_react23.useRef)(null);
4484
- const menuRef = (0, import_react23.useRef)(null);
4485
- const [menuPosition, setMenuPosition] = (0, import_react23.useState)({ top: 0, left: 0 });
4486
- const updatePosition = (0, import_react23.useCallback)(() => {
4509
+ const [open, setOpen] = (0, import_react24.useState)(false);
4510
+ const ref = (0, import_react24.useRef)(null);
4511
+ const menuRef = (0, import_react24.useRef)(null);
4512
+ const [menuPosition, setMenuPosition] = (0, import_react24.useState)({ top: 0, left: 0 });
4513
+ const updatePosition = (0, import_react24.useCallback)(() => {
4487
4514
  var _a;
4488
4515
  if (!ref.current) {
4489
4516
  return;
@@ -4503,7 +4530,7 @@ var Popover = ({ items = [], children }) => {
4503
4530
  left: rect.right
4504
4531
  });
4505
4532
  }, [items.length]);
4506
- (0, import_react23.useEffect)(() => {
4533
+ (0, import_react24.useEffect)(() => {
4507
4534
  const handleClickOutside = (event) => {
4508
4535
  var _a, _b;
4509
4536
  const isInTrigger = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
@@ -4608,7 +4635,7 @@ var MetricCard = ({
4608
4635
  };
4609
4636
 
4610
4637
  // src/Components/Tooltip/Tooltip.tsx
4611
- var import_react24 = require("react");
4638
+ var import_react25 = require("react");
4612
4639
  var import_styled_components42 = __toESM(require("styled-components"));
4613
4640
  var import_jsx_runtime51 = require("react/jsx-runtime");
4614
4641
  var StyledTooltipWrapper = import_styled_components42.default.div`
@@ -4712,7 +4739,7 @@ var Tooltip = ({
4712
4739
  direction = "top",
4713
4740
  children
4714
4741
  }) => {
4715
- const [isVisible, setIsVisible] = (0, import_react24.useState)(false);
4742
+ const [isVisible, setIsVisible] = (0, import_react25.useState)(false);
4716
4743
  const handleMouseEnter = () => setIsVisible(true);
4717
4744
  const handleMouseLeave = () => setIsVisible(false);
4718
4745
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
@@ -4739,7 +4766,7 @@ var Tooltip = ({
4739
4766
  };
4740
4767
 
4741
4768
  // src/Components/Pagination/Pagination.tsx
4742
- var import_react25 = require("react");
4769
+ var import_react26 = require("react");
4743
4770
  var import_jsx_runtime52 = require("react/jsx-runtime");
4744
4771
  var getPageNumbers = (current, total) => {
4745
4772
  if (total <= 5) {
@@ -4763,7 +4790,7 @@ var Pagination = ({
4763
4790
  summaryLabel
4764
4791
  }) => {
4765
4792
  const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
4766
- const pages = (0, import_react25.useMemo)(
4793
+ const pages = (0, import_react26.useMemo)(
4767
4794
  () => getPageNumbers(currentPage, totalPages),
4768
4795
  [currentPage, totalPages]
4769
4796
  );
@@ -4817,7 +4844,7 @@ var Pagination = ({
4817
4844
  };
4818
4845
 
4819
4846
  // src/Components/FileUploadZone/FileUploadZone.tsx
4820
- var import_react26 = require("react");
4847
+ var import_react27 = require("react");
4821
4848
  var import_styled_components43 = __toESM(require("styled-components"));
4822
4849
  var import_jsx_runtime53 = require("react/jsx-runtime");
4823
4850
  var ACCEPT_MAP = {
@@ -4904,19 +4931,19 @@ var FileUploadZone = ({
4904
4931
  icon = "cloud-arrow-up",
4905
4932
  showFileName = false
4906
4933
  }) => {
4907
- const [isDragging, setIsDragging] = (0, import_react26.useState)(false);
4908
- const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react26.useState)(
4934
+ const [isDragging, setIsDragging] = (0, import_react27.useState)(false);
4935
+ const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react27.useState)(
4909
4936
  null
4910
4937
  );
4911
- const [fileType, setFileType] = (0, import_react26.useState)(null);
4912
- const [fileName, setFileName] = (0, import_react26.useState)(null);
4913
- const [inlineError, setInlineError] = (0, import_react26.useState)(null);
4914
- const inputRef = (0, import_react26.useRef)(null);
4938
+ const [fileType, setFileType] = (0, import_react27.useState)(null);
4939
+ const [fileName, setFileName] = (0, import_react27.useState)(null);
4940
+ const [inlineError, setInlineError] = (0, import_react27.useState)(null);
4941
+ const inputRef = (0, import_react27.useRef)(null);
4915
4942
  const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
4916
4943
  const mimeTypes = getMimeTypes(resolvedAccept);
4917
4944
  const acceptString = mimeTypes.join(",");
4918
4945
  const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
4919
- const emitError = (0, import_react26.useCallback)(
4946
+ const emitError = (0, import_react27.useCallback)(
4920
4947
  (message) => {
4921
4948
  if (onError) {
4922
4949
  onError(message);
@@ -4926,7 +4953,7 @@ var FileUploadZone = ({
4926
4953
  },
4927
4954
  [onError]
4928
4955
  );
4929
- const validateFile = (0, import_react26.useCallback)(
4956
+ const validateFile = (0, import_react27.useCallback)(
4930
4957
  (file) => {
4931
4958
  if (!mimeTypes.includes(file.type)) {
4932
4959
  return { ok: false, error: "Format de fichier non accept\xE9." };
@@ -4941,7 +4968,7 @@ var FileUploadZone = ({
4941
4968
  },
4942
4969
  [mimeTypes, maxSizeMB]
4943
4970
  );
4944
- const processFile = (0, import_react26.useCallback)(
4971
+ const processFile = (0, import_react27.useCallback)(
4945
4972
  (file) => {
4946
4973
  setInlineError(null);
4947
4974
  const result = validateFile(file);
@@ -4959,7 +4986,7 @@ var FileUploadZone = ({
4959
4986
  },
4960
4987
  [validateFile, onSave, showPreview, emitError]
4961
4988
  );
4962
- const processFiles = (0, import_react26.useCallback)(
4989
+ const processFiles = (0, import_react27.useCallback)(
4963
4990
  (files) => {
4964
4991
  setInlineError(null);
4965
4992
  for (const file of files) {
package/dist/index.mjs CHANGED
@@ -1400,7 +1400,8 @@ var Drawer = ({
1400
1400
  rightButtonAction,
1401
1401
  isLoading = false,
1402
1402
  leftVariant,
1403
- variant = "blue_700"
1403
+ variant = "blue_700",
1404
+ footer
1404
1405
  }) => {
1405
1406
  const [isRendered, setIsRendered] = useState3(showDrawer);
1406
1407
  const [isVisible, setIsVisible] = useState3(false);
@@ -1442,6 +1443,7 @@ var Drawer = ({
1442
1443
  title && /* @__PURE__ */ jsx16(Divider, { orientation: "horizontal", thickness: "1px" }),
1443
1444
  /* @__PURE__ */ jsx16(ScrollableContent, { children: children && /* @__PURE__ */ jsx16(Col, { fullWidth: true, children }) }),
1444
1445
  /* @__PURE__ */ jsx16(Divider, { orientation: "horizontal", thickness: "1px" }),
1446
+ footer,
1445
1447
  (leftButtonLabel || rightButtonLabel) && /* @__PURE__ */ jsxs6(Row, { gap: "12", fullWidth: true, children: [
1446
1448
  leftButtonLabel && /* @__PURE__ */ jsx16(
1447
1449
  Button,
@@ -3274,8 +3276,9 @@ var TableCell = (props) => {
3274
3276
  };
3275
3277
 
3276
3278
  // src/Components/Table/TableHeaderCell/TableHeaderCell.tsx
3279
+ import { useState as useState9 } from "react";
3277
3280
  import styled31 from "styled-components";
3278
- import { jsx as jsx35 } from "react/jsx-runtime";
3281
+ import { jsx as jsx35, jsxs as jsxs15 } from "react/jsx-runtime";
3279
3282
  var shouldForwardPropTableHeaderCell = (prop) => !["useSort", "isSort", "flexGrow", "flexShrink", "width"].includes(prop);
3280
3283
  var StyledTableHeaderCell = styled31.div.withConfig({
3281
3284
  shouldForwardProp: shouldForwardPropTableHeaderCell
@@ -3293,24 +3296,48 @@ var StyledTableHeaderCell = styled31.div.withConfig({
3293
3296
  font-weight: bold;
3294
3297
  max-width: ${(props) => props.width || "auto"};
3295
3298
  min-width: ${(props) => props.width || "auto"};
3296
-
3297
- .sortingButton {
3298
- display: ${(props) => props.useSort ? "inline-flex" : "block"};
3299
- align-items: center;
3300
- padding: ${(props) => props.useSort ? "2px 10px" : "none"};
3301
- background: ${(props) => props.useSort ? props.isSort ? "#f8af2d" : "#FFF5" : "none"};
3302
- border-radius: ${(props) => props.useSort ? "20px" : "0"};
3303
- gap: ${(props) => props.useSort ? "8px" : "0"};
3304
- }
3299
+ `;
3300
+ var SortingButton = styled31.span`
3301
+ display: inline-flex;
3302
+ align-items: center;
3303
+ padding: 2px 10px;
3304
+ background: ${(props) => props.$isSort ? "#f8af2d" : "#FFF5"};
3305
+ border-radius: 20px;
3306
+ gap: 8px;
3307
+ cursor: pointer;
3308
+ `;
3309
+ var SortArrow = styled31.span`
3310
+ font-style: normal;
3311
+ font-size: 0.9em;
3312
+ line-height: 1;
3313
+ transition: opacity 0.15s;
3314
+ opacity: ${(props) => props.$opacity};
3305
3315
  `;
3306
3316
  var TableHeaderCell = (props) => {
3307
- const _a = props, { children, useSort, isSort } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort"]);
3317
+ const _a = props, { children, useSort, isSort, sortOrder } = _a, otherProps = __objRest(_a, ["children", "useSort", "isSort", "sortOrder"]);
3318
+ const [hovered, setHovered] = useState9(false);
3319
+ const showArrow = useSort && (isSort || hovered);
3320
+ const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
3321
+ const arrowOpacity = isSort ? 1 : 0.35;
3308
3322
  return /* @__PURE__ */ jsx35(
3309
3323
  StyledTableHeaderCell,
3310
3324
  __spreadProps(__spreadValues({}, otherProps), {
3311
3325
  useSort,
3312
3326
  isSort,
3313
- children: useSort ? /* @__PURE__ */ jsx35("div", { className: "sortingButton", children }) : children
3327
+ onMouseEnter: (e) => {
3328
+ var _a2;
3329
+ if (useSort) setHovered(true);
3330
+ (_a2 = otherProps.onMouseEnter) == null ? void 0 : _a2.call(otherProps, e);
3331
+ },
3332
+ onMouseLeave: (e) => {
3333
+ var _a2;
3334
+ if (useSort) setHovered(false);
3335
+ (_a2 = otherProps.onMouseLeave) == null ? void 0 : _a2.call(otherProps, e);
3336
+ },
3337
+ children: useSort ? /* @__PURE__ */ jsxs15(SortingButton, { $isSort: isSort, children: [
3338
+ children,
3339
+ showArrow && /* @__PURE__ */ jsx35(SortArrow, { $opacity: arrowOpacity, children: arrowChar })
3340
+ ] }) : children
3314
3341
  })
3315
3342
  );
3316
3343
  };
@@ -3411,7 +3438,7 @@ var TableFooterCell = (props) => {
3411
3438
  };
3412
3439
 
3413
3440
  // src/Components/Table/SkeletonRow/SkeletonRow.tsx
3414
- import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs15 } from "react/jsx-runtime";
3441
+ import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
3415
3442
  var style = `
3416
3443
  .skeleton-loader {
3417
3444
  width: 100%;
@@ -3430,7 +3457,7 @@ var style = `
3430
3457
  }
3431
3458
  }
3432
3459
  `;
3433
- var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs15(Fragment4, { children: [
3460
+ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs16(Fragment4, { children: [
3434
3461
  /* @__PURE__ */ jsx40("style", { children: style }),
3435
3462
  /* @__PURE__ */ jsx40(TableRow, { children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx40(TableCell, { children: /* @__PURE__ */ jsx40("div", { className: "skeleton-loader" }) }, index)) })
3436
3463
  ] });
@@ -3438,7 +3465,7 @@ var SkeletonRow = ({ columns = 9 }) => /* @__PURE__ */ jsxs15(Fragment4, { child
3438
3465
  // src/Components/Switch/Switch.tsx
3439
3466
  import { forwardRef as forwardRef7 } from "react";
3440
3467
  import styled36, { css } from "styled-components";
3441
- import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
3468
+ import { jsx as jsx41, jsxs as jsxs17 } from "react/jsx-runtime";
3442
3469
  var BASE = {
3443
3470
  s: { w: 36, h: 20, knob: 16, pad: 2 },
3444
3471
  m: { w: 48, h: 28, knob: 24, pad: 2 },
@@ -3539,7 +3566,7 @@ var Switch = forwardRef7(
3539
3566
  if (disabled) return;
3540
3567
  onChange == null ? void 0 : onChange(!!e.target.checked, e);
3541
3568
  };
3542
- return /* @__PURE__ */ jsxs16(Container4, { $disabled: disabled, htmlFor: id, children: [
3569
+ return /* @__PURE__ */ jsxs17(Container4, { $disabled: disabled, htmlFor: id, children: [
3543
3570
  /* @__PURE__ */ jsx41(
3544
3571
  HiddenCheckbox,
3545
3572
  __spreadValues({
@@ -3573,8 +3600,8 @@ var CardSkeleton = () => {
3573
3600
  };
3574
3601
 
3575
3602
  // src/Components/Options/Options.tsx
3576
- import { useState as useState9, useEffect as useEffect8 } from "react";
3577
- import { jsx as jsx43, jsxs as jsxs17 } from "react/jsx-runtime";
3603
+ import { useState as useState10, useEffect as useEffect8 } from "react";
3604
+ import { jsx as jsx43, jsxs as jsxs18 } from "react/jsx-runtime";
3578
3605
  var Options = ({
3579
3606
  icon,
3580
3607
  options,
@@ -3583,7 +3610,7 @@ var Options = ({
3583
3610
  onChange,
3584
3611
  disabled = false
3585
3612
  }) => {
3586
- const [state, setState] = useState9(0);
3613
+ const [state, setState] = useState10(0);
3587
3614
  useEffect8(() => {
3588
3615
  if (defaultId) {
3589
3616
  const defaultIndex = options.findIndex(
@@ -3633,7 +3660,7 @@ var Options = ({
3633
3660
  e.currentTarget.style.transform = "translateY(0px)";
3634
3661
  }
3635
3662
  },
3636
- children: /* @__PURE__ */ jsxs17(Row_default, { gap: "8", alignItems: "center", justifyContent: "center", children: [
3663
+ children: /* @__PURE__ */ jsxs18(Row_default, { gap: "8", alignItems: "center", justifyContent: "center", children: [
3637
3664
  /* @__PURE__ */ jsx43(Col_default, { children: /* @__PURE__ */ jsx43(Icon_default, { name: icon, type: "regular", color: "#414652" }) }),
3638
3665
  /* @__PURE__ */ jsx43(Col_default, { children: label })
3639
3666
  ] })
@@ -3644,7 +3671,7 @@ var Options = ({
3644
3671
  // src/Components/Stepper/Stepper.tsx
3645
3672
  import { Fragment as Fragment5 } from "react";
3646
3673
  import styled37 from "styled-components";
3647
- import { jsx as jsx44, jsxs as jsxs18 } from "react/jsx-runtime";
3674
+ import { jsx as jsx44, jsxs as jsxs19 } from "react/jsx-runtime";
3648
3675
  var Wrapper4 = styled37.nav`
3649
3676
  width: 100%;
3650
3677
  display: flex;
@@ -3681,7 +3708,7 @@ var Stepper = ({
3681
3708
  return /* @__PURE__ */ jsx44(Wrapper4, { "aria-label": "progression", className, children: Array.from({ length: numberOfSteps }, (_, i) => {
3682
3709
  const isActive = i === current;
3683
3710
  const isCompleted = i < current;
3684
- return /* @__PURE__ */ jsxs18(Fragment5, { children: [
3711
+ return /* @__PURE__ */ jsxs19(Fragment5, { children: [
3685
3712
  /* @__PURE__ */ jsx44(
3686
3713
  Circle,
3687
3714
  {
@@ -3703,13 +3730,13 @@ import {
3703
3730
  useEffect as useEffect9,
3704
3731
  useMemo,
3705
3732
  useRef as useRef8,
3706
- useState as useState10,
3733
+ useState as useState11,
3707
3734
  Children,
3708
3735
  isValidElement,
3709
3736
  cloneElement
3710
3737
  } from "react";
3711
3738
  import styled38 from "styled-components";
3712
- import { jsx as jsx45, jsxs as jsxs19 } from "react/jsx-runtime";
3739
+ import { jsx as jsx45, jsxs as jsxs20 } from "react/jsx-runtime";
3713
3740
  var TOKENS = {
3714
3741
  fontFamily: '"Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif'
3715
3742
  };
@@ -3859,7 +3886,7 @@ var Tabs = (_a) => {
3859
3886
  ]);
3860
3887
  const rootRef = useRef8(null);
3861
3888
  const refsMap = useRef8(/* @__PURE__ */ new Map());
3862
- const [bar, setBar] = useState10({ left: 0, width: 0 });
3889
+ const [bar, setBar] = useState11({ left: 0, width: 0 });
3863
3890
  const setTabRef = (id) => (el) => {
3864
3891
  if (el) refsMap.current.set(id, el);
3865
3892
  };
@@ -3917,7 +3944,7 @@ var Tabs = (_a) => {
3917
3944
  });
3918
3945
  });
3919
3946
  }, [items, children, value, variant, isPillsFullWidth, handleSelect]);
3920
- return /* @__PURE__ */ jsxs19(
3947
+ return /* @__PURE__ */ jsxs20(
3921
3948
  TabsRoot,
3922
3949
  __spreadProps(__spreadValues({
3923
3950
  ref: rootRef,
@@ -3936,9 +3963,9 @@ var Tabs = (_a) => {
3936
3963
  };
3937
3964
 
3938
3965
  // src/Components/MultiSelect/MultiSelect.tsx
3939
- import { useState as useState11, useRef as useRef9, useEffect as useEffect10 } from "react";
3966
+ import { useState as useState12, useRef as useRef9, useEffect as useEffect10 } from "react";
3940
3967
  import styled39 from "styled-components";
3941
- import { jsx as jsx46, jsxs as jsxs20 } from "react/jsx-runtime";
3968
+ import { jsx as jsx46, jsxs as jsxs21 } from "react/jsx-runtime";
3942
3969
  var Container5 = styled39.div`
3943
3970
  position: relative;
3944
3971
  display: inline-block;
@@ -3979,7 +4006,7 @@ var MultiSelect = ({
3979
4006
  width,
3980
4007
  align = "left"
3981
4008
  }) => {
3982
- const [isOpen, setIsOpen] = useState11(false);
4009
+ const [isOpen, setIsOpen] = useState12(false);
3983
4010
  const dropdownRef = useRef9(null);
3984
4011
  const toggleOption = (value) => {
3985
4012
  if (!onChange) return;
@@ -3999,7 +4026,7 @@ var MultiSelect = ({
3999
4026
  document.addEventListener("mousedown", handleClickOutside);
4000
4027
  return () => document.removeEventListener("mousedown", handleClickOutside);
4001
4028
  }, []);
4002
- return /* @__PURE__ */ jsxs20(Container5, { ref: dropdownRef, children: [
4029
+ return /* @__PURE__ */ jsxs21(Container5, { ref: dropdownRef, children: [
4003
4030
  /* @__PURE__ */ jsx46(
4004
4031
  Button,
4005
4032
  {
@@ -4010,10 +4037,10 @@ var MultiSelect = ({
4010
4037
  disabled
4011
4038
  }
4012
4039
  ),
4013
- isOpen && /* @__PURE__ */ jsxs20(Dropdown2, { $width: width, $align: align, children: [
4040
+ isOpen && /* @__PURE__ */ jsxs21(Dropdown2, { $width: width, $align: align, children: [
4014
4041
  options.map(({ label: optLabel, value }) => {
4015
4042
  const active = selectedValues.includes(value);
4016
- return /* @__PURE__ */ jsxs20(Item, { onClick: () => toggleOption(value), children: [
4043
+ return /* @__PURE__ */ jsxs21(Item, { onClick: () => toggleOption(value), children: [
4017
4044
  /* @__PURE__ */ jsx46(
4018
4045
  Icon,
4019
4046
  {
@@ -4032,14 +4059,14 @@ var MultiSelect = ({
4032
4059
  };
4033
4060
 
4034
4061
  // src/Components/DatePicker/DatePicker.tsx
4035
- import { useState as useState12, useRef as useRef10, useEffect as useEffect11 } from "react";
4036
- import { jsx as jsx47, jsxs as jsxs21 } from "react/jsx-runtime";
4062
+ import { useState as useState13, useRef as useRef10, useEffect as useEffect11 } from "react";
4063
+ import { jsx as jsx47, jsxs as jsxs22 } from "react/jsx-runtime";
4037
4064
  var DatePicker = ({ onChange, size = "s" }) => {
4038
- const [isOpen, setIsOpen] = useState12(false);
4039
- const [startDate, setStartDate] = useState12(null);
4040
- const [endDate, setEndDate] = useState12(null);
4041
- const [currentMonth, setCurrentMonth] = useState12(/* @__PURE__ */ new Date());
4042
- const [isSelectingEnd, setIsSelectingEnd] = useState12(false);
4065
+ const [isOpen, setIsOpen] = useState13(false);
4066
+ const [startDate, setStartDate] = useState13(null);
4067
+ const [endDate, setEndDate] = useState13(null);
4068
+ const [currentMonth, setCurrentMonth] = useState13(/* @__PURE__ */ new Date());
4069
+ const [isSelectingEnd, setIsSelectingEnd] = useState13(false);
4043
4070
  const ref = useRef10(null);
4044
4071
  const isFiltered = !!startDate && !!endDate;
4045
4072
  const toggleCalendar = () => setIsOpen((prev) => !prev);
@@ -4124,7 +4151,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
4124
4151
  "D\xE9cembre"
4125
4152
  ];
4126
4153
  const dayNames = ["Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"];
4127
- return /* @__PURE__ */ jsxs21("div", { className: "date-picker-container", ref, children: [
4154
+ return /* @__PURE__ */ jsxs22("div", { className: "date-picker-container", ref, children: [
4128
4155
  /* @__PURE__ */ jsx47(Button, { onClick: toggleCalendar, size, iconLeft: "calendar" }),
4129
4156
  isFiltered && /* @__PURE__ */ jsx47(
4130
4157
  "span",
@@ -4147,8 +4174,8 @@ var DatePicker = ({ onChange, size = "s" }) => {
4147
4174
  children: /* @__PURE__ */ jsx47(Icon, { name: "xmark", size: "s", color: colors.white })
4148
4175
  }
4149
4176
  ),
4150
- isOpen && /* @__PURE__ */ jsx47("div", { className: "date-picker-popup", children: /* @__PURE__ */ jsx47("div", { className: "date-picker-content", children: /* @__PURE__ */ jsxs21("div", { className: "calendar-container", children: [
4151
- /* @__PURE__ */ jsxs21("div", { className: "calendar-header", children: [
4177
+ isOpen && /* @__PURE__ */ jsx47("div", { className: "date-picker-popup", children: /* @__PURE__ */ jsx47("div", { className: "date-picker-content", children: /* @__PURE__ */ jsxs22("div", { className: "calendar-container", children: [
4178
+ /* @__PURE__ */ jsxs22("div", { className: "calendar-header", children: [
4152
4179
  /* @__PURE__ */ jsx47(
4153
4180
  "button",
4154
4181
  {
@@ -4175,7 +4202,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
4175
4202
  )
4176
4203
  }
4177
4204
  ),
4178
- /* @__PURE__ */ jsxs21("h3", { className: "calendar-month-title", children: [
4205
+ /* @__PURE__ */ jsxs22("h3", { className: "calendar-month-title", children: [
4179
4206
  monthNames[currentMonth.getMonth()],
4180
4207
  " ",
4181
4208
  currentMonth.getFullYear()
@@ -4230,7 +4257,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
4230
4257
  index
4231
4258
  );
4232
4259
  }) }),
4233
- startDate && /* @__PURE__ */ jsx47("div", { className: "selected-dates-display", children: /* @__PURE__ */ jsx47("div", { className: "selected-dates-text", children: endDate ? /* @__PURE__ */ jsxs21("span", { children: [
4260
+ startDate && /* @__PURE__ */ jsx47("div", { className: "selected-dates-display", children: /* @__PURE__ */ jsx47("div", { className: "selected-dates-text", children: endDate ? /* @__PURE__ */ jsxs22("span", { children: [
4234
4261
  /* @__PURE__ */ jsx47("strong", { children: "Du:" }),
4235
4262
  " ",
4236
4263
  formatDate(startDate, "weekday", "fr"),
@@ -4238,7 +4265,7 @@ var DatePicker = ({ onChange, size = "s" }) => {
4238
4265
  /* @__PURE__ */ jsx47("strong", { children: "Au:" }),
4239
4266
  " ",
4240
4267
  formatDate(endDate, "weekday", "fr")
4241
- ] }) : /* @__PURE__ */ jsxs21("span", { children: [
4268
+ ] }) : /* @__PURE__ */ jsxs22("span", { children: [
4242
4269
  /* @__PURE__ */ jsx47("strong", { children: "D\xE9but:" }),
4243
4270
  " ",
4244
4271
  formatDate(startDate, "weekday", "fr"),
@@ -4250,9 +4277,9 @@ var DatePicker = ({ onChange, size = "s" }) => {
4250
4277
  };
4251
4278
 
4252
4279
  // src/Components/IconTabs/IconTabs.tsx
4253
- import { useState as useState13, useEffect as useEffect12, useRef as useRef11 } from "react";
4280
+ import { useState as useState14, useEffect as useEffect12, useRef as useRef11 } from "react";
4254
4281
  import styled40, { css as css2 } from "styled-components";
4255
- import { jsx as jsx48, jsxs as jsxs22 } from "react/jsx-runtime";
4282
+ import { jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
4256
4283
  var TabsContainer = styled40.div`
4257
4284
  display: flex;
4258
4285
  flex-direction: column;
@@ -4312,7 +4339,7 @@ var IconTabs = ({
4312
4339
  defaultTabIndex = 0
4313
4340
  }) => {
4314
4341
  var _a;
4315
- const [selectedTab, setSelectedTab] = useState13(defaultTabIndex);
4342
+ const [selectedTab, setSelectedTab] = useState14(defaultTabIndex);
4316
4343
  const sliderRef = useRef11(null);
4317
4344
  const tabRefs = useRef11([]);
4318
4345
  useEffect12(() => {
@@ -4335,8 +4362,8 @@ var IconTabs = ({
4335
4362
  sliderRef.current.style.backgroundColor = colors[selectedColor];
4336
4363
  }
4337
4364
  }, [selectedTab, selectedColor]);
4338
- return /* @__PURE__ */ jsxs22(TabsContainer, { children: [
4339
- /* @__PURE__ */ jsxs22(IconsRow, { children: [
4365
+ return /* @__PURE__ */ jsxs23(TabsContainer, { children: [
4366
+ /* @__PURE__ */ jsxs23(IconsRow, { children: [
4340
4367
  items.map((item, index) => /* @__PURE__ */ jsx48(
4341
4368
  Tab2,
4342
4369
  {
@@ -4365,10 +4392,10 @@ var IconTabs = ({
4365
4392
  };
4366
4393
 
4367
4394
  // src/Components/Popover/Popover.tsx
4368
- import { useState as useState14, useRef as useRef12, useEffect as useEffect13, useCallback as useCallback4 } from "react";
4395
+ import { useState as useState15, useRef as useRef12, useEffect as useEffect13, useCallback as useCallback4 } from "react";
4369
4396
  import { createPortal } from "react-dom";
4370
4397
  import styled41 from "styled-components";
4371
- import { jsx as jsx49, jsxs as jsxs23 } from "react/jsx-runtime";
4398
+ import { jsx as jsx49, jsxs as jsxs24 } from "react/jsx-runtime";
4372
4399
  var PopoverWrapper = styled41.div`
4373
4400
  position: relative;
4374
4401
  display: inline-block;
@@ -4401,10 +4428,10 @@ var PopoverItem = styled41.div`
4401
4428
  }
4402
4429
  `;
4403
4430
  var Popover = ({ items = [], children }) => {
4404
- const [open, setOpen] = useState14(false);
4431
+ const [open, setOpen] = useState15(false);
4405
4432
  const ref = useRef12(null);
4406
4433
  const menuRef = useRef12(null);
4407
- const [menuPosition, setMenuPosition] = useState14({ top: 0, left: 0 });
4434
+ const [menuPosition, setMenuPosition] = useState15({ top: 0, left: 0 });
4408
4435
  const updatePosition = useCallback4(() => {
4409
4436
  var _a;
4410
4437
  if (!ref.current) {
@@ -4446,7 +4473,7 @@ var Popover = ({ items = [], children }) => {
4446
4473
  document.removeEventListener("mousedown", handleClickOutside);
4447
4474
  };
4448
4475
  }, [open, updatePosition]);
4449
- return /* @__PURE__ */ jsxs23(PopoverWrapper, { ref, children: [
4476
+ return /* @__PURE__ */ jsxs24(PopoverWrapper, { ref, children: [
4450
4477
  /* @__PURE__ */ jsx49(PopoverTrigger, { onClick: () => setOpen((o) => !o), children }),
4451
4478
  open && createPortal(
4452
4479
  /* @__PURE__ */ jsx49(
@@ -4479,7 +4506,7 @@ var Popover = ({ items = [], children }) => {
4479
4506
  };
4480
4507
 
4481
4508
  // src/Components/MetricCard/MetricCard.tsx
4482
- import { jsx as jsx50, jsxs as jsxs24 } from "react/jsx-runtime";
4509
+ import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
4483
4510
  var MetricCard = ({
4484
4511
  icon,
4485
4512
  title,
@@ -4502,7 +4529,7 @@ var MetricCard = ({
4502
4529
  cursor: onClick ? "pointer" : "default"
4503
4530
  },
4504
4531
  onClick,
4505
- children: /* @__PURE__ */ jsxs24(Row, { alignItems: "center", gap: "12", fullWidth: true, children: [
4532
+ children: /* @__PURE__ */ jsxs25(Row, { alignItems: "center", gap: "12", fullWidth: true, children: [
4506
4533
  /* @__PURE__ */ jsx50(
4507
4534
  Box,
4508
4535
  {
@@ -4517,10 +4544,10 @@ var MetricCard = ({
4517
4544
  children: /* @__PURE__ */ jsx50(Icon, { name: icon, size: "m", color: iconColor, family: "regular" })
4518
4545
  }
4519
4546
  ),
4520
- contentLayout === "row" ? /* @__PURE__ */ jsxs24(Row, { gap: "6", alignItems: "center", children: [
4547
+ contentLayout === "row" ? /* @__PURE__ */ jsxs25(Row, { gap: "6", alignItems: "center", children: [
4521
4548
  /* @__PURE__ */ jsx50(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value }),
4522
4549
  /* @__PURE__ */ jsx50(Text, { size: "s", variant: "grey_600", children: title })
4523
- ] }) : /* @__PURE__ */ jsxs24(Col, { gap: "4", children: [
4550
+ ] }) : /* @__PURE__ */ jsxs25(Col, { gap: "4", children: [
4524
4551
  /* @__PURE__ */ jsx50(Text, { size: "s", variant: "grey_600", children: title }),
4525
4552
  /* @__PURE__ */ jsx50(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value })
4526
4553
  ] })
@@ -4530,9 +4557,9 @@ var MetricCard = ({
4530
4557
  };
4531
4558
 
4532
4559
  // src/Components/Tooltip/Tooltip.tsx
4533
- import { useState as useState15 } from "react";
4560
+ import { useState as useState16 } from "react";
4534
4561
  import styled42 from "styled-components";
4535
- import { jsx as jsx51, jsxs as jsxs25 } from "react/jsx-runtime";
4562
+ import { jsx as jsx51, jsxs as jsxs26 } from "react/jsx-runtime";
4536
4563
  var StyledTooltipWrapper = styled42.div`
4537
4564
  position: relative;
4538
4565
  display: inline-block;
@@ -4634,10 +4661,10 @@ var Tooltip = ({
4634
4661
  direction = "top",
4635
4662
  children
4636
4663
  }) => {
4637
- const [isVisible, setIsVisible] = useState15(false);
4664
+ const [isVisible, setIsVisible] = useState16(false);
4638
4665
  const handleMouseEnter = () => setIsVisible(true);
4639
4666
  const handleMouseLeave = () => setIsVisible(false);
4640
- return /* @__PURE__ */ jsxs25(
4667
+ return /* @__PURE__ */ jsxs26(
4641
4668
  StyledTooltipWrapper,
4642
4669
  {
4643
4670
  onMouseEnter: handleMouseEnter,
@@ -4662,7 +4689,7 @@ var Tooltip = ({
4662
4689
 
4663
4690
  // src/Components/Pagination/Pagination.tsx
4664
4691
  import { useMemo as useMemo2 } from "react";
4665
- import { jsx as jsx52, jsxs as jsxs26 } from "react/jsx-runtime";
4692
+ import { jsx as jsx52, jsxs as jsxs27 } from "react/jsx-runtime";
4666
4693
  var getPageNumbers = (current, total) => {
4667
4694
  if (total <= 5) {
4668
4695
  return Array.from({ length: total }, (_, i) => i + 1);
@@ -4692,14 +4719,14 @@ var Pagination = ({
4692
4719
  const startItem = (currentPage - 1) * itemsPerPage + 1;
4693
4720
  const endItem = Math.min(currentPage * itemsPerPage, totalItems);
4694
4721
  const summary = summaryLabel || defaultSummary(startItem, endItem, totalItems);
4695
- return /* @__PURE__ */ jsxs26(
4722
+ return /* @__PURE__ */ jsxs27(
4696
4723
  Row,
4697
4724
  {
4698
4725
  justifyContent: showSummary ? "space-between" : "flex-end",
4699
4726
  alignItems: "center",
4700
4727
  children: [
4701
4728
  showSummary && /* @__PURE__ */ jsx52(Text, { size: "s", color: colors.grey_500, children: summary }),
4702
- /* @__PURE__ */ jsxs26(Row, { gap: "4", alignItems: "center", style: { width: "fit-content" }, children: [
4729
+ /* @__PURE__ */ jsxs27(Row, { gap: "4", alignItems: "center", style: { width: "fit-content" }, children: [
4703
4730
  /* @__PURE__ */ jsx52(
4704
4731
  Button,
4705
4732
  {
@@ -4739,9 +4766,9 @@ var Pagination = ({
4739
4766
  };
4740
4767
 
4741
4768
  // src/Components/FileUploadZone/FileUploadZone.tsx
4742
- import { useState as useState16, useRef as useRef13, useCallback as useCallback5 } from "react";
4769
+ import { useState as useState17, useRef as useRef13, useCallback as useCallback5 } from "react";
4743
4770
  import styled43 from "styled-components";
4744
- import { jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
4771
+ import { jsx as jsx53, jsxs as jsxs28 } from "react/jsx-runtime";
4745
4772
  var ACCEPT_MAP = {
4746
4773
  png: "image/png",
4747
4774
  jpg: "image/jpeg",
@@ -4826,13 +4853,13 @@ var FileUploadZone = ({
4826
4853
  icon = "cloud-arrow-up",
4827
4854
  showFileName = false
4828
4855
  }) => {
4829
- const [isDragging, setIsDragging] = useState16(false);
4830
- const [internalPreviewUrl, setInternalPreviewUrl] = useState16(
4856
+ const [isDragging, setIsDragging] = useState17(false);
4857
+ const [internalPreviewUrl, setInternalPreviewUrl] = useState17(
4831
4858
  null
4832
4859
  );
4833
- const [fileType, setFileType] = useState16(null);
4834
- const [fileName, setFileName] = useState16(null);
4835
- const [inlineError, setInlineError] = useState16(null);
4860
+ const [fileType, setFileType] = useState17(null);
4861
+ const [fileName, setFileName] = useState17(null);
4862
+ const [inlineError, setInlineError] = useState17(null);
4836
4863
  const inputRef = useRef13(null);
4837
4864
  const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
4838
4865
  const mimeTypes = getMimeTypes(resolvedAccept);
@@ -4939,7 +4966,7 @@ var FileUploadZone = ({
4939
4966
  onRemove == null ? void 0 : onRemove();
4940
4967
  };
4941
4968
  if (previewUrl) {
4942
- return /* @__PURE__ */ jsxs27(StyledPreview, { $fullWidth: fullWidth, children: [
4969
+ return /* @__PURE__ */ jsxs28(StyledPreview, { $fullWidth: fullWidth, children: [
4943
4970
  fileType && isPdf(fileType) ? /* @__PURE__ */ jsx53(StyledEmbed, { src: previewUrl, type: "application/pdf" }) : /* @__PURE__ */ jsx53(StyledImage2, { src: previewUrl, alt: "Aper\xE7u du fichier" }),
4944
4971
  /* @__PURE__ */ jsx53(Row, { gap: "8", justifyContent: "center", children: /* @__PURE__ */ jsx53(
4945
4972
  Button,
@@ -4955,8 +4982,8 @@ var FileUploadZone = ({
4955
4982
  }
4956
4983
  const showIcon = icon !== false;
4957
4984
  const showBrowse = !compact && browseLabel !== false;
4958
- return /* @__PURE__ */ jsxs27(Col, { gap: "4", children: [
4959
- /* @__PURE__ */ jsxs27(
4985
+ return /* @__PURE__ */ jsxs28(Col, { gap: "4", children: [
4986
+ /* @__PURE__ */ jsxs28(
4960
4987
  StyledDropZone,
4961
4988
  {
4962
4989
  $isDragging: isDragging,
@@ -5006,7 +5033,7 @@ var FileUploadZone = ({
5006
5033
  ]
5007
5034
  }
5008
5035
  ),
5009
- showFileName && fileName && /* @__PURE__ */ jsxs27(Row, { gap: "8", alignItems: "center", justifyContent: "center", children: [
5036
+ showFileName && fileName && /* @__PURE__ */ jsxs28(Row, { gap: "8", alignItems: "center", justifyContent: "center", children: [
5010
5037
  /* @__PURE__ */ jsx53(Icon, { name: "file", size: "s", color: "green_700" }),
5011
5038
  /* @__PURE__ */ jsx53(Text, { size: "s", color: "green_700", children: fileName })
5012
5039
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.235",
3
+ "version": "1.0.237",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10,6 +10,7 @@
10
10
  "prepublishOnly": "npm run build",
11
11
  "prepare": "husky",
12
12
  "test": "vitest run --project unit",
13
+ "typecheck": "tsc --noEmit",
13
14
  "storybook": "storybook dev -p 6006",
14
15
  "build-storybook": "storybook build",
15
16
  "lint": "eslint . --ext js,jsx,ts,tsx --report-unused-disable-directives --max-warnings 0",