@expcat/tigercat-react 0.0.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 (382) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunk-2DOPHSZP.js +32 -0
  3. package/dist/chunk-2TS6X5RA.js +73 -0
  4. package/dist/chunk-2Y327ZU4.js +493 -0
  5. package/dist/chunk-3GD3LOII.mjs +23 -0
  6. package/dist/chunk-3OF7XPIQ.js +90 -0
  7. package/dist/chunk-3WPKVV4N.js +140 -0
  8. package/dist/chunk-3XXXM4OB.mjs +203 -0
  9. package/dist/chunk-427CM2U6.mjs +76 -0
  10. package/dist/chunk-472D2S4R.mjs +23 -0
  11. package/dist/chunk-5FRENLDC.js +194 -0
  12. package/dist/chunk-5HUYCSA4.mjs +77 -0
  13. package/dist/chunk-5QKMQRCW.js +89 -0
  14. package/dist/chunk-5ZVSFIZD.js +50 -0
  15. package/dist/chunk-6575DOCV.mjs +117 -0
  16. package/dist/chunk-672SCJWZ.mjs +88 -0
  17. package/dist/chunk-6MGEGOYJ.js +108 -0
  18. package/dist/chunk-6PUSRC6S.js +68 -0
  19. package/dist/chunk-6YDIBMCM.mjs +33 -0
  20. package/dist/chunk-72ZRDBXN.js +25 -0
  21. package/dist/chunk-77D7VQMG.js +43 -0
  22. package/dist/chunk-7CAJK2ZK.mjs +54 -0
  23. package/dist/chunk-7JQ7LURS.mjs +25 -0
  24. package/dist/chunk-7KRBDT2Z.mjs +269 -0
  25. package/dist/chunk-7O2OQKVY.mjs +10 -0
  26. package/dist/chunk-7OLWGHUR.mjs +169 -0
  27. package/dist/chunk-7P6PHSFM.js +548 -0
  28. package/dist/chunk-ADOPAXPG.mjs +301 -0
  29. package/dist/chunk-AG6GVQ5O.js +271 -0
  30. package/dist/chunk-ALP3KYYY.mjs +47 -0
  31. package/dist/chunk-AQ6DHCP6.js +53 -0
  32. package/dist/chunk-AQQRWISY.js +184 -0
  33. package/dist/chunk-C52ZCGYG.mjs +313 -0
  34. package/dist/chunk-C5EFBJBR.js +540 -0
  35. package/dist/chunk-CES6LGQ7.mjs +546 -0
  36. package/dist/chunk-CKUSQR2H.mjs +41 -0
  37. package/dist/chunk-CR4QK2AB.mjs +88 -0
  38. package/dist/chunk-CTAMMQBC.mjs +297 -0
  39. package/dist/chunk-D3I2SY7X.js +301 -0
  40. package/dist/chunk-DCRVIDMY.mjs +41 -0
  41. package/dist/chunk-DIZNY6N4.mjs +71 -0
  42. package/dist/chunk-DZJUFU55.js +300 -0
  43. package/dist/chunk-EB6EDLJZ.mjs +50 -0
  44. package/dist/chunk-EI2GHMQS.js +37 -0
  45. package/dist/chunk-ENR3RIMM.js +205 -0
  46. package/dist/chunk-EQWQXURG.js +18 -0
  47. package/dist/chunk-EUHWE7MN.js +267 -0
  48. package/dist/chunk-FAKTU64M.js +67 -0
  49. package/dist/chunk-FQ6UHRAO.js +499 -0
  50. package/dist/chunk-G6FSHN2I.mjs +111 -0
  51. package/dist/chunk-GIYBVWR4.mjs +213 -0
  52. package/dist/chunk-HDDBBZQH.js +321 -0
  53. package/dist/chunk-HQLZL3XQ.mjs +48 -0
  54. package/dist/chunk-HQXZVTP4.mjs +199 -0
  55. package/dist/chunk-HUMGEP7S.mjs +17 -0
  56. package/dist/chunk-IFY46RWU.js +25 -0
  57. package/dist/chunk-IQINYCU6.js +99 -0
  58. package/dist/chunk-IWENGARY.mjs +32 -0
  59. package/dist/chunk-IY4LEJYF.js +78 -0
  60. package/dist/chunk-JW64IJP2.js +210 -0
  61. package/dist/chunk-K7ZMB2TH.mjs +696 -0
  62. package/dist/chunk-KAEHFMTQ.mjs +537 -0
  63. package/dist/chunk-KMQOLVWP.mjs +65 -0
  64. package/dist/chunk-KUCFT2OA.js +43 -0
  65. package/dist/chunk-LADCWARG.mjs +97 -0
  66. package/dist/chunk-LAZGEMA2.mjs +176 -0
  67. package/dist/chunk-LNKI6HQ3.js +152 -0
  68. package/dist/chunk-LXA2YBAO.js +38 -0
  69. package/dist/chunk-MKWXJZ3T.js +74 -0
  70. package/dist/chunk-MQXBU5YX.mjs +87 -0
  71. package/dist/chunk-NEULKOYJ.js +48 -0
  72. package/dist/chunk-NI2WNZRT.js +38 -0
  73. package/dist/chunk-NOOPXNR4.mjs +36 -0
  74. package/dist/chunk-NSGDRTSQ.mjs +138 -0
  75. package/dist/chunk-O3EUFIOS.mjs +142 -0
  76. package/dist/chunk-OCVQ3LOT.mjs +45 -0
  77. package/dist/chunk-OFCKGWTS.js +12 -0
  78. package/dist/chunk-OQTPXPAP.mjs +10 -0
  79. package/dist/chunk-OTRGVENC.js +305 -0
  80. package/dist/chunk-P273E6XE.js +219 -0
  81. package/dist/chunk-PAD2DX5M.mjs +331 -0
  82. package/dist/chunk-PUDU34R4.mjs +106 -0
  83. package/dist/chunk-Q3DPJHNM.js +407 -0
  84. package/dist/chunk-QEAC4MIG.mjs +295 -0
  85. package/dist/chunk-QFVE7GKD.js +109 -0
  86. package/dist/chunk-QL6OBKEN.js +84 -0
  87. package/dist/chunk-QL6UEG3U.js +27 -0
  88. package/dist/chunk-QN7NIX7D.mjs +82 -0
  89. package/dist/chunk-QORSSZX4.js +144 -0
  90. package/dist/chunk-R4JSBXGG.js +12 -0
  91. package/dist/chunk-R5BQHZWB.js +698 -0
  92. package/dist/chunk-R7MS42PL.js +90 -0
  93. package/dist/chunk-RTQNWZN4.mjs +405 -0
  94. package/dist/chunk-SIVJX7VU.mjs +16 -0
  95. package/dist/chunk-SJ5RFU2O.mjs +17 -0
  96. package/dist/chunk-T4TJJMLM.mjs +34 -0
  97. package/dist/chunk-TB2UHDOZ.js +19 -0
  98. package/dist/chunk-TBIEWDY5.js +175 -0
  99. package/dist/chunk-TJFS44SH.js +48 -0
  100. package/dist/chunk-TR246HQP.mjs +69 -0
  101. package/dist/chunk-TZ26HQAW.js +85 -0
  102. package/dist/chunk-U4ZVEPYD.js +71 -0
  103. package/dist/chunk-UFAXJVMD.js +120 -0
  104. package/dist/chunk-V2HVHLBY.mjs +83 -0
  105. package/dist/chunk-VD3IK5XT.mjs +35 -0
  106. package/dist/chunk-VEGBO77D.mjs +20 -0
  107. package/dist/chunk-VJJ76I7U.js +19 -0
  108. package/dist/chunk-VO4WDK4K.js +37 -0
  109. package/dist/chunk-VSF4DF7N.js +84 -0
  110. package/dist/chunk-VVO4V4IK.js +56 -0
  111. package/dist/chunk-W7HUFFPJ.mjs +263 -0
  112. package/dist/chunk-WDAMDVLU.mjs +106 -0
  113. package/dist/chunk-WEGU7O4J.mjs +66 -0
  114. package/dist/chunk-WK5HN4OH.js +113 -0
  115. package/dist/chunk-WSCSDSV7.mjs +145 -0
  116. package/dist/chunk-WSJO2PIE.mjs +72 -0
  117. package/dist/chunk-XDKXL2BP.mjs +188 -0
  118. package/dist/chunk-XS5JP2KO.mjs +491 -0
  119. package/dist/chunk-XZDJ5FRB.js +333 -0
  120. package/dist/chunk-YE2M2HNM.js +168 -0
  121. package/dist/chunk-YYGTJKP5.js +39 -0
  122. package/dist/chunk-YYKJ63LD.mjs +497 -0
  123. package/dist/chunk-Z4Z3I74Q.mjs +166 -0
  124. package/dist/chunk-ZO4XVOHU.mjs +45 -0
  125. package/dist/chunk-ZREFCRX3.js +52 -0
  126. package/dist/components/Alert.d.mts +24 -0
  127. package/dist/components/Alert.d.ts +24 -0
  128. package/dist/components/Alert.js +10 -0
  129. package/dist/components/Alert.mjs +1 -0
  130. package/dist/components/Avatar.d.mts +12 -0
  131. package/dist/components/Avatar.d.ts +12 -0
  132. package/dist/components/Avatar.js +10 -0
  133. package/dist/components/Avatar.mjs +1 -0
  134. package/dist/components/Badge.d.mts +12 -0
  135. package/dist/components/Badge.d.ts +12 -0
  136. package/dist/components/Badge.js +10 -0
  137. package/dist/components/Badge.mjs +1 -0
  138. package/dist/components/Breadcrumb.d.mts +13 -0
  139. package/dist/components/Breadcrumb.d.ts +13 -0
  140. package/dist/components/Breadcrumb.js +14 -0
  141. package/dist/components/Breadcrumb.mjs +1 -0
  142. package/dist/components/BreadcrumbItem.d.mts +21 -0
  143. package/dist/components/BreadcrumbItem.d.ts +21 -0
  144. package/dist/components/BreadcrumbItem.js +11 -0
  145. package/dist/components/BreadcrumbItem.mjs +2 -0
  146. package/dist/components/Button.d.mts +8 -0
  147. package/dist/components/Button.d.ts +8 -0
  148. package/dist/components/Button.js +10 -0
  149. package/dist/components/Button.mjs +1 -0
  150. package/dist/components/Card.d.mts +33 -0
  151. package/dist/components/Card.d.ts +33 -0
  152. package/dist/components/Card.js +10 -0
  153. package/dist/components/Card.mjs +1 -0
  154. package/dist/components/Checkbox.d.mts +48 -0
  155. package/dist/components/Checkbox.d.ts +48 -0
  156. package/dist/components/Checkbox.js +11 -0
  157. package/dist/components/Checkbox.mjs +2 -0
  158. package/dist/components/CheckboxGroup.d.mts +39 -0
  159. package/dist/components/CheckboxGroup.d.ts +39 -0
  160. package/dist/components/CheckboxGroup.js +14 -0
  161. package/dist/components/CheckboxGroup.mjs +1 -0
  162. package/dist/components/Col.d.mts +7 -0
  163. package/dist/components/Col.d.ts +7 -0
  164. package/dist/components/Col.js +11 -0
  165. package/dist/components/Col.mjs +2 -0
  166. package/dist/components/ConfigProvider.d.mts +14 -0
  167. package/dist/components/ConfigProvider.d.ts +14 -0
  168. package/dist/components/ConfigProvider.js +14 -0
  169. package/dist/components/ConfigProvider.mjs +1 -0
  170. package/dist/components/Container.d.mts +13 -0
  171. package/dist/components/Container.d.ts +13 -0
  172. package/dist/components/Container.js +10 -0
  173. package/dist/components/Container.mjs +1 -0
  174. package/dist/components/Content.d.mts +9 -0
  175. package/dist/components/Content.d.ts +9 -0
  176. package/dist/components/Content.js +10 -0
  177. package/dist/components/Content.mjs +1 -0
  178. package/dist/components/DatePicker.d.mts +24 -0
  179. package/dist/components/DatePicker.d.ts +24 -0
  180. package/dist/components/DatePicker.js +10 -0
  181. package/dist/components/DatePicker.mjs +1 -0
  182. package/dist/components/Descriptions.d.mts +53 -0
  183. package/dist/components/Descriptions.d.ts +53 -0
  184. package/dist/components/Descriptions.js +16 -0
  185. package/dist/components/Descriptions.mjs +1 -0
  186. package/dist/components/Divider.d.mts +12 -0
  187. package/dist/components/Divider.d.ts +12 -0
  188. package/dist/components/Divider.js +10 -0
  189. package/dist/components/Divider.mjs +1 -0
  190. package/dist/components/Drawer.d.mts +19 -0
  191. package/dist/components/Drawer.d.ts +19 -0
  192. package/dist/components/Drawer.js +11 -0
  193. package/dist/components/Drawer.mjs +2 -0
  194. package/dist/components/Dropdown.d.mts +22 -0
  195. package/dist/components/Dropdown.d.ts +22 -0
  196. package/dist/components/Dropdown.js +16 -0
  197. package/dist/components/Dropdown.mjs +3 -0
  198. package/dist/components/DropdownItem.d.mts +17 -0
  199. package/dist/components/DropdownItem.d.ts +17 -0
  200. package/dist/components/DropdownItem.js +13 -0
  201. package/dist/components/DropdownItem.mjs +4 -0
  202. package/dist/components/DropdownMenu.d.mts +13 -0
  203. package/dist/components/DropdownMenu.d.ts +13 -0
  204. package/dist/components/DropdownMenu.js +10 -0
  205. package/dist/components/DropdownMenu.mjs +1 -0
  206. package/dist/components/Footer.d.mts +9 -0
  207. package/dist/components/Footer.d.ts +9 -0
  208. package/dist/components/Footer.js +10 -0
  209. package/dist/components/Footer.mjs +1 -0
  210. package/dist/components/Form.d.mts +56 -0
  211. package/dist/components/Form.d.ts +56 -0
  212. package/dist/components/Form.js +14 -0
  213. package/dist/components/Form.mjs +1 -0
  214. package/dist/components/FormItem.d.mts +16 -0
  215. package/dist/components/FormItem.d.ts +16 -0
  216. package/dist/components/FormItem.js +11 -0
  217. package/dist/components/FormItem.mjs +2 -0
  218. package/dist/components/Header.d.mts +9 -0
  219. package/dist/components/Header.d.ts +9 -0
  220. package/dist/components/Header.js +10 -0
  221. package/dist/components/Header.mjs +1 -0
  222. package/dist/components/Icon.d.mts +9 -0
  223. package/dist/components/Icon.d.ts +9 -0
  224. package/dist/components/Icon.js +10 -0
  225. package/dist/components/Icon.mjs +1 -0
  226. package/dist/components/Input.d.mts +28 -0
  227. package/dist/components/Input.d.ts +28 -0
  228. package/dist/components/Input.js +10 -0
  229. package/dist/components/Input.mjs +1 -0
  230. package/dist/components/Layout.d.mts +9 -0
  231. package/dist/components/Layout.d.ts +9 -0
  232. package/dist/components/Layout.js +10 -0
  233. package/dist/components/Layout.mjs +1 -0
  234. package/dist/components/Link.d.mts +10 -0
  235. package/dist/components/Link.d.ts +10 -0
  236. package/dist/components/Link.js +10 -0
  237. package/dist/components/Link.mjs +1 -0
  238. package/dist/components/List.d.mts +94 -0
  239. package/dist/components/List.d.ts +94 -0
  240. package/dist/components/List.js +12 -0
  241. package/dist/components/List.mjs +3 -0
  242. package/dist/components/Loading.d.mts +8 -0
  243. package/dist/components/Loading.d.ts +8 -0
  244. package/dist/components/Loading.js +10 -0
  245. package/dist/components/Loading.mjs +1 -0
  246. package/dist/components/Menu.d.mts +35 -0
  247. package/dist/components/Menu.d.ts +35 -0
  248. package/dist/components/Menu.js +14 -0
  249. package/dist/components/Menu.mjs +1 -0
  250. package/dist/components/MenuItem.d.mts +20 -0
  251. package/dist/components/MenuItem.d.ts +20 -0
  252. package/dist/components/MenuItem.js +11 -0
  253. package/dist/components/MenuItem.mjs +2 -0
  254. package/dist/components/MenuItemGroup.d.mts +16 -0
  255. package/dist/components/MenuItemGroup.d.ts +16 -0
  256. package/dist/components/MenuItemGroup.js +12 -0
  257. package/dist/components/MenuItemGroup.mjs +3 -0
  258. package/dist/components/Message.d.mts +44 -0
  259. package/dist/components/Message.d.ts +44 -0
  260. package/dist/components/Message.js +20 -0
  261. package/dist/components/Message.mjs +1 -0
  262. package/dist/components/Modal.d.mts +41 -0
  263. package/dist/components/Modal.d.ts +41 -0
  264. package/dist/components/Modal.js +11 -0
  265. package/dist/components/Modal.mjs +2 -0
  266. package/dist/components/Notification.d.mts +40 -0
  267. package/dist/components/Notification.d.ts +40 -0
  268. package/dist/components/Notification.js +20 -0
  269. package/dist/components/Notification.mjs +1 -0
  270. package/dist/components/Pagination.d.mts +11 -0
  271. package/dist/components/Pagination.d.ts +11 -0
  272. package/dist/components/Pagination.js +16 -0
  273. package/dist/components/Pagination.mjs +1 -0
  274. package/dist/components/Popconfirm.d.mts +34 -0
  275. package/dist/components/Popconfirm.d.ts +34 -0
  276. package/dist/components/Popconfirm.js +10 -0
  277. package/dist/components/Popconfirm.mjs +1 -0
  278. package/dist/components/Popover.d.mts +14 -0
  279. package/dist/components/Popover.d.ts +14 -0
  280. package/dist/components/Popover.js +10 -0
  281. package/dist/components/Popover.mjs +1 -0
  282. package/dist/components/Progress.d.mts +8 -0
  283. package/dist/components/Progress.d.ts +8 -0
  284. package/dist/components/Progress.js +10 -0
  285. package/dist/components/Progress.mjs +1 -0
  286. package/dist/components/Radio.d.mts +20 -0
  287. package/dist/components/Radio.d.ts +20 -0
  288. package/dist/components/Radio.js +11 -0
  289. package/dist/components/Radio.mjs +2 -0
  290. package/dist/components/RadioGroup.d.mts +28 -0
  291. package/dist/components/RadioGroup.d.ts +28 -0
  292. package/dist/components/RadioGroup.js +14 -0
  293. package/dist/components/RadioGroup.mjs +1 -0
  294. package/dist/components/Row.d.mts +11 -0
  295. package/dist/components/Row.d.ts +11 -0
  296. package/dist/components/Row.js +14 -0
  297. package/dist/components/Row.mjs +1 -0
  298. package/dist/components/Select.d.mts +23 -0
  299. package/dist/components/Select.d.ts +23 -0
  300. package/dist/components/Select.js +10 -0
  301. package/dist/components/Select.mjs +1 -0
  302. package/dist/components/Sidebar.d.mts +9 -0
  303. package/dist/components/Sidebar.d.ts +9 -0
  304. package/dist/components/Sidebar.js +10 -0
  305. package/dist/components/Sidebar.mjs +1 -0
  306. package/dist/components/Skeleton.d.mts +7 -0
  307. package/dist/components/Skeleton.d.ts +7 -0
  308. package/dist/components/Skeleton.js +10 -0
  309. package/dist/components/Skeleton.mjs +1 -0
  310. package/dist/components/Slider.d.mts +12 -0
  311. package/dist/components/Slider.d.ts +12 -0
  312. package/dist/components/Slider.js +10 -0
  313. package/dist/components/Slider.mjs +1 -0
  314. package/dist/components/Space.d.mts +11 -0
  315. package/dist/components/Space.d.ts +11 -0
  316. package/dist/components/Space.js +10 -0
  317. package/dist/components/Space.mjs +1 -0
  318. package/dist/components/Steps.d.mts +31 -0
  319. package/dist/components/Steps.d.ts +31 -0
  320. package/dist/components/Steps.js +14 -0
  321. package/dist/components/Steps.mjs +1 -0
  322. package/dist/components/StepsItem.d.mts +36 -0
  323. package/dist/components/StepsItem.d.ts +36 -0
  324. package/dist/components/StepsItem.js +10 -0
  325. package/dist/components/StepsItem.mjs +1 -0
  326. package/dist/components/SubMenu.d.mts +20 -0
  327. package/dist/components/SubMenu.d.ts +20 -0
  328. package/dist/components/SubMenu.js +13 -0
  329. package/dist/components/SubMenu.mjs +4 -0
  330. package/dist/components/Switch.d.mts +12 -0
  331. package/dist/components/Switch.d.ts +12 -0
  332. package/dist/components/Switch.js +10 -0
  333. package/dist/components/Switch.mjs +1 -0
  334. package/dist/components/TabPane.d.mts +42 -0
  335. package/dist/components/TabPane.d.ts +42 -0
  336. package/dist/components/TabPane.js +10 -0
  337. package/dist/components/TabPane.mjs +1 -0
  338. package/dist/components/Table.d.mts +46 -0
  339. package/dist/components/Table.d.ts +46 -0
  340. package/dist/components/Table.js +10 -0
  341. package/dist/components/Table.mjs +1 -0
  342. package/dist/components/Tabs.d.mts +43 -0
  343. package/dist/components/Tabs.d.ts +43 -0
  344. package/dist/components/Tabs.js +14 -0
  345. package/dist/components/Tabs.mjs +1 -0
  346. package/dist/components/Tag.d.mts +16 -0
  347. package/dist/components/Tag.d.ts +16 -0
  348. package/dist/components/Tag.js +10 -0
  349. package/dist/components/Tag.mjs +1 -0
  350. package/dist/components/Text.d.mts +9 -0
  351. package/dist/components/Text.d.ts +9 -0
  352. package/dist/components/Text.js +10 -0
  353. package/dist/components/Text.mjs +1 -0
  354. package/dist/components/Textarea.d.mts +13 -0
  355. package/dist/components/Textarea.d.ts +13 -0
  356. package/dist/components/Textarea.js +10 -0
  357. package/dist/components/Textarea.mjs +1 -0
  358. package/dist/components/TimePicker.d.mts +28 -0
  359. package/dist/components/TimePicker.d.ts +28 -0
  360. package/dist/components/TimePicker.js +10 -0
  361. package/dist/components/TimePicker.mjs +1 -0
  362. package/dist/components/Timeline.d.mts +47 -0
  363. package/dist/components/Timeline.d.ts +47 -0
  364. package/dist/components/Timeline.js +10 -0
  365. package/dist/components/Timeline.mjs +1 -0
  366. package/dist/components/Tooltip.d.mts +15 -0
  367. package/dist/components/Tooltip.d.ts +15 -0
  368. package/dist/components/Tooltip.js +10 -0
  369. package/dist/components/Tooltip.mjs +1 -0
  370. package/dist/components/Tree.d.mts +154 -0
  371. package/dist/components/Tree.d.ts +154 -0
  372. package/dist/components/Tree.js +16 -0
  373. package/dist/components/Tree.mjs +1 -0
  374. package/dist/components/Upload.d.mts +16 -0
  375. package/dist/components/Upload.d.ts +16 -0
  376. package/dist/components/Upload.js +11 -0
  377. package/dist/components/Upload.mjs +2 -0
  378. package/dist/index.d.mts +76 -0
  379. package/dist/index.d.ts +76 -0
  380. package/dist/index.js +359 -0
  381. package/dist/index.mjs +67 -0
  382. package/package.json +60 -0
