@ceed/cds 1.2.5 → 1.2.6-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/InsetDrawer/InsetDrawer.d.ts +1 -7
- package/dist/index.cjs +145 -159
- package/dist/index.js +134 -148
- package/framer/index.js +28 -28
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -4136,8 +4136,6 @@ var StyledDrawer = (0, import_joy34.styled)(MotionDrawer)(({ theme, size = "md"
|
|
|
4136
4136
|
lg: "900px"
|
|
4137
4137
|
}[size],
|
|
4138
4138
|
[`& .${import_joy34.drawerClasses.content}`]: {
|
|
4139
|
-
bgcolor: "transparent",
|
|
4140
|
-
boxShadow: "none",
|
|
4141
4139
|
[theme.breakpoints.down("md")]: {
|
|
4142
4140
|
width: "100%"
|
|
4143
4141
|
}
|
|
@@ -4240,44 +4238,32 @@ var Divider = (props) => {
|
|
|
4240
4238
|
Divider.displayName = "Divider";
|
|
4241
4239
|
|
|
4242
4240
|
// src/components/InsetDrawer/InsetDrawer.tsx
|
|
4243
|
-
var import_react30 = __toESM(require("react"));
|
|
4244
4241
|
var import_joy40 = require("@mui/joy");
|
|
4245
|
-
var
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
...innerProps,
|
|
4253
|
-
slotProps: {
|
|
4254
|
-
...innerProps.slotProps,
|
|
4255
|
-
content: {
|
|
4256
|
-
...innerProps.slotProps?.content,
|
|
4257
|
-
sx: {
|
|
4258
|
-
bgcolor: "transparent",
|
|
4259
|
-
p: { md: 3, sm: 0 },
|
|
4260
|
-
boxShadow: "none"
|
|
4261
|
-
}
|
|
4262
|
-
}
|
|
4263
|
-
}
|
|
4242
|
+
var InsetDrawer = (0, import_joy40.styled)(import_joy40.Drawer)(({ theme }) => ({
|
|
4243
|
+
[`& .${import_joy40.drawerClasses.content}`]: {
|
|
4244
|
+
backgroundColor: "transparent",
|
|
4245
|
+
boxShadow: "none",
|
|
4246
|
+
[theme.breakpoints.down("md")]: {
|
|
4247
|
+
padding: 0,
|
|
4248
|
+
width: "100%"
|
|
4264
4249
|
},
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
}
|
|
4268
|
-
|
|
4250
|
+
[theme.breakpoints.up("md")]: {
|
|
4251
|
+
padding: theme.spacing(3)
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
}));
|
|
4269
4255
|
|
|
4270
4256
|
// src/components/Grid/Grid.tsx
|
|
4271
4257
|
var import_joy41 = require("@mui/joy");
|
|
4272
4258
|
|
|
4273
4259
|
// src/components/Markdown/Markdown.tsx
|
|
4274
|
-
var
|
|
4260
|
+
var import_react30 = __toESM(require("react"));
|
|
4275
4261
|
var import_joy42 = require("@mui/joy");
|
|
4276
4262
|
var import_joy43 = require("@mui/joy");
|
|
4277
|
-
var LazyReactMarkdown = (0,
|
|
4263
|
+
var LazyReactMarkdown = (0, import_react30.lazy)(() => import("react-markdown"));
|
|
4278
4264
|
var Markdown = (props) => {
|
|
4279
|
-
const [rehypeAccent2, setRehypeAccent] = (0,
|
|
4280
|
-
(0,
|
|
4265
|
+
const [rehypeAccent2, setRehypeAccent] = (0, import_react30.useState)(null);
|
|
4266
|
+
(0, import_react30.useEffect)(() => {
|
|
4281
4267
|
const loadRehypeAccent = async () => {
|
|
4282
4268
|
const module2 = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4283
4269
|
setRehypeAccent(() => module2.rehypeAccent);
|
|
@@ -4299,7 +4285,7 @@ var Markdown = (props) => {
|
|
|
4299
4285
|
if (!rehypeAccent2) {
|
|
4300
4286
|
return null;
|
|
4301
4287
|
}
|
|
4302
|
-
return /* @__PURE__ */
|
|
4288
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4303
4289
|
Typography,
|
|
4304
4290
|
{
|
|
4305
4291
|
component: "div",
|
|
@@ -4308,23 +4294,23 @@ var Markdown = (props) => {
|
|
|
4308
4294
|
level: defaultLevel,
|
|
4309
4295
|
...innerProps
|
|
4310
4296
|
},
|
|
4311
|
-
/* @__PURE__ */
|
|
4312
|
-
|
|
4297
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4298
|
+
import_react30.Suspense,
|
|
4313
4299
|
{
|
|
4314
|
-
fallback: fallback || /* @__PURE__ */
|
|
4300
|
+
fallback: fallback || /* @__PURE__ */ import_react30.default.createElement(Typography, null, /* @__PURE__ */ import_react30.default.createElement(import_joy42.Skeleton, null, content || ""))
|
|
4315
4301
|
},
|
|
4316
|
-
/* @__PURE__ */
|
|
4302
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4317
4303
|
LazyReactMarkdown,
|
|
4318
4304
|
{
|
|
4319
4305
|
...markdownOptions,
|
|
4320
4306
|
children: content,
|
|
4321
4307
|
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4322
4308
|
components: {
|
|
4323
|
-
h1: ({ children }) => /* @__PURE__ */
|
|
4324
|
-
h2: ({ children }) => /* @__PURE__ */
|
|
4325
|
-
h3: ({ children }) => /* @__PURE__ */
|
|
4326
|
-
h4: ({ children }) => /* @__PURE__ */
|
|
4327
|
-
p: ({ children, node }) => /* @__PURE__ */
|
|
4309
|
+
h1: ({ children }) => /* @__PURE__ */ import_react30.default.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4310
|
+
h2: ({ children }) => /* @__PURE__ */ import_react30.default.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
4311
|
+
h3: ({ children }) => /* @__PURE__ */ import_react30.default.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
4312
|
+
h4: ({ children }) => /* @__PURE__ */ import_react30.default.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
4313
|
+
p: ({ children, node }) => /* @__PURE__ */ import_react30.default.createElement(
|
|
4328
4314
|
Typography,
|
|
4329
4315
|
{
|
|
4330
4316
|
color,
|
|
@@ -4334,10 +4320,10 @@ var Markdown = (props) => {
|
|
|
4334
4320
|
},
|
|
4335
4321
|
children
|
|
4336
4322
|
),
|
|
4337
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
4338
|
-
hr: () => /* @__PURE__ */
|
|
4339
|
-
b: ({ children }) => /* @__PURE__ */
|
|
4340
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
4323
|
+
a: ({ children, href }) => /* @__PURE__ */ import_react30.default.createElement(import_joy43.Link, { href, target: defaultLinkAction }, children),
|
|
4324
|
+
hr: () => /* @__PURE__ */ import_react30.default.createElement(Divider, null),
|
|
4325
|
+
b: ({ children }) => /* @__PURE__ */ import_react30.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4326
|
+
strong: ({ children }) => /* @__PURE__ */ import_react30.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4341
4327
|
...markdownOptions?.components
|
|
4342
4328
|
}
|
|
4343
4329
|
}
|
|
@@ -4348,7 +4334,7 @@ var Markdown = (props) => {
|
|
|
4348
4334
|
Markdown.displayName = "Markdown";
|
|
4349
4335
|
|
|
4350
4336
|
// src/components/MenuButton/MenuButton.tsx
|
|
4351
|
-
var
|
|
4337
|
+
var import_react31 = __toESM(require("react"));
|
|
4352
4338
|
var import_joy44 = require("@mui/joy");
|
|
4353
4339
|
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"));
|
|
4354
4340
|
function MenuButton(props) {
|
|
@@ -4365,7 +4351,7 @@ function MenuButton(props) {
|
|
|
4365
4351
|
startDecorator
|
|
4366
4352
|
} = props;
|
|
4367
4353
|
if (!items.length) {
|
|
4368
|
-
return /* @__PURE__ */
|
|
4354
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
4369
4355
|
import_joy44.Button,
|
|
4370
4356
|
{
|
|
4371
4357
|
component: props.buttonComponent ?? "button",
|
|
@@ -4376,12 +4362,12 @@ function MenuButton(props) {
|
|
|
4376
4362
|
loading,
|
|
4377
4363
|
startDecorator,
|
|
4378
4364
|
...props.buttonComponentProps ?? {},
|
|
4379
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
4365
|
+
endDecorator: showIcon ? /* @__PURE__ */ import_react31.default.createElement(import_react31.default.Fragment, null, endDecorator, /* @__PURE__ */ import_react31.default.createElement(import_ExpandMore.default, null)) : /* @__PURE__ */ import_react31.default.createElement(import_react31.default.Fragment, null, endDecorator)
|
|
4380
4366
|
},
|
|
4381
4367
|
buttonText
|
|
4382
4368
|
);
|
|
4383
4369
|
}
|
|
4384
|
-
return /* @__PURE__ */
|
|
4370
|
+
return /* @__PURE__ */ import_react31.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react31.default.createElement(
|
|
4385
4371
|
import_joy44.MenuButton,
|
|
4386
4372
|
{
|
|
4387
4373
|
component: props.buttonComponent ?? "button",
|
|
@@ -4392,10 +4378,10 @@ function MenuButton(props) {
|
|
|
4392
4378
|
loading,
|
|
4393
4379
|
startDecorator,
|
|
4394
4380
|
...props.buttonComponentProps ?? {},
|
|
4395
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
4381
|
+
endDecorator: showIcon ? /* @__PURE__ */ import_react31.default.createElement(import_react31.default.Fragment, null, endDecorator, /* @__PURE__ */ import_react31.default.createElement(import_ExpandMore.default, null)) : /* @__PURE__ */ import_react31.default.createElement(import_react31.default.Fragment, null, endDecorator)
|
|
4396
4382
|
},
|
|
4397
4383
|
buttonText
|
|
4398
|
-
), /* @__PURE__ */
|
|
4384
|
+
), /* @__PURE__ */ import_react31.default.createElement(Menu, { size }, items.map((i) => /* @__PURE__ */ import_react31.default.createElement(
|
|
4399
4385
|
MenuItem,
|
|
4400
4386
|
{
|
|
4401
4387
|
key: i.text,
|
|
@@ -4408,7 +4394,7 @@ function MenuButton(props) {
|
|
|
4408
4394
|
MenuButton.displayName = "MenuButton";
|
|
4409
4395
|
|
|
4410
4396
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
4411
|
-
var
|
|
4397
|
+
var import_react32 = __toESM(require("react"));
|
|
4412
4398
|
var import_react_imask3 = require("react-imask");
|
|
4413
4399
|
var import_CalendarToday3 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
4414
4400
|
var import_joy45 = require("@mui/joy");
|
|
@@ -4457,10 +4443,10 @@ function parseDate3(dateString) {
|
|
|
4457
4443
|
const date = /* @__PURE__ */ new Date(`${year}/${month}`);
|
|
4458
4444
|
return date;
|
|
4459
4445
|
}
|
|
4460
|
-
var TextMaskAdapter7 =
|
|
4446
|
+
var TextMaskAdapter7 = import_react32.default.forwardRef(
|
|
4461
4447
|
function TextMaskAdapter8(props, ref) {
|
|
4462
4448
|
const { onChange, format, ...other } = props;
|
|
4463
|
-
return /* @__PURE__ */
|
|
4449
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
4464
4450
|
import_react_imask3.IMaskInput,
|
|
4465
4451
|
{
|
|
4466
4452
|
...other,
|
|
@@ -4489,7 +4475,7 @@ var TextMaskAdapter7 = import_react33.default.forwardRef(
|
|
|
4489
4475
|
);
|
|
4490
4476
|
}
|
|
4491
4477
|
);
|
|
4492
|
-
var MonthPicker = (0,
|
|
4478
|
+
var MonthPicker = (0, import_react32.forwardRef)(
|
|
4493
4479
|
(inProps, ref) => {
|
|
4494
4480
|
const props = (0, import_joy45.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
4495
4481
|
const {
|
|
@@ -4510,40 +4496,40 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4510
4496
|
size,
|
|
4511
4497
|
...innerProps
|
|
4512
4498
|
} = props;
|
|
4513
|
-
const innerRef = (0,
|
|
4499
|
+
const innerRef = (0, import_react32.useRef)(null);
|
|
4514
4500
|
const [value, setValue] = useControlledState(
|
|
4515
4501
|
props.value,
|
|
4516
4502
|
props.defaultValue || "",
|
|
4517
|
-
(0,
|
|
4503
|
+
(0, import_react32.useCallback)(
|
|
4518
4504
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4519
4505
|
[props.name, onChange]
|
|
4520
4506
|
),
|
|
4521
4507
|
{ disableStrict: true }
|
|
4522
4508
|
);
|
|
4523
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
4509
|
+
const [anchorEl, setAnchorEl] = (0, import_react32.useState)(null);
|
|
4524
4510
|
const open = Boolean(anchorEl);
|
|
4525
|
-
(0,
|
|
4511
|
+
(0, import_react32.useEffect)(() => {
|
|
4526
4512
|
if (!anchorEl) {
|
|
4527
4513
|
innerRef.current?.blur();
|
|
4528
4514
|
}
|
|
4529
4515
|
}, [anchorEl, innerRef]);
|
|
4530
|
-
(0,
|
|
4516
|
+
(0, import_react32.useImperativeHandle)(ref, () => innerRef.current, [
|
|
4531
4517
|
innerRef
|
|
4532
4518
|
]);
|
|
4533
|
-
const handleChange = (0,
|
|
4519
|
+
const handleChange = (0, import_react32.useCallback)(
|
|
4534
4520
|
(event) => {
|
|
4535
4521
|
setValue(event.target.value);
|
|
4536
4522
|
},
|
|
4537
4523
|
[setValue]
|
|
4538
4524
|
);
|
|
4539
|
-
const handleCalendarToggle = (0,
|
|
4525
|
+
const handleCalendarToggle = (0, import_react32.useCallback)(
|
|
4540
4526
|
(event) => {
|
|
4541
4527
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4542
4528
|
innerRef.current?.focus();
|
|
4543
4529
|
},
|
|
4544
4530
|
[anchorEl, setAnchorEl, innerRef]
|
|
4545
4531
|
);
|
|
4546
|
-
return /* @__PURE__ */
|
|
4532
|
+
return /* @__PURE__ */ import_react32.default.createElement(MonthPickerRoot, null, /* @__PURE__ */ import_react32.default.createElement(import_base4.FocusTrap, { open: true }, /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, /* @__PURE__ */ import_react32.default.createElement(
|
|
4547
4533
|
Input_default,
|
|
4548
4534
|
{
|
|
4549
4535
|
...innerProps,
|
|
@@ -4565,7 +4551,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4565
4551
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4566
4552
|
fontFamily: "monospace"
|
|
4567
4553
|
},
|
|
4568
|
-
endDecorator: /* @__PURE__ */
|
|
4554
|
+
endDecorator: /* @__PURE__ */ import_react32.default.createElement(
|
|
4569
4555
|
IconButton_default,
|
|
4570
4556
|
{
|
|
4571
4557
|
variant: "plain",
|
|
@@ -4575,12 +4561,12 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4575
4561
|
"aria-haspopup": "dialog",
|
|
4576
4562
|
"aria-expanded": open
|
|
4577
4563
|
},
|
|
4578
|
-
/* @__PURE__ */
|
|
4564
|
+
/* @__PURE__ */ import_react32.default.createElement(import_CalendarToday3.default, null)
|
|
4579
4565
|
),
|
|
4580
4566
|
label,
|
|
4581
4567
|
helperText
|
|
4582
4568
|
}
|
|
4583
|
-
), open && /* @__PURE__ */
|
|
4569
|
+
), open && /* @__PURE__ */ import_react32.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react32.default.createElement(
|
|
4584
4570
|
StyledPopper3,
|
|
4585
4571
|
{
|
|
4586
4572
|
id: "month-picker-popper",
|
|
@@ -4599,7 +4585,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4599
4585
|
"aria-label": "Calendar Tooltip",
|
|
4600
4586
|
"aria-expanded": open
|
|
4601
4587
|
},
|
|
4602
|
-
/* @__PURE__ */
|
|
4588
|
+
/* @__PURE__ */ import_react32.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
4603
4589
|
Calendar_default,
|
|
4604
4590
|
{
|
|
4605
4591
|
view: "month",
|
|
@@ -4619,14 +4605,14 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4619
4605
|
disableFuture,
|
|
4620
4606
|
disablePast
|
|
4621
4607
|
}
|
|
4622
|
-
), /* @__PURE__ */
|
|
4608
|
+
), /* @__PURE__ */ import_react32.default.createElement(
|
|
4623
4609
|
DialogActions_default,
|
|
4624
4610
|
{
|
|
4625
4611
|
sx: {
|
|
4626
4612
|
p: 1
|
|
4627
4613
|
}
|
|
4628
4614
|
},
|
|
4629
|
-
/* @__PURE__ */
|
|
4615
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
4630
4616
|
Button_default,
|
|
4631
4617
|
{
|
|
4632
4618
|
size,
|
|
@@ -4650,7 +4636,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4650
4636
|
);
|
|
4651
4637
|
|
|
4652
4638
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
4653
|
-
var
|
|
4639
|
+
var import_react33 = __toESM(require("react"));
|
|
4654
4640
|
var import_react_imask4 = require("react-imask");
|
|
4655
4641
|
var import_CalendarToday4 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
4656
4642
|
var import_joy46 = require("@mui/joy");
|
|
@@ -4708,10 +4694,10 @@ var parseDates2 = (str) => {
|
|
|
4708
4694
|
var formatToPattern4 = (format) => {
|
|
4709
4695
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
4710
4696
|
};
|
|
4711
|
-
var TextMaskAdapter9 =
|
|
4697
|
+
var TextMaskAdapter9 = import_react33.default.forwardRef(
|
|
4712
4698
|
function TextMaskAdapter10(props, ref) {
|
|
4713
4699
|
const { onChange, format, ...other } = props;
|
|
4714
|
-
return /* @__PURE__ */
|
|
4700
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
4715
4701
|
import_react_imask4.IMaskInput,
|
|
4716
4702
|
{
|
|
4717
4703
|
...other,
|
|
@@ -4740,7 +4726,7 @@ var TextMaskAdapter9 = import_react34.default.forwardRef(
|
|
|
4740
4726
|
);
|
|
4741
4727
|
}
|
|
4742
4728
|
);
|
|
4743
|
-
var MonthRangePicker = (0,
|
|
4729
|
+
var MonthRangePicker = (0, import_react33.forwardRef)(
|
|
4744
4730
|
(inProps, ref) => {
|
|
4745
4731
|
const props = (0, import_joy46.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
4746
4732
|
const {
|
|
@@ -4761,44 +4747,44 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4761
4747
|
size,
|
|
4762
4748
|
...innerProps
|
|
4763
4749
|
} = props;
|
|
4764
|
-
const innerRef = (0,
|
|
4750
|
+
const innerRef = (0, import_react33.useRef)(null);
|
|
4765
4751
|
const [value, setValue] = useControlledState(
|
|
4766
4752
|
props.value,
|
|
4767
4753
|
props.defaultValue || "",
|
|
4768
|
-
(0,
|
|
4754
|
+
(0, import_react33.useCallback)(
|
|
4769
4755
|
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4770
4756
|
[props.name, onChange]
|
|
4771
4757
|
),
|
|
4772
4758
|
{ disableStrict: true }
|
|
4773
4759
|
);
|
|
4774
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
4760
|
+
const [anchorEl, setAnchorEl] = (0, import_react33.useState)(null);
|
|
4775
4761
|
const open = Boolean(anchorEl);
|
|
4776
|
-
const calendarValue = (0,
|
|
4762
|
+
const calendarValue = (0, import_react33.useMemo)(
|
|
4777
4763
|
() => value ? parseDates2(value) : void 0,
|
|
4778
4764
|
[value]
|
|
4779
4765
|
);
|
|
4780
|
-
(0,
|
|
4766
|
+
(0, import_react33.useEffect)(() => {
|
|
4781
4767
|
if (!anchorEl) {
|
|
4782
4768
|
innerRef.current?.blur();
|
|
4783
4769
|
}
|
|
4784
4770
|
}, [anchorEl, innerRef]);
|
|
4785
|
-
(0,
|
|
4771
|
+
(0, import_react33.useImperativeHandle)(ref, () => innerRef.current, [
|
|
4786
4772
|
innerRef
|
|
4787
4773
|
]);
|
|
4788
|
-
const handleChange = (0,
|
|
4774
|
+
const handleChange = (0, import_react33.useCallback)(
|
|
4789
4775
|
(event) => {
|
|
4790
4776
|
setValue(event.target.value);
|
|
4791
4777
|
},
|
|
4792
4778
|
[setValue]
|
|
4793
4779
|
);
|
|
4794
|
-
const handleCalendarToggle = (0,
|
|
4780
|
+
const handleCalendarToggle = (0, import_react33.useCallback)(
|
|
4795
4781
|
(event) => {
|
|
4796
4782
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4797
4783
|
innerRef.current?.focus();
|
|
4798
4784
|
},
|
|
4799
4785
|
[anchorEl, setAnchorEl, innerRef]
|
|
4800
4786
|
);
|
|
4801
|
-
const handleCalendarChange = (0,
|
|
4787
|
+
const handleCalendarChange = (0, import_react33.useCallback)(
|
|
4802
4788
|
([date1, date2]) => {
|
|
4803
4789
|
if (!date1 || !date2) return;
|
|
4804
4790
|
setValue(formatValueString4([date1, date2], format));
|
|
@@ -4806,7 +4792,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4806
4792
|
},
|
|
4807
4793
|
[setValue, setAnchorEl, format]
|
|
4808
4794
|
);
|
|
4809
|
-
return /* @__PURE__ */
|
|
4795
|
+
return /* @__PURE__ */ import_react33.default.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ import_react33.default.createElement(import_base5.FocusTrap, { open: true }, /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(
|
|
4810
4796
|
Input_default,
|
|
4811
4797
|
{
|
|
4812
4798
|
...innerProps,
|
|
@@ -4828,7 +4814,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4828
4814
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4829
4815
|
fontFamily: "monospace"
|
|
4830
4816
|
},
|
|
4831
|
-
endDecorator: /* @__PURE__ */
|
|
4817
|
+
endDecorator: /* @__PURE__ */ import_react33.default.createElement(
|
|
4832
4818
|
IconButton_default,
|
|
4833
4819
|
{
|
|
4834
4820
|
variant: "plain",
|
|
@@ -4838,12 +4824,12 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4838
4824
|
"aria-haspopup": "dialog",
|
|
4839
4825
|
"aria-expanded": open
|
|
4840
4826
|
},
|
|
4841
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ import_react33.default.createElement(import_CalendarToday4.default, null)
|
|
4842
4828
|
),
|
|
4843
4829
|
label,
|
|
4844
4830
|
helperText
|
|
4845
4831
|
}
|
|
4846
|
-
), open && /* @__PURE__ */
|
|
4832
|
+
), open && /* @__PURE__ */ import_react33.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react33.default.createElement(
|
|
4847
4833
|
StyledPopper4,
|
|
4848
4834
|
{
|
|
4849
4835
|
id: "month-range-picker-popper",
|
|
@@ -4862,7 +4848,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4862
4848
|
"aria-label": "Calendar Tooltip",
|
|
4863
4849
|
"aria-expanded": open
|
|
4864
4850
|
},
|
|
4865
|
-
/* @__PURE__ */
|
|
4851
|
+
/* @__PURE__ */ import_react33.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
4866
4852
|
Calendar_default,
|
|
4867
4853
|
{
|
|
4868
4854
|
view: "month",
|
|
@@ -4875,14 +4861,14 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4875
4861
|
disableFuture,
|
|
4876
4862
|
disablePast
|
|
4877
4863
|
}
|
|
4878
|
-
), /* @__PURE__ */
|
|
4864
|
+
), /* @__PURE__ */ import_react33.default.createElement(
|
|
4879
4865
|
DialogActions_default,
|
|
4880
4866
|
{
|
|
4881
4867
|
sx: {
|
|
4882
4868
|
p: 1
|
|
4883
4869
|
}
|
|
4884
4870
|
},
|
|
4885
|
-
/* @__PURE__ */
|
|
4871
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
4886
4872
|
Button_default,
|
|
4887
4873
|
{
|
|
4888
4874
|
size,
|
|
@@ -4902,7 +4888,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
|
|
|
4902
4888
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
4903
4889
|
|
|
4904
4890
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
4905
|
-
var
|
|
4891
|
+
var import_react34 = __toESM(require("react"));
|
|
4906
4892
|
var import_joy47 = require("@mui/joy");
|
|
4907
4893
|
var AccordionSummary2 = (0, import_joy47.styled)(import_joy47.AccordionSummary, {
|
|
4908
4894
|
name: "NavigationGroup",
|
|
@@ -4926,11 +4912,11 @@ var AccordionDetails2 = (0, import_joy47.styled)(import_joy47.AccordionDetails,
|
|
|
4926
4912
|
}));
|
|
4927
4913
|
function NavigationGroup(props) {
|
|
4928
4914
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
4929
|
-
return /* @__PURE__ */
|
|
4915
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_joy47.Accordion, { ...rest }, /* @__PURE__ */ import_react34.default.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ import_react34.default.createElement(import_joy47.Stack, { direction: "row", gap: 4 }, startDecorator, title)), /* @__PURE__ */ import_react34.default.createElement(AccordionDetails2, null, children));
|
|
4930
4916
|
}
|
|
4931
4917
|
|
|
4932
4918
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
4933
|
-
var
|
|
4919
|
+
var import_react35 = __toESM(require("react"));
|
|
4934
4920
|
var import_joy48 = require("@mui/joy");
|
|
4935
4921
|
var ListItemButton = (0, import_joy48.styled)(import_joy48.ListItemButton, {
|
|
4936
4922
|
name: "NavigationItem",
|
|
@@ -4959,7 +4945,7 @@ function NavigationItem(props) {
|
|
|
4959
4945
|
const handleClick = () => {
|
|
4960
4946
|
onClick?.(id);
|
|
4961
4947
|
};
|
|
4962
|
-
return /* @__PURE__ */
|
|
4948
|
+
return /* @__PURE__ */ import_react35.default.createElement(import_joy48.ListItem, { ...rest }, /* @__PURE__ */ import_react35.default.createElement(
|
|
4963
4949
|
ListItemButton,
|
|
4964
4950
|
{
|
|
4965
4951
|
level,
|
|
@@ -4968,21 +4954,21 @@ function NavigationItem(props) {
|
|
|
4968
4954
|
"aria-current": selected,
|
|
4969
4955
|
onClick: handleClick
|
|
4970
4956
|
},
|
|
4971
|
-
startDecorator && /* @__PURE__ */
|
|
4957
|
+
startDecorator && /* @__PURE__ */ import_react35.default.createElement(import_joy48.ListItemDecorator, null, startDecorator),
|
|
4972
4958
|
children
|
|
4973
4959
|
));
|
|
4974
4960
|
}
|
|
4975
4961
|
|
|
4976
4962
|
// src/components/Navigator/Navigator.tsx
|
|
4977
|
-
var
|
|
4963
|
+
var import_react36 = __toESM(require("react"));
|
|
4978
4964
|
function Navigator(props) {
|
|
4979
4965
|
const { items, level = 0, onSelect } = props;
|
|
4980
4966
|
const handleItemClick = (id) => {
|
|
4981
4967
|
onSelect?.(id);
|
|
4982
4968
|
};
|
|
4983
|
-
return /* @__PURE__ */
|
|
4969
|
+
return /* @__PURE__ */ import_react36.default.createElement("div", null, items.map((item, index) => {
|
|
4984
4970
|
if (item.type === "item") {
|
|
4985
|
-
return /* @__PURE__ */
|
|
4971
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
4986
4972
|
NavigationItem,
|
|
4987
4973
|
{
|
|
4988
4974
|
key: item.id,
|
|
@@ -4995,7 +4981,7 @@ function Navigator(props) {
|
|
|
4995
4981
|
item.title
|
|
4996
4982
|
);
|
|
4997
4983
|
} else if (item.type === "group") {
|
|
4998
|
-
return /* @__PURE__ */
|
|
4984
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
4999
4985
|
NavigationGroup,
|
|
5000
4986
|
{
|
|
5001
4987
|
key: index,
|
|
@@ -5013,17 +4999,17 @@ function Navigator(props) {
|
|
|
5013
4999
|
Navigator.displayName = "Navigator";
|
|
5014
5000
|
|
|
5015
5001
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
5016
|
-
var
|
|
5002
|
+
var import_react37 = __toESM(require("react"));
|
|
5017
5003
|
var import_react_number_format2 = require("react-number-format");
|
|
5018
5004
|
var import_joy49 = require("@mui/joy");
|
|
5019
5005
|
var padDecimal = (value, decimalScale) => {
|
|
5020
5006
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5021
5007
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5022
5008
|
};
|
|
5023
|
-
var TextMaskAdapter11 =
|
|
5009
|
+
var TextMaskAdapter11 = import_react37.default.forwardRef(
|
|
5024
5010
|
function TextMaskAdapter12(props, ref) {
|
|
5025
5011
|
const { onChange, min, max, ...innerProps } = props;
|
|
5026
|
-
return /* @__PURE__ */
|
|
5012
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
|
5027
5013
|
import_react_number_format2.NumericFormat,
|
|
5028
5014
|
{
|
|
5029
5015
|
...innerProps,
|
|
@@ -5049,7 +5035,7 @@ var PercentageInputRoot = (0, import_joy49.styled)(Input_default, {
|
|
|
5049
5035
|
slot: "Root",
|
|
5050
5036
|
overridesResolver: (props, styles) => styles.root
|
|
5051
5037
|
})({});
|
|
5052
|
-
var PercentageInput =
|
|
5038
|
+
var PercentageInput = import_react37.default.forwardRef(function PercentageInput2(inProps, ref) {
|
|
5053
5039
|
const props = (0, import_joy49.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
5054
5040
|
const {
|
|
5055
5041
|
name,
|
|
@@ -5071,21 +5057,21 @@ var PercentageInput = import_react38.default.forwardRef(function PercentageInput
|
|
|
5071
5057
|
const [_value, setValue] = useControlledState(
|
|
5072
5058
|
props.value,
|
|
5073
5059
|
props.defaultValue,
|
|
5074
|
-
(0,
|
|
5060
|
+
(0, import_react37.useCallback)(
|
|
5075
5061
|
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
5076
5062
|
[onChange, name]
|
|
5077
5063
|
)
|
|
5078
5064
|
);
|
|
5079
|
-
const [internalError, setInternalError] = (0,
|
|
5065
|
+
const [internalError, setInternalError] = (0, import_react37.useState)(
|
|
5080
5066
|
max && _value && _value > max || min && _value && _value < min
|
|
5081
5067
|
);
|
|
5082
|
-
const value = (0,
|
|
5068
|
+
const value = (0, import_react37.useMemo)(() => {
|
|
5083
5069
|
if (_value && useMinorUnit) {
|
|
5084
5070
|
return _value / Math.pow(10, maxDecimalScale);
|
|
5085
5071
|
}
|
|
5086
5072
|
return _value;
|
|
5087
5073
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5088
|
-
const handleChange = (0,
|
|
5074
|
+
const handleChange = (0, import_react37.useCallback)(
|
|
5089
5075
|
(event) => {
|
|
5090
5076
|
if (event.target.value === "") {
|
|
5091
5077
|
setValue(void 0);
|
|
@@ -5102,7 +5088,7 @@ var PercentageInput = import_react38.default.forwardRef(function PercentageInput
|
|
|
5102
5088
|
},
|
|
5103
5089
|
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5104
5090
|
);
|
|
5105
|
-
return /* @__PURE__ */
|
|
5091
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
|
5106
5092
|
PercentageInputRoot,
|
|
5107
5093
|
{
|
|
5108
5094
|
...innerProps,
|
|
@@ -5133,27 +5119,27 @@ PercentageInput.displayName = "PercentageInput";
|
|
|
5133
5119
|
|
|
5134
5120
|
// src/components/Radio/Radio.tsx
|
|
5135
5121
|
var import_joy50 = require("@mui/joy");
|
|
5136
|
-
var
|
|
5137
|
-
var MotionRadio = (0,
|
|
5122
|
+
var import_framer_motion26 = require("framer-motion");
|
|
5123
|
+
var MotionRadio = (0, import_framer_motion26.motion)(import_joy50.Radio);
|
|
5138
5124
|
var Radio = MotionRadio;
|
|
5139
5125
|
Radio.displayName = "Radio";
|
|
5140
|
-
var MotionRadioGroup = (0,
|
|
5126
|
+
var MotionRadioGroup = (0, import_framer_motion26.motion)(import_joy50.RadioGroup);
|
|
5141
5127
|
var RadioGroup = MotionRadioGroup;
|
|
5142
5128
|
RadioGroup.displayName = "RadioGroup";
|
|
5143
5129
|
|
|
5144
5130
|
// src/components/RadioList/RadioList.tsx
|
|
5145
|
-
var
|
|
5131
|
+
var import_react38 = __toESM(require("react"));
|
|
5146
5132
|
function RadioList(props) {
|
|
5147
5133
|
const { items, ...innerProps } = props;
|
|
5148
|
-
return /* @__PURE__ */
|
|
5134
|
+
return /* @__PURE__ */ import_react38.default.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ import_react38.default.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
5149
5135
|
}
|
|
5150
5136
|
RadioList.displayName = "RadioList";
|
|
5151
5137
|
|
|
5152
5138
|
// src/components/Stepper/Stepper.tsx
|
|
5153
|
-
var
|
|
5139
|
+
var import_react39 = __toESM(require("react"));
|
|
5154
5140
|
var import_joy51 = require("@mui/joy");
|
|
5155
5141
|
var import_Check = __toESM(require("@mui/icons-material/Check"));
|
|
5156
|
-
var
|
|
5142
|
+
var import_framer_motion27 = require("framer-motion");
|
|
5157
5143
|
var Step = (0, import_joy51.styled)(import_joy51.Step)({});
|
|
5158
5144
|
Step.displayName = "Step";
|
|
5159
5145
|
var StepIndicator = (0, import_joy51.styled)(import_joy51.StepIndicator)({});
|
|
@@ -5166,7 +5152,7 @@ var StyledStepper = (0, import_joy51.styled)(import_joy51.Stepper)(({ theme }) =
|
|
|
5166
5152
|
fontSize: "var(--ceed-fontSize-xs)"
|
|
5167
5153
|
}
|
|
5168
5154
|
}));
|
|
5169
|
-
var MotionStepper = (0,
|
|
5155
|
+
var MotionStepper = (0, import_framer_motion27.motion)(StyledStepper);
|
|
5170
5156
|
function Stepper(props) {
|
|
5171
5157
|
const {
|
|
5172
5158
|
steps,
|
|
@@ -5176,7 +5162,7 @@ function Stepper(props) {
|
|
|
5176
5162
|
inactiveLineColor = "neutral.300",
|
|
5177
5163
|
activeStep
|
|
5178
5164
|
} = props;
|
|
5179
|
-
return /* @__PURE__ */
|
|
5165
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
5180
5166
|
MotionStepper,
|
|
5181
5167
|
{
|
|
5182
5168
|
sx: (theme) => ({
|
|
@@ -5210,15 +5196,15 @@ function Stepper(props) {
|
|
|
5210
5196
|
const completed = activeStep > i + 1;
|
|
5211
5197
|
const disabled = activeStep < i + 1;
|
|
5212
5198
|
const hasContent = step.label || step.extraContent;
|
|
5213
|
-
return /* @__PURE__ */
|
|
5199
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
5214
5200
|
Step,
|
|
5215
5201
|
{
|
|
5216
|
-
indicator: /* @__PURE__ */
|
|
5202
|
+
indicator: /* @__PURE__ */ import_react39.default.createElement(StepIndicator, { variant: "solid", color: "primary" }, completed ? /* @__PURE__ */ import_react39.default.createElement(import_Check.default, null) : step.indicatorContent),
|
|
5217
5203
|
active,
|
|
5218
5204
|
completed,
|
|
5219
5205
|
disabled
|
|
5220
5206
|
},
|
|
5221
|
-
hasContent && /* @__PURE__ */
|
|
5207
|
+
hasContent && /* @__PURE__ */ import_react39.default.createElement(Stack_default, null, step.label && /* @__PURE__ */ import_react39.default.createElement(Typography_default, { level: "title-sm" }, step.label), step.extraContent && /* @__PURE__ */ import_react39.default.createElement(Typography_default, { level: "body-xs" }, step.extraContent))
|
|
5222
5208
|
);
|
|
5223
5209
|
})
|
|
5224
5210
|
);
|
|
@@ -5226,11 +5212,11 @@ function Stepper(props) {
|
|
|
5226
5212
|
Stepper.displayName = "Stepper";
|
|
5227
5213
|
|
|
5228
5214
|
// src/components/Switch/Switch.tsx
|
|
5229
|
-
var
|
|
5215
|
+
var import_react40 = __toESM(require("react"));
|
|
5230
5216
|
var import_joy52 = require("@mui/joy");
|
|
5231
|
-
var
|
|
5232
|
-
var MotionSwitch = (0,
|
|
5233
|
-
var StyledThumb = (0, import_joy52.styled)(
|
|
5217
|
+
var import_framer_motion28 = require("framer-motion");
|
|
5218
|
+
var MotionSwitch = (0, import_framer_motion28.motion)(import_joy52.Switch);
|
|
5219
|
+
var StyledThumb = (0, import_joy52.styled)(import_framer_motion28.motion.div)({
|
|
5234
5220
|
"--Icon-fontSize": "calc(var(--Switch-thumbSize) * 0.75)",
|
|
5235
5221
|
display: "inline-flex",
|
|
5236
5222
|
justifyContent: "center",
|
|
@@ -5248,14 +5234,14 @@ var StyledThumb = (0, import_joy52.styled)(import_framer_motion29.motion.div)({
|
|
|
5248
5234
|
right: "var(--Switch-thumbOffset)"
|
|
5249
5235
|
}
|
|
5250
5236
|
});
|
|
5251
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
5237
|
+
var Thumb = (props) => /* @__PURE__ */ import_react40.default.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
5252
5238
|
var spring = {
|
|
5253
5239
|
type: "spring",
|
|
5254
5240
|
stiffness: 700,
|
|
5255
5241
|
damping: 30
|
|
5256
5242
|
};
|
|
5257
5243
|
var Switch = (props) => {
|
|
5258
|
-
return /* @__PURE__ */
|
|
5244
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
|
5259
5245
|
MotionSwitch,
|
|
5260
5246
|
{
|
|
5261
5247
|
...props,
|
|
@@ -5270,22 +5256,22 @@ Switch.displayName = "Switch";
|
|
|
5270
5256
|
|
|
5271
5257
|
// src/components/Tabs/Tabs.tsx
|
|
5272
5258
|
var import_joy53 = require("@mui/joy");
|
|
5273
|
-
var
|
|
5274
|
-
var MotionTabs = (0,
|
|
5259
|
+
var import_framer_motion29 = require("framer-motion");
|
|
5260
|
+
var MotionTabs = (0, import_framer_motion29.motion)(import_joy53.Tabs);
|
|
5275
5261
|
var Tabs = MotionTabs;
|
|
5276
5262
|
Tabs.displayName = "Tabs";
|
|
5277
|
-
var MotionTab = (0,
|
|
5263
|
+
var MotionTab = (0, import_framer_motion29.motion)(import_joy53.Tab);
|
|
5278
5264
|
var Tab = MotionTab;
|
|
5279
5265
|
Tab.displayName = "Tab";
|
|
5280
|
-
var MotionTabList = (0,
|
|
5266
|
+
var MotionTabList = (0, import_framer_motion29.motion)(import_joy53.TabList);
|
|
5281
5267
|
var TabList = MotionTabList;
|
|
5282
5268
|
TabList.displayName = "TabList";
|
|
5283
|
-
var MotionTabPanel = (0,
|
|
5269
|
+
var MotionTabPanel = (0, import_framer_motion29.motion)(import_joy53.TabPanel);
|
|
5284
5270
|
var TabPanel = MotionTabPanel;
|
|
5285
5271
|
TabPanel.displayName = "TabPanel";
|
|
5286
5272
|
|
|
5287
5273
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
5288
|
-
var
|
|
5274
|
+
var import_react41 = __toESM(require("react"));
|
|
5289
5275
|
var import_joy54 = require("@mui/joy");
|
|
5290
5276
|
var colorScheme = {
|
|
5291
5277
|
palette: {
|
|
@@ -5535,12 +5521,12 @@ var defaultTheme = (0, import_joy54.extendTheme)({
|
|
|
5535
5521
|
});
|
|
5536
5522
|
function ThemeProvider(props) {
|
|
5537
5523
|
const theme = props.theme || defaultTheme;
|
|
5538
|
-
return /* @__PURE__ */
|
|
5524
|
+
return /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, /* @__PURE__ */ import_react41.default.createElement(import_joy54.CssVarsProvider, { theme }, /* @__PURE__ */ import_react41.default.createElement(import_joy54.CssBaseline, null), props.children));
|
|
5539
5525
|
}
|
|
5540
5526
|
ThemeProvider.displayName = "ThemeProvider";
|
|
5541
5527
|
|
|
5542
5528
|
// src/components/Uploader/Uploader.tsx
|
|
5543
|
-
var
|
|
5529
|
+
var import_react42 = __toESM(require("react"));
|
|
5544
5530
|
var import_joy55 = require("@mui/joy");
|
|
5545
5531
|
var import_CloudUploadRounded = __toESM(require("@mui/icons-material/CloudUploadRounded"));
|
|
5546
5532
|
var import_UploadFileRounded = __toESM(require("@mui/icons-material/UploadFileRounded"));
|
|
@@ -5658,7 +5644,7 @@ var getFileSize = (n) => {
|
|
|
5658
5644
|
};
|
|
5659
5645
|
var Preview = (props) => {
|
|
5660
5646
|
const { files, uploaded, onDelete } = props;
|
|
5661
|
-
return /* @__PURE__ */
|
|
5647
|
+
return /* @__PURE__ */ import_react42.default.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ import_react42.default.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ import_react42.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ import_react42.default.createElement(UploadFileIcon, null), /* @__PURE__ */ import_react42.default.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ import_react42.default.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ import_react42.default.createElement(
|
|
5662
5648
|
Typography_default,
|
|
5663
5649
|
{
|
|
5664
5650
|
level: "body-xs",
|
|
@@ -5667,7 +5653,7 @@ var Preview = (props) => {
|
|
|
5667
5653
|
textColor: "text.tertiary"
|
|
5668
5654
|
},
|
|
5669
5655
|
getFileSize(file.size)
|
|
5670
|
-
)), /* @__PURE__ */
|
|
5656
|
+
)), /* @__PURE__ */ import_react42.default.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ import_react42.default.createElement(ClearIcon2, null))))));
|
|
5671
5657
|
};
|
|
5672
5658
|
var UploaderRoot = (0, import_joy55.styled)(Stack_default, {
|
|
5673
5659
|
name: "Uploader",
|
|
@@ -5704,7 +5690,7 @@ var UploaderIcon = (0, import_joy55.styled)(import_CloudUploadRounded.default, {
|
|
|
5704
5690
|
height: "32px"
|
|
5705
5691
|
})
|
|
5706
5692
|
);
|
|
5707
|
-
var Uploader =
|
|
5693
|
+
var Uploader = import_react42.default.memo(
|
|
5708
5694
|
(props) => {
|
|
5709
5695
|
const {
|
|
5710
5696
|
accept,
|
|
@@ -5719,19 +5705,19 @@ var Uploader = import_react43.default.memo(
|
|
|
5719
5705
|
disabled,
|
|
5720
5706
|
onDelete
|
|
5721
5707
|
} = props;
|
|
5722
|
-
const dropZoneRef = (0,
|
|
5723
|
-
const inputRef = (0,
|
|
5724
|
-
const [errorText, setErrorText] = (0,
|
|
5725
|
-
const [files, setFiles] = (0,
|
|
5726
|
-
const [uploaded, setUploaded] = (0,
|
|
5708
|
+
const dropZoneRef = (0, import_react42.useRef)(null);
|
|
5709
|
+
const inputRef = (0, import_react42.useRef)(null);
|
|
5710
|
+
const [errorText, setErrorText] = (0, import_react42.useState)();
|
|
5711
|
+
const [files, setFiles] = (0, import_react42.useState)([]);
|
|
5712
|
+
const [uploaded, setUploaded] = (0, import_react42.useState)(
|
|
5727
5713
|
props.uploaded || []
|
|
5728
5714
|
);
|
|
5729
|
-
const [previewState, setPreviewState] = (0,
|
|
5730
|
-
const accepts = (0,
|
|
5715
|
+
const [previewState, setPreviewState] = (0, import_react42.useState)("idle");
|
|
5716
|
+
const accepts = (0, import_react42.useMemo)(
|
|
5731
5717
|
() => accept.split(",").map((accept2) => accept2.trim()),
|
|
5732
5718
|
[accept]
|
|
5733
5719
|
);
|
|
5734
|
-
const parsedAccepts = (0,
|
|
5720
|
+
const parsedAccepts = (0, import_react42.useMemo)(
|
|
5735
5721
|
() => accepts.flatMap((type) => {
|
|
5736
5722
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
5737
5723
|
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
@@ -5740,7 +5726,7 @@ var Uploader = import_react43.default.memo(
|
|
|
5740
5726
|
}),
|
|
5741
5727
|
[accepts]
|
|
5742
5728
|
);
|
|
5743
|
-
const helperText = (0,
|
|
5729
|
+
const helperText = (0, import_react42.useMemo)(() => {
|
|
5744
5730
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
5745
5731
|
accepts.filter(
|
|
5746
5732
|
(accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
|
|
@@ -5773,15 +5759,15 @@ var Uploader = import_react43.default.memo(
|
|
|
5773
5759
|
}
|
|
5774
5760
|
return helperTexts.join(", ");
|
|
5775
5761
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
5776
|
-
const error = (0,
|
|
5762
|
+
const error = (0, import_react42.useMemo)(
|
|
5777
5763
|
() => !!errorText || props.error,
|
|
5778
5764
|
[props.error, errorText]
|
|
5779
5765
|
);
|
|
5780
|
-
const showDropZone = (0,
|
|
5766
|
+
const showDropZone = (0, import_react42.useMemo)(
|
|
5781
5767
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
5782
5768
|
[files, maxCount, uploaded]
|
|
5783
5769
|
);
|
|
5784
|
-
const addFiles = (0,
|
|
5770
|
+
const addFiles = (0, import_react42.useCallback)(
|
|
5785
5771
|
(uploads) => {
|
|
5786
5772
|
try {
|
|
5787
5773
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -5838,7 +5824,7 @@ var Uploader = import_react43.default.memo(
|
|
|
5838
5824
|
onChange
|
|
5839
5825
|
]
|
|
5840
5826
|
);
|
|
5841
|
-
(0,
|
|
5827
|
+
(0, import_react42.useEffect)(() => {
|
|
5842
5828
|
if (!dropZoneRef.current || disabled) {
|
|
5843
5829
|
return;
|
|
5844
5830
|
}
|
|
@@ -5886,7 +5872,7 @@ var Uploader = import_react43.default.memo(
|
|
|
5886
5872
|
);
|
|
5887
5873
|
return () => cleanup?.();
|
|
5888
5874
|
}, [disabled, addFiles]);
|
|
5889
|
-
(0,
|
|
5875
|
+
(0, import_react42.useEffect)(() => {
|
|
5890
5876
|
if (inputRef.current && minCount) {
|
|
5891
5877
|
if (files.length < minCount) {
|
|
5892
5878
|
inputRef.current.setCustomValidity(
|
|
@@ -5897,14 +5883,14 @@ var Uploader = import_react43.default.memo(
|
|
|
5897
5883
|
}
|
|
5898
5884
|
}
|
|
5899
5885
|
}, [inputRef, files, minCount]);
|
|
5900
|
-
const handleFileChanged = (0,
|
|
5886
|
+
const handleFileChanged = (0, import_react42.useCallback)(
|
|
5901
5887
|
(event) => {
|
|
5902
5888
|
const files2 = Array.from(event.target.files || []);
|
|
5903
5889
|
addFiles(files2);
|
|
5904
5890
|
},
|
|
5905
5891
|
[addFiles]
|
|
5906
5892
|
);
|
|
5907
|
-
const handleDeleteFile = (0,
|
|
5893
|
+
const handleDeleteFile = (0, import_react42.useCallback)(
|
|
5908
5894
|
(deletedFile) => {
|
|
5909
5895
|
if (deletedFile instanceof File) {
|
|
5910
5896
|
setFiles((current) => {
|
|
@@ -5926,10 +5912,10 @@ var Uploader = import_react43.default.memo(
|
|
|
5926
5912
|
},
|
|
5927
5913
|
[name, onChange, onDelete]
|
|
5928
5914
|
);
|
|
5929
|
-
const handleUploaderButtonClick = (0,
|
|
5915
|
+
const handleUploaderButtonClick = (0, import_react42.useCallback)(() => {
|
|
5930
5916
|
inputRef.current?.click();
|
|
5931
5917
|
}, []);
|
|
5932
|
-
const uploader = /* @__PURE__ */
|
|
5918
|
+
const uploader = /* @__PURE__ */ import_react42.default.createElement(
|
|
5933
5919
|
FileDropZone,
|
|
5934
5920
|
{
|
|
5935
5921
|
state: previewState,
|
|
@@ -5937,8 +5923,8 @@ var Uploader = import_react43.default.memo(
|
|
|
5937
5923
|
ref: dropZoneRef,
|
|
5938
5924
|
onClick: handleUploaderButtonClick
|
|
5939
5925
|
},
|
|
5940
|
-
/* @__PURE__ */
|
|
5941
|
-
/* @__PURE__ */
|
|
5926
|
+
/* @__PURE__ */ import_react42.default.createElement(Stack_default, { alignItems: "center", gap: 1 }, /* @__PURE__ */ import_react42.default.createElement(UploaderIcon, { state: previewState, error: !!(error || errorText) })),
|
|
5927
|
+
/* @__PURE__ */ import_react42.default.createElement(
|
|
5942
5928
|
VisuallyHiddenInput,
|
|
5943
5929
|
{
|
|
5944
5930
|
disabled,
|
|
@@ -5963,7 +5949,7 @@ var Uploader = import_react43.default.memo(
|
|
|
5963
5949
|
}
|
|
5964
5950
|
)
|
|
5965
5951
|
);
|
|
5966
|
-
return /* @__PURE__ */
|
|
5952
|
+
return /* @__PURE__ */ import_react42.default.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ import_react42.default.createElement(
|
|
5967
5953
|
FormControl_default,
|
|
5968
5954
|
{
|
|
5969
5955
|
size,
|
|
@@ -5971,10 +5957,10 @@ var Uploader = import_react43.default.memo(
|
|
|
5971
5957
|
disabled,
|
|
5972
5958
|
required: !!minCount
|
|
5973
5959
|
},
|
|
5974
|
-
label && /* @__PURE__ */
|
|
5960
|
+
label && /* @__PURE__ */ import_react42.default.createElement(FormLabel_default, null, label),
|
|
5975
5961
|
uploader,
|
|
5976
|
-
/* @__PURE__ */
|
|
5977
|
-
), [...uploaded, ...files].length > 0 && /* @__PURE__ */
|
|
5962
|
+
/* @__PURE__ */ import_react42.default.createElement(FormHelperText_default, null, /* @__PURE__ */ import_react42.default.createElement(Stack_default, null, errorText && /* @__PURE__ */ import_react42.default.createElement("div", null, errorText), /* @__PURE__ */ import_react42.default.createElement("div", null, helperText)))
|
|
5963
|
+
), [...uploaded, ...files].length > 0 && /* @__PURE__ */ import_react42.default.createElement(
|
|
5978
5964
|
Preview,
|
|
5979
5965
|
{
|
|
5980
5966
|
files,
|