glacia-native 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +84 -17
  2. package/lib/module/Accordion.js +58 -0
  3. package/lib/module/ActionSheet.js +38 -0
  4. package/lib/module/Alert.js +23 -0
  5. package/lib/module/AlertDialog.js +47 -0
  6. package/lib/module/Avatar.js +48 -0
  7. package/lib/module/Badge.js +36 -0
  8. package/lib/module/Bars.js +13 -268
  9. package/lib/module/Button.js +57 -39
  10. package/lib/module/Card.js +31 -19
  11. package/lib/module/Checkbox.js +42 -0
  12. package/lib/module/Chip.js +80 -0
  13. package/lib/module/Collapsible.js +26 -0
  14. package/lib/module/ContextMenu.js +33 -0
  15. package/lib/module/Dialog.js +39 -123
  16. package/lib/module/DropdownMenu.js +33 -0
  17. package/lib/module/Field.js +22 -0
  18. package/lib/module/Glass.js +10 -3
  19. package/lib/module/Group.js +36 -0
  20. package/lib/module/IconButton.js +40 -0
  21. package/lib/module/Input.js +43 -38
  22. package/lib/module/Label.js +17 -0
  23. package/lib/module/MorphGroup.js +47 -0
  24. package/lib/module/Popover.js +29 -0
  25. package/lib/module/Progress.js +32 -0
  26. package/lib/module/RadioGroup.js +51 -0
  27. package/lib/module/Scrim.js +44 -0
  28. package/lib/module/SegmentedControl.js +70 -63
  29. package/lib/module/Select.js +51 -0
  30. package/lib/module/Separator.js +25 -0
  31. package/lib/module/Sheet.js +51 -0
  32. package/lib/module/Skeleton.js +48 -0
  33. package/lib/module/Slider.js +45 -34
  34. package/lib/module/Stepper.js +167 -0
  35. package/lib/module/Switch.js +45 -55
  36. package/lib/module/TabBar.js +50 -44
  37. package/lib/module/Textarea.js +18 -0
  38. package/lib/module/Toast.js +55 -0
  39. package/lib/module/Toggle.js +47 -0
  40. package/lib/module/ToggleGroup.js +56 -0
  41. package/lib/module/Toolbar.js +37 -0
  42. package/lib/module/Tooltip.js +31 -0
  43. package/lib/module/glass-provider.js +28 -0
  44. package/lib/module/glass-stack.js +61 -0
  45. package/lib/module/index.js +78 -109
  46. package/lib/module/internal/GlassBackdrop.js +36 -0
  47. package/lib/module/internal/GlassView.js +43 -11
  48. package/lib/module/internal/blur-community.js +20 -0
  49. package/lib/module/internal/blur-community.web.js +9 -0
  50. package/lib/module/internal/blur.js +6 -9
  51. package/lib/module/internal/glass-routing.js +154 -30
  52. package/lib/module/internal/initials.js +12 -0
  53. package/lib/module/internal/overlay.js +147 -0
  54. package/lib/module/internal/primitives.js +16 -0
  55. package/lib/typescript/Accordion.d.ts +22 -0
  56. package/lib/typescript/ActionSheet.d.ts +24 -0
  57. package/lib/typescript/Alert.d.ts +15 -0
  58. package/lib/typescript/AlertDialog.d.ts +17 -0
  59. package/lib/typescript/Avatar.d.ts +22 -0
  60. package/lib/typescript/Badge.d.ts +12 -0
  61. package/lib/typescript/Bars.d.ts +3 -188
  62. package/lib/typescript/Button.d.ts +44 -10
  63. package/lib/typescript/Card.d.ts +30 -3
  64. package/lib/typescript/Checkbox.d.ts +14 -0
  65. package/lib/typescript/Chip.d.ts +19 -0
  66. package/lib/typescript/Collapsible.d.ts +17 -0
  67. package/lib/typescript/ContextMenu.d.ts +23 -0
  68. package/lib/typescript/Dialog.d.ts +8 -68
  69. package/lib/typescript/DropdownMenu.d.ts +23 -0
  70. package/lib/typescript/Field.d.ts +19 -0
  71. package/lib/typescript/Glass.d.ts +11 -2
  72. package/lib/typescript/Group.d.ts +35 -0
  73. package/lib/typescript/IconButton.d.ts +21 -0
  74. package/lib/typescript/Input.d.ts +17 -18
  75. package/lib/typescript/Label.d.ts +14 -0
  76. package/lib/typescript/MorphGroup.d.ts +46 -0
  77. package/lib/typescript/Popover.d.ts +17 -0
  78. package/lib/typescript/Progress.d.ts +13 -0
  79. package/lib/typescript/RadioGroup.d.ts +21 -0
  80. package/lib/typescript/Scrim.d.ts +33 -0
  81. package/lib/typescript/SegmentedControl.d.ts +24 -13
  82. package/lib/typescript/Select.d.ts +19 -0
  83. package/lib/typescript/Separator.d.ts +10 -0
  84. package/lib/typescript/Sheet.d.ts +45 -0
  85. package/lib/typescript/Skeleton.d.ts +10 -0
  86. package/lib/typescript/Slider.d.ts +15 -7
  87. package/lib/typescript/Stepper.d.ts +49 -0
  88. package/lib/typescript/Switch.d.ts +19 -12
  89. package/lib/typescript/TabBar.d.ts +18 -6
  90. package/lib/typescript/Textarea.d.ts +6 -0
  91. package/lib/typescript/Toast.d.ts +40 -0
  92. package/lib/typescript/Toggle.d.ts +21 -0
  93. package/lib/typescript/ToggleGroup.d.ts +22 -0
  94. package/lib/typescript/Toolbar.d.ts +35 -0
  95. package/lib/typescript/Tooltip.d.ts +16 -0
  96. package/lib/typescript/glass-provider.d.ts +34 -0
  97. package/lib/typescript/glass-stack.d.ts +54 -0
  98. package/lib/typescript/index.d.ts +38 -17
  99. package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
  100. package/lib/typescript/internal/GlassView.d.ts +18 -2
  101. package/lib/typescript/internal/blur-community.d.ts +2 -0
  102. package/lib/typescript/internal/blur-community.web.d.ts +2 -0
  103. package/lib/typescript/internal/glass-routing.d.ts +83 -15
  104. package/lib/typescript/internal/initials.d.ts +2 -0
  105. package/lib/typescript/internal/overlay.d.ts +74 -0
  106. package/lib/typescript/internal/primitives.d.ts +11 -0
  107. package/package.json +4 -2
  108. package/src/Accordion.tsx +165 -0
  109. package/src/ActionSheet.tsx +149 -0
  110. package/src/Alert.tsx +85 -0
  111. package/src/AlertDialog.tsx +124 -0
  112. package/src/Avatar.tsx +102 -0
  113. package/src/Badge.tsx +80 -0
  114. package/src/Bars.tsx +10 -807
  115. package/src/Button.tsx +196 -67
  116. package/src/Card.tsx +105 -32
  117. package/src/Checkbox.tsx +98 -0
  118. package/src/Chip.tsx +149 -0
  119. package/src/Collapsible.tsx +66 -0
  120. package/src/ContextMenu.tsx +103 -0
  121. package/src/Dialog.tsx +85 -335
  122. package/src/DropdownMenu.tsx +103 -0
  123. package/src/Field.tsx +65 -0
  124. package/src/Glass.tsx +15 -5
  125. package/src/Group.tsx +98 -0
  126. package/src/IconButton.tsx +110 -0
  127. package/src/Input.tsx +139 -87
  128. package/src/Label.tsx +56 -0
  129. package/src/MorphGroup.tsx +134 -0
  130. package/src/Popover.tsx +81 -0
  131. package/src/Progress.tsx +83 -0
  132. package/src/RadioGroup.tsx +122 -0
  133. package/src/Scrim.tsx +94 -0
  134. package/src/SegmentedControl.tsx +132 -99
  135. package/src/Select.tsx +136 -0
  136. package/src/Separator.tsx +52 -0
  137. package/src/Sheet.tsx +139 -0
  138. package/src/Skeleton.tsx +77 -0
  139. package/src/Slider.tsx +84 -47
  140. package/src/Stepper.tsx +315 -0
  141. package/src/Switch.tsx +81 -73
  142. package/src/TabBar.tsx +106 -93
  143. package/src/Textarea.tsx +34 -0
  144. package/src/Toast.tsx +131 -0
  145. package/src/Toggle.tsx +113 -0
  146. package/src/ToggleGroup.tsx +129 -0
  147. package/src/Toolbar.tsx +111 -0
  148. package/src/Tooltip.tsx +79 -0
  149. package/src/engine/CHANGELOG.md +430 -0
  150. package/src/engine/NOTICE +54 -0
  151. package/src/engine/README.md +975 -0
  152. package/src/engine/android/build.gradle +18 -0
  153. package/src/engine/android/src/main/AndroidManifest.xml +2 -0
  154. package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
  155. package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
  156. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
  157. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
  158. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
  159. package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
  160. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
  161. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
  162. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
  163. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
  164. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
  165. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
  166. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
  167. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
  168. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
  169. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
  170. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
  171. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
  172. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
  173. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
  174. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
  175. package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
  176. package/src/engine/index.ts +24 -0
  177. package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
  178. package/src/engine/ios/Enums/GlassVariant.swift +86 -0
  179. package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
  180. package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
  181. package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
  182. package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
  183. package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
  184. package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
  185. package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
  186. package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
  187. package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
  188. package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
  189. package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
  190. package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
  191. package/src/engine/ios/Glass/StripCache.swift +545 -0
  192. package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
  193. package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
  194. package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
  195. package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
  196. package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
  197. package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
  198. package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
  199. package/src/engine/package.json +70 -0
  200. package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
  201. package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
  202. package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
  203. package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
  204. package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
  205. package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
  206. package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
  207. package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
  208. package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
  209. package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
  210. package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
  211. package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
  212. package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
  213. package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
  214. package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
  215. package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
  216. package/src/engine/src/components/index.ts +16 -0
  217. package/src/engine/src/constants/index.ts +4 -0
  218. package/src/engine/src/constants/metal.constants.ts +327 -0
  219. package/src/engine/src/constants/metrics.constants.ts +325 -0
  220. package/src/engine/src/constants/springs.constants.ts +107 -0
  221. package/src/engine/src/constants/styles.constants.ts +12 -0
  222. package/src/engine/src/context/glass-group.context.ts +65 -0
  223. package/src/engine/src/context/index.ts +6 -0
  224. package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
  225. package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
  226. package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
  227. package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
  228. package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
  229. package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
  230. package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
  231. package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
  232. package/src/engine/src/core/components/index.ts +4 -0
  233. package/src/engine/src/core/constants/glass.constants.ts +57 -0
  234. package/src/engine/src/core/constants/index.ts +20 -0
  235. package/src/engine/src/core/constants/native.constants.ts +16 -0
  236. package/src/engine/src/core/context/glass-stack.context.ts +30 -0
  237. package/src/engine/src/core/context/index.ts +4 -0
  238. package/src/engine/src/core/enum/index.ts +12 -0
  239. package/src/engine/src/core/index.ts +1 -0
  240. package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
  241. package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
  242. package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
  243. package/src/engine/src/core/interfaces/index.ts +31 -0
  244. package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
  245. package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
  246. package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
  247. package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
  248. package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
  249. package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
  250. package/src/engine/src/core/modules/index.ts +2 -0
  251. package/src/engine/src/core/root/index.ts +51 -0
  252. package/src/engine/src/core/types/glass.types.ts +25 -0
  253. package/src/engine/src/core/types/index.ts +8 -0
  254. package/src/engine/src/core/utils/debug.utils.ts +17 -0
  255. package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
  256. package/src/engine/src/core/utils/hdr.utils.ts +37 -0
  257. package/src/engine/src/core/utils/index.ts +5 -0
  258. package/src/engine/src/core/utils/native-view.utils.ts +33 -0
  259. package/src/engine/src/core/utils/platform.utils.ts +34 -0
  260. package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
  261. package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
  262. package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
  263. package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
  264. package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
  265. package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
  266. package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
  267. package/src/engine/src/core/views/index.ts +4 -0
  268. package/src/engine/src/hooks/index.ts +18 -0
  269. package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
  270. package/src/engine/src/hooks/use-damped-drag.ts +332 -0
  271. package/src/engine/src/hooks/use-echo-filter.ts +55 -0
  272. package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
  273. package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
  274. package/src/engine/src/hooks/use-press-progress.ts +44 -0
  275. package/src/engine/src/index.ts +120 -0
  276. package/src/engine/src/interfaces/index.ts +28 -0
  277. package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
  278. package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
  279. package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
  280. package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
  281. package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
  282. package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
  283. package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
  284. package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
  285. package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
  286. package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
  287. package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
  288. package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
  289. package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
  290. package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
  291. package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
  292. package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
  293. package/src/engine/src/theme/glass-ui-theme.ts +100 -0
  294. package/src/engine/src/theme/index.ts +2 -0
  295. package/src/engine/src/utils/button-press.utils.ts +63 -0
  296. package/src/engine/src/utils/index.ts +3 -0
  297. package/src/engine/src/utils/metal.utils.ts +164 -0
  298. package/src/glass-provider.tsx +60 -0
  299. package/src/glass-stack.tsx +115 -0
  300. package/src/index.ts +47 -190
  301. package/src/internal/GlassBackdrop.tsx +60 -0
  302. package/src/internal/GlassView.tsx +53 -18
  303. package/src/internal/blur-community.ts +19 -0
  304. package/src/internal/blur-community.web.ts +7 -0
  305. package/src/internal/blur.ts +7 -8
  306. package/src/internal/glass-routing.ts +211 -34
  307. package/src/internal/initials.ts +7 -0
  308. package/src/internal/overlay.tsx +258 -0
  309. package/src/internal/primitives.ts +23 -0
  310. package/lib/module/Carousel.js +0 -103
  311. package/lib/module/Display.js +0 -318
  312. package/lib/module/Feedback.js +0 -395
  313. package/lib/module/Form.js +0 -160
  314. package/lib/module/Forms2.js +0 -471
  315. package/lib/module/Message.js +0 -84
  316. package/lib/module/Overlays.js +0 -344
  317. package/lib/module/Pickers.js +0 -243
  318. package/lib/module/Table.js +0 -100
  319. package/lib/module/ai.js +0 -283
  320. package/lib/module/charts/AreaChart.js +0 -32
  321. package/lib/module/charts/BarChart.js +0 -75
  322. package/lib/module/charts/FunnelChart.js +0 -50
  323. package/lib/module/charts/HeatmapChart.js +0 -71
  324. package/lib/module/charts/LineChart.js +0 -81
  325. package/lib/module/charts/PlotChart.js +0 -52
  326. package/lib/module/charts/RadarChart.js +0 -78
  327. package/lib/module/charts/RingChart.js +0 -52
  328. package/lib/module/charts/ScatterChart.js +0 -95
  329. package/lib/module/charts/WaterfallChart.js +0 -85
  330. package/lib/module/charts/advanced.js +0 -313
  331. package/lib/module/charts/extra.js +0 -108
  332. package/lib/module/charts/index.js +0 -50
  333. package/lib/module/charts/scales.js +0 -140
  334. package/lib/typescript/Carousel.d.ts +0 -47
  335. package/lib/typescript/Display.d.ts +0 -178
  336. package/lib/typescript/Feedback.d.ts +0 -196
  337. package/lib/typescript/Form.d.ts +0 -97
  338. package/lib/typescript/Forms2.d.ts +0 -209
  339. package/lib/typescript/Message.d.ts +0 -67
  340. package/lib/typescript/Overlays.d.ts +0 -146
  341. package/lib/typescript/Pickers.d.ts +0 -105
  342. package/lib/typescript/Table.d.ts +0 -64
  343. package/lib/typescript/ai.d.ts +0 -166
  344. package/lib/typescript/charts/AreaChart.d.ts +0 -44
  345. package/lib/typescript/charts/BarChart.d.ts +0 -19
  346. package/lib/typescript/charts/FunnelChart.d.ts +0 -25
  347. package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
  348. package/lib/typescript/charts/LineChart.d.ts +0 -30
  349. package/lib/typescript/charts/PlotChart.d.ts +0 -31
  350. package/lib/typescript/charts/RadarChart.d.ts +0 -27
  351. package/lib/typescript/charts/RingChart.d.ts +0 -28
  352. package/lib/typescript/charts/ScatterChart.d.ts +0 -34
  353. package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
  354. package/lib/typescript/charts/advanced.d.ts +0 -107
  355. package/lib/typescript/charts/extra.d.ts +0 -63
  356. package/lib/typescript/charts/index.d.ts +0 -13
  357. package/lib/typescript/charts/scales.d.ts +0 -35
  358. package/src/Carousel.tsx +0 -233
  359. package/src/Display.tsx +0 -781
  360. package/src/Feedback.tsx +0 -992
  361. package/src/Form.tsx +0 -445
  362. package/src/Forms2.tsx +0 -1055
  363. package/src/Message.tsx +0 -218
  364. package/src/Overlays.tsx +0 -704
  365. package/src/Pickers.tsx +0 -595
  366. package/src/Table.tsx +0 -232
  367. package/src/ai.tsx +0 -715
  368. package/src/charts/AreaChart.tsx +0 -73
  369. package/src/charts/BarChart.tsx +0 -221
  370. package/src/charts/FunnelChart.tsx +0 -125
  371. package/src/charts/HeatmapChart.tsx +0 -155
  372. package/src/charts/LineChart.tsx +0 -247
  373. package/src/charts/PlotChart.tsx +0 -168
  374. package/src/charts/RadarChart.tsx +0 -208
  375. package/src/charts/RingChart.tsx +0 -133
  376. package/src/charts/ScatterChart.tsx +0 -223
  377. package/src/charts/WaterfallChart.tsx +0 -201
  378. package/src/charts/advanced.tsx +0 -676
  379. package/src/charts/extra.tsx +0 -242
  380. package/src/charts/index.ts +0 -86
  381. package/src/charts/scales.ts +0 -163
