glacia-native 0.5.2 → 0.6.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/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 +154 -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 +4 -2
- 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 +211 -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,327 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
|
|
3
|
+
import type { GlassMetalOptions } from "../core";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The reference's glass recipes, one per surface, in the base view's `metal` vocabulary.
|
|
7
|
+
*
|
|
8
|
+
* Translation table between the two APIs:
|
|
9
|
+
*
|
|
10
|
+
* | Kyant `backdrop` | `expo-liquid-glass-ui` |
|
|
11
|
+
* |-----------------------------------|----------------------------------------------|
|
|
12
|
+
* | `vibrancy()` | `saturation: 1.5` (it *is* `saturation=1.5`) |
|
|
13
|
+
* | `blur(Ndp)` | `blurRadius: N` |
|
|
14
|
+
* | `lens(height, amount)` | `refraction: { width: h, height: h, amount }` |
|
|
15
|
+
* | `chromaticAberration = true` | `dispersion: { amount, reach, quadrant: 1 }` |
|
|
16
|
+
* | `Highlight.Default` | `highlight: { intensity, angle, width, falloff }` |
|
|
17
|
+
*
|
|
18
|
+
* Three constraints have no counterpart in the reference and bite if ignored:
|
|
19
|
+
*
|
|
20
|
+
* - **Effect order is fixed** in the shader as colour filter → blur → lens, which happens to be
|
|
21
|
+
* the order the reference declares them in anyway.
|
|
22
|
+
* - **Dispersion is a magnitude here, not a boolean.** Below ~2dp of spread the shader skips it
|
|
23
|
+
* entirely; above the tap budget it bands. `quality: "medium"` spaces its 8 taps one *point*
|
|
24
|
+
* apart (clean to ~8dp) while `"high"` spaces its 16 one *pixel* apart, so a wide fringe wants
|
|
25
|
+
* the expensive tier and a narrow one does not care.
|
|
26
|
+
* - **`quadrant` is what makes it read as the reference's aberration rather than a rim fringe.**
|
|
27
|
+
* Kyant scales the split by `(cx·cy)/(hx·hy)`: nothing along either centre line, everything at
|
|
28
|
+
* the corners, and the sign flipping between neighbours so the hue order reverses with it. On a
|
|
29
|
+
* capsule that puts all the colour at the two rounded ends and leaves the long flanks clean —
|
|
30
|
+
* which is exactly the "edge dispersion" the bar is recognised for. At `quadrant: 0` (the
|
|
31
|
+
* default, and iOS's behaviour) the same amount rings the whole rim evenly and reads as a
|
|
32
|
+
* chromatic *defect* instead.
|
|
33
|
+
*
|
|
34
|
+
* `dispersion.reach` is always set explicitly: left unset it falls back to the *variant's* default
|
|
35
|
+
* refraction height (20), not to the height in the same object.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
const CURVE = { power: 1, bias: 0 } as const;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The bottom bar: `vibrancy() -> blur(8dp) -> lens(24dp, 24dp)`, permanently on.
|
|
42
|
+
*
|
|
43
|
+
* `refractionAmount == refractionHeight` is deliberate — where they are equal the band samples the
|
|
44
|
+
* same source range twice, mirrored, which is the inverted sliver seen at a thick glass rim. This
|
|
45
|
+
* ratio is the single biggest driver of the look.
|
|
46
|
+
*
|
|
47
|
+
* Keeping this material *on* is also what makes a resting pill read as "extra clear": the clarity
|
|
48
|
+
* is relative. Flatten the bar and the pill has nothing to contrast against.
|
|
49
|
+
*/
|
|
50
|
+
const GLASS_BAR_METAL: GlassMetalOptions = {
|
|
51
|
+
refraction: {
|
|
52
|
+
amount: 24,
|
|
53
|
+
width: 24,
|
|
54
|
+
height: 24,
|
|
55
|
+
depth: 0,
|
|
56
|
+
swirl: 0,
|
|
57
|
+
curve: CURVE,
|
|
58
|
+
},
|
|
59
|
+
dispersion: { amount: 0, reach: 24 },
|
|
60
|
+
blurRadius: 8,
|
|
61
|
+
frost: 0,
|
|
62
|
+
saturation: 1.5,
|
|
63
|
+
noise: 0,
|
|
64
|
+
light: 0,
|
|
65
|
+
opacity: 1,
|
|
66
|
+
highlight: { intensity: 0.3, angle: 45, width: 0.5, falloff: 1 },
|
|
67
|
+
border: { width: 1, opacity: 0.28 },
|
|
68
|
+
android: { quality: "medium" },
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** `LiquidButton`: `vibrancy() -> blur(2dp) -> lens(12dp, 24dp)`. Static — nothing here animates. */
|
|
72
|
+
const GLASS_BUTTON_METAL: GlassMetalOptions = {
|
|
73
|
+
refraction: {
|
|
74
|
+
amount: 24,
|
|
75
|
+
width: 12,
|
|
76
|
+
height: 12,
|
|
77
|
+
depth: 0,
|
|
78
|
+
swirl: 0,
|
|
79
|
+
curve: CURVE,
|
|
80
|
+
},
|
|
81
|
+
dispersion: { amount: 0, reach: 12 },
|
|
82
|
+
blurRadius: 2,
|
|
83
|
+
frost: 0,
|
|
84
|
+
saturation: 1.5,
|
|
85
|
+
noise: 0,
|
|
86
|
+
light: 0,
|
|
87
|
+
opacity: 1,
|
|
88
|
+
highlight: { intensity: 0.3, angle: 45, width: 0.5, falloff: 1 },
|
|
89
|
+
border: { width: 1, opacity: 0.28 },
|
|
90
|
+
android: { quality: "medium" },
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The bar in **clear** dress: the scrim mostly gone, the glass doing the work.
|
|
95
|
+
*
|
|
96
|
+
* The regular bar reads through a 42% container fill, which is what guarantees a label stays
|
|
97
|
+
* legible over anything. Take that away and legibility has to come from the material itself, so
|
|
98
|
+
* this leans the other way from `GLASS_BAR_METAL` on every axis the base library's own
|
|
99
|
+
* `CLEAR_DEFAULTS` does: a whisper of frost instead of none, saturation pulled back toward life,
|
|
100
|
+
* dispersion raised so the rim actually reads, and a brighter border and highlight because with no
|
|
101
|
+
* fill behind it the edge is the only thing left saying "this is a surface".
|
|
102
|
+
*
|
|
103
|
+
* The blur stays low on purpose. Blurring hard is how you fake a scrim; a clear bar that blurs its
|
|
104
|
+
* backdrop into mush is just a scrim with extra steps.
|
|
105
|
+
*/
|
|
106
|
+
const GLASS_BAR_CLEAR_METAL: GlassMetalOptions = {
|
|
107
|
+
// The lens is unchanged from the regular bar, including the 1:1 amount-to-depth ratio that
|
|
108
|
+
// drives its look. Borrowing `CLEAR_DEFAULTS`' 30-over-10 was a mistake: that ratio is tuned for
|
|
109
|
+
// a small control, and on a 64dp bar a 30dp pull over a 10dp band drags the dark gap above the
|
|
110
|
+
// bar into a hard stripe across its top edge. Clear means less scrim, not a different lens.
|
|
111
|
+
refraction: {
|
|
112
|
+
amount: 24,
|
|
113
|
+
width: 24,
|
|
114
|
+
height: 24,
|
|
115
|
+
depth: 0,
|
|
116
|
+
swirl: 0,
|
|
117
|
+
curve: CURVE,
|
|
118
|
+
},
|
|
119
|
+
dispersion: { amount: 10, reach: 24, quadrant: 0 },
|
|
120
|
+
blurRadius: 3,
|
|
121
|
+
frost: 0.06,
|
|
122
|
+
saturation: 1.15,
|
|
123
|
+
noise: 0,
|
|
124
|
+
light: 0,
|
|
125
|
+
opacity: 1,
|
|
126
|
+
highlight: { intensity: 0.35, angle: 45, width: 0.75, falloff: 1 },
|
|
127
|
+
border: { width: 1, opacity: 0.4 },
|
|
128
|
+
android: { quality: "medium" },
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The tab pill at rest: every effect off. The reference's `lens()` early-returns when both
|
|
133
|
+
* arguments are zero, so no render effect is attached at all and the pill becomes a literal
|
|
134
|
+
* clipped window onto its backdrop.
|
|
135
|
+
*
|
|
136
|
+
* This is the `from` end of a blend, not a state to be swapped to — see {@link lerpMetal} and the
|
|
137
|
+
* tab bar's `pillProps`. Every field it names is a field the grab animates, and it names them at
|
|
138
|
+
* their resting value rather than omitting them, so the blend has both ends of every channel.
|
|
139
|
+
*/
|
|
140
|
+
const GLASS_PILL_METAL: GlassMetalOptions = {
|
|
141
|
+
refraction: {
|
|
142
|
+
amount: 0,
|
|
143
|
+
width: 0,
|
|
144
|
+
height: 0,
|
|
145
|
+
depth: 0,
|
|
146
|
+
swirl: 0,
|
|
147
|
+
curve: CURVE,
|
|
148
|
+
},
|
|
149
|
+
dispersion: { amount: 0, reach: 10, quadrant: 0 },
|
|
150
|
+
// No refraction of its own at rest, ever — the resting pill is a window onto the bar as it
|
|
151
|
+
// already renders. On Android the accent clone it reads through *is* the bar's recipe (lens,
|
|
152
|
+
// blur, vibrancy), so the pill adds nothing; on iOS the window capture excludes every glass
|
|
153
|
+
// view, so the pill would otherwise be a sharp, unwashed hole in a blurred bar. There it
|
|
154
|
+
// carries the bar's blur and vibrancy itself (its lens cannot follow: it would bend at the
|
|
155
|
+
// pill's rim, not the bar's) and melts them away as the grab lands.
|
|
156
|
+
blurRadius: Platform.OS === "ios" ? 8 : 0,
|
|
157
|
+
frost: 0,
|
|
158
|
+
saturation: Platform.OS === "ios" ? 1.5 : 1,
|
|
159
|
+
noise: 0,
|
|
160
|
+
light: 0,
|
|
161
|
+
opacity: 1,
|
|
162
|
+
highlight: { intensity: 0, angle: 45, width: 0.5, falloff: 1 },
|
|
163
|
+
border: { width: 1, opacity: 0 },
|
|
164
|
+
innerShadow: { radius: 0, opacity: 0 },
|
|
165
|
+
android: { quality: "high" },
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The tab pill fully grabbed: a lens across its whole face, with the colour split riding it.
|
|
170
|
+
* No blur and no saturation boost — those belong to the bar, and withholding them here keeps the
|
|
171
|
+
* pill sharper than its surroundings even while it refracts.
|
|
172
|
+
*
|
|
173
|
+
* The reference's `lens(10dp, 14dp, chromaticAberration = true)` is a rim band: 14dp of bend
|
|
174
|
+
* over the outer 10dp, the fringe quadrant-weighted onto the capsule's ends. iOS 26's grabbed
|
|
175
|
+
* pill is not that — held beside it on an iPhone 14 Pro Max (2026-09-07), the glyph at the
|
|
176
|
+
* pill's *centre* is displaced and colour-split, and the fringe runs evenly all the way round.
|
|
177
|
+
* So the band here reaches 40dp in from every edge, past the held pill's 39dp half-height, and
|
|
178
|
+
* the split runs 12dp over a 24dp reach with `quadrant` 0 (Kyant's weighting dies along both
|
|
179
|
+
* centre lines, which is exactly where iOS shows it most). The reach is deliberately short of
|
|
180
|
+
* the glyph's top and bottom — they sit ~27dp in from the pill's rim, and a 42dp reach put a
|
|
181
|
+
* faint fringe on them at every hold, which the user called out at once — while a glyph
|
|
182
|
+
* carried toward the pill's *side* by the drag, as in the iPhone frame, is well inside 24dp of
|
|
183
|
+
* that rim and splits as it should.
|
|
184
|
+
* The split walks the lens's own displacement, so the two must widen together — the shader
|
|
185
|
+
* disperses nothing outside the band. Two things keep a band that wide from wrecking the face:
|
|
186
|
+
* a cubic profile (`curve.power: 3`), so the bend is the reference's at the rim and gone by
|
|
187
|
+
* the centre — with the linear profile the nearest-edge direction flipping across the centre
|
|
188
|
+
* line tore the glyph in two and swirled the ends — and `depth: 1`, the radial direction, so
|
|
189
|
+
* what bend remains reads as one lens ball. `pillDraggedMetal` is the dial if an app wants the
|
|
190
|
+
* reference's quieter rim instead.
|
|
191
|
+
*
|
|
192
|
+
* `quality: "high"` earns its cost here and nowhere else: 16 taps one pixel apart keep a 12dp
|
|
193
|
+
* spread continuous, where `"medium"`'s 8 would step it. The pill is small, and it is the only
|
|
194
|
+
* surface in the kit whose fringe is ever this wide.
|
|
195
|
+
*/
|
|
196
|
+
const GLASS_PILL_DRAGGED_METAL: GlassMetalOptions = {
|
|
197
|
+
refraction: {
|
|
198
|
+
amount: 14,
|
|
199
|
+
width: 40,
|
|
200
|
+
height: 40,
|
|
201
|
+
depth: 1,
|
|
202
|
+
swirl: 0,
|
|
203
|
+
curve: { power: 3, bias: 0 },
|
|
204
|
+
},
|
|
205
|
+
dispersion: { amount: 12, reach: 24, quadrant: 0 },
|
|
206
|
+
blurRadius: 0,
|
|
207
|
+
frost: 0,
|
|
208
|
+
saturation: 1,
|
|
209
|
+
noise: 0,
|
|
210
|
+
light: 0,
|
|
211
|
+
opacity: 1,
|
|
212
|
+
highlight: { intensity: 0.5, angle: 45, width: 0.5, falloff: 1 },
|
|
213
|
+
border: { width: 1, opacity: 0.28 },
|
|
214
|
+
// None. The reference lifts its pill with `InnerShadow(radius = 8dp * progress, alpha =
|
|
215
|
+
// progress)`; iOS 26's dragged pill carries no inset shadow at all (iPhone 14 Pro Max,
|
|
216
|
+
// 2026-09-07). Named at zero rather than omitted so the blend has both ends of the channel.
|
|
217
|
+
innerShadow: { radius: 0, opacity: 0 },
|
|
218
|
+
android: { quality: "high" },
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
/** The toggle thumb at rest: an 8dp frost under an opaque white fill — `blur(8dp * (1 - p))`. */
|
|
222
|
+
const GLASS_THUMB_METAL: GlassMetalOptions = {
|
|
223
|
+
refraction: {
|
|
224
|
+
amount: 0,
|
|
225
|
+
width: 5,
|
|
226
|
+
height: 5,
|
|
227
|
+
depth: 0,
|
|
228
|
+
swirl: 0,
|
|
229
|
+
curve: CURVE,
|
|
230
|
+
},
|
|
231
|
+
dispersion: { amount: 0, reach: 5 },
|
|
232
|
+
blurRadius: 8,
|
|
233
|
+
frost: 0,
|
|
234
|
+
saturation: 1,
|
|
235
|
+
noise: 0,
|
|
236
|
+
light: 0,
|
|
237
|
+
opacity: 1,
|
|
238
|
+
highlight: { intensity: 0, angle: 45, width: 0.33, falloff: 1 },
|
|
239
|
+
border: { width: 1, opacity: 0 },
|
|
240
|
+
innerShadow: { radius: 0, opacity: 0 },
|
|
241
|
+
android: { quality: "medium" },
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The toggle thumb held: `lens(5dp, 10dp, chromaticAberration = true)` with **zero** blur.
|
|
246
|
+
*
|
|
247
|
+
* That inversion — the moving element being the *least*-processed surface — is a deliberate,
|
|
248
|
+
* repeated rule in the reference. The pill does it, the slider thumb does it, this does it.
|
|
249
|
+
*/
|
|
250
|
+
const GLASS_THUMB_PRESSED_METAL: GlassMetalOptions = {
|
|
251
|
+
refraction: {
|
|
252
|
+
amount: 10,
|
|
253
|
+
width: 5,
|
|
254
|
+
height: 5,
|
|
255
|
+
depth: 0,
|
|
256
|
+
swirl: 0,
|
|
257
|
+
curve: CURVE,
|
|
258
|
+
},
|
|
259
|
+
dispersion: { amount: 4, reach: 5 },
|
|
260
|
+
blurRadius: 0,
|
|
261
|
+
frost: 0,
|
|
262
|
+
saturation: 1,
|
|
263
|
+
noise: 0,
|
|
264
|
+
light: 0,
|
|
265
|
+
opacity: 1,
|
|
266
|
+
// `Highlight.Ambient` scaled to 1/1.5 for the small thumb.
|
|
267
|
+
highlight: { intensity: 0.38, angle: 45, width: 0.33, falloff: 1 },
|
|
268
|
+
border: { width: 1, opacity: 0.28 },
|
|
269
|
+
// `InnerShadow(radius = 4dp * progress, alpha = progress)` — the thumbs' thinner lip.
|
|
270
|
+
innerShadow: { radius: 4, opacity: 0.15 },
|
|
271
|
+
android: { quality: "medium" },
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/** The slider thumb at rest — identical frost, deeper lens waiting behind it. */
|
|
275
|
+
const GLASS_SLIDER_THUMB_METAL: GlassMetalOptions = {
|
|
276
|
+
...GLASS_THUMB_METAL,
|
|
277
|
+
refraction: {
|
|
278
|
+
amount: 0,
|
|
279
|
+
width: 10,
|
|
280
|
+
height: 10,
|
|
281
|
+
depth: 0,
|
|
282
|
+
swirl: 0,
|
|
283
|
+
curve: CURVE,
|
|
284
|
+
},
|
|
285
|
+
dispersion: { amount: 0, reach: 10 },
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* The slider thumb held: `lens(10dp, 14dp)` — it bends harder than the toggle's 5/10 because it
|
|
290
|
+
* has a whole track's worth of colour to pull through.
|
|
291
|
+
*/
|
|
292
|
+
const GLASS_SLIDER_THUMB_PRESSED_METAL: GlassMetalOptions = {
|
|
293
|
+
...GLASS_THUMB_PRESSED_METAL,
|
|
294
|
+
refraction: {
|
|
295
|
+
amount: 14,
|
|
296
|
+
width: 10,
|
|
297
|
+
height: 10,
|
|
298
|
+
depth: 0,
|
|
299
|
+
swirl: 0,
|
|
300
|
+
curve: CURVE,
|
|
301
|
+
},
|
|
302
|
+
dispersion: { amount: 5, reach: 10 },
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* A panel — `LiquidGlassCard`, `LiquidGlassSheet`: the bar's material, permanently on. A big
|
|
307
|
+
* pane wants the bar's 24dp band rather than the button's 12dp — the rim reads at the scale of
|
|
308
|
+
* the surface, and iOS 26's sheets carry a thick lip for the same reason.
|
|
309
|
+
*/
|
|
310
|
+
const GLASS_PANEL_METAL: GlassMetalOptions = GLASS_BAR_METAL;
|
|
311
|
+
|
|
312
|
+
/** A toast is a button-sized capsule and wears the button's glass. */
|
|
313
|
+
const GLASS_TOAST_METAL: GlassMetalOptions = GLASS_BUTTON_METAL;
|
|
314
|
+
|
|
315
|
+
export {
|
|
316
|
+
GLASS_BAR_CLEAR_METAL,
|
|
317
|
+
GLASS_PANEL_METAL,
|
|
318
|
+
GLASS_TOAST_METAL,
|
|
319
|
+
GLASS_BAR_METAL,
|
|
320
|
+
GLASS_BUTTON_METAL,
|
|
321
|
+
GLASS_PILL_METAL,
|
|
322
|
+
GLASS_PILL_DRAGGED_METAL,
|
|
323
|
+
GLASS_THUMB_METAL,
|
|
324
|
+
GLASS_THUMB_PRESSED_METAL,
|
|
325
|
+
GLASS_SLIDER_THUMB_METAL,
|
|
326
|
+
GLASS_SLIDER_THUMB_PRESSED_METAL,
|
|
327
|
+
};
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry lifted from the AndroidLiquidGlass catalog components (all in dp/pt).
|
|
3
|
+
*
|
|
4
|
+
* These are the reference's own numbers, not approximations of them. Where this kit used to
|
|
5
|
+
* deviate the deviation is called out, because each one was tuned against a bug that has since
|
|
6
|
+
* been fixed.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** `LiquidToggle`: 64x28 track, 40x24 thumb, 2 of inset — exactly 20 of thumb travel. */
|
|
10
|
+
const SWITCH_TRACK_WIDTH = 64;
|
|
11
|
+
const SWITCH_TRACK_HEIGHT = 28;
|
|
12
|
+
const SWITCH_THUMB_WIDTH = 40;
|
|
13
|
+
const SWITCH_THUMB_HEIGHT = 24;
|
|
14
|
+
const SWITCH_THUMB_INSET = 2;
|
|
15
|
+
const SWITCH_THUMB_TRAVEL =
|
|
16
|
+
SWITCH_TRACK_WIDTH - SWITCH_THUMB_WIDTH - SWITCH_THUMB_INSET * 2;
|
|
17
|
+
/** The reference's `pressedScale` — the bare thumb balloons to a lens ball while held. */
|
|
18
|
+
const SWITCH_THUMB_PRESSED_SCALE = 1.5;
|
|
19
|
+
/**
|
|
20
|
+
* How far the track is shrunk in the copy the thumb reads, `[at rest, fully grabbed]` —
|
|
21
|
+
* `LiquidToggle`'s `lerp(2/3, 0.75)` on X and `lerp(0, 0.75)` on Y.
|
|
22
|
+
*
|
|
23
|
+
* The zero is the interesting end: a resting thumb reads a track squashed to no height at all, so
|
|
24
|
+
* it sees only the screen and reads as a plain frosted lozenge. Grab it and the green body swells
|
|
25
|
+
* out of nothing underneath the glass.
|
|
26
|
+
*/
|
|
27
|
+
const SWITCH_TRACK_COPY_SCALE_X: readonly [number, number] = [2 / 3, 0.75];
|
|
28
|
+
const SWITCH_TRACK_COPY_SCALE_Y: readonly [number, number] = [0, 0.75];
|
|
29
|
+
/**
|
|
30
|
+
* Short-throw controls divide velocity by 50 before it reaches the jelly; full-width ones use 10.
|
|
31
|
+
* The toggle is the short-throw case, so its squash is 5x gentler than the slider's.
|
|
32
|
+
*/
|
|
33
|
+
const SWITCH_VELOCITY_DIVISOR = 50;
|
|
34
|
+
|
|
35
|
+
/** `LiquidSlider`: a 6dp track under the same 40x24 thumb. */
|
|
36
|
+
const SLIDER_TRACK_HEIGHT = 6;
|
|
37
|
+
const SLIDER_THUMB_WIDTH = 40;
|
|
38
|
+
const SLIDER_THUMB_HEIGHT = 24;
|
|
39
|
+
const SLIDER_THUMB_PRESSED_SCALE = 1.5;
|
|
40
|
+
const SLIDER_VELOCITY_DIVISOR = 10;
|
|
41
|
+
/**
|
|
42
|
+
* How far the thumb can be carried past either end of the track, dp, through a saturating tanh
|
|
43
|
+
* — the rubber band iOS 26's slider shows when you keep pulling at the stop. The reference's
|
|
44
|
+
* slider dead-stops; this is the one place the kit borrows a behaviour from the system slider
|
|
45
|
+
* rather than the catalog.
|
|
46
|
+
*/
|
|
47
|
+
const SLIDER_OVERSHOOT_MAX = 10;
|
|
48
|
+
/** The thumbs' resting drop shadow: `Shadow(radius = 4dp, Black a0.05)`. */
|
|
49
|
+
const THUMB_SHADOW = "0 1px 4px rgba(0,0,0,0.05)";
|
|
50
|
+
|
|
51
|
+
/** `LiquidButton`: 48dp tall, 16dp of horizontal padding, 8dp between icon and label. */
|
|
52
|
+
const BUTTON_HEIGHT = 48;
|
|
53
|
+
const BUTTON_PADDING_HORIZONTAL = 16;
|
|
54
|
+
const BUTTON_CONTENT_GAP = 8;
|
|
55
|
+
/** Pressed button inflates by 4dp of its height, the reference's `lerp(1, 1 + 4dp/h)`. */
|
|
56
|
+
const BUTTON_PRESS_GROWTH = 4;
|
|
57
|
+
/** `InteractiveHighlight`'s initial derivative: the button follows 5% of the finger's travel. */
|
|
58
|
+
const BUTTON_FOLLOW_DERIVATIVE = 0.05;
|
|
59
|
+
/**
|
|
60
|
+
* How much of the shader's press light a button shows at full press, 0..1. The shader's light
|
|
61
|
+
* is Kyant's bar-sized `InteractiveHighlight` — a flat 0.08 wash plus a 0.15 lobe reaching
|
|
62
|
+
* 1.5x the view's short side — and on a 48dp capsule that lobe covers the whole pane, so at 1
|
|
63
|
+
* the press reads as a flat lightening, the Material pressed-state look. A third of it keeps
|
|
64
|
+
* the finger's glint and lets the dent (`lens`) and the inflation carry the press instead.
|
|
65
|
+
*/
|
|
66
|
+
const BUTTON_PRESS_LIGHT = 0.35;
|
|
67
|
+
/**
|
|
68
|
+
* The button's three sizes — height, side padding and label size. `regular` is the reference's
|
|
69
|
+
* `LiquidButton`; `small` is the chip / compact-toolbar size and `large` the sheet-footer size.
|
|
70
|
+
* `height` on the button still overrides.
|
|
71
|
+
*/
|
|
72
|
+
const BUTTON_SIZES = {
|
|
73
|
+
small: { height: 36, paddingHorizontal: 14, fontSize: 15, iconSize: 18 },
|
|
74
|
+
regular: {
|
|
75
|
+
height: BUTTON_HEIGHT,
|
|
76
|
+
paddingHorizontal: BUTTON_PADDING_HORIZONTAL,
|
|
77
|
+
fontSize: 17,
|
|
78
|
+
iconSize: 22,
|
|
79
|
+
},
|
|
80
|
+
large: { height: 56, paddingHorizontal: 22, fontSize: 17, iconSize: 24 },
|
|
81
|
+
} as const;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* `LiquidGlassGroup`: `spacing` is the smooth-min reach — `UIGlassContainerEffect.spacing`'s
|
|
85
|
+
* meaning, the distance at which two members begin to fuse; the gap is the row's resting gap;
|
|
86
|
+
* the overhang is how far past the row the canvas extends, which bounds how far a pressed member
|
|
87
|
+
* can be carried by its rubber band while still rendering.
|
|
88
|
+
*/
|
|
89
|
+
const GROUP_SPACING = 28;
|
|
90
|
+
const GROUP_GAP = 12;
|
|
91
|
+
const GROUP_OVERHANG = 72;
|
|
92
|
+
|
|
93
|
+
/** `LiquidGlassCard`: a 24dp continuous corner and 16dp of padding by default. */
|
|
94
|
+
const CARD_CORNER_RADIUS = 24;
|
|
95
|
+
const CARD_PADDING = 16;
|
|
96
|
+
/** A tappable card presses to 98% — a whisper, since a card is furniture rather than a control. */
|
|
97
|
+
const CARD_PRESSED_SCALE = 0.98;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* `LiquidGlassStepper`: the segmented control's 40dp track, its 3dp-inset thumb, and the
|
|
101
|
+
* auto-repeat a held end runs at — iOS's stepper repeats while held.
|
|
102
|
+
*/
|
|
103
|
+
const STEPPER_HEIGHT = 40;
|
|
104
|
+
const STEPPER_CELL_WIDTH = 44;
|
|
105
|
+
const STEPPER_VALUE_MIN_WIDTH = 44;
|
|
106
|
+
const STEPPER_REPEAT_DELAY_MS = 400;
|
|
107
|
+
const STEPPER_REPEAT_INTERVAL_MS = 110;
|
|
108
|
+
/** The value pops to 1.18 on each change and springs back. */
|
|
109
|
+
const STEPPER_VALUE_POP_SCALE = 1.18;
|
|
110
|
+
|
|
111
|
+
/** `LiquidGlassToast`: a 44dp capsule, 24dp of side padding, 60dp in from the screen edge. */
|
|
112
|
+
const TOAST_HEIGHT = 44;
|
|
113
|
+
const TOAST_PADDING_HORIZONTAL = 20;
|
|
114
|
+
const TOAST_EDGE_OFFSET = 60;
|
|
115
|
+
const TOAST_DURATION_MS = 2600;
|
|
116
|
+
/** How far off-screen the toast starts, past its own height. */
|
|
117
|
+
const TOAST_TRAVEL = 24;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* `LiquidGlassSheet`: 28dp top corners, a 36x5 grab handle, and the release rule — dismissed
|
|
121
|
+
* past 30% of its height, or flung down faster than 900dp/s. Upward drag past the top is met
|
|
122
|
+
* with 4:1 resistance.
|
|
123
|
+
*/
|
|
124
|
+
const SHEET_CORNER_RADIUS = 28;
|
|
125
|
+
const SHEET_HANDLE_WIDTH = 36;
|
|
126
|
+
const SHEET_HANDLE_HEIGHT = 5;
|
|
127
|
+
const SHEET_HANDLE_AREA_HEIGHT = 24;
|
|
128
|
+
const SHEET_DISMISS_FRACTION = 0.3;
|
|
129
|
+
const SHEET_DISMISS_VELOCITY = 900;
|
|
130
|
+
const SHEET_OVERDRAG_RESISTANCE = 4;
|
|
131
|
+
const SHEET_DIM_OPACITY = 0.25;
|
|
132
|
+
|
|
133
|
+
/** `LiquidGlassToolbar`: a 48dp row; the title capsule is a regular button's height. */
|
|
134
|
+
const TOOLBAR_HEIGHT = 48;
|
|
135
|
+
|
|
136
|
+
/** `LiquidGlassChip`: the small button, with a 6dp icon gap. */
|
|
137
|
+
const CHIP_CONTENT_GAP = 6;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* `LiquidGlassMorphGroup`: the merge distance is `UIGlassContainerEffect.spacing`'s meaning fed
|
|
141
|
+
* to the smooth-min; the bloom is the grabbed capsule's inflation (the tab pill's 22dp read too
|
|
142
|
+
* heavy on a free-floating capsule); the overhang is how far past the row the canvas extends,
|
|
143
|
+
* bounding how far a capsule can be carried while still rendering.
|
|
144
|
+
*/
|
|
145
|
+
const MORPH_GROUP_SPACING = 28;
|
|
146
|
+
const MORPH_GROUP_GAP = 12;
|
|
147
|
+
const MORPH_GROUP_BLOOM = 10;
|
|
148
|
+
const MORPH_GROUP_OVERHANG = 72;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* `LiquidGlassSegmentedControl`: a 40dp track with a 3dp-inset thumb. The stretch is how much of
|
|
152
|
+
* the travel distance the mid-flight thumb elongates by; the smoothing is the neck to the
|
|
153
|
+
* droplet it leaves behind.
|
|
154
|
+
*/
|
|
155
|
+
const SEGMENTED_HEIGHT = 40;
|
|
156
|
+
const SEGMENTED_INSET = 3;
|
|
157
|
+
const SEGMENTED_SMOOTHING = 18;
|
|
158
|
+
const SEGMENTED_STRETCH = 0.22;
|
|
159
|
+
|
|
160
|
+
/** `LiquidBottomTabs`: a 64dp bar with 4dp of padding on every side. */
|
|
161
|
+
const TAB_BAR_HEIGHT = 64;
|
|
162
|
+
const TAB_BAR_PADDING = 4;
|
|
163
|
+
/**
|
|
164
|
+
* The pill is 56dp tall and exactly one tab cell wide — **zero inset**. This kit previously ran
|
|
165
|
+
* it at 60dp and 4dp wider than a cell, which is why it never sat right against the row.
|
|
166
|
+
*/
|
|
167
|
+
const TAB_PILL_HEIGHT = 56;
|
|
168
|
+
/** The reference's `78f / 56f`: the pill inflates to 78dp tall while grabbed. */
|
|
169
|
+
const TAB_PILL_PRESSED_SCALE = 78 / 56;
|
|
170
|
+
/**
|
|
171
|
+
* How much *wider* the grabbed pill gets, in dp — the same 22dp its height gains (56 → 78), rather
|
|
172
|
+
* than the same 1.393x ratio.
|
|
173
|
+
*
|
|
174
|
+
* The reference applies `pressedScale` to both axes, which is fine on its own bar and wrong on a
|
|
175
|
+
* wide one: the number is a *height* ratio, so a 4-tab pill 86dp across grows to 120dp and hangs
|
|
176
|
+
* ~17dp past its cell on each side with the finger held still. Blooming by a fixed amount keeps the
|
|
177
|
+
* swell obvious on a narrow pill and proportionate on a wide one, which is what the ratio was
|
|
178
|
+
* standing in for.
|
|
179
|
+
*/
|
|
180
|
+
const TAB_PILL_BLOOM_WIDTH = 78 - 56;
|
|
181
|
+
/**
|
|
182
|
+
* The grab scales the **whole bar** — glass, both rows, the pill riding in it — so its total
|
|
183
|
+
* width grows by exactly this, `lerp(1, 1 + 16dp/width)` on both axes. Icons included: iOS 26
|
|
184
|
+
* grows the entire bar under the finger and shrinks nothing, the active and inactive glyphs
|
|
185
|
+
* staying the same size as each other throughout (checked against an iPhone 14 Pro Max,
|
|
186
|
+
* 2026-09-07). The kit once scaled only the bar's glass and minified the active copy to the
|
|
187
|
+
* strip's 56/64 under the lifted pill; that read as the icon shrinking while the bar stood
|
|
188
|
+
* still, and is gone.
|
|
189
|
+
*/
|
|
190
|
+
const TAB_BAR_PRESS_GROWTH = 16;
|
|
191
|
+
/**
|
|
192
|
+
* The accent clone's capsule height under the grab: the reference's `tabsBackdrop`, a **56dp**
|
|
193
|
+
* capsule inside the 64dp bar (`.height(56.dp).fillMaxWidth()`). iOS 26 shows the bar *smaller*
|
|
194
|
+
* through the held pill while the icons keep their size (iPhone 14 Pro Max, 2026-09-07) — the
|
|
195
|
+
* pill's lens bends this inset rim into view — and this 8dp is the whole of that effect. It is
|
|
196
|
+
* the held height only: at rest the clone is the bar's full size, or a resting pill shows the
|
|
197
|
+
* backdrop unbent inside a bar that bends it.
|
|
198
|
+
*/
|
|
199
|
+
const TAB_ACCENT_STRIP_HEIGHT = 56;
|
|
200
|
+
/** The pill is a full-width control as far as the jelly is concerned. */
|
|
201
|
+
const TAB_VELOCITY_DIVISOR = 10;
|
|
202
|
+
/**
|
|
203
|
+
* How much the bar lights up under the grabbed pill — `LiquidGlassTabBar.pressLight`. The
|
|
204
|
+
* reference's `InteractiveHighlight` runs at 1: a flat additive wash across the bar and a lobe
|
|
205
|
+
* under the pill. At that strength the wash cost the bar its dynamic range — pushed toward
|
|
206
|
+
* white, it left the resting chip and the lifted pill nothing lighter to be. iOS 26 lightens
|
|
207
|
+
* the bar under the grab only faintly, "by 10 % maybe" (iPhone 14 Pro Max, 2026-09-07), so a
|
|
208
|
+
* tenth of the reference's is the default.
|
|
209
|
+
*/
|
|
210
|
+
const TAB_PRESS_LIGHT = 0.1;
|
|
211
|
+
/**
|
|
212
|
+
* How far the tab pill's jelly is allowed to go. The reference maps velocity to stretch at
|
|
213
|
+
* 0.75 on X (0.25 squash on Y) and clamps at ±0.2 — at most 1.25x wide on the fastest flick.
|
|
214
|
+
* iOS 26's pill is wilder than that by a long way: a fast flick pulls it into a hotdog
|
|
215
|
+
* (iPhone 14 Pro Max, 2026-09-07). Gain 2 doubles the mapping and limit 0.45 lets the stretch
|
|
216
|
+
* reach ~1.8x wide (`1 / (1 - 0.45)`), which a full-bar flick just about touches; the squash
|
|
217
|
+
* shares the limit but never gets near it (Y maps at a third of X). The slider and the switch
|
|
218
|
+
* keep the reference's own numbers — their thumbs are not supposed to do this.
|
|
219
|
+
*/
|
|
220
|
+
const TAB_JELLY_GAIN = 2;
|
|
221
|
+
const TAB_JELLY_LIMIT = 0.45;
|
|
222
|
+
/**
|
|
223
|
+
* The grabbed pill's drop shadow — the reference's default `Shadow(alpha = progress)`: a 24dp
|
|
224
|
+
* blur, offset a sixth of that, black at 10 %. It fades in with the grab, under the glass.
|
|
225
|
+
*/
|
|
226
|
+
const TAB_PILL_SHADOW = "0 4px 24px rgba(0,0,0,0.10)";
|
|
227
|
+
/**
|
|
228
|
+
* How far the *held* pill wash — a `pillDraggedMetal.tint` — overhangs the pill's rect in the
|
|
229
|
+
* accent layer, dp. The grabbed pill's lens pulls the backdrop inward from outside its rim
|
|
230
|
+
* (`GLASS_PILL_DRAGGED_METAL`: 14dp of displacement over a 10dp band), so a wash cut exactly to
|
|
231
|
+
* the pill would show a clear ring where the lens reaches past it; painted this much larger it
|
|
232
|
+
* fills the pill edge to edge, like a tinted button. The overhang is invisible on screen — the
|
|
233
|
+
* accent layer composites at 2% — and only ever reaches the eye through the pill.
|
|
234
|
+
*/
|
|
235
|
+
const TAB_PILL_WASH_BLEED = 16;
|
|
236
|
+
/** Whole-panel rubber band: `4dp * sign(f) * EaseOut(|f|)`, `f` = accumulated drag / bar width. */
|
|
237
|
+
const TAB_PANEL_MAX_OFFSET = 4;
|
|
238
|
+
/** Icon glyphs render 24dp inside a 28dp slot; label is 12sp with a 2dp gap above it. */
|
|
239
|
+
const TAB_ICON_SIZE = 24;
|
|
240
|
+
const TAB_ICON_SLOT = 28;
|
|
241
|
+
const TAB_LABEL_SIZE = 12;
|
|
242
|
+
const TAB_CONTENT_GAP = 2;
|
|
243
|
+
|
|
244
|
+
const TEXT_INPUT_HEIGHT = 48;
|
|
245
|
+
|
|
246
|
+
export {
|
|
247
|
+
SWITCH_TRACK_WIDTH,
|
|
248
|
+
SWITCH_TRACK_HEIGHT,
|
|
249
|
+
SWITCH_THUMB_WIDTH,
|
|
250
|
+
SWITCH_THUMB_HEIGHT,
|
|
251
|
+
SWITCH_THUMB_INSET,
|
|
252
|
+
SWITCH_THUMB_TRAVEL,
|
|
253
|
+
SWITCH_THUMB_PRESSED_SCALE,
|
|
254
|
+
SWITCH_TRACK_COPY_SCALE_X,
|
|
255
|
+
SWITCH_TRACK_COPY_SCALE_Y,
|
|
256
|
+
SWITCH_VELOCITY_DIVISOR,
|
|
257
|
+
SLIDER_TRACK_HEIGHT,
|
|
258
|
+
SLIDER_THUMB_WIDTH,
|
|
259
|
+
SLIDER_THUMB_HEIGHT,
|
|
260
|
+
SLIDER_THUMB_PRESSED_SCALE,
|
|
261
|
+
SLIDER_VELOCITY_DIVISOR,
|
|
262
|
+
SLIDER_OVERSHOOT_MAX,
|
|
263
|
+
THUMB_SHADOW,
|
|
264
|
+
BUTTON_HEIGHT,
|
|
265
|
+
BUTTON_PADDING_HORIZONTAL,
|
|
266
|
+
BUTTON_CONTENT_GAP,
|
|
267
|
+
BUTTON_PRESS_GROWTH,
|
|
268
|
+
BUTTON_FOLLOW_DERIVATIVE,
|
|
269
|
+
BUTTON_PRESS_LIGHT,
|
|
270
|
+
BUTTON_SIZES,
|
|
271
|
+
GROUP_SPACING,
|
|
272
|
+
GROUP_GAP,
|
|
273
|
+
GROUP_OVERHANG,
|
|
274
|
+
CARD_CORNER_RADIUS,
|
|
275
|
+
CARD_PADDING,
|
|
276
|
+
CARD_PRESSED_SCALE,
|
|
277
|
+
STEPPER_HEIGHT,
|
|
278
|
+
STEPPER_CELL_WIDTH,
|
|
279
|
+
STEPPER_VALUE_MIN_WIDTH,
|
|
280
|
+
STEPPER_REPEAT_DELAY_MS,
|
|
281
|
+
STEPPER_REPEAT_INTERVAL_MS,
|
|
282
|
+
STEPPER_VALUE_POP_SCALE,
|
|
283
|
+
TOAST_HEIGHT,
|
|
284
|
+
TOAST_PADDING_HORIZONTAL,
|
|
285
|
+
TOAST_EDGE_OFFSET,
|
|
286
|
+
TOAST_DURATION_MS,
|
|
287
|
+
TOAST_TRAVEL,
|
|
288
|
+
SHEET_CORNER_RADIUS,
|
|
289
|
+
SHEET_HANDLE_WIDTH,
|
|
290
|
+
SHEET_HANDLE_HEIGHT,
|
|
291
|
+
SHEET_HANDLE_AREA_HEIGHT,
|
|
292
|
+
SHEET_DISMISS_FRACTION,
|
|
293
|
+
SHEET_DISMISS_VELOCITY,
|
|
294
|
+
SHEET_OVERDRAG_RESISTANCE,
|
|
295
|
+
SHEET_DIM_OPACITY,
|
|
296
|
+
TOOLBAR_HEIGHT,
|
|
297
|
+
CHIP_CONTENT_GAP,
|
|
298
|
+
MORPH_GROUP_SPACING,
|
|
299
|
+
MORPH_GROUP_GAP,
|
|
300
|
+
MORPH_GROUP_BLOOM,
|
|
301
|
+
MORPH_GROUP_OVERHANG,
|
|
302
|
+
SEGMENTED_HEIGHT,
|
|
303
|
+
SEGMENTED_INSET,
|
|
304
|
+
SEGMENTED_SMOOTHING,
|
|
305
|
+
SEGMENTED_STRETCH,
|
|
306
|
+
TAB_BAR_HEIGHT,
|
|
307
|
+
TAB_BAR_PADDING,
|
|
308
|
+
TAB_PILL_HEIGHT,
|
|
309
|
+
TAB_PILL_PRESSED_SCALE,
|
|
310
|
+
TAB_PILL_BLOOM_WIDTH,
|
|
311
|
+
TAB_BAR_PRESS_GROWTH,
|
|
312
|
+
TAB_ACCENT_STRIP_HEIGHT,
|
|
313
|
+
TAB_PRESS_LIGHT,
|
|
314
|
+
TAB_VELOCITY_DIVISOR,
|
|
315
|
+
TAB_JELLY_GAIN,
|
|
316
|
+
TAB_JELLY_LIMIT,
|
|
317
|
+
TAB_PILL_SHADOW,
|
|
318
|
+
TAB_PILL_WASH_BLEED,
|
|
319
|
+
TAB_PANEL_MAX_OFFSET,
|
|
320
|
+
TAB_ICON_SIZE,
|
|
321
|
+
TAB_ICON_SLOT,
|
|
322
|
+
TAB_LABEL_SIZE,
|
|
323
|
+
TAB_CONTENT_GAP,
|
|
324
|
+
TEXT_INPUT_HEIGHT,
|
|
325
|
+
};
|