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
@@ -1,269 +1,15 @@
1
1
  "use strict";
2
+ // Bars, buttons and navigation: the rebuild's entries only.
3
+ //
4
+ // This file used to carry SearchBar, FAB and FABGroup as well. They were old
5
+ // package components and are out of scope (master prompt §2.3); the ported
6
+ // Toolbar, Chip and IconButton live in their own files and are re-exported
7
+ // here so existing import paths keep working.
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FABGroup = exports.AppBar = exports.IconButton = exports.FAB = exports.Chip = exports.SearchBar = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const Glass_1 = require("./Glass");
7
- const tokens_1 = require("./internal/tokens");
8
- const primitives_1 = require("./internal/primitives");
9
- const motion_1 = require("./internal/motion");
10
- /**
11
- * A search field for a bar or a screen header.
12
- *
13
- * Distinct from NativeAIInput: that is an AI composer with send semantics, this
14
- * is ordinary app search — magnifier, themed placeholder, and a clear button
15
- * once there is something to clear.
16
- */
17
- exports.SearchBar = (0, react_1.forwardRef)(function SearchBar({ value: valueProp, defaultValue = "", onChangeText, onSubmit, placeholder = "Search", showCancel = false, onCancel, accessibilityLabel = "Search", style, isDark: isDarkProp, testID, ...props }, ref) {
18
- const isDark = (0, motion_1.useIsDark)(isDarkProp);
19
- const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
20
- const { View, Text: RNText, TextInput, Pressable } = (0, primitives_1.primitives)();
21
- const [internal, setInternal] = (0, react_1.useState)(defaultValue);
22
- const value = valueProp !== undefined ? valueProp : internal;
23
- const handleChange = (next) => {
24
- if (valueProp === undefined)
25
- setInternal(next);
26
- onChangeText?.(next);
27
- };
28
- const clear = () => handleChange("");
29
- return ((0, jsx_runtime_1.jsxs)(View, { ref: ref, testID: testID, style: [{ flexDirection: "row", alignItems: "center", gap: 8 }, style], ...props, children: [(0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", isDark: isDark, style: {
30
- flex: 1,
31
- flexDirection: "row",
32
- alignItems: "center",
33
- gap: 8,
34
- height: 36,
35
- borderRadius: tokens_1.radii.pill,
36
- paddingHorizontal: 12,
37
- }, children: [(0, jsx_runtime_1.jsx)(RNText, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { fontSize: 14, color: theme.muted }, children: "\u2315" }), (0, jsx_runtime_1.jsxs)(View, { style: { flex: 1, justifyContent: "center" }, children: [!value && placeholder ? (
38
- // Themed placeholder: the OS default colour ignores the theme.
39
- (0, jsx_runtime_1.jsx)(RNText, { pointerEvents: "none", numberOfLines: 1, style: { position: "absolute", left: 0, fontSize: 15, color: theme.muted }, children: placeholder })) : null, (0, jsx_runtime_1.jsx)(TextInput, { accessibilityRole: "search", accessibilityLabel: accessibilityLabel, value: value, onChangeText: handleChange, onSubmitEditing: () => onSubmit?.(value), returnKeyType: "search", autoCorrect: false, placeholder: "", style: {
40
- fontSize: 15,
41
- paddingVertical: 4,
42
- color: theme.foreground,
43
- // Transparent: the themed placeholder above provides the hint.
44
- backgroundColor: "transparent",
45
- } })] }), value.length > 0 && ((0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: "Clear search", onPress: clear, hitSlop: 8, children: (0, jsx_runtime_1.jsx)(View, { style: {
46
- width: 16,
47
- height: 16,
48
- // A circle from its own size: half the 16pt box.
49
- borderRadius: 16 / 2,
50
- backgroundColor: theme.separator,
51
- alignItems: "center",
52
- justifyContent: "center",
53
- }, children: (0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 10, color: theme.muted }, children: "\u00D7" }) }) }))] }), showCancel && ((0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: "Cancel", onPress: () => {
54
- clear();
55
- onCancel?.();
56
- }, children: (0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 15, color: theme.fill }, children: "Cancel" }) }))] }));
57
- });
58
- /**
59
- * A filter or tag pill.
60
- *
61
- * Selected state is a glass pill tinted with `glassActive` — the same selected
62
- * treatment SegmentedControl and TabBar use, rather than a new colour.
63
- */
64
- exports.Chip = (0, react_1.forwardRef)(function Chip({ label, icon, onClose, onPress, selected: selectedProp, defaultSelected = false, onSelectedChange, disabled = false, style, isDark: isDarkProp, testID, ...props }, ref) {
65
- const isDark = (0, motion_1.useIsDark)(isDarkProp);
66
- const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
67
- const { View, Text: RNText, Pressable } = (0, primitives_1.primitives)();
68
- const [internalSelected, setInternalSelected] = (0, react_1.useState)(defaultSelected);
69
- const selected = selectedProp !== undefined ? selectedProp : internalSelected;
70
- const selectable = selectedProp !== undefined || onSelectedChange !== undefined || defaultSelected;
71
- const handlePress = () => {
72
- if (disabled)
73
- return;
74
- if (selectable) {
75
- const next = !selected;
76
- if (selectedProp === undefined)
77
- setInternalSelected(next);
78
- onSelectedChange?.(next);
79
- }
80
- onPress?.();
81
- };
82
- const pill = ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", isDark: isDark, tintColor: selected ? theme.glassActive : undefined, interactive: !disabled, style: {
83
- flexDirection: "row",
84
- alignItems: "center",
85
- gap: 6,
86
- height: 30,
87
- paddingHorizontal: 12,
88
- borderRadius: tokens_1.radii.pill,
89
- opacity: disabled ? 0.38 : 1,
90
- ...style,
91
- }, children: [icon ? (0, jsx_runtime_1.jsx)(View, { children: icon }) : null, (0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: { fontSize: 13, fontWeight: selected ? "600" : "500", color: selected ? theme.foreground : theme.muted }, children: label }), onClose && ((0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: `Remove ${label}`, onPress: onClose, hitSlop: 8, children: (0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 11, color: theme.muted }, children: "\u00D7" }) }))] }));
92
- if (!onPress && !selectable) {
93
- return ((0, jsx_runtime_1.jsx)(View, { ref: ref, testID: testID, accessibilityRole: "text", accessibilityLabel: label, ...props, children: pill }));
94
- }
95
- return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: label, accessibilityState: { selected: selectable ? selected : undefined, disabled }, disabled: disabled, onPress: handlePress, ...props, children: pill }));
96
- });
97
- const fabSizes = { md: 56, lg: 64 };
98
- /**
99
- * The floating action button.
100
- *
101
- * The flagship glass circle of the library: a round `Glass` with `interactive`
102
- * so the material itself responds to touch. The caller positions it; the
103
- * component does not assume an edge.
104
- */
105
- exports.FAB = (0, react_1.forwardRef)(function FAB({ onPress, accessibilityLabel, icon, label, size = "md", disabled = false, style, isDark: isDarkProp, testID, ...props }, ref) {
106
- const isDark = (0, motion_1.useIsDark)(isDarkProp);
107
- const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
108
- const { View, Text: RNText, Pressable } = (0, primitives_1.primitives)();
109
- const dimension = fabSizes[size];
110
- const extended = Boolean(label);
111
- return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, disabled: disabled, onPress: disabled ? undefined : onPress, style: ({ pressed }) => ({
112
- alignSelf: "flex-start",
113
- opacity: disabled ? 0.38 : pressed ? 0.85 : 1,
114
- }), ...props, children: (0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "clear", interactive: !disabled, isDark: isDark, style: {
115
- height: dimension,
116
- width: extended ? undefined : dimension,
117
- minWidth: dimension,
118
- borderRadius: extended ? dimension / 2 : dimension / 2,
119
- paddingHorizontal: extended ? 20 : 0,
120
- flexDirection: "row",
121
- alignItems: "center",
122
- justifyContent: "center",
123
- gap: 8,
124
- ...style,
125
- }, children: [icon ? (0, jsx_runtime_1.jsx)(View, { children: icon }) : null, label ? ((0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 15, fontWeight: "600", color: theme.foreground }, numberOfLines: 1, children: label })) : null] }) }));
126
- });
127
- const iconButtonSizes = { sm: 28, md: 36, lg: 44 };
128
- /**
129
- * An icon-only button on glass.
130
- *
131
- * Button takes an icon alongside a label; this is the icon-only form, which
132
- * every kit ships for toolbars and bar actions.
133
- */
134
- exports.IconButton = (0, react_1.forwardRef)(function IconButton({ accessibilityLabel, onPress, icon, size = "md", variant = "glass", disabled = false, style, isDark: isDarkProp, testID, ...props }, ref) {
135
- const isDark = (0, motion_1.useIsDark)(isDarkProp);
136
- const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
137
- const { View, Pressable } = (0, primitives_1.primitives)();
138
- const dimension = iconButtonSizes[size];
139
- return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, disabled: disabled, onPress: disabled ? undefined : onPress, style: ({ pressed }) => ({ opacity: disabled ? 0.38 : pressed ? 0.8 : 1 }), ...props, children: (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: variant === "ghost" ? "none" : "regular", interactive: !disabled && variant !== "ghost", isDark: isDark, style: {
140
- width: dimension,
141
- height: dimension,
142
- borderRadius: dimension / 2,
143
- alignItems: "center",
144
- justifyContent: "center",
145
- backgroundColor: variant === "ghost" ? "transparent" : undefined,
146
- ...style,
147
- }, children: (0, jsx_runtime_1.jsx)(View, { style: { width: dimension * 0.5, height: dimension * 0.5, alignItems: "center", justifyContent: "center" }, children: icon }) }) }));
148
- });
149
- /**
150
- * The top bar.
151
- *
152
- * A glass bar across the top of the screen with a leading action, a title and
153
- * trailing actions — the counterpart to the existing bottom TabBar.
154
- *
155
- * `scrolled` mirrors iOS 26's scroll-edge effect. At the top of the screen the
156
- * bar is quiet: its bottom edge is invisible and the glass blends into the
157
- * content above it. Once content has scrolled under it, the edge token becomes
158
- * visible and the surface reads as a distinct layer — the change iOS makes when
159
- * a navigation bar starts floating over scrolled content.
160
- *
161
- * ```
162
- * const [scrolled, setScrolled] = useState(false);
163
- * <ScrollView onScroll={(e) => setScrolled(e.nativeEvent.contentOffset.y > 8)}
164
- * scrollEventThrottle={16}>{...}</ScrollView>
165
- * <AppBar title="Inbox" scrolled={scrolled} />
166
- * ```
167
- */
168
- exports.AppBar = (0, react_1.forwardRef)(function AppBar({ title, subtitle, leading, actions, topInset = 0, scrolled = false, style, isDark: isDarkProp, testID, ...props }, ref) {
169
- const isDark = (0, motion_1.useIsDark)(isDarkProp);
170
- const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
171
- const { View, Text: RNText, Pressable } = (0, primitives_1.primitives)();
172
- const actionCount = actions?.length ?? 0;
173
- const renderAction = (action, key) => ((0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: action.accessibilityLabel, accessibilityState: { disabled: action.disabled }, disabled: action.disabled, onPress: action.disabled ? undefined : action.onPress, hitSlop: 6, style: { padding: 6, opacity: action.disabled ? 0.38 : 1 }, children: action.icon }, key));
174
- return ((0, jsx_runtime_1.jsx)(Glass_1.Glass, { ref: ref, effect: "regular", isDark: isDark, testID: testID, style: {
175
- borderRadius: 0,
176
- borderTopWidth: 0,
177
- borderLeftWidth: 0,
178
- borderRightWidth: 0,
179
- // Quiet at the top of a screen, defined once content is under it: the
180
- // bottom edge is the difference iOS draws on a scrolled navigation bar.
181
- ...(scrolled ? { borderBottomWidth: 0.5, borderBottomColor: theme.edge } : { borderBottomWidth: 0 }),
182
- ...style,
183
- }, ...props, children: (0, jsx_runtime_1.jsxs)(View, { style: {
184
- paddingTop: topInset,
185
- paddingHorizontal: 8,
186
- paddingBottom: 8,
187
- flexDirection: "row",
188
- alignItems: "center",
189
- gap: 4,
190
- minHeight: 44 + topInset,
191
- }, children: [leading ? renderAction(leading, "leading") : (0, jsx_runtime_1.jsx)(View, { style: { width: 8 } }), (0, jsx_runtime_1.jsxs)(View, { style: { flex: 1, paddingHorizontal: 4 }, children: [(0, jsx_runtime_1.jsx)(RNText, { accessibilityRole: "header", numberOfLines: 1, style: { fontSize: 17, fontWeight: "600", color: theme.foreground }, children: title }), subtitle ? ((0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: { fontSize: 12, color: theme.muted }, children: subtitle })) : null] }), actions && actionCount > 0 ? ((0, jsx_runtime_1.jsx)(View, { style: { flexDirection: "row", alignItems: "center" }, children: actions.map((action, index) => renderAction(action, `action-${index}`)) })) : null] }) }));
192
- });
193
- // The main button's size, and the mini buttons' — both from the size scale so
194
- // a mini button is never a hand-tuned multiple of the main one.
195
- const fabGroupSizes = {
196
- md: { main: 56, mini: 44 },
197
- lg: { main: 64, mini: 52 },
198
- };
199
- /**
200
- * A main button that expands into a stack of labelled mini buttons.
201
- *
202
- * The pattern Paper calls `FAB.Group`: one floating button stands in for a set
203
- * of actions until it is opened, then the actions appear above it, each on its
204
- * own glass pill with a label. A scrim behind them takes the next press and
205
- * closes the group, which is how a floating action set gets out of the way
206
- * without a dismissal button.
207
- *
208
- * The mini buttons rise on the bouncy spring with a small stagger, and the main
209
- * button's icon rotates 45° — both settle instantly under Reduce Motion.
210
- *
211
- * **Merging is an iOS 26+ visual effect.** This component is one glass surface
212
- * plus one per action; to have them blend into a single connected surface, put
213
- * the group inside a `GlassContainer` on iOS 26. It works standalone — nothing
214
- * depends on the container — and that composition is left to the caller rather
215
- * than forced, because a group outside a container is the correct rendering on
216
- * every other platform anyway.
217
- */
218
- exports.FABGroup = (0, react_1.forwardRef)(function FABGroup({ actions, icon, closeIcon, open: openProp, defaultOpen = false, onOpenChange, accessibilityLabel = "More actions", size = "md", style, isDark: isDarkProp, testID, ...props }, ref) {
219
- const isDark = (0, motion_1.useIsDark)(isDarkProp);
220
- const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
221
- const { View, Text: RNText, Pressable, Animated } = (0, primitives_1.primitives)();
222
- const [internalOpen, setInternalOpen] = (0, react_1.useState)(defaultOpen);
223
- const open = openProp !== undefined ? openProp : internalOpen;
224
- const setOpen = (next) => {
225
- if (openProp === undefined)
226
- setInternalOpen(next);
227
- onOpenChange?.(next);
228
- };
229
- // The stack's rise is one value: 0 closed, 1 open. The mini buttons ride it
230
- // with their own stagger, so they follow the lead rather than all snapping
231
- // at once.
232
- const { value: rise, animated } = (0, motion_1.useSpring)(open ? 1 : 0, "bouncy");
233
- const { main: dimension, mini } = fabGroupSizes[size];
234
- const closeFirst = closeIcon ?? icon;
235
- const rotate = animated ? rise.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "45deg"] }) : open ? "45deg" : "0deg";
236
- return ((0, jsx_runtime_1.jsxs)(View, { ref: ref, testID: testID, style: style, ...props, children: [open ? ((0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: "Close actions", onPress: () => setOpen(false), style: { position: "absolute", top: -2000, left: -2000, right: -2000, bottom: -2000, backgroundColor: theme.scrim } })) : null, (0, jsx_runtime_1.jsxs)(View, { style: { alignItems: "flex-end", gap: 10 }, children: [open
237
- ? actions.map((action, index) => {
238
- // Later actions sit higher, so the first is nearest the button.
239
- const order = actions.length - 1 - index;
240
- const translateY = animated
241
- ? rise.interpolate({
242
- inputRange: [0, 1],
243
- outputRange: [24 + order * 18, 0],
244
- })
245
- : 0;
246
- const opacity = animated ? rise.interpolate({ inputRange: [0, 0.4, 1], outputRange: [0, 0, 1] }) : 1;
247
- const pill = ((0, jsx_runtime_1.jsxs)(Pressable, { accessibilityRole: "button", accessibilityLabel: action.label, onPress: () => {
248
- setOpen(false);
249
- action.onPress();
250
- }, style: { flexDirection: "row", alignItems: "center", gap: 8 }, children: [(0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", isDark: isDark, style: { borderRadius: tokens_1.radii.pill, paddingHorizontal: 12, paddingVertical: 7 }, children: (0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 13, fontWeight: "600", color: theme.foreground }, numberOfLines: 1, children: action.label }) }), (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "regular", isDark: isDark, style: {
251
- width: mini,
252
- height: mini,
253
- borderRadius: mini / 2,
254
- alignItems: "center",
255
- justifyContent: "center",
256
- }, children: action.icon })] }));
257
- if (!animated) {
258
- return ((0, jsx_runtime_1.jsx)(View, { children: pill }, `${action.label}-${index}`));
259
- }
260
- return ((0, jsx_runtime_1.jsx)(Animated.View, { style: { transform: [{ translateY }], opacity }, children: pill }, `${action.label}-${index}`));
261
- })
262
- : null, (0, jsx_runtime_1.jsx)(Pressable, { accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { expanded: open }, onPress: () => setOpen(!open), children: (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: "clear", interactive: true, isDark: isDark, style: {
263
- width: dimension,
264
- height: dimension,
265
- borderRadius: dimension / 2,
266
- alignItems: "center",
267
- justifyContent: "center",
268
- }, children: animated ? ((0, jsx_runtime_1.jsx)(Animated.View, { style: { transform: [{ rotate }] }, children: open ? closeFirst : icon })) : ((0, jsx_runtime_1.jsx)(View, { children: open ? closeFirst : icon })) }) })] })] }));
269
- });
9
+ exports.Toolbar = exports.IconButton = exports.Chip = void 0;
10
+ var Chip_1 = require("./Chip");
11
+ Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return Chip_1.Chip; } });
12
+ var IconButton_1 = require("./IconButton");
13
+ Object.defineProperty(exports, "IconButton", { enumerable: true, get: function () { return IconButton_1.IconButton; } });
14
+ var Toolbar_1 = require("./Toolbar");
15
+ Object.defineProperty(exports, "Toolbar", { enumerable: true, get: function () { return Toolbar_1.Toolbar; } });
@@ -3,48 +3,69 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Button = 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
10
  const motion_1 = require("./internal/motion");
