taro-uno-ui 1.0.1 → 1.0.2
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/README.md +67 -30
- package/dist/js/{index-CDFsvu80.js → index-QpKiGsEQ.js} +39026 -28023
- package/dist/js/index-QpKiGsEQ.js.map +1 -0
- package/dist/js/{index-JffnTUrv.js → index-nnTHNhwl.js} +38743 -27720
- package/dist/js/index-nnTHNhwl.js.map +1 -0
- package/package.json +4 -4
- package/dist/js/index-CDFsvu80.js.map +0 -1
- package/dist/js/index-DFdcksbe.js +0 -1165
- package/dist/js/index-DFdcksbe.js.map +0 -1
- package/dist/js/index-DXRIkWX1.js +0 -1148
- package/dist/js/index-DXRIkWX1.js.map +0 -1
- package/dist/js/index-JffnTUrv.js.map +0 -1
- package/dist/utils/http/request.d.ts +0 -280
- package/src/app.config.ts +0 -55
- package/src/app.scss +0 -508
- package/src/app.tsx +0 -44
- package/src/components/basic/Button/Button.styles.ts +0 -130
- package/src/components/basic/Button/Button.test.tsx +0 -154
- package/src/components/basic/Button/Button.tsx +0 -133
- package/src/components/basic/Button/Button.types.ts +0 -81
- package/src/components/basic/Button/index.tsx +0 -6
- package/src/components/basic/Divider/Divider.styles.ts +0 -488
- package/src/components/basic/Divider/Divider.test.tsx +0 -551
- package/src/components/basic/Divider/Divider.tsx +0 -392
- package/src/components/basic/Divider/Divider.types.ts +0 -261
- package/src/components/basic/Divider/index.tsx +0 -25
- package/src/components/basic/Icon/Icon.data.ts +0 -474
- package/src/components/basic/Icon/Icon.styles.ts +0 -359
- package/src/components/basic/Icon/Icon.test.tsx +0 -357
- package/src/components/basic/Icon/Icon.tsx +0 -167
- package/src/components/basic/Icon/Icon.types.ts +0 -210
- package/src/components/basic/Icon/IconManager.ts +0 -229
- package/src/components/basic/Icon/index.tsx +0 -22
- package/src/components/basic/Text/Text.styles.ts +0 -500
- package/src/components/basic/Text/Text.test.tsx +0 -299
- package/src/components/basic/Text/Text.tsx +0 -340
- package/src/components/basic/Text/Text.types.ts +0 -329
- package/src/components/basic/Text/index.tsx +0 -27
- package/src/components/basic/Typography/Typography.styles.ts +0 -347
- package/src/components/basic/Typography/Typography.tsx +0 -207
- package/src/components/basic/Typography/Typography.types.ts +0 -296
- package/src/components/basic/Typography/index.tsx +0 -14
- package/src/components/basic/Video/Video.styles.ts +0 -777
- package/src/components/basic/Video/Video.test.tsx +0 -490
- package/src/components/basic/Video/Video.tsx +0 -1468
- package/src/components/basic/Video/Video.types.ts +0 -500
- package/src/components/basic/Video/index.tsx +0 -26
- package/src/components/basic/index.tsx +0 -300
- package/src/components/common/ErrorBoundary.tsx +0 -87
- package/src/components/common/LazyComponent.tsx +0 -247
- package/src/components/common/ResponsiveContainer.tsx +0 -93
- package/src/components/common/ResponsiveGrid.tsx +0 -183
- package/src/components/common/SecurityProvider.tsx +0 -98
- package/src/components/common/ThemeProvider.tsx +0 -115
- package/src/components/common/VirtualList.tsx +0 -350
- package/src/components/common/__tests__/ErrorBoundary.test.tsx +0 -249
- package/src/components/common/index.tsx +0 -32
- package/src/components/display/Avatar/Avatar.styles.ts +0 -62
- package/src/components/display/Avatar/Avatar.test.tsx +0 -390
- package/src/components/display/Avatar/Avatar.tsx +0 -66
- package/src/components/display/Avatar/Avatar.types.ts +0 -40
- package/src/components/display/Avatar/index.ts +0 -3
- package/src/components/display/Badge/Badge.tsx +0 -29
- package/src/components/display/Badge/Badge.types.ts +0 -29
- package/src/components/display/Badge/index.ts +0 -2
- package/src/components/display/Calendar/Calendar.styles.ts +0 -255
- package/src/components/display/Calendar/Calendar.test.tsx +0 -42
- package/src/components/display/Calendar/Calendar.tsx +0 -358
- package/src/components/display/Calendar/Calendar.types.ts +0 -91
- package/src/components/display/Calendar/index.ts +0 -3
- package/src/components/display/Card/Card.styles.ts +0 -89
- package/src/components/display/Card/Card.test.tsx +0 -182
- package/src/components/display/Card/Card.tsx +0 -135
- package/src/components/display/Card/Card.types.ts +0 -55
- package/src/components/display/Card/index.ts +0 -3
- package/src/components/display/Carousel/Carousel.styles.ts +0 -206
- package/src/components/display/Carousel/Carousel.tsx +0 -290
- package/src/components/display/Carousel/Carousel.types.ts +0 -57
- package/src/components/display/Carousel/index.ts +0 -3
- package/src/components/display/List/List.styles.ts +0 -79
- package/src/components/display/List/List.tsx +0 -114
- package/src/components/display/List/List.types.ts +0 -68
- package/src/components/display/List/index.ts +0 -3
- package/src/components/display/Rate/Rate.styles.ts +0 -254
- package/src/components/display/Rate/Rate.tsx +0 -324
- package/src/components/display/Rate/Rate.types.ts +0 -112
- package/src/components/display/Rate/index.ts +0 -20
- package/src/components/display/Table/Table.styles.ts +0 -269
- package/src/components/display/Table/Table.test.tsx +0 -345
- package/src/components/display/Table/Table.tsx +0 -426
- package/src/components/display/Table/Table.types.ts +0 -256
- package/src/components/display/Table/index.tsx +0 -16
- package/src/components/display/Tag/Tag.styles.ts +0 -197
- package/src/components/display/Tag/Tag.test.tsx +0 -541
- package/src/components/display/Tag/Tag.tsx +0 -139
- package/src/components/display/Tag/Tag.types.ts +0 -49
- package/src/components/display/Tag/index.ts +0 -3
- package/src/components/display/Timeline/Timeline.styles.ts +0 -211
- package/src/components/display/Timeline/Timeline.tsx +0 -220
- package/src/components/display/Timeline/Timeline.types.ts +0 -56
- package/src/components/display/Timeline/index.ts +0 -3
- package/src/components/display/index.tsx +0 -147
- package/src/components/feedback/Loading/Loading.styles.ts +0 -117
- package/src/components/feedback/Loading/Loading.test.tsx +0 -534
- package/src/components/feedback/Loading/Loading.tsx +0 -132
- package/src/components/feedback/Loading/Loading.types.ts +0 -33
- package/src/components/feedback/Loading/index.ts +0 -6
- package/src/components/feedback/Message/Message.styles.ts +0 -41
- package/src/components/feedback/Message/Message.test.tsx +0 -234
- package/src/components/feedback/Message/Message.tsx +0 -96
- package/src/components/feedback/Message/Message.types.ts +0 -37
- package/src/components/feedback/Message/index.ts +0 -6
- package/src/components/feedback/Modal/Modal.styles.ts +0 -21
- package/src/components/feedback/Modal/Modal.test.tsx +0 -11
- package/src/components/feedback/Modal/Modal.tsx +0 -269
- package/src/components/feedback/Modal/Modal.types.ts +0 -151
- package/src/components/feedback/Modal/index.tsx +0 -11
- package/src/components/feedback/Notification/Notification.styles.ts +0 -453
- package/src/components/feedback/Notification/Notification.test.tsx +0 -401
- package/src/components/feedback/Notification/Notification.tsx +0 -347
- package/src/components/feedback/Notification/Notification.types.ts +0 -339
- package/src/components/feedback/Notification/NotificationManager.tsx +0 -405
- package/src/components/feedback/Notification/index.ts +0 -40
- package/src/components/feedback/Notification/index.tsx +0 -154
- package/src/components/feedback/Progress/Progress.styles.ts +0 -469
- package/src/components/feedback/Progress/Progress.test.simple.tsx +0 -14
- package/src/components/feedback/Progress/Progress.test.tsx +0 -312
- package/src/components/feedback/Progress/Progress.tsx +0 -488
- package/src/components/feedback/Progress/Progress.types.ts +0 -163
- package/src/components/feedback/Progress/index.ts +0 -3
- package/src/components/feedback/Progress/index.tsx +0 -38
- package/src/components/feedback/Progress/utils/animation.ts +0 -193
- package/src/components/feedback/Progress/utils/index.ts +0 -26
- package/src/components/feedback/Progress/utils/progress-calculator.ts +0 -199
- package/src/components/feedback/Result/Result.styles.ts +0 -139
- package/src/components/feedback/Result/Result.tsx +0 -221
- package/src/components/feedback/Result/Result.types.ts +0 -128
- package/src/components/feedback/Result/index.tsx +0 -3
- package/src/components/feedback/Toast/Toast.styles.ts +0 -17
- package/src/components/feedback/Toast/Toast.test.tsx +0 -10
- package/src/components/feedback/Toast/Toast.tsx +0 -384
- package/src/components/feedback/Toast/Toast.types.ts +0 -86
- package/src/components/feedback/Toast/index.tsx +0 -3
- package/src/components/feedback/Tooltip/Tooltip.examples.tsx +0 -435
- package/src/components/feedback/Tooltip/Tooltip.styles.ts +0 -340
- package/src/components/feedback/Tooltip/Tooltip.test.tsx +0 -446
- package/src/components/feedback/Tooltip/Tooltip.tsx +0 -302
- package/src/components/feedback/Tooltip/Tooltip.types.ts +0 -166
- package/src/components/feedback/Tooltip/index.ts +0 -3
- package/src/components/feedback/Tooltip/index.tsx +0 -246
- package/src/components/feedback/index.tsx +0 -176
- package/src/components/form/Cascader/Cascader.styles.ts +0 -526
- package/src/components/form/Cascader/Cascader.test.tsx +0 -77
- package/src/components/form/Cascader/Cascader.tsx +0 -581
- package/src/components/form/Cascader/Cascader.types.ts +0 -581
- package/src/components/form/Cascader/hooks/index.ts +0 -3
- package/src/components/form/Cascader/hooks/useCascaderFieldNames.ts +0 -19
- package/src/components/form/Cascader/hooks/useCascaderOptions.ts +0 -127
- package/src/components/form/Cascader/hooks/useCascaderState.ts +0 -139
- package/src/components/form/Cascader/index.ts +0 -25
- package/src/components/form/Cascader/utils/formatDisplayValue.ts +0 -19
- package/src/components/form/Cascader/utils/index.ts +0 -1
- package/src/components/form/Checkbox/Checkbox.styles.ts +0 -607
- package/src/components/form/Checkbox/Checkbox.test.tsx +0 -1140
- package/src/components/form/Checkbox/Checkbox.tsx +0 -489
- package/src/components/form/Checkbox/Checkbox.types.ts +0 -472
- package/src/components/form/Checkbox/CheckboxGroup.tsx +0 -444
- package/src/components/form/Checkbox/index.tsx +0 -27
- package/src/components/form/DatePicker/DatePicker.styles.ts +0 -393
- package/src/components/form/DatePicker/DatePicker.test.tsx +0 -407
- package/src/components/form/DatePicker/DatePicker.tsx +0 -376
- package/src/components/form/DatePicker/DatePicker.types.ts +0 -250
- package/src/components/form/DatePicker/index.tsx +0 -15
- package/src/components/form/Form/Form.styles.ts +0 -357
- package/src/components/form/Form/Form.test.tsx +0 -122
- package/src/components/form/Form/Form.tsx +0 -257
- package/src/components/form/Form/Form.types.ts +0 -422
- package/src/components/form/Form/index.tsx +0 -31
- package/src/components/form/Form/useFormLogic.ts +0 -497
- package/src/components/form/Input/Input.styles.ts +0 -445
- package/src/components/form/Input/Input.test.tsx +0 -494
- package/src/components/form/Input/Input.tsx +0 -305
- package/src/components/form/Input/Input.types.ts +0 -297
- package/src/components/form/Input/index.tsx +0 -26
- package/src/components/form/Input/useInputLogic.test.ts +0 -82
- package/src/components/form/Input/useInputLogic.ts +0 -260
- package/src/components/form/InputNumber/InputNumber.styles.ts +0 -716
- package/src/components/form/InputNumber/InputNumber.tsx +0 -402
- package/src/components/form/InputNumber/InputNumber.types.ts +0 -336
- package/src/components/form/InputNumber/components/InputNumberClearButton.tsx +0 -24
- package/src/components/form/InputNumber/components/InputNumberControls.tsx +0 -33
- package/src/components/form/InputNumber/components/index.ts +0 -2
- package/src/components/form/InputNumber/hooks/index.ts +0 -4
- package/src/components/form/InputNumber/hooks/useInputNumberState.ts +0 -313
- package/src/components/form/InputNumber/hooks/useInputNumberValidation.ts +0 -148
- package/src/components/form/InputNumber/index.ts +0 -25
- package/src/components/form/Radio/Radio.styles.ts +0 -451
- package/src/components/form/Radio/Radio.test.tsx +0 -547
- package/src/components/form/Radio/Radio.tsx +0 -277
- package/src/components/form/Radio/Radio.types.ts +0 -414
- package/src/components/form/Radio/index.tsx +0 -21
- package/src/components/form/Select/Select.styles.ts +0 -518
- package/src/components/form/Select/Select.test.tsx +0 -648
- package/src/components/form/Select/Select.tsx +0 -474
- package/src/components/form/Select/Select.types.ts +0 -429
- package/src/components/form/Select/index.tsx +0 -30
- package/src/components/form/Slider/Slider.styles.ts +0 -139
- package/src/components/form/Slider/Slider.test.tsx +0 -553
- package/src/components/form/Slider/Slider.tsx +0 -312
- package/src/components/form/Slider/Slider.types.ts +0 -110
- package/src/components/form/Slider/index.tsx +0 -3
- package/src/components/form/Switch/Switch.styles.ts +0 -534
- package/src/components/form/Switch/Switch.test.tsx +0 -345
- package/src/components/form/Switch/Switch.tsx +0 -458
- package/src/components/form/Switch/Switch.types.ts +0 -386
- package/src/components/form/Switch/index.tsx +0 -26
- package/src/components/form/Textarea/Textarea.styles.ts +0 -592
- package/src/components/form/Textarea/Textarea.test.tsx +0 -1075
- package/src/components/form/Textarea/Textarea.tsx +0 -608
- package/src/components/form/Textarea/Textarea.types.ts +0 -374
- package/src/components/form/Textarea/index.tsx +0 -26
- package/src/components/form/TimePicker/TimePicker.styles.ts +0 -434
- package/src/components/form/TimePicker/TimePicker.test.tsx +0 -306
- package/src/components/form/TimePicker/TimePicker.tsx +0 -250
- package/src/components/form/TimePicker/TimePicker.types.ts +0 -385
- package/src/components/form/TimePicker/index.ts +0 -21
- package/src/components/form/Transfer/Transfer.styles.ts +0 -490
- package/src/components/form/Transfer/Transfer.test.tsx +0 -316
- package/src/components/form/Transfer/Transfer.tsx +0 -414
- package/src/components/form/Transfer/Transfer.types.ts +0 -565
- package/src/components/form/Transfer/components/TransferItem.tsx +0 -94
- package/src/components/form/Transfer/components/TransferList.tsx +0 -298
- package/src/components/form/Transfer/components/TransferOperations.tsx +0 -81
- package/src/components/form/Transfer/components/TransferPagination.tsx +0 -139
- package/src/components/form/Transfer/components/TransferSearch.tsx +0 -85
- package/src/components/form/Transfer/components/index.ts +0 -6
- package/src/components/form/Transfer/hooks/index.ts +0 -3
- package/src/components/form/Transfer/hooks/useTransferData.ts +0 -202
- package/src/components/form/Transfer/hooks/useTransferState.ts +0 -120
- package/src/components/form/Transfer/index.ts +0 -27
- package/src/components/form/Upload/Upload.styles.ts +0 -145
- package/src/components/form/Upload/Upload.test.tsx +0 -10
- package/src/components/form/Upload/Upload.tsx +0 -498
- package/src/components/form/Upload/Upload.types.ts +0 -200
- package/src/components/form/Upload/index.tsx +0 -12
- package/src/components/form/index.tsx +0 -152
- package/src/components/index.tsx +0 -145
- package/src/components/layout/Affix/Affix.styles.ts +0 -42
- package/src/components/layout/Affix/Affix.test.tsx +0 -10
- package/src/components/layout/Affix/Affix.tsx +0 -83
- package/src/components/layout/Affix/Affix.types.ts +0 -29
- package/src/components/layout/Affix/index.tsx +0 -3
- package/src/components/layout/Col/Col.styles.ts +0 -185
- package/src/components/layout/Col/Col.test.tsx +0 -537
- package/src/components/layout/Col/Col.tsx +0 -97
- package/src/components/layout/Col/Col.types.ts +0 -59
- package/src/components/layout/Col/index.tsx +0 -3
- package/src/components/layout/Container/Container.styles.ts +0 -163
- package/src/components/layout/Container/Container.test.tsx +0 -380
- package/src/components/layout/Container/Container.tsx +0 -123
- package/src/components/layout/Container/Container.types.ts +0 -63
- package/src/components/layout/Container/index.tsx +0 -3
- package/src/components/layout/Grid/Grid.styles.ts +0 -183
- package/src/components/layout/Grid/Grid.test.tsx +0 -637
- package/src/components/layout/Grid/Grid.tsx +0 -123
- package/src/components/layout/Grid/Grid.types.ts +0 -78
- package/src/components/layout/Grid/index.tsx +0 -3
- package/src/components/layout/Layout/Content.tsx +0 -30
- package/src/components/layout/Layout/Footer.tsx +0 -30
- package/src/components/layout/Layout/Header.tsx +0 -30
- package/src/components/layout/Layout/Layout.styles.ts +0 -84
- package/src/components/layout/Layout/Layout.test.tsx +0 -10
- package/src/components/layout/Layout/Layout.tsx +0 -28
- package/src/components/layout/Layout/Layout.types.ts +0 -58
- package/src/components/layout/Layout/Sider.tsx +0 -44
- package/src/components/layout/Layout/index.tsx +0 -22
- package/src/components/layout/Row/Row.styles.ts +0 -159
- package/src/components/layout/Row/Row.test.tsx +0 -467
- package/src/components/layout/Row/Row.tsx +0 -111
- package/src/components/layout/Row/Row.types.ts +0 -60
- package/src/components/layout/Row/index.tsx +0 -3
- package/src/components/layout/Space/Space.styles.ts +0 -255
- package/src/components/layout/Space/Space.test.tsx +0 -682
- package/src/components/layout/Space/Space.tsx +0 -203
- package/src/components/layout/Space/Space.types.ts +0 -92
- package/src/components/layout/Space/index.tsx +0 -12
- package/src/components/layout/index.tsx +0 -78
- package/src/components/navigation/Menu/Menu.constants.ts +0 -69
- package/src/components/navigation/Menu/Menu.stories.tsx +0 -107
- package/src/components/navigation/Menu/Menu.styles.ts +0 -767
- package/src/components/navigation/Menu/Menu.tsx +0 -352
- package/src/components/navigation/Menu/Menu.types.ts +0 -231
- package/src/components/navigation/Menu/Menu.utils.ts +0 -187
- package/src/components/navigation/Menu/MenuItem.tsx +0 -124
- package/src/components/navigation/Menu/SubMenu.tsx +0 -150
- package/src/components/navigation/Menu/index.tsx +0 -59
- package/src/components/navigation/NavBar/NavBar.styles.ts +0 -129
- package/src/components/navigation/NavBar/NavBar.test.tsx +0 -287
- package/src/components/navigation/NavBar/NavBar.tsx +0 -228
- package/src/components/navigation/NavBar/NavBar.types.ts +0 -54
- package/src/components/navigation/NavBar/index.tsx +0 -3
- package/src/components/navigation/Pagination/Pagination.styles.ts +0 -187
- package/src/components/navigation/Pagination/Pagination.test.tsx +0 -672
- package/src/components/navigation/Pagination/Pagination.tsx +0 -395
- package/src/components/navigation/Pagination/Pagination.types.ts +0 -87
- package/src/components/navigation/Pagination/index.ts +0 -24
- package/src/components/navigation/Pagination/index.tsx +0 -9
- package/src/components/navigation/Steps/Step.tsx +0 -36
- package/src/components/navigation/Steps/Steps.styles.ts +0 -169
- package/src/components/navigation/Steps/Steps.test.tsx +0 -14
- package/src/components/navigation/Steps/Steps.tsx +0 -112
- package/src/components/navigation/Steps/Steps.types.ts +0 -47
- package/src/components/navigation/Steps/index.tsx +0 -3
- package/src/components/navigation/Tabs/Tabs.styles.ts +0 -199
- package/src/components/navigation/Tabs/Tabs.test.tsx +0 -662
- package/src/components/navigation/Tabs/Tabs.tsx +0 -253
- package/src/components/navigation/Tabs/Tabs.types.ts +0 -115
- package/src/components/navigation/Tabs/index.tsx +0 -3
- package/src/components/navigation/index.tsx +0 -88
- package/src/constants/index.ts +0 -785
- package/src/hooks/index.ts +0 -60
- package/src/hooks/types.ts +0 -9
- package/src/hooks/useAsync.ts +0 -64
- package/src/hooks/useClickOutside.ts +0 -52
- package/src/hooks/useCounter.ts +0 -87
- package/src/hooks/useDebounce.ts +0 -150
- package/src/hooks/useDeepCompareEffect.ts +0 -88
- package/src/hooks/useEventHandling.ts +0 -444
- package/src/hooks/useEventListener.ts +0 -77
- package/src/hooks/useLifecycle.ts +0 -399
- package/src/hooks/useMediaQuery.ts +0 -75
- package/src/hooks/useMutation.ts +0 -233
- package/src/hooks/usePerformance.ts +0 -378
- package/src/hooks/usePerformanceMonitor.ts +0 -348
- package/src/hooks/usePlatform.ts +0 -64
- package/src/hooks/usePrevious.ts +0 -25
- package/src/hooks/useRequest.test.ts +0 -11
- package/src/hooks/useRequest.ts +0 -140
- package/src/hooks/useStateManagement.ts +0 -300
- package/src/hooks/useStorage.ts +0 -169
- package/src/hooks/useStyle.ts +0 -543
- package/src/hooks/useTheme.ts +0 -347
- package/src/hooks/useToggle.ts +0 -54
- package/src/hooks/useVirtualScroll.ts +0 -331
- package/src/index.ts +0 -323
- package/src/platform/index.ts +0 -1188
- package/src/providers/AppProvider.test.tsx +0 -63
- package/src/providers/AppProvider.tsx +0 -155
- package/src/providers/index.ts +0 -1
- package/src/theme/ThemeProvider.tsx +0 -279
- package/src/theme/ThemeProvider.types.ts +0 -26
- package/src/theme/animations.tsx +0 -660
- package/src/theme/defaults.ts +0 -188
- package/src/theme/design-system.ts +0 -562
- package/src/theme/design-tokens.ts +0 -1122
- package/src/theme/generated/dark-theme.scss +0 -120
- package/src/theme/generated/tokens.css +0 -441
- package/src/theme/generated/tokens.scss +0 -384
- package/src/theme/index.ts +0 -99
- package/src/theme/responsive.tsx +0 -195
- package/src/theme/styles/mixins.scss +0 -612
- package/src/theme/styles/variables.scss +0 -295
- package/src/theme/styles.ts +0 -403
- package/src/theme/tokens/colors.ts +0 -256
- package/src/theme/tokens/effects.ts +0 -260
- package/src/theme/tokens/index.ts +0 -217
- package/src/theme/tokens/spacing.ts +0 -137
- package/src/theme/tokens/typography.ts +0 -186
- package/src/theme/types.ts +0 -188
- package/src/theme/useThemeUtils.ts +0 -313
- package/src/theme/utils.ts +0 -501
- package/src/theme/variables.ts +0 -602
- package/src/types/accessibility.ts +0 -50
- package/src/types/button.ts +0 -560
- package/src/types/component-props.ts +0 -322
- package/src/types/env.d.ts +0 -20
- package/src/types/glob.d.ts +0 -4
- package/src/types/index.ts +0 -427
- package/src/types/modules.d.ts +0 -40
- package/src/types/standardized-components.ts +0 -550
- package/src/types/taro-adapter.d.ts +0 -174
- package/src/types/taro-components.d.ts +0 -73
- package/src/types/utils.ts +0 -400
- package/src/utils/__tests__/inputValidator.test.ts +0 -338
- package/src/utils/__tests__/responsiveUtils.test.ts +0 -311
- package/src/utils/__tests__/xssProtection.test.ts +0 -268
- package/src/utils/abort-controller.ts +0 -48
- package/src/utils/cache.ts +0 -79
- package/src/utils/createNamespace.ts +0 -24
- package/src/utils/environment.ts +0 -115
- package/src/utils/error-handler.ts +0 -88
- package/src/utils/errorLogger.ts +0 -193
- package/src/utils/formatUtils.ts +0 -412
- package/src/utils/http/error-codes.ts +0 -314
- package/src/utils/http/http-client.test.ts +0 -63
- package/src/utils/http/http-client.ts +0 -161
- package/src/utils/http/request-cache.ts +0 -127
- package/src/utils/http/request.ts +0 -954
- package/src/utils/http/taro-adapter.test.ts +0 -74
- package/src/utils/http/taro-adapter.ts +0 -24
- package/src/utils/http/types.ts +0 -414
- package/src/utils/http/web-adapter.ts +0 -33
- package/src/utils/index.ts +0 -112
- package/src/utils/inputValidator.ts +0 -264
- package/src/utils/performance/performance.ts +0 -839
- package/src/utils/responsiveUtils.ts +0 -348
- package/src/utils/rtl-support.ts +0 -354
- package/src/utils/security/api-security.ts +0 -394
- package/src/utils/security/xss-protection.ts +0 -69
- package/src/utils/securityHeaders.ts +0 -308
- package/src/utils/typeHelpers.ts +0 -16
- package/src/utils/types/dataProcessing.ts +0 -544
- package/src/utils/types/typeHelpers.ts +0 -197
- package/src/utils/xssProtection.ts +0 -468
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import { PlatformDetector } from '../../../utils';
|
|
2
|
-
import type { IconProps, IconSize, IconStatus, IconTheme } from './Icon.types';
|
|
3
|
-
|
|
4
|
-
/** 样式工具类 */
|
|
5
|
-
export class IconStyles {
|
|
6
|
-
/** 获取平台前缀 */
|
|
7
|
-
private static getPlatformPrefix(): string {
|
|
8
|
-
const platformValue = PlatformDetector.getPlatform();
|
|
9
|
-
return `taro-uno-${platformValue}-icon`;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** 尺寸映射 */
|
|
13
|
-
static readonly SIZE_MAP: Record<IconSize, number> = {
|
|
14
|
-
xs: 16,
|
|
15
|
-
sm: 20,
|
|
16
|
-
md: 24,
|
|
17
|
-
lg: 32,
|
|
18
|
-
xl: 40,
|
|
19
|
-
'2xl': 48,
|
|
20
|
-
'3xl': 56,
|
|
21
|
-
'4xl': 64,
|
|
22
|
-
'5xl': 72,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/** 状态映射 */
|
|
26
|
-
static readonly STATUS_MAP: Record<IconStatus, { opacity: number; cursor: string; pointerEvents: string }> = {
|
|
27
|
-
normal: { opacity: 1, cursor: 'default', pointerEvents: 'auto' },
|
|
28
|
-
active: { opacity: 0.8, cursor: 'pointer', pointerEvents: 'auto' },
|
|
29
|
-
disabled: { opacity: 0.5, cursor: 'not-allowed', pointerEvents: 'none' },
|
|
30
|
-
loading: { opacity: 0.7, cursor: 'not-allowed', pointerEvents: 'none' },
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/** 主题样式映射 */
|
|
34
|
-
static readonly THEME_STYLES: Record<IconTheme, { strokeWidth?: number; fill?: string; stroke?: string }> = {
|
|
35
|
-
outlined: { strokeWidth: 1.5, fill: 'none', stroke: 'currentColor' },
|
|
36
|
-
filled: { strokeWidth: 0, fill: 'currentColor', stroke: 'none' },
|
|
37
|
-
'two-tone': { strokeWidth: 1, fill: 'currentColor', stroke: 'currentColor' },
|
|
38
|
-
colored: { strokeWidth: 1.5, fill: 'currentColor', stroke: 'currentColor' },
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/** 滤镜效果映射 */
|
|
42
|
-
static readonly FILTER_MAP: Record<string, string> = {
|
|
43
|
-
none: 'none',
|
|
44
|
-
grayscale: 'grayscale(100%)',
|
|
45
|
-
sepia: 'sepia(100%)',
|
|
46
|
-
blur: 'blur(2px)',
|
|
47
|
-
brightness: 'brightness(1.5)',
|
|
48
|
-
contrast: 'contrast(2)',
|
|
49
|
-
'hue-rotate': 'hue-rotate(90deg)',
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/** 混合模式映射 */
|
|
53
|
-
static readonly BLEND_MODE_MAP: Record<string, string> = {
|
|
54
|
-
normal: 'normal',
|
|
55
|
-
multiply: 'multiply',
|
|
56
|
-
screen: 'screen',
|
|
57
|
-
overlay: 'overlay',
|
|
58
|
-
darken: 'darken',
|
|
59
|
-
lighten: 'lighten',
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/** 生成图标类名 */
|
|
63
|
-
static getClassName(props: Partial<IconProps>): string {
|
|
64
|
-
const prefix = this.getPlatformPrefix();
|
|
65
|
-
const {
|
|
66
|
-
size = 'md',
|
|
67
|
-
status = 'normal',
|
|
68
|
-
theme = 'outlined',
|
|
69
|
-
clickable = false,
|
|
70
|
-
loading = false,
|
|
71
|
-
disabled = false,
|
|
72
|
-
animated = false,
|
|
73
|
-
className = '',
|
|
74
|
-
} = props;
|
|
75
|
-
|
|
76
|
-
const classes = [
|
|
77
|
-
prefix,
|
|
78
|
-
`${prefix}--${typeof size === 'string' ? size : 'custom'}`,
|
|
79
|
-
`${prefix}--${status}`,
|
|
80
|
-
`${prefix}--${theme}`,
|
|
81
|
-
clickable && `${prefix}--clickable`,
|
|
82
|
-
loading && `${prefix}--loading`,
|
|
83
|
-
disabled && `${prefix}--disabled`,
|
|
84
|
-
animated && `${prefix}--animated`,
|
|
85
|
-
className,
|
|
86
|
-
].filter(Boolean);
|
|
87
|
-
|
|
88
|
-
return classes.join(' ');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** 生成图标样式 */
|
|
92
|
-
static getStyle(props: Partial<IconProps>): React.CSSProperties {
|
|
93
|
-
const {
|
|
94
|
-
size = 'md',
|
|
95
|
-
color = 'currentColor',
|
|
96
|
-
rotate = 0,
|
|
97
|
-
status = 'normal',
|
|
98
|
-
animated = false,
|
|
99
|
-
animationDuration = 300,
|
|
100
|
-
filter = 'none',
|
|
101
|
-
blendMode = 'normal',
|
|
102
|
-
style = {},
|
|
103
|
-
} = props;
|
|
104
|
-
|
|
105
|
-
const statusStyles = this.STATUS_MAP[status];
|
|
106
|
-
const filterStyle = this.FILTER_MAP[filter];
|
|
107
|
-
const blendModeStyle = this.BLEND_MODE_MAP[blendMode];
|
|
108
|
-
|
|
109
|
-
// 计算尺寸
|
|
110
|
-
const calculatedSize = typeof size === 'string' ? this.SIZE_MAP[size] : size;
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
width: calculatedSize,
|
|
114
|
-
height: calculatedSize,
|
|
115
|
-
fontSize: calculatedSize,
|
|
116
|
-
color,
|
|
117
|
-
opacity: statusStyles['opacity'],
|
|
118
|
-
cursor: statusStyles['cursor'],
|
|
119
|
-
pointerEvents: statusStyles['pointerEvents'] as any,
|
|
120
|
-
transform: rotate ? `rotate(${rotate}deg)` : 'none',
|
|
121
|
-
transition: animated ? `all ${animationDuration}ms ease-in-out` : 'none',
|
|
122
|
-
filter: filterStyle,
|
|
123
|
-
mixBlendMode: blendModeStyle as any,
|
|
124
|
-
display: 'inline-flex',
|
|
125
|
-
alignItems: 'center',
|
|
126
|
-
justifyContent: 'center',
|
|
127
|
-
verticalAlign: 'middle',
|
|
128
|
-
...style,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/** 生成SVG样式 */
|
|
133
|
-
static getSVGStyle(props: Partial<IconProps>): React.CSSProperties {
|
|
134
|
-
const { theme = 'outlined', size = 'md', color = 'currentColor', style = {} } = props;
|
|
135
|
-
|
|
136
|
-
const themeStyles = this.THEME_STYLES[theme];
|
|
137
|
-
const calculatedSize = typeof size === 'string' ? this.SIZE_MAP[size] : size;
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
width: calculatedSize,
|
|
141
|
-
height: calculatedSize,
|
|
142
|
-
fill: themeStyles['fill'],
|
|
143
|
-
stroke: themeStyles['stroke'],
|
|
144
|
-
strokeWidth: themeStyles['strokeWidth'],
|
|
145
|
-
color,
|
|
146
|
-
...style,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/** 生成图片样式 */
|
|
151
|
-
static getImageStyle(props: Partial<IconProps>): React.CSSProperties {
|
|
152
|
-
const { size = 'md', style = {} } = props;
|
|
153
|
-
|
|
154
|
-
const calculatedSize = typeof size === 'string' ? this.SIZE_MAP[size] : size;
|
|
155
|
-
|
|
156
|
-
return {
|
|
157
|
-
width: calculatedSize,
|
|
158
|
-
height: calculatedSize,
|
|
159
|
-
objectFit: 'contain',
|
|
160
|
-
display: 'block',
|
|
161
|
-
...style,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/** 生成字体图标样式 */
|
|
166
|
-
static getFontIconStyle(props: Partial<IconProps>): React.CSSProperties {
|
|
167
|
-
const { size = 'md', color = 'currentColor', style = {} } = props;
|
|
168
|
-
|
|
169
|
-
const calculatedSize = typeof size === 'string' ? this.SIZE_MAP[size] : size;
|
|
170
|
-
|
|
171
|
-
return {
|
|
172
|
-
fontSize: calculatedSize,
|
|
173
|
-
lineHeight: 1,
|
|
174
|
-
color,
|
|
175
|
-
display: 'inline-block',
|
|
176
|
-
...style,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/** 生成加载动画样式 */
|
|
181
|
-
static getLoadingStyle(size: IconSize | number): React.CSSProperties {
|
|
182
|
-
const calculatedSize = typeof size === 'string' ? this.SIZE_MAP[size] : size;
|
|
183
|
-
|
|
184
|
-
return {
|
|
185
|
-
width: calculatedSize,
|
|
186
|
-
height: calculatedSize,
|
|
187
|
-
border: '2px solid transparent',
|
|
188
|
-
borderTopColor: 'currentColor',
|
|
189
|
-
borderRadius: '50%',
|
|
190
|
-
animation: 'spin 1s linear infinite',
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/** 生成涟漪效果样式 */
|
|
195
|
-
static getRippleStyle(x: number, y: number, size: number): React.CSSProperties {
|
|
196
|
-
return {
|
|
197
|
-
position: 'absolute',
|
|
198
|
-
borderRadius: '50%',
|
|
199
|
-
backgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
200
|
-
width: `${size}px`,
|
|
201
|
-
height: `${size}px`,
|
|
202
|
-
top: `${y - size / 2}px`,
|
|
203
|
-
left: `${x - size / 2}px`,
|
|
204
|
-
animation: 'ripple 0.6s ease-out',
|
|
205
|
-
pointerEvents: 'none',
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/** 生成工具提示样式 */
|
|
210
|
-
static getTooltipStyle(position: string = 'top'): React.CSSProperties {
|
|
211
|
-
const baseStyle: React.CSSProperties = {
|
|
212
|
-
position: 'absolute',
|
|
213
|
-
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
|
214
|
-
color: '#ffffff',
|
|
215
|
-
padding: '4px 8px',
|
|
216
|
-
borderRadius: '4px',
|
|
217
|
-
fontSize: '12px',
|
|
218
|
-
whiteSpace: 'nowrap',
|
|
219
|
-
zIndex: 1000,
|
|
220
|
-
pointerEvents: 'none',
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
switch (position) {
|
|
224
|
-
case 'top':
|
|
225
|
-
return { ...baseStyle, bottom: '100%', left: '50%', transform: 'translateX(-50%)', marginBottom: '4px' };
|
|
226
|
-
case 'bottom':
|
|
227
|
-
return { ...baseStyle, top: '100%', left: '50%', transform: 'translateX(-50%)', marginTop: '4px' };
|
|
228
|
-
case 'left':
|
|
229
|
-
return { ...baseStyle, right: '100%', top: '50%', transform: 'translateY(-50%)', marginRight: '4px' };
|
|
230
|
-
case 'right':
|
|
231
|
-
return { ...baseStyle, left: '100%', top: '50%', transform: 'translateY(-50%)', marginLeft: '4px' };
|
|
232
|
-
default:
|
|
233
|
-
return baseStyle;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/** 生成图标组样式 */
|
|
238
|
-
static getGroupStyle(props: {
|
|
239
|
-
vertical?: boolean;
|
|
240
|
-
spacing?: number;
|
|
241
|
-
align?: string;
|
|
242
|
-
style?: React.CSSProperties;
|
|
243
|
-
}): React.CSSProperties {
|
|
244
|
-
const { vertical = false, spacing = 8, align = 'center', style = {} } = props;
|
|
245
|
-
|
|
246
|
-
return {
|
|
247
|
-
display: 'flex',
|
|
248
|
-
flexDirection: vertical ? 'column' : 'row',
|
|
249
|
-
gap: `${spacing}px`,
|
|
250
|
-
alignItems: align,
|
|
251
|
-
...style,
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/** 生成CSS变量 */
|
|
256
|
-
static generateCSSVariables(): string {
|
|
257
|
-
return `
|
|
258
|
-
:root {
|
|
259
|
-
--icon-primary-color: #0ea5e9;
|
|
260
|
-
--icon-secondary-color: #6b7280;
|
|
261
|
-
--icon-success-color: #22c55e;
|
|
262
|
-
--icon-warning-color: #f59e0b;
|
|
263
|
-
--icon-error-color: #ef4444;
|
|
264
|
-
--icon-info-color: #3b82f6;
|
|
265
|
-
--icon-disabled-opacity: 0.5;
|
|
266
|
-
--icon-loading-opacity: 0.7;
|
|
267
|
-
--icon-animation-duration: 300ms;
|
|
268
|
-
}
|
|
269
|
-
`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/** 生成关键帧动画 */
|
|
273
|
-
static generateKeyframes(): string {
|
|
274
|
-
return `
|
|
275
|
-
@keyframes spin {
|
|
276
|
-
from {
|
|
277
|
-
transform: rotate(0deg);
|
|
278
|
-
}
|
|
279
|
-
to {
|
|
280
|
-
transform: rotate(360deg);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
@keyframes ripple {
|
|
285
|
-
from {
|
|
286
|
-
transform: scale(0);
|
|
287
|
-
opacity: 1;
|
|
288
|
-
}
|
|
289
|
-
to {
|
|
290
|
-
transform: scale(4);
|
|
291
|
-
opacity: 0;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
@keyframes pulse {
|
|
296
|
-
0%, 100% {
|
|
297
|
-
opacity: 1;
|
|
298
|
-
}
|
|
299
|
-
50% {
|
|
300
|
-
opacity: 0.5;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
@keyframes bounce {
|
|
305
|
-
0%, 100% {
|
|
306
|
-
transform: translateY(0);
|
|
307
|
-
}
|
|
308
|
-
50% {
|
|
309
|
-
transform: translateY(-25%);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
@keyframes shake {
|
|
314
|
-
0%, 100% {
|
|
315
|
-
transform: translateX(0);
|
|
316
|
-
}
|
|
317
|
-
10%, 30%, 50%, 70%, 90% {
|
|
318
|
-
transform: translateX(-2px);
|
|
319
|
-
}
|
|
320
|
-
20%, 40%, 60%, 80% {
|
|
321
|
-
transform: translateX(2px);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
`;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/** 生成动画类名 */
|
|
328
|
-
static getAnimationClassName(animation: string): string {
|
|
329
|
-
const animationMap: Record<string, string> = {
|
|
330
|
-
spin: 'taro-uno-icon--spin',
|
|
331
|
-
pulse: 'taro-uno-icon--pulse',
|
|
332
|
-
bounce: 'taro-uno-icon--bounce',
|
|
333
|
-
shake: 'taro-uno-icon--shake',
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
return animationMap[animation] || '';
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/** 获取主题类名 */
|
|
340
|
-
static getThemeClassName(theme: IconTheme): string {
|
|
341
|
-
return `taro-uno-icon--${theme}`;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/** 获取状态类名 */
|
|
345
|
-
static getStatusClassName(status: IconStatus): string {
|
|
346
|
-
return `taro-uno-icon--${status}`;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/** 获取尺寸类名 */
|
|
350
|
-
static getSizeClassName(size: IconSize | number): string {
|
|
351
|
-
if (typeof size === 'number') {
|
|
352
|
-
return 'taro-uno-icon--custom';
|
|
353
|
-
}
|
|
354
|
-
return `taro-uno-icon--${size}`;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/** 导出样式工具 */
|
|
359
|
-
export const iconStyles = IconStyles;
|