glacia-native 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/LICENSE +29 -4
  2. package/README.md +111 -17
  3. package/lib/module/Accordion.js +58 -0
  4. package/lib/module/ActionSheet.js +38 -0
  5. package/lib/module/Alert.js +23 -0
  6. package/lib/module/AlertDialog.js +47 -0
  7. package/lib/module/Avatar.js +48 -0
  8. package/lib/module/Badge.js +36 -0
  9. package/lib/module/Bars.js +13 -267
  10. package/lib/module/Button.js +57 -36
  11. package/lib/module/Card.js +32 -20
  12. package/lib/module/Checkbox.js +42 -0
  13. package/lib/module/Chip.js +80 -0
  14. package/lib/module/Collapsible.js +26 -0
  15. package/lib/module/ContextMenu.js +33 -0
  16. package/lib/module/Dialog.js +39 -124
  17. package/lib/module/DropdownMenu.js +33 -0
  18. package/lib/module/Field.js +22 -0
  19. package/lib/module/Glass.js +12 -5
  20. package/lib/module/Group.js +36 -0
  21. package/lib/module/IconButton.js +40 -0
  22. package/lib/module/Input.js +47 -40
  23. package/lib/module/Label.js +17 -0
  24. package/lib/module/MorphGroup.js +47 -0
  25. package/lib/module/Popover.js +29 -0
  26. package/lib/module/Progress.js +32 -0
  27. package/lib/module/RadioGroup.js +51 -0
  28. package/lib/module/Scrim.js +44 -0
  29. package/lib/module/SegmentedControl.js +74 -58
  30. package/lib/module/Select.js +51 -0
  31. package/lib/module/Separator.js +25 -0
  32. package/lib/module/Sheet.js +51 -0
  33. package/lib/module/Skeleton.js +48 -0
  34. package/lib/module/Slider.js +60 -40
  35. package/lib/module/Stepper.js +167 -0
  36. package/lib/module/Switch.js +45 -43
  37. package/lib/module/TabBar.js +62 -50
  38. package/lib/module/Tabs.js +3 -2
  39. package/lib/module/Textarea.js +18 -0
  40. package/lib/module/Toast.js +55 -0
  41. package/lib/module/Toggle.js +47 -0
  42. package/lib/module/ToggleGroup.js +56 -0
  43. package/lib/module/Toolbar.js +37 -0
  44. package/lib/module/Tooltip.js +31 -0
  45. package/lib/module/glass-provider.js +28 -0
  46. package/lib/module/glass-stack.js +61 -0
  47. package/lib/module/index.js +78 -109
  48. package/lib/module/internal/GlassBackdrop.js +36 -0
  49. package/lib/module/internal/GlassView.js +45 -13
  50. package/lib/module/internal/blur-community.js +20 -0
  51. package/lib/module/internal/blur-community.web.js +9 -0
  52. package/lib/module/internal/blur.js +75 -0
  53. package/lib/module/internal/fallback.js +110 -20
  54. package/lib/module/internal/glass-routing.js +154 -30
  55. package/lib/module/internal/glow.js +36 -0
  56. package/lib/module/internal/initials.js +12 -0
  57. package/lib/module/internal/lens.js +70 -0
  58. package/lib/module/internal/material.js +64 -0
  59. package/lib/module/internal/overlay.js +147 -0
  60. package/lib/module/internal/primitives.js +17 -0
  61. package/lib/module/internal/rim.js +35 -0
  62. package/lib/module/internal/tokens.js +34 -2
  63. package/lib/typescript/Accordion.d.ts +22 -0
  64. package/lib/typescript/ActionSheet.d.ts +24 -0
  65. package/lib/typescript/Alert.d.ts +15 -0
  66. package/lib/typescript/AlertDialog.d.ts +17 -0
  67. package/lib/typescript/Avatar.d.ts +22 -0
  68. package/lib/typescript/Badge.d.ts +12 -0
  69. package/lib/typescript/Bars.d.ts +3 -188
  70. package/lib/typescript/Button.d.ts +44 -10
  71. package/lib/typescript/Card.d.ts +30 -3
  72. package/lib/typescript/Checkbox.d.ts +14 -0
  73. package/lib/typescript/Chip.d.ts +19 -0
  74. package/lib/typescript/Collapsible.d.ts +17 -0
  75. package/lib/typescript/ContextMenu.d.ts +23 -0
  76. package/lib/typescript/Dialog.d.ts +8 -68
  77. package/lib/typescript/DropdownMenu.d.ts +23 -0
  78. package/lib/typescript/Field.d.ts +19 -0
  79. package/lib/typescript/Glass.d.ts +11 -2
  80. package/lib/typescript/Group.d.ts +35 -0
  81. package/lib/typescript/IconButton.d.ts +21 -0
  82. package/lib/typescript/Input.d.ts +17 -18
  83. package/lib/typescript/Label.d.ts +14 -0
  84. package/lib/typescript/MorphGroup.d.ts +46 -0
  85. package/lib/typescript/Popover.d.ts +17 -0
  86. package/lib/typescript/Progress.d.ts +13 -0
  87. package/lib/typescript/RadioGroup.d.ts +21 -0
  88. package/lib/typescript/Scrim.d.ts +33 -0
  89. package/lib/typescript/SegmentedControl.d.ts +24 -13
  90. package/lib/typescript/Select.d.ts +19 -0
  91. package/lib/typescript/Separator.d.ts +10 -0
  92. package/lib/typescript/Sheet.d.ts +45 -0
  93. package/lib/typescript/Skeleton.d.ts +10 -0
  94. package/lib/typescript/Slider.d.ts +15 -7
  95. package/lib/typescript/Stepper.d.ts +49 -0
  96. package/lib/typescript/Switch.d.ts +19 -12
  97. package/lib/typescript/TabBar.d.ts +18 -6
  98. package/lib/typescript/Textarea.d.ts +6 -0
  99. package/lib/typescript/Toast.d.ts +40 -0
  100. package/lib/typescript/Toggle.d.ts +21 -0
  101. package/lib/typescript/ToggleGroup.d.ts +22 -0
  102. package/lib/typescript/Toolbar.d.ts +35 -0
  103. package/lib/typescript/Tooltip.d.ts +16 -0
  104. package/lib/typescript/glass-provider.d.ts +34 -0
  105. package/lib/typescript/glass-stack.d.ts +54 -0
  106. package/lib/typescript/index.d.ts +39 -17
  107. package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
  108. package/lib/typescript/internal/GlassView.d.ts +31 -2
  109. package/lib/typescript/internal/blur-community.d.ts +2 -0
  110. package/lib/typescript/internal/blur-community.web.d.ts +2 -0
  111. package/lib/typescript/internal/blur.d.ts +24 -0
  112. package/lib/typescript/internal/fallback.d.ts +27 -2
  113. package/lib/typescript/internal/glass-routing.d.ts +83 -15
  114. package/lib/typescript/internal/glow.d.ts +11 -0
  115. package/lib/typescript/internal/initials.d.ts +2 -0
  116. package/lib/typescript/internal/lens.d.ts +47 -0
  117. package/lib/typescript/internal/material.d.ts +27 -0
  118. package/lib/typescript/internal/overlay.d.ts +74 -0
  119. package/lib/typescript/internal/primitives.d.ts +13 -0
  120. package/lib/typescript/internal/rim.d.ts +16 -0
  121. package/lib/typescript/internal/tokens.d.ts +36 -0
  122. package/package.json +15 -4
  123. package/src/Accordion.tsx +165 -0
  124. package/src/ActionSheet.tsx +149 -0
  125. package/src/Alert.tsx +85 -0
  126. package/src/AlertDialog.tsx +124 -0
  127. package/src/Avatar.tsx +102 -0
  128. package/src/Badge.tsx +80 -0
  129. package/src/Bars.tsx +10 -797
  130. package/src/Button.tsx +196 -60
  131. package/src/Card.tsx +106 -33
  132. package/src/Checkbox.tsx +98 -0
  133. package/src/Chip.tsx +149 -0
  134. package/src/Collapsible.tsx +66 -0
  135. package/src/ContextMenu.tsx +103 -0
  136. package/src/Dialog.tsx +86 -325
  137. package/src/DropdownMenu.tsx +103 -0
  138. package/src/Field.tsx +65 -0
  139. package/src/Glass.tsx +19 -5
  140. package/src/Group.tsx +98 -0
  141. package/src/IconButton.tsx +110 -0
  142. package/src/Input.tsx +143 -87
  143. package/src/Label.tsx +56 -0
  144. package/src/MorphGroup.tsx +134 -0
  145. package/src/Popover.tsx +81 -0
  146. package/src/Progress.tsx +83 -0
  147. package/src/RadioGroup.tsx +122 -0
  148. package/src/Scrim.tsx +94 -0
  149. package/src/SegmentedControl.tsx +147 -90
  150. package/src/Select.tsx +136 -0
  151. package/src/Separator.tsx +52 -0
  152. package/src/Sheet.tsx +139 -0
  153. package/src/Skeleton.tsx +77 -0
  154. package/src/Slider.tsx +100 -54
  155. package/src/Stepper.tsx +315 -0
  156. package/src/Switch.tsx +80 -58
  157. package/src/TabBar.tsx +118 -84
  158. package/src/Tabs.tsx +5 -0
  159. package/src/Textarea.tsx +34 -0
  160. package/src/Toast.tsx +131 -0
  161. package/src/Toggle.tsx +113 -0
  162. package/src/ToggleGroup.tsx +129 -0
  163. package/src/Toolbar.tsx +111 -0
  164. package/src/Tooltip.tsx +79 -0
  165. package/src/engine/CHANGELOG.md +430 -0
  166. package/src/engine/NOTICE +54 -0
  167. package/src/engine/README.md +975 -0
  168. package/src/engine/android/build.gradle +18 -0
  169. package/src/engine/android/src/main/AndroidManifest.xml +2 -0
  170. package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
  171. package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
  172. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
  173. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
  174. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
  175. package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
  176. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
  177. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
  178. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
  179. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
  180. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
  181. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
  182. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
  183. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
  184. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
  185. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
  186. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
  187. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
  188. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
  189. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
  190. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
  191. package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
  192. package/src/engine/index.ts +24 -0
  193. package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
  194. package/src/engine/ios/Enums/GlassVariant.swift +86 -0
  195. package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
  196. package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
  197. package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
  198. package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
  199. package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
  200. package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
  201. package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
  202. package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
  203. package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
  204. package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
  205. package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
  206. package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
  207. package/src/engine/ios/Glass/StripCache.swift +545 -0
  208. package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
  209. package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
  210. package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
  211. package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
  212. package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
  213. package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
  214. package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
  215. package/src/engine/package.json +70 -0
  216. package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
  217. package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
  218. package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
  219. package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
  220. package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
  221. package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
  222. package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
  223. package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
  224. package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
  225. package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
  226. package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
  227. package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
  228. package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
  229. package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
  230. package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
  231. package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
  232. package/src/engine/src/components/index.ts +16 -0
  233. package/src/engine/src/constants/index.ts +4 -0
  234. package/src/engine/src/constants/metal.constants.ts +327 -0
  235. package/src/engine/src/constants/metrics.constants.ts +325 -0
  236. package/src/engine/src/constants/springs.constants.ts +107 -0
  237. package/src/engine/src/constants/styles.constants.ts +12 -0
  238. package/src/engine/src/context/glass-group.context.ts +65 -0
  239. package/src/engine/src/context/index.ts +6 -0
  240. package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
  241. package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
  242. package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
  243. package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
  244. package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
  245. package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
  246. package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
  247. package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
  248. package/src/engine/src/core/components/index.ts +4 -0
  249. package/src/engine/src/core/constants/glass.constants.ts +57 -0
  250. package/src/engine/src/core/constants/index.ts +20 -0
  251. package/src/engine/src/core/constants/native.constants.ts +16 -0
  252. package/src/engine/src/core/context/glass-stack.context.ts +30 -0
  253. package/src/engine/src/core/context/index.ts +4 -0
  254. package/src/engine/src/core/enum/index.ts +12 -0
  255. package/src/engine/src/core/index.ts +1 -0
  256. package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
  257. package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
  258. package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
  259. package/src/engine/src/core/interfaces/index.ts +31 -0
  260. package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
  261. package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
  262. package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
  263. package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
  264. package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
  265. package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
  266. package/src/engine/src/core/modules/index.ts +2 -0
  267. package/src/engine/src/core/root/index.ts +51 -0
  268. package/src/engine/src/core/types/glass.types.ts +25 -0
  269. package/src/engine/src/core/types/index.ts +8 -0
  270. package/src/engine/src/core/utils/debug.utils.ts +17 -0
  271. package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
  272. package/src/engine/src/core/utils/hdr.utils.ts +37 -0
  273. package/src/engine/src/core/utils/index.ts +5 -0
  274. package/src/engine/src/core/utils/native-view.utils.ts +33 -0
  275. package/src/engine/src/core/utils/platform.utils.ts +34 -0
  276. package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
  277. package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
  278. package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
  279. package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
  280. package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
  281. package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
  282. package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
  283. package/src/engine/src/core/views/index.ts +4 -0
  284. package/src/engine/src/hooks/index.ts +18 -0
  285. package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
  286. package/src/engine/src/hooks/use-damped-drag.ts +332 -0
  287. package/src/engine/src/hooks/use-echo-filter.ts +55 -0
  288. package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
  289. package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
  290. package/src/engine/src/hooks/use-press-progress.ts +44 -0
  291. package/src/engine/src/index.ts +120 -0
  292. package/src/engine/src/interfaces/index.ts +28 -0
  293. package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
  294. package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
  295. package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
  296. package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
  297. package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
  298. package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
  299. package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
  300. package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
  301. package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
  302. package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
  303. package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
  304. package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
  305. package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
  306. package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
  307. package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
  308. package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
  309. package/src/engine/src/theme/glass-ui-theme.ts +100 -0
  310. package/src/engine/src/theme/index.ts +2 -0
  311. package/src/engine/src/utils/button-press.utils.ts +63 -0
  312. package/src/engine/src/utils/index.ts +3 -0
  313. package/src/engine/src/utils/metal.utils.ts +164 -0
  314. package/src/glass-provider.tsx +60 -0
  315. package/src/glass-stack.tsx +115 -0
  316. package/src/index.ts +48 -190
  317. package/src/internal/GlassBackdrop.tsx +60 -0
  318. package/src/internal/GlassView.tsx +70 -18
  319. package/src/internal/blur-community.ts +19 -0
  320. package/src/internal/blur-community.web.ts +7 -0
  321. package/src/internal/blur.ts +89 -0
  322. package/src/internal/fallback.tsx +158 -20
  323. package/src/internal/glass-routing.ts +211 -34
  324. package/src/internal/glow.tsx +62 -0
  325. package/src/internal/initials.ts +7 -0
  326. package/src/internal/lens.tsx +105 -0
  327. package/src/internal/material.ts +92 -0
  328. package/src/internal/overlay.tsx +258 -0
  329. package/src/internal/primitives.ts +26 -0
  330. package/src/internal/rim.tsx +79 -0
  331. package/src/internal/tokens.ts +34 -1
  332. package/lib/module/Carousel.js +0 -103
  333. package/lib/module/Display.js +0 -317
  334. package/lib/module/Feedback.js +0 -386
  335. package/lib/module/Form.js +0 -164
  336. package/lib/module/Forms2.js +0 -454
  337. package/lib/module/Message.js +0 -88
  338. package/lib/module/Overlays.js +0 -328
  339. package/lib/module/Pickers.js +0 -243
  340. package/lib/module/Table.js +0 -99
  341. package/lib/module/ai.js +0 -280
  342. package/lib/module/charts/AreaChart.js +0 -32
  343. package/lib/module/charts/BarChart.js +0 -67
  344. package/lib/module/charts/FunnelChart.js +0 -50
  345. package/lib/module/charts/HeatmapChart.js +0 -71
  346. package/lib/module/charts/LineChart.js +0 -81
  347. package/lib/module/charts/PlotChart.js +0 -52
  348. package/lib/module/charts/RadarChart.js +0 -78
  349. package/lib/module/charts/RingChart.js +0 -52
  350. package/lib/module/charts/ScatterChart.js +0 -95
  351. package/lib/module/charts/WaterfallChart.js +0 -85
  352. package/lib/module/charts/advanced.js +0 -313
  353. package/lib/module/charts/extra.js +0 -108
  354. package/lib/module/charts/index.js +0 -50
  355. package/lib/module/charts/scales.js +0 -140
  356. package/lib/typescript/Carousel.d.ts +0 -47
  357. package/lib/typescript/Display.d.ts +0 -178
  358. package/lib/typescript/Feedback.d.ts +0 -196
  359. package/lib/typescript/Form.d.ts +0 -97
  360. package/lib/typescript/Forms2.d.ts +0 -209
  361. package/lib/typescript/Message.d.ts +0 -71
  362. package/lib/typescript/Overlays.d.ts +0 -146
  363. package/lib/typescript/Pickers.d.ts +0 -105
  364. package/lib/typescript/Table.d.ts +0 -64
  365. package/lib/typescript/ai.d.ts +0 -166
  366. package/lib/typescript/charts/AreaChart.d.ts +0 -44
  367. package/lib/typescript/charts/BarChart.d.ts +0 -19
  368. package/lib/typescript/charts/FunnelChart.d.ts +0 -25
  369. package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
  370. package/lib/typescript/charts/LineChart.d.ts +0 -30
  371. package/lib/typescript/charts/PlotChart.d.ts +0 -31
  372. package/lib/typescript/charts/RadarChart.d.ts +0 -27
  373. package/lib/typescript/charts/RingChart.d.ts +0 -28
  374. package/lib/typescript/charts/ScatterChart.d.ts +0 -34
  375. package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
  376. package/lib/typescript/charts/advanced.d.ts +0 -107
  377. package/lib/typescript/charts/extra.d.ts +0 -63
  378. package/lib/typescript/charts/index.d.ts +0 -13
  379. package/lib/typescript/charts/scales.d.ts +0 -35
  380. package/src/Carousel.tsx +0 -233
  381. package/src/Display.tsx +0 -778
  382. package/src/Feedback.tsx +0 -969
  383. package/src/Form.tsx +0 -425
  384. package/src/Forms2.tsx +0 -1014
  385. package/src/Message.tsx +0 -219
  386. package/src/Overlays.tsx +0 -685
  387. package/src/Pickers.tsx +0 -590
  388. package/src/Table.tsx +0 -231
  389. package/src/ai.tsx +0 -707
  390. package/src/charts/AreaChart.tsx +0 -73
  391. package/src/charts/BarChart.tsx +0 -183
  392. package/src/charts/FunnelChart.tsx +0 -125
  393. package/src/charts/HeatmapChart.tsx +0 -155
  394. package/src/charts/LineChart.tsx +0 -247
  395. package/src/charts/PlotChart.tsx +0 -168
  396. package/src/charts/RadarChart.tsx +0 -208
  397. package/src/charts/RingChart.tsx +0 -133
  398. package/src/charts/ScatterChart.tsx +0 -223
  399. package/src/charts/WaterfallChart.tsx +0 -201
  400. package/src/charts/advanced.tsx +0 -676
  401. package/src/charts/extra.tsx +0 -242
  402. package/src/charts/index.ts +0 -86
  403. package/src/charts/scales.ts +0 -163