10
- const sizeHeights = {
11
- sm: 32,
12
- md: 40,
13
- lg: 48,
14
- };
15
11
  /**
16
- * A pressable button on Glacia's glass.
12
+ * The web control scale the port keeps: 28 / 34 / 44, one horizontal padding and
13
+ * one type size for every button — the engine's own sizing table is the design
14
+ * source, and this is its Glacia-name translation.
15
+ */
16
+ const ENGINE_BUTTON_SIZES = { sm: 28, md: 34, lg: 44 };
17
+ /**
18
+ * A pressable button on Glacia's glass — ported from the engine's
19
+ * `LiquidGlassButton` (expo-liquid-glass-ui), the design Binyam approved on real
20
+ * devices this week.
17
21
  *
18
- * The root is a Pressable so it gets the platform's own press semantics
19
- * (focus, screen-reader activation, pressed feedback) while the material —
20
- * Apple's glass on iOS 26+, Glacia's tint elsewhere — comes from `Glass`.
22
+ * With a glass renderer available the engine's own control mounts, carrying the
23
+ * approved design, geometry and press behaviour. Without one — Expo Go, below
24
+ * every tier, or Reduce Transparency — the fallback floor renders the same
25
+ * geometry with a solid surface, so the button is never invisible.
21
26
  */
