@unif/react-native-design 0.20.0 → 0.21.1
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 +121 -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 +30 -14
- 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
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
4
|
+
function valid(snapshot, canonical) {
|
|
5
|
+
return {
|
|
6
|
+
valid: true,
|
|
7
|
+
snapshot,
|
|
8
|
+
canonical
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function invalid(kind) {
|
|
12
|
+
return {
|
|
13
|
+
valid: false,
|
|
14
|
+
canonical: `invalid:${kind}`
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function visitArray(value, keys, seen) {
|
|
18
|
+
if (!keys.includes('length')) return invalid('descriptor');
|
|
19
|
+
const lengthDescriptor = Reflect.getOwnPropertyDescriptor(value, 'length');
|
|
20
|
+
if (lengthDescriptor === undefined || lengthDescriptor.enumerable || !hasOwn(lengthDescriptor, 'value') || typeof lengthDescriptor.value !== 'number' || !Number.isInteger(lengthDescriptor.value) || lengthDescriptor.value < 0) {
|
|
21
|
+
return invalid('descriptor');
|
|
22
|
+
}
|
|
23
|
+
const length = lengthDescriptor.value;
|
|
24
|
+
if (keys.length !== length + 1) return invalid('descriptor');
|
|
25
|
+
const keySet = new Set(keys);
|
|
26
|
+
const parts = [];
|
|
27
|
+
const snapshot = [];
|
|
28
|
+
let allValid = true;
|
|
29
|
+
for (let index = 0; index < length; index += 1) {
|
|
30
|
+
const key = String(index);
|
|
31
|
+
if (!keySet.has(key)) return invalid('descriptor');
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
|
|
33
|
+
if (descriptor === undefined || !descriptor.enumerable || !hasOwn(descriptor, 'value')) {
|
|
34
|
+
return invalid('descriptor');
|
|
35
|
+
}
|
|
36
|
+
const item = visit(descriptor.value, seen);
|
|
37
|
+
parts.push(item.canonical);
|
|
38
|
+
if (item.valid) {
|
|
39
|
+
snapshot.push(item.snapshot);
|
|
40
|
+
} else {
|
|
41
|
+
allValid = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const canonical = `array:[${parts.join(',')}]`;
|
|
45
|
+
return allValid ? valid(Object.freeze(snapshot), canonical) : {
|
|
46
|
+
valid: false,
|
|
47
|
+
canonical
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function visitObject(value, keys, seen) {
|
|
51
|
+
const snapshot = {};
|
|
52
|
+
const parts = [];
|
|
53
|
+
let allValid = true;
|
|
54
|
+
for (const key of [...keys].sort()) {
|
|
55
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
|
|
56
|
+
if (descriptor === undefined) return invalid('descriptor');
|
|
57
|
+
if (!descriptor.enumerable) return invalid('non-enumerable');
|
|
58
|
+
if (!hasOwn(descriptor, 'value')) return invalid('accessor');
|
|
59
|
+
const item = visit(descriptor.value, seen);
|
|
60
|
+
parts.push(`${JSON.stringify(key)}:${item.canonical}`);
|
|
61
|
+
if (item.valid) {
|
|
62
|
+
Object.defineProperty(snapshot, key, {
|
|
63
|
+
configurable: false,
|
|
64
|
+
enumerable: true,
|
|
65
|
+
value: item.snapshot,
|
|
66
|
+
writable: false
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
allValid = false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const canonical = `object:{${parts.join(',')}}`;
|
|
73
|
+
return allValid ? valid(Object.freeze(snapshot), canonical) : {
|
|
74
|
+
valid: false,
|
|
75
|
+
canonical
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 只从 own data descriptor 读取一次,绝不执行 getter。snapshot 与 canonical
|
|
81
|
+
* key 因而来自同一份值;任何 descriptor / Proxy 异常都失败关闭。
|
|
82
|
+
*/
|
|
83
|
+
function visit(value, seen) {
|
|
84
|
+
if (value === undefined) return valid(undefined, 'undefined:');
|
|
85
|
+
if (value === null) return valid(null, 'null:');
|
|
86
|
+
switch (typeof value) {
|
|
87
|
+
case 'string':
|
|
88
|
+
return valid(value, `string:${JSON.stringify(value)}`);
|
|
89
|
+
case 'number':
|
|
90
|
+
return Number.isFinite(value) ? valid(value, `number:${value}`) : invalid('number');
|
|
91
|
+
case 'boolean':
|
|
92
|
+
return valid(value, `boolean:${String(value)}`);
|
|
93
|
+
case 'function':
|
|
94
|
+
case 'symbol':
|
|
95
|
+
case 'bigint':
|
|
96
|
+
return invalid(typeof value);
|
|
97
|
+
case 'object':
|
|
98
|
+
break;
|
|
99
|
+
case 'undefined':
|
|
100
|
+
return valid(undefined, 'undefined:');
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
if (seen.has(value)) return invalid('cycle');
|
|
104
|
+
const isArray = Array.isArray(value);
|
|
105
|
+
const ownKeys = Reflect.ownKeys(value);
|
|
106
|
+
const keys = [];
|
|
107
|
+
for (const key of ownKeys) {
|
|
108
|
+
if (typeof key === 'symbol') return invalid('symbol-key');
|
|
109
|
+
keys.push(key);
|
|
110
|
+
}
|
|
111
|
+
seen.add(value);
|
|
112
|
+
try {
|
|
113
|
+
return isArray ? visitArray(value, keys, seen) : visitObject(value, keys, seen);
|
|
114
|
+
} finally {
|
|
115
|
+
seen.delete(value);
|
|
116
|
+
}
|
|
117
|
+
} catch {
|
|
118
|
+
return invalid('exception');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function snapshotValue(value) {
|
|
122
|
+
try {
|
|
123
|
+
return visit(value, new WeakSet());
|
|
124
|
+
} catch {
|
|
125
|
+
return invalid('exception');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export function canonicalSourceValue(value) {
|
|
129
|
+
return snapshotValue(value).canonical;
|
|
130
|
+
}
|
|
131
|
+
const URI_STRING_FIELDS = ['bundle', 'method', 'body'];
|
|
132
|
+
const CACHE_POLICIES = new Set(['default', 'reload', 'force-cache', 'only-if-cached']);
|
|
133
|
+
function isSnapshotObject(value) {
|
|
134
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
135
|
+
}
|
|
136
|
+
function isValidHeaders(value) {
|
|
137
|
+
if (value === undefined) return true;
|
|
138
|
+
if (!isSnapshotObject(value)) return false;
|
|
139
|
+
return Object.keys(value).every(key => typeof value[key] === 'string');
|
|
140
|
+
}
|
|
141
|
+
function isValidUriSource(value) {
|
|
142
|
+
if (!isSnapshotObject(value) || !hasOwn(value, 'uri')) return false;
|
|
143
|
+
const uri = value.uri;
|
|
144
|
+
if (typeof uri !== 'string' || uri.trim().length === 0) return false;
|
|
145
|
+
for (const field of URI_STRING_FIELDS) {
|
|
146
|
+
const fieldValue = value[field];
|
|
147
|
+
if (fieldValue !== undefined && typeof fieldValue !== 'string') {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (!isValidHeaders(value.headers)) return false;
|
|
152
|
+
const cache = value.cache;
|
|
153
|
+
if (cache !== undefined && !CACHE_POLICIES.has(cache)) return false;
|
|
154
|
+
for (const field of ['width', 'height', 'scale']) {
|
|
155
|
+
const fieldValue = value[field];
|
|
156
|
+
if (fieldValue !== undefined && (typeof fieldValue !== 'number' || !Number.isFinite(fieldValue))) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
function asImageSource(snapshot) {
|
|
163
|
+
if (typeof snapshot === 'number') {
|
|
164
|
+
return Number.isFinite(snapshot) && snapshot > 0 && Number.isInteger(snapshot) ? snapshot : undefined;
|
|
165
|
+
}
|
|
166
|
+
if (Array.isArray(snapshot)) {
|
|
167
|
+
return snapshot.length > 0 && snapshot.every(isValidUriSource) ? snapshot : undefined;
|
|
168
|
+
}
|
|
169
|
+
return isValidUriSource(snapshot) ? snapshot : undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 组件唯一入口:一次读取完成 runtime validation、deep-frozen plain snapshot
|
|
174
|
+
* 与 semantic key。调用方必须把同一返回值里的 source / key 一起交给 attempt。
|
|
175
|
+
*/
|
|
176
|
+
export function resolveImageSource(source) {
|
|
177
|
+
const result = snapshotValue(source);
|
|
178
|
+
if (!result.valid) return undefined;
|
|
179
|
+
const snapshot = asImageSource(result.snapshot);
|
|
180
|
+
if (snapshot === undefined) return undefined;
|
|
181
|
+
return Object.freeze({
|
|
182
|
+
source: snapshot,
|
|
183
|
+
key: `image-source:${result.canonical}`
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
export function imageSourceKey(source) {
|
|
187
|
+
return `image-source:${snapshotValue(source).canonical}`;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* JS 消费者可能绕过类型系统。只有能安全 snapshot 的 asset id、URI object 或
|
|
192
|
+
* URI object 数组能进入 Image;accessor、异常 descriptor 与非法 nested value
|
|
193
|
+
* 一律失败关闭。
|
|
194
|
+
*/
|
|
195
|
+
export function isValidImageSource(source) {
|
|
196
|
+
return resolveImageSource(source) !== undefined;
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=imageSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hasOwn","value","key","Object","prototype","hasOwnProperty","call","valid","snapshot","canonical","invalid","kind","visitArray","keys","seen","includes","lengthDescriptor","Reflect","getOwnPropertyDescriptor","undefined","enumerable","Number","isInteger","length","keySet","Set","parts","allValid","index","String","has","descriptor","item","visit","push","join","freeze","visitObject","sort","JSON","stringify","defineProperty","configurable","writable","isFinite","isArray","Array","ownKeys","add","delete","snapshotValue","WeakSet","canonicalSourceValue","URI_STRING_FIELDS","CACHE_POLICIES","isSnapshotObject","isValidHeaders","every","isValidUriSource","uri","trim","field","fieldValue","headers","cache","asImageSource","resolveImageSource","source","result","imageSourceKey","isValidImageSource"],"sourceRoot":"../../../src","sources":["utils/imageSource.ts"],"mappings":";;AAiCA,MAAMA,MAAM,GAAGA,CAACC,KAAa,EAAEC,GAAgB,KAC7CC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,KAAK,EAAEC,GAAG,CAAC;AAElD,SAASK,KAAKA,CAACC,QAAuB,EAAEC,SAAiB,EAAkB;EACzE,OAAO;IAAEF,KAAK,EAAE,IAAI;IA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Q,CAACiD,KAAK,CAACC,gBAAgB,CAAC,GACzDlD,QAAQ,GACTW,SAAS;EACf;EAEA,OAAOuC,gBAAgB,CAAClD,QAAQ,CAAC,GAC5BA,QAAQ,GACTW,SAAS;AACf;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAAS+C,kBAAkBA,CAChCC,MAAe,EACkB;EACjC,MAAMC,MAAM,GAAGlB,aAAa,CAACiB,MAAM,CAAC;EACpC,IAAI,CAACC,MAAM,CAAC7D,KAAK,EAAE,OAAOY,SAAS;EAEnC,MAAMX,QAAQ,GAAGyD,aAAa,CAACG,MAAM,CAAC5D,QAAQ,CAAC;EAC/C,IAAIA,QAAQ,KAAKW,SAAS,EAAE,OAAOA,SAAS;EAE5C,OAAOhB,MAAM,CAACiC,MAAM,CAAC;IACnB+B,MAAM,EAAE3D,QAAQ;IAChBN,GAAG,EAAE,gBAAgBkE,MAAM,CAAC3D,SAAS;EACvC,CAAC,CAAC;AACJ;AAEA,OAAO,SAAS4D,cAAcA,CAC5BF,MAAuC,EAC/B;EACR,OAAO,gBAAgBjB,aAAa,CAACiB,MAAM,CAAC,CAAC1D,SAAS,EAAE;AAC1D;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS6D,kBAAkBA,CAChCH,MAAe,EACgB;EAC/B,OAAOD,kBAAkB,CAACC,MAAM,CAAC,KAAKhD,SAAS;AACjD","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime API 人工验证屏 —— 由 `yarn create:runtime-harness` 拷进临时的
|
|
4
|
+
* RN 0.86.2 app 里跑,**不属于任何自动化测试**。
|
|
5
|
+
*
|
|
6
|
+
* 它只 import 包根 barrel(与真实消费者一致),用来验证 Jest 覆盖不到的部分:
|
|
7
|
+
* 真实 native / Web 结构、44pt 命中框、a11y tree、reduced motion 和竞态。
|
|
8
|
+
*
|
|
9
|
+
* 每个交互结果都渲染成可见文本 —— 人工验收时逐条对照 verification matrix 记录。
|
|
10
|
+
*/
|
|
11
|
+
export declare function RuntimeApiScreen(): React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=RuntimeApiScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuntimeApiScreen.d.ts","sourceRoot":"","sources":["../../../../manual-tests/runtime-api/RuntimeApiScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AA0DrE;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAgYpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarWithRing.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/AvatarWithRing/AvatarWithRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAWvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,IAAS,EACT,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"AvatarWithRing.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/AvatarWithRing/AvatarWithRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAWvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,IAAS,EACT,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA+CzC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type ViewStyle } from 'react-native';
|
|
2
2
|
import { type ColorTokens } from '../../../theme';
|
|
3
3
|
/**
|
|
4
|
-
* 头像样式工厂 —— **非标 maker 签名**:`(size, ringColor, shadowStyle, c
|
|
4
|
+
* 头像样式工厂 —— **非标 maker 签名**:`(size, ringColor, shadowStyle, c,
|
|
5
|
+
* fontScale)` 5 参,
|
|
5
6
|
* 而非项目通用 `(c: ColorTokens, s: ShadowTokens) => StyleSheet` 2 参。
|
|
6
7
|
*
|
|
7
8
|
* **为何破例**:`size` / `ringColor` 是 **props 派生**(每次调用值不同,如 ring 宽度
|
|
8
9
|
* = `size * 0.0625`、label 字号 = `size * 0.40`、inner 直径 = `size - ringWidth*2`),
|
|
9
|
-
* 标准 `useThemedStyles(maker)` 按 `[colors, shadow]` memo
|
|
10
|
-
*
|
|
11
|
-
* shadow.brandAvatar])` 精确缓存,signature 因此带上
|
|
12
|
-
*
|
|
10
|
+
* 标准 `useThemedStyles(maker)` 按 `[colors, shadow, fontScale, maker]` memo,且假设 maker
|
|
11
|
+
* 是模块顶层常量,无法承接 props 变化。改走调用点自带 `useMemo([size, ringColor, c,
|
|
12
|
+
* shadow.brandAvatar, fontScale])` 精确缓存,signature 因此带上
|
|
13
|
+
* size/ringColor/shadow/fontScale 四个运行期入参,c 仍传入用于 label 文字色。
|
|
13
14
|
*
|
|
14
15
|
* **不用 borderWidth + borderColor 实现 ring**:RN new arch (Fabric) 在
|
|
15
16
|
* iOS 上对 `borderColor: rgba alpha + borderRadius: width/2`(完全圆)的组合
|
|
@@ -19,7 +20,7 @@ import { type ColorTokens } from '../../../theme';
|
|
|
19
20
|
* - shell:size×size 圆,backgroundColor = ringColor(承担 ring 视觉)+ shadow
|
|
20
21
|
* - avatarCore:inner×inner 圆,在 shell 内 flex center,内部放 SVG 渐变 + label
|
|
21
22
|
*/
|
|
22
|
-
export declare const makeAvatarStyles: (size: number, ringColor: string, shadowStyle: ViewStyle, c: ColorTokens) => {
|
|
23
|
+
export declare const makeAvatarStyles: (size: number, ringColor: string, shadowStyle: ViewStyle, c: ColorTokens, fontScale: number) => {
|
|
23
24
|
ringWidth: number;
|
|
24
25
|
dim: number;
|
|
25
26
|
inner: number;
|
|
@@ -108,7 +109,7 @@ export declare const makeAvatarStyles: (size: number, ringColor: string, shadowS
|
|
|
108
109
|
pointerEvents?: "auto" | "none" | "box-none" | "box-only";
|
|
109
110
|
cursor?: import("react-native").CursorValue;
|
|
110
111
|
boxShadow?: ReadonlyArray<import("react-native").BoxShadowValue> | string;
|
|
111
|
-
mixBlendMode?: "color" | "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "luminosity";
|
|
112
|
+
mixBlendMode?: "color" | "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "luminosity" | "plus-lighter";
|
|
112
113
|
experimental_backgroundImage?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundImageValue> | string;
|
|
113
114
|
experimental_backgroundSize?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundSizeValue> | string;
|
|
114
115
|
experimental_backgroundPosition?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundPositionValue> | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/AvatarWithRing/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/AvatarWithRing/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,EACjB,aAAa,SAAS,EACtB,GAAG,WAAW,EACd,WAAW,MAAM;;;;;;;;;;;qBAkDk0tB,CAAC;sBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD12tB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { VersionPillProps } from './types';
|
|
3
3
|
/** 版本徽章胶囊 —— success dot + 版本 + 分点 + build mono。 */
|
|
4
|
-
export declare function VersionPill({ version, build,
|
|
4
|
+
export declare function VersionPill({ version, build, status, versionPrefix, buildPrefix, style, testID, }: VersionPillProps): React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=VersionPill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionPill.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/VersionPill.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"VersionPill.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/VersionPill.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,MAAM,EACN,aAAqB,EACrB,WAAsB,EACtB,KAAK,EACL,MAAM,GACP,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsDtC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColorTokens } from '../../../theme';
|
|
2
|
+
import type { VersionStatus } from './types';
|
|
3
|
+
type VersionStatusColors = Pick<ColorTokens, 'foregroundMuted' | 'success'>;
|
|
4
|
+
type ResolvedVersionStatus = {
|
|
5
|
+
label: string;
|
|
6
|
+
color: string;
|
|
7
|
+
diagnostics: readonly string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveVersionStatus(status: VersionStatus | undefined, colors: VersionStatusColors): ResolvedVersionStatus;
|
|
10
|
+
type VersionPillLabelContent = {
|
|
11
|
+
version: string;
|
|
12
|
+
build: string | null | undefined;
|
|
13
|
+
statusLabel: string;
|
|
14
|
+
versionPrefix: string;
|
|
15
|
+
buildPrefix: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function buildVersionPillLabel({ version, build, statusLabel, versionPrefix, buildPrefix, }: VersionPillLabelContent): string;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,SAAS,CAAC,CAAC;AAE5E,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,GAAG,SAAS,EACjC,MAAM,EAAE,mBAAmB,GAC1B,qBAAqB,CAUvB;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,GACZ,EAAE,uBAAuB,GAAG,MAAM,CAKlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAExB;oDACoD;AACpD,eAAO,MAAM,qBAAqB,GAAI,GAAG,WAAW
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAExB;oDACoD;AACpD,eAAO,MAAM,qBAAqB,GAAI,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqChD,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
export type VersionStatus = {
|
|
3
|
+
label: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
};
|
|
2
6
|
export type VersionPillProps = {
|
|
3
7
|
/** 版本号,如 "2.8.0"。 */
|
|
4
8
|
version: string;
|
|
5
9
|
/** 可选 build 号;值为 null/undefined/"" 时省略分点与 build 字。 */
|
|
6
10
|
build?: string;
|
|
7
|
-
/**
|
|
8
|
-
|
|
11
|
+
/** 可见状态;缺省为 success 色的“正常”。 */
|
|
12
|
+
status?: VersionStatus;
|
|
9
13
|
/**
|
|
10
14
|
* 版本号前缀文案,默认 "版本 "。
|
|
11
15
|
* 消费者可传 "v" / "Version " 等覆盖(含末尾空格)。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/business/VersionPill/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -6,5 +6,5 @@ export type { GlassStatsProps, GlassStatItem } from './GlassStats';
|
|
|
6
6
|
export { AvatarWithRing } from './AvatarWithRing';
|
|
7
7
|
export type { AvatarWithRingProps } from './AvatarWithRing';
|
|
8
8
|
export { VersionPill } from './VersionPill';
|
|
9
|
-
export type { VersionPillProps } from './VersionPill';
|
|
9
|
+
export type { VersionPillProps, VersionStatus } from './VersionPill';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/business/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/business/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
export declare function sanitizeSvgIdPart(value: string): string;
|
|
2
|
+
export declare function buildSvgId(prefix: string, override: string | undefined, reactId: string): string;
|
|
1
3
|
/**
|
|
2
|
-
* SVG 渐变 id 生成 hook —— 消毒 React
|
|
4
|
+
* SVG 渐变 id 生成 hook —— 消毒 prefix、override 与 React useId。
|
|
3
5
|
*
|
|
4
|
-
* Why:
|
|
5
|
-
*
|
|
6
|
-
* 会导致 SVG 引用失败。sanitize 后拼上 prefix 保证唯一且合法。
|
|
6
|
+
* Why:useId() 的字符串格式由 renderer 决定,caller 传入的 prefix 与 override
|
|
7
|
+
* 也可能包含空白或标点;统一消毒并保证合法首字符后,SVG 引用才能跨平台稳定。
|
|
7
8
|
*
|
|
8
9
|
* @param prefix 短前缀,区分同屏多 gradient(如 "gw" / "rh" / "av")。
|
|
9
|
-
* @param override 可选:外部传入的 gradientId
|
|
10
|
+
* @param override 可选:外部传入的 gradientId;消毒后非空时优先使用。
|
|
10
11
|
*/
|
|
11
12
|
export declare function useSvgId(prefix: string, override?: string): string;
|
|
12
13
|
//# sourceMappingURL=useSvgId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSvgId.d.ts","sourceRoot":"","sources":["../../../../../src/components/business/useSvgId.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"useSvgId.d.ts","sourceRoot":"","sources":["../../../../../src/components/business/useSvgId.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,MAAM,GACd,MAAM,CAWR;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlE"}
|
|
@@ -3,8 +3,8 @@ import type { AvatarProps } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* 圆形头像 —— 5 档尺寸 × 4 种配色 × 可选图片 source。
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* 合法 source 由 keyed ImageAttempt 独立持有失败状态;非法 source 或加载失败
|
|
7
|
+
* 时渲染 label + variant 背景色。
|
|
8
8
|
*/
|
|
9
9
|
export declare function Avatar({ label, size, variant, source, style, testID, }: AvatarProps): React.JSX.Element;
|
|
10
10
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,IAAW,EACX,OAAmB,EACnB,MAAM,EACN,KAAK,EACL,MAAM,GACP,EAAE,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA6CjC"}
|
|
@@ -20,8 +20,12 @@ export type AvatarProps = {
|
|
|
20
20
|
/** 配色变体,默认 'neutral' */
|
|
21
21
|
variant?: AvatarVariant;
|
|
22
22
|
/**
|
|
23
|
-
* 真实头像图片(URL `{ uri: '...' }
|
|
24
|
-
*
|
|
23
|
+
* 真实头像图片(URL `{ uri: '...' }`、URI source 数组或 `require(...)`)。
|
|
24
|
+
* 运行时先校验并生成 immutable semantic snapshot;非法 source 直接 fallback。
|
|
25
|
+
* Web 对 URI source 数组明确使用首个 candidate,native 保留完整数组。
|
|
26
|
+
* class / custom prototype 只读取 own enumerable data,继承属性与 accessor 无效。
|
|
27
|
+
* 等价 source 沿用同一 keyed attempt,真实字段变化才重试;失败 state 不跨
|
|
28
|
+
* attempt 共享。
|
|
25
29
|
*/
|
|
26
30
|
source?: ImageSourcePropType;
|
|
27
31
|
/** 容器附加样式(margin / position 等布局微调)。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9E,mEAAmE;AACnE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,wBAAwB;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9E,mEAAmE;AACnE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,wBAAwB;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,uCAAuC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -7,5 +7,5 @@ import type { ButtonProps } from './types';
|
|
|
7
7
|
*
|
|
8
8
|
* `loading=true` 时 ButtonBase 把 children render prop 短路为 ActivityIndicator。
|
|
9
9
|
*/
|
|
10
|
-
export declare function Button({ label, onPress, size, variant, block, disabled, loading, leftIcon, rightIcon, style, testID, accessibilityHint, }: ButtonProps): React.JSX.Element;
|
|
10
|
+
export declare function Button({ label, onPress, size, variant, block, disabled, loading, leftIcon, rightIcon, style, testID, accessibilityHint, accessibilityState, }: ButtonProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAQzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,kBAAkB,GACnB,EAAE,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA+CjC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type AccessibilityRole, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { type AccessibilityRole, type AccessibilityState, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
import type { ButtonBaseRenderContext, ButtonSize, ButtonVariant } from './types';
|
|
4
4
|
export type ButtonBaseProps = {
|
|
5
|
-
onPress
|
|
5
|
+
onPress: () => void;
|
|
6
6
|
size?: ButtonSize;
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
8
|
disabled?: boolean;
|
|
@@ -14,6 +14,8 @@ export type ButtonBaseProps = {
|
|
|
14
14
|
accessibilityRole?: AccessibilityRole;
|
|
15
15
|
/** SR 朗读 label 后的行为说明 hint。仅在"行为不显然"时加。 */
|
|
16
16
|
accessibilityHint?: string;
|
|
17
|
+
/** 调用方附加状态;disabled / busy 由内部状态机控制,不能被覆盖。 */
|
|
18
|
+
accessibilityState?: Omit<AccessibilityState, 'disabled' | 'busy'>;
|
|
17
19
|
style?: StyleProp<ViewStyle>;
|
|
18
20
|
testID?: string;
|
|
19
21
|
/** 强制函数形态 — 消费者通过 ctx.sizing / ctx.palette 渲染内容,
|
|
@@ -23,5 +25,5 @@ export type ButtonBaseProps = {
|
|
|
23
25
|
/** ButtonBase —— Button / IconButton 共享的 internal primitive。
|
|
24
26
|
* 职责:Pressable / sizing / palette / 视觉态 / a11y / text variant 特殊处理 /
|
|
25
27
|
* block / square。children 强制 render prop,sizingFor / paletteFor 在 styles.ts。 */
|
|
26
|
-
export declare function ButtonBase({ onPress, size, variant, disabled, loading, block, square, accessibilityLabel, accessibilityRole, accessibilityHint, style, testID, children, }: ButtonBaseProps): React.JSX.Element;
|
|
28
|
+
export declare function ButtonBase({ onPress, size, variant, disabled, loading, block, square, accessibilityLabel, accessibilityRole, accessibilityHint, accessibilityState, style, testID, children, }: ButtonBaseProps): React.JSX.Element;
|
|
27
29
|
//# sourceMappingURL=ButtonBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Button/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Button/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;+CAC2C;IAC3C,QAAQ,EAAE,CAAC,GAAG,EAAE,uBAAuB,KAAK,KAAK,CAAC,SAAS,CAAC;CAC7D,CAAC;AAEF;;iFAEiF;AACjF,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,IAAW,EACX,OAAmB,EACnB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,iBAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA0ErC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { AccessibilityState, StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import type { IconName } from '../Icon';
|
|
3
3
|
/** Button 尺寸:sm=28 / md=36 / lg=44(对应 control.sm/md/lg) */
|
|
4
4
|
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
@@ -18,12 +18,12 @@ export type ButtonProps = {
|
|
|
18
18
|
/** 按钮文案;icon-only 场景请用 IconButton */
|
|
19
19
|
label: string;
|
|
20
20
|
/** 点击回调;disabled / loading 时不触发 */
|
|
21
|
-
onPress
|
|
21
|
+
onPress: () => void;
|
|
22
22
|
/** 尺寸,默认 'md' */
|
|
23
23
|
size?: ButtonSize;
|
|
24
24
|
/** 视觉变体,默认 'primary' */
|
|
25
25
|
variant?: ButtonVariant;
|
|
26
|
-
/**
|
|
26
|
+
/** 撑满父容器交叉轴宽度(alignSelf: stretch) */
|
|
27
27
|
block?: boolean;
|
|
28
28
|
/** 整体禁用:透明度 0.5 + 不响应 onPress */
|
|
29
29
|
disabled?: boolean;
|
|
@@ -39,6 +39,8 @@ export type ButtonProps = {
|
|
|
39
39
|
testID?: string;
|
|
40
40
|
/** SR 朗读 label 后的行为说明 hint。仅在"行为不显然"时加(如 "切换主题")。 */
|
|
41
41
|
accessibilityHint?: string;
|
|
42
|
+
/** 额外 a11y 状态;disabled / busy 由组件根据 disabled / loading 统一上报。 */
|
|
43
|
+
accessibilityState?: Omit<AccessibilityState, 'disabled' | 'busy'>;
|
|
42
44
|
};
|
|
43
45
|
/** ButtonBase 内部根据 size 算出的视觉参数集合,通过 render prop 暴露给消费者。 */
|
|
44
46
|
export type ButtonSizing = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAA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AiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,eAAe;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAqBzC,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA0J1D,eAAO,MAAM,QAAQ,EAAsC,CAAC,CAAC,EAC3D,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAAE,KACvD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 系统请求减弱动效时,Carousel 不得启动计时 autoplay。 */
|
|
2
|
+
export declare const effectiveCarouselAutoplay: (autoplay: boolean | undefined, reducedMotion: boolean) => boolean;
|
|
3
|
+
/** 单页不需要视觉页码,也不应为其保留布局高度。 */
|
|
4
|
+
export declare const shouldRenderCarouselPagination: (showIndicator: boolean, itemCount: number) => boolean;
|
|
5
|
+
type CarouselPressHandler<T> = (item: T, index: number) => void;
|
|
6
|
+
type CarouselLabelGetter<T> = (item: T, index: number) => unknown;
|
|
7
|
+
export type NormalizedCarouselAction<T> = {
|
|
8
|
+
kind: 'display';
|
|
9
|
+
diagnostics: readonly string[];
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'action';
|
|
12
|
+
onPressItem: CarouselPressHandler<T>;
|
|
13
|
+
getAccessibilityLabel: CarouselLabelGetter<T>;
|
|
14
|
+
diagnostics: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
/** 只有两个函数同时存在才形成 action;任何半配置/未类型化值都失败关闭为展示。 */
|
|
17
|
+
export declare function normalizeCarouselAction<T>(onPressItem: unknown, getAccessibilityLabel: unknown): NormalizedCarouselAction<T>;
|
|
18
|
+
export type CarouselItemAccessibility = {
|
|
19
|
+
label: string | undefined;
|
|
20
|
+
diagnostics: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
/** getter 的异常和非法返回值都只影响当前 item,不能让整个 Carousel render 崩溃。 */
|
|
23
|
+
export declare function resolveCarouselItemAccessibility<T>(getAccessibilityLabel: CarouselLabelGetter<T>, item: T, index: number, itemCount: number): CarouselItemAccessibility;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=behavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/Carousel/behavior.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,eAAO,MAAM,yBAAyB,GACpC,UAAU,OAAO,GAAG,SAAS,EAC7B,eAAe,OAAO,KACrB,OAA8C,CAAC;AAElD,6BAA6B;AAC7B,eAAO,MAAM,8BAA8B,GACzC,eAAe,OAAO,EACtB,WAAW,MAAM,KAChB,OAAyC,CAAC;AAE7C,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAChE,KAAK,m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