glacia-native 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -4
- package/README.md +111 -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 -267
- package/lib/module/Button.js +57 -36
- package/lib/module/Card.js +32 -20
- 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 -124
- package/lib/module/DropdownMenu.js +33 -0
- package/lib/module/Field.js +22 -0
- package/lib/module/Glass.js +12 -5
- package/lib/module/Group.js +36 -0
- package/lib/module/IconButton.js +40 -0
- package/lib/module/Input.js +47 -40
- 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 +74 -58
- 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 +60 -40
- package/lib/module/Stepper.js +167 -0
- package/lib/module/Switch.js +45 -43
- package/lib/module/TabBar.js +62 -50
- package/lib/module/Tabs.js +3 -2
- 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 +45 -13
- 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 +75 -0
- package/lib/module/internal/fallback.js +110 -20
- package/lib/module/internal/glass-routing.js +154 -30
- package/lib/module/internal/glow.js +36 -0
- package/lib/module/internal/initials.js +12 -0
- package/lib/module/internal/lens.js +70 -0
- package/lib/module/internal/material.js +64 -0
- package/lib/module/internal/overlay.js +147 -0
- package/lib/module/internal/primitives.js +17 -0
- package/lib/module/internal/rim.js +35 -0
- package/lib/module/internal/tokens.js +34 -2
- 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 +39 -17
- package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
- package/lib/typescript/internal/GlassView.d.ts +31 -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/blur.d.ts +24 -0
- package/lib/typescript/internal/fallback.d.ts +27 -2
- package/lib/typescript/internal/glass-routing.d.ts +83 -15
- package/lib/typescript/internal/glow.d.ts +11 -0
- package/lib/typescript/internal/initials.d.ts +2 -0
- package/lib/typescript/internal/lens.d.ts +47 -0
- package/lib/typescript/internal/material.d.ts +27 -0
- package/lib/typescript/internal/overlay.d.ts +74 -0
- package/lib/typescript/internal/primitives.d.ts +13 -0
- package/lib/typescript/internal/rim.d.ts +16 -0
- package/lib/typescript/internal/tokens.d.ts +36 -0
- package/package.json +15 -4
- 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 -797
- package/src/Button.tsx +196 -60
- package/src/Card.tsx +106 -33
- 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 +86 -325
- package/src/DropdownMenu.tsx +103 -0
- package/src/Field.tsx +65 -0
- package/src/Glass.tsx +19 -5
- package/src/Group.tsx +98 -0
- package/src/IconButton.tsx +110 -0
- package/src/Input.tsx +143 -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 +147 -90
- 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 +100 -54
- package/src/Stepper.tsx +315 -0
- package/src/Switch.tsx +80 -58
- package/src/TabBar.tsx +118 -84
- package/src/Tabs.tsx +5 -0
- 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 +48 -190
- package/src/internal/GlassBackdrop.tsx +60 -0
- package/src/internal/GlassView.tsx +70 -18
- package/src/internal/blur-community.ts +19 -0
- package/src/internal/blur-community.web.ts +7 -0
- package/src/internal/blur.ts +89 -0
- package/src/internal/fallback.tsx +158 -20
- package/src/internal/glass-routing.ts +211 -34
- package/src/internal/glow.tsx +62 -0
- package/src/internal/initials.ts +7 -0
- package/src/internal/lens.tsx +105 -0
- package/src/internal/material.ts +92 -0
- package/src/internal/overlay.tsx +258 -0
- package/src/internal/primitives.ts +26 -0
- package/src/internal/rim.tsx +79 -0
- package/src/internal/tokens.ts +34 -1
- package/lib/module/Carousel.js +0 -103
- package/lib/module/Display.js +0 -317
- package/lib/module/Feedback.js +0 -386
- package/lib/module/Form.js +0 -164
- package/lib/module/Forms2.js +0 -454
- package/lib/module/Message.js +0 -88
- package/lib/module/Overlays.js +0 -328
- package/lib/module/Pickers.js +0 -243
- package/lib/module/Table.js +0 -99
- package/lib/module/ai.js +0 -280
- package/lib/module/charts/AreaChart.js +0 -32
- package/lib/module/charts/BarChart.js +0 -67
- 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 -71
- 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 -778
- package/src/Feedback.tsx +0 -969
- package/src/Form.tsx +0 -425
- package/src/Forms2.tsx +0 -1014
- package/src/Message.tsx +0 -219
- package/src/Overlays.tsx +0 -685
- package/src/Pickers.tsx +0 -590
- package/src/Table.tsx +0 -231
- package/src/ai.tsx +0 -707
- package/src/charts/AreaChart.tsx +0 -73
- package/src/charts/BarChart.tsx +0 -183
- 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,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lensFill = void 0;
|
|
4
|
+
exports.lensShadow = lensShadow;
|
|
5
|
+
exports.LensRim = LensRim;
|
|
6
|
+
exports.SelectedLens = SelectedLens;
|
|
7
|
+
exports.rowLensStyle = rowLensStyle;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const tokens_1 = require("./tokens");
|
|
10
|
+
const primitives_1 = require("./primitives");
|
|
11
|
+
const rim_1 = require("./rim");
|
|
12
|
+
const fill = { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 };
|
|
13
|
+
/**
|
|
14
|
+
* How far a lens sits above its row.
|
|
15
|
+
*
|
|
16
|
+
* Shallower than a panel's shadow: a lens is inside a surface that already
|
|
17
|
+
* floats, so it needs contact, not altitude.
|
|
18
|
+
*/
|
|
19
|
+
function lensShadow(isDark) {
|
|
20
|
+
return {
|
|
21
|
+
shadowColor: tokens_1.material.shadowColor,
|
|
22
|
+
shadowOpacity: isDark ? 0 : 0.1,
|
|
23
|
+
shadowRadius: 8,
|
|
24
|
+
shadowOffset: { width: 0, height: 2 },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The rim of a lens, on its own.
|
|
29
|
+
*
|
|
30
|
+
* For indicators that are already animated views and cannot become a
|
|
31
|
+
* `SelectedLens`: they keep their own transform, and this paints the light on
|
|
32
|
+
* top of whatever tint they already have.
|
|
33
|
+
*/
|
|
34
|
+
function LensRim({ radius, isDark }) {
|
|
35
|
+
const { View } = (0, primitives_1.primitives)();
|
|
36
|
+
const rim = (isDark ? tokens_1.material.rim.dark : tokens_1.material.rim.light) * 0.66;
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(View, { style: { ...fill, overflow: "hidden", borderRadius: radius }, pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(rim_1.GlassRim, { radius: radius, rim: rim, highlight: tokens_1.material.highlight * 0.7 }) }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A selected state, drawn as the web's lens.
|
|
41
|
+
*
|
|
42
|
+
* Rendered as an absolutely positioned overlay so it never changes the layout
|
|
43
|
+
* of the row it marks: parents keep their padding and press handling, and the
|
|
44
|
+
* content paints above it by sibling order.
|
|
45
|
+
*/
|
|
46
|
+
function SelectedLens({ radius, isDark, style, children, testID }) {
|
|
47
|
+
const { View } = (0, primitives_1.primitives)();
|
|
48
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(View, { testID: testID, pointerEvents: "none", style: [
|
|
50
|
+
{
|
|
51
|
+
borderRadius: radius,
|
|
52
|
+
backgroundColor: theme.glassActive,
|
|
53
|
+
...lensShadow(isDark),
|
|
54
|
+
},
|
|
55
|
+
style,
|
|
56
|
+
], children: [(0, jsx_runtime_1.jsx)(LensRim, { radius: radius, isDark: isDark }), children] }));
|
|
57
|
+
}
|
|
58
|
+
/** The lens overlay for a row: inset from the panel's edges, full width inside. */
|
|
59
|
+
function rowLensStyle(radius, inset = 6) {
|
|
60
|
+
return {
|
|
61
|
+
position: "absolute",
|
|
62
|
+
top: 2,
|
|
63
|
+
bottom: 2,
|
|
64
|
+
left: inset,
|
|
65
|
+
right: inset,
|
|
66
|
+
borderRadius: radius,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** A pill lens filling its own box, for indicators pinned to a control. */
|
|
70
|
+
exports.lensFill = { ...fill, borderRadius: tokens_1.radii.pill };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The fallback's material recipe — the web engine's surface profiles, in
|
|
3
|
+
// React Native terms.
|
|
4
|
+
//
|
|
5
|
+
// The web fits a different lens per component family (panel, control, field,
|
|
6
|
+
// overlay, hint, rail). The fallback had a single flat surface for all of
|
|
7
|
+
// them, which is why a dialog and a badge looked identical. This module turns
|
|
8
|
+
// each profile into the numbers the layered fallback needs: how strongly the
|
|
9
|
+
// backdrop is blurred, how bright the rim is, how much light sits inside the
|
|
10
|
+
// top edge, and whether the surface is lifted by a shadow.
|
|
11
|
+
//
|
|
12
|
+
// Nothing here renders. It is a table plus one resolver, so the fallback
|
|
13
|
+
// component stays a layout and the profiles stay reviewable against the web.
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.materialFor = materialFor;
|
|
16
|
+
exports.isFlatProfile = isFlatProfile;
|
|
17
|
+
const tokens_1 = require("./tokens");
|
|
18
|
+
/**
|
|
19
|
+
* The web profile values this mapping is derived from.
|
|
20
|
+
*
|
|
21
|
+
* Kept in the same order and with the same names as the engine's table so the
|
|
22
|
+
* two can be diffed by eye: bend drives the blur strength, depth the inner
|
|
23
|
+
* highlight, and dome the rim brightness (the dome is the part of the lens
|
|
24
|
+
* that catches the light).
|
|
25
|
+
*/
|
|
26
|
+
const webProfiles = {
|
|
27
|
+
panel: { bend: 0.45, depth: 0.25, dome: 0.5 },
|
|
28
|
+
control: { bend: 0.55, depth: 0.3, dome: 0.6 },
|
|
29
|
+
field: { bend: 0.35, depth: 0.2, dome: 0.34 },
|
|
30
|
+
overlay: { bend: 0.5, depth: 0.34, dome: 0.66 },
|
|
31
|
+
hint: { bend: 0.28, depth: 0.22, dome: 0.3 },
|
|
32
|
+
rail: { bend: 0.4, depth: 0.22, dome: 0.4 },
|
|
33
|
+
};
|
|
34
|
+
/** The reference profile: the panel is the base lens the others scale from. */
|
|
35
|
+
const BASE_BLUR = 24;
|
|
36
|
+
const BASE_DOME = webProfiles.panel.dome;
|
|
37
|
+
const BASE_DEPTH = webProfiles.panel.depth;
|
|
38
|
+
/**
|
|
39
|
+
* The material for one surface.
|
|
40
|
+
*
|
|
41
|
+
* The `clear` effect is the same stack with a thinner lens — less blur and a
|
|
42
|
+
* fainter rim — which is what the web means by clear. Reduce Transparency is
|
|
43
|
+
* handled before this call: it replaces the whole stack with a solid colour.
|
|
44
|
+
*/
|
|
45
|
+
function materialFor(profile = "panel", effect = "regular", isDark = false) {
|
|
46
|
+
const lens = webProfiles[profile];
|
|
47
|
+
const thin = effect === "clear" ? 0.55 : 1;
|
|
48
|
+
const rimBase = isDark ? tokens_1.material.rim.dark : tokens_1.material.rim.light;
|
|
49
|
+
return {
|
|
50
|
+
blur: Math.round(BASE_BLUR * (lens.bend / webProfiles.panel.bend) * thin),
|
|
51
|
+
rim: rimBase * (lens.dome / BASE_DOME) * thin,
|
|
52
|
+
highlight: tokens_1.material.highlight * (lens.depth / BASE_DEPTH) * thin,
|
|
53
|
+
// The web drops every surface by 1px; overlays carry their own, deeper
|
|
54
|
+
// shadow from the component's style, which the fallback prefers when set.
|
|
55
|
+
shadowOpacity: isDark ? 0 : tokens_1.material.shadowOpacity.light,
|
|
56
|
+
shadowRadius: 3,
|
|
57
|
+
shadowOffsetY: 1,
|
|
58
|
+
elevation: isDark ? 0 : 1,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Whether a surface is a shadowed one at all (the hint family sits flat). */
|
|
62
|
+
function isFlatProfile(profile) {
|
|
63
|
+
return profile === "hint";
|
|
64
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useControllable = useControllable;
|
|
4
|
+
exports.useBackDismiss = useBackDismiss;
|
|
5
|
+
exports.measureAnchor = measureAnchor;
|
|
6
|
+
exports.placePanel = placePanel;
|
|
7
|
+
exports.OverlayPanel = OverlayPanel;
|
|
8
|
+
exports.PanelItem = PanelItem;
|
|
9
|
+
exports.useTriggerAnchor = useTriggerAnchor;
|
|
10
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
// The invisible behaviour every Wave 2 component shares.
|
|
12
|
+
//
|
|
13
|
+
// These are the donor's contracts, implemented on React Native's own
|
|
14
|
+
// primitives: a component can be controlled or keep its own state, overlays
|
|
15
|
+
// dismiss on Android's back gesture and on an outside press, and every control
|
|
16
|
+
// exposes the accessibility role the donor gives it (checkbox, radio, tab,
|
|
17
|
+
// dialog, menu). Nothing here styles anything — the Apple dress lives in the
|
|
18
|
+
// component files.
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const Glass_1 = require("../Glass");
|
|
21
|
+
const tokens_1 = require("./tokens");
|
|
22
|
+
const primitives_1 = require("./primitives");
|
|
23
|
+
const motion_1 = require("./motion");
|
|
24
|
+
/**
|
|
25
|
+
* Controlled-or-uncontrolled state. The donor's model: a `value` prop makes the
|
|
26
|
+
* component controlled, `defaultValue` seeds it, and `onChange` is called either
|
|
27
|
+
* way. Kept in one place so every component behaves identically.
|
|
28
|
+
*/
|
|
29
|
+
function useControllable(value, defaultValue, onChange) {
|
|
30
|
+
const [internal, setInternal] = (0, react_1.useState)(defaultValue);
|
|
31
|
+
const current = value !== undefined ? value : internal;
|
|
32
|
+
const set = (0, react_1.useCallback)((next) => {
|
|
33
|
+
if (value === undefined)
|
|
34
|
+
setInternal(next);
|
|
35
|
+
onChange?.(next);
|
|
36
|
+
}, [value, onChange]);
|
|
37
|
+
return [current, set];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Registers Android's hardware back while an overlay is open, so back closes the
|
|
41
|
+
* layer and not the screen behind it.
|
|
42
|
+
*/
|
|
43
|
+
function useBackDismiss(open, dismiss) {
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
45
|
+
if (!open)
|
|
46
|
+
return;
|
|
47
|
+
const BackHandler = (0, primitives_1.primitives)().getBackHandler();
|
|
48
|
+
if (!BackHandler?.addEventListener)
|
|
49
|
+
return;
|
|
50
|
+
const sub = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
51
|
+
dismiss();
|
|
52
|
+
return true;
|
|
53
|
+
});
|
|
54
|
+
return () => sub?.remove?.();
|
|
55
|
+
}, [open, dismiss]);
|
|
56
|
+
}
|
|
57
|
+
/** Reads a view's rectangle in window coordinates, when the runtime can. */
|
|
58
|
+
function measureAnchor(node) {
|
|
59
|
+
return new Promise((resolve) => {
|
|
60
|
+
if (!node || typeof node.measureInWindow !== "function") {
|
|
61
|
+
resolve(null);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
node.measureInWindow((x, y, width, height) => {
|
|
66
|
+
resolve({ x, y, width, height });
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
resolve(null);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Places a panel beside its trigger. Flips above when there is no room below,
|
|
76
|
+
* and clamps to the viewport otherwise — the donor's collision handling, kept
|
|
77
|
+
* deliberately small.
|
|
78
|
+
*/
|
|
79
|
+
function placePanel(trigger, panel, viewport, gap = 6) {
|
|
80
|
+
const below = trigger.y + trigger.height + gap;
|
|
81
|
+
const above = trigger.y - panel.height - gap;
|
|
82
|
+
const fitsBelow = below + panel.height <= viewport.height;
|
|
83
|
+
const flipped = !fitsBelow && above >= 0;
|
|
84
|
+
const top = Math.max(8, Math.min(flipped ? above : below, viewport.height - panel.height - 8));
|
|
85
|
+
const left = Math.max(8, Math.min(trigger.x, viewport.width - panel.width - 8));
|
|
86
|
+
return { left, top, flipped };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A full-screen modal layer with a dimmed backdrop and a glass panel. Used by
|
|
90
|
+
* Dialog, Alert, AlertDialog, Popover, DropdownMenu, ContextMenu, Select and
|
|
91
|
+
* Tooltip, so dismissal, back handling and the surface are one implementation.
|
|
92
|
+
*/
|
|
93
|
+
function OverlayPanel({ open, onClose, dismissOnBackdropPress = true, anchor, width, panelStyle, children, testID, isDark: isDarkProp, accessibilityLabel, role = "menu", }) {
|
|
94
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
95
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
96
|
+
const { View, Pressable, Modal, useWindowDimensions } = (0, primitives_1.primitives)();
|
|
97
|
+
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
|
|
98
|
+
useBackDismiss(open, onClose);
|
|
99
|
+
if (!open)
|
|
100
|
+
return null;
|
|
101
|
+
const placed = anchor ? placePanel(anchor, { width: width ?? 240, height: 0 }, { width: screenWidth, height: screenHeight }) : null;
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(Modal, { visible: true, transparent: true, animationType: "fade", onRequestClose: onClose, children: (0, jsx_runtime_1.jsxs)(View, { style: { flex: 1, backgroundColor: theme.scrim }, children: [(0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: dismissOnBackdropPress ? "Close" : undefined, onPress: dismissOnBackdropPress ? onClose : undefined, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 } }), (0, jsx_runtime_1.jsx)(View, { pointerEvents: "box-none", style: placed ? { position: "absolute", left: placed.left, top: placed.top } : { flex: 1, alignItems: "center", justifyContent: "center", padding: 24 }, children: (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "none", onPress: () => { }, children: (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "overlay", isDark: isDark, testID: testID, accessibilityLabel: accessibilityLabel, accessibilityRole: role, style: [
|
|
103
|
+
{
|
|
104
|
+
width: placed ? width ?? 240 : undefined,
|
|
105
|
+
maxWidth: screenWidth - 32,
|
|
106
|
+
borderRadius: tokens_1.radii.lg,
|
|
107
|
+
backgroundColor: theme.surface,
|
|
108
|
+
paddingVertical: 6,
|
|
109
|
+
},
|
|
110
|
+
panelStyle,
|
|
111
|
+
], children: children }) }) })] }) }));
|
|
112
|
+
}
|
|
113
|
+
/** One row inside an overlay panel — the donor's menu/option item. */
|
|
114
|
+
function PanelItem({ label, onPress, icon, destructive = false, selected = false, disabled = false, role = "button", style, testID, isDark: isDarkProp, }) {
|
|
115
|
+
const isDark = (0, motion_1.useIsDark)(isDarkProp);
|
|
116
|
+
const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
|
|
117
|
+
const { View, Pressable, Text: RNText } = (0, primitives_1.primitives)();
|
|
118
|
+
return ((0, jsx_runtime_1.jsxs)(Pressable, { testID: testID, accessibilityRole: role, accessibilityLabel: label, accessibilityState: { disabled, selected }, disabled: disabled, onPress: onPress, style: [
|
|
119
|
+
{
|
|
120
|
+
flexDirection: "row",
|
|
121
|
+
alignItems: "center",
|
|
122
|
+
gap: 10,
|
|
123
|
+
minHeight: 40,
|
|
124
|
+
paddingHorizontal: 14,
|
|
125
|
+
paddingVertical: 8,
|
|
126
|
+
opacity: disabled ? 0.38 : 1,
|
|
127
|
+
},
|
|
128
|
+
style,
|
|
129
|
+
], children: [icon ? (0, jsx_runtime_1.jsx)(View, { children: icon }) : null, (0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
fontSize: 15,
|
|
132
|
+
color: destructive ? theme.destructive : theme.foreground,
|
|
133
|
+
fontWeight: selected ? "600" : "400",
|
|
134
|
+
}, children: label }), selected ? (0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 15, color: theme.fill }, children: "\u2713" }) : null] }));
|
|
135
|
+
}
|
|
136
|
+
/** A positioned trigger that reports its window rectangle when it is pressed. */
|
|
137
|
+
function useTriggerAnchor() {
|
|
138
|
+
const ref = (0, react_1.useRef)(null);
|
|
139
|
+
const [anchor, setAnchor] = (0, react_1.useState)(null);
|
|
140
|
+
const capture = (0, react_1.useCallback)(async () => {
|
|
141
|
+
const rect = await measureAnchor(ref.current);
|
|
142
|
+
if (rect)
|
|
143
|
+
setAnchor(rect);
|
|
144
|
+
return rect;
|
|
145
|
+
}, []);
|
|
146
|
+
return { ref, anchor, capture };
|
|
147
|
+
}
|
|
@@ -77,6 +77,15 @@ function resolve() {
|
|
|
77
77
|
slider: "slider",
|
|
78
78
|
adjustable: "slider",
|
|
79
79
|
heading: "heading",
|
|
80
|
+
option: "option",
|
|
81
|
+
listbox: "listbox",
|
|
82
|
+
menu: "menu",
|
|
83
|
+
menuitem: "menuitem",
|
|
84
|
+
dialog: "dialog",
|
|
85
|
+
alertdialog: "alertdialog",
|
|
86
|
+
group: "group",
|
|
87
|
+
toolbar: "toolbar",
|
|
88
|
+
separator: "separator",
|
|
80
89
|
};
|
|
81
90
|
// "none" means presentational: emit no role rather than a misleading one.
|
|
82
91
|
if (accessibilityRole && accessibilityRole !== "none") {
|
|
@@ -215,6 +224,7 @@ function resolve() {
|
|
|
215
224
|
Polygon: svg?.Polygon ?? fallback("polygon"),
|
|
216
225
|
Defs: svg?.Defs ?? fallback("defs"),
|
|
217
226
|
LinearGradient: svg?.LinearGradient ?? fallback("linearGradient"),
|
|
227
|
+
RadialGradient: svg?.RadialGradient ?? fallback("radialGradient"),
|
|
218
228
|
Stop: svg?.Stop ?? fallback("stop"),
|
|
219
229
|
ClipPath: svg?.ClipPath ?? fallback("clipPath"),
|
|
220
230
|
// TextInput is not an SVG primitive, but resolving it here keeps every
|
|
@@ -246,6 +256,13 @@ function resolve() {
|
|
|
246
256
|
const view = typeof globalThis !== "undefined" ? globalThis.window : undefined;
|
|
247
257
|
return { width: view?.innerWidth ?? 390, height: view?.innerHeight ?? 800 };
|
|
248
258
|
}),
|
|
259
|
+
useSafeAreaInsets: rn?.useSafeAreaInsets ??
|
|
260
|
+
(() => ({
|
|
261
|
+
top: 0,
|
|
262
|
+
bottom: 0,
|
|
263
|
+
left: 0,
|
|
264
|
+
right: 0,
|
|
265
|
+
})),
|
|
249
266
|
};
|
|
250
267
|
}
|
|
251
268
|
/**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlassRim = GlassRim;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// The painted rim: light caught on the curved edge of a glass surface.
|
|
6
|
+
//
|
|
7
|
+
// This is the layer that makes a rounded corner *read* as rounded. The web
|
|
8
|
+
// engine paints a rim gradient into every glass element (brightest along the
|
|
9
|
+
// top edge, fading down the sides, nearly gone at the bottom), plus a soft
|
|
10
|
+
// highlight just inside the top. The fallback only had a uniform 8% edge line,
|
|
11
|
+
// which is why the owner described the corners as "not fully curved".
|
|
12
|
+
//
|
|
13
|
+
// Drawn in SVG because that is what the package already uses for its charts
|
|
14
|
+
// and share the same resolver: no new native dependency, and it works
|
|
15
|
+
// identically on iOS and Android.
|
|
16
|
+
const react_1 = require("react");
|
|
17
|
+
const primitives_1 = require("./primitives");
|
|
18
|
+
const tokens_1 = require("./tokens");
|
|
19
|
+
const fill = { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 };
|
|
20
|
+
/**
|
|
21
|
+
* The rim light and top highlight of one surface.
|
|
22
|
+
*
|
|
23
|
+
* Both are stacked stops of a vertical gradient in the same colour: the eye
|
|
24
|
+
* reads the brightest edge as a lit curve and the falloff as the curve turning
|
|
25
|
+
* away from the light.
|
|
26
|
+
*/
|
|
27
|
+
function GlassRim({ radius, rim, highlight }) {
|
|
28
|
+
const { Svg, Defs, Rect, LinearGradient, Stop } = (0, primitives_1.primitives)();
|
|
29
|
+
const key = (0, react_1.useId)().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
30
|
+
const rimId = `rim-${key}`;
|
|
31
|
+
const highlightId = `top-${key}`;
|
|
32
|
+
// SVG clamps rx/ry to half the side, so a pill radius simply becomes a pill.
|
|
33
|
+
const rx = Math.max(0, radius - 0.5);
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(Svg, { width: "100%", height: "100%", style: fill, pointerEvents: "none", children: [(0, jsx_runtime_1.jsxs)(Defs, { children: [(0, jsx_runtime_1.jsxs)(LinearGradient, { id: rimId, x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)(Stop, { offset: "0", stopColor: tokens_1.material.rimColor, stopOpacity: rim }), (0, jsx_runtime_1.jsx)(Stop, { offset: "0.55", stopColor: tokens_1.material.rimColor, stopOpacity: rim * 0.35 }), (0, jsx_runtime_1.jsx)(Stop, { offset: "1", stopColor: tokens_1.material.rimColor, stopOpacity: rim * 0.08 })] }), (0, jsx_runtime_1.jsxs)(LinearGradient, { id: highlightId, x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)(Stop, { offset: "0", stopColor: tokens_1.material.rimColor, stopOpacity: highlight }), (0, jsx_runtime_1.jsx)(Stop, { offset: "1", stopColor: tokens_1.material.rimColor, stopOpacity: 0 })] })] }), (0, jsx_runtime_1.jsx)(Rect, { x: 0.5, y: 0.5, width: "99%", height: "99%", rx: rx, ry: rx, fill: "none", stroke: `url(#${rimId})`, strokeWidth: 1 }), (0, jsx_runtime_1.jsx)(Rect, { x: 1, y: 1, width: "98%", height: "40%", rx: Math.max(0, rx - 1), ry: Math.max(0, rx - 1), fill: `url(#${highlightId})` })] }));
|
|
35
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colors = exports.controlSizes = exports.palette = exports.typeScale = exports.springs = exports.radii = void 0;
|
|
3
|
+
exports.material = exports.colors = exports.controlSizes = exports.palette = exports.typeScale = exports.springs = exports.radii = void 0;
|
|
4
4
|
exports.toneColor = toneColor;
|
|
5
5
|
const glacia_tokens_1 = require("glacia-tokens");
|
|
6
6
|
exports.radii = {
|
|
@@ -8,6 +8,7 @@ exports.radii = {
|
|
|
8
8
|
md: glacia_tokens_1.radii.md.number,
|
|
9
9
|
lg: glacia_tokens_1.radii.lg.number,
|
|
10
10
|
xl: glacia_tokens_1.radii.xl.number,
|
|
11
|
+
stack: glacia_tokens_1.radii.stack.number,
|
|
11
12
|
pill: glacia_tokens_1.radii.pill.number,
|
|
12
13
|
};
|
|
13
14
|
exports.springs = {
|
|
@@ -69,8 +70,16 @@ exports.colors = {
|
|
|
69
70
|
muted: "#3C3C4399",
|
|
70
71
|
glass: "rgba(255, 255, 255, 0.6)",
|
|
71
72
|
glassActive: "rgba(236, 236, 240, 0.85)",
|
|
73
|
+
/**
|
|
74
|
+
* The near-solid surface the web uses where legibility beats translucency:
|
|
75
|
+
* menus and toggle groups. A glass surface underneath text that must be
|
|
76
|
+
* read at a glance is the one place the web deliberately goes opaque-ish.
|
|
77
|
+
*/
|
|
78
|
+
surface: "rgba(255, 255, 255, 0.86)",
|
|
72
79
|
edge: "rgba(0, 0, 0, 0.08)",
|
|
73
|
-
separator:
|
|
80
|
+
// The agreed separator value: the web CSS one (0.15 / 0.16 dark), so the
|
|
81
|
+
// three files that carried three different light values now agree.
|
|
82
|
+
separator: "rgba(60, 60, 67, 0.15)",
|
|
74
83
|
fill: "#0088FF",
|
|
75
84
|
destructive: "#FF3B30",
|
|
76
85
|
on: "#34C759",
|
|
@@ -103,6 +112,7 @@ exports.colors = {
|
|
|
103
112
|
muted: "#EBEBF599",
|
|
104
113
|
glass: "rgba(40, 40, 40, 0.62)",
|
|
105
114
|
glassActive: "rgba(70, 70, 70, 0.62)",
|
|
115
|
+
surface: "rgba(40, 40, 40, 0.86)",
|
|
106
116
|
edge: "rgba(255, 255, 255, 0.08)",
|
|
107
117
|
separator: "rgba(235, 235, 245, 0.16)",
|
|
108
118
|
fill: "#0091FF",
|
|
@@ -121,6 +131,28 @@ exports.colors = {
|
|
|
121
131
|
axis: "#EBEBF5",
|
|
122
132
|
},
|
|
123
133
|
};
|
|
134
|
+
/**
|
|
135
|
+
* The values the fallback's material layers are built from.
|
|
136
|
+
*
|
|
137
|
+
* These are the web engine's numbers, not new inventions: the rim shine is the
|
|
138
|
+
* web's `--gl-rim` brightness (0.30 light / 0.13 dark), the top highlight and
|
|
139
|
+
* press glow are the web overlay alphas, and the drop shadow is the web's
|
|
140
|
+
* `0 1px 3px` black 0.06. They live here, next to the colours, so no component
|
|
141
|
+
* carries a material literal of its own.
|
|
142
|
+
*/
|
|
143
|
+
exports.material = {
|
|
144
|
+
/** Maximum alpha of the painted rim light, per theme (web: shine). */
|
|
145
|
+
rim: { light: 0.3, dark: 0.13 },
|
|
146
|
+
/** Alpha of the soft highlight drawn inside the top edge. */
|
|
147
|
+
highlight: 0.1,
|
|
148
|
+
/** Alpha of the radial glow that fades in while a surface is held. */
|
|
149
|
+
glow: 0.035,
|
|
150
|
+
/** Shadow colour; the web drops surfaces by 1px with 6% black in light. */
|
|
151
|
+
shadowColor: "#000000",
|
|
152
|
+
shadowOpacity: { light: 0.06, dark: 0 },
|
|
153
|
+
/** The colour the rim light and the top highlight are painted in. */
|
|
154
|
+
rimColor: "#FFFFFF",
|
|
155
|
+
};
|
|
124
156
|
/** Resolves a tone to its theme colour. */
|
|
125
157
|
function toneColor(theme, tone) {
|
|
126
158
|
switch (tone) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
export interface AccordionSection {
|
|
4
|
+
/** Stable identity for the section. */
|
|
5
|
+
value: string;
|
|
6
|
+
title: string;
|
|
7
|
+
/** Optional second line in the header. */
|
|
8
|
+
description?: string;
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface AccordionProps {
|
|
12
|
+
sections: AccordionSection[];
|
|
13
|
+
/** Allow several sections open at once. */
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
openSections?: string[];
|
|
16
|
+
defaultOpenSections?: string[];
|
|
17
|
+
onOpenSectionsChange?: (open: string[]) => void;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
isDark?: boolean;
|
|
20
|
+
testID?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function Accordion({ sections, multiple, openSections, defaultOpenSections, onOpenSectionsChange, style, isDark: isDarkProp, testID, }: AccordionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ActionSheetOption {
|
|
2
|
+
label: string;
|
|
3
|
+
/** Tints the row destructive, for delete actions. */
|
|
4
|
+
destructive?: boolean;
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface ActionSheetProps {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
title?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
options: ActionSheetOption[];
|
|
13
|
+
cancelLabel?: string;
|
|
14
|
+
isDark?: boolean;
|
|
15
|
+
/** Passed through to the sheet so it is testable. */
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A list of choices attached to the bottom of the screen.
|
|
20
|
+
*
|
|
21
|
+
* Anchored to the bottom because that is where a thumb reaches, and it keeps a
|
|
22
|
+
* separate Cancel row so a mis-tap is always reversible.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ActionSheet({ open: controlledOpen, onOpenChange, title, message, options, cancelLabel, isDark: isDarkProp, testID, }: ActionSheetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
export type AlertTone = "default" | "info" | "success" | "warning" | "destructive";
|
|
4
|
+
export interface AlertProps {
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
tone?: AlertTone;
|
|
9
|
+
/** Optional dismiss control. */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
isDark?: boolean;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
testID?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Alert({ title, description, icon, tone, onDismiss, isDark: isDarkProp, style, testID, }: AlertProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface AlertDialogProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Extra content between the description and the actions. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
cancelLabel?: string;
|
|
11
|
+
destructive?: boolean;
|
|
12
|
+
onConfirm?: () => void;
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
isDark?: boolean;
|
|
15
|
+
testID?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function AlertDialog({ open: openProp, onOpenChange, title, description, children, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, isDark: isDarkProp, testID, }: AlertDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { initialsOf } from "./internal/initials";
|
|
3
|
+
export type AvatarSize = "sm" | "md" | "lg";
|
|
4
|
+
export interface AvatarProps {
|
|
5
|
+
source?: {
|
|
6
|
+
uri: string;
|
|
7
|
+
} | number;
|
|
8
|
+
name?: string;
|
|
9
|
+
size?: AvatarSize;
|
|
10
|
+
status?: "online" | "offline" | "busy";
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
isDark?: boolean;
|
|
13
|
+
testID?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const STATUS_COLOR: {
|
|
16
|
+
readonly online: "on";
|
|
17
|
+
readonly offline: "muted";
|
|
18
|
+
readonly busy: "destructive";
|
|
19
|
+
};
|
|
20
|
+
export declare function Avatar({ source, name, size, status, style, isDark: isDarkProp, testID, }: AvatarProps): import("react").JSX.Element;
|
|
21
|
+
export { initialsOf };
|
|
22
|
+
export type { STATUS_COLOR };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
export interface BadgeProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
tone?: "fill" | "destructive" | "success" | "muted";
|
|
6
|
+
/** Wraps the badge around a control, e.g. an icon button with a count. */
|
|
7
|
+
overlay?: ReactNode;
|
|
8
|
+
isDark?: boolean;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
testID?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Badge({ children, tone, overlay, isDark: isDarkProp, style, testID, }: BadgeProps): import("react").JSX.Element;
|