glacia-native 0.5.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -17
- package/lib/module/Accordion.js +58 -0
- package/lib/module/ActionSheet.js +38 -0
- package/lib/module/Alert.js +23 -0
- package/lib/module/AlertDialog.js +47 -0
- package/lib/module/Avatar.js +48 -0
- package/lib/module/Badge.js +36 -0
- package/lib/module/Bars.js +13 -268
- package/lib/module/Button.js +57 -39
- package/lib/module/Card.js +31 -19
- package/lib/module/Checkbox.js +42 -0
- package/lib/module/Chip.js +80 -0
- package/lib/module/Collapsible.js +26 -0
- package/lib/module/ContextMenu.js +33 -0
- package/lib/module/Dialog.js +39 -123
- package/lib/module/DropdownMenu.js +33 -0
- package/lib/module/Field.js +22 -0
- package/lib/module/Glass.js +10 -3
- package/lib/module/Group.js +36 -0
- package/lib/module/IconButton.js +40 -0
- package/lib/module/Input.js +43 -38
- package/lib/module/Label.js +17 -0
- package/lib/module/MorphGroup.js +47 -0
- package/lib/module/Popover.js +29 -0
- package/lib/module/Progress.js +32 -0
- package/lib/module/RadioGroup.js +51 -0
- package/lib/module/Scrim.js +44 -0
- package/lib/module/SegmentedControl.js +70 -63
- package/lib/module/Select.js +51 -0
- package/lib/module/Separator.js +25 -0
- package/lib/module/Sheet.js +51 -0
- package/lib/module/Skeleton.js +48 -0
- package/lib/module/Slider.js +45 -34
- package/lib/module/Stepper.js +167 -0
- package/lib/module/Switch.js +45 -55
- package/lib/module/TabBar.js +50 -44
- package/lib/module/Textarea.js +18 -0
- package/lib/module/Toast.js +55 -0
- package/lib/module/Toggle.js +47 -0
- package/lib/module/ToggleGroup.js +56 -0
- package/lib/module/Toolbar.js +37 -0
- package/lib/module/Tooltip.js +31 -0
- package/lib/module/glass-provider.js +28 -0
- package/lib/module/glass-stack.js +61 -0
- package/lib/module/index.js +78 -109
- package/lib/module/internal/GlassBackdrop.js +36 -0
- package/lib/module/internal/GlassView.js +43 -11
- package/lib/module/internal/blur-community.js +20 -0
- package/lib/module/internal/blur-community.web.js +9 -0
- package/lib/module/internal/blur.js +6 -9
- package/lib/module/internal/glass-routing.js +156 -30
- package/lib/module/internal/initials.js +12 -0
- package/lib/module/internal/overlay.js +147 -0
- package/lib/module/internal/primitives.js +16 -0
- package/lib/typescript/Accordion.d.ts +22 -0
- package/lib/typescript/ActionSheet.d.ts +24 -0
- package/lib/typescript/Alert.d.ts +15 -0
- package/lib/typescript/AlertDialog.d.ts +17 -0
- package/lib/typescript/Avatar.d.ts +22 -0
- package/lib/typescript/Badge.d.ts +12 -0
- package/lib/typescript/Bars.d.ts +3 -188
- package/lib/typescript/Button.d.ts +44 -10
- package/lib/typescript/Card.d.ts +30 -3
- package/lib/typescript/Checkbox.d.ts +14 -0
- package/lib/typescript/Chip.d.ts +19 -0
- package/lib/typescript/Collapsible.d.ts +17 -0
- package/lib/typescript/ContextMenu.d.ts +23 -0
- package/lib/typescript/Dialog.d.ts +8 -68
- package/lib/typescript/DropdownMenu.d.ts +23 -0
- package/lib/typescript/Field.d.ts +19 -0
- package/lib/typescript/Glass.d.ts +11 -2
- package/lib/typescript/Group.d.ts +35 -0
- package/lib/typescript/IconButton.d.ts +21 -0
- package/lib/typescript/Input.d.ts +17 -18
- package/lib/typescript/Label.d.ts +14 -0
- package/lib/typescript/MorphGroup.d.ts +46 -0
- package/lib/typescript/Popover.d.ts +17 -0
- package/lib/typescript/Progress.d.ts +13 -0
- package/lib/typescript/RadioGroup.d.ts +21 -0
- package/lib/typescript/Scrim.d.ts +33 -0
- package/lib/typescript/SegmentedControl.d.ts +24 -13
- package/lib/typescript/Select.d.ts +19 -0
- package/lib/typescript/Separator.d.ts +10 -0
- package/lib/typescript/Sheet.d.ts +45 -0
- package/lib/typescript/Skeleton.d.ts +10 -0
- package/lib/typescript/Slider.d.ts +15 -7
- package/lib/typescript/Stepper.d.ts +49 -0
- package/lib/typescript/Switch.d.ts +19 -12
- package/lib/typescript/TabBar.d.ts +18 -6
- package/lib/typescript/Textarea.d.ts +6 -0
- package/lib/typescript/Toast.d.ts +40 -0
- package/lib/typescript/Toggle.d.ts +21 -0
- package/lib/typescript/ToggleGroup.d.ts +22 -0
- package/lib/typescript/Toolbar.d.ts +35 -0
- package/lib/typescript/Tooltip.d.ts +16 -0
- package/lib/typescript/glass-provider.d.ts +34 -0
- package/lib/typescript/glass-stack.d.ts +54 -0
- package/lib/typescript/index.d.ts +38 -17
- package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
- package/lib/typescript/internal/GlassView.d.ts +18 -2
- package/lib/typescript/internal/blur-community.d.ts +2 -0
- package/lib/typescript/internal/blur-community.web.d.ts +2 -0
- package/lib/typescript/internal/glass-routing.d.ts +83 -15
- package/lib/typescript/internal/initials.d.ts +2 -0
- package/lib/typescript/internal/overlay.d.ts +74 -0
- package/lib/typescript/internal/primitives.d.ts +11 -0
- package/package.json +12 -10
- package/src/Accordion.tsx +165 -0
- package/src/ActionSheet.tsx +149 -0
- package/src/Alert.tsx +85 -0
- package/src/AlertDialog.tsx +124 -0
- package/src/Avatar.tsx +102 -0
- package/src/Badge.tsx +80 -0
- package/src/Bars.tsx +10 -807
- package/src/Button.tsx +196 -67
- package/src/Card.tsx +105 -32
- package/src/Checkbox.tsx +98 -0
- package/src/Chip.tsx +149 -0
- package/src/Collapsible.tsx +66 -0
- package/src/ContextMenu.tsx +103 -0
- package/src/Dialog.tsx +85 -335
- package/src/DropdownMenu.tsx +103 -0
- package/src/Field.tsx +65 -0
- package/src/Glass.tsx +15 -5
- package/src/Group.tsx +98 -0
- package/src/IconButton.tsx +110 -0
- package/src/Input.tsx +139 -87
- package/src/Label.tsx +56 -0
- package/src/MorphGroup.tsx +134 -0
- package/src/Popover.tsx +81 -0
- package/src/Progress.tsx +83 -0
- package/src/RadioGroup.tsx +122 -0
- package/src/Scrim.tsx +94 -0
- package/src/SegmentedControl.tsx +132 -99
- package/src/Select.tsx +136 -0
- package/src/Separator.tsx +52 -0
- package/src/Sheet.tsx +139 -0
- package/src/Skeleton.tsx +77 -0
- package/src/Slider.tsx +84 -47
- package/src/Stepper.tsx +315 -0
- package/src/Switch.tsx +81 -73
- package/src/TabBar.tsx +106 -93
- package/src/Textarea.tsx +34 -0
- package/src/Toast.tsx +131 -0
- package/src/Toggle.tsx +113 -0
- package/src/ToggleGroup.tsx +129 -0
- package/src/Toolbar.tsx +111 -0
- package/src/Tooltip.tsx +79 -0
- package/src/engine/CHANGELOG.md +430 -0
- package/src/engine/NOTICE +54 -0
- package/src/engine/README.md +975 -0
- package/src/engine/android/build.gradle +18 -0
- package/src/engine/android/src/main/AndroidManifest.xml +2 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
- package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
- package/src/engine/index.ts +24 -0
- package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
- package/src/engine/ios/Enums/GlassVariant.swift +86 -0
- package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
- package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
- package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
- package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
- package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
- package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
- package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
- package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
- package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
- package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
- package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
- package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
- package/src/engine/ios/Glass/StripCache.swift +545 -0
- package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
- package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
- package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
- package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
- package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
- package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
- package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
- package/src/engine/package.json +70 -0
- package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
- package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
- package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
- package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
- package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
- package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
- package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
- package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
- package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
- package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
- package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
- package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
- package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
- package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
- package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
- package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
- package/src/engine/src/components/index.ts +16 -0
- package/src/engine/src/constants/index.ts +4 -0
- package/src/engine/src/constants/metal.constants.ts +327 -0
- package/src/engine/src/constants/metrics.constants.ts +325 -0
- package/src/engine/src/constants/springs.constants.ts +107 -0
- package/src/engine/src/constants/styles.constants.ts +12 -0
- package/src/engine/src/context/glass-group.context.ts +65 -0
- package/src/engine/src/context/index.ts +6 -0
- package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
- package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
- package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
- package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
- package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
- package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
- package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
- package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
- package/src/engine/src/core/components/index.ts +4 -0
- package/src/engine/src/core/constants/glass.constants.ts +57 -0
- package/src/engine/src/core/constants/index.ts +20 -0
- package/src/engine/src/core/constants/native.constants.ts +16 -0
- package/src/engine/src/core/context/glass-stack.context.ts +30 -0
- package/src/engine/src/core/context/index.ts +4 -0
- package/src/engine/src/core/enum/index.ts +12 -0
- package/src/engine/src/core/index.ts +1 -0
- package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
- package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
- package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
- package/src/engine/src/core/interfaces/index.ts +31 -0
- package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
- package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
- package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
- package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
- package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
- package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
- package/src/engine/src/core/modules/index.ts +2 -0
- package/src/engine/src/core/root/index.ts +51 -0
- package/src/engine/src/core/types/glass.types.ts +25 -0
- package/src/engine/src/core/types/index.ts +8 -0
- package/src/engine/src/core/utils/debug.utils.ts +17 -0
- package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
- package/src/engine/src/core/utils/hdr.utils.ts +37 -0
- package/src/engine/src/core/utils/index.ts +5 -0
- package/src/engine/src/core/utils/native-view.utils.ts +33 -0
- package/src/engine/src/core/utils/platform.utils.ts +34 -0
- package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
- package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
- package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
- package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
- package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
- package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
- package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
- package/src/engine/src/core/views/index.ts +4 -0
- package/src/engine/src/hooks/index.ts +18 -0
- package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
- package/src/engine/src/hooks/use-damped-drag.ts +332 -0
- package/src/engine/src/hooks/use-echo-filter.ts +55 -0
- package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
- package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
- package/src/engine/src/hooks/use-press-progress.ts +44 -0
- package/src/engine/src/index.ts +120 -0
- package/src/engine/src/interfaces/index.ts +28 -0
- package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
- package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
- package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
- package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
- package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
- package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
- package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
- package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
- package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
- package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
- package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
- package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
- package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
- package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
- package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
- package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
- package/src/engine/src/theme/glass-ui-theme.ts +100 -0
- package/src/engine/src/theme/index.ts +2 -0
- package/src/engine/src/utils/button-press.utils.ts +63 -0
- package/src/engine/src/utils/index.ts +3 -0
- package/src/engine/src/utils/metal.utils.ts +164 -0
- package/src/glass-provider.tsx +60 -0
- package/src/glass-stack.tsx +115 -0
- package/src/index.ts +47 -190
- package/src/internal/GlassBackdrop.tsx +60 -0
- package/src/internal/GlassView.tsx +53 -18
- package/src/internal/blur-community.ts +19 -0
- package/src/internal/blur-community.web.ts +7 -0
- package/src/internal/blur.ts +7 -8
- package/src/internal/glass-routing.ts +212 -34
- package/src/internal/initials.ts +7 -0
- package/src/internal/overlay.tsx +258 -0
- package/src/internal/primitives.ts +23 -0
- package/lib/module/Carousel.js +0 -103
- package/lib/module/Display.js +0 -318
- package/lib/module/Feedback.js +0 -395
- package/lib/module/Form.js +0 -160
- package/lib/module/Forms2.js +0 -471
- package/lib/module/Message.js +0 -84
- package/lib/module/Overlays.js +0 -344
- package/lib/module/Pickers.js +0 -243
- package/lib/module/Table.js +0 -100
- package/lib/module/ai.js +0 -283
- package/lib/module/charts/AreaChart.js +0 -32
- package/lib/module/charts/BarChart.js +0 -75
- package/lib/module/charts/FunnelChart.js +0 -50
- package/lib/module/charts/HeatmapChart.js +0 -71
- package/lib/module/charts/LineChart.js +0 -81
- package/lib/module/charts/PlotChart.js +0 -52
- package/lib/module/charts/RadarChart.js +0 -78
- package/lib/module/charts/RingChart.js +0 -52
- package/lib/module/charts/ScatterChart.js +0 -95
- package/lib/module/charts/WaterfallChart.js +0 -85
- package/lib/module/charts/advanced.js +0 -313
- package/lib/module/charts/extra.js +0 -108
- package/lib/module/charts/index.js +0 -50
- package/lib/module/charts/scales.js +0 -140
- package/lib/typescript/Carousel.d.ts +0 -47
- package/lib/typescript/Display.d.ts +0 -178
- package/lib/typescript/Feedback.d.ts +0 -196
- package/lib/typescript/Form.d.ts +0 -97
- package/lib/typescript/Forms2.d.ts +0 -209
- package/lib/typescript/Message.d.ts +0 -67
- package/lib/typescript/Overlays.d.ts +0 -146
- package/lib/typescript/Pickers.d.ts +0 -105
- package/lib/typescript/Table.d.ts +0 -64
- package/lib/typescript/ai.d.ts +0 -166
- package/lib/typescript/charts/AreaChart.d.ts +0 -44
- package/lib/typescript/charts/BarChart.d.ts +0 -19
- package/lib/typescript/charts/FunnelChart.d.ts +0 -25
- package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
- package/lib/typescript/charts/LineChart.d.ts +0 -30
- package/lib/typescript/charts/PlotChart.d.ts +0 -31
- package/lib/typescript/charts/RadarChart.d.ts +0 -27
- package/lib/typescript/charts/RingChart.d.ts +0 -28
- package/lib/typescript/charts/ScatterChart.d.ts +0 -34
- package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
- package/lib/typescript/charts/advanced.d.ts +0 -107
- package/lib/typescript/charts/extra.d.ts +0 -63
- package/lib/typescript/charts/index.d.ts +0 -13
- package/lib/typescript/charts/scales.d.ts +0 -35
- package/src/Carousel.tsx +0 -233
- package/src/Display.tsx +0 -781
- package/src/Feedback.tsx +0 -992
- package/src/Form.tsx +0 -445
- package/src/Forms2.tsx +0 -1055
- package/src/Message.tsx +0 -218
- package/src/Overlays.tsx +0 -704
- package/src/Pickers.tsx +0 -595
- package/src/Table.tsx +0 -232
- package/src/ai.tsx +0 -715
- package/src/charts/AreaChart.tsx +0 -73
- package/src/charts/BarChart.tsx +0 -221
- package/src/charts/FunnelChart.tsx +0 -125
- package/src/charts/HeatmapChart.tsx +0 -155
- package/src/charts/LineChart.tsx +0 -247
- package/src/charts/PlotChart.tsx +0 -168
- package/src/charts/RadarChart.tsx +0 -208
- package/src/charts/RingChart.tsx +0 -133
- package/src/charts/ScatterChart.tsx +0 -223
- package/src/charts/WaterfallChart.tsx +0 -201
- package/src/charts/advanced.tsx +0 -676
- package/src/charts/extra.tsx +0 -242
- package/src/charts/index.ts +0 -86
- package/src/charts/scales.ts +0 -163
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
COMPONENT_NAMES,
|
|
3
|
+
GLASS_ACTIVE_RENDERERS,
|
|
4
|
+
GLASS_CORNER_STYLES,
|
|
5
|
+
GLASS_RENDERERS,
|
|
6
|
+
GLASS_VARIANTS,
|
|
7
|
+
NATIVE_VIEW_NAMES,
|
|
8
|
+
} from "../constants";
|
|
9
|
+
|
|
10
|
+
type TGlassVariant = (typeof GLASS_VARIANTS)[number];
|
|
11
|
+
type TGlassRenderer = (typeof GLASS_RENDERERS)[number];
|
|
12
|
+
type TGlassActiveRenderer = (typeof GLASS_ACTIVE_RENDERERS)[number];
|
|
13
|
+
type TGlassCornerStyle = (typeof GLASS_CORNER_STYLES)[number];
|
|
14
|
+
type TNativeViewName =
|
|
15
|
+
(typeof NATIVE_VIEW_NAMES)[keyof typeof NATIVE_VIEW_NAMES];
|
|
16
|
+
type TComponentName = (typeof COMPONENT_NAMES)[keyof typeof COMPONENT_NAMES];
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
TGlassVariant,
|
|
20
|
+
TGlassRenderer,
|
|
21
|
+
TGlassActiveRenderer,
|
|
22
|
+
TGlassCornerStyle,
|
|
23
|
+
TNativeViewName,
|
|
24
|
+
TComponentName,
|
|
25
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExpoLiquidGlassModule } from "../modules";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Turns on native diagnostics for the Android glass path.
|
|
5
|
+
*
|
|
6
|
+
* Logs provider-recording and glass-draw rates once a second to logcat under the
|
|
7
|
+
* `ExpoLiquidGlass` tag, plus a warning whenever a glass view resolves no provider. Both counters
|
|
8
|
+
* must stop moving when the screen is at rest — that is the instrument for confirming the backdrop
|
|
9
|
+
* costs nothing at idle.
|
|
10
|
+
*
|
|
11
|
+
* No-ops on iOS and web, where the native module has no such function.
|
|
12
|
+
*/
|
|
13
|
+
function setGlassDebugLogging(enabled: boolean): void {
|
|
14
|
+
ExpoLiquidGlassModule?.setDebugLogging?.(enabled);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { setGlassDebugLogging };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const warned: Set<string> = new Set<string>();
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `console.warn`s [message] at most once per [key] for the life of the JS context, and only in
|
|
5
|
+
* dev — the JS mirror of the native `GlassDebug.warnOnce`.
|
|
6
|
+
*
|
|
7
|
+
* The conditions these describe are per-render, so an ungated warning would repeat on every
|
|
8
|
+
* re-render and bury itself.
|
|
9
|
+
*/
|
|
10
|
+
function devWarnOnce(key: string, message: string): void {
|
|
11
|
+
if (!__DEV__) return;
|
|
12
|
+
if (warned.has(key)) return;
|
|
13
|
+
warned.add(key);
|
|
14
|
+
console.warn(`expo-liquid-glass-ui: ${message}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { devWarnOnce };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ExpoLiquidGlassModule } from "../modules";
|
|
2
|
+
import type { IGlassHdrStatus } from "../interfaces";
|
|
3
|
+
|
|
4
|
+
const SDR_STATUS: IGlassHdrStatus = {
|
|
5
|
+
supported: false,
|
|
6
|
+
enabled: false,
|
|
7
|
+
headroom: 1,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Opts the current Android window in (or out) of HDR rendering for the glass border light.
|
|
12
|
+
*
|
|
13
|
+
* This is a **window-level** switch: `COLOR_MODE_HDR` moves the whole window to FP16 buffers
|
|
14
|
+
* (roughly double the compositing bandwidth), which is why it is an explicit call and never
|
|
15
|
+
* automatic. When active on an HDR panel (API 34+), the glass highlight rim may exceed SDR
|
|
16
|
+
* white by the display's live HDR/SDR ratio; everything else — including the backdrop seen
|
|
17
|
+
* through the glass — stays SDR. The request survives activity recreation: the module
|
|
18
|
+
* re-applies it on every foreground.
|
|
19
|
+
*
|
|
20
|
+
* Resolves with the resulting {@link IGlassHdrStatus}. On iOS/web, or below Android 14, this is
|
|
21
|
+
* a no-op that resolves `{ supported: false, enabled: false, headroom: 1 }`.
|
|
22
|
+
*/
|
|
23
|
+
async function setGlassHdrEnabled(enabled: boolean): Promise<IGlassHdrStatus> {
|
|
24
|
+
const status = await ExpoLiquidGlassModule?.setHdrEnabled?.(enabled);
|
|
25
|
+
return status ?? SDR_STATUS;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The live HDR state: whether this display can do mixed HDR/SDR at all, whether the opt-in is
|
|
30
|
+
* currently on, and the headroom the glass may use right now (1.0 while disabled or SDR — the
|
|
31
|
+
* ratio breathes with screen brightness, so poll it if you display it).
|
|
32
|
+
*/
|
|
33
|
+
function getGlassHdrStatus(): IGlassHdrStatus {
|
|
34
|
+
return ExpoLiquidGlassModule?.getHdrStatus?.() ?? SDR_STATUS;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { setGlassHdrEnabled, getGlassHdrStatus };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { requireNativeViewOnce } from "./native-view.utils";
|
|
2
|
+
export { supportsNativeGlass, supportsGlass } from "./platform.utils";
|
|
3
|
+
export { setGlassDebugLogging } from "./debug.utils";
|
|
4
|
+
export { setGlassHdrEnabled, getGlassHdrStatus } from "./hdr.utils";
|
|
5
|
+
export { devWarnOnce } from "./dev-warn.utils";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { requireNativeView } from "expo";
|
|
2
|
+
import type { ComponentType } from "react";
|
|
3
|
+
|
|
4
|
+
const CACHE_KEY = "__expoLiquidGlassNativeViews__";
|
|
5
|
+
|
|
6
|
+
type TNativeViewCache = Map<string, ComponentType<any>>;
|
|
7
|
+
|
|
8
|
+
const getCache = (): TNativeViewCache => {
|
|
9
|
+
const scope = globalThis as Record<string, unknown>;
|
|
10
|
+
if (!scope[CACHE_KEY]) {
|
|
11
|
+
scope[CACHE_KEY] = new Map<string, ComponentType<any>>();
|
|
12
|
+
}
|
|
13
|
+
return scope[CACHE_KEY] as TNativeViewCache;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const requireNativeViewOnce = <Props>(
|
|
17
|
+
moduleName: string,
|
|
18
|
+
viewName?: string,
|
|
19
|
+
): ComponentType<Props> => {
|
|
20
|
+
const key = `${moduleName}/${viewName ?? "default"}`;
|
|
21
|
+
const registry = getCache();
|
|
22
|
+
|
|
23
|
+
const existing = registry.get(key);
|
|
24
|
+
if (existing) {
|
|
25
|
+
return existing as ComponentType<Props>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const view = requireNativeView<Props>(moduleName, viewName);
|
|
29
|
+
registry.set(key, view as ComponentType<any>);
|
|
30
|
+
return view;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { requireNativeViewOnce };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
|
|
3
|
+
import { ExpoLiquidGlassModule } from "../modules";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Whether this device has Apple's *native* glass material (`UIGlassEffect`, iOS 26+).
|
|
7
|
+
*
|
|
8
|
+
* This is a layout question, not a rendering one: consumers switch tab-bar strategies on it
|
|
9
|
+
* (system NativeTabs vs a floating glass pill). It says nothing about whether `LiquidGlassView`
|
|
10
|
+
* will draw glass — below iOS 26 it will, via the Metal renderer. Use {@link supportsGlass} for
|
|
11
|
+
* that. On Android the two flags are identical (API 29+, where `RenderNode` makes a live
|
|
12
|
+
* backdrop possible); Apple's material never exists there.
|
|
13
|
+
*/
|
|
14
|
+
const supportsNativeGlass: boolean =
|
|
15
|
+
(Platform.OS === "ios" || Platform.OS === "android") &&
|
|
16
|
+
ExpoLiquidGlassModule?.supportsNativeGlass === true;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Whether `LiquidGlassView` renders glass at all — native, Metal, or AGSL.
|
|
20
|
+
*
|
|
21
|
+
* This is the mount gate. On iOS it is true on every supported version: the view picks
|
|
22
|
+
* `UIGlassEffect` on 26+, the Metal renderer below, and a blur if Metal itself is inoperable.
|
|
23
|
+
* Gating the mount on {@link supportsNativeGlass} was the bug that left iOS 18–25 with plain
|
|
24
|
+
* transparent `View`s — an invisible tab bar with floating icons.
|
|
25
|
+
*
|
|
26
|
+
* Natives older than the `supportsGlass` constant fall back to the strict flag, which restores
|
|
27
|
+
* the old behaviour instead of crashing on an unregistered view manager.
|
|
28
|
+
*/
|
|
29
|
+
const supportsGlass: boolean =
|
|
30
|
+
(Platform.OS === "ios" || Platform.OS === "android") &&
|
|
31
|
+
(ExpoLiquidGlassModule?.supportsGlass ??
|
|
32
|
+
ExpoLiquidGlassModule?.supportsNativeGlass) === true;
|
|
33
|
+
|
|
34
|
+
export { supportsNativeGlass, supportsGlass };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { NATIVE_MODULE_NAME } from "../constants";
|
|
5
|
+
import { requireNativeViewOnce } from "../utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The iOS backdrop scope for the Metal tier.
|
|
9
|
+
*
|
|
10
|
+
* Glass inside this view photographs the scroll content in content coordinates instead of
|
|
11
|
+
* photographing the window, so a pane dragged over a list keeps reading the right rows. It is a
|
|
12
|
+
* scope, not a surface: it draws nothing, lays out nothing of its own, and is a no-op on tiers
|
|
13
|
+
* that do not need it. The Android tier's equivalent is `LiquidGlassProviderView`; this exists
|
|
14
|
+
* because the iOS renderer needed the same contract and had no provider.
|
|
15
|
+
*/
|
|
16
|
+
export type IGlassBackdropViewProps = ViewProps;
|
|
17
|
+
|
|
18
|
+
const NativeGlassBackdropView: ComponentType<IGlassBackdropViewProps> =
|
|
19
|
+
requireNativeViewOnce<IGlassBackdropViewProps>(
|
|
20
|
+
NATIVE_MODULE_NAME,
|
|
21
|
+
"GlassBackdropView",
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export { NativeGlassBackdropView };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
import { NATIVE_MODULE_NAME, NATIVE_VIEW_NAMES } from "../constants";
|
|
4
|
+
import type { ILiquidGlassContainerProps } from "../interfaces";
|
|
5
|
+
import { requireNativeViewOnce } from "../utils";
|
|
6
|
+
|
|
7
|
+
const NativeLiquidGlassContainerView: ComponentType<ILiquidGlassContainerProps> =
|
|
8
|
+
requireNativeViewOnce<ILiquidGlassContainerProps>(
|
|
9
|
+
NATIVE_MODULE_NAME,
|
|
10
|
+
NATIVE_VIEW_NAMES.LIQUID_GLASS_CONTAINER_VIEW,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export { NativeLiquidGlassContainerView };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import type { ILiquidGlassContainerProps } from "../interfaces";
|
|
5
|
+
|
|
6
|
+
/** See `NativeLiquidGlassView.web.ts`. */
|
|
7
|
+
const NativeLiquidGlassContainerView =
|
|
8
|
+
View as unknown as ComponentType<ILiquidGlassContainerProps>;
|
|
9
|
+
|
|
10
|
+
export { NativeLiquidGlassContainerView };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
import { NATIVE_MODULE_NAME, NATIVE_VIEW_NAMES } from "../constants";
|
|
4
|
+
import type { ILiquidGlassProviderProps } from "../interfaces";
|
|
5
|
+
import { requireNativeViewOnce } from "../utils";
|
|
6
|
+
|
|
7
|
+
const NativeLiquidGlassProviderView: ComponentType<ILiquidGlassProviderProps> =
|
|
8
|
+
requireNativeViewOnce<ILiquidGlassProviderProps>(
|
|
9
|
+
NATIVE_MODULE_NAME,
|
|
10
|
+
NATIVE_VIEW_NAMES.LIQUID_GLASS_PROVIDER_VIEW,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export { NativeLiquidGlassProviderView };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import type { ILiquidGlassProviderProps } from "../interfaces";
|
|
5
|
+
|
|
6
|
+
/** See `NativeLiquidGlassView.web.ts`. */
|
|
7
|
+
const NativeLiquidGlassProviderView =
|
|
8
|
+
View as unknown as ComponentType<ILiquidGlassProviderProps>;
|
|
9
|
+
|
|
10
|
+
export { NativeLiquidGlassProviderView };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentType, RefAttributes } from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { NATIVE_MODULE_NAME, NATIVE_VIEW_NAMES } from "../constants";
|
|
5
|
+
import type { INativeLiquidGlassViewProps } from "../interfaces";
|
|
6
|
+
import { requireNativeViewOnce } from "../utils";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The ref is declared because `LiquidGlassView` forwards one — Reanimated needs a handle on the
|
|
10
|
+
* host view to write `metal` and `glow` from the UI thread.
|
|
11
|
+
*/
|
|
12
|
+
const NativeLiquidGlassView: ComponentType<
|
|
13
|
+
INativeLiquidGlassViewProps & RefAttributes<View>
|
|
14
|
+
> = requireNativeViewOnce<INativeLiquidGlassViewProps & RefAttributes<View>>(
|
|
15
|
+
NATIVE_MODULE_NAME,
|
|
16
|
+
NATIVE_VIEW_NAMES.LIQUID_GLASS_VIEW,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export { NativeLiquidGlassView };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import type { INativeLiquidGlassViewProps } from "../interfaces";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* There is no native module on web, and `requireNativeView` *throws* when asked for one — at
|
|
8
|
+
* module scope, so merely importing the package used to crash the bundle. This shim is what makes
|
|
9
|
+
* the README's "on web the components render as plain views" actually true.
|
|
10
|
+
*/
|
|
11
|
+
const NativeLiquidGlassView =
|
|
12
|
+
View as unknown as ComponentType<INativeLiquidGlassViewProps>;
|
|
13
|
+
|
|
14
|
+
export { NativeLiquidGlassView };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { NativeLiquidGlassView } from "./NativeLiquidGlassView";
|
|
2
|
+
export { NativeLiquidGlassContainerView } from "./NativeLiquidGlassContainerView";
|
|
3
|
+
export { NativeLiquidGlassProviderView } from "./NativeLiquidGlassProviderView";
|
|
4
|
+
export { NativeGlassBackdropView } from "./NativeGlassBackdropView";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { usePressProgress } from "./use-press-progress";
|
|
2
|
+
export type { IPressProgress } from "./use-press-progress";
|
|
3
|
+
export { useDampedDrag } from "./use-damped-drag";
|
|
4
|
+
export type { IDampedDrag, IDampedDragConfig } from "./use-damped-drag";
|
|
5
|
+
export { useAdaptiveGlass, ADAPTIVE_CROSSFADE_MS } from "./use-adaptive-glass";
|
|
6
|
+
export type {
|
|
7
|
+
IAdaptiveGlass,
|
|
8
|
+
IAdaptiveGlassOptions,
|
|
9
|
+
} from "./use-adaptive-glass";
|
|
10
|
+
export { useGravityHighlight } from "./use-gravity-highlight";
|
|
11
|
+
export type {
|
|
12
|
+
IGravityHighlight,
|
|
13
|
+
IGravityHighlightOptions,
|
|
14
|
+
} from "./use-gravity-highlight";
|
|
15
|
+
export { useGlassGroupMember } from "./use-glass-group-member";
|
|
16
|
+
export type { IGlassGroupMembership } from "./use-glass-group-member";
|
|
17
|
+
export { useEchoFilter } from "./use-echo-filter";
|
|
18
|
+
export type { IEchoFilter } from "./use-echo-filter";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { useColorScheme } from "react-native";
|
|
3
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
4
|
+
import { useSharedValue, withTiming } from "react-native-reanimated";
|
|
5
|
+
import type { GlassLuminanceReading } from "../core";
|
|
6
|
+
|
|
7
|
+
/** The native frost crossfade is 350 ms; the content follows on the same clock. */
|
|
8
|
+
const ADAPTIVE_CROSSFADE_MS = 350;
|
|
9
|
+
|
|
10
|
+
interface IAdaptiveGlassOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Which polarity to assume before the first reading arrives. Defaults to the colour scheme's
|
|
13
|
+
* — dark scheme, dark polarity — which is also what the native side starts from.
|
|
14
|
+
*/
|
|
15
|
+
initialDark?: boolean;
|
|
16
|
+
/** Crossfade of `progress`, ms. Defaults to the native frost's 350. */
|
|
17
|
+
duration?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface IAdaptiveGlass {
|
|
21
|
+
/** Spread onto a `LiquidGlassView`: turns the sensor on and listens to it. */
|
|
22
|
+
glassProps: {
|
|
23
|
+
adaptive: true;
|
|
24
|
+
onBackdropLuminance: (reading: GlassLuminanceReading) => void;
|
|
25
|
+
};
|
|
26
|
+
/** Whether the glass has settled on the dark polarity. React state — a flip is a rare event. */
|
|
27
|
+
dark: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The scheme the content *on* the glass should dress for. The dark polarity is a dark frost,
|
|
30
|
+
* which wants the dark palette's light label; the light polarity the reverse — the kit-wide
|
|
31
|
+
* contrast pairing, driven by the backdrop instead of the OS setting.
|
|
32
|
+
*/
|
|
33
|
+
scheme: "light" | "dark";
|
|
34
|
+
/**
|
|
35
|
+
* `0` at the light polarity, `1` at the dark one, timing between the two on the UI thread in
|
|
36
|
+
* step with the native frost — feed it to `interpolateColor` for a label that crossfades rather
|
|
37
|
+
* than snaps.
|
|
38
|
+
*/
|
|
39
|
+
progress: SharedValue<number>;
|
|
40
|
+
/** The latest raw reading, `0`–`1`, on the UI thread. */
|
|
41
|
+
luminance: SharedValue<number>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Adaptive glass, the kit's half: the native `adaptive` sensor reports the backdrop's luminance
|
|
46
|
+
* and settles on a polarity with hysteresis; this hook turns that into a scheme for the content
|
|
47
|
+
* on the glass and a crossfade to get there. Modeled on the AndroidLiquidGlass catalog's
|
|
48
|
+
* adaptive-luminance demo, which tweens its content colour to black over light backdrops and
|
|
49
|
+
* white over dark ones — the behaviour iOS 26's own glass has by default.
|
|
50
|
+
*
|
|
51
|
+
* ```tsx
|
|
52
|
+
* const adaptive = useAdaptiveGlass();
|
|
53
|
+
* const { colors } = useGlassUITheme(adaptive.scheme);
|
|
54
|
+
* <LiquidGlassView {...adaptive.glassProps} tint={colors.tabBarSurface} />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function useAdaptiveGlass(options: IAdaptiveGlassOptions = {}): IAdaptiveGlass {
|
|
58
|
+
const schemeIsDark = useColorScheme() === "dark";
|
|
59
|
+
const initialDark = options.initialDark ?? schemeIsDark;
|
|
60
|
+
const duration = options.duration ?? ADAPTIVE_CROSSFADE_MS;
|
|
61
|
+
|
|
62
|
+
const [dark, setDark] = useState(initialDark);
|
|
63
|
+
const progress = useSharedValue(initialDark ? 1 : 0);
|
|
64
|
+
const luminance = useSharedValue(0.5);
|
|
65
|
+
|
|
66
|
+
const onBackdropLuminance = useCallback(
|
|
67
|
+
(reading: GlassLuminanceReading): void => {
|
|
68
|
+
luminance.value = reading.luminance;
|
|
69
|
+
setDark((current) => {
|
|
70
|
+
if (current === reading.dark) return current;
|
|
71
|
+
progress.value = withTiming(reading.dark ? 1 : 0, { duration });
|
|
72
|
+
return reading.dark;
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
[duration, luminance, progress],
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return useMemo<IAdaptiveGlass>(
|
|
79
|
+
() => ({
|
|
80
|
+
glassProps: { adaptive: true, onBackdropLuminance },
|
|
81
|
+
dark,
|
|
82
|
+
scheme: dark ? "dark" : "light",
|
|
83
|
+
progress,
|
|
84
|
+
luminance,
|
|
85
|
+
}),
|
|
86
|
+
[dark, luminance, onBackdropLuminance, progress],
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { useAdaptiveGlass, ADAPTIVE_CROSSFADE_MS };
|
|
91
|
+
export type { IAdaptiveGlass, IAdaptiveGlassOptions };
|