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
@@ -4,13 +4,17 @@ exports.Slider = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const primitives_1 = require("./internal/primitives");
7
+ const glass_routing_1 = require("./internal/glass-routing");
8
+ const GlassView_1 = require("./internal/GlassView");
7
9
  const Glass_1 = require("./Glass");
8
10
  const tokens_1 = require("./internal/tokens");
9
11
  const primitives_2 = require("./internal/primitives");
10
12
  const motion_1 = require("./internal/motion");
11
13
  const haptics_1 = require("./internal/haptics");
12
- const TRACK_HEIGHT = 8;
13
- const THUMB = 22;
14
+ // The web slider: a 6pt track and a glass-lens thumb rather than a small dot.
15
+ const TRACK_HEIGHT = 6;
16
+ const THUMB_WIDTH = 40;
17
+ const THUMB_HEIGHT = 24;
14
18
  const CONTAINER_HEIGHT = 40;
15
19
  /** Rounds `value` onto the nearest step from `min`, clamped to the range. */
16
20
  function quantize(value, min, max, step) {
@@ -20,23 +24,25 @@ function quantize(value, min, max, step) {
20
24
  if (!(step > 0))
21
25
  return clamped;
22
26
  const stepped = min + Math.round((clamped - min) / step) * step;
23
- // Round away binary float noise introduced by the division above.
24
27
  const decimals = (String(step).split(".")[1] ?? "").length;
25
28
  return Number(Math.min(max, Math.max(min, stepped)).toFixed(decimals));
26
29
  }
27
30
  /**
28
- * A continuous value chosen by dragging.
31
+ * A continuous value chosen by dragging — ported from the engine's
32
+ * `LiquidGlassSlider`, which keeps the approved drag behaviour while the
33
+ * material changes by platform.
29
34
  *
30
- * The interaction is Glacia's own: the track and thumb are Views and dragging
31
- * is a PanResponder reading the touch position against the track's measured
32
- * width. React Native has no DOM `<input type="range">` and the platform
33
- * sliders are not used, so the control looks and behaves the same on every
34
- * platform; only the glass material changes.
35
+ * With a glass renderer available the engine's own control mounts, carrying the
36
+ * approved geometry and drag behaviour. Without one — Expo Go, below every tier,
37
+ * or Reduce Transparency — the fallback floor renders the same track and lens
38
+ * thumb with the fallback material, so the control is never invisible.
35
39
  */
36
- exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, defaultValue = 50, min = 0, max = 100, step = 1, onValueChange, disabled = false, haptics = true, accessibilityLabel, style, isDark: isDarkProp, testID, ...props }, ref) {
40
+ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, defaultValue = 50, min = 0, max = 100, step = 1, onValueChange, onSlidingComplete, disabled = false, haptics = true, accessibilityLabel, style, isDark: isDarkProp, testID, ...props }, ref) {
37
41
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
38
42
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
39
43
  const { View, Pressable, PanResponder } = (0, primitives_2.primitives)();
44
+ const capabilities = (0, GlassView_1.glassCapabilities)();
45
+ const EngineSlider = (0, glass_routing_1.loadEngineControl)("Slider");
40
46
  const [internalValue, setInternalValue] = (0, react_1.useState)(() => quantize(defaultValue, min, max, step));
41
47
  const value = valueProp !== undefined ? quantize(valueProp, min, max, step) : internalValue;
42
48
  // Two actions can arrive before React re-renders (increment then decrement,
@@ -44,8 +50,6 @@ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, def
44
50
  // second one starts from it instead of a stale closure.
45
51
  const valueRef = (0, react_1.useRef)(value);
46
52
  valueRef.current = value;
47
- // Track width as measured on layout. A drag before layout is a no-op rather
48
- // than a jump: without a width there is no honest mapping from x to value.
49
53
  const widthRef = (0, react_1.useRef)(0);
50
54
  /** Converts an x position relative to the track into a stepped value. */
51
55
  const valueAtX = (0, react_1.useMemo)(() => (x) => {
@@ -85,10 +89,15 @@ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, def
85
89
  if (next !== null)
86
90
  report(next);
87
91
  },
92
+ onPanResponderRelease: (event) => {
93
+ const next = valueAtX(event.nativeEvent.locationX);
94
+ if (next !== null) {
95
+ report(next);
96
+ onSlidingComplete?.(next);
97
+ }
98
+ },
88
99
  onPanResponderTerminationRequest: () => false,
89
100
  });
90
- // `report` reads the value from a ref, so the responder does not need to be
91
- // rebuilt on every value change and never acts on a stale render.
92
101
  }, [disabled, valueAtX]);
93
102
  /** Steps the value for accessibility actions and hardware keys. */
94
103
  const nudge = (direction) => {
@@ -118,33 +127,44 @@ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, def
118
127
  };
