@unif/react-native-design 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js +6 -4
- package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js.map +1 -1
- package/lib/module/components/business/AvatarWithRing/styles.js +15 -3
- package/lib/module/components/business/AvatarWithRing/styles.js.map +1 -1
- package/lib/module/components/business/Decorations/GradientWash.js +50 -36
- package/lib/module/components/business/Decorations/GradientWash.js.map +1 -1
- package/lib/module/components/business/Decorations/RadialHalo.js +10 -4
- package/lib/module/components/business/Decorations/RadialHalo.js.map +1 -1
- package/lib/module/components/business/Decorations/ScreenBackdrop.js +22 -14
- package/lib/module/components/business/Decorations/ScreenBackdrop.js.map +1 -1
- package/lib/module/components/business/Decorations/index.js +3 -0
- package/lib/module/components/business/Decorations/index.js.map +1 -1
- package/lib/module/components/business/GlassStats/GlassStats.js +7 -4
- package/lib/module/components/business/GlassStats/GlassStats.js.map +1 -1
- package/lib/module/components/business/GlassStats/types.js +2 -0
- package/lib/module/components/business/VersionPill/VersionPill.js +23 -5
- package/lib/module/components/business/VersionPill/VersionPill.js.map +1 -1
- package/lib/module/components/business/VersionPill/styles.js +1 -1
- package/lib/module/components/business/index.js.map +1 -1
- package/lib/module/components/business/useSvgId.js +20 -0
- package/lib/module/components/business/useSvgId.js.map +1 -0
- package/lib/module/components/ui/Avatar/Avatar.js +13 -8
- package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/ui/Avatar/styles.js +7 -7
- package/lib/module/components/ui/Avatar/styles.js.map +1 -1
- package/lib/module/components/ui/BlurLayer/BlurLayer.js +5 -1
- package/lib/module/components/ui/BlurLayer/BlurLayer.js.map +1 -1
- package/lib/module/components/ui/BlurLayer/BlurLayer.web.js +7 -1
- package/lib/module/components/ui/BlurLayer/BlurLayer.web.js.map +1 -1
- package/lib/module/components/ui/Button/Button.js +2 -1
- package/lib/module/components/ui/Button/Button.js.map +1 -1
- package/lib/module/components/ui/Button/ButtonBase.js +36 -2
- package/lib/module/components/ui/Button/ButtonBase.js.map +1 -1
- package/lib/module/components/ui/Button/styles.js +27 -25
- package/lib/module/components/ui/Button/styles.js.map +1 -1
- package/lib/module/components/ui/Card/Card.js +17 -8
- package/lib/module/components/ui/Card/Card.js.map +1 -1
- package/lib/module/components/ui/Card/styles.js +6 -1
- package/lib/module/components/ui/Card/styles.js.map +1 -1
- package/lib/module/components/ui/Carousel/Carousel.js +36 -6
- package/lib/module/components/ui/Carousel/Carousel.js.map +1 -1
- package/lib/module/components/ui/Cell/Cell.js +23 -5
- package/lib/module/components/ui/Cell/Cell.js.map +1 -1
- package/lib/module/components/ui/Cell/Leading.js +2 -2
- package/lib/module/components/ui/Cell/Leading.js.map +1 -1
- package/lib/module/components/ui/Cell/List.js +10 -5
- package/lib/module/components/ui/Cell/List.js.map +1 -1
- package/lib/module/components/ui/Cell/styles.js +7 -6
- package/lib/module/components/ui/Cell/styles.js.map +1 -1
- package/lib/module/components/ui/Checkbox/Checkbox.js +10 -8
- package/lib/module/components/ui/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/ui/Checkbox/styles.js +9 -1
- package/lib/module/components/ui/Checkbox/styles.js.map +1 -1
- package/lib/module/components/ui/Chip/Chip.js +19 -5
- package/lib/module/components/ui/Chip/Chip.js.map +1 -1
- package/lib/module/components/ui/Confirm/ConfirmHost.js +28 -11
- package/lib/module/components/ui/Confirm/ConfirmHost.js.map +1 -1
- package/lib/module/components/ui/Confirm/confirm.js +6 -0
- package/lib/module/components/ui/Confirm/confirm.js.map +1 -1
- package/lib/module/components/ui/DrawerHeader/DrawerHeader.js +14 -9
- package/lib/module/components/ui/DrawerHeader/DrawerHeader.js.map +1 -1
- package/lib/module/components/ui/DrawerHeader/styles.js +10 -6
- package/lib/module/components/ui/DrawerHeader/styles.js.map +1 -1
- package/lib/module/components/ui/Empty/Empty.js +5 -4
- package/lib/module/components/ui/Empty/Empty.js.map +1 -1
- package/lib/module/components/ui/EntryCard/EntryCard.js +5 -3
- package/lib/module/components/ui/EntryCard/EntryCard.js.map +1 -1
- package/lib/module/components/ui/EntryCard/styles.js +4 -4
- package/lib/module/components/ui/EntryCard/styles.js.map +1 -1
- package/lib/module/components/ui/Form/FormRow.js +1 -0
- package/lib/module/components/ui/Form/FormRow.js.map +1 -1
- package/lib/module/components/ui/Form/styles.js +3 -1
- package/lib/module/components/ui/Form/styles.js.map +1 -1
- package/lib/module/components/ui/Grid/Grid.js +39 -24
- package/lib/module/components/ui/Grid/Grid.js.map +1 -1
- package/lib/module/components/ui/Grid/styles.js +35 -46
- package/lib/module/components/ui/Grid/styles.js.map +1 -1
- package/lib/module/components/ui/Icon/Icon.js +46 -29
- package/lib/module/components/ui/Icon/Icon.js.map +1 -1
- package/lib/module/components/ui/IconButton/IconButton.js +2 -0
- package/lib/module/components/ui/IconButton/IconButton.js.map +1 -1
- package/lib/module/components/ui/Logo/Logo.js +2 -1
- package/lib/module/components/ui/Logo/Logo.js.map +1 -1
- package/lib/module/components/ui/NavBar/NavBar.js +15 -3
- package/lib/module/components/ui/NavBar/NavBar.js.map +1 -1
- package/lib/module/components/ui/PasswordInput/PasswordInput.js +43 -14
- package/lib/module/components/ui/PasswordInput/PasswordInput.js.map +1 -1
- package/lib/module/components/ui/PasswordInput/styles.js +1 -1
- package/lib/module/components/ui/Pulse/Pulse.js +2 -1
- package/lib/module/components/ui/Pulse/Pulse.js.map +1 -1
- package/lib/module/components/ui/Pulse/PulseDot.js +8 -10
- package/lib/module/components/ui/Pulse/PulseDot.js.map +1 -1
- package/lib/module/components/ui/Pulse/types.js +2 -0
- package/lib/module/components/ui/Pulse/usePulse.web.js +51 -30
- package/lib/module/components/ui/Pulse/usePulse.web.js.map +1 -1
- package/lib/module/components/ui/Radio/Radio.js +19 -5
- package/lib/module/components/ui/Radio/Radio.js.map +1 -1
- package/lib/module/components/ui/Radio/RadioGroup.js +10 -6
- package/lib/module/components/ui/Radio/RadioGroup.js.map +1 -1
- package/lib/module/components/ui/Radio/styles.js +10 -3
- package/lib/module/components/ui/Radio/styles.js.map +1 -1
- package/lib/module/components/ui/Reveal/Reveal.web.js +18 -3
- package/lib/module/components/ui/Reveal/Reveal.web.js.map +1 -1
- package/lib/module/components/ui/Search/Search.js +26 -10
- package/lib/module/components/ui/Search/Search.js.map +1 -1
- package/lib/module/components/ui/Segmented/Segmented.js +40 -30
- package/lib/module/components/ui/Segmented/Segmented.js.map +1 -1
- package/lib/module/components/ui/Segmented/styles.js +4 -2
- package/lib/module/components/ui/Segmented/styles.js.map +1 -1
- package/lib/module/components/ui/Skeleton/Skeleton.js +9 -8
- package/lib/module/components/ui/Skeleton/Skeleton.js.map +1 -1
- package/lib/module/components/ui/Spinner/Spinner.js +15 -16
- package/lib/module/components/ui/Spinner/Spinner.js.map +1 -1
- package/lib/module/components/ui/Spinner/Spinner.web.js +10 -14
- package/lib/module/components/ui/Spinner/Spinner.web.js.map +1 -1
- package/lib/module/components/ui/Spinner/shared.js +31 -0
- package/lib/module/components/ui/Spinner/shared.js.map +1 -0
- package/lib/module/components/ui/StatusDot/StatusDot.js +21 -4
- package/lib/module/components/ui/StatusDot/StatusDot.js.map +1 -1
- package/lib/module/components/ui/StatusDot/styles.js +1 -1
- package/lib/module/components/ui/StatusDot/types.js +2 -0
- package/lib/module/components/ui/Stepper/Stepper.js +46 -10
- package/lib/module/components/ui/Stepper/Stepper.js.map +1 -1
- package/lib/module/components/ui/Switch/Switch.js +6 -11
- package/lib/module/components/ui/Switch/Switch.js.map +1 -1
- package/lib/module/components/ui/Switch/Switch.web.js +2 -8
- package/lib/module/components/ui/Switch/Switch.web.js.map +1 -1
- package/lib/module/components/ui/Switch/styles.js +12 -3
- package/lib/module/components/ui/Switch/styles.js.map +1 -1
- package/lib/module/components/ui/TabBar/TabBar.js +10 -6
- package/lib/module/components/ui/TabBar/TabBar.js.map +1 -1
- package/lib/module/components/ui/TabBar/styles.js +28 -39
- package/lib/module/components/ui/TabBar/styles.js.map +1 -1
- package/lib/module/components/ui/Tabs/Tabs.js +19 -5
- package/lib/module/components/ui/Tabs/Tabs.js.map +1 -1
- package/lib/module/components/ui/Tabs/styles.js +6 -2
- package/lib/module/components/ui/Tabs/styles.js.map +1 -1
- package/lib/module/components/ui/Tabs/types.js +2 -0
- package/lib/module/components/ui/Tag/styles.js +15 -14
- package/lib/module/components/ui/Tag/styles.js.map +1 -1
- package/lib/module/components/ui/TextField/TextFieldBase.js +24 -6
- package/lib/module/components/ui/TextField/TextFieldBase.js.map +1 -1
- package/lib/module/components/ui/Thumbnail/Thumbnail.js +11 -3
- package/lib/module/components/ui/Thumbnail/Thumbnail.js.map +1 -1
- package/lib/module/components/ui/Thumbnail/styles.js +6 -2
- package/lib/module/components/ui/Thumbnail/styles.js.map +1 -1
- package/lib/module/components/ui/Toast/ToastHost.js +16 -5
- package/lib/module/components/ui/Toast/ToastHost.js.map +1 -1
- package/lib/module/components/ui/Toast/ToastHost.web.js +21 -4
- package/lib/module/components/ui/Toast/ToastHost.web.js.map +1 -1
- package/lib/module/components/ui/Toast/styles.js +2 -0
- package/lib/module/components/ui/Toast/styles.js.map +1 -1
- package/lib/module/components/ui/Toast/toast.js +23 -3
- package/lib/module/components/ui/Toast/toast.js.map +1 -1
- package/lib/module/components/ui/shared/badgeStyles.js +31 -0
- package/lib/module/components/ui/shared/badgeStyles.js.map +1 -0
- package/lib/module/icons/data.js +43 -18
- package/lib/module/icons/data.js.map +1 -1
- package/lib/module/theme/colors.js +28 -10
- package/lib/module/theme/colors.js.map +1 -1
- package/lib/module/theme/index.js +6 -2
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/scale.js +9 -1
- package/lib/module/theme/scale.js.map +1 -1
- package/lib/module/theme/shadow.js +24 -41
- package/lib/module/theme/shadow.js.map +1 -1
- package/lib/module/theme/tokens.js +10 -5
- package/lib/module/theme/tokens.js.map +1 -1
- package/lib/module/theme/usePrefersReducedMotion.js +12 -0
- package/lib/module/theme/usePrefersReducedMotion.js.map +1 -0
- package/lib/module/theme/usePrefersReducedMotion.web.js +25 -0
- package/lib/module/theme/usePrefersReducedMotion.web.js.map +1 -0
- package/lib/module/theme/useTheme.js +13 -0
- package/lib/module/theme/useTheme.js.map +1 -1
- package/lib/module/utils/logger/logger.js +5 -1
- package/lib/module/utils/logger/logger.js.map +1 -1
- package/lib/module/utils/testID/testID.js +6 -3
- package/lib/module/utils/testID/testID.js.map +1 -1
- package/lib/typescript/src/components/business/AvatarWithRing/AvatarWithRing.d.ts +1 -1
- package/lib/typescript/src/components/business/AvatarWithRing/AvatarWithRing.d.ts.map +1 -1
- package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts +5 -5
- package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/business/AvatarWithRing/types.d.ts +3 -1
- package/lib/typescript/src/components/business/AvatarWithRing/types.d.ts.map +1 -1
- package/lib/typescript/src/components/business/Decorations/GradientWash.d.ts +25 -0
- package/lib/typescript/src/components/business/Decorations/GradientWash.d.ts.map +1 -1
- package/lib/typescript/src/components/business/Decorations/RadialHalo.d.ts.map +1 -1
- package/lib/typescript/src/components/business/Decorations/ScreenBackdrop.d.ts +1 -1
- package/lib/typescript/src/components/business/Decorations/ScreenBackdrop.d.ts.map +1 -1
- package/lib/typescript/src/components/business/Decorations/index.d.ts +1 -1
- package/lib/typescript/src/components/business/Decorations/index.d.ts.map +1 -1
- package/lib/typescript/src/components/business/Decorations/types.d.ts +2 -0
- package/lib/typescript/src/components/business/Decorations/types.d.ts.map +1 -1
- package/lib/typescript/src/components/business/GlassStats/GlassStats.d.ts +1 -1
- package/lib/typescript/src/components/business/GlassStats/GlassStats.d.ts.map +1 -1
- package/lib/typescript/src/components/business/GlassStats/styles.d.ts +2 -2
- package/lib/typescript/src/components/business/GlassStats/types.d.ts +5 -0
- package/lib/typescript/src/components/business/GlassStats/types.d.ts.map +1 -1
- package/lib/typescript/src/components/business/VersionPill/VersionPill.d.ts +1 -1
- package/lib/typescript/src/components/business/VersionPill/VersionPill.d.ts.map +1 -1
- package/lib/typescript/src/components/business/VersionPill/styles.d.ts +1 -1
- package/lib/typescript/src/components/business/VersionPill/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/business/VersionPill/types.d.ts +13 -1
- package/lib/typescript/src/components/business/VersionPill/types.d.ts.map +1 -1
- package/lib/typescript/src/components/business/index.d.ts +1 -1
- package/lib/typescript/src/components/business/index.d.ts.map +1 -1
- package/lib/typescript/src/components/business/useSvgId.d.ts +12 -0
- package/lib/typescript/src/components/business/useSvgId.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts +1 -1
- package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Avatar/styles.d.ts +1 -1
- package/lib/typescript/src/components/ui/Avatar/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Avatar/types.d.ts +3 -1
- package/lib/typescript/src/components/ui/Avatar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/BlurLayer/BlurLayer.d.ts +1 -1
- package/lib/typescript/src/components/ui/BlurLayer/BlurLayer.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/BlurLayer/BlurLayer.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Button/Button.d.ts +1 -1
- package/lib/typescript/src/components/ui/Button/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Button/ButtonBase.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Button/styles.d.ts +2 -1
- package/lib/typescript/src/components/ui/Button/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Button/types.d.ts +1 -1
- package/lib/typescript/src/components/ui/Button/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Card/Card.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Card/styles.d.ts +2 -0
- package/lib/typescript/src/components/ui/Card/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Card/types.d.ts +4 -4
- package/lib/typescript/src/components/ui/Card/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Carousel/Carousel.d.ts +4 -11
- package/lib/typescript/src/components/ui/Carousel/Carousel.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Carousel/index.d.ts +1 -1
- package/lib/typescript/src/components/ui/Carousel/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Carousel/types.d.ts +4 -0
- package/lib/typescript/src/components/ui/Carousel/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/Cell.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/List.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/styles.d.ts +1 -1
- package/lib/typescript/src/components/ui/Cell/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/types.d.ts +5 -2
- package/lib/typescript/src/components/ui/Cell/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Checkbox/styles.d.ts +6 -0
- package/lib/typescript/src/components/ui/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Chip/Chip.d.ts +4 -3
- package/lib/typescript/src/components/ui/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Chip/types.d.ts +2 -0
- package/lib/typescript/src/components/ui/Chip/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/confirm.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/types.d.ts +4 -2
- package/lib/typescript/src/components/ui/Confirm/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/DrawerHeader/DrawerHeader.d.ts +1 -1
- package/lib/typescript/src/components/ui/DrawerHeader/DrawerHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/DrawerHeader/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts +3 -1
- package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Empty/Empty.d.ts +2 -2
- package/lib/typescript/src/components/ui/Empty/Empty.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Empty/types.d.ts +3 -0
- package/lib/typescript/src/components/ui/Empty/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/EntryCard/EntryCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/EntryCard/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/EntryCard/types.d.ts +2 -2
- package/lib/typescript/src/components/ui/EntryCard/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Form/FormRow.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Form/styles.d.ts +1 -0
- package/lib/typescript/src/components/ui/Form/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Form/types.d.ts +7 -2
- package/lib/typescript/src/components/ui/Form/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Grid/Grid.d.ts +1 -1
- package/lib/typescript/src/components/ui/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Grid/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Grid/types.d.ts +4 -1
- package/lib/typescript/src/components/ui/Grid/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/IconButton/IconButton.d.ts +1 -1
- package/lib/typescript/src/components/ui/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/IconButton/types.d.ts +7 -2
- package/lib/typescript/src/components/ui/IconButton/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Input/Input.d.ts +16 -16
- package/lib/typescript/src/components/ui/Input/types.d.ts +3 -2
- package/lib/typescript/src/components/ui/Input/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Logo/Logo.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar/NavBar.d.ts +8 -1
- package/lib/typescript/src/components/ui/NavBar/NavBar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar/types.d.ts +5 -1
- package/lib/typescript/src/components/ui/NavBar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts +13 -5
- package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts +1 -1
- package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/PasswordInput/types.d.ts +7 -2
- package/lib/typescript/src/components/ui/PasswordInput/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Pulse/Pulse.d.ts +1 -1
- package/lib/typescript/src/components/ui/Pulse/Pulse.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Pulse/PulseDot.d.ts +1 -1
- package/lib/typescript/src/components/ui/Pulse/PulseDot.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Pulse/types.d.ts +5 -0
- package/lib/typescript/src/components/ui/Pulse/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts +12 -8
- package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Radio/Radio.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Radio/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Radio/styles.d.ts +4 -2
- package/lib/typescript/src/components/ui/Radio/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts +9 -0
- package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Search/Search.d.ts +16 -15
- package/lib/typescript/src/components/ui/Search/Search.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Search/types.d.ts +3 -1
- package/lib/typescript/src/components/ui/Search/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts +1 -1
- package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/styles.d.ts +1 -1
- package/lib/typescript/src/components/ui/Segmented/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/types.d.ts +2 -0
- package/lib/typescript/src/components/ui/Segmented/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts +3 -2
- package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Spinner/Spinner.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Spinner/Spinner.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Spinner/shared.d.ts +5 -0
- package/lib/typescript/src/components/ui/Spinner/shared.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/StatusDot/StatusDot.d.ts +1 -5
- package/lib/typescript/src/components/ui/StatusDot/StatusDot.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/StatusDot/styles.d.ts +1 -1
- package/lib/typescript/src/components/ui/StatusDot/types.d.ts +13 -1
- package/lib/typescript/src/components/ui/StatusDot/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Switch/Switch.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Switch/Switch.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Switch/styles.d.ts +7 -1
- package/lib/typescript/src/components/ui/Switch/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TabBar/TabBar.d.ts +2 -2
- package/lib/typescript/src/components/ui/TabBar/TabBar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TabBar/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TabBar/types.d.ts +3 -0
- package/lib/typescript/src/components/ui/TabBar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tabs/Tabs.d.ts +1 -1
- package/lib/typescript/src/components/ui/Tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tabs/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tabs/types.d.ts +9 -1
- package/lib/typescript/src/components/ui/Tabs/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tag/styles.d.ts +2 -1
- package/lib/typescript/src/components/ui/Tag/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tag/types.d.ts +6 -2
- package/lib/typescript/src/components/ui/Tag/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts +16 -16
- package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts +16 -16
- package/lib/typescript/src/components/ui/Textarea/types.d.ts +2 -1
- package/lib/typescript/src/components/ui/Textarea/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts +3 -0
- package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/ToastHost.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/ToastHost.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/toast.d.ts +0 -5
- package/lib/typescript/src/components/ui/Toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/types.d.ts +1 -1
- package/lib/typescript/src/components/ui/Toast/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/shared/badgeStyles.d.ts +27 -0
- package/lib/typescript/src/components/ui/shared/badgeStyles.d.ts.map +1 -0
- package/lib/typescript/src/icons/data.d.ts.map +1 -1
- package/lib/typescript/src/icons/types.d.ts +18 -12
- package/lib/typescript/src/icons/types.d.ts.map +1 -1
- package/lib/typescript/src/theme/colors.d.ts +9 -3
- package/lib/typescript/src/theme/colors.d.ts.map +1 -1
- package/lib/typescript/src/theme/index.d.ts +3 -2
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/scale.d.ts.map +1 -1
- package/lib/typescript/src/theme/shadow.d.ts +8 -8
- package/lib/typescript/src/theme/shadow.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens.d.ts +7 -3
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts +8 -0
- package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts.map +1 -0
- package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts +6 -0
- package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts.map +1 -0
- package/lib/typescript/src/theme/useTheme.d.ts.map +1 -1
- package/lib/typescript/src/utils/logger/logger.d.ts.map +1 -1
- package/lib/typescript/src/utils/testID/testID.d.ts +6 -3
- package/lib/typescript/src/utils/testID/testID.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/components/business/AvatarWithRing/AvatarWithRing.tsx +5 -4
- package/src/components/business/AvatarWithRing/styles.ts +21 -3
- package/src/components/business/AvatarWithRing/types.ts +3 -1
- package/src/components/business/Decorations/GradientWash.tsx +46 -22
- package/src/components/business/Decorations/RadialHalo.tsx +8 -4
- package/src/components/business/Decorations/ScreenBackdrop.tsx +23 -5
- package/src/components/business/Decorations/index.ts +4 -0
- package/src/components/business/Decorations/types.ts +2 -0
- package/src/components/business/GlassStats/GlassStats.tsx +8 -4
- package/src/components/business/GlassStats/types.ts +6 -0
- package/src/components/business/VersionPill/VersionPill.tsx +46 -6
- package/src/components/business/VersionPill/styles.ts +1 -1
- package/src/components/business/VersionPill/types.ts +13 -1
- package/src/components/business/index.ts +1 -0
- package/src/components/business/useSvgId.ts +17 -0
- package/src/components/ui/Avatar/Avatar.tsx +17 -10
- package/src/components/ui/Avatar/styles.ts +7 -7
- package/src/components/ui/Avatar/types.ts +3 -1
- package/src/components/ui/BlurLayer/BlurLayer.tsx +4 -1
- package/src/components/ui/BlurLayer/BlurLayer.web.tsx +7 -1
- package/src/components/ui/Button/Button.tsx +2 -1
- package/src/components/ui/Button/ButtonBase.tsx +26 -2
- package/src/components/ui/Button/styles.ts +27 -25
- package/src/components/ui/Button/types.ts +1 -1
- package/src/components/ui/Card/Card.tsx +17 -7
- package/src/components/ui/Card/styles.ts +5 -0
- package/src/components/ui/Card/types.ts +4 -4
- package/src/components/ui/Carousel/Carousel.tsx +44 -15
- package/src/components/ui/Carousel/index.ts +1 -1
- package/src/components/ui/Carousel/types.ts +5 -0
- package/src/components/ui/Cell/Cell.tsx +28 -6
- package/src/components/ui/Cell/Leading.tsx +2 -2
- package/src/components/ui/Cell/List.tsx +14 -8
- package/src/components/ui/Cell/styles.ts +8 -5
- package/src/components/ui/Cell/types.ts +5 -2
- package/src/components/ui/Checkbox/Checkbox.tsx +18 -5
- package/src/components/ui/Checkbox/styles.ts +8 -0
- package/src/components/ui/Chip/Chip.tsx +20 -5
- package/src/components/ui/Chip/types.ts +2 -0
- package/src/components/ui/Confirm/ConfirmHost.tsx +26 -10
- package/src/components/ui/Confirm/confirm.ts +8 -0
- package/src/components/ui/Confirm/types.ts +4 -2
- package/src/components/ui/DrawerHeader/DrawerHeader.tsx +18 -12
- package/src/components/ui/DrawerHeader/styles.ts +10 -6
- package/src/components/ui/DrawerHeader/types.ts +3 -1
- package/src/components/ui/Empty/Empty.tsx +5 -4
- package/src/components/ui/Empty/types.ts +3 -0
- package/src/components/ui/EntryCard/EntryCard.tsx +5 -3
- package/src/components/ui/EntryCard/styles.ts +13 -4
- package/src/components/ui/EntryCard/types.ts +2 -2
- package/src/components/ui/Form/FormRow.tsx +7 -1
- package/src/components/ui/Form/styles.ts +2 -0
- package/src/components/ui/Form/types.ts +7 -2
- package/src/components/ui/Grid/Grid.tsx +42 -25
- package/src/components/ui/Grid/styles.ts +8 -20
- package/src/components/ui/Grid/types.ts +4 -1
- package/src/components/ui/Icon/Icon.tsx +42 -27
- package/src/components/ui/IconButton/IconButton.tsx +2 -0
- package/src/components/ui/IconButton/types.ts +8 -2
- package/src/components/ui/Input/types.ts +3 -2
- package/src/components/ui/Logo/Logo.tsx +2 -1
- package/src/components/ui/NavBar/NavBar.tsx +16 -2
- package/src/components/ui/NavBar/types.ts +5 -1
- package/src/components/ui/PasswordInput/PasswordInput.tsx +77 -43
- package/src/components/ui/PasswordInput/styles.ts +1 -1
- package/src/components/ui/PasswordInput/types.ts +7 -2
- package/src/components/ui/Pulse/Pulse.tsx +2 -1
- package/src/components/ui/Pulse/PulseDot.tsx +7 -6
- package/src/components/ui/Pulse/types.ts +6 -0
- package/src/components/ui/Pulse/usePulse.web.ts +50 -33
- package/src/components/ui/Radio/Radio.tsx +29 -6
- package/src/components/ui/Radio/RadioGroup.tsx +10 -3
- package/src/components/ui/Radio/styles.ts +9 -2
- package/src/components/ui/Reveal/Reveal.web.tsx +18 -3
- package/src/components/ui/Search/Search.tsx +22 -9
- package/src/components/ui/Search/types.ts +7 -1
- package/src/components/ui/Segmented/Segmented.tsx +8 -3
- package/src/components/ui/Segmented/styles.ts +4 -2
- package/src/components/ui/Segmented/types.ts +2 -0
- package/src/components/ui/Skeleton/Skeleton.tsx +9 -8
- package/src/components/ui/Spinner/Spinner.tsx +17 -17
- package/src/components/ui/Spinner/Spinner.web.tsx +7 -15
- package/src/components/ui/Spinner/shared.ts +37 -0
- package/src/components/ui/StatusDot/StatusDot.tsx +21 -3
- package/src/components/ui/StatusDot/styles.ts +1 -1
- package/src/components/ui/StatusDot/types.ts +14 -1
- package/src/components/ui/Stepper/Stepper.tsx +45 -10
- package/src/components/ui/Switch/Switch.tsx +4 -10
- package/src/components/ui/Switch/Switch.web.tsx +2 -8
- package/src/components/ui/Switch/styles.ts +10 -1
- package/src/components/ui/TabBar/TabBar.tsx +14 -6
- package/src/components/ui/TabBar/styles.ts +9 -21
- package/src/components/ui/TabBar/types.ts +3 -0
- package/src/components/ui/Tabs/Tabs.tsx +24 -5
- package/src/components/ui/Tabs/styles.ts +6 -2
- package/src/components/ui/Tabs/types.ts +10 -1
- package/src/components/ui/Tag/styles.ts +18 -10
- package/src/components/ui/Tag/types.ts +6 -2
- package/src/components/ui/TextField/TextFieldBase.tsx +31 -6
- package/src/components/ui/Textarea/types.ts +2 -1
- package/src/components/ui/Thumbnail/Thumbnail.tsx +14 -3
- package/src/components/ui/Thumbnail/styles.ts +6 -2
- package/src/components/ui/Toast/ToastHost.tsx +16 -8
- package/src/components/ui/Toast/ToastHost.web.tsx +26 -4
- package/src/components/ui/Toast/styles.ts +2 -0
- package/src/components/ui/Toast/toast.ts +35 -2
- package/src/components/ui/Toast/types.ts +1 -1
- package/src/components/ui/shared/badgeStyles.ts +36 -0
- package/src/icons/data.ts +27 -0
- package/src/icons/types.ts +25 -10
- package/src/theme/colors.ts +29 -10
- package/src/theme/index.ts +10 -1
- package/src/theme/scale.ts +5 -1
- package/src/theme/shadow.ts +33 -24
- package/src/theme/tokens.ts +10 -5
- package/src/theme/usePrefersReducedMotion.ts +9 -0
- package/src/theme/usePrefersReducedMotion.web.ts +27 -0
- package/src/theme/useTheme.ts +15 -0
- package/src/utils/logger/logger.ts +5 -1
- package/src/utils/testID/testID.ts +6 -3
- package/lib/module/components/index.js +0 -5
- package/lib/module/components/index.js.map +0 -1
- package/lib/typescript/src/components/index.d.ts +0 -3
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/src/components/index.ts +0 -2
|
@@ -3,12 +3,16 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
5
|
import { Pressable } from 'react-native-gesture-handler';
|
|
6
|
-
import { useThemedStyles } from "../../../theme/index.js";
|
|
6
|
+
import { fixed, pressedOpacity, useThemedStyles } from "../../../theme/index.js";
|
|
7
7
|
import { createLogger } from "../../../utils/logger/index.js";
|
|
8
|
+
import { childTestID } from "../../../utils/testID/index.js";
|
|
8
9
|
import { makeStyles, sizingFor } from "./styles.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const log = createLogger('Stepper');
|
|
11
12
|
|
|
13
|
+
// [L-30] 模块级 Set 去重 —— step/min/max 告警只打一次,避免渲染阶段刷屏
|
|
14
|
+
const _warned = new Set();
|
|
15
|
+
|
|
12
16
|
/**
|
|
13
17
|
* 数字步进器 [−][ N ][+]。
|
|
14
18
|
* 按钮自动夹到 min/max;越界的按钮透明度变 0.4。
|
|
@@ -28,11 +32,22 @@ export function Stepper({
|
|
|
28
32
|
}) {
|
|
29
33
|
const styles = useThemedStyles(makeStyles);
|
|
30
34
|
const dims = sizingFor(size);
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
|
|
36
|
+
// [L-30] step 口径对齐:非有限数(NaN/Infinity)也告警,与 min>max 告警保持一致
|
|
37
|
+
// 模块级 Set 去重:每个异常组合只打一次告警,避免渲染阶段重复刷屏
|
|
38
|
+
if (!Number.isFinite(step) || step <= 0) {
|
|
39
|
+
const k = `step:${step}`;
|
|
40
|
+
if (!_warned.has(k)) {
|
|
41
|
+
_warned.add(k);
|
|
42
|
+
log.warn(`step 必须是有限正数,传入 ${step},已 fallback 为 1`);
|
|
43
|
+
}
|
|
33
44
|
}
|
|
34
45
|
if (Number.isFinite(min) && Number.isFinite(max) && min > max) {
|
|
35
|
-
|
|
46
|
+
const k = `minmax:${min}:${max}`;
|
|
47
|
+
if (!_warned.has(k)) {
|
|
48
|
+
_warned.add(k);
|
|
49
|
+
log.warn(`min(${min}) 不能大于 max(${max}),已按 min 渲染`);
|
|
50
|
+
}
|
|
36
51
|
}
|
|
37
52
|
const safeStep = Number.isFinite(step) && step > 0 ? step : 1;
|
|
38
53
|
const safeMin = Number.isFinite(min) ? min : 0;
|
|
@@ -41,8 +56,14 @@ export function Stepper({
|
|
|
41
56
|
const safeValue = Number.isNaN(value) ? safeMin : Math.min(safeMax, Math.max(safeMin, value));
|
|
42
57
|
const decDisabled = disabled || safeValue <= safeMin;
|
|
43
58
|
const incDisabled = disabled || safeValue >= safeMax;
|
|
59
|
+
|
|
60
|
+
// [M-7] 按钮高 sm=28 / md=32 均低于 fixed.hitTarget=44;hitSlop 不越父边界,
|
|
61
|
+
// 须让容器一并扩展:wrap 加垂直 padding 把命中区撑到 44pt。
|
|
62
|
+
const wrapPaddingV = Math.max(0, Math.round((fixed.hitTarget - dims.h) / 2));
|
|
44
63
|
return /*#__PURE__*/_jsxs(View, {
|
|
45
|
-
style: styles.wrap,
|
|
64
|
+
style: [styles.wrap, {
|
|
65
|
+
paddingVertical: wrapPaddingV
|
|
66
|
+
}],
|
|
46
67
|
testID: testID,
|
|
47
68
|
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
48
69
|
onPress: () => onChange(Math.max(safeMin, safeValue - safeStep)),
|
|
@@ -53,31 +74,46 @@ export function Stepper({
|
|
|
53
74
|
disabled: decDisabled
|
|
54
75
|
},
|
|
55
76
|
accessibilityHint: `当前值 ${safeValue},减 ${safeStep}`,
|
|
56
|
-
testID: testID
|
|
77
|
+
testID: childTestID(testID, 'decrement'),
|
|
57
78
|
style: ({
|
|
58
79
|
pressed
|
|
59
80
|
}) => [styles.cell, styles.btnLeft, {
|
|
60
81
|
width: dims.btn,
|
|
61
82
|
height: dims.h
|
|
62
83
|
}, {
|
|
63
|
-
opacity: decDisabled ? 0.4 : pressed ?
|
|
84
|
+
opacity: decDisabled ? 0.4 : pressed ? pressedOpacity : 1
|
|
64
85
|
}],
|
|
65
86
|
children: /*#__PURE__*/_jsx(Text, {
|
|
66
87
|
style: styles.btnText,
|
|
67
88
|
children: "\u2212"
|
|
68
89
|
})
|
|
69
90
|
}), /*#__PURE__*/_jsx(View, {
|
|
91
|
+
accessible: true,
|
|
70
92
|
accessibilityRole: "adjustable",
|
|
71
93
|
accessibilityValue: {
|
|
72
94
|
min: safeMin,
|
|
73
95
|
max: safeMax,
|
|
74
96
|
now: safeValue
|
|
75
97
|
},
|
|
98
|
+
accessibilityActions: [{
|
|
99
|
+
name: 'increment',
|
|
100
|
+
label: '增加'
|
|
101
|
+
}, {
|
|
102
|
+
name: 'decrement',
|
|
103
|
+
label: '减少'
|
|
104
|
+
}],
|
|
105
|
+
onAccessibilityAction: e => {
|
|
106
|
+
if (e.nativeEvent.actionName === 'increment' && !incDisabled) {
|
|
107
|
+
onChange(Math.min(safeMax, safeValue + safeStep));
|
|
108
|
+
} else if (e.nativeEvent.actionName === 'decrement' && !decDisabled) {
|
|
109
|
+
onChange(Math.max(safeMin, safeValue - safeStep));
|
|
110
|
+
}
|
|
111
|
+
},
|
|
76
112
|
style: [styles.cell, {
|
|
77
113
|
minWidth: dims.w,
|
|
78
114
|
height: dims.h
|
|
79
115
|
}],
|
|
80
|
-
testID: testID
|
|
116
|
+
testID: childTestID(testID, 'value'),
|
|
81
117
|
children: /*#__PURE__*/_jsx(Text, {
|
|
82
118
|
style: [styles.valueText, {
|
|
83
119
|
fontSize: dims.fs
|
|
@@ -93,14 +129,14 @@ export function Stepper({
|
|
|
93
129
|
disabled: incDisabled
|
|
94
130
|
},
|
|
95
131
|
accessibilityHint: `当前值 ${safeValue},加 ${safeStep}`,
|
|
96
|
-
testID: testID
|
|
132
|
+
testID: childTestID(testID, 'increment'),
|
|
97
133
|
style: ({
|
|
98
134
|
pressed
|
|
99
135
|
}) => [styles.cell, styles.btnRight, {
|
|
100
136
|
width: dims.btn,
|
|
101
137
|
height: dims.h
|
|
102
138
|
}, {
|
|
103
|
-
opacity: incDisabled ? 0.4 : pressed ?
|
|
139
|
+
opacity: incDisabled ? 0.4 : pressed ? pressedOpacity : 1
|
|
104
140
|
}],
|
|
105
141
|
children: /*#__PURE__*/_jsx(Text, {
|
|
106
142
|
style: styles.btnText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Pressable","useThemedStyles","createLogger","makeStyles","sizingFor","jsx","_jsx","jsxs","_jsxs","log","Stepper","value","onChange","min","max","step","size","disabled","testID","styles","dims","Number","isFinite","warn","safeStep","safeMin","safeMax","safeValue","isNaN","Math","decDisabled","incDisabled","style","wrap","children","onPress","accessibilityRole","accessibilityLabel","accessibilityState","accessibilityHint","
|
|
1
|
+
{"version":3,"names":["React","Text","View","Pressable","fixed","pressedOpacity","useThemedStyles","createLogger","childTestID","makeStyles","sizingFor","jsx","_jsx","jsxs","_jsxs","log","_warned","Set","Stepper","value","onChange","min","max","step","size","disabled","testID","styles","dims","Number","isFinite","k","has","add","warn","safeStep","safeMin","safeMax","safeValue","isNaN","Math","decDisabled","incDisabled","wrapPaddingV","round","hitTarget","h","style","wrap","paddingVertical","children","onPress","accessibilityRole","accessibilityLabel","accessibilityState","accessibilityHint","pressed","cell","btnLeft","width","btn","height","opacity","btnText","accessible","accessibilityValue","now","accessibilityActions","name","label","onAccessibilityAction","e","nativeEvent","actionName","minWidth","w","valueText","fontSize","fs","btnRight"],"sourceRoot":"../../../../../src","sources":["components/ui/Stepper/Stepper.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,KAAK,EAAEC,cAAc,EAAEC,eAAe,QAAQ,yBAAgB;AACvE,SAASC,YAAY,QAAQ,gCAAuB;AACpD,SAASC,WAAW,QAAQ,gCAAuB;AACnD,SAASC,UAAU,EAAEC,SAAS,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGjD,MAAMC,GAAG,GAAGR,YAAY,CAAC,SAAS,CAAC;;AAEnC;AACA,MAAMS,OAAO,GAAG,IAAIC,GAAG,CAAS,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAAC;E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ler';
|
|
5
5
|
import Animated, { cancelAnimation, interpolate, interpolateColor, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
6
|
-
import { motion, r, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
7
|
-
import {
|
|
6
|
+
import { fixed, motion, r, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
7
|
+
import { makeStyles, THUMB_OFF_X, THUMB_ON_X, TRACK_H } from "./styles.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
// ─── 动画派生常量(组件私有,非 style)─────────────────────────────────────
|
|
10
|
-
// 把手 translateX 的 off / on 端点:左右各留 INSET 间距,
|
|
11
|
-
// off = INSET(2),on = trackW - INSET - thumbW(32-2-16=14)。
|
|
12
|
-
// 走 r() 保证多设备缩放跟 track / thumb 物理尺寸一致(否则非设计基准设备会错位)。
|
|
13
|
-
const THUMB_OFF_X = r(INSET);
|
|
14
|
-
const THUMB_ON_X = r(TRACK_W - INSET - THUMB);
|
|
15
|
-
|
|
16
9
|
/**
|
|
17
10
|
* 布尔切换。32×20 轨道 + 16×16 白色把手,200ms 缓动。
|
|
18
11
|
*
|
|
@@ -45,8 +38,10 @@ export function Switch({
|
|
|
45
38
|
}));
|
|
46
39
|
return /*#__PURE__*/_jsx(Pressable, {
|
|
47
40
|
onPress: () => !disabled && onChange(!value),
|
|
48
|
-
disabled: disabled
|
|
49
|
-
|
|
41
|
+
disabled: disabled
|
|
42
|
+
// [M-7] 轨道高 r(20)≈20pt;补 (44-20)/2=12 到 fixed.hitTarget
|
|
43
|
+
,
|
|
44
|
+
hitSlop: Math.round((fixed.hitTarget - r(TRACK_H)) / 2),
|
|
50
45
|
style: disabled ? styles.pressableDisabled : styles.pressableEnabled,
|
|
51
46
|
accessibilityRole: "switch",
|
|
52
47
|
accessibilityState: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","Pressable","Animated","cancelAnimation","interpolate","interpolateColor","useAnimatedStyle","useSharedValue","withTiming","motion","r","useColors","useThemedStyles","
|
|
1
|
+
{"version":3,"names":["React","useEffect","Pressable","Animated","cancelAnimation","interpolate","interpolateColor","useAnimatedStyle","useSharedValue","withTiming","fixed","motion","r","useColors","useThemedStyles","makeStyles","THUMB_OFF_X","THUMB_ON_X","TRACK_H","jsx","_jsx","Switch","value","onChange","disabled","accessibilityLabel","testID","c","styles","progress","duration","base","trackStyle","backgroundColor","surfaceContainerHighest","primary","thumbStyle","transform","translateX","onPress","hitSlop","Math","round","hitTarget","style","pressableDisabled","pressableEnabled","accessibilityRole","accessibilityState","checked","children","View","track","thumb"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/Switch.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,SAAS,QAAQ,8BAA8B;AAExD,OAAOC,QAAQ,IACbC,eAAe,EACfC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,KAAK,EAAEC,MAAM,EAAEC,CAAC,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AAC7E,SAASC,UAAU,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGxE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,MAAMA,CAAC;EACrBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,kBAAkB;EAClBC;AACW,CAAC,EAAqB;EACjC,MAAMC,CAAC,GAAGd,SAAS,CAAC,CAAC;EACrB,MAAMe,MAAM,GAAGd,eAAe,CAACC,UAAU,CAAC;EAC1C,MAAMc,QAAQ,GAAGrB,cAAc,CAACc,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;EAE9CrB,SAAS,CAAC,MAAM;IACd4B,QAAQ,CAACP,KAAK,GAAGb,UAAU,CAACa,KAAK,GAAG,CAA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ACgD,IAAI;MAACP,KAAK,EAAE,CAAChB,MAAM,CAACwB,KAAK,EAAEpB,UAAU,CAAE;MAAAkB,QAAA,eAC/C9B,IAAA,CAACjB,QAAQ,CAACgD,IAAI;QAACP,KAAK,EAAE,CAAChB,MAAM,CAACyB,KAAK,EAAEjB,UAAU;MAAE,CAAE;IAAC,CACvC;EAAC,CACP,CAAC;AAEhB","ignoreList":[]}
|
|
@@ -3,15 +3,9 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Pressable } from 'react-native-gesture-handler';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
|
-
import { motion,
|
|
7
|
-
import {
|
|
6
|
+
import { motion, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
7
|
+
import { makeStyles, THUMB_OFF_X, THUMB_ON_X } from "./styles.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
// ─── 动画派生常量(组件私有,非 style)─────────────────────────────────────
|
|
10
|
-
// 把手 translateX 的 off / on 端点:左右各留 INSET 间距,
|
|
11
|
-
// off = INSET(2),on = trackW - INSET - thumbW(32-2-16=14)。
|
|
12
|
-
const THUMB_OFF_X = r(INSET);
|
|
13
|
-
const THUMB_ON_X = r(TRACK_W - INSET - THUMB);
|
|
14
|
-
|
|
15
9
|
/**
|
|
16
10
|
* Web 端 Switch —— RN-Web 上 reanimated 4 + worklets 0.9.x 的 useAnimatedStyle
|
|
17
11
|
* 链路会抛 `Object.keys(undefined)` TypeError(切换时打印,thumb 卡住),走 CSS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Pressable","View","motion","
|
|
1
|
+
{"version":3,"names":["React","Pressable","View","motion","useColors","useThemedStyles","makeStyles","THUMB_OFF_X","THUMB_ON_X","jsx","_jsx","Switch","value","onChange","disabled","accessibilityLabel","testID","c","styles","trackWebStyle","track","backgroundColor","primary","surfaceContainerHighest","transitionProperty","transitionDuration","base","transitionTimingFunction","thumbWebStyle","thumb","transform","translateX","onPress","hitSlop","style","pressableDisabled","pressableEnabled","accessibilityRole","accessibilityState","checked","children"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/Switch.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AACnE,SAASC,UAAU,EAAEC,WAAW,EAAEC,UAAU,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,MAAMA,CAAC;EACrBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,kBAAkB;EAClBC;AACW,CAAC,EAAqB;EACjC,MAAMC,CAAC,GAAGb,SAAS,CAAC,CAAC;EACrB,MAAMc,MAAM,GAAGb,eAAe,CAACC,UAAU,CAAC;;EAE1C;EACA,MAAMa,aAAa,GAAG;IACpB,GAAGD,MAAM,CAACE,KAAK;IACfC,eAAe,EAAET,KAAK,GAAGK,CAAC,CAACK,OAAO,GAAGL,CAAC,CAACM,uBAAuB;IAC9D;IACAC,kBAAkB,EAAE,kBAAkB;IACtCC,kBAAkB,EAAE,GAAGtB,MAAM,CAACuB,IAAI,IAAI;IACtCC,wBAAwB,EAAE;EAC5B,CAAsB;EACtB,MAAMC,aAAa,GAAG;IACpB,GAAGV,MAAM,CAACW,KAAK;IACfC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAEnB,KAAK,GAAGJ,UAAU,GAAGD;IAAY,CAAC,CAAC;IAC7DiB,kBAAkB,EAAE,WAAW;IAC/BC,kBAAkB,EAAE,GAAGtB,MAAM,CAACuB,IAAI,IAAI;IACtCC,wBAAwB,EAAE;EAC5B,CAAsB;EAEtB,oBACEjB,IAAA,CAACT,SAAS;IACR+B,OAAO,EAAEA,CAAA,KAAM,CAAClB,QAAQ,IAAID,QAAQ,CAAC,CAACD,KAAK,CAAE;IAC7CE,QAAQ,EAAEA,QAAS;IACnBmB,OAAO,EAAE,CAAE;IACXC,KAAK,EAAEpB,QAAQ,GAAGI,MAAM,CAACiB,iBAAiB,GAAGjB,MAAM,CAACkB,gBAAiB;IACrEC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAE;MAAEC,OAAO,EAAE3B,KAAK;MAAEE,QAAQ,EAAE,CAAC,CAACA;IAAS,CAAE;IAC7DC,kBAAkB,EAAEA,kBAAmB;IACvCC,MAAM,EAAEA,MAAO;IAAAwB,QAAA,eAEf9B,IAAA,CAACR,IAAI;MAACgC,KAAK,EAAEf,aAAc;MAAAqB,QAAA,eACzB9B,IAAA,CAACR,IAAI;QAACgC,KAAK,EAAEN;MAAc,CAAE;IAAC,CAC1B;EAAC,CACE,CAAC;AAEhB","ignoreList":[]}
|
|
@@ -8,12 +8,20 @@ export const TRACK_W = 32;
|
|
|
8
8
|
export const TRACK_H = 20;
|
|
9
9
|
export const THUMB = 16;
|
|
10
10
|
export const INSET = 2;
|
|
11
|
+
|
|
12
|
+
/** [M-25] 把手 translateX 端点 —— 与 styles 同源导出,Switch.tsx / Switch.web.tsx 两端 import。
|
|
13
|
+
* off = INSET(2),on = TRACK_W - INSET - THUMB(32-2-16=14)。走 r() 保证多设备缩放一致。 */
|
|
14
|
+
export const THUMB_OFF_X = r(INSET);
|
|
15
|
+
export const THUMB_ON_X = r(TRACK_W - INSET - THUMB);
|
|
11
16
|
export const makeStyles = c => StyleSheet.create({
|
|
12
17
|
pressableEnabled: {
|
|
13
|
-
opacity: 1
|
|
18
|
+
opacity: 1,
|
|
19
|
+
// [L-37] alignSelf:'flex-start' 防止父容器拉伸把手区域(与 Chip [M-8] 同口径)
|
|
20
|
+
alignSelf: 'flex-start'
|
|
14
21
|
},
|
|
15
22
|
pressableDisabled: {
|
|
16
|
-
opacity: 0.5
|
|
23
|
+
opacity: 0.5,
|
|
24
|
+
alignSelf: 'flex-start'
|
|
17
25
|
},
|
|
18
26
|
track: {
|
|
19
27
|
width: r(TRACK_W),
|
|
@@ -24,7 +32,8 @@ export const makeStyles = c => StyleSheet.create({
|
|
|
24
32
|
thumb: {
|
|
25
33
|
width: r(THUMB),
|
|
26
34
|
height: r(THUMB),
|
|
27
|
-
|
|
35
|
+
// [L-79] radius.pill —— sentinel 999 确保把手始终是真圆
|
|
36
|
+
borderRadius: radius.pill,
|
|
28
37
|
backgroundColor: c.onPrimary
|
|
29
38
|
}
|
|
30
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","r","radius","TRACK_W","TRACK_H","THUMB","INSET","makeStyles","c","create","pressableEnabled","opacity","pressableDisabled","track","width","height","borderRadius","lg","justifyContent","thumb","
|
|
1
|
+
{"version":3,"names":["StyleSheet","r","radius","TRACK_W","TRACK_H","THUMB","INSET","THUMB_OFF_X","THUMB_ON_X","makeStyles","c","create","pressableEnabled","opacity","alignSelf","pressableDisabled","track","width","height","borderRadius","lg","justifyContent","thumb","pill","backgroundColor","onPrimary"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,CAAC,EAAEC,MAAM,QAAQ,yBAAgB;AAG1C;AACA;AACA,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,KAAK,GAAG,EAAE;AACvB,OAAO,MAAMC,KAAK,GAAG,CAAC;;AAEtB;AACA;AACA,OAAO,MAAMC,WAAW,GAAGN,CAAC,CAACK,KAAK,CAAC;AACnC,OAAO,MAAME,UAAU,GAAGP,CAAC,CAACE,OAAO,GAAGG,KAAK,GAAGD,KAAK,CAAC;AAEpD,OAAO,MAAMI,UAAU,GAAIC,CAAc,IACvCV,UAAU,CAACW,MAAM,CAAC;EAChBC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,CAAC;IACV;IACAC,SAAS,EAAE;EACb,CAAC;EACDC,iBAAiB,EAAE;IACjBF,OAAO,EAAE,GAAG;IACZC,SAAS,EAAE;EACb,CAAC;EACDE,KAAK,EAAE;IACLC,KAAK,EAAEhB,CAAC,CAACE,OAAO,CAAC;IACjBe,MAAM,EAAEjB,CAAC,CAACG,OAAO,CAAC;IAClBe,YAAY,EAAEjB,MAAM,CAACkB,EAAE;IACvBC,cAAc,EAAE;EAClB,CAAC;EACDC,KAAK,EAAE;IACLL,KAAK,EAAEhB,CAAC,CAACI,KAAK,CAAC;IACfa,MAAM,EAAEjB,CAAC,CAACI,KAAK,CAAC;IAChB;IACAc,YAAY,EAAEjB,MAAM,CAACqB,IAAI;IACzBC,eAAe,EAAEd,CAAC,CAACe;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,48 +3,52 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
5
|
import { Pressable } from 'react-native-gesture-handler';
|
|
6
|
-
import {
|
|
6
|
+
import { pressedOpacity, r, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
7
7
|
import { childTestID } from "../../../utils/testID/index.js";
|
|
8
8
|
import { Icon } from "../Icon/index.js";
|
|
9
9
|
import { makeStyles } from "./styles.js";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
/**
|
|
12
12
|
* 固定底部 tab bar —— App 主导航。
|
|
13
|
-
* 高 50px,顶部一条细线边框。激活色:primary
|
|
13
|
+
* 高 50px,顶部一条细线边框。激活色:primary。
|
|
14
14
|
* 想留 home indicator 的安全区,请外面包一层 `<SafeAreaView edges={['bottom']}>`。
|
|
15
15
|
*/
|
|
16
16
|
export function TabBar({
|
|
17
17
|
active,
|
|
18
18
|
onChange,
|
|
19
19
|
items,
|
|
20
|
+
style,
|
|
20
21
|
testID
|
|
21
22
|
}) {
|
|
22
23
|
const c = useColors();
|
|
23
24
|
const styles = useThemedStyles(makeStyles);
|
|
24
25
|
return /*#__PURE__*/_jsx(View, {
|
|
25
|
-
style: styles.bar,
|
|
26
|
+
style: [styles.bar, style],
|
|
26
27
|
testID: testID,
|
|
28
|
+
accessibilityRole: "tablist",
|
|
27
29
|
children: items.map(item => {
|
|
28
30
|
const on = item.id === active;
|
|
29
31
|
const tint = on ? c.primary : c.foregroundSubtle;
|
|
30
32
|
const itemTestID = childTestID(testID, item.id, item.testID);
|
|
33
|
+
// a11y label 包含角标数量,SR 用户知晓待处理条目数(如"消息,3条未读")
|
|
34
|
+
const a11yLabel = item.badge != null ? `${item.label},${item.badge}条未读` : item.label;
|
|
31
35
|
return /*#__PURE__*/_jsxs(Pressable, {
|
|
32
36
|
onPress: () => onChange(item.id),
|
|
33
37
|
accessibilityRole: "tab",
|
|
34
38
|
accessibilityState: {
|
|
35
39
|
selected: on
|
|
36
40
|
},
|
|
37
|
-
accessibilityLabel:
|
|
41
|
+
accessibilityLabel: a11yLabel,
|
|
38
42
|
testID: itemTestID,
|
|
39
43
|
style: ({
|
|
40
44
|
pressed
|
|
41
45
|
}) => [styles.tab, {
|
|
42
|
-
opacity: pressed ?
|
|
46
|
+
opacity: pressed ? pressedOpacity : 1
|
|
43
47
|
}],
|
|
44
48
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
45
49
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
46
50
|
name: item.icon,
|
|
47
|
-
size:
|
|
51
|
+
size: r(22),
|
|
48
52
|
color: tint
|
|
49
53
|
}), item.badge != null ? /*#__PURE__*/_jsx(View, {
|
|
50
54
|
style: styles.badge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Pressable","
|
|
1
|
+
{"version":3,"names":["React","Text","View","Pressable","pressedOpacity","r","useColors","useThemedStyles","childTestID","Icon","makeStyles","jsx","_jsx","jsxs","_jsxs","TabBar","active","onChange","items","style","testID","c","styles","bar","accessibilityRole","children","map","item","on","id","tint","primary","foregroundSubtle","itemTestID","a11yLabel","badge","label","onPress","accessibilityState","selected","accessibilityLabel","pressed","tab","opacity","name","icon","size","color","badgeText","numberOfLines"],"sourceRoot":"../../../../../src","sources":["components/ui/TabBar/TabBar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,cAAc,EAAEC,CAAC,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AAC9E,SAASC,WAAW,QAAQ,gCAAuB;AACnD,SAASC,IAAI,QAAQ,kBAAS;AAC9B,SAASC,UAAU,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGtC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,MAAMA,CAAC;EACrBC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,KAAK;EACLC;AACW,CAAC,EAAqB;EACjC,MAAMC,CAAC,GAAGf,SAAS,CAAC,CAAC;EACrB,MAAMgB,MAAM,GAAGf,eAAe,CAACG,UAAU,CAAC;EAC1C,oBACEE,IAAA,CAACV,IAAI;IACHiB,KAAK,EAAE,CAACG,MAAM,CAACC,GAAG,EAAEJ,KAAK,CAAE;IAC3BC,MAAM,EAAEA,MAAO;IACfI,iBAAiB,EAAC,SAAS;IAAAC,QAAA,EAE1BP,KAAK,CAACQ,GAAG,CAAEC,IAAI,IAAK;MACnB,MAAMC,EAAE,GAAGD,IAAI,CAACE,EAAE,KAAKb,MAAM;MAC7B,MAAMc,IAAI,GAAGF,EAAE,GAAGP,CAAC,CAACU,OAAO,GAAGV,CAAC,CAACW,gBAAgB;MAChD,MAAMC,UAAU,GAAGzB,WAAW,CAACY,MAAM,EAAEO,IAAI,CAACE,EAAE,EAAEF,IAAI,CAACP,MAAM,CAAC;MAC5D;MACA,MAAMc,SAAS,GACbP,IAAI,CAACQ,KA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EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
|
-
import { fixed, fw, r,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
paddingHorizontal: space[1],
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
justifyContent: 'center'
|
|
35
|
-
},
|
|
36
|
-
badgeText: {
|
|
37
|
-
color: c.onError,
|
|
38
|
-
fontSize: t.nano,
|
|
39
|
-
fontWeight: fw.bold,
|
|
40
|
-
lineHeight: 12
|
|
41
|
-
}
|
|
42
|
-
});
|
|
4
|
+
import { fixed, fw, r, type as t } from "../../../theme/index.js";
|
|
5
|
+
import { badgeStyles } from "../shared/badgeStyles.js";
|
|
6
|
+
export const makeStyles = c => {
|
|
7
|
+
// TabBar 图标 22pt,角标上边缘偏移 r(-3):使圆心落在图标右上角
|
|
8
|
+
const badge = badgeStyles(c, r(-3));
|
|
9
|
+
return StyleSheet.create({
|
|
10
|
+
bar: {
|
|
11
|
+
height: fixed.tabbarH,
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
backgroundColor: c.surface,
|
|
14
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
15
|
+
borderTopColor: c.outline
|
|
16
|
+
},
|
|
17
|
+
tab: {
|
|
18
|
+
flex: 1,
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
gap: r(2)
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
fontSize: t.nano,
|
|
25
|
+
fontWeight: fw.medium,
|
|
26
|
+
lineHeight: 12
|
|
27
|
+
},
|
|
28
|
+
badge: badge.badge,
|
|
29
|
+
badgeText: badge.badgeText
|
|
30
|
+
});
|
|
31
|
+
};
|
|
43
32
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","fixed","fw","r","
|
|
1
|
+
{"version":3,"names":["StyleSheet","fixed","fw","r","type","t","badgeStyles","makeStyles","c","badge","create","bar","height","tabbarH","flexDirection","backgroundColor","surface","borderTopWidth","hairlineWidth","borderTopColor","outline","tab","flex","alignItems","justifyContent","gap","label","fontSize","nano","fontWeight","medium","lineHeight","badgeText"],"sourceRoot":"../../../../../src","sources":["components/ui/TabBar/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,KAAK,EAAEC,EAAE,EAAEC,CAAC,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AACxD,SAASC,WAAW,QAAQ,0BAAuB;AAEnD,OAAO,MAAMC,UAAU,GAAIC,CAAc,IAAK;EAC5C;EACA,MAAMC,KAAK,GAAGH,WAAW,CAACE,CAAC,EAAEL,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACnC,OAAOH,UAAU,CAACU,MAAM,CAAC;IACvBC,GAAG,EAAE;MACHC,MAAM,EAAEX,KAAK,CAACY,OAAO;MACrBC,aAAa,EAAE,KAAK;MACpBC,eAAe,EAAEP,CAAC,CAACQ,OAAO;MAC1BC,cAAc,EAAEjB,UAAU,CAACkB,aAAa;MACxCC,cAAc,EAAEX,CAAC,CAACY;IACpB,CAAC;IACDC,GAAG,EAAE;MACHC,IAAI,EAAE,CAAC;MACPC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,GAAG,EAAEtB,CAAC,CAAC,CAAC;IACV,CAAC;IACDuB,KAAK,EAAE;MACLC,QAAQ,EAAEtB,CAAC,CAACuB,IAAI;MAChBC,UAAU,EAAE3B,EAAE,CAAC4B,MAAM;MACrBC,UAAU,EAAE;IACd,CAAC;IACDtB,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBuB,SAAS,EAAEvB,KAAK,CAACuB;EACnB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
5
|
import { Pressable } from 'react-native-gesture-handler';
|
|
6
|
-
import { useColors, useThemedStyles
|
|
6
|
+
import { fw, pressedOpacity, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
7
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
7
8
|
import { childTestID } from "../../../utils/testID/index.js";
|
|
8
9
|
import { makeStyles } from "./styles.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const log = createLogger('Tabs');
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* 页面级下划线 tabs。
|
|
12
15
|
* 占满宽度,高 44px,激活项下方有 2px 主色下划线。
|
|
@@ -15,28 +18,39 @@ export function Tabs({
|
|
|
15
18
|
value,
|
|
16
19
|
onChange,
|
|
17
20
|
items,
|
|
21
|
+
disabled: allDisabled = false,
|
|
22
|
+
style,
|
|
18
23
|
testID
|
|
19
24
|
}) {
|
|
20
25
|
const c = useColors();
|
|
21
26
|
const styles = useThemedStyles(makeStyles);
|
|
27
|
+
// items 长度守卫 —— types 注释承诺「≥2 项才有意义」,此处对违规使用方 dev warn。
|
|
28
|
+
// 不 return null:渲染空 tablist 比渲染单 tab 更符合 a11y 预期,且不破坏 hook 调用顺序。
|
|
29
|
+
if (items.length < 2) {
|
|
30
|
+
log.warn(`Tabs 至少需要 2 项,当前传入 ${items.length} 项`);
|
|
31
|
+
}
|
|
22
32
|
return /*#__PURE__*/_jsx(View, {
|
|
23
|
-
style: styles.under,
|
|
33
|
+
style: [styles.under, style],
|
|
24
34
|
testID: testID,
|
|
35
|
+
accessibilityRole: "tablist",
|
|
25
36
|
children: items.map(it => {
|
|
26
37
|
const on = it.id === value;
|
|
38
|
+
const itemDisabled = allDisabled || (it.disabled ?? false);
|
|
27
39
|
const itemTestID = childTestID(testID, it.id, it.testID);
|
|
28
40
|
return /*#__PURE__*/_jsxs(Pressable, {
|
|
29
|
-
onPress: () => onChange(it.id),
|
|
41
|
+
onPress: () => !itemDisabled && onChange(it.id),
|
|
42
|
+
disabled: itemDisabled,
|
|
30
43
|
accessibilityRole: "tab",
|
|
31
44
|
accessibilityState: {
|
|
32
|
-
selected: on
|
|
45
|
+
selected: on,
|
|
46
|
+
disabled: itemDisabled || undefined
|
|
33
47
|
},
|
|
34
48
|
accessibilityLabel: it.label,
|
|
35
49
|
testID: itemTestID,
|
|
36
50
|
style: ({
|
|
37
51
|
pressed
|
|
38
52
|
}) => [styles.underTab, {
|
|
39
|
-
opacity:
|
|
53
|
+
opacity: itemDisabled ? 0.4 : pressed ? pressedOpacity : 1
|
|
40
54
|
}],
|
|
41
55
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
42
56
|
style: [styles.underLabel, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Pressable","useColors","useThemedStyles","
|
|
1
|
+
{"version":3,"names":["React","Text","View","Pressable","fw","pressedOpacity","useColors","useThemedStyles","createLogger","childTestID","makeStyles","jsx","_jsx","jsxs","_jsxs","log","Tabs","value","onChange","items","disabled","allDisabled","style","testID","c","styles","length","warn","under","accessibilityRole","children","map","it","on","id","itemDisabled","itemTestID","onPress","accessibilityState","selected","undefined","accessibilityLabel","label","pressed","underTab","opacity","underLabel","color","primary","foregroundMuted","fontWeight","semi","medium","numberOfLines","underBar"],"sourceRoot":"../../../../../src","sources":["components/ui/Tabs/Tabs.tsx"],"mappings":";;AAAA,OAAOA,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AC;MACxD,oBACET,KAAA,CAACX,SAAS;QAERkC,OAAO,EAAEA,CAAA,KAAM,CAACF,YAAY,IAAIjB,QAAQ,CAACc,EAAE,CAACE,EAAE,CAAE;QAChDd,QAAQ,EAAEe,YAAa;QACvBN,iBAAiB,EAAC,KAAK;QACvBS,kBAAkB,EAAE;UAClBC,QAAQ,EAAEN,EAAE;UACZb,QAAQ,EAAEe,YAAY,IAAIK;QAC5B,CAAE;QACFC,kBAAkB,EAAET,EAAE,CAACU,KAAM;QAC7BnB,MAAM,EAAEa,UAAW;QACnBd,KAAK,EAAEA,CAAC;UAAEqB;QAAQ,CAAC,KAAK,CACtBlB,MAAM,CAACmB,QAAQ,EACf;UAAEC,OAAO,EAAEV,YAAY,GAAG,GAAG,GAAGQ,OAAO,GAAGtC,cAAc,GAAG;QAAE,CAAC,CAC9D;QAAAyB,QAAA,gBAEFlB,IAAA,CAACX,IAAI;UACHqB,KAAK,EAAE,CACLG,MAAM,CAACqB,UAAU,EACjB;YACEC,KAAK,EAAEd,EAAE,GAAGT,CAAC,CAACwB,OAAO,GAAGxB,CAAC,CAACyB,eAAe;YACzCC,UAAU,EAAEjB,EAAE,GAAG7B,EAAE,CAAC+C,IAAI,GAAG/C,EAAE,CAACgD;UAChC,CAAC,CACD;UACFC,aAAa,EAAE,CAAE;UAAAvB,QAAA,EAEhBE,EAAE,CAACU;QAAK,CACL,CAAC,EACNT,EAAE,gBAAGrB,IAAA,CAACV,IAAI;UAACoB,KAAK,EAAEG,MAAM,CAAC6B;QAAS,CAAE,CAAC,GAAG,IAAI;MAAA,GA3BxCtB,EAAE,CAACE,EA4BC,CAAC;IAEhB,CAAC;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
|
-
import { fixed,
|
|
4
|
+
import { fixed, r, type as t } from "../../../theme/index.js";
|
|
5
|
+
|
|
6
|
+
// 下划线宽度固定 36pt —— 视觉上比 tab 文字稍宽、比整个 tab 格窄,
|
|
7
|
+
// 刻意不用 icon.xl(语义是图标盒),此处是装饰性下划线,用具名常量自文档化。
|
|
8
|
+
const UNDER_BAR_WIDTH = r(36);
|
|
5
9
|
export const makeStyles = c => StyleSheet.create({
|
|
6
10
|
under: {
|
|
7
11
|
flexDirection: 'row',
|
|
@@ -22,7 +26,7 @@ export const makeStyles = c => StyleSheet.create({
|
|
|
22
26
|
position: 'absolute',
|
|
23
27
|
bottom: 0,
|
|
24
28
|
height: r(2),
|
|
25
|
-
width:
|
|
29
|
+
width: UNDER_BAR_WIDTH,
|
|
26
30
|
backgroundColor: c.primary,
|
|
27
31
|
borderRadius: r(1)
|
|
28
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","fixed","
|
|
1
|
+
{"version":3,"names":["StyleSheet","fixed","r","type","t","UNDER_BAR_WIDTH","makeStyles","c","create","under","flexDirection","backgroundColor","surface","borderBottomWidth","hairlineWidth","borderBottomColor","outline","underTab","flex","height","hitTarget","alignItems","justifyContent","underLabel","fontSize","sm","underBar","position","bottom","width","primary","borderRadius"],"sourceRoot":"../../../../../src","sources":["components/ui/Tabs/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,KAAK,EAAEC,CAAC,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;;AAEpD;AACA;AACA,MAAMC,eAAe,GAAGH,CAAC,CAAC,EAAE,CAAC;AAE7B,OAAO,MAAMI,UAAU,GAAIC,CAAc,IACvCP,UAAU,CAACQ,MAAM,CAAC;EAChBC,KAAK,EAAE;IACLC,aAAa,EAAE,KAAK;IACpBC,eAAe,EAAEJ,CAAC,CAACK,OAAO;IAC1BC,iBAAiB,EAAEb,UAAU,CAACc,aAAa;IAC3CC,iBAAiB,EAAER,CAAC,CAACS;EACvB,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE,CAAC;IACPC,MAAM,EAAElB,KAAK,CAACmB,SAAS;IACvBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDC,UAAU,EAAE;IACVC,QAAQ,EAAEpB,CAAC,CAACqB;EACd,CAAC;EACDC,QAAQ,EAAE;IACRC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTT,MAAM,EAAEjB,CAAC,CAAC,CAAC,CAAC;IACZ2B,KAAK,EAAExB,eAAe;IACtBM,eAAe,EAAEJ,CAAC,CAACuB,OAAO;IAC1BC,YAAY,EAAE7B,CAAC,CAAC,CAAC;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|