glacia-native 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +84 -17
  2. package/lib/module/Accordion.js +58 -0
  3. package/lib/module/ActionSheet.js +38 -0
  4. package/lib/module/Alert.js +23 -0
  5. package/lib/module/AlertDialog.js +47 -0
  6. package/lib/module/Avatar.js +48 -0
  7. package/lib/module/Badge.js +36 -0
  8. package/lib/module/Bars.js +13 -268
  9. package/lib/module/Button.js +57 -39
  10. package/lib/module/Card.js +31 -19
  11. package/lib/module/Checkbox.js +42 -0
  12. package/lib/module/Chip.js +80 -0
  13. package/lib/module/Collapsible.js +26 -0
  14. package/lib/module/ContextMenu.js +33 -0
  15. package/lib/module/Dialog.js +39 -123
  16. package/lib/module/DropdownMenu.js +33 -0
  17. package/lib/module/Field.js +22 -0
  18. package/lib/module/Glass.js +10 -3
  19. package/lib/module/Group.js +36 -0
  20. package/lib/module/IconButton.js +40 -0
  21. package/lib/module/Input.js +43 -38
  22. package/lib/module/Label.js +17 -0
  23. package/lib/module/MorphGroup.js +47 -0
  24. package/lib/module/Popover.js +29 -0
  25. package/lib/module/Progress.js +32 -0
  26. package/lib/module/RadioGroup.js +51 -0
  27. package/lib/module/Scrim.js +44 -0
  28. package/lib/module/SegmentedControl.js +70 -63
  29. package/lib/module/Select.js +51 -0
  30. package/lib/module/Separator.js +25 -0
  31. package/lib/module/Sheet.js +51 -0
  32. package/lib/module/Skeleton.js +48 -0
  33. package/lib/module/Slider.js +45 -34
  34. package/lib/module/Stepper.js +167 -0
  35. package/lib/module/Switch.js +45 -55
  36. package/lib/module/TabBar.js +50 -44
  37. package/lib/module/Textarea.js +18 -0
  38. package/lib/module/Toast.js +55 -0
  39. package/lib/module/Toggle.js +47 -0
  40. package/lib/module/ToggleGroup.js +56 -0
  41. package/lib/module/Toolbar.js +37 -0
  42. package/lib/module/Tooltip.js +31 -0
  43. package/lib/module/glass-provider.js +28 -0
  44. package/lib/module/glass-stack.js +61 -0
  45. package/lib/module/index.js +78 -109
  46. package/lib/module/internal/GlassBackdrop.js +36 -0
  47. package/lib/module/internal/GlassView.js +43 -11
  48. package/lib/module/internal/blur-community.js +20 -0
  49. package/lib/module/internal/blur-community.web.js +9 -0
  50. package/lib/module/internal/blur.js +6 -9
  51. package/lib/module/internal/glass-routing.js +154 -30
  52. package/lib/module/internal/initials.js +12 -0
  53. package/lib/module/internal/overlay.js +147 -0
  54. package/lib/module/internal/primitives.js +16 -0
  55. package/lib/typescript/Accordion.d.ts +22 -0
  56. package/lib/typescript/ActionSheet.d.ts +24 -0
  57. package/lib/typescript/Alert.d.ts +15 -0
  58. package/lib/typescript/AlertDialog.d.ts +17 -0
  59. package/lib/typescript/Avatar.d.ts +22 -0
  60. package/lib/typescript/Badge.d.ts +12 -0
  61. package/lib/typescript/Bars.d.ts +3 -188
  62. package/lib/typescript/Button.d.ts +44 -10
  63. package/lib/typescript/Card.d.ts +30 -3
  64. package/lib/typescript/Checkbox.d.ts +14 -0
  65. package/lib/typescript/Chip.d.ts +19 -0
  66. package/lib/typescript/Collapsible.d.ts +17 -0
  67. package/lib/typescript/ContextMenu.d.ts +23 -0
  68. package/lib/typescript/Dialog.d.ts +8 -68
  69. package/lib/typescript/DropdownMenu.d.ts +23 -0
  70. package/lib/typescript/Field.d.ts +19 -0
  71. package/lib/typescript/Glass.d.ts +11 -2
  72. package/lib/typescript/Group.d.ts +35 -0
  73. package/lib/typescript/IconButton.d.ts +21 -0
  74. package/lib/typescript/Input.d.ts +17 -18
  75. package/lib/typescript/Label.d.ts +14 -0
  76. package/lib/typescript/MorphGroup.d.ts +46 -0
  77. package/lib/typescript/Popover.d.ts +17 -0
  78. package/lib/typescript/Progress.d.ts +13 -0
  79. package/lib/typescript/RadioGroup.d.ts +21 -0
  80. package/lib/typescript/Scrim.d.ts +33 -0
  81. package/lib/typescript/SegmentedControl.d.ts +24 -13
  82. package/lib/typescript/Select.d.ts +19 -0
  83. package/lib/typescript/Separator.d.ts +10 -0
  84. package/lib/typescript/Sheet.d.ts +45 -0
  85. package/lib/typescript/Skeleton.d.ts +10 -0
  86. package/lib/typescript/Slider.d.ts +15 -7
  87. package/lib/typescript/Stepper.d.ts +49 -0
  88. package/lib/typescript/Switch.d.ts +19 -12
  89. package/lib/typescript/TabBar.d.ts +18 -6
  90. package/lib/typescript/Textarea.d.ts +6 -0
  91. package/lib/typescript/Toast.d.ts +40 -0
  92. package/lib/typescript/Toggle.d.ts +21 -0
  93. package/lib/typescript/ToggleGroup.d.ts +22 -0
  94. package/lib/typescript/Toolbar.d.ts +35 -0
  95. package/lib/typescript/Tooltip.d.ts +16 -0
  96. package/lib/typescript/glass-provider.d.ts +34 -0
  97. package/lib/typescript/glass-stack.d.ts +54 -0
  98. package/lib/typescript/index.d.ts +38 -17
  99. package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
  100. package/lib/typescript/internal/GlassView.d.ts +18 -2
  101. package/lib/typescript/internal/blur-community.d.ts +2 -0
  102. package/lib/typescript/internal/blur-community.web.d.ts +2 -0
  103. package/lib/typescript/internal/glass-routing.d.ts +83 -15
  104. package/lib/typescript/internal/initials.d.ts +2 -0
  105. package/lib/typescript/internal/overlay.d.ts +74 -0
  106. package/lib/typescript/internal/primitives.d.ts +11 -0
  107. package/package.json +4 -2
  108. package/src/Accordion.tsx +165 -0
  109. package/src/ActionSheet.tsx +149 -0
  110. package/src/Alert.tsx +85 -0
  111. package/src/AlertDialog.tsx +124 -0
  112. package/src/Avatar.tsx +102 -0
  113. package/src/Badge.tsx +80 -0
  114. package/src/Bars.tsx +10 -807
  115. package/src/Button.tsx +196 -67
  116. package/src/Card.tsx +105 -32
  117. package/src/Checkbox.tsx +98 -0
  118. package/src/Chip.tsx +149 -0
  119. package/src/Collapsible.tsx +66 -0
  120. package/src/ContextMenu.tsx +103 -0
  121. package/src/Dialog.tsx +85 -335
  122. package/src/DropdownMenu.tsx +103 -0
  123. package/src/Field.tsx +65 -0
  124. package/src/Glass.tsx +15 -5
  125. package/src/Group.tsx +98 -0
  126. package/src/IconButton.tsx +110 -0
  127. package/src/Input.tsx +139 -87
  128. package/src/Label.tsx +56 -0
  129. package/src/MorphGroup.tsx +134 -0
  130. package/src/Popover.tsx +81 -0
  131. package/src/Progress.tsx +83 -0
  132. package/src/RadioGroup.tsx +122 -0
  133. package/src/Scrim.tsx +94 -0
  134. package/src/SegmentedControl.tsx +132 -99
  135. package/src/Select.tsx +136 -0
  136. package/src/Separator.tsx +52 -0
  137. package/src/Sheet.tsx +139 -0
  138. package/src/Skeleton.tsx +77 -0
  139. package/src/Slider.tsx +84 -47
  140. package/src/Stepper.tsx +315 -0
  141. package/src/Switch.tsx +81 -73
  142. package/src/TabBar.tsx +106 -93
  143. package/src/Textarea.tsx +34 -0
  144. package/src/Toast.tsx +131 -0
  145. package/src/Toggle.tsx +113 -0
  146. package/src/ToggleGroup.tsx +129 -0
  147. package/src/Toolbar.tsx +111 -0
  148. package/src/Tooltip.tsx +79 -0
  149. package/src/engine/CHANGELOG.md +430 -0
  150. package/src/engine/NOTICE +54 -0
  151. package/src/engine/README.md +975 -0
  152. package/src/engine/android/build.gradle +18 -0
  153. package/src/engine/android/src/main/AndroidManifest.xml +2 -0
  154. package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
  155. package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
  156. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
  157. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
  158. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
  159. package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
  160. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
  161. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
  162. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
  163. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
  164. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
  165. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
  166. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
  167. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
  168. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
  169. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
  170. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
  171. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
  172. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
  173. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
  174. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
  175. package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
  176. package/src/engine/index.ts +24 -0
  177. package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
  178. package/src/engine/ios/Enums/GlassVariant.swift +86 -0
  179. package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
  180. package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
  181. package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
  182. package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
  183. package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
  184. package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
  185. package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
  186. package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
  187. package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
  188. package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
  189. package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
  190. package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
  191. package/src/engine/ios/Glass/StripCache.swift +545 -0
  192. package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
  193. package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
  194. package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
  195. package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
  196. package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
  197. package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
  198. package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
  199. package/src/engine/package.json +70 -0
  200. package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
  201. package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
  202. package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
  203. package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
  204. package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
  205. package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
  206. package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
  207. package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
  208. package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
  209. package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
  210. package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
  211. package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
  212. package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
  213. package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
  214. package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
  215. package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
  216. package/src/engine/src/components/index.ts +16 -0
  217. package/src/engine/src/constants/index.ts +4 -0
  218. package/src/engine/src/constants/metal.constants.ts +327 -0
  219. package/src/engine/src/constants/metrics.constants.ts +325 -0
  220. package/src/engine/src/constants/springs.constants.ts +107 -0
  221. package/src/engine/src/constants/styles.constants.ts +12 -0
  222. package/src/engine/src/context/glass-group.context.ts +65 -0
  223. package/src/engine/src/context/index.ts +6 -0
  224. package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
  225. package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
  226. package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
  227. package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
  228. package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
  229. package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
  230. package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
  231. package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
  232. package/src/engine/src/core/components/index.ts +4 -0
  233. package/src/engine/src/core/constants/glass.constants.ts +57 -0
  234. package/src/engine/src/core/constants/index.ts +20 -0
  235. package/src/engine/src/core/constants/native.constants.ts +16 -0
  236. package/src/engine/src/core/context/glass-stack.context.ts +30 -0
  237. package/src/engine/src/core/context/index.ts +4 -0
  238. package/src/engine/src/core/enum/index.ts +12 -0
  239. package/src/engine/src/core/index.ts +1 -0
  240. package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
  241. package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
  242. package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
  243. package/src/engine/src/core/interfaces/index.ts +31 -0
  244. package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
  245. package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
  246. package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
  247. package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
  248. package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
  249. package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
  250. package/src/engine/src/core/modules/index.ts +2 -0
  251. package/src/engine/src/core/root/index.ts +51 -0
  252. package/src/engine/src/core/types/glass.types.ts +25 -0
  253. package/src/engine/src/core/types/index.ts +8 -0
  254. package/src/engine/src/core/utils/debug.utils.ts +17 -0
  255. package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
  256. package/src/engine/src/core/utils/hdr.utils.ts +37 -0
  257. package/src/engine/src/core/utils/index.ts +5 -0
  258. package/src/engine/src/core/utils/native-view.utils.ts +33 -0
  259. package/src/engine/src/core/utils/platform.utils.ts +34 -0
  260. package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
  261. package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
  262. package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
  263. package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
  264. package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
  265. package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
  266. package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
  267. package/src/engine/src/core/views/index.ts +4 -0
  268. package/src/engine/src/hooks/index.ts +18 -0
  269. package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
  270. package/src/engine/src/hooks/use-damped-drag.ts +332 -0
  271. package/src/engine/src/hooks/use-echo-filter.ts +55 -0
  272. package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
  273. package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
  274. package/src/engine/src/hooks/use-press-progress.ts +44 -0
  275. package/src/engine/src/index.ts +120 -0
  276. package/src/engine/src/interfaces/index.ts +28 -0
  277. package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
  278. package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
  279. package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
  280. package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
  281. package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
  282. package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
  283. package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
  284. package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
  285. package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
  286. package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
  287. package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
  288. package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
  289. package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
  290. package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
  291. package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
  292. package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
  293. package/src/engine/src/theme/glass-ui-theme.ts +100 -0
  294. package/src/engine/src/theme/index.ts +2 -0
  295. package/src/engine/src/utils/button-press.utils.ts +63 -0
  296. package/src/engine/src/utils/index.ts +3 -0
  297. package/src/engine/src/utils/metal.utils.ts +164 -0
  298. package/src/glass-provider.tsx +60 -0
  299. package/src/glass-stack.tsx +115 -0
  300. package/src/index.ts +47 -190
  301. package/src/internal/GlassBackdrop.tsx +60 -0
  302. package/src/internal/GlassView.tsx +53 -18
  303. package/src/internal/blur-community.ts +19 -0
  304. package/src/internal/blur-community.web.ts +7 -0
  305. package/src/internal/blur.ts +7 -8
  306. package/src/internal/glass-routing.ts +211 -34
  307. package/src/internal/initials.ts +7 -0
  308. package/src/internal/overlay.tsx +258 -0
  309. package/src/internal/primitives.ts +23 -0
  310. package/lib/module/Carousel.js +0 -103
  311. package/lib/module/Display.js +0 -318
  312. package/lib/module/Feedback.js +0 -395
  313. package/lib/module/Form.js +0 -160
  314. package/lib/module/Forms2.js +0 -471
  315. package/lib/module/Message.js +0 -84
  316. package/lib/module/Overlays.js +0 -344
  317. package/lib/module/Pickers.js +0 -243
  318. package/lib/module/Table.js +0 -100
  319. package/lib/module/ai.js +0 -283
  320. package/lib/module/charts/AreaChart.js +0 -32
  321. package/lib/module/charts/BarChart.js +0 -75
  322. package/lib/module/charts/FunnelChart.js +0 -50
  323. package/lib/module/charts/HeatmapChart.js +0 -71
  324. package/lib/module/charts/LineChart.js +0 -81
  325. package/lib/module/charts/PlotChart.js +0 -52
  326. package/lib/module/charts/RadarChart.js +0 -78
  327. package/lib/module/charts/RingChart.js +0 -52
  328. package/lib/module/charts/ScatterChart.js +0 -95
  329. package/lib/module/charts/WaterfallChart.js +0 -85
  330. package/lib/module/charts/advanced.js +0 -313
  331. package/lib/module/charts/extra.js +0 -108
  332. package/lib/module/charts/index.js +0 -50
  333. package/lib/module/charts/scales.js +0 -140
  334. package/lib/typescript/Carousel.d.ts +0 -47
  335. package/lib/typescript/Display.d.ts +0 -178
  336. package/lib/typescript/Feedback.d.ts +0 -196
  337. package/lib/typescript/Form.d.ts +0 -97
  338. package/lib/typescript/Forms2.d.ts +0 -209
  339. package/lib/typescript/Message.d.ts +0 -67
  340. package/lib/typescript/Overlays.d.ts +0 -146
  341. package/lib/typescript/Pickers.d.ts +0 -105
  342. package/lib/typescript/Table.d.ts +0 -64
  343. package/lib/typescript/ai.d.ts +0 -166
  344. package/lib/typescript/charts/AreaChart.d.ts +0 -44
  345. package/lib/typescript/charts/BarChart.d.ts +0 -19
  346. package/lib/typescript/charts/FunnelChart.d.ts +0 -25
  347. package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
  348. package/lib/typescript/charts/LineChart.d.ts +0 -30
  349. package/lib/typescript/charts/PlotChart.d.ts +0 -31
  350. package/lib/typescript/charts/RadarChart.d.ts +0 -27
  351. package/lib/typescript/charts/RingChart.d.ts +0 -28
  352. package/lib/typescript/charts/ScatterChart.d.ts +0 -34
  353. package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
  354. package/lib/typescript/charts/advanced.d.ts +0 -107
  355. package/lib/typescript/charts/extra.d.ts +0 -63
  356. package/lib/typescript/charts/index.d.ts +0 -13
  357. package/lib/typescript/charts/scales.d.ts +0 -35
  358. package/src/Carousel.tsx +0 -233
  359. package/src/Display.tsx +0 -781
  360. package/src/Feedback.tsx +0 -992
  361. package/src/Form.tsx +0 -445
  362. package/src/Forms2.tsx +0 -1055
  363. package/src/Message.tsx +0 -218
  364. package/src/Overlays.tsx +0 -704
  365. package/src/Pickers.tsx +0 -595
  366. package/src/Table.tsx +0 -232
  367. package/src/ai.tsx +0 -715
  368. package/src/charts/AreaChart.tsx +0 -73
  369. package/src/charts/BarChart.tsx +0 -221
  370. package/src/charts/FunnelChart.tsx +0 -125
  371. package/src/charts/HeatmapChart.tsx +0 -155
  372. package/src/charts/LineChart.tsx +0 -247
  373. package/src/charts/PlotChart.tsx +0 -168
  374. package/src/charts/RadarChart.tsx +0 -208
  375. package/src/charts/RingChart.tsx +0 -133
  376. package/src/charts/ScatterChart.tsx +0 -223
  377. package/src/charts/WaterfallChart.tsx +0 -201
  378. package/src/charts/advanced.tsx +0 -676
  379. package/src/charts/extra.tsx +0 -242
  380. package/src/charts/index.ts +0 -86
  381. package/src/charts/scales.ts +0 -163
