@ceed/ads 0.0.53 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -173,8 +173,8 @@ var Button_default = Button;
173
173
  // src/components/Calendar/Calendar.tsx
174
174
  import React6, { Fragment, forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
175
175
  import { styled } from "@mui/joy/styles";
176
- import ChevronLeftIcon from "@mui/icons-material/esm/ChevronLeft";
177
- import ChevronRightIcon from "@mui/icons-material/esm/ChevronRight";
176
+ import ChevronLeftIcon from "@mui/icons-material/esm/ChevronLeft.js";
177
+ import ChevronRightIcon from "@mui/icons-material/esm/ChevronRight.js";
178
178
  import { AnimatePresence, motion as motion6 } from "framer-motion";
179
179
 
180
180
  // src/components/Typography/Typography.tsx
@@ -223,7 +223,7 @@ var getMonthName = (date, locale) => {
223
223
  return date.toLocaleString(locale, { year: "numeric", month: "long" });
224
224
  };
225
225
  var getMonthNameFromIndex = (index, locale) => {
226
- return new Date(0, index).toLocaleString(locale, { month: "long" });
226
+ return new Date(0, index).toLocaleString(locale, { month: "short" });
227
227
  };
228
228
  var getWeekdayNames = (locale) => {
229
229
  const currentDay = (/* @__PURE__ */ new Date()).getDay();
@@ -353,6 +353,7 @@ var useCalendarProps = (inProps) => {
353
353
  import { useCallback as useCallback2, useState as useState2 } from "react";
354
354
  var useCalendar = (ownerState) => {
355
355
  const [hoverDay, setHoverDay] = useState2(null);
356
+ const [hoverMonth, setHoverMonth] = useState2(null);
356
357
  return {
357
358
  calendarTitle: ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
358
359
  onPrev: useCallback2(() => {
@@ -401,6 +402,32 @@ var useCalendar = (ownerState) => {
401
402
  hoverDay
402
403
  ]
403
404
  ),
405
+ getMonthCellProps: useCallback2(
406
+ (monthIndex) => {
407
+ const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
408
+ thisMonth.setDate(1);
409
+ thisMonth.setHours(0, 0, 0, 0);
410
+ thisMonth.setMonth(monthIndex);
411
+ const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
412
+ const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
413
+ (hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
414
+ ownerState.value[1] && isWithinRange(
415
+ ownerState.value[0],
416
+ ownerState.value[1],
417
+ thisMonth
418
+ ));
419
+ return {
420
+ "aria-label": thisMonth.toLocaleDateString(),
421
+ "aria-current": inRange ? "date" : void 0
422
+ };
423
+ },
424
+ [
425
+ ownerState.rangeSelection,
426
+ ownerState.value,
427
+ ownerState.viewMonth,
428
+ hoverMonth
429
+ ]
430
+ ),
404
431
  getPickerDayProps: useCallback2(
405
432
  (day) => {
406
433
  const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
@@ -469,13 +496,40 @@ var useCalendar = (ownerState) => {
469
496
  thisMonth.setDate(1);
470
497
  thisMonth.setHours(0, 0, 0, 0);
471
498
  thisMonth.setMonth(monthIndex);
499
+ const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
472
500
  const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
501
+ const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
502
+ (hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
503
+ ownerState.value[1] && isWithinRange(
504
+ ownerState.value[0],
505
+ ownerState.value[1],
506
+ thisMonth
507
+ ));
473
508
  const handleMonthClick = () => {
474
- ownerState.onViewChange?.("day");
475
- ownerState.onMonthChange?.(thisMonth);
509
+ if (isMonthRangeSelection) {
510
+ if (!ownerState.value) {
511
+ ownerState.onChange?.([thisMonth, void 0]);
512
+ } else if (ownerState.value[0] && !ownerState.value[1]) {
513
+ ownerState.onChange?.([
514
+ new Date(
515
+ Math.min(ownerState.value[0].getTime(), thisMonth.getTime())
516
+ ),
517
+ new Date(
518
+ Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
519
+ )
520
+ ]);
521
+ } else {
522
+ ownerState.onChange?.([thisMonth, void 0]);
523
+ }
524
+ } else {
525
+ ownerState.onViewChange?.("day");
526
+ ownerState.onMonthChange?.(thisMonth);
527
+ }
528
+ setHoverMonth(null);
476
529
  };
477
530
  return {
478
531
  isSelected,
532
+ onMouseEnter: isMonthRangeSelection && ownerState.value?.[0] && !ownerState.value?.[1] ? () => setHoverMonth(thisMonth) : void 0,
479
533
  disabled: ownerState.minDate && (() => {
480
534
  const lastDay = new Date(thisMonth);
481
535
  lastDay.setMonth(lastDay.getMonth() + 1);
@@ -485,10 +539,12 @@ var useCalendar = (ownerState) => {
485
539
  const lastDay = new Date(thisMonth);
486
540
  lastDay.setDate(0);
487
541
  return lastDay > ownerState.maxDate;
488
- })() || ownerState.disableFuture && thisMonth > /* @__PURE__ */ new Date() || ownerState.disablePast && thisMonth < /* @__PURE__ */ new Date(),
542
+ })() || ownerState.disableFuture && thisMonth > /* @__PURE__ */ new Date() || ownerState.disablePast && thisMonth < /* @__PURE__ */ new Date() && !isSameMonth(thisMonth, /* @__PURE__ */ new Date()),
489
543
  onClick: handleMonthClick,
490
544
  tabIndex: -1,
491
- "aria-label": getMonthName(thisMonth, ownerState.locale || "default")
545
+ "aria-label": getMonthName(thisMonth, ownerState.locale || "default"),
546
+ "aria-selected": isSelected ? "true" : void 0,
547
+ "aria-current": inRange ? "date" : void 0
492
548
  };
493
549
  },
494
550
  [
@@ -501,7 +557,8 @@ var useCalendar = (ownerState) => {
501
557
  ownerState.minDate,
502
558
  ownerState.maxDate,
503
559
  ownerState.disableFuture,
504
- ownerState.disablePast
560
+ ownerState.disablePast,
561
+ hoverMonth
505
562
  ]
506
563
  )
507
564
  };
@@ -585,6 +642,28 @@ var CalendarDayCell = styled("td", {
585
642
  }
586
643
  }
587
644
  }));
645
+ var CalendarMonthCell = styled("td", {
646
+ name: "Calendar",
647
+ slot: "monthCell"
648
+ })(({ theme }) => ({
649
+ // aria-current=date === range에 포함된 버튼
650
+ "&[aria-current=date]": {
651
+ position: "relative",
652
+ "& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)": {
653
+ backgroundColor: `rgb(${theme.palette.primary.lightChannel})`
654
+ },
655
+ '& + td[aria-hidden] + td[aria-current="date"]::before': {
656
+ content: '""',
657
+ position: "absolute",
658
+ top: 0,
659
+ left: "-10px",
660
+ bottom: 0,
661
+ width: "16px",
662
+ backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
663
+ zIndex: -1
664
+ }
665
+ }
666
+ }));
588
667
  var CalendarMonth = styled(Button_default, {
589
668
  name: "Calendar",
590
669
  slot: "month"
@@ -747,7 +826,7 @@ var PickerDays = (props) => {
747
826
  };
748
827
  var PickerMonths = (props) => {
749
828
  const { ownerState } = props;
750
- const { getPickerMonthProps } = useCalendar(ownerState);
829
+ const { getPickerMonthProps, getMonthCellProps } = useCalendar(ownerState);
751
830
  const chunkedMonths = Array.from({ length: 12 }, (_, i) => i).reduce(
752
831
  (acc, month) => {
753
832
  if (acc[acc.length - 1].length === 4) {
@@ -787,7 +866,7 @@ var PickerMonths = (props) => {
787
866
  }
788
867
  }
789
868
  },
790
- /* @__PURE__ */ React6.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React6.createElement(Fragment, { key: i }, /* @__PURE__ */ React6.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React6.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React6.createElement("td", null, /* @__PURE__ */ React6.createElement(
869
+ /* @__PURE__ */ React6.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React6.createElement(Fragment, { key: i }, /* @__PURE__ */ React6.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React6.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React6.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React6.createElement(
791
870
  CalendarMonth,
792
871
  {
793
872
  size: "sm",
@@ -1416,7 +1495,7 @@ DataTable.displayName = "DataTable";
1416
1495
  // src/components/DatePicker/DatePicker.tsx
1417
1496
  import React12, { forwardRef as forwardRef4, useCallback as useCallback4, useState as useState4 } from "react";
1418
1497
  import { IMaskInput, IMask } from "react-imask";
1419
- import CalendarTodayIcon from "@mui/icons-material/esm/CalendarToday";
1498
+ import CalendarTodayIcon from "@mui/icons-material/esm/CalendarToday.js";
1420
1499
  import { styled as styled3 } from "@mui/joy/styles";
1421
1500
  import { FocusTrap } from "@mui/base/FocusTrap";
1422
1501
  import { ClickAwayListener } from "@mui/base/ClickAwayListener";
@@ -1425,12 +1504,44 @@ import { Popper } from "@mui/base/Popper";
1425
1504
  // src/components/Input/Input.tsx
1426
1505
  import React11 from "react";
1427
1506
  import { Input as JoyInput } from "@mui/joy";
1507
+ import { motion as motion13 } from "framer-motion";
1508
+
1509
+ // src/components/FormControl/FormControl.tsx
1510
+ import { FormControl as JoyFormControl } from "@mui/joy";
1428
1511
  import { motion as motion10 } from "framer-motion";
1429
- var MotionInput = motion10(JoyInput);
1512
+ var MotionFormControl = motion10(JoyFormControl);
1513
+ var FormControl = MotionFormControl;
1514
+ FormControl.displayName = "FormControl";
1515
+
1516
+ // src/components/FormControl/index.ts
1517
+ var FormControl_default = FormControl;
1518
+
1519
+ // src/components/FormLabel/FormLabel.tsx
1520
+ import { FormLabel as JoyFormLabel } from "@mui/joy";
1521
+ import { motion as motion11 } from "framer-motion";
1522
+ var MotionFormLabel = motion11(JoyFormLabel);
1523
+ var FormLabel = MotionFormLabel;
1524
+ FormLabel.displayName = "FormLabel";
1525
+
1526
+ // src/components/FormLabel/index.ts
1527
+ var FormLabel_default = FormLabel;
1528
+
1529
+ // src/components/FormHelperText/FormHelperText.tsx
1530
+ import { FormHelperText as JoyFormHelperText } from "@mui/joy";
1531
+ import { motion as motion12 } from "framer-motion";
1532
+ var MotionFormHelperText = motion12(JoyFormHelperText);
1533
+ var FormHelperText = MotionFormHelperText;
1534
+ FormHelperText.displayName = "FormHelperText";
1535
+
1536
+ // src/components/FormHelperText/index.ts
1537
+ var FormHelperText_default = FormHelperText;
1538
+
1539
+ // src/components/Input/Input.tsx
1540
+ var MotionInput = motion13(JoyInput);
1430
1541
  var Input = (props) => {
1431
1542
  const { label, helperText, error, style, ...innerProps } = props;
1432
1543
  if (label) {
1433
- return /* @__PURE__ */ React11.createElement(FormControl, { error }, /* @__PURE__ */ React11.createElement(FormLabel, null, label), /* @__PURE__ */ React11.createElement(MotionInput, { ...innerProps, color: error ? "danger" : innerProps.color }), helperText && /* @__PURE__ */ React11.createElement(FormHelperText, null, helperText));
1544
+ return /* @__PURE__ */ React11.createElement(FormControl_default, { error }, /* @__PURE__ */ React11.createElement(FormLabel_default, null, label), /* @__PURE__ */ React11.createElement(MotionInput, { ...innerProps, color: error ? "danger" : innerProps.color }), helperText && /* @__PURE__ */ React11.createElement(FormHelperText_default, null, helperText));
1434
1545
  }
1435
1546
  return /* @__PURE__ */ React11.createElement(MotionInput, { ...innerProps });
1436
1547
  };
@@ -1441,34 +1552,14 @@ var Input_default = Input;
1441
1552
 
1442
1553
  // src/components/DialogActions/DialogActions.tsx
1443
1554
  import { DialogActions as JoyDialogActions } from "@mui/joy";
1444
- import { motion as motion11 } from "framer-motion";
1445
- var MotionDialogActions = motion11(JoyDialogActions);
1555
+ import { motion as motion14 } from "framer-motion";
1556
+ var MotionDialogActions = motion14(JoyDialogActions);
1446
1557
  var DialogActions = MotionDialogActions;
1447
1558
  DialogActions.displayName = "DialogActions";
1448
1559
 
1449
1560
  // src/components/DialogActions/index.ts
1450
1561
  var DialogActions_default = DialogActions;
1451
1562
 
1452
- // src/components/FormControl/FormControl.tsx
1453
- import { FormControl as JoyFormControl } from "@mui/joy";
1454
- import { motion as motion12 } from "framer-motion";
1455
- var MotionFormControl = motion12(JoyFormControl);
1456
- var FormControl = MotionFormControl;
1457
- FormControl.displayName = "FormControl";
1458
-
1459
- // src/components/FormControl/index.ts
1460
- var FormControl_default = FormControl;
1461
-
1462
- // src/components/FormLabel/FormLabel.tsx
1463
- import { FormLabel as JoyFormLabel } from "@mui/joy";
1464
- import { motion as motion13 } from "framer-motion";
1465
- var MotionFormLabel = motion13(JoyFormLabel);
1466
- var FormLabel = MotionFormLabel;
1467
- FormLabel.displayName = "FormLabel";
1468
-
1469
- // src/components/FormLabel/index.ts
1470
- var FormLabel_default = FormLabel;
1471
-
1472
1563
  // src/components/DatePicker/DatePicker.tsx
1473
1564
  var StyledPopper = styled3(Popper, {
1474
1565
  name: "DatePicker",
@@ -1543,7 +1634,7 @@ var TextMaskAdapter = React12.forwardRef(
1543
1634
  );
1544
1635
  var DatePicker = forwardRef4(
1545
1636
  (props, ref) => {
1546
- const { onChange, disabled, label } = props;
1637
+ const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast } = props;
1547
1638
  const [value, setValue] = useState4(props.value || "");
1548
1639
  const [anchorEl, setAnchorEl] = useState4(null);
1549
1640
  const open = Boolean(anchorEl);
@@ -1599,7 +1690,11 @@ var DatePicker = forwardRef4(
1599
1690
  onChange: ([date]) => {
1600
1691
  setValue(formatValueString(date));
1601
1692
  setAnchorEl(null);
1602
- }
1693
+ },
1694
+ minDate,
1695
+ maxDate,
1696
+ disableFuture,
1697
+ disablePast
1603
1698
  }
1604
1699
  ), /* @__PURE__ */ React12.createElement(
1605
1700
  DialogActions_default,
@@ -1624,7 +1719,7 @@ var DatePicker = forwardRef4(
1624
1719
  )))
1625
1720
  )));
1626
1721
  if (label) {
1627
- return /* @__PURE__ */ React12.createElement(FormControl_default, { size: "sm" }, /* @__PURE__ */ React12.createElement(FormLabel_default, null, label), picker);
1722
+ return /* @__PURE__ */ React12.createElement(FormControl_default, { error, size: "sm" }, /* @__PURE__ */ React12.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React12.createElement(FormHelperText_default, null, helperText));
1628
1723
  }
1629
1724
  return picker;
1630
1725
  }
@@ -1634,7 +1729,7 @@ DatePicker.displayName = "DatePicker";
1634
1729
  // src/components/DateRangePicker/DateRangePicker.tsx
1635
1730
  import React13, { forwardRef as forwardRef5, useCallback as useCallback5, useMemo as useMemo4, useState as useState5 } from "react";
1636
1731
  import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
1637
- import CalendarTodayIcon2 from "@mui/icons-material/esm/CalendarToday";
1732
+ import CalendarTodayIcon2 from "@mui/icons-material/esm/CalendarToday.js";
1638
1733
  import { styled as styled4 } from "@mui/joy/styles";
1639
1734
  import { FocusTrap as FocusTrap2 } from "@mui/base/FocusTrap";
1640
1735
  import { ClickAwayListener as ClickAwayListener2 } from "@mui/base/ClickAwayListener";
@@ -1727,7 +1822,7 @@ var TextMaskAdapter3 = React13.forwardRef(
1727
1822
  );
1728
1823
  var DateRangePicker = forwardRef5(
1729
1824
  (props, ref) => {
1730
- const { onChange, disabled, label } = props;
1825
+ const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast } = props;
1731
1826
  const [value, setValue] = useState5(props.value || "");
1732
1827
  const [anchorEl, setAnchorEl] = useState5(null);
1733
1828
  const open = Boolean(anchorEl);
@@ -1794,7 +1889,11 @@ var DateRangePicker = forwardRef5(
1794
1889
  {
1795
1890
  rangeSelection: true,
1796
1891
  defaultValue: calendarValue,
1797
- onChange: handleCalendarChange
1892
+ onChange: handleCalendarChange,
1893
+ minDate,
1894
+ maxDate,
1895
+ disableFuture,
1896
+ disablePast
1798
1897
  }
1799
1898
  ), /* @__PURE__ */ React13.createElement(
1800
1899
  DialogActions_default,
@@ -1819,7 +1918,7 @@ var DateRangePicker = forwardRef5(
1819
1918
  )))
1820
1919
  )));
1821
1920
  if (label) {
1822
- return /* @__PURE__ */ React13.createElement(FormControl_default, { size: "sm" }, /* @__PURE__ */ React13.createElement(FormLabel_default, null, label), picker);
1921
+ return /* @__PURE__ */ React13.createElement(FormControl_default, { error, size: "sm" }, /* @__PURE__ */ React13.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React13.createElement(FormHelperText_default, null, helperText));
1823
1922
  }
1824
1923
  return picker;
1825
1924
  }
@@ -1828,8 +1927,8 @@ DateRangePicker.displayName = "DateRangePicker";
1828
1927
 
1829
1928
  // src/components/DialogContent/DialogContent.tsx
1830
1929
  import { DialogContent as JoyDialogContent } from "@mui/joy";
1831
- import { motion as motion14 } from "framer-motion";
1832
- var MotionDialogContent = motion14(JoyDialogContent);
1930
+ import { motion as motion15 } from "framer-motion";
1931
+ var MotionDialogContent = motion15(JoyDialogContent);
1833
1932
  var DialogContent = MotionDialogContent;
1834
1933
  DialogContent.displayName = "DialogContent";
1835
1934
 
@@ -1838,8 +1937,8 @@ var DialogContent_default = DialogContent;
1838
1937
 
1839
1938
  // src/components/DialogTitle/DialogTitle.tsx
1840
1939
  import { DialogTitle as JoyDialogTitle } from "@mui/joy";
1841
- import { motion as motion15 } from "framer-motion";
1842
- var MotionDialogTitle = motion15(JoyDialogTitle);
1940
+ import { motion as motion16 } from "framer-motion";
1941
+ var MotionDialogTitle = motion16(JoyDialogTitle);
1843
1942
  var DialogTitle = MotionDialogTitle;
1844
1943
  DialogTitle.displayName = "DialogTitle";
1845
1944
 
@@ -1857,17 +1956,17 @@ import {
1857
1956
  ModalClose as JoyModalClose,
1858
1957
  ModalOverflow as JoyModalOverflow
1859
1958
  } from "@mui/joy";
1860
- import { motion as motion16 } from "framer-motion";
1861
- var MotionModal = motion16(JoyModal);
1959
+ import { motion as motion17 } from "framer-motion";
1960
+ var MotionModal = motion17(JoyModal);
1862
1961
  var Modal = MotionModal;
1863
1962
  Modal.displayName = "Modal";
1864
- var MotionModalDialog = motion16(JoyModalDialog);
1963
+ var MotionModalDialog = motion17(JoyModalDialog);
1865
1964
  var ModalDialog = MotionModalDialog;
1866
1965
  ModalDialog.displayName = "ModalDialog";
1867
- var MotionModalClose = motion16(JoyModalClose);
1966
+ var MotionModalClose = motion17(JoyModalClose);
1868
1967
  var ModalClose = MotionModalClose;
1869
1968
  ModalClose.displayName = "ModalClose";
1870
- var MotionModalOverflow = motion16(JoyModalOverflow);
1969
+ var MotionModalOverflow = motion17(JoyModalOverflow);
1871
1970
  var ModalOverflow = MotionModalOverflow;
1872
1971
  ModalOverflow.displayName = "ModalOverflow";
1873
1972
  function ModalFrame(props) {
@@ -1886,8 +1985,8 @@ DialogFrame.displayName = "DialogFrame";
1886
1985
  // src/components/Divider/Divider.tsx
1887
1986
  import React16 from "react";
1888
1987
  import { Divider as JoyDivider } from "@mui/joy";
1889
- import { motion as motion17 } from "framer-motion";
1890
- var MotionDivider = motion17(JoyDivider);
1988
+ import { motion as motion18 } from "framer-motion";
1989
+ var MotionDivider = motion18(JoyDivider);
1891
1990
  var Divider = (props) => {
1892
1991
  return /* @__PURE__ */ React16.createElement(MotionDivider, { ...props });
1893
1992
  };
@@ -1896,8 +1995,8 @@ Divider.displayName = "Divider";
1896
1995
  // src/components/InsetDrawer/InsetDrawer.tsx
1897
1996
  import React17 from "react";
1898
1997
  import { Drawer as JoyDrawer } from "@mui/joy";
1899
- import { motion as motion18 } from "framer-motion";
1900
- var MotionDrawer = motion18(JoyDrawer);
1998
+ import { motion as motion19 } from "framer-motion";
1999
+ var MotionDrawer = motion19(JoyDrawer);
1901
2000
  var InsetDrawer = (props) => {
1902
2001
  const { children, ...innerProps } = props;
1903
2002
  return /* @__PURE__ */ React17.createElement(
@@ -1923,18 +2022,11 @@ InsetDrawer.displayName = "InsetDrawer";
1923
2022
 
1924
2023
  // src/components/Dropdown/Dropdown.tsx
1925
2024
  import { Dropdown as JoyDropdown } from "@mui/joy";
1926
- import { motion as motion19 } from "framer-motion";
1927
- var MotionDropdown = motion19(JoyDropdown);
2025
+ import { motion as motion20 } from "framer-motion";
2026
+ var MotionDropdown = motion20(JoyDropdown);
1928
2027
  var Dropdown = MotionDropdown;
1929
2028
  Dropdown.displayName = "Dropdown";
1930
2029
 
1931
- // src/components/FormHelperText/FormHelperText.tsx
1932
- import { FormHelperText as JoyFormHelperText } from "@mui/joy";
1933
- import { motion as motion20 } from "framer-motion";
1934
- var MotionFormHelperText = motion20(JoyFormHelperText);
1935
- var FormHelperText = MotionFormHelperText;
1936
- FormHelperText.displayName = "FormHelperText";
1937
-
1938
2030
  // src/components/Grid/Grid.tsx
1939
2031
  import { Grid as JoyGrid } from "@mui/joy";
1940
2032
  import { motion as motion21 } from "framer-motion";
@@ -1966,6 +2058,196 @@ var MenuItem = (props) => {
1966
2058
  };
1967
2059
  MenuItem.displayName = "MenuItem";
1968
2060
 
2061
+ // src/components/MonthRangePicker/MonthRangePicker.tsx
2062
+ import React19, { forwardRef as forwardRef6, useCallback as useCallback6, useMemo as useMemo5, useState as useState6 } from "react";
2063
+ import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
2064
+ import CalendarTodayIcon3 from "@mui/icons-material/esm/CalendarToday";
2065
+ import { styled as styled5 } from "@mui/joy/styles";
2066
+ import { FocusTrap as FocusTrap3 } from "@mui/base/FocusTrap";
2067
+ import { ClickAwayListener as ClickAwayListener3 } from "@mui/base/ClickAwayListener";
2068
+ import { Popper as Popper3 } from "@mui/base/Popper";
2069
+ var StyledPopper3 = styled5(Popper3, {
2070
+ name: "MonthRangePicker",
2071
+ slot: "popper"
2072
+ })(({ theme }) => ({
2073
+ zIndex: theme.zIndex.popup
2074
+ }));
2075
+ var CalendarSheet3 = styled5(Sheet_default, {
2076
+ name: "MonthRangePicker",
2077
+ slot: "sheet",
2078
+ overridesResolver: (props, styles) => styles.root
2079
+ })(({ theme }) => ({
2080
+ zIndex: theme.zIndex.popup,
2081
+ width: "264px",
2082
+ boxShadow: theme.shadow.md,
2083
+ borderRadius: theme.radius.md
2084
+ }));
2085
+ var formatValueString3 = ([date1, date2]) => {
2086
+ const getStr = (date) => {
2087
+ let month = `${date.getMonth() + 1}`;
2088
+ const year = date.getFullYear();
2089
+ if (Number(month) < 10)
2090
+ month = "0" + month;
2091
+ return [year, month].join("/");
2092
+ };
2093
+ return [getStr(date1), date2 ? getStr(date2) : ""].join(" - ");
2094
+ };
2095
+ var parseDate2 = (str) => {
2096
+ const date1 = str.split(" - ")[0] || "";
2097
+ const date2 = str.split(" - ")[1] || "";
2098
+ const yearMonthDay1 = date1.split("/");
2099
+ const yearMonthDay2 = date2.split("/");
2100
+ return [
2101
+ new Date(
2102
+ Number(yearMonthDay1[0]),
2103
+ Number(yearMonthDay1[1]) - 1
2104
+ ),
2105
+ new Date(
2106
+ Number(yearMonthDay2[0]),
2107
+ Number(yearMonthDay2[1]) - 1
2108
+ )
2109
+ ];
2110
+ };
2111
+ var TextMaskAdapter5 = React19.forwardRef(
2112
+ function TextMaskAdapter6(props, ref) {
2113
+ const { onChange, ...other } = props;
2114
+ return /* @__PURE__ */ React19.createElement(
2115
+ IMaskInput3,
2116
+ {
2117
+ ...other,
2118
+ inputRef: ref,
2119
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
2120
+ mask: Date,
2121
+ pattern: "Y/`m - Y/`m",
2122
+ blocks: {
2123
+ m: {
2124
+ mask: IMask3.MaskedRange,
2125
+ from: 1,
2126
+ to: 12,
2127
+ maxLength: 2
2128
+ },
2129
+ Y: {
2130
+ mask: IMask3.MaskedRange,
2131
+ from: 1900,
2132
+ to: 9999
2133
+ }
2134
+ },
2135
+ format: formatValueString3,
2136
+ parse: parseDate2,
2137
+ autofix: "pad",
2138
+ overwrite: true,
2139
+ placeholderChar: " "
2140
+ }
2141
+ );
2142
+ }
2143
+ );
2144
+ var MonthRangePicker = forwardRef6(
2145
+ (props, ref) => {
2146
+ const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast } = props;
2147
+ const [value, setValue] = useState6(props.value || "");
2148
+ const [anchorEl, setAnchorEl] = useState6(null);
2149
+ const open = Boolean(anchorEl);
2150
+ const calendarValue = useMemo5(
2151
+ () => value ? parseDate2(value) : void 0,
2152
+ [value]
2153
+ );
2154
+ const handleChange = useCallback6(
2155
+ (event) => {
2156
+ setValue(event.target.value);
2157
+ onChange?.(event);
2158
+ },
2159
+ [onChange]
2160
+ );
2161
+ const handleCalendarToggle = useCallback6(
2162
+ (event) => {
2163
+ setAnchorEl(anchorEl ? null : event.currentTarget);
2164
+ },
2165
+ [anchorEl, setAnchorEl]
2166
+ );
2167
+ const handleCalendarChange = useCallback6(
2168
+ ([date1, date2]) => {
2169
+ if (!date1 || !date2)
2170
+ return;
2171
+ setValue(formatValueString3([date1, date2]));
2172
+ setAnchorEl(null);
2173
+ },
2174
+ [setValue, setAnchorEl]
2175
+ );
2176
+ const picker = /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
2177
+ Input_default,
2178
+ {
2179
+ ref,
2180
+ size: "sm",
2181
+ value,
2182
+ onChange: handleChange,
2183
+ disabled,
2184
+ placeholder: "YYYY/MM - YYYY/MM",
2185
+ slotProps: { input: { component: TextMaskAdapter5 } },
2186
+ sx: {
2187
+ // NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
2188
+ fontFamily: "monospace"
2189
+ },
2190
+ endDecorator: /* @__PURE__ */ React19.createElement(IconButton_default, { variant: "plain", onClick: handleCalendarToggle }, /* @__PURE__ */ React19.createElement(CalendarTodayIcon3, null))
2191
+ }
2192
+ ), open && /* @__PURE__ */ React19.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React19.createElement(
2193
+ StyledPopper3,
2194
+ {
2195
+ id: "date-range-picker-popper",
2196
+ open: true,
2197
+ anchorEl,
2198
+ placement: "bottom-end",
2199
+ modifiers: [
2200
+ {
2201
+ name: "offset",
2202
+ options: {
2203
+ offset: [4, 4]
2204
+ }
2205
+ }
2206
+ ]
2207
+ },
2208
+ /* @__PURE__ */ React19.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React19.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React19.createElement(
2209
+ Calendar_default,
2210
+ {
2211
+ view: "month",
2212
+ views: ["month"],
2213
+ rangeSelection: true,
2214
+ defaultValue: calendarValue,
2215
+ onChange: handleCalendarChange,
2216
+ minDate,
2217
+ maxDate,
2218
+ disableFuture,
2219
+ disablePast
2220
+ }
2221
+ ), /* @__PURE__ */ React19.createElement(
2222
+ DialogActions_default,
2223
+ {
2224
+ sx: {
2225
+ p: 1
2226
+ }
2227
+ },
2228
+ /* @__PURE__ */ React19.createElement(
2229
+ Button_default,
2230
+ {
2231
+ size: "sm",
2232
+ variant: "plain",
2233
+ color: "neutral",
2234
+ onClick: () => {
2235
+ setValue("");
2236
+ setAnchorEl(null);
2237
+ }
2238
+ },
2239
+ "Clear"
2240
+ )
2241
+ )))
2242
+ )));
2243
+ if (label) {
2244
+ return /* @__PURE__ */ React19.createElement(FormControl_default, { error, size: "sm" }, /* @__PURE__ */ React19.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React19.createElement(FormHelperText_default, null, helperText));
2245
+ }
2246
+ return picker;
2247
+ }
2248
+ );
2249
+ MonthRangePicker.displayName = "MonthRangePicker";
2250
+
1969
2251
  // src/components/Radio/Radio.tsx
1970
2252
  import { Radio as JoyRadio, RadioGroup as JoyRadioGroup } from "@mui/joy";
1971
2253
  import { motion as motion23 } from "framer-motion";
@@ -1977,15 +2259,15 @@ var RadioGroup = MotionRadioGroup;
1977
2259
  RadioGroup.displayName = "RadioGroup";
1978
2260
 
1979
2261
  // src/components/RadioList/RadioList.tsx
1980
- import React19 from "react";
2262
+ import React20 from "react";
1981
2263
  function RadioList(props) {
1982
2264
  const { items, ...innerProps } = props;
1983
- return /* @__PURE__ */ React19.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React19.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
2265
+ return /* @__PURE__ */ React20.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React20.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
1984
2266
  }
1985
2267
  RadioList.displayName = "RadioList";
1986
2268
 
1987
2269
  // src/components/Select/Select.tsx
1988
- import React20 from "react";
2270
+ import React21 from "react";
1989
2271
  import {
1990
2272
  Select as JoySelect,
1991
2273
  Option as JoyOption
@@ -1997,22 +2279,28 @@ Option.displayName = "Option";
1997
2279
  function Select(props) {
1998
2280
  const { label, helperText, error, ...innerProps } = props;
1999
2281
  if (label) {
2000
- return /* @__PURE__ */ React20.createElement(FormControl, { error }, /* @__PURE__ */ React20.createElement(FormLabel, null, label), /* @__PURE__ */ React20.createElement(JoySelect, { ...innerProps, color: error ? "danger" : innerProps.color }), helperText && /* @__PURE__ */ React20.createElement(FormHelperText, null, helperText));
2282
+ return /* @__PURE__ */ React21.createElement(FormControl_default, { error }, /* @__PURE__ */ React21.createElement(FormLabel_default, null, label), /* @__PURE__ */ React21.createElement(
2283
+ JoySelect,
2284
+ {
2285
+ ...innerProps,
2286
+ color: error ? "danger" : innerProps.color
2287
+ }
2288
+ ), helperText && /* @__PURE__ */ React21.createElement(FormHelperText_default, null, helperText));
2001
2289
  }
2002
- return /* @__PURE__ */ React20.createElement(JoySelect, { ...innerProps });
2290
+ return /* @__PURE__ */ React21.createElement(JoySelect, { ...innerProps });
2003
2291
  }
2004
2292
  Select.displayName = "Select";
2005
2293
 
2006
2294
  // src/components/Switch/Switch.tsx
2007
- import React21 from "react";
2295
+ import React22 from "react";
2008
2296
  import {
2009
2297
  Switch as JoySwitch,
2010
- styled as styled5,
2298
+ styled as styled6,
2011
2299
  switchClasses
2012
2300
  } from "@mui/joy";
2013
2301
  import { motion as motion25 } from "framer-motion";
2014
2302
  var MotionSwitch = motion25(JoySwitch);
2015
- var StyledThumb = styled5(motion25.div)({
2303
+ var StyledThumb = styled6(motion25.div)({
2016
2304
  "--Icon-fontSize": "calc(var(--Switch-thumbSize) * 0.75)",
2017
2305
  display: "inline-flex",
2018
2306
  justifyContent: "center",
@@ -2030,14 +2318,14 @@ var StyledThumb = styled5(motion25.div)({
2030
2318
  right: "var(--Switch-thumbOffset)"
2031
2319
  }
2032
2320
  });
2033
- var Thumb = (props) => /* @__PURE__ */ React21.createElement(StyledThumb, { ...props, layout: true, transition: spring });
2321
+ var Thumb = (props) => /* @__PURE__ */ React22.createElement(StyledThumb, { ...props, layout: true, transition: spring });
2034
2322
  var spring = {
2035
2323
  type: "spring",
2036
2324
  stiffness: 700,
2037
2325
  damping: 30
2038
2326
  };
2039
2327
  var Switch = (props) => {
2040
- return /* @__PURE__ */ React21.createElement(
2328
+ return /* @__PURE__ */ React22.createElement(
2041
2329
  MotionSwitch,
2042
2330
  {
2043
2331
  ...props,
@@ -2067,17 +2355,17 @@ var TabPanel = MotionTabPanel;
2067
2355
  TabPanel.displayName = "TabPanel";
2068
2356
 
2069
2357
  // src/components/Textarea/Textarea.tsx
2070
- import React22 from "react";
2358
+ import React23 from "react";
2071
2359
  import { Textarea as JoyTextarea } from "@mui/joy";
2072
2360
  import { motion as motion27 } from "framer-motion";
2073
2361
  var MotionTextarea = motion27(JoyTextarea);
2074
2362
  var Textarea = (props) => {
2075
- return /* @__PURE__ */ React22.createElement(MotionTextarea, { ...props });
2363
+ return /* @__PURE__ */ React23.createElement(MotionTextarea, { ...props });
2076
2364
  };
2077
2365
  Textarea.displayName = "Textarea";
2078
2366
 
2079
2367
  // src/components/ThemeProvider/ThemeProvider.tsx
2080
- import React23 from "react";
2368
+ import React24 from "react";
2081
2369
  import {
2082
2370
  CssBaseline,
2083
2371
  CssVarsProvider,
@@ -2124,17 +2412,17 @@ var defaultTheme = extendTheme({
2124
2412
  }
2125
2413
  });
2126
2414
  function ThemeProvider(props) {
2127
- return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(CssVarsProvider, { theme: defaultTheme }, /* @__PURE__ */ React23.createElement(CssBaseline, null), props.children));
2415
+ return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(CssVarsProvider, { theme: defaultTheme }, /* @__PURE__ */ React24.createElement(CssBaseline, null), props.children));
2128
2416
  }
2129
2417
  ThemeProvider.displayName = "ThemeProvider";
2130
2418
 
2131
2419
  // src/components/Tooltip/Tooltip.tsx
2132
- import React24 from "react";
2420
+ import React25 from "react";
2133
2421
  import { Tooltip as JoyTooltip } from "@mui/joy";
2134
2422
  import { motion as motion28 } from "framer-motion";
2135
2423
  var MotionTooltip = motion28(JoyTooltip);
2136
2424
  var Tooltip = (props) => {
2137
- return /* @__PURE__ */ React24.createElement(MotionTooltip, { ...props });
2425
+ return /* @__PURE__ */ React25.createElement(MotionTooltip, { ...props });
2138
2426
  };
2139
2427
  Tooltip.displayName = "Tooltip";
2140
2428
  export {
@@ -2196,6 +2484,7 @@ export {
2196
2484
  ModalDialog,
2197
2485
  ModalFrame,
2198
2486
  ModalOverflow,
2487
+ MonthRangePicker,
2199
2488
  Option,
2200
2489
  Radio,
2201
2490
  RadioGroup,