@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.
Files changed (133) hide show
  1. package/dist/components/AutoResizeTextArea/index.cjs +140 -4
  2. package/dist/components/AutoResizeTextArea/index.css +38 -0
  3. package/dist/components/AutoResizeTextArea/index.d.cts +4 -0
  4. package/dist/components/AutoResizeTextArea/index.d.ts +4 -0
  5. package/dist/components/AutoResizeTextArea/index.js +140 -4
  6. package/dist/components/Badge/index.cjs +5 -1
  7. package/dist/components/Badge/index.css +1 -0
  8. package/dist/components/Badge/index.d.cts +1 -0
  9. package/dist/components/Badge/index.d.ts +1 -0
  10. package/dist/components/Badge/index.js +5 -1
  11. package/dist/components/Box/index.d.cts +3 -0
  12. package/dist/components/Box/index.d.ts +3 -0
  13. package/dist/components/Chart/index.cjs +7 -6
  14. package/dist/components/Chart/index.d.cts +12 -1
  15. package/dist/components/Chart/index.d.ts +12 -1
  16. package/dist/components/Chart/index.js +7 -6
  17. package/dist/components/ChatInput/index.cjs +150 -9
  18. package/dist/components/ChatInput/index.css +38 -0
  19. package/dist/components/ChatInput/index.d.cts +9 -0
  20. package/dist/components/ChatInput/index.d.ts +9 -0
  21. package/dist/components/ChatInput/index.js +151 -10
  22. package/dist/components/CheckBox/index.cjs +137 -6
  23. package/dist/components/CheckBox/index.css +40 -0
  24. package/dist/components/CheckBox/index.d.cts +13 -2
  25. package/dist/components/CheckBox/index.d.ts +13 -2
  26. package/dist/components/CheckBox/index.js +137 -6
  27. package/dist/components/Chip/index.d.cts +2 -0
  28. package/dist/components/Chip/index.d.ts +2 -0
  29. package/dist/components/DatePicker/index.cjs +76 -62
  30. package/dist/components/DatePicker/index.css +38 -31
  31. package/dist/components/DatePicker/index.js +42 -28
  32. package/dist/components/Drawer/index.d.cts +1 -0
  33. package/dist/components/Drawer/index.d.ts +1 -0
  34. package/dist/components/FieldMessage/index.cjs +183 -0
  35. package/dist/components/FieldMessage/index.css +37 -0
  36. package/dist/components/FieldMessage/index.d.cts +37 -0
  37. package/dist/components/FieldMessage/index.d.ts +37 -0
  38. package/dist/components/FieldMessage/index.js +154 -0
  39. package/dist/components/FileUpload/index.cjs +135 -8
  40. package/dist/components/FileUpload/index.css +38 -0
  41. package/dist/components/FileUpload/index.d.cts +9 -0
  42. package/dist/components/FileUpload/index.d.ts +9 -0
  43. package/dist/components/FileUpload/index.js +135 -8
  44. package/dist/components/ImageSelector/index.cjs +153 -11
  45. package/dist/components/ImageSelector/index.css +38 -0
  46. package/dist/components/ImageSelector/index.d.cts +6 -0
  47. package/dist/components/ImageSelector/index.d.ts +6 -0
  48. package/dist/components/ImageSelector/index.js +153 -11
  49. package/dist/components/Input/index.cjs +38 -25
  50. package/dist/components/Input/index.css +38 -31
  51. package/dist/components/Input/index.d.cts +7 -8
  52. package/dist/components/Input/index.d.ts +7 -8
  53. package/dist/components/Input/index.js +36 -23
  54. package/dist/components/NotificationBadge/index.cjs +5 -1
  55. package/dist/components/NotificationBadge/index.css +1 -0
  56. package/dist/components/NotificationBadge/index.d.cts +6 -2
  57. package/dist/components/NotificationBadge/index.d.ts +6 -2
  58. package/dist/components/NotificationBadge/index.js +5 -1
  59. package/dist/components/Pagination/index.cjs +6 -2
  60. package/dist/components/Pagination/index.css +1 -0
  61. package/dist/components/Pagination/index.d.cts +13 -2
  62. package/dist/components/Pagination/index.d.ts +13 -2
  63. package/dist/components/Pagination/index.js +6 -2
  64. package/dist/components/Progress/index.cjs +6 -2
  65. package/dist/components/Progress/index.css +1 -0
  66. package/dist/components/Progress/index.d.cts +11 -2
  67. package/dist/components/Progress/index.d.ts +11 -2
  68. package/dist/components/Progress/index.js +6 -2
  69. package/dist/components/Radio/index.cjs +158 -10
  70. package/dist/components/Radio/index.css +40 -0
  71. package/dist/components/Radio/index.d.cts +14 -2
  72. package/dist/components/Radio/index.d.ts +14 -2
  73. package/dist/components/Radio/index.js +158 -10
  74. package/dist/components/Select/index.cjs +139 -13
  75. package/dist/components/Select/index.css +38 -0
  76. package/dist/components/Select/index.d.cts +8 -1
  77. package/dist/components/Select/index.d.ts +8 -1
  78. package/dist/components/Select/index.js +139 -13
  79. package/dist/components/Skeleton/index.d.cts +3 -0
  80. package/dist/components/Skeleton/index.d.ts +3 -0
  81. package/dist/components/Spinner/index.cjs +6 -2
  82. package/dist/components/Spinner/index.css +1 -0
  83. package/dist/components/Spinner/index.d.cts +8 -2
  84. package/dist/components/Spinner/index.d.ts +8 -2
  85. package/dist/components/Spinner/index.js +6 -2
  86. package/dist/components/Steps/index.cjs +6 -2
  87. package/dist/components/Steps/index.css +11 -0
  88. package/dist/components/Steps/index.d.cts +9 -2
  89. package/dist/components/Steps/index.d.ts +9 -2
  90. package/dist/components/Steps/index.js +6 -2
  91. package/dist/components/Switch/index.cjs +146 -6
  92. package/dist/components/Switch/index.css +40 -0
  93. package/dist/components/Switch/index.d.cts +13 -2
  94. package/dist/components/Switch/index.d.ts +13 -2
  95. package/dist/components/Switch/index.js +146 -6
  96. package/dist/components/Tab/index.cjs +4 -3
  97. package/dist/components/Tab/index.d.cts +12 -1
  98. package/dist/components/Tab/index.d.ts +12 -1
  99. package/dist/components/Tab/index.js +4 -3
  100. package/dist/components/Tag/index.cjs +5 -3
  101. package/dist/components/Tag/index.d.cts +12 -2
  102. package/dist/components/Tag/index.d.ts +12 -2
  103. package/dist/components/Tag/index.js +5 -3
  104. package/dist/components/TextArea/index.cjs +138 -2
  105. package/dist/components/TextArea/index.css +38 -0
  106. package/dist/components/TextArea/index.d.cts +6 -0
  107. package/dist/components/TextArea/index.d.ts +6 -0
  108. package/dist/components/TextArea/index.js +138 -2
  109. package/dist/components/Tooltip/index.cjs +4 -2
  110. package/dist/components/Tooltip/index.d.cts +11 -1
  111. package/dist/components/Tooltip/index.d.ts +11 -1
  112. package/dist/components/Tooltip/index.js +4 -2
  113. package/dist/components/index.cjs +479 -408
  114. package/dist/components/index.css +59 -31
  115. package/dist/components/index.d.cts +3 -0
  116. package/dist/components/index.d.ts +3 -0
  117. package/dist/components/index.js +262 -194
  118. package/dist/index.cjs +484 -413
  119. package/dist/index.css +59 -31
  120. package/dist/index.d.cts +3 -0
  121. package/dist/index.d.ts +3 -0
  122. package/dist/index.js +264 -196
  123. package/dist/status-g_KP3qT6.d.cts +8 -0
  124. package/dist/status-g_KP3qT6.d.ts +8 -0
  125. package/dist/validation-Dqo1zqhT.d.cts +13 -0
  126. package/dist/validation-Dqo1zqhT.d.ts +13 -0
  127. package/guidelines/AGENT_PROMPT.md +15 -0
  128. package/guidelines/components/card.md +3 -3
  129. package/guidelines/components/feedback.md +1 -1
  130. package/guidelines/components/form.md +26 -0
  131. package/guidelines/components/navigation.md +16 -15
  132. package/guidelines/components/overlay.md +43 -4
  133. package/package.json +1 -1
@@ -49,6 +49,8 @@ __export(components_exports, {
49
49
  Dropdown: () => Dropdown_default,
50
50
  Editor: () => Editor_default,
51
51
  EmptyState: () => EmptyState_default,
52
+ Field: () => Field,
53
+ FieldMessage: () => FieldMessage_default,
52
54
  FileUpload: () => FileUpload_default,
53
55
  HtmlTypeWriter: () => HtmlTypeWriter_default,
54
56
  HtmlTypewriter: () => HtmlTypeWriter_default,
@@ -87,6 +89,7 @@ __export(components_exports, {
87
89
  ToastProvider: () => ToastProvider,
88
90
  Tooltip: () => Tooltip_default,
89
91
  Video: () => Video_default,
92
+ hasError: () => hasError,
90
93
  isInRange: () => isInRange,
91
94
  isSameDay: () => isSameDay,
92
95
  useCalendar: () => useCalendar,
@@ -1601,11 +1604,49 @@ var Alert_default = Alert;
1601
1604
 
1602
1605
  // src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
1603
1606
  var import_react2 = __toESM(require("react"), 1);
1607
+
1608
+ // src/components/FieldMessage/FieldMessage.tsx
1604
1609
  var import_jsx_runtime297 = require("react/jsx-runtime");
1610
+ var ICON = {
1611
+ default: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(InfoIcon_default, {}),
1612
+ success: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(SuccessIcon_default, {}),
1613
+ warning: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(InfoIcon_default, {}),
1614
+ error: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(ErrorIcon_default, {})
1615
+ };
1616
+ var FieldMessage = (props) => {
1617
+ const { validations } = props;
1618
+ if (!validations || validations.length === 0) return null;
1619
+ return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)(
1620
+ "div",
1621
+ {
1622
+ className: clsx_default("lib-xplat-field-message", v.status),
1623
+ children: [
1624
+ /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: "icon", children: ICON[v.status] }),
1625
+ /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("span", { children: v.message })
1626
+ ]
1627
+ },
1628
+ `${v.message}_${idx}`
1629
+ )) });
1630
+ };
1631
+ FieldMessage.displayName = "FieldMessage";
1632
+ var FieldMessage_default = FieldMessage;
1633
+ var Field = (props) => {
1634
+ const { validations, children } = props;
1635
+ if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(import_jsx_runtime297.Fragment, { children });
1636
+ return /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)("div", { className: "lib-xplat-field", children: [
1637
+ children,
1638
+ /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(FieldMessage, { validations })
1639
+ ] });
1640
+ };
1641
+ Field.displayName = "Field";
1642
+ var hasError = (validations) => !!validations?.some((v) => v.status === "error");
1643
+
1644
+ // src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
1645
+ var import_jsx_runtime298 = require("react/jsx-runtime");
1605
1646
  var MAX_HEIGHT = 400;
1606
1647
  var AutoResizeTextArea = import_react2.default.forwardRef(
1607
1648
  (props, ref) => {
1608
- const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
1649
+ const { value, className, onChange, disabled, bare = false, validations, ...textareaProps } = props;
1609
1650
  const localRef = import_react2.default.useRef(null);
1610
1651
  const setRefs = (el) => {
1611
1652
  localRef.current = el;
@@ -1633,9 +1674,10 @@ var AutoResizeTextArea = import_react2.default.forwardRef(
1633
1674
  updateHeight();
1634
1675
  }, [value]);
1635
1676
  if (bare) {
1636
- return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1677
+ return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
1637
1678
  "textarea",
1638
1679
  {
1680
+ "aria-invalid": hasError(validations) || void 0,
1639
1681
  ...textareaProps,
1640
1682
  ref: setRefs,
1641
1683
  className,
@@ -1645,9 +1687,10 @@ var AutoResizeTextArea = import_react2.default.forwardRef(
1645
1687
  }
1646
1688
  );
1647
1689
  }
1648
- return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1690
+ const control = /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
1649
1691
  "textarea",
1650
1692
  {
1693
+ "aria-invalid": hasError(validations) || void 0,
1651
1694
  ...textareaProps,
1652
1695
  ref: setRefs,
1653
1696
  disabled,
@@ -1655,13 +1698,14 @@ var AutoResizeTextArea = import_react2.default.forwardRef(
1655
1698
  onChange: handleChange
1656
1699
  }
1657
1700
  ) }) });
1701
+ return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(Field, { validations, children: control });
1658
1702
  }
1659
1703
  );
1660
1704
  AutoResizeTextArea.displayName = "AutoResizeTextArea";
1661
1705
  var AutoResizeTextArea_default = AutoResizeTextArea;
1662
1706
 
1663
1707
  // src/components/Avatar/Avatar.tsx
1664
- var import_jsx_runtime298 = require("react/jsx-runtime");
1708
+ var import_jsx_runtime299 = require("react/jsx-runtime");
1665
1709
  var CATEGORICAL_COUNT = 8;
1666
1710
  var getColorIndex = (name) => {
1667
1711
  if (!name) return 1;
@@ -1678,36 +1722,36 @@ var Avatar = (props) => {
1678
1722
  const fullInitials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
1679
1723
  const initials = size === "sm" ? fullInitials.slice(0, 1) : fullInitials;
1680
1724
  const catIndex = getColorIndex(name || "");
1681
- return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("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" }) }) }) });
1725
+ return /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("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" }) }) }) });
1682
1726
  };
1683
1727
  Avatar.displayName = "Avatar";
1684
1728
  var Avatar_default = Avatar;
1685
1729
 
1686
1730
  // src/components/Box/Box.tsx
1687
- var import_jsx_runtime299 = require("react/jsx-runtime");
1731
+ var import_jsx_runtime300 = require("react/jsx-runtime");
1688
1732
  var Box = ({
1689
1733
  children,
1690
1734
  title,
1691
1735
  variant = "outlined",
1692
1736
  padding = "md"
1693
1737
  }) => {
1694
- return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
1695
- title && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-title", children: title }),
1696
- /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-content", children })
1738
+ return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
1739
+ title && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-title", children: title }),
1740
+ /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-content", children })
1697
1741
  ] });
1698
1742
  };
1699
1743
  Box.displayName = "Box";
1700
1744
  var Box_default = Box;
1701
1745
 
1702
1746
  // src/components/Breadcrumb/Breadcrumb.tsx
