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,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Alert", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _index.Alert;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AlertActionPosition", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _node.AlertV2ActionPosition;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "AlertSubType", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _node.AlertV2SubType;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "AlertType", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _node.AlertV2Type;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "BlendNativeProvider", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _BlendNativeProvider.BlendNativeProvider;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "BlendNativeThemeContext", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _BlendNativeProvider.BlendNativeThemeContext;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "Block", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _Block.Block;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "BottomSheet", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _BottomSheet.BottomSheet;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "Button", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _index2.Button;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "ButtonSize", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _node.ButtonV2Size;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "ButtonState", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _node.ButtonV2State;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "ButtonSubType", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _node.ButtonV2SubType;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "ButtonType", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _node.ButtonV2Type;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "DEFAULT_NATIVE_THEME", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _BlendNativeProvider.DEFAULT_NATIVE_THEME;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "InputSize", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _node.InputSizeV2;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "InputState", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _node.InputStateV2;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "MIN_TOUCH_TARGET", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _touchTarget.MIN_TOUCH_TARGET;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "Portal", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _portal.Portal;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "Pressable", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _Pressable.Pressable;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "PrimitiveInput", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _PrimitiveInput.PrimitiveInput;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "SYSTEM_THEME", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _systemTheme.SYSTEM_THEME;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "Separator", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _Separator.Separator;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "Skeleton", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _index5.Skeleton;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "Slot", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _Slot.Slot;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "Tag", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _index3.Tag;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "TagColor", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _node.TagV2Color;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "TagSize", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _node.TagV2Size;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "TagSubType", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _node.TagV2SubType;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "TagType", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _node.TagV2Type;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "Text", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _Text.Text;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "TextInput", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _index4.TextInput;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "Theme", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _node.Theme;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "dismissToast", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _toastStore.dismissToast;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "showToast", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _toastStore.showToast;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "useLiveRegionAnnounce", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _useLiveRegion.useLiveRegionAnnounce;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "useNativeBreakpoint", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _useNativeBreakpoint.useNativeBreakpoint;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "useNativeTokens", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _useNativeTokens.useNativeTokens;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "useReduceMotion", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _useReduceMotion.useReduceMotion;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
var _index = require("./components/Alert/index.js");
|
|
235
|
+
var _index2 = require("./components/Button/index.js");
|
|
236
|
+
var _index3 = require("./components/Tag/index.js");
|
|
237
|
+
var _index4 = require("./components/TextInput/index.js");
|
|
238
|
+
var _index5 = require("./components/Skeleton/index.js");
|
|
239
|
+
var _BlendNativeProvider = require("./theme/BlendNativeProvider.js");
|
|
240
|
+
var _systemTheme = require("./theme/systemTheme.js");
|
|
241
|
+
var _useNativeTokens = require("./theme/useNativeTokens.js");
|
|
242
|
+
var _useNativeBreakpoint = require("./theme/useNativeBreakpoint.js");
|
|
243
|
+
var _Block = require("./primitives/Block.js");
|
|
244
|
+
var _Pressable = require("./primitives/Pressable.js");
|
|
245
|
+
var _Text = require("./primitives/Text.js");
|
|
246
|
+
var _Slot = require("./primitives/Slot.js");
|
|
247
|
+
var _Separator = require("./primitives/Separator.js");
|
|
248
|
+
var _PrimitiveInput = require("./primitives/PrimitiveInput.js");
|
|
249
|
+
var _touchTarget = require("./primitives/touchTarget.js");
|
|
250
|
+
var _portal = require("./overlay/portal.js");
|
|
251
|
+
var _useReduceMotion = require("./motion/useReduceMotion.js");
|
|
252
|
+
var _BottomSheet = require("./overlay/sheet/BottomSheet.js");
|
|
253
|
+
var _toastStore = require("./overlay/toast/toastStore.js");
|
|
254
|
+
var _useLiveRegion = require("./a11y/useLiveRegion.js");
|
|
255
|
+
var _node = require("@juspay/blend-design-system/node");
|
|
256
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","_index2","_index3","_index4","_index5","_BlendNativeProvider","_systemTheme","_useNativeTokens","_useNativeBreakpoint","_Block","_Pressable","_Text","_Slot","_Separator","_PrimitiveInput","_touchTarget","_portal","_useReduceMotion","_BottomSheet","_toastStore","_useLiveRegion","_node"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,OAAA,GAAAJ,OAAA;AAcA,IAAAK,oBAAA,GAAAL,OAAA;AAWA,IAAAM,YAAA,GAAAN,OAAA;AAQA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AASA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AAkBA,IAAAe,YAAA,GAAAf,OAAA;AAOA,IAAAgB,OAAA,GAAAhB,OAAA;AAEA,IAAAiB,gBAAA,GAAAjB,OAAA;AAIA,IAAAkB,YAAA,GAAAlB,OAAA;AAKA,IAAAmB,WAAA,GAAAnB,OAAA;AAcA,IAAAoB,cAAA,GAAApB,OAAA;AAEA,IAAAqB,KAAA,GAAArB,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MOTION_PRESETS = exports.MOTION_EASING = exports.MOTION_DURATION = void 0;
|
|
7
|
+
exports.reducedMotionVariant = reducedMotionVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Motion tokens and presets.
|
|
10
|
+
*
|
|
11
|
+
* Web Blend has no motion token layer — durations and curves are scattered
|
|
12
|
+
* inline (`transition: 'transform 0.15s ease-in-out'`, the MenuV2/ModalV2
|
|
13
|
+
* animation modules). Native centralises them here so every overlay and
|
|
14
|
+
* state change moves the same way.
|
|
15
|
+
*
|
|
16
|
+
* Pure data, deliberately independent of any animation library: consumers
|
|
17
|
+
* (the Reanimated-based overlay components) translate a preset into
|
|
18
|
+
* `withTiming`/`withSpring` calls. Keeping the descriptions library-free
|
|
19
|
+
* means this module stays vitest-testable and the animation dependency
|
|
20
|
+
* stays contained to the components that actually animate.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Milliseconds. `fast` = state feedback, `normal` = overlays, `slow` = sheets. */
|
|
24
|
+
const MOTION_DURATION = exports.MOTION_DURATION = {
|
|
25
|
+
fast: 150,
|
|
26
|
+
normal: 250,
|
|
27
|
+
slow: 400
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** Cubic-bezier control points, CSS order `[x1, y1, x2, y2]`. */
|
|
31
|
+
const MOTION_EASING = exports.MOTION_EASING = {
|
|
32
|
+
/** Both ends eased — in-place state changes. */
|
|
33
|
+
standard: [0.4, 0, 0.2, 1],
|
|
34
|
+
/** Fast start, soft landing — content entering the screen. */
|
|
35
|
+
decelerate: [0, 0, 0.2, 1],
|
|
36
|
+
/** Soft start, fast exit — content leaving the screen. */
|
|
37
|
+
accelerate: [0.4, 0, 1, 1]
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Transform/opacity state at one end of a transition. */
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The presets the overlay components share.
|
|
44
|
+
*
|
|
45
|
+
* - `fade` — tooltips, backdrops.
|
|
46
|
+
* - `scaleFade` — menus, popovers, selects (anchored surfaces growing from
|
|
47
|
+
* their anchor).
|
|
48
|
+
* - `slideUp` — toasts and sheets entering from the bottom edge (the
|
|
49
|
+
* translate distance is a starting offset; sheets override it with their
|
|
50
|
+
* own measured height).
|
|
51
|
+
* - `slideDown` — banners entering from the top edge.
|
|
52
|
+
*/
|
|
53
|
+
const MOTION_PRESETS = exports.MOTION_PRESETS = {
|
|
54
|
+
fade: {
|
|
55
|
+
from: {
|
|
56
|
+
opacity: 0
|
|
57
|
+
},
|
|
58
|
+
to: {
|
|
59
|
+
opacity: 1
|
|
60
|
+
},
|
|
61
|
+
duration: MOTION_DURATION.fast,
|
|
62
|
+
easing: 'decelerate',
|
|
63
|
+
exitDuration: MOTION_DURATION.fast,
|
|
64
|
+
exitEasing: 'accelerate'
|
|
65
|
+
},
|
|
66
|
+
scaleFade: {
|
|
67
|
+
from: {
|
|
68
|
+
opacity: 0,
|
|
69
|
+
scale: 0.95
|
|
70
|
+
},
|
|
71
|
+
to: {
|
|
72
|
+
opacity: 1,
|
|
73
|
+
scale: 1
|
|
74
|
+
},
|
|
75
|
+
duration: MOTION_DURATION.normal,
|
|
76
|
+
easing: 'decelerate',
|
|
77
|
+
exitDuration: MOTION_DURATION.fast,
|
|
78
|
+
exitEasing: 'accelerate'
|
|
79
|
+
},
|
|
80
|
+
slideUp: {
|
|
81
|
+
from: {
|
|
82
|
+
opacity: 0,
|
|
83
|
+
translateY: 16
|
|
84
|
+
},
|
|
85
|
+
to: {
|
|
86
|
+
opacity: 1,
|
|
87
|
+
translateY: 0
|
|
88
|
+
},
|
|
89
|
+
duration: MOTION_DURATION.normal,
|
|
90
|
+
easing: 'decelerate',
|
|
91
|
+
exitDuration: MOTION_DURATION.fast,
|
|
92
|
+
exitEasing: 'accelerate'
|
|
93
|
+
},
|
|
94
|
+
slideDown: {
|
|
95
|
+
from: {
|
|
96
|
+
opacity: 0,
|
|
97
|
+
translateY: -16
|
|
98
|
+
},
|
|
99
|
+
to: {
|
|
100
|
+
opacity: 1,
|
|
101
|
+
translateY: 0
|
|
102
|
+
},
|
|
103
|
+
duration: MOTION_DURATION.normal,
|
|
104
|
+
easing: 'decelerate',
|
|
105
|
+
exitDuration: MOTION_DURATION.fast,
|
|
106
|
+
exitEasing: 'accelerate'
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* A preset with motion removed — what every animation collapses to when the
|
|
111
|
+
* user has OS reduce-motion enabled (see `useReduceMotion`): a fast opacity
|
|
112
|
+
* change, no movement, no scaling.
|
|
113
|
+
*/
|
|
114
|
+
function reducedMotionVariant(preset) {
|
|
115
|
+
return {
|
|
116
|
+
from: {
|
|
117
|
+
opacity: preset.from.opacity ?? 0
|
|
118
|
+
},
|
|
119
|
+
to: {
|
|
120
|
+
opacity: preset.to.opacity ?? 1
|
|
121
|
+
},
|
|
122
|
+
duration: MOTION_DURATION.fast,
|
|
123
|
+
easing: 'standard',
|
|
124
|
+
exitDuration: MOTION_DURATION.fast,
|
|
125
|
+
exitEasing: 'standard'
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MOTION_DURATION","exports","fast","normal","slow","MOTION_EASING","standard","decelerate","accelerate","MOTION_PRESETS","fade","from","opacity","to","duration","easing","exitDuration","exitEasing","scaleFade","scale","slideUp","translateY","slideDown","reducedMotionVariant","preset"],"sourceRoot":"../../../src","sources":["motion/motion.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC3BE,IAAI,EAAE,GAAG;EACTC,MAAM,EAAE,GAAG;EACXC,IAAI,EAAE;AACV,CAAU;;AAEV;AACO,MAAMC,aAAa,GAAAJ,OAAA,CAAAI,aAAA,GAAG;EACzB;EACAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;EAC1B;EACAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;EAC1B;EACAC,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7B,CAAU;;AAIV;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,GAAAR,OAAA,CAAAQ,cAAA,GAAG;EAC1BC,IAAI,EAAE;IACFC,IAAI,EAAE;MAAEC,OAAO,EAAE;IAAE,CAAC;IACpBC,EAAE,EAAE;MAAED,OAAO,EAAE;IAAE,CAAC;IAClBE,QAAQ,EAAEd,eAAe,CAACE,IAAI;IAC9Ba,MAAM,EAAE,YAAY;IACpBC,YAAY,EAAEhB,eAAe,CAACE,IAAI;IAClCe,UAAU,EAAE;EAChB,CAAC;EACDC,SAAS,EAAE;IACPP,IAAI,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAEO,KAAK,EAAE;IAAK,CAAC;IACjCN,EAAE,EAAE;MAAED,OAAO,EAAE,CAAC;MAAEO,KAAK,EAAE;IAAE,CAAC;IAC5BL,QAAQ,EAAEd,eAAe,CAACG,MAAM;IAChCY,MAAM,EAAE,YAAY;IACpBC,YAAY,EAAEhB,eAAe,CAACE,IAAI;IAClCe,UAAU,EAAE;EAChB,CAAC;EACDG,OAAO,EAAE;IACLT,IAAI,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAES,UAAU,EAAE;IAAG,CAAC;IACpCR,EAAE,EAAE;MAAED,OAAO,EAAE,CAAC;MAAES,UAAU,EAAE;IAAE,CAAC;IACjCP,QAAQ,EAAEd,eAAe,CAACG,MAAM;IAChCY,MAAM,EAAE,YAAY;IACpBC,YAAY,EAAEhB,eAAe,CAACE,IAAI;IAClCe,UAAU,EAAE;EAChB,CAAC;EACDK,SAAS,EAAE;IACPX,IAAI,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAES,UAAU,EAAE,CAAC;IAAG,CAAC;IACrCR,EAAE,EAAE;MAAED,OAAO,EAAE,CAAC;MAAES,UAAU,EAAE;IAAE,CAAC;IACjCP,QAAQ,EAAEd,eAAe,CAACG,MAAM;IAChCY,MAAM,EAAE,YAAY;IACpBC,YAAY,EAAEhB,eAAe,CAACE,IAAI;IAClCe,UAAU,EAAE;EAChB;AACJ,CAAiD;AAIjD;AACA;AACA;AACA;AACA;AACO,SAASM,oBAAoBA,CAACC,MAAoB,EAAgB;EACrE,OAAO;IACHb,IAAI,EAAE;MAAEC,OAAO,EAAEY,MAAM,CAACb,IAAI,CAACC,OAAO,IAAI;IAAE,CAAC;IAC3CC,EAAE,EAAE;MAAED,OAAO,EAAEY,MAAM,CAACX,EAAE,CAACD,OAAO,IAAI;IAAE,CAAC;IACvCE,QAAQ,EAAEd,eAAe,CAACE,IAAI;IAC9Ba,MAAM,EAAE,UAAU;IAClBC,YAAY,EAAEhB,eAAe,CAACE,IAAI;IAClCe,UAAU,EAAE;EAChB,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.useReduceMotion = useReduceMotion;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
/**
|
|
11
|
+
* Whether the OS reduce-motion accessibility setting is on.
|
|
12
|
+
*
|
|
13
|
+
* The native counterpart of web's `prefers-reduced-motion` media query.
|
|
14
|
+
* Overlay components pair this with `reducedMotionVariant` so every
|
|
15
|
+
* animation collapses to a quick fade when the user asked for less motion.
|
|
16
|
+
*
|
|
17
|
+
* Starts `false` and corrects itself once the async platform query
|
|
18
|
+
* resolves — the safe default, since acting on it only ever *removes*
|
|
19
|
+
* motion. Subscribes to changes for the lifetime of the component.
|
|
20
|
+
*/
|
|
21
|
+
function useReduceMotion() {
|
|
22
|
+
const [reduceMotion, setReduceMotion] = (0, _react.useState)(false);
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
let mounted = true;
|
|
25
|
+
_reactNative.AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
|
|
26
|
+
if (mounted) setReduceMotion(enabled);
|
|
27
|
+
});
|
|
28
|
+
const subscription = _reactNative.AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotion);
|
|
29
|
+
return () => {
|
|
30
|
+
mounted = false;
|
|
31
|
+
subscription.remove();
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
return reduceMotion;
|
|
35
|
+
}
|
|
36
|
+
var _default = exports.default = useReduceMotion;
|
|
37
|
+
//# sourceMappingURL=useReduceMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","useReduceMotion","reduceMotion","setReduceMotion","useState","useEffect","mounted","AccessibilityInfo","isReduceMotionEnabled","then","enabled","subscription","addEventListener","remove","_default","exports","default"],"sourceRoot":"../../../src","sources":["motion/useReduceMotion.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAAA,EAAY;EACvC,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEvD,IAAAC,gBAAS,EAAC,MAAM;IACZ,IAAIC,OAAO,GAAG,IAAI;IAClBC,8BAAiB,CAACC,qBAAqB,CAAC,CAAC,CAACC,IAAI,CAAEC,OAAO,IAAK;MACxD,IAAIJ,OAAO,EAAEH,eAAe,CAACO,OAAO,CAAC;IACzC,CAAC,CAAC;IACF,MAAMC,YAAY,GAAGJ,8BAAiB,CAACK,gBAAgB,CACnD,qBAAqB,EACrBT,eACJ,CAAC;IACD,OAAO,MAAM;MACTG,OAAO,GAAG,KAAK;MACfK,YAAY,CAACE,MAAM,CAAC,CAAC;IACzB,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOX,YAAY;AACvB;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcf,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Portal = Portal;
|
|
7
|
+
exports.PortalArea = PortalArea;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* Portal — layered rendering above the app's content.
|
|
14
|
+
*
|
|
15
|
+
* The native replacement for web's `createPortal`/Radix `Portal`: overlay
|
|
16
|
+
* components (modal, menu, popover, tooltip, snackbar) mount their surface
|
|
17
|
+
* through `<Portal>` and it renders in an absolute-fill layer that
|
|
18
|
+
* `BlendNativeProvider` places *after* the app's children, so it paints on
|
|
19
|
+
* top regardless of where in the tree the overlay was opened.
|
|
20
|
+
*
|
|
21
|
+
* Layers stack in mount order — the overlay opened last paints on top,
|
|
22
|
+
* which matches how web portals appended to `document.body` behave.
|
|
23
|
+
*
|
|
24
|
+
* The provider must sit at a screen-filling root (the usual place for a
|
|
25
|
+
* theme provider): the layers are absolutely positioned siblings of the
|
|
26
|
+
* app's children, so they cover exactly what the provider's parent covers.
|
|
27
|
+
*
|
|
28
|
+
* With no provider mounted, `<Portal>` renders its children in place — an
|
|
29
|
+
* overlay degrades to inline rendering rather than disappearing.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const PortalRegistryContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
33
|
+
let warnedNoProvider = false;
|
|
34
|
+
/** Renders `children` into the provider's overlay layer. */
|
|
35
|
+
function Portal({
|
|
36
|
+
children
|
|
37
|
+
}) {
|
|
38
|
+
const registry = (0, _react.useContext)(PortalRegistryContext);
|
|
39
|
+
const key = (0, _react.useId)();
|
|
40
|
+
(0, _react.useEffect)(() => {
|
|
41
|
+
if (!registry) return;
|
|
42
|
+
registry.mount(key, children);
|
|
43
|
+
return () => registry.unmount(key);
|
|
44
|
+
}, [registry, key, children]);
|
|
45
|
+
|
|
46
|
+
// In an effect, not during render — warning inline would be a
|
|
47
|
+
// render-phase side effect (breaks under StrictMode double-render, the
|
|
48
|
+
// same class of bug Pressable's parse memoisation fixed).
|
|
49
|
+
(0, _react.useEffect)(() => {
|
|
50
|
+
if (registry || warnedNoProvider) return;
|
|
51
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
52
|
+
warnedNoProvider = true;
|
|
53
|
+
console.warn('[blend-native] <Portal> used without BlendNativeProvider — ' + 'rendering inline. Overlays will not layer above the app.');
|
|
54
|
+
}
|
|
55
|
+
}, [registry]);
|
|
56
|
+
if (!registry) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
57
|
+
children: children
|
|
58
|
+
});
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
Portal.displayName = 'Portal';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Internal — wraps the app's children with the portal registry and renders
|
|
65
|
+
* the mounted layers after them. Used by `BlendNativeProvider`; not public.
|
|
66
|
+
*/
|
|
67
|
+
function PortalArea({
|
|
68
|
+
children
|
|
69
|
+
}) {
|
|
70
|
+
const [portals, setPortals] = (0, _react.useState)([]);
|
|
71
|
+
const mount = (0, _react.useCallback)((key, node) => {
|
|
72
|
+
setPortals(current => {
|
|
73
|
+
const existing = current.findIndex(p => p.key === key);
|
|
74
|
+
if (existing === -1) return [...current, {
|
|
75
|
+
key,
|
|
76
|
+
node
|
|
77
|
+
}];
|
|
78
|
+
// Re-mount with new content keeps its layer position.
|
|
79
|
+
const next = current.slice();
|
|
80
|
+
next[existing] = {
|
|
81
|
+
key,
|
|
82
|
+
node
|
|
83
|
+
};
|
|
84
|
+
return next;
|
|
85
|
+
});
|
|
86
|
+
}, []);
|
|
87
|
+
const unmount = (0, _react.useCallback)(key => {
|
|
88
|
+
setPortals(current => current.filter(p => p.key !== key));
|
|
89
|
+
}, []);
|
|
90
|
+
const registry = (0, _react.useMemo)(() => ({
|
|
91
|
+
mount,
|
|
92
|
+
unmount
|
|
93
|
+
}), [mount, unmount]);
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PortalRegistryContext.Provider, {
|
|
95
|
+
value: registry,
|
|
96
|
+
children: [children, portals.map(({
|
|
97
|
+
key,
|
|
98
|
+
node
|
|
99
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
100
|
+
style: _reactNative.StyleSheet.absoluteFill
|
|
101
|
+
// Touches fall through empty layer area to the app;
|
|
102
|
+
// the overlay's own views still receive theirs.
|
|
103
|
+
,
|
|
104
|
+
pointerEvents: "box-none",
|
|
105
|
+
children: node
|
|
106
|
+
}, key))]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
PortalArea.displayName = 'PortalArea';
|
|
110
|
+
//# sourceMappingURL=portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PortalRegistryContext","createContext","warnedNoProvider","Portal","children","registry","useContext","key","useId","useEffect","mount","unmount","__DEV__","console","warn","jsx","Fragment","displayName","PortalArea","portals","setPortals","useState","useCallback","node","current","existing","findIndex","p","next","slice","filter","useMemo","jsxs","Provider","value","map","View","style","StyleSheet","absoluteFill","pointerEvents"],"sourceRoot":"../../../src","sources":["overlay/portal.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.computeAnchoredPosition = computeAnchoredPosition;
|
|
7
|
+
/**
|
|
8
|
+
* Anchored-overlay positioning.
|
|
9
|
+
*
|
|
10
|
+
* The native replacement for what Radix/floating-ui do on web: place a
|
|
11
|
+
* floating box (menu, popover, tooltip, select list) against an anchor
|
|
12
|
+
* rect, flipping to the opposite side when space runs out and clamping
|
|
13
|
+
* into the viewport.
|
|
14
|
+
*
|
|
15
|
+
* Pure and RN-free — rects in, a position out — so the whole placement
|
|
16
|
+
* matrix is unit-testable under vitest. `useAnchoredPosition` layers the
|
|
17
|
+
* measurement plumbing on top.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** Which side of the anchor the content prefers. */
|
|
21
|
+
|
|
22
|
+
/** Alignment along the anchor's other axis. */
|
|
23
|
+
|
|
24
|
+
const opposite = {
|
|
25
|
+
top: 'bottom',
|
|
26
|
+
bottom: 'top',
|
|
27
|
+
left: 'right',
|
|
28
|
+
right: 'left'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** Space between the anchor and the viewport edge on one side. */
|
|
32
|
+
function spaceOn(side, anchor, viewport, offset, padding) {
|
|
33
|
+
switch (side) {
|
|
34
|
+
case 'top':
|
|
35
|
+
return anchor.y - offset - padding;
|
|
36
|
+
case 'bottom':
|
|
37
|
+
return viewport.height - (anchor.y + anchor.height) - offset - padding;
|
|
38
|
+
case 'left':
|
|
39
|
+
return anchor.x - offset - padding;
|
|
40
|
+
case 'right':
|
|
41
|
+
return viewport.width - (anchor.x + anchor.width) - offset - padding;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const clamp = (value, min, max) =>
|
|
45
|
+
// A viewport smaller than the padding produces min > max; the lower
|
|
46
|
+
// bound wins so content pins to the leading edge instead of NaN-ing.
|
|
47
|
+
Math.max(min, Math.min(value, Math.max(min, max)));
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Compute where to place floating content against an anchor.
|
|
51
|
+
*
|
|
52
|
+
* - **Flip**: when the preferred side cannot fit the content but the
|
|
53
|
+
* opposite side can fit more of it, the placement flips.
|
|
54
|
+
* - **Clamp**: the cross-axis position shifts to keep the content inside
|
|
55
|
+
* the viewport padding (matching floating-ui's `shift`).
|
|
56
|
+
* - **Cap**: `maxHeight`/`maxWidth` report the space actually available on
|
|
57
|
+
* the resolved side, so scrollable content can cap itself.
|
|
58
|
+
*/
|
|
59
|
+
function computeAnchoredPosition(input) {
|
|
60
|
+
const {
|
|
61
|
+
anchor,
|
|
62
|
+
content,
|
|
63
|
+
viewport,
|
|
64
|
+
placement: preferred = 'bottom',
|
|
65
|
+
alignment = 'start',
|
|
66
|
+
offset = 8,
|
|
67
|
+
viewportPadding = 8
|
|
68
|
+
} = input;
|
|
69
|
+
const preferredSpace = spaceOn(preferred, anchor, viewport, offset, viewportPadding);
|
|
70
|
+
const isVertical = preferred === 'top' || preferred === 'bottom';
|
|
71
|
+
const needed = isVertical ? content.height : content.width;
|
|
72
|
+
let placement = preferred;
|
|
73
|
+
if (needed > preferredSpace) {
|
|
74
|
+
const other = spaceOn(opposite[preferred], anchor, viewport, offset, viewportPadding);
|
|
75
|
+
if (other > preferredSpace) placement = opposite[preferred];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ---- Main axis ------------------------------------------------------
|
|
79
|
+
let x = 0;
|
|
80
|
+
let y = 0;
|
|
81
|
+
switch (placement) {
|
|
82
|
+
case 'top':
|
|
83
|
+
y = anchor.y - offset - content.height;
|
|
84
|
+
break;
|
|
85
|
+
case 'bottom':
|
|
86
|
+
y = anchor.y + anchor.height + offset;
|
|
87
|
+
break;
|
|
88
|
+
case 'left':
|
|
89
|
+
x = anchor.x - offset - content.width;
|
|
90
|
+
break;
|
|
91
|
+
case 'right':
|
|
92
|
+
x = anchor.x + anchor.width + offset;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ---- Cross axis -----------------------------------------------------
|
|
97
|
+
const alignAlong = (anchorStart, anchorLength, contentLength) => {
|
|
98
|
+
if (alignment === 'start') return anchorStart;
|
|
99
|
+
if (alignment === 'end') return anchorStart + anchorLength - contentLength;
|
|
100
|
+
return anchorStart + (anchorLength - contentLength) / 2;
|
|
101
|
+
};
|
|
102
|
+
if (placement === 'top' || placement === 'bottom') {
|
|
103
|
+
x = alignAlong(anchor.x, anchor.width, content.width);
|
|
104
|
+
} else {
|
|
105
|
+
y = alignAlong(anchor.y, anchor.height, content.height);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ---- Keep inside the viewport ---------------------------------------
|
|
109
|
+
x = clamp(x, viewportPadding, viewport.width - viewportPadding - content.width);
|
|
110
|
+
y = clamp(y, viewportPadding, viewport.height - viewportPadding - content.height);
|
|
111
|
+
const available = spaceOn(placement, anchor, viewport, offset, viewportPadding);
|
|
112
|
+
const maxHeight = placement === 'top' || placement === 'bottom' ? Math.max(0, available) : Math.max(0, viewport.height - 2 * viewportPadding);
|
|
113
|
+
const maxWidth = placement === 'left' || placement === 'right' ? Math.max(0, available) : Math.max(0, viewport.width - 2 * viewportPadding);
|
|
114
|
+
return {
|
|
115
|
+
x,
|
|
116
|
+
y,
|
|
117
|
+
placement,
|
|
118
|
+
maxHeight,
|
|
119
|
+
maxWidth
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=positioning.js.map
|