glacia-native 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +84 -17
  2. package/lib/module/Accordion.js +58 -0
  3. package/lib/module/ActionSheet.js +38 -0
  4. package/lib/module/Alert.js +23 -0
  5. package/lib/module/AlertDialog.js +47 -0
  6. package/lib/module/Avatar.js +48 -0
  7. package/lib/module/Badge.js +36 -0
  8. package/lib/module/Bars.js +13 -268
  9. package/lib/module/Button.js +57 -39
  10. package/lib/module/Card.js +31 -19
  11. package/lib/module/Checkbox.js +42 -0
  12. package/lib/module/Chip.js +80 -0
  13. package/lib/module/Collapsible.js +26 -0
  14. package/lib/module/ContextMenu.js +33 -0
  15. package/lib/module/Dialog.js +39 -123
  16. package/lib/module/DropdownMenu.js +33 -0
  17. package/lib/module/Field.js +22 -0
  18. package/lib/module/Glass.js +10 -3
  19. package/lib/module/Group.js +36 -0
  20. package/lib/module/IconButton.js +40 -0
  21. package/lib/module/Input.js +43 -38
  22. package/lib/module/Label.js +17 -0
  23. package/lib/module/MorphGroup.js +47 -0
  24. package/lib/module/Popover.js +29 -0
  25. package/lib/module/Progress.js +32 -0
  26. package/lib/module/RadioGroup.js +51 -0
  27. package/lib/module/Scrim.js +44 -0
  28. package/lib/module/SegmentedControl.js +70 -63
  29. package/lib/module/Select.js +51 -0
  30. package/lib/module/Separator.js +25 -0
  31. package/lib/module/Sheet.js +51 -0
  32. package/lib/module/Skeleton.js +48 -0
  33. package/lib/module/Slider.js +45 -34
  34. package/lib/module/Stepper.js +167 -0
  35. package/lib/module/Switch.js +45 -55
  36. package/lib/module/TabBar.js +50 -44
  37. package/lib/module/Textarea.js +18 -0
  38. package/lib/module/Toast.js +55 -0
  39. package/lib/module/Toggle.js +47 -0
  40. package/lib/module/ToggleGroup.js +56 -0
  41. package/lib/module/Toolbar.js +37 -0
  42. package/lib/module/Tooltip.js +31 -0
  43. package/lib/module/glass-provider.js +28 -0
  44. package/lib/module/glass-stack.js +61 -0
  45. package/lib/module/index.js +78 -109
  46. package/lib/module/internal/GlassBackdrop.js +36 -0
  47. package/lib/module/internal/GlassView.js +43 -11
  48. package/lib/module/internal/blur-community.js +20 -0
  49. package/lib/module/internal/blur-community.web.js +9 -0
  50. package/lib/module/internal/blur.js +6 -9
  51. package/lib/module/internal/glass-routing.js +156 -30
  52. package/lib/module/internal/initials.js +12 -0
  53. package/lib/module/internal/overlay.js +147 -0
  54. package/lib/module/internal/primitives.js +16 -0
  55. package/lib/typescript/Accordion.d.ts +22 -0
  56. package/lib/typescript/ActionSheet.d.ts +24 -0
  57. package/lib/typescript/Alert.d.ts +15 -0
  58. package/lib/typescript/AlertDialog.d.ts +17 -0
  59. package/lib/typescript/Avatar.d.ts +22 -0
  60. package/lib/typescript/Badge.d.ts +12 -0
  61. package/lib/typescript/Bars.d.ts +3 -188
  62. package/lib/typescript/Button.d.ts +44 -10
  63. package/lib/typescript/Card.d.ts +30 -3
  64. package/lib/typescript/Checkbox.d.ts +14 -0
  65. package/lib/typescript/Chip.d.ts +19 -0
  66. package/lib/typescript/Collapsible.d.ts +17 -0
  67. package/lib/typescript/ContextMenu.d.ts +23 -0
  68. package/lib/typescript/Dialog.d.ts +8 -68
  69. package/lib/typescript/DropdownMenu.d.ts +23 -0
  70. package/lib/typescript/Field.d.ts +19 -0
  71. package/lib/typescript/Glass.d.ts +11 -2
  72. package/lib/typescript/Group.d.ts +35 -0
  73. package/lib/typescript/IconButton.d.ts +21 -0
  74. package/lib/typescript/Input.d.ts +17 -18
  75. package/lib/typescript/Label.d.ts +14 -0
  76. package/lib/typescript/MorphGroup.d.ts +46 -0
  77. package/lib/typescript/Popover.d.ts +17 -0
  78. package/lib/typescript/Progress.d.ts +13 -0
  79. package/lib/typescript/RadioGroup.d.ts +21 -0
  80. package/lib/typescript/Scrim.d.ts +33 -0
  81. package/lib/typescript/SegmentedControl.d.ts +24 -13
  82. package/lib/typescript/Select.d.ts +19 -0
  83. package/lib/typescript/Separator.d.ts +10 -0
  84. package/lib/typescript/Sheet.d.ts +45 -0
  85. package/lib/typescript/Skeleton.d.ts +10 -0
  86. package/lib/typescript/Slider.d.ts +15 -7
  87. package/lib/typescript/Stepper.d.ts +49 -0
  88. package/lib/typescript/Switch.d.ts +19 -12
  89. package/lib/typescript/TabBar.d.ts +18 -6
  90. package/lib/typescript/Textarea.d.ts +6 -0
  91. package/lib/typescript/Toast.d.ts +40 -0
  92. package/lib/typescript/Toggle.d.ts +21 -0
  93. package/lib/typescript/ToggleGroup.d.ts +22 -0
  94. package/lib/typescript/Toolbar.d.ts +35 -0
  95. package/lib/typescript/Tooltip.d.ts +16 -0
  96. package/lib/typescript/glass-provider.d.ts +34 -0
  97. package/lib/typescript/glass-stack.d.ts +54 -0
  98. package/lib/typescript/index.d.ts +38 -17
  99. package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
  100. package/lib/typescript/internal/GlassView.d.ts +18 -2
  101. package/lib/typescript/internal/blur-community.d.ts +2 -0
  102. package/lib/typescript/internal/blur-community.web.d.ts +2 -0
  103. package/lib/typescript/internal/glass-routing.d.ts +83 -15
  104. package/lib/typescript/internal/initials.d.ts +2 -0
  105. package/lib/typescript/internal/overlay.d.ts +74 -0
  106. package/lib/typescript/internal/primitives.d.ts +11 -0
  107. package/package.json +12 -10
  108. package/src/Accordion.tsx +165 -0
  109. package/src/ActionSheet.tsx +149 -0
  110. package/src/Alert.tsx +85 -0
  111. package/src/AlertDialog.tsx +124 -0
  112. package/src/Avatar.tsx +102 -0
  113. package/src/Badge.tsx +80 -0
  114. package/src/Bars.tsx +10 -807
  115. package/src/Button.tsx +196 -67
  116. package/src/Card.tsx +105 -32
  117. package/src/Checkbox.tsx +98 -0
  118. package/src/Chip.tsx +149 -0
  119. package/src/Collapsible.tsx +66 -0
  120. package/src/ContextMenu.tsx +103 -0
  121. package/src/Dialog.tsx +85 -335
  122. package/src/DropdownMenu.tsx +103 -0
  123. package/src/Field.tsx +65 -0
  124. package/src/Glass.tsx +15 -5
  125. package/src/Group.tsx +98 -0
  126. package/src/IconButton.tsx +110 -0
  127. package/src/Input.tsx +139 -87
  128. package/src/Label.tsx +56 -0
  129. package/src/MorphGroup.tsx +134 -0
  130. package/src/Popover.tsx +81 -0
  131. package/src/Progress.tsx +83 -0
  132. package/src/RadioGroup.tsx +122 -0
  133. package/src/Scrim.tsx +94 -0
  134. package/src/SegmentedControl.tsx +132 -99
  135. package/src/Select.tsx +136 -0
  136. package/src/Separator.tsx +52 -0
  137. package/src/Sheet.tsx +139 -0
  138. package/src/Skeleton.tsx +77 -0
  139. package/src/Slider.tsx +84 -47
  140. package/src/Stepper.tsx +315 -0
  141. package/src/Switch.tsx +81 -73
  142. package/src/TabBar.tsx +106 -93
  143. package/src/Textarea.tsx +34 -0
  144. package/src/Toast.tsx +131 -0
  145. package/src/Toggle.tsx +113 -0
  146. package/src/ToggleGroup.tsx +129 -0
  147. package/src/Toolbar.tsx +111 -0
  148. package/src/Tooltip.tsx +79 -0
  149. package/src/engine/CHANGELOG.md +430 -0
  150. package/src/engine/NOTICE +54 -0
  151. package/src/engine/README.md +975 -0
  152. package/src/engine/android/build.gradle +18 -0
  153. package/src/engine/android/src/main/AndroidManifest.xml +2 -0
  154. package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
  155. package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
  156. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
  157. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
  158. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
  159. package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
  160. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
  161. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
  162. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
  163. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
  164. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
  165. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
  166. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
  167. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
  168. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
  169. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
  170. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
  171. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
  172. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
  173. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
  174. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
  175. package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
  176. package/src/engine/index.ts +24 -0
  177. package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
  178. package/src/engine/ios/Enums/GlassVariant.swift +86 -0
  179. package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
  180. package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
  181. package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
  182. package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
  183. package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
  184. package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
  185. package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
  186. package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
  187. package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
  188. package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
  189. package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
  190. package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
  191. package/src/engine/ios/Glass/StripCache.swift +545 -0
  192. package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
  193. package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
  194. package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
  195. package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
  196. package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
  197. package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
  198. package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
  199. package/src/engine/package.json +70 -0
  200. package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
  201. package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
  202. package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
  203. package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
  204. package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
  205. package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
  206. package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
  207. package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
  208. package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
  209. package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
  210. package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
  211. package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
  212. package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
  213. package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
  214. package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
  215. package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
  216. package/src/engine/src/components/index.ts +16 -0
  217. package/src/engine/src/constants/index.ts +4 -0
  218. package/src/engine/src/constants/metal.constants.ts +327 -0
  219. package/src/engine/src/constants/metrics.constants.ts +325 -0
  220. package/src/engine/src/constants/springs.constants.ts +107 -0
  221. package/src/engine/src/constants/styles.constants.ts +12 -0
  222. package/src/engine/src/context/glass-group.context.ts +65 -0
  223. package/src/engine/src/context/index.ts +6 -0
  224. package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
  225. package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
  226. package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
  227. package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
  228. package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
  229. package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
  230. package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
  231. package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
  232. package/src/engine/src/core/components/index.ts +4 -0
  233. package/src/engine/src/core/constants/glass.constants.ts +57 -0
  234. package/src/engine/src/core/constants/index.ts +20 -0
  235. package/src/engine/src/core/constants/native.constants.ts +16 -0
  236. package/src/engine/src/core/context/glass-stack.context.ts +30 -0
  237. package/src/engine/src/core/context/index.ts +4 -0
  238. package/src/engine/src/core/enum/index.ts +12 -0
  239. package/src/engine/src/core/index.ts +1 -0
  240. package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
  241. package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
  242. package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
  243. package/src/engine/src/core/interfaces/index.ts +31 -0
  244. package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
  245. package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
  246. package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
  247. package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
  248. package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
  249. package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
  250. package/src/engine/src/core/modules/index.ts +2 -0
  251. package/src/engine/src/core/root/index.ts +51 -0
  252. package/src/engine/src/core/types/glass.types.ts +25 -0
  253. package/src/engine/src/core/types/index.ts +8 -0
  254. package/src/engine/src/core/utils/debug.utils.ts +17 -0
  255. package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
  256. package/src/engine/src/core/utils/hdr.utils.ts +37 -0
  257. package/src/engine/src/core/utils/index.ts +5 -0
  258. package/src/engine/src/core/utils/native-view.utils.ts +33 -0
  259. package/src/engine/src/core/utils/platform.utils.ts +34 -0
  260. package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
  261. package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
  262. package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
  263. package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
  264. package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
  265. package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
  266. package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
  267. package/src/engine/src/core/views/index.ts +4 -0
  268. package/src/engine/src/hooks/index.ts +18 -0
  269. package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
  270. package/src/engine/src/hooks/use-damped-drag.ts +332 -0
  271. package/src/engine/src/hooks/use-echo-filter.ts +55 -0
  272. package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
  273. package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
  274. package/src/engine/src/hooks/use-press-progress.ts +44 -0
  275. package/src/engine/src/index.ts +120 -0
  276. package/src/engine/src/interfaces/index.ts +28 -0
  277. package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
  278. package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
  279. package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
  280. package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
  281. package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
  282. package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
  283. package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
  284. package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
  285. package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
  286. package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
  287. package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
  288. package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
  289. package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
  290. package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
  291. package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
  292. package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
  293. package/src/engine/src/theme/glass-ui-theme.ts +100 -0
  294. package/src/engine/src/theme/index.ts +2 -0
  295. package/src/engine/src/utils/button-press.utils.ts +63 -0
  296. package/src/engine/src/utils/index.ts +3 -0
  297. package/src/engine/src/utils/metal.utils.ts +164 -0
  298. package/src/glass-provider.tsx +60 -0
  299. package/src/glass-stack.tsx +115 -0
  300. package/src/index.ts +47 -190
  301. package/src/internal/GlassBackdrop.tsx +60 -0
  302. package/src/internal/GlassView.tsx +53 -18
  303. package/src/internal/blur-community.ts +19 -0
  304. package/src/internal/blur-community.web.ts +7 -0
  305. package/src/internal/blur.ts +7 -8
  306. package/src/internal/glass-routing.ts +212 -34
  307. package/src/internal/initials.ts +7 -0
  308. package/src/internal/overlay.tsx +258 -0
  309. package/src/internal/primitives.ts +23 -0
  310. package/lib/module/Carousel.js +0 -103
  311. package/lib/module/Display.js +0 -318
  312. package/lib/module/Feedback.js +0 -395
  313. package/lib/module/Form.js +0 -160
  314. package/lib/module/Forms2.js +0 -471
  315. package/lib/module/Message.js +0 -84
  316. package/lib/module/Overlays.js +0 -344
  317. package/lib/module/Pickers.js +0 -243
  318. package/lib/module/Table.js +0 -100
  319. package/lib/module/ai.js +0 -283
  320. package/lib/module/charts/AreaChart.js +0 -32
  321. package/lib/module/charts/BarChart.js +0 -75
  322. package/lib/module/charts/FunnelChart.js +0 -50
  323. package/lib/module/charts/HeatmapChart.js +0 -71
  324. package/lib/module/charts/LineChart.js +0 -81
  325. package/lib/module/charts/PlotChart.js +0 -52
  326. package/lib/module/charts/RadarChart.js +0 -78
  327. package/lib/module/charts/RingChart.js +0 -52
  328. package/lib/module/charts/ScatterChart.js +0 -95
  329. package/lib/module/charts/WaterfallChart.js +0 -85
  330. package/lib/module/charts/advanced.js +0 -313
  331. package/lib/module/charts/extra.js +0 -108
  332. package/lib/module/charts/index.js +0 -50
  333. package/lib/module/charts/scales.js +0 -140
  334. package/lib/typescript/Carousel.d.ts +0 -47
  335. package/lib/typescript/Display.d.ts +0 -178
  336. package/lib/typescript/Feedback.d.ts +0 -196
  337. package/lib/typescript/Form.d.ts +0 -97
  338. package/lib/typescript/Forms2.d.ts +0 -209
  339. package/lib/typescript/Message.d.ts +0 -67
  340. package/lib/typescript/Overlays.d.ts +0 -146
  341. package/lib/typescript/Pickers.d.ts +0 -105
  342. package/lib/typescript/Table.d.ts +0 -64
  343. package/lib/typescript/ai.d.ts +0 -166
  344. package/lib/typescript/charts/AreaChart.d.ts +0 -44
  345. package/lib/typescript/charts/BarChart.d.ts +0 -19
  346. package/lib/typescript/charts/FunnelChart.d.ts +0 -25
  347. package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
  348. package/lib/typescript/charts/LineChart.d.ts +0 -30
  349. package/lib/typescript/charts/PlotChart.d.ts +0 -31
  350. package/lib/typescript/charts/RadarChart.d.ts +0 -27
  351. package/lib/typescript/charts/RingChart.d.ts +0 -28
  352. package/lib/typescript/charts/ScatterChart.d.ts +0 -34
  353. package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
  354. package/lib/typescript/charts/advanced.d.ts +0 -107
  355. package/lib/typescript/charts/extra.d.ts +0 -63
  356. package/lib/typescript/charts/index.d.ts +0 -13
  357. package/lib/typescript/charts/scales.d.ts +0 -35
  358. package/src/Carousel.tsx +0 -233
  359. package/src/Display.tsx +0 -781
  360. package/src/Feedback.tsx +0 -992
  361. package/src/Form.tsx +0 -445
  362. package/src/Forms2.tsx +0 -1055
  363. package/src/Message.tsx +0 -218
  364. package/src/Overlays.tsx +0 -704
  365. package/src/Pickers.tsx +0 -595
  366. package/src/Table.tsx +0 -232
  367. package/src/ai.tsx +0 -715
  368. package/src/charts/AreaChart.tsx +0 -73
  369. package/src/charts/BarChart.tsx +0 -221
  370. package/src/charts/FunnelChart.tsx +0 -125
  371. package/src/charts/HeatmapChart.tsx +0 -155
  372. package/src/charts/LineChart.tsx +0 -247
  373. package/src/charts/PlotChart.tsx +0 -168
  374. package/src/charts/RadarChart.tsx +0 -208
  375. package/src/charts/RingChart.tsx +0 -133
  376. package/src/charts/ScatterChart.tsx +0 -223
  377. package/src/charts/WaterfallChart.tsx +0 -201
  378. package/src/charts/advanced.tsx +0 -676
  379. package/src/charts/extra.tsx +0 -242
  380. package/src/charts/index.ts +0 -86
  381. package/src/charts/scales.ts +0 -163