1703
- var import_jsx_runtime300 = require("react/jsx-runtime");
1747
+ var import_jsx_runtime301 = require("react/jsx-runtime");
1704
1748
  var Breadcrumb = (props) => {
1705
1749
  const { items, separator = "/" } = props;
1706
- return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("ol", { children: items.map((item, index) => {
1750
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("ol", { children: items.map((item, index) => {
1707
1751
  const isLast = index === items.length - 1;
1708
- return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("li", { children: [
1709
- isLast ? /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("button", { className: "link", onClick: item.onClick, children: item.label }),
1710
- !isLast && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "separator", children: separator })
1752
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("li", { children: [
1753
+ isLast ? /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("button", { className: "link", onClick: item.onClick, children: item.label }),
1754
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "separator", children: separator })
1711
1755
  ] }, index);
1712
1756
  }) }) });
1713
1757
  };
@@ -1715,7 +1759,7 @@ Breadcrumb.displayName = "Breadcrumb";
1715
1759
  var Breadcrumb_default = Breadcrumb;
1716
1760
 
1717
1761
  // src/components/Button/Button.tsx
1718
- var import_jsx_runtime301 = require("react/jsx-runtime");
1762
+ var import_jsx_runtime302 = require("react/jsx-runtime");
1719
1763
  var Button = (props) => {
1720
1764
  const {
1721
1765
  children,
@@ -1724,7 +1768,7 @@ var Button = (props) => {
1724
1768
  disabled,
1725
1769
  ...rest
1726
1770
  } = props;
1727
- return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
1771
+ return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
1728
1772
  "button",
1729
1773
  {
1730
1774
  className: clsx_default("lib-xplat-button", type, size),
@@ -1841,7 +1885,7 @@ var MONTH_LABELS = {
1841
1885
  };
1842
1886
 
1843
1887
  // src/components/Calendar/Calendar.tsx
1844
- var import_jsx_runtime302 = require("react/jsx-runtime");
1888
+ var import_jsx_runtime303 = require("react/jsx-runtime");
1845
1889
  var DayCell = import_react4.default.memo(
1846
1890
  ({
1847
1891
  day,
@@ -1853,7 +1897,7 @@ var DayCell = import_react4.default.memo(
1853
1897
  onEventClick
1854
1898
  }) => {
1855
1899
  if (renderDay) {
1856
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
1900
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
1857
1901
  "div",
1858
1902
  {
1859
1903
  className: clsx_default(
@@ -1870,7 +1914,7 @@ var DayCell = import_react4.default.memo(
1870
1914
  }
1871
1915
  );
1872
1916
  }
1873
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
1917
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
1874
1918
  "div",
1875
1919
  {
1876
1920
  className: clsx_default(
@@ -1886,9 +1930,9 @@ var DayCell = import_react4.default.memo(
1886
1930
  if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
1887
1931
  },
1888
1932
  children: [
1889
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("span", { className: "calendar-day-number", children: day.day }),
1890
- dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-day-events", children: [
1891
- dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
1933
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("span", { className: "calendar-day-number", children: day.day }),
1934
+ dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-day-events", children: [
1935
+ dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
1892
1936
  "span",
1893
1937
  {
1894
1938
  className: "calendar-event-dot",
@@ -1901,7 +1945,7 @@ var DayCell = import_react4.default.memo(
1901
1945
  },
1902
1946
  ei
1903
1947
  )),
1904
- dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("span", { className: "calendar-event-more", children: [
1948
+ dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("span", { className: "calendar-event-more", children: [
1905
1949
  "+",
1906
1950
  dayEvents.length - 3
1907
1951
  ] })
@@ -2022,21 +2066,21 @@ var Calendar = (props) => {
2022
2066
  const weekdays = WEEKDAY_LABELS[locale];
2023
2067
  const monthLabels = MONTH_LABELS[locale];
2024
2068
  const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
2025
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
2069
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
2026
2070
  "div",
2027
2071
  {
2028
2072
  className: "lib-xplat-calendar",
2029
2073
  style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
2030
2074
  children: [
2031
- /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-header", children: [
2032
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(ChevronLeftIcon_default, {}) }),
2033
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
2034
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(ChevronRightIcon_default, {}) }),
2035
- showToday && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
2075
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-header", children: [
2076
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(ChevronLeftIcon_default, {}) }),
2077
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
2078
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(ChevronRightIcon_default, {}) }),
2079
+ showToday && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
2036
2080
  ] }),
2037
- pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
2081
+ pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
2038
2082
  const y = yearRangeStart + i;
2039
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2083
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2040
2084
  "button",
2041
2085
  {
2042
2086
  type: "button",
@@ -2047,7 +2091,7 @@ var Calendar = (props) => {
2047
2091
  y
2048
2092
  );
2049
2093
  }) }),
2050
- pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2094
+ pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2051
2095
  "button",
2052
2096
  {
2053
2097
  type: "button",
@@ -2057,8 +2101,8 @@ var Calendar = (props) => {
2057
2101
  },
2058
2102
  i
2059
2103
  )) }),
2060
- pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(import_jsx_runtime302.Fragment, { children: [
2061
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2104
+ pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(import_jsx_runtime303.Fragment, { children: [
2105
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2062
2106
  "div",
2063
2107
  {
2064
2108
  className: clsx_default(
@@ -2070,12 +2114,12 @@ var Calendar = (props) => {
2070
2114
  },
2071
2115
  label
2072
2116
  )) }),
2073
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
2117
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
2074
2118
  const dayEvents = getEventsForDay(day.date);
2075
2119
  const t = day.date.getTime();
2076
2120
  const disabled = t < minTime || t > maxTime;
2077
2121
  const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
2078
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2122
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2079
2123
  DayCell,
2080
2124
  {
2081
2125
  day,
@@ -2101,10 +2145,10 @@ var Calendar_default = Calendar;
2101
2145
  var import_react5 = __toESM(require("react"), 1);
2102
2146
 
2103
2147
  // src/components/CardTab/CardTabPanel.tsx
2104
- var import_jsx_runtime303 = require("react/jsx-runtime");
2148
+ var import_jsx_runtime304 = require("react/jsx-runtime");
2105
2149
  var CardTabPanel = (props) => {
2106
2150
  const { children, columns = 3 } = props;
2107
- return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2151
+ return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
2108
2152
  "div",
2109
2153
  {
2110
2154
  className: "card-tab-panel",
@@ -2117,7 +2161,7 @@ CardTabPanel.displayName = "CardTab.Panel";
2117
2161
  var CardTabPanel_default = CardTabPanel;
2118
2162
 
2119
2163
  // src/components/CardTab/CardTab.tsx
2120
- var import_jsx_runtime304 = require("react/jsx-runtime");
2164
+ var import_jsx_runtime305 = require("react/jsx-runtime");
2121
2165
  var CardTabRoot = (props) => {
2122
2166
  const {
2123
2167
  tabs,
@@ -2141,10 +2185,10 @@ var CardTabRoot = (props) => {
2141
2185
  const activePanel = panels.find(
2142
2186
  (panel) => panel.props.value === activeValue
2143
2187
  );
2144
- return /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
2145
- /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
2188
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
2189
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
2146
2190
  const isActive2 = tab.value === activeValue;
2147
- return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
2191
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2148
2192
  "button",
2149
2193
  {
2150
2194
  className: clsx_default("card-tab-trigger", isActive2 && "active"),
@@ -2156,7 +2200,7 @@ var CardTabRoot = (props) => {
2156
2200
  tab.value
2157
2201
  );
2158
2202
  }) }),
2159
- /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-body", children: activePanel })
2203
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-body", children: activePanel })
2160
2204
  ] });
2161
2205
  };
2162
2206
  CardTabRoot.displayName = "CardTab";
@@ -2167,7 +2211,7 @@ var CardTab_default = CardTab;
2167
2211
 
2168
2212
  // src/components/Chart/Chart.tsx
2169
2213
  var import_react6 = __toESM(require("react"), 1);
2170
- var import_jsx_runtime305 = require("react/jsx-runtime");
2214
+ var import_jsx_runtime306 = require("react/jsx-runtime");
2171
2215
  var CATEGORICAL_COUNT2 = 8;
2172
2216
  var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
2173
2217
  const n = i + 1;
@@ -2310,12 +2354,12 @@ var formatTick = (value, maxVal) => {
2310
2354
  const fixed = value.toFixed(decimals);
2311
2355
  return decimals === 0 ? Number(fixed).toLocaleString("en-US") : fixed;
2312
2356
  };
2313
- var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
2357
+ var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
2314
2358
  const y = PADDING.top + (1 - ratio) * chartH;
2315
2359
  const val = formatTick(maxVal * ratio, maxVal);
2316
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
2317
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
2318
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
2360
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
2361
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
2362
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
2319
2363
  ] }, ratio);
2320
2364
  }) }));
2321
2365
  GridLines.displayName = "GridLines";
@@ -2327,10 +2371,10 @@ var getLabelStep = (count, chartW) => {
2327
2371
  };
2328
2372
  var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
2329
2373
  const step = getLabelStep(count, chartW);
2330
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: labels.map((label, i) => {
2374
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: labels.map((label, i) => {
2331
2375
  if (i % step !== 0) return null;
2332
2376
  const x = PADDING.left + i / (count - 1 || 1) * chartW;
2333
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2377
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2334
2378
  }) });
2335
2379
  });
2336
2380
  AxisLabels.displayName = "AxisLabels";
@@ -2406,7 +2450,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
2406
2450
  }, [animate, width]);
2407
2451
  const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
2408
2452
  const lineClipId = "line-area-clip";
2409
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
2453
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
2410
2454
  "svg",
2411
2455
  {
2412
2456
  viewBox: `0 0 ${width} ${height}`,
@@ -2424,9 +2468,9 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
2424
2468
  onLeave();
2425
2469
  },
2426
2470
  children: [
2427
- animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("clipPath", { id: lineClipId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2428
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
2429
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
2471
+ animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("clipPath", { id: lineClipId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2472
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
2473
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
2430
2474
  entries.map(([key], di) => {
2431
2475
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
2432
2476
  const color = palette[2];
@@ -2435,16 +2479,16 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
2435
2479
  const gradientId = `line-gradient-${di}`;
2436
2480
  const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
2437
2481
  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`;
2438
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
2439
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2440
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
2441
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
2482
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
2483
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2484
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
2485
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
2442
2486
  ] }) }),
2443
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
2444
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
2445
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
2487
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
2488
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
2489
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
2446
2490
  ] }),
2447
- activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2491
+ activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2448
2492
  "circle",
2449
2493
  {
2450
2494
  cx: points[activeIndex].x,
@@ -2456,7 +2500,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
2456
2500
  )
2457
2501
  ] }, di);
2458
2502
  }),
2459
- activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2503
+ activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2460
2504
  "line",
2461
2505
  {
2462
2506
  x1: activeX,
@@ -2466,7 +2510,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
2466
2510
  className: "chart-crosshair"
2467
2511
  }
2468
2512
  ),
2469
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2513
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2470
2514
  "rect",
2471
2515
  {
2472
2516
  x: PADDING.left,
@@ -2515,7 +2559,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
2515
2559
  }, [animate, width]);
2516
2560
  const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
2517
2561
  const curveClipId = "curve-area-clip";
2518
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
2562
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
2519
2563
  "svg",
2520
2564
  {
2521
2565
  viewBox: `0 0 ${width} ${height}`,
@@ -2534,9 +2578,9 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
2534
2578
  onLeave();
2535
2579
  },
2536
2580
  children: [
2537
- animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("clipPath", { id: curveClipId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2538
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
2539
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
2581
+ animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("clipPath", { id: curveClipId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2582
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
2583
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
2540
2584
  entries.map(([key], di) => {
2541
2585
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
2542
2586
  const color = palette[2];
@@ -2545,16 +2589,16 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
2545
2589
  const gradientId = `curve-gradient-${di}`;
2546
2590
  const linePath = toSmoothPath(points);
2547
2591
  const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
2548
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
2549
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2550
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
2551
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
2592
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
2593
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2594
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
2595
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
2552
2596
  ] }) }),
2553
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
2554
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
2555
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
2597
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
2598
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
2599
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
2556
2600
  ] }),
2557
- activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2601
+ activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2558
2602
  "circle",
2559
2603
  {
2560
2604
  cx: points[activeIndex].x,
@@ -2566,7 +2610,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
2566
2610
  )
2567
2611
  ] }, di);
2568
2612
  }),
2569
- activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2613
+ activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2570
2614
  "line",
2571
2615
  {
2572
2616
  x1: activeX,
@@ -2576,7 +2620,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
2576
2620
  className: "chart-crosshair"
2577
2621
  }
2578
2622
  ),
2579
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2623
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2580
2624
  "rect",
2581
2625
  {
2582
2626
  x: PADDING.left,
@@ -2619,11 +2663,11 @@ var BarChart = import_react6.default.memo(({ data, labels, width, height, animat
2619
2663
  [entries, maxVal, chartH, groupW, barW, barGap, groupCount]
2620
2664
  );
2621
2665
  const barLabelStep = getLabelStep(count, chartW);
2622
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
2623
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
2666
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
2667
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
2624
2668
  labels.map((label, i) => {
2625
2669
  if (i % barLabelStep !== 0) return null;
2626
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2670
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2627
2671
  }),
2628
2672
  entries.map(([key], di) => {
2629
2673
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
@@ -2632,7 +2676,7 @@ var BarChart = import_react6.default.memo(({ data, labels, width, height, animat
2632
2676
  const r2 = Math.min(4, b.w / 2);
2633
2677
  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`;
2634
2678
  const delay = 100 + i * 80;
2635
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2679
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2636
2680
  "path",
2637
2681
  {
2638
2682
  d,
@@ -2712,8 +2756,8 @@ var PieDonutChart = import_react6.default.memo(
2712
2756
  });
2713
2757
  }, [values, total, cx, cy, r2, innerR, labels]);
2714
2758
  const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
2715
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
2716
- animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2759
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
2760
+ animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2717
2761
  "circle",
2718
2762
  {
2719
2763
  ref: maskRef,
@@ -2726,7 +2770,7 @@ var PieDonutChart = import_react6.default.memo(
2726
2770
  transform: `rotate(-90 ${cx} ${cy})`
2727
2771
  }
2728
2772
  ) }) }),
2729
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2773
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2730
2774
  "path",
2731
2775
  {
2732
2776
  d: s.d,
@@ -2761,15 +2805,15 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
2761
2805
  const sepIdx = content.indexOf(" \u2014 ");
2762
2806
  const title = sepIdx >= 0 ? content.slice(0, sepIdx) : content;
2763
2807
  const desc = sepIdx >= 0 ? content.slice(sepIdx + 3) : "";
2764
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
2808
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
2765
2809
  "div",
2766
2810
  {
2767
2811
  ref,
2768
2812
  className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
2769
2813
  style: { left: pos.left, top: pos.top },
2770
2814
  children: [
2771
- title && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-title", children: title }),
2772
- desc && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-desc", children: desc })
2815
+ title && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-title", children: title }),
2816
+ desc && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-desc", children: desc })
2773
2817
  ]
2774
2818
  }
2775
2819
  );
@@ -2781,14 +2825,14 @@ var ChartLegend = ({ data, labels, type }) => {
2781
2825
  const total = values.reduce((a, b) => a + b, 0) || 1;
2782
2826
  const firstKey = entries[0]?.[0] ?? "";
2783
2827
  const colorOffset = hashString(firstKey);
2784
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
2828
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
2785
2829
  const pct = Math.round(v / total * 100);
2786
2830
  const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
2787
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
2788
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2789
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
2790
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
2791
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("span", { className: "chart-legend-value", children: [
2831
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
2832
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2833
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
2834
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
2835
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("span", { className: "chart-legend-value", children: [
2792
2836
  v.toLocaleString(),
2793
2837
  "(",
2794
2838
  pct,
@@ -2798,22 +2842,23 @@ var ChartLegend = ({ data, labels, type }) => {
2798
2842
  ] }, i);
2799
2843
  }) });
2800
2844
  }
2801
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
2845
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
2802
2846
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
2803
2847
  const color = palette[2];
2804
2848
  const values = entries[di][1];
2805
2849
  const sum = values.reduce((a, b) => a + b, 0);
2806
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
2807
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2808
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
2809
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: key }),
2810
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
2850
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
2851
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2852
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
2853
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: key }),
2854
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
2811
2855
  ] })
