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,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Collapsible = Collapsible;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — Collapsible.
|
|
6
|
+
//
|
|
7
|
+
// The donor's single disclosure: the trigger announces `expanded`, the content
|
|
8
|
+
// mounts only while open, and state can be controlled or internal. Nothing is
|
|
9
|
+
// styled like the donor — the trigger is the family's glass control.
|
|
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
|
+
function Collapsible({ open: openProp, defaultOpen = false, onOpenChange, trigger, accessibilityLabel = "Toggle section", disabled = false, children, style, isDark: isDarkProp, testID, }) {
|
|
15
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
16
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
17
|
+
const { View, Pressable, Text: RNText } = (0, primitives_1.primitives)();
|
|
18
|
+
const [internalOpen, setInternalOpen] = (0, react_1.useState)(defaultOpen);
|
|
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, { testID: testID, style: style, children: [(0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { expanded: open, disabled }, disabled: disabled, onPress: () => setOpen(!open), children: trigger }), open ? (0, jsx_runtime_1.jsx)(View, { style: { paddingTop: 8 }, children: children }) : null] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextMenu = ContextMenu;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — ContextMenu.
|
|
6
|
+
//
|
|
7
|
+
// The donor's context menu: nothing opens it until a long press on the trigger,
|
|
8
|
+
// the panel carries a `menu` role with `menuitem` rows, and it closes on
|
|
9
|
+
// selection, outside press, or Android's back gesture. Dressed like the
|
|
10
|
+
// dropdown menu — same surface, same rows.
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const primitives_1 = require("./internal/primitives");
|
|
13
|
+
const motion_1 = require("./internal/motion");
|
|
14
|
+
const overlay_1 = require("./internal/overlay");
|
|
15
|
+
function ContextMenu({ trigger, items, open: openProp, onOpenChange, width = 220, accessibilityLabel = "Context menu", isDark: isDarkProp, style, testID, }) {
|
|
16
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
17
|
+
const { View, Pressable } = (0, primitives_1.primitives)();
|
|
18
|
+
const [internalOpen, setInternalOpen] = (0, react_1.useState)(false);
|
|
19
|
+
const { ref, anchor, capture } = (0, overlay_1.useTriggerAnchor)();
|
|
20
|
+
const open = openProp !== undefined ? openProp : internalOpen;
|
|
21
|
+
const setOpen = (next) => {
|
|
22
|
+
if (openProp === undefined)
|
|
23
|
+
setInternalOpen(next);
|
|
24
|
+
onOpenChange?.(next);
|
|
25
|
+
};
|
|
26
|
+
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 }, onLongPress: () => {
|
|
27
|
+
void capture();
|
|
28
|
+
setOpen(true);
|
|
29
|
+
}, delayLongPress: 350, children: trigger }), (0, jsx_runtime_1.jsx)(overlay_1.OverlayPanel, { open: open, onClose: () => setOpen(false), anchor: anchor, width: width, isDark: isDark, testID: testID ? `${testID}-menu` : undefined, accessibilityLabel: accessibilityLabel, role: "menu", panelStyle: style, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(overlay_1.PanelItem, { label: item.label, icon: item.icon, destructive: item.destructive, disabled: item.disabled, role: "menuitem", isDark: isDark, onPress: () => {
|
|
30
|
+
setOpen(false);
|
|
31
|
+
item.onPress();
|
|
32
|
+
} }, `${item.label}-${index}`))) })] }));
|
|
33
|
+
}
|
package/lib/module/Dialog.js
CHANGED
|
@@ -2,137 +2,53 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Dialog = Dialog;
|
|
4
4
|
exports.DialogTrigger = DialogTrigger;
|
|
5
|
-
exports.AlertDialog = AlertDialog;
|
|
6
|
-
exports.ActionSheet = ActionSheet;
|
|
7
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
// Wave 2 — Dialog.
|
|
7
|
+
//
|
|
8
|
+
// Behaviour from the donor: a modal layer that closes on the backdrop unless
|
|
9
|
+
// told not to, on Android's back gesture, and announces itself as a modal
|
|
10
|
+
// dialog with a heading. The dress is the Wave 1 family — the same glass
|
|
11
|
+
// surface, radius, type steps and spring entrance as the sheet.
|
|
8
12
|
const react_1 = require("react");
|
|
13
|
+
const Button_1 = require("./Button");
|
|
14
|
+
const Glass_1 = require("./Glass");
|
|
9
15
|
const tokens_1 = require("./internal/tokens");
|
|
10
16
|
const primitives_1 = require("./internal/primitives");
|
|
11
17
|
const motion_1 = require("./internal/motion");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A centred modal panel above a dimmed backdrop.
|
|
16
|
-
*
|
|
17
|
-
* The panel is a glass surface, so it is Apple's real Liquid Glass on iOS 26+
|
|
18
|
-
* and Glacia's translucent tint elsewhere; the text sits on it with the
|
|
19
|
-
* theme's foreground colour, so contrast holds either way.
|
|
20
|
-
*
|
|
21
|
-
* React Native has no built-in focus trap, so this component covers what the
|
|
22
|
-
* platform can actually do: `Modal` blocks touches behind it, Android's back
|
|
23
|
-
* button routes to `onOpenChange(false)`, and the heading is marked as such so
|
|
24
|
-
* screen readers announce the dialog as it appears.
|
|
25
|
-
*
|
|
26
|
-
* To open a dialog from a button, use `DialogTrigger`.
|
|
27
|
-
*/
|
|
28
|
-
function Dialog({ open: controlledOpen, onOpenChange, title, description, children, footer, dismissOnBackdropPress = true, isDark: isDarkProp, style, testID, }) {
|
|
18
|
+
const overlay_1 = require("./internal/overlay");
|
|
19
|
+
function Dialog({ open: openProp, onOpenChange, title, description, children, footer, dismissOnBackdropPress = true, isDark: isDarkProp, style, testID, }) {
|
|
29
20
|
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
30
21
|
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
31
|
-
const { View,
|
|
32
|
-
const [
|
|
33
|
-
const open =
|
|
34
|
-
const setOpen = (
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
onOpenChange?.(next);
|
|
38
|
-
}, [controlledOpen, onOpenChange]);
|
|
39
|
-
// Android's hardware back must close the dialog, not the screen behind it.
|
|
40
|
-
(0, react_1.useEffect)(() => {
|
|
41
|
-
if (!open)
|
|
42
|
-
return;
|
|
43
|
-
const BackHandler = getBackHandler();
|
|
44
|
-
if (!BackHandler)
|
|
45
|
-
return;
|
|
46
|
-
const sub = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
47
|
-
setOpen(false);
|
|
48
|
-
return true;
|
|
49
|
-
});
|
|
50
|
-
return () => sub.remove();
|
|
51
|
-
}, [open, setOpen, getBackHandler]);
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: () => setOpen(false), children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: "Close dialog", onPress: dismissOnBackdropPress ? () => setOpen(false) : undefined, style: {
|
|
53
|
-
flex: 1,
|
|
54
|
-
alignItems: "center",
|
|
55
|
-
justifyContent: "center",
|
|
56
|
-
padding: 24,
|
|
57
|
-
backgroundColor: "rgba(0, 0, 0, 0.45)",
|
|
58
|
-
}, children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "none", onPress: () => { }, style: { width: "100%", maxWidth: 380 }, children: (0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", surface: "overlay", isDark: isDark, testID: testID, style: {
|
|
59
|
-
borderRadius: tokens_1.radii.xl,
|
|
60
|
-
padding: 20,
|
|
61
|
-
gap: 8,
|
|
62
|
-
// The web overlay shadow: the panel has to float above the scrim.
|
|
63
|
-
shadowOpacity: 0.12,
|
|
64
|
-
shadowRadius: 50,
|
|
65
|
-
shadowOffset: { width: 0, height: 20 },
|
|
66
|
-
...style,
|
|
67
|
-
}, children: [title && ((0, jsx_runtime_1.jsx)(Text, { accessibilityRole: "heading", style: { fontSize: 17, fontWeight: "600", color: theme.foreground }, children: title })), description && ((0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 14, color: theme.muted, lineHeight: 20 }, children: description })), children, footer && (0, jsx_runtime_1.jsx)(View, { style: { marginTop: 12, gap: 8 }, children: footer })] }) }) }) }));
|
|
68
|
-
}
|
|
69
|
-
/** Opens the dialog without the caller tracking state. */
|
|
70
|
-
function DialogTrigger({ label, children, ...dialogProps }) {
|
|
71
|
-
const [open, setOpen] = (0, react_1.useState)(false);
|
|
72
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { accessibilityLabel: label, onPress: () => setOpen(true), children: label }), (0, jsx_runtime_1.jsx)(Dialog, { ...dialogProps, open: open, onOpenChange: setOpen })] }));
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* A dialog that asks for confirmation.
|
|
76
|
-
*
|
|
77
|
-
* Deliberately not dismissible by tapping the backdrop: a destructive question
|
|
78
|
-
* should require a real answer, so the only ways out are the two buttons or the
|
|
79
|
-
* Android back button, which counts as cancel.
|
|
80
|
-
*/
|
|
81
|
-
function AlertDialog({ open: controlledOpen, onOpenChange, title, description, confirmLabel = "Confirm", cancelLabel = "Cancel", destructive = false, onConfirm, onCancel, isDark: isDarkProp, testID, }) {
|
|
82
|
-
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
83
|
-
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
84
|
-
const { View } = (0, primitives_1.primitives)();
|
|
85
|
-
const [uncontrolled, setUncontrolled] = (0, react_1.useState)(false);
|
|
86
|
-
const open = controlledOpen ?? uncontrolled;
|
|
87
|
-
const close = (next) => {
|
|
88
|
-
if (controlledOpen === undefined)
|
|
89
|
-
setUncontrolled(next);
|
|
22
|
+
const { View, Pressable, Text: RNText, Modal } = (0, primitives_1.primitives)();
|
|
23
|
+
const [internalOpen, setInternalOpen] = (0, react_1.useState)(false);
|
|
24
|
+
const open = openProp !== undefined ? openProp : internalOpen;
|
|
25
|
+
const setOpen = (next) => {
|
|
26
|
+
if (openProp === undefined)
|
|
27
|
+
setInternalOpen(next);
|
|
90
28
|
onOpenChange?.(next);
|
|
91
29
|
};
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
close(true);
|
|
105
|
-
}, title: title, description: description, dismissOnBackdropPress: false, isDark: isDark, footer: (0, jsx_runtime_1.jsxs)(View, { style: { flexDirection: "row", gap: 8, justifyContent: "flex-end" }, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { accessibilityLabel: cancelLabel, variant: "ghost", onPress: cancel, children: cancelLabel }), (0, jsx_runtime_1.jsx)(Button_1.Button, { accessibilityLabel: confirmLabel, variant: "filled", tint: destructive ? theme.destructive : undefined, onPress: () => {
|
|
106
|
-
onConfirm?.();
|
|
107
|
-
close(false);
|
|
108
|
-
}, children: confirmLabel })] }) }));
|
|
30
|
+
const dismiss = () => setOpen(false);
|
|
31
|
+
(0, overlay_1.useBackDismiss)(open, dismiss);
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: dismiss, children: (0, jsx_runtime_1.jsxs)(View, { style: { flex: 1, backgroundColor: theme.scrim }, children: [(0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: "Close dialog", accessibilityState: { disabled: !dismissOnBackdropPress }, onPress: dismissOnBackdropPress ? dismiss : undefined, style: StyleSheetAbsoluteFill }), (0, jsx_runtime_1.jsx)(View, { style: { flex: 1, justifyContent: "center", padding: 24 }, pointerEvents: "box-none", children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "none", onPress: () => { }, children: (0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", surface: "overlay", isDark: isDark, testID: testID, accessibilityViewIsModal: true, style: [
|
|
33
|
+
{
|
|
34
|
+
borderRadius: tokens_1.radii.lg,
|
|
35
|
+
backgroundColor: theme.surface,
|
|
36
|
+
padding: 20,
|
|
37
|
+
gap: 10,
|
|
38
|
+
alignSelf: "stretch",
|
|
39
|
+
},
|
|
40
|
+
style,
|
|
41
|
+
], children: [title ? ((0, jsx_runtime_1.jsx)(RNText, { accessibilityRole: "heading", as: true, any: true, style: { ...tokens_1.typeScale.heading, color: theme.foreground }, children: title })) : null, description ? ((0, jsx_runtime_1.jsx)(RNText, { style: { ...tokens_1.typeScale.body, color: theme.muted }, children: description })) : null, children ? (0, jsx_runtime_1.jsx)(View, { style: { gap: 10 }, children: children }) : null, footer ? ((0, jsx_runtime_1.jsx)(View, { style: { gap: 8, marginTop: 4 }, children: footer })) : ((0, jsx_runtime_1.jsx)(View, { style: { alignSelf: "flex-end", marginTop: 4 }, children: (0, jsx_runtime_1.jsx)(Button_1.Button, { accessibilityLabel: "Close", variant: "filled", onPress: dismiss, children: "Close" }) }))] }) }) })] }) }));
|
|
109
42
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const { View, Text, Pressable, Modal } = (0, primitives_1.primitives)();
|
|
122
|
-
const [uncontrolled, setUncontrolled] = (0, react_1.useState)(false);
|
|
123
|
-
const open = controlledOpen ?? uncontrolled;
|
|
124
|
-
const close = () => {
|
|
125
|
-
if (controlledOpen === undefined)
|
|
126
|
-
setUncontrolled(false);
|
|
127
|
-
onOpenChange?.(false);
|
|
128
|
-
};
|
|
129
|
-
return ((0, jsx_runtime_1.jsx)(Modal, { visible: open, transparent: true, animationType: "slide", onRequestClose: close, testID: testID, children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: "Dismiss actions", onPress: close, style: { flex: 1, justifyContent: "flex-end", backgroundColor: "rgba(0,0,0,0.4)" }, children: (0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "none", onPress: () => { }, style: { padding: 10, gap: 8 }, children: [(title || message) && ((0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "overlay", isDark: isDark, style: { borderRadius: tokens_1.radii.lg }, children: (0, jsx_runtime_1.jsxs)(View, { style: { paddingVertical: 12, paddingHorizontal: 16, alignItems: "center" }, children: [title && ((0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 13, fontWeight: "600", color: theme.foreground }, children: title })), message && ((0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 12, color: theme.muted, marginTop: 4, textAlign: "center" }, children: message }))] }) })), options.map((option) => ((0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "overlay", isDark: isDark, style: { borderRadius: tokens_1.radii.pill }, children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: option.label, onPress: () => {
|
|
130
|
-
option.onPress?.();
|
|
131
|
-
close();
|
|
132
|
-
}, style: { minHeight: 44, paddingVertical: 12, paddingHorizontal: 20, alignItems: "center", justifyContent: "center" }, children: (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
133
|
-
fontSize: 17,
|
|
134
|
-
// The web's iOS-style action sheet: every row is the tint
|
|
135
|
-
// colour, and only a destructive one is red.
|
|
136
|
-
color: option.destructive ? theme.destructive : theme.fill,
|
|
137
|
-
}, children: option.label }) }) }, option.label))), (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "overlay", isDark: isDark, style: { borderRadius: tokens_1.radii.pill }, children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: cancelLabel, onPress: close, style: { minHeight: 44, paddingVertical: 12, alignItems: "center", justifyContent: "center" }, children: (0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 17, fontWeight: "600", color: theme.foreground }, children: cancelLabel }) }) })] }) }) }));
|
|
43
|
+
const StyleSheetAbsoluteFill = {
|
|
44
|
+
position: "absolute",
|
|
45
|
+
top: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
};
|
|
50
|
+
/** A button that owns a dialog's open state, the donor's `Dialog.Trigger`. */
|
|
51
|
+
function DialogTrigger({ label, children, ...dialog }) {
|
|
52
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { accessibilityLabel: label, onPress: () => setOpen(true), children: children ?? label }), (0, jsx_runtime_1.jsx)(Dialog, { ...dialog, open: open, onOpenChange: setOpen })] }));
|
|
138
54
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropdownMenu = DropdownMenu;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Wave 2 — DropdownMenu.
|
|
6
|
+
//
|
|
7
|
+
// The donor's menu button: a trigger that opens a menu of actions, closes on
|
|
8
|
+
// selection, on an outside press, and on Android's back gesture; the menu is a
|
|
9
|
+
// `menu` with `menuitem` rows. Dressed on the family's overlay surface, with the
|
|
10
|
+
// destructive tone the library already uses.
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const primitives_1 = require("./internal/primitives");
|
|
13
|
+
const motion_1 = require("./internal/motion");
|
|
14
|
+
const overlay_1 = require("./internal/overlay");
|
|
15
|
+
function DropdownMenu({ trigger, items, open: openProp, defaultOpen = false, onOpenChange, width = 220, accessibilityLabel = "Menu", isDark: isDarkProp, style, testID, }) {
|
|
16
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
17
|
+
const { View, Pressable } = (0, primitives_1.primitives)();
|
|
18
|
+
const [internalOpen, setInternalOpen] = (0, react_1.useState)(defaultOpen);
|
|
19
|
+
const { ref, anchor, capture } = (0, overlay_1.useTriggerAnchor)();
|
|
20
|
+
const open = openProp !== undefined ? openProp : internalOpen;
|
|
21
|
+
const setOpen = (next) => {
|
|
22
|
+
if (openProp === undefined)
|
|
23
|
+
setInternalOpen(next);
|
|
24
|
+
onOpenChange?.(next);
|
|
25
|
+
};
|
|
26
|
+
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: () => {
|
|
27
|
+
void capture();
|
|
28
|
+
setOpen(!open);
|
|
29
|
+
}, children: trigger }), (0, jsx_runtime_1.jsx)(overlay_1.OverlayPanel, { open: open, onClose: () => setOpen(false), anchor: anchor, width: width, isDark: isDark, testID: testID ? `${testID}-menu` : undefined, accessibilityLabel: accessibilityLabel, role: "menu", panelStyle: style, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(overlay_1.PanelItem, { label: item.label, icon: item.icon, destructive: item.destructive, disabled: item.disabled, role: "menuitem", isDark: isDark, onPress: () => {
|
|
30
|
+
setOpen(false);
|
|
31
|
+
item.onPress();
|
|
32
|
+
} }, `${item.label}-${index}`))) })] }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Field = Field;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Label_1 = require("./Label");
|
|
6
|
+
const tokens_1 = require("./internal/tokens");
|
|
7
|
+
const primitives_1 = require("./internal/primitives");
|
|
8
|
+
const motion_1 = require("./internal/motion");
|
|
9
|
+
/**
|
|
10
|
+
* Label, control and message stacked in the order assistive tech announces
|
|
11
|
+
* them, so a caller never has to place these three by hand.
|
|
12
|
+
*/
|
|
13
|
+
function Field({ label, description, error, required = false, disabled = false, isDark: isDarkProp, children, style, }) {
|
|
14
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
15
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
16
|
+
const { View, Text } = (0, primitives_1.primitives)();
|
|
17
|
+
const message = error ?? description;
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(View, { style: { gap: 7, ...style }, children: [label && ((0, jsx_runtime_1.jsx)(Label_1.Label, { required: required, disabled: disabled, isDark: isDark, children: label })), children, message && ((0, jsx_runtime_1.jsx)(Text, { accessibilityRole: error ? "alert" : "text", style: {
|
|
19
|
+
fontSize: 12,
|
|
20
|
+
color: error ? theme.destructive : theme.muted,
|
|
21
|
+
}, children: message }))] }));
|
|
22
|
+
}
|
package/lib/module/Glass.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Glass = void 0;
|
|
3
|
+
exports.GlassView = exports.Glass = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const GlassView_1 = require("./internal/GlassView");
|
|
@@ -9,10 +9,17 @@ const motion_1 = require("./internal/motion");
|
|
|
9
9
|
* A glass surface.
|
|
10
10
|
*
|
|
11
11
|
* Routes through the package's single switch: Apple's real `UIGlassEffect` on
|
|
12
|
-
* iOS 26+,
|
|
13
|
-
* Android
|
|
12
|
+
* iOS 26+, the engine's Metal renderer on iOS 16.4–25 and its AGSL renderer on
|
|
13
|
+
* Android 13+, Glacia's own glass fallback of identical shape elsewhere — Expo
|
|
14
|
+
* Go and below every tier. `testID` is passed to whichever surface renders.
|
|
14
15
|
*/
|
|
15
16
|
exports.Glass = (0, react_1.forwardRef)(function Glass({ effect = "regular", tintColor, interactive = false, surface, pressed, testID, style, children, isDark: isDarkProp, ...props }, ref) {
|
|
16
17
|
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
17
18
|
return ((0, jsx_runtime_1.jsx)(GlassView_1.GlassView, { ref: ref, effect: effect, tintColor: tintColor, interactive: interactive, surface: surface, pressed: pressed, testID: testID, isDark: isDark, style: style, ...props, children: children }));
|
|
18
19
|
});
|
|
20
|
+
/**
|
|
21
|
+
* The surface, under the engine's name. The public API uses Glacia names only,
|
|
22
|
+
* so the surface ships as `GlassView` alongside the Glacia `Glass` alias — both
|
|
23
|
+
* are the same component, and both are Glacia names.
|
|
24
|
+
*/
|
|
25
|
+
exports.GlassView = exports.Glass;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Group = 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 group of glass members that merge when pressed together — ported from the
|
|
13
|
+
* engine's `LiquidGlassGroup`.
|
|
14
|
+
*
|
|
15
|
+
* With a glass renderer available the engine's own control mounts, carrying the
|
|
16
|
+
* approved merge behaviour. Without one — Expo Go, below every tier, or Reduce
|
|
17
|
+
* Transparency — the fallback floor renders the same row of members with the
|
|
18
|
+
* fallback material, so the group is never invisible.
|
|
19
|
+
*/
|
|
20
|
+
exports.Group = (0, react_1.forwardRef)(function Group({ spacing = 28, gap = 12, direction = "row", metal, tint, providerId, style, children, isDark: isDarkProp, testID, ...props }, ref) {
|
|
21
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
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 EngineGroup = (0, glass_routing_1.loadEngineControl)("Group");
|
|
26
|
+
if (EngineGroup && capabilities.supported) {
|
|
27
|
+
const EngineGroupComponent = EngineGroup;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(EngineGroupComponent, { spacing: spacing, gap: gap, direction: direction, metal: metal, tint: tint, providerId: providerId, style: style, testID: testID, children: children }));
|
|
29
|
+
}
|
|
30
|
+
// Fallback floor: the members laid out with the group's resting gap.
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(View, { style: {
|
|
32
|
+
flexDirection: direction === "column" ? "column" : "row",
|
|
33
|
+
gap,
|
|
34
|
+
...style,
|
|
35
|
+
}, testID: testID, ...props, children: children }));
|
|
36
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IconButton = 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 Glass_1 = require("./Glass");
|
|
9
|
+
const tokens_1 = require("./internal/tokens");
|
|
10
|
+
const primitives_1 = require("./internal/primitives");
|
|
11
|
+
const motion_1 = require("./internal/motion");
|
|
12
|
+
const SIZES = { sm: 32, md: 38, lg: 44 };
|
|
13
|
+
/**
|
|
14
|
+
* An icon button on Glacia's glass — ported from the engine's
|
|
15
|
+
* `LiquidGlassIconButton`, which extends the engine button's design with a
|
|
16
|
+
* required accessibility label (a bare circle of glass has no text to read).
|
|
17
|
+
*/
|
|
18
|
+
exports.IconButton = (0, react_1.forwardRef)(function IconButton({ icon, onPress, disabled = false, size = "md", tint, accessibilityLabel, accessibilityState, style, isDark: isDarkProp, testID, children, }, ref) {
|
|
19
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
20
|
+
const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
21
|
+
const { Pressable, View } = (0, primitives_1.primitives)();
|
|
22
|
+
const capabilities = (0, GlassView_1.glassCapabilities)();
|
|
23
|
+
const EngineIconButton = (0, glass_routing_1.loadEngineControl)("IconButton");
|
|
24
|
+
const dimension = SIZES[size];
|
|
25
|
+
if (EngineIconButton && capabilities.supported) {
|
|
26
|
+
const EngineIconButtonComponent = EngineIconButton;
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(EngineIconButtonComponent, { ref: ref, onPress: disabled ? undefined : onPress, disabled: disabled, icon: icon, tint: tint, accessibilityLabel: accessibilityLabel, accessibilityState: { disabled, ...accessibilityState }, style: style, size: size, children: children }));
|
|
28
|
+
}
|
|
29
|
+
// Fallback floor: solid circle, full geometry, on the fallback material.
|
|
30
|
+
const radius = dimension / 2;
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "control", isDark: isDark, tintColor: tint, style: style, testID: testID, children: (0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, disabled: disabled, onPress: disabled ? undefined : onPress, style: style, children: (0, jsx_runtime_1.jsx)(View, { style: {
|
|
32
|
+
width: dimension,
|
|
33
|
+
height: dimension,
|
|
34
|
+
borderRadius: radius,
|
|
35
|
+
backgroundColor: tint ?? themeColors.fill,
|
|
36
|
+
opacity: disabled ? 0.38 : 1,
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
} }) }) }));
|
|
40
|
+
});
|
package/lib/module/Input.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Input = 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");
|
|
@@ -10,21 +12,25 @@ const motion_1 = require("./internal/motion");
|
|
|
10
12
|
const heights = { sm: 28, md: 34, lg: 44 };
|
|
11
13
|
const fontSizes = { sm: 14, md: 15, lg: 16 };
|
|
12
14
|
/**
|
|
13
|
-
* A single-line or multiline text field
|
|
15
|
+
* A single-line or multiline text field — ported from the engine's
|
|
16
|
+
* `LiquidGlassTextInput`, the design Binyam approved on real devices this week
|
|
17
|
+
* (48dp capsule, focus ring that springs in, leading/trailing slots).
|
|
14
18
|
*
|
|
15
19
|
* The native TextInput has no placeholder styling prop, so the placeholder is
|
|
16
|
-
* drawn as a sibling Text: that keeps its colour tied to the theme instead of
|
|
17
|
-
*
|
|
20
|
+
* drawn as a sibling Text: that keeps its colour tied to the theme instead of the
|
|
21
|
+
* OS default, which changes between iOS versions.
|
|
18
22
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
+
* With a glass renderer available the engine's own control mounts, carrying the
|
|
24
|
+
* approved material and focus behaviour. Without one — Expo Go, below every tier,
|
|
25
|
+
* or Reduce Transparency — the fallback floor renders the same capsule with the
|
|
26
|
+
* fallback material, so the field is never invisible and never bare text.
|
|
23
27
|
*/
|
|
24
|
-
exports.Input = (0, react_1.forwardRef)(function Input({ value, onChangeText, placeholder, invalid = false, disabled = false, secureTextEntry = false, keyboardType = "default", autoCapitalize, autoCorrect, multiline = false, minLines = 3, size = "md", accessibilityLabel, returnKeyType, onSubmitEditing, defaultValue, prefix, suffix, isDark: isDarkProp, style, testID, maxLength, editable, onFocus, onBlur, }, ref) {
|
|
28
|
+
exports.Input = (0, react_1.forwardRef)(function Input({ value, onChangeText, placeholder, invalid = false, disabled = false, secureTextEntry = false, keyboardType = "default", autoCapitalize, autoCorrect, multiline = false, minLines = 3, size = "md", accessibilityLabel, returnKeyType, onSubmitEditing, defaultValue, prefix, suffix, isDark: isDarkProp, style, testID, maxLength, editable, onFocus, onBlur, height, tint, variant = "regular", interactive = true, leading, trailing, focusRing = true, accentColor, ...props }, ref) {
|
|
25
29
|
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
26
30
|
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
27
31
|
const { View, Text, TextInput } = (0, primitives_1.primitives)();
|
|
32
|
+
const capabilities = (0, GlassView_1.glassCapabilities)();
|
|
33
|
+
const EngineInput = (0, glass_routing_1.loadEngineControl)("Input");
|
|
28
34
|
// Uncontrolled support: with no `value` prop the field owns its text.
|
|
29
35
|
const [internalText, setInternalText] = (0, react_1.useState)(defaultValue ?? "");
|
|
30
36
|
const text = value !== undefined ? value : internalText;
|
|
@@ -35,6 +41,7 @@ exports.Input = (0, react_1.forwardRef)(function Input({ value, onChangeText, pl
|
|
|
35
41
|
};
|
|
36
42
|
const isEditable = editable !== undefined ? editable : !disabled;
|
|
37
43
|
const showPlaceholder = !text && Boolean(placeholder);
|
|
44
|
+
const resolvedHeight = height ?? heights[size];
|
|
38
45
|
const fieldStyle = {
|
|
39
46
|
flex: 1,
|
|
40
47
|
paddingVertical: multiline ? 0 : height_padding(size),
|
|
@@ -42,37 +49,35 @@ exports.Input = (0, react_1.forwardRef)(function Input({ value, onChangeText, pl
|
|
|
42
49
|
fontSize: fontSizes[size],
|
|
43
50
|
color: theme.foreground,
|
|
44
51
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
// ------------------------------------------------------------------
|
|
53
|
+
// Fallback floor: the same capsule with the fallback material underneath.
|
|
54
|
+
// ------------------------------------------------------------------
|
|
55
|
+
if (!(EngineInput && capabilities.supported)) {
|
|
56
|
+
const { View, Text, TextInput } = (0, primitives_1.primitives)();
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: variant, surface: "field", isDark: isDark, style: {
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
alignItems: multiline ? "flex-start" : "center",
|
|
60
|
+
gap: 8,
|
|
61
|
+
borderRadius: multiline ? tokens_1.radii.xl : tokens_1.radii.pill,
|
|
62
|
+
minHeight: multiline ? 84 : resolvedHeight,
|
|
63
|
+
paddingHorizontal: 14,
|
|
64
|
+
paddingVertical: multiline ? 10 : 0,
|
|
65
|
+
borderColor: invalid ? theme.destructive : undefined,
|
|
66
|
+
opacity: disabled ? 0.5 : 1,
|
|
67
|
+
...style,
|
|
68
|
+
}, testID: testID, children: [prefix, (0, jsx_runtime_1.jsxs)(View, { style: { flex: 1, justifyContent: "center" }, children: [showPlaceholder && ((0, jsx_runtime_1.jsx)(Text, { style: {
|
|
69
|
+
position: "absolute",
|
|
70
|
+
left: 0,
|
|
71
|
+
top: multiline ? 0 : undefined,
|
|
72
|
+
fontSize: fontSizes[size],
|
|
73
|
+
color: theme.muted,
|
|
74
|
+
}, pointerEvents: "none", numberOfLines: 1, children: placeholder })), (0, jsx_runtime_1.jsx)(TextInput, { ref: ref, testID: testID, value: text, onChangeText: handleChangeText, editable: isEditable, secureTextEntry: secureTextEntry, keyboardType: keyboardType, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, multiline: multiline, numberOfLines: multiline ? minLines : undefined, maxLength: maxLength, returnKeyType: returnKeyType, onSubmitEditing: onSubmitEditing, onFocus: onFocus, onBlur: onBlur, accessibilityLabel: accessibilityLabel ?? placeholder, accessibilityState: { disabled: !isEditable }, style: fieldStyle })] }), trailing] }));
|
|
75
|
+
}
|
|
76
|
+
const EngineInputComponent = EngineInput;
|
|
77
|
+
const capsuleHeight = resolvedHeight;
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(EngineInputComponent, { value: value, defaultValue: defaultValue, onChangeText: handleChangeText, placeholder: placeholder, invalid: invalid, disabled: disabled, secureTextEntry: secureTextEntry, keyboardType: keyboardType, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, multiline: multiline, minLines: minLines, size: size, accessibilityLabel: accessibilityLabel, returnKeyType: returnKeyType, onSubmitEditing: onSubmitEditing, onFocus: onFocus, onBlur: onBlur, maxLength: maxLength, editable: isEditable, height: capsuleHeight, tint: tint, variant: variant, interactive: interactive, leading: leading, trailing: trailing, focusRing: focusRing, accentColor: accentColor, style: style, contentStyle: undefined, inputStyle: fieldStyle, testID: testID }));
|
|
65
79
|
});
|
|
66
80
|
/** Vertical padding tuned per size so the text sits optically centred. */
|
|
67
81
|
function height_padding(size) {
|
|
68
82
|
return size === "sm" ? 4 : size === "lg" ? 10 : 7;
|
|
69
83
|
}
|
|
70
|
-
/**
|
|
71
|
-
* A multi-line field.
|
|
72
|
-
*
|
|
73
|
-
* Separate from Input so `multiline` cannot silently turn off the single-line
|
|
74
|
-
* sizing, and so callers get a `rows` prop instead of guessing a pixel height.
|
|
75
|
-
*/
|
|
76
|
-
exports.Textarea = (0, react_1.forwardRef)(function Textarea({ rows = 4, ...props }, ref) {
|
|
77
|
-
return (0, jsx_runtime_1.jsx)(exports.Input, { ref: ref, ...props, multiline: true, minLines: rows });
|
|
78
|
-
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Label = Label;
|
|
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 Label({ children, required = false, disabled = false, nativeID, 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 { Text: RNText } = (0, primitives_1.primitives)();
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(RNText, { testID: testID, nativeID: nativeID, accessibilityRole: "text", accessibilityState: { disabled }, style: [
|
|
13
|
+
tokens_1.typeScale.label,
|
|
14
|
+
{ color: disabled ? theme.muted : theme.foreground },
|
|
15
|
+
style,
|
|
16
|
+
], ...{ "aria-required": required }, children: [children, required ? (0, jsx_runtime_1.jsx)(RNText, { style: { color: theme.destructive }, children: " *" }) : null] }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MorphGroup = 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 haptics_1 = require("./internal/haptics");
|
|
11
|
+
const motion_1 = require("./internal/motion");
|
|
12
|
+
/**
|
|
13
|
+
* A morphing group of capsules — ported from the engine's
|
|
14
|
+
* `LiquidGlassMorphGroup`, the design Binyam approved on real devices this week
|
|
15
|
+
* (capsules fuse when dragged together, spring home on release).
|
|
16
|
+
*
|
|
17
|
+
* With a glass renderer available the engine's own control mounts, carrying the
|
|
18
|
+
* approved morph behaviour. Without one — Expo Go, below every tier, or Reduce
|
|
19
|
+
* Transparency — the fallback floor renders the same capsules with solid
|
|
20
|
+
* surfaces, so the group is never invisible.
|
|
21
|
+
*/
|
|
22
|
+
exports.MorphGroup = (0, react_1.forwardRef)(function MorphGroup({ items, onMerge, onItemPress, spacing = 28, gap = 12, height = 48, tint, variant = "regular", metal, providerId, style, textStyle, ...props }, ref) {
|
|
23
|
+
const isDark = (0, motion_1.useIsDark)();
|
|
24
|
+
const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
25
|
+
const { View, Pressable, Text: RNText } = (0, primitives_1.primitives)();
|
|
26
|
+
const capabilities = (0, GlassView_1.glassCapabilities)();
|
|
27
|
+
const EngineMorphGroup = (0, glass_routing_1.loadEngineControl)("MorphGroup");
|
|
28
|
+
const capsules = items.map((item) => ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "button", accessibilityLabel: item.label ?? item.key, disabled: !item.onPress, onPress: () => {
|
|
29
|
+
(0, haptics_1.hapticSelection)();
|
|
30
|
+
item.onPress?.();
|
|
31
|
+
onItemPress?.(item.key);
|
|
32
|
+
}, style: {
|
|
33
|
+
height,
|
|
34
|
+
borderRadius: height / 2,
|
|
35
|
+
backgroundColor: themeColors.fill,
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
paddingHorizontal: 16,
|
|
39
|
+
...style,
|
|
40
|
+
}, children: [item.icon, item.label ? (0, jsx_runtime_1.jsx)(RNText, { style: [textStyle, { fontSize: 15, fontWeight: "600" }], children: item.label }) : null] }, item.key)));
|
|
41
|
+
if (EngineMorphGroup && capabilities.supported) {
|
|
42
|
+
const EngineMorphGroupComponent = EngineMorphGroup;
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(EngineMorphGroupComponent, { items: items, onMerge: onMerge, onItemPress: onItemPress, spacing: spacing, gap: gap, height: height, tint: tint, variant: variant, metal: metal, providerId: providerId, style: style, textStyle: textStyle }));
|
|
44
|
+
}
|
|
45
|
+
// Fallback floor: the same capsules, solid, in the same row.
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(View, { style: { flexDirection: "row", gap, ...style }, testID: undefined, ...props, children: capsules }));
|
|
47
|
+
});
|