@x-plat/design-system 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2EGVOUGV.cjs +93 -0
- package/dist/chunk-2T3BVV7R.js +0 -0
- package/dist/chunk-3FYYFDKQ.js +159 -0
- package/dist/chunk-3M3GFSHJ.js +67 -0
- package/dist/chunk-3WBHUFOA.cjs +48 -0
- package/dist/chunk-3XYYZQR5.cjs +22 -0
- package/dist/chunk-4EF7NVAL.js +67 -0
- package/dist/chunk-4ISERXK2.cjs +1 -0
- package/dist/chunk-4KYHHJ6Z.cjs +250 -0
- package/dist/chunk-4NSRDRXC.cjs +70 -0
- package/dist/chunk-4OXMRSVE.cjs +99 -0
- package/dist/chunk-55EPYLXN.js +30 -0
- package/dist/chunk-5CE3ADO5.js +254 -0
- package/dist/chunk-5F6Y2JD6.cjs +1 -0
- package/dist/chunk-5FMTMXSP.cjs +127 -0
- package/dist/chunk-5POCKDDY.js +36 -0
- package/dist/chunk-5VDI56BV.js +33 -0
- package/dist/chunk-5WLBUPSK.js +77 -0
- package/dist/chunk-5WNNWQHD.cjs +272 -0
- package/dist/chunk-66STZB6I.cjs +404 -0
- package/dist/chunk-6AIKCZN7.js +1455 -0
- package/dist/chunk-6IUJJUVP.js +18 -0
- package/dist/chunk-6P2B3ZGP.js +79 -0
- package/dist/chunk-764ILIDG.cjs +22 -0
- package/dist/chunk-7B44DWC4.js +0 -0
- package/dist/chunk-7BE6ETFY.js +18 -0
- package/dist/chunk-7BSUS5A4.js +97 -0
- package/dist/chunk-7RPWCDEW.cjs +20 -0
- package/dist/chunk-7ULXHGLO.cjs +77 -0
- package/dist/chunk-7YOI5XOW.js +55 -0
- package/dist/chunk-AFVTM5CP.js +0 -0
- package/dist/chunk-AN2WSL3B.cjs +1 -0
- package/dist/chunk-AT5Y5GLS.cjs +118 -0
- package/dist/chunk-AWPO2FI7.js +404 -0
- package/dist/chunk-BGXHIDUR.js +103 -0
- package/dist/chunk-BPZXL5TP.js +99 -0
- package/dist/chunk-BRTS5GWV.js +275 -0
- package/dist/chunk-BS3MLZCK.cjs +97 -0
- package/dist/chunk-BSPYYE2U.js +36 -0
- package/dist/chunk-BWJAEB42.js +48 -0
- package/dist/chunk-C4RMTISI.cjs +18 -0
- package/dist/chunk-C6M4XVR7.cjs +36 -0
- package/dist/chunk-CGC4D5MP.cjs +89 -0
- package/dist/chunk-CIRQYSQW.js +70 -0
- package/dist/chunk-CLOTWJNP.cjs +310 -0
- package/dist/chunk-CS7ZY35M.cjs +49 -0
- package/dist/chunk-CUV4RLDE.js +89 -0
- package/dist/chunk-CZAMLFSE.cjs +275 -0
- package/dist/chunk-D7QZLJ3Z.cjs +18 -0
- package/dist/chunk-DMSAAZ3M.cjs +92 -0
- package/dist/chunk-DUIZC7VJ.cjs +36 -0
- package/dist/chunk-DVBF4BDH.js +43 -0
- package/dist/chunk-EETYMP6K.cjs +584 -0
- package/dist/chunk-EFQL7JPX.js +0 -0
- package/dist/chunk-EFU7IAF5.cjs +12 -0
- package/dist/chunk-F3M2H5EX.cjs +79 -0
- package/dist/chunk-F436V2SX.cjs +254 -0
- package/dist/chunk-F664X2OY.js +250 -0
- package/dist/chunk-FF7ELUQW.cjs +1 -0
- package/dist/chunk-G3HE4S3Q.cjs +296 -0
- package/dist/chunk-GOPD5KUK.js +23 -0
- package/dist/chunk-GYTB24V6.cjs +107 -0
- package/dist/chunk-GZ657SGO.js +310 -0
- package/dist/chunk-H2QN65L6.cjs +1 -0
- package/dist/chunk-H6WUT7CK.js +22 -0
- package/dist/chunk-H76OQ75T.js +49 -0
- package/dist/chunk-HA3XONYI.js +18 -0
- package/dist/chunk-HF3UFXEU.js +296 -0
- package/dist/chunk-HGA47QVV.cjs +55 -0
- package/dist/chunk-HHPPAMXF.cjs +674 -0
- package/dist/chunk-HLV2XIE2.cjs +385 -0
- package/dist/chunk-HNQGIL45.cjs +96 -0
- package/dist/chunk-HQ37R7T3.js +53 -0
- package/dist/chunk-HXUGW4RR.js +187 -0
- package/dist/chunk-HYPRLWD3.js +272 -0
- package/dist/chunk-I7TLJUTP.cjs +6 -0
- package/dist/chunk-ICTWDTKC.cjs +1 -0
- package/dist/chunk-IPYKHDP4.cjs +187 -0
- package/dist/chunk-IRKREQ2X.cjs +18 -0
- package/dist/chunk-IVJJBMRY.js +92 -0
- package/dist/chunk-JPVIVOFG.js +26 -0
- package/dist/chunk-JYNBNSNF.js +151 -0
- package/dist/chunk-JZC3BXAC.js +93 -0
- package/dist/chunk-K5XPQWXN.cjs +92 -0
- package/dist/chunk-KQ3GOMHL.js +31 -0
- package/dist/chunk-KUJH72U6.cjs +159 -0
- package/dist/chunk-KVUXLC6M.cjs +479 -0
- package/dist/chunk-KZOJN57Q.js +19 -0
- package/dist/chunk-L3XPL4NP.cjs +53 -0
- package/dist/chunk-LOEMSXYB.js +0 -0
- package/dist/chunk-LU4KBPNG.cjs +23 -0
- package/dist/chunk-MWWWPQDB.js +26 -0
- package/dist/chunk-NCBB3WUJ.js +562 -0
- package/dist/chunk-NGCZTZST.cjs +562 -0
- package/dist/chunk-NSDKALIS.cjs +67 -0
- package/dist/chunk-NZHCRLNB.cjs +26 -0
- package/dist/chunk-OL4NANHB.js +0 -0
- package/dist/chunk-OTJRNKLR.js +96 -0
- package/dist/chunk-OWWFKTSK.js +0 -0
- package/dist/chunk-P2E3PB62.cjs +99 -0
- package/dist/chunk-P2QVFR7S.js +20 -0
- package/dist/chunk-P6ZGIYY7.cjs +18 -0
- package/dist/chunk-PFGSJJRY.cjs +19 -0
- package/dist/chunk-PNIUW7AJ.cjs +32 -0
- package/dist/chunk-Q2M2ONGO.js +70 -0
- package/dist/chunk-Q4PGP5KE.cjs +562 -0
- package/dist/chunk-QAI2YQPY.cjs +51 -0
- package/dist/chunk-QCD7UEZ3.cjs +59 -0
- package/dist/chunk-QEZ4R3SK.js +6 -0
- package/dist/chunk-QKDCPM2D.cjs +23 -0
- package/dist/chunk-QRGG3V7W.cjs +59 -0
- package/dist/chunk-QURIHUEC.js +107 -0
- package/dist/chunk-QY742LWN.js +30 -0
- package/dist/chunk-QYMRGYTN.js +127 -0
- package/dist/chunk-RLKJ2RZG.js +23 -0
- package/dist/chunk-RRR5BUOM.cjs +30 -0
- package/dist/chunk-RU3FCVXM.cjs +1 -0
- package/dist/chunk-RYTDVTV2.js +32 -0
- package/dist/chunk-RYYGUYDE.js +92 -0
- package/dist/chunk-SGLP4U3Y.cjs +67 -0
- package/dist/chunk-SJC543ZK.js +71 -0
- package/dist/chunk-SLYQK4SC.js +20 -0
- package/dist/chunk-SMLCOMLS.js +2888 -0
- package/dist/chunk-SNMOPLMH.cjs +372 -0
- package/dist/chunk-TRJUJYW7.cjs +151 -0
- package/dist/chunk-TTY5PE3P.js +30 -0
- package/dist/chunk-TXARYG3J.js +22 -0
- package/dist/chunk-TYXJU4EF.js +18 -0
- package/dist/chunk-U3PC7FYZ.cjs +26 -0
- package/dist/chunk-U67JM2WL.cjs +34 -0
- package/dist/chunk-UARGO5UG.js +59 -0
- package/dist/chunk-UCYE3H3F.cjs +43 -0
- package/dist/chunk-UGEGN35F.js +118 -0
- package/dist/chunk-UHUA3GQC.cjs +30 -0
- package/dist/chunk-UJQN477L.js +59 -0
- package/dist/chunk-UMX7DTFZ.cjs +70 -0
- package/dist/chunk-UT42P54P.js +372 -0
- package/dist/chunk-V76ZRGHQ.cjs +1 -0
- package/dist/chunk-VCIK366Y.cjs +1455 -0
- package/dist/chunk-VMA74ABT.cjs +137 -0
- package/dist/chunk-VSA62N2O.js +12 -0
- package/dist/chunk-WDAFLVQK.js +479 -0
- package/dist/chunk-WHMLMAMO.js +674 -0
- package/dist/chunk-WNBLKKLM.js +0 -0
- package/dist/chunk-WQ2GY7F3.js +46 -0
- package/dist/chunk-WRLCCK3M.cjs +30 -0
- package/dist/chunk-WVCZIOLY.js +562 -0
- package/dist/chunk-WZLGJQLW.js +385 -0
- package/dist/chunk-XB6FEBK6.js +34 -0
- package/dist/chunk-XMERDSRE.js +75 -0
- package/dist/chunk-XMLFKZYY.js +137 -0
- package/dist/chunk-XMM52J3T.js +584 -0
- package/dist/chunk-XZ7C5CGB.cjs +103 -0
- package/dist/chunk-YGFBAOKX.js +51 -0
- package/dist/chunk-YIN552MF.cjs +20 -0
- package/dist/chunk-YLC42E65.cjs +31 -0
- package/dist/chunk-YOTXRYJL.cjs +46 -0
- package/dist/chunk-ZAUGJZK7.js +99 -0
- package/dist/chunk-ZIZOQTDG.cjs +75 -0
- package/dist/chunk-ZMSV5VZI.cjs +2888 -0
- package/dist/chunk-ZN6MLZAE.cjs +71 -0
- package/dist/chunk-ZNCT6HXA.cjs +33 -0
- package/dist/components/Accordion/index.cjs +5 -1036
- package/dist/components/Accordion/index.js +5 -999
- package/dist/components/Alert/index.cjs +4 -69
- package/dist/components/Alert/index.js +4 -42
- package/dist/components/AutoResizeTextArea/index.cjs +6 -260
- package/dist/components/AutoResizeTextArea/index.js +6 -223
- package/dist/components/Avatar/index.cjs +4 -65
- package/dist/components/Avatar/index.js +4 -38
- package/dist/components/Badge/index.cjs +6 -69
- package/dist/components/Badge/index.js +5 -40
- package/dist/components/Box/index.cjs +4 -58
- package/dist/components/Box/index.js +4 -31
- package/dist/components/Breadcrumb/index.cjs +4 -42
- package/dist/components/Breadcrumb/index.js +3 -14
- package/dist/components/Button/index.cjs +5 -65
- package/dist/components/Button/index.js +5 -38
- package/dist/components/Calendar/index.cjs +6 -1317
- package/dist/components/Calendar/index.js +10 -1281
- package/dist/components/CardTab/index.cjs +4 -120
- package/dist/components/CardTab/index.js +4 -83
- package/dist/components/Chart/index.cjs +5 -708
- package/dist/components/Chart/index.js +4 -670
- package/dist/components/ChatInput/index.cjs +9 -390
- package/dist/components/ChatInput/index.js +9 -353
- package/dist/components/CheckBox/index.cjs +20 -1125
- package/dist/components/CheckBox/index.js +17 -1095
- package/dist/components/Chip/index.cjs +5 -55
- package/dist/components/Chip/index.js +5 -28
- package/dist/components/DatePicker/index.cjs +16 -2136
- package/dist/components/DatePicker/index.js +19 -2099
- package/dist/components/Divider/index.cjs +4 -58
- package/dist/components/Divider/index.js +4 -31
- package/dist/components/Drawer/index.cjs +5 -190
- package/dist/components/Drawer/index.js +5 -153
- package/dist/components/Dropdown/index.cjs +7 -375
- package/dist/components/Dropdown/index.js +7 -338
- package/dist/components/Editor/index.cjs +6 -1486
- package/dist/components/Editor/index.css +53 -0
- package/dist/components/Editor/index.d.cts +13 -0
- package/dist/components/Editor/index.d.ts +13 -0
- package/dist/components/Editor/index.js +6 -1453
- package/dist/components/EmptyState/index.cjs +4 -42
- package/dist/components/EmptyState/index.js +3 -14
- package/dist/components/FieldMessage/index.cjs +7 -182
- package/dist/components/FieldMessage/index.js +8 -154
- package/dist/components/FileUpload/index.cjs +7 -1171
- package/dist/components/FileUpload/index.js +7 -1134
- package/dist/components/HtmlTypeWriter/index.cjs +3 -171
- package/dist/components/HtmlTypeWriter/index.js +3 -133
- package/dist/components/IconButton/index.cjs +4 -65
- package/dist/components/IconButton/index.js +4 -38
- package/dist/components/ImageSelector/index.cjs +8 -1214
- package/dist/components/ImageSelector/index.js +8 -1177
- package/dist/components/Input/index.cjs +7 -429
- package/dist/components/Input/index.js +8 -392
- package/dist/components/Link/index.cjs +4 -61
- package/dist/components/Link/index.js +4 -34
- package/dist/components/LinkButton/index.cjs +5 -61
- package/dist/components/LinkButton/index.js +5 -34
- package/dist/components/Modal/index.cjs +5 -190
- package/dist/components/Modal/index.js +5 -153
- package/dist/components/NotificationBadge/index.cjs +5 -68
- package/dist/components/NotificationBadge/index.js +5 -40
- package/dist/components/Pagination/index.cjs +6 -1034
- package/dist/components/Pagination/index.js +6 -1007
- package/dist/components/PopOver/index.cjs +7 -363
- package/dist/components/PopOver/index.js +7 -326
- package/dist/components/Progress/index.cjs +5 -84
- package/dist/components/Progress/index.js +5 -57
- package/dist/components/Radio/index.cjs +7 -274
- package/dist/components/Radio/index.js +8 -237
- package/dist/components/Select/index.cjs +10 -1577
- package/dist/components/Select/index.js +11 -1540
- package/dist/components/Skeleton/index.cjs +4 -71
- package/dist/components/Skeleton/index.js +4 -44
- package/dist/components/Spinner/index.cjs +5 -88
- package/dist/components/Spinner/index.js +5 -61
- package/dist/components/Stat/index.cjs +5 -81
- package/dist/components/Stat/index.js +5 -54
- package/dist/components/Steps/index.cjs +7 -968
- package/dist/components/Steps/index.js +7 -941
- package/dist/components/Swiper/index.cjs +4 -357
- package/dist/components/Swiper/index.js +4 -320
- package/dist/components/Switch/index.cjs +7 -252
- package/dist/components/Switch/index.js +7 -215
- package/dist/components/Tab/index.cjs +4 -144
- package/dist/components/Tab/index.js +4 -107
- package/dist/components/Table/index.cjs +4 -337
- package/dist/components/Table/index.js +8 -300
- package/dist/components/Tag/index.cjs +6 -969
- package/dist/components/Tag/index.js +6 -942
- package/dist/components/TextArea/index.cjs +6 -229
- package/dist/components/TextArea/index.js +6 -192
- package/dist/components/TimePicker/index.cjs +9 -579
- package/dist/components/TimePicker/index.js +9 -542
- package/dist/components/Toast/index.cjs +5 -146
- package/dist/components/Toast/index.js +5 -108
- package/dist/components/ToggleChip/index.cjs +5 -66
- package/dist/components/ToggleChip/index.js +5 -39
- package/dist/components/Tooltip/index.cjs +6 -204
- package/dist/components/Tooltip/index.js +6 -167
- package/dist/components/Tour/index.cjs +6 -414
- package/dist/components/Tour/index.js +6 -377
- package/dist/components/Video/index.cjs +7 -796
- package/dist/components/Video/index.js +7 -759
- package/dist/components/index.cjs +140 -8342
- package/dist/components/index.js +190 -8288
- package/dist/index.cjs +903 -13318
- package/dist/index.js +524 -12526
- package/dist/layout/Grid/FullGrid/index.cjs +4 -46
- package/dist/layout/Grid/FullGrid/index.js +3 -18
- package/dist/layout/Grid/FullScreen/index.cjs +4 -46
- package/dist/layout/Grid/FullScreen/index.js +3 -18
- package/dist/layout/Grid/Item/index.cjs +5 -68
- package/dist/layout/Grid/Item/index.js +5 -41
- package/dist/layout/Grid/index.cjs +14 -109
- package/dist/layout/Grid/index.js +14 -79
- package/dist/layout/Header/index.cjs +4 -44
- package/dist/layout/Header/index.js +3 -16
- package/dist/layout/Layout/index.cjs +4 -42
- package/dist/layout/Layout/index.js +3 -14
- package/dist/layout/SideBar/index.cjs +6 -96
- package/dist/layout/SideBar/index.js +6 -57
- package/dist/layout/index.cjs +38 -209
- package/dist/layout/index.js +27 -153
- package/dist/tokens/index.cjs +627 -6119
- package/dist/tokens/index.js +324 -5489
- package/guidelines/components/editor.md +3 -0
- package/guidelines/setup.md +7 -0
- package/package.json +6 -3
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MONTH_LABELS,
|
|
3
|
+
WEEKDAY_LABELS,
|
|
4
|
+
isSameDay,
|
|
5
|
+
useCalendar
|
|
6
|
+
} from "./chunk-QURIHUEC.js";
|
|
7
|
+
import {
|
|
8
|
+
ChevronLeftIcon_default,
|
|
9
|
+
ChevronRightIcon_default
|
|
10
|
+
} from "./chunk-XMM52J3T.js";
|
|
11
|
+
import {
|
|
12
|
+
clsx_default
|
|
13
|
+
} from "./chunk-KZOJN57Q.js";
|
|
14
|
+
|
|
15
|
+
// src/components/Calendar/Calendar.tsx
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var DayCell = React.memo(
|
|
19
|
+
({
|
|
20
|
+
day,
|
|
21
|
+
disabled,
|
|
22
|
+
selected,
|
|
23
|
+
dayEvents,
|
|
24
|
+
renderDay,
|
|
25
|
+
onSelect,
|
|
26
|
+
onEventClick
|
|
27
|
+
}) => {
|
|
28
|
+
if (renderDay) {
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: clsx_default(
|
|
33
|
+
"calendar-day",
|
|
34
|
+
!day.isCurrentMonth && "outside",
|
|
35
|
+
disabled && "disabled",
|
|
36
|
+
selected && "selected",
|
|
37
|
+
day.isToday && "today"
|
|
38
|
+
),
|
|
39
|
+
onClick: () => {
|
|
40
|
+
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
41
|
+
},
|
|
42
|
+
children: renderDay(day, dayEvents)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsxs(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: clsx_default(
|
|
50
|
+
"calendar-day",
|
|
51
|
+
!day.isCurrentMonth && "outside",
|
|
52
|
+
disabled && "disabled",
|
|
53
|
+
selected && "selected",
|
|
54
|
+
day.isToday && "today",
|
|
55
|
+
day.isSunday && "sunday",
|
|
56
|
+
day.isSaturday && "saturday"
|
|
57
|
+
),
|
|
58
|
+
onClick: () => {
|
|
59
|
+
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "calendar-day-number", children: day.day }),
|
|
63
|
+
dayEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "calendar-day-events", children: [
|
|
64
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
className: "calendar-event-dot",
|
|
68
|
+
style: { backgroundColor: event.color ?? "var(--semantic-surface-brand-default)" },
|
|
69
|
+
title: event.label,
|
|
70
|
+
onClick: (e) => {
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
onEventClick?.(event);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
ei
|
|
76
|
+
)),
|
|
77
|
+
dayEvents.length > 3 && /* @__PURE__ */ jsxs("span", { className: "calendar-event-more", children: [
|
|
78
|
+
"+",
|
|
79
|
+
dayEvents.length - 3
|
|
80
|
+
] })
|
|
81
|
+
] })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
DayCell.displayName = "DayCell";
|
|
88
|
+
var Calendar = (props) => {
|
|
89
|
+
const {
|
|
90
|
+
year: yearProp,
|
|
91
|
+
month: monthProp,
|
|
92
|
+
selectedDate,
|
|
93
|
+
onSelect,
|
|
94
|
+
onMonthChange,
|
|
95
|
+
events = [],
|
|
96
|
+
renderDay,
|
|
97
|
+
onEventClick,
|
|
98
|
+
locale = "ko",
|
|
99
|
+
minDate,
|
|
100
|
+
maxDate,
|
|
101
|
+
selectedColor,
|
|
102
|
+
showToday = true
|
|
103
|
+
} = props;
|
|
104
|
+
const {
|
|
105
|
+
year,
|
|
106
|
+
month,
|
|
107
|
+
days,
|
|
108
|
+
goToPrevMonth,
|
|
109
|
+
goToNextMonth,
|
|
110
|
+
goToToday,
|
|
111
|
+
setYear,
|
|
112
|
+
setMonth
|
|
113
|
+
} = useCalendar(yearProp, monthProp);
|
|
114
|
+
const [pickerMode, setPickerMode] = React.useState("days");
|
|
115
|
+
const [yearRangeStart, setYearRangeStart] = React.useState(
|
|
116
|
+
Math.floor(year / 12) * 12
|
|
117
|
+
);
|
|
118
|
+
React.useEffect(() => {
|
|
119
|
+
if (yearProp !== void 0) setYear(yearProp);
|
|
120
|
+
}, [yearProp, setYear]);
|
|
121
|
+
React.useEffect(() => {
|
|
122
|
+
if (monthProp !== void 0) setMonth(monthProp);
|
|
123
|
+
}, [monthProp, setMonth]);
|
|
124
|
+
const handlePrev = () => {
|
|
125
|
+
if (pickerMode === "days") {
|
|
126
|
+
goToPrevMonth();
|
|
127
|
+
const prevMonth = month === 0 ? 11 : month - 1;
|
|
128
|
+
const prevYear = month === 0 ? year - 1 : year;
|
|
129
|
+
onMonthChange?.(prevYear, prevMonth);
|
|
130
|
+
} else if (pickerMode === "months") {
|
|
131
|
+
setYear(year - 1);
|
|
132
|
+
onMonthChange?.(year - 1, month);
|
|
133
|
+
} else {
|
|
134
|
+
setYearRangeStart((s) => s - 12);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const handleNext = () => {
|
|
138
|
+
if (pickerMode === "days") {
|
|
139
|
+
goToNextMonth();
|
|
140
|
+
const nextMonth = month === 11 ? 0 : month + 1;
|
|
141
|
+
const nextYear = month === 11 ? year + 1 : year;
|
|
142
|
+
onMonthChange?.(nextYear, nextMonth);
|
|
143
|
+
} else if (pickerMode === "months") {
|
|
144
|
+
setYear(year + 1);
|
|
145
|
+
onMonthChange?.(year + 1, month);
|
|
146
|
+
} else {
|
|
147
|
+
setYearRangeStart((s) => s + 12);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const handleToday = () => {
|
|
151
|
+
goToToday();
|
|
152
|
+
setPickerMode("days");
|
|
153
|
+
const today = /* @__PURE__ */ new Date();
|
|
154
|
+
onMonthChange?.(today.getFullYear(), today.getMonth());
|
|
155
|
+
};
|
|
156
|
+
const handleTitleClick = () => {
|
|
157
|
+
if (pickerMode === "days") setPickerMode("months");
|
|
158
|
+
else if (pickerMode === "months") {
|
|
159
|
+
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
160
|
+
setPickerMode("years");
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const handleMonthSelect = (m) => {
|
|
164
|
+
setMonth(m);
|
|
165
|
+
setPickerMode("days");
|
|
166
|
+
onMonthChange?.(year, m);
|
|
167
|
+
};
|
|
168
|
+
const handleYearSelect = (y) => {
|
|
169
|
+
setYear(y);
|
|
170
|
+
setPickerMode("months");
|
|
171
|
+
onMonthChange?.(y, month);
|
|
172
|
+
};
|
|
173
|
+
const minTime = React.useMemo(
|
|
174
|
+
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
175
|
+
[minDate]
|
|
176
|
+
);
|
|
177
|
+
const maxTime = React.useMemo(
|
|
178
|
+
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
179
|
+
[maxDate]
|
|
180
|
+
);
|
|
181
|
+
const eventsMap = React.useMemo(() => {
|
|
182
|
+
const map = /* @__PURE__ */ new Map();
|
|
183
|
+
for (const e of events) {
|
|
184
|
+
const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
|
|
185
|
+
const arr = map.get(key);
|
|
186
|
+
if (arr) arr.push(e);
|
|
187
|
+
else map.set(key, [e]);
|
|
188
|
+
}
|
|
189
|
+
return map;
|
|
190
|
+
}, [events]);
|
|
191
|
+
const getEventsForDay = React.useCallback(
|
|
192
|
+
(date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
|
|
193
|
+
[eventsMap]
|
|
194
|
+
);
|
|
195
|
+
const weekdays = WEEKDAY_LABELS[locale];
|
|
196
|
+
const monthLabels = MONTH_LABELS[locale];
|
|
197
|
+
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
198
|
+
return /* @__PURE__ */ jsxs(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
className: "lib-xplat-calendar",
|
|
202
|
+
style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ jsxs("div", { className: "calendar-header", children: [
|
|
205
|
+
/* @__PURE__ */ jsx("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ jsx(ChevronLeftIcon_default, {}) }),
|
|
206
|
+
/* @__PURE__ */ jsx("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
207
|
+
/* @__PURE__ */ jsx("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ jsx(ChevronRightIcon_default, {}) }),
|
|
208
|
+
showToday && /* @__PURE__ */ jsx("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
|
|
209
|
+
] }),
|
|
210
|
+
pickerMode === "years" && /* @__PURE__ */ jsx("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
211
|
+
const y = yearRangeStart + i;
|
|
212
|
+
return /* @__PURE__ */ jsx(
|
|
213
|
+
"button",
|
|
214
|
+
{
|
|
215
|
+
type: "button",
|
|
216
|
+
className: clsx_default("calendar-picker-cell", y === year && "active"),
|
|
217
|
+
onClick: () => handleYearSelect(y),
|
|
218
|
+
children: y
|
|
219
|
+
},
|
|
220
|
+
y
|
|
221
|
+
);
|
|
222
|
+
}) }),
|
|
223
|
+
pickerMode === "months" && /* @__PURE__ */ jsx("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx(
|
|
224
|
+
"button",
|
|
225
|
+
{
|
|
226
|
+
type: "button",
|
|
227
|
+
className: clsx_default("calendar-picker-cell", i === month && "active"),
|
|
228
|
+
onClick: () => handleMonthSelect(i),
|
|
229
|
+
children: label
|
|
230
|
+
},
|
|
231
|
+
i
|
|
232
|
+
)) }),
|
|
233
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
234
|
+
/* @__PURE__ */ jsx("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
className: clsx_default(
|
|
238
|
+
"calendar-weekday",
|
|
239
|
+
i === 0 && "sunday",
|
|
240
|
+
i === 6 && "saturday"
|
|
241
|
+
),
|
|
242
|
+
children: label
|
|
243
|
+
},
|
|
244
|
+
label
|
|
245
|
+
)) }),
|
|
246
|
+
/* @__PURE__ */ jsx("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
247
|
+
const dayEvents = getEventsForDay(day.date);
|
|
248
|
+
const t = day.date.getTime();
|
|
249
|
+
const disabled = t < minTime || t > maxTime;
|
|
250
|
+
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
DayCell,
|
|
253
|
+
{
|
|
254
|
+
day,
|
|
255
|
+
disabled,
|
|
256
|
+
selected: isSelected,
|
|
257
|
+
dayEvents,
|
|
258
|
+
renderDay,
|
|
259
|
+
onSelect,
|
|
260
|
+
onEventClick
|
|
261
|
+
},
|
|
262
|
+
idx
|
|
263
|
+
);
|
|
264
|
+
}) })
|
|
265
|
+
] })
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
};
|
|
270
|
+
Calendar.displayName = "Calendar";
|
|
271
|
+
var Calendar_default = Calendar;
|
|
272
|
+
|
|
273
|
+
export {
|
|
274
|
+
Calendar_default
|
|
275
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkEETYMP6Kcjs = require('./chunk-EETYMP6K.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkI7TLJUTPcjs = require('./chunk-I7TLJUTP.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkPFGSJJRYcjs = require('./chunk-PFGSJJRY.cjs');
|
|
11
|
+
|
|
12
|
+
// src/components/Pagination/Pagination.tsx
|
|
13
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
14
|
+
var getPageRange = (current, totalPages, siblingCount) => {
|
|
15
|
+
const totalNumbers = siblingCount * 2 + 5;
|
|
16
|
+
if (totalPages <= totalNumbers) {
|
|
17
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
18
|
+
}
|
|
19
|
+
const leftSibling = Math.max(current - siblingCount, 1);
|
|
20
|
+
const rightSibling = Math.min(current + siblingCount, totalPages);
|
|
21
|
+
const showLeftDots = leftSibling > 3;
|
|
22
|
+
const showRightDots = rightSibling < totalPages - 2;
|
|
23
|
+
if (!showLeftDots && showRightDots) {
|
|
24
|
+
const leftCount = siblingCount * 2 + 3;
|
|
25
|
+
const leftRange = Array.from({ length: leftCount }, (_, i) => i + 1);
|
|
26
|
+
return [...leftRange, "...", totalPages];
|
|
27
|
+
}
|
|
28
|
+
if (showLeftDots && !showRightDots) {
|
|
29
|
+
const rightCount = siblingCount * 2 + 3;
|
|
30
|
+
const rightRange = Array.from({ length: rightCount }, (_, i) => totalPages - rightCount + i + 1);
|
|
31
|
+
return [1, "...", ...rightRange];
|
|
32
|
+
}
|
|
33
|
+
const middleRange = Array.from(
|
|
34
|
+
{ length: rightSibling - leftSibling + 1 },
|
|
35
|
+
(_, i) => leftSibling + i
|
|
36
|
+
);
|
|
37
|
+
return [1, "...", ...middleRange, "...", totalPages];
|
|
38
|
+
};
|
|
39
|
+
var Pagination = (props) => {
|
|
40
|
+
const {
|
|
41
|
+
current,
|
|
42
|
+
total,
|
|
43
|
+
pageSize = 10,
|
|
44
|
+
siblingCount = 1,
|
|
45
|
+
onChange,
|
|
46
|
+
size = "md",
|
|
47
|
+
type = "primary"
|
|
48
|
+
} = props;
|
|
49
|
+
const statusType = _chunkI7TLJUTPcjs.normalizeStatus.call(void 0, type);
|
|
50
|
+
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
51
|
+
const pages = getPageRange(current, totalPages, siblingCount);
|
|
52
|
+
const handleClick = (page) => {
|
|
53
|
+
if (page !== current && page >= 1 && page <= totalPages) {
|
|
54
|
+
_optionalChain([onChange, 'optionalCall', _2 => _2(page)]);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { className: _chunkPFGSJJRYcjs.clsx_default.call(void 0, "lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
58
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
className: "page-btn prev",
|
|
62
|
+
disabled: current <= 1,
|
|
63
|
+
onClick: () => handleClick(current - 1),
|
|
64
|
+
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
65
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEETYMP6Kcjs.ChevronLeftIcon_default, {})
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
pages.map(
|
|
69
|
+
(page, i) => page === "..." ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
className: _chunkPFGSJJRYcjs.clsx_default.call(void 0, "page-btn", { active: page === current }),
|
|
73
|
+
onClick: () => handleClick(page),
|
|
74
|
+
"aria-current": page === current ? "page" : void 0,
|
|
75
|
+
children: page
|
|
76
|
+
},
|
|
77
|
+
page
|
|
78
|
+
)
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
className: "page-btn next",
|
|
84
|
+
disabled: current >= totalPages,
|
|
85
|
+
onClick: () => handleClick(current + 1),
|
|
86
|
+
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
87
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEETYMP6Kcjs.ChevronRightIcon_default, {})
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] });
|
|
91
|
+
};
|
|
92
|
+
Pagination.displayName = "Pagination";
|
|
93
|
+
var Pagination_default = Pagination;
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
exports.Pagination_default = Pagination_default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckIcon_default
|
|
3
|
+
} from "./chunk-UT42P54P.js";
|
|
4
|
+
import {
|
|
5
|
+
normalizeStatus
|
|
6
|
+
} from "./chunk-QEZ4R3SK.js";
|
|
7
|
+
import {
|
|
8
|
+
clsx_default
|
|
9
|
+
} from "./chunk-KZOJN57Q.js";
|
|
10
|
+
|
|
11
|
+
// src/components/Steps/Steps.tsx
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var Steps = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
items,
|
|
16
|
+
current,
|
|
17
|
+
type = "primary"
|
|
18
|
+
} = props;
|
|
19
|
+
const statusType = normalizeStatus(type);
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
|
|
21
|
+
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx_default("step-item", status), children: [
|
|
23
|
+
/* @__PURE__ */ jsx("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx(CheckIcon_default, {}) : /* @__PURE__ */ jsx("span", { children: index + 1 }) }),
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: "step-content", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("span", { className: "step-title", children: item.title }),
|
|
26
|
+
item.description && /* @__PURE__ */ jsx("span", { className: "step-description", children: item.description })
|
|
27
|
+
] })
|
|
28
|
+
] }, index);
|
|
29
|
+
}) });
|
|
30
|
+
};
|
|
31
|
+
Steps.displayName = "Steps";
|
|
32
|
+
var Steps_default = Steps;
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
Steps_default
|
|
36
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Field,
|
|
3
|
+
hasError
|
|
4
|
+
} from "./chunk-7YOI5XOW.js";
|
|
5
|
+
import {
|
|
6
|
+
clsx_default
|
|
7
|
+
} from "./chunk-KZOJN57Q.js";
|
|
8
|
+
|
|
9
|
+
// src/components/TextArea/TextArea.tsx
|
|
10
|
+
import React from "react";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var TextArea = React.forwardRef(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
const {
|
|
15
|
+
className,
|
|
16
|
+
size = "md",
|
|
17
|
+
validations,
|
|
18
|
+
label,
|
|
19
|
+
required,
|
|
20
|
+
resize = "vertical",
|
|
21
|
+
rows = 3,
|
|
22
|
+
disabled,
|
|
23
|
+
...textareaProps
|
|
24
|
+
} = props;
|
|
25
|
+
const autoId = React.useId();
|
|
26
|
+
const fieldId = props.id ?? autoId;
|
|
27
|
+
const control = /* @__PURE__ */ jsx("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx(
|
|
28
|
+
"textarea",
|
|
29
|
+
{
|
|
30
|
+
...textareaProps,
|
|
31
|
+
ref,
|
|
32
|
+
id: fieldId,
|
|
33
|
+
rows,
|
|
34
|
+
disabled,
|
|
35
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
36
|
+
className: clsx_default("lib-xplat-textarea", size, disabled && "disabled"),
|
|
37
|
+
style: { resize }
|
|
38
|
+
}
|
|
39
|
+
) });
|
|
40
|
+
return /* @__PURE__ */ jsx(Field, { validations, label, required, htmlFor: fieldId, children: control });
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
TextArea.displayName = "TextArea";
|
|
44
|
+
var TextArea_default = TextArea;
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
TextArea_default
|
|
48
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/layout/Layout/Layout.tsx
|
|
2
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
3
|
+
var Layout = (props) => {
|
|
4
|
+
const { header, sideBar, children } = props;
|
|
5
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "lib-xplat-layout", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
6
|
+
sideBar && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: sideBar }),
|
|
7
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "lib-xplat-layout-content", children: [
|
|
8
|
+
header && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "lib-xplat-layout-content-header", children: header }),
|
|
9
|
+
children
|
|
10
|
+
] })
|
|
11
|
+
] }) });
|
|
12
|
+
};
|
|
13
|
+
Layout.displayName = "Layout";
|
|
14
|
+
var Layout_default = Layout;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.Layout_default = Layout_default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkPFGSJJRYcjs = require('./chunk-PFGSJJRY.cjs');
|
|
4
|
+
|
|
5
|
+
// src/components/Skeleton/Skeleton.tsx
|
|
6
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
7
|
+
var SIZE_MAP = {
|
|
8
|
+
xs: "var(--spacing-space-1)",
|
|
9
|
+
sm: "var(--spacing-space-2)",
|
|
10
|
+
md: "var(--spacing-space-4)",
|
|
11
|
+
lg: "var(--spacing-space-8)",
|
|
12
|
+
xl: "var(--spacing-space-12)",
|
|
13
|
+
"2xl": "var(--spacing-space-16)",
|
|
14
|
+
full: "100%"
|
|
15
|
+
};
|
|
16
|
+
var Skeleton = (props) => {
|
|
17
|
+
const { variant = "text", width, height } = props;
|
|
18
|
+
const style = {
|
|
19
|
+
...width != null && { width: SIZE_MAP[width] },
|
|
20
|
+
...height != null && { height: SIZE_MAP[height] }
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: _chunkPFGSJJRYcjs.clsx_default.call(void 0, "lib-xplat-skeleton", variant),
|
|
26
|
+
style,
|
|
27
|
+
"aria-hidden": "true"
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
Skeleton.displayName = "Skeleton";
|
|
32
|
+
var Skeleton_default = Skeleton;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
exports.Skeleton_default = Skeleton_default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkQCD7UEZ3cjs = require('./chunk-QCD7UEZ3.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkEFU7IAF5cjs = require('./chunk-EFU7IAF5.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunk4KYHHJ6Zcjs = require('./chunk-4KYHHJ6Z.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkPFGSJJRYcjs = require('./chunk-PFGSJJRY.cjs');
|
|
16
|
+
|
|
17
|
+
// src/components/Dropdown/Dropdown.tsx
|
|
18
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
19
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
20
|
+
var Dropdown = (props) => {
|
|
21
|
+
const { items, children } = props;
|
|
22
|
+
const [isOpen, setIsOpen] = _react2.default.useState(false);
|
|
23
|
+
const [mounted, setMounted] = _react2.default.useState(false);
|
|
24
|
+
const [visible, setVisible] = _react2.default.useState(false);
|
|
25
|
+
const triggerRef = _react2.default.useRef(null);
|
|
26
|
+
const menuRef = _react2.default.useRef(null);
|
|
27
|
+
const host = _chunkQCD7UEZ3cjs.useOverlayHost_default.call(void 0, triggerRef, mounted);
|
|
28
|
+
_chunk4KYHHJ6Zcjs.useAutoPosition_default.call(void 0, triggerRef, menuRef, mounted);
|
|
29
|
+
_chunkQCD7UEZ3cjs.useClickOutside_default.call(void 0, [triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
30
|
+
_chunk4KYHHJ6Zcjs.useCloseWhenFocusHidden.call(void 0, isOpen, triggerRef, menuRef, () => setIsOpen(false));
|
|
31
|
+
_chunk4KYHHJ6Zcjs.useEscapeKey.call(void 0, isOpen, () => {
|
|
32
|
+
setIsOpen(false);
|
|
33
|
+
_optionalChain([triggerRef, 'access', _ => _.current, 'optionalAccess', _2 => _2.focus, 'call', _3 => _3({ preventScroll: true })]);
|
|
34
|
+
});
|
|
35
|
+
_react2.default.useEffect(() => {
|
|
36
|
+
if (isOpen) {
|
|
37
|
+
setMounted(true);
|
|
38
|
+
const t2 = setTimeout(() => setVisible(true), 1);
|
|
39
|
+
return () => clearTimeout(t2);
|
|
40
|
+
}
|
|
41
|
+
setVisible(false);
|
|
42
|
+
const t = setTimeout(() => setMounted(false), 150);
|
|
43
|
+
return () => clearTimeout(t);
|
|
44
|
+
}, [isOpen]);
|
|
45
|
+
const handleItemClick = (item) => {
|
|
46
|
+
if (item.disabled) return;
|
|
47
|
+
_optionalChain([item, 'access', _4 => _4.onClick, 'optionalCall', _5 => _5()]);
|
|
48
|
+
setIsOpen(false);
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "lib-xplat-dropdown", children: [
|
|
51
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref: triggerRef,
|
|
55
|
+
className: "dropdown-trigger",
|
|
56
|
+
onClick: () => setIsOpen((prev) => !prev),
|
|
57
|
+
children
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
mounted && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEFU7IAF5cjs.Portal_default, { container: host, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
ref: menuRef,
|
|
64
|
+
className: _chunkPFGSJJRYcjs.clsx_default.call(void 0, "lib-xplat-dropdown-menu", { visible }),
|
|
65
|
+
role: "menu",
|
|
66
|
+
children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
className: _chunkPFGSJJRYcjs.clsx_default.call(void 0, "dropdown-item", {
|
|
70
|
+
disabled: item.disabled,
|
|
71
|
+
danger: item.danger
|
|
72
|
+
}),
|
|
73
|
+
role: "menuitem",
|
|
74
|
+
disabled: item.disabled,
|
|
75
|
+
onClick: () => handleItemClick(item),
|
|
76
|
+
children: item.label
|
|
77
|
+
},
|
|
78
|
+
item.key
|
|
79
|
+
))
|
|
80
|
+
}
|
|
81
|
+
) })
|
|
82
|
+
] });
|
|
83
|
+
};
|
|
84
|
+
Dropdown.displayName = "Dropdown";
|
|
85
|
+
var Dropdown_default = Dropdown;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
exports.Dropdown_default = Dropdown_default;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/tokens/svg/form/CloseEyeIcon.tsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
var CloseEyeIcon = () => /* @__PURE__ */ jsxs(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "1em",
|
|
8
|
+
height: "1em",
|
|
9
|
+
viewBox: "0 0 20 20",
|
|
10
|
+
fill: "none",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
clipRule: "evenodd",
|
|
17
|
+
d: "M0.219742 0.219551C0.512654 -0.0731039 0.987475 -0.0732631 1.28029 0.219551L19.6133 18.5526C19.9059 18.8454 19.9059 19.3203 19.6133 19.6131C19.3205 19.9059 18.8457 19.9058 18.5527 19.6131L14.7813 15.8416C13.3403 16.784 11.6591 17.3045 9.92873 17.3328H9.91701C6.70085 17.3328 4.22416 15.4963 2.59865 13.7625C1.77931 12.8885 1.15357 12.0171 0.732437 11.3651C0.521591 11.0386 0.360106 10.7651 0.250992 10.5711C0.196584 10.4744 0.154657 10.3968 0.125992 10.3426C0.111712 10.3156 0.100585 10.2933 0.0927887 10.2781C0.0890167 10.2708 0.0852609 10.2649 0.083023 10.2606C0.0819635 10.2585 0.0817067 10.2561 0.0810699 10.2547L0.0800933 10.2528L0.0791168 10.2518C-0.0297164 10.034 -0.0260827 9.77692 0.0888824 9.56232C1.04113 7.78778 2.31584 6.20831 3.84572 4.90607L0.219742 1.2801C-0.0731515 0.987204 -0.0731515 0.512444 0.219742 0.219551ZM4.91115 5.9715C3.58556 7.08096 2.46618 8.41669 1.60646 9.91779C1.70047 10.0817 1.82896 10.2988 1.9922 10.5516C2.37833 11.1494 2.95068 11.9449 3.69337 12.7371C5.19121 14.3347 7.2954 15.8286 9.90822 15.8319C11.2476 15.8092 12.5514 15.4346 13.6934 14.7537L11.6348 12.6951C11.4891 12.7906 11.3365 12.8759 11.1768 12.9471C10.7784 13.1246 10.3482 13.2205 9.91212 13.2283C9.47589 13.236 9.0413 13.1554 8.63673 12.992C8.23247 12.8287 7.86504 12.5854 7.55666 12.2772C7.24809 11.9686 7.00429 11.6007 6.84084 11.1961C6.6774 10.7915 6.59683 10.358 6.60451 9.9217C6.61221 9.48532 6.70813 9.05473 6.88576 8.65607C6.95708 8.49604 7.04011 8.3419 7.13576 8.19611L4.91115 5.9715ZM8.24123 9.30158C8.15522 9.50642 8.10843 9.72574 8.10451 9.94807C8.10037 10.183 8.14345 10.4167 8.23146 10.6346C8.31948 10.8524 8.45111 11.0505 8.6172 11.2166C8.78327 11.3825 8.98157 11.5135 9.19923 11.6014C9.41683 11.6892 9.65018 11.7324 9.88478 11.7283C10.1069 11.7244 10.3257 11.6765 10.5303 11.5906L8.24123 9.30158Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
d: "M9.91701 2.5008C13.1328 2.5011 15.609 4.33645 17.2344 6.07014C18.0538 6.94422 18.6805 7.81555 19.1016 8.4676C19.3125 8.79427 19.473 9.06857 19.582 9.26252C19.6366 9.35947 19.6784 9.43688 19.707 9.49103C19.7213 9.51797 19.7325 9.53938 19.7402 9.55451C19.744 9.56183 19.7478 9.5677 19.75 9.57209L19.7539 9.5799L19.7901 9.66486C19.8604 9.86248 19.8453 10.0829 19.7451 10.2703C19.2148 11.2625 18.5817 12.1966 17.8574 13.0574C17.5908 13.3743 17.1177 13.4147 16.8008 13.1483C16.4839 12.8816 16.4424 12.4085 16.709 12.0916C17.2798 11.4133 17.7876 10.6845 18.2266 9.91486C18.1327 9.75115 18.0048 9.53442 17.8418 9.28205C17.4558 8.68431 16.8833 7.88875 16.1406 7.0965C14.6413 5.49721 12.5337 4.00013 9.91701 3.99982H9.91505C9.3843 3.99858 8.85471 4.05957 8.33791 4.18049C7.93468 4.27487 7.53105 4.02408 7.43654 3.62092C7.34213 3.21761 7.5928 2.81396 7.99611 2.71955C8.62561 2.57227 9.27051 2.49939 9.91701 2.5008Z",
|
|
25
|
+
fill: "currentColor"
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
var CloseEyeIcon_default = CloseEyeIcon;
|
|
32
|
+
|
|
33
|
+
// src/tokens/svg/form/OpenEyeIcon.tsx
|
|
34
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
35
|
+
var OpenEyeIcon = () => /* @__PURE__ */ jsxs2(
|
|
36
|
+
"svg",
|
|
37
|
+
{
|
|
38
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
+
width: "1em",
|
|
40
|
+
height: "1em",
|
|
41
|
+
viewBox: "0 0 20 20",
|
|
42
|
+
fill: "none",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx2(
|
|
45
|
+
"path",
|
|
46
|
+
{
|
|
47
|
+
fillRule: "evenodd",
|
|
48
|
+
clipRule: "evenodd",
|
|
49
|
+
d: "M10 6.75C11.795 6.75 13.25 8.20507 13.25 10C13.25 11.7949 11.795 13.25 10 13.25C8.20514 13.25 6.75004 11.7949 6.75004 10C6.75004 8.20509 8.20514 6.75002 10 6.75ZM10 8.25C9.03356 8.25002 8.25004 9.03352 8.25004 10C8.25004 10.9665 9.03356 11.75 10 11.75C10.9665 11.75 11.75 10.9665 11.75 10C11.75 9.0335 10.9665 8.25 10 8.25Z",
|
|
50
|
+
fill: "currentColor"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx2(
|
|
54
|
+
"path",
|
|
55
|
+
{
|
|
56
|
+
fillRule: "evenodd",
|
|
57
|
+
clipRule: "evenodd",
|
|
58
|
+
d: "M10.001 2.58301C13.2168 2.5833 15.693 4.41963 17.3184 6.15332C18.1379 7.02746 18.7644 7.8987 19.1856 8.55078C19.3966 8.87754 19.5569 9.15172 19.6661 9.3457C19.7206 9.44274 19.7624 9.52003 19.7911 9.57422C19.8054 9.60124 19.8165 9.62253 19.8243 9.6377C19.8281 9.64511 19.8318 9.65085 19.834 9.65527L19.8379 9.66309L19.8731 9.74512C19.9423 9.93686 19.9301 10.1503 19.8379 10.335L19.834 10.3438C19.8318 10.3481 19.828 10.354 19.8243 10.3613C19.8165 10.3764 19.8053 10.3989 19.7911 10.4258C19.7624 10.4799 19.7204 10.5577 19.6661 10.6543C19.557 10.8482 19.3963 11.1219 19.1856 11.4482C18.7645 12.1003 18.1378 12.9716 17.3184 13.8457C15.693 15.5794 13.2169 17.4157 10.001 17.416C6.78478 17.416 4.30817 15.5796 2.68266 13.8457C1.86324 12.9716 1.23758 12.1003 0.816447 11.4482C0.605537 11.1217 0.444118 10.8483 0.335002 10.6543C0.280535 10.5575 0.23867 10.4799 0.210002 10.4258C0.195664 10.3987 0.184599 10.3765 0.176799 10.3613C0.172971 10.3539 0.169262 10.3481 0.167033 10.3438C0.165933 10.3416 0.165786 10.3393 0.16508 10.3379L0.164103 10.3359L0.163127 10.335C0.0576283 10.1238 0.0575788 9.87516 0.163127 9.66406L0.164103 9.66309L0.16508 9.66113C0.165655 9.65972 0.166042 9.65723 0.167033 9.65527C0.169295 9.6509 0.17306 9.64497 0.176799 9.6377C0.184576 9.62257 0.195818 9.60103 0.210002 9.57422C0.238658 9.52007 0.280573 9.44247 0.335002 9.3457C0.444118 9.15173 0.605537 8.87735 0.816447 8.55078C1.2376 7.89875 1.86341 7.02719 2.68266 6.15332C4.30818 4.41955 6.78494 2.58301 10.001 2.58301ZM10.001 4.08301C7.38417 4.08301 5.27685 5.58037 3.77738 7.17969C3.03465 7.97195 2.46234 8.7674 2.07621 9.36523C1.91278 9.6183 1.78352 9.83509 1.68949 9.99902C1.7836 10.1632 1.91229 10.3809 2.07621 10.6348C2.46234 11.2326 3.03462 12.028 3.77738 12.8203C5.27685 14.4196 7.38421 15.916 10.001 15.916C12.6177 15.9157 14.7253 14.4196 16.2246 12.8203C16.9674 12.028 17.5397 11.2326 17.9258 10.6348C18.0896 10.3812 18.2175 10.1631 18.3116 9.99902C18.2176 9.83513 18.0892 9.61828 17.9258 9.36523C17.5398 8.76747 16.9674 7.97197 16.2246 7.17969C14.7253 5.58039 12.6177 4.0833 10.001 4.08301Z",
|
|
59
|
+
fill: "currentColor"
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
var OpenEyeIcon_default = OpenEyeIcon;
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
CloseEyeIcon_default,
|
|
69
|
+
OpenEyeIcon_default
|
|
70
|
+
};
|