@ceed/ads 0.0.77 → 0.0.79

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.
@@ -9,6 +9,7 @@ interface DatePickerProps {
9
9
  }) => void;
10
10
  name?: string;
11
11
  disabled?: boolean;
12
+ required?: boolean;
12
13
  label?: React.ReactNode;
13
14
  error?: boolean;
14
15
  helperText?: React.ReactNode;
@@ -9,6 +9,7 @@ interface DateRangePickerProps {
9
9
  }) => void;
10
10
  name?: string;
11
11
  disabled?: boolean;
12
+ required?: boolean;
12
13
  label?: React.ReactNode;
13
14
  error?: boolean;
14
15
  helperText?: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare const Modal: import("framer-motion").CustomDomComponent<Pick<import("@mui/base").ModalOwnProps, "children" | "container" | "open" | "disablePortal" | "keepMounted" | "disableAutoFocus" | "disableEnforceFocus" | "disableRestoreFocus" | "disableEscapeKeyDown" | "disableScrollLock" | "hideBackdrop"> & {
3
- onClose?: ((event: {}, reason: "backdropClick" | "escapeKeyDown" | "closeClick") => void) | undefined;
3
+ onClose?: ((event: {}, reason: "escapeKeyDown" | "backdropClick" | "closeClick") => void) | undefined;
4
4
  sx?: import("@mui/joy/styles/types").SxProps | undefined;
5
5
  } & import("@mui/joy").ModalSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
6
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
@@ -9,6 +9,7 @@ interface MonthRangePickerProps {
9
9
  }) => void;
10
10
  name?: string;
11
11
  disabled?: boolean;
12
+ required?: boolean;
12
13
  label?: React.ReactNode;
13
14
  error?: boolean;
14
15
  helperText?: React.ReactNode;
package/dist/index.js CHANGED
@@ -173,11 +173,41 @@ var FormHelperText_default = FormHelperText;
173
173
 
174
174
  // src/components/Autocomplete/Autocomplete.tsx
175
175
  function Autocomplete(props) {
176
- const { label, error, helperText, color, size, disabled, ...innerProps } = props;
176
+ const {
177
+ label,
178
+ error,
179
+ helperText,
180
+ color,
181
+ size,
182
+ disabled,
183
+ required,
184
+ ...innerProps
185
+ } = props;
177
186
  if (label) {
178
- return /* @__PURE__ */ React2.createElement(FormControl_default, { color, size, error, disabled }, /* @__PURE__ */ React2.createElement(FormLabel_default, null, label), /* @__PURE__ */ React2.createElement(JoyAutocomplete, { ...innerProps }), helperText && /* @__PURE__ */ React2.createElement(FormHelperText_default, null, helperText));
187
+ return /* @__PURE__ */ React2.createElement(
188
+ FormControl_default,
189
+ {
190
+ required,
191
+ color,
192
+ size,
193
+ error,
194
+ disabled
195
+ },
196
+ /* @__PURE__ */ React2.createElement(FormLabel_default, null, label),
197
+ /* @__PURE__ */ React2.createElement(JoyAutocomplete, { ...innerProps }),
198
+ helperText && /* @__PURE__ */ React2.createElement(FormHelperText_default, null, helperText)
199
+ );
179
200
  }
180
- return /* @__PURE__ */ React2.createElement(JoyAutocomplete, { ...innerProps, color, size, disabled });
201
+ return /* @__PURE__ */ React2.createElement(
202
+ JoyAutocomplete,
203
+ {
204
+ ...innerProps,
205
+ required,
206
+ color,
207
+ size,
208
+ disabled
209
+ }
210
+ );
181
211
  }
182
212
  Autocomplete.displayName = "Autocomplete";
183
213
 
@@ -1497,7 +1527,7 @@ function DataTable(props) {
1497
1527
  justifyContent: "space-between",
1498
1528
  alignItems: "center"
1499
1529
  },
