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.
Files changed (403) hide show
  1. package/LICENSE +29 -4
  2. package/README.md +111 -17
  3. package/lib/module/Accordion.js +58 -0
  4. package/lib/module/ActionSheet.js +38 -0
  5. package/lib/module/Alert.js +23 -0
  6. package/lib/module/AlertDialog.js +47 -0
  7. package/lib/module/Avatar.js +48 -0
  8. package/lib/module/Badge.js +36 -0
  9. package/lib/module/Bars.js +13 -267
  10. package/lib/module/Button.js +57 -36
  11. package/lib/module/Card.js +32 -20
  12. package/lib/module/Checkbox.js +42 -0
  13. package/lib/module/Chip.js +80 -0
  14. package/lib/module/Collapsible.js +26 -0
  15. package/lib/module/ContextMenu.js +33 -0
  16. package/lib/module/Dialog.js +39 -124
  17. package/lib/module/DropdownMenu.js +33 -0
  18. package/lib/module/Field.js +22 -0
  19. package/lib/module/Glass.js +12 -5
  20. package/lib/module/Group.js +36 -0
  21. package/lib/module/IconButton.js +40 -0
  22. package/lib/module/Input.js +47 -40
  23. package/lib/module/Label.js +17 -0
  24. package/lib/module/MorphGroup.js +47 -0
  25. package/lib/module/Popover.js +29 -0
  26. package/lib/module/Progress.js +32 -0
  27. package/lib/module/RadioGroup.js +51 -0
  28. package/lib/module/Scrim.js +44 -0
  29. package/lib/module/SegmentedControl.js +74 -58
  30. package/lib/module/Select.js +51 -0
  31. package/lib/module/Separator.js +25 -0
  32. package/lib/module/Sheet.js +51 -0
  33. package/lib/module/Skeleton.js +48 -0
  34. package/lib/module/Slider.js +60 -40
  35. package/lib/module/Stepper.js +167 -0
  36. package/lib/module/Switch.js +45 -43
  37. package/lib/module/TabBar.js +62 -50
  38. package/lib/module/Tabs.js +3 -2
  39. package/lib/module/Textarea.js +18 -0
  40. package/lib/module/Toast.js +55 -0
  41. package/lib/module/Toggle.js +47 -0
  42. package/lib/module/ToggleGroup.js +56 -0
  43. package/lib/module/Toolbar.js +37 -0
  44. package/lib/module/Tooltip.js +31 -0
  45. package/lib/module/glass-provider.js +28 -0
  46. package/lib/module/glass-stack.js +61 -0
  47. package/lib/module/index.js +78 -109
  48. package/lib/module/internal/GlassBackdrop.js +36 -0
  49. package/lib/module/internal/GlassView.js +45 -13
  50. package/lib/module/internal/blur-community.js +20 -0
  51. package/lib/module/internal/blur-community.web.js +9 -0
  52. package/lib/module/internal/blur.js +75 -0
  53. package/lib/module/internal/fallback.js +110 -20
  54. package/lib/module/internal/glass-routing.js +154 -30
  55. package/lib/module/internal/glow.js +36 -0
  56. package/lib/module/internal/initials.js +12 -0
  57. package/lib/module/internal/lens.js +70 -0
  58. package/lib/module/internal/material.js +64 -0
  59. package/lib/module/internal/overlay.js +147 -0
  60. package/lib/module/internal/primitives.js +17 -0
  61. package/lib/module/internal/rim.js +35 -0
  62. package/lib/module/internal/tokens.js +34 -2
  63. package/lib/typescript/Accordion.d.ts +22 -0
  64. package/lib/typescript/ActionSheet.d.ts +24 -0
  65. package/lib/typescript/Alert.d.ts +15 -0
  66. package/lib/typescript/AlertDialog.d.ts +17 -0
  67. package/lib/typescript/Avatar.d.ts +22 -0
  68. package/lib/typescript/Badge.d.ts +12 -0
  69. package/lib/typescript/Bars.d.ts +3 -188
  70. package/lib/typescript/Button.d.ts +44 -10
  71. package/lib/typescript/Card.d.ts +30 -3
  72. package/lib/typescript/Checkbox.d.ts +14 -0
  73. package/lib/typescript/Chip.d.ts +19 -0
  74. package/lib/typescript/Collapsible.d.ts +17 -0
  75. package/lib/typescript/ContextMenu.d.ts +23 -0
  76. package/lib/typescript/Dialog.d.ts +8 -68
  77. package/lib/typescript/DropdownMenu.d.ts +23 -0
  78. package/lib/typescript/Field.d.ts +19 -0
  79. package/lib/typescript/Glass.d.ts +11 -2
  80. package/lib/typescript/Group.d.ts +35 -0
  81. package/lib/typescript/IconButton.d.ts +21 -0
  82. package/lib/typescript/Input.d.ts +17 -18
  83. package/lib/typescript/Label.d.ts +14 -0
  84. package/lib/typescript/MorphGroup.d.ts +46 -0
  85. package/lib/typescript/Popover.d.ts +17 -0
  86. package/lib/typescript/Progress.d.ts +13 -0
  87. package/lib/typescript/RadioGroup.d.ts +21 -0
  88. package/lib/typescript/Scrim.d.ts +33 -0
  89. package/lib/typescript/SegmentedControl.d.ts +24 -13
  90. package/lib/typescript/Select.d.ts +19 -0
  91. package/lib/typescript/Separator.d.ts +10 -0
  92. package/lib/typescript/Sheet.d.ts +45 -0
  93. package/lib/typescript/Skeleton.d.ts +10 -0
  94. package/lib/typescript/Slider.d.ts +15 -7
  95. package/lib/typescript/Stepper.d.ts +49 -0
  96. package/lib/typescript/Switch.d.ts +19 -12
  97. package/lib/typescript/TabBar.d.ts +18 -6
  98. package/lib/typescript/Textarea.d.ts +6 -0
  99. package/lib/typescript/Toast.d.ts +40 -0
  100. package/lib/typescript/Toggle.d.ts +21 -0
  101. package/lib/typescript/ToggleGroup.d.ts +22 -0
  102. package/lib/typescript/Toolbar.d.ts +35 -0
  103. package/lib/typescript/Tooltip.d.ts +16 -0
  104. package/lib/typescript/glass-provider.d.ts +34 -0
  105. package/lib/typescript/glass-stack.d.ts +54 -0
  106. package/lib/typescript/index.d.ts +39 -17
  107. package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
  108. package/lib/typescript/internal/GlassView.d.ts +31 -2
  109. package/lib/typescript/internal/blur-community.d.ts +2 -0
  110. package/lib/typescript/internal/blur-community.web.d.ts +2 -0
  111. package/lib/typescript/internal/blur.d.ts +24 -0
  112. package/lib/typescript/internal/fallback.d.ts +27 -2
  113. package/lib/typescript/internal/glass-routing.d.ts +83 -15
  114. package/lib/typescript/internal/glow.d.ts +11 -0
  115. package/lib/typescript/internal/initials.d.ts +2 -0
  116. package/lib/typescript/internal/lens.d.ts +47 -0
  117. package/lib/typescript/internal/material.d.ts +27 -0
  118. package/lib/typescript/internal/overlay.d.ts +74 -0
  119. package/lib/typescript/internal/primitives.d.ts +13 -0
  120. package/lib/typescript/internal/rim.d.ts +16 -0
  121. package/lib/typescript/internal/tokens.d.ts +36 -0
  122. package/package.json +15 -4
  123. package/src/Accordion.tsx +165 -0
  124. package/src/ActionSheet.tsx +149 -0
  125. package/src/Alert.tsx +85 -0
  126. package/src/AlertDialog.tsx +124 -0
  127. package/src/Avatar.tsx +102 -0
  128. package/src/Badge.tsx +80 -0
  129. package/src/Bars.tsx +10 -797
  130. package/src/Button.tsx +196 -60
  131. package/src/Card.tsx +106 -33
  132. package/src/Checkbox.tsx +98 -0
  133. package/src/Chip.tsx +149 -0
  134. package/src/Collapsible.tsx +66 -0
  135. package/src/ContextMenu.tsx +103 -0
  136. package/src/Dialog.tsx +86 -325
  137. package/src/DropdownMenu.tsx +103 -0
  138. package/src/Field.tsx +65 -0
  139. package/src/Glass.tsx +19 -5
  140. package/src/Group.tsx +98 -0
  141. package/src/IconButton.tsx +110 -0
  142. package/src/Input.tsx +143 -87
  143. package/src/Label.tsx +56 -0
  144. package/src/MorphGroup.tsx +134 -0
  145. package/src/Popover.tsx +81 -0
  146. package/src/Progress.tsx +83 -0
  147. package/src/RadioGroup.tsx +122 -0
  148. package/src/Scrim.tsx +94 -0
  149. package/src/SegmentedControl.tsx +147 -90
  150. package/src/Select.tsx +136 -0
  151. package/src/Separator.tsx +52 -0
  152. package/src/Sheet.tsx +139 -0
  153. package/src/Skeleton.tsx +77 -0
  154. package/src/Slider.tsx +100 -54
  155. package/src/Stepper.tsx +315 -0
  156. package/src/Switch.tsx +80 -58
  157. package/src/TabBar.tsx +118 -84
  158. package/src/Tabs.tsx +5 -0
  159. package/src/Textarea.tsx +34 -0
  160. package/src/Toast.tsx +131 -0
  161. package/src/Toggle.tsx +113 -0
  162. package/src/ToggleGroup.tsx +129 -0
  163. package/src/Toolbar.tsx +111 -0
  164. package/src/Tooltip.tsx +79 -0
  165. package/src/engine/CHANGELOG.md +430 -0
  166. package/src/engine/NOTICE +54 -0
  167. package/src/engine/README.md +975 -0
  168. package/src/engine/android/build.gradle +18 -0
  169. package/src/engine/android/src/main/AndroidManifest.xml +2 -0
  170. package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
  171. package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
  172. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
  173. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
  174. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
  175. package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
  176. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
  177. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
  178. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
  179. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
  180. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
  181. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
  182. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
  183. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
  184. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
  185. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
  186. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
  187. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
  188. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
  189. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
  190. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
  191. package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
  192. package/src/engine/index.ts +24 -0
  193. package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
  194. package/src/engine/ios/Enums/GlassVariant.swift +86 -0
  195. package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
  196. package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
  197. package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
  198. package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
  199. package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
  200. package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
  201. package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
  202. package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
  203. package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
  204. package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
  205. package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
  206. package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
  207. package/src/engine/ios/Glass/StripCache.swift +545 -0
  208. package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
  209. package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
  210. package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
  211. package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
  212. package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
  213. package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
  214. package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
  215. package/src/engine/package.json +70 -0
  216. package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
  217. package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
  218. package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
  219. package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
  220. package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
  221. package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
  222. package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
  223. package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
  224. package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
  225. package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
  226. package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
  227. package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
  228. package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
  229. package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
  230. package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
  231. package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
  232. package/src/engine/src/components/index.ts +16 -0
  233. package/src/engine/src/constants/index.ts +4 -0
  234. package/src/engine/src/constants/metal.constants.ts +327 -0
  235. package/src/engine/src/constants/metrics.constants.ts +325 -0
  236. package/src/engine/src/constants/springs.constants.ts +107 -0
  237. package/src/engine/src/constants/styles.constants.ts +12 -0
  238. package/src/engine/src/context/glass-group.context.ts +65 -0
  239. package/src/engine/src/context/index.ts +6 -0
  240. package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
  241. package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
  242. package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
  243. package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
  244. package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
  245. package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
  246. package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
  247. package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
  248. package/src/engine/src/core/components/index.ts +4 -0
  249. package/src/engine/src/core/constants/glass.constants.ts +57 -0
  250. package/src/engine/src/core/constants/index.ts +20 -0
  251. package/src/engine/src/core/constants/native.constants.ts +16 -0
  252. package/src/engine/src/core/context/glass-stack.context.ts +30 -0
  253. package/src/engine/src/core/context/index.ts +4 -0
  254. package/src/engine/src/core/enum/index.ts +12 -0
  255. package/src/engine/src/core/index.ts +1 -0
  256. package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
  257. package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
  258. package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
  259. package/src/engine/src/core/interfaces/index.ts +31 -0
  260. package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
  261. package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
  262. package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
  263. package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
  264. package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
  265. package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
  266. package/src/engine/src/core/modules/index.ts +2 -0
  267. package/src/engine/src/core/root/index.ts +51 -0
  268. package/src/engine/src/core/types/glass.types.ts +25 -0
  269. package/src/engine/src/core/types/index.ts +8 -0
  270. package/src/engine/src/core/utils/debug.utils.ts +17 -0
  271. package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
  272. package/src/engine/src/core/utils/hdr.utils.ts +37 -0
  273. package/src/engine/src/core/utils/index.ts +5 -0
  274. package/src/engine/src/core/utils/native-view.utils.ts +33 -0
  275. package/src/engine/src/core/utils/platform.utils.ts +34 -0
  276. package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
  277. package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
  278. package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
  279. package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
  280. package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
  281. package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
  282. package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
  283. package/src/engine/src/core/views/index.ts +4 -0
  284. package/src/engine/src/hooks/index.ts +18 -0
  285. package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
  286. package/src/engine/src/hooks/use-damped-drag.ts +332 -0
  287. package/src/engine/src/hooks/use-echo-filter.ts +55 -0
  288. package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
  289. package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
  290. package/src/engine/src/hooks/use-press-progress.ts +44 -0
  291. package/src/engine/src/index.ts +120 -0
  292. package/src/engine/src/interfaces/index.ts +28 -0
  293. package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
  294. package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
  295. package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
  296. package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
  297. package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
  298. package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
  299. package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
  300. package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
  301. package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
  302. package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
  303. package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
  304. package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
  305. package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
  306. package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
  307. package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
  308. package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
  309. package/src/engine/src/theme/glass-ui-theme.ts +100 -0
  310. package/src/engine/src/theme/index.ts +2 -0
  311. package/src/engine/src/utils/button-press.utils.ts +63 -0
  312. package/src/engine/src/utils/index.ts +3 -0
  313. package/src/engine/src/utils/metal.utils.ts +164 -0
  314. package/src/glass-provider.tsx +60 -0
  315. package/src/glass-stack.tsx +115 -0
  316. package/src/index.ts +48 -190
  317. package/src/internal/GlassBackdrop.tsx +60 -0
  318. package/src/internal/GlassView.tsx +70 -18
  319. package/src/internal/blur-community.ts +19 -0
  320. package/src/internal/blur-community.web.ts +7 -0
  321. package/src/internal/blur.ts +89 -0
  322. package/src/internal/fallback.tsx +158 -20
  323. package/src/internal/glass-routing.ts +211 -34
  324. package/src/internal/glow.tsx +62 -0
  325. package/src/internal/initials.ts +7 -0
  326. package/src/internal/lens.tsx +105 -0
  327. package/src/internal/material.ts +92 -0
  328. package/src/internal/overlay.tsx +258 -0
  329. package/src/internal/primitives.ts +26 -0
  330. package/src/internal/rim.tsx +79 -0
  331. package/src/internal/tokens.ts +34 -1
  332. package/lib/module/Carousel.js +0 -103
  333. package/lib/module/Display.js +0 -317
  334. package/lib/module/Feedback.js +0 -386
  335. package/lib/module/Form.js +0 -164
  336. package/lib/module/Forms2.js +0 -454
  337. package/lib/module/Message.js +0 -88
  338. package/lib/module/Overlays.js +0 -328
  339. package/lib/module/Pickers.js +0 -243
  340. package/lib/module/Table.js +0 -99
  341. package/lib/module/ai.js +0 -280
  342. package/lib/module/charts/AreaChart.js +0 -32
  343. package/lib/module/charts/BarChart.js +0 -67
  344. package/lib/module/charts/FunnelChart.js +0 -50
  345. package/lib/module/charts/HeatmapChart.js +0 -71
  346. package/lib/module/charts/LineChart.js +0 -81
  347. package/lib/module/charts/PlotChart.js +0 -52
  348. package/lib/module/charts/RadarChart.js +0 -78
  349. package/lib/module/charts/RingChart.js +0 -52
  350. package/lib/module/charts/ScatterChart.js +0 -95
  351. package/lib/module/charts/WaterfallChart.js +0 -85
  352. package/lib/module/charts/advanced.js +0 -313
  353. package/lib/module/charts/extra.js +0 -108
  354. package/lib/module/charts/index.js +0 -50
  355. package/lib/module/charts/scales.js +0 -140
  356. package/lib/typescript/Carousel.d.ts +0 -47
  357. package/lib/typescript/Display.d.ts +0 -178
  358. package/lib/typescript/Feedback.d.ts +0 -196
  359. package/lib/typescript/Form.d.ts +0 -97
  360. package/lib/typescript/Forms2.d.ts +0 -209
  361. package/lib/typescript/Message.d.ts +0 -71
  362. package/lib/typescript/Overlays.d.ts +0 -146
  363. package/lib/typescript/Pickers.d.ts +0 -105
  364. package/lib/typescript/Table.d.ts +0 -64
  365. package/lib/typescript/ai.d.ts +0 -166
  366. package/lib/typescript/charts/AreaChart.d.ts +0 -44
  367. package/lib/typescript/charts/BarChart.d.ts +0 -19
  368. package/lib/typescript/charts/FunnelChart.d.ts +0 -25
  369. package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
  370. package/lib/typescript/charts/LineChart.d.ts +0 -30
  371. package/lib/typescript/charts/PlotChart.d.ts +0 -31
  372. package/lib/typescript/charts/RadarChart.d.ts +0 -27
  373. package/lib/typescript/charts/RingChart.d.ts +0 -28
  374. package/lib/typescript/charts/ScatterChart.d.ts +0 -34
  375. package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
  376. package/lib/typescript/charts/advanced.d.ts +0 -107
  377. package/lib/typescript/charts/extra.d.ts +0 -63
  378. package/lib/typescript/charts/index.d.ts +0 -13
  379. package/lib/typescript/charts/scales.d.ts +0 -35
  380. package/src/Carousel.tsx +0 -233
  381. package/src/Display.tsx +0 -778
  382. package/src/Feedback.tsx +0 -969
  383. package/src/Form.tsx +0 -425
  384. package/src/Forms2.tsx +0 -1014
  385. package/src/Message.tsx +0 -219
  386. package/src/Overlays.tsx +0 -685
  387. package/src/Pickers.tsx +0 -590
  388. package/src/Table.tsx +0 -231
  389. package/src/ai.tsx +0 -707
  390. package/src/charts/AreaChart.tsx +0 -73
  391. package/src/charts/BarChart.tsx +0 -183
  392. package/src/charts/FunnelChart.tsx +0 -125
  393. package/src/charts/HeatmapChart.tsx +0 -155
  394. package/src/charts/LineChart.tsx +0 -247
  395. package/src/charts/PlotChart.tsx +0 -168
  396. package/src/charts/RadarChart.tsx +0 -208
  397. package/src/charts/RingChart.tsx +0 -133
  398. package/src/charts/ScatterChart.tsx +0 -223
  399. package/src/charts/WaterfallChart.tsx +0 -201
  400. package/src/charts/advanced.tsx +0 -676
  401. package/src/charts/extra.tsx +0 -242
  402. package/src/charts/index.ts +0 -86
  403. package/src/charts/scales.ts +0 -163
