@expo/ui 58.0.26 → 58.0.28
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.
- package/CHANGELOG.md +25 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +9 -0
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +4 -0
- package/android/src/main/java/expo/modules/ui/RangeSliderView.kt +126 -0
- package/android/src/main/java/expo/modules/ui/ScrollDismissesKeyboard.kt +46 -0
- package/android/src/main/java/expo/modules/ui/SliderView.kt +31 -7
- package/android/src/main/java/expo/modules/ui/VerticalSliderView.kt +1 -8
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuPopup.kt +4 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +21 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +7 -0
- package/build/jetpack-compose/DropdownMenu/index.js.map +1 -1
- package/build/jetpack-compose/RangeSlider/index.d.ts +78 -0
- package/build/jetpack-compose/RangeSlider/index.js +51 -0
- package/build/jetpack-compose/RangeSlider/index.js.map +1 -0
- package/build/jetpack-compose/Slider/index.d.ts +15 -0
- package/build/jetpack-compose/Slider/index.js.map +1 -1
- package/build/jetpack-compose/index.d.ts +1 -0
- package/build/jetpack-compose/index.js +1 -0
- package/build/jetpack-compose/index.js.map +1 -1
- package/build/jetpack-compose/modifiers/index.d.ts +12 -0
- package/build/jetpack-compose/modifiers/index.js +11 -0
- package/build/jetpack-compose/modifiers/index.js.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +18 -3
- package/build/swift-ui/modifiers/index.js +18 -2
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/build/swift-ui/modifiers/symbolEffect.d.ts +49 -6
- package/build/swift-ui/modifiers/symbolEffect.js +1 -28
- package/build/swift-ui/modifiers/symbolEffect.js.map +1 -1
- package/build/swift-ui/modifiers/symbolEffectOptions.d.ts +22 -0
- package/build/swift-ui/modifiers/symbolEffectOptions.js +30 -0
- package/build/swift-ui/modifiers/symbolEffectOptions.js.map +1 -0
- package/build/universal/Picker/Picker.android.d.ts +1 -1
- package/build/universal/Picker/Picker.android.js +8 -3
- package/build/universal/Picker/Picker.android.js.map +1 -1
- package/build/universal/Picker/Picker.d.ts +1 -1
- package/build/universal/Picker/Picker.ios.d.ts +1 -1
- package/build/universal/Picker/Picker.ios.js +5 -2
- package/build/universal/Picker/Picker.ios.js.map +1 -1
- package/build/universal/Picker/Picker.js +2 -1
- package/build/universal/Picker/Picker.js.map +1 -1
- package/build/universal/Picker/types.d.ts +4 -0
- package/build/universal/Picker/types.js.map +1 -1
- package/ios/HostView.swift +6 -7
- package/ios/Modifiers/ContentTransitionModifier.swift +49 -0
- package/ios/RNHostView.swift +55 -1
- package/ios/UniversalLayout.swift +51 -19
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.26/expo.modules.ui-58.0.26-sources.jar → 58.0.28/expo.modules.ui-58.0.28-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.26/expo.modules.ui-58.0.26.module → 58.0.28/expo.modules.ui-58.0.28.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.26/expo.modules.ui-58.0.26.pom → 58.0.28/expo.modules.ui-58.0.28.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha512 +1 -0
- package/package.json +2 -2
- package/src/jetpack-compose/DropdownMenu/index.tsx +9 -0
- package/src/jetpack-compose/RangeSlider/index.tsx +125 -0
- package/src/jetpack-compose/Slider/index.tsx +15 -0
- package/src/jetpack-compose/index.ts +1 -0
- package/src/jetpack-compose/modifiers/index.ts +13 -0
- package/src/swift-ui/modifiers/index.ts +28 -4
- package/src/swift-ui/modifiers/symbolEffect.ts +53 -27
- package/src/swift-ui/modifiers/symbolEffectOptions.ts +22 -0
- package/src/universal/Picker/Picker.android.tsx +9 -2
- package/src/universal/Picker/Picker.ios.tsx +5 -0
- package/src/universal/Picker/Picker.tsx +2 -0
- package/src/universal/Picker/types.ts +5 -0
- package/ios/Modifiers/HostViewContentMarginsMitigation.swift +0 -98
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha512 +0 -1
|
@@ -23,6 +23,7 @@ export * from './RNHostView';
|
|
|
23
23
|
export * from './DatePicker';
|
|
24
24
|
export * from './SegmentedButton';
|
|
25
25
|
export * from './Progress';
|
|
26
|
+
export * from './RangeSlider';
|
|
26
27
|
export * from './Slider';
|
|
27
28
|
export * from './Spacer';
|
|
28
29
|
export * from './SplitButtonLayout';
|
|
@@ -653,5 +653,18 @@ export const verticalScroll = () => createModifier('verticalScroll');
|
|
|
653
653
|
*/
|
|
654
654
|
export const horizontalScroll = () => createModifier('horizontalScroll');
|
|
655
655
|
|
|
656
|
+
/**
|
|
657
|
+
* Hides the keyboard and clears focus when the user starts to drag the scrollable content.
|
|
658
|
+
*
|
|
659
|
+
* When used with `verticalScroll()` or `horizontalScroll()` modifier, it must be placed
|
|
660
|
+
* before them in the modifier list.
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* ```tsx
|
|
664
|
+
* modifiers={[scrollDismissesKeyboard(), verticalScroll()]}
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
export const scrollDismissesKeyboard = () => createModifier('scrollDismissesKeyboard');
|
|
668
|
+
|
|
656
669
|
export { createModifier, createModifierWithEventListener } from './createModifier';
|
|
657
670
|
export { createViewModifierEventListener } from './utils';
|
|
@@ -23,7 +23,12 @@ import { progressViewStyle } from './progressViewStyle';
|
|
|
23
23
|
import { onScrollPhaseChange, useScrollGeometryChange } from './scrollObservation';
|
|
24
24
|
import { id, scrollPosition } from './scrollPosition';
|
|
25
25
|
import { resolveShapeStyle, type ShapeStyle } from './shapeStyle';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
symbolEffect,
|
|
28
|
+
type ContentTransitionSymbolEffect,
|
|
29
|
+
type SymbolEffectOptions,
|
|
30
|
+
} from './symbolEffect';
|
|
31
|
+
import { flattenOptions } from './symbolEffectOptions';
|
|
27
32
|
import type { Color } from './types';
|
|
28
33
|
import { activityBackgroundTint, widgetAccentedRenderingMode, widgetURL } from './widgets';
|
|
29
34
|
|
|
@@ -1712,9 +1717,11 @@ export const textContentType = (
|
|
|
1712
1717
|
* Useful for animating changes in text content, especially numeric text.
|
|
1713
1718
|
* Use with the [`animation`](#animationanimationobject-animatedvalue) modifier to animate the transition when the content changes.
|
|
1714
1719
|
*
|
|
1715
|
-
* @param transitionType - The type of content transition.
|
|
1720
|
+
* @param transitionType - The type of content transition. The `'symbolEffect'` type applies a symbol effect transition to symbol images. Other views are unaffected by this transition. It requires iOS 17.0+, tvOS 17.0+, and macOS 14.0+. On earlier versions, the view does not change.
|
|
1716
1721
|
* @param params - Optional parameters.
|
|
1717
1722
|
* @param params.countsDown - Whether the numeric text counts down.
|
|
1723
|
+
* @param params.symbolEffect - The symbol effect to use with the `'symbolEffect'` type. Defaults to `{ effect: 'automatic' }`.
|
|
1724
|
+
* @param params.options - A set of options that configure how effects apply to symbol-based images. Use it with the `'symbolEffect'` type.
|
|
1718
1725
|
*
|
|
1719
1726
|
* @example
|
|
1720
1727
|
* ```tsx
|
|
@@ -1723,17 +1730,34 @@ export const textContentType = (
|
|
|
1723
1730
|
* </Text>
|
|
1724
1731
|
* ```
|
|
1725
1732
|
*
|
|
1733
|
+
* @example
|
|
1734
|
+
* ```tsx
|
|
1735
|
+
* <Image
|
|
1736
|
+
* systemName={isOn ? 'speaker.wave.2.fill' : 'speaker.slash.fill'}
|
|
1737
|
+
* modifiers={[
|
|
1738
|
+
* contentTransition('symbolEffect', { symbolEffect: { effect: 'replace', direction: 'downUp' } }),
|
|
1739
|
+
* animation(Animation.default, isOn),
|
|
1740
|
+
* ]}
|
|
1741
|
+
* />
|
|
1742
|
+
* ```
|
|
1743
|
+
*
|
|
1726
1744
|
* @platform ios 16.0+
|
|
1727
1745
|
* @platform tvos 16.0+
|
|
1728
1746
|
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/contenttransition(_:)).
|
|
1729
1747
|
*/
|
|
1730
1748
|
export const contentTransition = (
|
|
1731
|
-
transitionType: 'numericText' | 'identity' | 'opacity' | 'interpolate',
|
|
1732
|
-
params?: {
|
|
1749
|
+
transitionType: 'numericText' | 'identity' | 'opacity' | 'interpolate' | 'symbolEffect',
|
|
1750
|
+
params?: {
|
|
1751
|
+
countsDown?: boolean;
|
|
1752
|
+
symbolEffect?: ContentTransitionSymbolEffect;
|
|
1753
|
+
options?: SymbolEffectOptions;
|
|
1754
|
+
}
|
|
1733
1755
|
) =>
|
|
1734
1756
|
createModifier('contentTransition', {
|
|
1735
1757
|
transitionType,
|
|
1736
1758
|
countsDown: params?.countsDown,
|
|
1759
|
+
symbolEffect: params?.symbolEffect,
|
|
1760
|
+
options: flattenOptions(params?.options),
|
|
1737
1761
|
});
|
|
1738
1762
|
|
|
1739
1763
|
export type ListStyle = 'automatic' | 'plain' | 'inset' | 'insetGrouped' | 'grouped' | 'sidebar';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getStateId, type ObservableState } from '../../State';
|
|
2
2
|
import { createModifier } from './createModifier';
|
|
3
|
+
import { flattenOptions } from './symbolEffectOptions';
|
|
3
4
|
|
|
4
5
|
// https://developer.apple.com/documentation/symbols/appearsymboleffect
|
|
5
6
|
type AppearSymbolEffect = {
|
|
@@ -101,19 +102,65 @@ export type SymbolEffect =
|
|
|
101
102
|
| WiggleSymbolEffect;
|
|
102
103
|
|
|
103
104
|
/**
|
|
104
|
-
*
|
|
105
|
+
* A transition that applies the default animation to a symbol-based image in a context-sensitive manner.
|
|
106
|
+
*
|
|
107
|
+
* @see Official [Apple documentation](https://developer.apple.com/documentation/symbols/symboleffect/automatic).
|
|
108
|
+
*/
|
|
109
|
+
export type AutomaticSymbolEffect = {
|
|
110
|
+
effect: 'automatic';
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* An animation that replaces the layers of one symbol-based image with those of another.
|
|
115
|
+
*
|
|
116
|
+
* @see Official [Apple documentation](https://developer.apple.com/documentation/symbols/symboleffect/replace).
|
|
117
|
+
*/
|
|
118
|
+
export type ReplaceSymbolEffect = {
|
|
119
|
+
effect: 'replace';
|
|
120
|
+
/**
|
|
121
|
+
* The variant of the Replace animation.
|
|
122
|
+
* - `'downUp'` - replaces a symbol by scaling it down, and scaling a different symbol up.
|
|
123
|
+
* - `'upUp'` - replaces a symbol by scaling it up, and scaling a different symbol up.
|
|
124
|
+
* - `'offUp'` - replaces a symbol by removing it, and scaling a different symbol up.
|
|
125
|
+
*/
|
|
126
|
+
direction?: 'downUp' | 'upUp' | 'offUp';
|
|
127
|
+
/**
|
|
128
|
+
* How the effect replaces the symbol layers.
|
|
129
|
+
* - `'byLayer'` - replaces each layer separately.
|
|
130
|
+
* - `'wholeSymbol'` - replaces all layers simultaneously.
|
|
131
|
+
*/
|
|
132
|
+
scope?: 'byLayer' | 'wholeSymbol';
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* An effect that animates between symbols or different configurations of the same symbol.
|
|
137
|
+
*
|
|
138
|
+
* @see Official [Apple documentation](https://developer.apple.com/documentation/symbols/contenttransitionsymboleffect).
|
|
139
|
+
*/
|
|
140
|
+
export type ContentTransitionSymbolEffect = AutomaticSymbolEffect | ReplaceSymbolEffect;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Options that configure how effects apply to symbol-based images.
|
|
105
144
|
*
|
|
106
145
|
* @see Official [Apple documentation](https://developer.apple.com/documentation/symbols/symboleffectoptions).
|
|
107
146
|
*/
|
|
108
147
|
export type SymbolEffectOptions = {
|
|
109
148
|
/**
|
|
110
|
-
*
|
|
111
|
-
* - `'nonRepeating'`
|
|
112
|
-
* - `'continuous'`
|
|
113
|
-
* - `{ count?, delay? }`
|
|
149
|
+
* The preferred repeat behavior. Omit it to use the default set of effect options.
|
|
150
|
+
* - `'nonRepeating'` - prefers to not repeat.
|
|
151
|
+
* - `'continuous'` - prefers to repeat indefinitely, using continuous animations if available.
|
|
152
|
+
* - `{ count?, delay? }` - repeats with a preferred play count and delay, using periodic animations.
|
|
153
|
+
* `count` is the preferred number of times to play the effect. Omit it to play indefinitely.
|
|
154
|
+
* `delay` is the preferred delay between repetitions, in seconds. Omit it for the default delay.
|
|
155
|
+
*
|
|
156
|
+
* The `'continuous'` and `{ count?, delay? }` values require iOS 18.0+ and tvOS 18.0+.
|
|
157
|
+
* On earlier versions, the effect uses the default repeat behavior.
|
|
114
158
|
*/
|
|
115
159
|
repeat?: 'continuous' | 'nonRepeating' | { count?: number; delay?: number };
|
|
116
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* The preferred speed multiplier to play the effect with. The default multiplier is `1.0`.
|
|
162
|
+
* The system may clamp very large or small values.
|
|
163
|
+
*/
|
|
117
164
|
speed?: number;
|
|
118
165
|
};
|
|
119
166
|
|
|
@@ -155,26 +202,5 @@ export const symbolEffect = (
|
|
|
155
202
|
});
|
|
156
203
|
};
|
|
157
204
|
|
|
158
|
-
function flattenOptions(options?: SymbolEffectOptions) {
|
|
159
|
-
if (!options) return undefined;
|
|
160
|
-
const { speed } = options;
|
|
161
|
-
const repeatField = options.repeat;
|
|
162
|
-
if (repeatField === undefined) {
|
|
163
|
-
return { speed };
|
|
164
|
-
}
|
|
165
|
-
if (repeatField === 'nonRepeating') {
|
|
166
|
-
return { repeatKind: 'nonRepeating' as const, speed };
|
|
167
|
-
}
|
|
168
|
-
if (repeatField === 'continuous') {
|
|
169
|
-
return { repeatKind: 'continuous' as const, speed };
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
repeatKind: 'periodic' as const,
|
|
173
|
-
repeatCount: repeatField.count,
|
|
174
|
-
repeatDelay: repeatField.delay,
|
|
175
|
-
speed,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
205
|
// exported for docs api data
|
|
180
206
|
export { type ObservableState };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SymbolEffectOptions } from './symbolEffect';
|
|
2
|
+
|
|
3
|
+
export function flattenOptions(options?: SymbolEffectOptions) {
|
|
4
|
+
if (!options) return undefined;
|
|
5
|
+
const { speed } = options;
|
|
6
|
+
const repeatField = options.repeat;
|
|
7
|
+
if (repeatField === undefined) {
|
|
8
|
+
return { speed };
|
|
9
|
+
}
|
|
10
|
+
if (repeatField === 'nonRepeating') {
|
|
11
|
+
return { repeatKind: 'nonRepeating' as const, speed };
|
|
12
|
+
}
|
|
13
|
+
if (repeatField === 'continuous') {
|
|
14
|
+
return { repeatKind: 'continuous' as const, speed };
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
repeatKind: 'periodic' as const,
|
|
18
|
+
repeatCount: repeatField.count,
|
|
19
|
+
repeatDelay: repeatField.delay,
|
|
20
|
+
speed,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '../../jetpack-compose/ExposedDropdownMenuBox';
|
|
8
8
|
import { Text } from '../../jetpack-compose/Text';
|
|
9
9
|
import { TextField, type TextFieldRef } from '../../jetpack-compose/TextField';
|
|
10
|
-
import { menuAnchor, onVisibilityChanged } from '../../jetpack-compose/modifiers';
|
|
10
|
+
import { menuAnchor, onVisibilityChanged, semantics } from '../../jetpack-compose/modifiers';
|
|
11
11
|
import { extractPickerItems } from './PickerItem';
|
|
12
12
|
import type { PickerItemValue, PickerProps } from './types';
|
|
13
13
|
|
|
@@ -20,6 +20,7 @@ export function Picker<T extends PickerItemValue>({
|
|
|
20
20
|
selectedValue,
|
|
21
21
|
onValueChange,
|
|
22
22
|
enabled = true,
|
|
23
|
+
accessibilityLabel,
|
|
23
24
|
children,
|
|
24
25
|
}: PickerProps<T>) {
|
|
25
26
|
const items = extractPickerItems<T>(children);
|
|
@@ -42,7 +43,13 @@ export function Picker<T extends PickerItemValue>({
|
|
|
42
43
|
ref={textFieldRef}
|
|
43
44
|
readOnly
|
|
44
45
|
enabled={enabled}
|
|
45
|
-
modifiers={[
|
|
46
|
+
modifiers={[
|
|
47
|
+
menuAnchor(),
|
|
48
|
+
onVisibilityChanged((visible) => setIsVisible(visible)),
|
|
49
|
+
...(accessibilityLabel !== undefined
|
|
50
|
+
? [semantics({ contentDescription: accessibilityLabel })]
|
|
51
|
+
: []),
|
|
52
|
+
]}
|
|
46
53
|
/>
|
|
47
54
|
<ExposedDropdownMenu expanded={expanded} onDismissRequest={() => setExpanded(false)}>
|
|
48
55
|
{items.map((item) => (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Picker as SwiftUIPicker, Text } from '@expo/ui/swift-ui';
|
|
2
2
|
import {
|
|
3
|
+
accessibilityLabel as accessibilityLabelModifier,
|
|
3
4
|
disabled as disabledModifier,
|
|
4
5
|
pickerStyle,
|
|
5
6
|
tag,
|
|
@@ -19,12 +20,16 @@ export function Picker<T extends PickerItemValue>({
|
|
|
19
20
|
onValueChange,
|
|
20
21
|
appearance = 'menu',
|
|
21
22
|
enabled = true,
|
|
23
|
+
accessibilityLabel,
|
|
22
24
|
children,
|
|
23
25
|
testID,
|
|
24
26
|
}: PickerProps<T>) {
|
|
25
27
|
const items = extractPickerItems<T>(children);
|
|
26
28
|
const swiftUIStyle = appearance === 'wheel' ? 'wheel' : 'menu';
|
|
27
29
|
const modifiers: ModifierConfig[] = [pickerStyle(swiftUIStyle)];
|
|
30
|
+
if (accessibilityLabel !== undefined) {
|
|
31
|
+
modifiers.push(accessibilityLabelModifier(accessibilityLabel));
|
|
32
|
+
}
|
|
28
33
|
if (!enabled) modifiers.push(disabledModifier(true));
|
|
29
34
|
|
|
30
35
|
return (
|
|
@@ -57,6 +57,7 @@ export function Picker<T extends PickerItemValue>({
|
|
|
57
57
|
selectedValue,
|
|
58
58
|
onValueChange,
|
|
59
59
|
enabled = true,
|
|
60
|
+
accessibilityLabel,
|
|
60
61
|
children,
|
|
61
62
|
testID,
|
|
62
63
|
}: PickerProps<T>) {
|
|
@@ -66,6 +67,7 @@ export function Picker<T extends PickerItemValue>({
|
|
|
66
67
|
return (
|
|
67
68
|
<View>
|
|
68
69
|
<Select
|
|
70
|
+
aria-label={accessibilityLabel}
|
|
69
71
|
disabled={!enabled}
|
|
70
72
|
value={String(selectedValue)}
|
|
71
73
|
onFocus={onFocus}
|
|
@@ -59,6 +59,11 @@ export interface PickerProps<T extends PickerItemValue = PickerItemValue> {
|
|
|
59
59
|
*/
|
|
60
60
|
enabled?: boolean;
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Label announced by screen readers.
|
|
64
|
+
*/
|
|
65
|
+
accessibilityLabel?: string;
|
|
66
|
+
|
|
62
67
|
/**
|
|
63
68
|
* `<Picker.Item>` children that declare the available options.
|
|
64
69
|
*/
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
import SwiftUI
|
|
4
|
-
import ExpoModulesCore
|
|
5
|
-
|
|
6
|
-
/// Works around a SwiftUI bug on iPhone Duo: delete this file and its one use in `HostView` once iOS
|
|
7
|
-
/// fixes it.
|
|
8
|
-
///
|
|
9
|
-
/// When the app is in a split view, positioned left, the tab bar becomes a rail beside the content and
|
|
10
|
-
/// iOS drops its content margin on that edge, so the large title starts on the safe-area edge. A `Form`
|
|
11
|
-
/// or `List` hosted under a UIKit navigation bar, as every `Host` is, keeps its 20pt section margin there
|
|
12
|
-
/// and starts 20pt inside the title:
|
|
13
|
-
///
|
|
14
|
-
/// ```
|
|
15
|
-
/// RNSNavigationController navigation bar: large title at 84, the safe-area edge
|
|
16
|
-
/// └─ RNSScreen the pushed controller: safe area 84, layout margins 84
|
|
17
|
-
/// └─ UIHostingController the Host, a child controller: 84 + 20pt margin = 104 ❌ BUG
|
|
18
|
-
/// └─ Form sections at 104, 20pt inside the title
|
|
19
|
-
/// ```
|
|
20
|
-
///
|
|
21
|
-
/// SwiftUI drops that 20pt only when the hosting controller is itself the pushed controller, which a
|
|
22
|
-
/// `Host` can never be.
|
|
23
|
-
///
|
|
24
|
-
/// This sets the scroll content margin on such an edge to the hosted view's safe-area inset, measured
|
|
25
|
-
/// from the view's edge, so sections start with the title. It applies only where the inset exceeds the
|
|
26
|
-
/// window's own on that edge, so it comes from a bar beside the content, and the screen's layout margin
|
|
27
|
-
/// equals its safe area, so iOS has dropped the margin there.
|
|
28
|
-
///
|
|
29
|
-
/// See ENG-27830.
|
|
30
|
-
internal struct HostViewContentMarginsMitigation: ViewModifier {
|
|
31
|
-
let layoutDirection: LayoutDirection
|
|
32
|
-
weak var hostingView: UIView?
|
|
33
|
-
|
|
34
|
-
/// The leading and trailing content margins to apply, or `nil` to keep the system's.
|
|
35
|
-
@State private var margins = Margins()
|
|
36
|
-
|
|
37
|
-
private struct Margins: Equatable {
|
|
38
|
-
var leading: CGFloat?
|
|
39
|
-
var trailing: CGFloat?
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
func body(content: Content) -> some View {
|
|
43
|
-
#if os(iOS)
|
|
44
|
-
if #available(iOS 17.0, *) {
|
|
45
|
-
content
|
|
46
|
-
.contentMargins(.leading, margins.leading, for: .scrollContent)
|
|
47
|
-
.contentMargins(.trailing, margins.trailing, for: .scrollContent)
|
|
48
|
-
.onGeometryChange(for: CGRect.self, of: { proxy in proxy.frame(in: .global) }) { _ in
|
|
49
|
-
updateMargins()
|
|
50
|
-
}
|
|
51
|
-
.onGeometryChange(for: EdgeInsets.self, of: { proxy in proxy.safeAreaInsets }) { _ in
|
|
52
|
-
updateMargins()
|
|
53
|
-
}
|
|
54
|
-
} else {
|
|
55
|
-
content
|
|
56
|
-
}
|
|
57
|
-
#else
|
|
58
|
-
content
|
|
59
|
-
#endif
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#if os(iOS)
|
|
63
|
-
/// UIKit can update the screen's layout margins after SwiftUI reports the geometry change, as
|
|
64
|
-
/// when the window moves into a split view, so the margins are checked again once that settles.
|
|
65
|
-
private func updateMargins() {
|
|
66
|
-
margins = affectedMargins()
|
|
67
|
-
DispatchQueue.main.async {
|
|
68
|
-
margins = affectedMargins()
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private func affectedMargins() -> Margins {
|
|
73
|
-
guard let hostingView, let window = hostingView.window, let screen = screenView(of: hostingView) else {
|
|
74
|
-
return Margins()
|
|
75
|
-
}
|
|
76
|
-
let host = hostingView.safeAreaInsets
|
|
77
|
-
let left: CGFloat? = host.left > window.safeAreaInsets.left
|
|
78
|
-
&& abs(screen.layoutMargins.left - screen.safeAreaInsets.left) < 0.5 ? host.left : nil
|
|
79
|
-
let right: CGFloat? = host.right > window.safeAreaInsets.right
|
|
80
|
-
&& abs(screen.layoutMargins.right - screen.safeAreaInsets.right) < 0.5 ? host.right : nil
|
|
81
|
-
return layoutDirection == .rightToLeft
|
|
82
|
-
? Margins(leading: right, trailing: left)
|
|
83
|
-
: Margins(leading: left, trailing: right)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/// The view of the nearest view controller above the `Host`, which is the screen it is hosted in.
|
|
87
|
-
private func screenView(of view: UIView) -> UIView? {
|
|
88
|
-
var responder = view.next
|
|
89
|
-
while let current = responder {
|
|
90
|
-
if let controller = current as? UIViewController {
|
|
91
|
-
return controller.view
|
|
92
|
-
}
|
|
93
|
-
responder = current.next
|
|
94
|
-
}
|
|
95
|
-
return nil
|
|
96
|
-
}
|
|
97
|
-
#endif
|
|
98
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
86ee1f5cbe59fc8fd3532316b486649b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
161044ad8c5afe93447eba78b51e99afbc1d9e21
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bc95695ef06307f2c0099b8ed103d6f4ee1c1bce69682e23413a73d1f5382b66
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
73bf2bbf6c3100c6375b86c350d5533eacdde6dfc09b4441b96f38a57218718a9940dceb935194b0063870fcdfbb46ef6b72f755a13e61a2546bab1b32967b84
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar
DELETED
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
881118e26c11ff41e0a8f115338a7358
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f9bb58ebd351c2f423eb615d6365671b1f1553b3
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9ff0f17bc171c0a78627d99ec3e3e9daa17da71fb9d691e0a157ae5f249a8ace
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3610fc8f33f9a6d61a67482880e1b89515d0116933b15b51f3169bec6950096737c88627d8d20d916c3589d26cea950f51c9b5bbf20d70adcba058c70e48e51f
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
526134d76a7a63dd5e6bc5430dbe44ba
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
12d369269ac40c438bd87de1c8152115cdc0aa0a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f4f444a48574e35cbfa2e30acf366b6788a27c2025dc67c1f05801261ffeace3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
934f186cc5e3e67ce6f32a9b41d51c11ccfba401d2a56a9e6818d95fc7251808a4b7a973861f7d150af826c9bfbd2979f222fa551e8a4cf60b13bc2f56a381a2
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
528606253a6237e3b24104d7b85a9d40
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7f2d1fdb6762621589b11dfc56328633bc6748d2
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
512f093e189a05b11f8d0afcb436e3b4fcb9610a5e8ee6c758d7ee085652f3d1
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ed4a2cc21b8fe75b61bcf325630db95a2c03384b48c41e24b4939e220874d10b0bff9a6ff28ff4435e641f0d13ba63250b0f14c00c1b2f85451f346e84f0bcb0
|