22
- exports.Button = (0, react_1.forwardRef)(function Button({ variant = "glass", size = "md", disabled = false, onPress, accessibilityLabel, icon, children, style, tint, isDark: isDarkProp, testID, ...props }, ref) {
27
+ exports.Button = (0, react_1.forwardRef)(function Button({ variant = "glass", size = "md", shape = "capsule", disabled = false, loading = false, onPress, onLongPress, interactive = true, pressLight, adaptive = false, tint, height, icon, accessibilityLabel, accessibilityState, style, contentStyle, textStyle, isDark: isDarkProp, testID, children, }, ref) {
23
28
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
24
29
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
25
- const { Pressable, View, Text } = (0, primitives_1.primitives)();
26
- const height = sizeHeights[size];
27
- const buttonStyle = {
28
- height,
29
- borderRadius: height / 2,
30
- flexDirection: "row",
31
- alignItems: "center",
32
- justifyContent: "center",
33
- paddingHorizontal: size === "sm" ? 12 : size === "lg" ? 22 : 16,
34
- opacity: disabled ? 0.38 : 1,
35
- backgroundColor: variant === "filled"
36
- ? tint || themeColors.fill
37
- : variant === "ghost"
38
- ? "transparent"
39
- : undefined,
40
- ...style,
41
- };
42
- const textStyle = {
43
- color: variant === "filled" ? "#FFFFFF" : tint || themeColors.foreground,
44
- fontSize: size === "sm" ? 13 : size === "lg" ? 16 : 14,
45
- fontWeight: "500",
46
- };
47
- return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, disabled: disabled, onPress: disabled ? undefined : onPress, style: ({ pressed }) => ({ opacity: pressed && !disabled ? 0.85 : 1 }), ...props, children: (0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: variant === "ghost" ? "none" : "regular", interactive: !disabled, isDark: isDark, style: buttonStyle, children: [icon ? (0, jsx_runtime_1.jsx)(View, { style: { marginRight: children ? 8 : 0 }, children: icon }) : null, typeof children === "string" ? (
48
- // A string label is text: it needs Text to inherit font and colour.
49
- (0, jsx_runtime_1.jsx)(Text, { style: textStyle, numberOfLines: 1, children: children })) : (children)] }) }));
30
+ const { Pressable, View, Text: RNText } = (0, primitives_1.primitives)();
31
+ const capabilities = (0, GlassView_1.glassCapabilities)();
32
+ const EngineButton = (0, glass_routing_1.loadEngineControl)("Button");
33
+ const height_ = height ?? ENGINE_BUTTON_SIZES[size];
34
+ // A ghost button wears no surface; the engine has no none-variant, so the
35
+ // fallback floor renders the bare control.
36
+ if (variant === "ghost") {
37
+ return ((0, jsx_runtime_1.jsx)(GhostButton, { ref: ref, accessibilityLabel: accessibilityLabel, disabled: disabled, height: height_, isDark: isDark, testID: testID, onPress: onPress, children: children }));
38
+ }
39
+ if (EngineButton && capabilities.supported) {
40
+ const EngineButtonComponent = EngineButton;
41
+ return ((0, jsx_runtime_1.jsx)(EngineButtonComponent, { ref: ref, onPress: disabled || loading ? undefined : onPress, onLongPress: disabled || loading ? undefined : onLongPress, disabled: disabled || loading, loading: loading, interactive: interactive, pressLight: pressLight, adaptive: adaptive, tint: tint ?? (variant === "filled" ? themeColors.fill : undefined), height: height_, icon: icon, accessibilityLabel: accessibilityLabel, accessibilityState: { disabled, ...accessibilityState }, style: style, contentStyle: contentStyle, textStyle: textStyle, variant: variant === "filled" ? "regular" : "regular", shape: shape, children: children }));
42
+ }
43
+ // Fallback floor: solid surface, full geometry and states.
44
+ return ((0, jsx_runtime_1.jsx)(FallbackButton, { ref: ref, accessibilityLabel: accessibilityLabel, disabled: disabled, height: height_, isDark: isDark, testID: testID, variant: variant, tint: tint ?? themeColors.fill, onPress: onPress, children: children }));
45
+ });
46
+ const GhostButton = (0, react_1.forwardRef)(function GhostButton({ accessibilityLabel, disabled = false, height = ENGINE_BUTTON_SIZES.md, isDark, testID, onPress, children }, ref) {
47
+ const { Pressable, View, Text: RNText } = (0, primitives_1.primitives)();
48
+ const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
49
+ const radius = height / 2;
50
+ return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, disabled: disabled, onPress: disabled ? undefined : onPress, children: (0, jsx_runtime_1.jsx)(View, { style: {
51
+ height,
52
+ borderRadius: radius,
53
+ alignItems: "center",
54
+ justifyContent: "center",
55
+ opacity: disabled ? 0.38 : 1,
56
+ }, children: (0, jsx_runtime_1.jsx)(View, { style: { height: height - 8, justifyContent: "center", alignItems: "center", flex: 1 }, children: typeof children === "string" ? ((0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 14, fontWeight: "400" }, children: children })) : (children) }) }) }));
57
+ });
58
+ const FallbackButton = (0, react_1.forwardRef)(function FallbackButton({ accessibilityLabel, disabled = false, height = ENGINE_BUTTON_SIZES.md, isDark, testID, variant = "glass", tint, onPress, children }, ref) {
59
+ const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
60
+ const { Pressable, View, Text: RNText } = (0, primitives_1.primitives)();
61
+ const radius = height / 2;
62
+ const solid = variant !== "ghost";
63
+ return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled }, disabled: disabled, onPress: disabled ? undefined : onPress, children: (0, jsx_runtime_1.jsx)(View, { style: {
64
+ height,
65
+ borderRadius: radius,
66
+ backgroundColor: solid ? tint ?? themeColors.fill : "transparent",
67
+ opacity: disabled ? 0.38 : 1,
68
+ alignItems: "center",
69
+ justifyContent: "center",
70
+ }, children: (0, jsx_runtime_1.jsx)(View, { style: { height: height - 8, justifyContent: "center", alignItems: "center", flex: 1 }, children: typeof children === "string" ? ((0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 14, fontWeight: "400", color: themeColors.onTint }, children: children })) : (children) }) }) }));
50
71
  });
