@expcat/tigercat-react 0.1.8 → 0.2.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 (169) hide show
  1. package/dist/{chunk-TBIEWDY5.js → chunk-36RRHNZD.js} +13 -2
  2. package/dist/chunk-3CDAG4HD.mjs +151 -0
  3. package/dist/chunk-3QFHVAZT.js +68 -0
  4. package/dist/{chunk-ALP3KYYY.mjs → chunk-3XKBDV2Q.mjs} +5 -5
  5. package/dist/chunk-42UKIFFQ.js +278 -0
  6. package/dist/{chunk-K7ZMB2TH.mjs → chunk-5XKYWZZZ.mjs} +16 -22
  7. package/dist/chunk-677VSTPW.mjs +65 -0
  8. package/dist/chunk-6DYS4PJT.mjs +99 -0
  9. package/dist/chunk-6PBNFLM7.js +95 -0
  10. package/dist/{chunk-DCRVIDMY.mjs → chunk-6ZC7H22S.mjs} +1 -1
  11. package/dist/{chunk-WSCSDSV7.mjs → chunk-7IKJBQQV.mjs} +27 -5
  12. package/dist/{chunk-OTRGVENC.js → chunk-7SLNHUGJ.js} +1 -1
  13. package/dist/chunk-A2UW5OKX.mjs +415 -0
  14. package/dist/{chunk-NOOPXNR4.mjs → chunk-AGUPZEUL.mjs} +2 -3
  15. package/dist/chunk-AX5XRD2Q.js +35 -0
  16. package/dist/{chunk-BJU5N7WU.mjs → chunk-BAPR7UUR.mjs} +7 -7
  17. package/dist/chunk-CBALIFPW.mjs +275 -0
  18. package/dist/{chunk-BIWO5KB4.mjs → chunk-CJJ56NVL.mjs} +2 -2
  19. package/dist/{chunk-ENR3RIMM.js → chunk-DGBYGBLR.js} +72 -59
  20. package/dist/chunk-DUWAV47E.js +42 -0
  21. package/dist/chunk-E5GD3H7L.js +94 -0
  22. package/dist/chunk-EJLJYOO7.js +367 -0
  23. package/dist/{chunk-FQ6UHRAO.js → chunk-GQMYCYZ4.js} +6 -27
  24. package/dist/{chunk-G6FSHN2I.mjs → chunk-GW4EWT2K.mjs} +45 -31
  25. package/dist/{chunk-AQQRWISY.js → chunk-GXTBCX3M.js} +1 -1
  26. package/dist/{chunk-HQXZVTP4.mjs → chunk-HGF2EL25.mjs} +74 -61
  27. package/dist/{chunk-R5BQHZWB.js → chunk-HRYBEBZC.js} +15 -21
  28. package/dist/{chunk-PAD2DX5M.mjs → chunk-IIVRVCCP.mjs} +6 -24
  29. package/dist/chunk-IS467WAO.mjs +39 -0
  30. package/dist/{chunk-CTAMMQBC.mjs → chunk-IS7YOBR7.mjs} +16 -13
  31. package/dist/{chunk-ADOPAXPG.mjs → chunk-JI7SFMUT.mjs} +2 -2
  32. package/dist/chunk-KBGURVTD.mjs +282 -0
  33. package/dist/{chunk-O3EUFIOS.mjs → chunk-KELLYJZY.mjs} +36 -30
  34. package/dist/{chunk-XZDJ5FRB.js → chunk-KPZTGRNA.js} +5 -23
  35. package/dist/chunk-KQZ4F7FZ.js +153 -0
  36. package/dist/{chunk-XDKXL2BP.mjs → chunk-KV4LLPAY.mjs} +14 -3
  37. package/dist/{chunk-LNKI6HQ3.js → chunk-LIJLFLYE.js} +27 -5
  38. package/dist/chunk-LVC43YX2.mjs +72 -0
  39. package/dist/chunk-LZNG2HGC.mjs +227 -0
  40. package/dist/chunk-M375I56K.js +75 -0
  41. package/dist/{chunk-7OLWGHUR.mjs → chunk-MF3H7WWW.mjs} +13 -2
  42. package/dist/chunk-N32MAX4A.js +230 -0
  43. package/dist/{chunk-YYKJ63LD.mjs → chunk-NMDNLB3C.mjs} +7 -28
  44. package/dist/{chunk-77D7VQMG.js → chunk-OD2NNQD2.js} +2 -2
  45. package/dist/chunk-OONM7FO7.js +418 -0
  46. package/dist/{chunk-Q5Q7FG4U.js → chunk-OZLGNWET.js} +7 -7
  47. package/dist/{chunk-LAZGEMA2.mjs → chunk-P4EFJIXU.mjs} +1 -1
  48. package/dist/chunk-QI6WAP6Y.js +285 -0
  49. package/dist/{chunk-WK5HN4OH.js → chunk-QY6I7LU5.js} +43 -29
  50. package/dist/{chunk-KSW5JDIV.js → chunk-R7TOQU3U.js} +1 -1
  51. package/dist/chunk-RQSQXQN6.mjs +91 -0
  52. package/dist/chunk-SDLMB34Y.mjs +32 -0
  53. package/dist/chunk-UG3I4PCY.js +102 -0
  54. package/dist/chunk-VBSK4TGO.mjs +364 -0
  55. package/dist/{chunk-DZJUFU55.js → chunk-VXHBQTZS.js} +14 -11
  56. package/dist/chunk-WLIFEALE.mjs +111 -0
  57. package/dist/{chunk-AQ6DHCP6.js → chunk-XRFK2IXM.js} +4 -4
  58. package/dist/{chunk-5FRENLDC.js → chunk-Y2JOJ4D6.js} +14 -3
  59. package/dist/chunk-YER7IQF4.mjs +429 -0
  60. package/dist/{chunk-NI2WNZRT.js → chunk-YESS6YKC.js} +1 -2
  61. package/dist/chunk-Z6F67MJE.mjs +92 -0
  62. package/dist/{chunk-QORSSZX4.js → chunk-ZPFZMXA6.js} +34 -28
  63. package/dist/chunk-ZUUG3WOL.js +432 -0
  64. package/dist/chunk-ZYPEO2KY.js +115 -0
  65. package/dist/components/AreaChart.d.mts +19 -0
  66. package/dist/components/AreaChart.d.ts +19 -0
  67. package/dist/components/AreaChart.js +23 -0
  68. package/dist/components/AreaChart.mjs +8 -0
  69. package/dist/components/BarChart.d.mts +16 -0
  70. package/dist/components/BarChart.d.ts +16 -0
  71. package/dist/components/BarChart.js +23 -0
  72. package/dist/components/BarChart.mjs +8 -0
  73. package/dist/components/ChartAxis.d.mts +10 -0
  74. package/dist/components/ChartAxis.d.ts +10 -0
  75. package/dist/components/ChartAxis.js +16 -0
  76. package/dist/components/ChartAxis.mjs +1 -0
  77. package/dist/components/ChartCanvas.d.mts +9 -0
  78. package/dist/components/ChartCanvas.d.ts +9 -0
  79. package/dist/components/ChartCanvas.js +16 -0
  80. package/dist/components/ChartCanvas.mjs +1 -0
  81. package/dist/components/ChartGrid.d.mts +11 -0
  82. package/dist/components/ChartGrid.d.ts +11 -0
  83. package/dist/components/ChartGrid.js +16 -0
  84. package/dist/components/ChartGrid.mjs +1 -0
  85. package/dist/components/ChartLegend.d.mts +17 -0
  86. package/dist/components/ChartLegend.d.ts +17 -0
  87. package/dist/components/ChartLegend.js +16 -0
  88. package/dist/components/ChartLegend.mjs +1 -0
  89. package/dist/components/ChartSeries.d.mts +18 -0
  90. package/dist/components/ChartSeries.d.ts +18 -0
  91. package/dist/components/ChartSeries.js +16 -0
  92. package/dist/components/ChartSeries.mjs +1 -0
  93. package/dist/components/ChartTooltip.d.mts +12 -0
  94. package/dist/components/ChartTooltip.d.ts +12 -0
  95. package/dist/components/ChartTooltip.js +16 -0
  96. package/dist/components/ChartTooltip.mjs +1 -0
  97. package/dist/components/DonutChart.d.mts +14 -0
  98. package/dist/components/DonutChart.d.ts +14 -0
  99. package/dist/components/DonutChart.js +21 -0
  100. package/dist/components/DonutChart.mjs +6 -0
  101. package/dist/components/Drawer.js +3 -3
  102. package/dist/components/Drawer.mjs +2 -2
  103. package/dist/components/Dropdown.d.mts +12 -2
  104. package/dist/components/Dropdown.d.ts +12 -2
  105. package/dist/components/Dropdown.js +4 -4
  106. package/dist/components/Dropdown.mjs +2 -2
  107. package/dist/components/DropdownItem.js +4 -4
  108. package/dist/components/DropdownItem.mjs +3 -3
  109. package/dist/components/Icon.js +2 -2
  110. package/dist/components/Icon.mjs +1 -1
  111. package/dist/components/LineChart.d.mts +19 -0
  112. package/dist/components/LineChart.d.ts +19 -0
  113. package/dist/components/LineChart.js +23 -0
  114. package/dist/components/LineChart.mjs +8 -0
  115. package/dist/components/List.js +3 -3
  116. package/dist/components/List.mjs +2 -2
  117. package/dist/components/Message.js +4 -4
  118. package/dist/components/Message.mjs +1 -1
  119. package/dist/components/Modal.js +3 -3
  120. package/dist/components/Modal.mjs +2 -2
  121. package/dist/components/Notification.js +4 -4
  122. package/dist/components/Notification.mjs +1 -1
  123. package/dist/components/Pagination.d.mts +5 -1
  124. package/dist/components/Pagination.d.ts +5 -1
  125. package/dist/components/Pagination.js +3 -3
  126. package/dist/components/Pagination.mjs +1 -1
  127. package/dist/components/PieChart.d.mts +14 -0
  128. package/dist/components/PieChart.d.ts +14 -0
  129. package/dist/components/PieChart.js +20 -0
  130. package/dist/components/PieChart.mjs +5 -0
  131. package/dist/components/Popconfirm.d.mts +12 -2
  132. package/dist/components/Popconfirm.d.ts +12 -2
  133. package/dist/components/Popconfirm.js +3 -2
  134. package/dist/components/Popconfirm.mjs +2 -1
  135. package/dist/components/Popover.d.mts +12 -2
  136. package/dist/components/Popover.d.ts +12 -2
  137. package/dist/components/Popover.js +3 -2
  138. package/dist/components/Popover.mjs +2 -1
  139. package/dist/components/RadarChart.d.mts +20 -0
  140. package/dist/components/RadarChart.d.ts +20 -0
  141. package/dist/components/RadarChart.js +20 -0
  142. package/dist/components/RadarChart.mjs +5 -0
  143. package/dist/components/ScatterChart.d.mts +32 -0
  144. package/dist/components/ScatterChart.d.ts +32 -0
  145. package/dist/components/ScatterChart.js +23 -0
  146. package/dist/components/ScatterChart.mjs +8 -0
  147. package/dist/components/Select.js +2 -2
  148. package/dist/components/Select.mjs +1 -1
  149. package/dist/components/Slider.js +2 -2
  150. package/dist/components/Slider.mjs +1 -1
  151. package/dist/components/Space.js +2 -2
  152. package/dist/components/Space.mjs +1 -1
  153. package/dist/components/Steps.js +3 -3
  154. package/dist/components/Steps.mjs +1 -1
  155. package/dist/components/StepsItem.js +2 -2
  156. package/dist/components/StepsItem.mjs +1 -1
  157. package/dist/components/Table.js +2 -2
  158. package/dist/components/Table.mjs +1 -1
  159. package/dist/components/Tooltip.d.mts +12 -2
  160. package/dist/components/Tooltip.d.ts +12 -2
  161. package/dist/components/Tooltip.js +3 -2
  162. package/dist/components/Tooltip.mjs +2 -1
  163. package/dist/index.d.mts +97 -1
  164. package/dist/index.d.ts +97 -1
  165. package/dist/index.js +178 -108
  166. package/dist/index.mjs +41 -27
  167. package/package.json +2 -2
  168. package/dist/chunk-NEULKOYJ.js +0 -48
  169. package/dist/chunk-ZO4XVOHU.mjs +0 -45
