@ceed/ads 1.40.1 → 1.41.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.
package/dist/index.js CHANGED
@@ -260,13 +260,17 @@ var IconButton_default = IconButton;
260
260
  import { useState, useCallback, useEffect, useRef } from "react";
261
261
  function useControlledState(controlledValue, defaultValue, onChange) {
262
262
  const { current: isControlled } = useRef(controlledValue !== void 0);
263
- const [internalValue, setInternalValue] = useState(controlledValue ?? defaultValue);
264
- const displayValue = isControlled ? controlledValue : internalValue;
263
+ const [internalValue, setInternalValue] = useState(controlledValue !== void 0 ? controlledValue : defaultValue);
264
+ const hasWarnedRef = useRef(false);
265
265
  useEffect(() => {
266
- if (isControlled) {
267
- setInternalValue(controlledValue);
268
- }
266
+ if (false) return;
267
+ if (hasWarnedRef.current || isControlled === (controlledValue !== void 0)) return;
268
+ hasWarnedRef.current = true;
269
+ console.warn(
270
+ isControlled ? "useControlledState: A component is changing a controlled input to be uncontrolled. Pass `null` instead of `undefined` to keep it controlled with an empty value." : "useControlledState: A component is changing an uncontrolled input to be controlled. Pass `null` instead of `undefined` for the initial empty value to make it controlled from the first render."
271
+ );
269
272
  }, [isControlled, controlledValue]);
273
+ const displayValue = isControlled ? controlledValue : internalValue;
270
274
  const handleChange = useCallback(
271
275
  (value) => {
272
276
  const newValue = typeof value === "function" ? value(displayValue) : value;
@@ -373,6 +377,7 @@ var AutocompleteListBox = React5.forwardRef((props, ref) => {
373
377
  )
374
378
  ))));
375
379
  });
