@expcat/tigercat-react 1.3.4 → 1.4.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 (248) hide show
  1. package/dist/{chunk-3SV6J7I5.mjs → chunk-2L7QEOFD.mjs} +34 -25
  2. package/dist/{chunk-FNJDBFKM.mjs → chunk-2LYV6NBJ.mjs} +6 -1
  3. package/dist/{chunk-EEWHWEYO.js → chunk-2RBHQBSG.js} +2 -2
  4. package/dist/{chunk-Y5RQN5BO.mjs → chunk-376X7SDZ.mjs} +2 -2
  5. package/dist/{chunk-UXUYCWQC.js → chunk-3EDASNTG.js} +5 -5
  6. package/dist/{chunk-NPTXXUXF.mjs → chunk-3RBRWBUG.mjs} +9 -7
  7. package/dist/{chunk-PUZDW7NR.js → chunk-4AMSYFYC.js} +134 -20
  8. package/dist/{chunk-IG75YSX3.mjs → chunk-4MONGWU5.mjs} +4 -6
  9. package/dist/{chunk-3CJFNG54.mjs → chunk-56CTXEJS.mjs} +1 -1
  10. package/dist/{chunk-TMON4MPO.js → chunk-5ALMTE35.js} +9 -7
  11. package/dist/{chunk-MSHCPJIJ.mjs → chunk-6BOSSZM3.mjs} +8 -9
  12. package/dist/{chunk-SIY6FDKJ.js → chunk-7CHTTM6D.js} +339 -314
  13. package/dist/{chunk-RF2BA2N6.js → chunk-7PXALKLM.js} +4 -4
  14. package/dist/{chunk-DLKUDB2R.js → chunk-AF2AEZKM.js} +15 -3
  15. package/dist/{chunk-FB34UWF7.mjs → chunk-AVLIUHOS.mjs} +101 -40
  16. package/dist/{chunk-TSJYAEFZ.js → chunk-B63GEB2Y.js} +358 -305
  17. package/dist/{chunk-6I6X255M.js → chunk-BA6TJQZL.js} +12 -12
  18. package/dist/{chunk-LMTUM3J3.js → chunk-BEM7XG2L.js} +2 -4
  19. package/dist/{chunk-MB6U72CI.js → chunk-BEZO5IE4.js} +2 -2
  20. package/dist/{chunk-5OHVTGHS.mjs → chunk-BN4ZKCAI.mjs} +368 -315
  21. package/dist/{chunk-UHFHOTNI.js → chunk-BRA3PO53.js} +6 -7
  22. package/dist/{chunk-M7HBWFQO.js → chunk-BROIZ266.js} +11 -1
  23. package/dist/{chunk-SDZOVRVR.mjs → chunk-CAQPYJFA.mjs} +350 -325
  24. package/dist/{chunk-BFAZZUD6.js → chunk-CC5GFX6F.js} +5 -22
  25. package/dist/{chunk-LQT6ZGME.mjs → chunk-CME2IFUT.mjs} +15 -3
  26. package/dist/{chunk-KQ5I7PRM.js → chunk-CNNEUJR2.js} +28 -14
  27. package/dist/{chunk-EF5ZTNHX.js → chunk-D5MQBUP2.js} +16 -4
  28. package/dist/{chunk-RQXY2MGX.mjs → chunk-D7UR526A.mjs} +231 -184
  29. package/dist/{chunk-CBYJXDW4.js → chunk-DBMC6FPU.js} +16 -4
  30. package/dist/{chunk-WQ4FOHOU.mjs → chunk-DEIVWO2D.mjs} +3 -5
  31. package/dist/{chunk-7QZ4XT2P.mjs → chunk-DVEK5SO6.mjs} +3 -8
  32. package/dist/{chunk-TC6JLEGZ.js → chunk-EJKOUI26.js} +24 -7
  33. package/dist/{chunk-4GITZKAH.mjs → chunk-EPJ6W4VI.mjs} +14 -2
  34. package/dist/{chunk-KYP7U6FK.js → chunk-FZHBVHQ6.js} +34 -25
  35. package/dist/{chunk-WVVXZKNI.js → chunk-GDPU5MYA.js} +3 -8
  36. package/dist/{chunk-2GQCFTD7.mjs → chunk-H4MPPCTB.mjs} +23 -4
  37. package/dist/{chunk-YOAYDEWW.mjs → chunk-HHMYERHY.mjs} +3 -20
  38. package/dist/{chunk-LRPPXU74.mjs → chunk-I7FEGKX2.mjs} +19 -5
  39. package/dist/{chunk-F6IXIH6B.mjs → chunk-IZGXDHPB.mjs} +24 -5
  40. package/dist/{chunk-GQFVVAEF.js → chunk-J6OZWT3P.js} +5 -5
  41. package/dist/{chunk-IGAMV6ML.mjs → chunk-KDXKF6B2.mjs} +1 -1
  42. package/dist/{chunk-A42OLED6.mjs → chunk-KED5S2WG.mjs} +13 -2
  43. package/dist/{chunk-BJQIYELW.mjs → chunk-KGMVRIYC.mjs} +5 -5
  44. package/dist/{chunk-6GYT3EZD.mjs → chunk-KXT2TP6A.mjs} +3 -4
  45. package/dist/{chunk-BBLVRLXT.js → chunk-KYNWNTGO.js} +230 -146
  46. package/dist/{chunk-M73NMNZX.js → chunk-L24PPXLV.js} +17 -5
  47. package/dist/chunk-L3WPA2RP.js +25 -0
  48. package/dist/{chunk-V4JIZN3E.mjs → chunk-L6KSO66F.mjs} +4 -12
  49. package/dist/{chunk-4LX5UGPQ.js → chunk-LJRCEB7F.js} +168 -121
  50. package/dist/{chunk-F7H4ALKN.js → chunk-LZG24TDB.js} +8 -9
  51. package/dist/{chunk-ZYJTHGQW.js → chunk-M3FVPPMM.js} +9 -13
  52. package/dist/{chunk-GN3TSQWW.mjs → chunk-M6YXUNOU.mjs} +2 -2
  53. package/dist/{chunk-I373B74W.js → chunk-MC26ORSN.js} +102 -41
  54. package/dist/{chunk-5HFHHFQS.mjs → chunk-MTIGGMHG.mjs} +17 -5
  55. package/dist/{chunk-DKT2EYVM.mjs → chunk-MV2JQ6XQ.mjs} +3 -6
  56. package/dist/{chunk-HR5GBE3P.js → chunk-NDGA3N6H.js} +19 -7
  57. package/dist/{chunk-PU7KEYLP.mjs → chunk-NEZ445D4.mjs} +9 -9
  58. package/dist/{chunk-4U5HSR2H.js → chunk-NVI2P7VH.js} +3 -4
  59. package/dist/{chunk-NVEIVIAW.mjs → chunk-OFRKYQOZ.mjs} +133 -19
  60. package/dist/{chunk-AW5M3EL4.js → chunk-OS6M3IZF.js} +62 -12
  61. package/dist/{chunk-3ZNZLGQO.mjs → chunk-OXQOKKTP.mjs} +6 -7
  62. package/dist/{chunk-NMEVQPOD.js → chunk-PHAJXRGE.js} +2 -4
  63. package/dist/{chunk-WG3YS2QV.js → chunk-PT5T5F4H.js} +13 -2
  64. package/dist/{chunk-WNLUUD5N.mjs → chunk-QIL24WZD.mjs} +8 -12
  65. package/dist/{chunk-ZFMMAYSX.js → chunk-QLATA4UB.js} +4 -6
  66. package/dist/{chunk-2TZ3SBMU.mjs → chunk-RVLV63SI.mjs} +16 -11
  67. package/dist/{chunk-3QPCQH62.mjs → chunk-RYNLPRUM.mjs} +1 -1
  68. package/dist/{chunk-6GIJ7NFV.mjs → chunk-SDZKL3IB.mjs} +3 -5
  69. package/dist/{chunk-G5USITWF.js → chunk-SH4BZYXO.js} +27 -8
  70. package/dist/{chunk-L5AMVEQL.mjs → chunk-SLEXEH7R.mjs} +60 -10
  71. package/dist/{chunk-JLRRXRZO.js → chunk-SQONS5PH.js} +4 -7
  72. package/dist/chunk-SQTOVSDU.mjs +692 -0
  73. package/dist/{chunk-ITRYKHQJ.js → chunk-TEYL5X56.js} +19 -14
  74. package/dist/{chunk-KGSDDVRC.mjs → chunk-TNTOSFGN.mjs} +4 -4
  75. package/dist/{chunk-CY5GRTAX.js → chunk-UAM3RQY4.js} +24 -5
  76. package/dist/{chunk-XRNKHQTL.js → chunk-UEAXYZSE.js} +3 -2
  77. package/dist/{chunk-7ISEWLA3.js → chunk-UKQMF3JV.js} +21 -6
  78. package/dist/{chunk-ITVLIR7T.mjs → chunk-ULWT6W6M.mjs} +13 -20
  79. package/dist/{chunk-M5GSLKUX.mjs → chunk-VAIWWELW.mjs} +15 -3
  80. package/dist/{chunk-4SO4LANY.js → chunk-VC26SAXB.js} +340 -274
  81. package/dist/{chunk-SKMZTW3K.js → chunk-WCTNQYXO.js} +16 -23
  82. package/dist/{chunk-KXNWY2Q7.mjs → chunk-WFWEMXO7.mjs} +241 -157
  83. package/dist/chunk-WHYHLUXG.mjs +25 -0
  84. package/dist/{chunk-ONTRGV5T.js → chunk-WZUADPYB.js} +6 -14
  85. package/dist/{chunk-N4PP3ENO.js → chunk-XTQUPDRI.js} +2 -2
  86. package/dist/{chunk-XATXFVKR.mjs → chunk-Y7K27DVV.mjs} +4 -3
  87. package/dist/{chunk-WI4N5DD3.mjs → chunk-YH57D4AV.mjs} +16 -4
  88. package/dist/{chunk-3MRP3XYI.js → chunk-YRVAF2ID.js} +7 -2
  89. package/dist/{chunk-5XE5VBDS.mjs → chunk-YSGM22AH.mjs} +11 -1
  90. package/dist/{chunk-6TR7JB6C.js → chunk-ZDNQGS4O.js} +4 -4
  91. package/dist/{chunk-CHBUNQIJ.mjs → chunk-ZQSMJS2Q.mjs} +23 -6
  92. package/dist/{chunk-QQFLRNI3.mjs → chunk-ZRZB3C5J.mjs} +18 -3
  93. package/dist/components/ActivityFeed.js +4 -3
  94. package/dist/components/ActivityFeed.mjs +3 -2
  95. package/dist/components/Cascader.d.mts +3 -1
  96. package/dist/components/Cascader.d.ts +3 -1
  97. package/dist/components/Cascader.js +3 -2
  98. package/dist/components/Cascader.mjs +2 -1
  99. package/dist/components/ChatWindow.js +5 -5
  100. package/dist/components/ChatWindow.mjs +4 -4
  101. package/dist/components/Checkbox.js +4 -4
  102. package/dist/components/Checkbox.mjs +3 -3
  103. package/dist/components/CheckboxGroup.js +3 -3
  104. package/dist/components/CheckboxGroup.mjs +2 -2
  105. package/dist/components/CommentThread.js +4 -4
  106. package/dist/components/CommentThread.mjs +3 -3
  107. package/dist/components/CropUpload.js +4 -4
  108. package/dist/components/CropUpload.mjs +3 -3
  109. package/dist/components/DataTableWithToolbar.d.mts +2 -2
  110. package/dist/components/DataTableWithToolbar.d.ts +2 -2
  111. package/dist/components/DataTableWithToolbar.js +11 -11
  112. package/dist/components/DataTableWithToolbar.mjs +10 -10
  113. package/dist/components/DatePicker.d.mts +1 -0
  114. package/dist/components/DatePicker.d.ts +1 -0
  115. package/dist/components/DatePicker.js +3 -2
  116. package/dist/components/DatePicker.mjs +2 -1
  117. package/dist/components/Drawer.js +3 -3
  118. package/dist/components/Drawer.mjs +2 -2
  119. package/dist/components/FileManager.d.mts +2 -1
  120. package/dist/components/FileManager.d.ts +2 -1
  121. package/dist/components/FileManager.js +3 -2
  122. package/dist/components/FileManager.mjs +2 -1
  123. package/dist/components/Form.js +3 -2
  124. package/dist/components/Form.mjs +2 -1
  125. package/dist/components/FormItem.js +4 -3
  126. package/dist/components/FormItem.mjs +3 -2
  127. package/dist/components/FormWizard.js +4 -4
  128. package/dist/components/FormWizard.mjs +3 -3
  129. package/dist/components/Image.js +4 -4
  130. package/dist/components/Image.mjs +3 -3
  131. package/dist/components/ImageGroup.js +3 -3
  132. package/dist/components/ImageGroup.mjs +2 -2
  133. package/dist/components/ImagePreview.js +2 -2
  134. package/dist/components/ImagePreview.mjs +1 -1
  135. package/dist/components/ImageViewer.d.mts +1 -1
  136. package/dist/components/ImageViewer.d.ts +1 -1
  137. package/dist/components/ImageViewer.js +2 -2
  138. package/dist/components/ImageViewer.mjs +1 -1
  139. package/dist/components/InfiniteScroll.d.mts +2 -0
  140. package/dist/components/InfiniteScroll.d.ts +2 -0
  141. package/dist/components/InfiniteScroll.js +3 -2
  142. package/dist/components/InfiniteScroll.mjs +2 -1
  143. package/dist/components/Input.js +3 -2
  144. package/dist/components/Input.mjs +2 -1
  145. package/dist/components/InputNumber.js +3 -2
  146. package/dist/components/InputNumber.mjs +2 -1
  147. package/dist/components/List.d.mts +6 -2
  148. package/dist/components/List.d.ts +6 -2
  149. package/dist/components/List.js +3 -2
  150. package/dist/components/List.mjs +2 -1
  151. package/dist/components/Loading.js +3 -2
  152. package/dist/components/Loading.mjs +2 -1
  153. package/dist/components/MarkdownEditor.js +3 -3
  154. package/dist/components/MarkdownEditor.mjs +2 -2
  155. package/dist/components/Mentions.js +2 -2
  156. package/dist/components/Mentions.mjs +1 -1
  157. package/dist/components/Menu.d.mts +8 -80
  158. package/dist/components/Menu.d.ts +8 -80
  159. package/dist/components/Menu.js +2 -2
  160. package/dist/components/Menu.mjs +1 -1
  161. package/dist/components/MenuItem.d.mts +6 -2
  162. package/dist/components/MenuItem.d.ts +6 -2
  163. package/dist/components/MenuItem.js +2 -2
  164. package/dist/components/MenuItem.mjs +1 -1
  165. package/dist/components/MenuItemGroup.d.mts +6 -2
  166. package/dist/components/MenuItemGroup.d.ts +6 -2
  167. package/dist/components/MenuItemGroup.js +2 -2
  168. package/dist/components/MenuItemGroup.mjs +1 -1
  169. package/dist/components/Message.js +2 -2
  170. package/dist/components/Message.mjs +1 -1
  171. package/dist/components/Modal.js +3 -3
  172. package/dist/components/Modal.mjs +2 -2
  173. package/dist/components/Notification.js +2 -2
  174. package/dist/components/Notification.mjs +1 -1
  175. package/dist/components/NotificationCenter.js +5 -4
  176. package/dist/components/NotificationCenter.mjs +4 -3
  177. package/dist/components/NumberKeyboard.js +3 -2
  178. package/dist/components/NumberKeyboard.mjs +2 -1
  179. package/dist/components/Radio.js +4 -4
  180. package/dist/components/Radio.mjs +3 -3
  181. package/dist/components/RadioGroup.js +3 -3
  182. package/dist/components/RadioGroup.mjs +2 -2
  183. package/dist/components/RichTextEditor.js +3 -3
  184. package/dist/components/RichTextEditor.mjs +2 -2
  185. package/dist/components/Select.d.mts +3 -1
  186. package/dist/components/Select.d.ts +3 -1
  187. package/dist/components/Select.js +3 -2
  188. package/dist/components/Select.mjs +2 -1
  189. package/dist/components/Signature.d.mts +1 -0
  190. package/dist/components/Signature.d.ts +1 -0
  191. package/dist/components/Signature.js +3 -2
  192. package/dist/components/Signature.mjs +2 -1
  193. package/dist/components/Spotlight.js +4 -2
  194. package/dist/components/Spotlight.mjs +3 -1
  195. package/dist/components/Steps.js +2 -2
  196. package/dist/components/Steps.mjs +1 -1
  197. package/dist/components/StepsItem.js +2 -2
  198. package/dist/components/StepsItem.mjs +1 -1
  199. package/dist/components/SubMenu.d.mts +6 -2
  200. package/dist/components/SubMenu.d.ts +6 -2
  201. package/dist/components/SubMenu.js +2 -2
  202. package/dist/components/SubMenu.mjs +1 -1
  203. package/dist/components/Table.d.mts +2 -2
  204. package/dist/components/Table.d.ts +2 -2
  205. package/dist/components/Table.js +9 -9
  206. package/dist/components/Table.mjs +8 -8
  207. package/dist/components/Textarea.js +3 -3
  208. package/dist/components/Textarea.mjs +2 -2
  209. package/dist/components/TimePicker.d.mts +1 -0
  210. package/dist/components/TimePicker.d.ts +1 -0
  211. package/dist/components/TimePicker.js +4 -2
  212. package/dist/components/TimePicker.mjs +3 -1
  213. package/dist/components/Tour.js +3 -2
  214. package/dist/components/Tour.mjs +2 -1
  215. package/dist/components/Transfer.d.mts +3 -1
  216. package/dist/components/Transfer.d.ts +3 -1
  217. package/dist/components/Transfer.js +3 -2
  218. package/dist/components/Transfer.mjs +2 -1
  219. package/dist/components/Tree.d.mts +3 -1
  220. package/dist/components/Tree.d.ts +3 -1
  221. package/dist/components/Tree.js +3 -2
  222. package/dist/components/Tree.mjs +2 -1
  223. package/dist/components/TreeSelect.d.mts +3 -1
  224. package/dist/components/TreeSelect.d.ts +3 -1
  225. package/dist/components/TreeSelect.js +3 -2
  226. package/dist/components/TreeSelect.mjs +2 -1
  227. package/dist/components/Upload.js +3 -2
  228. package/dist/components/Upload.mjs +2 -1
  229. package/dist/components/VirtualTable.d.mts +3 -2
  230. package/dist/components/VirtualTable.d.ts +3 -2
  231. package/dist/components/VirtualTable.js +3 -2
  232. package/dist/components/VirtualTable.mjs +2 -1
  233. package/dist/index.d.mts +33 -7
  234. package/dist/index.d.ts +33 -7
  235. package/dist/index.js +54 -54
  236. package/dist/index.mjs +53 -53
  237. package/dist/{types-CHmCMNEM.d.mts → types-0oVwMXtR.d.mts} +1 -1
  238. package/dist/{types-CHmCMNEM.d.ts → types-0oVwMXtR.d.ts} +1 -1
  239. package/dist/types-DaC4a0Ny.d.mts +80 -0
  240. package/dist/types-DaC4a0Ny.d.ts +80 -0
  241. package/package.json +2 -2
  242. package/dist/chunk-UKGQ7256.js +0 -12
  243. package/dist/chunk-UQMPEMY7.mjs +0 -12
  244. package/dist/chunk-VNVGSPBI.mjs +0 -626
  245. package/dist/{chunk-OZD75CLT.js → chunk-ANBNSUSR.js} +3 -3
  246. package/dist/{chunk-I2AUOICV.mjs → chunk-M3MOSUZO.mjs} +3 -3
  247. package/dist/{chunk-UMZ3PMUJ.js → chunk-SXHCMZ6U.js} +2 -2
  248. package/dist/{chunk-BWDQZSAB.mjs → chunk-WTSG7QXK.mjs} +3 -3
