@expcat/tigercat-react 2.0.19 → 2.1.1

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 (186) hide show
  1. package/README.md +25 -16
  2. package/dist/chunk-246DAUEF.mjs +181 -0
  3. package/dist/{chunk-PU3JY6RE.mjs → chunk-2JMI7TCM.mjs} +1 -1
  4. package/dist/chunk-2YBLMVDT.mjs +428 -0
  5. package/dist/chunk-2YOP55OF.mjs +639 -0
  6. package/dist/{chunk-25D5TXZH.mjs → chunk-32MCQMBJ.mjs} +8 -6
  7. package/dist/chunk-3HHEVMHE.mjs +180 -0
  8. package/dist/{chunk-HSBN5MLS.mjs → chunk-3LACOSJQ.mjs} +1 -1
  9. package/dist/{chunk-F6WV53BS.mjs → chunk-3LDDXHW2.mjs} +28 -11
  10. package/dist/{chunk-IXQAECFP.mjs → chunk-3QNIFKVF.mjs} +12 -14
  11. package/dist/{chunk-UD4DTVJZ.mjs → chunk-4C2X5PZO.mjs} +57 -25
  12. package/dist/chunk-5JETWHLJ.mjs +28 -0
  13. package/dist/{chunk-VA6PZWOH.mjs → chunk-5SEMRHBD.mjs} +14 -6
  14. package/dist/{chunk-EKILTLUO.mjs → chunk-72CJNKDY.mjs} +1 -1
  15. package/dist/{chunk-XE4YFBOZ.mjs → chunk-AUD3VOLO.mjs} +1 -1
  16. package/dist/{chunk-UT5BV2VO.mjs → chunk-AYFKHWJS.mjs} +16 -10
  17. package/dist/{chunk-RPSHILHD.mjs → chunk-BXAH2GH3.mjs} +8 -2
  18. package/dist/{chunk-EW5EO7VE.mjs → chunk-BYD7EAWK.mjs} +1 -1
  19. package/dist/{chunk-BOGOQ44C.mjs → chunk-CQOLQAB5.mjs} +105 -90
  20. package/dist/{chunk-L55UK45A.mjs → chunk-CRIEUKMD.mjs} +5 -2
  21. package/dist/{chunk-DKNVSQSV.mjs → chunk-CUAXRBKO.mjs} +12 -0
  22. package/dist/{chunk-E7OTDBI6.mjs → chunk-DECUASRW.mjs} +17 -19
  23. package/dist/{chunk-XMTEMBQV.mjs → chunk-EAAWB3CK.mjs} +16 -13
  24. package/dist/{chunk-D33BIMGK.mjs → chunk-EG7EMDKK.mjs} +12 -2
  25. package/dist/chunk-EW43YBPV.mjs +457 -0
  26. package/dist/{chunk-HOYBHB7B.mjs → chunk-FNK2VWPP.mjs} +1 -1
  27. package/dist/{chunk-RJPNBYK5.mjs → chunk-FQS24AUH.mjs} +12 -3
  28. package/dist/{chunk-LADKKOJT.mjs → chunk-GBEDWXLL.mjs} +16 -10
  29. package/dist/chunk-GR3Y3XWP.mjs +47 -0
  30. package/dist/{chunk-2ENQZECC.mjs → chunk-HAXRHSCN.mjs} +4 -3
  31. package/dist/{chunk-K4GIKSZE.mjs → chunk-I2BENK5X.mjs} +2 -1
  32. package/dist/chunk-IGBQGR6G.mjs +234 -0
  33. package/dist/chunk-J76R2S62.mjs +161 -0
  34. package/dist/{chunk-DNOPEJ5I.mjs → chunk-JZZPLKTW.mjs} +7 -4
  35. package/dist/{chunk-7KCQMXJA.mjs → chunk-KDURW5AS.mjs} +4 -3
  36. package/dist/{chunk-TFMEHUVZ.mjs → chunk-KKN7KLTB.mjs} +0 -1
  37. package/dist/{chunk-6MGQAJ62.mjs → chunk-KL6YJIZ3.mjs} +24 -7
  38. package/dist/chunk-KRDHM5KB.mjs +259 -0
  39. package/dist/{chunk-HHIW7V7B.mjs → chunk-M6ZPTGBV.mjs} +2 -10
  40. package/dist/chunk-MFPVVGNA.mjs +248 -0
  41. package/dist/{chunk-PXRZ6CKY.mjs → chunk-MJVSZ2UJ.mjs} +46 -16
  42. package/dist/{chunk-LZKBDQE4.mjs → chunk-MYI3FPG4.mjs} +23 -4
  43. package/dist/{chunk-OIGEBCAS.mjs → chunk-NADODEZX.mjs} +69 -1
  44. package/dist/{chunk-KMP5CVNK.mjs → chunk-NJWTZ5MO.mjs} +57 -45
  45. package/dist/chunk-NLGLBTSM.mjs +138 -0
  46. package/dist/chunk-NT7GW2FD.mjs +40 -0
  47. package/dist/{chunk-773LH7BK.mjs → chunk-O6VYD4E4.mjs} +24 -2
  48. package/dist/{chunk-G7D4QV7A.mjs → chunk-O7TV5OKS.mjs} +33 -6
  49. package/dist/{chunk-DPWRXXXW.mjs → chunk-OJ6SHHOZ.mjs} +3 -3
  50. package/dist/chunk-OKYMTHFQ.mjs +279 -0
  51. package/dist/{chunk-UYJJLHVA.mjs → chunk-PMQJ6AYT.mjs} +23 -21
  52. package/dist/chunk-PY2VUNEJ.mjs +494 -0
  53. package/dist/{chunk-BEJZPJIK.mjs → chunk-QOAOOD53.mjs} +10 -4
  54. package/dist/{chunk-2WGEHH5A.mjs → chunk-QU3QXUTC.mjs} +49 -23
  55. package/dist/{chunk-V6P7ZK6O.mjs → chunk-QXSUG7SN.mjs} +3 -3
  56. package/dist/{chunk-FYINJRYN.mjs → chunk-R7YZ6FKP.mjs} +27 -16
  57. package/dist/{chunk-YI6YWH66.mjs → chunk-RE5ZLA5D.mjs} +6 -6
  58. package/dist/{chunk-UCBW5RJN.mjs → chunk-RGVU4EMA.mjs} +11 -6
  59. package/dist/{chunk-IBSOUQGB.mjs → chunk-RRGPDFDI.mjs} +7 -4
  60. package/dist/{chunk-ZH5ZBLAN.mjs → chunk-RUQ3F3MV.mjs} +34 -7
  61. package/dist/chunk-SEOG5AGS.mjs +72 -0
  62. package/dist/{chunk-PGD5RPKF.mjs → chunk-SVIJ2UZA.mjs} +2 -1
  63. package/dist/chunk-SXWEFZOF.mjs +766 -0
  64. package/dist/{chunk-NCHUEGUW.mjs → chunk-TEVEXDY2.mjs} +27 -16
  65. package/dist/{chunk-DJOFM2VO.mjs → chunk-TO6MZFNQ.mjs} +52 -40
  66. package/dist/chunk-TQ6RIFWR.mjs +135 -0
  67. package/dist/chunk-U4M3DC2P.mjs +48 -0
  68. package/dist/{chunk-ZCGIZOMT.mjs → chunk-V7HJ5HLC.mjs} +6 -10
  69. package/dist/{chunk-SIDDYP3O.mjs → chunk-VJWSKJLJ.mjs} +1 -1
  70. package/dist/{chunk-ZG56T75O.mjs → chunk-WTHWLCRL.mjs} +51 -11
  71. package/dist/{chunk-KP6DEYWB.mjs → chunk-X4L3W7RQ.mjs} +1 -1
  72. package/dist/{chunk-ZMRTETN2.mjs → chunk-X6C6MNG5.mjs} +4 -3
  73. package/dist/chunk-XT43B7ZI.mjs +58 -0
  74. package/dist/{chunk-OGG2TQDG.mjs → chunk-XVHTJQ4T.mjs} +12 -1
  75. package/dist/{chunk-QJE3MZBO.mjs → chunk-Y6UH3EKE.mjs} +1 -1
  76. package/dist/chunk-YJ5T4XZN.mjs +81 -0
  77. package/dist/{chunk-VVNFXJMN.mjs → chunk-YNDPQVEK.mjs} +8 -1
  78. package/dist/{chunk-QGZ32NFQ.mjs → chunk-Z23KOLNU.mjs} +4 -3
  79. package/dist/{chunk-5CKMYMTS.mjs → chunk-ZATZRXMW.mjs} +27 -8
  80. package/dist/components/ActivityFeed.mjs +3 -3
  81. package/dist/components/Affix.mjs +1 -1
  82. package/dist/components/Anchor.mjs +1 -1
  83. package/dist/components/AreaChart.mjs +5 -4
  84. package/dist/components/AspectRatio.d.mts +10 -0
  85. package/dist/components/AspectRatio.mjs +8 -0
  86. package/dist/components/AutoComplete.mjs +1 -1
  87. package/dist/components/BarChart.mjs +5 -4
  88. package/dist/components/Calendar.mjs +1 -1
  89. package/dist/components/Cascader.mjs +1 -1
  90. package/dist/components/ChartCanvas.mjs +1 -1
  91. package/dist/components/ChatWindow.mjs +4 -4
  92. package/dist/components/Code.mjs +3 -1
  93. package/dist/components/CollapsePanel.mjs +1 -1
  94. package/dist/components/ColorPicker.mjs +1 -1
  95. package/dist/components/CommentThread.mjs +2 -2
  96. package/dist/components/ContextMenu.d.mts +36 -0
  97. package/dist/components/ContextMenu.mjs +17 -0
  98. package/dist/components/DataExport.mjs +2 -2
  99. package/dist/components/DataTableWithToolbar.mjs +7 -7
  100. package/dist/components/DonutChart.mjs +4 -4
  101. package/dist/components/Dropdown.mjs +1 -1
  102. package/dist/components/FileManager.mjs +2 -1
  103. package/dist/components/FloatButton.mjs +1 -1
  104. package/dist/components/FormItem.mjs +1 -1
  105. package/dist/components/FormWizard.mjs +1 -1
  106. package/dist/components/FunnelChart.mjs +3 -3
  107. package/dist/components/Gantt.d.mts +3 -1
  108. package/dist/components/Gantt.mjs +2 -2
  109. package/dist/components/GaugeChart.mjs +2 -2
  110. package/dist/components/HeatmapChart.mjs +3 -3
  111. package/dist/components/Highlight.d.mts +11 -0
  112. package/dist/components/Highlight.mjs +8 -0
  113. package/dist/components/Image.mjs +4 -4
  114. package/dist/components/ImageCompare.d.mts +15 -0
  115. package/dist/components/ImageCompare.mjs +8 -0
  116. package/dist/components/ImageGroup.mjs +2 -2
  117. package/dist/components/ImagePreview.mjs +1 -1
  118. package/dist/components/Input.mjs +1 -1
  119. package/dist/components/InputNumber.d.mts +1 -1
  120. package/dist/components/InputNumber.mjs +1 -1
  121. package/dist/components/InputOTP.d.mts +33 -0
  122. package/dist/components/InputOTP.mjs +12 -0
  123. package/dist/components/Kanban.mjs +2 -2
  124. package/dist/components/Kbd.d.mts +10 -0
  125. package/dist/components/Kbd.mjs +8 -0
  126. package/dist/components/LineChart.mjs +5 -4
  127. package/dist/components/List.mjs +2 -2
  128. package/dist/components/Loading.mjs +1 -1
  129. package/dist/components/LoadingBar.d.mts +8 -0
  130. package/dist/components/LoadingBar.mjs +138 -0
  131. package/dist/components/LoadingBarContainer.d.mts +8 -0
  132. package/dist/components/LoadingBarContainer.mjs +8 -0
  133. package/dist/components/LoadingBarRoot.d.mts +6 -0
  134. package/dist/components/LoadingBarRoot.mjs +6 -0
  135. package/dist/components/Marquee.d.mts +10 -0
  136. package/dist/components/Marquee.mjs +8 -0
  137. package/dist/components/MaskInput.d.mts +37 -0
  138. package/dist/components/MaskInput.mjs +10 -0
  139. package/dist/components/Masonry.d.mts +10 -0
  140. package/dist/components/Masonry.mjs +8 -0
  141. package/dist/components/NavigationMenu.d.mts +84 -0
  142. package/dist/components/NavigationMenu.mjs +23 -0
  143. package/dist/components/NotificationCenter.mjs +4 -4
  144. package/dist/components/OrgChart.mjs +2 -2
  145. package/dist/components/PageHeader.d.mts +34 -0
  146. package/dist/components/PageHeader.mjs +11 -0
  147. package/dist/components/Pagination.mjs +1 -1
  148. package/dist/components/PieChart.mjs +3 -3
  149. package/dist/components/Popconfirm.mjs +2 -2
  150. package/dist/components/Popover.mjs +2 -2
  151. package/dist/components/QRCode.d.mts +2 -2
  152. package/dist/components/QRCode.mjs +1 -1
  153. package/dist/components/RadarChart.mjs +4 -4
  154. package/dist/components/Rate.mjs +1 -1
  155. package/dist/components/ScatterChart.mjs +5 -4
  156. package/dist/components/ScrollArea.d.mts +10 -0
  157. package/dist/components/ScrollArea.mjs +8 -0
  158. package/dist/components/ScrollSpy.mjs +1 -1
  159. package/dist/components/Signature.mjs +1 -1
  160. package/dist/components/SplitButton.d.mts +38 -0
  161. package/dist/components/SplitButton.mjs +12 -0
  162. package/dist/components/Splitter.mjs +1 -1
  163. package/dist/components/Stepper.d.mts +2 -0
  164. package/dist/components/Stepper.mjs +2 -1
  165. package/dist/components/SunburstChart.mjs +3 -3
  166. package/dist/components/Switch.d.mts +5 -1
  167. package/dist/components/Switch.mjs +2 -1
  168. package/dist/components/Table.mjs +2 -2
  169. package/dist/components/TagsInput.d.mts +41 -0
  170. package/dist/components/TagsInput.mjs +13 -0
  171. package/dist/components/TaskBoard.mjs +1 -1
  172. package/dist/components/Textarea.mjs +1 -1
  173. package/dist/components/Tooltip.mjs +2 -2
  174. package/dist/components/Tour.mjs +1 -1
  175. package/dist/components/TreeMapChart.mjs +3 -3
  176. package/dist/components/TreeSelect.mjs +2 -1
  177. package/dist/components/Upload.mjs +1 -1
  178. package/dist/hooks/useChartInteraction.d.mts +5 -0
  179. package/dist/hooks/useChartInteraction.mjs +1 -1
  180. package/dist/index.d.mts +17 -1
  181. package/dist/index.mjs +406 -0
  182. package/package.json +117 -2
  183. package/dist/chunk-7AFRHC7P.mjs +0 -312
  184. package/dist/chunk-CB4SK5AU.mjs +0 -235
  185. package/dist/chunk-KPACLRQH.mjs +0 -55
  186. package/dist/chunk-YIB6ZXZF.mjs +0 -386