@@ -8,57 +8,69 @@ exports.CardContent = CardContent;
8
8
  exports.CardFooter = CardFooter;
9
9
  const jsx_runtime_1 = require("react/jsx-runtime");
10
10
  const react_1 = require("react");
11
+ const glass_routing_1 = require("./internal/glass-routing");
12
+ const GlassView_1 = require("./internal/GlassView");
11
13
  const Glass_1 = require("./Glass");
12
14
  const tokens_1 = require("./internal/tokens");
13
15
  const primitives_1 = require("./internal/primitives");
14
16
  const motion_1 = require("./internal/motion");
15
17
  /**
16
- * A content panel on Glacia's glass: Apple's material on iOS 26+, Glacia's
17
- * tint elsewhere. The padding, radius and stacking are ours on every platform.
18
+ * A content panel on Glacia's glass — ported from the engine's
19
+ * `LiquidGlassCard`, the design Binyam approved on real devices this week (24dp
20
+ * continuous corner, 16dp padding, presses to 98%).
21
+ *
22
+ * With a glass renderer available the engine's own control mounts, carrying the
23
+ * approved material. Without one — Expo Go, below every tier, or Reduce
24
+ * Transparency — the fallback floor renders the same geometry with a solid
25
+ * surface, so the card is never invisible.
18
26
  */
