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,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Popover = Popover;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — Popover.
|
|
6
|
+
//
|
|
7
|
+
// The donor's popover: an anchored panel with its own open state, dismissed by
|
|
8
|
+
// an outside press or Android's back gesture, never stealing a rendering pass
|
|
9
|
+
// from the screen behind it. Dressed on the family's overlay surface.
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const primitives_1 = require("./internal/primitives");
|
|
12
|
+
const motion_1 = require("./internal/motion");
|
|
13
|
+
const overlay_1 = require("./internal/overlay");
|
|
14
|
+
function Popover({ trigger, children, open: openProp, defaultOpen = false, onOpenChange, width = 260, accessibilityLabel = "Popover", isDark: isDarkProp, style, testID, }) {
|
|
15
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
16
|
+
const { View, Pressable } = (0, primitives_1.primitives)();
|
|
17
|
+
const [internalOpen, setInternalOpen] = (0, react_1.useState)(defaultOpen);
|
|
18
|
+
const { ref, anchor, capture } = (0, overlay_1.useTriggerAnchor)();
|
|
19
|
+
const open = openProp !== undefined ? openProp : internalOpen;
|
|
20
|
+
const setOpen = (next) => {
|
|
21
|
+
if (openProp === undefined)
|
|
22
|
+
setInternalOpen(next);
|
|
23
|
+
onOpenChange?.(next);
|
|
24
|
+
};
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(View, { style: { alignSelf: "flex-start" }, children: [(0, jsx_runtime_1.jsx)(Pressable, { ref: ref, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { expanded: open }, onPress: () => {
|
|
26
|
+
void capture();
|
|
27
|
+
setOpen(!open);
|
|
28
|
+
}, children: trigger }), (0, jsx_runtime_1.jsx)(overlay_1.OverlayPanel, { open: open, onClose: () => setOpen(false), anchor: anchor, width: width, isDark: isDark, testID: testID, accessibilityLabel: accessibilityLabel, role: "dialog", panelStyle: style, children: (0, jsx_runtime_1.jsx)(View, { style: { padding: 14 }, children: children }) })] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Progress = Progress;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Glass_1 = require("./Glass");
|
|
6
|
+
const tokens_1 = require("./internal/tokens");
|
|
7
|
+
const primitives_1 = require("./internal/primitives");
|
|
8
|
+
const motion_1 = require("./internal/motion");
|
|
9
|
+
function Progress({ value, variant = "linear", tint, accessibilityLabel = "Progress", style, isDark: isDarkProp, testID, }) {
|
|
10
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
11
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
12
|
+
const { View, Text: RNText } = (0, primitives_1.primitives)();
|
|
13
|
+
const indeterminate = variant === "indeterminate";
|
|
14
|
+
const labelled = variant === "track" || variant === "ring";
|
|
15
|
+
const percent = Math.min(100, Math.max(0, Number.isFinite(value) ? value : 0));
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(View, { testID: testID, accessible: true, accessibilityRole: "progressbar", accessibilityLabel: accessibilityLabel, accessibilityValue: indeterminate ? undefined : { min: 0, max: 100, now: Math.round(percent) }, children: [(0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "control", isDark: isDark, style: flattenStyle([
|
|
17
|
+
{ height: 8, borderRadius: tokens_1.radii.pill, overflow: "hidden", justifyContent: "center" },
|
|
18
|
+
style,
|
|
19
|
+
]), children: (0, jsx_runtime_1.jsx)(View, { style: {
|
|
20
|
+
height: "100%",
|
|
21
|
+
width: indeterminate ? "40%" : `${percent}%`,
|
|
22
|
+
borderRadius: tokens_1.radii.pill,
|
|
23
|
+
backgroundColor: tint ?? theme.fill,
|
|
24
|
+
} }) }), labelled ? ((0, jsx_runtime_1.jsxs)(RNText, { style: { ...tokens_1.typeScale.caption, color: theme.muted, marginTop: 4 }, children: [Math.round(percent), "%"] })) : null] }));
|
|
25
|
+
}
|
|
26
|
+
/** Flattens a style prop into one object, so a plain view surface can take it. */
|
|
27
|
+
function flattenStyle(style) {
|
|
28
|
+
if (style == null)
|
|
29
|
+
return undefined;
|
|
30
|
+
const list = Array.isArray(style) ? style : [style];
|
|
31
|
+
return Object.assign({}, ...list.filter(Boolean));
|
|
32
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RadioGroup = RadioGroup;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — RadioGroup.
|
|
6
|
+
//
|
|
7
|
+
// The donor's radio semantics: the group is a `radiogroup`, every option is a
|
|
8
|
+
// `radio` with `selected`, disabled options are skipped, and the value can be
|
|
9
|
+
// controlled or internal. Dressed in the Wave 1 family's rows and type steps.
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const tokens_1 = require("./internal/tokens");
|
|
12
|
+
const primitives_1 = require("./internal/primitives");
|
|
13
|
+
const motion_1 = require("./internal/motion");
|
|
14
|
+
const haptics_1 = require("./internal/haptics");
|
|
15
|
+
function RadioGroup({ value: valueProp, defaultValue, onValueChange, options, horizontal = false, disabled = false, accessibilityLabel = "Options", isDark: isDarkProp, style, testID, }) {
|
|
16
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
17
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
18
|
+
const { View, Pressable, Text: RNText } = (0, primitives_1.primitives)();
|
|
19
|
+
const [internal, setInternal] = (0, react_1.useState)(defaultValue);
|
|
20
|
+
const value = valueProp !== undefined ? valueProp : internal;
|
|
21
|
+
const choose = (next) => {
|
|
22
|
+
if (valueProp === undefined)
|
|
23
|
+
setInternal(next);
|
|
24
|
+
(0, haptics_1.hapticSelection)();
|
|
25
|
+
onValueChange?.(next);
|
|
26
|
+
};
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(View, { testID: testID, accessibilityRole: "radiogroup", accessibilityLabel: accessibilityLabel, style: [{ gap: 6, flexDirection: horizontal ? "row" : "column", flexWrap: "wrap" }, style], children: options.map((option) => {
|
|
28
|
+
const selected = value === option.value;
|
|
29
|
+
const off = disabled || option.disabled;
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "radio", accessibilityLabel: option.label, accessibilityState: { checked: selected, disabled: off }, disabled: off, onPress: () => choose(option.value), style: {
|
|
31
|
+
flexDirection: "row",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
gap: 10,
|
|
34
|
+
paddingVertical: 8,
|
|
35
|
+
opacity: off ? 0.38 : 1,
|
|
36
|
+
}, children: [(0, jsx_runtime_1.jsx)(View, { style: {
|
|
37
|
+
width: 22,
|
|
38
|
+
height: 22,
|
|
39
|
+
borderRadius: tokens_1.radii.pill,
|
|
40
|
+
borderWidth: 1.5,
|
|
41
|
+
borderColor: selected ? theme.fill : theme.separator,
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyContent: "center",
|
|
44
|
+
}, children: selected ? ((0, jsx_runtime_1.jsx)(View, { style: {
|
|
45
|
+
width: 12,
|
|
46
|
+
height: 12,
|
|
47
|
+
borderRadius: tokens_1.radii.pill,
|
|
48
|
+
backgroundColor: theme.fill,
|
|
49
|
+
} })) : null }), (0, jsx_runtime_1.jsxs)(View, { style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(RNText, { style: { ...tokens_1.typeScale.body, color: theme.foreground }, children: option.label }), option.description ? ((0, jsx_runtime_1.jsx)(RNText, { style: { ...tokens_1.typeScale.caption, color: theme.muted }, children: option.description })) : null] })] }, option.value));
|
|
50
|
+
}) }));
|
|
51
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Scrim = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const glass_routing_1 = require("./internal/glass-routing");
|
|
7
|
+
const GlassView_1 = require("./internal/GlassView");
|
|
8
|
+
const tokens_1 = require("./internal/tokens");
|
|
9
|
+
const primitives_1 = require("./internal/primitives");
|
|
10
|
+
const motion_1 = require("./internal/motion");
|
|
11
|
+
/**
|
|
12
|
+
* A scroll-edge scrim — ported from the engine's `LiquidGlassScrim`, the design
|
|
13
|
+
* Binyam approved on real devices this week (edge-hugging blur ramp).
|
|
14
|
+
*
|
|
15
|
+
* With a glass renderer available the engine's own control mounts, carrying the
|
|
16
|
+
* approved ramp. Without one — Expo Go, below every tier, or Reduce Transparency —
|
|
17
|
+
* the fallback floor renders the same scrim with a solid wash, so content is
|
|
18
|
+
* never lost behind an invisible scrim.
|
|
19
|
+
*/
|
|
20
|
+
exports.Scrim = (0, react_1.forwardRef)(function Scrim({ edge = "bottom", size = 160, radius = 24, reach = 0.7, tint, providerId, style, children, ...props }, ref) {
|
|
21
|
+
const isDark = (0, motion_1.useIsDark)();
|
|
22
|
+
const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
23
|
+
const { View } = (0, primitives_1.primitives)();
|
|
24
|
+
const capabilities = (0, GlassView_1.glassCapabilities)();
|
|
25
|
+
const EngineScrim = (0, glass_routing_1.loadEngineControl)("Scrim");
|
|
26
|
+
if (EngineScrim && capabilities.supported) {
|
|
27
|
+
const EngineScrimComponent = EngineScrim;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(EngineScrimComponent, { edge: edge, size: size, radius: radius, reach: reach, tint: tint, providerId: providerId, style: style, children: children }));
|
|
29
|
+
}
|
|
30
|
+
// Fallback floor: solid scrim at the content edge, full geometry.
|
|
31
|
+
const scrimStyle = {
|
|
32
|
+
position: "absolute",
|
|
33
|
+
...(edge === "top"
|
|
34
|
+
? { top: 0, left: 0, right: 0, height: size }
|
|
35
|
+
: edge === "bottom"
|
|
36
|
+
? { bottom: 0, left: 0, right: 0, height: size }
|
|
37
|
+
: edge === "left"
|
|
38
|
+
? { left: 0, top: 0, bottom: 0, width: size }
|
|
39
|
+
: { right: 0, top: 0, bottom: 0, width: size }),
|
|
40
|
+
backgroundColor: tint ?? themeColors.scrim,
|
|
41
|
+
...style,
|
|
42
|
+
};
|
|
43
|
+
return (0, jsx_runtime_1.jsx)(View, { ref: ref, style: scrimStyle, ...props, children: children });
|
|
44
|
+
});
|
|
@@ -3,101 +3,108 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SegmentedControl = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const glass_routing_1 = require("./internal/glass-routing");
|
|
7
|
+
const GlassView_1 = require("./internal/GlassView");
|
|
6
8
|
const Glass_1 = require("./Glass");
|
|
7
9
|
const tokens_1 = require("./internal/tokens");
|
|
8
10
|
const primitives_1 = require("./internal/primitives");
|
|
9
11
|
const motion_1 = require("./internal/motion");
|
|
10
12
|
const haptics_1 = require("./internal/haptics");
|
|
11
13
|
const lens_1 = require("./internal/lens");
|
|
12
|
-
// The web segment is 32 high inside a 2pt inset, on a pill container, with the
|
|
13
|
-
// selected pill itself a pill: 500/400 weights, not a bold selected label.
|
|
14
|
-
const SEGMENT_HEIGHT = 32;
|
|
15
14
|
/**
|
|
16
|
-
* A
|
|
15
|
+
* A segmented control — ported from the engine's `LiquidGlassSegmentedControl`,
|
|
16
|
+
* the design Binyam approved on real devices this week (40dp track, 3dp-inset
|
|
17
|
+
* thumb).
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* With a glass renderer available the engine's own control mounts, carrying the
|
|
20
|
+
* approved geometry and thumb behaviour. Without one — Expo Go, below every
|
|
21
|
+
* tier, or Reduce Transparency — the fallback floor renders the same row of
|
|
22
|
+
* segments with solid selected states, so the control is never invisible.
|
|
21
23
|
*/
|
|
22
|
-
exports.SegmentedControl = (0, react_1.forwardRef)(function SegmentedControl({
|
|
24
|
+
exports.SegmentedControl = (0, react_1.forwardRef)(function SegmentedControl({ segments, selectedIndex, onChange, height = 40, tint, thumbTint, thumbMetal, accessibilityLabel, isDark: isDarkProp, testID, style, textStyle, ...props }, ref) {
|
|
23
25
|
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
24
26
|
const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
25
|
-
const { View,
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const safeIndex = Math.min(Math.max(activeIndex, 0), Math.max(values.length - 1, 0));
|
|
27
|
+
const { View, Pressable, Text: RNText, Animated } = (0, primitives_1.primitives)();
|
|
28
|
+
const capabilities = (0, GlassView_1.glassCapabilities)();
|
|
29
|
+
const EngineSegmentedControl = (0, glass_routing_1.loadEngineControl)("SegmentedControl");
|
|
30
|
+
const selected = Math.min(Math.max(selectedIndex, 0), Math.max(segments.length - 1, 0));
|
|
30
31
|
// The pill slides between equal-width segments, so a ratio is enough: 0 is
|
|
31
32
|
// the first segment, values.length - 1 the last.
|
|
32
|
-
const
|
|
33
|
-
const handleSelect = (index) => {
|
|
34
|
-
// Only a change ticks: re-pressing the current segment is not a selection.
|
|
35
|
-
if (haptics && index !== safeIndex)
|
|
36
|
-
(0, haptics_1.hapticSelection)();
|
|
37
|
-
if (selectedProp === undefined)
|
|
38
|
-
setInternalIndex(index);
|
|
39
|
-
const val = values[index];
|
|
40
|
-
if (val !== undefined)
|
|
41
|
-
onValueChange?.(val, index);
|
|
42
|
-
};
|
|
43
|
-
const count = Math.max(values.length, 1);
|
|
33
|
+
const count = Math.max(segments.length, 1);
|
|
44
34
|
const pillWidth = `${100 / count}%`;
|
|
45
|
-
const
|
|
46
|
-
position: "relative",
|
|
47
|
-
flexDirection: "row",
|
|
48
|
-
alignItems: "center",
|
|
49
|
-
alignSelf: "flex-start",
|
|
50
|
-
padding: 2,
|
|
51
|
-
borderRadius: tokens_1.radii.pill,
|
|
52
|
-
// The web lays the segment track tint over glass; the fallback paints the
|
|
53
|
-
// same tint as the flat track the web sees through the glass.
|
|
54
|
-
backgroundColor: themeColors.fieldWash,
|
|
55
|
-
...style,
|
|
56
|
-
};
|
|
35
|
+
const { value: slide, animated } = (0, motion_1.useSpring)(selected, "snappy");
|
|
57
36
|
const pillTranslate = animated
|
|
58
37
|
? slide.interpolate({
|
|
59
38
|
inputRange: [0, Math.max(count - 1, 1)],
|
|
60
|
-
// One segment's worth per step, measured against the pill's own width.
|
|
61
39
|
outputRange: ["0%", `${((count - 1) * 100) / count}%`],
|
|
62
40
|
})
|
|
63
|
-
: `${(
|
|
64
|
-
|
|
41
|
+
: `${(selected * 100) / count}%`;
|
|
42
|
+
if (EngineSegmentedControl && capabilities.supported) {
|
|
43
|
+
const EngineSegmentedControlComponent = EngineSegmentedControl;
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(EngineSegmentedControlComponent, { segments: segments, selectedIndex: selected, onChange: (index) => {
|
|
45
|
+
(0, haptics_1.hapticSelection)();
|
|
46
|
+
onChange(index);
|
|
47
|
+
}, height: height, tint: tint, thumbTint: thumbTint, thumbMetal: thumbMetal, style: style, textStyle: textStyle }));
|
|
48
|
+
}
|
|
49
|
+
// Fallback floor: the sliding lens pill on a solid track, full selection
|
|
50
|
+
// behaviour, so the selected segment reads exactly as it does in glass.
|
|
51
|
+
const fallback = ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", surface: "rail", pressed: false, isDark: isDark, style: {
|
|
52
|
+
position: "relative",
|
|
53
|
+
flexDirection: "row",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
alignSelf: "flex-start",
|
|
56
|
+
padding: 3,
|
|
57
|
+
borderRadius: tokens_1.radii.pill,
|
|
58
|
+
backgroundColor: themeColors.fieldWash,
|
|
59
|
+
...style,
|
|
60
|
+
}, testID: testID, ...props, children: [animated ? ((0, jsx_runtime_1.jsx)(Animated.View, { style: {
|
|
65
61
|
position: "absolute",
|
|
66
|
-
top:
|
|
67
|
-
left:
|
|
62
|
+
top: 3,
|
|
63
|
+
left: 3,
|
|
68
64
|
width: pillWidth,
|
|
69
|
-
height:
|
|
70
|
-
borderRadius:
|
|
65
|
+
height: height - 6,
|
|
66
|
+
borderRadius: (height - 6) / 2,
|
|
71
67
|
backgroundColor: themeColors.glassActive,
|
|
72
68
|
borderWidth: 0.5,
|
|
73
69
|
borderColor: themeColors.edge,
|
|
74
70
|
// The thumb is a lens: lifted off the rail, with its own rim.
|
|
75
71
|
...(0, lens_1.lensShadow)(isDark),
|
|
76
72
|
transform: [{ translateX: pillTranslate }],
|
|
77
|
-
}, pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lens_1.LensRim, { radius:
|
|
73
|
+
}, pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lens_1.LensRim, { radius: (height - 6) / 2, isDark: isDark }) })) : ((0, jsx_runtime_1.jsx)(View, { style: {
|
|
78
74
|
position: "absolute",
|
|
79
|
-
top:
|
|
80
|
-
left: `${
|
|
75
|
+
top: 3,
|
|
76
|
+
left: `${3 + (selected * 100) / count}%`,
|
|
81
77
|
width: pillWidth,
|
|
82
|
-
height:
|
|
83
|
-
borderRadius:
|
|
78
|
+
height: height - 6,
|
|
79
|
+
borderRadius: (height - 6) / 2,
|
|
84
80
|
backgroundColor: themeColors.glassActive,
|
|
85
81
|
borderWidth: 0.5,
|
|
86
82
|
borderColor: themeColors.edge,
|
|
87
83
|
...(0, lens_1.lensShadow)(isDark),
|
|
88
|
-
}, pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lens_1.LensRim, { radius:
|
|
89
|
-
const isSelected =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
}, pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lens_1.LensRim, { radius: (height - 6) / 2, isDark: isDark }) })), segments.map((segment, index) => {
|
|
85
|
+
const isSelected = index === selected;
|
|
86
|
+
const cell = (height - 6) / Math.max(segments.length, 1);
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(View, { style: { width: cell, height: height - 6, position: "relative" }, children: [isSelected ? ((0, jsx_runtime_1.jsx)(View, { style: {
|
|
88
|
+
position: "absolute",
|
|
89
|
+
top: 0,
|
|
90
|
+
left: 0,
|
|
91
|
+
width: cell,
|
|
92
|
+
height: height - 6,
|
|
93
|
+
borderRadius: (height - 6) / 2,
|
|
94
|
+
backgroundColor: themeColors.glassActive,
|
|
95
|
+
} })) : null, (0, jsx_runtime_1.jsx)(Pressable, { testID: testID ? `${testID}-segment-${index}` : undefined, accessibilityRole: "tab", accessibilityLabel: `${accessibilityLabel ?? "Segment"} ${segment}`, accessibilityState: { selected: isSelected, disabled: false }, disabled: false, onPress: () => {
|
|
96
|
+
if (index === selected)
|
|
97
|
+
return;
|
|
98
|
+
(0, haptics_1.hapticSelection)();
|
|
99
|
+
onChange(index);
|
|
100
|
+
}, style: { width: "100%", height, alignItems: "center", justifyContent: "center" }, children: (0, jsx_runtime_1.jsx)(RNText, { style: [
|
|
101
|
+
{
|
|
102
|
+
fontSize: 14,
|
|
103
|
+
fontWeight: isSelected ? "600" : "500",
|
|
104
|
+
color: isSelected ? themeColors.onTint : themeColors.muted,
|
|
105
|
+
},
|
|
106
|
+
textStyle,
|
|
107
|
+
], children: segment }) })] }, segment));
|
|
102
108
|
})] }));
|
|
109
|
+
return fallback;
|
|
103
110
|
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Select = Select;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — Select.
|
|
6
|
+
//
|
|
7
|
+
// The donor's single-choice field: a `listbox`-style combobox whose trigger
|
|
8
|
+
// shows the chosen label, opening an anchored list where each option is
|
|
9
|
+
// selectable and the chosen one is marked. Controlled or internal, with a
|
|
10
|
+
// placeholder and disabled options.
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const Glass_1 = require("./Glass");
|
|
13
|
+
const tokens_1 = require("./internal/tokens");
|
|
14
|
+
const primitives_1 = require("./internal/primitives");
|
|
15
|
+
const motion_1 = require("./internal/motion");
|
|
16
|
+
const haptics_1 = require("./internal/haptics");
|
|
17
|
+
const overlay_1 = require("./internal/overlay");
|
|
18
|
+
function Select({ value: valueProp, defaultValue, onValueChange, options, placeholder = "Select…", disabled = false, accessibilityLabel = "Select", isDark: isDarkProp, style, testID, }) {
|
|
19
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
20
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
21
|
+
const { View, Pressable, Text: RNText } = (0, primitives_1.primitives)();
|
|
22
|
+
const [internal, setInternal] = (0, react_1.useState)(defaultValue);
|
|
23
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
24
|
+
const { ref, anchor, capture } = (0, overlay_1.useTriggerAnchor)();
|
|
25
|
+
const value = valueProp !== undefined ? valueProp : internal;
|
|
26
|
+
const chosen = options.find((option) => option.value === value);
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(View, { style: { alignSelf: "flex-start", width: 220, maxWidth: "100%" }, children: [(0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: chosen ? chosen.label : accessibilityLabel, accessibilityState: { expanded: open, disabled }, accessibilityValue: chosen ? { text: chosen.label } : undefined, disabled: disabled, onPress: () => {
|
|
28
|
+
void capture();
|
|
29
|
+
setOpen(true);
|
|
30
|
+
}, style: { opacity: disabled ? 0.38 : 1 }, children: (0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", surface: "control", isDark: isDark, pressed: open, style: {
|
|
31
|
+
height: 40,
|
|
32
|
+
borderRadius: tokens_1.radii.md,
|
|
33
|
+
paddingHorizontal: 14,
|
|
34
|
+
flexDirection: "row",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: "space-between",
|
|
37
|
+
gap: 8,
|
|
38
|
+
}, children: [(0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
fontSize: 15,
|
|
41
|
+
color: chosen ? theme.foreground : theme.muted,
|
|
42
|
+
}, children: chosen?.label ?? placeholder }), (0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 11, color: theme.muted, transform: [{ rotate: open ? "180deg" : "0deg" }] }, children: "\u25BE" })] }) }), (0, jsx_runtime_1.jsx)(overlay_1.OverlayPanel, { open: open, onClose: () => setOpen(false), anchor: anchor, width: 220, isDark: isDark, testID: testID ? `${testID}-list` : undefined, accessibilityLabel: chosen ? chosen.label : accessibilityLabel, role: "listbox", children: options.map((option) => ((0, jsx_runtime_1.jsx)(overlay_1.PanelItem, { label: option.label, disabled: option.disabled, selected: option.value === value, role: "option", isDark: isDark, onPress: () => {
|
|
43
|
+
if (option.disabled)
|
|
44
|
+
return;
|
|
45
|
+
setOpen(false);
|
|
46
|
+
if (valueProp === undefined)
|
|
47
|
+
setInternal(option.value);
|
|
48
|
+
(0, haptics_1.hapticSelection)();
|
|
49
|
+
onValueChange?.(option.value);
|
|
50
|
+
} }, option.value))) })] }));
|
|
51
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Separator = Separator;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const tokens_1 = require("./internal/tokens");
|
|
6
|
+
const primitives_1 = require("./internal/primitives");
|
|
7
|
+
const motion_1 = require("./internal/motion");
|
|
8
|
+
function Separator({ orientation = "horizontal", inset = 0, isDark: isDarkProp, style, testID, }) {
|
|
9
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
10
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
11
|
+
const { View } = (0, primitives_1.primitives)();
|
|
12
|
+
const horizontal = orientation === "horizontal";
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(View, { testID: testID, accessibilityRole: "none", role: "separator", style: [
|
|
14
|
+
{
|
|
15
|
+
backgroundColor: theme.separator,
|
|
16
|
+
alignSelf: "stretch",
|
|
17
|
+
height: horizontal ? 1 : undefined,
|
|
18
|
+
width: horizontal ? undefined : 1,
|
|
19
|
+
marginLeft: horizontal ? inset : undefined,
|
|
20
|
+
marginVertical: horizontal ? 8 : 0,
|
|
21
|
+
},
|
|
22
|
+
horizontal ? null : { height: "100%" },
|
|
23
|
+
style,
|
|
24
|
+
] }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sheet = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const glass_routing_1 = require("./internal/glass-routing");
|
|
7
|
+
const GlassView_1 = require("./internal/GlassView");
|
|
8
|
+
const tokens_1 = require("./internal/tokens");
|
|
9
|
+
const primitives_1 = require("./internal/primitives");
|
|
10
|
+
const motion_1 = require("./internal/motion");
|
|
11
|
+
/**
|
|
12
|
+
* A bottom sheet — ported from the engine's `LiquidGlassSheet`, the design
|
|
13
|
+
* Binyam approved on real devices this week (28dp top corners, 36x5 grab handle,
|
|
14
|
+
* dismissed past 30 % of its height or on a dim tap).
|
|
15
|
+
*
|
|
16
|
+
* With a glass renderer available the engine's own control mounts, carrying the
|
|
17
|
+
* approved material, handle and dismissal behaviour. Without one — Expo Go, below
|
|
18
|
+
* every tier, or Reduce Transparency — the fallback floor renders the same panel
|
|
19
|
+
* with a solid surface and the same dismissal affordances, so the sheet is never
|
|
20
|
+
* invisible.
|
|
21
|
+
*/
|
|
22
|
+
exports.Sheet = (0, react_1.forwardRef)(function Sheet({ visible, onDismiss, height = 420, cornerRadius = 28, handle = true, dim = 0.25, dismissOnTap = true, tint, variant = "regular", style, contentStyle, children, isDark: isDarkProp, testID, ...props }, ref) {
|
|
23
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
24
|
+
const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
25
|
+
const { View } = (0, primitives_1.primitives)();
|
|
26
|
+
const capabilities = (0, GlassView_1.glassCapabilities)();
|
|
27
|
+
const EngineSheet = (0, glass_routing_1.loadEngineControl)("Sheet");
|
|
28
|
+
if (!visible)
|
|
29
|
+
return null;
|
|
30
|
+
if (EngineSheet && capabilities.supported) {
|
|
31
|
+
const EngineSheetComponent = EngineSheet;
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(EngineSheetComponent, { visible: visible, onDismiss: onDismiss, height: height, cornerRadius: cornerRadius, handle: handle, dim: dim, dismissOnTap: dismissOnTap, tint: tint, variant: variant, style: style, contentStyle: contentStyle, testID: testID, children: children }));
|
|
33
|
+
}
|
|
34
|
+
// Fallback floor: dim + solid panel at the bottom, same geometry.
|
|
35
|
+
const panelStyle = {
|
|
36
|
+
position: "absolute",
|
|
37
|
+
bottom: 0,
|
|
38
|
+
left: 0,
|
|
39
|
+
right: 0,
|
|
40
|
+
height,
|
|
41
|
+
borderTopLeftRadius: cornerRadius,
|
|
42
|
+
borderTopRightRadius: cornerRadius,
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
backgroundColor: tint ?? themeColors.surface,
|
|
45
|
+
...style,
|
|
46
|
+
};
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [dim > 0 ? ((0, jsx_runtime_1.jsx)(View, { testID: testID ? `${testID}-dim` : undefined, pointerEvents: "box-none", style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, backgroundColor: themeColors.scrim }, onStartShouldSetResponder: () => true, onResponderGrant: () => {
|
|
48
|
+
if (dismissOnTap)
|
|
49
|
+
onDismiss?.();
|
|
50
|
+
} })) : null, (0, jsx_runtime_1.jsxs)(View, { style: panelStyle, testID: testID, children: [handle ? ((0, jsx_runtime_1.jsx)(View, { style: { width: 36, height: 5, borderRadius: 2.5, alignSelf: "center", marginTop: 8 } })) : null, (0, jsx_runtime_1.jsx)(View, { style: contentStyle, children: children })] })] }));
|
|
51
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Skeleton = Skeleton;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — Skeleton.
|
|
6
|
+
//
|
|
7
|
+
// The donor's placeholder is decorative: it hides its content from screen
|
|
8
|
+
// readers and announces a busy state on the container instead. The shimmer is
|
|
9
|
+
// the family's motion and disappears under Reduce Motion.
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const tokens_1 = require("./internal/tokens");
|
|
12
|
+
const primitives_1 = require("./internal/primitives");
|
|
13
|
+
const motion_1 = require("./internal/motion");
|
|
14
|
+
const a11y_1 = require("./internal/a11y");
|
|
15
|
+
function Skeleton({ shape = "rect", width, height, isDark: isDarkProp, style, testID, }) {
|
|
16
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
17
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
18
|
+
const reducedMotion = (0, a11y_1.useReducedMotion)();
|
|
19
|
+
const { View, Animated, isNative } = (0, primitives_1.primitives)();
|
|
20
|
+
const pulse = (0, react_1.useRef)(null);
|
|
21
|
+
const animate = Boolean(isNative && Animated?.Value && Animated?.timing) && !reducedMotion;
|
|
22
|
+
if (pulse.current === null)
|
|
23
|
+
pulse.current = animate ? new Animated.Value(0.55) : { value: 1 };
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
if (!animate) {
|
|
26
|
+
pulse.current.value = 1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const loop = Animated.loop(Animated.sequence([
|
|
30
|
+
Animated.timing(pulse.current, { toValue: 1, duration: 700, useNativeDriver: true }),
|
|
31
|
+
Animated.timing(pulse.current, { toValue: 0.55, duration: 700, useNativeDriver: true }),
|
|
32
|
+
]));
|
|
33
|
+
loop.start();
|
|
34
|
+
return () => loop.stop?.();
|
|
35
|
+
}, [animate]);
|
|
36
|
+
const resolvedHeight = height ?? (shape === "line" ? 12 : 20);
|
|
37
|
+
const size = shape === "circle" ? resolvedHeight : undefined;
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(Animated.View, { testID: testID, accessibilityRole: "none", importantForAccessibility: "no", accessibilityElementsHidden: true, style: [
|
|
39
|
+
{
|
|
40
|
+
width: size ?? width ?? "100%",
|
|
41
|
+
height: resolvedHeight,
|
|
42
|
+
backgroundColor: theme.skeleton,
|
|
43
|
+
borderRadius: shape === "circle" ? resolvedHeight / 2 : tokens_1.radii.sm,
|
|
44
|
+
opacity: pulse.current,
|
|
45
|
+
},
|
|
46
|
+
style,
|
|
47
|
+
] }));
|
|
48
|
+
}
|