@vvedantb/native-ui 0.35.0 → 0.36.0
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 +16 -1
- package/dist/Button.jsx +9 -3
- package/dist/ExpoWebRoot.jsx +42 -21
- package/dist/Field.jsx +309 -0
- package/dist/FloatingTabBar.jsx +98 -94
- package/dist/ai/conversation.jsx +1 -1
- package/dist/blur.js +6 -0
- package/dist/controlStyles.js +24 -2
- package/dist/entries/primitives.js +1 -0
- package/dist/examples/ParityGallery.jsx +488 -475
- package/dist/glassBlur.jsx +1 -1
- package/dist/index.js +1 -0
- package/dist/primitives/window-layer.jsx +35 -28
- package/package.json +27 -3
- package/src/Button.tsx +10 -4
- package/src/DropdownMenu.tsx +11 -2
- package/src/ExpoWebRoot.tsx +18 -3
- package/src/Field.tsx +105 -0
- package/src/FloatingTabBar.tsx +17 -12
- package/src/Spinner.tsx +2 -2
- package/src/ai/conversation.tsx +1 -1
- package/src/ai/message.tsx +2 -2
- package/src/auth/AccountScreens.tsx +4 -4
- package/src/auth/SignInScreen.tsx +4 -4
- package/src/blur.ts +8 -0
- package/src/controlStyles.ts +29 -2
- package/src/entries/primitives.ts +2 -0
- package/src/examples/ParityGallery.tsx +22 -1
- package/src/glassBlur.tsx +5 -7
- package/src/index.ts +2 -0
- package/src/primitives/sheet-gesture.tsx +1 -2
- package/src/primitives/web-click-guard.ts +3 -3
- package/src/primitives/window-layer.tsx +8 -6
- package/src/tabBarRoutes.ts +4 -3
- package/src/webview/HtmlView.tsx +5 -2
package/README.md
CHANGED
|
@@ -373,7 +373,7 @@ configureTheme({ font: { regular: "Inter_400Regular", medium: "Inter_500Medium",
|
|
|
373
373
|
|
|
374
374
|
| Area | Exports |
|
|
375
375
|
| --- | --- |
|
|
376
|
-
| Actions and fields | `Button` (`default`/`primary`, `secondary`, `outline`, `destructive`, `ghost`, `link`, `tinted
|
|
376
|
+
| Actions and fields | `Button` (`default`/`primary`, `secondary`, `outline`, `destructive`, `ghost`, `link`, `tinted`, plus the `tertiary`/`danger`/`success`/`warning`/`flat` aliases; `sm`/`small`, `default`/`medium`, `lg`/`large`, `icon`; `shape` `pill`/`rounded` from 0.6.0), `IconButton` (0.5.0), `CaptureButton` (0.5.0), `Field` (with `FieldLabel`, `FieldControl`, `FieldDescription`, `FieldError`), `Input`, `SearchInput` (0.3.9), `PasswordInput` (0.11.0), `Textarea`, `Label`, `Select`, `Switch`, `Checkbox`, `LabeledSwitchRow`, `ColorSwatches` (0.5.0), `DateTimeField` (date-only, empty and clearable from 0.5.0) |
|
|
377
377
|
| Display | `Card` (+ `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter`; `onPress` from 0.5.0), `Badge`, `StatusDot` (`info` from 0.5.0), `Avatar` (+ `AvatarImage`, `AvatarFallback`, `initials()`), `Separator`, `Progress`, `Spinner`, `CenteredSpinner`, `Skeleton`, `EmptyState` (+ `EmptyState.Root` and parts), `ListRow` (`leading`, `titleEnd`, `control`, `onLongPress` from 0.5.0), `StatGrid` (0.5.0), `SectionLabel` (0.5.0), `Chip`, `Text` (0.5.0, `/primitives` only) |
|
|
378
378
|
| Navigation | `Tabs` (+ `TabsList`, `TabsTrigger` (`minHeight` from 0.14.0), `TabsContent`), `PillTabs`, `PageIndicator` (0.5.0), `FloatingTabBar`, `FloatingFAB`, `HeaderIconButton`, `ThemeToggle` (0.3.16), `StackPageHeader` (0.5.0) |
|
|
379
379
|
| Overlays | `Dialog`, `AlertDialog`, `ConfirmDialog`, `Sheet` (a `WindowLayer` from 0.29.0: in the app's window under `WindowLayerHost`, else an RN `Modal`; each with the web part names; a `SheetContent` or compact `DialogContent` drags down to close), `SheetRow` (0.5.0), `BottomSheetContainer` (`@swmansion/react-native-bottom-sheet`; optional `detents`), `DropdownMenu` (Unreleased; see below) |
|
|
@@ -384,6 +384,21 @@ configureTheme({ font: { regular: "Inter_400Regular", medium: "Inter_500Medium",
|
|
|
384
384
|
|
|
385
385
|
**Settings at web sizes (0.14.0).** `SettingsSection`, `SettingsToggleRow`, `SettingsField` and `SettingsEmptyState` take the web type: titles and labels `text-sm` (14 / 20; the section title semibold, the others medium), descriptions and help `text-xs leading-relaxed` (12 / 19.5; the section description `text-sm leading-relaxed`, 14 / 22.75). `SettingsToggleRow` steps up one size with larger text and has no minimum height; its control keeps the 44 target.
|
|
386
386
|
|
|
387
|
+
**`Button` aliases and `Field` (unreleased).** `variant` also accepts `tertiary` (= `ghost`), `danger` (= `destructive`), `success`, `warning` and `flat`, as the web `Button`. `tinted` stays as a legacy alias (the pink tint of `outline` before 0.3.0). `size` accepts `md` (= `default`/`medium`), and `Spinner` `size="default"` equals `md`. Roles: `primary`/`default` is the one main action, `secondary` an alternative, `tertiary`/`ghost` a dismissive action, `destructive`/`danger` a destructive action, `success` and `warning` show status, and `outline`, `link` and `flat` are visual.
|
|
388
|
+
|
|
389
|
+
`Field`, `FieldLabel`, `FieldControl`, `FieldDescription` and `FieldError` (root and `/primitives`) link a label to a control. `FieldLabel` sets `nativeID`; `FieldControl` sets `accessibilityLabelledBy` while a `FieldLabel` renders, and otherwise keeps the `accessibilityLabel` you pass (the fallback, and what iOS reads). A plain `Input` is unchanged. The `FieldError` in `@vvedantb/native-ui/auth` is a different component (it takes a `message` prop).
|
|
390
|
+
|
|
391
|
+
```tsx
|
|
392
|
+
<Field>
|
|
393
|
+
<FieldLabel>Email</FieldLabel>
|
|
394
|
+
<FieldControl placeholder="you@example.com" accessibilityLabel="Email" />
|
|
395
|
+
<FieldDescription>We never share it.</FieldDescription>
|
|
396
|
+
{error ? <FieldError>{error}</FieldError> : null}
|
|
397
|
+
</Field>
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Control styles are internal.** `buttonColors`, `fieldStyle`, `textStyle` and the other helpers in `src/controlStyles.ts` are not exported from any entry. Their names and return values can change in any release; build on the components instead.
|
|
401
|
+
|
|
387
402
|
**`Button` `shape` (0.6.0).** `Button` is a pill by default, as the web `Button` from `@vvedantb/ui` 0.31.0: `shape="pill"` is fully round (`tokens.radius.pill`, web `rounded-full`) for every variant and size, so `size="icon"` is a circle. `shape="rounded"` keeps the radius from before 0.6.0: 16 at every size (web `rounded-lg`). The web `rounded` is 14 (`rounded-md`) on `xs` and `icon-xs`; native has neither size. The radius is a style, so a `style` radius such as `style={{ borderRadius: 8 }}` wins over either shape; a `className` radius does not.
|
|
388
403
|
|
|
389
404
|
```tsx
|
package/dist/Button.jsx
CHANGED
|
@@ -14,7 +14,7 @@ import { useLargerText } from "./theme";
|
|
|
14
14
|
import { tokens } from "./tokens";
|
|
15
15
|
import { useScheme } from "./useScheme";
|
|
16
16
|
|
|
17
|
-
/** `sm`, `default` and `lg` are the web names for `small`, `medium` and `large`. `icon` is a square button. */
|
|
17
|
+
/** `sm`, `default` (or `md`) and `lg` are the web names for `small`, `medium` and `large`. `icon` is a square button. */
|
|
18
18
|
|
|
19
19
|
/** The web `shape`. `"pill"` (default) is fully round; `"rounded"` is radius 16, the look before 0.6.0. */
|
|
20
20
|
|
|
@@ -23,6 +23,7 @@ const SIZE_ALIAS = {
|
|
|
23
23
|
medium: "medium",
|
|
24
24
|
large: "large",
|
|
25
25
|
sm: "small",
|
|
26
|
+
md: "medium",
|
|
26
27
|
default: "medium",
|
|
27
28
|
lg: "large",
|
|
28
29
|
icon: "icon"
|
|
@@ -100,8 +101,8 @@ const RADIUS = {
|
|
|
100
101
|
rounded: tokens.radius.lg
|
|
101
102
|
};
|
|
102
103
|
|
|
103
|
-
// Colours come from `buttonColors` as styles, except `tinted
|
|
104
|
-
// the pink classes that `outline` used before 0.3.0.
|
|
104
|
+
// Colours come from `buttonColors` as styles, except `tinted` (a legacy
|
|
105
|
+
// alias), which keeps the pink classes that `outline` used before 0.3.0.
|
|
105
106
|
const VARIANT_CLASS = {
|
|
106
107
|
link: "h-auto border-0 px-0",
|
|
107
108
|
tinted: "border-0 bg-pink-50 dark:bg-pink-900/20"
|
|
@@ -117,6 +118,11 @@ const PRIMITIVE_VARIANT = {
|
|
|
117
118
|
secondary: "secondary",
|
|
118
119
|
destructive: "destructive",
|
|
119
120
|
ghost: "ghost",
|
|
121
|
+
tertiary: "ghost",
|
|
122
|
+
danger: "destructive",
|
|
123
|
+
success: "default",
|
|
124
|
+
warning: "default",
|
|
125
|
+
flat: "ghost",
|
|
120
126
|
link: "link",
|
|
121
127
|
tinted: "secondary"
|
|
122
128
|
};
|
package/dist/ExpoWebRoot.jsx
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as expoRouterHtml from "expo-router/html";
|
|
3
3
|
import { tokens } from "./tokens";
|
|
4
|
+
const {
|
|
5
|
+
ScrollViewStyleReset
|
|
6
|
+
} = expoRouterHtml;
|
|
7
|
+
|
|
8
|
+
// From Expo SDK 58 the static render no longer writes the page's CSS links and
|
|
9
|
+
// script tags into the HTML afterwards: it hands them to the root as nodes, and
|
|
10
|
+
// a root that leaves them out gives a blank page. Earlier SDKs have no such
|
|
11
|
+
// hook and still write the tags themselves.
|
|
12
|
+
|
|
13
|
+
const emptyDocument = {};
|
|
14
|
+
const useServerDocument = expoRouterHtml.useServerDocumentContext ?? (() => emptyDocument);
|
|
4
15
|
|
|
5
16
|
/** `"native"` stops pinch-zoom so the page acts like the app; `"accessible"` allows it (WCAG 1.4.4). Both cover the notch. */
|
|
6
17
|
|
|
@@ -39,7 +50,7 @@ html.dark body {
|
|
|
39
50
|
* Runs in Node during the static render, with no DOM.
|
|
40
51
|
*/
|
|
41
52
|
export function ExpoWebRoot(t0) {
|
|
42
|
-
const $ = _c(
|
|
53
|
+
const $ = _c(26);
|
|
43
54
|
const {
|
|
44
55
|
children,
|
|
45
56
|
lang: t1,
|
|
@@ -54,6 +65,12 @@ export function ExpoWebRoot(t0) {
|
|
|
54
65
|
const scrollReset = t3 === undefined ? true : t3;
|
|
55
66
|
const lightBackground = t4 === undefined ? tokens.color.background.light : t4;
|
|
56
67
|
const darkBackground = t5 === undefined ? tokens.color.background.dark : t5;
|
|
68
|
+
const {
|
|
69
|
+
htmlAttributes,
|
|
70
|
+
headNodes,
|
|
71
|
+
bodyAttributes,
|
|
72
|
+
bodyNodes
|
|
73
|
+
} = useServerDocument();
|
|
57
74
|
let t6;
|
|
58
75
|
let t7;
|
|
59
76
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -102,33 +119,37 @@ export function ExpoWebRoot(t0) {
|
|
|
102
119
|
t12 = $[10];
|
|
103
120
|
}
|
|
104
121
|
let t13;
|
|
105
|
-
if ($[11] !== head || $[12] !==
|
|
106
|
-
t13 = <head>{t6}{t7}{t9}{t10}{t12}{head}</head>;
|
|
122
|
+
if ($[11] !== head || $[12] !== headNodes || $[13] !== t10 || $[14] !== t12 || $[15] !== t9) {
|
|
123
|
+
t13 = <head>{t6}{t7}{t9}{t10}{t12}{head}{headNodes}</head>;
|
|
107
124
|
$[11] = head;
|
|
108
|
-
$[12] =
|
|
109
|
-
$[13] =
|
|
110
|
-
$[14] =
|
|
111
|
-
$[15] =
|
|
125
|
+
$[12] = headNodes;
|
|
126
|
+
$[13] = t10;
|
|
127
|
+
$[14] = t12;
|
|
128
|
+
$[15] = t9;
|
|
129
|
+
$[16] = t13;
|
|
112
130
|
} else {
|
|
113
|
-
t13 = $[
|
|
131
|
+
t13 = $[16];
|
|
114
132
|
}
|
|
115
133
|
let t14;
|
|
116
|
-
if ($[
|
|
117
|
-
t14 = <body>{children}</body>;
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
134
|
+
if ($[17] !== bodyAttributes || $[18] !== bodyNodes || $[19] !== children) {
|
|
135
|
+
t14 = <body {...bodyAttributes}>{children}{bodyNodes}</body>;
|
|
136
|
+
$[17] = bodyAttributes;
|
|
137
|
+
$[18] = bodyNodes;
|
|
138
|
+
$[19] = children;
|
|
139
|
+
$[20] = t14;
|
|
120
140
|
} else {
|
|
121
|
-
t14 = $[
|
|
141
|
+
t14 = $[20];
|
|
122
142
|
}
|
|
123
143
|
let t15;
|
|
124
|
-
if ($[
|
|
125
|
-
t15 = <html lang={lang}>{t13}{t14}</html>;
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
144
|
+
if ($[21] !== htmlAttributes || $[22] !== lang || $[23] !== t13 || $[24] !== t14) {
|
|
145
|
+
t15 = <html lang={lang} {...htmlAttributes}>{t13}{t14}</html>;
|
|
146
|
+
$[21] = htmlAttributes;
|
|
147
|
+
$[22] = lang;
|
|
148
|
+
$[23] = t13;
|
|
149
|
+
$[24] = t14;
|
|
150
|
+
$[25] = t15;
|
|
130
151
|
} else {
|
|
131
|
-
t15 = $[
|
|
152
|
+
t15 = $[25];
|
|
132
153
|
}
|
|
133
154
|
return t15;
|
|
134
155
|
}
|
package/dist/Field.jsx
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
import { cn } from "./cn";
|
|
5
|
+
import { Input } from "./Input";
|
|
6
|
+
import { Label } from "./Label";
|
|
7
|
+
import { sizeStyle, textStyle, typeStyle } from "./controlStyles";
|
|
8
|
+
import { palette } from "./palette";
|
|
9
|
+
import { useLargerText } from "./theme";
|
|
10
|
+
import { useScheme } from "./useScheme";
|
|
11
|
+
const FieldContext = React.createContext(null);
|
|
12
|
+
function useField(part) {
|
|
13
|
+
const value = React.useContext(FieldContext);
|
|
14
|
+
if (!value) {
|
|
15
|
+
throw new Error(`${part} must be used inside <Field>.`);
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A labelled control: a `gap-2` column. It generates the `nativeID` that
|
|
21
|
+
* `FieldLabel` sets and `FieldControl` points at with `accessibilityLabelledBy`.
|
|
22
|
+
* A plain `Input` does not need it.
|
|
23
|
+
*/
|
|
24
|
+
function Field(t0) {
|
|
25
|
+
const $ = _c(15);
|
|
26
|
+
let className;
|
|
27
|
+
let labelId;
|
|
28
|
+
let props;
|
|
29
|
+
if ($[0] !== t0) {
|
|
30
|
+
({
|
|
31
|
+
className,
|
|
32
|
+
labelId,
|
|
33
|
+
...props
|
|
34
|
+
} = t0);
|
|
35
|
+
$[0] = t0;
|
|
36
|
+
$[1] = className;
|
|
37
|
+
$[2] = labelId;
|
|
38
|
+
$[3] = props;
|
|
39
|
+
} else {
|
|
40
|
+
className = $[1];
|
|
41
|
+
labelId = $[2];
|
|
42
|
+
props = $[3];
|
|
43
|
+
}
|
|
44
|
+
const generated = React.useId();
|
|
45
|
+
const [hasLabel, setHasLabel] = React.useState(false);
|
|
46
|
+
const id = labelId ?? `field-${generated}-label`;
|
|
47
|
+
let t1;
|
|
48
|
+
if ($[4] !== hasLabel || $[5] !== id) {
|
|
49
|
+
t1 = {
|
|
50
|
+
labelId: id,
|
|
51
|
+
hasLabel,
|
|
52
|
+
setHasLabel
|
|
53
|
+
};
|
|
54
|
+
$[4] = hasLabel;
|
|
55
|
+
$[5] = id;
|
|
56
|
+
$[6] = t1;
|
|
57
|
+
} else {
|
|
58
|
+
t1 = $[6];
|
|
59
|
+
}
|
|
60
|
+
const context = t1;
|
|
61
|
+
let t2;
|
|
62
|
+
if ($[7] !== className) {
|
|
63
|
+
t2 = cn("gap-2", className);
|
|
64
|
+
$[7] = className;
|
|
65
|
+
$[8] = t2;
|
|
66
|
+
} else {
|
|
67
|
+
t2 = $[8];
|
|
68
|
+
}
|
|
69
|
+
let t3;
|
|
70
|
+
if ($[9] !== props || $[10] !== t2) {
|
|
71
|
+
t3 = <View className={t2} {...props} />;
|
|
72
|
+
$[9] = props;
|
|
73
|
+
$[10] = t2;
|
|
74
|
+
$[11] = t3;
|
|
75
|
+
} else {
|
|
76
|
+
t3 = $[11];
|
|
77
|
+
}
|
|
78
|
+
let t4;
|
|
79
|
+
if ($[12] !== context || $[13] !== t3) {
|
|
80
|
+
t4 = <FieldContext.Provider value={context}>{t3}</FieldContext.Provider>;
|
|
81
|
+
$[12] = context;
|
|
82
|
+
$[13] = t3;
|
|
83
|
+
$[14] = t4;
|
|
84
|
+
} else {
|
|
85
|
+
t4 = $[14];
|
|
86
|
+
}
|
|
87
|
+
return t4;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** `Label` with the `nativeID` of the nearest `Field`. */
|
|
91
|
+
function FieldLabel(props) {
|
|
92
|
+
const $ = _c(6);
|
|
93
|
+
const field = useField("FieldLabel");
|
|
94
|
+
const {
|
|
95
|
+
setHasLabel
|
|
96
|
+
} = field;
|
|
97
|
+
let t0;
|
|
98
|
+
let t1;
|
|
99
|
+
if ($[0] !== setHasLabel) {
|
|
100
|
+
t0 = () => {
|
|
101
|
+
setHasLabel(true);
|
|
102
|
+
return () => setHasLabel(false);
|
|
103
|
+
};
|
|
104
|
+
t1 = [setHasLabel];
|
|
105
|
+
$[0] = setHasLabel;
|
|
106
|
+
$[1] = t0;
|
|
107
|
+
$[2] = t1;
|
|
108
|
+
} else {
|
|
109
|
+
t0 = $[1];
|
|
110
|
+
t1 = $[2];
|
|
111
|
+
}
|
|
112
|
+
React.useLayoutEffect(t0, t1);
|
|
113
|
+
let t2;
|
|
114
|
+
if ($[3] !== field.labelId || $[4] !== props) {
|
|
115
|
+
t2 = <Label nativeID={field.labelId} {...props} />;
|
|
116
|
+
$[3] = field.labelId;
|
|
117
|
+
$[4] = props;
|
|
118
|
+
$[5] = t2;
|
|
119
|
+
} else {
|
|
120
|
+
t2 = $[5];
|
|
121
|
+
}
|
|
122
|
+
return t2;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* `Input` that names itself from the `FieldLabel` of the nearest `Field`
|
|
127
|
+
* (`accessibilityLabelledBy`, Android). With no `FieldLabel` rendered it
|
|
128
|
+
* keeps the `accessibilityLabel` you pass, which is the fallback on iOS too.
|
|
129
|
+
*/
|
|
130
|
+
function FieldControl(props) {
|
|
131
|
+
const $ = _c(6);
|
|
132
|
+
const field = useField("FieldControl");
|
|
133
|
+
let t0;
|
|
134
|
+
if ($[0] !== field.hasLabel || $[1] !== field.labelId) {
|
|
135
|
+
t0 = field.hasLabel ? {
|
|
136
|
+
accessibilityLabelledBy: field.labelId
|
|
137
|
+
} : null;
|
|
138
|
+
$[0] = field.hasLabel;
|
|
139
|
+
$[1] = field.labelId;
|
|
140
|
+
$[2] = t0;
|
|
141
|
+
} else {
|
|
142
|
+
t0 = $[2];
|
|
143
|
+
}
|
|
144
|
+
let t1;
|
|
145
|
+
if ($[3] !== props || $[4] !== t0) {
|
|
146
|
+
t1 = <Input {...props} {...t0} />;
|
|
147
|
+
$[3] = props;
|
|
148
|
+
$[4] = t0;
|
|
149
|
+
$[5] = t1;
|
|
150
|
+
} else {
|
|
151
|
+
t1 = $[5];
|
|
152
|
+
}
|
|
153
|
+
return t1;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Muted hint under the control. */
|
|
157
|
+
function FieldDescription(t0) {
|
|
158
|
+
const $ = _c(19);
|
|
159
|
+
let className;
|
|
160
|
+
let props;
|
|
161
|
+
let style;
|
|
162
|
+
if ($[0] !== t0) {
|
|
163
|
+
({
|
|
164
|
+
className,
|
|
165
|
+
style,
|
|
166
|
+
...props
|
|
167
|
+
} = t0);
|
|
168
|
+
$[0] = t0;
|
|
169
|
+
$[1] = className;
|
|
170
|
+
$[2] = props;
|
|
171
|
+
$[3] = style;
|
|
172
|
+
} else {
|
|
173
|
+
className = $[1];
|
|
174
|
+
props = $[2];
|
|
175
|
+
style = $[3];
|
|
176
|
+
}
|
|
177
|
+
useField("FieldDescription");
|
|
178
|
+
const scheme = useScheme();
|
|
179
|
+
const size = useLargerText() ? "text-base" : "text-sm";
|
|
180
|
+
let t1;
|
|
181
|
+
if ($[4] !== className || $[5] !== size) {
|
|
182
|
+
t1 = cn("font-instrument-sans", size, className);
|
|
183
|
+
$[4] = className;
|
|
184
|
+
$[5] = size;
|
|
185
|
+
$[6] = t1;
|
|
186
|
+
} else {
|
|
187
|
+
t1 = $[6];
|
|
188
|
+
}
|
|
189
|
+
let t2;
|
|
190
|
+
if ($[7] !== scheme) {
|
|
191
|
+
t2 = textStyle("muted", scheme);
|
|
192
|
+
$[7] = scheme;
|
|
193
|
+
$[8] = t2;
|
|
194
|
+
} else {
|
|
195
|
+
t2 = $[8];
|
|
196
|
+
}
|
|
197
|
+
let t3;
|
|
198
|
+
if ($[9] !== size) {
|
|
199
|
+
t3 = sizeStyle(size);
|
|
200
|
+
$[9] = size;
|
|
201
|
+
$[10] = t3;
|
|
202
|
+
} else {
|
|
203
|
+
t3 = $[10];
|
|
204
|
+
}
|
|
205
|
+
let t4;
|
|
206
|
+
if ($[11] !== style || $[12] !== t2 || $[13] !== t3) {
|
|
207
|
+
t4 = [t2, t3, style];
|
|
208
|
+
$[11] = style;
|
|
209
|
+
$[12] = t2;
|
|
210
|
+
$[13] = t3;
|
|
211
|
+
$[14] = t4;
|
|
212
|
+
} else {
|
|
213
|
+
t4 = $[14];
|
|
214
|
+
}
|
|
215
|
+
let t5;
|
|
216
|
+
if ($[15] !== props || $[16] !== t1 || $[17] !== t4) {
|
|
217
|
+
t5 = <Text className={t1} style={t4} {...props} />;
|
|
218
|
+
$[15] = props;
|
|
219
|
+
$[16] = t1;
|
|
220
|
+
$[17] = t4;
|
|
221
|
+
$[18] = t5;
|
|
222
|
+
} else {
|
|
223
|
+
t5 = $[18];
|
|
224
|
+
}
|
|
225
|
+
return t5;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** Error message under the control, read out when it appears. */
|
|
229
|
+
function FieldError(t0) {
|
|
230
|
+
const $ = _c(20);
|
|
231
|
+
let className;
|
|
232
|
+
let props;
|
|
233
|
+
let style;
|
|
234
|
+
if ($[0] !== t0) {
|
|
235
|
+
({
|
|
236
|
+
className,
|
|
237
|
+
style,
|
|
238
|
+
...props
|
|
239
|
+
} = t0);
|
|
240
|
+
$[0] = t0;
|
|
241
|
+
$[1] = className;
|
|
242
|
+
$[2] = props;
|
|
243
|
+
$[3] = style;
|
|
244
|
+
} else {
|
|
245
|
+
className = $[1];
|
|
246
|
+
props = $[2];
|
|
247
|
+
style = $[3];
|
|
248
|
+
}
|
|
249
|
+
useField("FieldError");
|
|
250
|
+
const scheme = useScheme();
|
|
251
|
+
const size = useLargerText() ? "text-base" : "text-sm";
|
|
252
|
+
let t1;
|
|
253
|
+
if ($[4] !== className || $[5] !== size) {
|
|
254
|
+
t1 = cn("font-instrument-sans-medium", size, className);
|
|
255
|
+
$[4] = className;
|
|
256
|
+
$[5] = size;
|
|
257
|
+
$[6] = t1;
|
|
258
|
+
} else {
|
|
259
|
+
t1 = $[6];
|
|
260
|
+
}
|
|
261
|
+
const t2 = palette.danger[scheme];
|
|
262
|
+
let t3;
|
|
263
|
+
if ($[7] !== t2) {
|
|
264
|
+
t3 = {
|
|
265
|
+
color: t2
|
|
266
|
+
};
|
|
267
|
+
$[7] = t2;
|
|
268
|
+
$[8] = t3;
|
|
269
|
+
} else {
|
|
270
|
+
t3 = $[8];
|
|
271
|
+
}
|
|
272
|
+
let t4;
|
|
273
|
+
if ($[9] !== size) {
|
|
274
|
+
t4 = sizeStyle(size);
|
|
275
|
+
$[9] = size;
|
|
276
|
+
$[10] = t4;
|
|
277
|
+
} else {
|
|
278
|
+
t4 = $[10];
|
|
279
|
+
}
|
|
280
|
+
let t5;
|
|
281
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
282
|
+
t5 = typeStyle("medium");
|
|
283
|
+
$[11] = t5;
|
|
284
|
+
} else {
|
|
285
|
+
t5 = $[11];
|
|
286
|
+
}
|
|
287
|
+
let t6;
|
|
288
|
+
if ($[12] !== style || $[13] !== t3 || $[14] !== t4) {
|
|
289
|
+
t6 = [t3, t4, t5, style];
|
|
290
|
+
$[12] = style;
|
|
291
|
+
$[13] = t3;
|
|
292
|
+
$[14] = t4;
|
|
293
|
+
$[15] = t6;
|
|
294
|
+
} else {
|
|
295
|
+
t6 = $[15];
|
|
296
|
+
}
|
|
297
|
+
let t7;
|
|
298
|
+
if ($[16] !== props || $[17] !== t1 || $[18] !== t6) {
|
|
299
|
+
t7 = <Text accessibilityLiveRegion="polite" accessibilityRole="alert" className={t1} style={t6} {...props} />;
|
|
300
|
+
$[16] = props;
|
|
301
|
+
$[17] = t1;
|
|
302
|
+
$[18] = t6;
|
|
303
|
+
$[19] = t7;
|
|
304
|
+
} else {
|
|
305
|
+
t7 = $[19];
|
|
306
|
+
}
|
|
307
|
+
return t7;
|
|
308
|
+
}
|
|
309
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldLabel };
|