@@ -1,9 +1,15 @@
1
+ import {
2
+ useControlledState
3
+ } from "./chunk-WHYHLUXG.mjs";
1
4
  import {
2
5
  renderBodyPortal,
3
6
  useBodyScrollLock,
4
7
  useEscapeKey,
5
8
  useFocusTrap
6
9
  } from "./chunk-SEWNVIHH.mjs";
10
+ import {
11
+ useTigerConfig
12
+ } from "./chunk-QAIBQHIO.mjs";
7
13
 
8
14
  // src/components/Spotlight.tsx
9
15
  import React, { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
@@ -20,6 +26,8 @@ import {
20
26
  getSpotlightOptionClasses,
21
27
  getSpotlightSearchState,
22
28
  getSpotlightShortcutLabel,
29
+ mergeTigerLocale,
30
+ resolveLocaleText,
23
31
  restoreFocus,
24
32
  shouldCloseOnMaskClick,
25
33
  spotlightEmptyClasses,
@@ -49,8 +57,9 @@ var Spotlight = ({
49
57
  defaultQuery = "",
50
58
  items = EMPTY_ITEMS,
51
59
  title = "Spotlight",
52
- placeholder = "Search",
53
- emptyText = "No results found",
60
+ placeholder,
61
+ emptyText,
62
+ locale,
54
63
  inputAriaLabel,
55
64
  listboxLabel,
56
65
  closeOnSelect = true,
@@ -67,13 +76,27 @@ var Spotlight = ({
67
76
  style,
68
77
  ...rest
69
78
  }) => {
70
- const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
71
- const [uncontrolledQuery, setUncontrolledQuery] = useState(defaultQuery);
79
+ const config = useTigerConfig();
80
+ const mergedLocale = useMemo(
81
+ () => mergeTigerLocale(config.locale, locale),
82
+ [config.locale, locale]
83
+ );
84
+ const placeholderText = resolveLocaleText(
85
+ "Search",
86
+ placeholder,
87
+ mergedLocale?.common?.searchPlaceholder
88
+ );
89
+ const [resolvedOpen, setOpenValue] = useControlledState(
90
+ open,
91
+ defaultOpen ?? false,
92
+ onOpenChange
93
+ );
94
+ const [resolvedQuery, setQueryValue] = useControlledState(
95
+ query,
96
+ defaultQuery ?? "",
97
+ onQueryChange
98
+ );
72
99
  const [activeIndex, setActiveIndex] = useState(-1);
73
- const isOpenControlled = open !== void 0;
74
- const isQueryControlled = query !== void 0;
75
- const resolvedOpen = isOpenControlled ? Boolean(open) : uncontrolledOpen;
76
- const resolvedQuery = isQueryControlled ? String(query) : uncontrolledQuery;
77
100
  const reactId = useId();
78
101
  const dialogId = `tiger-spotlight-${reactId}`;
79
102
  const titleId = `${dialogId}-title`;
@@ -85,20 +108,6 @@ var Spotlight = ({
85
108
  () => getSpotlightSearchState(items, resolvedQuery, { filterItem, limit }),
86
109
  [items, resolvedQuery, filterItem, limit]
87
110
  );
88
- const setOpenValue = useCallback(
89
- (nextOpen) => {
90
- if (!isOpenControlled) setUncontrolledOpen(nextOpen);
91
- onOpenChange?.(nextOpen);
92
- },
93
- [isOpenControlled, onOpenChange]
94
- );
95
- const setQueryValue = useCallback(
96
- (nextQuery) => {
97
- if (!isQueryControlled) setUncontrolledQuery(nextQuery);
98
- onQueryChange?.(nextQuery);
99
- },
100
- [isQueryControlled, onQueryChange]
101
- );
102
111
  const closeSpotlight = useCallback(() => {
103
112
  setOpenValue(false);
104
113
  }, [setOpenValue]);
@@ -200,8 +209,8 @@ var Spotlight = ({
200
209
  value: resolvedQuery,
201
210
  type: "search",
202
211
  className: spotlightInputClasses,
203
- placeholder,
204
- "aria-label": inputAriaLabel ?? placeholder,
212
+ placeholder: placeholderText,
213
+ "aria-label": inputAriaLabel ?? placeholderText,
205
214
  autoComplete: "off",
206
215
  ...getPickerComboboxAria({
207
216
  expanded: true,
@@ -256,7 +265,7 @@ var Spotlight = ({
256
265
  group.label ?? `group-${groupIndex}`
257
266
  ))
258
267
  }
259
- ) : /* @__PURE__ */ jsx("div", { className: spotlightEmptyClasses, children: emptyText })
268
+ ) : /* @__PURE__ */ jsx("div", { className: spotlightEmptyClasses, children: resolveLocaleText("No results found", emptyText, mergedLocale?.common?.emptyText) })
260
269
  ]
261
270
  }
262
271
  )
@@ -2,11 +2,15 @@ import {
2
2
  renderBodyPortal,
3
3
  useBodyScrollLock
4
4
  } from "./chunk-SEWNVIHH.mjs";
5
+ import {
6
+ useTigerConfig
7
+ } from "./chunk-QAIBQHIO.mjs";
5
8
 
6
9
  // src/components/Loading.tsx
7
10
  import { useEffect, useState, useMemo } from "react";
8
11
  import {
9
12
  classNames,
13
+ resolveLocaleText,
10
14
  getLoadingBarClasses,
11
15
  getLoadingBarsWrapperClasses,
12
16
  getLoadingClasses,
@@ -34,6 +38,7 @@ var Loading = ({
34
38
  style,
35
39
  ...props
36
40
  }) => {
41
+ const config = useTigerConfig();
37
42
  const [visible, setVisible] = useState(delay <= 0);
38
43
  useEffect(() => {
39
44
  injectLoadingAnimationStyles();
@@ -116,7 +121,7 @@ var Loading = ({
116
121
  className: containerClasses,
117
122
  style: mergedStyle,
118
123
  role: "status",
119
- "aria-label": text || "Loading",
124
+ "aria-label": text || resolveLocaleText("Loading", config.locale?.common?.loadingText),
120
125
  "aria-live": "polite",
121
126
  "aria-busy": true,
122
127
  ...props,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkOZD75CLTjs = require('./chunk-OZD75CLT.js');
3
+ var _chunkANBNSUSRjs = require('./chunk-ANBNSUSR.js');
4
4
 
5
5
 
6
6
  var _chunkFI53LYZ6js = require('./chunk-FI53LYZ6.js');
@@ -140,7 +140,7 @@ var CropUpload = ({
140
140
  }
141
141
  ),
142
142
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
143
- _chunkOZD75CLTjs.Modal,
143
+ _chunkANBNSUSRjs.Modal,
144
144
  {
145
145
  open: modalVisible,
146
146
  size: "lg",
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-7DUHHRAU.mjs";
4
4
  import {
5
5
  Input
6
- } from "./chunk-WNLUUD5N.mjs";
6
+ } from "./chunk-QIL24WZD.mjs";
7
7
  import {
8
8
  Empty
9
9
  } from "./chunk-WIWTY74F.mjs";
10
10
  import {
11
11
  Textarea
12
- } from "./chunk-7QZ4XT2P.mjs";
12
+ } from "./chunk-DVEK5SO6.mjs";
13
13
  import {
14
14
  Button
15
15
  } from "./chunk-5TE7KLE5.mjs";
@@ -53,7 +53,7 @@ var ImageViewer = ({
53
53
  className,
54
54
  onOpenChange,
55
55
  onClose,
56
- onIndexChange
56
+ onCurrentIndexChange
57
57
  }) => {
58
58
  const [index, setIndex] = _react.useState.call(void 0, currentIndex);
59
59
  const [transform, setTransform] = _react.useState.call(void 0, _tigercatcore.createDefaultTransform);
@@ -75,14 +75,14 @@ var ImageViewer = ({
75
75
  const newIndex = (index - 1 + images.length) % images.length;
76
76
  setIndex(newIndex);
77
77
  resetTransform();
78
- _optionalChain([onIndexChange, 'optionalCall', _3 => _3(newIndex)]);
79
- }, [index, images.length, onIndexChange, resetTransform]);
78
+ _optionalChain([onCurrentIndexChange, 'optionalCall', _3 => _3(newIndex)]);
79
+ }, [index, images.length, onCurrentIndexChange, resetTransform]);
80
80
  const handleNext = _react.useCallback.call(void 0, () => {
81
81
  const newIndex = (index + 1) % images.length;
82
82
  setIndex(newIndex);
83
83
  resetTransform();
84
- _optionalChain([onIndexChange, 'optionalCall', _4 => _4(newIndex)]);
85
- }, [index, images.length, onIndexChange, resetTransform]);
84
+ _optionalChain([onCurrentIndexChange, 'optionalCall', _4 => _4(newIndex)]);
85
+ }, [index, images.length, onCurrentIndexChange, resetTransform]);
86
86
  _react.useEffect.call(void 0, () => {
87
87
  if (!open) return;
88
88
  const handler = (e) => {
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  RadioGroupContext
3
- } from "./chunk-IG75YSX3.mjs";
3
+ } from "./chunk-4MONGWU5.mjs";
4
+ import {
5
+ useControlledState
6
+ } from "./chunk-WHYHLUXG.mjs";
4
7
 
5
8
  // src/components/Radio.tsx
6
- import { useContext, useMemo, useState } from "react";
9
+ import { useContext, useMemo } from "react";
7
10
  import {
8
11
  classNames,
9
12
  getRadioDotClasses,
@@ -27,13 +30,12 @@ var Radio = ({
27
30
  ...props
28
31
  }) => {
29
32
  const groupContext = useContext(RadioGroupContext);
30
- const [internalChecked, setInternalChecked] = useState(defaultChecked);
31
- const isCheckedControlled = checked !== void 0;
33
+ const [checkedState, setChecked] = useControlledState(checked, defaultChecked);
32
34
  const isInGroup = !!groupContext;
33
35
  const actualSize = size || groupContext?.size || "md";
34
36
  const actualDisabled = disabled !== void 0 ? disabled : groupContext?.disabled || false;
35
37
  const actualName = name || groupContext?.name || "";
36
- const isChecked = checked !== void 0 ? checked : groupContext?.value !== void 0 ? groupContext.value === value : internalChecked;
38
+ const isChecked = checked === void 0 && groupContext?.value !== void 0 ? groupContext.value === value : checkedState;
37
39
  const radioClasses = useMemo(
38
40
  () => getRadioVisualClasses({
39
41
  size: actualSize,
@@ -66,8 +68,8 @@ var Radio = ({
66
68
  }
67
69
  const newChecked = event.target.checked;
68
70
  if (!newChecked) return;
69
- if (!isCheckedControlled && !isInGroup) {
70
- setInternalChecked(true);
71
+ if (!isInGroup) {
72
+ setChecked(true);
71
73
  }
72
74
  onChange?.(value);
73
75
  groupContext?.onChange?.(value);
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkWVVXZKNIjs = require('./chunk-WVVXZKNI.js');
3
+ var _chunkGDPU5MYAjs = require('./chunk-GDPU5MYA.js');
4
4
 
5
5
 
6
6
  var _chunkZLNBE4ISjs = require('./chunk-ZLNBE4IS.js');
@@ -99,13 +99,14 @@ var CommentThread = ({
99
99
  const ACTION_BTN = `${BTN_BASE} text-gray-500 dark:text-gray-400 font-medium flex items-center gap-1.5`;
100
100
  const PRIMARY_BTN = `${BTN_BASE} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] dark:text-blue-400 dark:hover:text-blue-300 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10`;
101
101
  const renderNode = (node, depth, isLast) => {
102
- const hasChildren = !!node.children && node.children.length > 0;
102
+ const children = _nullishCoalesce(node.children, () => ( []));
103
+ const hasChildren = children.length > 0;
103
104
  const isExpanded = expandedSet.has(node.id);
104
105
  const showReplies = hasChildren && isExpanded;
105
106
  const showAllReplies = expandedAllKeys.has(node.id);
106
107
  const repliesId = `tiger-comment-replies-${node.id}`;
107
- const visibleChildren = showReplies ? maxReplies > 0 && !showAllReplies ? node.children.slice(0, maxReplies) : node.children : [];
108
- const showLoadMoreBtn = showReplies && maxReplies > 0 && node.children.length > maxReplies && !showAllReplies;
108
+ const visibleChildren = showReplies ? maxReplies > 0 && !showAllReplies ? children.slice(0, maxReplies) : children : [];
109
+ const showLoadMoreBtn = showReplies && maxReplies > 0 && children.length > maxReplies && !showAllReplies;
109
110
  const actions = [];
110
111
  if (showLike) {
111
112
  const likeLabel = node.liked ? likedText : likeText;
@@ -123,7 +124,25 @@ var CommentThread = ({
123
124
  ),
124
125
  onClick: () => _optionalChain([onLike, 'optionalCall', _4 => _4(node, !node.liked)]),
125
126
  children: [
126
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: _tigercatcore.classNames.call(void 0, "w-3.5 h-3.5 transition-transform duration-200 active:scale-125", node.liked ? "fill-current" : "stroke-current fill-none"), viewBox: "0 0 24 24", strokeWidth: "2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.421.068.848.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 010-7.764c.26-.85.1083-1.368 1.972-1.368h.908c.445 0 .72.498.523.898a8.963 8.963 0 00-.27.602" }) }),
127
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
128
+ "svg",
129
+ {
130
+ className: _tigercatcore.classNames.call(void 0,
131
+ "w-3.5 h-3.5 transition-transform duration-200 active:scale-125",
132
+ node.liked ? "fill-current" : "stroke-current fill-none"
133
+ ),
134
+ viewBox: "0 0 24 24",
135
+ strokeWidth: "2",
136
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
137
+ "path",
138
+ {
139
+ strokeLinecap: "round",
140
+ strokeLinejoin: "round",
141
+ d: "M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.421.068.848.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 010-7.764c.26-.85.1083-1.368 1.972-1.368h.908c.445 0 .72.498.523.898a8.963 8.963 0 00-.27.602"
142
+ }
143
+ )
144
+ }
145
+ ),
127
146
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: `${likeLabel}${likeCount}` })
128
147
  ]
129
148
  },
@@ -147,7 +166,24 @@ var CommentThread = ({
147
166
  setReplyValue("");
148
167
  },
149
168
  children: [
150
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
169
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
170
+ "svg",
171
+ {
172
+ className: "w-3.5 h-3.5",
173
+ viewBox: "0 0 24 24",
174
+ fill: "none",
175
+ stroke: "currentColor",
176
+ strokeWidth: "2",
177
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
178
+ "path",
179
+ {
180
+ strokeLinecap: "round",
181
+ strokeLinejoin: "round",
182
+ d: "M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
183
+ }
184
+ )
185
+ }
186
+ ),
151
187
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: replyText })
152
188
  ]
153
189
  },
@@ -168,7 +204,24 @@ var CommentThread = ({
168
204
  ),
169
205
  onClick: () => _optionalChain([onMore, 'optionalCall', _5 => _5(node)]),
170
206
  children: [
171
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" }) }),
207
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
208
+ "svg",
209
+ {
210
+ className: "w-3.5 h-3.5",
211
+ viewBox: "0 0 24 24",
212
+ fill: "none",
213
+ stroke: "currentColor",
214
+ strokeWidth: "2",
215
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
216
+ "path",
217
+ {
218
+ strokeLinecap: "round",
219
+ strokeLinejoin: "round",
220
+ d: "M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"
221
+ }
222
+ )
223
+ }
224
+ ),
172
225
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: moreText })
173
226
  ]
174
227
  },
@@ -185,10 +238,7 @@ var CommentThread = ({
185
238
  {
186
239
  size: "sm",
187
240
  variant: _nullishCoalesce(action.variant, () => ( "ghost")),
188
- className: _tigercatcore.classNames.call(void 0,
189
- ACTION_BTN,
190
- "hover:bg-gray-100 dark:hover:bg-gray-800"
191
- ),
241
+ className: _tigercatcore.classNames.call(void 0, ACTION_BTN, "hover:bg-gray-100 dark:hover:bg-gray-800"),
192
242
  disabled: action.disabled,
193
243
  onClick: () => {
194
244
  _optionalChain([action, 'access', _6 => _6.onClick, 'optionalCall', _7 => _7(node, action)]);
@@ -221,17 +271,61 @@ var CommentThread = ({
221
271
  ) : null,
222
272
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 min-w-0", children: [
223
273
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 flex-wrap", children: [
224
- _optionalChain([node, 'access', _9 => _9.user, 'optionalAccess', _10 => _10.name]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUF3DXKCIjs.Text, { tag: "span", size: "sm", weight: "bold", className: "text-gray-900 dark:text-gray-100 hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-pointer", children: node.user.name }) : null,
225
- _optionalChain([node, 'access', _11 => _11.user, 'optionalAccess', _12 => _12.title]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUF3DXKCIjs.Text, { tag: "span", size: "xs", color: "muted", className: "bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-gray-500 dark:text-gray-400 font-medium", children: node.user.title }) : null,
226
- node.tag ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZJI2VLILjs.Tag, { size: "sm", variant: _nullishCoalesce(node.tag.variant, () => ( "default")), className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10", children: node.tag.label }) : null,
227
- _optionalChain([node, 'access', _13 => _13.tags, 'optionalAccess', _14 => _14.map, 'call', _15 => _15((tag, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZJI2VLILjs.Tag, { size: "sm", variant: _nullishCoalesce(tag.variant, () => ( "default")), className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10", children: tag.label }, `${node.id}-tag-${index}`))]),
228
- node.time ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUF3DXKCIjs.Text, { tag: "span", size: "xs", color: "muted", className: "ml-auto text-gray-400 dark:text-gray-500 font-normal", children: _tigercatcore.formatCommentTime.call(void 0, node.time) }) : null
274
+ _optionalChain([node, 'access', _9 => _9.user, 'optionalAccess', _10 => _10.name]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
275
+ _chunkUF3DXKCIjs.Text,
276
+ {
277
+ tag: "span",
278
+ size: "sm",
279
+ weight: "bold",
280
+ className: "text-gray-900 dark:text-gray-100 hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-pointer",
281
+ children: node.user.name
282
+ }
283
+ ) : null,
284
+ _optionalChain([node, 'access', _11 => _11.user, 'optionalAccess', _12 => _12.title]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
285
+ _chunkUF3DXKCIjs.Text,
286
+ {
287
+ tag: "span",
288
+ size: "xs",
289
+ color: "muted",
290
+ className: "bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-gray-500 dark:text-gray-400 font-medium",
291
+ children: node.user.title
292
+ }
293
+ ) : null,
294
+ node.tag ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
295
+ _chunkZJI2VLILjs.Tag,
296
+ {
297
+ size: "sm",
298
+ variant: _nullishCoalesce(node.tag.variant, () => ( "default")),
299
+ className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10",
300
+ children: node.tag.label
301
+ }
302
+ ) : null,
303
+ _optionalChain([node, 'access', _13 => _13.tags, 'optionalAccess', _14 => _14.map, 'call', _15 => _15((tag, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
304
+ _chunkZJI2VLILjs.Tag,
305
+ {
306
+ size: "sm",
307
+ variant: _nullishCoalesce(tag.variant, () => ( "default")),
308
+ className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10",
309
+ children: tag.label
310
+ },
311
+ `${node.id}-tag-${index}`
312
+ ))]),
313
+ node.time ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
314
+ _chunkUF3DXKCIjs.Text,
315
+ {
316
+ tag: "span",
317
+ size: "xs",
318
+ color: "muted",
319
+ className: "ml-auto text-gray-400 dark:text-gray-500 font-normal",
320
+ children: _tigercatcore.formatCommentTime.call(void 0, node.time)
321
+ }
322
+ ) : null
229
323
  ] }),
230
324
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-gray-600 dark:text-gray-300 leading-relaxed break-words mt-2 mb-3 pr-2", children: node.content }),
231
325
  actions.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap items-center gap-1.5", children: actions }) : null,
232
326
  replyingTo === node.id ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-3 space-y-3 bg-gray-50/50 dark:bg-gray-900/30 border border-gray-100 dark:border-gray-800/80 p-4 rounded-xl shadow-sm backdrop-blur-sm transition-all duration-300", children: [
233
327
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
234
- _chunkWVVXZKNIjs.Textarea,
328
+ _chunkGDPU5MYAjs.Textarea,
235
329
  {
236
330
  rows: 3,
237
331
  value: replyValue,
@@ -271,11 +365,14 @@ var CommentThread = ({
271
365
  {
272
366
  size: "sm",
273
367
  variant: "ghost",
274
- className: _tigercatcore.classNames.call(void 0, "mt-2 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10 transition-colors", PRIMARY_BTN),
368
+ className: _tigercatcore.classNames.call(void 0,
369
+ "mt-2 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10 transition-colors",
370
+ PRIMARY_BTN
371
+ ),
275
372
  "aria-expanded": isExpanded,
276
373
  "aria-controls": repliesId,
277
374
  onClick: () => toggleExpanded(node.id),
278
- children: isExpanded ? "\u25BE \u6536\u8D77\u56DE\u590D" : `\u25B8 \u5C55\u5F00 ${node.children.length} \u6761\u56DE\u590D`
375
+ children: isExpanded ? "\u25BE \u6536\u8D77\u56DE\u590D" : `\u25B8 \u5C55\u5F00 ${children.length} \u6761\u56DE\u590D`
279
376
  }
280
377
  ) : null,
281
378
  showReplies ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -315,7 +412,24 @@ var CommentThread = ({
315
412
  "aria-label": _nullishCoalesce(divProps["aria-label"], () => ( (divProps["aria-labelledby"] ? void 0 : "\u8BC4\u8BBA\u7EBF\u7A0B"))),
316
413
  ...divProps,
317
414
  children: resolvedNodes.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center border border-dashed border-gray-200 dark:border-gray-800/80 rounded-xl py-12 px-4 bg-gray-50/20 dark:bg-gray-900/5 transition-colors", children: [
318
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-10 h-10 text-gray-300 dark:text-gray-600 mb-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
415
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
416
+ "svg",
417
+ {
418
+ className: "w-10 h-10 text-gray-300 dark:text-gray-600 mb-3",
419
+ fill: "none",
420
+ viewBox: "0 0 24 24",
421
+ stroke: "currentColor",
422
+ strokeWidth: "1.5",
423
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
424
+ "path",
425
+ {
426
+ strokeLinecap: "round",
427
+ strokeLinejoin: "round",
428
+ d: "M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
429
+ }
430
+ )
431
+ }
432
+ ),
319
433
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUF3DXKCIjs.Text, { tag: "div", size: "sm", color: "muted", className: "font-medium", children: emptyText })
320
434
  ] }) : resolvedNodes.map((node, index) => renderNode(node, 1, index === resolvedNodes.length - 1))
321
435
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useControlledState
3
- } from "./chunk-UQMPEMY7.mjs";
3
+ } from "./chunk-WHYHLUXG.mjs";
4
4
 
5
5
  // src/components/RadioGroup.tsx
6
6
  import React, { useCallback, useMemo, useRef } from "react";
@@ -18,7 +18,7 @@ var RadioGroup = ({
18
18
  className,
19
19
  ...props
20
20
  }) => {
21
- const [currentValue, setInternalValue, isControlled] = useControlledState(value, defaultValue);
21
+ const [currentValue, setValue] = useControlledState(value, defaultValue);
22
22
  const generatedNameRef = useRef(
23
23
  `tiger-radio-group-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`
24
24
  );
@@ -26,12 +26,10 @@ var RadioGroup = ({
26
26
  const handleChange = useCallback(
27
27
  (newValue) => {
28
28
  if (disabled) return;
29
- if (!isControlled) {
30
- setInternalValue(newValue);
31
- }
29
+ setValue(newValue);
32
30
  onChange?.(newValue);
33
31
  },
34
- [disabled, isControlled, setInternalValue, onChange]
32
+ [disabled, setValue, onChange]
35
33
  );
36
34
  const handleKeyDown = (event) => {
37
35
  if (disabled) return;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Modal
3
- } from "./chunk-I2AUOICV.mjs";
3
+ } from "./chunk-M3MOSUZO.mjs";
4
4
  import {
5
5
  ImageCropper
6
6
  } from "./chunk-SY23FAXK.mjs";
@@ -1,6 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkZFMMAYSXjs = require('./chunk-ZFMMAYSX.js');
3
+ var _chunkQLATA4UBjs = require('./chunk-QLATA4UB.js');
4
+
5
+
6
+ var _chunkL3WPA2RPjs = require('./chunk-L3WPA2RP.js');
4
7
 
5
8
  // src/components/Radio.tsx
6
9
  var _react = require('react');
@@ -26,14 +29,13 @@ var Radio = ({
26
29
  style,
27
30
  ...props
28
31
  }) => {
29
- const groupContext = _react.useContext.call(void 0, _chunkZFMMAYSXjs.RadioGroupContext);
30
- const [internalChecked, setInternalChecked] = _react.useState.call(void 0, defaultChecked);
31
- const isCheckedControlled = checked !== void 0;
32
+ const groupContext = _react.useContext.call(void 0, _chunkQLATA4UBjs.RadioGroupContext);
33
+ const [checkedState, setChecked] = _chunkL3WPA2RPjs.useControlledState.call(void 0, checked, defaultChecked);
32
34
  const isInGroup = !!groupContext;
33
35
  const actualSize = size || _optionalChain([groupContext, 'optionalAccess', _ => _.size]) || "md";
34
36
  const actualDisabled = disabled !== void 0 ? disabled : _optionalChain([groupContext, 'optionalAccess', _2 => _2.disabled]) || false;
35
37
  const actualName = name || _optionalChain([groupContext, 'optionalAccess', _3 => _3.name]) || "";
36
- const isChecked = checked !== void 0 ? checked : _optionalChain([groupContext, 'optionalAccess', _4 => _4.value]) !== void 0 ? groupContext.value === value : internalChecked;
38
+ const isChecked = checked === void 0 && _optionalChain([groupContext, 'optionalAccess', _4 => _4.value]) !== void 0 ? groupContext.value === value : checkedState;
37
39
  const radioClasses = _react.useMemo.call(void 0,
38
40
  () => _tigercatcore.getRadioVisualClasses.call(void 0, {
39
41
  size: actualSize,
@@ -66,8 +68,8 @@ var Radio = ({
66
68
  }
67
69
  const newChecked = event.target.checked;
68
70
  if (!newChecked) return;
69
- if (!isCheckedControlled && !isInGroup) {
70
- setInternalChecked(true);
71
+ if (!isInGroup) {
72
+ setChecked(true);
71
73
  }
72
74
  _optionalChain([onChange, 'optionalCall', _5 => _5(value)]);
73
75
  _optionalChain([groupContext, 'optionalAccess', _6 => _6.onChange, 'optionalCall', _7 => _7(value)]);
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  useCheckboxGroup
3
- } from "./chunk-DKT2EYVM.mjs";
3
+ } from "./chunk-MV2JQ6XQ.mjs";
4
+ import {
5
+ useControlledState
6
+ } from "./chunk-WHYHLUXG.mjs";
4
7
 
5
8
  // src/components/Checkbox.tsx
6
- import { useEffect, useRef, useState } from "react";
9
+ import { useEffect, useRef } from "react";
7
10
  import {
8
11
  classNames,
9
12
  getCheckboxClasses,
@@ -23,11 +26,10 @@ var Checkbox = ({
23
26
  ...props
24
27
  }) => {
25
28
  const groupContext = useCheckboxGroup();
26
- const [internalChecked, setInternalChecked] = useState(defaultChecked);
27
- const isControlled = controlledChecked !== void 0;
29
+ const [checkedState, setChecked] = useControlledState(controlledChecked, defaultChecked, onChange);
28
30
  const effectiveSize = propSize || groupContext?.size || "md";
29
31
  const effectiveDisabled = propDisabled || groupContext?.disabled || false;
30
- const checked = groupContext && value !== void 0 ? groupContext.value.includes(value) : isControlled ? controlledChecked : internalChecked;
32
+ const checked = groupContext && value !== void 0 ? groupContext.value.includes(value) : checkedState;
31
33
  const checkboxRef = useRef(null);
32
34
  useEffect(() => {
33
35
  if (checkboxRef.current) {
@@ -40,10 +42,7 @@ var Checkbox = ({
40
42
  if (groupContext && value !== void 0) {
41
43
  groupContext.updateValue(value, newValue);
42
44
  } else {
43
- if (!isControlled) {
44
- setInternalChecked(newValue);
45
- }
46
- onChange?.(newValue, event);
45
+ setChecked(newValue, event);
47
46
  }
48
47
  };
49
48
  const checkboxClasses = getCheckboxClasses(effectiveSize, effectiveDisabled);