@@ -1,8 +1,8 @@
1
- import React, { useState, useRef, useEffect, useMemo } from 'react';
2
- import { classNames, getPopconfirmContainerClasses, getPopconfirmTriggerClasses, getDropdownMenuWrapperClasses, getPopconfirmArrowClasses, getPopconfirmContentClasses, getPopconfirmTitleClasses, getPopconfirmDescriptionClasses, getPopconfirmIconClasses, getPopconfirmButtonsClasses, getPopconfirmCancelButtonClasses, getPopconfirmOkButtonClasses, mergeStyleValues, popconfirmIconStrokeWidth, popconfirmIconViewBox, getPopconfirmIconPath, popconfirmIconPathStrokeLinejoin, popconfirmIconPathStrokeLinecap } from '@expcat/tigercat-core';
1
+ import { useFloating, useClickOutside, useEscapeKey } from './chunk-WLIFEALE.mjs';
2
+ import React, { useState, useRef, useCallback, useMemo } from 'react';
3
+ import { getTransformOrigin, classNames, getPopconfirmContainerClasses, getPopconfirmTriggerClasses, getPopconfirmArrowClasses, getPopconfirmContentClasses, getPopconfirmTitleClasses, getPopconfirmDescriptionClasses, getPopconfirmIconClasses, getPopconfirmButtonsClasses, getPopconfirmCancelButtonClasses, getPopconfirmOkButtonClasses, mergeStyleValues, popconfirmIconStrokeWidth, popconfirmIconViewBox, getPopconfirmIconPath, popconfirmIconPathStrokeLinejoin, popconfirmIconPathStrokeLinecap } from '@expcat/tigercat-core';
3
4
  import { jsx, jsxs } from 'react/jsx-runtime';
