@unif/react-native-design 0.8.2 → 0.10.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 +1 -2
- 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 +45 -19
- 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 +1 -1
- 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 +30 -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
|
@@ -10,7 +10,7 @@ export declare const type: {
|
|
|
10
10
|
readonly xxs: number;
|
|
11
11
|
readonly micro: number;
|
|
12
12
|
readonly nano: number;
|
|
13
|
-
/** micro(11)与 xxs(12)之间:VersionPill /
|
|
13
|
+
/** micro(11)与 xxs(12)之间:VersionPill / Splash / carousel 副标题。 */
|
|
14
14
|
readonly microPlus: number;
|
|
15
15
|
/** xs(13)与 sm(14)之间:Privacy 长文阅读字号。 */
|
|
16
16
|
readonly xsPlus: number;
|
|
@@ -19,7 +19,7 @@ export declare const type: {
|
|
|
19
19
|
readonly smPlus: number;
|
|
20
20
|
/** Hero 区主标题档(一级 brand hero,带 Logo,Login 屏)。 */
|
|
21
21
|
readonly heroLg: number;
|
|
22
|
-
/** Hero 区中等档(独立屏 + NavBar 的二级 hero
|
|
22
|
+
/** Hero 区中等档(独立屏 + NavBar 的二级 hero)。 */
|
|
23
23
|
readonly heroMd: number;
|
|
24
24
|
/** Hero 区小档(承接式 hero,Group 选组/选角色子区)。 */
|
|
25
25
|
readonly heroSm: number;
|
|
@@ -82,7 +82,7 @@ export declare const control: {
|
|
|
82
82
|
};
|
|
83
83
|
/** 散尺寸 —— 未归到 avatar/icon/control 阶梯的单点常量。 */
|
|
84
84
|
export declare const dim: {
|
|
85
|
-
/** 发送按钮 32px ——
|
|
85
|
+
/** 发送按钮 32px —— 主送出/发送按钮专用,与 avatar.md 同值 */
|
|
86
86
|
readonly sendBtn: number;
|
|
87
87
|
};
|
|
88
88
|
/** 物理常量表 —— **不**参与缩放,在任何设备上保持同一物理尺寸。
|
|
@@ -99,4 +99,8 @@ export declare const motion: {
|
|
|
99
99
|
readonly slow: 300;
|
|
100
100
|
readonly pulse: 1600;
|
|
101
101
|
};
|
|
102
|
+
/** 按压态透明度 —— Pressable pressed 时 opacity 的共享常量。
|
|
103
|
+
* ButtonBase、Chip、Cell、Grid、EntryCard、Tabs、Segmented、TabBar 等
|
|
104
|
+
* 凡需要「按压反馈」的组件统一引用此值,避免散落多处手写 0.7 后不同步。 */
|
|
105
|
+
export declare const pressedOpacity = 0.7;
|
|
102
106
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/theme/tokens.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAInB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;IAYf,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/theme/tokens.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAInB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;IAYf,gEAAgE;;IAEhE,uCAAuC;;IAEvC;2DACuD;;IAEvD,gDAAgD;;IAEhD,wCAAwC;;IAExC,yCAAyC;;CAEjC,CAAC;AAEX,eAAO,MAAM,EAAE;;;;;;CAML,CAAC;AAEX,eAAO,MAAM,KAAK;;;;;;;;;;;;CAYR,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,MAAM;;;;;;CAMT,CAAC;AAEX;4DAC4D;AAC5D,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC;AAEX;;YAEY;AACZ,eAAO,MAAM,OAAO;;;;CAIV,CAAC;AAEX,8CAA8C;AAC9C,eAAO,MAAM,GAAG;IACd,6CAA6C;;CAErC,CAAC;AAEX;+BAC+B;AAC/B,eAAO,MAAM,KAAK;;;;;CAKR,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;CAKT,CAAC;AAEX;;4CAE4C;AAC5C,eAAO,MAAM,cAAc,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 系统「减弱动态效果」开关。
|
|
3
|
+
*
|
|
4
|
+
* native 端的动画由 reanimated 默认 `ReduceMotion.System` 处理(reduce-motion 下自动
|
|
5
|
+
* 跳到端值),此 hook 只有 web 平台的 CSS/JS 动画需要 —— native 恒返回 false,见 `.web.ts`。
|
|
6
|
+
*/
|
|
7
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
8
|
+
//# sourceMappingURL=usePrefersReducedMotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrefersReducedMotion.d.ts","sourceRoot":"","sources":["../../../../src/theme/usePrefersReducedMotion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrefersReducedMotion.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/usePrefersReducedMotion.web.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAcjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAiBvE,wBAAgB,QAAQ,IAAI,iBAAiB,CAW5C;AAED,wBAAgB,SAAS,mCAExB;AAED,wBAAgB,SAAS,oCAExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../../src/utils/logger/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAa,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAuCzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWlD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAED,wBAAgB,WAAW,IAAI,QAAQ,CAEtC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../../src/utils/logger/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAa,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAuCzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWlD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAED,wBAAgB,WAAW,IAAI,QAAQ,CAEtC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,CAKlD;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAIhD"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `childTestID` —— 把"父 testID + 子 id → 子 testID"的拼接逻辑收口。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Sources / ChainOfThought)重复同一三元:
|
|
4
|
+
* 本仓已接入的 list-like 组件(Tabs / Segmented / TabBar / Grid)原来各自重复:
|
|
6
5
|
*
|
|
7
6
|
* ```ts
|
|
8
7
|
* const itemTestID = item.testID ?? (testID ? `${testID}-${item.id}` : undefined);
|
|
9
8
|
* ```
|
|
10
9
|
*
|
|
11
10
|
* 抽 helper:
|
|
12
|
-
* - `override` 命中
|
|
11
|
+
* - `override` 命中(truthy)→ 用 caller 显式指定
|
|
13
12
|
* - 父 `parent` 缺失 → undefined(testID 不强制)
|
|
14
13
|
* - 都没问题 → `{parent}-{id}` 拼接
|
|
14
|
+
*
|
|
15
|
+
* 注意:与旧式 `??` 不同,**空串 override 视为未提供、回落拼接**。
|
|
16
|
+
* 这是刻意设计:空 testID 没有语义价值,用例已钉死此边界
|
|
17
|
+
* (`__tests__/utils/testID.test.ts:31-33`),勿改回 `??` 判定。
|
|
15
18
|
*/
|
|
16
19
|
export declare function childTestID(parent: string | undefined, id: string | number, override?: string): string | undefined;
|
|
17
20
|
//# sourceMappingURL=testID.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testID.d.ts","sourceRoot":"","sources":["../../../../../src/utils/testID/testID.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"testID.d.ts","sourceRoot":"","sources":["../../../../../src/utils/testID/testID.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAGpB"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unif/react-native-design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Unif 设计系统:theme + icons + utils + components",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"source": "./src/index.tsx",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import Svg, {
|
|
4
4
|
Defs,
|
|
@@ -7,6 +7,7 @@ import Svg, {
|
|
|
7
7
|
Stop,
|
|
8
8
|
} from 'react-native-svg';
|
|
9
9
|
import { avatarGradient, useTheme } from '../../../theme';
|
|
10
|
+
import { useSvgId } from '../useSvgId';
|
|
10
11
|
import { makeAvatarStyles } from './styles';
|
|
11
12
|
import type { AvatarWithRingProps } from './types';
|
|
12
13
|
|
|
@@ -22,17 +23,17 @@ export function AvatarWithRing({
|
|
|
22
23
|
size = 64,
|
|
23
24
|
ringColor,
|
|
24
25
|
style,
|
|
26
|
+
testID,
|
|
25
27
|
}: AvatarWithRingProps): React.JSX.Element {
|
|
26
28
|
const { colors: c, shadow } = useTheme();
|
|
27
|
-
const
|
|
28
|
-
const id = `av-${autoId.replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
29
|
+
const id = useSvgId('av');
|
|
29
30
|
const { inner, styles } = useMemo(
|
|
30
31
|
() =>
|
|
31
32
|
makeAvatarStyles(size, ringColor ?? c.avatarRing, shadow.brandAvatar, c),
|
|
32
33
|
[size, ringColor, c, shadow.brandAvatar]
|
|
33
34
|
);
|
|
34
35
|
return (
|
|
35
|
-
<View style={[styles.shell, style]}>
|
|
36
|
+
<View style={[styles.shell, style]} testID={testID}>
|
|
36
37
|
<View style={styles.avatarCore}>
|
|
37
38
|
<Svg width={inner} height={inner} style={StyleSheet.absoluteFill}>
|
|
38
39
|
<Defs>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { StyleSheet, type ViewStyle } from 'react-native';
|
|
2
2
|
import { fw, r, type ColorTokens } from '../../../theme';
|
|
3
|
+
import { createLogger } from '../../../utils/logger';
|
|
4
|
+
|
|
5
|
+
const log = createLogger('AvatarWithRing');
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* 头像样式工厂 —— **非标 maker 签名**:`(size, ringColor, shadowStyle, c)` 4 参,
|
|
@@ -26,9 +29,24 @@ export const makeAvatarStyles = (
|
|
|
26
29
|
shadowStyle: ViewStyle,
|
|
27
30
|
c: ColorTokens
|
|
28
31
|
) => {
|
|
29
|
-
|
|
32
|
+
// 防御非法 size:NaN / 负数 / 0 会导致 inner 为负传入 SVG。
|
|
33
|
+
// 最小合理值 = ringWidth*2 + 1(至少 1pt 圆心可见)。
|
|
34
|
+
// ringWidth 下限为 2(见下方 Math.max),所以 size 至少要大于 4pt。
|
|
35
|
+
const MIN_SIZE = 5;
|
|
36
|
+
const safeSize =
|
|
37
|
+
Number.isFinite(size) && size >= MIN_SIZE
|
|
38
|
+
? size
|
|
39
|
+
: (() => {
|
|
40
|
+
if (__DEV__) {
|
|
41
|
+
log.warn(
|
|
42
|
+
`AvatarWithRing: size=${size} 无效(须 ≥ ${MIN_SIZE}),已钳制为 ${MIN_SIZE}。`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return MIN_SIZE;
|
|
46
|
+
})();
|
|
47
|
+
const dim = r(safeSize);
|
|
30
48
|
const half = dim / 2;
|
|
31
|
-
const ringWidth = Math.max(2, r(Math.round(
|
|
49
|
+
const ringWidth = Math.max(2, r(Math.round(safeSize * 0.0625)));
|
|
32
50
|
const inner = dim - ringWidth * 2;
|
|
33
51
|
const innerHalf = inner / 2;
|
|
34
52
|
const styles = StyleSheet.create({
|
|
@@ -50,7 +68,7 @@ export const makeAvatarStyles = (
|
|
|
50
68
|
justifyContent: 'center',
|
|
51
69
|
},
|
|
52
70
|
label: {
|
|
53
|
-
fontSize: r(Math.round(
|
|
71
|
+
fontSize: r(Math.round(safeSize * 0.4)),
|
|
54
72
|
fontWeight: fw.bold,
|
|
55
73
|
color: c.onPrimary,
|
|
56
74
|
letterSpacing: -0.5,
|
|
@@ -8,8 +8,10 @@ export type AvatarWithRingProps = {
|
|
|
8
8
|
* 视觉占比:label 字号约 size * 0.40,ring 宽度约 size * 0.0625。
|
|
9
9
|
*/
|
|
10
10
|
size?: number;
|
|
11
|
-
/** ring
|
|
11
|
+
/** ring 颜色,默认 c.avatarRing(白系半透明)。 */
|
|
12
12
|
ringColor?: string;
|
|
13
13
|
/** 容器附加样式(margin / position 等定位)。 */
|
|
14
14
|
style?: StyleProp<ViewStyle>;
|
|
15
|
+
/** E2E / 测试定位 */
|
|
16
|
+
testID?: string;
|
|
15
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import Svg, {
|
|
4
4
|
Defs,
|
|
@@ -6,8 +6,48 @@ import Svg, {
|
|
|
6
6
|
Rect,
|
|
7
7
|
Stop,
|
|
8
8
|
} from 'react-native-svg';
|
|
9
|
+
import { useSvgId } from '../useSvgId';
|
|
9
10
|
import type { GradientWashProps } from './types';
|
|
10
11
|
|
|
12
|
+
/** 解析 rgba(r,g,b,a) 或 #RRGGBBAA 字符串拆出 alpha,返回 { color: rgb/hex, opacity }。
|
|
13
|
+
* 非支持格式(rgb / hex / named / hsl 等)原样返回 + opacity=1。
|
|
14
|
+
*
|
|
15
|
+
* 支持格式:
|
|
16
|
+
* - 逗号式 rgba(r,g,b,a) → 拆出 alpha
|
|
17
|
+
* - 8 位 hex #RRGGBBAA → 末两位转 alpha
|
|
18
|
+
* - 其它(rgb / hex6 / named) → 原样 + opacity=1
|
|
19
|
+
*
|
|
20
|
+
* Why:react-native-svg `<Stop stopColor>` 接 rgba 时 alpha 可能被忽略
|
|
21
|
+
* (stopColor 只解析 RGB,需要 stopOpacity 分离),拆分后跨平台一致。 */
|
|
22
|
+
export function parseRgba(color: string): { color: string; opacity: number } {
|
|
23
|
+
// 逗号式 rgba(r,g,b,a)
|
|
24
|
+
const mRgba = color.match(/^rgba\(([^)]+)\)$/);
|
|
25
|
+
if (mRgba?.[1]) {
|
|
26
|
+
const parts = mRgba[1].split(',').map((s) => s.trim());
|
|
27
|
+
if (parts.length === 4) {
|
|
28
|
+
const alphaStr = parts[3];
|
|
29
|
+
if (alphaStr !== undefined) {
|
|
30
|
+
const alpha = parseFloat(alphaStr);
|
|
31
|
+
if (!Number.isNaN(alpha)) {
|
|
32
|
+
return {
|
|
33
|
+
color: `rgb(${parts.slice(0, 3).join(',')})`,
|
|
34
|
+
opacity: alpha,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// 8 位 hex #RRGGBBAA
|
|
41
|
+
const mHex8 = color.match(
|
|
42
|
+
/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
43
|
+
);
|
|
44
|
+
if (mHex8?.[1] && mHex8[2] && mHex8[3] && mHex8[4]) {
|
|
45
|
+
const alpha = parseInt(mHex8[4], 16) / 255;
|
|
46
|
+
return { color: `#${mHex8[1]}${mHex8[2]}${mHex8[3]}`, opacity: alpha };
|
|
47
|
+
}
|
|
48
|
+
return { color, opacity: 1 };
|
|
49
|
+
}
|
|
50
|
+
|
|
11
51
|
/**
|
|
12
52
|
* 垂直线性渐变 wash —— 全宽矩形 + 顶到底的 SVG LinearGradient。
|
|
13
53
|
*
|
|
@@ -17,30 +57,11 @@ import type { GradientWashProps } from './types';
|
|
|
17
57
|
*
|
|
18
58
|
* `pointerEvents="none"` 透传,装饰层不捕事件。
|
|
19
59
|
*
|
|
20
|
-
* gradientId
|
|
21
|
-
* 不是合法 SVG id 字符,sanitize 后再用。
|
|
60
|
+
* gradientId 不传时由 useSvgId 自动生成唯一合法 id(消毒 React 19 useId 的冒号)。
|
|
22
61
|
*/
|
|
23
|
-
/** 解析 rgba(r,g,b,a) 字符串拆出 alpha,返回 { color: rgb(...), opacity }。
|
|
24
|
-
* 非 rgba 输入(hex / rgb / named)原样返回 + opacity=1。
|
|
25
|
-
*
|
|
26
|
-
* Why:react-native-svg `<Stop stopColor>` 接 rgba 时 alpha 可能被忽略
|
|
27
|
-
* (stopColor 只解析 RGB,需要 stopOpacity 分离),拆分后跨平台一致。 */
|
|
28
|
-
function parseRgba(color: string): { color: string; opacity: number } {
|
|
29
|
-
const m = color.match(/^rgba\(([^)]+)\)$/);
|
|
30
|
-
if (!m || !m[1]) return { color, opacity: 1 };
|
|
31
|
-
const parts = m[1].split(',').map((s) => s.trim());
|
|
32
|
-
if (parts.length !== 4) return { color, opacity: 1 };
|
|
33
|
-
const alphaStr = parts[3];
|
|
34
|
-
if (alphaStr === undefined) return { color, opacity: 1 };
|
|
35
|
-
const alpha = parseFloat(alphaStr);
|
|
36
|
-
if (Number.isNaN(alpha)) return { color, opacity: 1 };
|
|
37
|
-
return { color: `rgb(${parts.slice(0, 3).join(',')})`, opacity: alpha };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
62
|
export function GradientWash(props: GradientWashProps): React.JSX.Element {
|
|
41
63
|
const { height, style, gradientId } = props;
|
|
42
|
-
const
|
|
43
|
-
const id = gradientId ?? `gw-${autoId.replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
64
|
+
const id = useSvgId('gw', gradientId);
|
|
44
65
|
const stops = props.stops ?? [
|
|
45
66
|
{ offset: 0, color: props.color, opacity: props.fromOpacity ?? 0.1 },
|
|
46
67
|
{ offset: 1, color: props.color, opacity: props.toOpacity ?? 0 },
|
|
@@ -62,6 +83,9 @@ export function GradientWash(props: GradientWashProps): React.JSX.Element {
|
|
|
62
83
|
>
|
|
63
84
|
{stops.map((s, i) => {
|
|
64
85
|
const parsed = parseRgba(s.color);
|
|
86
|
+
// s.opacity 显式传入时优先;未传(undefined)时使用 parseRgba 解出的值。
|
|
87
|
+
// 注:这里是替换而非相乘 —— stops 里的 opacity 字段语义是"最终不透明度",
|
|
88
|
+
// 若需要与解析色 alpha 相乘请在构建 stops 时预先合并。
|
|
65
89
|
const opacity = s.opacity ?? parsed.opacity;
|
|
66
90
|
return (
|
|
67
91
|
<Stop
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import Svg, {
|
|
4
4
|
Defs,
|
|
@@ -6,6 +6,8 @@ import Svg, {
|
|
|
6
6
|
RadialGradient as SvgRadialGradient,
|
|
7
7
|
Stop,
|
|
8
8
|
} from 'react-native-svg';
|
|
9
|
+
import { useSvgId } from '../useSvgId';
|
|
10
|
+
import { parseRgba } from './GradientWash';
|
|
9
11
|
import type { RadialHaloProps } from './types';
|
|
10
12
|
|
|
11
13
|
const DEFAULT_MAX_OPACITY = 0.16;
|
|
@@ -35,13 +37,15 @@ export function RadialHalo({
|
|
|
35
37
|
}: RadialHaloProps): React.JSX.Element {
|
|
36
38
|
const w = size;
|
|
37
39
|
const h = height ?? size;
|
|
38
|
-
const
|
|
39
|
-
const id = gradientId ?? `rh-${autoId.replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
40
|
+
const id = useSvgId('rh', gradientId);
|
|
40
41
|
const resolvedStops = stops ?? buildStops(maxOpacity);
|
|
41
42
|
const cx = w / 2;
|
|
42
43
|
const cy = h / 2;
|
|
43
44
|
// farthest-corner:r = 中心到最远角的距离
|
|
44
45
|
const r = Math.sqrt(cx * cx + cy * cy);
|
|
46
|
+
// parseRgba:react-native-svg stopColor 只解析 RGB,rgba/8位hex 的 alpha 会被忽略;
|
|
47
|
+
// 拆分为 stopColor(rgb/hex6) + stopOpacity 后跨平台一致(与 GradientWash 同理)。
|
|
48
|
+
const { color: stopColor } = parseRgba(color);
|
|
45
49
|
return (
|
|
46
50
|
<View pointerEvents="none" style={[{ width: w, height: h }, style]}>
|
|
47
51
|
<Svg width={w} height={h}>
|
|
@@ -61,7 +65,7 @@ export function RadialHalo({
|
|
|
61
65
|
<Stop
|
|
62
66
|
key={`${s.offset}-${i}`}
|
|
63
67
|
offset={s.offset}
|
|
64
|
-
stopColor={
|
|
68
|
+
stopColor={stopColor}
|
|
65
69
|
stopOpacity={s.opacity}
|
|
66
70
|
/>
|
|
67
71
|
))}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
3
|
-
import { useColors, useTheme, warmOrangePalette } from '../../../theme';
|
|
3
|
+
import { r, useColors, useTheme, warmOrangePalette } from '../../../theme';
|
|
4
4
|
import { GradientWash } from './GradientWash';
|
|
5
5
|
import { RadialHalo } from './RadialHalo';
|
|
6
6
|
import type {
|
|
@@ -39,9 +39,22 @@ const PRESETS: Record<ScreenBackdropPreset, PresetConfig> = {
|
|
|
39
39
|
light: buildStops(warmOrangePalette.light, WARM_ORANGE_OFFSETS),
|
|
40
40
|
dark: buildStops(warmOrangePalette.dark, WARM_ORANGE_OFFSETS),
|
|
41
41
|
halos: [
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
|
|
42
|
+
// [L-88] halo 几何走 r() 对齐缩放纪律;maxOpacity / centerX 是无单位值,不缩放。
|
|
43
|
+
{
|
|
44
|
+
size: r(520),
|
|
45
|
+
height: r(420),
|
|
46
|
+
maxOpacity: 0.22,
|
|
47
|
+
top: r(-120),
|
|
48
|
+
centerX: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
size: r(560),
|
|
52
|
+
height: r(380),
|
|
53
|
+
maxOpacity: 0.18,
|
|
54
|
+
bottom: r(-160),
|
|
55
|
+
centerX: true,
|
|
56
|
+
},
|
|
57
|
+
{ size: r(220), maxOpacity: 0.16, top: r(180), right: r(-80) },
|
|
45
58
|
],
|
|
46
59
|
},
|
|
47
60
|
};
|
|
@@ -70,6 +83,7 @@ export function ScreenBackdrop({
|
|
|
70
83
|
halos,
|
|
71
84
|
children,
|
|
72
85
|
style,
|
|
86
|
+
testID,
|
|
73
87
|
}: ScreenBackdropProps): React.JSX.Element {
|
|
74
88
|
const c = useColors();
|
|
75
89
|
const { scheme } = useTheme();
|
|
@@ -84,6 +98,7 @@ export function ScreenBackdrop({
|
|
|
84
98
|
return (
|
|
85
99
|
<View
|
|
86
100
|
style={[backdropStyles.root, { backgroundColor: c.background }, style]}
|
|
101
|
+
testID={testID}
|
|
87
102
|
>
|
|
88
103
|
{resolvedStops ? (
|
|
89
104
|
<GradientWash
|
|
@@ -102,7 +117,10 @@ export function ScreenBackdrop({
|
|
|
102
117
|
height={h.height}
|
|
103
118
|
color={h.color ?? c.primary}
|
|
104
119
|
maxOpacity={h.maxOpacity}
|
|
105
|
-
gradientId
|
|
120
|
+
// [L-60] 不传 gradientId —— 让 RadialHalo 走自己的 useSvgId(useId) 默认值。
|
|
121
|
+
// 实例内同名在多 ScreenBackdrop 同挂(keep-mounted 栈、导航页)时会导致
|
|
122
|
+
// web DOM SVG 的 url(#id) 命中文档首个同名渐变,造成跨实例渐变串台。
|
|
123
|
+
// useId 保证每次挂载唯一,「实例内多 halo 不同 id」也由 useSvgId 前缀+'rh' 保证。
|
|
106
124
|
style={[
|
|
107
125
|
backdropStyles.haloAbsolute,
|
|
108
126
|
{ top: h.top, bottom: h.bottom, left, right },
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
// Decorations 族:GradientWash / RadialHalo / ScreenBackdrop 三件强内聚,
|
|
2
|
+
// 共享 GradientStop 类型 + parseRgba 工具 —— 刻意共居一目录、共享 types.ts,
|
|
3
|
+
// 不拆单组件目录;CLAUDE.md 组件约定的族式聚合例外。
|
|
1
4
|
export { GradientWash } from './GradientWash';
|
|
2
5
|
export { RadialHalo } from './RadialHalo';
|
|
3
6
|
export { ScreenBackdrop } from './ScreenBackdrop';
|
|
4
7
|
export type {
|
|
8
|
+
GradientStop,
|
|
5
9
|
GradientWashProps,
|
|
6
10
|
RadialHaloProps,
|
|
7
11
|
ScreenBackdropHalo,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
|
-
import { BlurLayer } from '../../ui';
|
|
3
|
+
import { BlurLayer } from '../../ui/BlurLayer';
|
|
4
4
|
import { useThemedStyles } from '../../../theme';
|
|
5
5
|
import { makeGlassStatsStyles } from './styles';
|
|
6
6
|
import type { GlassStatsProps } from './types';
|
|
@@ -11,20 +11,24 @@ import type { GlassStatsProps } from './types';
|
|
|
11
11
|
* BlurLayer 接管 backdrop 双层结构(BlurView soft + glassTintLight tint),
|
|
12
12
|
* blurType 跟 scheme 自动切。
|
|
13
13
|
*/
|
|
14
|
-
export function GlassStats({
|
|
14
|
+
export function GlassStats({
|
|
15
|
+
items,
|
|
16
|
+
style,
|
|
17
|
+
testID,
|
|
18
|
+
}: GlassStatsProps): React.JSX.Element {
|
|
15
19
|
const styles = useThemedStyles(makeGlassStatsStyles);
|
|
16
20
|
return (
|
|
17
21
|
// 外层 shell 承担 shadow(无 overflow,iOS Core Animation masksToBounds=true
|
|
18
22
|
// 会裁掉 outer shadow);内层 glass 承担 overflow:hidden + border 裁圆角。
|
|
19
23
|
// 单层 overflow + shadow 在 iOS 上 shadow 完全不可见。
|
|
20
|
-
<View style={styles.glassShell}>
|
|
24
|
+
<View style={[styles.glassShell, style]} testID={testID}>
|
|
21
25
|
<View style={styles.glass}>
|
|
22
26
|
<BlurLayer intensity="soft" />
|
|
23
27
|
{/* 顶部 1px inset 白高光,让数据条顶部"凸起" */}
|
|
24
28
|
<View style={styles.topHighlight} pointerEvents="none" />
|
|
25
29
|
<View style={styles.inner}>
|
|
26
30
|
{items.map(([count, label], i) => (
|
|
27
|
-
<React.Fragment key={label}>
|
|
31
|
+
<React.Fragment key={`${label}-${i}`}>
|
|
28
32
|
{i > 0 ? <View style={styles.sep} /> : null}
|
|
29
33
|
<View style={styles.col}>
|
|
30
34
|
<Text style={styles.countText}>{count}</Text>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
1
3
|
/** 单元格元组 —— [count, label] —— count 已格式化好(如 '12' / '¥2,016') */
|
|
2
4
|
export type GlassStatItem = readonly [count: string, label: string];
|
|
3
5
|
|
|
4
6
|
export type GlassStatsProps = {
|
|
5
7
|
/** 数据列。一般 2~4 列均可,不强制数量。 */
|
|
6
8
|
items: ReadonlyArray<GlassStatItem>;
|
|
9
|
+
/** 容器附加样式(margin / position 等布局微调)。 */
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
/** E2E / 测试定位 */
|
|
12
|
+
testID?: string;
|
|
7
13
|
};
|
|
@@ -9,19 +9,59 @@ export function VersionPill({
|
|
|
9
9
|
version,
|
|
10
10
|
build,
|
|
11
11
|
statusColor,
|
|
12
|
+
versionPrefix = '版本 ',
|
|
13
|
+
buildPrefix = 'build ',
|
|
12
14
|
style,
|
|
15
|
+
testID,
|
|
13
16
|
}: VersionPillProps): React.JSX.Element {
|
|
14
17
|
const c = useColors();
|
|
15
18
|
const styles = useThemedStyles(makeVersionPillStyles);
|
|
16
19
|
const dotColor = statusColor ?? c.success;
|
|
20
|
+
// build 的「省略」契约:undefined / null / "" 均视为空;字符串 "0" 不省略。
|
|
21
|
+
const hasBuild = build != null && build !== '';
|
|
22
|
+
// 状态点用颜色传达语义,SR 无法感知;整个 pill 作为分组提供无障碍合并读出。
|
|
23
|
+
const a11yLabel = hasBuild
|
|
24
|
+
? `${versionPrefix}${version},${buildPrefix}${build}`
|
|
25
|
+
: `${versionPrefix}${version}`;
|
|
17
26
|
return (
|
|
18
|
-
<View
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
27
|
+
<View
|
|
28
|
+
accessible
|
|
29
|
+
accessibilityLabel={a11yLabel}
|
|
30
|
+
style={[styles.pill, style]}
|
|
31
|
+
testID={testID}
|
|
32
|
+
>
|
|
33
|
+
{/* 状态点仅颜色通道,屏幕阅读器由外层容器统一朗读,此处隐藏 */}
|
|
34
|
+
<View
|
|
35
|
+
style={[styles.dot, { backgroundColor: dotColor }]}
|
|
36
|
+
accessibilityElementsHidden
|
|
37
|
+
importantForAccessibility="no"
|
|
38
|
+
/>
|
|
39
|
+
<Text
|
|
40
|
+
style={styles.version}
|
|
41
|
+
accessibilityElementsHidden
|
|
42
|
+
importantForAccessibility="no"
|
|
43
|
+
>
|
|
44
|
+
{versionPrefix}
|
|
45
|
+
{version}
|
|
46
|
+
</Text>
|
|
47
|
+
{hasBuild ? (
|
|
22
48
|
<>
|
|
23
|
-
|
|
24
|
-
<Text
|
|
49
|
+
{/* 分隔符「·」无语义,隐藏于无障碍树 */}
|
|
50
|
+
<Text
|
|
51
|
+
style={styles.sep}
|
|
52
|
+
accessibilityElementsHidden
|
|
53
|
+
importantForAccessibility="no"
|
|
54
|
+
>
|
|
55
|
+
·
|
|
56
|
+
</Text>
|
|
57
|
+
<Text
|
|
58
|
+
style={styles.build}
|
|
59
|
+
accessibilityElementsHidden
|
|
60
|
+
importantForAccessibility="no"
|
|
61
|
+
>
|
|
62
|
+
{buildPrefix}
|
|
63
|
+
{build}
|
|
64
|
+
</Text>
|
|
25
65
|
</>
|
|
26
66
|
) : null}
|
|
27
67
|
</View>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '../../../theme';
|
|
10
10
|
|
|
11
11
|
/** VersionPill 样式工厂 —— hairline 描边 + surface 底胶囊。
|
|
12
|
-
* 字号走 type.microPlus(11.5)
|
|
12
|
+
* 字号走 type.microPlus(11.5),现仓内仅 VersionPill 消费。 */
|
|
13
13
|
export const makeVersionPillStyles = (c: ColorTokens) =>
|
|
14
14
|
StyleSheet.create({
|
|
15
15
|
pill: {
|
|
@@ -3,10 +3,22 @@ import type { StyleProp, ViewStyle } from 'react-native';
|
|
|
3
3
|
export type VersionPillProps = {
|
|
4
4
|
/** 版本号,如 "2.8.0"。 */
|
|
5
5
|
version: string;
|
|
6
|
-
/** 可选 build
|
|
6
|
+
/** 可选 build 号;值为 null/undefined/"" 时省略分点与 build 字。 */
|
|
7
7
|
build?: string;
|
|
8
8
|
/** 状态点颜色,默认 c.success。 */
|
|
9
9
|
statusColor?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 版本号前缀文案,默认 "版本 "。
|
|
12
|
+
* 消费者可传 "v" / "Version " 等覆盖(含末尾空格)。
|
|
13
|
+
*/
|
|
14
|
+
versionPrefix?: string;
|
|
15
|
+
/**
|
|
16
|
+
* build 号前缀文案,默认 "build "。
|
|
17
|
+
* 消费者可传 "Build " / "#" 等覆盖。
|
|
18
|
+
*/
|
|
19
|
+
buildPrefix?: string;
|
|
10
20
|
/** 容器附加样式覆盖。 */
|
|
11
21
|
style?: StyleProp<ViewStyle>;
|
|
22
|
+
/** E2E / 测试定位 */
|
|
23
|
+
testID?: string;
|
|
12
24
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SVG 渐变 id 生成 hook —— 消毒 React 19 useId 中的冒号字符。
|
|
5
|
+
*
|
|
6
|
+
* Why:React 19 的 useId() 返回含冒号(`:r0:`)的字符串,不是合法的 SVG id 字符
|
|
7
|
+
* (XML NCName 规则),直接用在 `<LinearGradient id>` / `<RadialGradient id>`
|
|
8
|
+
* 会导致 SVG 引用失败。sanitize 后拼上 prefix 保证唯一且合法。
|
|
9
|
+
*
|
|
10
|
+
* @param prefix 短前缀,区分同屏多 gradient(如 "gw" / "rh" / "av")。
|
|
11
|
+
* @param override 可选:外部传入的 gradientId;有值时直接返回,跳过 useId 分配。
|
|
12
|
+
*/
|
|
13
|
+
export function useSvgId(prefix: string, override?: string): string {
|
|
14
|
+
const autoId = useId();
|
|
15
|
+
if (override !== undefined) return override;
|
|
16
|
+
return `${prefix}-${autoId.replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
17
|
+
}
|