@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 @@
|
|
|
1
|
+
{"version":3,"file":"pressVelocity.js","sourceRoot":"","sources":["../../src/pressVelocity.ts"],"names":[],"mappings":"AAOA,2EAA2E;AAC3E,MAAM,UAAU,4BAA4B,CACxC,OAAsC,EACtC,aAAa,GAAG,GAAG;IAEnB,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC9C,MAAM,GAAG,GAA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C,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,WAAW;QAC1C,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,WAAW;KAC7C,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '../theme';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
/**
|
|
6
|
+
* Design System Divider.
|
|
7
|
+
*
|
|
8
|
+
* Visual reference:
|
|
9
|
+
* miuix-vue/src/components/divider/Divider.vue (Divider.kt)
|
|
10
|
+
*
|
|
11
|
+
* DividerDefaults: thickness 0.75dp, color = dividerLine. Pages must not
|
|
12
|
+
* hardcode `#E0E0E0` — use this.
|
|
13
|
+
*/
|
|
14
|
+
export const Divider = memo(function Divider({ orientation = 'horizontal', thickness = 0.75, color, style }) {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const isHorizontal = orientation === 'horizontal';
|
|
17
|
+
return (_jsx(View, { style: [
|
|
18
|
+
{
|
|
19
|
+
backgroundColor: color ?? theme.colors.dividerLine,
|
|
20
|
+
opacity: theme.presentation.content.dividerStyle === 'subtle' ? 0.72 : 1,
|
|
21
|
+
},
|
|
22
|
+
isHorizontal
|
|
23
|
+
? { width: '100%', height: thickness }
|
|
24
|
+
: { height: '100%', width: thickness },
|
|
25
|
+
style,
|
|
26
|
+
] }));
|
|
27
|
+
});
|
|
28
|
+
Divider.displayName = 'HyperDivider';
|
|
29
|
+
//# sourceMappingURL=Divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../src/primitives/Divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAYpC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,OAAO,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE,SAAS,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,EAAmB;IACxH,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,WAAW,KAAK,YAAY,CAAC;IAClD,OAAO,CACH,KAAC,IAAI,IACD,KAAK,EAAE;YACH;gBACI,eAAe,EAAE,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW;gBAClD,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC3E;YACD,YAAY;gBACR,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE;gBACtC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;YAC1C,KAAK;SACR,GACH,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Design System Icon — the only icon entry point business pages use.
|
|
6
|
+
*
|
|
7
|
+
* The underlying glyph set is @expo/vector-icons MaterialCommunityIcons for now
|
|
8
|
+
* (task §57); Miuix Icons can slot in behind the same props later without
|
|
9
|
+
* touching callers.
|
|
10
|
+
*/
|
|
11
|
+
export const Icon = memo(function Icon({ name, source, size = 24, color, opacity, disabled, weight, style }) {
|
|
12
|
+
return (_jsx(MaterialCommunityIcons
|
|
13
|
+
// `weight` is accepted but not applicable to MaterialCommunityIcons yet.
|
|
14
|
+
, {
|
|
15
|
+
// `weight` is accepted but not applicable to MaterialCommunityIcons yet.
|
|
16
|
+
name: (name ?? source), size: size, color: color, style: [opacity != null ? { opacity } : undefined, disabled ? { opacity: 0.38 } : undefined, style] }));
|
|
17
|
+
});
|
|
18
|
+
Icon.displayName = 'HyperIcon';
|
|
19
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/primitives/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAuB7B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAgB;IACrH,OAAO,CACH,KAAC,sBAAsB;IACnB,yEAAyE;;QAAzE,yEAAyE;QACzE,IAAI,EAAE,CAAC,IAAI,IAAI,MAAM,CAAa,EAClC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,GACrG,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AACH,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';
|
|
4
|
+
import { pressIndication } from '../motion';
|
|
5
|
+
/**
|
|
6
|
+
* MiuixIndication alpha overlay — the standard press feedback.
|
|
7
|
+
*
|
|
8
|
+
* Visual reference:
|
|
9
|
+
* miuix-vue/src/components/basic-component/BasicComponent.vue (::after overlay)
|
|
10
|
+
*
|
|
11
|
+
* Mobile behavior (task §23): normal 0, pressed 0.10, animated 120ms linear.
|
|
12
|
+
* Web adds hover 0.06 / focus 0.08 additively — mobile keeps press only.
|
|
13
|
+
*
|
|
14
|
+
* Implemented as an absolute-filled overlay View (RN has no ::after).
|
|
15
|
+
*/
|
|
16
|
+
export function PressIndication({ pressed, color, radius, style, intensity = 0.1 }) {
|
|
17
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
18
|
+
opacity: withTiming(pressed.value * intensity, pressIndication),
|
|
19
|
+
}));
|
|
20
|
+
return (_jsx(Animated.View, { pointerEvents: "none", style: [StyleSheet.absoluteFill, { backgroundColor: color }, radius != null ? { borderRadius: radius } : undefined, animatedStyle, style] }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=PressIndication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PressIndication.js","sourceRoot":"","sources":["../../../src/primitives/PressIndication.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,QAAQ,EAAE,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAe5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,GAAG,EAAwB;IACpG,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,EAAE,eAAe,CAAC;KAClE,CAAC,CAAC,CAAC;IAEJ,OAAO,CACH,KAAC,QAAQ,CAAC,IAAI,IACV,aAAa,EAAC,MAAM,EACpB,KAAK,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC,GAC3I,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable as NativePressable } from 'react-native';
|
|
3
|
+
import { useSharedValue } from 'react-native-reanimated';
|
|
4
|
+
import { useTheme } from '../theme';
|
|
5
|
+
import { PressIndication } from './PressIndication';
|
|
6
|
+
/** Generic Hyper tap surface for interactions without a semantic Button/ListRow/Card. */
|
|
7
|
+
export function Pressable({ showIndication = true, indicationColor, indicationRadius, disabled, ...rest }) {
|
|
8
|
+
if (!showIndication || disabled || (!rest.onPress && !rest.onLongPress)) {
|
|
9
|
+
return _jsx(NativePressable, { ...rest, disabled: disabled });
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(InteractivePressable, { ...rest, disabled: disabled, indicationColor: indicationColor, indicationRadius: indicationRadius }));
|
|
12
|
+
}
|
|
13
|
+
function InteractivePressable({ indicationColor, indicationRadius, onPressIn, onPressOut, disabled, children, ...rest }) {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const pressed = useSharedValue(0);
|
|
16
|
+
const renderChildren = (state) => (_jsxs(_Fragment, { children: [typeof children === 'function' ? children(state) : children, _jsx(PressIndication, { pressed: pressed, color: indicationColor ?? theme.colors.onBackground, radius: indicationRadius })] }));
|
|
17
|
+
return (_jsx(NativePressable, { ...rest, disabled: disabled, onPressIn: (event) => {
|
|
18
|
+
pressed.value = 1;
|
|
19
|
+
onPressIn?.(event);
|
|
20
|
+
}, onPressOut: (event) => {
|
|
21
|
+
pressed.value = 0;
|
|
22
|
+
onPressOut?.(event);
|
|
23
|
+
}, children: renderChildren }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Pressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pressable.js","sourceRoot":"","sources":["../../../src/primitives/Pressable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASpD,yFAAyF;AACzF,MAAM,UAAU,SAAS,CAAC,EACtB,cAAc,GAAG,IAAI,EACrB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,GAAG,IAAI,EACS;IAChB,IAAI,CAAC,cAAc,IAAI,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACtE,OAAO,KAAC,eAAe,OAAK,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;IAC7D,CAAC;IAED,OAAO,CACH,KAAC,oBAAoB,OACb,IAAI,EACR,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,GACpC,CACL,CAAC;AACN,CAAC;AAED,SAAS,oBAAoB,CAAC,EAC1B,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,GAAG,IAAI,EACiC;IACxC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,cAAc,GAAG,CAAC,KAAiC,EAAE,EAAE,CAAC,CAC1D,8BACK,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAC5D,KAAC,eAAe,IACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,IAAI,KAAK,CAAC,MAAM,CAAC,YAAY,EACnD,MAAM,EAAE,gBAAgB,GAC1B,IACH,CACN,CAAC;IAEF,OAAO,CACH,KAAC,eAAe,OACR,IAAI,EACR,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;YAClB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,EACD,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;YAClB,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC,YAEA,cAAc,GACD,CACrB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable } from 'react-native';
|
|
3
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
4
|
+
import { cardSink } from '../motion';
|
|
5
|
+
import { useReducedMotionPreference } from '../motion/MotionProvider';
|
|
6
|
+
/**
|
|
7
|
+
* Pressable that scales down while pressed with a folme spring.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ Use ONLY where the Miuix reference specifies a scale press feedback
|
|
10
|
+
* (Card sink, Switch / Slider thumb). Do not wire this globally — Miuix
|
|
11
|
+
* buttons and list rows use the alpha overlay (PressIndication), not scale.
|
|
12
|
+
*/
|
|
13
|
+
export function PressableScale({ scale = 0.94, springConfig = cardSink, onPressIn, onPressOut, disabled, style, children, ...rest }) {
|
|
14
|
+
const pressed = useSharedValue(0);
|
|
15
|
+
const reducedMotion = useReducedMotionPreference();
|
|
16
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
17
|
+
transform: [{ scale: reducedMotion ? 1 : withSpring(pressed.value === 1 ? scale : 1, springConfig) }],
|
|
18
|
+
}));
|
|
19
|
+
return (_jsx(Pressable, { ...rest, disabled: disabled, onPressIn: (e) => {
|
|
20
|
+
if (!disabled)
|
|
21
|
+
pressed.value = 1;
|
|
22
|
+
onPressIn?.(e);
|
|
23
|
+
}, onPressOut: (e) => {
|
|
24
|
+
pressed.value = 0;
|
|
25
|
+
onPressOut?.(e);
|
|
26
|
+
}, children: _jsx(Animated.View, { style: [style, animatedStyle], children: children }) }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=PressableScale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PressableScale.js","sourceRoot":"","sources":["../../../src/primitives/PressableScale.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,QAAQ,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEjG,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAWtE;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,YAAY,GAAG,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAuB;IACpJ,MAAM,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;IAEnD,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC;KACxG,CAAC,CAAC,CAAC;IAEJ,OAAO,CACH,KAAC,SAAS,OACF,IAAI,EACR,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,IAAI,CAAC,QAAQ;gBAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;YACjC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,EACD,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;YAClB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC,YAED,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,YAAG,QAAQ,GAAiB,GAChE,CACf,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '../theme';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { GlassSurface } from '../GlassSurface';
|
|
5
|
+
import Animated from 'react-native-reanimated';
|
|
6
|
+
import { StyleSheet, View } from 'react-native';
|
|
7
|
+
/**
|
|
8
|
+
* Design System Surface — themed material without press semantics.
|
|
9
|
+
*
|
|
10
|
+
* Defaults to a plain solid surface for compatibility. Glass is a material
|
|
11
|
+
* choice only; callers add Pressable behavior separately when the content acts.
|
|
12
|
+
*/
|
|
13
|
+
export const Surface = React.memo(function Surface({ color, backgroundColor, radius = 0, material = 'solid', glassVariant = 'card', surfaceRole = 'staticGroup', sampling = 'local', samplingSource = 'routeScene', inlineBackdrop = false, borderColor = 'transparent', borderWidth = 0, contentStyle, animatedStyle, centeredTransformOrigin, children, style, }) {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const glassStyle = useMemo(() => {
|
|
16
|
+
const flattened = StyleSheet.flatten(style);
|
|
17
|
+
if (!flattened || !('backgroundColor' in flattened))
|
|
18
|
+
return style;
|
|
19
|
+
const layoutStyle = { ...flattened };
|
|
20
|
+
delete layoutStyle.backgroundColor;
|
|
21
|
+
return layoutStyle;
|
|
22
|
+
}, [style]);
|
|
23
|
+
const flattenedContentStyle = useMemo(() => StyleSheet.flatten(contentStyle), [contentStyle]);
|
|
24
|
+
const glassContentStyle = useMemo(() => {
|
|
25
|
+
if (!flattenedContentStyle || !('backgroundColor' in flattenedContentStyle))
|
|
26
|
+
return contentStyle;
|
|
27
|
+
const layoutStyle = { ...flattenedContentStyle };
|
|
28
|
+
delete layoutStyle.backgroundColor;
|
|
29
|
+
return layoutStyle;
|
|
30
|
+
}, [contentStyle, flattenedContentStyle]);
|
|
31
|
+
const glassSizingStyle = useMemo(() => {
|
|
32
|
+
if (!flattenedContentStyle)
|
|
33
|
+
return undefined;
|
|
34
|
+
const containerStyle = {};
|
|
35
|
+
const sizingKeys = [
|
|
36
|
+
'flex', 'flexGrow', 'flexShrink', 'flexBasis', 'alignSelf',
|
|
37
|
+
'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight',
|
|
38
|
+
];
|
|
39
|
+
for (const key of sizingKeys) {
|
|
40
|
+
const value = flattenedContentStyle[key];
|
|
41
|
+
if (value !== undefined) {
|
|
42
|
+
containerStyle[key] = value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return containerStyle;
|
|
46
|
+
}, [flattenedContentStyle]);
|
|
47
|
+
const resolvedBackground = backgroundColor ?? color ?? theme.colors.surface;
|
|
48
|
+
const centeredOriginStyle = centeredTransformOrigin ? { transformOrigin: '50% 50%' } : undefined;
|
|
49
|
+
const resolvedSolidContentStyle = material === 'overlayTint' ? glassContentStyle : contentStyle;
|
|
50
|
+
if (material === 'glass') {
|
|
51
|
+
return (_jsx(GlassSurface, { variant: glassVariant, surfaceRole: surfaceRole, positioning: "inFlow", sampling: sampling, samplingSource: samplingSource, inlineBackdrop: inlineBackdrop, intrinsicInlineBackdrop: inlineBackdrop, contentPlacement: "aboveGlass", style: [
|
|
52
|
+
{
|
|
53
|
+
width: '100%',
|
|
54
|
+
borderRadius: radius,
|
|
55
|
+
overflow: 'hidden',
|
|
56
|
+
backgroundColor: 'transparent',
|
|
57
|
+
borderWidth,
|
|
58
|
+
borderColor,
|
|
59
|
+
},
|
|
60
|
+
glassSizingStyle,
|
|
61
|
+
centeredOriginStyle,
|
|
62
|
+
glassStyle,
|
|
63
|
+
], contentStyle: glassContentStyle, animatedStyle: animatedStyle, children: children }));
|
|
64
|
+
}
|
|
65
|
+
const solidStyle = [
|
|
66
|
+
{
|
|
67
|
+
backgroundColor: resolvedBackground,
|
|
68
|
+
borderRadius: radius,
|
|
69
|
+
overflow: 'hidden',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
borderWidth,
|
|
72
|
+
borderColor,
|
|
73
|
+
},
|
|
74
|
+
centeredOriginStyle,
|
|
75
|
+
resolvedSolidContentStyle,
|
|
76
|
+
style,
|
|
77
|
+
];
|
|
78
|
+
return animatedStyle
|
|
79
|
+
? _jsx(Animated.View, { style: [solidStyle, animatedStyle], children: children })
|
|
80
|
+
: _jsx(View, { style: solidStyle, children: children });
|
|
81
|
+
});
|
|
82
|
+
Surface.displayName = 'HyperSurface';
|
|
83
|
+
//# sourceMappingURL=Surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Surface.js","sourceRoot":"","sources":["../../../src/primitives/Surface.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,E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OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAC,QAAQ,EACpB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,uBAAuB,EAAE,cAAc,EACvC,gBAAgB,EAAC,YAAY,EAC7B,KAAK,EAAE;gBACH;oBACI,KAAK,EAAE,MAAM;oBACb,YAAY,EAAE,MAAM;oBACpB,QAAQ,EAAE,QAAQ;oBAClB,eAAe,EAAE,aAAa;oBAC9B,WAAW;oBACX,WAAW;iBACd;gBACD,gBAAgB;gBAChB,mBAAmB;gBACnB,UAAU;aACb,EACD,YAAY,EAAE,iBAAiB,EAC/B,aAAa,EAAE,aAAa,YAE3B,QAAQ,GACE,CAClB,CAAC;IACN,CAAC;IAED,MAAM,UAAU,GAAyB;QACrC;YACI,eAAe,EAAE,kBAAkB;YACnC,YAAY,EAAE,MAAM;YACpB,QAAQ,EAAE,QAAiB;YAC3B,aAAa,EAAE,QAAiB;YAChC,WAAW;YACX,WAAW;SACd;QACD,mBAAmB;QACnB,yBAAyB;QACzB,KAAK;KACR,CAAC;IACF,OAAO,aAAa;QAChB,CAAC,CAAC,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,YAAG,QAAQ,GAAiB;QAC/E,CAAC,CAAC,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,YAAG,QAAQ,GAAQ,CAAC;AACrD,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '../theme';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Text as RNText } from 'react-native';
|
|
5
|
+
const WEIGHT_MAP = {
|
|
6
|
+
normal: '400',
|
|
7
|
+
medium: '500',
|
|
8
|
+
semibold: '600',
|
|
9
|
+
bold: '700',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Design System Text.
|
|
13
|
+
*
|
|
14
|
+
* Visual reference:
|
|
15
|
+
* miuix-vue/src/components/text/Text.vue (TextStyles.kt presets)
|
|
16
|
+
*
|
|
17
|
+
* Resolution precedence: explicit props > style preset > theme default.
|
|
18
|
+
*/
|
|
19
|
+
export const Text = memo(function Text({ type = 'main', weight, color, size, align, style, children, ...rest }) {
|
|
20
|
+
const theme = useTheme();
|
|
21
|
+
const preset = theme.typography[type];
|
|
22
|
+
const resolvedWeight = weight != null
|
|
23
|
+
? typeof weight === 'number'
|
|
24
|
+
? String(weight)
|
|
25
|
+
: WEIGHT_MAP[weight]
|
|
26
|
+
: preset.fontWeight;
|
|
27
|
+
const resolvedLineHeight = preset.lineHeightRatio != null ? Math.round(preset.fontSize * preset.lineHeightRatio) : preset.lineHeight;
|
|
28
|
+
return (_jsx(RNText, { ...rest, style: [
|
|
29
|
+
{
|
|
30
|
+
color: color ?? theme.colors.onSurface,
|
|
31
|
+
fontSize: size ?? preset.fontSize,
|
|
32
|
+
fontWeight: resolvedWeight,
|
|
33
|
+
textAlign: align,
|
|
34
|
+
lineHeight: resolvedLineHeight,
|
|
35
|
+
},
|
|
36
|
+
style,
|
|
37
|
+
], children: children }));
|
|
38
|
+
});
|
|
39
|
+
Text.displayName = 'HyperText';
|
|
40
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../src/primitives/Text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAY9C,MAAM,UAAU,GAA4C;IACxD,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,Q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
|
+
export { Surface } from './Surface';
|
|
4
|
+
export { Divider } from './Divider';
|
|
5
|
+
export { PressIndication } from './PressIndication';
|
|
6
|
+
export { Pressable } from './Pressable';
|
|
7
|
+
export { PressableScale } from './PressableScale';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced renderer entry point.
|
|
3
|
+
*
|
|
4
|
+
* Import from `@luckylca/react-native-liquid-glass/renderer` when you need the
|
|
5
|
+
* low-level glass surface, native engine controls or telemetry directly
|
|
6
|
+
* instead of the standard control set. Everything here is also exported from
|
|
7
|
+
* the package root; this subpath exists so a renderer-only consumer — a
|
|
8
|
+
* native benchmark harness, for example — can depend on the optical API
|
|
9
|
+
* without pulling the whole control kit into its module graph.
|
|
10
|
+
*/
|
|
11
|
+
export { GlassAppearanceProvider, GlassMaterialProvider, GlassOverlay, GlassSurface, RouteGlassCaptureScope, RouteGlassCaptureSource, useGlassAppearance, useGlassProviderId, useGlassReducedMotion, } from './GlassSurface';
|
|
12
|
+
export { useGlassPressMotion } from './useGlassPressMotion';
|
|
13
|
+
export { glassController, setSharedPassEnabled, setSharedPassProbe } from './glassController';
|
|
14
|
+
export { getGlassNativeEngine, setGlassNativeEngine } from './glassNativeEngine';
|
|
15
|
+
export { getGlassRuntime, setGlassRuntime } from './glassRuntime';
|
|
16
|
+
export { GlassTabBar, GLASS_TAB_BAR_CONTENT_INSET } from './GlassTabBar';
|
|
17
|
+
export { GlassTabLens } from './GlassTabLens';
|
|
18
|
+
export { LiquidGlassProvider } from './LiquidGlassProvider';
|
|
19
|
+
export { beginEffectiveScrollFpsSession, getLiquidGlassPerformanceStats, setLiquidGlassPerformanceTelemetryEnabled, } from './performanceTelemetry';
|
|
20
|
+
export { getLocalGlassNativeEngine, getLocalGlassTelemetry, setLocalGlassHardwareLayerExperimentEnabled, setLocalGlassNativeEngine, setLocalGlassTelemetryEnabled, setLocalGlassVisibleItemCount, } from './localGlassTelemetry';
|
|
21
|
+
export { getSurfaceRendererPolicy, getSurfaceRendererPolicyOverride, setSurfaceRendererPolicyOverride, } from './surfaceRendererPolicy';
|
|
22
|
+
//# sourceMappingURL=renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACH,8BAA8B,EAC9B,8BAA8B,EAC9B,yCAAyC,GAC5C,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,yBAAyB,EACzB,sBAAsB,EACtB,2CAA2C,EAC3C,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,GAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,wBAAwB,EACxB,gCAAgC,EAChC,gCAAgC,GACnC,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Preserve step and magnetic key-point semantics across both public slider APIs. */
|
|
2
|
+
export function resolveSliderValue(value, min, max, step = 0, keyPoints = [], magnetThreshold = .02) {
|
|
3
|
+
const span = max - min;
|
|
4
|
+
if (span <= 0)
|
|
5
|
+
return min;
|
|
6
|
+
let next = Math.max(min, Math.min(max, value));
|
|
7
|
+
if (step > 0)
|
|
8
|
+
next = min + Math.round((next - min) / step) * step;
|
|
9
|
+
else {
|
|
10
|
+
let distance = Math.max(0, magnetThreshold) * span;
|
|
11
|
+
let target = next;
|
|
12
|
+
for (const point of keyPoints) {
|
|
13
|
+
if (point < min || point > max || !Number.isFinite(point))
|
|
14
|
+
continue;
|
|
15
|
+
const delta = Math.abs(point - next);
|
|
16
|
+
if (delta < distance) {
|
|
17
|
+
target = point;
|
|
18
|
+
distance = delta;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
next = target;
|
|
22
|
+
}
|
|
23
|
+
return Math.max(min, Math.min(max, next));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=sliderValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliderValue.js","sourceRoot":"","sources":["../../src/sliderValue.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,GAAW,EAAE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
+
import React, { useContext } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import Animated, { useAnimatedProps } from 'react-native-reanimated';
|
|
5
|
+
import { LocalGlassMaterial } from '../LocalGlassMaterial';
|
|
6
|
+
import { GlassRuntimeContext } from './contexts';
|
|
7
|
+
import { NativeBackdropSurface } from './NativeSurface';
|
|
8
|
+
import { styles } from './styles';
|
|
9
|
+
export const InlineBackdropSurface = React.memo(function InlineBackdropSurface({ renderingEnabled, providerId, variant, tintColor, interactive, continuous, sharedSource, captureProbe, opticalProgress, pointerEvent, pointerEventValue, pointerEventSink, valueEventSink, valueEvent, opticalToggleFraction, opticalPointX, opticalPointY, opticalVelocityX, opticalVelocityY, opticalMotionX, opticalMotionY, materialOverrides, displacementOnlyDebug, syncContentTransform, intrinsicLayout, contentStyle, placement, children, }) {
|
|
10
|
+
const runtime = useContext(GlassRuntimeContext);
|
|
11
|
+
const hasAnimatedOptics = Boolean(opticalPointX ||
|
|
12
|
+
opticalPointY ||
|
|
13
|
+
opticalVelocityX ||
|
|
14
|
+
opticalVelocityY ||
|
|
15
|
+
opticalProgress ||
|
|
16
|
+
opticalToggleFraction ||
|
|
17
|
+
opticalMotionX ||
|
|
18
|
+
opticalMotionY);
|
|
19
|
+
const animatedOptics = useAnimatedProps(() => ({
|
|
20
|
+
interactionVelocityX: opticalVelocityX?.value,
|
|
21
|
+
interactionVelocityY: opticalVelocityY?.value,
|
|
22
|
+
interactionPointX: opticalPointX?.value,
|
|
23
|
+
interactionPointY: opticalPointY?.value,
|
|
24
|
+
interactionProgress: opticalProgress?.value ?? 0,
|
|
25
|
+
toggleFraction: opticalToggleFraction?.value ?? 0,
|
|
26
|
+
motionX: opticalMotionX ? Math.max(-1, Math.min(1, opticalMotionX.value / 1800)) : undefined,
|
|
27
|
+
motionY: opticalMotionY ? Math.max(-1, Math.min(1, opticalMotionY.value / 1800)) : undefined,
|
|
28
|
+
}), [
|
|
29
|
+
opticalPointX,
|
|
30
|
+
opticalPointY,
|
|
31
|
+
opticalVelocityX,
|
|
32
|
+
opticalVelocityY,
|
|
33
|
+
opticalProgress,
|
|
34
|
+
pointerEventValue,
|
|
35
|
+
valueEvent,
|
|
36
|
+
opticalToggleFraction,
|
|
37
|
+
opticalMotionX,
|
|
38
|
+
opticalMotionY,
|
|
39
|
+
]);
|
|
40
|
+
if (!runtime)
|
|
41
|
+
return _jsx(_Fragment, { children: children });
|
|
42
|
+
const { tokens, dark, reducedMotion } = runtime;
|
|
43
|
+
const material = materialOverrides
|
|
44
|
+
? { ...tokens.materials[variant], ...materialOverrides }
|
|
45
|
+
: tokens.materials[variant];
|
|
46
|
+
const qualityScale = material.opticsModel === 'referenceParity'
|
|
47
|
+
? 1
|
|
48
|
+
: tokens.quality === 'high'
|
|
49
|
+
? 1.2
|
|
50
|
+
: tokens.quality === 'fallback'
|
|
51
|
+
? 0.45
|
|
52
|
+
: 1;
|
|
53
|
+
return (_jsxs(View, { collapsable: !syncContentTransform, style: intrinsicLayout ? styles.inlineBackdropIntrinsicSurface : styles.inlineBackdropSurface, children: [_jsx(NativeBackdropSurface, { renderingEnabled: renderingEnabled, providerId: providerId, opticsModel: material.opticsModel, depthEffect: material.referenceDepthEffect ?? false, highlightStyle: material.referenceHighlightStyle, interactionProfile: material.referenceInteractionProfile, contentScaleX: material.referenceContentScaleX, contentScaleY: material.referenceContentScaleY, sampleOffsetX: material.referenceSampleOffsetX, sampleOffsetY: material.referenceSampleOffsetY, toggleTrackColorOff: material.referenceToggleTrackColorOff, toggleTrackColorOn: material.referenceToggleTrackColorOn, toggleTrackWidth: material.referenceToggleTrackWidth, toggleTrackHeight: material.referenceToggleTrackHeight, toggleSolidBackdropColor: material.referenceToggleSolidBackdropColor, brightness: material.brightness ?? 0, contrast: material.contrast ?? 1, highlightFalloff: material.highlightFalloff ?? 1, sdfContrast: material.sdfScaleLens?.contrast, sdfBrightness: material.sdfScaleLens?.brightness, sdfSaturation: material.sdfScaleLens?.saturation, sdfOuterShadowAlpha: material.sdfScaleLens?.outerShadowAlpha, sdfOuterShadowBlurRadius: material.sdfScaleLens?.outerShadowBlurRadius, sdfOuterShadowOffsetY: material.sdfScaleLens?.outerShadowOffsetY, sdfInnerShadowAlpha: material.sdfScaleLens?.innerShadowAlpha, sdfInnerShadowExtent: material.sdfScaleLens?.innerShadowExtent, cornerRadius: material.radius, blurRadius: material.blurRadius * qualityScale, refractionHeight: material.refractionHeight * qualityScale, refractionAmount: material.refractionAmount * qualityScale, bodyRefractionAmount: (material.refractionBodyAmount ?? 2.5) * qualityScale, interactionProgress: 0, pointerEvent: pointerEventValue, pointerEventSink: pointerEventSink, valueEventSink: valueEventSink, valueEvent: valueEvent, saturation: material.saturation, chromaticAberration: material.opticsModel === 'referenceParity' ||
|
|
54
|
+
tokens.quality === 'high' ||
|
|
55
|
+
variant === 'tabSelectionLens'
|
|
56
|
+
? material.chromaticAberration
|
|
57
|
+
: 0, highlightAlpha: material.highlightAlpha, highlightWidth: material.highlightWidth, lightAngle: material.highlightAngle ?? 45, highlightColor: material.highlightColor
|
|
58
|
+
? dark
|
|
59
|
+
? material.highlightColor.dark
|
|
60
|
+
: material.highlightColor.light
|
|
61
|
+
: undefined, tintAlpha: material.tintAlpha ?? 1, specularStrength: material.specularStrength ?? 1, fresnelStrength: material.fresnelStrength ?? 0.85, innerShadowStrength: material.innerShadowStrength ?? (material.opticsModel === 'referenceParity' ? 0 : 0.18), shadowOpacity: material.shadowOpacity ?? (material.opticsModel === 'referenceParity' ? 0 : 0.1), shadowRadius: material.shadowRadius ?? (material.opticsModel === 'referenceParity' ? 0 : 24), shadowOffsetY: material.shadowOffsetY ?? (material.opticsModel === 'referenceParity' ? 0 : 4), tint: tintColor ?? (dark ? tokens.tint.dark : tokens.tint.light), surfaceColor: material.surfaceColor
|
|
62
|
+
? dark
|
|
63
|
+
? material.surfaceColor.dark
|
|
64
|
+
: material.surfaceColor.light
|
|
65
|
+
: undefined, interactive: interactive && tokens.interaction.enabled && !reducedMotion, continuous: continuous, sharedSource: sharedSource, captureProbe: captureProbe, displacementOnlyDebug: displacementOnlyDebug, syncContentTransform: syncContentTransform, animatedProps: hasAnimatedOptics ? animatedOptics : undefined, pointerEvents: interactive ? undefined : 'none', style: [StyleSheet.absoluteFill, { borderRadius: material.radius }] }), _jsx(View, { style: [
|
|
66
|
+
intrinsicLayout
|
|
67
|
+
? styles.portalContentIntrinsic
|
|
68
|
+
: placement === 'layout'
|
|
69
|
+
? styles.portalContentLayout
|
|
70
|
+
: styles.portalContentWrap,
|
|
71
|
+
contentStyle,
|
|
72
|
+
], children: children })] }));
|
|
73
|
+
});
|
|
74
|
+
export function LocalGlassSurface({ variant, surfaceRole, style, contentStyle, animatedStyle, fallbackAnimatedStyle, pointerEvents, onLayout, children, }) {
|
|
75
|
+
const runtime = useContext(GlassRuntimeContext);
|
|
76
|
+
if (!runtime?.tokens.enabled)
|
|
77
|
+
return (_jsx(Animated.View, { onLayout: onLayout, style: [style, animatedStyle, fallbackAnimatedStyle], children: _jsx(View, { style: contentStyle, children: children }) }));
|
|
78
|
+
const { tokens, dark } = runtime;
|
|
79
|
+
const material = tokens.materials[variant ?? 'surface'];
|
|
80
|
+
const fallback = tokens.quality === 'fallback';
|
|
81
|
+
return (_jsxs(Animated.View, { pointerEvents: pointerEvents, onLayout: onLayout, style: [
|
|
82
|
+
styles.localSurface,
|
|
83
|
+
{ borderRadius: material.radius, backgroundColor: 'transparent' },
|
|
84
|
+
style,
|
|
85
|
+
animatedStyle,
|
|
86
|
+
fallbackAnimatedStyle,
|
|
87
|
+
], children: [fallback ? (_jsx(View, { pointerEvents: "none", style: [
|
|
88
|
+
StyleSheet.absoluteFill,
|
|
89
|
+
{
|
|
90
|
+
backgroundColor: dark ? tokens.fallbackTint.dark : tokens.fallbackTint.light,
|
|
91
|
+
borderColor: dark ? tokens.fallbackBorder.dark : tokens.fallbackBorder.light,
|
|
92
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
93
|
+
borderRadius: material.radius,
|
|
94
|
+
},
|
|
95
|
+
] })) : (_jsx(LocalGlassMaterial, { tokens: tokens, material: material, dark: dark, surfaceRole: surfaceRole })), _jsx(View, { style: [styles.localContent, contentStyle], children: children })] }));
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=InlineSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineSurface.js","sourceRoot":"","sources":["../../../src/surface/InlineSurface.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,QAAQ,EAAE,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,qBAAqB,CAAC,EAC3E,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,QAAQ,GAmCX;IACG,MAAM,OAAO,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,OAAO,CAC7B,aAAa;QAC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back, useId, useMemo, useRef } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { GlassRuntimeContext, GlassHostContext, GlassOverlayHostContext, GlassScopeActiveContext, } from './contexts';
|
|
5
|
+
import { createEntryRegistry, sameSurface, sameOverlay } from './registry';
|
|
6
|
+
import { GlassCaptureSourceView } from './NativeSurface';
|
|
7
|
+
import { GlassSurfacePortalLayer, GlassRouteOverlayLayer } from './PortalLayers';
|
|
8
|
+
import { styles } from './styles';
|
|
9
|
+
export function GlassAppearanceProvider({ children, tokens, dark, reducedMotion = false, }) {
|
|
10
|
+
const runtime = useMemo(() => ({ tokens, dark, reducedMotion }), [tokens, dark, reducedMotion]);
|
|
11
|
+
return _jsx(GlassRuntimeContext.Provider, { value: runtime, children: children });
|
|
12
|
+
}
|
|
13
|
+
export function GlassMaterialProvider({ children, backdrop, themeBackdrop, themeBackdropRevision, inlineBackdropByDefault = false, defaultSamplingSource = 'routeScene', providerId: providerIdProp, style, tokens, dark, reducedMotion = false, active = true, }) {
|
|
14
|
+
const hostRef = useRef(null);
|
|
15
|
+
const generatedProviderId = useId();
|
|
16
|
+
const providerId = providerIdProp ?? generatedProviderId;
|
|
17
|
+
const routeSceneProviderId = backdrop !== undefined ? providerId : null;
|
|
18
|
+
const generatedThemeBackdropProviderId = useId();
|
|
19
|
+
// When a separate stable theme backdrop was not supplied, the provider's
|
|
20
|
+
// base backdrop is the stable scene. Aliasing its id avoids recording that
|
|
21
|
+
// exact scene into a second native source just to support inline lenses.
|
|
22
|
+
const themeBackdropProviderId = themeBackdrop !== undefined ? generatedThemeBackdropProviderId : providerId;
|
|
23
|
+
const surfaceRegistryRef = useRef(null);
|
|
24
|
+
const overlayRegistryRef = useRef(null);
|
|
25
|
+
if (!surfaceRegistryRef.current)
|
|
26
|
+
surfaceRegistryRef.current = createEntryRegistry();
|
|
27
|
+
if (!overlayRegistryRef.current)
|
|
28
|
+
overlayRegistryRef.current = createEntryRegistry();
|
|
29
|
+
const surfaceRegistry = surfaceRegistryRef.current;
|
|
30
|
+
const overlayRegistry = overlayRegistryRef.current;
|
|
31
|
+
const runtime = useMemo(() => ({ tokens, dark, reducedMotion }), [tokens, dark, reducedMotion]);
|
|
32
|
+
const updateSurface = useCallback((id, entry) => {
|
|
33
|
+
surfaceRegistry.update(id, entry, sameSurface);
|
|
34
|
+
}, [surfaceRegistry]);
|
|
35
|
+
const updateOverlay = useCallback((id, entry) => {
|
|
36
|
+
overlayRegistry.update(id, entry, sameOverlay);
|
|
37
|
+
}, [overlayRegistry]);
|
|
38
|
+
const removeOverlay = useCallback((id) => {
|
|
39
|
+
overlayRegistry.remove(id);
|
|
40
|
+
}, [overlayRegistry]);
|
|
41
|
+
const remove = useCallback((id) => {
|
|
42
|
+
surfaceRegistry.remove(id);
|
|
43
|
+
overlayRegistry.remove(id);
|
|
44
|
+
}, [surfaceRegistry, overlayRegistry]);
|
|
45
|
+
const hasSeparateBackdrop = backdrop !== undefined;
|
|
46
|
+
const context = useMemo(() => ({
|
|
47
|
+
providerId,
|
|
48
|
+
routeSceneProviderId,
|
|
49
|
+
themeBackdropProviderId,
|
|
50
|
+
inlineBackdropByDefault,
|
|
51
|
+
hasSeparateBackdrop,
|
|
52
|
+
defaultSamplingSource,
|
|
53
|
+
hostRef,
|
|
54
|
+
updateSurface,
|
|
55
|
+
updateOverlay,
|
|
56
|
+
removeOverlay,
|
|
57
|
+
remove,
|
|
58
|
+
}), [
|
|
59
|
+
providerId,
|
|
60
|
+
routeSceneProviderId,
|
|
61
|
+
themeBackdropProviderId,
|
|
62
|
+
inlineBackdropByDefault,
|
|
63
|
+
hasSeparateBackdrop,
|
|
64
|
+
defaultSamplingSource,
|
|
65
|
+
updateSurface,
|
|
66
|
+
updateOverlay,
|
|
67
|
+
removeOverlay,
|
|
68
|
+
remove,
|
|
69
|
+
]);
|
|
70
|
+
const overlayContext = useMemo(() => ({ providerId, updateOverlay, remove }), [providerId, updateOverlay, remove]);
|
|
71
|
+
const recording = active && tokens.enabled;
|
|
72
|
+
return (_jsx(GlassRuntimeContext.Provider, { value: runtime, children: _jsx(GlassHostContext.Provider, { value: context, children: _jsx(GlassOverlayHostContext.Provider, { value: overlayContext, children: _jsx(View, { ref: hostRef, collapsable: false, style: [styles.root, style], children: _jsxs(GlassScopeActiveContext.Provider, { value: recording, children: [recording && themeBackdrop !== undefined ? (_jsx(GlassCaptureSourceView, { providerId: themeBackdropProviderId, captureMode: "static", sourceRevision: themeBackdropRevision, pointerEvents: "none", style: StyleSheet.absoluteFill, children: themeBackdrop })) : null, hasSeparateBackdrop ? (_jsxs(_Fragment, { children: [_jsx(GlassCaptureSourceView, { providerId: providerId, underlayProviderId: themeBackdrop !== undefined ? themeBackdropProviderId : undefined, captureMode: recording ? 'live' : 'frozen', style: StyleSheet.absoluteFill, children: backdrop }), _jsx(View, { pointerEvents: "box-none", style: StyleSheet.absoluteFill, children: children })] })) : (_jsx(GlassCaptureSourceView, { providerId: providerId, underlayProviderId: themeBackdrop !== undefined ? themeBackdropProviderId : undefined, captureMode: recording ? 'live' : 'frozen', style: StyleSheet.absoluteFill, children: children })), _jsx(GlassSurfacePortalLayer, { registry: surfaceRegistry, tokens: tokens }), _jsx(GlassRouteOverlayLayer, { registry: overlayRegistry, enabled: recording })] }) }) }) }) }));
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=MaterialProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialProvider.js","sourceRoot":"","sources":["../../../src/surface/MaterialProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EACH,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,GAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBA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