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,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Block = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _surfaceStyle = require("../adapters/surfaceStyle.js");
|
|
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
|
+
* Native `Block` — a `View` driven by token-shaped style props.
|
|
14
|
+
*
|
|
15
|
+
* Style resolution is delegated to `resolveSurfaceStyle`, the same function
|
|
16
|
+
* `Pressable` uses, so a component that swaps between the two depending on
|
|
17
|
+
* whether it is interactive (web's `TagElement = onClick ? PrimitiveButton :
|
|
18
|
+
* Block` pattern) renders identically in both branches. Before that was
|
|
19
|
+
* shared, `Block` could not render a border, radius, shadow, or height at
|
|
20
|
+
* all.
|
|
21
|
+
*
|
|
22
|
+
* Note there is **no `color` prop**. On web, `Block`'s `color` maps to CSS
|
|
23
|
+
* `color` — a foreground value that SVG icons inherit via `currentColor`.
|
|
24
|
+
* RN has no such inheritance, and mapping `color` to `backgroundColor` (as
|
|
25
|
+
* this file previously did) silently inverted the meaning of every call
|
|
26
|
+
* copied over from web. Use `backgroundColor` for a background, and `Slot`
|
|
27
|
+
* for tinting icons.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const BlockImpl = /*#__PURE__*/(0, _react.forwardRef)(function Block({
|
|
31
|
+
children,
|
|
32
|
+
style,
|
|
33
|
+
...rest
|
|
34
|
+
}, ref) {
|
|
35
|
+
// Split token-shaped style props from pass-through RN View props.
|
|
36
|
+
const {
|
|
37
|
+
background,
|
|
38
|
+
backgroundColor,
|
|
39
|
+
border,
|
|
40
|
+
borderRadius,
|
|
41
|
+
boxShadow,
|
|
42
|
+
paddingTop,
|
|
43
|
+
paddingRight,
|
|
44
|
+
paddingBottom,
|
|
45
|
+
paddingLeft,
|
|
46
|
+
width,
|
|
47
|
+
minWidth,
|
|
48
|
+
maxWidth,
|
|
49
|
+
height,
|
|
50
|
+
minHeight,
|
|
51
|
+
maxHeight,
|
|
52
|
+
flexDirection,
|
|
53
|
+
alignItems,
|
|
54
|
+
justifyContent,
|
|
55
|
+
alignSelf,
|
|
56
|
+
gap,
|
|
57
|
+
flexShrink,
|
|
58
|
+
flexGrow,
|
|
59
|
+
opacity,
|
|
60
|
+
overflow,
|
|
61
|
+
...viewProps
|
|
62
|
+
} = rest;
|
|
63
|
+
const resolved = (0, _surfaceStyle.resolveSurfaceStyle)({
|
|
64
|
+
background,
|
|
65
|
+
backgroundColor,
|
|
66
|
+
border,
|
|
67
|
+
borderRadius,
|
|
68
|
+
boxShadow,
|
|
69
|
+
paddingTop,
|
|
70
|
+
paddingRight,
|
|
71
|
+
paddingBottom,
|
|
72
|
+
paddingLeft,
|
|
73
|
+
width,
|
|
74
|
+
minWidth,
|
|
75
|
+
maxWidth,
|
|
76
|
+
height,
|
|
77
|
+
minHeight,
|
|
78
|
+
maxHeight,
|
|
79
|
+
flexDirection,
|
|
80
|
+
alignItems,
|
|
81
|
+
justifyContent,
|
|
82
|
+
alignSelf,
|
|
83
|
+
gap,
|
|
84
|
+
flexShrink,
|
|
85
|
+
flexGrow,
|
|
86
|
+
opacity,
|
|
87
|
+
overflow
|
|
88
|
+
}, _reactNative.Platform.OS);
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
90
|
+
ref: ref,
|
|
91
|
+
style: _reactNative.StyleSheet.flatten([baseStyle.view, resolved, style]),
|
|
92
|
+
...viewProps,
|
|
93
|
+
children: children
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Memoised because primitives sit at the leaves of every component tree: a
|
|
99
|
+
* parent re-render should not walk the whole subtree when none of the
|
|
100
|
+
* token-derived props changed.
|
|
101
|
+
*/
|
|
102
|
+
const Block = exports.Block = /*#__PURE__*/(0, _react.memo)(BlockImpl);
|
|
103
|
+
Block.displayName = 'Block';
|
|
104
|
+
const baseStyle = _reactNative.StyleSheet.create({
|
|
105
|
+
view: {
|
|
106
|
+
// RN Views are already flex containers; declaring it keeps parity
|
|
107
|
+
// with web `Block`, which is `display: flex`.
|
|
108
|
+
display: 'flex'
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
var _default = exports.default = Block;
|
|
112
|
+
//# sourceMappingURL=Block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_surfaceStyle","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BlockImpl","forwardRef","Block","children","style","rest","ref","background","backgroundColor","border","borderRadius","boxShadow","paddingTop","paddingRight","paddingBottom","paddingLeft","width","minWidth","maxWidth","height","minHeight","maxHeight","flexDirection","alignItems","justifyContent","alignSelf","gap","flexShrink","flexGrow","opacity","overflow","viewProps","resolved","resolveSurfaceStyle","Platform","OS","jsx","View","StyleSheet","flatten","baseStyle","view","exports","memo","displayName","create","display","_default"],"sourceRoot":"../../../src","sources":["primitives/Block.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,aAAA,GAAAF,OAAA;AAGiC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UA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|
+
Object.defineProperty(exports, "MIN_TOUCH_TARGET", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _touchTarget.MIN_TOUCH_TARGET;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = exports.Pressable = void 0;
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
var _cssStringAdapter = require("../adapters/cssStringAdapter.js");
|
|
16
|
+
var _surfaceStyle = require("../adapters/surfaceStyle.js");
|
|
17
|
+
var _optionalGradient = require("../adapters/optionalGradient.js");
|
|
18
|
+
var _touchTarget = require("./touchTarget.js");
|
|
19
|
+
var _useLiveRegion = require("../a11y/useLiveRegion.js");
|
|
20
|
+
var _pressFeedback = require("./pressFeedback.js");
|
|
21
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
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); }
|
|
23
|
+
/**
|
|
24
|
+
* Native `Pressable` — the interactive surface for buttons, tags, and any
|
|
25
|
+
* other pressable token-driven component.
|
|
26
|
+
*
|
|
27
|
+
* Web's `PrimitiveButton` is a styled-components `button` with `_active`,
|
|
28
|
+
* `_hover`, `_focusVisible` and `_disabled` pseudo-state objects. RN has no
|
|
29
|
+
* CSS pseudo-selectors; instead `Pressable` exposes a `style` callback
|
|
30
|
+
* receiving `{ pressed }`. This primitive takes the same token-derived CSS
|
|
31
|
+
* strings, translates them through the shared adapter, and composes them per
|
|
32
|
+
* state.
|
|
33
|
+
*
|
|
34
|
+
* `_hover` is ignored — RN has no hover. `_focusVisible` is ignored — there
|
|
35
|
+
* is no focus ring on touch.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* `expo-linear-gradient` is an **optional** peer (probe shared with
|
|
40
|
+
* Skeleton in `adapters/optionalGradient`). When it is absent the surface
|
|
41
|
+
* falls back to the gradient's first colour, which `resolveSurfaceStyle`
|
|
42
|
+
* already supplies as `backgroundColor` — so a gradient button degrades to
|
|
43
|
+
* a solid one rather than rendering transparent.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Note this extends `SurfaceStyleProps`, exactly as `BlockProps` does.
|
|
48
|
+
*
|
|
49
|
+
* That shared base is load-bearing, not cosmetic. Components that switch
|
|
50
|
+
* between `Block` and `Pressable` depending on interactivity (Tag, and web's
|
|
51
|
+
* `TagElement = onClick ? PrimitiveButton : Block` pattern) build one surface
|
|
52
|
+
* object and hand it to whichever they render. If the two accepted different
|
|
53
|
+
* prop sets, the extras would fall silently into `...rest` in one branch and
|
|
54
|
+
* vanish — and TypeScript would not catch it, because spreading an object
|
|
55
|
+
* into JSX skips excess-property checking. Keeping one base makes that class
|
|
56
|
+
* of bug unrepresentable.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
const PressableImpl = /*#__PURE__*/(0, _react.forwardRef)(function Pressable({
|
|
60
|
+
children,
|
|
61
|
+
background,
|
|
62
|
+
backgroundColor,
|
|
63
|
+
activeBackground,
|
|
64
|
+
disabledBackground,
|
|
65
|
+
border,
|
|
66
|
+
activeBorder,
|
|
67
|
+
disabledBorder,
|
|
68
|
+
borderRadius,
|
|
69
|
+
boxShadow,
|
|
70
|
+
activeBoxShadow,
|
|
71
|
+
paddingTop,
|
|
72
|
+
paddingRight,
|
|
73
|
+
paddingBottom,
|
|
74
|
+
paddingLeft,
|
|
75
|
+
flexDirection,
|
|
76
|
+
alignItems,
|
|
77
|
+
justifyContent,
|
|
78
|
+
alignSelf,
|
|
79
|
+
gap,
|
|
80
|
+
width,
|
|
81
|
+
minWidth,
|
|
82
|
+
maxWidth,
|
|
83
|
+
height,
|
|
84
|
+
minHeight,
|
|
85
|
+
maxHeight,
|
|
86
|
+
flexShrink,
|
|
87
|
+
flexGrow,
|
|
88
|
+
opacity,
|
|
89
|
+
overflow,
|
|
90
|
+
disabled = false,
|
|
91
|
+
loading = false,
|
|
92
|
+
loaderColor,
|
|
93
|
+
loaderSize = 'small',
|
|
94
|
+
loadingAccessibilityLabel = 'Loading, please wait',
|
|
95
|
+
pressedScale = 0.99,
|
|
96
|
+
rippleColor,
|
|
97
|
+
rippleBorderless = false,
|
|
98
|
+
minTouchTarget = _touchTarget.MIN_TOUCH_TARGET,
|
|
99
|
+
onPress,
|
|
100
|
+
style,
|
|
101
|
+
accessibilityRole = 'button',
|
|
102
|
+
accessible = true,
|
|
103
|
+
...rest
|
|
104
|
+
}, ref) {
|
|
105
|
+
// Parsing is memoised on the inputs themselves. The previous
|
|
106
|
+
// implementation stored these in refs and reassigned `.current`
|
|
107
|
+
// during render — a render-phase side effect that breaks under
|
|
108
|
+
// StrictMode/concurrent rendering, and which also kept a stale parse
|
|
109
|
+
// whenever a prop transitioned from a value back to `undefined`.
|
|
110
|
+
const parsedBg = (0, _react.useMemo)(() => (0, _cssStringAdapter.parseBackground)(background), [background]);
|
|
111
|
+
const parsedActiveBg = (0, _react.useMemo)(() => (0, _cssStringAdapter.parseBackground)(activeBackground), [activeBackground]);
|
|
112
|
+
const parsedDisabledBg = (0, _react.useMemo)(() => (0, _cssStringAdapter.parseBackground)(disabledBackground), [disabledBackground]);
|
|
113
|
+
const activeBorderStyle = (0, _react.useMemo)(() => (0, _cssStringAdapter.parseBorder)(activeBorder), [activeBorder]);
|
|
114
|
+
const disabledBorderStyle = (0, _react.useMemo)(() => (0, _cssStringAdapter.parseBorder)(disabledBorder), [disabledBorder]);
|
|
115
|
+
const activeShadowStyle = (0, _react.useMemo)(() => (0, _cssStringAdapter.parseBoxShadow)(activeBoxShadow) ?? {}, [activeBoxShadow]);
|
|
116
|
+
|
|
117
|
+
// Loading and disabled are deliberately *separate* concerns, matching
|
|
118
|
+
// web: `ButtonV2` passes `disabled={isDisabled}` to `PrimitiveButton`
|
|
119
|
+
// and computes `isDisabled` from the `disabled` prop alone, while
|
|
120
|
+
// `renderButtonContent` swaps in a spinner when loading. So a loading
|
|
121
|
+
// button keeps its normal chrome — including its gradient — and only
|
|
122
|
+
// its content changes.
|
|
123
|
+
//
|
|
124
|
+
// Collapsing the two (the earlier `isInert = disabled || loading`)
|
|
125
|
+
// made every loading button render in the disabled colour.
|
|
126
|
+
|
|
127
|
+
/** Blocks presses. Both states are non-interactive. */
|
|
128
|
+
const isInteractionBlocked = disabled || loading;
|
|
129
|
+
/** Applies disabled chrome. Only the real disabled state does. */
|
|
130
|
+
const usesDisabledChrome = disabled;
|
|
131
|
+
const surface = (0, _react.useMemo)(() => (0, _surfaceStyle.resolveSurfaceStyle)({
|
|
132
|
+
background,
|
|
133
|
+
backgroundColor,
|
|
134
|
+
border,
|
|
135
|
+
borderRadius,
|
|
136
|
+
boxShadow,
|
|
137
|
+
paddingTop,
|
|
138
|
+
paddingRight,
|
|
139
|
+
paddingBottom,
|
|
140
|
+
paddingLeft,
|
|
141
|
+
flexDirection,
|
|
142
|
+
alignItems,
|
|
143
|
+
justifyContent,
|
|
144
|
+
alignSelf,
|
|
145
|
+
gap,
|
|
146
|
+
width,
|
|
147
|
+
minWidth,
|
|
148
|
+
maxWidth,
|
|
149
|
+
height,
|
|
150
|
+
minHeight,
|
|
151
|
+
maxHeight,
|
|
152
|
+
flexShrink,
|
|
153
|
+
flexGrow,
|
|
154
|
+
opacity,
|
|
155
|
+
overflow
|
|
156
|
+
}, _reactNative.Platform.OS), [background, backgroundColor, border, borderRadius, boxShadow, paddingTop, paddingRight, paddingBottom, paddingLeft, flexDirection, alignItems, justifyContent, alignSelf, gap, width, minWidth, maxWidth, height, minHeight, maxHeight, flexShrink, flexGrow, opacity, overflow]);
|
|
157
|
+
const isGradient = parsedBg?.type === 'gradient';
|
|
158
|
+
const canRenderGradient = isGradient && _optionalGradient.LinearGradient !== null;
|
|
159
|
+
const activeFlatBgColor = parsedActiveBg?.type === 'flat' ? parsedActiveBg.color : undefined;
|
|
160
|
+
const disabledBgColor = parsedDisabledBg?.type === 'flat' ? parsedDisabledBg.color : parsedDisabledBg?.type === 'gradient' ? parsedDisabledBg.colors[0] : undefined;
|
|
161
|
+
|
|
162
|
+
// RN's equivalent of web's `aria-live="polite"` announcement. On
|
|
163
|
+
// Android `accessibilityState.busy` already conveys this, so the hook
|
|
164
|
+
// only speaks on iOS — see `a11y/useLiveRegion`.
|
|
165
|
+
(0, _useLiveRegion.useLiveRegionAnnounce)(loadingAccessibilityLabel, loading);
|
|
166
|
+
const handlePress = (0, _react.useCallback)(event => {
|
|
167
|
+
if (disabled || loading) return;
|
|
168
|
+
onPress?.(event);
|
|
169
|
+
}, [disabled, loading, onPress]);
|
|
170
|
+
const accessibilityState = (0, _react.useMemo)(() => ({
|
|
171
|
+
disabled: isInteractionBlocked,
|
|
172
|
+
busy: loading
|
|
173
|
+
}), [isInteractionBlocked, loading]);
|
|
174
|
+
|
|
175
|
+
// Ripple on Android, scale elsewhere — see `./pressFeedback`.
|
|
176
|
+
const {
|
|
177
|
+
androidRipple,
|
|
178
|
+
pressedTransform
|
|
179
|
+
} = (0, _react.useMemo)(() => (0, _pressFeedback.resolvePressFeedback)(_reactNative.Platform.OS, {
|
|
180
|
+
rippleColor,
|
|
181
|
+
activeBackgroundColor: activeFlatBgColor,
|
|
182
|
+
rippleBorderless,
|
|
183
|
+
pressedScale
|
|
184
|
+
}), [rippleColor, activeFlatBgColor, rippleBorderless, pressedScale]);
|
|
185
|
+
const disabledStyle = (0, _react.useMemo)(() => usesDisabledChrome ? {
|
|
186
|
+
...(disabledBgColor ? {
|
|
187
|
+
backgroundColor: disabledBgColor
|
|
188
|
+
} : {}),
|
|
189
|
+
...disabledBorderStyle
|
|
190
|
+
} : undefined, [usesDisabledChrome, disabledBgColor, disabledBorderStyle]);
|
|
191
|
+
const pressedStyle = (0, _react.useMemo)(() => ({
|
|
192
|
+
...(activeFlatBgColor ? {
|
|
193
|
+
backgroundColor: activeFlatBgColor
|
|
194
|
+
} : {}),
|
|
195
|
+
...activeBorderStyle,
|
|
196
|
+
...activeShadowStyle,
|
|
197
|
+
...pressedTransform
|
|
198
|
+
}), [activeFlatBgColor, activeBorderStyle, activeShadowStyle, pressedTransform]);
|
|
199
|
+
|
|
200
|
+
// Widen the tap target once laid out, if the control is smaller than
|
|
201
|
+
// the minimum. `hitSlop` extends only the touch region, so layout and
|
|
202
|
+
// appearance are untouched.
|
|
203
|
+
//
|
|
204
|
+
// The resolved slop is stored rather than the raw dimensions, and it
|
|
205
|
+
// starts as `undefined` — the same value a compliant control resolves
|
|
206
|
+
// to. A control already at or above the minimum therefore never
|
|
207
|
+
// changes state and never re-renders; only ones that actually need
|
|
208
|
+
// slop pay for a second pass. Storing `{ width, height }` instead made
|
|
209
|
+
// every Pressable on the screen re-render on mount.
|
|
210
|
+
const [hitSlop, setHitSlop] = (0, _react.useState)(undefined);
|
|
211
|
+
const handleLayout = (0, _react.useCallback)(event => {
|
|
212
|
+
const {
|
|
213
|
+
width,
|
|
214
|
+
height
|
|
215
|
+
} = event.nativeEvent.layout;
|
|
216
|
+
const next = (0, _touchTarget.resolveHitSlop)(width, height, minTouchTarget);
|
|
217
|
+
setHitSlop(previous => (0, _touchTarget.sameHitSlop)(previous, next) ? previous : next);
|
|
218
|
+
}, [minTouchTarget]);
|
|
219
|
+
const content = loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
220
|
+
size: loaderSize,
|
|
221
|
+
color: loaderColor
|
|
222
|
+
}) : children;
|
|
223
|
+
|
|
224
|
+
// ---- Gradient path ----------------------------------------------
|
|
225
|
+
//
|
|
226
|
+
// <Pressable border + radius + overflow:hidden>
|
|
227
|
+
// <LinearGradient absoluteFill (bled into the border zone) />
|
|
228
|
+
// <View padding + layout> {content} </View>
|
|
229
|
+
// </Pressable>
|
|
230
|
+
//
|
|
231
|
+
// The gradient absolute-fills the whole border box — including under
|
|
232
|
+
// the border — so no antialiasing wedge forms at the corners, and the
|
|
233
|
+
// Pressable's own radius + overflow:hidden clips the bleed.
|
|
234
|
+
if (canRenderGradient && !usesDisabledChrome && parsedBg?.type === 'gradient') {
|
|
235
|
+
const gradient = parsedBg;
|
|
236
|
+
const Gradient = _optionalGradient.LinearGradient;
|
|
237
|
+
const borderWidth = surface.borderWidth ?? 1;
|
|
238
|
+
const bleed = -borderWidth;
|
|
239
|
+
|
|
240
|
+
// Negative inset bleeds the gradient into the border zone so no
|
|
241
|
+
// antialiasing gap forms between border and gradient edge; the
|
|
242
|
+
// frame's radius + overflow:hidden clips the overhang.
|
|
243
|
+
const bleedStyle = {
|
|
244
|
+
position: 'absolute',
|
|
245
|
+
top: bleed,
|
|
246
|
+
right: bleed,
|
|
247
|
+
bottom: bleed,
|
|
248
|
+
left: bleed
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// The gradient fills the border box, so padding and inner layout
|
|
252
|
+
// move to a child view; the Pressable keeps only the frame
|
|
253
|
+
// (border, radius, sizing) plus the clip.
|
|
254
|
+
const {
|
|
255
|
+
paddingTop,
|
|
256
|
+
paddingRight,
|
|
257
|
+
paddingBottom,
|
|
258
|
+
paddingLeft,
|
|
259
|
+
flexDirection: frameFlexDirection,
|
|
260
|
+
alignItems: frameAlignItems,
|
|
261
|
+
justifyContent: frameJustifyContent,
|
|
262
|
+
gap: frameGap,
|
|
263
|
+
...frame
|
|
264
|
+
} = surface;
|
|
265
|
+
const contentLayout = {
|
|
266
|
+
flex: 1,
|
|
267
|
+
paddingTop,
|
|
268
|
+
paddingRight,
|
|
269
|
+
paddingBottom,
|
|
270
|
+
paddingLeft,
|
|
271
|
+
flexDirection: frameFlexDirection,
|
|
272
|
+
alignItems: frameAlignItems,
|
|
273
|
+
justifyContent: frameJustifyContent,
|
|
274
|
+
gap: frameGap
|
|
275
|
+
};
|
|
276
|
+
const frameStyle = {
|
|
277
|
+
...frame,
|
|
278
|
+
flexDirection: frameFlexDirection,
|
|
279
|
+
overflow: 'hidden'
|
|
280
|
+
};
|
|
281
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
282
|
+
ref: ref,
|
|
283
|
+
onPress: handlePress,
|
|
284
|
+
disabled: isInteractionBlocked,
|
|
285
|
+
accessibilityRole: accessibilityRole,
|
|
286
|
+
accessible: accessible,
|
|
287
|
+
accessibilityState: accessibilityState,
|
|
288
|
+
onLayout: minTouchTarget ? handleLayout : undefined,
|
|
289
|
+
hitSlop: hitSlop,
|
|
290
|
+
android_ripple: androidRipple,
|
|
291
|
+
style: ({
|
|
292
|
+
pressed
|
|
293
|
+
}) => [frameStyle, pressed ? pressedTransform : undefined, pressed ? activeBorderStyle : undefined, pressed ? activeShadowStyle : undefined, style],
|
|
294
|
+
...rest,
|
|
295
|
+
children: ({
|
|
296
|
+
pressed
|
|
297
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
298
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Gradient, {
|
|
299
|
+
colors: gradient.colors,
|
|
300
|
+
locations: gradient.locations,
|
|
301
|
+
start: gradient.start,
|
|
302
|
+
end: gradient.end,
|
|
303
|
+
style: bleedStyle
|
|
304
|
+
}), pressed && parsedActiveBg?.type === 'gradient' && /*#__PURE__*/(0, _jsxRuntime.jsx)(Gradient, {
|
|
305
|
+
colors: parsedActiveBg.colors,
|
|
306
|
+
locations: parsedActiveBg.locations,
|
|
307
|
+
start: parsedActiveBg.start,
|
|
308
|
+
end: parsedActiveBg.end,
|
|
309
|
+
style: bleedStyle
|
|
310
|
+
}), pressed && activeFlatBgColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
311
|
+
style: [bleedStyle, {
|
|
312
|
+
backgroundColor: activeFlatBgColor
|
|
313
|
+
}]
|
|
314
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
315
|
+
style: contentLayout,
|
|
316
|
+
children: content
|
|
317
|
+
})]
|
|
318
|
+
})
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// ---- Flat path ---------------------------------------------------
|
|
323
|
+
// Also the fallback when a gradient is requested but
|
|
324
|
+
// `expo-linear-gradient` is not installed: `resolveSurfaceStyle` has
|
|
325
|
+
// already set `backgroundColor` to the gradient's first stop.
|
|
326
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
327
|
+
ref: ref,
|
|
328
|
+
onPress: handlePress,
|
|
329
|
+
disabled: isInteractionBlocked,
|
|
330
|
+
accessibilityRole: accessibilityRole,
|
|
331
|
+
accessible: accessible,
|
|
332
|
+
accessibilityState: accessibilityState,
|
|
333
|
+
onLayout: minTouchTarget ? handleLayout : undefined,
|
|
334
|
+
hitSlop: hitSlop,
|
|
335
|
+
android_ripple: androidRipple,
|
|
336
|
+
style: ({
|
|
337
|
+
pressed
|
|
338
|
+
}) => [surface, disabledStyle, !isInteractionBlocked && pressed ? pressedStyle : undefined, style],
|
|
339
|
+
...rest,
|
|
340
|
+
children: content
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
/** Memoised — see the note on `Block`. */
|
|
345
|
+
const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.memo)(PressableImpl);
|
|
346
|
+
Pressable.displayName = 'Pressable';
|
|
347
|
+
var _default = exports.default = Pressable;
|
|
348
|
+
//# sourceMappingURL=Pressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_cssStringAdapter","_surfaceStyle","_optionalGradient","_touchTarget","_useLiveRegion","_pressFeedback","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PressableImpl","forwardRef","Pressable","children","background","backgroundColor","activeBackground","disabledBackground","border","activeBorder","disabledBorder","borderRadius","boxShadow","activeBoxShadow","paddingTop","paddingRight","paddingBottom","paddingLeft","flexDirection","alignItems","justifyContent","alignSelf","gap","width","minWidth","maxWidth","height","minHeight","maxHeight","flexShrink","flexGrow","opacity","overflow","disabled","loading","loaderColor","loaderSize","loadingAccessibilityLabel","pressedScale","rippleColor","rippleBorderless","minTouchTarget","MIN_TOUCH_TARGET","onPress","style","accessibilityRole","accessible","rest","ref","parsedBg","useMemo","parseBackground","parsedActiveBg","parsedDisabledBg","activeBorderStyle","parseBorder","disabledBorderStyle","activeShadowStyle","parseBoxShadow","isInteractionBlocked","usesDisabledChrome","surface","resolveSurfaceStyle","Platform","OS","isGradient","type","canRenderGradient","LinearGradient","activeFlatBgColor","color","undefined","disabledBgColor","colors","useLiveRegionAnnounce","handlePress","useCallback","event","accessibilityState","busy","androidRipple","pressedTransform","resolvePressFeedback","activeBackgroundColor","disabledStyle","pressedStyle","hitSlop","setHitSlop","useState","handleLayout","nativeEvent","layout","next","resolveHitSlop","previous","sameHitSlop","content","jsx","ActivityIndicator","size","gradient","Gradient","borderWidth","bleed","bleedStyle","position","top","right","bottom","left","frameFlexDirection","frameAlignItems","frameJustifyContent","frameGap","frame","contentLayout","flex","frameStyle","onLayout","android_ripple","pressed","jsxs","Fragment","locations","start","end","View","exports","memo","displayName","_default"],"sourceRoot":"../../../src","sources":["primitives/Pressable.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,iBAAA,GAAAF,OAAA;AAKA,IAAAG,aAAA,GAAAH,OAAA;AAIA,IAA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C;QACxC,CACL,CACJ,eACD,IAAAzF,WAAA,CAAAqH,GAAA,EAAC5H,YAAA,CAAAyJ,IAAI;UAAClF,KAAK,EAAEuE,aAAc;UAAAhH,QAAA,EAAE6F;QAAO,CAAO,CAAC;MAAA,CAC9C;IACL,CACQ,CAAC;EAEtB;;EAEA;EACA;EACA;EACA;EACA,oBACI,IAAApH,WAAA,CAAAqH,GAAA,EAAC5H,YAAA,CAAA6B,SAAW;IACR8C,GAAG,EAAEA,GAAI;IACTL,OAAO,EAAEgC,WAAY;IACrB1C,QAAQ,EAAE0B,oBAAqB;IAC/Bd,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBgC,kBAAkB,EAAEA,kBAAmB;IACvCwC,QAAQ,EAAE7E,cAAc,GAAGgD,YAAY,GAAGlB,SAAU;IACpDe,OAAO,EAAEA,OAAQ;IACjBiC,cAAc,EAAEvC,aAAc;IAC9BpC,KAAK,EAAEA,CAAC;MAAE4E;IAAQ,CAAC,KAAK,CACpB3D,OAAO,EACPuB,aAAa,EACb,CAACzB,oBAAoB,IAAI6D,OAAO,GAAGnC,YAAY,GAAGd,SAAS,EAC3D3B,KAAK,CACP;IAAA,GACEG,IAAI;IAAA5C,QAAA,EAEP6F;EAAO,CACC,CAAC;AAEtB,CACJ,CAAC;;AAED;AACO,MAAM9F,SAAS,GAAA6H,OAAA,CAAA7H,SAAA,gBAAG,IAAA8H,WAAI,EAAChI,aAAa,CAAC;AAC5CE,SAAS,CAAC+H,WAAW,GAAG,WAAW;AAAA,IAAAC,QAAA,GAAAH,OAAA,CAAAxI,OAAA,GAEpBW,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.PrimitiveInput = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _cssStringAdapter = require("../adapters/cssStringAdapter.js");
|
|
10
|
+
var _textStyle = require("./textStyle.js");
|
|
11
|
+
var _BlendNativeProvider = require("../theme/BlendNativeProvider.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* Native `PrimitiveInput` — a bare RN `TextInput` driven by token-shaped
|
|
15
|
+
* text props, the input counterpart of `Text`.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately *only* the text field: web's `PrimitiveInput` styles the
|
|
18
|
+
* `<input>` element itself with border and padding, but RN inputs carry
|
|
19
|
+
* leading/trailing slots, so the bordered container is a `Block` row that
|
|
20
|
+
* the field component owns and this primitive sits inside with `flex: 1`.
|
|
21
|
+
*
|
|
22
|
+
* Font family comes from the provider's role map (`body`), matching `Text`,
|
|
23
|
+
* and OS font scaling stays on per the package policy.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const PrimitiveInputImpl = /*#__PURE__*/(0, _react.forwardRef)(function PrimitiveInput({
|
|
27
|
+
fontSize,
|
|
28
|
+
fontWeight,
|
|
29
|
+
color,
|
|
30
|
+
lineHeight,
|
|
31
|
+
placeholderColor,
|
|
32
|
+
style,
|
|
33
|
+
...rest
|
|
34
|
+
}, ref) {
|
|
35
|
+
const {
|
|
36
|
+
fontFamily
|
|
37
|
+
} = (0, _react.useContext)(_BlendNativeProvider.BlendNativeThemeContext);
|
|
38
|
+
const resolved = {
|
|
39
|
+
fontSize: (0, _cssStringAdapter.parseDimension)(fontSize),
|
|
40
|
+
fontWeight: (0, _textStyle.resolveFontWeight)(fontWeight),
|
|
41
|
+
color,
|
|
42
|
+
lineHeight: (0, _cssStringAdapter.parseDimension)(lineHeight),
|
|
43
|
+
fontFamily: fontFamily.body ?? undefined
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
46
|
+
ref: ref,
|
|
47
|
+
style: _reactNative.StyleSheet.flatten([baseStyle.input, resolved, style]),
|
|
48
|
+
placeholderTextColor: placeholderColor,
|
|
49
|
+
...rest
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/** Memoised — see the note on `Block`. */
|
|
54
|
+
const PrimitiveInput = exports.PrimitiveInput = /*#__PURE__*/(0, _react.memo)(PrimitiveInputImpl);
|
|
55
|
+
PrimitiveInput.displayName = 'PrimitiveInput';
|
|
56
|
+
const baseStyle = _reactNative.StyleSheet.create({
|
|
57
|
+
input: {
|
|
58
|
+
// The field row owns padding; RN inputs default to platform padding
|
|
59
|
+
// that would double up with the container's token padding.
|
|
60
|
+
flex: 1,
|
|
61
|
+
paddingVertical: 0,
|
|
62
|
+
paddingHorizontal: 0
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
var _default = exports.default = PrimitiveInput;
|
|
66
|
+
//# sourceMappingURL=PrimitiveInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_cssStringAdapter","_textStyle","_BlendNativeProvider","_jsxRuntime","PrimitiveInputImpl","forwardRef","PrimitiveInput","fontSize","fontWeight","color","lineHeight","placeholderColor","style","rest","ref","fontFamily","useContext","BlendNativeThemeContext","resolved","parseDimension","resolveFontWeight","body","undefined","jsx","TextInput","StyleSheet","flatten","baseStyle","input","placeholderTextColor","exports","memo","displayName","create","flex","paddingVertical","paddingHorizontal","_default","default"],"sourceRoot":"../../../src","sources":["primitives/PrimitiveInput.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAAsE,IAAAK,WAAA,GAAAL,OAAA;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,MAAM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|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Separator = Separator;
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _node = require("@juspay/blend-design-system/node");
|
|
10
|
+
var _cssStringAdapter = require("../adapters/cssStringAdapter.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* Decorative divider.
|
|
14
|
+
*
|
|
15
|
+
* Native counterpart of web's `components/common/Seperator.tsx` — a fixed-size
|
|
16
|
+
* block of colour used to separate adjacent content. Alert renders one between
|
|
17
|
+
* its actions and its close button when the actions sit inline.
|
|
18
|
+
*
|
|
19
|
+
* Always hidden from assistive tech: it carries no information that the
|
|
20
|
+
* surrounding content does not already convey.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const DEFAULT_LENGTH = _node.FOUNDATION_THEME.unit[16];
|
|
24
|
+
const DEFAULT_THICKNESS = 1;
|
|
25
|
+
const DEFAULT_COLOR = String(_node.FOUNDATION_THEME.colors.gray[300]);
|
|
26
|
+
function Separator({
|
|
27
|
+
orientation = 'vertical',
|
|
28
|
+
length = DEFAULT_LENGTH,
|
|
29
|
+
thickness = DEFAULT_THICKNESS,
|
|
30
|
+
color = DEFAULT_COLOR,
|
|
31
|
+
style,
|
|
32
|
+
testID
|
|
33
|
+
}) {
|
|
34
|
+
const resolvedLength = (0, _cssStringAdapter.parseDimension)(length);
|
|
35
|
+
const resolvedThickness = (0, _cssStringAdapter.parseDimension)(thickness);
|
|
36
|
+
const sizing = orientation === 'vertical' ? {
|
|
37
|
+
width: resolvedThickness,
|
|
38
|
+
height: resolvedLength
|
|
39
|
+
} : {
|
|
40
|
+
width: resolvedLength,
|
|
41
|
+
height: resolvedThickness
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
44
|
+
testID: testID,
|
|
45
|
+
accessible: false,
|
|
46
|
+
accessibilityElementsHidden: true,
|
|
47
|
+
importantForAccessibility: "no-hide-descendants",
|
|
48
|
+
style: _reactNative.StyleSheet.flatten([sizing, {
|
|
49
|
+
backgroundColor: color
|
|
50
|
+
}, style])
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
Separator.displayName = 'Separator';
|
|
54
|
+
var _default = exports.default = Separator;
|
|
55
|
+
//# sourceMappingURL=Separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_node","_cssStringAdapter","_jsxRuntime","DEFAULT_LENGTH","FOUNDATION_THEME","unit","DEFAULT_THICKNESS","DEFAULT_COLOR","String","colors","gray","Separator","orientation","length","thickness","color","style","testID","resolvedLength","parseDimension","resolvedThickness","sizing","width","height","jsx","View","accessible","accessibilityElementsHidden","importantForAccessibility","StyleSheet","flatten","backgroundColor","displayName","_default","exports","default"],"sourceRoot":"../../../src","sources":["primitives/Separator.tsx"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAA6D,IAAAG,WAAA,GAAAH,OAAA;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,MAAMI,cAAc,GAAGC,sBAAgB,CAACC,IAAI,CAAC,EAAE,CAAC;AAChD,MAAMC,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,aAAa,GAAGC,MAAM,CAACJ,sBAAgB,CAACK,MAAM,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;AAExD,SAASC,SAASA,CAAC;EACtBC,WAAW,GAAG,UAAU;EACxBC,MAAM,GAAGV,cAAc;EACvBW,SAAS,GAAGR,iBAAiB;EAC7BS,KAAK,GAAGR,aAAa;EACrBS,KAAK;EACLC;AACY,CAAC,EAAE;EACf,MAAMC,cAAc,GAAG,IAAAC,gCAAc,EAACN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