@scglab/admin-ui 0.1.3 → 0.1.5
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/ic-sort-arrow-down-H56K6AN4.svg +11 -0
- package/dist/ic-sort-arrow-up-DJQRDWHQ.svg +11 -0
- package/dist/index.cjs +3412 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1371 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +397 -5
- package/dist/index.d.ts +397 -5
- package/dist/index.js +3391 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -154,8 +154,3399 @@ function Text({
|
|
|
154
154
|
};
|
|
155
155
|
return /* @__PURE__ */ jsx("div", { id, style: styles, className, ...props, children });
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
// src/utils/helperUtils.ts
|
|
159
|
+
import moment from "moment";
|
|
160
|
+
var toRemFunction2 = (px) => {
|
|
161
|
+
return `${px / 14}rem`;
|
|
162
|
+
};
|
|
163
|
+
var formatNumberWithComma = (num) => {
|
|
164
|
+
if (!num) return "0";
|
|
165
|
+
const numStr = num.toString().replace(/[^\d]/g, "");
|
|
166
|
+
return numStr.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
167
|
+
};
|
|
168
|
+
var formatDate = (date) => {
|
|
169
|
+
return date ? moment(date).format("YYYY.MM.DD") : "";
|
|
170
|
+
};
|
|
171
|
+
var formatDateTime = (date) => {
|
|
172
|
+
return date ? moment(date).format("YYYY-MM-DD HH:mm:ss") : "";
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// src/components/ui/BorderRadiusBox/BorderRadiusBox.tsx
|
|
176
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
177
|
+
function BorderRadiusBox({
|
|
178
|
+
active = false,
|
|
179
|
+
paddingX = 22,
|
|
180
|
+
paddingY = 20,
|
|
181
|
+
radius = 12,
|
|
182
|
+
children,
|
|
183
|
+
onClick,
|
|
184
|
+
className,
|
|
185
|
+
fullWidth = false,
|
|
186
|
+
bgColor = "white",
|
|
187
|
+
borderColor = "line"
|
|
188
|
+
}) {
|
|
189
|
+
return /* @__PURE__ */ jsx2(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
className: `border ${fullWidth ? "w-full" : ""} ${active ? "border-primary bg-primary10" : `border-${borderColor} bg-${bgColor}`} ${onClick ? "cursor-pointer" : ""} ${className}`,
|
|
193
|
+
style: {
|
|
194
|
+
paddingLeft: toRemFunction2(paddingX),
|
|
195
|
+
paddingRight: toRemFunction2(paddingX),
|
|
196
|
+
paddingTop: toRemFunction2(paddingY),
|
|
197
|
+
paddingBottom: toRemFunction2(paddingY),
|
|
198
|
+
borderRadius: toRemFunction2(radius)
|
|
199
|
+
},
|
|
200
|
+
onClick,
|
|
201
|
+
children
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
var BorderRadiusBox_default = BorderRadiusBox;
|
|
206
|
+
|
|
207
|
+
// src/components/ui/Tooltip/Tooltip.tsx
|
|
208
|
+
import { useEffect, useState } from "react";
|
|
209
|
+
|
|
210
|
+
// src/assets/colorIcon/ColorIcTagClose.tsx
|
|
211
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
212
|
+
function ColorIcTagClose({
|
|
213
|
+
width = 10,
|
|
214
|
+
height = 10,
|
|
215
|
+
color = "text"
|
|
216
|
+
}) {
|
|
217
|
+
return /* @__PURE__ */ jsxs(
|
|
218
|
+
"svg",
|
|
219
|
+
{
|
|
220
|
+
width,
|
|
221
|
+
height,
|
|
222
|
+
viewBox: "0 0 10 10",
|
|
223
|
+
fill: "none",
|
|
224
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
225
|
+
style: { color: `var(--color-${color})` },
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsx3("g", { clipPath: "url(#clip0_848_3903)", children: /* @__PURE__ */ jsx3(
|
|
228
|
+
"path",
|
|
229
|
+
{
|
|
230
|
+
d: "M5.5 5L9.3125 1.1875C9.45312 1.04688 9.45312 0.828125 9.3125 0.6875C9.17188 0.546875 8.95312 0.546875 8.8125 0.6875L5 4.5L1.1875 0.6875C1.04687 0.546875 0.828125 0.546875 0.6875 0.6875C0.546875 0.828125 0.546875 1.04688 0.6875 1.1875L4.5 5L0.6875 8.8125C0.546875 8.95313 0.546875 9.17188 0.6875 9.3125C0.75 9.375 0.84375 9.42188 0.9375 9.42188C1.03125 9.42188 1.125 9.39063 1.1875 9.3125L5 5.5L8.8125 9.3125C8.875 9.375 8.96875 9.42188 9.0625 9.42188C9.15625 9.42188 9.25 9.39063 9.3125 9.3125C9.45312 9.17188 9.45312 8.95313 9.3125 8.8125L5.5 5Z",
|
|
231
|
+
fill: "currentColor"
|
|
232
|
+
}
|
|
233
|
+
) }),
|
|
234
|
+
/* @__PURE__ */ jsx3("defs", { children: /* @__PURE__ */ jsx3("clipPath", { id: "clip0_848_3903", children: /* @__PURE__ */ jsx3("rect", { width: "10", height: "10", fill: "white" }) }) })
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
var ColorIcTagClose_default = ColorIcTagClose;
|
|
240
|
+
|
|
241
|
+
// src/assets/colorIcon/ColorIcTooltip.tsx
|
|
242
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
243
|
+
function ColorIcTooltip({
|
|
244
|
+
width = 14,
|
|
245
|
+
height = 14,
|
|
246
|
+
color = "text"
|
|
247
|
+
}) {
|
|
248
|
+
return /* @__PURE__ */ jsxs2(
|
|
249
|
+
"svg",
|
|
250
|
+
{
|
|
251
|
+
width,
|
|
252
|
+
height,
|
|
253
|
+
viewBox: "0 0 14 14",
|
|
254
|
+
fill: "none",
|
|
255
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
256
|
+
style: { color: `var(--color-${color})` },
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsx4(
|
|
259
|
+
"path",
|
|
260
|
+
{
|
|
261
|
+
d: "M6.97882 4.26364H6.95761C6.70306 4.26364 6.46973 4.47576 6.46973 4.75152C6.46973 5.02728 6.68185 5.2394 6.95761 5.2394H6.97882C7.23336 5.2394 7.4667 5.02728 7.4667 4.75152C7.4667 4.47576 7.25458 4.26364 6.97882 4.26364Z",
|
|
262
|
+
fill: "currentColor"
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
/* @__PURE__ */ jsx4(
|
|
266
|
+
"path",
|
|
267
|
+
{
|
|
268
|
+
d: "M6.97872 5.93941C6.72418 5.93941 6.49084 6.15153 6.49084 6.42729V9.69395C6.49084 9.9485 6.70297 10.1818 6.97872 10.1818C7.23327 10.1818 7.4666 9.96971 7.4666 9.69395V6.40607C7.4666 6.15153 7.25448 5.93941 6.97872 5.93941Z",
|
|
269
|
+
fill: "currentColor"
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ jsx4(
|
|
273
|
+
"path",
|
|
274
|
+
{
|
|
275
|
+
d: "M6.97866 0.593945C3.43624 0.593945 0.551392 3.45758 0.551392 7.00001C0.551392 10.5424 3.43624 13.4273 6.97866 13.4273C10.5211 13.4273 13.3847 10.5424 13.3847 7.00001C13.3847 3.45758 10.5211 0.593945 6.97866 0.593945ZM6.97866 12.4727C3.96654 12.4727 1.50594 10.0121 1.50594 7.00001C1.50594 3.98788 3.96654 1.52728 6.97866 1.52728C9.99079 1.52728 12.4302 3.98788 12.4302 7.00001C12.4302 10.0121 9.99079 12.4727 6.97866 12.4727Z",
|
|
276
|
+
fill: "currentColor"
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
var ColorIcTooltip_default = ColorIcTooltip;
|
|
284
|
+
|
|
285
|
+
// src/components/ui/Tooltip/Tooltip.tsx
|
|
286
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
287
|
+
function Tooltip({ tooltipInfo, position = "right" }) {
|
|
288
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
289
|
+
useEffect(() => {
|
|
290
|
+
if (isOpen) {
|
|
291
|
+
}
|
|
292
|
+
}, [isOpen]);
|
|
293
|
+
const positionStyle = {
|
|
294
|
+
left: position === "right" ? "17px" : "50%",
|
|
295
|
+
top: position === "right" ? "50%" : "17px",
|
|
296
|
+
transform: position === "right" ? "translate(0, -50%)" : "translate(-62%, 0)"
|
|
297
|
+
};
|
|
298
|
+
return /* @__PURE__ */ jsxs3("div", { className: "tooltip relative ml-2", children: [
|
|
299
|
+
/* @__PURE__ */ jsx5(
|
|
300
|
+
"div",
|
|
301
|
+
{
|
|
302
|
+
className: "relative",
|
|
303
|
+
onClick: (e) => {
|
|
304
|
+
e.stopPropagation();
|
|
305
|
+
setIsOpen(!isOpen);
|
|
306
|
+
},
|
|
307
|
+
children: /* @__PURE__ */ jsx5(ColorIcTooltip_default, { width: 14, height: 14 })
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
isOpen && /* @__PURE__ */ jsxs3(
|
|
311
|
+
"div",
|
|
312
|
+
{
|
|
313
|
+
className: `absolute z-10 rounded-md`,
|
|
314
|
+
style: {
|
|
315
|
+
...positionStyle
|
|
316
|
+
},
|
|
317
|
+
children: [
|
|
318
|
+
tooltipInfo,
|
|
319
|
+
/* @__PURE__ */ jsx5("span", { className: "absolute top-10 right-10 cursor-pointer", onClick: (e) => {
|
|
320
|
+
e.stopPropagation();
|
|
321
|
+
setIsOpen(false);
|
|
322
|
+
}, children: /* @__PURE__ */ jsx5(ColorIcTagClose_default, { width: 10, height: 10, color: "text" }) })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
] });
|
|
327
|
+
}
|
|
328
|
+
var Tooltip_default = Tooltip;
|
|
329
|
+
|
|
330
|
+
// src/components/ui/BulletText/BulletText.tsx
|
|
331
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
332
|
+
var BulletText = ({
|
|
333
|
+
label,
|
|
334
|
+
bulletColor = "secondaryText",
|
|
335
|
+
tooltip,
|
|
336
|
+
textColor = "text",
|
|
337
|
+
textSize = "body14",
|
|
338
|
+
fontWeight: fontWeight2 = "bold"
|
|
339
|
+
}) => {
|
|
340
|
+
return /* @__PURE__ */ jsxs4("div", { className: `flex flex-none relative label-mobile`, children: [
|
|
341
|
+
/* @__PURE__ */ jsx6(
|
|
342
|
+
"span",
|
|
343
|
+
{
|
|
344
|
+
className: `inline-block w-3 h-3 bg-${bulletColor} mr-4 ${textSize === "body12" ? "mt-7" : "mt-9"}`
|
|
345
|
+
}
|
|
346
|
+
),
|
|
347
|
+
/* @__PURE__ */ jsx6(Text, { size: textSize, color: textColor, fontWeight: fontWeight2, children: label }),
|
|
348
|
+
tooltip && /* @__PURE__ */ jsx6(Tooltip_default, { tooltipInfo: tooltip })
|
|
349
|
+
] });
|
|
350
|
+
};
|
|
351
|
+
var BulletText_default = BulletText;
|
|
352
|
+
|
|
353
|
+
// src/components/ui/Button/Button.tsx
|
|
354
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
355
|
+
var Button = ({
|
|
356
|
+
children,
|
|
357
|
+
variant = "primary",
|
|
358
|
+
size = "large",
|
|
359
|
+
fontWeight: fontWeight2 = "bold",
|
|
360
|
+
isLoading = false,
|
|
361
|
+
disabled,
|
|
362
|
+
className = "",
|
|
363
|
+
alignSelf = "center",
|
|
364
|
+
justifySelf = "center",
|
|
365
|
+
cornerStyle = "square",
|
|
366
|
+
icon,
|
|
367
|
+
iconPosition = "right",
|
|
368
|
+
type = "button",
|
|
369
|
+
customWidth,
|
|
370
|
+
wFull = false,
|
|
371
|
+
...props
|
|
372
|
+
}) => {
|
|
373
|
+
const getVariantStyles = () => {
|
|
374
|
+
switch (variant) {
|
|
375
|
+
case "primary":
|
|
376
|
+
return `bg-primary text-white border border-primary hover:bg-blue-600 ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
377
|
+
case "secondary":
|
|
378
|
+
return `bg-primary10 border border-primary10 text-primary ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
379
|
+
case "danger":
|
|
380
|
+
return `bg-warningLight border border-warningLight text-warning hover:bg-warningLight ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
381
|
+
case "lower":
|
|
382
|
+
return `bg-gray2 text-dark5 border border-gray2 hover:bg-gray3 ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
383
|
+
case "neutral":
|
|
384
|
+
return `bg-white border border-primary text-primary ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
385
|
+
case "neutralGray":
|
|
386
|
+
return `bg-white border border-line text-text ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
387
|
+
case "blue":
|
|
388
|
+
return `bg-blueLight text-blue border border-blueLight ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
389
|
+
case "orange":
|
|
390
|
+
return `bg-orangeLight text-orange border border-orangeLight ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
391
|
+
case "green":
|
|
392
|
+
return `bg-greenLight text-green border border-greenLight ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const getSizeStyles = () => {
|
|
396
|
+
switch (size) {
|
|
397
|
+
case "small":
|
|
398
|
+
return "px-10 py-1 text-sm";
|
|
399
|
+
case "medium":
|
|
400
|
+
return `px-16 pt-7 pb-8 text-body14 font-${fontWeight2}`;
|
|
401
|
+
case "large":
|
|
402
|
+
return `px-28 py-13 text-body16 font-${fontWeight2} min-w-[140px]`;
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
const baseStyles = "flex items-center justify-center transition-colors whitespace-nowrap cursor-pointer focus:outline-none";
|
|
406
|
+
const disabledStyles = `bg-gray1 text-dark7 cursor-not-allowed border border-gray1 ${cornerStyle === "round" ? "rounded-full" : "rounded-md"}`;
|
|
407
|
+
const buttonStyles = `
|
|
408
|
+
${baseStyles}
|
|
409
|
+
${getSizeStyles()}
|
|
410
|
+
${disabled || isLoading ? disabledStyles : getVariantStyles()}
|
|
411
|
+
${alignSelfs[alignSelf]}
|
|
412
|
+
${justifySelfs[justifySelf]}
|
|
413
|
+
`;
|
|
414
|
+
return /* @__PURE__ */ jsxs5(
|
|
415
|
+
"button",
|
|
416
|
+
{
|
|
417
|
+
className: `${buttonStyles} ${className}`,
|
|
418
|
+
disabled: disabled || isLoading,
|
|
419
|
+
type,
|
|
420
|
+
style: {
|
|
421
|
+
width: wFull ? "100%" : customWidth ? `${customWidth}px` : ""
|
|
422
|
+
},
|
|
423
|
+
...props,
|
|
424
|
+
children: [
|
|
425
|
+
icon && iconPosition === "left" && (typeof icon === "string" ? /* @__PURE__ */ jsx7("img", { src: icon, alt: "icon", className: "w-16 h-16 mr-4" }) : /* @__PURE__ */ jsx7("div", { className: "mr-4", children: icon })),
|
|
426
|
+
isLoading ? /* @__PURE__ */ jsxs5("span", { className: "flex items-center justify-center", children: [
|
|
427
|
+
/* @__PURE__ */ jsxs5(
|
|
428
|
+
"svg",
|
|
429
|
+
{
|
|
430
|
+
className: "animate-spin -ml-1 mr-2 h-14 w-14 text-current",
|
|
431
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
432
|
+
fill: "none",
|
|
433
|
+
viewBox: "0 0 24 24",
|
|
434
|
+
children: [
|
|
435
|
+
/* @__PURE__ */ jsx7(
|
|
436
|
+
"circle",
|
|
437
|
+
{
|
|
438
|
+
className: "opacity-25",
|
|
439
|
+
cx: "12",
|
|
440
|
+
cy: "12",
|
|
441
|
+
r: "10",
|
|
442
|
+
stroke: "currentColor",
|
|
443
|
+
strokeWidth: "4"
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
/* @__PURE__ */ jsx7(
|
|
447
|
+
"path",
|
|
448
|
+
{
|
|
449
|
+
className: "opacity-75",
|
|
450
|
+
fill: "currentColor",
|
|
451
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
"\uCC98\uB9AC \uC911..."
|
|
458
|
+
] }) : children,
|
|
459
|
+
icon && iconPosition === "right" && (typeof icon === "string" ? /* @__PURE__ */ jsx7("img", { src: icon, alt: "icon", className: "w-16 h-16 ml-3" }) : /* @__PURE__ */ jsx7("div", { className: "mr-4", children: icon }))
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
};
|
|
464
|
+
var Button_default = Button;
|
|
465
|
+
|
|
466
|
+
// src/components/ui/Checkbox/Checkbox.tsx
|
|
467
|
+
import { forwardRef, useState as useState2, useEffect as useEffect2 } from "react";
|
|
468
|
+
|
|
469
|
+
// src/assets/colorIcon/ColorIcCheckDim.tsx
|
|
470
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
471
|
+
function ColorIcCheckDim({
|
|
472
|
+
width = 21,
|
|
473
|
+
height = 20,
|
|
474
|
+
fillColor = "gray3",
|
|
475
|
+
strokeColor = "stroke",
|
|
476
|
+
iconColor = "white"
|
|
477
|
+
}) {
|
|
478
|
+
return /* @__PURE__ */ jsxs6(
|
|
479
|
+
"svg",
|
|
480
|
+
{
|
|
481
|
+
width,
|
|
482
|
+
height,
|
|
483
|
+
viewBox: "0 0 21 20",
|
|
484
|
+
fill: "none",
|
|
485
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsx8(
|
|
488
|
+
"rect",
|
|
489
|
+
{
|
|
490
|
+
x: "1",
|
|
491
|
+
y: "0.5",
|
|
492
|
+
width: "19",
|
|
493
|
+
height: "19",
|
|
494
|
+
rx: "3.5",
|
|
495
|
+
fill: `var(--color-${fillColor})`
|
|
496
|
+
}
|
|
497
|
+
),
|
|
498
|
+
/* @__PURE__ */ jsx8(
|
|
499
|
+
"rect",
|
|
500
|
+
{
|
|
501
|
+
x: "1",
|
|
502
|
+
y: "0.5",
|
|
503
|
+
width: "19",
|
|
504
|
+
height: "19",
|
|
505
|
+
rx: "3.5",
|
|
506
|
+
stroke: `var(--color-${strokeColor})`
|
|
507
|
+
}
|
|
508
|
+
),
|
|
509
|
+
/* @__PURE__ */ jsx8(
|
|
510
|
+
"path",
|
|
511
|
+
{
|
|
512
|
+
d: "M13.9658 5.92676C14.1349 5.75801 14.4042 5.75793 14.5732 5.92676C14.7212 6.07465 14.74 6.29972 14.6289 6.4668L14.5732 6.53418L11.1133 10.001L14.5596 13.4688C14.7286 13.6376 14.7293 13.9071 14.5605 14.0762C14.4836 14.153 14.367 14.2002 14.2627 14.2002C14.1584 14.2002 14.0427 14.153 13.9658 14.0762H13.9648L10.5059 10.6084L7.03418 14.0762C6.95726 14.153 6.84163 14.2002 6.7373 14.2002C6.63295 14.2002 6.5164 14.153 6.43945 14.0762C6.27071 13.9072 6.27047 13.6376 6.43945 13.4688L9.89746 10.002L6.42676 6.54785V6.54688C6.25778 6.37786 6.25763 6.10837 6.42676 5.93945C6.59574 5.77069 6.8651 5.77085 7.03418 5.93945L10.5059 9.39453L13.9648 5.92676H13.9658Z",
|
|
513
|
+
fill: `var(--color-${iconColor})`,
|
|
514
|
+
stroke: `var(--color-${iconColor})`,
|
|
515
|
+
strokeWidth: "0.4"
|
|
516
|
+
}
|
|
517
|
+
)
|
|
518
|
+
]
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
var ColorIcCheckDim_default = ColorIcCheckDim;
|
|
523
|
+
|
|
524
|
+
// src/components/ui/Checkbox/Checkbox.tsx
|
|
525
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
526
|
+
var Checkbox = forwardRef(
|
|
527
|
+
({
|
|
528
|
+
label,
|
|
529
|
+
error,
|
|
530
|
+
className = "",
|
|
531
|
+
id,
|
|
532
|
+
type = "filled",
|
|
533
|
+
checked,
|
|
534
|
+
checkboxWidth,
|
|
535
|
+
disabled = false,
|
|
536
|
+
...props
|
|
537
|
+
}, ref) => {
|
|
538
|
+
const checkboxId = id || `checkbox-${Math.random().toString(36).substring(2, 9)}`;
|
|
539
|
+
const [isChecked, setIsChecked] = useState2(checked || false);
|
|
540
|
+
useEffect2(() => {
|
|
541
|
+
setIsChecked(checked || false);
|
|
542
|
+
}, [checked]);
|
|
543
|
+
const handleInputChange = (e) => {
|
|
544
|
+
setIsChecked(e.target.checked);
|
|
545
|
+
if (props.onChange) {
|
|
546
|
+
props.onChange(e);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
const handleCheckboxClick = (e) => {
|
|
550
|
+
e.preventDefault();
|
|
551
|
+
e.stopPropagation();
|
|
552
|
+
if (disabled) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
const newChecked = !isChecked;
|
|
556
|
+
setIsChecked(newChecked);
|
|
557
|
+
const event = {
|
|
558
|
+
target: {
|
|
559
|
+
checked: newChecked,
|
|
560
|
+
value: props.value || "",
|
|
561
|
+
name: props.name || "",
|
|
562
|
+
type: "checkbox"
|
|
563
|
+
},
|
|
564
|
+
currentTarget: {
|
|
565
|
+
checked: newChecked,
|
|
566
|
+
value: props.value || "",
|
|
567
|
+
name: props.name || "",
|
|
568
|
+
type: "checkbox"
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
if (props.onChange) {
|
|
572
|
+
props.onChange(event);
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
const handleLabelClick = (e) => {
|
|
576
|
+
e.preventDefault();
|
|
577
|
+
e.stopPropagation();
|
|
578
|
+
if (disabled) {
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
const newChecked = !isChecked;
|
|
582
|
+
setIsChecked(newChecked);
|
|
583
|
+
const event = {
|
|
584
|
+
target: {
|
|
585
|
+
checked: newChecked,
|
|
586
|
+
value: props.value || "",
|
|
587
|
+
name: props.name || "",
|
|
588
|
+
type: "checkbox"
|
|
589
|
+
},
|
|
590
|
+
currentTarget: {
|
|
591
|
+
checked: newChecked,
|
|
592
|
+
value: props.value || "",
|
|
593
|
+
name: props.name || "",
|
|
594
|
+
type: "checkbox"
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
if (props.onChange) {
|
|
598
|
+
props.onChange(event);
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
const getTypeNoneCheckedClass = () => {
|
|
602
|
+
if (type === "filled") {
|
|
603
|
+
return "border border-line rounded";
|
|
604
|
+
}
|
|
605
|
+
if (type === "outline") {
|
|
606
|
+
return "bg-white";
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
const getTypeCheckedClass = () => {
|
|
610
|
+
if (type === "filled") {
|
|
611
|
+
if (isChecked) {
|
|
612
|
+
return "bg-primary border-primary";
|
|
613
|
+
}
|
|
614
|
+
return "bg-white";
|
|
615
|
+
}
|
|
616
|
+
if (type === "outline") {
|
|
617
|
+
return "bg-white";
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
const getTypeCheckedIconClass = () => {
|
|
621
|
+
if (type === "filled") {
|
|
622
|
+
return "text-white";
|
|
623
|
+
}
|
|
624
|
+
if (type === "outline") {
|
|
625
|
+
if (isChecked) {
|
|
626
|
+
return "text-primary";
|
|
627
|
+
}
|
|
628
|
+
return "text-line";
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
return /* @__PURE__ */ jsx9(
|
|
632
|
+
"div",
|
|
633
|
+
{
|
|
634
|
+
className: `flex items-center py-1 px-1 ${checkboxWidth}`,
|
|
635
|
+
style: {
|
|
636
|
+
width: checkboxWidth ? `${toRemFunction2(checkboxWidth)}` : ""
|
|
637
|
+
},
|
|
638
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "relative flex items-center", children: [
|
|
639
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center h-5", children: [
|
|
640
|
+
/* @__PURE__ */ jsx9(
|
|
641
|
+
"input",
|
|
642
|
+
{
|
|
643
|
+
ref,
|
|
644
|
+
id: checkboxId,
|
|
645
|
+
type: "checkbox",
|
|
646
|
+
checked: isChecked,
|
|
647
|
+
onChange: handleInputChange,
|
|
648
|
+
disabled,
|
|
649
|
+
className: "sr-only",
|
|
650
|
+
...props
|
|
651
|
+
}
|
|
652
|
+
),
|
|
653
|
+
disabled ? /* @__PURE__ */ jsx9(ColorIcCheckDim_default, { width: 18, height: 18 }) : /* @__PURE__ */ jsx9(
|
|
654
|
+
"div",
|
|
655
|
+
{
|
|
656
|
+
className: `
|
|
657
|
+
h-18 w-18
|
|
658
|
+
${getTypeNoneCheckedClass()}
|
|
659
|
+
transition-all duration-200
|
|
660
|
+
flex items-center justify-center
|
|
661
|
+
${getTypeCheckedClass()}
|
|
662
|
+
${error ? "border-red" : ""}
|
|
663
|
+
${className}
|
|
664
|
+
`,
|
|
665
|
+
onClick: handleCheckboxClick,
|
|
666
|
+
children: /* @__PURE__ */ jsx9("span", { className: `${getTypeCheckedIconClass()} flex items-center justify-center`, children: /* @__PURE__ */ jsx9(
|
|
667
|
+
"svg",
|
|
668
|
+
{
|
|
669
|
+
width: "18",
|
|
670
|
+
height: "18",
|
|
671
|
+
viewBox: "0 0 20 20",
|
|
672
|
+
fill: "none",
|
|
673
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
674
|
+
children: /* @__PURE__ */ jsx9(
|
|
675
|
+
"path",
|
|
676
|
+
{
|
|
677
|
+
d: "M15.292 5.93848C15.5167 5.687 15.8864 5.68757 16.1104 5.94043L16.1172 5.94727L16.123 5.95508C16.2977 6.1856 16.3012 6.54196 16.0713 6.77832L16.0723 6.7793L9.55078 13.9229L9.55176 13.9238C9.36406 14.1357 9.1186 14.25 8.84668 14.25C8.59606 14.25 8.33167 14.1383 8.1416 13.9238V13.9229L4.90918 10.373L4.90625 10.3701C4.69767 10.1343 4.69773 9.77005 4.90625 9.53418C5.12992 9.2815 5.49974 9.28064 5.72461 9.53125L8.86426 12.9795L15.292 5.9375V5.93848Z",
|
|
678
|
+
fill: "currentColor",
|
|
679
|
+
stroke: "currentColor",
|
|
680
|
+
strokeWidth: "0.5"
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
}
|
|
684
|
+
) })
|
|
685
|
+
}
|
|
686
|
+
)
|
|
687
|
+
] }),
|
|
688
|
+
label && /* @__PURE__ */ jsx9("div", { className: `text-sm ${type === "outline" ? "ml-4" : "ml-8"}`, children: /* @__PURE__ */ jsx9(
|
|
689
|
+
"label",
|
|
690
|
+
{
|
|
691
|
+
htmlFor: checkboxId,
|
|
692
|
+
onClick: handleLabelClick,
|
|
693
|
+
className: ` text-body14 ${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"} select-none ${type === "outline" ? "text-primaryText " : "text-primaryText"}`,
|
|
694
|
+
children: label
|
|
695
|
+
}
|
|
696
|
+
) })
|
|
697
|
+
] })
|
|
698
|
+
}
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
);
|
|
702
|
+
Checkbox.displayName = "Checkbox";
|
|
703
|
+
var Checkbox_default = Checkbox;
|
|
704
|
+
|
|
705
|
+
// src/components/ui/Divider/Divider.tsx
|
|
706
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
707
|
+
function Divider({
|
|
708
|
+
className = "",
|
|
709
|
+
orientation = "horizontal",
|
|
710
|
+
variant = "solid",
|
|
711
|
+
width
|
|
712
|
+
}) {
|
|
713
|
+
const baseClasses = orientation === "horizontal" ? "w-full border-t" : "h-full border-l";
|
|
714
|
+
const variantClasses = {
|
|
715
|
+
solid: "border-solid",
|
|
716
|
+
dashed: "border-dashed",
|
|
717
|
+
dotted: "border-dotted"
|
|
718
|
+
};
|
|
719
|
+
return /* @__PURE__ */ jsx10(
|
|
720
|
+
"div",
|
|
721
|
+
{
|
|
722
|
+
className: `${baseClasses} ${variantClasses[variant]} border-line ${className}`,
|
|
723
|
+
style: { width: width ? toRemFunction2(width) : "100%" },
|
|
724
|
+
role: "separator"
|
|
725
|
+
}
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
var Divider_default = Divider;
|
|
729
|
+
|
|
730
|
+
// src/components/ui/EmailInput/EmailInput.tsx
|
|
731
|
+
import { useState as useState4, useEffect as useEffect4 } from "react";
|
|
732
|
+
|
|
733
|
+
// src/components/ui/Stack/Stack.tsx
|
|
734
|
+
import clsx from "clsx";
|
|
735
|
+
import { Children, isValidElement, forwardRef as forwardRef2 } from "react";
|
|
736
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
737
|
+
var Stack = forwardRef2(
|
|
738
|
+
({
|
|
739
|
+
direction = "col",
|
|
740
|
+
justify,
|
|
741
|
+
align,
|
|
742
|
+
even = false,
|
|
743
|
+
className = "",
|
|
744
|
+
children,
|
|
745
|
+
gap,
|
|
746
|
+
rowGap = 0,
|
|
747
|
+
columnGap = 0,
|
|
748
|
+
wFull = false,
|
|
749
|
+
hFull = false,
|
|
750
|
+
onClick,
|
|
751
|
+
childSizes,
|
|
752
|
+
flexWrap = false
|
|
753
|
+
}, ref) => {
|
|
754
|
+
const classes = clsx(
|
|
755
|
+
"flex",
|
|
756
|
+
flexWrap && "flex-wrap",
|
|
757
|
+
directions[direction],
|
|
758
|
+
justify && justifies[justify],
|
|
759
|
+
align && aligns[align],
|
|
760
|
+
{
|
|
761
|
+
even,
|
|
762
|
+
"w-full": wFull,
|
|
763
|
+
"h-full": hFull
|
|
764
|
+
},
|
|
765
|
+
className
|
|
766
|
+
);
|
|
767
|
+
const renderChildren = () => {
|
|
768
|
+
if (!childSizes) return children;
|
|
769
|
+
const childrenArray = Children.toArray(children);
|
|
770
|
+
const result = [];
|
|
771
|
+
const maxLength = Math.max(childSizes.length, childrenArray.length);
|
|
772
|
+
for (let index = 0; index < maxLength; index++) {
|
|
773
|
+
const size = childSizes[index];
|
|
774
|
+
const child = childrenArray[index];
|
|
775
|
+
if (!child) {
|
|
776
|
+
if (size !== void 0 && size !== null && size !== -1) {
|
|
777
|
+
let sizeValue;
|
|
778
|
+
if (typeof size === "string") {
|
|
779
|
+
if (/^\d+$/.test(size)) {
|
|
780
|
+
sizeValue = `${size}px`;
|
|
781
|
+
} else {
|
|
782
|
+
sizeValue = size;
|
|
783
|
+
}
|
|
784
|
+
} else if (typeof size === "number" && size > 0) {
|
|
785
|
+
sizeValue = `${size}px`;
|
|
786
|
+
} else {
|
|
787
|
+
continue;
|
|
788
|
+
}
|
|
789
|
+
const sizeStyle2 = {
|
|
790
|
+
flexBasis: sizeValue,
|
|
791
|
+
flexShrink: 0,
|
|
792
|
+
flexGrow: 0
|
|
793
|
+
};
|
|
794
|
+
result.push(/* @__PURE__ */ jsx11("div", { style: sizeStyle2 }, `spacer-${index}`));
|
|
795
|
+
}
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
if (!isValidElement(child)) {
|
|
799
|
+
result.push(child);
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
let sizeStyle;
|
|
803
|
+
if (size === -1 || size === void 0 || size === null) {
|
|
804
|
+
sizeStyle = {
|
|
805
|
+
flex: 1
|
|
806
|
+
};
|
|
807
|
+
} else {
|
|
808
|
+
let sizeValue;
|
|
809
|
+
if (typeof size === "string") {
|
|
810
|
+
if (/^\d+$/.test(size)) {
|
|
811
|
+
sizeValue = `${size}px`;
|
|
812
|
+
} else {
|
|
813
|
+
sizeValue = size;
|
|
814
|
+
}
|
|
815
|
+
} else {
|
|
816
|
+
sizeValue = `${size}px`;
|
|
817
|
+
}
|
|
818
|
+
sizeStyle = {
|
|
819
|
+
flexBasis: sizeValue,
|
|
820
|
+
flexShrink: 0,
|
|
821
|
+
flexGrow: 0
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
result.push(
|
|
825
|
+
/* @__PURE__ */ jsx11("div", { style: sizeStyle, children: child }, index)
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
return result;
|
|
829
|
+
};
|
|
830
|
+
const gapStyle = gap ? { gap: toRemFunction2(gap) } : { rowGap: toRemFunction2(rowGap), columnGap: toRemFunction2(columnGap) };
|
|
831
|
+
return /* @__PURE__ */ jsx11(
|
|
832
|
+
"div",
|
|
833
|
+
{
|
|
834
|
+
ref,
|
|
835
|
+
className: classes,
|
|
836
|
+
style: gapStyle ? gapStyle : void 0,
|
|
837
|
+
onClick,
|
|
838
|
+
children: renderChildren()
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
Stack.displayName = "Stack";
|
|
844
|
+
var Stack_default = Stack;
|
|
845
|
+
|
|
846
|
+
// src/components/ui/RequiredDot/RequiredDot.tsx
|
|
847
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
848
|
+
function RequiredDot() {
|
|
849
|
+
return /* @__PURE__ */ jsx12("span", { className: "inline-block w-6 h-6 bg-red rounded-full bg-warning ml-4" });
|
|
850
|
+
}
|
|
851
|
+
var RequiredDot_default = RequiredDot;
|
|
852
|
+
|
|
853
|
+
// src/components/ui/Label/Label.tsx
|
|
854
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
855
|
+
var Label = ({
|
|
856
|
+
isDot = true,
|
|
857
|
+
label,
|
|
858
|
+
required = false,
|
|
859
|
+
inputId,
|
|
860
|
+
width,
|
|
861
|
+
tooltip,
|
|
862
|
+
labelHidden = false,
|
|
863
|
+
subText,
|
|
864
|
+
fontWeight: fontWeight2 = "bold",
|
|
865
|
+
align
|
|
866
|
+
}) => {
|
|
867
|
+
if (!label || labelHidden) return null;
|
|
868
|
+
return /* @__PURE__ */ jsxs8(
|
|
869
|
+
"label",
|
|
870
|
+
{
|
|
871
|
+
htmlFor: inputId ? inputId : "",
|
|
872
|
+
className: `leading-none flex items-center flex-none relative label-mobile ${align === "end" ? "justify-end" : ""}`,
|
|
873
|
+
style: { width: width ? toRemFunction2(width) : "auto" },
|
|
874
|
+
children: [
|
|
875
|
+
/* @__PURE__ */ jsx13(Text, { size: "body14", color: "primaryText", fontWeight: fontWeight2, children: label }),
|
|
876
|
+
subText,
|
|
877
|
+
tooltip && /* @__PURE__ */ jsx13(Tooltip_default, { tooltipInfo: tooltip }),
|
|
878
|
+
required && /* @__PURE__ */ jsx13(RequiredDot_default, {})
|
|
879
|
+
]
|
|
880
|
+
}
|
|
881
|
+
);
|
|
882
|
+
};
|
|
883
|
+
var Label_default = Label;
|
|
884
|
+
|
|
885
|
+
// src/components/ui/Input/Input.tsx
|
|
886
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
887
|
+
var Input = ({
|
|
888
|
+
isDot = true,
|
|
889
|
+
label,
|
|
890
|
+
type = "text",
|
|
891
|
+
error,
|
|
892
|
+
fullWidth = false,
|
|
893
|
+
id,
|
|
894
|
+
className = "",
|
|
895
|
+
originRef,
|
|
896
|
+
direction = "row",
|
|
897
|
+
textAlign = "left",
|
|
898
|
+
value,
|
|
899
|
+
description,
|
|
900
|
+
onChange,
|
|
901
|
+
customWidth,
|
|
902
|
+
tooltip,
|
|
903
|
+
labelWidth,
|
|
904
|
+
disabled,
|
|
905
|
+
onlyData = false,
|
|
906
|
+
labelHidden,
|
|
907
|
+
rightIcon,
|
|
908
|
+
onRightIconClick,
|
|
909
|
+
...props
|
|
910
|
+
}) => {
|
|
911
|
+
const inputId = id || `input-${Math.random().toString(36).substring(2, 9)}`;
|
|
912
|
+
const displayValue = type === "number" && value ? formatNumberWithComma(value) : value;
|
|
913
|
+
const handleChange = (e) => {
|
|
914
|
+
if (type === "number") {
|
|
915
|
+
const rawValue = e.target.value.replace(/[^\d]/g, "");
|
|
916
|
+
if (onChange) {
|
|
917
|
+
const newEvent = {
|
|
918
|
+
...e,
|
|
919
|
+
target: {
|
|
920
|
+
...e.target,
|
|
921
|
+
value: rawValue
|
|
922
|
+
// 숫자값만 전달
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
onChange(newEvent);
|
|
926
|
+
}
|
|
927
|
+
} else if (onChange) {
|
|
928
|
+
onChange(e);
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
return /* @__PURE__ */ jsxs9(
|
|
932
|
+
Stack_default,
|
|
933
|
+
{
|
|
934
|
+
direction,
|
|
935
|
+
wFull: fullWidth,
|
|
936
|
+
gap: direction === "row" ? 14 : 4,
|
|
937
|
+
align: direction === "row" ? "center" : "start",
|
|
938
|
+
children: [
|
|
939
|
+
/* @__PURE__ */ jsx14(
|
|
940
|
+
Label_default,
|
|
941
|
+
{
|
|
942
|
+
label,
|
|
943
|
+
isDot,
|
|
944
|
+
width: labelWidth,
|
|
945
|
+
required: props.required,
|
|
946
|
+
inputId,
|
|
947
|
+
tooltip,
|
|
948
|
+
labelHidden
|
|
949
|
+
}
|
|
950
|
+
),
|
|
951
|
+
/* @__PURE__ */ jsxs9(
|
|
952
|
+
Stack_default,
|
|
953
|
+
{
|
|
954
|
+
gap: 5,
|
|
955
|
+
className: `${fullWidth ? "flex-auto" : ""} relative`,
|
|
956
|
+
wFull: direction === "row" ? false : fullWidth,
|
|
957
|
+
children: [
|
|
958
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative w-full", children: [
|
|
959
|
+
/* @__PURE__ */ jsx14(
|
|
960
|
+
"input",
|
|
961
|
+
{
|
|
962
|
+
id: inputId,
|
|
963
|
+
ref: originRef,
|
|
964
|
+
type: type === "number" ? "text" : type,
|
|
965
|
+
value: displayValue,
|
|
966
|
+
onChange: handleChange,
|
|
967
|
+
autoComplete: props.autoComplete || "off",
|
|
968
|
+
className: `
|
|
969
|
+
px-12 h-36 border rounded-md leading-[36px]
|
|
970
|
+
${error ? "border-red" : "border-line"}
|
|
971
|
+
focus:border-primary
|
|
972
|
+
${fullWidth && "w-full"}
|
|
973
|
+
${className}
|
|
974
|
+
${type === "number" ? "no-spinner" : ""}
|
|
975
|
+
${disabled ? "bg-gray1 border-line" : ""}
|
|
976
|
+
${onlyData && "bg-white"}
|
|
977
|
+
${rightIcon ? "pr-40" : ""}
|
|
978
|
+
`,
|
|
979
|
+
style: {
|
|
980
|
+
textAlign,
|
|
981
|
+
// autofill 배경색 제거를 위한 강력한 스타일
|
|
982
|
+
// WebkitBoxShadow: "0 0 0 1000px white inset",
|
|
983
|
+
WebkitTextFillColor: "inherit",
|
|
984
|
+
// transition: "background-color 5000s ease-in-out 0s",
|
|
985
|
+
width: customWidth ? `${toRemFunction2(customWidth)}` : "100%"
|
|
986
|
+
// backgroundColor: disabled ? "var(--gray)" : "white",
|
|
987
|
+
},
|
|
988
|
+
disabled: disabled || onlyData,
|
|
989
|
+
...props,
|
|
990
|
+
"aria-required": props.required
|
|
991
|
+
}
|
|
992
|
+
),
|
|
993
|
+
rightIcon && /* @__PURE__ */ jsx14(
|
|
994
|
+
"div",
|
|
995
|
+
{
|
|
996
|
+
className: `absolute inset-y-0 right-0 flex items-center pr-12 ${onRightIconClick ? "cursor-pointer" : "pointer-events-none"}`,
|
|
997
|
+
onClick: onRightIconClick,
|
|
998
|
+
children: /* @__PURE__ */ jsx14("img", { src: rightIcon, alt: "icon", width: 16, height: 16 })
|
|
999
|
+
}
|
|
1000
|
+
)
|
|
1001
|
+
] }),
|
|
1002
|
+
description && /* @__PURE__ */ jsx14(Text, { size: "body12", color: "gray", children: description })
|
|
1003
|
+
]
|
|
1004
|
+
}
|
|
1005
|
+
)
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
);
|
|
1009
|
+
};
|
|
1010
|
+
var Input_default = Input;
|
|
1011
|
+
|
|
1012
|
+
// src/components/ui/SelectBox/SelectBox.tsx
|
|
1013
|
+
import { forwardRef as forwardRef3, useState as useState3, useRef, useEffect as useEffect3 } from "react";
|
|
1014
|
+
|
|
1015
|
+
// src/assets/colorIcon/ColorIcArrow.tsx
|
|
1016
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1017
|
+
function ColorIcArrow({
|
|
1018
|
+
isOpen = false,
|
|
1019
|
+
rotate = 0,
|
|
1020
|
+
width = 14,
|
|
1021
|
+
height = 14,
|
|
1022
|
+
color = "primary"
|
|
1023
|
+
}) {
|
|
1024
|
+
const rotateAngle = isOpen ? 90 : 0;
|
|
1025
|
+
const finalRotate = rotate + rotateAngle;
|
|
1026
|
+
return /* @__PURE__ */ jsx15(
|
|
1027
|
+
"span",
|
|
1028
|
+
{
|
|
1029
|
+
className: "cursor-pointer",
|
|
1030
|
+
style: {
|
|
1031
|
+
color: `var(--color-${color})`,
|
|
1032
|
+
transform: `rotate(${finalRotate}deg)`,
|
|
1033
|
+
transition: "transform 200ms",
|
|
1034
|
+
display: "inline-flex",
|
|
1035
|
+
alignItems: "center",
|
|
1036
|
+
justifyContent: "center"
|
|
1037
|
+
},
|
|
1038
|
+
children: /* @__PURE__ */ jsx15(
|
|
1039
|
+
"svg",
|
|
1040
|
+
{
|
|
1041
|
+
width,
|
|
1042
|
+
height,
|
|
1043
|
+
viewBox: "0 0 14 14",
|
|
1044
|
+
fill: "none",
|
|
1045
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1046
|
+
children: /* @__PURE__ */ jsx15(
|
|
1047
|
+
"path",
|
|
1048
|
+
{
|
|
1049
|
+
d: "M4.38402 1.8246C4.46631 1.74231 4.58724 1.74171 4.67015 1.82264V1.82362L9.61351 6.85487L9.61546 6.85585C9.69844 6.93882 9.69844 7.06096 9.61546 7.14393L9.61351 7.14589L4.6721 12.1752C4.62893 12.2184 4.56875 12.2424 4.52855 12.2426C4.47778 12.2426 4.43387 12.2297 4.37425 12.1849C4.30224 12.1026 4.30507 11.9888 4.38402 11.9096L4.38695 11.9066L8.9807 7.2035L9.17992 6.9994L8.97972 6.7953L4.38597 2.11464L4.38402 2.11268L4.35765 2.07948C4.30316 1.99948 4.3114 1.89721 4.38402 1.8246Z",
|
|
1050
|
+
fill: "currentColor",
|
|
1051
|
+
stroke: "currentColor",
|
|
1052
|
+
strokeWidth: "0.583333"
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
}
|
|
1056
|
+
)
|
|
1057
|
+
}
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
var ColorIcArrow_default = ColorIcArrow;
|
|
1061
|
+
|
|
1062
|
+
// src/components/ui/SelectBox/SelectBox.tsx
|
|
1063
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1064
|
+
var SelectBox = forwardRef3(
|
|
1065
|
+
({
|
|
1066
|
+
isDot = true,
|
|
1067
|
+
label,
|
|
1068
|
+
error,
|
|
1069
|
+
fullWidth = false,
|
|
1070
|
+
options,
|
|
1071
|
+
id,
|
|
1072
|
+
direction = "row",
|
|
1073
|
+
className = "",
|
|
1074
|
+
placeholder = "\uC120\uD0DD\uD558\uC138\uC694",
|
|
1075
|
+
value,
|
|
1076
|
+
onChange,
|
|
1077
|
+
onFocus,
|
|
1078
|
+
onBlur,
|
|
1079
|
+
onEmptyClick,
|
|
1080
|
+
disabled = false,
|
|
1081
|
+
required = false,
|
|
1082
|
+
customWidth,
|
|
1083
|
+
labelHidden,
|
|
1084
|
+
emptyMessage = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
1085
|
+
labelWidth,
|
|
1086
|
+
tooltip
|
|
1087
|
+
}, ref) => {
|
|
1088
|
+
const [isOpen, setIsOpen] = useState3(false);
|
|
1089
|
+
const [dropdownPosition, setDropdownPosition] = useState3(
|
|
1090
|
+
"bottom"
|
|
1091
|
+
);
|
|
1092
|
+
const dropdownRef = useRef(null);
|
|
1093
|
+
const selectButtonRef = useRef(null);
|
|
1094
|
+
const selectId = id || `select-${Math.random().toString(36).substring(2, 9)}`;
|
|
1095
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
1096
|
+
const calculateMinWidth = () => {
|
|
1097
|
+
if (!options.length) return "auto";
|
|
1098
|
+
const maxLength = Math.max(
|
|
1099
|
+
...options.map((option) => option.label.length),
|
|
1100
|
+
placeholder.length
|
|
1101
|
+
);
|
|
1102
|
+
const calculatedWidth = Math.min(Math.max(maxLength * 8 + 80, 120), 400);
|
|
1103
|
+
return `${calculatedWidth}px`;
|
|
1104
|
+
};
|
|
1105
|
+
const minWidth = calculateMinWidth();
|
|
1106
|
+
const calculateDropdownPosition = () => {
|
|
1107
|
+
if (!selectButtonRef.current) return "bottom";
|
|
1108
|
+
const selectRect = selectButtonRef.current.getBoundingClientRect();
|
|
1109
|
+
const viewportHeight = window.innerHeight;
|
|
1110
|
+
const dropdownHeight = Math.min(240, options.length * 40 + 20);
|
|
1111
|
+
const spaceBelow = viewportHeight - selectRect.bottom;
|
|
1112
|
+
const spaceAbove = selectRect.top;
|
|
1113
|
+
if (spaceBelow >= dropdownHeight) {
|
|
1114
|
+
return "bottom";
|
|
1115
|
+
} else if (spaceAbove >= dropdownHeight) {
|
|
1116
|
+
return "top";
|
|
1117
|
+
} else {
|
|
1118
|
+
return spaceBelow > spaceAbove ? "bottom" : "top";
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
useEffect3(() => {
|
|
1122
|
+
if (isOpen) {
|
|
1123
|
+
const position = calculateDropdownPosition();
|
|
1124
|
+
setDropdownPosition(position);
|
|
1125
|
+
}
|
|
1126
|
+
}, [isOpen, options.length]);
|
|
1127
|
+
useEffect3(() => {
|
|
1128
|
+
const handleClickOutside = (event) => {
|
|
1129
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1130
|
+
setIsOpen(false);
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1134
|
+
return () => {
|
|
1135
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1136
|
+
};
|
|
1137
|
+
}, []);
|
|
1138
|
+
const handleSelect = (optionValue) => {
|
|
1139
|
+
setIsOpen(false);
|
|
1140
|
+
onChange?.(optionValue);
|
|
1141
|
+
};
|
|
1142
|
+
const handleButtonClick = () => {
|
|
1143
|
+
if (disabled) return;
|
|
1144
|
+
if (!options || options.length === 0) {
|
|
1145
|
+
onEmptyClick?.();
|
|
1146
|
+
} else {
|
|
1147
|
+
setIsOpen(!isOpen);
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
const handleKeyDown = (event) => {
|
|
1151
|
+
if (disabled) return;
|
|
1152
|
+
switch (event.key) {
|
|
1153
|
+
case "Enter":
|
|
1154
|
+
case " ":
|
|
1155
|
+
event.preventDefault();
|
|
1156
|
+
handleButtonClick();
|
|
1157
|
+
break;
|
|
1158
|
+
case "Escape":
|
|
1159
|
+
setIsOpen(false);
|
|
1160
|
+
break;
|
|
1161
|
+
}
|
|
1162
|
+
};
|
|
1163
|
+
return /* @__PURE__ */ jsxs10(
|
|
1164
|
+
Stack_default,
|
|
1165
|
+
{
|
|
1166
|
+
ref,
|
|
1167
|
+
direction,
|
|
1168
|
+
wFull: fullWidth,
|
|
1169
|
+
gap: direction === "row" ? 14 : 4,
|
|
1170
|
+
align: direction === "row" ? "center" : "start",
|
|
1171
|
+
children: [
|
|
1172
|
+
/* @__PURE__ */ jsx16(
|
|
1173
|
+
Label_default,
|
|
1174
|
+
{
|
|
1175
|
+
isDot,
|
|
1176
|
+
label,
|
|
1177
|
+
required,
|
|
1178
|
+
inputId: selectId,
|
|
1179
|
+
labelHidden,
|
|
1180
|
+
width: labelWidth,
|
|
1181
|
+
tooltip
|
|
1182
|
+
}
|
|
1183
|
+
),
|
|
1184
|
+
/* @__PURE__ */ jsx16(
|
|
1185
|
+
Stack_default,
|
|
1186
|
+
{
|
|
1187
|
+
gap: 10,
|
|
1188
|
+
className: "flex-auto relative",
|
|
1189
|
+
wFull: direction === "row" ? false : fullWidth,
|
|
1190
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1191
|
+
"div",
|
|
1192
|
+
{
|
|
1193
|
+
ref: dropdownRef,
|
|
1194
|
+
className: `relative ${fullWidth ? "w-full" : ""}`,
|
|
1195
|
+
style: !fullWidth ? {
|
|
1196
|
+
minWidth,
|
|
1197
|
+
width: customWidth ? `${toRemFunction2(customWidth)}` : "100%"
|
|
1198
|
+
} : {},
|
|
1199
|
+
children: [
|
|
1200
|
+
/* @__PURE__ */ jsx16(
|
|
1201
|
+
"div",
|
|
1202
|
+
{
|
|
1203
|
+
ref: selectButtonRef,
|
|
1204
|
+
id: selectId,
|
|
1205
|
+
className: `
|
|
1206
|
+
relative w-full px-12 h-36 text-left border rounded-md cursor-pointer
|
|
1207
|
+
content-center leading-none
|
|
1208
|
+
${error ? "border-red" : "border-line"}
|
|
1209
|
+
${disabled ? "text-dark5 cursor-not-allowed bg-gray1 border-line" : "focus:border-primary bg-white"}
|
|
1210
|
+
${className}
|
|
1211
|
+
`,
|
|
1212
|
+
onClick: handleButtonClick,
|
|
1213
|
+
onKeyDown: handleKeyDown,
|
|
1214
|
+
onFocus,
|
|
1215
|
+
onBlur,
|
|
1216
|
+
tabIndex: disabled ? -1 : 0,
|
|
1217
|
+
role: "combobox",
|
|
1218
|
+
"aria-haspopup": "listbox",
|
|
1219
|
+
"aria-expanded": isOpen,
|
|
1220
|
+
"aria-labelledby": label ? `${selectId}-label` : void 0,
|
|
1221
|
+
"aria-required": required,
|
|
1222
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between h-full", children: [
|
|
1223
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-2 h-full", children: [
|
|
1224
|
+
selectedOption?.icon && /* @__PURE__ */ jsx16("span", { className: "flex-shrink-0", children: selectedOption.icon }),
|
|
1225
|
+
/* @__PURE__ */ jsx16(
|
|
1226
|
+
"span",
|
|
1227
|
+
{
|
|
1228
|
+
className: `block truncate leading-36 ${!value && selectedOption?.label !== "\uC804\uCCB4" ? "text-secondaryText" : "text-primaryText"}`,
|
|
1229
|
+
children: selectedOption?.label || placeholder
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
] }),
|
|
1233
|
+
/* @__PURE__ */ jsx16(
|
|
1234
|
+
ColorIcArrow_default,
|
|
1235
|
+
{
|
|
1236
|
+
isOpen,
|
|
1237
|
+
rotate: isOpen ? 270 : 90,
|
|
1238
|
+
color: "text"
|
|
1239
|
+
}
|
|
1240
|
+
)
|
|
1241
|
+
] })
|
|
1242
|
+
}
|
|
1243
|
+
),
|
|
1244
|
+
isOpen && /* @__PURE__ */ jsx16(
|
|
1245
|
+
"div",
|
|
1246
|
+
{
|
|
1247
|
+
className: `absolute z-50 w-full bg-white border border-line rounded-md shadow-sm max-h-200 overflow-auto
|
|
1248
|
+
${dropdownPosition === "bottom" ? "mt-2" : "mb-2 bottom-full"}
|
|
1249
|
+
`,
|
|
1250
|
+
children: /* @__PURE__ */ jsx16("ul", { className: "py-4", role: "listbox", children: options.map((option, index) => {
|
|
1251
|
+
if (option.divider) {
|
|
1252
|
+
return /* @__PURE__ */ jsx16(Divider_default, { className: "my-10" }, index);
|
|
1253
|
+
}
|
|
1254
|
+
return /* @__PURE__ */ jsx16(
|
|
1255
|
+
"li",
|
|
1256
|
+
{
|
|
1257
|
+
className: `
|
|
1258
|
+
relative cursor-pointer select-none py-7 px-16
|
|
1259
|
+
${option.disabled ? "text-text cursor-not-allowed bg-gray-50" : "text-text hover:bg-primary hover:text-white"}
|
|
1260
|
+
${value === option.value ? "bg-primary10 text-primary" : ""}
|
|
1261
|
+
`,
|
|
1262
|
+
onClick: () => !option.disabled && handleSelect(option.value),
|
|
1263
|
+
role: "option",
|
|
1264
|
+
"aria-selected": value === option.value,
|
|
1265
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-2", children: [
|
|
1266
|
+
option.icon && /* @__PURE__ */ jsx16("span", { className: "flex-shrink-0", children: option.icon }),
|
|
1267
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex-1", children: [
|
|
1268
|
+
/* @__PURE__ */ jsx16("div", { className: "font-medium", children: option.label }),
|
|
1269
|
+
option.description && /* @__PURE__ */ jsx16("div", { className: "text-sm text-gray", children: option.description })
|
|
1270
|
+
] })
|
|
1271
|
+
] })
|
|
1272
|
+
},
|
|
1273
|
+
option.value
|
|
1274
|
+
);
|
|
1275
|
+
}) })
|
|
1276
|
+
}
|
|
1277
|
+
)
|
|
1278
|
+
]
|
|
1279
|
+
}
|
|
1280
|
+
)
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
);
|
|
1286
|
+
}
|
|
1287
|
+
);
|
|
1288
|
+
SelectBox.displayName = "SelectBox";
|
|
1289
|
+
var SelectBox_default = SelectBox;
|
|
1290
|
+
|
|
1291
|
+
// src/components/ui/EmailInput/EmailInput.tsx
|
|
1292
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1293
|
+
var EmailInput = ({
|
|
1294
|
+
value,
|
|
1295
|
+
onChange,
|
|
1296
|
+
error,
|
|
1297
|
+
label = "\uC774\uBA54\uC77C",
|
|
1298
|
+
placeholder = "\uC774\uBA54\uC77C \uC8FC\uC18C",
|
|
1299
|
+
required = false,
|
|
1300
|
+
direction = "row",
|
|
1301
|
+
fullWidth = false,
|
|
1302
|
+
onBlur,
|
|
1303
|
+
triggerValidation,
|
|
1304
|
+
labelHidden = false,
|
|
1305
|
+
className,
|
|
1306
|
+
customWidth
|
|
1307
|
+
}) => {
|
|
1308
|
+
const [localPart, setLocalPart] = useState4("");
|
|
1309
|
+
const [domain, setDomain] = useState4("");
|
|
1310
|
+
const [selectedDomain, setSelectedDomain] = useState4("");
|
|
1311
|
+
const [isCustomDomain, setIsCustomDomain] = useState4(false);
|
|
1312
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
1313
|
+
const domainOptions = [
|
|
1314
|
+
{ value: "", label: "\uC120\uD0DD" },
|
|
1315
|
+
{ value: "gmail.com", label: "gmail.com" },
|
|
1316
|
+
{ value: "naver.com", label: "naver.com" },
|
|
1317
|
+
{ value: "daum.net", label: "daum.net" },
|
|
1318
|
+
{ value: "custom", label: "\uC9C1\uC811 \uC785\uB825" }
|
|
1319
|
+
];
|
|
1320
|
+
useEffect4(() => {
|
|
1321
|
+
if (value) {
|
|
1322
|
+
const parts = value.split("@");
|
|
1323
|
+
if (parts.length === 2) {
|
|
1324
|
+
setLocalPart(parts[0]);
|
|
1325
|
+
setDomain(parts[1]);
|
|
1326
|
+
const domainOption = domainOptions.find(
|
|
1327
|
+
(option) => option.value === parts[1] && option.value !== "custom"
|
|
1328
|
+
);
|
|
1329
|
+
if (domainOption) {
|
|
1330
|
+
setSelectedDomain(parts[1]);
|
|
1331
|
+
setIsCustomDomain(false);
|
|
1332
|
+
} else {
|
|
1333
|
+
setSelectedDomain("custom");
|
|
1334
|
+
setIsCustomDomain(true);
|
|
1335
|
+
}
|
|
1336
|
+
} else {
|
|
1337
|
+
setLocalPart(value);
|
|
1338
|
+
setSelectedDomain("");
|
|
1339
|
+
setDomain("");
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}, [value]);
|
|
1343
|
+
const handleValueChange = (newValue) => {
|
|
1344
|
+
onChange(newValue);
|
|
1345
|
+
if (triggerValidation) {
|
|
1346
|
+
triggerValidation();
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
const handleLocalPartChange = (e) => {
|
|
1350
|
+
const newLocalPart = e.target.value;
|
|
1351
|
+
setLocalPart(newLocalPart);
|
|
1352
|
+
updateEmail(newLocalPart, domain);
|
|
1353
|
+
};
|
|
1354
|
+
const handleDomainSelect = (selectedValue) => {
|
|
1355
|
+
setSelectedDomain(selectedValue);
|
|
1356
|
+
if (selectedValue === "custom") {
|
|
1357
|
+
setIsCustomDomain(true);
|
|
1358
|
+
updateEmail(localPart, domain);
|
|
1359
|
+
} else {
|
|
1360
|
+
setIsCustomDomain(false);
|
|
1361
|
+
setDomain(selectedValue);
|
|
1362
|
+
updateEmail(localPart, selectedValue || "");
|
|
1363
|
+
}
|
|
1364
|
+
};
|
|
1365
|
+
const handleCustomDomainChange = (e) => {
|
|
1366
|
+
const newDomain = e.target.value;
|
|
1367
|
+
const cleanDomain = newDomain.replace(/@/g, "");
|
|
1368
|
+
setDomain(cleanDomain);
|
|
1369
|
+
updateEmail(localPart, cleanDomain);
|
|
1370
|
+
};
|
|
1371
|
+
const updateEmail = (local, dmn) => {
|
|
1372
|
+
if (local && dmn) {
|
|
1373
|
+
handleValueChange(`${local}@${dmn}`);
|
|
1374
|
+
} else if (local) {
|
|
1375
|
+
handleValueChange(local);
|
|
1376
|
+
} else {
|
|
1377
|
+
handleValueChange("");
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
const handleFocus = () => {
|
|
1381
|
+
setIsFocused(true);
|
|
1382
|
+
};
|
|
1383
|
+
const handleBlur = () => {
|
|
1384
|
+
setIsFocused(false);
|
|
1385
|
+
if (onBlur) {
|
|
1386
|
+
onBlur();
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
return /* @__PURE__ */ jsx17("div", { className: `${fullWidth ? "w-full" : ""}`, "aria-required": required, children: /* @__PURE__ */ jsxs11(
|
|
1390
|
+
Stack_default,
|
|
1391
|
+
{
|
|
1392
|
+
direction,
|
|
1393
|
+
wFull: fullWidth,
|
|
1394
|
+
gap: direction === "row" ? 14 : 4,
|
|
1395
|
+
align: direction === "row" ? "center" : "start",
|
|
1396
|
+
className,
|
|
1397
|
+
children: [
|
|
1398
|
+
!labelHidden && /* @__PURE__ */ jsx17(Label_default, { label, required }),
|
|
1399
|
+
/* @__PURE__ */ jsx17(
|
|
1400
|
+
Stack_default,
|
|
1401
|
+
{
|
|
1402
|
+
gap: 10,
|
|
1403
|
+
className: "flex-auto relative",
|
|
1404
|
+
wFull: direction === "row" ? false : fullWidth,
|
|
1405
|
+
children: /* @__PURE__ */ jsxs11(
|
|
1406
|
+
"div",
|
|
1407
|
+
{
|
|
1408
|
+
className: `flex items-center border rounded-md ${error ? "border-red" : isFocused ? "border-primary" : "border-line"}`,
|
|
1409
|
+
style: !fullWidth ? {
|
|
1410
|
+
width: customWidth ? `${toRemFunction2(customWidth)}` : "100%"
|
|
1411
|
+
} : {},
|
|
1412
|
+
children: [
|
|
1413
|
+
/* @__PURE__ */ jsx17(
|
|
1414
|
+
Input_default,
|
|
1415
|
+
{
|
|
1416
|
+
value: localPart,
|
|
1417
|
+
onChange: handleLocalPartChange,
|
|
1418
|
+
onFocus: handleFocus,
|
|
1419
|
+
onBlur: handleBlur,
|
|
1420
|
+
placeholder,
|
|
1421
|
+
className: `border-0 border-r rounded-r-none ${isFocused && "border-primary"}`,
|
|
1422
|
+
error: "",
|
|
1423
|
+
fullWidth: true
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
/* @__PURE__ */ jsx17("span", { className: `px-10 flex items-center`, children: "@" }),
|
|
1427
|
+
isCustomDomain && /* @__PURE__ */ jsx17(
|
|
1428
|
+
Input_default,
|
|
1429
|
+
{
|
|
1430
|
+
value: domain,
|
|
1431
|
+
onChange: handleCustomDomainChange,
|
|
1432
|
+
onFocus: handleFocus,
|
|
1433
|
+
onBlur: handleBlur,
|
|
1434
|
+
placeholder: "\uB3C4\uBA54\uC778 \uC785\uB825",
|
|
1435
|
+
className: `border-0 border-l rounded-l-none ${isFocused && "border-primary"}`,
|
|
1436
|
+
error: "",
|
|
1437
|
+
fullWidth: true
|
|
1438
|
+
}
|
|
1439
|
+
),
|
|
1440
|
+
/* @__PURE__ */ jsx17(
|
|
1441
|
+
SelectBox_default,
|
|
1442
|
+
{
|
|
1443
|
+
value: selectedDomain,
|
|
1444
|
+
onChange: handleDomainSelect,
|
|
1445
|
+
onFocus: handleFocus,
|
|
1446
|
+
onBlur: handleBlur,
|
|
1447
|
+
options: domainOptions,
|
|
1448
|
+
className: `border-0 border-l rounded-l-none ${isFocused && "border-primary"}`,
|
|
1449
|
+
fullWidth: true
|
|
1450
|
+
}
|
|
1451
|
+
)
|
|
1452
|
+
]
|
|
1453
|
+
}
|
|
1454
|
+
)
|
|
1455
|
+
}
|
|
1456
|
+
)
|
|
1457
|
+
]
|
|
1458
|
+
}
|
|
1459
|
+
) });
|
|
1460
|
+
};
|
|
1461
|
+
var EmailInput_default = EmailInput;
|
|
1462
|
+
|
|
1463
|
+
// src/components/ui/MultiSelectCheckbox/MultiSelectCheckbox.tsx
|
|
1464
|
+
import { forwardRef as forwardRef4, useState as useState5, useRef as useRef2, useEffect as useEffect5 } from "react";
|
|
1465
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1466
|
+
var MultiSelectCheckbox = forwardRef4(
|
|
1467
|
+
({
|
|
1468
|
+
isDot = true,
|
|
1469
|
+
label,
|
|
1470
|
+
error,
|
|
1471
|
+
fullWidth = false,
|
|
1472
|
+
options,
|
|
1473
|
+
id,
|
|
1474
|
+
direction = "row",
|
|
1475
|
+
className = "",
|
|
1476
|
+
placeholder = "\uC120\uD0DD\uD558\uC138\uC694",
|
|
1477
|
+
value = [],
|
|
1478
|
+
onChange,
|
|
1479
|
+
onConfirm,
|
|
1480
|
+
onFocus,
|
|
1481
|
+
onBlur,
|
|
1482
|
+
onEmptyClick,
|
|
1483
|
+
disabled = false,
|
|
1484
|
+
required = false,
|
|
1485
|
+
customWidth,
|
|
1486
|
+
labelHidden,
|
|
1487
|
+
emptyMessage = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
1488
|
+
labelWidth,
|
|
1489
|
+
tooltip,
|
|
1490
|
+
confirmButtonText = "\uC120\uD0DD \uC644\uB8CC"
|
|
1491
|
+
}, ref) => {
|
|
1492
|
+
const toSafeArray = (val) => {
|
|
1493
|
+
if (Array.isArray(val)) return val;
|
|
1494
|
+
if (typeof val === "string" && val.length > 0) {
|
|
1495
|
+
return val.split(",").map((v) => v.trim()).filter((v) => v !== "");
|
|
1496
|
+
}
|
|
1497
|
+
return [];
|
|
1498
|
+
};
|
|
1499
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
1500
|
+
const [tempSelectedValues, setTempSelectedValues] = useState5(toSafeArray(value));
|
|
1501
|
+
const [originalValues, setOriginalValues] = useState5(
|
|
1502
|
+
toSafeArray(value)
|
|
1503
|
+
);
|
|
1504
|
+
const [dropdownPosition, setDropdownPosition] = useState5(
|
|
1505
|
+
"bottom"
|
|
1506
|
+
);
|
|
1507
|
+
const dropdownRef = useRef2(null);
|
|
1508
|
+
const selectButtonRef = useRef2(null);
|
|
1509
|
+
const selectId = id || `multi-select-${Math.random().toString(36).substring(2, 9)}`;
|
|
1510
|
+
useEffect5(() => {
|
|
1511
|
+
const safeValue = toSafeArray(value);
|
|
1512
|
+
setTempSelectedValues(safeValue);
|
|
1513
|
+
setOriginalValues(safeValue);
|
|
1514
|
+
}, [value]);
|
|
1515
|
+
const getDisplayText = () => {
|
|
1516
|
+
if (!tempSelectedValues || tempSelectedValues.length === 0) {
|
|
1517
|
+
return placeholder;
|
|
1518
|
+
}
|
|
1519
|
+
if (tempSelectedValues.length === options.length) {
|
|
1520
|
+
return "\uC804\uCCB4";
|
|
1521
|
+
}
|
|
1522
|
+
if (tempSelectedValues.length === 1) {
|
|
1523
|
+
const selectedOption = options.find(
|
|
1524
|
+
(opt) => opt.value === tempSelectedValues[0]
|
|
1525
|
+
);
|
|
1526
|
+
return selectedOption?.label || placeholder;
|
|
1527
|
+
}
|
|
1528
|
+
return `${tempSelectedValues.length}\uAC1C \uC120\uD0DD\uB428`;
|
|
1529
|
+
};
|
|
1530
|
+
const calculateMinWidth = () => {
|
|
1531
|
+
if (!options.length) return "auto";
|
|
1532
|
+
const maxLength = Math.max(
|
|
1533
|
+
...options.map((option) => option.label.length),
|
|
1534
|
+
placeholder.length
|
|
1535
|
+
);
|
|
1536
|
+
const calculatedWidth = Math.min(Math.max(maxLength * 8 + 80, 120), 400);
|
|
1537
|
+
return `${calculatedWidth}px`;
|
|
1538
|
+
};
|
|
1539
|
+
const minWidth = calculateMinWidth();
|
|
1540
|
+
const calculateDropdownPosition = () => {
|
|
1541
|
+
if (!selectButtonRef.current) return "bottom";
|
|
1542
|
+
const selectRect = selectButtonRef.current.getBoundingClientRect();
|
|
1543
|
+
const viewportHeight = window.innerHeight;
|
|
1544
|
+
const dropdownHeight = Math.min(320, options.length * 40 + 100);
|
|
1545
|
+
const spaceBelow = viewportHeight - selectRect.bottom;
|
|
1546
|
+
const spaceAbove = selectRect.top;
|
|
1547
|
+
if (spaceBelow >= dropdownHeight) {
|
|
1548
|
+
return "bottom";
|
|
1549
|
+
} else if (spaceAbove >= dropdownHeight) {
|
|
1550
|
+
return "top";
|
|
1551
|
+
} else {
|
|
1552
|
+
return spaceBelow > spaceAbove ? "bottom" : "top";
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
useEffect5(() => {
|
|
1556
|
+
if (isOpen) {
|
|
1557
|
+
const position = calculateDropdownPosition();
|
|
1558
|
+
setDropdownPosition(position);
|
|
1559
|
+
}
|
|
1560
|
+
}, [isOpen, options.length]);
|
|
1561
|
+
useEffect5(() => {
|
|
1562
|
+
const handleClickOutside = (event) => {
|
|
1563
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1564
|
+
setTempSelectedValues(originalValues);
|
|
1565
|
+
onChange?.(originalValues);
|
|
1566
|
+
setIsOpen(false);
|
|
1567
|
+
}
|
|
1568
|
+
};
|
|
1569
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1570
|
+
return () => {
|
|
1571
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1572
|
+
};
|
|
1573
|
+
}, [originalValues, onChange]);
|
|
1574
|
+
const handleButtonClick = () => {
|
|
1575
|
+
if (disabled) return;
|
|
1576
|
+
if (!options || options.length === 0) {
|
|
1577
|
+
onEmptyClick?.();
|
|
1578
|
+
} else {
|
|
1579
|
+
if (!isOpen) {
|
|
1580
|
+
setOriginalValues(tempSelectedValues);
|
|
1581
|
+
}
|
|
1582
|
+
setIsOpen(!isOpen);
|
|
1583
|
+
}
|
|
1584
|
+
};
|
|
1585
|
+
const handleKeyDown = (event) => {
|
|
1586
|
+
if (disabled) return;
|
|
1587
|
+
switch (event.key) {
|
|
1588
|
+
case "Enter":
|
|
1589
|
+
case " ":
|
|
1590
|
+
event.preventDefault();
|
|
1591
|
+
handleButtonClick();
|
|
1592
|
+
break;
|
|
1593
|
+
case "Escape":
|
|
1594
|
+
setTempSelectedValues(originalValues);
|
|
1595
|
+
onChange?.(originalValues);
|
|
1596
|
+
setIsOpen(false);
|
|
1597
|
+
break;
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
const handleSelectAll = () => {
|
|
1601
|
+
const enabledOptions2 = options.filter((opt) => !opt.disabled);
|
|
1602
|
+
const allEnabledValues = enabledOptions2.map((opt) => opt.value);
|
|
1603
|
+
const allEnabledSelected = enabledOptions2.every(
|
|
1604
|
+
(opt) => tempSelectedValues.includes(opt.value)
|
|
1605
|
+
);
|
|
1606
|
+
if (allEnabledSelected) {
|
|
1607
|
+
setTempSelectedValues([]);
|
|
1608
|
+
onChange?.([]);
|
|
1609
|
+
} else {
|
|
1610
|
+
setTempSelectedValues(allEnabledValues);
|
|
1611
|
+
onChange?.(allEnabledValues);
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
const handleCheckboxChange = (optionValue) => {
|
|
1615
|
+
const newValues = tempSelectedValues.includes(optionValue) ? tempSelectedValues.filter((v) => v !== optionValue) : [...tempSelectedValues, optionValue];
|
|
1616
|
+
setTempSelectedValues(newValues);
|
|
1617
|
+
onChange?.(newValues);
|
|
1618
|
+
};
|
|
1619
|
+
const handleConfirm = () => {
|
|
1620
|
+
setOriginalValues(tempSelectedValues);
|
|
1621
|
+
setIsOpen(false);
|
|
1622
|
+
onConfirm?.(tempSelectedValues);
|
|
1623
|
+
};
|
|
1624
|
+
const enabledOptions = options.filter((opt) => !opt.disabled);
|
|
1625
|
+
const isAllSelected = enabledOptions.length > 0 && enabledOptions.every((opt) => tempSelectedValues.includes(opt.value));
|
|
1626
|
+
return /* @__PURE__ */ jsxs12(
|
|
1627
|
+
Stack_default,
|
|
1628
|
+
{
|
|
1629
|
+
ref,
|
|
1630
|
+
direction,
|
|
1631
|
+
wFull: fullWidth,
|
|
1632
|
+
gap: direction === "row" ? 14 : 4,
|
|
1633
|
+
align: direction === "row" ? "center" : "start",
|
|
1634
|
+
children: [
|
|
1635
|
+
/* @__PURE__ */ jsx18(
|
|
1636
|
+
Label_default,
|
|
1637
|
+
{
|
|
1638
|
+
isDot,
|
|
1639
|
+
label,
|
|
1640
|
+
required,
|
|
1641
|
+
inputId: selectId,
|
|
1642
|
+
labelHidden,
|
|
1643
|
+
width: labelWidth,
|
|
1644
|
+
tooltip
|
|
1645
|
+
}
|
|
1646
|
+
),
|
|
1647
|
+
/* @__PURE__ */ jsx18(
|
|
1648
|
+
Stack_default,
|
|
1649
|
+
{
|
|
1650
|
+
gap: 10,
|
|
1651
|
+
className: "flex-auto relative",
|
|
1652
|
+
wFull: direction === "row" ? false : fullWidth,
|
|
1653
|
+
children: /* @__PURE__ */ jsxs12(
|
|
1654
|
+
"div",
|
|
1655
|
+
{
|
|
1656
|
+
ref: dropdownRef,
|
|
1657
|
+
className: `relative ${fullWidth ? "w-full" : ""}`,
|
|
1658
|
+
style: !fullWidth ? {
|
|
1659
|
+
minWidth,
|
|
1660
|
+
width: customWidth ? `${toRemFunction2(customWidth)}` : "100%"
|
|
1661
|
+
} : {},
|
|
1662
|
+
children: [
|
|
1663
|
+
/* @__PURE__ */ jsx18(
|
|
1664
|
+
"div",
|
|
1665
|
+
{
|
|
1666
|
+
ref: selectButtonRef,
|
|
1667
|
+
id: selectId,
|
|
1668
|
+
className: `
|
|
1669
|
+
relative w-full px-12 h-36 text-left border rounded-md cursor-pointer
|
|
1670
|
+
content-center leading-none
|
|
1671
|
+
${error ? "border-red" : "border-line"}
|
|
1672
|
+
${disabled ? "text-dark5 cursor-not-allowed bg-gray1 border-line" : "focus:border-primary bg-white"}
|
|
1673
|
+
${className}
|
|
1674
|
+
`,
|
|
1675
|
+
onClick: handleButtonClick,
|
|
1676
|
+
onKeyDown: handleKeyDown,
|
|
1677
|
+
onFocus,
|
|
1678
|
+
onBlur,
|
|
1679
|
+
tabIndex: disabled ? -1 : 0,
|
|
1680
|
+
role: "combobox",
|
|
1681
|
+
"aria-haspopup": "listbox",
|
|
1682
|
+
"aria-expanded": isOpen,
|
|
1683
|
+
"aria-labelledby": label ? `${selectId}-label` : void 0,
|
|
1684
|
+
"aria-required": required,
|
|
1685
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between h-full", children: [
|
|
1686
|
+
/* @__PURE__ */ jsx18(
|
|
1687
|
+
"span",
|
|
1688
|
+
{
|
|
1689
|
+
className: `block truncate leading-36 ${tempSelectedValues.length === 0 ? "text-secondaryText" : "text-primaryText"}`,
|
|
1690
|
+
children: getDisplayText()
|
|
1691
|
+
}
|
|
1692
|
+
),
|
|
1693
|
+
/* @__PURE__ */ jsx18(
|
|
1694
|
+
ColorIcArrow_default,
|
|
1695
|
+
{
|
|
1696
|
+
isOpen,
|
|
1697
|
+
rotate: isOpen ? 270 : 90,
|
|
1698
|
+
color: "text"
|
|
1699
|
+
}
|
|
1700
|
+
)
|
|
1701
|
+
] })
|
|
1702
|
+
}
|
|
1703
|
+
),
|
|
1704
|
+
isOpen && /* @__PURE__ */ jsxs12(
|
|
1705
|
+
"div",
|
|
1706
|
+
{
|
|
1707
|
+
className: `absolute z-50 w-full bg-white border border-line rounded-md shadow-sm
|
|
1708
|
+
${dropdownPosition === "bottom" ? "mt-2" : "mb-2 bottom-full"}
|
|
1709
|
+
`,
|
|
1710
|
+
children: [
|
|
1711
|
+
/* @__PURE__ */ jsx18(
|
|
1712
|
+
"div",
|
|
1713
|
+
{
|
|
1714
|
+
className: " py-8 px-16 cursor-pointer hover:bg-gray1",
|
|
1715
|
+
onClick: (e) => {
|
|
1716
|
+
e.stopPropagation();
|
|
1717
|
+
handleSelectAll();
|
|
1718
|
+
},
|
|
1719
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-8 pointer-events-none", children: [
|
|
1720
|
+
/* @__PURE__ */ jsx18(Checkbox_default, { checked: isAllSelected, onChange: () => {
|
|
1721
|
+
} }),
|
|
1722
|
+
/* @__PURE__ */ jsx18(Text, { children: "\uC804\uCCB4" })
|
|
1723
|
+
] })
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
/* @__PURE__ */ jsx18("div", { className: "px-10", children: /* @__PURE__ */ jsx18(Divider_default, {}) }),
|
|
1727
|
+
/* @__PURE__ */ jsx18("div", { className: "max-h-200 overflow-auto py-4", children: /* @__PURE__ */ jsx18("ul", { role: "listbox", children: options.map((option) => {
|
|
1728
|
+
const isChecked = tempSelectedValues.includes(
|
|
1729
|
+
option.value
|
|
1730
|
+
);
|
|
1731
|
+
return /* @__PURE__ */ jsx18(
|
|
1732
|
+
"li",
|
|
1733
|
+
{
|
|
1734
|
+
className: `
|
|
1735
|
+
relative select-none py-7 px-16
|
|
1736
|
+
${option.disabled ? "text-text cursor-not-allowed bg-gray-50" : "text-text hover:bg-gray1 cursor-pointer"}
|
|
1737
|
+
`,
|
|
1738
|
+
onClick: (e) => {
|
|
1739
|
+
e.stopPropagation();
|
|
1740
|
+
if (!option.disabled) {
|
|
1741
|
+
handleCheckboxChange(option.value);
|
|
1742
|
+
}
|
|
1743
|
+
},
|
|
1744
|
+
role: "option",
|
|
1745
|
+
"aria-selected": isChecked,
|
|
1746
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-8 pointer-events-none", children: [
|
|
1747
|
+
/* @__PURE__ */ jsx18(
|
|
1748
|
+
Checkbox_default,
|
|
1749
|
+
{
|
|
1750
|
+
checked: isChecked,
|
|
1751
|
+
onChange: () => {
|
|
1752
|
+
},
|
|
1753
|
+
disabled: option.disabled
|
|
1754
|
+
}
|
|
1755
|
+
),
|
|
1756
|
+
option.color && /* @__PURE__ */ jsx18(
|
|
1757
|
+
"div",
|
|
1758
|
+
{
|
|
1759
|
+
className: `w-16 h-16 rounded-full flex-shrink-0 bg-${option.color}`
|
|
1760
|
+
}
|
|
1761
|
+
),
|
|
1762
|
+
/* @__PURE__ */ jsx18(Text, { children: option.label })
|
|
1763
|
+
] })
|
|
1764
|
+
},
|
|
1765
|
+
option.value
|
|
1766
|
+
);
|
|
1767
|
+
}) }) }),
|
|
1768
|
+
/* @__PURE__ */ jsx18("div", { className: "px-10", children: /* @__PURE__ */ jsx18(Divider_default, {}) }),
|
|
1769
|
+
/* @__PURE__ */ jsx18("div", { className: " p-9", children: /* @__PURE__ */ jsx18(Stack_default, { direction: "row", align: "end", justify: "end", wFull: true, children: /* @__PURE__ */ jsx18(
|
|
1770
|
+
Button_default,
|
|
1771
|
+
{
|
|
1772
|
+
variant: "lower",
|
|
1773
|
+
size: "medium",
|
|
1774
|
+
onClick: handleConfirm,
|
|
1775
|
+
children: confirmButtonText
|
|
1776
|
+
}
|
|
1777
|
+
) }) })
|
|
1778
|
+
]
|
|
1779
|
+
}
|
|
1780
|
+
)
|
|
1781
|
+
]
|
|
1782
|
+
}
|
|
1783
|
+
)
|
|
1784
|
+
}
|
|
1785
|
+
)
|
|
1786
|
+
]
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
}
|
|
1790
|
+
);
|
|
1791
|
+
MultiSelectCheckbox.displayName = "MultiSelectCheckbox";
|
|
1792
|
+
var MultiSelectCheckbox_default = MultiSelectCheckbox;
|
|
1793
|
+
|
|
1794
|
+
// src/assets/colorIcon/ColorIcFormArrow.tsx
|
|
1795
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1796
|
+
function ColorIcFormArrow({
|
|
1797
|
+
isOpen = false,
|
|
1798
|
+
rotate = 0,
|
|
1799
|
+
width = 16,
|
|
1800
|
+
height = 16,
|
|
1801
|
+
color = "secondaryText"
|
|
1802
|
+
}) {
|
|
1803
|
+
const rotateAngle = isOpen ? 180 : 0;
|
|
1804
|
+
const finalRotate = rotate + rotateAngle;
|
|
1805
|
+
return /* @__PURE__ */ jsx19(
|
|
1806
|
+
"span",
|
|
1807
|
+
{
|
|
1808
|
+
className: "cursor-pointer",
|
|
1809
|
+
style: {
|
|
1810
|
+
color: `var(--color-${color})`,
|
|
1811
|
+
transform: `rotate(${finalRotate}deg)`,
|
|
1812
|
+
transition: "transform 200ms",
|
|
1813
|
+
display: "inline-flex",
|
|
1814
|
+
alignItems: "center",
|
|
1815
|
+
justifyContent: "center"
|
|
1816
|
+
},
|
|
1817
|
+
children: /* @__PURE__ */ jsx19(
|
|
1818
|
+
"svg",
|
|
1819
|
+
{
|
|
1820
|
+
width,
|
|
1821
|
+
height,
|
|
1822
|
+
viewBox: "0 0 16 16",
|
|
1823
|
+
fill: "none",
|
|
1824
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1825
|
+
children: /* @__PURE__ */ jsx19(
|
|
1826
|
+
"path",
|
|
1827
|
+
{
|
|
1828
|
+
d: "M13.5854 4.9856C13.6683 4.90272 13.7851 4.89236 13.8765 4.95435L13.9146 4.9856C14.0086 5.07977 14.0094 5.21801 13.9165 5.31274L8.1665 10.9622L8.16455 10.9641C8.06824 11.0604 8.02264 11.0667 7.99951 11.0667C7.93967 11.0666 7.88852 11.0508 7.81689 10.9954L2.0835 5.36255C2.0024 5.2798 1.9927 5.16414 2.0542 5.07349L2.08545 5.0354C2.16829 4.95264 2.28515 4.94226 2.37646 5.00415L2.41455 5.0354L2.41748 5.03833L7.76709 10.2639L8.00146 10.4924L8.23389 10.262L13.5835 4.98755L13.5854 4.9856Z",
|
|
1829
|
+
fill: "currentColor",
|
|
1830
|
+
stroke: "currentColor",
|
|
1831
|
+
strokeWidth: "0.666667"
|
|
1832
|
+
}
|
|
1833
|
+
)
|
|
1834
|
+
}
|
|
1835
|
+
)
|
|
1836
|
+
}
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
var ColorIcFormArrow_default = ColorIcFormArrow;
|
|
1840
|
+
|
|
1841
|
+
// src/components/ui/Paging/Paging.tsx
|
|
1842
|
+
import { Fragment, jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1843
|
+
function getPagination(current, total) {
|
|
1844
|
+
const pages = [];
|
|
1845
|
+
if (total <= 7) {
|
|
1846
|
+
for (let i = 1; i <= total; i++) pages.push(i);
|
|
1847
|
+
return pages;
|
|
1848
|
+
}
|
|
1849
|
+
if (current <= 4) {
|
|
1850
|
+
pages.push(1, 2, 3, 4, 5, "...", total);
|
|
1851
|
+
} else if (current >= total - 3) {
|
|
1852
|
+
pages.push(1, "...", total - 4, total - 3, total - 2, total - 1, total);
|
|
1853
|
+
} else {
|
|
1854
|
+
pages.push(1, "...", current - 1, current, current + 1, "...", total);
|
|
1855
|
+
}
|
|
1856
|
+
return pages;
|
|
1857
|
+
}
|
|
1858
|
+
function Paging({
|
|
1859
|
+
page,
|
|
1860
|
+
total,
|
|
1861
|
+
limit,
|
|
1862
|
+
onPageChange
|
|
1863
|
+
}) {
|
|
1864
|
+
const totalPages = Math.ceil(total / limit);
|
|
1865
|
+
const pages = getPagination(page, totalPages);
|
|
1866
|
+
if (!total) return /* @__PURE__ */ jsx20(Fragment, {});
|
|
1867
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-center gap-2 mt-8", children: [
|
|
1868
|
+
/* @__PURE__ */ jsx20(
|
|
1869
|
+
"span",
|
|
1870
|
+
{
|
|
1871
|
+
onClick: () => {
|
|
1872
|
+
if (page === 1) return;
|
|
1873
|
+
onPageChange(page - 2);
|
|
1874
|
+
},
|
|
1875
|
+
className: `rounded flex p-6 ${page === 1 ? "opacity-0 " : "cursor-pointer "} hover:bg-gray2`,
|
|
1876
|
+
children: /* @__PURE__ */ jsx20(ColorIcFormArrow_default, { rotate: 90 })
|
|
1877
|
+
}
|
|
1878
|
+
),
|
|
1879
|
+
pages.map(
|
|
1880
|
+
(p, i) => typeof p === "number" ? /* @__PURE__ */ jsx20(
|
|
1881
|
+
"span",
|
|
1882
|
+
{
|
|
1883
|
+
onClick: () => onPageChange(p - 1),
|
|
1884
|
+
className: `inline-block rounded h-24 w-24 pt-5 text-center leading-none text-body16 ${page === p ? "bg-primary text-white cursor-not-allowed" : "text-text cursor-pointer"}`,
|
|
1885
|
+
children: p
|
|
1886
|
+
},
|
|
1887
|
+
p
|
|
1888
|
+
) : /* @__PURE__ */ jsx20(
|
|
1889
|
+
"span",
|
|
1890
|
+
{
|
|
1891
|
+
className: "px-10 inline-block text-gray-400 text-lg",
|
|
1892
|
+
children: "..."
|
|
1893
|
+
},
|
|
1894
|
+
`ellipsis-${i}`
|
|
1895
|
+
)
|
|
1896
|
+
),
|
|
1897
|
+
/* @__PURE__ */ jsx20(
|
|
1898
|
+
"span",
|
|
1899
|
+
{
|
|
1900
|
+
onClick: () => {
|
|
1901
|
+
if (page === totalPages) return;
|
|
1902
|
+
onPageChange(page);
|
|
1903
|
+
},
|
|
1904
|
+
className: `rounded flex p-6 ${page === totalPages ? "opacity-0 " : "cursor-pointer"} hover:bg-gray2`,
|
|
1905
|
+
children: /* @__PURE__ */ jsx20(ColorIcFormArrow_default, { rotate: 270 })
|
|
1906
|
+
}
|
|
1907
|
+
)
|
|
1908
|
+
] });
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
// src/components/ui/Radio/Radio.tsx
|
|
1912
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
1913
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1914
|
+
var Radio = forwardRef5(
|
|
1915
|
+
({ label, error, className = "", id, radioWidth, checked, ...props }, ref) => {
|
|
1916
|
+
const radioId = id || `radio-${Math.random().toString(36).substring(2, 9)}`;
|
|
1917
|
+
return /* @__PURE__ */ jsx21(
|
|
1918
|
+
"div",
|
|
1919
|
+
{
|
|
1920
|
+
className: "flex items-center h-36",
|
|
1921
|
+
style: {
|
|
1922
|
+
width: radioWidth ? `${toRemFunction2(radioWidth)}` : "auto"
|
|
1923
|
+
},
|
|
1924
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "relative flex items-center gap-10", children: [
|
|
1925
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center", children: [
|
|
1926
|
+
/* @__PURE__ */ jsx21(
|
|
1927
|
+
"input",
|
|
1928
|
+
{
|
|
1929
|
+
ref,
|
|
1930
|
+
id: radioId,
|
|
1931
|
+
type: "radio",
|
|
1932
|
+
className: "sr-only",
|
|
1933
|
+
checked,
|
|
1934
|
+
...props
|
|
1935
|
+
}
|
|
1936
|
+
),
|
|
1937
|
+
/* @__PURE__ */ jsx21(
|
|
1938
|
+
"label",
|
|
1939
|
+
{
|
|
1940
|
+
htmlFor: radioId,
|
|
1941
|
+
className: `
|
|
1942
|
+
relative flex items-center justify-center w-20 h-20 rounded-full cursor-pointer
|
|
1943
|
+
border transition-all duration-100
|
|
1944
|
+
${checked ? "bg-primary border-primary" : "bg-line border-line"}
|
|
1945
|
+
${error ? "border-red" : ""}
|
|
1946
|
+
${props.disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
1947
|
+
${className}
|
|
1948
|
+
`,
|
|
1949
|
+
children: /* @__PURE__ */ jsx21(
|
|
1950
|
+
"div",
|
|
1951
|
+
{
|
|
1952
|
+
className: ` bg-white rounded-full items-center ${checked ? "w-10 h-10 border-primary" : "w-18 h-18 border-line"}`
|
|
1953
|
+
}
|
|
1954
|
+
)
|
|
1955
|
+
}
|
|
1956
|
+
)
|
|
1957
|
+
] }),
|
|
1958
|
+
label && /* @__PURE__ */ jsx21("div", { className: "text-sm", children: /* @__PURE__ */ jsx21(
|
|
1959
|
+
"label",
|
|
1960
|
+
{
|
|
1961
|
+
htmlFor: radioId,
|
|
1962
|
+
className: "text-body14 text-primaryText cursor-pointer",
|
|
1963
|
+
children: label
|
|
1964
|
+
}
|
|
1965
|
+
) })
|
|
1966
|
+
] })
|
|
1967
|
+
}
|
|
1968
|
+
);
|
|
1969
|
+
}
|
|
1970
|
+
);
|
|
1971
|
+
Radio.displayName = "Radio";
|
|
1972
|
+
var Radio_default = Radio;
|
|
1973
|
+
|
|
1974
|
+
// src/components/ui/Table/Table.tsx
|
|
1975
|
+
import { useState as useState6, useEffect as useEffect6 } from "react";
|
|
1976
|
+
|
|
1977
|
+
// src/assets/common/ic-sort-arrow-up.svg
|
|
1978
|
+
var ic_sort_arrow_up_default = "./ic-sort-arrow-up-DJQRDWHQ.svg";
|
|
1979
|
+
|
|
1980
|
+
// src/assets/common/ic-sort-arrow-down.svg
|
|
1981
|
+
var ic_sort_arrow_down_default = "./ic-sort-arrow-down-H56K6AN4.svg";
|
|
1982
|
+
|
|
1983
|
+
// src/components/ui/Table/Table.tsx
|
|
1984
|
+
import React6 from "react";
|
|
1985
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1986
|
+
function Table({
|
|
1987
|
+
columns,
|
|
1988
|
+
datas = [],
|
|
1989
|
+
footers,
|
|
1990
|
+
isRadioOption = false,
|
|
1991
|
+
isCheckboxOption = false,
|
|
1992
|
+
isModify = false,
|
|
1993
|
+
overWidth,
|
|
1994
|
+
emptyMessage = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
1995
|
+
disabledCheckboxCondition,
|
|
1996
|
+
onButtonClick,
|
|
1997
|
+
onLinkClick,
|
|
1998
|
+
onChangeInput,
|
|
1999
|
+
onChangeCheckbox,
|
|
2000
|
+
onChangeToggle,
|
|
2001
|
+
onCheckboxOption,
|
|
2002
|
+
onRadioOption,
|
|
2003
|
+
onMoveUp,
|
|
2004
|
+
onMoveDown,
|
|
2005
|
+
onSort
|
|
2006
|
+
}) {
|
|
2007
|
+
const headersKeys = columns.map((col) => col.key);
|
|
2008
|
+
const linkKeys = columns.filter((col) => col.type === "link").map((col) => col.key);
|
|
2009
|
+
const dateKeys = columns.filter((col) => col.type === "date").map((col) => col.key);
|
|
2010
|
+
const dateTimeKeys = columns.filter((col) => col.type === "dateTime").map((col) => col.key);
|
|
2011
|
+
const amountKeys = columns.filter((col) => col.type === "amount").map((col) => col.key);
|
|
2012
|
+
const persentKeys = columns.filter((col) => col.type === "percent").map((col) => col.key);
|
|
2013
|
+
const inputKeys = columns.filter((col) => col.type === "input").map((col) => col.key);
|
|
2014
|
+
const checkboxKeys = columns.filter((col) => col.type === "checkbox").map((col) => col.key);
|
|
2015
|
+
const thAlignLeftKeys = columns.filter((col) => (col.thAlign || col.align) === "left").map((col) => col.key);
|
|
2016
|
+
const thAlignRightKeys = columns.filter((col) => (col.thAlign || col.align) === "right").map((col) => col.key);
|
|
2017
|
+
const tdAlignLeftKeys = columns.filter((col) => (col.tdAlign || col.align) === "left").map((col) => col.key);
|
|
2018
|
+
const tdAlignRightKeys = columns.filter((col) => (col.tdAlign || col.align) === "right").map((col) => col.key);
|
|
2019
|
+
const textBoldKeys = columns.filter((col) => col.bold).map((col) => col.key);
|
|
2020
|
+
const noWrapKeys = columns.filter((col) => col.noWrap).map((col) => col.key);
|
|
2021
|
+
const requiredKeys = columns.filter((col) => col.required).map((col) => col.key);
|
|
2022
|
+
const importantColorKeys = columns.filter((col) => col.important).map((col) => col.key);
|
|
2023
|
+
const sortKeys = columns.filter((col) => col.sortable).map((col) => col.key);
|
|
2024
|
+
const mergeDuplicateKeys = columns.filter((col) => col.mergeDuplicate).map((col) => col.key);
|
|
2025
|
+
const [selectedIds, setSelectedIds] = useState6([]);
|
|
2026
|
+
const [sortState, setSortState] = useState6(null);
|
|
2027
|
+
const enabledDatas = datas.filter(
|
|
2028
|
+
(data) => !disabledCheckboxCondition?.(data)
|
|
2029
|
+
);
|
|
2030
|
+
const isAllSelected = enabledDatas.length > 0 && selectedIds.length === enabledDatas.length;
|
|
2031
|
+
const getCellSpan = (rowIndex, colIndex, headerKey) => {
|
|
2032
|
+
if (!mergeDuplicateKeys.includes(headerKey)) return 1;
|
|
2033
|
+
const currentRow = datas[rowIndex];
|
|
2034
|
+
const currentOrderNo = currentRow["orderNo"];
|
|
2035
|
+
const currentValue = JSON.stringify(currentRow[headerKey]);
|
|
2036
|
+
let span = 1;
|
|
2037
|
+
for (let i = rowIndex + 1; i < datas.length; i++) {
|
|
2038
|
+
const nextRow = datas[i];
|
|
2039
|
+
const nextOrderNo = nextRow["orderNo"];
|
|
2040
|
+
const nextValue = JSON.stringify(nextRow[headerKey]);
|
|
2041
|
+
if (JSON.stringify(nextOrderNo) !== JSON.stringify(currentOrderNo)) {
|
|
2042
|
+
break;
|
|
2043
|
+
}
|
|
2044
|
+
if (nextValue !== currentValue) {
|
|
2045
|
+
break;
|
|
2046
|
+
}
|
|
2047
|
+
span++;
|
|
2048
|
+
}
|
|
2049
|
+
return span;
|
|
2050
|
+
};
|
|
2051
|
+
const getMergedCellClassName = (rowSpan) => {
|
|
2052
|
+
if (rowSpan <= 1) return "border-b border-line px-20 py-8";
|
|
2053
|
+
return "border-b border-r border-line px-20 py-8";
|
|
2054
|
+
};
|
|
2055
|
+
const shouldRenderCell = (rowIndex, colIndex, headerKey) => {
|
|
2056
|
+
if (!mergeDuplicateKeys.includes(headerKey)) return true;
|
|
2057
|
+
if (rowIndex > 0) {
|
|
2058
|
+
const currentRow = datas[rowIndex];
|
|
2059
|
+
const previousRow = datas[rowIndex - 1];
|
|
2060
|
+
const currentOrderNo = currentRow["orderNo"];
|
|
2061
|
+
const previousOrderNo = previousRow["orderNo"];
|
|
2062
|
+
const currentValue = JSON.stringify(currentRow[headerKey]);
|
|
2063
|
+
const previousValue = JSON.stringify(previousRow[headerKey]);
|
|
2064
|
+
if (JSON.stringify(currentOrderNo) === JSON.stringify(previousOrderNo) && currentValue === previousValue) {
|
|
2065
|
+
return false;
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return true;
|
|
2069
|
+
};
|
|
2070
|
+
const handleSelectAll = () => {
|
|
2071
|
+
if (isAllSelected) {
|
|
2072
|
+
setSelectedIds([]);
|
|
2073
|
+
onCheckboxOption?.([]);
|
|
2074
|
+
} else {
|
|
2075
|
+
const enabledIds = enabledDatas.map((data) => data.id).filter(Boolean);
|
|
2076
|
+
setSelectedIds(enabledIds.map(String));
|
|
2077
|
+
onCheckboxOption?.(enabledIds.map(String));
|
|
2078
|
+
}
|
|
2079
|
+
};
|
|
2080
|
+
const handleSelectItem = (id) => {
|
|
2081
|
+
const data = datas.find((item) => String(item.id) === id);
|
|
2082
|
+
if (data && disabledCheckboxCondition?.(data)) {
|
|
2083
|
+
return;
|
|
2084
|
+
}
|
|
2085
|
+
const newSelectedIds = selectedIds.includes(id) ? selectedIds.filter((selectedId) => selectedId !== id) : [...selectedIds, id];
|
|
2086
|
+
setSelectedIds(newSelectedIds);
|
|
2087
|
+
onCheckboxOption?.(newSelectedIds);
|
|
2088
|
+
};
|
|
2089
|
+
const handleSelectRadioItem = (id) => {
|
|
2090
|
+
setSelectedIds([id]);
|
|
2091
|
+
onRadioOption?.(id);
|
|
2092
|
+
};
|
|
2093
|
+
const handleMoveUp = (id) => {
|
|
2094
|
+
onMoveUp?.(id);
|
|
2095
|
+
};
|
|
2096
|
+
const handleMoveDown = (id) => {
|
|
2097
|
+
onMoveDown?.(id);
|
|
2098
|
+
};
|
|
2099
|
+
const handleSort = (key) => {
|
|
2100
|
+
if (!sortKeys.includes(key)) return;
|
|
2101
|
+
let newDirection;
|
|
2102
|
+
if (sortState?.key === key) {
|
|
2103
|
+
if (sortState.direction === "asc") {
|
|
2104
|
+
newDirection = "desc";
|
|
2105
|
+
} else if (sortState.direction === "desc") {
|
|
2106
|
+
newDirection = "none";
|
|
2107
|
+
} else {
|
|
2108
|
+
newDirection = "asc";
|
|
2109
|
+
}
|
|
2110
|
+
} else {
|
|
2111
|
+
newDirection = "asc";
|
|
2112
|
+
}
|
|
2113
|
+
if (newDirection === "none") {
|
|
2114
|
+
setSortState(null);
|
|
2115
|
+
} else {
|
|
2116
|
+
setSortState({ key, direction: newDirection });
|
|
2117
|
+
}
|
|
2118
|
+
onSort?.(key, newDirection);
|
|
2119
|
+
};
|
|
2120
|
+
const getSortedData = (data, sortKey, direction) => {
|
|
2121
|
+
if (!sortKey || direction === "none") return data;
|
|
2122
|
+
return [...data].sort((a, b) => {
|
|
2123
|
+
const aValue = a[sortKey];
|
|
2124
|
+
const bValue = b[sortKey];
|
|
2125
|
+
if (aValue === null || aValue === void 0)
|
|
2126
|
+
return direction === "asc" ? -1 : 1;
|
|
2127
|
+
if (bValue === null || bValue === void 0)
|
|
2128
|
+
return direction === "asc" ? 1 : -1;
|
|
2129
|
+
if (typeof aValue === "number" && typeof bValue === "number") {
|
|
2130
|
+
return direction === "asc" ? aValue - bValue : bValue - aValue;
|
|
2131
|
+
}
|
|
2132
|
+
if (dateKeys.includes(sortKey)) {
|
|
2133
|
+
const aDate = new Date(String(aValue)).getTime();
|
|
2134
|
+
const bDate = new Date(String(bValue)).getTime();
|
|
2135
|
+
return direction === "asc" ? aDate - bDate : bDate - aDate;
|
|
2136
|
+
}
|
|
2137
|
+
if (dateTimeKeys.includes(sortKey)) {
|
|
2138
|
+
const aDate = new Date(String(aValue)).getTime();
|
|
2139
|
+
const bDate = new Date(String(bValue)).getTime();
|
|
2140
|
+
return direction === "asc" ? aDate - bDate : bDate - aDate;
|
|
2141
|
+
}
|
|
2142
|
+
const aString = String(aValue).toLowerCase();
|
|
2143
|
+
const bString = String(bValue).toLowerCase();
|
|
2144
|
+
if (aString < bString) return direction === "asc" ? -1 : 1;
|
|
2145
|
+
if (aString > bString) return direction === "asc" ? 1 : -1;
|
|
2146
|
+
return 0;
|
|
2147
|
+
});
|
|
2148
|
+
};
|
|
2149
|
+
const sortedData = sortState ? getSortedData(datas, sortState.key, sortState.direction) : datas;
|
|
2150
|
+
useEffect6(() => {
|
|
2151
|
+
const currentIds = sortedData.map((data) => String(data.id)).filter(Boolean);
|
|
2152
|
+
const validSelectedIds = selectedIds.filter(
|
|
2153
|
+
(id) => currentIds.includes(id)
|
|
2154
|
+
);
|
|
2155
|
+
if (validSelectedIds.length !== selectedIds.length) {
|
|
2156
|
+
setSelectedIds(validSelectedIds);
|
|
2157
|
+
onCheckboxOption?.(validSelectedIds);
|
|
2158
|
+
}
|
|
2159
|
+
}, [sortedData, selectedIds, onCheckboxOption]);
|
|
2160
|
+
const cellData = (data, headerKey, rowIndex, colIndex) => {
|
|
2161
|
+
const value = data[headerKey];
|
|
2162
|
+
if (!shouldRenderCell(rowIndex, colIndex, headerKey)) {
|
|
2163
|
+
return null;
|
|
2164
|
+
}
|
|
2165
|
+
const rowSpan = getCellSpan(rowIndex, colIndex, headerKey);
|
|
2166
|
+
const column = columns.find((col) => col.key === headerKey);
|
|
2167
|
+
if (column?.render) {
|
|
2168
|
+
return /* @__PURE__ */ jsx22(
|
|
2169
|
+
"td",
|
|
2170
|
+
{
|
|
2171
|
+
className: `${getMergedCellClassName(rowSpan)} ${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""} ${textBoldKeys?.includes(headerKey) ? "font-bold" : ""} ${column.tdClassName || ""}`,
|
|
2172
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2173
|
+
children: column.render(value, data, rowIndex)
|
|
2174
|
+
},
|
|
2175
|
+
`${rowIndex}-${colIndex}`
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
if (inputKeys?.includes(headerKey)) {
|
|
2179
|
+
return /* @__PURE__ */ jsx22(
|
|
2180
|
+
"td",
|
|
2181
|
+
{
|
|
2182
|
+
className: `${getMergedCellClassName(rowSpan)} ${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}`,
|
|
2183
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2184
|
+
children: /* @__PURE__ */ jsxs15(Stack_default, { direction: "row", gap: 4, align: "center", justify: "center", children: [
|
|
2185
|
+
/* @__PURE__ */ jsx22(
|
|
2186
|
+
Input_default,
|
|
2187
|
+
{
|
|
2188
|
+
type: "number",
|
|
2189
|
+
textAlign: "right",
|
|
2190
|
+
direction: "row",
|
|
2191
|
+
value: String(value),
|
|
2192
|
+
customWidth: 120,
|
|
2193
|
+
onChange: (e) => {
|
|
2194
|
+
onChangeInput?.(
|
|
2195
|
+
data.id,
|
|
2196
|
+
String(e.target.value),
|
|
2197
|
+
headerKey
|
|
2198
|
+
);
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
),
|
|
2202
|
+
/* @__PURE__ */ jsx22(Text, { children: "\uC6D0" })
|
|
2203
|
+
] })
|
|
2204
|
+
},
|
|
2205
|
+
`${rowIndex}-${colIndex}`
|
|
2206
|
+
);
|
|
2207
|
+
}
|
|
2208
|
+
if (checkboxKeys?.includes(headerKey)) {
|
|
2209
|
+
return /* @__PURE__ */ jsx22(
|
|
2210
|
+
"td",
|
|
2211
|
+
{
|
|
2212
|
+
className: `${getMergedCellClassName(rowSpan)} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}`,
|
|
2213
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2214
|
+
children: /* @__PURE__ */ jsx22(Stack_default, { direction: "row", gap: 4, align: "center", justify: "start", children: /* @__PURE__ */ jsx22(
|
|
2215
|
+
Checkbox_default,
|
|
2216
|
+
{
|
|
2217
|
+
checked: value,
|
|
2218
|
+
onChange: (e) => onChangeCheckbox?.(
|
|
2219
|
+
data.id,
|
|
2220
|
+
e.target.checked,
|
|
2221
|
+
headerKey
|
|
2222
|
+
)
|
|
2223
|
+
}
|
|
2224
|
+
) })
|
|
2225
|
+
},
|
|
2226
|
+
`${rowIndex}-${colIndex}`
|
|
2227
|
+
);
|
|
2228
|
+
}
|
|
2229
|
+
if (amountKeys?.includes(headerKey)) {
|
|
2230
|
+
return /* @__PURE__ */ jsxs15(
|
|
2231
|
+
"td",
|
|
2232
|
+
{
|
|
2233
|
+
className: `${getMergedCellClassName(rowSpan)} ${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}`,
|
|
2234
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2235
|
+
children: [
|
|
2236
|
+
formatNumberWithComma(String(value)),
|
|
2237
|
+
"\uC6D0"
|
|
2238
|
+
]
|
|
2239
|
+
},
|
|
2240
|
+
`${rowIndex}-${colIndex}`
|
|
2241
|
+
);
|
|
2242
|
+
}
|
|
2243
|
+
if (dateKeys?.includes(headerKey)) {
|
|
2244
|
+
return /* @__PURE__ */ jsx22(
|
|
2245
|
+
"td",
|
|
2246
|
+
{
|
|
2247
|
+
className: `${getMergedCellClassName(rowSpan)} ${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}`,
|
|
2248
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2249
|
+
children: formatDate(String(value))
|
|
2250
|
+
},
|
|
2251
|
+
`${rowIndex}-${colIndex}`
|
|
2252
|
+
);
|
|
2253
|
+
}
|
|
2254
|
+
if (dateTimeKeys?.includes(headerKey)) {
|
|
2255
|
+
return /* @__PURE__ */ jsx22(
|
|
2256
|
+
"td",
|
|
2257
|
+
{
|
|
2258
|
+
className: `${getMergedCellClassName(rowSpan)} ${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}`,
|
|
2259
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2260
|
+
children: value ? formatDateTime(String(value)) : "-"
|
|
2261
|
+
},
|
|
2262
|
+
`${rowIndex}-${colIndex}`
|
|
2263
|
+
);
|
|
2264
|
+
}
|
|
2265
|
+
if (React6.isValidElement(value)) {
|
|
2266
|
+
return /* @__PURE__ */ jsx22(
|
|
2267
|
+
"td",
|
|
2268
|
+
{
|
|
2269
|
+
className: `${getMergedCellClassName(rowSpan)} ${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}`,
|
|
2270
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2271
|
+
children: value
|
|
2272
|
+
},
|
|
2273
|
+
`${rowIndex}-${colIndex}`
|
|
2274
|
+
);
|
|
2275
|
+
}
|
|
2276
|
+
let cellContent = value?.toString() || "";
|
|
2277
|
+
if (persentKeys?.includes(headerKey)) {
|
|
2278
|
+
cellContent = `${formatNumberWithComma(String(value))}%`;
|
|
2279
|
+
}
|
|
2280
|
+
if (typeof value === "object" && value !== null) {
|
|
2281
|
+
cellContent = /* @__PURE__ */ jsx22(Stack_default, { direction: "row", gap: 8, align: "center", children: Object.entries(value).map(
|
|
2282
|
+
([key, val], index) => {
|
|
2283
|
+
if (key === "image" && val) {
|
|
2284
|
+
return /* @__PURE__ */ jsx22(
|
|
2285
|
+
"img",
|
|
2286
|
+
{
|
|
2287
|
+
src: String(val),
|
|
2288
|
+
alt: "\uC0C1\uD488 \uC774\uBBF8\uC9C0",
|
|
2289
|
+
className: "w-40 h-40 object-cover rounded border border-line"
|
|
2290
|
+
},
|
|
2291
|
+
`${key}-${index}`
|
|
2292
|
+
);
|
|
2293
|
+
}
|
|
2294
|
+
return /* @__PURE__ */ jsx22(
|
|
2295
|
+
"span",
|
|
2296
|
+
{
|
|
2297
|
+
className: `${key === "name" || key === "title" ? "" : ""} `,
|
|
2298
|
+
children: val?.toString() || ""
|
|
2299
|
+
},
|
|
2300
|
+
`${key}-${index}`
|
|
2301
|
+
);
|
|
2302
|
+
}
|
|
2303
|
+
) });
|
|
2304
|
+
}
|
|
2305
|
+
return /* @__PURE__ */ jsx22(
|
|
2306
|
+
"td",
|
|
2307
|
+
{
|
|
2308
|
+
className: `${getMergedCellClassName(rowSpan)}
|
|
2309
|
+
${linkKeys?.includes(headerKey) && "text-primary underline cursor-pointer"}
|
|
2310
|
+
${tdAlignLeftKeys?.includes(headerKey) ? "text-left" : tdAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"}
|
|
2311
|
+
${noWrapKeys?.includes(headerKey) ? "whitespace-nowrap" : ""}
|
|
2312
|
+
${textBoldKeys?.includes(headerKey) ? "font-bold" : ""}
|
|
2313
|
+
`,
|
|
2314
|
+
rowSpan: rowSpan > 1 ? rowSpan : void 0,
|
|
2315
|
+
onClick: () => {
|
|
2316
|
+
if (!linkKeys?.includes(headerKey)) {
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
onLinkClick?.(data.id, String(value), headerKey);
|
|
2320
|
+
},
|
|
2321
|
+
children: cellContent
|
|
2322
|
+
},
|
|
2323
|
+
`${rowIndex}-${colIndex}`
|
|
2324
|
+
);
|
|
2325
|
+
};
|
|
2326
|
+
const renderTableBody = () => {
|
|
2327
|
+
if (sortedData.length === 0) {
|
|
2328
|
+
const colSpanCount = headersKeys.length + (isCheckboxOption ? 1 : 0) + (isRadioOption ? 1 : 0) + (isModify ? 1 : 0);
|
|
2329
|
+
return /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22(
|
|
2330
|
+
"td",
|
|
2331
|
+
{
|
|
2332
|
+
colSpan: colSpanCount,
|
|
2333
|
+
className: "text-center border-b border-line px-20 py-8",
|
|
2334
|
+
children: emptyMessage
|
|
2335
|
+
}
|
|
2336
|
+
) });
|
|
2337
|
+
}
|
|
2338
|
+
return sortedData.map((data, rowIndex) => /* @__PURE__ */ jsxs15(
|
|
2339
|
+
"tr",
|
|
2340
|
+
{
|
|
2341
|
+
className: `${mergeDuplicateKeys.length === 0 ? "hover:bg-gray1" : ""} ${isCheckboxOption && mergeDuplicateKeys.length === 0 && selectedIds.includes(String(data.id)) && "bg-primary5"}`,
|
|
2342
|
+
children: [
|
|
2343
|
+
isCheckboxOption && /* @__PURE__ */ jsx22("td", { className: "border-b border-line px-20 py-8 text-center w-30 ", children: /* @__PURE__ */ jsx22(
|
|
2344
|
+
Checkbox_default,
|
|
2345
|
+
{
|
|
2346
|
+
checked: selectedIds.includes(String(data.id)),
|
|
2347
|
+
disabled: disabledCheckboxCondition?.(data) || false,
|
|
2348
|
+
onChange: () => handleSelectItem(String(data.id))
|
|
2349
|
+
}
|
|
2350
|
+
) }),
|
|
2351
|
+
isRadioOption && /* @__PURE__ */ jsx22("td", { className: "border-b border-line px-20 py-8 text-center w-50", children: /* @__PURE__ */ jsx22(
|
|
2352
|
+
Radio_default,
|
|
2353
|
+
{
|
|
2354
|
+
checked: selectedIds.includes(String(data.id)),
|
|
2355
|
+
onChange: () => handleSelectRadioItem(String(data.id))
|
|
2356
|
+
}
|
|
2357
|
+
) }),
|
|
2358
|
+
isModify && /* @__PURE__ */ jsx22("td", { className: "border-b border-line px-20 py-8 text-center w-60", children: /* @__PURE__ */ jsxs15("div", { className: "flex justify-center gap-1", children: [
|
|
2359
|
+
/* @__PURE__ */ jsx22(
|
|
2360
|
+
"img",
|
|
2361
|
+
{
|
|
2362
|
+
src: ic_sort_arrow_up_default,
|
|
2363
|
+
alt: "\uC704\uB85C \uC774\uB3D9",
|
|
2364
|
+
className: `w-16 h-16 cursor-pointer ${rowIndex === 0 ? "opacity-30 cursor-not-allowed" : "hover:opacity-70"}`,
|
|
2365
|
+
onClick: () => {
|
|
2366
|
+
if (rowIndex > 0) {
|
|
2367
|
+
handleMoveUp(String(data.id));
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
),
|
|
2372
|
+
/* @__PURE__ */ jsx22(
|
|
2373
|
+
"img",
|
|
2374
|
+
{
|
|
2375
|
+
src: ic_sort_arrow_down_default,
|
|
2376
|
+
alt: "\uC544\uB798\uB85C \uC774\uB3D9",
|
|
2377
|
+
className: `w-16 h-16 cursor-pointer ${rowIndex === sortedData.length - 1 ? "opacity-30 cursor-not-allowed" : "hover:opacity-70"}`,
|
|
2378
|
+
onClick: () => {
|
|
2379
|
+
if (rowIndex < sortedData.length - 1) {
|
|
2380
|
+
handleMoveDown(String(data.id));
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
)
|
|
2385
|
+
] }) }),
|
|
2386
|
+
headersKeys.map((headerKey, colIndex) => {
|
|
2387
|
+
const cell = cellData(data, headerKey, rowIndex, colIndex);
|
|
2388
|
+
return cell;
|
|
2389
|
+
}).filter(Boolean)
|
|
2390
|
+
]
|
|
2391
|
+
},
|
|
2392
|
+
data.id ? String(data.id) : rowIndex
|
|
2393
|
+
));
|
|
2394
|
+
};
|
|
2395
|
+
useEffect6(() => {
|
|
2396
|
+
if (selectedIds.length > 0) {
|
|
2397
|
+
setSelectedIds([]);
|
|
2398
|
+
}
|
|
2399
|
+
}, [datas]);
|
|
2400
|
+
return /* @__PURE__ */ jsx22("div", { className: "w-full", children: /* @__PURE__ */ jsx22("div", { className: `${overWidth ? "overflow-x-auto" : ""}`, children: /* @__PURE__ */ jsxs15(
|
|
2401
|
+
"table",
|
|
2402
|
+
{
|
|
2403
|
+
className: "border-collapse border-line border-t w-full table",
|
|
2404
|
+
style: {
|
|
2405
|
+
minWidth: overWidth ? toRemFunction2(overWidth) : "100%"
|
|
2406
|
+
},
|
|
2407
|
+
children: [
|
|
2408
|
+
/* @__PURE__ */ jsx22("thead", { children: /* @__PURE__ */ jsxs15("tr", { children: [
|
|
2409
|
+
isCheckboxOption && /* @__PURE__ */ jsx22("th", { className: "border-b border-line px-20 py-8 bg-gray1 text-center w-30 vertical-middle", children: /* @__PURE__ */ jsx22(
|
|
2410
|
+
Checkbox_default,
|
|
2411
|
+
{
|
|
2412
|
+
checked: isAllSelected,
|
|
2413
|
+
onChange: handleSelectAll
|
|
2414
|
+
}
|
|
2415
|
+
) }),
|
|
2416
|
+
isRadioOption && /* @__PURE__ */ jsx22("th", { className: "border-b border-line px-20 py-8 bg-gray1 text-center w-30", children: "\uC120\uD0DD" }),
|
|
2417
|
+
isModify && /* @__PURE__ */ jsx22("th", { className: "border-b border-line px-20 py-8 bg-gray1 text-center w-60 whitespace-nowrap", children: "\uD3B8\uC9D1" }),
|
|
2418
|
+
columns.map((column, index) => {
|
|
2419
|
+
const title = column.header;
|
|
2420
|
+
const colSpan = column.colSpan;
|
|
2421
|
+
const headerKey = column.key;
|
|
2422
|
+
const isSortable = sortKeys.includes(headerKey);
|
|
2423
|
+
const isCurrentSort = sortState?.key === headerKey;
|
|
2424
|
+
const isImportantColor = importantColorKeys.includes(headerKey);
|
|
2425
|
+
return /* @__PURE__ */ jsx22(
|
|
2426
|
+
"th",
|
|
2427
|
+
{
|
|
2428
|
+
colSpan,
|
|
2429
|
+
className: `border-b border-line px-20 py-7 bg-gray1 whitespace-nowrap text-body14 text-text font-medium ${thAlignLeftKeys?.includes(headerKey) ? "text-left" : thAlignRightKeys?.includes(headerKey) ? "text-right" : "text-center"} ${isSortable ? "cursor-pointer hover:bg-gray-200" : ""}
|
|
2430
|
+
${isImportantColor ? "text-primary bg-primary10" : ""}
|
|
2431
|
+
${column.thClassName || ""}`,
|
|
2432
|
+
onClick: () => isSortable && handleSort(headerKey),
|
|
2433
|
+
children: /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2434
|
+
typeof title === "string" ? /* @__PURE__ */ jsx22("span", { children: title }) : title,
|
|
2435
|
+
requiredKeys?.includes(headerKey) && /* @__PURE__ */ jsx22(
|
|
2436
|
+
"span",
|
|
2437
|
+
{
|
|
2438
|
+
className: "inline-block -mt-2",
|
|
2439
|
+
style: { verticalAlign: "top" },
|
|
2440
|
+
children: /* @__PURE__ */ jsx22(RequiredDot_default, {})
|
|
2441
|
+
}
|
|
2442
|
+
),
|
|
2443
|
+
isSortable && /* @__PURE__ */ jsxs15("div", { className: "flex flex-col inline-block ml-5 vertical-middle", children: [
|
|
2444
|
+
/* @__PURE__ */ jsx22(
|
|
2445
|
+
"img",
|
|
2446
|
+
{
|
|
2447
|
+
src: ic_sort_arrow_up_default,
|
|
2448
|
+
alt: "\uC624\uB984\uCC28\uC21C",
|
|
2449
|
+
className: `w-12 h-12 ${isCurrentSort && sortState.direction === "asc" ? "opacity-100" : "opacity-30"}`
|
|
2450
|
+
}
|
|
2451
|
+
),
|
|
2452
|
+
/* @__PURE__ */ jsx22(
|
|
2453
|
+
"img",
|
|
2454
|
+
{
|
|
2455
|
+
src: ic_sort_arrow_down_default,
|
|
2456
|
+
alt: "\uB0B4\uB9BC\uCC28\uC21C",
|
|
2457
|
+
className: `w-12 h-12 ${isCurrentSort && sortState.direction === "desc" ? "opacity-100" : "opacity-30"}`
|
|
2458
|
+
}
|
|
2459
|
+
)
|
|
2460
|
+
] })
|
|
2461
|
+
] })
|
|
2462
|
+
},
|
|
2463
|
+
index
|
|
2464
|
+
);
|
|
2465
|
+
})
|
|
2466
|
+
] }) }),
|
|
2467
|
+
/* @__PURE__ */ jsx22("tbody", { children: renderTableBody() }),
|
|
2468
|
+
footers && /* @__PURE__ */ jsx22("tfoot", { children: footers })
|
|
2469
|
+
]
|
|
2470
|
+
}
|
|
2471
|
+
) }) });
|
|
2472
|
+
}
|
|
2473
|
+
var Table_default = Table;
|
|
2474
|
+
|
|
2475
|
+
// src/constants/common.ts
|
|
2476
|
+
var LIST_PAGE_SIZE = 10;
|
|
2477
|
+
|
|
2478
|
+
// src/components/ui/Table/TableTop.tsx
|
|
2479
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2480
|
+
function TableTop({
|
|
2481
|
+
type = "search",
|
|
2482
|
+
count,
|
|
2483
|
+
pageSize = LIST_PAGE_SIZE,
|
|
2484
|
+
countText = "\uAC1C \uC0C1\uD488 \uC870\uD68C",
|
|
2485
|
+
leftButtons,
|
|
2486
|
+
rightButtons,
|
|
2487
|
+
registText = "\uC0C1\uD488 \uB4F1\uB85D",
|
|
2488
|
+
sortOptionValue,
|
|
2489
|
+
sortOptions,
|
|
2490
|
+
useDivider = true,
|
|
2491
|
+
isPageCount = true,
|
|
2492
|
+
useCountOption = true,
|
|
2493
|
+
deleteText = "\uC120\uD0DD \uC0AD\uC81C",
|
|
2494
|
+
onChangeSort,
|
|
2495
|
+
onChangePageSize,
|
|
2496
|
+
onDelete,
|
|
2497
|
+
onExcelDownload,
|
|
2498
|
+
onSelectExcelDownload,
|
|
2499
|
+
handleRegist
|
|
2500
|
+
}) {
|
|
2501
|
+
return /* @__PURE__ */ jsxs16(Stack_default, { direction: "col", gap: 6, children: [
|
|
2502
|
+
(sortOptions || useCountOption || isPageCount) && /* @__PURE__ */ jsxs16(Stack_default, { direction: "row", gap: 10, justify: "between", align: "end", children: [
|
|
2503
|
+
isPageCount && /* @__PURE__ */ jsx23(Stack_default, { direction: "row", gap: 10, children: /* @__PURE__ */ jsxs16(Text, { size: "body14", fontWeight: "bold", children: [
|
|
2504
|
+
"\uCD1D",
|
|
2505
|
+
"\xA0",
|
|
2506
|
+
/* @__PURE__ */ jsx23(Text, { size: "body14", fontWeight: "bold", color: "primary", children: count }),
|
|
2507
|
+
countText
|
|
2508
|
+
] }) }),
|
|
2509
|
+
/* @__PURE__ */ jsxs16(Stack_default, { direction: "row", gap: 10, align: "center", children: [
|
|
2510
|
+
rightButtons,
|
|
2511
|
+
sortOptions && /* @__PURE__ */ jsx23(
|
|
2512
|
+
SelectBox_default,
|
|
2513
|
+
{
|
|
2514
|
+
value: sortOptionValue,
|
|
2515
|
+
options: sortOptions,
|
|
2516
|
+
customWidth: 160,
|
|
2517
|
+
onChange: (value) => {
|
|
2518
|
+
if (onChangeSort) {
|
|
2519
|
+
onChangeSort(value);
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
),
|
|
2524
|
+
useCountOption && /* @__PURE__ */ jsx23(
|
|
2525
|
+
SelectBox_default,
|
|
2526
|
+
{
|
|
2527
|
+
value: pageSize,
|
|
2528
|
+
options: [
|
|
2529
|
+
{ label: "10 \uAC74\uC529 \uBCF4\uAE30", value: 10 },
|
|
2530
|
+
{ label: "20 \uAC74\uC529 \uBCF4\uAE30", value: 20 },
|
|
2531
|
+
{ label: "30 \uAC74\uC529 \uBCF4\uAE30", value: 30 },
|
|
2532
|
+
{ label: "50 \uAC74\uC529 \uBCF4\uAE30", value: 50 },
|
|
2533
|
+
{ label: "100 \uAC74\uC529 \uBCF4\uAE30", value: 100 }
|
|
2534
|
+
],
|
|
2535
|
+
customWidth: 160,
|
|
2536
|
+
onChange: (value) => {
|
|
2537
|
+
if (onChangePageSize) {
|
|
2538
|
+
onChangePageSize(value);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
)
|
|
2543
|
+
] })
|
|
2544
|
+
] }),
|
|
2545
|
+
type === "search" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2546
|
+
useDivider && isPageCount && /* @__PURE__ */ jsx23(Divider_default, {}),
|
|
2547
|
+
/* @__PURE__ */ jsxs16(Stack_default, { direction: "row", gap: 10, justify: "between", children: [
|
|
2548
|
+
/* @__PURE__ */ jsx23(Stack_default, { direction: "row", gap: 4, children: leftButtons }),
|
|
2549
|
+
/* @__PURE__ */ jsx23(Stack_default, { direction: "row", gap: 4, children: handleRegist && /* @__PURE__ */ jsx23(
|
|
2550
|
+
Button_default,
|
|
2551
|
+
{
|
|
2552
|
+
size: "medium",
|
|
2553
|
+
variant: "primary",
|
|
2554
|
+
onClick: () => {
|
|
2555
|
+
handleRegist?.();
|
|
2556
|
+
},
|
|
2557
|
+
children: registText
|
|
2558
|
+
}
|
|
2559
|
+
) })
|
|
2560
|
+
] })
|
|
2561
|
+
] })
|
|
2562
|
+
] });
|
|
2563
|
+
}
|
|
2564
|
+
var TableTop_default = TableTop;
|
|
2565
|
+
|
|
2566
|
+
// src/components/ui/Table/CommonTable.tsx
|
|
2567
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2568
|
+
function CommonTable({ tableTop, tableBody, pagination }) {
|
|
2569
|
+
return /* @__PURE__ */ jsx24(Stack_default, { direction: "col", gap: 20, wFull: true, children: /* @__PURE__ */ jsxs17(Stack_default, { direction: "col", gap: 7, children: [
|
|
2570
|
+
tableTop && tableTop,
|
|
2571
|
+
tableBody && tableBody,
|
|
2572
|
+
pagination && pagination
|
|
2573
|
+
] }) });
|
|
2574
|
+
}
|
|
2575
|
+
var CommonTable_default = CommonTable;
|
|
2576
|
+
|
|
2577
|
+
// src/components/ui/Tag/Tag.tsx
|
|
2578
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2579
|
+
function Tag({
|
|
2580
|
+
id,
|
|
2581
|
+
children,
|
|
2582
|
+
color = "text",
|
|
2583
|
+
bgColor,
|
|
2584
|
+
size = "body12",
|
|
2585
|
+
fontWeight: fontWeightProp = "bold",
|
|
2586
|
+
className = "",
|
|
2587
|
+
variant = "filled",
|
|
2588
|
+
style,
|
|
2589
|
+
...props
|
|
2590
|
+
}) {
|
|
2591
|
+
const getVariantStyles = () => {
|
|
2592
|
+
if (variant === "outlined") {
|
|
2593
|
+
return {
|
|
2594
|
+
backgroundColor: colors.white,
|
|
2595
|
+
color: colors[color],
|
|
2596
|
+
border: `1px solid ${colors.line}`
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
const bgColorKey = bgColor || `${color}Light`;
|
|
2600
|
+
return {
|
|
2601
|
+
backgroundColor: colors[bgColorKey] || colors[`${color}Light`] || colors.textLight,
|
|
2602
|
+
color: colors[color]
|
|
2603
|
+
};
|
|
2604
|
+
};
|
|
2605
|
+
const styles = {
|
|
2606
|
+
display: "inline-block",
|
|
2607
|
+
fontSize: fontSize[size],
|
|
2608
|
+
fontWeight: fontWeight[fontWeightProp],
|
|
2609
|
+
paddingLeft: "6px",
|
|
2610
|
+
paddingRight: "6px",
|
|
2611
|
+
height: "26px",
|
|
2612
|
+
borderRadius: "6px",
|
|
2613
|
+
touchAction: "none",
|
|
2614
|
+
lineHeight: "26px",
|
|
2615
|
+
whiteSpace: "nowrap",
|
|
2616
|
+
...getVariantStyles(),
|
|
2617
|
+
...style
|
|
2618
|
+
// 사용자 정의 style을 마지막에 배치하여 오버라이드 가능하게
|
|
2619
|
+
};
|
|
2620
|
+
return /* @__PURE__ */ jsx25("div", { id, style: styles, className, ...props, children });
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
// src/components/ui/TagInput/TagInput.tsx
|
|
2624
|
+
import { useState as useState7, forwardRef as forwardRef6, useMemo } from "react";
|
|
2625
|
+
import {
|
|
2626
|
+
DndContext,
|
|
2627
|
+
closestCenter,
|
|
2628
|
+
KeyboardSensor,
|
|
2629
|
+
PointerSensor,
|
|
2630
|
+
useSensor,
|
|
2631
|
+
useSensors,
|
|
2632
|
+
DragOverlay,
|
|
2633
|
+
MeasuringStrategy
|
|
2634
|
+
} from "@dnd-kit/core";
|
|
2635
|
+
import {
|
|
2636
|
+
arrayMove,
|
|
2637
|
+
SortableContext,
|
|
2638
|
+
sortableKeyboardCoordinates,
|
|
2639
|
+
useSortable,
|
|
2640
|
+
rectSortingStrategy
|
|
2641
|
+
} from "@dnd-kit/sortable";
|
|
2642
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2643
|
+
var SimpleTag = ({
|
|
2644
|
+
tag,
|
|
2645
|
+
index,
|
|
2646
|
+
onRemove,
|
|
2647
|
+
disabled
|
|
2648
|
+
}) => {
|
|
2649
|
+
return /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-center gap-8 bg-primary3 text-text text-body14 font-medium px-12 h-36 rounded-md border border-line leading-[36px]", children: [
|
|
2650
|
+
!disabled && /* @__PURE__ */ jsx26("span", { className: "cursor-pointer", onClick: () => onRemove(index), children: /* @__PURE__ */ jsx26(ColorIcTagClose_default, { width: 10, height: 10, color: "text" }) }),
|
|
2651
|
+
/* @__PURE__ */ jsx26("span", { children: tag })
|
|
2652
|
+
] });
|
|
2653
|
+
};
|
|
2654
|
+
var SortableTag = ({
|
|
2655
|
+
tag,
|
|
2656
|
+
index,
|
|
2657
|
+
onRemove,
|
|
2658
|
+
disabled
|
|
2659
|
+
}) => {
|
|
2660
|
+
const {
|
|
2661
|
+
attributes,
|
|
2662
|
+
listeners,
|
|
2663
|
+
setNodeRef,
|
|
2664
|
+
transform,
|
|
2665
|
+
transition,
|
|
2666
|
+
isDragging
|
|
2667
|
+
} = useSortable({ id: tag });
|
|
2668
|
+
const style = {
|
|
2669
|
+
transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : void 0,
|
|
2670
|
+
transition,
|
|
2671
|
+
opacity: isDragging ? 0 : 1
|
|
2672
|
+
// 드래그 중인 원본 항목은 투명하게 처리
|
|
2673
|
+
};
|
|
2674
|
+
return /* @__PURE__ */ jsxs18(
|
|
2675
|
+
"div",
|
|
2676
|
+
{
|
|
2677
|
+
ref: setNodeRef,
|
|
2678
|
+
style,
|
|
2679
|
+
...attributes,
|
|
2680
|
+
...listeners,
|
|
2681
|
+
className: "flex items-center justify-center gap-8 bg-primary3 text-text text-body14 font-medium px-12 h-36 rounded-md touch-none border border-line leading-[36px]",
|
|
2682
|
+
children: [
|
|
2683
|
+
!disabled && /* @__PURE__ */ jsx26(
|
|
2684
|
+
"span",
|
|
2685
|
+
{
|
|
2686
|
+
onPointerDown: (e) => {
|
|
2687
|
+
e.stopPropagation();
|
|
2688
|
+
onRemove(index);
|
|
2689
|
+
},
|
|
2690
|
+
children: /* @__PURE__ */ jsx26(ColorIcTagClose_default, { width: 10, height: 10, color: "text" })
|
|
2691
|
+
}
|
|
2692
|
+
),
|
|
2693
|
+
/* @__PURE__ */ jsx26("span", { children: tag })
|
|
2694
|
+
]
|
|
2695
|
+
}
|
|
2696
|
+
);
|
|
2697
|
+
};
|
|
2698
|
+
var TagInput = forwardRef6(
|
|
2699
|
+
({
|
|
2700
|
+
label,
|
|
2701
|
+
labelHidden,
|
|
2702
|
+
tags,
|
|
2703
|
+
onChange,
|
|
2704
|
+
placeholder = "\uC785\uB825 \uD6C4 Enter",
|
|
2705
|
+
disabled = false,
|
|
2706
|
+
className = "",
|
|
2707
|
+
id,
|
|
2708
|
+
required = false,
|
|
2709
|
+
error,
|
|
2710
|
+
tooltip,
|
|
2711
|
+
onlyView = true,
|
|
2712
|
+
draggable = true,
|
|
2713
|
+
// 기본값: 드래그 가능
|
|
2714
|
+
onDuplicateTag
|
|
2715
|
+
}, ref) => {
|
|
2716
|
+
const [inputValue, setInputValue] = useState7("");
|
|
2717
|
+
const [activeId, setActiveId] = useState7(null);
|
|
2718
|
+
const [draggedWidth, setDraggedWidth] = useState7(null);
|
|
2719
|
+
const activeTag = useMemo(
|
|
2720
|
+
() => tags.find((tag) => tag === activeId),
|
|
2721
|
+
[activeId, tags]
|
|
2722
|
+
);
|
|
2723
|
+
const inputId = id || `tag-input-${Math.random().toString(36).substring(2, 9)}`;
|
|
2724
|
+
const sensors = useSensors(
|
|
2725
|
+
useSensor(PointerSensor),
|
|
2726
|
+
useSensor(KeyboardSensor, {
|
|
2727
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
2728
|
+
})
|
|
2729
|
+
);
|
|
2730
|
+
const handleInputChange = (e) => {
|
|
2731
|
+
setInputValue(e.target.value);
|
|
2732
|
+
};
|
|
2733
|
+
const handleKeyDown = (e) => {
|
|
2734
|
+
if (e.key === "Enter" && !e.nativeEvent.isComposing) {
|
|
2735
|
+
e.preventDefault();
|
|
2736
|
+
const newTag = inputValue.trim();
|
|
2737
|
+
if (newTag && !tags.includes(newTag)) {
|
|
2738
|
+
onChange([...tags, newTag]);
|
|
2739
|
+
setInputValue("");
|
|
2740
|
+
} else if (newTag && onDuplicateTag) {
|
|
2741
|
+
onDuplicateTag(newTag);
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
};
|
|
2745
|
+
const removeTag = (indexToRemove) => {
|
|
2746
|
+
if (disabled) return;
|
|
2747
|
+
onChange(tags.filter((_, index) => index !== indexToRemove));
|
|
2748
|
+
};
|
|
2749
|
+
const handleDragStart = (event) => {
|
|
2750
|
+
setActiveId(event.active.id);
|
|
2751
|
+
if (event.active.rect.current.initial) {
|
|
2752
|
+
setDraggedWidth(event.active.rect.current.initial.width);
|
|
2753
|
+
}
|
|
2754
|
+
};
|
|
2755
|
+
const handleDragEnd = (event) => {
|
|
2756
|
+
const { active, over } = event;
|
|
2757
|
+
if (over && active.id !== over.id) {
|
|
2758
|
+
const oldIndex = tags.findIndex((tag) => tag === active.id);
|
|
2759
|
+
const newIndex = tags.findIndex((tag) => tag === over.id);
|
|
2760
|
+
onChange(arrayMove(tags, oldIndex, newIndex));
|
|
2761
|
+
}
|
|
2762
|
+
setActiveId(null);
|
|
2763
|
+
setDraggedWidth(null);
|
|
2764
|
+
};
|
|
2765
|
+
const handleDragCancel = () => {
|
|
2766
|
+
setActiveId(null);
|
|
2767
|
+
setDraggedWidth(null);
|
|
2768
|
+
};
|
|
2769
|
+
if (!draggable) {
|
|
2770
|
+
return /* @__PURE__ */ jsxs18(Stack_default, { direction: "col", gap: 4, className, wFull: true, children: [
|
|
2771
|
+
/* @__PURE__ */ jsx26(
|
|
2772
|
+
Label_default,
|
|
2773
|
+
{
|
|
2774
|
+
label,
|
|
2775
|
+
required,
|
|
2776
|
+
tooltip,
|
|
2777
|
+
inputId,
|
|
2778
|
+
labelHidden
|
|
2779
|
+
}
|
|
2780
|
+
),
|
|
2781
|
+
/* @__PURE__ */ jsx26(
|
|
2782
|
+
"div",
|
|
2783
|
+
{
|
|
2784
|
+
className: `
|
|
2785
|
+
flex items-center flex-wrap gap-8 rounded-md
|
|
2786
|
+
min-h-36
|
|
2787
|
+
${error ? "border-red" : "border-line"}
|
|
2788
|
+
${disabled ? "bg-gray1" : "bg-white"}
|
|
2789
|
+
`,
|
|
2790
|
+
children: tags.map((tag, index) => /* @__PURE__ */ jsx26(
|
|
2791
|
+
SimpleTag,
|
|
2792
|
+
{
|
|
2793
|
+
tag,
|
|
2794
|
+
index,
|
|
2795
|
+
onRemove: removeTag,
|
|
2796
|
+
disabled
|
|
2797
|
+
},
|
|
2798
|
+
tag
|
|
2799
|
+
))
|
|
2800
|
+
}
|
|
2801
|
+
)
|
|
2802
|
+
] });
|
|
2803
|
+
}
|
|
2804
|
+
return /* @__PURE__ */ jsxs18(Stack_default, { direction: "col", gap: 4, className, wFull: true, children: [
|
|
2805
|
+
/* @__PURE__ */ jsx26(
|
|
2806
|
+
Label_default,
|
|
2807
|
+
{
|
|
2808
|
+
label,
|
|
2809
|
+
required,
|
|
2810
|
+
tooltip,
|
|
2811
|
+
inputId,
|
|
2812
|
+
labelHidden
|
|
2813
|
+
}
|
|
2814
|
+
),
|
|
2815
|
+
/* @__PURE__ */ jsxs18(
|
|
2816
|
+
DndContext,
|
|
2817
|
+
{
|
|
2818
|
+
sensors,
|
|
2819
|
+
collisionDetection: closestCenter,
|
|
2820
|
+
onDragStart: handleDragStart,
|
|
2821
|
+
onDragEnd: handleDragEnd,
|
|
2822
|
+
onDragCancel: handleDragCancel,
|
|
2823
|
+
measuring: {
|
|
2824
|
+
droppable: {
|
|
2825
|
+
strategy: MeasuringStrategy.Always
|
|
2826
|
+
}
|
|
2827
|
+
},
|
|
2828
|
+
children: [
|
|
2829
|
+
/* @__PURE__ */ jsx26(SortableContext, { items: tags, strategy: rectSortingStrategy, children: /* @__PURE__ */ jsxs18(
|
|
2830
|
+
"div",
|
|
2831
|
+
{
|
|
2832
|
+
className: `
|
|
2833
|
+
flex items-center flex-wrap gap-8 rounded-md
|
|
2834
|
+
min-h-36
|
|
2835
|
+
${error ? "border-red" : "border-line"}
|
|
2836
|
+
${disabled ? "bg-gray1" : "bg-white"}
|
|
2837
|
+
`,
|
|
2838
|
+
children: [
|
|
2839
|
+
tags.map((tag, index) => /* @__PURE__ */ jsx26(
|
|
2840
|
+
SortableTag,
|
|
2841
|
+
{
|
|
2842
|
+
tag,
|
|
2843
|
+
index,
|
|
2844
|
+
onRemove: removeTag,
|
|
2845
|
+
disabled
|
|
2846
|
+
},
|
|
2847
|
+
tag
|
|
2848
|
+
)),
|
|
2849
|
+
!onlyView && /* @__PURE__ */ jsx26(
|
|
2850
|
+
"input",
|
|
2851
|
+
{
|
|
2852
|
+
ref,
|
|
2853
|
+
id: inputId,
|
|
2854
|
+
type: "text",
|
|
2855
|
+
value: inputValue,
|
|
2856
|
+
onChange: handleInputChange,
|
|
2857
|
+
onKeyDown: handleKeyDown,
|
|
2858
|
+
placeholder: tags.length === 0 ? placeholder : "",
|
|
2859
|
+
disabled,
|
|
2860
|
+
className: " text-text text-body14 font-medium px-12 h-36 rounded-md text-text "
|
|
2861
|
+
}
|
|
2862
|
+
)
|
|
2863
|
+
]
|
|
2864
|
+
}
|
|
2865
|
+
) }),
|
|
2866
|
+
/* @__PURE__ */ jsx26(DragOverlay, { dropAnimation: null, adjustScale: false, children: activeTag ? /* @__PURE__ */ jsxs18(
|
|
2867
|
+
"div",
|
|
2868
|
+
{
|
|
2869
|
+
className: "flex items-center justify-center gap-8 bg-primary3 text-text text-body14 font-medium px-12 h-36 rounded-md border border-line leading-[36px] shadow-lg",
|
|
2870
|
+
style: {
|
|
2871
|
+
width: draggedWidth ? `${draggedWidth}px` : "auto"
|
|
2872
|
+
},
|
|
2873
|
+
children: [
|
|
2874
|
+
!disabled && /* @__PURE__ */ jsx26("span", { children: /* @__PURE__ */ jsx26(ColorIcTagClose_default, { width: 10, height: 10, color: "text" }) }),
|
|
2875
|
+
/* @__PURE__ */ jsx26("span", { children: activeTag })
|
|
2876
|
+
]
|
|
2877
|
+
}
|
|
2878
|
+
) : null })
|
|
2879
|
+
]
|
|
2880
|
+
}
|
|
2881
|
+
)
|
|
2882
|
+
] });
|
|
2883
|
+
}
|
|
2884
|
+
);
|
|
2885
|
+
TagInput.displayName = "TagInput";
|
|
2886
|
+
var TagInput_default = TagInput;
|
|
2887
|
+
|
|
2888
|
+
// src/components/ui/TextArea/TextArea.tsx
|
|
2889
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2890
|
+
var TextArea = ({
|
|
2891
|
+
label,
|
|
2892
|
+
labelHidden,
|
|
2893
|
+
labelWidth,
|
|
2894
|
+
error,
|
|
2895
|
+
fullWidth = false,
|
|
2896
|
+
required = false,
|
|
2897
|
+
direction = "row",
|
|
2898
|
+
id,
|
|
2899
|
+
className = "",
|
|
2900
|
+
rows = 5,
|
|
2901
|
+
areaHeight = 80,
|
|
2902
|
+
maxLength,
|
|
2903
|
+
...props
|
|
2904
|
+
}) => {
|
|
2905
|
+
const textareaId = id || `textarea-${Math.random().toString(36).substring(2, 9)}`;
|
|
2906
|
+
return /* @__PURE__ */ jsxs19(
|
|
2907
|
+
Stack_default,
|
|
2908
|
+
{
|
|
2909
|
+
direction,
|
|
2910
|
+
wFull: fullWidth,
|
|
2911
|
+
gap: direction === "row" ? 14 : 4,
|
|
2912
|
+
align: direction === "row" ? "center" : "start",
|
|
2913
|
+
children: [
|
|
2914
|
+
/* @__PURE__ */ jsx27(
|
|
2915
|
+
Label_default,
|
|
2916
|
+
{
|
|
2917
|
+
label,
|
|
2918
|
+
required,
|
|
2919
|
+
width: labelWidth,
|
|
2920
|
+
labelHidden
|
|
2921
|
+
}
|
|
2922
|
+
),
|
|
2923
|
+
/* @__PURE__ */ jsxs19(
|
|
2924
|
+
Stack_default,
|
|
2925
|
+
{
|
|
2926
|
+
gap: 0,
|
|
2927
|
+
className: "flex-auto relative",
|
|
2928
|
+
wFull: direction === "row" ? false : fullWidth,
|
|
2929
|
+
children: [
|
|
2930
|
+
/* @__PURE__ */ jsx27(
|
|
2931
|
+
"textarea",
|
|
2932
|
+
{
|
|
2933
|
+
id: textareaId,
|
|
2934
|
+
rows,
|
|
2935
|
+
className: `
|
|
2936
|
+
px-12 py-10 border rounded-md w-full
|
|
2937
|
+
${error ? "border-red" : "border-line"}
|
|
2938
|
+
focus:border-primary
|
|
2939
|
+
resize-vertical
|
|
2940
|
+
${className}
|
|
2941
|
+
`,
|
|
2942
|
+
style: { height: `${toRemFunction2(areaHeight)}` },
|
|
2943
|
+
...props,
|
|
2944
|
+
maxLength
|
|
2945
|
+
}
|
|
2946
|
+
),
|
|
2947
|
+
maxLength && /* @__PURE__ */ jsxs19(Text, { color: "primaryText", justify: "end", children: [
|
|
2948
|
+
/* @__PURE__ */ jsx27(Text, { color: "red", children: props.value?.toString().length || 0 }),
|
|
2949
|
+
"/",
|
|
2950
|
+
maxLength
|
|
2951
|
+
] })
|
|
2952
|
+
]
|
|
2953
|
+
}
|
|
2954
|
+
)
|
|
2955
|
+
]
|
|
2956
|
+
}
|
|
2957
|
+
);
|
|
2958
|
+
};
|
|
2959
|
+
var TextArea_default = TextArea;
|
|
2960
|
+
|
|
2961
|
+
// src/components/ui/TextButton/TextButton.tsx
|
|
2962
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2963
|
+
function TextButton({
|
|
2964
|
+
text,
|
|
2965
|
+
isOpen = false,
|
|
2966
|
+
onClick,
|
|
2967
|
+
color = "primaryText",
|
|
2968
|
+
type = "arrow",
|
|
2969
|
+
size = "body14"
|
|
2970
|
+
}) {
|
|
2971
|
+
return /* @__PURE__ */ jsxs20(
|
|
2972
|
+
Stack_default,
|
|
2973
|
+
{
|
|
2974
|
+
direction: "row",
|
|
2975
|
+
align: "center",
|
|
2976
|
+
justify: "center",
|
|
2977
|
+
onClick,
|
|
2978
|
+
className: "cursor-pointer",
|
|
2979
|
+
children: [
|
|
2980
|
+
/* @__PURE__ */ jsx28(
|
|
2981
|
+
Text,
|
|
2982
|
+
{
|
|
2983
|
+
size,
|
|
2984
|
+
fontWeight: "bold",
|
|
2985
|
+
color,
|
|
2986
|
+
textDecoration: type === "underline" ? "underline" : "none",
|
|
2987
|
+
className: "leading-none",
|
|
2988
|
+
children: text
|
|
2989
|
+
}
|
|
2990
|
+
),
|
|
2991
|
+
type === "arrow" && /* @__PURE__ */ jsx28(ColorIcArrow_default, { isOpen, color })
|
|
2992
|
+
]
|
|
2993
|
+
}
|
|
2994
|
+
);
|
|
2995
|
+
}
|
|
2996
|
+
var TextButton_default = TextButton;
|
|
2997
|
+
|
|
2998
|
+
// src/components/ui/Toggle/Toggle.tsx
|
|
2999
|
+
import { forwardRef as forwardRef7, useRef as useRef3, useState as useState8, useEffect as useEffect7 } from "react";
|
|
3000
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3001
|
+
var Toggle = forwardRef7(
|
|
3002
|
+
({
|
|
3003
|
+
checked = false,
|
|
3004
|
+
onChange,
|
|
3005
|
+
label,
|
|
3006
|
+
disabled = false,
|
|
3007
|
+
size = "medium",
|
|
3008
|
+
textToggleSize = 76,
|
|
3009
|
+
className = "",
|
|
3010
|
+
id,
|
|
3011
|
+
required = false,
|
|
3012
|
+
error,
|
|
3013
|
+
tooltip,
|
|
3014
|
+
onText,
|
|
3015
|
+
offText,
|
|
3016
|
+
labelWidth,
|
|
3017
|
+
isDot = false
|
|
3018
|
+
}, ref) => {
|
|
3019
|
+
const toggleId = id || `toggle-${Math.random().toString(36).substring(2, 9)}`;
|
|
3020
|
+
const onRef = useRef3(null);
|
|
3021
|
+
const offRef = useRef3(null);
|
|
3022
|
+
const [sliderStyle, setSliderStyle] = useState8({});
|
|
3023
|
+
const handleToggle = () => {
|
|
3024
|
+
if (!disabled && onChange) {
|
|
3025
|
+
onChange(!checked);
|
|
3026
|
+
}
|
|
3027
|
+
};
|
|
3028
|
+
const handleKeyDown = (e) => {
|
|
3029
|
+
if (disabled) return;
|
|
3030
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3031
|
+
e.preventDefault();
|
|
3032
|
+
handleToggle();
|
|
3033
|
+
}
|
|
3034
|
+
};
|
|
3035
|
+
useEffect7(() => {
|
|
3036
|
+
if (!onText || !offText) return;
|
|
3037
|
+
const targetRef = checked ? onRef : offRef;
|
|
3038
|
+
if (targetRef.current) {
|
|
3039
|
+
setSliderStyle({
|
|
3040
|
+
width: targetRef.current.offsetWidth,
|
|
3041
|
+
transform: `translateX(${targetRef.current.offsetLeft - 4}px)`
|
|
3042
|
+
});
|
|
3043
|
+
}
|
|
3044
|
+
}, [checked, onText, offText]);
|
|
3045
|
+
if (onText && offText) {
|
|
3046
|
+
return /* @__PURE__ */ jsxs21(Stack_default, { direction: "row", align: "center", gap: 14, className, children: [
|
|
3047
|
+
label && /* @__PURE__ */ jsx29(
|
|
3048
|
+
Label_default,
|
|
3049
|
+
{
|
|
3050
|
+
label,
|
|
3051
|
+
width: labelWidth,
|
|
3052
|
+
required,
|
|
3053
|
+
tooltip,
|
|
3054
|
+
isDot
|
|
3055
|
+
}
|
|
3056
|
+
),
|
|
3057
|
+
/* @__PURE__ */ jsxs21(Stack_default, { direction: "col", gap: 4, className: "flex-auto", children: [
|
|
3058
|
+
/* @__PURE__ */ jsxs21(
|
|
3059
|
+
"button",
|
|
3060
|
+
{
|
|
3061
|
+
ref,
|
|
3062
|
+
id: toggleId,
|
|
3063
|
+
type: "button",
|
|
3064
|
+
role: "switch",
|
|
3065
|
+
"aria-checked": checked,
|
|
3066
|
+
disabled,
|
|
3067
|
+
onClick: handleToggle,
|
|
3068
|
+
onKeyDown: handleKeyDown,
|
|
3069
|
+
className: `
|
|
3070
|
+
relative flex items-center rounded-full h-36 p-4
|
|
3071
|
+
bg-gray1 border border-line
|
|
3072
|
+
w-fit
|
|
3073
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
|
3074
|
+
`,
|
|
3075
|
+
children: [
|
|
3076
|
+
/* @__PURE__ */ jsx29(
|
|
3077
|
+
"div",
|
|
3078
|
+
{
|
|
3079
|
+
className: "absolute h-[calc(100%-6px)] top-[3px] bg-primary rounded-full transition-all duration-300 ease-in-out",
|
|
3080
|
+
style: sliderStyle
|
|
3081
|
+
}
|
|
3082
|
+
),
|
|
3083
|
+
/* @__PURE__ */ jsx29(
|
|
3084
|
+
"span",
|
|
3085
|
+
{
|
|
3086
|
+
ref: onRef,
|
|
3087
|
+
className: `relative text-center leading-none text-body14 ${checked ? "text-white font-bold" : "font-semibold text-text"}`,
|
|
3088
|
+
style: { width: `${toRemFunction2(textToggleSize)}` },
|
|
3089
|
+
children: onText
|
|
3090
|
+
}
|
|
3091
|
+
),
|
|
3092
|
+
/* @__PURE__ */ jsx29(
|
|
3093
|
+
"span",
|
|
3094
|
+
{
|
|
3095
|
+
ref: offRef,
|
|
3096
|
+
className: `relative text-body14 leading-none ${!checked ? "text-white font-bold" : "font-semibold text-text"}`,
|
|
3097
|
+
style: { width: `${toRemFunction2(textToggleSize)}` },
|
|
3098
|
+
children: offText
|
|
3099
|
+
}
|
|
3100
|
+
)
|
|
3101
|
+
]
|
|
3102
|
+
}
|
|
3103
|
+
),
|
|
3104
|
+
error && /* @__PURE__ */ jsx29("span", { className: "text-red text-body12", children: error })
|
|
3105
|
+
] })
|
|
3106
|
+
] });
|
|
3107
|
+
}
|
|
3108
|
+
const getSizeClasses = () => {
|
|
3109
|
+
switch (size) {
|
|
3110
|
+
case "small":
|
|
3111
|
+
return "w-32 h-18";
|
|
3112
|
+
case "large":
|
|
3113
|
+
return "w-56 h-32";
|
|
3114
|
+
default:
|
|
3115
|
+
return "w-44 h-24";
|
|
3116
|
+
}
|
|
3117
|
+
};
|
|
3118
|
+
const getSliderSizeClasses = () => {
|
|
3119
|
+
switch (size) {
|
|
3120
|
+
case "small":
|
|
3121
|
+
return "w-14 h-14";
|
|
3122
|
+
case "large":
|
|
3123
|
+
return "w-28 h-28";
|
|
3124
|
+
default:
|
|
3125
|
+
return "w-20 h-20";
|
|
3126
|
+
}
|
|
3127
|
+
};
|
|
3128
|
+
return /* @__PURE__ */ jsxs21(Stack_default, { direction: "row", gap: 10, align: "center", className, children: [
|
|
3129
|
+
label && /* @__PURE__ */ jsx29(Label_default, { label, required, tooltip }),
|
|
3130
|
+
/* @__PURE__ */ jsxs21(Stack_default, { direction: "col", gap: 4, className: "flex-auto", children: [
|
|
3131
|
+
/* @__PURE__ */ jsx29(
|
|
3132
|
+
"button",
|
|
3133
|
+
{
|
|
3134
|
+
ref,
|
|
3135
|
+
id: toggleId,
|
|
3136
|
+
type: "button",
|
|
3137
|
+
role: "switch",
|
|
3138
|
+
"aria-checked": checked,
|
|
3139
|
+
"aria-labelledby": label ? `${toggleId}-label` : void 0,
|
|
3140
|
+
disabled,
|
|
3141
|
+
onClick: handleToggle,
|
|
3142
|
+
onKeyDown: handleKeyDown,
|
|
3143
|
+
className: `
|
|
3144
|
+
relative inline-flex items-center rounded-full transition-colors duration-200 ease-in-out
|
|
3145
|
+
focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
|
|
3146
|
+
${getSizeClasses()}
|
|
3147
|
+
${checked ? "bg-primary" : "bg-gray3 "}
|
|
3148
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:opacity-80"}
|
|
3149
|
+
`,
|
|
3150
|
+
tabIndex: disabled ? -1 : 0,
|
|
3151
|
+
children: /* @__PURE__ */ jsx29(
|
|
3152
|
+
"span",
|
|
3153
|
+
{
|
|
3154
|
+
className: `
|
|
3155
|
+
inline-block rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out
|
|
3156
|
+
${getSliderSizeClasses()}
|
|
3157
|
+
${checked ? "translate-x-22" : "translate-x-2"}
|
|
3158
|
+
${size === "large" ? "translate-x-8" : ""}
|
|
3159
|
+
${size === "small" ? "translate-x-4" : ""}
|
|
3160
|
+
`
|
|
3161
|
+
}
|
|
3162
|
+
)
|
|
3163
|
+
}
|
|
3164
|
+
),
|
|
3165
|
+
error && /* @__PURE__ */ jsx29("span", { className: "text-red text-body12", children: error })
|
|
3166
|
+
] })
|
|
3167
|
+
] });
|
|
3168
|
+
}
|
|
3169
|
+
);
|
|
3170
|
+
Toggle.displayName = "Toggle";
|
|
3171
|
+
var Toggle_default = Toggle;
|
|
3172
|
+
|
|
3173
|
+
// src/components/ui/ToolTipBox/ToolTipBox.tsx
|
|
3174
|
+
import { useState as useState9, useRef as useRef4, useEffect as useEffect8 } from "react";
|
|
3175
|
+
|
|
3176
|
+
// src/assets/colorIcon/ColorIcTooltipArrow.tsx
|
|
3177
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3178
|
+
function ColorIcTooltipArrow({
|
|
3179
|
+
width = 14,
|
|
3180
|
+
height = 14,
|
|
3181
|
+
color = "primary"
|
|
3182
|
+
}) {
|
|
3183
|
+
return /* @__PURE__ */ jsx30(
|
|
3184
|
+
"svg",
|
|
3185
|
+
{
|
|
3186
|
+
width,
|
|
3187
|
+
height,
|
|
3188
|
+
viewBox: "0 0 14 14",
|
|
3189
|
+
fill: "none",
|
|
3190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3191
|
+
style: { color: `var(--color-${color})` },
|
|
3192
|
+
children: /* @__PURE__ */ jsx30(
|
|
3193
|
+
"path",
|
|
3194
|
+
{
|
|
3195
|
+
d: "M12.0309 9.9748C11.8996 9.9748 11.7902 9.93106 11.6809 9.84356L6.99961 5.22793L2.31836 9.82168C2.12148 10.0186 1.81523 10.0186 1.61836 9.82168C1.42148 9.62481 1.42148 9.31856 1.61836 9.12168L6.64961 4.17793C6.84648 3.98105 7.15273 3.98105 7.34961 4.17793L12.3809 9.12168C12.5777 9.31856 12.5777 9.62481 12.3809 9.82168C12.2934 9.90918 12.1621 9.9748 12.0309 9.9748Z",
|
|
3196
|
+
fill: "currentColor"
|
|
3197
|
+
}
|
|
3198
|
+
)
|
|
3199
|
+
}
|
|
3200
|
+
);
|
|
3201
|
+
}
|
|
3202
|
+
var ColorIcTooltipArrow_default = ColorIcTooltipArrow;
|
|
3203
|
+
|
|
3204
|
+
// src/assets/colorIcon/ColorIcTooltipBlue.tsx
|
|
3205
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3206
|
+
function ColorIcTooltipBlue({
|
|
3207
|
+
width = 16,
|
|
3208
|
+
height = 16,
|
|
3209
|
+
color = "primary"
|
|
3210
|
+
}) {
|
|
3211
|
+
return /* @__PURE__ */ jsxs22(
|
|
3212
|
+
"svg",
|
|
3213
|
+
{
|
|
3214
|
+
width,
|
|
3215
|
+
height,
|
|
3216
|
+
viewBox: "0 0 16 16",
|
|
3217
|
+
fill: "none",
|
|
3218
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3219
|
+
style: { color: `var(--color-${color})` },
|
|
3220
|
+
children: [
|
|
3221
|
+
/* @__PURE__ */ jsxs22("g", { clipPath: "url(#clip0_175_11783)", children: [
|
|
3222
|
+
/* @__PURE__ */ jsx31(
|
|
3223
|
+
"path",
|
|
3224
|
+
{
|
|
3225
|
+
d: "M7.9744 4.87305H7.95015C7.65924 4.87305 7.39258 5.11547 7.39258 5.43062C7.39258 5.74577 7.635 5.9882 7.95015 5.9882H7.9744C8.26531 5.9882 8.53197 5.74577 8.53197 5.43062C8.53197 5.11547 8.28955 4.87305 7.9744 4.87305Z",
|
|
3226
|
+
fill: "currentColor"
|
|
3227
|
+
}
|
|
3228
|
+
),
|
|
3229
|
+
/* @__PURE__ */ jsx31(
|
|
3230
|
+
"path",
|
|
3231
|
+
{
|
|
3232
|
+
d: "M7.97554 6.78809C7.68464 6.78809 7.41797 7.03051 7.41797 7.34566V11.079C7.41797 11.3699 7.66039 11.6366 7.97554 11.6366C8.26645 11.6366 8.53312 11.3941 8.53312 11.079V7.32142C8.53312 7.03051 8.2907 6.78809 7.97554 6.78809Z",
|
|
3233
|
+
fill: "currentColor"
|
|
3234
|
+
}
|
|
3235
|
+
),
|
|
3236
|
+
/* @__PURE__ */ jsx31(
|
|
3237
|
+
"path",
|
|
3238
|
+
{
|
|
3239
|
+
d: "M7.97631 0.678711C3.92783 0.678711 0.630859 3.95144 0.630859 7.99992C0.630859 12.0484 3.92783 15.3454 7.97631 15.3454C12.0248 15.3454 15.2975 12.0484 15.2975 7.99992C15.2975 3.95144 12.0248 0.678711 7.97631 0.678711ZM7.97631 14.2545C4.53389 14.2545 1.72177 11.4423 1.72177 7.99992C1.72177 4.5575 4.53389 1.74538 7.97631 1.74538C11.4187 1.74538 14.2066 4.5575 14.2066 7.99992C14.2066 11.4423 11.4187 14.2545 7.97631 14.2545Z",
|
|
3240
|
+
fill: "currentColor"
|
|
3241
|
+
}
|
|
3242
|
+
)
|
|
3243
|
+
] }),
|
|
3244
|
+
/* @__PURE__ */ jsx31("defs", { children: /* @__PURE__ */ jsx31("clipPath", { id: "clip0_175_11783", children: /* @__PURE__ */ jsx31("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
3245
|
+
]
|
|
3246
|
+
}
|
|
3247
|
+
);
|
|
3248
|
+
}
|
|
3249
|
+
var ColorIcTooltipBlue_default = ColorIcTooltipBlue;
|
|
3250
|
+
|
|
3251
|
+
// src/components/ui/ToolTipBox/ToolTipBox.tsx
|
|
3252
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3253
|
+
function ToolTipBox({ title, children }) {
|
|
3254
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
3255
|
+
const contentRef = useRef4(null);
|
|
3256
|
+
const [contentHeight, setContentHeight] = useState9(0);
|
|
3257
|
+
useEffect8(() => {
|
|
3258
|
+
if (contentRef.current) {
|
|
3259
|
+
setContentHeight(contentRef.current.scrollHeight);
|
|
3260
|
+
}
|
|
3261
|
+
}, [children]);
|
|
3262
|
+
return /* @__PURE__ */ jsx32(
|
|
3263
|
+
BorderRadiusBox_default,
|
|
3264
|
+
{
|
|
3265
|
+
borderColor: "primary3Border",
|
|
3266
|
+
bgColor: "primary3",
|
|
3267
|
+
paddingX: 20,
|
|
3268
|
+
paddingY: 12,
|
|
3269
|
+
children: /* @__PURE__ */ jsxs23(Stack_default, { direction: "col", children: [
|
|
3270
|
+
/* @__PURE__ */ jsxs23(
|
|
3271
|
+
Stack_default,
|
|
3272
|
+
{
|
|
3273
|
+
direction: "row",
|
|
3274
|
+
gap: 3,
|
|
3275
|
+
align: "center",
|
|
3276
|
+
justify: "between",
|
|
3277
|
+
onClick: () => {
|
|
3278
|
+
setIsOpen(!isOpen);
|
|
3279
|
+
},
|
|
3280
|
+
className: "cursor-pointer",
|
|
3281
|
+
children: [
|
|
3282
|
+
/* @__PURE__ */ jsxs23(Stack_default, { direction: "row", gap: 3, align: "center", children: [
|
|
3283
|
+
/* @__PURE__ */ jsx32(ColorIcTooltipBlue_default, { width: 14, height: 14 }),
|
|
3284
|
+
/* @__PURE__ */ jsx32(Text, { size: "body14", fontWeight: "bold", color: "primary", children: title })
|
|
3285
|
+
] }),
|
|
3286
|
+
/* @__PURE__ */ jsx32("span", { className: `w-16 h-16 cursor-pointer transition-transform duration-300 ${isOpen ? "" : "rotate-180"}`, children: /* @__PURE__ */ jsx32(ColorIcTooltipArrow_default, { width: 14, height: 14, color: "primary" }) })
|
|
3287
|
+
]
|
|
3288
|
+
}
|
|
3289
|
+
),
|
|
3290
|
+
/* @__PURE__ */ jsx32(
|
|
3291
|
+
"div",
|
|
3292
|
+
{
|
|
3293
|
+
className: "overflow-hidden transition-all duration-300 ease-in-out",
|
|
3294
|
+
style: {
|
|
3295
|
+
height: isOpen ? `${contentHeight}px` : "0px",
|
|
3296
|
+
opacity: isOpen ? 1 : 0
|
|
3297
|
+
},
|
|
3298
|
+
children: /* @__PURE__ */ jsx32("div", { ref: contentRef, className: "grid grid-cols-2 gap-2 mt-4", children: children.map((child, index) => /* @__PURE__ */ jsx32(
|
|
3299
|
+
BulletText_default,
|
|
3300
|
+
{
|
|
3301
|
+
label: child,
|
|
3302
|
+
textColor: "primary",
|
|
3303
|
+
textSize: "body12",
|
|
3304
|
+
fontWeight: "regular",
|
|
3305
|
+
bulletColor: "dark6"
|
|
3306
|
+
},
|
|
3307
|
+
index
|
|
3308
|
+
)) })
|
|
3309
|
+
}
|
|
3310
|
+
)
|
|
3311
|
+
] })
|
|
3312
|
+
}
|
|
3313
|
+
);
|
|
3314
|
+
}
|
|
3315
|
+
var ToolTipBox_default = ToolTipBox;
|
|
3316
|
+
|
|
3317
|
+
// src/components/ui/TooltipInfo/TooltipInfo.tsx
|
|
3318
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3319
|
+
function TooltipInfo({ title, children }) {
|
|
3320
|
+
return /* @__PURE__ */ jsx33(
|
|
3321
|
+
BorderRadiusBox_default,
|
|
3322
|
+
{
|
|
3323
|
+
radius: 6,
|
|
3324
|
+
paddingX: 0,
|
|
3325
|
+
paddingY: 0,
|
|
3326
|
+
className: " border-none overflow-hidden",
|
|
3327
|
+
children: /* @__PURE__ */ jsx33("div", { style: { backgroundColor: "#4B5563E5" }, className: "px-12 py-10", children: /* @__PURE__ */ jsxs24(Stack_default, { gap: 5, direction: "col", children: [
|
|
3328
|
+
/* @__PURE__ */ jsx33(
|
|
3329
|
+
Text,
|
|
3330
|
+
{
|
|
3331
|
+
size: "body14",
|
|
3332
|
+
fontWeight: "bold",
|
|
3333
|
+
color: "white",
|
|
3334
|
+
className: "whitespace-nowrap",
|
|
3335
|
+
style: {
|
|
3336
|
+
lineHeight: "1.4"
|
|
3337
|
+
},
|
|
3338
|
+
children: title
|
|
3339
|
+
}
|
|
3340
|
+
),
|
|
3341
|
+
/* @__PURE__ */ jsx33(Stack_default, { gap: 2, direction: "col", children: children.map((child, index) => /* @__PURE__ */ jsxs24(
|
|
3342
|
+
"div",
|
|
3343
|
+
{
|
|
3344
|
+
className: `whitespace-nowrap flex items-baseline flex-none relative w-full`,
|
|
3345
|
+
children: [
|
|
3346
|
+
/* @__PURE__ */ jsx33(
|
|
3347
|
+
"span",
|
|
3348
|
+
{
|
|
3349
|
+
className: "inline-block w-3 h-3 bg-dark6 mr-4 ",
|
|
3350
|
+
style: {
|
|
3351
|
+
verticalAlign: "top",
|
|
3352
|
+
position: "relative",
|
|
3353
|
+
top: "-2px"
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
),
|
|
3357
|
+
/* @__PURE__ */ jsx33(
|
|
3358
|
+
Text,
|
|
3359
|
+
{
|
|
3360
|
+
size: "body12",
|
|
3361
|
+
color: "white",
|
|
3362
|
+
fontWeight: "regular",
|
|
3363
|
+
style: {
|
|
3364
|
+
lineHeight: "1.4"
|
|
3365
|
+
},
|
|
3366
|
+
children: child
|
|
3367
|
+
},
|
|
3368
|
+
"tooltipInfoText" + index
|
|
3369
|
+
)
|
|
3370
|
+
]
|
|
3371
|
+
},
|
|
3372
|
+
"tooltipInfo" + index
|
|
3373
|
+
)) })
|
|
3374
|
+
] }) })
|
|
3375
|
+
},
|
|
3376
|
+
"tooltipInfo"
|
|
3377
|
+
);
|
|
3378
|
+
}
|
|
3379
|
+
var TooltipInfo_default = TooltipInfo;
|
|
3380
|
+
|
|
3381
|
+
// src/assets/colorIcon/ColorIcInfo.tsx
|
|
3382
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3383
|
+
function ColorIcInfo({
|
|
3384
|
+
width = 12,
|
|
3385
|
+
height = 12,
|
|
3386
|
+
color = "gray"
|
|
3387
|
+
}) {
|
|
3388
|
+
return /* @__PURE__ */ jsx34(
|
|
3389
|
+
"span",
|
|
3390
|
+
{
|
|
3391
|
+
style: {
|
|
3392
|
+
color: `var(--color-${color})`,
|
|
3393
|
+
display: "inline-flex",
|
|
3394
|
+
alignItems: "center",
|
|
3395
|
+
justifyContent: "center"
|
|
3396
|
+
},
|
|
3397
|
+
children: /* @__PURE__ */ jsxs25(
|
|
3398
|
+
"svg",
|
|
3399
|
+
{
|
|
3400
|
+
width,
|
|
3401
|
+
height,
|
|
3402
|
+
viewBox: "0 0 12 12",
|
|
3403
|
+
fill: "none",
|
|
3404
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3405
|
+
children: [
|
|
3406
|
+
/* @__PURE__ */ jsx34("rect", { width: "12", height: "12", rx: "6", fill: "currentColor" }),
|
|
3407
|
+
/* @__PURE__ */ jsxs25("g", { clipPath: "url(#clip0_603_10414)", children: [
|
|
3408
|
+
/* @__PURE__ */ jsx34(
|
|
3409
|
+
"path",
|
|
3410
|
+
{
|
|
3411
|
+
d: "M6.81978 8.68161H6.09194V4.57706C6.09194 4.24297 5.81751 3.98047 5.49535 3.98047H4.82717C4.68398 3.98047 4.55273 4.09979 4.55273 4.2549C4.55273 4.41001 4.67205 4.52933 4.82717 4.52933H5.49535C5.53114 4.52933 5.55501 4.5532 5.55501 4.58899V8.68161H4.82717C4.68398 8.68161 4.55273 8.80092 4.55273 8.95604C4.55273 9.11115 4.67205 9.23047 4.82717 9.23047H6.83171C6.97489 9.23047 7.10614 9.11115 7.10614 8.95604C7.10614 8.80092 6.96296 8.68161 6.81978 8.68161Z",
|
|
3412
|
+
fill: "white"
|
|
3413
|
+
}
|
|
3414
|
+
),
|
|
3415
|
+
/* @__PURE__ */ jsx34(
|
|
3416
|
+
"path",
|
|
3417
|
+
{
|
|
3418
|
+
d: "M5.75835 3.3956C5.95604 3.3956 6.1163 3.23533 6.1163 3.03764C6.1163 2.83995 5.95604 2.67969 5.75835 2.67969C5.56065 2.67969 5.40039 2.83995 5.40039 3.03764C5.40039 3.23533 5.56065 3.3956 5.75835 3.3956Z",
|
|
3419
|
+
fill: "white"
|
|
3420
|
+
}
|
|
3421
|
+
)
|
|
3422
|
+
] }),
|
|
3423
|
+
/* @__PURE__ */ jsx34("defs", { children: /* @__PURE__ */ jsx34("clipPath", { id: "clip0_603_10414", children: /* @__PURE__ */ jsx34(
|
|
3424
|
+
"rect",
|
|
3425
|
+
{
|
|
3426
|
+
width: "7.63636",
|
|
3427
|
+
height: "7.63636",
|
|
3428
|
+
fill: "white",
|
|
3429
|
+
transform: "translate(2 2)"
|
|
3430
|
+
}
|
|
3431
|
+
) }) })
|
|
3432
|
+
]
|
|
3433
|
+
}
|
|
3434
|
+
)
|
|
3435
|
+
}
|
|
3436
|
+
);
|
|
3437
|
+
}
|
|
3438
|
+
var ColorIcInfo_default = ColorIcInfo;
|
|
3439
|
+
|
|
3440
|
+
// src/assets/colorIcon/ColorIcWarning.tsx
|
|
3441
|
+
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3442
|
+
function ColorIcWarning({
|
|
3443
|
+
width = 16,
|
|
3444
|
+
height = 16,
|
|
3445
|
+
color = "warning"
|
|
3446
|
+
}) {
|
|
3447
|
+
return /* @__PURE__ */ jsx35(
|
|
3448
|
+
"span",
|
|
3449
|
+
{
|
|
3450
|
+
style: {
|
|
3451
|
+
color: `var(--color-${color})`,
|
|
3452
|
+
display: "inline-flex",
|
|
3453
|
+
alignItems: "center",
|
|
3454
|
+
justifyContent: "center"
|
|
3455
|
+
},
|
|
3456
|
+
children: /* @__PURE__ */ jsxs26(
|
|
3457
|
+
"svg",
|
|
3458
|
+
{
|
|
3459
|
+
width,
|
|
3460
|
+
height,
|
|
3461
|
+
viewBox: "0 0 16 16",
|
|
3462
|
+
fill: "none",
|
|
3463
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3464
|
+
children: [
|
|
3465
|
+
/* @__PURE__ */ jsx35("rect", { width: "16", height: "16", rx: "8", fill: "currentColor" }),
|
|
3466
|
+
/* @__PURE__ */ jsx35(
|
|
3467
|
+
"path",
|
|
3468
|
+
{
|
|
3469
|
+
d: "M12.5343 9.47947L9.1297 4.00144C8.85925 3.63553 8.44561 3.42871 8.00016 3.42871C7.53879 3.42871 7.12516 3.63553 6.87061 4.00144L3.46607 9.47947C3.14789 9.90901 3.10016 10.4658 3.3388 10.9431C3.57743 11.4204 4.0547 11.7227 4.59561 11.7227H11.4047C11.9456 11.7227 12.4229 11.4204 12.6615 10.9431C12.9002 10.4817 12.8524 9.90901 12.5343 9.47947ZM12.0252 10.6249C11.8979 10.8636 11.6752 11.0067 11.4047 11.0067H4.59561C4.32516 11.0067 4.10243 10.8636 3.97516 10.6249C3.8638 10.3863 3.8797 10.1158 4.0388 9.90901L7.44334 4.43098C7.57061 4.25598 7.77743 4.14462 8.00016 4.14462C8.22289 4.14462 8.4297 4.24007 8.55698 4.43098L11.9615 9.90901C12.1206 10.1158 12.1365 10.3863 12.0252 10.6249Z",
|
|
3470
|
+
fill: "white"
|
|
3471
|
+
}
|
|
3472
|
+
),
|
|
3473
|
+
/* @__PURE__ */ jsx35(
|
|
3474
|
+
"path",
|
|
3475
|
+
{
|
|
3476
|
+
d: "M8.00067 6.3877C7.80977 6.3877 7.63477 6.54679 7.63477 6.7536V8.4877C7.63477 8.6786 7.79386 8.8536 8.00067 8.8536C8.20749 8.8536 8.36658 8.69451 8.36658 8.4877V6.7377C8.36658 6.54679 8.19158 6.3877 8.00067 6.3877Z",
|
|
3477
|
+
fill: "white"
|
|
3478
|
+
}
|
|
3479
|
+
),
|
|
3480
|
+
/* @__PURE__ */ jsx35(
|
|
3481
|
+
"path",
|
|
3482
|
+
{
|
|
3483
|
+
d: "M8.00067 9.27246C7.80977 9.27246 7.63477 9.43155 7.63477 9.63837V9.71792C7.63477 9.90882 7.79386 10.0838 8.00067 10.0838C8.20749 10.0838 8.36658 9.92473 8.36658 9.71792V9.62246C8.36658 9.43155 8.19158 9.27246 8.00067 9.27246Z",
|
|
3484
|
+
fill: "white"
|
|
3485
|
+
}
|
|
3486
|
+
)
|
|
3487
|
+
]
|
|
3488
|
+
}
|
|
3489
|
+
)
|
|
3490
|
+
}
|
|
3491
|
+
);
|
|
3492
|
+
}
|
|
3493
|
+
var ColorIcWarning_default = ColorIcWarning;
|
|
3494
|
+
|
|
3495
|
+
// src/components/ui/WarningBox/WarningBox.tsx
|
|
3496
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3497
|
+
var WarningBox = ({
|
|
3498
|
+
children,
|
|
3499
|
+
color = "warning"
|
|
3500
|
+
}) => {
|
|
3501
|
+
const colorClass = `bg-${color}Light text-${color} `;
|
|
3502
|
+
const iconSize = color === "text" ? 14 : 16;
|
|
3503
|
+
const icon = color === "text" ? /* @__PURE__ */ jsx36(ColorIcInfo_default, { width: iconSize, height: iconSize }) : /* @__PURE__ */ jsx36(ColorIcWarning_default, { width: iconSize, height: iconSize });
|
|
3504
|
+
return /* @__PURE__ */ jsx36(
|
|
3505
|
+
"div",
|
|
3506
|
+
{
|
|
3507
|
+
className: `opacity-80 relative ${colorClass} rounded-sm pl-2 before:content-[''] before:absolute before:left-0 before:top-0 before:bottom-0 before:w-[50px] ${color === "text" ? "before:bg-text" : "before:bg-warning"} before:rounded-tl-warnOut before:rounded-bl-warnOut `,
|
|
3508
|
+
children: /* @__PURE__ */ jsx36(
|
|
3509
|
+
"div",
|
|
3510
|
+
{
|
|
3511
|
+
className: `relative ${colorClass} inline-block text-body12 font-bold px-12 py-8 rounded-warn touch-none`,
|
|
3512
|
+
children: /* @__PURE__ */ jsxs27(Stack_default, { direction: "row", align: "start", gap: 4, children: [
|
|
3513
|
+
/* @__PURE__ */ jsx36("span", { className: `${color === "text" ? "mt-4" : "mt-3"}`, children: icon }),
|
|
3514
|
+
children
|
|
3515
|
+
] })
|
|
3516
|
+
}
|
|
3517
|
+
)
|
|
3518
|
+
}
|
|
3519
|
+
);
|
|
3520
|
+
};
|
|
3521
|
+
var WarningBox_default = WarningBox;
|
|
157
3522
|
export {
|
|
3523
|
+
BorderRadiusBox_default as BorderRadiusBox,
|
|
3524
|
+
BulletText_default as BulletText,
|
|
3525
|
+
Button_default as Button,
|
|
3526
|
+
Checkbox_default as Checkbox,
|
|
3527
|
+
CommonTable_default as CommonTable,
|
|
3528
|
+
Divider_default as Divider,
|
|
3529
|
+
EmailInput_default as EmailInput,
|
|
3530
|
+
Input_default as Input,
|
|
3531
|
+
Label_default as Label,
|
|
3532
|
+
MultiSelectCheckbox_default as MultiSelectCheckbox,
|
|
3533
|
+
Paging,
|
|
3534
|
+
Radio_default as Radio,
|
|
3535
|
+
RequiredDot_default as RequiredDot,
|
|
3536
|
+
SelectBox_default as SelectBox,
|
|
3537
|
+
Stack_default as Stack,
|
|
3538
|
+
Table_default as Table,
|
|
3539
|
+
TableTop_default as TableTop,
|
|
3540
|
+
Tag,
|
|
3541
|
+
TagInput_default as TagInput,
|
|
158
3542
|
Text,
|
|
3543
|
+
TextArea_default as TextArea,
|
|
3544
|
+
TextButton_default as TextButton,
|
|
3545
|
+
Toggle_default as Toggle,
|
|
3546
|
+
ToolTipBox_default as ToolTipBox,
|
|
3547
|
+
Tooltip_default as Tooltip,
|
|
3548
|
+
TooltipInfo_default as TooltipInfo,
|
|
3549
|
+
WarningBox_default as WarningBox,
|
|
159
3550
|
alignSelfs,
|
|
160
3551
|
aligns,
|
|
161
3552
|
colors,
|