expo-ui-easy 0.0.0-stage → 0.0.2

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 (157) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +146 -2
  3. package/lib/module/android/components/bars.js +31 -0
  4. package/lib/module/android/components/bars.js.map +1 -0
  5. package/lib/module/android/components/buttons.js +65 -0
  6. package/lib/module/android/components/buttons.js.map +1 -0
  7. package/lib/module/android/components/generated.js +388 -0
  8. package/lib/module/android/components/generated.js.map +1 -0
  9. package/lib/module/android/components/inputs.js +68 -0
  10. package/lib/module/android/components/inputs.js.map +1 -0
  11. package/lib/module/android/components/menus.js +63 -0
  12. package/lib/module/android/components/menus.js.map +1 -0
  13. package/lib/module/android/components/overlays.js +60 -0
  14. package/lib/module/android/components/overlays.js.map +1 -0
  15. package/lib/module/android/components/pickers.js +74 -0
  16. package/lib/module/android/components/pickers.js.map +1 -0
  17. package/lib/module/android/components/scrollables.js +19 -0
  18. package/lib/module/android/components/scrollables.js.map +1 -0
  19. package/lib/module/android/components/text.js +37 -0
  20. package/lib/module/android/components/text.js.map +1 -0
  21. package/lib/module/android/host/HostDebugOverlay.js +60 -0
  22. package/lib/module/android/host/HostDebugOverlay.js.map +1 -0
  23. package/lib/module/android/host/host.js +77 -0
  24. package/lib/module/android/host/host.js.map +1 -0
  25. package/lib/module/android/index.js +30 -0
  26. package/lib/module/android/index.js.map +1 -0
  27. package/lib/module/android/internal/button-padding.js +19 -0
  28. package/lib/module/android/internal/button-padding.js.map +1 -0
  29. package/lib/module/android/internal/host-stats.js +54 -0
  30. package/lib/module/android/internal/host-stats.js.map +1 -0
  31. package/lib/module/android/internal/modifiers.js +26 -0
  32. package/lib/module/android/internal/modifiers.js.map +1 -0
  33. package/lib/module/android/internal/statics.js +13 -0
  34. package/lib/module/android/internal/statics.js.map +1 -0
  35. package/lib/module/android/internal/text-input.js +14 -0
  36. package/lib/module/android/internal/text-input.js.map +1 -0
  37. package/lib/module/android/internal/translate.js +21 -0
  38. package/lib/module/android/internal/translate.js.map +1 -0
  39. package/lib/module/android/internal/types.js +4 -0
  40. package/lib/module/android/internal/types.js.map +1 -0
  41. package/lib/module/android/internal/utils.js +26 -0
  42. package/lib/module/android/internal/utils.js.map +1 -0
  43. package/lib/module/android/internal/variants.js +45 -0
  44. package/lib/module/android/internal/variants.js.map +1 -0
  45. package/lib/module/android/internal/wrap.js +65 -0
  46. package/lib/module/android/internal/wrap.js.map +1 -0
  47. package/lib/module/android/modifiers.js +5 -0
  48. package/lib/module/android/modifiers.js.map +1 -0
  49. package/lib/module/android/recipes/NativeList.js +138 -0
  50. package/lib/module/android/recipes/NativeList.js.map +1 -0
  51. package/lib/module/android/recipes/list-utils.js +18 -0
  52. package/lib/module/android/recipes/list-utils.js.map +1 -0
  53. package/lib/module/android/support/native-support.js +22 -0
  54. package/lib/module/android/support/native-support.js.map +1 -0
  55. package/lib/module/index.android.js +4 -0
  56. package/lib/module/index.android.js.map +1 -0
  57. package/lib/module/index.ios.js +6 -0
  58. package/lib/module/index.ios.js.map +1 -0
  59. package/lib/module/index.js +4 -0
  60. package/lib/module/index.js.map +1 -0
  61. package/lib/module/index.web.js +6 -0
  62. package/lib/module/index.web.js.map +1 -0
  63. package/lib/module/ios/README.md +4 -0
  64. package/lib/module/package.json +1 -0
  65. package/lib/typescript/package.json +1 -0
  66. package/lib/typescript/src/android/components/bars.d.ts +16 -0
  67. package/lib/typescript/src/android/components/bars.d.ts.map +1 -0
  68. package/lib/typescript/src/android/components/buttons.d.ts +44 -0
  69. package/lib/typescript/src/android/components/buttons.d.ts.map +1 -0
  70. package/lib/typescript/src/android/components/generated.d.ts +173 -0
  71. package/lib/typescript/src/android/components/generated.d.ts.map +1 -0
  72. package/lib/typescript/src/android/components/inputs.d.ts +33 -0
  73. package/lib/typescript/src/android/components/inputs.d.ts.map +1 -0
  74. package/lib/typescript/src/android/components/menus.d.ts +37 -0
  75. package/lib/typescript/src/android/components/menus.d.ts.map +1 -0
  76. package/lib/typescript/src/android/components/overlays.d.ts +22 -0
  77. package/lib/typescript/src/android/components/overlays.d.ts.map +1 -0
  78. package/lib/typescript/src/android/components/pickers.d.ts +31 -0
  79. package/lib/typescript/src/android/components/pickers.d.ts.map +1 -0
  80. package/lib/typescript/src/android/components/scrollables.d.ts +7 -0
  81. package/lib/typescript/src/android/components/scrollables.d.ts.map +1 -0
  82. package/lib/typescript/src/android/components/text.d.ts +24 -0
  83. package/lib/typescript/src/android/components/text.d.ts.map +1 -0
  84. package/lib/typescript/src/android/host/HostDebugOverlay.d.ts +10 -0
  85. package/lib/typescript/src/android/host/HostDebugOverlay.d.ts.map +1 -0
  86. package/lib/typescript/src/android/host/host.d.ts +33 -0
  87. package/lib/typescript/src/android/host/host.d.ts.map +1 -0
  88. package/lib/typescript/src/android/index.d.ts +31 -0
  89. package/lib/typescript/src/android/index.d.ts.map +1 -0
  90. package/lib/typescript/src/android/internal/button-padding.d.ts +14 -0
  91. package/lib/typescript/src/android/internal/button-padding.d.ts.map +1 -0
  92. package/lib/typescript/src/android/internal/host-stats.d.ts +23 -0
  93. package/lib/typescript/src/android/internal/host-stats.d.ts.map +1 -0
  94. package/lib/typescript/src/android/internal/modifiers.d.ts +12 -0
  95. package/lib/typescript/src/android/internal/modifiers.d.ts.map +1 -0
  96. package/lib/typescript/src/android/internal/statics.d.ts +6 -0
  97. package/lib/typescript/src/android/internal/statics.d.ts.map +1 -0
  98. package/lib/typescript/src/android/internal/text-input.d.ts +16 -0
  99. package/lib/typescript/src/android/internal/text-input.d.ts.map +1 -0
  100. package/lib/typescript/src/android/internal/translate.d.ts +10 -0
  101. package/lib/typescript/src/android/internal/translate.d.ts.map +1 -0
  102. package/lib/typescript/src/android/internal/types.d.ts +43 -0
  103. package/lib/typescript/src/android/internal/types.d.ts.map +1 -0
  104. package/lib/typescript/src/android/internal/utils.d.ts +14 -0
  105. package/lib/typescript/src/android/internal/utils.d.ts.map +1 -0
  106. package/lib/typescript/src/android/internal/variants.d.ts +35 -0
  107. package/lib/typescript/src/android/internal/variants.d.ts.map +1 -0
  108. package/lib/typescript/src/android/internal/wrap.d.ts +36 -0
  109. package/lib/typescript/src/android/internal/wrap.d.ts.map +1 -0
  110. package/lib/typescript/src/android/modifiers.d.ts +2 -0
  111. package/lib/typescript/src/android/modifiers.d.ts.map +1 -0
  112. package/lib/typescript/src/android/recipes/NativeList.d.ts +58 -0
  113. package/lib/typescript/src/android/recipes/NativeList.d.ts.map +1 -0
  114. package/lib/typescript/src/android/recipes/list-utils.d.ts +5 -0
  115. package/lib/typescript/src/android/recipes/list-utils.d.ts.map +1 -0
  116. package/lib/typescript/src/android/support/native-support.d.ts +9 -0
  117. package/lib/typescript/src/android/support/native-support.d.ts.map +1 -0
  118. package/lib/typescript/src/index.android.d.ts +2 -0
  119. package/lib/typescript/src/index.android.d.ts.map +1 -0
  120. package/lib/typescript/src/index.d.ts +2 -0
  121. package/lib/typescript/src/index.d.ts.map +1 -0
  122. package/lib/typescript/src/index.ios.d.ts +1 -0
  123. package/lib/typescript/src/index.ios.d.ts.map +1 -0
  124. package/lib/typescript/src/index.web.d.ts +1 -0
  125. package/lib/typescript/src/index.web.d.ts.map +1 -0
  126. package/package.json +79 -4
  127. package/src/android/components/bars.tsx +30 -0
  128. package/src/android/components/buttons.tsx +75 -0
  129. package/src/android/components/generated.ts +247 -0
  130. package/src/android/components/inputs.tsx +81 -0
  131. package/src/android/components/menus.tsx +56 -0
  132. package/src/android/components/overlays.tsx +51 -0
  133. package/src/android/components/pickers.tsx +73 -0
  134. package/src/android/components/scrollables.tsx +12 -0
  135. package/src/android/components/text.tsx +35 -0
  136. package/src/android/host/HostDebugOverlay.tsx +34 -0
  137. package/src/android/host/host.tsx +91 -0
  138. package/src/android/index.ts +71 -0
  139. package/src/android/internal/button-padding.ts +29 -0
  140. package/src/android/internal/host-stats.ts +59 -0
  141. package/src/android/internal/modifiers.ts +30 -0
  142. package/src/android/internal/statics.ts +13 -0
  143. package/src/android/internal/text-input.ts +23 -0
  144. package/src/android/internal/translate.ts +26 -0
  145. package/src/android/internal/types.ts +44 -0
  146. package/src/android/internal/utils.ts +26 -0
  147. package/src/android/internal/variants.tsx +63 -0
  148. package/src/android/internal/wrap.tsx +95 -0
  149. package/src/android/modifiers.ts +2 -0
  150. package/src/android/recipes/NativeList.tsx +175 -0
  151. package/src/android/recipes/list-utils.ts +15 -0
  152. package/src/android/support/native-support.ts +23 -0
  153. package/src/index.android.ts +1 -0
  154. package/src/index.ios.ts +5 -0
  155. package/src/index.ts +1 -0
  156. package/src/index.web.ts +5 -0
  157. package/src/ios/README.md +4 -0
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 <yashdahiwale>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
7
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
8
+ to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of
11
+ the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
14
+ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
16
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,147 @@
1
- # Temporary Holding Version
1
+ # Expo UI Easy (Android / Jetpack Compose)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Expo UI's Jetpack Compose components, usable like normal React Native components.
4
+
5
+ **Rule: Expo UI is the source of truth.** Prop types and sub-components
6
+ (`Switch.ThumbContent`, `Slider.Thumb`, `AlertDialog.Title`, ...) come directly from Expo. Related Expo components
7
+ are consolidated into typed families. The only prop renames are for props that React Native already has under
8
+ another name:
9
+
10
+ | You write (RN name) | Expo UI prop | Where |
11
+ | --- | --- | --- |
12
+ | `onPress` | `onClick` | buttons, chips, FABs, `RadioButton`, `Surface`, nav items, menu items, ... |
13
+ | `disabled` | `enabled` (inverted) | everything that has `enabled` |
14
+ | `onValueChange` | `onCheckedChange` | `Switch`, `Checkbox`, `ToggleButton` family, `SegmentedButton`, `Surface` |
15
+ | `numberOfLines` | `maxLines` | `Text` |
16
+ | `onChangeText` | `onValueChange` | `TextField` |
17
+ | `placeholder`, `secureTextEntry`, `multiline`, `editable` | `TextField.Placeholder` slot, `visualTransformation='password'`, `singleLine` (inverted), `readOnly` (inverted) | `TextField`, `OutlinedTextField` |
18
+ | `style` | layout style of the auto-created `Host` | everything (`containerStyle` on `Text`, whose own `style` is Expo's `TextStyle`) |
19
+ | `testID`, `accessibilityLabel` | `testID` / `semantics` modifiers | everything |
20
+
21
+ Everything else is Expo's: `colors`, `modifiers`, `shape`, `contentPadding`, `min` / `max` / `steps`, `progress`,
22
+ `strokeCap`, `amplitude`, ... Because the public types are derived from Expo's own prop types, new Expo props
23
+ show up here automatically. An explicit Expo prop always wins over an RN alias (e.g. `singleLine` over `multiline`).
24
+
25
+ ## Variants
26
+
27
+ Where Expo UI ships one component per look, a family here is one component with a typed prop (`Button variant`,
28
+ `TextField variant`, `Card variant`, `IconButton variant`, `IconToggleButton variant`, `Chip variant`,
29
+ `Slider variant`, `ProgressIndicator variant`, `Badge variant`, `SearchBar variant`, `LoadingIndicator variant`,
30
+ `FloatingActionButton size`). Props that exist on one variant only are accepted only with it, and the old per-variant
31
+ names no longer exist.
32
+
33
+ ```tsx
34
+ <Button onPress={save}>Save</Button>
35
+ <Button variant="outlined" startIcon={<Icon source={add} size={18} />}>Add</Button>
36
+ <TextField variant="outlined" value={name} onChangeText={setText} placeholder="Name" />
37
+ <Text variant="titleLarge">Title</Text>
38
+ ```
39
+
40
+ ## Components
41
+
42
+ Everything is imported from one place. Related Expo components are consolidated into one typed family. Slots
43
+ remain Expo's own statics, e.g. `AlertDialog.Title`, `ListItem.HeadlineContent`, `TextField.Label`, `Chip.Label`.
44
+
45
+ - **Buttons**: `Button` (`variant`: `filled` | `tonal` | `outlined` | `elevated` | `text`) with extra
46
+ `startIcon` / `endIcon` (see Icons below); `IconButton` (`variant`: `standard` | `filled` | `tonal` | `outlined`);
47
+ `FloatingActionButton` (`size`: `small` | `medium` | `large` | `extended`); `SplitButtonLayout`.
48
+ - **Selection**: `Switch` (`variant`: `standard` | `sync`), `Checkbox` (`variant`: `standard` | `tri-state`),
49
+ `RadioButton`, `ToggleButton`, `IconToggleButton`, `SegmentedButton` (`mode`: item, single or multiple),
50
+ and `Chip` (`assist` | `filter` | `input` | `suggestion`).
51
+ - **Sliders**: `Slider` (`standard` | `range` | `vertical`).
52
+ - **Text**: `Text` (`variant`: a Material 3 type role), `TextField` (`filled` | `outlined` | `basic`).
53
+ - **Progress**: `ProgressIndicator` (`circular` | `linear` | `circular-wavy` | `linear-wavy`),
54
+ `LoadingIndicator` (`default` | `contained`).
55
+ - **Layout and containers**: `Row`, `Column`, `Box`, `FlowRow`, `Spacer`, `Surface`, `Card` (`variant`: `filled` | `elevated` | `outlined`), `ListItem`, `Divider` (`orientation`: `horizontal` | `vertical`), `Badge` (`standard` | `anchored`), `Icon`, `Image`,
56
+ `AnimatedVisibility`.
57
+ - **Pickers**: `DateTimePicker` (`type`: `date` | `time` | `date-time` | `range`, optional `dialog`).
58
+ Android has no combined date-and-time dialog, so that combination is rejected by TypeScript.
59
+ - **Scrollables**: `LazyColumn`, `LazyRow`, `PagerView`, `Carousel` (`multi-browse` | `uncontained` |
60
+ `centered-hero`), `PullToRefreshBox`. They fill
61
+ their parent by default instead of matching contents (a scrollable needs a bounded size).
62
+ - **Overlays**: `AlertDialog` (`structured` | `basic`), `BottomSheet`, `Menu` (`dropdown` | `popup` | `exposed`),
63
+ `Snackbar` (host, queueing and styling in one component), and `Tooltip` (plain/rich slots).
64
+ - **Bars**: `TopAppBar`, `BottomNavigationBar` with `BottomNavigationBar.Item`, `SearchBar`
65
+ (`expanding` | `docked`), `FloatingToolbar`.
66
+ - **Not wrapped** (re-exported exactly as Expo ships them): hooks and factories (`useNativeState`,
67
+ `useMaterialColors`, `Shape`, `EnterTransition`, ...) and slot parts (`SplitButtonLeadingButton`,
68
+ `SwitchThumbContent`, ...), so their props keep Expo's names (`onClick`, `onCheckedChange`).
69
+
70
+ ## Host
71
+
72
+ `Host` is Expo's `Host`, plus it tells the components inside that a Compose root already exists. Put one around a
73
+ screen or section. A component used outside any `Host` creates its own (`matchContents`), which is convenient but
74
+ costs one Compose root per component. In development a warning fires at 25 of them.
75
+
76
+ ## NativeList
77
+
78
+ A FlatList-style list on ONE Host with Expo's recycling `LazyColumn` (the setup that measured about twice as fast as
79
+ a Host per row):
80
+
81
+ ```tsx
82
+ <NativeList
83
+ data={rows}
84
+ renderItem={({ item }) => <ListItem><ListItem.HeadlineContent><Text>{item.title}</Text></ListItem.HeadlineContent></ListItem>}
85
+ keyExtractor={(item) => String(item.id)} // default: item.key, then item.id, then the index
86
+ ListHeaderComponent={<Text>Header</Text>} // Compose elements, not React Native views
87
+ ListEmptyComponent={<Text>Nothing here</Text>}
88
+ ItemSeparatorComponent={<Divider />}
89
+ onEndReached={loadMore} // fires once per data length
90
+ refreshing={refreshing}
91
+ onRefresh={refresh} // enables pull to refresh
92
+ />
93
+ ```
94
+
95
+ Differences from FlatList: `onEndReachedThreshold` counts **rows** (default 4), not viewport lengths; `renderItem`
96
+ and the header / footer / separator parts must be Compose elements; there is no `horizontal` yet. `onEndReached` is
97
+ detected from which rows are mounted, so it needs `recycling` (the default). Expo's `contentPadding`,
98
+ `verticalArrangement`, `horizontalAlignment`, `modifiers`, `overscanCount` and `estimatedItemSize` pass through.
99
+
100
+ ## Finding accidental Hosts
101
+
102
+ Every component used outside a `Host` creates its own. In development, `<HostDebugOverlay />` (put it at the app
103
+ root) shows how many exist and which components made them, `useHostStats()` / `getHostStats()` give the same numbers,
104
+ and a console warning names the top offenders once there are 25. All of it is a no-op in production.
105
+
106
+ ## Icons in buttons
107
+
108
+ `startIcon` / `endIcon` take any Compose element. Three sources work:
109
+
110
+ | Source | Example | Inherits the button's color (incl. disabled) |
111
+ | --- | --- | --- |
112
+ | Material Symbols via Expo UI's universal `Icon` (recommended) | `<Icon name={AddIcon} size={18} />` with `import AddIcon from '@expo/material-symbols/add.xml'` and `import { Icon } from '@expo/ui'` | yes |
113
+ | Expo UI's Compose `Icon` | `<Icon source={require('./x.xml')} size={18} />` from `@expo/ui/jetpack-compose` | yes |
114
+ | `@expo/vector-icons` (React Native side) | `<RNHostView matchContents><Ionicons name="add" size={18} color="#fff" /></RNHostView>` | no, pass `color` yourself |
115
+
116
+ Vector icons are React Native views embedded into Compose, so each costs an extra RN view; prefer Material Symbols in
117
+ lists. With an icon present the Material3 icon padding is applied unless you pass your own `contentPadding`.
118
+
119
+ ## Notes and limits
120
+
121
+ - **Hot loops.** Every wrapped component adds a small per-node cost (a context read, a prop translation). For
122
+ thousands of rows inside one `Host`, import `Row` / `Column` / `Box` straight from `@expo/ui/jetpack-compose`, as
123
+ the stress test does; the props are identical.
124
+ - **Verified**: type-checks under strict settings, compile-time tests for the renamed props, unit tests for the prop
125
+ translation. The example app has one route per public component (`/component/<kebab-name>`), and a test keeps that list in step
126
+ with the manifest.
127
+ - **Not verified on a device**: whether Expo's parents (menus, rows, bars) accept the wrapper components as children
128
+ everywhere. If one misbehaves, import that one component from `@expo/ui/jetpack-compose` and tell me.
129
+
130
+ ## Adding or changing a component
131
+
132
+ Components are declared in `manifest/components.json` (name, category, renames, host preset, required native views).
133
+ `src/android/components/generated.ts` is generated from it:
134
+
135
+ ```bash
136
+ # edit manifest/components.json, then
137
+ npm run generate
138
+ ```
139
+
140
+ Families that differ only in look are `kind: "variants"` entries (see `variants` in the manifest). Hand-written components (`kind: "custom"`: `Button`, `TextField`, `Text`) stay in `src/android/components`.
141
+
142
+ ## Checks
143
+
144
+ `npm run typecheck` includes compile-time tests: wrong or Expo-only names (`onClick`, `enabled`, `maxLines`, ...) must
145
+ fail to compile, and generated checks confirm the manifest still matches Expo's prop types. `npm test` covers the prop
146
+ translation and the **contract tests**: a new, removed or renamed `@expo/ui` export, an unknown native view, or a stale
147
+ generated file fails the run.
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ import { memo } from 'react';
4
+ import * as Expo from '@expo/ui/jetpack-compose';
5
+ import { wrap } from "../internal/wrap.js";
6
+ const STRETCH = {
7
+ hostProps: {
8
+ matchContents: {
9
+ vertical: true
10
+ }
11
+ },
12
+ style: {
13
+ alignSelf: 'stretch'
14
+ }
15
+ };
16
+ const NavigationItem = wrap(Expo.NavigationBarItem, {
17
+ displayName: 'BottomNavigationBar.Item'
18
+ });
19
+ const NavigationBar = wrap(Expo.NavigationBar, {
20
+ displayName: 'BottomNavigationBar',
21
+ hostDefaults: STRETCH
22
+ });
23
+ const MemoizedNavigationBar = /*#__PURE__*/memo(NavigationBar);
24
+ MemoizedNavigationBar.displayName = 'BottomNavigationBar';
25
+ export const BottomNavigationBar = MemoizedNavigationBar;
26
+ BottomNavigationBar.Item = NavigationItem;
27
+ export const FloatingToolbar = wrap(Expo.HorizontalFloatingToolbar, {
28
+ displayName: 'FloatingToolbar',
29
+ hostDefaults: STRETCH
30
+ });
31
+ //# sourceMappingURL=bars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["memo","Expo","wrap","STRETCH","hostProps","matchContents","vertical","style","alignSelf","NavigationItem","NavigationBarItem","displayName","NavigationBar","hostDefaults","MemoizedNavigationBar","BottomNavigationBar","Item","FloatingToolbar","HorizontalFloatingToolbar"],"sourceRoot":"../../../../src","sources":["android/components/bars.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAA6B,OAAO;AACjD,OAAO,KAAKC,IAAI,MAAM,0BAA0B;AAEhD,SAASC,IAAI,QAA8B,qBAAkB;AAE7D,MAAMC,OAAO,GAAG;EAAEC,SAAS,EAAE;IAAEC,aAAa,EAAE;MAAEC,QAAQ,EAAE;IAAK;EAAE,CAAC;EAAEC,KAAK,EAAE;IAAEC,SAAS,EAAE;EAAU;AAAE,CAAU;AAE9G,MAAMC,cAAc,GAAGP,IAAI,CAACD,IAAI,CAACS,iBAAiB,EAAE;EAAEC,WAAW,EAAE;AAA2B,CAAC,CAAC;AAChG,MAAMC,aAAa,GAAGV,IAAI,CAACD,IAAI,CAACW,aAAa,EAAE;EAC7CD,WAAW,EAAE,qBAAqB;EAClCE,YAAY,EAAEV;AAChB,CAAC,CAAC;AAMF,MAAMW,qBAAqB,gBAAGd,IAAI,CAACY,aAAa,CAAC;AACjDE,qBAAqB,CAACH,WAAW,GAAG,qBAAqB;AACzD,OAAO,MAAMI,mBAAmB,GAAGD,qBAAgE;AACnGC,mBAAmB,CAACC,IAAI,GAAGP,cAAc;AAIzC,OAAO,MAAMQ,eAAuE,GAClFf,IAAI,CAACD,IAAI,CAACiB,yBAAyB,EAAE;EACnCP,WAAW,EAAE,iBAAiB;EAC9BE,YAAY,EAAEV;AAChB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ import { memo, useMemo } from 'react';
4
+ import * as Expo from '@expo/ui/jetpack-compose';
5
+ import { iconContentPadding } from "../internal/button-padding.js";
6
+ import { defined } from "../internal/utils.js";
7
+ import { createVariants } from "../internal/variants.js";
8
+ import { wrap } from "../internal/wrap.js";
9
+
10
+ /** What the Expo button family adds on top of its Expo props. */
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ function createButton(Native, displayName, family) {
13
+ const Base = wrap(Native, {
14
+ displayName
15
+ });
16
+ function ButtonWithIcons(props) {
17
+ const {
18
+ startIcon,
19
+ endIcon,
20
+ children,
21
+ contentPadding,
22
+ ...rest
23
+ } = props;
24
+ const hasStart = startIcon != null;
25
+ const hasEnd = endIcon != null;
26
+ const padding = useMemo(() => contentPadding ?? iconContentPadding(family, hasStart, hasEnd), [contentPadding, hasStart, hasEnd]);
27
+ // A plain string label is a convenience: Compose needs a Text element.
28
+ const label = typeof children === 'string' ? /*#__PURE__*/_jsx(Expo.Text, {
29
+ children: children
30
+ }) : children;
31
+ return /*#__PURE__*/_jsx(Base, {
32
+ ...rest,
33
+ ...defined({
34
+ contentPadding: padding
35
+ }),
36
+ children: hasStart || hasEnd ? /*#__PURE__*/_jsxs(Expo.Row, {
37
+ verticalAlignment: "center",
38
+ horizontalArrangement: {
39
+ spacedBy: 8
40
+ },
41
+ children: [startIcon, label, endIcon]
42
+ }) : label
43
+ });
44
+ }
45
+ ButtonWithIcons.displayName = displayName;
46
+ return /*#__PURE__*/memo(ButtonWithIcons);
47
+ }
48
+
49
+ /**
50
+ * One button, five Material3 looks. `variant` picks the Expo component: `filled` (default, `Button`),
51
+ * `tonal` (`FilledTonalButton`), `outlined`, `elevated` or `text`. Every variant takes the same props.
52
+ */
53
+ export const Button = createVariants({
54
+ displayName: 'Button',
55
+ prop: 'variant',
56
+ defaultVariant: 'filled',
57
+ variants: {
58
+ filled: createButton(Expo.Button, 'Button', 'standard'),
59
+ tonal: createButton(Expo.FilledTonalButton, 'Button', 'standard'),
60
+ outlined: createButton(Expo.OutlinedButton, 'Button', 'standard'),
61
+ elevated: createButton(Expo.ElevatedButton, 'Button', 'standard'),
62
+ text: createButton(Expo.TextButton, 'Button', 'text')
63
+ }
64
+ });
65
+ //# sourceMappingURL=buttons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["memo","useMemo","Expo","iconContentPadding","defined","createVariants","wrap","jsx","_jsx","jsxs","_jsxs","createButton","Native","displayName","family","Base","ButtonWithIcons","props","startIcon","endIcon","children","contentPadding","rest","hasStart","hasEnd","padding","label","Text","Row","verticalAlignment","horizontalArrangement","spacedBy","Button","prop","defaultVariant","variants","filled","tonal","FilledTonalButton","outlined","OutlinedButton","elevated","ElevatedButton","text","TextButton"],"sourceRoot":"../../../../src","sources":["android/components/buttons.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,OAAO,QAA6C,OAAO;AAC1E,OAAO,KAAKC,IAAI,MAAM,0BAA0B;AAChD,SAASC,kBAAkB,QAA2B,+BAA4B;AAClF,SAASC,OAAO,QAAQ,sBAAmB;AAE3C,SAASC,cAAc,QAAQ,yBAAsB;AACrD,SAASC,IAAI,QAAQ,qBAAkB;;AAEvC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgBA,SAASC,YAAYA,CAACC,MAAkB,EAAEC,WAAmB,EAAEC,MAAoB,EAAE;EACnF,MAAMC,IAAI,GAAGT,IAAI,CAACM,MAAM,EAAE;IAAEC;EAAY,CAAC,CAAC;EAE1C,SAASG,eAAeA,CAACC,KAAsB,EAAa;IAC1D,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAEC,QAAQ;MAAEC,cAAc;MAAE,GAAGC;IAAK,CAAC,GAAGL,KAAK;IACvE,MAAMM,QAAQ,GAAGL,SAAS,IAAI,IAAI;IAClC,MAAMM,MAAM,GAAGL,OAAO,IAAI,IAAI;IAE9B,MAAMM,OAAO,GAAGxB,OAAO,CACrB,MAAMoB,cAAc,IAAIlB,kBAAkB,CAACW,MAAM,EAAES,QAAQ,EAAEC,MAAM,CAAC,EACpE,CAACH,cAAc,EAAEE,QAAQ,EAAEC,MAAM,CACnC,CAAC;IACD;IACA,MAAME,KAAK,GAAG,OAAON,QAAQ,KAAK,QAAQ,gBAAGZ,IAAA,CAACN,IAAI,CAACyB,IAAI;MAAAP,QAAA,EAAEA;IAAQ,CAAY,CAAC,GAAGA,QAAQ;IAEzF,oBACEZ,IAAA,CAACO,IAAI;MAAA,GAAKO,IAAI;MAAA,GAAMlB,OAAO,CAAC;QAAEiB,cAAc,EAAEI;MAAQ,CAAC,CAAC;MAAAL,QAAA,EACrDG,QAAQ,IAAIC,MAAM,gBACjBd,KAAA,CAACR,IAAI,CAAC0B,GAAG;QAACC,iBAAiB,EAAC,QAAQ;QAACC,qBAAqB,EAAE;UAAEC,QAAQ,EAAE;QAAE,CAAE;QAAAX,QAAA,GACzEF,SAAS,EACTQ,KAAK,EACLP,OAAO;MAAA,CACA,CAAC,GAEXO;IACD,CACG,CAAC;EAEX;EAEAV,eAAe,CAACH,WAAW,GAAGA,WAAW;EACzC,oBAAOb,IAAI,CAACgB,eAAe,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMgB,MAAM,GAAG3B,cAAc,CAAC;EACnCQ,WAAW,EAAE,QAAQ;EACrBoB,IAAI,EAAE,SAAS;EACfC,cAAc,EAAE,QAAQ;EACxBC,QAAQ,EAAE;IACRC,MAAM,EAAEzB,YAAY,CAACT,IAAI,CAAC8B,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC;IACvDK,KAAK,EAAE1B,YAAY,CAACT,IAAI,CAACoC,iBAAiB,EAAE,QAAQ,EAAE,UAAU,CAAC;IACjEC,QAAQ,EAAE5B,YAAY,CAACT,IAAI,CAACsC,cAAc,EAAE,QAAQ,EAAE,UAAU,CAAC;IACjEC,QAAQ,EAAE9B,YAAY,CAACT,IAAI,CAACwC,cAAc,EAAE,QAAQ,EAAE,UAAU,CAAC;IACjEC,IAAI,EAAEhC,YAAY,CAACT,IAAI,CAAC0C,UAAU,EAAE,QAAQ,EAAE,MAAM;EACtD;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,388 @@
1
+ "use strict";
2
+
3
+ // AUTO-GENERATED by scripts/generate-components.mjs from manifest/components.json. DO NOT EDIT.
4
+ // Wrapped Expo UI components. Edit the manifest, not this file.
5
+
6
+ import * as Expo from '@expo/ui/jetpack-compose';
7
+ import { fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers';
8
+ import { createVariants } from "../internal/variants.js";
9
+ import { wrap } from "../internal/wrap.js";
10
+ const FILL_WIDTH = [fillMaxWidth()];
11
+ // Presets are documented in manifest/components.json ("presets").
12
+ const STRETCH = {
13
+ hostProps: {
14
+ matchContents: {
15
+ vertical: true
16
+ }
17
+ },
18
+ style: {
19
+ alignSelf: 'stretch'
20
+ }
21
+ };
22
+ const FILL_PARENT = {
23
+ hostProps: {
24
+ matchContents: false
25
+ },
26
+ style: {
27
+ flex: 1
28
+ }
29
+ };
30
+
31
+ // --- selection -------------------------------------------------------------
32
+ export const RadioButton = wrap(Expo.RadioButton, {
33
+ displayName: 'RadioButton'
34
+ });
35
+ export const ToggleButton = wrap(Expo.ToggleButton, {
36
+ displayName: 'ToggleButton',
37
+ rename: {
38
+ onValueChange: 'onCheckedChange'
39
+ }
40
+ });
41
+ export const Switch = createVariants({
42
+ displayName: 'Switch',
43
+ prop: 'variant',
44
+ defaultVariant: 'standard',
45
+ variants: {
46
+ 'standard': wrap(Expo.Switch, {
47
+ displayName: 'Switch',
48
+ rename: {
49
+ onValueChange: 'onCheckedChange'
50
+ }
51
+ }),
52
+ 'sync': wrap(Expo.SyncSwitch, {
53
+ displayName: 'Switch'
54
+ })
55
+ },
56
+ staticsFrom: Object.assign({}, Expo.Switch)
57
+ });
58
+ export const Checkbox = createVariants({
59
+ displayName: 'Checkbox',
60
+ prop: 'variant',
61
+ defaultVariant: 'standard',
62
+ variants: {
63
+ 'standard': wrap(Expo.Checkbox, {
64
+ displayName: 'Checkbox',
65
+ rename: {
66
+ onValueChange: 'onCheckedChange'
67
+ }
68
+ }),
69
+ 'tri-state': wrap(Expo.TriStateCheckbox, {
70
+ displayName: 'Checkbox'
71
+ })
72
+ }
73
+ });
74
+ export const IconToggleButton = createVariants({
75
+ displayName: 'IconToggleButton',
76
+ prop: 'variant',
77
+ defaultVariant: 'standard',
78
+ variants: {
79
+ 'standard': wrap(Expo.IconToggleButton, {
80
+ displayName: 'IconToggleButton',
81
+ rename: {
82
+ onValueChange: 'onCheckedChange'
83
+ }
84
+ }),
85
+ 'filled': wrap(Expo.FilledIconToggleButton, {
86
+ displayName: 'IconToggleButton',
87
+ rename: {
88
+ onValueChange: 'onCheckedChange'
89
+ }
90
+ }),
91
+ 'outlined': wrap(Expo.OutlinedIconToggleButton, {
92
+ displayName: 'IconToggleButton',
93
+ rename: {
94
+ onValueChange: 'onCheckedChange'
95
+ }
96
+ })
97
+ }
98
+ });
99
+ export const SegmentedButton = createVariants({
100
+ displayName: 'SegmentedButton',
101
+ prop: 'mode',
102
+ defaultVariant: 'item',
103
+ variants: {
104
+ 'item': wrap(Expo.SegmentedButton, {
105
+ displayName: 'SegmentedButton',
106
+ rename: {
107
+ onValueChange: 'onCheckedChange'
108
+ }
109
+ }),
110
+ 'single': wrap(Expo.SingleChoiceSegmentedButtonRow, {
111
+ displayName: 'SegmentedButton'
112
+ }),
113
+ 'multiple': wrap(Expo.MultiChoiceSegmentedButtonRow, {
114
+ displayName: 'SegmentedButton'
115
+ })
116
+ },
117
+ staticsFrom: Object.assign({}, Expo.SegmentedButton)
118
+ });
119
+ export const Chip = createVariants({
120
+ displayName: 'Chip',
121
+ prop: 'variant',
122
+ defaultVariant: 'assist',
123
+ variants: {
124
+ 'assist': wrap(Expo.AssistChip, {
125
+ displayName: 'Chip'
126
+ }),
127
+ 'filter': wrap(Expo.FilterChip, {
128
+ displayName: 'Chip'
129
+ }),
130
+ 'input': wrap(Expo.InputChip, {
131
+ displayName: 'Chip'
132
+ }),
133
+ 'suggestion': wrap(Expo.SuggestionChip, {
134
+ displayName: 'Chip'
135
+ })
136
+ },
137
+ staticsFrom: Object.assign({}, Expo.AssistChip, Expo.FilterChip, Expo.InputChip, Expo.SuggestionChip)
138
+ });
139
+ // --- sliders ---------------------------------------------------------------
140
+ export const Slider = createVariants({
141
+ displayName: 'Slider',
142
+ prop: 'variant',
143
+ defaultVariant: 'standard',
144
+ variants: {
145
+ 'standard': wrap(Expo.Slider, {
146
+ displayName: 'Slider',
147
+ hostDefaults: STRETCH,
148
+ leadingModifiers: FILL_WIDTH
149
+ }),
150
+ 'range': wrap(Expo.RangeSlider, {
151
+ displayName: 'Slider',
152
+ hostDefaults: STRETCH,
153
+ leadingModifiers: FILL_WIDTH
154
+ }),
155
+ 'vertical': wrap(Expo.VerticalSlider, {
156
+ displayName: 'Slider'
157
+ })
158
+ },
159
+ staticsFrom: Object.assign({}, Expo.Slider, Expo.VerticalSlider, Expo.RangeSlider)
160
+ });
161
+ // --- buttons ---------------------------------------------------------------
162
+ export const SplitButtonLayout = wrap(Expo.SplitButtonLayout, {
163
+ displayName: 'SplitButtonLayout'
164
+ });
165
+ export const IconButton = createVariants({
166
+ displayName: 'IconButton',
167
+ prop: 'variant',
168
+ defaultVariant: 'standard',
169
+ variants: {
170
+ 'standard': wrap(Expo.IconButton, {
171
+ displayName: 'IconButton'
172
+ }),
173
+ 'filled': wrap(Expo.FilledIconButton, {
174
+ displayName: 'IconButton'
175
+ }),
176
+ 'tonal': wrap(Expo.FilledTonalIconButton, {
177
+ displayName: 'IconButton'
178
+ }),
179
+ 'outlined': wrap(Expo.OutlinedIconButton, {
180
+ displayName: 'IconButton'
181
+ })
182
+ }
183
+ });
184
+ export const FloatingActionButton = createVariants({
185
+ displayName: 'FloatingActionButton',
186
+ prop: 'size',
187
+ defaultVariant: 'medium',
188
+ variants: {
189
+ 'small': wrap(Expo.SmallFloatingActionButton, {
190
+ displayName: 'FloatingActionButton'
191
+ }),
192
+ 'medium': wrap(Expo.FloatingActionButton, {
193
+ displayName: 'FloatingActionButton'
194
+ }),
195
+ 'large': wrap(Expo.LargeFloatingActionButton, {
196
+ displayName: 'FloatingActionButton'
197
+ }),
198
+ 'extended': wrap(Expo.ExtendedFloatingActionButton, {
199
+ displayName: 'FloatingActionButton'
200
+ })
201
+ },
202
+ staticsFrom: Object.assign({}, Expo.ExtendedFloatingActionButton)
203
+ });
204
+ // --- progress --------------------------------------------------------------
205
+ export const ProgressIndicator = createVariants({
206
+ displayName: 'ProgressIndicator',
207
+ prop: 'variant',
208
+ defaultVariant: 'circular',
209
+ variants: {
210
+ 'circular': wrap(Expo.CircularProgressIndicator, {
211
+ displayName: 'ProgressIndicator'
212
+ }),
213
+ 'linear': wrap(Expo.LinearProgressIndicator, {
214
+ displayName: 'ProgressIndicator',
215
+ hostDefaults: STRETCH,
216
+ leadingModifiers: FILL_WIDTH
217
+ }),
218
+ 'circular-wavy': wrap(Expo.CircularWavyProgressIndicator, {
219
+ displayName: 'ProgressIndicator'
220
+ }),
221
+ 'linear-wavy': wrap(Expo.LinearWavyProgressIndicator, {
222
+ displayName: 'ProgressIndicator',
223
+ hostDefaults: STRETCH,
224
+ leadingModifiers: FILL_WIDTH
225
+ })
226
+ }
227
+ });
228
+ export const LoadingIndicator = createVariants({
229
+ displayName: 'LoadingIndicator',
230
+ prop: 'variant',
231
+ defaultVariant: 'default',
232
+ variants: {
233
+ 'default': wrap(Expo.LoadingIndicator, {
234
+ displayName: 'LoadingIndicator'
235
+ }),
236
+ 'contained': wrap(Expo.ContainedLoadingIndicator, {
237
+ displayName: 'LoadingIndicator'
238
+ })
239
+ }
240
+ });
241
+ // --- layout ----------------------------------------------------------------
242
+ export const Row = wrap(Expo.Row, {
243
+ displayName: 'Row'
244
+ });
245
+ export const Column = wrap(Expo.Column, {
246
+ displayName: 'Column'
247
+ });
248
+ export const Box = wrap(Expo.Box, {
249
+ displayName: 'Box'
250
+ });
251
+ export const FlowRow = wrap(Expo.FlowRow, {
252
+ displayName: 'FlowRow'
253
+ });
254
+ export const Spacer = wrap(Expo.Spacer, {
255
+ displayName: 'Spacer'
256
+ });
257
+ export const Surface = wrap(Expo.Surface, {
258
+ displayName: 'Surface',
259
+ rename: {
260
+ onValueChange: 'onCheckedChange'
261
+ }
262
+ });
263
+ export const ListItem = wrap(Expo.ListItem, {
264
+ displayName: 'ListItem'
265
+ });
266
+ export const Card = createVariants({
267
+ displayName: 'Card',
268
+ prop: 'variant',
269
+ defaultVariant: 'filled',
270
+ variants: {
271
+ 'filled': wrap(Expo.Card, {
272
+ displayName: 'Card'
273
+ }),
274
+ 'elevated': wrap(Expo.ElevatedCard, {
275
+ displayName: 'Card'
276
+ }),
277
+ 'outlined': wrap(Expo.OutlinedCard, {
278
+ displayName: 'Card'
279
+ })
280
+ }
281
+ });
282
+ export const Badge = createVariants({
283
+ displayName: 'Badge',
284
+ prop: 'variant',
285
+ defaultVariant: 'standard',
286
+ variants: {
287
+ 'standard': wrap(Expo.Badge, {
288
+ displayName: 'Badge'
289
+ }),
290
+ 'anchored': wrap(Expo.BadgedBox, {
291
+ displayName: 'Badge'
292
+ })
293
+ },
294
+ staticsFrom: Object.assign({}, Expo.BadgedBox)
295
+ });
296
+ export const Divider = createVariants({
297
+ displayName: 'Divider',
298
+ prop: 'orientation',
299
+ defaultVariant: 'horizontal',
300
+ variants: {
301
+ 'horizontal': wrap(Expo.HorizontalDivider, {
302
+ displayName: 'Divider',
303
+ hostDefaults: STRETCH
304
+ }),
305
+ 'vertical': wrap(Expo.VerticalDivider, {
306
+ displayName: 'Divider'
307
+ })
308
+ }
309
+ });
310
+ // --- media -----------------------------------------------------------------
311
+ export const Icon = wrap(Expo.Icon, {
312
+ displayName: 'Icon'
313
+ });
314
+ export const Image = wrap(Expo.Image, {
315
+ displayName: 'Image'
316
+ });
317
+ export const AnimatedVisibility = wrap(Expo.AnimatedVisibility, {
318
+ displayName: 'AnimatedVisibility'
319
+ });
320
+ // --- scrollables -----------------------------------------------------------
321
+ export const LazyColumn = wrap(Expo.LazyColumn, {
322
+ displayName: 'LazyColumn',
323
+ hostDefaults: FILL_PARENT
324
+ });
325
+ export const LazyRow = wrap(Expo.LazyRow, {
326
+ displayName: 'LazyRow',
327
+ hostDefaults: STRETCH
328
+ });
329
+ export const PullToRefreshBox = wrap(Expo.PullToRefreshBox, {
330
+ displayName: 'PullToRefreshBox',
331
+ hostDefaults: FILL_PARENT
332
+ });
333
+ export const Carousel = createVariants({
334
+ displayName: 'Carousel',
335
+ prop: 'variant',
336
+ defaultVariant: 'multi-browse',
337
+ variants: {
338
+ 'multi-browse': wrap(Expo.HorizontalMultiBrowseCarousel, {
339
+ displayName: 'Carousel',
340
+ hostDefaults: STRETCH
341
+ }),
342
+ 'uncontained': wrap(Expo.HorizontalUncontainedCarousel, {
343
+ displayName: 'Carousel',
344
+ hostDefaults: STRETCH
345
+ }),
346
+ 'centered-hero': wrap(Expo.HorizontalCenteredHeroCarousel, {
347
+ displayName: 'Carousel',
348
+ hostDefaults: STRETCH
349
+ })
350
+ }
351
+ });
352
+ // --- overlays --------------------------------------------------------------
353
+ export const AlertDialog = createVariants({
354
+ displayName: 'AlertDialog',
355
+ prop: 'variant',
356
+ defaultVariant: 'structured',
357
+ variants: {
358
+ 'structured': wrap(Expo.AlertDialog, {
359
+ displayName: 'AlertDialog'
360
+ }),
361
+ 'basic': wrap(Expo.BasicAlertDialog, {
362
+ displayName: 'AlertDialog'
363
+ })
364
+ },
365
+ staticsFrom: Object.assign({}, Expo.AlertDialog)
366
+ });
367
+ // --- bars ------------------------------------------------------------------
368
+ export const TopAppBar = wrap(Expo.TopAppBar, {
369
+ displayName: 'TopAppBar',
370
+ hostDefaults: STRETCH
371
+ });
372
+ export const SearchBar = createVariants({
373
+ displayName: 'SearchBar',
374
+ prop: 'variant',
375
+ defaultVariant: 'expanding',
376
+ variants: {
377
+ 'expanding': wrap(Expo.SearchBar, {
378
+ displayName: 'SearchBar',
379
+ hostDefaults: STRETCH
380
+ }),
381
+ 'docked': wrap(Expo.DockedSearchBar, {
382
+ displayName: 'SearchBar',
383
+ hostDefaults: STRETCH
384
+ })
385
+ },
386
+ staticsFrom: Object.assign({}, Expo.SearchBar, Expo.DockedSearchBar)
387
+ });
388
+ //# sourceMappingURL=generated.js.map