taro-uno-ui 0.9.0-beta

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 (397) hide show
  1. package/LICENSE +100 -0
  2. package/README.md +273 -0
  3. package/dist/js/index-6NJ3A1Dn.js +26535 -0
  4. package/dist/js/index-6NJ3A1Dn.js.map +1 -0
  5. package/dist/js/index-DFdcksbe.js +1165 -0
  6. package/dist/js/index-DFdcksbe.js.map +1 -0
  7. package/dist/js/index-DXRIkWX1.js +1148 -0
  8. package/dist/js/index-DXRIkWX1.js.map +1 -0
  9. package/dist/js/index-DffLRSro.js +26519 -0
  10. package/dist/js/index-DffLRSro.js.map +1 -0
  11. package/package.json +119 -0
  12. package/src/app.config.ts +55 -0
  13. package/src/app.scss +508 -0
  14. package/src/app.tsx +44 -0
  15. package/src/components/basic/Button/Button.styles.ts +130 -0
  16. package/src/components/basic/Button/Button.test.tsx +154 -0
  17. package/src/components/basic/Button/Button.tsx +93 -0
  18. package/src/components/basic/Button/Button.types.ts +45 -0
  19. package/src/components/basic/Button/index.tsx +6 -0
  20. package/src/components/basic/Divider/Divider.styles.ts +488 -0
  21. package/src/components/basic/Divider/Divider.test.tsx +551 -0
  22. package/src/components/basic/Divider/Divider.tsx +361 -0
  23. package/src/components/basic/Divider/Divider.types.ts +261 -0
  24. package/src/components/basic/Divider/index.tsx +25 -0
  25. package/src/components/basic/Icon/Icon.styles.ts +359 -0
  26. package/src/components/basic/Icon/Icon.test.tsx +357 -0
  27. package/src/components/basic/Icon/Icon.tsx +154 -0
  28. package/src/components/basic/Icon/Icon.types.ts +210 -0
  29. package/src/components/basic/Icon/index.tsx +22 -0
  30. package/src/components/basic/Text/Text.styles.ts +500 -0
  31. package/src/components/basic/Text/Text.test.tsx +299 -0
  32. package/src/components/basic/Text/Text.tsx +340 -0
  33. package/src/components/basic/Text/Text.types.ts +319 -0
  34. package/src/components/basic/Text/index.tsx +27 -0
  35. package/src/components/basic/Typography/Typography.styles.ts +346 -0
  36. package/src/components/basic/Typography/Typography.tsx +205 -0
  37. package/src/components/basic/Typography/Typography.types.ts +296 -0
  38. package/src/components/basic/Typography/index.tsx +14 -0
  39. package/src/components/basic/index.tsx +302 -0
  40. package/src/components/common/ErrorBoundary.tsx +87 -0
  41. package/src/components/common/LazyComponent.tsx +246 -0
  42. package/src/components/common/ResponsiveContainer.tsx +93 -0
  43. package/src/components/common/ResponsiveGrid.tsx +183 -0
  44. package/src/components/common/SecurityProvider.tsx +110 -0
  45. package/src/components/common/ThemeProvider.tsx +128 -0
  46. package/src/components/common/VirtualList.tsx +368 -0
  47. package/src/components/common/__tests__/ErrorBoundary.test.tsx +249 -0
  48. package/src/components/common/index.tsx +7 -0
  49. package/src/components/display/Avatar/Avatar.styles.ts +62 -0
  50. package/src/components/display/Avatar/Avatar.test.tsx +390 -0
  51. package/src/components/display/Avatar/Avatar.tsx +79 -0
  52. package/src/components/display/Avatar/Avatar.types.ts +40 -0
  53. package/src/components/display/Avatar/index.ts +3 -0
  54. package/src/components/display/Badge/Badge.tsx +42 -0
  55. package/src/components/display/Badge/Badge.types.ts +29 -0
  56. package/src/components/display/Badge/index.ts +2 -0
  57. package/src/components/display/Calendar/Calendar.styles.ts +255 -0
  58. package/src/components/display/Calendar/Calendar.test.tsx +30 -0
  59. package/src/components/display/Calendar/Calendar.tsx +337 -0
  60. package/src/components/display/Calendar/Calendar.types.ts +91 -0
  61. package/src/components/display/Calendar/index.ts +3 -0
  62. package/src/components/display/Card/Card.styles.ts +89 -0
  63. package/src/components/display/Card/Card.test.tsx +180 -0
  64. package/src/components/display/Card/Card.tsx +135 -0
  65. package/src/components/display/Card/Card.types.ts +55 -0
  66. package/src/components/display/Card/index.ts +3 -0
  67. package/src/components/display/Carousel/Carousel.styles.ts +206 -0
  68. package/src/components/display/Carousel/Carousel.tsx +295 -0
  69. package/src/components/display/Carousel/Carousel.types.ts +57 -0
  70. package/src/components/display/Carousel/index.ts +3 -0
  71. package/src/components/display/List/List.styles.ts +79 -0
  72. package/src/components/display/List/List.tsx +115 -0
  73. package/src/components/display/List/List.types.ts +68 -0
  74. package/src/components/display/List/index.ts +3 -0
  75. package/src/components/display/Rate/Rate.styles.ts +266 -0
  76. package/src/components/display/Rate/Rate.tsx +332 -0
  77. package/src/components/display/Rate/Rate.types.ts +111 -0
  78. package/src/components/display/Rate/index.ts +28 -0
  79. package/src/components/display/Table/Table.styles.ts +269 -0
  80. package/src/components/display/Table/Table.test.tsx +343 -0
  81. package/src/components/display/Table/Table.tsx +430 -0
  82. package/src/components/display/Table/Table.types.ts +255 -0
  83. package/src/components/display/Table/index.tsx +16 -0
  84. package/src/components/display/Tag/Tag.styles.ts +197 -0
  85. package/src/components/display/Tag/Tag.test.tsx +541 -0
  86. package/src/components/display/Tag/Tag.tsx +156 -0
  87. package/src/components/display/Tag/Tag.types.ts +49 -0
  88. package/src/components/display/Tag/index.ts +3 -0
  89. package/src/components/display/Timeline/Timeline.styles.ts +211 -0
  90. package/src/components/display/Timeline/Timeline.tsx +239 -0
  91. package/src/components/display/Timeline/Timeline.types.ts +56 -0
  92. package/src/components/display/Timeline/index.ts +3 -0
  93. package/src/components/display/index.tsx +143 -0
  94. package/src/components/feedback/Loading/Loading.styles.ts +117 -0
  95. package/src/components/feedback/Loading/Loading.test.tsx +534 -0
  96. package/src/components/feedback/Loading/Loading.tsx +127 -0
  97. package/src/components/feedback/Loading/Loading.types.ts +33 -0
  98. package/src/components/feedback/Loading/index.ts +9 -0
  99. package/src/components/feedback/Message/Message.styles.ts +41 -0
  100. package/src/components/feedback/Message/Message.test.tsx +234 -0
  101. package/src/components/feedback/Message/Message.tsx +96 -0
  102. package/src/components/feedback/Message/Message.types.ts +37 -0
  103. package/src/components/feedback/Message/index.ts +9 -0
  104. package/src/components/feedback/Modal/Modal.styles.ts +21 -0
  105. package/src/components/feedback/Modal/Modal.test.tsx +11 -0
  106. package/src/components/feedback/Modal/Modal.tsx +291 -0
  107. package/src/components/feedback/Modal/Modal.types.ts +141 -0
  108. package/src/components/feedback/Modal/index.tsx +11 -0
  109. package/src/components/feedback/Notification/Notification.styles.ts +443 -0
  110. package/src/components/feedback/Notification/Notification.test.tsx +401 -0
  111. package/src/components/feedback/Notification/Notification.tsx +370 -0
  112. package/src/components/feedback/Notification/Notification.types.ts +336 -0
  113. package/src/components/feedback/Notification/NotificationManager.tsx +376 -0
  114. package/src/components/feedback/Notification/index.ts +33 -0
  115. package/src/components/feedback/Notification/index.tsx +164 -0
  116. package/src/components/feedback/Progress/Progress.styles.ts +460 -0
  117. package/src/components/feedback/Progress/Progress.test.simple.tsx +14 -0
  118. package/src/components/feedback/Progress/Progress.test.tsx +312 -0
  119. package/src/components/feedback/Progress/Progress.tsx +508 -0
  120. package/src/components/feedback/Progress/Progress.types.ts +163 -0
  121. package/src/components/feedback/Progress/index.ts +3 -0
  122. package/src/components/feedback/Progress/index.tsx +38 -0
  123. package/src/components/feedback/Progress/utils/animation.ts +204 -0
  124. package/src/components/feedback/Progress/utils/index.ts +26 -0
  125. package/src/components/feedback/Progress/utils/progress-calculator.ts +217 -0
  126. package/src/components/feedback/Result/Result.styles.ts +139 -0
  127. package/src/components/feedback/Result/Result.tsx +233 -0
  128. package/src/components/feedback/Result/Result.types.ts +128 -0
  129. package/src/components/feedback/Result/index.tsx +3 -0
  130. package/src/components/feedback/Toast/Toast.styles.ts +17 -0
  131. package/src/components/feedback/Toast/Toast.test.tsx +10 -0
  132. package/src/components/feedback/Toast/Toast.tsx +372 -0
  133. package/src/components/feedback/Toast/Toast.types.ts +86 -0
  134. package/src/components/feedback/Toast/index.tsx +3 -0
  135. package/src/components/feedback/Tooltip/Tooltip.examples.tsx +458 -0
  136. package/src/components/feedback/Tooltip/Tooltip.styles.ts +346 -0
  137. package/src/components/feedback/Tooltip/Tooltip.test.tsx +446 -0
  138. package/src/components/feedback/Tooltip/Tooltip.tsx +283 -0
  139. package/src/components/feedback/Tooltip/Tooltip.types.ts +172 -0
  140. package/src/components/feedback/Tooltip/index.ts +3 -0
  141. package/src/components/feedback/Tooltip/index.tsx +258 -0
  142. package/src/components/feedback/index.tsx +164 -0
  143. package/src/components/form/Cascader/Cascader.styles.ts +526 -0
  144. package/src/components/form/Cascader/Cascader.test.tsx +77 -0
  145. package/src/components/form/Cascader/Cascader.tsx +585 -0
  146. package/src/components/form/Cascader/Cascader.types.ts +582 -0
  147. package/src/components/form/Cascader/hooks/index.ts +3 -0
  148. package/src/components/form/Cascader/hooks/useCascaderFieldNames.ts +16 -0
  149. package/src/components/form/Cascader/hooks/useCascaderOptions.ts +109 -0
  150. package/src/components/form/Cascader/hooks/useCascaderState.ts +133 -0
  151. package/src/components/form/Cascader/index.ts +25 -0
  152. package/src/components/form/Cascader/utils/formatDisplayValue.ts +19 -0
  153. package/src/components/form/Cascader/utils/index.ts +1 -0
  154. package/src/components/form/Checkbox/Checkbox.styles.ts +608 -0
  155. package/src/components/form/Checkbox/Checkbox.test.tsx +1140 -0
  156. package/src/components/form/Checkbox/Checkbox.tsx +496 -0
  157. package/src/components/form/Checkbox/Checkbox.types.ts +472 -0
  158. package/src/components/form/Checkbox/CheckboxGroup.tsx +444 -0
  159. package/src/components/form/Checkbox/index.tsx +27 -0
  160. package/src/components/form/DatePicker/DatePicker.styles.ts +393 -0
  161. package/src/components/form/DatePicker/DatePicker.test.tsx +407 -0
  162. package/src/components/form/DatePicker/DatePicker.tsx +360 -0
  163. package/src/components/form/DatePicker/DatePicker.types.ts +247 -0
  164. package/src/components/form/DatePicker/index.tsx +15 -0
  165. package/src/components/form/Form/Form.styles.ts +357 -0
  166. package/src/components/form/Form/Form.test.tsx +122 -0
  167. package/src/components/form/Form/Form.tsx +695 -0
  168. package/src/components/form/Form/Form.types.ts +407 -0
  169. package/src/components/form/Form/index.tsx +31 -0
  170. package/src/components/form/Input/Input.enhanced.tsx +732 -0
  171. package/src/components/form/Input/Input.styles.ts +438 -0
  172. package/src/components/form/Input/Input.test.tsx +494 -0
  173. package/src/components/form/Input/Input.tsx +541 -0
  174. package/src/components/form/Input/Input.types.ts +285 -0
  175. package/src/components/form/Input/index.tsx +26 -0
  176. package/src/components/form/InputNumber/InputNumber.styles.ts +665 -0
  177. package/src/components/form/InputNumber/InputNumber.tsx +370 -0
  178. package/src/components/form/InputNumber/InputNumber.types.ts +318 -0
  179. package/src/components/form/InputNumber/components/InputNumberClearButton.tsx +32 -0
  180. package/src/components/form/InputNumber/components/InputNumberControls.tsx +42 -0
  181. package/src/components/form/InputNumber/components/index.ts +2 -0
  182. package/src/components/form/InputNumber/hooks/index.ts +4 -0
  183. package/src/components/form/InputNumber/hooks/useInputNumberState.ts +315 -0
  184. package/src/components/form/InputNumber/hooks/useInputNumberValidation.ts +147 -0
  185. package/src/components/form/InputNumber/index.ts +25 -0
  186. package/src/components/form/Radio/Radio.styles.ts +458 -0
  187. package/src/components/form/Radio/Radio.test.tsx +547 -0
  188. package/src/components/form/Radio/Radio.tsx +283 -0
  189. package/src/components/form/Radio/Radio.types.ts +410 -0
  190. package/src/components/form/Radio/index.tsx +21 -0
  191. package/src/components/form/Select/Select.styles.ts +514 -0
  192. package/src/components/form/Select/Select.test.tsx +648 -0
  193. package/src/components/form/Select/Select.tsx +474 -0
  194. package/src/components/form/Select/Select.types.ts +428 -0
  195. package/src/components/form/Select/index.tsx +30 -0
  196. package/src/components/form/Slider/Slider.styles.ts +139 -0
  197. package/src/components/form/Slider/Slider.test.tsx +553 -0
  198. package/src/components/form/Slider/Slider.tsx +326 -0
  199. package/src/components/form/Slider/Slider.types.ts +108 -0
  200. package/src/components/form/Slider/index.tsx +10 -0
  201. package/src/components/form/Switch/Switch.styles.ts +540 -0
  202. package/src/components/form/Switch/Switch.test.tsx +345 -0
  203. package/src/components/form/Switch/Switch.tsx +464 -0
  204. package/src/components/form/Switch/Switch.types.ts +386 -0
  205. package/src/components/form/Switch/index.tsx +26 -0
  206. package/src/components/form/Textarea/Textarea.styles.ts +592 -0
  207. package/src/components/form/Textarea/Textarea.test.tsx +1075 -0
  208. package/src/components/form/Textarea/Textarea.tsx +602 -0
  209. package/src/components/form/Textarea/Textarea.types.ts +371 -0
  210. package/src/components/form/Textarea/index.tsx +26 -0
  211. package/src/components/form/TimePicker/TimePicker.styles.ts +438 -0
  212. package/src/components/form/TimePicker/TimePicker.test.tsx +306 -0
  213. package/src/components/form/TimePicker/TimePicker.tsx +228 -0
  214. package/src/components/form/TimePicker/TimePicker.types.ts +385 -0
  215. package/src/components/form/TimePicker/index.ts +21 -0
  216. package/src/components/form/Transfer/Transfer.styles.ts +502 -0
  217. package/src/components/form/Transfer/Transfer.test.tsx +316 -0
  218. package/src/components/form/Transfer/Transfer.tsx +402 -0
  219. package/src/components/form/Transfer/Transfer.types.ts +557 -0
  220. package/src/components/form/Transfer/components/TransferItem.tsx +101 -0
  221. package/src/components/form/Transfer/components/TransferList.tsx +285 -0
  222. package/src/components/form/Transfer/components/TransferOperations.tsx +84 -0
  223. package/src/components/form/Transfer/components/TransferPagination.tsx +135 -0
  224. package/src/components/form/Transfer/components/TransferSearch.tsx +88 -0
  225. package/src/components/form/Transfer/components/index.ts +6 -0
  226. package/src/components/form/Transfer/hooks/index.ts +3 -0
  227. package/src/components/form/Transfer/hooks/useTransferData.ts +192 -0
  228. package/src/components/form/Transfer/hooks/useTransferState.ts +114 -0
  229. package/src/components/form/Transfer/index.ts +33 -0
  230. package/src/components/form/Upload/Upload.styles.ts +145 -0
  231. package/src/components/form/Upload/Upload.test.tsx +10 -0
  232. package/src/components/form/Upload/Upload.tsx +451 -0
  233. package/src/components/form/Upload/Upload.types.ts +200 -0
  234. package/src/components/form/Upload/index.tsx +12 -0
  235. package/src/components/form/index.tsx +121 -0
  236. package/src/components/index.tsx +146 -0
  237. package/src/components/layout/Affix/Affix.styles.ts +37 -0
  238. package/src/components/layout/Affix/Affix.test.tsx +10 -0
  239. package/src/components/layout/Affix/Affix.tsx +91 -0
  240. package/src/components/layout/Affix/Affix.types.ts +29 -0
  241. package/src/components/layout/Affix/index.tsx +3 -0
  242. package/src/components/layout/Col/Col.styles.ts +185 -0
  243. package/src/components/layout/Col/Col.test.tsx +535 -0
  244. package/src/components/layout/Col/Col.tsx +115 -0
  245. package/src/components/layout/Col/Col.types.ts +59 -0
  246. package/src/components/layout/Col/index.tsx +3 -0
  247. package/src/components/layout/Container/Container.styles.ts +161 -0
  248. package/src/components/layout/Container/Container.test.tsx +380 -0
  249. package/src/components/layout/Container/Container.tsx +132 -0
  250. package/src/components/layout/Container/Container.types.ts +63 -0
  251. package/src/components/layout/Container/index.tsx +3 -0
  252. package/src/components/layout/Grid/Grid.styles.ts +183 -0
  253. package/src/components/layout/Grid/Grid.test.tsx +637 -0
  254. package/src/components/layout/Grid/Grid.tsx +173 -0
  255. package/src/components/layout/Grid/Grid.types.ts +78 -0
  256. package/src/components/layout/Grid/index.tsx +3 -0
  257. package/src/components/layout/Layout/Content.tsx +38 -0
  258. package/src/components/layout/Layout/Footer.tsx +38 -0
  259. package/src/components/layout/Layout/Header.tsx +38 -0
  260. package/src/components/layout/Layout/Layout.styles.ts +84 -0
  261. package/src/components/layout/Layout/Layout.test.tsx +10 -0
  262. package/src/components/layout/Layout/Layout.tsx +39 -0
  263. package/src/components/layout/Layout/Layout.types.ts +58 -0
  264. package/src/components/layout/Layout/Sider.tsx +56 -0
  265. package/src/components/layout/Layout/index.tsx +8 -0
  266. package/src/components/layout/Row/Row.styles.ts +159 -0
  267. package/src/components/layout/Row/Row.test.tsx +467 -0
  268. package/src/components/layout/Row/Row.tsx +139 -0
  269. package/src/components/layout/Row/Row.types.ts +60 -0
  270. package/src/components/layout/Row/index.tsx +3 -0
  271. package/src/components/layout/Space/Space.styles.ts +255 -0
  272. package/src/components/layout/Space/Space.test.tsx +682 -0
  273. package/src/components/layout/Space/Space.tsx +211 -0
  274. package/src/components/layout/Space/Space.types.ts +92 -0
  275. package/src/components/layout/Space/index.tsx +12 -0
  276. package/src/components/layout/index.tsx +68 -0
  277. package/src/components/navigation/Menu/Menu.styles.ts +779 -0
  278. package/src/components/navigation/Menu/Menu.tsx +355 -0
  279. package/src/components/navigation/Menu/Menu.types.ts +231 -0
  280. package/src/components/navigation/Menu/Menu.utils.ts +187 -0
  281. package/src/components/navigation/Menu/MenuItem.tsx +126 -0
  282. package/src/components/navigation/Menu/SubMenu.tsx +148 -0
  283. package/src/components/navigation/Menu/__tests__/Menu.test.tsx +687 -0
  284. package/src/components/navigation/Menu/index.tsx +124 -0
  285. package/src/components/navigation/NavBar/NavBar.styles.ts +129 -0
  286. package/src/components/navigation/NavBar/NavBar.test.tsx +287 -0
  287. package/src/components/navigation/NavBar/NavBar.tsx +231 -0
  288. package/src/components/navigation/NavBar/NavBar.types.ts +54 -0
  289. package/src/components/navigation/NavBar/index.tsx +3 -0
  290. package/src/components/navigation/Pagination/Pagination.styles.ts +187 -0
  291. package/src/components/navigation/Pagination/Pagination.test.tsx +673 -0
  292. package/src/components/navigation/Pagination/Pagination.tsx +395 -0
  293. package/src/components/navigation/Pagination/Pagination.types.ts +86 -0
  294. package/src/components/navigation/Pagination/index.ts +18 -0
  295. package/src/components/navigation/Pagination/index.tsx +9 -0
  296. package/src/components/navigation/Steps/Step.tsx +56 -0
  297. package/src/components/navigation/Steps/Steps.styles.ts +154 -0
  298. package/src/components/navigation/Steps/Steps.test.tsx +12 -0
  299. package/src/components/navigation/Steps/Steps.tsx +113 -0
  300. package/src/components/navigation/Steps/Steps.types.ts +47 -0
  301. package/src/components/navigation/Steps/index.tsx +3 -0
  302. package/src/components/navigation/Tabs/Tabs.styles.ts +199 -0
  303. package/src/components/navigation/Tabs/Tabs.test.tsx +661 -0
  304. package/src/components/navigation/Tabs/Tabs.tsx +253 -0
  305. package/src/components/navigation/Tabs/Tabs.types.ts +114 -0
  306. package/src/components/navigation/Tabs/index.tsx +3 -0
  307. package/src/components/navigation/Tree/Tree.styles.ts +553 -0
  308. package/src/components/navigation/Tree/Tree.test.basic.tsx +7 -0
  309. package/src/components/navigation/Tree/Tree.test.functional.tsx +496 -0
  310. package/src/components/navigation/Tree/Tree.test.import.check.tsx +6 -0
  311. package/src/components/navigation/Tree/Tree.test.import.tsx +6 -0
  312. package/src/components/navigation/Tree/Tree.test.minimal.tsx +5 -0
  313. package/src/components/navigation/Tree/Tree.test.simple.tsx +30 -0
  314. package/src/components/navigation/Tree/Tree.test.tsx +908 -0
  315. package/src/components/navigation/Tree/Tree.test.working.tsx +673 -0
  316. package/src/components/navigation/Tree/Tree.tsx +600 -0
  317. package/src/components/navigation/Tree/Tree.types.ts +909 -0
  318. package/src/components/navigation/Tree/Tree.utils.ts +452 -0
  319. package/src/components/navigation/Tree/index.ts +33 -0
  320. package/src/components/navigation/Tree/index.tsx +23 -0
  321. package/src/components/navigation/index.tsx +83 -0
  322. package/src/constants/index.ts +785 -0
  323. package/src/hooks/index.ts +110 -0
  324. package/src/hooks/types.ts +10 -0
  325. package/src/hooks/useAsync.ts +65 -0
  326. package/src/hooks/useEventHandling.ts +444 -0
  327. package/src/hooks/useLifecycle.ts +399 -0
  328. package/src/hooks/usePerformance.ts +441 -0
  329. package/src/hooks/usePerformanceMonitor.ts +348 -0
  330. package/src/hooks/usePlatform.ts +62 -0
  331. package/src/hooks/useRequest.test.ts +11 -0
  332. package/src/hooks/useRequest.ts +135 -0
  333. package/src/hooks/useStateManagement.ts +300 -0
  334. package/src/hooks/useStyle.ts +537 -0
  335. package/src/hooks/useTheme.ts +347 -0
  336. package/src/hooks/useVirtualScroll.ts +331 -0
  337. package/src/index.ts +298 -0
  338. package/src/platform/index.ts +1188 -0
  339. package/src/providers/AppProvider.test.tsx +63 -0
  340. package/src/providers/AppProvider.tsx +155 -0
  341. package/src/providers/index.ts +1 -0
  342. package/src/theme/ThemeProvider.tsx +283 -0
  343. package/src/theme/ThemeProvider.types.ts +26 -0
  344. package/src/theme/animations.tsx +660 -0
  345. package/src/theme/defaults.ts +188 -0
  346. package/src/theme/design-system.ts +562 -0
  347. package/src/theme/design-tokens.ts +1136 -0
  348. package/src/theme/generated/dark-theme.scss +120 -0
  349. package/src/theme/generated/tokens.css +441 -0
  350. package/src/theme/generated/tokens.scss +320 -0
  351. package/src/theme/index.ts +120 -0
  352. package/src/theme/responsive.tsx +193 -0
  353. package/src/theme/styles/mixins.scss +612 -0
  354. package/src/theme/styles/variables.scss +295 -0
  355. package/src/theme/styles.ts +403 -0
  356. package/src/theme/tokens/colors.ts +256 -0
  357. package/src/theme/tokens/effects.ts +260 -0
  358. package/src/theme/tokens/index.ts +217 -0
  359. package/src/theme/tokens/spacing.ts +137 -0
  360. package/src/theme/tokens/typography.ts +186 -0
  361. package/src/theme/types.ts +188 -0
  362. package/src/theme/useThemeUtils.ts +313 -0
  363. package/src/theme/utils.ts +501 -0
  364. package/src/theme/variables.ts +583 -0
  365. package/src/types/accessibility.ts +51 -0
  366. package/src/types/button.ts +562 -0
  367. package/src/types/component-props.ts +317 -0
  368. package/src/types/env.d.ts +20 -0
  369. package/src/types/index.ts +427 -0
  370. package/src/types/modules.d.ts +40 -0
  371. package/src/types/standardized-components.ts +544 -0
  372. package/src/types/taro-adapter.d.ts +174 -0
  373. package/src/types/taro-components.d.ts +73 -0
  374. package/src/types/utils.ts +410 -0
  375. package/src/utils/__tests__/inputValidator.test.ts +338 -0
  376. package/src/utils/__tests__/responsiveUtils.test.ts +310 -0
  377. package/src/utils/__tests__/xssProtection.test.ts +268 -0
  378. package/src/utils/cache.ts +83 -0
  379. package/src/utils/createNamespace.ts +24 -0
  380. package/src/utils/environment.ts +95 -0
  381. package/src/utils/error-handler.ts +88 -0
  382. package/src/utils/errorLogger.ts +197 -0
  383. package/src/utils/formatUtils.ts +444 -0
  384. package/src/utils/index.ts +115 -0
  385. package/src/utils/inputValidator.ts +261 -0
  386. package/src/utils/network/http-client.test.ts +18 -0
  387. package/src/utils/network/http-client.ts +151 -0
  388. package/src/utils/performance/performance.ts +850 -0
  389. package/src/utils/responsiveUtils.ts +357 -0
  390. package/src/utils/rtl-support.ts +344 -0
  391. package/src/utils/security/api-security.ts +386 -0
  392. package/src/utils/security/xss-protection.ts +69 -0
  393. package/src/utils/securityHeaders.ts +314 -0
  394. package/src/utils/typeHelpers.ts +16 -0
  395. package/src/utils/types/dataProcessing.ts +543 -0
  396. package/src/utils/types/typeHelpers.ts +187 -0
  397. package/src/utils/xssProtection.ts +420 -0