119
128
  const thumbStyle = {
120
129
  position: "absolute",
121
- top: (CONTAINER_HEIGHT - THUMB) / 2,
130
+ top: (CONTAINER_HEIGHT - THUMB_HEIGHT) / 2,
122
131
  left: `${Math.min(100, Math.max(0, percentage))}%`,
123
- width: THUMB,
124
- height: THUMB,
125
- marginLeft: -THUMB / 2,
126
- borderRadius: THUMB / 2,
127
- backgroundColor: "#FFFFFF",
132
+ width: THUMB_WIDTH,
133
+ height: THUMB_HEIGHT,
134
+ marginLeft: -THUMB_WIDTH / 2,
135
+ borderRadius: THUMB_HEIGHT / 2,
136
+ backgroundColor: themeColors.onTint,
128
137
  borderWidth: 0.5,
129
- borderColor: "rgba(0, 0, 0, 0.12)",
138
+ borderColor: themeColors.edge,
139
+ shadowColor: tokens_1.material.shadowColor,
140
+ shadowOpacity: 0.2,
141
+ shadowRadius: 8,
142
+ shadowOffset: { width: 0, height: 3 },
143
+ elevation: 3,
130
144
  };
131
- return ((0, jsx_runtime_1.jsxs)(Pressable, { testID: testID, accessibilityRole: "adjustable", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, accessibilityValue: { min, max, now: value }, accessibilityActions: [{ name: "increment" }, { name: "decrement" }], onAccessibilityAction: (event) => {
132
- if (event?.nativeEvent?.actionName === "increment")
133
- nudge(1);
134
- if (event?.nativeEvent?.actionName === "decrement")
135
- nudge(-1);
136
- }, disabled: disabled, onLayout: (event) => {
137
- const width = event?.nativeEvent?.layout?.width;
138
- if (typeof width === "number" && width > 0)
139
- widthRef.current = width;
140
- },
141
- // The DOM preview has no layout events, so measure on mount there too;
142
- // on a device this resolves to nothing and onLayout is the source.
143
- ref: (node) => {
144
- (0, primitives_1.measurePreviewWidth)(node, widthRef);
145
- if (typeof ref === "function")
146
- ref(node);
147
- else if (ref)
148
- ref.current = node;
149
- }, style: containerStyle, ...(panResponder ? panResponder.panHandlers : {}), ...props, children: [(0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", isDark: isDark, style: trackStyle, children: (0, jsx_runtime_1.jsx)(View, { style: fillStyle }) }), (0, jsx_runtime_1.jsx)(View, { style: thumbStyle, pointerEvents: "none" })] }));
145
+ // ------------------------------------------------------------------
146
+ // Fallback floor: the same track and lens thumb, on the fallback material.
147
+ // ------------------------------------------------------------------
148
+ if (!(EngineSlider && capabilities.supported)) {
149
+ const track = ((0, jsx_runtime_1.jsx)(View, { style: trackStyle, children: (0, jsx_runtime_1.jsx)(View, { style: fillStyle }) }));
150
+ const thumb = (0, jsx_runtime_1.jsx)(View, { style: thumbStyle, pointerEvents: "none" });
151
+ return ((0, jsx_runtime_1.jsxs)(Pressable, { testID: testID, accessibilityRole: "adjustable", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, accessibilityValue: { min, max, now: value }, accessibilityActions: [{ name: "increment" }, { name: "decrement" }], disabled: disabled, onAccessibilityAction: (event) => {
152
+ if (event?.nativeEvent?.actionName === "increment")
153
+ nudge(1);
154
+ if (event?.nativeEvent?.actionName === "decrement")
155
+ nudge(-1);
156
+ }, onLayout: (event) => {
157
+ const width = event?.nativeEvent?.layout?.width;
158
+ if (typeof width === "number" && width > 0)
159
+ widthRef.current = width;
160
+ }, ref: (node) => {
161
+ (0, primitives_1.measurePreviewWidth)(node, widthRef);
162
+ if (typeof ref === "function")
163
+ ref(node);
164
+ else if (ref)
165
+ ref.current = node;
166
+ }, style: containerStyle, ...(panResponder ? panResponder.panHandlers : {}), ...props, children: [(0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", isDark: isDark, style: trackStyle, children: track }), thumb] }));
167
+ }
168
+ const EngineSliderComponent = EngineSlider;
169
+ return ((0, jsx_runtime_1.jsx)(EngineSliderComponent, { value: value, onValueChange: disabled ? undefined : onValueChange ?? report, onSlidingComplete: disabled ? undefined : onSlidingComplete, minimumValue: min, maximumValue: max, step: step, disabled: disabled, accentColor: themeColors.fill, trackColor: "rgba(120, 120, 128, 0.2)", style: style }));
150
170
  });
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Stepper = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const glass_routing_1 = require("./internal/glass-routing");
7
+ const GlassView_1 = require("./internal/GlassView");
8
+ const Glass_1 = require("./Glass");
9
+ const tokens_1 = require("./internal/tokens");
10
+ const primitives_1 = require("./internal/primitives");
11
+ const motion_1 = require("./internal/motion");
12
+ const a11y_1 = require("./internal/a11y");
13
+ const haptics_1 = require("./internal/haptics");
14
+ // The engine's stepper geometry, kept exactly: a 40dp capsule whose `−`/`+`
15
+ // ends are 44dp cells around a 44dp-minimum readout, with the thumb inset by
16
+ // the segmented control's 3dp.
17
+ const STEPPER_HEIGHT = 40;
18
+ const STEPPER_CELL_WIDTH = 44;
19
+ const STEPPER_VALUE_MIN_WIDTH = 44;
20
+ const STEPPER_INSET = 3;
21
+ const STEPPER_REPEAT_DELAY_MS = 400;
22
+ const STEPPER_REPEAT_INTERVAL_MS = 110;
23
+ const STEPPER_VALUE_POP_SCALE = 1.18;
24
+ /**
25
+ * Minus / value / plus — ported from the engine's `LiquidGlassStepper`, the
26
+ * design Binyam approved on real devices this week (40dp capsule, 44dp cells,
27
+ * press thumb blooming over the held end, the value popping as it changes, and
28
+ * hold-to-repeat).
29
+ *
30
+ * With a glass renderer available the engine's own control mounts, carrying the
31
+ * approved geometry and behaviour. Without one — Expo Go, below every tier, or
32
+ * Reduce Transparency — the fallback floor renders the same capsule, cells and
33
+ * readout on Glacia's solid material, so the control is never invisible.
34
+ */
35
+ exports.Stepper = (0, react_1.forwardRef)(function Stepper({ value: valueProp, defaultValue = 0, onValueChange, min, max, minimumValue, maximumValue, step = 1, autoRepeat = true, haptics = true, disabled = false, height = STEPPER_HEIGHT, formatValue, accessibilityLabel, tint, thumbTint, providerId, isDark: isDarkProp, style, textStyle, testID, ...props }, ref) {
36
+ const isDark = (0, motion_1.useIsDark)(isDarkProp);
37
+ const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
38
+ const reducedMotion = (0, a11y_1.useReducedMotion)();
39
+ const { Animated, View, Pressable, Text: RNText, isNative } = (0, primitives_1.primitives)();
40
+ const capabilities = (0, GlassView_1.glassCapabilities)();
41
+ const EngineStepper = (0, glass_routing_1.loadEngineControl)("Stepper");
42
+ const lower = min ?? minimumValue ?? 0;
43
+ const upper = max ?? maximumValue ?? 100;
44
+ const [internalValue, setInternalValue] = (0, react_1.useState)(() => clamp(defaultValue, lower, upper));
45
+ const value = clamp(valueProp !== undefined ? valueProp : internalValue, lower, upper);
46
+ // Two actions can arrive before a re-render (hold-to-repeat, or both ends in
47
+ // one frame). The ref holds the newest value so the next step starts from it.
48
+ const valueRef = (0, react_1.useRef)(value);
49
+ valueRef.current = value;
50
+ const [held, setHeld] = (0, react_1.useState)(0);
51
+ const repeatTimer = (0, react_1.useRef)(null);
52
+ (0, react_1.useEffect)(() => () => stopRepeat(), []);
53
+ // The readout pops on each change, like the engine's: an immediate lift then
54
+ // a spring home. Reduce Motion settles it straight at its resting scale.
55
+ const pop = (0, react_1.useRef)(null);
56
+ const animate = Boolean(isNative && Animated?.Value && Animated?.spring) && !reducedMotion;
57
+ if (pop.current === null) {
58
+ pop.current = animate ? new Animated.Value(1) : { value: 1 };
59
+ }
60
+ const firstValue = (0, react_1.useRef)(true);
61
+ (0, react_1.useEffect)(() => {
62
+ if (firstValue.current) {
63
+ firstValue.current = false;
64
+ return;
65
+ }
66
+ if (!animate)
67
+ return;
68
+ pop.current.setValue(STEPPER_VALUE_POP_SCALE);
69
+ const animation = Animated.spring(pop.current, {
70
+ toValue: 1,
71
+ ...tokens_1.springs.snappy,
72
+ useNativeDriver: false,
73
+ });
74
+ animation.start();
75
+ return () => animation.stop?.();
76
+ }, [animate, value]);
77
+ const atMin = value <= lower;
78
+ const atMax = value >= upper;
79
+ const apply = (next) => {
80
+ const clamped = clamp(next, lower, upper);
81
+ if (clamped === valueRef.current)
82
+ return;
83
+ if (haptics)
84
+ (0, haptics_1.hapticSelection)();
85
+ valueRef.current = clamped;
86
+ if (valueProp === undefined)
87
+ setInternalValue(clamped);
88
+ onValueChange?.(clamped);
89
+ };
90
+ function stopRepeat() {
91
+ if (repeatTimer.current != null) {
92
+ clearInterval(repeatTimer.current);
93
+ repeatTimer.current = null;
94
+ }
95
+ }
96
+ const stepBy = (direction) => apply(valueRef.current + direction * step);
97
+ const handlePressIn = (direction) => {
98
+ setHeld(direction);
99
+ };
100
+ const handlePressOut = () => {
101
+ setHeld(0);
102
+ stopRepeat();
103
+ };
104
+ const handleLongPress = (direction) => {
105
+ if (!autoRepeat)
106
+ return;
107
+ stepBy(direction);
108
+ stopRepeat();
109
+ repeatTimer.current = setInterval(() => stepBy(direction), STEPPER_REPEAT_INTERVAL_MS);
110
+ };
111
+ const label = formatValue ? formatValue(value) : String(value);
112
+ const rootStyle = {
113
+ height,
114
+ borderRadius: tokens_1.radii.pill,
115
+ alignSelf: "flex-start",
116
+ flexDirection: "row",
117
+ alignItems: "stretch",
118
+ opacity: disabled ? 0.5 : 1,
119
+ ...style,
120
+ };
121
+ const cellStyle = {
122
+ width: STEPPER_CELL_WIDTH,
123
+ alignItems: "center",
124
+ justifyContent: "center",
125
+ };
126
+ // ------------------------------------------------------------------
127
+ // Fallback floor: the same capsule, cells and readout, on Glacia's
128
+ // solid-capable material.
129
+ // ------------------------------------------------------------------
130
+ if (!(EngineStepper && capabilities.supported)) {
131
+ const thumbWidth = STEPPER_CELL_WIDTH - STEPPER_INSET;
132
+ const thumb = held !== 0 ? ((0, jsx_runtime_1.jsx)(View, { pointerEvents: "none", style: {
133
+ position: "absolute",
134
+ top: STEPPER_INSET,
135
+ left: held < 0 ? STEPPER_INSET : undefined,
136
+ right: held > 0 ? STEPPER_INSET : undefined,
137
+ width: thumbWidth,
138
+ height: height - 2 * STEPPER_INSET,
139
+ borderRadius: tokens_1.radii.pill,
140
+ backgroundColor: thumbTint ?? theme.glassActive,
141
+ } })) : null;
142
+ const cell = (label, sign, direction, blocked) => ((0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: label, accessibilityState: { disabled: disabled || blocked }, disabled: disabled || blocked, delayLongPress: STEPPER_REPEAT_DELAY_MS, onPressIn: () => handlePressIn(direction), onPressOut: handlePressOut, onPress: () => stepBy(direction), onLongPress: () => handleLongPress(direction), style: cellStyle, children: (0, jsx_runtime_1.jsx)(RNText, { style: {
143
+ fontSize: 20,
144
+ fontWeight: "500",
145
+ color: theme.foreground,
146
+ opacity: disabled || blocked ? 0.35 : 1,
147
+ }, children: sign }) }));
148
+ return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { ref: ref, effect: "regular", surface: "control", tintColor: tint, isDark: isDark, testID: testID, accessibilityRole: "adjustable", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, accessibilityValue: { min: lower, max: upper, now: value, text: label }, accessibilityActions: [{ name: "increment" }, { name: "decrement" }], onAccessibilityAction: (event) => {
149
+ const action = event?.nativeEvent?.actionName;
150
+ if (action === "increment")
151
+ apply(valueRef.current + step);
152
+ if (action === "decrement")
153
+ apply(valueRef.current - step);
154
+ }, style: rootStyle, ...props, children: [cell(`Decrease ${accessibilityLabel}`, "\u2212", -1, atMin), (0, jsx_runtime_1.jsx)(View, { style: { minWidth: STEPPER_VALUE_MIN_WIDTH, justifyContent: "center", alignItems: "center" }, children: (0, jsx_runtime_1.jsx)(Animated.View, { style: { transform: [{ scale: pop.current }] }, children: (0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: [
155
+ { fontSize: 16, fontWeight: "600", color: theme.foreground },
156
+ textStyle,
157
+ ], children: label }) }) }), cell(`Increase ${accessibilityLabel}`, "+", 1, atMax), thumb] }));
158
+ }
159
+ const EngineStepperComponent = EngineStepper;
160
+ return ((0, jsx_runtime_1.jsx)(EngineStepperComponent, { value: value, onValueChange: disabled ? undefined : (next) => apply(next), minimumValue: lower, maximumValue: upper, step: step, disabled: disabled, autoRepeat: autoRepeat, formatValue: formatValue, height: height, tint: tint, thumbTint: thumbTint, providerId: providerId, style: style, textStyle: textStyle, testID: testID, accessibilityLabel: accessibilityLabel }));
161
+ });
162
+ /** Keeps a value inside the stepper's range. */
163
+ function clamp(value, min, max) {
164
+ if (!Number.isFinite(value))
165
+ return min;
166
+ return Math.min(max, Math.max(min, value));
167
+ }
@@ -3,61 +3,63 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Switch = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const Glass_1 = require("./Glass");
6
+ const glass_routing_1 = require("./internal/glass-routing");
7
+ const GlassView_1 = require("./internal/GlassView");
7
8
  const tokens_1 = require("./internal/tokens");
8
9
  const primitives_1 = require("./internal/primitives");
9
- const motion_1 = require("./internal/motion");
10
10
  const haptics_1 = require("./internal/haptics");
11
- const TRACK_WIDTH = 51;
12
- const TRACK_HEIGHT = 31;
13
- const THUMB = 27;
14
- const TRAVEL = TRACK_WIDTH - THUMB - 4;
11
+ const motion_1 = require("./internal/motion");
15
12
  /**
16
- * An on/off switch.
13
+ * An on/off switch — ported from the engine's `LiquidGlassSwitch`, the design
14
+ * Binyam approved on real devices this week (64x28 track, 40x24 lens thumb).
17
15
  *
18
- * The track is Glacia's glass; the thumb is one of our own Views, animated on
19
- * the springs token. The material changes by platform (Apple's glass on
20
- * iOS 26+, Glacia's tint elsewhere) but the control is always ours — React
21
- * Native's built-in Switch is never used.
16
+ * With a glass renderer available the engine's own control mounts, carrying the
17
+ * approved geometry and interaction. Without one — Expo Go, below every tier, or
18
+ * Reduce Transparency — the fallback floor renders the same geometry with a solid
19
+ * track and lens thumb, so the control is never invisible.
22
20
  */
23
- exports.Switch = (0, react_1.forwardRef)(function Switch({ checked: checkedProp, defaultChecked = false, onCheckedChange, disabled = false, haptics = true, accessibilityLabel, style, isDark: isDarkProp, testID, ...props }, ref) {
21
+ exports.Switch = (0, react_1.forwardRef)(function Switch({ value: valueProp, defaultValue = false, onValueChange, disabled = false, accentColor, trackColor, accessibilityLabel, haptics = true, isDark: isDarkProp, testID, style, ...props }, ref) {
24
22
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
25
23
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
26
- const { View, Pressable, Animated } = (0, primitives_1.primitives)();
27
- const [internalChecked, setInternalChecked] = (0, react_1.useState)(defaultChecked);
28
- const isChecked = checkedProp !== undefined ? checkedProp : internalChecked;
29
- // The thumb's travel is a single number animated on the springs token.
30
- const { value: offset, animated } = (0, motion_1.useSpring)(isChecked ? TRAVEL : 0, "snappy");
24
+ const { View, Pressable } = (0, primitives_1.primitives)();
25
+ const capabilities = (0, GlassView_1.glassCapabilities)();
26
+ const EngineSwitch = (0, glass_routing_1.loadEngineControl)("Switch");
27
+ const [internalValue, setInternalValue] = (0, react_1.useState)(defaultValue);
28
+ const value = valueProp ?? internalValue;
31
29
  const toggle = () => {
32
30
  if (disabled)
33
31
  return;
34
- const next = !isChecked;
32
+ const next = !value;
35
33
  if (haptics)
36
34
  (0, haptics_1.hapticSelection)();
37
- if (checkedProp === undefined)
38
- setInternalChecked(next);
39
- onCheckedChange?.(next);
40
- };
41
- const trackStyle = {
42
- width: TRACK_WIDTH,
43
- height: TRACK_HEIGHT,
44
- borderRadius: TRACK_HEIGHT / 2,
45
- backgroundColor: isChecked ? themeColors.fill : "rgba(120, 120, 128, 0.16)",
46
- padding: 2,
47
- justifyContent: "center",
48
- opacity: disabled ? 0.38 : 1,
49
- ...style,
50
- };
51
- const thumbStyle = {
52
- width: THUMB,
53
- height: THUMB,
54
- borderRadius: THUMB / 2,
55
- backgroundColor: "#FFFFFF",
56
- // A hairline edge instead of a drop shadow: RN shadows need per-platform
57
- // props, and the edge reads correctly on a translucent track.
58
- borderWidth: 0.5,
59
- borderColor: "rgba(0, 0, 0, 0.12)",
60
- transform: [{ translateX: animated ? offset : isChecked ? TRAVEL : 0 }],
35
+ if (valueProp === undefined)
36
+ setInternalValue(next);
37
+ onValueChange?.(next);
61
38
  };
62
- return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "switch", accessibilityLabel: accessibilityLabel, accessibilityState: { checked: isChecked, disabled }, disabled: disabled, onPress: toggle, style: { alignSelf: "flex-start" }, ...props, children: (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", isDark: isDark, style: trackStyle, children: animated ? (0, jsx_runtime_1.jsx)(Animated.View, { style: thumbStyle }) : (0, jsx_runtime_1.jsx)(View, { style: thumbStyle }) }) }));
39
+ if (EngineSwitch && capabilities.supported) {
40
+ const EngineSwitchComponent = EngineSwitch;
41
+ return ((0, jsx_runtime_1.jsx)(EngineSwitchComponent, { value: value, onValueChange: disabled ? undefined : toggle, disabled: disabled, accentColor: accentColor, trackColor: trackColor, style: style }));
42
+ }
43
+ // Fallback floor: solid track + lens thumb, full geometry, full states.
44
+ const trackHeight = 28;
45
+ const thumbHeight = 24;
46
+ const thumbInset = 2;
47
+ const travel = 64 - 40 - thumbInset * 2;
48
+ return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "switch", accessibilityLabel: accessibilityLabel, accessibilityState: { checked: value, disabled }, disabled: disabled, onPress: disabled ? undefined : toggle, style: { alignSelf: "flex-start" }, ...props, children: (0, jsx_runtime_1.jsx)(View, { style: {
49
+ width: 64,
50
+ height: trackHeight,
51
+ borderRadius: trackHeight / 2,
52
+ backgroundColor: value ? accentColor ?? themeColors.fill : themeColors.fieldWash,
53
+ overflow: "hidden",
54
+ opacity: disabled ? 0.38 : 1,
55
+ }, children: (0, jsx_runtime_1.jsx)(View, { style: {
56
+ position: "absolute",
57
+ left: thumbInset,
58
+ top: (trackHeight - thumbHeight) / 2,
59
+ width: 40,
60
+ height: thumbHeight,
61
+ borderRadius: thumbHeight / 2,
62
+ backgroundColor: themeColors.onTint,
63
+ transform: [{ translateX: value ? travel : 0 }],
64
+ } }) }) }));
63
65
  });
@@ -3,33 +3,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TabBar = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const glass_routing_1 = require("./internal/glass-routing");
7
+ const GlassView_1 = require("./internal/GlassView");
6
8
  const Glass_1 = require("./Glass");
7
9
  const tokens_1 = require("./internal/tokens");
8
10
  const primitives_1 = require("./internal/primitives");
9
11
  const motion_1 = require("./internal/motion");
10
12
  const haptics_1 = require("./internal/haptics");
11
- const BAR_HEIGHT = 52;
13
+ const lens_1 = require("./internal/lens");
14
+ // The web bar: a 40pt rail (32pt tabs in a 4pt inset) with a 20pt radius, a
15
+ // glass lens filling the active slot, and 13pt labels at 500/400 weight.
16
+ const BAR_HEIGHT = 40;
12
17
  /**
13
18
  * The bottom bar of an app: a row of tabs on one glass surface.
14
19
  *
15
20
  * The platform rule is the point of this component. On iOS 26+ the surface is
16
- * Apple's real Liquid Glass (`UIGlassEffect` via `@callstack/liquid-glass`)
17
- * with Glacia's own items inside it; on older iOS and on Android it is
18
- * Glacia's bar. The items are always our Pressables and Texts — no native tab
19
- * bar is used on any platform.
21
+ * Apple's real Liquid Glass (`UIGlassEffect` via the vendored engine) with
22
+ * Glacia's own items inside it; on older iOS and on Android it is Glacia's bar.
23
+ * The items are always our Pressables and Texts — no native tab bar is used on
24
+ * any platform.
25
+ *
26
+ * The port is the engine's `LiquidGlassTabBar` design, and it carries over
27
+ * session 1's safe-area behaviour: the bar floats fully above the system inset
28
+ * (the Android navigation bar or the iOS home indicator) — the safe-area bottom
29
+ * inset is added to the bar's height — so the glass ends above the inset rather
30
+ * than sinking into it and the labels never clip.
20
31
  */
21
- exports.TabBar = (0, react_1.forwardRef)(function TabBar({ items, activeId: activeProp, defaultActiveId, onTabChange, haptics = true, style, isDark: isDarkProp, testID, ...props }, ref) {
32
+ exports.TabBar = (0, react_1.forwardRef)(function TabBar({ items, activeId: activeProp, defaultActiveId, onTabChange, haptics = true, style, isDark: isDarkProp, bottomInset, testID, ...props }, ref) {
22
33
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
23
34
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
24
- const { View, Text, Pressable, Animated } = (0, primitives_1.primitives)();
35
+ const { View, Pressable, Text: RNText, Animated } = (0, primitives_1.primitives)();
36
+ const capabilities = (0, GlassView_1.glassCapabilities)();
37
+ const EngineTabBar = (0, glass_routing_1.loadEngineControl)("TabBar");
25
38
  const [internalId, setInternalId] = (0, react_1.useState)(defaultActiveId || items[0]?.id || "");
26
- const activeId = activeProp !== undefined ? activeProp : internalId;
27
- const activeIndex = Math.max(0, items.findIndex((item) => item.id === activeId));
28
- // The active wash slides between equally wide items on the springs token.
29
- const { value: slide, animated } = (0, motion_1.useSpring)(activeIndex, "snappy");
39
+ const [held, setHeld] = (0, react_1.useState)(false);
40
+ const activeId = activeProp ?? internalId;
30
41
  const handleSelect = (id) => {
31
- // Selecting the tab already active is not a change, so it does not tick.
32
- if (haptics && id !== activeId)
42
+ if (haptics)
33
43
  (0, haptics_1.hapticSelection)();
34
44
  if (activeProp === undefined)
35
45
  setInternalId(id);
@@ -39,51 +49,53 @@ exports.TabBar = (0, react_1.forwardRef)(function TabBar({ items, activeId: acti
39
49
  flexDirection: "row",
40
50
  alignItems: "center",
41
51
  justifyContent: "space-around",
42
- height: BAR_HEIGHT,
43
- paddingHorizontal: 8,
44
- borderRadius: tokens_1.radii.xl,
52
+ // The bar floats fully above the system inset, so it is taller than its
53
+ // design height by the safe-area bottom inset. At zero inset it is exactly
54
+ // the design height.
55
+ height: BAR_HEIGHT + Math.max(bottomInset ?? 0, 0),
56
+ paddingHorizontal: 4,
57
+ borderRadius: tokens_1.radii.lg,
45
58
  ...style,
46
59
  };
47
60
  const count = Math.max(items.length, 1);
48
61
  const itemWidth = `${100 / count}%`;
62
+ const activeIndex = Math.max(0, items.findIndex((tab) => tab.id === activeId));
49
63
  const indicatorStyle = {
50
64
  position: "absolute",
51
- top: 6,
52
- bottom: 6,
53
- left: 8,
65
+ top: 4,
66
+ bottom: 4,
67
+ left: 4,
54
68
  width: itemWidth,
55
- borderRadius: tokens_1.radii.lg,
69
+ borderRadius: tokens_1.radii.pill,
56
70
  backgroundColor: themeColors.glassActive,
57
71
  opacity: 0.75,
72
+ ...(0, lens_1.lensShadow)(isDark),
58
73
  };
59
- return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { ref: ref, effect: "regular", isDark: isDark, style: barStyle, testID: testID, ...props, children: [animated ? ((0, jsx_runtime_1.jsx)(Animated.View, { pointerEvents: "none", style: {
60
- ...indicatorStyle,
61
- transform: [
62
- {
63
- translateX: slide.interpolate({
64
- inputRange: [0, Math.max(count - 1, 1)],
65
- outputRange: [
66
- "0%",
67
- `${((count - 1) * 100) / count}%`,
68
- ],
69
- }),
70
- },
71
- ],
72
- } })) : ((0, jsx_runtime_1.jsx)(View, { pointerEvents: "none", style: { ...indicatorStyle, left: `${(activeIndex * 100) / count}%` } })), items.map((tab) => {
73
- const isActive = tab.id === activeId;
74
- return ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "tab", accessibilityLabel: tab.label, accessibilityState: { selected: isActive }, onPress: () => handleSelect(tab.id), style: {
75
- flex: 1,
76
- height: "100%",
77
- flexDirection: "column",
78
- alignItems: "center",
79
- justifyContent: "center",
80
- gap: 2,
81
- paddingHorizontal: 8,
82
- paddingVertical: 4,
83
- }, children: [tab.icon ?? null, (0, jsx_runtime_1.jsx)(Text, { numberOfLines: 1, style: {
84
- fontSize: 11,
85
- fontWeight: isActive ? "600" : "500",
86
- color: isActive ? themeColors.fill : themeColors.muted,
87
- }, children: tab.label })] }, tab.id));
88
- })] }));
74
+ const { value: offset, animated } = (0, motion_1.useSpring)(activeIndex, "snappy");
75
+ // ------------------------------------------------------------------
76
+ // Fallback floor: the same rail and lens pill, on the fallback material.
77
+ // ------------------------------------------------------------------
78
+ if (!(EngineTabBar && capabilities.supported)) {
79
+ return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { ref: ref, effect: "regular", surface: "rail", pressed: held, isDark: isDark, style: barStyle, testID: testID, ...props, children: [animated ? ((0, jsx_runtime_1.jsx)(Animated.View, { pointerEvents: "none", style: { ...indicatorStyle, transform: [{ translateX: offset.interpolate({ inputRange: [0, Math.max(count - 1, 1)], outputRange: [0, `${((count - 1) * 100) / count}%`] }) }] }, children: (0, jsx_runtime_1.jsx)(lens_1.LensRim, { radius: tokens_1.radii.pill, isDark: isDark }) })) : ((0, jsx_runtime_1.jsx)(View, { pointerEvents: "none", style: { ...indicatorStyle, left: `${(activeIndex * 100) / count}%` }, children: (0, jsx_runtime_1.jsx)(lens_1.LensRim, { radius: tokens_1.radii.pill, isDark: isDark }) })), items.map((tab) => {
80
+ const isActive = tab.id === activeId;
81
+ return ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "tab", accessibilityLabel: tab.label, accessibilityState: { selected: isActive }, onPress: () => handleSelect(tab.id), onPressIn: () => setHeld(true), onPressOut: () => setHeld(false), style: {
82
+ flex: 1,
83
+ height: "100%",
84
+ flexDirection: "column",
85
+ alignItems: "center",
86
+ justifyContent: "center",
87
+ gap: 2,
88
+ paddingHorizontal: 8,
89
+ paddingVertical: 4,
90
+ }, children: [tab.icon ?? null, (0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: { fontSize: 13, fontWeight: isActive ? "500" : "400", color: isActive ? themeColors.fill : themeColors.muted }, children: tab.label })] }, tab.id));
91
+ })] }));
92
+ }
93
+ const EngineTabBarComponent = EngineTabBar;
94
+ const tabs = items.map((item) => ({
95
+ key: item.id,
96
+ title: item.label,
97
+ icon: item.icon,
98
+ }));
99
+ const selectedIndex = Math.max(0, items.findIndex((item) => item.id === activeId));
100
+ return ((0, jsx_runtime_1.jsx)(EngineTabBarComponent, { tabs: tabs, selectedIndex: selectedIndex, onTabSelected: (index) => handleSelect(items[index]?.id ?? ""), accentColor: themeColors.fill, inactiveColor: themeColors.muted, tint: themeColors.glass, style: style, labelStyle: { fontSize: 13 } }));
89
101
  });