@@ -2,19 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GlassView = exports.isGlassSupported = void 0;
4
4
  exports.resetGlassRouter = resetGlassRouter;
5
+ exports.glassDecision = glassDecision;
6
+ exports.glassCapabilities = glassCapabilities;
5
7
  const jsx_runtime_1 = require("react/jsx-runtime");
6
8
  const react_1 = require("react");
7
9
  const fallback_1 = require("./fallback");
8
10
  const glass_routing_1 = require("./glass-routing");
9
11
  const motion_1 = require("./motion");
10
12
  /**
11
- * The installed `@callstack/liquid-glass` module's routing decision.
12
- *
13
- * Resolved lazily and memoised on first use, rather than at module load, so the
14
- * decision is taken when a surface first renders. On a device that is the same
15
- * answer either way — `isLiquidGlassSupported` is a constant of the installed
16
- * build — but it keeps the choice a property of the module rather than of
17
- * import order, which is what makes both branches reachable in tests.
13
+ * The installed engine module's routing decision, memoised on first use, rather
14
+ * than at module load, so the decision is taken when a surface first renders.
15
+ * On a device that is the same answer either way — the engine's capability flag
16
+ * is a constant of the installed build — but it keeps the choice a property of
17
+ * the module rather than of import order, which is what makes both branches
18
+ * reachable in tests.
18
19
  */
