@unif/react-native-design 0.20.0 → 0.21.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 +68 -12
- package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js +4 -5
- package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js.map +1 -1
- package/lib/module/components/business/AvatarWithRing/styles.js +10 -9
- package/lib/module/components/business/AvatarWithRing/styles.js.map +1 -1
- package/lib/module/components/business/VersionPill/VersionPill.js +32 -15
- package/lib/module/components/business/VersionPill/VersionPill.js.map +1 -1
- package/lib/module/components/business/VersionPill/content.js +30 -0
- package/lib/module/components/business/VersionPill/content.js.map +1 -0
- package/lib/module/components/business/VersionPill/styles.js +4 -0
- package/lib/module/components/business/VersionPill/styles.js.map +1 -1
- package/lib/module/components/business/useSvgId.js +17 -8
- package/lib/module/components/business/useSvgId.js.map +1 -1
- package/lib/module/components/ui/Avatar/Avatar.js +22 -29
- package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/ui/Button/Button.js +40 -23
- package/lib/module/components/ui/Button/Button.js.map +1 -1
- package/lib/module/components/ui/Button/ButtonBase.js +13 -13
- package/lib/module/components/ui/Button/ButtonBase.js.map +1 -1
- package/lib/module/components/ui/Carousel/Carousel.js +68 -40
- package/lib/module/components/ui/Carousel/Carousel.js.map +1 -1
- package/lib/module/components/ui/Carousel/behavior.js +60 -0
- package/lib/module/components/ui/Carousel/behavior.js.map +1 -0
- package/lib/module/components/ui/Carousel/styles.js +6 -8
- package/lib/module/components/ui/Carousel/styles.js.map +1 -1
- package/lib/module/components/ui/Cell/Cell.js +76 -65
- package/lib/module/components/ui/Cell/Cell.js.map +1 -1
- package/lib/module/components/ui/Cell/Leading.js +11 -5
- package/lib/module/components/ui/Cell/Leading.js.map +1 -1
- package/lib/module/components/ui/Cell/content.js +34 -0
- package/lib/module/components/ui/Cell/content.js.map +1 -0
- package/lib/module/components/ui/Checkbox/Checkbox.js +25 -8
- package/lib/module/components/ui/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/ui/Confirm/ConfirmHost.js +49 -25
- package/lib/module/components/ui/Confirm/ConfirmHost.js.map +1 -1
- package/lib/module/components/ui/Confirm/confirm.js +15 -29
- package/lib/module/components/ui/Confirm/confirm.js.map +1 -1
- package/lib/module/components/ui/Confirm/labels.js +10 -0
- package/lib/module/components/ui/Confirm/labels.js.map +1 -0
- package/lib/module/components/ui/Confirm/store.js +113 -0
- package/lib/module/components/ui/Confirm/store.js.map +1 -0
- package/lib/module/components/ui/Confirm/styles.js +4 -0
- package/lib/module/components/ui/Confirm/styles.js.map +1 -1
- package/lib/module/components/ui/DrawerHeader/DrawerHeader.js +17 -25
- package/lib/module/components/ui/DrawerHeader/DrawerHeader.js.map +1 -1
- package/lib/module/components/ui/Grid/Grid.js +26 -9
- package/lib/module/components/ui/Grid/Grid.js.map +1 -1
- package/lib/module/components/ui/Grid/accessibility.js +13 -0
- package/lib/module/components/ui/Grid/accessibility.js.map +1 -0
- package/lib/module/components/ui/IconButton/IconButton.js +16 -3
- package/lib/module/components/ui/IconButton/IconButton.js.map +1 -1
- package/lib/module/components/ui/Input/Input.js +8 -5
- package/lib/module/components/ui/Input/Input.js.map +1 -1
- package/lib/module/components/ui/Logo/Logo.js +22 -4
- package/lib/module/components/ui/Logo/Logo.js.map +1 -1
- package/lib/module/components/ui/NavBar/NavBar.js +23 -14
- package/lib/module/components/ui/NavBar/NavBar.js.map +1 -1
- package/lib/module/components/ui/NavBar/isSlot.js +297 -4
- package/lib/module/components/ui/NavBar/isSlot.js.map +1 -1
- package/lib/module/components/ui/PasswordInput/PasswordInput.js +61 -66
- package/lib/module/components/ui/PasswordInput/PasswordInput.js.map +1 -1
- package/lib/module/components/ui/Pulse/Pulse.js +1 -1
- package/lib/module/components/ui/Pulse/Pulse.js.map +1 -1
- package/lib/module/components/ui/Pulse/PulseDot.js +5 -7
- package/lib/module/components/ui/Pulse/PulseDot.js.map +1 -1
- package/lib/module/components/ui/Pulse/index.js +1 -1
- package/lib/module/components/ui/Pulse/index.js.map +1 -1
- package/lib/module/components/ui/Pulse/normalizePulseOptions.js +45 -0
- package/lib/module/components/ui/Pulse/normalizePulseOptions.js.map +1 -0
- package/lib/module/components/ui/Pulse/usePulse.js +61 -24
- package/lib/module/components/ui/Pulse/usePulse.js.map +1 -1
- package/lib/module/components/ui/Pulse/usePulseDriver.js +44 -0
- package/lib/module/components/ui/Pulse/usePulseDriver.js.map +1 -0
- package/lib/module/components/ui/Pulse/usePulseDriver.web.js +67 -0
- package/lib/module/components/ui/Pulse/usePulseDriver.web.js.map +1 -0
- package/lib/module/components/ui/Radio/Radio.js +31 -14
- package/lib/module/components/ui/Radio/Radio.js.map +1 -1
- package/lib/module/components/ui/Radio/RadioGroup.js +15 -2
- package/lib/module/components/ui/Radio/RadioGroup.js.map +1 -1
- package/lib/module/components/ui/Reveal/Reveal.js +4 -3
- package/lib/module/components/ui/Reveal/Reveal.js.map +1 -1
- package/lib/module/components/ui/Reveal/Reveal.web.js +55 -32
- package/lib/module/components/ui/Reveal/Reveal.web.js.map +1 -1
- package/lib/module/components/ui/Reveal/webTransition.js +157 -0
- package/lib/module/components/ui/Reveal/webTransition.js.map +1 -0
- package/lib/module/components/ui/Search/Search.js +85 -58
- package/lib/module/components/ui/Search/Search.js.map +1 -1
- package/lib/module/components/ui/Segmented/Segmented.js +4 -2
- package/lib/module/components/ui/Segmented/Segmented.js.map +1 -1
- package/lib/module/components/ui/Skeleton/Skeleton.js +5 -7
- package/lib/module/components/ui/Skeleton/Skeleton.js.map +1 -1
- package/lib/module/components/ui/Spinner/Spinner.js +18 -11
- package/lib/module/components/ui/Spinner/Spinner.js.map +1 -1
- package/lib/module/components/ui/Spinner/Spinner.web.js +18 -14
- package/lib/module/components/ui/Spinner/Spinner.web.js.map +1 -1
- package/lib/module/components/ui/Spinner/shared.js +6 -0
- package/lib/module/components/ui/Spinner/shared.js.map +1 -1
- package/lib/module/components/ui/Stepper/Stepper.js +131 -99
- package/lib/module/components/ui/Stepper/Stepper.js.map +1 -1
- package/lib/module/components/ui/Stepper/StepperPressable.js +4 -0
- package/lib/module/components/ui/Stepper/StepperPressable.js.map +1 -0
- package/lib/module/components/ui/Stepper/StepperPressable.web.js +4 -0
- package/lib/module/components/ui/Stepper/StepperPressable.web.js.map +1 -0
- package/lib/module/components/ui/Stepper/accessibility.js +30 -0
- package/lib/module/components/ui/Stepper/accessibility.js.map +1 -0
- package/lib/module/components/ui/Stepper/accessibility.types.js +4 -0
- package/lib/module/components/ui/Stepper/accessibility.types.js.map +1 -0
- package/lib/module/components/ui/Stepper/accessibility.web.js +57 -0
- package/lib/module/components/ui/Stepper/accessibility.web.js.map +1 -0
- package/lib/module/components/ui/Stepper/layout.js +28 -0
- package/lib/module/components/ui/Stepper/layout.js.map +1 -0
- package/lib/module/components/ui/Stepper/normalizeStepper.js +53 -0
- package/lib/module/components/ui/Stepper/normalizeStepper.js.map +1 -0
- package/lib/module/components/ui/Stepper/styles.js +9 -2
- package/lib/module/components/ui/Stepper/styles.js.map +1 -1
- package/lib/module/components/ui/Switch/Switch.js +45 -19
- package/lib/module/components/ui/Switch/Switch.js.map +1 -1
- package/lib/module/components/ui/Switch/Switch.web.js +47 -20
- package/lib/module/components/ui/Switch/Switch.web.js.map +1 -1
- package/lib/module/components/ui/Switch/styles.js +12 -5
- package/lib/module/components/ui/Switch/styles.js.map +1 -1
- package/lib/module/components/ui/Tag/Tag.js +3 -2
- package/lib/module/components/ui/Tag/Tag.js.map +1 -1
- package/lib/module/components/ui/TextField/TextFieldBase.js +131 -86
- package/lib/module/components/ui/TextField/TextFieldBase.js.map +1 -1
- package/lib/module/components/ui/TextField/TextFieldSlot.js +82 -0
- package/lib/module/components/ui/TextField/TextFieldSlot.js.map +1 -0
- package/lib/module/components/ui/TextField/normalize.js +238 -0
- package/lib/module/components/ui/TextField/normalize.js.map +1 -0
- package/lib/module/components/ui/TextField/styles.js +31 -0
- package/lib/module/components/ui/TextField/styles.js.map +1 -1
- package/lib/module/components/ui/TextField/useErrorAnnouncement.js +27 -0
- package/lib/module/components/ui/TextField/useErrorAnnouncement.js.map +1 -0
- package/lib/module/components/ui/TextField/useTextFieldValue.js +66 -0
- package/lib/module/components/ui/TextField/useTextFieldValue.js.map +1 -0
- package/lib/module/components/ui/TextField/valueState.js +93 -0
- package/lib/module/components/ui/TextField/valueState.js.map +1 -0
- package/lib/module/components/ui/Textarea/Textarea.js +7 -3
- package/lib/module/components/ui/Textarea/Textarea.js.map +1 -1
- package/lib/module/components/ui/Thumbnail/Thumbnail.js +67 -48
- package/lib/module/components/ui/Thumbnail/Thumbnail.js.map +1 -1
- package/lib/module/components/ui/Thumbnail/normalize.js +58 -0
- package/lib/module/components/ui/Thumbnail/normalize.js.map +1 -0
- package/lib/module/components/ui/Thumbnail/styles.js +6 -11
- package/lib/module/components/ui/Thumbnail/styles.js.map +1 -1
- package/lib/module/components/ui/Toast/ToastHost.js +64 -21
- package/lib/module/components/ui/Toast/ToastHost.js.map +1 -1
- package/lib/module/components/ui/Toast/ToastHost.web.js +73 -24
- package/lib/module/components/ui/Toast/ToastHost.web.js.map +1 -1
- package/lib/module/components/ui/Toast/store.js +110 -0
- package/lib/module/components/ui/Toast/store.js.map +1 -0
- package/lib/module/components/ui/Toast/toast.js +17 -7
- package/lib/module/components/ui/Toast/toast.js.map +1 -1
- package/lib/module/components/ui/index.js.map +1 -1
- package/lib/module/components/ui/shared/ImageAttempt.js +28 -0
- package/lib/module/components/ui/shared/ImageAttempt.js.map +1 -0
- package/lib/module/components/ui/shared/a11y.js +21 -0
- package/lib/module/components/ui/shared/a11y.js.map +1 -0
- package/lib/module/components/ui/shared/accessibilityName.js +9 -0
- package/lib/module/components/ui/shared/accessibilityName.js.map +1 -0
- package/lib/module/components/ui/shared/selectImageAttemptSource.js +5 -0
- package/lib/module/components/ui/shared/selectImageAttemptSource.js.map +1 -0
- package/lib/module/components/ui/shared/selectImageAttemptSource.shared.js +13 -0
- package/lib/module/components/ui/shared/selectImageAttemptSource.shared.js.map +1 -0
- package/lib/module/components/ui/shared/selectImageAttemptSource.web.js +5 -0
- package/lib/module/components/ui/shared/selectImageAttemptSource.web.js.map +1 -0
- package/lib/module/icons/data.js +1 -1
- package/lib/module/icons/data.js.map +1 -1
- package/lib/module/theme/ThemeProvider.js +14 -4
- package/lib/module/theme/ThemeProvider.js.map +1 -1
- package/lib/module/theme/fontScale.js +13 -0
- package/lib/module/theme/fontScale.js.map +1 -0
- package/lib/module/theme/index.js +2 -4
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/themeContext.js +15 -0
- package/lib/module/theme/themeContext.js.map +1 -0
- package/lib/module/theme/themeDiagnostics.js +29 -0
- package/lib/module/theme/themeDiagnostics.js.map +1 -0
- package/lib/module/theme/usePrefersReducedMotion.js +11 -4
- package/lib/module/theme/usePrefersReducedMotion.js.map +1 -1
- package/lib/module/theme/usePrefersReducedMotion.web.js +5 -2
- package/lib/module/theme/usePrefersReducedMotion.web.js.map +1 -1
- package/lib/module/theme/useTheme.js +12 -25
- package/lib/module/theme/useTheme.js.map +1 -1
- package/lib/module/theme/useThemedStyles.js +9 -6
- package/lib/module/theme/useThemedStyles.js.map +1 -1
- package/lib/module/utils/imageSource.js +198 -0
- package/lib/module/utils/imageSource.js.map +1 -0
- package/lib/typescript/manual-tests/runtime-api/RuntimeApiScreen.d.ts +12 -0
- package/lib/typescript/manual-tests/runtime-api/RuntimeApiScreen.d.ts.map +1 -0
- package/lib/typescript/src/components/business/AvatarWithRing/AvatarWithRing.d.ts.map +1 -1
- package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts +8 -7
- package/lib/typescript/src/components/business/AvatarWithRing/styles.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/content.d.ts +19 -0
- package/lib/typescript/src/components/business/VersionPill/content.d.ts.map +1 -0
- package/lib/typescript/src/components/business/VersionPill/index.d.ts +1 -1
- package/lib/typescript/src/components/business/VersionPill/index.d.ts.map +1 -1
- package/lib/typescript/src/components/business/VersionPill/styles.d.ts +4 -0
- package/lib/typescript/src/components/business/VersionPill/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/business/VersionPill/types.d.ts +6 -2
- 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 +6 -5
- package/lib/typescript/src/components/business/useSvgId.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts +2 -2
- package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Avatar/types.d.ts +6 -2
- package/lib/typescript/src/components/ui/Avatar/types.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 +5 -3
- package/lib/typescript/src/components/ui/Button/ButtonBase.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Button/types.d.ts +5 -3
- package/lib/typescript/src/components/ui/Button/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Carousel/Carousel.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Carousel/behavior.d.ts +25 -0
- package/lib/typescript/src/components/ui/Carousel/behavior.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Carousel/styles.d.ts +4 -6
- package/lib/typescript/src/components/ui/Carousel/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Carousel/types.d.ts +14 -6
- package/lib/typescript/src/components/ui/Carousel/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/Cell.d.ts +1 -1
- package/lib/typescript/src/components/ui/Cell/Cell.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/Leading.d.ts +2 -3
- package/lib/typescript/src/components/ui/Cell/Leading.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/content.d.ts +18 -0
- package/lib/typescript/src/components/ui/Cell/content.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Cell/index.d.ts +1 -1
- package/lib/typescript/src/components/ui/Cell/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Cell/types.d.ts +66 -30
- package/lib/typescript/src/components/ui/Cell/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Checkbox/Checkbox.d.ts +1 -1
- package/lib/typescript/src/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Checkbox/types.d.ts +12 -3
- package/lib/typescript/src/components/ui/Checkbox/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts +6 -3
- package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/confirm.d.ts +10 -4
- package/lib/typescript/src/components/ui/Confirm/confirm.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/labels.d.ts +6 -0
- package/lib/typescript/src/components/ui/Confirm/labels.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Confirm/store.d.ts +44 -0
- package/lib/typescript/src/components/ui/Confirm/store.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Confirm/styles.d.ts +3 -0
- package/lib/typescript/src/components/ui/Confirm/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Confirm/types.d.ts +0 -9
- package/lib/typescript/src/components/ui/Confirm/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/DrawerHeader/DrawerHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts +7 -1
- package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Grid/accessibility.d.ts +5 -0
- package/lib/typescript/src/components/ui/Grid/accessibility.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Grid/types.d.ts +2 -0
- package/lib/typescript/src/components/ui/Grid/types.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 +4 -2
- package/lib/typescript/src/components/ui/IconButton/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Input/Input.d.ts +5 -383
- package/lib/typescript/src/components/ui/Input/Input.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Input/index.d.ts +1 -0
- package/lib/typescript/src/components/ui/Input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Input/types.d.ts +3 -17
- package/lib/typescript/src/components/ui/Input/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Logo/Logo.d.ts +2 -2
- package/lib/typescript/src/components/ui/Logo/Logo.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Logo/types.d.ts +2 -2
- package/lib/typescript/src/components/ui/Logo/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar/NavBar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar/index.d.ts +1 -1
- package/lib/typescript/src/components/ui/NavBar/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar/isSlot.d.ts +24 -4
- package/lib/typescript/src/components/ui/NavBar/isSlot.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar/types.d.ts +8 -8
- package/lib/typescript/src/components/ui/NavBar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts +6 -14
- package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/PasswordInput/types.d.ts +4 -14
- package/lib/typescript/src/components/ui/PasswordInput/types.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/normalizePulseOptions.d.ts +32 -0
- package/lib/typescript/src/components/ui/Pulse/normalizePulseOptions.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Pulse/usePulse.d.ts +10 -5
- package/lib/typescript/src/components/ui/Pulse/usePulse.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Pulse/usePulseDriver.d.ts +11 -0
- package/lib/typescript/src/components/ui/Pulse/usePulseDriver.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Pulse/usePulseDriver.web.d.ts +18 -0
- package/lib/typescript/src/components/ui/Pulse/usePulseDriver.web.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Radio/Radio.d.ts +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 +2 -2
- package/lib/typescript/src/components/ui/Radio/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Radio/types.d.ts +14 -3
- package/lib/typescript/src/components/ui/Radio/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Reveal/Reveal.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts +2 -8
- package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Reveal/types.d.ts +1 -1
- package/lib/typescript/src/components/ui/Reveal/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Reveal/webTransition.d.ts +38 -0
- package/lib/typescript/src/components/ui/Reveal/webTransition.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Search/Search.d.ts +4 -214
- package/lib/typescript/src/components/ui/Search/Search.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Search/types.d.ts +13 -6
- package/lib/typescript/src/components/ui/Search/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts +3 -3
- package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Spinner/Spinner.d.ts +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 +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 -1
- package/lib/typescript/src/components/ui/Spinner/types.d.ts +1 -1
- package/lib/typescript/src/components/ui/Spinner/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Stepper/Stepper.d.ts +3 -3
- package/lib/typescript/src/components/ui/Stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Stepper/StepperPressable.d.ts +2 -0
- package/lib/typescript/src/components/ui/Stepper/StepperPressable.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/StepperPressable.web.d.ts +2 -0
- package/lib/typescript/src/components/ui/Stepper/StepperPressable.web.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/accessibility.d.ts +3 -0
- package/lib/typescript/src/components/ui/Stepper/accessibility.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/accessibility.types.d.ts +23 -0
- package/lib/typescript/src/components/ui/Stepper/accessibility.types.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/accessibility.web.d.ts +9 -0
- package/lib/typescript/src/components/ui/Stepper/accessibility.web.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/layout.d.ts +22 -0
- package/lib/typescript/src/components/ui/Stepper/layout.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/normalizeStepper.d.ts +31 -0
- package/lib/typescript/src/components/ui/Stepper/normalizeStepper.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Stepper/styles.d.ts +9 -2
- package/lib/typescript/src/components/ui/Stepper/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Stepper/types.d.ts +3 -1
- package/lib/typescript/src/components/ui/Stepper/types.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 +9 -3
- package/lib/typescript/src/components/ui/Switch/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Switch/types.d.ts +2 -2
- package/lib/typescript/src/components/ui/Switch/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tag/Tag.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts +4 -401
- package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TextField/TextFieldSlot.d.ts +13 -0
- package/lib/typescript/src/components/ui/TextField/TextFieldSlot.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/TextField/normalize.d.ts +51 -0
- package/lib/typescript/src/components/ui/TextField/normalize.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/TextField/styles.d.ts +30 -0
- package/lib/typescript/src/components/ui/TextField/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TextField/types.d.ts +92 -18
- package/lib/typescript/src/components/ui/TextField/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/TextField/useErrorAnnouncement.d.ts +3 -0
- package/lib/typescript/src/components/ui/TextField/useErrorAnnouncement.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/TextField/useTextFieldValue.d.ts +18 -0
- package/lib/typescript/src/components/ui/TextField/useTextFieldValue.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/TextField/valueState.d.ts +50 -0
- package/lib/typescript/src/components/ui/TextField/valueState.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts +4 -382
- package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Textarea/index.d.ts +1 -0
- package/lib/typescript/src/components/ui/Textarea/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Textarea/types.d.ts +3 -14
- package/lib/typescript/src/components/ui/Textarea/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/Thumbnail.d.ts +5 -12
- package/lib/typescript/src/components/ui/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/index.d.ts +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/normalize.d.ts +13 -0
- package/lib/typescript/src/components/ui/Thumbnail/normalize.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts +4 -8
- package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Thumbnail/types.d.ts +21 -13
- package/lib/typescript/src/components/ui/Thumbnail/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/ToastHost.d.ts +6 -2
- package/lib/typescript/src/components/ui/Toast/ToastHost.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/ToastHost.web.d.ts +6 -3
- package/lib/typescript/src/components/ui/Toast/ToastHost.web.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/store.d.ts +39 -0
- package/lib/typescript/src/components/ui/Toast/store.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/Toast/toast.d.ts +7 -2
- package/lib/typescript/src/components/ui/Toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast/types.d.ts +5 -3
- package/lib/typescript/src/components/ui/Toast/types.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/index.d.ts +4 -4
- package/lib/typescript/src/components/ui/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/shared/ImageAttempt.d.ts +13 -0
- package/lib/typescript/src/components/ui/shared/ImageAttempt.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/shared/a11y.d.ts +19 -0
- package/lib/typescript/src/components/ui/shared/a11y.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/shared/accessibilityName.d.ts +3 -0
- package/lib/typescript/src/components/ui/shared/accessibilityName.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.d.ts +3 -0
- package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.shared.d.ts +4 -0
- package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.shared.d.ts.map +1 -0
- package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.web.d.ts +3 -0
- package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.web.d.ts.map +1 -0
- package/lib/typescript/src/theme/ThemeProvider.d.ts +2 -3
- package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/theme/fontScale.d.ts +4 -0
- package/lib/typescript/src/theme/fontScale.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +2 -1
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/themeContext.d.ts +6 -0
- package/lib/typescript/src/theme/themeContext.d.ts.map +1 -0
- package/lib/typescript/src/theme/themeDiagnostics.d.ts +6 -0
- package/lib/typescript/src/theme/themeDiagnostics.d.ts.map +1 -0
- package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts +8 -3
- package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts.map +1 -1
- package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts +5 -2
- package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts.map +1 -1
- package/lib/typescript/src/theme/useTheme.d.ts +1 -1
- package/lib/typescript/src/theme/useTheme.d.ts.map +1 -1
- package/lib/typescript/src/theme/useThemedStyles.d.ts +1 -1
- package/lib/typescript/src/theme/useThemedStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/imageSource.d.ts +20 -0
- package/lib/typescript/src/utils/imageSource.d.ts.map +1 -0
- package/lib/typescript/type-tests/public-api.d.ts +2 -0
- package/lib/typescript/type-tests/public-api.d.ts.map +1 -0
- package/lib/typescript/website/src/components/iconCatalogCategories.d.ts +11 -0
- package/lib/typescript/website/src/components/iconCatalogCategories.d.ts.map +1 -0
- package/package.json +27 -13
- package/src/components/business/AvatarWithRing/AvatarWithRing.tsx +11 -4
- package/src/components/business/AvatarWithRing/styles.ts +11 -9
- package/src/components/business/VersionPill/VersionPill.tsx +31 -25
- package/src/components/business/VersionPill/content.ts +47 -0
- package/src/components/business/VersionPill/index.ts +1 -1
- package/src/components/business/VersionPill/styles.ts +4 -0
- package/src/components/business/VersionPill/types.ts +7 -2
- package/src/components/business/index.ts +1 -1
- package/src/components/business/useSvgId.ts +29 -8
- package/src/components/ui/Avatar/Avatar.tsx +25 -34
- package/src/components/ui/Avatar/types.ts +6 -2
- package/src/components/ui/Button/Button.tsx +39 -20
- package/src/components/ui/Button/ButtonBase.tsx +21 -12
- package/src/components/ui/Button/types.ts +5 -3
- package/src/components/ui/Carousel/Carousel.tsx +102 -40
- package/src/components/ui/Carousel/behavior.ts +78 -0
- package/src/components/ui/Carousel/styles.ts +5 -7
- package/src/components/ui/Carousel/types.ts +18 -6
- package/src/components/ui/Cell/Cell.tsx +85 -74
- package/src/components/ui/Cell/Leading.tsx +14 -14
- package/src/components/ui/Cell/content.ts +53 -0
- package/src/components/ui/Cell/index.ts +7 -1
- package/src/components/ui/Cell/types.ts +64 -30
- package/src/components/ui/Checkbox/Checkbox.tsx +35 -8
- package/src/components/ui/Checkbox/types.ts +15 -3
- package/src/components/ui/Confirm/ConfirmHost.tsx +51 -26
- package/src/components/ui/Confirm/confirm.ts +17 -34
- package/src/components/ui/Confirm/labels.ts +14 -0
- package/src/components/ui/Confirm/store.ts +147 -0
- package/src/components/ui/Confirm/styles.ts +4 -0
- package/src/components/ui/Confirm/types.ts +2 -10
- package/src/components/ui/DrawerHeader/DrawerHeader.tsx +22 -27
- package/src/components/ui/DrawerHeader/types.ts +7 -1
- package/src/components/ui/Grid/Grid.tsx +44 -12
- package/src/components/ui/Grid/accessibility.ts +21 -0
- package/src/components/ui/Grid/types.ts +2 -0
- package/src/components/ui/IconButton/IconButton.tsx +20 -3
- package/src/components/ui/IconButton/types.ts +4 -2
- package/src/components/ui/Input/Input.tsx +16 -6
- package/src/components/ui/Input/index.ts +5 -0
- package/src/components/ui/Input/types.ts +12 -23
- package/src/components/ui/Logo/Logo.tsx +27 -4
- package/src/components/ui/Logo/types.ts +2 -2
- package/src/components/ui/NavBar/NavBar.tsx +27 -19
- package/src/components/ui/NavBar/index.ts +1 -1
- package/src/components/ui/NavBar/isSlot.ts +372 -5
- package/src/components/ui/NavBar/types.ts +9 -8
- package/src/components/ui/PasswordInput/PasswordInput.tsx +67 -69
- package/src/components/ui/PasswordInput/types.ts +12 -14
- package/src/components/ui/Pulse/PulseDot.tsx +5 -4
- package/src/components/ui/Pulse/normalizePulseOptions.ts +76 -0
- package/src/components/ui/Pulse/usePulse.ts +80 -34
- package/src/components/ui/Pulse/usePulseDriver.ts +49 -0
- package/src/components/ui/Pulse/usePulseDriver.web.ts +66 -0
- package/src/components/ui/Radio/Radio.tsx +44 -15
- package/src/components/ui/Radio/RadioGroup.tsx +21 -3
- package/src/components/ui/Radio/types.ts +17 -3
- package/src/components/ui/Reveal/Reveal.tsx +5 -3
- package/src/components/ui/Reveal/Reveal.web.tsx +72 -29
- package/src/components/ui/Reveal/types.ts +1 -1
- package/src/components/ui/Reveal/webTransition.ts +206 -0
- package/src/components/ui/Search/Search.tsx +127 -58
- package/src/components/ui/Search/types.ts +30 -9
- package/src/components/ui/Segmented/Segmented.tsx +10 -2
- package/src/components/ui/Skeleton/Skeleton.tsx +9 -5
- package/src/components/ui/Spinner/Spinner.tsx +25 -17
- package/src/components/ui/Spinner/Spinner.web.tsx +23 -18
- package/src/components/ui/Spinner/shared.ts +7 -0
- package/src/components/ui/Spinner/types.ts +1 -1
- package/src/components/ui/Stepper/Stepper.tsx +166 -86
- package/src/components/ui/Stepper/StepperPressable.tsx +1 -0
- package/src/components/ui/Stepper/StepperPressable.web.tsx +1 -0
- package/src/components/ui/Stepper/accessibility.ts +32 -0
- package/src/components/ui/Stepper/accessibility.types.ts +22 -0
- package/src/components/ui/Stepper/accessibility.web.ts +65 -0
- package/src/components/ui/Stepper/layout.ts +44 -0
- package/src/components/ui/Stepper/normalizeStepper.ts +85 -0
- package/src/components/ui/Stepper/styles.ts +9 -2
- package/src/components/ui/Stepper/types.ts +3 -1
- package/src/components/ui/Switch/Switch.tsx +54 -15
- package/src/components/ui/Switch/Switch.web.tsx +57 -19
- package/src/components/ui/Switch/styles.ts +11 -4
- package/src/components/ui/Switch/types.ts +2 -2
- package/src/components/ui/Tag/Tag.tsx +6 -2
- package/src/components/ui/TextField/TextFieldBase.tsx +175 -70
- package/src/components/ui/TextField/TextFieldSlot.tsx +91 -0
- package/src/components/ui/TextField/normalize.ts +280 -0
- package/src/components/ui/TextField/styles.ts +31 -0
- package/src/components/ui/TextField/types.ts +118 -22
- package/src/components/ui/TextField/useErrorAnnouncement.ts +27 -0
- package/src/components/ui/TextField/useTextFieldValue.ts +94 -0
- package/src/components/ui/TextField/valueState.ts +125 -0
- package/src/components/ui/Textarea/Textarea.tsx +11 -4
- package/src/components/ui/Textarea/index.ts +5 -0
- package/src/components/ui/Textarea/types.ts +14 -22
- package/src/components/ui/Thumbnail/Thumbnail.tsx +86 -51
- package/src/components/ui/Thumbnail/index.ts +5 -1
- package/src/components/ui/Thumbnail/normalize.ts +78 -0
- package/src/components/ui/Thumbnail/styles.ts +5 -10
- package/src/components/ui/Thumbnail/types.ts +43 -13
- package/src/components/ui/Toast/ToastHost.tsx +81 -22
- package/src/components/ui/Toast/ToastHost.web.tsx +91 -29
- package/src/components/ui/Toast/store.ts +148 -0
- package/src/components/ui/Toast/toast.ts +19 -10
- package/src/components/ui/Toast/types.ts +7 -3
- package/src/components/ui/index.ts +19 -4
- package/src/components/ui/shared/ImageAttempt.tsx +30 -0
- package/src/components/ui/shared/a11y.ts +18 -0
- package/src/components/ui/shared/accessibilityName.ts +6 -0
- package/src/components/ui/shared/selectImageAttemptSource.shared.ts +17 -0
- package/src/components/ui/shared/selectImageAttemptSource.ts +3 -0
- package/src/components/ui/shared/selectImageAttemptSource.web.ts +3 -0
- package/src/icons/data.ts +1 -1
- package/src/theme/ThemeProvider.tsx +18 -7
- package/src/theme/fontScale.ts +15 -0
- package/src/theme/index.ts +2 -3
- package/src/theme/themeContext.ts +24 -0
- package/src/theme/themeDiagnostics.ts +41 -0
- package/src/theme/usePrefersReducedMotion.ts +11 -4
- package/src/theme/usePrefersReducedMotion.web.ts +5 -2
- package/src/theme/useTheme.ts +19 -27
- package/src/theme/useThemedStyles.ts +12 -7
- package/src/utils/imageSource.ts +303 -0
- package/lib/module/components/ui/PasswordInput/styles.js +0 -12
- package/lib/module/components/ui/PasswordInput/styles.js.map +0 -1
- package/lib/module/components/ui/Pulse/usePulse.web.js +0 -76
- package/lib/module/components/ui/Pulse/usePulse.web.js.map +0 -1
- package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts +0 -7
- package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts.map +0 -1
- package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts +0 -21
- package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts.map +0 -1
- package/src/components/ui/PasswordInput/styles.ts +0 -7
- package/src/components/ui/Pulse/usePulse.web.ts +0 -74
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useEffect, useRef } from 'react';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
5
|
import { useColors, useThemedStyles } from "../../../theme/index.js";
|
|
6
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
6
7
|
import { IconButton } from "../IconButton/index.js";
|
|
7
|
-
import {
|
|
8
|
+
import { classifyNavBarSlot } from "./isSlot.js";
|
|
8
9
|
import { makeStyles } from "./styles.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
+
const log = createLogger('NavBar');
|
|
12
|
+
|
|
13
|
+
/** NavBarAction → IconButton(variant='ghost' + 外部 tint)。 */
|
|
11
14
|
function renderSlot(slot, tint) {
|
|
12
|
-
// [L-50] 缺 accessibilityLabel 时 dev 告警 —— 回退读英文 icon 名(如 "menu")体验不佳。
|
|
13
|
-
if (!slot.accessibilityLabel && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
14
|
-
console.warn(`NavBar slot(icon="${slot.icon}")未传 accessibilityLabel,SR 将读出 icon 名,请传人类可读短语。`);
|
|
15
|
-
}
|
|
16
15
|
return /*#__PURE__*/_jsx(IconButton, {
|
|
17
16
|
icon: slot.icon,
|
|
18
17
|
onPress: slot.onPress,
|
|
19
18
|
variant: "ghost",
|
|
20
19
|
color: tint,
|
|
21
|
-
accessibilityLabel: slot.accessibilityLabel
|
|
20
|
+
accessibilityLabel: slot.accessibilityLabel
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
/** left / right slot:
|
|
24
|
+
/** left / right slot:NavBarAction → IconButton,已归一化 display node → 原样。 */
|
|
26
25
|
function resolveSlot(slot, tint) {
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
return
|
|
26
|
+
if (slot.kind === 'action') return renderSlot(slot.action, tint);
|
|
27
|
+
if (slot.kind === 'node') return slot.node;
|
|
28
|
+
return null;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
/**
|
|
@@ -49,6 +48,16 @@ export function NavBar({
|
|
|
49
48
|
const styles = useThemedStyles(makeStyles);
|
|
50
49
|
const isBrand = variant === 'brand';
|
|
51
50
|
const isTransparent = variant === 'transparent';
|
|
51
|
+
const leftSlot = classifyNavBarSlot(left);
|
|
52
|
+
const rightSlot = classifyNavBarSlot(right);
|
|
53
|
+
const warnedInvalidSlot = useRef(false);
|
|
54
|
+
const hasInvalidSlot = leftSlot.kind === 'invalid' || rightSlot.kind === 'invalid';
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (hasInvalidSlot && !warnedInvalidSlot.current) {
|
|
57
|
+
warnedInvalidSlot.current = true;
|
|
58
|
+
log.warn('忽略无效的 NavBar action;请传 NavBarAction 或 ReactNode');
|
|
59
|
+
}
|
|
60
|
+
}, [hasInvalidSlot]);
|
|
52
61
|
// brand 实底白字;default + transparent 都走深字(transparent 用在浅色
|
|
53
62
|
// hero 渐变之上,白字看不清)。后续若有"相机 / 地图"等深色浮层场景需要
|
|
54
63
|
// 白字 transparent navbar,再加 'transparentLight' variant。
|
|
@@ -59,7 +68,7 @@ export function NavBar({
|
|
|
59
68
|
testID: testID,
|
|
60
69
|
children: [/*#__PURE__*/_jsx(View, {
|
|
61
70
|
style: styles.side,
|
|
62
|
-
children: resolveSlot(
|
|
71
|
+
children: resolveSlot(leftSlot, tint)
|
|
63
72
|
}), /*#__PURE__*/_jsxs(View, {
|
|
64
73
|
style: styles.center,
|
|
65
74
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
@@ -77,7 +86,7 @@ export function NavBar({
|
|
|
77
86
|
}) : null]
|
|
78
87
|
}), /*#__PURE__*/_jsx(View, {
|
|
79
88
|
style: [styles.side, styles.sideRight],
|
|
80
|
-
children: resolveSlot(
|
|
89
|
+
children: resolveSlot(rightSlot, tint)
|
|
81
90
|
})]
|
|
82
91
|
});
|
|
83
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","useColors","useThemedStyles","IconButton","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","Text","View","useColors","useThemedStyles","createLogger","IconButton","classifyNavBarSlot","makeStyles","jsx","_jsx","jsxs","_jsxs","log","renderSlot","slot","tint","icon","onPress","variant","color","accessibilityLabel","resolveSlot","kind","action","node","NavBar","title","subtitle","left","right","style","testID","c","styles","isBrand","isTransparent","leftSlot","rightSlot","warnedInvalidSlot","hasInvalidSlot","current","warn","onPrimary","foreground","subtint","onPrimaryMuted","foregroundSubtle","bar","barBrand","barTransparent","children","side","center","numberOfLines","sideRight"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/NavBar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AAC3D,SAASC,YAAY,QAAQ,gCAAuB;AACpD,SAASC,UAAU,QAAQ,wBAAe;AAC1C,SAASC,kBAAkB,QAAuC,aAAU;AAC5E,SAASC,UAAU,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGtC,MAAMC,GAAG,GAAGR,YAAY,CAAC,QAAQ,CAAC;;AAElC;AACA,SAASS,UAAUA,CAACC,IAAkB,EAAEC,IAAY,EAAE;EACpD,oBACEN,IAAA,CAACJ,UAAU;IACTW,IAAI,EAAEF,IAAI,CAACE,IAAK;IAChBC,OAAO,EAAEH,IAAI,CAACG,OAAQ;IACtBC,OAAO,EAAC,OAAO;IACfC,KAAK,EAAEJ,IAAK;IACZK,kBAAkB,EAAEN,IAAI,CAACM;EAAmB,CAC7C,CAAC;AAEN;;AAEA;AACA,SAASC,WAAWA,CAClBP,IAA8B,EAC9BC,IAAY,EACK;EACjB,IAAID,IAAI,CAACQ,IAAI,KAAK,QAAQ,EAAE,OAAOT,UAAU,CAACC,IAAI,CAACS,MAAM,EAAER,IAAI,CAAC;EAChE,IAAID,IAAI,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AAQ,EAC1Bb,aAAa,IAAIF,MAAM,CAACgB,cAAc,EACtCnB,KAAK,CACL;IACFC,MAAM,EAAEA,MAAO;IAAAmB,QAAA,gBAEfzC,IAAA,CAACR,IAAI;MAAC6B,KAAK,EAAEG,MAAM,CAACkB,IAAK;MAAAD,QAAA,EAAE7B,WAAW,CAACe,QAAQ,EAAErB,IAAI;IAAC,CAAO,CAAC,eAC9DJ,KAAA,CAACV,IAAI;MAAC6B,KAAK,EAAEG,MAAM,CAACmB,MAAO;MAAAF,QAAA,gBACzBzC,IAAA,CAACT,IAAI;QAAC8B,KAAK,EAAE,CAACG,MAAM,CAACP,KAAK,EAAE;UAAEP,KAAK,EAAEJ;QAAK,CAAC,CAAE;QAACsC,aAAa,EAAE,CAAE;QAAAH,QAAA,EAC5DxB;MAAK,CACF,CAAC,EACNC,QAAQ,gBACPlB,IAAA,CAACT,IAAI;QAAC8B,KAAK,EAAE,CAACG,MAAM,CAACN,QAAQ,EAAE;UAAER,KAAK,EAAEyB;QAAQ,CAAC,CAAE;QAACS,aAAa,EAAE,CAAE;QAAAH,QAAA,EAClEvB;MAAQ,CACL,CAAC,GACL,IAAI;IAAA,CACJ,CAAC,eACPlB,IAAA,CAACR,IAAI;MAAC6B,KAAK,EAAE,CAACG,MAAM,CAACkB,IAAI,EAAElB,MAAM,CAACqB,SAAS,CAAE;MAAAJ,QAAA,EAC1C7B,WAAW,CAACgB,SAAS,EAAEtB,IAAI;IAAC,CACzB,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1,10 +1,303 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Text } from 'react-native';
|
|
5
|
+
import { ICONS } from "../../../icons/index.js";
|
|
6
|
+
const mappedThenables = new WeakMap();
|
|
7
|
+
function isIconName(value) {
|
|
8
|
+
return typeof value === 'string' && Object.prototype.hasOwnProperty.call(ICONS, value);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Type guard:action 的 icon 必须真实存在于生成的 registry,且有 handler 与非空名称。
|
|
13
|
+
*/
|
|
14
|
+
export function isNavBarAction(v) {
|
|
15
|
+
if (typeof v !== 'object' || v === null) return false;
|
|
16
|
+
const slot = v;
|
|
17
|
+
return isIconName(slot.icon) && typeof slot.onPress === 'function' && typeof slot.accessibilityLabel === 'string' && slot.accessibilityLabel.trim().length > 0;
|
|
18
|
+
}
|
|
19
|
+
function hasElementShape(value) {
|
|
20
|
+
const element = value;
|
|
21
|
+
return Object.prototype.hasOwnProperty.call(value, 'type') && Object.prototype.hasOwnProperty.call(value, 'props') && element.type !== null && element.type !== undefined && typeof element.props === 'object' && element.props !== null;
|
|
22
|
+
}
|
|
23
|
+
function isThenable(value) {
|
|
24
|
+
if (typeof value !== 'object' || value === null) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
return typeof value.then === 'function';
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function normalizeFragment(value, activeIterables, path, owner) {
|
|
34
|
+
try {
|
|
35
|
+
const props = value.props;
|
|
36
|
+
const normalized = normalizeReactNode(props.children, activeIterables, `${path}.fragment`, owner);
|
|
37
|
+
if (normalized.kind === 'invalid') return normalized;
|
|
38
|
+
return {
|
|
39
|
+
kind: 'node',
|
|
40
|
+
node: /*#__PURE__*/React.cloneElement(value, undefined, normalized.node)
|
|
41
|
+
};
|
|
42
|
+
} catch {
|
|
43
|
+
return {
|
|
44
|
+
kind: 'invalid'
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function recordReaches(from, target, visited = new Set()) {
|
|
49
|
+
if (from === target) return true;
|
|
50
|
+
if (visited.has(from)) return false;
|
|
51
|
+
visited.add(from);
|
|
52
|
+
for (const dependency of from.dependencies) {
|
|
53
|
+
if (recordReaches(dependency, target, visited)) return true;
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
function addThenableDependency(owner, dependency) {
|
|
58
|
+
// dependency 已能走回 owner 时再加边会闭环;不加边并让当前 resolution 失败关闭。
|
|
59
|
+
if (recordReaches(dependency, owner)) return false;
|
|
60
|
+
owner.dependencies.add(dependency);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
function createThenableRecord(value, path) {
|
|
64
|
+
let resolveMapped = () => {};
|
|
65
|
+
let rejectMapped = () => {};
|
|
66
|
+
const mappedPromise = new Promise((resolve, reject) => {
|
|
67
|
+
resolveMapped = resolve;
|
|
68
|
+
rejectMapped = reject;
|
|
69
|
+
});
|
|
70
|
+
const mappedNode = mappedPromise;
|
|
71
|
+
const record = {
|
|
72
|
+
node: mappedNode,
|
|
73
|
+
dependencies: new Set()
|
|
74
|
+
};
|
|
75
|
+
// 先入 cache 再调用用户 then:同步 thenable 可复用同一 record,并由依赖图识别闭环。
|
|
76
|
+
mappedThenables.set(value, record);
|
|
77
|
+
let claimed = false;
|
|
78
|
+
const resolveOnce = resolved => {
|
|
79
|
+
if (claimed) return;
|
|
80
|
+
claimed = true;
|
|
81
|
+
if (resolved === value || resolved === mappedPromise) {
|
|
82
|
+
resolveMapped(null);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const normalized = normalizeReactNode(resolved, new WeakSet(), `${path}.then`, record);
|
|
87
|
+
resolveMapped(normalized.kind === 'invalid' ? null : normalized.node);
|
|
88
|
+
} catch {
|
|
89
|
+
resolveMapped(null);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const rejectOnce = reason => {
|
|
93
|
+
if (claimed) return;
|
|
94
|
+
claimed = true;
|
|
95
|
+
rejectMapped(reason);
|
|
96
|
+
};
|
|
97
|
+
try {
|
|
98
|
+
const then = value.then;
|
|
99
|
+
if (typeof then !== 'function') {
|
|
100
|
+
resolveOnce(null);
|
|
101
|
+
return record;
|
|
102
|
+
}
|
|
103
|
+
then.call(value, resolveOnce, rejectOnce);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
rejectOnce(error);
|
|
106
|
+
}
|
|
107
|
+
return record;
|
|
108
|
+
}
|
|
109
|
+
function normalizeThenable(value, path, owner) {
|
|
110
|
+
const record = mappedThenables.get(value) ?? createThenableRecord(value, path);
|
|
111
|
+
if (owner !== undefined && !addThenableDependency(owner, record)) {
|
|
112
|
+
return {
|
|
113
|
+
kind: 'invalid'
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
kind: 'node',
|
|
118
|
+
node: record.node
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function getIteratorFactory(value) {
|
|
122
|
+
try {
|
|
123
|
+
const iterator = value[Symbol.iterator];
|
|
124
|
+
if (iterator === undefined || iterator === null) return {
|
|
125
|
+
kind: 'none'
|
|
126
|
+
};
|
|
127
|
+
if (typeof iterator !== 'function') return {
|
|
128
|
+
kind: 'none'
|
|
129
|
+
};
|
|
130
|
+
return {
|
|
131
|
+
kind: 'factory',
|
|
132
|
+
factory: iterator
|
|
133
|
+
};
|
|
134
|
+
} catch {
|
|
135
|
+
return {
|
|
136
|
+
kind: 'invalid'
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function isReactPortal(value) {
|
|
141
|
+
const portal = value;
|
|
142
|
+
const hasPortalShape = Object.prototype.hasOwnProperty.call(value, 'key') && Object.prototype.hasOwnProperty.call(value, 'children') && Object.prototype.hasOwnProperty.call(value, 'containerInfo') && Object.prototype.hasOwnProperty.call(value, 'implementation') && (portal.key === null || typeof portal.key === 'string') && portal.containerInfo !== null && portal.containerInfo !== undefined;
|
|
143
|
+
if (!hasPortalShape) return false;
|
|
144
|
+
try {
|
|
145
|
+
// React 没有公开 portal guard;只调用公开 Children API,且该分支已排除 iterable/
|
|
146
|
+
// thenable,避免消费 generator 或改变 Promise 语义。
|
|
147
|
+
return React.Children.count(value) === 1;
|
|
148
|
+
} catch {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function normalizeArray(value, activeIterables, path, owner) {
|
|
153
|
+
if (activeIterables.has(value)) return {
|
|
154
|
+
kind: 'invalid'
|
|
155
|
+
};
|
|
156
|
+
activeIterables.add(value);
|
|
157
|
+
try {
|
|
158
|
+
const nodes = [];
|
|
159
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
160
|
+
const normalized = normalizeReactNode(value[index], activeIterables, `${path}.${index}`, owner);
|
|
161
|
+
if (normalized.kind === 'invalid') return normalized;
|
|
162
|
+
nodes.push(normalized.node);
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
kind: 'node',
|
|
166
|
+
node: nodes
|
|
167
|
+
};
|
|
168
|
+
} catch {
|
|
169
|
+
return {
|
|
170
|
+
kind: 'invalid'
|
|
171
|
+
};
|
|
172
|
+
} finally {
|
|
173
|
+
activeIterables.delete(value);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function normalizeIterable(value, factory, activeIterables, path, owner) {
|
|
177
|
+
if (activeIterables.has(value)) return {
|
|
178
|
+
kind: 'invalid'
|
|
179
|
+
};
|
|
180
|
+
activeIterables.add(value);
|
|
181
|
+
let iterator;
|
|
182
|
+
let completed = false;
|
|
183
|
+
try {
|
|
184
|
+
const candidate = factory.call(value);
|
|
185
|
+
if (typeof candidate !== 'object' || candidate === null) {
|
|
186
|
+
return {
|
|
187
|
+
kind: 'invalid'
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
iterator = candidate;
|
|
191
|
+
const next = iterator.next;
|
|
192
|
+
if (typeof next !== 'function') return {
|
|
193
|
+
kind: 'invalid'
|
|
194
|
+
};
|
|
195
|
+
const nodes = [];
|
|
196
|
+
let index = 0;
|
|
197
|
+
for (;;) {
|
|
198
|
+
const step = next.call(iterator);
|
|
199
|
+
if (typeof step !== 'object' || step === null) {
|
|
200
|
+
return {
|
|
201
|
+
kind: 'invalid'
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const result = step;
|
|
205
|
+
// Iterator protocol 的 done 走 ToBoolean,而不是限制为 boolean primitive。
|
|
206
|
+
if (result.done) {
|
|
207
|
+
completed = true;
|
|
208
|
+
return {
|
|
209
|
+
kind: 'node',
|
|
210
|
+
node: nodes
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const normalized = normalizeReactNode(result.value, activeIterables, `${path}.${index}`, owner);
|
|
214
|
+
if (normalized.kind === 'invalid') return normalized;
|
|
215
|
+
nodes.push(normalized.node);
|
|
216
|
+
index += 1;
|
|
217
|
+
}
|
|
218
|
+
} catch {
|
|
219
|
+
return {
|
|
220
|
+
kind: 'invalid'
|
|
221
|
+
};
|
|
222
|
+
} finally {
|
|
223
|
+
if (!completed && iterator !== undefined) {
|
|
224
|
+
try {
|
|
225
|
+
const close = iterator.return;
|
|
226
|
+
if (typeof close === 'function') close.call(iterator);
|
|
227
|
+
} catch {
|
|
228
|
+
// 分类已失败;关闭时的异常不能逃逸到 NavBar render。
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
activeIterables.delete(value);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function normalizeReactNode(value, activeIterables, path, owner) {
|
|
235
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint') {
|
|
236
|
+
return {
|
|
237
|
+
kind: 'node',
|
|
238
|
+
node: /*#__PURE__*/React.createElement(Text, {
|
|
239
|
+
key: path
|
|
240
|
+
}, String(value))
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
if (value === undefined || value === null || typeof value === 'boolean') {
|
|
244
|
+
return {
|
|
245
|
+
kind: 'node',
|
|
246
|
+
node: value
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (/*#__PURE__*/React.isValidElement(value)) {
|
|
250
|
+
if (!hasElementShape(value)) return {
|
|
251
|
+
kind: 'invalid'
|
|
252
|
+
};
|
|
253
|
+
return value.type === React.Fragment ? normalizeFragment(value, activeIterables, path, owner) : {
|
|
254
|
+
kind: 'node',
|
|
255
|
+
node: value
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
if (typeof value !== 'object' || value === null) {
|
|
259
|
+
return {
|
|
260
|
+
kind: 'invalid'
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
if (Array.isArray(value)) {
|
|
264
|
+
return normalizeArray(value, activeIterables, path, owner);
|
|
265
|
+
}
|
|
266
|
+
const iterator = getIteratorFactory(value);
|
|
267
|
+
if (iterator.kind === 'invalid') return iterator;
|
|
268
|
+
if (iterator.kind === 'factory') {
|
|
269
|
+
return normalizeIterable(value, iterator.factory, activeIterables, path, owner);
|
|
270
|
+
}
|
|
271
|
+
if (isThenable(value)) return normalizeThenable(value, path, owner);
|
|
272
|
+
if (typeof value !== 'object') return {
|
|
273
|
+
kind: 'invalid'
|
|
274
|
+
};
|
|
275
|
+
return isReactPortal(value) ? {
|
|
276
|
+
kind: 'node',
|
|
277
|
+
node: value
|
|
278
|
+
} : {
|
|
279
|
+
kind: 'invalid'
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
3
283
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
284
|
+
* 未类型化边界的单一分类器。React 的公开 API 无法证明 object 不可伪造;这里拒绝
|
|
285
|
+
* 结构不成立的 marker-only element 与普通 plain object,同时保留 React 19 声明的
|
|
286
|
+
* bigint、Iterable、portal、Promise/thenable 等合法 ReactNode。Fragment/Iterable
|
|
287
|
+
* 会递归验证 primitive 叶子;thenable 映射按源对象缓存,避免每次 render 制造新的
|
|
288
|
+
* suspend identity;resolution record 的依赖可达性同时拦截 direct/indirect cycle,
|
|
289
|
+
* 并把 cycle 或非法 resolved value 确定性失败关闭为 null。
|
|
6
290
|
*/
|
|
7
|
-
export function
|
|
8
|
-
|
|
291
|
+
export function classifyNavBarSlot(value) {
|
|
292
|
+
if (value === undefined || value === null || typeof value === 'boolean') {
|
|
293
|
+
return {
|
|
294
|
+
kind: 'empty'
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if (isNavBarAction(value)) return {
|
|
298
|
+
kind: 'action',
|
|
299
|
+
action: value
|
|
300
|
+
};
|
|
301
|
+
return normalizeReactNode(value, new WeakSet(), 'slot');
|
|
9
302
|
}
|
|
10
303
|
//# sourceMappingURL=isSlot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isSlot","v"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/isSlot.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CAACC,CAAU,EAAyB;EACxD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,IAAI,MAAM,IAAIA,CAAC;AAC3D","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Text","ICONS","mappedThenables","WeakMap","isIconName","value","Object","prototype","hasOwnProperty","call","isNavBarAction","v","slot","icon","onPress","accessibilityLabel","trim","length","hasElementShape","element","type","undefined","props","isThenable","then","normalizeFragment","activeIterables","path","owner","normalized","normalizeReactNode","children","kind","node","cloneElement","recordReaches","from","target","visited","Set","has","add","dependency","dependencies","addThenableDependency","createThenableRecord","resolveMapped","rejectMapped","mappedPromise","Promise","resolve","reject","mappedNode","record","set","claimed","resolveOnce","resolved","WeakSet","rejectOnce","reason","error","normalizeThenable","get","getIteratorFactory","iterator","Symbol","factory","isReactPortal","portal","hasPortalShape","key","containerInfo","Children","count","normalizeArray","nodes","index","push","delete","normalizeIterable","completed","candidate","next","step","result","done","close","return","createElement","String","isValidElement","Fragment","Array","isArray","classifyNavBarSlot","action"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/isSlot.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAA0B,OAAO;AAC7C,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAuB,yBAAgB;AAqBrD,MAAMC,eAAe,GAAG,IA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AAK,QAAQ,EAAE,OAAO;IAAE2B,IAAI,EAAE;EAAU,CAAC;EACzD,OAAOoC,aAAa,CAAC/D,KAAK,CAAC,GACvB;IAAE2B,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE5B;EAAM,CAAC,GAC7B;IAAE2B,IAAI,EAAE;EAAU,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS+D,kBAAkBA,CAAC1F,KAAc,EAA4B;EAC3E,IAAIA,KAAK,KAAKgB,SAAS,IAAIhB,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;IACvE,OAAO;MAAE2B,IAAI,EAAE;IAAQ,CAAC;EAC1B;EACA,IAAItB,cAAc,CAACL,KAAK,CAAC,EAAE,OAAO;IAAE2B,IAAI,EAAE,QAAQ;IAAEgE,MAAM,EAAE3F;EAAM,CAAC;EACnE,OAAOyB,kBAAkB,CAACzB,KAAK,EAAE,IAAIqD,OAAO,CAAS,CAAC,EAAE,MAAM,CAAC;AACjE","ignoreList":[]}
|
|
@@ -1,78 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { forwardRef, useState } from 'react';
|
|
4
|
-
import { Pressable } from 'react-native-gesture-handler';
|
|
5
|
-
import { Icon } from "../Icon/index.js";
|
|
3
|
+
import React, { forwardRef, useEffect, useState } from 'react';
|
|
6
4
|
import { Input } from "../Input/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { childTestID } from "../../../utils/testID/index.js";
|
|
9
|
-
import { styles } from "./styles.js";
|
|
5
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
10
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
const
|
|
7
|
+
const log = createLogger('PasswordInput');
|
|
8
|
+
|
|
9
|
+
/** 密码输入:只切换 secureTextEntry,不改变调用方持有的受控文本或焦点。 */
|
|
10
|
+
export const PasswordInput = /*#__PURE__*/forwardRef(function PasswordInput(props, ref) {
|
|
11
|
+
const {
|
|
12
|
+
textContentType: rawTextContentType,
|
|
13
|
+
autoComplete: rawAutoComplete,
|
|
14
|
+
autoCapitalize: rawAutoCapitalize,
|
|
15
|
+
value: rawValue,
|
|
16
|
+
onChangeText: rawOnChangeText,
|
|
17
|
+
disabled: rawDisabled,
|
|
18
|
+
editable: rawEditable,
|
|
19
|
+
placeholder: rawPlaceholder,
|
|
20
|
+
defaultValue: _defaultValue,
|
|
21
|
+
inputProps: _inputProps,
|
|
22
|
+
secureTextEntry: _secureTextEntry,
|
|
23
|
+
leading: _leading,
|
|
24
|
+
trailing: _trailing,
|
|
25
|
+
...rest
|
|
26
|
+
} = props;
|
|
27
|
+
const value = typeof rawValue === 'string' ? rawValue : '';
|
|
28
|
+
const onChangeText = typeof rawOnChangeText === 'function' ? rawOnChangeText : undefined;
|
|
29
|
+
const disabled = rawDisabled === true;
|
|
30
|
+
const editable = rawEditable === false ? false : undefined;
|
|
31
|
+
const placeholder = typeof rawPlaceholder === 'string' ? rawPlaceholder : '请输入密码';
|
|
32
|
+
const removedNativeAliasKey = Object.entries({
|
|
33
|
+
defaultValue: _defaultValue,
|
|
34
|
+
inputProps: _inputProps,
|
|
35
|
+
secureTextEntry: _secureTextEntry,
|
|
36
|
+
leading: _leading,
|
|
37
|
+
trailing: _trailing
|
|
38
|
+
}).filter(([, entry]) => entry !== undefined).map(([name]) => name).join(',');
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (removedNativeAliasKey.length > 0) {
|
|
41
|
+
log.warn(`已忽略 PasswordInput 自管 props(${removedNativeAliasKey})。`);
|
|
42
|
+
}
|
|
43
|
+
}, [removedNativeAliasKey]);
|
|
44
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
45
|
+
const effectiveEditable = disabled !== true && editable !== false;
|
|
46
|
+
const trailing = {
|
|
47
|
+
kind: 'action',
|
|
48
|
+
icon: showPassword ? 'eye' : 'eye-off',
|
|
49
|
+
onPress: () => setShowPassword(visible => !visible),
|
|
50
|
+
accessibilityLabel: showPassword ? '隐藏密码' : '显示密码',
|
|
51
|
+
disabled: !effectiveEditable
|
|
52
|
+
};
|
|
34
53
|
return /*#__PURE__*/_jsx(Input, {
|
|
35
54
|
ref: ref,
|
|
36
|
-
|
|
55
|
+
...rest,
|
|
37
56
|
value: value,
|
|
38
57
|
onChangeText: onChangeText,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
editable: editable,
|
|
39
60
|
placeholder: placeholder,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
leading: /*#__PURE__*/_jsx(Icon, {
|
|
51
|
-
name: "lock",
|
|
52
|
-
size: r(18),
|
|
53
|
-
color: c.iconFaint40
|
|
54
|
-
}),
|
|
55
|
-
trailing: /*#__PURE__*/_jsx(Pressable, {
|
|
56
|
-
testID: childTestID(testID, 'toggle'),
|
|
57
|
-
style: styles.eyeBtn,
|
|
58
|
-
onPress: () => setShowPw(v => !v),
|
|
59
|
-
accessibilityRole: "button",
|
|
60
|
-
accessibilityLabel: showPw ? '隐藏密码' : '显示密码'
|
|
61
|
-
// [M-7] eye icon r(16)≈16pt;Input 高 control.md≈36pt 限制垂直扩展
|
|
62
|
-
// vertical 走 (44-control.md)/2≈4;horizontal 走 (44-16)/2=14
|
|
63
|
-
,
|
|
64
|
-
hitSlop: {
|
|
65
|
-
top: Math.round((fixed.hitTarget - control.md) / 2),
|
|
66
|
-
bottom: Math.round((fixed.hitTarget - control.md) / 2),
|
|
67
|
-
left: Math.round((fixed.hitTarget - r(16)) / 2),
|
|
68
|
-
right: Math.round((fixed.hitTarget - r(16)) / 2)
|
|
69
|
-
},
|
|
70
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
71
|
-
name: showPw ? 'eye' : 'eye-off',
|
|
72
|
-
size: r(16),
|
|
73
|
-
color: c.iconFaint40
|
|
74
|
-
})
|
|
75
|
-
})
|
|
61
|
+
textContentType: rawTextContentType ?? 'password',
|
|
62
|
+
autoComplete: rawAutoComplete ?? 'current-password',
|
|
63
|
+
autoCapitalize: rawAutoCapitalize ?? 'none',
|
|
64
|
+
secureTextEntry: !showPassword,
|
|
65
|
+
leading: {
|
|
66
|
+
kind: 'icon',
|
|
67
|
+
icon: 'lock',
|
|
68
|
+
size: 18
|
|
69
|
+
},
|
|
70
|
+
trailing: trailing
|
|
76
71
|
});
|
|
77
72
|
});
|
|
78
73
|
PasswordInput.displayName = 'PasswordInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useState","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useEffect","useState","Input","createLogger","jsx","_jsx","log","PasswordInput","props","ref","textContentType","rawTextContentType","autoComplete","rawAutoComplete","autoCapitalize","rawAutoCapitalize","value","rawValue","onChangeText","rawOnChangeText","disabled","rawDisabled","editable","rawEditable","placeholder","rawPlaceholder","defaultValue","_defaultValue","inputProps","_inputProps","secureTextEntry","_secureTextEntry","leading","_leading","trailing","_trailing","rest","undefined","removedNativeAliasKey","Object","entries","filter","entry","map","name","join","length","warn","showPassword","setShowPassword","effectiveEditable","kind","icon","onPress","visible","accessibilityLabel","size","displayName"],"sourceRoot":"../../../../../src","sources":["components/ui/PasswordInput/PasswordInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC9D,SAASC,KAAK,QAA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G,CAAE;IAClDtB,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CACF,CAAC;AAED3B,aAAa,CAACkD,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Animated","usePulse","jsx","_jsx","Pulse","children","style","testID","opts","animatedStyle","View"],"sourceRoot":"../../../../../src","sources":["components/ui/Pulse/Pulse.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,QAAQ,QAAQ,
|
|
1
|
+
{"version":3,"names":["React","Animated","usePulse","jsx","_jsx","Pulse","children","style","testID","opts","animatedStyle","View"],"sourceRoot":"../../../../../src","sources":["components/ui/Pulse/Pulse.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,QAAQ,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtC,OAAO,SAASC,KAAKA,CAAC;EACpBC,QAAQ;EACRC,KAAK;EACLC,MAAM;EACN,GAAGC;AACuC,CAAC,EAAqB;EAChE,MAAMC,aAAa,GAAGR,QAAQ,CAACO,IAAI,CAAC;EACpC,oBACEL,IAAA,CAACH,QAAQ,CAACU,IAAI;IAACJ,KAAK,EAAE,CAACG,aAAa,EAAEH,KAAK,CAAE;IAACC,MAAM,EAAEA,MAAO;IAAAF,QAAA,EAC1DA;EAAQ,CACI,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -3,23 +3,21 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Animated from 'react-native-reanimated';
|
|
5
5
|
import { r, useColors } from "../../../theme/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { DOT_DEFAULTS, usePulseWithDefaults } from "./usePulse.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export function PulseDot({
|
|
9
9
|
size = r(6),
|
|
10
10
|
color,
|
|
11
|
-
from = 0.5,
|
|
12
11
|
style,
|
|
13
12
|
testID,
|
|
14
13
|
...opts
|
|
15
14
|
} = {}) {
|
|
16
15
|
const c = useColors();
|
|
17
16
|
const fill = color ?? c.primary;
|
|
18
|
-
// [L-93]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
17
|
+
// [L-93] 圆点的 from 默认 0.5(比 <Pulse> 的 0.6 更淡)。默认值交给共享的
|
|
18
|
+
// DOT_DEFAULTS,不再在解构里写 `from = 0.5` —— 那样 from 会先被默认值填满,
|
|
19
|
+
// 归一化层再也分不清「调用方没传」和「调用方传了 0.5」。
|
|
20
|
+
const animatedStyle = usePulseWithDefaults(opts, DOT_DEFAULTS, 'PulseDot');
|
|
23
21
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
24
22
|
style: [{
|
|
25
23
|
width: size,
|