@@ -4,6 +4,8 @@ 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");
@@ -11,7 +13,7 @@ const motion_1 = require("./internal/motion");
11
13
  const haptics_1 = require("./internal/haptics");
12
14
  // The web slider: a 6pt track and a glass-lens thumb rather than a small dot.
13
15
  const TRACK_HEIGHT = 6;
14
- const THUMB_WIDTH = 36;
16
+ const THUMB_WIDTH = 40;
15
17
  const THUMB_HEIGHT = 24;
16
18
  const CONTAINER_HEIGHT = 40;
17
19
  /** Rounds `value` onto the nearest step from `min`, clamped to the range. */
@@ -22,23 +24,25 @@ function quantize(value, min, max, step) {
22
24
  if (!(step > 0))
23
25
  return clamped;
24
26
  const stepped = min + Math.round((clamped - min) / step) * step;
25
- // Round away binary float noise introduced by the division above.
26
27
  const decimals = (String(step).split(".")[1] ?? "").length;
27
28
  return Number(Math.min(max, Math.max(min, stepped)).toFixed(decimals));
28
29
  }
29
30
  /**
30
- * 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.
31
34
  *
32
- * The interaction is Glacia's own: the track and thumb are Views and dragging
33
- * is a PanResponder reading the touch position against the track's measured
34
- * width. React Native has no DOM `<input type="range">` and the platform
35
- * sliders are not used, so the control looks and behaves the same on every
36
- * 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.
37
39
  */