1500
- /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React13.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(rowCount ?? rows.length), " items")), isTotalSelected && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(rowCount ?? rows.length), " items are selected."), /* @__PURE__ */ React13.createElement(
1530
+ !!checkboxSelection && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React13.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(rowCount ?? rows.length), " items")), isTotalSelected && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(rowCount ?? rows.length), " items are selected."), /* @__PURE__ */ React13.createElement(
1501
1531
  Button_default,
1502
1532
  {
1503
1533
  size: "sm",
@@ -1623,11 +1653,42 @@ import { Input as JoyInput } from "@mui/joy";
1623
1653
  import { motion as motion15 } from "framer-motion";
1624
1654
  var MotionInput = motion15(JoyInput);
1625
1655
  var Input = (props) => {
1626
- const { label, helperText, error, style, size, color, disabled, ...innerProps } = props;
1656
+ const {
1657
+ label,
1658
+ helperText,
1659
+ error,
1660
+ style,
1661
+ size,
1662
+ color,
1663
+ disabled,
1664
+ required,
1665
+ ...innerProps
1666
+ } = props;
1627
1667
  if (label) {
1628
- return /* @__PURE__ */ React14.createElement(FormControl_default, { color, size, error, disabled }, /* @__PURE__ */ React14.createElement(FormLabel_default, null, label), /* @__PURE__ */ React14.createElement(MotionInput, { ...innerProps }), helperText && /* @__PURE__ */ React14.createElement(FormHelperText_default, null, helperText));
1668
+ return /* @__PURE__ */ React14.createElement(
1669
+ FormControl_default,
1670
+ {
1671
+ required,
1672
+ color,
1673
+ size,
1674
+ error,
1675
+ disabled
1676
+ },
1677
+ /* @__PURE__ */ React14.createElement(FormLabel_default, null, label),
1678
+ /* @__PURE__ */ React14.createElement(MotionInput, { ...innerProps }),
1679
+ helperText && /* @__PURE__ */ React14.createElement(FormHelperText_default, null, helperText)
1680
+ );
1629
1681
  }
1630
- return /* @__PURE__ */ React14.createElement(MotionInput, { color, size, disabled, ...innerProps });
1682
+ return /* @__PURE__ */ React14.createElement(
1683
+ MotionInput,
1684
+ {
1685
+ required,
1686
+ color,
1687
+ size,
1688
+ disabled,
1689
+ ...innerProps
1690
+ }
1691
+ );
1631
1692
  };
1632
1693
  Input.displayName = "Input";
1633
1694
 
@@ -1724,7 +1785,18 @@ var TextMaskAdapter = React15.forwardRef(
1724
1785
  );
1725
1786
  var DatePicker = forwardRef4(
1726
1787
  (props, ref) => {
1727
- const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast } = props;
1788
+ const {
1789
+ onChange,
1790
+ disabled,
1791
+ label,
1792
+ error,
1793
+ helperText,
1794
+ minDate,
1795
+ maxDate,
1796
+ disableFuture,
1797
+ disablePast,
1798
+ required
1799
+ } = props;
1728
1800
  const [value, setValue] = useState4(props.value || "");
1729
1801
  const [anchorEl, setAnchorEl] = useState4(null);
1730
1802
  const open = Boolean(anchorEl);
@@ -1750,6 +1822,7 @@ var DatePicker = forwardRef4(
1750
1822
  onChange: handleChange,
1751
1823
  placeholder: "YYYY/MM/DD",
1752
1824
  disabled,
1825
+ required,
1753
1826
  slotProps: { input: { component: TextMaskAdapter } },
1754
1827
  sx: {
1755
1828
  // NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
@@ -1809,7 +1882,18 @@ var DatePicker = forwardRef4(
1809
1882
  )))
1810
1883
  )));
