blend-native 0.0.1-beta.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 +404 -0
- package/lib/commonjs/a11y/announcement.js +42 -0
- package/lib/commonjs/a11y/announcement.js.map +1 -0
- package/lib/commonjs/a11y/useLiveRegion.js +37 -0
- package/lib/commonjs/a11y/useLiveRegion.js.map +1 -0
- package/lib/commonjs/adapters/cssStringAdapter.js +363 -0
- package/lib/commonjs/adapters/cssStringAdapter.js.map +1 -0
- package/lib/commonjs/adapters/optionalGradient.js +33 -0
- package/lib/commonjs/adapters/optionalGradient.js.map +1 -0
- package/lib/commonjs/adapters/surfaceStyle.js +159 -0
- package/lib/commonjs/adapters/surfaceStyle.js.map +1 -0
- package/lib/commonjs/components/Alert/Alert.js +130 -0
- package/lib/commonjs/components/Alert/Alert.js.map +1 -0
- package/lib/commonjs/components/Alert/AlertActions.js +74 -0
- package/lib/commonjs/components/Alert/AlertActions.js.map +1 -0
- package/lib/commonjs/components/Alert/AlertClose.js +48 -0
- package/lib/commonjs/components/Alert/AlertClose.js.map +1 -0
- package/lib/commonjs/components/Alert/AlertText.js +49 -0
- package/lib/commonjs/components/Alert/AlertText.js.map +1 -0
- package/lib/commonjs/components/Alert/alert.tokens.js +6 -0
- package/lib/commonjs/components/Alert/alert.tokens.js.map +1 -0
- package/lib/commonjs/components/Alert/alert.types.js +6 -0
- package/lib/commonjs/components/Alert/alert.types.js.map +1 -0
- package/lib/commonjs/components/Alert/alert.utils.js +80 -0
- package/lib/commonjs/components/Alert/alert.utils.js.map +1 -0
- package/lib/commonjs/components/Alert/index.js +51 -0
- package/lib/commonjs/components/Alert/index.js.map +1 -0
- package/lib/commonjs/components/Button/Button.js +125 -0
- package/lib/commonjs/components/Button/Button.js.map +1 -0
- package/lib/commonjs/components/Button/button.types.js +6 -0
- package/lib/commonjs/components/Button/button.types.js.map +1 -0
- package/lib/commonjs/components/Button/button.utils.js +129 -0
- package/lib/commonjs/components/Button/button.utils.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +57 -0
- package/lib/commonjs/components/Button/index.js.map +1 -0
- package/lib/commonjs/components/Skeleton/Skeleton.js +154 -0
- package/lib/commonjs/components/Skeleton/Skeleton.js.map +1 -0
- package/lib/commonjs/components/Skeleton/index.js +20 -0
- package/lib/commonjs/components/Skeleton/index.js.map +1 -0
- package/lib/commonjs/components/Skeleton/skeleton.types.js +6 -0
- package/lib/commonjs/components/Skeleton/skeleton.types.js.map +1 -0
- package/lib/commonjs/components/Skeleton/skeleton.utils.js +45 -0
- package/lib/commonjs/components/Skeleton/skeleton.utils.js.map +1 -0
- package/lib/commonjs/components/Tag/Tag.js +161 -0
- package/lib/commonjs/components/Tag/Tag.js.map +1 -0
- package/lib/commonjs/components/Tag/index.js +33 -0
- package/lib/commonjs/components/Tag/index.js.map +1 -0
- package/lib/commonjs/components/Tag/tag.types.js +6 -0
- package/lib/commonjs/components/Tag/tag.types.js.map +1 -0
- package/lib/commonjs/components/Tag/tag.utils.js +69 -0
- package/lib/commonjs/components/Tag/tag.utils.js.map +1 -0
- package/lib/commonjs/components/TextInput/TextInput.js +138 -0
- package/lib/commonjs/components/TextInput/TextInput.js.map +1 -0
- package/lib/commonjs/components/TextInput/index.js +14 -0
- package/lib/commonjs/components/TextInput/index.js.map +1 -0
- package/lib/commonjs/components/TextInput/textInput.types.js +6 -0
- package/lib/commonjs/components/TextInput/textInput.types.js.map +1 -0
- package/lib/commonjs/components/TextInput/textInput.utils.js +40 -0
- package/lib/commonjs/components/TextInput/textInput.utils.js.map +1 -0
- package/lib/commonjs/components/shared/field/FieldFooter.js +51 -0
- package/lib/commonjs/components/shared/field/FieldFooter.js.map +1 -0
- package/lib/commonjs/components/shared/field/FieldLabels.js +67 -0
- package/lib/commonjs/components/shared/field/FieldLabels.js.map +1 -0
- package/lib/commonjs/components/shared/field/fieldState.js +37 -0
- package/lib/commonjs/components/shared/field/fieldState.js.map +1 -0
- package/lib/commonjs/components/shared/group.js +73 -0
- package/lib/commonjs/components/shared/group.js.map +1 -0
- package/lib/commonjs/index.js +256 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/motion/motion.js +128 -0
- package/lib/commonjs/motion/motion.js.map +1 -0
- package/lib/commonjs/motion/useReduceMotion.js +37 -0
- package/lib/commonjs/motion/useReduceMotion.js.map +1 -0
- package/lib/commonjs/overlay/portal.js +110 -0
- package/lib/commonjs/overlay/portal.js.map +1 -0
- package/lib/commonjs/overlay/positioning.js +122 -0
- package/lib/commonjs/overlay/positioning.js.map +1 -0
- package/lib/commonjs/overlay/safeAreaInsets.js +30 -0
- package/lib/commonjs/overlay/safeAreaInsets.js.map +1 -0
- package/lib/commonjs/overlay/sheet/BottomSheet.js +196 -0
- package/lib/commonjs/overlay/sheet/BottomSheet.js.map +1 -0
- package/lib/commonjs/overlay/sheet/sheetMath.js +60 -0
- package/lib/commonjs/overlay/sheet/sheetMath.js.map +1 -0
- package/lib/commonjs/overlay/toast/ToastOutlet.js +106 -0
- package/lib/commonjs/overlay/toast/ToastOutlet.js.map +1 -0
- package/lib/commonjs/overlay/toast/toastStore.js +76 -0
- package/lib/commonjs/overlay/toast/toastStore.js.map +1 -0
- package/lib/commonjs/overlay/useAnchoredPosition.js +85 -0
- package/lib/commonjs/overlay/useAnchoredPosition.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/primitives/Block.js +112 -0
- package/lib/commonjs/primitives/Block.js.map +1 -0
- package/lib/commonjs/primitives/Pressable.js +348 -0
- package/lib/commonjs/primitives/Pressable.js.map +1 -0
- package/lib/commonjs/primitives/PrimitiveInput.js +66 -0
- package/lib/commonjs/primitives/PrimitiveInput.js.map +1 -0
- package/lib/commonjs/primitives/Separator.js +55 -0
- package/lib/commonjs/primitives/Separator.js.map +1 -0
- package/lib/commonjs/primitives/Slot.js +78 -0
- package/lib/commonjs/primitives/Slot.js.map +1 -0
- package/lib/commonjs/primitives/Text.js +73 -0
- package/lib/commonjs/primitives/Text.js.map +1 -0
- package/lib/commonjs/primitives/pressFeedback.js +53 -0
- package/lib/commonjs/primitives/pressFeedback.js.map +1 -0
- package/lib/commonjs/primitives/textStyle.js +27 -0
- package/lib/commonjs/primitives/textStyle.js.map +1 -0
- package/lib/commonjs/primitives/tintSlot.js +45 -0
- package/lib/commonjs/primitives/tintSlot.js.map +1 -0
- package/lib/commonjs/primitives/touchTarget.js +64 -0
- package/lib/commonjs/primitives/touchTarget.js.map +1 -0
- package/lib/commonjs/theme/BlendNativeProvider.js +90 -0
- package/lib/commonjs/theme/BlendNativeProvider.js.map +1 -0
- package/lib/commonjs/theme/breakpoint.js +36 -0
- package/lib/commonjs/theme/breakpoint.js.map +1 -0
- package/lib/commonjs/theme/fonts.js +58 -0
- package/lib/commonjs/theme/fonts.js.map +1 -0
- package/lib/commonjs/theme/nativeTokenRegistry.js +44 -0
- package/lib/commonjs/theme/nativeTokenRegistry.js.map +1 -0
- package/lib/commonjs/theme/systemTheme.js +35 -0
- package/lib/commonjs/theme/systemTheme.js.map +1 -0
- package/lib/commonjs/theme/useNativeBreakpoint.js +33 -0
- package/lib/commonjs/theme/useNativeBreakpoint.js.map +1 -0
- package/lib/commonjs/theme/useNativeTokens.js +71 -0
- package/lib/commonjs/theme/useNativeTokens.js.map +1 -0
- package/lib/module/a11y/announcement.js +38 -0
- package/lib/module/a11y/announcement.js.map +1 -0
- package/lib/module/a11y/useLiveRegion.js +33 -0
- package/lib/module/a11y/useLiveRegion.js.map +1 -0
- package/lib/module/adapters/cssStringAdapter.js +352 -0
- package/lib/module/adapters/cssStringAdapter.js.map +1 -0
- package/lib/module/adapters/optionalGradient.js +29 -0
- package/lib/module/adapters/optionalGradient.js.map +1 -0
- package/lib/module/adapters/surfaceStyle.js +155 -0
- package/lib/module/adapters/surfaceStyle.js.map +1 -0
- package/lib/module/components/Alert/Alert.js +126 -0
- package/lib/module/components/Alert/Alert.js.map +1 -0
- package/lib/module/components/Alert/AlertActions.js +70 -0
- package/lib/module/components/Alert/AlertActions.js.map +1 -0
- package/lib/module/components/Alert/AlertClose.js +44 -0
- package/lib/module/components/Alert/AlertClose.js.map +1 -0
- package/lib/module/components/Alert/AlertText.js +45 -0
- package/lib/module/components/Alert/AlertText.js.map +1 -0
- package/lib/module/components/Alert/alert.tokens.js +4 -0
- package/lib/module/components/Alert/alert.tokens.js.map +1 -0
- package/lib/module/components/Alert/alert.types.js +4 -0
- package/lib/module/components/Alert/alert.types.js.map +1 -0
- package/lib/module/components/Alert/alert.utils.js +72 -0
- package/lib/module/components/Alert/alert.utils.js.map +1 -0
- package/lib/module/components/Alert/index.js +6 -0
- package/lib/module/components/Alert/index.js.map +1 -0
- package/lib/module/components/Button/Button.js +121 -0
- package/lib/module/components/Button/Button.js.map +1 -0
- package/lib/module/components/Button/button.types.js +4 -0
- package/lib/module/components/Button/button.types.js.map +1 -0
- package/lib/module/components/Button/button.utils.js +120 -0
- package/lib/module/components/Button/button.utils.js.map +1 -0
- package/lib/module/components/Button/index.js +5 -0
- package/lib/module/components/Button/index.js.map +1 -0
- package/lib/module/components/Skeleton/Skeleton.js +149 -0
- package/lib/module/components/Skeleton/Skeleton.js.map +1 -0
- package/lib/module/components/Skeleton/index.js +4 -0
- package/lib/module/components/Skeleton/index.js.map +1 -0
- package/lib/module/components/Skeleton/skeleton.types.js +4 -0
- package/lib/module/components/Skeleton/skeleton.types.js.map +1 -0
- package/lib/module/components/Skeleton/skeleton.utils.js +40 -0
- package/lib/module/components/Skeleton/skeleton.utils.js.map +1 -0
- package/lib/module/components/Tag/Tag.js +157 -0
- package/lib/module/components/Tag/Tag.js.map +1 -0
- package/lib/module/components/Tag/index.js +5 -0
- package/lib/module/components/Tag/index.js.map +1 -0
- package/lib/module/components/Tag/tag.types.js +4 -0
- package/lib/module/components/Tag/tag.types.js.map +1 -0
- package/lib/module/components/Tag/tag.utils.js +64 -0
- package/lib/module/components/Tag/tag.utils.js.map +1 -0
- package/lib/module/components/TextInput/TextInput.js +134 -0
- package/lib/module/components/TextInput/TextInput.js.map +1 -0
- package/lib/module/components/TextInput/index.js +4 -0
- package/lib/module/components/TextInput/index.js.map +1 -0
- package/lib/module/components/TextInput/textInput.types.js +4 -0
- package/lib/module/components/TextInput/textInput.types.js.map +1 -0
- package/lib/module/components/TextInput/textInput.utils.js +36 -0
- package/lib/module/components/TextInput/textInput.utils.js.map +1 -0
- package/lib/module/components/shared/field/FieldFooter.js +47 -0
- package/lib/module/components/shared/field/FieldFooter.js.map +1 -0
- package/lib/module/components/shared/field/FieldLabels.js +63 -0
- package/lib/module/components/shared/field/FieldLabels.js.map +1 -0
- package/lib/module/components/shared/field/fieldState.js +33 -0
- package/lib/module/components/shared/field/fieldState.js.map +1 -0
- package/lib/module/components/shared/group.js +68 -0
- package/lib/module/components/shared/group.js.map +1 -0
- package/lib/module/index.js +80 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/motion/motion.js +123 -0
- package/lib/module/motion/motion.js.map +1 -0
- package/lib/module/motion/useReduceMotion.js +33 -0
- package/lib/module/motion/useReduceMotion.js.map +1 -0
- package/lib/module/overlay/portal.js +104 -0
- package/lib/module/overlay/portal.js.map +1 -0
- package/lib/module/overlay/positioning.js +118 -0
- package/lib/module/overlay/positioning.js.map +1 -0
- package/lib/module/overlay/safeAreaInsets.js +27 -0
- package/lib/module/overlay/safeAreaInsets.js.map +1 -0
- package/lib/module/overlay/sheet/BottomSheet.js +190 -0
- package/lib/module/overlay/sheet/BottomSheet.js.map +1 -0
- package/lib/module/overlay/sheet/sheetMath.js +53 -0
- package/lib/module/overlay/sheet/sheetMath.js.map +1 -0
- package/lib/module/overlay/toast/ToastOutlet.js +101 -0
- package/lib/module/overlay/toast/ToastOutlet.js.map +1 -0
- package/lib/module/overlay/toast/toastStore.js +66 -0
- package/lib/module/overlay/toast/toastStore.js.map +1 -0
- package/lib/module/overlay/useAnchoredPosition.js +82 -0
- package/lib/module/overlay/useAnchoredPosition.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/primitives/Block.js +107 -0
- package/lib/module/primitives/Block.js.map +1 -0
- package/lib/module/primitives/Pressable.js +339 -0
- package/lib/module/primitives/Pressable.js.map +1 -0
- package/lib/module/primitives/PrimitiveInput.js +62 -0
- package/lib/module/primitives/PrimitiveInput.js.map +1 -0
- package/lib/module/primitives/Separator.js +50 -0
- package/lib/module/primitives/Separator.js.map +1 -0
- package/lib/module/primitives/Slot.js +69 -0
- package/lib/module/primitives/Slot.js.map +1 -0
- package/lib/module/primitives/Text.js +68 -0
- package/lib/module/primitives/Text.js.map +1 -0
- package/lib/module/primitives/pressFeedback.js +48 -0
- package/lib/module/primitives/pressFeedback.js.map +1 -0
- package/lib/module/primitives/textStyle.js +23 -0
- package/lib/module/primitives/textStyle.js.map +1 -0
- package/lib/module/primitives/tintSlot.js +42 -0
- package/lib/module/primitives/tintSlot.js.map +1 -0
- package/lib/module/primitives/touchTarget.js +58 -0
- package/lib/module/primitives/touchTarget.js.map +1 -0
- package/lib/module/theme/BlendNativeProvider.js +78 -0
- package/lib/module/theme/BlendNativeProvider.js.map +1 -0
- package/lib/module/theme/breakpoint.js +33 -0
- package/lib/module/theme/breakpoint.js.map +1 -0
- package/lib/module/theme/fonts.js +55 -0
- package/lib/module/theme/fonts.js.map +1 -0
- package/lib/module/theme/nativeTokenRegistry.js +40 -0
- package/lib/module/theme/nativeTokenRegistry.js.map +1 -0
- package/lib/module/theme/systemTheme.js +31 -0
- package/lib/module/theme/systemTheme.js.map +1 -0
- package/lib/module/theme/useNativeBreakpoint.js +24 -0
- package/lib/module/theme/useNativeBreakpoint.js.map +1 -0
- package/lib/module/theme/useNativeTokens.js +67 -0
- package/lib/module/theme/useNativeTokens.js.map +1 -0
- package/lib/typescript/commonjs/a11y/announcement.d.ts +26 -0
- package/lib/typescript/commonjs/a11y/announcement.d.ts.map +1 -0
- package/lib/typescript/commonjs/a11y/useLiveRegion.d.ts +17 -0
- package/lib/typescript/commonjs/a11y/useLiveRegion.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapters/cssStringAdapter.d.ts +119 -0
- package/lib/typescript/commonjs/adapters/cssStringAdapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapters/optionalGradient.d.ts +32 -0
- package/lib/typescript/commonjs/adapters/optionalGradient.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapters/surfaceStyle.d.ts +75 -0
- package/lib/typescript/commonjs/adapters/surfaceStyle.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/Alert.d.ts +14 -0
- package/lib/typescript/commonjs/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/AlertActions.d.ts +13 -0
- package/lib/typescript/commonjs/components/Alert/AlertActions.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/AlertClose.d.ts +22 -0
- package/lib/typescript/commonjs/components/Alert/AlertClose.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/AlertText.d.ts +19 -0
- package/lib/typescript/commonjs/components/Alert/AlertText.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/alert.tokens.d.ts +17 -0
- package/lib/typescript/commonjs/components/Alert/alert.tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/alert.types.d.ts +70 -0
- package/lib/typescript/commonjs/components/Alert/alert.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/alert.utils.d.ts +58 -0
- package/lib/typescript/commonjs/components/Alert/alert.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/index.d.ts +7 -0
- package/lib/typescript/commonjs/components/Alert/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +22 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/button.types.d.ts +37 -0
- package/lib/typescript/commonjs/components/Button/button.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/button.utils.d.ts +98 -0
- package/lib/typescript/commonjs/components/Button/button.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +7 -0
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Skeleton/skeleton.types.d.ts +25 -0
- package/lib/typescript/commonjs/components/Skeleton/skeleton.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Skeleton/skeleton.utils.d.ts +21 -0
- package/lib/typescript/commonjs/components/Skeleton/skeleton.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Tag/Tag.d.ts +21 -0
- package/lib/typescript/commonjs/components/Tag/Tag.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Tag/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/Tag/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Tag/tag.types.d.ts +56 -0
- package/lib/typescript/commonjs/components/Tag/tag.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Tag/tag.utils.d.ts +41 -0
- package/lib/typescript/commonjs/components/Tag/tag.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TextInput/TextInput.d.ts +33 -0
- package/lib/typescript/commonjs/components/TextInput/TextInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TextInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/TextInput/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TextInput/textInput.types.d.ts +45 -0
- package/lib/typescript/commonjs/components/TextInput/textInput.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TextInput/textInput.utils.d.ts +35 -0
- package/lib/typescript/commonjs/components/TextInput/textInput.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/shared/field/FieldFooter.d.ts +22 -0
- package/lib/typescript/commonjs/components/shared/field/FieldFooter.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/shared/field/FieldLabels.d.ts +27 -0
- package/lib/typescript/commonjs/components/shared/field/FieldLabels.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/shared/field/fieldState.d.ts +23 -0
- package/lib/typescript/commonjs/components/shared/field/fieldState.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/shared/group.d.ts +50 -0
- package/lib/typescript/commonjs/components/shared/group.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +74 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/motion.d.ts +121 -0
- package/lib/typescript/commonjs/motion/motion.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/useReduceMotion.d.ts +14 -0
- package/lib/typescript/commonjs/motion/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/portal.d.ts +20 -0
- package/lib/typescript/commonjs/overlay/portal.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/positioning.d.ts +65 -0
- package/lib/typescript/commonjs/overlay/positioning.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/safeAreaInsets.d.ts +19 -0
- package/lib/typescript/commonjs/overlay/safeAreaInsets.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/sheet/BottomSheet.d.ts +56 -0
- package/lib/typescript/commonjs/overlay/sheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/sheet/sheetMath.d.ts +32 -0
- package/lib/typescript/commonjs/overlay/sheet/sheetMath.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/toast/ToastOutlet.d.ts +17 -0
- package/lib/typescript/commonjs/overlay/toast/ToastOutlet.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/toast/toastStore.d.ts +45 -0
- package/lib/typescript/commonjs/overlay/toast/toastStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/overlay/useAnchoredPosition.d.ts +40 -0
- package/lib/typescript/commonjs/overlay/useAnchoredPosition.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/primitives/Block.d.ts +37 -0
- package/lib/typescript/commonjs/primitives/Block.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/Pressable.d.ts +135 -0
- package/lib/typescript/commonjs/primitives/Pressable.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/PrimitiveInput.d.ts +42 -0
- package/lib/typescript/commonjs/primitives/PrimitiveInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/Separator.d.ts +28 -0
- package/lib/typescript/commonjs/primitives/Separator.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/Slot.d.ts +48 -0
- package/lib/typescript/commonjs/primitives/Slot.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/Text.d.ts +50 -0
- package/lib/typescript/commonjs/primitives/Text.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/pressFeedback.d.ts +39 -0
- package/lib/typescript/commonjs/primitives/pressFeedback.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/textStyle.d.ts +13 -0
- package/lib/typescript/commonjs/primitives/textStyle.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/tintSlot.d.ts +10 -0
- package/lib/typescript/commonjs/primitives/tintSlot.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives/touchTarget.d.ts +43 -0
- package/lib/typescript/commonjs/primitives/touchTarget.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/BlendNativeProvider.d.ts +69 -0
- package/lib/typescript/commonjs/theme/BlendNativeProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/breakpoint.d.ts +27 -0
- package/lib/typescript/commonjs/theme/breakpoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/fonts.d.ts +34 -0
- package/lib/typescript/commonjs/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/nativeTokenRegistry.d.ts +34 -0
- package/lib/typescript/commonjs/theme/nativeTokenRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/systemTheme.d.ts +25 -0
- package/lib/typescript/commonjs/theme/systemTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/useNativeBreakpoint.d.ts +17 -0
- package/lib/typescript/commonjs/theme/useNativeBreakpoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/useNativeTokens.d.ts +4 -0
- package/lib/typescript/commonjs/theme/useNativeTokens.d.ts.map +1 -0
- package/lib/typescript/module/a11y/announcement.d.ts +26 -0
- package/lib/typescript/module/a11y/announcement.d.ts.map +1 -0
- package/lib/typescript/module/a11y/useLiveRegion.d.ts +17 -0
- package/lib/typescript/module/a11y/useLiveRegion.d.ts.map +1 -0
- package/lib/typescript/module/adapters/cssStringAdapter.d.ts +119 -0
- package/lib/typescript/module/adapters/cssStringAdapter.d.ts.map +1 -0
- package/lib/typescript/module/adapters/optionalGradient.d.ts +32 -0
- package/lib/typescript/module/adapters/optionalGradient.d.ts.map +1 -0
- package/lib/typescript/module/adapters/surfaceStyle.d.ts +75 -0
- package/lib/typescript/module/adapters/surfaceStyle.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/Alert.d.ts +14 -0
- package/lib/typescript/module/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/AlertActions.d.ts +13 -0
- package/lib/typescript/module/components/Alert/AlertActions.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/AlertClose.d.ts +22 -0
- package/lib/typescript/module/components/Alert/AlertClose.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/AlertText.d.ts +19 -0
- package/lib/typescript/module/components/Alert/AlertText.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/alert.tokens.d.ts +17 -0
- package/lib/typescript/module/components/Alert/alert.tokens.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/alert.types.d.ts +70 -0
- package/lib/typescript/module/components/Alert/alert.types.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/alert.utils.d.ts +58 -0
- package/lib/typescript/module/components/Alert/alert.utils.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/index.d.ts +7 -0
- package/lib/typescript/module/components/Alert/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/Button.d.ts +22 -0
- package/lib/typescript/module/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/button.types.d.ts +37 -0
- package/lib/typescript/module/components/Button/button.types.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/button.utils.d.ts +98 -0
- package/lib/typescript/module/components/Button/button.utils.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/index.d.ts +5 -0
- package/lib/typescript/module/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +7 -0
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/module/components/Skeleton/index.d.ts +3 -0
- package/lib/typescript/module/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Skeleton/skeleton.types.d.ts +25 -0
- package/lib/typescript/module/components/Skeleton/skeleton.types.d.ts.map +1 -0
- package/lib/typescript/module/components/Skeleton/skeleton.utils.d.ts +21 -0
- package/lib/typescript/module/components/Skeleton/skeleton.utils.d.ts.map +1 -0
- package/lib/typescript/module/components/Tag/Tag.d.ts +21 -0
- package/lib/typescript/module/components/Tag/Tag.d.ts.map +1 -0
- package/lib/typescript/module/components/Tag/index.d.ts +4 -0
- package/lib/typescript/module/components/Tag/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Tag/tag.types.d.ts +56 -0
- package/lib/typescript/module/components/Tag/tag.types.d.ts.map +1 -0
- package/lib/typescript/module/components/Tag/tag.utils.d.ts +41 -0
- package/lib/typescript/module/components/Tag/tag.utils.d.ts.map +1 -0
- package/lib/typescript/module/components/TextInput/TextInput.d.ts +33 -0
- package/lib/typescript/module/components/TextInput/TextInput.d.ts.map +1 -0
- package/lib/typescript/module/components/TextInput/index.d.ts +3 -0
- package/lib/typescript/module/components/TextInput/index.d.ts.map +1 -0
- package/lib/typescript/module/components/TextInput/textInput.types.d.ts +45 -0
- package/lib/typescript/module/components/TextInput/textInput.types.d.ts.map +1 -0
- package/lib/typescript/module/components/TextInput/textInput.utils.d.ts +35 -0
- package/lib/typescript/module/components/TextInput/textInput.utils.d.ts.map +1 -0
- package/lib/typescript/module/components/shared/field/FieldFooter.d.ts +22 -0
- package/lib/typescript/module/components/shared/field/FieldFooter.d.ts.map +1 -0
- package/lib/typescript/module/components/shared/field/FieldLabels.d.ts +27 -0
- package/lib/typescript/module/components/shared/field/FieldLabels.d.ts.map +1 -0
- package/lib/typescript/module/components/shared/field/fieldState.d.ts +23 -0
- package/lib/typescript/module/components/shared/field/fieldState.d.ts.map +1 -0
- package/lib/typescript/module/components/shared/group.d.ts +50 -0
- package/lib/typescript/module/components/shared/group.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +74 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/motion/motion.d.ts +121 -0
- package/lib/typescript/module/motion/motion.d.ts.map +1 -0
- package/lib/typescript/module/motion/useReduceMotion.d.ts +14 -0
- package/lib/typescript/module/motion/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/module/overlay/portal.d.ts +20 -0
- package/lib/typescript/module/overlay/portal.d.ts.map +1 -0
- package/lib/typescript/module/overlay/positioning.d.ts +65 -0
- package/lib/typescript/module/overlay/positioning.d.ts.map +1 -0
- package/lib/typescript/module/overlay/safeAreaInsets.d.ts +19 -0
- package/lib/typescript/module/overlay/safeAreaInsets.d.ts.map +1 -0
- package/lib/typescript/module/overlay/sheet/BottomSheet.d.ts +56 -0
- package/lib/typescript/module/overlay/sheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/module/overlay/sheet/sheetMath.d.ts +32 -0
- package/lib/typescript/module/overlay/sheet/sheetMath.d.ts.map +1 -0
- package/lib/typescript/module/overlay/toast/ToastOutlet.d.ts +17 -0
- package/lib/typescript/module/overlay/toast/ToastOutlet.d.ts.map +1 -0
- package/lib/typescript/module/overlay/toast/toastStore.d.ts +45 -0
- package/lib/typescript/module/overlay/toast/toastStore.d.ts.map +1 -0
- package/lib/typescript/module/overlay/useAnchoredPosition.d.ts +40 -0
- package/lib/typescript/module/overlay/useAnchoredPosition.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/primitives/Block.d.ts +37 -0
- package/lib/typescript/module/primitives/Block.d.ts.map +1 -0
- package/lib/typescript/module/primitives/Pressable.d.ts +135 -0
- package/lib/typescript/module/primitives/Pressable.d.ts.map +1 -0
- package/lib/typescript/module/primitives/PrimitiveInput.d.ts +42 -0
- package/lib/typescript/module/primitives/PrimitiveInput.d.ts.map +1 -0
- package/lib/typescript/module/primitives/Separator.d.ts +28 -0
- package/lib/typescript/module/primitives/Separator.d.ts.map +1 -0
- package/lib/typescript/module/primitives/Slot.d.ts +48 -0
- package/lib/typescript/module/primitives/Slot.d.ts.map +1 -0
- package/lib/typescript/module/primitives/Text.d.ts +50 -0
- package/lib/typescript/module/primitives/Text.d.ts.map +1 -0
- package/lib/typescript/module/primitives/pressFeedback.d.ts +39 -0
- package/lib/typescript/module/primitives/pressFeedback.d.ts.map +1 -0
- package/lib/typescript/module/primitives/textStyle.d.ts +13 -0
- package/lib/typescript/module/primitives/textStyle.d.ts.map +1 -0
- package/lib/typescript/module/primitives/tintSlot.d.ts +10 -0
- package/lib/typescript/module/primitives/tintSlot.d.ts.map +1 -0
- package/lib/typescript/module/primitives/touchTarget.d.ts +43 -0
- package/lib/typescript/module/primitives/touchTarget.d.ts.map +1 -0
- package/lib/typescript/module/theme/BlendNativeProvider.d.ts +69 -0
- package/lib/typescript/module/theme/BlendNativeProvider.d.ts.map +1 -0
- package/lib/typescript/module/theme/breakpoint.d.ts +27 -0
- package/lib/typescript/module/theme/breakpoint.d.ts.map +1 -0
- package/lib/typescript/module/theme/fonts.d.ts +34 -0
- package/lib/typescript/module/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/module/theme/nativeTokenRegistry.d.ts +34 -0
- package/lib/typescript/module/theme/nativeTokenRegistry.d.ts.map +1 -0
- package/lib/typescript/module/theme/systemTheme.d.ts +25 -0
- package/lib/typescript/module/theme/systemTheme.d.ts.map +1 -0
- package/lib/typescript/module/theme/useNativeBreakpoint.d.ts +17 -0
- package/lib/typescript/module/theme/useNativeBreakpoint.d.ts.map +1 -0
- package/lib/typescript/module/theme/useNativeTokens.d.ts +4 -0
- package/lib/typescript/module/theme/useNativeTokens.d.ts.map +1 -0
- package/package.json +137 -0
- package/src/a11y/announcement.ts +41 -0
- package/src/a11y/useLiveRegion.ts +36 -0
- package/src/adapters/cssStringAdapter.ts +403 -0
- package/src/adapters/optionalGradient.ts +39 -0
- package/src/adapters/surfaceStyle.ts +209 -0
- package/src/components/Alert/Alert.tsx +167 -0
- package/src/components/Alert/AlertActions.tsx +98 -0
- package/src/components/Alert/AlertClose.tsx +53 -0
- package/src/components/Alert/AlertText.tsx +58 -0
- package/src/components/Alert/alert.tokens.ts +24 -0
- package/src/components/Alert/alert.types.ts +81 -0
- package/src/components/Alert/alert.utils.ts +94 -0
- package/src/components/Alert/index.ts +21 -0
- package/src/components/Button/Button.tsx +180 -0
- package/src/components/Button/button.types.ts +44 -0
- package/src/components/Button/button.utils.ts +213 -0
- package/src/components/Button/index.ts +12 -0
- package/src/components/Skeleton/Skeleton.tsx +196 -0
- package/src/components/Skeleton/index.ts +2 -0
- package/src/components/Skeleton/skeleton.types.ts +28 -0
- package/src/components/Skeleton/skeleton.utils.ts +56 -0
- package/src/components/Tag/Tag.tsx +204 -0
- package/src/components/Tag/index.ts +7 -0
- package/src/components/Tag/tag.types.ts +63 -0
- package/src/components/Tag/tag.utils.ts +82 -0
- package/src/components/TextInput/TextInput.tsx +165 -0
- package/src/components/TextInput/index.ts +2 -0
- package/src/components/TextInput/textInput.types.ts +54 -0
- package/src/components/TextInput/textInput.utils.ts +68 -0
- package/src/components/shared/field/FieldFooter.tsx +66 -0
- package/src/components/shared/field/FieldLabels.tsx +86 -0
- package/src/components/shared/field/fieldState.ts +39 -0
- package/src/components/shared/group.ts +72 -0
- package/src/index.ts +144 -0
- package/src/motion/motion.ts +115 -0
- package/src/motion/useReduceMotion.ts +36 -0
- package/src/overlay/portal.tsx +122 -0
- package/src/overlay/positioning.ts +196 -0
- package/src/overlay/safeAreaInsets.ts +36 -0
- package/src/overlay/sheet/BottomSheet.tsx +276 -0
- package/src/overlay/sheet/sheetMath.ts +58 -0
- package/src/overlay/toast/ToastOutlet.tsx +127 -0
- package/src/overlay/toast/toastStore.ts +96 -0
- package/src/overlay/useAnchoredPosition.ts +92 -0
- package/src/primitives/Block.tsx +129 -0
- package/src/primitives/Pressable.tsx +528 -0
- package/src/primitives/PrimitiveInput.tsx +87 -0
- package/src/primitives/Separator.tsx +65 -0
- package/src/primitives/Slot.tsx +94 -0
- package/src/primitives/Text.tsx +98 -0
- package/src/primitives/pressFeedback.ts +78 -0
- package/src/primitives/textStyle.ts +24 -0
- package/src/primitives/tintSlot.ts +44 -0
- package/src/primitives/touchTarget.ts +72 -0
- package/src/theme/BlendNativeProvider.tsx +147 -0
- package/src/theme/breakpoint.ts +38 -0
- package/src/theme/fonts.ts +63 -0
- package/src/theme/nativeTokenRegistry.ts +57 -0
- package/src/theme/systemTheme.ts +34 -0
- package/src/theme/useNativeBreakpoint.ts +27 -0
- package/src/theme/useNativeTokens.ts +99 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InputStateV2 } from '@juspay/blend-design-system/node';
|
|
2
|
+
/**
|
|
3
|
+
* Input state derivation, shared by every field component.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors web's `getInputState` (`InputsV2/TextInputV2/utils.ts`) and the
|
|
6
|
+
* per-variant resolution `TextInputV2.tsx` performs inline: error always
|
|
7
|
+
* wins, then disabled, and focus applies only when nothing stronger does.
|
|
8
|
+
* `HOVER` exists in the enum but has no touch counterpart.
|
|
9
|
+
*
|
|
10
|
+
* Pure and RN-free so the whole truth table unit-tests under vitest.
|
|
11
|
+
*/
|
|
12
|
+
export type FieldError = {
|
|
13
|
+
show: boolean;
|
|
14
|
+
message?: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
/** The state driving label/footer colours — web's `getInputState`. */
|
|
17
|
+
export declare function getFieldState(error: FieldError, disabled?: boolean): InputStateV2;
|
|
18
|
+
/**
|
|
19
|
+
* The state driving the input container's border/background/text, which
|
|
20
|
+
* unlike the label state also reflects focus.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getFieldVisualState(error: FieldError, disabled: boolean | undefined, focused: boolean): InputStateV2;
|
|
23
|
+
//# sourceMappingURL=fieldState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldState.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/field/fieldState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAE/D;;;;;;;;;GASG;AAEH,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAA;AAExE,sEAAsE;AACtE,wBAAgB,aAAa,CACzB,KAAK,EAAE,UAAU,EACjB,QAAQ,CAAC,EAAE,OAAO,GACnB,YAAY,CAId;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,OAAO,EAAE,OAAO,GACjB,YAAY,CAKd"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Shared styling for grouped controls (button groups, tag groups).
|
|
4
|
+
*
|
|
5
|
+
* Members join edge to edge, so each keeps its radius only on the outward
|
|
6
|
+
* corners, and interior members drop the borders they would otherwise double
|
|
7
|
+
* up with their neighbour. Web implements the radius half identically in
|
|
8
|
+
* `ButtonV2/utils.ts` and `TagV2/utils.ts`, and the border half in
|
|
9
|
+
* `ButtonV2/utils.ts` (`getButtonBorderStyles`).
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `components/shared/` in the web package, which holds cross-component
|
|
12
|
+
* internals rather than components.
|
|
13
|
+
*/
|
|
14
|
+
/** Where a control sits within its group. `undefined` means ungrouped. */
|
|
15
|
+
export type GroupPosition = 'center' | 'left' | 'right';
|
|
16
|
+
/**
|
|
17
|
+
* Collapse a control's border radius for its position in a group.
|
|
18
|
+
*
|
|
19
|
+
* Returns a CSS string — either the untouched radius or a four-corner
|
|
20
|
+
* shorthand in CSS order (top-left, top-right, bottom-right, bottom-left).
|
|
21
|
+
* `parseBorderRadius` handles both forms.
|
|
22
|
+
*
|
|
23
|
+
* ```
|
|
24
|
+
* getGroupedBorderRadius('10px', undefined) -> '10px'
|
|
25
|
+
* getGroupedBorderRadius('10px', 'left') -> '10px 0 0 10px'
|
|
26
|
+
* getGroupedBorderRadius('10px', 'right') -> '0 10px 10px 0'
|
|
27
|
+
* getGroupedBorderRadius('10px', 'center') -> '0px 0px 0px 0px'
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function getGroupedBorderRadius(radius: string | number, position: GroupPosition | undefined): string;
|
|
31
|
+
/**
|
|
32
|
+
* Border widths to overlay for a control's position in a group.
|
|
33
|
+
*
|
|
34
|
+
* Interior (`center`) members drop their left and right borders so a shared
|
|
35
|
+
* edge is one line wide rather than two. Web does this in
|
|
36
|
+
* `getButtonBorderStyles`, which sets `borderLeft`/`borderRight` to `'none'`
|
|
37
|
+
* for the centre position and leaves the end caps fully bordered.
|
|
38
|
+
*
|
|
39
|
+
* Returned as a `ViewStyle` fragment to spread *after* the resolved surface,
|
|
40
|
+
* so `borderWidth: 1` still applies to the remaining sides.
|
|
41
|
+
*
|
|
42
|
+
* ```
|
|
43
|
+
* getGroupedBorderWidths(undefined) -> {}
|
|
44
|
+
* getGroupedBorderWidths('left') -> {}
|
|
45
|
+
* getGroupedBorderWidths('right') -> {}
|
|
46
|
+
* getGroupedBorderWidths('center') -> { borderLeftWidth: 0, borderRightWidth: 0 }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function getGroupedBorderWidths(position: GroupPosition | undefined): Pick<ViewStyle, 'borderLeftWidth' | 'borderRightWidth'>;
|
|
50
|
+
//# sourceMappingURL=group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;;;;;;;GAWG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAKvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,QAAQ,EAAE,aAAa,GAAG,SAAS,GACpC,MAAM,CAQR;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,aAAa,GAAG,SAAS,GACpC,IAAI,CAAC,SAAS,EAAE,iBAAiB,GAAG,kBAAkB,CAAC,CAGzD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* blend-native — React Native components for Blend Design System.
|
|
3
|
+
*
|
|
4
|
+
* Consumes Blend's token system via the React-free
|
|
5
|
+
* `@juspay/blend-design-system/node` entry and translates CSS-string token
|
|
6
|
+
* values into RN style objects.
|
|
7
|
+
*
|
|
8
|
+
* No `styled-components`, no DOM, no `window.addEventListener`.
|
|
9
|
+
*
|
|
10
|
+
* ---
|
|
11
|
+
*
|
|
12
|
+
* This barrel is the package's **public API**, and everything named here is a
|
|
13
|
+
* semver commitment. Low-level internals — the CSS-string parsers, the surface
|
|
14
|
+
* resolver, the token registry, the grouped-control helpers — are deliberately
|
|
15
|
+
* NOT exported: they exist to serve the primitives, their shapes will change as
|
|
16
|
+
* more components land, and `Block` / `Pressable` already expose everything a
|
|
17
|
+
* consumer needs to build a token-driven surface of their own.
|
|
18
|
+
*/
|
|
19
|
+
export { Alert } from './components/Alert/index.js';
|
|
20
|
+
export { Button } from './components/Button/index.js';
|
|
21
|
+
export { Tag } from './components/Tag/index.js';
|
|
22
|
+
export { TextInput } from './components/TextInput/index.js';
|
|
23
|
+
export type { TextInputNativeProps, TextInputSlot, } from './components/TextInput/index.js';
|
|
24
|
+
export { Skeleton } from './components/Skeleton/index.js';
|
|
25
|
+
export type { SkeletonNativeProps } from './components/Skeleton/index.js';
|
|
26
|
+
export type { AlertNativeProps, AlertSlot, AlertAction, AlertActions, AlertCloseButton, } from './components/Alert/index.js';
|
|
27
|
+
export type { ButtonNativeProps } from './components/Button/index.js';
|
|
28
|
+
export type { TagNativeProps, TagSlot } from './components/Tag/index.js';
|
|
29
|
+
export { BlendNativeProvider, BlendNativeThemeContext, DEFAULT_NATIVE_THEME, } from './theme/BlendNativeProvider.js';
|
|
30
|
+
export type { BlendNativeProviderProps, BlendNativeThemeValue, } from './theme/BlendNativeProvider.js';
|
|
31
|
+
/** Pass `theme={SYSTEM_THEME}` (or `theme="system"`) to follow the OS. */
|
|
32
|
+
export { SYSTEM_THEME } from './theme/systemTheme.js';
|
|
33
|
+
export type { NativeThemeSetting } from './theme/systemTheme.js';
|
|
34
|
+
export type { NativeFontRole, NativeFontFamilies, NativeFontFamilyOption, } from './theme/fonts.js';
|
|
35
|
+
export { useNativeTokens } from './theme/useNativeTokens.js';
|
|
36
|
+
export { useNativeBreakpoint } from './theme/useNativeBreakpoint.js';
|
|
37
|
+
export type { NativeBreakpoint } from './theme/useNativeBreakpoint.js';
|
|
38
|
+
export type { NativeTokenSlot, NativeComponentTokenOverrides, } from './theme/nativeTokenRegistry.js';
|
|
39
|
+
export { Block } from './primitives/Block.js';
|
|
40
|
+
export { Pressable } from './primitives/Pressable.js';
|
|
41
|
+
export { Text } from './primitives/Text.js';
|
|
42
|
+
export { Slot } from './primitives/Slot.js';
|
|
43
|
+
export { Separator } from './primitives/Separator.js';
|
|
44
|
+
export { PrimitiveInput } from './primitives/PrimitiveInput.js';
|
|
45
|
+
export type { PrimitiveInputProps } from './primitives/PrimitiveInput.js';
|
|
46
|
+
export type { BlockProps } from './primitives/Block.js';
|
|
47
|
+
export type { PrimitivePressableProps } from './primitives/Pressable.js';
|
|
48
|
+
export type { BlendTextProps } from './primitives/Text.js';
|
|
49
|
+
export type { SlotProps } from './primitives/Slot.js';
|
|
50
|
+
export type { SeparatorProps } from './primitives/Separator.js';
|
|
51
|
+
export type { SurfaceStyleProps } from './adapters/surfaceStyle.js';
|
|
52
|
+
export type { RNSize } from './adapters/cssStringAdapter.js';
|
|
53
|
+
/**
|
|
54
|
+
* The minimum tap target `Pressable` enforces via `hitSlop`, in points.
|
|
55
|
+
* Exposed so consumers can reason about it; pass `minTouchTarget={0}` to opt
|
|
56
|
+
* a control out.
|
|
57
|
+
*/
|
|
58
|
+
export { MIN_TOUCH_TARGET } from './primitives/touchTarget.js';
|
|
59
|
+
export { Portal } from './overlay/portal.js';
|
|
60
|
+
export type { PortalProps } from './overlay/portal.js';
|
|
61
|
+
export { useReduceMotion } from './motion/useReduceMotion.js';
|
|
62
|
+
export { BottomSheet } from './overlay/sheet/BottomSheet.js';
|
|
63
|
+
export type { BottomSheetProps } from './overlay/sheet/BottomSheet.js';
|
|
64
|
+
export { showToast, dismissToast } from './overlay/toast/toastStore.js';
|
|
65
|
+
export type { ToastOptions } from './overlay/toast/toastStore.js';
|
|
66
|
+
/** Position of a control within a button or tag group. */
|
|
67
|
+
export type { GroupPosition } from './components/shared/group.js';
|
|
68
|
+
/**
|
|
69
|
+
* Announce a status message to assistive tech. Exposed for consumers building
|
|
70
|
+
* their own status surfaces; `Alert` uses it internally.
|
|
71
|
+
*/
|
|
72
|
+
export { useLiveRegionAnnounce } from './a11y/useLiveRegion.js';
|
|
73
|
+
export { AlertV2Type as AlertType, AlertV2SubType as AlertSubType, AlertV2ActionPosition as AlertActionPosition, ButtonV2Type as ButtonType, ButtonV2Size as ButtonSize, ButtonV2SubType as ButtonSubType, ButtonV2State as ButtonState, InputSizeV2 as InputSize, InputStateV2 as InputState, TagV2Type as TagType, TagV2Size as TagSize, TagV2SubType as TagSubType, TagV2Color as TagColor, Theme, } from '@juspay/blend-design-system/node';
|
|
74
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,6BAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,8BAAqB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,2BAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAwB,CAAA;AAClD,YAAY,EACR,oBAAoB,EACpB,aAAa,GAChB,MAAM,iCAAwB,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAuB,CAAA;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAuB,CAAA;AAEhE,YAAY,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,gBAAgB,GACnB,MAAM,6BAAoB,CAAA;AAC3B,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAAqB,CAAA;AAC5D,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,2BAAkB,CAAA;AAG/D,OAAO,EACH,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,gCAA6B,CAAA;AACpC,YAAY,EACR,wBAAwB,EACxB,qBAAqB,GACxB,MAAM,gCAA6B,CAAA;AAEpC,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAqB,CAAA;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAqB,CAAA;AAC7D,YAAY,EACR,cAAc,EACd,kBAAkB,EAClB,sBAAsB,GACzB,MAAM,kBAAe,CAAA;AAEtB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAAyB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAA6B,CAAA;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gCAA6B,CAAA;AACnE,YAAY,EACR,eAAe,EACf,6BAA6B,GAChC,MAAM,gCAA6B,CAAA;AAIpC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAoB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAAwB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAmB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAmB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAAwB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAA6B,CAAA;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAA6B,CAAA;AAEtE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAoB,CAAA;AACpD,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAAwB,CAAA;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAA;AACvD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAmB,CAAA;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,2BAAwB,CAAA;AAG5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAAyB,CAAA;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,gCAA6B,CAAA;AAEzD;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA0B,CAAA;AAO3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAkB,CAAA;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAkB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA0B,CAAA;AAI1D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAA6B,CAAA;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,gCAA6B,CAAA;AAInE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAA4B,CAAA;AACpE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA4B,CAAA;AAE9D,0DAA0D;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA2B,CAAA;AAM9D;;;GAGG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAsB,CAAA;AAE5D,OAAO,EACH,WAAW,IAAI,SAAS,EACxB,cAAc,IAAI,YAAY,EAC9B,qBAAqB,IAAI,mBAAmB,EAC5C,YAAY,IAAI,UAAU,EAC1B,YAAY,IAAI,UAAU,EAC1B,eAAe,IAAI,aAAa,EAChC,aAAa,IAAI,WAAW,EAC5B,WAAW,IAAI,SAAS,EACxB,YAAY,IAAI,UAAU,EAC1B,SAAS,IAAI,OAAO,EACpB,SAAS,IAAI,OAAO,EACpB,YAAY,IAAI,UAAU,EAC1B,UAAU,IAAI,QAAQ,EACtB,KAAK,GACR,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion tokens and presets.
|
|
3
|
+
*
|
|
4
|
+
* Web Blend has no motion token layer — durations and curves are scattered
|
|
5
|
+
* inline (`transition: 'transform 0.15s ease-in-out'`, the MenuV2/ModalV2
|
|
6
|
+
* animation modules). Native centralises them here so every overlay and
|
|
7
|
+
* state change moves the same way.
|
|
8
|
+
*
|
|
9
|
+
* Pure data, deliberately independent of any animation library: consumers
|
|
10
|
+
* (the Reanimated-based overlay components) translate a preset into
|
|
11
|
+
* `withTiming`/`withSpring` calls. Keeping the descriptions library-free
|
|
12
|
+
* means this module stays vitest-testable and the animation dependency
|
|
13
|
+
* stays contained to the components that actually animate.
|
|
14
|
+
*/
|
|
15
|
+
/** Milliseconds. `fast` = state feedback, `normal` = overlays, `slow` = sheets. */
|
|
16
|
+
export declare const MOTION_DURATION: {
|
|
17
|
+
readonly fast: 150;
|
|
18
|
+
readonly normal: 250;
|
|
19
|
+
readonly slow: 400;
|
|
20
|
+
};
|
|
21
|
+
/** Cubic-bezier control points, CSS order `[x1, y1, x2, y2]`. */
|
|
22
|
+
export declare const MOTION_EASING: {
|
|
23
|
+
/** Both ends eased — in-place state changes. */
|
|
24
|
+
readonly standard: readonly [0.4, 0, 0.2, 1];
|
|
25
|
+
/** Fast start, soft landing — content entering the screen. */
|
|
26
|
+
readonly decelerate: readonly [0, 0, 0.2, 1];
|
|
27
|
+
/** Soft start, fast exit — content leaving the screen. */
|
|
28
|
+
readonly accelerate: readonly [0.4, 0, 1, 1];
|
|
29
|
+
};
|
|
30
|
+
export type MotionEasing = keyof typeof MOTION_EASING;
|
|
31
|
+
/** Transform/opacity state at one end of a transition. */
|
|
32
|
+
export type MotionFrame = {
|
|
33
|
+
opacity?: number;
|
|
34
|
+
scale?: number;
|
|
35
|
+
translateX?: number;
|
|
36
|
+
translateY?: number;
|
|
37
|
+
};
|
|
38
|
+
export type MotionPreset = {
|
|
39
|
+
from: MotionFrame;
|
|
40
|
+
to: MotionFrame;
|
|
41
|
+
duration: number;
|
|
42
|
+
easing: MotionEasing;
|
|
43
|
+
/** Exit timing — exits run faster than entrances by convention. */
|
|
44
|
+
exitDuration: number;
|
|
45
|
+
exitEasing: MotionEasing;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The presets the overlay components share.
|
|
49
|
+
*
|
|
50
|
+
* - `fade` — tooltips, backdrops.
|
|
51
|
+
* - `scaleFade` — menus, popovers, selects (anchored surfaces growing from
|
|
52
|
+
* their anchor).
|
|
53
|
+
* - `slideUp` — toasts and sheets entering from the bottom edge (the
|
|
54
|
+
* translate distance is a starting offset; sheets override it with their
|
|
55
|
+
* own measured height).
|
|
56
|
+
* - `slideDown` — banners entering from the top edge.
|
|
57
|
+
*/
|
|
58
|
+
export declare const MOTION_PRESETS: {
|
|
59
|
+
readonly fade: {
|
|
60
|
+
readonly from: {
|
|
61
|
+
readonly opacity: 0;
|
|
62
|
+
};
|
|
63
|
+
readonly to: {
|
|
64
|
+
readonly opacity: 1;
|
|
65
|
+
};
|
|
66
|
+
readonly duration: 150;
|
|
67
|
+
readonly easing: "decelerate";
|
|
68
|
+
readonly exitDuration: 150;
|
|
69
|
+
readonly exitEasing: "accelerate";
|
|
70
|
+
};
|
|
71
|
+
readonly scaleFade: {
|
|
72
|
+
readonly from: {
|
|
73
|
+
readonly opacity: 0;
|
|
74
|
+
readonly scale: 0.95;
|
|
75
|
+
};
|
|
76
|
+
readonly to: {
|
|
77
|
+
readonly opacity: 1;
|
|
78
|
+
readonly scale: 1;
|
|
79
|
+
};
|
|
80
|
+
readonly duration: 250;
|
|
81
|
+
readonly easing: "decelerate";
|
|
82
|
+
readonly exitDuration: 150;
|
|
83
|
+
readonly exitEasing: "accelerate";
|
|
84
|
+
};
|
|
85
|
+
readonly slideUp: {
|
|
86
|
+
readonly from: {
|
|
87
|
+
readonly opacity: 0;
|
|
88
|
+
readonly translateY: 16;
|
|
89
|
+
};
|
|
90
|
+
readonly to: {
|
|
91
|
+
readonly opacity: 1;
|
|
92
|
+
readonly translateY: 0;
|
|
93
|
+
};
|
|
94
|
+
readonly duration: 250;
|
|
95
|
+
readonly easing: "decelerate";
|
|
96
|
+
readonly exitDuration: 150;
|
|
97
|
+
readonly exitEasing: "accelerate";
|
|
98
|
+
};
|
|
99
|
+
readonly slideDown: {
|
|
100
|
+
readonly from: {
|
|
101
|
+
readonly opacity: 0;
|
|
102
|
+
readonly translateY: -16;
|
|
103
|
+
};
|
|
104
|
+
readonly to: {
|
|
105
|
+
readonly opacity: 1;
|
|
106
|
+
readonly translateY: 0;
|
|
107
|
+
};
|
|
108
|
+
readonly duration: 250;
|
|
109
|
+
readonly easing: "decelerate";
|
|
110
|
+
readonly exitDuration: 150;
|
|
111
|
+
readonly exitEasing: "accelerate";
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export type MotionPresetName = keyof typeof MOTION_PRESETS;
|
|
115
|
+
/**
|
|
116
|
+
* A preset with motion removed — what every animation collapses to when the
|
|
117
|
+
* user has OS reduce-motion enabled (see `useReduceMotion`): a fast opacity
|
|
118
|
+
* change, no movement, no scaling.
|
|
119
|
+
*/
|
|
120
|
+
export declare function reducedMotionVariant(preset: MotionPreset): MotionPreset;
|
|
121
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../../../src/motion/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,mFAAmF;AACnF,eAAO,MAAM,eAAe;;;;CAIlB,CAAA;AAEV,iEAAiE;AACjE,eAAO,MAAM,aAAa;IACtB,gDAAgD;;IAEhD,8DAA8D;;IAE9D,0DAA0D;;CAEpD,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAA;AAErD,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,WAAW,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,mEAAmE;IACnE,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCsB,CAAA;AAEjD,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,cAAc,CAAA;AAE1D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CASvE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the OS reduce-motion accessibility setting is on.
|
|
3
|
+
*
|
|
4
|
+
* The native counterpart of web's `prefers-reduced-motion` media query.
|
|
5
|
+
* Overlay components pair this with `reducedMotionVariant` so every
|
|
6
|
+
* animation collapses to a quick fade when the user asked for less motion.
|
|
7
|
+
*
|
|
8
|
+
* Starts `false` and corrects itself once the async platform query
|
|
9
|
+
* resolves — the safe default, since acting on it only ever *removes*
|
|
10
|
+
* motion. Subscribes to changes for the lifetime of the component.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useReduceMotion(): boolean;
|
|
13
|
+
export default useReduceMotion;
|
|
14
|
+
//# sourceMappingURL=useReduceMotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReduceMotion.d.ts","sourceRoot":"","sources":["../../../../src/motion/useReduceMotion.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAmBzC;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type PortalProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
/** Renders `children` into the provider's overlay layer. */
|
|
6
|
+
export declare function Portal({ children }: PortalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare namespace Portal {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Internal — wraps the app's children with the portal registry and renders
|
|
12
|
+
* the mounted layers after them. Used by `BlendNativeProvider`; not public.
|
|
13
|
+
*/
|
|
14
|
+
export declare function PortalArea({ children }: {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace PortalArea {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../src/overlay/portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAA;AAkCd,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAA;AAExD,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,kDA2B/C;yBA3Be,MAAM;;;AA+BtB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAuCtE;yBAvCe,UAAU"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchored-overlay positioning.
|
|
3
|
+
*
|
|
4
|
+
* The native replacement for what Radix/floating-ui do on web: place a
|
|
5
|
+
* floating box (menu, popover, tooltip, select list) against an anchor
|
|
6
|
+
* rect, flipping to the opposite side when space runs out and clamping
|
|
7
|
+
* into the viewport.
|
|
8
|
+
*
|
|
9
|
+
* Pure and RN-free — rects in, a position out — so the whole placement
|
|
10
|
+
* matrix is unit-testable under vitest. `useAnchoredPosition` layers the
|
|
11
|
+
* measurement plumbing on top.
|
|
12
|
+
*/
|
|
13
|
+
export type Rect = {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
export type Size = {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
/** Which side of the anchor the content prefers. */
|
|
24
|
+
export type Placement = 'top' | 'bottom' | 'left' | 'right';
|
|
25
|
+
/** Alignment along the anchor's other axis. */
|
|
26
|
+
export type Alignment = 'start' | 'center' | 'end';
|
|
27
|
+
export type AnchoredPositionInput = {
|
|
28
|
+
/** The anchor's rect in window coordinates (`measureInWindow`). */
|
|
29
|
+
anchor: Rect;
|
|
30
|
+
/** The floating content's measured size. */
|
|
31
|
+
content: Size;
|
|
32
|
+
/** The window size (`useWindowDimensions`). */
|
|
33
|
+
viewport: Size;
|
|
34
|
+
placement?: Placement;
|
|
35
|
+
alignment?: Alignment;
|
|
36
|
+
/** Gap between anchor and content, in points. */
|
|
37
|
+
offset?: number;
|
|
38
|
+
/** Minimum distance kept from every viewport edge, in points. */
|
|
39
|
+
viewportPadding?: number;
|
|
40
|
+
};
|
|
41
|
+
export type AnchoredPosition = {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
/** The placement actually used, after any flip. */
|
|
45
|
+
placement: Placement;
|
|
46
|
+
/**
|
|
47
|
+
* Space available for the content on the resolved side, after padding.
|
|
48
|
+
* Callers cap scrollable content (menus, select lists) with these so a
|
|
49
|
+
* long list scrolls instead of overflowing the screen.
|
|
50
|
+
*/
|
|
51
|
+
maxHeight: number;
|
|
52
|
+
maxWidth: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Compute where to place floating content against an anchor.
|
|
56
|
+
*
|
|
57
|
+
* - **Flip**: when the preferred side cannot fit the content but the
|
|
58
|
+
* opposite side can fit more of it, the placement flips.
|
|
59
|
+
* - **Clamp**: the cross-axis position shifts to keep the content inside
|
|
60
|
+
* the viewport padding (matching floating-ui's `shift`).
|
|
61
|
+
* - **Cap**: `maxHeight`/`maxWidth` report the space actually available on
|
|
62
|
+
* the resolved side, so scrollable content can cap itself.
|
|
63
|
+
*/
|
|
64
|
+
export declare function computeAnchoredPosition(input: AnchoredPositionInput): AnchoredPosition;
|
|
65
|
+
//# sourceMappingURL=positioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positioning.d.ts","sourceRoot":"","sources":["../../../../src/overlay/positioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAC1E,MAAM,MAAM,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD,oDAAoD;AACpD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAE3D,+CAA+C;AAC/C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAElD,MAAM,MAAM,qBAAqB,GAAG;IAChC,mEAAmE;IACnE,MAAM,EAAE,IAAI,CAAA;IACZ,4CAA4C;IAC5C,OAAO,EAAE,IAAI,CAAA;IACb,+CAA+C;IAC/C,QAAQ,EAAE,IAAI,CAAA;IACd,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,mDAAmD;IACnD,SAAS,EAAE,SAAS,CAAA;IACpB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAoCD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,qBAAqB,GAC7B,gBAAgB,CAkGlB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Optional `react-native-safe-area-context` integration, shared by every
|
|
4
|
+
* overlay that must respect the home indicator or notch (BottomSheet, the
|
|
5
|
+
* toast outlet).
|
|
6
|
+
*
|
|
7
|
+
* `useContext` needs *a* context unconditionally, so when the optional peer
|
|
8
|
+
* is absent — or its provider is not mounted — a null-valued fallback
|
|
9
|
+
* stands in and insets resolve to zero. Same probe pattern as
|
|
10
|
+
* expo-linear-gradient.
|
|
11
|
+
*/
|
|
12
|
+
export type EdgeInsets = {
|
|
13
|
+
top: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
left: number;
|
|
16
|
+
right: number;
|
|
17
|
+
};
|
|
18
|
+
export declare let SafeAreaInsetsContext: React.Context<EdgeInsets | null>;
|
|
19
|
+
//# sourceMappingURL=safeAreaInsets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeAreaInsets.d.ts","sourceRoot":"","sources":["../../../../src/overlay/safeAreaInsets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAE5C;;;;;;;;;GASG;AAEH,MAAM,MAAM,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAID,eAAO,IAAI,qBAAqB,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CACxC,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewStyle } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* BottomSheet — the gesture-driven sheet foundation.
|
|
5
|
+
*
|
|
6
|
+
* The native replacement for `vaul` and the phone presentation web already
|
|
7
|
+
* prescribes in its Mobile* variants (mobileModalV2, MobileSingleSelectV2,
|
|
8
|
+
* MobilePopoverV2): DrawerV2 and the phone modes of Select/Menu/Modal
|
|
9
|
+
* compose this primitive and pass their token values in — the sheet itself
|
|
10
|
+
* carries structure and physics, not design decisions, which is why its
|
|
11
|
+
* colour props have plain defaults instead of token lookups.
|
|
12
|
+
*
|
|
13
|
+
* Controlled: `open` drives it; every dismiss route (drag, backdrop, the
|
|
14
|
+
* Android back button) calls `onClose` and the owner flips `open` — the
|
|
15
|
+
* exit animation runs, then the sheet unmounts from the portal layer.
|
|
16
|
+
*
|
|
17
|
+
* Requirements: `react-native-reanimated` and `react-native-gesture-handler`
|
|
18
|
+
* (required peers), and a `GestureHandlerRootView` at the app root — apps
|
|
19
|
+
* using react-navigation already have one. `react-native-safe-area-context`
|
|
20
|
+
* is optional: with it (and its provider) mounted, the sheet pads itself
|
|
21
|
+
* past the home indicator; without it the bottom inset is 0.
|
|
22
|
+
*
|
|
23
|
+
* Reduce-motion: the slide collapses to a fade (`useReduceMotion`).
|
|
24
|
+
*/
|
|
25
|
+
export type BottomSheetProps = {
|
|
26
|
+
/** Whether the sheet is presented. */
|
|
27
|
+
open: boolean;
|
|
28
|
+
/** Called whenever the sheet asks to close; the owner flips `open`. */
|
|
29
|
+
onClose: () => void;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
/** Cap on sheet height as a fraction of the window. Default 0.9. */
|
|
32
|
+
maxHeightFraction?: number;
|
|
33
|
+
/** Backdrop fill. Defaults to 50% black. */
|
|
34
|
+
backdropColor?: string;
|
|
35
|
+
/** Sheet surface colour. Component layers pass their token value. */
|
|
36
|
+
backgroundColor?: string;
|
|
37
|
+
/** Radius of the two top corners. */
|
|
38
|
+
topRadius?: number;
|
|
39
|
+
/** Show the drag handle. Default true. */
|
|
40
|
+
showHandle?: boolean;
|
|
41
|
+
handleColor?: string;
|
|
42
|
+
/** Allow drag-down to dismiss. Default true. */
|
|
43
|
+
dragToDismiss?: boolean;
|
|
44
|
+
/** Dismiss when the backdrop is pressed. Default true. */
|
|
45
|
+
dismissOnBackdropPress?: boolean;
|
|
46
|
+
accessibilityLabel?: string;
|
|
47
|
+
testID?: string;
|
|
48
|
+
/** Style escape hatch for the sheet surface. */
|
|
49
|
+
style?: ViewStyle;
|
|
50
|
+
};
|
|
51
|
+
export declare function BottomSheet({ open, onClose, children, maxHeightFraction, backdropColor, backgroundColor, topRadius, showHandle, handleColor, dragToDismiss, dismissOnBackdropPress, accessibilityLabel, testID, style, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
52
|
+
export declare namespace BottomSheet {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
export default BottomSheet;
|
|
56
|
+
//# sourceMappingURL=BottomSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/overlay/sheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAC3E,OAAO,EAOH,KAAK,SAAS,EACjB,MAAM,cAAc,CAAA;AAqBrB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,sCAAsC;IACtC,IAAI,EAAE,OAAO,CAAA;IACb,uEAAuE;IACvE,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gDAAgD;IAChD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,0DAA0D;IAC1D,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAWD,wBAAgB,WAAW,CAAC,EACxB,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,iBAA6C,EAC7C,aAAoC,EACpC,eAA2B,EAC3B,SAAc,EACd,UAAiB,EACjB,WAAkC,EAClC,aAAoB,EACpB,sBAA6B,EAC7B,kBAAkB,EAClB,MAAM,EACN,KAAK,GACR,EAAE,gBAAgB,kDAqJlB;yBApKe,WAAW;;;AA0L3B,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bottom-sheet gesture arithmetic.
|
|
3
|
+
*
|
|
4
|
+
* Pure and RN-free (the `theme/breakpoint.ts` pattern) so the dismiss
|
|
5
|
+
* decision — the part of a sheet that feels wrong when it is wrong — is
|
|
6
|
+
* unit-testable under vitest. `BottomSheet` wires these into the pan
|
|
7
|
+
* gesture; they also run as Reanimated worklets, so nothing here may close
|
|
8
|
+
* over module state.
|
|
9
|
+
*/
|
|
10
|
+
/** Dragging past this fraction of the sheet's height dismisses on release. */
|
|
11
|
+
export declare const SHEET_DISMISS_FRACTION = 0.25;
|
|
12
|
+
/** A downward fling at or above this velocity (pt/s) dismisses regardless. */
|
|
13
|
+
export declare const SHEET_DISMISS_VELOCITY = 800;
|
|
14
|
+
/** Default cap: a sheet covers at most this fraction of the window. */
|
|
15
|
+
export declare const SHEET_MAX_HEIGHT_FRACTION = 0.9;
|
|
16
|
+
/**
|
|
17
|
+
* The sheet follows the finger downward only — upward drag is pinned so the
|
|
18
|
+
* sheet feels anchored rather than lifting off its resting position.
|
|
19
|
+
*/
|
|
20
|
+
export declare function clampSheetDrag(translationY: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a released drag should dismiss the sheet: past the distance
|
|
23
|
+
* threshold, or a genuine downward fling. An upward fling never dismisses,
|
|
24
|
+
* whatever distance was covered first.
|
|
25
|
+
*/
|
|
26
|
+
export declare function shouldDismissSheet(translationY: number, velocityY: number, sheetHeight: number): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The tallest a sheet may grow: the capped fraction of the window, minus
|
|
29
|
+
* whatever top inset (status bar / notch) must stay visible above it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSheetMaxHeight(windowHeight: number, topInset?: number, maxHeightFraction?: number): number;
|
|
32
|
+
//# sourceMappingURL=sheetMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheetMath.d.ts","sourceRoot":"","sources":["../../../../../src/overlay/sheet/sheetMath.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAE1C,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,MAAM,CAAA;AAEzC,uEAAuE;AACvE,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAE5C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAC9B,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACpB,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACjC,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE,MAAU,EACpB,iBAAiB,GAAE,MAAkC,GACtD,MAAM,CAGR"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toast rendering surface, mounted once by `BlendNativeProvider`.
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to the store and renders the newest `MAX_VISIBLE_TOASTS`
|
|
5
|
+
* bottom-stacked above everything through a `Portal`. Each toast slides up
|
|
6
|
+
* on entry (a fade under reduce-motion), owns its auto-dismiss timer, and
|
|
7
|
+
* announces itself to assistive tech when asked.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare namespace ToastOutlet {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
/** Exit duration is not modelled yet — dismissal unmounts immediately;
|
|
14
|
+
* SnackbarV2 will own richer exit choreography when it lands. Kept simple
|
|
15
|
+
* so the host stays predictable under the synchronous test mock. */
|
|
16
|
+
export declare const TOAST_EXIT_DURATION: 150;
|
|
17
|
+
//# sourceMappingURL=ToastOutlet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastOutlet.d.ts","sourceRoot":"","sources":["../../../../../src/overlay/toast/ToastOutlet.tsx"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,wBAAgB,WAAW,mDAuB1B;yBAvBe,WAAW;;;AA8E3B;;oEAEoE;AACpE,eAAO,MAAM,mBAAmB,KAAuB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Toast queue — the sonner role, minus the styling.
|
|
4
|
+
*
|
|
5
|
+
* A module-level store with an imperative `showToast`/`dismissToast` API,
|
|
6
|
+
* so any code (not just components) can raise a toast; the outlet the
|
|
7
|
+
* provider mounts subscribes and renders. SnackbarV2 will layer its token
|
|
8
|
+
* styling on top of this host; the host itself owns only queueing,
|
|
9
|
+
* stacking, timing, and announcements.
|
|
10
|
+
*
|
|
11
|
+
* RN-free (a `React.ReactNode` type is the only React surface) so queue
|
|
12
|
+
* semantics unit-test under vitest.
|
|
13
|
+
*/
|
|
14
|
+
export type ToastOptions = {
|
|
15
|
+
/** Reusing an id replaces that toast's content in place. */
|
|
16
|
+
id?: string;
|
|
17
|
+
/** The rendered toast; a function receives its own dismiss. */
|
|
18
|
+
content: React.ReactNode | ((dismiss: () => void) => React.ReactNode);
|
|
19
|
+
/** Auto-dismiss delay in ms; `null` keeps the toast until dismissed. */
|
|
20
|
+
duration?: number | null;
|
|
21
|
+
/** Spoken to assistive tech when the toast appears. */
|
|
22
|
+
announcement?: string;
|
|
23
|
+
};
|
|
24
|
+
export type ToastEntry = Required<Pick<ToastOptions, 'content'>> & {
|
|
25
|
+
id: string;
|
|
26
|
+
duration: number | null;
|
|
27
|
+
announcement?: string;
|
|
28
|
+
};
|
|
29
|
+
/** How many toasts render at once; older ones wait in the queue. */
|
|
30
|
+
export declare const MAX_VISIBLE_TOASTS = 3;
|
|
31
|
+
/** Default auto-dismiss delay, matching sonner's. */
|
|
32
|
+
export declare const DEFAULT_TOAST_DURATION = 4000;
|
|
33
|
+
type Listener = (toasts: readonly ToastEntry[]) => void;
|
|
34
|
+
/** Raise a toast; returns its id. */
|
|
35
|
+
export declare function showToast(options: ToastOptions): string;
|
|
36
|
+
/** Dismiss one toast, or every toast when no id is given. */
|
|
37
|
+
export declare function dismissToast(id?: string): void;
|
|
38
|
+
export declare function getToasts(): readonly ToastEntry[];
|
|
39
|
+
/** The slice the outlet renders: the newest MAX_VISIBLE. */
|
|
40
|
+
export declare function getVisibleToasts(all?: readonly ToastEntry[]): readonly ToastEntry[];
|
|
41
|
+
export declare function subscribeToasts(listener: Listener): () => void;
|
|
42
|
+
/** Test hook — clears the queue without notifying. */
|
|
43
|
+
export declare function resetToasts(): void;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=toastStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toastStore.d.ts","sourceRoot":"","sources":["../../../../../src/overlay/toast/toastStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,YAAY,GAAG;IACvB,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IACrE,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,GAAG;IAC/D,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAE1C,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,KAAK,IAAI,CAAA;AAUvD,qCAAqC;AACrC,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAkBvD;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAG9C;AAED,wBAAgB,SAAS,IAAI,SAAS,UAAU,EAAE,CAEjD;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAC5B,GAAG,GAAE,SAAS,UAAU,EAAW,GACpC,SAAS,UAAU,EAAE,CAEvB;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAG9D;AAED,sDAAsD;AACtD,wBAAgB,WAAW,IAAI,IAAI,CAGlC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type LayoutChangeEvent, type View } from 'react-native';
|
|
2
|
+
import { type Alignment, type AnchoredPosition, type Placement } from './positioning.js';
|
|
3
|
+
/**
|
|
4
|
+
* Measurement plumbing for `computeAnchoredPosition`.
|
|
5
|
+
*
|
|
6
|
+
* Wires the three inputs the pure engine needs: the anchor's window rect
|
|
7
|
+
* (`measureInWindow`, taken when the overlay opens), the floating content's
|
|
8
|
+
* size (its `onLayout`), and the window size (re-renders on rotation).
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const { anchorRef, measureAnchor, onContentLayout, position } =
|
|
12
|
+
* useAnchoredPosition({ placement: 'bottom' })
|
|
13
|
+
*
|
|
14
|
+
* <Pressable ref={anchorRef} onPress={() => { measureAnchor(); open() }} />
|
|
15
|
+
* <Portal>
|
|
16
|
+
* <View
|
|
17
|
+
* onLayout={onContentLayout}
|
|
18
|
+
* style={position && {
|
|
19
|
+
* position: 'absolute', left: position.x, top: position.y,
|
|
20
|
+
* maxHeight: position.maxHeight, opacity: 1,
|
|
21
|
+
* }}
|
|
22
|
+
* />
|
|
23
|
+
* </Portal>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* `position` is `null` until both measurements land — render the content
|
|
27
|
+
* transparent (not unmounted, or `onLayout` never fires) until then.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useAnchoredPosition(options?: {
|
|
30
|
+
placement?: Placement;
|
|
31
|
+
alignment?: Alignment;
|
|
32
|
+
offset?: number;
|
|
33
|
+
viewportPadding?: number;
|
|
34
|
+
}): {
|
|
35
|
+
anchorRef: import("react").RefObject<View | null>;
|
|
36
|
+
measureAnchor: () => void;
|
|
37
|
+
onContentLayout: (event: LayoutChangeEvent) => void;
|
|
38
|
+
position: AnchoredPosition | null;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useAnchoredPosition.d.ts.map
|