380
+ var EMPTY_MULTIPLE_VALUE = [];
376
381
  var autocompleteDeleteSize = {
377
382
  sm: "20px",
378
383
  md: "24px",
@@ -415,9 +420,9 @@ function Autocomplete(props) {
415
420
  className,
416
421
  ...innerProps
417
422
  } = props;
418
- const [_value, setValue] = useControlledState(
423
+ const [rawValue, setValue] = useControlledState(
419
424
  props.value,
420
- props.defaultValue || "",
425
+ props.defaultValue ?? null,
421
426
  useCallback2(
422
427
  (value2) => onChange?.({
423
428
  target: {
@@ -428,6 +433,7 @@ function Autocomplete(props) {
428
433
  [onChange, props.name]
429
434
  )
430
435
  );
436
+ const _value = rawValue ?? (props.multiple ? EMPTY_MULTIPLE_VALUE : "");
431
437
  const options = useMemo(
432
438
  () => props.options.map((option) => {
433
439
  if (typeof option !== "object") {
@@ -488,7 +494,7 @@ function Autocomplete(props) {
488
494
  (event, value2) => {
489
495
  const newValue = value2;
490
496
  const _value2 = Array.isArray(newValue) ? newValue.map((value3) => value3.value) : newValue?.value;
491
- setValue(_value2);
497
+ setValue(_value2 ?? null);
492
498
  if (Array.isArray(newValue) && newValue.map((value3) => optionMap.get(value3.value)) || optionMap.get(newValue?.value)) {
493
499
  onChangeComplete?.({
494
500
  ...event,
@@ -1796,7 +1802,7 @@ var Container = forwardRef5(function Container2(props, ref) {
1796
1802
  Container.displayName = "Container";
1797
1803
 
1798
1804
  // src/components/CurrencyInput/CurrencyInput.tsx
1799
- import React17, { useCallback as useCallback8, useMemo as useMemo6, useState as useState7 } from "react";
1805
+ import React17, { useCallback as useCallback8, useMemo as useMemo6 } from "react";
1800
1806
  import { NumericFormat } from "react-number-format";
1801
1807
 
1802
1808
  // src/components/Input/Input.tsx
@@ -1820,6 +1826,10 @@ var Input = React16.forwardRef((props, ref) => {
1820
1826
  onChange,
1821
1827
  name,
1822
1828
  type,
1829
+ // NOTE: value/defaultValue는 아래에서 직접 다루므로 innerProps 스프레드에서 제외한다.
1830
+ // defaultValue가 스프레드에 남으면 항상 정의되는 value와 함께 DOM input에 도달해 React가 경고한다.
1831
+ value: valueProp,
1832
+ defaultValue: defaultValueProp,
1823
1833
  // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
1824
1834
  sx,
1825
1835
  className,
@@ -1832,8 +1842,8 @@ var Input = React16.forwardRef((props, ref) => {
1832
1842
  }
1833
1843
  const [passwordVisible, setPasswordVisible] = useState6(false);
1834
1844
  const [value, setValue] = useControlledState(
1835
- props.value,
1836
- props.defaultValue,
1845
+ valueProp,
1846
+ defaultValueProp ?? null,
1837
1847
  useCallback7(
1838
1848
  (value2) => {
1839
1849
  onChange?.({
@@ -1852,8 +1862,9 @@ var Input = React16.forwardRef((props, ref) => {
1852
1862
  setValue(e.target.value);
1853
1863
  };
1854
1864
  const handleClear = () => {
1855
- setValue(props.defaultValue || "");
1865
+ setValue(defaultValueProp || "");
1856
1866
  };
1867
+ const displayValue = valueProp !== void 0 ? valueProp : value;
1857
1868
  const handleTogglePasswordVisibility = () => {
1858
1869
  setPasswordVisible((prev) => !prev);
1859
1870
  };
@@ -1863,7 +1874,7 @@ var Input = React16.forwardRef((props, ref) => {
1863
1874
  const input = /* @__PURE__ */ React16.createElement(
1864
1875
  MotionInput,
1865
1876
  {
1866
- value,
1877
+ value: displayValue ?? "",
1867
1878
  name,
1868
1879
  onChange: handleChange,
1869
1880
  required,
@@ -1884,7 +1895,7 @@ var Input = React16.forwardRef((props, ref) => {
1884
1895
  "aria-label": passwordVisible ? "Hide password" : "Show password"
1885
1896
  },
1886
1897
  passwordVisible ? /* @__PURE__ */ React16.createElement(VisibilityOffIcon, null) : /* @__PURE__ */ React16.createElement(VisibilityIcon, null)
1887
- )) : null : enableClearable ? /* @__PURE__ */ React16.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React16.createElement(
1898
+ )) : null : enableClearable ? /* @__PURE__ */ React16.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, displayValue && /* @__PURE__ */ React16.createElement(
1888
1899
  IconButton_default,
1889
1900
  {
1890
1901
  onMouseDown: (e) => e.preventDefault(),
@@ -2122,7 +2133,7 @@ var CurrencyInput = React17.forwardRef(function CurrencyInput2(inProps, ref) {
2122
2133
  const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale } = useCurrencySetting(props);
2123
2134
  const [_value, setValue] = useControlledState(
2124
2135
  props.value,
2125
- props.defaultValue,
2136
+ props.defaultValue ?? null,
2126
2137
  useCallback8((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
2127
2138
  );
2128
2139
  const value = useMemo6(() => {
@@ -2137,22 +2148,17 @@ var CurrencyInput = React17.forwardRef(function CurrencyInput2(inProps, ref) {
2137
2148
  }
2138
2149
  return props.max;
2139
2150
  }, [props.max, useMinorUnit, decimalScale]);
2140
- const [isOverLimit, setIsOverLimit] = useState7(!!max && !!value && value > max);
2151
+ const isOverLimit = useMemo6(() => max != null && value != null && value > max, [max, value]);
2141
2152
  const handleChange = useCallback8(
2142
2153
  (event) => {
2143
2154
  if (event.target.value === "") {
2144
- setValue(void 0);
2155
+ setValue(null);
2145
2156
  return;
2146
2157
  }
2147
2158
  const amount = useMinorUnit ? Number(decimalSeparator ? event.target.value?.replace(decimalSeparator, "") : event.target.value) : Number(event.target.value);
2148
- if (!!max && Number(event.target.value) > max) {
2149
- setIsOverLimit(true);
2150
- } else {
2151
- setIsOverLimit(false);
2152
- }
2153
2159
  setValue(amount);
2154
2160
  },
2155
- [decimalSeparator, max, useMinorUnit, setValue]
2161
+ [decimalSeparator, useMinorUnit, setValue]
2156
2162
  );
2157
2163
  return /* @__PURE__ */ React17.createElement(
2158
2164
  CurrencyInputRoot,
@@ -2616,7 +2622,7 @@ var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PU
2616
2622
  // src/components/DataTable/components.tsx
2617
2623
  import React23, {
2618
2624
  useRef as useRef5,
2619
- useState as useState9,
2625
+ useState as useState8,
2620
2626
  useLayoutEffect,
2621
2627
  useMemo as useMemo9,
2622
2628
  useCallback as useCallback10,
@@ -2628,7 +2634,7 @@ import { styled as styled12, useTheme } from "@mui/joy";
2628
2634
  import { AnimatePresence as AnimatePresence2 } from "framer-motion";
2629
2635
 
2630
2636
  // src/components/DatePicker/DatePicker.tsx
2631
- import React19, { forwardRef as forwardRef6, useCallback as useCallback9, useEffect as useEffect4, useImperativeHandle, useRef as useRef4, useState as useState8 } from "react";
2637
+ import React19, { forwardRef as forwardRef6, useCallback as useCallback9, useEffect as useEffect4, useImperativeHandle, useRef as useRef4, useState as useState7 } from "react";
2632
2638
  import { IMaskInput, IMask } from "react-imask";
2633
2639
  import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
2634
2640
  import { styled as styled10, useThemeProps as useThemeProps5 } from "@mui/joy";
@@ -2847,16 +2853,20 @@ var DatePicker = forwardRef6((inProps, ref) => {
2847
2853
  } = props;
2848
2854
  const innerRef = useRef4(null);
2849
2855
  const buttonRef = useRef4(null);
2850
- const [value, setValue] = useControlledState(
2856
+ const [rawValue, setValue] = useControlledState(
2851
2857
  props.value,
2852
- props.defaultValue || "",
2853
- useCallback9((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
2858
+ props.defaultValue ?? null,
2859
+ useCallback9(
2860
+ (value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
2861
+ [props.name, onChange]
2862
+ )
2854
2863
  );
2864
+ const value = rawValue ?? "";
2855
2865
  const isAlphabeticDisplay = hasAlphabeticMonth(displayFormat);
2856
- const [displayValue, setDisplayValue] = useState8(
2866
+ const [displayValue, setDisplayValue] = useState7(
2857
2867
  () => value ? formatValueString(parseDate(value, format), displayFormat, locale) : ""
2858
2868
  );
2859
- const [anchorEl, setAnchorEl] = useState8(null);
2869
+ const [anchorEl, setAnchorEl] = useState7(null);
2860
2870
  const open = Boolean(anchorEl);
2861
2871
  useEffect4(() => {
2862
2872
  if (!anchorEl) {
@@ -3309,7 +3319,7 @@ var TextEllipsis = ({
3309
3319
  ...rest
3310
3320
  }) => {
3311
3321
  const textRef = useRef5(null);
3312
- const [showTooltip, setShowTooltip] = useState9(false);
3322
+ const [showTooltip, setShowTooltip] = useState8(false);
3313
3323
  useLayoutEffect(() => {
3314
3324
  const element = textRef.current;
3315
3325
  if (!element) return;
@@ -3326,7 +3336,7 @@ var TextEllipsis = ({
3326
3336
  };
3327
3337
  var CellTextEllipsis = ({ children }) => {
3328
3338
  const textRef = useRef5(null);
3329
- const [showTooltip, setShowTooltip] = useState9(false);
3339
+ const [showTooltip, setShowTooltip] = useState8(false);
3330
3340
  useLayoutEffect(() => {
3331
3341
  const element = textRef.current;
3332
3342
  if (element) {
@@ -3384,7 +3394,7 @@ var HeadCell = (props) => {
3384
3394
  useLayoutEffect(() => {
3385
3395
  ref.current = localRef.current;
3386
3396
  }, [ref]);
3387
- const [isHovered, setIsHovered] = useState9(false);
3397
+ const [isHovered, setIsHovered] = useState8(false);
3388
3398
  const sortable = type === "actions" ? false : _sortable;
3389
3399
  const headId = useMemo9(
3390
3400
  () => `${tableId}_header_${headerName ?? field}`.trim(),
@@ -3513,7 +3523,7 @@ var BodyCell = (props) => {
3513
3523
  onCellEditStop
3514
3524
  } = props;
3515
3525
  const theme = useTheme();
3516
- const [value, setValue] = useState9(row[field]);
3526
+ const [value, setValue] = useState8(row[field]);
3517
3527
  const cellRef = useRef5(null);
3518
3528
  const params = useMemo9(
3519
3529
  () => ({
@@ -3735,9 +3745,9 @@ var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
3735
3745
  });
3736
3746
 
3737
3747
  // src/components/DataTable/hooks.ts
3738
- import { useState as useState10, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useMemo as useMemo10, useCallback as useCallback11, useEffect as useEffect6, createRef } from "react";
3748
+ import { useState as useState9, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useMemo as useMemo10, useCallback as useCallback11, useEffect as useEffect6, createRef } from "react";
3739
3749
  function useColumnWidths(columnsByField) {
3740
- const [widths, setWidths] = useState10({});
3750
+ const [widths, setWidths] = useState9({});
3741
3751
  const roRef = useRef6();
3742
3752
  useLayoutEffect2(() => {
3743
3753
  if (roRef.current) roRef.current.disconnect();
@@ -3798,8 +3808,8 @@ function useDataTableRenderer({
3798
3808
  }
3799
3809
  const onSelectionModelChangeRef = useRef6(onSelectionModelChange);
3800
3810
  onSelectionModelChangeRef.current = onSelectionModelChange;
3801
- const [focusedRowId, setFocusedRowId] = useState10(null);
3802
- const [selectionAnchor, setSelectionAnchor] = useState10(null);
3811
+ const [focusedRowId, setFocusedRowId] = useState9(null);
3812
+ const [selectionAnchor, setSelectionAnchor] = useState9(null);
3803
3813
  const [sortModel, setSortModel] = useControlledState(
3804
3814
  controlledSortModel,
3805
3815
  initialState?.sorting?.sortModel ?? [],
@@ -3891,7 +3901,7 @@ function useDataTableRenderer({
3891
3901
  () => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
3892
3902
  [_sortOrder]
3893
3903
  );
3894
- const [page, setPage] = useState10(paginationModel?.page || 1);
3904
+ const [page, setPage] = useState9(paginationModel?.page || 1);
3895
3905
  const pageSize = paginationModel?.pageSize || 20;
3896
3906
  const getId = useCallback11(
3897
3907
  (row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
@@ -4934,7 +4944,7 @@ var DataTable = forwardRef7(Component);
4934
4944
  DataTable.displayName = "DataTable";
4935
4945
 
4936
4946
  // src/components/DateRangePicker/DateRangePicker.tsx
4937
- import React27, { forwardRef as forwardRef8, useCallback as useCallback14, useEffect as useEffect8, useImperativeHandle as useImperativeHandle3, useMemo as useMemo12, useRef as useRef8, useState as useState11 } from "react";
4947
+ import React27, { forwardRef as forwardRef8, useCallback as useCallback14, useEffect as useEffect8, useImperativeHandle as useImperativeHandle3, useMemo as useMemo12, useRef as useRef8, useState as useState10 } from "react";
4938
4948
  import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
4939
4949
  import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
4940
4950
  import { styled as styled14, useThemeProps as useThemeProps7 } from "@mui/joy";
@@ -5141,16 +5151,20 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
5141
5151
  } = props;
5142
5152
  const innerRef = useRef8(null);
5143
5153
  const buttonRef = useRef8(null);
5144
- const [value, setValue] = useControlledState(
5154
+ const [rawValue, setValue] = useControlledState(
5145
5155
  props.value,
5146
- props.defaultValue || "",
5147
- useCallback14((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
5156
+ props.defaultValue ?? null,
5157
+ useCallback14(
5158
+ (value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
5159
+ [props.name, onChange]
5160
+ )
5148
5161
  );
5162
+ const value = rawValue ?? "";
5149
5163
  const isAlphabeticDisplay = hasAlphabeticMonth2(displayFormat);
5150
- const [displayValue, setDisplayValue] = useState11(
5164
+ const [displayValue, setDisplayValue] = useState10(
5151
5165
  () => value ? formatValueString2(parseDates(value, format), displayFormat, locale) : ""
5152
5166
  );
5153
- const [anchorEl, setAnchorEl] = useState11(null);
5167
+ const [anchorEl, setAnchorEl] = useState10(null);
5154
5168
  const open = Boolean(anchorEl);
5155
5169
  const calendarValue = useMemo12(
5156
5170
  () => value ? parseDates(value, format) : void 0,
@@ -5495,14 +5509,15 @@ var InsetDrawer = styled19(JoyDrawer)(({ theme }) => ({
5495
5509
  }));
5496
5510
 
5497
5511
  // src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
5498
- import React31, { useCallback as useCallback15, useEffect as useEffect9, useMemo as useMemo13, useRef as useRef9, useState as useState12 } from "react";
5512
+ import React31, { useCallback as useCallback15, useEffect as useEffect9, useMemo as useMemo13, useRef as useRef9, useState as useState11 } from "react";
5499
5513
  import SearchIcon from "@mui/icons-material/Search";
5500
5514
  import { useThemeProps as useThemeProps8 } from "@mui/joy";
5501
5515
  import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
5516
+ var EMPTY_VALUE = [];
5502
5517
  function LabelWithTooltip(props) {
5503
5518
  const { label, size } = props;
5504
5519
  const labelContentRef = useRef9(null);
5505
- const [isOverflowing, setIsOverflowing] = useState12(false);
5520
+ const [isOverflowing, setIsOverflowing] = useState11(false);
5506
5521
  const labelContent = /* @__PURE__ */ React31.createElement(
5507
5522
  "span",
5508
5523
  {
@@ -5544,13 +5559,14 @@ function FilterableCheckboxGroup(inProps) {
5544
5559
  maxHeight = 300,
5545
5560
  disabled
5546
5561
  } = props;
5547
- const [searchTerm, setSearchTerm] = useState12("");
5548
- const [sortedOptions, setSortedOptions] = useState12(options);
5549
- const [internalValue, setInternalValue] = useControlledState(
5562
+ const [searchTerm, setSearchTerm] = useState11("");
5563
+ const [sortedOptions, setSortedOptions] = useState11(options);
5564
+ const [rawValue, setInternalValue] = useControlledState(
5550
5565
  value,
5551
- value ?? [],
5552
- useCallback15((newValue) => onChange?.(newValue), [onChange])
5566
+ value ?? EMPTY_VALUE,
5567
+ useCallback15((newValue) => onChange?.(newValue ?? []), [onChange])
5553
5568
  );
5569
+ const internalValue = rawValue ?? EMPTY_VALUE;
5554
5570
  const parentRef = useRef9(null);
5555
5571
  const isInitialSortRef = useRef9(false);
5556
5572
  const prevOptionsRef = useRef9([...options]);
@@ -5821,7 +5837,7 @@ function RadioGroup2(props) {
5821
5837
  RadioGroup2.displayName = "RadioGroup";
5822
5838
 
5823
5839
  // src/components/FilterMenu/components/DateRange.tsx
5824
- import React35, { useCallback as useCallback19, useMemo as useMemo14, useState as useState13, useEffect as useEffect10 } from "react";
5840
+ import React35, { useCallback as useCallback19, useMemo as useMemo14, useState as useState12, useEffect as useEffect10 } from "react";
5825
5841
  import { Stack as Stack5 } from "@mui/joy";
5826
5842
  function DateRange(props) {
5827
5843
  const {
@@ -5839,7 +5855,7 @@ function DateRange(props) {
5839
5855
  hideClearButton
5840
5856
  } = props;
5841
5857
  const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
5842
- const [selectedOption, setSelectedOption] = useState13("all-time");
5858
+ const [selectedOption, setSelectedOption] = useState12("all-time");
5843
5859
  const dateRangeOptions = useMemo14(
5844
5860
  () => [
5845
5861
  { label: "All Time", value: "all-time" },
@@ -5968,7 +5984,7 @@ import React37, { useCallback as useCallback21, useMemo as useMemo16 } from "rea
5968
5984
  import { Stack as Stack6 } from "@mui/joy";
5969
5985
 
5970
5986
  // src/components/MonthRangePicker/MonthRangePicker.tsx
5971
- import React36, { forwardRef as forwardRef9, useCallback as useCallback20, useEffect as useEffect11, useImperativeHandle as useImperativeHandle4, useMemo as useMemo15, useRef as useRef10, useState as useState14 } from "react";
5987
+ import React36, { forwardRef as forwardRef9, useCallback as useCallback20, useEffect as useEffect11, useImperativeHandle as useImperativeHandle4, useMemo as useMemo15, useRef as useRef10, useState as useState13 } from "react";
5972
5988
  import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
5973
5989
  import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
5974
5990
  import { styled as styled20, useThemeProps as useThemeProps9 } from "@mui/joy";
@@ -6085,15 +6101,19 @@ var MonthRangePicker = forwardRef9((inProps, ref) => {
6085
6101
  const isAlphabeticDisplay = hasAlphabeticMonth3(displayFormat);
6086
6102
  const innerRef = useRef10(null);
6087
6103
  const buttonRef = useRef10(null);
6088
- const [value, setValue] = useControlledState(
6104
+ const [rawValue, setValue] = useControlledState(
6089
6105
  props.value,
6090
- props.defaultValue || "",
6091
- useCallback20((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
6106
+ props.defaultValue ?? null,
6107
+ useCallback20(
6108
+ (value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
6109
+ [props.name, onChange]
6110
+ )
6092
6111
  );
6093
- const [displayValue, setDisplayValue] = useState14(
6112
+ const value = rawValue ?? "";
6113
+ const [displayValue, setDisplayValue] = useState13(
6094
6114
  () => value ? formatValueString3(parseDates2(value), displayFormat, locale) : ""
6095
6115
  );
6096
- const [anchorEl, setAnchorEl] = useState14(null);
6116
+ const [anchorEl, setAnchorEl] = useState13(null);
6097
6117
  const open = Boolean(anchorEl);
6098
6118
  const calendarValue = useMemo15(() => value ? parseDates2(value) : void 0, [value]);
6099
6119
  useEffect11(() => {
@@ -6316,7 +6336,7 @@ function CurrencyInput3(props) {
6316
6336
  const [internalValue, setInternalValue] = useControlledState(value, value, onChange);
6317
6337
  const handleCurrencyChange = useCallback22(
6318
6338
  (event) => {
6319
- const newValue = event.target.value;
6339
+ const newValue = event.target.value ?? void 0;
6320
6340
  setInternalValue(newValue);
6321
6341
  },
6322
6342
  [setInternalValue]
@@ -6349,7 +6369,7 @@ function CurrencyRange(props) {
6349
6369
  const maxValue = internalValue?.[1];
6350
6370
  const handleMinChange = useCallback23(
6351
6371
  (event) => {
6352
- const newMinValue = event.target.value;
6372
+ const newMinValue = event.target.value ?? void 0;
6353
6373
  const currentMaxValue = maxValue;
6354
6374
  if (newMinValue !== void 0 && currentMaxValue !== void 0) {
6355
6375
  setInternalValue([newMinValue, currentMaxValue]);
@@ -6363,7 +6383,7 @@ function CurrencyRange(props) {
6363
6383
  );
6364
6384
  const handleMaxChange = useCallback23(
6365
6385
  (event) => {
6366
- const newMaxValue = event.target.value;
6386
+ const newMaxValue = event.target.value ?? void 0;
6367
6387
  const currentMinValue = minValue;
6368
6388
  if (currentMinValue !== void 0 && newMaxValue !== void 0) {
6369
6389
  setInternalValue([currentMinValue, newMaxValue]);
@@ -6413,7 +6433,7 @@ import React41 from "react";
6413
6433
  import { Stack as Stack9, Typography as Typography5 } from "@mui/joy";
6414
6434
 
6415
6435
  // src/components/PercentageInput/PercentageInput.tsx
6416
- import React40, { useCallback as useCallback24, useMemo as useMemo17, useState as useState15 } from "react";
6436
+ import React40, { useCallback as useCallback24, useMemo as useMemo17 } from "react";
6417
6437
  import { NumericFormat as NumericFormat2 } from "react-number-format";
6418
6438
  import { styled as styled21, useThemeProps as useThemeProps10 } from "@mui/joy";
6419
6439
  var padDecimal = (value, decimalScale) => {
@@ -6469,34 +6489,30 @@ var PercentageInput = React40.forwardRef(
6469
6489
  } = props;
6470
6490
  const [_value, setValue] = useControlledState(
6471
6491
  props.value,
6472
- props.defaultValue,
6492
+ props.defaultValue ?? null,
6473
6493
  useCallback24((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
6474
6494
  );
6475
- const [internalError, setInternalError] = useState15(
6476
- max && _value && _value > max || min && _value && _value < min
6477
- );
6478
6495
  const value = useMemo17(() => {
6479
6496
  if (_value && useMinorUnit) {
6480
6497
  return _value / Math.pow(10, maxDecimalScale);
6481
6498
  }
6482
6499
  return _value;
6483
6500
  }, [_value, useMinorUnit, maxDecimalScale]);
6501
+ const internalError = useMemo17(
6502
+ () => value != null && (max != null && value > max || min != null && value < min),
6503
+ [max, min, value]
6504
+ );
6484
6505
  const handleChange = useCallback24(
6485
6506
  (event) => {
6486
6507
  if (event.target.value === "") {
6487
- setValue(void 0);
6508
+ setValue(null);
6488
6509
  return;
6489
6510
  }
6490
6511
  const originalAmount = Number(event.target.value);
6491
- if (min && originalAmount < min || max && originalAmount > max) {
6492
- setInternalError(true);
6493
- } else {
6494
- setInternalError(false);
6495
- }
6496
6512
  const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
6497
6513
  setValue(amount);
6498
6514
  },
6499
- [setValue, useMinorUnit, maxDecimalScale, min, max]
6515
+ [setValue, useMinorUnit, maxDecimalScale]
6500
6516
  );
6501
6517
  return /* @__PURE__ */ React40.createElement(
6502
6518
  PercentageInputRoot,
@@ -6549,7 +6565,7 @@ var PercentageInput3 = ({
6549
6565
  PercentageInput,
6550
6566
  {
6551
6567
  value: _value,
6552
- onChange: (event) => setValue(event.target.value),
6568
+ onChange: (event) => setValue(event.target.value ?? void 0),
6553
6569
  useMinorUnit,
6554
6570
  maxDecimalScale,
6555
6571
  min,
@@ -6573,7 +6589,7 @@ function PercentageRange(props) {
6573
6589
  const maxValue = internalValue?.[1];
6574
6590
  const handleMinChange = useCallback25(
6575
6591
  (event) => {
6576
- const newMinValue = event.target.value;
6592
+ const newMinValue = event.target.value ?? void 0;
6577
6593
  const currentMaxValue = maxValue;
6578
6594
  if (newMinValue !== void 0) {
6579
6595
  setInternalValue([newMinValue, currentMaxValue || null]);
@@ -6585,7 +6601,7 @@ function PercentageRange(props) {
6585
6601
  );
6586
6602
  const handleMaxChange = useCallback25(
6587
6603
  (event) => {
6588
- const newMaxValue = event.target.value;
6604
+ const newMaxValue = event.target.value ?? void 0;
6589
6605
  const currentMinValue = minValue;
6590
6606
  if (newMaxValue !== void 0) {
6591
6607
  setInternalValue([currentMinValue || null, newMaxValue]);
@@ -6639,7 +6655,7 @@ function Autocomplete2(props) {
6639
6655
  const autocompleteValue = typeof internalValue === "string" || typeof internalValue === "number" ? String(internalValue) : void 0;
6640
6656
  const handleChange = useCallback26(
6641
6657
  (event) => {
6642
- const val = event.target.value;
6658
+ const val = event.target.value ?? void 0;
6643
6659
  if (val) {
6644
6660
  const numVal = Number(val);
6645
6661
  setInternalValue(!isNaN(numVal) && isFinite(numVal) ? numVal : val);
@@ -6742,7 +6758,7 @@ function FilterMenu(props) {
6742
6758
  FilterMenu.displayName = "FilterMenu";
6743
6759
 
6744
6760
  // src/components/Uploader/Uploader.tsx
6745
- import React45, { useCallback as useCallback28, useEffect as useEffect13, useMemo as useMemo18, useRef as useRef11, useState as useState16 } from "react";
6761
+ import React45, { useCallback as useCallback28, useEffect as useEffect13, useMemo as useMemo18, useRef as useRef11, useState as useState14 } from "react";
6746
6762
  import { styled as styled22, Input as Input2 } from "@mui/joy";
6747
6763
  import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
6748
6764
  import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
@@ -6892,10 +6908,10 @@ var Uploader = React45.memo((props) => {
6892
6908
  } = props;
6893
6909
  const dropZoneRef = useRef11(null);
6894
6910
  const inputRef = useRef11(null);
6895
- const [errorText, setErrorText] = useState16();
6896
- const [files, setFiles] = useState16([]);
6897
- const [uploaded, setUploaded] = useState16(props.uploaded || []);
6898
- const [previewState, setPreviewState] = useState16("idle");
6911
+ const [errorText, setErrorText] = useState14();
6912
+ const [files, setFiles] = useState14([]);
6913
+ const [uploaded, setUploaded] = useState14(props.uploaded || []);
6914
+ const [previewState, setPreviewState] = useState14("idle");
6899
6915
  const accepts = useMemo18(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
6900
6916
  const parsedAccepts = useMemo18(
6901
6917
  () => accepts.flatMap((type) => {
@@ -7157,13 +7173,13 @@ function IconMenuButton(props) {
7157
7173
  IconMenuButton.displayName = "IconMenuButton";
7158
7174
 
7159
7175
  // src/components/Markdown/Markdown.tsx
7160
- import React47, { lazy, Suspense, useEffect as useEffect14, useState as useState17 } from "react";
7176
+ import React47, { lazy, Suspense, useEffect as useEffect14, useState as useState15 } from "react";
7161
7177
  import { Skeleton } from "@mui/joy";
7162
7178
  import { Link as Link2 } from "@mui/joy";
7163
7179
  import remarkGfm from "remark-gfm";
7164
7180
  var LazyReactMarkdown = lazy(() => import("react-markdown"));
7165
7181
  var Markdown = (props) => {
7166
- const [rehypeAccent, setRehypeAccent] = useState17(null);
7182
+ const [rehypeAccent, setRehypeAccent] = useState15(null);
7167
7183
  useEffect14(() => {
7168
7184
  const loadRehypeAccent = async () => {
7169
7185
  const module = await import("./chunks/rehype-accent-FZRUD7VI.js");
@@ -7345,7 +7361,7 @@ function MenuButton2(props) {
7345
7361
  MenuButton2.displayName = "MenuButton";
7346
7362
 
7347
7363
  // src/components/MonthPicker/MonthPicker.tsx
7348
- import React49, { forwardRef as forwardRef10, useCallback as useCallback29, useEffect as useEffect15, useImperativeHandle as useImperativeHandle5, useRef as useRef12, useState as useState18 } from "react";
7364
+ import React49, { forwardRef as forwardRef10, useCallback as useCallback29, useEffect as useEffect15, useImperativeHandle as useImperativeHandle5, useRef as useRef12, useState as useState16 } from "react";
7349
7365
  import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
7350
7366
  import { styled as styled23, useThemeProps as useThemeProps11 } from "@mui/joy";
7351
7367
  import { FocusTrap as FocusTrap4, ClickAwayListener as ClickAwayListener4, Popper as Popper5 } from "@mui/base";
@@ -7430,11 +7446,15 @@ var MonthPicker = forwardRef10((inProps, ref) => {
7430
7446
  } = props;
7431
7447
  const innerRef = useRef12(null);
7432
7448
  const buttonRef = useRef12(null);
7433
- const [value, setValue, isControlled] = useControlledState(
7449
+ const [rawValue, setValue, isControlled] = useControlledState(
7434
7450
  props.value,
7435
- props.defaultValue || "",
7436
- useCallback29((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
7451
+ props.defaultValue ?? null,
7452
+ useCallback29(
7453
+ (value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
7454
+ [props.name, onChange]
7455
+ )
7437
7456
  );
7457
+ const value = rawValue ?? "";
7438
7458
  const getFormattedDisplayValue = useCallback29(
7439
7459
  (inputValue) => {
7440
7460
  if (!inputValue) return "";
@@ -7446,8 +7466,8 @@ var MonthPicker = forwardRef10((inProps, ref) => {
7446
7466
  },
7447
7467
  [format, displayFormat, locale]
7448
7468
  );
7449
- const [displayValue, setDisplayValue] = useState18(() => getFormattedDisplayValue(value));
7450
- const [anchorEl, setAnchorEl] = useState18(null);
7469
+ const [displayValue, setDisplayValue] = useState16(() => getFormattedDisplayValue(value));
7470
+ const [anchorEl, setAnchorEl] = useState16(null);
7451
7471
  const open = Boolean(anchorEl);
7452
7472
  useEffect15(() => {
7453
7473
  if (!anchorEl) {