@@ -0,0 +1,59 @@
1
+ import { ReactNode } from 'react';
2
+ import { BaseComponentProps } from '../../../types';
3
+ import type { RowGutter } from '../Row/Row.types';
4
+
5
+ /** Col组件跨度 */
6
+ export type ColSpan = number | `${number}`;
7
+
8
+ /** Col组件偏移量 */
9
+ export type ColOffset = number | `${number}`;
10
+
11
+ /** Col组件排序 */
12
+ export type ColOrder = number | `${number}`;
13
+
14
+ /** Col组件引用 */
15
+ export interface ColRef {
16
+ /** 获取元素引用 */
17
+ element: any;
18
+ /** 获取当前跨度 */
19
+ getSpan: () => ColSpan;
20
+ /** 获取当前偏移量 */
21
+ getOffset: () => ColOffset;
22
+ /** 获取当前排序 */
23
+ getOrder: () => ColOrder;
24
+ /** 设置跨度 */
25
+ setSpan: (_span: ColSpan) => void;
26
+ /** 设置偏移量 */
27
+ setOffset: (_offset: ColOffset) => void;
28
+ /** 设置排序 */
29
+ setOrder: (_order: ColOrder) => void;
30
+ /** 滚动到视图 */
31
+ scrollIntoView: (options?: ScrollIntoViewOptions) => void;
32
+ }
33
+
34
+ /** Col组件属性 */
35
+ export interface ColProps extends BaseComponentProps {
36
+ /** 子元素 */
37
+ children?: ReactNode;
38
+ /** 跨度 (1-24) */
39
+ span?: ColSpan;
40
+ /** 偏移量 */
41
+ offset?: ColOffset;
42
+ /** 排序 */
43
+ order?: ColOrder;
44
+ /** 从父组件Row继承的间距 */
45
+ gutter?: RowGutter;
46
+ /** 柔性布局 */
47
+ flex?: number | 'auto' | 'none';
48
+ /** 点击事件 */
49
+ onClick?: (_event: React.MouseEvent) => void;
50
+ /** 响应式断点 */
51
+ responsive?: {
52
+ xs?: Partial<ColProps>;
53
+ sm?: Partial<ColProps>;
54
+ md?: Partial<ColProps>;
55
+ lg?: Partial<ColProps>;
56
+ xl?: Partial<ColProps>;
57
+ xxl?: Partial<ColProps>;
58
+ };
59
+ }
@@ -0,0 +1,3 @@
1
+ export { Col, ColComponent } from './Col';
2
+ export type { ColProps, ColRef, ColSpan, ColOffset, ColOrder } from './Col.types';
3
+ export { colStyles } from './Col.styles';
@@ -0,0 +1,161 @@
1
+ import type { ContainerProps } from './Container.types';
2
+ import type { Size, CSSUnit } from '../../../types';
3
+
4
+ /** Container组件样式管理器 */
5
+ export const containerStyles = {
6
+ /** 尺寸映射表 */
7
+ SIZE_MAP: {
8
+ small: 320,
9
+ medium: 768,
10
+ large: 1024,
11
+ default: 1200,
12
+ full: '100%',
13
+ fluid: '100%',
14
+ } as const,
15
+
16
+ /** 对齐方式映射表 */
17
+ ALIGN_MAP: {
18
+ start: 'flex-start',
19
+ center: 'center',
20
+ end: 'flex-end',
21
+ stretch: 'stretch',
22
+ } as const,
23
+
24
+ /**
25
+ * 解析尺寸值
26
+ */
27
+ parseSize: (size: Size | number | `${number}${CSSUnit}`): number | string => {
28
+ if (typeof size === 'number') {
29
+ return `${size}px`;
30
+ }
31
+
32
+ if (typeof size === 'string') {
33
+ if (size in containerStyles.SIZE_MAP) {
34
+ return containerStyles.SIZE_MAP[size as keyof typeof containerStyles.SIZE_MAP];
35
+ }
36
+ return size;
37
+ }
38
+
39
+ return `${containerStyles.SIZE_MAP.default}px`;
40
+ },
41
+
42
+ /**
43
+ * 获取基础样式
44
+ */
45
+ getBaseStyle: (props: ContainerProps): React.CSSProperties => {
46
+ const {
47
+ size = 'default',
48
+ maxWidth,
49
+ padding = 'medium',
50
+ margin = 'medium',
51
+ align = 'stretch',
52
+ center = false,
53
+ scrollable = false,
54
+ scrollDirection = 'vertical',
55
+ style = {},
56
+ } = props;
57
+
58
+ // 计算宽度
59
+ const width = size === 'fluid' ? '100%' : size === 'full' ? '100%' : containerStyles['parseSize'](size);
60
+
61
+ // 计算最大宽度
62
+ const finalMaxWidth =
63
+ maxWidth !== undefined
64
+ ? typeof maxWidth === 'number' ? `${maxWidth}px` : containerStyles['parseSize'](maxWidth as Size)
65
+ : size === 'fluid'
66
+ ? 'none'
67
+ : containerStyles.SIZE_MAP[size as keyof typeof containerStyles.SIZE_MAP];
68
+
69
+ // 计算内边距
70
+ const paddingValue =
71
+ typeof padding === 'number'
72
+ ? `${padding}px`
73
+ : typeof padding === 'string' && padding in containerStyles.SIZE_MAP
74
+ ? `${containerStyles.SIZE_MAP[padding as keyof typeof containerStyles.SIZE_MAP]}px`
75
+ : containerStyles['parseSize'](padding);
76
+
77
+ // 计算外边距
78
+ const marginValue =
79
+ typeof margin === 'number'
80
+ ? `${margin}px`
81
+ : typeof margin === 'string' && margin in containerStyles.SIZE_MAP
82
+ ? `${containerStyles.SIZE_MAP[margin as keyof typeof containerStyles.SIZE_MAP]}px`
83
+ : containerStyles['parseSize'](margin);
84
+
85
+ // 计算对齐方式
86
+ const justifyContent = center ? 'center' : containerStyles['ALIGN_MAP'][align] || 'stretch';
87
+
88
+ // 计算滚动样式
89
+ const overflow = scrollable
90
+ ? {
91
+ overflowX: (scrollDirection === 'horizontal' || scrollDirection === 'both' ? 'auto' : 'hidden') as any,
92
+ overflowY: (scrollDirection === 'vertical' || scrollDirection === 'both' ? 'auto' : 'hidden') as any,
93
+ }
94
+ : {
95
+ overflow: 'visible' as any,
96
+ };
97
+
98
+ return {
99
+ width,
100
+ maxWidth: finalMaxWidth,
101
+ padding: paddingValue,
102
+ margin: center ? '0 auto' : marginValue,
103
+ display: 'flex',
104
+ flexDirection: 'column',
105
+ justifyContent,
106
+ alignItems: center ? 'center' : undefined,
107
+ boxSizing: 'border-box',
108
+ ...overflow,
109
+ ...style,
110
+ };
111
+ },
112
+
113
+ /**
114
+ * 获取类名
115
+ */
116
+ getClassName: (props: ContainerProps): string => {
117
+ const { size = 'default', align = 'stretch', center = false, scrollable = false, className = '' } = props;
118
+
119
+ const baseClass = 'taro-uno-container';
120
+ const sizeClass = `${baseClass}--${size}`;
121
+ const alignClass = `${baseClass}--${align}`;
122
+ const centerClass = center ? `${baseClass}--center` : '';
123
+ const scrollableClass = scrollable ? `${baseClass}--scrollable` : '';
124
+
125
+ return [baseClass, sizeClass, alignClass, centerClass, scrollableClass, className].filter(Boolean).join(' ');
126
+ },
127
+
128
+ /**
129
+ * 获取响应式样式
130
+ */
131
+ getResponsiveStyle: (responsive: ContainerProps['responsive']): React.CSSProperties => {
132
+ if (!responsive) return {};
133
+
134
+ const responsiveStyle: React.CSSProperties = {};
135
+
136
+ Object.entries(responsive).forEach(([_breakpoint, props]) => {
137
+ if (props) {
138
+ // 这里需要配合CSS-in-JS库来处理响应式样式
139
+ // 暂时返回空对象
140
+ // Breakpoint value: containerStyles['getBreakpointValue'](breakpoint)
141
+ }
142
+ });
143
+
144
+ return responsiveStyle;
145
+ },
146
+
147
+ /**
148
+ * 获取断点值
149
+ */
150
+ getBreakpointValue: (breakpoint: string): number => {
151
+ const breakpoints = {
152
+ xs: 0,
153
+ sm: 640,
154
+ md: 768,
155
+ lg: 1024,
156
+ xl: 1280,
157
+ xxl: 1536,
158
+ };
159
+ return breakpoints[breakpoint as keyof typeof breakpoints] || 0;
160
+ },
161
+ };
@@ -0,0 +1,380 @@
1
+ import React from 'react'
2
+ import { render, screen, fireEvent, act } from '@testing-library/react'
3
+ import { Container } from '../Container'
4
+ import type { ContainerProps, ContainerRef } from '../Container.types'
5
+
6
+ // Mock Taro components
7
+ vi.mock('@tarojs/components', () => ({
8
+ View: 'div'
9
+ }))
10
+
11
+ // Mock styles
12
+ vi.mock('../Container.styles', () => ({
13
+ containerStyles: {
14
+ SIZE_MAP: {
15
+ small: 320,
16
+ medium: 768,
17
+ large: 1024,
18
+ default: 1200,
19
+ full: '100%',
20
+ fluid: '100%'
21
+ },
22
+ ALIGN_MAP: {
23
+ start: 'flex-start',
24
+ center: 'center',
25
+ end: 'flex-end',
26
+ stretch: 'stretch'
27
+ },
28
+ parseSize: (size: any) => {
29
+ if (typeof size === 'number') return `${size}px`
30
+ const sizeMap = { small: 320, medium: 768, large: 1024, default: 1200, full: '100%', fluid: '100%' }
31
+ if (typeof size === 'string' && size in sizeMap) {
32
+ return sizeMap[size as keyof typeof sizeMap]
33
+ }
34
+ return size || '1200px'
35
+ },
36
+ getBaseStyle: (props: any) => ({
37
+ maxWidth: props.maxWidth || 1200,
38
+ padding: '16px',
39
+ margin: '16px',
40
+ display: 'flex',
41
+ alignItems: props.center ? 'center' : 'stretch',
42
+ overflow: props.scrollable ? 'auto' : 'visible'
43
+ }),
44
+ getResponsiveStyle: (responsive: any) => responsive ? { '@media (max-width: 768px)': { maxWidth: '100%' } } : {},
45
+ getClassName: (props: any) => `taro-uno-container taro-uno-container--${props.size} taro-uno-container--${props.align} ${props.className || ''}`
46
+ }
47
+ }))
48
+
49
+ describe('Container Component', () => {
50
+ const mockRef = React.createRef<ContainerRef>()
51
+
52
+ beforeEach(() => {
53
+ vi.clearAllMocks()
54
+ })
55
+
56
+ describe('Rendering', () => {
57
+ it('renders container with default props', () => {
58
+ render(<Container data-testid="container">Test Content</Container>)
59
+ const container = screen.getByTestId('container')
60
+ expect(container).toBeInTheDocument()
61
+ expect(container).toHaveTextContent('Test Content')
62
+ })
63
+
64
+ it('renders container with custom size', () => {
65
+ render(<Container size="large" data-testid="container">Large Container</Container>)
66
+ const container = screen.getByTestId('container')
67
+ expect(container).toBeInTheDocument()
68
+ })
69
+
70
+ it('renders container with custom maxWidth', () => {
71
+ render(<Container maxWidth={800} data-testid="container">Custom Width</Container>)
72
+ const container = screen.getByTestId('container')
73
+ expect(container).toBeInTheDocument()
74
+ })
75
+
76
+ it('renders container with center alignment', () => {
77
+ render(<Container center data-testid="container">Centered</Container>)
78
+ const container = screen.getByTestId('container')
79
+ expect(container).toBeInTheDocument()
80
+ })
81
+
82
+ it('renders container with scrollable content', () => {
83
+ render(<Container scrollable data-testid="container">Scrollable</Container>)
84
+ const container = screen.getByTestId('container')
85
+ expect(container).toBeInTheDocument()
86
+ })
87
+
88
+ it('renders container with custom className', () => {
89
+ render(<Container className="custom-container" data-testid="container">Custom Class</Container>)
90
+ const container = screen.getByTestId('container')
91
+ expect(container).toBeInTheDocument()
92
+ expect(container).toHaveClass('custom-container')
93
+ })
94
+
95
+ it('renders container with responsive props', () => {
96
+ render(<Container responsive={{ xs: { size: 'small' } }} data-testid="container">Responsive</Container>)
97
+ const container = screen.getByTestId('container')
98
+ expect(container).toBeInTheDocument()
99
+ })
100
+
101
+ it('renders empty container', () => {
102
+ render(<Container data-testid="container" />)
103
+ const container = screen.getByTestId('container')
104
+ expect(container).toBeInTheDocument()
105
+ expect(container).toBeEmptyDOMElement()
106
+ })
107
+
108
+ it('renders container with multiple children', () => {
109
+ render(
110
+ <Container data-testid="container">
111
+ <div>Child 1</div>
112
+ <div>Child 2</div>
113
+ <div>Child 3</div>
114
+ </Container>
115
+ )
116
+ const container = screen.getByTestId('container')
117
+ expect(container).toBeInTheDocument()
118
+ expect(container.children).toHaveLength(3)
119
+ })
120
+ })
121
+
122
+ describe('Event Handling', () => {
123
+ it('handles click events', () => {
124
+ const handleClick = vi.fn()
125
+ render(<Container onClick={handleClick} data-testid="container">Clickable</Container>)
126
+ const container = screen.getByTestId('container')
127
+ fireEvent.click(container)
128
+ expect(handleClick).toHaveBeenCalledTimes(1)
129
+ })
130
+
131
+ it('handles scroll events', () => {
132
+ const handleScroll = vi.fn()
133
+ render(<Container onScroll={handleScroll} data-testid="container">Scrollable</Container>)
134
+ const container = screen.getByTestId('container')
135
+ fireEvent.scroll(container)
136
+ expect(handleScroll).toHaveBeenCalledTimes(1)
137
+ })
138
+
139
+ it('handles multiple event handlers', () => {
140
+ const handleClick = vi.fn()
141
+ const handleScroll = vi.fn()
142
+ render(
143
+ <Container onClick={handleClick} onScroll={handleScroll} data-testid="container">
144
+ Events
145
+ </Container>
146
+ )
147
+ const container = screen.getByTestId('container')
148
+ fireEvent.click(container)
149
+ fireEvent.scroll(container)
150
+ expect(handleClick).toHaveBeenCalledTimes(1)
151
+ expect(handleScroll).toHaveBeenCalledTimes(1)
152
+ })
153
+ })
154
+
155
+ describe('Props Updates', () => {
156
+ it('updates size prop correctly', () => {
157
+ const { rerender } = render(<Container size="small" data-testid="container">Size Test</Container>)
158
+ const container = screen.getByTestId('container')
159
+ rerender(<Container size="large" data-testid="container">Size Test</Container>)
160
+ expect(container).toBeInTheDocument()
161
+ })
162
+
163
+ it('updates align prop correctly', () => {
164
+ const { rerender } = render(<Container align="start" data-testid="container">Align Test</Container>)
165
+ const container = screen.getByTestId('container')
166
+ rerender(<Container align="center" data-testid="container">Align Test</Container>)
167
+ expect(container).toBeInTheDocument()
168
+ })
169
+
170
+ it('updates center prop correctly', () => {
171
+ const { rerender } = render(<Container center={false} data-testid="container">Center Test</Container>)
172
+ const container = screen.getByTestId('container')
173
+ rerender(<Container center={true} data-testid="container">Center Test</Container>)
174
+ expect(container).toBeInTheDocument()
175
+ })
176
+
177
+ it('updates scrollable prop correctly', () => {
178
+ const { rerender } = render(<Container scrollable={false} data-testid="container">Scroll Test</Container>)
179
+ const container = screen.getByTestId('container')
180
+ rerender(<Container scrollable={true} data-testid="container">Scroll Test</Container>)
181
+ expect(container).toBeInTheDocument()
182
+ })
183
+
184
+ it('updates scrollDirection prop correctly', () => {
185
+ const { rerender } = render(<Container scrollDirection="vertical" data-testid="container">Direction Test</Container>)
186
+ const container = screen.getByTestId('container')
187
+ rerender(<Container scrollDirection="horizontal" data-testid="container">Direction Test</Container>)
188
+ expect(container).toBeInTheDocument()
189
+ })
190
+ })
191
+
192
+ describe('Ref API', () => {
193
+ it('exposes ref methods correctly', () => {
194
+ render(<Container ref={mockRef} data-testid="container">Ref Test</Container>)
195
+
196
+ act(() => {
197
+ if (mockRef.current) {
198
+ expect(mockRef.current.getSize()).toBe('default')
199
+ expect(mockRef.current.getAlign()).toBe('stretch')
200
+ expect(mockRef.current.getMaxWidth()).toBe(1200)
201
+ }
202
+ })
203
+ })
204
+
205
+ it('sets size via ref method', () => {
206
+ render(<Container ref={mockRef} data-testid="container">Ref Size Test</Container>)
207
+
208
+ act(() => {
209
+ if (mockRef.current) {
210
+ expect(() => mockRef.current.setSize('large')).not.toThrow()
211
+ }
212
+ })
213
+ })
214
+
215
+ it('sets align via ref method', () => {
216
+ render(<Container ref={mockRef} data-testid="container">Ref Align Test</Container>)
217
+
218
+ act(() => {
219
+ if (mockRef.current) {
220
+ expect(() => mockRef.current.setAlign('center')).not.toThrow()
221
+ }
222
+ })
223
+ })
224
+
225
+ it('sets maxWidth via ref method', () => {
226
+ render(<Container ref={mockRef} data-testid="container">Ref MaxWidth Test</Container>)
227
+
228
+ act(() => {
229
+ if (mockRef.current) {
230
+ expect(() => mockRef.current.setMaxWidth(800)).not.toThrow()
231
+ }
232
+ })
233
+ })
234
+
235
+ it('calls scrollIntoView via ref method', () => {
236
+ render(<Container ref={mockRef} data-testid="container">Ref Scroll Test</Container>)
237
+
238
+ act(() => {
239
+ if (mockRef.current) {
240
+ // In mock environment, scrollIntoView might not be available
241
+ // So we test that the method exists and can be called
242
+ expect(typeof mockRef.current.scrollIntoView).toBe('function')
243
+ }
244
+ })
245
+ })
246
+
247
+ it('provides element access via ref', () => {
248
+ render(<Container ref={mockRef} data-testid="container">Ref Element Test</Container>)
249
+
250
+ act(() => {
251
+ if (mockRef.current) {
252
+ expect(mockRef.current.element).toBeDefined()
253
+ }
254
+ })
255
+ })
256
+ })
257
+
258
+ describe('Accessibility', () => {
259
+ it('has proper role attribute', () => {
260
+ render(<Container role="main" data-testid="container">Accessible</Container>)
261
+ const container = screen.getByTestId('container')
262
+ expect(container).toHaveAttribute('role', 'main')
263
+ })
264
+
265
+ it('supports aria-label', () => {
266
+ render(<Container aria-label="Main container" data-testid="container">Labeled</Container>)
267
+ const container = screen.getByTestId('container')
268
+ expect(container).toHaveAttribute('aria-label', 'Main container')
269
+ })
270
+
271
+ it('supports aria-labelledby', () => {
272
+ render(<Container aria-labelledby="container-title" data-testid="container">Labelled By</Container>)
273
+ const container = screen.getByTestId('container')
274
+ expect(container).toHaveAttribute('aria-labelledby', 'container-title')
275
+ })
276
+
277
+ it('supports tabIndex for keyboard navigation', () => {
278
+ render(<Container tabIndex={0} data-testid="container">Tabbable</Container>)
279
+ const container = screen.getByTestId('container')
280
+ expect(container).toHaveAttribute('tabindex', '0')
281
+ })
282
+
283
+ it('supports data attributes', () => {
284
+ render(<Container data-testid="container" data-custom="value">Data Attr</Container>)
285
+ const container = screen.getByTestId('container')
286
+ expect(container).toHaveAttribute('data-custom', 'value')
287
+ })
288
+ })
289
+
290
+ describe('Edge Cases', () => {
291
+ it('handles invalid size prop gracefully', () => {
292
+ render(<Container size="invalid" as any data-testid="container">Invalid Size</Container>)
293
+ expect(screen.getByTestId('container')).toBeInTheDocument()
294
+ })
295
+
296
+ it('handles invalid align prop gracefully', () => {
297
+ render(<Container align="invalid" as any data-testid="container">Invalid Align</Container>)
298
+ expect(screen.getByTestId('container')).toBeInTheDocument()
299
+ })
300
+
301
+ it('handles zero maxWidth', () => {
302
+ render(<Container maxWidth={0} data-testid="container">Zero Width</Container>)
303
+ const container = screen.getByTestId('container')
304
+ expect(container).toBeInTheDocument()
305
+ })
306
+
307
+ it('handles negative maxWidth gracefully', () => {
308
+ const { container } = render(<Container maxWidth={-100} data-testid="container">Negative Width</Container>)
309
+ expect(screen.getByTestId('container')).toBeInTheDocument()
310
+ })
311
+
312
+ it('handles very large maxWidth', () => {
313
+ render(<Container maxWidth={999999} data-testid="container">Large Width</Container>)
314
+ const container = screen.getByTestId('container')
315
+ expect(container).toBeInTheDocument()
316
+ })
317
+
318
+ it('handles undefined children', () => {
319
+ render(<Container data-testid="container">{undefined}</Container>)
320
+ const container = screen.getByTestId('container')
321
+ expect(container).toBeInTheDocument()
322
+ })
323
+
324
+ it('handles null children', () => {
325
+ render(<Container data-testid="container">{null}</Container>)
326
+ const container = screen.getByTestId('container')
327
+ expect(container).toBeInTheDocument()
328
+ })
329
+
330
+ it('handles boolean children', () => {
331
+ render(<Container data-testid="container">{true}</Container>)
332
+ const container = screen.getByTestId('container')
333
+ expect(container).toBeInTheDocument()
334
+ })
335
+ })
336
+
337
+ describe('Responsive Behavior', () => {
338
+ it('applies responsive styles correctly', () => {
339
+ const responsiveProps = {
340
+ xs: { size: 'small' },
341
+ sm: { size: 'medium' },
342
+ md: { size: 'large' }
343
+ }
344
+ render(<Container responsive={responsiveProps} data-testid="container">Responsive</Container>)
345
+ const container = screen.getByTestId('container')
346
+ expect(container).toBeInTheDocument()
347
+ })
348
+
349
+ it('handles empty responsive object', () => {
350
+ render(<Container responsive={{}} data-testid="container">Empty Responsive</Container>)
351
+ const container = screen.getByTestId('container')
352
+ expect(container).toBeInTheDocument()
353
+ })
354
+
355
+ it('handles partial responsive object', () => {
356
+ render(<Container responsive={{ xs: { size: 'small' } }} data-testid="container">Partial Responsive</Container>)
357
+ const container = screen.getByTestId('container')
358
+ expect(container).toBeInTheDocument()
359
+ })
360
+ })
361
+
362
+ describe('Performance', () => {
363
+ it('renders efficiently with many children', () => {
364
+ const children = Array.from({ length: 100 }, (_, i) => <div key={i}>Child {i}</div>)
365
+ const { container } = render(<Container data-testid="container">{children}</Container>)
366
+ expect(screen.getByTestId('container')).toBeInTheDocument()
367
+ expect(screen.getByTestId('container').children).toHaveLength(100)
368
+ })
369
+
370
+ it('handles frequent prop updates efficiently', () => {
371
+ const { rerender } = render(<Container size="small" data-testid="container">Performance</Container>)
372
+
373
+ for (let i = 0; i < 10; i++) {
374
+ rerender(<Container size={i % 2 === 0 ? 'small' : 'large'} data-testid="container">Performance</Container>)
375
+ }
376
+
377
+ expect(screen.getByTestId('container')).toBeInTheDocument()
378
+ })
379
+ })
380
+ })