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,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _node = require("@juspay/blend-design-system/node");
|
|
9
|
+
var _useNativeTokens = require("../../theme/useNativeTokens.js");
|
|
10
|
+
var _Block = require("../../primitives/Block.js");
|
|
11
|
+
var _Separator = require("../../primitives/Separator.js");
|
|
12
|
+
var _Slot = require("../../primitives/Slot.js");
|
|
13
|
+
var _announcement = require("../../a11y/announcement.js");
|
|
14
|
+
var _useLiveRegion = require("../../a11y/useLiveRegion.js");
|
|
15
|
+
var _AlertActions = require("./AlertActions.js");
|
|
16
|
+
var _AlertClose = require("./AlertClose.js");
|
|
17
|
+
var _AlertText = require("./AlertText.js");
|
|
18
|
+
var _alertUtils = require("./alert.utils.js");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
/**
|
|
21
|
+
* Alert — React Native implementation of web's `AlertV2`.
|
|
22
|
+
*
|
|
23
|
+
* Tokens resolve through `useNativeTokens('ALERTV2')`, so theme and per-slot
|
|
24
|
+
* overrides come from `BlendNativeProvider`.
|
|
25
|
+
*
|
|
26
|
+
* AlertV2's tokens contain no gradients, so this needs no native module beyond
|
|
27
|
+
* the icon set.
|
|
28
|
+
*/
|
|
29
|
+
const Alert = /*#__PURE__*/(0, _react.forwardRef)(function Alert({
|
|
30
|
+
type = _node.AlertV2Type.PRIMARY,
|
|
31
|
+
subType = _node.AlertV2SubType.SUBTLE,
|
|
32
|
+
slot,
|
|
33
|
+
heading,
|
|
34
|
+
description,
|
|
35
|
+
actions,
|
|
36
|
+
closeButton = {
|
|
37
|
+
show: true
|
|
38
|
+
},
|
|
39
|
+
width,
|
|
40
|
+
maxWidth,
|
|
41
|
+
minWidth,
|
|
42
|
+
announce = true,
|
|
43
|
+
accessibilityLabel,
|
|
44
|
+
testID,
|
|
45
|
+
style
|
|
46
|
+
}, ref) {
|
|
47
|
+
const tokens = (0, _useNativeTokens.useNativeTokens)('ALERTV2');
|
|
48
|
+
const position = actions?.position ?? _node.AlertV2ActionPosition.BOTTOM;
|
|
49
|
+
const layout = (0, _react.useMemo)(() => (0, _alertUtils.getAlertLayout)(position), [position]);
|
|
50
|
+
const closeShown = Boolean(closeButton?.show);
|
|
51
|
+
const showSeparator = (0, _alertUtils.shouldShowSeparator)(position, closeShown);
|
|
52
|
+
|
|
53
|
+
// Web hard-codes `aria-live="assertive"` + `aria-atomic`. Android reads the
|
|
54
|
+
// region itself via `accessibilityLiveRegion`; iOS has no live-region
|
|
55
|
+
// support, so the composed sentence is announced imperatively.
|
|
56
|
+
const announcement = (0, _react.useMemo)(() => (0, _announcement.buildAnnouncement)(heading, description), [heading, description]);
|
|
57
|
+
(0, _useLiveRegion.useLiveRegionAnnounce)(announcement, announce);
|
|
58
|
+
const hasText = Boolean(heading || description);
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Block.Block, {
|
|
60
|
+
ref: ref,
|
|
61
|
+
testID: testID
|
|
62
|
+
// NOTE: `accessible` is deliberately NOT set here.
|
|
63
|
+
//
|
|
64
|
+
// In RN, marking a View as an accessibility element "groups its
|
|
65
|
+
// children into a single selectable component" — which on iOS makes
|
|
66
|
+
// the action links and the close button individually unreachable by
|
|
67
|
+
// VoiceOver. Web has no such problem: `role="alert"` does not affect
|
|
68
|
+
// whether nested buttons can be focused.
|
|
69
|
+
//
|
|
70
|
+
// `accessibilityRole="alert"` conveys the semantic without
|
|
71
|
+
// collapsing the subtree, and each child keeps its own label.
|
|
72
|
+
,
|
|
73
|
+
accessibilityRole: "alert",
|
|
74
|
+
accessibilityLabel: accessibilityLabel,
|
|
75
|
+
accessibilityLiveRegion: announce ? 'assertive' : 'none',
|
|
76
|
+
flexDirection: "row",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
width: width ?? tokens.width,
|
|
79
|
+
maxWidth: maxWidth ?? tokens.maxWidth,
|
|
80
|
+
minWidth: minWidth ?? tokens.minWidth,
|
|
81
|
+
border: String(tokens.border[type][subType]),
|
|
82
|
+
borderRadius: tokens.borderRadius,
|
|
83
|
+
backgroundColor: String(tokens.backgroundColor[type][subType]),
|
|
84
|
+
paddingTop: tokens.padding.top,
|
|
85
|
+
paddingBottom: tokens.padding.bottom,
|
|
86
|
+
paddingLeft: tokens.padding.left,
|
|
87
|
+
paddingRight: tokens.padding.right,
|
|
88
|
+
gap: tokens.gap[position],
|
|
89
|
+
style: style,
|
|
90
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Block.Block, {
|
|
91
|
+
..._alertUtils.ALERT_FLEX_BOX,
|
|
92
|
+
flexDirection: "row",
|
|
93
|
+
gap: tokens.mainContainer.gap,
|
|
94
|
+
children: [slot?.slot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Slot.Slot, {
|
|
95
|
+
maxHeight: slot.maxHeight ?? tokens.slot.maxHeight,
|
|
96
|
+
hidden: hasText,
|
|
97
|
+
testID: testID ? `${testID}-slot` : undefined,
|
|
98
|
+
children: slot.slot
|
|
99
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Block.Block, {
|
|
100
|
+
..._alertUtils.ALERT_FLEX_BOX,
|
|
101
|
+
flexDirection: layout.contentDirection,
|
|
102
|
+
justifyContent: layout.contentJustify,
|
|
103
|
+
alignItems: layout.contentAlign,
|
|
104
|
+
gap: tokens.mainContainer.content.gap[position],
|
|
105
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AlertText.AlertText, {
|
|
106
|
+
heading: heading,
|
|
107
|
+
description: description,
|
|
108
|
+
type: type,
|
|
109
|
+
tokens: tokens.mainContainer.content.textContainer
|
|
110
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AlertActions.AlertActions, {
|
|
111
|
+
actions: actions,
|
|
112
|
+
type: type,
|
|
113
|
+
tokens: tokens.mainContainer.content.actionContainer,
|
|
114
|
+
testID: testID
|
|
115
|
+
})]
|
|
116
|
+
})]
|
|
117
|
+
}), showSeparator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Separator.Separator, {
|
|
118
|
+
testID: testID ? `${testID}-separator` : undefined
|
|
119
|
+
}) : null, closeShown ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_AlertClose.AlertClose, {
|
|
120
|
+
closeButton: closeButton,
|
|
121
|
+
color: String(tokens.mainContainer.closeButton.color[type]),
|
|
122
|
+
size: (0, _alertUtils.getCloseIconSize)(tokens),
|
|
123
|
+
alignSelf: layout.closeAlign,
|
|
124
|
+
testID: testID ? `${testID}-close` : undefined
|
|
125
|
+
}) : null]
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
Alert.displayName = 'Alert';
|
|
129
|
+
var _default = exports.default = Alert;
|
|
130
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_node","_useNativeTokens","_Block","_Separator","_Slot","_announcement","_useLiveRegion","_AlertActions","_AlertClose","_AlertText","_alertUtils","_jsxRuntime","Alert","forwardRef","type","AlertV2Type","PRIMARY","subType","AlertV2SubType","SUBTLE","slot","heading","description","actions","closeButton","show","width","maxWidth","minWidth","announce","accessibilityLabel","testID","style","ref","tokens","useNativeTokens","position","AlertV2ActionPosition","BOTTOM","layout","useMemo","getAlertLayout","closeShown","Boolean","showSeparator","shouldShowSeparator","announcement","buildAnnouncement","useLiveRegionAnnounce","hasText","jsxs","Block","accessibilityRole","accessibilityLiveRegion","flexDirection","alignItems","border","String","borderRadius","backgroundColor","paddingTop","padding","top","paddingBottom","bottom","paddingLeft","left","paddingRight","right","gap","children","ALERT_FLEX_BOX","mainContainer","jsx","Slot","maxHeight","hidden","undefined","contentDirection","justifyContent","contentJustify","contentAlign","content","AlertText","textContainer","AlertActions","actionContainer","Separator","AlertClose","color","size","getCloseIconSize","alignSelf","closeAlign","displayName","_default","exports","default"],"sourceRoot":"../../../../src","sources":["components/Alert/Alert.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA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,UAAA,CAAAoF,SAAS;MACNxD,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,YAAY,GAAG8C;IAAU,CACtD,CAAC,GACF,IAAI,EAEPnC,UAAU,gBACP,IAAA/B,WAAA,CAAA8D,GAAA,EAACjE,WAAA,CAAAgF,UAAU;MACPhE,WAAW,EAAEA,WAAY;MACzBiE,KAAK,EAAEhC,MAAM,CAACvB,MAAM,CAACsC,aAAa,CAAChD,WAAW,CAACiE,KAAK,CAAC3E,IAAI,CAAC,CAAE;MAC5D4E,IAAI,EAAE,IAAAC,4BAAgB,EAACzD,MAAM,CAAE;MAC/B0D,SAAS,EAAErD,MAAM,CAACsD,UAAW;MAC7B9D,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,QAAQ,GAAG8C;IAAU,CAClD,CAAC,GACF,IAAI;EAAA,CACL,CAAC;AAEhB,CAAC,CAAC;AAEFjE,KAAK,CAACkF,WAAW,GAAG,OAAO;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEZrF,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AlertActions = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _Block = require("../../primitives/Block.js");
|
|
9
|
+
var _Pressable = require("../../primitives/Pressable.js");
|
|
10
|
+
var _Text = require("../../primitives/Text.js");
|
|
11
|
+
var _alertUtils = require("./alert.utils.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* `Alert`'s action row.
|
|
15
|
+
*
|
|
16
|
+
* These are **text links**, not `Button`s: web renders them as a bare
|
|
17
|
+
* `PrimitiveButton` with no border or background, so native composes
|
|
18
|
+
* `Pressable` + `Text` rather than reusing the `Button` component.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
function ActionLink({
|
|
22
|
+
action,
|
|
23
|
+
type,
|
|
24
|
+
tokens,
|
|
25
|
+
testID
|
|
26
|
+
}) {
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.Pressable, {
|
|
28
|
+
onPress: action.onPress,
|
|
29
|
+
accessibilityRole: "button",
|
|
30
|
+
accessibilityLabel: (0, _alertUtils.getActionAccessibilityLabel)(action.text, action.accessibilityLabel),
|
|
31
|
+
testID: testID,
|
|
32
|
+
alignSelf: "flex-start",
|
|
33
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
34
|
+
fontSize: tokens.fontSize,
|
|
35
|
+
fontWeight: tokens.fontWeight,
|
|
36
|
+
lineHeight: tokens.lineHeight,
|
|
37
|
+
color: String(tokens.color[type])
|
|
38
|
+
// Web sets `white-space: nowrap`; the RN equivalent is a single
|
|
39
|
+
// line. `tail` makes an over-long label visibly truncated rather
|
|
40
|
+
// than silently clipped.
|
|
41
|
+
,
|
|
42
|
+
numberOfLines: 1,
|
|
43
|
+
ellipsizeMode: "tail",
|
|
44
|
+
children: action.text
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function AlertActionsImpl({
|
|
49
|
+
actions,
|
|
50
|
+
type,
|
|
51
|
+
tokens,
|
|
52
|
+
testID
|
|
53
|
+
}) {
|
|
54
|
+
if (!actions?.primaryAction && !actions?.secondaryAction) return null;
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Block.Block, {
|
|
56
|
+
flexDirection: "row",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
gap: tokens.gap,
|
|
59
|
+
children: [actions.primaryAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionLink, {
|
|
60
|
+
action: actions.primaryAction,
|
|
61
|
+
type: type,
|
|
62
|
+
tokens: tokens.primaryAction,
|
|
63
|
+
testID: testID ? `${testID}-primary-action` : undefined
|
|
64
|
+
}) : null, actions.secondaryAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionLink, {
|
|
65
|
+
action: actions.secondaryAction,
|
|
66
|
+
type: type,
|
|
67
|
+
tokens: tokens.secondaryAction,
|
|
68
|
+
testID: testID ? `${testID}-secondary-action` : undefined
|
|
69
|
+
}) : null]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const AlertActions = exports.AlertActions = /*#__PURE__*/(0, _react.memo)(AlertActionsImpl);
|
|
73
|
+
AlertActions.displayName = 'AlertActions';
|
|
74
|
+
//# sourceMappingURL=AlertActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_Block","_Pressable","_Text","_alertUtils","_jsxRuntime","ActionLink","action","type","tokens","testID","jsx","Pressable","onPress","accessibilityRole","accessibilityLabel","getActionAccessibilityLabel","text","alignSelf","children","Text","fontSize","fontWeight","lineHeight","color","String","numberOfLines","ellipsizeMode","AlertActionsImpl","actions","primaryAction","secondaryAction","jsxs","Block","flexDirection","alignItems","gap","undefined","AlertActions","exports","memo","displayName"],"sourceRoot":"../../../../src","sources":["components/Alert/AlertActions.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAA2D,IAAAK,WAAA,GAAAL,OAAA;AAU3D;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASM,UAAUA,CAAC;EAAEC,MAAM;EAAEC,IAAI;EAAEC,MAAM;EAAEC;AAAwB,CAAC,EAAE;EACnE,oBACI,IAAAL,WAAA,CAAAM,GAAA,EAACT,UAAA,CAAAU,SAAS;IACNC,OAAO,EAAEN,MAAM,CAACM,OAAQ;IACxBC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAE,IAAAC,uCAA2B,EAC3CT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ACE,eAAgB;MAChCvB,IAAI,EAAEA,IAAK;MACXC,MAAM,EAAEA,MAAM,CAACsB,eAAgB;MAC/BrB,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,mBAAmB,GAAG2B;IAAU,CAC7D,CAAC,GACF,IAAI;EAAA,CACL,CAAC;AAEhB;AAEO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,WAAI,EAACZ,gBAAgB,CAAC;AAClDU,YAAY,CAACG,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AlertClose = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _lucideReactNative = require("lucide-react-native");
|
|
9
|
+
var _Pressable = require("../../primitives/Pressable.js");
|
|
10
|
+
var _Slot = require("../../primitives/Slot.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* `Alert`'s close affordance.
|
|
14
|
+
*
|
|
15
|
+
* Renders lucide's `X` by default; a consumer icon supplied via
|
|
16
|
+
* `closeButton.icon` goes through `Slot` so it is tinted the same way.
|
|
17
|
+
*
|
|
18
|
+
* The control is smaller than the 44pt minimum tap target, so it relies on the
|
|
19
|
+
* `hitSlop` `Pressable` applies automatically.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
function AlertCloseImpl({
|
|
23
|
+
closeButton,
|
|
24
|
+
color,
|
|
25
|
+
size,
|
|
26
|
+
alignSelf,
|
|
27
|
+
testID
|
|
28
|
+
}) {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.Pressable, {
|
|
30
|
+
onPress: closeButton.onPress,
|
|
31
|
+
accessibilityRole: "button",
|
|
32
|
+
accessibilityLabel: closeButton.accessibilityLabel ?? 'Close',
|
|
33
|
+
testID: testID,
|
|
34
|
+
alignSelf: alignSelf,
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
children: closeButton.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Slot.Slot, {
|
|
38
|
+
color: color,
|
|
39
|
+
children: closeButton.icon
|
|
40
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.X, {
|
|
41
|
+
size: size,
|
|
42
|
+
color: color
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const AlertClose = exports.AlertClose = /*#__PURE__*/(0, _react.memo)(AlertCloseImpl);
|
|
47
|
+
AlertClose.displayName = 'AlertClose';
|
|
48
|
+
//# sourceMappingURL=AlertClose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_lucideReactNative","_Pressable","_Slot","_jsxRuntime","AlertCloseImpl","closeButton","color","size","alignSelf","testID","jsx","Pressable","onPress","accessibilityRole","accessibilityLabel","alignItems","justifyContent","children","icon","Slot","X","AlertClose","exports","memo","displayName"],"sourceRoot":"../../../../src","sources":["components/Alert/AlertClose.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAA4C,IAAAI,WAAA,GAAAJ,OAAA;AAG5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASK,cAAcA,CAAC;EACpBC,WAAW;EACXC,KAAK;EACLC,IAAI;EACJC,SAAS;EACTC;AACa,CAAC,EAAE;EAChB,oBACI,IAAAN,WAAA,CAAAO,GAAA,EAACT,UAAA,CAAAU,SAAS;IACNC,OAAO,EAAEP,WAAW,CAACO,OAAQ;IAC7BC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAET,WAAW,CAACS,kBAAkB,IAAI,OAAQ;IAC9DL,MAAM,EAAEA,MAAO;IACfD,SAAS,EAAEA,SAAU;IACrBO,UAAU,EAAC,QAAQ;IACnBC,cAAc,EAAC,QAAQ;IAAAC,QAAA,EAEtBZ,WAAW,CAACa,IAAI,gBACb,IAAAf,WAAA,CAAAO,GAAA,EAACR,KAAA,CAAAiB,IAAI;MAACb,KAAK,EAAEA,KAAM;MAAAW,QAAA,EAAEZ,WAAW,CAACa;IAAI,CAAO,CAAC,gBAE7C,IAAAf,WAAA,CAAAO,GAAA,EAACV,kBAAA,CAAAoB,CAAC;MAACb,IAAI,EAAEA,IAAK;MAACD,KAAK,EAAEA;IAAM,CAAE;EACjC,CACM,CAAC;AAEpB;AAEO,MAAMe,UAAU,GAAAC,OAAA,CAAAD,UAAA,gBAAG,IAAAE,WAAI,EAACnB,cAAc,CAAC;AAC9CiB,UAAU,CAACG,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AlertText = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _Block = require("../../primitives/Block.js");
|
|
9
|
+
var _Text = require("../../primitives/Text.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* The heading and description block of an `Alert`.
|
|
13
|
+
*
|
|
14
|
+
* `flexShrink` is explicit because Yoga defaults it to 0 where CSS defaults it
|
|
15
|
+
* to 1 — without it this box sizes to its text and a long description runs off
|
|
16
|
+
* the edge instead of wrapping.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function AlertTextImpl({
|
|
20
|
+
heading,
|
|
21
|
+
description,
|
|
22
|
+
type,
|
|
23
|
+
tokens
|
|
24
|
+
}) {
|
|
25
|
+
if (!heading && !description) return null;
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Block.Block, {
|
|
27
|
+
flexGrow: 1,
|
|
28
|
+
flexShrink: 1,
|
|
29
|
+
flexDirection: "column",
|
|
30
|
+
gap: tokens.gap,
|
|
31
|
+
children: [heading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
32
|
+
accessibilityRole: "header",
|
|
33
|
+
fontSize: tokens.heading.fontSize,
|
|
34
|
+
fontWeight: tokens.heading.fontWeight,
|
|
35
|
+
lineHeight: tokens.heading.lineHeight,
|
|
36
|
+
color: String(tokens.heading.color[type]),
|
|
37
|
+
children: heading
|
|
38
|
+
}) : null, description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
39
|
+
fontSize: tokens.description.fontSize,
|
|
40
|
+
fontWeight: tokens.description.fontWeight,
|
|
41
|
+
lineHeight: tokens.description.lineHeight,
|
|
42
|
+
color: String(tokens.description.color[type]),
|
|
43
|
+
children: description
|
|
44
|
+
}) : null]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const AlertText = exports.AlertText = /*#__PURE__*/(0, _react.memo)(AlertTextImpl);
|
|
48
|
+
AlertText.displayName = 'AlertText';
|
|
49
|
+
//# sourceMappingURL=AlertText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_Block","_Text","_jsxRuntime","AlertTextImpl","heading","description","type","tokens","jsxs","Block","flexGrow","flexShrink","flexDirection","gap","children","jsx","Text","accessibilityRole","fontSize","fontWeight","lineHeight","color","String","AlertText","exports","memo","displayName"],"sourceRoot":"../../../../src","sources":["components/Alert/AlertText.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA4C,IAAAG,WAAA,GAAAH,OAAA;AAG5C;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASI,aAAaA,CAAC;EAAEC,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|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Alert/alert.tokens.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Alert/alert.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FALLBACK_CLOSE_ICON_SIZE = exports.ALERT_FLEX_BOX = void 0;
|
|
7
|
+
exports.getActionAccessibilityLabel = getActionAccessibilityLabel;
|
|
8
|
+
exports.getAlertLayout = getAlertLayout;
|
|
9
|
+
exports.getCloseIconSize = getCloseIconSize;
|
|
10
|
+
exports.shouldShowSeparator = shouldShowSeparator;
|
|
11
|
+
var _node = require("@juspay/blend-design-system/node");
|
|
12
|
+
/**
|
|
13
|
+
* Native Alert layout helpers.
|
|
14
|
+
*
|
|
15
|
+
* Web computes these inline in the JSX of `AlertV2.tsx`. Pulling them out
|
|
16
|
+
* makes the branching testable, and keeps the component readable given that
|
|
17
|
+
* one prop reshapes four layout values at once.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Flex sizing shared by every box in Alert's row chain.
|
|
22
|
+
*
|
|
23
|
+
* `flexShrink` is explicit because **Yoga defaults it to 0 where CSS defaults
|
|
24
|
+
* it to 1**. Without it a flex child sizes to its content and refuses to
|
|
25
|
+
* narrow, so a long description runs off the right edge instead of wrapping.
|
|
26
|
+
*
|
|
27
|
+
* Exported as a constant rather than repeated inline so the invariant has one
|
|
28
|
+
* definition and can be asserted directly in tests.
|
|
29
|
+
*/
|
|
30
|
+
const ALERT_FLEX_BOX = exports.ALERT_FLEX_BOX = {
|
|
31
|
+
flexGrow: 1,
|
|
32
|
+
flexShrink: 1
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Fallback icon size when the close-button token cannot be parsed. */
|
|
36
|
+
const FALLBACK_CLOSE_ICON_SIZE = exports.FALLBACK_CLOSE_ICON_SIZE = 16;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the layout for an action position.
|
|
39
|
+
*
|
|
40
|
+
* `BOTTOM` stacks the actions beneath the text and pins the close button to
|
|
41
|
+
* the top; `RIGHT` runs everything on one line, vertically centred. Mirrors
|
|
42
|
+
* the `actionPlacementBottom` branches in web `AlertV2.tsx`.
|
|
43
|
+
*/
|
|
44
|
+
function getAlertLayout(position) {
|
|
45
|
+
const isBottom = position === _node.AlertV2ActionPosition.BOTTOM;
|
|
46
|
+
return {
|
|
47
|
+
contentDirection: isBottom ? 'column' : 'row',
|
|
48
|
+
contentJustify: isBottom ? 'space-between' : 'flex-start',
|
|
49
|
+
contentAlign: isBottom ? 'flex-start' : 'center',
|
|
50
|
+
closeAlign: isBottom ? 'flex-start' : 'center'
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Whether to render the divider between the actions and the close button.
|
|
56
|
+
*
|
|
57
|
+
* Web's condition is `position === RIGHT && closeButton.show` — the separator
|
|
58
|
+
* only makes sense when both sit on the same line. Extracted because the
|
|
59
|
+
* two-term condition is easy to get subtly wrong, and it has a truth table
|
|
60
|
+
* in the tests.
|
|
61
|
+
*/
|
|
62
|
+
function shouldShowSeparator(position, closeButtonShown) {
|
|
63
|
+
return position === _node.AlertV2ActionPosition.RIGHT && closeButtonShown;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Resolve the accessible name for an action.
|
|
68
|
+
* Mirrors web's `aria-label={`${action.text} action`}`.
|
|
69
|
+
*/
|
|
70
|
+
function getActionAccessibilityLabel(text, override) {
|
|
71
|
+
return override ?? `${text} action`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Numeric size for the close icon, from the same token web uses. */
|
|
75
|
+
function getCloseIconSize(tokens) {
|
|
76
|
+
const raw = tokens.mainContainer.closeButton.height;
|
|
77
|
+
const parsed = typeof raw === 'number' ? raw : Number.parseFloat(String(raw));
|
|
78
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : FALLBACK_CLOSE_ICON_SIZE;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=alert.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_node","require","ALERT_FLEX_BOX","exports","flexGrow","flexShrink","FALLBACK_CLOSE_ICON_SIZE","getAlertLayout","position","isBottom","AlertV2ActionPosition","BOTTOM","contentDirection","contentJustify","contentAlign","closeAlign","shouldShowSeparator","closeButtonShown","RIGHT","getActionAccessibilityLabel","text","override","getCloseIconSize","tokens","raw","mainContainer","closeButton","height","parsed","Number","parseFloat","String","isFinite"],"sourceRoot":"../../../../src","sources":["components/Alert/alert.utils.ts"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1BE,QAAQ,EAAE,CAAC;EACXC,UAAU,EAAE;AAChB,CAAU;;AAEV;AACO,MAAMC,wBAAwB,GAAAH,OAAA,CAAAG,wBAAA,GAAG,EAAE;AAW1C;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,QAA+B,EAAe;EACzE,MAAMC,QAAQ,GAAGD,QAAQ,KAAKE,2BAAqB,CAACC,MAAM;EAE1D,OAAO;IACHC,gBAAgB,EAAEH,QAAQ,GAAG,QAAQ,GAAG,KAAK;IAC7CI,cAAc,EAAEJ,QAAQ,GAAG,eAAe,GAAG,YAAY;IACzDK,YAAY,EAAEL,QAAQ,GAAG,YAAY,GAAG,QAAQ;IAChDM,UAAU,EAAEN,QAAQ,GAAG,YAAY,GAAG;EAC1C,CAAC;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,mBAAmBA,CAC/BR,QAA+B,EAC/BS,gBAAyB,EAClB;EACP,OAAOT,QAAQ,KAAKE,2BAAqB,CAACQ,KAAK,IAAID,gBAAgB;AACvE;;AAEA;AACA;AACA;AACA;AACO,SAASE,2BAA2BA,CACvCC,IAAY,EACZC,QAAiB,EACX;EACN,OAAOA,QAAQ,IAAI,GAAGD,IAAI,SAAS;AACvC;;AAEA;AACO,SAASE,gBAAgBA,CAACC,MAAyB,EAAU;EAChE,MAAMC,GAAG,GAAGD,MAAM,CAACE,aAAa,CAACC,WAAW,CAACC,MAAM;EACnD,MAAMC,MAAM,GACR,OAAOJ,GAAG,KAAK,QAAQ,GAAGA,GAAG,GAAGK,MAAM,CAACC,UAAU,CAACC,MAAM,CAACP,GAAG,CAAC,CAAC;EAClE,OAAOK,MAAM,CAACG,QAAQ,CAACJ,MAAM,CAAC,IAAIA,MAAM,GAAG,CAAC,GACtCA,MAAM,GACNtB,wBAAwB;AAClC","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ALERT_FLEX_BOX", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _alertUtils.ALERT_FLEX_BOX;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Alert", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Alert.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "FALLBACK_CLOSE_ICON_SIZE", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _alertUtils.FALLBACK_CLOSE_ICON_SIZE;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "getActionAccessibilityLabel", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _alertUtils.getActionAccessibilityLabel;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getAlertLayout", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _alertUtils.getAlertLayout;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "getCloseIconSize", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _alertUtils.getCloseIconSize;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "shouldShowSeparator", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _alertUtils.shouldShowSeparator;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var _Alert = _interopRequireDefault(require("./Alert.js"));
|
|
49
|
+
var _alertUtils = require("./alert.utils.js");
|
|
50
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_Alert","_interopRequireDefault","require","_alertUtils","e","__esModule","default"],"sourceRoot":"../../../../src","sources":["components/Alert/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAQA,IAAAC,WAAA,GAAAD,OAAA;AAKsB,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _node = require("@juspay/blend-design-system/node");
|
|
9
|
+
var _useNativeTokens = require("../../theme/useNativeTokens.js");
|
|
10
|
+
var _Pressable = require("../../primitives/Pressable.js");
|
|
11
|
+
var _Slot = require("../../primitives/Slot.js");
|
|
12
|
+
var _Text = require("../../primitives/Text.js");
|
|
13
|
+
var _buttonUtils = require("./button.utils.js");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* Button — React Native implementation of web's `ButtonV2`.
|
|
17
|
+
*
|
|
18
|
+
* Imports only from `@juspay/blend-design-system/node` (the React-free token
|
|
19
|
+
* entry), the local adapters, and the local primitives — never from web's
|
|
20
|
+
* `context/`, `hooks/`, or `Primitives/` directories.
|
|
21
|
+
*
|
|
22
|
+
* Tokens resolve through `useNativeTokens('BUTTONV2')`, which reads theme and
|
|
23
|
+
* per-slot overrides from `BlendNativeProvider`. This replaces the earlier
|
|
24
|
+
* per-component `theme` prop, which offered no app-wide dark mode, no nested
|
|
25
|
+
* theme scopes, and no `componentTokens` overrides.
|
|
26
|
+
*/
|
|
27
|
+
const Button = /*#__PURE__*/(0, _react.forwardRef)(function Button({
|
|
28
|
+
buttonType = _node.ButtonV2Type.PRIMARY,
|
|
29
|
+
size = _node.ButtonV2Size.SMALL,
|
|
30
|
+
subType = _node.ButtonV2SubType.DEFAULT,
|
|
31
|
+
text,
|
|
32
|
+
leftSlot,
|
|
33
|
+
rightSlot,
|
|
34
|
+
loading = false,
|
|
35
|
+
disabled = false,
|
|
36
|
+
state = _node.ButtonV2State.DEFAULT,
|
|
37
|
+
buttonGroupPosition,
|
|
38
|
+
width,
|
|
39
|
+
minWidth,
|
|
40
|
+
maxWidth,
|
|
41
|
+
justifyContent = 'center',
|
|
42
|
+
onPress,
|
|
43
|
+
testID,
|
|
44
|
+
accessibilityLabel,
|
|
45
|
+
style,
|
|
46
|
+
...rest
|
|
47
|
+
}, ref) {
|
|
48
|
+
const tokens = (0, _useNativeTokens.useNativeTokens)('BUTTONV2');
|
|
49
|
+
const styles = (0, _react.useMemo)(() => (0, _buttonUtils.getButtonNativeStyles)(disabled, buttonType, subType, size, state, tokens, buttonGroupPosition), [disabled, buttonType, subType, size, state, tokens, buttonGroupPosition]);
|
|
50
|
+
const iconMaxHeights = (0, _buttonUtils.getIconMaxHeight)(subType, leftSlot?.maxHeight, rightSlot?.maxHeight, tokens.slotMaxHeight[size]);
|
|
51
|
+
|
|
52
|
+
// Icon colour tracks the resolved text colour for the current state, and
|
|
53
|
+
// is handed to the icon element explicitly by `Slot` — RN has no
|
|
54
|
+
// `currentColor` inheritance the way web's `Block` relies on.
|
|
55
|
+
const iconColor = styles.textColor;
|
|
56
|
+
const loaderColor = String(tokens.text.color[buttonType][subType].default ?? '#2563EB');
|
|
57
|
+
const content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
58
|
+
children: [leftSlot?.slot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Slot.Slot, {
|
|
59
|
+
color: iconColor,
|
|
60
|
+
maxHeight: iconMaxHeights.left,
|
|
61
|
+
hidden: Boolean(text),
|
|
62
|
+
testID: testID ? `${testID}-left-slot` : undefined,
|
|
63
|
+
children: leftSlot.slot
|
|
64
|
+
}) : null, text ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
65
|
+
fontSize: tokens.text.fontSize[size],
|
|
66
|
+
fontWeight: tokens.text.fontWeight[size],
|
|
67
|
+
lineHeight: tokens.text.lineHeight?.[size],
|
|
68
|
+
color: styles.textColor,
|
|
69
|
+
textAlign: "center",
|
|
70
|
+
children: text
|
|
71
|
+
}) : null, rightSlot?.slot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Slot.Slot, {
|
|
72
|
+
color: iconColor,
|
|
73
|
+
maxHeight: iconMaxHeights.right,
|
|
74
|
+
hidden: Boolean(text),
|
|
75
|
+
testID: testID ? `${testID}-right-slot` : undefined,
|
|
76
|
+
children: rightSlot.slot
|
|
77
|
+
}) : null]
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.Pressable, {
|
|
80
|
+
ref: ref,
|
|
81
|
+
background: styles.background,
|
|
82
|
+
activeBackground: styles.activeBackground,
|
|
83
|
+
disabledBackground: styles.disabledBackground,
|
|
84
|
+
border: styles.border,
|
|
85
|
+
activeBorder: styles.activeBorder,
|
|
86
|
+
disabledBorder: styles.disabledBorder,
|
|
87
|
+
borderRadius: styles.borderRadius,
|
|
88
|
+
boxShadow: styles.boxShadow,
|
|
89
|
+
activeBoxShadow: styles.activeBoxShadow,
|
|
90
|
+
paddingTop: styles.padding.top,
|
|
91
|
+
paddingRight: styles.padding.right,
|
|
92
|
+
paddingBottom: styles.padding.bottom,
|
|
93
|
+
paddingLeft: styles.padding.left,
|
|
94
|
+
flexDirection: "row",
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
justifyContent: justifyContent,
|
|
97
|
+
gap: styles.gap
|
|
98
|
+
// Web defaults to `width: fit-content`; `auto` is RN's equivalent.
|
|
99
|
+
,
|
|
100
|
+
width: width ?? 'auto',
|
|
101
|
+
minWidth: minWidth,
|
|
102
|
+
maxWidth: maxWidth,
|
|
103
|
+
height: styles.height,
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
loading: loading,
|
|
106
|
+
loaderColor: loaderColor,
|
|
107
|
+
loaderSize: (0, _buttonUtils.getLoaderSize)(size),
|
|
108
|
+
onPress: onPress,
|
|
109
|
+
testID: testID,
|
|
110
|
+
accessibilityLabel: accessibilityLabel ?? text,
|
|
111
|
+
accessibilityRole: "button"
|
|
112
|
+
// Grouped members drop their shared edges; spread after the
|
|
113
|
+
// resolved surface so `borderWidth` still covers the other sides.
|
|
114
|
+
,
|
|
115
|
+
style: {
|
|
116
|
+
...styles.groupBorderWidths,
|
|
117
|
+
...style
|
|
118
|
+
},
|
|
119
|
+
...rest,
|
|
120
|
+
children: content
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
Button.displayName = 'Button';
|
|
124
|
+
var _default = exports.default = Button;
|
|
125
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_node","_useNativeTokens","_Pressable","_Slot","_Text","_buttonUtils","_jsxRuntime","Button","forwardRef","buttonType","ButtonV2Type","PRIMARY","size","ButtonV2Size","SMALL","subType","ButtonV2SubType","DEFAULT","text","leftSlot","rightSlot","loading","disabled","state","ButtonV2State","buttonGroupPosition","width","minWidth","maxWidth","justifyContent","onPress","testID","accessibilityLabel","style","rest","ref","tokens","useNativeTokens","styles","useMemo","getButtonNativeStyles","iconMaxHeights","getIconMaxHeight","maxHeight","slotMaxHeight","iconColor","textColor","loaderColor","String","color","default","content","jsxs","Fragment","children","slot","jsx","Slot","left","hidden","Boolean","undefined","Text","fontSize","fontWeight","lineHeight","textAlign","right","Pressable","background","activeBackground","disabledBackground","border","activeBorder","disabledBorder","borderRadius","boxShadow","activeBoxShadow","paddingTop","padding","top","paddingRight","paddingBottom","bottom","paddingLeft","flexDirection","alignItems","gap","height","loaderSize","getLoaderSize","accessibilityRole","groupBorderWidths","displayName","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAOA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAIuB,IAAAO,WAAA,GAAAP,OAAA;AAGvB;AACA;AACA;AACA;AACA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AM,CAACsD,iBAAiB;MAAE,GAAG3D;IAAM,CAAE;IAAA,GAC7CC,IAAI;IAAAoB,QAAA,EAEPH;EAAO,CACD,CAAC;AAEpB,CAAC,CAAC;AAEF5C,MAAM,CAACsF,WAAW,GAAG,QAAQ;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA7C,OAAA,GAEd3C,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Button/button.types.ts"],"mappings":"","ignoreList":[]}
|