2812
2856
  ] }, di);
2813
2857
  }) });
2814
2858
  };
2815
2859
  var Chart = import_react6.default.memo((props) => {
2816
- const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
2860
+ const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
2861
+ const shape = variant ?? type ?? "line";
2817
2862
  const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
2818
2863
  const { width, height } = useChartSize(containerRef);
2819
2864
  const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
@@ -2821,14 +2866,14 @@ var Chart = import_react6.default.memo((props) => {
2821
2866
  const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
2822
2867
  const animate = useChartAnimation(containerRef, dataKey);
2823
2868
  const ready = width > 0 && height > 0;
2824
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
2825
- ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2826
- ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2827
- ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2828
- ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2829
- ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
2830
- ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
2831
- tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
2869
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
2870
+ ready && shape === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2871
+ ready && shape === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2872
+ ready && shape === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2873
+ ready && shape === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2874
+ ready && shape === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
2875
+ ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
2876
+ tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
2832
2877
  ] });
2833
2878
  });
2834
2879
  Chart.displayName = "Chart";
@@ -2838,7 +2883,7 @@ var Chart_default = Chart;
2838
2883
  var import_react7 = __toESM(require("react"), 1);
2839
2884
 
2840
2885
  // src/components/IconButton/IconButton.tsx
2841
- var import_jsx_runtime306 = require("react/jsx-runtime");
2886
+ var import_jsx_runtime307 = require("react/jsx-runtime");
2842
2887
  var IconButton = (props) => {
2843
2888
  const {
2844
2889
  icon,
@@ -2847,7 +2892,7 @@ var IconButton = (props) => {
2847
2892
  disabled,
2848
2893
  ...rest
2849
2894
  } = props;
2850
- return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2895
+ return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
2851
2896
  "button",
2852
2897
  {
2853
2898
  className: clsx_default("lib-xplat-icon-button", type, size),
@@ -2861,7 +2906,7 @@ IconButton.displayName = "IconButton";
2861
2906
  var IconButton_default = IconButton;
2862
2907
 
2863
2908
  // src/components/ChatInput/ChatInput.tsx
2864
- var import_jsx_runtime307 = require("react/jsx-runtime");
2909
+ var import_jsx_runtime308 = require("react/jsx-runtime");
2865
2910
  var ChatInput = import_react7.default.forwardRef(
2866
2911
  (props, ref) => {
2867
2912
  const {
@@ -2870,7 +2915,8 @@ var ChatInput = import_react7.default.forwardRef(
2870
2915
  disabled = false,
2871
2916
  buttonType = "primary",
2872
2917
  onSubmit,
2873
- onChange
2918
+ onChange,
2919
+ validations
2874
2920
  } = props;
2875
2921
  const isControlled = valueProp !== void 0;
2876
2922
  const [internalValue, setInternalValue] = import_react7.default.useState("");
@@ -2892,8 +2938,8 @@ var ChatInput = import_react7.default.forwardRef(
2892
2938
  handleSubmit();
2893
2939
  }
2894
2940
  };
2895
- return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
2896
- /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
2941
+ const control = /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
2942
+ /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
2897
2943
  AutoResizeTextArea_default,
2898
2944
  {
2899
2945
  ref,
@@ -2904,13 +2950,14 @@ var ChatInput = import_react7.default.forwardRef(
2904
2950
  disabled,
2905
2951
  rows: 1,
2906
2952
  onChange: handleChange,
2953
+ "aria-invalid": hasError(validations) || void 0,
2907
2954
  onKeyDown: handleKeyDown
2908
2955
  }
2909
2956
  ),
2910
- /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
2957
+ /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
2911
2958
  IconButton_default,
2912
2959
  {
2913
- icon: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(MessageSquareIcon_default, {}),
2960
+ icon: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(MessageSquareIcon_default, {}),
2914
2961
  type: buttonType,
2915
2962
  size: "sm",
2916
2963
  disabled: !hasText || disabled,
@@ -2919,6 +2966,7 @@ var ChatInput = import_react7.default.forwardRef(
2919
2966
  }
2920
2967
  )
2921
2968
  ] });
2969
+ return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Field, { validations, children: control });
2922
2970
  }
2923
2971
  );
2924
2972
  ChatInput.displayName = "ChatInput";
@@ -2930,8 +2978,11 @@ var import_tokens_core = require("@x-plat/tokens-core");
2930
2978
  // src/tokens/index.ts
2931
2979
  var import_tokens_core2 = require("@x-plat/tokens-core");
2932
2980
 
2981
+ // src/tokens/interface/status.ts
2982
+ var normalizeStatus = (value) => value === "brand" ? "primary" : value;
2983
+
2933
2984
  // src/components/CheckBox/CheckBox.tsx
2934
- var import_jsx_runtime308 = require("react/jsx-runtime");
2985
+ var import_jsx_runtime309 = require("react/jsx-runtime");
2935
2986
  var CheckBox = (props) => {
2936
2987
  const {
2937
2988
  checked,
@@ -2940,9 +2991,11 @@ var CheckBox = (props) => {
2940
2991
  onChange,
2941
2992
  disabled,
2942
2993
  size = "md",
2943
- type = "brand",
2994
+ type = "primary",
2995
+ validations,
2944
2996
  ...rest
2945
2997
  } = props;
2998
+ const statusType = normalizeStatus(type);
2946
2999
  const handleChange = (e) => {
2947
3000
  if (onChange) onChange(e);
2948
3001
  };
@@ -2950,60 +3003,45 @@ var CheckBox = (props) => {
2950
3003
  const checkedClasses = `checked`;
2951
3004
  const disabledClasses = "disabled";
2952
3005
  const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
2953
- return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
2954
- /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
3006
+ const control = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
3007
+ /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
2955
3008
  "input",
2956
3009
  {
2957
3010
  type: "checkbox",
2958
3011
  checked,
2959
3012
  onChange: handleChange,
2960
3013
  disabled,
3014
+ "aria-invalid": hasError(validations) || void 0,
2961
3015
  ...rest
2962
3016
  }
2963
3017
  ),
2964
- /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(CheckIcon_default, {}) }) }),
2965
- label && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("span", { className: "label", children: label })
3018
+ /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(CheckIcon_default, {}) }) }),
3019
+ label && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { className: "label", children: label })
2966
3020
  ] });
3021
+ return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(Field, { validations, children: control });
2967
3022
  };
2968
3023
  CheckBox.displayName = "CheckBox";
2969
3024
  var CheckBox_default = CheckBox;
2970
3025
 
2971
3026
  // src/components/Chip/Chip.tsx
2972
- var import_jsx_runtime309 = require("react/jsx-runtime");
3027
+ var import_jsx_runtime310 = require("react/jsx-runtime");
2973
3028
  var Chip = (props) => {
2974
3029
  const {
2975
3030
  children,
2976
3031
  type = "primary",
2977
3032
  size = "md"
2978
3033
  } = props;
2979
- return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size), children });
3034
+ return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size), children });
2980
3035
  };
2981
3036
  Chip.displayName = "Chip";
2982
3037
  var Chip_default = Chip;
2983
3038
 
2984
3039
  // src/components/DatePicker/InputDatePicker/index.tsx
2985
- var import_react13 = __toESM(require("react"), 1);
3040
+ var import_react12 = __toESM(require("react"), 1);
2986
3041
 
2987
3042
  // src/components/Input/Input.tsx
2988
3043
  var import_react8 = __toESM(require("react"), 1);
2989
3044
 
2990
- // src/components/Input/InputValidations.tsx
2991
- var import_jsx_runtime310 = require("react/jsx-runtime");
2992
- var InputValidations = (props) => {
2993
- const { message, status = "default" } = props;
2994
- return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
2995
- /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "icon", children: [
2996
- status === "default" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(InfoIcon_default, {}),
2997
- status === "success" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(SuccessIcon_default, {}),
2998
- status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(InfoIcon_default, {}),
2999
- status === "error" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(ErrorIcon_default, {})
3000
- ] }),
3001
- /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "message", children: message })
3002
- ] });
3003
- };
3004
- InputValidations.displayName = "InputValidations";
3005
- var InputValidations_default = InputValidations;
3006
-
3007
3045
  // src/components/Input/reg.ts
3008
3046
  var numberAndCommaReg = /^[0-9,]+$/;
3009
3047
  var phoneNumberMaxLengthReg = /^.{0,13}$/;
@@ -3040,7 +3078,6 @@ var handleTelBackspace = (prevValue, currValue) => {
3040
3078
 
3041
3079
  // src/components/Input/Input.tsx
3042
3080
  var import_jsx_runtime311 = require("react/jsx-runtime");
3043
- var import_react9 = require("react");
3044
3081
  var formatValue = (type, value) => {
3045
3082
  if (value === null || value === void 0) return "";
3046
3083
  const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
@@ -3129,32 +3166,27 @@ var Input = import_react8.default.forwardRef((props, ref) => {
3129
3166
  disabled,
3130
3167
  type: type === "number" ? "text" : type,
3131
3168
  value: localValue,
3132
- onChange: handleChange
3169
+ onChange: handleChange,
3170
+ "aria-invalid": hasError(validations) || void 0
3133
3171
  }
3134
3172
  ),
3135
3173
  suffix && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "suffix", children: suffix })
3136
3174
  ]
3137
3175
  }
3138
3176
  ),
3139
- validations && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ (0, import_react9.createElement)(
3140
- InputValidations_default,
3141
- {
3142
- ...validation,
3143
- key: `${validation.message}_${idx}`
3144
- }
3145
- )) })
3177
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(FieldMessage_default, { validations })
3146
3178
  ] });
3147
3179
  });
3148
3180
  Input.displayName = "Input";
3149
3181
  var Input_default = Input;
3150
3182
 
3151
3183
  // src/components/Input/PasswordInput/PasswordInput.tsx
3152
- var import_react10 = __toESM(require("react"), 1);
3184
+ var import_react9 = __toESM(require("react"), 1);
3153
3185
  var import_jsx_runtime312 = require("react/jsx-runtime");