@@ -21,6 +21,7 @@ exports.Tabs = (0, react_1.forwardRef)(function Tabs({ items, activeId: activePr
21
21
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
22
22
  const { View, Text, Pressable, Animated } = (0, primitives_1.primitives)();
23
23
  const [internalId, setInternalId] = (0, react_1.useState)(defaultActiveId || items[0]?.id || "");
24
+ const [held, setHeld] = (0, react_1.useState)(false);
24
25
  const activeId = activeProp !== undefined ? activeProp : internalId;
25
26
  const activeIndex = Math.max(0, items.findIndex((tab) => tab.id === activeId));
26
27
  const { value: slide, animated } = (0, motion_1.useSpring)(activeIndex, "snappy");
@@ -43,7 +44,7 @@ exports.Tabs = (0, react_1.forwardRef)(function Tabs({ items, activeId: activePr
43
44
  borderWidth: 0.5,
44
45
  borderColor: themeColors.edge,
45
46
  };
46
- return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { ref: ref, effect: "regular", isDark: isDark, style: {
47
+ return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { ref: ref, effect: "regular", surface: "rail", pressed: held, isDark: isDark, style: {
47
48
  flexDirection: "row",
48
49
  alignItems: "center",
49
50
  alignSelf: "flex-start",
@@ -63,7 +64,7 @@ exports.Tabs = (0, react_1.forwardRef)(function Tabs({ items, activeId: activePr
63
64
  ],
64
65
  } })) : ((0, jsx_runtime_1.jsx)(View, { pointerEvents: "none", style: { ...paneStyle, left: `${(activeIndex * 100) / count}%` } })), items.map((tab) => {
65
66
  const isActive = tab.id === activeId;
66
- return ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "tab", accessibilityLabel: tab.label, accessibilityState: { selected: isActive }, onPress: () => handleSelect(tab.id), style: {
67
+ return ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "tab", accessibilityLabel: tab.label, accessibilityState: { selected: isActive }, onPress: () => handleSelect(tab.id), onPressIn: () => setHeld(true), onPressOut: () => setHeld(false), style: {
67
68
  flex: 1,
68
69
  height: 36,
69
70
  flexDirection: "row",
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Textarea = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Wave 2 — Textarea.
6
+ //
7
+ // The donor's multiline field: the same label/description/error contract as a
8
+ // single-line input, `textAlignVertical: top`, and a height derived from `rows`.
9
+ // It is the family's Input with `multiline`, not a second control.
10
+ const react_1 = require("react");
11
+ const Input_1 = require("./Input");
12
+ exports.Textarea = (0, react_1.forwardRef)(function Textarea({ rows = 4, style, minLines, ...props }, ref) {
13
+ const own = { textAlignVertical: "top", minHeight: 22 * rows + 20 };
14
+ const flat = Array.isArray(style)
15
+ ? Object.assign({}, own, ...style.filter(Boolean))
16
+ : Object.assign({}, own, style ?? {});
17
+ return ((0, jsx_runtime_1.jsx)(Input_1.Input, { ref: ref, multiline: true, minLines: minLines ?? rows, style: flat, ...{ rows }, ...props }));
18
+ });