@@ -0,0 +1,315 @@
1
+ import { forwardRef, useEffect, useRef, useState } from "react";
2
+ import type { StyleProp, TextStyle, ViewStyle } from "react-native";
3
+
4
+ import { loadEngineControl } from "./internal/glass-routing";
5
+ import { glassCapabilities } from "./internal/GlassView";
6
+ import { Glass } from "./Glass";
7
+ import { colors, radii, springs } from "./internal/tokens";
8
+ import { primitives } from "./internal/primitives";
9
+ import { useIsDark } from "./internal/motion";
10
+ import { useReducedMotion } from "./internal/a11y";
11
+ import { hapticSelection } from "./internal/haptics";
12
+
13
+ // The engine's stepper geometry, kept exactly: a 40dp capsule whose `−`/`+`
14
+ // ends are 44dp cells around a 44dp-minimum readout, with the thumb inset by
15
+ // the segmented control's 3dp.
16
+ const STEPPER_HEIGHT = 40;
17
+ const STEPPER_CELL_WIDTH = 44;
18
+ const STEPPER_VALUE_MIN_WIDTH = 44;
19
+ const STEPPER_INSET = 3;
20
+ const STEPPER_REPEAT_DELAY_MS = 400;
21
+ const STEPPER_REPEAT_INTERVAL_MS = 110;
22
+ const STEPPER_VALUE_POP_SCALE = 1.18;
23
+
24
+ export interface StepperProps {
25
+ /** Controlled value. Omit it and the stepper keeps its own. */
26
+ value?: number;
27
+ defaultValue?: number;
28
+ /** Fires with the next value whenever one of the ends steps it. */
29
+ onValueChange?: (value: number) => void;
30
+ /** Inclusive lower bound. Defaults to 0. `minimumValue` is the engine's spelling. */
31
+ min?: number;
32
+ /** Inclusive upper bound. Defaults to 100. `maximumValue` is the engine's spelling. */
33
+ max?: number;
34
+ minimumValue?: number;
35
+ maximumValue?: number;
36
+ /** Increment per press. Defaults to 1. */
37
+ step?: number;
38
+ /** Hold an end and it keeps stepping, the way the system's does. Defaults to true. */
39
+ autoRepeat?: boolean;
40
+ /** One selection tick each time the value changes. `false` opts out. */
41
+ haptics?: boolean;
42
+ disabled?: boolean;
43
+ /** Capsule height, dp. Defaults to the engine's 40. */
44
+ height?: number;
45
+ /** Formats the middle readout; defaults to the plain number. */
46
+ formatValue?: (value: number) => string;
47
+ /** Announced by screen readers, e.g. "Guests". */
48
+ accessibilityLabel: string;
49
+ /** The track's wash. Defaults to the scheme's glass tint. */
50
+ tint?: string;
51
+ /** The pressed thumb's wash. Defaults to the scheme's glass-active tint. */
52
+ thumbTint?: string;
53
+ /** Pairs the surface with its Android backdrop provider. */
54
+ providerId?: string;
55
+ isDark?: boolean;
56
+ style?: StyleProp<ViewStyle>;
57
+ textStyle?: StyleProp<TextStyle>;
58
+ testID?: string;
59
+ }
60
+
61
+ /**
62
+ * Minus / value / plus — ported from the engine's `LiquidGlassStepper`, the
63
+ * design Binyam approved on real devices this week (40dp capsule, 44dp cells,
64
+ * press thumb blooming over the held end, the value popping as it changes, and
65
+ * hold-to-repeat).
66
+ *
67
+ * With a glass renderer available the engine's own control mounts, carrying the
68
+ * approved geometry and behaviour. Without one — Expo Go, below every tier, or
69
+ * Reduce Transparency — the fallback floor renders the same capsule, cells and
70
+ * readout on Glacia's solid material, so the control is never invisible.
71
+ */
72
+ export const Stepper = forwardRef<any, StepperProps>(function Stepper(
73
+ {
74
+ value: valueProp,
75
+ defaultValue = 0,
76
+ onValueChange,
77
+ min,
78
+ max,
79
+ minimumValue,
80
+ maximumValue,
81
+ step = 1,
82
+ autoRepeat = true,
83
+ haptics = true,
84
+ disabled = false,
85
+ height = STEPPER_HEIGHT,
86
+ formatValue,
87
+ accessibilityLabel,
88
+ tint,
89
+ thumbTint,
90
+ providerId,
91
+ isDark: isDarkProp,
92
+ style,
93
+ textStyle,
94
+ testID,
95
+ ...props
96
+ },
97
+ ref,
98
+ ) {
99
+ const isDark = useIsDark(isDarkProp);
100
+ const theme = isDark ? colors.dark : colors.light;
101
+ const reducedMotion = useReducedMotion();
102
+ const { Animated, View, Pressable, Text: RNText, isNative } = primitives();
103
+ const capabilities = glassCapabilities();
104
+ const EngineStepper = loadEngineControl("Stepper");
105
+
106
+ const lower = min ?? minimumValue ?? 0;
107
+ const upper = max ?? maximumValue ?? 100;
108
+
109
+ const [internalValue, setInternalValue] = useState(() => clamp(defaultValue, lower, upper));
110
+ const value = clamp(valueProp !== undefined ? valueProp : internalValue, lower, upper);
111
+
112
+ // Two actions can arrive before a re-render (hold-to-repeat, or both ends in
113
+ // one frame). The ref holds the newest value so the next step starts from it.
114
+ const valueRef = useRef(value);
115
+ valueRef.current = value;
116
+
117
+ const [held, setHeld] = useState<-1 | 0 | 1>(0);
118
+ const repeatTimer = useRef<ReturnType<typeof setInterval> | null>(null);
119
+ useEffect(() => () => stopRepeat(), []);
120
+
121
+ // The readout pops on each change, like the engine's: an immediate lift then
122
+ // a spring home. Reduce Motion settles it straight at its resting scale.
123
+ const pop = useRef<any>(null);
124
+ const animate = Boolean(isNative && Animated?.Value && Animated?.spring) && !reducedMotion;
125
+ if (pop.current === null) {
126
+ pop.current = animate ? new Animated.Value(1) : { value: 1 };
127
+ }
128
+ const firstValue = useRef(true);
129
+ useEffect(() => {
130
+ if (firstValue.current) {
131
+ firstValue.current = false;
132
+ return;
133
+ }
134
+ if (!animate) return;
135
+ pop.current.setValue(STEPPER_VALUE_POP_SCALE);
136
+ const animation = Animated.spring(pop.current, {
137
+ toValue: 1,
138
+ ...springs.snappy,
139
+ useNativeDriver: false,
140
+ });
141
+ animation.start();
142
+ return () => animation.stop?.();
143
+ }, [animate, value]);
144
+
145
+ const atMin = value <= lower;
146
+ const atMax = value >= upper;
147
+
148
+ const apply = (next: number) => {
149
+ const clamped = clamp(next, lower, upper);
150
+ if (clamped === valueRef.current) return;
151
+ if (haptics) hapticSelection();
152
+ valueRef.current = clamped;
153
+ if (valueProp === undefined) setInternalValue(clamped);
154
+ onValueChange?.(clamped);
155
+ };
156
+
157
+ function stopRepeat() {
158
+ if (repeatTimer.current != null) {
159
+ clearInterval(repeatTimer.current);
160
+ repeatTimer.current = null;
161
+ }
162
+ }
163
+
164
+ const stepBy = (direction: -1 | 1) => apply(valueRef.current + direction * step);
165
+
166
+ const handlePressIn = (direction: -1 | 1) => {
167
+ setHeld(direction);
168
+ };
169
+ const handlePressOut = () => {
170
+ setHeld(0);
171
+ stopRepeat();
172
+ };
173
+ const handleLongPress = (direction: -1 | 1) => {
174
+ if (!autoRepeat) return;
175
+ stepBy(direction);
176
+ stopRepeat();
177
+ repeatTimer.current = setInterval(() => stepBy(direction), STEPPER_REPEAT_INTERVAL_MS);
178
+ };
179
+
180
+ const label = formatValue ? formatValue(value) : String(value);
181
+
182
+ const rootStyle: ViewStyle = {
183
+ height,
184
+ borderRadius: radii.pill,
185
+ alignSelf: "flex-start",
186
+ flexDirection: "row",
187
+ alignItems: "stretch",
188
+ opacity: disabled ? 0.5 : 1,
189
+ ...(style as ViewStyle),
190
+ };
191
+
192
+ const cellStyle: ViewStyle = {
193
+ width: STEPPER_CELL_WIDTH,
194
+ alignItems: "center",
195
+ justifyContent: "center",
196
+ };
197
+
198
+
199
+ // ------------------------------------------------------------------
200
+ // Fallback floor: the same capsule, cells and readout, on Glacia's
201
+ // solid-capable material.
202
+ // ------------------------------------------------------------------
203
+ if (!(EngineStepper && capabilities.supported)) {
204
+ const thumbWidth = STEPPER_CELL_WIDTH - STEPPER_INSET;
205
+ const thumb = held !== 0 ? (
206
+ <View
207
+ pointerEvents="none"
208
+ style={{
209
+ position: "absolute",
210
+ top: STEPPER_INSET,
211
+ left: held < 0 ? STEPPER_INSET : undefined,
212
+ right: held > 0 ? STEPPER_INSET : undefined,
213
+ width: thumbWidth,
214
+ height: height - 2 * STEPPER_INSET,
215
+ borderRadius: radii.pill,
216
+ backgroundColor: thumbTint ?? theme.glassActive,
217
+ }}
218
+ />
219
+ ) : null;
220
+
221
+ const cell = (label: string, sign: "\u2212" | "+", direction: -1 | 1, blocked: boolean) => (
222
+ <Pressable
223
+ accessibilityRole="button"
224
+ accessibilityLabel={label}
225
+ accessibilityState={{ disabled: disabled || blocked }}
226
+ disabled={disabled || blocked}
227
+ delayLongPress={STEPPER_REPEAT_DELAY_MS}
228
+ onPressIn={() => handlePressIn(direction)}
229
+ onPressOut={handlePressOut}
230
+ onPress={() => stepBy(direction)}
231
+ onLongPress={() => handleLongPress(direction)}
232
+ style={cellStyle}
233
+ >
234
+ <RNText
235
+ style={{
236
+ fontSize: 20,
237
+ fontWeight: "500",
238
+ color: theme.foreground,
239
+ opacity: disabled || blocked ? 0.35 : 1,
240
+ }}
241
+ >
242
+ {sign}
243
+ </RNText>
244
+ </Pressable>
245
+ );
246
+
247
+ return (
248
+ <Glass
249
+ ref={ref}
250
+ effect="regular"
251
+ surface="control"
252
+ tintColor={tint}
253
+ isDark={isDark}
254
+ testID={testID}
255
+ accessibilityRole="adjustable"
256
+ accessibilityLabel={accessibilityLabel}
257
+ accessibilityState={{ disabled }}
258
+ accessibilityValue={{ min: lower, max: upper, now: value, text: label }}
259
+ accessibilityActions={[{ name: "increment" }, { name: "decrement" }]}
260
+ onAccessibilityAction={(event: any) => {
261
+ const action = event?.nativeEvent?.actionName;
262
+ if (action === "increment") apply(valueRef.current + step);
263
+ if (action === "decrement") apply(valueRef.current - step);
264
+ }}
265
+ style={rootStyle}
266
+ {...props}
267
+ >
268
+ {cell(`Decrease ${accessibilityLabel}`, "\u2212", -1, atMin)}
269
+ <View style={{ minWidth: STEPPER_VALUE_MIN_WIDTH, justifyContent: "center", alignItems: "center" }}>
270
+ <Animated.View style={{ transform: [{ scale: pop.current }] }}>
271
+ <RNText
272
+ numberOfLines={1}
273
+ style={[
274
+ { fontSize: 16, fontWeight: "600", color: theme.foreground },
275
+ textStyle,
276
+ ]}
277
+ >
278
+ {label}
279
+ </RNText>
280
+ </Animated.View>
281
+ </View>
282
+ {cell(`Increase ${accessibilityLabel}`, "+", 1, atMax)}
283
+ {thumb}
284
+ </Glass>
285
+ );
286
+ }
287
+
288
+ const EngineStepperComponent = EngineStepper;
289
+ return (
290
+ <EngineStepperComponent
291
+ value={value}
292
+ onValueChange={disabled ? undefined : (next: number) => apply(next)}
293
+ minimumValue={lower}
294
+ maximumValue={upper}
295
+ step={step}
296
+ disabled={disabled}
297
+ autoRepeat={autoRepeat}
298
+ formatValue={formatValue}
299
+ height={height}
300
+ tint={tint}
301
+ thumbTint={thumbTint}
302
+ providerId={providerId}
303
+ style={style}
304
+ textStyle={textStyle}
305
+ testID={testID}
306
+ accessibilityLabel={accessibilityLabel}
307
+ />
308
+ );
309
+ });
310
+
311
+ /** Keeps a value inside the stepper's range. */
312
+ function clamp(value: number, min: number, max: number): number {
313
+ if (!Number.isFinite(value)) return min;
314
+ return Math.min(max, Math.max(min, value));
315
+ }
package/src/Switch.tsx CHANGED
@@ -1,109 +1,131 @@
1
1
  import { forwardRef, useState } from "react";