@@ -0,0 +1,180 @@
1
+ import {
2
+ Dropdown,
3
+ DropdownItem,
4
+ DropdownMenu
5
+ } from "./chunk-RE5ZLA5D.mjs";
6
+ import {
7
+ Button
8
+ } from "./chunk-5TE7KLE5.mjs";
9
+ import {
10
+ ButtonGroup
11
+ } from "./chunk-ZJWUBR2X.mjs";
12
+
13
+ // src/components/SplitButton.tsx
14
+ import React, { useMemo } from "react";
15
+ import {
16
+ DROPDOWN_CHEVRON_PATH,
17
+ getDropdownChevronClasses,
18
+ getSplitButtonPrimaryClasses,
19
+ getSplitButtonRootClasses,
20
+ getSplitButtonTriggerClasses,
21
+ resolveSplitButtonSize,
22
+ resolveSplitButtonTriggerAriaLabel,
23
+ resolveSplitButtonVariant
24
+ } from "@expcat/tigercat-core";
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ function wrapMenu(nodes) {
27
+ if (nodes == null || typeof nodes === "boolean") return null;
28
+ if (React.isValidElement(nodes) && nodes.type === DropdownMenu) return nodes;
29
+ const array = React.Children.toArray(nodes);
30
+ if (array.length === 0) return null;
31
+ const existing = array.find((child) => React.isValidElement(child) && child.type === DropdownMenu);
32
+ if (existing) return existing;
33
+ return /* @__PURE__ */ jsx(DropdownMenu, { children: nodes });
34
+ }
35
+ function partitionChildren(children) {
36
+ const primary = [];
37
+ const menuItems = [];
38
+ let menu = null;
39
+ React.Children.forEach(children, (child) => {
40
+ if (!React.isValidElement(child)) {
41
+ if (child != null && typeof child !== "boolean") primary.push(child);
42
+ return;
43
+ }
44
+ if (child.type === DropdownMenu) {
45
+ menu = child;
46
+ return;
47
+ }
48
+ if (child.type === DropdownItem) {
49
+ menuItems.push(child);
50
+ return;
51
+ }
52
+ primary.push(child);
53
+ });
54
+ if (!menu && menuItems.length > 0) {
55
+ menu = /* @__PURE__ */ jsx(DropdownMenu, { children: menuItems });
56
+ }
57
+ return { primary, menu };
58
+ }
59
+ function Chevron({ open }) {
60
+ return /* @__PURE__ */ jsx(
61
+ "svg",
62
+ {
63
+ className: getDropdownChevronClasses(open),
64
+ viewBox: "0 0 24 24",
65
+ fill: "none",
66
+ stroke: "currentColor",
67
+ strokeWidth: "2",
68
+ strokeLinecap: "round",
69
+ strokeLinejoin: "round",
70
+ "aria-hidden": "true",
71
+ focusable: "false",
72
+ children: /* @__PURE__ */ jsx("path", { d: DROPDOWN_CHEVRON_PATH })
73
+ }
74
+ );
75
+ }
76
+ var SplitButton = ({
77
+ variant = "primary",
78
+ size = "md",
79
+ disabled = false,
80
+ loading = false,
81
+ danger = false,
82
+ block = false,
83
+ htmlType = "button",
84
+ iconPosition = "left",
85
+ icon,
86
+ loadingIcon,
87
+ trigger,
88
+ triggerAriaLabel,
89
+ open,
90
+ defaultOpen = false,
91
+ closeOnClick = true,
92
+ portal = true,
93
+ placement = "bottom-end",
94
+ offset = 4,
95
+ menu,
96
+ onClick,
97
+ onOpenChange,
98
+ className,
99
+ style,
100
+ children,
101
+ ...rest
102
+ }) => {
103
+ const resolvedVariant = resolveSplitButtonVariant(variant);
104
+ const resolvedSize = resolveSplitButtonSize(size);
105
+ const isDisabled = disabled || loading;
106
+ const triggerLabel = resolveSplitButtonTriggerAriaLabel(triggerAriaLabel);
107
+ const partitioned = useMemo(() => partitionChildren(children), [children]);
108
+ const menuNode = menu != null ? wrapMenu(menu) : partitioned.menu;
109
+ const rootClasses = getSplitButtonRootClasses({ block, className });
110
+ const primaryClasses = getSplitButtonPrimaryClasses({ block });
111
+ const triggerClasses = getSplitButtonTriggerClasses({ size: resolvedSize });
112
+ return /* @__PURE__ */ jsxs(
113
+ ButtonGroup,
114
+ {
115
+ size: resolvedSize,
116
+ className: rootClasses,
117
+ style,
118
+ "data-split-button": "",
119
+ ...rest,
120
+ children: [
121
+ /* @__PURE__ */ jsx(
122
+ Button,
123
+ {
124
+ variant: resolvedVariant,
125
+ size: resolvedSize,
126
+ disabled,
127
+ loading,
128
+ danger,
129
+ htmlType,
130
+ iconPosition,
131
+ icon,
132
+ loadingIcon,
133
+ className: primaryClasses,
134
+ "data-split-button-primary": "",
135
+ onClick,
136
+ children: partitioned.primary
137
+ }
138
+ ),
139
+ /* @__PURE__ */ jsx(
140
+ Dropdown,
141
+ {
142
+ trigger: "click",
143
+ showArrow: false,
144
+ disabled: isDisabled,
145
+ open,
146
+ defaultOpen,
147
+ closeOnClick,
148
+ portal,
149
+ placement,
150
+ offset,
151
+ onOpenChange,
152
+ renderTrigger: ({ open: menuOpen }) => /* @__PURE__ */ jsx(
153
+ Button,
154
+ {
155
+ variant: resolvedVariant,
156
+ size: resolvedSize,
157
+ disabled: isDisabled,
158
+ danger,
159
+ htmlType: "button",
160
+ className: triggerClasses,
161
+ "aria-label": triggerLabel,
162
+ "aria-haspopup": "menu",
163
+ "aria-expanded": menuOpen,
164
+ "data-split-button-trigger": "",
165
+ children: trigger ?? /* @__PURE__ */ jsx(Chevron, { open: menuOpen })
166
+ }
167
+ ),
168
+ children: menuNode
169
+ }
170
+ )
171
+ ]
172
+ }
173
+ );
174
+ };
175
+ var SplitButton_default = SplitButton;
176
+
177
+ export {
178
+ SplitButton,
179
+ SplitButton_default
180
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ImagePreview
3
- } from "./chunk-ZCGIZOMT.mjs";
3
+ } from "./chunk-V7HJ5HLC.mjs";
4
4
 