@@ -1,85 +1,263 @@
1
1
  // The glass switch — the law of this library.
2
2
  //
3
- // Every glass surface in every Glacia Native component goes through
4
- // `GlassView`, which routes here. On iOS 26+ `@callstack/liquid-glass` reports
5
- // `isLiquidGlassSupported === true` and the surface is rendered by Apple's
6
- // real `UIGlassEffect` (`LiquidGlassView`). Everywhere else — older iOS,
7
- // Android, Expo Go, or a build without the module — it is Glacia's own
8
- // translucent fallback of identical shape.
3
+ // Every glass surface in every Glacia Native component goes through the package
4
+ // surface, which routes here. The decision now comes from the engine vendored
5
+ // into this package (`src/engine` — a copy of
6
+ // https://github.com/capthndsme/expo-liquid-glass-ui, MIT), not from an external
7
+ // `@callstack/liquid-glass` package: the rebuild patches the engine's iOS capture
8
+ // code, which a dependency could not receive.
9
9
  //
10
- // The decision is split out from the React component so both branches can be
10
+ // The decision is split out of the React component so both branches can be
11
11
  // exercised in tests: `routerFor` takes the module as an argument, and the
12
- // default export routes on whatever is installed. On a device the argument is
13
- // always the installed module, so the routing logic is unchanged.
12
+ // default export routes on whatever the vendored engine reports. On a device
13
+ // the argument is always the vendored engine module, so the routing logic is
14
+ // unchanged; only its source moved.
14
15
 
