@plexui/react-native 0.2.25 → 0.2.27
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/README.md +3 -0
- package/dist/es/components/BottomActions/BottomActions.js +2 -2
- package/dist/es/components/BottomSheet/BottomSheet.js +7 -3
- package/dist/es/components/Button/Button.js +10 -6
- package/dist/es/components/Card/Card.js +9 -2
- package/dist/es/components/Checkbox/Checkbox.js +2 -2
- package/dist/es/components/Chip/Chip.js +19 -11
- package/dist/es/components/Dialog/Dialog.js +18 -6
- package/dist/es/components/EmptyMessage/EmptyMessage.js +2 -2
- package/dist/es/components/Indicator/CircularProgress.js +11 -5
- package/dist/es/components/Input/Input.js +17 -2
- package/dist/es/components/List/List.js +77 -9
- package/dist/es/components/Menu/Menu.js +15 -5
- package/dist/es/components/PageControl/PageControl.js +7 -3
- package/dist/es/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/es/components/RollingNumber/RollingNumber.js +7 -7
- package/dist/es/components/ScrollEdge/ScrollEdge.js +12 -6
- package/dist/es/components/Select/Select.js +4 -2
- package/dist/es/components/Switch/Switch.js +2 -2
- package/dist/es/components/TabBar/TabBar.js +15 -0
- package/dist/es/components/TextLink/TextLink.js +23 -3
- package/dist/es/index.js +2 -2
- package/dist/es/internal/a11y.js +12 -0
- package/dist/es/internal/row.js +13 -0
- package/dist/es/theme/ThemeProvider.js +4 -2
- package/dist/es/theme/material.js +2 -0
- package/dist/types/components/BottomActions/BottomActions.d.ts +6 -1
- package/dist/types/components/Button/Button.d.ts +5 -0
- package/dist/types/components/Card/Card.d.ts +5 -1
- package/dist/types/components/Chip/Chip.d.ts +9 -3
- package/dist/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/types/components/EmptyMessage/EmptyMessage.d.ts +4 -2
- package/dist/types/components/Indicator/CircularProgress.d.ts +10 -2
- package/dist/types/components/Input/Input.d.ts +8 -1
- package/dist/types/components/List/List.d.ts +36 -1
- package/dist/types/components/Menu/Menu.d.ts +10 -4
- package/dist/types/components/RollingNumber/RollingNumber.d.ts +3 -1
- package/dist/types/components/ScrollEdge/ScrollEdge.d.ts +7 -1
- package/dist/types/components/TabBar/TabBar.d.ts +13 -0
- package/dist/types/components/TextLink/TextLink.d.ts +7 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/internal/a11y.d.ts +22 -0
- package/dist/types/internal/row.d.ts +21 -2
- package/dist/types/theme/ThemeProvider.d.ts +3 -2
- package/dist/types/theme/material.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/BottomActions/BottomActions.tsx +7 -2
- package/src/components/BottomSheet/BottomSheet.tsx +9 -4
- package/src/components/Button/Button.tsx +19 -4
- package/src/components/Card/Card.tsx +8 -3
- package/src/components/Checkbox/Checkbox.tsx +2 -1
- package/src/components/Chip/Chip.tsx +28 -9
- package/src/components/Dialog/Dialog.tsx +30 -6
- package/src/components/EmptyMessage/EmptyMessage.tsx +12 -3
- package/src/components/Indicator/CircularProgress.tsx +27 -11
- package/src/components/Input/Input.tsx +43 -3
- package/src/components/List/List.tsx +125 -7
- package/src/components/Menu/Menu.tsx +27 -11
- package/src/components/PageControl/PageControl.tsx +7 -3
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/RollingNumber/RollingNumber.tsx +10 -8
- package/src/components/ScrollEdge/ScrollEdge.tsx +19 -6
- package/src/components/Select/Select.tsx +4 -1
- package/src/components/Switch/Switch.tsx +2 -1
- package/src/components/TabBar/TabBar.tsx +15 -0
- package/src/components/TextLink/TextLink.tsx +52 -3
- package/src/index.ts +2 -2
- package/src/internal/a11y.ts +13 -0
- package/src/internal/row.ts +14 -2
- package/src/theme/ThemeProvider.tsx +7 -4
- package/src/theme/material.ts +2 -0
|
@@ -29,6 +29,11 @@ export type ButtonProps = Omit<PressableProps, "children" | "style"> & {
|
|
|
29
29
|
uniform?: boolean;
|
|
30
30
|
/** Takes the whole width. */
|
|
31
31
|
block?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The most lines a text label takes before it ends in an ellipsis: 2 lets a long label ("Get 3 months for €35.99" in a
|
|
34
|
+
* longer language or at a large text size) wrap within the button, which grows from its height. @default 1
|
|
35
|
+
*/
|
|
36
|
+
labelLines?: number;
|
|
32
37
|
selected?: boolean;
|
|
33
38
|
loading?: boolean;
|
|
34
39
|
disabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type ImageSourcePropType, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import type { Theme } from "../../theme/types";
|
|
4
|
-
export type CardVariant = "outline" | "solid" | "ghost";
|
|
4
|
+
export type CardVariant = "outline" | "solid" | "ghost" | "elevated";
|
|
5
5
|
export type CardSize = "sm" | "md" | "lg";
|
|
6
6
|
/** A fill of the palette: the accent, the Plex primary, or a semantic color. */
|
|
7
7
|
export type CardColor = "accent" | "primary" | "info" | "success" | "warning" | "caution" | "danger" | "discovery";
|
|
@@ -31,6 +31,10 @@ export type CardProps = {
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function cardSurface(theme: Theme, variant: CardVariant): {
|
|
33
33
|
backgroundColor: string;
|
|
34
|
+
boxShadow?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
backgroundColor: string;
|
|
37
|
+
boxShadow: string;
|
|
34
38
|
};
|
|
35
39
|
/**
|
|
36
40
|
* A card, as @plexui/ui's Card with its parts (`Card.Header`, `.Title`, `.Description`, `.Content`, `.Footer`,
|
|
@@ -24,10 +24,16 @@ export type ChipProps = {
|
|
|
24
24
|
accessibilityLabel?: string;
|
|
25
25
|
/**
|
|
26
26
|
* iOS: `tag`, a capsule of the gray fill 40pt tall (a tag cloud in a sheet, as Maps' Filters), or `glass`, a glass
|
|
27
|
-
* capsule 44pt tall (a filter in a row over content, as Maps' filters under its search). Android draws
|
|
28
|
-
* either
|
|
27
|
+
* capsule 44pt tall (a filter in a row over content, as Maps' filters under its search). Android draws Material's
|
|
28
|
+
* chip with either; with `glass` it stands on a glass of its size (the bar circles'), readable over content.
|
|
29
|
+
* @default "tag"
|
|
29
30
|
*/
|
|
30
31
|
appearance?: "tag" | "glass";
|
|
32
|
+
/**
|
|
33
|
+
* iOS: `sm`, a step under the regular chip, as a filter row a step under Maps' 44: 36pt tall, the label 15/20, the
|
|
34
|
+
* insides in proportion, the target still 44. Android keeps Material's 32dp chip. @default "md"
|
|
35
|
+
*/
|
|
36
|
+
size?: "md" | "sm";
|
|
31
37
|
/** An input chip: called when the reader takes the value back (a cross on Android; see `removeStyle` on iOS). */
|
|
32
38
|
onRemove?: () => void;
|
|
33
39
|
/** The remove action's name, for screen readers. @default "Remove" */
|
|
@@ -49,4 +55,4 @@ export type ChipProps = {
|
|
|
49
55
|
testID?: string;
|
|
50
56
|
style?: StyleProp<ViewStyle>;
|
|
51
57
|
};
|
|
52
|
-
export declare function Chip({ children, selected: selectedProp, defaultSelected, onSelectedChange, onPress, icon, trailingIcon, menu, expanded, accessibilityLabel, appearance, onRemove, removeLabel, removeStyle, onLongPress, longPressLabel, disabled, testID, style, }: ChipProps): import("react").JSX.Element;
|
|
58
|
+
export declare function Chip({ children, selected: selectedProp, defaultSelected, onSelectedChange, onPress, icon, trailingIcon, menu, expanded, accessibilityLabel, appearance, size, onRemove, removeLabel, removeStyle, onLongPress, longPressLabel, disabled, testID, style, }: ChipProps): import("react").JSX.Element;
|
|
@@ -29,6 +29,12 @@ export type DialogProps = {
|
|
|
29
29
|
mobileLayout?: "inline" | "stacked";
|
|
30
30
|
/** A tap outside, Android's back and Escape close it: Android's dialogs do, an iOS alert does not. @default Android true, iOS false */
|
|
31
31
|
dismissible?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The colors of the main action: `accent`, as iOS fills an alert's preferred action and Android writes its dialog
|
|
34
|
+
* buttons; `primary`, the main button's own (the solid primary button's fill and label on iOS, the primary ghost
|
|
35
|
+
* button's text on Android), for an app whose main actions are in its ink. @default "accent"
|
|
36
|
+
*/
|
|
37
|
+
actionColor?: "accent" | "primary";
|
|
32
38
|
testID?: string;
|
|
33
39
|
};
|
|
34
40
|
/**
|
|
@@ -37,7 +43,7 @@ export type DialogProps = {
|
|
|
37
43
|
* radius 21, a Medium 20 title over 16 text, text buttons in the accent at the end, Android's dialog animation). The
|
|
38
44
|
* web Dialog's `mobileVariant="alert"` as one call; a sheet is `BottomSheet`.
|
|
39
45
|
*/
|
|
40
|
-
export declare function Dialog({
|
|
46
|
+
export declare function Dialog({ actionColor, ...props }: DialogProps): import("react").JSX.Element;
|
|
41
47
|
export type ChoiceDialogProps = {
|
|
42
48
|
open: boolean;
|
|
43
49
|
onClose: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from "react-native";
|
|
3
3
|
type Tone = "secondary" | "danger" | "warning";
|
|
4
4
|
export type EmptyMessageProps = {
|
|
5
5
|
children: ReactNode;
|
|
@@ -36,9 +36,11 @@ declare function EmptyMessageIcon({ children, color, size }: {
|
|
|
36
36
|
declare namespace EmptyMessageIcon {
|
|
37
37
|
var displayName: string;
|
|
38
38
|
}
|
|
39
|
-
declare function EmptyMessageTitle({ children, color }: {
|
|
39
|
+
declare function EmptyMessageTitle({ children, color, style, }: {
|
|
40
40
|
children: ReactNode;
|
|
41
41
|
color?: Tone;
|
|
42
|
+
/** Over the title's own type: a brand's display face at its size and line (`fontFamily`, `fontSize`, `lineHeight`). */
|
|
43
|
+
style?: StyleProp<TextStyle>;
|
|
42
44
|
}): import("react").JSX.Element;
|
|
43
45
|
declare namespace EmptyMessageTitle {
|
|
44
46
|
var displayName: string;
|
|
@@ -8,8 +8,16 @@ export type CircularProgressProps = {
|
|
|
8
8
|
progress?: number;
|
|
9
9
|
/** Size of the indicator, in pixels. @default 28 */
|
|
10
10
|
size?: number;
|
|
11
|
-
/** Stroke width of the ring, in pixels of its 20px drawing, between 1 and 4. @default 2 */
|
|
11
|
+
/** Stroke width of the ring, in pixels of its 20px drawing, between 1 and 4 (with `ring="edge"`, in pixels of `size`). @default 2 */
|
|
12
12
|
strokeWidth?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Where the ring stands in its box: `"inset"`, the web's drawing (a ring of radius 8 in 20, so 28 across draws a
|
|
15
|
+
* ring of about 24); `"edge"`, the ring's outside on the box's edge, `size` the ring's own size.
|
|
16
|
+
* @default "inset"
|
|
17
|
+
*/
|
|
18
|
+
ring?: "inset" | "edge";
|
|
19
|
+
/** How long a new value takes to draw, in ms. @default 300 on iOS, 200 on Android */
|
|
20
|
+
duration?: number;
|
|
13
21
|
/** Color of the active progress track (stroke): a color or a token, such as `"var(--gray-1000)"`. */
|
|
14
22
|
trackActiveColor?: string;
|
|
15
23
|
/** Color of the base track (background stroke): a color or a token, such as `"var(--alpha-15)"`. */
|
|
@@ -31,4 +39,4 @@ export declare function getSimulatedProgress(maxTime: number, elapsedTime: numbe
|
|
|
31
39
|
* of its own for this, so both draw the Plex ring; a new value moves the arc in 300ms (ease) on iOS, as the web's
|
|
32
40
|
* transition, and in Android's determinate radial progress time (200ms, decelerating); at once with reduced motion.
|
|
33
41
|
*/
|
|
34
|
-
export declare function CircularProgress({ maxDuration, done, progress: progressProp, size, strokeWidth, trackActiveColor, trackColor, "aria-label": ariaLabel, accessibilityLabel, testID, style, }: CircularProgressProps): import("react").JSX.Element;
|
|
42
|
+
export declare function CircularProgress({ maxDuration, done, progress: progressProp, size, strokeWidth, ring, duration, trackActiveColor, trackColor, "aria-label": ariaLabel, accessibilityLabel, testID, style, }: CircularProgressProps): import("react").JSX.Element;
|
|
@@ -149,11 +149,18 @@ export type TextFieldProps = InputProps & {
|
|
|
149
149
|
/** Shown under the field in place of the description, and marks it invalid. */
|
|
150
150
|
errorMessage?: ReactNode;
|
|
151
151
|
required?: boolean;
|
|
152
|
+
/** Content at the end of the label's line on iOS, or of the help's line on Android (where the label floats). */
|
|
153
|
+
labelAction?: ReactNode;
|
|
154
|
+
/**
|
|
155
|
+
* Shows the count of characters against `maxLength` (`3/15`): Material's counter at the end of the help's line on
|
|
156
|
+
* Android, at the end of the label's line on iOS.
|
|
157
|
+
*/
|
|
158
|
+
counter?: boolean;
|
|
152
159
|
};
|
|
153
160
|
/**
|
|
154
161
|
* A labelled text field: Plex UI's Field around an Input. iOS sets the label over the field (15/20 medium) and the
|
|
155
162
|
* description or error under it (15/20, 4pt below, `--mobile-field-error-*`); Android is the outlined field with its
|
|
156
163
|
* floating label (on the line of an outlined field) and the help under it (14, 14dp in).
|
|
157
164
|
*/
|
|
158
|
-
export declare function TextField({ label, description, errorMessage, required, invalid, ...input }: TextFieldProps): import("react").JSX.Element;
|
|
165
|
+
export declare function TextField({ label, description, errorMessage, required, invalid, labelAction, counter, ...input }: TextFieldProps): import("react").JSX.Element;
|
|
159
166
|
export {};
|
|
@@ -44,6 +44,14 @@ export type ListProps = {
|
|
|
44
44
|
};
|
|
45
45
|
/** Whether a control stands in a List's rows (a FloatingLabelInput is a row there, a List of its own elsewhere). */
|
|
46
46
|
export declare function useInList(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Where a List's rows start their text inside the card and how round the card is, for a card built beside a List
|
|
49
|
+
* that must line up with it: iOS `--list-row-inset` (20) and `--field-group-radius` (26), Android 21 and 16.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useListMetrics(): {
|
|
52
|
+
rowInset: number;
|
|
53
|
+
radius: number;
|
|
54
|
+
};
|
|
47
55
|
/**
|
|
48
56
|
* A section of rows. iOS 26: a section of an inset grouped list, as @plexui/ui's FieldGroup on a phone
|
|
49
57
|
* (`--field-group-radius` 26, the grouped secondary surface, rows 20 in from its edges, hairlines between rows from
|
|
@@ -57,6 +65,25 @@ export declare function useInList(): boolean;
|
|
|
57
65
|
* the footer on that gray.
|
|
58
66
|
*/
|
|
59
67
|
export declare function List({ children, header, description, footer, error, surface, action, headerProminence, columns, "aria-label": ariaLabel, testID, style, }: ListProps): import("react").JSX.Element;
|
|
68
|
+
export type ListStackProps = {
|
|
69
|
+
/** The sections (`List`) and any blocks between them (a note, a button). */
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
/** The space between two blocks that are not both sections, as the screen's own. @default 0 */
|
|
72
|
+
gap?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Keeps the room under the last section (iOS 35 over the home indicator, Android at least 16 over the system's bar).
|
|
75
|
+
* Off for a stack that is not the screen's end. @default true
|
|
76
|
+
*/
|
|
77
|
+
end?: boolean;
|
|
78
|
+
style?: StyleProp<ViewStyle>;
|
|
79
|
+
testID?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Sections one under another, as SwiftUI's Form and the web's stacked FieldGroups space them: on iOS 35 rows to rows,
|
|
83
|
+
* less what a footer's block (17.33) and a header's (18.67, a prominent one 18, after a footer 11.33) take; on Android
|
|
84
|
+
* 12 apart, none after a footer. Blocks that are not sections keep `gap`; the stack ends with the last section's room.
|
|
85
|
+
*/
|
|
86
|
+
export declare function ListStack({ children, gap, end, style, testID }: ListStackProps): import("react").JSX.Element;
|
|
60
87
|
export type ListItemProps = {
|
|
61
88
|
/** The row's text, as @plexui/ui's NavigationRow `label`. */
|
|
62
89
|
label: ReactNode;
|
|
@@ -89,6 +116,12 @@ export type ListItemProps = {
|
|
|
89
116
|
* control stays the one element for a screen reader, named by the label when it has no name of its own.
|
|
90
117
|
*/
|
|
91
118
|
trailing?: ReactNode;
|
|
119
|
+
/**
|
|
120
|
+
* A row of a list to pick one from (countries with their codes, a sound): `true` draws the check at its end (the
|
|
121
|
+
* accent's checkmark), `false` keeps the check's room, so the values of every row stand in one column and a pick
|
|
122
|
+
* moves no text. Read as selected. Leave `trailing` out.
|
|
123
|
+
*/
|
|
124
|
+
selected?: boolean;
|
|
92
125
|
/**
|
|
93
126
|
* An error under the row, as the web's FieldError in a form row: on iOS a line of its own across the row, 4 under the
|
|
94
127
|
* label, 15/20 in the danger color after a 16pt exclamation mark; on Android under the label, 13sp in the error color.
|
|
@@ -117,6 +150,8 @@ export type ListItemProps = {
|
|
|
117
150
|
/** A row in red, as a destructive action row. */
|
|
118
151
|
destructive?: boolean;
|
|
119
152
|
accessibilityLabel?: string;
|
|
153
|
+
/** What a press does, read after the name ("Edit date of birth"): on the row, or on the control that takes its focus. */
|
|
154
|
+
accessibilityHint?: string;
|
|
120
155
|
testID?: string;
|
|
121
156
|
};
|
|
122
157
|
/**
|
|
@@ -131,7 +166,7 @@ export type ListItemProps = {
|
|
|
131
166
|
* in (a multi-select list); a 1px divider from the text's start to the card's end, none under a row with a tile (a
|
|
132
167
|
* tiled row draws none).
|
|
133
168
|
*/
|
|
134
|
-
export declare function ListItem({ label, description, leading, leadingColor, value, valuePlacement, valueColor, trailing, error, checked: checkedProp, defaultChecked, onCheckedChange, disclosure, onPress, onLongPress, longPressLabel, disabled, destructive, accessibilityLabel, testID, }: ListItemProps): import("react").JSX.Element;
|
|
169
|
+
export declare function ListItem({ label, description, leading, leadingColor, value, valuePlacement, valueColor, trailing: trailingProp, selected, error, checked: checkedProp, defaultChecked, onCheckedChange, disclosure, onPress, onLongPress, longPressLabel, disabled, destructive, accessibilityLabel, accessibilityHint, testID, }: ListItemProps): import("react").JSX.Element;
|
|
135
170
|
export type StackedRowProps = {
|
|
136
171
|
/** The label over the value; none for a row whose placeholder names the field (`hideLabel`). */
|
|
137
172
|
label?: ReactNode;
|
|
@@ -63,6 +63,16 @@ export type MenuContentProps = {
|
|
|
63
63
|
align?: "start" | "end";
|
|
64
64
|
/** @default 250 on iOS; on Android the popup fits its items, 196 to 288 */
|
|
65
65
|
width?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Several options to pick: a press on an item with `checked` checks or unchecks it and the menu stays open; its items
|
|
68
|
+
* read as checkboxes. @default false
|
|
69
|
+
*/
|
|
70
|
+
multiple?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The menu opens over its trigger, as Android's popup and the web's phone menu; `false` opens it under the trigger,
|
|
73
|
+
* its top at the trigger's bottom edge, as Material's dropdown menu under a chip. @default true
|
|
74
|
+
*/
|
|
75
|
+
cover?: boolean;
|
|
66
76
|
"aria-label"?: string;
|
|
67
77
|
testID?: string;
|
|
68
78
|
};
|
|
@@ -76,10 +86,6 @@ type SurfaceProps = MenuContentProps & {
|
|
|
76
86
|
anchor: MenuAnchor | null;
|
|
77
87
|
onClose: () => void;
|
|
78
88
|
check?: boolean;
|
|
79
|
-
/** Select's `multiple`: a press checks or unchecks an option and the menu stays open. */
|
|
80
|
-
multiple?: boolean;
|
|
81
|
-
/** The menu opens over its trigger, as Android's popup and the web's phone menu (a dropdown field's list opens under it). @default true */
|
|
82
|
-
cover?: boolean;
|
|
83
89
|
/** The List row the menu opens from: on Android the screen dims around it and the popup stands under it. */
|
|
84
90
|
row?: MenuRow | null;
|
|
85
91
|
/** Opened from a bar's button: on Android the header menu, in the bar's glass. */
|
|
@@ -9,6 +9,8 @@ export type RollingNumberProps = Omit<TextProps, "children"> & {
|
|
|
9
9
|
format?: Intl.NumberFormatOptions;
|
|
10
10
|
/** The style of the row of characters. */
|
|
11
11
|
containerStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
/** How long a change takes, in ms. @default `--rolling-number-duration` (600) on iOS, 320 on Android */
|
|
13
|
+
duration?: number;
|
|
12
14
|
};
|
|
13
15
|
type Character = {
|
|
14
16
|
character: string;
|
|
@@ -32,5 +34,5 @@ export declare const rollingNumberParts: (value: number, locales?: Intl.LocalesA
|
|
|
32
34
|
* 0.3 of the font size while the new one comes in, in 320ms (ease-out quint), up for a larger number. With reduced
|
|
33
35
|
* motion it changes at once. A screen reader reads the written number.
|
|
34
36
|
*/
|
|
35
|
-
export declare function RollingNumber({ value, locales, format, containerStyle, style, size, variant, weight, mono, testID, accessibilityLabel, ...text }: RollingNumberProps): import("react").JSX.Element;
|
|
37
|
+
export declare function RollingNumber({ value, locales, format, containerStyle, duration, style, size, variant, weight, mono, testID, accessibilityLabel, ...text }: RollingNumberProps): import("react").JSX.Element;
|
|
36
38
|
export {};
|
|
@@ -6,6 +6,12 @@ export type ScrollEdgeProps = {
|
|
|
6
6
|
scrolled?: boolean;
|
|
7
7
|
/** The color of the screen it fades into (a grouped screen's canvas). @default the theme's background */
|
|
8
8
|
canvasColor?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Top edge under a floating row (filters, tabs): where the fade ends, from the screen's top. Only what went under the
|
|
11
|
+
* row is muted, the content below it stays sharp: pass the row's bottom. On Android, too, the edge then is the row's
|
|
12
|
+
* (iOS 27.2's), not the status bar's alone.
|
|
13
|
+
*/
|
|
14
|
+
fadeEnd?: number;
|
|
9
15
|
testID?: string;
|
|
10
16
|
style?: StyleProp<ViewStyle>;
|
|
11
17
|
};
|
|
@@ -16,4 +22,4 @@ export type ScrollEdgeProps = {
|
|
|
16
22
|
* the screen's color that grows to 46% at the screen's edge. On Android the top edge is the soft edge of its top bar
|
|
17
23
|
* over the status bar alone, the bottom one draws nothing. Lay it over the screen, after the scroll view.
|
|
18
24
|
*/
|
|
19
|
-
export declare function ScrollEdge({ edge, scrolled, canvasColor, testID, style }: ScrollEdgeProps): import("react").JSX.Element | null;
|
|
25
|
+
export declare function ScrollEdge({ edge, scrolled, canvasColor, fadeEnd, testID, style }: ScrollEdgeProps): import("react").JSX.Element | null;
|
|
@@ -107,6 +107,19 @@ declare namespace TabBarRoot {
|
|
|
107
107
|
export declare const TabBar: typeof TabBarRoot & {
|
|
108
108
|
Item: typeof TabBarItem;
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* Where the tab bar's capsule stands, for what floats over it (a screen's floating buttons a set gap above it, a
|
|
112
|
+
* scroll that ends over it): `capsuleHeight`, and `bottom`, from the screen's bottom edge to the capsule's. iOS 26: the
|
|
113
|
+
* 54pt tabs in a capsule 4 above and below (62), 21 over the screen's bottom (or over the home indicator); Android:
|
|
114
|
+
* 56dp, 8 over the gesture bar. The bar itself (its soft edge) reaches higher. Pass the bar's `safeArea`.
|
|
115
|
+
*/
|
|
116
|
+
export declare function useTabBarMetrics({ safeArea, minimized }?: {
|
|
117
|
+
safeArea?: boolean;
|
|
118
|
+
minimized?: boolean;
|
|
119
|
+
}): {
|
|
120
|
+
capsuleHeight: number;
|
|
121
|
+
bottom: number;
|
|
122
|
+
};
|
|
110
123
|
/**
|
|
111
124
|
* Minimizes a TabBar while the screen scrolls down and expands it when it scrolls back up, as iOS 26
|
|
112
125
|
* `tabBarMinimizeBehavior(.onScrollDown)`: pass `onScroll` to the ScrollView and `minimized` and
|
|
@@ -16,6 +16,12 @@ export type TextLinkProps = {
|
|
|
16
16
|
onPress?: (event: GestureResponderEvent) => void;
|
|
17
17
|
/** The weight of the link's text; it takes the text's own around it by default (`--link-font-weight: inherit`). */
|
|
18
18
|
weight?: FontWeightName;
|
|
19
|
+
/**
|
|
20
|
+
* A small action of its own outside running text (Restore Purchases under a store's plans): on iOS the text alone
|
|
21
|
+
* at the subheadline (15/20, regular) in the link color with a 44pt target and the system's pressed fade; on Android
|
|
22
|
+
* Material's small text button. @default false
|
|
23
|
+
*/
|
|
24
|
+
standalone?: boolean;
|
|
19
25
|
accessibilityLabel?: string;
|
|
20
26
|
testID?: string;
|
|
21
27
|
style?: StyleProp<TextStyle>;
|
|
@@ -27,4 +33,4 @@ export type TextLinkProps = {
|
|
|
27
33
|
* row in the Plex Android look (the text's ink at 11%, white at 5% at night). With `href` it is a `link` and opens the
|
|
28
34
|
* URL (an `<a>` on the web, a new tab for an external one); with only `onPress` it is a `button`.
|
|
29
35
|
*/
|
|
30
|
-
export declare function TextLink({ children, href, primary, underline, forceExternal, onPress, weight, accessibilityLabel, testID, style }: TextLinkProps): import("react").JSX.Element;
|
|
36
|
+
export declare function TextLink({ children, href, primary, underline, forceExternal, onPress, weight, standalone, accessibilityLabel, testID, style }: TextLinkProps): import("react").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { Glass, type GlassProps } from "./internal/Glass";
|
|
|
10
10
|
export { BarItemContext, type BarItemStyle } from "./components/Button/Button";
|
|
11
11
|
export { NavigationButton, type NavigationAction, type NavigationButtonProps } from "./components/NavigationButton/NavigationButton";
|
|
12
12
|
export { Toolbar, type ToolbarBackground, type ToolbarContentProps, type ToolbarPlacement, type ToolbarProps, type ToolbarTitleAlign, type ToolbarTitleProps, type ToolbarTitleStyle, } from "./components/Toolbar/Toolbar";
|
|
13
|
-
export { TabBar, useTabBarMinimize, type TabBarBackground, type TabBarBadgeColor, type TabBarItemProps, type TabBarProminent, type TabBarProps, type TabBarSearch, } from "./components/TabBar/TabBar";
|
|
13
|
+
export { TabBar, useTabBarMetrics, useTabBarMinimize, type TabBarBackground, type TabBarBadgeColor, type TabBarItemProps, type TabBarProminent, type TabBarProps, type TabBarSearch, } from "./components/TabBar/TabBar";
|
|
14
14
|
export { SegmentedControl, type SegmentedControlBadgeProp, type SegmentedControlOptionProps, type SegmentedControlProps, } from "./components/SegmentedControl/SegmentedControl";
|
|
15
15
|
export { Switch, type SwitchProps } from "./components/Switch/Switch";
|
|
16
16
|
export { Checkbox, type CheckboxProps } from "./components/Checkbox/Checkbox";
|
|
@@ -37,7 +37,7 @@ export { Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVari
|
|
|
37
37
|
export { BottomActions, type BottomActionsBackground, type BottomActionsProps } from "./components/BottomActions/BottomActions";
|
|
38
38
|
export { IntroHeader, type IntroHeaderAlign, type IntroHeaderProps } from "./components/IntroHeader/IntroHeader";
|
|
39
39
|
export { Card, cardColors, type CardColor, type CardMediaProps, type CardProps, type CardSize, type CardVariant } from "./components/Card/Card";
|
|
40
|
-
export { List, ListItem, type ListItemProps, type ListProps } from "./components/List/List";
|
|
40
|
+
export { List, ListItem, ListStack, useListMetrics, type ListItemProps, type ListProps, type ListStackProps } from "./components/List/List";
|
|
41
41
|
export { Chip, type ChipProps } from "./components/Chip/Chip";
|
|
42
42
|
export { Skeleton, type SkeletonProps } from "./components/Skeleton/Skeleton";
|
|
43
43
|
export { Progress, progressSegments, type ProgressColor, type ProgressProps, type ProgressSegment, type ProgressSize } from "./components/Progress/Progress";
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A hint (what a press does) for a screen reader: `accessibilityHint` on a phone; on the web, where React Native Web
|
|
4
|
+
* drops that prop, the id of an unseen text (`nodeProps`, the text's `nativeID`) that `aria-describedby` points at.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useHint(hint: string | undefined): {
|
|
7
|
+
id: undefined;
|
|
8
|
+
props: {
|
|
9
|
+
"aria-describedby"?: undefined;
|
|
10
|
+
accessibilityHint?: undefined;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
id: string | undefined;
|
|
14
|
+
props: {
|
|
15
|
+
"aria-describedby": string;
|
|
16
|
+
accessibilityHint?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
accessibilityHint: string;
|
|
19
|
+
"aria-describedby"?: undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/** Ids for `aria-describedby`, the empty ones left out. */
|
|
23
|
+
export declare const describedBy: (...ids: (string | undefined)[]) => string | undefined;
|
|
2
24
|
/**
|
|
3
25
|
* The description of a control for a screen reader: read after its label and state, as VoiceOver and TalkBack
|
|
4
26
|
* read a hint, and tied to the text by `aria-describedby` on the web. Give `id` to the description's text as its
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GestureResponderEvent } from "react-native";
|
|
2
2
|
/** The end of a List row, as its control sees it. */
|
|
3
3
|
export type RowEnd = {
|
|
4
4
|
/**
|
|
@@ -65,9 +65,12 @@ export declare function rowHold(hold: ((held: boolean, event?: GestureResponderE
|
|
|
65
65
|
onPressOut: () => void;
|
|
66
66
|
} | null;
|
|
67
67
|
/** A List row's touch and hold, for the control at its end, which takes the row's touches and its screen reader focus. */
|
|
68
|
+
/** A row's touch and hold (`run`, named by `label`) and its press's hint, for the control that takes the row's focus. */
|
|
68
69
|
export type RowAction = {
|
|
69
|
-
run
|
|
70
|
+
run?: () => void;
|
|
70
71
|
label?: string;
|
|
72
|
+
hint?: string;
|
|
73
|
+
hintId?: string;
|
|
71
74
|
};
|
|
72
75
|
/**
|
|
73
76
|
* Set by a row with `onLongPress`: a control at its end that takes its own touches (a checkbox, a switch, a choice)
|
|
@@ -112,4 +115,20 @@ export declare function holdProps(own: {
|
|
|
112
115
|
}[];
|
|
113
116
|
onAccessibilityAction: (event: AccessibilityActionEvent) => void;
|
|
114
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* The row's hint on the control that takes the row's focus, kept with the control's own description: a phone reads
|
|
120
|
+
* both as one hint; on the web the control is described by its description and the row's unseen hint text.
|
|
121
|
+
*/
|
|
122
|
+
export declare function rowHint(row: RowAction | null, described: {
|
|
123
|
+
id?: string;
|
|
124
|
+
props: {
|
|
125
|
+
accessibilityHint?: string;
|
|
126
|
+
};
|
|
127
|
+
}): {
|
|
128
|
+
"aria-describedby": string;
|
|
129
|
+
accessibilityHint?: undefined;
|
|
130
|
+
} | {
|
|
131
|
+
accessibilityHint: string;
|
|
132
|
+
"aria-describedby"?: undefined;
|
|
133
|
+
} | null;
|
|
115
134
|
export {};
|
|
@@ -20,9 +20,10 @@ export type ThemeProviderProps = {
|
|
|
20
20
|
selectionColor?: SelectionColor;
|
|
21
21
|
/**
|
|
22
22
|
* The product's brand: colors, faces and radii over the Plex UI defaults. A nested ThemeProvider keeps its
|
|
23
|
-
* parent's brand and lays its own over it
|
|
23
|
+
* parent's brand and lays its own over it; `null` draws its subtree in Plex UI's own colors and radii, not the
|
|
24
|
+
* parent's brand (a stand-in for a system prompt, which is in the system's colors, never the app's). Faces stay.
|
|
24
25
|
*/
|
|
25
|
-
brand?: BrandTheme;
|
|
26
|
+
brand?: BrandTheme | null;
|
|
26
27
|
/**
|
|
27
28
|
* Faces of the kit (a nested ThemeProvider takes its parent's). Without them the platform's own face is used; see
|
|
28
29
|
* `interFonts` and `robotoFonts`. Faces per drawn platform, `{ ios, android }`, take the one of `platform`: the
|
|
@@ -73,6 +73,8 @@ export declare const elevationShadow: {
|
|
|
73
73
|
readonly bar: "0 2px 8px rgba(0, 0, 0, 0.06)";
|
|
74
74
|
/** The same over a dark screen, where a light shadow does not show: the controls stand apart by their fill. */
|
|
75
75
|
readonly barDark: "0 2px 8px rgba(0, 0, 0, 0.3)";
|
|
76
|
+
/** Level 1: an elevated card. */
|
|
77
|
+
readonly level1: "0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15)";
|
|
76
78
|
readonly level2: "0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3)";
|
|
77
79
|
readonly level3: "0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15)";
|
|
78
80
|
};
|
package/package.json
CHANGED
|
@@ -31,6 +31,11 @@ export type BottomActionsProps = {
|
|
|
31
31
|
background?: BottomActionsBackground
|
|
32
32
|
/** The color the floating edge fades into: the screen's (a grouped screen's gray). @default the theme's background */
|
|
33
33
|
canvasColor?: string
|
|
34
|
+
/**
|
|
35
|
+
* No main action: the lone Button takes the second action's look (iOS 26's glass capsule, Android's ghost button),
|
|
36
|
+
* as a step whose rows move on by themselves keeps only its way past ("Skip"). @default false
|
|
37
|
+
*/
|
|
38
|
+
secondary?: boolean
|
|
34
39
|
testID?: string
|
|
35
40
|
style?: StyleProp<ViewStyle>
|
|
36
41
|
}
|
|
@@ -42,7 +47,7 @@ export type BottomActionsProps = {
|
|
|
42
47
|
* action stands under it, 8 apart. Android: the Plex Android look's 48dp full-width button, 16dp from the sides and
|
|
43
48
|
* 16 above the gesture bar. Each Button inside is a block of the size `3xl` unless it sets its own.
|
|
44
49
|
*/
|
|
45
|
-
export function BottomActions({ children, floating = false, background = "soft", canvasColor, testID, style }: BottomActionsProps) {
|
|
50
|
+
export function BottomActions({ children, floating = false, background = "soft", canvasColor, secondary = false, testID, style }: BottomActionsProps) {
|
|
46
51
|
const theme = useTheme()
|
|
47
52
|
const insets = useSafeAreaInsets()
|
|
48
53
|
const android = theme.isAndroid
|
|
@@ -57,7 +62,7 @@ export function BottomActions({ children, floating = false, background = "soft",
|
|
|
57
62
|
const props = child.props as ButtonProps
|
|
58
63
|
// The second action: iOS 26's glass capsule of the main one's size, Android's ghost button
|
|
59
64
|
const second =
|
|
60
|
-
index > 0 && props.variant === undefined
|
|
65
|
+
(index > 0 || secondary) && props.variant === undefined
|
|
61
66
|
? android
|
|
62
67
|
? { variant: "ghost" as const, color: props.color ?? ("secondary" as const) }
|
|
63
68
|
: { variant: "soft" as const, color: props.color ?? ("secondary" as const), mobileMaterial: props.mobileMaterial ?? ("glass" as const) }
|
|
@@ -275,6 +275,8 @@ export function BottomSheetBase({
|
|
|
275
275
|
const margin = theme.length("--mobile-layout-margin", 16)
|
|
276
276
|
// Android: content scrolled under the bar fades out under it; the footer's height sets the room under the content
|
|
277
277
|
const [scrolled, setScrolled] = useState(false)
|
|
278
|
+
// The Android bar's height: 69 with a title on one line, a line more when it wraps to a second
|
|
279
|
+
const [androidBarHeight, setAndroidBarHeight] = useState(ANDROID_BAR_HEIGHT)
|
|
278
280
|
const [footerHeight, setFooterHeight] = useState(0)
|
|
279
281
|
// Android's sheet has no handle: the whole sheet takes the drag. With a title its bar is the reference's sheet bar,
|
|
280
282
|
// over the content: Close in a 46dp glass circle 12 under the top edge and 12 from the side (in line with the
|
|
@@ -284,7 +286,7 @@ export function BottomSheetBase({
|
|
|
284
286
|
const barItem = useMemoBarItem(background)
|
|
285
287
|
const header = android ? (
|
|
286
288
|
title != null ? (
|
|
287
|
-
<View onStartShouldSetResponderCapture={gesture.chrome} style={styles.androidBar}>
|
|
289
|
+
<View onStartShouldSetResponderCapture={gesture.chrome} onLayout={(event) => setAndroidBarHeight(Math.max(ANDROID_BAR_HEIGHT, event.nativeEvent.layout.height))} style={styles.androidBar}>
|
|
288
290
|
<SheetBarFade fill={background} shown={scrolled} />
|
|
289
291
|
<View style={styles.androidCircle}>
|
|
290
292
|
{dismissible ? (
|
|
@@ -294,7 +296,7 @@ export function BottomSheetBase({
|
|
|
294
296
|
) : null}
|
|
295
297
|
</View>
|
|
296
298
|
<View style={styles.androidHeading}>
|
|
297
|
-
<Text nativeID={titleId} accessibilityRole="header" weight="medium" align="center" numberOfLines={
|
|
299
|
+
<Text nativeID={titleId} accessibilityRole="header" weight="medium" align="center" numberOfLines={2} color={m.onSurface} style={{ fontSize: titleType.fontSize, lineHeight: titleType.lineHeight }}>
|
|
298
300
|
{title}
|
|
299
301
|
</Text>
|
|
300
302
|
</View>
|
|
@@ -399,7 +401,8 @@ export function BottomSheetBase({
|
|
|
399
401
|
styles.androidContent,
|
|
400
402
|
// A screen whose gutter is Material's compact 16 sets it with --bottom-sheet-android-padding-inline
|
|
401
403
|
{ paddingHorizontal: androidInline },
|
|
402
|
-
|
|
404
|
+
// 2 under the bar: 71 under a one-line title
|
|
405
|
+
title != null ? { paddingTop: androidBarHeight + 2 } : null,
|
|
403
406
|
// Over a footer: 8 above its height, which reaches over the sheet's bottom padding
|
|
404
407
|
footer ? { paddingBottom: 8 + Math.max(0, footerHeight - insets.bottom - keyboard) } : null,
|
|
405
408
|
]
|
|
@@ -493,6 +496,9 @@ function SheetBarFade({ fill, shown }: { fill: string; shown: boolean }) {
|
|
|
493
496
|
*/
|
|
494
497
|
export const BottomSheet = Object.assign(BottomSheetRoot, { Footer: BottomSheetFooter })
|
|
495
498
|
|
|
499
|
+
/** An Android sheet's bar: Close's 46dp circle 12 under the top edge and 11 over the bar's end. */
|
|
500
|
+
const ANDROID_BAR_HEIGHT = 12 + 46 + 11
|
|
501
|
+
|
|
496
502
|
const styles = StyleSheet.create({
|
|
497
503
|
bottom: { flex: 1, justifyContent: "flex-end", alignItems: "center" },
|
|
498
504
|
sheet: { alignSelf: "stretch", overflow: "hidden", borderCurve: "continuous", marginHorizontal: "auto", width: "100%" },
|
|
@@ -511,7 +517,6 @@ const styles = StyleSheet.create({
|
|
|
511
517
|
// The content 12 from the sides (as a page's groups), 16 over the navigation bar; under a bar 13 under its circles
|
|
512
518
|
// (71 from the sheet's top, 2 under the bar)
|
|
513
519
|
androidContent: { paddingHorizontal: 12, paddingTop: 4, paddingBottom: 16 },
|
|
514
|
-
androidContentUnderBar: { paddingTop: 12 + 46 + 13 },
|
|
515
520
|
iosFooter: { gap: 10, paddingTop: 12 },
|
|
516
521
|
iosFooterEdge: { position: "absolute", top: -15, left: 0, right: 0, bottom: 0 },
|
|
517
522
|
// Android's sheet actions: 48dp buttons 4 apart, 12 from the sides and above, 12 over the gesture bar, over the
|
|
@@ -42,6 +42,11 @@ export type ButtonProps = Omit<PressableProps, "children" | "style"> & {
|
|
|
42
42
|
uniform?: boolean
|
|
43
43
|
/** Takes the whole width. */
|
|
44
44
|
block?: boolean
|
|
45
|
+
/**
|
|
46
|
+
* The most lines a text label takes before it ends in an ellipsis: 2 lets a long label ("Get 3 months for €35.99" in a
|
|
47
|
+
* longer language or at a large text size) wrap within the button, which grows from its height. @default 1
|
|
48
|
+
*/
|
|
49
|
+
labelLines?: number
|
|
45
50
|
selected?: boolean
|
|
46
51
|
loading?: boolean
|
|
47
52
|
disabled?: boolean
|
|
@@ -380,13 +385,19 @@ function Spinner({ color }: { color: string }) {
|
|
|
380
385
|
}
|
|
381
386
|
|
|
382
387
|
/** Strings and numbers in a row make one label ("Pressed {count}"); an element (an icon) stands on its own. */
|
|
383
|
-
function renderChildren(children: ReactNode, metrics: Metrics) {
|
|
388
|
+
function renderChildren(children: ReactNode, metrics: Metrics, lines = 1) {
|
|
384
389
|
const out: ReactNode[] = []
|
|
385
390
|
let label: (string | number)[] = []
|
|
386
391
|
const flush = () => {
|
|
387
392
|
if (!label.length) return
|
|
388
393
|
out.push(
|
|
389
|
-
<Text
|
|
394
|
+
<Text
|
|
395
|
+
key={`label-${out.length}`}
|
|
396
|
+
numberOfLines={lines}
|
|
397
|
+
weight={metrics.weight}
|
|
398
|
+
// A label on more lines than one shrinks to the button and centers its lines
|
|
399
|
+
style={[{ fontSize: metrics.fontSize, lineHeight: metrics.lineHeight }, lines > 1 ? styles.wraps : null]}
|
|
400
|
+
>
|
|
390
401
|
{label.join("")}
|
|
391
402
|
</Text>,
|
|
392
403
|
)
|
|
@@ -432,6 +443,7 @@ function ListActionButton({
|
|
|
432
443
|
disabled = false,
|
|
433
444
|
loading = false,
|
|
434
445
|
inert: inertProp = loading,
|
|
446
|
+
labelLines,
|
|
435
447
|
children,
|
|
436
448
|
style,
|
|
437
449
|
onPressIn,
|
|
@@ -470,7 +482,7 @@ function ListActionButton({
|
|
|
470
482
|
const trailingIcon = row && parts.length > 1 && isValidElement(parts[parts.length - 1])
|
|
471
483
|
const content = parts.map((part, index) =>
|
|
472
484
|
typeof part === "string" || typeof part === "number" ? (
|
|
473
|
-
<Text key={`label-${index}`} weight={android && !row ? "medium" : "regular"} numberOfLines={row ? undefined : 1} style={[type, trailingIcon && index < parts.length - 1 ? styles.grow : null]}>
|
|
485
|
+
<Text key={`label-${index}`} weight={android && !row ? "medium" : "regular"} numberOfLines={labelLines ?? (row ? undefined : 1)} style={[type, trailingIcon && index < parts.length - 1 ? styles.grow : null, labelLines != null && labelLines > 1 && !row ? styles.shrinks : null]}>
|
|
474
486
|
{part}
|
|
475
487
|
</Text>
|
|
476
488
|
) : (
|
|
@@ -524,6 +536,7 @@ function ButtonBody({
|
|
|
524
536
|
mobileMaterial,
|
|
525
537
|
uniform = false,
|
|
526
538
|
block = false,
|
|
539
|
+
labelLines = 1,
|
|
527
540
|
selected = false,
|
|
528
541
|
loading = false,
|
|
529
542
|
disabled = false,
|
|
@@ -732,7 +745,7 @@ function ButtonBody({
|
|
|
732
745
|
const content = (
|
|
733
746
|
<TextColorProvider value={ink}>
|
|
734
747
|
<IconDefaultsProvider size={metrics.iconSize} color={ink}>
|
|
735
|
-
<Animated.View style={[styles.row, android ? styles.fromTop : null, { gap: metrics.gap }, labelMotion]}>{renderChildren(children, metrics)}</Animated.View>
|
|
748
|
+
<Animated.View style={[styles.row, android ? styles.fromTop : null, labelLines > 1 ? styles.shrinks : null, { gap: metrics.gap }, labelMotion]}>{renderChildren(children, metrics, labelLines)}</Animated.View>
|
|
736
749
|
{spinner}
|
|
737
750
|
</IconDefaultsProvider>
|
|
738
751
|
</TextColorProvider>
|
|
@@ -780,4 +793,6 @@ const styles = StyleSheet.create({
|
|
|
780
793
|
row: { flexDirection: "row", alignItems: "center", justifyContent: "center" },
|
|
781
794
|
fromTop: { alignSelf: "stretch", transformOrigin: "top" },
|
|
782
795
|
grow: { flexGrow: 1, flexShrink: 1 },
|
|
796
|
+
wraps: { flexShrink: 1, minWidth: 0, textAlign: "center" },
|
|
797
|
+
shrinks: { flexShrink: 1, minWidth: 0, maxWidth: "100%" },
|
|
783
798
|
})
|