19
- exports.Card = (0, react_1.forwardRef)(function Card({ effect = "regular", style, children, isDark: isDarkProp, testID, ...props }, ref) {
27
+ exports.Card = (0, react_1.forwardRef)(function Card({ onPress, onLongPress, disabled = false, cornerRadius = 24, padding = 16, adaptive = false, tint, variant = "regular", accessibilityLabel, style, contentStyle, children, isDark: isDarkProp, testID, ...props }, ref) {
20
28
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
29
+ const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
30
+ const { View, Pressable } = (0, primitives_1.primitives)();
31
+ const capabilities = (0, GlassView_1.glassCapabilities)();
32
+ const EngineCard = (0, glass_routing_1.loadEngineControl)("Card");
21
33
  const cardStyle = {
22
- padding: 20,
23
- borderRadius: tokens_1.radii.lg,
34
+ padding,
35
+ borderRadius: cornerRadius,
24
36
  flexDirection: "column",
25
- gap: 12,
37
+ gap: 16,
26
38
  ...style,
27
39
  };
28
- return ((0, jsx_runtime_1.jsx)(Glass_1.Glass, { ref: ref, effect: effect, isDark: isDark, style: cardStyle, testID: testID, ...props, children: children }));
40
+ if (EngineCard && capabilities.supported) {
41
+ const EngineCardComponent = EngineCard;
42
+ return ((0, jsx_runtime_1.jsx)(EngineCardComponent, { onPress: disabled ? undefined : onPress, onLongPress: disabled ? undefined : onLongPress, disabled: disabled, cornerRadius: cornerRadius, padding: padding, adaptive: adaptive, tint: tint, variant: variant, style: style, contentStyle: contentStyle, accessibilityLabel: accessibilityLabel, children: children }));
43
+ }
44
+ // Fallback floor: layered-or-solid material with the card's full geometry.
45
+ const content = (0, jsx_runtime_1.jsx)(View, { style: cardStyle, children: children });
46
+ if (onPress) {
47
+ return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, disabled: disabled, onPress: disabled ? undefined : onPress, onLongPress: disabled ? undefined : onLongPress, style: [{ transform: [{ scale: 0.98 }] }], ...props, children: (0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: variant, surface: "panel", tintColor: tint, isDark: isDark, style: cardStyle, testID: testID, children: content }) }));
48
+ }
49
+ return ((0, jsx_runtime_1.jsx)(Glass_1.Glass, { effect: variant, surface: "panel", tintColor: tint, isDark: isDark, style: cardStyle, testID: testID, children: content }));
29
50
  });