15
16
  declare const require: any;
16
17
 
18
+ /**
19
+ * The vendored engine's glass module, as the parts Glacia switches on.
20
+ *
21
+ * Mirrors the engine's public surface: the glass view, the merge container, the
22
+ * backdrop provider, the stacked-glass primitive, and the capability flags the
23
+ * renderer tier machinery fills in.
24
+ */
17
25
  export interface LiquidGlassModule {
18
26
  LiquidGlassView?: any;
19
27
  /**
20
28
  * The container that merges nearby glass elements into one connected
21
- * surface. Exported by `@callstack/liquid-glass` alongside the view.
29
+ * surface. The engine names it `LiquidGlassContainer`; the older bridge
30
+ * package called it `LiquidGlassContainerView`. Both accepted.
22
31
  */
32
+ LiquidGlassContainer?: any;
23
33
  LiquidGlassContainerView?: any;
34
+ /**
35
+ * Marks the content that should show through the glass (the Android backdrop
36
+ * source). Present on the engine module; unused off the Android tier.
37
+ */
38
+ LiquidGlassProvider?: any;
39
+ LiquidGlassStack?: any;
40
+ /**
41
+ * The iOS backdrop scope view (Metal tier). Absent on the Android and native builds; a scope
42
+ * there would only add a view.
43
+ */
44
+ NativeGlassBackdropView?: any;
45
+ /** The engine's mount gate: native (iOS 26+), Metal (iOS 16.4–25), AGSL (Android 13+). */
46
+ supportsGlass?: boolean;
47
+ /** Legacy spelling of the mount gate, from the older bridge package. */
24
48
  isLiquidGlassSupported?: boolean;
49
+ /** Whether Apple's real `UIGlassEffect` is available (iOS 26+). */
50
+ supportsNativeGlass?: boolean;
25
51
  }
