taro-uno-ui 0.9.0 → 1.0.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 (647) hide show
  1. package/README.md +21 -0
  2. package/dist/app.config.d.ts +38 -0
  3. package/dist/app.d.ts +6 -0
  4. package/dist/components/basic/Button/Button.d.ts +6 -0
  5. package/dist/components/basic/Button/Button.styles.d.ts +2 -0
  6. package/dist/components/basic/Button/Button.types.d.ts +74 -0
  7. package/dist/components/basic/Button/index.d.ts +4 -0
  8. package/dist/components/basic/Divider/Divider.d.ts +6 -0
  9. package/dist/components/basic/Divider/Divider.styles.d.ts +87 -0
  10. package/dist/components/basic/Divider/Divider.types.d.ts +242 -0
  11. package/dist/components/basic/Divider/index.d.ts +6 -0
  12. package/dist/components/basic/Icon/Icon.d.ts +5 -0
  13. package/dist/components/basic/Icon/Icon.data.d.ts +29 -0
  14. package/dist/components/basic/Icon/Icon.styles.d.ts +61 -0
  15. package/dist/components/basic/Icon/Icon.types.d.ts +199 -0
  16. package/dist/components/basic/Icon/IconManager.d.ts +120 -0
  17. package/dist/components/basic/Icon/index.d.ts +6 -0
  18. package/dist/components/basic/Text/Text.d.ts +7 -0
  19. package/dist/components/basic/Text/Text.styles.d.ts +67 -0
  20. package/dist/components/basic/Text/Text.types.d.ts +274 -0
  21. package/dist/components/basic/Text/index.d.ts +5 -0
  22. package/dist/components/basic/Typography/Typography.d.ts +8 -0
  23. package/dist/components/basic/Typography/Typography.styles.d.ts +83 -0
  24. package/dist/components/basic/Typography/Typography.types.d.ts +245 -0
  25. package/dist/components/basic/Typography/index.d.ts +3 -0
  26. package/dist/components/basic/Video/Video.d.ts +7 -0
  27. package/dist/components/basic/Video/Video.styles.d.ts +212 -0
  28. package/dist/components/basic/Video/Video.types.d.ts +447 -0
  29. package/dist/components/basic/Video/index.d.ts +10 -0
  30. package/dist/components/basic/index.d.ts +217 -0
  31. package/dist/components/common/ErrorBoundary.d.ts +19 -0
  32. package/dist/components/common/LazyComponent.d.ts +78 -0
  33. package/dist/components/common/ResponsiveContainer.d.ts +23 -0
  34. package/dist/components/common/ResponsiveGrid.d.ts +44 -0
  35. package/dist/components/common/SecurityProvider.d.ts +15 -0
  36. package/dist/components/common/ThemeProvider.d.ts +17 -0
  37. package/dist/components/common/VirtualList.d.ts +89 -0
  38. package/dist/components/common/index.d.ts +17 -0
  39. package/dist/components/display/Avatar/Avatar.d.ts +3 -0
  40. package/dist/components/display/Avatar/Avatar.styles.d.ts +2 -0
  41. package/dist/components/display/Avatar/Avatar.types.d.ts +37 -0
  42. package/dist/components/display/Avatar/index.d.ts +3 -0
  43. package/dist/components/display/Badge/Badge.d.ts +3 -0
  44. package/dist/components/display/Badge/Badge.types.d.ts +27 -0
  45. package/dist/components/display/Badge/index.d.ts +2 -0
  46. package/dist/components/display/Calendar/Calendar.d.ts +5 -0
  47. package/dist/components/display/Calendar/Calendar.styles.d.ts +2 -0
  48. package/dist/components/display/Calendar/Calendar.types.d.ts +87 -0
  49. package/dist/components/display/Calendar/index.d.ts +3 -0
  50. package/dist/components/display/Card/Card.d.ts +3 -0
  51. package/dist/components/display/Card/Card.styles.d.ts +1 -0
  52. package/dist/components/display/Card/Card.types.d.ts +52 -0
  53. package/dist/components/display/Card/index.d.ts +3 -0
  54. package/dist/components/display/Carousel/Carousel.d.ts +5 -0
  55. package/dist/components/display/Carousel/Carousel.styles.d.ts +2 -0
  56. package/dist/components/display/Carousel/Carousel.types.d.ts +55 -0
  57. package/dist/components/display/Carousel/index.d.ts +3 -0
  58. package/dist/components/display/List/List.d.ts +4 -0
  59. package/dist/components/display/List/List.styles.d.ts +1 -0
  60. package/dist/components/display/List/List.types.d.ts +64 -0
  61. package/dist/components/display/List/index.d.ts +3 -0
  62. package/dist/components/display/Rate/Rate.d.ts +6 -0
  63. package/dist/components/display/Rate/Rate.styles.d.ts +100 -0
  64. package/dist/components/display/Rate/Rate.types.d.ts +105 -0
  65. package/dist/components/display/Rate/index.d.ts +17 -0
  66. package/dist/components/display/Table/Table.d.ts +7 -0
  67. package/dist/components/display/Table/Table.styles.d.ts +84 -0
  68. package/dist/components/display/Table/Table.types.d.ts +251 -0
  69. package/dist/components/display/Table/index.d.ts +4 -0
  70. package/dist/components/display/Tag/Tag.d.ts +5 -0
  71. package/dist/components/display/Tag/Tag.styles.d.ts +2 -0
  72. package/dist/components/display/Tag/Tag.types.d.ts +47 -0
  73. package/dist/components/display/Tag/index.d.ts +3 -0
  74. package/dist/components/display/Timeline/Timeline.d.ts +16 -0
  75. package/dist/components/display/Timeline/Timeline.styles.d.ts +2 -0
  76. package/dist/components/display/Timeline/Timeline.types.d.ts +53 -0
  77. package/dist/components/display/Timeline/index.d.ts +3 -0
  78. package/dist/components/display/index.d.ts +67 -0
  79. package/dist/components/feedback/Loading/Loading.d.ts +4 -0
  80. package/dist/components/feedback/Loading/Loading.styles.d.ts +2 -0
  81. package/dist/components/feedback/Loading/Loading.types.d.ts +29 -0
  82. package/dist/components/feedback/Loading/index.d.ts +4 -0
  83. package/dist/components/feedback/Message/Message.d.ts +4 -0
  84. package/dist/components/feedback/Message/Message.styles.d.ts +34 -0
  85. package/dist/components/feedback/Message/Message.types.d.ts +33 -0
  86. package/dist/components/feedback/Message/index.d.ts +4 -0
  87. package/dist/components/feedback/Modal/Modal.d.ts +8 -0
  88. package/dist/components/feedback/Modal/Modal.styles.d.ts +18 -0
  89. package/dist/components/feedback/Modal/Modal.types.d.ts +143 -0
  90. package/dist/components/feedback/Modal/index.d.ts +3 -0
  91. package/dist/components/feedback/Notification/Notification.d.ts +4 -0
  92. package/dist/components/feedback/Notification/Notification.styles.d.ts +88 -0
  93. package/dist/components/feedback/Notification/Notification.types.d.ts +279 -0
  94. package/dist/components/feedback/Notification/NotificationManager.d.ts +4 -0
  95. package/dist/components/feedback/Notification/index.d.ts +25 -0
  96. package/dist/components/feedback/Progress/Progress.d.ts +4 -0
  97. package/dist/components/feedback/Progress/Progress.styles.d.ts +261 -0
  98. package/dist/components/feedback/Progress/Progress.test.simple.d.ts +2 -0
  99. package/dist/components/feedback/Progress/Progress.types.d.ts +147 -0
  100. package/dist/components/feedback/Progress/index.d.ts +3 -0
  101. package/dist/components/feedback/Progress/utils/animation.d.ts +55 -0
  102. package/dist/components/feedback/Progress/utils/index.d.ts +2 -0
  103. package/dist/components/feedback/Progress/utils/progress-calculator.d.ts +75 -0
  104. package/dist/components/feedback/Result/Result.d.ts +7 -0
  105. package/dist/components/feedback/Result/Result.styles.d.ts +2 -0
  106. package/dist/components/feedback/Result/Result.types.d.ts +66 -0
  107. package/dist/components/feedback/Result/index.d.ts +3 -0
  108. package/dist/components/feedback/Toast/Toast.d.ts +7 -0
  109. package/dist/components/feedback/Toast/Toast.styles.d.ts +14 -0
  110. package/dist/components/feedback/Toast/Toast.types.d.ts +81 -0
  111. package/dist/components/feedback/Toast/index.d.ts +3 -0
  112. package/dist/components/feedback/Tooltip/Tooltip.d.ts +4 -0
  113. package/dist/components/feedback/Tooltip/Tooltip.examples.d.ts +6 -0
  114. package/dist/components/feedback/Tooltip/Tooltip.styles.d.ts +78 -0
  115. package/dist/components/feedback/Tooltip/Tooltip.types.d.ts +130 -0
  116. package/dist/components/feedback/Tooltip/index.d.ts +3 -0
  117. package/dist/components/feedback/index.d.ts +71 -0
  118. package/dist/components/form/Cascader/Cascader.d.ts +7 -0
  119. package/dist/components/form/Cascader/Cascader.styles.d.ts +107 -0
  120. package/dist/components/form/Cascader/Cascader.types.d.ts +418 -0
  121. package/dist/components/form/Cascader/hooks/index.d.ts +3 -0
  122. package/dist/components/form/Cascader/hooks/useCascaderFieldNames.d.ts +12 -0
  123. package/dist/components/form/Cascader/hooks/useCascaderOptions.d.ts +15 -0
  124. package/dist/components/form/Cascader/hooks/useCascaderState.d.ts +23 -0
  125. package/dist/components/form/Cascader/index.d.ts +6 -0
  126. package/dist/components/form/Cascader/utils/formatDisplayValue.d.ts +9 -0
  127. package/dist/components/form/Cascader/utils/index.d.ts +1 -0
  128. package/dist/components/form/Checkbox/Checkbox.d.ts +6 -0
  129. package/dist/components/form/Checkbox/Checkbox.styles.d.ts +111 -0
  130. package/dist/components/form/Checkbox/Checkbox.types.d.ts +473 -0
  131. package/dist/components/form/Checkbox/CheckboxGroup.d.ts +6 -0
  132. package/dist/components/form/Checkbox/index.d.ts +8 -0
  133. package/dist/components/form/DatePicker/DatePicker.d.ts +6 -0
  134. package/dist/components/form/DatePicker/DatePicker.styles.d.ts +99 -0
  135. package/dist/components/form/DatePicker/DatePicker.types.d.ts +236 -0
  136. package/dist/components/form/DatePicker/index.d.ts +3 -0
  137. package/dist/components/form/Form/Form.d.ts +8 -0
  138. package/dist/components/form/Form/Form.styles.d.ts +84 -0
  139. package/dist/components/form/Form/Form.types.d.ts +416 -0
  140. package/dist/components/form/Form/index.d.ts +9 -0
  141. package/dist/components/form/Form/useFormLogic.d.ts +22 -0
  142. package/dist/components/form/Input/Input.d.ts +6 -0
  143. package/dist/components/form/Input/Input.styles.d.ts +61 -0
  144. package/dist/components/form/Input/Input.types.d.ts +294 -0
  145. package/dist/components/form/Input/index.d.ts +8 -0
  146. package/dist/components/form/Input/useInputLogic.d.ts +35 -0
  147. package/dist/components/form/InputNumber/InputNumber.d.ts +6 -0
  148. package/dist/components/form/InputNumber/InputNumber.styles.d.ts +120 -0
  149. package/dist/components/form/InputNumber/InputNumber.types.d.ts +303 -0
  150. package/dist/components/form/InputNumber/components/InputNumberClearButton.d.ts +10 -0
  151. package/dist/components/form/InputNumber/components/InputNumberControls.d.ts +11 -0
  152. package/dist/components/form/InputNumber/components/index.d.ts +2 -0
  153. package/dist/components/form/InputNumber/hooks/index.d.ts +4 -0
  154. package/dist/components/form/InputNumber/hooks/useInputNumberState.d.ts +38 -0
  155. package/dist/components/form/InputNumber/hooks/useInputNumberValidation.d.ts +12 -0
  156. package/dist/components/form/InputNumber/index.d.ts +5 -0
  157. package/dist/components/form/Radio/Radio.d.ts +6 -0
  158. package/dist/components/form/Radio/Radio.styles.d.ts +80 -0
  159. package/dist/components/form/Radio/Radio.types.d.ts +415 -0
  160. package/dist/components/form/Radio/index.d.ts +8 -0
  161. package/dist/components/form/Select/Select.d.ts +6 -0
  162. package/dist/components/form/Select/Select.styles.d.ts +71 -0
  163. package/dist/components/form/Select/Select.types.d.ts +418 -0
  164. package/dist/components/form/Select/index.d.ts +8 -0
  165. package/dist/components/form/Slider/Slider.d.ts +7 -0
  166. package/dist/components/form/Slider/Slider.styles.d.ts +2 -0
  167. package/dist/components/form/Slider/Slider.types.d.ts +85 -0
  168. package/dist/components/form/Slider/index.d.ts +3 -0
  169. package/dist/components/form/Switch/Switch.d.ts +10 -0
  170. package/dist/components/form/Switch/Switch.styles.d.ts +154 -0
  171. package/dist/components/form/Switch/Switch.types.d.ts +351 -0
  172. package/dist/components/form/Switch/index.d.ts +7 -0
  173. package/dist/components/form/Textarea/Textarea.d.ts +6 -0
  174. package/dist/components/form/Textarea/Textarea.styles.d.ts +66 -0
  175. package/dist/components/form/Textarea/Textarea.types.d.ts +348 -0
  176. package/dist/components/form/Textarea/index.d.ts +7 -0
  177. package/dist/components/form/TimePicker/TimePicker.d.ts +6 -0
  178. package/dist/components/form/TimePicker/TimePicker.styles.d.ts +104 -0
  179. package/dist/components/form/TimePicker/TimePicker.types.d.ts +385 -0
  180. package/dist/components/form/TimePicker/index.d.ts +4 -0
  181. package/dist/components/form/Transfer/Transfer.d.ts +7 -0
  182. package/dist/components/form/Transfer/Transfer.styles.d.ts +106 -0
  183. package/dist/components/form/Transfer/Transfer.types.d.ts +384 -0
  184. package/dist/components/form/Transfer/components/TransferItem.d.ts +23 -0
  185. package/dist/components/form/Transfer/components/TransferList.d.ts +55 -0
  186. package/dist/components/form/Transfer/components/TransferOperations.d.ts +21 -0
  187. package/dist/components/form/Transfer/components/TransferPagination.d.ts +19 -0
  188. package/dist/components/form/Transfer/components/TransferSearch.d.ts +21 -0
  189. package/dist/components/form/Transfer/components/index.d.ts +6 -0
  190. package/dist/components/form/Transfer/hooks/index.d.ts +3 -0
  191. package/dist/components/form/Transfer/hooks/useTransferData.d.ts +41 -0
  192. package/dist/components/form/Transfer/hooks/useTransferState.d.ts +21 -0
  193. package/dist/components/form/Transfer/index.d.ts +9 -0
  194. package/dist/components/form/Upload/Upload.d.ts +7 -0
  195. package/dist/components/form/Upload/Upload.styles.d.ts +2 -0
  196. package/dist/components/form/Upload/Upload.types.d.ts +143 -0
  197. package/dist/components/form/Upload/index.d.ts +3 -0
  198. package/dist/components/form/index.d.ts +126 -0
  199. package/dist/components/index.d.ts +122 -0
  200. package/dist/components/layout/Affix/Affix.d.ts +4 -0
  201. package/dist/components/layout/Affix/Affix.styles.d.ts +1669 -0
  202. package/dist/components/layout/Affix/Affix.types.d.ts +25 -0
  203. package/dist/components/layout/Affix/index.d.ts +3 -0
  204. package/dist/components/layout/Col/Col.d.ts +6 -0
  205. package/dist/components/layout/Col/Col.styles.d.ts +52 -0
  206. package/dist/components/layout/Col/Col.types.d.ts +54 -0
  207. package/dist/components/layout/Col/index.d.ts +3 -0
  208. package/dist/components/layout/Container/Container.d.ts +6 -0
  209. package/dist/components/layout/Container/Container.styles.d.ts +41 -0
  210. package/dist/components/layout/Container/Container.types.d.ts +59 -0
  211. package/dist/components/layout/Container/index.d.ts +3 -0
  212. package/dist/components/layout/Grid/Grid.d.ts +6 -0
  213. package/dist/components/layout/Grid/Grid.styles.d.ts +60 -0
  214. package/dist/components/layout/Grid/Grid.types.d.ts +68 -0
  215. package/dist/components/layout/Grid/index.d.ts +3 -0
  216. package/dist/components/layout/Layout/Content.d.ts +4 -0
  217. package/dist/components/layout/Layout/Footer.d.ts +4 -0
  218. package/dist/components/layout/Layout/Header.d.ts +4 -0
  219. package/dist/components/layout/Layout/Layout.d.ts +4 -0
  220. package/dist/components/layout/Layout/Layout.styles.d.ts +3366 -0
  221. package/dist/components/layout/Layout/Layout.types.d.ts +48 -0
  222. package/dist/components/layout/Layout/Sider.d.ts +4 -0
  223. package/dist/components/layout/Layout/index.d.ts +8 -0
  224. package/dist/components/layout/Row/Row.d.ts +6 -0
  225. package/dist/components/layout/Row/Row.styles.d.ts +55 -0
  226. package/dist/components/layout/Row/Row.types.d.ts +51 -0
  227. package/dist/components/layout/Row/index.d.ts +3 -0
  228. package/dist/components/layout/Space/Space.d.ts +6 -0
  229. package/dist/components/layout/Space/Space.styles.d.ts +69 -0
  230. package/dist/components/layout/Space/Space.types.d.ts +84 -0
  231. package/dist/components/layout/Space/index.d.ts +3 -0
  232. package/dist/components/layout/index.d.ts +39 -0
  233. package/dist/components/navigation/Menu/Menu.constants.d.ts +59 -0
  234. package/dist/components/navigation/Menu/Menu.d.ts +10 -0
  235. package/dist/components/navigation/Menu/Menu.stories.d.ts +157 -0
  236. package/dist/components/navigation/Menu/Menu.styles.d.ts +143 -0
  237. package/dist/components/navigation/Menu/Menu.types.d.ts +210 -0
  238. package/dist/components/navigation/Menu/Menu.utils.d.ts +54 -0
  239. package/dist/components/navigation/Menu/MenuItem.d.ts +32 -0
  240. package/dist/components/navigation/Menu/SubMenu.d.ts +41 -0
  241. package/dist/components/navigation/Menu/index.d.ts +54 -0
  242. package/dist/components/navigation/NavBar/NavBar.d.ts +7 -0
  243. package/dist/components/navigation/NavBar/NavBar.styles.d.ts +114 -0
  244. package/dist/components/navigation/NavBar/NavBar.types.d.ts +50 -0
  245. package/dist/components/navigation/NavBar/index.d.ts +3 -0
  246. package/dist/components/navigation/Pagination/Pagination.d.ts +6 -0
  247. package/dist/components/navigation/Pagination/Pagination.styles.d.ts +55 -0
  248. package/dist/components/navigation/Pagination/Pagination.types.d.ts +77 -0
  249. package/dist/components/navigation/Pagination/index.d.ts +15 -0
  250. package/dist/components/navigation/Steps/Step.d.ts +4 -0
  251. package/dist/components/navigation/Steps/Steps.d.ts +4 -0
  252. package/dist/components/navigation/Steps/Steps.styles.d.ts +6716 -0
  253. package/dist/components/navigation/Steps/Steps.types.d.ts +41 -0
  254. package/dist/components/navigation/Steps/index.d.ts +3 -0
  255. package/dist/components/navigation/Tabs/Tabs.d.ts +6 -0
  256. package/dist/components/navigation/Tabs/Tabs.styles.d.ts +60 -0
  257. package/dist/components/navigation/Tabs/Tabs.types.d.ts +107 -0
  258. package/dist/components/navigation/Tabs/index.d.ts +3 -0
  259. package/dist/components/navigation/index.d.ts +35 -0
  260. package/dist/constants/index.d.ts +624 -0
  261. package/dist/hooks/index.d.ts +28 -0
  262. package/dist/hooks/types.d.ts +7 -0
  263. package/dist/hooks/useAsync.d.ts +17 -0
  264. package/dist/hooks/useClickOutside.d.ts +19 -0
  265. package/dist/hooks/useCounter.d.ts +36 -0
  266. package/dist/hooks/useDebounce.d.ts +31 -0
  267. package/dist/hooks/useDeepCompareEffect.d.ts +22 -0
  268. package/dist/hooks/useEventHandling.d.ts +81 -0
  269. package/dist/hooks/useEventListener.d.ts +19 -0
  270. package/dist/hooks/useLifecycle.d.ts +66 -0
  271. package/dist/hooks/useMediaQuery.d.ts +22 -0
  272. package/dist/hooks/useMutation.d.ts +47 -0
  273. package/dist/hooks/usePerformance.d.ts +73 -0
  274. package/dist/hooks/usePerformanceMonitor.d.ts +66 -0
  275. package/dist/hooks/usePlatform.d.ts +20 -0
  276. package/dist/hooks/usePrevious.d.ts +14 -0
  277. package/dist/hooks/useRequest.d.ts +32 -0
  278. package/dist/hooks/useStateManagement.d.ts +62 -0
  279. package/dist/hooks/useStorage.d.ts +27 -0
  280. package/dist/hooks/useStyle.d.ts +127 -0
  281. package/dist/hooks/useTheme.d.ts +58 -0
  282. package/dist/hooks/useToggle.d.ts +28 -0
  283. package/dist/hooks/useVirtualScroll.d.ts +42 -0
  284. package/dist/index.d.ts +271 -0
  285. package/dist/js/{index-DffLRSro.js → index-CDFsvu80.js} +15369 -10741
  286. package/dist/js/index-CDFsvu80.js.map +1 -0
  287. package/dist/js/index-DFdcksbe.js.map +1 -1
  288. package/dist/js/index-DXRIkWX1.js.map +1 -1
  289. package/dist/js/{index-6NJ3A1Dn.js → index-JffnTUrv.js} +15430 -10801
  290. package/dist/js/index-JffnTUrv.js.map +1 -0
  291. package/dist/platform/index.d.ts +172 -0
  292. package/dist/providers/AppProvider.d.ts +34 -0
  293. package/dist/providers/index.d.ts +1 -0
  294. package/dist/theme/ThemeProvider.d.ts +34 -0
  295. package/dist/theme/ThemeProvider.types.d.ts +21 -0
  296. package/dist/theme/animations.d.ts +96 -0
  297. package/dist/theme/defaults.d.ts +6 -0
  298. package/dist/theme/design-system.d.ts +400 -0
  299. package/dist/theme/design-tokens.d.ts +459 -0
  300. package/dist/theme/index.d.ts +187 -0
  301. package/dist/theme/responsive.d.ts +63 -0
  302. package/dist/theme/styles.d.ts +65 -0
  303. package/dist/theme/tokens/colors.d.ts +72 -0
  304. package/dist/theme/tokens/effects.d.ts +122 -0
  305. package/dist/theme/tokens/index.d.ts +94 -0
  306. package/dist/theme/tokens/spacing.d.ts +65 -0
  307. package/dist/theme/tokens/typography.d.ts +73 -0
  308. package/dist/theme/types.d.ts +153 -0
  309. package/dist/theme/useThemeUtils.d.ts +21 -0
  310. package/dist/theme/utils.d.ts +255 -0
  311. package/dist/theme/variables.d.ts +170 -0
  312. package/dist/types/accessibility.d.ts +46 -0
  313. package/dist/types/button.d.ts +285 -0
  314. package/dist/types/component-props.d.ts +109 -0
  315. package/dist/types/index.d.ts +343 -0
  316. package/dist/types/standardized-components.d.ts +263 -0
  317. package/dist/types/utils.d.ts +190 -0
  318. package/dist/utils/abort-controller.d.ts +19 -0
  319. package/dist/utils/cache.d.ts +28 -0
  320. package/dist/utils/createNamespace.d.ts +9 -0
  321. package/dist/utils/environment.d.ts +26 -0
  322. package/dist/utils/error-handler.d.ts +37 -0
  323. package/dist/utils/errorLogger.d.ts +72 -0
  324. package/dist/utils/formatUtils.d.ts +93 -0
  325. package/dist/utils/http/error-codes.d.ts +131 -0
  326. package/dist/utils/http/http-client.d.ts +53 -0
  327. package/dist/utils/http/request-cache.d.ts +65 -0
  328. package/dist/utils/http/request.d.ts +280 -0
  329. package/dist/utils/http/taro-adapter.d.ts +4 -0
  330. package/dist/utils/http/types.d.ts +351 -0
  331. package/dist/utils/http/web-adapter.d.ts +4 -0
  332. package/dist/utils/index.d.ts +46 -0
  333. package/dist/utils/inputValidator.d.ts +74 -0
  334. package/dist/utils/performance/performance.d.ts +167 -0
  335. package/dist/utils/responsiveUtils.d.ts +148 -0
  336. package/dist/utils/rtl-support.d.ts +78 -0
  337. package/dist/utils/security/api-security.d.ts +82 -0
  338. package/dist/utils/security/xss-protection.d.ts +20 -0
  339. package/dist/utils/securityHeaders.d.ts +74 -0
  340. package/dist/utils/typeHelpers.d.ts +1 -0
  341. package/dist/utils/types/dataProcessing.d.ts +111 -0
  342. package/dist/utils/types/typeHelpers.d.ts +50 -0
  343. package/dist/utils/xssProtection.d.ts +90 -0
  344. package/package.json +14 -10
  345. package/src/components/basic/Button/Button.tsx +53 -13
  346. package/src/components/basic/Button/Button.types.ts +45 -9
  347. package/src/components/basic/Divider/Divider.tsx +60 -29
  348. package/src/components/basic/Icon/Icon.data.ts +474 -0
  349. package/src/components/basic/Icon/Icon.test.tsx +2 -2
  350. package/src/components/basic/Icon/Icon.tsx +48 -35
  351. package/src/components/basic/Icon/IconManager.ts +229 -0
  352. package/src/components/basic/Text/Text.styles.ts +3 -3
  353. package/src/components/basic/Text/Text.types.ts +14 -4
  354. package/src/components/basic/Typography/Typography.styles.ts +10 -9
  355. package/src/components/basic/Typography/Typography.tsx +15 -13
  356. package/src/components/basic/Typography/Typography.types.ts +41 -41
  357. package/src/components/basic/Typography/index.tsx +1 -1
  358. package/src/components/basic/Video/Video.styles.ts +777 -0
  359. package/src/components/basic/Video/Video.test.tsx +490 -0
  360. package/src/components/basic/Video/Video.tsx +1468 -0
  361. package/src/components/basic/Video/Video.types.ts +500 -0
  362. package/src/components/basic/Video/index.tsx +26 -0
  363. package/src/components/basic/index.tsx +13 -15
  364. package/src/components/common/ErrorBoundary.tsx +1 -1
  365. package/src/components/common/LazyComponent.tsx +9 -8
  366. package/src/components/common/SecurityProvider.tsx +2 -14
  367. package/src/components/common/ThemeProvider.tsx +43 -56
  368. package/src/components/common/VirtualList.tsx +187 -205
  369. package/src/components/common/index.tsx +25 -0
  370. package/src/components/display/Avatar/Avatar.styles.ts +1 -1
  371. package/src/components/display/Avatar/Avatar.tsx +6 -19
  372. package/src/components/display/Avatar/Avatar.types.ts +1 -1
  373. package/src/components/display/Avatar/index.ts +1 -1
  374. package/src/components/display/Badge/Badge.tsx +3 -16
  375. package/src/components/display/Badge/Badge.types.ts +1 -1
  376. package/src/components/display/Badge/index.ts +1 -1
  377. package/src/components/display/Calendar/Calendar.styles.ts +36 -36
  378. package/src/components/display/Calendar/Calendar.test.tsx +27 -15
  379. package/src/components/display/Calendar/Calendar.tsx +56 -35
  380. package/src/components/display/Calendar/Calendar.types.ts +1 -1
  381. package/src/components/display/Calendar/index.ts +1 -1
  382. package/src/components/display/Card/Card.styles.ts +2 -2
  383. package/src/components/display/Card/Card.test.tsx +6 -4
  384. package/src/components/display/Card/Card.tsx +1 -1
  385. package/src/components/display/Card/Card.types.ts +4 -4
  386. package/src/components/display/Card/index.ts +1 -1
  387. package/src/components/display/Carousel/Carousel.styles.ts +31 -31
  388. package/src/components/display/Carousel/Carousel.tsx +34 -39
  389. package/src/components/display/Carousel/Carousel.types.ts +1 -1
  390. package/src/components/display/Carousel/index.ts +1 -1
  391. package/src/components/display/List/List.styles.ts +3 -3
  392. package/src/components/display/List/List.tsx +0 -1
  393. package/src/components/display/List/index.ts +1 -1
  394. package/src/components/display/Rate/Rate.styles.ts +5 -17
  395. package/src/components/display/Rate/Rate.tsx +6 -14
  396. package/src/components/display/Rate/Rate.types.ts +4 -3
  397. package/src/components/display/Rate/index.ts +3 -11
  398. package/src/components/display/Table/Table.test.tsx +2 -0
  399. package/src/components/display/Table/Table.tsx +3 -7
  400. package/src/components/display/Table/Table.types.ts +3 -2
  401. package/src/components/display/Tag/Tag.styles.ts +31 -31
  402. package/src/components/display/Tag/Tag.tsx +9 -26
  403. package/src/components/display/Tag/Tag.types.ts +1 -1
  404. package/src/components/display/Tag/index.ts +1 -1
  405. package/src/components/display/Timeline/Timeline.styles.ts +32 -32
  406. package/src/components/display/Timeline/Timeline.tsx +23 -42
  407. package/src/components/display/Timeline/Timeline.types.ts +1 -1
  408. package/src/components/display/Timeline/index.ts +1 -1
  409. package/src/components/display/index.tsx +33 -29
  410. package/src/components/feedback/Loading/Loading.tsx +6 -1
  411. package/src/components/feedback/Loading/index.ts +2 -5
  412. package/src/components/feedback/Message/Message.styles.ts +3 -3
  413. package/src/components/feedback/Message/index.ts +2 -5
  414. package/src/components/feedback/Modal/Modal.styles.ts +1 -1
  415. package/src/components/feedback/Modal/Modal.tsx +9 -31
  416. package/src/components/feedback/Modal/Modal.types.ts +12 -2
  417. package/src/components/feedback/Notification/Notification.styles.ts +49 -39
  418. package/src/components/feedback/Notification/Notification.test.tsx +1 -1
  419. package/src/components/feedback/Notification/Notification.tsx +97 -120
  420. package/src/components/feedback/Notification/Notification.types.ts +11 -8
  421. package/src/components/feedback/Notification/NotificationManager.tsx +135 -106
  422. package/src/components/feedback/Notification/index.ts +10 -3
  423. package/src/components/feedback/Notification/index.tsx +16 -26
  424. package/src/components/feedback/Progress/Progress.styles.ts +23 -14
  425. package/src/components/feedback/Progress/Progress.tsx +93 -113
  426. package/src/components/feedback/Progress/Progress.types.ts +1 -1
  427. package/src/components/feedback/Progress/index.ts +1 -1
  428. package/src/components/feedback/Progress/utils/animation.ts +12 -23
  429. package/src/components/feedback/Progress/utils/index.ts +2 -2
  430. package/src/components/feedback/Progress/utils/progress-calculator.ts +14 -32
  431. package/src/components/feedback/Result/Result.styles.ts +29 -29
  432. package/src/components/feedback/Result/Result.tsx +8 -20
  433. package/src/components/feedback/Result/Result.types.ts +7 -7
  434. package/src/components/feedback/Result/index.tsx +1 -1
  435. package/src/components/feedback/Toast/Toast.styles.ts +1 -1
  436. package/src/components/feedback/Toast/Toast.tsx +25 -13
  437. package/src/components/feedback/Tooltip/Tooltip.examples.tsx +21 -44
  438. package/src/components/feedback/Tooltip/Tooltip.styles.ts +16 -22
  439. package/src/components/feedback/Tooltip/Tooltip.test.tsx +1 -1
  440. package/src/components/feedback/Tooltip/Tooltip.tsx +65 -46
  441. package/src/components/feedback/Tooltip/Tooltip.types.ts +14 -20
  442. package/src/components/feedback/Tooltip/index.ts +1 -1
  443. package/src/components/feedback/Tooltip/index.tsx +12 -24
  444. package/src/components/feedback/index.tsx +54 -42
  445. package/src/components/form/Cascader/Cascader.styles.ts +2 -2
  446. package/src/components/form/Cascader/Cascader.tsx +84 -88
  447. package/src/components/form/Cascader/Cascader.types.ts +49 -50
  448. package/src/components/form/Cascader/hooks/useCascaderFieldNames.ts +11 -8
  449. package/src/components/form/Cascader/hooks/useCascaderOptions.ts +73 -55
  450. package/src/components/form/Cascader/hooks/useCascaderState.ts +31 -25
  451. package/src/components/form/Cascader/index.ts +1 -1
  452. package/src/components/form/Cascader/utils/formatDisplayValue.ts +4 -4
  453. package/src/components/form/Checkbox/Checkbox.styles.ts +83 -84
  454. package/src/components/form/Checkbox/Checkbox.tsx +2 -9
  455. package/src/components/form/Checkbox/CheckboxGroup.tsx +7 -7
  456. package/src/components/form/DatePicker/DatePicker.test.tsx +1 -1
  457. package/src/components/form/DatePicker/DatePicker.tsx +91 -75
  458. package/src/components/form/DatePicker/DatePicker.types.ts +4 -1
  459. package/src/components/form/Form/Form.tsx +66 -504
  460. package/src/components/form/Form/Form.types.ts +16 -1
  461. package/src/components/form/Form/useFormLogic.ts +497 -0
  462. package/src/components/form/Input/Input.styles.ts +8 -1
  463. package/src/components/form/Input/Input.tsx +55 -291
  464. package/src/components/form/Input/Input.types.ts +13 -1
  465. package/src/components/form/Input/useInputLogic.test.ts +82 -0
  466. package/src/components/form/Input/useInputLogic.ts +260 -0
  467. package/src/components/form/InputNumber/InputNumber.styles.ts +76 -25
  468. package/src/components/form/InputNumber/InputNumber.tsx +53 -21
  469. package/src/components/form/InputNumber/InputNumber.types.ts +21 -3
  470. package/src/components/form/InputNumber/components/InputNumberClearButton.tsx +3 -11
  471. package/src/components/form/InputNumber/components/InputNumberControls.tsx +3 -12
  472. package/src/components/form/InputNumber/hooks/index.ts +1 -1
  473. package/src/components/form/InputNumber/hooks/useInputNumberState.ts +7 -9
  474. package/src/components/form/InputNumber/hooks/useInputNumberValidation.ts +18 -17
  475. package/src/components/form/InputNumber/index.ts +7 -7
  476. package/src/components/form/Radio/Radio.styles.ts +1 -8
  477. package/src/components/form/Radio/Radio.tsx +3 -9
  478. package/src/components/form/Radio/Radio.types.ts +5 -1
  479. package/src/components/form/Select/Select.styles.ts +5 -1
  480. package/src/components/form/Select/Select.tsx +15 -15
  481. package/src/components/form/Select/Select.types.ts +2 -1
  482. package/src/components/form/Slider/Slider.styles.ts +13 -13
  483. package/src/components/form/Slider/Slider.tsx +19 -33
  484. package/src/components/form/Slider/Slider.types.ts +14 -12
  485. package/src/components/form/Slider/index.tsx +2 -9
  486. package/src/components/form/Switch/Switch.styles.ts +1 -7
  487. package/src/components/form/Switch/Switch.tsx +7 -13
  488. package/src/components/form/Textarea/Textarea.styles.ts +4 -4
  489. package/src/components/form/Textarea/Textarea.tsx +7 -1
  490. package/src/components/form/Textarea/Textarea.types.ts +4 -1
  491. package/src/components/form/TimePicker/TimePicker.styles.ts +8 -12
  492. package/src/components/form/TimePicker/TimePicker.tsx +122 -100
  493. package/src/components/form/TimePicker/TimePicker.types.ts +2 -2
  494. package/src/components/form/TimePicker/index.ts +1 -1
  495. package/src/components/form/Transfer/Transfer.styles.ts +3 -15
  496. package/src/components/form/Transfer/Transfer.tsx +146 -134
  497. package/src/components/form/Transfer/Transfer.types.ts +34 -26
  498. package/src/components/form/Transfer/components/TransferItem.tsx +55 -62
  499. package/src/components/form/Transfer/components/TransferList.tsx +212 -199
  500. package/src/components/form/Transfer/components/TransferOperations.tsx +52 -55
  501. package/src/components/form/Transfer/components/TransferPagination.tsx +115 -111
  502. package/src/components/form/Transfer/components/TransferSearch.tsx +52 -55
  503. package/src/components/form/Transfer/hooks/useTransferData.ts +91 -81
  504. package/src/components/form/Transfer/hooks/useTransferState.ts +22 -16
  505. package/src/components/form/Transfer/index.ts +2 -8
  506. package/src/components/form/Upload/Upload.styles.ts +21 -21
  507. package/src/components/form/Upload/Upload.tsx +189 -142
  508. package/src/components/form/Upload/Upload.types.ts +31 -31
  509. package/src/components/form/Upload/index.tsx +1 -1
  510. package/src/components/form/index.tsx +60 -29
  511. package/src/components/index.tsx +0 -1
  512. package/src/components/layout/Affix/Affix.styles.ts +16 -11
  513. package/src/components/layout/Affix/Affix.tsx +67 -75
  514. package/src/components/layout/Affix/Affix.types.ts +18 -18
  515. package/src/components/layout/Affix/index.tsx +1 -1
  516. package/src/components/layout/Col/Col.styles.ts +17 -17
  517. package/src/components/layout/Col/Col.test.tsx +7 -5
  518. package/src/components/layout/Col/Col.tsx +3 -21
  519. package/src/components/layout/Col/Col.types.ts +1 -1
  520. package/src/components/layout/Container/Container.styles.ts +3 -1
  521. package/src/components/layout/Container/Container.tsx +2 -11
  522. package/src/components/layout/Grid/Grid.tsx +3 -53
  523. package/src/components/layout/Layout/Content.tsx +24 -32
  524. package/src/components/layout/Layout/Footer.tsx +24 -32
  525. package/src/components/layout/Layout/Header.tsx +24 -32
  526. package/src/components/layout/Layout/Layout.styles.ts +17 -17
  527. package/src/components/layout/Layout/Layout.tsx +14 -25
  528. package/src/components/layout/Layout/Layout.types.ts +29 -29
  529. package/src/components/layout/Layout/Sider.tsx +44 -56
  530. package/src/components/layout/Layout/index.tsx +16 -2
  531. package/src/components/layout/Row/Row.tsx +15 -43
  532. package/src/components/layout/Space/Space.tsx +3 -11
  533. package/src/components/layout/Space/Space.types.ts +1 -1
  534. package/src/components/layout/index.tsx +29 -19
  535. package/src/components/navigation/Menu/Menu.constants.ts +69 -0
  536. package/src/components/navigation/Menu/Menu.stories.tsx +107 -0
  537. package/src/components/navigation/Menu/Menu.styles.ts +25 -37
  538. package/src/components/navigation/Menu/Menu.tsx +8 -11
  539. package/src/components/navigation/Menu/Menu.types.ts +2 -2
  540. package/src/components/navigation/Menu/Menu.utils.ts +17 -17
  541. package/src/components/navigation/Menu/MenuItem.tsx +9 -11
  542. package/src/components/navigation/Menu/SubMenu.tsx +8 -6
  543. package/src/components/navigation/Menu/index.tsx +4 -69
  544. package/src/components/navigation/NavBar/NavBar.styles.ts +1 -1
  545. package/src/components/navigation/NavBar/NavBar.tsx +7 -10
  546. package/src/components/navigation/NavBar/NavBar.types.ts +3 -3
  547. package/src/components/navigation/NavBar/index.tsx +1 -1
  548. package/src/components/navigation/Pagination/Pagination.test.tsx +2 -3
  549. package/src/components/navigation/Pagination/Pagination.tsx +3 -3
  550. package/src/components/navigation/Pagination/Pagination.types.ts +3 -2
  551. package/src/components/navigation/Pagination/index.ts +9 -3
  552. package/src/components/navigation/Steps/Step.tsx +24 -44
  553. package/src/components/navigation/Steps/Steps.styles.ts +28 -13
  554. package/src/components/navigation/Steps/Steps.test.tsx +2 -0
  555. package/src/components/navigation/Steps/Steps.tsx +88 -89
  556. package/src/components/navigation/Steps/Steps.types.ts +30 -30
  557. package/src/components/navigation/Steps/index.tsx +1 -1
  558. package/src/components/navigation/Tabs/Tabs.test.tsx +3 -2
  559. package/src/components/navigation/Tabs/Tabs.types.ts +4 -3
  560. package/src/components/navigation/index.tsx +21 -16
  561. package/src/constants/index.ts +1 -1
  562. package/src/hooks/index.ts +52 -102
  563. package/src/hooks/types.ts +4 -5
  564. package/src/hooks/useAsync.ts +46 -47
  565. package/src/hooks/useClickOutside.ts +52 -0
  566. package/src/hooks/useCounter.ts +87 -0
  567. package/src/hooks/useDebounce.ts +150 -0
  568. package/src/hooks/useDeepCompareEffect.ts +88 -0
  569. package/src/hooks/useEventListener.ts +77 -0
  570. package/src/hooks/useMediaQuery.ts +75 -0
  571. package/src/hooks/useMutation.ts +233 -0
  572. package/src/hooks/usePerformance.ts +1 -64
  573. package/src/hooks/usePlatform.ts +3 -1
  574. package/src/hooks/usePrevious.ts +25 -0
  575. package/src/hooks/useRequest.ts +12 -7
  576. package/src/hooks/useStateManagement.ts +1 -1
  577. package/src/hooks/useStorage.ts +169 -0
  578. package/src/hooks/useStyle.ts +8 -2
  579. package/src/hooks/useToggle.ts +54 -0
  580. package/src/index.ts +34 -9
  581. package/src/theme/ThemeProvider.tsx +3 -7
  582. package/src/theme/ThemeProvider.types.ts +1 -1
  583. package/src/theme/defaults.ts +1 -1
  584. package/src/theme/design-system.ts +2 -2
  585. package/src/theme/design-tokens.ts +85 -99
  586. package/src/theme/generated/dark-theme.scss +1 -1
  587. package/src/theme/generated/tokens.scss +82 -18
  588. package/src/theme/index.ts +8 -29
  589. package/src/theme/responsive.tsx +36 -34
  590. package/src/theme/styles.ts +1 -1
  591. package/src/theme/useThemeUtils.ts +43 -43
  592. package/src/theme/utils.ts +32 -32
  593. package/src/theme/variables.ts +70 -51
  594. package/src/types/accessibility.ts +36 -37
  595. package/src/types/button.ts +25 -27
  596. package/src/types/component-props.ts +6 -1
  597. package/src/types/glob.d.ts +4 -0
  598. package/src/types/index.ts +2 -2
  599. package/src/types/standardized-components.ts +9 -3
  600. package/src/types/utils.ts +13 -23
  601. package/src/utils/__tests__/responsiveUtils.test.ts +5 -4
  602. package/src/utils/abort-controller.ts +48 -0
  603. package/src/utils/cache.ts +2 -6
  604. package/src/utils/createNamespace.ts +4 -4
  605. package/src/utils/environment.ts +26 -6
  606. package/src/utils/error-handler.ts +2 -2
  607. package/src/utils/errorLogger.ts +16 -20
  608. package/src/utils/formatUtils.ts +38 -70
  609. package/src/utils/http/error-codes.ts +314 -0
  610. package/src/utils/http/http-client.test.ts +63 -0
  611. package/src/utils/{network → http}/http-client.ts +45 -35
  612. package/src/utils/http/request-cache.ts +127 -0
  613. package/src/utils/http/request.ts +954 -0
  614. package/src/utils/http/taro-adapter.test.ts +74 -0
  615. package/src/utils/http/taro-adapter.ts +24 -0
  616. package/src/utils/http/types.ts +414 -0
  617. package/src/utils/http/web-adapter.ts +33 -0
  618. package/src/utils/index.ts +5 -8
  619. package/src/utils/inputValidator.ts +17 -14
  620. package/src/utils/performance/performance.ts +60 -71
  621. package/src/utils/responsiveUtils.ts +7 -16
  622. package/src/utils/rtl-support.ts +29 -19
  623. package/src/utils/security/api-security.ts +47 -39
  624. package/src/utils/securityHeaders.ts +61 -67
  625. package/src/utils/typeHelpers.ts +10 -10
  626. package/src/utils/types/dataProcessing.ts +93 -92
  627. package/src/utils/types/typeHelpers.ts +31 -21
  628. package/src/utils/xssProtection.ts +96 -48
  629. package/dist/js/index-6NJ3A1Dn.js.map +0 -1
  630. package/dist/js/index-DffLRSro.js.map +0 -1
  631. package/src/components/form/Input/Input.enhanced.tsx +0 -732
  632. package/src/components/navigation/Menu/__tests__/Menu.test.tsx +0 -687
  633. package/src/components/navigation/Tree/Tree.styles.ts +0 -553
  634. package/src/components/navigation/Tree/Tree.test.basic.tsx +0 -7
  635. package/src/components/navigation/Tree/Tree.test.functional.tsx +0 -496
  636. package/src/components/navigation/Tree/Tree.test.import.check.tsx +0 -6
  637. package/src/components/navigation/Tree/Tree.test.import.tsx +0 -6
  638. package/src/components/navigation/Tree/Tree.test.minimal.tsx +0 -5
  639. package/src/components/navigation/Tree/Tree.test.simple.tsx +0 -30
  640. package/src/components/navigation/Tree/Tree.test.tsx +0 -908
  641. package/src/components/navigation/Tree/Tree.test.working.tsx +0 -673
  642. package/src/components/navigation/Tree/Tree.tsx +0 -600
  643. package/src/components/navigation/Tree/Tree.types.ts +0 -909
  644. package/src/components/navigation/Tree/Tree.utils.ts +0 -452
  645. package/src/components/navigation/Tree/index.ts +0 -33
  646. package/src/components/navigation/Tree/index.tsx +0 -23
  647. package/src/utils/network/http-client.test.ts +0 -18
