@luckylca/react-native-liquid-glass 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +294 -2
- package/README.zh-CN.md +297 -0
- package/THIRD_PARTY_NOTICES.md +98 -0
- package/android/build.gradle +19 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/expo/modules/liquidglass/EffectiveScrollInputBridge.kt +47 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassCaptureView.kt +1125 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassRegistry.kt +75 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassSurfaceView.kt +571 -0
- package/android/src/main/java/expo/modules/liquidglass/LiquidGlassModule.kt +205 -0
- package/android/src/main/java/expo/modules/liquidglass/LocalMaterialView.kt +138 -0
- package/android/src/main/java/expo/modules/liquidglass/PassSurfaceSuppression.kt +39 -0
- package/android/src/main/java/expo/modules/liquidglass/SharedGlassPassProbeLog.kt +23 -0
- package/android/src/main/java/expo/modules/liquidglass/SharedGlassPassWiring.kt +59 -0
- package/android-core/build.gradle +36 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/BackdropRecorder.kt +930 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/FrozenBackdrop.kt +66 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassBackdropCoordinator.kt +624 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassBackdropSourceHandle.kt +8 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassScrollSource.kt +13 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassViewController.kt +1002 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/LiquidGlassProviderLayout.kt +340 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/LiquidGlassView.kt +103 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/ReferenceSourceWindowPolicy.kt +13 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/StableSceneTexturePolicy.kt +43 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/SurfaceFrameBuilder.kt +278 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/SurfaceInteraction.kt +359 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/GlassFrame.kt +110 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/GlassViewRenderer.kt +728 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/ReferenceParityPasses.kt +705 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/ReferenceTabSampling.kt +15 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/SharedSceneCapture.kt +163 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassCapabilities.kt +21 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassEngine.kt +131 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassMaterial.kt +89 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassMath.kt +131 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassOpticalInsets.kt +8 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassRenderTier.kt +54 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassShapePacker.kt +77 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassSurfaceState.kt +11 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassUniforms.kt +113 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/LiquidGlassShaders.kt +234 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/SharedGlassPass.kt +456 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/geometry/G2RoundedRectangle.kt +207 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/geometry/ReferenceG2MaskTexture.kt +334 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/HeightFieldGlassShader.kt +7 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceBackdropBlurShader.kt +58 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceGaussianDiscBackdropBlur.kt +42 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceGlassUniforms.kt +111 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceParityGlassShader.kt +613 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceParityMultiShapeShader.kt +128 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/SdfScaleLensShader.kt +144 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassHardwareLayerExperiment.kt +29 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassMaterial.kt +14 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassRenderer.kt +126 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassRuntimeShader.kt +50 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassShader.kt +59 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassView.kt +47 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/GlassMotionDriver.kt +824 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/GlassMotionState.kt +359 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/PointerVelocityTracker.kt +109 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/SpringSpec.kt +209 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/G2Corner.kt +194 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassMaterial.kt +250 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassOpticsShader.kt +696 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassParityProbe.kt +342 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassShapeGeometry.kt +317 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassUniformBinder.kt +308 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/PixelDiff.kt +363 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/ReferenceOptics.kt +568 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/GlassSurfaceHost.kt +317 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/GlassSurfaceRenderer.kt +847 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/RetainedBackdropLayer.kt +83 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/scheduler/GlassFrameScheduler.kt +27 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/EffectiveScrollFpsProbe.kt +965 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/GlassTelemetry.kt +16 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LiquidGlassPerfTelemetry.kt +676 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LiquidGlassTrace.kt +30 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LocalGlassTelemetry.kt +55 -0
- package/app.plugin.js +25 -0
- package/docs/architecture.md +61 -0
- package/docs/images/buttons.webp +0 -0
- package/docs/images/controls.webp +0 -0
- package/docs/images/tabs.webp +0 -0
- package/docs/migration-0.3.md +19 -0
- package/docs/publishing.md +106 -0
- package/expo-module.config.json +10 -0
- package/lib/commonjs/GlassSurface.js +404 -0
- package/lib/commonjs/GlassSurface.js.map +1 -0
- package/lib/commonjs/GlassTabBar.js +37 -0
- package/lib/commonjs/GlassTabBar.js.map +1 -0
- package/lib/commonjs/GlassTabLens.js +67 -0
- package/lib/commonjs/GlassTabLens.js.map +1 -0
- package/lib/commonjs/LiquidGlassProvider.js +40 -0
- package/lib/commonjs/LiquidGlassProvider.js.map +1 -0
- package/lib/commonjs/LocalGlassMaterial.js +188 -0
- package/lib/commonjs/LocalGlassMaterial.js.map +1 -0
- package/lib/commonjs/adaptiveLuminance.js +14 -0
- package/lib/commonjs/adaptiveLuminance.js.map +1 -0
- package/lib/commonjs/badgePalette.js +46 -0
- package/lib/commonjs/badgePalette.js.map +1 -0
- package/lib/commonjs/buttonGesturePolicy.js +22 -0
- package/lib/commonjs/buttonGesturePolicy.js.map +1 -0
- package/lib/commonjs/components/AdaptiveLuminance.js +20 -0
- package/lib/commonjs/components/AdaptiveLuminance.js.map +1 -0
- package/lib/commonjs/components/BottomSheet.js +222 -0
- package/lib/commonjs/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/components/Button.js +20 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/Card.js +206 -0
- package/lib/commonjs/components/Card.js.map +1 -0
- package/lib/commonjs/components/Checkbox.js +123 -0
- package/lib/commonjs/components/Checkbox.js.map +1 -0
- package/lib/commonjs/components/ControlPressContext.js +8 -0
- package/lib/commonjs/components/ControlPressContext.js.map +1 -0
- package/lib/commonjs/components/Dialog.js +122 -0
- package/lib/commonjs/components/Dialog.js.map +1 -0
- package/lib/commonjs/components/DialogAction.js +124 -0
- package/lib/commonjs/components/DialogAction.js.map +1 -0
- package/lib/commonjs/components/DialogContent.js +23 -0
- package/lib/commonjs/components/DialogContent.js.map +1 -0
- package/lib/commonjs/components/GlassButton.js +96 -0
- package/lib/commonjs/components/GlassButton.js.map +1 -0
- package/lib/commonjs/components/GlassFab.js +43 -0
- package/lib/commonjs/components/GlassFab.js.map +1 -0
- package/lib/commonjs/components/GlassMagnifier.js +135 -0
- package/lib/commonjs/components/GlassMagnifier.js.map +1 -0
- package/lib/commonjs/components/GlassPlayground.js +158 -0
- package/lib/commonjs/components/GlassPlayground.js.map +1 -0
- package/lib/commonjs/components/GlassSlider.js +364 -0
- package/lib/commonjs/components/GlassSlider.js.map +1 -0
- package/lib/commonjs/components/GlassSwitch.js +334 -0
- package/lib/commonjs/components/GlassSwitch.js.map +1 -0
- package/lib/commonjs/components/GlassTabBar.js +387 -0
- package/lib/commonjs/components/GlassTabBar.js.map +1 -0
- package/lib/commonjs/components/Input.js +180 -0
- package/lib/commonjs/components/Input.js.map +1 -0
- package/lib/commonjs/components/ListRow.js +64 -0
- package/lib/commonjs/components/ListRow.js.map +1 -0
- package/lib/commonjs/components/Menu.js +214 -0
- package/lib/commonjs/components/Menu.js.map +1 -0
- package/lib/commonjs/components/NavigationBar.js +20 -0
- package/lib/commonjs/components/NavigationBar.js.map +1 -0
- package/lib/commonjs/components/NumberWheel.js +273 -0
- package/lib/commonjs/components/NumberWheel.js.map +1 -0
- package/lib/commonjs/components/PageFeedList.js +25 -0
- package/lib/commonjs/components/PageFeedList.js.map +1 -0
- package/lib/commonjs/components/PageScaffold.js +161 -0
- package/lib/commonjs/components/PageScaffold.js.map +1 -0
- package/lib/commonjs/components/PreferenceGroup.js +34 -0
- package/lib/commonjs/components/PreferenceGroup.js.map +1 -0
- package/lib/commonjs/components/ProgressIndicator.js +79 -0
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -0
- package/lib/commonjs/components/ProgressiveBlur.js +29 -0
- package/lib/commonjs/components/ProgressiveBlur.js.map +1 -0
- package/lib/commonjs/components/ReferenceSlider.js +304 -0
- package/lib/commonjs/components/ReferenceSlider.js.map +1 -0
- package/lib/commonjs/components/ReferenceTabBar.js +381 -0
- package/lib/commonjs/components/ReferenceTabBar.js.map +1 -0
- package/lib/commonjs/components/SearchBar.js +200 -0
- package/lib/commonjs/components/SearchBar.js.map +1 -0
- package/lib/commonjs/components/SegmentedControl.js +62 -0
- package/lib/commonjs/components/SegmentedControl.js.map +1 -0
- package/lib/commonjs/components/Slider.js +12 -0
- package/lib/commonjs/components/Slider.js.map +1 -0
- package/lib/commonjs/components/Snackbar.js +11 -0
- package/lib/commonjs/components/Snackbar.js.map +1 -0
- package/lib/commonjs/components/SurfaceEnvironmentContext.js +35 -0
- package/lib/commonjs/components/SurfaceEnvironmentContext.js.map +1 -0
- package/lib/commonjs/components/SurfaceGroup.js +39 -0
- package/lib/commonjs/components/SurfaceGroup.js.map +1 -0
- package/lib/commonjs/components/Switch.js +11 -0
- package/lib/commonjs/components/Switch.js.map +1 -0
- package/lib/commonjs/components/Toast.js +110 -0
- package/lib/commonjs/components/Toast.js.map +1 -0
- package/lib/commonjs/components/TopAppBar.js +107 -0
- package/lib/commonjs/components/TopAppBar.js.map +1 -0
- package/lib/commonjs/components/bottomSheetMotion.js +14 -0
- package/lib/commonjs/components/bottomSheetMotion.js.map +1 -0
- package/lib/commonjs/components/glassControlMaterial.js +22 -0
- package/lib/commonjs/components/glassControlMaterial.js.map +1 -0
- package/lib/commonjs/components/menuPosition.js +42 -0
- package/lib/commonjs/components/menuPosition.js.map +1 -0
- package/lib/commonjs/components/pages/FeedPage.js +15 -0
- package/lib/commonjs/components/pages/FeedPage.js.map +1 -0
- package/lib/commonjs/components/pages/PageBenchmarkContext.js +123 -0
- package/lib/commonjs/components/pages/PageBenchmarkContext.js.map +1 -0
- package/lib/commonjs/components/pages/SettingsPage.js +47 -0
- package/lib/commonjs/components/pages/SettingsPage.js.map +1 -0
- package/lib/commonjs/components/pages/SettingsSection.js +14 -0
- package/lib/commonjs/components/pages/SettingsSection.js.map +1 -0
- package/lib/commonjs/components/pages/StaticSettingsPage.js +16 -0
- package/lib/commonjs/components/pages/StaticSettingsPage.js.map +1 -0
- package/lib/commonjs/fallbackKnobGeometry.js +19 -0
- package/lib/commonjs/fallbackKnobGeometry.js.map +1 -0
- package/lib/commonjs/glassController.js +61 -0
- package/lib/commonjs/glassController.js.map +1 -0
- package/lib/commonjs/glassNativeEngine.js +16 -0
- package/lib/commonjs/glassNativeEngine.js.map +1 -0
- package/lib/commonjs/glassRuntime.js +15 -0
- package/lib/commonjs/glassRuntime.js.map +1 -0
- package/lib/commonjs/index.js +218 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/inputPresentation.js +17 -0
- package/lib/commonjs/inputPresentation.js.map +1 -0
- package/lib/commonjs/localGlassTelemetry.js +104 -0
- package/lib/commonjs/localGlassTelemetry.js.map +1 -0
- package/lib/commonjs/motion/MotionProvider.js +15 -0
- package/lib/commonjs/motion/MotionProvider.js.map +1 -0
- package/lib/commonjs/motion/easings.js +71 -0
- package/lib/commonjs/motion/easings.js.map +1 -0
- package/lib/commonjs/motion/folmeSpring.js +24 -0
- package/lib/commonjs/motion/folmeSpring.js.map +1 -0
- package/lib/commonjs/motion/folmeSpringByResponse.js +22 -0
- package/lib/commonjs/motion/folmeSpringByResponse.js.map +1 -0
- package/lib/commonjs/motion/index.js +57 -0
- package/lib/commonjs/motion/index.js.map +1 -0
- package/lib/commonjs/motion/presets.js +101 -0
- package/lib/commonjs/motion/presets.js.map +1 -0
- package/lib/commonjs/nativeGlassViews.js +30 -0
- package/lib/commonjs/nativeGlassViews.js.map +1 -0
- package/lib/commonjs/performanceTelemetry.js +24 -0
- package/lib/commonjs/performanceTelemetry.js.map +1 -0
- package/lib/commonjs/pointerEventBridge.js +17 -0
- package/lib/commonjs/pointerEventBridge.js.map +1 -0
- package/lib/commonjs/pointerGeometry.js +12 -0
- package/lib/commonjs/pointerGeometry.js.map +1 -0
- package/lib/commonjs/pressVelocity.js +34 -0
- package/lib/commonjs/pressVelocity.js.map +1 -0
- package/lib/commonjs/primitives/Divider.js +32 -0
- package/lib/commonjs/primitives/Divider.js.map +1 -0
- package/lib/commonjs/primitives/Icon.js +22 -0
- package/lib/commonjs/primitives/Icon.js.map +1 -0
- package/lib/commonjs/primitives/PressIndication.js +58 -0
- package/lib/commonjs/primitives/PressIndication.js.map +1 -0
- package/lib/commonjs/primitives/Pressable.js +28 -0
- package/lib/commonjs/primitives/Pressable.js.map +1 -0
- package/lib/commonjs/primitives/PressableScale.js +64 -0
- package/lib/commonjs/primitives/PressableScale.js.map +1 -0
- package/lib/commonjs/primitives/Surface.js +122 -0
- package/lib/commonjs/primitives/Surface.js.map +1 -0
- package/lib/commonjs/primitives/Text.js +43 -0
- package/lib/commonjs/primitives/Text.js.map +1 -0
- package/lib/commonjs/primitives/index.js +18 -0
- package/lib/commonjs/primitives/index.js.map +1 -0
- package/lib/commonjs/renderer.js +58 -0
- package/lib/commonjs/renderer.js.map +1 -0
- package/lib/commonjs/sliderValue.js +28 -0
- package/lib/commonjs/sliderValue.js.map +1 -0
- package/lib/commonjs/surface/InlineSurface.js +134 -0
- package/lib/commonjs/surface/InlineSurface.js.map +1 -0
- package/lib/commonjs/surface/MaterialProvider.js +78 -0
- package/lib/commonjs/surface/MaterialProvider.js.map +1 -0
- package/lib/commonjs/surface/NativeSurface.js +55 -0
- package/lib/commonjs/surface/NativeSurface.js.map +1 -0
- package/lib/commonjs/surface/PortalLayers.js +331 -0
- package/lib/commonjs/surface/PortalLayers.js.map +1 -0
- package/lib/commonjs/surface/contexts.js +108 -0
- package/lib/commonjs/surface/contexts.js.map +1 -0
- package/lib/commonjs/surface/registry.js +113 -0
- package/lib/commonjs/surface/registry.js.map +1 -0
- package/lib/commonjs/surface/styles.js +34 -0
- package/lib/commonjs/surface/styles.js.map +1 -0
- package/lib/commonjs/surface/types.js +3 -0
- package/lib/commonjs/surface/types.js.map +1 -0
- package/lib/commonjs/surfaceRendererPolicy.js +32 -0
- package/lib/commonjs/surfaceRendererPolicy.js.map +1 -0
- package/lib/commonjs/tabs/GlassTabItem.js +66 -0
- package/lib/commonjs/tabs/GlassTabItem.js.map +1 -0
- package/lib/commonjs/tabs/InlineTabBar.js +867 -0
- package/lib/commonjs/tabs/InlineTabBar.js.map +1 -0
- package/lib/commonjs/tabs/tabConstants.js +22 -0
- package/lib/commonjs/tabs/tabConstants.js.map +1 -0
- package/lib/commonjs/tabs/tabDebug.js +50 -0
- package/lib/commonjs/tabs/tabDebug.js.map +1 -0
- package/lib/commonjs/tabs/tabStyles.js +107 -0
- package/lib/commonjs/tabs/tabStyles.js.map +1 -0
- package/lib/commonjs/tabs/useInlineTabGesture.js +227 -0
- package/lib/commonjs/tabs/useInlineTabGesture.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +37 -0
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/buildTheme.js +157 -0
- package/lib/commonjs/theme/buildTheme.js.map +1 -0
- package/lib/commonjs/theme/glassColors.js +17 -0
- package/lib/commonjs/theme/glassColors.js.map +1 -0
- package/lib/commonjs/theme/index.js +38 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/liquidGlass.js +24 -0
- package/lib/commonjs/theme/liquidGlass.js.map +1 -0
- package/lib/commonjs/theme/presentation.js +14 -0
- package/lib/commonjs/theme/presentation.js.map +1 -0
- package/lib/commonjs/theme/registry.js +17 -0
- package/lib/commonjs/theme/registry.js.map +1 -0
- package/lib/commonjs/theme/selectVariant.js +13 -0
- package/lib/commonjs/theme/selectVariant.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +266 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/theme/types.js +3 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/wallpaper.js +91 -0
- package/lib/commonjs/theme/wallpaper.js.map +1 -0
- package/lib/commonjs/types.js +3 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useButtonGesture.js +135 -0
- package/lib/commonjs/useButtonGesture.js.map +1 -0
- package/lib/commonjs/useGlassKnobMotion.js +115 -0
- package/lib/commonjs/useGlassKnobMotion.js.map +1 -0
- package/lib/commonjs/useGlassPressMotion.js +147 -0
- package/lib/commonjs/useGlassPressMotion.js.map +1 -0
- package/lib/module/GlassSurface.js +354 -0
- package/lib/module/GlassSurface.js.map +1 -0
- package/lib/module/GlassTabBar.js +32 -0
- package/lib/module/GlassTabBar.js.map +1 -0
- package/lib/module/GlassTabLens.js +64 -0
- package/lib/module/GlassTabLens.js.map +1 -0
- package/lib/module/LiquidGlassProvider.js +37 -0
- package/lib/module/LiquidGlassProvider.js.map +1 -0
- package/lib/module/LocalGlassMaterial.js +185 -0
- package/lib/module/LocalGlassMaterial.js.map +1 -0
- package/lib/module/adaptiveLuminance.js +11 -0
- package/lib/module/adaptiveLuminance.js.map +1 -0
- package/lib/module/badgePalette.js +40 -0
- package/lib/module/badgePalette.js.map +1 -0
- package/lib/module/buttonGesturePolicy.js +17 -0
- package/lib/module/buttonGesturePolicy.js.map +1 -0
- package/lib/module/components/AdaptiveLuminance.js +16 -0
- package/lib/module/components/AdaptiveLuminance.js.map +1 -0
- package/lib/module/components/BottomSheet.js +186 -0
- package/lib/module/components/BottomSheet.js.map +1 -0
- package/lib/module/components/Button.js +17 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/Card.js +170 -0
- package/lib/module/components/Card.js.map +1 -0
- package/lib/module/components/Checkbox.js +84 -0
- package/lib/module/components/Checkbox.js.map +1 -0
- package/lib/module/components/ControlPressContext.js +4 -0
- package/lib/module/components/ControlPressContext.js.map +1 -0
- package/lib/module/components/Dialog.js +86 -0
- package/lib/module/components/Dialog.js.map +1 -0
- package/lib/module/components/DialogAction.js +88 -0
- package/lib/module/components/DialogAction.js.map +1 -0
- package/lib/module/components/DialogContent.js +20 -0
- package/lib/module/components/DialogContent.js.map +1 -0
- package/lib/module/components/GlassButton.js +93 -0
- package/lib/module/components/GlassButton.js.map +1 -0
- package/lib/module/components/GlassFab.js +37 -0
- package/lib/module/components/GlassFab.js.map +1 -0
- package/lib/module/components/GlassMagnifier.js +99 -0
- package/lib/module/components/GlassMagnifier.js.map +1 -0
- package/lib/module/components/GlassPlayground.js +122 -0
- package/lib/module/components/GlassPlayground.js.map +1 -0
- package/lib/module/components/GlassSlider.js +328 -0
- package/lib/module/components/GlassSlider.js.map +1 -0
- package/lib/module/components/GlassSwitch.js +298 -0
- package/lib/module/components/GlassSwitch.js.map +1 -0
- package/lib/module/components/GlassTabBar.js +351 -0
- package/lib/module/components/GlassTabBar.js.map +1 -0
- package/lib/module/components/Input.js +144 -0
- package/lib/module/components/Input.js.map +1 -0
- package/lib/module/components/ListRow.js +61 -0
- package/lib/module/components/ListRow.js.map +1 -0
- package/lib/module/components/Menu.js +178 -0
- package/lib/module/components/Menu.js.map +1 -0
- package/lib/module/components/NavigationBar.js +14 -0
- package/lib/module/components/NavigationBar.js.map +1 -0
- package/lib/module/components/NumberWheel.js +238 -0
- package/lib/module/components/NumberWheel.js.map +1 -0
- package/lib/module/components/PageFeedList.js +19 -0
- package/lib/module/components/PageFeedList.js.map +1 -0
- package/lib/module/components/PageScaffold.js +114 -0
- package/lib/module/components/PageScaffold.js.map +1 -0
- package/lib/module/components/PreferenceGroup.js +28 -0
- package/lib/module/components/PreferenceGroup.js.map +1 -0
- package/lib/module/components/ProgressIndicator.js +44 -0
- package/lib/module/components/ProgressIndicator.js.map +1 -0
- package/lib/module/components/ProgressiveBlur.js +26 -0
- package/lib/module/components/ProgressiveBlur.js.map +1 -0
- package/lib/module/components/ReferenceSlider.js +268 -0
- package/lib/module/components/ReferenceSlider.js.map +1 -0
- package/lib/module/components/ReferenceTabBar.js +344 -0
- package/lib/module/components/ReferenceTabBar.js.map +1 -0
- package/lib/module/components/SearchBar.js +164 -0
- package/lib/module/components/SearchBar.js.map +1 -0
- package/lib/module/components/SegmentedControl.js +26 -0
- package/lib/module/components/SegmentedControl.js.map +1 -0
- package/lib/module/components/Slider.js +9 -0
- package/lib/module/components/Slider.js.map +1 -0
- package/lib/module/components/Snackbar.js +8 -0
- package/lib/module/components/Snackbar.js.map +1 -0
- package/lib/module/components/SurfaceEnvironmentContext.js +27 -0
- package/lib/module/components/SurfaceEnvironmentContext.js.map +1 -0
- package/lib/module/components/SurfaceGroup.js +33 -0
- package/lib/module/components/SurfaceGroup.js.map +1 -0
- package/lib/module/components/Switch.js +8 -0
- package/lib/module/components/Switch.js.map +1 -0
- package/lib/module/components/Toast.js +74 -0
- package/lib/module/components/Toast.js.map +1 -0
- package/lib/module/components/TopAppBar.js +68 -0
- package/lib/module/components/TopAppBar.js.map +1 -0
- package/lib/module/components/bottomSheetMotion.js +11 -0
- package/lib/module/components/bottomSheetMotion.js.map +1 -0
- package/lib/module/components/glassControlMaterial.js +19 -0
- package/lib/module/components/glassControlMaterial.js.map +1 -0
- package/lib/module/components/menuPosition.js +37 -0
- package/lib/module/components/menuPosition.js.map +1 -0
- package/lib/module/components/pages/FeedPage.js +12 -0
- package/lib/module/components/pages/FeedPage.js.map +1 -0
- package/lib/module/components/pages/PageBenchmarkContext.js +84 -0
- package/lib/module/components/pages/PageBenchmarkContext.js.map +1 -0
- package/lib/module/components/pages/SettingsPage.js +11 -0
- package/lib/module/components/pages/SettingsPage.js.map +1 -0
- package/lib/module/components/pages/SettingsSection.js +8 -0
- package/lib/module/components/pages/SettingsSection.js.map +1 -0
- package/lib/module/components/pages/StaticSettingsPage.js +10 -0
- package/lib/module/components/pages/StaticSettingsPage.js.map +1 -0
- package/lib/module/fallbackKnobGeometry.js +16 -0
- package/lib/module/fallbackKnobGeometry.js.map +1 -0
- package/lib/module/glassController.js +54 -0
- package/lib/module/glassController.js.map +1 -0
- package/lib/module/glassNativeEngine.js +11 -0
- package/lib/module/glassNativeEngine.js.map +1 -0
- package/lib/module/glassRuntime.js +10 -0
- package/lib/module/glassRuntime.js.map +1 -0
- package/lib/module/index.js +80 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/inputPresentation.js +14 -0
- package/lib/module/inputPresentation.js.map +1 -0
- package/lib/module/localGlassTelemetry.js +94 -0
- package/lib/module/localGlassTelemetry.js.map +1 -0
- package/lib/module/motion/MotionProvider.js +11 -0
- package/lib/module/motion/MotionProvider.js.map +1 -0
- package/lib/module/motion/easings.js +64 -0
- package/lib/module/motion/easings.js.map +1 -0
- package/lib/module/motion/folmeSpring.js +21 -0
- package/lib/module/motion/folmeSpring.js.map +1 -0
- package/lib/module/motion/folmeSpringByResponse.js +19 -0
- package/lib/module/motion/folmeSpringByResponse.js.map +1 -0
- package/lib/module/motion/index.js +6 -0
- package/lib/module/motion/index.js.map +1 -0
- package/lib/module/motion/presets.js +98 -0
- package/lib/module/motion/presets.js.map +1 -0
- package/lib/module/nativeGlassViews.js +24 -0
- package/lib/module/nativeGlassViews.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performanceTelemetry.js +19 -0
- package/lib/module/performanceTelemetry.js.map +1 -0
- package/lib/module/pointerEventBridge.js +14 -0
- package/lib/module/pointerEventBridge.js.map +1 -0
- package/lib/module/pointerGeometry.js +9 -0
- package/lib/module/pointerGeometry.js.map +1 -0
- package/lib/module/pressVelocity.js +31 -0
- package/lib/module/pressVelocity.js.map +1 -0
- package/lib/module/primitives/Divider.js +29 -0
- package/lib/module/primitives/Divider.js.map +1 -0
- package/lib/module/primitives/Icon.js +19 -0
- package/lib/module/primitives/Icon.js.map +1 -0
- package/lib/module/primitives/PressIndication.js +22 -0
- package/lib/module/primitives/PressIndication.js.map +1 -0
- package/lib/module/primitives/Pressable.js +25 -0
- package/lib/module/primitives/Pressable.js.map +1 -0
- package/lib/module/primitives/PressableScale.js +28 -0
- package/lib/module/primitives/PressableScale.js.map +1 -0
- package/lib/module/primitives/Surface.js +83 -0
- package/lib/module/primitives/Surface.js.map +1 -0
- package/lib/module/primitives/Text.js +40 -0
- package/lib/module/primitives/Text.js.map +1 -0
- package/lib/module/primitives/index.js +8 -0
- package/lib/module/primitives/index.js.map +1 -0
- package/lib/module/renderer.js +22 -0
- package/lib/module/renderer.js.map +1 -0
- package/lib/module/sliderValue.js +25 -0
- package/lib/module/sliderValue.js.map +1 -0
- package/lib/module/surface/InlineSurface.js +97 -0
- package/lib/module/surface/InlineSurface.js.map +1 -0
- package/lib/module/surface/MaterialProvider.js +74 -0
- package/lib/module/surface/MaterialProvider.js.map +1 -0
- package/lib/module/surface/NativeSurface.js +47 -0
- package/lib/module/surface/NativeSurface.js.map +1 -0
- package/lib/module/surface/PortalLayers.js +292 -0
- package/lib/module/surface/PortalLayers.js.map +1 -0
- package/lib/module/surface/contexts.js +96 -0
- package/lib/module/surface/contexts.js.map +1 -0
- package/lib/module/surface/registry.js +103 -0
- package/lib/module/surface/registry.js.map +1 -0
- package/lib/module/surface/styles.js +31 -0
- package/lib/module/surface/styles.js.map +1 -0
- package/lib/module/surface/types.js +2 -0
- package/lib/module/surface/types.js.map +1 -0
- package/lib/module/surfaceRendererPolicy.js +27 -0
- package/lib/module/surfaceRendererPolicy.js.map +1 -0
- package/lib/module/tabs/GlassTabItem.js +30 -0
- package/lib/module/tabs/GlassTabItem.js.map +1 -0
- package/lib/module/tabs/InlineTabBar.js +829 -0
- package/lib/module/tabs/InlineTabBar.js.map +1 -0
- package/lib/module/tabs/tabConstants.js +19 -0
- package/lib/module/tabs/tabConstants.js.map +1 -0
- package/lib/module/tabs/tabDebug.js +13 -0
- package/lib/module/tabs/tabDebug.js.map +1 -0
- package/lib/module/tabs/tabStyles.js +104 -0
- package/lib/module/tabs/tabStyles.js.map +1 -0
- package/lib/module/tabs/useInlineTabGesture.js +221 -0
- package/lib/module/tabs/useInlineTabGesture.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +32 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/buildTheme.js +153 -0
- package/lib/module/theme/buildTheme.js.map +1 -0
- package/lib/module/theme/glassColors.js +14 -0
- package/lib/module/theme/glassColors.js.map +1 -0
- package/lib/module/theme/index.js +9 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/liquidGlass.js +21 -0
- package/lib/module/theme/liquidGlass.js.map +1 -0
- package/lib/module/theme/presentation.js +11 -0
- package/lib/module/theme/presentation.js.map +1 -0
- package/lib/module/theme/registry.js +13 -0
- package/lib/module/theme/registry.js.map +1 -0
- package/lib/module/theme/selectVariant.js +10 -0
- package/lib/module/theme/selectVariant.js.map +1 -0
- package/lib/module/theme/tokens.js +262 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/theme/types.js +2 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/wallpaper.js +83 -0
- package/lib/module/theme/wallpaper.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useButtonGesture.js +132 -0
- package/lib/module/useButtonGesture.js.map +1 -0
- package/lib/module/useGlassKnobMotion.js +112 -0
- package/lib/module/useGlassKnobMotion.js.map +1 -0
- package/lib/module/useGlassPressMotion.js +143 -0
- package/lib/module/useGlassPressMotion.js.map +1 -0
- package/lib/types/GlassSurface.d.ts +147 -0
- package/lib/types/GlassTabBar.d.ts +36 -0
- package/lib/types/GlassTabLens.d.ts +11 -0
- package/lib/types/LiquidGlassProvider.d.ts +47 -0
- package/lib/types/LocalGlassMaterial.d.ts +21 -0
- package/lib/types/adaptiveLuminance.d.ts +2 -0
- package/lib/types/badgePalette.d.ts +9 -0
- package/lib/types/buttonGesturePolicy.d.ts +4 -0
- package/lib/types/components/AdaptiveLuminance.d.ts +23 -0
- package/lib/types/components/BottomSheet.d.ts +33 -0
- package/lib/types/components/Button.d.ts +16 -0
- package/lib/types/components/Card.d.ts +25 -0
- package/lib/types/components/Checkbox.d.ts +11 -0
- package/lib/types/components/ControlPressContext.d.ts +9 -0
- package/lib/types/components/Dialog.d.ts +12 -0
- package/lib/types/components/DialogAction.d.ts +4 -0
- package/lib/types/components/DialogContent.d.ts +12 -0
- package/lib/types/components/GlassButton.d.ts +38 -0
- package/lib/types/components/GlassFab.d.ts +15 -0
- package/lib/types/components/GlassMagnifier.d.ts +41 -0
- package/lib/types/components/GlassPlayground.d.ts +12 -0
- package/lib/types/components/GlassSlider.d.ts +48 -0
- package/lib/types/components/GlassSwitch.d.ts +46 -0
- package/lib/types/components/GlassTabBar.d.ts +44 -0
- package/lib/types/components/Input.d.ts +47 -0
- package/lib/types/components/ListRow.d.ts +17 -0
- package/lib/types/components/Menu.d.ts +41 -0
- package/lib/types/components/NavigationBar.d.ts +14 -0
- package/lib/types/components/NumberWheel.d.ts +11 -0
- package/lib/types/components/PageFeedList.d.ts +6 -0
- package/lib/types/components/PageScaffold.d.ts +64 -0
- package/lib/types/components/PreferenceGroup.d.ts +12 -0
- package/lib/types/components/ProgressIndicator.d.ts +9 -0
- package/lib/types/components/ProgressiveBlur.d.ts +12 -0
- package/lib/types/components/ReferenceSlider.d.ts +31 -0
- package/lib/types/components/ReferenceTabBar.d.ts +61 -0
- package/lib/types/components/SearchBar.d.ts +52 -0
- package/lib/types/components/SegmentedControl.d.ts +10 -0
- package/lib/types/components/Slider.d.ts +19 -0
- package/lib/types/components/Snackbar.d.ts +5 -0
- package/lib/types/components/SurfaceEnvironmentContext.d.ts +17 -0
- package/lib/types/components/SurfaceGroup.d.ts +17 -0
- package/lib/types/components/Switch.d.ts +12 -0
- package/lib/types/components/Toast.d.ts +14 -0
- package/lib/types/components/TopAppBar.d.ts +49 -0
- package/lib/types/components/bottomSheetMotion.d.ts +2 -0
- package/lib/types/components/glassControlMaterial.d.ts +3 -0
- package/lib/types/components/menuPosition.d.ts +22 -0
- package/lib/types/components/pages/FeedPage.d.ts +31 -0
- package/lib/types/components/pages/PageBenchmarkContext.d.ts +30 -0
- package/lib/types/components/pages/SettingsPage.d.ts +20 -0
- package/lib/types/components/pages/SettingsSection.d.ts +9 -0
- package/lib/types/components/pages/StaticSettingsPage.d.ts +18 -0
- package/lib/types/fallbackKnobGeometry.d.ts +7 -0
- package/lib/types/glassController.d.ts +20 -0
- package/lib/types/glassNativeEngine.d.ts +5 -0
- package/lib/types/glassRuntime.d.ts +10 -0
- package/lib/types/index.d.ts +124 -0
- package/lib/types/inputPresentation.d.ts +12 -0
- package/lib/types/localGlassTelemetry.d.ts +28 -0
- package/lib/types/motion/MotionProvider.d.ts +7 -0
- package/lib/types/motion/easings.d.ts +33 -0
- package/lib/types/motion/folmeSpring.d.ts +15 -0
- package/lib/types/motion/folmeSpringByResponse.d.ts +14 -0
- package/lib/types/motion/index.d.ts +7 -0
- package/lib/types/motion/presets.d.ts +103 -0
- package/lib/types/nativeGlassViews.d.ts +112 -0
- package/lib/types/performanceTelemetry.d.ts +65 -0
- package/lib/types/pointerEventBridge.d.ts +17 -0
- package/lib/types/pointerGeometry.d.ts +2 -0
- package/lib/types/pressVelocity.d.ts +11 -0
- package/lib/types/primitives/Divider.d.ts +19 -0
- package/lib/types/primitives/Icon.d.ts +29 -0
- package/lib/types/primitives/PressIndication.d.ts +26 -0
- package/lib/types/primitives/Pressable.d.ts +9 -0
- package/lib/types/primitives/PressableScale.d.ts +19 -0
- package/lib/types/primitives/Surface.d.ts +63 -0
- package/lib/types/primitives/Text.d.ts +35 -0
- package/lib/types/primitives/index.d.ts +14 -0
- package/lib/types/renderer.d.ts +32 -0
- package/lib/types/sliderValue.d.ts +2 -0
- package/lib/types/surface/InlineSurface.d.ts +42 -0
- package/lib/types/surface/MaterialProvider.d.ts +46 -0
- package/lib/types/surface/NativeSurface.d.ts +11 -0
- package/lib/types/surface/PortalLayers.d.ts +33 -0
- package/lib/types/surface/contexts.d.ts +66 -0
- package/lib/types/surface/registry.d.ts +6 -0
- package/lib/types/surface/styles.d.ts +74 -0
- package/lib/types/surface/types.d.ts +118 -0
- package/lib/types/surfaceRendererPolicy.d.ts +14 -0
- package/lib/types/tabs/GlassTabItem.d.ts +20 -0
- package/lib/types/tabs/InlineTabBar.d.ts +5 -0
- package/lib/types/tabs/tabConstants.d.ts +34 -0
- package/lib/types/tabs/tabDebug.d.ts +15 -0
- package/lib/types/tabs/tabStyles.d.ts +119 -0
- package/lib/types/tabs/useInlineTabGesture.d.ts +34 -0
- package/lib/types/theme/ThemeProvider.d.ts +26 -0
- package/lib/types/theme/buildTheme.d.ts +6 -0
- package/lib/types/theme/glassColors.d.ts +13 -0
- package/lib/types/theme/index.d.ts +11 -0
- package/lib/types/theme/liquidGlass.d.ts +5 -0
- package/lib/types/theme/presentation.d.ts +3 -0
- package/lib/types/theme/registry.d.ts +7 -0
- package/lib/types/theme/selectVariant.d.ts +10 -0
- package/lib/types/theme/tokens.d.ts +18 -0
- package/lib/types/theme/types.d.ts +305 -0
- package/lib/types/theme/wallpaper.d.ts +32 -0
- package/lib/types/types.d.ts +127 -0
- package/lib/types/useButtonGesture.d.ts +30 -0
- package/lib/types/useGlassKnobMotion.d.ts +40 -0
- package/lib/types/useGlassPressMotion.d.ts +61 -0
- package/licenses/Apache-2.0-Kyant0-Shapes.txt +191 -0
- package/package.json +131 -4
- package/src/GlassSurface.tsx +676 -0
- package/src/GlassTabBar.tsx +106 -0
- package/src/GlassTabLens.tsx +92 -0
- package/src/LiquidGlassProvider.tsx +135 -0
- package/src/LocalGlassMaterial.tsx +256 -0
- package/src/adaptiveLuminance.ts +15 -0
- package/src/badgePalette.ts +54 -0
- package/src/buttonGesturePolicy.ts +15 -0
- package/src/components/AdaptiveLuminance.tsx +40 -0
- package/src/components/BottomSheet.tsx +291 -0
- package/src/components/Button.tsx +30 -0
- package/src/components/Card.tsx +343 -0
- package/src/components/Checkbox.tsx +141 -0
- package/src/components/ControlPressContext.ts +11 -0
- package/src/components/Dialog.tsx +129 -0
- package/src/components/DialogAction.tsx +109 -0
- package/src/components/DialogContent.tsx +52 -0
- package/src/components/GlassButton.tsx +225 -0
- package/src/components/GlassFab.tsx +98 -0
- package/src/components/GlassMagnifier.tsx +178 -0
- package/src/components/GlassPlayground.tsx +190 -0
- package/src/components/GlassSlider.tsx +448 -0
- package/src/components/GlassSwitch.tsx +391 -0
- package/src/components/GlassTabBar.tsx +522 -0
- package/src/components/Input.tsx +277 -0
- package/src/components/ListRow.tsx +124 -0
- package/src/components/Menu.tsx +322 -0
- package/src/components/NavigationBar.tsx +27 -0
- package/src/components/NumberWheel.tsx +344 -0
- package/src/components/PageFeedList.tsx +37 -0
- package/src/components/PageScaffold.tsx +266 -0
- package/src/components/PreferenceGroup.tsx +65 -0
- package/src/components/ProgressIndicator.tsx +63 -0
- package/src/components/ProgressiveBlur.tsx +56 -0
- package/src/components/ReferenceSlider.tsx +364 -0
- package/src/components/ReferenceTabBar.tsx +564 -0
- package/src/components/SearchBar.tsx +340 -0
- package/src/components/SegmentedControl.tsx +45 -0
- package/src/components/Slider.tsx +25 -0
- package/src/components/Snackbar.tsx +10 -0
- package/src/components/SurfaceEnvironmentContext.tsx +46 -0
- package/src/components/SurfaceGroup.tsx +60 -0
- package/src/components/Switch.tsx +18 -0
- package/src/components/Toast.tsx +110 -0
- package/src/components/TopAppBar.tsx +272 -0
- package/src/components/bottomSheetMotion.ts +10 -0
- package/src/components/glassControlMaterial.ts +20 -0
- package/src/components/menuPosition.ts +58 -0
- package/src/components/pages/FeedPage.tsx +96 -0
- package/src/components/pages/PageBenchmarkContext.tsx +105 -0
- package/src/components/pages/SettingsPage.tsx +55 -0
- package/src/components/pages/SettingsSection.tsx +20 -0
- package/src/components/pages/StaticSettingsPage.tsx +50 -0
- package/src/fallbackKnobGeometry.ts +15 -0
- package/src/glassController.ts +70 -0
- package/src/glassNativeEngine.ts +16 -0
- package/src/glassRuntime.ts +11 -0
- package/src/index.ts +199 -0
- package/src/inputPresentation.ts +32 -0
- package/src/localGlassTelemetry.ts +129 -0
- package/src/motion/MotionProvider.tsx +12 -0
- package/src/motion/easings.ts +71 -0
- package/src/motion/folmeSpring.ts +22 -0
- package/src/motion/folmeSpringByResponse.ts +19 -0
- package/src/motion/index.ts +47 -0
- package/src/motion/presets.ts +128 -0
- package/src/nativeGlassViews.ts +144 -0
- package/src/performanceTelemetry.ts +91 -0
- package/src/pointerEventBridge.ts +27 -0
- package/src/pointerGeometry.ts +8 -0
- package/src/pressVelocity.ts +36 -0
- package/src/primitives/Divider.tsx +42 -0
- package/src/primitives/Icon.tsx +44 -0
- package/src/primitives/PressIndication.tsx +43 -0
- package/src/primitives/Pressable.tsx +75 -0
- package/src/primitives/PressableScale.tsx +50 -0
- package/src/primitives/Surface.tsx +171 -0
- package/src/primitives/Text.tsx +80 -0
- package/src/primitives/index.ts +14 -0
- package/src/renderer.ts +70 -0
- package/src/sliderValue.ts +19 -0
- package/src/surface/InlineSurface.tsx +299 -0
- package/src/surface/MaterialProvider.tsx +235 -0
- package/src/surface/NativeSurface.tsx +115 -0
- package/src/surface/PortalLayers.tsx +574 -0
- package/src/surface/contexts.tsx +188 -0
- package/src/surface/registry.ts +109 -0
- package/src/surface/styles.ts +31 -0
- package/src/surface/types.ts +139 -0
- package/src/surfaceRendererPolicy.ts +32 -0
- package/src/tabs/GlassTabItem.tsx +100 -0
- package/src/tabs/InlineTabBar.tsx +1193 -0
- package/src/tabs/tabConstants.ts +35 -0
- package/src/tabs/tabDebug.ts +29 -0
- package/src/tabs/tabStyles.ts +104 -0
- package/src/tabs/useInlineTabGesture.ts +306 -0
- package/src/theme/ThemeProvider.tsx +52 -0
- package/src/theme/buildTheme.ts +160 -0
- package/src/theme/glassColors.ts +13 -0
- package/src/theme/index.ts +34 -0
- package/src/theme/liquidGlass.ts +25 -0
- package/src/theme/presentation.ts +12 -0
- package/src/theme/registry.ts +16 -0
- package/src/theme/selectVariant.ts +12 -0
- package/src/theme/tokens.ts +309 -0
- package/src/theme/types.ts +345 -0
- package/src/theme/wallpaper.ts +94 -0
- package/src/types.ts +95 -0
- package/src/useButtonGesture.ts +134 -0
- package/src/useGlassKnobMotion.ts +155 -0
- package/src/useGlassPressMotion.ts +209 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalGlassMaterial = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_skia_1 = require("@shopify/react-native-skia");
|
|
6
|
+
const expo_modules_core_1 = require("expo-modules-core");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const localGlassTelemetry_1 = require("./localGlassTelemetry");
|
|
10
|
+
const surfaceRendererPolicy_1 = require("./surfaceRendererPolicy");
|
|
11
|
+
const GLASS_SHADER = `
|
|
12
|
+
uniform float2 resolution;
|
|
13
|
+
uniform float4 baseTint;
|
|
14
|
+
uniform float4 accentTint;
|
|
15
|
+
uniform float4 highlightTint;
|
|
16
|
+
uniform float4 innerShade;
|
|
17
|
+
uniform float surfaceWarp;
|
|
18
|
+
uniform float chromatic;
|
|
19
|
+
uniform float highlightStrength;
|
|
20
|
+
uniform float noiseStrength;
|
|
21
|
+
uniform float materialOpacity;
|
|
22
|
+
uniform float cornerRadiusPx;
|
|
23
|
+
|
|
24
|
+
half4 main(float2 position) {
|
|
25
|
+
float2 size = max(resolution, float2(1.0));
|
|
26
|
+
float2 uv = clamp(position / size, float2(0.0), float2(1.0));
|
|
27
|
+
|
|
28
|
+
// Local surfaces only warp their procedural lighting field. This is a
|
|
29
|
+
// low-cost shell material, not backdrop refraction; the tab selection lens
|
|
30
|
+
// uses the native sampled AGSL path instead.
|
|
31
|
+
float bend = sin((uv.x * 1.35 + uv.y * 0.72) * 6.28318) * surfaceWarp * 0.0018;
|
|
32
|
+
float2 lightUv = clamp(uv + float2(bend, -bend * 0.55), float2(0.0), float2(1.0));
|
|
33
|
+
float vertical = 1.0 - smoothstep(0.0, 1.0, lightUv.y);
|
|
34
|
+
float radius = clamp(cornerRadiusPx / min(size.x, size.y), 0.0, 0.5);
|
|
35
|
+
float2 p = uv - float2(0.5);
|
|
36
|
+
float2 q = abs(p) - float2(0.5 - radius);
|
|
37
|
+
float signedEdgeDistance = length(max(q, float2(0.0))) + min(max(q.x, q.y), 0.0) - radius;
|
|
38
|
+
float edgeDepth = max(-signedEdgeDistance, 0.0);
|
|
39
|
+
|
|
40
|
+
float2 outside = max(q, float2(0.0));
|
|
41
|
+
float2 edgeNormal = length(outside) > 0.0001
|
|
42
|
+
? normalize(outside) * sign(p)
|
|
43
|
+
: (q.x > q.y ? float2(sign(p.x), 0.0) : float2(0.0, sign(p.y)));
|
|
44
|
+
float2 lightDirection = normalize(float2(-0.52, -0.85));
|
|
45
|
+
float edgeFacing = max(dot(edgeNormal, lightDirection), 0.0);
|
|
46
|
+
float edgeLight = 0.2 + 0.8 * pow(edgeFacing, 1.35);
|
|
47
|
+
float fresnel = (1.0 - smoothstep(0.0, 0.105, edgeDepth)) * edgeLight;
|
|
48
|
+
float innerShadow = smoothstep(0.005, 0.045, edgeDepth) * (1.0 - smoothstep(0.045, 0.14, edgeDepth));
|
|
49
|
+
float sideReflection = exp(-pow((uv.x - 0.025) * 24.0, 2.0)) + exp(-pow((uv.x - 0.975) * 24.0, 2.0));
|
|
50
|
+
|
|
51
|
+
float3 body = mix(baseTint.rgb, accentTint.rgb, 0.12 + vertical * 0.18);
|
|
52
|
+
float3 color = body;
|
|
53
|
+
color += highlightTint.rgb * sideReflection * 0.035 * highlightStrength;
|
|
54
|
+
color += highlightTint.rgb * fresnel * (0.055 + highlightStrength * 0.11);
|
|
55
|
+
color -= innerShade.rgb * innerShadow * 0.16;
|
|
56
|
+
|
|
57
|
+
// A restrained RGB fringe suggests a thick polished edge without a blur
|
|
58
|
+
// pass or a sample of the changing page behind the control.
|
|
59
|
+
float dispersion = fresnel * chromatic * 0.055;
|
|
60
|
+
color += float3(dispersion * 0.82, dispersion * 0.12, -dispersion * 0.48);
|
|
61
|
+
|
|
62
|
+
float grain = fract(sin(dot(floor(position), float2(12.9898, 78.233))) * 43758.5453) - 0.5;
|
|
63
|
+
color += grain * noiseStrength;
|
|
64
|
+
color = clamp(color, float3(0.0), float3(1.0));
|
|
65
|
+
|
|
66
|
+
float alpha = clamp((baseTint.a + accentTint.a * (0.22 + vertical * 0.08)) * materialOpacity, 0.0, 0.72);
|
|
67
|
+
// Skia shader colors are premultiplied before source-over compositing.
|
|
68
|
+
// Leaving RGB unscaled makes translucent light tints look almost opaque.
|
|
69
|
+
return half4(color * alpha, alpha);
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
const NativeLocalGlassView = react_native_1.Platform.OS === 'android'
|
|
73
|
+
? (0, expo_modules_core_1.requireNativeViewManager)('LiquidGlass', 'LocalGlassMaterial')
|
|
74
|
+
: null;
|
|
75
|
+
const resolvedMaterialCache = new Map();
|
|
76
|
+
const MAX_RESOLVED_MATERIALS = 48;
|
|
77
|
+
let sharedShader;
|
|
78
|
+
function getSharedShader() {
|
|
79
|
+
if (sharedShader !== undefined)
|
|
80
|
+
return sharedShader;
|
|
81
|
+
try {
|
|
82
|
+
sharedShader = react_native_skia_1.Skia.RuntimeEffect.Make(GLASS_SHADER);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.warn('[LiquidGlass] Local SkSL shader unavailable; using the material fallback.', error);
|
|
86
|
+
sharedShader = null;
|
|
87
|
+
}
|
|
88
|
+
return sharedShader;
|
|
89
|
+
}
|
|
90
|
+
function rgba(value) {
|
|
91
|
+
const functional = value.match(/rgba?\(([^)]+)\)/i);
|
|
92
|
+
if (functional) {
|
|
93
|
+
const parts = functional[1].split(',').map((part) => Number.parseFloat(part.trim()));
|
|
94
|
+
if (parts.length >= 3 && parts.slice(0, 3).every(Number.isFinite)) {
|
|
95
|
+
return [parts[0] / 255, parts[1] / 255, parts[2] / 255, parts[3] ?? 1];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const hex = value.replace('#', '').trim();
|
|
99
|
+
if (/^[0-9a-f]{3}$/i.test(hex)) {
|
|
100
|
+
return [...hex].map((digit) => Number.parseInt(`${digit}${digit}`, 16) / 255).concat(1);
|
|
101
|
+
}
|
|
102
|
+
if (/^[0-9a-f]{6}([0-9a-f]{2})?$/i.test(hex)) {
|
|
103
|
+
return [
|
|
104
|
+
Number.parseInt(hex.slice(0, 2), 16) / 255,
|
|
105
|
+
Number.parseInt(hex.slice(2, 4), 16) / 255,
|
|
106
|
+
Number.parseInt(hex.slice(4, 6), 16) / 255,
|
|
107
|
+
hex.length === 8 ? Number.parseInt(hex.slice(6, 8), 16) / 255 : 1,
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
return [1, 1, 1, 0.2];
|
|
111
|
+
}
|
|
112
|
+
function resolveMaterial(tokens, material, dark) {
|
|
113
|
+
const mode = dark ? 'dark' : 'light';
|
|
114
|
+
const colorValues = [
|
|
115
|
+
tokens.procedural.baseTint[mode],
|
|
116
|
+
(material.accentTint ?? tokens.procedural.accentTint)[mode],
|
|
117
|
+
tokens.procedural.highlightTint[mode],
|
|
118
|
+
tokens.procedural.innerShade[mode],
|
|
119
|
+
];
|
|
120
|
+
const scalarValues = [
|
|
121
|
+
material.refractionAmount,
|
|
122
|
+
material.chromaticAberration,
|
|
123
|
+
material.highlightAlpha,
|
|
124
|
+
tokens.procedural.noiseStrength,
|
|
125
|
+
material.opacity ?? 1,
|
|
126
|
+
material.radius,
|
|
127
|
+
];
|
|
128
|
+
const key = JSON.stringify([colorValues, scalarValues]);
|
|
129
|
+
const cached = resolvedMaterialCache.get(key);
|
|
130
|
+
if (cached)
|
|
131
|
+
return cached;
|
|
132
|
+
const resolved = {
|
|
133
|
+
baseTint: rgba(colorValues[0]),
|
|
134
|
+
accentTint: rgba(colorValues[1]),
|
|
135
|
+
highlightTint: rgba(colorValues[2]),
|
|
136
|
+
innerShade: rgba(colorValues[3]),
|
|
137
|
+
surfaceWarp: scalarValues[0],
|
|
138
|
+
chromatic: scalarValues[1],
|
|
139
|
+
highlightStrength: scalarValues[2],
|
|
140
|
+
noiseStrength: scalarValues[3],
|
|
141
|
+
materialOpacity: scalarValues[4],
|
|
142
|
+
cornerRadiusPx: scalarValues[5],
|
|
143
|
+
};
|
|
144
|
+
if (resolvedMaterialCache.size >= MAX_RESOLVED_MATERIALS) {
|
|
145
|
+
const oldest = resolvedMaterialCache.keys().next().value;
|
|
146
|
+
if (oldest !== undefined)
|
|
147
|
+
resolvedMaterialCache.delete(oldest);
|
|
148
|
+
}
|
|
149
|
+
resolvedMaterialCache.set(key, resolved);
|
|
150
|
+
return resolved;
|
|
151
|
+
}
|
|
152
|
+
function NativeLocalGlassRenderer({ tokens, material, dark, resolved, }) {
|
|
153
|
+
const NativeView = NativeLocalGlassView;
|
|
154
|
+
(0, react_1.useEffect)(() => NativeView ? (0, localGlassTelemetry_1.registerLocalGlassMaterial)('native') : undefined, [NativeView]);
|
|
155
|
+
if (!NativeView) {
|
|
156
|
+
return (0, jsx_runtime_1.jsx)(SkiaLocalGlassRenderer, { tokens: tokens, material: material, dark: dark, resolved: resolved });
|
|
157
|
+
}
|
|
158
|
+
return (0, jsx_runtime_1.jsx)(NativeView, { ...resolved, pointerEvents: "none", style: react_native_1.StyleSheet.absoluteFill });
|
|
159
|
+
}
|
|
160
|
+
function SkiaLocalGlassRenderer({ tokens, material, dark, resolved, }) {
|
|
161
|
+
const [size, setSize] = (0, react_1.useState)({ width: 0, height: 0 });
|
|
162
|
+
const source = (0, react_1.useMemo)(getSharedShader, []);
|
|
163
|
+
const uniforms = (0, react_1.useMemo)(() => ({
|
|
164
|
+
resolution: [size.width, size.height],
|
|
165
|
+
...resolved,
|
|
166
|
+
}), [resolved, size]);
|
|
167
|
+
(0, react_1.useEffect)(() => (0, localGlassTelemetry_1.registerLocalGlassMaterial)(source ? 'skia' : 'fallback'), [source]);
|
|
168
|
+
const handleLayout = (event) => {
|
|
169
|
+
const next = { width: event.nativeEvent.layout.width, height: event.nativeEvent.layout.height };
|
|
170
|
+
setSize((current) => current.width === next.width && current.height === next.height ? current : next);
|
|
171
|
+
};
|
|
172
|
+
if (!source) {
|
|
173
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: [react_native_1.StyleSheet.absoluteFill, { backgroundColor: dark ? tokens.fallbackTint.dark : tokens.fallbackTint.light }] }));
|
|
174
|
+
}
|
|
175
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", onLayout: handleLayout, style: react_native_1.StyleSheet.absoluteFill, children: (0, jsx_runtime_1.jsx)(react_native_skia_1.Canvas, { pointerEvents: "none", style: react_native_1.StyleSheet.absoluteFill, children: (0, jsx_runtime_1.jsx)(react_native_skia_1.Fill, { children: (0, jsx_runtime_1.jsx)(react_native_skia_1.Shader, { source: source, uniforms: uniforms }) }) }) }));
|
|
176
|
+
}
|
|
177
|
+
exports.LocalGlassMaterial = (0, react_1.memo)(function LocalGlassMaterial({ tokens, material, dark, surfaceRole = 'staticGroup', }) {
|
|
178
|
+
const resolved = (0, react_1.useMemo)(() => resolveMaterial(tokens, material, dark), [dark, material, tokens]);
|
|
179
|
+
const renderer = (0, surfaceRendererPolicy_1.getSurfaceRendererPolicy)(surfaceRole);
|
|
180
|
+
const supportsNativeRenderer = react_native_1.Platform.OS === 'android'
|
|
181
|
+
&& Number(react_native_1.Platform.Version) >= 33
|
|
182
|
+
&& NativeLocalGlassView !== null;
|
|
183
|
+
if (supportsNativeRenderer && renderer === 'native') {
|
|
184
|
+
return (0, jsx_runtime_1.jsx)(NativeLocalGlassRenderer, { tokens: tokens, material: material, dark: dark, resolved: resolved });
|
|
185
|
+
}
|
|
186
|
+
return (0, jsx_runtime_1.jsx)(SkiaLocalGlassRenderer, { tokens: tokens, material: material, dark: dark, resolved: resolved });
|
|
187
|
+
});
|
|
188
|
+
//# sourceMappingURL=LocalGlassMaterial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalGlassMaterial.js","sourceRoot":"","sources":["../../src/LocalGlassMaterial.tsx"],"names":[],"mappings":";;;;AAAA,kEAAwE;AACxE,yDAA6D;AAC7D,iCAAkE;AAClE,+CAA0D;AAG1D,+DAAqE;AACrE,mEAAmE;AAGnE,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DpB,CAAC;AAiBF,MAAM,oBAAoB,GAA8D,uBAAQ,CAAC,EAAE,KAAK,SAAS;IAC7G,CAAC,CAAC,IAAA,4CAAwB,EAAgC,aAAa,EA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luminance contrast selection for two foreground candidates. */
|
|
5
|
+
function resolveAdaptiveLuminanceForeground(luminance, lightForeground = '#000000', darkForeground = '#FFFFFF', threshold) {
|
|
6
|
+
const sample = Math.max(0, Math.min(1, Number.isFinite(luminance) ? luminance : 0));
|
|
7
|
+
if (threshold != null && Number.isFinite(threshold)) {
|
|
8
|
+
return sample > Math.max(0, Math.min(1, threshold)) ? lightForeground : darkForeground;
|
|
9
|
+
}
|
|
10
|
+
const contrastAgainstBlack = (sample + 0.05) / 0.05;
|
|
11
|
+
const contrastAgainstWhite = 1.05 / (sample + 0.05);
|
|
12
|
+
return contrastAgainstBlack >= contrastAgainstWhite ? lightForeground : darkForeground;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=adaptiveLuminance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptiveLuminance.js","sourceRoot":"","sources":["../../src/adaptiveLuminance.ts"],"names":[],"mappings":";;AACA,gFAaC;AAdD,gFAAgF;AAChF,SAAgB,kCAAkC,CAC9C,SAAiB,EACjB,eAAe,GAAG,SAAS,EAC3B,cAAc,GAAG,SAAS,EAC1B,SAAkB;IAElB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,IAAI,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAClD,OAAO,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC;IAC3F,CAAC;IACD,MAAM,oBAAoB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACpD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpD,OAAO,oBAAoB,IAAI,oBAAoB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.badgeColorSeed = badgeColorSeed;
|
|
4
|
+
exports.getDistinctBadgePalette = getDistinctBadgePalette;
|
|
5
|
+
exports.getBadgeColors = getBadgeColors;
|
|
6
|
+
exports.getBadgeColorsByIndex = getBadgeColorsByIndex;
|
|
7
|
+
const LIGHT_BADGE_PALETTE = [
|
|
8
|
+
{ background: '#FDE8E7', foreground: '#B42318', border: '#F7B7B2' },
|
|
9
|
+
{ background: '#FFF0E0', foreground: '#B54708', border: '#F6C48A' },
|
|
10
|
+
{ background: '#FFF6CC', foreground: '#8A6100', border: '#EACF63' },
|
|
11
|
+
{ background: '#E3F7E8', foreground: '#18743D', border: '#9FD8AD' },
|
|
12
|
+
{ background: '#DCF7F3', foreground: '#0F766E', border: '#93D9D0' },
|
|
13
|
+
{ background: '#E1F4FF', foreground: '#0369A1', border: '#9BD3F1' },
|
|
14
|
+
{ background: '#F0E7FF', foreground: '#6D28D9', border: '#CDB7F6' },
|
|
15
|
+
{ background: '#FCE7F3', foreground: '#BE185D', border: '#F4B3D1' },
|
|
16
|
+
];
|
|
17
|
+
const DARK_BADGE_PALETTE = [
|
|
18
|
+
{ background: '#4A1D1B', foreground: '#FFB4AB', border: '#7A322D' },
|
|
19
|
+
{ background: '#4A2A12', foreground: '#FFC182', border: '#79501F' },
|
|
20
|
+
{ background: '#453A0A', foreground: '#FFE082', border: '#75651B' },
|
|
21
|
+
{ background: '#173A25', foreground: '#8EE3A8', border: '#2D6740' },
|
|
22
|
+
{ background: '#123B38', foreground: '#83E4D8', border: '#266763' },
|
|
23
|
+
{ background: '#12384A', foreground: '#8BD7FF', border: '#275E77' },
|
|
24
|
+
{ background: '#2F214A', foreground: '#D5BAFF', border: '#584282' },
|
|
25
|
+
{ background: '#451C35', foreground: '#FFB2D4', border: '#75345B' },
|
|
26
|
+
];
|
|
27
|
+
function badgeColorSeed(value) {
|
|
28
|
+
let hash = 2166136261;
|
|
29
|
+
for (const char of value) {
|
|
30
|
+
hash ^= char.codePointAt(0) ?? 0;
|
|
31
|
+
hash = Math.imul(hash, 16777619);
|
|
32
|
+
}
|
|
33
|
+
return hash >>> 0;
|
|
34
|
+
}
|
|
35
|
+
function getDistinctBadgePalette(dark) {
|
|
36
|
+
return dark ? DARK_BADGE_PALETTE : LIGHT_BADGE_PALETTE;
|
|
37
|
+
}
|
|
38
|
+
function getBadgeColors(key, dark, offset = 0) {
|
|
39
|
+
const palette = getDistinctBadgePalette(dark);
|
|
40
|
+
return palette[(badgeColorSeed(key) + offset) % palette.length];
|
|
41
|
+
}
|
|
42
|
+
function getBadgeColorsByIndex(index, dark) {
|
|
43
|
+
const palette = getDistinctBadgePalette(dark);
|
|
44
|
+
return palette[((index % palette.length) + palette.length) % palette.length];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=badgePalette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badgePalette.js","sourceRoot":"","sources":["../../src/badgePalette.ts"],"names":[],"mappings":";;AA4BA,wCAOC;AAED,0DAEC;AAED,wCAOC;AAED,sDAGC;AA/CD,MAAM,mBAAmB,GAAkB;IACvC,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;IACnE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;IACnE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EA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AM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC;AACtB,CAAC;AAED,SAAgB,uBAAuB,CAAC,IAAa;IACjD,OAAO,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAC3D,CAAC;AAED,SAAgB,cAAc,CAC1B,GAAW,EACX,IAAa,EACb,MAAM,GAAG,CAAC;IAEV,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,qBAAqB,CAAC,KAAa,EAAE,IAAa;IAC9D,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUTTON_HOLD_DELAY_MS = void 0;
|
|
4
|
+
exports.buttonMoveDisposition = buttonMoveDisposition;
|
|
5
|
+
exports.buttonReleaseInside = buttonReleaseInside;
|
|
6
|
+
/** A stationary hold takes ownership before a later vertical drag can scroll. */
|
|
7
|
+
exports.BUTTON_HOLD_DELAY_MS = 180;
|
|
8
|
+
function buttonMoveDisposition(insideScroll, dx, dy) {
|
|
9
|
+
'worklet';
|
|
10
|
+
if (!insideScroll)
|
|
11
|
+
return 'activate';
|
|
12
|
+
if (Math.abs(dy) > 12)
|
|
13
|
+
return 'scroll';
|
|
14
|
+
if (Math.abs(dx) > 8)
|
|
15
|
+
return 'activate';
|
|
16
|
+
return 'wait';
|
|
17
|
+
}
|
|
18
|
+
function buttonReleaseInside(x, y, width, height, hitSlop) {
|
|
19
|
+
'worklet';
|
|
20
|
+
return x >= -hitSlop && x <= width + hitSlop && y >= -hitSlop && y <= height + hitSlop;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=buttonGesturePolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonGesturePolicy.js","sourceRoot":"","sources":["../../src/buttonGesturePolicy.ts"],"names":[],"mappings":";;;AAGA,sDAMC;AAED,kDAGC;AAdD,iFAAiF;AACpE,QAAA,oBAAoB,GAAG,GAAG,CAAC;AAExC,SAAgB,qBAAqB,CAAC,YAAqB,EAAE,EAAU,EAAE,EAAU;IAC/E,SAAS,CAAC;IACV,IAAI,CAAC,YAAY;QAAE,OAAO,UAAU,CAAC;IACrC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,OAAO,QAAQ,CAAC;IACvC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IACxC,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAgB,mBAAmB,CAAC,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,MAAc,EAAE,OAAe;IACpG,SAAS,CAAC;IACV,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,KAAK,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptiveLuminance = exports.resolveAdaptiveLuminanceForeground = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const adaptiveLuminance_1 = require("../adaptiveLuminance");
|
|
8
|
+
var adaptiveLuminance_2 = require("../adaptiveLuminance");
|
|
9
|
+
Object.defineProperty(exports, "resolveAdaptiveLuminanceForeground", { enumerable: true, get: function () { return adaptiveLuminance_2.resolveAdaptiveLuminanceForeground; } });
|
|
10
|
+
/**
|
|
11
|
+
* Selects a readable foreground from a caller-supplied backdrop luminance.
|
|
12
|
+
* The optical renderer owns scene sampling; this component stays platform
|
|
13
|
+
* agnostic and can be fed a value from an image, sensor, or application model.
|
|
14
|
+
*/
|
|
15
|
+
exports.AdaptiveLuminance = (0, react_1.memo)(function AdaptiveLuminance({ luminance, lightForeground = '#000000', darkForeground = '#FFFFFF', threshold, children, style, }) {
|
|
16
|
+
const foreground = (0, adaptiveLuminance_1.resolveAdaptiveLuminanceForeground)(luminance, lightForeground, darkForeground, threshold);
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.View, { style: style, children: children(foreground) });
|
|
18
|
+
});
|
|
19
|
+
exports.AdaptiveLuminance.displayName = 'AdaptiveLuminance';
|
|
20
|
+
//# sourceMappingURL=AdaptiveLuminance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdaptiveLuminance.js","sourceRoot":"","sources":["../../../src/components/AdaptiveLuminance.tsx"],"names":[],"mappings":";;;;AAAA,iCAAoC;AAGpC,+CAAoC;AACpC,4DAA0E;AAE1E,0DAA0E;AAAjE,uIAAA,kCAAkC,OAAA;AAgB3C;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,IAAA,YAAI,EAAC,SAAS,iBAAiB,CAAC,EAC7D,SAAS,EACT,eAAe,GAAG,SAAS,EAC3B,cAAc,GAAG,SAAS,EAC1B,SAAS,EACT,QAAQ,EACR,KAAK,GACgB;IACrB,MAAM,UAAU,GAAG,IAAA,sDAAkC,EAAC,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAC7G,OAAO,uBAAC,mBAAI,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,CAAC,UAAU,CAAC,GAAQ,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEH,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BottomSheet = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const primitives_1 = require("../primitives");
|
|
39
|
+
const glassController_1 = require("../glassController");
|
|
40
|
+
const GlassSurface_1 = require("../GlassSurface");
|
|
41
|
+
const GlassSurface_2 = require("../GlassSurface");
|
|
42
|
+
const motion_1 = require("../motion");
|
|
43
|
+
const MotionProvider_1 = require("../motion/MotionProvider");
|
|
44
|
+
const theme_1 = require("../theme");
|
|
45
|
+
const SurfaceEnvironmentContext_1 = require("./SurfaceEnvironmentContext");
|
|
46
|
+
const bottomSheetMotion_1 = require("./bottomSheetMotion");
|
|
47
|
+
const react_1 = __importStar(require("react"));
|
|
48
|
+
const react_native_1 = require("react-native");
|
|
49
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
50
|
+
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
51
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
52
|
+
const UPWARD_DAMPING = 0.1;
|
|
53
|
+
const FROZEN_SHEET_MATERIAL_OVERRIDE = { blurRadius: 0, referenceDepthEffect: true, highlightAlpha: 0.45 };
|
|
54
|
+
exports.BottomSheet = react_1.default.memo(function BottomSheet({ visible = false, onClose, title, allowDismiss = true, closeOnClickModal = true, startAction, endAction, animationsEnabled = true, onDismissed, children, }) {
|
|
55
|
+
const theme = (0, theme_1.useTheme)();
|
|
56
|
+
// The sheet is always a glass overlay; a disabled material provider only
|
|
57
|
+
// stops native sampling, leaving the surface on its own tint.
|
|
58
|
+
const usesGlassMaterial = theme.glass.enabled;
|
|
59
|
+
const reducedMotion = (0, MotionProvider_1.useReducedMotionPreference)();
|
|
60
|
+
const c = theme.components.bottomSheet;
|
|
61
|
+
const { height: windowH } = (0, react_native_1.useWindowDimensions)();
|
|
62
|
+
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
63
|
+
const sheetBackground = usesGlassMaterial ? 'transparent' : theme.colors.surfaceContainer;
|
|
64
|
+
const overscrollFill = usesGlassMaterial
|
|
65
|
+
? (theme.dark ? 'rgba(20,24,32,0.52)' : 'rgba(250,250,252,0.54)')
|
|
66
|
+
: sheetBackground;
|
|
67
|
+
const providerId = (0, GlassSurface_2.useGlassProviderId)();
|
|
68
|
+
const [rendered, setRendered] = (0, react_1.useState)(visible);
|
|
69
|
+
const [sheetHeight, setSheetHeight] = (0, react_1.useState)(0);
|
|
70
|
+
const openAnimationStarted = (0, react_1.useRef)(false);
|
|
71
|
+
const sheetY = (0, react_native_reanimated_1.useSharedValue)(windowH);
|
|
72
|
+
const dimOpacity = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
73
|
+
const handlePressed = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
74
|
+
const handleDismissed = (0, react_1.useCallback)(() => {
|
|
75
|
+
if (usesGlassMaterial)
|
|
76
|
+
glassController_1.glassController.resume(providerId);
|
|
77
|
+
onDismissed?.();
|
|
78
|
+
}, [onDismissed, providerId, usesGlassMaterial]);
|
|
79
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
80
|
+
if (visible) {
|
|
81
|
+
if (!openAnimationStarted.current) {
|
|
82
|
+
openAnimationStarted.current = true;
|
|
83
|
+
if (usesGlassMaterial)
|
|
84
|
+
glassController_1.glassController.prepareFrozenBackdrop(providerId, 18);
|
|
85
|
+
setRendered(true);
|
|
86
|
+
sheetY.value = windowH;
|
|
87
|
+
dimOpacity.value = 0;
|
|
88
|
+
if (!animationsEnabled) {
|
|
89
|
+
sheetY.value = 0;
|
|
90
|
+
dimOpacity.value = 1;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
sheetY.value = reducedMotion ? 0 : (0, react_native_reanimated_1.withSpring)(0, motion_1.bottomSheetEnter);
|
|
94
|
+
dimOpacity.value = (0, react_native_reanimated_1.withTiming)(1, { duration: reducedMotion ? 120 : 300, easing: motion_1.linearEasing });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (rendered) {
|
|
99
|
+
openAnimationStarted.current = false;
|
|
100
|
+
const finish = (finished) => {
|
|
101
|
+
if (finished) {
|
|
102
|
+
(0, react_native_reanimated_1.runOnJS)(setRendered)(false);
|
|
103
|
+
(0, react_native_reanimated_1.runOnJS)(handleDismissed)();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
if (!animationsEnabled) {
|
|
107
|
+
sheetY.value = windowH;
|
|
108
|
+
dimOpacity.value = 0;
|
|
109
|
+
setRendered(false);
|
|
110
|
+
handleDismissed();
|
|
111
|
+
}
|
|
112
|
+
else if (reducedMotion) {
|
|
113
|
+
dimOpacity.value = (0, react_native_reanimated_1.withTiming)(0, { duration: 100, easing: motion_1.linearEasing }, finish);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
sheetY.value = (0, react_native_reanimated_1.withSpring)(windowH, motion_1.bottomSheetEnter, finish);
|
|
117
|
+
dimOpacity.value = (0, react_native_reanimated_1.withTiming)(0, { duration: 250, easing: motion_1.linearEasing });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [visible, usesGlassMaterial, providerId, windowH, rendered, animationsEnabled, reducedMotion, sheetY, dimOpacity, handleDismissed]);
|
|
121
|
+
const dragY = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
122
|
+
const handleClose = (0, react_1.useCallback)(() => {
|
|
123
|
+
onClose?.();
|
|
124
|
+
}, [onClose]);
|
|
125
|
+
const handleSheetLayout = (0, react_1.useCallback)((event) => {
|
|
126
|
+
const nextHeight = event.nativeEvent.layout.height;
|
|
127
|
+
setSheetHeight((current) => current === nextHeight ? current : nextHeight);
|
|
128
|
+
}, []);
|
|
129
|
+
const dismissThreshold = (0, bottomSheetMotion_1.getBottomSheetDismissThreshold)(sheetHeight);
|
|
130
|
+
(0, react_1.useEffect)(() => {
|
|
131
|
+
if (!usesGlassMaterial || !rendered)
|
|
132
|
+
return;
|
|
133
|
+
const subscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', () => {
|
|
134
|
+
handleClose();
|
|
135
|
+
return true;
|
|
136
|
+
});
|
|
137
|
+
return () => subscription.remove();
|
|
138
|
+
}, [usesGlassMaterial, rendered, handleClose]);
|
|
139
|
+
const pan = react_native_gesture_handler_1.Gesture.Pan()
|
|
140
|
+
.enabled(visible && rendered)
|
|
141
|
+
.activeOffsetY([-4, 4])
|
|
142
|
+
.onBegin(() => {
|
|
143
|
+
handlePressed.value = 1;
|
|
144
|
+
})
|
|
145
|
+
.onUpdate((e) => {
|
|
146
|
+
const dy = e.translationY;
|
|
147
|
+
const damped = dy < 0 ? dy * UPWARD_DAMPING : allowDismiss ? dy : dy * UPWARD_DAMPING;
|
|
148
|
+
dragY.value = damped;
|
|
149
|
+
// Dim fades as the sheet travels down.
|
|
150
|
+
const progress = Math.max(0, Math.min(1, dy / dismissThreshold));
|
|
151
|
+
dimOpacity.value = 1 - progress * 0.6;
|
|
152
|
+
})
|
|
153
|
+
.onFinalize(() => {
|
|
154
|
+
handlePressed.value = 0;
|
|
155
|
+
const dy = dragY.value;
|
|
156
|
+
if (allowDismiss && dy > dismissThreshold) {
|
|
157
|
+
if (animationsEnabled) {
|
|
158
|
+
sheetY.value = (0, react_native_reanimated_1.withSpring)(windowH, motion_1.bottomSheetEnter, (finished) => {
|
|
159
|
+
if (finished) {
|
|
160
|
+
(0, react_native_reanimated_1.runOnJS)(setRendered)(false);
|
|
161
|
+
(0, react_native_reanimated_1.runOnJS)(handleClose)();
|
|
162
|
+
(0, react_native_reanimated_1.runOnJS)(handleDismissed)();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
sheetY.value = windowH;
|
|
168
|
+
dimOpacity.value = 0;
|
|
169
|
+
(0, react_native_reanimated_1.runOnJS)(setRendered)(false);
|
|
170
|
+
(0, react_native_reanimated_1.runOnJS)(handleClose)();
|
|
171
|
+
(0, react_native_reanimated_1.runOnJS)(handleDismissed)();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
sheetY.value = animationsEnabled ? (0, react_native_reanimated_1.withSpring)(0, motion_1.bottomSheetSettle) : 0;
|
|
176
|
+
if (animationsEnabled)
|
|
177
|
+
dimOpacity.value = (0, react_native_reanimated_1.withTiming)(1, { duration: 150, easing: motion_1.linearEasing });
|
|
178
|
+
else
|
|
179
|
+
dimOpacity.value = 1;
|
|
180
|
+
}
|
|
181
|
+
dragY.value = 0;
|
|
182
|
+
});
|
|
183
|
+
const handleStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
184
|
+
width: (0, react_native_reanimated_1.withTiming)(handlePressed.value === 1 ? 55 : c.handleWidth, handlePressed.value === 1 ? motion_1.sheetHandlePress : motion_1.sheetHandleRelease),
|
|
185
|
+
transform: [{ scaleY: (0, react_native_reanimated_1.withTiming)(handlePressed.value === 1 ? 1.15 : 1, handlePressed.value === 1 ? motion_1.sheetHandlePress : motion_1.sheetHandleRelease) }],
|
|
186
|
+
opacity: (0, react_native_reanimated_1.withTiming)(handlePressed.value === 1 ? theme.opacity.sheetHandlePressed : theme.opacity.sheetHandle, handlePressed.value === 1 ? motion_1.sheetHandlePress : motion_1.sheetHandleRelease),
|
|
187
|
+
}));
|
|
188
|
+
const sheetStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
189
|
+
transform: [{ translateY: sheetY.value + dragY.value }],
|
|
190
|
+
}));
|
|
191
|
+
const dimStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
192
|
+
opacity: dimOpacity.value,
|
|
193
|
+
backgroundColor: theme.colors.windowDimming,
|
|
194
|
+
}));
|
|
195
|
+
const overscrollHeight = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
196
|
+
height: Math.max(0, -dragY.value) + 1,
|
|
197
|
+
}));
|
|
198
|
+
const sheetBody = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "none", style: [
|
|
199
|
+
{ position: 'absolute', left: 0, right: 0, bottom: 0, backgroundColor: overscrollFill },
|
|
200
|
+
overscrollHeight,
|
|
201
|
+
] }), (0, jsx_runtime_1.jsx)(react_native_gesture_handler_1.GestureDetector, { gesture: pan, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { height: theme.spacing.xl, alignItems: 'center', justifyContent: 'center' }, children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [{ height: c.handleHeight, borderRadius: 2, backgroundColor: usesGlassMaterial ? theme.colors.onGlassMuted : theme.colors.onSurfaceVariantSummary }, handleStyle] }) }), (title != null || startAction != null || endAction != null) && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexDirection: 'row', alignItems: 'center', paddingVertical: 6, paddingBottom: 12 }, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 0, justifyContent: 'flex-start' }, children: startAction }), (0, jsx_runtime_1.jsx)(primitives_1.Text, { type: "title4", weight: "medium", color: usesGlassMaterial ? theme.colors.onGlass : theme.colors.onSurface, style: { flex: 1, textAlign: 'center' }, children: title }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 0, justifyContent: 'flex-end', marginLeft: 'auto' }, children: endAction })] }))] }) }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: '100%', minHeight: 0, flexGrow: 0, flexShrink: 1 }, children: typeof children === 'function' ? children(handleClose) : children })] }));
|
|
202
|
+
const content = ((0, jsx_runtime_1.jsx)(react_native_gesture_handler_1.GestureHandlerRootView, { style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(react_native_reanimated_1.default.View, { style: [{ flex: 1, justifyContent: 'flex-end', alignItems: 'center' }, dimStyle], children: [(0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: react_native_1.StyleSheet.absoluteFill, onPress: closeOnClickModal && allowDismiss ? handleClose : undefined }), (0, jsx_runtime_1.jsx)(GlassSurface_1.GlassSurface, { variant: "sheet", positioning: "floating", sampling: "backdrop", samplingSource: "routeScene", inlineBackdrop: true, intrinsicInlineBackdrop: true, materialOverrides: usesGlassMaterial ? FROZEN_SHEET_MATERIAL_OVERRIDE : undefined, placement: "bottom", animatedStyle: sheetStyle, onLayout: handleSheetLayout, zIndex: 101, style: {
|
|
203
|
+
width: '100%',
|
|
204
|
+
maxWidth: c.maxWidth,
|
|
205
|
+
maxHeight: windowH - insets.top - 24,
|
|
206
|
+
borderTopLeftRadius: c.radius,
|
|
207
|
+
borderTopRightRadius: c.radius,
|
|
208
|
+
backgroundColor: sheetBackground,
|
|
209
|
+
overflow: 'hidden',
|
|
210
|
+
}, contentStyle: {
|
|
211
|
+
width: '100%',
|
|
212
|
+
maxHeight: windowH - insets.top - 24,
|
|
213
|
+
paddingHorizontal: c.horizontalPadding,
|
|
214
|
+
paddingBottom: insets.bottom,
|
|
215
|
+
overflow: 'hidden',
|
|
216
|
+
}, children: usesGlassMaterial ? ((0, jsx_runtime_1.jsx)(SurfaceEnvironmentContext_1.GlassOverlayContentScope, { children: sheetBody })) : sheetBody })] }) }));
|
|
217
|
+
if (usesGlassMaterial)
|
|
218
|
+
return rendered ? (0, jsx_runtime_1.jsx)(GlassSurface_1.GlassOverlay, { zIndex: 200, children: content }) : null;
|
|
219
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { transparent: true, statusBarTranslucent: true, animationType: "none", visible: rendered, onRequestClose: handleClose, children: content }));
|
|
220
|
+
});
|
|
221
|
+
exports.BottomSheet.displayName = 'HyperBottomSheet';
|
|
222
|
+
//# sourceMappingURL=BottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["../../../src/components/BottomSheet.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqC;AACrC,wDAAqD;AACrD,kDAA6D;AAC7D,kDAAqD;AACrD,sCAAoH;AACpH,6DAAsE;AACtE,oCAAoC;AACpC,2EAAuE;AACvE,2DAAqE;AACrE,+CAAyF;AAGzF,+CAAoG;AACpG,+EAAgG;AAChG,mFAAsH;AACtH,mFAAmE;AAkCnE,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,8BAA8B,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,oBAAoB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAW,CAAC;AAEvG,QAAA,WAAW,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC,EACvD,OAAO,GAAG,KAAK,EACf,OAAO,EACP,KAAK,EACL,YAAY,GAAG,IAAI,EACnB,iBAAiB,GAAG,IAAI,EACxB,WAAW,EACX,SAAS,EACT,iBAAiB,GAAG,IAAI,EACxB,WAAW,EACX,QAAQ,GACU;IAClB,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,yEAAyE;IACzE,8DAA8D;IAC9D,MAAM,iBAAiB,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;IAC9C,MAAM,aAAa,GAAG,IAAA,2CAA0B,GAAE,CAAC;IACnD,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,kCAAmB,GAAE,CAAC;IAClD,MAAM,MAAM,GAAG,IAAA,kDAAiB,GAAE,CAAC;IACnC,MAAM,eAAe,GAAG,iB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G,EACX,KAAK,EAAE;wBACH,KAAK,EAAE,MAAM;wBACb,QAAQ,EAAE,CAAC,CAAC,QAAQ;wBACpB,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG,GAAG,EAAE;wBACpC,mBAAmB,EAAE,CAAC,CAAC,MAAM;wBAC7B,oBAAoB,EAAE,CAAC,CAAC,MAAM;wBAC9B,eAAe,EAAE,eAAe;wBAChC,QAAQ,EAAE,QAAQ;qBACrB,EACD,YAAY,EAAE;wBACV,KAAK,EAAE,MAAM;wBACb,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG,GAAG,EAAE;wBACpC,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;wBACtC,aAAa,EAAE,MAAM,CAAC,MAAM;wBAC5B,QAAQ,EAAE,QAAQ;qBACrB,YAEA,iBAAiB,CAAC,CAAC,CAAC,CACjB,uBAAC,oDAAwB,cAAE,SAAS,GAA4B,CACnE,CAAC,CAAC,CAAC,SAAS,GACF,IACH,GACH,CAC5B,CAAC;IAEF,IAAI,iBAAiB;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,uBAAC,2BAAY,IAAC,MAAM,EAAE,GAAG,YAAG,OAAO,GAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;IACpG,OAAO,CACH,uBAAC,oBAAK,IAAC,WAAW,QAAC,oBAAoB,QAAC,aAAa,EAAC,MAAM,EAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,YACtG,OAAO,GACJ,CACX,CAAC;AACN,CAAC,CAAC,CAAC;AACH,mBAAW,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const GlassButton_1 = require("./GlassButton");
|
|
7
|
+
const DialogAction_1 = require("./DialogAction");
|
|
8
|
+
const SurfaceEnvironmentContext_1 = require("./SurfaceEnvironmentContext");
|
|
9
|
+
const theme_1 = require("../theme");
|
|
10
|
+
/** The consumer entry shares the reference renderer, except for dialog actions. */
|
|
11
|
+
exports.Button = (0, react_1.memo)(function Button(props) {
|
|
12
|
+
const inDialog = (0, SurfaceEnvironmentContext_1.useIsInsideDialog)();
|
|
13
|
+
const theme = (0, theme_1.useTheme)();
|
|
14
|
+
if (inDialog)
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(DialogAction_1.DialogAction, { ...props });
|
|
16
|
+
const { type = 'default', ...rest } = props;
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(GlassButton_1.GlassButton, { ...rest, appearance: type === 'primary' ? 'tinted' : 'surface', tintColor: theme.colors.primary });
|
|
18
|
+
});
|
|
19
|
+
exports.Button.displayName = 'LiquidGlassButton';
|
|
20
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":";;;;AAAA,iCAAoC;AAGpC,+CAA4C;AAC5C,iDAA8C;AAC9C,2EAAgE;AAChE,oCAAoC;AAcpC,mFAAmF;AACtE,QAAA,MAAM,GAAG,IAAA,YAAI,EAAC,SAAS,MAAM,CAAC,KAAqB;IAC5D,MAAM,QAAQ,GAAG,IAAA,6CAAiB,GAAE,CAAC;IACrC,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,IAAI,QAAQ;QAAE,OAAO,uBAAC,2BAAY,OAAK,KAAK,GAAI,CAAC;IACjD,MAAM,EAAE,IAAI,GAAG,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC5C,OAAO,uBAAC,yBAAW,OAAK,IAAI,EAAE,UAAU,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC/E,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,GAAI,CAAC;AAC5C,CAAC,CAAC,CAAC;AACH,cAAM,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
|