4
5
 
5
- // src/components/Popconfirm.tsx
6
6
  var popconfirmIdCounter = 0;
7
7
  var createPopconfirmId = () => `tiger-popconfirm-${++popconfirmIdCounter}`;
8
8
  var PopconfirmIcon = ({ type }) => /* @__PURE__ */ jsx(
@@ -33,7 +33,8 @@ var Popconfirm = ({
33
33
  okText = "\u786E\u5B9A",
34
34
  cancelText = "\u53D6\u6D88",
35
35
  okType = "primary",
36
- placement = "top",
36
+ placement: initialPlacement = "top",
37
+ offset = 8,
37
38
  disabled = false,
38
39
  className,
39
40
  style,
@@ -49,6 +50,8 @@ var Popconfirm = ({
49
50
  const [internalVisible, setInternalVisible] = useState(defaultVisible);
50
51
  const currentVisible = isControlled ? visible : internalVisible;
51
52
  const containerRef = useRef(null);
53
+ const triggerRef = useRef(null);
54
+ const floatingRef = useRef(null);
52
55
  const popconfirmIdRef = useRef(null);
53
56
  if (!popconfirmIdRef.current) {
54
57
  popconfirmIdRef.current = createPopconfirmId();
@@ -76,40 +79,40 @@ var Popconfirm = ({
76
79
  if (disabled) return;
77
80
  setVisible(!currentVisible);
78
81
  };
79
- useEffect(() => {
80
- if (!currentVisible) return;
81
- const handleClickOutside = (event) => {
82
- const target = event.target;
83
- if (!target) return;
84
- if (containerRef.current?.contains(target)) return;
85
- setVisible(false);
86
- };
87
- const timeoutId = window.setTimeout(() => {
88
- document.addEventListener("click", handleClickOutside);
89
- }, 0);
90
- return () => {
91
- clearTimeout(timeoutId);
92
- document.removeEventListener("click", handleClickOutside);
93
- };
94
- }, [currentVisible]);
95
- useEffect(() => {
96
- if (!currentVisible) return;
97
- const handleKeyDown = (event) => {
98
- if (event.key !== "Escape") return;
99
- setVisible(false);
100
- };
101
- document.addEventListener("keydown", handleKeyDown);
102
- return () => document.removeEventListener("keydown", handleKeyDown);
103
- }, [currentVisible]);
82
+ const { x, y, placement } = useFloating({
83
+ referenceRef: triggerRef,
84
+ floatingRef,
85
+ enabled: currentVisible,
86
+ placement: initialPlacement,
87
+ offset
88
+ });
89
+ const handleOutsideClick = useCallback(() => setVisible(false), []);
90
+ const handleEscape = useCallback(() => setVisible(false), []);
91
+ useClickOutside({
92
+ enabled: currentVisible,
93
+ refs: [containerRef],
94
+ onOutsideClick: handleOutsideClick,
95
+ defer: true
96
+ });
97
+ useEscapeKey({
98
+ enabled: currentVisible,
99
+ onEscape: handleEscape
100
+ });
101
+ const contentWrapperStyles = useMemo(
102
+ () => ({
103
+ position: "absolute",
104
+ left: x,
105
+ top: y,
106
+ transformOrigin: getTransformOrigin(placement)
107
+ }),
108
+ [x, y, placement]
109
+ );
104
110
  const containerClasses = useMemo(
105
111
  () => classNames(getPopconfirmContainerClasses(), className),
106
112
  [className]
107
113
  );
108
114
  const triggerClasses = useMemo(() => getPopconfirmTriggerClasses(disabled), [disabled]);
109
- const contentWrapperClasses = useMemo(
110
- () => getDropdownMenuWrapperClasses(Boolean(currentVisible), placement),
111
- [currentVisible, placement]
112
- );
115
+ const contentWrapperClasses = useMemo(() => "absolute z-50", []);
113
116
  const arrowClasses = useMemo(() => getPopconfirmArrowClasses(placement), [placement]);
114
117
  const contentClasses = useMemo(() => getPopconfirmContentClasses(), []);
115
118
  const titleClasses = useMemo(() => getPopconfirmTitleClasses(), []);
@@ -165,34 +168,44 @@ var Popconfirm = ({
165
168
  );
166
169
  })();
167
170
  return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: containerClasses, style: mergedStyle, ...divProps, children: [
168
- triggerNode,
169
- /* @__PURE__ */ jsx("div", { className: contentWrapperClasses, hidden: !currentVisible, "aria-hidden": !currentVisible, children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
170
- /* @__PURE__ */ jsx("div", { className: arrowClasses, "aria-hidden": "true" }),
171
- /* @__PURE__ */ jsxs(
172
- "div",
173
- {
174
- id: popconfirmId,
175
- role: "dialog",
176
- "aria-modal": "false",
177
- "aria-labelledby": titleId,
178
- "aria-describedby": describedBy,
179
- className: contentClasses,
180
- children: [
181
- /* @__PURE__ */ jsxs("div", { className: "flex items-start", children: [
182
- showIcon && /* @__PURE__ */ jsx("div", { className: iconClasses, "aria-hidden": "true", children: /* @__PURE__ */ jsx(PopconfirmIcon, { type: icon }) }),
183
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
184
- /* @__PURE__ */ jsx("div", { id: titleId, className: titleClasses, children: titleContent || title }),
185
- (description || descriptionContent) && /* @__PURE__ */ jsx("div", { id: descriptionId, className: descriptionClasses, children: descriptionContent || description })
186
- ] })
187
- ] }),
188
- /* @__PURE__ */ jsxs("div", { className: buttonsClasses, children: [
189
- /* @__PURE__ */ jsx("button", { type: "button", className: cancelButtonClasses, onClick: handleCancel, children: cancelText }),
190
- /* @__PURE__ */ jsx("button", { type: "button", className: okButtonClasses, onClick: handleConfirm, children: okText })
191
- ] })
192
- ]
193
- }
194
- )
195
- ] }) })
171
+ /* @__PURE__ */ jsx("div", { ref: triggerRef, children: triggerNode }),
172
+ /* @__PURE__ */ jsx(
173
+ "div",
174
+ {
175
+ ref: floatingRef,
176
+ className: contentWrapperClasses,
177
+ style: contentWrapperStyles,
178
+ hidden: !currentVisible,
179
+ "aria-hidden": !currentVisible,
180
+ children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
181
+ /* @__PURE__ */ jsx("div", { className: arrowClasses, "aria-hidden": "true" }),
182
+ /* @__PURE__ */ jsxs(
183
+ "div",
184
+ {
185
+ id: popconfirmId,
186
+ role: "dialog",
187
+ "aria-modal": "false",
188
+ "aria-labelledby": titleId,
189
+ "aria-describedby": describedBy,
190
+ className: contentClasses,
191
+ children: [
192
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start", children: [
193
+ showIcon && /* @__PURE__ */ jsx("div", { className: iconClasses, "aria-hidden": "true", children: /* @__PURE__ */ jsx(PopconfirmIcon, { type: icon }) }),
194
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
195
+ /* @__PURE__ */ jsx("div", { id: titleId, className: titleClasses, children: titleContent || title }),
196
+ (description || descriptionContent) && /* @__PURE__ */ jsx("div", { id: descriptionId, className: descriptionClasses, children: descriptionContent || description })
197
+ ] })
198
+ ] }),
199
+ /* @__PURE__ */ jsxs("div", { className: buttonsClasses, children: [
200
+ /* @__PURE__ */ jsx("button", { type: "button", className: cancelButtonClasses, onClick: handleCancel, children: cancelText }),
201
+ /* @__PURE__ */ jsx("button", { type: "button", className: okButtonClasses, onClick: handleConfirm, children: okText })
202
+ ] })
203
+ ]
204
+ }
205
+ )
206
+ ] })
207
+ }
208
+ )
196
209
  ] });