@@ -0,0 +1,407 @@
1
+ 'use strict';
2
+
3
+ var chunkQL6UEG3U_js = require('./chunk-QL6UEG3U.js');
4
+ var react = require('react');
5
+ var tigercatCore = require('@expcat/tigercat-core');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ var Upload = ({
9
+ accept,
10
+ multiple = false,
11
+ limit,
12
+ maxSize,
13
+ disabled = false,
14
+ drag = false,
15
+ listType = "text",
16
+ fileList: controlledFileList,
17
+ showFileList = true,
18
+ autoUpload = true,
19
+ customRequest,
20
+ onChange,
21
+ onRemove,
22
+ onPreview,
23
+ beforeUpload,
24
+ onProgress,
25
+ onSuccess,
26
+ onError,
27
+ onExceed,
28
+ locale,
29
+ labels: labelsOverrides,
30
+ children,
31
+ className,
32
+ style,
33
+ ...divProps
34
+ }) => {
35
+ const spinnerSvg = tigercatCore.getSpinnerSVG("spinner");
36
+ const config = chunkQL6UEG3U_js.useTigerConfig();
37
+ const mergedLocale = react.useMemo(
38
+ () => tigercatCore.mergeTigerLocale(config.locale, locale),
39
+ [config.locale, locale]
40
+ );
41
+ const labels = react.useMemo(
42
+ () => tigercatCore.getUploadLabels(mergedLocale, labelsOverrides),
43
+ [mergedLocale, labelsOverrides]
44
+ );
45
+ const inputRef = react.useRef(null);
46
+ const [isDragging, setIsDragging] = react.useState(false);
47
+ const [internalFileList, setInternalFileList] = react.useState([]);
48
+ const isControlled = controlledFileList !== void 0;
49
+ const fileList = isControlled ? controlledFileList : internalFileList;
50
+ const updateFileList = react.useCallback(
51
+ (newFileList) => {
52
+ if (!isControlled) {
53
+ setInternalFileList(newFileList);
54
+ }
55
+ },
56
+ [isControlled]
57
+ );
58
+ const handleClick = () => {
59
+ if (disabled) return;
60
+ inputRef.current?.click();
61
+ };
62
+ const handleFileChange = async (event) => {
63
+ const files = Array.from(event.target.files || []);
64
+ await processFiles(files);
65
+ if (event.target) {
66
+ event.target.value = "";
67
+ }
68
+ };
69
+ const processFiles = async (incomingFiles) => {
70
+ if (incomingFiles.length === 0) return;
71
+ const prepared = await tigercatCore.prepareUploadFiles({
72
+ currentCount: fileList.length,
73
+ incomingFiles,
74
+ limit,
75
+ accept,
76
+ maxSize,
77
+ beforeUpload
78
+ });
79
+ if (prepared.rejectedExceedFiles.length > 0) {
80
+ onExceed?.(prepared.rejectedExceedFiles, fileList);
81
+ }
82
+ let nextFileList = [...fileList];
83
+ for (const file of prepared.acceptedFiles) {
84
+ const uploadFile = tigercatCore.fileToUploadFile(file);
85
+ nextFileList = [...nextFileList, uploadFile];
86
+ updateFileList(nextFileList);
87
+ if (onChange) {
88
+ onChange(uploadFile, nextFileList);
89
+ }
90
+ if (autoUpload) {
91
+ uploadFile.status = "uploading";
92
+ if (customRequest) {
93
+ customRequest({
94
+ file,
95
+ onProgress: (progress) => {
96
+ uploadFile.progress = progress;
97
+ if (onProgress) {
98
+ onProgress(progress, uploadFile);
99
+ }
100
+ },
101
+ onSuccess: (response) => {
102
+ uploadFile.status = "success";
103
+ if (onSuccess) {
104
+ onSuccess(response, uploadFile);
105
+ }
106
+ },
107
+ onError: (error) => {
108
+ uploadFile.status = "error";
109
+ uploadFile.error = error.message;
110
+ if (onError) {
111
+ onError(error, uploadFile);
112
+ }
113
+ }
114
+ });
115
+ } else {
116
+ uploadFile.status = "success";
117
+ }
118
+ }
119
+ }
120
+ };
121
+ const handleRemove = (file) => {
122
+ const newFileList = fileList.filter((f) => f.uid !== file.uid);
123
+ const removeResult = onRemove?.(file, newFileList);
124
+ if (removeResult === false) return;
125
+ updateFileList(newFileList);
126
+ onChange?.(file, newFileList);
127
+ };
128
+ const handlePreview = (file) => {
129
+ if (onPreview) {
130
+ onPreview(file);
131
+ }
132
+ };
133
+ const handleDragOver = (event) => {
134
+ if (disabled) return;
135
+ event.preventDefault();
136
+ setIsDragging(true);
137
+ };
138
+ const handleDragKeyDown = (event) => {
139
+ if (disabled) return;
140
+ if (event.key === "Enter" || event.key === " ") {
141
+ event.preventDefault();
142
+ handleClick();
143
+ }
144
+ };
145
+ const handleDragLeave = (event) => {
146
+ if (disabled) return;
147
+ event.preventDefault();
148
+ setIsDragging(false);
149
+ };
150
+ const handleDrop = async (event) => {
151
+ if (disabled) return;
152
+ event.preventDefault();
153
+ setIsDragging(false);
154
+ const files = Array.from(event.dataTransfer?.files || []);
155
+ await processFiles(files);
156
+ };
157
+ const renderUploadButton = () => {
158
+ if (drag) {
159
+ return /* @__PURE__ */ jsxRuntime.jsxs(
160
+ "div",
161
+ {
162
+ className: tigercatCore.getDragAreaClasses(isDragging, disabled),
163
+ onClick: handleClick,
164
+ onKeyDown: handleDragKeyDown,
165
+ onDragOver: handleDragOver,
166
+ onDragLeave: handleDragLeave,
167
+ onDrop: handleDrop,
168
+ role: "button",
169
+ tabIndex: disabled ? -1 : 0,
170
+ "aria-disabled": disabled,
171
+ "aria-label": labels.dragAreaAriaLabel,
172
+ children: [
173
+ /* @__PURE__ */ jsxRuntime.jsx(
174
+ "svg",
175
+ {
176
+ className: "w-12 h-12 mb-3 text-gray-400",
177
+ fill: "none",
178
+ stroke: "currentColor",
179
+ viewBox: "0 0 24 24",
180
+ "aria-hidden": "true",
181
+ children: /* @__PURE__ */ jsxRuntime.jsx(
182
+ "path",
183
+ {
184
+ strokeLinecap: "round",
185
+ strokeLinejoin: "round",
186
+ strokeWidth: 2,
187
+ d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
188
+ }
189
+ )
190
+ }
191
+ ),
192
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mb-2 text-sm", children: [
193
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: labels.clickToUploadText }),
194
+ " ",
195
+ labels.dragAndDropText
196
+ ] }),
197
+ accept && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500", children: tigercatCore.interpolateUploadLabel(labels.acceptInfoText, { accept }) }),
198
+ maxSize && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500", children: tigercatCore.interpolateUploadLabel(labels.maxSizeInfoText, {
199
+ maxSize: tigercatCore.formatFileSize(maxSize)
200
+ }) })
201
+ ]
202
+ }
203
+ );
204
+ }
205
+ return /* @__PURE__ */ jsxRuntime.jsx(
206
+ "button",
207
+ {
208
+ type: "button",
209
+ className: tigercatCore.getUploadButtonClasses(drag, disabled),
210
+ onClick: handleClick,
211
+ disabled,
212
+ "aria-label": labels.buttonAriaLabel,
213
+ children: children || labels.selectFileText
214
+ }
215
+ );
216
+ };
217
+ const renderFileList = () => {
218
+ if (!showFileList || fileList.length === 0) {
219
+ return null;
220
+ }
221
+ if (listType === "picture-card") {
222
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2 mt-4", children: fileList.map((file) => renderPictureCard(file)) });
223
+ }
224
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mt-4 space-y-2", role: "list", "aria-label": labels.uploadedFilesAriaLabel, children: fileList.map((file) => renderFileItem(file)) });
225
+ };
226
+ const renderFileItem = (file) => {
227
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: tigercatCore.getFileListItemClasses(file.status), children: [
228
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center flex-1 min-w-0", children: [
229
+ /* @__PURE__ */ jsxRuntime.jsx(
230
+ "svg",
231
+ {
232
+ className: "w-5 h-5 mr-2 flex-shrink-0",
233
+ fill: "none",
234
+ stroke: "currentColor",
235
+ viewBox: "0 0 24 24",
236
+ "aria-hidden": "true",
237
+ children: /* @__PURE__ */ jsxRuntime.jsx(
238
+ "path",
239
+ {
240
+ strokeLinecap: "round",
241
+ strokeLinejoin: "round",
242
+ strokeWidth: 2,
243
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
244
+ }
245
+ )
246
+ }
247
+ ),
248
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
249
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: file.name }),
250
+ file.size && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500", children: tigercatCore.formatFileSize(file.size) })
251
+ ] })
252
+ ] }),
253
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2 ml-4", children: [
254
+ file.status === "success" && /* @__PURE__ */ jsxRuntime.jsx(
255
+ "svg",
256
+ {
257
+ className: tigercatCore.getUploadStatusIconClasses("success", "sm"),
258
+ fill: "currentColor",
259
+ viewBox: tigercatCore.icon20ViewBox,
260
+ "aria-label": labels.successAriaLabel,
261
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: tigercatCore.successCircleSolidIcon20PathD, clipRule: "evenodd" })
262
+ }
263
+ ),
264
+ file.status === "error" && /* @__PURE__ */ jsxRuntime.jsx(
265
+ "svg",
266
+ {
267
+ className: tigercatCore.getUploadStatusIconClasses("error", "sm"),
268
+ fill: "currentColor",
269
+ viewBox: tigercatCore.icon20ViewBox,
270
+ "aria-label": labels.errorAriaLabel,
271
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: tigercatCore.errorCircleSolidIcon20PathD, clipRule: "evenodd" })
272
+ }
273
+ ),
274
+ file.status === "uploading" && /* @__PURE__ */ jsxRuntime.jsx(
275
+ "svg",
276
+ {
277
+ className: tigercatCore.getUploadStatusIconClasses("uploading", "sm", {
278
+ spinning: true
279
+ }),
280
+ fill: "none",
281
+ viewBox: spinnerSvg.viewBox,
282
+ "aria-label": labels.uploadingAriaLabel,
283
+ children: spinnerSvg.elements.map((el, index) => {
284
+ if (el.type === "circle") return /* @__PURE__ */ jsxRuntime.jsx("circle", { ...el.attrs }, index);
285
+ if (el.type === "path") return /* @__PURE__ */ jsxRuntime.jsx("path", { ...el.attrs }, index);
286
+ return null;
287
+ })
288
+ }
289
+ ),
290
+ /* @__PURE__ */ jsxRuntime.jsx(
291
+ "button",
292
+ {
293
+ type: "button",
294
+ className: "text-gray-400 hover:text-red-500 transition-colors",
295
+ onClick: () => handleRemove(file),
296
+ "aria-label": tigercatCore.interpolateUploadLabel(labels.removeFileAriaLabel, {
297
+ fileName: file.name
298
+ }),
299
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: tigercatCore.icon20ViewBox, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: tigercatCore.closeSolidIcon20PathD, clipRule: "evenodd" }) })
300
+ }
301
+ )
302
+ ] })
303
+ ] }, file.uid);
304
+ };
305
+ const renderPictureCard = (file) => {
306
+ const imageUrl = file.url || (file.file ? URL.createObjectURL(file.file) : "");
307
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getPictureCardClasses(file.status), children: [
308
+ imageUrl && /* @__PURE__ */ jsxRuntime.jsx("img", { src: imageUrl, alt: file.name, className: "w-full h-full object-cover" }),
309
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 bg-black bg-opacity-0 hover:bg-opacity-50 transition-all flex items-center justify-center space-x-2 opacity-0 hover:opacity-100", children: [
310
+ /* @__PURE__ */ jsxRuntime.jsx(
311
+ "button",
312
+ {
313
+ type: "button",
314
+ className: "text-white hover:text-blue-200 transition-colors",
315
+ onClick: () => handlePreview(file),
316
+ "aria-label": tigercatCore.interpolateUploadLabel(labels.previewFileAriaLabel, {
317
+ fileName: file.name
318
+ }),
319
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
320
+ "svg",
321
+ {
322
+ className: "w-6 h-6",
323
+ fill: "none",
324
+ stroke: "currentColor",
325
+ viewBox: "0 0 24 24",
326
+ "aria-hidden": "true",
327
+ children: [
328
+ /* @__PURE__ */ jsxRuntime.jsx(
329
+ "path",
330
+ {
331
+ strokeLinecap: "round",
332
+ strokeLinejoin: "round",
333
+ strokeWidth: 2,
334
+ d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
335
+ }
336
+ ),
337
+ /* @__PURE__ */ jsxRuntime.jsx(
338
+ "path",
339
+ {
340
+ strokeLinecap: "round",
341
+ strokeLinejoin: "round",
342
+ strokeWidth: 2,
343
+ d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
344
+ }
345
+ )
346
+ ]
347
+ }
348
+ )
349
+ }
350
+ ),
351
+ /* @__PURE__ */ jsxRuntime.jsx(
352
+ "button",
353
+ {
354
+ type: "button",
355
+ className: "text-white hover:text-red-200 transition-colors",
356
+ onClick: () => handleRemove(file),
357
+ "aria-label": tigercatCore.interpolateUploadLabel(labels.removeFileAriaLabel, {
358
+ fileName: file.name
359
+ }),
360
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-6 h-6", fill: "currentColor", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
361
+ "path",
362
+ {
363
+ fillRule: "evenodd",
364
+ d: "M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",
365
+ clipRule: "evenodd"
366
+ }
367
+ ) })
368
+ }
369
+ )
370
+ ] }),
371
+ file.status === "uploading" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
372
+ "svg",
373
+ {
374
+ className: tigercatCore.getUploadStatusIconClasses("uploading", "lg", {
375
+ spinning: true
376
+ }),
377
+ fill: "none",
378
+ viewBox: spinnerSvg.viewBox,
379
+ children: spinnerSvg.elements.map((el, index) => {
380
+ if (el.type === "circle") return /* @__PURE__ */ jsxRuntime.jsx("circle", { ...el.attrs }, index);
381
+ if (el.type === "path") return /* @__PURE__ */ jsxRuntime.jsx("path", { ...el.attrs }, index);
382
+ return null;
383
+ })
384
+ }
385
+ ) })
386
+ ] }, file.uid);
387
+ };
388
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...divProps, className: tigercatCore.classNames("tiger-upload", className), style, children: [
389
+ /* @__PURE__ */ jsxRuntime.jsx(
390
+ "input",
391
+ {
392
+ ref: inputRef,
393
+ type: "file",
394
+ accept,
395
+ multiple,
396
+ disabled,
397
+ style: { display: "none" },
398
+ onChange: handleFileChange,
399
+ "aria-hidden": "true"
400
+ }
401
+ ),
402
+ renderUploadButton(),
403
+ renderFileList()
404
+ ] });
405
+ };
406
+
407
+ exports.Upload = Upload;
@@ -0,0 +1,295 @@
1
+ import { MenuItemGroup } from './chunk-IWENGARY.mjs';
2
+ import { MenuItem } from './chunk-NSGDRTSQ.mjs';
3
+ import { useMenuContext } from './chunk-WDAMDVLU.mjs';
4
+ import React, { useState, useEffect, useMemo, useCallback } from 'react';
5
+ import { isKeyOpen, getSubMenuTitleClasses, submenuContentHorizontalClasses, submenuContentPopupClasses, submenuContentInlineClasses, submenuContentVerticalClasses, getMenuItemIndent, classNames, menuItemIconClasses, getSubMenuExpandIconClasses } from '@expcat/tigercat-core';
6
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
+
8
+ var ExpandIcon = ({ expanded }) => /* @__PURE__ */ jsx(
9
+ "svg",
10
+ {
11
+ className: getSubMenuExpandIconClasses(expanded),
12
+ width: "12",
13
+ height: "12",
14
+ viewBox: "0 0 12 12",
15
+ fill: "currentColor",
16
+ children: /* @__PURE__ */ jsx("path", { d: "M6 9L1.5 4.5L2.205 3.795L6 7.59L9.795 3.795L10.5 4.5L6 9Z" })
17
+ }
18
+ );
19
+ function getMenuButtonsWithin(menuEl) {
20
+ return Array.from(
21
+ menuEl.querySelectorAll('button[data-tiger-menuitem="true"]')
22
+ ).filter((el) => !el.disabled && !el.closest('[data-tiger-menu-hidden="true"]'));
23
+ }
24
+ function roveFocus(current, next) {
25
+ const menuEl = current.closest('ul[role="menu"]');
26
+ if (!menuEl) {
27
+ next.focus();
28
+ return;
29
+ }
30
+ const items = getMenuButtonsWithin(menuEl);
31
+ items.forEach((el) => {
32
+ el.tabIndex = el === next ? 0 : -1;
33
+ });
34
+ next.focus();
35
+ }
36
+ function moveFocus(current, delta) {
37
+ const menuEl = current.closest('ul[role="menu"]');
38
+ if (!menuEl) return;
39
+ const items = getMenuButtonsWithin(menuEl);
40
+ const currentIndex = items.indexOf(current);
41
+ if (currentIndex < 0) return;
42
+ const nextIndex = (currentIndex + delta + items.length) % items.length;
43
+ roveFocus(current, items[nextIndex]);
44
+ }
45
+ function focusEdge(current, edge) {
46
+ const menuEl = current.closest('ul[role="menu"]');
47
+ if (!menuEl) return;
48
+ const items = getMenuButtonsWithin(menuEl);
49
+ if (items.length === 0) return;
50
+ roveFocus(current, edge === "start" ? items[0] : items[items.length - 1]);
51
+ }
52
+ function focusFirstChildItemFromTitle(titleEl) {
53
+ const li = titleEl.closest("li");
54
+ const submenu = li?.querySelector('ul[role="menu"]');
55
+ if (!submenu) return;
56
+ const items = getMenuButtonsWithin(submenu);
57
+ if (items.length === 0) return;
58
+ items.forEach((el, idx) => {
59
+ el.tabIndex = idx === 0 ? 0 : -1;
60
+ });
61
+ items[0].focus();
62
+ }
63
+ var SubMenu = ({
64
+ itemKey,
65
+ title = "",
66
+ icon,
67
+ disabled = false,
68
+ className,
69
+ level = 0,
70
+ children,
71
+ collapsed: collapsedOverride
72
+ }) => {
73
+ const menuContext = useMenuContext();
74
+ if (!menuContext) {
75
+ console.warn("SubMenu must be used within Menu component");
76
+ }
77
+ const [isHovered, setIsHovered] = useState(false);
78
+ const [isOpenByKeyboard, setIsOpenByKeyboard] = useState(false);
79
+ const effectiveCollapsed = collapsedOverride ?? (menuContext ? menuContext.collapsed : false);
80
+ const isPopup = !!menuContext && menuContext.mode === "vertical" && effectiveCollapsed;
81
+ const isOpen = !!menuContext && isKeyOpen(itemKey, menuContext.openKeys);
82
+ const isExpanded = menuContext?.mode === "horizontal" || isPopup ? isHovered || isOpenByKeyboard : isOpen;
83
+ const isInlineOrVertical = menuContext?.mode !== "horizontal" && !isPopup;
84
+ const [hasRenderedInline, setHasRenderedInline] = useState(
85
+ () => isInlineOrVertical ? isExpanded : false
86
+ );
87
+ useEffect(() => {
88
+ if (!isInlineOrVertical || !isExpanded || hasRenderedInline) return;
89
+ setHasRenderedInline(true);
90
+ }, [hasRenderedInline, isExpanded, isInlineOrVertical]);
91
+ const titleClasses = useMemo(() => {
92
+ if (!menuContext) return "";
93
+ return getSubMenuTitleClasses(menuContext.theme, disabled);
94
+ }, [menuContext, disabled]);
95
+ const contentClasses = useMemo(() => {
96
+ if (!menuContext) return "";
97
+ if (menuContext.mode === "horizontal") return submenuContentHorizontalClasses;
98
+ if (isPopup) return submenuContentPopupClasses;
99
+ if (menuContext.mode === "inline") return submenuContentInlineClasses;
100
+ return submenuContentVerticalClasses;
101
+ }, [menuContext, isPopup]);
102
+ const handleTitleClick = useCallback(() => {
103
+ if (!menuContext || disabled) return;
104
+ if (menuContext.mode === "horizontal") return;
105
+ if (isPopup) {
106
+ setIsOpenByKeyboard((prev) => !prev);
107
+ setIsHovered(true);
108
+ return;
109
+ }
110
+ setHasRenderedInline(true);
111
+ menuContext.handleOpenChange(itemKey);
112
+ }, [disabled, menuContext, itemKey, isPopup]);
113
+ const handleMouseEnter = useCallback(() => {
114
+ if (menuContext?.mode === "horizontal" || isPopup) setIsHovered(true);
115
+ }, [menuContext, isPopup]);
116
+ const handleMouseLeave = useCallback(() => {
117
+ if (menuContext?.mode === "horizontal" || isPopup) {
118
+ setIsHovered(false);
119
+ setIsOpenByKeyboard(false);
120
+ }
121
+ }, [menuContext, isPopup]);
122
+ const openInline = useCallback(
123
+ (titleEl) => {
124
+ if (!menuContext) return;
125
+ setHasRenderedInline(true);
126
+ menuContext.handleOpenChange(itemKey);
127
+ setTimeout(() => focusFirstChildItemFromTitle(titleEl), 0);
128
+ },
129
+ [menuContext, itemKey]
130
+ );
131
+ const handleTitleKeyDown = useCallback(
132
+ (event) => {
133
+ if (!menuContext || disabled) return;
134
+ const current = event.currentTarget;
135
+ const rootMenu = current.closest('ul[role="menu"]');
136
+ const isRoot = rootMenu?.dataset.tigerMenuRoot === "true";
137
+ const isHorizontalRoot = isRoot && menuContext.mode === "horizontal";
138
+ const nextKey = isHorizontalRoot ? "ArrowRight" : "ArrowDown";
139
+ const prevKey = isHorizontalRoot ? "ArrowLeft" : "ArrowUp";
140
+ if (event.key === nextKey) {
141
+ event.preventDefault();
142
+ moveFocus(current, 1);
143
+ return;
144
+ }
145
+ if (event.key === prevKey) {
146
+ event.preventDefault();
147
+ moveFocus(current, -1);
148
+ return;
149
+ }
150
+ if (event.key === "Home") {
151
+ event.preventDefault();
152
+ focusEdge(current, "start");
153
+ return;
154
+ }
155
+ if (event.key === "End") {
156
+ event.preventDefault();
157
+ focusEdge(current, "end");
158
+ return;
159
+ }
160
+ if (event.key === "Escape" || event.key === "ArrowLeft") {
161
+ if (menuContext.mode === "horizontal" || isPopup) {
162
+ event.preventDefault();
163
+ setIsOpenByKeyboard(false);
164
+ setIsHovered(false);
165
+ return;
166
+ }
167
+ if (isOpen) {
168
+ event.preventDefault();
169
+ menuContext.handleOpenChange(itemKey);
170
+ }
171
+ return;
172
+ }
173
+ if (event.key === "Enter" || event.key === " ") {
174
+ event.preventDefault();
175
+ if (menuContext.mode === "horizontal" || isPopup) {
176
+ setIsOpenByKeyboard(true);
177
+ return;
178
+ }
179
+ openInline(current);
180
+ return;
181
+ }
182
+ if (event.key === "ArrowRight" || event.key === "ArrowDown") {
183
+ if (menuContext.mode === "horizontal" || isPopup) {
184
+ event.preventDefault();
185
+ setIsOpenByKeyboard(true);
186
+ return;
187
+ }
188
+ if (!isOpen) {
189
+ event.preventDefault();
190
+ openInline(current);
191
+ }
192
+ }
193
+ },
194
+ [menuContext, disabled, isOpen, isPopup, openInline]
195
+ );
196
+ const indentStyle = !menuContext || menuContext.mode === "horizontal" || level === 0 ? {} : getMenuItemIndent(level, menuContext.inlineIndent);
197
+ if (!menuContext) return null;
198
+ const renderIcon = () => {
199
+ if (!icon) return null;
200
+ if (typeof icon === "string") {
201
+ return /* @__PURE__ */ jsx("span", { className: menuItemIconClasses, dangerouslySetInnerHTML: { __html: icon } });
202
+ }
203
+ return /* @__PURE__ */ jsx("span", { className: menuItemIconClasses, children: icon });
204
+ };
205
+ const renderTitle = () => {
206
+ if (!effectiveCollapsed) {
207
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
208
+ renderIcon(),
209
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: title }),
210
+ menuContext.mode !== "horizontal" && !isPopup && /* @__PURE__ */ jsx(ExpandIcon, { expanded: isExpanded })
211
+ ] });
212
+ } else if (!icon) {
213
+ return /* @__PURE__ */ jsx("span", { className: "flex-1 text-center", children: title.charAt(0).toUpperCase() });
214
+ } else {
215
+ return renderIcon();
216
+ }
217
+ };
218
+ const renderContent = () => {
219
+ const nextLevel = level + 1;
220
+ const enhancedChildren = React.Children.map(children, (child) => {
221
+ if (!React.isValidElement(child)) return child;
222
+ if (child.type === MenuItem || child.type === SubMenu || child.type === MenuItemGroup) {
223
+ return React.cloneElement(
224
+ child,
225
+ {
226
+ level: nextLevel,
227
+ collapsed: isPopup ? false : void 0
228
+ }
229
+ );
230
+ }
231
+ return child;
232
+ });
233
+ if (menuContext.mode === "horizontal" || isPopup) {
234
+ return /* @__PURE__ */ jsx(
235
+ "ul",
236
+ {
237
+ className: contentClasses,
238
+ style: { display: isExpanded ? "block" : "none" },
239
+ role: "menu",
240
+ "aria-hidden": isExpanded ? void 0 : "true",
241
+ children: enhancedChildren
242
+ }
243
+ );
244
+ }
245
+ if (!hasRenderedInline) return null;
246
+ const isHidden = !isExpanded;
247
+ return /* @__PURE__ */ jsx(
248
+ "div",
249
+ {
250
+ className: classNames(
251
+ "grid overflow-hidden transition-[grid-template-rows,opacity] duration-200 ease-in-out",
252
+ isHidden ? "grid-rows-[0fr] opacity-0" : "grid-rows-[1fr] opacity-100"
253
+ ),
254
+ "aria-hidden": isHidden ? "true" : void 0,
255
+ "data-tiger-menu-hidden": isHidden ? "true" : void 0,
256
+ children: /* @__PURE__ */ jsx("ul", { className: classNames(contentClasses, "min-h-0"), role: "menu", children: enhancedChildren })
257
+ }
258
+ );
259
+ };
260
+ return /* @__PURE__ */ jsxs(
261
+ "li",
262
+ {
263
+ className: classNames(
264
+ menuContext.mode === "horizontal" || isPopup ? "relative" : "",
265
+ className
266
+ ),
267
+ onMouseEnter: handleMouseEnter,
268
+ onMouseLeave: handleMouseLeave,
269
+ role: "none",
270
+ children: [
271
+ /* @__PURE__ */ jsx(
272
+ "button",
273
+ {
274
+ type: "button",
275
+ className: titleClasses,
276
+ style: indentStyle,
277
+ onClick: handleTitleClick,
278
+ onKeyDown: handleTitleKeyDown,
279
+ role: "menuitem",
280
+ "data-tiger-menuitem": "true",
281
+ "aria-expanded": isExpanded ? "true" : "false",
282
+ "aria-haspopup": "true",
283
+ "aria-disabled": disabled ? "true" : void 0,
284
+ disabled,
285
+ tabIndex: -1,
286
+ children: renderTitle()
287
+ }
288
+ ),
289
+ renderContent()
290
+ ]
291
+ }
292
+ );
293
+ };
294
+
295
+ export { SubMenu };