@x-plat/design-system 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/index.cjs +38 -31
- package/dist/components/Accordion/index.css +1 -0
- package/dist/components/Accordion/index.js +38 -31
- package/dist/components/Alert/index.css +1 -0
- package/dist/components/Breadcrumb/index.css +3 -0
- package/dist/components/Button/index.css +1 -0
- package/dist/components/Calendar/index.cjs +103 -62
- package/dist/components/Calendar/index.css +1 -0
- package/dist/components/Calendar/index.js +103 -62
- package/dist/components/Card/index.css +2 -0
- package/dist/components/CardTab/index.css +1 -0
- package/dist/components/Chart/index.cjs +106 -83
- package/dist/components/Chart/index.css +1 -0
- package/dist/components/Chart/index.js +106 -83
- package/dist/components/DatePicker/index.cjs +36 -15
- package/dist/components/DatePicker/index.css +2 -0
- package/dist/components/DatePicker/index.js +36 -15
- package/dist/components/EmptyState/index.css +1 -0
- package/dist/components/FileUpload/index.css +2 -0
- package/dist/components/HtmlTypeWriter/index.css +1 -0
- package/dist/components/Pagination/index.css +8 -8
- package/dist/components/Spinner/index.css +7 -2
- package/dist/components/Steps/index.cjs +1 -4
- package/dist/components/Steps/index.css +15 -36
- package/dist/components/Steps/index.js +1 -4
- package/dist/components/Swiper/index.cjs +16 -12
- package/dist/components/Swiper/index.css +1 -0
- package/dist/components/Swiper/index.js +16 -12
- package/dist/components/Switch/index.css +20 -19
- package/dist/components/Tab/index.css +16 -2
- package/dist/components/Table/index.cjs +4 -4
- package/dist/components/Table/index.css +1 -0
- package/dist/components/Table/index.d.cts +2 -5
- package/dist/components/Table/index.d.ts +2 -5
- package/dist/components/Table/index.js +4 -4
- package/dist/components/Video/index.cjs +32 -43
- package/dist/components/Video/index.css +4 -4
- package/dist/components/Video/index.d.cts +1 -5
- package/dist/components/Video/index.d.ts +1 -5
- package/dist/components/Video/index.js +32 -43
- package/dist/components/index.cjs +339 -257
- package/dist/components/index.css +88 -71
- package/dist/components/index.js +339 -257
- package/dist/index.cjs +339 -257
- package/dist/index.css +88 -71
- package/dist/index.js +339 -257
- package/guidelines/Guidelines.md +11 -4
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -5487,38 +5487,45 @@ var clsx_default = clsx;
|
|
|
5487
5487
|
|
|
5488
5488
|
// src/components/Accordion/Accordion.tsx
|
|
5489
5489
|
import { jsx as jsx295, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
5490
|
-
var AccordionItem = (
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
{
|
|
5502
|
-
className: "accordion-header",
|
|
5503
|
-
onClick: onToggle,
|
|
5504
|
-
"aria-expanded": isOpen,
|
|
5505
|
-
children: [
|
|
5506
|
-
/* @__PURE__ */ jsx295("span", { className: "title", children: item.title }),
|
|
5507
|
-
/* @__PURE__ */ jsx295("span", { className: "chevron", children: /* @__PURE__ */ jsx295(ChevronDownIcon_default, {}) })
|
|
5508
|
-
]
|
|
5509
|
-
}
|
|
5510
|
-
),
|
|
5511
|
-
/* @__PURE__ */ jsx295(
|
|
5512
|
-
"div",
|
|
5513
|
-
{
|
|
5514
|
-
ref: bodyRef,
|
|
5515
|
-
className: "accordion-body",
|
|
5516
|
-
style: { maxHeight: isOpen ? height : 0 },
|
|
5517
|
-
children: /* @__PURE__ */ jsx295("div", { className: "accordion-content", children: item.content })
|
|
5490
|
+
var AccordionItem = React.memo(
|
|
5491
|
+
({
|
|
5492
|
+
item,
|
|
5493
|
+
isOpen,
|
|
5494
|
+
onToggle
|
|
5495
|
+
}) => {
|
|
5496
|
+
const bodyRef = React.useRef(null);
|
|
5497
|
+
const [height, setHeight] = React.useState(0);
|
|
5498
|
+
React.useEffect(() => {
|
|
5499
|
+
if (bodyRef.current) {
|
|
5500
|
+
setHeight(bodyRef.current.scrollHeight);
|
|
5518
5501
|
}
|
|
5519
|
-
)
|
|
5520
|
-
|
|
5521
|
-
|
|
5502
|
+
}, [isOpen, item.content]);
|
|
5503
|
+
return /* @__PURE__ */ jsxs189("div", { className: clsx_default("accordion-item", { open: isOpen }), children: [
|
|
5504
|
+
/* @__PURE__ */ jsxs189(
|
|
5505
|
+
"button",
|
|
5506
|
+
{
|
|
5507
|
+
className: "accordion-header",
|
|
5508
|
+
onClick: onToggle,
|
|
5509
|
+
"aria-expanded": isOpen,
|
|
5510
|
+
children: [
|
|
5511
|
+
/* @__PURE__ */ jsx295("span", { className: "title", children: item.title }),
|
|
5512
|
+
/* @__PURE__ */ jsx295("span", { className: "chevron", children: /* @__PURE__ */ jsx295(ChevronDownIcon_default, {}) })
|
|
5513
|
+
]
|
|
5514
|
+
}
|
|
5515
|
+
),
|
|
5516
|
+
/* @__PURE__ */ jsx295(
|
|
5517
|
+
"div",
|
|
5518
|
+
{
|
|
5519
|
+
ref: bodyRef,
|
|
5520
|
+
className: "accordion-body",
|
|
5521
|
+
style: { maxHeight: isOpen ? height : 0 },
|
|
5522
|
+
children: /* @__PURE__ */ jsx295("div", { className: "accordion-content", children: item.content })
|
|
5523
|
+
}
|
|
5524
|
+
)
|
|
5525
|
+
] });
|
|
5526
|
+
}
|
|
5527
|
+
);
|
|
5528
|
+
AccordionItem.displayName = "AccordionItem";
|
|
5522
5529
|
var Accordion = (props) => {
|
|
5523
5530
|
const { items } = props;
|
|
5524
5531
|
const isMultiple = props.multiple === true;
|
|
@@ -5773,6 +5780,76 @@ var MONTH_LABELS = {
|
|
|
5773
5780
|
|
|
5774
5781
|
// src/components/Calendar/Calendar.tsx
|
|
5775
5782
|
import { Fragment, jsx as jsx301, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
5783
|
+
var DayCell = React3.memo(
|
|
5784
|
+
({
|
|
5785
|
+
day,
|
|
5786
|
+
disabled,
|
|
5787
|
+
selected,
|
|
5788
|
+
dayEvents,
|
|
5789
|
+
renderDay,
|
|
5790
|
+
onSelect,
|
|
5791
|
+
onEventClick
|
|
5792
|
+
}) => {
|
|
5793
|
+
if (renderDay) {
|
|
5794
|
+
return /* @__PURE__ */ jsx301(
|
|
5795
|
+
"div",
|
|
5796
|
+
{
|
|
5797
|
+
className: clsx_default(
|
|
5798
|
+
"calendar-day",
|
|
5799
|
+
!day.isCurrentMonth && "outside",
|
|
5800
|
+
disabled && "disabled",
|
|
5801
|
+
selected && "selected",
|
|
5802
|
+
day.isToday && "today"
|
|
5803
|
+
),
|
|
5804
|
+
onClick: () => {
|
|
5805
|
+
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5806
|
+
},
|
|
5807
|
+
children: renderDay(day, dayEvents)
|
|
5808
|
+
}
|
|
5809
|
+
);
|
|
5810
|
+
}
|
|
5811
|
+
return /* @__PURE__ */ jsxs193(
|
|
5812
|
+
"div",
|
|
5813
|
+
{
|
|
5814
|
+
className: clsx_default(
|
|
5815
|
+
"calendar-day",
|
|
5816
|
+
!day.isCurrentMonth && "outside",
|
|
5817
|
+
disabled && "disabled",
|
|
5818
|
+
selected && "selected",
|
|
5819
|
+
day.isToday && "today",
|
|
5820
|
+
day.isSunday && "sunday",
|
|
5821
|
+
day.isSaturday && "saturday"
|
|
5822
|
+
),
|
|
5823
|
+
onClick: () => {
|
|
5824
|
+
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5825
|
+
},
|
|
5826
|
+
children: [
|
|
5827
|
+
/* @__PURE__ */ jsx301("span", { className: "calendar-day-number", children: day.day }),
|
|
5828
|
+
dayEvents.length > 0 && /* @__PURE__ */ jsxs193("div", { className: "calendar-day-events", children: [
|
|
5829
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx301(
|
|
5830
|
+
"span",
|
|
5831
|
+
{
|
|
5832
|
+
className: "calendar-event-dot",
|
|
5833
|
+
style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
|
|
5834
|
+
title: event.label,
|
|
5835
|
+
onClick: (e) => {
|
|
5836
|
+
e.stopPropagation();
|
|
5837
|
+
onEventClick?.(event);
|
|
5838
|
+
}
|
|
5839
|
+
},
|
|
5840
|
+
ei
|
|
5841
|
+
)),
|
|
5842
|
+
dayEvents.length > 3 && /* @__PURE__ */ jsxs193("span", { className: "calendar-event-more", children: [
|
|
5843
|
+
"+",
|
|
5844
|
+
dayEvents.length - 3
|
|
5845
|
+
] })
|
|
5846
|
+
] })
|
|
5847
|
+
]
|
|
5848
|
+
}
|
|
5849
|
+
);
|
|
5850
|
+
}
|
|
5851
|
+
);
|
|
5852
|
+
DayCell.displayName = "DayCell";
|
|
5776
5853
|
var Calendar = (props) => {
|
|
5777
5854
|
const {
|
|
5778
5855
|
year: yearProp,
|
|
@@ -5858,12 +5935,28 @@ var Calendar = (props) => {
|
|
|
5858
5935
|
setPickerMode("months");
|
|
5859
5936
|
onMonthChange?.(y, month);
|
|
5860
5937
|
};
|
|
5861
|
-
const
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5938
|
+
const minTime = React3.useMemo(
|
|
5939
|
+
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
5940
|
+
[minDate]
|
|
5941
|
+
);
|
|
5942
|
+
const maxTime = React3.useMemo(
|
|
5943
|
+
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
5944
|
+
[maxDate]
|
|
5945
|
+
);
|
|
5946
|
+
const eventsMap = React3.useMemo(() => {
|
|
5947
|
+
const map = /* @__PURE__ */ new Map();
|
|
5948
|
+
for (const e of events) {
|
|
5949
|
+
const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
|
|
5950
|
+
const arr = map.get(key);
|
|
5951
|
+
if (arr) arr.push(e);
|
|
5952
|
+
else map.set(key, [e]);
|
|
5953
|
+
}
|
|
5954
|
+
return map;
|
|
5955
|
+
}, [events]);
|
|
5956
|
+
const getEventsForDay = React3.useCallback(
|
|
5957
|
+
(date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
|
|
5958
|
+
[eventsMap]
|
|
5959
|
+
);
|
|
5867
5960
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
5868
5961
|
const monthLabels = MONTH_LABELS[locale];
|
|
5869
5962
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
@@ -5917,64 +6010,19 @@ var Calendar = (props) => {
|
|
|
5917
6010
|
)) }),
|
|
5918
6011
|
/* @__PURE__ */ jsx301("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
5919
6012
|
const dayEvents = getEventsForDay(day.date);
|
|
5920
|
-
const
|
|
6013
|
+
const t = day.date.getTime();
|
|
6014
|
+
const disabled = t < minTime || t > maxTime;
|
|
5921
6015
|
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
"div",
|
|
5925
|
-
{
|
|
5926
|
-
className: clsx_default(
|
|
5927
|
-
"calendar-day",
|
|
5928
|
-
!day.isCurrentMonth && "outside",
|
|
5929
|
-
disabled && "disabled",
|
|
5930
|
-
isSelected && "selected",
|
|
5931
|
-
day.isToday && "today"
|
|
5932
|
-
),
|
|
5933
|
-
onClick: () => {
|
|
5934
|
-
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5935
|
-
},
|
|
5936
|
-
children: renderDay(day, dayEvents)
|
|
5937
|
-
},
|
|
5938
|
-
idx
|
|
5939
|
-
);
|
|
5940
|
-
}
|
|
5941
|
-
return /* @__PURE__ */ jsxs193(
|
|
5942
|
-
"div",
|
|
6016
|
+
return /* @__PURE__ */ jsx301(
|
|
6017
|
+
DayCell,
|
|
5943
6018
|
{
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
day.isSaturday && "saturday"
|
|
5952
|
-
),
|
|
5953
|
-
onClick: () => {
|
|
5954
|
-
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
5955
|
-
},
|
|
5956
|
-
children: [
|
|
5957
|
-
/* @__PURE__ */ jsx301("span", { className: "calendar-day-number", children: day.day }),
|
|
5958
|
-
dayEvents.length > 0 && /* @__PURE__ */ jsxs193("div", { className: "calendar-day-events", children: [
|
|
5959
|
-
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx301(
|
|
5960
|
-
"span",
|
|
5961
|
-
{
|
|
5962
|
-
className: "calendar-event-dot",
|
|
5963
|
-
style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
|
|
5964
|
-
title: event.label,
|
|
5965
|
-
onClick: (e) => {
|
|
5966
|
-
e.stopPropagation();
|
|
5967
|
-
onEventClick?.(event);
|
|
5968
|
-
}
|
|
5969
|
-
},
|
|
5970
|
-
ei
|
|
5971
|
-
)),
|
|
5972
|
-
dayEvents.length > 3 && /* @__PURE__ */ jsxs193("span", { className: "calendar-event-more", children: [
|
|
5973
|
-
"+",
|
|
5974
|
-
dayEvents.length - 3
|
|
5975
|
-
] })
|
|
5976
|
-
] })
|
|
5977
|
-
]
|
|
6019
|
+
day,
|
|
6020
|
+
disabled,
|
|
6021
|
+
selected: isSelected,
|
|
6022
|
+
dayEvents,
|
|
6023
|
+
renderDay,
|
|
6024
|
+
onSelect,
|
|
6025
|
+
onEventClick
|
|
5978
6026
|
},
|
|
5979
6027
|
idx
|
|
5980
6028
|
);
|
|
@@ -6122,14 +6170,28 @@ var useChartTooltip = (enabled) => {
|
|
|
6122
6170
|
}, []);
|
|
6123
6171
|
return { tooltip, show, hide, move, containerRef };
|
|
6124
6172
|
};
|
|
6125
|
-
var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
|
|
6126
|
-
const entries = Object.entries(data);
|
|
6127
|
-
const
|
|
6128
|
-
|
|
6173
|
+
var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
6174
|
+
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6175
|
+
const maxVal = React5.useMemo(() => {
|
|
6176
|
+
const allValues = entries.flatMap(([, v]) => v);
|
|
6177
|
+
return Math.max(...allValues) * 1.2 || 1;
|
|
6178
|
+
}, [entries]);
|
|
6129
6179
|
const count = labels.length;
|
|
6180
|
+
const chartW = 600 - PADDING.left - PADDING.right;
|
|
6181
|
+
const chartH = 300 - PADDING.top - PADDING.bottom;
|
|
6182
|
+
const seriesPoints = React5.useMemo(
|
|
6183
|
+
() => entries.map(
|
|
6184
|
+
([, values]) => values.map((v, i) => ({
|
|
6185
|
+
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
6186
|
+
y: PADDING.top + (1 - v / maxVal) * chartH,
|
|
6187
|
+
v
|
|
6188
|
+
}))
|
|
6189
|
+
),
|
|
6190
|
+
[entries, count, chartW, chartH, maxVal]
|
|
6191
|
+
);
|
|
6130
6192
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: "0 0 600 300", className: "chart-svg", children: [
|
|
6131
6193
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6132
|
-
const y = PADDING.top + (1 - ratio) *
|
|
6194
|
+
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6133
6195
|
const val = Math.round(maxVal * ratio);
|
|
6134
6196
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6135
6197
|
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: 600 - PADDING.right, y2: y, className: "chart-grid" }),
|
|
@@ -6137,17 +6199,13 @@ var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6137
6199
|
] }, ratio);
|
|
6138
6200
|
}),
|
|
6139
6201
|
labels.map((label, i) => {
|
|
6140
|
-
const x = PADDING.left + i / (count - 1 || 1) *
|
|
6202
|
+
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6141
6203
|
return /* @__PURE__ */ jsx305("text", { x, y: 300 - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6142
6204
|
}),
|
|
6143
|
-
entries.map(([key
|
|
6205
|
+
entries.map(([key], di) => {
|
|
6144
6206
|
const palette = getPalette(LINE_BAR_PALETTES, di);
|
|
6145
6207
|
const color = palette[4];
|
|
6146
|
-
const points =
|
|
6147
|
-
const x = PADDING.left + i / (count - 1 || 1) * (600 - PADDING.left - PADDING.right);
|
|
6148
|
-
const y = PADDING.top + (1 - v / maxVal) * (300 - PADDING.top - PADDING.bottom);
|
|
6149
|
-
return { x, y, v };
|
|
6150
|
-
});
|
|
6208
|
+
const points = seriesPoints[di];
|
|
6151
6209
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6152
6210
|
/* @__PURE__ */ jsx305(
|
|
6153
6211
|
"polyline",
|
|
@@ -6175,17 +6233,31 @@ var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6175
6233
|
] }, di);
|
|
6176
6234
|
})
|
|
6177
6235
|
] });
|
|
6178
|
-
};
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
const
|
|
6182
|
-
const maxVal =
|
|
6236
|
+
});
|
|
6237
|
+
LineChart.displayName = "LineChart";
|
|
6238
|
+
var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
6239
|
+
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6240
|
+
const maxVal = React5.useMemo(() => {
|
|
6241
|
+
const allValues = entries.flatMap(([, v]) => v);
|
|
6242
|
+
return Math.max(...allValues) * 1.2 || 1;
|
|
6243
|
+
}, [entries]);
|
|
6183
6244
|
const count = labels.length;
|
|
6184
6245
|
const groupCount = entries.length;
|
|
6185
6246
|
const chartW = 600 - PADDING.left - PADDING.right;
|
|
6186
6247
|
const chartH = 300 - PADDING.top - PADDING.bottom;
|
|
6187
6248
|
const groupW = chartW / count;
|
|
6188
6249
|
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
6250
|
+
const bars = React5.useMemo(
|
|
6251
|
+
() => entries.map(
|
|
6252
|
+
([, values], di) => values.map((v, i) => {
|
|
6253
|
+
const h = v / maxVal * chartH;
|
|
6254
|
+
const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
|
|
6255
|
+
const y = PADDING.top + chartH - h;
|
|
6256
|
+
return { x, y, w: barW, h, v };
|
|
6257
|
+
})
|
|
6258
|
+
),
|
|
6259
|
+
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
6260
|
+
);
|
|
6189
6261
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: "0 0 600 300", className: "chart-svg", children: [
|
|
6190
6262
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6191
6263
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
@@ -6196,85 +6268,84 @@ var BarChart = ({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6196
6268
|
] }, ratio);
|
|
6197
6269
|
}),
|
|
6198
6270
|
labels.map((label, i) => /* @__PURE__ */ jsx305("text", { x: PADDING.left + groupW * i + groupW / 2, y: 300 - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i)),
|
|
6199
|
-
entries.map(([key
|
|
6271
|
+
entries.map(([key], di) => {
|
|
6200
6272
|
const palette = getPalette(LINE_BAR_PALETTES, di);
|
|
6201
6273
|
const color = palette[4];
|
|
6202
|
-
return
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
onMouseLeave: onLeave
|
|
6219
|
-
},
|
|
6220
|
-
`${di}-${i}`
|
|
6221
|
-
);
|
|
6222
|
-
});
|
|
6274
|
+
return bars[di].map((b, i) => /* @__PURE__ */ jsx305(
|
|
6275
|
+
"rect",
|
|
6276
|
+
{
|
|
6277
|
+
x: b.x,
|
|
6278
|
+
y: b.y,
|
|
6279
|
+
width: b.w,
|
|
6280
|
+
height: b.h,
|
|
6281
|
+
rx: "2",
|
|
6282
|
+
fill: color,
|
|
6283
|
+
className: "chart-bar",
|
|
6284
|
+
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
|
|
6285
|
+
onMouseMove: onMove,
|
|
6286
|
+
onMouseLeave: onLeave
|
|
6287
|
+
},
|
|
6288
|
+
`${di}-${i}`
|
|
6289
|
+
));
|
|
6223
6290
|
})
|
|
6224
6291
|
] });
|
|
6225
|
-
};
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6292
|
+
});
|
|
6293
|
+
BarChart.displayName = "BarChart";
|
|
6294
|
+
var PieDonutChart = React5.memo(
|
|
6295
|
+
({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6296
|
+
const values = React5.useMemo(() => Object.entries(data).flatMap(([, v]) => v), [data]);
|
|
6297
|
+
const total = React5.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
6298
|
+
const cx = 150;
|
|
6299
|
+
const cy = 150;
|
|
6300
|
+
const r2 = 120;
|
|
6301
|
+
const innerR = isDoughnut ? 60 : 0;
|
|
6302
|
+
const palette = getPalette(PIE_PALETTES, 0);
|
|
6303
|
+
const sliceData = React5.useMemo(() => {
|
|
6304
|
+
let angle0 = -Math.PI / 2;
|
|
6305
|
+
return values.map((v, i) => {
|
|
6306
|
+
const angle = v / total * Math.PI * 2;
|
|
6307
|
+
const endAngle = angle0 + angle;
|
|
6308
|
+
const largeArc = angle > Math.PI ? 1 : 0;
|
|
6309
|
+
const x1 = cx + r2 * Math.cos(angle0);
|
|
6310
|
+
const y1 = cy + r2 * Math.sin(angle0);
|
|
6311
|
+
const x2 = cx + r2 * Math.cos(endAngle);
|
|
6312
|
+
const y2 = cy + r2 * Math.sin(endAngle);
|
|
6313
|
+
let d;
|
|
6314
|
+
if (innerR > 0) {
|
|
6315
|
+
const ix1 = cx + innerR * Math.cos(angle0);
|
|
6316
|
+
const iy1 = cy + innerR * Math.sin(angle0);
|
|
6317
|
+
const ix2 = cx + innerR * Math.cos(endAngle);
|
|
6318
|
+
const iy2 = cy + innerR * Math.sin(endAngle);
|
|
6319
|
+
d = `M ${ix1} ${iy1} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} L ${ix2} ${iy2} A ${innerR} ${innerR} 0 ${largeArc} 0 ${ix1} ${iy1} Z`;
|
|
6320
|
+
} else {
|
|
6321
|
+
d = `M ${cx} ${cy} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} Z`;
|
|
6322
|
+
}
|
|
6323
|
+
const midAngle = angle0 + angle / 2;
|
|
6324
|
+
const labelR = innerR > 0 ? (r2 + innerR) / 2 : r2 * 0.6;
|
|
6325
|
+
const lx = cx + labelR * Math.cos(midAngle);
|
|
6326
|
+
const ly = cy + labelR * Math.sin(midAngle);
|
|
6327
|
+
const pct = Math.round(v / total * 100);
|
|
6328
|
+
angle0 = endAngle;
|
|
6329
|
+
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
|
|
6330
|
+
});
|
|
6331
|
+
}, [values, total, innerR, labels]);
|
|
6332
|
+
return /* @__PURE__ */ jsx305("svg", { viewBox: "0 0 300 300", className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ jsxs196("g", { children: [
|
|
6262
6333
|
/* @__PURE__ */ jsx305(
|
|
6263
6334
|
"path",
|
|
6264
6335
|
{
|
|
6265
|
-
d,
|
|
6336
|
+
d: s.d,
|
|
6266
6337
|
fill: palette[i % palette.length],
|
|
6267
6338
|
className: "chart-slice",
|
|
6268
|
-
onMouseEnter: (e) => onHover(e, `${label}: ${v} (${pct}%)`),
|
|
6339
|
+
onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
|
|
6269
6340
|
onMouseMove: onMove,
|
|
6270
6341
|
onMouseLeave: onLeave
|
|
6271
6342
|
}
|
|
6272
6343
|
),
|
|
6273
|
-
angle > 0.2 && /* @__PURE__ */ jsx305("text", { x: lx, y: ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: v })
|
|
6274
|
-
] }, i);
|
|
6275
|
-
}
|
|
6276
|
-
|
|
6277
|
-
|
|
6344
|
+
s.angle > 0.2 && /* @__PURE__ */ jsx305("text", { x: s.lx, y: s.ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: s.v })
|
|
6345
|
+
] }, i)) });
|
|
6346
|
+
}
|
|
6347
|
+
);
|
|
6348
|
+
PieDonutChart.displayName = "PieDonutChart";
|
|
6278
6349
|
var Chart = (props) => {
|
|
6279
6350
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
6280
6351
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
@@ -6583,7 +6654,7 @@ var useClickOutside_default = useClickOutside;
|
|
|
6583
6654
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
6584
6655
|
import React9 from "react";
|
|
6585
6656
|
import { Fragment as Fragment2, jsx as jsx311, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
6586
|
-
var
|
|
6657
|
+
var DayCell2 = React9.memo(
|
|
6587
6658
|
({
|
|
6588
6659
|
day,
|
|
6589
6660
|
disabled,
|
|
@@ -6613,7 +6684,7 @@ var DayCell = React9.memo(
|
|
|
6613
6684
|
),
|
|
6614
6685
|
(prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.day === next.day
|
|
6615
6686
|
);
|
|
6616
|
-
|
|
6687
|
+
DayCell2.displayName = "DayCell";
|
|
6617
6688
|
var SingleDatePicker = (props) => {
|
|
6618
6689
|
const {
|
|
6619
6690
|
value,
|
|
@@ -6736,7 +6807,7 @@ var SingleDatePicker = (props) => {
|
|
|
6736
6807
|
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
6737
6808
|
);
|
|
6738
6809
|
return /* @__PURE__ */ jsx311(
|
|
6739
|
-
|
|
6810
|
+
DayCell2,
|
|
6740
6811
|
{
|
|
6741
6812
|
day,
|
|
6742
6813
|
disabled,
|
|
@@ -6851,6 +6922,35 @@ var Modal_default = Modal;
|
|
|
6851
6922
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
6852
6923
|
import React12 from "react";
|
|
6853
6924
|
import { jsx as jsx314, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
6925
|
+
var RangeDayCell = React12.memo(
|
|
6926
|
+
({
|
|
6927
|
+
day,
|
|
6928
|
+
disabled,
|
|
6929
|
+
isStart,
|
|
6930
|
+
isEnd,
|
|
6931
|
+
inRange,
|
|
6932
|
+
onClick
|
|
6933
|
+
}) => /* @__PURE__ */ jsx314(
|
|
6934
|
+
"button",
|
|
6935
|
+
{
|
|
6936
|
+
type: "button",
|
|
6937
|
+
className: clsx_default(
|
|
6938
|
+
"datepicker-day",
|
|
6939
|
+
!day.isCurrentMonth && "outside",
|
|
6940
|
+
disabled && "disabled",
|
|
6941
|
+
(isStart || isEnd) && "selected",
|
|
6942
|
+
inRange && !isStart && !isEnd && "in-range",
|
|
6943
|
+
day.isToday && "today",
|
|
6944
|
+
day.isSunday && "sunday",
|
|
6945
|
+
day.isSaturday && "saturday"
|
|
6946
|
+
),
|
|
6947
|
+
disabled: disabled || !day.isCurrentMonth,
|
|
6948
|
+
onClick,
|
|
6949
|
+
children: day.day
|
|
6950
|
+
}
|
|
6951
|
+
)
|
|
6952
|
+
);
|
|
6953
|
+
RangeDayCell.displayName = "RangeDayCell";
|
|
6854
6954
|
var RangePicker = (props) => {
|
|
6855
6955
|
const {
|
|
6856
6956
|
startDate,
|
|
@@ -6927,20 +7027,13 @@ var RangePicker = (props) => {
|
|
|
6927
7027
|
const isEnd = isSameDay(day.date, endDate);
|
|
6928
7028
|
const inRange = isInRange(day.date, startDate, endDate);
|
|
6929
7029
|
return /* @__PURE__ */ jsx314(
|
|
6930
|
-
|
|
7030
|
+
RangeDayCell,
|
|
6931
7031
|
{
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
(isStart || isEnd) && "selected",
|
|
6938
|
-
inRange && !isStart && !isEnd && "in-range",
|
|
6939
|
-
day.isToday && "today",
|
|
6940
|
-
day.isSunday && "sunday",
|
|
6941
|
-
day.isSaturday && "saturday"
|
|
6942
|
-
),
|
|
6943
|
-
disabled: disabled || !day.isCurrentMonth,
|
|
7032
|
+
day,
|
|
7033
|
+
disabled,
|
|
7034
|
+
isStart,
|
|
7035
|
+
isEnd,
|
|
7036
|
+
inRange,
|
|
6944
7037
|
onClick: () => {
|
|
6945
7038
|
if (!disabled && day.isCurrentMonth) {
|
|
6946
7039
|
if (type === "start") {
|
|
@@ -6951,8 +7044,7 @@ var RangePicker = (props) => {
|
|
|
6951
7044
|
onChange?.({ startDate, endDate: newEnd });
|
|
6952
7045
|
}
|
|
6953
7046
|
}
|
|
6954
|
-
}
|
|
6955
|
-
children: day.day
|
|
7047
|
+
}
|
|
6956
7048
|
},
|
|
6957
7049
|
idx
|
|
6958
7050
|
);
|
|
@@ -8010,10 +8102,7 @@ var Steps = (props) => {
|
|
|
8010
8102
|
return /* @__PURE__ */ jsx332("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8011
8103
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8012
8104
|
return /* @__PURE__ */ jsxs215("div", { className: clsx_default("step-item", status), children: [
|
|
8013
|
-
/* @__PURE__ */
|
|
8014
|
-
/* @__PURE__ */ jsx332("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx332(CheckIcon_default, {}) : /* @__PURE__ */ jsx332("span", { children: index + 1 }) }),
|
|
8015
|
-
index < items.length - 1 && /* @__PURE__ */ jsx332("div", { className: "step-line" })
|
|
8016
|
-
] }),
|
|
8105
|
+
/* @__PURE__ */ jsx332("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx332(CheckIcon_default, {}) : /* @__PURE__ */ jsx332("span", { children: index + 1 }) }),
|
|
8017
8106
|
/* @__PURE__ */ jsxs215("div", { className: "step-content", children: [
|
|
8018
8107
|
/* @__PURE__ */ jsx332("span", { className: "step-title", children: item.title }),
|
|
8019
8108
|
item.description && /* @__PURE__ */ jsx332("span", { className: "step-description", children: item.description })
|
|
@@ -8224,6 +8313,21 @@ var Swiper = (props) => {
|
|
|
8224
8313
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8225
8314
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8226
8315
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8316
|
+
const slideElements = React26.useMemo(
|
|
8317
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx333(
|
|
8318
|
+
"div",
|
|
8319
|
+
{
|
|
8320
|
+
className: "lib-xplat-swiper__slide",
|
|
8321
|
+
style: {
|
|
8322
|
+
minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
|
|
8323
|
+
maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
|
|
8324
|
+
},
|
|
8325
|
+
children: item
|
|
8326
|
+
},
|
|
8327
|
+
idx
|
|
8328
|
+
)),
|
|
8329
|
+
[extendedItems, slideWidthPercent, gapAdjust]
|
|
8330
|
+
);
|
|
8227
8331
|
const totalSteps = Math.ceil((maxIndex + 1) / slideBy);
|
|
8228
8332
|
const currentStep = Math.min(
|
|
8229
8333
|
Math.floor(realIndex / slideBy),
|
|
@@ -8249,18 +8353,7 @@ var Swiper = (props) => {
|
|
|
8249
8353
|
gap: `${spaceBetween}px`
|
|
8250
8354
|
},
|
|
8251
8355
|
onTransitionEnd: handleTransitionEnd,
|
|
8252
|
-
children:
|
|
8253
|
-
"div",
|
|
8254
|
-
{
|
|
8255
|
-
className: "lib-xplat-swiper__slide",
|
|
8256
|
-
style: {
|
|
8257
|
-
minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
|
|
8258
|
-
maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
|
|
8259
|
-
},
|
|
8260
|
-
children: item
|
|
8261
|
-
},
|
|
8262
|
-
idx
|
|
8263
|
-
))
|
|
8356
|
+
children: slideElements
|
|
8264
8357
|
}
|
|
8265
8358
|
)
|
|
8266
8359
|
}
|
|
@@ -8479,7 +8572,7 @@ var TableRowContext_default = TableRowContext;
|
|
|
8479
8572
|
|
|
8480
8573
|
// src/components/Table/TableCell.tsx
|
|
8481
8574
|
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
8482
|
-
var TableCell = (props) => {
|
|
8575
|
+
var TableCell = React33.memo((props) => {
|
|
8483
8576
|
const {
|
|
8484
8577
|
children,
|
|
8485
8578
|
align = "center",
|
|
@@ -8534,7 +8627,7 @@ var TableCell = (props) => {
|
|
|
8534
8627
|
children
|
|
8535
8628
|
}
|
|
8536
8629
|
);
|
|
8537
|
-
};
|
|
8630
|
+
});
|
|
8538
8631
|
TableCell.displayName = "TableCell";
|
|
8539
8632
|
var TableCell_default = TableCell;
|
|
8540
8633
|
|
|
@@ -8553,7 +8646,7 @@ var TableHead_default = TableHead;
|
|
|
8553
8646
|
// src/components/Table/TableRow.tsx
|
|
8554
8647
|
import React34 from "react";
|
|
8555
8648
|
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
8556
|
-
var TableRow = (props) => {
|
|
8649
|
+
var TableRow = React34.memo((props) => {
|
|
8557
8650
|
const {
|
|
8558
8651
|
children,
|
|
8559
8652
|
type = "secondary",
|
|
@@ -8581,7 +8674,7 @@ var TableRow = (props) => {
|
|
|
8581
8674
|
children
|
|
8582
8675
|
}
|
|
8583
8676
|
) });
|
|
8584
|
-
};
|
|
8677
|
+
});
|
|
8585
8678
|
TableRow.displayName = "TableRow";
|
|
8586
8679
|
var TableRow_default = TableRow;
|
|
8587
8680
|
|
|
@@ -8789,7 +8882,6 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
8789
8882
|
const {
|
|
8790
8883
|
src,
|
|
8791
8884
|
poster,
|
|
8792
|
-
controls = true,
|
|
8793
8885
|
autoPlay,
|
|
8794
8886
|
muted,
|
|
8795
8887
|
loop,
|
|
@@ -8828,49 +8920,39 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
8828
8920
|
videoRef.current.play();
|
|
8829
8921
|
}
|
|
8830
8922
|
};
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8923
|
+
return /* @__PURE__ */ jsxs221("div", { className: "lib-xplat-video custom-overlay", children: [
|
|
8924
|
+
/* @__PURE__ */ jsx346(
|
|
8925
|
+
"video",
|
|
8926
|
+
{
|
|
8927
|
+
ref: setRefs,
|
|
8928
|
+
src,
|
|
8929
|
+
poster,
|
|
8930
|
+
autoPlay,
|
|
8931
|
+
muted,
|
|
8932
|
+
loop,
|
|
8933
|
+
playsInline: playsInline ?? true,
|
|
8934
|
+
onPlay: handlePlay,
|
|
8935
|
+
onPause: handlePause,
|
|
8936
|
+
onLoadedData: handleLoadedData,
|
|
8937
|
+
onClick: togglePlay,
|
|
8938
|
+
...rest
|
|
8939
|
+
}
|
|
8940
|
+
),
|
|
8941
|
+
/* @__PURE__ */ jsx346(
|
|
8942
|
+
"button",
|
|
8943
|
+
{
|
|
8944
|
+
type: "button",
|
|
8945
|
+
className: clsx_default(
|
|
8946
|
+
"play-overlay",
|
|
8947
|
+
isPlaying && "is-playing",
|
|
8948
|
+
!isLoaded && "is-loading"
|
|
8856
8949
|
),
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
isPlaying && "is-playing",
|
|
8864
|
-
!isLoaded && "is-loading"
|
|
8865
|
-
),
|
|
8866
|
-
onClick: togglePlay,
|
|
8867
|
-
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
8868
|
-
children: isPlaying ? /* @__PURE__ */ jsx346(PauseIcon_default, {}) : /* @__PURE__ */ jsx346("span", { className: "play-icon", children: /* @__PURE__ */ jsx346(PlayCircleIcon_default, {}) })
|
|
8869
|
-
}
|
|
8870
|
-
)
|
|
8871
|
-
]
|
|
8872
|
-
}
|
|
8873
|
-
);
|
|
8950
|
+
onClick: togglePlay,
|
|
8951
|
+
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
8952
|
+
children: isPlaying ? /* @__PURE__ */ jsx346(PauseIcon_default, {}) : /* @__PURE__ */ jsx346("span", { className: "play-icon", children: /* @__PURE__ */ jsx346(PlayCircleIcon_default, {}) })
|
|
8953
|
+
}
|
|
8954
|
+
)
|
|
8955
|
+
] });
|
|
8874
8956
|
});
|
|
8875
8957
|
Video.displayName = "Video";
|
|
8876
8958
|
var Video_default = Video;
|