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/Pickers.tsx DELETED
@@ -1,595 +0,0 @@
1
- import { forwardRef, useMemo, useState } from "react";
2
- import type { StyleProp, ViewStyle } from "react-native";
3
-
4
- import { Glass } from "./Glass";
5
- import { Button } from "./Button";
6
- import { Sheet } from "./Overlays";
7
- import { colors, radii } from "./internal/tokens";
8
- import { primitives } from "./internal/primitives";
9
- import { useIsDark } from "./internal/motion";
10
- import { SelectedLens, lensFill } from "./internal/lens";
11
-
12
- // ---------------------------------------------------------------------------
13
- // Date helpers
14
- //
15
- // Kept pure and exported so a caller (and the tests) can reason about the same
16
- // calendar maths the grid uses. Dates are compared by day, never by instant,
17
- // which is the bug that makes a picker select "yesterday" near midnight.
18
-
19
- /** Midnight on the same calendar day, so two picks compare equal. */
20
- export function startOfDay(date: Date): Date {
21
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
22
- }
23
-
24
- export function sameDay(a: Date | undefined, b: Date | undefined): boolean {
25
- if (!a || !b) return false;
26
- return (
27
- a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()
28
- );
29
- }
30
-
31
- export interface CalendarCell {
32
- date: Date;
33
- /** True for days outside the displayed month, shown to fill the grid. */
34
- outside: boolean;
35
- key: string;
36
- }
37
-
38
- /**
39
- * The six-row month grid.
40
- *
41
- * Always six rows so the calendar does not change height as months change,
42
- * which would make the surrounding layout jump between February and March.
43
- */
44
- export function monthGrid(year: number, month: number, weekStartsOn: 0 | 1 = 0): CalendarCell[] {
45
- const first = new Date(year, month, 1);
46
- // getDay() is 0 for Sunday; the offset is how many leading cells to add.
47
- const offset = (first.getDay() - weekStartsOn + 7) % 7;
48
- const cells: CalendarCell[] = [];
49
- for (let i = 0; i < 42; i += 1) {
50
- const date = new Date(year, month, 1 - offset + i);
51
- cells.push({
52
- date,
53
- outside: date.getMonth() !== month,
54
- key: `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`,
55
- });
56
- }
57
- return cells;
58
- }
59
-
60
- export const WEEKDAYS = ["S", "M", "T", "W", "T", "F", "S"];
61
-
62
- export const MONTHS = [
63
- "January",
64
- "February",
65
- "March",
66
- "April",
67
- "May",
68
- "June",
69
- "July",
70
- "August",
71
- "September",
72
- "October",
73
- "November",
74
- "December",
75
- ];
76
-
77
- // ---------------------------------------------------------------------------
78
- // Calendar
79
-
80
- export interface CalendarProps {
81
- /** Controlled selection. */
82
- value?: Date;
83
- /** Fires when a day is tapped. */
84
- onChange?: (date: Date) => void;
85
- /** Days before this are dimmed and cannot be picked. */
86
- minDate?: Date;
87
- /** Days after this are dimmed and cannot be picked. */
88
- maxDate?: Date;
89
- /** Which month to open on when there is no value. */
90
- initialMonth?: Date;
91
- /** 0 starts the week on Sunday, 1 on Monday. */
92
- weekStartsOn?: 0 | 1;
93
- style?: StyleProp<ViewStyle>;
94
- isDark?: boolean;
95
- testID?: string;
96
- }
97
-
98
- /**
99
- * A month calendar, built from Glacia's own views.
100
- *
101
- * No native date picker anywhere: the grid, the weekday header and the month
102
- * navigation are ours, so the calendar looks the same on iOS and Android and
103
- * wears the library's tokens. The selected day is a `glassActive` fill, today
104
- * carries a ring, and disabled days are dimmed.
105
- */
106
- export const Calendar = forwardRef<any, CalendarProps>(function Calendar(
107
- {
108
- value,
109
- onChange,
110
- minDate,
111
- maxDate,
112
- initialMonth,
113
- weekStartsOn = 0,
114
- style,
115
- isDark: isDarkProp,
116
- testID,
117
- ...props
118
- },
119
- ref,
120
- ) {
121
- const isDark = useIsDark(isDarkProp);
122
- const theme = isDark ? colors.dark : colors.light;
123
- const { View, Text: RNText, Pressable } = primitives();
124
-
125
- const anchor = value ?? initialMonth ?? new Date();
126
- const [month, setMonth] = useState({ year: anchor.getFullYear(), month: anchor.getMonth() });
127
-
128
- const cells = useMemo(() => monthGrid(month.year, month.month, weekStartsOn), [month, weekStartsOn]);
129
- const today = startOfDay(new Date());
130
-
131
- const isDisabled = (date: Date) => {
132
- const day = startOfDay(date);
133
- if (minDate && day < startOfDay(minDate)) return true;
134
- if (maxDate && day > startOfDay(maxDate)) return true;
135
- return false;
136
- };
137
-
138
- const shift = (delta: number) => {
139
- setMonth((current) => {
140
- const next = new Date(current.year, current.month + delta, 1);
141
- return { year: next.getFullYear(), month: next.getMonth() };
142
- });
143
- };
144
-
145
- const cellSize = 38;
146
-
147
- return (
148
- <View
149
- ref={ref}
150
- testID={testID}
151
- accessibilityRole="none"
152
- style={[{ alignSelf: "stretch" }, style as ViewStyle]}
153
- {...props}
154
- >
155
- {/* Month navigation. */}
156
- <View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingBottom: 8 }}>
157
- <Pressable
158
- accessibilityRole="button"
159
- accessibilityLabel="Previous month"
160
- onPress={() => shift(-1)}
161
- hitSlop={8}
162
- style={{ padding: 6 }}
163
- >
164
- <RNText style={{ fontSize: 17, color: theme.foreground }}>{"\u2039"}</RNText>
165
- </Pressable>
166
- <RNText accessibilityRole="heading" style={{ fontSize: 16, fontWeight: "600", color: theme.foreground }}>
167
- {`${MONTHS[month.month]} ${month.year}`}
168
- </RNText>
169
- <Pressable
170
- accessibilityRole="button"
171
- accessibilityLabel="Next month"
172
- onPress={() => shift(1)}
173
- hitSlop={8}
174
- style={{ padding: 6 }}
175
- >
176
- <RNText style={{ fontSize: 17, color: theme.foreground }}>{"\u203A"}</RNText>
177
- </Pressable>
178
- </View>
179
-
180
- {/* Weekday header, derived from the same weekStartsOn as the grid. */}
181
- <View style={{ flexDirection: "row" }}>
182
- {Array.from({ length: 7 }, (_, i) => (
183
- <View key={i} style={{ flex: 1, alignItems: "center", paddingVertical: 4 }}>
184
- <RNText
185
- accessibilityElementsHidden
186
- style={{ fontSize: 11, fontWeight: "600", color: theme.muted }}
187
- >
188
- {WEEKDAYS[(i + weekStartsOn) % 7]}
189
- </RNText>
190
- </View>
191
- ))}
192
- </View>
193
-
194
- {/* The grid: six rows of seven. */}
195
- {Array.from({ length: 6 }, (_, row) => (
196
- <View key={row} style={{ flexDirection: "row" }}>
197
- {cells.slice(row * 7, row * 7 + 7).map((cell) => {
198
- const selected = sameDay(cell.date, value);
199
- const isToday = sameDay(cell.date, today);
200
- const disabled = isDisabled(cell.date);
201
- return (
202
- <View key={cell.key} style={{ flex: 1, alignItems: "center", paddingVertical: 2 }}>
203
- <Pressable
204
- accessibilityRole="button"
205
- accessibilityLabel={cell.date.toDateString()}
206
- accessibilityState={{ selected, disabled }}
207
- disabled={disabled}
208
- onPress={() => onChange?.(startOfDay(cell.date))}
209
- style={{
210
- width: cellSize,
211
- height: cellSize,
212
- borderRadius: cellSize / 2,
213
- alignItems: "center",
214
- justifyContent: "center",
215
- backgroundColor: "transparent",
216
- // Today is ringed; the selection is a lens on top of it.
217
- borderWidth: isToday && !selected ? 0.5 : 0,
218
- borderColor: isToday && !selected ? theme.fill : theme.edge,
219
- opacity: disabled ? 0.28 : cell.outside ? 0.45 : 1,
220
- }}
221
- >
222
- {selected ? (
223
- <SelectedLens radius={cellSize / 2} isDark={isDark} style={lensFill} />
224
- ) : null}
225
- <RNText
226
- style={{
227
- fontSize: 14,
228
- fontWeight: selected ? "600" : "400",
229
- color: selected ? theme.foreground : theme.foreground,
230
- }}
231
- >
232
- {String(cell.date.getDate())}
233
- </RNText>
234
- </Pressable>
235
- </View>
236
- );
237
- })}
238
- </View>
239
- ))}
240
- </View>
241
- );
242
- });
243
-
244
- // ---------------------------------------------------------------------------
245
- // DatePicker
246
-
247
- export interface DatePickerProps {
248
- /** Controlled visibility. Omit and the picker keeps its own. */
249
- open?: boolean;
250
- defaultOpen?: boolean;
251
- onOpenChange?: (open: boolean) => void;
252
- /** The committed date. */
253
- value?: Date;
254
- /** Fires only when the user confirms, never on a mere browse. */
255
- onConfirm?: (date: Date) => void;
256
- onCancel?: () => void;
257
- title?: string;
258
- confirmLabel?: string;
259
- cancelLabel?: string;
260
- minDate?: Date;
261
- maxDate?: Date;
262
- style?: StyleProp<ViewStyle>;
263
- isDark?: boolean;
264
- testID?: string;
265
- }
266
-
267
- /**
268
- * A date picker: the Calendar presented in a Sheet.
269
- *
270
- * Browsing months does not commit anything — the pending date is local until
271
- * the user confirms, so an accidental swipe of the calendar cannot change a
272
- * saved value.
273
- */
274
- export const DatePicker = forwardRef<any, DatePickerProps>(function DatePicker(
275
- {
276
- open: openProp,
277
- defaultOpen = false,
278
- onOpenChange,
279
- value,
280
- onConfirm,
281
- onCancel,
282
- title = "Select date",
283
- confirmLabel = "Confirm",
284
- cancelLabel = "Cancel",
285
- minDate,
286
- maxDate,
287
- style,
288
- isDark: isDarkProp,
289
- testID,
290
- ...props
291
- },
292
- ref,
293
- ) {
294
- const isDark = useIsDark(isDarkProp);
295
- const [internalOpen, setInternalOpen] = useState(defaultOpen);
296
- const open = openProp !== undefined ? openProp : internalOpen;
297
-
298
- const [pending, setPending] = useState<Date | undefined>(value);
299
-
300
- const setOpen = (next: boolean) => {
301
- if (openProp === undefined) setInternalOpen(next);
302
- onOpenChange?.(next);
303
- };
304
-
305
- return (
306
- <Sheet
307
- ref={ref}
308
- open={open}
309
- onOpenChange={setOpen}
310
- title={title}
311
- isDark={isDark}
312
- testID={testID}
313
- style={style}
314
- footer={
315
- <>
316
- <Button
317
- variant="ghost"
318
- accessibilityLabel={cancelLabel}
319
- onPress={() => {
320
- // Cancelling restores the committed value for the next open.
321
- setPending(value);
322
- onCancel?.();
323
- setOpen(false);
324
- }}
325
- >
326
- {cancelLabel}
327
- </Button>
328
- <Button
329
- variant="filled"
330
- accessibilityLabel={confirmLabel}
331
- disabled={pending === undefined}
332
- onPress={() => {
333
- if (pending) onConfirm?.(pending);
334
- setOpen(false);
335
- }}
336
- >
337
- {confirmLabel}
338
- </Button>
339
- </>
340
- }
341
- {...props}
342
- >
343
- <Calendar
344
- value={pending}
345
- onChange={setPending}
346
- minDate={minDate}
347
- maxDate={maxDate}
348
- isDark={isDark}
349
- initialMonth={value}
350
- />
351
- </Sheet>
352
- );
353
- });
354
-
355
- // ---------------------------------------------------------------------------
356
- // TimePicker
357
-
358
- export interface TimePickerProps {
359
- open?: boolean;
360
- defaultOpen?: boolean;
361
- onOpenChange?: (open: boolean) => void;
362
- /** The committed time, as "HH:MM" (24-hour). */
363
- value?: string;
364
- /** Fires only on confirm. */
365
- onConfirm?: (time: string) => void;
366
- onCancel?: () => void;
367
- /** Show an AM/PM column and present times in 12-hour form. */
368
- use12Hour?: boolean;
369
- title?: string;
370
- confirmLabel?: string;
371
- cancelLabel?: string;
372
- minuteStep?: number;
373
- style?: StyleProp<ViewStyle>;
374
- isDark?: boolean;
375
- testID?: string;
376
- }
377
-
378
- /** Splits "HH:MM" into parts, falling back to a sane default. */
379
- export function parseTime(value: string | undefined): { hour: number; minute: number } {
380
- const match = /^(\d{1,2}):(\d{2})$/.exec(value ?? "");
381
- if (!match) return { hour: 9, minute: 0 };
382
- return {
383
- hour: Math.min(Math.max(Number(match[1]), 0), 23),
384
- minute: Math.min(Math.max(Number(match[2]), 0), 59),
385
- };
386
- }
387
-
388
- /** Formats parts back to zero-padded "HH:MM". */
389
- export function formatTime(hour: number, minute: number): string {
390
- return `${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`;
391
- }
392
-
393
- /**
394
- * A time picker: tappable hour/minute drums inside a Sheet.
395
- *
396
- * The drums are ordinary Pressables drawn by Glacia — not a native picker
397
- * widget. Tapping a value selects it; the whole column scrolls in the Sheet.
398
- */
399
- export const TimePicker = forwardRef<any, TimePickerProps>(function TimePicker(
400
- {
401
- open: openProp,
402
- defaultOpen = false,
403
- onOpenChange,
404
- value,
405
- onConfirm,
406
- onCancel,
407
- use12Hour = false,
408
- title = "Select time",
409
- confirmLabel = "Confirm",
410
- cancelLabel = "Cancel",
411
- minuteStep = 1,
412
- style,
413
- isDark: isDarkProp,
414
- testID,
415
- ...props
416
- },
417
- ref,
418
- ) {
419
- const isDark = useIsDark(isDarkProp);
420
- const theme = isDark ? colors.dark : colors.light;
421
- const { View, Text: RNText, Pressable } = primitives();
422
-
423
- const [internalOpen, setInternalOpen] = useState(defaultOpen);
424
- const open = openProp !== undefined ? openProp : internalOpen;
425
-
426
- const initial = parseTime(value);
427
- const [hour, setHour] = useState(initial.hour);
428
- const [minute, setMinute] = useState(initial.minute);
429
-
430
- const setOpen = (next: boolean) => {
431
- if (openProp === undefined) setInternalOpen(next);
432
- onOpenChange?.(next);
433
- };
434
-
435
- const hours = Array.from({ length: 24 }, (_, i) => i);
436
- const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);
437
-
438
- // In 12-hour mode the column shows 1–12; the stored hour stays 24-hour.
439
- const displayHour = use12Hour ? (hour % 12 === 0 ? 12 : hour % 12) : hour;
440
- const isPm = hour >= 12;
441
-
442
- const column = (items: number[], selected: number, onPick: (value: number) => void, label: string, pad = 2) => (
443
- <View style={{ height: 168, flex: 1 }} accessibilityRole="none" accessibilityLabel={label}>
444
- <ScrollColumn
445
- items={items}
446
- selected={selected}
447
- onPick={onPick}
448
- isDark={isDark}
449
- pad={pad}
450
- />
451
- </View>
452
- );
453
-
454
- return (
455
- <Sheet
456
- ref={ref}
457
- open={open}
458
- onOpenChange={setOpen}
459
- title={title}
460
- isDark={isDark}
461
- testID={testID}
462
- style={style}
463
- footer={
464
- <>
465
- <Button
466
- variant="ghost"
467
- accessibilityLabel={cancelLabel}
468
- onPress={() => {
469
- setHour(initial.hour);
470
- setMinute(initial.minute);
471
- onCancel?.();
472
- setOpen(false);
473
- }}
474
- >
475
- {cancelLabel}
476
- </Button>
477
- <Button
478
- variant="filled"
479
- accessibilityLabel={confirmLabel}
480
- onPress={() => {
481
- onConfirm?.(formatTime(hour, minute));
482
- setOpen(false);
483
- }}
484
- >
485
- {confirmLabel}
486
- </Button>
487
- </>
488
- }
489
- {...props}
490
- >
491
- <View style={{ flexDirection: "row", gap: 8, alignItems: "center" }}>
492
- {column(use12Hour ? Array.from({ length: 12 }, (_, i) => i + 1) : hours, displayHour, (picked) => {
493
- if (!use12Hour) {
494
- setHour(picked);
495
- return;
496
- }
497
- // Keep the current half of the day when the hour column changes.
498
- setHour(picked % 12 === 0 ? (isPm ? 12 : 0) : isPm ? picked + 12 : picked);
499
- }, "Hour")}
500
- <RNText style={{ fontSize: 22, color: theme.muted }}>{":"}</RNText>
501
- {column(minutes, minute, setMinute, "Minute")}
502
- {use12Hour && (
503
- <View style={{ flex: 1, gap: 6 }}>
504
- {["AM", "PM"].map((label) => {
505
- const active = label === "PM" ? isPm : !isPm;
506
- return (
507
- <Pressable
508
- key={label}
509
- accessibilityRole="button"
510
- accessibilityLabel={label}
511
- accessibilityState={{ selected: active }}
512
- onPress={() => {
513
- const nextPm = label === "PM";
514
- if (nextPm === isPm) return;
515
- setHour((current) => (nextPm ? (current % 12) + 12 : current % 12));
516
- }}
517
- style={{
518
- height: 34,
519
- borderRadius: radii.sm,
520
- alignItems: "center",
521
- justifyContent: "center",
522
- backgroundColor: "transparent",
523
- }}
524
- >
525
- {active ? <SelectedLens radius={radii.sm} isDark={isDark} style={lensFill} /> : null}
526
- <RNText style={{ fontSize: 14, fontWeight: active ? "600" : "500", color: active ? theme.foreground : theme.muted }}>
527
- {label}
528
- </RNText>
529
- </Pressable>
530
- );
531
- })}
532
- </View>
533
- )}
534
- </View>
535
- </Sheet>
536
- );
537
- });
538
-
539
- /** One scrollable column of the time drums. */
540
- function ScrollColumn({
541
- items,
542
- selected,
543
- onPick,
544
- isDark,
545
- pad,
546
- }: {
547
- items: number[];
548
- selected: number;
549
- onPick: (value: number) => void;
550
- isDark: boolean;
551
- pad: number;
552
- }) {
553
- const theme = isDark ? colors.dark : colors.light;
554
- const { getScrollView } = primitives();
555
- const ScrollView = getScrollView();
556
- const { View, Text: RNText, Pressable } = primitives();
557
-
558
- const rows = items.map((item) => {
559
- const active = item === selected;
560
- return (
561
- <Pressable
562
- key={item}
563
- accessibilityRole="button"
564
- accessibilityLabel={String(item).padStart(pad, "0")}
565
- accessibilityState={{ selected: active }}
566
- onPress={() => onPick(item)}
567
- style={{
568
- height: 34,
569
- alignItems: "center",
570
- justifyContent: "center",
571
- borderRadius: radii.sm,
572
- backgroundColor: "transparent",
573
- }}
574
- >
575
- {active ? <SelectedLens radius={radii.sm} isDark={isDark} style={lensFill} /> : null}
576
- <RNText style={{ fontSize: 17, fontWeight: active ? "600" : "400", color: active ? theme.foreground : theme.muted }}>
577
- {String(item).padStart(pad, "0")}
578
- </RNText>
579
- </Pressable>
580
- );
581
- });
582
-
583
- if (!ScrollView) {
584
- // Off-device: no ScrollView, so the column is clipped to its height rather
585
- // than truncated. Every value stays present and selectable, which is what
586
- // the real drum shows once it can scroll.
587
- return <View style={{ gap: 2, overflow: "hidden", height: 168 }}>{rows}</View>;
588
- }
589
-
590
- return (
591
- <ScrollView showsVerticalScrollIndicator={false} style={{ flex: 1 }}>
592
- <View style={{ gap: 2 }}>{rows}</View>
593
- </ScrollView>
594
- );
595
- }