@ceed/ads 1.8.6 → 1.9.0

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.
Files changed (126) hide show
  1. package/dist/components/Accordions/Accordions.d.ts +1 -1
  2. package/dist/components/Accordions/index.d.ts +2 -2
  3. package/dist/components/Alert/Alert.d.ts +3 -3
  4. package/dist/components/Autocomplete/Autocomplete.d.ts +3 -3
  5. package/dist/components/Autocomplete/index.d.ts +2 -2
  6. package/dist/components/Avatar/Avatar.d.ts +2 -2
  7. package/dist/components/Box/Box.d.ts +1 -1
  8. package/dist/components/Box/index.d.ts +2 -2
  9. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +5 -5
  10. package/dist/components/Breadcrumbs/index.d.ts +2 -2
  11. package/dist/components/Button/Button.d.ts +3 -3
  12. package/dist/components/Button/index.d.ts +2 -2
  13. package/dist/components/Calendar/Calendar.d.ts +2 -2
  14. package/dist/components/Calendar/hooks/use-calendar-props.d.ts +2 -2
  15. package/dist/components/Calendar/hooks/use-calendar.d.ts +11 -11
  16. package/dist/components/Calendar/index.d.ts +2 -2
  17. package/dist/components/Calendar/types.d.ts +2 -2
  18. package/dist/components/Card/Card.d.ts +1 -1
  19. package/dist/components/Card/index.d.ts +2 -2
  20. package/dist/components/Checkbox/Checkbox.d.ts +3 -3
  21. package/dist/components/Checkbox/index.d.ts +2 -2
  22. package/dist/components/Container/Container.d.ts +1 -1
  23. package/dist/components/Container/index.d.ts +2 -2
  24. package/dist/components/CurrencyInput/CurrencyInput.d.ts +4 -4
  25. package/dist/components/DataTable/DataTable.d.ts +3 -3
  26. package/dist/components/DataTable/index.d.ts +3 -3
  27. package/dist/components/DataTable/types.d.ts +45 -20
  28. package/dist/components/DatePicker/DatePicker.d.ts +3 -3
  29. package/dist/components/DatePicker/index.d.ts +2 -2
  30. package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -3
  31. package/dist/components/DateRangePicker/index.d.ts +2 -2
  32. package/dist/components/DialogActions/DialogActions.d.ts +1 -1
  33. package/dist/components/DialogActions/index.d.ts +2 -2
  34. package/dist/components/DialogContent/DialogContent.d.ts +1 -1
  35. package/dist/components/DialogContent/index.d.ts +2 -2
  36. package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
  37. package/dist/components/DialogFrame/index.d.ts +2 -2
  38. package/dist/components/DialogTitle/DialogTitle.d.ts +1 -1
  39. package/dist/components/DialogTitle/index.d.ts +2 -2
  40. package/dist/components/Divider/Divider.d.ts +3 -3
  41. package/dist/components/Divider/index.d.ts +2 -2
  42. package/dist/components/Dropdown/Dropdown.d.ts +1 -1
  43. package/dist/components/Dropdown/index.d.ts +2 -2
  44. package/dist/components/FilterMenu/FilterMenu.d.ts +2 -2
  45. package/dist/components/FilterMenu/components/Autocomplete.d.ts +2 -2
  46. package/dist/components/FilterMenu/components/CheckboxGroup.d.ts +2 -2
  47. package/dist/components/FilterMenu/components/CurrencyInput.d.ts +2 -2
  48. package/dist/components/FilterMenu/components/CurrencyRange.d.ts +2 -2
  49. package/dist/components/FilterMenu/components/DateRange.d.ts +2 -2
  50. package/dist/components/FilterMenu/components/PercentageInput.d.ts +2 -2
  51. package/dist/components/FilterMenu/components/PercentageRange.d.ts +2 -2
  52. package/dist/components/FilterMenu/components/RadioGroup.d.ts +2 -2
  53. package/dist/components/FilterMenu/index.d.ts +2 -2
  54. package/dist/components/FilterMenu/types.d.ts +18 -18
  55. package/dist/components/FormControl/FormControl.d.ts +1 -1
  56. package/dist/components/FormControl/index.d.ts +2 -2
  57. package/dist/components/FormHelperText/FormHelperText.d.ts +1 -1
  58. package/dist/components/FormHelperText/index.d.ts +2 -2
  59. package/dist/components/FormLabel/FormLabel.d.ts +1 -1
  60. package/dist/components/FormLabel/index.d.ts +2 -2
  61. package/dist/components/Grid/Grid.d.ts +1 -1
  62. package/dist/components/Grid/index.d.ts +2 -2
  63. package/dist/components/IconButton/IconButton.d.ts +4 -4
  64. package/dist/components/IconButton/index.d.ts +2 -2
  65. package/dist/components/IconMenuButton/IconMenuButton.d.ts +6 -6
  66. package/dist/components/IconMenuButton/index.d.ts +2 -2
  67. package/dist/components/InfoSign/InfoSign.d.ts +4 -4
  68. package/dist/components/InfoSign/index.d.ts +2 -2
  69. package/dist/components/Input/Input.d.ts +2 -2
  70. package/dist/components/Input/index.d.ts +2 -2
  71. package/dist/components/InsetDrawer/index.d.ts +2 -2
  72. package/dist/components/Markdown/Markdown.d.ts +6 -6
  73. package/dist/components/Markdown/index.d.ts +2 -2
  74. package/dist/components/Menu/Menu.d.ts +3 -3
  75. package/dist/components/Menu/index.d.ts +2 -2
  76. package/dist/components/MenuButton/MenuButton.d.ts +8 -8
  77. package/dist/components/MenuButton/index.d.ts +2 -2
  78. package/dist/components/Modal/Modal.d.ts +1 -1
  79. package/dist/components/Modal/index.d.ts +2 -2
  80. package/dist/components/MonthPicker/MonthPicker.d.ts +3 -3
  81. package/dist/components/MonthPicker/index.d.ts +2 -2
  82. package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +3 -3
  83. package/dist/components/MonthRangePicker/index.d.ts +2 -2
  84. package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -3
  85. package/dist/components/NavigationGroup/index.d.ts +2 -2
  86. package/dist/components/NavigationItem/NavigationItem.d.ts +3 -3
  87. package/dist/components/NavigationItem/index.d.ts +2 -2
  88. package/dist/components/Navigator/Navigator.d.ts +3 -3
  89. package/dist/components/Pagination/Pagination.d.ts +2 -2
  90. package/dist/components/Pagination/index.d.ts +2 -2
  91. package/dist/components/PercentageInput/PercentageInput.d.ts +4 -4
  92. package/dist/components/ProfileMenu/ProfileMenu.d.ts +5 -5
  93. package/dist/components/ProfileMenu/index.d.ts +2 -2
  94. package/dist/components/Radio/Radio.d.ts +1 -1
  95. package/dist/components/Radio/index.d.ts +2 -2
  96. package/dist/components/RadioList/RadioList.d.ts +2 -2
  97. package/dist/components/RadioList/index.d.ts +2 -2
  98. package/dist/components/Select/Select.d.ts +5 -5
  99. package/dist/components/Select/index.d.ts +2 -2
  100. package/dist/components/Sheet/Sheet.d.ts +1 -1
  101. package/dist/components/Sheet/index.d.ts +2 -2
  102. package/dist/components/Stack/Stack.d.ts +1 -1
  103. package/dist/components/Stack/index.d.ts +2 -2
  104. package/dist/components/Stepper/Stepper.d.ts +2 -2
  105. package/dist/components/Switch/Switch.d.ts +3 -3
  106. package/dist/components/Switch/index.d.ts +2 -2
  107. package/dist/components/Table/Table.d.ts +2 -2
  108. package/dist/components/Table/index.d.ts +2 -2
  109. package/dist/components/Tabs/Tabs.d.ts +1 -1
  110. package/dist/components/Tabs/index.d.ts +2 -2
  111. package/dist/components/Textarea/Textarea.d.ts +3 -3
  112. package/dist/components/Textarea/index.d.ts +2 -2
  113. package/dist/components/ThemeProvider/ThemeProvider.d.ts +18 -18
  114. package/dist/components/ThemeProvider/index.d.ts +2 -2
  115. package/dist/components/Tooltip/Tooltip.d.ts +3 -3
  116. package/dist/components/Tooltip/index.d.ts +2 -2
  117. package/dist/components/Typography/Typography.d.ts +3 -3
  118. package/dist/components/Typography/index.d.ts +2 -2
  119. package/dist/components/Uploader/Uploader.d.ts +1 -1
  120. package/dist/components/index.d.ts +60 -60
  121. package/dist/index.cjs +1421 -2083
  122. package/dist/index.d.ts +4 -4
  123. package/dist/index.js +1445 -2187
  124. package/dist/libs/rehype-accent/index.d.ts +2 -2
  125. package/framer/index.js +40 -40
  126. package/package.json +6 -1
package/dist/index.js CHANGED
@@ -222,16 +222,7 @@ var MotionAlert = styled(motion3(JoyAlert))({
222
222
  function Alert(props) {
223
223
  const { title, content, actions, color = "primary", ...innerProps } = props;
224
224
  const invertedColors = props.invertedColors || props.variant === "solid";
225
- return /* @__PURE__ */ React3.createElement(
226
- MotionAlert,
227
- {
228
- ...innerProps,
229
- color,
230
- endDecorator: actions,
231
- invertedColors
232
- },
233
- /* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ React3.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content))
234
- );
225
+ return /* @__PURE__ */ React3.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors }, /* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ React3.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content)));
235
226
  }
236
227
  Alert.displayName = "Alert";
237
228
 
@@ -294,9 +285,7 @@ var Chip_default = Chip;
294
285
 
295
286
  // src/components/IconButton/IconButton.tsx
296
287
  import React4, { forwardRef } from "react";
297
- import {
298
- IconButton as JoyIconButton
299
- } from "@mui/joy";
288
+ import { IconButton as JoyIconButton } from "@mui/joy";
300
289
  import { motion as motion8 } from "framer-motion";
301
290
  var MotionIconButton = motion8(JoyIconButton);
302
291
  var IconButton = forwardRef(
@@ -313,9 +302,7 @@ var IconButton_default = IconButton;
313
302
  import { useState, useCallback, useEffect, useRef } from "react";
314
303
  function useControlledState(controlledValue, defaultValue, onChange) {
315
304
  const { current: isControlled } = useRef(controlledValue !== void 0);
316
- const [internalValue, setInternalValue] = useState(
317
- controlledValue ?? defaultValue
318
- );
305
+ const [internalValue, setInternalValue] = useState(controlledValue ?? defaultValue);
319
306
  const displayValue = isControlled ? controlledValue : internalValue;
320
307
  useEffect(() => {
321
308
  if (isControlled) {
@@ -381,51 +368,42 @@ var AutocompleteListBox = React5.forwardRef((props, ref) => {
381
368
  virtualizer.measure();
382
369
  }
383
370
  }, [open, virtualizer]);
384
- return /* @__PURE__ */ React5.createElement(
385
- AutocompletePopper,
371
+ return /* @__PURE__ */ React5.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ React5.createElement(JoyAutocompleteListbox, { ...innerProps }, /* @__PURE__ */ React5.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ React5.createElement(
372
+ "div",
386
373
  {
387
- ref,
388
- anchorEl,
389
- open,
390
- modifiers
374
+ style: {
375
+ height: `${virtualizer.getTotalSize()}px`,
376
+ position: "relative"
377
+ }
391
378
  },
392
- /* @__PURE__ */ React5.createElement(JoyAutocompleteListbox, { ...innerProps }, /* @__PURE__ */ React5.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ React5.createElement(
393
- "div",
394
- {
379
+ items.map(
380
+ ({ index, size, start, key }) => React5.cloneElement(renderTargets[index], {
381
+ key,
395
382
  style: {
396
- height: `${virtualizer.getTotalSize()}px`,
397
- position: "relative"
398
- }
399
- },
400
- items.map(
401
- ({ index, size, start, key }) => React5.cloneElement(renderTargets[index], {
402
- key,
403
- style: {
404
- position: "absolute",
405
- top: 0,
406
- left: 0,
407
- width: "100%",
408
- fontSize: `var(--ceed-fontSize-${fontSize})`,
409
- height: `${size}px`,
410
- transform: `translateY(${start}px)`,
411
- overflow: "visible"
383
+ position: "absolute",
384
+ top: 0,
385
+ left: 0,
386
+ width: "100%",
387
+ fontSize: `var(--ceed-fontSize-${fontSize})`,
388
+ height: `${size}px`,
389
+ transform: `translateY(${start}px)`,
390
+ overflow: "visible"
391
+ },
392
+ children: /* @__PURE__ */ React5.createElement(
393
+ "div",
394
+ {
395
+ style: {
396
+ textOverflow: "ellipsis",
397
+ textWrap: "nowrap",
398
+ overflow: "hidden",
399
+ width: "100%"
400
+ }
412
401
  },
413
- children: /* @__PURE__ */ React5.createElement(
414
- "div",
415
- {
416
- style: {
417
- textOverflow: "ellipsis",
418
- textWrap: "nowrap",
419
- overflow: "hidden",
420
- width: "100%"
421
- }
422
- },
423
- renderTargets[index].props.children
424
- )
425
- })
426
- )
427
- )))
428
- );
402
+ renderTargets[index].props.children
403
+ )
404
+ })
405
+ )
406
+ ))));
429
407
  });
430
408
  var AutocompleteDeleteSize = {
431
409
  sm: "20px",
@@ -495,15 +473,7 @@ function Autocomplete(props) {
495
473
  return {
496
474
  value: "",
497
475
  label: "",
498
- startDecorator: /* @__PURE__ */ React5.createElement(
499
- CircularProgress,
500
- {
501
- size: "sm",
502
- color: "neutral",
503
- variant: "plain",
504
- thickness: 3
505
- }
506
- )
476
+ startDecorator: /* @__PURE__ */ React5.createElement(CircularProgress, { size: "sm", color: "neutral", variant: "plain", thickness: 3 })
507
477
  };
508
478
  }
509
479
  if (Array.isArray(_value)) {
@@ -518,15 +488,11 @@ function Autocomplete(props) {
518
488
  [size, props.loading]
519
489
  );
520
490
  const startDecorator = useMemo(
521
- () => applySize(
522
- value?.startDecorator || props.startDecorator
523
- ),
491
+ () => applySize(value?.startDecorator || props.startDecorator),
524
492
  [value, applySize, props.startDecorator]
525
493
  );
526
494
  const endDecorator = useMemo(
527
- () => applySize(
528
- value?.endDecorator || props.endDecorator
529
- ),
495
+ () => applySize(value?.endDecorator || props.endDecorator),
530
496
  [value, applySize, props.endDecorator]
531
497
  );
532
498
  const handleChange = useCallback2(
@@ -564,16 +530,7 @@ function Autocomplete(props) {
564
530
  const { onClick, ...rest } = getTagProps({ index });
565
531
  return applySize(
566
532
  /* @__PURE__ */ React5.createElement(Chip_default, { color: "primary", ...rest }, /* @__PURE__ */ React5.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2, py: 0.5 }, tag.value, applySize(
567
- /* @__PURE__ */ React5.createElement(
568
- AutocompleteTagDelete,
569
- {
570
- color: "primary",
571
- variant: "soft",
572
- onClick,
573
- size
574
- },
575
- /* @__PURE__ */ React5.createElement(CloseIcon, null)
576
- )
533
+ /* @__PURE__ */ React5.createElement(AutocompleteTagDelete, { color: "primary", variant: "soft", onClick, size }, /* @__PURE__ */ React5.createElement(CloseIcon, null))
577
534
  )))
578
535
  );
579
536
  }),
@@ -623,12 +580,7 @@ var Autocomplete_default = Autocomplete;
623
580
 
624
581
  // src/components/Avatar/Avatar.tsx
625
582
  import React6, { forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
626
- import {
627
- Avatar as JoyAvatar,
628
- AvatarGroup,
629
- styled as styled4,
630
- useThemeProps
631
- } from "@mui/joy";
583
+ import { Avatar as JoyAvatar, AvatarGroup, styled as styled4, useThemeProps } from "@mui/joy";
632
584
  var StyledAvatar = styled4(JoyAvatar, {
633
585
  name: "Avatar",
634
586
  slot: "Root",
@@ -684,10 +636,7 @@ import {
684
636
 
685
637
  // src/components/Menu/Menu.tsx
686
638
  import React7 from "react";
687
- import {
688
- Menu as JoyMenu,
689
- MenuItem as JoyMenuItem
690
- } from "@mui/joy";
639
+ import { Menu as JoyMenu, MenuItem as JoyMenuItem } from "@mui/joy";
691
640
  import { motion as motion10 } from "framer-motion";
692
641
  var MotionMenu = motion10(JoyMenu);
693
642
  var Menu = (props) => {
@@ -731,33 +680,13 @@ function Breadcrumbs(props) {
731
680
  }
732
681
  };
733
682
  if (!collapsed) {
734
- return /* @__PURE__ */ React8.createElement(
735
- JoyBreadcrumbs,
736
- {
737
- size,
738
- slots: restSlots,
739
- slotProps: restSlotProps,
740
- ...innerProps
741
- },
742
- crumbs.map((crumb, index) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb }))
743
- );
683
+ return /* @__PURE__ */ React8.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
744
684
  }
745
685
  const _endCrumbCount = Math.max(1, endCrumbCount);
746
686
  const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
747
687
  const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
748
688
  const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ React8.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ React8.createElement(Crumb, { ...crumb })));
749
- return /* @__PURE__ */ React8.createElement(
750
- JoyBreadcrumbs,
751
- {
752
- size,
753
- slots: restSlots,
754
- slotProps: restSlotProps,
755
- ...innerProps
756
- },
757
- frontCrumbs,
758
- collapsedCrumbs.length && /* @__PURE__ */ React8.createElement(Dropdown_default, null, /* @__PURE__ */ React8.createElement(JoyMenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ React8.createElement(Menu_default, { size }, collapsedCrumbs)),
759
- backCrumbs
760
- );
689
+ return /* @__PURE__ */ React8.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, frontCrumbs, collapsedCrumbs.length && /* @__PURE__ */ React8.createElement(Dropdown_default, null, /* @__PURE__ */ React8.createElement(JoyMenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ React8.createElement(Menu_default, { size }, collapsedCrumbs)), backCrumbs);
761
690
  }
762
691
  Breadcrumbs.displayName = "Breadcrumbs";
763
692
 
@@ -767,13 +696,7 @@ import { Button as JoyButton } from "@mui/joy";
767
696
  import { motion as motion11 } from "framer-motion";
768
697
  var MotionButton = motion11(JoyButton);
769
698
  var Button = forwardRef3(({ ...props }, ref) => {
770
- return /* @__PURE__ */ React9.createElement(
771
- MotionButton,
772
- {
773
- ref,
774
- ...props
775
- }
776
- );
699
+ return /* @__PURE__ */ React9.createElement(MotionButton, { ref, ...props });
777
700
  });
778
701
  Button.displayName = "Button";
779
702
 
