expo-android-glass-view 0.1.5 → 0.1.6

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 (67) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/build/AndroidGlassBottomTabs.android.d.ts +4 -0
  3. package/build/AndroidGlassBottomTabs.android.d.ts.map +1 -0
  4. package/build/AndroidGlassBottomTabs.android.js +51 -0
  5. package/build/AndroidGlassBottomTabs.android.js.map +1 -0
  6. package/build/AndroidGlassBottomTabs.d.ts +5 -0
  7. package/build/AndroidGlassBottomTabs.d.ts.map +1 -0
  8. package/build/AndroidGlassBottomTabs.js +34 -0
  9. package/build/AndroidGlassBottomTabs.js.map +1 -0
  10. package/build/AndroidGlassButton.android.d.ts +4 -0
  11. package/build/AndroidGlassButton.android.d.ts.map +1 -0
  12. package/build/AndroidGlassButton.android.js +32 -0
  13. package/build/AndroidGlassButton.android.js.map +1 -0
  14. package/build/AndroidGlassButton.d.ts +5 -0
  15. package/build/AndroidGlassButton.d.ts.map +1 -0
  16. package/build/AndroidGlassButton.js +38 -0
  17. package/build/AndroidGlassButton.js.map +1 -0
  18. package/build/AndroidGlassComponents.types.d.ts +72 -0
  19. package/build/AndroidGlassComponents.types.d.ts.map +1 -0
  20. package/build/AndroidGlassComponents.types.js +2 -0
  21. package/build/AndroidGlassComponents.types.js.map +1 -0
  22. package/build/AndroidGlassSlider.android.d.ts +4 -0
  23. package/build/AndroidGlassSlider.android.d.ts.map +1 -0
  24. package/build/AndroidGlassSlider.android.js +27 -0
  25. package/build/AndroidGlassSlider.android.js.map +1 -0
  26. package/build/AndroidGlassSlider.d.ts +5 -0
  27. package/build/AndroidGlassSlider.d.ts.map +1 -0
  28. package/build/AndroidGlassSlider.js +47 -0
  29. package/build/AndroidGlassSlider.js.map +1 -0
  30. package/build/AndroidGlassTab.d.ts +9 -0
  31. package/build/AndroidGlassTab.d.ts.map +1 -0
  32. package/build/AndroidGlassTab.js +22 -0
  33. package/build/AndroidGlassTab.js.map +1 -0
  34. package/build/AndroidGlassToggle.android.d.ts +4 -0
  35. package/build/AndroidGlassToggle.android.d.ts.map +1 -0
  36. package/build/AndroidGlassToggle.android.js +27 -0
  37. package/build/AndroidGlassToggle.android.js.map +1 -0
  38. package/build/AndroidGlassToggle.d.ts +5 -0
  39. package/build/AndroidGlassToggle.d.ts.map +1 -0
  40. package/build/AndroidGlassToggle.js +7 -0
  41. package/build/AndroidGlassToggle.js.map +1 -0
  42. package/build/AndroidGlassView.android.d.ts +4 -0
  43. package/build/AndroidGlassView.android.d.ts.map +1 -0
  44. package/build/AndroidGlassView.android.js +10 -0
  45. package/build/AndroidGlassView.android.js.map +1 -0
  46. package/build/AndroidGlassView.d.ts +8 -0
  47. package/build/AndroidGlassView.d.ts.map +1 -0
  48. package/build/AndroidGlassView.js +18 -0
  49. package/build/AndroidGlassView.js.map +1 -0
  50. package/build/AndroidGlassView.types.d.ts +34 -0
  51. package/build/AndroidGlassView.types.d.ts.map +1 -0
  52. package/build/AndroidGlassView.types.js +2 -0
  53. package/build/AndroidGlassView.types.js.map +1 -0
  54. package/build/MinimizeOnScroll.d.ts +41 -0
  55. package/build/MinimizeOnScroll.d.ts.map +1 -0
  56. package/build/MinimizeOnScroll.js +76 -0
  57. package/build/MinimizeOnScroll.js.map +1 -0
  58. package/build/index.d.ts +10 -0
  59. package/build/index.d.ts.map +1 -0
  60. package/build/index.js +12 -0
  61. package/build/index.js.map +1 -0
  62. package/build/utils.d.ts +5 -0
  63. package/build/utils.d.ts.map +1 -0
  64. package/build/utils.js +9 -0
  65. package/build/utils.js.map +1 -0
  66. package/package.json +1 -1
  67. package/tsconfig.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.1.6 — 2026-09-12
4
+
5
+ - Fix: 0.1.4 and 0.1.5 were published without their compiled JavaScript (`build/`), so Metro
6
+ failed with `Unable to resolve "expo-android-glass-view"`. The native code is the same as in
7
+ 0.1.5: an app whose native build already has 0.1.5 only needs the new JavaScript, no rebuild.
8
+ - `prepare` now fails when TypeScript emits nothing, so a package without its JavaScript can't be
9
+ published again.
10
+
11
+ ## 0.1.5 — 2026-09-12
4
12
 
5
13
  - Performance: a glass view's capture leaves out everything that cannot reach it. Before, an
