@x-plat/design-system 0.8.3 → 0.10.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/components/AutoResizeTextArea/index.cjs +140 -4
- package/dist/components/AutoResizeTextArea/index.css +38 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +4 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +4 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/Badge/index.cjs +5 -1
- package/dist/components/Badge/index.css +1 -0
- package/dist/components/Badge/index.d.cts +1 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.js +5 -1
- package/dist/components/Box/index.d.cts +3 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Chart/index.cjs +7 -6
- package/dist/components/Chart/index.d.cts +12 -1
- package/dist/components/Chart/index.d.ts +12 -1
- package/dist/components/Chart/index.js +7 -6
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +9 -0
- package/dist/components/ChatInput/index.d.ts +9 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +137 -6
- package/dist/components/CheckBox/index.css +40 -0
- package/dist/components/CheckBox/index.d.cts +13 -2
- package/dist/components/CheckBox/index.d.ts +13 -2
- package/dist/components/CheckBox/index.js +137 -6
- package/dist/components/Chip/index.d.cts +2 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/DatePicker/index.cjs +76 -62
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +42 -28
- package/dist/components/Drawer/index.d.cts +1 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/FieldMessage/index.cjs +183 -0
- package/dist/components/FieldMessage/index.css +37 -0
- package/dist/components/FieldMessage/index.d.cts +37 -0
- package/dist/components/FieldMessage/index.d.ts +37 -0
- package/dist/components/FieldMessage/index.js +154 -0
- package/dist/components/FileUpload/index.cjs +135 -8
- package/dist/components/FileUpload/index.css +38 -0
- package/dist/components/FileUpload/index.d.cts +9 -0
- package/dist/components/FileUpload/index.d.ts +9 -0
- package/dist/components/FileUpload/index.js +135 -8
- package/dist/components/ImageSelector/index.cjs +153 -11
- package/dist/components/ImageSelector/index.css +38 -0
- package/dist/components/ImageSelector/index.d.cts +6 -0
- package/dist/components/ImageSelector/index.d.ts +6 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -31
- package/dist/components/Input/index.d.cts +7 -8
- package/dist/components/Input/index.d.ts +7 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/NotificationBadge/index.cjs +5 -1
- package/dist/components/NotificationBadge/index.css +1 -0
- package/dist/components/NotificationBadge/index.d.cts +6 -2
- package/dist/components/NotificationBadge/index.d.ts +6 -2
- package/dist/components/NotificationBadge/index.js +5 -1
- package/dist/components/Pagination/index.cjs +6 -2
- package/dist/components/Pagination/index.css +1 -0
- package/dist/components/Pagination/index.d.cts +13 -2
- package/dist/components/Pagination/index.d.ts +13 -2
- package/dist/components/Pagination/index.js +6 -2
- package/dist/components/Progress/index.cjs +6 -2
- package/dist/components/Progress/index.css +1 -0
- package/dist/components/Progress/index.d.cts +11 -2
- package/dist/components/Progress/index.d.ts +11 -2
- package/dist/components/Progress/index.js +6 -2
- package/dist/components/Radio/index.cjs +158 -10
- package/dist/components/Radio/index.css +40 -0
- package/dist/components/Radio/index.d.cts +14 -2
- package/dist/components/Radio/index.d.ts +14 -2
- package/dist/components/Radio/index.js +158 -10
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +8 -1
- package/dist/components/Select/index.d.ts +8 -1
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Skeleton/index.d.cts +3 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Spinner/index.cjs +6 -2
- package/dist/components/Spinner/index.css +1 -0
- package/dist/components/Spinner/index.d.cts +8 -2
- package/dist/components/Spinner/index.d.ts +8 -2
- package/dist/components/Spinner/index.js +6 -2
- package/dist/components/Steps/index.cjs +6 -2
- package/dist/components/Steps/index.css +11 -0
- package/dist/components/Steps/index.d.cts +9 -2
- package/dist/components/Steps/index.d.ts +9 -2
- package/dist/components/Steps/index.js +6 -2
- package/dist/components/Switch/index.cjs +146 -6
- package/dist/components/Switch/index.css +40 -0
- package/dist/components/Switch/index.d.cts +13 -2
- package/dist/components/Switch/index.d.ts +13 -2
- package/dist/components/Switch/index.js +146 -6
- package/dist/components/Tab/index.cjs +4 -3
- package/dist/components/Tab/index.d.cts +12 -1
- package/dist/components/Tab/index.d.ts +12 -1
- package/dist/components/Tab/index.js +4 -3
- package/dist/components/Tag/index.cjs +5 -3
- package/dist/components/Tag/index.d.cts +12 -2
- package/dist/components/Tag/index.d.ts +12 -2
- package/dist/components/Tag/index.js +5 -3
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +6 -0
- package/dist/components/TextArea/index.d.ts +6 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/Tooltip/index.cjs +4 -2
- package/dist/components/Tooltip/index.d.cts +11 -1
- package/dist/components/Tooltip/index.d.ts +11 -1
- package/dist/components/Tooltip/index.js +4 -2
- package/dist/components/index.cjs +479 -408
- package/dist/components/index.css +59 -31
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +262 -194
- package/dist/index.cjs +484 -413
- package/dist/index.css +59 -31
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +264 -196
- package/dist/status-g_KP3qT6.d.cts +8 -0
- package/dist/status-g_KP3qT6.d.ts +8 -0
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/AGENT_PROMPT.md +15 -0
- package/guidelines/components/card.md +3 -3
- package/guidelines/components/feedback.md +1 -1
- package/guidelines/components/form.md +26 -0
- package/guidelines/components/navigation.md +16 -15
- package/guidelines/components/overlay.md +43 -4
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1505,11 +1505,49 @@ var Alert_default = Alert;
|
|
|
1505
1505
|
|
|
1506
1506
|
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
1507
1507
|
import React2 from "react";
|
|
1508
|
-
|
|
1508
|
+
|
|
1509
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
1510
|
+
import { Fragment, jsx as jsx297, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
1511
|
+
var ICON = {
|
|
1512
|
+
default: /* @__PURE__ */ jsx297(InfoIcon_default, {}),
|
|
1513
|
+
success: /* @__PURE__ */ jsx297(SuccessIcon_default, {}),
|
|
1514
|
+
warning: /* @__PURE__ */ jsx297(InfoIcon_default, {}),
|
|
1515
|
+
error: /* @__PURE__ */ jsx297(ErrorIcon_default, {})
|
|
1516
|
+
};
|
|
1517
|
+
var FieldMessage = (props) => {
|
|
1518
|
+
const { validations } = props;
|
|
1519
|
+
if (!validations || validations.length === 0) return null;
|
|
1520
|
+
return /* @__PURE__ */ jsx297("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs191(
|
|
1521
|
+
"div",
|
|
1522
|
+
{
|
|
1523
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
1524
|
+
children: [
|
|
1525
|
+
/* @__PURE__ */ jsx297("div", { className: "icon", children: ICON[v.status] }),
|
|
1526
|
+
/* @__PURE__ */ jsx297("span", { children: v.message })
|
|
1527
|
+
]
|
|
1528
|
+
},
|
|
1529
|
+
`${v.message}_${idx}`
|
|
1530
|
+
)) });
|
|
1531
|
+
};
|
|
1532
|
+
FieldMessage.displayName = "FieldMessage";
|
|
1533
|
+
var FieldMessage_default = FieldMessage;
|
|
1534
|
+
var Field = (props) => {
|
|
1535
|
+
const { validations, children } = props;
|
|
1536
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ jsx297(Fragment, { children });
|
|
1537
|
+
return /* @__PURE__ */ jsxs191("div", { className: "lib-xplat-field", children: [
|
|
1538
|
+
children,
|
|
1539
|
+
/* @__PURE__ */ jsx297(FieldMessage, { validations })
|
|
1540
|
+
] });
|
|
1541
|
+
};
|
|
1542
|
+
Field.displayName = "Field";
|
|
1543
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
1544
|
+
|
|
1545
|
+
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
1546
|
+
import { jsx as jsx298 } from "react/jsx-runtime";
|
|
1509
1547
|
var MAX_HEIGHT = 400;
|
|
1510
1548
|
var AutoResizeTextArea = React2.forwardRef(
|
|
1511
1549
|
(props, ref) => {
|
|
1512
|
-
const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
|
|
1550
|
+
const { value, className, onChange, disabled, bare = false, validations, ...textareaProps } = props;
|
|
1513
1551
|
const localRef = React2.useRef(null);
|
|
1514
1552
|
const setRefs = (el) => {
|
|
1515
1553
|
localRef.current = el;
|
|
@@ -1537,9 +1575,10 @@ var AutoResizeTextArea = React2.forwardRef(
|
|
|
1537
1575
|
updateHeight();
|
|
1538
1576
|
}, [value]);
|
|
1539
1577
|
if (bare) {
|
|
1540
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ jsx298(
|
|
1541
1579
|
"textarea",
|
|
1542
1580
|
{
|
|
1581
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
1543
1582
|
...textareaProps,
|
|
1544
1583
|
ref: setRefs,
|
|
1545
1584
|
className,
|
|
@@ -1549,9 +1588,10 @@ var AutoResizeTextArea = React2.forwardRef(
|
|
|
1549
1588
|
}
|
|
1550
1589
|
);
|
|
1551
1590
|
}
|
|
1552
|
-
|
|
1591
|
+
const control = /* @__PURE__ */ jsx298("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ jsx298("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ jsx298(
|
|
1553
1592
|
"textarea",
|
|
1554
1593
|
{
|
|
1594
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
1555
1595
|
...textareaProps,
|
|
1556
1596
|
ref: setRefs,
|
|
1557
1597
|
disabled,
|
|
@@ -1559,13 +1599,14 @@ var AutoResizeTextArea = React2.forwardRef(
|
|
|
1559
1599
|
onChange: handleChange
|
|
1560
1600
|
}
|
|
1561
1601
|
) }) });
|
|
1602
|
+
return /* @__PURE__ */ jsx298(Field, { validations, children: control });
|
|
1562
1603
|
}
|
|
1563
1604
|
);
|
|
1564
1605
|
AutoResizeTextArea.displayName = "AutoResizeTextArea";
|
|
1565
1606
|
var AutoResizeTextArea_default = AutoResizeTextArea;
|
|
1566
1607
|
|
|
1567
1608
|
// src/components/Avatar/Avatar.tsx
|
|
1568
|
-
import { jsx as
|
|
1609
|
+
import { jsx as jsx299 } from "react/jsx-runtime";
|
|
1569
1610
|
var CATEGORICAL_COUNT = 8;
|
|
1570
1611
|
var getColorIndex = (name) => {
|
|
1571
1612
|
if (!name) return 1;
|
|
@@ -1582,36 +1623,36 @@ var Avatar = (props) => {
|
|
|
1582
1623
|
const fullInitials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
|
|
1583
1624
|
const initials = size === "sm" ? fullInitials.slice(0, 1) : fullInitials;
|
|
1584
1625
|
const catIndex = getColorIndex(name || "");
|
|
1585
|
-
return /* @__PURE__ */
|
|
1626
|
+
return /* @__PURE__ */ jsx299("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ jsx299("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ jsx299("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ jsx299("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx299("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }) });
|
|
1586
1627
|
};
|
|
1587
1628
|
Avatar.displayName = "Avatar";
|
|
1588
1629
|
var Avatar_default = Avatar;
|
|
1589
1630
|
|
|
1590
1631
|
// src/components/Box/Box.tsx
|
|
1591
|
-
import { jsx as
|
|
1632
|
+
import { jsx as jsx300, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
1592
1633
|
var Box = ({
|
|
1593
1634
|
children,
|
|
1594
1635
|
title,
|
|
1595
1636
|
variant = "outlined",
|
|
1596
1637
|
padding = "md"
|
|
1597
1638
|
}) => {
|
|
1598
|
-
return /* @__PURE__ */
|
|
1599
|
-
title && /* @__PURE__ */
|
|
1600
|
-
/* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsxs192("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
1640
|
+
title && /* @__PURE__ */ jsx300("div", { className: "box-title", children: title }),
|
|
1641
|
+
/* @__PURE__ */ jsx300("div", { className: "box-content", children })
|
|
1601
1642
|
] });
|
|
1602
1643
|
};
|
|
1603
1644
|
Box.displayName = "Box";
|
|
1604
1645
|
var Box_default = Box;
|
|
1605
1646
|
|
|
1606
1647
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
1607
|
-
import { jsx as
|
|
1648
|
+
import { jsx as jsx301, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
1608
1649
|
var Breadcrumb = (props) => {
|
|
1609
1650
|
const { items, separator = "/" } = props;
|
|
1610
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsx301("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ jsx301("ol", { children: items.map((item, index) => {
|
|
1611
1652
|
const isLast = index === items.length - 1;
|
|
1612
|
-
return /* @__PURE__ */
|
|
1613
|
-
isLast ? /* @__PURE__ */
|
|
1614
|
-
!isLast && /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ jsxs193("li", { children: [
|
|
1654
|
+
isLast ? /* @__PURE__ */ jsx301("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ jsx301("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ jsx301("button", { className: "link", onClick: item.onClick, children: item.label }),
|
|
1655
|
+
!isLast && /* @__PURE__ */ jsx301("span", { className: "separator", children: separator })
|
|
1615
1656
|
] }, index);
|
|
1616
1657
|
}) }) });
|
|
1617
1658
|
};
|
|
@@ -1619,7 +1660,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
1619
1660
|
var Breadcrumb_default = Breadcrumb;
|
|
1620
1661
|
|
|
1621
1662
|
// src/components/Button/Button.tsx
|
|
1622
|
-
import { jsx as
|
|
1663
|
+
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
1623
1664
|
var Button = (props) => {
|
|
1624
1665
|
const {
|
|
1625
1666
|
children,
|
|
@@ -1628,7 +1669,7 @@ var Button = (props) => {
|
|
|
1628
1669
|
disabled,
|
|
1629
1670
|
...rest
|
|
1630
1671
|
} = props;
|
|
1631
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsx302(
|
|
1632
1673
|
"button",
|
|
1633
1674
|
{
|
|
1634
1675
|
className: clsx_default("lib-xplat-button", type, size),
|
|
@@ -1745,7 +1786,7 @@ var MONTH_LABELS = {
|
|
|
1745
1786
|
};
|
|
1746
1787
|
|
|
1747
1788
|
// src/components/Calendar/Calendar.tsx
|
|
1748
|
-
import { Fragment, jsx as
|
|
1789
|
+
import { Fragment as Fragment2, jsx as jsx303, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
1749
1790
|
var DayCell = React4.memo(
|
|
1750
1791
|
({
|
|
1751
1792
|
day,
|
|
@@ -1757,7 +1798,7 @@ var DayCell = React4.memo(
|
|
|
1757
1798
|
onEventClick
|
|
1758
1799
|
}) => {
|
|
1759
1800
|
if (renderDay) {
|
|
1760
|
-
return /* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ jsx303(
|
|
1761
1802
|
"div",
|
|
1762
1803
|
{
|
|
1763
1804
|
className: clsx_default(
|
|
@@ -1774,7 +1815,7 @@ var DayCell = React4.memo(
|
|
|
1774
1815
|
}
|
|
1775
1816
|
);
|
|
1776
1817
|
}
|
|
1777
|
-
return /* @__PURE__ */
|
|
1818
|
+
return /* @__PURE__ */ jsxs194(
|
|
1778
1819
|
"div",
|
|
1779
1820
|
{
|
|
1780
1821
|
className: clsx_default(
|
|
@@ -1790,9 +1831,9 @@ var DayCell = React4.memo(
|
|
|
1790
1831
|
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
1791
1832
|
},
|
|
1792
1833
|
children: [
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
dayEvents.length > 0 && /* @__PURE__ */
|
|
1795
|
-
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */
|
|
1834
|
+
/* @__PURE__ */ jsx303("span", { className: "calendar-day-number", children: day.day }),
|
|
1835
|
+
dayEvents.length > 0 && /* @__PURE__ */ jsxs194("div", { className: "calendar-day-events", children: [
|
|
1836
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx303(
|
|
1796
1837
|
"span",
|
|
1797
1838
|
{
|
|
1798
1839
|
className: "calendar-event-dot",
|
|
@@ -1805,7 +1846,7 @@ var DayCell = React4.memo(
|
|
|
1805
1846
|
},
|
|
1806
1847
|
ei
|
|
1807
1848
|
)),
|
|
1808
|
-
dayEvents.length > 3 && /* @__PURE__ */
|
|
1849
|
+
dayEvents.length > 3 && /* @__PURE__ */ jsxs194("span", { className: "calendar-event-more", children: [
|
|
1809
1850
|
"+",
|
|
1810
1851
|
dayEvents.length - 3
|
|
1811
1852
|
] })
|
|
@@ -1926,21 +1967,21 @@ var Calendar = (props) => {
|
|
|
1926
1967
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
1927
1968
|
const monthLabels = MONTH_LABELS[locale];
|
|
1928
1969
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
1929
|
-
return /* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ jsxs194(
|
|
1930
1971
|
"div",
|
|
1931
1972
|
{
|
|
1932
1973
|
className: "lib-xplat-calendar",
|
|
1933
1974
|
style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
|
|
1934
1975
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
showToday && /* @__PURE__ */
|
|
1976
|
+
/* @__PURE__ */ jsxs194("div", { className: "calendar-header", children: [
|
|
1977
|
+
/* @__PURE__ */ jsx303("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ jsx303(ChevronLeftIcon_default, {}) }),
|
|
1978
|
+
/* @__PURE__ */ jsx303("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
1979
|
+
/* @__PURE__ */ jsx303("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ jsx303(ChevronRightIcon_default, {}) }),
|
|
1980
|
+
showToday && /* @__PURE__ */ jsx303("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
|
|
1940
1981
|
] }),
|
|
1941
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
1982
|
+
pickerMode === "years" && /* @__PURE__ */ jsx303("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
1942
1983
|
const y = yearRangeStart + i;
|
|
1943
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ jsx303(
|
|
1944
1985
|
"button",
|
|
1945
1986
|
{
|
|
1946
1987
|
type: "button",
|
|
@@ -1951,7 +1992,7 @@ var Calendar = (props) => {
|
|
|
1951
1992
|
y
|
|
1952
1993
|
);
|
|
1953
1994
|
}) }),
|
|
1954
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
1995
|
+
pickerMode === "months" && /* @__PURE__ */ jsx303("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx303(
|
|
1955
1996
|
"button",
|
|
1956
1997
|
{
|
|
1957
1998
|
type: "button",
|
|
@@ -1961,8 +2002,8 @@ var Calendar = (props) => {
|
|
|
1961
2002
|
},
|
|
1962
2003
|
i
|
|
1963
2004
|
)) }),
|
|
1964
|
-
pickerMode === "days" && /* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */
|
|
2005
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs194(Fragment2, { children: [
|
|
2006
|
+
/* @__PURE__ */ jsx303("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx303(
|
|
1966
2007
|
"div",
|
|
1967
2008
|
{
|
|
1968
2009
|
className: clsx_default(
|
|
@@ -1974,12 +2015,12 @@ var Calendar = (props) => {
|
|
|
1974
2015
|
},
|
|
1975
2016
|
label
|
|
1976
2017
|
)) }),
|
|
1977
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ jsx303("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
1978
2019
|
const dayEvents = getEventsForDay(day.date);
|
|
1979
2020
|
const t = day.date.getTime();
|
|
1980
2021
|
const disabled = t < minTime || t > maxTime;
|
|
1981
2022
|
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
1982
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ jsx303(
|
|
1983
2024
|
DayCell,
|
|
1984
2025
|
{
|
|
1985
2026
|
day,
|
|
@@ -2005,10 +2046,10 @@ var Calendar_default = Calendar;
|
|
|
2005
2046
|
import React5 from "react";
|
|
2006
2047
|
|
|
2007
2048
|
// src/components/CardTab/CardTabPanel.tsx
|
|
2008
|
-
import { jsx as
|
|
2049
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
2009
2050
|
var CardTabPanel = (props) => {
|
|
2010
2051
|
const { children, columns = 3 } = props;
|
|
2011
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ jsx304(
|
|
2012
2053
|
"div",
|
|
2013
2054
|
{
|
|
2014
2055
|
className: "card-tab-panel",
|
|
@@ -2021,7 +2062,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
2021
2062
|
var CardTabPanel_default = CardTabPanel;
|
|
2022
2063
|
|
|
2023
2064
|
// src/components/CardTab/CardTab.tsx
|
|
2024
|
-
import { jsx as
|
|
2065
|
+
import { jsx as jsx305, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
2025
2066
|
var CardTabRoot = (props) => {
|
|
2026
2067
|
const {
|
|
2027
2068
|
tabs,
|
|
@@ -2045,10 +2086,10 @@ var CardTabRoot = (props) => {
|
|
|
2045
2086
|
const activePanel = panels.find(
|
|
2046
2087
|
(panel) => panel.props.value === activeValue
|
|
2047
2088
|
);
|
|
2048
|
-
return /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2089
|
+
return /* @__PURE__ */ jsxs195("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
2090
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
2050
2091
|
const isActive2 = tab.value === activeValue;
|
|
2051
|
-
return /* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ jsx305(
|
|
2052
2093
|
"button",
|
|
2053
2094
|
{
|
|
2054
2095
|
className: clsx_default("card-tab-trigger", isActive2 && "active"),
|
|
@@ -2060,7 +2101,7 @@ var CardTabRoot = (props) => {
|
|
|
2060
2101
|
tab.value
|
|
2061
2102
|
);
|
|
2062
2103
|
}) }),
|
|
2063
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-body", children: activePanel })
|
|
2064
2105
|
] });
|
|
2065
2106
|
};
|
|
2066
2107
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -2071,7 +2112,7 @@ var CardTab_default = CardTab;
|
|
|
2071
2112
|
|
|
2072
2113
|
// src/components/Chart/Chart.tsx
|
|
2073
2114
|
import React6 from "react";
|
|
2074
|
-
import { Fragment as
|
|
2115
|
+
import { Fragment as Fragment3, jsx as jsx306, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
2075
2116
|
var CATEGORICAL_COUNT2 = 8;
|
|
2076
2117
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
2077
2118
|
const n = i + 1;
|
|
@@ -2214,12 +2255,12 @@ var formatTick = (value, maxVal) => {
|
|
|
2214
2255
|
const fixed = value.toFixed(decimals);
|
|
2215
2256
|
return decimals === 0 ? Number(fixed).toLocaleString("en-US") : fixed;
|
|
2216
2257
|
};
|
|
2217
|
-
var GridLines = React6.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */
|
|
2258
|
+
var GridLines = React6.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx306(Fragment3, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2218
2259
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2219
2260
|
const val = formatTick(maxVal * ratio, maxVal);
|
|
2220
|
-
return /* @__PURE__ */
|
|
2221
|
-
/* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2261
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2262
|
+
/* @__PURE__ */ jsx306("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2263
|
+
/* @__PURE__ */ jsx306("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2223
2264
|
] }, ratio);
|
|
2224
2265
|
}) }));
|
|
2225
2266
|
GridLines.displayName = "GridLines";
|
|
@@ -2231,10 +2272,10 @@ var getLabelStep = (count, chartW) => {
|
|
|
2231
2272
|
};
|
|
2232
2273
|
var AxisLabels = React6.memo(({ labels, count, chartW, height }) => {
|
|
2233
2274
|
const step = getLabelStep(count, chartW);
|
|
2234
|
-
return /* @__PURE__ */
|
|
2275
|
+
return /* @__PURE__ */ jsx306(Fragment3, { children: labels.map((label, i) => {
|
|
2235
2276
|
if (i % step !== 0) return null;
|
|
2236
2277
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2237
|
-
return /* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ jsx306("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2238
2279
|
}) });
|
|
2239
2280
|
});
|
|
2240
2281
|
AxisLabels.displayName = "AxisLabels";
|
|
@@ -2310,7 +2351,7 @@ var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2310
2351
|
}, [animate, width]);
|
|
2311
2352
|
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
|
|
2312
2353
|
const lineClipId = "line-area-clip";
|
|
2313
|
-
return /* @__PURE__ */
|
|
2354
|
+
return /* @__PURE__ */ jsxs196(
|
|
2314
2355
|
"svg",
|
|
2315
2356
|
{
|
|
2316
2357
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -2328,9 +2369,9 @@ var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2328
2369
|
onLeave();
|
|
2329
2370
|
},
|
|
2330
2371
|
children: [
|
|
2331
|
-
animate && /* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
/* @__PURE__ */
|
|
2372
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("clipPath", { id: lineClipId, children: /* @__PURE__ */ jsx306("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
2373
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2374
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
2334
2375
|
entries.map(([key], di) => {
|
|
2335
2376
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2336
2377
|
const color = palette[2];
|
|
@@ -2339,16 +2380,16 @@ var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2339
2380
|
const gradientId = `line-gradient-${di}`;
|
|
2340
2381
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
2341
2382
|
const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
|
|
2342
|
-
return /* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
2344
|
-
/* @__PURE__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
2383
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2384
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2385
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
2386
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
2346
2387
|
] }) }),
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
/* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2388
|
+
/* @__PURE__ */ jsxs196("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
|
|
2389
|
+
/* @__PURE__ */ jsx306("path", { d: areaD, fill: `url(#${gradientId})` }),
|
|
2390
|
+
/* @__PURE__ */ jsx306("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
|
|
2350
2391
|
] }),
|
|
2351
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */
|
|
2392
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ jsx306(
|
|
2352
2393
|
"circle",
|
|
2353
2394
|
{
|
|
2354
2395
|
cx: points[activeIndex].x,
|
|
@@ -2360,7 +2401,7 @@ var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2360
2401
|
)
|
|
2361
2402
|
] }, di);
|
|
2362
2403
|
}),
|
|
2363
|
-
activeX !== null && /* @__PURE__ */
|
|
2404
|
+
activeX !== null && /* @__PURE__ */ jsx306(
|
|
2364
2405
|
"line",
|
|
2365
2406
|
{
|
|
2366
2407
|
x1: activeX,
|
|
@@ -2370,7 +2411,7 @@ var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2370
2411
|
className: "chart-crosshair"
|
|
2371
2412
|
}
|
|
2372
2413
|
),
|
|
2373
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ jsx306(
|
|
2374
2415
|
"rect",
|
|
2375
2416
|
{
|
|
2376
2417
|
x: PADDING.left,
|
|
@@ -2419,7 +2460,7 @@ var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2419
2460
|
}, [animate, width]);
|
|
2420
2461
|
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
|
|
2421
2462
|
const curveClipId = "curve-area-clip";
|
|
2422
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ jsxs196(
|
|
2423
2464
|
"svg",
|
|
2424
2465
|
{
|
|
2425
2466
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -2438,9 +2479,9 @@ var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2438
2479
|
onLeave();
|
|
2439
2480
|
},
|
|
2440
2481
|
children: [
|
|
2441
|
-
animate && /* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2482
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("clipPath", { id: curveClipId, children: /* @__PURE__ */ jsx306("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
2483
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2484
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
2444
2485
|
entries.map(([key], di) => {
|
|
2445
2486
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2446
2487
|
const color = palette[2];
|
|
@@ -2449,16 +2490,16 @@ var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2449
2490
|
const gradientId = `curve-gradient-${di}`;
|
|
2450
2491
|
const linePath = toSmoothPath(points);
|
|
2451
2492
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
2452
|
-
return /* @__PURE__ */
|
|
2453
|
-
/* @__PURE__ */
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2494
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2495
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
2496
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
2456
2497
|
] }) }),
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ jsxs196("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
|
|
2499
|
+
/* @__PURE__ */ jsx306("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
2500
|
+
/* @__PURE__ */ jsx306("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
|
|
2460
2501
|
] }),
|
|
2461
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */
|
|
2502
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ jsx306(
|
|
2462
2503
|
"circle",
|
|
2463
2504
|
{
|
|
2464
2505
|
cx: points[activeIndex].x,
|
|
@@ -2470,7 +2511,7 @@ var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2470
2511
|
)
|
|
2471
2512
|
] }, di);
|
|
2472
2513
|
}),
|
|
2473
|
-
activeX !== null && /* @__PURE__ */
|
|
2514
|
+
activeX !== null && /* @__PURE__ */ jsx306(
|
|
2474
2515
|
"line",
|
|
2475
2516
|
{
|
|
2476
2517
|
x1: activeX,
|
|
@@ -2480,7 +2521,7 @@ var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2480
2521
|
className: "chart-crosshair"
|
|
2481
2522
|
}
|
|
2482
2523
|
),
|
|
2483
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ jsx306(
|
|
2484
2525
|
"rect",
|
|
2485
2526
|
{
|
|
2486
2527
|
x: PADDING.left,
|
|
@@ -2523,11 +2564,11 @@ var BarChart = React6.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2523
2564
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
2524
2565
|
);
|
|
2525
2566
|
const barLabelStep = getLabelStep(count, chartW);
|
|
2526
|
-
return /* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2567
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2568
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2528
2569
|
labels.map((label, i) => {
|
|
2529
2570
|
if (i % barLabelStep !== 0) return null;
|
|
2530
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx306("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2531
2572
|
}),
|
|
2532
2573
|
entries.map(([key], di) => {
|
|
2533
2574
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -2536,7 +2577,7 @@ var BarChart = React6.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2536
2577
|
const r2 = Math.min(4, b.w / 2);
|
|
2537
2578
|
const d = b.h <= r2 ? `M ${b.x} ${b.y + b.h} V ${b.y} H ${b.x + b.w} V ${b.y + b.h} Z` : `M ${b.x} ${b.y + b.h} V ${b.y + r2} Q ${b.x} ${b.y} ${b.x + r2} ${b.y} H ${b.x + b.w - r2} Q ${b.x + b.w} ${b.y} ${b.x + b.w} ${b.y + r2} V ${b.y + b.h} Z`;
|
|
2538
2579
|
const delay = 100 + i * 80;
|
|
2539
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ jsx306(
|
|
2540
2581
|
"path",
|
|
2541
2582
|
{
|
|
2542
2583
|
d,
|
|
@@ -2616,8 +2657,8 @@ var PieDonutChart = React6.memo(
|
|
|
2616
2657
|
});
|
|
2617
2658
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
2618
2659
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
2619
|
-
return /* @__PURE__ */
|
|
2620
|
-
animate && /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
2661
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("mask", { id: maskId, children: /* @__PURE__ */ jsx306(
|
|
2621
2662
|
"circle",
|
|
2622
2663
|
{
|
|
2623
2664
|
ref: maskRef,
|
|
@@ -2630,7 +2671,7 @@ var PieDonutChart = React6.memo(
|
|
|
2630
2671
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
2631
2672
|
}
|
|
2632
2673
|
) }) }),
|
|
2633
|
-
/* @__PURE__ */
|
|
2674
|
+
/* @__PURE__ */ jsx306("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ jsx306("g", { children: /* @__PURE__ */ jsx306(
|
|
2634
2675
|
"path",
|
|
2635
2676
|
{
|
|
2636
2677
|
d: s.d,
|
|
@@ -2665,15 +2706,15 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
|
|
|
2665
2706
|
const sepIdx = content.indexOf(" \u2014 ");
|
|
2666
2707
|
const title = sepIdx >= 0 ? content.slice(0, sepIdx) : content;
|
|
2667
2708
|
const desc = sepIdx >= 0 ? content.slice(sepIdx + 3) : "";
|
|
2668
|
-
return /* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ jsxs196(
|
|
2669
2710
|
"div",
|
|
2670
2711
|
{
|
|
2671
2712
|
ref,
|
|
2672
2713
|
className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
|
|
2673
2714
|
style: { left: pos.left, top: pos.top },
|
|
2674
2715
|
children: [
|
|
2675
|
-
title && /* @__PURE__ */
|
|
2676
|
-
desc && /* @__PURE__ */
|
|
2716
|
+
title && /* @__PURE__ */ jsx306("div", { className: "tooltip-title", children: title }),
|
|
2717
|
+
desc && /* @__PURE__ */ jsx306("div", { className: "tooltip-desc", children: desc })
|
|
2677
2718
|
]
|
|
2678
2719
|
}
|
|
2679
2720
|
);
|
|
@@ -2685,14 +2726,14 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2685
2726
|
const total = values.reduce((a, b) => a + b, 0) || 1;
|
|
2686
2727
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2687
2728
|
const colorOffset = hashString(firstKey);
|
|
2688
|
-
return /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ jsx306("div", { className: "chart-legend", children: values.map((v, i) => {
|
|
2689
2730
|
const pct = Math.round(v / total * 100);
|
|
2690
2731
|
const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
|
|
2691
|
-
return /* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2732
|
+
return /* @__PURE__ */ jsxs196("div", { className: "chart-legend-item", children: [
|
|
2733
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
2734
|
+
/* @__PURE__ */ jsxs196("div", { className: "chart-legend-text", children: [
|
|
2735
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
|
|
2736
|
+
/* @__PURE__ */ jsxs196("span", { className: "chart-legend-value", children: [
|
|
2696
2737
|
v.toLocaleString(),
|
|
2697
2738
|
"(",
|
|
2698
2739
|
pct,
|
|
@@ -2702,22 +2743,23 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2702
2743
|
] }, i);
|
|
2703
2744
|
}) });
|
|
2704
2745
|
}
|
|
2705
|
-
return /* @__PURE__ */
|
|
2746
|
+
return /* @__PURE__ */ jsx306("div", { className: "chart-legend", children: entries.map(([key], di) => {
|
|
2706
2747
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2707
2748
|
const color = palette[2];
|
|
2708
2749
|
const values = entries[di][1];
|
|
2709
2750
|
const sum = values.reduce((a, b) => a + b, 0);
|
|
2710
|
-
return /* @__PURE__ */
|
|
2711
|
-
/* @__PURE__ */
|
|
2712
|
-
/* @__PURE__ */
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
2751
|
+
return /* @__PURE__ */ jsxs196("div", { className: "chart-legend-item", children: [
|
|
2752
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
2753
|
+
/* @__PURE__ */ jsxs196("div", { className: "chart-legend-text", children: [
|
|
2754
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-label", children: key }),
|
|
2755
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-value", children: sum.toLocaleString() })
|
|
2715
2756
|
] })
|
|
2716
2757
|
] }, di);
|
|
2717
2758
|
}) });
|
|
2718
2759
|
};
|
|
2719
2760
|
var Chart = React6.memo((props) => {
|
|
2720
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2761
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2762
|
+
const shape = variant ?? type ?? "line";
|
|
2721
2763
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2722
2764
|
const { width, height } = useChartSize(containerRef);
|
|
2723
2765
|
const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -2725,14 +2767,14 @@ var Chart = React6.memo((props) => {
|
|
|
2725
2767
|
const dataKey = React6.useMemo(() => JSON.stringify(labels), [labels]);
|
|
2726
2768
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2727
2769
|
const ready = width > 0 && height > 0;
|
|
2728
|
-
return /* @__PURE__ */
|
|
2729
|
-
ready &&
|
|
2730
|
-
ready &&
|
|
2731
|
-
ready &&
|
|
2732
|
-
ready &&
|
|
2733
|
-
ready &&
|
|
2734
|
-
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */
|
|
2735
|
-
tooltip.visible && tooltip.content && /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2771
|
+
ready && shape === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2772
|
+
ready && shape === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2773
|
+
ready && shape === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2774
|
+
ready && shape === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2775
|
+
ready && shape === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2776
|
+
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
2777
|
+
tooltip.visible && tooltip.content && /* @__PURE__ */ jsx306(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
2736
2778
|
] });
|
|
2737
2779
|
});
|
|
2738
2780
|
Chart.displayName = "Chart";
|
|
@@ -2742,7 +2784,7 @@ var Chart_default = Chart;
|
|
|
2742
2784
|
import React7 from "react";
|
|
2743
2785
|
|
|
2744
2786
|
// src/components/IconButton/IconButton.tsx
|
|
2745
|
-
import { jsx as
|
|
2787
|
+
import { jsx as jsx307 } from "react/jsx-runtime";
|
|
2746
2788
|
var IconButton = (props) => {
|
|
2747
2789
|
const {
|
|
2748
2790
|
icon,
|
|
@@ -2751,7 +2793,7 @@ var IconButton = (props) => {
|
|
|
2751
2793
|
disabled,
|
|
2752
2794
|
...rest
|
|
2753
2795
|
} = props;
|
|
2754
|
-
return /* @__PURE__ */
|
|
2796
|
+
return /* @__PURE__ */ jsx307(
|
|
2755
2797
|
"button",
|
|
2756
2798
|
{
|
|
2757
2799
|
className: clsx_default("lib-xplat-icon-button", type, size),
|
|
@@ -2765,7 +2807,7 @@ IconButton.displayName = "IconButton";
|
|
|
2765
2807
|
var IconButton_default = IconButton;
|
|
2766
2808
|
|
|
2767
2809
|
// src/components/ChatInput/ChatInput.tsx
|
|
2768
|
-
import { jsx as
|
|
2810
|
+
import { jsx as jsx308, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
2769
2811
|
var ChatInput = React7.forwardRef(
|
|
2770
2812
|
(props, ref) => {
|
|
2771
2813
|
const {
|
|
@@ -2774,7 +2816,8 @@ var ChatInput = React7.forwardRef(
|
|
|
2774
2816
|
disabled = false,
|
|
2775
2817
|
buttonType = "primary",
|
|
2776
2818
|
onSubmit,
|
|
2777
|
-
onChange
|
|
2819
|
+
onChange,
|
|
2820
|
+
validations
|
|
2778
2821
|
} = props;
|
|
2779
2822
|
const isControlled = valueProp !== void 0;
|
|
2780
2823
|
const [internalValue, setInternalValue] = React7.useState("");
|
|
@@ -2796,8 +2839,8 @@ var ChatInput = React7.forwardRef(
|
|
|
2796
2839
|
handleSubmit();
|
|
2797
2840
|
}
|
|
2798
2841
|
};
|
|
2799
|
-
|
|
2800
|
-
/* @__PURE__ */
|
|
2842
|
+
const control = /* @__PURE__ */ jsxs197("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
2843
|
+
/* @__PURE__ */ jsx308(
|
|
2801
2844
|
AutoResizeTextArea_default,
|
|
2802
2845
|
{
|
|
2803
2846
|
ref,
|
|
@@ -2808,13 +2851,14 @@ var ChatInput = React7.forwardRef(
|
|
|
2808
2851
|
disabled,
|
|
2809
2852
|
rows: 1,
|
|
2810
2853
|
onChange: handleChange,
|
|
2854
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
2811
2855
|
onKeyDown: handleKeyDown
|
|
2812
2856
|
}
|
|
2813
2857
|
),
|
|
2814
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ jsx308(
|
|
2815
2859
|
IconButton_default,
|
|
2816
2860
|
{
|
|
2817
|
-
icon: /* @__PURE__ */
|
|
2861
|
+
icon: /* @__PURE__ */ jsx308(MessageSquareIcon_default, {}),
|
|
2818
2862
|
type: buttonType,
|
|
2819
2863
|
size: "sm",
|
|
2820
2864
|
disabled: !hasText || disabled,
|
|
@@ -2823,6 +2867,7 @@ var ChatInput = React7.forwardRef(
|
|
|
2823
2867
|
}
|
|
2824
2868
|
)
|
|
2825
2869
|
] });
|
|
2870
|
+
return /* @__PURE__ */ jsx308(Field, { validations, children: control });
|
|
2826
2871
|
}
|
|
2827
2872
|
);
|
|
2828
2873
|
ChatInput.displayName = "ChatInput";
|
|
@@ -2834,8 +2879,11 @@ import { semantic } from "@x-plat/tokens-core";
|
|
|
2834
2879
|
// src/tokens/index.ts
|
|
2835
2880
|
import { cssVar } from "@x-plat/tokens-core";
|
|
2836
2881
|
|
|
2882
|
+
// src/tokens/interface/status.ts
|
|
2883
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
2884
|
+
|
|
2837
2885
|
// src/components/CheckBox/CheckBox.tsx
|
|
2838
|
-
import { jsx as
|
|
2886
|
+
import { jsx as jsx309, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2839
2887
|
var CheckBox = (props) => {
|
|
2840
2888
|
const {
|
|
2841
2889
|
checked,
|
|
@@ -2844,9 +2892,11 @@ var CheckBox = (props) => {
|
|
|
2844
2892
|
onChange,
|
|
2845
2893
|
disabled,
|
|
2846
2894
|
size = "md",
|
|
2847
|
-
type = "
|
|
2895
|
+
type = "primary",
|
|
2896
|
+
validations,
|
|
2848
2897
|
...rest
|
|
2849
2898
|
} = props;
|
|
2899
|
+
const statusType = normalizeStatus(type);
|
|
2850
2900
|
const handleChange = (e) => {
|
|
2851
2901
|
if (onChange) onChange(e);
|
|
2852
2902
|
};
|
|
@@ -2854,33 +2904,35 @@ var CheckBox = (props) => {
|
|
|
2854
2904
|
const checkedClasses = `checked`;
|
|
2855
2905
|
const disabledClasses = "disabled";
|
|
2856
2906
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2857
|
-
|
|
2858
|
-
/* @__PURE__ */
|
|
2907
|
+
const control = /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
2908
|
+
/* @__PURE__ */ jsx309(
|
|
2859
2909
|
"input",
|
|
2860
2910
|
{
|
|
2861
2911
|
type: "checkbox",
|
|
2862
2912
|
checked,
|
|
2863
2913
|
onChange: handleChange,
|
|
2864
2914
|
disabled,
|
|
2915
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
2865
2916
|
...rest
|
|
2866
2917
|
}
|
|
2867
2918
|
),
|
|
2868
|
-
/* @__PURE__ */
|
|
2869
|
-
label && /* @__PURE__ */
|
|
2919
|
+
/* @__PURE__ */ jsx309("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx309("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx309(CheckIcon_default, {}) }) }),
|
|
2920
|
+
label && /* @__PURE__ */ jsx309("span", { className: "label", children: label })
|
|
2870
2921
|
] });
|
|
2922
|
+
return /* @__PURE__ */ jsx309(Field, { validations, children: control });
|
|
2871
2923
|
};
|
|
2872
2924
|
CheckBox.displayName = "CheckBox";
|
|
2873
2925
|
var CheckBox_default = CheckBox;
|
|
2874
2926
|
|
|
2875
2927
|
// src/components/Chip/Chip.tsx
|
|
2876
|
-
import { jsx as
|
|
2928
|
+
import { jsx as jsx310 } from "react/jsx-runtime";
|
|
2877
2929
|
var Chip = (props) => {
|
|
2878
2930
|
const {
|
|
2879
2931
|
children,
|
|
2880
2932
|
type = "primary",
|
|
2881
2933
|
size = "md"
|
|
2882
2934
|
} = props;
|
|
2883
|
-
return /* @__PURE__ */
|
|
2935
|
+
return /* @__PURE__ */ jsx310("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
2884
2936
|
};
|
|
2885
2937
|
Chip.displayName = "Chip";
|
|
2886
2938
|
var Chip_default = Chip;
|
|
@@ -2891,23 +2943,6 @@ import React12 from "react";
|
|
|
2891
2943
|
// src/components/Input/Input.tsx
|
|
2892
2944
|
import React8 from "react";
|
|
2893
2945
|
|
|
2894
|
-
// src/components/Input/InputValidations.tsx
|
|
2895
|
-
import { jsx as jsx310, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2896
|
-
var InputValidations = (props) => {
|
|
2897
|
-
const { message, status = "default" } = props;
|
|
2898
|
-
return /* @__PURE__ */ jsxs198("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2899
|
-
/* @__PURE__ */ jsxs198("div", { className: "icon", children: [
|
|
2900
|
-
status === "default" && /* @__PURE__ */ jsx310(InfoIcon_default, {}),
|
|
2901
|
-
status === "success" && /* @__PURE__ */ jsx310(SuccessIcon_default, {}),
|
|
2902
|
-
status === "warning" && /* @__PURE__ */ jsx310(InfoIcon_default, {}),
|
|
2903
|
-
status === "error" && /* @__PURE__ */ jsx310(ErrorIcon_default, {})
|
|
2904
|
-
] }),
|
|
2905
|
-
/* @__PURE__ */ jsx310("div", { className: "message", children: message })
|
|
2906
|
-
] });
|
|
2907
|
-
};
|
|
2908
|
-
InputValidations.displayName = "InputValidations";
|
|
2909
|
-
var InputValidations_default = InputValidations;
|
|
2910
|
-
|
|
2911
2946
|
// src/components/Input/reg.ts
|
|
2912
2947
|
var numberAndCommaReg = /^[0-9,]+$/;
|
|
2913
2948
|
var phoneNumberMaxLengthReg = /^.{0,13}$/;
|
|
@@ -2944,7 +2979,6 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
2944
2979
|
|
|
2945
2980
|
// src/components/Input/Input.tsx
|
|
2946
2981
|
import { jsx as jsx311, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
2947
|
-
import { createElement } from "react";
|
|
2948
2982
|
var formatValue = (type, value) => {
|
|
2949
2983
|
if (value === null || value === void 0) return "";
|
|
2950
2984
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -3033,20 +3067,15 @@ var Input = React8.forwardRef((props, ref) => {
|
|
|
3033
3067
|
disabled,
|
|
3034
3068
|
type: type === "number" ? "text" : type,
|
|
3035
3069
|
value: localValue,
|
|
3036
|
-
onChange: handleChange
|
|
3070
|
+
onChange: handleChange,
|
|
3071
|
+
"aria-invalid": hasError(validations) || void 0
|
|
3037
3072
|
}
|
|
3038
3073
|
),
|
|
3039
3074
|
suffix && /* @__PURE__ */ jsx311("div", { className: "suffix", children: suffix })
|
|
3040
3075
|
]
|
|
3041
3076
|
}
|
|
3042
3077
|
),
|
|
3043
|
-
|
|
3044
|
-
InputValidations_default,
|
|
3045
|
-
{
|
|
3046
|
-
...validation,
|
|
3047
|
-
key: `${validation.message}_${idx}`
|
|
3048
|
-
}
|
|
3049
|
-
)) })
|
|
3078
|
+
/* @__PURE__ */ jsx311(FieldMessage_default, { validations })
|
|
3050
3079
|
] });
|
|
3051
3080
|
});
|
|
3052
3081
|
Input.displayName = "Input";
|
|
@@ -3130,7 +3159,7 @@ var Modal_default = Modal;
|
|
|
3130
3159
|
|
|
3131
3160
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
3132
3161
|
import React11 from "react";
|
|
3133
|
-
import { Fragment as
|
|
3162
|
+
import { Fragment as Fragment4, jsx as jsx314, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
3134
3163
|
var DayCell2 = React11.memo(
|
|
3135
3164
|
({
|
|
3136
3165
|
day,
|
|
@@ -3273,7 +3302,7 @@ var SingleDatePicker = (props) => {
|
|
|
3273
3302
|
},
|
|
3274
3303
|
i
|
|
3275
3304
|
)) }),
|
|
3276
|
-
pickerMode === "days" && /* @__PURE__ */ jsxs200(
|
|
3305
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment4, { children: [
|
|
3277
3306
|
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx314(
|
|
3278
3307
|
"div",
|
|
3279
3308
|
{
|
|
@@ -3410,7 +3439,8 @@ var TabItem_default = TabItem;
|
|
|
3410
3439
|
// src/components/Tab/Tab.tsx
|
|
3411
3440
|
import { jsx as jsx317, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
3412
3441
|
var Tab = (props) => {
|
|
3413
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3442
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
3443
|
+
const shape = variant ?? type ?? "default";
|
|
3414
3444
|
const [underlineStyle, setUnderlineStyle] = React14.useState({
|
|
3415
3445
|
left: 0,
|
|
3416
3446
|
width: 0
|
|
@@ -3425,7 +3455,7 @@ var Tab = (props) => {
|
|
|
3425
3455
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3426
3456
|
}
|
|
3427
3457
|
}, [activeIndex, tabs.length]);
|
|
3428
|
-
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
3458
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
3429
3459
|
tabs.map((tab, idx) => /* @__PURE__ */ jsx317(
|
|
3430
3460
|
TabItem_default,
|
|
3431
3461
|
{
|
|
@@ -3438,7 +3468,7 @@ var Tab = (props) => {
|
|
|
3438
3468
|
},
|
|
3439
3469
|
`${tab.value}_${idx}`
|
|
3440
3470
|
)),
|
|
3441
|
-
|
|
3471
|
+
shape === "toggle" && /* @__PURE__ */ jsx317(
|
|
3442
3472
|
"div",
|
|
3443
3473
|
{
|
|
3444
3474
|
className: "tab-toggle-underline",
|
|
@@ -4562,7 +4592,8 @@ var FileUpload = (props) => {
|
|
|
4562
4592
|
maxSize,
|
|
4563
4593
|
onChange,
|
|
4564
4594
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
4565
|
-
description
|
|
4595
|
+
description,
|
|
4596
|
+
validations
|
|
4566
4597
|
} = props;
|
|
4567
4598
|
const [isDragOver, setIsDragOver] = React22.useState(false);
|
|
4568
4599
|
const inputRef = React22.useRef(null);
|
|
@@ -4595,7 +4626,7 @@ var FileUpload = (props) => {
|
|
|
4595
4626
|
handleFiles(e.target.files);
|
|
4596
4627
|
}
|
|
4597
4628
|
};
|
|
4598
|
-
|
|
4629
|
+
const control = /* @__PURE__ */ jsxs209(
|
|
4599
4630
|
"div",
|
|
4600
4631
|
{
|
|
4601
4632
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -4611,7 +4642,8 @@ var FileUpload = (props) => {
|
|
|
4611
4642
|
type: "file",
|
|
4612
4643
|
accept,
|
|
4613
4644
|
multiple,
|
|
4614
|
-
onChange: handleChange
|
|
4645
|
+
onChange: handleChange,
|
|
4646
|
+
"aria-invalid": hasError(validations) || void 0
|
|
4615
4647
|
}
|
|
4616
4648
|
),
|
|
4617
4649
|
/* @__PURE__ */ jsx325("div", { className: "upload-icon", children: /* @__PURE__ */ jsx325(UploadIcon_default, {}) }),
|
|
@@ -4620,6 +4652,7 @@ var FileUpload = (props) => {
|
|
|
4620
4652
|
]
|
|
4621
4653
|
}
|
|
4622
4654
|
);
|
|
4655
|
+
return /* @__PURE__ */ jsx325(Field, { validations, children: control });
|
|
4623
4656
|
};
|
|
4624
4657
|
FileUpload.displayName = "FileUpload";
|
|
4625
4658
|
var FileUpload_default = FileUpload;
|
|
@@ -4762,7 +4795,7 @@ var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
|
4762
4795
|
import React25 from "react";
|
|
4763
4796
|
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
4764
4797
|
var ImageSelector = (props) => {
|
|
4765
|
-
const { value, label, onChange } = props;
|
|
4798
|
+
const { value, label, onChange, validations } = props;
|
|
4766
4799
|
const [previewUrl, setPreviewUrl] = React25.useState();
|
|
4767
4800
|
React25.useEffect(() => {
|
|
4768
4801
|
if (!value) {
|
|
@@ -4786,7 +4819,7 @@ var ImageSelector = (props) => {
|
|
|
4786
4819
|
const handleOpenFileDialog = () => {
|
|
4787
4820
|
inputRef.current?.click();
|
|
4788
4821
|
};
|
|
4789
|
-
|
|
4822
|
+
const control = /* @__PURE__ */ jsxs210("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
4790
4823
|
/* @__PURE__ */ jsx327(
|
|
4791
4824
|
"input",
|
|
4792
4825
|
{
|
|
@@ -4794,7 +4827,8 @@ var ImageSelector = (props) => {
|
|
|
4794
4827
|
accept: "image/*",
|
|
4795
4828
|
id: "image-input",
|
|
4796
4829
|
onChange: handleFileChange,
|
|
4797
|
-
ref: inputRef
|
|
4830
|
+
ref: inputRef,
|
|
4831
|
+
"aria-invalid": hasError(validations) || void 0
|
|
4798
4832
|
}
|
|
4799
4833
|
),
|
|
4800
4834
|
value && /* @__PURE__ */ jsxs210("div", { className: "action-bar", children: [
|
|
@@ -4806,6 +4840,7 @@ var ImageSelector = (props) => {
|
|
|
4806
4840
|
/* @__PURE__ */ jsx327("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
4807
4841
|
] }) })
|
|
4808
4842
|
] });
|
|
4843
|
+
return /* @__PURE__ */ jsx327(Field, { validations, children: control });
|
|
4809
4844
|
};
|
|
4810
4845
|
ImageSelector.displayName = "ImageSelector";
|
|
4811
4846
|
var ImageSelector_default = ImageSelector;
|
|
@@ -4859,11 +4894,12 @@ var NotificationBadge = (props) => {
|
|
|
4859
4894
|
dot = false,
|
|
4860
4895
|
size = "md"
|
|
4861
4896
|
} = props;
|
|
4897
|
+
const statusType = normalizeStatus(type);
|
|
4862
4898
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
4863
4899
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
4864
4900
|
return /* @__PURE__ */ jsxs211("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
4865
4901
|
children,
|
|
4866
|
-
showBadge && /* @__PURE__ */ jsx330("span", { className: clsx_default("badge-indicator",
|
|
4902
|
+
showBadge && /* @__PURE__ */ jsx330("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
4867
4903
|
] });
|
|
4868
4904
|
};
|
|
4869
4905
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -4904,8 +4940,9 @@ var Pagination = (props) => {
|
|
|
4904
4940
|
siblingCount = 1,
|
|
4905
4941
|
onChange,
|
|
4906
4942
|
size = "md",
|
|
4907
|
-
type = "
|
|
4943
|
+
type = "primary"
|
|
4908
4944
|
} = props;
|
|
4945
|
+
const statusType = normalizeStatus(type);
|
|
4909
4946
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
4910
4947
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
4911
4948
|
const handleClick = (page) => {
|
|
@@ -4913,7 +4950,7 @@ var Pagination = (props) => {
|
|
|
4913
4950
|
onChange?.(page);
|
|
4914
4951
|
}
|
|
4915
4952
|
};
|
|
4916
|
-
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
4953
|
+
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
4917
4954
|
/* @__PURE__ */ jsx331(
|
|
4918
4955
|
"button",
|
|
4919
4956
|
{
|
|
@@ -5014,11 +5051,12 @@ var Progress = (props) => {
|
|
|
5014
5051
|
value,
|
|
5015
5052
|
max = 100,
|
|
5016
5053
|
size = "md",
|
|
5017
|
-
type = "
|
|
5054
|
+
type = "primary",
|
|
5018
5055
|
showLabel = false
|
|
5019
5056
|
} = props;
|
|
5057
|
+
const statusType = normalizeStatus(type);
|
|
5020
5058
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
5021
|
-
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size,
|
|
5059
|
+
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
5022
5060
|
/* @__PURE__ */ jsx333(
|
|
5023
5061
|
"div",
|
|
5024
5062
|
{
|
|
@@ -5063,9 +5101,11 @@ var Radio = (props) => {
|
|
|
5063
5101
|
className,
|
|
5064
5102
|
value,
|
|
5065
5103
|
size: sizeProp,
|
|
5066
|
-
type = "
|
|
5104
|
+
type = "primary",
|
|
5105
|
+
validations,
|
|
5067
5106
|
...rest
|
|
5068
5107
|
} = props;
|
|
5108
|
+
const statusType = normalizeStatus(type);
|
|
5069
5109
|
const context = useRadioGroupContext();
|
|
5070
5110
|
const size = sizeProp ?? context?.size ?? "md";
|
|
5071
5111
|
const isGroup = !!context;
|
|
@@ -5075,18 +5115,27 @@ var Radio = (props) => {
|
|
|
5075
5115
|
value,
|
|
5076
5116
|
onChange: rest.onChange
|
|
5077
5117
|
};
|
|
5078
|
-
|
|
5118
|
+
const control = /* @__PURE__ */ jsxs215(
|
|
5079
5119
|
"label",
|
|
5080
5120
|
{
|
|
5081
5121
|
className: clsx_default(
|
|
5082
5122
|
"lib-xplat-radio",
|
|
5083
5123
|
size,
|
|
5084
|
-
|
|
5124
|
+
statusType,
|
|
5085
5125
|
localChecked ? "checked" : void 0,
|
|
5086
5126
|
className
|
|
5087
5127
|
),
|
|
5088
5128
|
children: [
|
|
5089
|
-
/* @__PURE__ */ jsx334(
|
|
5129
|
+
/* @__PURE__ */ jsx334(
|
|
5130
|
+
"input",
|
|
5131
|
+
{
|
|
5132
|
+
...rest,
|
|
5133
|
+
...inputProps,
|
|
5134
|
+
checked: localChecked,
|
|
5135
|
+
type: "radio",
|
|
5136
|
+
"aria-invalid": hasError(validations) || void 0
|
|
5137
|
+
}
|
|
5138
|
+
),
|
|
5090
5139
|
/* @__PURE__ */ jsx334(
|
|
5091
5140
|
"div",
|
|
5092
5141
|
{
|
|
@@ -5101,15 +5150,16 @@ var Radio = (props) => {
|
|
|
5101
5150
|
]
|
|
5102
5151
|
}
|
|
5103
5152
|
);
|
|
5153
|
+
return /* @__PURE__ */ jsx334(Field, { validations, children: control });
|
|
5104
5154
|
};
|
|
5105
5155
|
Radio.displayName = "Radio";
|
|
5106
5156
|
var Radio_default = Radio;
|
|
5107
5157
|
|
|
5108
5158
|
// src/components/Radio/RadioGroup.tsx
|
|
5109
|
-
import { Fragment as
|
|
5159
|
+
import { Fragment as Fragment5, jsx as jsx335 } from "react/jsx-runtime";
|
|
5110
5160
|
var RadioGroup = (props) => {
|
|
5111
5161
|
const { children, ...rest } = props;
|
|
5112
|
-
return /* @__PURE__ */ jsx335(
|
|
5162
|
+
return /* @__PURE__ */ jsx335(Fragment5, { children: /* @__PURE__ */ jsx335(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
5113
5163
|
};
|
|
5114
5164
|
RadioGroup.displayName = "RadioGroup";
|
|
5115
5165
|
var RadioGroup_default = RadioGroup;
|
|
@@ -5168,6 +5218,7 @@ var SelectRoot = (props) => {
|
|
|
5168
5218
|
children,
|
|
5169
5219
|
disabled = false,
|
|
5170
5220
|
error = false,
|
|
5221
|
+
validations,
|
|
5171
5222
|
size = "md"
|
|
5172
5223
|
} = props;
|
|
5173
5224
|
const itemChildren = React30.Children.toArray(children).filter(
|
|
@@ -5238,14 +5289,14 @@ var SelectRoot = (props) => {
|
|
|
5238
5289
|
if (disabled) return;
|
|
5239
5290
|
toggle();
|
|
5240
5291
|
};
|
|
5241
|
-
|
|
5292
|
+
const control = /* @__PURE__ */ jsx337(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs216(
|
|
5242
5293
|
"div",
|
|
5243
5294
|
{
|
|
5244
5295
|
className: clsx_default(
|
|
5245
5296
|
"lib-xplat-select",
|
|
5246
5297
|
size,
|
|
5247
5298
|
disabled && "disabled",
|
|
5248
|
-
error && "error",
|
|
5299
|
+
(error || hasError(validations)) && "error",
|
|
5249
5300
|
mounted && "is-open"
|
|
5250
5301
|
),
|
|
5251
5302
|
children: [
|
|
@@ -5256,14 +5307,14 @@ var SelectRoot = (props) => {
|
|
|
5256
5307
|
className: clsx_default(
|
|
5257
5308
|
"select-trigger",
|
|
5258
5309
|
disabled && "disabled",
|
|
5259
|
-
error && "error"
|
|
5310
|
+
(error || hasError(validations)) && "error"
|
|
5260
5311
|
),
|
|
5261
5312
|
onClick: handleTriggerClick,
|
|
5262
5313
|
role: "combobox",
|
|
5263
5314
|
"aria-expanded": isOpen,
|
|
5264
5315
|
"aria-haspopup": "listbox",
|
|
5265
5316
|
"aria-disabled": disabled,
|
|
5266
|
-
"aria-invalid": error,
|
|
5317
|
+
"aria-invalid": error || hasError(validations) || void 0,
|
|
5267
5318
|
tabIndex: disabled ? -1 : 0,
|
|
5268
5319
|
onKeyDown: (e) => {
|
|
5269
5320
|
if (disabled) return;
|
|
@@ -5307,6 +5358,7 @@ var SelectRoot = (props) => {
|
|
|
5307
5358
|
]
|
|
5308
5359
|
}
|
|
5309
5360
|
) });
|
|
5361
|
+
return /* @__PURE__ */ jsx337(Field, { validations, children: control });
|
|
5310
5362
|
};
|
|
5311
5363
|
SelectRoot.displayName = "Select";
|
|
5312
5364
|
var Select = Object.assign(SelectRoot, {
|
|
@@ -5348,12 +5400,13 @@ import { jsx as jsx339, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
|
5348
5400
|
var Spinner = (props) => {
|
|
5349
5401
|
const {
|
|
5350
5402
|
size = "md",
|
|
5351
|
-
type = "
|
|
5403
|
+
type = "primary"
|
|
5352
5404
|
} = props;
|
|
5405
|
+
const statusType = normalizeStatus(type);
|
|
5353
5406
|
return /* @__PURE__ */ jsx339(
|
|
5354
5407
|
"div",
|
|
5355
5408
|
{
|
|
5356
|
-
className: clsx_default("lib-xplat-spinner", size,
|
|
5409
|
+
className: clsx_default("lib-xplat-spinner", size, statusType),
|
|
5357
5410
|
role: "status",
|
|
5358
5411
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
5359
5412
|
children: /* @__PURE__ */ jsxs217("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
@@ -5391,9 +5444,10 @@ var Steps = (props) => {
|
|
|
5391
5444
|
const {
|
|
5392
5445
|
items,
|
|
5393
5446
|
current,
|
|
5394
|
-
type = "
|
|
5447
|
+
type = "primary"
|
|
5395
5448
|
} = props;
|
|
5396
|
-
|
|
5449
|
+
const statusType = normalizeStatus(type);
|
|
5450
|
+
return /* @__PURE__ */ jsx340("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
|
|
5397
5451
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
5398
5452
|
return /* @__PURE__ */ jsxs218("div", { className: clsx_default("step-item", status), children: [
|
|
5399
5453
|
/* @__PURE__ */ jsx340("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx340(CheckIcon_default, {}) : /* @__PURE__ */ jsx340("span", { children: index + 1 }) }),
|
|
@@ -5718,10 +5772,12 @@ var Switch = (props) => {
|
|
|
5718
5772
|
const {
|
|
5719
5773
|
value,
|
|
5720
5774
|
size = "md",
|
|
5721
|
-
type = "
|
|
5775
|
+
type = "primary",
|
|
5722
5776
|
disabled,
|
|
5723
|
-
onChange
|
|
5777
|
+
onChange,
|
|
5778
|
+
validations
|
|
5724
5779
|
} = props;
|
|
5780
|
+
const statusType = normalizeStatus(type);
|
|
5725
5781
|
const [isAnimating, setIsAnimating] = React32.useState(false);
|
|
5726
5782
|
const timeoutRef = React32.useRef(null);
|
|
5727
5783
|
React32.useEffect(() => {
|
|
@@ -5739,22 +5795,24 @@ var Switch = (props) => {
|
|
|
5739
5795
|
timeoutRef.current = null;
|
|
5740
5796
|
}, KNOB_TRANSITION_MS);
|
|
5741
5797
|
};
|
|
5742
|
-
|
|
5798
|
+
const control = /* @__PURE__ */ jsx342(
|
|
5743
5799
|
"div",
|
|
5744
5800
|
{
|
|
5745
5801
|
className: clsx_default(
|
|
5746
5802
|
"lib-xplat-switch",
|
|
5747
5803
|
size,
|
|
5748
|
-
|
|
5804
|
+
statusType,
|
|
5749
5805
|
value ? "checked" : void 0,
|
|
5750
5806
|
disabled && "disabled",
|
|
5751
5807
|
isAnimating && "animating"
|
|
5752
5808
|
),
|
|
5753
5809
|
onClick: handleClick,
|
|
5810
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
5754
5811
|
"aria-disabled": disabled || isAnimating,
|
|
5755
5812
|
children: /* @__PURE__ */ jsx342("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
5756
5813
|
}
|
|
5757
5814
|
);
|
|
5815
|
+
return /* @__PURE__ */ jsx342(Field, { validations, children: control });
|
|
5758
5816
|
};
|
|
5759
5817
|
Switch.displayName = "Switch";
|
|
5760
5818
|
var Switch_default = Switch;
|
|
@@ -5960,20 +6018,22 @@ import { jsx as jsx348, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
|
5960
6018
|
var Tag = (props) => {
|
|
5961
6019
|
const {
|
|
5962
6020
|
children,
|
|
5963
|
-
|
|
6021
|
+
variant,
|
|
6022
|
+
type,
|
|
5964
6023
|
onClose,
|
|
5965
6024
|
size = "md",
|
|
5966
6025
|
disabled = false,
|
|
5967
6026
|
colorIndex
|
|
5968
6027
|
} = props;
|
|
6028
|
+
const shape = variant ?? type ?? "neutral";
|
|
5969
6029
|
return /* @__PURE__ */ jsxs220(
|
|
5970
6030
|
"span",
|
|
5971
6031
|
{
|
|
5972
6032
|
className: clsx_default(
|
|
5973
6033
|
"lib-xplat-tag",
|
|
5974
|
-
|
|
6034
|
+
shape,
|
|
5975
6035
|
size,
|
|
5976
|
-
|
|
6036
|
+
shape === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
|
|
5977
6037
|
disabled && "disabled"
|
|
5978
6038
|
),
|
|
5979
6039
|
children: [
|
|
@@ -5994,22 +6054,25 @@ var TextArea = React38.forwardRef(
|
|
|
5994
6054
|
const {
|
|
5995
6055
|
className,
|
|
5996
6056
|
size = "md",
|
|
6057
|
+
validations,
|
|
5997
6058
|
resize = "vertical",
|
|
5998
6059
|
rows = 3,
|
|
5999
6060
|
disabled,
|
|
6000
6061
|
...textareaProps
|
|
6001
6062
|
} = props;
|
|
6002
|
-
|
|
6063
|
+
const control = /* @__PURE__ */ jsx349("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx349(
|
|
6003
6064
|
"textarea",
|
|
6004
6065
|
{
|
|
6005
6066
|
...textareaProps,
|
|
6006
6067
|
ref,
|
|
6007
6068
|
rows,
|
|
6008
6069
|
disabled,
|
|
6070
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
6009
6071
|
className: clsx_default("lib-xplat-textarea", size, disabled && "disabled"),
|
|
6010
6072
|
style: { resize }
|
|
6011
6073
|
}
|
|
6012
6074
|
) });
|
|
6075
|
+
return /* @__PURE__ */ jsx349(Field, { validations, children: control });
|
|
6013
6076
|
}
|
|
6014
6077
|
);
|
|
6015
6078
|
TextArea.displayName = "TextArea";
|
|
@@ -6108,7 +6171,7 @@ ToastProvider.displayName = "ToastProvider";
|
|
|
6108
6171
|
|
|
6109
6172
|
// src/components/Tooltip/Tooltip.tsx
|
|
6110
6173
|
import React40 from "react";
|
|
6111
|
-
import { Fragment as
|
|
6174
|
+
import { Fragment as Fragment6, jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
6112
6175
|
var OFFSET = 12;
|
|
6113
6176
|
var GAP = 8;
|
|
6114
6177
|
var SHOW_DELAY = 300;
|
|
@@ -6117,10 +6180,12 @@ var Tooltip = (props) => {
|
|
|
6117
6180
|
children,
|
|
6118
6181
|
title,
|
|
6119
6182
|
description,
|
|
6120
|
-
|
|
6183
|
+
variant,
|
|
6184
|
+
type,
|
|
6121
6185
|
follow = false,
|
|
6122
6186
|
disabled = false
|
|
6123
6187
|
} = props;
|
|
6188
|
+
const shape = variant ?? type ?? "dark";
|
|
6124
6189
|
const triggerRef = React40.useRef(null);
|
|
6125
6190
|
const tooltipRef = React40.useRef(null);
|
|
6126
6191
|
const [visible, setVisible] = React40.useState(false);
|
|
@@ -6211,7 +6276,7 @@ var Tooltip = (props) => {
|
|
|
6211
6276
|
window.clearTimeout(delayTimer.current);
|
|
6212
6277
|
cancelAnimationFrame(rafRef.current);
|
|
6213
6278
|
}, []);
|
|
6214
|
-
if (!title && !description) return /* @__PURE__ */ jsx351(
|
|
6279
|
+
if (!title && !description) return /* @__PURE__ */ jsx351(Fragment6, { children });
|
|
6215
6280
|
return /* @__PURE__ */ jsxs222(
|
|
6216
6281
|
"div",
|
|
6217
6282
|
{
|
|
@@ -6230,7 +6295,7 @@ var Tooltip = (props) => {
|
|
|
6230
6295
|
{
|
|
6231
6296
|
ref: tooltipRef,
|
|
6232
6297
|
role: "tooltip",
|
|
6233
|
-
className: clsx_default("lib-xplat-tooltip",
|
|
6298
|
+
className: clsx_default("lib-xplat-tooltip", shape),
|
|
6234
6299
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
6235
6300
|
children: [
|
|
6236
6301
|
title && /* @__PURE__ */ jsx351("div", { className: "tooltip-title", children: title }),
|
|
@@ -6626,6 +6691,8 @@ export {
|
|
|
6626
6691
|
Dropdown_default as Dropdown,
|
|
6627
6692
|
Editor_default as Editor,
|
|
6628
6693
|
EmptyState_default as EmptyState,
|
|
6694
|
+
Field,
|
|
6695
|
+
FieldMessage_default as FieldMessage,
|
|
6629
6696
|
FileUpload_default as FileUpload,
|
|
6630
6697
|
HtmlTypeWriter_default as HtmlTypeWriter,
|
|
6631
6698
|
HtmlTypeWriter_default as HtmlTypewriter,
|
|
@@ -6664,6 +6731,7 @@ export {
|
|
|
6664
6731
|
ToastProvider,
|
|
6665
6732
|
Tooltip_default as Tooltip,
|
|
6666
6733
|
Video_default as Video,
|
|
6734
|
+
hasError,
|
|
6667
6735
|
isInRange,
|
|
6668
6736
|
isSameDay,
|
|
6669
6737
|
useCalendar,
|