@@ -4,7 +4,7 @@ import type {
4
4
  NotificationManagerProps,
5
5
  NotificationManagerRef,
6
6
  NotificationItem,
7
- NotificationPlacement
7
+ NotificationPlacement,
8
8
  } from './Notification.types';
9
9
  import { Notification } from './Notification';
10
10
  import { notificationStyleHelpers } from './Notification.styles';
@@ -50,93 +50,102 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
50
50
  const notificationRefs = useRef<Map<string, { current: any }>>(new Map());
51
51
 
52
52
  // 添加通知
53
- const addNotification = useCallback((config: Omit<NotificationItem, 'key' | 'createdAt'>): string => {
54
- const key = NotificationUtils.generateKey();
55
- const newNotification: InternalNotificationItem = {
56
- ...config,
57
- key,
58
- createdAt: Date.now(),
59
- placement: config.placement || defaultPlacement,
60
- duration: config.duration ?? defaultDuration,
61
- animation: config.animation || defaultAnimation,
62
- stackIndex: 0,
63
- isClosing: false,
64
- };
65
-
66
- setNotifications(prev => {
67
- // 检查是否超过最大数量
68
- let updatedNotifications = [...prev, newNotification];
69
-
70
- if (updatedNotifications.length > maxCount) {
71
- // 移除最早的通知
72
- const removed = updatedNotifications.shift();
73
- if (removed) {
74
- // 添加到历史记录
75
- setHistory(prevHistory => [...prevHistory.slice(-DEFAULT_NOTIFICATION_CONFIG.maxHistoryCount!), removed]);
76
- onLeave?.(removed.key);
53
+ const addNotification = useCallback(
54
+ (config: Omit<NotificationItem, 'key' | 'createdAt'>): string => {
55
+ const key = NotificationUtils.generateKey();
56
+ const newNotification: InternalNotificationItem = {
57
+ ...config,
58
+ key,
59
+ createdAt: Date.now(),
60
+ placement: config.placement || defaultPlacement,
61
+ duration: config.duration ?? defaultDuration,
62
+ animation: config.animation || defaultAnimation,
63
+ stackIndex: 0,
64
+ isClosing: false,
65
+ };
66
+
67
+ setNotifications((prev) => {
68
+ // 检查是否超过最大数量
69
+ let updatedNotifications = [...prev, newNotification];
70
+
71
+ if (updatedNotifications.length > maxCount) {
72
+ // 移除最早的通知
73
+ const removed = updatedNotifications.shift();
74
+ if (removed) {
75
+ // 添加到历史记录
76
+ setHistory((prevHistory) => [...prevHistory.slice(-DEFAULT_NOTIFICATION_CONFIG.maxHistoryCount!), removed]);
77
+ onLeave?.(removed.key);
78
+ }
77
79
  }
78
- }
79
80
 
80
- // 更新堆叠索引
81
- return updateStackIndices(updatedNotifications);
82
- });
81
+ // 更新堆叠索引
82
+ return updateStackIndices(updatedNotifications);
83
+ });
83
84
 
84
- onEnter?.(key);
85
- return key;
86
- }, [maxCount, defaultPlacement, defaultDuration, defaultAnimation, onEnter, onLeave]);
85
+ onEnter?.(key);
86
+ return key;
87
+ },
88
+ [maxCount, defaultPlacement, defaultDuration, defaultAnimation, onEnter, onLeave],
89
+ );
87
90
 
88
91
  // 更新堆叠索引
89
- const updateStackIndices = useCallback((notificationsList: InternalNotificationItem[]): InternalNotificationItem[] => {
90
- if (!stack) return notificationsList;
91
-
92
- return notificationsList.map((notification, index) => ({
93
- ...notification,
94
- stackIndex: index,
95
- }));
96
- }, [stack]);
92
+ const updateStackIndices = useCallback(
93
+ (notificationsList: InternalNotificationItem[]): InternalNotificationItem[] => {
94
+ if (!stack) return notificationsList;
95
+
96
+ return notificationsList.map((notification, index) => ({
97
+ ...notification,
98
+ stackIndex: index,
99
+ }));
100
+ },
101
+ [stack],
102
+ );
97
103
 
98
104
  // 关闭通知
99
- const closeNotification = useCallback((key: string) => {
100
- setNotifications(prev => {
101
- const notificationIndex = prev.findIndex(n => n.key === key);
102
- if (notificationIndex === -1) return prev;
103
-
104
- const notification = prev[notificationIndex];
105
- const updatedNotifications = prev.filter((_, index) => index !== notificationIndex);
106
-
107
- // 添加到历史记录
108
- setHistory(prevHistory => [...prevHistory.slice(-DEFAULT_NOTIFICATION_CONFIG.maxHistoryCount!), notification as NotificationItem]);
109
-
110
- // 更新堆叠索引
111
- return updateStackIndices(updatedNotifications);
112
- });
105
+ const closeNotification = useCallback(
106
+ (key: string) => {
107
+ setNotifications((prev) => {
108
+ const notificationIndex = prev.findIndex((n) => n.key === key);
109
+ if (notificationIndex === -1) return prev;
110
+
111
+ const notification = prev[notificationIndex];
112
+ const updatedNotifications = prev.filter((_, index) => index !== notificationIndex);
113
+
114
+ // 添加到历史记录
115
+ setHistory((prevHistory) => [
116
+ ...prevHistory.slice(-DEFAULT_NOTIFICATION_CONFIG.maxHistoryCount!),
117
+ notification as NotificationItem,
118
+ ]);
119
+
120
+ // 更新堆叠索引
121
+ return updateStackIndices(updatedNotifications);
122
+ });
113
123
 
114
- onLeave?.(key);
115
- }, [onLeave, updateStackIndices]);
124
+ onLeave?.(key);
125
+ },
126
+ [onLeave, updateStackIndices],
127
+ );
116
128
 
117
129
  // 关闭所有通知
118
130
  const closeAllNotifications = useCallback(() => {
119
- setNotifications(prev => {
131
+ setNotifications((prev) => {
120
132
  // 添加到历史记录
121
- setHistory(prevHistory => [
122
- ...prevHistory.slice(-DEFAULT_NOTIFICATION_CONFIG.maxHistoryCount!),
123
- ...prev
124
- ]);
133
+ setHistory((prevHistory) => [...prevHistory.slice(-DEFAULT_NOTIFICATION_CONFIG.maxHistoryCount!), ...prev]);
125
134
 
126
135
  const firstKey = prev[0]?.key;
127
136
  if (firstKey) {
128
137
  onLeave?.(firstKey);
129
138
  }
130
139
  onAllClose?.();
131
-
140
+
132
141
  return [];
133
142
  });
134
143
  }, [onLeave, onAllClose]);
135
144
 
136
145
  // 更新通知
137
146
  const updateNotification = useCallback((key: string, config: Partial<NotificationItem>) => {
138
- setNotifications(prev => {
139
- return prev.map(notification => {
147
+ setNotifications((prev) => {
148
+ return prev.map((notification) => {
140
149
  if (notification.key === key) {
141
150
  return {
142
151
  ...notification,
@@ -152,34 +161,52 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
152
161
  }, []);
153
162
 
154
163
  // 显示通知
155
- const open = useCallback((config: Omit<NotificationItem, 'key' | 'createdAt'>) => {
156
- return addNotification(config);
157
- }, [addNotification]);
164
+ const open = useCallback(
165
+ (config: Omit<NotificationItem, 'key' | 'createdAt'>) => {
166
+ return addNotification(config);
167
+ },
168
+ [addNotification],
169
+ );
158
170
 
159
171
  // 显示成功通知
160
- const success = useCallback((config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
161
- return open({ ...config, type: 'success' });
162
- }, [open]);
172
+ const success = useCallback(
173
+ (config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
174
+ return open({ ...config, type: 'success' });
175
+ },
176
+ [open],
177
+ );
163
178
 
164
179
  // 显示信息通知
165
- const info = useCallback((config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
166
- return open({ ...config, type: 'info' });
167
- }, [open]);
180
+ const info = useCallback(
181
+ (config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
182
+ return open({ ...config, type: 'info' });
183
+ },
184
+ [open],
185
+ );
168
186
 
169
187
  // 显示警告通知
170
- const warning = useCallback((config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
171
- return open({ ...config, type: 'warning' });
172
- }, [open]);
188
+ const warning = useCallback(
189
+ (config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
190
+ return open({ ...config, type: 'warning' });
191
+ },
192
+ [open],
193
+ );
173
194
 
174
195
  // 显示错误通知
175
- const error = useCallback((config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
176
- return open({ ...config, type: 'error' });
177
- }, [open]);
196
+ const error = useCallback(
197
+ (config: Omit<NotificationItem, 'key' | 'createdAt' | 'type'>) => {
198
+ return open({ ...config, type: 'error' });
199
+ },
200
+ [open],
201
+ );
178
202
 
179
203
  // 关闭指定通知
180
- const close = useCallback((key: string) => {
181
- closeNotification(key);
182
- }, [closeNotification]);
204
+ const close = useCallback(
205
+ (key: string) => {
206
+ closeNotification(key);
207
+ },
208
+ [closeNotification],
209
+ );
183
210
 
184
211
  // 关闭所有通知
185
212
  const destroyAll = useCallback(() => {
@@ -217,7 +244,7 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
217
244
  // 暂停所有通知自动关闭
218
245
  const pauseAll = useCallback(() => {
219
246
  setIsAllPaused(true);
220
- notificationRefs.current.forEach(refObject => {
247
+ notificationRefs.current.forEach((refObject) => {
221
248
  if (refObject?.current?.pauseProgress) {
222
249
  refObject.current.pauseProgress();
223
250
  }
@@ -227,7 +254,7 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
227
254
  // 恢复所有通知自动关闭
228
255
  const resumeAll = useCallback(() => {
229
256
  setIsAllPaused(false);
230
- notificationRefs.current.forEach(ref => {
257
+ notificationRefs.current.forEach((ref) => {
231
258
  if (ref?.current?.resumeProgress) {
232
259
  ref.current.resumeProgress();
233
260
  }
@@ -266,17 +293,23 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
266
293
  }));
267
294
 
268
295
  // 处理通知关闭
269
- const handleNotificationClose = useCallback((key: string) => {
270
- closeNotification(key);
271
- }, [closeNotification]);
296
+ const handleNotificationClose = useCallback(
297
+ (key: string) => {
298
+ closeNotification(key);
299
+ },
300
+ [closeNotification],
301
+ );
272
302
 
273
303
  // 处理通知点击
274
- const handleNotificationClick = useCallback((key: string) => {
275
- const notification = notifications.find(n => n.key === key);
276
- if (notification?.onClick) {
277
- notification.onClick();
278
- }
279
- }, [notifications]);
304
+ const handleNotificationClick = useCallback(
305
+ (key: string) => {
306
+ const notification = notifications.find((n) => n.key === key);
307
+ if (notification?.onClick) {
308
+ notification.onClick();
309
+ }
310
+ },
311
+ [notifications],
312
+ );
280
313
 
281
314
  // 获取容器样式
282
315
  const getContainerStyle = () => {
@@ -288,13 +321,9 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
288
321
 
289
322
  // 获取容器类名
290
323
  const getContainerClassName = () => {
291
- return cn(
292
- 'taro-uno-notification-container',
293
- containerClassName
294
- );
324
+ return cn('taro-uno-notification-container', containerClassName);
295
325
  };
296
326
 
297
-
298
327
  // 按位置分组通知
299
328
  const renderNotificationsByPlacement = () => {
300
329
  const notificationsByPlacement: Record<NotificationPlacement, InternalNotificationItem[]> = {
@@ -307,7 +336,7 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
307
336
  };
308
337
 
309
338
  // 按位置分组
310
- notifications.forEach(notification => {
339
+ notifications.forEach((notification) => {
311
340
  const placement = notification.placement || defaultPlacement;
312
341
  notificationsByPlacement[placement].push(notification);
313
342
  });
@@ -317,7 +346,7 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
317
346
  if (placementNotifications.length === 0) return null;
318
347
 
319
348
  const sortedNotifications = NotificationUtils.sortNotifications(placementNotifications);
320
-
349
+
321
350
  return (
322
351
  <View
323
352
  key={placement}
@@ -357,15 +386,15 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
357
386
 
358
387
  // 获取位置样式
359
388
  const getPlacementStyle = (placement: NotificationPlacement) => {
360
- const placementStyleData = notificationStyleHelpers.getPlacementStyle(placement, { theme, isMobile: platform.isMobile() });
389
+ const placementStyleData = notificationStyleHelpers.getPlacementStyle(placement, {
390
+ theme,
391
+ isMobile: platform.isMobile(),
392
+ });
361
393
  return placementStyleData.container;
362
394
  };
363
395
 
364
396
  return (
365
- <View
366
- className={getContainerClassName()}
367
- style={getContainerStyle()}
368
- >
397
+ <View className={getContainerClassName()} style={getContainerStyle()}>
369
398
  {renderNotificationsByPlacement()}
370
399
  </View>
371
400
  );
@@ -373,4 +402,4 @@ export const NotificationManager = forwardRef<NotificationManagerRef, Notificati
373
402
 
374
403
  NotificationManager.displayName = 'NotificationManager';
375
404
 
376
- export default NotificationManager;
405
+ export default NotificationManager;
@@ -4,7 +4,9 @@ export { default as NotificationManager } from './NotificationManager';
4
4
  // Simple notification singleton for direct usage
5
5
  class NotificationSingleton {
6
6
  open = (_config: any) => {
7
- console.warn('Notification singleton called. Please render <NotificationManager /> in your app for full functionality.');
7
+ console.warn(
8
+ 'Notification singleton called. Please render <NotificationManager /> in your app for full functionality.',
9
+ );
8
10
  return 'notification-key';
9
11
  };
10
12
 
@@ -27,7 +29,12 @@ class NotificationSingleton {
27
29
  }
28
30
 
29
31
  export const notification = new NotificationSingleton();
30
- export type { NotificationProps, NotificationRef, NotificationManagerProps, NotificationPlacement } from './Notification.types';
32
+ export type {
33
+ NotificationProps,
34
+ NotificationRef,
35
+ NotificationManagerProps,
36
+ NotificationPlacement,
37
+ } from './Notification.types';
31
38
  export { notificationStyles } from './Notification.styles';
32
39
 
33
- export default Notification;
40
+ export default Notification;
@@ -56,67 +56,67 @@ export const notification = {
56
56
  open: (config: Parameters<NotificationManagerRef['open']>[0]) => {
57
57
  return globalNotificationRef?.open(config) || '';
58
58
  },
59
-
59
+
60
60
  // 显示成功通知
61
61
  success: (config: Parameters<NotificationManagerRef['success']>[0]) => {
62
62
  return globalNotificationRef?.success(config) || '';
63
63
  },
64
-
64
+
65
65
  // 显示信息通知
66
66
  info: (config: Parameters<NotificationManagerRef['info']>[0]) => {
67
67
  return globalNotificationRef?.info(config) || '';
68
68
  },
69
-
69
+
70
70
  // 显示警告通知
71
71
  warning: (config: Parameters<NotificationManagerRef['warning']>[0]) => {
72
72
  return globalNotificationRef?.warning(config) || '';
73
73
  },
74
-
74
+
75
75
  // 显示错误通知
76
76
  error: (config: Parameters<NotificationManagerRef['error']>[0]) => {
77
77
  return globalNotificationRef?.error(config) || '';
78
78
  },
79
-
79
+
80
80
  // 关闭通知
81
81
  close: (key: string) => {
82
82
  globalNotificationRef?.close(key);
83
83
  },
84
-
84
+
85
85
  // 关闭所有通知
86
86
  destroyAll: () => {
87
87
  globalNotificationRef?.destroyAll();
88
88
  },
89
-
89
+
90
90
  // 更新通知
91
91
  update: (key: string, config: Parameters<NotificationManagerRef['update']>[1]) => {
92
92
  globalNotificationRef?.update(key, config);
93
93
  },
94
-
94
+
95
95
  // 获取所有通知
96
96
  getNotifications: () => {
97
97
  return globalNotificationRef?.getNotifications() || [];
98
98
  },
99
-
99
+
100
100
  // 获取通知数量
101
101
  getCount: () => {
102
102
  return globalNotificationRef?.getCount() || 0;
103
103
  },
104
-
104
+
105
105
  // 暂停所有通知
106
106
  pauseAll: () => {
107
107
  globalNotificationRef?.pauseAll();
108
108
  },
109
-
109
+
110
110
  // 恢复所有通知
111
111
  resumeAll: () => {
112
112
  globalNotificationRef?.resumeAll();
113
113
  },
114
-
114
+
115
115
  // 清空历史记录
116
116
  clearHistory: () => {
117
117
  globalNotificationRef?.clearHistory();
118
118
  },
119
-
119
+
120
120
  // 获取通知历史
121
121
  getHistory: () => {
122
122
  return globalNotificationRef?.getHistory() || [];
@@ -124,15 +124,7 @@ export const notification = {
124
124
  };
125
125
 
126
126
  // 便捷方法
127
- export const {
128
- success,
129
- info,
130
- warning,
131
- error,
132
- destroyAll,
133
- pauseAll,
134
- resumeAll,
135
- } = notification;
127
+ export const { success, info, warning, error, destroyAll, pauseAll, resumeAll } = notification;
136
128
 
137
129
  // 默认导出
138
130
  export default Notification;
@@ -143,7 +135,7 @@ export type {
143
135
  NotificationType as Type,
144
136
  NotificationPlacement as Placement,
145
137
  NotificationAnimation as Animation,
146
-
138
+
147
139
  // 通知接口
148
140
  NotificationItem as Item,
149
141
  NotificationProps as Props,
@@ -159,6 +151,4 @@ export { notification };
159
151
  if (typeof Notification !== 'undefined') {
160
152
  (Notification as any).displayName = 'Notification';
161
153
  }
162
- if (typeof NotificationManager !== 'undefined') {
163
- (NotificationManager as any).displayName = 'NotificationManager';
164
- }
154
+ // NotificationManager displayName is set in NotificationManager.tsx
@@ -7,9 +7,9 @@ import type {
7
7
  ProgressStyles as ProgressStylesType,
8
8
  ProgressGradient,
9
9
  } from './Progress.types';
10
- import {
11
- calculateCircleDimensions,
12
- calculateCircleProgress,
10
+ import {
11
+ calculateCircleDimensions,
12
+ calculateCircleProgress,
13
13
  calculateDashboardProgress,
14
14
  getStatusColor,
15
15
  calculateBorderRadius,
@@ -198,7 +198,11 @@ export const getLineStyle = (props: ProgressStyleProps) => {
198
198
 
199
199
  const mergedTheme = { ...defaultTheme, ...theme };
200
200
  const borderRadius = calculateBorderRadius(strokeWidth, strokeLinecap);
201
- const color = strokeColor ? (typeof strokeColor === 'string' ? strokeColor : mergedTheme.primaryColor) : getStatusColor(status, statusColors);
201
+ const color = strokeColor
202
+ ? typeof strokeColor === 'string'
203
+ ? strokeColor
204
+ : mergedTheme.primaryColor
205
+ : getStatusColor(status, statusColors);
202
206
 
203
207
  return {
204
208
  outer: {
@@ -237,10 +241,14 @@ export const getCircleStyle = (props: ProgressStyleProps) => {
237
241
  const sizeValue = sizeMapping[size];
238
242
  const strokeWidth = customStrokeWidth || strokeWidthMapping[size];
239
243
  const mergedTheme = { ...defaultTheme, ...theme };
240
-
244
+
241
245
  const dimensions = calculateCircleDimensions(sizeValue, strokeWidth);
242
246
  const progressData = calculateCircleProgress(dimensions, percent);
243
- const color = strokeColor ? (typeof strokeColor === 'string' ? strokeColor : mergedTheme.primaryColor) : getStatusColor(status, statusColors);
247
+ const color = strokeColor
248
+ ? typeof strokeColor === 'string'
249
+ ? strokeColor
250
+ : mergedTheme.primaryColor
251
+ : getStatusColor(status, statusColors);
244
252
 
245
253
  return {
246
254
  outer: {
@@ -305,10 +313,14 @@ export const getDashboardStyle = (props: ProgressStyleProps) => {
305
313
  const sizeValue = sizeMapping[size];
306
314
  const strokeWidth = customStrokeWidth || strokeWidthMapping[size];
307
315
  const mergedTheme = { ...defaultTheme, ...theme };
308
-
316
+
309
317
  const dimensions = calculateCircleDimensions(sizeValue, strokeWidth);
310
318
  const progressData = calculateDashboardProgress(dimensions, percent, gapDegree, gapPosition);
311
- const color = strokeColor ? (typeof strokeColor === 'string' ? strokeColor : mergedTheme.primaryColor) : getStatusColor(status, statusColors);
319
+ const color = strokeColor
320
+ ? typeof strokeColor === 'string'
321
+ ? strokeColor
322
+ : mergedTheme.primaryColor
323
+ : getStatusColor(status, statusColors);
312
324
 
313
325
  return {
314
326
  outer: {
@@ -374,17 +386,14 @@ export const getInfoStyle = (size?: ProgressSize, customStyle?: CSSProperties):
374
386
  };
375
387
 
376
388
  // 获取容器样式
377
- export const getContainerStyle = (
378
- type?: ProgressType,
379
- customStyle?: CSSProperties
380
- ): CSSProperties => {
389
+ export const getContainerStyle = (type?: ProgressType, customStyle?: CSSProperties): CSSProperties => {
381
390
  if (type === 'line') {
382
391
  return {
383
392
  ...progressStyles['lineContainer'],
384
393
  ...customStyle,
385
394
  };
386
395
  }
387
-
396
+
388
397
  return {
389
398
  ...progressStyles['container'],
390
399
  ...customStyle,
@@ -457,4 +466,4 @@ export const ProgressCSSVariables = {
457
466
  };
458
467
 
459
468
  // 导出默认样式
460
- export default progressStyles;
469
+ export default progressStyles;