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,56 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SkeletonShape,
|
|
3
|
+
SkeletonTokensType,
|
|
4
|
+
} from '@juspay/blend-design-system/node'
|
|
5
|
+
import {
|
|
6
|
+
parseBorderRadius,
|
|
7
|
+
parseDuration,
|
|
8
|
+
parseSize,
|
|
9
|
+
} from '../../adapters/cssStringAdapter'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Pure resolution for the native Skeleton — vitest-testable, worklet-free.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Default when the token duration cannot be parsed. */
|
|
16
|
+
export const SKELETON_FALLBACK_DURATION = 1500
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Animation cycle length in milliseconds, from the token's CSS duration
|
|
20
|
+
* string (`"1.5s"`).
|
|
21
|
+
*/
|
|
22
|
+
export function resolveSkeletonDuration(tokens: SkeletonTokensType): number {
|
|
23
|
+
return (
|
|
24
|
+
parseDuration(tokens.animation.duration as string | number) ??
|
|
25
|
+
SKELETON_FALLBACK_DURATION
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Border radius for a shape.
|
|
31
|
+
*
|
|
32
|
+
* The `circle` token is CSS `"50%"`, which RN cannot express — a circle
|
|
33
|
+
* needs a numeric radius of half the box. When the box size is unknown
|
|
34
|
+
* (string sizes, wrap mode) a large radius produces the same pill/circle
|
|
35
|
+
* silhouette, the same trick web's `radius.full` relies on.
|
|
36
|
+
*/
|
|
37
|
+
export function resolveSkeletonRadius(
|
|
38
|
+
shape: SkeletonShape,
|
|
39
|
+
tokens: SkeletonTokensType,
|
|
40
|
+
width?: string | number,
|
|
41
|
+
height?: string | number
|
|
42
|
+
): number {
|
|
43
|
+
if (shape === 'circle') {
|
|
44
|
+
const w = typeof width === 'number' ? width : parseSize(String(width))
|
|
45
|
+
const h =
|
|
46
|
+
typeof height === 'number' ? height : parseSize(String(height))
|
|
47
|
+
if (typeof w === 'number' && typeof h === 'number') {
|
|
48
|
+
return Math.min(w, h) / 2
|
|
49
|
+
}
|
|
50
|
+
return 9999
|
|
51
|
+
}
|
|
52
|
+
const parsed = parseBorderRadius(
|
|
53
|
+
tokens.borderRadius[shape] as string | number
|
|
54
|
+
)
|
|
55
|
+
return typeof parsed === 'number' ? parsed : 0
|
|
56
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { forwardRef, useMemo } from 'react'
|
|
2
|
+
import type { View as RNView } from 'react-native'
|
|
3
|
+
import {
|
|
4
|
+
TagV2Color,
|
|
5
|
+
TagV2Size,
|
|
6
|
+
TagV2SubType,
|
|
7
|
+
TagV2Type,
|
|
8
|
+
type TagV2TokensType,
|
|
9
|
+
} from '@juspay/blend-design-system/node'
|
|
10
|
+
import { useNativeTokens } from '../../theme/useNativeTokens'
|
|
11
|
+
import { Block } from '../../primitives/Block'
|
|
12
|
+
import { Pressable } from '../../primitives/Pressable'
|
|
13
|
+
import { Slot } from '../../primitives/Slot'
|
|
14
|
+
import { Text } from '../../primitives/Text'
|
|
15
|
+
import {
|
|
16
|
+
getAccessibleName,
|
|
17
|
+
getTagBorderRadius,
|
|
18
|
+
getTagAccessibilityState,
|
|
19
|
+
} from './tag.utils'
|
|
20
|
+
import { getGroupedBorderWidths } from '../shared/group'
|
|
21
|
+
import type { TagNativeProps } from './tag.types'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Layout that never varies with tokens or props.
|
|
25
|
+
*
|
|
26
|
+
* Hoisted to module scope so it is allocated once rather than per render.
|
|
27
|
+
* `alignSelf: 'flex-start'` is RN's equivalent of web's `width: fit-content`
|
|
28
|
+
* on an inline-flex element — shrink-to-fit inside a column parent.
|
|
29
|
+
*/
|
|
30
|
+
const TAG_LAYOUT = {
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignSelf: 'flex-start',
|
|
35
|
+
} as const
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Tag — React Native implementation of web's `TagV2`.
|
|
39
|
+
*
|
|
40
|
+
* Tokens resolve through `useNativeTokens('TAGV2')`, the native counterpart
|
|
41
|
+
* of web's `useResponsiveTokens('TAGV2')`, so theme and per-slot overrides
|
|
42
|
+
* come from `BlendNativeProvider` rather than a per-component prop.
|
|
43
|
+
*
|
|
44
|
+
* Like web, the rendered element depends on interactivity: web picks
|
|
45
|
+
* `PrimitiveButton` when `onClick` is supplied and `Block` otherwise; native
|
|
46
|
+
* picks `Pressable` vs `Block`. Both branches resolve their styles through
|
|
47
|
+
* the same `resolveSurfaceStyle`, so the two render identically apart from
|
|
48
|
+
* press feedback.
|
|
49
|
+
*
|
|
50
|
+
* TagV2's tokens contain no gradients, shadows, or state matrix, so this
|
|
51
|
+
* component needs no native module — it is pure JS.
|
|
52
|
+
*/
|
|
53
|
+
const Tag = forwardRef<RNView, TagNativeProps>(function Tag(
|
|
54
|
+
{
|
|
55
|
+
text,
|
|
56
|
+
size = TagV2Size.SM,
|
|
57
|
+
type = TagV2Type.SUBTLE,
|
|
58
|
+
subType = TagV2SubType.SQUARICAL,
|
|
59
|
+
color = TagV2Color.PRIMARY,
|
|
60
|
+
leftSlot,
|
|
61
|
+
rightSlot,
|
|
62
|
+
tagGroupPosition,
|
|
63
|
+
onPress,
|
|
64
|
+
pressed,
|
|
65
|
+
accessibilityLabel,
|
|
66
|
+
testID,
|
|
67
|
+
style,
|
|
68
|
+
},
|
|
69
|
+
ref
|
|
70
|
+
) {
|
|
71
|
+
const tokens = useNativeTokens<TagV2TokensType>('TAGV2')
|
|
72
|
+
|
|
73
|
+
const isInteractive = typeof onPress === 'function'
|
|
74
|
+
|
|
75
|
+
// Grouped members drop their shared edges so a seam is one line wide.
|
|
76
|
+
const groupBorderWidths = useMemo(
|
|
77
|
+
() => getGroupedBorderWidths(tagGroupPosition),
|
|
78
|
+
[tagGroupPosition]
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
const borderRadius = useMemo(
|
|
82
|
+
() => getTagBorderRadius(size, subType, tagGroupPosition, tokens),
|
|
83
|
+
[size, subType, tagGroupPosition, tokens]
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
const backgroundColor = String(tokens.backgroundColor[type][color])
|
|
87
|
+
const border = String(tokens.border[type][color])
|
|
88
|
+
const textColor = String(tokens.text.color[type][color])
|
|
89
|
+
|
|
90
|
+
// Slot icons are tinted to match the label. On web this happens
|
|
91
|
+
// implicitly — `Block`'s `color` becomes CSS `color` and SVGs inherit it
|
|
92
|
+
// through `currentColor`. RN has no such inheritance, so `Slot` hands the
|
|
93
|
+
// colour to the icon element explicitly.
|
|
94
|
+
const accessibleName =
|
|
95
|
+
accessibilityLabel ?? getAccessibleName(text, isInteractive, pressed)
|
|
96
|
+
|
|
97
|
+
const content = (
|
|
98
|
+
<>
|
|
99
|
+
{leftSlot?.slot ? (
|
|
100
|
+
<Slot
|
|
101
|
+
color={textColor}
|
|
102
|
+
maxHeight={
|
|
103
|
+
leftSlot.maxHeight ?? tokens.leftSlot.maxHeight[size]
|
|
104
|
+
}
|
|
105
|
+
// Matches web's `aria-hidden` on slots accompanying text:
|
|
106
|
+
// the label already carries the accessible name.
|
|
107
|
+
hidden={Boolean(text)}
|
|
108
|
+
testID={testID ? `${testID}-left-slot` : undefined}
|
|
109
|
+
>
|
|
110
|
+
{leftSlot.slot}
|
|
111
|
+
</Slot>
|
|
112
|
+
) : null}
|
|
113
|
+
|
|
114
|
+
<Text
|
|
115
|
+
fontSize={tokens.text.fontSize[size]}
|
|
116
|
+
fontWeight={tokens.text.fontWeight[size]}
|
|
117
|
+
lineHeight={tokens.text.lineHeight[size]}
|
|
118
|
+
color={textColor}
|
|
119
|
+
>
|
|
120
|
+
{text}
|
|
121
|
+
</Text>
|
|
122
|
+
|
|
123
|
+
{rightSlot?.slot ? (
|
|
124
|
+
<Slot
|
|
125
|
+
color={textColor}
|
|
126
|
+
maxHeight={
|
|
127
|
+
rightSlot.maxHeight ?? tokens.rightSlot.maxHeight[size]
|
|
128
|
+
}
|
|
129
|
+
hidden={Boolean(text)}
|
|
130
|
+
testID={testID ? `${testID}-right-slot` : undefined}
|
|
131
|
+
>
|
|
132
|
+
{rightSlot.slot}
|
|
133
|
+
</Slot>
|
|
134
|
+
) : null}
|
|
135
|
+
</>
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
const surface = useMemo(
|
|
139
|
+
() => ({
|
|
140
|
+
...TAG_LAYOUT,
|
|
141
|
+
backgroundColor,
|
|
142
|
+
border,
|
|
143
|
+
borderRadius,
|
|
144
|
+
// The height token is applied as `minHeight`, not `height`.
|
|
145
|
+
//
|
|
146
|
+
// At the default font scale the result is identical to web: the
|
|
147
|
+
// line height is shorter than the token height, so the box renders
|
|
148
|
+
// at exactly `minHeight` with the line centred. But RN respects OS
|
|
149
|
+
// font scaling (Dynamic Type), and a fixed `height` clips scaled
|
|
150
|
+
// text — the package policy is to let controls grow instead
|
|
151
|
+
// (see `primitives/Text.tsx`).
|
|
152
|
+
//
|
|
153
|
+
// Vertical padding is still deliberately NOT applied. The tokens
|
|
154
|
+
// define both a height and vertical padding, and the padding
|
|
155
|
+
// leaves a content box shorter than the text's own line height
|
|
156
|
+
// (sm: 14px box vs 18px line). On web that is harmless — the line
|
|
157
|
+
// box overflows the padding box and `overflow: visible` shows it.
|
|
158
|
+
// RN clips instead: descenders ("p" in primary, "g" in warning)
|
|
159
|
+
// were sheared off on iOS while react-native-web rendered fine.
|
|
160
|
+
// With a centred single line the padding is visually inert on web
|
|
161
|
+
// anyway, so dropping it reproduces web's result exactly.
|
|
162
|
+
minHeight: tokens.height[size],
|
|
163
|
+
paddingLeft: tokens.padding.left[size],
|
|
164
|
+
paddingRight: tokens.padding.right[size],
|
|
165
|
+
gap: tokens.gap,
|
|
166
|
+
}),
|
|
167
|
+
[backgroundColor, border, borderRadius, tokens, size]
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
if (isInteractive) {
|
|
171
|
+
return (
|
|
172
|
+
<Pressable
|
|
173
|
+
ref={ref}
|
|
174
|
+
{...surface}
|
|
175
|
+
onPress={onPress}
|
|
176
|
+
accessibilityRole="button"
|
|
177
|
+
accessibilityLabel={accessibleName}
|
|
178
|
+
accessibilityState={getTagAccessibilityState(true, pressed)}
|
|
179
|
+
testID={testID}
|
|
180
|
+
style={{ ...groupBorderWidths, ...style }}
|
|
181
|
+
>
|
|
182
|
+
{content}
|
|
183
|
+
</Pressable>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<Block
|
|
189
|
+
ref={ref}
|
|
190
|
+
{...surface}
|
|
191
|
+
accessible
|
|
192
|
+
accessibilityRole="text"
|
|
193
|
+
accessibilityLabel={accessibilityLabel}
|
|
194
|
+
testID={testID}
|
|
195
|
+
style={{ ...groupBorderWidths, ...style }}
|
|
196
|
+
>
|
|
197
|
+
{content}
|
|
198
|
+
</Block>
|
|
199
|
+
)
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
Tag.displayName = 'Tag'
|
|
203
|
+
|
|
204
|
+
export default Tag
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
import type { GestureResponderEvent, ViewStyle } from 'react-native'
|
|
3
|
+
import type {
|
|
4
|
+
TagV2Color,
|
|
5
|
+
TagV2Size,
|
|
6
|
+
TagV2SubType,
|
|
7
|
+
TagV2Type,
|
|
8
|
+
} from '@juspay/blend-design-system/node'
|
|
9
|
+
import type { GroupPosition } from '../shared/group'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for the native `Tag`.
|
|
13
|
+
*
|
|
14
|
+
* Mirrors web `TagV2Props` (`packages/blend/lib/components/TagV2/
|
|
15
|
+
* TagV2.types.ts`) with DOM-specific pieces replaced by RN equivalents:
|
|
16
|
+
*
|
|
17
|
+
* - `onClick` → `onPress`, carrying a `GestureResponderEvent`.
|
|
18
|
+
* - `aria-pressed` → `pressed`, surfaced as `accessibilityState.selected`.
|
|
19
|
+
* - `HTMLAttributes` passthrough → RN `View`/`Pressable` props via `...rest`.
|
|
20
|
+
*
|
|
21
|
+
* `skeleton` is deliberately **absent** rather than accepted-and-ignored.
|
|
22
|
+
* Web's `TagV2` renders a `TagSkeleton`, which has no native counterpart yet;
|
|
23
|
+
* omitting the prop from the type keeps it a compile error instead of a
|
|
24
|
+
* silent no-op. Same decision as `Button`.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export type TagSlot = {
|
|
28
|
+
slot: React.ReactNode
|
|
29
|
+
/** Overrides the size-derived slot max height from tokens. */
|
|
30
|
+
maxHeight?: string | number
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type TagNativeProps = {
|
|
34
|
+
text: string
|
|
35
|
+
size?: TagV2Size
|
|
36
|
+
type?: TagV2Type
|
|
37
|
+
subType?: TagV2SubType
|
|
38
|
+
color?: TagV2Color
|
|
39
|
+
leftSlot?: TagSlot
|
|
40
|
+
rightSlot?: TagSlot
|
|
41
|
+
/**
|
|
42
|
+
* Position within a tag group. Collapses the border radius on the joined
|
|
43
|
+
* edges, matching web's `getTagBorderRadius`.
|
|
44
|
+
*/
|
|
45
|
+
tagGroupPosition?: GroupPosition
|
|
46
|
+
/**
|
|
47
|
+
* Providing this makes the tag interactive: it renders as a pressable
|
|
48
|
+
* with `accessibilityRole="button"` instead of a static view, mirroring
|
|
49
|
+
* web's `TagElement = onClick ? PrimitiveButton : Block`.
|
|
50
|
+
*/
|
|
51
|
+
onPress?: (event: GestureResponderEvent) => void
|
|
52
|
+
/**
|
|
53
|
+
* Toggle state for interactive tags. Maps to web's `aria-pressed` and to
|
|
54
|
+
* RN's `accessibilityState.selected`, and is folded into the accessible
|
|
55
|
+
* name exactly as web's `getAccessibleName` does.
|
|
56
|
+
*/
|
|
57
|
+
pressed?: boolean | 'mixed'
|
|
58
|
+
/** Overrides the accessible name derived from `text`. */
|
|
59
|
+
accessibilityLabel?: string
|
|
60
|
+
testID?: string
|
|
61
|
+
/** Escape hatch for RN styles the token props do not cover. */
|
|
62
|
+
style?: ViewStyle
|
|
63
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TagV2Size,
|
|
3
|
+
TagV2SubType,
|
|
4
|
+
type TagV2TokensType,
|
|
5
|
+
} from '@juspay/blend-design-system/node'
|
|
6
|
+
import { getGroupedBorderRadius, type GroupPosition } from '../shared/group'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Native Tag style helpers.
|
|
10
|
+
*
|
|
11
|
+
* Ported from `packages/blend/lib/components/TagV2/utils.ts`. Both functions
|
|
12
|
+
* below are pure string/logic helpers with no DOM dependency, so they are
|
|
13
|
+
* reproduced verbatim in behaviour — keeping web and native visually and
|
|
14
|
+
* semantically identical is the whole point.
|
|
15
|
+
*
|
|
16
|
+
* Web's third helper, `createKeyboardHandler` (Enter/Space → click), has no
|
|
17
|
+
* native counterpart: RN's `Pressable` handles activation itself, including
|
|
18
|
+
* for switch-control and keyboard users.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the border radius for a tag, collapsing the joined edges when the
|
|
23
|
+
* tag sits inside a group.
|
|
24
|
+
*
|
|
25
|
+
* Mirrors `getTagBorderRadius` in web `utils.ts`. The collapsing itself lives
|
|
26
|
+
* in `shared/group` because Button needs exactly the same algorithm.
|
|
27
|
+
*/
|
|
28
|
+
export function getTagBorderRadius(
|
|
29
|
+
size: TagV2Size,
|
|
30
|
+
subType: TagV2SubType,
|
|
31
|
+
tagGroupPosition: GroupPosition | undefined,
|
|
32
|
+
tokens: TagV2TokensType
|
|
33
|
+
): string {
|
|
34
|
+
return getGroupedBorderRadius(
|
|
35
|
+
tokens.borderRadius[size][subType] as string | number,
|
|
36
|
+
tagGroupPosition
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Build the accessible name for a tag.
|
|
42
|
+
*
|
|
43
|
+
* Mirrors `getAccessibleName` in web `utils.ts`: non-interactive tags get no
|
|
44
|
+
* explicit name (the text content is announced instead), and interactive
|
|
45
|
+
* tags fold their toggle state into the label.
|
|
46
|
+
*/
|
|
47
|
+
export function getAccessibleName(
|
|
48
|
+
text: string,
|
|
49
|
+
isInteractive: boolean,
|
|
50
|
+
pressed: boolean | 'mixed' | undefined
|
|
51
|
+
): string | undefined {
|
|
52
|
+
if (!isInteractive) {
|
|
53
|
+
return undefined
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let accessibleName = text
|
|
57
|
+
|
|
58
|
+
if (pressed !== undefined) {
|
|
59
|
+
if (pressed === true) {
|
|
60
|
+
accessibleName = `${text}, pressed`
|
|
61
|
+
} else if (pressed === 'mixed') {
|
|
62
|
+
accessibleName = `${text}, mixed state`
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return accessibleName
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the accessibility state for a tag.
|
|
71
|
+
*
|
|
72
|
+
* `'mixed'` has no RN equivalent — RN's `selected` is a boolean — so it is
|
|
73
|
+
* reported as unselected and carried in the accessible name instead, which
|
|
74
|
+
* is what `getAccessibleName` already appends.
|
|
75
|
+
*/
|
|
76
|
+
export function getTagAccessibilityState(
|
|
77
|
+
isInteractive: boolean,
|
|
78
|
+
pressed: boolean | 'mixed' | undefined
|
|
79
|
+
): { selected: boolean } | undefined {
|
|
80
|
+
if (!isInteractive || pressed === undefined) return undefined
|
|
81
|
+
return { selected: pressed === true }
|
|
82
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { forwardRef, useCallback, useMemo, useState } from 'react'
|
|
2
|
+
import type {
|
|
3
|
+
TextInputProps as RNTextInputProps,
|
|
4
|
+
View as RNView,
|
|
5
|
+
} from 'react-native'
|
|
6
|
+
import {
|
|
7
|
+
InputSizeV2,
|
|
8
|
+
type TextInputV2TokensType,
|
|
9
|
+
} from '@juspay/blend-design-system/node'
|
|
10
|
+
import { useNativeTokens } from '../../theme/useNativeTokens'
|
|
11
|
+
import { Block } from '../../primitives/Block'
|
|
12
|
+
import { PrimitiveInput } from '../../primitives/PrimitiveInput'
|
|
13
|
+
import { Slot } from '../../primitives/Slot'
|
|
14
|
+
import { FieldLabels } from '../shared/field/FieldLabels'
|
|
15
|
+
import { FieldFooter } from '../shared/field/FieldFooter'
|
|
16
|
+
import { getFieldState, getFieldVisualState } from '../shared/field/fieldState'
|
|
17
|
+
import { getTextInputNativeStyles } from './textInput.utils'
|
|
18
|
+
import type { TextInputNativeProps } from './textInput.types'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* TextInput — React Native implementation of web's `TextInputV2`, and the
|
|
22
|
+
* reference consumer of the shared field chrome (`FieldLabels`,
|
|
23
|
+
* `FieldFooter`, `PrimitiveInput`) the rest of the InputsV2 family will
|
|
24
|
+
* reuse.
|
|
25
|
+
*
|
|
26
|
+
* Anatomy matches web: a column of label row, bordered field row (left
|
|
27
|
+
* slot / input / right slot), and footer — all resolved from the
|
|
28
|
+
* `TEXT_INPUTV2` token slot. Focus is component state re-resolving the
|
|
29
|
+
* container against the FOCUS tokens, replacing web's `_focus` pseudo
|
|
30
|
+
* object; the spread-only focus ring has no RN equivalent and is dropped.
|
|
31
|
+
*/
|
|
32
|
+
const TextInput = forwardRef<RNView, TextInputNativeProps>(function TextInput(
|
|
33
|
+
{
|
|
34
|
+
value,
|
|
35
|
+
onChangeText,
|
|
36
|
+
label,
|
|
37
|
+
subLabel,
|
|
38
|
+
size = InputSizeV2.SM,
|
|
39
|
+
error,
|
|
40
|
+
hintText,
|
|
41
|
+
required = false,
|
|
42
|
+
disabled = false,
|
|
43
|
+
leftSlot,
|
|
44
|
+
rightSlot,
|
|
45
|
+
testID,
|
|
46
|
+
accessibilityLabel,
|
|
47
|
+
style,
|
|
48
|
+
inputRef,
|
|
49
|
+
onFocus,
|
|
50
|
+
onBlur,
|
|
51
|
+
...rest
|
|
52
|
+
},
|
|
53
|
+
ref
|
|
54
|
+
) {
|
|
55
|
+
const tokens = useNativeTokens<TextInputV2TokensType>('TEXT_INPUTV2')
|
|
56
|
+
const [focused, setFocused] = useState(false)
|
|
57
|
+
|
|
58
|
+
// Labels/footer track error+disabled; the container also tracks focus.
|
|
59
|
+
const fieldState = getFieldState(error, disabled)
|
|
60
|
+
const visualState = getFieldVisualState(error, disabled, focused)
|
|
61
|
+
|
|
62
|
+
const styles = useMemo(
|
|
63
|
+
() => getTextInputNativeStyles(tokens, size, visualState),
|
|
64
|
+
[tokens, size, visualState]
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
// Event types come from RN's own prop signatures — they changed shape
|
|
68
|
+
// across RN versions (FocusEvent/BlurEvent), so deriving keeps us
|
|
69
|
+
// correct on every supported peer.
|
|
70
|
+
const handleFocus = useCallback<NonNullable<RNTextInputProps['onFocus']>>(
|
|
71
|
+
(event) => {
|
|
72
|
+
setFocused(true)
|
|
73
|
+
onFocus?.(event)
|
|
74
|
+
},
|
|
75
|
+
[onFocus]
|
|
76
|
+
)
|
|
77
|
+
const handleBlur = useCallback<NonNullable<RNTextInputProps['onBlur']>>(
|
|
78
|
+
(event) => {
|
|
79
|
+
setFocused(false)
|
|
80
|
+
onBlur?.(event)
|
|
81
|
+
},
|
|
82
|
+
[onBlur]
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Block ref={ref} gap={styles.gap} style={style} testID={testID}>
|
|
87
|
+
<FieldLabels
|
|
88
|
+
label={label}
|
|
89
|
+
sublabel={subLabel}
|
|
90
|
+
required={required}
|
|
91
|
+
size={size}
|
|
92
|
+
state={fieldState}
|
|
93
|
+
tokens={tokens.topContainer}
|
|
94
|
+
testID={testID ? `${testID}-labels` : undefined}
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<Block
|
|
98
|
+
flexDirection="row"
|
|
99
|
+
alignItems="center"
|
|
100
|
+
width="100%"
|
|
101
|
+
testID={testID ? `${testID}-container` : undefined}
|
|
102
|
+
border={styles.container.border}
|
|
103
|
+
backgroundColor={styles.container.backgroundColor}
|
|
104
|
+
borderRadius={styles.container.borderRadius}
|
|
105
|
+
gap={styles.container.gap}
|
|
106
|
+
paddingTop={styles.container.paddingTop}
|
|
107
|
+
paddingRight={styles.container.paddingRight}
|
|
108
|
+
paddingBottom={styles.container.paddingBottom}
|
|
109
|
+
paddingLeft={styles.container.paddingLeft}
|
|
110
|
+
>
|
|
111
|
+
{leftSlot?.slot ? (
|
|
112
|
+
<Slot
|
|
113
|
+
maxHeight={leftSlot.maxHeight}
|
|
114
|
+
// Decorative next to the labelled input, matching
|
|
115
|
+
// web's aria-hidden on input slots.
|
|
116
|
+
hidden
|
|
117
|
+
testID={testID ? `${testID}-left-slot` : undefined}
|
|
118
|
+
>
|
|
119
|
+
{leftSlot.slot}
|
|
120
|
+
</Slot>
|
|
121
|
+
) : null}
|
|
122
|
+
|
|
123
|
+
<PrimitiveInput
|
|
124
|
+
ref={inputRef}
|
|
125
|
+
value={value}
|
|
126
|
+
onChangeText={onChangeText}
|
|
127
|
+
editable={!disabled}
|
|
128
|
+
fontSize={styles.text.fontSize}
|
|
129
|
+
fontWeight={styles.text.fontWeight}
|
|
130
|
+
lineHeight={styles.text.lineHeight}
|
|
131
|
+
color={styles.text.color}
|
|
132
|
+
placeholderColor={styles.placeholderColor}
|
|
133
|
+
onFocus={handleFocus}
|
|
134
|
+
onBlur={handleBlur}
|
|
135
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
136
|
+
accessibilityState={{ disabled }}
|
|
137
|
+
testID={testID ? `${testID}-input` : undefined}
|
|
138
|
+
{...rest}
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
{rightSlot?.slot ? (
|
|
142
|
+
<Slot
|
|
143
|
+
maxHeight={rightSlot.maxHeight}
|
|
144
|
+
hidden
|
|
145
|
+
testID={testID ? `${testID}-right-slot` : undefined}
|
|
146
|
+
>
|
|
147
|
+
{rightSlot.slot}
|
|
148
|
+
</Slot>
|
|
149
|
+
) : null}
|
|
150
|
+
</Block>
|
|
151
|
+
|
|
152
|
+
<FieldFooter
|
|
153
|
+
error={error}
|
|
154
|
+
hintText={hintText}
|
|
155
|
+
size={size}
|
|
156
|
+
tokens={tokens.bottomContainer}
|
|
157
|
+
testID={testID ? `${testID}-footer` : undefined}
|
|
158
|
+
/>
|
|
159
|
+
</Block>
|
|
160
|
+
)
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
TextInput.displayName = 'TextInput'
|
|
164
|
+
|
|
165
|
+
export default TextInput
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
import type {
|
|
3
|
+
TextInput as RNTextInput,
|
|
4
|
+
TextInputProps as RNTextInputProps,
|
|
5
|
+
ViewStyle,
|
|
6
|
+
} from 'react-native'
|
|
7
|
+
import type { InputSizeV2 } from '@juspay/blend-design-system/node'
|
|
8
|
+
import type { FieldError } from '../shared/field/fieldState'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Props for the native `TextInput` — the port of web's `TextInputV2`.
|
|
12
|
+
*
|
|
13
|
+
* Web pieces swapped for RN ones: `onChange` on a DOM input becomes RN's
|
|
14
|
+
* `onChangeText`, `data-testid` becomes `testID`, and the HTML-attribute
|
|
15
|
+
* passthrough becomes RN `TextInputProps` (which supplies `placeholder`,
|
|
16
|
+
* `keyboardType`, `autoCapitalize`, `secureTextEntry`, ... for free).
|
|
17
|
+
*
|
|
18
|
+
* Deliberately omitted rather than accepted-and-ignored (the `skeleton`
|
|
19
|
+
* precedent — passing them should be a compile error, not a no-op):
|
|
20
|
+
*
|
|
21
|
+
* - `dropdown` — the embedded SingleSelect needs the native Select family.
|
|
22
|
+
* - `helpIconText` — needs a native Tooltip.
|
|
23
|
+
* - The floating-label mode (web floats the label into `lg` inputs on
|
|
24
|
+
* phones) — deferred until the field pattern settles on native.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export type TextInputSlot = {
|
|
28
|
+
slot: React.ReactElement
|
|
29
|
+
maxHeight?: string | number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type TextInputNativeProps = {
|
|
33
|
+
value: string
|
|
34
|
+
onChangeText?: (text: string) => void
|
|
35
|
+
label?: string
|
|
36
|
+
subLabel?: string
|
|
37
|
+
size?: InputSizeV2
|
|
38
|
+
error?: FieldError
|
|
39
|
+
hintText?: string
|
|
40
|
+
required?: boolean
|
|
41
|
+
disabled?: boolean
|
|
42
|
+
leftSlot?: TextInputSlot
|
|
43
|
+
rightSlot?: TextInputSlot
|
|
44
|
+
testID?: string
|
|
45
|
+
/** Screen-reader name; defaults to `label`. */
|
|
46
|
+
accessibilityLabel?: string
|
|
47
|
+
/** Escape hatch for the outer column (label + field + footer). */
|
|
48
|
+
style?: ViewStyle
|
|
49
|
+
/** Ref to the underlying RN TextInput (focus/blur/clear). */
|
|
50
|
+
inputRef?: React.Ref<RNTextInput>
|
|
51
|
+
} & Omit<
|
|
52
|
+
RNTextInputProps,
|
|
53
|
+
'value' | 'onChangeText' | 'style' | 'editable' | 'placeholderTextColor'
|
|
54
|
+
>
|