38
- 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) {
39
41
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
40
42
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
41
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");
42
46
  const [internalValue, setInternalValue] = (0, react_1.useState)(() => quantize(defaultValue, min, max, step));
43
47
  const value = valueProp !== undefined ? quantize(valueProp, min, max, step) : internalValue;
44
48
  // Two actions can arrive before React re-renders (increment then decrement,
@@ -46,8 +50,6 @@ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, def
46
50
  // second one starts from it instead of a stale closure.
47
51
  const valueRef = (0, react_1.useRef)(value);
48
52
  valueRef.current = value;
49
- // Track width as measured on layout. A drag before layout is a no-op rather
50
- // than a jump: without a width there is no honest mapping from x to value.
51
53
  const widthRef = (0, react_1.useRef)(0);
52
54
  /** Converts an x position relative to the track into a stepped value. */
53
55
  const valueAtX = (0, react_1.useMemo)(() => (x) => {
@@ -87,10 +89,15 @@ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, def
87
89
  if (next !== null)
88
90
  report(next);
89
91
  },
92
+ onPanResponderRelease: (event) => {
93
+ const next = valueAtX(event.nativeEvent.locationX);
94
+ if (next !== null) {
95
+ report(next);
96
+ onSlidingComplete?.(next);
97
+ }
98
+ },
90
99
  onPanResponderTerminationRequest: () => false,
91
100
  });
