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.
- package/LICENSE +100 -0
- package/README.md +273 -0
- package/dist/js/index-6NJ3A1Dn.js +26535 -0
- package/dist/js/index-6NJ3A1Dn.js.map +1 -0
- package/dist/js/index-DFdcksbe.js +1165 -0
- package/dist/js/index-DFdcksbe.js.map +1 -0
- package/dist/js/index-DXRIkWX1.js +1148 -0
- package/dist/js/index-DXRIkWX1.js.map +1 -0
- package/dist/js/index-DffLRSro.js +26519 -0
- package/dist/js/index-DffLRSro.js.map +1 -0
- package/package.json +119 -0
- package/src/app.config.ts +55 -0
- package/src/app.scss +508 -0
- package/src/app.tsx +44 -0
- package/src/components/basic/Button/Button.styles.ts +130 -0
- package/src/components/basic/Button/Button.test.tsx +154 -0
- package/src/components/basic/Button/Button.tsx +93 -0
- package/src/components/basic/Button/Button.types.ts +45 -0
- package/src/components/basic/Button/index.tsx +6 -0
- package/src/components/basic/Divider/Divider.styles.ts +488 -0
- package/src/components/basic/Divider/Divider.test.tsx +551 -0
- package/src/components/basic/Divider/Divider.tsx +361 -0
- package/src/components/basic/Divider/Divider.types.ts +261 -0
- package/src/components/basic/Divider/index.tsx +25 -0
- package/src/components/basic/Icon/Icon.styles.ts +359 -0
- package/src/components/basic/Icon/Icon.test.tsx +357 -0
- package/src/components/basic/Icon/Icon.tsx +154 -0
- package/src/components/basic/Icon/Icon.types.ts +210 -0
- package/src/components/basic/Icon/index.tsx +22 -0
- package/src/components/basic/Text/Text.styles.ts +500 -0
- package/src/components/basic/Text/Text.test.tsx +299 -0
- package/src/components/basic/Text/Text.tsx +340 -0
- package/src/components/basic/Text/Text.types.ts +319 -0
- package/src/components/basic/Text/index.tsx +27 -0
- package/src/components/basic/Typography/Typography.styles.ts +346 -0
- package/src/components/basic/Typography/Typography.tsx +205 -0
- package/src/components/basic/Typography/Typography.types.ts +296 -0
- package/src/components/basic/Typography/index.tsx +14 -0
- package/src/components/basic/index.tsx +302 -0
- package/src/components/common/ErrorBoundary.tsx +87 -0
- package/src/components/common/LazyComponent.tsx +246 -0
- package/src/components/common/ResponsiveContainer.tsx +93 -0
- package/src/components/common/ResponsiveGrid.tsx +183 -0
- package/src/components/common/SecurityProvider.tsx +110 -0
- package/src/components/common/ThemeProvider.tsx +128 -0
- package/src/components/common/VirtualList.tsx +368 -0
- package/src/components/common/__tests__/ErrorBoundary.test.tsx +249 -0
- package/src/components/common/index.tsx +7 -0
- package/src/components/display/Avatar/Avatar.styles.ts +62 -0
- package/src/components/display/Avatar/Avatar.test.tsx +390 -0
- package/src/components/display/Avatar/Avatar.tsx +79 -0
- package/src/components/display/Avatar/Avatar.types.ts +40 -0
- package/src/components/display/Avatar/index.ts +3 -0
- package/src/components/display/Badge/Badge.tsx +42 -0
- package/src/components/display/Badge/Badge.types.ts +29 -0
- package/src/components/display/Badge/index.ts +2 -0
- package/src/components/display/Calendar/Calendar.styles.ts +255 -0
- package/src/components/display/Calendar/Calendar.test.tsx +30 -0
- package/src/components/display/Calendar/Calendar.tsx +337 -0
- package/src/components/display/Calendar/Calendar.types.ts +91 -0
- package/src/components/display/Calendar/index.ts +3 -0
- package/src/components/display/Card/Card.styles.ts +89 -0
- package/src/components/display/Card/Card.test.tsx +180 -0
- package/src/components/display/Card/Card.tsx +135 -0
- package/src/components/display/Card/Card.types.ts +55 -0
- package/src/components/display/Card/index.ts +3 -0
- package/src/components/display/Carousel/Carousel.styles.ts +206 -0
- package/src/components/display/Carousel/Carousel.tsx +295 -0
- package/src/components/display/Carousel/Carousel.types.ts +57 -0
- package/src/components/display/Carousel/index.ts +3 -0
- package/src/components/display/List/List.styles.ts +79 -0
- package/src/components/display/List/List.tsx +115 -0
- package/src/components/display/List/List.types.ts +68 -0
- package/src/components/display/List/index.ts +3 -0
- package/src/components/display/Rate/Rate.styles.ts +266 -0
- package/src/components/display/Rate/Rate.tsx +332 -0
- package/src/components/display/Rate/Rate.types.ts +111 -0
- package/src/components/display/Rate/index.ts +28 -0
- package/src/components/display/Table/Table.styles.ts +269 -0
- package/src/components/display/Table/Table.test.tsx +343 -0
- package/src/components/display/Table/Table.tsx +430 -0
- package/src/components/display/Table/Table.types.ts +255 -0
- package/src/components/display/Table/index.tsx +16 -0
- package/src/components/display/Tag/Tag.styles.ts +197 -0
- package/src/components/display/Tag/Tag.test.tsx +541 -0
- package/src/components/display/Tag/Tag.tsx +156 -0
- package/src/components/display/Tag/Tag.types.ts +49 -0
- package/src/components/display/Tag/index.ts +3 -0
- package/src/components/display/Timeline/Timeline.styles.ts +211 -0
- package/src/components/display/Timeline/Timeline.tsx +239 -0
- package/src/components/display/Timeline/Timeline.types.ts +56 -0
- package/src/components/display/Timeline/index.ts +3 -0
- package/src/components/display/index.tsx +143 -0
- package/src/components/feedback/Loading/Loading.styles.ts +117 -0
- package/src/components/feedback/Loading/Loading.test.tsx +534 -0
- package/src/components/feedback/Loading/Loading.tsx +127 -0
- package/src/components/feedback/Loading/Loading.types.ts +33 -0
- package/src/components/feedback/Loading/index.ts +9 -0
- package/src/components/feedback/Message/Message.styles.ts +41 -0
- package/src/components/feedback/Message/Message.test.tsx +234 -0
- package/src/components/feedback/Message/Message.tsx +96 -0
- package/src/components/feedback/Message/Message.types.ts +37 -0
- package/src/components/feedback/Message/index.ts +9 -0
- package/src/components/feedback/Modal/Modal.styles.ts +21 -0
- package/src/components/feedback/Modal/Modal.test.tsx +11 -0
- package/src/components/feedback/Modal/Modal.tsx +291 -0
- package/src/components/feedback/Modal/Modal.types.ts +141 -0
- package/src/components/feedback/Modal/index.tsx +11 -0
- package/src/components/feedback/Notification/Notification.styles.ts +443 -0
- package/src/components/feedback/Notification/Notification.test.tsx +401 -0
- package/src/components/feedback/Notification/Notification.tsx +370 -0
- package/src/components/feedback/Notification/Notification.types.ts +336 -0
- package/src/components/feedback/Notification/NotificationManager.tsx +376 -0
- package/src/components/feedback/Notification/index.ts +33 -0
- package/src/components/feedback/Notification/index.tsx +164 -0
- package/src/components/feedback/Progress/Progress.styles.ts +460 -0
- package/src/components/feedback/Progress/Progress.test.simple.tsx +14 -0
- package/src/components/feedback/Progress/Progress.test.tsx +312 -0
- package/src/components/feedback/Progress/Progress.tsx +508 -0
- package/src/components/feedback/Progress/Progress.types.ts +163 -0
- package/src/components/feedback/Progress/index.ts +3 -0
- package/src/components/feedback/Progress/index.tsx +38 -0
- package/src/components/feedback/Progress/utils/animation.ts +204 -0
- package/src/components/feedback/Progress/utils/index.ts +26 -0
- package/src/components/feedback/Progress/utils/progress-calculator.ts +217 -0
- package/src/components/feedback/Result/Result.styles.ts +139 -0
- package/src/components/feedback/Result/Result.tsx +233 -0
- package/src/components/feedback/Result/Result.types.ts +128 -0
- package/src/components/feedback/Result/index.tsx +3 -0
- package/src/components/feedback/Toast/Toast.styles.ts +17 -0
- package/src/components/feedback/Toast/Toast.test.tsx +10 -0
- package/src/components/feedback/Toast/Toast.tsx +372 -0
- package/src/components/feedback/Toast/Toast.types.ts +86 -0
- package/src/components/feedback/Toast/index.tsx +3 -0
- package/src/components/feedback/Tooltip/Tooltip.examples.tsx +458 -0
- package/src/components/feedback/Tooltip/Tooltip.styles.ts +346 -0
- package/src/components/feedback/Tooltip/Tooltip.test.tsx +446 -0
- package/src/components/feedback/Tooltip/Tooltip.tsx +283 -0
- package/src/components/feedback/Tooltip/Tooltip.types.ts +172 -0
- package/src/components/feedback/Tooltip/index.ts +3 -0
- package/src/components/feedback/Tooltip/index.tsx +258 -0
- package/src/components/feedback/index.tsx +164 -0
- package/src/components/form/Cascader/Cascader.styles.ts +526 -0
- package/src/components/form/Cascader/Cascader.test.tsx +77 -0
- package/src/components/form/Cascader/Cascader.tsx +585 -0
- package/src/components/form/Cascader/Cascader.types.ts +582 -0
- package/src/components/form/Cascader/hooks/index.ts +3 -0
- package/src/components/form/Cascader/hooks/useCascaderFieldNames.ts +16 -0
- package/src/components/form/Cascader/hooks/useCascaderOptions.ts +109 -0
- package/src/components/form/Cascader/hooks/useCascaderState.ts +133 -0
- package/src/components/form/Cascader/index.ts +25 -0
- package/src/components/form/Cascader/utils/formatDisplayValue.ts +19 -0
- package/src/components/form/Cascader/utils/index.ts +1 -0
- package/src/components/form/Checkbox/Checkbox.styles.ts +608 -0
- package/src/components/form/Checkbox/Checkbox.test.tsx +1140 -0
- package/src/components/form/Checkbox/Checkbox.tsx +496 -0
- package/src/components/form/Checkbox/Checkbox.types.ts +472 -0
- package/src/components/form/Checkbox/CheckboxGroup.tsx +444 -0
- package/src/components/form/Checkbox/index.tsx +27 -0
- package/src/components/form/DatePicker/DatePicker.styles.ts +393 -0
- package/src/components/form/DatePicker/DatePicker.test.tsx +407 -0
- package/src/components/form/DatePicker/DatePicker.tsx +360 -0
- package/src/components/form/DatePicker/DatePicker.types.ts +247 -0
- package/src/components/form/DatePicker/index.tsx +15 -0
- package/src/components/form/Form/Form.styles.ts +357 -0
- package/src/components/form/Form/Form.test.tsx +122 -0
- package/src/components/form/Form/Form.tsx +695 -0
- package/src/components/form/Form/Form.types.ts +407 -0
- package/src/components/form/Form/index.tsx +31 -0
- package/src/components/form/Input/Input.enhanced.tsx +732 -0
- package/src/components/form/Input/Input.styles.ts +438 -0
- package/src/components/form/Input/Input.test.tsx +494 -0
- package/src/components/form/Input/Input.tsx +541 -0
- package/src/components/form/Input/Input.types.ts +285 -0
- package/src/components/form/Input/index.tsx +26 -0
- package/src/components/form/InputNumber/InputNumber.styles.ts +665 -0
- package/src/components/form/InputNumber/InputNumber.tsx +370 -0
- package/src/components/form/InputNumber/InputNumber.types.ts +318 -0
- package/src/components/form/InputNumber/components/InputNumberClearButton.tsx +32 -0
- package/src/components/form/InputNumber/components/InputNumberControls.tsx +42 -0
- package/src/components/form/InputNumber/components/index.ts +2 -0
- package/src/components/form/InputNumber/hooks/index.ts +4 -0
- package/src/components/form/InputNumber/hooks/useInputNumberState.ts +315 -0
- package/src/components/form/InputNumber/hooks/useInputNumberValidation.ts +147 -0
- package/src/components/form/InputNumber/index.ts +25 -0
- package/src/components/form/Radio/Radio.styles.ts +458 -0
- package/src/components/form/Radio/Radio.test.tsx +547 -0
- package/src/components/form/Radio/Radio.tsx +283 -0
- package/src/components/form/Radio/Radio.types.ts +410 -0
- package/src/components/form/Radio/index.tsx +21 -0
- package/src/components/form/Select/Select.styles.ts +514 -0
- package/src/components/form/Select/Select.test.tsx +648 -0
- package/src/components/form/Select/Select.tsx +474 -0
- package/src/components/form/Select/Select.types.ts +428 -0
- package/src/components/form/Select/index.tsx +30 -0
- package/src/components/form/Slider/Slider.styles.ts +139 -0
- package/src/components/form/Slider/Slider.test.tsx +553 -0
- package/src/components/form/Slider/Slider.tsx +326 -0
- package/src/components/form/Slider/Slider.types.ts +108 -0
- package/src/components/form/Slider/index.tsx +10 -0
- package/src/components/form/Switch/Switch.styles.ts +540 -0
- package/src/components/form/Switch/Switch.test.tsx +345 -0
- package/src/components/form/Switch/Switch.tsx +464 -0
- package/src/components/form/Switch/Switch.types.ts +386 -0
- package/src/components/form/Switch/index.tsx +26 -0
- package/src/components/form/Textarea/Textarea.styles.ts +592 -0
- package/src/components/form/Textarea/Textarea.test.tsx +1075 -0
- package/src/components/form/Textarea/Textarea.tsx +602 -0
- package/src/components/form/Textarea/Textarea.types.ts +371 -0
- package/src/components/form/Textarea/index.tsx +26 -0
- package/src/components/form/TimePicker/TimePicker.styles.ts +438 -0
- package/src/components/form/TimePicker/TimePicker.test.tsx +306 -0
- package/src/components/form/TimePicker/TimePicker.tsx +228 -0
- package/src/components/form/TimePicker/TimePicker.types.ts +385 -0
- package/src/components/form/TimePicker/index.ts +21 -0
- package/src/components/form/Transfer/Transfer.styles.ts +502 -0
- package/src/components/form/Transfer/Transfer.test.tsx +316 -0
- package/src/components/form/Transfer/Transfer.tsx +402 -0
- package/src/components/form/Transfer/Transfer.types.ts +557 -0
- package/src/components/form/Transfer/components/TransferItem.tsx +101 -0
- package/src/components/form/Transfer/components/TransferList.tsx +285 -0
- package/src/components/form/Transfer/components/TransferOperations.tsx +84 -0
- package/src/components/form/Transfer/components/TransferPagination.tsx +135 -0
- package/src/components/form/Transfer/components/TransferSearch.tsx +88 -0
- package/src/components/form/Transfer/components/index.ts +6 -0
- package/src/components/form/Transfer/hooks/index.ts +3 -0
- package/src/components/form/Transfer/hooks/useTransferData.ts +192 -0
- package/src/components/form/Transfer/hooks/useTransferState.ts +114 -0
- package/src/components/form/Transfer/index.ts +33 -0
- package/src/components/form/Upload/Upload.styles.ts +145 -0
- package/src/components/form/Upload/Upload.test.tsx +10 -0
- package/src/components/form/Upload/Upload.tsx +451 -0
- package/src/components/form/Upload/Upload.types.ts +200 -0
- package/src/components/form/Upload/index.tsx +12 -0
- package/src/components/form/index.tsx +121 -0
- package/src/components/index.tsx +146 -0
- package/src/components/layout/Affix/Affix.styles.ts +37 -0
- package/src/components/layout/Affix/Affix.test.tsx +10 -0
- package/src/components/layout/Affix/Affix.tsx +91 -0
- package/src/components/layout/Affix/Affix.types.ts +29 -0
- package/src/components/layout/Affix/index.tsx +3 -0
- package/src/components/layout/Col/Col.styles.ts +185 -0
- package/src/components/layout/Col/Col.test.tsx +535 -0
- package/src/components/layout/Col/Col.tsx +115 -0
- package/src/components/layout/Col/Col.types.ts +59 -0
- package/src/components/layout/Col/index.tsx +3 -0
- package/src/components/layout/Container/Container.styles.ts +161 -0
- package/src/components/layout/Container/Container.test.tsx +380 -0
- package/src/components/layout/Container/Container.tsx +132 -0
- package/src/components/layout/Container/Container.types.ts +63 -0
- package/src/components/layout/Container/index.tsx +3 -0
- package/src/components/layout/Grid/Grid.styles.ts +183 -0
- package/src/components/layout/Grid/Grid.test.tsx +637 -0
- package/src/components/layout/Grid/Grid.tsx +173 -0
- package/src/components/layout/Grid/Grid.types.ts +78 -0
- package/src/components/layout/Grid/index.tsx +3 -0
- package/src/components/layout/Layout/Content.tsx +38 -0
- package/src/components/layout/Layout/Footer.tsx +38 -0
- package/src/components/layout/Layout/Header.tsx +38 -0
- package/src/components/layout/Layout/Layout.styles.ts +84 -0
- package/src/components/layout/Layout/Layout.test.tsx +10 -0
- package/src/components/layout/Layout/Layout.tsx +39 -0
- package/src/components/layout/Layout/Layout.types.ts +58 -0
- package/src/components/layout/Layout/Sider.tsx +56 -0
- package/src/components/layout/Layout/index.tsx +8 -0
- package/src/components/layout/Row/Row.styles.ts +159 -0
- package/src/components/layout/Row/Row.test.tsx +467 -0
- package/src/components/layout/Row/Row.tsx +139 -0
- package/src/components/layout/Row/Row.types.ts +60 -0
- package/src/components/layout/Row/index.tsx +3 -0
- package/src/components/layout/Space/Space.styles.ts +255 -0
- package/src/components/layout/Space/Space.test.tsx +682 -0
- package/src/components/layout/Space/Space.tsx +211 -0
- package/src/components/layout/Space/Space.types.ts +92 -0
- package/src/components/layout/Space/index.tsx +12 -0
- package/src/components/layout/index.tsx +68 -0
- package/src/components/navigation/Menu/Menu.styles.ts +779 -0
- package/src/components/navigation/Menu/Menu.tsx +355 -0
- package/src/components/navigation/Menu/Menu.types.ts +231 -0
- package/src/components/navigation/Menu/Menu.utils.ts +187 -0
- package/src/components/navigation/Menu/MenuItem.tsx +126 -0
- package/src/components/navigation/Menu/SubMenu.tsx +148 -0
- package/src/components/navigation/Menu/__tests__/Menu.test.tsx +687 -0
- package/src/components/navigation/Menu/index.tsx +124 -0
- package/src/components/navigation/NavBar/NavBar.styles.ts +129 -0
- package/src/components/navigation/NavBar/NavBar.test.tsx +287 -0
- package/src/components/navigation/NavBar/NavBar.tsx +231 -0
- package/src/components/navigation/NavBar/NavBar.types.ts +54 -0
- package/src/components/navigation/NavBar/index.tsx +3 -0
- package/src/components/navigation/Pagination/Pagination.styles.ts +187 -0
- package/src/components/navigation/Pagination/Pagination.test.tsx +673 -0
- package/src/components/navigation/Pagination/Pagination.tsx +395 -0
- package/src/components/navigation/Pagination/Pagination.types.ts +86 -0
- package/src/components/navigation/Pagination/index.ts +18 -0
- package/src/components/navigation/Pagination/index.tsx +9 -0
- package/src/components/navigation/Steps/Step.tsx +56 -0
- package/src/components/navigation/Steps/Steps.styles.ts +154 -0
- package/src/components/navigation/Steps/Steps.test.tsx +12 -0
- package/src/components/navigation/Steps/Steps.tsx +113 -0
- package/src/components/navigation/Steps/Steps.types.ts +47 -0
- package/src/components/navigation/Steps/index.tsx +3 -0
- package/src/components/navigation/Tabs/Tabs.styles.ts +199 -0
- package/src/components/navigation/Tabs/Tabs.test.tsx +661 -0
- package/src/components/navigation/Tabs/Tabs.tsx +253 -0
- package/src/components/navigation/Tabs/Tabs.types.ts +114 -0
- package/src/components/navigation/Tabs/index.tsx +3 -0
- package/src/components/navigation/Tree/Tree.styles.ts +553 -0
- package/src/components/navigation/Tree/Tree.test.basic.tsx +7 -0
- package/src/components/navigation/Tree/Tree.test.functional.tsx +496 -0
- package/src/components/navigation/Tree/Tree.test.import.check.tsx +6 -0
- package/src/components/navigation/Tree/Tree.test.import.tsx +6 -0
- package/src/components/navigation/Tree/Tree.test.minimal.tsx +5 -0
- package/src/components/navigation/Tree/Tree.test.simple.tsx +30 -0
- package/src/components/navigation/Tree/Tree.test.tsx +908 -0
- package/src/components/navigation/Tree/Tree.test.working.tsx +673 -0
- package/src/components/navigation/Tree/Tree.tsx +600 -0
- package/src/components/navigation/Tree/Tree.types.ts +909 -0
- package/src/components/navigation/Tree/Tree.utils.ts +452 -0
- package/src/components/navigation/Tree/index.ts +33 -0
- package/src/components/navigation/Tree/index.tsx +23 -0
- package/src/components/navigation/index.tsx +83 -0
- package/src/constants/index.ts +785 -0
- package/src/hooks/index.ts +110 -0
- package/src/hooks/types.ts +10 -0
- package/src/hooks/useAsync.ts +65 -0
- package/src/hooks/useEventHandling.ts +444 -0
- package/src/hooks/useLifecycle.ts +399 -0
- package/src/hooks/usePerformance.ts +441 -0
- package/src/hooks/usePerformanceMonitor.ts +348 -0
- package/src/hooks/usePlatform.ts +62 -0
- package/src/hooks/useRequest.test.ts +11 -0
- package/src/hooks/useRequest.ts +135 -0
- package/src/hooks/useStateManagement.ts +300 -0
- package/src/hooks/useStyle.ts +537 -0
- package/src/hooks/useTheme.ts +347 -0
- package/src/hooks/useVirtualScroll.ts +331 -0
- package/src/index.ts +298 -0
- package/src/platform/index.ts +1188 -0
- package/src/providers/AppProvider.test.tsx +63 -0
- package/src/providers/AppProvider.tsx +155 -0
- package/src/providers/index.ts +1 -0
- package/src/theme/ThemeProvider.tsx +283 -0
- package/src/theme/ThemeProvider.types.ts +26 -0
- package/src/theme/animations.tsx +660 -0
- package/src/theme/defaults.ts +188 -0
- package/src/theme/design-system.ts +562 -0
- package/src/theme/design-tokens.ts +1136 -0
- package/src/theme/generated/dark-theme.scss +120 -0
- package/src/theme/generated/tokens.css +441 -0
- package/src/theme/generated/tokens.scss +320 -0
- package/src/theme/index.ts +120 -0
- package/src/theme/responsive.tsx +193 -0
- package/src/theme/styles/mixins.scss +612 -0
- package/src/theme/styles/variables.scss +295 -0
- package/src/theme/styles.ts +403 -0
- package/src/theme/tokens/colors.ts +256 -0
- package/src/theme/tokens/effects.ts +260 -0
- package/src/theme/tokens/index.ts +217 -0
- package/src/theme/tokens/spacing.ts +137 -0
- package/src/theme/tokens/typography.ts +186 -0
- package/src/theme/types.ts +188 -0
- package/src/theme/useThemeUtils.ts +313 -0
- package/src/theme/utils.ts +501 -0
- package/src/theme/variables.ts +583 -0
- package/src/types/accessibility.ts +51 -0
- package/src/types/button.ts +562 -0
- package/src/types/component-props.ts +317 -0
- package/src/types/env.d.ts +20 -0
- package/src/types/index.ts +427 -0
- package/src/types/modules.d.ts +40 -0
- package/src/types/standardized-components.ts +544 -0
- package/src/types/taro-adapter.d.ts +174 -0
- package/src/types/taro-components.d.ts +73 -0
- package/src/types/utils.ts +410 -0
- package/src/utils/__tests__/inputValidator.test.ts +338 -0
- package/src/utils/__tests__/responsiveUtils.test.ts +310 -0
- package/src/utils/__tests__/xssProtection.test.ts +268 -0
- package/src/utils/cache.ts +83 -0
- package/src/utils/createNamespace.ts +24 -0
- package/src/utils/environment.ts +95 -0
- package/src/utils/error-handler.ts +88 -0
- package/src/utils/errorLogger.ts +197 -0
- package/src/utils/formatUtils.ts +444 -0
- package/src/utils/index.ts +115 -0
- package/src/utils/inputValidator.ts +261 -0
- package/src/utils/network/http-client.test.ts +18 -0
- package/src/utils/network/http-client.ts +151 -0
- package/src/utils/performance/performance.ts +850 -0
- package/src/utils/responsiveUtils.ts +357 -0
- package/src/utils/rtl-support.ts +344 -0
- package/src/utils/security/api-security.ts +386 -0
- package/src/utils/security/xss-protection.ts +69 -0
- package/src/utils/securityHeaders.ts +314 -0
- package/src/utils/typeHelpers.ts +16 -0
- package/src/utils/types/dataProcessing.ts +543 -0
- package/src/utils/types/typeHelpers.ts +187 -0
- package/src/utils/xssProtection.ts +420 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Agions
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Enterprise License
|
|
26
|
+
|
|
27
|
+
For enterprise licensing options, including:
|
|
28
|
+
|
|
29
|
+
- Commercial support and maintenance
|
|
30
|
+
- Custom development and features
|
|
31
|
+
- Priority bug fixes and security patches
|
|
32
|
+
- Dedicated deployment assistance
|
|
33
|
+
- Training and consulting services
|
|
34
|
+
|
|
35
|
+
Please contact us at [enterprise@taro-uno.com](mailto:enterprise@taro-uno.com)
|
|
36
|
+
|
|
37
|
+
## Third-Party Licenses
|
|
38
|
+
|
|
39
|
+
This project includes third-party components with their own licenses:
|
|
40
|
+
|
|
41
|
+
### React and React DOM
|
|
42
|
+
|
|
43
|
+
- License: MIT
|
|
44
|
+
- Source: https://reactjs.org/
|
|
45
|
+
|
|
46
|
+
### Taro Framework
|
|
47
|
+
|
|
48
|
+
- License: MIT
|
|
49
|
+
- Source: https://taro.jd.com/
|
|
50
|
+
|
|
51
|
+
### TypeScript
|
|
52
|
+
|
|
53
|
+
- License: Apache 2.0
|
|
54
|
+
- Source: https://www.typescriptlang.org/
|
|
55
|
+
|
|
56
|
+
### Vite
|
|
57
|
+
|
|
58
|
+
- License: MIT
|
|
59
|
+
- Source: https://vitejs.dev/
|
|
60
|
+
|
|
61
|
+
### Vitest
|
|
62
|
+
|
|
63
|
+
- License: MIT
|
|
64
|
+
- Source: https://vitest.dev/
|
|
65
|
+
|
|
66
|
+
### Storybook
|
|
67
|
+
|
|
68
|
+
- License: MIT
|
|
69
|
+
- Source: https://storybook.js.org/
|
|
70
|
+
|
|
71
|
+
### DOMPurify
|
|
72
|
+
|
|
73
|
+
- License: MPL 2.0
|
|
74
|
+
- Source: https://github.com/cure53/DOMPurify
|
|
75
|
+
|
|
76
|
+
### i18next
|
|
77
|
+
|
|
78
|
+
- License: MIT
|
|
79
|
+
- Source: https://www.i18next.com/
|
|
80
|
+
|
|
81
|
+
### Other Dependencies
|
|
82
|
+
|
|
83
|
+
See `package.json` for a complete list of dependencies and their respective licenses.
|
|
84
|
+
|
|
85
|
+
## Trademarks
|
|
86
|
+
|
|
87
|
+
Taro, React, and other mentioned products are trademarks of their respective owners.
|
|
88
|
+
|
|
89
|
+
## Disclaimer
|
|
90
|
+
|
|
91
|
+
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
92
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
93
|
+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
94
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
95
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
96
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
97
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
98
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
99
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
100
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Taro Uno
|
|
2
|
+
|
|
3
|
+
Taro Uno 是一个基于 Taro 框架的跨平台组件库,提供丰富的 UI 组件和表单控件,支持微信小程序、H5、React Native 等多端开发。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- **跨平台兼容**:支持微信小程序、H5、React Native 等多端环境
|
|
8
|
+
- **丰富组件**:提供完整的 UI 组件和表单控件
|
|
9
|
+
- **TypeScript 支持**:完整的类型定义,提供良好的开发体验
|
|
10
|
+
- **主题定制**:支持自定义主题和样式变量
|
|
11
|
+
- **易于扩展**:组件设计遵循可组合、可扩展原则
|
|
12
|
+
- **完善文档**:详细的使用文档和示例
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# 使用 npm
|
|
18
|
+
npm install taro-uno-ui
|
|
19
|
+
|
|
20
|
+
# 使用 yarn
|
|
21
|
+
yarn add taro-uno-ui
|
|
22
|
+
|
|
23
|
+
# 使用 pnpm
|
|
24
|
+
pnpm add taro-uno-ui
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 快速开始
|
|
28
|
+
|
|
29
|
+
### 引入样式
|
|
30
|
+
|
|
31
|
+
在项目入口文件中引入全局样式:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
// app.tsx 或 app.jsx
|
|
35
|
+
import 'taro-uno-ui/dist/style.css';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 引入组件
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import { View } from '@tarojs/components';
|
|
43
|
+
import { Button, Input } from 'taro-uno-ui';
|
|
44
|
+
|
|
45
|
+
const App = () => {
|
|
46
|
+
return (
|
|
47
|
+
<View>
|
|
48
|
+
<Input placeholder="请输入内容" />
|
|
49
|
+
<Button type="primary">点击我</Button>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default App;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 组件分类
|
|
58
|
+
|
|
59
|
+
### 基础组件 (Basic)
|
|
60
|
+
- Button - 按钮
|
|
61
|
+
- Icon - 图标
|
|
62
|
+
- Typography - 排版
|
|
63
|
+
|
|
64
|
+
### 表单组件 (Form)
|
|
65
|
+
- Input - 输入框
|
|
66
|
+
- Select - 选择器
|
|
67
|
+
- Checkbox - 复选框
|
|
68
|
+
- Radio - 单选框
|
|
69
|
+
- Switch - 开关
|
|
70
|
+
- Slider - 滑块
|
|
71
|
+
- Upload - 上传
|
|
72
|
+
- DatePicker - 日期选择器
|
|
73
|
+
- TimePicker - 时间选择器
|
|
74
|
+
- Cascader - 级联选择器
|
|
75
|
+
- Textarea - 多行文本输入
|
|
76
|
+
|
|
77
|
+
### 布局组件 (Layout)
|
|
78
|
+
- Grid - 网格
|
|
79
|
+
- Space - 间距
|
|
80
|
+
- Divider - 分割线
|
|
81
|
+
- Container - 容器
|
|
82
|
+
|
|
83
|
+
### 显示组件 (Display)
|
|
84
|
+
- Card - 卡片
|
|
85
|
+
- Table - 表格
|
|
86
|
+
- List - 列表
|
|
87
|
+
- Badge - 徽标
|
|
88
|
+
- Avatar - 头像
|
|
89
|
+
|
|
90
|
+
### 反馈组件 (Feedback)
|
|
91
|
+
- Modal - 对话框
|
|
92
|
+
- Message - 消息提示
|
|
93
|
+
- Notification - 通知提醒
|
|
94
|
+
- Toast - 轻提示
|
|
95
|
+
- Loading - 加载
|
|
96
|
+
|
|
97
|
+
### 导航组件 (Navigation)
|
|
98
|
+
- Tabs - 标签页
|
|
99
|
+
- Pagination - 分页
|
|
100
|
+
- Steps - 步骤条
|
|
101
|
+
|
|
102
|
+
## 文档
|
|
103
|
+
|
|
104
|
+
### 组件文档
|
|
105
|
+
|
|
106
|
+
每个组件都配有详细的中文文档,包含:
|
|
107
|
+
- 功能介绍
|
|
108
|
+
- 基本用法
|
|
109
|
+
- API 参数说明
|
|
110
|
+
- 事件说明
|
|
111
|
+
- 使用示例
|
|
112
|
+
|
|
113
|
+
### 文档结构
|
|
114
|
+
|
|
115
|
+
组件文档位于 `docs/components/` 目录下,按组件类型分类:
|
|
116
|
+
|
|
117
|
+
- `docs/components/basic/` - 基础组件文档
|
|
118
|
+
- `docs/components/form/` - 表单组件文档
|
|
119
|
+
- `docs/components/layout/` - 布局组件文档
|
|
120
|
+
- `docs/components/display/` - 显示组件文档
|
|
121
|
+
- `docs/components/feedback/` - 反馈组件文档
|
|
122
|
+
- `docs/components/navigation/` - 导航组件文档
|
|
123
|
+
|
|
124
|
+
### 示例代码
|
|
125
|
+
|
|
126
|
+
每个组件的文档目录中包含 `examples` 文件夹,提供可运行的示例代码,方便开发者快速了解组件的使用方法。
|
|
127
|
+
|
|
128
|
+
### 文档生成
|
|
129
|
+
|
|
130
|
+
我们提供了自动化的文档生成工具:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# 生成所有文档
|
|
134
|
+
node scripts/generate-docs.js all
|
|
135
|
+
|
|
136
|
+
# 生成组件文档
|
|
137
|
+
node scripts/generate-docs.js components
|
|
138
|
+
|
|
139
|
+
# 生成 API 文档
|
|
140
|
+
node scripts/generate-docs.js api
|
|
141
|
+
|
|
142
|
+
# 生成类型文档
|
|
143
|
+
node scripts/generate-docs.js types
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 文档验证
|
|
147
|
+
|
|
148
|
+
使用文档验证工具确保文档质量:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# 验证文档
|
|
152
|
+
node scripts/validate-docs.js
|
|
153
|
+
|
|
154
|
+
# 更新文档
|
|
155
|
+
node scripts/update-docs.js --commit
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 文档部署
|
|
159
|
+
|
|
160
|
+
文档自动化部署到 GitHub Pages:
|
|
161
|
+
- 每次代码提交自动构建和部署
|
|
162
|
+
- 支持多环境部署
|
|
163
|
+
- 自动生成文档统计和报告
|
|
164
|
+
|
|
165
|
+
### API 文档
|
|
166
|
+
|
|
167
|
+
项目使用 TypeDoc 自动生成 API 文档:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# 生成 API 文档
|
|
171
|
+
npm run docs:generate
|
|
172
|
+
|
|
173
|
+
# 监听模式(文件变化自动重新生成)
|
|
174
|
+
npm run docs:watch
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
生成的文档位于 `docs/api/` 目录,包含:
|
|
178
|
+
- 完整的类型定义
|
|
179
|
+
- 组件 Props 接口
|
|
180
|
+
- 工具函数文档
|
|
181
|
+
- 类型别名和枚举
|
|
182
|
+
|
|
183
|
+
### 本地开发
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# 启动文档开发服务器
|
|
187
|
+
cd docs
|
|
188
|
+
pnpm install
|
|
189
|
+
pnpm dev
|
|
190
|
+
|
|
191
|
+
# 构建文档
|
|
192
|
+
pnpm build
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## 开发指南
|
|
196
|
+
|
|
197
|
+
### 开发环境设置
|
|
198
|
+
|
|
199
|
+
1. 克隆仓库
|
|
200
|
+
```bash
|
|
201
|
+
git clone https://github.com/agions/taro-uno.git
|
|
202
|
+
cd taro-uno
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
2. 安装依赖
|
|
206
|
+
```bash
|
|
207
|
+
pnpm install
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
3. 启动开发服务器
|
|
211
|
+
```bash
|
|
212
|
+
# H5
|
|
213
|
+
pnpm dev:h5
|
|
214
|
+
|
|
215
|
+
# 微信小程序
|
|
216
|
+
pnpm dev:weapp
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 构建
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# 构建 H5
|
|
223
|
+
pnpm build:h5
|
|
224
|
+
|
|
225
|
+
# 构建微信小程序
|
|
226
|
+
pnpm build:weapp
|
|
227
|
+
|
|
228
|
+
# 构建所有平台
|
|
229
|
+
pnpm build:all
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 测试
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# 运行单元测试
|
|
236
|
+
pnpm test
|
|
237
|
+
|
|
238
|
+
# 运行 ESLint 检查
|
|
239
|
+
pnpm lint
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## 🤝 贡献指南
|
|
243
|
+
|
|
244
|
+
我们欢迎所有形式的贡献!请阅读 [贡献指南](./CONTRIBUTING.md) 了解详情。
|
|
245
|
+
|
|
246
|
+
### 开发流程
|
|
247
|
+
|
|
248
|
+
1. Fork 本仓库
|
|
249
|
+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
|
250
|
+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
|
251
|
+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
|
252
|
+
5. 创建 Pull Request
|
|
253
|
+
|
|
254
|
+
### 代码规范
|
|
255
|
+
|
|
256
|
+
- 使用 TypeScript 编写代码
|
|
257
|
+
- 遵循 ESLint 和 Prettier 规范
|
|
258
|
+
- 编写完整的单元测试
|
|
259
|
+
- 添加详细的 JSDoc 注释
|
|
260
|
+
- 遵循 Git 提交规范
|
|
261
|
+
|
|
262
|
+
## 许可证
|
|
263
|
+
|
|
264
|
+
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情
|
|
265
|
+
|
|
266
|
+
## 更新日志
|
|
267
|
+
|
|
268
|
+
详细的更新日志请查看 [CHANGELOG.md](CHANGELOG.md)
|
|
269
|
+
|
|
270
|
+
## 联系我们
|
|
271
|
+
|
|
272
|
+
- GitHub: https://github.com/agions/taro-uno
|
|
273
|
+
- Issues: https://github.com/agions/taro-uno/issues
|