@ceed/cds 1.14.0 → 1.15.0-next.2
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/components/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +21 -0
- package/dist/components/FilterableCheckboxGroup/index.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inputs/FilterableCheckboxGroup.md +179 -0
- package/dist/components/inputs/llms.txt +1 -0
- package/dist/index.cjs +485 -301
- package/dist/index.d.ts +1 -1
- package/dist/index.js +308 -124
- package/dist/llms.txt +1 -0
- package/framer/index.js +38 -38
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -4442,11 +4442,194 @@ var InsetDrawer = styled20(JoyDrawer2)(({ theme }) => ({
|
|
|
4442
4442
|
}
|
|
4443
4443
|
}));
|
|
4444
4444
|
|
|
4445
|
+
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
4446
|
+
import React31, { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo12, useRef as useRef8, useState as useState10 } from "react";
|
|
4447
|
+
import { Input as Input2, Stack as Stack2 } from "@mui/joy";
|
|
4448
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
4449
|
+
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
4450
|
+
function FilterableCheckboxGroup(props) {
|
|
4451
|
+
const { value, options, label, placeholder, helperText, size = "md", required, onChange, maxHeight = 300 } = props;
|
|
4452
|
+
const [searchTerm, setSearchTerm] = useState10("");
|
|
4453
|
+
const [sortedOptions, setSortedOptions] = useState10(options);
|
|
4454
|
+
const [internalValue, setInternalValue] = useControlledState(
|
|
4455
|
+
value,
|
|
4456
|
+
value ?? [],
|
|
4457
|
+
useCallback13((newValue) => onChange?.(newValue), [onChange])
|
|
4458
|
+
);
|
|
4459
|
+
const parentRef = useRef8(null);
|
|
4460
|
+
const isInitialSortRef = useRef8(false);
|
|
4461
|
+
const filteredOptions = useMemo12(() => {
|
|
4462
|
+
if (!searchTerm) return sortedOptions;
|
|
4463
|
+
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
4464
|
+
}, [sortedOptions, searchTerm]);
|
|
4465
|
+
const itemSize = useMemo12(() => {
|
|
4466
|
+
switch (size) {
|
|
4467
|
+
case "sm":
|
|
4468
|
+
return 28;
|
|
4469
|
+
case "md":
|
|
4470
|
+
return 32;
|
|
4471
|
+
case "lg":
|
|
4472
|
+
return 36;
|
|
4473
|
+
}
|
|
4474
|
+
}, [size]);
|
|
4475
|
+
const noOptionsFontSize = useMemo12(() => {
|
|
4476
|
+
switch (size) {
|
|
4477
|
+
case "sm":
|
|
4478
|
+
return "14px";
|
|
4479
|
+
case "md":
|
|
4480
|
+
return "16px";
|
|
4481
|
+
case "lg":
|
|
4482
|
+
return "18px";
|
|
4483
|
+
}
|
|
4484
|
+
}, [size]);
|
|
4485
|
+
const virtualizer = useVirtualizer3({
|
|
4486
|
+
count: filteredOptions.length,
|
|
4487
|
+
estimateSize: () => itemSize,
|
|
4488
|
+
measureElement: (element) => element.clientHeight,
|
|
4489
|
+
getScrollElement: () => parentRef.current,
|
|
4490
|
+
overscan: 5
|
|
4491
|
+
});
|
|
4492
|
+
const items = virtualizer.getVirtualItems();
|
|
4493
|
+
useEffect8(() => {
|
|
4494
|
+
if (isInitialSortRef.current) return;
|
|
4495
|
+
const initialValue = value ?? [];
|
|
4496
|
+
const sorted = [...options].sort((a, b) => {
|
|
4497
|
+
const aSelected = initialValue.includes(a.value);
|
|
4498
|
+
const bSelected = initialValue.includes(b.value);
|
|
4499
|
+
if (aSelected !== bSelected) {
|
|
4500
|
+
return aSelected ? -1 : 1;
|
|
4501
|
+
}
|
|
4502
|
+
const aIsAlpha = /^[a-zA-Z]/.test(a.label);
|
|
4503
|
+
const bIsAlpha = /^[a-zA-Z]/.test(b.label);
|
|
4504
|
+
if (aIsAlpha !== bIsAlpha) {
|
|
4505
|
+
return aIsAlpha ? -1 : 1;
|
|
4506
|
+
}
|
|
4507
|
+
return a.label.localeCompare(b.label);
|
|
4508
|
+
});
|
|
4509
|
+
setSortedOptions(sorted);
|
|
4510
|
+
isInitialSortRef.current = true;
|
|
4511
|
+
}, [options, value]);
|
|
4512
|
+
useEffect8(() => {
|
|
4513
|
+
virtualizer.measure();
|
|
4514
|
+
}, [virtualizer, filteredOptions]);
|
|
4515
|
+
const handleSearchChange = useCallback13((event) => {
|
|
4516
|
+
setSearchTerm(event.target.value);
|
|
4517
|
+
}, []);
|
|
4518
|
+
const handleCheckboxChange = useCallback13(
|
|
4519
|
+
(optionValue) => (event) => {
|
|
4520
|
+
const checked = event.target.checked;
|
|
4521
|
+
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
4522
|
+
setInternalValue(newValue);
|
|
4523
|
+
},
|
|
4524
|
+
[internalValue, setInternalValue]
|
|
4525
|
+
);
|
|
4526
|
+
const handleSelectAll = useCallback13(
|
|
4527
|
+
(event) => {
|
|
4528
|
+
const checked = event.target.checked;
|
|
4529
|
+
if (checked) {
|
|
4530
|
+
setInternalValue(filteredOptions.map((option) => option.value));
|
|
4531
|
+
} else {
|
|
4532
|
+
setInternalValue([]);
|
|
4533
|
+
}
|
|
4534
|
+
},
|
|
4535
|
+
[filteredOptions, setInternalValue]
|
|
4536
|
+
);
|
|
4537
|
+
const isAllSelected = filteredOptions.length > 0 && filteredOptions.every((option) => internalValue.includes(option.value));
|
|
4538
|
+
const isIndeterminate = !isAllSelected && filteredOptions.some((option) => internalValue.includes(option.value));
|
|
4539
|
+
return /* @__PURE__ */ React31.createElement("div", { style: { width: "100%" } }, /* @__PURE__ */ React31.createElement(FormControl_default, { required, size }, label && /* @__PURE__ */ React31.createElement(FormLabel_default, null, label), /* @__PURE__ */ React31.createElement(
|
|
4540
|
+
Input2,
|
|
4541
|
+
{
|
|
4542
|
+
variant: "outlined",
|
|
4543
|
+
color: "neutral",
|
|
4544
|
+
placeholder,
|
|
4545
|
+
value: searchTerm,
|
|
4546
|
+
onChange: handleSearchChange,
|
|
4547
|
+
size,
|
|
4548
|
+
endDecorator: /* @__PURE__ */ React31.createElement(SearchIcon, null)
|
|
4549
|
+
}
|
|
4550
|
+
), helperText && /* @__PURE__ */ React31.createElement(FormHelperText_default, null, helperText)), filteredOptions.length === 0 ? /* @__PURE__ */ React31.createElement(
|
|
4551
|
+
Stack2,
|
|
4552
|
+
{
|
|
4553
|
+
sx: {
|
|
4554
|
+
padding: "20px 12px",
|
|
4555
|
+
justifyContent: "center",
|
|
4556
|
+
alignItems: "center",
|
|
4557
|
+
fontSize: noOptionsFontSize,
|
|
4558
|
+
color: "#A2AAB8"
|
|
4559
|
+
}
|
|
4560
|
+
},
|
|
4561
|
+
"No options found."
|
|
4562
|
+
) : /* @__PURE__ */ React31.createElement(
|
|
4563
|
+
"div",
|
|
4564
|
+
{
|
|
4565
|
+
ref: parentRef,
|
|
4566
|
+
style: {
|
|
4567
|
+
overflow: "auto",
|
|
4568
|
+
maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight,
|
|
4569
|
+
padding: "8px 0px",
|
|
4570
|
+
marginTop: "8px"
|
|
4571
|
+
}
|
|
4572
|
+
},
|
|
4573
|
+
!searchTerm && /* @__PURE__ */ React31.createElement(
|
|
4574
|
+
Checkbox_default,
|
|
4575
|
+
{
|
|
4576
|
+
label: "Select all",
|
|
4577
|
+
checked: isAllSelected,
|
|
4578
|
+
indeterminate: isIndeterminate,
|
|
4579
|
+
onChange: handleSelectAll,
|
|
4580
|
+
size,
|
|
4581
|
+
slotProps: {
|
|
4582
|
+
action: {
|
|
4583
|
+
sx: { top: 0, left: 0, bottom: 0, right: 0 }
|
|
4584
|
+
}
|
|
4585
|
+
},
|
|
4586
|
+
sx: { width: "100%", height: itemSize }
|
|
4587
|
+
}
|
|
4588
|
+
),
|
|
4589
|
+
/* @__PURE__ */ React31.createElement(
|
|
4590
|
+
Stack2,
|
|
4591
|
+
{
|
|
4592
|
+
sx: {
|
|
4593
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
4594
|
+
position: "relative"
|
|
4595
|
+
}
|
|
4596
|
+
},
|
|
4597
|
+
items.map((virtualRow) => {
|
|
4598
|
+
const option = filteredOptions[virtualRow.index];
|
|
4599
|
+
return /* @__PURE__ */ React31.createElement(
|
|
4600
|
+
Checkbox_default,
|
|
4601
|
+
{
|
|
4602
|
+
key: virtualRow.key,
|
|
4603
|
+
label: option.label,
|
|
4604
|
+
checked: internalValue.includes(option.value),
|
|
4605
|
+
onChange: handleCheckboxChange(option.value),
|
|
4606
|
+
size,
|
|
4607
|
+
slotProps: {
|
|
4608
|
+
action: {
|
|
4609
|
+
sx: { top: 0, left: 0, bottom: 0, right: 0 }
|
|
4610
|
+
}
|
|
4611
|
+
},
|
|
4612
|
+
sx: {
|
|
4613
|
+
position: "absolute",
|
|
4614
|
+
top: 0,
|
|
4615
|
+
left: 0,
|
|
4616
|
+
width: "100%",
|
|
4617
|
+
height: `${virtualRow.size}px`,
|
|
4618
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4621
|
+
);
|
|
4622
|
+
})
|
|
4623
|
+
)
|
|
4624
|
+
));
|
|
4625
|
+
}
|
|
4626
|
+
FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
4627
|
+
|
|
4445
4628
|
// src/components/Grid/Grid.tsx
|
|
4446
4629
|
import { Grid } from "@mui/joy";
|
|
4447
4630
|
|
|
4448
4631
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
4449
|
-
import
|
|
4632
|
+
import React32 from "react";
|
|
4450
4633
|
import { MenuButton as JoyMenuButton2, IconButton as JoyIconButton2 } from "@mui/joy";
|
|
4451
4634
|
function IconMenuButton(props) {
|
|
4452
4635
|
const {
|
|
@@ -4460,7 +4643,7 @@ function IconMenuButton(props) {
|
|
|
4460
4643
|
placement = "bottom"
|
|
4461
4644
|
} = props;
|
|
4462
4645
|
if (!items.length) {
|
|
4463
|
-
return /* @__PURE__ */
|
|
4646
|
+
return /* @__PURE__ */ React32.createElement(
|
|
4464
4647
|
JoyIconButton2,
|
|
4465
4648
|
{
|
|
4466
4649
|
component: props.buttonComponent ?? "button",
|
|
@@ -4474,7 +4657,7 @@ function IconMenuButton(props) {
|
|
|
4474
4657
|
icon
|
|
4475
4658
|
);
|
|
4476
4659
|
}
|
|
4477
|
-
return /* @__PURE__ */
|
|
4660
|
+
return /* @__PURE__ */ React32.createElement(Dropdown_default, null, /* @__PURE__ */ React32.createElement(
|
|
4478
4661
|
JoyMenuButton2,
|
|
4479
4662
|
{
|
|
4480
4663
|
slots: { root: JoyIconButton2 },
|
|
@@ -4491,19 +4674,19 @@ function IconMenuButton(props) {
|
|
|
4491
4674
|
}
|
|
4492
4675
|
},
|
|
4493
4676
|
icon
|
|
4494
|
-
), /* @__PURE__ */
|
|
4677
|
+
), /* @__PURE__ */ React32.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React32.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4495
4678
|
}
|
|
4496
4679
|
IconMenuButton.displayName = "IconMenuButton";
|
|
4497
4680
|
|
|
4498
4681
|
// src/components/Markdown/Markdown.tsx
|
|
4499
|
-
import
|
|
4682
|
+
import React33, { lazy, Suspense, useEffect as useEffect9, useState as useState11 } from "react";
|
|
4500
4683
|
import { Skeleton } from "@mui/joy";
|
|
4501
4684
|
import { Link as Link2 } from "@mui/joy";
|
|
4502
4685
|
import remarkGfm from "remark-gfm";
|
|
4503
4686
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
4504
4687
|
var Markdown = (props) => {
|
|
4505
|
-
const [rehypeAccent2, setRehypeAccent] =
|
|
4506
|
-
|
|
4688
|
+
const [rehypeAccent2, setRehypeAccent] = useState11(null);
|
|
4689
|
+
useEffect9(() => {
|
|
4507
4690
|
const loadRehypeAccent = async () => {
|
|
4508
4691
|
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4509
4692
|
setRehypeAccent(() => module.rehypeAccent);
|
|
@@ -4525,12 +4708,12 @@ var Markdown = (props) => {
|
|
|
4525
4708
|
if (!rehypeAccent2) {
|
|
4526
4709
|
return null;
|
|
4527
4710
|
}
|
|
4528
|
-
return /* @__PURE__ */
|
|
4711
|
+
return /* @__PURE__ */ React33.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React33.createElement(
|
|
4529
4712
|
Suspense,
|
|
4530
4713
|
{
|
|
4531
|
-
fallback: fallback || /* @__PURE__ */
|
|
4714
|
+
fallback: fallback || /* @__PURE__ */ React33.createElement(Typography, null, /* @__PURE__ */ React33.createElement(Skeleton, null, content || ""))
|
|
4532
4715
|
},
|
|
4533
|
-
/* @__PURE__ */
|
|
4716
|
+
/* @__PURE__ */ React33.createElement(
|
|
4534
4717
|
LazyReactMarkdown,
|
|
4535
4718
|
{
|
|
4536
4719
|
...markdownOptions,
|
|
@@ -4538,15 +4721,15 @@ var Markdown = (props) => {
|
|
|
4538
4721
|
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4539
4722
|
remarkPlugins: [remarkGfm],
|
|
4540
4723
|
components: {
|
|
4541
|
-
h1: ({ children }) => /* @__PURE__ */
|
|
4542
|
-
h2: ({ children }) => /* @__PURE__ */
|
|
4543
|
-
h3: ({ children }) => /* @__PURE__ */
|
|
4544
|
-
h4: ({ children }) => /* @__PURE__ */
|
|
4545
|
-
p: ({ children, node }) => /* @__PURE__ */
|
|
4546
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
4547
|
-
hr: () => /* @__PURE__ */
|
|
4548
|
-
b: ({ children }) => /* @__PURE__ */
|
|
4549
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
4724
|
+
h1: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4725
|
+
h2: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
4726
|
+
h3: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
4727
|
+
h4: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
4728
|
+
p: ({ children, node }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
4729
|
+
a: ({ children, href }) => /* @__PURE__ */ React33.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
4730
|
+
hr: () => /* @__PURE__ */ React33.createElement(Divider, null),
|
|
4731
|
+
b: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4732
|
+
strong: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4550
4733
|
...markdownOptions?.components
|
|
4551
4734
|
}
|
|
4552
4735
|
}
|
|
@@ -4556,7 +4739,7 @@ var Markdown = (props) => {
|
|
|
4556
4739
|
Markdown.displayName = "Markdown";
|
|
4557
4740
|
|
|
4558
4741
|
// src/components/MenuButton/MenuButton.tsx
|
|
4559
|
-
import
|
|
4742
|
+
import React34 from "react";
|
|
4560
4743
|
import { MenuButton as JoyMenuButton3, Button as JoyButton2 } from "@mui/joy";
|
|
4561
4744
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4562
4745
|
function MenuButton(props) {
|
|
@@ -4574,7 +4757,7 @@ function MenuButton(props) {
|
|
|
4574
4757
|
placement = "bottom"
|
|
4575
4758
|
} = props;
|
|
4576
4759
|
if (!items.length) {
|
|
4577
|
-
return /* @__PURE__ */
|
|
4760
|
+
return /* @__PURE__ */ React34.createElement(
|
|
4578
4761
|
JoyButton2,
|
|
4579
4762
|
{
|
|
4580
4763
|
component: props.buttonComponent ?? "button",
|
|
@@ -4585,12 +4768,12 @@ function MenuButton(props) {
|
|
|
4585
4768
|
loading,
|
|
4586
4769
|
startDecorator,
|
|
4587
4770
|
...props.buttonComponentProps ?? {},
|
|
4588
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
4771
|
+
endDecorator: showIcon ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, endDecorator, /* @__PURE__ */ React34.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, endDecorator)
|
|
4589
4772
|
},
|
|
4590
4773
|
buttonText
|
|
4591
4774
|
);
|
|
4592
4775
|
}
|
|
4593
|
-
return /* @__PURE__ */
|
|
4776
|
+
return /* @__PURE__ */ React34.createElement(Dropdown_default, null, /* @__PURE__ */ React34.createElement(
|
|
4594
4777
|
JoyMenuButton3,
|
|
4595
4778
|
{
|
|
4596
4779
|
component: props.buttonComponent ?? "button",
|
|
@@ -4601,15 +4784,15 @@ function MenuButton(props) {
|
|
|
4601
4784
|
loading,
|
|
4602
4785
|
startDecorator,
|
|
4603
4786
|
...props.buttonComponentProps ?? {},
|
|
4604
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
4787
|
+
endDecorator: showIcon ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, endDecorator, /* @__PURE__ */ React34.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, endDecorator)
|
|
4605
4788
|
},
|
|
4606
4789
|
buttonText
|
|
4607
|
-
), /* @__PURE__ */
|
|
4790
|
+
), /* @__PURE__ */ React34.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React34.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4608
4791
|
}
|
|
4609
4792
|
MenuButton.displayName = "MenuButton";
|
|
4610
4793
|
|
|
4611
4794
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
4612
|
-
import
|
|
4795
|
+
import React35, { forwardRef as forwardRef9, useCallback as useCallback14, useEffect as useEffect10, useImperativeHandle as useImperativeHandle4, useRef as useRef9, useState as useState12 } from "react";
|
|
4613
4796
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
4614
4797
|
import { styled as styled21, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
4615
4798
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
@@ -4691,14 +4874,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4691
4874
|
locale,
|
|
4692
4875
|
...innerProps
|
|
4693
4876
|
} = props;
|
|
4694
|
-
const innerRef =
|
|
4695
|
-
const buttonRef =
|
|
4877
|
+
const innerRef = useRef9(null);
|
|
4878
|
+
const buttonRef = useRef9(null);
|
|
4696
4879
|
const [value, setValue, isControlled] = useControlledState(
|
|
4697
4880
|
props.value,
|
|
4698
4881
|
props.defaultValue || "",
|
|
4699
|
-
|
|
4882
|
+
useCallback14((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4700
4883
|
);
|
|
4701
|
-
const getFormattedDisplayValue =
|
|
4884
|
+
const getFormattedDisplayValue = useCallback14(
|
|
4702
4885
|
(inputValue) => {
|
|
4703
4886
|
if (!inputValue) return "";
|
|
4704
4887
|
try {
|
|
@@ -4709,19 +4892,19 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4709
4892
|
},
|
|
4710
4893
|
[format, displayFormat, locale]
|
|
4711
4894
|
);
|
|
4712
|
-
const [displayValue, setDisplayValue] =
|
|
4713
|
-
const [anchorEl, setAnchorEl] =
|
|
4895
|
+
const [displayValue, setDisplayValue] = useState12(() => getFormattedDisplayValue(value));
|
|
4896
|
+
const [anchorEl, setAnchorEl] = useState12(null);
|
|
4714
4897
|
const open = Boolean(anchorEl);
|
|
4715
|
-
|
|
4898
|
+
useEffect10(() => {
|
|
4716
4899
|
if (!anchorEl) {
|
|
4717
4900
|
innerRef.current?.blur();
|
|
4718
4901
|
}
|
|
4719
4902
|
}, [anchorEl, innerRef]);
|
|
4720
4903
|
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
4721
|
-
|
|
4904
|
+
useEffect10(() => {
|
|
4722
4905
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
4723
4906
|
}, [value, getFormattedDisplayValue]);
|
|
4724
|
-
const handleChange =
|
|
4907
|
+
const handleChange = useCallback14(
|
|
4725
4908
|
(event) => {
|
|
4726
4909
|
const newValue = event.target.value;
|
|
4727
4910
|
setValue(newValue);
|
|
@@ -4731,21 +4914,21 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4731
4914
|
},
|
|
4732
4915
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
4733
4916
|
);
|
|
4734
|
-
const handleCalendarToggle =
|
|
4917
|
+
const handleCalendarToggle = useCallback14(
|
|
4735
4918
|
(event) => {
|
|
4736
4919
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4737
4920
|
innerRef.current?.focus();
|
|
4738
4921
|
},
|
|
4739
4922
|
[anchorEl, setAnchorEl, innerRef]
|
|
4740
4923
|
);
|
|
4741
|
-
const handleInputMouseDown =
|
|
4924
|
+
const handleInputMouseDown = useCallback14(
|
|
4742
4925
|
(event) => {
|
|
4743
4926
|
event.preventDefault();
|
|
4744
4927
|
buttonRef.current?.focus();
|
|
4745
4928
|
},
|
|
4746
4929
|
[buttonRef]
|
|
4747
4930
|
);
|
|
4748
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ React35.createElement(MonthPickerRoot, null, /* @__PURE__ */ React35.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(
|
|
4749
4932
|
Input_default,
|
|
4750
4933
|
{
|
|
4751
4934
|
...innerProps,
|
|
@@ -4775,7 +4958,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4775
4958
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4776
4959
|
fontFamily: "monospace"
|
|
4777
4960
|
},
|
|
4778
|
-
endDecorator: /* @__PURE__ */
|
|
4961
|
+
endDecorator: /* @__PURE__ */ React35.createElement(
|
|
4779
4962
|
IconButton_default,
|
|
4780
4963
|
{
|
|
4781
4964
|
ref: buttonRef,
|
|
@@ -4787,12 +4970,12 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4787
4970
|
"aria-expanded": open,
|
|
4788
4971
|
disabled
|
|
4789
4972
|
},
|
|
4790
|
-
/* @__PURE__ */
|
|
4973
|
+
/* @__PURE__ */ React35.createElement(CalendarTodayIcon3, null)
|
|
4791
4974
|
),
|
|
4792
4975
|
label,
|
|
4793
4976
|
helperText
|
|
4794
4977
|
}
|
|
4795
|
-
), open && /* @__PURE__ */
|
|
4978
|
+
), open && /* @__PURE__ */ React35.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React35.createElement(
|
|
4796
4979
|
StyledPopper3,
|
|
4797
4980
|
{
|
|
4798
4981
|
id: "month-picker-popper",
|
|
@@ -4811,7 +4994,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4811
4994
|
"aria-label": "Calendar Tooltip",
|
|
4812
4995
|
"aria-expanded": open
|
|
4813
4996
|
},
|
|
4814
|
-
/* @__PURE__ */
|
|
4997
|
+
/* @__PURE__ */ React35.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React35.createElement(
|
|
4815
4998
|
Calendar_default,
|
|
4816
4999
|
{
|
|
4817
5000
|
view: "month",
|
|
@@ -4832,14 +5015,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4832
5015
|
disablePast,
|
|
4833
5016
|
locale
|
|
4834
5017
|
}
|
|
4835
|
-
), /* @__PURE__ */
|
|
5018
|
+
), /* @__PURE__ */ React35.createElement(
|
|
4836
5019
|
DialogActions_default,
|
|
4837
5020
|
{
|
|
4838
5021
|
sx: {
|
|
4839
5022
|
p: 1
|
|
4840
5023
|
}
|
|
4841
5024
|
},
|
|
4842
|
-
/* @__PURE__ */
|
|
5025
|
+
/* @__PURE__ */ React35.createElement(
|
|
4843
5026
|
Button_default,
|
|
4844
5027
|
{
|
|
4845
5028
|
size,
|
|
@@ -4862,7 +5045,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
4862
5045
|
});
|
|
4863
5046
|
|
|
4864
5047
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
4865
|
-
import
|
|
5048
|
+
import React36, { forwardRef as forwardRef10, useCallback as useCallback15, useEffect as useEffect11, useImperativeHandle as useImperativeHandle5, useMemo as useMemo13, useRef as useRef10, useState as useState13 } from "react";
|
|
4866
5049
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
4867
5050
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
4868
5051
|
import { styled as styled22, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
@@ -4920,9 +5103,9 @@ var parseDates2 = (str) => {
|
|
|
4920
5103
|
var formatToPattern3 = (format) => {
|
|
4921
5104
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
4922
5105
|
};
|
|
4923
|
-
var TextMaskAdapter7 =
|
|
5106
|
+
var TextMaskAdapter7 = React36.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4924
5107
|
const { onChange, format, ...other } = props;
|
|
4925
|
-
return /* @__PURE__ */
|
|
5108
|
+
return /* @__PURE__ */ React36.createElement(
|
|
4926
5109
|
IMaskInput3,
|
|
4927
5110
|
{
|
|
4928
5111
|
...other,
|
|
@@ -4970,35 +5153,35 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
4970
5153
|
size,
|
|
4971
5154
|
...innerProps
|
|
4972
5155
|
} = props;
|
|
4973
|
-
const innerRef =
|
|
5156
|
+
const innerRef = useRef10(null);
|
|
4974
5157
|
const [value, setValue] = useControlledState(
|
|
4975
5158
|
props.value,
|
|
4976
5159
|
props.defaultValue || "",
|
|
4977
|
-
|
|
5160
|
+
useCallback15((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4978
5161
|
);
|
|
4979
|
-
const [anchorEl, setAnchorEl] =
|
|
5162
|
+
const [anchorEl, setAnchorEl] = useState13(null);
|
|
4980
5163
|
const open = Boolean(anchorEl);
|
|
4981
|
-
const calendarValue =
|
|
4982
|
-
|
|
5164
|
+
const calendarValue = useMemo13(() => value ? parseDates2(value) : void 0, [value]);
|
|
5165
|
+
useEffect11(() => {
|
|
4983
5166
|
if (!anchorEl) {
|
|
4984
5167
|
innerRef.current?.blur();
|
|
4985
5168
|
}
|
|
4986
5169
|
}, [anchorEl, innerRef]);
|
|
4987
5170
|
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
4988
|
-
const handleChange =
|
|
5171
|
+
const handleChange = useCallback15(
|
|
4989
5172
|
(event) => {
|
|
4990
5173
|
setValue(event.target.value);
|
|
4991
5174
|
},
|
|
4992
5175
|
[setValue]
|
|
4993
5176
|
);
|
|
4994
|
-
const handleCalendarToggle =
|
|
5177
|
+
const handleCalendarToggle = useCallback15(
|
|
4995
5178
|
(event) => {
|
|
4996
5179
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4997
5180
|
innerRef.current?.focus();
|
|
4998
5181
|
},
|
|
4999
5182
|
[anchorEl, setAnchorEl, innerRef]
|
|
5000
5183
|
);
|
|
5001
|
-
const handleCalendarChange =
|
|
5184
|
+
const handleCalendarChange = useCallback15(
|
|
5002
5185
|
([date1, date2]) => {
|
|
5003
5186
|
if (!date1 || !date2) return;
|
|
5004
5187
|
setValue(formatValueString4([date1, date2], format));
|
|
@@ -5006,7 +5189,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5006
5189
|
},
|
|
5007
5190
|
[setValue, setAnchorEl, format]
|
|
5008
5191
|
);
|
|
5009
|
-
return /* @__PURE__ */
|
|
5192
|
+
return /* @__PURE__ */ React36.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React36.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
|
|
5010
5193
|
Input_default,
|
|
5011
5194
|
{
|
|
5012
5195
|
...innerProps,
|
|
@@ -5028,7 +5211,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5028
5211
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5029
5212
|
fontFamily: "monospace"
|
|
5030
5213
|
},
|
|
5031
|
-
endDecorator: /* @__PURE__ */
|
|
5214
|
+
endDecorator: /* @__PURE__ */ React36.createElement(
|
|
5032
5215
|
IconButton_default,
|
|
5033
5216
|
{
|
|
5034
5217
|
variant: "plain",
|
|
@@ -5038,12 +5221,12 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5038
5221
|
"aria-haspopup": "dialog",
|
|
5039
5222
|
"aria-expanded": open
|
|
5040
5223
|
},
|
|
5041
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ React36.createElement(CalendarTodayIcon4, null)
|
|
5042
5225
|
),
|
|
5043
5226
|
label,
|
|
5044
5227
|
helperText
|
|
5045
5228
|
}
|
|
5046
|
-
), open && /* @__PURE__ */
|
|
5229
|
+
), open && /* @__PURE__ */ React36.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React36.createElement(
|
|
5047
5230
|
StyledPopper4,
|
|
5048
5231
|
{
|
|
5049
5232
|
id: "month-range-picker-popper",
|
|
@@ -5062,7 +5245,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5062
5245
|
"aria-label": "Calendar Tooltip",
|
|
5063
5246
|
"aria-expanded": open
|
|
5064
5247
|
},
|
|
5065
|
-
/* @__PURE__ */
|
|
5248
|
+
/* @__PURE__ */ React36.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React36.createElement(
|
|
5066
5249
|
Calendar_default,
|
|
5067
5250
|
{
|
|
5068
5251
|
view: "month",
|
|
@@ -5075,14 +5258,14 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5075
5258
|
disableFuture,
|
|
5076
5259
|
disablePast
|
|
5077
5260
|
}
|
|
5078
|
-
), /* @__PURE__ */
|
|
5261
|
+
), /* @__PURE__ */ React36.createElement(
|
|
5079
5262
|
DialogActions_default,
|
|
5080
5263
|
{
|
|
5081
5264
|
sx: {
|
|
5082
5265
|
p: 1
|
|
5083
5266
|
}
|
|
5084
5267
|
},
|
|
5085
|
-
/* @__PURE__ */
|
|
5268
|
+
/* @__PURE__ */ React36.createElement(
|
|
5086
5269
|
Button_default,
|
|
5087
5270
|
{
|
|
5088
5271
|
size,
|
|
@@ -5101,14 +5284,14 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
5101
5284
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
5102
5285
|
|
|
5103
5286
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
5104
|
-
import
|
|
5287
|
+
import React37 from "react";
|
|
5105
5288
|
import {
|
|
5106
5289
|
Accordion as JoyAccordion2,
|
|
5107
5290
|
AccordionSummary as JoyAccordionSummary2,
|
|
5108
5291
|
AccordionDetails as JoyAccordionDetails2,
|
|
5109
5292
|
styled as styled23,
|
|
5110
5293
|
accordionSummaryClasses,
|
|
5111
|
-
Stack as
|
|
5294
|
+
Stack as Stack3
|
|
5112
5295
|
} from "@mui/joy";
|
|
5113
5296
|
var AccordionSummary2 = styled23(JoyAccordionSummary2, {
|
|
5114
5297
|
name: "NavigationGroup",
|
|
@@ -5132,11 +5315,11 @@ var AccordionDetails2 = styled23(JoyAccordionDetails2, {
|
|
|
5132
5315
|
}));
|
|
5133
5316
|
function NavigationGroup(props) {
|
|
5134
5317
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
5135
|
-
return /* @__PURE__ */
|
|
5318
|
+
return /* @__PURE__ */ React37.createElement(JoyAccordion2, { ...rest }, /* @__PURE__ */ React37.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ React37.createElement(Stack3, { direction: "row", gap: 4 }, startDecorator, title)), /* @__PURE__ */ React37.createElement(AccordionDetails2, null, children));
|
|
5136
5319
|
}
|
|
5137
5320
|
|
|
5138
5321
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
5139
|
-
import
|
|
5322
|
+
import React38 from "react";
|
|
5140
5323
|
import {
|
|
5141
5324
|
ListItem as JoyListItem,
|
|
5142
5325
|
ListItemButton as JoyListItemButton,
|
|
@@ -5171,7 +5354,7 @@ function NavigationItem(props) {
|
|
|
5171
5354
|
const handleClick = () => {
|
|
5172
5355
|
onClick?.(id);
|
|
5173
5356
|
};
|
|
5174
|
-
return /* @__PURE__ */
|
|
5357
|
+
return /* @__PURE__ */ React38.createElement(JoyListItem, { ...rest }, /* @__PURE__ */ React38.createElement(
|
|
5175
5358
|
ListItemButton,
|
|
5176
5359
|
{
|
|
5177
5360
|
level,
|
|
@@ -5180,21 +5363,21 @@ function NavigationItem(props) {
|
|
|
5180
5363
|
"aria-current": selected,
|
|
5181
5364
|
onClick: handleClick
|
|
5182
5365
|
},
|
|
5183
|
-
startDecorator && /* @__PURE__ */
|
|
5366
|
+
startDecorator && /* @__PURE__ */ React38.createElement(JoyListItemDecorator, null, startDecorator),
|
|
5184
5367
|
children
|
|
5185
5368
|
));
|
|
5186
5369
|
}
|
|
5187
5370
|
|
|
5188
5371
|
// src/components/Navigator/Navigator.tsx
|
|
5189
|
-
import
|
|
5372
|
+
import React39 from "react";
|
|
5190
5373
|
function Navigator(props) {
|
|
5191
5374
|
const { items, level = 0, onSelect } = props;
|
|
5192
5375
|
const handleItemClick = (id) => {
|
|
5193
5376
|
onSelect?.(id);
|
|
5194
5377
|
};
|
|
5195
|
-
return /* @__PURE__ */
|
|
5378
|
+
return /* @__PURE__ */ React39.createElement("div", null, items.map((item, index) => {
|
|
5196
5379
|
if (item.type === "item") {
|
|
5197
|
-
return /* @__PURE__ */
|
|
5380
|
+
return /* @__PURE__ */ React39.createElement(
|
|
5198
5381
|
NavigationItem,
|
|
5199
5382
|
{
|
|
5200
5383
|
key: item.id,
|
|
@@ -5207,7 +5390,7 @@ function Navigator(props) {
|
|
|
5207
5390
|
item.title
|
|
5208
5391
|
);
|
|
5209
5392
|
} else if (item.type === "group") {
|
|
5210
|
-
return /* @__PURE__ */
|
|
5393
|
+
return /* @__PURE__ */ React39.createElement(
|
|
5211
5394
|
NavigationGroup,
|
|
5212
5395
|
{
|
|
5213
5396
|
key: `${item.title}-${index}`,
|
|
@@ -5225,16 +5408,16 @@ function Navigator(props) {
|
|
|
5225
5408
|
Navigator.displayName = "Navigator";
|
|
5226
5409
|
|
|
5227
5410
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
5228
|
-
import
|
|
5411
|
+
import React40, { useCallback as useCallback16, useMemo as useMemo14, useState as useState14 } from "react";
|
|
5229
5412
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
5230
5413
|
import { styled as styled25, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
5231
5414
|
var padDecimal = (value, decimalScale) => {
|
|
5232
5415
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5233
5416
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5234
5417
|
};
|
|
5235
|
-
var TextMaskAdapter9 =
|
|
5418
|
+
var TextMaskAdapter9 = React40.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
5236
5419
|
const { onChange, min, max, ...innerProps } = props;
|
|
5237
|
-
return /* @__PURE__ */
|
|
5420
|
+
return /* @__PURE__ */ React40.createElement(
|
|
5238
5421
|
NumericFormat2,
|
|
5239
5422
|
{
|
|
5240
5423
|
...innerProps,
|
|
@@ -5259,7 +5442,7 @@ var PercentageInputRoot = styled25(Input_default, {
|
|
|
5259
5442
|
slot: "Root",
|
|
5260
5443
|
overridesResolver: (props, styles) => styles.root
|
|
5261
5444
|
})({});
|
|
5262
|
-
var PercentageInput =
|
|
5445
|
+
var PercentageInput = React40.forwardRef(
|
|
5263
5446
|
function PercentageInput2(inProps, ref) {
|
|
5264
5447
|
const props = useThemeProps8({ props: inProps, name: "PercentageInput" });
|
|
5265
5448
|
const {
|
|
@@ -5282,18 +5465,18 @@ var PercentageInput = React39.forwardRef(
|
|
|
5282
5465
|
const [_value, setValue] = useControlledState(
|
|
5283
5466
|
props.value,
|
|
5284
5467
|
props.defaultValue,
|
|
5285
|
-
|
|
5468
|
+
useCallback16((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
5286
5469
|
);
|
|
5287
|
-
const [internalError, setInternalError] =
|
|
5470
|
+
const [internalError, setInternalError] = useState14(
|
|
5288
5471
|
max && _value && _value > max || min && _value && _value < min
|
|
5289
5472
|
);
|
|
5290
|
-
const value =
|
|
5473
|
+
const value = useMemo14(() => {
|
|
5291
5474
|
if (_value && useMinorUnit) {
|
|
5292
5475
|
return _value / Math.pow(10, maxDecimalScale);
|
|
5293
5476
|
}
|
|
5294
5477
|
return _value;
|
|
5295
5478
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5296
|
-
const handleChange =
|
|
5479
|
+
const handleChange = useCallback16(
|
|
5297
5480
|
(event) => {
|
|
5298
5481
|
if (event.target.value === "") {
|
|
5299
5482
|
setValue(void 0);
|
|
@@ -5310,7 +5493,7 @@ var PercentageInput = React39.forwardRef(
|
|
|
5310
5493
|
},
|
|
5311
5494
|
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5312
5495
|
);
|
|
5313
|
-
return /* @__PURE__ */
|
|
5496
|
+
return /* @__PURE__ */ React40.createElement(
|
|
5314
5497
|
PercentageInputRoot,
|
|
5315
5498
|
{
|
|
5316
5499
|
...innerProps,
|
|
@@ -5351,15 +5534,15 @@ var RadioGroup = MotionRadioGroup;
|
|
|
5351
5534
|
RadioGroup.displayName = "RadioGroup";
|
|
5352
5535
|
|
|
5353
5536
|
// src/components/RadioList/RadioList.tsx
|
|
5354
|
-
import
|
|
5537
|
+
import React41 from "react";
|
|
5355
5538
|
function RadioList(props) {
|
|
5356
5539
|
const { items, ...innerProps } = props;
|
|
5357
|
-
return /* @__PURE__ */
|
|
5540
|
+
return /* @__PURE__ */ React41.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React41.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
5358
5541
|
}
|
|
5359
5542
|
RadioList.displayName = "RadioList";
|
|
5360
5543
|
|
|
5361
5544
|
// src/components/Stepper/Stepper.tsx
|
|
5362
|
-
import
|
|
5545
|
+
import React42 from "react";
|
|
5363
5546
|
import {
|
|
5364
5547
|
Stepper as JoyStepper,
|
|
5365
5548
|
Step as JoyStep,
|
|
@@ -5395,7 +5578,7 @@ function Stepper(props) {
|
|
|
5395
5578
|
stepOrientation = "horizontal"
|
|
5396
5579
|
} = props;
|
|
5397
5580
|
const effectiveStepOrientation = orientation === "vertical" ? "horizontal" : stepOrientation;
|
|
5398
|
-
return /* @__PURE__ */
|
|
5581
|
+
return /* @__PURE__ */ React42.createElement(
|
|
5399
5582
|
MotionStepper,
|
|
5400
5583
|
{
|
|
5401
5584
|
orientation,
|
|
@@ -5434,23 +5617,23 @@ function Stepper(props) {
|
|
|
5434
5617
|
const completed = activeStep > i + 1;
|
|
5435
5618
|
const disabled = activeStep < i + 1;
|
|
5436
5619
|
const hasContent = step.label || step.extraContent;
|
|
5437
|
-
return /* @__PURE__ */
|
|
5620
|
+
return /* @__PURE__ */ React42.createElement(
|
|
5438
5621
|
Step,
|
|
5439
5622
|
{
|
|
5440
5623
|
key: `step-${i}`,
|
|
5441
|
-
indicator: /* @__PURE__ */
|
|
5624
|
+
indicator: /* @__PURE__ */ React42.createElement(StepIndicator, { variant: disabled ? "outlined" : "solid", color: disabled ? "neutral" : "primary" }, completed ? /* @__PURE__ */ React42.createElement(CheckIcon, null) : step.indicatorContent),
|
|
5442
5625
|
active,
|
|
5443
5626
|
completed,
|
|
5444
5627
|
disabled,
|
|
5445
5628
|
orientation: effectiveStepOrientation
|
|
5446
5629
|
},
|
|
5447
|
-
hasContent && /* @__PURE__ */
|
|
5630
|
+
hasContent && /* @__PURE__ */ React42.createElement(
|
|
5448
5631
|
Stack_default,
|
|
5449
5632
|
{
|
|
5450
5633
|
sx: orientation === "horizontal" && effectiveStepOrientation === "vertical" ? { alignItems: "center" } : {}
|
|
5451
5634
|
},
|
|
5452
|
-
step.label && /* @__PURE__ */
|
|
5453
|
-
step.extraContent && /* @__PURE__ */
|
|
5635
|
+
step.label && /* @__PURE__ */ React42.createElement(Typography_default, { level: "title-sm" }, step.label),
|
|
5636
|
+
step.extraContent && /* @__PURE__ */ React42.createElement(Typography_default, { level: "body-xs" }, step.extraContent)
|
|
5454
5637
|
)
|
|
5455
5638
|
);
|
|
5456
5639
|
})
|
|
@@ -5459,7 +5642,7 @@ function Stepper(props) {
|
|
|
5459
5642
|
Stepper.displayName = "Stepper";
|
|
5460
5643
|
|
|
5461
5644
|
// src/components/Switch/Switch.tsx
|
|
5462
|
-
import
|
|
5645
|
+
import React43 from "react";
|
|
5463
5646
|
import { Switch as JoySwitch, styled as styled27, switchClasses } from "@mui/joy";
|
|
5464
5647
|
import { motion as motion28 } from "framer-motion";
|
|
5465
5648
|
var MotionSwitch = motion28(JoySwitch);
|
|
@@ -5481,14 +5664,14 @@ var StyledThumb = styled27(motion28.div)({
|
|
|
5481
5664
|
right: "var(--Switch-thumbOffset)"
|
|
5482
5665
|
}
|
|
5483
5666
|
});
|
|
5484
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
5667
|
+
var Thumb = (props) => /* @__PURE__ */ React43.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
5485
5668
|
var spring = {
|
|
5486
5669
|
type: "spring",
|
|
5487
5670
|
stiffness: 700,
|
|
5488
5671
|
damping: 30
|
|
5489
5672
|
};
|
|
5490
5673
|
var Switch = (props) => {
|
|
5491
|
-
return /* @__PURE__ */
|
|
5674
|
+
return /* @__PURE__ */ React43.createElement(
|
|
5492
5675
|
MotionSwitch,
|
|
5493
5676
|
{
|
|
5494
5677
|
...props,
|
|
@@ -5502,7 +5685,7 @@ var Switch = (props) => {
|
|
|
5502
5685
|
Switch.displayName = "Switch";
|
|
5503
5686
|
|
|
5504
5687
|
// src/components/Tabs/Tabs.tsx
|
|
5505
|
-
import
|
|
5688
|
+
import React44, { forwardRef as forwardRef11 } from "react";
|
|
5506
5689
|
import {
|
|
5507
5690
|
Tabs as JoyTabs,
|
|
5508
5691
|
Tab as JoyTab,
|
|
@@ -5526,14 +5709,14 @@ var StyledTab = styled28(JoyTab)(({ theme }) => ({
|
|
|
5526
5709
|
}
|
|
5527
5710
|
}));
|
|
5528
5711
|
var Tab = forwardRef11(function Tab2({ startDecorator, endDecorator, children, ...props }, ref) {
|
|
5529
|
-
return /* @__PURE__ */
|
|
5712
|
+
return /* @__PURE__ */ React44.createElement(StyledTab, { ...props, ref }, startDecorator, children, endDecorator);
|
|
5530
5713
|
});
|
|
5531
5714
|
Tab.displayName = "Tab";
|
|
5532
5715
|
var TabList = JoyTabList;
|
|
5533
5716
|
var TabPanel = JoyTabPanel;
|
|
5534
5717
|
|
|
5535
5718
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
5536
|
-
import
|
|
5719
|
+
import React45 from "react";
|
|
5537
5720
|
import {
|
|
5538
5721
|
CssBaseline,
|
|
5539
5722
|
CssVarsProvider,
|
|
@@ -5789,13 +5972,13 @@ var defaultTheme = extendTheme({
|
|
|
5789
5972
|
});
|
|
5790
5973
|
function ThemeProvider(props) {
|
|
5791
5974
|
const theme = props.theme || defaultTheme;
|
|
5792
|
-
return /* @__PURE__ */
|
|
5975
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(CssVarsProvider, { theme }, /* @__PURE__ */ React45.createElement(CssBaseline, null), props.children));
|
|
5793
5976
|
}
|
|
5794
5977
|
ThemeProvider.displayName = "ThemeProvider";
|
|
5795
5978
|
|
|
5796
5979
|
// src/components/Uploader/Uploader.tsx
|
|
5797
|
-
import
|
|
5798
|
-
import { styled as styled29, Input as
|
|
5980
|
+
import React46, { useCallback as useCallback17, useEffect as useEffect12, useMemo as useMemo15, useRef as useRef11, useState as useState15 } from "react";
|
|
5981
|
+
import { styled as styled29, Input as Input3 } from "@mui/joy";
|
|
5799
5982
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
5800
5983
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
5801
5984
|
import MuiClearIcon from "@mui/icons-material/ClearRounded";
|
|
@@ -5817,7 +6000,7 @@ var esmFiles = {
|
|
|
5817
6000
|
"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js"
|
|
5818
6001
|
)
|
|
5819
6002
|
};
|
|
5820
|
-
var VisuallyHiddenInput = styled29(
|
|
6003
|
+
var VisuallyHiddenInput = styled29(Input3)({
|
|
5821
6004
|
width: "1px",
|
|
5822
6005
|
height: "1px",
|
|
5823
6006
|
overflow: "hidden",
|
|
@@ -5871,7 +6054,7 @@ var getFileSize = (n) => {
|
|
|
5871
6054
|
};
|
|
5872
6055
|
var Preview = (props) => {
|
|
5873
6056
|
const { files, uploaded, onDelete } = props;
|
|
5874
|
-
return /* @__PURE__ */
|
|
6057
|
+
return /* @__PURE__ */ React46.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React46.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React46.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React46.createElement(UploadFileIcon, null), /* @__PURE__ */ React46.createElement(Stack_default, { flex: "1", sx: { overflow: "hidden" } }, /* @__PURE__ */ React46.createElement(
|
|
5875
6058
|
Typography_default,
|
|
5876
6059
|
{
|
|
5877
6060
|
level: "body-sm",
|
|
@@ -5883,7 +6066,7 @@ var Preview = (props) => {
|
|
|
5883
6066
|
}
|
|
5884
6067
|
},
|
|
5885
6068
|
file.name
|
|
5886
|
-
), !!file.size && /* @__PURE__ */
|
|
6069
|
+
), !!file.size && /* @__PURE__ */ React46.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ React46.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React46.createElement(ClearIcon2, null))))));
|
|
5887
6070
|
};
|
|
5888
6071
|
var UploaderRoot = styled29(Stack_default, {
|
|
5889
6072
|
name: "Uploader",
|
|
@@ -5926,7 +6109,7 @@ var UploaderIcon = styled29(MuiFileUploadIcon, {
|
|
|
5926
6109
|
}
|
|
5927
6110
|
})
|
|
5928
6111
|
);
|
|
5929
|
-
var Uploader =
|
|
6112
|
+
var Uploader = React46.memo(
|
|
5930
6113
|
(props) => {
|
|
5931
6114
|
const {
|
|
5932
6115
|
accept,
|
|
@@ -5943,14 +6126,14 @@ var Uploader = React45.memo(
|
|
|
5943
6126
|
error: errorProp,
|
|
5944
6127
|
helperText: helperTextProp
|
|
5945
6128
|
} = props;
|
|
5946
|
-
const dropZoneRef =
|
|
5947
|
-
const inputRef =
|
|
5948
|
-
const [errorText, setErrorText] =
|
|
5949
|
-
const [files, setFiles] =
|
|
5950
|
-
const [uploaded, setUploaded] =
|
|
5951
|
-
const [previewState, setPreviewState] =
|
|
5952
|
-
const accepts =
|
|
5953
|
-
const parsedAccepts =
|
|
6129
|
+
const dropZoneRef = useRef11(null);
|
|
6130
|
+
const inputRef = useRef11(null);
|
|
6131
|
+
const [errorText, setErrorText] = useState15();
|
|
6132
|
+
const [files, setFiles] = useState15([]);
|
|
6133
|
+
const [uploaded, setUploaded] = useState15(props.uploaded || []);
|
|
6134
|
+
const [previewState, setPreviewState] = useState15("idle");
|
|
6135
|
+
const accepts = useMemo15(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
6136
|
+
const parsedAccepts = useMemo15(
|
|
5954
6137
|
() => accepts.flatMap((type) => {
|
|
5955
6138
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
5956
6139
|
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
@@ -5959,7 +6142,7 @@ var Uploader = React45.memo(
|
|
|
5959
6142
|
}),
|
|
5960
6143
|
[accepts]
|
|
5961
6144
|
);
|
|
5962
|
-
const helperText =
|
|
6145
|
+
const helperText = useMemo15(() => {
|
|
5963
6146
|
if (helperTextProp) {
|
|
5964
6147
|
return helperTextProp;
|
|
5965
6148
|
}
|
|
@@ -5989,12 +6172,12 @@ var Uploader = React45.memo(
|
|
|
5989
6172
|
}
|
|
5990
6173
|
return helperTexts.join(", ");
|
|
5991
6174
|
}, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
|
|
5992
|
-
const error =
|
|
5993
|
-
const showDropZone =
|
|
6175
|
+
const error = useMemo15(() => !!errorText || errorProp, [errorProp, errorText]);
|
|
6176
|
+
const showDropZone = useMemo15(
|
|
5994
6177
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
5995
6178
|
[files, maxCount, uploaded]
|
|
5996
6179
|
);
|
|
5997
|
-
const addFiles =
|
|
6180
|
+
const addFiles = useCallback17(
|
|
5998
6181
|
(uploads) => {
|
|
5999
6182
|
try {
|
|
6000
6183
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -6039,7 +6222,7 @@ var Uploader = React45.memo(
|
|
|
6039
6222
|
},
|
|
6040
6223
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
6041
6224
|
);
|
|
6042
|
-
|
|
6225
|
+
useEffect12(() => {
|
|
6043
6226
|
if (!dropZoneRef.current || disabled) {
|
|
6044
6227
|
return;
|
|
6045
6228
|
}
|
|
@@ -6077,7 +6260,7 @@ var Uploader = React45.memo(
|
|
|
6077
6260
|
);
|
|
6078
6261
|
return () => cleanup?.();
|
|
6079
6262
|
}, [disabled, addFiles]);
|
|
6080
|
-
|
|
6263
|
+
useEffect12(() => {
|
|
6081
6264
|
if (inputRef.current && minCount) {
|
|
6082
6265
|
if (files.length < minCount) {
|
|
6083
6266
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -6086,14 +6269,14 @@ var Uploader = React45.memo(
|
|
|
6086
6269
|
}
|
|
6087
6270
|
}
|
|
6088
6271
|
}, [inputRef, files, minCount]);
|
|
6089
|
-
const handleFileChanged =
|
|
6272
|
+
const handleFileChanged = useCallback17(
|
|
6090
6273
|
(event) => {
|
|
6091
6274
|
const files2 = Array.from(event.target.files || []);
|
|
6092
6275
|
addFiles(files2);
|
|
6093
6276
|
},
|
|
6094
6277
|
[addFiles]
|
|
6095
6278
|
);
|
|
6096
|
-
const handleDeleteFile =
|
|
6279
|
+
const handleDeleteFile = useCallback17(
|
|
6097
6280
|
(deletedFile) => {
|
|
6098
6281
|
if (deletedFile instanceof File) {
|
|
6099
6282
|
setFiles((current) => {
|
|
@@ -6113,10 +6296,10 @@ var Uploader = React45.memo(
|
|
|
6113
6296
|
},
|
|
6114
6297
|
[name, onChange, onDelete]
|
|
6115
6298
|
);
|
|
6116
|
-
const handleUploaderButtonClick =
|
|
6299
|
+
const handleUploaderButtonClick = useCallback17(() => {
|
|
6117
6300
|
inputRef.current?.click();
|
|
6118
6301
|
}, []);
|
|
6119
|
-
const uploader = /* @__PURE__ */
|
|
6302
|
+
const uploader = /* @__PURE__ */ React46.createElement(
|
|
6120
6303
|
FileDropZone,
|
|
6121
6304
|
{
|
|
6122
6305
|
state: previewState,
|
|
@@ -6125,8 +6308,8 @@ var Uploader = React45.memo(
|
|
|
6125
6308
|
ref: dropZoneRef,
|
|
6126
6309
|
onClick: handleUploaderButtonClick
|
|
6127
6310
|
},
|
|
6128
|
-
/* @__PURE__ */
|
|
6129
|
-
/* @__PURE__ */
|
|
6311
|
+
/* @__PURE__ */ React46.createElement(Stack_default, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React46.createElement(UploaderIcon, { state: previewState, error: !!(error || errorText), disabled })),
|
|
6312
|
+
/* @__PURE__ */ React46.createElement(
|
|
6130
6313
|
VisuallyHiddenInput,
|
|
6131
6314
|
{
|
|
6132
6315
|
disabled,
|
|
@@ -6149,7 +6332,7 @@ var Uploader = React45.memo(
|
|
|
6149
6332
|
}
|
|
6150
6333
|
)
|
|
6151
6334
|
);
|
|
6152
|
-
return /* @__PURE__ */
|
|
6335
|
+
return /* @__PURE__ */ React46.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React46.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ React46.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ React46.createElement(FormHelperText_default, null, /* @__PURE__ */ React46.createElement(Stack_default, null, errorText && /* @__PURE__ */ React46.createElement("div", null, errorText), /* @__PURE__ */ React46.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React46.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
6153
6336
|
}
|
|
6154
6337
|
);
|
|
6155
6338
|
Uploader.displayName = "Uploader";
|
|
@@ -6191,6 +6374,7 @@ export {
|
|
|
6191
6374
|
Divider,
|
|
6192
6375
|
Drawer,
|
|
6193
6376
|
Dropdown,
|
|
6377
|
+
FilterableCheckboxGroup,
|
|
6194
6378
|
FormControl,
|
|
6195
6379
|
FormHelperText,
|
|
6196
6380
|
FormLabel,
|