92
- // `report` reads the value from a ref, so the responder does not need to be
93
- // rebuilt on every value change and never acts on a stale render.
94
101
  }, [disabled, valueAtX]);
95
102
  /** Steps the value for accessibility actions and hardware keys. */
96
103
  const nudge = (direction) => {
@@ -129,31 +136,35 @@ exports.Slider = (0, react_1.forwardRef)(function Slider({ value: valueProp, def
129
136
  backgroundColor: themeColors.onTint,
130
137
  borderWidth: 0.5,
131
138
  borderColor: themeColors.edge,
132
- // The same lens shadow stack the Switch thumb carries: the web thumb is a
133
- // lens with real depth, not a white dot painted on the track.
134
139
  shadowColor: tokens_1.material.shadowColor,
135
140
  shadowOpacity: 0.2,
136
141
  shadowRadius: 8,
137
142
  shadowOffset: { width: 0, height: 3 },
138
143
  elevation: 3,
139
144
  };
140
- 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) => {
141
- if (event?.nativeEvent?.actionName === "increment")
142
- nudge(1);
143
- if (event?.nativeEvent?.actionName === "decrement")
144
- nudge(-1);
145
- }, disabled: disabled, onLayout: (event) => {
146
- const width = event?.nativeEvent?.layout?.width;
147
- if (typeof width === "number" && width > 0)
148
- widthRef.current = width;
149
- },
150
- // The DOM preview has no layout events, so measure on mount there too;
151
- // on a device this resolves to nothing and onLayout is the source.
152
- ref: (node) => {
153
- (0, primitives_1.measurePreviewWidth)(node, widthRef);
154
- if (typeof ref === "function")
155
- ref(node);
156
- else if (ref)
157
- ref.current = node;
158
- }, 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 }));
159
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,73 +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
- // The web switch's geometry: a 60 x 25 track with a 21pt thumb, which the web
12
- // draws at 160 x 67 and scales down by 0.375. The thumb is a lens, not a dot:
13
- // it carries the same shadow stack as the slider's.
14
- const TRACK_WIDTH = 60;
15
- const TRACK_HEIGHT = 25;
16
- const THUMB = 21;
17
- const TRAVEL = TRACK_WIDTH - THUMB - 4;
11
+ const motion_1 = require("./internal/motion");
18
12
  /**
19
- * 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).
20
15
  *
21
- * The track is Glacia's glass; the thumb is one of our own Views, animated on
22
- * the springs token. The material changes by platform (Apple's glass on
23
- * iOS 26+, Glacia's tint elsewhere) but the control is always ours — React
24
- * 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.
25
20
  */
