glacia-native 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +84 -17
  2. package/lib/module/Accordion.js +58 -0
  3. package/lib/module/ActionSheet.js +38 -0
  4. package/lib/module/Alert.js +23 -0
  5. package/lib/module/AlertDialog.js +47 -0
  6. package/lib/module/Avatar.js +48 -0
  7. package/lib/module/Badge.js +36 -0
  8. package/lib/module/Bars.js +13 -268
  9. package/lib/module/Button.js +57 -39
  10. package/lib/module/Card.js +31 -19
  11. package/lib/module/Checkbox.js +42 -0
  12. package/lib/module/Chip.js +80 -0
  13. package/lib/module/Collapsible.js +26 -0
  14. package/lib/module/ContextMenu.js +33 -0
  15. package/lib/module/Dialog.js +39 -123
  16. package/lib/module/DropdownMenu.js +33 -0
  17. package/lib/module/Field.js +22 -0
  18. package/lib/module/Glass.js +10 -3
  19. package/lib/module/Group.js +36 -0
  20. package/lib/module/IconButton.js +40 -0
  21. package/lib/module/Input.js +43 -38
  22. package/lib/module/Label.js +17 -0
  23. package/lib/module/MorphGroup.js +47 -0
  24. package/lib/module/Popover.js +29 -0
  25. package/lib/module/Progress.js +32 -0
  26. package/lib/module/RadioGroup.js +51 -0
  27. package/lib/module/Scrim.js +44 -0
  28. package/lib/module/SegmentedControl.js +70 -63
  29. package/lib/module/Select.js +51 -0
  30. package/lib/module/Separator.js +25 -0
  31. package/lib/module/Sheet.js +51 -0
  32. package/lib/module/Skeleton.js +48 -0
  33. package/lib/module/Slider.js +45 -34
  34. package/lib/module/Stepper.js +167 -0
  35. package/lib/module/Switch.js +45 -55
  36. package/lib/module/TabBar.js +50 -44
  37. package/lib/module/Textarea.js +18 -0
  38. package/lib/module/Toast.js +55 -0
  39. package/lib/module/Toggle.js +47 -0
  40. package/lib/module/ToggleGroup.js +56 -0
  41. package/lib/module/Toolbar.js +37 -0
  42. package/lib/module/Tooltip.js +31 -0
  43. package/lib/module/glass-provider.js +28 -0
  44. package/lib/module/glass-stack.js +61 -0
  45. package/lib/module/index.js +78 -109
  46. package/lib/module/internal/GlassBackdrop.js +36 -0
  47. package/lib/module/internal/GlassView.js +43 -11
  48. package/lib/module/internal/blur-community.js +20 -0
  49. package/lib/module/internal/blur-community.web.js +9 -0
  50. package/lib/module/internal/blur.js +6 -9
  51. package/lib/module/internal/glass-routing.js +156 -30
  52. package/lib/module/internal/initials.js +12 -0
  53. package/lib/module/internal/overlay.js +147 -0
  54. package/lib/module/internal/primitives.js +16 -0
  55. package/lib/typescript/Accordion.d.ts +22 -0
  56. package/lib/typescript/ActionSheet.d.ts +24 -0
  57. package/lib/typescript/Alert.d.ts +15 -0
  58. package/lib/typescript/AlertDialog.d.ts +17 -0
  59. package/lib/typescript/Avatar.d.ts +22 -0
  60. package/lib/typescript/Badge.d.ts +12 -0
  61. package/lib/typescript/Bars.d.ts +3 -188
  62. package/lib/typescript/Button.d.ts +44 -10
  63. package/lib/typescript/Card.d.ts +30 -3
  64. package/lib/typescript/Checkbox.d.ts +14 -0
  65. package/lib/typescript/Chip.d.ts +19 -0
  66. package/lib/typescript/Collapsible.d.ts +17 -0
  67. package/lib/typescript/ContextMenu.d.ts +23 -0
  68. package/lib/typescript/Dialog.d.ts +8 -68
  69. package/lib/typescript/DropdownMenu.d.ts +23 -0
  70. package/lib/typescript/Field.d.ts +19 -0
  71. package/lib/typescript/Glass.d.ts +11 -2
  72. package/lib/typescript/Group.d.ts +35 -0
  73. package/lib/typescript/IconButton.d.ts +21 -0
  74. package/lib/typescript/Input.d.ts +17 -18
  75. package/lib/typescript/Label.d.ts +14 -0
  76. package/lib/typescript/MorphGroup.d.ts +46 -0
  77. package/lib/typescript/Popover.d.ts +17 -0
  78. package/lib/typescript/Progress.d.ts +13 -0
  79. package/lib/typescript/RadioGroup.d.ts +21 -0
  80. package/lib/typescript/Scrim.d.ts +33 -0
  81. package/lib/typescript/SegmentedControl.d.ts +24 -13
  82. package/lib/typescript/Select.d.ts +19 -0
  83. package/lib/typescript/Separator.d.ts +10 -0
  84. package/lib/typescript/Sheet.d.ts +45 -0
  85. package/lib/typescript/Skeleton.d.ts +10 -0
  86. package/lib/typescript/Slider.d.ts +15 -7
  87. package/lib/typescript/Stepper.d.ts +49 -0
  88. package/lib/typescript/Switch.d.ts +19 -12
  89. package/lib/typescript/TabBar.d.ts +18 -6
  90. package/lib/typescript/Textarea.d.ts +6 -0
  91. package/lib/typescript/Toast.d.ts +40 -0
  92. package/lib/typescript/Toggle.d.ts +21 -0
  93. package/lib/typescript/ToggleGroup.d.ts +22 -0
  94. package/lib/typescript/Toolbar.d.ts +35 -0
  95. package/lib/typescript/Tooltip.d.ts +16 -0
  96. package/lib/typescript/glass-provider.d.ts +34 -0
  97. package/lib/typescript/glass-stack.d.ts +54 -0
  98. package/lib/typescript/index.d.ts +38 -17
  99. package/lib/typescript/internal/GlassBackdrop.d.ts +33 -0
  100. package/lib/typescript/internal/GlassView.d.ts +18 -2
  101. package/lib/typescript/internal/blur-community.d.ts +2 -0
  102. package/lib/typescript/internal/blur-community.web.d.ts +2 -0
  103. package/lib/typescript/internal/glass-routing.d.ts +83 -15
  104. package/lib/typescript/internal/initials.d.ts +2 -0
  105. package/lib/typescript/internal/overlay.d.ts +74 -0
  106. package/lib/typescript/internal/primitives.d.ts +11 -0
  107. package/package.json +12 -10
  108. package/src/Accordion.tsx +165 -0
  109. package/src/ActionSheet.tsx +149 -0
  110. package/src/Alert.tsx +85 -0
  111. package/src/AlertDialog.tsx +124 -0
  112. package/src/Avatar.tsx +102 -0
  113. package/src/Badge.tsx +80 -0
  114. package/src/Bars.tsx +10 -807
  115. package/src/Button.tsx +196 -67
  116. package/src/Card.tsx +105 -32
  117. package/src/Checkbox.tsx +98 -0
  118. package/src/Chip.tsx +149 -0
  119. package/src/Collapsible.tsx +66 -0
  120. package/src/ContextMenu.tsx +103 -0
  121. package/src/Dialog.tsx +85 -335
  122. package/src/DropdownMenu.tsx +103 -0
  123. package/src/Field.tsx +65 -0
  124. package/src/Glass.tsx +15 -5
  125. package/src/Group.tsx +98 -0
  126. package/src/IconButton.tsx +110 -0
  127. package/src/Input.tsx +139 -87
  128. package/src/Label.tsx +56 -0
  129. package/src/MorphGroup.tsx +134 -0
  130. package/src/Popover.tsx +81 -0
  131. package/src/Progress.tsx +83 -0
  132. package/src/RadioGroup.tsx +122 -0
  133. package/src/Scrim.tsx +94 -0
  134. package/src/SegmentedControl.tsx +132 -99
  135. package/src/Select.tsx +136 -0
  136. package/src/Separator.tsx +52 -0
  137. package/src/Sheet.tsx +139 -0
  138. package/src/Skeleton.tsx +77 -0
  139. package/src/Slider.tsx +84 -47
  140. package/src/Stepper.tsx +315 -0
  141. package/src/Switch.tsx +81 -73
  142. package/src/TabBar.tsx +106 -93
  143. package/src/Textarea.tsx +34 -0
  144. package/src/Toast.tsx +131 -0
  145. package/src/Toggle.tsx +113 -0
  146. package/src/ToggleGroup.tsx +129 -0
  147. package/src/Toolbar.tsx +111 -0
  148. package/src/Tooltip.tsx +79 -0
  149. package/src/engine/CHANGELOG.md +430 -0
  150. package/src/engine/NOTICE +54 -0
  151. package/src/engine/README.md +975 -0
  152. package/src/engine/android/build.gradle +18 -0
  153. package/src/engine/android/src/main/AndroidManifest.xml +2 -0
  154. package/src/engine/android/src/main/java/expo/modules/liquidglass/ExpoLiquidGlassModule.kt +174 -0
  155. package/src/engine/android/src/main/java/expo/modules/liquidglass/GlassConstants.kt +7 -0
  156. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassContainerView.kt +16 -0
  157. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassProviderView.kt +165 -0
  158. package/src/engine/android/src/main/java/expo/modules/liquidglass/LiquidGlassView.kt +1731 -0
  159. package/src/engine/android/src/main/java/expo/modules/liquidglass/enums/GlassEnums.kt +171 -0
  160. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropGraph.kt +146 -0
  161. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/BackdropSource.kt +53 -0
  162. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ContinuousCorners.kt +188 -0
  163. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/CornerRadii.kt +62 -0
  164. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassAppearance.kt +352 -0
  165. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassDebug.kt +109 -0
  166. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassEnvironment.kt +139 -0
  167. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassHdr.kt +85 -0
  168. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassLuminanceProbe.kt +189 -0
  169. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassPressAnimator.kt +264 -0
  170. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassProgressiveBlur.kt +249 -0
  171. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderCache.kt +256 -0
  172. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassShaderSource.kt +845 -0
  173. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/GlassTier.kt +63 -0
  174. package/src/engine/android/src/main/java/expo/modules/liquidglass/glass/ProviderRegistry.kt +71 -0
  175. package/src/engine/android/src/main/java/expo/modules/liquidglass/records/GlassRecords.kt +288 -0
  176. package/src/engine/index.ts +24 -0
  177. package/src/engine/ios/Enums/GlassBlurDirection.swift +21 -0
  178. package/src/engine/ios/Enums/GlassVariant.swift +86 -0
  179. package/src/engine/ios/ExpoLiquidGlass.podspec +93 -0
  180. package/src/engine/ios/ExpoLiquidGlassModule.swift +77 -0
  181. package/src/engine/ios/Glass/BackdropCapturer.swift +811 -0
  182. package/src/engine/ios/Glass/ContinuousCorners.swift +165 -0
  183. package/src/engine/ios/Glass/GlassBackdrop.swift +176 -0
  184. package/src/engine/ios/Glass/GlassFramePhase.swift +126 -0
  185. package/src/engine/ios/Glass/GlassFrameScheduler.swift +261 -0
  186. package/src/engine/ios/Glass/GlassPressAnimator.swift +250 -0
  187. package/src/engine/ios/Glass/GlassRenderContext.swift +168 -0
  188. package/src/engine/ios/Glass/GlassRenderer.swift +186 -0
  189. package/src/engine/ios/Glass/GlassSurfaceView.swift +452 -0
  190. package/src/engine/ios/Glass/NonRenderableView.swift +54 -0
  191. package/src/engine/ios/Glass/StripCache.swift +545 -0
  192. package/src/engine/ios/Records/GlassCornerRadii.swift +79 -0
  193. package/src/engine/ios/Records/GlassMetalOptions.swift +180 -0
  194. package/src/engine/ios/Records/GlassRefractionCurve.swift +14 -0
  195. package/src/engine/ios/Shaders/LiquidGlass.metal +480 -0
  196. package/src/engine/ios/Shaders/bundle-marker.txt +6 -0
  197. package/src/engine/ios/Views/LiquidGlassContainerView.swift +99 -0
  198. package/src/engine/ios/Views/LiquidGlassView.swift +859 -0
  199. package/src/engine/package.json +70 -0
  200. package/src/engine/src/components/LiquidGlassButton/LiquidGlassButton.tsx +424 -0
  201. package/src/engine/src/components/LiquidGlassCard/LiquidGlassCard.tsx +98 -0
  202. package/src/engine/src/components/LiquidGlassChip/LiquidGlassChip.tsx +65 -0
  203. package/src/engine/src/components/LiquidGlassGroup/LiquidGlassGroup.tsx +350 -0
  204. package/src/engine/src/components/LiquidGlassIconButton/LiquidGlassIconButton.tsx +24 -0
  205. package/src/engine/src/components/LiquidGlassMorphGroup/LiquidGlassMorphGroup.tsx +434 -0
  206. package/src/engine/src/components/LiquidGlassScrim/LiquidGlassScrim.tsx +100 -0
  207. package/src/engine/src/components/LiquidGlassSegmentedControl/LiquidGlassSegmentedControl.tsx +213 -0
  208. package/src/engine/src/components/LiquidGlassSheet/LiquidGlassSheet.tsx +218 -0
  209. package/src/engine/src/components/LiquidGlassSlider/LiquidGlassSlider.tsx +327 -0
  210. package/src/engine/src/components/LiquidGlassStepper/LiquidGlassStepper.tsx +321 -0
  211. package/src/engine/src/components/LiquidGlassSwitch/LiquidGlassSwitch.tsx +296 -0
  212. package/src/engine/src/components/LiquidGlassTabBar/LiquidGlassTabBar.tsx +952 -0
  213. package/src/engine/src/components/LiquidGlassTextInput/LiquidGlassTextInput.tsx +151 -0
  214. package/src/engine/src/components/LiquidGlassToast/LiquidGlassToast.tsx +169 -0
  215. package/src/engine/src/components/LiquidGlassToolbar/LiquidGlassToolbar.tsx +124 -0
  216. package/src/engine/src/components/index.ts +16 -0
  217. package/src/engine/src/constants/index.ts +4 -0
  218. package/src/engine/src/constants/metal.constants.ts +327 -0
  219. package/src/engine/src/constants/metrics.constants.ts +325 -0
  220. package/src/engine/src/constants/springs.constants.ts +107 -0
  221. package/src/engine/src/constants/styles.constants.ts +12 -0
  222. package/src/engine/src/context/glass-group.context.ts +65 -0
  223. package/src/engine/src/context/index.ts +6 -0
  224. package/src/engine/src/core/components/LiquidGlassContainer/LiquidGlassContainer.tsx +32 -0
  225. package/src/engine/src/core/components/LiquidGlassContainer/index.ts +1 -0
  226. package/src/engine/src/core/components/LiquidGlassProvider/LiquidGlassProvider.tsx +66 -0
  227. package/src/engine/src/core/components/LiquidGlassProvider/index.ts +1 -0
  228. package/src/engine/src/core/components/LiquidGlassStack/LiquidGlassStack.tsx +184 -0
  229. package/src/engine/src/core/components/LiquidGlassStack/index.ts +1 -0
  230. package/src/engine/src/core/components/LiquidGlassView/LiquidGlassView.tsx +126 -0
  231. package/src/engine/src/core/components/LiquidGlassView/index.ts +1 -0
  232. package/src/engine/src/core/components/index.ts +4 -0
  233. package/src/engine/src/core/constants/glass.constants.ts +57 -0
  234. package/src/engine/src/core/constants/index.ts +20 -0
  235. package/src/engine/src/core/constants/native.constants.ts +16 -0
  236. package/src/engine/src/core/context/glass-stack.context.ts +30 -0
  237. package/src/engine/src/core/context/index.ts +4 -0
  238. package/src/engine/src/core/enum/index.ts +12 -0
  239. package/src/engine/src/core/index.ts +1 -0
  240. package/src/engine/src/core/interfaces/glass-hdr.interface.ts +15 -0
  241. package/src/engine/src/core/interfaces/glass-metal.interface.ts +248 -0
  242. package/src/engine/src/core/interfaces/glass-surface.interface.ts +9 -0
  243. package/src/engine/src/core/interfaces/index.ts +31 -0
  244. package/src/engine/src/core/interfaces/liquid-glass-container.interface.ts +6 -0
  245. package/src/engine/src/core/interfaces/liquid-glass-provider.interface.ts +14 -0
  246. package/src/engine/src/core/interfaces/liquid-glass-stack.interface.ts +21 -0
  247. package/src/engine/src/core/interfaces/liquid-glass-view.interface.ts +129 -0
  248. package/src/engine/src/core/interfaces/native-liquid-glass-view.interface.ts +19 -0
  249. package/src/engine/src/core/modules/ExpoLiquidGlassModule.ts +26 -0
  250. package/src/engine/src/core/modules/index.ts +2 -0
  251. package/src/engine/src/core/root/index.ts +51 -0
  252. package/src/engine/src/core/types/glass.types.ts +25 -0
  253. package/src/engine/src/core/types/index.ts +8 -0
  254. package/src/engine/src/core/utils/debug.utils.ts +17 -0
  255. package/src/engine/src/core/utils/dev-warn.utils.ts +17 -0
  256. package/src/engine/src/core/utils/hdr.utils.ts +37 -0
  257. package/src/engine/src/core/utils/index.ts +5 -0
  258. package/src/engine/src/core/utils/native-view.utils.ts +33 -0
  259. package/src/engine/src/core/utils/platform.utils.ts +34 -0
  260. package/src/engine/src/core/views/NativeGlassBackdropView.ts +24 -0
  261. package/src/engine/src/core/views/NativeLiquidGlassContainerView.ts +13 -0
  262. package/src/engine/src/core/views/NativeLiquidGlassContainerView.web.ts +10 -0
  263. package/src/engine/src/core/views/NativeLiquidGlassProviderView.ts +13 -0
  264. package/src/engine/src/core/views/NativeLiquidGlassProviderView.web.ts +10 -0
  265. package/src/engine/src/core/views/NativeLiquidGlassView.ts +19 -0
  266. package/src/engine/src/core/views/NativeLiquidGlassView.web.ts +14 -0
  267. package/src/engine/src/core/views/index.ts +4 -0
  268. package/src/engine/src/hooks/index.ts +18 -0
  269. package/src/engine/src/hooks/use-adaptive-glass.ts +91 -0
  270. package/src/engine/src/hooks/use-damped-drag.ts +332 -0
  271. package/src/engine/src/hooks/use-echo-filter.ts +55 -0
  272. package/src/engine/src/hooks/use-glass-group-member.ts +169 -0
  273. package/src/engine/src/hooks/use-gravity-highlight.ts +79 -0
  274. package/src/engine/src/hooks/use-press-progress.ts +44 -0
  275. package/src/engine/src/index.ts +120 -0
  276. package/src/engine/src/interfaces/index.ts +28 -0
  277. package/src/engine/src/interfaces/liquid-glass-button.interface.ts +94 -0
  278. package/src/engine/src/interfaces/liquid-glass-card.interface.ts +40 -0
  279. package/src/engine/src/interfaces/liquid-glass-chip.interface.ts +29 -0
  280. package/src/engine/src/interfaces/liquid-glass-group.interface.ts +32 -0
  281. package/src/engine/src/interfaces/liquid-glass-icon-button.interface.ts +19 -0
  282. package/src/engine/src/interfaces/liquid-glass-morph-group.interface.ts +59 -0
  283. package/src/engine/src/interfaces/liquid-glass-scrim.interface.ts +36 -0
  284. package/src/engine/src/interfaces/liquid-glass-segmented-control.interface.ts +32 -0
  285. package/src/engine/src/interfaces/liquid-glass-sheet.interface.ts +38 -0
  286. package/src/engine/src/interfaces/liquid-glass-slider.interface.ts +37 -0
  287. package/src/engine/src/interfaces/liquid-glass-stepper.interface.ts +35 -0
  288. package/src/engine/src/interfaces/liquid-glass-switch.interface.ts +27 -0
  289. package/src/engine/src/interfaces/liquid-glass-tab-bar.interface.ts +116 -0
  290. package/src/engine/src/interfaces/liquid-glass-text-input.interface.ts +42 -0
  291. package/src/engine/src/interfaces/liquid-glass-toast.interface.ts +36 -0
  292. package/src/engine/src/interfaces/liquid-glass-toolbar.interface.ts +33 -0
  293. package/src/engine/src/theme/glass-ui-theme.ts +100 -0
  294. package/src/engine/src/theme/index.ts +2 -0
  295. package/src/engine/src/utils/button-press.utils.ts +63 -0
  296. package/src/engine/src/utils/index.ts +3 -0
  297. package/src/engine/src/utils/metal.utils.ts +164 -0
  298. package/src/glass-provider.tsx +60 -0
  299. package/src/glass-stack.tsx +115 -0
  300. package/src/index.ts +47 -190
  301. package/src/internal/GlassBackdrop.tsx +60 -0
  302. package/src/internal/GlassView.tsx +53 -18
  303. package/src/internal/blur-community.ts +19 -0
  304. package/src/internal/blur-community.web.ts +7 -0
  305. package/src/internal/blur.ts +7 -8
  306. package/src/internal/glass-routing.ts +212 -34
  307. package/src/internal/initials.ts +7 -0
  308. package/src/internal/overlay.tsx +258 -0
  309. package/src/internal/primitives.ts +23 -0
  310. package/lib/module/Carousel.js +0 -103
  311. package/lib/module/Display.js +0 -318
  312. package/lib/module/Feedback.js +0 -395
  313. package/lib/module/Form.js +0 -160
  314. package/lib/module/Forms2.js +0 -471
  315. package/lib/module/Message.js +0 -84
  316. package/lib/module/Overlays.js +0 -344
  317. package/lib/module/Pickers.js +0 -243
  318. package/lib/module/Table.js +0 -100
  319. package/lib/module/ai.js +0 -283
  320. package/lib/module/charts/AreaChart.js +0 -32
  321. package/lib/module/charts/BarChart.js +0 -75
  322. package/lib/module/charts/FunnelChart.js +0 -50
  323. package/lib/module/charts/HeatmapChart.js +0 -71
  324. package/lib/module/charts/LineChart.js +0 -81
  325. package/lib/module/charts/PlotChart.js +0 -52
  326. package/lib/module/charts/RadarChart.js +0 -78
  327. package/lib/module/charts/RingChart.js +0 -52
  328. package/lib/module/charts/ScatterChart.js +0 -95
  329. package/lib/module/charts/WaterfallChart.js +0 -85
  330. package/lib/module/charts/advanced.js +0 -313
  331. package/lib/module/charts/extra.js +0 -108
  332. package/lib/module/charts/index.js +0 -50
  333. package/lib/module/charts/scales.js +0 -140
  334. package/lib/typescript/Carousel.d.ts +0 -47
  335. package/lib/typescript/Display.d.ts +0 -178
  336. package/lib/typescript/Feedback.d.ts +0 -196
  337. package/lib/typescript/Form.d.ts +0 -97
  338. package/lib/typescript/Forms2.d.ts +0 -209
  339. package/lib/typescript/Message.d.ts +0 -67
  340. package/lib/typescript/Overlays.d.ts +0 -146
  341. package/lib/typescript/Pickers.d.ts +0 -105
  342. package/lib/typescript/Table.d.ts +0 -64
  343. package/lib/typescript/ai.d.ts +0 -166
  344. package/lib/typescript/charts/AreaChart.d.ts +0 -44
  345. package/lib/typescript/charts/BarChart.d.ts +0 -19
  346. package/lib/typescript/charts/FunnelChart.d.ts +0 -25
  347. package/lib/typescript/charts/HeatmapChart.d.ts +0 -23
  348. package/lib/typescript/charts/LineChart.d.ts +0 -30
  349. package/lib/typescript/charts/PlotChart.d.ts +0 -31
  350. package/lib/typescript/charts/RadarChart.d.ts +0 -27
  351. package/lib/typescript/charts/RingChart.d.ts +0 -28
  352. package/lib/typescript/charts/ScatterChart.d.ts +0 -34
  353. package/lib/typescript/charts/WaterfallChart.d.ts +0 -22
  354. package/lib/typescript/charts/advanced.d.ts +0 -107
  355. package/lib/typescript/charts/extra.d.ts +0 -63
  356. package/lib/typescript/charts/index.d.ts +0 -13
  357. package/lib/typescript/charts/scales.d.ts +0 -35
  358. package/src/Carousel.tsx +0 -233
  359. package/src/Display.tsx +0 -781
  360. package/src/Feedback.tsx +0 -992
  361. package/src/Form.tsx +0 -445
  362. package/src/Forms2.tsx +0 -1055
  363. package/src/Message.tsx +0 -218
  364. package/src/Overlays.tsx +0 -704
  365. package/src/Pickers.tsx +0 -595
  366. package/src/Table.tsx +0 -232
  367. package/src/ai.tsx +0 -715
  368. package/src/charts/AreaChart.tsx +0 -73
  369. package/src/charts/BarChart.tsx +0 -221
  370. package/src/charts/FunnelChart.tsx +0 -125
  371. package/src/charts/HeatmapChart.tsx +0 -155
  372. package/src/charts/LineChart.tsx +0 -247
  373. package/src/charts/PlotChart.tsx +0 -168
  374. package/src/charts/RadarChart.tsx +0 -208
  375. package/src/charts/RingChart.tsx +0 -133
  376. package/src/charts/ScatterChart.tsx +0 -223
  377. package/src/charts/WaterfallChart.tsx +0 -201
  378. package/src/charts/advanced.tsx +0 -676
  379. package/src/charts/extra.tsx +0 -242
  380. package/src/charts/index.ts +0 -86
  381. package/src/charts/scales.ts +0 -163