19
20
  let cachedRouter = null;
20
21
  function router() {
@@ -26,12 +27,32 @@ function router() {
26
27
  function resetGlassRouter() {
27
28
  cachedRouter = null;
28
29
  }
30
+ /**
31
+ * The memoised routing decision — the package's single source of truth for
32
+ * which glass surface a component may mount. Read through the same router the
33
+ * surface itself uses, so a component and its surface can never disagree about
34
+ * the mount tier.
35
+ */
36
+ function glassDecision() {
37
+ return router();
38
+ }
39
+ /**
40
+ * The capability verdicts the package switches on, read through the same
41
+ * memoised decision as the surface — the one place a component's engine branch
42
+ * and its fallback floor are chosen from.
43
+ */
44
+ function glassCapabilities() {
45
+ const decision = router();
46
+ return { supported: decision.supported, native: decision.native === true };
47
+ }
29
48
  /** Whether this build renders Apple's glass. */
30
49
  exports.isGlassSupported = (0, glass_routing_1.defaultRouter)().supported;
31
50
  /**
32
51
  * Platform Glass View — the single place a glass surface is chosen:
33
- * - iOS 26+: Real UIGlassEffect via @callstack/liquid-glass
34
- * - iOS < 26 / Android / Expo Go: translucent tint View with identical layout
52
+ * - iOS 26+: Real `UIGlassEffect` via the vendored engine's native view
53
+ * - iOS 16.4–25: the engine's Metal renderer over a captured backdrop
54
+ * - Android 13+: the engine's AGSL renderer over a recorded backdrop
55
+ * - Everywhere else: Glacia's own glass fallback of identical shape
35
56
  *
36
57
  * Reduce Transparency is honoured on the fallback branch only: there the
37
58
  * translucent tint is replaced by the theme's solid glass colour, with the same
@@ -41,12 +62,23 @@ exports.isGlassSupported = (0, glass_routing_1.defaultRouter)().supported;
41
62
  * overriding Apple's accessibility treatment would be worse than deferring to
42
63
  * it, so the real glass is left exactly as the system renders it.
43
64
  */
44
- exports.GlassView = (0, react_1.forwardRef)(function GlassView({ effect = "regular", tintColor, interactive = false, testID, style, children, isDark: isDarkProp, ...props }, ref) {
65
+ exports.GlassView = (0, react_1.forwardRef)(function GlassView({ effect = "regular", tintColor, interactive = false, surface = "panel", pressed, testID, style, children, isDark: isDarkProp, ...props }, ref) {
45
66
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
46
67
  const decision = router();
47
- if (decision.supported && decision.LiquidGlassView) {
68
+ // A deliberate "no surface here" (a ghost button) never mounts a material:
69
+ // the engine has no none-variant and the fallback paints nothing, so the
70
+ // content renders bare in both.
71
+ const bare = effect === "none";
72
+ if (!bare && decision.supported && decision.LiquidGlassView) {
48
73
  const LiquidGlassView = decision.LiquidGlassView;
49
- return ((0, jsx_runtime_1.jsx)(LiquidGlassView, { ref: ref, effect: effect, tintColor: tintColor, interactive: interactive, testID: testID, style: style, ...props, children: children }));
74
+ const variant = effect === "clear" ? "clear" : "regular";
75
+ const glow = pressed === undefined ? props.glow : { progress: pressed ? 1 : 0, lens: true };
76
+ // The engine owns the material; Glacia's own surface parameters stop at
77
+ // the branch. Everything else (accessibility contract, provider pairing,
78
+ // the adaptive sensor, an externally driven press) rides through.
79
+ return ((0, jsx_runtime_1.jsx)(LiquidGlassView, { ...props, ref: ref, variant: variant, tint: tintColor, interactive: interactive, glow: glow, style: style, testID: testID, children: children }));
50
80
  }
51
- return ((0, jsx_runtime_1.jsx)(fallback_1.FallbackGlassView, { ref: ref, effect: effect, tintColor: tintColor, testID: testID, isDark: isDark, style: style, ...props, children: children }));
81
+ // Unsupported, or a deliberate "no surface": the fallback floor renders —
82
+ // with the same shape, states and materials as the glass would have.
83
+ return ((0, jsx_runtime_1.jsx)(fallback_1.FallbackGlassView, { ref: ref, effect: effect, tintColor: tintColor, surface: surface, pressed: pressed, testID: testID, isDark: isDark, style: style, ...props, children: children }));
52
84
  });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // The bare-React-Native blur backend, isolated so platform resolution can
3
+ // choose whether this file exists at all.
4
+ //
5
+ // `@react-native-community/blur` ships BlurView.ios.js / BlurView.android.js
6
+ // with no web build, so a web bundle that statically requires it fails to
7
+ // resolve `./components/BlurView`. Metro uses `blur-community.web.ts` for the
8
+ // web platform instead, and this module is only ever bundled natively.
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.loadCommunityBlurView = loadCommunityBlurView;
11
+ /** The community `BlurView`, or null when the package is not installed. */
12
+ function loadCommunityBlurView() {
13
+ try {
14
+ const community = require("@react-native-community/blur");
15
+ return community?.BlurView ?? null;
16
+ }
17
+ catch {
18
+ return null;
19
+ }
20
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Web: the community blur has no web build, so it is never loaded and never
3
+ // resolved by Metro. `expo-blur` covers the web fallback through CSS blur.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.loadCommunityBlurView = loadCommunityBlurView;
6
+ /** Always null on web. */
7
+ function loadCommunityBlurView() {
8
+ return null;
9
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ // Backdrop blur for the fallback material.
3
+ //
4
+ // React Native has no backdrop blur of its own. The fallback's biggest missing
5
+ // layer is exactly that: without it a surface is a translucent rectangle, not
6
+ // glass. Two community backends provide a real native blur view, and the
7
+ // package accepts either:
8
+ //
9
+ // - `expo-blur` (Expo apps; also works on web through backdrop-filter)
10
+ // - `@react-native-community/blur` (bare React Native)
11
+ //
12
+ // They are optional peer dependencies, resolved at runtime like every other
13
+ // native module in this package: a project that installs neither still gets a
14
+ // working (unblurred) fallback instead of a crash, and the jsdom test run never
15
+ // touches a native module.
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.resolveBlurView = resolveBlurView;
18
+ exports.resetBlurResolver = resetBlurResolver;
19
+ exports.blurProps = blurProps;
20
+ const blur_community_1 = require("./blur-community");
21
+ let resolved;
22
+ /**
23
+ * The installed blur backend, or null when neither is available.
24
+ *
25
+ * Memoised: the answer is a property of the installed modules, not of the
26
+ * render, so resolving once keeps every surface on the same backend.
27
+ */
28
+ function resolveBlurView() {
29
+ if (resolved !== undefined)
30
+ return resolved;
31
+ try {
32
+ const expo = require("expo-blur");
33
+ if (expo?.BlurView) {
34
+ resolved = { kind: "expo", View: expo.BlurView };
35
+ return resolved;
36
+ }
37
+ }
38
+ catch {
39
+ // Not installed: try the bare-React-Native backend below.
40
+ }
41
+ const communityView = (0, blur_community_1.loadCommunityBlurView)();
42
+ if (communityView) {
43
+ resolved = { kind: "community", View: communityView };
44
+ return resolved;
45
+ }
46
+ // Neither backend is installed; the fallback renders tint, rim and shadow.
47
+ resolved = null;
48
+ return resolved;
49
+ }
50
+ /** Clears the memoised backend. Only tests call this. */
51
+ function resetBlurResolver() {
52
+ resolved = undefined;
53
+ }
54
+ /**
55
+ * The props one backend needs to blur a surface.
56
+ *
57
+ * The two libraries name the same idea differently — expo-blur takes a 0–100
58
+ * intensity and a tint, community-blur a 0–100 amount and a blur type — so the
59
+ * mapping lives here rather than in the fallback's render. Android needs an
60
+ * explicit method on expo-blur; Dimezis is its own real-time backdrop blur.
61
+ */
62
+ function blurProps(kind, intensity, isDark) {
63
+ if (kind === "expo") {
64
+ return {
65
+ intensity,
66
+ tint: isDark ? "dark" : "light",
67
+ experimentalBlurMethod: "dimezisBlurView",
68
+ };
69
+ }
70
+ return {
71
+ // Community blur amounts are coarser; the tint carries most of the read.
72
+ blurAmount: Math.max(1, Math.round(intensity / 1.6)),
73
+ blurType: isDark ? "dark" : "light",
74
+ };
75
+ }
@@ -6,40 +6,130 @@ const react_1 = require("react");
6
6
  const tokens_1 = require("./tokens");
7
7
  const primitives_1 = require("./primitives");
8
8
  const a11y_1 = require("./a11y");
9
+ const blur_1 = require("./blur");
10
+ const glow_1 = require("./glow");
11
+ const material_1 = require("./material");
12
+ const rim_1 = require("./rim");
13
+ const fill = { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 };
14
+ /** Layout and paint properties that belong to the surface itself. */
15
+ const HOISTED = new Set([
16
+ "backgroundColor",
17
+ "shadowColor",
18
+ "shadowOpacity",
19
+ "shadowRadius",
20
+ "shadowOffset",
21
+ "elevation",
22
+ ]);
23
+ /** Merges a style prop into one object; a function style is not resolvable here. */
24
+ function flattenStyle(style) {
25
+ if (!style)
26
+ return {};
27
+ if (Array.isArray(style)) {
28
+ return style.reduce((acc, entry) => ({ ...acc, ...flattenStyle(entry) }), {});
29
+ }
30
+ if (typeof style === "function")
31
+ return {};
32
+ return style;
33
+ }
9
34
  /**
10
35
  * Glacia's own glass surface for every platform where Apple's material is not
11
36
  * available: Android, iOS before 26, and Expo Go.
12
37
  *
13
- * It renders the resolver's real React Native `View` with the same shape and
14
- * layout as the native glass, so switching branches never shifts the layout.
38
+ * The material is the web one, rebuilt in layers, because a single flat View
39
+ * could never read as glass:
40
+ *
41
+ * 1. backdrop blur (`expo-blur` / `@react-native-community/blur` when either
42
+ * is installed — a real `UIVisualEffectView` on iOS 17),
43
+ * 2. the tint token on top of the blurred backdrop,
44
+ * 3. a painted rim light, brightest on the top edge, so corners read as curved,
45
+ * 4. a soft highlight just inside the top edge,
46
+ * 5. the 0.5px edge line, and
47
+ * 6. a drop shadow on the surface itself (outside the clipped layer).
48
+ *
49
+ * All of that lives in an absolutely-positioned, clipped layer behind the
50
+ * children. The caller's style stays on the outer View, so heights, padding and
51
+ * flex behaviour are byte-identical to the old flat implementation and
52
+ * switching branches never shifts the layout.
53
+ *
54
+ * Reduce Transparency still replaces the whole thing with a solid colour: the
55
+ * preference exists precisely to remove see-through surfaces.
15
56
  */
16
- exports.FallbackGlassView = (0, react_1.forwardRef)(function FallbackGlassView({ effect = "regular", tintColor, testID, style, children, isDark = false, reducedTransparency, ...props }, ref) {
57
+ exports.FallbackGlassView = (0, react_1.forwardRef)(function FallbackGlassView({ effect = "regular", surface = "panel", tintColor, pressed, testID, style, children, isDark = false, reducedTransparency, ...props }, ref) {
17
58
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
18
59
  const { View } = (0, primitives_1.primitives)();
19
60
  // Reduce Transparency means the translucent material is replaced by a solid
20
61
  // colour — the point of the preference is to remove see-through surfaces.
21
62
  const systemReduced = (0, a11y_1.useReducedTransparency)();
22
63
  const solid = reducedTransparency ?? systemReduced;
23
- const bg = solid
24
- ? effect === "none"
25
- ? "transparent"
26
- : tintColor && effect === "clear"
27
- ? tintColor
28
- : themeColors.glassSolid
29
- : effect === "none"
30
- ? "transparent"
64
+ const flat = flattenStyle(style);
65
+ const radius = typeof flat.borderRadius === "number" ? flat.borderRadius : tokens_1.radii.md;
66
+ const explicitBackground = typeof flat.backgroundColor === "string" ? flat.backgroundColor : undefined;
67
+ // `effect="none"` is a deliberate "no surface here" (a ghost button); it
68
+ // paints nothing at all, exactly as before.
69
+ const bare = effect === "none";
70
+ const layered = !solid && !bare;
71
+ const profile = (0, material_1.materialFor)(surface, bare ? "regular" : effect, isDark);
72
+ const blur = layered ? (0, blur_1.resolveBlurView)() : null;
73
+ const surfaceStyle = { ...flat };
74
+ for (const key of HOISTED)
75
+ delete surfaceStyle[key];
76
+ // The edge is the web's 0.5px inset line. A component that draws only one
77
+ // edge (AppBar's scroll edge) keeps its own widths; a component that asked
78
+ // for a 1px box border is brought back to the hairline.
79
+ const perEdge = ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"].some((key) => typeof flat[key] === "number");
80
+ if (typeof flat.borderWidth === "number") {
81
+ surfaceStyle.borderWidth = Math.min(flat.borderWidth, 0.5);
82
+ }
83
+ else if (!perEdge) {
84
+ surfaceStyle.borderWidth = 0.5;
85
+ }
86
+ surfaceStyle.borderColor = flat.borderColor ?? themeColors.edge;
87
+ surfaceStyle.borderRadius = radius;
88
+ if (solid) {
89
+ // The solid path is the old single flat view: opaque, no layers, and the
90
+ // caller's own background (a filled button) still wins over the token.
91
+ surfaceStyle.backgroundColor =
92
+ flat.backgroundColor ??
93
+ (effect === "clear" && tintColor ? tintColor : themeColors.glassSolid);
94
+ surfaceStyle.overflow = "hidden";
95
+ }
96
+ else if (bare) {
97
+ surfaceStyle.backgroundColor = flat.backgroundColor ?? "transparent";
98
+ surfaceStyle.overflow = "hidden";
99
+ }
100
+ else {
101
+ // Layered material. An opaque background is a filled control, not glass:
102
+ // it still gets a rim so it does not read as a sticker, but no blur tint.
103
+ const opaque = Boolean(explicitBackground);
104
+ const tint = opaque
105
+ ? explicitBackground
31
106
  : effect === "clear"
32
107
  ? isDark
33
108
  ? "rgba(28, 28, 30, 0.35)"
34
109
  : "rgba(255, 255, 255, 0.35)"
35
110
  : tintColor || themeColors.glass;
36
- const containerStyle = {
37
- backgroundColor: bg,
38
- borderColor: themeColors.edge,
39
- borderWidth: 0.5,
40
- borderRadius: tokens_1.radii.md,
41
- overflow: "hidden",
42
- ...style,
43
- };
44
- return ((0, jsx_runtime_1.jsx)(View, { ref: ref, testID: testID, style: containerStyle, ...props, children: children }));
111
+ const rim = opaque ? profile.rim * 0.5 : profile.rim;
112
+ const highlight = opaque ? profile.highlight * 0.5 : profile.highlight;
113
+ const blurrable = Boolean(blur) && !opaque;
114
+ const shadowOpacity = typeof flat.shadowOpacity === "number" ? flat.shadowOpacity : profile.shadowOpacity;
115
+ const shadowRadius = typeof flat.shadowRadius === "number" ? flat.shadowRadius : profile.shadowRadius;
116
+ const shadowHeight = typeof flat.shadowOffset?.height === "number"
117
+ ? flat.shadowOffset.height
118
+ : profile.shadowOffsetY;
119
+ // The hint family (badges, tooltips) sits flush with the page on the web.
120
+ const lifts = !(0, material_1.isFlatProfile)(surface) && shadowOpacity > 0;
121
+ return ((0, jsx_runtime_1.jsxs)(View, { ref: ref, testID: testID, style: [
122
+ surfaceStyle,
123
+ lifts
124
+ ? {
125
+ shadowColor: tokens_1.material.shadowColor,
126
+ shadowOpacity,
127
+ shadowRadius,
128
+ shadowOffset: { width: 0, height: shadowHeight },
129
+ elevation: typeof flat.elevation === "number" ? flat.elevation : profile.elevation,
130
+ }
131
+ : null,
132
+ ], ...props, children: [(0, jsx_runtime_1.jsxs)(View, { testID: testID ? `${testID}-material` : undefined, style: [fill, { borderRadius: radius, overflow: "hidden" }], pointerEvents: "none", children: [blurrable && blur ? ((0, jsx_runtime_1.jsx)(blur.View, { ...(0, blur_1.blurProps)(blur.kind, profile.blur, isDark), style: [fill, { borderRadius: radius }] })) : null, (0, jsx_runtime_1.jsx)(View, { testID: testID ? `${testID}-tint` : undefined, style: [fill, { backgroundColor: tint }] }), (0, jsx_runtime_1.jsx)(rim_1.GlassRim, { radius: radius, rim: rim, highlight: highlight }), pressed !== undefined ? (0, jsx_runtime_1.jsx)(glow_1.SurfaceGlow, { active: pressed }) : null] }), children] }));
133
+ }
134
+ return ((0, jsx_runtime_1.jsx)(View, { ref: ref, testID: testID, style: surfaceStyle, ...props, children: children }));
45
135
  });
@@ -1,63 +1,187 @@
1
1
  "use strict";
2
2
  // The glass switch — the law of this library.
3
3
  //
4
- // Every glass surface in every Glacia Native component goes through
5
- // `GlassView`, which routes here. On iOS 26+ `@callstack/liquid-glass` reports
6
- // `isLiquidGlassSupported === true` and the surface is rendered by Apple's
7
- // real `UIGlassEffect` (`LiquidGlassView`). Everywhere else — older iOS,
8
- // Android, Expo Go, or a build without the module — it is Glacia's own
9
- // translucent fallback of identical shape.
4
+ // Every glass surface in every Glacia Native component goes through the package
5
+ // surface, which routes here. The decision now comes from the engine vendored
6
+ // into this package (`src/engine` — a copy of
7
+ // https://github.com/capthndsme/expo-liquid-glass-ui, MIT), not from an external
8
+ // `@callstack/liquid-glass` package: the rebuild patches the engine's iOS capture
9
+ // code, which a dependency could not receive.
10
10
  //
11
- // The decision is split out from the React component so both branches can be
11
+ // The decision is split out of the React component so both branches can be
12
12
  // exercised in tests: `routerFor` takes the module as an argument, and the
13
- // default export routes on whatever is installed. On a device the argument is
14
- // always the installed module, so the routing logic is unchanged.
13
+ // default export routes on whatever the vendored engine reports. On a device
14
+ // the argument is always the vendored engine module, so the routing logic is
15
+ // unchanged; only its source moved.
15
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ENGINE_CONTROL_NAMES = void 0;
16
18
  exports.routerFor = routerFor;
17
- exports.loadLiquidGlass = loadLiquidGlass;
18
19
  exports.defaultRouter = defaultRouter;
20
+ exports.loadLiquidGlass = loadLiquidGlass;
21
+ exports.readCapabilities = readCapabilities;
22
+ exports.supportsGlass = supportsGlass;
23
+ exports.supportsNativeGlass = supportsNativeGlass;
24
+ exports.loadBackdropScope = loadBackdropScope;
25
+ exports.resetBackdropScope = resetBackdropScope;
26
+ exports.loadEngineControl = loadEngineControl;
19
27
  /**
20
28
  * Reads a liquid-glass module and decides which branch renders.
21
29
  *
22
30
  * A module only counts as supported when it exports the view *and* reports
23
- * support; a missing export falls back rather than crashing.
31
+ * support; a missing export falls back rather than crashing. Below every glass
32
+ * tier the answer is `false`, which is what routes the surface to Glacia's
33
+ * fallback floor.
24
34
  */
25
35
  function routerFor(module) {
26
36
  const view = module?.LiquidGlassView ?? null;
27
- const container = module?.LiquidGlassContainerView ?? null;
37
+ const container = module?.LiquidGlassContainer ?? module?.LiquidGlassContainerView ?? null;
38
+ const provider = module?.LiquidGlassProvider ?? null;
39
+ const stack = module?.LiquidGlassStack ?? null;
40
+ const supported = Boolean(module?.LiquidGlassView) &&
41
+ (module?.supportsGlass ?? module?.isLiquidGlassSupported ?? false) === true;
28
42
  return {
29
- // A module that reports support but lacks the container still renders real
30
- // glass; the container is only needed by GlassContainer, which falls back
31
- // when it is missing.
32
- supported: Boolean(module?.isLiquidGlassSupported) && Boolean(view),
43
+ supported,
33
44
  LiquidGlassView: view,
34
- // The container merges only when the material itself is available; a
35
- // container without the view would have nothing to merge.
36
45
  LiquidGlassContainerView: container,
46
+ LiquidGlassProvider: provider,
47
+ LiquidGlassStack: stack,
48
+ native: module?.supportsNativeGlass === true,
37
49
  };
38
50
  }
39
51
  /**
40
- * Loads `@callstack/liquid-glass` at runtime.
52
+ * Loads the vendored glass engine.
41
53
  *
42
54
  * Resolved through `require` rather than a static import so the package stays
43
- * importable where the native module is absent (jsdom tests, web preview).
44
- * `isLiquidGlassSupported` is a constant baked by the package's own platform
45
- * resolution: its iOS build reads the native module and answers true only on
46
- * iOS 26+; the default build answers false.
55
+ * importable where the native module is absent (jsdom tests, web preview). The
56
+ * engine's `supportsGlass` is a constant of the installed build — its iOS build
57
+ * reads the native module and answers true only on iOS 26+, its Android build
58
+ * answers for the AGSL tier — so loading it is how the verdict is learned.
47
59
  */
48
- function loadLiquidGlass() {
49
- try {
50
- const module = require("@callstack/liquid-glass");
51
- if (module && (module.LiquidGlassView || module.isLiquidGlassSupported !== undefined)) {
52
- return module;
53
- }
60
+ const ENGINE_MODULE_ID = "../engine";
61
+ function requireEngineModule() {
62
+ const scope = globalThis;
63
+ const req = typeof require === "function" ? require : scope.require;
64
+ if (typeof req !== "function")
54
65
  return null;
66
+ try {
67
+ const module = req(ENGINE_MODULE_ID);
68
+ return module ?? null;
55
69
  }
56
70
  catch {
71
+ // The engine (or its native module) is not resolvable here: unsupported.
57
72
  return null;
58
73
  }
59
74
  }
60
- /** The installed module's routing decision, computed once per process. */
75
+ /** The installed engine's routing decision, computed once per process. */
61
76
  function defaultRouter() {
62
77
  return routerFor(loadLiquidGlass());
63
78
  }
79
+ /** The installed engine's glass module, or null when it cannot be loaded. */
80
+ function loadLiquidGlass() {
81
+ const module = requireEngineModule();
82
+ if (module && (module.LiquidGlassView || module.supportsGlass !== undefined)) {
83
+ return module;
84
+ }
85
+ return null;
86
+ }
87
+ /** Reads the capability verdicts from an explicit module, or from the engine. */
88
+ function readCapabilities(module) {
89
+ const resolved = module !== undefined ? module : loadLiquidGlass();
90
+ const supported = resolved != null &&
91
+ Boolean(resolved.LiquidGlassView) &&
92
+ (resolved.supportsGlass ?? resolved.isLiquidGlassSupported ?? false) === true;
93
+ const native = resolved?.supportsNativeGlass === true;
94
+ return { supported, native };
95
+ }
96
+ /**
97
+ * Whether any glass renderer is available on this device — the mount gate.
98
+ *
99
+ * Resolves instead of blocking: the caller renders either the glass surface or
100
+ * the fallback floor from this, and the floor is the safe answer, so the check
101
+ * must always be able to finish. When no renderer verdict has arrived the
102
+ * absence *is* the verdict — unsupported — and the fallback floor renders.
103
+ */
104
+ function supportsGlass(module) {
105
+ const capabilities = readCapabilities(module);
106
+ return Promise.resolve(capabilities.supported);
107
+ }
108
+ /**
109
+ * Whether Apple's own glass material (`UIGlassEffect`) is available — iOS 26+.
110
+ * The narrower question behind the mount gate; the renderer tier machinery picks
111
+ * Metal or AGSL below that.
112
+ */
113
+ function supportsNativeGlass(module) {
114
+ const resolved = module !== undefined ? module : loadLiquidGlass();
115
+ return resolved?.supportsNativeGlass === true;
116
+ }
117
+ /**
118
+ * The vendored engine's control components, by the Glacia-facing name.
119
+ *
120
+ * Every Wave 1 control is the engine's own component mounted through the same
121
+ * capability verdict the glass surface uses, so an unsupported device (or Expo
122
+ * Go, or Reduce Transparency) takes the Glacia fallback floor instead of the
123
+ * engine's own degrade-to-plain-view.
124
+ */
125
+ const ENGINE_CONTROLS = {
126
+ Button: "LiquidGlassButton",
127
+ IconButton: "LiquidGlassIconButton",
128
+ Chip: "LiquidGlassChip",
129
+ Switch: "LiquidGlassSwitch",
130
+ Slider: "LiquidGlassSlider",
131
+ Stepper: "LiquidGlassStepper",
132
+ SegmentedControl: "LiquidGlassSegmentedControl",
133
+ Input: "LiquidGlassTextInput",
134
+ Card: "LiquidGlassCard",
135
+ Toolbar: "LiquidGlassToolbar",
136
+ Toast: "LiquidGlassToast",
137
+ Sheet: "LiquidGlassSheet",
138
+ TabBar: "LiquidGlassTabBar",
139
+ Group: "LiquidGlassGroup",
140
+ MorphGroup: "LiquidGlassMorphGroup",
141
+ Scrim: "LiquidGlassScrim",
142
+ };
143
+ /**
144
+ * The native backdrop scope, when the active tier is the Metal renderer.
145
+ *
146
+ * Only iOS 16.4–25 needs it: iOS 26+ reads the live window through Apple's own glass, and the
147
+ * Android renderer already has a provider contract of its own. Off that tier this is null and
148
+ * callers render a plain wrapper, so a `GlassBackdrop` never changes layout where it does
149
+ * nothing.
150
+ */
151
+ let cachedBackdropScope;
152
+ /**
153
+ * Resolves the scope for the active tier. An explicit module is used by tests, the same way
154
+ * `readCapabilities` takes one: the routing question must be answerable without a device.
155
+ */
156
+ function loadBackdropScope(module) {
157
+ if (module !== undefined) {
158
+ const capabilities = readCapabilities(module);
159
+ return capabilities.supported && !capabilities.native
160
+ ? module?.NativeGlassBackdropView ?? null
161
+ : null;
162
+ }
163
+ if (cachedBackdropScope !== undefined)
164
+ return cachedBackdropScope;
165
+ const capabilities = readCapabilities();
166
+ const engine = requireEngineModule();
167
+ cachedBackdropScope =
168
+ capabilities.supported && !capabilities.native
169
+ ? engine?.NativeGlassBackdropView ?? null
170
+ : null;
171
+ return cachedBackdropScope;
172
+ }
173
+ /** Clears the memoised backdrop route. Tests call this after flipping the module. */
174
+ function resetBackdropScope() {
175
+ cachedBackdropScope = undefined;
176
+ }
177
+ /** The Glacia names of every control the vendored engine carries. */
178
+ exports.ENGINE_CONTROL_NAMES = Object.freeze(Object.keys(ENGINE_CONTROLS));
179
+ /** Loads one of the vendored engine's control components by Glacia-facing name. */
180
+ function loadEngineControl(key) {
181
+ const engine = requireEngineModule();
182
+ const engineName = ENGINE_CONTROLS[key];
183
+ if (!engine || !engineName)
184
+ return null;
185
+ const control = engine[engineName];
186
+ return control ?? null;
187
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SurfaceGlow = SurfaceGlow;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // The specular press highlight, painted as a radial glow.
6
+ //
7
+ // The web material fades a 240px radial white highlight in under the finger
8
+ // for 220ms whenever a glass control is held. That is what makes a press feel
9
+ // like touching a lens rather than a flat sticker. The fallback had only an
10
+ // opacity dip, so controls never looked held.
11
+ //
12
+ // The glow lives inside the clipped material layer, so it follows the same
13
+ // radius as the surface and can never spill outside it.
14
+ const react_1 = require("react");
15
+ const motion_1 = require("./motion");
16
+ const primitives_1 = require("./primitives");
17
+ const tokens_1 = require("./tokens");
18
+ const fill = { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 };
19
+ /**
20
+ * A radial highlight that fades in while `active`.
21
+ *
22
+ * Motion uses the package's spring tokens and respects Reduce Motion: with the
23
+ * preference on, the glow appears at its end state rather than fading.
24
+ */
25
+ function SurfaceGlow({ active }) {
26
+ const { Svg, Defs, RadialGradient, Stop, Rect, Animated } = (0, primitives_1.primitives)();
27
+ const { value, animated } = (0, motion_1.useSpring)(active ? 1 : 0, "snappy");
28
+ const gradientId = `glow-${(0, react_1.useId)().replace(/[^a-zA-Z0-9_-]/g, "")}`;
29
+ const painting = ((0, jsx_runtime_1.jsxs)(Svg, { width: "100%", height: "100%", style: fill, pointerEvents: "none", children: [(0, jsx_runtime_1.jsx)(Defs, { children: (0, jsx_runtime_1.jsxs)(RadialGradient, { id: gradientId, cx: "50%", cy: "50%", r: "50%", children: [(0, jsx_runtime_1.jsx)(Stop, { offset: "0", stopColor: tokens_1.material.rimColor, stopOpacity: tokens_1.material.glow }), (0, jsx_runtime_1.jsx)(Stop, { offset: "1", stopColor: tokens_1.material.rimColor, stopOpacity: 0 })] }) }), (0, jsx_runtime_1.jsx)(Rect, { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${gradientId})` })] }));
30
+ // Off-device there is no Animated API; the settled state is what a preview
31
+ // should show, exactly as `useSpring` documents.
32
+ if (!animated) {
33
+ return ((0, jsx_runtime_1.jsx)(Animated.View, { style: [fill, { opacity: active ? 1 : 0 }], pointerEvents: "none", children: painting }));
34
+ }
35
+ return ((0, jsx_runtime_1.jsx)(Animated.View, { style: [fill, { opacity: value }], pointerEvents: "none", children: painting }));
36
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialsOf = initialsOf;
4
+ /** The initials an avatar shows when there is no picture. Kept in one place. */
5
+ function initialsOf(name) {
6
+ const words = name.trim().split(/\s+/).filter(Boolean);
7
+ if (words.length === 0)
8
+ return "";
9
+ if (words.length === 1)
10
+ return words[0].slice(0, 2).toUpperCase();
11
+ return (words[0][0] + words[words.length - 1][0]).toUpperCase();
12
+ }