26
- 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) {
27
22
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
28
23
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
29
- const { View, Pressable, Animated } = (0, primitives_1.primitives)();
30
- const [internalChecked, setInternalChecked] = (0, react_1.useState)(defaultChecked);
31
- const [held, setHeld] = (0, react_1.useState)(false);
32
- const isChecked = checkedProp !== undefined ? checkedProp : internalChecked;
33
- // The thumb's travel is a single number animated on the springs token.
34
- 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;
35
29
  const toggle = () => {
36
30
  if (disabled)
37
31
  return;
38
- const next = !isChecked;
32
+ const next = !value;
39
33
  if (haptics)
40
34
  (0, haptics_1.hapticSelection)();
41
- if (checkedProp === undefined)
42
- setInternalChecked(next);
43
- onCheckedChange?.(next);
44
- };
45
- const trackStyle = {
46
- width: TRACK_WIDTH,
47
- height: TRACK_HEIGHT,
48
- borderRadius: TRACK_HEIGHT / 2,
49
- backgroundColor: isChecked ? themeColors.fill : "rgba(120, 120, 128, 0.16)",
50
- padding: 2,
51
- justifyContent: "center",
52
- opacity: disabled ? 0.38 : 1,
53
- ...style,
54
- };
55
- const thumbStyle = {
56
- width: THUMB,
57
- height: THUMB,
58
- borderRadius: THUMB / 2,
59
- backgroundColor: themeColors.onTint,
60
- borderWidth: 0.5,
61
- borderColor: themeColors.edge,
62
- // The lens's lift: a soft shadow under the thumb, and a slight growth
63
- // while it is held, matching the web thumb.
64
- shadowColor: tokens_1.material.shadowColor,
65
- shadowOpacity: 0.2,
66
- shadowRadius: 8,
67
- shadowOffset: { width: 0, height: 3 },
68
- elevation: 3,
69
- transform: [
70
- { translateX: animated ? offset : isChecked ? TRAVEL : 0 },
71
- { scale: held ? 1.06 : 1 },
72
- ],
35
+ if (valueProp === undefined)
36
+ setInternalValue(next);
37
+ onValueChange?.(next);
73
38
  };
74
- return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "switch", accessibilityLabel: accessibilityLabel, accessibilityState: { checked: isChecked, disabled }, disabled: disabled, onPress: toggle, onPressIn: () => setHeld(true), onPressOut: () => setHeld(false), style: { alignSelf: "flex-start" }, ...props, children: (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", surface: "control", 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
+ } }) }) }));
75
65
  });