6
14
  animation anywhere on screen made every glass view re-render its blur and refraction on every
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassBottomTabsProps } from './AndroidGlassComponents.types';
3
+ export default function AndroidGlassBottomTabs({ selectedIndex, onTabSelected, minimized, onMinimizedChange, accentColor, containerColor, children, style, ...rest }: AndroidGlassBottomTabsProps): React.JSX.Element;
4
+ //# sourceMappingURL=AndroidGlassBottomTabs.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassBottomTabs.android.d.ts","sourceRoot":"","sources":["../src/AndroidGlassBottomTabs.android.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAuBlF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,aAAa,EACb,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,qBAgD7B"}
@@ -0,0 +1,51 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+ import { StyleSheet, View } from 'react-native';
4
+ import { MinimizedStateContext } from './MinimizeOnScroll';
5
+ import { toNativeColor } from './utils';
6
+ const NativeAndroidGlassBottomTabs = requireNativeView('ExpoAndroidGlassView', 'AndroidGlassBottomTabs');
7
+ export default function AndroidGlassBottomTabs({ selectedIndex, onTabSelected, minimized, onMinimizedChange, accentColor, containerColor, children, style, ...rest }) {
8
+ const tabs = React.Children.toArray(children).filter(React.isValidElement);
9
+ // Without a `selectedIndex` prop, the bar keeps the user's selection.
10
+ const [ownIndex, setOwnIndex] = React.useState(0);
11
+ // Sent back with `selectedIndex`, so the native side can tell a stale index (JS still catching
12
+ // up with earlier selections) from a current one.
13
+ const [eventCount, setEventCount] = React.useState(0);
14
+ const selected = selectedIndex ?? ownIndex;
15
+ // Inside a MinimizeOnScrollProvider, the bar follows the shared state unless `minimized` is given.
16
+ const shared = React.useContext(MinimizedStateContext);
17
+ const followsProvider = minimized === undefined;
18
+ return (<NativeAndroidGlassBottomTabs accessibilityRole="tablist" {...rest} style={[styles.bar, style]} selectedIndex={selected} tabsCount={tabs.length} mostRecentEventCount={eventCount} minimized={minimized ?? shared?.minimized ?? false} accentColor={toNativeColor(accentColor)} containerColor={toNativeColor(containerColor)} onTabSelected={(event) => {
19
+ const { index, eventCount: count } = event.nativeEvent;
20
+ setEventCount((current) => Math.max(current, count));
21
+ setOwnIndex(index);
22
+ onTabSelected?.(index);
23
+ }} onMinimizedChange={(event) => {
24
+ const value = event.nativeEvent.minimized;
25
+ if (followsProvider)
26
+ shared?.setMinimized(value);
27
+ onMinimizedChange?.(value);
28
+ }}>
29
+ {tabs.map((tab, index) => (
30
+ // The native bar handles taps and drags, and draws these views itself (inside the glass
31
+ // and, tinted, under the droplet), so they must stay real views and not take touches.
32
+ <View key={tab.key ?? index} collapsable={false} pointerEvents="none" accessibilityRole="tab" accessibilityState={{ selected: index === selected }} style={styles.tab}>
33
+ {tab}
34
+ </View>))}
35
+ </NativeAndroidGlassBottomTabs>);
36
+ }
37
+ const styles = StyleSheet.create({
38
+ // 4 dp side padding keeps the tabs aligned with the droplet: (width - 8 dp) / count each.
39
+ bar: {
40
+ height: 64,
41
+ flexDirection: 'row',
42
+ paddingHorizontal: 4,
43
+ },
44
+ tab: {
45
+ flex: 1,
46
+ alignItems: 'center',
47
+ justifyContent: 'center',
48
+ gap: 2,
49
+ },
50
+ });
51
+ //# sourceMappingURL=AndroidGlassBottomTabs.android.js.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AAK,CACvB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,KAAK,QAAQ,EAAE,CAAC,CACrD,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAClB;UAAA,CAAC,GAAG,CACN;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CACJ;IAAA,EAAE,4BAA4B,CAAC,CAChC,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,0FAA0F;IAC1F,GAAG,EAAE;QACH,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,CAAC;KACrB;IACD,GAAG,EAAE;QACH,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport type { AndroidGlassBottomTabsProps } from './AndroidGlassComponents.types';\nimport { MinimizedStateContext } from './MinimizeOnScroll';\nimport { type NativeColor, toNativeColor } from './utils';\n\ntype IndexEvent = { nativeEvent: { index: number; eventCount: number } };\ntype MinimizedEvent = { nativeEvent: { minimized: boolean } };\n\ntype NativeAndroidGlassBottomTabsProps = Omit<\n AndroidGlassBottomTabsProps,\n 'onTabSelected' | 'onMinimizedChange' | 'accentColor' | 'containerColor'\n> & {\n tabsCount: number;\n /** Count of the last selection event handled here (see ControlledProp on the native side). */\n mostRecentEventCount: number;\n onTabSelected: (event: IndexEvent) => void;\n onMinimizedChange: (event: MinimizedEvent) => void;\n accentColor?: NativeColor;\n containerColor?: NativeColor;\n};\n\nconst NativeAndroidGlassBottomTabs: React.ComponentType<NativeAndroidGlassBottomTabsProps> =\n requireNativeView('ExpoAndroidGlassView', 'AndroidGlassBottomTabs');\n\nexport default function AndroidGlassBottomTabs({\n selectedIndex,\n onTabSelected,\n minimized,\n onMinimizedChange,\n accentColor,\n containerColor,\n children,\n style,\n ...rest\n}: AndroidGlassBottomTabsProps) {\n const tabs = React.Children.toArray(children).filter(React.isValidElement);\n // Without a `selectedIndex` prop, the bar keeps the user's selection.\n const [ownIndex, setOwnIndex] = React.useState(0);\n // Sent back with `selectedIndex`, so the native side can tell a stale index (JS still catching\n // up with earlier selections) from a current one.\n const [eventCount, setEventCount] = React.useState(0);\n const selected = selectedIndex ?? ownIndex;\n // Inside a MinimizeOnScrollProvider, the bar follows the shared state unless `minimized` is given.\n const shared = React.useContext(MinimizedStateContext);\n const followsProvider = minimized === undefined;\n return (\n <NativeAndroidGlassBottomTabs\n accessibilityRole=\"tablist\"\n {...rest}\n style={[styles.bar, style]}\n selectedIndex={selected}\n tabsCount={tabs.length}\n mostRecentEventCount={eventCount}\n minimized={minimized ?? shared?.minimized ?? false}\n accentColor={toNativeColor(accentColor)}\n containerColor={toNativeColor(containerColor)}\n onTabSelected={(event) => {\n const { index, eventCount: count } = event.nativeEvent;\n setEventCount((current) => Math.max(current, count));\n setOwnIndex(index);\n onTabSelected?.(index);\n }}\n onMinimizedChange={(event) => {\n const value = event.nativeEvent.minimized;\n if (followsProvider) shared?.setMinimized(value);\n onMinimizedChange?.(value);\n }}>\n {tabs.map((tab, index) => (\n // The native bar handles taps and drags, and draws these views itself (inside the glass\n // and, tinted, under the droplet), so they must stay real views and not take touches.\n <View\n key={tab.key ?? index}\n collapsable={false}\n pointerEvents=\"none\"\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: index === selected }}\n style={styles.tab}>\n {tab}\n </View>\n ))}\n </NativeAndroidGlassBottomTabs>\n );\n}\n\nconst styles = StyleSheet.create({\n // 4 dp side padding keeps the tabs aligned with the droplet: (width - 8 dp) / count each.\n bar: {\n height: 64,\n flexDirection: 'row',\n paddingHorizontal: 4,\n },\n tab: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n gap: 2,\n },\n});\n"]}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassBottomTabsProps } from './AndroidGlassComponents.types';
3
+ /** iOS and web fallback: a plain tab bar with the same API (it does not minimize). */
4
+ export default function AndroidGlassBottomTabs({ selectedIndex, onTabSelected, minimized: _minimized, onMinimizedChange: _onMinimizedChange, accentColor: _accentColor, containerColor, children, style, ...rest }: AndroidGlassBottomTabsProps): React.JSX.Element;
5
+ //# sourceMappingURL=AndroidGlassBottomTabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassBottomTabs.d.ts","sourceRoot":"","sources":["../src/AndroidGlassBottomTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAElF,sFAAsF;AACtF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,aAAiB,EACjB,aAAa,EACb,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,kBAAkB,EACrC,WAAW,EAAE,YAAY,EACzB,cAAc,EACd,QAAQ,EACR,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,qBAuB7B"}
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ import { Pressable, StyleSheet, View } from 'react-native';
3
+ /** iOS and web fallback: a plain tab bar with the same API (it does not minimize). */
4
+ export default function AndroidGlassBottomTabs({ selectedIndex = 0, onTabSelected, minimized: _minimized, onMinimizedChange: _onMinimizedChange, accentColor: _accentColor, containerColor, children, style, ...rest }) {
5
+ const tabs = React.Children.toArray(children).filter(React.isValidElement);
6
+ return (<View accessibilityRole="tablist" {...rest} style={[
7
+ styles.bar,
8
+ { backgroundColor: containerColor ?? 'rgba(250, 250, 250, 0.9)' },
9
+ style,
10
+ ]}>
11
+ {tabs.map((tab, index) => (<Pressable key={tab.key ?? index} accessibilityRole="tab" accessibilityState={{ selected: index === selectedIndex }} onPress={() => onTabSelected?.(index)} style={[styles.tab, index === selectedIndex && styles.selected]}>
12
+ {tab}
13
+ </Pressable>))}
14
+ </View>);
15
+ }
16
+ const styles = StyleSheet.create({
17
+ bar: {
18
+ height: 64,
19
+ flexDirection: 'row',
20
+ padding: 4,
21
+ borderRadius: 32,
22
+ },
23
+ tab: {
24
+ flex: 1,
25
+ alignItems: 'center',
26
+ justifyContent: 'center',
27
+ gap: 2,
28
+ borderRadius: 28,
29
+ },
30
+ selected: {
31
+ backgroundColor: 'rgba(0, 0, 0, 0.08)',
32
+ },
33
+ });
34
+ //# sourceMappingURL=AndroidGlassBottomTabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassBottomTabs.js","sourceRoot":"","sources":["../src/AndroidGlassBottomTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAI3D,sFAAsF;AACtF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,aAAa,GAAG,CAAC,EACjB,aAAa,EACb,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,kBAAkB,EACrC,WAAW,EAAE,YAAY,EACzB,cAAc,EACd,QAAQ,EACR,KAAK,EACL,GAAG,IAAI,EACqB;IAC5B,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC3E,OAAO,CACL,CAAC,IAAI,CACH,iBAAiB,CAAC,SAAS,CAC3B,IAAI,IAAI,CAAC,CACT,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,GAAG;YACV,EAAE,eAAe,EAAE,cAAc,IAAI,0BAA0B,EAAE;YACjE,KAAK;SACN,CAAC,CACF;MAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,CAAC,SAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,CACtB,iBAAiB,CAAC,KAAK,CACvB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,KAAK,aAAa,EAAE,CAAC,CAC1D,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC,CACtC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,KAAK,aAAa,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAChE;UAAA,CAAC,GAAG,CACN;QAAA,EAAE,SAAS,CAAC,CACb,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,EAAE;KACjB;IACD,GAAG,EAAE;QACH,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;QACN,YAAY,EAAE,EAAE;KACjB;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,qBAAqB;KACvC;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { Pressable, StyleSheet, View } from 'react-native';\n\nimport type { AndroidGlassBottomTabsProps } from './AndroidGlassComponents.types';\n\n/** iOS and web fallback: a plain tab bar with the same API (it does not minimize). */\nexport default function AndroidGlassBottomTabs({\n selectedIndex = 0,\n onTabSelected,\n minimized: _minimized,\n onMinimizedChange: _onMinimizedChange,\n accentColor: _accentColor,\n containerColor,\n children,\n style,\n ...rest\n}: AndroidGlassBottomTabsProps) {\n const tabs = React.Children.toArray(children).filter(React.isValidElement);\n return (\n <View\n accessibilityRole=\"tablist\"\n {...rest}\n style={[\n styles.bar,\n { backgroundColor: containerColor ?? 'rgba(250, 250, 250, 0.9)' },\n style,\n ]}>\n {tabs.map((tab, index) => (\n <Pressable\n key={tab.key ?? index}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: index === selectedIndex }}\n onPress={() => onTabSelected?.(index)}\n style={[styles.tab, index === selectedIndex && styles.selected]}>\n {tab}\n </Pressable>\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n bar: {\n height: 64,\n flexDirection: 'row',\n padding: 4,\n borderRadius: 32,\n },\n tab: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n gap: 2,\n borderRadius: 28,\n },\n selected: {\n backgroundColor: 'rgba(0, 0, 0, 0.08)',\n },\n});\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassButtonProps } from './AndroidGlassComponents.types';
3
+ export default function AndroidGlassButton({ onPress, title, titleStyle, cornerRadius, tintColor, surfaceColor, fallbackColor, style, children, ...rest }: AndroidGlassButtonProps): React.JSX.Element;
4
+ //# sourceMappingURL=AndroidGlassButton.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassButton.android.d.ts","sourceRoot":"","sources":["../src/AndroidGlassButton.android.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAgB9E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,EACb,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,uBAAuB,qBAoBzB"}
@@ -0,0 +1,32 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+ import { StyleSheet, Text } from 'react-native';
4
+ import { toNativeColor } from './utils';
5
+ const NativeAndroidGlassButton = requireNativeView('ExpoAndroidGlassView', 'AndroidGlassButton');
6
+ export default function AndroidGlassButton({ onPress, title, titleStyle, cornerRadius, tintColor, surfaceColor, fallbackColor, style, children, ...rest }) {
7
+ const borderRadius = StyleSheet.flatten(style)?.borderRadius;
8
+ return (<NativeAndroidGlassButton accessibilityRole="button" {...rest} style={[styles.button, style]} cornerRadius={cornerRadius ?? (typeof borderRadius === 'number' ? borderRadius : undefined)} tintColor={toNativeColor(tintColor)} surfaceColor={toNativeColor(surfaceColor)} fallbackColor={toNativeColor(fallbackColor)} onPress={onPress ? () => onPress() : undefined}>
9
+ {title != null ? (<Text style={[styles.title, tintColor != null && styles.titleOnTint, titleStyle]}>
10
+ {title}
11
+ </Text>) : null}
12
+ {children}
13
+ </NativeAndroidGlassButton>);
14
+ }
15
+ const styles = StyleSheet.create({
16
+ button: {
17
+ height: 48,
18
+ paddingHorizontal: 16,
19
+ flexDirection: 'row',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ gap: 8,
23
+ },
24
+ title: {
25
+ fontSize: 15,
26
+ color: '#000000',
27
+ },
28
+ titleOnTint: {
29
+ color: '#ffffff',
30
+ },
31
+ });
32
+ //# sourceMappingURL=AndroidGlassButton.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassButton.android.js","sourceRoot":"","sources":["../src/AndroidGlassButton.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAY1D,MAAM,wBAAwB,GAC5B,iBAAiB,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EAC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Q;QACpB,cAAc,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;KACP;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACjB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { StyleSheet, Text } from 'react-native';\n\nimport type { AndroidGlassButtonProps } from './AndroidGlassComponents.types';\nimport { type NativeColor, toNativeColor } from './utils';\n\ntype NativeAndroidGlassButtonProps = Omit<\n AndroidGlassButtonProps,\n 'tintColor' | 'surfaceColor' | 'fallbackColor' | 'onPress' | 'title' | 'titleStyle'\n> & {\n tintColor?: NativeColor;\n surfaceColor?: NativeColor;\n fallbackColor?: NativeColor;\n onPress?: () => void;\n};\n\nconst NativeAndroidGlassButton: React.ComponentType<NativeAndroidGlassButtonProps> =\n requireNativeView('ExpoAndroidGlassView', 'AndroidGlassButton');\n\nexport default function AndroidGlassButton({\n onPress,\n title,\n titleStyle,\n cornerRadius,\n tintColor,\n surfaceColor,\n fallbackColor,\n style,\n children,\n ...rest\n}: AndroidGlassButtonProps) {\n const borderRadius = StyleSheet.flatten(style)?.borderRadius;\n return (\n <NativeAndroidGlassButton\n accessibilityRole=\"button\"\n {...rest}\n style={[styles.button, style]}\n cornerRadius={cornerRadius ?? (typeof borderRadius === 'number' ? borderRadius : undefined)}\n tintColor={toNativeColor(tintColor)}\n surfaceColor={toNativeColor(surfaceColor)}\n fallbackColor={toNativeColor(fallbackColor)}\n onPress={onPress ? () => onPress() : undefined}>\n {title != null ? (\n <Text style={[styles.title, tintColor != null && styles.titleOnTint, titleStyle]}>\n {title}\n </Text>\n ) : null}\n {children}\n </NativeAndroidGlassButton>\n );\n}\n\nconst styles = StyleSheet.create({\n button: {\n height: 48,\n paddingHorizontal: 16,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n },\n title: {\n fontSize: 15,\n color: '#000000',\n },\n titleOnTint: {\n color: '#ffffff',\n },\n});\n"]}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassButtonProps } from './AndroidGlassComponents.types';
3
+ /** iOS and web fallback: a translucent capsule button with the same API. */
4
+ export default function AndroidGlassButton({ onPress, title, titleStyle, cornerRadius, tintColor, surfaceColor, fallbackColor, style, children, blurRadius: _blurRadius, refractionHeight: _refractionHeight, refractionAmount: _refractionAmount, chromaticAberration: _chromaticAberration, depthEffect: _depthEffect, vibrancy: _vibrancy, highlight: _highlight, shadow: _shadow, interactive: _interactive, ...rest }: AndroidGlassButtonProps): React.JSX.Element;
5
+ //# sourceMappingURL=AndroidGlassButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassButton.d.ts","sourceRoot":"","sources":["../src/AndroidGlassButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAI9E,4EAA4E;AAC5E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,EACb,KAAK,EACL,QAAQ,EACR,UAAU,EAAE,WAAW,EACvB,gBAAgB,EAAE,iBAAiB,EACnC,gBAAgB,EAAE,iBAAiB,EACnC,mBAAmB,EAAE,oBAAoB,EACzC,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,YAAY,EACzB,GAAG,IAAI,EACR,EAAE,uBAAuB,qBAuBzB"}
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ import { Pressable, StyleSheet, Text } from 'react-native';
3
+ const DEFAULT_FALLBACK_COLOR = 'rgba(255, 255, 255, 0.7)';
4
+ /** iOS and web fallback: a translucent capsule button with the same API. */
5
+ export default function AndroidGlassButton({ onPress, title, titleStyle, cornerRadius, tintColor, surfaceColor, fallbackColor, style, children, blurRadius: _blurRadius, refractionHeight: _refractionHeight, refractionAmount: _refractionAmount, chromaticAberration: _chromaticAberration, depthEffect: _depthEffect, vibrancy: _vibrancy, highlight: _highlight, shadow: _shadow, interactive: _interactive, ...rest }) {
6
+ return (<Pressable accessibilityRole="button" {...rest} onPress={onPress} style={({ pressed }) => [
7
+ styles.button,
8
+ {
9
+ backgroundColor: tintColor ?? surfaceColor ?? fallbackColor ?? DEFAULT_FALLBACK_COLOR,
10
+ borderRadius: cornerRadius ?? 999,
11
+ opacity: pressed ? 0.75 : 1,
12
+ },
13
+ style,
14
+ ]}>
15
+ {title != null ? (<Text style={[styles.title, tintColor != null && styles.titleOnTint, titleStyle]}>
16
+ {title}
17
+ </Text>) : null}
18
+ {children}
19
+ </Pressable>);
20
+ }
21
+ const styles = StyleSheet.create({
22
+ button: {
23
+ height: 48,
24
+ paddingHorizontal: 16,
25
+ flexDirection: 'row',
26
+ alignItems: 'center',
27
+ justifyContent: 'center',
28
+ gap: 8,
29
+ },
30
+ title: {
31
+ fontSize: 15,
32
+ color: '#000000',
33
+ },
34
+ titleOnTint: {
35
+ color: '#ffffff',
36
+ },
37
+ });
38
+ //# sourceMappingURL=AndroidGlassButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassButton.js","sourceRoot":"","sources":["../src/AndroidGlassButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAI3D,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAE1D,4EAA4E;AAC5E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EAC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c,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;KACP;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACjB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { Pressable, StyleSheet, Text } from 'react-native';\n\nimport type { AndroidGlassButtonProps } from './AndroidGlassComponents.types';\n\nconst DEFAULT_FALLBACK_COLOR = 'rgba(255, 255, 255, 0.7)';\n\n/** iOS and web fallback: a translucent capsule button with the same API. */\nexport default function AndroidGlassButton({\n onPress,\n title,\n titleStyle,\n cornerRadius,\n tintColor,\n surfaceColor,\n fallbackColor,\n style,\n children,\n blurRadius: _blurRadius,\n refractionHeight: _refractionHeight,\n refractionAmount: _refractionAmount,\n chromaticAberration: _chromaticAberration,\n depthEffect: _depthEffect,\n vibrancy: _vibrancy,\n highlight: _highlight,\n shadow: _shadow,\n interactive: _interactive,\n ...rest\n}: AndroidGlassButtonProps) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n {...rest}\n onPress={onPress}\n style={({ pressed }) => [\n styles.button,\n {\n backgroundColor: tintColor ?? surfaceColor ?? fallbackColor ?? DEFAULT_FALLBACK_COLOR,\n borderRadius: cornerRadius ?? 999,\n opacity: pressed ? 0.75 : 1,\n },\n style,\n ]}>\n {title != null ? (\n <Text style={[styles.title, tintColor != null && styles.titleOnTint, titleStyle]}>\n {title}\n </Text>\n ) : null}\n {children}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n button: {\n height: 48,\n paddingHorizontal: 16,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n },\n title: {\n fontSize: 15,\n color: '#000000',\n },\n titleOnTint: {\n color: '#ffffff',\n },\n});\n"]}
@@ -0,0 +1,72 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ColorValue, StyleProp, TextStyle, ViewProps } from 'react-native';
3
+ import type { AndroidGlassViewProps } from './AndroidGlassView.types';
4
+ /**
5
+ * Accepts every `AndroidGlassView` glass prop. `cornerRadius` defaults to a capsule.
6
+ * Children (label, icon, …) are drawn inside the glass and follow its press deformation; they
7
+ * are decorative, so don't put interactive elements in a button.
8
+ */
9
+ export type AndroidGlassButtonProps = AndroidGlassViewProps & {
10
+ /** Called when the button is tapped. */
11
+ onPress?: () => void;
12
+ /** Convenience label, rendered before the children. */
13
+ title?: string;
14
+ titleStyle?: StyleProp<TextStyle>;
15
+ /**
16
+ * Press and drag feedback: the glass stretches towards the finger and a highlight follows it.
17
+ * Default true.
18
+ */
19
+ interactive?: boolean;
20
+ };
21
+ export type AndroidGlassToggleProps = ViewProps & {
22
+ value?: boolean;
23
+ onValueChange?: (value: boolean) => void;
24
+ /** Track colour when on. Default iOS green. */
25
+ accentColor?: ColorValue;
26
+ /** Track colour when off. */
27
+ trackColor?: ColorValue;
28
+ };
29
+ export type AndroidGlassSliderProps = ViewProps & {
30
+ value?: number;
31
+ /** Default 0. */
32
+ minimumValue?: number;
33
+ /** Default 1. */
34
+ maximumValue?: number;
35
+ /** Called continuously while the thumb is dragged. */
36
+ onValueChange?: (value: number) => void;
37
+ /** Called once when the finger is lifted, or after a tap on the track. */
38
+ onSlidingComplete?: (value: number) => void;
39
+ /** Colour of the filled part of the track. Default system blue. */
40
+ accentColor?: ColorValue;
41
+ trackColor?: ColorValue;
42
+ };
43
+ export type AndroidGlassBottomTabsProps = ViewProps & {
44
+ /** Index of the selected tab. */
45
+ selectedIndex?: number;
46
+ /** Called when the user taps a tab or drops the droplet on one. */
47
+ onTabSelected?: (index: number) => void;
48
+ /**
49
+ * Minimizes the bar (an addition of this package): it gets shorter and narrower, each tab keeps
50
+ * only its first child (the icon) and the rest (the label) fades out. Animated natively. Inside a
51
+ * `MinimizeOnScrollProvider`, leave it out: the bar follows the provider. Android only.
52
+ */
53
+ minimized?: boolean;
54
+ /**
55
+ * Called with `false` when the user expands the minimized bar by touching it. With
56
+ * `useMinimizeOnScroll`, pass its `setMinimized`; inside a `MinimizeOnScrollProvider` it isn't
57
+ * needed.
58
+ */
59
+ onMinimizedChange?: (minimized: boolean) => void;
60
+ /** Colour the selected tab's content takes under the droplet. Default system blue. */
61
+ accentColor?: ColorValue;
62
+ /** Colour of the glass bar. */
63
+ containerColor?: ColorValue;
64
+ /** One child per tab, e.g. `AndroidGlassTab`. Tabs get equal widths. */
65
+ children?: ReactNode;
66
+ };
67
+ export type AndroidGlassTabProps = {
68
+ icon?: ReactNode;
69
+ label?: string;
70
+ labelStyle?: StyleProp<TextStyle>;
71
+ };
72
+ //# sourceMappingURL=AndroidGlassComponents.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassComponents.types.d.ts","sourceRoot":"","sources":["../src/AndroidGlassComponents.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,GAAG;IAC5D,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,6BAA6B;IAC7B,UA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":"AndroidGlassComponents.types.js","sourceRoot":"","sources":["../src/AndroidGlassComponents.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { ColorValue, StyleProp, TextStyle, ViewProps } from 'react-native';\n\nimport type { AndroidGlassViewProps } from './AndroidGlassView.types';\n\n/**\n * Accepts every `AndroidGlassView` glass prop. `cornerRadius` defaults to a capsule.\n * Children (label, icon, …) are drawn inside the glass and follow its press deformation; they\n * are decorative, so don't put interactive elements in a button.\n */\nexport type AndroidGlassButtonProps = AndroidGlassViewProps & {\n /** Called when the button is tapped. */\n onPress?: () => void;\n /** Convenience label, rendered before the children. */\n title?: string;\n titleStyle?: StyleProp<TextStyle>;\n /**\n * Press and drag feedback: the glass stretches towards the finger and a highlight follows it.\n * Default true.\n */\n interactive?: boolean;\n};\n\nexport type AndroidGlassToggleProps = ViewProps & {\n value?: boolean;\n onValueChange?: (value: boolean) => void;\n /** Track colour when on. Default iOS green. */\n accentColor?: ColorValue;\n /** Track colour when off. */\n trackColor?: ColorValue;\n};\n\nexport type AndroidGlassSliderProps = ViewProps & {\n value?: number;\n /** Default 0. */\n minimumValue?: number;\n /** Default 1. */\n maximumValue?: number;\n /** Called continuously while the thumb is dragged. */\n onValueChange?: (value: number) => void;\n /** Called once when the finger is lifted, or after a tap on the track. */\n onSlidingComplete?: (value: number) => void;\n /** Colour of the filled part of the track. Default system blue. */\n accentColor?: ColorValue;\n trackColor?: ColorValue;\n};\n\nexport type AndroidGlassBottomTabsProps = ViewProps & {\n /** Index of the selected tab. */\n selectedIndex?: number;\n /** Called when the user taps a tab or drops the droplet on one. */\n onTabSelected?: (index: number) => void;\n /**\n * Minimizes the bar (an addition of this package): it gets shorter and narrower, each tab keeps\n * only its first child (the icon) and the rest (the label) fades out. Animated natively. Inside a\n * `MinimizeOnScrollProvider`, leave it out: the bar follows the provider. Android only.\n */\n minimized?: boolean;\n /**\n * Called with `false` when the user expands the minimized bar by touching it. With\n * `useMinimizeOnScroll`, pass its `setMinimized`; inside a `MinimizeOnScrollProvider` it isn't\n * needed.\n */\n onMinimizedChange?: (minimized: boolean) => void;\n /** Colour the selected tab's content takes under the droplet. Default system blue. */\n accentColor?: ColorValue;\n /** Colour of the glass bar. */\n containerColor?: ColorValue;\n /** One child per tab, e.g. `AndroidGlassTab`. Tabs get equal widths. */\n children?: ReactNode;\n};\n\nexport type AndroidGlassTabProps = {\n icon?: ReactNode;\n label?: string;\n labelStyle?: StyleProp<TextStyle>;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassSliderProps } from './AndroidGlassComponents.types';
3
+ export default function AndroidGlassSlider({ value, minimumValue, maximumValue, onValueChange, onSlidingComplete, accentColor, trackColor, style, ...rest }: AndroidGlassSliderProps): React.JSX.Element;
4
+ //# sourceMappingURL=AndroidGlassSlider.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassSlider.android.d.ts","sourceRoot":"","sources":["../src/AndroidGlassSlider.android.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAoB9E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACR,EAAE,uBAAuB,qBA4BzB"}
@@ -0,0 +1,27 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+ import { StyleSheet } from 'react-native';
4
+ import { toNativeColor } from './utils';
5
+ const NativeAndroidGlassSlider = requireNativeView('ExpoAndroidGlassView', 'AndroidGlassSlider');
6
+ export default function AndroidGlassSlider({ value, minimumValue, maximumValue, onValueChange, onSlidingComplete, accentColor, trackColor, style, ...rest }) {
7
+ const min = minimumValue ?? 0;
8
+ // Without a `value` prop, the slider keeps the position the user gives it.
9
+ const [ownValue, setOwnValue] = React.useState(min);
10
+ // Sent back with `value`, so the native side can tell a stale value (JS still catching up with
11
+ // earlier events) from a current one.
12
+ const [eventCount, setEventCount] = React.useState(0);
13
+ const handleEvent = (event) => {
14
+ const { value: next, eventCount: count } = event.nativeEvent;
15
+ setEventCount((current) => Math.max(current, count));
16
+ setOwnValue(next);
17
+ return next;
18
+ };
19
+ return (<NativeAndroidGlassSlider accessibilityRole="adjustable" {...rest} style={[styles.slider, style]} value={value ?? ownValue} minimumValue={min} maximumValue={maximumValue ?? 1} mostRecentEventCount={eventCount} accentColor={toNativeColor(accentColor)} trackColor={toNativeColor(trackColor)} onValueChange={(event) => onValueChange?.(handleEvent(event))} onSlidingComplete={(event) => onSlidingComplete?.(handleEvent(event))}/>);
20
+ }
21
+ const styles = StyleSheet.create({
22
+ slider: {
23
+ height: 36,
24
+ alignSelf: 'stretch',
25
+ },
26
+ });
27
+ //# sourceMappingURL=AndroidGlassSlider.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassSlider.android.js","sourceRoot":"","sources":["../src/AndroidGlassSlider.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAgB1D,MAAM,wBAAwB,GAC5B,iBAAiB,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACiB;IACxB,MAAM,GAAG,GAAG,YAAY,IAAI,CAAC,CAAC;IAC9B,2EAA2E;IAC3E,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AAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { AndroidGlassSliderProps } from './AndroidGlassComponents.types';\nimport { type NativeColor, toNativeColor } from './utils';\n\ntype ValueEvent = { nativeEvent: { value: number; eventCount: number } };\n\ntype NativeAndroidGlassSliderProps = Omit<\n AndroidGlassSliderProps,\n 'onValueChange' | 'onSlidingComplete' | 'accentColor' | 'trackColor'\n> & {\n /** Count of the last event handled here (see ControlledProp on the native side). */\n mostRecentEventCount: number;\n onValueChange: (event: ValueEvent) => void;\n onSlidingComplete: (event: ValueEvent) => void;\n accentColor?: NativeColor;\n trackColor?: NativeColor;\n};\n\nconst NativeAndroidGlassSlider: React.ComponentType<NativeAndroidGlassSliderProps> =\n requireNativeView('ExpoAndroidGlassView', 'AndroidGlassSlider');\n\nexport default function AndroidGlassSlider({\n value,\n minimumValue,\n maximumValue,\n onValueChange,\n onSlidingComplete,\n accentColor,\n trackColor,\n style,\n ...rest\n}: AndroidGlassSliderProps) {\n const min = minimumValue ?? 0;\n // Without a `value` prop, the slider keeps the position the user gives it.\n const [ownValue, setOwnValue] = React.useState(min);\n // Sent back with `value`, so the native side can tell a stale value (JS still catching up with\n // earlier events) from a current one.\n const [eventCount, setEventCount] = React.useState(0);\n const handleEvent = (event: ValueEvent) => {\n const { value: next, eventCount: count } = event.nativeEvent;\n setEventCount((current) => Math.max(current, count));\n setOwnValue(next);\n return next;\n };\n return (\n <NativeAndroidGlassSlider\n accessibilityRole=\"adjustable\"\n {...rest}\n style={[styles.slider, style]}\n value={value ?? ownValue}\n minimumValue={min}\n maximumValue={maximumValue ?? 1}\n mostRecentEventCount={eventCount}\n accentColor={toNativeColor(accentColor)}\n trackColor={toNativeColor(trackColor)}\n onValueChange={(event) => onValueChange?.(handleEvent(event))}\n onSlidingComplete={(event) => onSlidingComplete?.(handleEvent(event))}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n slider: {\n height: 36,\n alignSelf: 'stretch',\n },\n});\n"]}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassSliderProps } from './AndroidGlassComponents.types';
3
+ /** iOS and web fallback: a plain slider with the same API. */
4
+ export default function AndroidGlassSlider({ value, minimumValue, maximumValue, onValueChange, onSlidingComplete, accentColor, trackColor, style, onLayout, ...rest }: AndroidGlassSliderProps): React.JSX.Element;
5
+ //# sourceMappingURL=AndroidGlassSlider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassSlider.d.ts","sourceRoot":"","sources":["../src/AndroidGlassSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,8DAA8D;AAC9D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAS,EACT,YAAgB,EAChB,YAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,WAAuB,EACvB,UAAuC,EACvC,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,uBAAuB,qBA+BzB"}
@@ -0,0 +1,47 @@
1
+ import * as React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ /** iOS and web fallback: a plain slider with the same API. */
4
+ export default function AndroidGlassSlider({ value = 0, minimumValue = 0, maximumValue = 1, onValueChange, onSlidingComplete, accentColor = '#0088FF', trackColor = 'rgba(120, 120, 120, 0.2)', style, onLayout, ...rest }) {
5
+ const [width, setWidth] = React.useState(0);
6
+ const range = maximumValue - minimumValue || 1;
7
+ const progress = Math.min(1, Math.max(0, (value - minimumValue) / range));
8
+ const valueAt = (event) => minimumValue + Math.min(1, Math.max(0, event.nativeEvent.locationX / (width || 1))) * range;
9
+ return (<View accessibilityRole="adjustable" {...rest} onStartShouldSetResponder={() => true} onMoveShouldSetResponder={() => true} onResponderTerminationRequest={() => false} onResponderGrant={(event) => onValueChange?.(valueAt(event))} onResponderMove={(event) => onValueChange?.(valueAt(event))} onResponderRelease={(event) => onSlidingComplete?.(valueAt(event))} onLayout={(event) => {
10
+ setWidth(event.nativeEvent.layout.width);
11
+ onLayout?.(event);
12
+ }} style={[styles.container, style]}>
13
+ <View pointerEvents="none" style={[styles.track, { backgroundColor: trackColor }]}>
14
+ <View style={[styles.fill, { width: `${progress * 100}%`, backgroundColor: accentColor }]}/>
15
+ </View>
16
+ <View pointerEvents="none" style={[styles.thumb, { left: `${progress * 100}%` }]}/>
17
+ </View>);
18
+ }
19
+ const styles = StyleSheet.create({
20
+ container: {
21
+ height: 36,
22
+ alignSelf: 'stretch',
23
+ justifyContent: 'center',
24
+ },
25
+ track: {
26
+ height: 6,
27
+ borderRadius: 3,
28
+ overflow: 'hidden',
29
+ },
30
+ fill: {
31
+ height: '100%',
32
+ },
33
+ thumb: {
34
+ position: 'absolute',
35
+ width: 40,
36
+ height: 24,
37
+ marginLeft: -20,
38
+ borderRadius: 12,
39
+ backgroundColor: '#ffffff',
40
+ shadowColor: '#000000',
41
+ shadowOpacity: 0.15,
42
+ shadowRadius: 4,
43
+ shadowOffset: { width: 0, height: 1 },
44
+ elevation: 2,
45
+ },
46
+ });
47
+ //# sourceMappingURL=AndroidGlassSlider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassSlider.js","sourceRoot":"","sources":["../src/AndroidGlassSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA8B,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAI5E,8DAA8D;AAC9D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,GAAG,CAAC,EACT,YAAY,GAAG,CAAC,EAChB,YAAY,GAA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AE,CAAC,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,SAAS;QAC1B,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QACrC,SAAS,EAAE,CAAC;KACb;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { type GestureResponderEvent, StyleSheet, View } from 'react-native';\n\nimport type { AndroidGlassSliderProps } from './AndroidGlassComponents.types';\n\n/** iOS and web fallback: a plain slider with the same API. */\nexport default function AndroidGlassSlider({\n value = 0,\n minimumValue = 0,\n maximumValue = 1,\n onValueChange,\n onSlidingComplete,\n accentColor = '#0088FF',\n trackColor = 'rgba(120, 120, 120, 0.2)',\n style,\n onLayout,\n ...rest\n}: AndroidGlassSliderProps) {\n const [width, setWidth] = React.useState(0);\n const range = maximumValue - minimumValue || 1;\n const progress = Math.min(1, Math.max(0, (value - minimumValue) / range));\n\n const valueAt = (event: GestureResponderEvent) =>\n minimumValue + Math.min(1, Math.max(0, event.nativeEvent.locationX / (width || 1))) * range;\n\n return (\n <View\n accessibilityRole=\"adjustable\"\n {...rest}\n onStartShouldSetResponder={() => true}\n onMoveShouldSetResponder={() => true}\n onResponderTerminationRequest={() => false}\n onResponderGrant={(event) => onValueChange?.(valueAt(event))}\n onResponderMove={(event) => onValueChange?.(valueAt(event))}\n onResponderRelease={(event) => onSlidingComplete?.(valueAt(event))}\n onLayout={(event) => {\n setWidth(event.nativeEvent.layout.width);\n onLayout?.(event);\n }}\n style={[styles.container, style]}>\n <View pointerEvents=\"none\" style={[styles.track, { backgroundColor: trackColor }]}>\n <View\n style={[styles.fill, { width: `${progress * 100}%`, backgroundColor: accentColor }]}\n />\n </View>\n <View pointerEvents=\"none\" style={[styles.thumb, { left: `${progress * 100}%` }]} />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n height: 36,\n alignSelf: 'stretch',\n justifyContent: 'center',\n },\n track: {\n height: 6,\n borderRadius: 3,\n overflow: 'hidden',\n },\n fill: {\n height: '100%',\n },\n thumb: {\n position: 'absolute',\n width: 40,\n height: 24,\n marginLeft: -20,\n borderRadius: 12,\n backgroundColor: '#ffffff',\n shadowColor: '#000000',\n shadowOpacity: 0.15,\n shadowRadius: 4,\n shadowOffset: { width: 0, height: 1 },\n elevation: 2,\n },\n});\n"]}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassTabProps } from './AndroidGlassComponents.types';
3
+ /**
4
+ * An icon over a label, like Kyant's LiquidBottomTab. Use as a child of AndroidGlassBottomTabs.
5
+ * The icon gets a view of its own: a minimized tab bar keeps each tab's first child and fades the
6
+ * rest (the label) out.
7
+ */
8
+ export default function AndroidGlassTab({ icon, label, labelStyle }: AndroidGlassTabProps): React.JSX.Element;
9
+ //# sourceMappingURL=AndroidGlassTab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassTab.d.ts","sourceRoot":"","sources":["../src/AndroidGlassTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,oBAAoB,qBAWxF"}
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { StyleSheet, Text, View } from 'react-native';
3
+ /**
4
+ * An icon over a label, like Kyant's LiquidBottomTab. Use as a child of AndroidGlassBottomTabs.
5
+ * The icon gets a view of its own: a minimized tab bar keeps each tab's first child and fades the
6
+ * rest (the label) out.
7
+ */
8
+ export default function AndroidGlassTab({ icon, label, labelStyle }) {
9
+ return (<>
10
+ {icon != null ? <View collapsable={false}>{icon}</View> : null}
11
+ {label != null ? (<Text numberOfLines={1} style={[styles.label, labelStyle]}>
12
+ {label}
13
+ </Text>) : null}
14
+ </>);
15
+ }
16
+ const styles = StyleSheet.create({
17
+ label: {
18
+ fontSize: 12,
19
+ color: '#000000',
20
+ },
21
+ });
22
+ //# sourceMappingURL=AndroidGlassTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassTab.js","sourceRoot":"","sources":["../src/AndroidGlassTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAwB;IACvF,OAAO,CACL,EACE;MAAA,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAC9D;MAAA,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CACf,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CACxD;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type { AndroidGlassTabProps } from './AndroidGlassComponents.types';\n\n/**\n * An icon over a label, like Kyant's LiquidBottomTab. Use as a child of AndroidGlassBottomTabs.\n * The icon gets a view of its own: a minimized tab bar keeps each tab's first child and fades the\n * rest (the label) out.\n */\nexport default function AndroidGlassTab({ icon, label, labelStyle }: AndroidGlassTabProps) {\n return (\n <>\n {icon != null ? <View collapsable={false}>{icon}</View> : null}\n {label != null ? (\n <Text numberOfLines={1} style={[styles.label, labelStyle]}>\n {label}\n </Text>\n ) : null}\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n label: {\n fontSize: 12,\n color: '#000000',\n },\n});\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassToggleProps } from './AndroidGlassComponents.types';
3
+ export default function AndroidGlassToggle({ value, onValueChange, accentColor, trackColor, style, ...rest }: AndroidGlassToggleProps): React.JSX.Element;
4
+ //# sourceMappingURL=AndroidGlassToggle.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassToggle.android.d.ts","sourceRoot":"","sources":["../src/AndroidGlassToggle.android.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAmB9E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACR,EAAE,uBAAuB,qBAyBzB"}
@@ -0,0 +1,27 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+ import { StyleSheet } from 'react-native';
4
+ import { toNativeColor } from './utils';
5
+ const NativeAndroidGlassToggle = requireNativeView('ExpoAndroidGlassView', 'AndroidGlassToggle');
6
+ export default function AndroidGlassToggle({ value, onValueChange, accentColor, trackColor, style, ...rest }) {
7
+ // Without a `value` prop, the switch keeps the user's choice.
8
+ const [ownValue, setOwnValue] = React.useState(false);
9
+ // Sent back with `value`, so the native side can tell a stale value (JS still catching up with
10
+ // earlier changes) from a current one.
11
+ const [eventCount, setEventCount] = React.useState(0);
12
+ const checked = value ?? ownValue;
13
+ return (<NativeAndroidGlassToggle accessibilityRole="switch" accessibilityState={{ checked }} {...rest} style={[styles.toggle, style]} value={checked} mostRecentEventCount={eventCount} accentColor={toNativeColor(accentColor)} trackColor={toNativeColor(trackColor)} onValueChange={(event) => {
14
+ const { value: next, eventCount: count } = event.nativeEvent;
15
+ setEventCount((current) => Math.max(current, count));
16
+ setOwnValue(next);
17
+ onValueChange?.(next);
18
+ }}/>);
19
+ }
20
+ const styles = StyleSheet.create({
21
+ // The track is 64 × 28 dp; the thumb grows past it while pressed.
22
+ toggle: {
23
+ width: 64,
24
+ height: 28,
25
+ },
26
+ });
27
+ //# sourceMappingURL=AndroidGlassToggle.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassToggle.android.js","sourceRoot":"","sources":["../src/AndroidGlassToggle.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAe1D,MAAM,wBAAwB,GAC5B,iBAAiB,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACiB;IACxB,8DAA8D;IAC9D,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,+FAA+F;IAC/F,uCAAuC;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,KAAK,IAAI,QAAQ,CAAC;IAClC,OAAO,CACL,CAAC,wBAAwB,CACvB,iBAAiB,CAAC,QAAQ,CAC1B,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAChC,IAAI,IAAI,CAAC,CACT,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAC9B,KAAK,CAAC,CAAC,OAAO,CAAC,CACf,oBAAoB,CAAC,CAAC,UAAU,CAAC,CACjC,WAAW,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CACxC,UAAU,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CACtC,aAAa,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC;YAC7D,aAAa,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;YACrD,WAAW,CAAC,IAAI,CAAC,CAAC;YAClB,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAC,EACF,CACH,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,kEAAkE;IAClE,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;KACX;CACF,CAAC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { AndroidGlassToggleProps } from './AndroidGlassComponents.types';\nimport { type NativeColor, toNativeColor } from './utils';\n\ntype ValueEvent = { nativeEvent: { value: boolean; eventCount: number } };\n\ntype NativeAndroidGlassToggleProps = Omit<\n AndroidGlassToggleProps,\n 'onValueChange' | 'accentColor' | 'trackColor'\n> & {\n /** Count of the last change event handled here (see ControlledProp on the native side). */\n mostRecentEventCount: number;\n onValueChange: (event: ValueEvent) => void;\n accentColor?: NativeColor;\n trackColor?: NativeColor;\n};\n\nconst NativeAndroidGlassToggle: React.ComponentType<NativeAndroidGlassToggleProps> =\n requireNativeView('ExpoAndroidGlassView', 'AndroidGlassToggle');\n\nexport default function AndroidGlassToggle({\n value,\n onValueChange,\n accentColor,\n trackColor,\n style,\n ...rest\n}: AndroidGlassToggleProps) {\n // Without a `value` prop, the switch keeps the user's choice.\n const [ownValue, setOwnValue] = React.useState(false);\n // Sent back with `value`, so the native side can tell a stale value (JS still catching up with\n // earlier changes) from a current one.\n const [eventCount, setEventCount] = React.useState(0);\n const checked = value ?? ownValue;\n return (\n <NativeAndroidGlassToggle\n accessibilityRole=\"switch\"\n accessibilityState={{ checked }}\n {...rest}\n style={[styles.toggle, style]}\n value={checked}\n mostRecentEventCount={eventCount}\n accentColor={toNativeColor(accentColor)}\n trackColor={toNativeColor(trackColor)}\n onValueChange={(event) => {\n const { value: next, eventCount: count } = event.nativeEvent;\n setEventCount((current) => Math.max(current, count));\n setOwnValue(next);\n onValueChange?.(next);\n }}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n // The track is 64 × 28 dp; the thumb grows past it while pressed.\n toggle: {\n width: 64,\n height: 28,\n },\n});\n"]}
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassToggleProps } from './AndroidGlassComponents.types';
3
+ /** iOS and web fallback: the platform switch with the same API. */
4
+ export default function AndroidGlassToggle({ value, onValueChange, accentColor, trackColor, ...rest }: AndroidGlassToggleProps): React.JSX.Element;
5
+ //# sourceMappingURL=AndroidGlassToggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassToggle.d.ts","sourceRoot":"","sources":["../src/AndroidGlassToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,mEAAmE;AACnE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,GAAG,IAAI,EACR,EAAE,uBAAuB,qBASzB"}
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { Switch } from 'react-native';
3
+ /** iOS and web fallback: the platform switch with the same API. */
4
+ export default function AndroidGlassToggle({ value, onValueChange, accentColor, trackColor, ...rest }) {
5
+ return (<Switch {...rest} value={value ?? false} onValueChange={onValueChange} trackColor={{ false: trackColor ?? undefined, true: accentColor ?? '#34C759' }}/>);
6
+ }
7
+ //# sourceMappingURL=AndroidGlassToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassToggle.js","sourceRoot":"","sources":["../src/AndroidGlassToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,mEAAmE;AACnE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,GAAG,IAAI,EACiB;IACxB,OAAO,CACL,CAAC,MAAM,CACL,IAAI,IAAI,CAAC,CACT,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CACtB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,IAAI,SAAS,EAAE,IAAI,EAAE,WAAW,IAAI,SAAS,EAAE,CAAC,EAC/E,CACH,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { Switch } from 'react-native';\n\nimport type { AndroidGlassToggleProps } from './AndroidGlassComponents.types';\n\n/** iOS and web fallback: the platform switch with the same API. */\nexport default function AndroidGlassToggle({\n value,\n onValueChange,\n accentColor,\n trackColor,\n ...rest\n}: AndroidGlassToggleProps) {\n return (\n <Switch\n {...rest}\n value={value ?? false}\n onValueChange={onValueChange}\n trackColor={{ false: trackColor ?? undefined, true: accentColor ?? '#34C759' }}\n />\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassViewProps } from './AndroidGlassView.types';
3
+ export default function AndroidGlassView({ cornerRadius, tintColor, surfaceColor, fallbackColor, style, ...rest }: AndroidGlassViewProps): React.JSX.Element;
4
+ //# sourceMappingURL=AndroidGlassView.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassView.android.d.ts","sourceRoot":"","sources":["../src/AndroidGlassView.android.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAiBtE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,EACb,KAAK,EACL,GAAG,IAAI,EACR,EAAE,qBAAqB,qBAYvB"}
@@ -0,0 +1,10 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+ import { StyleSheet } from 'react-native';
4
+ import { toNativeColor } from './utils';
5
+ const NativeAndroidGlassView = requireNativeView('ExpoAndroidGlassView', 'AndroidGlassView');
6
+ export default function AndroidGlassView({ cornerRadius, tintColor, surfaceColor, fallbackColor, style, ...rest }) {
7
+ const borderRadius = StyleSheet.flatten(style)?.borderRadius;
8
+ return (<NativeAndroidGlassView {...rest} style={style} cornerRadius={cornerRadius ?? (typeof borderRadius === 'number' ? borderRadius : undefined)} tintColor={toNativeColor(tintColor)} surfaceColor={toNativeColor(surfaceColor)} fallbackColor={toNativeColor(fallbackColor)}/>);
9
+ }
10
+ //# sourceMappingURL=AndroidGlassView.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassView.android.js","sourceRoot":"","sources":["../src/AndroidGlassView.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAW1D,MAAM,sBAAsB,GAAqD,iBAAiB,CAChG,sBAAsB,EACtB,kBAAkB,CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,EACb,KAAK,EACL,GAAG,IAAI,EACe;IACtB,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC7D,OAAO,CACL,CAAC,sBAAsB,CACrB,IAAI,IAAI,CAAC,CACT,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,YAAY,CAAC,CAAC,YAAY,IAAI,CAAC,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAC5F,SAAS,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CACpC,YAAY,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAC1C,aAAa,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,EAC5C,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { AndroidGlassViewProps } from './AndroidGlassView.types';\nimport { type NativeColor, toNativeColor } from './utils';\n\ntype NativeAndroidGlassViewProps = Omit<\n AndroidGlassViewProps,\n 'tintColor' | 'surfaceColor' | 'fallbackColor'\n> & {\n tintColor?: NativeColor;\n surfaceColor?: NativeColor;\n fallbackColor?: NativeColor;\n};\n\nconst NativeAndroidGlassView: React.ComponentType<NativeAndroidGlassViewProps> = requireNativeView(\n 'ExpoAndroidGlassView',\n 'AndroidGlassView'\n);\n\nexport default function AndroidGlassView({\n cornerRadius,\n tintColor,\n surfaceColor,\n fallbackColor,\n style,\n ...rest\n}: AndroidGlassViewProps) {\n const borderRadius = StyleSheet.flatten(style)?.borderRadius;\n return (\n <NativeAndroidGlassView\n {...rest}\n style={style}\n cornerRadius={cornerRadius ?? (typeof borderRadius === 'number' ? borderRadius : undefined)}\n tintColor={toNativeColor(tintColor)}\n surfaceColor={toNativeColor(surfaceColor)}\n fallbackColor={toNativeColor(fallbackColor)}\n />\n );\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { AndroidGlassViewProps } from './AndroidGlassView.types';
3
+ /**
4
+ * iOS and web fallback: the glass effect is Android-only, so render a plain translucent surface
5
+ * with the same shape. Children render as usual.
6
+ */
7
+ export default function AndroidGlassView({ cornerRadius, fallbackColor, blurRadius: _blurRadius, refractionHeight: _refractionHeight, refractionAmount: _refractionAmount, chromaticAberration: _chromaticAberration, depthEffect: _depthEffect, vibrancy: _vibrancy, highlight: _highlight, shadow: _shadow, tintColor: _tintColor, surfaceColor: _surfaceColor, style, ...rest }: AndroidGlassViewProps): React.JSX.Element;
8
+ //# sourceMappingURL=AndroidGlassView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassView.d.ts","sourceRoot":"","sources":["../src/AndroidGlassView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAItE;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,YAAY,EACZ,aAAa,EACb,UAAU,EAAE,WAAW,EACvB,gBAAgB,EAAE,iBAAiB,EACnC,gBAAgB,EAAE,iBAAiB,EACnC,mBAAmB,EAAE,oBAAoB,EACzC,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,aAAa,EAC3B,KAAK,EACL,GAAG,IAAI,EACR,EAAE,qBAAqB,qBAcvB"}
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { View } from 'react-native';
3
+ const DEFAULT_FALLBACK_COLOR = 'rgba(255, 255, 255, 0.7)';
4
+ /**
5
+ * iOS and web fallback: the glass effect is Android-only, so render a plain translucent surface
6
+ * with the same shape. Children render as usual.
7
+ */
8
+ export default function AndroidGlassView({ cornerRadius, fallbackColor, blurRadius: _blurRadius, refractionHeight: _refractionHeight, refractionAmount: _refractionAmount, chromaticAberration: _chromaticAberration, depthEffect: _depthEffect, vibrancy: _vibrancy, highlight: _highlight, shadow: _shadow, tintColor: _tintColor, surfaceColor: _surfaceColor, style, ...rest }) {
9
+ return (<View {...rest} style={[
10
+ {
11
+ backgroundColor: fallbackColor ?? DEFAULT_FALLBACK_COLOR,
12
+ borderRadius: cornerRadius ?? 24,
13
+ overflow: 'hidden',
14
+ },
15
+ style,
16
+ ]}/>);
17
+ }
18
+ //# sourceMappingURL=AndroidGlassView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassView.js","sourceRoot":"","sources":["../src/AndroidGlassView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,YAAY,EACZ,aAAa,EACb,UAAU,EAAE,WAAW,EACvB,gBAAgB,EAAE,iBAAiB,EACnC,gBAAgB,EAAE,iBAAiB,EACnC,mBAAmB,EAAE,oBAAoB,EACzC,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,aAAa,EAC3B,KAAK,EACL,GAAG,IAAI,EACe;IACtB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,IAAI,CAAC,CACT,KAAK,CAAC,CAAC;YACL;gBACE,eAAe,EAAE,aAAa,IAAI,sBAAsB;gBACxD,YAAY,EAAE,YAAY,IAAI,EAAE;gBAChC,QAAQ,EAAE,QAAQ;aACnB;YACD,KAAK;SACN,CAAC,EACF,CACH,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { View } from 'react-native';\n\nimport type { AndroidGlassViewProps } from './AndroidGlassView.types';\n\nconst DEFAULT_FALLBACK_COLOR = 'rgba(255, 255, 255, 0.7)';\n\n/**\n * iOS and web fallback: the glass effect is Android-only, so render a plain translucent surface\n * with the same shape. Children render as usual.\n */\nexport default function AndroidGlassView({\n cornerRadius,\n fallbackColor,\n blurRadius: _blurRadius,\n refractionHeight: _refractionHeight,\n refractionAmount: _refractionAmount,\n chromaticAberration: _chromaticAberration,\n depthEffect: _depthEffect,\n vibrancy: _vibrancy,\n highlight: _highlight,\n shadow: _shadow,\n tintColor: _tintColor,\n surfaceColor: _surfaceColor,\n style,\n ...rest\n}: AndroidGlassViewProps) {\n return (\n <View\n {...rest}\n style={[\n {\n backgroundColor: fallbackColor ?? DEFAULT_FALLBACK_COLOR,\n borderRadius: cornerRadius ?? 24,\n overflow: 'hidden',\n },\n style,\n ]}\n />\n );\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import type { ColorValue, ViewProps } from 'react-native';
2
+ export type AndroidGlassViewProps = ViewProps & {
3
+ /**
4
+ * Corner radius of the glass shape, in dp. Falls back to `style.borderRadius`, then 24.
5
+ * Use a large value (e.g. 999) for a capsule.
6
+ */
7
+ cornerRadius?: number;
8
+ /** Backdrop blur radius in dp. Default 2. `0` disables the blur. */
9
+ blurRadius?: number;
10
+ /** Width of the refracting rim in dp. Default 12. `0` disables refraction. */
11
+ refractionHeight?: number;
12
+ /** How far content is bent at the rim, in dp. Default 24. */
13
+ refractionAmount?: number;
14
+ /** Split the refraction per colour channel for a prism fringe. Default false. */
15
+ chromaticAberration?: boolean;
16
+ /** Stronger, depth-like bending towards the rim. Default false. */
17
+ depthEffect?: boolean;
18
+ /** Boost the saturation of what is behind the glass. Default true. */
19
+ vibrancy?: boolean;
20
+ /** Specular highlight along the rim. Default true. */
21
+ highlight?: boolean;
22
+ /** Soft drop shadow around the shape. Default true. */
23
+ shadow?: boolean;
24
+ /** Colour tint mixed into the glass. */
25
+ tintColor?: ColorValue;
26
+ /** Flat colour painted over the glass, on top of the refraction. */
27
+ surfaceColor?: ColorValue;
28
+ /**
29
+ * Surface colour used where the effect cannot run: Android 11 and older, iOS and web.
30
+ * Default `rgba(255, 255, 255, 0.7)`.
31
+ */
32
+ fallbackColor?: ColorValue;
33
+ };
34
+ //# sourceMappingURL=AndroidGlassView.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassView.types.d.ts","sourceRoot":"","sources":["../src/AndroidGlassView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,oEAAoE;IACpE,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;CAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AndroidGlassView.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AndroidGlassView.types.js","sourceRoot":"","sources":["../src/AndroidGlassView.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorValue, ViewProps } from 'react-native';\n\nexport type AndroidGlassViewProps = ViewProps & {\n /**\n * Corner radius of the glass shape, in dp. Falls back to `style.borderRadius`, then 24.\n * Use a large value (e.g. 999) for a capsule.\n */\n cornerRadius?: number;\n /** Backdrop blur radius in dp. Default 2. `0` disables the blur. */\n blurRadius?: number;\n /** Width of the refracting rim in dp. Default 12. `0` disables refraction. */\n refractionHeight?: number;\n /** How far content is bent at the rim, in dp. Default 24. */\n refractionAmount?: number;\n /** Split the refraction per colour channel for a prism fringe. Default false. */\n chromaticAberration?: boolean;\n /** Stronger, depth-like bending towards the rim. Default false. */\n depthEffect?: boolean;\n /** Boost the saturation of what is behind the glass. Default true. */\n vibrancy?: boolean;\n /** Specular highlight along the rim. Default true. */\n highlight?: boolean;\n /** Soft drop shadow around the shape. Default true. */\n shadow?: boolean;\n /** Colour tint mixed into the glass. */\n tintColor?: ColorValue;\n /** Flat colour painted over the glass, on top of the refraction. */\n surfaceColor?: ColorValue;\n /**\n * Surface colour used where the effect cannot run: Android 11 and older, iOS and web.\n * Default `rgba(255, 255, 255, 0.7)`.\n */\n fallbackColor?: ColorValue;\n};\n"]}
@@ -0,0 +1,41 @@
1
+ import * as React from 'react';
2
+ import { type NativeScrollEvent, type NativeSyntheticEvent } from 'react-native';
3
+ type ScrollHandler = (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
4
+ type SetMinimized = (minimized: boolean) => void;
5
+ type MinimizedState = {
6
+ minimized: boolean;
7
+ setMinimized: SetMinimized;
8
+ };
9
+ export type MinimizeOnScroll = {
10
+ /** Pass to `AndroidGlassBottomTabs`' `minimized`. */
11
+ minimized: boolean;
12
+ /** Pass to `AndroidGlassBottomTabs`' `onMinimizedChange`. Can also force a state. */
13
+ setMinimized: SetMinimized;
14
+ /** Pass to the list's `onScroll`, together with `scrollEventThrottle={16}`. */
15
+ onScroll: ScrollHandler;
16
+ };
17
+ /** Read by AndroidGlassBottomTabs; not part of the public API. */
18
+ export declare const MinimizedStateContext: React.Context<MinimizedState | null>;
19
+ /**
20
+ * Shares one minimize state between the tab bar and any number of lists, e.g. around a
21
+ * navigator's tabs, where the bar and the screens are different components. Inside it,
22
+ * `AndroidGlassBottomTabs` follows the shared state unless it gets a `minimized` prop.
23
+ */
24
+ export declare function MinimizeOnScrollProvider({ children }: {
25
+ children?: React.ReactNode;
26
+ }): React.JSX.Element;
27
+ /**
28
+ * `onScroll` for a list inside `MinimizeOnScrollProvider`: scrolling down minimizes the tab bar,
29
+ * scrolling up (or reaching the top) expands it. Each list tracks its own position, and the
30
+ * component isn't re-rendered when the bar minimizes. Returns `undefined` outside a provider and
31
+ * on iOS and web, where the bar doesn't minimize, so the list sends no scroll events for nothing.
32
+ */
33
+ export declare function useMinimizeOnScrollHandler(): ScrollHandler | undefined;
34
+ /**
35
+ * Minimize state plus an `onScroll` for one list. Inside `MinimizeOnScrollProvider` it uses the
36
+ * shared state; outside, its own, which is enough when the list and the tab bar are in the same
37
+ * component.
38
+ */
39
+ export declare function useMinimizeOnScroll(): MinimizeOnScroll;
40
+ export {};
41
+ //# sourceMappingURL=MinimizeOnScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinimizeOnScroll.d.ts","sourceRoot":"","sources":["../src/MinimizeOnScroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAY,MAAM,cAAc,CAAC;AAO3F,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;AAC9E,KAAK,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;AACjD,KAAK,cAAc,GAAG;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAE,CAAC;AAEzE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,qFAAqF;IACrF,YAAY,EAAE,YAAY,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAIF,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,sCAAmD,CAAC;AAkCtF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAOpF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,aAAa,GAAG,SAAS,CAItE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAMtD"}
@@ -0,0 +1,76 @@
1
+ import * as React from 'react';
2
+ import { Platform } from 'react-native';
3
+ /** Within this distance from the top of the list, the bar is always expanded. */
4
+ const TOP_ZONE = 24;
5
+ /** Smallest scroll step between two events that counts as a direction. */
6
+ const MIN_STEP = 3;
7
+ // Two contexts: lists only need the (stable) setter, so a minimize doesn't re-render screens.
8
+ const SetMinimizedContext = React.createContext(null);
9
+ /** Read by AndroidGlassBottomTabs; not part of the public API. */
10
+ export const MinimizedStateContext = React.createContext(null);
11
+ /** Minimize state whose setter only re-renders on a change (scroll events arrive every frame). */
12
+ function useMinimizedState() {
13
+ const [minimized, setState] = React.useState(false);
14
+ const current = React.useRef(false);
15
+ const setMinimized = React.useCallback((next) => {
16
+ if (current.current !== next) {
17
+ current.current = next;
18
+ setState(next);
19
+ }
20
+ }, []);
21
+ return React.useMemo(() => ({ minimized, setMinimized }), [minimized, setMinimized]);
22
+ }
23
+ /** Minimizes on scroll down; expands on scroll up and near the top. */
24
+ function useScrollHandler(setMinimized) {
25
+ const previousY = React.useRef(0);
26
+ return React.useCallback((event) => {
27
+ // Clamped to the scrollable range, so overscroll can't flip the direction for a frame.
28
+ const { contentOffset, contentSize, layoutMeasurement } = event.nativeEvent;
29
+ const maxY = Math.max(contentSize.height - layoutMeasurement.height, 0);
30
+ const y = Math.min(Math.max(contentOffset.y, 0), maxY);
31
+ const step = y - previousY.current;
32
+ previousY.current = y;
33
+ if (y < TOP_ZONE)
34
+ setMinimized(false);
35
+ else if (step > MIN_STEP)
36
+ setMinimized(true);
37
+ else if (step < -MIN_STEP)
38
+ setMinimized(false);
39
+ }, [setMinimized]);
40
+ }
41
+ /**
42
+ * Shares one minimize state between the tab bar and any number of lists, e.g. around a
43
+ * navigator's tabs, where the bar and the screens are different components. Inside it,
44
+ * `AndroidGlassBottomTabs` follows the shared state unless it gets a `minimized` prop.
45
+ */
46
+ export function MinimizeOnScrollProvider({ children }) {
47
+ const state = useMinimizedState();
48
+ return (<SetMinimizedContext.Provider value={state.setMinimized}>
49
+ <MinimizedStateContext.Provider value={state}>{children}</MinimizedStateContext.Provider>
50
+ </SetMinimizedContext.Provider>);
51
+ }
52
+ /**
53
+ * `onScroll` for a list inside `MinimizeOnScrollProvider`: scrolling down minimizes the tab bar,
54
+ * scrolling up (or reaching the top) expands it. Each list tracks its own position, and the
55
+ * component isn't re-rendered when the bar minimizes. Returns `undefined` outside a provider and
56
+ * on iOS and web, where the bar doesn't minimize, so the list sends no scroll events for nothing.
57
+ */
58
+ export function useMinimizeOnScrollHandler() {
59
+ const setMinimized = React.useContext(SetMinimizedContext);
60
+ const onScroll = useScrollHandler(setMinimized ?? noop);
61
+ return setMinimized != null && Platform.OS === 'android' ? onScroll : undefined;
62
+ }
63
+ /**
64
+ * Minimize state plus an `onScroll` for one list. Inside `MinimizeOnScrollProvider` it uses the
65
+ * shared state; outside, its own, which is enough when the list and the tab bar are in the same
66
+ * component.
67
+ */
68
+ export function useMinimizeOnScroll() {
69
+ const shared = React.useContext(MinimizedStateContext);
70
+ const own = useMinimizedState();
71
+ const { minimized, setMinimized } = shared ?? own;
72
+ const onScroll = useScrollHandler(setMinimized);
73
+ return { minimized, setMinimized, onScroll };
74
+ }
75
+ function noop() { }
76
+ //# sourceMappingURL=MinimizeOnScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinimizeOnScroll.js","sourceRoot":"","sources":["../src/MinimizeOnScroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAqD,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE3F,iFAAiF;AACjF,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,0EAA0E;AAC1E,MAAM,QAAQ,GAAG,CAAC,CAAC;AAenB,8FAA8F;AAC9F,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAsB,IAAI,CAAC,CAAC;AAC3E,kEAAkE;AAClE,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAAwB,IAAI,CAAC,CAAC;AAEtF,kGAAkG;AAClG,SAAS,iBAAiB;IACxB,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,IAAa,EAAE,EAAE;QACvD,IAAI,OAAO,CAAC,OAAO,KAAK,IAA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AAC,EAAE,QAAQ,EAAkC;IACnF,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,OAAO,CACL,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CACtD;MAAA,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAC1F;IAAA,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAChC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B;IACxC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC;IACxD,OAAO,YAAY,IAAI,IAAI,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IACvD,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;IAChC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,GAAG,CAAC;IAClD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAChD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,IAAI,KAAI,CAAC","sourcesContent":["import * as React from 'react';\nimport { type NativeScrollEvent, type NativeSyntheticEvent, Platform } from 'react-native';\n\n/** Within this distance from the top of the list, the bar is always expanded. */\nconst TOP_ZONE = 24;\n/** Smallest scroll step between two events that counts as a direction. */\nconst MIN_STEP = 3;\n\ntype ScrollHandler = (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\ntype SetMinimized = (minimized: boolean) => void;\ntype MinimizedState = { minimized: boolean; setMinimized: SetMinimized };\n\nexport type MinimizeOnScroll = {\n /** Pass to `AndroidGlassBottomTabs`' `minimized`. */\n minimized: boolean;\n /** Pass to `AndroidGlassBottomTabs`' `onMinimizedChange`. Can also force a state. */\n setMinimized: SetMinimized;\n /** Pass to the list's `onScroll`, together with `scrollEventThrottle={16}`. */\n onScroll: ScrollHandler;\n};\n\n// Two contexts: lists only need the (stable) setter, so a minimize doesn't re-render screens.\nconst SetMinimizedContext = React.createContext<SetMinimized | null>(null);\n/** Read by AndroidGlassBottomTabs; not part of the public API. */\nexport const MinimizedStateContext = React.createContext<MinimizedState | null>(null);\n\n/** Minimize state whose setter only re-renders on a change (scroll events arrive every frame). */\nfunction useMinimizedState(): MinimizedState {\n const [minimized, setState] = React.useState(false);\n const current = React.useRef(false);\n const setMinimized = React.useCallback((next: boolean) => {\n if (current.current !== next) {\n current.current = next;\n setState(next);\n }\n }, []);\n return React.useMemo(() => ({ minimized, setMinimized }), [minimized, setMinimized]);\n}\n\n/** Minimizes on scroll down; expands on scroll up and near the top. */\nfunction useScrollHandler(setMinimized: SetMinimized): ScrollHandler {\n const previousY = React.useRef(0);\n return React.useCallback(\n (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n // Clamped to the scrollable range, so overscroll can't flip the direction for a frame.\n const { contentOffset, contentSize, layoutMeasurement } = event.nativeEvent;\n const maxY = Math.max(contentSize.height - layoutMeasurement.height, 0);\n const y = Math.min(Math.max(contentOffset.y, 0), maxY);\n const step = y - previousY.current;\n previousY.current = y;\n if (y < TOP_ZONE) setMinimized(false);\n else if (step > MIN_STEP) setMinimized(true);\n else if (step < -MIN_STEP) setMinimized(false);\n },\n [setMinimized]\n );\n}\n\n/**\n * Shares one minimize state between the tab bar and any number of lists, e.g. around a\n * navigator's tabs, where the bar and the screens are different components. Inside it,\n * `AndroidGlassBottomTabs` follows the shared state unless it gets a `minimized` prop.\n */\nexport function MinimizeOnScrollProvider({ children }: { children?: React.ReactNode }) {\n const state = useMinimizedState();\n return (\n <SetMinimizedContext.Provider value={state.setMinimized}>\n <MinimizedStateContext.Provider value={state}>{children}</MinimizedStateContext.Provider>\n </SetMinimizedContext.Provider>\n );\n}\n\n/**\n * `onScroll` for a list inside `MinimizeOnScrollProvider`: scrolling down minimizes the tab bar,\n * scrolling up (or reaching the top) expands it. Each list tracks its own position, and the\n * component isn't re-rendered when the bar minimizes. Returns `undefined` outside a provider and\n * on iOS and web, where the bar doesn't minimize, so the list sends no scroll events for nothing.\n */\nexport function useMinimizeOnScrollHandler(): ScrollHandler | undefined {\n const setMinimized = React.useContext(SetMinimizedContext);\n const onScroll = useScrollHandler(setMinimized ?? noop);\n return setMinimized != null && Platform.OS === 'android' ? onScroll : undefined;\n}\n\n/**\n * Minimize state plus an `onScroll` for one list. Inside `MinimizeOnScrollProvider` it uses the\n * shared state; outside, its own, which is enough when the list and the tab bar are in the same\n * component.\n */\nexport function useMinimizeOnScroll(): MinimizeOnScroll {\n const shared = React.useContext(MinimizedStateContext);\n const own = useMinimizedState();\n const { minimized, setMinimized } = shared ?? own;\n const onScroll = useScrollHandler(setMinimized);\n return { minimized, setMinimized, onScroll };\n}\n\nfunction noop() {}\n"]}
@@ -0,0 +1,10 @@
1
+ export { default as AndroidGlassView } from './AndroidGlassView';
2
+ export { default as AndroidGlassButton } from './AndroidGlassButton';
3
+ export { default as AndroidGlassToggle } from './AndroidGlassToggle';
4
+ export { default as AndroidGlassSlider } from './AndroidGlassSlider';
5
+ export { default as AndroidGlassBottomTabs } from './AndroidGlassBottomTabs';
6
+ export { default as AndroidGlassTab } from './AndroidGlassTab';
7
+ export { MinimizeOnScrollProvider, useMinimizeOnScroll, useMinimizeOnScrollHandler, type MinimizeOnScroll, } from './MinimizeOnScroll';
8
+ export * from './AndroidGlassView.types';
9
+ export * from './AndroidGlassComponents.types';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,12 @@
1
+ // Each component resolves to its native Android implementation (*.android.tsx) on Android, and
2
+ // to a plain fallback with the same API on iOS and web.
3
+ export { default as AndroidGlassView } from './AndroidGlassView';
4
+ export { default as AndroidGlassButton } from './AndroidGlassButton';
5
+ export { default as AndroidGlassToggle } from './AndroidGlassToggle';
6
+ export { default as AndroidGlassSlider } from './AndroidGlassSlider';
7
+ export { default as AndroidGlassBottomTabs } from './AndroidGlassBottomTabs';
8
+ export { default as AndroidGlassTab } from './AndroidGlassTab';
9
+ export { MinimizeOnScrollProvider, useMinimizeOnScroll, useMinimizeOnScrollHandler, } from './MinimizeOnScroll';
10
+ export * from './AndroidGlassView.types';
11
+ export * from './AndroidGlassComponents.types';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wDAAwD;AACxD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,oBAAoB,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC","sourcesContent":["// Each component resolves to its native Android implementation (*.android.tsx) on Android, and\n// to a plain fallback with the same API on iOS and web.\nexport { default as AndroidGlassView } from './AndroidGlassView';\nexport { default as AndroidGlassButton } from './AndroidGlassButton';\nexport { default as AndroidGlassToggle } from './AndroidGlassToggle';\nexport { default as AndroidGlassSlider } from './AndroidGlassSlider';\nexport { default as AndroidGlassBottomTabs } from './AndroidGlassBottomTabs';\nexport { default as AndroidGlassTab } from './AndroidGlassTab';\nexport {\n MinimizeOnScrollProvider,\n useMinimizeOnScroll,\n useMinimizeOnScrollHandler,\n type MinimizeOnScroll,\n} from './MinimizeOnScroll';\nexport * from './AndroidGlassView.types';\nexport * from './AndroidGlassComponents.types';\n"]}
@@ -0,0 +1,5 @@
1
+ import { type ColorValue } from 'react-native';
2
+ export type NativeColor = number | null;
3
+ /** Converts a React Native colour to the ARGB int the native views expect. */
4
+ export declare function toNativeColor(color: ColorValue | undefined): NativeColor;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,cAAc,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;AAExC,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,CAIxE"}
package/build/utils.js ADDED
@@ -0,0 +1,9 @@
1
+ import { processColor } from 'react-native';
2
+ /** Converts a React Native colour to the ARGB int the native views expect. */
3
+ export function toNativeColor(color) {
4
+ if (color == null)
5
+ return null;
6
+ const processed = processColor(color);
7
+ return typeof processed === 'number' ? processed : null;
8
+ }
9
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAI7D,8EAA8E;AAC9E,MAAM,UAAU,aAAa,CAAC,KAA6B;IACzD,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC","sourcesContent":["import { type ColorValue, processColor } from 'react-native';\n\nexport type NativeColor = number | null;\n\n/** Converts a React Native colour to the ARGB int the native views expect. */\nexport function toNativeColor(color: ColorValue | undefined): NativeColor {\n if (color == null) return null;\n const processed = processColor(color);\n return typeof processed === 'number' ? processed : null;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-android-glass-view",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Liquid Glass views, buttons, sliders and toggles for React Native on Android (Jetpack Compose, powered by Kyant0/AndroidLiquidGlass)",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
package/tsconfig.json CHANGED
@@ -30,7 +30,8 @@
30
30
  "noUnusedLocals": true,
31
31
  "noUnusedParameters": false,
32
32
  "rootDir": "./src",
33
- "outDir": "./build"
33
+ "outDir": "./build",
34
+ "noEmit": false
34
35
  },
35
36
  "include": [
36
37
  "./src"
@@ -38,6 +39,5 @@
38
39
  "exclude": [
39
40
  "**/__mocks__/*",
40
41
  "**/__tests__/*"
41
- ],
42
- "extends": "expo/tsconfig.base"
42
+ ]
43
43
  }