197
210
  };
198
211
 
@@ -14,9 +14,9 @@ var SortIcon = ({ direction }) => {
14
14
  className: tigercatCore.getSortIconClasses(true),
15
15
  width: "16",
16
16
  height: "16",
17
- viewBox: "0 0 16 16",
17
+ viewBox: tigercatCore.icon16ViewBox,
18
18
  fill: "currentColor",
19
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 3l4 4H4l4-4z" })
19
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: tigercatCore.sortAscIcon16PathD })
20
20
  }
21
21
  );
22
22
  }
@@ -27,9 +27,9 @@ var SortIcon = ({ direction }) => {
27
27
  className: tigercatCore.getSortIconClasses(true),
28
28
  width: "16",
29
29
  height: "16",
30
- viewBox: "0 0 16 16",
30
+ viewBox: tigercatCore.icon16ViewBox,
31
31
  fill: "currentColor",
32
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 13l-4-4h8l-4 4z" })
32
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: tigercatCore.sortDescIcon16PathD })
33
33
  }
34
34
  );
35
35
  }
@@ -39,14 +39,14 @@ var SortIcon = ({ direction }) => {
39
39
  className: tigercatCore.getSortIconClasses(false),
40
40
  width: "16",
41
41
  height: "16",
42
- viewBox: "0 0 16 16",
42
+ viewBox: tigercatCore.icon16ViewBox,
43
43
  fill: "currentColor",
44
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 3l4 4H4l4-4zM8 13l-4-4h8l-4 4z" })
44
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: tigercatCore.sortBothIcon16PathD })
45
45
  }