@@ -793,9 +716,7 @@ var getCalendarDates = (date) => {
793
716
  const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
794
717
  const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
795
718
  const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
796
- const lastWeekInThisMonth = Math.ceil(
797
- (lastDay.getDate() + firstDay.getDay()) / 7
798
- );
719
+ const lastWeekInThisMonth = Math.ceil((lastDay.getDate() + firstDay.getDay()) / 7);
799
720
  let day = 1;
800
721
  for (let i = 1; i <= lastWeekInThisMonth; i++) {
801
722
  const week = [];
@@ -870,7 +791,9 @@ var useCalendarProps = (inProps) => {
870
791
  const [uncontrolledView, setUncontrolledView] = useState2(
871
792
  () => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
872
793
  );
873
- const [uncontrolledValue, setUncontrolledValue] = useState2(inProps.defaultValue);
794
+ const [uncontrolledValue, setUncontrolledValue] = useState2(
795
+ inProps.defaultValue
796
+ );
874
797
  const [viewMonth, setViewMonth] = useState2(() => {
875
798
  const today = /* @__PURE__ */ new Date();
876
799
  today.setDate(1);
@@ -943,10 +866,7 @@ var useCalendarProps = (inProps) => {
943
866
  },
944
867
  name: "Calendar"
945
868
  });
946
- const ownerState = useMemo3(
947
- () => ({ ...props, viewMonth, direction }),
948
- [props, viewMonth, direction]
949
- );
869
+ const ownerState = useMemo3(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
950
870
  return [props, ownerState];
951
871
  };
952
872
 
@@ -964,11 +884,7 @@ var useCalendar = (ownerState) => {
964
884
  const currentMonth = currentDate.getMonth();
965
885
  const currentDay = currentDate.getDate();
966
886
  const prevMonth = new Date(currentYear, currentMonth - 1, 1);
967
- const lastDayOfPrevMonth = new Date(
968
- currentYear,
969
- currentMonth,
970
- 0
971
- ).getDate();
887
+ const lastDayOfPrevMonth = new Date(currentYear, currentMonth, 0).getDate();
972
888
  const prevMonthDay = Math.min(currentDay, lastDayOfPrevMonth);
973
889
  prevMonth.setDate(prevMonthDay);
974
890
  ownerState.onMonthChange?.(prevMonth);
@@ -985,11 +901,7 @@ var useCalendar = (ownerState) => {
985
901
  const currentMonth = currentDate.getMonth();
986
902
  const currentDay = currentDate.getDate();
987
903
  const nextMonth = new Date(currentYear, currentMonth + 1, 1);
988
- const lastDayOfNextMonth = new Date(
989
- currentYear,
990
- currentMonth + 2,
991
- 0
992
- ).getDate();
904
+ const lastDayOfNextMonth = new Date(currentYear, currentMonth + 2, 0).getDate();
993
905
  const nextMonthDay = Math.min(currentDay, lastDayOfNextMonth);
994
906
  nextMonth.setDate(nextMonthDay);
995
907
  ownerState.onMonthChange?.(nextMonth);
@@ -1006,22 +918,13 @@ var useCalendar = (ownerState) => {
1006
918
  thisDay.setDate(day);
1007
919
  const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
1008
920
  (hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
1009
- ownerState.value[1] && isWithinRange(
1010
- ownerState.value[0],
1011
- ownerState.value[1],
1012
- thisDay
1013
- ));
921
+ ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
1014
922
  return {
1015
923
  "aria-label": thisDay.toLocaleDateString(),
1016
924
  "aria-current": inRange ? "date" : void 0
1017
925
  };
1018
926
  },
1019
- [
1020
- ownerState.rangeSelection,
1021
- ownerState.value,
1022
- ownerState.viewMonth,
1023
- hoverDay
1024
- ]
927
+ [ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
1025
928
  ),
1026
929
  getMonthCellProps: useCallback4(
1027
930
  (monthIndex) => {
@@ -1032,22 +935,13 @@ var useCalendar = (ownerState) => {
1032
935
  const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
1033
936
  const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
1034
937
  (hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
1035
- ownerState.value[1] && isWithinRange(
1036
- ownerState.value[0],
1037
- ownerState.value[1],
1038
- thisMonth
1039
- ));
938
+ ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
1040
939
  return {
1041
940
  "aria-label": thisMonth.toLocaleDateString(),
1042
941
  "aria-current": inRange ? "date" : void 0
1043
942
  };
1044
943
  },
1045
- [
1046
- ownerState.rangeSelection,
1047
- ownerState.value,
1048
- ownerState.viewMonth,
1049
- hoverMonth
1050
- ]
944
+ [ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
1051
945
  ),
1052
946
  getPickerDayProps: useCallback4(
1053
947
  (day) => {
@@ -1057,23 +951,15 @@ var useCalendar = (ownerState) => {
1057
951
  const isSelected = !!ownerState.value && (isSameDay(thisDay, ownerState.value[0]) || ownerState.value[1] && isSameDay(thisDay, ownerState.value[1]));
1058
952
  const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
1059
953
  (hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
1060
- ownerState.value[1] && isWithinRange(
1061
- ownerState.value[0],
1062
- ownerState.value[1],
1063
- thisDay
1064
- ));
954
+ ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
1065
955
  const handleDayClick = () => {
1066
956
  if (ownerState.rangeSelection) {
1067
957
  if (!ownerState.value) {
1068
958
  ownerState.onChange?.([thisDay, void 0]);
1069
959
  } else if (ownerState.value[0] && !ownerState.value[1]) {
1070
960
  ownerState.onChange?.([
1071
- new Date(
1072
- Math.min(ownerState.value[0].getTime(), thisDay.getTime())
1073
- ),
1074
- new Date(
1075
- Math.max(ownerState.value[0].getTime(), thisDay.getTime())
1076
- )
961
+ new Date(Math.min(ownerState.value[0].getTime(), thisDay.getTime())),
962
+ new Date(Math.max(ownerState.value[0].getTime(), thisDay.getTime()))
1077
963
  ]);
1078
964
  } else {
1079
965
  ownerState.onChange?.([thisDay, void 0]);
@@ -1122,23 +1008,15 @@ var useCalendar = (ownerState) => {
1122
1008
  const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
1123
1009
  const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
1124
1010
  (hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
1125
- ownerState.value[1] && isWithinRange(
1126
- ownerState.value[0],
1127
- ownerState.value[1],
1128
- thisMonth
1129
- ));
1011
+ ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
1130
1012
  const handleMonthClick = () => {
1131
1013
  if (isMonthRangeSelection) {
1132
1014
  if (!ownerState.value) {
1133
1015
  ownerState.onChange?.([thisMonth, void 0]);
1134
1016
  } else if (ownerState.value[0] && !ownerState.value[1]) {
1135
1017
  ownerState.onChange?.([
1136
- new Date(
1137
- Math.min(ownerState.value[0].getTime(), thisMonth.getTime())
1138
- ),
1139
- new Date(
1140
- Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
1141
- )
1018
+ new Date(Math.min(ownerState.value[0].getTime(), thisMonth.getTime())),
1019
+ new Date(Math.max(ownerState.value[0].getTime(), thisMonth.getTime()))
1142
1020
  ]);
1143
1021
  } else {
1144
1022
  ownerState.onChange?.([thisMonth, void 0]);
@@ -1208,15 +1086,13 @@ var CalendarViewContainer = styled5("div", {
1208
1086
  name: "Calendar",
1209
1087
  slot: "viewContainer",
1210
1088
  shouldForwardProp: (prop) => prop !== "calendarType"
1211
- })(
1212
- ({ theme, calendarType }) => ({
1213
- paddingLeft: theme.spacing(2),
1214
- paddingRight: theme.spacing(2),
1215
- position: "relative",
1216
- overflow: "hidden",
1217
- minHeight: calendarType === "datePicker" ? "250px" : "unset"
1218
- })
1219
- );
1089
+ })(({ theme, calendarType }) => ({
1090
+ paddingLeft: theme.spacing(2),
1091
+ paddingRight: theme.spacing(2),
1092
+ position: "relative",
1093
+ overflow: "hidden",
1094
+ minHeight: calendarType === "datePicker" ? "250px" : "unset"
1095
+ }));
1220
1096
  var CalendarViewTable = styled5(motion12.table, {
1221
1097
  name: "Calendar",
1222
1098
  slot: "viewTable"
@@ -1395,14 +1271,8 @@ var swipePower = (offset, velocity) => {
1395
1271
  var PickerDays = (props) => {
1396
1272
  const { ownerState } = props;
1397
1273
  const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
1398
- const calendarDates = useMemo4(
1399
- () => getCalendarDates(ownerState.viewMonth),
1400
- [ownerState.viewMonth]
1401
- );
1402
- const weekdayNames = useMemo4(
1403
- () => getWeekdayNames(ownerState.locale || "default"),
1404
- [ownerState.locale]
1405
- );
1274
+ const calendarDates = useMemo4(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
1275
+ const weekdayNames = useMemo4(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
1406
1276
  return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
1407
1277
  CalendarViewTable,
1408
1278
  {
@@ -1432,25 +1302,9 @@ var PickerDays = (props) => {
1432
1302
  }
1433
1303
  }
1434
1304
  },
1435
- /* @__PURE__ */ React11.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React11.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React11.createElement("th", null, /* @__PURE__ */ React11.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React11.createElement(
1436
- "th",
1437
- {
1438
- style: { width: 4 },
1439
- "aria-hidden": "true",
1440
- "aria-description": "cell-gap"
1441
- }
1442
- ))))),
1305
+ /* @__PURE__ */ React11.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React11.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React11.createElement("th", null, /* @__PURE__ */ React11.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React11.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
1443
1306
  /* @__PURE__ */ React11.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React11.createElement("tr", null, weekDates.map(
1444
- (date, i) => date ? /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React11.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React11.createElement(
1445
- CalendarDay,
1446
- {
1447
- size: "sm",
1448
- variant: "plain",
1449
- color: "neutral",
1450
- ...getPickerDayProps(date)
1451
- },
1452
- date
1453
- )), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ React11.createElement("td", null), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
1307
+ (date, i) => date ? /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React11.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React11.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ React11.createElement("td", null), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
1454
1308
  )), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 13, style: { height: 4 } })))))
1455
1309
  )));
1456
1310
  };
@@ -1468,62 +1322,37 @@ var PickerMonths = (props) => {
1468
1322
  [[]]
1469
1323
  );
1470
1324
  const isMonthPicker = !ownerState.views?.find((view) => view === "day");
1471
- return /* @__PURE__ */ React11.createElement(
1472
- CalendarViewContainer,
1325
+ return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
1326
+ CalendarViewTable,
1473
1327
  {
1474
- calendarType: isMonthPicker ? "monthPicker" : "datePicker"
1475
- },
1476
- /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
1477
- CalendarViewTable,
1478
- {
1479
- key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
1480
- custom: ownerState.direction,
1481
- variants,
1482
- initial: "enter",
1483
- animate: "center",
1484
- exit: "exit",
1485
- transition: {
1486
- x: { type: "spring", stiffness: 300, damping: 30 },
1487
- opacity: { duration: 0.2 }
1488
- },
1489
- drag: "x",
1490
- dragConstraints: { left: 0, right: 0 },
1491
- dragElastic: 1,
1492
- onDragEnd: (e, { offset, velocity }) => {
1493
- const swipe = swipePower(offset.x, velocity.x);
1494
- if (swipe < -swipeConfidenceThreshold) {
1495
- const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
1496
- date.setMonth(date.getMonth() + 1);
1497
- ownerState.onMonthChange?.(date);
1498
- } else if (swipe > swipeConfidenceThreshold) {
1499
- const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
1500
- date.setMonth(date.getMonth() - 1);
1501
- ownerState.onMonthChange?.(date);
1502
- }
1503
- }
1328
+ key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
1329
+ custom: ownerState.direction,
1330
+ variants,
1331
+ initial: "enter",
1332
+ animate: "center",
1333
+ exit: "exit",
1334
+ transition: {
1335
+ x: { type: "spring", stiffness: 300, damping: 30 },
1336
+ opacity: { duration: 0.2 }
1504
1337
  },
1505
- /* @__PURE__ */ React11.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: months.join("_") }, /* @__PURE__ */ React11.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React11.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React11.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React11.createElement(
1506
- CalendarMonth,
1507
- {
1508
- size: "sm",
1509
- variant: "plain",
1510
- color: "neutral",
1511
- ...getPickerMonthProps(monthIndex)
1512
- },
1513
- getMonthNameFromIndex(
1514
- monthIndex,
1515
- ownerState.locale
1516
- )
1517
- )), j < 3 && /* @__PURE__ */ React11.createElement(
1518
- "td",
1519
- {
1520
- style: { width: 4 },
1521
- "aria-hidden": "true",
1522
- "aria-description": "cell-gap"
1338
+ drag: "x",
1339
+ dragConstraints: { left: 0, right: 0 },
1340
+ dragElastic: 1,
1341
+ onDragEnd: (e, { offset, velocity }) => {
1342
+ const swipe = swipePower(offset.x, velocity.x);
1343
+ if (swipe < -swipeConfidenceThreshold) {
1344
+ const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
1345
+ date.setMonth(date.getMonth() + 1);
1346
+ ownerState.onMonthChange?.(date);
1347
+ } else if (swipe > swipeConfidenceThreshold) {
1348
+ const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
1349
+ date.setMonth(date.getMonth() - 1);
1350
+ ownerState.onMonthChange?.(date);
1523
1351
  }
1524
- )))), i < chunkedMonths.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 7, style: { height: 4 } })))))
1525
- ))
1526
- );
1352
+ }
1353
+ },
1354
+ /* @__PURE__ */ React11.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: months.join("_") }, /* @__PURE__ */ React11.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React11.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React11.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React11.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ React11.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 7, style: { height: 4 } })))))
1355
+ )));
1527
1356
  };