5
5
  // src/components/ImageGroup.tsx
6
6
  import { useState, useCallback, useMemo, createContext, useRef } from "react";
@@ -12,7 +12,7 @@ import {
12
12
  import { useState, useEffect, useRef, useCallback, useId } from "react";
13
13
  import {
14
14
  classNames,
15
- getInputClasses,
15
+ getInputFieldClasses,
16
16
  getInputWrapperClasses,
17
17
  getInputAffixClasses,
18
18
  getInputErrorClasses,
@@ -103,16 +103,13 @@ var Input = ({
103
103
  const showClear = clearable && !disabled && !readonly && currentValStr.length > 0;
104
104
  const showPasswordToggle = showPassword && type === "password" && !disabled;
105
105
  const effectiveType = showPassword && type === "password" ? passwordVisible ? "text" : "password" : type;
106
- const inputClasses = getInputClasses({
106
+ const inputClasses = getInputFieldClasses({
107
107
  size: effectiveSize,
108
108
  status,
109
109
  hasPrefix,
110
110
  hasSuffix
111
111
  });
112
112
  const renderSuffix = () => {
113
- if (activeError) {
114
- return /* @__PURE__ */ jsx("div", { id: errorMsgId, className: getInputErrorClasses(effectiveSize), children: errorMessage });
115
- }
116
113
  if (showClear) {
117
114
  return /* @__PURE__ */ jsx(
118
115
  "button",
@@ -148,7 +145,7 @@ var Input = ({
148
145
  "div",
149
146
  {
150
147
  ref: wrapperRef,
151
- className: classNames(getInputWrapperClasses(), className),
148
+ className: classNames(getInputWrapperClasses(status), className),
152
149
  style,
153
150
  onAnimationEnd: handleAnimationEnd,
154
151
  children: [
@@ -183,16 +180,36 @@ var Input = ({
183
180
  ]
184
181
  }
185
182
  );
183
+ const extras = [];
184
+ if (activeError) {
185
+ extras.push(
186
+ /* @__PURE__ */ jsx(
187
+ "div",
188
+ {
189
+ id: errorMsgId,
190
+ className: getInputErrorClasses(effectiveSize),
191
+ "aria-live": "polite",
192
+ children: errorMessage
193
+ },
194
+ "error"
195
+ )
196
+ );
197
+ }
186
198
  if (showCount) {
187
199
  const count = currentValStr.length;
188
200
  const isOver = maxLength !== void 0 && count > maxLength;
189
201
  const countText = maxLength !== void 0 ? `${count} / ${maxLength}` : `${count}`;
190
- return /* @__PURE__ */ jsxs("div", { children: [
191
- wrapperNode,
192
- /* @__PURE__ */ jsx("div", { className: getInputCountClasses(isOver), children: countText })
193
- ] });
202
+ extras.push(
203
+ /* @__PURE__ */ jsx("div", { className: getInputCountClasses(isOver), children: countText }, "count")
204
+ );
205
+ }
206
+ if (extras.length === 0) {
207
+ return wrapperNode;
194
208
  }
195
- return wrapperNode;
209
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
210
+ wrapperNode,
211
+ extras
212
+ ] });
196
213
  };
197
214
 
198
215
  export {
@@ -16,6 +16,7 @@ import {
16
16
  getAnchorLinkClasses,
17
17
  getAnchorLinkListClasses,
18
18
  createAnchorObserver,
19
+ createProgrammaticScrollLock,
19
20
  scrollToAnchor
20
21
  } from "@expcat/tigercat-core";
21
22
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -86,7 +87,7 @@ var AnchorLink = ({
86
87
  };
87
88
  var Anchor = ({
88
89
  affix = true,
89
- bounds: _bounds = 5,
90
+ bounds = 5,
90
91
  offsetTop = 0,
91
92
  showInkInFixed = false,
92
93
  targetOffset,
@@ -103,10 +104,9 @@ var Anchor = ({
103
104
  const [links, setLinks] = useState([]);
104
105
  const anchorRef = useRef(null);
105
106
  const inkRef = useRef(null);
106
- const isScrollingRef = useRef(false);
107
- const scrollTimeoutRef = useRef(null);
108
107
  const getContainerRef = useRef(getContainer);
109
108
  getContainerRef.current = getContainer;
109
+ const scrollLockRef = useRef(createProgrammaticScrollLock(() => getContainerRef.current()));
110
110
  const getCurrentAnchorRef = useRef(getCurrentAnchor);
111
111
  getCurrentAnchorRef.current = getCurrentAnchor;
112
112
  const onChangeRef = useRef(onChange);
@@ -133,14 +133,9 @@ var Anchor = ({
133
133
  const handleLinkClick = useCallback(
134
134
  (href, event) => {
135
135
  onClick?.(event, href);
136
- isScrollingRef.current = true;
136
+ scrollLockRef.current.lock();
137
137
  setActiveLink(href);
138
138
  scrollTo(href);
139
- if (scrollTimeoutRef.current !== null) clearTimeout(scrollTimeoutRef.current);
140
- scrollTimeoutRef.current = setTimeout(() => {
141
- isScrollingRef.current = false;
142
- scrollTimeoutRef.current = null;
143
- }, 500);
144
139
  },
145
140
  [onClick, scrollTo]
146
141
  );
@@ -151,9 +146,10 @@ var Anchor = ({
151
146
  const root = container === window ? null : container;
152
147
  stop = createAnchorObserver(links, {
153
148
  offsetTop: scrollOffset,
149
+ bounds,
154
150
  root,
155
151
  onChange: (newActiveLink) => {
156
- if (isScrollingRef.current) return;
152
+ if (scrollLockRef.current.isLocked()) return;
157
153
  const finalActiveLink = getCurrentAnchorRef.current ? getCurrentAnchorRef.current(newActiveLink) : newActiveLink;
158
154
  setActiveLink((prev) => {
159
155
  if (finalActiveLink !== prev) {
@@ -168,11 +164,13 @@ var Anchor = ({
168
164
  return () => {
169
165
  clearTimeout(timeoutId);
170
166
  stop?.();
171
- if (scrollTimeoutRef.current !== null) {
172
- clearTimeout(scrollTimeoutRef.current);
173
- }
174
167
  };
175
- }, [links, scrollOffset]);
168
+ }, [bounds, links, scrollOffset]);
169
+ useEffect(() => {
170
+ return () => {
171
+ scrollLockRef.current.dispose();
172
+ };
173
+ }, []);
176
174
  useEffect(() => {
177
175
  if (!inkRef.current || !anchorRef.current || !activeLink) {
178
176
  return;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Textarea
3
- } from "./chunk-UYJJLHVA.mjs";
3
+ } from "./chunk-PMQJ6AYT.mjs";
4
4
  import {
5
5
  Button
6
6
  } from "./chunk-5TE7KLE5.mjs";
@@ -13,6 +13,9 @@ import {
13
13
  import {
14
14
  Avatar
15
15
  } from "./chunk-OO562MFD.mjs";
16
+ import {
17
+ useTigerConfig
18
+ } from "./chunk-YSIXURBW.mjs";
16
19
 
17
20
  // src/components/CommentThread.tsx
18
21
  import { useMemo, useState } from "react";
@@ -20,7 +23,13 @@ import {
20
23
  classNames,
21
24
  buildCommentTree,
22
25
  clipCommentTreeDepth,
23
- formatCommentTime
26
+ formatCommentTime,
27
+ getCommentThreadLabels,
28
+ mergeTigerLocale,
29
+ nextCommentLikeState,
30
+ resolveCommentLikeState,
31
+ resolveLocaleText,
32
+ writeCommentLikeOverlay
24
33
  } from "@expcat/tigercat-core";
25
34
 
26
35
  // ../core/src/internal/comment-thread-styles.ts
@@ -55,15 +64,19 @@ var CommentThread = ({
55
64
  maxReplies = 3,
56
65
  defaultExpandedKeys = [],
57
66
  expandedKeys,
58
- emptyText = "\u6682\u65E0\u8BC4\u8BBA",
59
- replyPlaceholder = "\u5199\u4E0B\u56DE\u590D...",
60
- replyButtonText = "\u56DE\u590D",
61
- cancelReplyText = "\u53D6\u6D88",
62
- likeText = "\u70B9\u8D5E",
63
- likedText = "\u5DF2\u8D5E",
64
- replyText = "\u56DE\u590D",
65
- moreText = "\u66F4\u591A",
66
- loadMoreText = "\u52A0\u8F7D\u66F4\u591A",
67
+ emptyText,
68
+ replyPlaceholder,
69
+ replyButtonText,
70
+ cancelReplyText,
71
+ likeText,
72
+ likedText,
73
+ replyText,
74
+ moreText,
75
+ loadMoreText,
76
+ collapseRepliesText,
77
+ expandRepliesText,
78
+ locale,
79
+ labels: labelsOverride,
67
80
  showAvatar = true,
68
81
  showDivider = true,
69
82
  showLike = true,
@@ -78,8 +91,18 @@ var CommentThread = ({
78
91
  className,
79
92
  ...divProps
80
93
  }) => {
94
+ const config = useTigerConfig();
95
+ const mergedLocale = useMemo(
96
+ () => mergeTigerLocale(config.locale, locale),
97
+ [config.locale, locale]
98
+ );
99
+ const labels = useMemo(
100
+ () => getCommentThreadLabels(mergedLocale, labelsOverride),
101
+ [mergedLocale, labelsOverride]
102
+ );
81
103
  const [innerExpandedKeys, setInnerExpandedKeys] = useState(defaultExpandedKeys);
82
104
  const [expandedAllKeys, setExpandedAllKeys] = useState(/* @__PURE__ */ new Set());
105
+ const [likeOverlay, setLikeOverlay] = useState(() => /* @__PURE__ */ new Map());
83
106
  const [replyingTo, setReplyingTo] = useState(null);
84
107
  const [replyValue, setReplyValue] = useState("");
85
108
  const mergedExpandedKeys = expandedKeys ?? innerExpandedKeys;
@@ -109,6 +132,11 @@ var CommentThread = ({
109
132
  });
110
133
  onLoadMore?.(node);
111
134
  };
135
+ const handleLike = (node) => {
136
+ const next = nextCommentLikeState(node, likeOverlay);
137
+ setLikeOverlay(writeCommentLikeOverlay(likeOverlay, node.id, next));
138
+ onLike?.(node, next.liked);
139
+ };
112
140
  const handleReplySubmit = (node) => {
113
141
  const trimmed = replyValue.trim();
114
142
  if (!trimmed) return;
@@ -131,8 +159,9 @@ var CommentThread = ({
131
159
  const showLoadMoreBtn = showReplies && maxReplies > 0 && children.length > maxReplies && !showAllReplies;
132
160
  const actions = [];
133
161
  if (showLike) {
134
- const likeLabel = node.liked ? likedText : likeText;
135
- const likeCount = node.likes ? ` ${node.likes}` : "";
162
+ const { liked, likes } = resolveCommentLikeState(node, likeOverlay);
163
+ const likeLabel = liked ? resolveLocaleText(labels.likedText, likedText) : resolveLocaleText(labels.likeText, likeText);
164
+ const likeCount = likes ? ` ${likes}` : "";
136
165
  actions.push(
137
166
  /* @__PURE__ */ jsxs(
138
167
  Button,
@@ -142,16 +171,16 @@ var CommentThread = ({
142
171
  className: classNames(
143
172
  commentThreadActionButtonClasses,
144
173
  commentThreadLikeButtonClasses,
145
- node.liked && commentThreadLikedButtonClasses
174
+ liked && commentThreadLikedButtonClasses
146
175
  ),
147
- onClick: () => onLike?.(node, !node.liked),
176
+ onClick: () => handleLike(node),
148
177
  children: [
149
178
  /* @__PURE__ */ jsx(
150
179
  "svg",
151
180
  {
152
181
  className: classNames(
153
182
  commentThreadLikeIconClasses,
154
- node.liked ? "fill-current" : "stroke-current fill-none"
183
+ liked ? "fill-current" : "stroke-current fill-none"
155
184
  ),
156
185
  viewBox: "0 0 24 24",
157
186
  strokeWidth: "2",
@@ -203,7 +232,7 @@ var CommentThread = ({
203
232
  )
204
233
  }
205
234
  ),
206
- /* @__PURE__ */ jsx("span", { children: replyText })
235
+ /* @__PURE__ */ jsx("span", { children: resolveLocaleText(labels.replyText, replyText) })
207
236
  ]
208
237
  },
209
238
  "reply"
@@ -241,7 +270,7 @@ var CommentThread = ({
241
270
  )
242
271
  }
243
272
  ),
244
- /* @__PURE__ */ jsx("span", { children: moreText })
273
+ /* @__PURE__ */ jsx("span", { children: resolveLocaleText(labels.moreText, moreText) })
245
274
  ]
246
275
  },
247
276
  "more"
@@ -324,7 +353,7 @@ var CommentThread = ({
324
353
  {
325
354
  rows: 3,
326
355
  value: replyValue,
327
- placeholder: replyPlaceholder,
356
+ placeholder: resolveLocaleText(labels.replyPlaceholder, replyPlaceholder),
328
357
  className: commentThreadReplyTextareaClasses,
329
358
  onChange: (event) => setReplyValue(event.target.value)
330
359
  }
@@ -340,7 +369,7 @@ var CommentThread = ({
340
369
  setReplyingTo(null);
341
370
  setReplyValue("");
342
371
  },
343
- children: cancelReplyText
372
+ children: resolveLocaleText(labels.cancelReplyText, cancelReplyText)
344
373
  }
345
374
  ),
346
375
  /* @__PURE__ */ jsx(
@@ -350,7 +379,7 @@ var CommentThread = ({
350
379
  variant: "primary",
351
380
  className: commentThreadSubmitButtonClasses,
352
381
  onClick: () => handleReplySubmit(node),
353
- children: replyButtonText
382
+ children: resolveLocaleText(labels.replyButtonText, replyButtonText)
354
383
  }
355
384
  )
356
385
  ] })
@@ -364,7 +393,10 @@ var CommentThread = ({
364
393
  "aria-expanded": isExpanded,
365
394
  "aria-controls": repliesId,
366
395
  onClick: () => toggleExpanded(node.id),
367
- children: isExpanded ? "\u25BE \u6536\u8D77\u56DE\u590D" : `\u25B8 \u5C55\u5F00 ${children.length} \u6761\u56DE\u590D`
396
+ children: isExpanded ? resolveLocaleText(labels.collapseRepliesText, collapseRepliesText) : resolveLocaleText(labels.expandRepliesText, expandRepliesText).replace(
397
+ "{count}",
398
+ String(children.length)
399
+ )
368
400
  }
369
401
  ) : null,
370
402
  showReplies ? /* @__PURE__ */ jsxs("div", { id: repliesId, className: commentThreadRepliesClasses, children: [
@@ -378,7 +410,7 @@ var CommentThread = ({
378
410
  variant: "ghost",
379
411
  className: commentThreadPrimaryButtonClasses,
380
412
  onClick: () => handleLoadMore(node),
381
- children: loadMoreText
413
+ children: resolveLocaleText(labels.loadMoreText, loadMoreText)
382
414
  }
383
415
  ) : null
384
416
  ] }) : null
@@ -394,7 +426,7 @@ var CommentThread = ({
394
426
  className: classNames("tiger-comment-thread flex flex-col", className),
395
427
  role: divProps.role ?? "feed",
396
428
  "data-tiger-comment-thread": true,
397
- "aria-label": divProps["aria-label"] ?? (divProps["aria-labelledby"] ? void 0 : "\u8BC4\u8BBA\u7EBF\u7A0B"),
429
+ "aria-label": divProps["aria-label"] ?? (divProps["aria-labelledby"] ? void 0 : "Comment thread"),
398
430
  ...divProps,
399
431
  children: resolvedNodes.length === 0 ? /* @__PURE__ */ jsxs("div", { className: commentThreadEmptyClasses, children: [
400
432
  /* @__PURE__ */ jsx(
@@ -415,7 +447,7 @@ var CommentThread = ({
415
447
  )
416
448
  }
417
449
  ),
418
- /* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", color: "muted", className: "font-medium", children: emptyText })
450
+ /* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", color: "muted", className: "font-medium", children: resolveLocaleText(labels.emptyText, emptyText) })
419
451
  ] }) : resolvedNodes.map((node, index) => renderNode(node, 1, index === resolvedNodes.length - 1))
420
452
  }
421
453
  );
@@ -0,0 +1,28 @@
1
+ // src/hooks/useResponsiveChartSize.ts
2
+ import { useCallback, useMemo, useState } from "react";
3
+ import {
4
+ getChartInnerRect,
5
+ resolveResponsiveChartSize
6
+ } from "@expcat/tigercat-core";
7
+ function useResponsiveChartSize(width, height, padding, responsive) {
8
+ const [observedSize, setObservedSize] = useState(null);
9
+ const plotSize = useMemo(
10
+ () => resolveResponsiveChartSize({ width, height }, responsive ? observedSize : null),
11
+ [width, height, responsive, observedSize]
12
+ );
13
+ const innerRect = useMemo(
14
+ () => getChartInnerRect(plotSize.width, plotSize.height, padding),
15
+ [plotSize.width, plotSize.height, padding]
16
+ );
17
+ const onResolvedSizeChange = useCallback((size) => {
18
+ setObservedSize((prev) => {
19
+ if (prev && prev.width === size.width && prev.height === size.height) return prev;
20
+ return size;
21
+ });
22
+ }, []);
23
+ return { plotSize, innerRect, onResolvedSizeChange };
24
+ }
25
+
26
+ export {
27
+ useResponsiveChartSize
28
+ };
@@ -1,3 +1,6 @@
1
+ import {
2
+ useControlledState
3
+ } from "./chunk-MEFARVQI.mjs";
1
4
  import {
2
5
  useTigerConfig
3
6
  } from "./chunk-YSIXURBW.mjs";
@@ -34,7 +37,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
34
37
  var FileManager = ({
35
38
  files = [],
36
39
  viewMode = "list",
37
- selectedKeys = [],
40
+ selectedKeys,
41
+ defaultSelectedKeys,
38
42
  multiple = false,
39
43
  columns,
40
44
  sortField = "name",
@@ -67,6 +71,11 @@ var FileManager = ({
67
71
  const contentRef = useRef(null);
68
72
  const dragFromIndex = useRef(null);
69
73
  const labels = useMemo(() => getFileManagerLabels(mergedLocale), [mergedLocale]);
74
+ const [keys, setKeys] = useControlledState(
75
+ selectedKeys,
76
+ defaultSelectedKeys ?? [],
77
+ onSelectedKeysChange
78
+ );
70
79
  const metaColumns = columns ?? ["size", "modified"];
71
80
  const showSizeColumn = metaColumns.includes("size");
72
81
  const showModifiedColumn = metaColumns.includes("modified");
@@ -75,23 +84,22 @@ var FileManager = ({
75
84
  () => deriveFileManagerModel({
76
85
  files,
77
86
  currentPath,
78
- selectedKeys,
87
+ selectedKeys: keys,
79
88
  sortField,
80
89
  sortOrder,
81
90
  showHidden,
82
91
  searchText: localSearch || searchText
83
92
  }),
84
- [files, currentPath, selectedKeys, sortField, sortOrder, showHidden, localSearch, searchText]
93
+ [files, currentPath, keys, sortField, sortOrder, showHidden, localSearch, searchText]
85
94
  );
86
95
  const containerClasses = useMemo(() => getFileManagerContainerClasses(className), [className]);
87
96
  const handleSelect = useCallback(
88
97
  (item) => {
89
98
  if (item.disabled) return;
90
99
  onSelect?.(item);
91
- const keys = toggleFileSelection(selectedKeys, item.key, multiple);
92
- onSelectedKeysChange?.(keys);
100
+ setKeys(toggleFileSelection(keys, item.key, multiple));
93
101
  },
94
- [selectedKeys, multiple, onSelect, onSelectedKeysChange]
102
+ [keys, multiple, onSelect, setKeys]
95
103
  );
96
104
  const handleOpen = useCallback(
97
105
  (item) => {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YORCCCQX.mjs";
4
4
  import {
5
5
  ChartCanvas
6
- } from "./chunk-DKNVSQSV.mjs";
6
+ } from "./chunk-CUAXRBKO.mjs";
7
7
 
8
8
  // src/components/GaugeChart.tsx
9
9
  import React, { useId, useMemo, useState, useRef, useEffect } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  usePopup
3
- } from "./chunk-ZG56T75O.mjs";
3
+ } from "./chunk-WTHWLCRL.mjs";
4
4
  import {
5
5
  renderOverlayPortal
6
6
  } from "./chunk-HKAZXG74.mjs";