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,34 @@
|
|
|
1
|
+
import { FOUNDATION_THEME } from '@juspay/blend-design-system/node';
|
|
2
|
+
/**
|
|
3
|
+
* Font-family policy.
|
|
4
|
+
*
|
|
5
|
+
* Web never applies Blend's font tokens — components inherit whatever face the
|
|
6
|
+
* host document loads (`fontFamily: 'inherit'` in the primitives), and the
|
|
7
|
+
* consuming app supplies InterDisplay via `@font-face`. React Native has no
|
|
8
|
+
* inheritance and no `@font-face`, so the provider is the inheritance
|
|
9
|
+
* mechanism: it resolves one family per role and `Text` applies it.
|
|
10
|
+
*
|
|
11
|
+
* Defaults come from the foundation tokens (`font.family`), so out of the box
|
|
12
|
+
* native asks for the same faces the design system names. A consumer that has
|
|
13
|
+
* not loaded those fonts sees the platform fallback (plus a dev warning on
|
|
14
|
+
* iOS) — load them with `expo-font` or native assets, or opt out:
|
|
15
|
+
*
|
|
16
|
+
* - `fontFamily="system"` — platform fonts everywhere, no families applied.
|
|
17
|
+
* - `fontFamily={{ mono: 'JetBrainsMono' }}` — override one role, keep the
|
|
18
|
+
* token defaults for the rest.
|
|
19
|
+
* - `fontFamily={{ body: null }}` — disable one role only.
|
|
20
|
+
*
|
|
21
|
+
* Kept as a leaf module with no `react-native` value import so it stays
|
|
22
|
+
* testable under plain vitest — the same constraint as `theme/breakpoint.ts`.
|
|
23
|
+
*/
|
|
24
|
+
export type NativeFontRole = 'display' | 'body' | 'heading' | 'mono';
|
|
25
|
+
/** One resolved family per role; `null` means "leave the platform font". */
|
|
26
|
+
export type NativeFontFamilies = Record<NativeFontRole, string | null>;
|
|
27
|
+
/** What `BlendNativeProvider` accepts for its `fontFamily` prop. */
|
|
28
|
+
export type NativeFontFamilyOption = 'system' | Partial<Record<NativeFontRole, string | null>>;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the provider's `fontFamily` option against the active foundation
|
|
31
|
+
* tokens. Pure; called once per provider render.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveFontFamilies(foundationTokens?: typeof FOUNDATION_THEME, option?: NativeFontFamilyOption): NativeFontFamilies;
|
|
34
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../../src/theme/fonts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AAEpE,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;AAEtE,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAC5B,QAAQ,GACR,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAA;AAIpD;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,gBAAgB,GAAE,OAAO,gBAAmC,EAC5D,MAAM,CAAC,EAAE,sBAAsB,GAChC,kBAAkB,CAkBpB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FOUNDATION_THEME, Theme, type BreakpointType } from '@juspay/blend-design-system/node';
|
|
2
|
+
/**
|
|
3
|
+
* Slot name → token factory.
|
|
4
|
+
*
|
|
5
|
+
* **This is the only file to edit when adding a component.** Web needs three
|
|
6
|
+
* files changed in lockstep for a new token slot (`context/ThemeContext.tsx`
|
|
7
|
+
* for the type + default, `context/initComponentTokens.ts` for the `??`
|
|
8
|
+
* fallback, `context/useComponentToken.ts` for the union and `switch` case) —
|
|
9
|
+
* and missing one throws at runtime. Native collapses that to a single
|
|
10
|
+
* registry entry, with the slot union derived from the object rather than
|
|
11
|
+
* hand-maintained alongside it.
|
|
12
|
+
*
|
|
13
|
+
* Factories come from `@juspay/blend-design-system/node`, the React-free
|
|
14
|
+
* entry, so registering one pulls in no UI code.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NATIVE_TOKEN_REGISTRY: {
|
|
17
|
+
readonly ALERTV2: (foundationToken: import("@juspay/blend-design-system/node").FoundationTokenType, theme?: Theme | string) => import("@juspay/blend-design-system/node").ResponsiveAlertV2Tokens;
|
|
18
|
+
readonly BUTTONV2: (foundationToken: import("@juspay/blend-design-system/node").FoundationTokenType, theme?: Theme | string) => import("@juspay/blend-design-system/node").ResponsiveButtonV2Tokens;
|
|
19
|
+
readonly SKELETON: (foundationToken: import("@juspay/blend-design-system/node").FoundationTokenType, theme?: Theme | string) => import("@juspay/blend-design-system/node").ResponsiveSkeletonTokens;
|
|
20
|
+
readonly TAGV2: (foundationToken: import("@juspay/blend-design-system/node").FoundationTokenType, theme?: Theme | string) => import("@juspay/blend-design-system/node").ResponsiveTagV2Tokens;
|
|
21
|
+
readonly TEXT_INPUTV2: (foundationToken: import("@juspay/blend-design-system/node").FoundationTokenType, theme?: Theme | string) => import("@juspay/blend-design-system/node").ResponsiveTextInputV2Tokens;
|
|
22
|
+
};
|
|
23
|
+
/** Every component slot native can resolve. Derived, never hand-written. */
|
|
24
|
+
export type NativeTokenSlot = keyof typeof NATIVE_TOKEN_REGISTRY;
|
|
25
|
+
/**
|
|
26
|
+
* A Blend token factory: pure, takes foundation tokens plus a theme, and
|
|
27
|
+
* returns one token object per breakpoint.
|
|
28
|
+
*/
|
|
29
|
+
export type TokenFactory<T> = (foundation: typeof FOUNDATION_THEME, theme?: Theme | string) => Record<keyof BreakpointType, T>;
|
|
30
|
+
/** Overrides accepted by `BlendNativeProvider`, keyed by slot. */
|
|
31
|
+
export type NativeComponentTokenOverrides = Partial<Record<NativeTokenSlot, unknown>>;
|
|
32
|
+
export declare const NATIVE_TOKEN_SLOTS: NativeTokenSlot[];
|
|
33
|
+
export declare function isNativeTokenSlot(value: string): value is NativeTokenSlot;
|
|
34
|
+
//# sourceMappingURL=nativeTokenRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeTokenRegistry.d.ts","sourceRoot":"","sources":["../../../../src/theme/nativeTokenRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,KAAK,EAML,KAAK,cAAc,EACtB,MAAM,kCAAkC,CAAA;AAEzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB;;;;;;CAMxB,CAAA;AAEV,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,qBAAqB,CAAA;AAEhE;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAC1B,UAAU,EAAE,OAAO,gBAAgB,EACnC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,KACrB,MAAM,CAAC,MAAM,cAAc,EAAE,CAAC,CAAC,CAAA;AAEpC,kEAAkE;AAClE,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAC/C,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CACnC,CAAA;AAED,eAAO,MAAM,kBAAkB,EAE1B,eAAe,EAAE,CAAA;AAEtB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,eAAe,CAEzE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Theme } from '@juspay/blend-design-system/node';
|
|
2
|
+
/**
|
|
3
|
+
* `theme="system"` resolution.
|
|
4
|
+
*
|
|
5
|
+
* The provider accepts the sentinel and resolves it against the OS appearance
|
|
6
|
+
* (`useColorScheme`) before the value enters context, so token resolution and
|
|
7
|
+
* every consumer below only ever see a concrete theme.
|
|
8
|
+
*
|
|
9
|
+
* Kept as a leaf module with no `react-native` value import so the mapping is
|
|
10
|
+
* testable under plain vitest; the provider owns the `useColorScheme`
|
|
11
|
+
* subscription.
|
|
12
|
+
*/
|
|
13
|
+
/** Pass as `theme` to follow the OS light/dark setting. */
|
|
14
|
+
export declare const SYSTEM_THEME: "system";
|
|
15
|
+
export type NativeThemeSetting = Theme | string | typeof SYSTEM_THEME;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a theme setting to a concrete theme.
|
|
18
|
+
*
|
|
19
|
+
* `colorScheme` is `useColorScheme()`'s value. Typed as `string` rather than
|
|
20
|
+
* a literal union because RN's `ColorSchemeName` has grown values across
|
|
21
|
+
* versions (`'unspecified'` on some platforms) — anything that is not
|
|
22
|
+
* `'dark'` resolves light, matching the provider's default.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveThemeSetting(theme: NativeThemeSetting, colorScheme: string | null | undefined): Theme | string;
|
|
25
|
+
//# sourceMappingURL=systemTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/systemTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAExD;;;;;;;;;;GAUG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,YAAY,EAAG,QAAiB,CAAA;AAE7C,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,YAAY,CAAA;AAErE;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,kBAAkB,EACzB,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACvC,KAAK,GAAG,MAAM,CAGhB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type BreakpointType } from '@juspay/blend-design-system/node';
|
|
2
|
+
import { resolveBreakpoint, type NativeBreakpoint } from './breakpoint.js';
|
|
3
|
+
export { resolveBreakpoint };
|
|
4
|
+
export type { NativeBreakpoint };
|
|
5
|
+
/**
|
|
6
|
+
* The active breakpoint for the current RN viewport.
|
|
7
|
+
*
|
|
8
|
+
* `useWindowDimensions` is RN's equivalent of web's resize listener — it
|
|
9
|
+
* re-renders on rotation, split-screen, and foldable unfold. The previous
|
|
10
|
+
* implementation hardcoded `'sm'` on the assumption that native is
|
|
11
|
+
* phone-only, which silently gave tablets and landscape the wrong tokens.
|
|
12
|
+
*
|
|
13
|
+
* The width→label mapping itself lives in `./breakpoint`, which imports
|
|
14
|
+
* nothing from `react-native` and is therefore unit-testable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useNativeBreakpoint(breakpoints?: BreakpointType): NativeBreakpoint;
|
|
17
|
+
//# sourceMappingURL=useNativeBreakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNativeBreakpoint.d.ts","sourceRoot":"","sources":["../../../../src/theme/useNativeBreakpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,cAAc,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAc,CAAA;AAEvE,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAC5B,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAEhC;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAC/B,WAAW,GAAE,cAA4B,GAC1C,gBAAgB,CAGlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNativeTokens.d.ts","sourceRoot":"","sources":["../../../../src/theme/useNativeTokens.ts"],"names":[],"mappings":"AAQA,OAAO,EAIH,KAAK,eAAe,EAEvB,MAAM,0BAAuB,CAAA;AAuD9B,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,GAAG,CAAC,CA2B3D;AAED,eAAe,eAAe,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "blend-native",
|
|
3
|
+
"version": "0.0.1-beta.0",
|
|
4
|
+
"description": "React Native components for Blend Design System",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"src",
|
|
11
|
+
"!**/__tests__",
|
|
12
|
+
"!**/*.test.*"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"source": "./src/index.ts",
|
|
18
|
+
"react-native": "./src/index.ts",
|
|
19
|
+
"import": {
|
|
20
|
+
"types": "./lib/typescript/module/index.d.ts",
|
|
21
|
+
"default": "./lib/module/index.js"
|
|
22
|
+
},
|
|
23
|
+
"require": {
|
|
24
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
25
|
+
"default": "./lib/commonjs/index.js"
|
|
26
|
+
},
|
|
27
|
+
"default": "./lib/commonjs/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "bob build",
|
|
32
|
+
"check:peer": "node scripts/check-peer-exports.mjs",
|
|
33
|
+
"clean": "rm -rf lib",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"prepublishOnly": "bob build",
|
|
36
|
+
"test": "vitest run && jest",
|
|
37
|
+
"test:render": "jest",
|
|
38
|
+
"test:unit": "vitest run",
|
|
39
|
+
"test:watch": "vitest",
|
|
40
|
+
"typecheck": "tsc --noEmit"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@juspay/blend-design-system": ">=0.0.38-beta.2",
|
|
44
|
+
"expo-linear-gradient": ">=15.0.0",
|
|
45
|
+
"lucide-react-native": ">=1.0.0",
|
|
46
|
+
"react": ">=18.2.0",
|
|
47
|
+
"react-native": ">=0.74.0",
|
|
48
|
+
"react-native-svg": ">=12.0.0",
|
|
49
|
+
"react-native-reanimated": ">=3.16.0",
|
|
50
|
+
"react-native-gesture-handler": ">=2.20.0",
|
|
51
|
+
"react-native-safe-area-context": ">=4.10.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"expo-linear-gradient": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"react-native-safe-area-context": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@eslint/js": "^9.25.0",
|
|
63
|
+
"@juspay/blend-design-system": "workspace:*",
|
|
64
|
+
"@react-native/jest-preset": "^0.85.3",
|
|
65
|
+
"@testing-library/react-native": "^13.3.3",
|
|
66
|
+
"@types/jest": "^30.0.0",
|
|
67
|
+
"@types/react": "^19.1.17",
|
|
68
|
+
"babel-jest": "29.7.0",
|
|
69
|
+
"eslint": "^9.25.0",
|
|
70
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
71
|
+
"eslint-plugin-import-x": "^4.6.1",
|
|
72
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
73
|
+
"expo-linear-gradient": "~15.0.3",
|
|
74
|
+
"jest": "^29.7.0",
|
|
75
|
+
"lucide-react-native": "^1.33.0",
|
|
76
|
+
"react": "19.2.3",
|
|
77
|
+
"react-native": "0.85.3",
|
|
78
|
+
"react-native-builder-bob": "^0.43.0",
|
|
79
|
+
"react-native-gesture-handler": "2.31.1",
|
|
80
|
+
"react-native-reanimated": "4.3.1",
|
|
81
|
+
"react-native-safe-area-context": "5.7.0",
|
|
82
|
+
"react-native-svg": "15.15.5",
|
|
83
|
+
"react-native-worklets": "0.8.3",
|
|
84
|
+
"react-test-renderer": "19.2.3",
|
|
85
|
+
"test-renderer": "^1.2.0",
|
|
86
|
+
"typescript": "~5.8.3",
|
|
87
|
+
"typescript-eslint": "^8.30.1",
|
|
88
|
+
"vitest": "^3.2.4"
|
|
89
|
+
},
|
|
90
|
+
"keywords": [
|
|
91
|
+
"react-native",
|
|
92
|
+
"blend",
|
|
93
|
+
"design-system",
|
|
94
|
+
"juspay",
|
|
95
|
+
"ui"
|
|
96
|
+
],
|
|
97
|
+
"author": "Juspay",
|
|
98
|
+
"license": "MIT",
|
|
99
|
+
"homepage": "https://blend.juspay.design/",
|
|
100
|
+
"repository": {
|
|
101
|
+
"type": "git",
|
|
102
|
+
"url": "https://github.com/juspay/blend-design-system.git"
|
|
103
|
+
},
|
|
104
|
+
"bugs": {
|
|
105
|
+
"url": "https://github.com/juspay/blend-design-system/issues"
|
|
106
|
+
},
|
|
107
|
+
"publishConfig": {
|
|
108
|
+
"access": "public"
|
|
109
|
+
},
|
|
110
|
+
"packageManager": "pnpm@10.21.0",
|
|
111
|
+
"module": "./lib/module/index.js",
|
|
112
|
+
"source": "./src/index.ts",
|
|
113
|
+
"react-native-builder-bob": {
|
|
114
|
+
"source": "src",
|
|
115
|
+
"output": "lib",
|
|
116
|
+
"targets": [
|
|
117
|
+
[
|
|
118
|
+
"commonjs",
|
|
119
|
+
{
|
|
120
|
+
"esm": true
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
[
|
|
124
|
+
"module",
|
|
125
|
+
{
|
|
126
|
+
"esm": true
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
"typescript",
|
|
131
|
+
{
|
|
132
|
+
"project": "tsconfig.build.json"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live-region message construction.
|
|
3
|
+
*
|
|
4
|
+
* Kept RN-free so it stays unit-testable outside a renderer — the same split
|
|
5
|
+
* as `theme/breakpoint.ts` and `primitives/touchTarget.ts`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Compose the sentence a screen reader should announce for a status surface.
|
|
10
|
+
*
|
|
11
|
+
* Web relies on `aria-atomic="true"` to have the whole region re-read when any
|
|
12
|
+
* part changes, so the announcement is heading and description together. iOS
|
|
13
|
+
* has no live-region concept at all and must be told the exact string, so it
|
|
14
|
+
* is built here rather than left to the platform.
|
|
15
|
+
*
|
|
16
|
+
* Returns `undefined` when there is nothing worth announcing, so callers can
|
|
17
|
+
* skip the announcement entirely instead of interrupting the user with silence.
|
|
18
|
+
*
|
|
19
|
+
* ```
|
|
20
|
+
* buildAnnouncement('Saved', 'Your changes are live') -> 'Saved. Your changes are live'
|
|
21
|
+
* buildAnnouncement('Saved', undefined) -> 'Saved'
|
|
22
|
+
* buildAnnouncement(undefined, 'Your changes are live')-> 'Your changes are live'
|
|
23
|
+
* buildAnnouncement(undefined, undefined) -> undefined
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function buildAnnouncement(
|
|
27
|
+
heading?: string,
|
|
28
|
+
description?: string
|
|
29
|
+
): string | undefined {
|
|
30
|
+
const parts = [heading, description]
|
|
31
|
+
.map((part) => part?.trim())
|
|
32
|
+
.filter((part): part is string => Boolean(part))
|
|
33
|
+
|
|
34
|
+
if (parts.length === 0) return undefined
|
|
35
|
+
if (parts.length === 1) return parts[0]
|
|
36
|
+
|
|
37
|
+
// Punctuate between the two so the reader pauses rather than running the
|
|
38
|
+
// heading into the description as one sentence.
|
|
39
|
+
const [head, rest] = parts
|
|
40
|
+
return /[.!?:]$/.test(head) ? `${head} ${rest}` : `${head}. ${rest}`
|
|
41
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react'
|
|
2
|
+
import { AccessibilityInfo, Platform } from 'react-native'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Announce a status message to assistive tech.
|
|
6
|
+
*
|
|
7
|
+
* Web expresses this declaratively with `aria-live` + `aria-atomic`. React
|
|
8
|
+
* Native splits it across platforms:
|
|
9
|
+
*
|
|
10
|
+
* - **Android** understands `accessibilityLiveRegion` on the view itself, so
|
|
11
|
+
* callers set that prop directly and this hook stays out of the way.
|
|
12
|
+
* - **iOS** has no live-region support. The only route is to hand the exact
|
|
13
|
+
* string to `announceForAccessibility`, which is what this does.
|
|
14
|
+
*
|
|
15
|
+
* Re-announces when the message changes, and skips repeats of the same string
|
|
16
|
+
* so a parent re-render does not interrupt the user twice with the same text.
|
|
17
|
+
*/
|
|
18
|
+
export function useLiveRegionAnnounce(
|
|
19
|
+
message: string | undefined,
|
|
20
|
+
enabled = true
|
|
21
|
+
): void {
|
|
22
|
+
const lastAnnounced = useRef<string | undefined>(undefined)
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!enabled || !message) return
|
|
26
|
+
// Android already announces via accessibilityLiveRegion; announcing
|
|
27
|
+
// again here would read the alert twice.
|
|
28
|
+
if (Platform.OS !== 'ios') return
|
|
29
|
+
if (lastAnnounced.current === message) return
|
|
30
|
+
|
|
31
|
+
lastAnnounced.current = message
|
|
32
|
+
AccessibilityInfo.announceForAccessibility(message)
|
|
33
|
+
}, [message, enabled])
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default useLiveRegionAnnounce
|