@x-plat/design-system 0.8.3 → 0.9.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 +3 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +3 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +3 -0
- package/dist/components/ChatInput/index.d.ts +3 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +132 -5
- package/dist/components/CheckBox/index.css +38 -0
- package/dist/components/CheckBox/index.d.cts +3 -0
- package/dist/components/CheckBox/index.d.ts +3 -0
- package/dist/components/CheckBox/index.js +132 -5
- package/dist/components/DatePicker/index.cjs +72 -59
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +38 -25
- 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 +3 -0
- package/dist/components/FileUpload/index.d.ts +3 -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 +3 -0
- package/dist/components/ImageSelector/index.d.ts +3 -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 +3 -8
- package/dist/components/Input/index.d.ts +3 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/Radio/index.cjs +152 -8
- package/dist/components/Radio/index.css +38 -0
- package/dist/components/Radio/index.d.cts +3 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.js +152 -8
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Switch/index.cjs +140 -4
- package/dist/components/Switch/index.css +38 -0
- package/dist/components/Switch/index.d.cts +3 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.js +140 -4
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +3 -0
- package/dist/components/TextArea/index.d.ts +3 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/index.cjs +439 -385
- package/dist/components/index.css +38 -31
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +222 -171
- package/dist/index.cjs +444 -390
- package/dist/index.css +38 -31
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +224 -173
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/components/form.md +26 -0
- 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,16 +2743,16 @@ 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
|
}) });
|
|
@@ -2725,14 +2766,14 @@ var Chart = React6.memo((props) => {
|
|
|
2725
2766
|
const dataKey = React6.useMemo(() => JSON.stringify(labels), [labels]);
|
|
2726
2767
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2727
2768
|
const ready = width > 0 && height > 0;
|
|
2728
|
-
return /* @__PURE__ */
|
|
2729
|
-
ready && type === "line" && /* @__PURE__ */
|
|
2730
|
-
ready && type === "curve" && /* @__PURE__ */
|
|
2731
|
-
ready && type === "bar" && /* @__PURE__ */
|
|
2732
|
-
ready && type === "pie" && /* @__PURE__ */
|
|
2733
|
-
ready && type === "doughnut" && /* @__PURE__ */
|
|
2734
|
-
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */
|
|
2735
|
-
tooltip.visible && tooltip.content && /* @__PURE__ */
|
|
2769
|
+
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2770
|
+
ready && type === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2771
|
+
ready && type === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2772
|
+
ready && type === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2773
|
+
ready && type === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2774
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2775
|
+
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
2776
|
+
tooltip.visible && tooltip.content && /* @__PURE__ */ jsx306(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
2736
2777
|
] });
|
|
2737
2778
|
});
|
|
2738
2779
|
Chart.displayName = "Chart";
|
|
@@ -2742,7 +2783,7 @@ var Chart_default = Chart;
|
|
|
2742
2783
|
import React7 from "react";
|
|
2743
2784
|
|
|
2744
2785
|
// src/components/IconButton/IconButton.tsx
|
|
2745
|
-
import { jsx as
|
|
2786
|
+
import { jsx as jsx307 } from "react/jsx-runtime";
|
|
2746
2787
|
var IconButton = (props) => {
|
|
2747
2788
|
const {
|
|
2748
2789
|
icon,
|
|
@@ -2751,7 +2792,7 @@ var IconButton = (props) => {
|
|
|
2751
2792
|
disabled,
|
|
2752
2793
|
...rest
|
|
2753
2794
|
} = props;
|
|
2754
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ jsx307(
|
|
2755
2796
|
"button",
|
|
2756
2797
|
{
|
|
2757
2798
|
className: clsx_default("lib-xplat-icon-button", type, size),
|
|
@@ -2765,7 +2806,7 @@ IconButton.displayName = "IconButton";
|
|
|
2765
2806
|
var IconButton_default = IconButton;
|
|
2766
2807
|
|
|
2767
2808
|
// src/components/ChatInput/ChatInput.tsx
|
|
2768
|
-
import { jsx as
|
|
2809
|
+
import { jsx as jsx308, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
2769
2810
|
var ChatInput = React7.forwardRef(
|
|
2770
2811
|
(props, ref) => {
|
|
2771
2812
|
const {
|
|
@@ -2774,7 +2815,8 @@ var ChatInput = React7.forwardRef(
|
|
|
2774
2815
|
disabled = false,
|
|
2775
2816
|
buttonType = "primary",
|
|
2776
2817
|
onSubmit,
|
|
2777
|
-
onChange
|
|
2818
|
+
onChange,
|
|
2819
|
+
validations
|
|
2778
2820
|
} = props;
|
|
2779
2821
|
const isControlled = valueProp !== void 0;
|
|
2780
2822
|
const [internalValue, setInternalValue] = React7.useState("");
|
|
@@ -2796,8 +2838,8 @@ var ChatInput = React7.forwardRef(
|
|
|
2796
2838
|
handleSubmit();
|
|
2797
2839
|
}
|
|
2798
2840
|
};
|
|
2799
|
-
|
|
2800
|
-
/* @__PURE__ */
|
|
2841
|
+
const control = /* @__PURE__ */ jsxs197("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
2842
|
+
/* @__PURE__ */ jsx308(
|
|
2801
2843
|
AutoResizeTextArea_default,
|
|
2802
2844
|
{
|
|
2803
2845
|
ref,
|
|
@@ -2808,13 +2850,14 @@ var ChatInput = React7.forwardRef(
|
|
|
2808
2850
|
disabled,
|
|
2809
2851
|
rows: 1,
|
|
2810
2852
|
onChange: handleChange,
|
|
2853
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
2811
2854
|
onKeyDown: handleKeyDown
|
|
2812
2855
|
}
|
|
2813
2856
|
),
|
|
2814
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ jsx308(
|
|
2815
2858
|
IconButton_default,
|
|
2816
2859
|
{
|
|
2817
|
-
icon: /* @__PURE__ */
|
|
2860
|
+
icon: /* @__PURE__ */ jsx308(MessageSquareIcon_default, {}),
|
|
2818
2861
|
type: buttonType,
|
|
2819
2862
|
size: "sm",
|
|
2820
2863
|
disabled: !hasText || disabled,
|
|
@@ -2823,6 +2866,7 @@ var ChatInput = React7.forwardRef(
|
|
|
2823
2866
|
}
|
|
2824
2867
|
)
|
|
2825
2868
|
] });
|
|
2869
|
+
return /* @__PURE__ */ jsx308(Field, { validations, children: control });
|
|
2826
2870
|
}
|
|
2827
2871
|
);
|
|
2828
2872
|
ChatInput.displayName = "ChatInput";
|
|
@@ -2835,7 +2879,7 @@ import { semantic } from "@x-plat/tokens-core";
|
|
|
2835
2879
|
import { cssVar } from "@x-plat/tokens-core";
|
|
2836
2880
|
|
|
2837
2881
|
// src/components/CheckBox/CheckBox.tsx
|
|
2838
|
-
import { jsx as
|
|
2882
|
+
import { jsx as jsx309, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2839
2883
|
var CheckBox = (props) => {
|
|
2840
2884
|
const {
|
|
2841
2885
|
checked,
|
|
@@ -2845,6 +2889,7 @@ var CheckBox = (props) => {
|
|
|
2845
2889
|
disabled,
|
|
2846
2890
|
size = "md",
|
|
2847
2891
|
type = "brand",
|
|
2892
|
+
validations,
|
|
2848
2893
|
...rest
|
|
2849
2894
|
} = props;
|
|
2850
2895
|
const handleChange = (e) => {
|
|
@@ -2854,33 +2899,35 @@ var CheckBox = (props) => {
|
|
|
2854
2899
|
const checkedClasses = `checked`;
|
|
2855
2900
|
const disabledClasses = "disabled";
|
|
2856
2901
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2857
|
-
|
|
2858
|
-
/* @__PURE__ */
|
|
2902
|
+
const control = /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
|
|
2903
|
+
/* @__PURE__ */ jsx309(
|
|
2859
2904
|
"input",
|
|
2860
2905
|
{
|
|
2861
2906
|
type: "checkbox",
|
|
2862
2907
|
checked,
|
|
2863
2908
|
onChange: handleChange,
|
|
2864
2909
|
disabled,
|
|
2910
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
2865
2911
|
...rest
|
|
2866
2912
|
}
|
|
2867
2913
|
),
|
|
2868
|
-
/* @__PURE__ */
|
|
2869
|
-
label && /* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx309("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx309("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx309(CheckIcon_default, {}) }) }),
|
|
2915
|
+
label && /* @__PURE__ */ jsx309("span", { className: "label", children: label })
|
|
2870
2916
|
] });
|
|
2917
|
+
return /* @__PURE__ */ jsx309(Field, { validations, children: control });
|
|
2871
2918
|
};
|
|
2872
2919
|
CheckBox.displayName = "CheckBox";
|
|
2873
2920
|
var CheckBox_default = CheckBox;
|
|
2874
2921
|
|
|
2875
2922
|
// src/components/Chip/Chip.tsx
|
|
2876
|
-
import { jsx as
|
|
2923
|
+
import { jsx as jsx310 } from "react/jsx-runtime";
|
|
2877
2924
|
var Chip = (props) => {
|
|
2878
2925
|
const {
|
|
2879
2926
|
children,
|
|
2880
2927
|
type = "primary",
|
|
2881
2928
|
size = "md"
|
|
2882
2929
|
} = props;
|
|
2883
|
-
return /* @__PURE__ */
|
|
2930
|
+
return /* @__PURE__ */ jsx310("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
2884
2931
|
};
|
|
2885
2932
|
Chip.displayName = "Chip";
|
|
2886
2933
|
var Chip_default = Chip;
|
|
@@ -2891,23 +2938,6 @@ import React12 from "react";
|
|
|
2891
2938
|
// src/components/Input/Input.tsx
|
|
2892
2939
|
import React8 from "react";
|
|
2893
2940
|
|
|
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
2941
|
// src/components/Input/reg.ts
|
|
2912
2942
|
var numberAndCommaReg = /^[0-9,]+$/;
|
|
2913
2943
|
var phoneNumberMaxLengthReg = /^.{0,13}$/;
|
|
@@ -2944,7 +2974,6 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
2944
2974
|
|
|
2945
2975
|
// src/components/Input/Input.tsx
|
|
2946
2976
|
import { jsx as jsx311, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
2947
|
-
import { createElement } from "react";
|
|
2948
2977
|
var formatValue = (type, value) => {
|
|
2949
2978
|
if (value === null || value === void 0) return "";
|
|
2950
2979
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -3033,20 +3062,15 @@ var Input = React8.forwardRef((props, ref) => {
|
|
|
3033
3062
|
disabled,
|
|
3034
3063
|
type: type === "number" ? "text" : type,
|
|
3035
3064
|
value: localValue,
|
|
3036
|
-
onChange: handleChange
|
|
3065
|
+
onChange: handleChange,
|
|
3066
|
+
"aria-invalid": hasError(validations) || void 0
|
|
3037
3067
|
}
|
|
3038
3068
|
),
|
|
3039
3069
|
suffix && /* @__PURE__ */ jsx311("div", { className: "suffix", children: suffix })
|
|
3040
3070
|
]
|
|
3041
3071
|
}
|
|
3042
3072
|
),
|
|
3043
|
-
|
|
3044
|
-
InputValidations_default,
|
|
3045
|
-
{
|
|
3046
|
-
...validation,
|
|
3047
|
-
key: `${validation.message}_${idx}`
|
|
3048
|
-
}
|
|
3049
|
-
)) })
|
|
3073
|
+
/* @__PURE__ */ jsx311(FieldMessage_default, { validations })
|
|
3050
3074
|
] });
|
|
3051
3075
|
});
|
|
3052
3076
|
Input.displayName = "Input";
|
|
@@ -3130,7 +3154,7 @@ var Modal_default = Modal;
|
|
|
3130
3154
|
|
|
3131
3155
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
3132
3156
|
import React11 from "react";
|
|
3133
|
-
import { Fragment as
|
|
3157
|
+
import { Fragment as Fragment4, jsx as jsx314, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
3134
3158
|
var DayCell2 = React11.memo(
|
|
3135
3159
|
({
|
|
3136
3160
|
day,
|
|
@@ -3273,7 +3297,7 @@ var SingleDatePicker = (props) => {
|
|
|
3273
3297
|
},
|
|
3274
3298
|
i
|
|
3275
3299
|
)) }),
|
|
3276
|
-
pickerMode === "days" && /* @__PURE__ */ jsxs200(
|
|
3300
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment4, { children: [
|
|
3277
3301
|
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx314(
|
|
3278
3302
|
"div",
|
|
3279
3303
|
{
|
|
@@ -4562,7 +4586,8 @@ var FileUpload = (props) => {
|
|
|
4562
4586
|
maxSize,
|
|
4563
4587
|
onChange,
|
|
4564
4588
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
4565
|
-
description
|
|
4589
|
+
description,
|
|
4590
|
+
validations
|
|
4566
4591
|
} = props;
|
|
4567
4592
|
const [isDragOver, setIsDragOver] = React22.useState(false);
|
|
4568
4593
|
const inputRef = React22.useRef(null);
|
|
@@ -4595,7 +4620,7 @@ var FileUpload = (props) => {
|
|
|
4595
4620
|
handleFiles(e.target.files);
|
|
4596
4621
|
}
|
|
4597
4622
|
};
|
|
4598
|
-
|
|
4623
|
+
const control = /* @__PURE__ */ jsxs209(
|
|
4599
4624
|
"div",
|
|
4600
4625
|
{
|
|
4601
4626
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -4611,7 +4636,8 @@ var FileUpload = (props) => {
|
|
|
4611
4636
|
type: "file",
|
|
4612
4637
|
accept,
|
|
4613
4638
|
multiple,
|
|
4614
|
-
onChange: handleChange
|
|
4639
|
+
onChange: handleChange,
|
|
4640
|
+
"aria-invalid": hasError(validations) || void 0
|
|
4615
4641
|
}
|
|
4616
4642
|
),
|
|
4617
4643
|
/* @__PURE__ */ jsx325("div", { className: "upload-icon", children: /* @__PURE__ */ jsx325(UploadIcon_default, {}) }),
|
|
@@ -4620,6 +4646,7 @@ var FileUpload = (props) => {
|
|
|
4620
4646
|
]
|
|
4621
4647
|
}
|
|
4622
4648
|
);
|
|
4649
|
+
return /* @__PURE__ */ jsx325(Field, { validations, children: control });
|
|
4623
4650
|
};
|
|
4624
4651
|
FileUpload.displayName = "FileUpload";
|
|
4625
4652
|
var FileUpload_default = FileUpload;
|
|
@@ -4762,7 +4789,7 @@ var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
|
4762
4789
|
import React25 from "react";
|
|
4763
4790
|
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
4764
4791
|
var ImageSelector = (props) => {
|
|
4765
|
-
const { value, label, onChange } = props;
|
|
4792
|
+
const { value, label, onChange, validations } = props;
|
|
4766
4793
|
const [previewUrl, setPreviewUrl] = React25.useState();
|
|
4767
4794
|
React25.useEffect(() => {
|
|
4768
4795
|
if (!value) {
|
|
@@ -4786,7 +4813,7 @@ var ImageSelector = (props) => {
|
|
|
4786
4813
|
const handleOpenFileDialog = () => {
|
|
4787
4814
|
inputRef.current?.click();
|
|
4788
4815
|
};
|
|
4789
|
-
|
|
4816
|
+
const control = /* @__PURE__ */ jsxs210("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
4790
4817
|
/* @__PURE__ */ jsx327(
|
|
4791
4818
|
"input",
|
|
4792
4819
|
{
|
|
@@ -4794,7 +4821,8 @@ var ImageSelector = (props) => {
|
|
|
4794
4821
|
accept: "image/*",
|
|
4795
4822
|
id: "image-input",
|
|
4796
4823
|
onChange: handleFileChange,
|
|
4797
|
-
ref: inputRef
|
|
4824
|
+
ref: inputRef,
|
|
4825
|
+
"aria-invalid": hasError(validations) || void 0
|
|
4798
4826
|
}
|
|
4799
4827
|
),
|
|
4800
4828
|
value && /* @__PURE__ */ jsxs210("div", { className: "action-bar", children: [
|
|
@@ -4806,6 +4834,7 @@ var ImageSelector = (props) => {
|
|
|
4806
4834
|
/* @__PURE__ */ jsx327("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
4807
4835
|
] }) })
|
|
4808
4836
|
] });
|
|
4837
|
+
return /* @__PURE__ */ jsx327(Field, { validations, children: control });
|
|
4809
4838
|
};
|
|
4810
4839
|
ImageSelector.displayName = "ImageSelector";
|
|
4811
4840
|
var ImageSelector_default = ImageSelector;
|
|
@@ -5064,6 +5093,7 @@ var Radio = (props) => {
|
|
|
5064
5093
|
value,
|
|
5065
5094
|
size: sizeProp,
|
|
5066
5095
|
type = "brand",
|
|
5096
|
+
validations,
|
|
5067
5097
|
...rest
|
|
5068
5098
|
} = props;
|
|
5069
5099
|
const context = useRadioGroupContext();
|
|
@@ -5075,7 +5105,7 @@ var Radio = (props) => {
|
|
|
5075
5105
|
value,
|
|
5076
5106
|
onChange: rest.onChange
|
|
5077
5107
|
};
|
|
5078
|
-
|
|
5108
|
+
const control = /* @__PURE__ */ jsxs215(
|
|
5079
5109
|
"label",
|
|
5080
5110
|
{
|
|
5081
5111
|
className: clsx_default(
|
|
@@ -5086,7 +5116,16 @@ var Radio = (props) => {
|
|
|
5086
5116
|
className
|
|
5087
5117
|
),
|
|
5088
5118
|
children: [
|
|
5089
|
-
/* @__PURE__ */ jsx334(
|
|
5119
|
+
/* @__PURE__ */ jsx334(
|
|
5120
|
+
"input",
|
|
5121
|
+
{
|
|
5122
|
+
...rest,
|
|
5123
|
+
...inputProps,
|
|
5124
|
+
checked: localChecked,
|
|
5125
|
+
type: "radio",
|
|
5126
|
+
"aria-invalid": hasError(validations) || void 0
|
|
5127
|
+
}
|
|
5128
|
+
),
|
|
5090
5129
|
/* @__PURE__ */ jsx334(
|
|
5091
5130
|
"div",
|
|
5092
5131
|
{
|
|
@@ -5101,15 +5140,16 @@ var Radio = (props) => {
|
|
|
5101
5140
|
]
|
|
5102
5141
|
}
|
|
5103
5142
|
);
|
|
5143
|
+
return /* @__PURE__ */ jsx334(Field, { validations, children: control });
|
|
5104
5144
|
};
|
|
5105
5145
|
Radio.displayName = "Radio";
|
|
5106
5146
|
var Radio_default = Radio;
|
|
5107
5147
|
|
|
5108
5148
|
// src/components/Radio/RadioGroup.tsx
|
|
5109
|
-
import { Fragment as
|
|
5149
|
+
import { Fragment as Fragment5, jsx as jsx335 } from "react/jsx-runtime";
|
|
5110
5150
|
var RadioGroup = (props) => {
|
|
5111
5151
|
const { children, ...rest } = props;
|
|
5112
|
-
return /* @__PURE__ */ jsx335(
|
|
5152
|
+
return /* @__PURE__ */ jsx335(Fragment5, { children: /* @__PURE__ */ jsx335(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
5113
5153
|
};
|
|
5114
5154
|
RadioGroup.displayName = "RadioGroup";
|
|
5115
5155
|
var RadioGroup_default = RadioGroup;
|
|
@@ -5168,6 +5208,7 @@ var SelectRoot = (props) => {
|
|
|
5168
5208
|
children,
|
|
5169
5209
|
disabled = false,
|
|
5170
5210
|
error = false,
|
|
5211
|
+
validations,
|
|
5171
5212
|
size = "md"
|
|
5172
5213
|
} = props;
|
|
5173
5214
|
const itemChildren = React30.Children.toArray(children).filter(
|
|
@@ -5238,14 +5279,14 @@ var SelectRoot = (props) => {
|
|
|
5238
5279
|
if (disabled) return;
|
|
5239
5280
|
toggle();
|
|
5240
5281
|
};
|
|
5241
|
-
|
|
5282
|
+
const control = /* @__PURE__ */ jsx337(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs216(
|
|
5242
5283
|
"div",
|
|
5243
5284
|
{
|
|
5244
5285
|
className: clsx_default(
|
|
5245
5286
|
"lib-xplat-select",
|
|
5246
5287
|
size,
|
|
5247
5288
|
disabled && "disabled",
|
|
5248
|
-
error && "error",
|
|
5289
|
+
(error || hasError(validations)) && "error",
|
|
5249
5290
|
mounted && "is-open"
|
|
5250
5291
|
),
|
|
5251
5292
|
children: [
|
|
@@ -5256,14 +5297,14 @@ var SelectRoot = (props) => {
|
|
|
5256
5297
|
className: clsx_default(
|
|
5257
5298
|
"select-trigger",
|
|
5258
5299
|
disabled && "disabled",
|
|
5259
|
-
error && "error"
|
|
5300
|
+
(error || hasError(validations)) && "error"
|
|
5260
5301
|
),
|
|
5261
5302
|
onClick: handleTriggerClick,
|
|
5262
5303
|
role: "combobox",
|
|
5263
5304
|
"aria-expanded": isOpen,
|
|
5264
5305
|
"aria-haspopup": "listbox",
|
|
5265
5306
|
"aria-disabled": disabled,
|
|
5266
|
-
"aria-invalid": error,
|
|
5307
|
+
"aria-invalid": error || hasError(validations) || void 0,
|
|
5267
5308
|
tabIndex: disabled ? -1 : 0,
|
|
5268
5309
|
onKeyDown: (e) => {
|
|
5269
5310
|
if (disabled) return;
|
|
@@ -5307,6 +5348,7 @@ var SelectRoot = (props) => {
|
|
|
5307
5348
|
]
|
|
5308
5349
|
}
|
|
5309
5350
|
) });
|
|
5351
|
+
return /* @__PURE__ */ jsx337(Field, { validations, children: control });
|
|
5310
5352
|
};
|
|
5311
5353
|
SelectRoot.displayName = "Select";
|
|
5312
5354
|
var Select = Object.assign(SelectRoot, {
|
|
@@ -5720,7 +5762,8 @@ var Switch = (props) => {
|
|
|
5720
5762
|
size = "md",
|
|
5721
5763
|
type = "brand",
|
|
5722
5764
|
disabled,
|
|
5723
|
-
onChange
|
|
5765
|
+
onChange,
|
|
5766
|
+
validations
|
|
5724
5767
|
} = props;
|
|
5725
5768
|
const [isAnimating, setIsAnimating] = React32.useState(false);
|
|
5726
5769
|
const timeoutRef = React32.useRef(null);
|
|
@@ -5739,7 +5782,7 @@ var Switch = (props) => {
|
|
|
5739
5782
|
timeoutRef.current = null;
|
|
5740
5783
|
}, KNOB_TRANSITION_MS);
|
|
5741
5784
|
};
|
|
5742
|
-
|
|
5785
|
+
const control = /* @__PURE__ */ jsx342(
|
|
5743
5786
|
"div",
|
|
5744
5787
|
{
|
|
5745
5788
|
className: clsx_default(
|
|
@@ -5751,10 +5794,12 @@ var Switch = (props) => {
|
|
|
5751
5794
|
isAnimating && "animating"
|
|
5752
5795
|
),
|
|
5753
5796
|
onClick: handleClick,
|
|
5797
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
5754
5798
|
"aria-disabled": disabled || isAnimating,
|
|
5755
5799
|
children: /* @__PURE__ */ jsx342("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
5756
5800
|
}
|
|
5757
5801
|
);
|
|
5802
|
+
return /* @__PURE__ */ jsx342(Field, { validations, children: control });
|
|
5758
5803
|
};
|
|
5759
5804
|
Switch.displayName = "Switch";
|
|
5760
5805
|
var Switch_default = Switch;
|
|
@@ -5994,22 +6039,25 @@ var TextArea = React38.forwardRef(
|
|
|
5994
6039
|
const {
|
|
5995
6040
|
className,
|
|
5996
6041
|
size = "md",
|
|
6042
|
+
validations,
|
|
5997
6043
|
resize = "vertical",
|
|
5998
6044
|
rows = 3,
|
|
5999
6045
|
disabled,
|
|
6000
6046
|
...textareaProps
|
|
6001
6047
|
} = props;
|
|
6002
|
-
|
|
6048
|
+
const control = /* @__PURE__ */ jsx349("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx349(
|
|
6003
6049
|
"textarea",
|
|
6004
6050
|
{
|
|
6005
6051
|
...textareaProps,
|
|
6006
6052
|
ref,
|
|
6007
6053
|
rows,
|
|
6008
6054
|
disabled,
|
|
6055
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
6009
6056
|
className: clsx_default("lib-xplat-textarea", size, disabled && "disabled"),
|
|
6010
6057
|
style: { resize }
|
|
6011
6058
|
}
|
|
6012
6059
|
) });
|
|
6060
|
+
return /* @__PURE__ */ jsx349(Field, { validations, children: control });
|
|
6013
6061
|
}
|
|
6014
6062
|
);
|
|
6015
6063
|
TextArea.displayName = "TextArea";
|
|
@@ -6108,7 +6156,7 @@ ToastProvider.displayName = "ToastProvider";
|
|
|
6108
6156
|
|
|
6109
6157
|
// src/components/Tooltip/Tooltip.tsx
|
|
6110
6158
|
import React40 from "react";
|
|
6111
|
-
import { Fragment as
|
|
6159
|
+
import { Fragment as Fragment6, jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
6112
6160
|
var OFFSET = 12;
|
|
6113
6161
|
var GAP = 8;
|
|
6114
6162
|
var SHOW_DELAY = 300;
|
|
@@ -6211,7 +6259,7 @@ var Tooltip = (props) => {
|
|
|
6211
6259
|
window.clearTimeout(delayTimer.current);
|
|
6212
6260
|
cancelAnimationFrame(rafRef.current);
|
|
6213
6261
|
}, []);
|
|
6214
|
-
if (!title && !description) return /* @__PURE__ */ jsx351(
|
|
6262
|
+
if (!title && !description) return /* @__PURE__ */ jsx351(Fragment6, { children });
|
|
6215
6263
|
return /* @__PURE__ */ jsxs222(
|
|
6216
6264
|
"div",
|
|
6217
6265
|
{
|
|
@@ -6626,6 +6674,8 @@ export {
|
|
|
6626
6674
|
Dropdown_default as Dropdown,
|
|
6627
6675
|
Editor_default as Editor,
|
|
6628
6676
|
EmptyState_default as EmptyState,
|
|
6677
|
+
Field,
|
|
6678
|
+
FieldMessage_default as FieldMessage,
|
|
6629
6679
|
FileUpload_default as FileUpload,
|
|
6630
6680
|
HtmlTypeWriter_default as HtmlTypeWriter,
|
|
6631
6681
|
HtmlTypeWriter_default as HtmlTypewriter,
|
|
@@ -6664,6 +6714,7 @@ export {
|
|
|
6664
6714
|
ToastProvider,
|
|
6665
6715
|
Tooltip_default as Tooltip,
|
|
6666
6716
|
Video_default as Video,
|
|
6717
|
+
hasError,
|
|
6667
6718
|
isInRange,
|
|
6668
6719
|
isSameDay,
|
|
6669
6720
|
useCalendar,
|