26
52
 
27
53
  /** The routing decision for one glass surface. */
28
54
  export interface GlassRouter {
29
- /** True when Apple's real glass renders this surface. */
55
+ /** True when a glass renderer can render at all — native, Metal or AGSL. */
30
56
  supported: boolean;
31
- /** Apple's `LiquidGlassView`, or null when the fallback renders instead. */
57
+ /** The engine's `LiquidGlassView`, or null when the fallback renders instead. */
32
58
  LiquidGlassView: any;
33
59
  /**
34
- * Apple's `LiquidGlassContainerView` — the surface that merges neighbouring
35
- * glass — or null when the fallback wrapper renders instead.
60
+ * The engine's container that merges neighbouring glass, or null when the
61
+ * fallback wrapper renders instead. Exposed under the historical field name so
62
+ * the rest of the package keeps reading one decision.
36
63
  */
37
64
  LiquidGlassContainerView: any;
65
+ /** The engine's backdrop provider, or null. */
66
+ LiquidGlassProvider: any;
67
+ /** The engine's stacked-glass primitive, or null. */
68
+ LiquidGlassStack: any;
69
+ /**
70
+ * True when the active tier is Apple's own `UIGlassEffect` (iOS 26+) rather
71
+ * than the engine's Metal or AGSL renderer. Optional so a routing decision
72
+ * that only carries the mount gate — the test double, the fallback wrapper —
73
+ * can still be read as a tier.
74
+ */
75
+ native?: boolean;
38
76
  }