30
51
  /** The block holding a card's title and description. */
31
52
  function CardHeader({ style, children, ...props }) {
32
53
  const { View } = (0, primitives_1.primitives)();
33
- return ((0, jsx_runtime_1.jsx)(View, { style: { flexDirection: "column", gap: 4, ...style }, ...props, children: children }));
54
+ return (0, jsx_runtime_1.jsx)(View, { style: { flexDirection: "column", gap: 4, ...style }, ...props, children: children });
34
55
  }
35
56
  /** A card's heading, announced as a heading by screen readers. */
36
57
  function CardTitle({ style, children, isDark: isDarkProp, ...props }) {
37
58
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
38
59
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
39
60
  const { Text } = (0, primitives_1.primitives)();
40
- return ((0, jsx_runtime_1.jsx)(Text, { accessibilityRole: "heading", style: {
41
- fontSize: 18,
42
- fontWeight: "600",
43
- color: themeColors.foreground,
44
- ...style,
45
- }, ...props, children: children }));
61
+ return ((0, jsx_runtime_1.jsx)(Text, { accessibilityRole: "heading", style: { fontSize: 18, fontWeight: "600", color: themeColors.foreground, ...style }, ...props, children: children }));
46
62
  }
47
63
  /** Supporting text under a card's title. */
