@rockshin/tao-ui 0.0.60 → 0.1.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 (416) hide show
  1. package/README.md +5 -1
  2. package/component-manifest.json +1 -1
  3. package/dist/components/affix/affix.css +1 -1
  4. package/dist/components/affix/affix.d.ts +1 -0
  5. package/dist/components/affix/affix.js +18 -17
  6. package/dist/components/alert/alert.css +123 -119
  7. package/dist/components/alert/alert.js +78 -188
  8. package/dist/components/app/app-modals.js +49 -98
  9. package/dist/components/app/app-notices.d.ts +2 -2
  10. package/dist/components/app/app-notices.js +294 -243
  11. package/dist/components/app/app-types.d.ts +6 -3
  12. package/dist/components/app/app.css +185 -183
  13. package/dist/components/app/app.js +1 -1
  14. package/dist/components/auto-complete/auto-complete.css +30 -28
  15. package/dist/components/auto-complete/auto-complete.d.ts +3 -1
  16. package/dist/components/auto-complete/auto-complete.js +2 -1
  17. package/dist/components/badge/badge.js +42 -127
  18. package/dist/components/border-beam/border-beam.css +1 -1
  19. package/dist/components/border-beam/border-beam.d.ts +1 -0
  20. package/dist/components/border-beam/border-beam.js +1 -0
  21. package/dist/components/breadcrumb/breadcrumb.css +123 -120
  22. package/dist/components/breadcrumb/breadcrumb.js +160 -265
  23. package/dist/components/button/button.d.ts +1 -1
  24. package/dist/components/button/button.js +52 -151
  25. package/dist/components/calendar/calendar.js +28 -27
  26. package/dist/components/card/card-tabs.d.ts +56 -5
  27. package/dist/components/card/card-tabs.js +214 -468
  28. package/dist/components/card/card.d.ts +1 -2
  29. package/dist/components/card/card.js +64 -226
  30. package/dist/components/carousel/carousel.css +1 -1
  31. package/dist/components/carousel/carousel.d.ts +59 -4
  32. package/dist/components/carousel/carousel.js +299 -243
  33. package/dist/components/cascader/cascader.css +186 -184
  34. package/dist/components/cascader/cascader.d.ts +3 -1
  35. package/dist/components/cascader/cascader.js +28 -34
  36. package/dist/components/checkbox/checkbox.css +93 -90
  37. package/dist/components/checkbox/checkbox.d.ts +1 -1
  38. package/dist/components/checkbox/checkbox.js +171 -499
  39. package/dist/components/collapse/collapse-panels.js +145 -400
  40. package/dist/components/collapse/collapse.css +172 -170
  41. package/dist/components/collapse/collapse.d.ts +1 -1
  42. package/dist/components/collapse/collapse.js +62 -181
  43. package/dist/components/color-picker/color-picker.js +418 -982
  44. package/dist/components/context-menu/context-menu.css +4 -4
  45. package/dist/components/context-menu/context-menu.d.ts +1 -1
  46. package/dist/components/context-menu/context-menu.js +52 -138
  47. package/dist/components/date-picker/calendar/calendar-grid.js +41 -41
  48. package/dist/components/date-picker/calendar/calendar-header.js +171 -337
  49. package/dist/components/date-picker/calendar/month-grid.js +33 -103
  50. package/dist/components/date-picker/calendar/time-panel.js +81 -210
  51. package/dist/components/date-picker/calendar/year-grid.js +36 -105
  52. package/dist/components/date-picker/date-localization.js +1 -1
  53. package/dist/components/date-picker/date-picker.css +599 -642
  54. package/dist/components/date-picker/date-picker.d.ts +2 -1
  55. package/dist/components/date-picker/date-picker.js +93 -104
  56. package/dist/components/date-picker/presets.js +12 -37
  57. package/dist/components/date-picker/range-picker.d.ts +2 -1
  58. package/dist/components/date-picker/range-picker.js +217 -252
  59. package/dist/components/date-picker/types.d.ts +2 -1
  60. package/dist/components/descriptions/descriptions.css +1 -1
  61. package/dist/components/descriptions/descriptions.js +30 -39
  62. package/dist/components/drawer/drawer.css +202 -200
  63. package/dist/components/drawer/drawer.js +28 -34
  64. package/dist/components/dropdown/dropdown-core.d.ts +32 -0
  65. package/dist/components/dropdown/dropdown-core.js +156 -0
  66. package/dist/components/dropdown/dropdown.css +38 -36
  67. package/dist/components/dropdown/dropdown.d.ts +4 -31
  68. package/dist/components/dropdown/dropdown.js +90 -276
  69. package/dist/components/empty/empty.css +30 -28
  70. package/dist/components/empty/empty.js +81 -236
  71. package/dist/components/float-button/float-button.css +1 -1
  72. package/dist/components/float-button/float-button.js +36 -47
  73. package/dist/components/form/field-control.js +2 -3
  74. package/dist/components/form/form-item.js +67 -129
  75. package/dist/components/form/form.css +36 -34
  76. package/dist/components/form/form.d.ts +1 -1
  77. package/dist/components/form/form.js +29 -100
  78. package/dist/components/form/index.d.ts +1 -1
  79. package/dist/components/form/use-form.js +48 -67
  80. package/dist/components/form-actions/form-actions.d.ts +1 -0
  81. package/dist/components/form-actions/form-actions.js +10 -36
  82. package/dist/components/form-field/form-field-view.d.ts +1 -0
  83. package/dist/components/form-field/form-field-view.js +81 -288
  84. package/dist/components/form-field/form-field.js +13 -31
  85. package/dist/components/form-field/form.css +74 -72
  86. package/dist/components/form-section/form-section.d.ts +1 -0
  87. package/dist/components/form-section/form-section.js +38 -91
  88. package/dist/components/image/image-icons.js +16 -31
  89. package/dist/components/image/image.css +1 -1
  90. package/dist/components/image/image.js +298 -911
  91. package/dist/components/input/base-input.d.ts +3 -1
  92. package/dist/components/input/base-input.js +8 -7
  93. package/dist/components/input/input-shared.css +62 -60
  94. package/dist/components/input/input-shared.d.ts +1 -1
  95. package/dist/components/input/input-shared.js +56 -100
  96. package/dist/components/input/input.css +222 -220
  97. package/dist/components/input/otp.d.ts +2 -1
  98. package/dist/components/input/otp.js +143 -324
  99. package/dist/components/input/password.js +12 -67
  100. package/dist/components/input/search.js +13 -13
  101. package/dist/components/input-number/input-number.d.ts +2 -1
  102. package/dist/components/input-number/input-number.js +30 -152
  103. package/dist/components/list/list-pagination.css +107 -105
  104. package/dist/components/list/list-pagination.d.ts +56 -5
  105. package/dist/components/list/list-pagination.js +249 -316
  106. package/dist/components/list/list.css +179 -177
  107. package/dist/components/list/list.js +170 -604
  108. package/dist/components/listy/listy.css +55 -53
  109. package/dist/components/listy/listy.d.ts +43 -4
  110. package/dist/components/listy/listy.js +198 -216
  111. package/dist/components/masonry/masonry.css +1 -1
  112. package/dist/components/masonry/masonry.d.ts +1 -0
  113. package/dist/components/masonry/masonry.js +90 -244
  114. package/dist/components/mentions/mentions.css +153 -151
  115. package/dist/components/mentions/mentions.d.ts +53 -11
  116. package/dist/components/mentions/mentions.js +288 -73
  117. package/dist/components/menu/menu-render.d.ts +2 -1
  118. package/dist/components/menu/menu-render.js +149 -307
  119. package/dist/components/menu/menu.css +142 -140
  120. package/dist/components/modal/confirm-dialog.js +8 -18
  121. package/dist/components/modal/modal.css +165 -162
  122. package/dist/components/modal/modal.js +285 -731
  123. package/dist/components/modal/use-modal.js +25 -25
  124. package/dist/components/pagination/pagination.css +134 -131
  125. package/dist/components/pagination/pagination.d.ts +1 -1
  126. package/dist/components/pagination/pagination.js +137 -290
  127. package/dist/components/popconfirm/popconfirm.css +38 -36
  128. package/dist/components/popconfirm/popconfirm.js +105 -288
  129. package/dist/components/popover/popover.css +89 -87
  130. package/dist/components/popover/popover.js +168 -275
  131. package/dist/components/progress/progress.css +153 -151
  132. package/dist/components/progress/progress.js +34 -43
  133. package/dist/components/qr-code/qr-code.css +36 -34
  134. package/dist/components/qr-code/qr-code.js +83 -277
  135. package/dist/components/radio/radio.css +95 -92
  136. package/dist/components/radio/radio.d.ts +1 -1
  137. package/dist/components/radio/radio.js +114 -376
  138. package/dist/components/rate/rate.css +80 -78
  139. package/dist/components/rate/rate.d.ts +34 -6
  140. package/dist/components/rate/rate.js +160 -244
  141. package/dist/components/result/result.css +59 -57
  142. package/dist/components/result/result.d.ts +1 -0
  143. package/dist/components/result/result.js +118 -291
  144. package/dist/components/scroll-area/scroll-area.css +160 -148
  145. package/dist/components/scroll-area/scroll-area.js +284 -488
  146. package/dist/components/segmented/segmented.css +1 -1
  147. package/dist/components/segmented/segmented.js +59 -58
  148. package/dist/components/select/mobile-select.css +166 -164
  149. package/dist/components/select/mobile-select.js +48 -131
  150. package/dist/components/select/select-icons.js +59 -128
  151. package/dist/components/select/select-searchable-list.js +19 -19
  152. package/dist/components/select/select-tags.js +70 -156
  153. package/dist/components/select/select-types.d.ts +2 -1
  154. package/dist/components/select/select.css +509 -506
  155. package/dist/components/select/select.d.ts +1 -0
  156. package/dist/components/select/select.js +67 -65
  157. package/dist/components/select/use-select-selection.js +181 -269
  158. package/dist/components/skeleton/skeleton.css +105 -103
  159. package/dist/components/skeleton/skeleton.js +140 -399
  160. package/dist/components/slider/slider.css +160 -158
  161. package/dist/components/slider/slider.d.ts +45 -6
  162. package/dist/components/slider/slider.js +359 -74
  163. package/dist/components/sonner/index.d.ts +1 -1
  164. package/dist/components/sonner/sonner.css +190 -182
  165. package/dist/components/sonner/sonner.js +12 -11
  166. package/dist/components/spinner/spinner.css +80 -76
  167. package/dist/components/spinner/spinner.d.ts +1 -1
  168. package/dist/components/spinner/spinner.js +75 -219
  169. package/dist/components/splitter/splitter.css +157 -154
  170. package/dist/components/splitter/splitter.js +271 -448
  171. package/dist/components/statistic/statistic.css +1 -1
  172. package/dist/components/statistic/statistic.js +121 -413
  173. package/dist/components/status-icon/status-icon.js +14 -26
  174. package/dist/components/steps/steps-icons.js +63 -100
  175. package/dist/components/steps/steps.css +817 -807
  176. package/dist/components/steps/steps.d.ts +1 -1
  177. package/dist/components/steps/steps.js +38 -94
  178. package/dist/components/steps/use-display-steps.js +21 -54
  179. package/dist/components/switch/switch-touch.css +17 -15
  180. package/dist/components/switch/switch.css +192 -190
  181. package/dist/components/switch/switch.js +63 -196
  182. package/dist/components/table/table-filter.d.ts +1 -1
  183. package/dist/components/table/table-filter.js +68 -155
  184. package/dist/components/table/table-icons.js +77 -152
  185. package/dist/components/table/table-summary.js +30 -77
  186. package/dist/components/table/table-types.d.ts +2 -1
  187. package/dist/components/table/table.css +468 -465
  188. package/dist/components/table/table.js +85 -84
  189. package/dist/components/table/use-table-data.js +137 -248
  190. package/dist/components/tabs/tabs.css +123 -120
  191. package/dist/components/tabs/tabs.d.ts +1 -1
  192. package/dist/components/tabs/tabs.js +156 -331
  193. package/dist/components/tag/tag.css +231 -221
  194. package/dist/components/tag/tag.js +110 -248
  195. package/dist/components/textarea/textarea.css +2 -1
  196. package/dist/components/textarea/textarea.d.ts +3 -1
  197. package/dist/components/textarea/textarea.js +16 -15
  198. package/dist/components/time-picker/time-picker.d.ts +1 -0
  199. package/dist/components/time-picker/time-picker.js +88 -220
  200. package/dist/components/timeline/timeline.css +1 -1
  201. package/dist/components/timeline/timeline.js +17 -17
  202. package/dist/components/tooltip/tooltip.css +79 -77
  203. package/dist/components/tooltip/tooltip.js +105 -215
  204. package/dist/components/tour/tour.css +1 -1
  205. package/dist/components/tour/tour.d.ts +59 -6
  206. package/dist/components/tour/tour.js +343 -622
  207. package/dist/components/transfer/transfer-list.js +19 -19
  208. package/dist/components/transfer/transfer-parts.js +63 -139
  209. package/dist/components/transfer/transfer.css +192 -190
  210. package/dist/components/transfer/transfer.js +57 -56
  211. package/dist/components/tree/tree-check.js +25 -32
  212. package/dist/components/tree/tree-keyboard.js +1 -1
  213. package/dist/components/tree/tree.css +204 -200
  214. package/dist/components/tree/tree.js +139 -277
  215. package/dist/components/tree-select/select-engine.css +200 -197
  216. package/dist/components/tree-select/select-engine.js +11 -38
  217. package/dist/components/tree-select/tree-select.css +21 -19
  218. package/dist/components/tree-select/tree-select.d.ts +3 -1
  219. package/dist/components/tree-select/tree-select.js +11 -10
  220. package/dist/components/upload/upload.js +193 -308
  221. package/dist/components/watermark/watermark-context.js +8 -14
  222. package/dist/components/watermark/watermark.css +1 -1
  223. package/dist/components/watermark/watermark.js +209 -400
  224. package/dist/docs/components/stack.doc.js +1 -1
  225. package/dist/docs/components/table.doc.js +1 -1
  226. package/dist/entries/affix.d.ts +0 -2
  227. package/dist/entries/affix.js +0 -2
  228. package/dist/entries/alert.d.ts +0 -2
  229. package/dist/entries/alert.js +0 -2
  230. package/dist/entries/app.d.ts +0 -2
  231. package/dist/entries/app.js +0 -2
  232. package/dist/entries/auto-complete.d.ts +0 -2
  233. package/dist/entries/auto-complete.js +0 -2
  234. package/dist/entries/avatar.d.ts +0 -2
  235. package/dist/entries/avatar.js +0 -2
  236. package/dist/entries/badge.d.ts +0 -2
  237. package/dist/entries/badge.js +0 -2
  238. package/dist/entries/border-beam.d.ts +0 -2
  239. package/dist/entries/border-beam.js +0 -2
  240. package/dist/entries/breadcrumb.d.ts +0 -2
  241. package/dist/entries/breadcrumb.js +0 -2
  242. package/dist/entries/button.d.ts +0 -2
  243. package/dist/entries/button.js +0 -2
  244. package/dist/entries/calendar.d.ts +0 -2
  245. package/dist/entries/calendar.js +0 -2
  246. package/dist/entries/card.d.ts +0 -2
  247. package/dist/entries/card.js +0 -2
  248. package/dist/entries/carousel.d.ts +0 -2
  249. package/dist/entries/carousel.js +0 -2
  250. package/dist/entries/cascader.d.ts +0 -2
  251. package/dist/entries/cascader.js +0 -2
  252. package/dist/entries/checkbox.d.ts +0 -2
  253. package/dist/entries/checkbox.js +0 -2
  254. package/dist/entries/collapse.d.ts +0 -2
  255. package/dist/entries/collapse.js +0 -2
  256. package/dist/entries/color-picker.d.ts +0 -2
  257. package/dist/entries/color-picker.js +0 -2
  258. package/dist/entries/context-menu.d.ts +0 -2
  259. package/dist/entries/context-menu.js +0 -2
  260. package/dist/entries/date-picker.d.ts +0 -2
  261. package/dist/entries/date-picker.js +0 -2
  262. package/dist/entries/descriptions.d.ts +0 -2
  263. package/dist/entries/descriptions.js +0 -2
  264. package/dist/entries/divider.d.ts +0 -2
  265. package/dist/entries/divider.js +0 -2
  266. package/dist/entries/drawer.d.ts +0 -2
  267. package/dist/entries/drawer.js +0 -2
  268. package/dist/entries/dropdown.d.ts +0 -2
  269. package/dist/entries/dropdown.js +0 -2
  270. package/dist/entries/empty.d.ts +0 -2
  271. package/dist/entries/empty.js +0 -2
  272. package/dist/entries/float-button.d.ts +0 -2
  273. package/dist/entries/float-button.js +0 -2
  274. package/dist/entries/form-actions.d.ts +0 -2
  275. package/dist/entries/form-actions.js +0 -2
  276. package/dist/entries/form-field.d.ts +0 -2
  277. package/dist/entries/form-field.js +0 -2
  278. package/dist/entries/form-layout.d.ts +0 -2
  279. package/dist/entries/form-layout.js +0 -2
  280. package/dist/entries/form-section.d.ts +0 -2
  281. package/dist/entries/form-section.js +0 -2
  282. package/dist/entries/form.d.ts +1 -3
  283. package/dist/entries/form.js +0 -2
  284. package/dist/entries/image.d.ts +0 -2
  285. package/dist/entries/image.js +0 -2
  286. package/dist/entries/input-number.d.ts +0 -2
  287. package/dist/entries/input-number.js +0 -2
  288. package/dist/entries/input.d.ts +1 -3
  289. package/dist/entries/input.js +0 -2
  290. package/dist/entries/list.d.ts +0 -2
  291. package/dist/entries/list.js +0 -2
  292. package/dist/entries/listy.d.ts +0 -2
  293. package/dist/entries/listy.js +0 -2
  294. package/dist/entries/masonry.d.ts +0 -2
  295. package/dist/entries/masonry.js +0 -2
  296. package/dist/entries/mentions.d.ts +0 -2
  297. package/dist/entries/mentions.js +0 -2
  298. package/dist/entries/modal.d.ts +0 -2
  299. package/dist/entries/modal.js +0 -2
  300. package/dist/entries/number-input.d.ts +0 -2
  301. package/dist/entries/number-input.js +0 -2
  302. package/dist/entries/pagination.d.ts +0 -2
  303. package/dist/entries/pagination.js +0 -2
  304. package/dist/entries/popconfirm.d.ts +0 -2
  305. package/dist/entries/popconfirm.js +0 -2
  306. package/dist/entries/popover.d.ts +0 -2
  307. package/dist/entries/popover.js +0 -2
  308. package/dist/entries/progress.d.ts +0 -2
  309. package/dist/entries/progress.js +0 -2
  310. package/dist/entries/provider.d.ts +1 -3
  311. package/dist/entries/provider.js +1 -3
  312. package/dist/entries/qr-code.d.ts +0 -2
  313. package/dist/entries/qr-code.js +0 -2
  314. package/dist/entries/radio.d.ts +0 -2
  315. package/dist/entries/radio.js +0 -2
  316. package/dist/entries/range-picker.d.ts +0 -2
  317. package/dist/entries/range-picker.js +0 -2
  318. package/dist/entries/rate.d.ts +0 -2
  319. package/dist/entries/rate.js +0 -2
  320. package/dist/entries/result.d.ts +0 -2
  321. package/dist/entries/result.js +0 -2
  322. package/dist/entries/scroll-area.d.ts +0 -2
  323. package/dist/entries/scroll-area.js +0 -2
  324. package/dist/entries/segmented.d.ts +0 -2
  325. package/dist/entries/segmented.js +0 -2
  326. package/dist/entries/select.d.ts +0 -2
  327. package/dist/entries/select.js +0 -2
  328. package/dist/entries/skeleton.d.ts +0 -2
  329. package/dist/entries/skeleton.js +0 -2
  330. package/dist/entries/slider.d.ts +0 -2
  331. package/dist/entries/slider.js +0 -2
  332. package/dist/entries/sonner.d.ts +0 -2
  333. package/dist/entries/sonner.js +0 -2
  334. package/dist/entries/spinner.d.ts +0 -2
  335. package/dist/entries/spinner.js +0 -2
  336. package/dist/entries/splitter.d.ts +0 -2
  337. package/dist/entries/splitter.js +0 -2
  338. package/dist/entries/stack.d.ts +0 -2
  339. package/dist/entries/stack.js +0 -2
  340. package/dist/entries/statistic.d.ts +0 -2
  341. package/dist/entries/statistic.js +0 -2
  342. package/dist/entries/steps.d.ts +0 -2
  343. package/dist/entries/steps.js +0 -2
  344. package/dist/entries/switch.d.ts +0 -2
  345. package/dist/entries/switch.js +0 -2
  346. package/dist/entries/table.d.ts +0 -2
  347. package/dist/entries/table.js +0 -2
  348. package/dist/entries/tabs.d.ts +0 -2
  349. package/dist/entries/tabs.js +0 -2
  350. package/dist/entries/tag.d.ts +0 -2
  351. package/dist/entries/tag.js +0 -2
  352. package/dist/entries/textarea.d.ts +0 -2
  353. package/dist/entries/textarea.js +0 -2
  354. package/dist/entries/time-picker.d.ts +0 -2
  355. package/dist/entries/time-picker.js +0 -2
  356. package/dist/entries/timeline.d.ts +0 -2
  357. package/dist/entries/timeline.js +0 -2
  358. package/dist/entries/tooltip.d.ts +0 -2
  359. package/dist/entries/tooltip.js +0 -2
  360. package/dist/entries/tour.d.ts +0 -2
  361. package/dist/entries/tour.js +0 -2
  362. package/dist/entries/transfer.d.ts +0 -2
  363. package/dist/entries/transfer.js +0 -2
  364. package/dist/entries/tree-select.d.ts +0 -2
  365. package/dist/entries/tree-select.js +0 -2
  366. package/dist/entries/tree.d.ts +0 -2
  367. package/dist/entries/tree.js +0 -2
  368. package/dist/entries/upload.d.ts +0 -2
  369. package/dist/entries/upload.js +0 -2
  370. package/dist/entries/watermark.d.ts +0 -2
  371. package/dist/entries/watermark.js +0 -2
  372. package/dist/index.d.ts +5 -7
  373. package/dist/index.js +2 -4
  374. package/dist/layouts/form-layout/form-layout.d.ts +1 -0
  375. package/dist/layouts/form-layout/form-layout.js +10 -36
  376. package/dist/layouts/stack/layout.css +46 -44
  377. package/dist/layouts/stack/stack.d.ts +1 -0
  378. package/dist/layouts/stack/stack.js +16 -69
  379. package/dist/locales/ar-EG.js +25 -2
  380. package/dist/locales/create-locale.d.ts +1 -2
  381. package/dist/locales/create-locale.js +0 -28
  382. package/dist/locales/de-DE.js +25 -2
  383. package/dist/locales/en-US.js +24 -1
  384. package/dist/locales/es-ES.js +25 -2
  385. package/dist/locales/fr-FR.js +25 -2
  386. package/dist/locales/hi-IN.js +25 -2
  387. package/dist/locales/id-ID.js +25 -2
  388. package/dist/locales/index.d.ts +10 -10
  389. package/dist/locales/index.js +9 -9
  390. package/dist/locales/it-IT.js +25 -2
  391. package/dist/locales/ja-JP.js +25 -2
  392. package/dist/locales/ko-KR.js +25 -2
  393. package/dist/locales/pt-BR.js +25 -2
  394. package/dist/locales/ru-RU.js +25 -2
  395. package/dist/locales/th-TH.js +25 -2
  396. package/dist/locales/tr-TR.js +25 -2
  397. package/dist/locales/vi-VN.js +25 -2
  398. package/dist/locales/zh-CN.js +25 -2
  399. package/dist/locales/zh-TW.js +25 -2
  400. package/dist/number-input/number-input.js +24 -81
  401. package/dist/number-input/use-number-input.js +42 -42
  402. package/dist/provider/locale.d.ts +1 -1
  403. package/dist/provider/tao-context.d.ts +38 -0
  404. package/dist/provider/tao-context.js +92 -0
  405. package/dist/provider/tao-portal-scope.d.ts +14 -0
  406. package/dist/provider/tao-portal-scope.js +54 -0
  407. package/dist/provider/tao-provider.d.ts +5 -55
  408. package/dist/provider/tao-provider.js +94 -378
  409. package/dist/theme/control.css +106 -126
  410. package/dist/theme/theme.css +2 -0
  411. package/dist/utils/dialog-content.js +55 -210
  412. package/dist/utils/overlay.js +15 -30
  413. package/dist/utils/rc-compat.d.ts +13 -0
  414. package/dist/utils/rc-compat.js +48 -0
  415. package/dist/utils/refs.js +5 -19
  416. package/package.json +10 -16
