@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
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  Table
3
- } from "./chunk-BOGOQ44C.mjs";
3
+ } from "./chunk-CQOLQAB5.mjs";
4
4
  import {
5
5
  Select
6
6
  } from "./chunk-KVCI2346.mjs";
7
7
  import {
8
8
  Popover
9
- } from "./chunk-HOYBHB7B.mjs";
9
+ } from "./chunk-FNK2VWPP.mjs";
10
10
  import {
11
11
  Input
12
- } from "./chunk-F6WV53BS.mjs";
12
+ } from "./chunk-3LDDXHW2.mjs";
13
13
  import {
14
14
  Checkbox
15
15
  } from "./chunk-EPWAROC2.mjs";
@@ -1,6 +1,12 @@
1
+ import {
2
+ useResponsiveChartSize
3
+ } from "./chunk-5JETWHLJ.mjs";
1
4
  import {
2
5
  useChartInteraction
3
- } from "./chunk-DNOPEJ5I.mjs";
6
+ } from "./chunk-JZZPLKTW.mjs";
7
+ import {
8
+ ChartSeries
9
+ } from "./chunk-SDLMB34Y.mjs";
4
10
  import {
5
11
  ChartTooltip
6
12
  } from "./chunk-YORCCCQX.mjs";
@@ -9,16 +15,13 @@ import {
9
15
  } from "./chunk-RQSQXQN6.mjs";
10
16
  import {
11
17
  ChartCanvas
12
- } from "./chunk-DKNVSQSV.mjs";
18
+ } from "./chunk-CUAXRBKO.mjs";
13
19
  import {
14
20
  ChartGrid
15
21
  } from "./chunk-677VSTPW.mjs";
16
22
  import {
17
23
  ChartLegend
18
24
  } from "./chunk-F2ITBDUS.mjs";
19
- import {
20
- ChartSeries
21
- } from "./chunk-SDLMB34Y.mjs";
22
25
 
23
26
  // src/components/AreaChart.tsx
24
27
  import { useId, useMemo, useState, useCallback } from "react";