2
2
  import type { StyleProp, ViewStyle } from "react-native";
3
3
 
4
+ import { loadEngineControl } from "./internal/glass-routing";
5
+ import { glassCapabilities } from "./internal/GlassView";
4
6
  import { Glass } from "./Glass";
5
7
  import { colors } from "./internal/tokens";
6
8
  import { primitives } from "./internal/primitives";
7
- import { useIsDark, useSpring } from "./internal/motion";
8
9
  import { hapticSelection } from "./internal/haptics";
10
+ import { useIsDark } from "./internal/motion";
9
11
 
10
12
  export interface SwitchProps {
11
- checked?: boolean;
12
- defaultChecked?: boolean;
13
- onCheckedChange?: (checked: boolean) => void;
13
+ /** Controlled on/off value. Omit it and the switch keeps its own. */
14
+ value?: boolean;
15
+ defaultValue?: boolean;
16
+ /** Fires with the next value. The engine's controlled contract. */
17
+ onValueChange?: (value: boolean) => void;
18
+ disabled?: boolean;
19
+ /** Track colour while on. A parseable colour string. Defaults to the scheme's system blue. */
20
+ accentColor?: string;
21
+ /** Track colour while off. */
22
+ trackColor?: string;
23
+ accessibilityLabel?: string;
14
24
  /** One selection tick when it toggles. `false` opts out. */
15
25
  haptics?: boolean;
16
- disabled?: boolean;
17
- accessibilityLabel: string;
18
- style?: StyleProp<ViewStyle>;
19
26
  isDark?: boolean;
20
- /** Passed through to the switch track so it is testable. */
27
+ /** Passed to the control so it is testable. */
21
28
  testID?: string;
29
+ style?: StyleProp<ViewStyle>;
22
30
  }