3154
- var PasswordInput = import_react10.default.forwardRef(
3186
+ var PasswordInput = import_react9.default.forwardRef(
3155
3187
  (props, ref) => {
3156
3188
  const { reg: _reg, ...inputProps } = props;
3157
- const [isView, setIsView] = import_react10.default.useState(false);
3189
+ const [isView, setIsView] = import_react9.default.useState(false);
3158
3190
  const handleChangeView = () => {
3159
3191
  setIsView((prev) => !prev);
3160
3192
  };
@@ -3173,16 +3205,16 @@ PasswordInput.displayName = "PasswordInput";
3173
3205
  var PasswordInput_default = PasswordInput;
3174
3206
 
3175
3207
  // src/components/Modal/Modal.tsx
3176
- var import_react11 = __toESM(require("react"), 1);
3208
+ var import_react10 = __toESM(require("react"), 1);
3177
3209
  var import_react_dom = require("react-dom");
3178
3210
  var import_jsx_runtime313 = require("react/jsx-runtime");
3179
3211
  var ANIMATION_DURATION_MS = 200;
3180
3212
  var Modal = (props) => {
3181
3213
  const { isOpen, onClose, children } = props;
3182
- const [mounted, setMounted] = import_react11.default.useState(false);
3183
- const [visible, setVisible] = import_react11.default.useState(false);
3184
- const [settled, setSettled] = import_react11.default.useState(false);
3185
- import_react11.default.useEffect(() => {
3214
+ const [mounted, setMounted] = import_react10.default.useState(false);
3215
+ const [visible, setVisible] = import_react10.default.useState(false);
3216
+ const [settled, setSettled] = import_react10.default.useState(false);
3217
+ import_react10.default.useEffect(() => {
3186
3218
  if (isOpen) {
3187
3219
  setMounted(true);
3188
3220
  const show = setTimeout(() => setVisible(true), 1);
@@ -3225,9 +3257,9 @@ Modal.displayName = "Modal";
3225
3257
  var Modal_default = Modal;
3226
3258
 
3227
3259
  // src/components/DatePicker/SingleDatePicker/index.tsx
3228
- var import_react12 = __toESM(require("react"), 1);
3260
+ var import_react11 = __toESM(require("react"), 1);
3229
3261
  var import_jsx_runtime314 = require("react/jsx-runtime");
3230
- var DayCell2 = import_react12.default.memo(
3262
+ var DayCell2 = import_react11.default.memo(
3231
3263
  ({
3232
3264
  day,
3233
3265
  disabled,
@@ -3279,26 +3311,26 @@ var SingleDatePicker = (props) => {
3279
3311
  initialYear,
3280
3312
  initialMonth
3281
3313
  );
3282
- const [pickerMode, setPickerMode] = import_react12.default.useState("days");
3283
- const [yearRangeStart, setYearRangeStart] = import_react12.default.useState(
3314
+ const [pickerMode, setPickerMode] = import_react11.default.useState("days");
3315
+ const [yearRangeStart, setYearRangeStart] = import_react11.default.useState(
3284
3316
  Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
3285
3317
  );
3286
- const minTime = import_react12.default.useMemo(
3318
+ const minTime = import_react11.default.useMemo(
3287
3319
  () => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
3288
3320
  [minDate]
3289
3321
  );
3290
- const maxTime = import_react12.default.useMemo(
3322
+ const maxTime = import_react11.default.useMemo(
3291
3323
  () => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
3292
3324
  [maxDate]
3293
3325
  );
3294
- const highlightSet = import_react12.default.useMemo(() => {
3326
+ const highlightSet = import_react11.default.useMemo(() => {
3295
3327
  const set = /* @__PURE__ */ new Set();
3296
3328
  for (const h of highlightDates) {
3297
3329
  set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
3298
3330
  }
3299
3331
  return set;
3300
3332
  }, [highlightDates]);
3301
- const handleSelect = import_react12.default.useCallback(
3333
+ const handleSelect = import_react11.default.useCallback(
3302
3334
  (date) => {
3303
3335
  onChange?.(date);
3304
3336
  },
@@ -3427,8 +3459,8 @@ var formatDate = (date) => {
3427
3459
  };
3428
3460
  var InputDatePicker = (props) => {
3429
3461
  const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
3430
- const [isOpen, setIsOpen] = import_react13.default.useState(false);
3431
- const [tempDate, setTempDate] = import_react13.default.useState(value ?? /* @__PURE__ */ new Date());
3462
+ const [isOpen, setIsOpen] = import_react12.default.useState(false);
3463
+ const [tempDate, setTempDate] = import_react12.default.useState(value ?? /* @__PURE__ */ new Date());
3432
3464
  const handleOpen = () => {
3433
3465
  if (disabled) return;
3434
3466
  setTempDate(value ?? /* @__PURE__ */ new Date());
@@ -3477,18 +3509,18 @@ InputDatePicker.displayName = "InputDatePicker";
3477
3509
  var InputDatePicker_default = InputDatePicker;
3478
3510
 
3479
3511
  // src/components/DatePicker/PopupPicker/index.tsx
3480
- var import_react17 = __toESM(require("react"), 1);
3512
+ var import_react16 = __toESM(require("react"), 1);
3481
3513
 
3482
3514
  // src/components/DatePicker/RangePicker/index.tsx
3483
- var import_react16 = __toESM(require("react"), 1);
3515
+ var import_react15 = __toESM(require("react"), 1);
3484
3516
 
3485
3517
  // src/components/Tab/Tab.tsx
3486
- var import_react15 = __toESM(require("react"), 1);
3518
+ var import_react14 = __toESM(require("react"), 1);
3487
3519
 
3488
3520
  // src/components/Tab/TabItem.tsx
3489
- var import_react14 = __toESM(require("react"), 1);
3521
+ var import_react13 = __toESM(require("react"), 1);
3490
3522
  var import_jsx_runtime316 = require("react/jsx-runtime");
3491
- var TabItem = import_react14.default.forwardRef((props, ref) => {
3523
+ var TabItem = import_react13.default.forwardRef((props, ref) => {
3492
3524
  const { isActive: isActive2, title, onClick } = props;
3493
3525
  return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
3494
3526
  "div",
@@ -3506,22 +3538,23 @@ var TabItem_default = TabItem;
3506
3538
  // src/components/Tab/Tab.tsx
3507
3539
  var import_jsx_runtime317 = require("react/jsx-runtime");
3508
3540
  var Tab = (props) => {
3509
- const { activeIndex, onChange, tabs, type, size = "md" } = props;
3510
- const [underlineStyle, setUnderlineStyle] = import_react15.default.useState({
3541
+ const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
3542
+ const shape = variant ?? type ?? "default";
3543
+ const [underlineStyle, setUnderlineStyle] = import_react14.default.useState({
3511
3544
  left: 0,
3512
3545
  width: 0
3513
3546
  });
3514
- const itemRefs = import_react15.default.useRef([]);
3547
+ const itemRefs = import_react14.default.useRef([]);
3515
3548
  const handleChangeActiveTab = (tabItem, tabIdx) => {
3516
3549
  onChange(tabItem, tabIdx);
3517
3550
  };
3518
- import_react15.default.useEffect(() => {
3551
+ import_react14.default.useEffect(() => {
3519
3552
  const el = itemRefs.current[activeIndex];
3520
3553
  if (el) {
3521
3554
  setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
3522
3555
  }
3523
3556
  }, [activeIndex, tabs.length]);
3524
- return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
3557
+ return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
3525
3558
  tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
3526
3559
  TabItem_default,
3527
3560
  {
@@ -3534,7 +3567,7 @@ var Tab = (props) => {
3534
3567
  },
3535
3568
  `${tab.value}_${idx}`
3536
3569
  )),
3537
- type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
3570
+ shape === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
3538
3571
  "div",
3539
3572
  {
3540
3573
  className: "tab-toggle-underline",
@@ -3560,7 +3593,7 @@ var RangePicker = (props) => {
3560
3593
  maxDate,
3561
3594
  locale = "ko"
3562
3595
  } = props;
3563
- const [activeTab, setActiveTab] = import_react16.default.useState("start");
3596
+ const [activeTab, setActiveTab] = import_react15.default.useState("start");
3564
3597
  const handleStartChange = (date) => {
3565
3598
  if (!date) return;
3566
3599
  const newStart = date > endDate ? endDate : date;
@@ -3645,7 +3678,7 @@ var RangePicker_default = RangePicker;
3645
3678
  var import_jsx_runtime319 = require("react/jsx-runtime");
3646
3679
  var PopupPicker = (props) => {
3647
3680
  const { component, type, locale } = props;
3648
- const [isOpen, setIsOpen] = import_react17.default.useState(false);
3681
+ const [isOpen, setIsOpen] = import_react16.default.useState(false);
3649
3682
  const handleClick = () => setIsOpen(true);
3650
3683
  const handleClose = () => setIsOpen(false);
3651
3684
  const handleSingleChange = (date) => {
@@ -3654,7 +3687,7 @@ var PopupPicker = (props) => {
3654
3687
  handleClose();
3655
3688
  };
3656
3689
  return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
3657
- import_react17.default.cloneElement(component, { onClick: handleClick }),
3690
+ import_react16.default.cloneElement(component, { onClick: handleClick }),
3658
3691
  /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
3659
3692
  /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-content", children: [
3660
3693
  type === "single" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
@@ -3713,15 +3746,15 @@ Divider.displayName = "Divider";
3713
3746
  var Divider_default = Divider;
3714
3747
 
3715
3748
  // src/components/Drawer/Drawer.tsx
3716
- var import_react18 = __toESM(require("react"), 1);
3749
+ var import_react17 = __toESM(require("react"), 1);
3717
3750
  var import_react_dom2 = require("react-dom");
3718
3751
  var import_jsx_runtime321 = require("react/jsx-runtime");
3719
3752
  var ANIMATION_DURATION_MS2 = 250;
3720
3753
  var Drawer = (props) => {
3721
3754
  const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
3722
- const [mounted, setMounted] = import_react18.default.useState(false);
3723
- const [visible, setVisible] = import_react18.default.useState(false);
3724
- import_react18.default.useEffect(() => {
3755
+ const [mounted, setMounted] = import_react17.default.useState(false);
3756
+ const [visible, setVisible] = import_react17.default.useState(false);
3757
+ import_react17.default.useEffect(() => {
3725
3758
  if (isOpen) {
3726
3759
  setMounted(true);
3727
3760
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -3765,7 +3798,7 @@ Drawer.displayName = "Drawer";
3765
3798
  var Drawer_default = Drawer;
3766
3799
 
3767
3800
  // src/components/Dropdown/Dropdown.tsx
3768
- var import_react21 = __toESM(require("react"), 1);
3801
+ var import_react20 = __toESM(require("react"), 1);
3769
3802
 
3770
3803
  // src/tokens/hooks/Portal.tsx
3771
3804
  var import_react_dom3 = __toESM(require("react-dom"), 1);
@@ -3777,13 +3810,13 @@ Portal.displayName = "Portal";
3777
3810
  var Portal_default = Portal;
3778
3811
 
3779
3812
  // src/tokens/hooks/useAutoPosition.ts
3780
- var import_react19 = __toESM(require("react"), 1);
3813
+ var import_react18 = __toESM(require("react"), 1);
3781
3814
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3782
- const [position, setPosition] = import_react19.default.useState({
3815
+ const [position, setPosition] = import_react18.default.useState({
3783
3816
  position: {},
3784
3817
  direction: "bottom"
3785
3818
  });
3786
- const calculatePosition = import_react19.default.useCallback(() => {
3819
+ const calculatePosition = import_react18.default.useCallback(() => {
3787
3820
  if (!triggerRef.current || !popRef.current) return;
3788
3821
  const triggerRect = triggerRef.current.getBoundingClientRect();
3789
3822
  const popW = popRef.current.offsetWidth;
@@ -3810,13 +3843,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3810
3843
  direction
3811
3844
  });
3812
3845
  }, [triggerRef, popRef]);
3813
- import_react19.default.useLayoutEffect(() => {
3846
+ import_react18.default.useLayoutEffect(() => {
3814
3847
  if (!enabled) return;
3815
3848
  calculatePosition();
3816
3849
  const raf = requestAnimationFrame(calculatePosition);
3817
3850
  return () => cancelAnimationFrame(raf);
3818
3851
  }, [calculatePosition, enabled]);
3819
- import_react19.default.useEffect(() => {
3852
+ import_react18.default.useEffect(() => {
3820
3853
  if (!enabled || !popRef.current) return;
3821
3854
  const observer = new ResizeObserver(() => {
3822
3855
  calculatePosition();
@@ -3824,7 +3857,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3824
3857
  observer.observe(popRef.current);
3825
3858
  return () => observer.disconnect();
3826
3859
  }, [calculatePosition, enabled, popRef]);
3827
- import_react19.default.useEffect(() => {
3860
+ import_react18.default.useEffect(() => {
3828
3861
  if (!enabled) return;
3829
3862
  window.addEventListener("resize", calculatePosition);
3830
3863
  window.addEventListener("scroll", calculatePosition, true);
@@ -3838,9 +3871,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3838
3871
  var useAutoPosition_default = useAutoPosition;
3839
3872
 
3840
3873
  // src/tokens/hooks/useClickOutside.ts
3841
- var import_react20 = __toESM(require("react"), 1);
3874
+ var import_react19 = __toESM(require("react"), 1);
3842
3875
  var useClickOutside = (refs, handler, enabled = true) => {
3843
- import_react20.default.useEffect(() => {
3876
+ import_react19.default.useEffect(() => {
3844
3877
  if (!enabled) return;
3845
3878
  const refArray = Array.isArray(refs) ? refs : [refs];
3846
3879
  const listener = (event) => {
@@ -3866,14 +3899,14 @@ var useClickOutside_default = useClickOutside;
3866
3899
  var import_jsx_runtime322 = require("react/jsx-runtime");
3867
3900
  var Dropdown = (props) => {
3868
3901
  const { items, children } = props;
3869
- const [isOpen, setIsOpen] = import_react21.default.useState(false);
3870
- const [mounted, setMounted] = import_react21.default.useState(false);
3871
- const [visible, setVisible] = import_react21.default.useState(false);
3872
- const triggerRef = import_react21.default.useRef(null);
3873
- const menuRef = import_react21.default.useRef(null);
3902
+ const [isOpen, setIsOpen] = import_react20.default.useState(false);
3903
+ const [mounted, setMounted] = import_react20.default.useState(false);
3904
+ const [visible, setVisible] = import_react20.default.useState(false);
3905
+ const triggerRef = import_react20.default.useRef(null);
3906
+ const menuRef = import_react20.default.useRef(null);
3874
3907
  const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
3875
3908
  useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
3876
- import_react21.default.useEffect(() => {
3909
+ import_react20.default.useEffect(() => {
3877
3910
  if (isOpen) {
3878
3911
  setMounted(true);
3879
3912
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -3927,7 +3960,7 @@ Dropdown.displayName = "Dropdown";
3927
3960
  var Dropdown_default = Dropdown;
3928
3961
 
3929
3962
  // src/components/Editor/Editor.tsx
3930
- var import_react22 = __toESM(require("react"), 1);
3963
+ var import_react21 = __toESM(require("react"), 1);
3931
3964
  var import_jsx_runtime323 = require("react/jsx-runtime");
3932
3965
  var DEFAULT_TOOLBAR = [
3933
3966
  "bold",
@@ -4035,21 +4068,21 @@ var Editor = (props) => {
4035
4068
  onImageUpload,
4036
4069
  minHeight = 200
4037
4070
  } = props;
4038
- const editorRef = import_react22.default.useRef(null);
4039
- const lastRangeRef = import_react22.default.useRef(null);
4040
- const composingRef = import_react22.default.useRef(false);
4041
- const [isFocused, setIsFocused] = import_react22.default.useState(false);
4042
- const [isEmpty, setIsEmpty] = import_react22.default.useState(!value);
4043
- const [activeFormats, setActiveFormats] = import_react22.default.useState(/* @__PURE__ */ new Set());
4044
- const [slashOpen, setSlashOpen] = import_react22.default.useState(false);
4045
- const [slashFilter, setSlashFilter] = import_react22.default.useState("");
4046
- const [slashIdx, setSlashIdx] = import_react22.default.useState(0);
4047
- const [slashPos, setSlashPos] = import_react22.default.useState({ top: 0, left: 0 });
4048
- const slashStartRangeRef = import_react22.default.useRef(null);
4049
- const [linkOpen, setLinkOpen] = import_react22.default.useState(false);
4050
- const [linkValue, setLinkValue] = import_react22.default.useState("");
4051
- const [linkPos, setLinkPos] = import_react22.default.useState({ top: 0, left: 0 });
4052
- import_react22.default.useEffect(() => {
4071
+ const editorRef = import_react21.default.useRef(null);
4072
+ const lastRangeRef = import_react21.default.useRef(null);
4073
+ const composingRef = import_react21.default.useRef(false);
4074
+ const [isFocused, setIsFocused] = import_react21.default.useState(false);
4075
+ const [isEmpty, setIsEmpty] = import_react21.default.useState(!value);
4076
+ const [activeFormats, setActiveFormats] = import_react21.default.useState(/* @__PURE__ */ new Set());
4077
+ const [slashOpen, setSlashOpen] = import_react21.default.useState(false);
4078
+ const [slashFilter, setSlashFilter] = import_react21.default.useState("");
4079
+ const [slashIdx, setSlashIdx] = import_react21.default.useState(0);
4080
+ const [slashPos, setSlashPos] = import_react21.default.useState({ top: 0, left: 0 });
4081
+ const slashStartRangeRef = import_react21.default.useRef(null);
4082
+ const [linkOpen, setLinkOpen] = import_react21.default.useState(false);
4083
+ const [linkValue, setLinkValue] = import_react21.default.useState("");
4084
+ const [linkPos, setLinkPos] = import_react21.default.useState({ top: 0, left: 0 });
4085
+ import_react21.default.useEffect(() => {
4053
4086
  if (!editorRef.current) return;
4054
4087
  if (editorRef.current.innerHTML !== value) {
4055
4088
  editorRef.current.innerHTML = sanitizeHtml(value || "");
@@ -4163,7 +4196,7 @@ var Editor = (props) => {
4163
4196
  setSlashIdx(0);
4164
4197
  slashStartRangeRef.current = null;
4165
4198
  };
4166
- const filteredSlashItems = import_react22.default.useMemo(() => {
4199
+ const filteredSlashItems = import_react21.default.useMemo(() => {
4167
4200
  if (!slashFilter) return SLASH_ITEMS;
4168
4201
  const f = slashFilter.toLowerCase();
4169
4202
  return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
@@ -4556,7 +4589,7 @@ var EditorToolbar = ({ items, active, onAction }) => {
4556
4589
  )) });
4557
4590
  };
4558
4591
  var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
4559
- import_react22.default.useEffect(() => {
4592
+ import_react21.default.useEffect(() => {
4560
4593
  const handleClickOutside = (e) => {
4561
4594
  const target = e.target;
4562
4595
  const menu = document.querySelector(".lib-xplat-editor__slash-menu");
@@ -4590,8 +4623,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
4590
4623
  );
4591
4624
  };
4592
4625
  var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
4593
- const inputRef = import_react22.default.useRef(null);
4594
- import_react22.default.useEffect(() => {
4626
+ const inputRef = import_react21.default.useRef(null);
4627
+ import_react21.default.useEffect(() => {
4595
4628
  inputRef.current?.focus();
4596
4629
  }, []);
4597
4630
  return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
@@ -4649,7 +4682,7 @@ EmptyState.displayName = "EmptyState";
4649
4682
  var EmptyState_default = EmptyState;
4650
4683
 
4651
4684
  // src/components/FileUpload/FileUpload.tsx
4652
- var import_react23 = __toESM(require("react"), 1);
4685
+ var import_react22 = __toESM(require("react"), 1);
4653
4686
  var import_jsx_runtime325 = require("react/jsx-runtime");
4654
4687
  var FileUpload = (props) => {
4655
4688
  const {
@@ -4658,10 +4691,11 @@ var FileUpload = (props) => {
4658
4691
  maxSize,
4659
4692
  onChange,
4660
4693
  label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
4661
- description
4694
+ description,
4695
+ validations
4662
4696
  } = props;
4663
- const [isDragOver, setIsDragOver] = import_react23.default.useState(false);
4664
- const inputRef = import_react23.default.useRef(null);
4697
+ const [isDragOver, setIsDragOver] = import_react22.default.useState(false);
4698
+ const inputRef = import_react22.default.useRef(null);
4665
4699
  const handleFiles = (fileList) => {
4666
4700
  let files = Array.from(fileList);
4667
4701
  if (maxSize) {
@@ -4691,7 +4725,7 @@ var FileUpload = (props) => {
4691
4725
  handleFiles(e.target.files);
4692
4726
  }
4693
4727
  };
4694
- return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
4728
+ const control = /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
4695
4729
  "div",
4696
4730
  {
4697
4731
  className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
@@ -4707,7 +4741,8 @@ var FileUpload = (props) => {
4707
4741
  type: "file",
4708
4742
  accept,
4709
4743
  multiple,
4710
- onChange: handleChange
4744
+ onChange: handleChange,
4745
+ "aria-invalid": hasError(validations) || void 0
4711
4746
  }
4712
4747
  ),
4713
4748
  /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(UploadIcon_default, {}) }),
@@ -4716,15 +4751,16 @@ var FileUpload = (props) => {
4716
4751
  ]
4717
4752
  }
4718
4753
  );
4754
+ return /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(Field, { validations, children: control });
4719
4755
  };
4720
4756
  FileUpload.displayName = "FileUpload";
4721
4757
  var FileUpload_default = FileUpload;
4722
4758
 
4723
4759
  // src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
4724
- var import_react25 = __toESM(require("react"), 1);
4760
+ var import_react24 = __toESM(require("react"), 1);
4725
4761
 
4726
4762
  // src/components/HtmlTypeWriter/utils.ts
4727
- var import_react24 = __toESM(require("react"), 1);
4763
+ var import_react23 = __toESM(require("react"), 1);
4728
4764
  var voidTags = /* @__PURE__ */ new Set([
4729
4765
  "br",
4730
4766
  "img",
@@ -4792,15 +4828,15 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
4792
4828
  props[attr.name] = attr.value;
4793
4829
  });
4794
4830
  if (voidTags.has(tag)) {
4795
- return import_react24.default.createElement(tag, props);
4831
+ return import_react23.default.createElement(tag, props);
4796
4832
  }
4797
4833
  const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
4798
- return import_react24.default.createElement(tag, props, ...children);
4834
+ return import_react23.default.createElement(tag, props, ...children);
4799
4835
  };
4800
4836
  var htmlToReactProgressive = (root, typedLen, rangeMap) => {
4801
4837
  const nodes = Array.from(root.childNodes).map((child, idx) => {
4802
4838
  const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
4803
- return node == null ? null : import_react24.default.createElement(import_react24.default.Fragment, { key: idx }, node);
4839
+ return node == null ? null : import_react23.default.createElement(import_react23.default.Fragment, { key: idx }, node);
4804
4840
  }).filter(Boolean);
4805
4841
  return nodes.length === 0 ? null : nodes;
4806
4842
  };
@@ -4813,20 +4849,20 @@ var HtmlTypeWriter = ({
4813
4849
  onDone,
4814
4850
  onChange
4815
4851
  }) => {
4816
- const [typedLen, setTypedLen] = import_react25.default.useState(0);
4817
- const doneCalledRef = import_react25.default.useRef(false);
4818
- const { doc, rangeMap, totalLength } = import_react25.default.useMemo(() => {
4852
+ const [typedLen, setTypedLen] = import_react24.default.useState(0);
4853
+ const doneCalledRef = import_react24.default.useRef(false);
4854
+ const { doc, rangeMap, totalLength } = import_react24.default.useMemo(() => {
4819
4855
  if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
4820
4856
  const decoded = decodeHtmlEntities(html);
4821
4857
  const doc2 = new DOMParser().parseFromString(decoded, "text/html");
4822
4858
  const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
4823
4859
  return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
4824
4860
  }, [html]);
4825
- import_react25.default.useEffect(() => {
4861
+ import_react24.default.useEffect(() => {
4826
4862
  setTypedLen(0);
4827
4863
  doneCalledRef.current = false;
4828
4864
  }, [html]);
4829
- import_react25.default.useEffect(() => {
4865
+ import_react24.default.useEffect(() => {
4830
4866
  if (!totalLength) return;
4831
4867
  if (typedLen >= totalLength) return;
4832
4868
  const timer = window.setInterval(() => {
@@ -4834,18 +4870,18 @@ var HtmlTypeWriter = ({
4834
4870
  }, duration);
4835
4871
  return () => window.clearInterval(timer);
4836
4872
  }, [typedLen, totalLength, duration]);
4837
- import_react25.default.useEffect(() => {
4873
+ import_react24.default.useEffect(() => {
4838
4874
  if (typedLen > 0 && typedLen < totalLength) {
4839
4875
  onChange?.();
4840
4876
  }
4841
4877
  }, [typedLen, totalLength, onChange]);
4842
- import_react25.default.useEffect(() => {
4878
+ import_react24.default.useEffect(() => {
4843
4879
  if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
4844
4880
  doneCalledRef.current = true;
4845
4881
  onDone?.();
4846
4882
  }
4847
4883
  }, [typedLen, totalLength, onDone]);
4848
- const parsed = import_react25.default.useMemo(
4884
+ const parsed = import_react24.default.useMemo(
4849
4885
  () => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
4850
4886
  [doc, typedLen, rangeMap]
4851
4887
  );
@@ -4855,12 +4891,12 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
4855
4891
  var HtmlTypeWriter_default = HtmlTypeWriter;
4856
4892
 
4857
4893
  // src/components/ImageSelector/ImageSelector.tsx
4858
- var import_react26 = __toESM(require("react"), 1);
4894
+ var import_react25 = __toESM(require("react"), 1);
4859
4895
  var import_jsx_runtime327 = require("react/jsx-runtime");
4860
4896
  var ImageSelector = (props) => {
4861
- const { value, label, onChange } = props;
4862
- const [previewUrl, setPreviewUrl] = import_react26.default.useState();
4863
- import_react26.default.useEffect(() => {
4897
+ const { value, label, onChange, validations } = props;
4898
+ const [previewUrl, setPreviewUrl] = import_react25.default.useState();
4899
+ import_react25.default.useEffect(() => {
4864
4900
  if (!value) {
4865
4901
  setPreviewUrl(void 0);
4866
4902
  return;
@@ -4869,7 +4905,7 @@ var ImageSelector = (props) => {
4869
4905
  setPreviewUrl(url);
4870
4906
  return () => URL.revokeObjectURL(url);
4871
4907
  }, [value]);
4872
- const inputRef = import_react26.default.useRef(null);
4908
+ const inputRef = import_react25.default.useRef(null);
4873
4909
  const handleFileChange = (e) => {
4874
4910
  const selectedFile = e.target.files?.[0];
4875
4911
  if (selectedFile) {
@@ -4882,7 +4918,7 @@ var ImageSelector = (props) => {
4882
4918
  const handleOpenFileDialog = () => {
4883
4919
  inputRef.current?.click();
4884
4920
  };
4885
- return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
4921
+ const control = /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
4886
4922
  /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
4887
4923
  "input",
4888
4924
  {
@@ -4890,7 +4926,8 @@ var ImageSelector = (props) => {
4890
4926
  accept: "image/*",
4891
4927
  id: "image-input",
4892
4928
  onChange: handleFileChange,
4893
- ref: inputRef
4929
+ ref: inputRef,
4930
+ "aria-invalid": hasError(validations) || void 0
4894
4931
  }
4895
4932
  ),
4896
4933
  value && /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: "action-bar", children: [
@@ -4902,6 +4939,7 @@ var ImageSelector = (props) => {
4902
4939
  /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
4903
4940
  ] }) })
4904
4941
  ] });
4942
+ return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Field, { validations, children: control });
4905
4943
  };
4906
4944
  ImageSelector.displayName = "ImageSelector";
4907
4945
  var ImageSelector_default = ImageSelector;
@@ -4955,11 +4993,12 @@ var NotificationBadge = (props) => {
4955
4993
  dot = false,
4956
4994
  size = "md"
4957
4995
  } = props;
4996
+ const statusType = normalizeStatus(type);
4958
4997
  const showBadge = dot || count !== void 0 && count > 0;
4959
4998
  const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
4960
4999
  return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
4961
5000
  children,
4962
- showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
5001
+ showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
4963
5002
  ] });
4964
5003
  };
4965
5004
  NotificationBadge.displayName = "NotificationBadge";
@@ -5000,8 +5039,9 @@ var Pagination = (props) => {
5000
5039
  siblingCount = 1,
5001
5040
  onChange,
5002
5041
  size = "md",
5003
- type = "brand"
5042
+ type = "primary"
5004
5043
  } = props;
5044
+ const statusType = normalizeStatus(type);
5005
5045
  const totalPages = Math.max(1, Math.ceil(total / pageSize));
5006
5046
  const pages = getPageRange(current, totalPages, siblingCount);
5007
5047
  const handleClick = (page) => {
@@ -5009,7 +5049,7 @@ var Pagination = (props) => {
5009
5049
  onChange?.(page);
5010
5050
  }
5011
5051
  };
5012
- return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
5052
+ return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
5013
5053
  /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
5014
5054
  "button",
5015
5055
  {
@@ -5048,17 +5088,17 @@ Pagination.displayName = "Pagination";
5048
5088
  var Pagination_default = Pagination;
5049
5089
 
5050
5090
  // src/components/PopOver/PopOver.tsx
5051
- var import_react27 = __toESM(require("react"), 1);
5091
+ var import_react26 = __toESM(require("react"), 1);
5052
5092
  var import_jsx_runtime332 = require("react/jsx-runtime");
5053
5093
  var PopOver = (props) => {
5054
5094
  const { children, isOpen, onClose, PopOverEl } = props;
5055
- const popRef = import_react27.default.useRef(null);
5056
- const triggerRef = import_react27.default.useRef(null);
5057
- const [localOpen, setLocalOpen] = import_react27.default.useState(false);
5058
- const [eventTrigger, setEventTrigger] = import_react27.default.useState(false);
5095
+ const popRef = import_react26.default.useRef(null);
5096
+ const triggerRef = import_react26.default.useRef(null);
5097
+ const [localOpen, setLocalOpen] = import_react26.default.useState(false);
5098
+ const [eventTrigger, setEventTrigger] = import_react26.default.useState(false);
5059
5099
  useClickOutside_default([popRef, triggerRef], onClose, isOpen);
5060
5100
  const position = useAutoPosition_default(triggerRef, popRef, localOpen);
5061
- import_react27.default.useEffect(() => {
5101
+ import_react26.default.useEffect(() => {
5062
5102
  if (isOpen) {
5063
5103
  setLocalOpen(isOpen);
5064
5104
  setTimeout(() => {
@@ -5110,11 +5150,12 @@ var Progress = (props) => {
5110
5150
  value,
5111
5151
  max = 100,
5112
5152
  size = "md",
5113
- type = "brand",
5153
+ type = "primary",
5114
5154
  showLabel = false
5115
5155
  } = props;
5156
+ const statusType = normalizeStatus(type);
5116
5157
  const percentage = Math.min(100, Math.max(0, value / max * 100));
5117
- return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
5158
+ return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
5118
5159
  /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
5119
5160
  "div",
5120
5161
  {
@@ -5142,12 +5183,12 @@ Progress.displayName = "Progress";
5142
5183
  var Progress_default = Progress;
5143
5184
 
5144
5185
  // src/components/Radio/RadioGroupContext.tsx
5145
- var import_react28 = __toESM(require("react"), 1);
5146
- var RadioGroupContext = import_react28.default.createContext(
5186
+ var import_react27 = __toESM(require("react"), 1);
5187
+ var RadioGroupContext = import_react27.default.createContext(
5147
5188
  null
5148
5189
  );
5149
5190
  var useRadioGroupContext = () => {
5150
- return import_react28.default.useContext(RadioGroupContext);
5191
+ return import_react27.default.useContext(RadioGroupContext);
5151
5192
  };
5152
5193
  var RadioGroupContext_default = RadioGroupContext;
5153
5194
 
@@ -5159,9 +5200,11 @@ var Radio = (props) => {
5159
5200
  className,
5160
5201
  value,
5161
5202
  size: sizeProp,
5162
- type = "brand",
5203
+ type = "primary",
5204
+ validations,
5163
5205
  ...rest
5164
5206
  } = props;
5207
+ const statusType = normalizeStatus(type);
5165
5208
  const context = useRadioGroupContext();
5166
5209
  const size = sizeProp ?? context?.size ?? "md";
5167
5210
  const isGroup = !!context;
@@ -5171,18 +5214,27 @@ var Radio = (props) => {
5171
5214
  value,
5172
5215
  onChange: rest.onChange
5173
5216
  };
5174
- return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
5217
+ const control = /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
5175
5218
  "label",
5176
5219
  {
5177
5220
  className: clsx_default(
5178
5221
  "lib-xplat-radio",
5179
5222
  size,
5180
- type,
5223
+ statusType,
5181
5224
  localChecked ? "checked" : void 0,
5182
5225
  className
5183
5226
  ),
5184
5227
  children: [
5185
- /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
5228
+ /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
5229
+ "input",
5230
+ {
5231
+ ...rest,
5232
+ ...inputProps,
5233
+ checked: localChecked,
5234
+ type: "radio",
5235
+ "aria-invalid": hasError(validations) || void 0
5236
+ }
5237
+ ),
5186
5238
  /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
5187
5239
  "div",
5188
5240
  {
@@ -5197,6 +5249,7 @@ var Radio = (props) => {
5197
5249
  ]
5198
5250
  }
5199
5251
  );
5252
+ return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(Field, { validations, children: control });
5200
5253
  };
5201
5254
  Radio.displayName = "Radio";
5202
5255
  var Radio_default = Radio;
@@ -5211,19 +5264,19 @@ RadioGroup.displayName = "RadioGroup";
5211
5264
  var RadioGroup_default = RadioGroup;
5212
5265
 
5213
5266
  // src/components/Select/Select.tsx
5214
- var import_react31 = __toESM(require("react"), 1);
5267
+ var import_react30 = __toESM(require("react"), 1);
5215
5268
 
5216
5269
  // src/components/Select/context.ts
5217
- var import_react29 = __toESM(require("react"), 1);
5218
- var SelectContext = import_react29.default.createContext(null);
5270
+ var import_react28 = __toESM(require("react"), 1);
5271
+ var SelectContext = import_react28.default.createContext(null);
5219
5272
  var context_default = SelectContext;
5220
5273
 
5221
5274
  // src/components/Select/SelectItem.tsx
5222
- var import_react30 = __toESM(require("react"), 1);
5275
+ var import_react29 = __toESM(require("react"), 1);
5223
5276
  var import_jsx_runtime336 = require("react/jsx-runtime");
5224
5277
  var SelectItem = (props) => {
5225
5278
  const { children, value, onClick, disabled = false } = props;
5226
- const ctx = import_react30.default.useContext(context_default);
5279
+ const ctx = import_react29.default.useContext(context_default);
5227
5280
  const handleClick = (e) => {
5228
5281
  e.preventDefault();
5229
5282
  e.stopPropagation();
@@ -5264,30 +5317,31 @@ var SelectRoot = (props) => {
5264
5317
  children,
5265
5318
  disabled = false,
5266
5319
  error = false,
5320
+ validations,
5267
5321
  size = "md"
5268
5322
  } = props;
5269
- const itemChildren = import_react31.default.Children.toArray(children).filter(
5270
- (child) => import_react31.default.isValidElement(child) && child.type === SelectItem_default
5323
+ const itemChildren = import_react30.default.Children.toArray(children).filter(
5324
+ (child) => import_react30.default.isValidElement(child) && child.type === SelectItem_default
5271
5325
  );
5272
5326
  const isControlled = valueProp !== void 0;
5273
- const [isOpen, setOpen] = import_react31.default.useState(false);
5274
- const [uncontrolledLabel, setUncontrolledLabel] = import_react31.default.useState(null);
5275
- const [uncontrolledValue, setUncontrolledValue] = import_react31.default.useState(void 0);
5276
- const controlledLabel = import_react31.default.useMemo(() => {
5327
+ const [isOpen, setOpen] = import_react30.default.useState(false);
5328
+ const [uncontrolledLabel, setUncontrolledLabel] = import_react30.default.useState(null);
5329
+ const [uncontrolledValue, setUncontrolledValue] = import_react30.default.useState(void 0);
5330
+ const controlledLabel = import_react30.default.useMemo(() => {
5277
5331
  if (!isControlled) return null;
5278
5332
  const match = itemChildren.find((child) => child.props.value === valueProp);
5279
5333
  return match ? match.props.children : null;
5280
5334
  }, [isControlled, valueProp, itemChildren]);
5281
5335
  const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
5282
5336
  const selectedValue = isControlled ? valueProp : uncontrolledValue;
5283
- const triggerRef = import_react31.default.useRef(null);
5284
- const contentRef = import_react31.default.useRef(null);
5285
- const [mounted, setMounted] = import_react31.default.useState(false);
5286
- const [visible, setVisible] = import_react31.default.useState(false);
5287
- import_react31.default.useEffect(() => {
5337
+ const triggerRef = import_react30.default.useRef(null);
5338
+ const contentRef = import_react30.default.useRef(null);
5339
+ const [mounted, setMounted] = import_react30.default.useState(false);
5340
+ const [visible, setVisible] = import_react30.default.useState(false);
5341
+ import_react30.default.useEffect(() => {
5288
5342
  if (disabled && isOpen) setOpen(false);
5289
5343
  }, [disabled, isOpen]);
5290
- import_react31.default.useEffect(() => {
5344
+ import_react30.default.useEffect(() => {
5291
5345
  if (isOpen) {
5292
5346
  setMounted(true);
5293
5347
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -5297,12 +5351,12 @@ var SelectRoot = (props) => {
5297
5351
  const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
5298
5352
  return () => clearTimeout(t);
5299
5353
  }, [isOpen]);
5300
- const open = import_react31.default.useCallback(() => setOpen(true), []);
5301
- const close = import_react31.default.useCallback(() => setOpen(false), []);
5302
- const toggle = import_react31.default.useCallback(() => setOpen((prev) => !prev), []);
5354
+ const open = import_react30.default.useCallback(() => setOpen(true), []);
5355
+ const close = import_react30.default.useCallback(() => setOpen(false), []);
5356
+ const toggle = import_react30.default.useCallback(() => setOpen((prev) => !prev), []);
5303
5357
  useClickOutside_default([contentRef, triggerRef], close, isOpen);
5304
5358
  const position = useAutoPosition_default(triggerRef, contentRef, mounted);
5305
- const setSelected = import_react31.default.useCallback(
5359
+ const setSelected = import_react30.default.useCallback(
5306
5360
  (label, itemValue) => {
5307
5361
  if (!isControlled) {
5308
5362
  setUncontrolledLabel(label);
@@ -5312,7 +5366,7 @@ var SelectRoot = (props) => {
5312
5366
  },
5313
5367
  [isControlled, onChange]
5314
5368
  );
5315
- const ctxValue = import_react31.default.useMemo(
5369
+ const ctxValue = import_react30.default.useMemo(
5316
5370
  () => ({
5317
5371
  isOpen,
5318
5372
  mounted,
@@ -5334,14 +5388,14 @@ var SelectRoot = (props) => {
5334
5388
  if (disabled) return;
5335
5389
  toggle();
5336
5390
  };
5337
- return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
5391
+ const control = /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
5338
5392
  "div",
5339
5393
  {
5340
5394
  className: clsx_default(
5341
5395
  "lib-xplat-select",
5342
5396
  size,
5343
5397
  disabled && "disabled",
5344
- error && "error",
5398
+ (error || hasError(validations)) && "error",
5345
5399
  mounted && "is-open"
5346
5400
  ),
5347
5401
  children: [
@@ -5352,14 +5406,14 @@ var SelectRoot = (props) => {
5352
5406
  className: clsx_default(
5353
5407
  "select-trigger",
5354
5408
  disabled && "disabled",
5355
- error && "error"
5409
+ (error || hasError(validations)) && "error"
5356
5410
  ),
5357
5411
  onClick: handleTriggerClick,
5358
5412
  role: "combobox",
5359
5413
  "aria-expanded": isOpen,
5360
5414
  "aria-haspopup": "listbox",
5361
5415
  "aria-disabled": disabled,
5362
- "aria-invalid": error,
5416
+ "aria-invalid": error || hasError(validations) || void 0,
5363
5417
  tabIndex: disabled ? -1 : 0,
5364
5418
  onKeyDown: (e) => {
5365
5419
  if (disabled) return;
@@ -5403,6 +5457,7 @@ var SelectRoot = (props) => {
5403
5457
  ]
5404
5458
  }
5405
5459
  ) });
5460
+ return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(Field, { validations, children: control });
5406
5461
  };
5407
5462
  SelectRoot.displayName = "Select";
5408
5463
  var Select = Object.assign(SelectRoot, {
@@ -5444,12 +5499,13 @@ var import_jsx_runtime339 = require("react/jsx-runtime");
5444
5499
  var Spinner = (props) => {
5445
5500
  const {
5446
5501
  size = "md",
5447
- type = "brand"
5502
+ type = "primary"
5448
5503
  } = props;
5504
+ const statusType = normalizeStatus(type);
5449
5505
  return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
5450
5506
  "div",
5451
5507
  {
5452
- className: clsx_default("lib-xplat-spinner", size, type),
5508
+ className: clsx_default("lib-xplat-spinner", size, statusType),
5453
5509
  role: "status",
5454
5510
  "aria-label": "\uB85C\uB529 \uC911",
5455
5511
  children: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
@@ -5487,9 +5543,10 @@ var Steps = (props) => {
5487
5543
  const {
5488
5544
  items,
5489
5545
  current,
5490
- type = "brand"
5546
+ type = "primary"
5491
5547
  } = props;
5492
- return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
5548
+ const statusType = normalizeStatus(type);
5549
+ return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
5493
5550
  const status = index < current ? "completed" : index === current ? "active" : "pending";
5494
5551
  return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)("div", { className: clsx_default("step-item", status), children: [
5495
5552
  /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("span", { children: index + 1 }) }),
@@ -5504,7 +5561,7 @@ Steps.displayName = "Steps";
5504
5561
  var Steps_default = Steps;
5505
5562
 
5506
5563
  // src/components/Swiper/Swiper.tsx
5507
- var import_react32 = __toESM(require("react"), 1);
5564
+ var import_react31 = __toESM(require("react"), 1);
5508
5565
  var import_jsx_runtime341 = require("react/jsx-runtime");
5509
5566
  var Swiper = (props) => {
5510
5567
  const {
@@ -5529,26 +5586,26 @@ var Swiper = (props) => {
5529
5586
  const maxIndex = Math.max(0, totalSlides - viewItemCount);
5530
5587
  const useLoop = loop && canSlide;
5531
5588
  const cloneCount = useLoop ? totalSlides : 0;
5532
- const extendedItems = import_react32.default.useMemo(() => {
5589
+ const extendedItems = import_react31.default.useMemo(() => {
5533
5590
  if (!useLoop) return items;
5534
5591
  return [...items, ...items, ...items];
5535
5592
  }, [items, useLoop]);
5536
5593
  const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
5537
- const [innerIndex, setInnerIndex] = import_react32.default.useState(
5594
+ const [innerIndex, setInnerIndex] = import_react31.default.useState(
5538
5595
  useLoop ? cloneCount + initialIdx : initialIdx
5539
5596
  );
5540
- const [isDragging, setIsDragging] = import_react32.default.useState(false);
5541
- const [dragOffset, setDragOffset] = import_react32.default.useState(0);
5542
- const [animated, setAnimated] = import_react32.default.useState(false);
5543
- const [containerWidth, setContainerWidth] = import_react32.default.useState(0);
5544
- const containerRef = import_react32.default.useRef(null);
5545
- const startXRef = import_react32.default.useRef(0);
5546
- const startTimeRef = import_react32.default.useRef(0);
5547
- const autoplayTimerRef = import_react32.default.useRef(null);
5548
- const resumeTimeoutRef = import_react32.default.useRef(null);
5549
- const [paused, setPaused] = import_react32.default.useState(false);
5550
- const initializedRef = import_react32.default.useRef(false);
5551
- import_react32.default.useEffect(() => {
5597
+ const [isDragging, setIsDragging] = import_react31.default.useState(false);
5598
+ const [dragOffset, setDragOffset] = import_react31.default.useState(0);
5599
+ const [animated, setAnimated] = import_react31.default.useState(false);
5600
+ const [containerWidth, setContainerWidth] = import_react31.default.useState(0);
5601
+ const containerRef = import_react31.default.useRef(null);
5602
+ const startXRef = import_react31.default.useRef(0);
5603
+ const startTimeRef = import_react31.default.useRef(0);
5604
+ const autoplayTimerRef = import_react31.default.useRef(null);
5605
+ const resumeTimeoutRef = import_react31.default.useRef(null);
5606
+ const [paused, setPaused] = import_react31.default.useState(false);
5607
+ const initializedRef = import_react31.default.useRef(false);
5608
+ import_react31.default.useEffect(() => {
5552
5609
  const el = containerRef.current;
5553
5610
  if (!el) return;
5554
5611
  const ro = new ResizeObserver((entries) => {
@@ -5571,7 +5628,7 @@ var Swiper = (props) => {
5571
5628
  return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
5572
5629
  };
5573
5630
  const realIndex = getRealIndex(innerIndex);
5574
- const moveToInner = import_react32.default.useCallback(
5631
+ const moveToInner = import_react31.default.useCallback(
5575
5632
  (idx, withAnim = true) => {
5576
5633
  if (!useLoop) {
5577
5634
  setAnimated(withAnim);
@@ -5599,7 +5656,7 @@ var Swiper = (props) => {
5599
5656
  },
5600
5657
  [useLoop, cloneCount, totalSlides]
5601
5658
  );
5602
- const handleTransitionEnd = import_react32.default.useCallback(() => {
5659
+ const handleTransitionEnd = import_react31.default.useCallback(() => {
5603
5660
  if (!useLoop) return;
5604
5661
  const real = getRealIndex(innerIndex);
5605
5662
  const canonical = cloneCount + real;
@@ -5609,7 +5666,7 @@ var Swiper = (props) => {
5609
5666
  }
5610
5667
  onChange?.(Math.min(real, maxIndex));
5611
5668
  }, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
5612
- const slideTo = import_react32.default.useCallback(
5669
+ const slideTo = import_react31.default.useCallback(
5613
5670
  (logicalIndex) => {
5614
5671
  if (!canSlide) return;
5615
5672
  const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
@@ -5619,7 +5676,7 @@ var Swiper = (props) => {
5619
5676
  },
5620
5677
  [canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
5621
5678
  );
5622
- const slideNext = import_react32.default.useCallback(() => {
5679
+ const slideNext = import_react31.default.useCallback(() => {
5623
5680
  if (!canSlide) return;
5624
5681
  const nextInner = innerIndex + slideBy;
5625
5682
  if (useLoop) {
@@ -5628,7 +5685,7 @@ var Swiper = (props) => {
5628
5685
  moveToInner(Math.min(nextInner, maxIndex), true);
5629
5686
  }
5630
5687
  }, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
5631
- const slidePrev = import_react32.default.useCallback(() => {
5688
+ const slidePrev = import_react31.default.useCallback(() => {
5632
5689
  if (!canSlide) return;
5633
5690
  const prevInner = innerIndex - slideBy;
5634
5691
  if (useLoop) {
@@ -5637,7 +5694,7 @@ var Swiper = (props) => {
5637
5694
  moveToInner(Math.max(prevInner, 0), true);
5638
5695
  }
5639
5696
  }, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
5640
- import_react32.default.useEffect(() => {
5697
+ import_react31.default.useEffect(() => {
5641
5698
  if (indexProp === void 0) return;
5642
5699
  const clamped = Math.max(0, Math.min(indexProp, maxIndex));
5643
5700
  const target = useLoop ? cloneCount + clamped : clamped;
@@ -5645,12 +5702,12 @@ var Swiper = (props) => {
5645
5702
  moveToInner(target, true);
5646
5703
  }
5647
5704
  }, [indexProp]);
5648
- import_react32.default.useImperativeHandle(swiperRef, () => ({
5705
+ import_react31.default.useImperativeHandle(swiperRef, () => ({
5649
5706
  slidePrev,
5650
5707
  slideNext,
5651
5708
  slideTo
5652
5709
  }));
5653
- import_react32.default.useEffect(() => {
5710
+ import_react31.default.useEffect(() => {
5654
5711
  if (!auto || !canSlide || paused) return;
5655
5712
  autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
5656
5713
  return () => {
@@ -5676,7 +5733,7 @@ var Swiper = (props) => {
5676
5733
  resumeTimeoutRef.current = null;
5677
5734
  }, pauseOnInteraction);
5678
5735
  };
5679
- import_react32.default.useEffect(() => {
5736
+ import_react31.default.useEffect(() => {
5680
5737
  return () => {
5681
5738
  if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
5682
5739
  };
@@ -5694,7 +5751,7 @@ var Swiper = (props) => {
5694
5751
  startXRef.current = getClientX(e);
5695
5752
  startTimeRef.current = Date.now();
5696
5753
  };
5697
- import_react32.default.useEffect(() => {
5754
+ import_react31.default.useEffect(() => {
5698
5755
  if (!isDragging) return;
5699
5756
  const handleMove = (e) => {
5700
5757
  setDragOffset(getClientX(e) - startXRef.current);
@@ -5733,7 +5790,7 @@ var Swiper = (props) => {
5733
5790
  }, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
5734
5791
  const slideWidthPercent = 100 / viewItemCount;
5735
5792
  const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
5736
- const slideElements = import_react32.default.useMemo(
5793
+ const slideElements = import_react31.default.useMemo(
5737
5794
  () => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
5738
5795
  "div",
5739
5796
  {
@@ -5807,20 +5864,22 @@ Swiper.displayName = "Swiper";
5807
5864
  var Swiper_default = Swiper;
5808
5865
 
5809
5866
  // src/components/Switch/Switch.tsx
5810
- var import_react33 = __toESM(require("react"), 1);
5867
+ var import_react32 = __toESM(require("react"), 1);
5811
5868
  var import_jsx_runtime342 = require("react/jsx-runtime");
5812
5869
  var KNOB_TRANSITION_MS = 250;
5813
5870
  var Switch = (props) => {
5814
5871
  const {
5815
5872
  value,
5816
5873
  size = "md",
5817
- type = "brand",
5874
+ type = "primary",
5818
5875
  disabled,
5819
- onChange
5876
+ onChange,
5877
+ validations
5820
5878
  } = props;
5821
- const [isAnimating, setIsAnimating] = import_react33.default.useState(false);
5822
- const timeoutRef = import_react33.default.useRef(null);
5823
- import_react33.default.useEffect(() => {
5879
+ const statusType = normalizeStatus(type);
5880
+ const [isAnimating, setIsAnimating] = import_react32.default.useState(false);
5881
+ const timeoutRef = import_react32.default.useRef(null);
5882
+ import_react32.default.useEffect(() => {
5824
5883
  return () => {
5825
5884
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5826
5885
  };
@@ -5835,31 +5894,33 @@ var Switch = (props) => {
5835
5894
  timeoutRef.current = null;
5836
5895
  }, KNOB_TRANSITION_MS);
5837
5896
  };
5838
- return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
5897
+ const control = /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
5839
5898
  "div",
5840
5899
  {
5841
5900
  className: clsx_default(
5842
5901
  "lib-xplat-switch",
5843
5902
  size,
5844
- type,
5903
+ statusType,
5845
5904
  value ? "checked" : void 0,
5846
5905
  disabled && "disabled",
5847
5906
  isAnimating && "animating"
5848
5907
  ),
5849
5908
  onClick: handleClick,
5909
+ "aria-invalid": hasError(validations) || void 0,
5850
5910
  "aria-disabled": disabled || isAnimating,
5851
5911
  children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
5852
5912
  }
5853
5913
  );
5914
+ return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(Field, { validations, children: control });
5854
5915
  };
5855
5916
  Switch.displayName = "Switch";
5856
5917
  var Switch_default = Switch;
5857
5918
 
5858
5919
  // src/components/Table/TableContext.tsx
5859
- var import_react34 = __toESM(require("react"), 1);
5860
- var TableContext = import_react34.default.createContext(null);
5920
+ var import_react33 = __toESM(require("react"), 1);
5921
+ var TableContext = import_react33.default.createContext(null);
5861
5922
  var useTableContext = () => {
5862
- const ctx = import_react34.default.useContext(TableContext);
5923
+ const ctx = import_react33.default.useContext(TableContext);
5863
5924
  if (!ctx) throw new Error("Table components must be used inside <Table>");
5864
5925
  return ctx;
5865
5926
  };
@@ -5902,24 +5963,24 @@ TableBody.displayName = "TableBody";
5902
5963
  var TableBody_default = TableBody;
5903
5964
 
5904
5965
  // src/components/Table/TableCell.tsx
5905
- var import_react37 = __toESM(require("react"), 1);
5966
+ var import_react36 = __toESM(require("react"), 1);
5906
5967
 
5907
5968
  // src/components/Table/TableHeadContext.tsx
5908
- var import_react35 = __toESM(require("react"), 1);
5909
- var TableHeadContext = import_react35.default.createContext(
5969
+ var import_react34 = __toESM(require("react"), 1);
5970
+ var TableHeadContext = import_react34.default.createContext(
5910
5971
  null
5911
5972
  );
5912
5973
  var useTableHeadContext = () => {
5913
- const ctx = import_react35.default.useContext(TableHeadContext);
5974
+ const ctx = import_react34.default.useContext(TableHeadContext);
5914
5975
  return ctx;
5915
5976
  };
5916
5977
  var TableHeadContext_default = TableHeadContext;
5917
5978
 
5918
5979
  // src/components/Table/TableRowContext.tsx
5919
- var import_react36 = __toESM(require("react"), 1);
5920
- var TableRowContext = import_react36.default.createContext(null);
5980
+ var import_react35 = __toESM(require("react"), 1);
5981
+ var TableRowContext = import_react35.default.createContext(null);
5921
5982
  var useTableRowContext = () => {
5922
- const ctx = import_react36.default.useContext(TableRowContext);
5983
+ const ctx = import_react35.default.useContext(TableRowContext);
5923
5984
  if (!ctx) throw new Error("Table components must be used inside <Table>");
5924
5985
  return ctx;
5925
5986
  };
@@ -5927,7 +5988,7 @@ var TableRowContext_default = TableRowContext;
5927
5988
 
5928
5989
  // src/components/Table/TableCell.tsx
5929
5990
  var import_jsx_runtime345 = require("react/jsx-runtime");
5930
- var TableCell = import_react37.default.memo((props) => {
5991
+ var TableCell = import_react36.default.memo((props) => {
5931
5992
  const {
5932
5993
  children,
5933
5994
  align = "center",
@@ -5941,9 +6002,9 @@ var TableCell = import_react37.default.memo((props) => {
5941
6002
  const { registerStickyCell, stickyCells } = useTableRowContext();
5942
6003
  const { stickyShadow } = useTableContext();
5943
6004
  const headContext = useTableHeadContext();
5944
- const [left, setLeft] = import_react37.default.useState(0);
5945
- const cellRef = import_react37.default.useRef(null);
5946
- const calculateLeft = import_react37.default.useCallback(() => {
6005
+ const [left, setLeft] = import_react36.default.useState(0);
6006
+ const cellRef = import_react36.default.useRef(null);
6007
+ const calculateLeft = import_react36.default.useCallback(() => {
5947
6008
  if (!cellRef.current) return 0;
5948
6009
  let totalLeft = 0;
5949
6010
  for (const ref of stickyCells) {
@@ -5952,7 +6013,7 @@ var TableCell = import_react37.default.memo((props) => {
5952
6013
  }
5953
6014
  return totalLeft;
5954
6015
  }, [stickyCells]);
5955
- import_react37.default.useEffect(() => {
6016
+ import_react36.default.useEffect(() => {
5956
6017
  if (!isSticky || !cellRef.current) return;
5957
6018
  registerStickyCell(cellRef);
5958
6019
  setLeft(calculateLeft());
@@ -6010,9 +6071,9 @@ TableHead.displayName = "TableHead";
6010
6071
  var TableHead_default = TableHead;
6011
6072
 
6012
6073
  // src/components/Table/TableRow.tsx
6013
- var import_react38 = __toESM(require("react"), 1);
6074
+ var import_react37 = __toESM(require("react"), 1);
6014
6075
  var import_jsx_runtime347 = require("react/jsx-runtime");
6015
- var TableRow = import_react38.default.memo((props) => {
6076
+ var TableRow = import_react37.default.memo((props) => {
6016
6077
  const {
6017
6078
  children,
6018
6079
  type = "secondary",
@@ -6021,7 +6082,7 @@ var TableRow = import_react38.default.memo((props) => {
6021
6082
  onClick
6022
6083
  } = props;
6023
6084
  const { rowBorderUse } = useTableContext();
6024
- const [stickyCells, setStickyCells] = import_react38.default.useState([]);
6085
+ const [stickyCells, setStickyCells] = import_react37.default.useState([]);
6025
6086
  const registerStickyCell = (ref) => {
6026
6087
  setStickyCells((prev) => {
6027
6088
  if (prev.includes(ref)) return prev;
@@ -6056,20 +6117,22 @@ var import_jsx_runtime348 = require("react/jsx-runtime");
6056
6117
  var Tag = (props) => {
6057
6118
  const {
6058
6119
  children,
6059
- type = "neutral",
6120
+ variant,
6121
+ type,
6060
6122
  onClose,
6061
6123
  size = "md",
6062
6124
  disabled = false,
6063
6125
  colorIndex
6064
6126
  } = props;
6127
+ const shape = variant ?? type ?? "neutral";
6065
6128
  return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
6066
6129
  "span",
6067
6130
  {
6068
6131
  className: clsx_default(
6069
6132
  "lib-xplat-tag",
6070
- type,
6133
+ shape,
6071
6134
  size,
6072
- type === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
6135
+ shape === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
6073
6136
  disabled && "disabled"
6074
6137
  ),
6075
6138
  children: [
@@ -6083,49 +6146,52 @@ Tag.displayName = "Tag";
6083
6146
  var Tag_default = Tag;
6084
6147
 
6085
6148
  // src/components/TextArea/TextArea.tsx
6086
- var import_react39 = __toESM(require("react"), 1);
6149
+ var import_react38 = __toESM(require("react"), 1);
6087
6150
  var import_jsx_runtime349 = require("react/jsx-runtime");
6088
- var TextArea = import_react39.default.forwardRef(
6151
+ var TextArea = import_react38.default.forwardRef(
6089
6152
  (props, ref) => {
6090
6153
  const {
6091
6154
  className,
6092
6155
  size = "md",
6156
+ validations,
6093
6157
  resize = "vertical",
6094
6158
  rows = 3,
6095
6159
  disabled,
6096
6160
  ...textareaProps
6097
6161
  } = props;
6098
- return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(
6162
+ const control = /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(
6099
6163
  "textarea",
6100
6164
  {
6101
6165
  ...textareaProps,
6102
6166
  ref,
6103
6167
  rows,
6104
6168
  disabled,
6169
+ "aria-invalid": hasError(validations) || void 0,
6105
6170
  className: clsx_default("lib-xplat-textarea", size, disabled && "disabled"),
6106
6171
  style: { resize }
6107
6172
  }
6108
6173
  ) });
6174
+ return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(Field, { validations, children: control });
6109
6175
  }
6110
6176
  );
6111
6177
  TextArea.displayName = "TextArea";
6112
6178
  var TextArea_default = TextArea;
6113
6179
 
6114
6180
  // src/components/Toast/Toast.tsx
6115
- var import_react40 = __toESM(require("react"), 1);
6181
+ var import_react39 = __toESM(require("react"), 1);
6116
6182
  var import_react_dom4 = require("react-dom");
6117
6183
  var import_jsx_runtime350 = require("react/jsx-runtime");
6118
- var ToastContext = import_react40.default.createContext(null);
6184
+ var ToastContext = import_react39.default.createContext(null);
6119
6185
  var useToast = () => {
6120
- const ctx = import_react40.default.useContext(ToastContext);
6186
+ const ctx = import_react39.default.useContext(ToastContext);
6121
6187
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
6122
6188
  return ctx;
6123
6189
  };
6124
6190
  var EXIT_DURATION = 300;
6125
6191
  var ToastItemComponent = ({ item, isExiting, onClose }) => {
6126
- const ref = import_react40.default.useRef(null);
6127
- const [height, setHeight] = import_react40.default.useState(void 0);
6128
- import_react40.default.useEffect(() => {
6192
+ const ref = import_react39.default.useRef(null);
6193
+ const [height, setHeight] = import_react39.default.useState(void 0);
6194
+ import_react39.default.useEffect(() => {
6129
6195
  if (ref.current && !isExiting) {
6130
6196
  setHeight(ref.current.offsetHeight);
6131
6197
  }
@@ -6157,13 +6223,13 @@ var ToastProvider = ({
6157
6223
  children,
6158
6224
  position = "top-right"
6159
6225
  }) => {
6160
- const [toasts, setToasts] = import_react40.default.useState([]);
6161
- const [removing, setRemoving] = import_react40.default.useState(/* @__PURE__ */ new Set());
6162
- const [mounted, setMounted] = import_react40.default.useState(false);
6163
- import_react40.default.useEffect(() => {
6226
+ const [toasts, setToasts] = import_react39.default.useState([]);
6227
+ const [removing, setRemoving] = import_react39.default.useState(/* @__PURE__ */ new Set());
6228
+ const [mounted, setMounted] = import_react39.default.useState(false);
6229
+ import_react39.default.useEffect(() => {
6164
6230
  setMounted(true);
6165
6231
  }, []);
6166
- const remove = import_react40.default.useCallback((id) => {
6232
+ const remove = import_react39.default.useCallback((id) => {
6167
6233
  setRemoving((prev) => new Set(prev).add(id));
6168
6234
  setTimeout(() => {
6169
6235
  setToasts((prev) => prev.filter((t) => t.id !== id));
@@ -6174,7 +6240,7 @@ var ToastProvider = ({
6174
6240
  });
6175
6241
  }, EXIT_DURATION);
6176
6242
  }, []);
6177
- const toast = import_react40.default.useCallback(
6243
+ const toast = import_react39.default.useCallback(
6178
6244
  (type, message, duration = 3e3) => {
6179
6245
  const id = `${Date.now()}-${Math.random()}`;
6180
6246
  setToasts((prev) => [...prev, { id, type, message }]);
@@ -6203,7 +6269,7 @@ var ToastProvider = ({
6203
6269
  ToastProvider.displayName = "ToastProvider";
6204
6270
 
6205
6271
  // src/components/Tooltip/Tooltip.tsx
6206
- var import_react41 = __toESM(require("react"), 1);
6272
+ var import_react40 = __toESM(require("react"), 1);
6207
6273
  var import_jsx_runtime351 = require("react/jsx-runtime");
6208
6274
  var OFFSET = 12;
6209
6275
  var GAP = 8;
@@ -6213,18 +6279,20 @@ var Tooltip = (props) => {
6213
6279
  children,
6214
6280
  title,
6215
6281
  description,
6216
- type = "dark",
6282
+ variant,
6283
+ type,
6217
6284
  follow = false,
6218
6285
  disabled = false
6219
6286
  } = props;
6220
- const triggerRef = import_react41.default.useRef(null);
6221
- const tooltipRef = import_react41.default.useRef(null);
6222
- const [visible, setVisible] = import_react41.default.useState(false);
6223
- const [pos, setPos] = import_react41.default.useState({ left: 0, top: 0 });
6224
- const delayTimer = import_react41.default.useRef(0);
6225
- const rafRef = import_react41.default.useRef(0);
6226
- const cursor = import_react41.default.useRef(null);
6227
- const clamp = import_react41.default.useCallback((left, top, w, h) => {
6287
+ const shape = variant ?? type ?? "dark";
6288
+ const triggerRef = import_react40.default.useRef(null);
6289
+ const tooltipRef = import_react40.default.useRef(null);
6290
+ const [visible, setVisible] = import_react40.default.useState(false);
6291
+ const [pos, setPos] = import_react40.default.useState({ left: 0, top: 0 });
6292
+ const delayTimer = import_react40.default.useRef(0);
6293
+ const rafRef = import_react40.default.useRef(0);
6294
+ const cursor = import_react40.default.useRef(null);
6295
+ const clamp = import_react40.default.useCallback((left, top, w, h) => {
6228
6296
  const vw = window.innerWidth;
6229
6297
  const vh = window.innerHeight;
6230
6298
  return {
@@ -6232,7 +6300,7 @@ var Tooltip = (props) => {
6232
6300
  top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
6233
6301
  };
6234
6302
  }, []);
6235
- const placeAtCursor = import_react41.default.useCallback((x, y) => {
6303
+ const placeAtCursor = import_react40.default.useCallback((x, y) => {
6236
6304
  const el = tooltipRef.current;
6237
6305
  if (!el) return;
6238
6306
  const w = el.offsetWidth;
@@ -6243,7 +6311,7 @@ var Tooltip = (props) => {
6243
6311
  if (top < GAP) top = y + OFFSET;
6244
6312
  setPos(clamp(left, top, w, h));
6245
6313
  }, [clamp]);
6246
- const placeAtTrigger = import_react41.default.useCallback(() => {
6314
+ const placeAtTrigger = import_react40.default.useCallback(() => {
6247
6315
  const el = tooltipRef.current;
6248
6316
  const trigger = triggerRef.current;
6249
6317
  if (!el || !trigger) return;
@@ -6255,19 +6323,19 @@ var Tooltip = (props) => {
6255
6323
  const left = rect.left + rect.width / 2 - w / 2;
6256
6324
  setPos(clamp(left, top, w, h));
6257
6325
  }, [clamp]);
6258
- const reposition = import_react41.default.useCallback(() => {
6326
+ const reposition = import_react40.default.useCallback(() => {
6259
6327
  if (follow && cursor.current) {
6260
6328
  placeAtCursor(cursor.current.x, cursor.current.y);
6261
6329
  } else {
6262
6330
  placeAtTrigger();
6263
6331
  }
6264
6332
  }, [follow, placeAtCursor, placeAtTrigger]);
6265
- const handleMouseEnter = import_react41.default.useCallback((e) => {
6333
+ const handleMouseEnter = import_react40.default.useCallback((e) => {
6266
6334
  if (disabled) return;
6267
6335
  cursor.current = { x: e.clientX, y: e.clientY };
6268
6336
  delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
6269
6337
  }, [disabled]);
6270
- const handleMouseMove = import_react41.default.useCallback((e) => {
6338
+ const handleMouseMove = import_react40.default.useCallback((e) => {
6271
6339
  cursor.current = { x: e.clientX, y: e.clientY };
6272
6340
  if (!visible || !follow) return;
6273
6341
  cancelAnimationFrame(rafRef.current);
@@ -6275,25 +6343,25 @@ var Tooltip = (props) => {
6275
6343
  if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
6276
6344
  });
6277
6345
  }, [visible, follow, placeAtCursor]);
6278
- const close = import_react41.default.useCallback(() => {
6346
+ const close = import_react40.default.useCallback(() => {
6279
6347
  window.clearTimeout(delayTimer.current);
6280
6348
  cancelAnimationFrame(rafRef.current);
6281
6349
  setVisible(false);
6282
6350
  }, []);
6283
- const handleMouseLeave = import_react41.default.useCallback(() => {
6351
+ const handleMouseLeave = import_react40.default.useCallback(() => {
6284
6352
  cursor.current = null;
6285
6353
  close();
6286
6354
  }, [close]);
6287
- const handleFocus = import_react41.default.useCallback(() => {
6355
+ const handleFocus = import_react40.default.useCallback(() => {
6288
6356
  if (disabled) return;
6289
6357
  cursor.current = null;
6290
6358
  setVisible(true);
6291
6359
  }, [disabled]);
6292
- import_react41.default.useLayoutEffect(() => {
6360
+ import_react40.default.useLayoutEffect(() => {
6293
6361
  if (!visible) return;
6294
6362
  reposition();
6295
6363
  }, [visible, reposition]);
6296
- import_react41.default.useEffect(() => {
6364
+ import_react40.default.useEffect(() => {
6297
6365
  if (!visible || follow) return;
6298
6366
  const onChange = () => placeAtTrigger();
6299
6367
  window.addEventListener("scroll", onChange, true);
@@ -6303,7 +6371,7 @@ var Tooltip = (props) => {
6303
6371
  window.removeEventListener("resize", onChange);
6304
6372
  };
6305
6373
  }, [visible, follow, placeAtTrigger]);
6306
- import_react41.default.useEffect(() => () => {
6374
+ import_react40.default.useEffect(() => () => {
6307
6375
  window.clearTimeout(delayTimer.current);
6308
6376
  cancelAnimationFrame(rafRef.current);
6309
6377
  }, []);
@@ -6326,7 +6394,7 @@ var Tooltip = (props) => {
6326
6394
  {
6327
6395
  ref: tooltipRef,
6328
6396
  role: "tooltip",
6329
- className: clsx_default("lib-xplat-tooltip", type),
6397
+ className: clsx_default("lib-xplat-tooltip", shape),
6330
6398
  style: { position: "fixed", left: pos.left, top: pos.top },
6331
6399
  children: [
6332
6400
  title && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { className: "tooltip-title", children: title }),
@@ -6342,7 +6410,7 @@ Tooltip.displayName = "Tooltip";
6342
6410
  var Tooltip_default = Tooltip;
6343
6411
 
6344
6412
  // src/components/Video/Video.tsx
6345
- var import_react42 = __toESM(require("react"), 1);
6413
+ var import_react41 = __toESM(require("react"), 1);
6346
6414
  var import_jsx_runtime352 = require("react/jsx-runtime");
6347
6415
  var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
6348
6416
  /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
@@ -6354,7 +6422,7 @@ var formatTime = (sec) => {
6354
6422
  const s = Math.floor(sec % 60);
6355
6423
  return `${m}:${s.toString().padStart(2, "0")}`;
6356
6424
  };
6357
- var Video = import_react42.default.forwardRef((props, ref) => {
6425
+ var Video = import_react41.default.forwardRef((props, ref) => {
6358
6426
  const {
6359
6427
  src,
6360
6428
  poster,
@@ -6378,21 +6446,21 @@ var Video = import_react42.default.forwardRef((props, ref) => {
6378
6446
  children,
6379
6447
  ...rest
6380
6448
  } = props;
6381
- const containerRef = import_react42.default.useRef(null);
6382
- const videoRef = import_react42.default.useRef(null);
6383
- const [isPlaying, setIsPlaying] = import_react42.default.useState(Boolean(autoPlay));
6384
- const [isLoaded, setIsLoaded] = import_react42.default.useState(false);
6385
- const [currentTime, setCurrentTime] = import_react42.default.useState(0);
6386
- const [duration, setDuration] = import_react42.default.useState(0);
6387
- const [buffered, setBuffered] = import_react42.default.useState(0);
6388
- const [volume, setVolume] = import_react42.default.useState(1);
6389
- const [isMuted, setIsMuted] = import_react42.default.useState(Boolean(muted));
6390
- const [isFullscreen, setIsFullscreen] = import_react42.default.useState(false);
6391
- const [playbackRate, setPlaybackRate] = import_react42.default.useState(1);
6392
- const [rateMenuOpen, setRateMenuOpen] = import_react42.default.useState(false);
6393
- const [captionsOn, setCaptionsOn] = import_react42.default.useState(false);
6394
- const [isPip, setIsPip] = import_react42.default.useState(false);
6395
- const setRefs = import_react42.default.useCallback(
6449
+ const containerRef = import_react41.default.useRef(null);
6450
+ const videoRef = import_react41.default.useRef(null);
6451
+ const [isPlaying, setIsPlaying] = import_react41.default.useState(Boolean(autoPlay));
6452
+ const [isLoaded, setIsLoaded] = import_react41.default.useState(false);
6453
+ const [currentTime, setCurrentTime] = import_react41.default.useState(0);
6454
+ const [duration, setDuration] = import_react41.default.useState(0);
6455
+ const [buffered, setBuffered] = import_react41.default.useState(0);
6456
+ const [volume, setVolume] = import_react41.default.useState(1);
6457
+ const [isMuted, setIsMuted] = import_react41.default.useState(Boolean(muted));
6458
+ const [isFullscreen, setIsFullscreen] = import_react41.default.useState(false);
6459
+ const [playbackRate, setPlaybackRate] = import_react41.default.useState(1);
6460
+ const [rateMenuOpen, setRateMenuOpen] = import_react41.default.useState(false);
6461
+ const [captionsOn, setCaptionsOn] = import_react41.default.useState(false);
6462
+ const [isPip, setIsPip] = import_react41.default.useState(false);
6463
+ const setRefs = import_react41.default.useCallback(
6396
6464
  (el) => {
6397
6465
  videoRef.current = el;
6398
6466
  if (typeof ref === "function") ref(el);
@@ -6400,14 +6468,14 @@ var Video = import_react42.default.forwardRef((props, ref) => {
6400
6468
  },
6401
6469
  [ref]
6402
6470
  );
6403
- import_react42.default.useEffect(() => {
6471
+ import_react41.default.useEffect(() => {
6404
6472
  const onFsChange = () => {
6405
6473
  setIsFullscreen(document.fullscreenElement === containerRef.current);
6406
6474
  };
6407
6475
  document.addEventListener("fullscreenchange", onFsChange);
6408
6476
  return () => document.removeEventListener("fullscreenchange", onFsChange);
6409
6477
  }, []);
6410
- import_react42.default.useEffect(() => {
6478
+ import_react41.default.useEffect(() => {
6411
6479
  const v = videoRef.current;
6412
6480
  if (!v) return;
6413
6481
  const onEnter = () => setIsPip(true);
@@ -6723,6 +6791,8 @@ var Video_default = Video;
6723
6791
  Dropdown,
6724
6792
  Editor,
6725
6793
  EmptyState,
6794
+ Field,
6795
+ FieldMessage,
6726
6796
  FileUpload,
6727
6797
  HtmlTypeWriter,
6728
6798
  HtmlTypewriter,
@@ -6761,6 +6831,7 @@ var Video_default = Video;
6761
6831
  ToastProvider,
6762
6832
  Tooltip,
6763
6833
  Video,
6834
+ hasError,
6764
6835
  isInRange,
6765
6836
  isSameDay,
6766
6837
  useCalendar,