39
77
 
40
78
  /**
41
79
  * Reads a liquid-glass module and decides which branch renders.
42
80
  *
43
81
  * A module only counts as supported when it exports the view *and* reports
44
- * support; a missing export falls back rather than crashing.
82
+ * support; a missing export falls back rather than crashing. Below every glass
83
+ * tier the answer is `false`, which is what routes the surface to Glacia's
84
+ * fallback floor.
45
85
  */
46
86
  export function routerFor(module: LiquidGlassModule | null | undefined): GlassRouter {
47
87
  const view = module?.LiquidGlassView ?? null;
48
- const container = module?.LiquidGlassContainerView ?? null;
88
+ const container = module?.LiquidGlassContainer ?? module?.LiquidGlassContainerView ?? null;
89
+ const provider = module?.LiquidGlassProvider ?? null;
90
+ const stack = module?.LiquidGlassStack ?? null;
91
+ const supported =
92
+ Boolean(module?.LiquidGlassView) &&
93
+ (module?.supportsGlass ?? module?.isLiquidGlassSupported ?? false) === true;
94
+
49
95
  return {
50
- // A module that reports support but lacks the container still renders real
51
- // glass; the container is only needed by GlassContainer, which falls back
52
- // when it is missing.
53
- supported: Boolean(module?.isLiquidGlassSupported) && Boolean(view),
96
+ supported,
54
97
  LiquidGlassView: view,
55
- // The container merges only when the material itself is available; a
56
- // container without the view would have nothing to merge.
57
98
  LiquidGlassContainerView: container,
99
+ LiquidGlassProvider: provider,
100
+ LiquidGlassStack: stack,
101
+ native: module?.supportsNativeGlass === true,
58
102
  };
59
103
  }
60
104
 
61
105
  /**
62
- * Loads `@callstack/liquid-glass` at runtime.
106
+ * Loads the vendored glass engine.
63
107
  *
64
108
  * Resolved through `require` rather than a static import so the package stays
65
- * importable where the native module is absent (jsdom tests, web preview).
66
- * `isLiquidGlassSupported` is a constant baked by the package's own platform
67
- * resolution: its iOS build reads the native module and answers true only on
68
- * iOS 26+; the default build answers false.
109
+ * importable where the native module is absent (jsdom tests, web preview). The
110
+ * engine's `supportsGlass` is a constant of the installed build — its iOS build
111
+ * reads the native module and answers true only on iOS 26+, its Android build
112
+ * answers for the AGSL tier — so loading it is how the verdict is learned.
69
113
  */