1528
1357
  var Calendar = forwardRef4((inProps, ref) => {
1529
1358
  const [props, ownerState] = useCalendarProps(inProps);
@@ -1544,15 +1373,7 @@ var Calendar = forwardRef4((inProps, ref) => {
1544
1373
  ...others
1545
1374
  } = props;
1546
1375
  const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
1547
- return /* @__PURE__ */ React11.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React11.createElement(CalendarHeader, null, /* @__PURE__ */ React11.createElement(
1548
- IconButton_default,
1549
- {
1550
- size: "sm",
1551
- onClick: onPrev,
1552
- "aria-label": `Previous ${view === "day" ? "Month" : "Year"}`
1553
- },
1554
- /* @__PURE__ */ React11.createElement(ChevronLeftIcon, null)
1555
- ), /* @__PURE__ */ React11.createElement(
1376
+ return /* @__PURE__ */ React11.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React11.createElement(CalendarHeader, null, /* @__PURE__ */ React11.createElement(IconButton_default, { size: "sm", onClick: onPrev, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React11.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React11.createElement(
1556
1377
  CalendarSwitchViewButton,
1557
1378
  {
1558
1379
  ownerState,
@@ -1562,15 +1383,7 @@ var Calendar = forwardRef4((inProps, ref) => {
1562
1383
  "aria-label": "Switch Calendar View"
1563
1384
  },
1564
1385
  calendarTitle
1565
- ), /* @__PURE__ */ React11.createElement(
1566
- IconButton_default,
1567
- {
1568
- size: "sm",
1569
- onClick: onNext,
1570
- "aria-label": `Next ${view === "day" ? "Month" : "Year"}`
1571
- },
1572
- /* @__PURE__ */ React11.createElement(ChevronRightIcon, null)
1573
- )), view === "day" && /* @__PURE__ */ React11.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React11.createElement(PickerMonths, { ownerState }));
1386
+ ), /* @__PURE__ */ React11.createElement(IconButton_default, { size: "sm", onClick: onNext, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React11.createElement(ChevronRightIcon, null))), view === "day" && /* @__PURE__ */ React11.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React11.createElement(PickerMonths, { ownerState }));
1574
1387
  });
1575
1388
  Calendar.displayName = "Calendar";
1576
1389
 
@@ -1714,23 +1527,15 @@ var Input = React14.forwardRef((props, ref) => {
1714
1527
  ...innerProps.slotProps
1715
1528
  },
1716
1529
  ...innerProps,
1717
- endDecorator: enableClearable ? /* @__PURE__ */ React14.createElement(
1718
- Stack_default,
1530
+ endDecorator: enableClearable ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React14.createElement(
1531
+ IconButton_default,
1719
1532
  {
1720
- gap: 1,
1721
- direction: "row"
1533
+ onMouseDown: (e) => e.preventDefault(),
1534
+ onClick: handleClear,
1535
+ "aria-label": "Clear"
1722
1536
  },
1723
- innerProps.endDecorator,
1724
- value && /* @__PURE__ */ React14.createElement(
1725
- IconButton_default,
1726
- {
1727
- onMouseDown: (e) => e.preventDefault(),
1728
- onClick: handleClear,
1729
- "aria-label": "Clear"
1730
- },
1731
- /* @__PURE__ */ React14.createElement(ClearIcon, null)
1732
- )
1733
- ) : innerProps.endDecorator
1537
+ /* @__PURE__ */ React14.createElement(ClearIcon, null)
1538
+ )) : innerProps.endDecorator
1734
1539
  }
1735
1540
  );
1736
1541
  return /* @__PURE__ */ React14.createElement(
@@ -1918,25 +1723,23 @@ var useCurrencySetting = (props) => {
1918
1723
  };
1919
1724
 
1920
1725
  // src/components/CurrencyInput/CurrencyInput.tsx
1921
- var TextMaskAdapter = React15.forwardRef(
1922
- function TextMaskAdapter2(props, ref) {
1923
- const { onChange, ...innerProps } = props;
1924
- return /* @__PURE__ */ React15.createElement(
1925
- NumericFormat,
1926
- {
1927
- ...innerProps,
1928
- onValueChange: ({ value }) => {
1929
- onChange?.({
1930
- target: { name: props.name, value }
1931
- });
1932
- },
1933
- valueIsNumericString: true,
1934
- getInputRef: ref,
1935
- allowNegative: true
1936
- }
1937
- );
1938
- }
1939
- );
1726
+ var TextMaskAdapter = React15.forwardRef(function TextMaskAdapter2(props, ref) {
1727
+ const { onChange, ...innerProps } = props;
1728
+ return /* @__PURE__ */ React15.createElement(
1729
+ NumericFormat,
1730
+ {
1731
+ ...innerProps,
1732
+ onValueChange: ({ value }) => {
1733
+ onChange?.({
1734
+ target: { name: props.name, value }
1735
+ });
1736
+ },
1737
+ valueIsNumericString: true,
1738
+ getInputRef: ref,
1739
+ allowNegative: true
1740
+ }
1741
+ );
1742
+ });
1940
1743
  var CurrencyInputRoot = styled7(Input_default, {
1941
1744
  name: "CurrencyInput",
1942
1745
  slot: "root",
@@ -1959,21 +1762,11 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
1959
1762
  className,
1960
1763
  ...innerProps
1961
1764
  } = props;
1962
- const {
1963
- symbol,
1964
- thousandSeparator,
1965
- decimalSeparator,
1966
- placeholder,
1967
- fixedDecimalScale,
1968
- decimalScale
1969
- } = useCurrencySetting(props);
1765
+ const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale } = useCurrencySetting(props);
1970
1766
  const [_value, setValue] = useControlledState(
1971
1767
  props.value,
1972
1768
  props.defaultValue,
1973
- useCallback6(
1974
- (value2) => onChange?.({ target: { name, value: value2 } }),
1975
- [onChange, name]
1976
- )
1769
+ useCallback6((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
1977
1770
  );
1978
1771
  const value = useMemo5(() => {
1979
1772
  if (_value && useMinorUnit) {
@@ -1987,9 +1780,7 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
1987
1780
  }
1988
1781
  return props.max;
1989
1782
  }, [props.max, useMinorUnit, decimalScale]);
1990
- const [isOverLimit, setIsOverLimit] = useState4(
1991
- !!max && !!value && value > max
1992
- );
1783
+ const [isOverLimit, setIsOverLimit] = useState4(!!max && !!value && value > max);
1993
1784
  const handleChange = useCallback6(
1994
1785
  (event) => {
1995
1786
  if (event.target.value === "") {
@@ -2019,9 +1810,9 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
2019
1810
  required,
2020
1811
  color: error || isOverLimit ? "danger" : props.color,
2021
1812
  label,
2022
- helperText: isOverLimit ? new IntlMessageFormat2(
2023
- `limit: {amount, number, ::currency/${currency} unit-width-narrow}`
2024
- ).format({ amount: max }) : helperText,
1813
+ helperText: isOverLimit ? new IntlMessageFormat2(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
1814
+ amount: max
1815
+ }) : helperText,
2025
1816
  slotProps: {
2026
1817
  input: {
2027
1818
  component: TextMaskAdapter,
@@ -2056,17 +1847,11 @@ import React23, {
2056
1847
  useImperativeHandle as useImperativeHandle2,
2057
1848
  createElement,
2058
1849
  memo,
2059
- useLayoutEffect
1850
+ useLayoutEffect,
1851
+ Fragment as Fragment2
2060
1852
  } from "react";
2061
1853
  import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
2062
- import {
2063
- styled as styled12,
2064
- LinearProgress,
2065
- Link,
2066
- useTheme,
2067
- buttonClasses,
2068
- iconButtonClasses
2069
- } from "@mui/joy";
1854
+ import { styled as styled12, LinearProgress, Link, useTheme, buttonClasses, iconButtonClasses } from "@mui/joy";
2070
1855
  import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
2071
1856
 
2072
1857
  // src/components/Sheet/Sheet.tsx
@@ -2136,13 +1921,7 @@ function TableBody(props) {
2136
1921
  textAlign: "center"
2137
1922
  }
2138
1923
  },
2139
- /* @__PURE__ */ React16.createElement(
2140
- RenderCheckbox,
2141
- {
2142
- onChange: (event) => onCheckboxChange?.(event, rowIndex),
2143
- ...checkboxProps
2144
- }
2145
- )
1924
+ /* @__PURE__ */ React16.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
2146
1925
  ), cellOrder.map((cellKey) => /* @__PURE__ */ React16.createElement(
2147
1926
  "td",
2148
1927
  {
@@ -2157,14 +1936,7 @@ function TableBody(props) {
2157
1936
  TableBody.displayName = "TableBody";
2158
1937
 
2159
1938
  // src/components/DatePicker/DatePicker.tsx
2160
- import React17, {
2161
- forwardRef as forwardRef6,
2162
- useCallback as useCallback7,
2163
- useEffect as useEffect3,
2164
- useImperativeHandle,
2165
- useRef as useRef3,
2166
- useState as useState5
2167
- } from "react";
1939
+ import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState5 } from "react";
2168
1940
  import { IMaskInput, IMask } from "react-imask";
2169
1941
  import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
2170
1942
  import { styled as styled9, useThemeProps as useThemeProps4 } from "@mui/joy";
@@ -2194,9 +1966,7 @@ var CalendarButton = styled9(IconButton_default, {
2194
1966
  "&:focus": {
2195
1967
  "--Icon-color": "currentColor",
2196
1968
  outlineOffset: `${theme.getCssVar("focus-thickness")}`,
2197
- outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
2198
- "palette-focusVisible"
2199
- )}`
1969
+ outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
2200
1970
  }
2201
1971
  }));
2202
1972
  var StyledPopper = styled9(Popper2, {
@@ -2230,9 +2000,7 @@ var validValueFormat = (value, format) => {
2230
2000
  if (value !== formatValueString(parsedValue, format)) {
2231
2001
  return false;
2232
2002
  }
2233
- const regex = new RegExp(
2234
- `^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`
2235
- );
2003
+ const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
2236
2004
  return regex.test(value);
2237
2005
  } catch (e) {
2238
2006
  return false;
@@ -2273,276 +2041,259 @@ function parseDate(dateString, format) {
2273
2041
  var formatToPattern = (format) => {
2274
2042
  return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
2275
2043
  };
2276
- var TextMaskAdapter3 = React17.forwardRef(
2277
- function TextMaskAdapter4(props, ref) {
2278
- const { onChange, format, ...other } = props;
2279
- return /* @__PURE__ */ React17.createElement(
2280
- IMaskInput,
2281
- {
2282
- ...other,
2283
- inputRef: ref,
2284
- onAccept: (value) => onChange({ target: { name: props.name, value } }),
2285
- mask: Date,
2286
- pattern: formatToPattern(format),
2287
- blocks: {
2288
- D: {
2289
- mask: IMask.MaskedRange,
2290
- from: 1,
2291
- to: 31,
2292
- maxLength: 2
2293
- },
2294
- M: {
2295
- mask: IMask.MaskedRange,
2296
- from: 1,
2297
- to: 12,
2298
- maxLength: 2
2299
- },
2300
- Y: {
2301
- mask: IMask.MaskedRange,
2302
- from: 1900,
2303
- to: 9999,
2304
- maxLength: 4
2305
- }
2044
+ var TextMaskAdapter3 = React17.forwardRef(function TextMaskAdapter4(props, ref) {
2045
+ const { onChange, format, ...other } = props;
2046
+ return /* @__PURE__ */ React17.createElement(
2047
+ IMaskInput,
2048
+ {
2049
+ ...other,
2050
+ inputRef: ref,
2051
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
2052
+ mask: Date,
2053
+ pattern: formatToPattern(format),
2054
+ blocks: {
2055
+ D: {
2056
+ mask: IMask.MaskedRange,
2057
+ from: 1,
2058
+ to: 31,
2059
+ maxLength: 2
2060
+ },
2061
+ M: {
2062
+ mask: IMask.MaskedRange,
2063
+ from: 1,
2064
+ to: 12,
2065
+ maxLength: 2
2306
2066
  },
2307
- format: (date) => formatValueString(date, format),
2308
- parse: (str) => parseDate(str, format),
2309
- autofix: "pad",
2310
- overwrite: true
2067
+ Y: {
2068
+ mask: IMask.MaskedRange,
2069
+ from: 1900,
2070
+ to: 9999,
2071
+ maxLength: 4
2072
+ }
2073
+ },
2074
+ format: (date) => formatValueString(date, format),
2075
+ parse: (str) => parseDate(str, format),
2076
+ autofix: "pad",
2077
+ overwrite: true
2078
+ }
2079
+ );
2080
+ });
2081
+ var DatePicker = forwardRef6((inProps, ref) => {
2082
+ const props = useThemeProps4({ props: inProps, name: "DatePicker" });
2083
+ const {
2084
+ onChange,
2085
+ disabled,
2086
+ label,
2087
+ error,
2088
+ helperText,
2089
+ minDate,
2090
+ maxDate,
2091
+ disableFuture,
2092
+ disablePast,
2093
+ required,
2094
+ // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
2095
+ sx,
2096
+ className,
2097
+ format = "YYYY/MM/DD",
2098
+ displayFormat = "YYYY/MM/DD",
2099
+ size,
2100
+ inputReadOnly,
2101
+ hideClearButton,
2102
+ readOnly,
2103
+ shouldDisableDate,
2104
+ ...innerProps
2105
+ } = props;
2106
+ const innerRef = useRef3(null);
2107
+ const buttonRef = useRef3(null);
2108
+ const [value, setValue] = useControlledState(
2109
+ props.value,
2110
+ props.defaultValue || "",
2111
+ useCallback7((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
2112
+ );
2113
+ const [displayValue, setDisplayValue] = useState5(
2114
+ () => value ? formatValueString(parseDate(value, format), displayFormat) : ""
2115
+ );
2116
+ const [anchorEl, setAnchorEl] = useState5(null);
2117
+ const open = Boolean(anchorEl);
2118
+ useEffect3(() => {
2119
+ if (!anchorEl) {
2120
+ innerRef.current?.blur();
2121
+ }
2122
+ }, [anchorEl, innerRef]);
2123
+ useEffect3(() => {
2124
+ if (value === "") {
2125
+ setDisplayValue("");
2126
+ return;
2127
+ }
2128
+ const formattedValue = formatValueString(parseDate(value, format), displayFormat);
2129
+ if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
2130
+ setDisplayValue(formattedValue);
2131
+ }
2132
+ }, [displayFormat, displayValue, format, value]);
2133
+ useImperativeHandle(ref, () => innerRef.current, [innerRef]);
2134
+ const handleChange = useCallback7(
2135
+ (event) => {
2136
+ const value2 = event.target.value;
2137
+ setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
2138
+ setValue(value2);
2139
+ },
2140
+ [displayFormat, format, setValue]
2141
+ );
2142
+ const handleDisplayInputChange = useCallback7(
2143
+ (event) => {
2144
+ if (event.target.value === "") {
2145
+ handleChange({
2146
+ target: {
2147
+ name: props.name,
2148
+ value: ""
2149
+ }
2150
+ });
2151
+ return;
2311
2152
  }
2312
- );
2313
- }
2314
- );
2315
- var DatePicker = forwardRef6(
2316
- (inProps, ref) => {
2317
- const props = useThemeProps4({ props: inProps, name: "DatePicker" });
2318
- const {
2319
- onChange,
2153
+ const isValidDisplayValue = validValueFormat(event.target.value, displayFormat);
2154
+ if (isValidDisplayValue) {
2155
+ const parsedDate = parseDate(event.target.value, displayFormat);
2156
+ const formattedValue = formatValueString(parsedDate, format);
2157
+ handleChange({
2158
+ target: {
2159
+ name: props.name,
2160
+ value: formattedValue
2161
+ }
2162
+ });
2163
+ }
2164
+ },
2165
+ [displayFormat, format, handleChange, props.name]
2166
+ );
2167
+ const handleCalendarToggle = useCallback7(
2168
+ (event) => {
2169
+ setAnchorEl(anchorEl ? null : event.currentTarget);
2170
+ setTimeout(() => {
2171
+ innerRef.current?.focus();
2172
+ }, 0);
2173
+ },
2174
+ [anchorEl, setAnchorEl, innerRef]
2175
+ );
2176
+ const handleInputMouseDown = useCallback7(
2177
+ (event) => {
2178
+ if (inputReadOnly) {
2179
+ event.preventDefault();
2180
+ buttonRef.current?.focus();
2181
+ }
2182
+ },
2183
+ [inputReadOnly, buttonRef]
2184
+ );
2185
+ return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
2186
+ Input_default,
2187
+ {
2188
+ ...innerProps,
2189
+ color: error ? "danger" : innerProps.color,
2190
+ ref: innerRef,
2191
+ size,
2192
+ value: displayValue,
2193
+ onChange: handleDisplayInputChange,
2194
+ placeholder: displayFormat,
2320
2195
  disabled,
2321
- label,
2322
- error,
2323
- helperText,
2324
- minDate,
2325
- maxDate,
2326
- disableFuture,
2327
- disablePast,
2328
2196
  required,
2329
- // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
2330
- sx,
2197
+ error,
2198
+ slotProps: {
2199
+ input: {
2200
+ component: TextMaskAdapter3,
2201
+ ref: innerRef,
2202
+ format: displayFormat,
2203
+ sx: {
2204
+ "&:hover": {
2205
+ cursor: inputReadOnly || readOnly ? "default" : "text"
2206
+ }
2207
+ },
2208
+ onMouseDown: handleInputMouseDown
2209
+ }
2210
+ },
2331
2211
  className,
2332
- format = "YYYY/MM/DD",
2333
- displayFormat = "YYYY/MM/DD",
2334
- size,
2335
- inputReadOnly,
2336
- hideClearButton,
2337
- readOnly,
2338
- shouldDisableDate,
2339
- ...innerProps
2340
- } = props;
2341
- const innerRef = useRef3(null);
2342
- const buttonRef = useRef3(null);
2343
- const [value, setValue] = useControlledState(
2344
- props.value,
2345
- props.defaultValue || "",
2346
- useCallback7(
2347
- (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
2348
- [props.name, onChange]
2349
- )
2350
- );
2351
- const [displayValue, setDisplayValue] = useState5(
2352
- () => value ? formatValueString(parseDate(value, format), displayFormat) : ""
2353
- );
2354
- const [anchorEl, setAnchorEl] = useState5(null);
2355
- const open = Boolean(anchorEl);
2356
- useEffect3(() => {
2357
- if (!anchorEl) {
2358
- innerRef.current?.blur();
2359
- }
2360
- }, [anchorEl, innerRef]);
2361
- useEffect3(() => {
2362
- if (value === "") {
2363
- setDisplayValue("");
2364
- return;
2365
- }
2366
- const formattedValue = formatValueString(
2367
- parseDate(value, format),
2368
- displayFormat
2369
- );
2370
- if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
2371
- setDisplayValue(formattedValue);
2372
- }
2373
- }, [displayFormat, displayValue, format, value]);
2374
- useImperativeHandle(ref, () => innerRef.current, [
2375
- innerRef
2376
- ]);
2377
- const handleChange = useCallback7(
2378
- (event) => {
2379
- const value2 = event.target.value;
2380
- setDisplayValue(
2381
- value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2
2382
- );
2383
- setValue(value2);
2384
- },
2385
- [displayFormat, format, setValue]
2386
- );
2387
- const handleDisplayInputChange = useCallback7(
2388
- (event) => {
2389
- if (event.target.value === "") {
2390
- handleChange({
2391
- target: {
2392
- name: props.name,
2393
- value: ""
2394
- }
2395
- });
2396
- return;
2212
+ sx,
2213
+ endDecorator: /* @__PURE__ */ React17.createElement(
2214
+ CalendarButton,
2215
+ {
2216
+ ref: buttonRef,
2217
+ variant: "plain",
2218
+ onClick: readOnly ? void 0 : handleCalendarToggle,
2219
+ "aria-label": "Toggle Calendar",
2220
+ "aria-controls": "date-picker-popper",
2221
+ "aria-haspopup": "dialog",
2222
+ "aria-expanded": open,
2223
+ disabled
2224
+ },
2225
+ /* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
2226
+ ),
2227
+ label,
2228
+ helperText,
2229
+ readOnly: readOnly || inputReadOnly
2230
+ }
2231
+ ), open && /* @__PURE__ */ React17.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React17.createElement(
2232
+ StyledPopper,
2233
+ {
2234
+ id: "date-picker-popper",
2235
+ open: true,
2236
+ anchorEl,
2237
+ placement: "bottom-end",
2238
+ onMouseDown: (e) => e.preventDefault(),
2239
+ modifiers: [
2240
+ {
2241
+ name: "offset",
2242
+ options: {
2243
+ offset: [4, 4]
2244
+ }
2397
2245
  }
2398
- const isValidDisplayValue = validValueFormat(
2399
- event.target.value,
2400
- displayFormat
2401
- );
2402
- if (isValidDisplayValue) {
2403
- const parsedDate = parseDate(event.target.value, displayFormat);
2404
- const formattedValue = formatValueString(parsedDate, format);
2246
+ ],
2247
+ "aria-label": "Calendar Tooltip",
2248
+ "aria-expanded": open
2249
+ },
2250
+ /* @__PURE__ */ React17.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React17.createElement(
2251
+ Calendar_default,
2252
+ {
2253
+ value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
2254
+ onChange: ([date]) => {
2405
2255
  handleChange({
2406
2256
  target: {
2407
2257
  name: props.name,
2408
- value: formattedValue
2258
+ value: formatValueString(date, format)
2409
2259
  }
2410
2260
  });
2411
- }
2412
- },
2413
- [displayFormat, format, handleChange, props.name]
2414
- );
2415
- const handleCalendarToggle = useCallback7(
2416
- (event) => {
2417
- setAnchorEl(anchorEl ? null : event.currentTarget);
2418
- setTimeout(() => {
2419
- innerRef.current?.focus();
2420
- }, 0);
2421
- },
2422
- [anchorEl, setAnchorEl, innerRef]
2423
- );
2424
- const handleInputMouseDown = useCallback7(
2425
- (event) => {
2426
- if (inputReadOnly) {
2427
- event.preventDefault();
2428
- buttonRef.current?.focus();
2429
- }
2430
- },
2431
- [inputReadOnly, buttonRef]
2432
- );
2433
- return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
2434
- Input_default,
2435
- {
2436
- ...innerProps,
2437
- color: error ? "danger" : innerProps.color,
2438
- ref: innerRef,
2439
- size,
2440
- value: displayValue,
2441
- onChange: handleDisplayInputChange,
2442
- placeholder: displayFormat,
2443
- disabled,
2444
- required,
2445
- error,
2446
- slotProps: {
2447
- input: {
2448
- component: TextMaskAdapter3,
2449
- ref: innerRef,
2450
- format: displayFormat,
2451
- sx: {
2452
- "&:hover": {
2453
- cursor: inputReadOnly || readOnly ? "default" : "text"
2454
- }
2455
- },
2456
- onMouseDown: handleInputMouseDown
2457
- }
2261
+ setAnchorEl(null);
2458
2262
  },
2459
- className,
2460
- sx,
2461
- endDecorator: /* @__PURE__ */ React17.createElement(
2462
- CalendarButton,
2463
- {
2464
- ref: buttonRef,
2465
- variant: "plain",
2466
- onClick: readOnly ? void 0 : handleCalendarToggle,
2467
- "aria-label": "Toggle Calendar",
2468
- "aria-controls": "date-picker-popper",
2469
- "aria-haspopup": "dialog",
2470
- "aria-expanded": open,
2471
- disabled
2472
- },
2473
- /* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
2474
- ),
2475
- label,
2476
- helperText,
2477
- readOnly: readOnly || inputReadOnly
2263
+ minDate: minDate ? new Date(minDate) : void 0,
2264
+ maxDate: maxDate ? new Date(maxDate) : void 0,
2265
+ disableFuture,
2266
+ disablePast,
2267
+ shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
2478
2268
  }
2479
- ), open && /* @__PURE__ */ React17.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React17.createElement(
2480
- StyledPopper,
2269
+ ), !hideClearButton && /* @__PURE__ */ React17.createElement(
2270
+ DialogActions_default,
2481
2271
  {
2482
- id: "date-picker-popper",
2483
- open: true,
2484
- anchorEl,
2485
- placement: "bottom-end",
2486
- onMouseDown: (e) => e.preventDefault(),
2487
- modifiers: [
2488
- {
2489
- name: "offset",
2490
- options: {
2491
- offset: [4, 4]
2492
- }
2493
- }
2494
- ],
2495
- "aria-label": "Calendar Tooltip",
2496
- "aria-expanded": open
2272
+ sx: {
2273
+ p: 1
2274
+ }
2497
2275
  },
2498
- /* @__PURE__ */ React17.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React17.createElement(
2499
- Calendar_default,
2276
+ /* @__PURE__ */ React17.createElement(
2277
+ Button_default,
2500
2278
  {
2501
- value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
2502
- onChange: ([date]) => {
2279
+ size,
2280
+ variant: "plain",
2281
+ color: "neutral",
2282
+ onClick: () => {
2503
2283
  handleChange({
2504
2284
  target: {
2505
2285
  name: props.name,
2506
- value: formatValueString(date, format)
2286
+ value: ""
2507
2287
  }
2508
2288
  });
2509
2289
  setAnchorEl(null);
2510
- },
2511
- minDate: minDate ? new Date(minDate) : void 0,
2512
- maxDate: maxDate ? new Date(maxDate) : void 0,
2513
- disableFuture,
2514
- disablePast,
2515
- shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
2516
- }
2517
- ), !hideClearButton && /* @__PURE__ */ React17.createElement(
2518
- DialogActions_default,
2519
- {
2520
- sx: {
2521
- p: 1
2522
2290
  }
2523
2291
  },
2524
- /* @__PURE__ */ React17.createElement(
2525
- Button_default,
2526
- {
2527
- size,
2528
- variant: "plain",
2529
- color: "neutral",
2530
- onClick: () => {
2531
- handleChange({
2532
- target: {
2533
- name: props.name,
2534
- value: ""
2535
- }
2536
- });
2537
- setAnchorEl(null);
2538
- }
2539
- },
2540
- "Clear"
2541
- )
2542
- ))
2543
- )))));
2544
- }
2545
- );
2292
+ "Clear"
2293
+ )
2294
+ ))
2295
+ )))));
2296
+ });
2546
2297
 
2547
2298
  // src/components/DatePicker/index.ts
2548
2299
  var DatePicker_default = DatePicker;
@@ -2603,10 +2354,7 @@ var Textarea_default = Textarea;
2603
2354
 
2604
2355
  // src/components/Select/Select.tsx
2605
2356
  import React19, { useMemo as useMemo7 } from "react";
2606
- import {
2607
- Select as JoySelect,
2608
- Option as JoyOption
2609
- } from "@mui/joy";
2357
+ import { Select as JoySelect, Option as JoyOption } from "@mui/joy";
2610
2358
  import { motion as motion19 } from "framer-motion";
2611
2359
  var MotionOption = motion19(JoyOption);
2612
2360
  var Option = MotionOption;
@@ -2778,18 +2526,9 @@ function Pagination(props) {
2778
2526
  setPaginationModel({ ...paginationModel, page: newPage });
2779
2527
  };
2780
2528
  const firstPage = 1;
2781
- const lastPage = Math.max(
2782
- firstPage,
2783
- Math.ceil(rowCount / paginationModel.pageSize)
2784
- );
2785
- const beforePages = [
2786
- paginationModel.page - 2,
2787
- paginationModel.page - 1
2788
- ].filter((p) => p > 1);
2789
- const afterPages = [
2790
- paginationModel.page + 1,
2791
- paginationModel.page + 2
2792
- ].filter((p) => p <= lastPage - 1);
2529
+ const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
2530
+ const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
2531
+ const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
2793
2532
  const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
2794
2533
  const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
2795
2534
  useEffect4(() => {
@@ -2808,16 +2547,7 @@ function Pagination(props) {
2808
2547
  "aria-label": "Previous page"
2809
2548
  },
2810
2549
  /* @__PURE__ */ React21.createElement(PreviousIcon, null)
2811
- ), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(
2812
- PaginationButton,
2813
- {
2814
- size,
2815
- variant: "plain",
2816
- color: "neutral",
2817
- onClick: () => handlePageChange(firstPage)
2818
- },
2819
- firstPage
2820
- ), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
2550
+ ), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
2821
2551
  PaginationButton,
2822
2552
  {
2823
2553
  size,
@@ -2827,27 +2557,7 @@ function Pagination(props) {
2827
2557
  "aria-label": "More previous pages"
2828
2558
  },
2829
2559
  "..."
2830
- ), beforePages.map((p) => /* @__PURE__ */ React21.createElement(
2831
- PaginationButton,
2832
- {
2833
- key: p,
2834
- size,
2835
- variant: "plain",
2836
- color: "neutral",
2837
- onClick: () => handlePageChange(p)
2838
- },
2839
- p
2840
- )), /* @__PURE__ */ React21.createElement(PaginationButton, { active: "true", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(
2841
- PaginationButton,
2842
- {
2843
- key: p,
2844
- size,
2845
- variant: "plain",
2846
- color: "neutral",
2847
- onClick: () => handlePageChange(p)
2848
- },
2849
- p
2850
- )), isMoreAfterPages && /* @__PURE__ */ React21.createElement(
2560
+ ), beforePages.map((p) => /* @__PURE__ */ React21.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ React21.createElement(PaginationButton, { active: "true", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ React21.createElement(
2851
2561
  PaginationButton,
2852
2562
  {
2853
2563
  size,
@@ -2857,16 +2567,7 @@ function Pagination(props) {
2857
2567
  onClick: () => handlePageChange(paginationModel.page + 3)
2858
2568
  },
2859
2569
  "..."
2860
- ), paginationModel.page !== lastPage && /* @__PURE__ */ React21.createElement(
2861
- PaginationButton,
2862
- {
2863
- size,
2864
- variant: "plain",
2865
- color: "neutral",
2866
- onClick: () => handlePageChange(lastPage)
2867
- },
2868
- lastPage
2869
- ), /* @__PURE__ */ React21.createElement(
2570
+ ), paginationModel.page !== lastPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ React21.createElement(
2870
2571
  PaginationIconButton,
2871
2572
  {
2872
2573
  size,
@@ -2886,10 +2587,7 @@ var Pagination_default = Pagination;
2886
2587
 
2887
2588
  // src/components/InfoSign/InfoSign.tsx
2888
2589
  import React22 from "react";
2889
- import {
2890
- styled as styled11,
2891
- tooltipClasses
2892
- } from "@mui/joy";
2590
+ import { styled as styled11, tooltipClasses } from "@mui/joy";
2893
2591
  import MuiInfoIcon from "@mui/icons-material/Info";
2894
2592
  var InfoIcon = styled11(MuiInfoIcon, {
2895
2593
  name: "InfoSign",
@@ -2921,6 +2619,118 @@ function InfoSign(props) {
2921
2619
  var InfoSign_default = InfoSign;
2922
2620
 
2923
2621
  // src/components/DataTable/DataTable.tsx
2622
+ function extractFieldsFromGroupingModel(items) {
2623
+ const fields = /* @__PURE__ */ new Set();
2624
+ for (const item of items) {
2625
+ if ("groupId" in item) {
2626
+ const children = Array.isArray(item.children) ? item.children : [item.children];
2627
+ const childFields = extractFieldsFromGroupingModel(children);
2628
+ childFields.forEach((field) => fields.add(field));
2629
+ } else {
2630
+ fields.add(item.field);
2631
+ }
2632
+ }
2633
+ return fields;
2634
+ }
2635
+ function reorderColumnsByGroupingModel(columns, columnGroupingModel) {
2636
+ const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
2637
+ const orderedFields = [];
2638
+ function collectFieldsInOrder(items) {
2639
+ for (const item of items) {
2640
+ if ("groupId" in item) {
2641
+ const children = Array.isArray(item.children) ? item.children : [item.children];
2642
+ collectFieldsInOrder(children);
2643
+ } else {
2644
+ if (!orderedFields.includes(item.field)) {
2645
+ orderedFields.push(item.field);
2646
+ }
2647
+ }
2648
+ }
2649
+ }
2650
+ collectFieldsInOrder(columnGroupingModel);
2651
+ const columnMap = new Map(columns.map((col) => [col.field, col]));
2652
+ const reorderedColumns = [];
2653
+ for (const field of orderedFields) {
2654
+ const column = columnMap.get(field);
2655
+ if (column) {
2656
+ reorderedColumns.push(column);
2657
+ }
2658
+ }
2659
+ for (const column of columns) {
2660
+ if (!fieldsInGroupingModel.has(column.field)) {
2661
+ reorderedColumns.push(column);
2662
+ }
2663
+ }
2664
+ return reorderedColumns;
2665
+ }
2666
+ function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }) {
2667
+ const result = [];
2668
+ for (const item of items) {
2669
+ if ("groupId" in item) {
2670
+ const newPath = [...groupPath, item.groupId];
2671
+ const children = Array.isArray(item.children) ? item.children : [item.children];
2672
+ result.push(...flattenColumnGroups(children, newPath, columnIndex));
2673
+ } else {
2674
+ result.push({
2675
+ ...item,
2676
+ groupPath,
2677
+ columnIndex: columnIndex.current++
2678
+ });
2679
+ }
2680
+ }
2681
+ return result;
2682
+ }
2683
+ function calculateColumnGroups(columnGroupingModel, columns) {
2684
+ const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
2685
+ const flattenedColumns = flattenColumnGroups(columnGroupingModel);
2686
+ const columnIndexMap = new Map(flattenedColumns.map((col) => [col.field, col.columnIndex]));
2687
+ const processedGroups = /* @__PURE__ */ new Map();
2688
+ const groupsByLevel = [];
2689
+ let maxLevel = 0;
2690
+ function processGroup(items, level, parentGroupId) {
2691
+ let minIndex = Infinity;
2692
+ let maxIndex = -Infinity;
2693
+ for (const item of items) {
2694
+ if ("groupId" in item) {
2695
+ const groupKey = parentGroupId ? `${parentGroupId}.${item.groupId}` : item.groupId;
2696
+ if (!processedGroups.has(groupKey)) {
2697
+ const children = Array.isArray(item.children) ? item.children : [item.children];
2698
+ const { startIndex, colspan } = processGroup(children, level + 1, groupKey);
2699
+ const group = {
2700
+ groupId: item.groupId,
2701
+ headerName: item.headerName,
2702
+ colspan,
2703
+ level,
2704
+ startIndex
2705
+ };
2706
+ processedGroups.set(groupKey, group);
2707
+ if (!groupsByLevel[level]) {
2708
+ groupsByLevel[level] = [];
2709
+ }
2710
+ groupsByLevel[level].push(group);
2711
+ maxLevel = Math.max(maxLevel, level);
2712
+ minIndex = Math.min(minIndex, startIndex);
2713
+ maxIndex = Math.max(maxIndex, startIndex + colspan - 1);
2714
+ }
2715
+ } else {
2716
+ const columnIndex = columnIndexMap.get(item.field);
2717
+ if (columnIndex !== void 0) {
2718
+ minIndex = Math.min(minIndex, columnIndex);
2719
+ maxIndex = Math.max(maxIndex, columnIndex);
2720
+ }
2721
+ }
2722
+ }
2723
+ return {
2724
+ startIndex: minIndex === Infinity ? 0 : minIndex,
2725
+ colspan: maxIndex === -Infinity ? 0 : maxIndex - minIndex + 1
2726
+ };
2727
+ }
2728
+ processGroup(columnGroupingModel, 0);
2729
+ groupsByLevel.forEach((level) => {
2730
+ level.sort((a, b) => a.startIndex - b.startIndex);
2731
+ });
2732
+ return { groups: groupsByLevel, maxLevel, fieldsInGroupingModel };
2733
+ }
2924
2734
  function getTextAlign(props) {
2925
2735
  return !props.editMode && ["number", "date", "currency"].includes(props.type || "") ? "end" : "start";
2926
2736
  }
@@ -2945,15 +2755,7 @@ var TextEllipsis = ({ children }) => {
2945
2755
  }, [children]);
2946
2756
  const content = /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef }, children);
2947
2757
  if (showTooltip) {
2948
- return /* @__PURE__ */ React23.createElement(
2949
- Tooltip_default,
2950
- {
2951
- title: children,
2952
- placement: "top",
2953
- onClick: (e) => e.stopPropagation()
2954
- },
2955
- content
2956
- );
2758
+ return /* @__PURE__ */ React23.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
2957
2759
  }
2958
2760
  return content;
2959
2761
  };
@@ -2999,7 +2801,7 @@ var OverlayWrapper = styled12("tr", {
2999
2801
  }
3000
2802
  });
3001
2803
  var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
3002
- var Resizer = (ref) => /* @__PURE__ */ React23.createElement(
2804
+ var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ React23.createElement(
3003
2805
  Box_default,
3004
2806
  {
3005
2807
  sx: {
@@ -3017,6 +2819,7 @@ var Resizer = (ref) => /* @__PURE__ */ React23.createElement(
3017
2819
  const onMouseMove = (e2) => {
3018
2820
  if (initialWidth && initialX) {
3019
2821
  ref.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
2822
+ targetRef.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
3020
2823
  }
3021
2824
  };
3022
2825
  const onMouseUp = () => {
@@ -3127,20 +2930,19 @@ var HeadCell = (props) => {
3127
2930
  isPinned,
3128
2931
  pinnedStartPosition,
3129
2932
  pinnedEndPosition,
3130
- headerRef
2933
+ headerRef,
2934
+ tableColRef
3131
2935
  } = props;
3132
2936
  const theme = useTheme();
3133
2937
  const ref = headerRef;
2938
+ const colRef = tableColRef;
3134
2939
  const [isHovered, setIsHovered] = useState6(false);
3135
2940
  const sortable = type === "actions" ? false : _sortable;
3136
2941
  const headId = useMemo8(
3137
2942
  () => `${tableId}_header_${headerName ?? field}`.trim(),
3138
2943
  [tableId, headerName, field]
3139
2944
  );
3140
- const resizer = useMemo8(
3141
- () => resizable ?? true ? Resizer(ref) : null,
3142
- [resizable, ref]
3143
- );
2945
+ const resizer = useMemo8(() => resizable ?? true ? Resizer(ref, colRef) : null, [resizable, ref, colRef]);
3144
2946
  const style = useMemo8(
3145
2947
  () => ({
3146
2948
  width,
@@ -3155,17 +2957,7 @@ var HeadCell = (props) => {
3155
2957
  // TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
3156
2958
  userSelect: "none"
3157
2959
  }),
3158
- [
3159
- isPinned,
3160
- maxWidth,
3161
- minWidth,
3162
- pinnedEndPosition,
3163
- pinnedStartPosition,
3164
- sortable,
3165
- stickyHeader,
3166
- theme,
3167
- width
3168
- ]
2960
+ [isPinned, maxWidth, minWidth, pinnedEndPosition, pinnedStartPosition, sortable, stickyHeader, theme, width]
3169
2961
  );
3170
2962
  const textAlign = getTextAlign(props);
3171
2963
  const initialSort = sortOrder[0];
@@ -3222,20 +3014,7 @@ var HeadCell = (props) => {
3222
3014
  whileHover: "hover",
3223
3015
  initial: "initial"
3224
3016
  },
3225
- /* @__PURE__ */ React23.createElement(
3226
- Stack_default,
3227
- {
3228
- gap: 1,
3229
- direction: "row",
3230
- justifyContent: textAlign,
3231
- alignItems: "center"
3232
- },
3233
- textAlign === "end" && sortIcon,
3234
- textAlign === "end" && infoSign,
3235
- /* @__PURE__ */ React23.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ React23.createElement(Asterisk, null, "*")),
3236
- textAlign === "start" && infoSign,
3237
- textAlign === "start" && sortIcon
3238
- ),
3017
+ /* @__PURE__ */ React23.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center" }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ React23.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ React23.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
3239
3018
  resizer
3240
3019
  );
3241
3020
  };
@@ -3254,7 +3033,10 @@ var BodyCell = (props) => {
3254
3033
  pinnedStartPosition,
3255
3034
  pinnedEndPosition,
3256
3035
  row,
3257
- rowId
3036
+ rowId,
3037
+ cellClassName,
3038
+ onCellEditStart,
3039
+ onCellEditStop
3258
3040
  } = props;
3259
3041
  const theme = useTheme();
3260
3042
  const [value, setValue] = useState6(row[field]);
@@ -3263,20 +3045,22 @@ var BodyCell = (props) => {
3263
3045
  () => ({
3264
3046
  row,
3265
3047
  value,
3266
- id: rowId
3048
+ id: rowId,
3049
+ field
3267
3050
  }),
3268
- [row, rowId, value]
3051
+ [row, rowId, value, field]
3269
3052
  );
3270
3053
  const editMode = useMemo8(
3271
3054
  () => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
3272
3055
  [props.editMode, isCellEditable, params]
3273
3056
  );
3057
+ const propsComponentProps = "componentProps" in props ? props.componentProps : null;
3274
3058
  const componentProps = useMemo8(
3275
3059
  () => ({
3276
- ..."componentProps" in props && (typeof props.componentProps === "function" ? props.componentProps(params) : props.componentProps || {}),
3060
+ ..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
3277
3061
  size: "sm"
3278
3062
  }),
3279
- ["componentProps" in props ? props.componentProps : null, params]
3063
+ [props, propsComponentProps, params]
3280
3064
  );
3281
3065
  const editModeComponentProps = useMemo8(
3282
3066
  () => ({
@@ -3285,7 +3069,7 @@ var BodyCell = (props) => {
3285
3069
  componentProps.onChange?.(e);
3286
3070
  setValue(e.target.value);
3287
3071
  if (type === "select") {
3288
- props.onCellEditStop?.({
3072
+ onCellEditStop?.({
3289
3073
  ...params,
3290
3074
  originalRow: row,
3291
3075
  row: {
@@ -3298,7 +3082,7 @@ var BodyCell = (props) => {
3298
3082
  },
3299
3083
  onFocus: (e) => {
3300
3084
  componentProps.onFocus?.(e);
3301
- props.onCellEditStart?.({
3085
+ onCellEditStart?.({
3302
3086
  ...params,
3303
3087
  originalRow: row,
3304
3088
  row: {
@@ -3311,7 +3095,7 @@ var BodyCell = (props) => {
3311
3095
  onBlur: (e) => {
3312
3096
  componentProps.onBlur?.(e);
3313
3097
  if (type && ["number", "text", "longText", "currency", "date"].includes(type)) {
3314
- props.onCellEditStop?.({
3098
+ onCellEditStop?.({
3315
3099
  ...params,
3316
3100
  originalRow: row,
3317
3101
  row: {
@@ -3326,7 +3110,7 @@ var BodyCell = (props) => {
3326
3110
  onChangeComplete: (e) => {
3327
3111
  componentProps.onChangeComplete?.(e);
3328
3112
  setValue(e.target.value);
3329
- props.onCellEditStop?.({
3113
+ onCellEditStop?.({
3330
3114
  ...params,
3331
3115
  originalRow: row,
3332
3116
  row: {
@@ -3338,29 +3122,14 @@ var BodyCell = (props) => {
3338
3122
  }
3339
3123
  }
3340
3124
  }),
3341
- [
3342
- params,
3343
- row,
3344
- field,
3345
- value,
3346
- componentProps,
3347
- type,
3348
- props.onCellEditStop,
3349
- props.onCellEditStart
3350
- ]
3125
+ [params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
3351
3126
  );
3352
3127
  const EditModeComponent = useMemo8(() => {
3353
3128
  if (renderEditCell) {
3354
3129
  return createElement(memo(renderEditCell), params);
3355
3130
  }
3356
3131
  return {
3357
- date: /* @__PURE__ */ React23.createElement(
3358
- DatePicker_default,
3359
- {
3360
- value,
3361
- ...editModeComponentProps
3362
- }
3363
- ),
3132
+ date: /* @__PURE__ */ React23.createElement(DatePicker_default, { value, ...editModeComponentProps }),
3364
3133
  currency: /* @__PURE__ */ React23.createElement(
3365
3134
  CurrencyInput_default,
3366
3135
  {
@@ -3368,29 +3137,9 @@ var BodyCell = (props) => {
3368
3137
  ...editModeComponentProps
3369
3138
  }
3370
3139
  ),
3371
- number: /* @__PURE__ */ React23.createElement(
3372
- Input_default,
3373
- {
3374
- value,
3375
- type: "number",
3376
- ...editModeComponentProps
3377
- }
3378
- ),
3379
- text: /* @__PURE__ */ React23.createElement(
3380
- Input_default,
3381
- {
3382
- value,
3383
- type: "text",
3384
- ...editModeComponentProps
3385
- }
3386
- ),
3387
- longText: /* @__PURE__ */ React23.createElement(
3388
- Textarea_default,
3389
- {
3390
- value,
3391
- ...editModeComponentProps
3392
- }
3393
- ),
3140
+ number: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
3141
+ text: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
3142
+ longText: /* @__PURE__ */ React23.createElement(Textarea_default, { value, ...editModeComponentProps }),
3394
3143
  autocomplete: /* @__PURE__ */ React23.createElement(
3395
3144
  Autocomplete_default,
3396
3145
  {
@@ -3408,50 +3157,34 @@ var BodyCell = (props) => {
3408
3157
  }
3409
3158
  )
3410
3159
  }[type || "text"];
3411
- }, [value, editModeComponentProps, type]);
3160
+ }, [value, editModeComponentProps, type, renderEditCell, params]);
3161
+ const linkComponentFromProps = props.component;
3412
3162
  const ReadModeComponent = useMemo8(() => {
3413
3163
  if (renderCell) {
3414
3164
  return createElement(memo(renderCell), params);
3415
3165
  }
3416
3166
  const innerText = value;
3417
3167
  const typedComponent = {
3418
- link: React23.createElement(
3419
- props.component || Link,
3420
- {
3421
- children: innerText,
3422
- ...componentProps
3423
- }
3424
- )
3168
+ link: React23.createElement(linkComponentFromProps || Link, {
3169
+ children: innerText,
3170
+ ...componentProps
3171
+ })
3425
3172
  }[type || "text"];
3426
3173
  return typedComponent || innerText;
3427
- }, [value, renderCell, params, type, componentProps]);
3174
+ }, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
3175
+ const getActions = props.getActions;
3428
3176
  const CellComponent = useMemo8(() => {
3429
3177
  if (type === "actions") {
3430
- return /* @__PURE__ */ React23.createElement(
3431
- Stack_default,
3432
- {
3433
- direction: "row",
3434
- gap: 1,
3435
- justifyContent: "center",
3436
- alignItems: "center"
3437
- },
3438
- props.getActions?.(params)
3439
- );
3178
+ return /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
3440
3179
  }
3441
3180
  return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
3442
- }, [
3443
- type,
3444
- props.getActions,
3445
- params,
3446
- editMode,
3447
- EditModeComponent,
3448
- ReadModeComponent
3449
- ]);
3450
- const showTooltip = useMemo8(
3451
- () => noWrap && type === "longText",
3452
- [noWrap, type]
3453
- );
3181
+ }, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
3182
+ const showTooltip = useMemo8(() => noWrap && type === "longText", [noWrap, type]);
3454
3183
  const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
3184
+ const computedCellClassName = useMemo8(
3185
+ () => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
3186
+ [cellClassName, params]
3187
+ );
3455
3188
  useEffect5(() => {
3456
3189
  setValue(row[field]);
3457
3190
  }, [row, field]);
@@ -3470,11 +3203,11 @@ var BodyCell = (props) => {
3470
3203
  zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + ${isBoundary ? 2 : 3})` : void 0,
3471
3204
  "--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
3472
3205
  },
3473
- className: isLastStartPinnedColumn && "is-last-left" || isLastEndPinnedColumn && "is-last-right" || ""
3206
+ className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
3474
3207
  },
3475
3208
  useMemo8(
3476
3209
  () => showTooltip ? /* @__PURE__ */ React23.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
3477
- [CellComponent, showTooltip, value]
3210
+ [CellComponent, showTooltip]
3478
3211
  )
3479
3212
  );
3480
3213
  };
@@ -3544,31 +3277,40 @@ function useDataTableRenderer({
3544
3277
  editMode,
3545
3278
  getId: _getId,
3546
3279
  isTotalSelected: _isTotalSelected,
3547
- isRowSelectable
3280
+ isRowSelectable,
3281
+ columnGroupingModel
3282
+ // Add this prop
3548
3283
  }) {
3284
+ if (pinnedColumns && columnGroupingModel) {
3285
+ throw new Error(
3286
+ "You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
3287
+ );
3288
+ }
3549
3289
  const onSelectionModelChangeRef = useRef4(onSelectionModelChange);
3550
3290
  onSelectionModelChangeRef.current = onSelectionModelChange;
3551
3291
  const [focusedRowId, setFocusedRowId] = useState6(null);
3552
3292
  const [sortModel, setSortModel] = useControlledState(
3553
3293
  controlledSortModel,
3554
3294
  initialState?.sorting?.sortModel ?? [],
3555
- useCallback9(
3556
- (sortModel2) => onSortModelChange?.(sortModel2),
3557
- [onSortModelChange]
3558
- )
3295
+ useCallback9((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
3559
3296
  );
3297
+ const reorderedColumns = useMemo8(() => {
3298
+ if (!columnGroupingModel) return columnsProp;
3299
+ return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
3300
+ }, [columnsProp, columnGroupingModel]);
3560
3301
  const columnsByField = useMemo8(
3561
- () => columnsProp.reduce(
3302
+ () => reorderedColumns.reduce(
3562
3303
  (acc, curr) => ({
3563
3304
  ...acc,
3564
3305
  [curr.field]: {
3565
3306
  ...curr,
3566
- headerRef: React23.createRef()
3307
+ headerRef: React23.createRef(),
3308
+ tableColRef: React23.createRef()
3567
3309
  }
3568
3310
  }),
3569
3311
  {}
3570
3312
  ),
3571
- [columnsProp]
3313
+ [reorderedColumns]
3572
3314
  );
3573
3315
  const sortComparator = useCallback9(
3574
3316
  (rowA, rowB) => {
@@ -3630,9 +3372,7 @@ function useDataTableRenderer({
3630
3372
  [dataInPage, isRowSelectable, getId]
3631
3373
  );
3632
3374
  const isAllSelected = useMemo8(
3633
- () => selectableDataInPage.length > 0 && selectableDataInPage.every(
3634
- (row, i) => selectedModelSet.has(getId(row, i))
3635
- ),
3375
+ () => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
3636
3376
  [selectableDataInPage, selectedModelSet, getId]
3637
3377
  );
3638
3378
  const rowCount = totalRowsProp || rows.length;
@@ -3650,22 +3390,25 @@ function useDataTableRenderer({
3650
3390
  columnsByField[f].minWidth ?? 0,
3651
3391
  [columnWidths, columnsByField]
3652
3392
  );
3393
+ const processedColumnGroups = useMemo8(() => {
3394
+ if (!columnGroupingModel) return null;
3395
+ return calculateColumnGroups(columnGroupingModel, reorderedColumns);
3396
+ }, [columnGroupingModel, reorderedColumns]);
3653
3397
  const columns = useMemo8(() => {
3654
- const baseColumns = columnsProp || // fallback
3655
- Object.keys(rows[0] || {}).map((key) => ({
3656
- field: key
3657
- }));
3398
+ const baseColumns = reorderedColumns.length > 0 ? reorderedColumns : (
3399
+ // fallback
3400
+ Object.keys(rows[0] || {}).map((key) => ({
3401
+ field: key
3402
+ }))
3403
+ );
3658
3404
  return baseColumns.map((column) => {
3659
- const isLeftPinned = pinnedColumns?.left?.includes(
3660
- column.field
3661
- );
3662
- const isRightPinned = pinnedColumns?.right?.includes(
3663
- column.field
3664
- );
3405
+ const isLeftPinned = pinnedColumns?.left?.includes(column.field);
3406
+ const isRightPinned = pinnedColumns?.right?.includes(column.field);
3665
3407
  const isPinned = isLeftPinned || isRightPinned;
3666
3408
  return {
3667
3409
  ...column,
3668
3410
  headerRef: columnsByField[column.field].headerRef,
3411
+ tableColRef: columnsByField[column.field].tableColRef,
3669
3412
  isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
3670
3413
  sort: sortModel.find((sort) => sort.field === column.field)?.sort,
3671
3414
  sortOrder: columnsByField[column.field]?.sortOrder || sortOrder,
@@ -3673,17 +3416,12 @@ function useDataTableRenderer({
3673
3416
  isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
3674
3417
  isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
3675
3418
  // pinned 관련 계산부
3676
- pinnedStartPosition: pinnedColumns?.left?.slice(
3677
- 0,
3678
- isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length
3679
- ).reduce((acc, curr) => acc + getWidth(curr), 0),
3680
- pinnedEndPosition: pinnedColumns?.right?.slice(
3681
- isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0
3682
- ).reduce((acc, curr) => acc + getWidth(curr), 0)
3419
+ pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
3420
+ pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
3683
3421
  };
3684
3422
  });
3685
3423
  }, [
3686
- columnsProp,
3424
+ reorderedColumns,
3687
3425
  rows,
3688
3426
  pinnedColumns?.left,
3689
3427
  pinnedColumns?.right,
@@ -3714,9 +3452,7 @@ function useDataTableRenderer({
3714
3452
  setSortModel(newSortModel2);
3715
3453
  return;
3716
3454
  }
3717
- const newSortModel = multiple ? sortModel.map(
3718
- (model) => model.field === field ? { field, sort: nextSortOrder } : model
3719
- ) : [{ field, sort: nextSortOrder }];
3455
+ const newSortModel = multiple ? sortModel.map((model) => model.field === field ? { field, sort: nextSortOrder } : model) : [{ field, sort: nextSortOrder }];
3720
3456
  setSortModel(newSortModel);
3721
3457
  } else {
3722
3458
  const newSortModel = multiple ? [...sortModel, { field, sort: columnSortOrder[0] }] : [{ field, sort: columnSortOrder[0] }];
@@ -3753,10 +3489,7 @@ function useDataTableRenderer({
3753
3489
  isAllSelected,
3754
3490
  // all rows are selected on this page
3755
3491
  isTotalSelected,
3756
- isSelectedRow: useCallback9(
3757
- (model) => selectedModelSet.has(model),
3758
- [selectedModelSet]
3759
- ),
3492
+ isSelectedRow: useCallback9((model) => selectedModelSet.has(model), [selectedModelSet]),
3760
3493
  isRowSelectable: useCallback9(
3761
3494
  (rowId, row) => {
3762
3495
  if (!isRowSelectable) return true;
@@ -3769,16 +3502,12 @@ function useDataTableRenderer({
3769
3502
  setFocusedRowId(rowId);
3770
3503
  }, []),
3771
3504
  onAllCheckboxChange: useCallback9(() => {
3772
- onSelectionModelChange?.(
3773
- isAllSelected ? [] : selectableDataInPage.map(getId)
3774
- );
3505
+ onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
3775
3506
  }, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
3776
3507
  onCheckboxChange: useCallback9(
3777
3508
  (event, selectedModel) => {
3778
3509
  if (selectedModelSet.has(selectedModel)) {
3779
- const newSelectionModel = (selectionModel || []).filter(
3780
- (model) => model !== selectedModel
3781
- );
3510
+ const newSelectionModel = (selectionModel || []).filter((model) => model !== selectedModel);
3782
3511
  onSelectionModelChange?.(newSelectionModel);
3783
3512
  } else {
3784
3513
  const newSelectionModel = [...selectionModel || [], selectedModel];
@@ -3788,15 +3517,13 @@ function useDataTableRenderer({
3788
3517
  [selectionModel, onSelectionModelChange, selectedModelSet]
3789
3518
  ),
3790
3519
  columns,
3520
+ processedColumnGroups,
3791
3521
  onTotalSelect: useCallback9(() => {
3792
3522
  const selectableRows = rows.filter((row, i) => {
3793
3523
  if (!isRowSelectable) return true;
3794
3524
  return isRowSelectable({ row, id: getId(row, i) });
3795
3525
  });
3796
- onSelectionModelChange?.(
3797
- isTotalSelected ? [] : selectableRows.map(getId),
3798
- !isTotalSelected
3799
- );
3526
+ onSelectionModelChange?.(isTotalSelected ? [] : selectableRows.map(getId), !isTotalSelected);
3800
3527
  }, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
3801
3528
  };
3802
3529
  }
@@ -3833,17 +3560,15 @@ function Component(props, apiRef) {
3833
3560
  getId: ____________,
3834
3561
  // getId is used in useDataTableRenderer
3835
3562
  loading,
3563
+ columnGroupingModel: _________________,
3564
+ // columnGroupingModel is used in useDataTableRenderer
3836
3565
  slots: {
3837
3566
  checkbox: RenderCheckbox = Checkbox_default,
3838
3567
  toolbar: Toolbar,
3839
3568
  footer: Footer,
3840
3569
  loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
3841
3570
  } = {},
3842
- slotProps: {
3843
- checkbox: checkboxProps = {},
3844
- toolbar: toolbarProps,
3845
- background: backgroundProps = {}
3846
- } = {},
3571
+ slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
3847
3572
  stripe,
3848
3573
  isTotalSelected: ___________,
3849
3574
  ...innerProps
@@ -3853,6 +3578,7 @@ function Component(props, apiRef) {
3853
3578
  const tableBodyRef = useRef4(null);
3854
3579
  const {
3855
3580
  columns,
3581
+ processedColumnGroups,
3856
3582
  isAllSelected,
3857
3583
  isSelectedRow,
3858
3584
  isRowSelectable: isRowSelectableCheck,
@@ -3888,13 +3614,7 @@ function Component(props, apiRef) {
3888
3614
  onRowClick?.({ row, rowId }, e);
3889
3615
  checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
3890
3616
  },
3891
- [
3892
- onRowClick,
3893
- checkboxSelection,
3894
- disableSelectionOnClick,
3895
- onCheckboxChange,
3896
- isRowSelectableCheck
3897
- ]
3617
+ [onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
3898
3618
  );
3899
3619
  const getRowFocusHandler = useCallback9(
3900
3620
  (rowId) => () => {
@@ -3952,16 +3672,7 @@ function Component(props, apiRef) {
3952
3672
  justifyContent: "space-between",
3953
3673
  alignItems: "center"
3954
3674
  },
3955
- !!checkboxSelection && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React23.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ React23.createElement(
3956
- Button_default,
3957
- {
3958
- size: "sm",
3959
- variant: "plain",
3960
- color: "danger",
3961
- onClick: onTotalSelect
3962
- },
3963
- "Cancel"
3964
- ))),
3675
+ !!checkboxSelection && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React23.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ React23.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
3965
3676
  Toolbar && /* @__PURE__ */ React23.createElement(Toolbar, { ...toolbarProps || {} })
3966
3677
  ),
3967
3678
  /* @__PURE__ */ React23.createElement(
@@ -3975,7 +3686,8 @@ function Component(props, apiRef) {
3975
3686
  boxShadow: "sm",
3976
3687
  borderRadius: "sm",
3977
3688
  "--DataTableSheet-width": parentRef.current?.clientWidth + "px",
3978
- backgroundColor: "white"
3689
+ backgroundColor: "white",
3690
+ "--TableCell-cornerRadius": "0px"
3979
3691
  },
3980
3692
  className: [
3981
3693
  ...(parentRef.current?.scrollLeft || 0) > 0 ? ["ScrollableRight"] : [],
@@ -3984,12 +3696,30 @@ function Component(props, apiRef) {
3984
3696
  ref: parentRef,
3985
3697
  ...backgroundProps
3986
3698
  },
3987
- /* @__PURE__ */ React23.createElement(Table, { ...innerProps }, /* @__PURE__ */ React23.createElement("thead", null, /* @__PURE__ */ React23.createElement("tr", null, checkboxSelection && /* @__PURE__ */ React23.createElement(
3699
+ /* @__PURE__ */ React23.createElement(Table, { ...innerProps }, /* @__PURE__ */ React23.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ React23.createElement(
3700
+ "col",
3701
+ {
3702
+ style: {
3703
+ width: "40px"
3704
+ }
3705
+ }
3706
+ ), columns.map((c) => /* @__PURE__ */ React23.createElement(
3707
+ "col",
3708
+ {
3709
+ ref: c.tableColRef,
3710
+ key: `${c.field.toString()}_${c.width}`,
3711
+ style: {
3712
+ width: c.width
3713
+ }
3714
+ }
3715
+ ))), /* @__PURE__ */ React23.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ React23.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ React23.createElement(
3988
3716
  "th",
3989
3717
  {
3718
+ rowSpan: processedColumnGroups.maxLevel + 2,
3990
3719
  style: {
3991
3720
  width: "40px",
3992
- textAlign: "center"
3721
+ textAlign: "center",
3722
+ verticalAlign: "middle"
3993
3723
  }
3994
3724
  },
3995
3725
  /* @__PURE__ */ React23.createElement(
@@ -4002,16 +3732,52 @@ function Component(props, apiRef) {
4002
3732
  ...checkboxProps
4003
3733
  }
4004
3734
  )
4005
- ), columns.map((c, i) => /* @__PURE__ */ React23.createElement(
4006
- HeadCell2,
3735
+ ), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ React23.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.map((group, groupIndex) => {
3736
+ const nextGroup = levelGroups[groupIndex + 1];
3737
+ const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
3738
+ return /* @__PURE__ */ React23.createElement(Fragment2, { key: group.groupId }, /* @__PURE__ */ React23.createElement(
3739
+ "th",
3740
+ {
3741
+ colSpan: group.colspan,
3742
+ style: {
3743
+ textAlign: "center",
3744
+ fontWeight: "bold",
3745
+ verticalAlign: "middle"
3746
+ }
3747
+ },
3748
+ group.headerName ?? group.groupId
3749
+ ), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ React23.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
3750
+ }))), /* @__PURE__ */ React23.createElement("tr", null, !processedColumnGroups && checkboxSelection && /* @__PURE__ */ React23.createElement(
3751
+ "th",
4007
3752
  {
4008
- tableId,
4009
- key: `${c.field.toString()}_${i}`,
4010
- stickyHeader: props.stickyHeader,
4011
- editMode: !!c.isCellEditable,
4012
- onSortChange: handleSortChange,
4013
- ...c
4014
- }
3753
+ style: {
3754
+ width: "40px",
3755
+ textAlign: "center"
3756
+ }
3757
+ },
3758
+ /* @__PURE__ */ React23.createElement(
3759
+ RenderCheckbox,
3760
+ {
3761
+ onChange: onAllCheckboxChange,
3762
+ checked: isAllSelected,
3763
+ indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
3764
+ disabled: dataInPage.length > 0 && !selectableRowCount,
3765
+ ...checkboxProps
3766
+ }
3767
+ )
3768
+ ), columns.map((c, i) => (
3769
+ // @ts-ignore
3770
+ /* @__PURE__ */ React23.createElement(
3771
+ HeadCell2,
3772
+ {
3773
+ tableId,
3774
+ key: `${c.field.toString()}_${i}`,
3775
+ stickyHeader: props.stickyHeader,
3776
+ editMode: !!c.isCellEditable,
3777
+ onSortChange: handleSortChange,
3778
+ ...c
3779
+ }
3780
+ )
4015
3781
  )))), /* @__PURE__ */ React23.createElement(
4016
3782
  VirtualizedTableBody,
4017
3783
  {
@@ -4118,15 +3884,7 @@ var DataTable = forwardRef7(Component);
4118
3884
  DataTable.displayName = "DataTable";
4119
3885
 
4120
3886
  // src/components/DateRangePicker/DateRangePicker.tsx
4121
- import React24, {
4122
- forwardRef as forwardRef8,
4123
- useCallback as useCallback10,
4124
- useEffect as useEffect6,
4125
- useImperativeHandle as useImperativeHandle3,
4126
- useMemo as useMemo9,
4127
- useRef as useRef5,
4128
- useState as useState7
4129
- } from "react";
3887
+ import React24, { forwardRef as forwardRef8, useCallback as useCallback10, useEffect as useEffect6, useImperativeHandle as useImperativeHandle3, useMemo as useMemo9, useRef as useRef5, useState as useState7 } from "react";
4130
3888
  import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
4131
3889
  import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
4132
3890
  import { styled as styled13, useThemeProps as useThemeProps5 } from "@mui/joy";
@@ -4138,9 +3896,7 @@ var CalendarButton2 = styled13(IconButton_default, {
4138
3896
  "&:focus": {
4139
3897
  "--Icon-color": "currentColor",
4140
3898
  outlineOffset: `${theme.getCssVar("focus-thickness")}`,
4141
- outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
4142
- "palette-focusVisible"
4143
- )}`
3899
+ outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
4144
3900
  }
4145
3901
  }));
4146
3902
  var StyledPopper2 = styled13(Popper3, {
@@ -4177,10 +3933,7 @@ var validValueFormat2 = (value, format) => {
4177
3933
  if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
4178
3934
  return false;
4179
3935
  }
4180
- const formattedValue = formatValueString2(
4181
- [parsedDate1, parsedDate2],
4182
- format
4183
- );
3936
+ const formattedValue = formatValueString2([parsedDate1, parsedDate2], format);
4184
3937
  if (value !== formattedValue) {
4185
3938
  return false;
4186
3939
  }
@@ -4232,287 +3985,263 @@ var parseDates = (str, format) => {
4232
3985
  var formatToPattern2 = (format) => {
4233
3986
  return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
4234
3987
  };
4235
- var TextMaskAdapter5 = React24.forwardRef(
4236
- function TextMaskAdapter6(props, ref) {
4237
- const { onChange, format, ...other } = props;
4238
- return /* @__PURE__ */ React24.createElement(
4239
- IMaskInput2,
4240
- {
4241
- ...other,
4242
- inputRef: ref,
4243
- onAccept: (value) => onChange({ target: { name: props.name, value } }),
4244
- mask: Date,
4245
- pattern: formatToPattern2(format),
4246
- blocks: {
4247
- D: {
4248
- mask: IMask2.MaskedRange,
4249
- from: 1,
4250
- to: 31,
4251
- maxLength: 2
4252
- },
4253
- M: {
4254
- mask: IMask2.MaskedRange,
4255
- from: 1,
4256
- to: 12,
4257
- maxLength: 2
4258
- },
4259
- Y: {
4260
- mask: IMask2.MaskedRange,
4261
- from: 1900,
4262
- to: 9999
4263
- }
3988
+ var TextMaskAdapter5 = React24.forwardRef(function TextMaskAdapter6(props, ref) {
3989
+ const { onChange, format, ...other } = props;
3990
+ return /* @__PURE__ */ React24.createElement(
3991
+ IMaskInput2,
3992
+ {
3993
+ ...other,
3994
+ inputRef: ref,
3995
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
3996
+ mask: Date,
3997
+ pattern: formatToPattern2(format),
3998
+ blocks: {
3999
+ D: {
4000
+ mask: IMask2.MaskedRange,
4001
+ from: 1,
4002
+ to: 31,
4003
+ maxLength: 2
4264
4004
  },
4265
- format: (dates) => formatValueString2(dates, format),
4266
- parse: (str) => parseDates(str, format),
4267
- autofix: "pad",
4268
- overwrite: true
4269
- }
4270
- );
4271
- }
4272
- );
4273
- var DateRangePicker = forwardRef8(
4274
- (inProps, ref) => {
4275
- const props = useThemeProps5({ props: inProps, name: "DateRangePicker" });
4276
- const {
4277
- onChange,
4278
- disabled,
4279
- label,
4280
- error,
4281
- helperText,
4282
- minDate,
4283
- maxDate,
4284
- disableFuture,
4285
- disablePast,
4286
- required,
4287
- // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
4288
- sx,
4289
- className,
4290
- format = "YYYY/MM/DD",
4291
- displayFormat = "YYYY/MM/DD",
4292
- size,
4293
- inputReadOnly,
4294
- hideClearButton,
4295
- readOnly,
4296
- ...innerProps
4297
- } = props;
4298
- const innerRef = useRef5(null);
4299
- const buttonRef = useRef5(null);
4300
- const [value, setValue] = useControlledState(
4301
- props.value,
4302
- props.defaultValue || "",
4303
- useCallback10(
4304
- (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
4305
- [props.name, onChange]
4306
- )
4307
- );
4308
- const [displayValue, setDisplayValue] = useState7(
4309
- () => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
4310
- );
4311
- const [anchorEl, setAnchorEl] = useState7(null);
4312
- const open = Boolean(anchorEl);
4313
- const calendarValue = useMemo9(
4314
- () => value ? parseDates(value, format) : void 0,
4315
- [value, format]
4316
- );
4317
- useEffect6(() => {
4318
- if (value) {
4319
- try {
4320
- const dates = parseDates(value, format);
4321
- const newDisplayValue = formatValueString2(dates, displayFormat);
4322
- setDisplayValue(newDisplayValue);
4323
- } catch (error2) {
4005
+ M: {
4006
+ mask: IMask2.MaskedRange,
4007
+ from: 1,
4008
+ to: 12,
4009
+ maxLength: 2
4010
+ },
4011
+ Y: {
4012
+ mask: IMask2.MaskedRange,
4013
+ from: 1900,
4014
+ to: 9999
4324
4015
  }
4016
+ },
4017
+ format: (dates) => formatValueString2(dates, format),
4018
+ parse: (str) => parseDates(str, format),
4019
+ autofix: "pad",
4020
+ overwrite: true
4021
+ }
4022
+ );
4023
+ });
4024
+ var DateRangePicker = forwardRef8((inProps, ref) => {
4025
+ const props = useThemeProps5({ props: inProps, name: "DateRangePicker" });
4026
+ const {
4027
+ onChange,
4028
+ disabled,
4029
+ label,
4030
+ error,
4031
+ helperText,
4032
+ minDate,
4033
+ maxDate,
4034
+ disableFuture,
4035
+ disablePast,
4036
+ required,
4037
+ // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
4038
+ sx,
4039
+ className,
4040
+ format = "YYYY/MM/DD",
4041
+ displayFormat = "YYYY/MM/DD",
4042
+ size,
4043
+ inputReadOnly,
4044
+ hideClearButton,
4045
+ readOnly,
4046
+ ...innerProps
4047
+ } = props;
4048
+ const innerRef = useRef5(null);
4049
+ const buttonRef = useRef5(null);
4050
+ const [value, setValue] = useControlledState(
4051
+ props.value,
4052
+ props.defaultValue || "",
4053
+ useCallback10((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
4054
+ );
4055
+ const [displayValue, setDisplayValue] = useState7(
4056
+ () => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
4057
+ );
4058
+ const [anchorEl, setAnchorEl] = useState7(null);
4059
+ const open = Boolean(anchorEl);
4060
+ const calendarValue = useMemo9(
4061
+ () => value ? parseDates(value, format) : void 0,
4062
+ [value, format]
4063
+ );
4064
+ useEffect6(() => {
4065
+ if (value) {
4066
+ try {
4067
+ const dates = parseDates(value, format);
4068
+ const newDisplayValue = formatValueString2(dates, displayFormat);
4069
+ setDisplayValue(newDisplayValue);
4070
+ } catch (error2) {
4071
+ }
4072
+ } else {
4073
+ setDisplayValue("");
4074
+ }
4075
+ }, [displayFormat, value, format]);
4076
+ useEffect6(() => {
4077
+ if (!anchorEl) {
4078
+ innerRef.current?.blur();
4079
+ }
4080
+ }, [anchorEl, innerRef]);
4081
+ useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
4082
+ const handleChange = useCallback10(
4083
+ (event) => {
4084
+ const value2 = event.target.value;
4085
+ setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
4086
+ setValue(value2);
4087
+ },
4088
+ [displayFormat, format, setValue]
4089
+ );
4090
+ const handleDisplayInputChange = useCallback10(
4091
+ (event) => {
4092
+ if (event.target.value === "") {
4093
+ handleChange({
4094
+ target: {
4095
+ name: props.name,
4096
+ value: ""
4097
+ }
4098
+ });
4099
+ return;
4100
+ }
4101
+ const isValidDisplayValue = validValueFormat2(event.target.value, displayFormat);
4102
+ if (isValidDisplayValue) {
4103
+ const dates = parseDates(event.target.value, displayFormat);
4104
+ const formattedValue = formatValueString2(dates, format);
4105
+ handleChange({
4106
+ target: {
4107
+ name: props.name,
4108
+ value: formattedValue
4109
+ }
4110
+ });
4111
+ }
4112
+ },
4113
+ [displayFormat, format, handleChange, props.name]
4114
+ );
4115
+ const handleCalendarToggle = useCallback10(
4116
+ (event) => {
4117
+ setAnchorEl(anchorEl ? null : event.currentTarget);
4118
+ innerRef.current?.focus();
4119
+ },
4120
+ [anchorEl, setAnchorEl, innerRef]
4121
+ );
4122
+ const handleCalendarChange = useCallback10(
4123
+ ([date1, date2]) => {
4124
+ if (!date1 || !date2) return;
4125
+ const formattedValue = formatValueString2([date1, date2], format);
4126
+ if (props.value !== void 0) {
4127
+ onChange?.({ target: { name: props.name, value: formattedValue } });
4325
4128
  } else {
4326
- setDisplayValue("");
4129
+ setDisplayValue(formatValueString2([date1, date2], displayFormat));
4130
+ setValue(formattedValue);
4327
4131
  }
4328
- }, [displayFormat, value, format]);
4329
- useEffect6(() => {
4330
- if (!anchorEl) {
4331
- innerRef.current?.blur();
4132
+ setAnchorEl(null);
4133
+ },
4134
+ [props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
4135
+ );
4136
+ const handleInputMouseDown = useCallback10(
4137
+ (event) => {
4138
+ if (inputReadOnly) {
4139
+ event.preventDefault();
4140
+ buttonRef.current?.focus();
4332
4141
  }
4333
- }, [anchorEl, innerRef]);
4334
- useImperativeHandle3(ref, () => innerRef.current, [
4335
- innerRef
4336
- ]);
4337
- const handleChange = useCallback10(
4338
- (event) => {
4339
- const value2 = event.target.value;
4340
- setDisplayValue(
4341
- value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2
4342
- );
4343
- setValue(value2);
4344
- },
4345
- [displayFormat, format, setValue]
4346
- );
4347
- const handleDisplayInputChange = useCallback10(
4348
- (event) => {
4349
- if (event.target.value === "") {
4350
- handleChange({
4351
- target: {
4352
- name: props.name,
4353
- value: ""
4354
- }
4355
- });
4356
- return;
4357
- }
4358
- const isValidDisplayValue = validValueFormat2(
4359
- event.target.value,
4360
- displayFormat
4361
- );
4362
- if (isValidDisplayValue) {
4363
- const dates = parseDates(event.target.value, displayFormat);
4364
- const formattedValue = formatValueString2(dates, format);
4365
- handleChange({
4366
- target: {
4367
- name: props.name,
4368
- value: formattedValue
4142
+ },
4143
+ [inputReadOnly, buttonRef]
4144
+ );
4145
+ return /* @__PURE__ */ React24.createElement(DateRangePickerRoot, null, /* @__PURE__ */ React24.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
4146
+ Input_default,
4147
+ {
4148
+ ...innerProps,
4149
+ color: error ? "danger" : innerProps.color,
4150
+ ref,
4151
+ size,
4152
+ value: displayValue,
4153
+ onChange: handleDisplayInputChange,
4154
+ disabled,
4155
+ required,
4156
+ placeholder: `${displayFormat} - ${displayFormat}`,
4157
+ slotProps: {
4158
+ input: {
4159
+ component: TextMaskAdapter5,
4160
+ ref: innerRef,
4161
+ format: displayFormat,
4162
+ sx: {
4163
+ "&:hover": {
4164
+ cursor: inputReadOnly || readOnly ? "default" : "text"
4369
4165
  }
4370
- });
4371
- }
4372
- },
4373
- [displayFormat, format, handleChange, props.name]
4374
- );
4375
- const handleCalendarToggle = useCallback10(
4376
- (event) => {
4377
- setAnchorEl(anchorEl ? null : event.currentTarget);
4378
- innerRef.current?.focus();
4379
- },
4380
- [anchorEl, setAnchorEl, innerRef]
4381
- );
4382
- const handleCalendarChange = useCallback10(
4383
- ([date1, date2]) => {
4384
- if (!date1 || !date2) return;
4385
- const formattedValue = formatValueString2([date1, date2], format);
4386
- if (props.value !== void 0) {
4387
- onChange?.({ target: { name: props.name, value: formattedValue } });
4388
- } else {
4389
- setDisplayValue(
4390
- formatValueString2([date1, date2], displayFormat)
4391
- );
4392
- setValue(formattedValue);
4166
+ },
4167
+ onMouseDown: handleInputMouseDown
4393
4168
  }
4394
- setAnchorEl(null);
4395
4169
  },
4396
- [
4397
- props.value,
4398
- props.name,
4399
- onChange,
4400
- setValue,
4401
- setAnchorEl,
4402
- format,
4403
- displayFormat
4404
- ]
4405
- );
4406
- const handleInputMouseDown = useCallback10(
4407
- (event) => {
4408
- if (inputReadOnly) {
4409
- event.preventDefault();
4410
- buttonRef.current?.focus();
4170
+ error,
4171
+ className,
4172
+ sx,
4173
+ endDecorator: /* @__PURE__ */ React24.createElement(
4174
+ CalendarButton2,
4175
+ {
4176
+ ref: buttonRef,
4177
+ variant: "plain",
4178
+ onClick: readOnly ? void 0 : handleCalendarToggle,
4179
+ "aria-label": "Toggle Calendar",
4180
+ "aria-controls": "date-range-picker-popper",
4181
+ "aria-haspopup": "dialog",
4182
+ "aria-expanded": open,
4183
+ disabled
4184
+ },
4185
+ /* @__PURE__ */ React24.createElement(CalendarTodayIcon2, null)
4186
+ ),
4187
+ label,
4188
+ helperText,
4189
+ readOnly: readOnly || inputReadOnly
4190
+ }
4191
+ ), open && /* @__PURE__ */ React24.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React24.createElement(
4192
+ StyledPopper2,
4193
+ {
4194
+ id: "date-range-picker-popper",
4195
+ open: true,
4196
+ anchorEl,
4197
+ placement: "bottom-end",
4198
+ onMouseDown: (e) => e.preventDefault(),
4199
+ modifiers: [
4200
+ {
4201
+ name: "offset",
4202
+ options: {
4203
+ offset: [4, 4]
4204
+ }
4411
4205
  }
4412
- },
4413
- [inputReadOnly, buttonRef]
4414
- );
4415
- return /* @__PURE__ */ React24.createElement(DateRangePickerRoot, null, /* @__PURE__ */ React24.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
4416
- Input_default,
4206
+ ],
4207
+ "aria-label": "Calendar Tooltip",
4208
+ "aria-expanded": open
4209
+ },
4210
+ /* @__PURE__ */ React24.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React24.createElement(
4211
+ Calendar_default,
4417
4212
  {
4418
- ...innerProps,
4419
- color: error ? "danger" : innerProps.color,
4420
- ref,
4421
- size,
4422
- value: displayValue,
4423
- onChange: handleDisplayInputChange,
4424
- disabled,
4425
- required,
4426
- placeholder: `${displayFormat} - ${displayFormat}`,
4427
- slotProps: {
4428
- input: {
4429
- component: TextMaskAdapter5,
4430
- ref: innerRef,
4431
- format: displayFormat,
4432
- sx: {
4433
- "&:hover": {
4434
- cursor: inputReadOnly || readOnly ? "default" : "text"
4435
- }
4436
- },
4437
- onMouseDown: handleInputMouseDown
4438
- }
4439
- },
4440
- error,
4441
- className,
4442
- sx,
4443
- endDecorator: /* @__PURE__ */ React24.createElement(
4444
- CalendarButton2,
4445
- {
4446
- ref: buttonRef,
4447
- variant: "plain",
4448
- onClick: readOnly ? void 0 : handleCalendarToggle,
4449
- "aria-label": "Toggle Calendar",
4450
- "aria-controls": "date-range-picker-popper",
4451
- "aria-haspopup": "dialog",
4452
- "aria-expanded": open,
4453
- disabled
4454
- },
4455
- /* @__PURE__ */ React24.createElement(CalendarTodayIcon2, null)
4456
- ),
4457
- label,
4458
- helperText,
4459
- readOnly: readOnly || inputReadOnly
4213
+ rangeSelection: true,
4214
+ defaultValue: calendarValue,
4215
+ onChange: handleCalendarChange,
4216
+ minDate: minDate ? new Date(minDate) : void 0,
4217
+ maxDate: maxDate ? new Date(maxDate) : void 0,
4218
+ disableFuture,
4219
+ disablePast
4460
4220
  }
4461
- ), open && /* @__PURE__ */ React24.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React24.createElement(
4462
- StyledPopper2,
4221
+ ), !hideClearButton && /* @__PURE__ */ React24.createElement(
4222
+ DialogActions_default,
4463
4223
  {
4464
- id: "date-range-picker-popper",
4465
- open: true,
4466
- anchorEl,
4467
- placement: "bottom-end",
4468
- onMouseDown: (e) => e.preventDefault(),
4469
- modifiers: [
4470
- {
4471
- name: "offset",
4472
- options: {
4473
- offset: [4, 4]
4474
- }
4475
- }
4476
- ],
4477
- "aria-label": "Calendar Tooltip",
4478
- "aria-expanded": open
4479
- },
4480
- /* @__PURE__ */ React24.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React24.createElement(
4481
- Calendar_default,
4482
- {
4483
- rangeSelection: true,
4484
- defaultValue: calendarValue,
4485
- onChange: handleCalendarChange,
4486
- minDate: minDate ? new Date(minDate) : void 0,
4487
- maxDate: maxDate ? new Date(maxDate) : void 0,
4488
- disableFuture,
4489
- disablePast
4224
+ sx: {
4225
+ p: 1
4490
4226
  }
4491
- ), !hideClearButton && /* @__PURE__ */ React24.createElement(
4492
- DialogActions_default,
4227
+ },
4228
+ /* @__PURE__ */ React24.createElement(
4229
+ Button_default,
4493
4230
  {
4494
- sx: {
4495
- p: 1
4231
+ size,
4232
+ variant: "plain",
4233
+ color: "neutral",
4234
+ onClick: () => {
4235
+ setValue("");
4236
+ setDisplayValue("");
4237
+ setAnchorEl(null);
4496
4238
  }
4497
4239
  },
4498
- /* @__PURE__ */ React24.createElement(
4499
- Button_default,
4500
- {
4501
- size,
4502
- variant: "plain",
4503
- color: "neutral",
4504
- onClick: () => {
4505
- setValue("");
4506
- setDisplayValue("");
4507
- setAnchorEl(null);
4508
- }
4509
- },
4510
- "Clear"
4511
- )
4512
- ))
4513
- )))));
4514
- }
4515
- );
4240
+ "Clear"
4241
+ )
4242
+ ))
4243
+ )))));
4244
+ });
4516
4245
  DateRangePicker.displayName = "DateRangePicker";
4517
4246
 
4518
4247
  // src/components/DialogContent/DialogContent.tsx
@@ -4582,17 +4311,7 @@ var StyledDialogFrame = styled17(ModalDialog, {
4582
4311
  });
4583
4312
  var DialogFrame = React26.forwardRef((props, ref) => {
4584
4313
  const { title, children, actions, fullscreen, ...innerProps } = props;
4585
- return /* @__PURE__ */ React26.createElement(
4586
- StyledDialogFrame,
4587
- {
4588
- layout: fullscreen ? "fullscreen" : "center",
4589
- ref,
4590
- ...innerProps
4591
- },
4592
- /* @__PURE__ */ React26.createElement(DialogTitle_default, null, title),
4593
- /* @__PURE__ */ React26.createElement(DialogContent_default, null, children),
4594
- /* @__PURE__ */ React26.createElement(DialogActions_default, null, actions)
4595
- );
4314
+ return /* @__PURE__ */ React26.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...innerProps }, /* @__PURE__ */ React26.createElement(DialogTitle_default, null, title), /* @__PURE__ */ React26.createElement(DialogContent_default, null, children), /* @__PURE__ */ React26.createElement(DialogActions_default, null, actions));
4596
4315
  });
4597
4316
  DialogFrame.displayName = "DialogFrame";
4598
4317
 
@@ -4631,11 +4350,7 @@ import React28, { useCallback as useCallback11 } from "react";
4631
4350
  import { Stack as Stack2 } from "@mui/joy";
4632
4351
  function CheckboxGroup(props) {
4633
4352
  const { id, label, options, value, onChange, hidden } = props;
4634
- const [internalValue, setInternalValue] = useControlledState(
4635
- value,
4636
- [],
4637
- onChange
4638
- );
4353
+ const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
4639
4354
  const handleCheckboxChange = useCallback11(
4640
4355
  (optionValue) => (event) => {
4641
4356
  const checked = event.target.checked;
@@ -4652,16 +4367,7 @@ function CheckboxGroup(props) {
4652
4367
  if (hidden) {
4653
4368
  return null;
4654
4369
  }
4655
- return /* @__PURE__ */ React28.createElement(Stack2, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React28.createElement(
4656
- Typography_default,
4657
- {
4658
- id,
4659
- level: "title-sm",
4660
- component: "label",
4661
- textColor: "text.tertiary"
4662
- },
4663
- label
4664
- ), options.map((option) => /* @__PURE__ */ React28.createElement(
4370
+ return /* @__PURE__ */ React28.createElement(Stack2, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React28.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), options.map((option) => /* @__PURE__ */ React28.createElement(
4665
4371
  Checkbox_default,
4666
4372
  {
4667
4373
  key: `${id}-${option.value}`,
@@ -4690,11 +4396,7 @@ RadioGroup.displayName = "RadioGroup";
4690
4396
  import { Stack as Stack3 } from "@mui/joy";
4691
4397
  function RadioGroup2(props) {
4692
4398
  const { id, label, options, value, onChange, hidden } = props;
4693
- const [internalValue, setInternalValue] = useControlledState(
4694
- value,
4695
- value ?? "",
4696
- onChange
4697
- );
4399
+ const [internalValue, setInternalValue] = useControlledState(value, value ?? "", onChange);
4698
4400
  const handleRadioChange = useCallback12(
4699
4401
  (event) => {
4700
4402
  const newValue = event.target.value;
@@ -4707,31 +4409,7 @@ function RadioGroup2(props) {
4707
4409
  if (hidden) {
4708
4410
  return null;
4709
4411
  }
4710
- return /* @__PURE__ */ React29.createElement(Stack3, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React29.createElement(Stack3, { spacing: 1 }, /* @__PURE__ */ React29.createElement(
4711
- Typography_default,
4712
- {
4713
- id,
4714
- level: "title-sm",
4715
- component: "label",
4716
- textColor: "text.tertiary"
4717
- },
4718
- label
4719
- )), /* @__PURE__ */ React29.createElement(
4720
- RadioGroup,
4721
- {
4722
- name: id,
4723
- value: internalValue?.toString(),
4724
- onChange: handleRadioChange
4725
- },
4726
- options.map((option) => /* @__PURE__ */ React29.createElement(
4727
- Radio,
4728
- {
4729
- key: `${id}-${option.value}`,
4730
- value: option.value.toString(),
4731
- label: option.label
4732
- }
4733
- ))
4734
- ));
4412
+ return /* @__PURE__ */ React29.createElement(Stack3, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React29.createElement(Stack3, { spacing: 1 }, /* @__PURE__ */ React29.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label)), /* @__PURE__ */ React29.createElement(RadioGroup, { name: id, value: internalValue?.toString(), onChange: handleRadioChange }, options.map((option) => /* @__PURE__ */ React29.createElement(Radio, { key: `${id}-${option.value}`, value: option.value.toString(), label: option.label }))));
4735
4413
  }
4736
4414
  RadioGroup2.displayName = "RadioGroup";
4737
4415
 
@@ -4754,11 +4432,7 @@ function DateRange(props) {
4754
4432
  inputReadOnly,
4755
4433
  hideClearButton
4756
4434
  } = props;
4757
- const [internalValue, setInternalValue] = useControlledState(
4758
- value,
4759
- null,
4760
- onChange
4761
- );
4435
+ const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
4762
4436
  const [selectedOption, setSelectedOption] = useState8("all-time");
4763
4437
  const dateRangeOptions = useMemo10(
4764
4438
  () => [
@@ -4787,28 +4461,19 @@ function DateRange(props) {
4787
4461
  case "this-month": {
4788
4462
  const startOfMonth = new Date(currentYear, currentMonth, 1);
4789
4463
  const endOfMonth = new Date(currentYear, currentMonth + 1, 0);
4790
- return [
4791
- formatDate(startOfMonth),
4792
- formatDate(endOfMonth)
4793
- ];
4464
+ return [formatDate(startOfMonth), formatDate(endOfMonth)];
4794
4465
  }
4795
4466
  case "this-year": {
4796
4467
  const startOfYear = new Date(currentYear, 0, 1);
4797
4468
  const endOfYear = new Date(currentYear, 11, 31);
4798
- return [
4799
- formatDate(startOfYear),
4800
- formatDate(endOfYear)
4801
- ];
4469
+ return [formatDate(startOfYear), formatDate(endOfYear)];
4802
4470
  }
4803
4471
  case "last-month": {
4804
4472
  const lastMonthYear = currentMonth === 0 ? currentYear - 1 : currentYear;
4805
4473
  const lastMonth = currentMonth === 0 ? 11 : currentMonth - 1;
4806
4474
  const startOfLastMonth = new Date(lastMonthYear, lastMonth, 1);
4807
4475
  const endOfLastMonth = new Date(lastMonthYear, lastMonth + 1, 0);
4808
- return [
4809
- formatDate(startOfLastMonth),
4810
- formatDate(endOfLastMonth)
4811
- ];
4476
+ return [formatDate(startOfLastMonth), formatDate(endOfLastMonth)];
4812
4477
  }
4813
4478
  case "custom":
4814
4479
  return internalValue;
@@ -4871,31 +4536,7 @@ function DateRange(props) {
4871
4536
  if (hidden) {
4872
4537
  return null;
4873
4538
  }
4874
- return /* @__PURE__ */ React30.createElement(Stack4, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React30.createElement(
4875
- Typography_default,
4876
- {
4877
- id,
4878
- level: "title-sm",
4879
- component: "label",
4880
- textColor: "text.tertiary"
4881
- },
4882
- label
4883
- ), /* @__PURE__ */ React30.createElement(
4884
- RadioGroup,
4885
- {
4886
- name: `${id}-options`,
4887
- value: selectedOption,
4888
- onChange: handleOptionChange
4889
- },
4890
- dateRangeOptions.map((option) => /* @__PURE__ */ React30.createElement(
4891
- Radio,
4892
- {
4893
- key: `${id}-${option.value}`,
4894
- value: option.value,
4895
- label: option.label
4896
- }
4897
- ))
4898
- ), selectedOption === "custom" && /* @__PURE__ */ React30.createElement(
4539
+ return /* @__PURE__ */ React30.createElement(Stack4, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React30.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ React30.createElement(RadioGroup, { name: `${id}-options`, value: selectedOption, onChange: handleOptionChange }, dateRangeOptions.map((option) => /* @__PURE__ */ React30.createElement(Radio, { key: `${id}-${option.value}`, value: option.value, label: option.label }))), selectedOption === "custom" && /* @__PURE__ */ React30.createElement(
4899
4540
  DateRangePicker,
4900
4541
  {
4901
4542
  value: customDateRangeValue,
@@ -4917,22 +4558,8 @@ DateRange.displayName = "DateRange";
4917
4558
  import React31, { useCallback as useCallback14 } from "react";
4918
4559
  import { Stack as Stack5 } from "@mui/joy";
4919
4560
  function CurrencyInput3(props) {
4920
- const {
4921
- id,
4922
- label,
4923
- value,
4924
- onChange,
4925
- hidden,
4926
- max,
4927
- placeholder,
4928
- useMinorUnit,
4929
- currency = "USD"
4930
- } = props;
4931
- const [internalValue, setInternalValue] = useControlledState(
4932
- value,
4933
- value,
4934
- onChange
4935
- );
4561
+ const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
4562
+ const [internalValue, setInternalValue] = useControlledState(value, value, onChange);
4936
4563
  const handleCurrencyChange = useCallback14(
4937
4564
  (event) => {
4938
4565
  const newValue = event.target.value;
@@ -4943,16 +4570,7 @@ function CurrencyInput3(props) {
4943
4570
  if (hidden) {
4944
4571
  return null;
4945
4572
  }
4946
- return /* @__PURE__ */ React31.createElement(Stack5, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React31.createElement(
4947
- Typography_default,
4948
- {
4949
- id,
4950
- level: "title-sm",
4951
- component: "label",
4952
- textColor: "text.tertiary"
4953
- },
4954
- label
4955
- ), /* @__PURE__ */ React31.createElement(
4573
+ return /* @__PURE__ */ React31.createElement(Stack5, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React31.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ React31.createElement(
4956
4574
  CurrencyInput,
4957
4575
  {
4958
4576
  value: internalValue,
@@ -4971,22 +4589,8 @@ CurrencyInput3.displayName = "CurrencyInput";
4971
4589
  import React32, { useCallback as useCallback15 } from "react";
4972
4590
  import { Stack as Stack6 } from "@mui/joy";
4973
4591
  function CurrencyRange(props) {
4974
- const {
4975
- id,
4976
- label,
4977
- value,
4978
- onChange,
4979
- hidden,
4980
- max,
4981
- placeholder,
4982
- useMinorUnit,
4983
- currency = "USD"
4984
- } = props;
4985
- const [internalValue, setInternalValue] = useControlledState(
4986
- value,
4987
- null,
4988
- onChange
4989
- );
4592
+ const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
4593
+ const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
4990
4594
  const minValue = internalValue?.[0];
4991
4595
  const maxValue = internalValue?.[1];
4992
4596
  const handleMinChange = useCallback15(
@@ -5020,16 +4624,7 @@ function CurrencyRange(props) {
5020
4624
  if (hidden) {
5021
4625
  return null;
5022
4626
  }
5023
- return /* @__PURE__ */ React32.createElement(Stack6, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React32.createElement(
5024
- Typography_default,
5025
- {
5026
- id,
5027
- level: "title-sm",
5028
- component: "label",
5029
- textColor: "text.tertiary"
5030
- },
5031
- label
5032
- ), /* @__PURE__ */ React32.createElement(Stack6, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ React32.createElement(
4627
+ return /* @__PURE__ */ React32.createElement(Stack6, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React32.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ React32.createElement(Stack6, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ React32.createElement(
5033
4628
  CurrencyInput,
5034
4629
  {
5035
4630
  label: "Minimum",
@@ -5066,120 +4661,117 @@ import { Stack as Stack7, Typography as Typography2 } from "@mui/joy";
5066
4661
  // src/components/PercentageInput/PercentageInput.tsx
5067
4662
  import React33, { useCallback as useCallback16, useMemo as useMemo11, useState as useState9 } from "react";
5068
4663
  import { NumericFormat as NumericFormat2 } from "react-number-format";
5069
- import { styled as styled19, useThemeProps as useThemeProps6 } from "@mui/joy";
5070
- var padDecimal = (value, decimalScale) => {
5071
- const [integer, decimal = ""] = `${value}`.split(".");
5072
- return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
5073
- };
5074
- var TextMaskAdapter7 = React33.forwardRef(
5075
- function TextMaskAdapter8(props, ref) {
5076
- const { onChange, min, max, ...innerProps } = props;
5077
- return /* @__PURE__ */ React33.createElement(
5078
- NumericFormat2,
5079
- {
5080
- ...innerProps,
5081
- onValueChange: ({ value }) => {
5082
- onChange?.({
5083
- target: {
5084
- name: props.name,
5085
- value
5086
- }
5087
- });
5088
- },
5089
- valueIsNumericString: true,
5090
- thousandSeparator: true,
5091
- suffix: "%",
5092
- getInputRef: ref,
5093
- allowNegative: true
5094
- }
5095
- );
5096
- }
5097
- );
4664
+ import { styled as styled19, useThemeProps as useThemeProps6 } from "@mui/joy";
4665
+ var padDecimal = (value, decimalScale) => {
4666
+ const [integer, decimal = ""] = `${value}`.split(".");
4667
+ return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
4668
+ };
4669
+ var TextMaskAdapter7 = React33.forwardRef(function TextMaskAdapter8(props, ref) {
4670
+ const { onChange, min, max, ...innerProps } = props;
4671
+ return /* @__PURE__ */ React33.createElement(
4672
+ NumericFormat2,
4673
+ {
4674
+ ...innerProps,
4675
+ onValueChange: ({ value }) => {
4676
+ onChange?.({
4677
+ target: {
4678
+ name: props.name,
4679
+ value
4680
+ }
4681
+ });
4682
+ },
4683
+ valueIsNumericString: true,
4684
+ thousandSeparator: true,
4685
+ suffix: "%",
4686
+ getInputRef: ref,
4687
+ allowNegative: true
4688
+ }
4689
+ );
4690
+ });
5098
4691
  var PercentageInputRoot = styled19(Input_default, {
5099
4692
  name: "PercentageInput",
5100
4693
  slot: "Root",
5101
4694
  overridesResolver: (props, styles) => styles.root
5102
4695
  })({});
5103
- var PercentageInput = React33.forwardRef(function PercentageInput2(inProps, ref) {
5104
- const props = useThemeProps6({ props: inProps, name: "PercentageInput" });
5105
- const {
5106
- name,
5107
- onChange,
5108
- label,
5109
- error,
5110
- helperText,
5111
- required,
5112
- disabled,
5113
- useMinorUnit,
5114
- maxDecimalScale = 0,
5115
- min,
5116
- max,
5117
- // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
5118
- sx,
5119
- className,
5120
- ...innerProps
5121
- } = props;
5122
- const [_value, setValue] = useControlledState(
5123
- props.value,
5124
- props.defaultValue,
5125
- useCallback16(
5126
- (value2) => onChange?.({ target: { name, value: value2 } }),
5127
- [onChange, name]
5128
- )
5129
- );
5130
- const [internalError, setInternalError] = useState9(
5131
- max && _value && _value > max || min && _value && _value < min
5132
- );
5133
- const value = useMemo11(() => {
5134
- if (_value && useMinorUnit) {
5135
- return _value / Math.pow(10, maxDecimalScale);
5136
- }
5137
- return _value;
5138
- }, [_value, useMinorUnit, maxDecimalScale]);
5139
- const handleChange = useCallback16(
5140
- (event) => {
5141
- if (event.target.value === "") {
5142
- setValue(void 0);
5143
- return;
5144
- }
5145
- const originalAmount = Number(event.target.value);
5146
- if (min && originalAmount < min || max && originalAmount > max) {
5147
- setInternalError(true);
5148
- } else {
5149
- setInternalError(false);
5150
- }
5151
- const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
5152
- setValue(amount);
5153
- },
5154
- [setValue, useMinorUnit, maxDecimalScale, min, max]
5155
- );
5156
- return /* @__PURE__ */ React33.createElement(
5157
- PercentageInputRoot,
5158
- {
5159
- ...innerProps,
5160
- ref,
5161
- value,
5162
- onChange: handleChange,
5163
- error: internalError || error,
5164
- disabled,
5165
- required,
5166
- color: internalError || error ? "danger" : props.color,
4696
+ var PercentageInput = React33.forwardRef(
4697
+ function PercentageInput2(inProps, ref) {
4698
+ const props = useThemeProps6({ props: inProps, name: "PercentageInput" });
4699
+ const {
4700
+ name,
4701
+ onChange,
5167
4702
  label,
4703
+ error,
5168
4704
  helperText,
5169
- slotProps: {
5170
- input: {
5171
- component: TextMaskAdapter7,
5172
- "aria-label": innerProps["aria-label"],
5173
- decimalScale: maxDecimalScale
4705
+ required,
4706
+ disabled,
4707
+ useMinorUnit,
4708
+ maxDecimalScale = 0,
4709
+ min,
4710
+ max,
4711
+ // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
4712
+ sx,
4713
+ className,
4714
+ ...innerProps
4715
+ } = props;
4716
+ const [_value, setValue] = useControlledState(
4717
+ props.value,
4718
+ props.defaultValue,
4719
+ useCallback16((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
4720
+ );
4721
+ const [internalError, setInternalError] = useState9(
4722
+ max && _value && _value > max || min && _value && _value < min
4723
+ );
4724
+ const value = useMemo11(() => {
4725
+ if (_value && useMinorUnit) {
4726
+ return _value / Math.pow(10, maxDecimalScale);
4727
+ }
4728
+ return _value;
4729
+ }, [_value, useMinorUnit, maxDecimalScale]);
4730
+ const handleChange = useCallback16(
4731
+ (event) => {
4732
+ if (event.target.value === "") {
4733
+ setValue(void 0);
4734
+ return;
5174
4735
  }
4736
+ const originalAmount = Number(event.target.value);
4737
+ if (min && originalAmount < min || max && originalAmount > max) {
4738
+ setInternalError(true);
4739
+ } else {
4740
+ setInternalError(false);
4741
+ }
4742
+ const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
4743
+ setValue(amount);
5175
4744
  },
5176
- sx: {
5177
- ...sx
5178
- },
5179
- className
5180
- }
5181
- );
5182
- });
4745
+ [setValue, useMinorUnit, maxDecimalScale, min, max]
4746
+ );
4747
+ return /* @__PURE__ */ React33.createElement(
4748
+ PercentageInputRoot,
4749
+ {
4750
+ ...innerProps,
4751
+ ref,
4752
+ value,
4753
+ onChange: handleChange,
4754
+ error: internalError || error,
4755
+ disabled,
4756
+ required,
4757
+ color: internalError || error ? "danger" : props.color,
4758
+ label,
4759
+ helperText,
4760
+ slotProps: {
4761
+ input: {
4762
+ component: TextMaskAdapter7,
4763
+ "aria-label": innerProps["aria-label"],
4764
+ decimalScale: maxDecimalScale
4765
+ }
4766
+ },
4767
+ sx: {
4768
+ ...sx
4769
+ },
4770
+ className
4771
+ }
4772
+ );
4773
+ }
4774
+ );
5183
4775
  PercentageInput.displayName = "PercentageInput";
5184
4776
 
5185
4777
  // src/components/FilterMenu/components/PercentageInput.tsx
@@ -5199,16 +4791,7 @@ var PercentageInput3 = ({
5199
4791
  if (hidden) {
5200
4792
  return null;
5201
4793
  }
5202
- return /* @__PURE__ */ React34.createElement(Stack7, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React34.createElement(
5203
- Typography2,
5204
- {
5205
- id,
5206
- level: "title-sm",
5207
- component: "label",
5208
- textColor: "text.tertiary"
5209
- },
5210
- label
5211
- ), /* @__PURE__ */ React34.createElement(
4794
+ return /* @__PURE__ */ React34.createElement(Stack7, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React34.createElement(Typography2, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ React34.createElement(
5212
4795
  PercentageInput,
5213
4796
  {
5214
4797
  value: _value,
@@ -5226,18 +4809,12 @@ var PercentageInput3 = ({
5226
4809
  import React35, { useCallback as useCallback17 } from "react";
5227
4810
  import { Stack as Stack8 } from "@mui/joy";
5228
4811
  function PercentageRange(props) {
5229
- const {
5230
- id,
5231
- label,
4812
+ const { id, label, value, onChange, hidden, useMinorUnit, maxDecimalScale, min, max } = props;
4813
+ const [internalValue, setInternalValue] = useControlledState(
5232
4814
  value,
5233
- onChange,
5234
- hidden,
5235
- useMinorUnit,
5236
- maxDecimalScale,
5237
- min,
5238
- max
5239
- } = props;
5240
- const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
4815
+ null,
4816
+ onChange
4817
+ );
5241
4818
  const minValue = internalValue?.[0];
5242
4819
  const maxValue = internalValue?.[1];
5243
4820
  const handleMinChange = useCallback17(
@@ -5267,16 +4844,7 @@ function PercentageRange(props) {
5267
4844
  if (hidden) {
5268
4845
  return null;
5269
4846
  }
5270
- return /* @__PURE__ */ React35.createElement(Stack8, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React35.createElement(
5271
- Typography_default,
5272
- {
5273
- id,
5274
- level: "title-sm",
5275
- component: "label",
5276
- textColor: "text.tertiary"
5277
- },
5278
- label
5279
- ), /* @__PURE__ */ React35.createElement(Stack8, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ React35.createElement(
4847
+ return /* @__PURE__ */ React35.createElement(Stack8, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React35.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ React35.createElement(Stack8, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ React35.createElement(
5280
4848
  PercentageInput,
5281
4849
  {
5282
4850
  label: "Minimum",
@@ -5313,11 +4881,7 @@ import React36, { useCallback as useCallback18 } from "react";
5313
4881
  import { Stack as Stack9 } from "@mui/joy";
5314
4882
  function Autocomplete2(props) {
5315
4883
  const { id, label, value, onChange, options, multiple, hidden, placeholder } = props;
5316
- const [internalValue, setInternalValue] = useControlledState(
5317
- value,
5318
- void 0,
5319
- onChange
5320
- );
4884
+ const [internalValue, setInternalValue] = useControlledState(value, void 0, onChange);
5321
4885
  const autocompleteValue = typeof internalValue === "string" || typeof internalValue === "number" ? String(internalValue) : void 0;
5322
4886
  const handleChange = useCallback18(
5323
4887
  (event) => {
@@ -5334,16 +4898,7 @@ function Autocomplete2(props) {
5334
4898
  if (hidden) {
5335
4899
  return null;
5336
4900
  }
5337
- return /* @__PURE__ */ React36.createElement(Stack9, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React36.createElement(
5338
- Typography_default,
5339
- {
5340
- id,
5341
- level: "title-sm",
5342
- component: "label",
5343
- textColor: "text.tertiary"
5344
- },
5345
- label
5346
- ), /* @__PURE__ */ React36.createElement(
4901
+ return /* @__PURE__ */ React36.createElement(Stack9, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ React36.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ React36.createElement(
5347
4902
  Autocomplete,
5348
4903
  {
5349
4904
  value: autocompleteValue,
@@ -5369,16 +4924,7 @@ var componentMap = {
5369
4924
  autocomplete: Autocomplete2
5370
4925
  };
5371
4926
  function FilterMenu(props) {
5372
- const {
5373
- filters,
5374
- values,
5375
- defaultValues,
5376
- resetValues = {},
5377
- onChange,
5378
- onClose,
5379
- useClear,
5380
- useReset
5381
- } = props;
4927
+ const { filters, values, defaultValues, resetValues = {}, onChange, onClose, useClear, useReset } = props;
5382
4928
  const [internalValues, setInternalValues] = useControlledState(
5383
4929
  values,
5384
4930
  defaultValues || {},
@@ -5428,37 +4974,13 @@ function FilterMenu(props) {
5428
4974
  }
5429
4975
  ) : null;
5430
4976
  }))),
5431
- /* @__PURE__ */ React37.createElement(DialogActions, { sx: { justifyContent: "space-between" } }, useClear && filters?.length === 1 && /* @__PURE__ */ React37.createElement(
5432
- Button2,
5433
- {
5434
- variant: "plain",
5435
- color: "neutral",
5436
- size: "md",
5437
- onClick: handleClear
5438
- },
5439
- "Clear"
5440
- ), useReset && !useClear && /* @__PURE__ */ React37.createElement(
5441
- Button2,
5442
- {
5443
- variant: "plain",
5444
- color: "neutral",
5445
- size: "md",
5446
- onClick: handleClear
5447
- },
5448
- "Reset"
5449
- ), /* @__PURE__ */ React37.createElement(Button2, { variant: "solid", color: "primary", size: "md", onClick: handleApply }, "Apply"))
4977
+ /* @__PURE__ */ React37.createElement(DialogActions, { sx: { justifyContent: "space-between" } }, useClear && filters?.length === 1 && /* @__PURE__ */ React37.createElement(Button2, { variant: "plain", color: "neutral", size: "md", onClick: handleClear }, "Clear"), useReset && !useClear && /* @__PURE__ */ React37.createElement(Button2, { variant: "plain", color: "neutral", size: "md", onClick: handleClear }, "Reset"), /* @__PURE__ */ React37.createElement(Button2, { variant: "solid", color: "primary", size: "md", onClick: handleApply }, "Apply"))
5450
4978
  );
5451
4979
  }
5452
4980
  FilterMenu.displayName = "FilterMenu";
5453
4981
 
5454
4982
  // src/components/Uploader/Uploader.tsx
5455
- import React38, {
5456
- useCallback as useCallback20,
5457
- useEffect as useEffect8,
5458
- useMemo as useMemo12,
5459
- useRef as useRef6,
5460
- useState as useState10
5461
- } from "react";
4983
+ import React38, { useCallback as useCallback20, useEffect as useEffect8, useMemo as useMemo12, useRef as useRef6, useState as useState10 } from "react";
5462
4984
  import { styled as styled20, Input as Input2 } from "@mui/joy";
5463
4985
  import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
5464
4986
  import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
@@ -5517,52 +5039,11 @@ var ClearIcon2 = styled20(MuiClearIcon, {
5517
5039
  width: "18px",
5518
5040
  height: "18px"
5519
5041
  }));
5520
- var UNITS = [
5521
- "byte",
5522
- "kilobyte",
5523
- "megabyte",
5524
- "gigabyte",
5525
- "terabyte",
5526
- "petabyte"
5527
- ];
5042
+ var UNITS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
5528
5043
  var ALL_EXTENSIONS_BY_TYPE = {
5529
- "image/*": [
5530
- ".jpeg",
5531
- ".jpg",
5532
- ".png",
5533
- ".gif",
5534
- ".bmp",
5535
- ".tiff",
5536
- ".svg",
5537
- ".webp",
5538
- ".heic",
5539
- ".ico"
5540
- ],
5541
- "audio/*": [
5542
- ".mp3",
5543
- ".wav",
5544
- ".flac",
5545
- ".aac",
5546
- ".ogg",
5547
- ".m4a",
5548
- ".wma",
5549
- ".aiff",
5550
- ".alac",
5551
- ".midi",
5552
- ".mp4"
5553
- ],
5554
- "video/*": [
5555
- ".mp4",
5556
- ".avi",
5557
- ".mkv",
5558
- ".mov",
5559
- ".wmv",
5560
- ".flv",
5561
- ".webm",
5562
- ".mpeg",
5563
- ".3gp",
5564
- ".m4v"
5565
- ]
5044
+ "image/*": [".jpeg", ".jpg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".heic", ".ico"],
5045
+ "audio/*": [".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".midi", ".mp4"],
5046
+ "video/*": [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".m4v"]
5566
5047
  };
5567
5048
  var getFileSize = (n) => {
5568
5049
  const i = n == 0 ? 0 : Math.floor(Math.log(n) / Math.log(1024));
@@ -5576,16 +5057,7 @@ var getFileSize = (n) => {
5576
5057
  };
5577
5058
  var Preview = (props) => {
5578
5059
  const { files, uploaded, onDelete } = props;
5579
- return /* @__PURE__ */ React38.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React38.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React38.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React38.createElement(UploadFileIcon, null), /* @__PURE__ */ React38.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ React38.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ React38.createElement(
5580
- Typography_default,
5581
- {
5582
- level: "body-xs",
5583
- fontWeight: "300",
5584
- lineHeight: "1.33",
5585
- textColor: "text.tertiary"
5586
- },
5587
- getFileSize(file.size)
5588
- )), /* @__PURE__ */ React38.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React38.createElement(ClearIcon2, null))))));
5060
+ return /* @__PURE__ */ React38.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React38.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React38.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React38.createElement(UploadFileIcon, null), /* @__PURE__ */ React38.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ React38.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ React38.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ React38.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React38.createElement(ClearIcon2, null))))));
5589
5061
  };
5590
5062
  var UploaderRoot = styled20(Stack_default, {
5591
5063
  name: "Uploader",
@@ -5597,31 +5069,27 @@ var FileDropZone = styled20(Sheet_default, {
5597
5069
  name: "Uploader",
5598
5070
  slot: "dropZone",
5599
5071
  shouldForwardProp: (prop) => prop !== "error"
5600
- })(
5601
- ({ theme, state, error }) => ({
5602
- width: "100%",
5603
- display: "flex",
5604
- flexDirection: "column",
5605
- justifyContent: "center",
5606
- alignItems: "center",
5607
- padding: theme.spacing(5),
5608
- gap: theme.spacing(4),
5609
- cursor: "pointer",
5610
- backgroundColor: theme.palette.background.surface,
5611
- border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
5612
- })
5613
- );
5072
+ })(({ theme, state, error }) => ({
5073
+ width: "100%",
5074
+ display: "flex",
5075
+ flexDirection: "column",
5076
+ justifyContent: "center",
5077
+ alignItems: "center",
5078
+ padding: theme.spacing(5),
5079
+ gap: theme.spacing(4),
5080
+ cursor: "pointer",
5081
+ backgroundColor: theme.palette.background.surface,
5082
+ border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
5083
+ }));
5614
5084
  var UploaderIcon = styled20(MuiFileUploadIcon, {
5615
5085
  name: "Uploader",
5616
5086
  slot: "iconContainer",
5617
5087
  shouldForwardProp: (prop) => prop !== "error"
5618
- })(
5619
- ({ theme, state, error }) => ({
5620
- color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
5621
- width: "32px",
5622
- height: "32px"
5623
- })
5624
- );
5088
+ })(({ theme, state, error }) => ({
5089
+ color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
5090
+ width: "32px",
5091
+ height: "32px"
5092
+ }));
5625
5093
  var Uploader = React38.memo(
5626
5094
  (props) => {
5627
5095
  const {
@@ -5641,14 +5109,9 @@ var Uploader = React38.memo(
5641
5109
  const inputRef = useRef6(null);
5642
5110
  const [errorText, setErrorText] = useState10();
5643
5111
  const [files, setFiles] = useState10([]);
5644
- const [uploaded, setUploaded] = useState10(
5645
- props.uploaded || []
5646
- );
5112
+ const [uploaded, setUploaded] = useState10(props.uploaded || []);
5647
5113
  const [previewState, setPreviewState] = useState10("idle");
5648
- const accepts = useMemo12(
5649
- () => accept.split(",").map((accept2) => accept2.trim()),
5650
- [accept]
5651
- );
5114
+ const accepts = useMemo12(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
5652
5115
  const parsedAccepts = useMemo12(
5653
5116
  () => accepts.flatMap((type) => {
5654
5117
  if (["image/*", "video/*", "audio/*"].includes(type)) {
@@ -5660,15 +5123,11 @@ var Uploader = React38.memo(
5660
5123
  );
5661
5124
  const helperText = useMemo12(() => {
5662
5125
  const [allAcceptedTypes, acceptedTypes] = [
5663
- accepts.filter(
5664
- (accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
5665
- ).map((accept2) => {
5126
+ accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
5666
5127
  const [type] = accept2.split("/");
5667
5128
  return type.toLowerCase();
5668
5129
  }),
5669
- accepts.filter(
5670
- (accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)
5671
- ).map((accept2) => {
5130
+ accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
5672
5131
  const [extensionOrType, subType] = accept2.split("/");
5673
5132
  if (!subType) {
5674
5133
  return extensionOrType.toUpperCase().replace(".", "");
@@ -5685,16 +5144,11 @@ var Uploader = React38.memo(
5685
5144
  }
5686
5145
  helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
5687
5146
  if (maxCount) {
5688
- helperTexts.push(
5689
- `Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`
5690
- );
5147
+ helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
5691
5148
  }
5692
5149
  return helperTexts.join(", ");
5693
5150
  }, [accepts, maxFileTotalSize, maxCount]);
5694
- const error = useMemo12(
5695
- () => !!errorText || props.error,
5696
- [props.error, errorText]
5697
- );
5151
+ const error = useMemo12(() => !!errorText || props.error, [props.error, errorText]);
5698
5152
  const showDropZone = useMemo12(
5699
5153
  () => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
5700
5154
  [files, maxCount, uploaded]
@@ -5721,10 +5175,7 @@ var Uploader = React38.memo(
5721
5175
  }
5722
5176
  });
5723
5177
  }
5724
- const totalFileSize = [...files, ...uploads].reduce(
5725
- (acc, file) => acc + file.size,
5726
- 0
5727
- );
5178
+ const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
5728
5179
  if (totalFileSize > maxFileTotalSize) {
5729
5180
  throw new Error(`Total File size exceeded the maximum limit.`);
5730
5181
  }
@@ -5745,34 +5196,15 @@ var Uploader = React38.memo(
5745
5196
  setErrorText(err.message);
5746
5197
  }
5747
5198
  },
5748
- [
5749
- files,
5750
- uploaded,
5751
- maxCount,
5752
- parsedAccepts,
5753
- maxFileSize,
5754
- maxFileTotalSize,
5755
- name,
5756
- onChange
5757
- ]
5199
+ [files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
5758
5200
  );
5759
5201
  useEffect8(() => {
5760
5202
  if (!dropZoneRef.current || disabled) {
5761
5203
  return;
5762
5204
  }
5763
5205
  let cleanup;
5764
- Promise.all([
5765
- esmFiles.combine,
5766
- esmFiles.adapter,
5767
- esmFiles.file,
5768
- esmFiles.preventUnhandled
5769
- ]).then(
5770
- ([
5771
- combineModule,
5772
- adapterModule,
5773
- fileModule,
5774
- preventUnhandledModule
5775
- ]) => {
5206
+ Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
5207
+ ([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
5776
5208
  const { combine } = combineModule;
5777
5209
  const { dropTargetForExternal, monitorForExternal } = adapterModule;
5778
5210
  const { containsFiles, getFiles } = fileModule;
@@ -5807,9 +5239,7 @@ var Uploader = React38.memo(
5807
5239
  useEffect8(() => {
5808
5240
  if (inputRef.current && minCount) {
5809
5241
  if (files.length < minCount) {
5810
- inputRef.current.setCustomValidity(
5811
- `At least ${minCount} files are required.`
5812
- );
5242
+ inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
5813
5243
  } else {
5814
5244
  inputRef.current.setCustomValidity("");
5815
5245
  }
@@ -5835,9 +5265,7 @@ var Uploader = React38.memo(
5835
5265
  return current.filter((file) => file !== deletedFile);
5836
5266
  });
5837
5267
  } else {
5838
- setUploaded(
5839
- (uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id)
5840
- );
5268
+ setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
5841
5269
  onDelete?.(deletedFile);
5842
5270
  }
5843
5271
  setErrorText(void 0);
@@ -5863,9 +5291,7 @@ var Uploader = React38.memo(
5863
5291
  required: !!minCount,
5864
5292
  onInvalid: (e) => {
5865
5293
  if (minCount && files.length < minCount) {
5866
- setErrorText(
5867
- `Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`
5868
- );
5294
+ setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
5869
5295
  }
5870
5296
  },
5871
5297
  slotProps: {
@@ -5881,25 +5307,7 @@ var Uploader = React38.memo(
5881
5307
  }
5882
5308
  )
5883
5309
  );
5884
- return /* @__PURE__ */ React38.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React38.createElement(
5885
- FormControl_default,
5886
- {
5887
- size,
5888
- error: !!(error || errorText),
5889
- disabled,
5890
- required: !!minCount
5891
- },
5892
- label && /* @__PURE__ */ React38.createElement(FormLabel_default, null, label),
5893
- uploader,
5894
- /* @__PURE__ */ React38.createElement(FormHelperText_default, null, /* @__PURE__ */ React38.createElement(Stack_default, null, errorText && /* @__PURE__ */ React38.createElement("div", null, errorText), /* @__PURE__ */ React38.createElement("div", null, helperText)))
5895
- ), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React38.createElement(
5896
- Preview,
5897
- {
5898
- files,
5899
- uploaded,
5900
- onDelete: handleDeleteFile
5901
- }
5902
- ));
5310
+ return /* @__PURE__ */ React38.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React38.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ React38.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ React38.createElement(FormHelperText_default, null, /* @__PURE__ */ React38.createElement(Stack_default, null, errorText && /* @__PURE__ */ React38.createElement("div", null, errorText), /* @__PURE__ */ React38.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React38.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
5903
5311
  }
5904
5312
  );
5905
5313
  Uploader.displayName = "Uploader";
@@ -5909,10 +5317,7 @@ import { Grid } from "@mui/joy";
5909
5317
 
5910
5318
  // src/components/IconMenuButton/IconMenuButton.tsx
5911
5319
  import React39 from "react";
5912
- import {
5913
- MenuButton as JoyMenuButton2,
5914
- IconButton as JoyIconButton2
5915
- } from "@mui/joy";
5320
+ import { MenuButton as JoyMenuButton2, IconButton as JoyIconButton2 } from "@mui/joy";
5916
5321
  function IconMenuButton(props) {
5917
5322
  const {
5918
5323
  size,
@@ -5956,15 +5361,7 @@ function IconMenuButton(props) {
5956
5361
  }
5957
5362
  },
5958
5363
  icon
5959
- ), /* @__PURE__ */ React39.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React39.createElement(
5960
- MenuItem,
5961
- {
5962
- key: i.text,
5963
- component: i.component,
5964
- ...i.componentProps ?? {}
5965
- },
5966
- i.text
5967
- ))));
5364
+ ), /* @__PURE__ */ React39.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React39.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
5968
5365
  }
5969
5366
  IconMenuButton.displayName = "IconMenuButton";
5970
5367
 
@@ -5998,61 +5395,39 @@ var Markdown = (props) => {
5998
5395
  if (!rehypeAccent2) {
5999
5396
  return null;
6000
5397
  }
6001
- return /* @__PURE__ */ React40.createElement(
6002
- Typography,
5398
+ return /* @__PURE__ */ React40.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React40.createElement(
5399
+ Suspense,
6003
5400
  {
6004
- component: "div",
6005
- color,
6006
- textColor,
6007
- level: defaultLevel,
6008
- ...innerProps
5401
+ fallback: fallback || /* @__PURE__ */ React40.createElement(Typography, null, /* @__PURE__ */ React40.createElement(Skeleton, null, content || ""))
6009
5402
  },
6010
5403
  /* @__PURE__ */ React40.createElement(
6011
- Suspense,
5404
+ LazyReactMarkdown,
6012
5405
  {
6013
- fallback: fallback || /* @__PURE__ */ React40.createElement(Typography, null, /* @__PURE__ */ React40.createElement(Skeleton, null, content || ""))
6014
- },
6015
- /* @__PURE__ */ React40.createElement(
6016
- LazyReactMarkdown,
6017
- {
6018
- ...markdownOptions,
6019
- children: content,
6020
- rehypePlugins: [[rehypeAccent2, { accentColor }]],
6021
- remarkPlugins: [remarkGfm],
6022
- components: {
6023
- h1: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h1" }, children),
6024
- h2: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h2" }, children),
6025
- h3: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h3" }, children),
6026
- h4: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h4" }, children),
6027
- p: ({ children, node }) => /* @__PURE__ */ React40.createElement(
6028
- Typography,
6029
- {
6030
- color,
6031
- textColor,
6032
- level: defaultLevel,
6033
- ...node?.properties
6034
- },
6035
- children
6036
- ),
6037
- a: ({ children, href }) => /* @__PURE__ */ React40.createElement(Link2, { href, target: defaultLinkAction }, children),
6038
- hr: () => /* @__PURE__ */ React40.createElement(Divider, null),
6039
- b: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { fontWeight: boldFontWeight }, children),
6040
- strong: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { fontWeight: boldFontWeight }, children),
6041
- ...markdownOptions?.components
6042
- }
5406
+ ...markdownOptions,
5407
+ children: content,
5408
+ rehypePlugins: [[rehypeAccent2, { accentColor }]],
5409
+ remarkPlugins: [remarkGfm],
5410
+ components: {
5411
+ h1: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h1" }, children),
5412
+ h2: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h2" }, children),
5413
+ h3: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h3" }, children),
5414
+ h4: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: "h4" }, children),
5415
+ p: ({ children, node }) => /* @__PURE__ */ React40.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
5416
+ a: ({ children, href }) => /* @__PURE__ */ React40.createElement(Link2, { href, target: defaultLinkAction }, children),
5417
+ hr: () => /* @__PURE__ */ React40.createElement(Divider, null),
5418
+ b: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { fontWeight: boldFontWeight }, children),
5419
+ strong: ({ children }) => /* @__PURE__ */ React40.createElement(Typography, { fontWeight: boldFontWeight }, children),
5420
+ ...markdownOptions?.components
6043
5421
  }
6044
- )
5422
+ }
6045
5423
  )
6046
- );
5424
+ ));
6047
5425
  };
6048
5426
  Markdown.displayName = "Markdown";
6049
5427
 
6050
5428
  // src/components/MenuButton/MenuButton.tsx
6051
5429
  import React41 from "react";
6052
- import {
6053
- MenuButton as JoyMenuButton3,
6054
- Button as JoyButton2
6055
- } from "@mui/joy";
5430
+ import { MenuButton as JoyMenuButton3, Button as JoyButton2 } from "@mui/joy";
6056
5431
  import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
6057
5432
  function MenuButton(props) {
6058
5433
  const {
@@ -6099,27 +5474,12 @@ function MenuButton(props) {
6099
5474
  endDecorator: showIcon ? /* @__PURE__ */ React41.createElement(React41.Fragment, null, endDecorator, /* @__PURE__ */ React41.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React41.createElement(React41.Fragment, null, endDecorator)
6100
5475
  },
6101
5476
  buttonText
6102
- ), /* @__PURE__ */ React41.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React41.createElement(
6103
- MenuItem,
6104
- {
6105
- key: i.text,
6106
- component: i.component,
6107
- ...i.componentProps ?? {}
6108
- },
6109
- i.text
6110
- ))));
5477
+ ), /* @__PURE__ */ React41.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React41.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
6111
5478
  }
6112
5479
  MenuButton.displayName = "MenuButton";
6113
5480
 
6114
5481
  // src/components/MonthPicker/MonthPicker.tsx
6115
- import React42, {
6116
- forwardRef as forwardRef9,
6117
- useCallback as useCallback21,
6118
- useEffect as useEffect10,
6119
- useImperativeHandle as useImperativeHandle4,
6120
- useRef as useRef7,
6121
- useState as useState12
6122
- } from "react";
5482
+ import React42, { forwardRef as forwardRef9, useCallback as useCallback21, useEffect as useEffect10, useImperativeHandle as useImperativeHandle4, useRef as useRef7, useState as useState12 } from "react";
6123
5483
  import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
6124
5484
  import { styled as styled21, useThemeProps as useThemeProps7 } from "@mui/joy";
6125
5485
  import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
@@ -6174,226 +5534,205 @@ function parseDate3(dateString, format) {
6174
5534
  const result = new Date(year, month, day);
6175
5535
  return result;
6176
5536
  }
6177
- var MonthPicker = forwardRef9(
6178
- (inProps, ref) => {
6179
- const props = useThemeProps7({ props: inProps, name: "MonthPicker" });
6180
- const {
6181
- onChange,
6182
- disabled,
6183
- label,
6184
- error,
6185
- helperText,
6186
- minDate,
6187
- maxDate,
6188
- disableFuture,
6189
- disablePast,
6190
- required,
6191
- // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
6192
- sx,
6193
- className,
6194
- /**
6195
- * NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
6196
- * @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
6197
- * @see https://github.com/Ecube-Labs/hds/pull/145
6198
- */
6199
- format = "YYYY/MM/DD",
6200
- displayFormat = "YYYY/MM",
6201
- size,
6202
- locale,
6203
- ...innerProps
6204
- } = props;
6205
- const innerRef = useRef7(null);
6206
- const buttonRef = useRef7(null);
6207
- const [value, setValue, isControlled] = useControlledState(
6208
- props.value,
6209
- props.defaultValue || "",
6210
- useCallback21(
6211
- (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
6212
- [props.name, onChange]
6213
- )
6214
- );
6215
- const getFormattedDisplayValue = useCallback21(
6216
- (inputValue) => {
6217
- if (!inputValue) return "";
6218
- try {
6219
- return formatValueString3(
6220
- parseDate3(inputValue, format),
6221
- displayFormat,
6222
- locale
6223
- );
6224
- } catch (e) {
6225
- return inputValue;
6226
- }
6227
- },
6228
- [format, displayFormat, locale]
6229
- );
6230
- const [displayValue, setDisplayValue] = useState12(
6231
- () => getFormattedDisplayValue(value)
6232
- );
6233
- const [anchorEl, setAnchorEl] = useState12(null);
6234
- const open = Boolean(anchorEl);
6235
- useEffect10(() => {
6236
- if (!anchorEl) {
6237
- innerRef.current?.blur();
5537
+ var MonthPicker = forwardRef9((inProps, ref) => {
5538
+ const props = useThemeProps7({ props: inProps, name: "MonthPicker" });
5539
+ const {
5540
+ onChange,
5541
+ disabled,
5542
+ label,
5543
+ error,
5544
+ helperText,
5545
+ minDate,
5546
+ maxDate,
5547
+ disableFuture,
5548
+ disablePast,
5549
+ required,
5550
+ // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
5551
+ sx,
5552
+ className,
5553
+ /**
5554
+ * NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
5555
+ * @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
5556
+ * @see https://github.com/Ecube-Labs/hds/pull/145
5557
+ */
5558
+ format = "YYYY/MM/DD",
5559
+ displayFormat = "YYYY/MM",
5560
+ size,
5561
+ locale,
5562
+ ...innerProps
5563
+ } = props;
5564
+ const innerRef = useRef7(null);
5565
+ const buttonRef = useRef7(null);
5566
+ const [value, setValue, isControlled] = useControlledState(
5567
+ props.value,
5568
+ props.defaultValue || "",
5569
+ useCallback21((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
5570
+ );
5571
+ const getFormattedDisplayValue = useCallback21(
5572
+ (inputValue) => {
5573
+ if (!inputValue) return "";
5574
+ try {
5575
+ return formatValueString3(parseDate3(inputValue, format), displayFormat, locale);
5576
+ } catch (e) {
5577
+ return inputValue;
5578
+ }
5579
+ },
5580
+ [format, displayFormat, locale]
5581
+ );
5582
+ const [displayValue, setDisplayValue] = useState12(() => getFormattedDisplayValue(value));
5583
+ const [anchorEl, setAnchorEl] = useState12(null);
5584
+ const open = Boolean(anchorEl);
5585
+ useEffect10(() => {
5586
+ if (!anchorEl) {
5587
+ innerRef.current?.blur();
5588
+ }
5589
+ }, [anchorEl, innerRef]);
5590
+ useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
5591
+ useEffect10(() => {
5592
+ setDisplayValue(getFormattedDisplayValue(value));
5593
+ }, [value, getFormattedDisplayValue]);
5594
+ const handleChange = useCallback21(
5595
+ (event) => {
5596
+ const newValue = event.target.value;
5597
+ setValue(newValue);
5598
+ if (!isControlled) {
5599
+ setDisplayValue(getFormattedDisplayValue(newValue));
6238
5600
  }
6239
- }, [anchorEl, innerRef]);
6240
- useImperativeHandle4(ref, () => innerRef.current, [
6241
- innerRef
6242
- ]);
6243
- useEffect10(() => {
6244
- setDisplayValue(getFormattedDisplayValue(value));
6245
- }, [value, getFormattedDisplayValue]);
6246
- const handleChange = useCallback21(
6247
- (event) => {
6248
- const newValue = event.target.value;
6249
- setValue(newValue);
6250
- if (!isControlled) {
6251
- setDisplayValue(getFormattedDisplayValue(newValue));
5601
+ },
5602
+ [setValue, getFormattedDisplayValue, isControlled]
5603
+ );
5604
+ const handleCalendarToggle = useCallback21(
5605
+ (event) => {
5606
+ setAnchorEl(anchorEl ? null : event.currentTarget);
5607
+ innerRef.current?.focus();
5608
+ },
5609
+ [anchorEl, setAnchorEl, innerRef]
5610
+ );
5611
+ const handleInputMouseDown = useCallback21(
5612
+ (event) => {
5613
+ event.preventDefault();
5614
+ buttonRef.current?.focus();
5615
+ },
5616
+ [buttonRef]
5617
+ );
5618
+ return /* @__PURE__ */ React42.createElement(MonthPickerRoot, null, /* @__PURE__ */ React42.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(
5619
+ Input_default,
5620
+ {
5621
+ ...innerProps,
5622
+ color: error ? "danger" : innerProps.color,
5623
+ ref: innerRef,
5624
+ size,
5625
+ value: displayValue,
5626
+ placeholder: displayFormat,
5627
+ disabled,
5628
+ required,
5629
+ slotProps: {
5630
+ input: {
5631
+ ref: innerRef,
5632
+ format: displayFormat,
5633
+ sx: {
5634
+ "&:hover": {
5635
+ cursor: "default"
5636
+ }
5637
+ },
5638
+ onMouseDown: handleInputMouseDown
6252
5639
  }
6253
5640
  },
6254
- [setValue, getFormattedDisplayValue, isControlled]
6255
- );
6256
- const handleCalendarToggle = useCallback21(
6257
- (event) => {
6258
- setAnchorEl(anchorEl ? null : event.currentTarget);
6259
- innerRef.current?.focus();
6260
- },
6261
- [anchorEl, setAnchorEl, innerRef]
6262
- );
6263
- const handleInputMouseDown = useCallback21(
6264
- (event) => {
6265
- event.preventDefault();
6266
- buttonRef.current?.focus();
5641
+ error,
5642
+ className,
5643
+ sx: {
5644
+ ...sx,
5645
+ // NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
5646
+ fontFamily: "monospace"
6267
5647
  },
6268
- [buttonRef]
6269
- );
6270
- return /* @__PURE__ */ React42.createElement(MonthPickerRoot, null, /* @__PURE__ */ React42.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(
6271
- Input_default,
6272
- {
6273
- ...innerProps,
6274
- color: error ? "danger" : innerProps.color,
6275
- ref: innerRef,
6276
- size,
6277
- value: displayValue,
6278
- placeholder: displayFormat,
6279
- disabled,
6280
- required,
6281
- slotProps: {
6282
- input: {
6283
- ref: innerRef,
6284
- format: displayFormat,
6285
- sx: {
6286
- "&:hover": {
6287
- cursor: "default"
6288
- }
6289
- },
6290
- onMouseDown: handleInputMouseDown
6291
- }
5648
+ endDecorator: /* @__PURE__ */ React42.createElement(
5649
+ IconButton_default,
5650
+ {
5651
+ ref: buttonRef,
5652
+ variant: "plain",
5653
+ onClick: handleCalendarToggle,
5654
+ "aria-label": "Toggle Calendar",
5655
+ "aria-controls": "month-picker-popper",
5656
+ "aria-haspopup": "dialog",
5657
+ "aria-expanded": open,
5658
+ disabled
6292
5659
  },
6293
- error,
6294
- className,
6295
- sx: {
6296
- ...sx,
6297
- // NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
6298
- fontFamily: "monospace"
5660
+ /* @__PURE__ */ React42.createElement(CalendarTodayIcon3, null)
5661
+ ),
5662
+ label,
5663
+ helperText
5664
+ }
5665
+ ), open && /* @__PURE__ */ React42.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React42.createElement(
5666
+ StyledPopper3,
5667
+ {
5668
+ id: "month-picker-popper",
5669
+ open: true,
5670
+ anchorEl,
5671
+ placement: "bottom-end",
5672
+ onMouseDown: (e) => e.preventDefault(),
5673
+ modifiers: [
5674
+ {
5675
+ name: "offset",
5676
+ options: {
5677
+ offset: [4, 4]
5678
+ }
5679
+ }
5680
+ ],
5681
+ "aria-label": "Calendar Tooltip",
5682
+ "aria-expanded": open
5683
+ },
5684
+ /* @__PURE__ */ React42.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React42.createElement(
5685
+ Calendar_default,
5686
+ {
5687
+ view: "month",
5688
+ views: ["month"],
5689
+ value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
5690
+ onChange: ([date]) => {
5691
+ handleChange({
5692
+ target: {
5693
+ name: props.name,
5694
+ value: formatValueString3(date, format, locale)
5695
+ }
5696
+ });
5697
+ setAnchorEl(null);
6299
5698
  },
6300
- endDecorator: /* @__PURE__ */ React42.createElement(
6301
- IconButton_default,
6302
- {
6303
- ref: buttonRef,
6304
- variant: "plain",
6305
- onClick: handleCalendarToggle,
6306
- "aria-label": "Toggle Calendar",
6307
- "aria-controls": "month-picker-popper",
6308
- "aria-haspopup": "dialog",
6309
- "aria-expanded": open,
6310
- disabled
6311
- },
6312
- /* @__PURE__ */ React42.createElement(CalendarTodayIcon3, null)
6313
- ),
6314
- label,
6315
- helperText
5699
+ minDate: minDate ? new Date(minDate) : void 0,
5700
+ maxDate: maxDate ? new Date(maxDate) : void 0,
5701
+ disableFuture,
5702
+ disablePast,
5703
+ locale
6316
5704
  }
6317
- ), open && /* @__PURE__ */ React42.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React42.createElement(
6318
- StyledPopper3,
5705
+ ), /* @__PURE__ */ React42.createElement(
5706
+ DialogActions_default,
6319
5707
  {
6320
- id: "month-picker-popper",
6321
- open: true,
6322
- anchorEl,
6323
- placement: "bottom-end",
6324
- onMouseDown: (e) => e.preventDefault(),
6325
- modifiers: [
6326
- {
6327
- name: "offset",
6328
- options: {
6329
- offset: [4, 4]
6330
- }
6331
- }
6332
- ],
6333
- "aria-label": "Calendar Tooltip",
6334
- "aria-expanded": open
5708
+ sx: {
5709
+ p: 1
5710
+ }
6335
5711
  },
6336
- /* @__PURE__ */ React42.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React42.createElement(
6337
- Calendar_default,
5712
+ /* @__PURE__ */ React42.createElement(
5713
+ Button_default,
6338
5714
  {
6339
- view: "month",
6340
- views: ["month"],
6341
- value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
6342
- onChange: ([date]) => {
5715
+ size,
5716
+ variant: "plain",
5717
+ color: "neutral",
5718
+ onClick: () => {
6343
5719
  handleChange({
6344
5720
  target: {
6345
5721
  name: props.name,
6346
- value: formatValueString3(date, format, locale)
5722
+ value: ""
6347
5723
  }
6348
5724
  });
6349
5725
  setAnchorEl(null);
6350
- },
6351
- minDate: minDate ? new Date(minDate) : void 0,
6352
- maxDate: maxDate ? new Date(maxDate) : void 0,
6353
- disableFuture,
6354
- disablePast,
6355
- locale
6356
- }
6357
- ), /* @__PURE__ */ React42.createElement(
6358
- DialogActions_default,
6359
- {
6360
- sx: {
6361
- p: 1
6362
5726
  }
6363
5727
  },
6364
- /* @__PURE__ */ React42.createElement(
6365
- Button_default,
6366
- {
6367
- size,
6368
- variant: "plain",
6369
- color: "neutral",
6370
- onClick: () => {
6371
- handleChange({
6372
- target: {
6373
- name: props.name,
6374
- value: ""
6375
- }
6376
- });
6377
- setAnchorEl(null);
6378
- }
6379
- },
6380
- "Clear"
6381
- )
6382
- ))
6383
- )))));
6384
- }
6385
- );
5728
+ "Clear"
5729
+ )
5730
+ ))
5731
+ )))));
5732
+ });
6386
5733
 
6387
5734
  // src/components/MonthRangePicker/MonthRangePicker.tsx
6388
- import React43, {
6389
- forwardRef as forwardRef10,
6390
- useCallback as useCallback22,
6391
- useEffect as useEffect11,
6392
- useImperativeHandle as useImperativeHandle5,
6393
- useMemo as useMemo13,
6394
- useRef as useRef8,
6395
- useState as useState13
6396
- } from "react";
5735
+ import React43, { forwardRef as forwardRef10, useCallback as useCallback22, useEffect as useEffect11, useImperativeHandle as useImperativeHandle5, useMemo as useMemo13, useRef as useRef8, useState as useState13 } from "react";
6397
5736
  import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
6398
5737
  import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
6399
5738
  import { styled as styled22, useThemeProps as useThemeProps8 } from "@mui/joy";
@@ -6451,196 +5790,184 @@ var parseDates2 = (str) => {
6451
5790
  var formatToPattern3 = (format) => {
6452
5791
  return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
6453
5792
  };
6454
- var TextMaskAdapter9 = React43.forwardRef(
6455
- function TextMaskAdapter10(props, ref) {
6456
- const { onChange, format, ...other } = props;
6457
- return /* @__PURE__ */ React43.createElement(
6458
- IMaskInput3,
6459
- {
6460
- ...other,
6461
- inputRef: ref,
6462
- onAccept: (value) => onChange({ target: { name: props.name, value } }),
6463
- mask: Date,
6464
- pattern: formatToPattern3(format),
6465
- blocks: {
6466
- m: {
6467
- mask: IMask3.MaskedRange,
6468
- from: 1,
6469
- to: 12,
6470
- maxLength: 2
6471
- },
6472
- Y: {
6473
- mask: IMask3.MaskedRange,
6474
- from: 1900,
6475
- to: 9999
6476
- }
5793
+ var TextMaskAdapter9 = React43.forwardRef(function TextMaskAdapter10(props, ref) {
5794
+ const { onChange, format, ...other } = props;
5795
+ return /* @__PURE__ */ React43.createElement(
5796
+ IMaskInput3,
5797
+ {
5798
+ ...other,
5799
+ inputRef: ref,
5800
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
5801
+ mask: Date,
5802
+ pattern: formatToPattern3(format),
5803
+ blocks: {
5804
+ m: {
5805
+ mask: IMask3.MaskedRange,
5806
+ from: 1,
5807
+ to: 12,
5808
+ maxLength: 2
6477
5809
  },
6478
- format: (dates) => formatValueString4(dates, format),
6479
- parse: parseDates2,
6480
- autofix: "pad",
6481
- overwrite: true
6482
- }
6483
- );
6484
- }
6485
- );
6486
- var MonthRangePicker = forwardRef10(
6487
- (inProps, ref) => {
6488
- const props = useThemeProps8({ props: inProps, name: "MonthRangePicker" });
6489
- const {
6490
- onChange,
5810
+ Y: {
5811
+ mask: IMask3.MaskedRange,
5812
+ from: 1900,
5813
+ to: 9999
5814
+ }
5815
+ },
5816
+ format: (dates) => formatValueString4(dates, format),
5817
+ parse: parseDates2,
5818
+ autofix: "pad",
5819
+ overwrite: true
5820
+ }
5821
+ );
5822
+ });
5823
+ var MonthRangePicker = forwardRef10((inProps, ref) => {
5824
+ const props = useThemeProps8({ props: inProps, name: "MonthRangePicker" });
5825
+ const {
5826
+ onChange,
5827
+ disabled,
5828
+ label,
5829
+ error,
5830
+ helperText,
5831
+ minDate,
5832
+ maxDate,
5833
+ disableFuture,
5834
+ disablePast,
5835
+ required,
5836
+ // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
5837
+ sx,
5838
+ className,
5839
+ format = "YYYY/MM",
5840
+ size,
5841
+ ...innerProps
5842
+ } = props;
5843
+ const innerRef = useRef8(null);
5844
+ const [value, setValue] = useControlledState(
5845
+ props.value,
5846
+ props.defaultValue || "",
5847
+ useCallback22((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
5848
+ );
5849
+ const [anchorEl, setAnchorEl] = useState13(null);
5850
+ const open = Boolean(anchorEl);
5851
+ const calendarValue = useMemo13(() => value ? parseDates2(value) : void 0, [value]);
5852
+ useEffect11(() => {
5853
+ if (!anchorEl) {
5854
+ innerRef.current?.blur();
5855
+ }
5856
+ }, [anchorEl, innerRef]);
5857
+ useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
5858
+ const handleChange = useCallback22(
5859
+ (event) => {
5860
+ setValue(event.target.value);
5861
+ },
5862
+ [setValue]
5863
+ );
5864
+ const handleCalendarToggle = useCallback22(
5865
+ (event) => {
5866
+ setAnchorEl(anchorEl ? null : event.currentTarget);
5867
+ innerRef.current?.focus();
5868
+ },
5869
+ [anchorEl, setAnchorEl, innerRef]
5870
+ );
5871
+ const handleCalendarChange = useCallback22(
5872
+ ([date1, date2]) => {
5873
+ if (!date1 || !date2) return;
5874
+ setValue(formatValueString4([date1, date2], format));
5875
+ setAnchorEl(null);
5876
+ },
5877
+ [setValue, setAnchorEl, format]
5878
+ );
5879
+ return /* @__PURE__ */ React43.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React43.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
5880
+ Input_default,
5881
+ {
5882
+ ...innerProps,
5883
+ color: error ? "danger" : innerProps.color,
5884
+ ref,
5885
+ size,
5886
+ value,
5887
+ onChange: handleChange,
6491
5888
  disabled,
6492
- label,
6493
- error,
6494
- helperText,
6495
- minDate,
6496
- maxDate,
6497
- disableFuture,
6498
- disablePast,
6499
5889
  required,
6500
- // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
6501
- sx,
6502
- className,
6503
- format = "YYYY/MM",
6504
- size,
6505
- ...innerProps
6506
- } = props;
6507
- const innerRef = useRef8(null);
6508
- const [value, setValue] = useControlledState(
6509
- props.value,
6510
- props.defaultValue || "",
6511
- useCallback22(
6512
- (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
6513
- [props.name, onChange]
6514
- )
6515
- );
6516
- const [anchorEl, setAnchorEl] = useState13(null);
6517
- const open = Boolean(anchorEl);
6518
- const calendarValue = useMemo13(
6519
- () => value ? parseDates2(value) : void 0,
6520
- [value]
6521
- );
6522
- useEffect11(() => {
6523
- if (!anchorEl) {
6524
- innerRef.current?.blur();
6525
- }
6526
- }, [anchorEl, innerRef]);
6527
- useImperativeHandle5(ref, () => innerRef.current, [
6528
- innerRef
6529
- ]);
6530
- const handleChange = useCallback22(
6531
- (event) => {
6532
- setValue(event.target.value);
6533
- },
6534
- [setValue]
6535
- );
6536
- const handleCalendarToggle = useCallback22(
6537
- (event) => {
6538
- setAnchorEl(anchorEl ? null : event.currentTarget);
6539
- innerRef.current?.focus();
5890
+ placeholder: `${format} - ${format}`,
5891
+ slotProps: {
5892
+ input: { component: TextMaskAdapter9, ref: innerRef, format }
6540
5893
  },
6541
- [anchorEl, setAnchorEl, innerRef]
6542
- );
6543
- const handleCalendarChange = useCallback22(
6544
- ([date1, date2]) => {
6545
- if (!date1 || !date2) return;
6546
- setValue(formatValueString4([date1, date2], format));
6547
- setAnchorEl(null);
5894
+ error,
5895
+ className,
5896
+ sx: {
5897
+ ...sx,
5898
+ // NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
5899
+ fontFamily: "monospace"
6548
5900
  },
6549
- [setValue, setAnchorEl, format]
6550
- );
6551
- return /* @__PURE__ */ React43.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React43.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
6552
- Input_default,
6553
- {
6554
- ...innerProps,
6555
- color: error ? "danger" : innerProps.color,
6556
- ref,
6557
- size,
6558
- value,
6559
- onChange: handleChange,
6560
- disabled,
6561
- required,
6562
- placeholder: `${format} - ${format}`,
6563
- slotProps: {
6564
- input: { component: TextMaskAdapter9, ref: innerRef, format }
6565
- },
6566
- error,
6567
- className,
6568
- sx: {
6569
- ...sx,
6570
- // NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
6571
- fontFamily: "monospace"
5901
+ endDecorator: /* @__PURE__ */ React43.createElement(
5902
+ IconButton_default,
5903
+ {
5904
+ variant: "plain",
5905
+ onClick: handleCalendarToggle,
5906
+ "aria-label": "Toggle Calendar",
5907
+ "aria-controls": "month-range-picker-popper",
5908
+ "aria-haspopup": "dialog",
5909
+ "aria-expanded": open
6572
5910
  },
6573
- endDecorator: /* @__PURE__ */ React43.createElement(
6574
- IconButton_default,
6575
- {
6576
- variant: "plain",
6577
- onClick: handleCalendarToggle,
6578
- "aria-label": "Toggle Calendar",
6579
- "aria-controls": "month-range-picker-popper",
6580
- "aria-haspopup": "dialog",
6581
- "aria-expanded": open
6582
- },
6583
- /* @__PURE__ */ React43.createElement(CalendarTodayIcon4, null)
6584
- ),
6585
- label,
6586
- helperText
5911
+ /* @__PURE__ */ React43.createElement(CalendarTodayIcon4, null)
5912
+ ),
5913
+ label,
5914
+ helperText
5915
+ }
5916
+ ), open && /* @__PURE__ */ React43.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React43.createElement(
5917
+ StyledPopper4,
5918
+ {
5919
+ id: "month-range-picker-popper",
5920
+ open: true,
5921
+ anchorEl,
5922
+ placement: "bottom-end",
5923
+ onMouseDown: (e) => e.preventDefault(),
5924
+ modifiers: [
5925
+ {
5926
+ name: "offset",
5927
+ options: {
5928
+ offset: [4, 4]
5929
+ }
5930
+ }
5931
+ ],
5932
+ "aria-label": "Calendar Tooltip",
5933
+ "aria-expanded": open
5934
+ },
5935
+ /* @__PURE__ */ React43.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React43.createElement(
5936
+ Calendar_default,
5937
+ {
5938
+ view: "month",
5939
+ views: ["month"],
5940
+ rangeSelection: true,
5941
+ defaultValue: calendarValue,
5942
+ onChange: handleCalendarChange,
5943
+ minDate: minDate ? new Date(minDate) : void 0,
5944
+ maxDate: maxDate ? new Date(maxDate) : void 0,
5945
+ disableFuture,
5946
+ disablePast
6587
5947
  }
6588
- ), open && /* @__PURE__ */ React43.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React43.createElement(
6589
- StyledPopper4,
5948
+ ), /* @__PURE__ */ React43.createElement(
5949
+ DialogActions_default,
6590
5950
  {
6591
- id: "month-range-picker-popper",
6592
- open: true,
6593
- anchorEl,
6594
- placement: "bottom-end",
6595
- onMouseDown: (e) => e.preventDefault(),
6596
- modifiers: [
6597
- {
6598
- name: "offset",
6599
- options: {
6600
- offset: [4, 4]
6601
- }
6602
- }
6603
- ],
6604
- "aria-label": "Calendar Tooltip",
6605
- "aria-expanded": open
6606
- },
6607
- /* @__PURE__ */ React43.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React43.createElement(
6608
- Calendar_default,
6609
- {
6610
- view: "month",
6611
- views: ["month"],
6612
- rangeSelection: true,
6613
- defaultValue: calendarValue,
6614
- onChange: handleCalendarChange,
6615
- minDate: minDate ? new Date(minDate) : void 0,
6616
- maxDate: maxDate ? new Date(maxDate) : void 0,
6617
- disableFuture,
6618
- disablePast
5951
+ sx: {
5952
+ p: 1
6619
5953
  }
6620
- ), /* @__PURE__ */ React43.createElement(
6621
- DialogActions_default,
5954
+ },
5955
+ /* @__PURE__ */ React43.createElement(
5956
+ Button_default,
6622
5957
  {
6623
- sx: {
6624
- p: 1
5958
+ size,
5959
+ variant: "plain",
5960
+ color: "neutral",
5961
+ onClick: () => {
5962
+ setValue("");
5963
+ setAnchorEl(null);
6625
5964
  }
6626
5965
  },
6627
- /* @__PURE__ */ React43.createElement(
6628
- Button_default,
6629
- {
6630
- size,
6631
- variant: "plain",
6632
- color: "neutral",
6633
- onClick: () => {
6634
- setValue("");
6635
- setAnchorEl(null);
6636
- }
6637
- },
6638
- "Clear"
6639
- )
6640
- ))
6641
- )))));
6642
- }
6643
- );
5966
+ "Clear"
5967
+ )
5968
+ ))
5969
+ )))));
5970
+ });
6644
5971
  MonthRangePicker.displayName = "MonthRangePicker";
6645
5972
 
6646
5973
  // src/components/NavigationGroup/NavigationGroup.tsx
@@ -6769,13 +6096,7 @@ Navigator.displayName = "Navigator";
6769
6096
 
6770
6097
  // src/components/ProfileMenu/ProfileMenu.tsx
6771
6098
  import React47, { useCallback as useCallback23, useMemo as useMemo14 } from "react";
6772
- import {
6773
- Dropdown as Dropdown2,
6774
- ListDivider,
6775
- menuItemClasses,
6776
- styled as styled25,
6777
- MenuButton as MenuButton2
6778
- } from "@mui/joy";
6099
+ import { Dropdown as Dropdown2, ListDivider, menuItemClasses, styled as styled25, MenuButton as MenuButton2 } from "@mui/joy";
6779
6100
  import { ClickAwayListener as ClickAwayListener5 } from "@mui/base";
6780
6101
  import DropdownIcon from "@mui/icons-material/ArrowDropDown";
6781
6102
  var StyledProfileCard = styled25(Stack, {
@@ -6784,23 +6105,9 @@ var StyledProfileCard = styled25(Stack, {
6784
6105
  })({});
6785
6106
  function ProfileCard(props) {
6786
6107
  const { children, chip, caption, size } = props;
6787
- const captionLevel = useMemo14(
6788
- () => size === "sm" ? "body-xs" : "body-sm",
6789
- [size]
6790
- );
6791
- const nameLevel = useMemo14(
6792
- () => size === "sm" ? "body-sm" : "body-md",
6793
- [size]
6794
- );
6795
- return /* @__PURE__ */ React47.createElement(StyledProfileCard, { px: 4, py: 2 }, /* @__PURE__ */ React47.createElement(Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(
6796
- Typography,
6797
- {
6798
- level: nameLevel,
6799
- fontWeight: "bold",
6800
- textColor: "text.primary"
6801
- },
6802
- children
6803
- ), chip && /* @__PURE__ */ React47.createElement(Chip, { size, color: "neutral", variant: "outlined" }, chip)), caption && /* @__PURE__ */ React47.createElement(Typography, { level: captionLevel, textColor: "text.tertiary" }, caption));
6108
+ const captionLevel = useMemo14(() => size === "sm" ? "body-xs" : "body-sm", [size]);
6109
+ const nameLevel = useMemo14(() => size === "sm" ? "body-sm" : "body-md", [size]);
6110
+ return /* @__PURE__ */ React47.createElement(StyledProfileCard, { px: 4, py: 2 }, /* @__PURE__ */ React47.createElement(Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(Typography, { level: nameLevel, fontWeight: "bold", textColor: "text.primary" }, children), chip && /* @__PURE__ */ React47.createElement(Chip, { size, color: "neutral", variant: "outlined" }, chip)), caption && /* @__PURE__ */ React47.createElement(Typography, { level: captionLevel, textColor: "text.tertiary" }, caption));
6804
6111
  }
6805
6112
  ProfileCard.displayName = "ProfileCard";
6806
6113
  var StyledProfileMenuButton = styled25(MenuButton2, {
@@ -6821,18 +6128,7 @@ function ProfileMenuButton(props) {
6821
6128
  endDecorator: /* @__PURE__ */ React47.createElement(DropdownIcon, null),
6822
6129
  ...innerProps
6823
6130
  },
6824
- /* @__PURE__ */ React47.createElement(
6825
- Avatar,
6826
- {
6827
- variant: "soft",
6828
- color: "primary",
6829
- size,
6830
- src,
6831
- alt,
6832
- getInitial
6833
- },
6834
- children
6835
- )
6131
+ /* @__PURE__ */ React47.createElement(Avatar, { variant: "soft", color: "primary", size, src, alt, getInitial }, children)
6836
6132
  );
6837
6133
  }
6838
6134
  ProfileMenuButton.displayName = "ProfileMenuButton";
@@ -6847,16 +6143,7 @@ var ProfileMenuRoot = styled25(Menu, {
6847
6143
  }
6848
6144
  }));
6849
6145
  function ProfileMenu(props) {
6850
- const {
6851
- open: _open,
6852
- defaultOpen,
6853
- onOpenChange,
6854
- profile,
6855
- getInitial,
6856
- menuItems,
6857
- size,
6858
- ...innerProps
6859
- } = props;
6146
+ const { open: _open, defaultOpen, onOpenChange, profile, getInitial, menuItems, size, ...innerProps } = props;
6860
6147
  const [open, setOpen] = useControlledState(
6861
6148
  _open,
6862
6149
  defaultOpen ?? false,
@@ -6872,37 +6159,18 @@ function ProfileMenu(props) {
6872
6159
  getInitial
6873
6160
  },
6874
6161
  profile.name
6875
- ), /* @__PURE__ */ React47.createElement(
6876
- ProfileMenuRoot,
6162
+ ), /* @__PURE__ */ React47.createElement(ProfileMenuRoot, { size, placement: "bottom-end", ...innerProps, onClose: () => setOpen(false) }, /* @__PURE__ */ React47.createElement(ProfileCard, { size, caption: profile.caption, chip: profile.chip }, profile.name), !!menuItems.length && /* @__PURE__ */ React47.createElement(ListDivider, null), menuItems.map(({ label, ...menuProps }) => /* @__PURE__ */ React47.createElement(
6163
+ MenuItem,
6877
6164
  {
6878
- size,
6879
- placement: "bottom-end",
6880
- ...innerProps,
6881
- onClose: () => setOpen(false)
6165
+ key: label,
6166
+ ...menuProps,
6167
+ onClick: (e) => {
6168
+ menuProps.onClick?.(e);
6169
+ setOpen(false);
6170
+ }
6882
6171
  },
6883
- /* @__PURE__ */ React47.createElement(
6884
- ProfileCard,
6885
- {
6886
- size,
6887
- caption: profile.caption,
6888
- chip: profile.chip
6889
- },
6890
- profile.name
6891
- ),
6892
- !!menuItems.length && /* @__PURE__ */ React47.createElement(ListDivider, null),
6893
- menuItems.map(({ label, ...menuProps }) => /* @__PURE__ */ React47.createElement(
6894
- MenuItem,
6895
- {
6896
- key: label,
6897
- ...menuProps,
6898
- onClick: (e) => {
6899
- menuProps.onClick?.(e);
6900
- setOpen(false);
6901
- }
6902
- },
6903
- label
6904
- ))
6905
- ))));
6172
+ label
6173
+ ))))));
6906
6174
  }
6907
6175
  ProfileMenu.displayName = "ProfileMenu";
6908
6176
 
@@ -7000,11 +6268,7 @@ Stepper.displayName = "Stepper";
7000
6268
 
7001
6269
  // src/components/Switch/Switch.tsx
7002
6270
  import React50 from "react";
7003
- import {
7004
- Switch as JoySwitch,
7005
- styled as styled27,
7006
- switchClasses
7007
- } from "@mui/joy";
6271
+ import { Switch as JoySwitch, styled as styled27, switchClasses } from "@mui/joy";
7008
6272
  import { motion as motion28 } from "framer-motion";
7009
6273
  var MotionSwitch = motion28(JoySwitch);
7010
6274
  var StyledThumb = styled27(motion28.div)({
@@ -7078,13 +6342,7 @@ var TabPanel = JoyTabPanel;
7078
6342
 
7079
6343
  // src/components/ThemeProvider/ThemeProvider.tsx
7080
6344
  import React52 from "react";
7081
- import {
7082
- CssBaseline,
7083
- CssVarsProvider,
7084
- checkboxClasses,
7085
- extendTheme,
7086
- inputClasses
7087
- } from "@mui/joy";
6345
+ import { CssBaseline, CssVarsProvider, checkboxClasses, extendTheme, inputClasses } from "@mui/joy";
7088
6346
  var colorScheme = {
7089
6347
  palette: {
7090
6348
  danger: {