package/src/Group.tsx ADDED
@@ -0,0 +1,98 @@
1
+ import { forwardRef, type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+
4
+ import { loadEngineControl } from "./internal/glass-routing";
5
+ import { glassCapabilities } from "./internal/GlassView";
6
+ import { Glass } from "./Glass";
7
+ import { colors } from "./internal/tokens";
8
+ import { primitives } from "./internal/primitives";
9
+ import { useIsDark } from "./internal/motion";
10
+
11
+ export interface GroupProps {
12
+ /** The distance at which a pressed member begins to fuse with its neighbour, dp. Defaults to 28. */
13
+ spacing?: number;
14
+ /** Resting gap between members, dp. Defaults to 12. */
15
+ gap?: number;
16
+ /** Lay the members out along a row (default) or a column. */
17
+ direction?: "row" | "column";
18
+ /**
19
+ * The canvas glass — the material the merged silhouette is drawn with. Defaults to the kit's
20
+ * button recipe.
21
+ */
22
+ metal?: unknown;
23
+ /** Surface wash over the canvas. */
24
+ tint?: string;
25
+ /** Android only — which `LiquidGlassProvider` supplies the backdrop. */
26
+ providerId?: string;
27
+ style?: StyleProp<ViewStyle>;
28
+ /** The members — the kit's buttons, icon buttons and chips join automatically. */
29
+ children?: ReactNode;
30
+ isDark?: boolean;
31
+ /** Passed to the group so it is testable. */
32
+ testID?: string;
33
+ }
34
+
35
+ /**
36
+ * A group of glass members that merge when pressed together — ported from the
37
+ * engine's `LiquidGlassGroup`.
38
+ *
39
+ * With a glass renderer available the engine's own control mounts, carrying the
40
+ * approved merge behaviour. Without one — Expo Go, below every tier, or Reduce
41
+ * Transparency — the fallback floor renders the same row of members with the
42
+ * fallback material, so the group is never invisible.
43
+ */
44
+ export const Group = forwardRef<any, GroupProps>(function Group(
45
+ {
46
+ spacing = 28,
47
+ gap = 12,
48
+ direction = "row",
49
+ metal,
50
+ tint,
51
+ providerId,
52
+ style,
53
+ children,
54
+ isDark: isDarkProp,
55
+ testID,
56
+ ...props
57
+ },
58
+ ref,
59
+ ) {
60
+ const isDark = useIsDark(isDarkProp);
61
+ const themeColors = isDark ? colors.dark : colors.light;
62
+ const { View } = primitives();
63
+ const capabilities = glassCapabilities();
64
+ const EngineGroup = loadEngineControl("Group");
65
+
66
+ if (EngineGroup && capabilities.supported) {
67
+ const EngineGroupComponent = EngineGroup;
68
+ return (
69
+ <EngineGroupComponent
70
+ spacing={spacing}
71
+ gap={gap}
72
+ direction={direction}
73
+ metal={metal}
74
+ tint={tint}
75
+ providerId={providerId}
76
+ style={style}
77
+ testID={testID}
78
+ >
79
+ {children}
80
+ </EngineGroupComponent>
81
+ );
82
+ }
83
+
84
+ // Fallback floor: the members laid out with the group's resting gap.
85
+ return (
86
+ <View
87
+ style={{
88
+ flexDirection: direction === "column" ? "column" : "row",
89
+ gap,
90
+ ...(style as ViewStyle),
91
+ }}
92
+ testID={testID}
93
+ {...(props as any)}
94
+ >
95
+ {children}
96
+ </View>
97
+ );
98
+ });
@@ -0,0 +1,110 @@
1
+ import { forwardRef } from "react";
2
+ import type { ReactNode } from "react";
3
+ import type { StyleProp, ViewStyle } from "react-native";
4
+
5
+ import { loadEngineControl } from "./internal/glass-routing";
6
+ import { glassCapabilities } from "./internal/GlassView";
7
+ import { Glass } from "./Glass";
8
+ import { colors, radii } from "./internal/tokens";
9
+ import { primitives } from "./internal/primitives";
10
+ import { useIsDark } from "./internal/motion";
11
+
12
+ export interface IconButtonProps {
13
+ icon: ReactNode | ((state: any) => ReactNode);
14
+ onPress?: () => void;
15
+ disabled?: boolean;
16
+ size?: "sm" | "md" | "lg";
17
+ tint?: string;
18
+ accessibilityLabel: string;
19
+ accessibilityState?: Record<string, any>;
20
+ style?: StyleProp<ViewStyle>;
21
+ isDark?: boolean;
22
+ testID?: string;
23
+ children?: ReactNode;
24
+ }
25
+
26
+ const SIZES = { sm: 32, md: 38, lg: 44 } as const;
27
+
28
+ /**
29
+ * An icon button on Glacia's glass — ported from the engine's
30
+ * `LiquidGlassIconButton`, which extends the engine button's design with a
31
+ * required accessibility label (a bare circle of glass has no text to read).
32
+ */
33
+ export const IconButton = forwardRef<any, IconButtonProps>(function IconButton(
34
+ {
35
+ icon,
36
+ onPress,
37
+ disabled = false,
38
+ size = "md",
39
+ tint,
40
+ accessibilityLabel,
41
+ accessibilityState,
42
+ style,
43
+ isDark: isDarkProp,
44
+ testID,
45
+ children,
46
+ },
47
+ ref,
48
+ ) {
49
+ const isDark = useIsDark(isDarkProp);
50
+ const themeColors = isDark ? colors.dark : colors.light;
51
+ const { Pressable, View } = primitives();
52
+ const capabilities = glassCapabilities();
53
+ const EngineIconButton = loadEngineControl("IconButton");
54
+ const dimension = SIZES[size];
55
+
56
+ if (EngineIconButton && capabilities.supported) {
57
+ const EngineIconButtonComponent = EngineIconButton;
58
+ return (
59
+ <EngineIconButtonComponent
60
+ ref={ref}
61
+ onPress={disabled ? undefined : onPress}
62
+ disabled={disabled}
63
+ icon={icon}
64
+ tint={tint}
65
+ accessibilityLabel={accessibilityLabel}
66
+ accessibilityState={{ disabled, ...accessibilityState }}
67
+ style={style}
68
+ size={size}
69
+ >
70
+ {children}
71
+ </EngineIconButtonComponent>
72
+ );
73
+ }
74
+
75
+ // Fallback floor: solid circle, full geometry, on the fallback material.
76
+ const radius = dimension / 2;
77
+ return (
78
+ <Glass
79
+ effect="regular"
80
+ surface="control"
81
+ isDark={isDark}
82
+ tintColor={tint}
83
+ style={style}
84
+ testID={testID}
85
+ >
86
+ <Pressable
87
+ ref={ref}
88
+ testID={testID}
89
+ accessibilityRole="button"
90
+ accessibilityLabel={accessibilityLabel}
91
+ accessibilityState={{ disabled }}
92
+ disabled={disabled}
93
+ onPress={disabled ? undefined : onPress}
94
+ style={style as ViewStyle}
95
+ >
96
+ <View
97
+ style={{
98
+ width: dimension,
99
+ height: dimension,
100
+ borderRadius: radius,
101
+ backgroundColor: tint ?? themeColors.fill,
102
+ opacity: disabled ? 0.38 : 1,
103
+ alignItems: "center",
104
+ justifyContent: "center",
105
+ }}
106
+ />
107
+ </Pressable>
108
+ </Glass>
109
+ );
110
+ });
package/src/Input.tsx CHANGED
@@ -1,6 +1,8 @@
1
1
  import { forwardRef, useState, type ReactNode } from "react";
2
2
  import type { StyleProp, TextStyle, ViewStyle } from "react-native";
3
3
 
4
+ import { loadEngineControl } from "./internal/glass-routing";
5
+ import { glassCapabilities } from "./internal/GlassView";
4
6
  import { Glass } from "./Glass";
5
7
  import { colors, radii } from "./internal/tokens";
6
8
  import { primitives } from "./internal/primitives";
@@ -37,22 +39,35 @@ export interface InputProps {
37
39
  editable?: boolean;
38
40
  onFocus?: () => void;
39
41
  onBlur?: () => void;
42
+ // Engine-port additions (LiquidGlassTextInput): the capsule height and the
43
+ // glass-frame controls. `height` wins when set; the size-based ergonomics above
44
+ // remain for callers that use them.
45
+ height?: number;
46
+ tint?: string;
47
+ variant?: "regular" | "clear";
48
+ interactive?: boolean;
49
+ leading?: ReactNode;
50
+ trailing?: ReactNode;
51
+ focusRing?: boolean;
52
+ accentColor?: string;
40
53
  }
41
54
 
42
55
  const heights = { sm: 28, md: 34, lg: 44 };
43
56
  const fontSizes = { sm: 14, md: 15, lg: 16 };
44
57
 
45
58
  /**
46
- * A single-line or multiline text field.
59
+ * A single-line or multiline text field — ported from the engine's
60
+ * `LiquidGlassTextInput`, the design Binyam approved on real devices this week
61
+ * (48dp capsule, focus ring that springs in, leading/trailing slots).
47
62
  *
48
63
  * The native TextInput has no placeholder styling prop, so the placeholder is
49
- * drawn as a sibling Text: that keeps its colour tied to the theme instead of
50
- * the OS default, which changes between iOS versions.
64
+ * drawn as a sibling Text: that keeps its colour tied to the theme instead of the
65
+ * OS default, which changes between iOS versions.
51
66
  *
52
- * The field works controlled (`value` + `onChangeText`) or uncontrolled (no
53
- * `value` prop). In uncontrolled use it tracks its own text so the themed
54
- * placeholder disappears as soon as the user types; without that state the
55
- * overlay would sit on top of the typed text until the parent re-rendered.
67
+ * With a glass renderer available the engine's own control mounts, carrying the
68
+ * approved material and focus behaviour. Without one — Expo Go, below every tier,
69
+ * or Reduce Transparency — the fallback floor renders the same capsule with the
70
+ * fallback material, so the field is never invisible and never bare text.
56
71
  */
57
72
  export const Input = forwardRef<any, InputProps>(function Input(
58
73
  {
@@ -81,12 +96,23 @@ export const Input = forwardRef<any, InputProps>(function Input(
81
96
  editable,
82
97
  onFocus,
83
98
  onBlur,
99
+ height,
100
+ tint,
101
+ variant = "regular",
102
+ interactive = true,
103
+ leading,
104
+ trailing,
105
+ focusRing = true,
106
+ accentColor,
107
+ ...props
84
108
  },
85
109
  ref,
86
110
  ) {
87
111
  const isDark = useIsDark(isDarkProp);
88
112
  const theme = isDark ? colors.dark : colors.light;
89
113
  const { View, Text, TextInput } = primitives();
114
+ const capabilities = glassCapabilities();
115
+ const EngineInput = loadEngineControl("Input");
90
116
 
91
117
  // Uncontrolled support: with no `value` prop the field owns its text.
92
118
  const [internalText, setInternalText] = useState(defaultValue ?? "");
@@ -99,6 +125,8 @@ export const Input = forwardRef<any, InputProps>(function Input(
99
125
  const isEditable = editable !== undefined ? editable : !disabled;
100
126
  const showPlaceholder = !text && Boolean(placeholder);
101
127
 
128
+ const resolvedHeight = height ?? heights[size];
129
+
102
130
  const fieldStyle: TextStyle = {
103
131
  flex: 1,
104
132
  paddingVertical: multiline ? 0 : height_padding(size),
@@ -107,69 +135,111 @@ export const Input = forwardRef<any, InputProps>(function Input(
107
135
  color: theme.foreground,
108
136
  };
109
137
 
110
- return (
111
- <Glass
112
- surface="field"
113
- isDark={isDark}
114
- style={{
115
- flexDirection: "row",
116
- alignItems: multiline ? "flex-start" : "center",
117
- gap: 8,
118
- // Fields are pills on the web; a multi-line field relaxes to the
119
- // stack radius (18) because a pill around wrapped text reads wrong.
120
- borderRadius: multiline ? 18 : radii.pill,
121
- minHeight: multiline ? 84 : heights[size],
122
- paddingHorizontal: 14,
123
- paddingVertical: multiline ? 10 : 0,
124
- borderColor: invalid ? theme.destructive : undefined,
125
- opacity: disabled ? 0.5 : 1,
126
- ...(style as ViewStyle),
127
- }}
128
- >
129
- {prefix}
130
-
131
- <View style={{ flex: 1, justifyContent: "center" }}>
132
- {showPlaceholder && (
133
- <Text
134
- style={{
135
- position: "absolute",
136
- left: 0,
137
- top: multiline ? 0 : undefined,
138
- fontSize: fontSizes[size],
139
- color: theme.muted,
140
- }}
141
- pointerEvents="none"
142
- numberOfLines={1}
143
- >
144
- {placeholder}
145
- </Text>
146
- )}
147
-
148
- <TextInput
149
- ref={ref}
150
- testID={testID}
151
- value={text}
152
- onChangeText={handleChangeText}
153
- editable={isEditable}
154
- secureTextEntry={secureTextEntry}
155
- keyboardType={keyboardType}
156
- autoCapitalize={autoCapitalize}
157
- autoCorrect={autoCorrect}
158
- multiline={multiline}
159
- numberOfLines={multiline ? minLines : undefined}
160
- maxLength={maxLength}
161
- returnKeyType={returnKeyType}
162
- onSubmitEditing={onSubmitEditing}
163
- onFocus={onFocus}
164
- onBlur={onBlur}
165
- accessibilityLabel={accessibilityLabel ?? placeholder}
166
- accessibilityState={{ disabled: !isEditable }}
167
- style={fieldStyle}
168
- />
169
- </View>
138
+ // ------------------------------------------------------------------
139
+ // Fallback floor: the same capsule with the fallback material underneath.
140
+ // ------------------------------------------------------------------
141
+ if (!(EngineInput && capabilities.supported)) {
142
+ const { View, Text, TextInput } = primitives();
143
+ return (
144
+ <Glass
145
+ effect={variant}
146
+ surface="field"
147
+ isDark={isDark}
148
+ style={{
149
+ flexDirection: "row",
150
+ alignItems: multiline ? "flex-start" : "center",
151
+ gap: 8,
152
+ borderRadius: multiline ? radii.xl : radii.pill,
153
+ minHeight: multiline ? 84 : resolvedHeight,
154
+ paddingHorizontal: 14,
155
+ paddingVertical: multiline ? 10 : 0,
156
+ borderColor: invalid ? theme.destructive : undefined,
157
+ opacity: disabled ? 0.5 : 1,
158
+ ...(style as ViewStyle),
159
+ }}
160
+ testID={testID}
161
+ >
162
+ {prefix}
163
+ <View style={{ flex: 1, justifyContent: "center" }}>
164
+ {showPlaceholder && (
165
+ <Text
166
+ style={{
167
+ position: "absolute",
168
+ left: 0,
169
+ top: multiline ? 0 : undefined,
170
+ fontSize: fontSizes[size],
171
+ color: theme.muted,
172
+ }}
173
+ pointerEvents="none"
174
+ numberOfLines={1}
175
+ >
176
+ {placeholder}
177
+ </Text>
178
+ )}
179
+ <TextInput
180
+ ref={ref}
181
+ testID={testID}
182
+ value={text}
183
+ onChangeText={handleChangeText}
184
+ editable={isEditable}
185
+ secureTextEntry={secureTextEntry}
186
+ keyboardType={keyboardType}
187
+ autoCapitalize={autoCapitalize}
188
+ autoCorrect={autoCorrect}
189
+ multiline={multiline}
190
+ numberOfLines={multiline ? minLines : undefined}
191
+ maxLength={maxLength}
192
+ returnKeyType={returnKeyType}
193
+ onSubmitEditing={onSubmitEditing}
194
+ onFocus={onFocus}
195
+ onBlur={onBlur}
196
+ accessibilityLabel={accessibilityLabel ?? placeholder}
197
+ accessibilityState={{ disabled: !isEditable }}
198
+ style={fieldStyle}
199
+ />
200
+ </View>
201
+ {trailing}
202
+ </Glass>
203
+ );
204
+ }
170
205
 
171
- {suffix}
172
- </Glass>
206
+ const EngineInputComponent = EngineInput;
207
+ const capsuleHeight = resolvedHeight;
208
+ return (
209
+ <EngineInputComponent
210
+ value={value}
211
+ defaultValue={defaultValue}
212
+ onChangeText={handleChangeText}
213
+ placeholder={placeholder}
214
+ invalid={invalid}
215
+ disabled={disabled}
216
+ secureTextEntry={secureTextEntry}
217
+ keyboardType={keyboardType}
218
+ autoCapitalize={autoCapitalize}
219
+ autoCorrect={autoCorrect}
220
+ multiline={multiline}
221
+ minLines={minLines}
222
+ size={size}
223
+ accessibilityLabel={accessibilityLabel}
224
+ returnKeyType={returnKeyType}
225
+ onSubmitEditing={onSubmitEditing}
226
+ onFocus={onFocus}
227
+ onBlur={onBlur}
228
+ maxLength={maxLength}
229
+ editable={isEditable}
230
+ height={capsuleHeight}
231
+ tint={tint}
232
+ variant={variant}
233
+ interactive={interactive}
234
+ leading={leading}
235
+ trailing={trailing}
236
+ focusRing={focusRing}
237
+ accentColor={accentColor}
238
+ style={style}
239
+ contentStyle={undefined}
240
+ inputStyle={fieldStyle}
241
+ testID={testID}
242
+ />
173
243
  );
174
244
  });
175
245
 
@@ -177,21 +247,3 @@ export const Input = forwardRef<any, InputProps>(function Input(
177
247
  function height_padding(size: "sm" | "md" | "lg") {
178
248
  return size === "sm" ? 4 : size === "lg" ? 10 : 7;
179
249
  }
180
-
181
- export interface TextareaProps extends Omit<InputProps, "size" | "multiline" | "minLines"> {
182
- /** Visible height in text lines. */
183
- rows?: number;
184
- }
185
-
186
- /**
187
- * A multi-line field.
188
- *
189
- * Separate from Input so `multiline` cannot silently turn off the single-line
190
- * sizing, and so callers get a `rows` prop instead of guessing a pixel height.
191
- */
192
- export const Textarea = forwardRef<any, TextareaProps>(function Textarea(
193
- { rows = 4, ...props },
194
- ref,
195
- ) {
196
- return <Input ref={ref} {...props} multiline minLines={rows} />;
197
- });
package/src/Label.tsx ADDED
@@ -0,0 +1,56 @@
1
+ // Wave 2 — the label and type primitives.
2
+ //
3
+ // The label's behaviour is the donor's: it names a control through
4
+ // `nativeID`, marks required and disabled states for screen readers, and does
5
+ // not intercept touches. The dress is the Wave 1 family's type scale.
6
+
7
+ import type { ReactNode } from "react";
8
+ import type { StyleProp, TextStyle } from "react-native";
9
+
10
+ import { colors, typeScale } from "./internal/tokens";
11
+ import { primitives } from "./internal/primitives";
12
+ import { useIsDark } from "./internal/motion";
13
+
14
+ export interface LabelProps {
15
+ children?: ReactNode;
16
+ /** Adds the required marker and reports it to screen readers. */
17
+ required?: boolean;
18
+ disabled?: boolean;
19
+ /** Matched by a control's `aria-labelledby`/`nativeID`. */
20
+ nativeID?: string;
21
+ isDark?: boolean;
22
+ style?: StyleProp<TextStyle>;
23
+ testID?: string;
24
+ }
25
+
26
+ export function Label({
27
+ children,
28
+ required = false,
29
+ disabled = false,
30
+ nativeID,
31
+ isDark: isDarkProp,
32
+ style,
33
+ testID,
34
+ }: LabelProps) {
35
+ const isDark = useIsDark(isDarkProp);
36
+ const theme = isDark ? colors.dark : colors.light;
37
+ const { Text: RNText } = primitives();
38
+
39
+ return (
40
+ <RNText
41
+ testID={testID}
42
+ nativeID={nativeID}
43
+ accessibilityRole="text"
44
+ accessibilityState={{ disabled }}
45
+ style={[
46
+ typeScale.label,
47
+ { color: disabled ? theme.muted : theme.foreground },
48
+ style,
49
+ ]}
50
+ {...({ "aria-required": required } as any)}
51
+ >
52
+ {children}
53
+ {required ? <RNText style={{ color: theme.destructive }}> *</RNText> : null}
54
+ </RNText>
55
+ );
56
+ }
@@ -0,0 +1,134 @@
1
+ import { forwardRef, useState } from "react";
2
+ import type { StyleProp, TextStyle, ViewStyle } from "react-native";
3
+
4
+ import { loadEngineControl } from "./internal/glass-routing";
5
+ import { glassCapabilities } from "./internal/GlassView";
6
+ import { Glass } from "./Glass";
7
+ import { colors } from "./internal/tokens";
8
+ import { primitives } from "./internal/primitives";
9
+ import { hapticSelection } from "./internal/haptics";
10
+ import { useIsDark } from "./internal/motion";
11
+
12
+ export interface MorphGroupItem {
13
+ key: string;
14
+ /** Wrapped in a styled `Text`. */
15
+ label?: string;
16
+ /** Rendered before the label. */
17
+ icon?: any;
18
+ onPress?: () => void;
19
+ }
20
+
21
+ export interface MorphGroupProps {
22
+ /** The capsules, laid out in a row. Two or more make the morph reachable. */
23
+ items: MorphGroupItem[];
24
+ /**
25
+ * A capsule was dragged onto a neighbour and released there. What that *means*
26
+ * — combining actions, stacking items, a folder — is the app's; the group only
27
+ * springs everything home.
28
+ */
29
+ onMerge?: (fromKey: string, toKey: string) => void;
30
+ /** A plain tap, forwarded alongside the item's own `onPress`. */
31
+ onItemPress?: (key: string) => void;
32
+ /** The distance at which two capsules begin to fuse, dp. Defaults to 28. */
33
+ spacing?: number;
34
+ /** Gap between capsules at rest, dp. Defaults to 12. */
35
+ gap?: number;
36
+ /** Capsule height; the corner radius follows it. Defaults to 48. */
37
+ height?: number;
38
+ /** Surface wash over every capsule's glass. */
39
+ tint?: string;
40
+ variant?: "regular" | "clear";
41
+ metal?: unknown;
42
+ providerId?: string;
43
+ style?: StyleProp<ViewStyle>;
44
+ /** Applied to item labels. */
45
+ textStyle?: StyleProp<TextStyle>;
46
+ }
47
+
48
+ /**
49
+ * A morphing group of capsules — ported from the engine's
50
+ * `LiquidGlassMorphGroup`, the design Binyam approved on real devices this week
51
+ * (capsules fuse when dragged together, spring home on release).
52
+ *
53
+ * With a glass renderer available the engine's own control mounts, carrying the
54
+ * approved morph behaviour. Without one — Expo Go, below every tier, or Reduce
55
+ * Transparency — the fallback floor renders the same capsules with solid
56
+ * surfaces, so the group is never invisible.
57
+ */
58
+ export const MorphGroup = forwardRef<any, MorphGroupProps>(function MorphGroup(
59
+ {
60
+ items,
61
+ onMerge,
62
+ onItemPress,
63
+ spacing = 28,
64
+ gap = 12,
65
+ height = 48,
66
+ tint,
67
+ variant = "regular",
68
+ metal,
69
+ providerId,
70
+ style,
71
+ textStyle,
72
+ ...props
73
+ },
74
+ ref,
75
+ ) {
76
+ const isDark = useIsDark();
77
+ const themeColors = isDark ? colors.dark : colors.light;
78
+ const { View, Pressable, Text: RNText } = primitives();
79
+ const capabilities = glassCapabilities();
80
+ const EngineMorphGroup = loadEngineControl("MorphGroup");
81
+
82
+ const capsules = items.map((item) => (
83
+ <Pressable
84
+ key={item.key}
85
+ accessibilityRole="button"
86
+ accessibilityLabel={item.label ?? item.key}
87
+ disabled={!item.onPress}
88
+ onPress={() => {
89
+ hapticSelection();
90
+ item.onPress?.();
91
+ onItemPress?.(item.key);
92
+ }}
93
+ style={{
94
+ height,
95
+ borderRadius: height / 2,
96
+ backgroundColor: themeColors.fill,
97
+ alignItems: "center",
98
+ justifyContent: "center",
99
+ paddingHorizontal: 16,
100
+ ...(style as ViewStyle),
101
+ }}
102
+ >
103
+ {item.icon}
104
+ {item.label ? <RNText style={[textStyle, { fontSize: 15, fontWeight: "600" }]}>{item.label}</RNText> : null}
105
+ </Pressable>
106
+ ));
107
+
108
+ if (EngineMorphGroup && capabilities.supported) {
109
+ const EngineMorphGroupComponent = EngineMorphGroup;
110
+ return (
111
+ <EngineMorphGroupComponent
112
+ items={items}
113
+ onMerge={onMerge}
114
+ onItemPress={onItemPress}
115
+ spacing={spacing}
116
+ gap={gap}
117
+ height={height}
118
+ tint={tint}
119
+ variant={variant}
120
+ metal={metal}
121
+ providerId={providerId}
122
+ style={style}
123
+ textStyle={textStyle}
124
+ />
125
+ );
126
+ }
127
+
128
+ // Fallback floor: the same capsules, solid, in the same row.
129
+ return (
130
+ <View style={{ flexDirection: "row", gap, ...(style as ViewStyle) }} testID={undefined} {...(props as any)}>
131
+ {capsules}
132
+ </View>
133
+ );
134
+ });