70
- export function loadLiquidGlass(): LiquidGlassModule | null {
114
+ function requireEngineModule(): any | null {
115
+ if (typeof require !== "function") return null;
71
116
  try {
72
- const module = require("@callstack/liquid-glass");
73
- if (module && (module.LiquidGlassView || module.isLiquidGlassSupported !== undefined)) {
74
- return module as LiquidGlassModule;
75
- }
76
- return null;
117
+ // Metro only bundles calls spelled literally require("<string>"): the
118
+ // callee must be the `require` identifier AND the argument a string
119
+ // literal. A call through a local alias or with a variable module id
120
+ // is never collected, so the engine would be missing from the bundle
121
+ // (UnknownModuleError at launch).
122
+ const module = require("../engine");
123
+ return module ?? null;
77
124
  } catch {
125
+ // The engine (or its native module) is not resolvable here: unsupported.
78
126
  return null;
79
127
  }
80
128
  }
81
129
 
82
- /** The installed module's routing decision, computed once per process. */
130
+ /** The installed engine's routing decision, computed once per process. */
83
131
  export function defaultRouter(): GlassRouter {
84
132
  return routerFor(loadLiquidGlass());
85
133
  }
134
+
135
+ /** The installed engine's glass module, or null when it cannot be loaded. */
136
+ export function loadLiquidGlass(): LiquidGlassModule | null {
137
+ const module = requireEngineModule();
138
+ if (module && (module.LiquidGlassView || module.supportsGlass !== undefined)) {
139
+ return module as LiquidGlassModule;
140
+ }
141
+ return null;
142
+ }
143
+
144
+ /**
145
+ * The capability verdicts Glacia switches on.
146
+ */
147
+ export interface GlassCapabilities {
148
+ /** Whether any glass renderer (Apple's native, the Metal renderer, AGSL) exists. */
149
+ supported: boolean;
150
+ /** Whether Apple's own `UIGlassEffect` exists — iOS 26+ only. */
151
+ native: boolean;
152
+ }
153
+
154
+ /** Reads the capability verdicts from an explicit module, or from the engine. */
155
+ export function readCapabilities(module?: LiquidGlassModule | null): GlassCapabilities {
156
+ const resolved = module !== undefined ? module : loadLiquidGlass();
157
+ const supported =
158
+ resolved != null &&
159
+ Boolean(resolved.LiquidGlassView) &&
160
+ (resolved.supportsGlass ?? resolved.isLiquidGlassSupported ?? false) === true;
161
+ const native = resolved?.supportsNativeGlass === true;
162
+ return { supported, native };
163
+ }
164
+
165
+ /**
166
+ * Whether any glass renderer is available on this device — the mount gate.
167
+ *
168
+ * Resolves instead of blocking: the caller renders either the glass surface or
169
+ * the fallback floor from this, and the floor is the safe answer, so the check
170
+ * must always be able to finish. When no renderer verdict has arrived the
171
+ * absence *is* the verdict — unsupported — and the fallback floor renders.
172
+ */
173
+ export function supportsGlass(module?: LiquidGlassModule | null): Promise<boolean> {
174
+ const capabilities = readCapabilities(module);
175
+ return Promise.resolve(capabilities.supported);
176
+ }
177
+
178
+ /**
179
+ * Whether Apple's own glass material (`UIGlassEffect`) is available — iOS 26+.
180
+ * The narrower question behind the mount gate; the renderer tier machinery picks
181
+ * Metal or AGSL below that.
182
+ */
183
+ export function supportsNativeGlass(module?: LiquidGlassModule | null): boolean {
184
+ const resolved = module !== undefined ? module : loadLiquidGlass();
185
+ return resolved?.supportsNativeGlass === true;
186
+ }
187
+
188
+ /**
189
+ * The vendored engine's control components, by the Glacia-facing name.
190
+ *
191
+ * Every Wave 1 control is the engine's own component mounted through the same
192
+ * capability verdict the glass surface uses, so an unsupported device (or Expo
193
+ * Go, or Reduce Transparency) takes the Glacia fallback floor instead of the
194
+ * engine's own degrade-to-plain-view.
195
+ */
196
+ const ENGINE_CONTROLS: Record<string, string> = {
197
+ Button: "LiquidGlassButton",
198
+ IconButton: "LiquidGlassIconButton",
199
+ Chip: "LiquidGlassChip",
200
+ Switch: "LiquidGlassSwitch",
201
+ Slider: "LiquidGlassSlider",
202
+ Stepper: "LiquidGlassStepper",
203
+ SegmentedControl: "LiquidGlassSegmentedControl",
204
+ Input: "LiquidGlassTextInput",
205
+ Card: "LiquidGlassCard",
206
+ Toolbar: "LiquidGlassToolbar",
207
+ Toast: "LiquidGlassToast",
208
+ Sheet: "LiquidGlassSheet",
209
+ TabBar: "LiquidGlassTabBar",
210
+ Group: "LiquidGlassGroup",
211
+ MorphGroup: "LiquidGlassMorphGroup",
212
+ Scrim: "LiquidGlassScrim",
213
+ };
214
+
215
+ /**
216
+ * The native backdrop scope, when the active tier is the Metal renderer.
217
+ *
218
+ * Only iOS 16.4–25 needs it: iOS 26+ reads the live window through Apple's own glass, and the
219
+ * Android renderer already has a provider contract of its own. Off that tier this is null and
220
+ * callers render a plain wrapper, so a `GlassBackdrop` never changes layout where it does
221
+ * nothing.
222
+ */
223
+ let cachedBackdropScope: any | null | undefined;
224
+
225
+ /**
226
+ * Resolves the scope for the active tier. An explicit module is used by tests, the same way
227
+ * `readCapabilities` takes one: the routing question must be answerable without a device.
228
+ */
229
+ export function loadBackdropScope(module?: LiquidGlassModule | null): any | null {
230
+ if (module !== undefined) {
231
+ const capabilities = readCapabilities(module);
232
+ return capabilities.supported && !capabilities.native
233
+ ? (module as any)?.NativeGlassBackdropView ?? null
234
+ : null;
235
+ }
236
+ if (cachedBackdropScope !== undefined) return cachedBackdropScope;
237
+ const capabilities = readCapabilities();
238
+ const engine = requireEngineModule() as any;
239
+ cachedBackdropScope =
240
+ capabilities.supported && !capabilities.native
241
+ ? engine?.NativeGlassBackdropView ?? null
242
+ : null;
243
+ return cachedBackdropScope;
244
+ }
245
+
246
+ /** Clears the memoised backdrop route. Tests call this after flipping the module. */
247
+ export function resetBackdropScope() {
248
+ cachedBackdropScope = undefined;
249
+ }
250
+
251
+ /** The Glacia names of every control the vendored engine carries. */
252
+ export const ENGINE_CONTROL_NAMES: readonly string[] = Object.freeze(
253
+ Object.keys(ENGINE_CONTROLS),
254
+ );
255
+
256
+ /** Loads one of the vendored engine's control components by Glacia-facing name. */
257
+ export function loadEngineControl(key: string): any | null {
258
+ const engine = requireEngineModule() as any;
259
+ const engineName = ENGINE_CONTROLS[key];
260
+ if (!engine || !engineName) return null;
261
+ const control = engine[engineName];
262
+ return control ?? null;
263
+ }
@@ -0,0 +1,7 @@
1
+ /** The initials an avatar shows when there is no picture. Kept in one place. */
2
+ export function initialsOf(name: string): string {
3
+ const words = name.trim().split(/\s+/).filter(Boolean);
4
+ if (words.length === 0) return "";
5
+ if (words.length === 1) return words[0]!.slice(0, 2).toUpperCase();
6
+ return (words[0]![0]! + words[words.length - 1]![0]!).toUpperCase();
7
+ }
@@ -0,0 +1,258 @@
1
+ // The invisible behaviour every Wave 2 component shares.
2
+ //
3
+ // These are the donor's contracts, implemented on React Native's own
4
+ // primitives: a component can be controlled or keep its own state, overlays
5
+ // dismiss on Android's back gesture and on an outside press, and every control
6
+ // exposes the accessibility role the donor gives it (checkbox, radio, tab,
7
+ // dialog, menu). Nothing here styles anything — the Apple dress lives in the
8
+ // component files.
9
+
10
+ import { useCallback, useEffect, useRef, useState } from "react";
11
+ import type { ReactNode } from "react";
12
+ import type { StyleProp, ViewStyle } from "react-native";
13
+
14
+ import { Glass } from "../Glass";
15
+ import { colors, radii } from "./tokens";
16
+ import { primitives } from "./primitives";
17
+ import { useIsDark } from "./motion";
18
+
19
+ /**
20
+ * Controlled-or-uncontrolled state. The donor's model: a `value` prop makes the
21
+ * component controlled, `defaultValue` seeds it, and `onChange` is called either
22
+ * way. Kept in one place so every component behaves identically.
23
+ */
24
+ export function useControllable<T>(
25
+ value: T | undefined,
26
+ defaultValue: T,
27
+ onChange?: (value: T) => void,
28
+ ): [T, (next: T) => void] {
29
+ const [internal, setInternal] = useState(defaultValue);
30
+ const current = value !== undefined ? value : internal;
31
+ const set = useCallback(
32
+ (next: T) => {
33
+ if (value === undefined) setInternal(next);
34
+ onChange?.(next);
35
+ },
36
+ [value, onChange],
37
+ );
38
+ return [current, set];
39
+ }
40
+
41
+ /**
42
+ * Registers Android's hardware back while an overlay is open, so back closes the
43
+ * layer and not the screen behind it.
44
+ */
45
+ export function useBackDismiss(open: boolean, dismiss: () => void) {
46
+ useEffect(() => {
47
+ if (!open) return;
48
+ const BackHandler = primitives().getBackHandler();
49
+ if (!BackHandler?.addEventListener) return;
50
+ const sub = BackHandler.addEventListener("hardwareBackPress", () => {
51
+ dismiss();
52
+ return true;
53
+ });
54
+ return () => sub?.remove?.();
55
+ }, [open, dismiss]);
56
+ }
57
+
58
+ export interface AnchorRect {
59
+ x: number;
60
+ y: number;
61
+ width: number;
62
+ height: number;
63
+ }
64
+
65
+ /** Reads a view's rectangle in window coordinates, when the runtime can. */
66
+ export function measureAnchor(node: any): Promise<AnchorRect | null> {
67
+ return new Promise((resolve) => {
68
+ if (!node || typeof node.measureInWindow !== "function") {
69
+ resolve(null);
70
+ return;
71
+ }
72
+ try {
73
+ node.measureInWindow((x: number, y: number, width: number, height: number) => {
74
+ resolve({ x, y, width, height });
75
+ });
76
+ } catch {
77
+ resolve(null);
78
+ }
79
+ });
80
+ }
81
+
82
+ /**
83
+ * Places a panel beside its trigger. Flips above when there is no room below,
84
+ * and clamps to the viewport otherwise — the donor's collision handling, kept
85
+ * deliberately small.
86
+ */
87
+ export function placePanel(
88
+ trigger: AnchorRect,
89
+ panel: { width: number; height: number },
90
+ viewport: { width: number; height: number },
91
+ gap = 6,
92
+ ): { left: number; top: number; flipped: boolean } {
93
+ const below = trigger.y + trigger.height + gap;
94
+ const above = trigger.y - panel.height - gap;
95
+ const fitsBelow = below + panel.height <= viewport.height;
96
+ const flipped = !fitsBelow && above >= 0;
97
+ const top = Math.max(8, Math.min(flipped ? above : below, viewport.height - panel.height - 8));
98
+ const left = Math.max(8, Math.min(trigger.x, viewport.width - panel.width - 8));
99
+ return { left, top, flipped };
100
+ }
101
+
102
+ /**
103
+ * A full-screen modal layer with a dimmed backdrop and a glass panel. Used by
104
+ * Dialog, Alert, AlertDialog, Popover, DropdownMenu, ContextMenu, Select and
105
+ * Tooltip, so dismissal, back handling and the surface are one implementation.
106
+ */
107
+ export function OverlayPanel({
108
+ open,
109
+ onClose,
110
+ dismissOnBackdropPress = true,
111
+ anchor,
112
+ width,
113
+ panelStyle,
114
+ children,
115
+ testID,
116
+ isDark: isDarkProp,
117
+ accessibilityLabel,
118
+ role = "menu",
119
+ }: {
120
+ open: boolean;
121
+ onClose: () => void;
122
+ dismissOnBackdropPress?: boolean;
123
+ anchor?: AnchorRect | null;
124
+ width?: number;
125
+ panelStyle?: StyleProp<ViewStyle>;
126
+ children: ReactNode;
127
+ testID?: string;
128
+ isDark?: boolean;
129
+ accessibilityLabel?: string;
130
+ role?: string;
131
+ }) {
132
+ const isDark = useIsDark(isDarkProp);
133
+ const theme = isDark ? colors.dark : colors.light;
134
+ const { View, Pressable, Modal, useWindowDimensions } = primitives();
135
+ const { width: screenWidth, height: screenHeight } = useWindowDimensions();
136
+ useBackDismiss(open, onClose);
137
+
138
+ if (!open) return null;
139
+
140
+ const placed = anchor ? placePanel(anchor, { width: width ?? 240, height: 0 }, { width: screenWidth, height: screenHeight }) : null;
141
+
142
+ return (
143
+ <Modal visible transparent animationType="fade" onRequestClose={onClose}>
144
+ <View style={{ flex: 1, backgroundColor: theme.scrim }}>
145
+ <Pressable
146
+ accessibilityRole="button"
147
+ accessibilityLabel={dismissOnBackdropPress ? "Close" : undefined}
148
+ onPress={dismissOnBackdropPress ? onClose : undefined}
149
+ style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }}
150
+ />
151
+ <View
152
+ pointerEvents="box-none"
153
+ style={placed ? { position: "absolute", left: placed.left, top: placed.top } : { flex: 1, alignItems: "center", justifyContent: "center", padding: 24 }}
154
+ >
155
+ <Pressable accessibilityRole="none" onPress={() => {}}>
156
+ <Glass
157
+ effect="regular"
158
+ surface="overlay"
159
+ isDark={isDark}
160
+ testID={testID}
161
+ accessibilityLabel={accessibilityLabel}
162
+ accessibilityRole={role as any}
163
+ style={[
164
+ {
165
+ width: placed ? width ?? 240 : undefined,
166
+ maxWidth: screenWidth - 32,
167
+ borderRadius: radii.lg,
168
+ backgroundColor: theme.surface,
169
+ paddingVertical: 6,
170
+ },
171
+ panelStyle,
172
+ ]}
173
+ >
174
+ {children}
175
+ </Glass>
176
+ </Pressable>
177
+ </View>
178
+ </View>
179
+ </Modal>
180
+ );
181
+ }
182
+
183
+ /** One row inside an overlay panel — the donor's menu/option item. */
184
+ export function PanelItem({
185
+ label,
186
+ onPress,
187
+ icon,
188
+ destructive = false,
189
+ selected = false,
190
+ disabled = false,
191
+ role = "button",
192
+ style,
193
+ testID,
194
+ isDark: isDarkProp,
195
+ }: {
196
+ label: string;
197
+ onPress: () => void;
198
+ icon?: ReactNode;
199
+ destructive?: boolean;
200
+ selected?: boolean;
201
+ disabled?: boolean;
202
+ role?: string;
203
+ style?: StyleProp<ViewStyle>;
204
+ testID?: string;
205
+ isDark?: boolean;
206
+ }) {
207
+ const isDark = useIsDark(isDarkProp);
208
+ const theme = isDark ? colors.dark : colors.light;
209
+ const { View, Pressable, Text: RNText } = primitives();
210
+ return (
211
+ <Pressable
212
+ testID={testID}
213
+ accessibilityRole={role as any}
214
+ accessibilityLabel={label}
215
+ accessibilityState={{ disabled, selected }}
216
+ disabled={disabled}
217
+ onPress={onPress}
218
+ style={[
219
+ {
220
+ flexDirection: "row",
221
+ alignItems: "center",
222
+ gap: 10,
223
+ minHeight: 40,
224
+ paddingHorizontal: 14,
225
+ paddingVertical: 8,
226
+ opacity: disabled ? 0.38 : 1,
227
+ },
228
+ style,
229
+ ]}
230
+ >
231
+ {icon ? <View>{icon}</View> : null}
232
+ <RNText
233
+ numberOfLines={1}
234
+ style={{
235
+ flex: 1,
236
+ fontSize: 15,
237
+ color: destructive ? theme.destructive : theme.foreground,
238
+ fontWeight: selected ? "600" : "400",
239
+ }}
240
+ >
241
+ {label}
242
+ </RNText>
243
+ {selected ? <RNText style={{ fontSize: 15, color: theme.fill }}>✓</RNText> : null}
244
+ </Pressable>
245
+ );
246
+ }
247
+
248
+ /** A positioned trigger that reports its window rectangle when it is pressed. */
249
+ export function useTriggerAnchor() {
250
+ const ref = useRef<any>(null);
251
+ const [anchor, setAnchor] = useState<AnchorRect | null>(null);
252
+ const capture = useCallback(async () => {
253
+ const rect = await measureAnchor(ref.current);
254
+ if (rect) setAnchor(rect);
255
+ return rect;
256
+ }, []);
257
+ return { ref, anchor, capture };
258
+ }
@@ -66,6 +66,12 @@ export interface RNPrimitives {
66
66
  * it can resolve them.
67
67
  */
68
68
  useWindowDimensions: () => { width: number; height: number };
69
+ /**
70
+ * React Native's safe-area insets, or a zero reader off-device. Bottom bars
71
+ * (the TabBar) float the glass above the system inset — the Android nav bar or
72
+ * the iOS home indicator — instead of letting it sink under.
73
+ */
74
+ useSafeAreaInsets: () => { top: number; bottom: number; left: number; right: number };
69
75
  }
70
76
 
71
77
  /**
@@ -167,6 +173,15 @@ function resolve(): RNPrimitives {
167
173
  slider: "slider",
168
174
  adjustable: "slider",
169
175
  heading: "heading",
176
+ option: "option",
177
+ listbox: "listbox",
178
+ menu: "menu",
179
+ menuitem: "menuitem",
180
+ dialog: "dialog",
181
+ alertdialog: "alertdialog",
182
+ group: "group",
183
+ toolbar: "toolbar",
184
+ separator: "separator",
170
185
  };
171
186
  // "none" means presentational: emit no role rather than a misleading one.
172
187
  if (accessibilityRole && accessibilityRole !== "none") {
@@ -331,6 +346,14 @@ function resolve(): RNPrimitives {
331
346
  const view: any = typeof globalThis !== "undefined" ? (globalThis as any).window : undefined;
332
347
  return { width: view?.innerWidth ?? 390, height: view?.innerHeight ?? 800 };
333
348
  }),
349
+ useSafeAreaInsets:
350
+ rn?.useSafeAreaInsets ??
351
+ (() => ({
352
+ top: 0,
353
+ bottom: 0,
354
+ left: 0,
355
+ right: 0,
356
+ })),
334
357
  };
335
358
  }
336
359