@plexui/react-native 0.2.7 → 0.2.9
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/dist/es/components/ActionSheet/ActionSheet.js +2 -1
- package/dist/es/components/Alert/Alert.js +2 -1
- package/dist/es/components/Avatar/Avatar.js +2 -1
- package/dist/es/components/Badge/Badge.js +2 -1
- package/dist/es/components/BottomActions/BottomActions.js +3 -3
- package/dist/es/components/BottomSheet/BottomSheet.js +2 -1
- package/dist/es/components/Button/Button.js +2 -1
- package/dist/es/components/Card/Card.js +2 -1
- package/dist/es/components/Checkbox/Checkbox.js +2 -1
- package/dist/es/components/Chip/Chip.js +2 -1
- package/dist/es/components/DatePicker/Calendar.js +2 -1
- package/dist/es/components/DatePicker/DatePicker.js +2 -1
- package/dist/es/components/DatePicker/TimeDial.js +2 -1
- package/dist/es/components/DatePicker/Wheel.js +2 -1
- package/dist/es/components/Dialog/Dialog.js +2 -1
- package/dist/es/components/Input/Input.js +2 -1
- package/dist/es/components/InputGroup/InputGroup.js +2 -1
- package/dist/es/components/IntroHeader/IntroHeader.js +32 -0
- package/dist/es/components/List/List.js +45 -18
- package/dist/es/components/Menu/Menu.js +2 -1
- package/dist/es/components/RadioGroup/RadioGroup.js +2 -1
- package/dist/es/components/SegmentedControl/SegmentedControl.js +52 -54
- package/dist/es/components/Select/Select.js +2 -1
- package/dist/es/components/Stepper/Stepper.js +2 -1
- package/dist/es/components/Switch/Switch.js +2 -1
- package/dist/es/components/TabBar/TabBar.js +2 -1
- package/dist/es/components/TagInput/TagInput.js +2 -1
- package/dist/es/components/Tip/Tip.js +2 -1
- package/dist/es/components/Toast/Toast.js +2 -1
- package/dist/es/index.js +1 -0
- package/dist/es/internal/Pressable.js +10 -0
- package/dist/es/theme/material.js +11 -2
- package/dist/types/components/BottomActions/BottomActions.d.ts +10 -1
- package/dist/types/components/IntroHeader/IntroHeader.d.ts +33 -0
- package/dist/types/components/List/List.d.ts +1 -1
- package/dist/types/components/SegmentedControl/SegmentedControl.d.ts +11 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/internal/Pressable.d.ts +3 -0
- package/package.json +2 -2
- package/src/components/ActionSheet/ActionSheet.tsx +2 -1
- package/src/components/Alert/Alert.tsx +2 -1
- package/src/components/Avatar/Avatar.tsx +2 -1
- package/src/components/Badge/Badge.tsx +2 -1
- package/src/components/BottomActions/BottomActions.tsx +14 -2
- package/src/components/BottomSheet/BottomSheet.tsx +2 -1
- package/src/components/Button/Button.tsx +2 -13
- package/src/components/Card/Card.tsx +2 -1
- package/src/components/Checkbox/Checkbox.tsx +2 -1
- package/src/components/Chip/Chip.tsx +2 -1
- package/src/components/DatePicker/Calendar.tsx +2 -1
- package/src/components/DatePicker/DatePicker.tsx +2 -1
- package/src/components/DatePicker/TimeDial.tsx +2 -1
- package/src/components/DatePicker/Wheel.tsx +2 -1
- package/src/components/Dialog/Dialog.tsx +2 -1
- package/src/components/Input/Input.tsx +2 -17
- package/src/components/InputGroup/InputGroup.tsx +2 -1
- package/src/components/IntroHeader/IntroHeader.tsx +79 -0
- package/src/components/List/List.tsx +55 -20
- package/src/components/Menu/Menu.tsx +2 -1
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +68 -48
- package/src/components/Select/Select.tsx +2 -1
- package/src/components/Stepper/Stepper.tsx +2 -1
- package/src/components/Switch/Switch.tsx +2 -1
- package/src/components/TabBar/TabBar.tsx +2 -13
- package/src/components/TagInput/TagInput.tsx +2 -1
- package/src/components/Tip/Tip.tsx +2 -1
- package/src/components/Toast/Toast.tsx +2 -1
- package/src/index.ts +2 -1
- package/src/internal/Pressable.tsx +17 -0
- package/src/theme/material.ts +9 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useEffect, useLayoutEffect, useState } from "react";
|
|
3
|
-
import { Platform,
|
|
3
|
+
import { Platform, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import Svg, { Path } from "react-native-svg";
|
|
5
6
|
import ChevronUpDown from "../../icons/plex/ChevronUpDown";
|
|
6
7
|
import { spaceToggles } from "../../internal/a11y";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
-
import { Animated, Platform,
|
|
3
|
+
import { Animated, Platform, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import Minus from "../../icons/plex/Minus";
|
|
5
6
|
import Plus from "../../icons/plex/Plus";
|
|
6
7
|
import RemoveTrash from "../../icons/plex/RemoveTrash";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useEffect, useState } from "react";
|
|
3
|
-
import { Animated, Easing,
|
|
3
|
+
import { Animated, Easing, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import { spaceToggles, useDescription } from "../../internal/a11y";
|
|
5
6
|
import { ControlLabel } from "../../internal/ControlLabel";
|
|
6
7
|
import { RowEndContext, RowHoldContext, rowHold } from "../../internal/row";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Animated, Easing,
|
|
3
|
+
import { Animated, Easing, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
6
|
import Search from "../../icons/plex/Search";
|
|
6
7
|
import { BarBackdrop, SoftBottomEdge, TabBarFade, ANDROID_FADE_ALPHA, ANDROID_FADE_STOPS, glassBarBlur, useAndroidGlass } from "../../internal/BarBackdrop";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { StyleSheet, TextInput, View } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import X from "../../icons/plex/X";
|
|
5
6
|
import { RowEndContext } from "../../internal/row";
|
|
6
7
|
import { dangerText, withAlpha } from "../../theme/material";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cloneElement, isValidElement, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { StyleSheet, View, useWindowDimensions } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import Svg, { Path } from "react-native-svg";
|
|
5
6
|
import X from "../../icons/plex/X";
|
|
6
7
|
import { flattenChildren, isRenderable, textOf } from "../../internal/children";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
3
|
-
import { AccessibilityInfo, Animated, Easing, PanResponder, PixelRatio, Platform,
|
|
3
|
+
import { AccessibilityInfo, Animated, Easing, PanResponder, PixelRatio, Platform, StyleSheet, View, useWindowDimensions } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
4
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
6
|
import CheckCircle from "../../icons/plex/CheckCircle";
|
|
6
7
|
import InfoCircle from "../../icons/plex/InfoCircle";
|
package/dist/es/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export { Toaster, toast } from "./components/Toast/Toast";
|
|
|
35
35
|
export { Avatar, AvatarGroup } from "./components/Avatar/Avatar";
|
|
36
36
|
export { Badge } from "./components/Badge/Badge";
|
|
37
37
|
export { BottomActions } from "./components/BottomActions/BottomActions";
|
|
38
|
+
export { IntroHeader } from "./components/IntroHeader/IntroHeader";
|
|
38
39
|
export { Card, cardColors } from "./components/Card/Card";
|
|
39
40
|
export { List, ListItem } from "./components/List/List";
|
|
40
41
|
export { Chip } from "./components/Chip/Chip";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Platform, Pressable as NativePressable } from "react-native";
|
|
4
|
+
// A press target takes no text selection on the web: a drag or a long press over a row, a button or a segment selects
|
|
5
|
+
// nothing, as on iOS and Android, where a control's label is never selectable
|
|
6
|
+
const NO_SELECT = Platform.OS === "web" ? { userSelect: "none" } : null;
|
|
7
|
+
/** react-native's Pressable that selects no text on the web; every pressable control of the kit is drawn with it. */
|
|
8
|
+
export const Pressable = forwardRef(function Pressable({ style, ...props }, ref) {
|
|
9
|
+
return (_jsx(NativePressable, { ref: ref, ...props, style: typeof style === "function" ? (state) => [NO_SELECT, style(state)] : [NO_SELECT, style] }));
|
|
10
|
+
});
|
|
@@ -224,12 +224,21 @@ export const elevationShadow = {
|
|
|
224
224
|
};
|
|
225
225
|
/** A color with its alpha multiplied: a state layer or a disabled container. */
|
|
226
226
|
export function withAlpha(color, alpha) {
|
|
227
|
-
// `#rrggbb(aa)`, `rgb()
|
|
227
|
+
// `#rgb(a)`, `#rrggbb(aa)`, `rgb()`, `rgba()`, `white` or `black`; any other form is returned as it is
|
|
228
228
|
const c = channels(color);
|
|
229
229
|
return c ? `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${Math.round(c[3] * alpha * 1000) / 1000})` : color;
|
|
230
230
|
}
|
|
231
|
-
/** The channels of a `#rrggbb(aa)
|
|
231
|
+
/** The channels of a `#rgb(a)`, `#rrggbb(aa)`, `rgb(a)()`, `white` or `black` color, alpha 0–1; undefined for any other form. */
|
|
232
232
|
function channels(color) {
|
|
233
|
+
// `#rgb(a)` reads as `#rrggbb(aa)`; `white` and `black`, the names a canvas is likeliest to be given
|
|
234
|
+
if (color === "white")
|
|
235
|
+
return [255, 255, 255, 1];
|
|
236
|
+
if (color === "black")
|
|
237
|
+
return [0, 0, 0, 1];
|
|
238
|
+
if (color.startsWith("#") && (color.length === 4 || color.length === 5)) {
|
|
239
|
+
const [r, g, b, a = "f"] = color.slice(1);
|
|
240
|
+
return [parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255];
|
|
241
|
+
}
|
|
233
242
|
if (color.startsWith("#") && (color.length === 7 || color.length === 9)) {
|
|
234
243
|
const a = color.length === 9 ? parseInt(color.slice(7, 9), 16) / 255 : 1;
|
|
235
244
|
return [parseInt(color.slice(1, 3), 16), parseInt(color.slice(3, 5), 16), parseInt(color.slice(5, 7), 16), a];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
/** What stands between floating actions and the content under them */
|
|
4
|
+
export type BottomActionsBackground = "soft" | "fade";
|
|
3
5
|
export type BottomActionsProps = {
|
|
4
6
|
/**
|
|
5
7
|
* The screen's main action, a Button, and an optional second Button under it ("Not now", "Skip"). A second Button
|
|
@@ -13,6 +15,13 @@ export type BottomActionsProps = {
|
|
|
13
15
|
* in. Off, they take their room at the end of the screen. @default false
|
|
14
16
|
*/
|
|
15
17
|
floating?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The edge under floating actions. `soft`: the screen's color in over 27pt above the actions, over a light blur.
|
|
20
|
+
* `fade`: TabBar's fade, the content running on under the actions, crisp: from the top action's top the screen's
|
|
21
|
+
* color comes in over 60pt to 85% and holds to the screen's edge; no blur. Android draws its soft edge for both, as
|
|
22
|
+
* TabBar does. @default "soft"
|
|
23
|
+
*/
|
|
24
|
+
background?: BottomActionsBackground;
|
|
16
25
|
/** The color the floating edge fades into: the screen's (a grouped screen's gray). @default the theme's background */
|
|
17
26
|
canvasColor?: string;
|
|
18
27
|
testID?: string;
|
|
@@ -25,4 +34,4 @@ export type BottomActionsProps = {
|
|
|
25
34
|
* action stands under it, 8 apart. Android: the Plex Android look's 48dp full-width button, 16dp from the sides and
|
|
26
35
|
* 16 above the gesture bar. Each Button inside is a block of the size `3xl` unless it sets its own.
|
|
27
36
|
*/
|
|
28
|
-
export declare function BottomActions({ children, floating, canvasColor, testID, style }: BottomActionsProps): import("react").JSX.Element;
|
|
37
|
+
export declare function BottomActions({ children, floating, background, canvasColor, testID, style }: BottomActionsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
export type IntroHeaderAlign = "cells" | "text";
|
|
4
|
+
export type IntroHeaderProps = {
|
|
5
|
+
/** The step's title: Title 2 bold on iOS (22/28), Headline Small on Android (24/32). Read as a header. */
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
/** An optional line or two under the title: Title 2 in the secondary label on iOS, Body Large on Android. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* An optional symbol or picture over the title, in the middle on iOS, at the start on Android. A kit icon takes
|
|
11
|
+
* the accent and 80pt on iOS (its drawing about 67), 40dp in the primary on Android, unless it sets its own.
|
|
12
|
+
*/
|
|
13
|
+
media?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* What the title and description line up with. `cells`: the column the content under them stands on, the edge of
|
|
16
|
+
* the fields, cards and buttons (a step with a field or a few rows, as Apple Account or Set Up eSIM); `text`: the text
|
|
17
|
+
* inside the cells, the row inset (20pt, 21dp) in, over a long grouped list (as Health's Choose the Medication Type).
|
|
18
|
+
* @default "cells"
|
|
19
|
+
*/
|
|
20
|
+
align?: IntroHeaderAlign;
|
|
21
|
+
testID?: string;
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The header of a step in a sheet or a setup flow: an optional symbol, the step's title and what it asks, as iOS 27's
|
|
26
|
+
* own steps set them (Apple Account, Add Email Address, Recovery Key, Pair Hearing Device, Set Up eSIM, Health's
|
|
27
|
+
* medication steps). Measured on a 430pt phone: the symbol's drawing about 70pt, in the middle, its bottom about 31pt
|
|
28
|
+
* over the title's line; the title in Title 2 bold and the description in Title 2 in the secondary label right under
|
|
29
|
+
* it, both at the start of the column. The header keeps no space round it: the screen sets it 24 under its bar and the
|
|
30
|
+
* content 24 under it. Android: the setup wizard's header, a 40dp symbol in the primary at the start 16 over a Headline
|
|
31
|
+
* Small title, the description in Body Large 16 under it in onSurfaceVariant.
|
|
32
|
+
*/
|
|
33
|
+
export declare function IntroHeader({ title, description, media, align, testID, style }: IntroHeaderProps): import("react").JSX.Element;
|
|
@@ -110,7 +110,7 @@ export type ListItemProps = {
|
|
|
110
110
|
testID?: string;
|
|
111
111
|
};
|
|
112
112
|
/**
|
|
113
|
-
* A row of a List: the label (17/22, `--field-row-*`: 52 tall,
|
|
113
|
+
* A row of a List: the label (17/22, `--field-row-*`: 52 tall, 62 with a description, 12 above and below the text at
|
|
114
114
|
* least) with a description, a leading symbol, a value (wrapping within 60% of the row, or under the label: `valuePlacement`) or a control, and the chevron
|
|
115
115
|
* of a drill-in (`Disclosure`, in the tertiary label, turned over right to left). A row with `checked` is a switch
|
|
116
116
|
* row. On Android a row of a settings screen: 50dp tall at least (64 with a description, its text 12 from the row's
|
|
@@ -34,6 +34,12 @@ export type SegmentedControlProps<T extends string> = {
|
|
|
34
34
|
* @default "equal"
|
|
35
35
|
*/
|
|
36
36
|
mobileSegmentWidth?: "equal" | "content";
|
|
37
|
+
/**
|
|
38
|
+
* Draws each tab's `badge`: a count in a small capsule after its label, as a messenger's folder tabs set their
|
|
39
|
+
* unread counts; each segment then takes its own width (`mobileSegmentWidth` content), 10 beside its label and
|
|
40
|
+
* count. Off, the count is only read with the segment's name, as the native controls draw none. @default false
|
|
41
|
+
*/
|
|
42
|
+
showBadges?: boolean;
|
|
37
43
|
style?: StyleProp<ViewStyle>;
|
|
38
44
|
testID?: string;
|
|
39
45
|
/** `SegmentedControl.Tab` elements. */
|
|
@@ -50,7 +56,10 @@ export type SegmentedControlOptionProps = {
|
|
|
50
56
|
children?: ReactNode;
|
|
51
57
|
/** A symbol before the label; with a label, iOS shows the symbol alone, as UISegmentedControl. */
|
|
52
58
|
icon?: ReactNode;
|
|
53
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* A count. Read with the segment's name; drawn only with the control's `showBadges`, as the native controls (iOS and
|
|
61
|
+
* Material alike) draw none.
|
|
62
|
+
*/
|
|
54
63
|
badge?: SegmentedControlBadgeProp;
|
|
55
64
|
disabled?: boolean;
|
|
56
65
|
testID?: string;
|
|
@@ -69,7 +78,7 @@ declare namespace SegmentedControlTab {
|
|
|
69
78
|
* iOS 26 apps (48pt; 40 in a Toolbar.Row), its thumb sliding to the selection; on Android a segmented capsule, white
|
|
70
79
|
* with a sliding pill of the accent. Props follow @plexui/ui (`SegmentedControl` and `SegmentedControl.Tab`).
|
|
71
80
|
*/
|
|
72
|
-
declare function SegmentedControlRoot<T extends string>({ value, onChange, onClick, "aria-label": ariaLabel, size, disabled, block, mobileMaterial, mobileSegmentWidth, style, testID, children, }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
81
|
+
declare function SegmentedControlRoot<T extends string>({ value, onChange, onClick, "aria-label": ariaLabel, size, disabled, block, mobileMaterial, mobileSegmentWidth, showBadges, style, testID, children, }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
73
82
|
declare namespace SegmentedControlRoot {
|
|
74
83
|
var displayName: string;
|
|
75
84
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -33,7 +33,8 @@ export { Dialog, type DialogAction, type DialogProps } from "./components/Dialog
|
|
|
33
33
|
export { Toaster, toast, type ToasterProps, type ToastId, type ToastOptions, type ToastT, type ToastType } from "./components/Toast/Toast";
|
|
34
34
|
export { Avatar, AvatarGroup, type AvatarColor, type AvatarGroupProps, type AvatarProps, type AvatarVariant } from "./components/Avatar/Avatar";
|
|
35
35
|
export { Badge, type BadgeColor, type BadgeProps, type BadgeSize, type BadgeVariant } from "./components/Badge/Badge";
|
|
36
|
-
export { BottomActions, type BottomActionsProps } from "./components/BottomActions/BottomActions";
|
|
36
|
+
export { BottomActions, type BottomActionsBackground, type BottomActionsProps } from "./components/BottomActions/BottomActions";
|
|
37
|
+
export { IntroHeader, type IntroHeaderAlign, type IntroHeaderProps } from "./components/IntroHeader/IntroHeader";
|
|
37
38
|
export { Card, cardColors, type CardColor, type CardMediaProps, type CardProps, type CardSize, type CardVariant } from "./components/Card/Card";
|
|
38
39
|
export { List, ListItem, type ListItemProps, type ListProps } from "./components/List/List";
|
|
39
40
|
export { Chip, type ChipProps } from "./components/Chip/Chip";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type PressableProps } from "react-native";
|
|
2
|
+
/** react-native's Pressable that selects no text on the web; every pressable control of the kit is drawn with it. */
|
|
3
|
+
export declare const Pressable: import("react").ForwardRefExoticComponent<PressableProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/react-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "Plex UI components for React Native and Expo: iOS 26 and Material 3, on the shared @plexui/styles tokens",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://plexui.com",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"test": "npm run typecheck && npm run lint && npm run test:web --prefix example"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@plexui/styles": "^0.17.
|
|
87
|
+
"@plexui/styles": "^0.17.4"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"expo-blur": ">=15",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useId, useRef, useState, type ReactNode, type RefObject } from "react"
|
|
2
|
-
import { Animated, Platform,
|
|
2
|
+
import { Animated, Platform, ScrollView, StyleSheet, View, useWindowDimensions } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
|
4
5
|
import { FloatingPanel } from "../../internal/FloatingPanel"
|
|
5
6
|
import { Glass } from "../../internal/Glass"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cloneElement, isValidElement, useState, type ReactElement, type ReactNode } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet, View, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import CheckCircle from "../../icons/plex/CheckCircle"
|
|
4
5
|
import InfoCircle from "../../icons/plex/InfoCircle"
|
|
5
6
|
import Warning from "../../icons/plex/Warning"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Children, isValidElement, useId, useState, type ComponentType, type ReactNode } from "react"
|
|
2
|
-
import { Animated, Easing, Platform,
|
|
2
|
+
import { Animated, Easing, Platform, StyleSheet, View, type ImageSourcePropType, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import Svg, { Circle, Defs, LinearGradient, Stop } from "react-native-svg"
|
|
4
5
|
import { useTheme } from "../../theme/ThemeProvider"
|
|
5
6
|
import type { Theme } from "../../theme/types"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef, useState, type ReactNode } from "react"
|
|
2
|
-
import { Animated,
|
|
2
|
+
import { Animated, StyleSheet, Text as NativeText, View, type LayoutChangeEvent, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import CloseBold from "../../icons/plex/CloseBold"
|
|
4
5
|
import { flattenChildren } from "../../internal/children"
|
|
5
6
|
import { curves } from "../../internal/motion"
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Children, cloneElement, isValidElement, type ReactElement, type ReactNode } from "react"
|
|
2
2
|
import { StyleSheet, View, type StyleProp, type ViewStyle } from "react-native"
|
|
3
3
|
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
|
4
|
-
import { ANDROID_FADE_ALPHA, ANDROID_FADE_STOPS, SoftBottomEdge } from "../../internal/BarBackdrop"
|
|
4
|
+
import { ANDROID_FADE_ALPHA, ANDROID_FADE_STOPS, SoftBottomEdge, TabBarFade } from "../../internal/BarBackdrop"
|
|
5
5
|
import { withAlpha } from "../../theme/material"
|
|
6
6
|
import { useTheme } from "../../theme/ThemeProvider"
|
|
7
7
|
import { Button, type ButtonProps } from "../Button/Button"
|
|
8
8
|
|
|
9
|
+
/** What stands between floating actions and the content under them */
|
|
10
|
+
export type BottomActionsBackground = "soft" | "fade"
|
|
11
|
+
|
|
9
12
|
export type BottomActionsProps = {
|
|
10
13
|
/**
|
|
11
14
|
* The screen's main action, a Button, and an optional second Button under it ("Not now", "Skip"). A second Button
|
|
@@ -19,6 +22,13 @@ export type BottomActionsProps = {
|
|
|
19
22
|
* in. Off, they take their room at the end of the screen. @default false
|
|
20
23
|
*/
|
|
21
24
|
floating?: boolean
|
|
25
|
+
/**
|
|
26
|
+
* The edge under floating actions. `soft`: the screen's color in over 27pt above the actions, over a light blur.
|
|
27
|
+
* `fade`: TabBar's fade, the content running on under the actions, crisp: from the top action's top the screen's
|
|
28
|
+
* color comes in over 60pt to 85% and holds to the screen's edge; no blur. Android draws its soft edge for both, as
|
|
29
|
+
* TabBar does. @default "soft"
|
|
30
|
+
*/
|
|
31
|
+
background?: BottomActionsBackground
|
|
22
32
|
/** The color the floating edge fades into: the screen's (a grouped screen's gray). @default the theme's background */
|
|
23
33
|
canvasColor?: string
|
|
24
34
|
testID?: string
|
|
@@ -32,7 +42,7 @@ export type BottomActionsProps = {
|
|
|
32
42
|
* action stands under it, 8 apart. Android: the Plex Android look's 48dp full-width button, 16dp from the sides and
|
|
33
43
|
* 16 above the gesture bar. Each Button inside is a block of the size `3xl` unless it sets its own.
|
|
34
44
|
*/
|
|
35
|
-
export function BottomActions({ children, floating = false, canvasColor, testID, style }: BottomActionsProps) {
|
|
45
|
+
export function BottomActions({ children, floating = false, background = "soft", canvasColor, testID, style }: BottomActionsProps) {
|
|
36
46
|
const theme = useTheme()
|
|
37
47
|
const insets = useSafeAreaInsets()
|
|
38
48
|
const android = theme.isAndroid
|
|
@@ -68,6 +78,8 @@ export function BottomActions({ children, floating = false, canvasColor, testID,
|
|
|
68
78
|
{floating ? (
|
|
69
79
|
android ? (
|
|
70
80
|
<SoftBottomEdge fill={withAlpha(canvas, ANDROID_FADE_ALPHA)} top={paddingTop - 13 + 60} tail={60} blur={0} stops={ANDROID_FADE_STOPS} />
|
|
81
|
+
) : background === "fade" ? (
|
|
82
|
+
<TabBarFade fill={canvas} top={paddingTop} />
|
|
71
83
|
) : (
|
|
72
84
|
<SoftBottomEdge fill={canvas} top={paddingTop} tail={27} blur={theme.length("--toolbar-edge-blur-small", 3)} />
|
|
73
85
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isValidElement, useId, useLayoutEffect, useMemo, useState, type ReactNode } from "react"
|
|
2
|
-
import { Animated, Easing, PanResponder, Platform,
|
|
2
|
+
import { Animated, Easing, PanResponder, Platform, ScrollView, StyleSheet, View, useWindowDimensions, type LayoutChangeEvent, type NativeScrollEvent, type NativeSyntheticEvent, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
|
4
5
|
import { childrenOfType, flattenChildren } from "../../internal/children"
|
|
5
6
|
import { useKeyboardHeight } from "../../internal/keyboard"
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { createContext, Fragment, isValidElement, useContext, useEffect, useState, type ComponentRef, type ReactNode, type Ref } from "react"
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Animated,
|
|
5
|
-
Easing,
|
|
6
|
-
Platform,
|
|
7
|
-
Pressable,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
View,
|
|
10
|
-
type GestureResponderEvent,
|
|
11
|
-
type PressableProps,
|
|
12
|
-
type StyleProp,
|
|
13
|
-
type ViewStyle,
|
|
14
|
-
} from "react-native"
|
|
2
|
+
import { ActivityIndicator, Animated, Easing, Platform, StyleSheet, View, type GestureResponderEvent, type PressableProps, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
15
4
|
import Svg, { Circle } from "react-native-svg"
|
|
16
5
|
import { flattenChildren } from "../../internal/children"
|
|
17
6
|
import { Glass } from "../../internal/Glass"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cloneElement, createContext, isValidElement, useContext, type ReactElement, type ReactNode } from "react"
|
|
2
|
-
import { Image, Platform,
|
|
2
|
+
import { Image, Platform, StyleSheet, View, type ImageSourcePropType, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { flattenChildren } from "../../internal/children"
|
|
4
5
|
import { space } from "../../internal/spacing"
|
|
5
6
|
import { controlHighlight, withAlpha } from "../../theme/material"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useContext, useEffect, useState, type ReactNode } from "react"
|
|
2
|
-
import { Animated, Easing,
|
|
2
|
+
import { Animated, Easing, StyleSheet, View, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import Svg, { Path } from "react-native-svg"
|
|
4
5
|
import CheckMd from "../../icons/plex/CheckMd"
|
|
5
6
|
import Minus from "../../icons/plex/Minus"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState, type ReactNode } from "react"
|
|
2
|
-
import { Animated, Easing, Platform,
|
|
2
|
+
import { Animated, Easing, Platform, StyleSheet, View, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import ChevronDownSm from "../../icons/plex/ChevronDownSm"
|
|
4
5
|
import CloseBold from "../../icons/plex/CloseBold"
|
|
5
6
|
import XCircleFilled from "../../icons/plex/XCircleFilled"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from "react"
|
|
2
|
-
import { Platform,
|
|
2
|
+
import { Platform, StyleSheet, View } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import ChevronLeftLg from "../../icons/plex/ChevronLeftLg"
|
|
4
5
|
import ChevronRightLg from "../../icons/plex/ChevronRightLg"
|
|
5
6
|
import { isRTL } from "../../internal/direction"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useContext, useEffect, useRef, useState, type ReactNode } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet, View, useWindowDimensions, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { RowEndContext, RowHoldContext, rowHold } from "../../internal/row"
|
|
4
5
|
import { withAlpha } from "../../theme/material"
|
|
5
6
|
import { useTheme } from "../../theme/ThemeProvider"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useRef, useState } from "react"
|
|
2
|
-
import { Platform,
|
|
2
|
+
import { Platform, StyleSheet, View, type GestureResponderEvent } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import Svg, { Circle, Line } from "react-native-svg"
|
|
4
5
|
import { useTheme } from "../../theme/ThemeProvider"
|
|
5
6
|
import { Text } from "../Text/Text"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react"
|
|
2
|
-
import { Animated, Platform,
|
|
2
|
+
import { Animated, Platform, ScrollView, StyleSheet, View, type NativeScrollEvent, type NativeSyntheticEvent } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { withAlpha } from "../../theme/material"
|
|
4
5
|
import { useTheme } from "../../theme/ThemeProvider"
|
|
5
6
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useId, useState, type ReactNode } from "react"
|
|
2
|
-
import { Animated, KeyboardAvoidingView, Platform,
|
|
2
|
+
import { Animated, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, View, useWindowDimensions } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
|
4
5
|
import { Glass } from "../../internal/Glass"
|
|
5
6
|
import { useRipple } from "../../internal/ripple"
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { createContext, useCallback, useContext, useEffect, useRef, useState, type ComponentRef, type ReactNode, type Ref } from "react"
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Easing,
|
|
5
|
-
PixelRatio,
|
|
6
|
-
Platform,
|
|
7
|
-
Pressable,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
Text as NativeText,
|
|
10
|
-
TextInput,
|
|
11
|
-
View,
|
|
12
|
-
processColor,
|
|
13
|
-
type PressableProps,
|
|
14
|
-
type StyleProp,
|
|
15
|
-
type TextInputProps,
|
|
16
|
-
type ViewProps,
|
|
17
|
-
type ViewStyle,
|
|
18
|
-
} from "react-native"
|
|
2
|
+
import { Animated, Easing, PixelRatio, Platform, StyleSheet, Text as NativeText, TextInput, View, processColor, type PressableProps, type StyleProp, type TextInputProps, type ViewProps, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
19
4
|
import XCircleFilled from "../../icons/plex/XCircleFilled"
|
|
20
5
|
import { useAndroidGlass } from "../../internal/BarBackdrop"
|
|
21
6
|
import { FieldStack, FloatLabelContext } from "../../internal/fieldStack"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createContext, isValidElement, useContext, type ReactElement, type ReactNode } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet, View, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
3
4
|
import { flattenChildren } from "../../internal/children"
|
|
4
5
|
import { RowEndContext } from "../../internal/row"
|
|
5
6
|
import { useTheme } from "../../theme/ThemeProvider"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ComponentRef, ReactNode } from "react"
|
|
2
|
+
import { Platform, StyleSheet, View, type StyleProp, type TextStyle, type ViewStyle } from "react-native"
|
|
3
|
+
import { useRTL } from "../../internal/direction"
|
|
4
|
+
import { useTheme } from "../../theme/ThemeProvider"
|
|
5
|
+
import { IconDefaultsProvider } from "../Icon/createIcon"
|
|
6
|
+
import { Text } from "../Text/Text"
|
|
7
|
+
|
|
8
|
+
export type IntroHeaderAlign = "cells" | "text"
|
|
9
|
+
|
|
10
|
+
export type IntroHeaderProps = {
|
|
11
|
+
/** The step's title: Title 2 bold on iOS (22/28), Headline Small on Android (24/32). Read as a header. */
|
|
12
|
+
title: ReactNode
|
|
13
|
+
/** An optional line or two under the title: Title 2 in the secondary label on iOS, Body Large on Android. */
|
|
14
|
+
description?: ReactNode
|
|
15
|
+
/**
|
|
16
|
+
* An optional symbol or picture over the title, in the middle on iOS, at the start on Android. A kit icon takes
|
|
17
|
+
* the accent and 80pt on iOS (its drawing about 67), 40dp in the primary on Android, unless it sets its own.
|
|
18
|
+
*/
|
|
19
|
+
media?: ReactNode
|
|
20
|
+
/**
|
|
21
|
+
* What the title and description line up with. `cells`: the column the content under them stands on, the edge of
|
|
22
|
+
* the fields, cards and buttons (a step with a field or a few rows, as Apple Account or Set Up eSIM); `text`: the text
|
|
23
|
+
* inside the cells, the row inset (20pt, 21dp) in, over a long grouped list (as Health's Choose the Medication Type).
|
|
24
|
+
* @default "cells"
|
|
25
|
+
*/
|
|
26
|
+
align?: IntroHeaderAlign
|
|
27
|
+
testID?: string
|
|
28
|
+
style?: StyleProp<ViewStyle>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The header of a step in a sheet or a setup flow: an optional symbol, the step's title and what it asks, as iOS 27's
|
|
33
|
+
* own steps set them (Apple Account, Add Email Address, Recovery Key, Pair Hearing Device, Set Up eSIM, Health's
|
|
34
|
+
* medication steps). Measured on a 430pt phone: the symbol's drawing about 70pt, in the middle, its bottom about 31pt
|
|
35
|
+
* over the title's line; the title in Title 2 bold and the description in Title 2 in the secondary label right under
|
|
36
|
+
* it, both at the start of the column. The header keeps no space round it: the screen sets it 24 under its bar and the
|
|
37
|
+
* content 24 under it. Android: the setup wizard's header, a 40dp symbol in the primary at the start 16 over a Headline
|
|
38
|
+
* Small title, the description in Body Large 16 under it in onSurfaceVariant.
|
|
39
|
+
*/
|
|
40
|
+
export function IntroHeader({ title, description, media, align = "cells", testID, style }: IntroHeaderProps) {
|
|
41
|
+
const theme = useTheme()
|
|
42
|
+
const android = theme.isAndroid
|
|
43
|
+
// On the rows' text: Android's list rows keep their text 21 in (List's ANDROID_INSET), iOS's the row inset
|
|
44
|
+
const inset = align === "text" ? (android ? 21 : theme.length("--list-row-inset", 20)) : 0
|
|
45
|
+
// The text at the start: React Native turns `left` to the right in a right-to-left layout on a phone, the web keeps
|
|
46
|
+
// it left, so there the side is read from the header's direction
|
|
47
|
+
const { ref, rtl } = useRTL<ComponentRef<typeof View>>()
|
|
48
|
+
const start: TextStyle = { textAlign: Platform.OS === "web" && rtl ? "right" : "left" }
|
|
49
|
+
return (
|
|
50
|
+
<View ref={ref} testID={testID} style={[{ paddingHorizontal: inset }, style]}>
|
|
51
|
+
{media != null ? (
|
|
52
|
+
<View
|
|
53
|
+
aria-hidden
|
|
54
|
+
accessibilityElementsHidden
|
|
55
|
+
importantForAccessibility="no-hide-descendants"
|
|
56
|
+
// A symbol's box keeps about 7 round its drawing at 80: 24 under the box is the drawing's 31 over the title
|
|
57
|
+
style={[styles.media, { alignSelf: android ? "flex-start" : "center", marginBottom: android ? 16 : 24 }]}
|
|
58
|
+
>
|
|
59
|
+
<IconDefaultsProvider size={android ? 40 : 80} color={android ? theme.material.primary : theme.colors.accent}>
|
|
60
|
+
{media}
|
|
61
|
+
</IconDefaultsProvider>
|
|
62
|
+
</View>
|
|
63
|
+
) : null}
|
|
64
|
+
<Text variant="title2" weight={android ? "regular" : "bold"} accessibilityRole="header" style={start}>
|
|
65
|
+
{title}
|
|
66
|
+
</Text>
|
|
67
|
+
{description != null ? (
|
|
68
|
+
<Text variant={android ? "body" : "title2"} color="secondary" style={[start, android ? styles.androidDescription : null]}>
|
|
69
|
+
{description}
|
|
70
|
+
</Text>
|
|
71
|
+
) : null}
|
|
72
|
+
</View>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
media: { alignItems: "center", justifyContent: "center" },
|
|
78
|
+
androidDescription: { marginTop: 16 },
|
|
79
|
+
})
|