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
@@ -0,0 +1,180 @@
1
+ import ExpoModulesCore
2
+
3
+ // Mirrors `src/core/interfaces/glass-metal.interface.ts` and the Android
4
+ // `records/GlassRecords.kt`. Every field is optional so "not supplied" stays distinguishable
5
+ // from a supplied value — the per-variant defaults apply only to fields the caller left out.
6
+
7
+ public struct GlassRefractionOptions: Record {
8
+
9
+ @Field public var amount: Double?
10
+
11
+ @Field public var width: Double?
12
+
13
+ @Field public var height: Double?
14
+
15
+ @Field public var depth: Double?
16
+
17
+ /// How far the edge refraction leans toward the highlight's light axis, unitless like
18
+ /// `depth`. Default 0 — measured real iOS 26 carries no lean. Clamped to [-1, 1].
19
+ @Field public var swirl: Double?
20
+
21
+ @Field public var curve: GlassRefractionCurve?
22
+
23
+ public init() {}
24
+ }
25
+
26
+ public struct GlassDispersionOptions: Record {
27
+
28
+ @Field public var amount: Double?
29
+
30
+ @Field public var reach: Double?
31
+
32
+ /// How much of the fringe follows Kyant's quadrant weighting, 0..1. Default 0 — an even rim
33
+ /// fringe the whole way round.
34
+ @Field public var quadrant: Double?
35
+
36
+ public init() {}
37
+ }
38
+
39
+ public struct GlassHighlightOptions: Record {
40
+
41
+ @Field public var intensity: Double?
42
+
43
+ /// Degrees, screen-space with y increasing downward.
44
+ @Field public var angle: Double?
45
+
46
+ /// Depth of the glass border light, points. Default 0.75.
47
+ @Field public var width: Double?
48
+
49
+ /// Angular falloff exponent of the two light lobes. Default 1; floored at 0.01.
50
+ @Field public var falloff: Double?
51
+
52
+ public init() {}
53
+ }
54
+
55
+ public struct GlassBorderOptions: Record {
56
+
57
+ @Field public var width: Double?
58
+
59
+ @Field public var opacity: Double?
60
+
61
+ public init() {}
62
+ }
63
+
64
+ public struct GlassProgressiveBlurOptions: Record {
65
+
66
+ @Field public var startRadius: Double?
67
+
68
+ @Field public var endRadius: Double?
69
+
70
+ @Field public var direction: GlassBlurDirection?
71
+
72
+ @Field public var start: Double?
73
+
74
+ @Field public var end: Double?
75
+
76
+ public init() {}
77
+ }
78
+
79
+ public struct GlassShapeOptions: Record {
80
+
81
+ @Field public var x: Double?
82
+
83
+ @Field public var y: Double?
84
+
85
+ @Field public var width: Double?
86
+
87
+ @Field public var height: Double?
88
+
89
+ public init() {}
90
+ }
91
+
92
+ public struct GlassMorphOptions: Record {
93
+
94
+ @Field public var x: Double?
95
+
96
+ @Field public var y: Double?
97
+
98
+ @Field public var width: Double?
99
+
100
+ @Field public var height: Double?
101
+
102
+ @Field public var cornerRadius: Double?
103
+
104
+ @Field public var smoothing: Double?
105
+
106
+ public init() {}
107
+ }
108
+
109
+ /// The inner shadow: a soft dark band along the inside of the silhouette, the shape minus itself
110
+ /// translated by the offset and blurred by the radius (Kyant's `InnerShadow`). `radius` 0 is off.
111
+ public struct GlassInnerShadowOptions: Record {
112
+
113
+ /// Blur radius, points. 0 disables.
114
+ @Field public var radius: Double?
115
+
116
+ /// Where the shadow is cast, points. Defaults: x 0, y = radius — lit from above, so the
117
+ /// pane's top lip shades the top inner edge.
118
+ @Field public var offsetX: Double?
119
+
120
+ @Field public var offsetY: Double?
121
+
122
+ /// Strength of the (black) shadow, 0..1. Default 0.15.
123
+ @Field public var opacity: Double?
124
+
125
+ public init() {}
126
+ }
127
+
128
+ /// A press that happened somewhere else — the app-choreographed twin of `interactive`. The bar
129
+ /// hosting a dragged pill is the canonical case: the finger is on the pill, the bar lights up.
130
+ /// Non-nil takes over the press uniforms entirely; `interactive`'s own animator stops reaching
131
+ /// the shader until it goes back to nil. Never touches the view's transform.
132
+ public struct GlassGlowOptions: Record {
133
+
134
+ /// 0 = at rest and the shader's branch is off; 1 = fully lit.
135
+ @Field public var progress: Double = 0
136
+
137
+ /// Hotspot, view-local points. Both default to the view's centre.
138
+ @Field public var x: Double?
139
+
140
+ @Field public var y: Double?
141
+
142
+ /// Whether the press also bends the glass — the backdrop dent and the lens boost. Default
143
+ /// false: a surface hosting someone else's press should light up, not refract harder.
144
+ @Field public var lens: Bool = false
145
+
146
+ public init() {}
147
+ }
148
+
149
+ public struct GlassMetalOptions: Record {
150
+
151
+ @Field public var blurRadius: Double?
152
+ @Field public var captureQuality: Double?
153
+ @Field public var opacity: Double?
154
+
155
+ @Field public var frost: Double?
156
+ @Field public var saturation: Double?
157
+ @Field public var noise: Double?
158
+ @Field public var light: Double?
159
+
160
+ /// A whole-surface lens: the backdrop reads enlarged through the pane, contracting toward
161
+ /// the shape's center. 1 = none; clamped to [1, 4].
162
+ @Field public var magnification: Double?
163
+
164
+ @Field public var refraction: GlassRefractionOptions?
165
+ @Field public var dispersion: GlassDispersionOptions?
166
+ @Field public var highlight: GlassHighlightOptions?
167
+ @Field public var border: GlassBorderOptions?
168
+ @Field public var innerShadow: GlassInnerShadowOptions?
169
+ @Field public var shape: GlassShapeOptions?
170
+ @Field public var morph: GlassMorphOptions?
171
+ @Field public var progressiveBlur: GlassProgressiveBlurOptions?
172
+
173
+ /// The wash over the glass. Present, it overrides the view's own `tint` prop: a recipe
174
+ /// carries its own colour, so `lerpMetal` can crossfade it between two recipes on the UI
175
+ /// thread and a `metal` object fully describes a look. Arrives as a hex string or a
176
+ /// processed ARGB number, both of which the Color converter takes.
177
+ @Field public var tint: UIColor?
178
+
179
+ public init() {}
180
+ }
@@ -0,0 +1,14 @@
1
+ import ExpoModulesCore
2
+
3
+ public struct GlassRefractionCurve: Record {
4
+
5
+ @Field public var power: Double = 1
6
+
7
+ @Field public var bias: Double = 0
8
+
9
+ public init() {}
10
+
11
+ var simd: SIMD2<Float> {
12
+ SIMD2<Float>(Float(power), Float(bias))
13
+ }
14
+ }
@@ -0,0 +1,480 @@
1
+ #include <metal_stdlib>
2
+ using namespace metal;
3
+
4
+ // =============================================================================================
5
+ // LiquidGlass.metal — the pre-iOS-26 renderer.
6
+ //
7
+ // The glass pass is kept line-for-line in step with the Android AGSL build
8
+ // (android/.../glass/GlassShaderSource.kt), which is where every remodel against real iOS 26
9
+ // glass was measured (docs/android-port/research/04): the continuous-corner SDF family, the
10
+ // additive two-lobe border light, longitudinal dispersion, the press dent and glow, the inner
11
+ // shadow and the whole-surface magnification. One algorithm, two languages; a divergence
12
+ // between them is a bug in whichever side moved last.
13
+ //
14
+ // Coordinate space: view-local POINTS, origin at the view's top-left, y down. Every length in
15
+ // GlassParams is in points. (Android works in device pixels and carries a `unitScale`; here a
16
+ // point IS the unit, so the hard-coded point values below need no conversion.)
17
+ //
18
+ // Portions of the Android build derive from AndroidLiquidGlass (Apache-2.0, (c) 2025 Kyant) —
19
+ // the rounded-rect SDF decomposition, the highlight's angular falloff model and the press glow;
20
+ // see NOTICE. Those came home to this file with the parity pass.
21
+ // =============================================================================================
22
+
23
+ struct VertexOut {
24
+ float4 position [[position]];
25
+ float2 uv;
26
+ };
27
+
28
+ struct BlurParams {
29
+
30
+ float4 uvRect;
31
+
32
+ // The progressive ramp (metal.progressiveBlur). rampLine.xy is the view-local point (in
33
+ // points, y-down) where the ramp begins, rampLine.zw is the unit direction divided by the
34
+ // ramp's length so a dot() lands directly in 0..1. rampRadii holds the leading and trailing
35
+ // radii in texels; a negative x disables the ramp and the uniform `radius` applies.
36
+ float4 rampLine;
37
+ float2 rampRadii;
38
+ float2 paddedSize; // the padded region this pass covers, points
39
+
40
+ float2 texelStep;
41
+ float radius;
42
+ float padding; // points of padding on each side: viewPos = uv * paddedSize - padding
43
+ };
44
+
45
+ // Field order and types mirror GlassRenderContext.swift's GlassParams exactly: eight float4s,
46
+ // seven float2s, then seventeen floats — every member naturally aligned in both layouts, so
47
+ // neither compiler inserts interior padding and every offset agrees (252 bytes of fields, 256
48
+ // with the trailing alignment pad on both sides). Reorder one side and the shader reads garbage.
49
+ // docs/inspiration-port/tools/check-params-layout.py verifies the two against each other.
50
+ struct GlassParams {
51
+ float4 cornerExtents; // corner-cell extents, points, packed (BL, BR, TR, TL). E = r for a
52
+ // circular corner, up to 1.5287 r for a continuous one.
53
+ float4 cornerShapes; // superellipse exponent per corner, same packing. 2 = circular,
54
+ // 3.3418 = Apple's continuous corner (research/05).
55
+ float4 tintColor; // straight RGBA
56
+ float4 frostColor; // rgb = system background, a = frost amount
57
+ float4 sourceRect; // where this view sits in the sampled texture, UV
58
+ float4 morphRect; // the morph partner: xy = its center's offset from the SHAPE
59
+ // center, zw = its half extents. Points, like every length here.
60
+ float4 innerShadow; // rgb = shadow colour, a = its opacity. a <= 0 turns the band off.
61
+ float4 touch; // xy = press hotspot (view-local points), z = glow 0..1,
62
+ // w = the lens gate: 1 for a press on this glass, 0 for one
63
+ // reported from elsewhere (light only, no dent).
64
+
65
+ float2 morphShape; // (partner corner radius, smoothing); smoothing <= 0 = off
66
+ float2 viewSize;
67
+ float2 shapeSize; // the primary shape's size; == viewSize unless metal.shape insets it
68
+ float2 shapeOffset; // the shape center relative to the view center; zero by default
69
+ float2 refractionScale;
70
+ float2 highlightDir; // (cos angle, sin angle) — the per-pixel sin/cos pair, hoisted
71
+ float2 innerShadowOffset; // points
72
+
73
+ float refractionAmount;
74
+ float refractionSwirl; // lean of the displacement toward the light axis; 0 = none
75
+ float depthEffect;
76
+ float profilePower;
77
+ float profileBias;
78
+ float dispersionHeight;
79
+ float dispersionAmount;
80
+ float dispersionQuadrant; // 0 = even rim fringe (iOS), 1 = Kyant's corner weighting
81
+ float highlightIntensity;
82
+ float highlightWidth; // depth of the crisp border light, points
83
+ float highlightFalloff; // angular falloff exponent of the two lobes, >= 0.01
84
+ float lightIntensity;
85
+ float glassOpacity;
86
+ float saturation;
87
+ float noiseAmount;
88
+ float innerShadowRadius; // points; 0 = off
89
+ float magnification; // >= 1; 1 = none. Sampling contracts toward the shape center.
90
+ };
91
+
92
+ vertex VertexOut liquid_glass_vertex(const device float4 *vertices [[buffer(0)]],
93
+ uint vid [[vertex_id]]) {
94
+ VertexOut out;
95
+ out.position = float4(vertices[vid].xy, 0.0, 1.0);
96
+ out.uv = vertices[vid].zw;
97
+ return out;
98
+ }
99
+
100
+ constant float kNormEps = 1e-6;
101
+ constant int kBlurTaps = 8;
102
+ constant int kDispersionTaps = 16;
103
+
104
+ // The faint broad glow under the lit edges, points deep (research/04: ~7 pt on real iOS 26).
105
+ constant float kSheenDepth = 7.0;
106
+
107
+ constexpr sampler linearSampler(mag_filter::linear,
108
+ min_filter::linear,
109
+ address::clamp_to_edge);
110
+
111
+ // ----------------------------------------------------------------------------------- geometry
112
+
113
+ // NaN-free normalize. A ternary is not safe: if the compiler lowers `cond ? normalize(v) : fb`
114
+ // to an arithmetic select then normalize(0) = NaN is still multiplied by 0, and NaN * 0 = NaN.
115
+ // The division form cannot produce NaN for any finite v, because the denominator is floored.
116
+ inline float2 safeNormalize(float2 v, float2 fallback) {
117
+ float len = length(v);
118
+ float ok = step(kNormEps, len);
119
+ return mix(fallback, v / max(len, kNormEps), ok);
120
+ }
121
+
122
+ // Quadrant-select any per-corner packed float4 (extents, shapes). The argument MUST be the
123
+ // CENTERED coordinate, y down.
124
+ inline float cornerParam(float2 c, float4 corners) {
125
+ if (c.x >= 0.0) {
126
+ return (c.y <= 0.0) ? corners.z : corners.y; // right-top : right-bottom
127
+ }
128
+ return (c.y <= 0.0) ? corners.w : corners.x; // left-top : left-bottom
129
+ }
130
+
131
+ // The rounded-rect SDF, extended to the continuous-corner family (research/05): a corner is a
132
+ // superellipse quadrant in an E x E cell, and (E = r, n = 2) IS the circular corner — the
133
+ // else-branch is the original Euclidean SDF verbatim, with E in place of r. The edge and
134
+ // interior algebra cancels E exactly as it cancelled r, so straight edges stay exact for any
135
+ // extent.
136
+ //
137
+ // The corner branch is the n-norm field with a first-order Euclidean correction,
138
+ // sd ~ (g - E) / |grad g|. Measured against the true curve: error <= 0.11 px at 20 px depth,
139
+ // growing only where the refraction profile has already decayed to ~0. pow() is only ever
140
+ // called with a strictly positive base (the qp > 0 guards), so pow(x < 0) and pow(0, 0) are
141
+ // unreachable.
142
+ inline float sdGlassRect(float2 c, float2 halfSize, float4 extents, float4 shapes) {
143
+ // The host resolves the view's own extents; the min() is for rects it cannot see — a
144
+ // `metal.shape` smaller than the radii resolved against it. innerHalf < 0 breaks the SDF.
145
+ float E = min(cornerParam(c, extents), min(halfSize.x, halfSize.y));
146
+ float n = cornerParam(c, shapes);
147
+ float2 innerHalf = halfSize - float2(E);
148
+ float2 q = abs(c) - innerHalf;
149
+ float2 qp = max(q, float2(0.0));
150
+ float outside;
151
+ if (n > 2.001 && qp.x > 0.0 && qp.y > 0.0) {
152
+ float g = max(pow(pow(qp.x, n) + pow(qp.y, n), 1.0 / n), kNormEps);
153
+ float2 dg = pow(qp / g, float2(n - 1.0));
154
+ outside = (g - E) / max(length(dg), kNormEps);
155
+ } else {
156
+ outside = length(qp) - E;
157
+ }
158
+ float inside = min(max(q.x, q.y), 0.0);
159
+ return outside + inside;
160
+ }
161
+
162
+ // Same extension for the gradient. In the corner cell the outward direction is the n-norm
163
+ // field's gradient (qp/g)^(n-1), which at n = 2 is qp itself — the original normalize direction.
164
+ inline float2 gradGlassRect(float2 c, float2 halfSize, float4 extents, float4 shapes) {
165
+ float E = min(cornerParam(c, extents), min(halfSize.x, halfSize.y));
166
+ float n = cornerParam(c, shapes);
167
+ float2 innerHalf = halfSize - float2(E);
168
+ float2 q = abs(c) - innerHalf;
169
+
170
+ float insideCorner = step(0.0, min(q.x, q.y));
171
+ float xMajor = step(q.y, q.x);
172
+ float2 gradEdge = float2(xMajor, 1.0 - xMajor);
173
+ float2 qp = max(q, float2(0.0));
174
+ float2 dir = qp;
175
+ if (n > 2.001) {
176
+ float g = max(pow(pow(qp.x, n) + pow(qp.y, n), 1.0 / n), kNormEps);
177
+ dir = pow(qp / g, float2(n - 1.0));
178
+ }
179
+ float2 gradCorner = safeNormalize(dir, float2(0.0));
180
+ return sign(c) * mix(gradEdge, gradCorner, insideCorner);
181
+ }
182
+
183
+ // KEEP the max(0.0, …): without it this returns NaN for |x| > 1.
184
+ inline float circleMap(float x) {
185
+ return 1.0 - sqrt(max(0.0, 1.0 - x * x));
186
+ }
187
+
188
+ inline float hashNoise(float2 co) {
189
+ return fract(sin(dot(co, float2(12.9898, 78.233))) * 43758.5453);
190
+ }
191
+
192
+ // The merged field: the primary shape with the morph partner folded in by the polynomial
193
+ // smooth-min (I. Quilez's smin, published mid-2000s and folklore since). Everything downstream
194
+ // reads this field and its blended gradient, which is what fuses two nearby shapes into one
195
+ // pane of liquid instead of two panes overlapping. `morphH` comes out as the blend weight —
196
+ // 1.0 both when there is no partner and far on the primary's side — for the gradient blend.
197
+ //
198
+ // The partner's corners are circular (n = 2): its radius is a single scalar, and the
199
+ // continuous-corner family stays a primary-shape refinement.
200
+ inline float mergedSd(float2 centered, constant GlassParams &params, thread float &morphH) {
201
+ float2 halfSize = params.shapeSize * 0.5;
202
+ float sd = sdGlassRect(centered, halfSize, params.cornerExtents, params.cornerShapes);
203
+
204
+ float2 morphHalf = params.morphRect.zw;
205
+ morphH = 1.0;
206
+ if (params.morphShape.y > 0.0 && morphHalf.x > 0.0 && morphHalf.y > 0.0) {
207
+ float2 morphCoord = centered - params.morphRect.xy;
208
+ float morphR = min(params.morphShape.x, min(morphHalf.x, morphHalf.y));
209
+ float sdB = sdGlassRect(morphCoord, morphHalf, float4(morphR), float4(2.0));
210
+ float k = params.morphShape.y;
211
+ morphH = clamp(0.5 + 0.5 * (sdB - sd) / k, 0.0, 1.0);
212
+ sd = mix(sdB, sd, morphH) - k * morphH * (1.0 - morphH);
213
+ }
214
+ return sd;
215
+ }
216
+
217
+ // ------------------------------------------------------------------------------------- blur
218
+
219
+ fragment float4 blurFragment(VertexOut in [[stage_in]],
220
+ texture2d<float> source [[texture(0)]],
221
+ constant BlurParams &params [[buffer(1)]]) {
222
+ float2 base = params.uvRect.xy + in.uv * params.uvRect.zw;
223
+
224
+ float radius = params.radius;
225
+ if (params.rampRadii.x >= 0.0) {
226
+ // The local radius from a Hermite-eased ramp over view-local points. Both passes cover
227
+ // the same padded region, so in.uv maps identically in each.
228
+ float2 viewPos = in.uv * params.paddedSize - params.padding;
229
+ float t = clamp(dot(viewPos - params.rampLine.xy, params.rampLine.zw), 0.0, 1.0);
230
+ t = t * t * (3.0 - 2.0 * t);
231
+ radius = mix(params.rampRadii.x, params.rampRadii.y, t);
232
+ }
233
+
234
+ if (radius <= 0.01) {
235
+ return source.sample(linearSampler, base);
236
+ }
237
+
238
+ float sigma = max(radius * 0.5, 0.0001);
239
+ float invTwoSigmaSq = -1.0 / (2.0 * sigma * sigma);
240
+
241
+ float stride = max(radius * 1.5 / float(kBlurTaps), 1.0);
242
+ // Per-pixel comb jitter — the sparse-tap plaid fix, measured on the Android port of this
243
+ // exact loop. Sub-pixel at the stride floor, so the small-radius look this pass has always
244
+ // had is untouched.
245
+ float jitter = hashNoise(in.uv * 587.0 + params.texelStep) - 0.5;
246
+
247
+ float4 sum = source.sample(linearSampler, base);
248
+ float weightSum = 1.0;
249
+
250
+ for (int i = 0; i < kBlurTaps; ++i) {
251
+ float offset = (float(i) + 0.5 + jitter) * stride;
252
+ float weight = exp2(offset * offset * invTwoSigmaSq * 1.4426950);
253
+ float2 delta = params.texelStep * offset;
254
+
255
+ sum += source.sample(linearSampler, base + delta) * weight;
256
+ sum += source.sample(linearSampler, base - delta) * weight;
257
+ weightSum += weight * 2.0;
258
+ }
259
+
260
+ return sum / weightSum;
261
+ }
262
+
263
+ // ------------------------------------------------------------------------------------ glass
264
+
265
+ // Every backdrop read passes through here, which is what keeps the press dent coherent:
266
+ // samples near the finger are pulled toward it, so the interior, the rim band and every
267
+ // dispersion tap warp together as a magnifying bulge travelling with the touch, while geometry
268
+ // (sd, normals, t) stays un-warped. d == 0 at the touch point, so there is no normalize() and no
269
+ // NaN to guard. The branch is uniform-coherent — free while nothing is pressed.
270
+ inline float3 sampleBackdrop(texture2d<float> source,
271
+ float2 pixels,
272
+ constant GlassParams &params) {
273
+ float lens = params.touch.z * params.touch.w;
274
+ if (lens > 0.0) {
275
+ float2 d = pixels - params.touch.xy;
276
+ float f = 1.0 - smoothstep(0.0, 0.6 * min(params.viewSize.x, params.viewSize.y), length(d));
277
+ pixels -= d * (f * f * 0.22 * lens);
278
+ }
279
+ float2 uv = pixels / params.viewSize;
280
+ float2 texUV = params.sourceRect.xy + uv * params.sourceRect.zw;
281
+
282
+ return source.sample(linearSampler, clamp(texUV, float2(0.0), float2(1.0))).rgb;
283
+ }
284
+
285
+ fragment float4 glassFragment(VertexOut in [[stage_in]],
286
+ texture2d<float> source [[texture(0)]],
287
+ constant GlassParams &params [[buffer(1)]]) {
288
+ float2 halfSize = params.shapeSize * 0.5;
289
+ float2 pixels = in.uv * params.viewSize;
290
+ // Shape-centered, not view-centered: with `metal.shape` unset the offset is zero and this is
291
+ // the historical line exactly. Sampling positions stay `pixels` — only geometry moves.
292
+ float2 centered = pixels - params.viewSize * 0.5 - params.shapeOffset;
293
+
294
+ // The SDF alone decides the early-out — before any gradient work, and on the MERGED field,
295
+ // because the smooth-min neck lies outside both source shapes: a coverage test on the
296
+ // primary SDF alone would discard exactly the pixels the merge exists to draw.
297
+ float morphH = 1.0;
298
+ float sd = mergedSd(centered, params, morphH);
299
+
300
+ float aa = max(fwidth(sd), 1e-4);
301
+ float shapeAlpha = 1.0 - smoothstep(-aa, aa, sd);
302
+ if (shapeAlpha <= 0.001) {
303
+ return float4(0.0);
304
+ }
305
+
306
+ // Normals from corner cells inflated 1.5x — for circular corners that is exactly the
307
+ // original radius inflation, and for continuous ones it widens the same look-tuning band
308
+ // around the softer corner.
309
+ float4 maxGradExtent = float4(min(halfSize.x, halfSize.y));
310
+ float4 gradExtents = min(params.cornerExtents * 1.5, maxGradExtent);
311
+ float2 normal = safeNormalize(
312
+ gradGlassRect(centered, halfSize, gradExtents, params.cornerShapes),
313
+ float2(0.0, 1.0));
314
+
315
+ // The merged field's gradient: the two shapes' gradients blended by the same hermite
316
+ // weight — standard SDF practice (the exact derivative's dh terms are dropped), smooth
317
+ // everywhere the weight is. Only ever computed near the partner.
318
+ if (morphH < 1.0) {
319
+ float2 morphHalf = params.morphRect.zw;
320
+ float2 morphCoord = centered - params.morphRect.xy;
321
+ float morphR = min(params.morphShape.x, min(morphHalf.x, morphHalf.y));
322
+ float4 maxGradB = float4(min(morphHalf.x, morphHalf.y));
323
+ float4 gradExtentsB = min(float4(morphR) * 1.5, maxGradB);
324
+ float2 normalB = safeNormalize(
325
+ gradGlassRect(morphCoord, morphHalf, gradExtentsB, float4(2.0)),
326
+ float2(0.0, 1.0));
327
+ normal = safeNormalize(mix(normalB, normal, morphH), normal);
328
+ }
329
+
330
+ float2 radial = safeNormalize(centered, float2(0.0));
331
+
332
+ // The light axis: highlightDir rotated +90 degrees — the same axis the border-light lobes
333
+ // sit on, so `highlight.angle` steers both. Mixing it into the displacement direction
334
+ // before normalizing leans the edge refraction toward the light — a stylisation knob, OFF
335
+ // by default: measured real iOS 26 glass carries no such lean (research/04, C8); its
336
+ // perceived twist is the radial term sweeping through the corners.
337
+ float2 lobeDir = float2(-params.highlightDir.y, params.highlightDir.x);
338
+ float2 direction = safeNormalize(
339
+ normal + params.depthEffect * radial + params.refractionSwirl * lobeDir, normal);
340
+
341
+ // Anisotropic refraction height: n^2 . refractionScale yields refractionScale.x on a
342
+ // vertical edge and .y on a horizontal one.
343
+ float2 limit = max(halfSize, float2(1e-3));
344
+ float2 scale2 = clamp(params.refractionScale, float2(1e-3), limit);
345
+ float scale = max(dot(normal * normal, scale2), 1e-3);
346
+
347
+ float t = clamp(-min(sd, 0.0) / scale, 0.0, 1.0);
348
+ float inside = -min(sd, 0.0);
349
+
350
+ // The press deepens the lens — Kyant's components animate their lens amount with press
351
+ // progress; this is that. 1.0 at rest, and 1.0 for a press reported from another view,
352
+ // which lights this glass without bending it further.
353
+ float glow = params.touch.z;
354
+ float touchBoost = 1.0 + 0.35 * glow * params.touch.w;
355
+
356
+ // The whole-surface lens (research/04, C16): sampling contracts toward the shape center by
357
+ // the magnification, so the backdrop reads enlarged through the pane. Geometry is untouched
358
+ // — the edge band still bends off the true silhouette — and >= 1 only ever samples inward.
359
+ float2 samplePx = pixels;
360
+ if (params.magnification > 1.0001) {
361
+ samplePx = pixels - centered * (1.0 - 1.0 / params.magnification);
362
+ }
363
+
364
+ float3 color;
365
+
366
+ if (inside >= scale) {
367
+ color = sampleBackdrop(source, samplePx, params);
368
+ } else {
369
+ float profile = circleMap(pow(1.0 - t, max(params.profilePower, 1e-3)));
370
+ float amount = (profile + params.profileBias * (1.0 - t))
371
+ * params.refractionAmount * touchBoost;
372
+ float2 base = samplePx - amount * direction;
373
+
374
+ float dispersionT = clamp(inside / max(params.dispersionHeight, 1e-3), 0.0, 1.0);
375
+ float spread = circleMap(1.0 - dispersionT) * params.dispersionAmount * touchBoost;
376
+
377
+ // Kyant's quadrant weighting, blended in by `dispersionQuadrant`: the product of the
378
+ // normalized centered coordinates is 0 along both centre lines and +/-1 at the corners,
379
+ // so the fringe lives where the eye already reads the shape bending — a capsule's ends —
380
+ // and dies out along its flanks. Left signed on purpose: the sign flips between
381
+ // adjacent quadrants, which walks the taps the other way and reverses the hue order.
382
+ float2 quadrant = centered / max(halfSize, float2(1e-3));
383
+ spread *= mix(1.0, quadrant.x * quadrant.y, params.dispersionQuadrant);
384
+ // Magnitude from here down: a negative spread is a direction, not a smaller one.
385
+ float spreadMag = abs(spread);
386
+
387
+ if (spreadMag < 2.0) {
388
+ color = sampleBackdrop(source, base, params);
389
+ } else {
390
+ // LONGITUDINAL aberration: taps walk along the displacement axis itself — R sampled
391
+ // deepest, B shallowest, G centred. Per-channel phase solves of real iOS 26 measured
392
+ // the spread along the displacement direction with blue as the outermost fringe
393
+ // (research/04, C26); the tangent walk this pass used to do puts the fringe on the
394
+ // wrong axis. `base - direction * s` deepens the sample for positive s, so the R half
395
+ // of the mask (u > 0.5) lands deepest.
396
+ float3 accumulated = float3(0.0);
397
+ float3 weight = float3(0.0);
398
+ float maxI = min(spreadMag, float(kDispersionTaps)); // one tap per point
399
+
400
+ for (int i = 0; i < kDispersionTaps; ++i) {
401
+ float u = float(i) / maxI;
402
+ if (u > 1.0) break;
403
+
404
+ float3 tap = sampleBackdrop(source, base - direction * (u - 0.5) * spread, params);
405
+ float3 mask = float3(step(0.5, u),
406
+ step(0.25, u) * step(u, 0.75),
407
+ step(u, 0.5));
408
+
409
+ accumulated += tap * mask;
410
+ weight += mask;
411
+ }
412
+
413
+ color = accumulated / max(weight, float3(1e-6));
414
+ }
415
+ }
416
+
417
+ color = clamp(color, 0.0, 1.0);
418
+
419
+ float luma = dot(color, float3(0.2126, 0.7152, 0.0722));
420
+ color = mix(float3(luma), color, params.saturation);
421
+ color = mix(color, params.frostColor.rgb, params.frostColor.a);
422
+ color = mix(color, params.tintColor.rgb, params.tintColor.a);
423
+
424
+ // Keyed off `pixels`, which is view-local and stable, so the grain field does not jump when
425
+ // the drawable resizes mid-animation.
426
+ if (params.noiseAmount > 0.0) {
427
+ color += (hashNoise(pixels * 1e-3) - 0.5) * params.noiseAmount;
428
+ }
429
+
430
+ // The glass border light, and nothing else — remodeled against real iOS 26 glass. The signed
431
+ // multiplicative wash this pass used to carry (`sin(pos_angle - angle)` over the whole
432
+ // refraction band) darkened the quadrant opposite the light by up to 25 %, an inset shadow
433
+ // real glass does not have, and vanished over dark backdrops; the separate contour line on
434
+ // top was the over-thick edge. What remains: a thin ADDITIVE rim lighting both light-axis
435
+ // lobes — `pow(abs(dot(normal, light)), falloff)`, Kyant's falloff model — fading over its own
436
+ // `highlightWidth`, plus the faint broad sheen under the lit edges (~0.18x the rim's weight,
437
+ // measured +13/255 over ~25 px). `abs()` is what lights both lobes; `normal`, not the
438
+ // position angle, is what holds a long edge at constant intensity.
439
+ float rim = pow(abs(dot(normal, lobeDir)), params.highlightFalloff);
440
+ float rimT = clamp(inside / max(params.highlightWidth, 1e-3), 0.0, 1.0);
441
+ float rimBand = 1.0 - smoothstep(0.0, 1.0, rimT);
442
+
443
+ float sheenT = clamp(inside / kSheenDepth, 0.0, 1.0);
444
+ float sheen = 1.0 - smoothstep(0.0, 1.0, sheenT);
445
+
446
+ // Glass does not amplify what it merely transmits: the interior is pinned at 1 before the
447
+ // rim is added on top.
448
+ color = min(color * (1.0 + params.lightIntensity), float3(1.0));
449
+ color += rim * rimBand * params.highlightIntensity;
450
+ color += rim * sheen * params.highlightIntensity * 0.18;
451
+
452
+ // The inner shadow — Kyant's `InnerShadow`, as an SDF band: the blurred coverage of the
453
+ // shape minus itself translated by the offset, `S \ (S + o)`. Blur is linear and the blurred
454
+ // coverage of a set is a smoothstep of its SDF, so the band is ss(sd of S ∩ (S + o)) −
455
+ // ss(sd of S) with sd of the intersection = max of the two fields. Offset (0, +r) shades the
456
+ // top inner edge: light from above, and the pane's top lip casts inward. Evaluated on the
457
+ // merged field, so a morph partner shades as one piece.
458
+ if (params.innerShadow.a > 0.0 && params.innerShadowRadius > 0.0) {
459
+ float r = params.innerShadowRadius;
460
+ float shiftedH = 1.0;
461
+ float sdShifted = mergedSd(centered - params.innerShadowOffset, params, shiftedH);
462
+ float shade = smoothstep(-r, r, max(sd, sdShifted)) - smoothstep(-r, r, sd);
463
+ color = mix(color, params.innerShadow.rgb, clamp(shade, 0.0, 1.0) * params.innerShadow.a);
464
+ }
465
+
466
+ // The press glow, per Kyant's InteractiveHighlight: a flat 0.08 wash plus a 0.15 radial lobe,
467
+ // additive, radius 1.5x the view's min dimension, full strength inside half that radius.
468
+ // Uniform-coherent, so it costs nothing at rest.
469
+ if (glow > 0.0) {
470
+ float touchRadius = 1.5 * min(params.viewSize.x, params.viewSize.y);
471
+ float touchDist = distance(pixels, params.touch.xy);
472
+ float touchFalloff = 1.0 - smoothstep(touchRadius * 0.5, touchRadius, touchDist);
473
+ color += (0.08 + 0.15 * touchFalloff) * glow;
474
+ }
475
+
476
+ color = clamp(color, 0.0, 1.0);
477
+
478
+ float alpha = shapeAlpha * params.glassOpacity;
479
+ return float4(color * alpha, alpha);
480
+ }
@@ -0,0 +1,6 @@
1
+ Placeholder so CocoaPods creates ExpoLiquidGlassShaders.bundle.
2
+
3
+ The bundle's real payload is default.metallib, which the podspec's
4
+ "Bundle compiled Metal shaders" script phase copies in after Xcode
5
+ compiles Shaders/*.metal. A resource bundle needs at least one
6
+ pod-install-time file to exist, hence this marker.