@@ -3,6 +3,8 @@ 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");
@@ -16,24 +18,28 @@ const BAR_HEIGHT = 40;
16
18
  * The bottom bar of an app: a row of tabs on one glass surface.
17
19
  *
18
20
  * The platform rule is the point of this component. On iOS 26+ the surface is
19
- * Apple's real Liquid Glass (`UIGlassEffect` via `@callstack/liquid-glass`)
20
- * with Glacia's own items inside it; on older iOS and on Android it is
21
- * Glacia's bar. The items are always our Pressables and Texts — no native tab
22
- * 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.
23
31
  */
24
- 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) {
25
33
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
26
34
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
27
- 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");
28
38
  const [internalId, setInternalId] = (0, react_1.useState)(defaultActiveId || items[0]?.id || "");
29
39
  const [held, setHeld] = (0, react_1.useState)(false);
30
- const activeId = activeProp !== undefined ? activeProp : internalId;
31
- const activeIndex = Math.max(0, items.findIndex((item) => item.id === activeId));
32
- // The active wash slides between equally wide items on the springs token.
33
- const { value: slide, animated } = (0, motion_1.useSpring)(activeIndex, "snappy");
40
+ const activeId = activeProp ?? internalId;
34
41
  const handleSelect = (id) => {
35
- // Selecting the tab already active is not a change, so it does not tick.
36
- if (haptics && id !== activeId)
42
+ if (haptics)
37
43
  (0, haptics_1.hapticSelection)();
38
44
  if (activeProp === undefined)
39
45
  setInternalId(id);
@@ -43,13 +49,17 @@ exports.TabBar = (0, react_1.forwardRef)(function TabBar({ items, activeId: acti
43
49
  flexDirection: "row",
44
50
  alignItems: "center",
45
51
  justifyContent: "space-around",
46
- height: BAR_HEIGHT,
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),
47
56
  paddingHorizontal: 4,
48
57
  borderRadius: tokens_1.radii.lg,
49
58
  ...style,
50
59
  };
51
60
  const count = Math.max(items.length, 1);
52
61
  const itemWidth = `${100 / count}%`;
62
+ const activeIndex = Math.max(0, items.findIndex((tab) => tab.id === activeId));
53
63
  const indicatorStyle = {
54
64
  position: "absolute",
55
65
  top: 4,
@@ -59,37 +69,33 @@ exports.TabBar = (0, react_1.forwardRef)(function TabBar({ items, activeId: acti
59
69
  borderRadius: tokens_1.radii.pill,
60
70
  backgroundColor: themeColors.glassActive,
61
71
  opacity: 0.75,
62
- // A lens, not a wash: it lifts off the rail and carries the rim.
63
72
  ...(0, lens_1.lensShadow)(isDark),
64
73
  };
65
- 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: {
66
- ...indicatorStyle,
67
- transform: [
68
- {
69
- translateX: slide.interpolate({
70
- inputRange: [0, Math.max(count - 1, 1)],
71
- outputRange: [
72
- "0%",
73
- `${((count - 1) * 100) / count}%`,
74
- ],
75
- }),
76
- },
77
- ],
78
- }, 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) => {
79
- const isActive = tab.id === activeId;
80
- 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: {
81
- flex: 1,
82
- height: "100%",
83
- flexDirection: "column",
84
- alignItems: "center",
85
- justifyContent: "center",
86
- gap: 2,
87
- paddingHorizontal: 8,
88
- paddingVertical: 4,
89
- }, children: [tab.icon ?? null, (0, jsx_runtime_1.jsx)(Text, { numberOfLines: 1, style: {
90
- fontSize: 13,
91
- fontWeight: isActive ? "500" : "400",
92
- color: isActive ? themeColors.fill : themeColors.muted,
93
- }, children: tab.label })] }, tab.id));
94
- })] }));
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 } }));
95
101
  });