23
31
 
24
- const TRACK_WIDTH = 51;
25
- const TRACK_HEIGHT = 31;
26
- const THUMB = 27;
27
- const TRAVEL = TRACK_WIDTH - THUMB - 4;
28
-
29
32
  /**
30
- * An on/off switch.
33
+ * An on/off switch — ported from the engine's `LiquidGlassSwitch`, the design
34
+ * Binyam approved on real devices this week (64x28 track, 40x24 lens thumb).
31
35
  *
32
- * The track is Glacia's glass; the thumb is one of our own Views, animated on
33
- * the springs token. The material changes by platform (Apple's glass on
34
- * iOS 26+, Glacia's tint elsewhere) but the control is always ours — React
35
- * Native's built-in Switch is never used.
36
+ * With a glass renderer available the engine's own control mounts, carrying the
37
+ * approved geometry and interaction. Without one — Expo Go, below every tier, or
38
+ * Reduce Transparency — the fallback floor renders the same geometry with a solid
39
+ * track and lens thumb, so the control is never invisible.
36
40
  */
37
41
  export const Switch = forwardRef<any, SwitchProps>(function Switch(
38
42
  {
39
- checked: checkedProp,
40
- defaultChecked = false,
41
- onCheckedChange,
43
+ value: valueProp,
44
+ defaultValue = false,
45
+ onValueChange,
42
46
  disabled = false,
43
- haptics = true,
47
+ accentColor,
48
+ trackColor,
44
49
  accessibilityLabel,
45
- style,
50
+ haptics = true,
46
51
  isDark: isDarkProp,
47
52
  testID,
53
+ style,
48
54
  ...props
49
55
  },
50
56
  ref,
51
57
  ) {
52
58
  const isDark = useIsDark(isDarkProp);
53
59
  const themeColors = isDark ? colors.dark : colors.light;
54
- const { View, Pressable, Animated } = primitives();
55
- const [internalChecked, setInternalChecked] = useState(defaultChecked);
56
- const isChecked = checkedProp !== undefined ? checkedProp : internalChecked;
60
+ const { View, Pressable } = primitives();
61
+ const capabilities = glassCapabilities();
62
+ const EngineSwitch = loadEngineControl("Switch");
57
63
 
58
- // The thumb's travel is a single number animated on the springs token.
59
- const { value: offset, animated } = useSpring(isChecked ? TRAVEL : 0, "snappy");
64
+ const [internalValue, setInternalValue] = useState(defaultValue);
65
+ const value = valueProp ?? internalValue;
60
66
 
61
67
  const toggle = () => {
62
68
  if (disabled) return;
63
- const next = !isChecked;
69
+ const next = !value;
64
70
  if (haptics) hapticSelection();
65
- if (checkedProp === undefined) setInternalChecked(next);
66
- onCheckedChange?.(next);
71
+ if (valueProp === undefined) setInternalValue(next);
72
+ onValueChange?.(next);
67
73
  };
68
74
 
69
- const trackStyle: ViewStyle = {
70
- width: TRACK_WIDTH,
71
- height: TRACK_HEIGHT,
72
- borderRadius: TRACK_HEIGHT / 2,
73
- backgroundColor: isChecked ? themeColors.fill : "rgba(120, 120, 128, 0.16)",
74
- padding: 2,
75
- justifyContent: "center",
76
- opacity: disabled ? 0.38 : 1,
77
- ...(style as ViewStyle),
78
- };
79
-
80
- const thumbStyle: ViewStyle = {
81
- width: THUMB,
82
- height: THUMB,
83
- borderRadius: THUMB / 2,
84
- backgroundColor: "#FFFFFF",
85
- // A hairline edge instead of a drop shadow: RN shadows need per-platform
86
- // props, and the edge reads correctly on a translucent track.
87
- borderWidth: 0.5,
88
- borderColor: "rgba(0, 0, 0, 0.12)",
89
- transform: [{ translateX: animated ? offset : isChecked ? TRAVEL : 0 }],
90
- };
75
+ if (EngineSwitch && capabilities.supported) {
76
+ const EngineSwitchComponent = EngineSwitch;
77
+ return (
78
+ <EngineSwitchComponent
79
+ value={value}
80
+ onValueChange={disabled ? undefined : toggle}
81
+ disabled={disabled}
82
+ accentColor={accentColor}
83
+ trackColor={trackColor}
84
+ style={style}
85
+ />
86
+ );
87
+ }
91
88
 
89
+ // Fallback floor: solid track + lens thumb, full geometry, full states.
90
+ const trackHeight = 28;
91
+ const thumbHeight = 24;
92
+ const thumbInset = 2;
93
+ const travel = 64 - 40 - thumbInset * 2;
92
94
  return (
93
95
  <Pressable
94
96
  ref={ref}
95
97
  testID={testID}
96
98
  accessibilityRole="switch"
97
99
  accessibilityLabel={accessibilityLabel}
98
- accessibilityState={{ checked: isChecked, disabled }}
100
+ accessibilityState={{ checked: value, disabled }}
99
101
  disabled={disabled}
100
- onPress={toggle}
102
+ onPress={disabled ? undefined : toggle}
101
103
  style={{ alignSelf: "flex-start" }}
102
104
  {...props}
103
105
  >
104
- <Glass effect="regular" isDark={isDark} style={trackStyle}>
105
- {animated ? <Animated.View style={thumbStyle} /> : <View style={thumbStyle} />}
106
- </Glass>
106
+ <View
107
+ style={{
108
+ width: 64,
109
+ height: trackHeight,
110
+ borderRadius: trackHeight / 2,
111
+ backgroundColor: value ? accentColor ?? themeColors.fill : themeColors.fieldWash,
112
+ overflow: "hidden",
113
+ opacity: disabled ? 0.38 : 1,
114
+ }}
115
+ >
116
+ <View
117
+ style={{
118
+ position: "absolute",
119
+ left: thumbInset,
120
+ top: (trackHeight - thumbHeight) / 2,
121
+ width: 40,
122
+ height: thumbHeight,
123
+ borderRadius: thumbHeight / 2,
124
+ backgroundColor: themeColors.onTint,
125
+ transform: [{ translateX: value ? travel : 0 }],
126
+ }}
127
+ />
128
+ </View>
107
129
  </Pressable>
108
130
  );
109
131
  });