46
46
  );
47
47
  };
48
48
  var LockIcon = ({ locked }) => {
49
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: locked ? /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 8h-1V6a4 4 0 10-8 0v2H7a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V10a2 2 0 00-2-2zm-7-2a2 2 0 114 0v2h-4V6z" }) : /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 8h-1V6a4 4 0 00-7.75-1.41 1 1 0 101.9.62A2 2 0 0114 6v2H7a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V10a2 2 0 00-2-2zm0 12H7V10h10v10z" }) });
49
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: tigercatCore.icon24ViewBox, fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: locked ? tigercatCore.lockClosedIcon24PathD : tigercatCore.lockOpenIcon24PathD }) });
50
50
  };
51
51
  var LoadingSpinner = () => /* @__PURE__ */ jsxRuntime.jsx(
52
52
  "svg",
@@ -588,13 +588,13 @@ function Table({
588
588
  const { totalPages, startIndex, endIndex, hasNext, hasPrev } = paginationInfo;
589
589
  const total = processedData.length;
590
590
  const paginationConfig2 = pagination;
591
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.tablePaginationContainerClasses, children: [
592
- paginationConfig2.showTotal !== false && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-700", children: paginationConfig2.totalText ? paginationConfig2.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} results` }),
593
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
591
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getSimplePaginationContainerClasses(), children: [
592
+ paginationConfig2.showTotal !== false && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.getSimplePaginationTotalClasses(), children: paginationConfig2.totalText ? paginationConfig2.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} results` }),
593
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getSimplePaginationControlsClasses(), children: [
594
594
  paginationConfig2.showSizeChanger !== false && /* @__PURE__ */ jsxRuntime.jsx(
595
595
  "select",
596
596
  {
597
- className: "px-3 py-1 border border-gray-300 rounded text-sm",
597
+ className: tigercatCore.getSimplePaginationSelectClasses(),
598
598
  value: currentPageSize,
599
599
  onChange: (e) => handlePageSizeChange(Number(e.target.value)),
600
600
  children: (paginationConfig2.pageSizeOptions || [10, 20, 50, 100]).map((size2) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: size2, children: [
@@ -603,20 +603,17 @@ function Table({
603
603
  ] }, size2))
604
604
  }
605
605
  ),
606
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
606
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getSimplePaginationButtonsWrapperClasses(), children: [
607
607
  /* @__PURE__ */ jsxRuntime.jsx(
608
608
  "button",
609
609
  {
610
- className: tigercatCore.classNames(
611
- "px-3 py-1 border border-gray-300 rounded text-sm",
612
- hasPrev ? "hover:bg-gray-50 text-gray-700" : "text-gray-400 cursor-not-allowed"
613
- ),
610
+ className: tigercatCore.getSimplePaginationButtonClasses(!hasPrev),
614
611
  disabled: !hasPrev,
615
612
  onClick: () => handlePageChange(currentPage - 1),
616
613
  children: "Previous"
617
614
  }
618
615
  ),
619
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-3 py-1 text-sm text-gray-700", children: [
616
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: tigercatCore.getSimplePaginationPageIndicatorClasses(), children: [
620
617
  "Page ",
621
618
  currentPage,
622
619
  " of ",
@@ -625,10 +622,7 @@ function Table({
625
622
  /* @__PURE__ */ jsxRuntime.jsx(
626
623
  "button",
627
624
  {
628
- className: tigercatCore.classNames(
629
- "px-3 py-1 border border-gray-300 rounded text-sm",
630
- hasNext ? "hover:bg-gray-50 text-gray-700" : "text-gray-400 cursor-not-allowed"
631
- ),
625
+ className: tigercatCore.getSimplePaginationButtonClasses(!hasNext),
632
626
  disabled: !hasNext,
633
627
  onClick: () => handlePageChange(currentPage + 1),
634
628
  children: "Next"
@@ -1,5 +1,5 @@
1
1
  import { memo, useState, useRef, useEffect, useCallback } from 'react';
2
- import { getSliderTrackClasses, getSliderThumbClasses, getSliderTooltipClasses, classNames, sliderRangeClasses, sliderBaseClasses } from '@expcat/tigercat-core';
2
+ import { sliderNormalizeValue, sliderGetPercentage, getSliderTrackClasses, getSliderThumbClasses, getSliderTooltipClasses, classNames, sliderRangeClasses, sliderBaseClasses, sliderGetKeyboardValue } from '@expcat/tigercat-core';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
 
5
5
  // src/components/Slider.tsx
@@ -92,16 +92,11 @@ var Slider = ({
92
92
  }
93
93
  }, [controlledValue]);
94
94
  const normalizeValue = useCallback(
95
- (val) => {
96
- const steps = Math.round((val - min) / step);
97
- return Math.min(Math.max(min + steps * step, min), max);
98
- },
95
+ (val) => sliderNormalizeValue(val, min, max, step),
99
96
  [min, max, step]
100
97
  );
101
98
  const getPercentage = useCallback(
102
- (val) => {
103
- return (val - min) / (max - min) * 100;
104
- },
99
+ (val) => sliderGetPercentage(val, min, max),
105
100
  [min, max]
106
101
  );
107
102
  const getValueFromPosition = useCallback(
@@ -185,22 +180,9 @@ var Slider = ({
185
180
  };
186
181
  const handleKeyDown = (e, value, thumbType) => {
187
182
  if (disabled) return;
188
- let newValue = value;
189
- if (e.key === "ArrowRight" || e.key === "ArrowUp") {
190
- e.preventDefault();
191
- newValue = normalizeValue(value + step);
192
- } else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
193
- e.preventDefault();
194
- newValue = normalizeValue(value - step);
195
- } else if (e.key === "Home") {
196
- e.preventDefault();
197
- newValue = min;
198
- } else if (e.key === "End") {
199
- e.preventDefault();
200
- newValue = max;
201
- } else {
202
- return;
203
- }
183
+ const newValue = sliderGetKeyboardValue(e.key, value, min, max, step);
184
+ if (newValue === null) return;
185
+ e.preventDefault();
204
186
  if (range && Array.isArray(internalValue)) {
205
187
  const [minVal, maxVal] = internalValue;
206
188
  if (thumbType === "min") {
@@ -0,0 +1,39 @@
1
+ import { useMemo } from 'react';
2
+ import { getChartInnerRect, classNames, chartCanvasBaseClasses } from '@expcat/tigercat-core';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+
5
+ // src/components/ChartCanvas.tsx
6
+ var ChartCanvas = ({
7
+ width = 320,
8
+ height = 200,
9
+ padding = 24,
10
+ className,
11
+ title,
12
+ desc,
13
+ children,
14
+ ...props
15
+ }) => {
16
+ const innerRect = useMemo(
17
+ () => getChartInnerRect(width, height, padding),
18
+ [width, height, padding]
19
+ );
20
+ const svgClasses = useMemo(() => classNames(chartCanvasBaseClasses, className), [className]);
21
+ return /* @__PURE__ */ jsxs(
22
+ "svg",
23
+ {
24
+ ...props,
25
+ width,
26
+ height,
27
+ viewBox: `0 0 ${width} ${height}`,
28
+ className: svgClasses,
29
+ children: [
30
+ title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
31
+ desc ? /* @__PURE__ */ jsx("desc", { children: desc }) : null,
32
+ /* @__PURE__ */ jsx("g", { transform: `translate(${innerRect.x}, ${innerRect.y})`, children })
33
+ ]
34
+ }
35
+ );
36
+ };
37
+ var ChartCanvas_default = ChartCanvas;
38
+
39
+ export { ChartCanvas, ChartCanvas_default };
@@ -1,5 +1,5 @@
1
- import { useState, useCallback } from 'react';
2
- import { getTotalPages, validateCurrentPage, getPageRange, getPaginationContainerClasses, defaultTotalText, getTotalTextClasses, getPaginationButtonBaseClasses, classNames, getPageNumbers, getPaginationEllipsisClasses, getPaginationButtonActiveClasses, getPageSizeSelectorClasses, getQuickJumperInputClasses } from '@expcat/tigercat-core';
1
+ import { useMemo, useState, useCallback } from 'react';
2
+ import { getPaginationLabels, getTotalPages, validateCurrentPage, getPageRange, getPaginationContainerClasses, defaultTotalText, getTotalTextClasses, getPaginationButtonBaseClasses, classNames, getPageNumbers, getPaginationEllipsisClasses, formatPageAriaLabel, getPaginationButtonActiveClasses, getPageSizeSelectorClasses, getQuickJumperInputClasses } from '@expcat/tigercat-core';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
 
5
5
  // src/components/Pagination.tsx
@@ -24,9 +24,11 @@ var Pagination = ({
24
24
  style,
25
25
  onChange,
26
26
  onPageSizeChange,
27
+ locale,
27
28
  ...props
28
29
  }) => {
29
30
  const { "aria-label": ariaLabelProp, ...navProps } = props;
31
+ const labels = useMemo(() => getPaginationLabels(locale), [locale]);
30
32
  const [internalCurrent, setInternalCurrent] = useState(defaultCurrent);
31
33
  const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
32
34
  const [quickJumperValue, setQuickJumperValue] = useState("");
@@ -114,7 +116,7 @@ var Pagination = ({
114
116
  className: getPaginationButtonBaseClasses(size),
115
117
  disabled: prevDisabled,
116
118
  onClick: () => handlePageChange(validatedCurrentPage - 1),
117
- "aria-label": "\u4E0A\u4E00\u9875",
119
+ "aria-label": labels.prevPageAriaLabel,
118
120
  children: "\u2039"
119
121
  },
120
122
  "prev"
@@ -145,7 +147,7 @@ var Pagination = ({
145
147
  className: getPaginationButtonBaseClasses(size),
146
148
  disabled: nextDisabled,
147
149
  onClick: () => handlePageChange(validatedCurrentPage + 1),
148
- "aria-label": "\u4E0B\u4E00\u9875",
150
+ "aria-label": labels.nextPageAriaLabel,
149
151
  children: "\u203A"
150
152
  },
151
153
  "next"
@@ -162,7 +164,7 @@ var Pagination = ({
162
164
  className: getPaginationButtonBaseClasses(size),
163
165
  disabled: prevDisabled,
164
166
  onClick: () => handlePageChange(validatedCurrentPage - 1),
165
- "aria-label": "\u4E0A\u4E00\u9875",
167
+ "aria-label": labels.prevPageAriaLabel,
166
168
  children: "\u2039"
167
169
  },
168
170
  "prev"
@@ -195,7 +197,7 @@ var Pagination = ({
195
197
  ),
196
198
  disabled,
197
199
  onClick: () => handlePageChange(pageNum),
198
- "aria-label": `\u7B2C ${pageNum} \u9875`,
200
+ "aria-label": formatPageAriaLabel(labels.pageAriaLabel, pageNum),
199
201
  "aria-current": isActive ? "page" : void 0,
200
202
  children: String(pageNum)
201
203
  },
@@ -212,7 +214,7 @@ var Pagination = ({
212
214
  className: getPaginationButtonBaseClasses(size),
213
215
  disabled: nextDisabled,
214
216
  onClick: () => handlePageChange(validatedCurrentPage + 1),
215
- "aria-label": "\u4E0B\u4E00\u9875",
217
+ "aria-label": labels.nextPageAriaLabel,
216
218
  children: "\u203A"
217
219
  },
218
220
  "next"
@@ -228,10 +230,11 @@ var Pagination = ({
228
230
  disabled,
229
231
  value: currentPageSize,
230
232
  onChange: (e) => handlePageSizeChange(parseInt(e.target.value, 10)),
231
- "aria-label": "\u6BCF\u9875\u6761\u6570",
233
+ "aria-label": labels.itemsPerPageText,
232
234
  children: pageSizeOptions.map((sizeOption) => /* @__PURE__ */ jsxs("option", { value: sizeOption, children: [
233
235
  sizeOption,
234
- " \u6761/\u9875"
236
+ " ",
237
+ labels.itemsPerPageText
235
238
  ] }, sizeOption))
236
239
  },
237
240
  "size-changer"
@@ -247,7 +250,7 @@ var Pagination = ({
247
250
  "ml-2",
248
251
  size === "small" ? "text-sm" : size === "large" ? "text-lg" : "text-base"
249
252
  ),
250
- children: "\u8DF3\u81F3"
253
+ children: labels.jumpToText
251
254
  },
252
255
  "jumper-label-start"
253
256
  )
@@ -264,7 +267,7 @@ var Pagination = ({
264
267
  onKeyDown: handleQuickJumperKeyPress,
265
268
  min: 1,
266
269
  max: totalPages,
267
- "aria-label": "\u8DF3\u8F6C\u9875\u7801"
270
+ "aria-label": labels.jumpToText
268
271
  },
269
272
  "jumper-input"
270
273
  )
@@ -274,7 +277,7 @@ var Pagination = ({
274
277
  "span",
275
278
  {
276
279
  className: size === "small" ? "text-sm" : size === "large" ? "text-lg" : "text-base",
277
- children: "\u9875"
280
+ children: labels.pageText
278
281
  },
279
282
  "jumper-label-end"
280
283
  )
@@ -286,7 +289,7 @@ var Pagination = ({
286
289
  className: containerClasses,
287
290
  ...navProps,
288
291
  role: "navigation",
289
- "aria-label": ariaLabelProp ?? "\u5206\u9875\u5BFC\u822A",
292
+ "aria-label": ariaLabelProp ?? "Pagination",
290
293
  style,
291
294
  children: elements
292
295
  }
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
- import { classNames, notificationContainerBaseClasses, notificationPositionClasses, getNotificationTypeClasses, defaultNotificationThemeColors, notificationBaseClasses, getNotificationIconPath, notificationIconClasses, notificationContentClasses, notificationTitleClasses, notificationDescriptionClasses, notificationCloseButtonClasses, notificationCloseIconClasses, notificationCloseIconPath, icon24StrokeWidth, icon24ViewBox, icon24PathStrokeLinejoin, icon24PathStrokeLinecap, isBrowser } from '@expcat/tigercat-core';
3
+ import { classNames, notificationContainerBaseClasses, notificationPositionClasses, getNotificationTypeClasses, defaultNotificationThemeColors, notificationBaseClasses, getNotificationIconPath, notificationIconClasses, notificationContentClasses, notificationTitleClasses, notificationDescriptionClasses, notificationCloseButtonClasses, notificationCloseIconClasses, notificationCloseIconPath, icon24StrokeWidth, icon24ViewBox, icon24PathStrokeLinejoin, icon24PathStrokeLinecap, ANIMATION_DURATION_MS, isBrowser } from '@expcat/tigercat-core';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
 
6
6
  // src/components/Notification.tsx
@@ -67,7 +67,7 @@ var NotificationItem = ({ notification: notification2, onClose }) => {
67
67
  const iconClass = classNames(notificationIconClasses, colorScheme.icon);
68
68
  const handleClose = () => {
69
69
  setIsVisible(false);
70
- setTimeout(() => onClose(notification2.id), 300);
70
+ setTimeout(() => onClose(notification2.id), ANIMATION_DURATION_MS);
71
71
  };
72
72
  const a11yRole = notification2.type === "error" ? "alert" : "status";
73
73
  const ariaLive = notification2.type === "error" ? "assertive" : "polite";