48
64
  function CardDescription({ style, children, isDark: isDarkProp, ...props }) {
49
65
  const isDark = (0, motion_1.useIsDark)(isDarkProp);
50
66
  const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
51
67
  const { Text } = (0, primitives_1.primitives)();
52
- return ((0, jsx_runtime_1.jsx)(Text, { style: {
53
- fontSize: 13,
54
- color: themeColors.muted,
55
- ...style,
56
- }, ...props, children: children }));
68
+ return ((0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 13, color: themeColors.muted, ...style }, ...props, children: children }));
57
69
  }
58
70
  /** The card's body. */
59
71
  function CardContent({ style, children, ...props }) {
60
72
  const { View } = (0, primitives_1.primitives)();
61
- return ((0, jsx_runtime_1.jsx)(View, { style: { flexDirection: "column", gap: 8, ...style }, ...props, children: children }));
73
+ return (0, jsx_runtime_1.jsx)(View, { style: { flexDirection: "column", gap: 8, ...style }, ...props, children: children });
62
74
  }
63
75
  exports.CardBody = CardContent;
64
76
  /** The card's action row. */
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Checkbox = Checkbox;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Wave 2 — Checkbox.
6
+ //
7
+ // The donor's checkbox semantics: `role="checkbox"`, checked / mixed states
8
+ // exposed to screen readers, a label that is part of the same press target, and
9
+ // controlled-or-internal state. Dressed as the family's small glass square.
10
+ const react_1 = require("react");
11
+ const tokens_1 = require("./internal/tokens");
12
+ const primitives_1 = require("./internal/primitives");
13
+ const motion_1 = require("./internal/motion");
14
+ const haptics_1 = require("./internal/haptics");
15
+ function Checkbox({ checked: checkedProp, defaultChecked = false, onCheckedChange, label, description, indeterminate = false, disabled = false, isDark: isDarkProp, style, testID, }) {
16
+ const isDark = (0, motion_1.useIsDark)(isDarkProp);
17
+ const theme = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
18
+ const { View, Pressable, Text: RNText } = (0, primitives_1.primitives)();
19
+ const [internal, setInternal] = (0, react_1.useState)(defaultChecked);
20
+ const checked = checkedProp !== undefined ? checkedProp : internal;
21
+ const on = checked || indeterminate;
22
+ const toggle = () => {
23
+ const next = !checked;
24
+ if (checkedProp === undefined)
25
+ setInternal(next);
26
+ (0, haptics_1.hapticSelection)();
27
+ onCheckedChange?.(next);
28
+ };
29
+ return ((0, jsx_runtime_1.jsxs)(Pressable, { testID: testID, accessibilityRole: "checkbox", accessibilityLabel: label ?? "Checkbox", accessibilityState: { checked: indeterminate ? "mixed" : checked, disabled }, disabled: disabled, onPress: toggle, style: [
30
+ { flexDirection: "row", alignItems: "center", gap: 10, opacity: disabled ? 0.38 : 1 },
31
+ style,
32
+ ], children: [(0, jsx_runtime_1.jsx)(View, { style: {
33
+ width: 22,
34
+ height: 22,
35
+ borderRadius: tokens_1.radii.sm,
36
+ borderWidth: 1.5,
37
+ borderColor: on ? theme.fill : theme.separator,
38
+ backgroundColor: on ? theme.fill : "transparent",
39
+ alignItems: "center",
40
+ justifyContent: "center",
41
+ }, children: indeterminate ? ((0, jsx_runtime_1.jsx)(View, { style: { width: 10, height: 2, borderRadius: tokens_1.radii.pill, backgroundColor: theme.onTint } })) : checked ? ((0, jsx_runtime_1.jsx)(RNText, { style: { fontSize: 13, fontWeight: "800", color: theme.onTint }, children: "\u2713" })) : null }), label || description ? ((0, jsx_runtime_1.jsxs)(View, { style: { flex: 1 }, children: [label ? ((0, jsx_runtime_1.jsx)(RNText, { style: { ...tokens_1.typeScale.body, color: theme.foreground }, children: label })) : null, description ? ((0, jsx_runtime_1.jsx)(RNText, { style: { ...tokens_1.typeScale.caption, color: theme.muted }, children: description })) : null] })) : null] }));
42
+ }
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Chip = 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 filter or tag pill — ported from the engine's `LiquidGlassChip`, whose
14
+ * selected state wears the accent as a wash with a white label.
15
+ */
16
+ exports.Chip = (0, react_1.forwardRef)(function Chip({ label, icon, onPress, selected: selectedProp, defaultSelected = false, onSelectedChange, disabled = false, style, isDark: isDarkProp, testID, }, ref) {
17
+ const isDark = (0, motion_1.useIsDark)(isDarkProp);
18
+ const themeColors = isDark ? tokens_1.colors.dark : tokens_1.colors.light;
19
+ const { Pressable, View, Text: RNText } = (0, primitives_1.primitives)();
20
+ const [internalSelected, setInternalSelected] = (0, react_1.useState)(defaultSelected);
21
+ const selected = selectedProp !== undefined ? selectedProp : internalSelected;
22
+ const selectable = selectedProp !== undefined || onSelectedChange !== undefined || defaultSelected;
23
+ const interactive = Boolean(onPress) || selectable;
24
+ const capabilities = (0, GlassView_1.glassCapabilities)();
25
+ const EngineChip = (0, glass_routing_1.loadEngineControl)("Chip");
26
+ const handlePress = () => {
27
+ if (disabled)
28
+ return;
29
+ if (selectable) {
30
+ const next = !selected;
31
+ if (selectedProp === undefined)
32
+ setInternalSelected(next);
33
+ onSelectedChange?.(next);
34
+ }
35
+ onPress?.();
36
+ };
37
+ // A tag with no affordance and no selection is a static label, not a button.
38
+ if (!interactive) {
39
+ const height = 34;
40
+ const radius = height / 2;
41
+ return ((0, jsx_runtime_1.jsxs)(Glass_1.Glass, { effect: "regular", surface: "control", isDark: isDark, tintColor: selected ? themeColors.glassActive : undefined, interactive: false, style: {
42
+ flexDirection: "row",
43
+ alignItems: "center",
44
+ gap: 6,
45
+ height,
46
+ paddingHorizontal: 12,
47
+ borderRadius: radius,
48
+ opacity: disabled ? 0.38 : 1,
49
+ ...style,
50
+ }, testID: testID, children: [icon ? (0, jsx_runtime_1.jsx)(View, { children: typeof icon === "function" ? null : icon }) : null, (0, jsx_runtime_1.jsx)(RNText, { numberOfLines: 1, style: {
51
+ fontSize: 14,
52
+ fontWeight: selected ? "600" : "500",
53
+ color: selected ? themeColors.foreground : themeColors.muted,
54
+ }, children: label })] }));
55
+ }
56
+ if (EngineChip && capabilities.supported) {
57
+ const EngineChipComponent = EngineChip;
58
+ return (0, jsx_runtime_1.jsx)(EngineChipComponent, { label: label, icon: icon, selected: selected, onPress: disabled ? undefined : handlePress, disabled: disabled, accentColor: themeColors.info, tint: selected ? themeColors.glassActive : undefined, style: style, testID: testID });
59
+ }
60
+ // Fallback floor: solid pill, full geometry and states.
61
+ const height = 34;
62
+ const radius = height / 2;
63
+ return ((0, jsx_runtime_1.jsx)(Pressable, { ref: ref, testID: testID, accessibilityRole: "button", accessibilityLabel: label, accessibilityState: { selected, disabled }, disabled: disabled, onPress: disabled ? undefined : handlePress, children: (0, jsx_runtime_1.jsxs)(View, { style: {
64
+ height,
65
+ borderRadius: radius,
66
+ backgroundColor: selected ? themeColors.glassActive : "transparent",
67
+ borderWidth: 0.5,
68
+ borderColor: themeColors.edge,
69
+ opacity: disabled ? 0.38 : 1,
70
+ paddingHorizontal: 12,
71
+ alignItems: "center",
72
+ justifyContent: "center",
73
+ flexDirection: "row",
74
+ gap: 6,
75
+ }, children: [icon ? (0, jsx_runtime_1.jsx)(View, { children: typeof icon === "function" ? null : icon }) : null, (0, jsx_runtime_1.jsx)(RNText, { style: {
76
+ fontSize: 14,
77
+ fontWeight: selected ? "600" : "500",
78
+ color: selected ? themeColors.foreground : themeColors.muted,
79
+ }, children: label })] }) }));
80
+ });