1811
1884
  if (label) {
1812
- return /* @__PURE__ */ React15.createElement(FormControl_default, { disabled, error, size: "sm" }, /* @__PURE__ */ React15.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React15.createElement(FormHelperText_default, null, helperText));
1885
+ return /* @__PURE__ */ React15.createElement(
1886
+ FormControl_default,
1887
+ {
1888
+ required,
1889
+ disabled,
1890
+ error,
1891
+ size: "sm"
1892
+ },
1893
+ /* @__PURE__ */ React15.createElement(FormLabel_default, null, label),
1894
+ picker,
1895
+ helperText && /* @__PURE__ */ React15.createElement(FormHelperText_default, null, helperText)
1896
+ );
1813
1897
  }
1814
1898
  return picker;
1815
1899
  }
@@ -1910,7 +1994,18 @@ var TextMaskAdapter3 = React16.forwardRef(
1910
1994
  );
1911
1995
  var DateRangePicker = forwardRef5(
1912
1996
  (props, ref) => {
1913
- const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast } = props;
1997
+ const {
1998
+ onChange,
1999
+ disabled,
2000
+ label,
2001
+ error,
2002
+ helperText,
2003
+ minDate,
2004
+ maxDate,
2005
+ disableFuture,
2006
+ disablePast,
2007
+ required
2008
+ } = props;
1914
2009
  const [value, setValue] = useState5(props.value || "");
1915
2010
  const [anchorEl, setAnchorEl] = useState5(null);
1916
2011
  const open = Boolean(anchorEl);
@@ -1948,6 +2043,7 @@ var DateRangePicker = forwardRef5(
1948
2043
  value,
1949
2044
  onChange: handleChange,
1950
2045
  disabled,
2046
+ required,
1951
2047
  placeholder: "YYYY/MM/DD - YYYY/MM/DD",
1952
2048
  slotProps: { input: { component: TextMaskAdapter3 } },
1953
2049
  sx: {
@@ -2006,7 +2102,7 @@ var DateRangePicker = forwardRef5(
2006
2102
  )))
2007
2103
  )));
2008
2104
  if (label) {
2009
- return /* @__PURE__ */ React16.createElement(FormControl_default, { disabled, error, size: "sm" }, /* @__PURE__ */ React16.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React16.createElement(FormHelperText_default, null, helperText));
2105
+ return /* @__PURE__ */ React16.createElement(FormControl_default, { required, disabled, error, size: "sm" }, /* @__PURE__ */ React16.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React16.createElement(FormHelperText_default, null, helperText));
2010
2106
  }
2011
2107
  return picker;
2012
2108
  }
@@ -2211,7 +2307,8 @@ var MonthRangePicker = forwardRef6(
2211
2307
  minDate,
2212
2308
  maxDate,
2213
2309
  disableFuture,
2214
- disablePast
2310
+ disablePast,
2311
+ required
2215
2312
  } = props;
2216
2313
  const [value, setValue] = useState6(props.value || "");
2217
2314
  const [anchorEl, setAnchorEl] = useState6(null);
@@ -2250,6 +2347,7 @@ var MonthRangePicker = forwardRef6(
2250
2347
  value,
2251
2348
  onChange: handleChange,
2252
2349
  disabled,
2350
+ required,
2253
2351
  placeholder: "YYYY/MM - YYYY/MM",
2254
2352
  slotProps: { input: { component: TextMaskAdapter5 } },
2255
2353
  sx: {
@@ -2310,7 +2408,7 @@ var MonthRangePicker = forwardRef6(
2310
2408
  )))
2311
2409
  )));
2312
2410
  if (label) {
2313
- return /* @__PURE__ */ React21.createElement(FormControl_default, { disabled, error, size: "sm" }, /* @__PURE__ */ React21.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React21.createElement(FormHelperText_default, null, helperText));
2411
+ return /* @__PURE__ */ React21.createElement(FormControl_default, { required, disabled, error, size: "sm" }, /* @__PURE__ */ React21.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React21.createElement(FormHelperText_default, null, helperText));
2314
2412
  }
2315
2413
  return picker;
2316
2414
  }
@@ -2346,16 +2444,41 @@ var MotionOption = motion24(JoyOption);
2346
2444
  var Option = MotionOption;
