glacia-native 0.5.2 → 0.6.1
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 +84 -17
- package/lib/module/Accordion.js +58 -0
- package/lib/module/ActionSheet.js +38 -0
- package/lib/module/Alert.js +23 -0
- package/lib/module/AlertDialog.js +47 -0
- package/lib/module/Avatar.js +48 -0
- package/lib/module/Badge.js +36 -0
- package/lib/module/Bars.js +13 -268
- package/lib/module/Button.js +57 -39
- package/lib/module/Card.js +31 -19
- package/lib/module/Checkbox.js +42 -0
- package/lib/module/Chip.js +80 -0
- package/lib/module/Collapsible.js +26 -0
- package/lib/module/ContextMenu.js +33 -0
- package/lib/module/Dialog.js +39 -123
- package/lib/module/DropdownMenu.js +33 -0
- package/lib/module/Field.js +22 -0
- package/lib/module/Glass.js +10 -3
- package/lib/module/Group.js +36 -0
- package/lib/module/IconButton.js +40 -0
- package/lib/module/Input.js +43 -38
- package/lib/module/Label.js +17 -0
- package/lib/module/MorphGroup.js +47 -0
- package/lib/module/Popover.js +29 -0
- package/lib/module/Progress.js +32 -0
- package/lib/module/RadioGroup.js +51 -0
- package/lib/module/Scrim.js +44 -0
- package/lib/module/SegmentedControl.js +70 -63
- package/lib/module/Select.js +51 -0
- package/lib/module/Separator.js +25 -0
- package/lib/module/Sheet.js +51 -0
- package/lib/module/Skeleton.js +48 -0
- package/lib/module/Slider.js +45 -34
- package/lib/module/Stepper.js +167 -0
- package/lib/module/Switch.js +45 -55
- package/lib/module/TabBar.js +50 -44
- package/lib/module/Textarea.js +18 -0
- package/lib/module/Toast.js +55 -0
- package/lib/module/Toggle.js +47 -0
- package/lib/module/ToggleGroup.js +56 -0
- package/lib/module/Toolbar.js +37 -0
- package/lib/module/Tooltip.js +31 -0
- package/lib/module/glass-provider.js +28 -0
- package/lib/module/glass-stack.js +61 -0
- package/lib/module/index.js +78 -109
- package/lib/module/internal/GlassBackdrop.js +36 -0
- package/lib/module/internal/GlassView.js +43 -11
- package/lib/module/internal/blur-community.js +20 -0
- package/lib/module/internal/blur-community.web.js +9 -0
- package/lib/module/internal/blur.js +6 -9
- package/lib/module/internal/glass-routing.js +156 -30
- package/lib/module/internal/initials.js +12 -0
- package/lib/module/internal/overlay.js +147 -0
- package/lib/module/internal/primitives.js +16 -0
- package/lib/typescript/Accordion.d.ts +22 -0
- package/lib/typescript/ActionSheet.d.ts +24 -0
- package/lib/typescript/Alert.d.ts +15 -0
- package/lib/typescript/AlertDialog.d.ts +17 -0
- package/lib/typescript/Avatar.d.ts +22 -0
- package/lib/typescript/Badge.d.ts +12 -0
- package/lib/typescript/Bars.d.ts +3 -188
- package/lib/typescript/Button.d.ts +44 -10
- package/lib/typescript/Card.d.ts +30 -3
- package/lib/typescript/Checkbox.d.ts +14 -0
- package/lib/typescript/Chip.d.ts +19 -0
- package/lib/typescript/Collapsible.d.ts +17 -0
- package/lib/typescript/ContextMenu.d.ts +23 -0
- package/lib/typescript/Dialog.d.ts +8 -68
- package/lib/typescript/DropdownMenu.d.ts +23 -0
- package/lib/typescript/Field.d.ts +19 -0
- package/lib/typescript/Glass.d.ts +11 -2
- package/lib/typescript/Group.d.ts +35 -0
- package/lib/typescript/IconButton.d.ts +21 -0
- package/lib/typescript/Input.d.ts +17 -18
- package/lib/typescript/Label.d.ts +14 -0
- package/lib/typescript/MorphGroup.d.ts +46 -0
- package/lib/typescript/Popover.d.ts +17 -0
- package/lib/typescript/Progress.d.ts +13 -0
- package/lib/typescript/RadioGroup.d.ts +21 -0
- package/lib/typescript/Scrim.d.ts +33 -0
- package/lib/typescript/SegmentedControl.d.ts +24 -13
- package/lib/typescript/Select.d.ts +19 -0
- package/lib/typescript/Separator.d.ts +10 -0
- package/lib/typescript/Sheet.d.ts +45 -0
- package/lib/typescript/Skeleton.d.ts +10 -0
- package/lib/typescript/Slider.d.ts +15 -7
- package/lib/typescript/Stepper.d.ts +49 -0
- package/lib/typescript/Switch.d.ts +19 -12
- package/lib/typescript/TabBar.d.ts +18 -6
- package/lib/typescript/Textarea.d.ts +6 -0
- package/lib/typescript/Toast.d.ts +40 -0
- package/lib/typescript/Toggle.d.ts +21 -0
- package/lib/typescript/ToggleGroup.d.ts +22 -0
- package/lib/typescript/Toolbar.d.ts +35 -0
- package/lib/typescript/Tooltip.d.ts +16 -0
- package/lib/typescript/glass-provider.d.ts +34 -0
- package/lib/typescript/glass-stack.d.ts +54 -0
- package/lib/typescript/index.d.ts +38 -17
- package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
- package/lib/typescript/internal/GlassView.d.ts +18 -2
- package/lib/typescript/internal/blur-community.d.ts +2 -0
- package/lib/typescript/internal/blur-community.web.d.ts +2 -0
- package/lib/typescript/internal/glass-routing.d.ts +83 -15
- package/lib/typescript/internal/initials.d.ts +2 -0
- package/lib/typescript/internal/overlay.d.ts +74 -0
- package/lib/typescript/internal/primitives.d.ts +11 -0
- package/package.json +12 -10
- package/src/Accordion.tsx +165 -0
- package/src/ActionSheet.tsx +149 -0
- package/src/Alert.tsx +85 -0
- package/src/AlertDialog.tsx +124 -0
- package/src/Avatar.tsx +102 -0
- package/src/Badge.tsx +80 -0
- package/src/Bars.tsx +10 -807
- package/src/Button.tsx +196 -67
- package/src/Card.tsx +105 -32
- package/src/Checkbox.tsx +98 -0
- package/src/Chip.tsx +149 -0
- package/src/Collapsible.tsx +66 -0
- package/src/ContextMenu.tsx +103 -0
- package/src/Dialog.tsx +85 -335
- package/src/DropdownMenu.tsx +103 -0
- package/src/Field.tsx +65 -0
- package/src/Glass.tsx +15 -5
- package/src/Group.tsx +98 -0
- package/src/IconButton.tsx +110 -0
- package/src/Input.tsx +139 -87
- package/src/Label.tsx +56 -0
- package/src/MorphGroup.tsx +134 -0
- package/src/Popover.tsx +81 -0
- package/src/Progress.tsx +83 -0
- package/src/RadioGroup.tsx +122 -0
- package/src/Scrim.tsx +94 -0
- package/src/SegmentedControl.tsx +132 -99
- package/src/Select.tsx +136 -0
- package/src/Separator.tsx +52 -0
- package/src/Sheet.tsx +139 -0
- package/src/Skeleton.tsx +77 -0
- package/src/Slider.tsx +84 -47
- package/src/Stepper.tsx +315 -0
- package/src/Switch.tsx +81 -73
- package/src/TabBar.tsx +106 -93
- package/src/Textarea.tsx +34 -0
- package/src/Toast.tsx +131 -0
- package/src/Toggle.tsx +113 -0
- package/src/ToggleGroup.tsx +129 -0
- package/src/Toolbar.tsx +111 -0
- package/src/Tooltip.tsx +79 -0
- package/src/engine/CHANGELOG.md +430 -0
- package/src/engine/NOTICE +54 -0
- package/src/engine/README.md +975 -0
- package/src/engine/android/build.gradle +18 -0
- package/src/engine/android/src/main/AndroidManifest.xml +2 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
- package/src/engine/index.ts +24 -0
- package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
- package/src/engine/ios/Enums/GlassVariant.swift +86 -0
- package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
- package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
- package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
- package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
- package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
- package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
- package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
- package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
- package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
- package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
- package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
- package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
- package/src/engine/ios/Glass/StripCache.swift +545 -0
- package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
- package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
- package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
- package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
- package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
- package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
- package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
- package/src/engine/package.json +70 -0
- package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
- package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
- package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
- package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
- package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
- package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
- package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
- package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
- package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
- package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
- package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
- package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
- package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
- package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
- package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
- package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
- package/src/engine/src/components/index.ts +16 -0
- package/src/engine/src/constants/index.ts +4 -0
- package/src/engine/src/constants/metal.constants.ts +327 -0
- package/src/engine/src/constants/metrics.constants.ts +325 -0
- package/src/engine/src/constants/springs.constants.ts +107 -0
- package/src/engine/src/constants/styles.constants.ts +12 -0
- package/src/engine/src/context/glass-group.context.ts +65 -0
- package/src/engine/src/context/index.ts +6 -0
- package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
- package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
- package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
- package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
- package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
- package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
- package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
- package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
- package/src/engine/src/core/components/index.ts +4 -0
- package/src/engine/src/core/constants/glass.constants.ts +57 -0
- package/src/engine/src/core/constants/index.ts +20 -0
- package/src/engine/src/core/constants/native.constants.ts +16 -0
- package/src/engine/src/core/context/glass-stack.context.ts +30 -0
- package/src/engine/src/core/context/index.ts +4 -0
- package/src/engine/src/core/enum/index.ts +12 -0
- package/src/engine/src/core/index.ts +1 -0
- package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
- package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
- package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
- package/src/engine/src/core/interfaces/index.ts +31 -0
- package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
- package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
- package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
- package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
- package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
- package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
- package/src/engine/src/core/modules/index.ts +2 -0
- package/src/engine/src/core/root/index.ts +51 -0
- package/src/engine/src/core/types/glass.types.ts +25 -0
- package/src/engine/src/core/types/index.ts +8 -0
- package/src/engine/src/core/utils/debug.utils.ts +17 -0
- package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
- package/src/engine/src/core/utils/hdr.utils.ts +37 -0
- package/src/engine/src/core/utils/index.ts +5 -0
- package/src/engine/src/core/utils/native-view.utils.ts +33 -0
- package/src/engine/src/core/utils/platform.utils.ts +34 -0
- package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
- package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
- package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
- package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
- package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
- package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
- package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
- package/src/engine/src/core/views/index.ts +4 -0
- package/src/engine/src/hooks/index.ts +18 -0
- package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
- package/src/engine/src/hooks/use-damped-drag.ts +332 -0
- package/src/engine/src/hooks/use-echo-filter.ts +55 -0
- package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
- package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
- package/src/engine/src/hooks/use-press-progress.ts +44 -0
- package/src/engine/src/index.ts +120 -0
- package/src/engine/src/interfaces/index.ts +28 -0
- package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
- package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
- package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
- package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
- package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
- package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
- package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
- package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
- package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
- package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
- package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
- package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
- package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
- package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
- package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
- package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
- package/src/engine/src/theme/glass-ui-theme.ts +100 -0
- package/src/engine/src/theme/index.ts +2 -0
- package/src/engine/src/utils/button-press.utils.ts +63 -0
- package/src/engine/src/utils/index.ts +3 -0
- package/src/engine/src/utils/metal.utils.ts +164 -0
- package/src/glass-provider.tsx +60 -0
- package/src/glass-stack.tsx +115 -0
- package/src/index.ts +47 -190
- package/src/internal/GlassBackdrop.tsx +60 -0
- package/src/internal/GlassView.tsx +53 -18
- package/src/internal/blur-community.ts +19 -0
- package/src/internal/blur-community.web.ts +7 -0
- package/src/internal/blur.ts +7 -8
- package/src/internal/glass-routing.ts +212 -34
- package/src/internal/initials.ts +7 -0
- package/src/internal/overlay.tsx +258 -0
- package/src/internal/primitives.ts +23 -0
- package/lib/module/Carousel.js +0 -103
- package/lib/module/Display.js +0 -318
- package/lib/module/Feedback.js +0 -395
- package/lib/module/Form.js +0 -160
- package/lib/module/Forms2.js +0 -471
- package/lib/module/Message.js +0 -84
- package/lib/module/Overlays.js +0 -344
- package/lib/module/Pickers.js +0 -243
- package/lib/module/Table.js +0 -100
- package/lib/module/ai.js +0 -283
- package/lib/module/charts/AreaChart.js +0 -32
- package/lib/module/charts/BarChart.js +0 -75
- package/lib/module/charts/FunnelChart.js +0 -50
- package/lib/module/charts/HeatmapChart.js +0 -71
- package/lib/module/charts/LineChart.js +0 -81
- package/lib/module/charts/PlotChart.js +0 -52
- package/lib/module/charts/RadarChart.js +0 -78
- package/lib/module/charts/RingChart.js +0 -52
- package/lib/module/charts/ScatterChart.js +0 -95
- package/lib/module/charts/WaterfallChart.js +0 -85
- package/lib/module/charts/advanced.js +0 -313
- package/lib/module/charts/extra.js +0 -108
- package/lib/module/charts/index.js +0 -50
- package/lib/module/charts/scales.js +0 -140
- package/lib/typescript/Carousel.d.ts +0 -47
- package/lib/typescript/Display.d.ts +0 -178
- package/lib/typescript/Feedback.d.ts +0 -196
- package/lib/typescript/Form.d.ts +0 -97
- package/lib/typescript/Forms2.d.ts +0 -209
- package/lib/typescript/Message.d.ts +0 -67
- package/lib/typescript/Overlays.d.ts +0 -146
- package/lib/typescript/Pickers.d.ts +0 -105
- package/lib/typescript/Table.d.ts +0 -64
- package/lib/typescript/ai.d.ts +0 -166
- package/lib/typescript/charts/AreaChart.d.ts +0 -44
- package/lib/typescript/charts/BarChart.d.ts +0 -19
- package/lib/typescript/charts/FunnelChart.d.ts +0 -25
- package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
- package/lib/typescript/charts/LineChart.d.ts +0 -30
- package/lib/typescript/charts/PlotChart.d.ts +0 -31
- package/lib/typescript/charts/RadarChart.d.ts +0 -27
- package/lib/typescript/charts/RingChart.d.ts +0 -28
- package/lib/typescript/charts/ScatterChart.d.ts +0 -34
- package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
- package/lib/typescript/charts/advanced.d.ts +0 -107
- package/lib/typescript/charts/extra.d.ts +0 -63
- package/lib/typescript/charts/index.d.ts +0 -13
- package/lib/typescript/charts/scales.d.ts +0 -35
- package/src/Carousel.tsx +0 -233
- package/src/Display.tsx +0 -781
- package/src/Feedback.tsx +0 -992
- package/src/Form.tsx +0 -445
- package/src/Forms2.tsx +0 -1055
- package/src/Message.tsx +0 -218
- package/src/Overlays.tsx +0 -704
- package/src/Pickers.tsx +0 -595
- package/src/Table.tsx +0 -232
- package/src/ai.tsx +0 -715
- package/src/charts/AreaChart.tsx +0 -73
- package/src/charts/BarChart.tsx +0 -221
- package/src/charts/FunnelChart.tsx +0 -125
- package/src/charts/HeatmapChart.tsx +0 -155
- package/src/charts/LineChart.tsx +0 -247
- package/src/charts/PlotChart.tsx +0 -168
- package/src/charts/RadarChart.tsx +0 -208
- package/src/charts/RingChart.tsx +0 -133
- package/src/charts/ScatterChart.tsx +0 -223
- package/src/charts/WaterfallChart.tsx +0 -201
- package/src/charts/advanced.tsx +0 -676
- package/src/charts/extra.tsx +0 -242
- package/src/charts/index.ts +0 -86
- package/src/charts/scales.ts +0 -163
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export {
|
|
2
|
+
NATIVE_MODULE_NAME,
|
|
3
|
+
NATIVE_VIEW_NAMES,
|
|
4
|
+
COMPONENT_NAMES,
|
|
5
|
+
} from "./native.constants";
|
|
6
|
+
export {
|
|
7
|
+
GLASS_VARIANTS,
|
|
8
|
+
GLASS_RENDERERS,
|
|
9
|
+
GLASS_ACTIVE_RENDERERS,
|
|
10
|
+
GLASS_CORNER_STYLES,
|
|
11
|
+
DEFAULT_GLASS_VARIANT,
|
|
12
|
+
DEFAULT_GLASS_RENDERER,
|
|
13
|
+
DEFAULT_GLASS_CORNER_STYLE,
|
|
14
|
+
DEFAULT_HIGHLIGHT_ANGLE,
|
|
15
|
+
DEFAULT_BORDER_WIDTH,
|
|
16
|
+
DEFAULT_GLASS_OPACITY,
|
|
17
|
+
MIN_IOS_VERSION_FOR_NATIVE_GLASS,
|
|
18
|
+
MIN_ANDROID_SDK_FOR_NATIVE_GLASS,
|
|
19
|
+
DEFAULT_PROVIDER_ID,
|
|
20
|
+
} from "./glass.constants";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const NATIVE_MODULE_NAME = "ExpoLiquidGlass";
|
|
2
|
+
|
|
3
|
+
const NATIVE_VIEW_NAMES = {
|
|
4
|
+
LIQUID_GLASS_VIEW: "LiquidGlassView",
|
|
5
|
+
LIQUID_GLASS_CONTAINER_VIEW: "LiquidGlassContainerView",
|
|
6
|
+
LIQUID_GLASS_PROVIDER_VIEW: "LiquidGlassProviderView",
|
|
7
|
+
} as const;
|
|
8
|
+
|
|
9
|
+
const COMPONENT_NAMES = {
|
|
10
|
+
LIQUID_GLASS_VIEW: "LiquidGlassView",
|
|
11
|
+
LIQUID_GLASS_CONTAINER: "LiquidGlassContainer",
|
|
12
|
+
LIQUID_GLASS_PROVIDER: "LiquidGlassProvider",
|
|
13
|
+
LIQUID_GLASS_STACK: "LiquidGlassStack",
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export { NATIVE_MODULE_NAME, NATIVE_VIEW_NAMES, COMPONENT_NAMES };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Carries the `providerId` a glass view should read when it renders inside a
|
|
5
|
+
* `LiquidGlassStack` layer.
|
|
6
|
+
*
|
|
7
|
+
* Each layer wrap provides the id of the provider recording everything *below* that layer — never
|
|
8
|
+
* a provider the layer sits inside — so a `LiquidGlassView` that consumes this value can never be
|
|
9
|
+
* pointed at its own backdrop. `undefined` outside any stack; an explicit `providerId` prop always
|
|
10
|
+
* wins over the context.
|
|
11
|
+
*/
|
|
12
|
+
const GlassStackProviderContext: React.Context<string | undefined> = createContext<
|
|
13
|
+
string | undefined
|
|
14
|
+
>(undefined);
|
|
15
|
+
|
|
16
|
+
GlassStackProviderContext.displayName = "GlassStackProviderContext";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The `providerId` supplied by the nearest enclosing `LiquidGlassStack` layer, or `undefined`
|
|
20
|
+
* outside any stack.
|
|
21
|
+
*
|
|
22
|
+
* `LiquidGlassView` already consumes this on its own. Reach for the hook only when building a
|
|
23
|
+
* component that must *forward* the id somewhere a context cannot follow — into a `Modal`, or into
|
|
24
|
+
* an imperative API.
|
|
25
|
+
*/
|
|
26
|
+
function useGlassStackProviderId(): string | undefined {
|
|
27
|
+
return useContext(GlassStackProviderContext);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { GlassStackProviderContext, useGlassStackProviderId };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./root";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Result of the Android HDR opt-in / status calls. See `setGlassHdrEnabled`. */
|
|
2
|
+
interface IGlassHdrStatus {
|
|
3
|
+
/** Whether this display + platform can do mixed HDR/SDR UI at all (Android 14+, HDR panel). */
|
|
4
|
+
supported: boolean;
|
|
5
|
+
/** Whether the app's opt-in is currently on (independent of `supported`). */
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The multiple of SDR white the glass highlight may reach right now. Exactly 1 while disabled
|
|
9
|
+
* or unsupported; breathes with screen brightness while active (e.g. up to ~4.5 on dim OLED
|
|
10
|
+
* panels, ~2 at full brightness).
|
|
11
|
+
*/
|
|
12
|
+
headroom: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { IGlassHdrStatus };
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import type { ColorValue } from "react-native";
|
|
2
|
+
|
|
3
|
+
interface IGlassRefractionCurve {
|
|
4
|
+
power?: number;
|
|
5
|
+
bias?: number;
|
|
6
|
+
}
|
|
7
|
+
interface IGlassRefraction {
|
|
8
|
+
amount?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
depth?: number;
|
|
12
|
+
/**
|
|
13
|
+
* How far the edge refraction leans toward `highlight.angle`'s light axis, unitless like
|
|
14
|
+
* `depth`. Default 0 (measured off real iOS 26, which carries no lean); negative flips it.
|
|
15
|
+
* Clamped to [-1, 1]. Shader renderers — Android's `agsl` tier and the iOS Metal renderer;
|
|
16
|
+
* iOS 26's native glass ignores it.
|
|
17
|
+
*
|
|
18
|
+
* A stylisation knob: the twist the eye reads on real glass is `depth`'s radial term sweeping
|
|
19
|
+
* the corners, which ships by default. This leans the whole rim toward the light on top.
|
|
20
|
+
*/
|
|
21
|
+
swirl?: number;
|
|
22
|
+
curve?: IGlassRefractionCurve;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface IGlassDispersion {
|
|
26
|
+
amount?: number;
|
|
27
|
+
reach?: number;
|
|
28
|
+
/**
|
|
29
|
+
* How much of the fringe follows Kyant's quadrant weighting, 0..1. Default 0 — an even rim
|
|
30
|
+
* fringe the whole way round. Shader renderers (Android `agsl`, iOS Metal); the native iOS 26
|
|
31
|
+
* glass ignores it.
|
|
32
|
+
*
|
|
33
|
+
* At 1 the spread is scaled by `(cx * cy) / (hx * hy)`: nothing along either centre line, full
|
|
34
|
+
* strength at the corners, and the sign — hence the hue order — flipping between neighbours. On
|
|
35
|
+
* a capsule that concentrates every trace of colour at the two rounded ends and leaves the long
|
|
36
|
+
* flanks clean, which is the look Kyant's tab pill is known for.
|
|
37
|
+
*/
|
|
38
|
+
quadrant?: number;
|
|
39
|
+
}
|
|
40
|
+
interface IGlassHighlight {
|
|
41
|
+
intensity?: number;
|
|
42
|
+
angle?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Depth of the glass border light, in dp. Default 0.75. Shader renderers (Android `agsl`, iOS
|
|
45
|
+
* Metal); the native iOS 26 glass ignores it.
|
|
46
|
+
*
|
|
47
|
+
* Both shader renderers draw the highlight as a thin additive two-lobe rim hugging the edge
|
|
48
|
+
* (measured off real iOS 26 glass), and this is that rim's fade-out depth. A faint ~7 dp sheen
|
|
49
|
+
* under the lit edges rides the same lobes.
|
|
50
|
+
*/
|
|
51
|
+
width?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Angular falloff exponent of the rim's two lobes. Default 1; higher concentrates the light at
|
|
54
|
+
* the lobes and darkens the perpendicular corners sooner. Shader renderers, like `width`.
|
|
55
|
+
*/
|
|
56
|
+
falloff?: number;
|
|
57
|
+
}
|
|
58
|
+
interface IGlassBorder {
|
|
59
|
+
width?: number;
|
|
60
|
+
opacity?: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The inner shadow: a soft dark band along the inside of the silhouette — the shape minus itself
|
|
65
|
+
* translated by the cast offset, blurred by `radius` (Kyant's `InnerShadow`). It is what gives a
|
|
66
|
+
* lifted control its thickness: iOS 26's grabbed tab pill and slider thumb carry one.
|
|
67
|
+
*
|
|
68
|
+
* Shader renderers only (Android `agsl`, iOS Metal), evaluated on the merged field so a `morph`
|
|
69
|
+
* partner shades as one piece. Animatable per frame like the rest of `metal` — the kit ramps it
|
|
70
|
+
* in with press progress. `radius` 0 (or absent) is off.
|
|
71
|
+
*/
|
|
72
|
+
interface IGlassInnerShadow {
|
|
73
|
+
/** Blur radius, dp. 0 disables. */
|
|
74
|
+
radius?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Where the shadow is cast, dp. Defaults: `offsetX` 0, `offsetY` = `radius` — lit from above,
|
|
77
|
+
* so the pane's top lip shades the top inner edge.
|
|
78
|
+
*/
|
|
79
|
+
offsetX?: number;
|
|
80
|
+
offsetY?: number;
|
|
81
|
+
/** Strength of the (black) shadow, 0..1. Default 0.15. */
|
|
82
|
+
opacity?: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A blur whose radius ramps across the view — iOS 26's "content melts into blur" scroll-edge
|
|
87
|
+
* look. The ramp travels along `direction` (named for where the blur *increases* toward), from
|
|
88
|
+
* `startRadius` at the leading edge to `endRadius` at the trailing one, eased with a Hermite
|
|
89
|
+
* step and confined to the `start`..`end` fraction window.
|
|
90
|
+
*
|
|
91
|
+
* Shader renderers: Android's `agsl` tier runs a blur pyramid — one platform blur per doubling
|
|
92
|
+
* of radius up to the ramp's maximum, cross-faded per pixel by the ramp, radii in the iOS
|
|
93
|
+
* `sigma = 0.5 * r` convention so `endRadius: 24` here looks like `blurRadius: 24` on iOS; the
|
|
94
|
+
* iOS Metal renderer ramps its existing blur passes per-pixel. When present it replaces the
|
|
95
|
+
* uniform `blurRadius` stage (equal radii collapse to the plain uniform stage). Android's
|
|
96
|
+
* `fallback-blur` tier (API 31–32) approximates it with a uniform blur at the mean radius;
|
|
97
|
+
* `scrim` ignores it; iOS 26's native glass has no per-pixel blur to drive — pair with the
|
|
98
|
+
* system's own scroll-edge effects there. Animatable per-frame via Reanimated
|
|
99
|
+
* `useAnimatedProps`, like the rest of `metal`.
|
|
100
|
+
*/
|
|
101
|
+
interface IGlassProgressiveBlur {
|
|
102
|
+
/** Radius at the leading edge, dp. Default 0 — sharp. */
|
|
103
|
+
startRadius?: number;
|
|
104
|
+
/** Radius at the trailing edge, dp. Default 0. */
|
|
105
|
+
endRadius?: number;
|
|
106
|
+
/** Where the blur increases toward. Default "down" — sharp top, blurred bottom. */
|
|
107
|
+
direction?: "down" | "up" | "left" | "right";
|
|
108
|
+
/** Where the ramp begins, as a fraction of the view's extent along `direction`. Default 0. */
|
|
109
|
+
start?: number;
|
|
110
|
+
/** Where the ramp completes, same units. Default 1. */
|
|
111
|
+
end?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The primary shape as a sub-rect of the view — view-local dp, top-left origin. Absent, the
|
|
116
|
+
* shape fills the view exactly as it always has.
|
|
117
|
+
*
|
|
118
|
+
* This is what makes a *canvas* view possible: a view larger than its glass, inside which a
|
|
119
|
+
* `morph` partner has room to approach, neck apart and separate — both platforms clip their
|
|
120
|
+
* draw at the view's bounds, so the extra room must come from the view itself. Shader
|
|
121
|
+
* renderers only, like `morph`. The view's `cornerRadius` resolves against this rect; the
|
|
122
|
+
* drawn `border` and child clipping still track the view, so a canvas view should carry
|
|
123
|
+
* `border: { width: 0 }` and host its own chrome.
|
|
124
|
+
*/
|
|
125
|
+
interface IGlassShapeRect {
|
|
126
|
+
x?: number;
|
|
127
|
+
y?: number;
|
|
128
|
+
width?: number;
|
|
129
|
+
height?: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The morph partner: a second rounded rect folded into this view's shape with a smooth-min, so
|
|
134
|
+
* the two read as one connected pane of liquid — refraction, dispersion and the border light all
|
|
135
|
+
* follow the *merged* silhouette, and animating the rect toward the view's edge makes the shapes
|
|
136
|
+
* neck together and fuse exactly like iOS 26's `UIGlassContainerEffect` merge.
|
|
137
|
+
*
|
|
138
|
+
* Shader renderers only: Android's `agsl` tier and iOS's Metal renderer (so iOS below 26, or
|
|
139
|
+
* `renderer="metal"`). The native iOS 26 glass and the blur/scrim tiers ignore it — for the
|
|
140
|
+
* native path, use `LiquidGlassContainer`'s real merge instead.
|
|
141
|
+
*
|
|
142
|
+
* View-local dp, top-left origin, exactly like layout. All-or-nothing: `width`, `height` and a
|
|
143
|
+
* positive `smoothing` make it live. Keep the partner inside the view's bounds (both platforms
|
|
144
|
+
* clip there) and pair it with `shape` when it needs room outside the primary silhouette. Like
|
|
145
|
+
* the rest of `metal`, this can be driven per-frame from the UI thread via Reanimated's
|
|
146
|
+
* `useAnimatedProps`.
|
|
147
|
+
*/
|
|
148
|
+
interface IGlassMorph {
|
|
149
|
+
/** Partner's top-left corner, view-local dp. Defaults to 0. */
|
|
150
|
+
x?: number;
|
|
151
|
+
y?: number;
|
|
152
|
+
width?: number;
|
|
153
|
+
height?: number;
|
|
154
|
+
/** One radius for all four partner corners, clamped to half its short side. */
|
|
155
|
+
cornerRadius?: number;
|
|
156
|
+
/** The distance at which the two shapes begin to merge, dp. 0 disables. */
|
|
157
|
+
smoothing?: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* How much of the shader to run. Android only — iOS ignores it.
|
|
161
|
+
*
|
|
162
|
+
* The chromatic-dispersion loop must have a compile-time-constant bound to unroll, so each tier is
|
|
163
|
+
* a separately compiled shader rather than a uniform.
|
|
164
|
+
*
|
|
165
|
+
* - `high` — 16 dispersion taps, one per device pixel. Finer than iOS.
|
|
166
|
+
* - `medium` — 8 taps, one per point. What iOS resolves to at the built-in defaults, so this is the
|
|
167
|
+
* parity setting and the default.
|
|
168
|
+
* - `low` — no dispersion, no film grain. Roughly a fifth of `high`'s cost. Use it for glass that
|
|
169
|
+
* covers a large fraction of the screen.
|
|
170
|
+
*/
|
|
171
|
+
type TGlassAndroidQuality = "low" | "medium" | "high";
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* A ceiling on Android's rendering ladder. Android only — iOS ignores it.
|
|
175
|
+
*
|
|
176
|
+
* The values are the same strings `onRendererChange` reports, so what you ask for is directly
|
|
177
|
+
* comparable with what you get. It can only ever *lower* the tier: `"agsl"` on an API-31 device
|
|
178
|
+
* still resolves to `"fallback-blur"`, because the device's own ceiling always applies first.
|
|
179
|
+
*
|
|
180
|
+
* - `agsl` — no cap. The default.
|
|
181
|
+
* - `fallback-blur` — blur, saturation, frost and tint, clipped to the outline. No refraction.
|
|
182
|
+
* - `scrim` — the live backdrop drawn straight through under a translucent scrim. No blur.
|
|
183
|
+
* - `none` — no backdrop at all; frost, tint and border only.
|
|
184
|
+
*
|
|
185
|
+
* Two uses: capping the cost of glass that covers a large fraction of the screen, and exercising
|
|
186
|
+
* the fallbacks on a device that would otherwise never take them.
|
|
187
|
+
*
|
|
188
|
+
* Note that `"none"` is the *native* floor, which is not quite the sub-API-29 experience — there,
|
|
189
|
+
* JS never mounts the native view at all and you get a bare `<View>`.
|
|
190
|
+
*/
|
|
191
|
+
type TGlassAndroidTier = "agsl" | "fallback-blur" | "scrim" | "none";
|
|
192
|
+
|
|
193
|
+
interface IGlassAndroidOptions {
|
|
194
|
+
quality?: TGlassAndroidQuality;
|
|
195
|
+
maxTier?: TGlassAndroidTier;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface IGlassMetalOptions {
|
|
199
|
+
/**
|
|
200
|
+
* The wash over the glass — the same thing as the view's `tint` prop, carried by the recipe.
|
|
201
|
+
* Present, it wins over the prop. Two reasons to put it here rather than on the view: a
|
|
202
|
+
* `metal` object then describes a whole look, colour included (`{ ...GLASS_BUTTON_METAL,
|
|
203
|
+
* tint: "#0088FFCC" }` is a blue button), and `lerpMetal` crossfades it between two recipes
|
|
204
|
+
* on the UI thread — a pill that goes blue as it is grabbed, a bar that warms on press.
|
|
205
|
+
* Any colour string works on both platforms; the wrapper processes it before it crosses.
|
|
206
|
+
*/
|
|
207
|
+
tint?: ColorValue;
|
|
208
|
+
blurRadius?: number;
|
|
209
|
+
captureQuality?: number;
|
|
210
|
+
opacity?: number;
|
|
211
|
+
frost?: number;
|
|
212
|
+
saturation?: number;
|
|
213
|
+
noise?: number;
|
|
214
|
+
light?: number;
|
|
215
|
+
/**
|
|
216
|
+
* A whole-surface lens: the backdrop reads enlarged through the pane, contracting toward the
|
|
217
|
+
* shape's centre — the interior magnification real iOS 26 glass carries (a slider thumb
|
|
218
|
+
* enlarges the track under it). `1` is none; clamped to `[1, 4]`. Shader renderers only.
|
|
219
|
+
* Geometry is untouched, so the rim still bends off the true silhouette, and a value ≥ 1 only
|
|
220
|
+
* ever samples inward, so it costs no extra backdrop.
|
|
221
|
+
*/
|
|
222
|
+
magnification?: number;
|
|
223
|
+
refraction?: IGlassRefraction;
|
|
224
|
+
dispersion?: IGlassDispersion;
|
|
225
|
+
highlight?: IGlassHighlight;
|
|
226
|
+
border?: IGlassBorder;
|
|
227
|
+
innerShadow?: IGlassInnerShadow;
|
|
228
|
+
shape?: IGlassShapeRect;
|
|
229
|
+
morph?: IGlassMorph;
|
|
230
|
+
progressiveBlur?: IGlassProgressiveBlur;
|
|
231
|
+
/** Android-only escape hatch; ignored everywhere else. */
|
|
232
|
+
android?: IGlassAndroidOptions;
|
|
233
|
+
}
|
|
234
|
+
export type {
|
|
235
|
+
IGlassMetalOptions,
|
|
236
|
+
IGlassRefraction,
|
|
237
|
+
IGlassRefractionCurve,
|
|
238
|
+
IGlassDispersion,
|
|
239
|
+
IGlassHighlight,
|
|
240
|
+
IGlassBorder,
|
|
241
|
+
IGlassInnerShadow,
|
|
242
|
+
IGlassShapeRect,
|
|
243
|
+
IGlassMorph,
|
|
244
|
+
IGlassProgressiveBlur,
|
|
245
|
+
IGlassAndroidOptions,
|
|
246
|
+
TGlassAndroidQuality,
|
|
247
|
+
TGlassAndroidTier,
|
|
248
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type { IGlassSurfaceProps } from "./glass-surface.interface";
|
|
2
|
+
export type { IGlassHdrStatus } from "./glass-hdr.interface";
|
|
3
|
+
export type {
|
|
4
|
+
IGlassMetalOptions,
|
|
5
|
+
IGlassRefraction,
|
|
6
|
+
IGlassRefractionCurve,
|
|
7
|
+
IGlassDispersion,
|
|
8
|
+
IGlassHighlight,
|
|
9
|
+
IGlassBorder,
|
|
10
|
+
IGlassInnerShadow,
|
|
11
|
+
IGlassShapeRect,
|
|
12
|
+
IGlassMorph,
|
|
13
|
+
IGlassProgressiveBlur,
|
|
14
|
+
IGlassAndroidOptions,
|
|
15
|
+
TGlassAndroidQuality,
|
|
16
|
+
TGlassAndroidTier,
|
|
17
|
+
} from "./glass-metal.interface";
|
|
18
|
+
export type {
|
|
19
|
+
ILiquidGlassViewProps,
|
|
20
|
+
IGlassCornerRadii,
|
|
21
|
+
IGlassGlow,
|
|
22
|
+
IGlassLuminanceReading,
|
|
23
|
+
TGlassCornerRadius,
|
|
24
|
+
} from "./liquid-glass-view.interface";
|
|
25
|
+
export type { ILiquidGlassContainerProps } from "./liquid-glass-container.interface";
|
|
26
|
+
export type { ILiquidGlassProviderProps } from "./liquid-glass-provider.interface";
|
|
27
|
+
export type {
|
|
28
|
+
ILiquidGlassStackProps,
|
|
29
|
+
ILiquidGlassStackLayerProps,
|
|
30
|
+
} from "./liquid-glass-stack.interface";
|
|
31
|
+
export type { INativeLiquidGlassViewProps } from "./native-liquid-glass-view.interface";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IGlassSurfaceProps } from "./glass-surface.interface";
|
|
2
|
+
|
|
3
|
+
interface ILiquidGlassProviderProps extends IGlassSurfaceProps {
|
|
4
|
+
/**
|
|
5
|
+
* Pairs this provider with the `LiquidGlassView`s that read its backdrop. Defaults to
|
|
6
|
+
* `"default"` on both sides, so a single provider needs no explicit id.
|
|
7
|
+
*
|
|
8
|
+
* Pairing is explicit rather than inferred from the view hierarchy on purpose: a hierarchy walk
|
|
9
|
+
* is what broke `expo-blur` inside `Modal`, because a `Modal` is a separate window.
|
|
10
|
+
*/
|
|
11
|
+
providerId?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type { ILiquidGlassProviderProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IGlassSurfaceProps } from "./glass-surface.interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props for `LiquidGlassStack` — declarative stacked glass.
|
|
5
|
+
*
|
|
6
|
+
* Direct children must be `LiquidGlassStack.Layer` elements, bottom to top. Anything else is
|
|
7
|
+
* dropped with a dev warning.
|
|
8
|
+
*/
|
|
9
|
+
interface ILiquidGlassStackProps extends IGlassSurfaceProps {}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for `LiquidGlassStack.Layer`.
|
|
13
|
+
*
|
|
14
|
+
* The first layer is the stack's base content and lays out in normal flow (`flex: 1`) — its
|
|
15
|
+
* `style` must not set `position: "absolute"`, because that view is the flow child of the
|
|
16
|
+
* innermost provider. Every later layer is an overlay: an `absoluteFill` wrap with
|
|
17
|
+
* `pointerEvents="box-none"`, with `style` merged on top.
|
|
18
|
+
*/
|
|
19
|
+
interface ILiquidGlassStackLayerProps extends IGlassSurfaceProps {}
|
|
20
|
+
|
|
21
|
+
export type { ILiquidGlassStackProps, ILiquidGlassStackLayerProps };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
TGlassActiveRenderer,
|
|
5
|
+
TGlassCornerStyle,
|
|
6
|
+
TGlassRenderer,
|
|
7
|
+
TGlassVariant,
|
|
8
|
+
} from "../types";
|
|
9
|
+
import type { IGlassMetalOptions } from "./glass-metal.interface";
|
|
10
|
+
import type { IGlassSurfaceProps } from "./glass-surface.interface";
|
|
11
|
+
|
|
12
|
+
interface IGlassCornerRadii {
|
|
13
|
+
topLeft?: number;
|
|
14
|
+
topRight?: number;
|
|
15
|
+
bottomRight?: number;
|
|
16
|
+
bottomLeft?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type TGlassCornerRadius = number | IGlassCornerRadii;
|
|
20
|
+
|
|
21
|
+
interface ILiquidGlassViewProps extends IGlassSurfaceProps {
|
|
22
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Which `LiquidGlassProvider` supplies this view's backdrop. Defaults to `"default"`.
|
|
26
|
+
*
|
|
27
|
+
* An **array** composites several providers in order, first at the bottom — the combined
|
|
28
|
+
* backdrop of the nested-layer pattern: `["default", layerId]` makes glass over a glass bar
|
|
29
|
+
* refract the bar *composited over* the content behind it, exactly what the eye sees under
|
|
30
|
+
* the view.
|
|
31
|
+
*
|
|
32
|
+
* **Android only.** iOS captures what lies beneath each glass in the window, which already
|
|
33
|
+
* is that composite.
|
|
34
|
+
*/
|
|
35
|
+
providerId?: string | string[];
|
|
36
|
+
|
|
37
|
+
variant?: TGlassVariant;
|
|
38
|
+
renderer?: TGlassRenderer;
|
|
39
|
+
cornerRadius?: TGlassCornerRadius;
|
|
40
|
+
cornerStyle?: TGlassCornerStyle;
|
|
41
|
+
tint?: ColorValue;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* System touch response. Defaults to `false`.
|
|
45
|
+
*
|
|
46
|
+
* **iOS 26+**: passed to `UIGlassEffect.isInteractive`; the OS owns the behaviour. **Android
|
|
47
|
+
* and the iOS Metal renderer (iOS below 26)**: a native port of it, the same springs on both —
|
|
48
|
+
* a spring-driven specular blooms under the finger, the refraction dents and deepens around it,
|
|
49
|
+
* and the glass inflates ~3.5 %, translates a little toward the drag and stretches along it,
|
|
50
|
+
* rubber-band style, all off the platform's animation stage with no JS per frame. On Android a
|
|
51
|
+
* bare-glass press held over ~150 ms takes the gesture from ancestor scrollers, so dragging the
|
|
52
|
+
* glass does not scroll it away; quick flicks still scroll. On iOS an ancestor recogniser
|
|
53
|
+
* taking the touch releases the press like a lift.
|
|
54
|
+
*/
|
|
55
|
+
interactive?: boolean;
|
|
56
|
+
metal?: IGlassMetalOptions;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A press this glass should respond to, driven by the app rather than by its own touches.
|
|
60
|
+
* Shader renderers — Android and the iOS Metal renderer; iOS 26's native glass ignores it.
|
|
61
|
+
*
|
|
62
|
+
* `interactive` covers a press *on this view*. This covers the other case: a control the app is
|
|
63
|
+
* choreographing, whose press belongs to some other view. A tab bar whose pill is being dragged
|
|
64
|
+
* is the canonical one — the finger is on the pill, but it is the bar that lights up under it.
|
|
65
|
+
*
|
|
66
|
+
* Setting it takes over the press uniforms entirely; `interactive`'s own animator stops reaching
|
|
67
|
+
* the shader until it goes back to `undefined`. And unlike `interactive` it never writes the
|
|
68
|
+
* view's transform, so it composes with a `transform` style instead of fighting it.
|
|
69
|
+
*
|
|
70
|
+
* Cheap enough to animate per frame with Reanimated's `useAnimatedProps` — it re-uploads
|
|
71
|
+
* uniforms and redraws, and touches nothing else.
|
|
72
|
+
*/
|
|
73
|
+
glow?: IGlassGlow;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Adaptive glass. Defaults to `false`.
|
|
77
|
+
*
|
|
78
|
+
* On, the shader renderers (Android, and iOS below 26) read the mean luminance of the backdrop
|
|
79
|
+
* under the view — Android renders the provider content into an 8×8 probe off the RenderThread,
|
|
80
|
+
* iOS samples the capture it already holds — at most four times a second and only when the
|
|
81
|
+
* backdrop or the view moved. Two things follow from it: the frost's polarity tracks the
|
|
82
|
+
* backdrop instead of the colour scheme (dark content under a dark frost, light under a light
|
|
83
|
+
* one, with hysteresis at 0.45 / 0.55 and a 350 ms crossfade), and `onBackdropLuminance` fires
|
|
84
|
+
* so the content *on* the glass can flip to match — which is what `useAdaptiveGlass` and the
|
|
85
|
+
* kit's `adaptive` props do. iOS 26's native glass adapts on its own and ignores this.
|
|
86
|
+
*/
|
|
87
|
+
adaptive?: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The adaptive sensor's reading: the backdrop's mean luminance under the view, `0`–`1` in sRGB
|
|
91
|
+
* gamma space, and the polarity the glass has settled on. Fires when the value has moved by at
|
|
92
|
+
* least 0.02 or the polarity flipped; requires `adaptive`.
|
|
93
|
+
*/
|
|
94
|
+
onBackdropLuminance?: (reading: IGlassLuminanceReading) => void;
|
|
95
|
+
|
|
96
|
+
onRendererChange?: (renderer: TGlassActiveRenderer) => void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface IGlassLuminanceReading {
|
|
100
|
+
/** Mean luminance of the backdrop under the glass, `0` (black) to `1` (white). */
|
|
101
|
+
luminance: number;
|
|
102
|
+
/** Whether the glass has settled on the dark polarity — a dark frost, wanting light content. */
|
|
103
|
+
dark: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface IGlassGlow {
|
|
107
|
+
/** 0 = at rest, and the effect costs nothing; 1 = fully lit. */
|
|
108
|
+
progress: number;
|
|
109
|
+
|
|
110
|
+
/** Hotspot, view-local dp. Both default to the view's centre. */
|
|
111
|
+
x?: number;
|
|
112
|
+
y?: number;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Whether the press also bends the glass — the backdrop dent under the hotspot and the lens
|
|
116
|
+
* boost `interactive` applies. Default `false`: a surface hosting someone else's press should
|
|
117
|
+
* light up, not start refracting harder. Set it when the press really is on this glass and you
|
|
118
|
+
* are only driving it by hand.
|
|
119
|
+
*/
|
|
120
|
+
lens?: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type {
|
|
124
|
+
ILiquidGlassViewProps,
|
|
125
|
+
IGlassCornerRadii,
|
|
126
|
+
IGlassGlow,
|
|
127
|
+
IGlassLuminanceReading,
|
|
128
|
+
TGlassCornerRadius,
|
|
129
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TGlassActiveRenderer } from "../types";
|
|
2
|
+
import type {
|
|
3
|
+
IGlassLuminanceReading,
|
|
4
|
+
ILiquidGlassViewProps,
|
|
5
|
+
} from "./liquid-glass-view.interface";
|
|
6
|
+
|
|
7
|
+
interface INativeLiquidGlassViewProps extends Omit<
|
|
8
|
+
ILiquidGlassViewProps,
|
|
9
|
+
"containerStyle" | "onRendererChange" | "onBackdropLuminance" | "providerId"
|
|
10
|
+
> {
|
|
11
|
+
/** A single id on the wire; the JS component routes arrays to `providerIds`. */
|
|
12
|
+
providerId?: string;
|
|
13
|
+
providerIds?: string[];
|
|
14
|
+
onRendererChange?: (event: {
|
|
15
|
+
nativeEvent: { renderer: TGlassActiveRenderer };
|
|
16
|
+
}) => void;
|
|
17
|
+
onBackdropLuminance?: (event: { nativeEvent: IGlassLuminanceReading }) => void;
|
|
18
|
+
}
|
|
19
|
+
export type { INativeLiquidGlassViewProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { requireOptionalNativeModule } from "expo";
|
|
2
|
+
|
|
3
|
+
import { NATIVE_MODULE_NAME } from "../constants";
|
|
4
|
+
import type { IGlassHdrStatus } from "../interfaces";
|
|
5
|
+
|
|
6
|
+
interface IExpoLiquidGlassModule {
|
|
7
|
+
supportsNativeGlass: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether any glass renderer is available, native or not. Optional because natives built
|
|
10
|
+
* before this constant existed don't export it — readers must fall back to
|
|
11
|
+
* {@link supportsNativeGlass}, which restores the old (over-strict on iOS) behaviour.
|
|
12
|
+
*/
|
|
13
|
+
supportsGlass?: boolean;
|
|
14
|
+
/** Android only — absent on iOS and web. See {@link setGlassDebugLogging}. */
|
|
15
|
+
setDebugLogging?: (enabled: boolean) => void;
|
|
16
|
+
/** Android only — absent on iOS and web. See {@link setGlassHdrEnabled}. */
|
|
17
|
+
setHdrEnabled?: (enabled: boolean) => Promise<IGlassHdrStatus>;
|
|
18
|
+
/** Android only — absent on iOS and web. See {@link getGlassHdrStatus}. */
|
|
19
|
+
getHdrStatus?: () => IGlassHdrStatus;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ExpoLiquidGlassModule =
|
|
23
|
+
requireOptionalNativeModule<IExpoLiquidGlassModule>(NATIVE_MODULE_NAME);
|
|
24
|
+
|
|
25
|
+
export { ExpoLiquidGlassModule };
|
|
26
|
+
export type { IExpoLiquidGlassModule };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export {
|
|
2
|
+
LiquidGlassView,
|
|
3
|
+
LiquidGlassContainer,
|
|
4
|
+
LiquidGlassProvider,
|
|
5
|
+
LiquidGlassStack,
|
|
6
|
+
} from "../components";
|
|
7
|
+
export { NativeGlassBackdropView } from "../views";
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
supportsNativeGlass,
|
|
11
|
+
supportsGlass,
|
|
12
|
+
setGlassDebugLogging,
|
|
13
|
+
setGlassHdrEnabled,
|
|
14
|
+
getGlassHdrStatus,
|
|
15
|
+
} from "../utils";
|
|
16
|
+
export { useGlassStackProviderId } from "../context";
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
ILiquidGlassViewProps as LiquidGlassViewProps,
|
|
20
|
+
ILiquidGlassContainerProps as LiquidGlassContainerProps,
|
|
21
|
+
ILiquidGlassProviderProps as LiquidGlassProviderProps,
|
|
22
|
+
ILiquidGlassStackProps as LiquidGlassStackProps,
|
|
23
|
+
ILiquidGlassStackLayerProps as LiquidGlassStackLayerProps,
|
|
24
|
+
IGlassMetalOptions as GlassMetalOptions,
|
|
25
|
+
IGlassRefraction as GlassRefraction,
|
|
26
|
+
IGlassRefractionCurve as GlassRefractionCurve,
|
|
27
|
+
IGlassDispersion as GlassDispersion,
|
|
28
|
+
IGlassHighlight as GlassHighlight,
|
|
29
|
+
IGlassBorder as GlassBorder,
|
|
30
|
+
IGlassInnerShadow as GlassInnerShadow,
|
|
31
|
+
IGlassShapeRect as GlassShapeRect,
|
|
32
|
+
IGlassMorph as GlassMorph,
|
|
33
|
+
IGlassProgressiveBlur as GlassProgressiveBlur,
|
|
34
|
+
IGlassAndroidOptions as GlassAndroidOptions,
|
|
35
|
+
TGlassAndroidQuality as GlassAndroidQuality,
|
|
36
|
+
TGlassAndroidTier as GlassAndroidTier,
|
|
37
|
+
IGlassHdrStatus as GlassHdrStatus,
|
|
38
|
+
IGlassCornerRadii as GlassCornerRadii,
|
|
39
|
+
IGlassGlow as GlassGlow,
|
|
40
|
+
IGlassLuminanceReading as GlassLuminanceReading,
|
|
41
|
+
TGlassCornerRadius as GlassCornerRadius,
|
|
42
|
+
} from "../interfaces";
|
|
43
|
+
|
|
44
|
+
export type {
|
|
45
|
+
TGlassVariant,
|
|
46
|
+
TGlassRenderer,
|
|
47
|
+
TGlassActiveRenderer as GlassActiveRenderer,
|
|
48
|
+
TGlassCornerStyle as GlassCornerStyle,
|
|
49
|
+
} from "../types";
|
|
50
|
+
|
|
51
|
+
export { GlassRenderer, GlassVariant } from "../enum/index";
|