@@ -1,9 +1,9 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
3
- import { useNotification } from "@rc-component/notification";
4
- import { useLayoutEffect } from "@rc-component/util";
5
- import { useMemo, useRef } from "react";
6
- import { TaoPortalScope, useTaoConfig, useTaoInternalConfig } from "../../provider/tao-provider.js";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef, useState } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import { useTaoConfig, useTaoInternalConfig } from "../../provider/tao-context.js";
5
+ import { TaoPortalScope } from "../../provider/tao-portal-scope.js";
6
+ import { useIsomorphicLayoutEffect } from "../../utils/rc-compat.js";
7
7
  import { useCommittedRef } from "../../utils/refs.js";
8
8
  import { cx } from "../../utils/semantic.js";
9
9
  import { Spinner } from "../spinner/spinner.js";
@@ -50,116 +50,225 @@ function iconFor(type, icon) {
50
50
  })
51
51
  });
52
52
  }
53
+ function NoticeCard({ entry, index, onDismiss, closeLabel, prefixCls }) {
54
+ const [hovered, setHovered] = useState(false);
55
+ const [percent, setPercent] = useState(0);
56
+ const remainingRef = useRef('number' == typeof entry.duration && entry.duration > 0 ? 1000 * entry.duration : 0);
57
+ const onDismissRef = useCommittedRef(onDismiss);
58
+ useEffect(()=>{
59
+ if (entry.version < 0) return;
60
+ remainingRef.current = 'number' == typeof entry.duration && entry.duration > 0 ? 1000 * entry.duration : 0;
61
+ setPercent(0);
62
+ }, [
63
+ entry.duration,
64
+ entry.version
65
+ ]);
66
+ useEffect(()=>{
67
+ if (entry.version < 0 || 'number' != typeof entry.duration || entry.duration <= 0 || entry.pauseOnHover && hovered) return;
68
+ const start = Date.now();
69
+ const wait = Math.max(0, remainingRef.current);
70
+ const timer = setTimeout(()=>{
71
+ onDismissRef.current(entry.key);
72
+ }, wait);
73
+ const totalMs = 1000 * entry.duration;
74
+ const interval = entry.showProgress ? setInterval(()=>{
75
+ const elapsed = totalMs - Math.max(0, wait - (Date.now() - start));
76
+ setPercent(Math.min(100, Math.round(elapsed / totalMs * 100)));
77
+ }, 100) : void 0;
78
+ return ()=>{
79
+ clearTimeout(timer);
80
+ if (interval) clearInterval(interval);
81
+ remainingRef.current = Math.max(0, wait - (Date.now() - start));
82
+ };
83
+ }, [
84
+ entry.duration,
85
+ entry.key,
86
+ entry.pauseOnHover,
87
+ entry.showProgress,
88
+ entry.version,
89
+ hovered,
90
+ onDismissRef
91
+ ]);
92
+ const closableObj = 'object' == typeof entry.closable ? entry.closable : void 0;
93
+ const showClose = false !== entry.closable;
94
+ return /*#__PURE__*/ jsxs("div", {
95
+ ...entry.props,
96
+ role: entry.role,
97
+ className: cx(`${prefixCls}-notice`, entry.classNames.root, entry.className, 'string' == typeof entry.props?.className ? entry.props.className : void 0),
98
+ style: {
99
+ '--notification-index': index,
100
+ '--notification-y': `${64 * index}px`,
101
+ ...entry.styles.root,
102
+ ...entry.style,
103
+ ...'object' == typeof entry.props?.style && entry.props.style ? entry.props.style : {}
104
+ },
105
+ onClick: entry.onClick,
106
+ onMouseEnter: ()=>setHovered(true),
107
+ onMouseLeave: ()=>setHovered(false),
108
+ children: [
109
+ /*#__PURE__*/ jsxs("div", {
110
+ className: entry.classNames.wrapper,
111
+ style: entry.styles.wrapper,
112
+ children: [
113
+ null != entry.icon && /*#__PURE__*/ jsx("div", {
114
+ className: entry.classNames.icon,
115
+ style: entry.styles.icon,
116
+ children: entry.icon
117
+ }),
118
+ /*#__PURE__*/ jsxs("div", {
119
+ className: entry.classNames.section,
120
+ style: entry.styles.section,
121
+ children: [
122
+ null != entry.title && /*#__PURE__*/ jsx("div", {
123
+ className: entry.classNames.title,
124
+ style: entry.styles.title,
125
+ children: entry.title
126
+ }),
127
+ null != entry.description && /*#__PURE__*/ jsx("div", {
128
+ className: entry.classNames.description,
129
+ style: entry.styles.description,
130
+ children: entry.description
131
+ }),
132
+ null != entry.actions && /*#__PURE__*/ jsx("div", {
133
+ className: entry.classNames.actions,
134
+ style: entry.styles.actions,
135
+ children: entry.actions
136
+ })
137
+ ]
138
+ })
139
+ ]
140
+ }),
141
+ showClose && /*#__PURE__*/ jsx("button", {
142
+ type: "button",
143
+ disabled: closableObj?.disabled,
144
+ "aria-label": closableObj?.['aria-label'] ?? closeLabel,
145
+ className: entry.classNames.close,
146
+ style: entry.styles.close,
147
+ onClick: (event)=>{
148
+ event.stopPropagation();
149
+ if (!closableObj?.disabled) onDismiss(entry.key);
150
+ },
151
+ children: closableObj?.closeIcon ?? '×'
152
+ }),
153
+ entry.showProgress && 'number' == typeof entry.duration && entry.duration > 0 && /*#__PURE__*/ jsx("progress", {
154
+ className: entry.classNames.progress,
155
+ style: entry.styles.progress,
156
+ max: 100,
157
+ value: percent
158
+ })
159
+ ]
160
+ });
161
+ }
53
162
  function useNoticeHolder(kind, config) {
54
- const $ = c(33);
55
- const { tokenStyle } = useTaoInternalConfig();
163
+ const { tokenStyle, locale } = useTaoInternalConfig();
56
164
  const notificationConfig = config;
57
- const t0 = config.prefixCls ?? `tao-app-${kind}`;
58
- const t1 = config.getContainer;
59
- const t2 = config.duration ?? ("message" === kind ? 3 : 4.5);
60
- const t3 = config.maxCount;
61
- const t4 = config.pauseOnHover ?? true;
62
- const t5 = notificationConfig.showProgress;
63
- let t6;
64
- if ($[0] !== config.stack || $[1] !== kind) {
65
- t6 = config.stack ?? ("notification" === kind ? {
66
- threshold: 3
67
- } : false);
68
- $[0] = config.stack;
69
- $[1] = kind;
70
- $[2] = t6;
71
- } else t6 = $[2];
72
- const t7 = "notification" === kind;
73
- let t8;
74
- if ($[3] !== config || $[4] !== notificationConfig.classNames) {
75
- t8 = noticeClasses(resolveAppSemantic(notificationConfig.classNames, config));
76
- $[3] = config;
77
- $[4] = notificationConfig.classNames;
78
- $[5] = t8;
79
- } else t8 = $[5];
80
- const t9 = config;
81
- let t10;
82
- if ($[6] !== notificationConfig.styles || $[7] !== t9) {
83
- t10 = resolveAppSemantic(notificationConfig.styles, t9);
84
- $[6] = notificationConfig.styles;
85
- $[7] = t9;
86
- $[8] = t10;
87
- } else t10 = $[8];
88
- let t11;
89
- if ($[9] !== config) {
90
- t11 = config.transitionName ? {
91
- motionName: config.transitionName
92
- } : void 0;
93
- $[9] = config;
94
- $[10] = t11;
95
- } else t11 = $[10];
96
- let t12;
97
- if ($[11] !== config.rtl || $[12] !== config.top || $[13] !== kind || $[14] !== notificationConfig.bottom || $[15] !== tokenStyle) {
98
- t12 = (node, t13)=>{
99
- const { key } = t13;
100
- return /*#__PURE__*/ jsx(TaoPortalScope, {
101
- children: /*#__PURE__*/ jsx("div", {
102
- "data-tao-app-notices": kind,
103
- "data-tao-placement": key,
104
- dir: void 0 === config.rtl ? void 0 : config.rtl ? "rtl" : "ltr",
105
- style: {
106
- ...tokenStyle,
107
- top: String(key).startsWith("top") ? config.top ?? 24 : void 0,
108
- bottom: String(key).startsWith("bottom") ? notificationConfig.bottom ?? 24 : void 0
109
- },
110
- children: node
111
- })
112
- });
165
+ const prefixCls = config.prefixCls ?? `tao-app-${kind}`;
166
+ const [entries, setEntries] = useState([]);
167
+ const entriesRef = useRef([]);
168
+ entriesRef.current = entries;
169
+ const latestConfig = useCommittedRef(config);
170
+ const versionRef = useRef(0);
171
+ const api = useMemo(()=>{
172
+ const close = (key)=>{
173
+ const target = entriesRef.current.find((item)=>item.key === key);
174
+ if (!target) return;
175
+ const next = entriesRef.current.filter((item)=>item.key !== key);
176
+ entriesRef.current = next;
177
+ setEntries(next);
178
+ target.onClose?.();
179
+ };
180
+ const destroy = ()=>{
181
+ const existing = [
182
+ ...entriesRef.current
183
+ ];
184
+ entriesRef.current = [];
185
+ setEntries([]);
186
+ for (const item of existing)item.onClose?.();
113
187
  };
114
- $[11] = config.rtl;
115
- $[12] = config.top;
116
- $[13] = kind;
117
- $[14] = notificationConfig.bottom;
118
- $[15] = tokenStyle;
119
- $[16] = t12;
120
- } else t12 = $[16];
121
- let t13;
122
- if ($[17] !== config.getContainer || $[18] !== config.maxCount || $[19] !== notificationConfig.showProgress || $[20] !== t0 || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t2 || $[25] !== t4 || $[26] !== t6 || $[27] !== t7 || $[28] !== t8) {
123
- t13 = {
124
- prefixCls: t0,
125
- getContainer: t1,
126
- duration: t2,
127
- maxCount: t3,
128
- pauseOnHover: t4,
129
- showProgress: t5,
130
- stack: t6,
131
- closable: t7,
132
- classNames: t8,
133
- styles: t10,
134
- motion: t11,
135
- renderNotifications: t12
188
+ const open = (input)=>{
189
+ const nextVersion = ++versionRef.current;
190
+ const entry = {
191
+ ...input,
192
+ version: nextVersion
193
+ };
194
+ const idx = entriesRef.current.findIndex((item)=>item.key === input.key);
195
+ let next;
196
+ if (idx >= 0) {
197
+ next = [
198
+ ...entriesRef.current
199
+ ];
200
+ next[idx] = entry;
201
+ } else next = [
202
+ ...entriesRef.current,
203
+ entry
204
+ ];
205
+ const maxCount = latestConfig.current.maxCount ?? 0;
206
+ const evicted = [];
207
+ while(maxCount > 0 && next.length > maxCount){
208
+ const removed = next.shift();
209
+ if (removed) evicted.push(removed);
210
+ }
211
+ entriesRef.current = next;
212
+ setEntries(next);
213
+ for (const removed of evicted)removed.onClose?.();
136
214
  };
137
- $[17] = config.getContainer;
138
- $[18] = config.maxCount;
139
- $[19] = notificationConfig.showProgress;
140
- $[20] = t0;
141
- $[21] = t10;
142
- $[22] = t11;
143
- $[23] = t12;
144
- $[24] = t2;
145
- $[25] = t4;
146
- $[26] = t6;
147
- $[27] = t7;
148
- $[28] = t8;
149
- $[29] = t13;
150
- } else t13 = $[29];
151
- const [api, holder] = useNotification(t13);
152
- let t14;
153
- if ($[30] !== api || $[31] !== holder) {
154
- t14 = [
155
- api,
156
- holder
157
- ];
158
- $[30] = api;
159
- $[31] = holder;
160
- $[32] = t14;
161
- } else t14 = $[32];
162
- return t14;
215
+ return {
216
+ open,
217
+ close,
218
+ destroy
219
+ };
220
+ }, [
221
+ latestConfig
222
+ ]);
223
+ const grouped = useMemo(()=>{
224
+ const map = new Map();
225
+ for (const entry of entries){
226
+ const list = map.get(entry.placement);
227
+ if (list) list.push(entry);
228
+ else map.set(entry.placement, [
229
+ entry
230
+ ]);
231
+ }
232
+ return map;
233
+ }, [
234
+ entries
235
+ ]);
236
+ const container = "u" > typeof document ? config.getContainer?.() ?? document.body : null;
237
+ const listClasses = noticeClasses(resolveAppSemantic(notificationConfig.classNames, config));
238
+ const listStyles = resolveAppSemantic(notificationConfig.styles, config);
239
+ const holder = container && grouped.size > 0 ? /*#__PURE__*/ createPortal([
240
+ ...grouped.entries()
241
+ ].map(([placement, items])=>/*#__PURE__*/ jsx(TaoPortalScope, {
242
+ children: /*#__PURE__*/ jsx("div", {
243
+ "data-tao-app-notices": kind,
244
+ "data-tao-placement": placement,
245
+ dir: void 0 === config.rtl ? void 0 : config.rtl ? 'rtl' : 'ltr',
246
+ style: {
247
+ ...tokenStyle,
248
+ top: placement.startsWith('top') ? config.top ?? 24 : void 0,
249
+ bottom: placement.startsWith('bottom') ? notificationConfig.bottom ?? 24 : void 0
250
+ },
251
+ children: /*#__PURE__*/ jsx("div", {
252
+ className: cx(`${prefixCls}-list`, listClasses.list),
253
+ style: listStyles?.list,
254
+ children: /*#__PURE__*/ jsx("div", {
255
+ className: cx(`${prefixCls}-list-content`, listClasses.listContent),
256
+ style: listStyles?.listContent,
257
+ children: items.map((entry, idx)=>/*#__PURE__*/ jsx(NoticeCard, {
258
+ entry: entry,
259
+ index: idx,
260
+ prefixCls: prefixCls,
261
+ closeLabel: locale.close,
262
+ onDismiss: api.close
263
+ }, entry.key))
264
+ })
265
+ })
266
+ })
267
+ }, placement)), container) : null;
268
+ return [
269
+ api,
270
+ holder
271
+ ];
163
272
  }
164
273
  function messageResult(promise, close) {
165
274
  return Object.assign(close, {
@@ -175,7 +284,7 @@ function useAppMessages(config = {}) {
175
284
  const sequence = useRef(0);
176
285
  const disposed = useRef(false);
177
286
  const latest = useCommittedRef(config);
178
- useLayoutEffect(()=>{
287
+ useIsomorphicLayoutEffect(()=>{
179
288
  disposed.current = false;
180
289
  return ()=>{
181
290
  disposed.current = true;
@@ -184,39 +293,38 @@ function useAppMessages(config = {}) {
184
293
  };
185
294
  }, []);
186
295
  const api = useMemo(()=>{
187
- const finish = (key, life_0)=>{
188
- if (active.current.get(key) !== life_0) return;
296
+ const finish = (key, life)=>{
297
+ if (active.current.get(key) !== life) return;
189
298
  active.current.delete(key);
190
299
  try {
191
- life_0.onClose?.();
300
+ life.onClose?.();
192
301
  } finally{
193
- for (const resolve of life_0.resolve)resolve();
302
+ for (const resolve of life.resolve)resolve();
194
303
  }
195
304
  };
196
- const close = (key_0, life_1 = active.current.get(key_0))=>{
197
- if (!life_1 || active.current.get(key_0) !== life_1) return;
198
- notices.close(key_0);
199
- finish(key_0, life_1);
305
+ const close = (key, life = active.current.get(key))=>{
306
+ if (!life || active.current.get(key) !== life) return;
307
+ notices.close(key);
308
+ finish(key, life);
200
309
  };
201
310
  const open = (args)=>{
202
311
  if (disposed.current) return messageResult(Promise.resolve(true), ()=>{});
203
312
  const defaults = latest.current;
204
- const key_1 = null == args.key ? `tao-app-message-${sequence.current++}` : explicitMessageKey(args.key);
313
+ const key = null == args.key ? `tao-app-message-${sequence.current++}` : explicitMessageKey(args.key);
205
314
  const merged = {
206
315
  ...defaults,
207
316
  ...args
208
317
  };
209
318
  const classNames = noticeClasses(resolveAppSemantic(defaults.classNames, merged), resolveAppSemantic(args.classNames, merged));
210
319
  const styles = noticeStyles(resolveAppSemantic(defaults.styles, merged), resolveAppSemantic(args.styles, merged));
211
- const life_2 = active.current.get(key_1) ?? {
320
+ const life = active.current.get(key) ?? {
212
321
  resolve: []
213
322
  };
214
- life_2.onClose = args.onClose;
215
- const promise = new Promise((resolve_0)=>life_2.resolve.push(()=>resolve_0(true)));
216
- active.current.set(key_1, life_2);
323
+ life.onClose = args.onClose;
324
+ const promise = new Promise((resolve)=>life.resolve.push(()=>resolve(true)));
325
+ active.current.set(key, life);
217
326
  notices.open({
218
- ...args,
219
- key: key_1,
327
+ key,
220
328
  title: args.content,
221
329
  duration: args.duration ?? defaults.duration ?? 3,
222
330
  pauseOnHover: args.pauseOnHover ?? defaults.pauseOnHover ?? true,
@@ -224,20 +332,23 @@ function useAppMessages(config = {}) {
224
332
  closable: false,
225
333
  placement: 'top',
226
334
  icon: iconFor(args.type, args.icon),
335
+ className: args.className,
336
+ style: args.style,
227
337
  classNames,
228
338
  styles,
229
- onClose: ()=>finish(key_1, life_2)
339
+ onClick: args.onClick,
340
+ onClose: ()=>finish(key, life)
230
341
  });
231
342
  const maxCount = defaults.maxCount ?? 0;
232
343
  while(maxCount > 0 && active.current.size > maxCount)close(active.current.keys().next().value);
233
- return messageResult(promise, ()=>close(key_1, life_2));
344
+ return messageResult(promise, ()=>close(key, life));
234
345
  };
235
346
  const typed = (type)=>(content, duration, onClose)=>{
236
- const args_0 = content && 'object' == typeof content && 'content' in content ? content : {
347
+ const args = content && 'object' == typeof content && 'content' in content ? content : {
237
348
  content
238
349
  };
239
350
  return open({
240
- ...args_0,
351
+ ...args,
241
352
  type,
242
353
  ...'number' == typeof duration ? {
243
354
  duration
@@ -256,13 +367,13 @@ function useAppMessages(config = {}) {
256
367
  warning: typed('warning'),
257
368
  error: typed('error'),
258
369
  loading: typed('loading'),
259
- destroy: (key_2)=>{
260
- if (void 0 !== key_2) return void close(explicitMessageKey(key_2));
370
+ destroy: (key)=>{
371
+ if (void 0 !== key) return void close(explicitMessageKey(key));
261
372
  const failures = [];
262
- for (const [key_3, life_3] of [
373
+ for (const [k, life] of [
263
374
  ...active.current
264
375
  ])try {
265
- close(key_3, life_3);
376
+ close(k, life);
266
377
  } catch (error) {
267
378
  failures.push(error);
268
379
  }
@@ -279,137 +390,77 @@ function useAppMessages(config = {}) {
279
390
  holder
280
391
  ];
281
392
  }
282
- function useAppNotifications(t0) {
283
- const $ = c(23);
284
- let t1;
285
- if ($[0] !== t0) {
286
- t1 = void 0 === t0 ? {} : t0;
287
- $[0] = t0;
288
- $[1] = t1;
289
- } else t1 = $[1];
290
- const config = t1;
393
+ function useAppNotifications(config = {}) {
291
394
  const { locale } = useTaoConfig();
292
395
  const closeLabel = useCommittedRef(locale.close);
293
- const [notices, holder] = useNoticeHolder("notification", config);
396
+ const [notices, holder] = useNoticeHolder('notification', config);
294
397
  const latest = useCommittedRef(config);
295
- let t2;
296
- if ($[2] !== closeLabel || $[3] !== latest || $[4] !== notices) {
297
- t2 = (args)=>{
398
+ const sequence = useRef(0);
399
+ const api = useMemo(()=>{
400
+ const open = (args)=>{
298
401
  const defaults = latest.current;
299
402
  const merged = {
300
403
  ...defaults,
301
404
  ...args
302
405
  };
303
- const closeIcon = void 0 === args.closeIcon ? void 0 === defaults.closeIcon ? "\xD7" : defaults.closeIcon : args.closeIcon;
406
+ const closeIcon = void 0 === args.closeIcon ? void 0 === defaults.closeIcon ? '×' : defaults.closeIcon : args.closeIcon;
304
407
  const closable = false === args.closable || null === args.closable || false === closeIcon || null === closeIcon ? false : {
305
408
  closeIcon,
306
- "aria-label": closeLabel.current,
307
- ..."object" == typeof args.closable ? args.closable : {}
409
+ 'aria-label': closeLabel.current,
410
+ ...'object' == typeof args.closable ? args.closable : {}
308
411
  };
309
412
  const classNames = noticeClasses(resolveAppSemantic(defaults.classNames, merged), resolveAppSemantic(args.classNames, merged));
310
413
  const styles = noticeStyles(resolveAppSemantic(defaults.styles, merged), resolveAppSemantic(args.styles, merged));
311
- const disabledClose = "object" == typeof closable && closable?.disabled;
312
- const title = args.title ?? args.message;
414
+ const key = args.key ?? `tao-app-notification-${sequence.current++}`;
313
415
  notices.open({
314
- ...args,
315
- title: disabledClose ? /*#__PURE__*/ jsxs(Fragment, {
316
- children: [
317
- title,
318
- /*#__PURE__*/ jsx("button", {
319
- type: "button",
320
- disabled: true,
321
- "aria-label": closable["aria-label"] ?? closeLabel.current,
322
- className: classNames.close,
323
- style: styles.close,
324
- children: closable.closeIcon
325
- })
326
- ]
327
- }) : title,
416
+ key,
417
+ title: args.title ?? args.message,
418
+ description: args.description,
328
419
  actions: args.actions ?? args.btn,
329
- placement: args.placement ?? defaults.placement ?? "topRight",
420
+ placement: args.placement ?? defaults.placement ?? 'topRight',
330
421
  duration: args.duration ?? defaults.duration ?? 4.5,
331
422
  pauseOnHover: args.pauseOnHover ?? defaults.pauseOnHover ?? true,
332
423
  showProgress: args.showProgress ?? defaults.showProgress,
333
- role: args.role ?? "alert",
424
+ role: args.role ?? 'alert',
334
425
  icon: iconFor(args.type, args.icon),
426
+ className: args.className,
427
+ style: args.style,
335
428
  classNames,
336
429
  styles,
337
- closable: disabledClose ? false : closable
430
+ closable,
431
+ props: args.props,
432
+ onClick: args.onClick,
433
+ onClose: args.onClose
338
434
  });
339
435
  };
340
- $[2] = closeLabel;
341
- $[3] = latest;
342
- $[4] = notices;
343
- $[5] = t2;
344
- } else t2 = $[5];
345
- const open = t2;
346
- let t3;
347
- let t4;
348
- let t5;
349
- let t6;
350
- if ($[6] !== open) {
351
- t3 = (args_0)=>open({
352
- ...args_0,
353
- type: "success"
354
- });
355
- t4 = (args_1)=>open({
356
- ...args_1,
357
- type: "info"
358
- });
359
- t5 = (args_2)=>open({
360
- ...args_2,
361
- type: "error"
362
- });
363
- t6 = (args_3)=>open({
364
- ...args_3,
365
- type: "warning"
366
- });
367
- $[6] = open;
368
- $[7] = t3;
369
- $[8] = t4;
370
- $[9] = t5;
371
- $[10] = t6;
372
- } else {
373
- t3 = $[7];
374
- t4 = $[8];
375
- t5 = $[9];
376
- t6 = $[10];
377
- }
378
- let t7;
379
- if ($[11] !== notices) {
380
- t7 = (key)=>void 0 === key ? notices.destroy() : notices.close(key);
381
- $[11] = notices;
382
- $[12] = t7;
383
- } else t7 = $[12];
384
- let t8;
385
- if ($[13] !== open || $[14] !== t3 || $[15] !== t4 || $[16] !== t5 || $[17] !== t6 || $[18] !== t7) {
386
- t8 = {
436
+ return {
387
437
  open,
388
- success: t3,
389
- info: t4,
390
- error: t5,
391
- warning: t6,
392
- destroy: t7
438
+ success: (args)=>open({
439
+ ...args,
440
+ type: 'success'
441
+ }),
442
+ info: (args)=>open({
443
+ ...args,
444
+ type: 'info'
445
+ }),
446
+ error: (args)=>open({
447
+ ...args,
448
+ type: 'error'
449
+ }),
450
+ warning: (args)=>open({
451
+ ...args,
452
+ type: 'warning'
453
+ }),
454
+ destroy: (key)=>void 0 === key ? notices.destroy() : notices.close(key)
393
455
  };
394
- $[13] = open;
395
- $[14] = t3;
396
- $[15] = t4;
397
- $[16] = t5;
398
- $[17] = t6;
399
- $[18] = t7;
400
- $[19] = t8;
401
- } else t8 = $[19];
402
- const api = t8;
403
- let t9;
404
- if ($[20] !== api || $[21] !== holder) {
405
- t9 = [
406
- api,
407
- holder
408
- ];
409
- $[20] = api;
410
- $[21] = holder;
411
- $[22] = t9;
412
- } else t9 = $[22];
413
- return t9;
456
+ }, [
457
+ closeLabel,
458
+ latest,
459
+ notices
460
+ ]);
461
+ return [
462
+ api,
463
+ holder
464
+ ];
414
465
  }
415
466
  export { resolveAppSemantic, useAppMessages, useAppNotifications };
@@ -1,4 +1,3 @@
1
- import type { NotificationProps } from '@rc-component/notification';
2
1
  import type { CSSProperties, ElementType, Key, MouseEvent, ReactNode } from 'react';
3
2
  import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic.js';
4
3
  import type { ButtonProps } from '../button/button.js';
@@ -75,8 +74,12 @@ export interface AppNotificationArgs {
75
74
  readonly type?: Exclude<AppNoticeType, 'loading'>;
76
75
  onClick?: () => void;
77
76
  closeIcon?: ReactNode;
78
- closable?: NotificationProps['closable'];
79
- props?: NotificationProps['props'];
77
+ closable?: boolean | ({
78
+ closeIcon?: ReactNode;
79
+ disabled?: boolean;
80
+ 'aria-label'?: string;
81
+ } & Record<string, unknown>);
82
+ props?: Record<string, unknown>;
80
83
  role?: 'alert' | 'status';
81
84
  }
82
85
  export interface AppNotificationConfig {