@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,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
|
-
import { fw, radius } from "../../../theme/index.js";
|
|
4
|
+
import { fw, r, radius, space, type as t } from "../../../theme/index.js";
|
|
5
5
|
/** Tag 静态 base —— alignSelf 防 flex 父容器拉伸,radius 走 token。 */
|
|
6
6
|
export const styles = StyleSheet.create({
|
|
7
7
|
base: {
|
|
@@ -21,23 +21,30 @@ export function sizingFor(size) {
|
|
|
21
21
|
switch (size) {
|
|
22
22
|
case 'md':
|
|
23
23
|
return {
|
|
24
|
-
h: 22,
|
|
25
|
-
px:
|
|
26
|
-
fs:
|
|
24
|
+
h: r(22),
|
|
25
|
+
px: space['3'],
|
|
26
|
+
fs: t.xxs
|
|
27
27
|
};
|
|
28
28
|
case 'lg':
|
|
29
29
|
return {
|
|
30
|
-
h: 26,
|
|
31
|
-
px:
|
|
32
|
-
fs:
|
|
30
|
+
h: r(26),
|
|
31
|
+
px: space['4'],
|
|
32
|
+
fs: t.xs
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/** Tag 颜色推导:variant → { bg, fg, border } 三色,全走 ColorTokens。
|
|
38
|
-
* 签名 `(
|
|
38
|
+
* 签名 `(variant, c)` 与 Button/Avatar 的 paletteFor 一致。
|
|
39
|
+
* 新增 variant 在 types.ts 加 union + 这里加 case。 */
|
|
39
40
|
export function paletteFor(variant, c) {
|
|
40
41
|
switch (variant) {
|
|
42
|
+
case 'neutral':
|
|
43
|
+
return {
|
|
44
|
+
bg: c.surfaceContainerHigh,
|
|
45
|
+
fg: c.foregroundMuted,
|
|
46
|
+
border: undefined
|
|
47
|
+
};
|
|
41
48
|
case 'brand':
|
|
42
49
|
return {
|
|
43
50
|
bg: c.primaryContainer,
|
|
@@ -68,12 +75,6 @@ export function paletteFor(variant, c) {
|
|
|
68
75
|
fg: c.foregroundMuted,
|
|
69
76
|
border: c.outline
|
|
70
77
|
};
|
|
71
|
-
default:
|
|
72
|
-
return {
|
|
73
|
-
bg: c.surfaceContainerHigh,
|
|
74
|
-
fg: c.foregroundMuted,
|
|
75
|
-
border: undefined
|
|
76
|
-
};
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","fw","radius","styles","create","base","alignSelf","flexDirection","alignItems","borderRadius","sm","text","fontWeight","medium","sizingFor","size","h","px","fs","paletteFor","variant","c","bg","
|
|
1
|
+
{"version":3,"names":["StyleSheet","fw","r","radius","space","type","t","styles","create","base","alignSelf","flexDirection","alignItems","borderRadius","sm","text","fontWeight","medium","sizingFor","size","h","px","fs","xxs","xs","paletteFor","variant","c","bg","surfaceContainerHigh","fg","foregroundMuted","border","undefined","primaryContainer","primary","successContainer","success","errorContainer","error","infoContainer","info","outline"],"sourceRoot":"../../../../../src","sources":["components/ui/Tag/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SACEC,EAAE,EACFC,CAAC,EACDC,MAAM,EACNC,KAAK,EACLC,IAAI,IAAIC,CAAC,QAEJ,yBAAgB;AAGvB;AACA,OAAO,MAAMC,MAAM,GAAGP,UAAU,CAACQ,MAAM,CAAC;EACtCC,IAAI,EAAE;IACJC,SAAS,EAAE,YAAY;IACvBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAEV,MAAM,CAACW;EACvB,CAAC;EACDC,IAAI,EAAE;IACJC,UAAU,EAAEf,EAAE,CAACgB;EACjB;AACF,CAAC,CAAC;;AAEF;AACA;AACA,OAAO,SAASC,SAASA,CAACC,IAAa,EAIrC;EACA,QAAQA,IAAI;IACV,KAAK,IAAI;MACP,OAAO;QAAEC,CAAC,EAAElB,CAAC,CAAC,EAAE,CAAC;QAAEmB,EAAE,EAAEjB,KAAK,CAAC,GAAG,CAAC;QAAEkB,EAAE,EAAEhB,CAAC,CAACiB;MAAI,CAAC;IAChD,KAAK,IAAI;MACP,OAAO;QAAEH,CAAC,EAAElB,CAAC,CAAC,EAAE,CAAC;QAAEmB,EAAE,EAAEjB,KAAK,CAAC,GAAG,CAAC;QAAEkB,EAAE,EAAEhB,CAAC,CAACkB;MAAG,CAAC;EACjD;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,OAAmB,EAAEC,CAAc,EAAE;EAC9D,QAAQD,OAAO;IACb,KAAK,SAAS;MACZ,OAAO;QACLE,EAAE,EAAED,CAAC,CAACE,oBAAoB;QAC1BC,EAAE,EAAEH,CAAC,CAACI,eAAe;QACrBC,MAAM,EAAEC;MACV,CAAC;IACH,KAAK,OAAO;MACV,OAAO;QAAEL,EAAE,EAAED,CAAC,CAACO,gBAAgB;QAAEJ,EAAE,EAAEH,CAAC,CAACQ,OAAO;QAAEH,MAAM,EAAEC;MAAU,CAAC;IACrE,KAAK,SAAS;MACZ,OAAO;QAAEL,EAAE,EAAED,CAAC,CAACS,gBAAgB;QAAEN,EAAE,EAAEH,CAAC,CAACU,OAAO;QAAEL,MAAM,EAAEC;MAAU,CAAC;IACrE,KAAK,OAAO;MACV,OAAO;QAAEL,EAAE,EAAED,CAAC,CAACW,cAAc;QAAER,EAAE,EAAEH,CAAC,CAACY,KAAK;QAAEP,MAAM,EAAEC;MAAU,CAAC;IACjE,KAAK,MAAM;MACT,OAAO;QAAEL,EAAE,EAAED,CAAC,CAACa,aAAa;QAAEV,EAAE,EAAEH,CAAC,CAACc,IAAI;QAAET,MAAM,EAAEC;MAAU,CAAC;IAC/D,KAAK,SAAS;MACZ,OAAO;QACLL,EAAE,EAAE,aAAsB;QAC1BE,EAAE,EAAEH,CAAC,CAACI,eAAe;QACrBC,MAAM,EAAEL,CAAC,CAACe;MACZ,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { forwardRef, useState } from 'react';
|
|
4
4
|
import { Text, TextInput, View } from 'react-native';
|
|
5
|
-
import { control, space, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
5
|
+
import { control, r, space, useColors, useThemedStyles } from "../../../theme/index.js";
|
|
6
|
+
import { childTestID } from "../../../utils/testID/index.js";
|
|
6
7
|
import { makeStyles } from "./styles.js";
|
|
7
8
|
|
|
8
9
|
/** `TextInput` 在 react-native-strict-api 下是组件类型(`TextInputType`),
|
|
@@ -24,7 +25,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
24
25
|
export const TextFieldBase = /*#__PURE__*/forwardRef(function TextFieldBase({
|
|
25
26
|
multiline = false,
|
|
26
27
|
height = control.lg,
|
|
27
|
-
minHeight
|
|
28
|
+
// [L-81] multiline minHeight 裸 96 → r(96),随设备缩放
|
|
29
|
+
minHeight = r(96),
|
|
28
30
|
maxHeight,
|
|
29
31
|
leading,
|
|
30
32
|
trailing,
|
|
@@ -35,14 +37,21 @@ export const TextFieldBase = /*#__PURE__*/forwardRef(function TextFieldBase({
|
|
|
35
37
|
value,
|
|
36
38
|
onFocus,
|
|
37
39
|
onBlur,
|
|
40
|
+
onChangeText,
|
|
38
41
|
testID,
|
|
39
42
|
...rest
|
|
40
43
|
}, ref) {
|
|
41
44
|
const c = useColors();
|
|
42
45
|
const styles = useThemedStyles(makeStyles);
|
|
43
46
|
const [focused, setFocused] = useState(false);
|
|
44
|
-
|
|
47
|
+
// [M-9] 内部镜像 state:非受控场景 value 不传,用 _mirror 做 hasValue 判断
|
|
48
|
+
const [_mirror, setMirror] = useState('');
|
|
49
|
+
// [M-9] filled 在受控 value 和内部镜像 state 之间取 hasValue,
|
|
50
|
+
// 保证非受控场景 filled 视觉态能正确响应用户输入,且受控用法行为不变
|
|
51
|
+
const filled = value != null ? String(value).length > 0 : _mirror.length > 0;
|
|
45
52
|
const isEditable = disabled ? false : editable;
|
|
53
|
+
// [L-31] editable=false(非 disabled)时也应进入 disabled a11y state
|
|
54
|
+
const isDisabledA11y = disabled || editable === false;
|
|
46
55
|
|
|
47
56
|
// 视觉态优先级:error > focused > filled > idle。
|
|
48
57
|
// active 三态(focus/filled/error)共享 wrapActive 白底,各自只覆 borderColor 差量。
|
|
@@ -66,6 +75,11 @@ export const TextFieldBase = /*#__PURE__*/forwardRef(function TextFieldBase({
|
|
|
66
75
|
...rest,
|
|
67
76
|
editable: isEditable,
|
|
68
77
|
value: value,
|
|
78
|
+
onChangeText: text => {
|
|
79
|
+
// [M-9] 同步内部镜像,非受控场景 filled 视觉态依赖此 state
|
|
80
|
+
setMirror(text);
|
|
81
|
+
onChangeText?.(text);
|
|
82
|
+
},
|
|
69
83
|
multiline: multiline,
|
|
70
84
|
onFocus: e => {
|
|
71
85
|
setFocused(true);
|
|
@@ -80,16 +94,20 @@ export const TextFieldBase = /*#__PURE__*/forwardRef(function TextFieldBase({
|
|
|
80
94
|
multiline && {
|
|
81
95
|
minHeight: Math.max(0, minHeight - space[4] * 2)
|
|
82
96
|
}],
|
|
83
|
-
placeholderTextColor: c.foregroundSubtle
|
|
84
|
-
|
|
97
|
+
placeholderTextColor: c.foregroundSubtle
|
|
98
|
+
// [L-31] editable=false 并入 disabled a11y state,SR 能正确播报不可编辑
|
|
99
|
+
,
|
|
100
|
+
accessibilityState: isDisabledA11y ? {
|
|
85
101
|
disabled: true
|
|
86
102
|
} : undefined,
|
|
87
|
-
testID: testID
|
|
103
|
+
testID: childTestID(testID, 'input')
|
|
88
104
|
}), trailing != null ? /*#__PURE__*/_jsx(View, {
|
|
89
105
|
children: trailing
|
|
90
106
|
}) : null]
|
|
91
107
|
}), error ? /*#__PURE__*/_jsx(Text, {
|
|
92
108
|
style: styles.errorMsg,
|
|
109
|
+
accessibilityLiveRegion: "polite",
|
|
110
|
+
testID: childTestID(testID, 'error'),
|
|
93
111
|
children: error
|
|
94
112
|
}) : null]
|
|
95
113
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useState","Text","TextInput","View","control","space","useColors","useThemedStyles","makeStyles","jsx","_jsx","jsxs","_jsxs","TextFieldBase","multiline","height","lg","minHeight","maxHeight","leading","trailing","error","disabled","editable","containerStyle","value","onFocus","onBlur","testID","rest","ref","c","styles","focused","setFocused","filled","String","length","isEditable","wrapStateStyles","wrapActive","wrapError","wrapFocus","wrapFilled","wrapIdle","style","containerDisabled","children","wrap","wrapMultiline","e","input","inputMultiline","Math","max","placeholderTextColor","foregroundSubtle","accessibilityState","undefined","errorMsg","displayName"],"sourceRoot":"../../../../../src","sources":["components/ui/TextField/TextFieldBase.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAuBC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACtE,SAASC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AACpD,SAASC,OAAO,EAAEC,KAAK,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useState","Text","TextInput","View","control","r","space","useColors","useThemedStyles","childTestID","makeStyles","jsx","_jsx","jsxs","_jsxs","TextFieldBase","multiline","height","lg","minHeight","maxHeight","leading","trailing","error","disabled","editable","containerStyle","value","onFocus","onBlur","onChangeText","testID","rest","ref","c","styles","focused","setFocused","_mirror","setMirror","filled","String","length","isEditable","isDisabledA11y","wrapStateStyles","wrapActive","wrapError","wrapFocus","wrapFilled","wrapIdle","style","containerDisabled","children","wrap","wrapMultiline","text","e","input","inputMultiline","Math","max","placeholderTextColor","foregroundSubtle","accessibilityState","undefined","errorMsg","accessibilityLiveRegion","displayName"],"sourceRoot":"../../../../../src","sources":["components/ui/TextField/TextFieldBase.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAuBC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACtE,SAASC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AACpD,SAASC,OAAO,EAAEC,CAAC,EAAEC,KAAK,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AAC9E,SAASC,WAAW,QAAQ,gCAAuB;AACnD,SAASC,UAAU,QAAQ,aAAU;;AAGrC;AACA;AADA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;A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AC,GAAG,CAAC;QACjD,CAAC,CACD;QACFwD,oBAAoB,EAAE5B,CAAC,CAAC6B;QACxB;QAAA;QACAC,kBAAkB,EAAEpB,cAAc,GAAG;UAAEpB,QAAQ,EAAE;QAAK,CAAC,GAAGyC,SAAU;QACpElC,MAAM,EAAEtB,WAAW,CAACsB,MAAM,EAAE,OAAO;MAAE,CACtC,CAAC,EACDT,QAAQ,IAAI,IAAI,gBAAGV,IAAA,CAACT,IAAI;QAAAkD,QAAA,EAAE/B;MAAQ,CAAO,CAAC,GAAG,IAAI;IAAA,CAC9C,CAAC,EAENC,KAAK,gBACJX,IAAA,CAACX,IAAI;MACHkD,KAAK,EAAEhB,MAAM,CAAC+B,QAAS;MACvBC,uBAAuB,EAAC,QAAQ;MAChCpC,MAAM,EAAEtB,WAAW,CAACsB,MAAM,EAAE,OAAO,CAAE;MAAAsB,QAAA,EAEpC9B;IAAK,CACF,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX,CACF,CAAC;AAEDR,aAAa,CAACqD,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Image, View } from 'react-native';
|
|
5
5
|
import { useThemedStyles } from "../../../theme/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
7
|
+
import { makeStyles, RING_EXTRA_RADIUS, sizingFor } from "./styles.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const log = createLogger('Thumbnail');
|
|
10
|
+
|
|
8
11
|
/** 缩略图基础组件 —— 列表 / 卡片 / chat 行内通用 16:9.5 小图。
|
|
9
12
|
*
|
|
10
13
|
* 尺寸阶梯:sm / md(默认 113×67)/ lg,与 NewsList / NewsArea 历史一致。
|
|
@@ -27,7 +30,12 @@ export function Thumbnail({
|
|
|
27
30
|
testID
|
|
28
31
|
}) {
|
|
29
32
|
const styles = useThemedStyles(makeStyles);
|
|
30
|
-
if (!uri && !source)
|
|
33
|
+
if (!uri && !source) {
|
|
34
|
+
// [L-18] uri/source 均未传:一次性告警,返回 null 而非空白区域。
|
|
35
|
+
// types 注释已说明二选一语义;此 warn 用于开发期快速定位漏传。
|
|
36
|
+
log.warn('Thumbnail: uri 和 source 均未提供,组件将渲染为 null');
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
31
39
|
const dim = sizingFor(size);
|
|
32
40
|
const image = /*#__PURE__*/_jsx(Image, {
|
|
33
41
|
source: uri ? {
|
|
@@ -43,7 +51,7 @@ export function Thumbnail({
|
|
|
43
51
|
// ring 容器:borderRadius 比 image 大 (border + padding) 才能贴合包裹外圈
|
|
44
52
|
return /*#__PURE__*/_jsx(View, {
|
|
45
53
|
style: [styles.ring, {
|
|
46
|
-
borderRadius: dim.borderRadius +
|
|
54
|
+
borderRadius: dim.borderRadius + RING_EXTRA_RADIUS
|
|
47
55
|
}],
|
|
48
56
|
testID: testID,
|
|
49
57
|
children: image
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Image","View","useThemedStyles","makeStyles","sizingFor","jsx","_jsx","Thumbnail","uri","source","size","selected","style","resizeMode","accessibilityLabel","testID","styles","dim","image","base","accessible","undefined","ring","borderRadius","children"],"sourceRoot":"../../../../../src","sources":["components/ui/Thumbnail/Thumbnail.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AAC1C,SAASC,eAAe,QAAQ,yBAAgB;AAChD,SAASC,UAAU,EAAEC,SAAS,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","Image","View","useThemedStyles","createLogger","makeStyles","RING_EXTRA_RADIUS","sizingFor","jsx","_jsx","log","Thumbnail","uri","source","size","selected","style","resizeMode","accessibilityLabel","testID","styles","warn","dim","image","base","accessible","undefined","ring","borderRadius","children"],"sourceRoot":"../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AAK,EAAE,CACLI,MAAM,CAACO,IAAI,EACX;MAAEC,YAAY,EAAEN,GAAG,CAACM,YAAY,GAAGtB;IAAkB,CAAC,CACtD;IACFa,MAAM,EAAEA,MAAO;IAAAU,QAAA,EAEdN;EAAK,CACF,CAAC;AAEX","ignoreList":[]}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { r } from "../../../theme/index.js";
|
|
5
|
+
/** [L-94] ring 圆角外展量:border(2) + padding(1) = 3pt,让外圈圆角贴合内圆角。
|
|
6
|
+
* Thumbnail.tsx 侧用此常量替代魔数 `+ 3`。 */
|
|
7
|
+
export const RING_EXTRA_RADIUS = r(2) + r(1); // border + padding
|
|
8
|
+
|
|
5
9
|
/** Thumbnail 静态样式 ——
|
|
6
10
|
* - `base`:Image 占位色,加载中 / 失败时不至于空白
|
|
7
11
|
* - `ring`:`selected` 态的外圈品牌色描边,padding 抵消 ring 与 image 之间留 1pt gap */
|
|
@@ -10,9 +14,9 @@ export const makeStyles = c => StyleSheet.create({
|
|
|
10
14
|
backgroundColor: c.surfaceContainer
|
|
11
15
|
},
|
|
12
16
|
ring: {
|
|
13
|
-
borderWidth: 2,
|
|
17
|
+
borderWidth: r(2),
|
|
14
18
|
borderColor: c.primary,
|
|
15
|
-
padding: 1
|
|
19
|
+
padding: r(1)
|
|
16
20
|
}
|
|
17
21
|
});
|
|
18
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","r","makeStyles","c","create","base","backgroundColor","surfaceContainer","ring","borderWidth","borderColor","primary","padding","sizingFor","size","width","height","borderRadius"],"sourceRoot":"../../../../../src","sources":["components/ui/Thumbnail/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,CAAC,QAA0B,yBAAgB;AAGpD;AACA;AACA;AACA,OAAO,
|
|
1
|
+
{"version":3,"names":["StyleSheet","r","RING_EXTRA_RADIUS","makeStyles","c","create","base","backgroundColor","surfaceContainer","ring","borderWidth","borderColor","primary","padding","sizingFor","size","width","height","borderRadius"],"sourceRoot":"../../../../../src","sources":["components/ui/Thumbnail/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,CAAC,QAA0B,yBAAgB;AAGpD;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGD,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;AAE9C;AACA;AACA;AACA,OAAO,MAAME,UAAU,GAAIC,CAAc,IACvCJ,UAAU,CAACK,MAAM,CAAC;EAChBC,IAAI,EAAE;IACJC,eAAe,EAAEH,CAAC,CAACI;EACrB,CAAC;EACDC,IAAI,EAAE;IACJC,WAAW,EAAET,CAAC,CAAC,CAAC,CAAC;IACjBU,WAAW,EAAEP,CAAC,CAACQ,OAAO;IACtBC,OAAO,EAAEZ,CAAC,CAAC,CAAC;EACd;AACF,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMa,SAAS,GAAIC,IAAmB,IAAK;EAChD,QAAQA,IAAI;IACV,KAAK,IAAI;MACP,OAAO;QAAEC,KAAK,EAAEf,CAAC,CAAC,EAAE,CAAC;QAAEgB,MAAM,EAAEhB,CAAC,CAAC,EAAE,CAAC;QAAEiB,YAAY,EAAEjB,CAAC,CAAC,CAAC;MAAE,CAAC;IAC5D,KAAK,IAAI;MACP,OAAO;QAAEe,KAAK,EAAEf,CAAC,CAAC,GAAG,CAAC;QAAEgB,MAAM,EAAEhB,CAAC,CAAC,EAAE,CAAC;QAAEiB,YAAY,EAAEjB,CAAC,CAAC,EAAE;MAAE,CAAC;IAC9D,KAAK,IAAI;IACT;MACE;MACA,OAAO;QAAEe,KAAK,EAAEf,CAAC,CAAC,GAAG,CAAC;QAAEgB,MAAM,EAAEhB,CAAC,CAAC,EAAE,CAAC;QAAEiB,YAAY,EAAEjB,CAAC,CAAC,CAAC;MAAE,CAAC;EAC/D;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { Text, View } from 'react-native';
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { AccessibilityInfo, Text, View } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import Animated, { cancelAnimation, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
7
7
|
import { useColors, useThemedStyles, motion, space } from "../../../theme/index.js";
|
|
8
|
+
import { childTestID } from "../../../utils/testID/index.js";
|
|
8
9
|
import { dotColorFor, makeStyles } from "./styles.js";
|
|
9
10
|
import { _subs } from "./toast.js";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -35,8 +36,18 @@ export function ToastHost({
|
|
|
35
36
|
_subs.delete(sub);
|
|
36
37
|
};
|
|
37
38
|
}, []);
|
|
39
|
+
|
|
40
|
+
// 退场完成只清「仍是自己」的 entry:withTiming 完成回调经 runOnJS 跨线程异步投递,
|
|
41
|
+
// 投递到执行之间若来了新 toast,无 id 守卫的 setEntry(null) 会把新 toast 瞬时清掉([M-14])。
|
|
42
|
+
const dismissIfCurrent = useCallback(id => {
|
|
43
|
+
setEntry(cur => cur?.id === id ? null : cur);
|
|
44
|
+
}, []);
|
|
38
45
|
useEffect(() => {
|
|
39
46
|
if (!entry) return;
|
|
47
|
+
// [M-15] toast 出现时主动播报 —— 容器 pointerEvents="none" + 3s 自动消失,
|
|
48
|
+
// SR 用户对一闪而过的反馈本无任何感知通道。
|
|
49
|
+
AccessibilityInfo.announceForAccessibility(entry.message);
|
|
50
|
+
const id = entry.id;
|
|
40
51
|
// 进入方向:top 从上(-8)滑入,bottom / center 从下(8)滑入
|
|
41
52
|
const from = entry.position === 'top' ? -8 : 8;
|
|
42
53
|
cancelAnimation(op);
|
|
@@ -56,7 +67,7 @@ export function ToastHost({
|
|
|
56
67
|
ty.value = withTiming(from, {
|
|
57
68
|
duration: motion.base
|
|
58
69
|
}, finished => {
|
|
59
|
-
if (finished) runOnJS(
|
|
70
|
+
if (finished) runOnJS(dismissIfCurrent)(id);
|
|
60
71
|
});
|
|
61
72
|
}, entry.duration);
|
|
62
73
|
return () => {
|
|
@@ -64,7 +75,7 @@ export function ToastHost({
|
|
|
64
75
|
cancelAnimation(op);
|
|
65
76
|
cancelAnimation(ty);
|
|
66
77
|
};
|
|
67
|
-
}, [entry, op, ty]);
|
|
78
|
+
}, [entry, op, ty, dismissIfCurrent]);
|
|
68
79
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
69
80
|
opacity: op.value,
|
|
70
81
|
transform: [{
|
|
@@ -96,7 +107,7 @@ export function ToastHost({
|
|
|
96
107
|
}]
|
|
97
108
|
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
98
109
|
style: styles.text,
|
|
99
|
-
testID: testID
|
|
110
|
+
testID: childTestID(testID, 'text'),
|
|
100
111
|
children: entry.message
|
|
101
112
|
})]
|
|
102
113
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Text","View","useSafeAreaInsets","Animated","cancelAnimation","runOnJS","useAnimatedStyle","useSharedValue","withTiming","useColors","useThemedStyles","motion","space","dotColorFor","makeStyles","_subs","jsx","_jsx","jsxs","_jsxs","ToastHost","testID","c","styles","insets","entry","setEntry","op","ty","dismissTimer","sub","next","current","clearTimeout","add","delete","from","position","value","duration","base","setTimeout","finished","animatedStyle","opacity","transform","translateY","posStyle","top","bottom","justifyContent","dotColor","kind","style","host","pointerEvents","children","toast","dot","backgroundColor","text"
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","AccessibilityInfo","Text","View","useSafeAreaInsets","Animated","cancelAnimation","runOnJS","useAnimatedStyle","useSharedValue","withTiming","useColors","useThemedStyles","motion","space","childTestID","dotColorFor","makeStyles","_subs","jsx","_jsx","jsxs","_jsxs","ToastHost","testID","c","styles","insets","entry","setEntry","op","ty","dismissTimer","sub","next","current","clearTimeout","add","delete","dismissIfCurrent","id","cur","announceForAccessibility","message","from","position","value","duration","base","setTimeout","finished","animatedStyle","opacity","transform","translateY","posStyle","top","bottom","justifyContent","dotColor","kind","style","host","pointerEvents","children","toast","dot","backgroundColor","text"],"sourceRoot":"../../../../../src","sources":["components/ui/Toast/ToastHost.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAASC,iBAAiB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,OAAOC,QAAQ,IACbC,eAAe,EACfC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,KAAK,QAAQ,yBAAgB;AAC1E,SAASC,WAAW,QAAQ,gCAAuB;AACnD,SAASC,WAAW,EAAEC,UAAU,QAAQ,aAAU;AAClD,SAASC,KAAK,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAC;EACxBC;AACc,CAAC,GAAG,CAAC,CAAC,EAA4B;EAChD,MAAMC,CAAC,GAAGd,SAAS,CAAC,CAAC;EACrB,MAAMe,MAAM,GAAGd,eAAe,CAACK,UAAU,CAAC;EAC1C,MAAMU,MAAM,GAAGvB,iBAAiB,CAAC,CAAC;EAClC,MAAM,CAACwB,KAAK,EAAEC,QAAQ,CAAC,GAAG7B,QAAQ,CAAoB,IAAI,CAAC;EAC3D,MAAM8B,EAAE,GAAGrB,c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M,EAAE,CAAC;IAAEC,cAAc,EAAE;EAAkB,CAAC,GACxD;IAAED,MAAM,EAAE9B,MAAM,CAAC8B,MAAM,GAAG3C,KAAK,CAAC,EAAE;EAAE,CAAC;EAE7C,MAAM6C,QAAQ,GAAG3C,WAAW,CAACY,KAAK,CAACgC,IAAI,EAAEnC,CAAC,CAAC;EAE3C,oBACEL,IAAA,CAACjB,IAAI;IAAC0D,KAAK,EAAE,CAACnC,MAAM,CAACoC,IAAI,EAAEP,QAAQ,CAAE;IAACQ,aAAa,EAAC,MAAM;IAACvC,MAAM,EAAEA,MAAO;IAAAwC,QAAA,eACxE1C,KAAA,CAACjB,QAAQ,CAACF,IAAI;MAAC0D,KAAK,EAAE,CAACnC,MAAM,CAACuC,KAAK,EAAEd,aAAa,CAAE;MAAAa,QAAA,GACjDL,QAAQ,gBACPvC,IAAA,CAACjB,IAAI;QAAC0D,KAAK,EAAE,CAACnC,MAAM,CAACwC,GAAG,EAAE;UAAEC,eAAe,EAAER;QAAS,CAAC;MAAE,CAAE,CAAC,GAC1D,IAAI,eACRvC,IAAA,CAAClB,IAAI;QAAC2D,KAAK,EAAEnC,MAAM,CAAC0C,IAAK;QAAC5C,MAAM,EAAET,WAAW,CAACS,MAAM,EAAE,MAAM,CAAE;QAAAwC,QAAA,EAC3DpC,KAAK,CAACe;MAAO,CACV,CAAC;IAAA,CACM;EAAC,CACZ,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { Text, View } from 'react-native';
|
|
5
|
-
import {
|
|
4
|
+
import { AccessibilityInfo, Text, View } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { motion, space, useColors, usePrefersReducedMotion, useThemedStyles } from "../../../theme/index.js";
|
|
6
7
|
import { dotColorFor, makeStyles } from "./styles.js";
|
|
7
8
|
import { _subs } from "./toast.js";
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -21,6 +22,8 @@ export function ToastHost({
|
|
|
21
22
|
} = {}) {
|
|
22
23
|
const c = useColors();
|
|
23
24
|
const styles = useThemedStyles(makeStyles);
|
|
25
|
+
const insets = useSafeAreaInsets();
|
|
26
|
+
const reduced = usePrefersReducedMotion();
|
|
24
27
|
const [entry, setEntry] = useState(null);
|
|
25
28
|
const [visible, setVisible] = useState(false);
|
|
26
29
|
const dismissTimerRef = useRef(null);
|
|
@@ -38,6 +41,8 @@ export function ToastHost({
|
|
|
38
41
|
useEffect(() => {
|
|
39
42
|
// entry=null:上一轮 effect 的 cleanup 已清 timer/RAF,这里无需重复。
|
|
40
43
|
if (!entry) return;
|
|
44
|
+
// [M-15] web 同样主动播报(RN-Web announceForAccessibility 注入 aria-live region)。
|
|
45
|
+
AccessibilityInfo.announceForAccessibility(entry.message);
|
|
41
46
|
|
|
42
47
|
// cancelled 标志:entry 快速连续切换 / 组件卸载时,cleanup 置 true。RAF 与
|
|
43
48
|
// timer 回调执行前都检查它 —— cancelAnimationFrame 在部分浏览器不保证取消
|
|
@@ -72,14 +77,26 @@ export function ToastHost({
|
|
|
72
77
|
};
|
|
73
78
|
}, [entry]);
|
|
74
79
|
if (!entry) return null;
|
|
80
|
+
|
|
81
|
+
// 位置:top=顶部(safe-area + 间距)/ center=屏幕居中 / bottom=底部(默认),复刻 native 版。
|
|
82
|
+
// 此前 web 完全未注入定位,position 参数被静默忽略、垂直位置随挂载次序漂移([H-6])。
|
|
83
|
+
const posStyle = entry.position === 'top' ? {
|
|
84
|
+
top: insets.top + space[10]
|
|
85
|
+
} : entry.position === 'center' ? {
|
|
86
|
+
top: 0,
|
|
87
|
+
bottom: 0,
|
|
88
|
+
justifyContent: 'center'
|
|
89
|
+
} : {
|
|
90
|
+
bottom: insets.bottom + space[10]
|
|
91
|
+
};
|
|
75
92
|
const dotColor = dotColorFor(entry.kind, c);
|
|
76
93
|
const animatedWebStyle = {
|
|
77
94
|
opacity: visible ? 1 : 0,
|
|
78
95
|
transform: visible ? 'translateY(0px)' : 'translateY(8px)',
|
|
79
|
-
transition: `opacity ${motion.base}ms ease-out, transform ${motion.base}ms ease-out`
|
|
96
|
+
transition: reduced ? 'none' : `opacity ${motion.base}ms ease-out, transform ${motion.base}ms ease-out`
|
|
80
97
|
};
|
|
81
98
|
return /*#__PURE__*/_jsx(View, {
|
|
82
|
-
style: styles.host,
|
|
99
|
+
style: [styles.host, posStyle],
|
|
83
100
|
pointerEvents: "none",
|
|
84
101
|
testID: testID,
|
|
85
102
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Text","View","useColors","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","AccessibilityInfo","Text","View","useSafeAreaInsets","motion","space","useColors","usePrefersReducedMotion","useThemedStyles","dotColorFor","makeStyles","_subs","jsx","_jsx","jsxs","_jsxs","ToastHost","testID","c","styles","insets","reduced","entry","setEntry","visible","setVisible","dismissTimerRef","exitTimerRef","enterRafRef","sub","next","add","delete","announceForAccessibility","message","cancelled","current","requestAnimationFrame","setTimeout","base","duration","clearTimeout","cancelAnimationFrame","posStyle","position","top","bottom","justifyContent","dotColor","kind","animatedWebStyle","opacity","transform","transition","style","host","pointerEvents","children","toast","dot","backgroundColor","text","undefined"],"sourceRoot":"../../../../../src","sources":["components/ui/Toast/ToastHost.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,iBAAiB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SACEC,MAAM,EACNC,KAAK,EACLC,SAAS,EACTC,uBAAuB,EACvBC,eAAe,QACV,yBAAgB;AACvB,SAASC,WAAW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,EAAE1B,MAAM,CAAC0B,MAAM,GAAGzC,KAAK,CAAC,EAAE;EAAE,CAAC;EAE7C,MAAM2C,QAAQ,GAAGvC,WAAW,CAACa,KAAK,CAAC2B,IAAI,EAAE/B,CAAC,CAAC;EAC3C,MAAMgC,gBAAqC,GAAG;IAC5CC,OAAO,EAAE3B,OAAO,GAAG,CAAC,GAAG,CAAC;IACxB4B,SAAS,EAAE5B,OAAO,GAAG,iBAAiB,GAAG,iBAAiB;IAC1D6B,UAAU,EAAEhC,OAAO,GACf,MAAM,GACN,WAAWjB,MAAM,CAACmC,IAAI,0BAA0BnC,MAAM,CAACmC,IAAI;EACjE,CAAC;EAED,oBACE1B,IAAA,CAACX,IAAI;IAACoD,KAAK,EAAE,CAACnC,MAAM,CAACoC,IAAI,EAAEZ,QAAQ,CAAE;IAACa,aAAa,EAAC,MAAM;IAACvC,MAAM,EAAEA,MAAO;IAAAwC,QAAA,eACxE5C,IAAA;MAAKyC,KAAK,EAAEJ,gBAAiB;MAAAO,QAAA,eAC3B1C,KAAA,CAACb,IAAI;QAACoD,KAAK,EAAEnC,MAAM,CAACuC,KAAM;QAAAD,QAAA,GACvBT,QAAQ,gBACPnC,IAAA,CAACX,IAAI;UAACoD,KAAK,EAAE,CAACnC,MAAM,CAACwC,GAAG,EAAE;YAAEC,eAAe,EAAEZ;UAAS,CAAC;QAAE,CAAE,CAAC,GAC1D,IAAI,eACRnC,IAAA,CAACZ,IAAI;UACHqD,KAAK,EAAEnC,MAAM,CAAC0C,IAAK;UACnB5C,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,OAAO,GAAG6C,SAAU;UAAAL,QAAA,EAE7CnC,KAAK,CAACY;QAAO,CACV,CAAC;MAAA,CACH;IAAC,CACJ;EAAC,CACF,CAAC;AAEX","ignoreList":[]}
|
|
@@ -12,6 +12,8 @@ export const makeStyles = c => StyleSheet.create({
|
|
|
12
12
|
// zIndex: toast 浮层 —— 盖在 Screen 内容之上(navigator / overlay 之下)。
|
|
13
13
|
// 同级兄弟节点无 z 顺序需求,但作为 absolute 浮岛对其他屏内 absolute 节点
|
|
14
14
|
// 需要显式 200 抢占,保留并锁数值。
|
|
15
|
+
// 注意:confirm() 的原生 Modal 是 window 级,永远盖在 toast 之上 —— confirm
|
|
16
|
+
// 打开期间到达的 toast 不可见,勿把 toast 当作 confirm 显示期间的反馈通道。
|
|
15
17
|
zIndex: 200
|
|
16
18
|
},
|
|
17
19
|
toast: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","fw","r","radius","space","type","t","makeStyles","c","create","host","position","left","right","alignItems","zIndex","toast","flexDirection","gap","backgroundColor","inverseSurface","borderRadius","md","paddingHorizontal","paddingVertical","maxWidth","dot","width","height","text","color","inverseOnSurface","fontSize","sm","fontWeight","medium","flexShrink","dotColorFor","kind","success","error"],"sourceRoot":"../../../../../src","sources":["components/ui/Toast/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,EAAE,EAAEC,CAAC,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AAGhE,OAAO,MAAMC,UAAU,GAAIC,CAAc,IACvCR,UAAU,CAACS,MAAM,CAAC;EAChBC,IAAI,EAAE;IACJ;IACAC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,UAAU,EAAE,QAAQ;IACpB;IACA;IACA;IACAC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBI,GAAG,EAAEd,KAAK,CAAC,CAAC,CAAC;IACbe,eAAe,EAAEX,CAAC,CAACY,cAAc;IACjCC,YAAY,EAAElB,MAAM,CAACmB,EAAE;IACvBC,iBAAiB,EAAEnB,KAAK,CAAC,CAAC,CAAC;IAC3BoB,eAAe,EAAEpB,KAAK,CAAC,CAAC,CAAC;IACzBqB,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACH;IACAC,KAAK,EAAEzB,CAAC,CAAC,CAAC,CAAC;IACX0B,MAAM,EAAE1B,CAAC,CAAC,CAAC,CAAC;IACZmB,YAAY,EAAEnB,CAAC,CAAC,CAAC;EACnB,CAAC;EACD2B,IAAI,EAAE;IACJC,KAAK,EAAEtB,CAAC,CAACuB,gBAAgB;IACzBC,QAAQ,EAAE1B,CAAC,CAAC2B,EAAE;IACdC,UAAU,EAAEjC,EAAE,CAACkC,MAAM;IACrBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,IAAe,EAAE9B,CAAc,EAAiB;EAC1E,QAAQ8B,IAAI;IACV,KAAK,SAAS;MACZ,OAAO9B,CAAC,CAAC+B,OAAO;IAClB,KAAK,OAAO;MACV,OAAO/B,CAAC,CAACgC,KAAK;IAChB,KAAK,MAAM;MACT,OAAO,IAAI;EACf;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["StyleSheet","fw","r","radius","space","type","t","makeStyles","c","create","host","position","left","right","alignItems","zIndex","toast","flexDirection","gap","backgroundColor","inverseSurface","borderRadius","md","paddingHorizontal","paddingVertical","maxWidth","dot","width","height","text","color","inverseOnSurface","fontSize","sm","fontWeight","medium","flexShrink","dotColorFor","kind","success","error"],"sourceRoot":"../../../../../src","sources":["components/ui/Toast/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,EAAE,EAAEC,CAAC,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AAGhE,OAAO,MAAMC,UAAU,GAAIC,CAAc,IACvCR,UAAU,CAACS,MAAM,CAAC;EAChBC,IAAI,EAAE;IACJ;IACAC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,UAAU,EAAE,QAAQ;IACpB;IACA;IACA;IACA;IACA;IACAC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLC,aAAa,EAAE,KAAK;IACpBH,UAAU,EAAE,QAAQ;IACpBI,GAAG,EAAEd,KAAK,CAAC,CAAC,CAAC;IACbe,eAAe,EAAEX,CAAC,CAACY,cAAc;IACjCC,YAAY,EAAElB,MAAM,CAACmB,EAAE;IACvBC,iBAAiB,EAAEnB,KAAK,CAAC,CAAC,CAAC;IAC3BoB,eAAe,EAAEpB,KAAK,CAAC,CAAC,CAAC;IACzBqB,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACH;IACAC,KAAK,EAAEzB,CAAC,CAAC,CAAC,CAAC;IACX0B,MAAM,EAAE1B,CAAC,CAAC,CAAC,CAAC;IACZmB,YAAY,EAAEnB,CAAC,CAAC,CAAC;EACnB,CAAC;EACD2B,IAAI,EAAE;IACJC,KAAK,EAAEtB,CAAC,CAACuB,gBAAgB;IACzBC,QAAQ,EAAE1B,CAAC,CAAC2B,EAAE;IACdC,UAAU,EAAEjC,EAAE,CAACkC,MAAM;IACrBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,IAAe,EAAE9B,CAAc,EAAiB;EAC1E,QAAQ8B,IAAI;IACV,KAAK,SAAS;MACZ,OAAO9B,CAAC,CAAC+B,OAAO;IAClB,KAAK,OAAO;MACV,OAAO/B,CAAC,CAACgC,KAAK;IAChB,KAAK,MAAM;MACT,OAAO,IAAI;EACf;AACF","ignoreList":[]}
|
|
@@ -5,23 +5,43 @@
|
|
|
5
5
|
*
|
|
6
6
|
* 文件名故意小写 `toast.ts`,host 组件叫 `ToastHost.tsx`,避免 APFS 大小写冲突。
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
9
|
+
const log = createLogger('toast');
|
|
9
10
|
let _id = 0;
|
|
10
11
|
export const _subs = new Set();
|
|
12
|
+
const DEFAULT_DURATION = 3000;
|
|
13
|
+
// [L-55] duration 合法域:[1, 2^31)。INT32_MAX = 2^31-1 = 2147483647,
|
|
14
|
+
// setTimeout 内部用 int32 存储,超出会溢出变成 0 立即触发。
|
|
15
|
+
const MAX_DURATION = 2147483647;
|
|
16
|
+
|
|
17
|
+
/** [L-55] 钳制 duration 到 [1, 2^31),域外回落 DEFAULT_DURATION 并 dev warn。 */
|
|
18
|
+
function clampDuration(raw) {
|
|
19
|
+
if (raw == null) return DEFAULT_DURATION;
|
|
20
|
+
if (!Number.isFinite(raw) || raw < 1 || raw >= MAX_DURATION) {
|
|
21
|
+
log.warn(`toast duration(${raw}) 超出合法域 [1, 2^31),已回落 ${DEFAULT_DURATION}ms。`);
|
|
22
|
+
return DEFAULT_DURATION;
|
|
23
|
+
}
|
|
24
|
+
return Math.trunc(raw);
|
|
25
|
+
}
|
|
11
26
|
function emit(input, kind = 'info') {
|
|
12
27
|
const entry = typeof input === 'string' ? {
|
|
13
28
|
id: ++_id,
|
|
14
29
|
message: input,
|
|
15
30
|
kind,
|
|
16
|
-
duration:
|
|
31
|
+
duration: DEFAULT_DURATION,
|
|
17
32
|
position: 'bottom'
|
|
18
33
|
} : {
|
|
19
34
|
id: ++_id,
|
|
20
35
|
message: input.message,
|
|
21
36
|
kind: input.kind ?? kind,
|
|
22
|
-
duration: input.duration
|
|
37
|
+
duration: clampDuration(input.duration),
|
|
23
38
|
position: input.position ?? 'bottom'
|
|
24
39
|
};
|
|
40
|
+
// 未挂 <ToastHost />:消息无人接收,告警提示集成漏挂(对照 confirm 重入告警的纪律)。
|
|
41
|
+
if (_subs.size === 0) {
|
|
42
|
+
log.warn('toast() 调用时未挂载 <ToastHost />,消息被丢弃。请在 app 根附近挂一次 <ToastHost />。');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
25
45
|
_subs.forEach(s => s(entry));
|
|
26
46
|
}
|
|
27
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_id","_subs","Set","emit","input","kind","entry","id","message","duration","position","forEach","s","toast","Object","assign","info","success","error"],"sourceRoot":"../../../../../src","sources":["components/ui/Toast/toast.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["createLogger","log","_id","_subs","Set","DEFAULT_DURATION","MAX_DURATION","clampDuration","raw","Number","isFinite","warn","Math","trunc","emit","input","kind","entry","id","message","duration","position","size","forEach","s","toast","Object","assign","info","success","error"],"sourceRoot":"../../../../../src","sources":["components/ui/Toast/toast.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,gCAAuB;AAGpD,MAAMC,GAAG,GAAGD,YAAY,CAAC,OAAO,CAAC;AAEjC,IAAIE,GAAG,GAAG,CAAC;AACX,OAAO,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAa,CAAC;AAE1C,MAAMC,gBAAgB,GAAG,IAAI;AAC7B;AACA;AACA,MAAMC,YAAY,GAAG,UAAU;;AAE/B;AACA,SAASC,aAAaA,CAACC,GAAuB,EAAU;EACtD,IAAIA,GAAG,IAAI,IAAI,EAAE,OAAOH,gBAAgB;EACxC,IAAI,CAACI,MAAM,CAACC,QAAQ,CAACF,GAAG,CAAC,IAAIA,GAAG,GAAG,CAAC,IAAIA,GAAG,IAAIF,YAAY,EAAE;IAC3DL,GAAG,CAACU,IAAI,CACN,kBAAkBH,GAAG,yBAAyBH,gBAAgB,KAChE,CAAC;IACD,OAAOA,gBAAgB;EACzB;EACA,OAAOO,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;AACxB;AAEA,SAASM,IAAIA,CAACC,KAAiB,EAAEC,IAAe,GAAG,MAAM,EAAE;EACzD,MAAMC,KAAiB,GACrB,OAAOF,KAAK,KAAK,QAAQ,GACrB;IACEG,EAAE,EAAE,EAAEhB,GAAG;IACTiB,OAAO,EAAEJ,KAAK;IACdC,IAAI;IACJI,QAAQ,EAAEf,gBAAgB;IAC1BgB,QAAQ,EAAE;EACZ,CAAC,GACD;IACEH,EAAE,EAAE,EAAEhB,GAAG;IACTiB,OAAO,EAAEJ,KAAK,CAACI,OAAO;IACtBH,IAAI,EAAED,KAAK,CAACC,IAAI,IAAIA,IAAI;IACxBI,QAAQ,EAAEb,aAAa,CAACQ,KAAK,CAACK,QAAQ,CAAC;IACvCC,QAAQ,EAAEN,KAAK,CAACM,QAAQ,IAAI;EAC9B,CAAC;EACP;EACA,IAAIlB,KAAK,CAACmB,IAAI,KAAK,CAAC,EAAE;IACpBrB,GAAG,CAACU,IAAI,CACN,iEACF,CAAC;IACD;EACF;EACAR,KAAK,CAACoB,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACP,KAAK,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMQ,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAEZ,KAAiB,IAAKD,IAAI,CAACC,KAAK,EAAE,MAAM,CAAC,EAAE;EAC7Ea,IAAI,EAAGb,KAAiB,IAAKD,IAAI,CAACC,KAAK,EAAE,MAAM,CAAC;EAChDc,OAAO,EAAGd,KAAiB,IAAKD,IAAI,CAACC,KAAK,EAAE,SAAS,CAAC;EACtDe,KAAK,EAAGf,KAAiB,IAAKD,IAAI,CAACC,KAAK,EAAE,OAAO;AACnD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
import { fw, r, radius, space, type as t } from "../../../theme/index.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 角标样式工厂 —— Grid/TabBar 等组件图标右上角小红点共用。
|
|
8
|
+
* @param c 颜色 token
|
|
9
|
+
* @param top 角标纵向偏移(不同场景基点不同:Grid 图标 r(-6) / TabBar 图标 r(-3))
|
|
10
|
+
*/
|
|
11
|
+
export const badgeStyles = (c, top) => StyleSheet.create({
|
|
12
|
+
badge: {
|
|
13
|
+
position: 'absolute',
|
|
14
|
+
top,
|
|
15
|
+
right: r(-10),
|
|
16
|
+
minWidth: r(16),
|
|
17
|
+
height: r(16),
|
|
18
|
+
borderRadius: radius.md,
|
|
19
|
+
backgroundColor: c.error,
|
|
20
|
+
paddingHorizontal: space[1],
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center'
|
|
23
|
+
},
|
|
24
|
+
badgeText: {
|
|
25
|
+
color: c.onError,
|
|
26
|
+
fontSize: t.nano,
|
|
27
|
+
fontWeight: fw.bold,
|
|
28
|
+
lineHeight: 12
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=badgeStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","fw","r","radius","space","type","t","badgeStyles","c","top","create","badge","position","right","minWidth","height","borderRadius","md","backgroundColor","error","paddingHorizontal","alignItems","justifyContent","badgeText","color","onError","fontSize","nano","fontWeight","bold","lineHeight"],"sourceRoot":"../../../../../src","sources":["components/ui/shared/badgeStyles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SACEC,EAAE,EACFC,CAAC,EACDC,MAAM,EACNC,KAAK,EACLC,IAAI,IAAIC,CAAC,QAEJ,yBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGA,CAACC,CAAc,EAAEC,GAAW,KACrDT,UAAU,CAACU,MAAM,CAAC;EAChBC,KAAK,EAAE;IACLC,QAAQ,EAAE,UAAU;IACpBH,GAAG;IACHI,KAAK,EAAEX,CAAC,CAAC,CAAC,EAAE,CAAC;IACbY,QAAQ,EAAEZ,CAAC,CAAC,EAAE,CAAC;IACfa,MAAM,EAAEb,CAAC,CAAC,EAAE,CAAC;IACbc,YAAY,EAAEb,MAAM,CAACc,EAAE;IACvBC,eAAe,EAAEV,CAAC,CAACW,KAAK;IACxBC,iBAAiB,EAAEhB,KAAK,CAAC,CAAC,CAAC;IAC3BiB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDC,SAAS,EAAE;IACTC,KAAK,EAAEhB,CAAC,CAACiB,OAAO;IAChBC,QAAQ,EAAEpB,CAAC,CAACqB,IAAI;IAChBC,UAAU,EAAE3B,EAAE,CAAC4B,IAAI;IACnBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|