@luckylca/react-native-liquid-glass 0.0.0-stage → 0.2.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 +307 -2
- package/README.zh-CN.md +310 -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/localglass/ExpoLocalGlassEngineModule.kt +141 -0
- package/android/src/main/java/expo/modules/localglass/ExpoLocalGlassModule.kt +341 -0
- package/android/src/main/java/expo/modules/localglass/LocalGlassShader.kt +59 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/CoreLiquidGlassRegistry.kt +75 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/EffectiveScrollInputBridge.kt +47 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/ExpoGlassCoreModule.kt +226 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/ExpoGlassProviderCoreView.kt +1125 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/ExpoGlassSurfaceCoreView.kt +571 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/PassSurfaceSuppression.kt +39 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/SharedGlassPassProbeLog.kt +23 -0
- package/android/src/main/java/expo/modules/newhuliquidglass/SharedGlassPassWiring.kt +59 -0
- package/android-core/build.gradle +36 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/BackdropRecorder.kt +930 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/FrozenBackdrop.kt +66 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/GlassBackdropCoordinator.kt +624 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/GlassBackdropSourceHandle.kt +8 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/GlassScrollSource.kt +13 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/GlassViewController.kt +1605 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/LiquidGlassProviderLayout.kt +340 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/LiquidGlassView.kt +103 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/ReferenceSourceWindowPolicy.kt +13 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/StableSceneTexturePolicy.kt +43 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/internal/GlassViewRenderer.kt +1459 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/internal/ReferenceTabSampling.kt +15 -0
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/internal/SharedSceneCapture.kt +163 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassCapabilities.kt +21 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassEngine.kt +131 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassMaterial.kt +89 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassMath.kt +131 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassOpticalInsets.kt +8 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassRenderTier.kt +54 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassShapePacker.kt +77 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassSurfaceState.kt +11 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/GlassUniforms.kt +113 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/LiquidGlassShaders.kt +234 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/SharedGlassPass.kt +456 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/geometry/G2RoundedRectangle.kt +207 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/geometry/ReferenceG2MaskTexture.kt +334 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/HeightFieldGlassShader.kt +7 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/ReferenceBackdropBlurShader.kt +58 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/ReferenceGaussianDiscBackdropBlur.kt +42 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/ReferenceGlassUniforms.kt +111 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/ReferenceParityGlassShader.kt +613 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/ReferenceParityMultiShapeShader.kt +128 -0
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/SdfScaleLensShader.kt +144 -0
- package/android-core/src/main/java/com/newhu/liquidglass/local/LocalGlassHardwareLayerExperiment.kt +29 -0
- package/android-core/src/main/java/com/newhu/liquidglass/local/LocalGlassMaterial.kt +14 -0
- package/android-core/src/main/java/com/newhu/liquidglass/local/LocalGlassRenderer.kt +126 -0
- package/android-core/src/main/java/com/newhu/liquidglass/local/LocalGlassRuntimeShader.kt +50 -0
- package/android-core/src/main/java/com/newhu/liquidglass/local/LocalGlassShader.kt +59 -0
- package/android-core/src/main/java/com/newhu/liquidglass/local/LocalGlassView.kt +47 -0
- package/android-core/src/main/java/com/newhu/liquidglass/motion/GlassMotionDriver.kt +824 -0
- package/android-core/src/main/java/com/newhu/liquidglass/motion/GlassMotionState.kt +359 -0
- package/android-core/src/main/java/com/newhu/liquidglass/motion/PointerVelocityTracker.kt +109 -0
- package/android-core/src/main/java/com/newhu/liquidglass/motion/SpringSpec.kt +209 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/G2Corner.kt +194 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/GlassMaterial.kt +250 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/GlassOpticsShader.kt +696 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/GlassParityProbe.kt +342 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/GlassShapeGeometry.kt +317 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/GlassUniformBinder.kt +308 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/PixelDiff.kt +363 -0
- package/android-core/src/main/java/com/newhu/liquidglass/optics/ReferenceOptics.kt +568 -0
- package/android-core/src/main/java/com/newhu/liquidglass/rendering/GlassEngineSelection.kt +30 -0
- package/android-core/src/main/java/com/newhu/liquidglass/rendering/GlassSurfaceHost.kt +317 -0
- package/android-core/src/main/java/com/newhu/liquidglass/rendering/GlassSurfaceRenderer.kt +847 -0
- package/android-core/src/main/java/com/newhu/liquidglass/rendering/RetainedBackdropLayer.kt +83 -0
- package/android-core/src/main/java/com/newhu/liquidglass/scheduler/GlassFrameScheduler.kt +27 -0
- package/android-core/src/main/java/com/newhu/liquidglass/telemetry/EffectiveScrollFpsProbe.kt +965 -0
- package/android-core/src/main/java/com/newhu/liquidglass/telemetry/GlassTelemetry.kt +16 -0
- package/android-core/src/main/java/com/newhu/liquidglass/telemetry/LiquidGlassPerfTelemetry.kt +676 -0
- package/android-core/src/main/java/com/newhu/liquidglass/telemetry/LiquidGlassTrace.kt +30 -0
- package/android-core/src/main/java/com/newhu/liquidglass/telemetry/LocalGlassTelemetry.kt +55 -0
- package/app.plugin.js +25 -0
- package/docs/images/buttons.webp +0 -0
- package/docs/images/controls.webp +0 -0
- package/docs/images/tabs.webp +0 -0
- package/docs/publishing.md +84 -0
- package/expo-module.config.json +10 -0
- package/lib/commonjs/GlassSurface.js +832 -0
- package/lib/commonjs/GlassSurface.js.map +1 -0
- package/lib/commonjs/GlassTabBar.js +976 -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 +194 -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 +65 -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 +27 -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 +113 -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 +33 -0
- package/lib/commonjs/nativeGlassViews.js.map +1 -0
- package/lib/commonjs/performanceTelemetry.js +28 -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/surfaceRendererPolicy.js +32 -0
- package/lib/commonjs/surfaceRendererPolicy.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 +782 -0
- package/lib/module/GlassSurface.js.map +1 -0
- package/lib/module/GlassTabBar.js +939 -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 +191 -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 +58 -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 +22 -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 +103 -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 +27 -0
- package/lib/module/nativeGlassViews.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performanceTelemetry.js +23 -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/surfaceRendererPolicy.js +27 -0
- package/lib/module/surfaceRendererPolicy.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 +216 -0
- package/lib/types/GlassTabBar.d.ts +35 -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 +7 -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 +114 -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/surfaceRendererPolicy.d.ts +14 -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 +139 -4
- package/patches/liquid-glass-kit+1.0.0.patch +2015 -0
- package/patches/liquid-glass-kit-invalidation-coalescing.diff +249 -0
- package/patches/liquid-glass-kit-native-infra.diff +624 -0
- package/scripts/apply-legacy-patches.mjs +116 -0
- package/src/GlassSurface.tsx +1786 -0
- package/src/GlassTabBar.tsx +1304 -0
- package/src/GlassTabLens.tsx +92 -0
- package/src/LiquidGlassProvider.tsx +135 -0
- package/src/LocalGlassMaterial.tsx +262 -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 +74 -0
- package/src/glassNativeEngine.ts +16 -0
- package/src/glassRuntime.ts +28 -0
- package/src/index.ts +199 -0
- package/src/inputPresentation.ts +32 -0
- package/src/localGlassTelemetry.ts +138 -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 +147 -0
- package/src/performanceTelemetry.ts +95 -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/surfaceRendererPolicy.ts +32 -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":"pointerGeometry.js","sourceRoot":"","sources":["../../src/pointerGeometry.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,UAAU,cAAc,CAAC,SAAiB,EAAE,QAAgB,EAAE,SAAiB;IACjF,SAAS,CAAC;IACV,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QAC7G,OAAO,CAAC,CAAC;IACb,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Least-squares 2D velocity over the newest 100ms/20 samples, in dp/s. */
|
|
2
|
+
export function estimateGlassPointerVelocity(samples, windowSeconds = 0.1) {
|
|
3
|
+
if (samples.length < 2)
|
|
4
|
+
return { x: 0, y: 0 };
|
|
5
|
+
const now = samples[samples.length - 1].timeSeconds;
|
|
6
|
+
const cutoff = now - windowSeconds;
|
|
7
|
+
let n = 0, sumT = 0, sumTT = 0, sumX = 0, sumY = 0, sumTX = 0, sumTY = 0;
|
|
8
|
+
for (let index = samples.length - 1; index >= 0 && n < 20; index--) {
|
|
9
|
+
const sample = samples[index];
|
|
10
|
+
if (sample.timeSeconds < cutoff)
|
|
11
|
+
break;
|
|
12
|
+
const t = sample.timeSeconds - now;
|
|
13
|
+
n++;
|
|
14
|
+
sumT += t;
|
|
15
|
+
sumTT += t * t;
|
|
16
|
+
sumX += sample.x;
|
|
17
|
+
sumY += sample.y;
|
|
18
|
+
sumTX += t * sample.x;
|
|
19
|
+
sumTY += t * sample.y;
|
|
20
|
+
}
|
|
21
|
+
if (n < 2)
|
|
22
|
+
return { x: 0, y: 0 };
|
|
23
|
+
const denominator = n * sumTT - sumT * sumT;
|
|
24
|
+
if (Math.abs(denominator) < 1e-9)
|
|
25
|
+
return { x: 0, y: 0 };
|
|
26
|
+
return {
|
|
27
|
+
x: (n * sumTX - sumT * sumX) / denominator,
|
|
28
|
+
y: (n * sumTY - sumT * sumY) / denominator,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=pressVelocity.js.map
|
|
@@ -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,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC;IACpD,MAAM,MAAM,GAAG,GAAG,GAAG,aAAa,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC;IACzE,KAAK,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC;QACjE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,MAAM,CAAC,WAAW,GAAG,MAAM;YAAE,MAAM;QACvC,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;QACnC,CAAC,EAAE,CAAC;QACJ,IAAI,IAAI,CAAC,CAAC;QACV,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC;QACf,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC;QACjB,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,IAAI;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACxD,OAAO;QACH,CAAC,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,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAuDhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,EAC/C,KAAK,EACL,eAAe,EACf,MAAM,GAAG,CAAC,EACV,QAAQ,GAAG,OAAO,EAClB,YAAY,GAAG,MAAM,EACrB,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,OAAO,EAClB,cAAc,GAAG,YAAY,EAC7B,cAAc,GAAG,KAAK,EACtB,WAAW,GAAG,aAAa,EAC3B,WAAW,GAAG,CAAC,EACf,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,QAAQ,EACR,KAAK,GACS;IACd,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,iBAAiB,IAAI,SAAS,CAAC;YAAE,OAAO,KAAK,CAAC;QAClE,MAAM,WAAW,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;QACrC,OAAO,WAAW,CAAC,eAAe,CAAC;QACnC,OAAO,WAAW,CAAC;IACvB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9F,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,IAAI,CAAC,qBAAqB,IAAI,CAAC,CAAC,iBAAiB,IAAI,qBAAqB,CAAC;YAAE,OAAO,YAAY,CAAC;QACjG,MAAM,WAAW,GAAG,EAAE,GAAG,qBAAqB,EAAE,CAAC;QACjD,OAAO,WAAW,CAAC,eAAe,CAAC;QACnC,OAAO,WAAW,CAAC;IACvB,CAAC,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;QAClC,IAAI,CAAC,qBAAqB;YAAE,OAAO,SAAS,CAAC;QAC7C,MAAM,cAAc,GAAc,EAAE,CAAC;QACrC,MAAM,UAAU,GAA2B;YACvC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW;YAC1D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW;SACtE,CAAC;QACF,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACrB,cAA0C,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAC7D,CAAC;QACL,CAAC;QACD,OAAO,cAAc,CAAC;IAC1B,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC5B,MAAM,kBAAkB,GAAG,eAAe,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAC5E,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,SAAkB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1G,MAAM,yBAAyB,GAAG,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC;IAEhG,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACvB,OAAO,CACH,KAAC,YAAY,IACT,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,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;CACd,CAAC;AAoBF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAgB;IACxH,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAEtC,MAAM,cAAc,GAChB,MAAM,IAAI,IAAI;QACV,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;YACxB,CAAC,CAAC,MAAM,CAAC,MAAM,CAA4B;YAC3C,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;QACxB,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;IAE5B,MAAM,kBAAkB,GAAG,MAAM,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;IAErI,OAAO,CACH,KAAC,MAAM,OACC,IAAI,EACR,KAAK,EAAE;YACH;gBACI,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS;gBACtC,QAAQ,EAAE,IAAI,IAAI,MAAM,CAAC,QAAQ;gBACjC,UAAU,EAAE,cAAc;gBAC1B,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE,kBAAkB;aACjC;YACD,KAAK;SACR,YAEA,QAAQ,GACJ,CACZ,CAAC;AACN,CAAC,CAAC,CAAC;AACH,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Text } from './Text';
|
|
2
|
+
export { Icon } from './Icon';
|
|
3
|
+
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,GAAW,EAAE,IAAI,GAAG,CAAC,EAChF,YAA+B,EAAE,EAAE,eAAe,GAAG,GAAG;IACxD,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;IACvB,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IAC1B,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,IAAI,IAAI,GAAG,CAAC;QAAE,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;SAC7D,CAAC;QACF,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,IAAI,CAAC;QACnD,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;YAC5B,IAAI,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,SAAS;YACpE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;YACrC,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;gBAAC,MAAM,GAAG,KAAK,CAAC;gBAAC,QAAQ,GAAG,KAAK,CAAC;YAAC,CAAC;QAC/D,CAAC;QACD,IAAI,GAAG,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const overrides = {};
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the local material backend from the surface's reusable semantic role.
|
|
4
|
+
* The matched Settings device A/B found no effective-cadence gain from Skia,
|
|
5
|
+
* so local roles currently retain the native renderer. Backdrop optics never
|
|
6
|
+
* pass through this local renderer policy.
|
|
7
|
+
*/
|
|
8
|
+
export function getSurfaceRendererPolicy(role) {
|
|
9
|
+
if (role === 'backdropOptical')
|
|
10
|
+
return 'native';
|
|
11
|
+
return overrides[role] ?? 'native';
|
|
12
|
+
}
|
|
13
|
+
export function getSurfaceRendererPolicyOverride(role) {
|
|
14
|
+
return overrides[role] ?? null;
|
|
15
|
+
}
|
|
16
|
+
/** Diagnostic A/B control. Production calls are ignored. */
|
|
17
|
+
export function setSurfaceRendererPolicyOverride(role, renderer) {
|
|
18
|
+
if (!__DEV__)
|
|
19
|
+
return;
|
|
20
|
+
if (overrides[role] === renderer || (renderer == null && overrides[role] == null))
|
|
21
|
+
return;
|
|
22
|
+
if (renderer == null)
|
|
23
|
+
delete overrides[role];
|
|
24
|
+
else
|
|
25
|
+
overrides[role] = renderer;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=surfaceRendererPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceRendererPolicy.js","sourceRoot":"","sources":["../../src/surfaceRendererPolicy.ts"],"names":[],"mappings":"AAKA,MAAM,SAAS,GAAmD,EAAE,CAAC;AAErE;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAsB;IAC3D,IAAI,IAAI,KAAK,iBAAiB;QAAE,OAAO,QAAQ,CAAC;IAChD,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,IAAe;IAC5D,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACnC,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,gCAAgC,CAC5C,IAAe,EACf,QAAmC;IAEnC,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;QAAE,OAAO;IAC1F,IAAI,QAAQ,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;;QACxC,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
3
|
+
import { useColorScheme } from 'react-native';
|
|
4
|
+
import { resolveLiquidGlassTheme } from './registry';
|
|
5
|
+
import { MotionProvider } from '../motion/MotionProvider';
|
|
6
|
+
const ThemeContext = createContext(resolveLiquidGlassTheme(false));
|
|
7
|
+
/**
|
|
8
|
+
* Theme and motion scope for Liquid Glass components.
|
|
9
|
+
*
|
|
10
|
+
* This provider only resolves appearance and motion preference. It does not
|
|
11
|
+
* mount a backdrop recorder: surfaces that sample the scene need
|
|
12
|
+
* `GlassMaterialProvider` (or `LiquidGlassProvider`, which nests both) so the
|
|
13
|
+
* component library can be used for static previews without starting native
|
|
14
|
+
* capture.
|
|
15
|
+
*/
|
|
16
|
+
export function LiquidGlassThemeProvider({ mode = 'system', reducedMotion = false, value, children }) {
|
|
17
|
+
const systemScheme = useColorScheme();
|
|
18
|
+
const resolved = useMemo(() => {
|
|
19
|
+
if (value)
|
|
20
|
+
return value;
|
|
21
|
+
const dark = mode === 'dark' || (mode === 'system' && systemScheme === 'dark');
|
|
22
|
+
return resolveLiquidGlassTheme(dark);
|
|
23
|
+
}, [value, mode, systemScheme]);
|
|
24
|
+
return (_jsx(ThemeContext.Provider, { value: resolved, children: _jsx(MotionProvider, { reduced: reducedMotion, children: children }) }));
|
|
25
|
+
}
|
|
26
|
+
/** Read the current Liquid Glass theme. */
|
|
27
|
+
export function useLiquidGlassTheme() {
|
|
28
|
+
return useContext(ThemeContext);
|
|
29
|
+
}
|
|
30
|
+
/** @deprecated Use {@link useLiquidGlassTheme}. */
|
|
31
|
+
export const useTheme = useLiquidGlassTheme;
|
|
32
|
+
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAe1D,MAAM,YAAY,GAAG,aAAa,CAAmB,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,aAAa,GAAG,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAiC;IAC/H,MAAM,YAAY,GAAG,cAAc,EAAE,CAAC;IAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;QACxB,MAAM,IAAI,GAAG,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,YAAY,KAAK,MAAM,CAAC,CAAC;QAC/E,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAEhC,OAAO,CACH,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAClC,KAAC,cAAc,IAAC,OAAO,EAAE,aAAa,YAAG,QAAQ,GAAkB,GAC/C,CAC3B,CAAC;AACN,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,mBAAmB;IAC/B,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAAC"}
|