2347
2445
  Option.displayName = "Option";
2348
2446
  function Select(props) {
2349
- const { label, helperText, error, size, color, disabled, ...innerProps } = props;
2447
+ const {
2448
+ label,
2449
+ helperText,
2450
+ error,
2451
+ size,
2452
+ color,
2453
+ disabled,
2454
+ required,
2455
+ ...innerProps
2456
+ } = props;
2350
2457
  if (label) {
2351
- return /* @__PURE__ */ React23.createElement(FormControl_default, { disabled, size, color, error }, /* @__PURE__ */ React23.createElement(FormLabel_default, null, label), /* @__PURE__ */ React23.createElement(
2352
- JoySelect,
2458
+ return /* @__PURE__ */ React23.createElement(
2459
+ FormControl_default,
2353
2460
  {
2354
- ...innerProps
2355
- }
2356
- ), helperText && /* @__PURE__ */ React23.createElement(FormHelperText_default, null, helperText));
2461
+ required,
2462
+ disabled,
2463
+ size,
2464
+ color,
2465
+ error
2466
+ },
2467
+ /* @__PURE__ */ React23.createElement(FormLabel_default, null, label),
2468
+ /* @__PURE__ */ React23.createElement(JoySelect, { ...innerProps }),
2469
+ helperText && /* @__PURE__ */ React23.createElement(FormHelperText_default, null, helperText)
2470
+ );
2357
2471
  }
2358
- return /* @__PURE__ */ React23.createElement(JoySelect, { disabled, size, color, ...innerProps });
2472
+ return /* @__PURE__ */ React23.createElement(
2473
+ JoySelect,
2474
+ {
2475
+ required,
2476
+ disabled,
2477
+ size,
2478
+ color,
2479
+ ...innerProps
2480
+ }
2481
+ );
2359
2482
  }
2360
2483
  Select.displayName = "Select";
2361
2484
 
@@ -2428,11 +2551,41 @@ import { Textarea as JoyTextarea } from "@mui/joy";
2428
2551
  import { motion as motion27 } from "framer-motion";
2429
2552
  var MotionTextarea = motion27(JoyTextarea);
2430
2553
  var Textarea = (props) => {
2431
- const { label, error, helperText, color, size, disabled, ...innerProps } = props;
2554
+ const {
2555
+ label,
2556
+ error,
2557
+ helperText,
2558
+ color,
2559
+ size,
2560
+ disabled,
2561
+ required,
2562
+ ...innerProps
2563
+ } = props;
2432
2564
  if (label) {
2433
- return /* @__PURE__ */ React25.createElement(FormControl_default, { disabled, color, size, error }, /* @__PURE__ */ React25.createElement(FormLabel_default, null, label), /* @__PURE__ */ React25.createElement(MotionTextarea, { ...innerProps }), helperText && /* @__PURE__ */ React25.createElement(FormHelperText_default, null, helperText));
2565
+ return /* @__PURE__ */ React25.createElement(
2566
+ FormControl_default,
2567
+ {
2568
+ required,
2569
+ disabled,
2570
+ color,
2571
+ size,
2572
+ error
2573
+ },
2574
+ /* @__PURE__ */ React25.createElement(FormLabel_default, null, label),
2575
+ /* @__PURE__ */ React25.createElement(MotionTextarea, { ...innerProps }),
2576
+ helperText && /* @__PURE__ */ React25.createElement(FormHelperText_default, null, helperText)
2577
+ );
2434
2578
  }
2435
- return /* @__PURE__ */ React25.createElement(MotionTextarea, { disabled, color, size, ...innerProps });
2579
+ return /* @__PURE__ */ React25.createElement(
2580
+ MotionTextarea,
2581
+ {
2582
+ required,
2583
+ disabled,
2584
+ color,
2585
+ size,
2586
+ ...innerProps
2587
+ }
2588
+ );
2436
2589
  };
2437
2590
  Textarea.displayName = "Textarea";
2438
2591