@@ -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
+ });
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Toast = 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
+ /**
13
+ * A transient message on a glass pill — ported from the engine's
14
+ * `LiquidGlassToast`, the design Binyam approved on real devices this week (44dp
15
+ * capsule, 60dp from the screen edge, auto-dismiss after 2.6s).
16
+ *
17
+ * With a glass renderer available the engine's own control mounts, carrying the
18
+ * approved material and motion. Without one — Expo Go, below every tier, or
19
+ * Reduce Transparency — the fallback floor renders the same pill with the
20
+ * fallback material, so the toast is never invisible.
21
+ */
22
+ exports.Toast = (0, react_1.forwardRef)(function Toast({ visible, message, icon, onDismiss, duration = 2600, edge = "top", offset = 60, tint, variant = "regular", style, textStyle, isDark: isDarkProp, testID, ...props }, ref) {
23
+ const isDark = (0, motion_1.useIsDark)(isDarkProp);
24
+ const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
25
+ const { View, Text: RNText, Pressable } = (0, primitives_1.primitives)();
26
+ const capabilities = (0, GlassView_1.glassCapabilities)();
27
+ const EngineToast = (0, glass_routing_1.loadEngineControl)("Toast");
28
+ // Auto-dismiss: the toast never hides itself, the timer only fires its
29
+ // `onDismiss` so the app owns the visible state.
30
+ (0, react_1.useEffect)(() => {
31
+ if (!visible)
32
+ return;
33
+ if (!onDismiss || duration <= 0)
34
+ return;
35
+ const id = setTimeout(() => onDismiss(), duration);
36
+ return () => clearTimeout(id);
37
+ }, [visible, duration, onDismiss]);
38
+ if (!visible)
39
+ return null;
40
+ if (EngineToast && capabilities.supported) {
41
+ const EngineToastComponent = EngineToast;
42
+ return ((0, jsx_runtime_1.jsx)(EngineToastComponent, { visible: visible, message: message, icon: icon, onDismiss: onDismiss, duration: duration, edge: edge, offset: offset, tint: tint, variant: variant, style: style, textStyle: textStyle }));
43
+ }
44
+ // Fallback floor: solid pill, same geometry, dismissible by tap.
45
+ const pillStyle = {
46
+ height: 44,
47
+ borderRadius: 22,
48
+ paddingHorizontal: 20,
49
+ justifyContent: "center",
50
+ alignItems: "center",
51
+ ...(edge === "bottom" ? { bottom: offset } : { top: offset }),
52
+ ...style,
53
+ };
54
+ return ((0, jsx_runtime_1.jsx)(View, { pointerEvents: "box-none", style: [pillStyle], testID: testID, ...props, children: (0, jsx_runtime_1.jsx)(Pressable, { testID: testID ? `${testID}-pill` : undefined, accessibilityRole: "button", accessibilityLabel: `Dismiss toast: ${message}`, onPress: onDismiss, style: pillStyle, children: (0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: variant, surface: "control", tintColor: tint, isDark: isDark, style: pillStyle, children: [icon, (0, jsx_runtime_1.jsx)(RNText, { style: [textStyle, { fontSize: 14, fontWeight: "500" }], children: message })] }) }) }));
55
+ });