@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
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import { Pressable } from 'react-native-gesture-handler';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
fixed,
|
|
6
|
+
pressedOpacity,
|
|
7
|
+
r,
|
|
8
|
+
useColors,
|
|
9
|
+
useThemedStyles,
|
|
10
|
+
} from '../../../theme';
|
|
5
11
|
import { Icon } from '../Icon';
|
|
6
12
|
import { makeStyles } from './styles';
|
|
7
13
|
import type { CheckboxProps } from './types';
|
|
@@ -27,20 +33,22 @@ export function Checkbox({
|
|
|
27
33
|
<Pressable
|
|
28
34
|
onPress={() => !disabled && onChange(!checked)}
|
|
29
35
|
disabled={disabled}
|
|
30
|
-
|
|
36
|
+
// [M-7] box 20pt → 垂直补 (44-20)/2=12 到 fixed.hitTarget
|
|
37
|
+
hitSlop={Math.round((fixed.hitTarget - r(20)) / 2)}
|
|
31
38
|
accessibilityRole="checkbox"
|
|
32
39
|
accessibilityState={{ checked, disabled: !!disabled }}
|
|
33
40
|
accessibilityLabel={label}
|
|
34
41
|
testID={testID}
|
|
35
42
|
style={({ pressed }) => [
|
|
36
43
|
styles.row,
|
|
37
|
-
{ opacity: disabled ? 0.5 : pressed ?
|
|
44
|
+
{ opacity: disabled ? 0.5 : pressed ? pressedOpacity : 1 },
|
|
38
45
|
]}
|
|
39
46
|
>
|
|
40
47
|
<View
|
|
41
48
|
style={[
|
|
42
49
|
styles.box,
|
|
43
|
-
|
|
50
|
+
// [L-79] circle 形态改用 radius.pill —— sentinel 999 确保任何尺寸下都是真圆
|
|
51
|
+
shape === 'circle' && styles.boxCircle,
|
|
44
52
|
checked && {
|
|
45
53
|
backgroundColor: c.primary,
|
|
46
54
|
borderColor: c.primary,
|
|
@@ -48,7 +56,12 @@ export function Checkbox({
|
|
|
48
56
|
]}
|
|
49
57
|
>
|
|
50
58
|
{checked ? (
|
|
51
|
-
<Icon
|
|
59
|
+
<Icon
|
|
60
|
+
name="check"
|
|
61
|
+
size={r(14)}
|
|
62
|
+
color={c.onPrimary}
|
|
63
|
+
strokeWidth={2.5}
|
|
64
|
+
/>
|
|
52
65
|
) : null}
|
|
53
66
|
</View>
|
|
54
67
|
{label ? <Text style={styles.label}>{label}</Text> : null}
|
|
@@ -7,6 +7,8 @@ export const makeStyles = (c: ColorTokens) =>
|
|
|
7
7
|
row: {
|
|
8
8
|
flexDirection: 'row',
|
|
9
9
|
alignItems: 'center',
|
|
10
|
+
// [L-37] alignSelf:'flex-start' 防止父容器拉伸(与 Chip [M-8] 同口径)
|
|
11
|
+
alignSelf: 'flex-start' as const,
|
|
10
12
|
gap: space[4],
|
|
11
13
|
},
|
|
12
14
|
box: {
|
|
@@ -18,9 +20,15 @@ export const makeStyles = (c: ColorTokens) =>
|
|
|
18
20
|
alignItems: 'center',
|
|
19
21
|
justifyContent: 'center',
|
|
20
22
|
},
|
|
23
|
+
/** [L-79] circle 形态 —— radius.pill(sentinel 999)确保任何尺寸下真圆 */
|
|
24
|
+
boxCircle: {
|
|
25
|
+
borderRadius: radius.pill,
|
|
26
|
+
},
|
|
21
27
|
label: {
|
|
22
28
|
fontSize: t.sm,
|
|
23
29
|
color: c.foreground,
|
|
24
30
|
fontWeight: fw.regular,
|
|
31
|
+
// flexShrink:长 label 在 row 内换行/截断,不溢出也不把同行控件挤没([M-10])
|
|
32
|
+
flexShrink: 1,
|
|
25
33
|
},
|
|
26
34
|
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import { Pressable } from 'react-native-gesture-handler';
|
|
4
|
-
import { useThemedStyles } from '../../../theme';
|
|
4
|
+
import { fixed, pressedOpacity, r, rf, useThemedStyles } from '../../../theme';
|
|
5
5
|
import { makeStyles } from './styles';
|
|
6
6
|
import type { ChipProps } from './types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 胶囊形可点击 chip。
|
|
10
|
-
* -
|
|
10
|
+
* - 默认:surface 底 + outline 细线边框,foreground 文本
|
|
11
11
|
* - 选中:主色边框 + 主色文本
|
|
12
|
-
* - 按下:透明度
|
|
12
|
+
* - 按下:透明度 pressedOpacity(与 ButtonBase 同源)
|
|
13
|
+
* - 禁用:透明度 0.5 + 不响应 onPress
|
|
13
14
|
*
|
|
14
15
|
* 常用于建议 chip、筛选 pill、多选标签等。
|
|
15
16
|
*/
|
|
@@ -17,6 +18,7 @@ export function Chip({
|
|
|
17
18
|
label,
|
|
18
19
|
selected,
|
|
19
20
|
onPress,
|
|
21
|
+
disabled,
|
|
20
22
|
leading,
|
|
21
23
|
trailing,
|
|
22
24
|
style,
|
|
@@ -37,14 +39,27 @@ export function Chip({
|
|
|
37
39
|
);
|
|
38
40
|
|
|
39
41
|
if (onPress) {
|
|
42
|
+
// [M-7] chip 内容高 ≈ 2×space[3] + xs 行高 ≈ 34pt < 44pt
|
|
43
|
+
// Pressable 是外壳,hitSlop 向外补足到 fixed.hitTarget
|
|
44
|
+
const chipHitSlopV = Math.max(
|
|
45
|
+
0,
|
|
46
|
+
Math.round((fixed.hitTarget - (2 * r(8) + rf(13) * 1.4)) / 2)
|
|
47
|
+
);
|
|
40
48
|
return (
|
|
41
49
|
<Pressable
|
|
42
50
|
onPress={onPress}
|
|
51
|
+
disabled={disabled}
|
|
43
52
|
accessibilityRole="button"
|
|
44
|
-
accessibilityState={{ selected: !!selected }}
|
|
53
|
+
accessibilityState={{ selected: !!selected, disabled: !!disabled }}
|
|
45
54
|
accessibilityLabel={label}
|
|
46
55
|
testID={testID}
|
|
47
|
-
|
|
56
|
+
hitSlop={{ top: chipHitSlopV, bottom: chipHitSlopV, left: 0, right: 0 }}
|
|
57
|
+
style={({ pressed }) => [
|
|
58
|
+
{
|
|
59
|
+
alignSelf: 'flex-start',
|
|
60
|
+
opacity: disabled ? 0.5 : pressed ? pressedOpacity : 1,
|
|
61
|
+
},
|
|
62
|
+
]}
|
|
48
63
|
>
|
|
49
64
|
{inner}
|
|
50
65
|
</Pressable>
|
|
@@ -5,6 +5,8 @@ export type ChipProps = {
|
|
|
5
5
|
label: string;
|
|
6
6
|
selected?: boolean;
|
|
7
7
|
onPress?: () => void;
|
|
8
|
+
/** 整体禁用:opacity 0.5 + 不响应 onPress + accessibilityState.disabled */
|
|
9
|
+
disabled?: boolean;
|
|
8
10
|
/** 可选的前置插槽 —— 如 <Icon name="spark" /> */
|
|
9
11
|
leading?: ReactNode;
|
|
10
12
|
/** 可选的后置插槽 —— 如一个小的 × 关闭按钮 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Modal, Pressable, Text, View } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { space, useThemedStyles } from '../../../theme';
|
|
@@ -19,11 +19,25 @@ export function ConfirmHost(): React.JSX.Element | null {
|
|
|
19
19
|
const insets = useSafeAreaInsets();
|
|
20
20
|
const [entry, setEntry] = useState<ConfirmEntry | null>(null);
|
|
21
21
|
|
|
22
|
+
// 跟踪当前未决 entry,供 unmount cleanup resolve(false)。
|
|
23
|
+
const pendingRef = useRef<ConfirmEntry | null>(null);
|
|
24
|
+
pendingRef.current = entry;
|
|
25
|
+
|
|
26
|
+
// 保留最后一次显示的 entry:关闭时 entry 立即置 null,但 slide 退场动画期 Modal 仍可见,
|
|
27
|
+
// 渲染 lastEntry 才不会滑出一个只剩 padding 的空 sheet([M-17])。
|
|
28
|
+
const lastEntryRef = useRef<ConfirmEntry | null>(null);
|
|
29
|
+
if (entry) lastEntryRef.current = entry;
|
|
30
|
+
const display = entry ?? lastEntryRef.current;
|
|
31
|
+
|
|
22
32
|
useEffect(() => {
|
|
33
|
+
// [L-101] Subscriber 不再接收 null —— 收到新 entry 即显示;关闭路径由 resolve() 驱动
|
|
23
34
|
const sub: Subscriber = (next) => setEntry(next);
|
|
24
35
|
_subs.add(sub);
|
|
25
36
|
return () => {
|
|
26
37
|
_subs.delete(sub);
|
|
38
|
+
// Host 卸载时若对话框仍未决(error boundary 重置 / 根 re-key 切语言主题等),
|
|
39
|
+
// resolve(false) —— 否则 confirm() 的 Promise 永久悬挂、_activeEntry 锁死([H-5])。
|
|
40
|
+
pendingRef.current?.resolve(false);
|
|
27
41
|
};
|
|
28
42
|
}, []);
|
|
29
43
|
|
|
@@ -49,35 +63,37 @@ export function ConfirmHost(): React.JSX.Element | null {
|
|
|
49
63
|
<Pressable
|
|
50
64
|
style={styles.backdrop}
|
|
51
65
|
onPress={handleCancel}
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
// [M-16] accessible={false}:否则 backdrop 把整个子树合并成单一「关闭, 按钮」,
|
|
67
|
+
// 遮蔽 sheet 内的 title/message/按钮。SR 取消路径走 cancel 按钮 + onRequestClose。
|
|
68
|
+
accessible={false}
|
|
54
69
|
>
|
|
55
70
|
<Pressable
|
|
56
71
|
style={[styles.sheet, { paddingBottom: insets.bottom + space['7'] }]}
|
|
57
72
|
onPress={() => {}}
|
|
73
|
+
accessible={false}
|
|
58
74
|
>
|
|
59
|
-
{
|
|
75
|
+
{display ? (
|
|
60
76
|
<>
|
|
61
77
|
<View style={styles.body}>
|
|
62
78
|
<Text style={styles.title} accessibilityRole="header">
|
|
63
|
-
{
|
|
79
|
+
{display.title}
|
|
64
80
|
</Text>
|
|
65
|
-
{
|
|
66
|
-
<Text style={styles.message}>{
|
|
81
|
+
{display.message ? (
|
|
82
|
+
<Text style={styles.message}>{display.message}</Text>
|
|
67
83
|
) : null}
|
|
68
84
|
</View>
|
|
69
85
|
<View style={styles.actions}>
|
|
70
86
|
<Button
|
|
71
87
|
testID="confirm-cancel"
|
|
72
|
-
label={
|
|
88
|
+
label={display.cancelLabel ?? '取消'}
|
|
73
89
|
variant="secondary"
|
|
74
90
|
block
|
|
75
91
|
onPress={handleCancel}
|
|
76
92
|
/>
|
|
77
93
|
<Button
|
|
78
94
|
testID="confirm-ok"
|
|
79
|
-
label={
|
|
80
|
-
variant={
|
|
95
|
+
label={display.confirmLabel ?? '确认'}
|
|
96
|
+
variant={display.destructive ? 'danger' : 'primary'}
|
|
81
97
|
block
|
|
82
98
|
onPress={handleConfirm}
|
|
83
99
|
/>
|
|
@@ -38,6 +38,14 @@ export function confirm(options: ConfirmOptions): Promise<boolean> {
|
|
|
38
38
|
);
|
|
39
39
|
return Promise.resolve(false);
|
|
40
40
|
}
|
|
41
|
+
// 没有 ConfirmHost 订阅 → entry 无人接收,Promise 会永久悬挂、调用方 await 卡死。
|
|
42
|
+
// 立即 resolve(false) 并告警,且不占 _activeEntry(否则后续 confirm 全被重入分支锁死)。
|
|
43
|
+
if (_subs.size === 0) {
|
|
44
|
+
log.warn(
|
|
45
|
+
'confirm() 调用时未挂载 <ConfirmHost />,对话框无法显示,已 resolve(false)。请在 app 根附近挂一次 <ConfirmHost />。'
|
|
46
|
+
);
|
|
47
|
+
return Promise.resolve(false);
|
|
48
|
+
}
|
|
41
49
|
return new Promise<boolean>((resolve) => {
|
|
42
50
|
const entry: ConfirmEntry = {
|
|
43
51
|
id: ++_id,
|
|
@@ -18,5 +18,7 @@ export type ConfirmEntry = ConfirmOptions & {
|
|
|
18
18
|
resolve: (confirmed: boolean) => void;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
/** ConfirmHost 监听器签名 —— 收到 entry
|
|
22
|
-
|
|
21
|
+
/** ConfirmHost 监听器签名 —— 收到 entry 渲染对话框。
|
|
22
|
+
* [L-101] 删去 null 分支:全仓唯一发射点 confirm.ts:_subs.forEach 只发非 null entry,
|
|
23
|
+
* 关闭路径由 ConfirmEntry.resolve() 驱动;null 分支是死协议,对齐 Toast Subscriber 签名。 */
|
|
24
|
+
export type Subscriber = (entry: ConfirmEntry) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Image, Text, View } from 'react-native';
|
|
3
3
|
import { useThemedStyles } from '../../../theme';
|
|
4
4
|
import { makeStyles } from './styles';
|
|
@@ -12,25 +12,30 @@ export function DrawerHeader({
|
|
|
12
12
|
name,
|
|
13
13
|
subtitle,
|
|
14
14
|
source,
|
|
15
|
+
style,
|
|
15
16
|
testID,
|
|
16
17
|
}: DrawerHeaderProps): React.JSX.Element {
|
|
17
18
|
const styles = useThemedStyles(makeStyles);
|
|
18
19
|
const [imageFailed, setImageFailed] = useState(false);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
20
|
+
|
|
21
|
+
// [M-20] React 18+ 已移除 unmount 后 setState 的 warning,mountedRef 守卫为死码,删除。
|
|
22
|
+
// [L-44] source 变化时重置 imageFailed,否则换图 URL 后仍展示 fallback 文字。
|
|
23
|
+
const uri =
|
|
24
|
+
source != null && typeof source === 'object' && 'uri' in source
|
|
25
|
+
? (source as { uri?: string }).uri
|
|
26
|
+
: null;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setImageFailed(false);
|
|
29
|
+
}, [uri, source]);
|
|
30
|
+
|
|
27
31
|
const handleImageError = () => {
|
|
28
|
-
|
|
32
|
+
setImageFailed(true);
|
|
29
33
|
};
|
|
30
|
-
|
|
34
|
+
// [L-51] 码点级取首字,防 emoji / 代理对被截断为乱码。
|
|
35
|
+
const initial = [...name.trim()][0] ?? '?';
|
|
31
36
|
const showImage = source != null && !imageFailed;
|
|
32
37
|
return (
|
|
33
|
-
<View style={styles.header} testID={testID}>
|
|
38
|
+
<View style={[styles.header, style]} testID={testID}>
|
|
34
39
|
<View style={[styles.avatar, showImage && styles.avatarImageMode]}>
|
|
35
40
|
{showImage ? (
|
|
36
41
|
<Image
|
|
@@ -38,6 +43,7 @@ export function DrawerHeader({
|
|
|
38
43
|
onError={handleImageError}
|
|
39
44
|
style={styles.avatarImage}
|
|
40
45
|
resizeMode="cover"
|
|
46
|
+
accessible={!!name}
|
|
41
47
|
accessibilityLabel={name}
|
|
42
48
|
/>
|
|
43
49
|
) : (
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
import type { ColorTokens } from '../../../theme';
|
|
3
|
-
import {
|
|
3
|
+
import { avatar, fw, rf, space, type as t } from '../../../theme';
|
|
4
|
+
|
|
5
|
+
// 头像盒用 avatar.xl(56pt)而非 icon['2xl'] —— 两者数值相同但语义不同:
|
|
6
|
+
// icon.* 是图标容器阶梯,avatar.* 是头像容器阶梯。此处是用户头像,按语义选 avatar。
|
|
7
|
+
const AVATAR_SIZE = avatar.xl;
|
|
4
8
|
|
|
5
9
|
export const makeStyles = (c: ColorTokens) =>
|
|
6
10
|
StyleSheet.create({
|
|
@@ -12,9 +16,9 @@ export const makeStyles = (c: ColorTokens) =>
|
|
|
12
16
|
gap: space[3],
|
|
13
17
|
},
|
|
14
18
|
avatar: {
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
17
|
-
borderRadius:
|
|
19
|
+
width: AVATAR_SIZE,
|
|
20
|
+
height: AVATAR_SIZE,
|
|
21
|
+
borderRadius: AVATAR_SIZE / 2,
|
|
18
22
|
backgroundColor: c.primaryPressed,
|
|
19
23
|
alignItems: 'center',
|
|
20
24
|
justifyContent: 'center',
|
|
@@ -23,8 +27,8 @@ export const makeStyles = (c: ColorTokens) =>
|
|
|
23
27
|
overflow: 'hidden',
|
|
24
28
|
},
|
|
25
29
|
avatarImage: {
|
|
26
|
-
width:
|
|
27
|
-
height:
|
|
30
|
+
width: AVATAR_SIZE,
|
|
31
|
+
height: AVATAR_SIZE,
|
|
28
32
|
},
|
|
29
33
|
avatarText: {
|
|
30
34
|
color: c.onPrimary,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ImageSourcePropType } from 'react-native';
|
|
1
|
+
import type { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
|
|
3
3
|
export type DrawerHeaderProps = {
|
|
4
4
|
/** 用户名(首字符渲染到圆形 brand 头像里;source 提供时仅作为 a11y label / fallback) */
|
|
@@ -7,6 +7,8 @@ export type DrawerHeaderProps = {
|
|
|
7
7
|
subtitle?: string;
|
|
8
8
|
/** 真实头像图片(URL 或 require);提供时优先渲染 image,加载失败 fallback 到 letter */
|
|
9
9
|
source?: ImageSourcePropType;
|
|
10
|
+
/** 容器附加样式(margin / position 等布局微调)。 */
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
10
12
|
/** E2E / 测试定位 */
|
|
11
13
|
testID?: string;
|
|
12
14
|
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
|
-
import { useColors, useThemedStyles } from '../../../theme';
|
|
3
|
+
import { r, useColors, useThemedStyles } from '../../../theme';
|
|
4
4
|
import { Icon } from '../Icon';
|
|
5
5
|
import { makeStyles } from './styles';
|
|
6
6
|
import type { EmptyProps } from './types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* 空态 / 占位组件 —— `
|
|
9
|
+
* 空态 / 占位组件 —— `primaryContainer` 圆盘上的 icon 插画 + 标题 + 描述。
|
|
10
10
|
* icon 默认 `'spark'`(通用空态);相机 / 出错 / 权限场景应显式传强语义 icon。
|
|
11
11
|
*/
|
|
12
12
|
export function Empty({
|
|
13
13
|
title,
|
|
14
14
|
desc,
|
|
15
15
|
icon = 'spark',
|
|
16
|
+
style,
|
|
16
17
|
testID,
|
|
17
18
|
}: EmptyProps): React.JSX.Element {
|
|
18
19
|
const c = useColors();
|
|
19
20
|
const styles = useThemedStyles(makeStyles);
|
|
20
21
|
return (
|
|
21
|
-
<View style={styles.wrap} testID={testID}>
|
|
22
|
+
<View style={[styles.wrap, style]} testID={testID}>
|
|
22
23
|
<View style={styles.illust}>
|
|
23
|
-
<Icon name={icon} size={28} color={c.primary} />
|
|
24
|
+
<Icon name={icon} size={r(28)} color={c.primary} />
|
|
24
25
|
</View>
|
|
25
26
|
<Text style={styles.title}>{title}</Text>
|
|
26
27
|
{desc ? <Text style={styles.desc}>{desc}</Text> : null}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
1
2
|
import type { IconName } from '../../../icons';
|
|
2
3
|
|
|
3
4
|
export type EmptyProps = {
|
|
@@ -8,6 +9,8 @@ export type EmptyProps = {
|
|
|
8
9
|
/** illust 圆盘内的图标,默认 `'spark'`(通用空态)。
|
|
9
10
|
* 相机域可传 `'camera-off'` / `'permission-denied'` / `'error-alert'` 等强语义 icon。 */
|
|
10
11
|
icon?: IconName;
|
|
12
|
+
/** 容器附加样式(margin / position 等布局微调)。 */
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
11
14
|
/** E2E / 测试定位 */
|
|
12
15
|
testID?: string;
|
|
13
16
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import { Pressable } from 'react-native-gesture-handler';
|
|
4
4
|
import { Icon } from '../Icon';
|
|
5
|
-
import { useColors, useThemedStyles } from '../../../theme';
|
|
5
|
+
import { r, useColors, useThemedStyles } from '../../../theme';
|
|
6
6
|
import { makeStyles } from './styles';
|
|
7
7
|
import type { EntryCardProps } from './types';
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ export function EntryCard({
|
|
|
22
22
|
const content = (
|
|
23
23
|
<>
|
|
24
24
|
<View style={styles.iconTile}>
|
|
25
|
-
<Icon name={icon} size={16} color={c.foregroundMuted} />
|
|
25
|
+
<Icon name={icon} size={r(16)} color={c.foregroundMuted} />
|
|
26
26
|
</View>
|
|
27
27
|
<View style={styles.body}>
|
|
28
28
|
<Text style={styles.title} numberOfLines={1}>
|
|
@@ -38,11 +38,13 @@ export function EntryCard({
|
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
if (onPress) {
|
|
41
|
+
// a11y label 包含副标题,SR 用户听到完整信息(标题+sub)再决定是否点击
|
|
42
|
+
const a11yLabel = sub ? `${title},${sub}` : title;
|
|
41
43
|
return (
|
|
42
44
|
<Pressable
|
|
43
45
|
onPress={onPress}
|
|
44
46
|
accessibilityRole="button"
|
|
45
|
-
accessibilityLabel={
|
|
47
|
+
accessibilityLabel={a11yLabel}
|
|
46
48
|
testID={testID}
|
|
47
49
|
style={({ pressed }) => [styles.card, pressed && styles.pressed, style]}
|
|
48
50
|
>
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
fw,
|
|
4
|
+
icon,
|
|
5
|
+
pressedOpacity,
|
|
6
|
+
r,
|
|
7
|
+
rf,
|
|
8
|
+
radius,
|
|
9
|
+
space,
|
|
10
|
+
type ColorTokens,
|
|
11
|
+
} from '../../../theme';
|
|
3
12
|
|
|
4
13
|
export const makeStyles = (c: ColorTokens) =>
|
|
5
14
|
StyleSheet.create({
|
|
@@ -29,16 +38,16 @@ export const makeStyles = (c: ColorTokens) =>
|
|
|
29
38
|
},
|
|
30
39
|
title: {
|
|
31
40
|
// 13.5pt —— 介于 type.xs(13) / type.sm(14) 之间的设计稿专定字号
|
|
32
|
-
fontSize:
|
|
41
|
+
fontSize: rf(13) + 0.5,
|
|
33
42
|
fontWeight: fw.medium,
|
|
34
43
|
letterSpacing: -0.2,
|
|
35
44
|
color: c.foreground,
|
|
36
45
|
},
|
|
37
46
|
sub: {
|
|
38
|
-
fontSize:
|
|
47
|
+
fontSize: rf(11),
|
|
39
48
|
color: c.foregroundMuted,
|
|
40
49
|
},
|
|
41
50
|
pressed: {
|
|
42
|
-
opacity:
|
|
51
|
+
opacity: pressedOpacity,
|
|
43
52
|
},
|
|
44
53
|
});
|
|
@@ -4,9 +4,9 @@ import type { IconName } from '../Icon';
|
|
|
4
4
|
export type EntryCardProps = {
|
|
5
5
|
/** 左侧 icon tile 内的图标名 */
|
|
6
6
|
icon: IconName;
|
|
7
|
-
/** 主标题(13.
|
|
7
|
+
/** 主标题(rf(13)+0.5 medium,随设备缩放) */
|
|
8
8
|
title: string;
|
|
9
|
-
/** 副标题(
|
|
9
|
+
/** 副标题(rf(11) muted,随设备缩放),省略不渲染该行 */
|
|
10
10
|
sub?: string;
|
|
11
11
|
/** 点击回调,未传不挂 Pressable */
|
|
12
12
|
onPress?: () => void;
|
|
@@ -24,7 +24,13 @@ export function FormRow({
|
|
|
24
24
|
</Text>
|
|
25
25
|
<View style={styles.rowControl}>{children}</View>
|
|
26
26
|
</View>
|
|
27
|
-
{
|
|
27
|
+
{/* [L-31] accessibilityLiveRegion="polite" —— error 出现时 SR 自动播报,
|
|
28
|
+
不干扰当前朗读(polite 排队等当前发言结束)。 */}
|
|
29
|
+
{error ? (
|
|
30
|
+
<Text style={styles.errorText} accessibilityLiveRegion="polite">
|
|
31
|
+
{error}
|
|
32
|
+
</Text>
|
|
33
|
+
) : null}
|
|
28
34
|
</View>
|
|
29
35
|
);
|
|
30
36
|
}
|
|
@@ -19,11 +19,16 @@ export type FormGroupProps = {
|
|
|
19
19
|
export type FormRowProps = {
|
|
20
20
|
/** 字段标题 */
|
|
21
21
|
label: string;
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* 字段控件(Input / Select / Switch / Checkbox 等)。
|
|
24
|
+
* [L-31] 约定:传入控件自带 accessibilityLabel / accessibilityRole,
|
|
25
|
+
* 使 SR 能独立播报控件意图,不依赖 FormRow 的 label 文字。
|
|
26
|
+
*/
|
|
23
27
|
children: ReactNode;
|
|
24
28
|
/** 必填标记,渲染右上红色星号 */
|
|
25
29
|
required?: boolean;
|
|
26
|
-
/**
|
|
30
|
+
/** 错误信息,渲染在控件下方。
|
|
31
|
+
* [L-31] 错误文本携带 accessibilityLiveRegion="polite",SR 自动播报。 */
|
|
27
32
|
error?: string;
|
|
28
33
|
/** E2E / 测试定位 */
|
|
29
34
|
testID?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import { Pressable } from 'react-native-gesture-handler';
|
|
4
|
-
import { useColors, useThemedStyles } from '../../../theme';
|
|
4
|
+
import { pressedOpacity, r, useColors, useThemedStyles } from '../../../theme';
|
|
5
5
|
import { createLogger } from '../../../utils/logger';
|
|
6
6
|
import { childTestID } from '../../../utils/testID';
|
|
7
7
|
import { Icon } from '../Icon';
|
|
@@ -10,6 +10,9 @@ import type { GridProps } from './types';
|
|
|
10
10
|
|
|
11
11
|
const log = createLogger('Grid');
|
|
12
12
|
|
|
13
|
+
// 渲染路径去重集合 —— 同一 columns 值只在首次渲染时告警一次,避免长列表重复刷 log。
|
|
14
|
+
const _warnedColumns = new Set<number>();
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* 图标入口宫格 —— 首页 / 分类落地页。1..6 列。
|
|
15
18
|
* 每格:图标 + 小标签,纵向居中。
|
|
@@ -21,44 +24,58 @@ export function Grid({
|
|
|
21
24
|
columns = 4,
|
|
22
25
|
onPress,
|
|
23
26
|
card = true,
|
|
27
|
+
style,
|
|
24
28
|
testID,
|
|
25
29
|
}: GridProps): React.JSX.Element {
|
|
26
30
|
const c = useColors();
|
|
27
31
|
const styles = useThemedStyles(makeStyles);
|
|
28
|
-
if (![1, 2, 3, 4, 5, 6].includes(columns)) {
|
|
32
|
+
if (![1, 2, 3, 4, 5, 6].includes(columns) && !_warnedColumns.has(columns)) {
|
|
33
|
+
_warnedColumns.add(columns);
|
|
29
34
|
log.warn(`columns 仅支持 1..6,传入 ${columns},已 fallback 为 4 列`);
|
|
30
35
|
}
|
|
31
36
|
const cellWidth = colWidth(columns);
|
|
32
37
|
return (
|
|
33
|
-
<View style={[styles.wrap, card && styles.card]} testID={testID}>
|
|
38
|
+
<View style={[styles.wrap, card && styles.card, style]} testID={testID}>
|
|
34
39
|
<View style={styles.inner}>
|
|
35
40
|
{items.map((item) => {
|
|
36
41
|
const itemTestID = childTestID(testID, item.id, item.testID);
|
|
42
|
+
const cellContent = (
|
|
43
|
+
<>
|
|
44
|
+
<View>
|
|
45
|
+
{/* 28pt 介于 icon.md(26) / icon.lg(30) 之间的设计稿专定字形尺寸 */}
|
|
46
|
+
<Icon name={item.icon} size={r(28)} color={c.foregroundMuted} />
|
|
47
|
+
{item.badge != null ? (
|
|
48
|
+
<View style={styles.badge}>
|
|
49
|
+
<Text style={styles.badgeText}>{item.badge}</Text>
|
|
50
|
+
</View>
|
|
51
|
+
) : null}
|
|
52
|
+
</View>
|
|
53
|
+
<Text style={styles.label} numberOfLines={1}>
|
|
54
|
+
{item.label}
|
|
55
|
+
</Text>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
37
58
|
return (
|
|
38
59
|
<View key={item.id} style={cellWidth}>
|
|
39
|
-
|
|
40
|
-
onPress
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
) : null}
|
|
60
|
+
{onPress ? (
|
|
61
|
+
// 有 onPress 才挂 Pressable + button 语义,纯展示宫格不播报 button
|
|
62
|
+
<Pressable
|
|
63
|
+
onPress={() => onPress(item)}
|
|
64
|
+
accessibilityRole="button"
|
|
65
|
+
accessibilityLabel={item.label}
|
|
66
|
+
testID={itemTestID}
|
|
67
|
+
style={({ pressed }) => [
|
|
68
|
+
styles.cell,
|
|
69
|
+
{ opacity: pressed ? pressedOpacity : 1 },
|
|
70
|
+
]}
|
|
71
|
+
>
|
|
72
|
+
{cellContent}
|
|
73
|
+
</Pressable>
|
|
74
|
+
) : (
|
|
75
|
+
<View style={styles.cell} testID={itemTestID}>
|
|
76
|
+
{cellContent}
|
|
57
77
|
</View>
|
|
58
|
-
|
|
59
|
-
{item.label}
|
|
60
|
-
</Text>
|
|
61
|
-
</Pressable>
|
|
78
|
+
)}
|
|
62
79
|
</View>
|
|
63
80
|
);
|
|
64
81
|
})}
|