@@ -29,7 +32,6 @@ import {
29
32
  createLinePath,
30
33
  createPointScale,
31
34
  getChartElementOpacity,
32
- getChartInnerRect,
33
35
  getStableChartGradientPrefix,
34
36
  getNumberExtent,
35
37
  linePointTransitionClasses,
@@ -111,9 +113,11 @@ var AreaChart = ({
111
113
  () => getStableChartGradientPrefix("area", gradientId),
112
114
  [gradientId]
113
115
  );
114
- const innerRect = useMemo(
115
- () => getChartInnerRect(width, height, padding),
116
- [width, height, padding]
116
+ const { innerRect, onResolvedSizeChange } = useResponsiveChartSize(
117
+ width,
118
+ height,
119
+ padding,
120
+ responsive
117
121
  );
118
122
  const resolvedSeries = useMemo(
119
123
  () => resolveSeriesData(series, data, {
@@ -135,6 +139,7 @@ var AreaChart = ({
135
139
  wrapperClasses
136
140
  } = useChartInteraction({
137
141
  hoverable,
142
+ showTooltip,
138
143
  hoveredIndexProp,
139
144
  selectable,
140
145
  selectedIndexProp,
@@ -287,17 +292,21 @@ var AreaChart = ({
287
292
  (seriesIndex, pointIndex, event) => {
288
293
  setHoveredPointInfo({ seriesIndex, pointIndex });
289
294
  setTooltipPosition({ x: event.clientX, y: event.clientY });
290
- onPointHover?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
295
+ if (hoverable) {
296
+ onPointHover?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
297
+ }
291
298
  },
292
- [onPointHover, resolvedSeries]
299
+ [hoverable, onPointHover, resolvedSeries]
293
300
  );
294
301
  const handlePointMouseMove = useCallback((event) => {
295
302
  setTooltipPosition({ x: event.clientX, y: event.clientY });
296
303
  }, []);
297
304
  const handlePointMouseLeave = useCallback(() => {
298
305
  setHoveredPointInfo(null);
299
- onPointHover?.(null, null, null);
300
- }, [onPointHover]);
306
+ if (hoverable) {
307
+ onPointHover?.(null, null, null);
308
+ }
309
+ }, [hoverable, onPointHover]);
301
310
  const showPointTooltipFromElement = useCallback(
302
311
  (el, seriesIndex, pointIndex) => {
303
312
  if (!hoverable) return;
@@ -325,6 +334,7 @@ var AreaChart = ({
325
334
  [selectable, handleSeriesSelect]
326
335
  );
327
336
  const pointClickable = selectable || !!onPointClick;
337
+ const trackPointHover = showTooltip || hoverable;
328
338
  const reversedSeriesData = useMemo(() => [...seriesData].reverse(), [seriesData]);
329
339
  const chart = /* @__PURE__ */ jsxs(
330
340
  ChartCanvas,
@@ -336,6 +346,7 @@ var AreaChart = ({
336
346
  title,
337
347
  desc,
338
348
  className: classNames(className),
349
+ onResolvedSizeChange,
339
350
  children: [
340
351
  (gradient || animated || strokeGradient || pointGradient) && /* @__PURE__ */ jsxs("defs", { children: [
341
352
  animated && /* @__PURE__ */ jsx("style", { children: `
@@ -518,9 +529,9 @@ var AreaChart = ({
518
529
  tabIndex: pointInteractive ? 0 : void 0,
519
530
  "data-point-index": point.pointIndex,
520
531
  "data-series-key": sd.seriesKey,
521
- onMouseEnter: hoverable ? (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e) : void 0,
522
- onMouseMove: hoverable ? handlePointMouseMove : void 0,
523
- onMouseLeave: hoverable ? handlePointMouseLeave : void 0,
532
+ onMouseEnter: trackPointHover ? (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e) : void 0,
533
+ onMouseMove: trackPointHover ? handlePointMouseMove : void 0,
534
+ onMouseLeave: trackPointHover ? handlePointMouseLeave : void 0,
524
535
  onClick: pointClickable ? (e) => {
525
536
  e.stopPropagation();
526
537
  handlePointClick(sd.seriesIndex, point.pointIndex);
@@ -44,6 +44,7 @@ var DropdownMenu = ({
44
44
  var DropdownItem = ({
45
45
  disabled = false,
46
46
  divided = false,
47
+ closeOnClick,
47
48
  className,
48
49
  onClick,
49
50
  children,
@@ -56,8 +57,9 @@ var DropdownItem = ({
56
57
  return;
57
58
  }
58
59
  onClick?.(event);
59
- if (context?.closeOnClick) {
60
- context.handleItemClick();
60
+ const shouldClose = closeOnClick ?? context?.closeOnClick ?? true;
61
+ if (shouldClose) {
62
+ context?.handleItemClick();
61
63
  }
62
64
  };
63
65
  const itemClasses = classNames(getDropdownItemClasses(disabled, divided), className);
@@ -129,10 +131,8 @@ var Dropdown = ({
129
131
  [disabled, visible, controlledOpen, onOpenChange]
130
132
  );
131
133
  const handleItemClick = useCallback(() => {
132
- if (closeOnClick) {
133
- setVisible(false);
134
- }
135
- }, [closeOnClick, setVisible]);
134
+ setVisible(false);
135
+ }, [setVisible]);
136
136
  const handleMouseEnter = useCallback(() => {
137
137
  if (trigger !== "hover") return;
138
138
  if (hoverTimerRef.current) {
@@ -33,7 +33,7 @@ import {
33
33
  getPictureCardClasses,
34
34
  getUploadStatusIconClasses
35
35
  } from "@expcat/tigercat-core";
36
- import { jsx, jsxs } from "react/jsx-runtime";
36
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
37
37
  var spinnerSvg = getSpinnerSVG("spinner");
38
38
  var Upload = ({
39
39
  accept,
@@ -133,6 +133,11 @@ var Upload = ({
133
133
  onExceed?.(prepared.rejectedExceedFiles, fileList);
134
134
  }
135
135
  let nextFileList = [...fileList];
136
+ const notifyFileList = (file) => {
137
+ const nextList = [...nextFileList];
138
+ updateFileList(nextList);
139
+ onChange?.(file, nextList);
140
+ };
136
141
  for (const file of prepared.acceptedFiles) {
137
142
  const uploadFile = fileToUploadFile(file);
138
143
  nextFileList = [...nextFileList, uploadFile];
@@ -141,7 +146,7 @@ var Upload = ({
141
146
  onChange(uploadFile, nextFileList);
142
147
  }
143
148
  if (autoUpload && !queue) {
144
- await uploadOne(file, uploadFile, () => updateFileList([...nextFileList]));
149
+ await uploadOne(file, uploadFile, () => notifyFileList(uploadFile));
145
150
  }
146
151
  }
147
152
  if (autoUpload && queue) {
@@ -154,7 +159,7 @@ var Upload = ({
154
159
  async (item) => {
155
160
  const uploadFile = nextFileList.find((candidate) => candidate.uid === item.id);
156
161
  if (!uploadFile) return;
157
- await uploadOne(item.file, uploadFile, () => updateFileList([...nextFileList]));
162
+ await uploadOne(item.file, uploadFile, () => notifyFileList(uploadFile));
158
163
  },
159
164
  { concurrency: maxConcurrent, onChange: onQueueChange }
160
165
  );
@@ -266,7 +271,7 @@ var Upload = ({
266
271
  };
267
272
  const renderUploadButton = () => {
268
273
  if (drag) {
269
- return /* @__PURE__ */ jsxs(
274
+ return /* @__PURE__ */ jsx(
270
275
  "div",
271
276
  {
272
277
  className: getDragAreaClasses(isDragging, disabled),
@@ -279,7 +284,7 @@ var Upload = ({
279
284
  tabIndex: disabled ? -1 : 0,
280
285
  "aria-disabled": disabled,
281
286
  "aria-label": labels.dragAreaAriaLabel,
282
- children: [
287
+ children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
283
288
  /* @__PURE__ */ jsx(
284
289
  "svg",
285
290
  {
@@ -308,7 +313,7 @@ var Upload = ({
308
313
  maxSize && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: interpolateUploadLabel(labels.maxSizeInfoText, {
309
314
  maxSize: formatFileSize(maxSize)
310
315
  }) })
311
- ]
316
+ ] })
312
317
  }
313
318
  );
314
319
  }
@@ -155,14 +155,17 @@ var FormWizard = ({
155
155
  ]);
156
156
  const handleStepChange = useCallback(
157
157
  async (nextIndex) => {
158
- if (nextIndex === currentIndex || steps[nextIndex]?.disabled) return;
159
- if (nextIndex > currentIndex) {
158
+ if (nextIndex === currentIndex) return;
159
+ const direction2 = nextIndex > currentIndex ? 1 : -1;
160
+ if (direction2 === 1) {
160
161
  const ok = await runBeforeNext();
161
162
  if (!ok) return;
162
163
  }
163
- setCurrent(nextIndex);
164
+ const target = findNextUnskipped(nextIndex, direction2);
165
+ if (target === currentIndex) return;
166
+ setCurrent(target);
164
167
  },
165
- [currentIndex, runBeforeNext, setCurrent, steps]
168
+ [currentIndex, runBeforeNext, setCurrent, findNextUnskipped]
166
169
  );
167
170
  const contentNode = useMemo(() => {
168
171
  if (!currentStep) return null;
@@ -21,6 +21,25 @@ import {
21
21
  getFormItemAsteriskClasses
22
22
  } from "@expcat/tigercat-core";
23
23
  import { jsx, jsxs } from "react/jsx-runtime";
24
+ function isEventTarget(value) {
25
+ return value !== null && typeof value === "object";
26
+ }
27
+ function extractFormChangeValue(argument) {
28
+ if (argument === void 0) {
29
+ return { found: false };
30
+ }
31
+ if (argument !== null && typeof argument === "object" && "target" in argument) {
32
+ const target = argument.target;
33
+ if (isEventTarget(target)) {
34
+ const type = typeof target.type === "string" ? target.type.toLowerCase() : "";
35
+ if (type === "checkbox" || type === "radio") {
36
+ return { found: true, value: target.checked };
37
+ }
38
+ return { found: true, value: target.value };
39
+ }
40
+ }
41
+ return { found: true, value: argument };
42
+ }
24
43
  function hasRequiredRule(maybeRules) {
25
44
  if (!maybeRules) return false;
26
45
  const ruleArr = Array.isArray(maybeRules) ? maybeRules : [maybeRules];
@@ -129,11 +148,19 @@ var FormItem = ({
129
148
  formContext.validateField(name, rules, "blur");
130
149
  }
131
150
  }, [name, formContext, rules]);
132
- const handleChange = useCallback(() => {
133
- if (name && formContext) {
151
+ const handleChange = useCallback(
152
+ (argument) => {
153
+ if (!name || !formContext) {
154
+ return;
155
+ }
156
+ const extracted = extractFormChangeValue(argument);
157
+ if (extracted.found) {
158
+ formContext.updateValue(name, extracted.value);
159
+ }
134
160
  formContext.validateField(name, rules, "change");
135
- }
136
- }, [name, formContext, rules]);
161
+ },
162
+ [name, formContext, rules]
163
+ );
137
164
  const hasError = !!errorMessage;
138
165
  const popupErrorVisible = showMessage && hasError && errorDisplayMode === "popup";
139
166
  const overlay = useAnchoredOverlay({
@@ -172,9 +199,9 @@ var FormItem = ({
172
199
  onlyChild.props.onBlur?.(event);
173
200
  handleBlur();
174
201
  },
175
- onChange: (event) => {
176
- onlyChild.props.onChange?.(event);
177
- handleChange();
202
+ onChange: (...args) => {
203
+ onlyChild.props.onChange?.(...args);
204
+ handleChange(args[0]);
178
205
  }
179
206
  };
180
207
  if (!isNativeElement) {
@@ -0,0 +1,72 @@
1
+ // src/components/Highlight.tsx
2
+ import React, { forwardRef, isValidElement } from "react";
3
+ import {
4
+ getHighlightMarkClasses,
5
+ getHighlightRootClasses,
6
+ getHighlightSegments,
7
+ resolveHighlightText
8
+ } from "@expcat/tigercat-core";
9
+ import { jsx } from "react/jsx-runtime";
10
+ function flattenReactText(node) {
11
+ if (node == null || typeof node === "boolean") return "";
12
+ if (typeof node === "string" || typeof node === "number") return String(node);
13
+ if (Array.isArray(node)) {
14
+ let out = "";
15
+ for (const item of node) out += flattenReactText(item);
16
+ return out;
17
+ }
18
+ if (isValidElement(node)) {
19
+ const props = node.props;
20
+ return flattenReactText(props.children);
21
+ }
22
+ return "";
23
+ }
24
+ var Highlight = forwardRef(
25
+ ({
26
+ text,
27
+ keywords,
28
+ caseSensitive = false,
29
+ global = true,
30
+ highlightClassName,
31
+ highlightStyle,
32
+ className,
33
+ style,
34
+ children,
35
+ ...rest
36
+ }, ref) => {
37
+ const source = resolveHighlightText(text, flattenReactText(children));
38
+ const segments = getHighlightSegments(source, keywords, { caseSensitive, global });
39
+ const markClasses = getHighlightMarkClasses(highlightClassName);
40
+ return /* @__PURE__ */ jsx(
41
+ "span",
42
+ {
43
+ ref,
44
+ "data-highlight": "",
45
+ "data-highlight-case-sensitive": caseSensitive ? "true" : "false",
46
+ "data-highlight-global": global ? "true" : "false",
47
+ className: getHighlightRootClasses(className),
48
+ style,
49
+ ...rest,
50
+ children: segments.map(
51
+ (segment) => segment.highlighted ? /* @__PURE__ */ jsx(
52
+ "mark",
53
+ {
54
+ className: markClasses,
55
+ style: highlightStyle,
56
+ "data-highlight-mark": "",
57
+ children: segment.text
58
+ },
59
+ `mark-${segment.start}-${segment.end}`
60
+ ) : /* @__PURE__ */ jsx(React.Fragment, { children: segment.text }, `text-${segment.start}-${segment.end}`)
61
+ )
62
+ }
63
+ );
64
+ }
65
+ );
66
+ Highlight.displayName = "Highlight";
67
+ var Highlight_default = Highlight;
68
+
69
+ export {
70
+ Highlight,
71
+ Highlight_default
72
+ };
@@ -7,6 +7,7 @@ import { useState, useMemo, useCallback } from "react";
7
7
  import {
8
8
  rateBaseClasses,
9
9
  getRateStarClasses,
10
+ rateHalfStarInnerClasses,
10
11
  rateActiveColor,
11
12
  rateInactiveColor,
12
13
  rateHoverColor,
@@ -126,7 +127,7 @@ var Rate = ({
126
127
  isHovering ? rateHoverColor : rateActiveColor
127
128
  ),
128
129
  style: { width: "50%" },
129
- children: isChar ? /* @__PURE__ */ jsx("span", { children: character }) : starIcon
130
+ children: isChar ? /* @__PURE__ */ jsx("span", { className: rateHalfStarInnerClasses, children: character }) : /* @__PURE__ */ jsx("svg", { viewBox: starViewBox, fill: "currentColor", className: rateHalfStarInnerClasses, children: /* @__PURE__ */ jsx("path", { d: starPathD }) })
130
131
  }
131
132
  )
132
133
  ] }) : /* @__PURE__ */ jsx("span", { className: colorClass, children: isChar ? /* @__PURE__ */ jsx("span", { children: character }) : starIcon });