@expo/ui 56.0.15 → 56.0.16
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 +14 -0
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +45 -0
- package/android/src/main/java/expo/modules/ui/NavigationBarView.kt +95 -0
- package/android/src/main/java/expo/modules/ui/TextFieldView.kt +34 -24
- package/build/jetpack-compose/NavigationBar/index.d.ts +101 -0
- package/build/jetpack-compose/NavigationBar/index.d.ts.map +1 -0
- package/build/jetpack-compose/index.d.ts +1 -0
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/index.d.ts +31 -0
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/DisclosureGroup/index.d.ts +11 -2
- package/build/swift-ui/DisclosureGroup/index.d.ts.map +1 -1
- package/build/swift-ui/Image/index.d.ts +4 -0
- package/build/swift-ui/Image/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts +5 -0
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +68 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/universal/Collapsible/index.android.d.ts +1 -1
- package/build/universal/Collapsible/index.android.d.ts.map +1 -1
- package/build/universal/Collapsible/index.d.ts +1 -1
- package/build/universal/Collapsible/index.d.ts.map +1 -1
- package/build/universal/Collapsible/index.ios.d.ts +1 -1
- package/build/universal/Collapsible/index.ios.d.ts.map +1 -1
- package/build/universal/Collapsible/types.d.ts +5 -0
- package/build/universal/Collapsible/types.d.ts.map +1 -1
- package/build/universal/TextInput/index.android.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/BottomSheetView.swift +1 -1
- package/ios/DisclosureGroupView.swift +36 -13
- package/ios/ImageView.swift +19 -9
- package/ios/Label.swift +26 -2
- package/ios/Modifiers/ButtonBorderShapeModifier.swift +46 -0
- package/ios/Modifiers/DynamicTypeSizeModifier.swift +56 -0
- package/ios/Modifiers/FontModifier.swift +4 -1
- package/ios/Modifiers/ViewModifierRegistry.swift +57 -8
- package/ios/SecureFieldView.swift +17 -1
- package/ios/TextFieldView.swift +33 -2
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.15/expo.modules.ui-56.0.15-sources.jar → 56.0.16/expo.modules.ui-56.0.16-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.15/expo.modules.ui-56.0.15.module → 56.0.16/expo.modules.ui-56.0.16.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.15/expo.modules.ui-56.0.15.pom → 56.0.16/expo.modules.ui-56.0.16.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.16/expo.modules.ui-56.0.16.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +4 -4
- package/src/State/useNativeState.ts +0 -8
- package/src/community/segmented-control/SegmentedControl.ios.tsx +1 -1
- package/src/jetpack-compose/NavigationBar/index.tsx +174 -0
- package/src/jetpack-compose/index.ts +1 -0
- package/src/jetpack-compose/modifiers/index.ts +36 -0
- package/src/swift-ui/DisclosureGroup/index.tsx +14 -2
- package/src/swift-ui/Image/index.tsx +4 -0
- package/src/swift-ui/Label/index.tsx +8 -1
- package/src/swift-ui/modifiers/index.ts +101 -0
- package/src/universal/Collapsible/index.android.tsx +10 -2
- package/src/universal/Collapsible/index.ios.tsx +17 -3
- package/src/universal/Collapsible/index.tsx +8 -2
- package/src/universal/Collapsible/types.ts +7 -0
- package/src/universal/TextInput/index.android.tsx +31 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.sha512 +0 -1
|
@@ -163,6 +163,42 @@ export const border = (borderWidth: number, borderColor: ColorValue) =>
|
|
|
163
163
|
*/
|
|
164
164
|
export const shadow = (elevation: number) => createModifier('shadow', { elevation });
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Options for the `dropShadow` and `innerShadow` modifiers.
|
|
168
|
+
*/
|
|
169
|
+
export type ShadowConfig = {
|
|
170
|
+
/** Blur radius of the shadow in dp. */
|
|
171
|
+
radius?: number;
|
|
172
|
+
/** Amount to expand (positive) or contract (negative) the shadow geometry in dp. */
|
|
173
|
+
spread?: number;
|
|
174
|
+
/** Shadow color string (hex). Defaults to black. */
|
|
175
|
+
color?: ColorValue;
|
|
176
|
+
/** Horizontal offset of the shadow in dp. */
|
|
177
|
+
offsetX?: number;
|
|
178
|
+
/** Vertical offset of the shadow in dp. */
|
|
179
|
+
offsetY?: number;
|
|
180
|
+
/** Shadow opacity, from 0.0 to 1.0. */
|
|
181
|
+
alpha?: number;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Draws a shadow behind the view with control over the blur radius, spread, offset, and color. Unlike
|
|
186
|
+
* `shadow`, it does not require an elevation value.
|
|
187
|
+
* @param shape - The shape of the shadow, for example `Shapes.RoundedCorner(16)` or `Shapes.Circle`.
|
|
188
|
+
* @param config - Options that control the shadow's appearance.
|
|
189
|
+
*/
|
|
190
|
+
export const dropShadow = (shape: BuiltinShape, config: ShadowConfig = {}) =>
|
|
191
|
+
createModifier('dropShadow', { shape, ...config });
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Draws a shadow inside the view to create an inset effect. The view's `background` must come before
|
|
195
|
+
* this modifier for the shadow to render.
|
|
196
|
+
* @param shape - The shape of the shadow, for example `Shapes.RoundedCorner(16)` or `Shapes.Circle`.
|
|
197
|
+
* @param config - Options that control the shadow's appearance.
|
|
198
|
+
*/
|
|
199
|
+
export const innerShadow = (shape: BuiltinShape, config: ShadowConfig = {}) =>
|
|
200
|
+
createModifier('innerShadow', { shape, ...config });
|
|
201
|
+
|
|
166
202
|
/**
|
|
167
203
|
* Sets the opacity/alpha of the view.
|
|
168
204
|
* @param alpha - Opacity value (0.0 to 1.0).
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
|
|
3
3
|
import { type ViewEvent } from '../../types';
|
|
4
|
+
import { Slot } from '../SlotView';
|
|
4
5
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
6
|
import { type CommonViewModifierProps } from '../types';
|
|
6
7
|
|
|
7
8
|
export interface DisclosureGroupProps extends CommonViewModifierProps {
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Text label for the disclosure group. Use `DisclosureGroup.Label` for custom label content.
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
9
13
|
children: React.ReactNode;
|
|
10
14
|
/**
|
|
11
15
|
* Controls whether the disclosure group is expanded.
|
|
@@ -25,7 +29,11 @@ type NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onIsExpandedChange
|
|
|
25
29
|
const DisclosureGroupNativeView: React.ComponentType<NativeDisclosureGroupProps> =
|
|
26
30
|
requireNativeView('ExpoUI', 'DisclosureGroupView');
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
function Label({ children }: { children: React.ReactNode }) {
|
|
33
|
+
return <Slot name="label">{children}</Slot>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function DisclosureGroupComponent(props: DisclosureGroupProps) {
|
|
29
37
|
const { onIsExpandedChange, modifiers, ...rest } = props;
|
|
30
38
|
|
|
31
39
|
function handleStateChange(event: { nativeEvent: { isExpanded: boolean } }) {
|
|
@@ -40,3 +48,7 @@ export function DisclosureGroup(props: DisclosureGroupProps) {
|
|
|
40
48
|
|
|
41
49
|
return <DisclosureGroupNativeView {...transformedProps} onIsExpandedChange={handleStateChange} />;
|
|
42
50
|
}
|
|
51
|
+
|
|
52
|
+
DisclosureGroupComponent.Label = Label;
|
|
53
|
+
|
|
54
|
+
export { DisclosureGroupComponent as DisclosureGroup };
|
|
@@ -12,6 +12,10 @@ export interface ImageProps extends CommonViewModifierProps {
|
|
|
12
12
|
* For example: 'photo', 'heart.fill', 'star.circle'
|
|
13
13
|
*/
|
|
14
14
|
systemName?: SFSymbol;
|
|
15
|
+
/**
|
|
16
|
+
* The asset catalog name of a custom SF Symbol imported as a symbol set.
|
|
17
|
+
*/
|
|
18
|
+
assetName?: string;
|
|
15
19
|
/**
|
|
16
20
|
* The URI of the local image file to display.
|
|
17
21
|
* For example: 'file:///path/to/image.jpg'
|
|
@@ -23,6 +23,12 @@ export type LabelProps = {
|
|
|
23
23
|
*/
|
|
24
24
|
icon?: React.ReactNode;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Custom title view. Accepts any React node (for example, a `VStack` with title and subtitle).
|
|
28
|
+
* When provided, this takes precedence over `title`.
|
|
29
|
+
*/
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
|
|
26
32
|
/**
|
|
27
33
|
* The color of the label icon.
|
|
28
34
|
* @deprecated Use `foregroundStyle` modifier instead.
|
|
@@ -40,12 +46,13 @@ const LabelNativeView: React.ComponentType<LabelProps & { children?: React.React
|
|
|
40
46
|
* @returns {JSX.Element} The rendered native Label component.
|
|
41
47
|
*/
|
|
42
48
|
export function Label(props: LabelProps) {
|
|
43
|
-
const { modifiers, icon, ...restProps } = props;
|
|
49
|
+
const { modifiers, icon, children, ...restProps } = props;
|
|
44
50
|
return (
|
|
45
51
|
<LabelNativeView
|
|
46
52
|
modifiers={modifiers}
|
|
47
53
|
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
48
54
|
{...restProps}>
|
|
55
|
+
{children && <Slot name="title">{children}</Slot>}
|
|
49
56
|
{icon && <Slot name="icon">{icon}</Slot>}
|
|
50
57
|
</LabelNativeView>
|
|
51
58
|
);
|
|
@@ -534,6 +534,17 @@ export const buttonStyle = (
|
|
|
534
534
|
| 'plain'
|
|
535
535
|
) => createModifier('buttonStyle', { style });
|
|
536
536
|
|
|
537
|
+
/**
|
|
538
|
+
* Sets the border shape used by buttons within this view.
|
|
539
|
+
* @param shape - The button border shape.
|
|
540
|
+
* @param cornerRadius - Corner radius, only used with `'roundedRectangle'`.
|
|
541
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/buttonbordershape(_:)).
|
|
542
|
+
*/
|
|
543
|
+
export const buttonBorderShape = (
|
|
544
|
+
shape: 'automatic' | 'capsule' | 'roundedRectangle' | 'circle',
|
|
545
|
+
cornerRadius?: number
|
|
546
|
+
) => createModifier('buttonBorderShape', { shape, cornerRadius });
|
|
547
|
+
|
|
537
548
|
/**
|
|
538
549
|
* Sets the style for toggles within this view.
|
|
539
550
|
* @param style - The toggle style.
|
|
@@ -720,6 +731,29 @@ export const accessibilityHint = (hint: string) => createModifier('accessibility
|
|
|
720
731
|
export const accessibilityValue = (value: string) =>
|
|
721
732
|
createModifier('accessibilityValue', { value });
|
|
722
733
|
|
|
734
|
+
/**
|
|
735
|
+
* Sets an accessibility identifier for the view.
|
|
736
|
+
*
|
|
737
|
+
* Unlike `accessibilityLabel`, this value is for UI testing and is not visible
|
|
738
|
+
* to the user. UI testing tools such as XCUITest read it to locate the view, so
|
|
739
|
+
* prefer a stable, machine-readable identifier here.
|
|
740
|
+
* @param identifier - The accessibility identifier used for UI testing.
|
|
741
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/accessibilityidentifier(_:)).
|
|
742
|
+
*/
|
|
743
|
+
export const accessibilityIdentifier = (identifier: string) =>
|
|
744
|
+
createModifier('accessibilityIdentifier', { identifier });
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Marks the view as decoratively-named so VoiceOver and other assistive
|
|
748
|
+
* technologies skip it during element traversal. Useful for hero icons or
|
|
749
|
+
* presentational imagery that's already described by adjacent text.
|
|
750
|
+
*
|
|
751
|
+
* @param hidden - Whether the view should be hidden from accessibility. Defaults to `true`.
|
|
752
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/accessibilityhidden(_:)).
|
|
753
|
+
*/
|
|
754
|
+
export const accessibilityHidden = (hidden: boolean = true) =>
|
|
755
|
+
createModifier('accessibilityHidden', { hidden });
|
|
756
|
+
|
|
723
757
|
/**
|
|
724
758
|
* Sets layout priority for the view.
|
|
725
759
|
* @param priority - Layout priority value.
|
|
@@ -837,6 +871,14 @@ export const listRowSeparator = (
|
|
|
837
871
|
edges?: 'all' | 'top' | 'bottom'
|
|
838
872
|
) => createModifier('listRowSeparator', { visibility, edges });
|
|
839
873
|
|
|
874
|
+
/**
|
|
875
|
+
* Sets the vertical spacing between adjacent rows in a list.
|
|
876
|
+
* @param spacing - The spacing value to use. When omitted, the default spacing is used.
|
|
877
|
+
* @platform ios 15.0+
|
|
878
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/listrowspacing(_:)).
|
|
879
|
+
*/
|
|
880
|
+
export const listRowSpacing = (spacing?: number) => createModifier('listRowSpacing', { spacing });
|
|
881
|
+
|
|
840
882
|
/**
|
|
841
883
|
* Sets the truncation mode for lines of text that are too long to fit in the available space.
|
|
842
884
|
* @param mode - The truncation mode that specifies where to truncate the text within the text view, if needed.
|
|
@@ -1038,6 +1080,60 @@ export const font = (params: {
|
|
|
1038
1080
|
| 'caption'
|
|
1039
1081
|
| 'caption2';
|
|
1040
1082
|
}) => createModifier('font', params);
|
|
1083
|
+
/**
|
|
1084
|
+
* A standard size for Dynamic Type, from `xSmall` through the five
|
|
1085
|
+
* `accessibility` sizes. Mirrors SwiftUI's `DynamicTypeSize`.
|
|
1086
|
+
*/
|
|
1087
|
+
export type DynamicTypeSizeValue =
|
|
1088
|
+
| 'xSmall'
|
|
1089
|
+
| 'small'
|
|
1090
|
+
| 'medium'
|
|
1091
|
+
| 'large'
|
|
1092
|
+
| 'xLarge'
|
|
1093
|
+
| 'xxLarge'
|
|
1094
|
+
| 'xxxLarge'
|
|
1095
|
+
| 'accessibility1'
|
|
1096
|
+
| 'accessibility2'
|
|
1097
|
+
| 'accessibility3'
|
|
1098
|
+
| 'accessibility4'
|
|
1099
|
+
| 'accessibility5';
|
|
1100
|
+
/**
|
|
1101
|
+
* Sets or constrains the Dynamic Type size within the view, overriding the
|
|
1102
|
+
* value inherited from the system.
|
|
1103
|
+
*
|
|
1104
|
+
* Four variants matching SwiftUI's `dynamicTypeSize(_:)`:
|
|
1105
|
+
* - `dynamicTypeSize('large')` — fixes the Dynamic Type size to a single value
|
|
1106
|
+
* - `dynamicTypeSize({ max: 'accessibility3' })` — caps growth at a ceiling (`...accessibility3`)
|
|
1107
|
+
* - `dynamicTypeSize({ min: 'large' })` — sets a floor (`large...`)
|
|
1108
|
+
* - `dynamicTypeSize({ min: 'large', max: 'accessibility3' })` — clamps to a range (`large...accessibility3`)
|
|
1109
|
+
*
|
|
1110
|
+
* `min` and `max` are independent: pass either or both. Set it on a `<Host>` to
|
|
1111
|
+
* cascade the constraint to every descendant through the SwiftUI environment.
|
|
1112
|
+
* Keep `min` at or below `max`, or the range traps natively, like SwiftUI.
|
|
1113
|
+
* Per Apple's guidance, prefer capping at an accessibility size over disabling
|
|
1114
|
+
* Dynamic Type entirely.
|
|
1115
|
+
*
|
|
1116
|
+
* @example
|
|
1117
|
+
* ```tsx
|
|
1118
|
+
* // Cap how large text in a tight layout can grow
|
|
1119
|
+
* <Host modifiers={[dynamicTypeSize({ max: 'accessibility3' })]}>...</Host>
|
|
1120
|
+
* ```
|
|
1121
|
+
*
|
|
1122
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/dynamictypesize(_:)).
|
|
1123
|
+
*/
|
|
1124
|
+
export function dynamicTypeSize(size: DynamicTypeSizeValue): ModifierConfig;
|
|
1125
|
+
export function dynamicTypeSize(range: {
|
|
1126
|
+
min?: DynamicTypeSizeValue;
|
|
1127
|
+
max?: DynamicTypeSizeValue;
|
|
1128
|
+
}): ModifierConfig;
|
|
1129
|
+
export function dynamicTypeSize(
|
|
1130
|
+
sizeOrRange: DynamicTypeSizeValue | { min?: DynamicTypeSizeValue; max?: DynamicTypeSizeValue }
|
|
1131
|
+
): ModifierConfig {
|
|
1132
|
+
if (typeof sizeOrRange === 'object' && sizeOrRange !== null) {
|
|
1133
|
+
return createModifier('dynamicTypeSize', { min: sizeOrRange.min, max: sizeOrRange.max });
|
|
1134
|
+
}
|
|
1135
|
+
return createModifier('dynamicTypeSize', { size: sizeOrRange });
|
|
1136
|
+
}
|
|
1041
1137
|
/**
|
|
1042
1138
|
* Asks grid layouts not to offer the view extra size in the specified axes.
|
|
1043
1139
|
* @param axes - The dimensions in which the grid shouldn’t offer the view a share of any available space. This prevents a flexible view like a Spacer, Divider, or Color from defining the size of a row or column.
|
|
@@ -1329,6 +1425,7 @@ export type BuiltInModifier =
|
|
|
1329
1425
|
| ReturnType<typeof colorInvert>
|
|
1330
1426
|
| ReturnType<typeof grayscale>
|
|
1331
1427
|
| ReturnType<typeof buttonStyle>
|
|
1428
|
+
| ReturnType<typeof buttonBorderShape>
|
|
1332
1429
|
| ReturnType<typeof toggleStyle>
|
|
1333
1430
|
| ReturnType<typeof controlSize>
|
|
1334
1431
|
| ReturnType<typeof labelStyle>
|
|
@@ -1338,6 +1435,8 @@ export type BuiltInModifier =
|
|
|
1338
1435
|
| ReturnType<typeof accessibilityLabel>
|
|
1339
1436
|
| ReturnType<typeof accessibilityHint>
|
|
1340
1437
|
| ReturnType<typeof accessibilityValue>
|
|
1438
|
+
| ReturnType<typeof accessibilityIdentifier>
|
|
1439
|
+
| ReturnType<typeof accessibilityHidden>
|
|
1341
1440
|
| ReturnType<typeof layoutPriority>
|
|
1342
1441
|
| ReturnType<typeof mask>
|
|
1343
1442
|
| ReturnType<typeof overlay>
|
|
@@ -1366,6 +1465,7 @@ export type BuiltInModifier =
|
|
|
1366
1465
|
| ReturnType<typeof environment>
|
|
1367
1466
|
| ReturnType<typeof listRowBackground>
|
|
1368
1467
|
| ReturnType<typeof listRowSeparator>
|
|
1468
|
+
| ReturnType<typeof listRowSpacing>
|
|
1369
1469
|
| ReturnType<typeof truncationMode>
|
|
1370
1470
|
| ReturnType<typeof allowsTightening>
|
|
1371
1471
|
| ReturnType<typeof kerning>
|
|
@@ -1383,6 +1483,7 @@ export type BuiltInModifier =
|
|
|
1383
1483
|
| ReturnType<typeof badge>
|
|
1384
1484
|
| ReturnType<typeof listSectionMargins>
|
|
1385
1485
|
| ReturnType<typeof font>
|
|
1486
|
+
| ReturnType<typeof dynamicTypeSize>
|
|
1386
1487
|
| ReturnType<typeof gridCellUnsizedAxes>
|
|
1387
1488
|
| ReturnType<typeof gridCellColumns>
|
|
1388
1489
|
| ReturnType<typeof gridColumnAlignment>
|
|
@@ -35,7 +35,13 @@ const EXIT = ExitTransition.shrinkVertically().plus(ExitTransition.fadeOut());
|
|
|
35
35
|
* Android implementation of `Collapsible`.
|
|
36
36
|
* A rounded M3 card whose container tint fades between `transparent` (collapsed) and `surfaceContainer` (expanded).
|
|
37
37
|
*/
|
|
38
|
-
export function Collapsible({
|
|
38
|
+
export function Collapsible({
|
|
39
|
+
isOpen,
|
|
40
|
+
onOpenChange,
|
|
41
|
+
label = '',
|
|
42
|
+
labelStyle,
|
|
43
|
+
children,
|
|
44
|
+
}: CollapsibleProps) {
|
|
39
45
|
const colors = useMaterialColors();
|
|
40
46
|
const containerColor = isOpen ? colors.surfaceContainer : 'transparent';
|
|
41
47
|
|
|
@@ -51,7 +57,9 @@ export function Collapsible({ isOpen, onOpenChange, label = '', children }: Coll
|
|
|
51
57
|
colors={{ containerColor: 'transparent' }}
|
|
52
58
|
modifiers={[clickable(() => onOpenChange(!isOpen))]}>
|
|
53
59
|
<ListItem.HeadlineContent>
|
|
54
|
-
<Text
|
|
60
|
+
<Text color={labelStyle?.color} style={labelStyle}>
|
|
61
|
+
{label}
|
|
62
|
+
</Text>
|
|
55
63
|
</ListItem.HeadlineContent>
|
|
56
64
|
<ListItem.TrailingContent>
|
|
57
65
|
<Icon
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import { DisclosureGroup } from '@expo/ui/swift-ui';
|
|
1
|
+
import { DisclosureGroup, Text } from '@expo/ui/swift-ui';
|
|
2
2
|
|
|
3
|
+
import { transformToModifiers } from '../transformStyle';
|
|
3
4
|
import type { CollapsibleProps } from './types';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* iOS implementation of `Collapsible`. Wraps SwiftUI's `DisclosureGroup`.
|
|
7
8
|
*/
|
|
8
|
-
export function Collapsible({
|
|
9
|
+
export function Collapsible({
|
|
10
|
+
isOpen,
|
|
11
|
+
onOpenChange,
|
|
12
|
+
label = '',
|
|
13
|
+
labelStyle,
|
|
14
|
+
children,
|
|
15
|
+
}: CollapsibleProps) {
|
|
16
|
+
const labelTextModifiers = labelStyle
|
|
17
|
+
? transformToModifiers(undefined, {}, undefined, { textStyle: labelStyle })
|
|
18
|
+
: undefined;
|
|
19
|
+
|
|
9
20
|
return (
|
|
10
|
-
<DisclosureGroup
|
|
21
|
+
<DisclosureGroup isExpanded={isOpen} onIsExpandedChange={onOpenChange}>
|
|
22
|
+
<DisclosureGroup.Label>
|
|
23
|
+
<Text modifiers={labelTextModifiers}>{label}</Text>
|
|
24
|
+
</DisclosureGroup.Label>
|
|
11
25
|
{children}
|
|
12
26
|
</DisclosureGroup>
|
|
13
27
|
);
|
|
@@ -23,7 +23,13 @@ const Summary = (
|
|
|
23
23
|
* A primitive that toggles visibility of its content via a labelled tappable
|
|
24
24
|
* header. Controlled via `isOpen` + `onOpenChange`.
|
|
25
25
|
*/
|
|
26
|
-
export function Collapsible({
|
|
26
|
+
export function Collapsible({
|
|
27
|
+
isOpen,
|
|
28
|
+
onOpenChange,
|
|
29
|
+
label = '',
|
|
30
|
+
labelStyle,
|
|
31
|
+
children,
|
|
32
|
+
}: CollapsibleProps) {
|
|
27
33
|
const isDark = useColorScheme() === 'dark';
|
|
28
34
|
|
|
29
35
|
return (
|
|
@@ -37,7 +43,7 @@ export function Collapsible({ isOpen, onOpenChange, label = '', children }: Coll
|
|
|
37
43
|
}}
|
|
38
44
|
style={[styles.container, isDark && styles.darkText]}>
|
|
39
45
|
<Summary style={styles.summary}>
|
|
40
|
-
<Text style={isDark && styles.darkText}>{label}</Text>
|
|
46
|
+
<Text style={[isDark && styles.darkText, labelStyle]}>{label}</Text>
|
|
41
47
|
</Summary>
|
|
42
48
|
<View style={styles.content}>{children}</View>
|
|
43
49
|
</Details>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UniversalTextStyle } from '../Text/types';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Props for the [`Collapsible`](#collapsible) component, a primitive that
|
|
3
5
|
* shows or hides its content with a tap on a labelled header.
|
|
@@ -18,6 +20,11 @@ export interface CollapsibleProps {
|
|
|
18
20
|
*/
|
|
19
21
|
label?: string;
|
|
20
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Text-specific styling for the tappable header label.
|
|
25
|
+
*/
|
|
26
|
+
labelStyle?: UniversalTextStyle;
|
|
27
|
+
|
|
21
28
|
/**
|
|
22
29
|
* Content rendered when `isOpen` is `true`.
|
|
23
30
|
*/
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
useNativeState,
|
|
8
8
|
} from '@expo/ui/jetpack-compose';
|
|
9
9
|
import {
|
|
10
|
+
fillMaxWidth,
|
|
10
11
|
onSizeChanged,
|
|
11
12
|
semantics,
|
|
12
13
|
testID as testIDModifier,
|
|
@@ -96,6 +97,8 @@ export function TextInput({
|
|
|
96
97
|
const numberOfLines = numberOfLinesProp ?? rows;
|
|
97
98
|
const keyboardType = keyboardTypeProp ?? inputModeToKeyboardType(inputMode);
|
|
98
99
|
const returnKeyType = returnKeyTypeProp ?? enterKeyHintToReturnKeyType(enterKeyHint);
|
|
100
|
+
const { backgroundColor: styleBackgroundColor, ...boxStyle } = style ?? {};
|
|
101
|
+
const hideIndicator = boxStyle.borderWidth === 0 && underlineColorAndroid == null;
|
|
99
102
|
|
|
100
103
|
const initialFallbackRef = useRef(defaultValue ?? '');
|
|
101
104
|
const fallback = useNativeState<string>(initialFallbackRef.current);
|
|
@@ -157,7 +160,7 @@ export function TextInput({
|
|
|
157
160
|
ref={innerRef}
|
|
158
161
|
modifiers={[
|
|
159
162
|
...(userModifiers ?? []),
|
|
160
|
-
...transformToModifiers(
|
|
163
|
+
...transformToModifiers(boxStyle, {}),
|
|
161
164
|
...(testID ? [testIDModifier(testID)] : []),
|
|
162
165
|
...(autoComplete ? [semantics({ contentType: autoComplete })] : []),
|
|
163
166
|
...(onContentSizeChange ? [onSizeChanged(onContentSizeChange)] : []),
|
|
@@ -169,19 +172,39 @@ export function TextInput({
|
|
|
169
172
|
maxLines={multiline && numberOfLines && numberOfLines > 0 ? numberOfLines : undefined}
|
|
170
173
|
minLines={multiline && numberOfLines && numberOfLines > 0 ? numberOfLines : undefined}
|
|
171
174
|
colors={
|
|
172
|
-
caretHidden ||
|
|
175
|
+
caretHidden ||
|
|
176
|
+
cursorColor ||
|
|
177
|
+
underlineColorAndroid ||
|
|
178
|
+
placeholderTextColor ||
|
|
179
|
+
styleBackgroundColor ||
|
|
180
|
+
hideIndicator
|
|
173
181
|
? {
|
|
174
182
|
...(caretHidden
|
|
175
183
|
? { cursorColor: 'transparent' }
|
|
176
184
|
: cursorColor
|
|
177
185
|
? { cursorColor }
|
|
178
186
|
: null),
|
|
187
|
+
...(styleBackgroundColor
|
|
188
|
+
? {
|
|
189
|
+
focusedContainerColor: styleBackgroundColor,
|
|
190
|
+
unfocusedContainerColor: styleBackgroundColor,
|
|
191
|
+
disabledContainerColor: styleBackgroundColor,
|
|
192
|
+
errorContainerColor: styleBackgroundColor,
|
|
193
|
+
}
|
|
194
|
+
: null),
|
|
179
195
|
...(underlineColorAndroid
|
|
180
196
|
? {
|
|
181
197
|
unfocusedIndicatorColor: underlineColorAndroid,
|
|
182
198
|
focusedIndicatorColor: underlineColorAndroid,
|
|
183
199
|
}
|
|
184
|
-
:
|
|
200
|
+
: hideIndicator
|
|
201
|
+
? {
|
|
202
|
+
focusedIndicatorColor: 'transparent',
|
|
203
|
+
unfocusedIndicatorColor: 'transparent',
|
|
204
|
+
disabledIndicatorColor: 'transparent',
|
|
205
|
+
errorIndicatorColor: 'transparent',
|
|
206
|
+
}
|
|
207
|
+
: null),
|
|
185
208
|
...(placeholderTextColor
|
|
186
209
|
? {
|
|
187
210
|
unfocusedPlaceholderColor: placeholderTextColor,
|
|
@@ -218,7 +241,11 @@ export function TextInput({
|
|
|
218
241
|
onSelectionChange={onSelectionChange}>
|
|
219
242
|
{placeholder ? (
|
|
220
243
|
<ComposeTextField.Placeholder>
|
|
221
|
-
<Text
|
|
244
|
+
<Text
|
|
245
|
+
modifiers={[fillMaxWidth()]}
|
|
246
|
+
style={textAlign && textAlign !== 'auto' ? { textAlign } : undefined}>
|
|
247
|
+
{placeholder}
|
|
248
|
+
</Text>
|
|
222
249
|
</ComposeTextField.Placeholder>
|
|
223
250
|
) : null}
|
|
224
251
|
</ComposeTextField>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2cf329d52090d6202b7a70c1cb7c2a4b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cef9c4c1296a5c70d6a61965cba485c2dd802f47
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
01e5734d4e704ab1ff81ad1651eae63e0c5317dbba712328b1721270d303e0cf
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ba1daa456b3e0d92466af0c58b5ddd0bdd0a4c5f06c727bf7d34acd69e78c42187295b575199cefa3b2098d59eeb1ab6fcf2463c339fd6af2a186224a14f505d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar
DELETED
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
790df1c5a23dc1ac9a8521284af9bc15
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7100e52679119435cf14936c7a715d729b763e16
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
27c02acb624ed6593fe2380e495a636970bc9033ae9cd00132029c7b8ecf899e
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b0183591c16d8ba78c2d0e6aad2044b660811a5fb2126302a5f746dff169fc93fd4547d4c73ccf35bfefa083fde9819acbf3bb0fa4f6c80869e0d225880047a2
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e6bb09e9c4356f9c9879e24e1b133cba
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
31baeb0a70741592621ef9b3fe973a23610a563b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c3b3041adb593ed9fc7963db11fd0a71170dc9778d48f0aac09908b9374500b9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f91dfa09f2f467b5332f41b2232a9956d8a542f41568d9fe895fca36be7643fcd7c3f8f03e6410dde0abea53ad161499b23a208a5b5277d735b02bc60f4edfdb
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
461d361330d6a24030016012aa6e920c
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0e241f8a0e32f5849c1879bd3bc73fcade47e375
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
473cf11bc355d074e0289ab7523931ed0868b056d0b0d3aa434d43524ac013f3
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.15/expo.modules.ui-56.0.15.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
81d473db58273d5ed4738fe0c68a614d82590d7ef2c68dea746f40c93413f5e63f139faedb9d5afc9fc20dc5f21ae2103fd7933f2f10915fd05e96207681c242
|