package/src/Bars.tsx CHANGED
@@ -1,807 +1,10 @@
1
- import { forwardRef, useState, type ReactNode } from "react";
2
- import type { StyleProp, TextStyle, ViewStyle } from "react-native";
3
-
4
- import { Glass } from "./Glass";
5
- import { Button } from "./Button";
6
- import { Text } from "./Text";
7
- import { colors, radii } from "./internal/tokens";
8
- import { primitives } from "./internal/primitives";
9
- import { useIsDark, useSpring } from "./internal/motion";
10
-
11
- // ---------------------------------------------------------------------------
12
- // SearchBar
13
-
14
- export interface SearchBarProps {
15
- /** Controlled text. Omit and the bar keeps its own. */
16
- value?: string;
17
- defaultValue?: string;
18
- onChangeText?: (text: string) => void;
19
- onSubmit?: (text: string) => void;
20
- placeholder?: string;
21
- /** Shows a cancel button beside the field while it holds text or focus. */
22
- showCancel?: boolean;
23
- onCancel?: () => void;
24
- accessibilityLabel?: string;
25
- style?: StyleProp<ViewStyle>;
26
- isDark?: boolean;
27
- testID?: string;
28
- }
29
-
30
- /**
31
- * A search field for a bar or a screen header.
32
- *
33
- * Distinct from NativeAIInput: that is an AI composer with send semantics, this
34
- * is ordinary app search — magnifier, themed placeholder, and a clear button
35
- * once there is something to clear.
36
- */
37
- export const SearchBar = forwardRef<any, SearchBarProps>(function SearchBar(
38
- {
39
- value: valueProp,
40
- defaultValue = "",
41
- onChangeText,
42
- onSubmit,
43
- placeholder = "Search",
44
- showCancel = false,
45
- onCancel,
46
- accessibilityLabel = "Search",
47
- style,
48
- isDark: isDarkProp,
49
- testID,
50
- ...props
51
- },
52
- ref,
53
- ) {
54
- const isDark = useIsDark(isDarkProp);
55
- const theme = isDark ? colors.dark : colors.light;
56
- const { View, Text: RNText, TextInput, Pressable } = primitives();
57
-
58
- const [internal, setInternal] = useState(defaultValue);
59
- const value = valueProp !== undefined ? valueProp : internal;
60
-
61
- const handleChange = (next: string) => {
62
- if (valueProp === undefined) setInternal(next);
63
- onChangeText?.(next);
64
- };
65
-
66
- const clear = () => handleChange("");
67
-
68
- return (
69
- <View
70
- ref={ref}
71
- testID={testID}
72
- style={[{ flexDirection: "row", alignItems: "center", gap: 8 }, style as ViewStyle]}
73
- {...props}
74
- >
75
- <Glass
76
- effect="regular"
77
- surface="field"
78
- isDark={isDark}
79
- style={{
80
- flex: 1,
81
- flexDirection: "row",
82
- alignItems: "center",
83
- gap: 8,
84
- height: 36,
85
- borderRadius: radii.pill,
86
- paddingHorizontal: 12,
87
- }}
88
- >
89
- <RNText accessibilityElementsHidden importantForAccessibility="no" style={{ fontSize: 14, color: theme.muted }}>
90
- {"\u2315"}
91
- </RNText>
92
- <View style={{ flex: 1, justifyContent: "center" }}>
93
- {!value && placeholder ? (
94
- // Themed placeholder: the OS default colour ignores the theme.
95
- <RNText
96
- pointerEvents="none"
97
- numberOfLines={1}
98
- style={{ position: "absolute", left: 0, fontSize: 15, color: theme.muted }}
99
- >
100
- {placeholder}
101
- </RNText>
102
- ) : null}
103
- <TextInput
104
- accessibilityRole="search"
105
- accessibilityLabel={accessibilityLabel}
106
- value={value}
107
- onChangeText={handleChange}
108
- onSubmitEditing={() => onSubmit?.(value)}
109
- returnKeyType="search"
110
- autoCorrect={false}
111
- placeholder=""
112
- style={{
113
- fontSize: 15,
114
- paddingVertical: 4,
115
- color: theme.foreground,
116
- // Transparent: the themed placeholder above provides the hint.
117
- backgroundColor: "transparent",
118
- }}
119
- />
120
- </View>
121
- {value.length > 0 && (
122
- <Pressable
123
- accessibilityRole="button"
124
- accessibilityLabel="Clear search"
125
- onPress={clear}
126
- hitSlop={8}
127
- >
128
- <View
129
- style={{
130
- width: 16,
131
- height: 16,
132
- // A circle from its own size: half the 16pt box.
133
- borderRadius: 16 / 2,
134
- backgroundColor: theme.separator,
135
- alignItems: "center",
136
- justifyContent: "center",
137
- }}
138
- >
139
- <RNText style={{ fontSize: 10, color: theme.muted }}>{"\u00D7"}</RNText>
140
- </View>
141
- </Pressable>
142
- )}
143
- </Glass>
144
- {showCancel && (
145
- <Pressable
146
- accessibilityRole="button"
147
- accessibilityLabel="Cancel"
148
- onPress={() => {
149
- clear();
150
- onCancel?.();
151
- }}
152
- >
153
- <RNText style={{ fontSize: 15, color: theme.fill }}>Cancel</RNText>
154
- </Pressable>
155
- )}
156
- </View>
157
- );
158
- });
159
-
160
- // ---------------------------------------------------------------------------
161
- // Chip
162
-
163
- export interface ChipProps {
164
- label: string;
165
- icon?: ReactNode;
166
- /** Shows a close affordance; called when it is pressed. */
167
- onClose?: () => void;
168
- /** Tapping the chip. Omit to make it a static tag. */
169
- onPress?: () => void;
170
- /** Controlled selection. Omit for a plain tag with no selected state. */
171
- selected?: boolean;
172
- defaultSelected?: boolean;
173
- onSelectedChange?: (selected: boolean) => void;
174
- disabled?: boolean;
175
- style?: StyleProp<ViewStyle>;
176
- isDark?: boolean;
177
- testID?: string;
178
- }
179
-
180
- /**
181
- * A filter or tag pill.
182
- *
183
- * Selected state is a glass pill tinted with `glassActive` — the same selected
184
- * treatment SegmentedControl and TabBar use, rather than a new colour.
185
- */
186
- export const Chip = forwardRef<any, ChipProps>(function Chip(
187
- {
188
- label,
189
- icon,
190
- onClose,
191
- onPress,
192
- selected: selectedProp,
193
- defaultSelected = false,
194
- onSelectedChange,
195
- disabled = false,
196
- style,
197
- isDark: isDarkProp,
198
- testID,
199
- ...props
200
- },
201
- ref,
202
- ) {
203
- const isDark = useIsDark(isDarkProp);
204
- const theme = isDark ? colors.dark : colors.light;
205
- const { View, Text: RNText, Pressable } = primitives();
206
-
207
- const [internalSelected, setInternalSelected] = useState(defaultSelected);
208
- const [held, setHeld] = useState(false);
209
- const selected = selectedProp !== undefined ? selectedProp : internalSelected;
210
- const selectable = selectedProp !== undefined || onSelectedChange !== undefined || defaultSelected;
211
-
212
- const handlePress = () => {
213
- if (disabled) return;
214
- if (selectable) {
215
- const next = !selected;
216
- if (selectedProp === undefined) setInternalSelected(next);
217
- onSelectedChange?.(next);
218
- }
219
- onPress?.();
220
- };
221
-
222
- const pill = (
223
- <Glass
224
- effect="regular"
225
- surface="control"
226
- pressed={held}
227
- isDark={isDark}
228
- tintColor={selected ? theme.glassActive : undefined}
229
- interactive={!disabled}
230
- style={{
231
- flexDirection: "row",
232
- alignItems: "center",
233
- gap: 6,
234
- height: 34,
235
- paddingHorizontal: 12,
236
- borderRadius: radii.pill,
237
- opacity: disabled ? 0.38 : 1,
238
- ...(style as ViewStyle),
239
- }}
240
- >
241
- {icon ? <View>{icon}</View> : null}
242
- <RNText
243
- numberOfLines={1}
244
- style={{ fontSize: 14, fontWeight: selected ? "600" : "500", color: selected ? theme.foreground : theme.muted }}
245
- >
246
- {label}
247
- </RNText>
248
- {onClose && (
249
- <Pressable
250
- accessibilityRole="button"
251
- accessibilityLabel={`Remove ${label}`}
252
- onPress={onClose}
253
- hitSlop={8}
254
- >
255
- <RNText style={{ fontSize: 11, color: theme.muted }}>{"\u00D7"}</RNText>
256
- </Pressable>
257
- )}
258
- </Glass>
259
- );
260
-
261
- if (!onPress && !selectable) {
262
- return (
263
- <View ref={ref} testID={testID} accessibilityRole="text" accessibilityLabel={label} {...props}>
264
- {pill}
265
- </View>
266
- );
267
- }
268
-
269
- return (
270
- <Pressable
271
- ref={ref}
272
- testID={testID}
273
- accessibilityRole="button"
274
- accessibilityLabel={label}
275
- accessibilityState={{ selected: selectable ? selected : undefined, disabled }}
276
- disabled={disabled}
277
- onPress={handlePress}
278
- {...props}
279
- >
280
- {pill}
281
- </Pressable>
282
- );
283
- });
284
-
285
- // ---------------------------------------------------------------------------
286
- // FAB
287
-
288
- export interface FABProps {
289
- onPress: () => void;
290
- /** Required: an icon-only circle has no text to announce. */
291
- accessibilityLabel: string;
292
- /** The icon. When a label string is also supplied, the FAB is extended. */
293
- icon?: ReactNode;
294
- /** Turns the circle into an extended pill with visible text. */
295
- label?: string;
296
- size?: "md" | "lg";
297
- disabled?: boolean;
298
- style?: StyleProp<ViewStyle>;
299
- isDark?: boolean;
300
- testID?: string;
301
- }
302
-
303
- const fabSizes = { md: 56, lg: 64 };
304
-
305
- /**
306
- * The floating action button.
307
- *
308
- * The flagship glass circle of the library: a round `Glass` with `interactive`
309
- * so the material itself responds to touch. The caller positions it; the
310
- * component does not assume an edge.
311
- */
312
- export const FAB = forwardRef<any, FABProps>(function FAB(
313
- {
314
- onPress,
315
- accessibilityLabel,
316
- icon,
317
- label,
318
- size = "md",
319
- disabled = false,
320
- style,
321
- isDark: isDarkProp,
322
- testID,
323
- ...props
324
- },
325
- ref,
326
- ) {
327
- const isDark = useIsDark(isDarkProp);
328
- const theme = isDark ? colors.dark : colors.light;
329
- const { View, Text: RNText, Pressable } = primitives();
330
-
331
- const dimension = fabSizes[size];
332
- const extended = Boolean(label);
333
-
334
- return (
335
- <Pressable
336
- ref={ref}
337
- testID={testID}
338
- accessibilityRole="button"
339
- accessibilityLabel={accessibilityLabel}
340
- accessibilityState={{ disabled }}
341
- disabled={disabled}
342
- onPress={disabled ? undefined : onPress}
343
- style={({ pressed }: { pressed: boolean }) => ({
344
- alignSelf: "flex-start",
345
- opacity: disabled ? 0.38 : pressed ? 0.85 : 1,
346
- })}
347
- {...props}
348
- >
349
- <Glass
350
- effect="clear"
351
- surface="control"
352
- interactive={!disabled}
353
- isDark={isDark}
354
- style={{
355
- height: dimension,
356
- width: extended ? undefined : dimension,
357
- minWidth: dimension,
358
- borderRadius: extended ? dimension / 2 : dimension / 2,
359
- paddingHorizontal: extended ? 20 : 0,
360
- flexDirection: "row",
361
- alignItems: "center",
362
- justifyContent: "center",
363
- gap: 8,
364
- ...(style as ViewStyle),
365
- }}
366
- >
367
- {icon ? <View>{icon}</View> : null}
368
- {label ? (
369
- <RNText style={{ fontSize: 15, fontWeight: "600", color: theme.foreground }} numberOfLines={1}>
370
- {label}
371
- </RNText>
372
- ) : null}
373
- </Glass>
374
- </Pressable>
375
- );
376
- });
377
-
378
- // ---------------------------------------------------------------------------
379
- // IconButton
380
-
381
- export interface IconButtonProps {
382
- /** Required: the icon carries no text of its own. */
383
- accessibilityLabel: string;
384
- onPress: () => void;
385
- icon: ReactNode;
386
- size?: "sm" | "md" | "lg";
387
- variant?: "glass" | "ghost";
388
- disabled?: boolean;
389
- style?: StyleProp<ViewStyle>;
390
- isDark?: boolean;
391
- testID?: string;
392
- }
393
-
394
- const iconButtonSizes = { sm: 28, md: 36, lg: 44 };
395
-
396
- /**
397
- * An icon-only button on glass.
398
- *
399
- * Button takes an icon alongside a label; this is the icon-only form, which
400
- * every kit ships for toolbars and bar actions.
401
- */
402
- export const IconButton = forwardRef<any, IconButtonProps>(function IconButton(
403
- {
404
- accessibilityLabel,
405
- onPress,
406
- icon,
407
- size = "md",
408
- variant = "glass",
409
- disabled = false,
410
- style,
411
- isDark: isDarkProp,
412
- testID,
413
- ...props
414
- },
415
- ref,
416
- ) {
417
- const isDark = useIsDark(isDarkProp);
418
- const theme = isDark ? colors.dark : colors.light;
419
- const { View, Pressable } = primitives();
420
- const dimension = iconButtonSizes[size];
421
-
422
- return (
423
- <Pressable
424
- ref={ref}
425
- testID={testID}
426
- accessibilityRole="button"
427
- accessibilityLabel={accessibilityLabel}
428
- accessibilityState={{ disabled }}
429
- disabled={disabled}
430
- onPress={disabled ? undefined : onPress}
431
- style={({ pressed }: { pressed: boolean }) => ({ opacity: disabled ? 0.38 : pressed ? 0.8 : 1 })}
432
- {...props}
433
- >
434
- <Glass
435
- effect={variant === "ghost" ? "none" : "regular"}
436
- surface="control"
437
- interactive={!disabled && variant !== "ghost"}
438
- isDark={isDark}
439
- style={{
440
- width: dimension,
441
- height: dimension,
442
- borderRadius: dimension / 2,
443
- alignItems: "center",
444
- justifyContent: "center",
445
- backgroundColor: variant === "ghost" ? "transparent" : undefined,
446
- ...(style as ViewStyle),
447
- }}
448
- >
449
- <View style={{ width: dimension * 0.5, height: dimension * 0.5, alignItems: "center", justifyContent: "center" }}>
450
- {icon}
451
- </View>
452
- </Glass>
453
- </Pressable>
454
- );
455
- });
456
-
457
- // ---------------------------------------------------------------------------
458
- // AppBar
459
-
460
- export interface AppBarAction {
461
- /** Announced to screen readers; the icon is decorative. */
462
- accessibilityLabel: string;
463
- icon: ReactNode;
464
- onPress: () => void;
465
- disabled?: boolean;
466
- }
467
-
468
- export interface AppBarProps {
469
- title: string;
470
- /** Optional second line under the title. */
471
- subtitle?: string;
472
- /** A back or menu action at the leading edge. */
473
- leading?: AppBarAction;
474
- /** Actions at the trailing edge. */
475
- actions?: AppBarAction[];
476
- /**
477
- * The caller's safe-area inset above the bar. Glacia takes it as a prop
478
- * rather than adding a native insets dependency: on a device the app already
479
- * knows its insets, and passing a number keeps this component dependency-free.
480
- */
481
- topInset?: number;
482
- /**
483
- * Whether content has scrolled under the bar.
484
- *
485
- * iOS bars sit quiet at the top of a screen and gain a defined edge once
486
- * content passes beneath them, so the bar reads as a layer over the content
487
- * rather than as part of it. Wire this to a ScrollView's scroll offset — see
488
- * the component's documentation for the two-line version.
489
- */
490
- scrolled?: boolean;
491
- style?: StyleProp<ViewStyle>;
492
- isDark?: boolean;
493
- testID?: string;
494
- }
495
-
496
- /**
497
- * The top bar.
498
- *
499
- * A glass bar across the top of the screen with a leading action, a title and
500
- * trailing actions — the counterpart to the existing bottom TabBar.
501
- *
502
- * `scrolled` mirrors iOS 26's scroll-edge effect. At the top of the screen the
503
- * bar is quiet: its bottom edge is invisible and the glass blends into the
504
- * content above it. Once content has scrolled under it, the edge token becomes
505
- * visible and the surface reads as a distinct layer — the change iOS makes when
506
- * a navigation bar starts floating over scrolled content.
507
- *
508
- * ```
509
- * const [scrolled, setScrolled] = useState(false);
510
- * <ScrollView onScroll={(e) => setScrolled(e.nativeEvent.contentOffset.y > 8)}
511
- * scrollEventThrottle={16}>{...}</ScrollView>
512
- * <AppBar title="Inbox" scrolled={scrolled} />
513
- * ```
514
- */
515
- export const AppBar = forwardRef<any, AppBarProps>(function AppBar(
516
- {
517
- title,
518
- subtitle,
519
- leading,
520
- actions,
521
- topInset = 0,
522
- scrolled = false,
523
- style,
524
- isDark: isDarkProp,
525
- testID,
526
- ...props
527
- },
528
- ref,
529
- ) {
530
- const isDark = useIsDark(isDarkProp);
531
- const theme = isDark ? colors.dark : colors.light;
532
- const { View, Text: RNText, Pressable } = primitives();
533
- const actionCount = actions?.length ?? 0;
534
-
535
- const renderAction = (action: AppBarAction, key: string) => (
536
- <Pressable
537
- key={key}
538
- accessibilityRole="button"
539
- accessibilityLabel={action.accessibilityLabel}
540
- accessibilityState={{ disabled: action.disabled }}
541
- disabled={action.disabled}
542
- onPress={action.disabled ? undefined : action.onPress}
543
- hitSlop={6}
544
- style={{ padding: 6, opacity: action.disabled ? 0.38 : 1 }}
545
- >
546
- {action.icon}
547
- </Pressable>
548
- );
549
-
550
- return (
551
- <Glass
552
- ref={ref}
553
- effect="regular"
554
- surface="rail"
555
- isDark={isDark}
556
- testID={testID}
557
- style={{
558
- borderRadius: 0,
559
- borderTopWidth: 0,
560
- borderLeftWidth: 0,
561
- borderRightWidth: 0,
562
- // Quiet at the top of a screen, defined once content is under it: the
563
- // bottom edge is the difference iOS draws on a scrolled navigation bar.
564
- ...(scrolled ? { borderBottomWidth: 0.5, borderBottomColor: theme.edge } : { borderBottomWidth: 0 }),
565
- ...(style as ViewStyle),
566
- }}
567
- {...props}
568
- >
569
- <View
570
- style={{
571
- paddingTop: topInset,
572
- paddingHorizontal: 8,
573
- paddingBottom: 8,
574
- flexDirection: "row",
575
- alignItems: "center",
576
- gap: 4,
577
- minHeight: 44 + topInset,
578
- }}
579
- >
580
- {leading ? renderAction(leading, "leading") : <View style={{ width: 8 }} />}
581
- <View style={{ flex: 1, paddingHorizontal: 4 }}>
582
- <RNText
583
- accessibilityRole="header"
584
- numberOfLines={1}
585
- style={{ fontSize: 17, fontWeight: "600", color: theme.foreground }}
586
- >
587
- {title}
588
- </RNText>
589
- {subtitle ? (
590
- <RNText numberOfLines={1} style={{ fontSize: 12, color: theme.muted }}>
591
- {subtitle}
592
- </RNText>
593
- ) : null}
594
- </View>
595
- {actions && actionCount > 0 ? (
596
- <View style={{ flexDirection: "row", alignItems: "center" }}>
597
- {actions.map((action, index) => renderAction(action, `action-${index}`))}
598
- </View>
599
- ) : null}
600
- </View>
601
- </Glass>
602
- );
603
- });
604
-
605
- // ---------------------------------------------------------------------------
606
- // FABGroup
607
-
608
- export interface FABGroupAction {
609
- /** A leading node, typically an SVG icon the caller supplies. */
610
- icon: ReactNode;
611
- /** The action's name, shown on its mini button. */
612
- label: string;
613
- onPress: () => void;
614
- }
615
-
616
- export interface FABGroupProps {
617
- /** The actions, listed top to bottom as they appear when expanded. */
618
- actions: FABGroupAction[];
619
- /** The icon on the main button. Rotates 45° while open. */
620
- icon: ReactNode;
621
- /** The icon on the main button while open. Defaults to the closed one. */
622
- closeIcon?: ReactNode;
623
- /** Controlled open state. Omit and the group keeps its own. */
624
- open?: boolean;
625
- defaultOpen?: boolean;
626
- onOpenChange?: (open: boolean) => void;
627
- /** The main button's accessible name. */
628
- accessibilityLabel?: string;
629
- size?: "md" | "lg";
630
- style?: StyleProp<ViewStyle>;
631
- isDark?: boolean;
632
- testID?: string;
633
- }
634
-
635
- // The main button's size, and the mini buttons' — both from the size scale so
636
- // a mini button is never a hand-tuned multiple of the main one.
637
- const fabGroupSizes = {
638
- md: { main: 56, mini: 44 },
639
- lg: { main: 64, mini: 52 },
640
- };
641
-
642
- /**
643
- * A main button that expands into a stack of labelled mini buttons.
644
- *
645
- * The pattern Paper calls `FAB.Group`: one floating button stands in for a set
646
- * of actions until it is opened, then the actions appear above it, each on its
647
- * own glass pill with a label. A scrim behind them takes the next press and
648
- * closes the group, which is how a floating action set gets out of the way
649
- * without a dismissal button.
650
- *
651
- * The mini buttons rise on the bouncy spring with a small stagger, and the main
652
- * button's icon rotates 45° — both settle instantly under Reduce Motion.
653
- *
654
- * **Merging is an iOS 26+ visual effect.** This component is one glass surface
655
- * plus one per action; to have them blend into a single connected surface, put
656
- * the group inside a `GlassContainer` on iOS 26. It works standalone — nothing
657
- * depends on the container — and that composition is left to the caller rather
658
- * than forced, because a group outside a container is the correct rendering on
659
- * every other platform anyway.
660
- */
661
- export const FABGroup = forwardRef<any, FABGroupProps>(function FABGroup(
662
- {
663
- actions,
664
- icon,
665
- closeIcon,
666
- open: openProp,
667
- defaultOpen = false,
668
- onOpenChange,
669
- accessibilityLabel = "More actions",
670
- size = "md",
671
- style,
672
- isDark: isDarkProp,
673
- testID,
674
- ...props
675
- },
676
- ref,
677
- ) {
678
- const isDark = useIsDark(isDarkProp);
679
- const theme = isDark ? colors.dark : colors.light;
680
- const { View, Text: RNText, Pressable, Animated } = primitives();
681
-
682
- const [internalOpen, setInternalOpen] = useState(defaultOpen);
683
- const open = openProp !== undefined ? openProp : internalOpen;
684
-
685
- const setOpen = (next: boolean) => {
686
- if (openProp === undefined) setInternalOpen(next);
687
- onOpenChange?.(next);
688
- };
689
-
690
- // The stack's rise is one value: 0 closed, 1 open. The mini buttons ride it
691
- // with their own stagger, so they follow the lead rather than all snapping
692
- // at once.
693
- const { value: rise, animated } = useSpring(open ? 1 : 0, "bouncy");
694
-
695
- const { main: dimension, mini } = fabGroupSizes[size];
696
- const closeFirst = closeIcon ?? icon;
697
-
698
- const rotate = animated ? rise.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "45deg"] }) : open ? "45deg" : "0deg";
699
-
700
- return (
701
- <View ref={ref} testID={testID} style={style} {...props}>
702
- {open ? (
703
- <Pressable
704
- accessibilityRole="button"
705
- accessibilityLabel="Close actions"
706
- onPress={() => setOpen(false)}
707
- style={{ position: "absolute", top: -2000, left: -2000, right: -2000, bottom: -2000, backgroundColor: theme.scrim }}
708
- />
709
- ) : null}
710
-
711
- <View style={{ alignItems: "flex-end", gap: 10 }}>
712
- {open
713
- ? actions.map((action, index) => {
714
- // Later actions sit higher, so the first is nearest the button.
715
- const order = actions.length - 1 - index;
716
- const translateY = animated
717
- ? rise.interpolate({
718
- inputRange: [0, 1],
719
- outputRange: [24 + order * 18, 0],
720
- })
721
- : 0;
722
- const opacity = animated ? rise.interpolate({ inputRange: [0, 0.4, 1], outputRange: [0, 0, 1] }) : 1;
723
-
724
- const pill = (
725
- <Pressable
726
- accessibilityRole="button"
727
- accessibilityLabel={action.label}
728
- onPress={() => {
729
- setOpen(false);
730
- action.onPress();
731
- }}
732
- style={{ flexDirection: "row", alignItems: "center", gap: 8 }}
733
- >
734
- <Glass
735
- effect="regular"
736
- surface="control"
737
- isDark={isDark}
738
- style={{ borderRadius: radii.pill, paddingHorizontal: 12, paddingVertical: 7 }}
739
- >
740
- <RNText style={{ fontSize: 13, fontWeight: "600", color: theme.foreground }} numberOfLines={1}>
741
- {action.label}
742
- </RNText>
743
- </Glass>
744
- <Glass
745
- effect="regular"
746
- surface="control"
747
- isDark={isDark}
748
- style={{
749
- width: mini,
750
- height: mini,
751
- borderRadius: mini / 2,
752
- alignItems: "center",
753
- justifyContent: "center",
754
- }}
755
- >
756
- {action.icon}
757
- </Glass>
758
- </Pressable>
759
- );
760
-
761
- if (!animated) {
762
- return (
763
- <View key={`${action.label}-${index}`}>{pill}</View>
764
- );
765
- }
766
-
767
- return (
768
- <Animated.View
769
- key={`${action.label}-${index}`}
770
- style={{ transform: [{ translateY }], opacity }}
771
- >
772
- {pill}
773
- </Animated.View>
774
- );
775
- })
776
- : null}
777
-
778
- <Pressable
779
- accessibilityRole="button"
780
- accessibilityLabel={accessibilityLabel}
781
- accessibilityState={{ expanded: open }}
782
- onPress={() => setOpen(!open)}
783
- >
784
- <Glass
785
- effect="clear"
786
- surface="control"
787
- interactive
788
- isDark={isDark}
789
- style={{
790
- width: dimension,
791
- height: dimension,
792
- borderRadius: dimension / 2,
793
- alignItems: "center",
794
- justifyContent: "center",
795
- }}
796
- >
797
- {animated ? (
798
- <Animated.View style={{ transform: [{ rotate }] }}>{open ? closeFirst : icon}</Animated.View>
799
- ) : (
800
- <View>{open ? closeFirst : icon}</View>
801
- )}
802
- </Glass>
803
- </Pressable>
804
- </View>
805
- </View>
806
- );
807
- });
1
+ // Bars, buttons and navigation: the rebuild's entries only.
2
+ //
3
+ // This file used to carry SearchBar, FAB and FABGroup as well. They were old
4
+ // package components and are out of scope (master prompt §2.3); the ported
5
+ // Toolbar, Chip and IconButton live in their own files and are re-exported
6
+ // here so existing import paths keep working.
7
+
8
+ export { Chip, type ChipProps } from "./Chip";
9
+ export { IconButton, type IconButtonProps } from "./IconButton";
10
+ export { Toolbar, type ToolbarProps } from "./Toolbar";