@vvedantb/native-ui 0.17.2 → 0.18.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/dist/AlertDialog.jsx +123 -0
- package/dist/AmbientBackground.jsx +73 -0
- package/dist/ArtifactList.jsx +59 -0
- package/dist/Avatar.jsx +285 -0
- package/dist/Badge.jsx +154 -0
- package/dist/BottomSheetContainer.jsx +208 -0
- package/dist/BulkActionBar.jsx +717 -0
- package/dist/Button.jsx +344 -0
- package/dist/CaptureButton.jsx +104 -0
- package/dist/Card.jsx +371 -0
- package/dist/Checkbox.jsx +177 -0
- package/dist/Chip.jsx +79 -0
- package/dist/ColorSwatches.jsx +159 -0
- package/dist/ConfirmDialog.jsx +157 -0
- package/dist/DateTimeField.jsx +204 -0
- package/dist/Dialog.jsx +614 -0
- package/dist/DividedList.jsx +120 -0
- package/dist/DropdownMenu.jsx +849 -0
- package/dist/EmptyState.jsx +434 -0
- package/dist/ExpoWebRoot.jsx +134 -0
- package/dist/FloatingFAB.jsx +95 -0
- package/dist/FloatingSurface.jsx +226 -0
- package/dist/FloatingTabBar.jsx +403 -0
- package/dist/HeaderIconButton.jsx +53 -0
- package/dist/IconButton.jsx +157 -0
- package/dist/Input.jsx +96 -0
- package/dist/Label.jsx +96 -0
- package/dist/LabeledSwitchRow.jsx +170 -0
- package/dist/LiquidGlass.jsx +2 -0
- package/dist/ListRow.jsx +281 -0
- package/dist/LoadingState.jsx +205 -0
- package/dist/PageIndicator.jsx +128 -0
- package/dist/PageTitle.jsx +205 -0
- package/dist/Pager.jsx +105 -0
- package/dist/PasswordInput.jsx +120 -0
- package/dist/PillTabs.jsx +300 -0
- package/dist/PinnedBotTile.jsx +212 -0
- package/dist/Progress.jsx +147 -0
- package/dist/SafeAreaContainer.jsx +38 -0
- package/dist/ScreenContainer.jsx +117 -0
- package/dist/SearchInput.jsx +150 -0
- package/dist/SectionLabel.jsx +128 -0
- package/dist/Select.jsx +223 -0
- package/dist/Separator.jsx +95 -0
- package/dist/Sheet.jsx +343 -0
- package/dist/SheetRow.jsx +198 -0
- package/dist/Skeleton.jsx +311 -0
- package/dist/Spinner.jsx +195 -0
- package/dist/StackPageHeader.jsx +160 -0
- package/dist/StatGrid.jsx +74 -0
- package/dist/StatusDot.jsx +129 -0
- package/dist/SurfaceRow.jsx +143 -0
- package/dist/SwipeableRow.jsx +50 -0
- package/dist/Switch.jsx +130 -0
- package/dist/Tabs.jsx +385 -0
- package/dist/Textarea.jsx +103 -0
- package/dist/ThemeToggle.jsx +78 -0
- package/dist/Toast.jsx +396 -0
- package/dist/ai/activity-step-detail.jsx +179 -0
- package/dist/ai/activity-step-label.js +816 -0
- package/dist/ai/activity-step-types.js +14 -0
- package/dist/ai/activity-step.jsx +98 -0
- package/dist/ai/activity-tasks-utils.js +172 -0
- package/dist/ai/activity-timeline.js +47 -0
- package/dist/ai/attachments.jsx +258 -0
- package/dist/ai/card-button.jsx +188 -0
- package/dist/ai/chain-of-thought.jsx +459 -0
- package/dist/ai/chat-jump-rail.jsx +57 -0
- package/dist/ai/chat-text.js +44 -0
- package/dist/ai/chat-thread.jsx +135 -0
- package/dist/ai/choice-question.jsx +925 -0
- package/dist/ai/code-block.jsx +574 -0
- package/dist/ai/collapsible.jsx +275 -0
- package/dist/ai/conversation.jsx +723 -0
- package/dist/ai/file-chip.jsx +198 -0
- package/dist/ai/icon-button.jsx +179 -0
- package/dist/ai/index.js +37 -0
- package/dist/ai/message-action-sheet.jsx +408 -0
- package/dist/ai/message-quote.jsx +241 -0
- package/dist/ai/message.jsx +739 -0
- package/dist/ai/prompt-input-menu.jsx +365 -0
- package/dist/ai/prompt-input.jsx +626 -0
- package/dist/ai/reasoning.jsx +446 -0
- package/dist/ai/reply-quote-chip.jsx +278 -0
- package/dist/ai/response-text.jsx +130 -0
- package/dist/ai/shimmer.jsx +149 -0
- package/dist/ai/sources.jsx +260 -0
- package/dist/ai/subagent-cards.jsx +645 -0
- package/dist/ai/suggestion.jsx +186 -0
- package/dist/ai/tool-approval-card.jsx +359 -0
- package/dist/ai/trace.jsx +728 -0
- package/dist/ai/unified-diff.jsx +280 -0
- package/dist/ai/use-streaming-disclosure.js +70 -0
- package/dist/auth/AuthProviders.jsx +27 -0
- package/dist/auth/AuthScreen.jsx +292 -0
- package/dist/auth/GoogleSignInButton.jsx +188 -0
- package/dist/auth/SecondFactorScreen.jsx +133 -0
- package/dist/auth/SignInScreen.jsx +482 -0
- package/dist/auth/authErrors.js +131 -0
- package/dist/auth/index.js +11 -0
- package/dist/auth/totp.js +378 -0
- package/dist/blur.js +36 -0
- package/dist/brand/AppIcons.jsx +118 -0
- package/dist/brand/AppMark.jsx +128 -0
- package/dist/brand/AppWordmark.jsx +138 -0
- package/dist/brand/GoogleMark.jsx +71 -0
- package/dist/brand/ProviderIcon.jsx +192 -0
- package/dist/brand/familyApps.js +33 -0
- package/dist/brand/index.js +11 -0
- package/dist/brand/svg.js +252 -0
- package/dist/brand/vProAppBenefits.js +19 -0
- package/dist/cn.js +5 -0
- package/dist/colors.js +15 -0
- package/dist/configureTheme.js +72 -0
- package/dist/controlStyles.js +520 -0
- package/dist/definiteSize.js +12 -0
- package/dist/dialogLayout.js +18 -0
- package/dist/entries/ai.js +4 -0
- package/dist/entries/ambient.js +3 -0
- package/dist/entries/auth.js +5 -0
- package/dist/entries/bottom-sheet.js +2 -0
- package/dist/entries/brand.js +2 -0
- package/dist/entries/button.js +2 -0
- package/dist/entries/date-time.js +3 -0
- package/dist/entries/expo-router.js +4 -0
- package/dist/entries/expo-web-root.js +3 -0
- package/dist/entries/floating.js +7 -0
- package/dist/entries/gesture-handler.js +4 -0
- package/dist/entries/keyboard-controller.js +4 -0
- package/dist/entries/layout.js +16 -0
- package/dist/entries/markdown.js +4 -0
- package/dist/entries/marketing.js +3 -0
- package/dist/entries/page-title.js +7 -0
- package/dist/entries/password-input.js +3 -0
- package/dist/entries/primitives.js +57 -0
- package/dist/entries/search-input.js +3 -0
- package/dist/entries/tab-bar.js +4 -0
- package/dist/entries/theme.js +7 -0
- package/dist/entries/toast.js +5 -0
- package/dist/entries/video.js +3 -0
- package/dist/entries/webview.js +4 -0
- package/dist/examples/AiChatGallery.jsx +509 -0
- package/dist/examples/ParityGallery.jsx +1307 -0
- package/dist/floating.js +62 -0
- package/dist/glassBlur.jsx +145 -0
- package/dist/gradient.js +17 -0
- package/dist/haptics.js +44 -0
- package/dist/highlight.js +382 -0
- package/dist/index.js +85 -0
- package/dist/initials.js +4 -0
- package/dist/loadingGrid.js +81 -0
- package/dist/markdown/Markdown.jsx +515 -0
- package/dist/markdown/MarkdownTable.jsx +443 -0
- package/dist/markdown/tableText.js +68 -0
- package/dist/marketing/PricingModal.jsx +608 -0
- package/dist/marketing/UpgradeToProCard.jsx +164 -0
- package/dist/marketing/pricing.js +34 -0
- package/dist/media/ImageGallery.jsx +580 -0
- package/dist/media/MediaCard.jsx +162 -0
- package/dist/media/imageGrid.js +54 -0
- package/dist/motion.js +33 -0
- package/dist/pagerSwipe.js +104 -0
- package/dist/palette.js +104 -0
- package/dist/primitives/button.jsx +127 -0
- package/dist/primitives/card.jsx +249 -0
- package/dist/primitives/icon.jsx +37 -0
- package/dist/primitives/input.jsx +56 -0
- package/dist/primitives/keyboard-controller.jsx +207 -0
- package/dist/primitives/keyboard-parts.jsx +75 -0
- package/dist/primitives/native-only-animated-view.jsx +68 -0
- package/dist/primitives/overlay.jsx +391 -0
- package/dist/primitives/pager-gesture.jsx +131 -0
- package/dist/primitives/select-host.jsx +103 -0
- package/dist/primitives/select.jsx +555 -0
- package/dist/primitives/sheet-drag.jsx +420 -0
- package/dist/primitives/sheet-gesture.jsx +219 -0
- package/dist/primitives/swipe-row-gesture.jsx +341 -0
- package/dist/primitives/switch.jsx +105 -0
- package/dist/primitives/text.jsx +145 -0
- package/dist/primitives/toast-drag-gesture.jsx +94 -0
- package/dist/primitives/use-controllable-state.js +40 -0
- package/dist/primitives/web-click-guard.js +69 -0
- package/dist/push.js +166 -0
- package/dist/relativeTime.js +70 -0
- package/dist/router/RouterStackPageHeader.jsx +53 -0
- package/dist/selectA11y.js +32 -0
- package/dist/settings/MoreFromProjectV.jsx +168 -0
- package/dist/settings/SettingsEmptyState.jsx +102 -0
- package/dist/settings/SettingsField.jsx +49 -0
- package/dist/settings/SettingsSection.jsx +101 -0
- package/dist/settings/SettingsStack.jsx +17 -0
- package/dist/settings/SettingsToggleRow.jsx +163 -0
- package/dist/settings/projectVMobileApps.js +126 -0
- package/dist/settings/relaxedSizeStyle.js +11 -0
- package/dist/sheetDrag.js +76 -0
- package/dist/svgA11y.js +46 -0
- package/dist/swipeRow.js +161 -0
- package/dist/tabBarRoutes.js +41 -0
- package/dist/tabIndicator.js +139 -0
- package/dist/tailwind-preset.cjs +255 -0
- package/dist/tailwind-preset.d.cts +55 -0
- package/dist/theme.jsx +62 -0
- package/dist/toastChrome.js +110 -0
- package/dist/toastDrag.js +51 -0
- package/dist/toastStore.js +54 -0
- package/dist/tokens.js +70 -0
- package/dist/typography.js +40 -0
- package/dist/useReduceMotion.js +32 -0
- package/dist/useReduceTransparency.js +27 -0
- package/dist/useScheme.js +15 -0
- package/dist/video/InlineVideo.jsx +115 -0
- package/dist/webview/HtmlView.jsx +169 -0
- package/dist/webview/HtmlView.web.jsx +63 -0
- package/dist/webview/htmlView.js +43 -0
- package/package.json +70 -33
- package/src/DropdownMenu.tsx +28 -16
- package/src/FloatingTabBar.tsx +78 -41
- package/src/ai/conversation.tsx +12 -8
- package/src/glassBlur.tsx +47 -22
- package/src/primitives/swipe-row-gesture.tsx +11 -2
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { StyleSheet, View } from "react-native";
|
|
4
|
+
import Animated, { cancelAnimation, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from "react-native-reanimated";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { cn } from "./cn";
|
|
7
|
+
import { cardStyle } from "./controlStyles";
|
|
8
|
+
import { ListDivider } from "./DividedList";
|
|
9
|
+
import { useReduceMotion } from "./useReduceMotion";
|
|
10
|
+
import { useScheme } from "./useScheme";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Pulsing placeholder block. Holds still with Reduce Motion. Size it with
|
|
14
|
+
* `className` (for example `h-4 w-32`). The classes sit on a plain `View`:
|
|
15
|
+
* NativeWind does not style a Reanimated `Animated.View`, so only the pulse
|
|
16
|
+
* (opacity) is animated, on a fill inside.
|
|
17
|
+
*/
|
|
18
|
+
export function Skeleton(t0) {
|
|
19
|
+
const $ = _c(20);
|
|
20
|
+
let className;
|
|
21
|
+
let props;
|
|
22
|
+
let style;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({
|
|
25
|
+
className,
|
|
26
|
+
style,
|
|
27
|
+
...props
|
|
28
|
+
} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = className;
|
|
31
|
+
$[2] = props;
|
|
32
|
+
$[3] = style;
|
|
33
|
+
} else {
|
|
34
|
+
className = $[1];
|
|
35
|
+
props = $[2];
|
|
36
|
+
style = $[3];
|
|
37
|
+
}
|
|
38
|
+
const reduceMotion = useReduceMotion();
|
|
39
|
+
const opacity = useSharedValue(0.4);
|
|
40
|
+
let t1;
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[4] !== opacity || $[5] !== reduceMotion) {
|
|
43
|
+
t1 = () => {
|
|
44
|
+
if (reduceMotion) {
|
|
45
|
+
opacity.set(0.7);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
opacity.set(withRepeat(withTiming(1, {
|
|
49
|
+
duration: 800
|
|
50
|
+
}), -1, true));
|
|
51
|
+
return () => cancelAnimation(opacity);
|
|
52
|
+
};
|
|
53
|
+
t2 = [opacity, reduceMotion];
|
|
54
|
+
$[4] = opacity;
|
|
55
|
+
$[5] = reduceMotion;
|
|
56
|
+
$[6] = t1;
|
|
57
|
+
$[7] = t2;
|
|
58
|
+
} else {
|
|
59
|
+
t1 = $[6];
|
|
60
|
+
t2 = $[7];
|
|
61
|
+
}
|
|
62
|
+
useEffect(t1, t2);
|
|
63
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
64
|
+
opacity: opacity.get()
|
|
65
|
+
}));
|
|
66
|
+
let t3;
|
|
67
|
+
if ($[8] !== className) {
|
|
68
|
+
t3 = cn("overflow-hidden rounded-lg", className);
|
|
69
|
+
$[8] = className;
|
|
70
|
+
$[9] = t3;
|
|
71
|
+
} else {
|
|
72
|
+
t3 = $[9];
|
|
73
|
+
}
|
|
74
|
+
let t4;
|
|
75
|
+
if ($[10] !== animatedStyle) {
|
|
76
|
+
t4 = [StyleSheet.absoluteFill, animatedStyle];
|
|
77
|
+
$[10] = animatedStyle;
|
|
78
|
+
$[11] = t4;
|
|
79
|
+
} else {
|
|
80
|
+
t4 = $[11];
|
|
81
|
+
}
|
|
82
|
+
let t5;
|
|
83
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
84
|
+
t5 = <View className="flex-1 bg-neutral-200 dark:bg-neutral-700" />;
|
|
85
|
+
$[12] = t5;
|
|
86
|
+
} else {
|
|
87
|
+
t5 = $[12];
|
|
88
|
+
}
|
|
89
|
+
let t6;
|
|
90
|
+
if ($[13] !== t4) {
|
|
91
|
+
t6 = <Animated.View style={t4}>{t5}</Animated.View>;
|
|
92
|
+
$[13] = t4;
|
|
93
|
+
$[14] = t6;
|
|
94
|
+
} else {
|
|
95
|
+
t6 = $[14];
|
|
96
|
+
}
|
|
97
|
+
let t7;
|
|
98
|
+
if ($[15] !== props || $[16] !== style || $[17] !== t3 || $[18] !== t6) {
|
|
99
|
+
t7 = <View accessibilityElementsHidden={true} importantForAccessibility="no-hide-descendants" {...props} style={style} className={t3}>{t6}</View>;
|
|
100
|
+
$[15] = props;
|
|
101
|
+
$[16] = style;
|
|
102
|
+
$[17] = t3;
|
|
103
|
+
$[18] = t6;
|
|
104
|
+
$[19] = t7;
|
|
105
|
+
} else {
|
|
106
|
+
t7 = $[19];
|
|
107
|
+
}
|
|
108
|
+
return t7;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** A `Card`-shaped placeholder: the flat card fill and radius. */
|
|
112
|
+
export function CardSkeleton() {
|
|
113
|
+
const $ = _c(6);
|
|
114
|
+
const scheme = useScheme();
|
|
115
|
+
let t0;
|
|
116
|
+
if ($[0] !== scheme) {
|
|
117
|
+
t0 = cardStyle(scheme);
|
|
118
|
+
$[0] = scheme;
|
|
119
|
+
$[1] = t0;
|
|
120
|
+
} else {
|
|
121
|
+
t0 = $[1];
|
|
122
|
+
}
|
|
123
|
+
let t1;
|
|
124
|
+
let t2;
|
|
125
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t1 = <Skeleton className="h-4 w-32" />;
|
|
127
|
+
t2 = <Skeleton className="h-16 w-full" />;
|
|
128
|
+
$[2] = t1;
|
|
129
|
+
$[3] = t2;
|
|
130
|
+
} else {
|
|
131
|
+
t1 = $[2];
|
|
132
|
+
t2 = $[3];
|
|
133
|
+
}
|
|
134
|
+
let t3;
|
|
135
|
+
if ($[4] !== t0) {
|
|
136
|
+
t3 = <View className="gap-3 p-5" style={t0}>{t1}{t2}</View>;
|
|
137
|
+
$[4] = t0;
|
|
138
|
+
$[5] = t3;
|
|
139
|
+
} else {
|
|
140
|
+
t3 = $[5];
|
|
141
|
+
}
|
|
142
|
+
return t3;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Title widths, row by row, so a list of placeholders does not read as one block. */
|
|
146
|
+
const TITLE_WIDTHS = ["72%", "54%", "84%", "62%", "46%", "78%"];
|
|
147
|
+
/**
|
|
148
|
+
* A list row's placeholder, shaped like the row it stands for: a round mark,
|
|
149
|
+
* a title (and a detail line), and a short trailing block, on the `px-4` row
|
|
150
|
+
* padding. Pulses as `Skeleton`; holds still with Reduce Motion.
|
|
151
|
+
*/
|
|
152
|
+
export function SkeletonRow(t0) {
|
|
153
|
+
const $ = _c(21);
|
|
154
|
+
const {
|
|
155
|
+
index: t1,
|
|
156
|
+
leading,
|
|
157
|
+
lines: t2,
|
|
158
|
+
trailing: t3,
|
|
159
|
+
minHeight: t4,
|
|
160
|
+
className
|
|
161
|
+
} = t0;
|
|
162
|
+
const index = t1 === undefined ? 0 : t1;
|
|
163
|
+
const lines = t2 === undefined ? 1 : t2;
|
|
164
|
+
const trailing = t3 === undefined ? true : t3;
|
|
165
|
+
const minHeight = t4 === undefined ? 56 : t4;
|
|
166
|
+
let t5;
|
|
167
|
+
if ($[0] !== className) {
|
|
168
|
+
t5 = cn("flex-row items-center gap-3 px-4", className);
|
|
169
|
+
$[0] = className;
|
|
170
|
+
$[1] = t5;
|
|
171
|
+
} else {
|
|
172
|
+
t5 = $[1];
|
|
173
|
+
}
|
|
174
|
+
let t6;
|
|
175
|
+
if ($[2] !== minHeight) {
|
|
176
|
+
t6 = {
|
|
177
|
+
minHeight
|
|
178
|
+
};
|
|
179
|
+
$[2] = minHeight;
|
|
180
|
+
$[3] = t6;
|
|
181
|
+
} else {
|
|
182
|
+
t6 = $[3];
|
|
183
|
+
}
|
|
184
|
+
let t7;
|
|
185
|
+
if ($[4] !== leading) {
|
|
186
|
+
t7 = leading ? <Skeleton style={{
|
|
187
|
+
width: leading,
|
|
188
|
+
height: leading,
|
|
189
|
+
borderRadius: leading / 2
|
|
190
|
+
}} /> : null;
|
|
191
|
+
$[4] = leading;
|
|
192
|
+
$[5] = t7;
|
|
193
|
+
} else {
|
|
194
|
+
t7 = $[5];
|
|
195
|
+
}
|
|
196
|
+
const t8 = TITLE_WIDTHS[index % TITLE_WIDTHS.length];
|
|
197
|
+
let t9;
|
|
198
|
+
if ($[6] !== t8) {
|
|
199
|
+
t9 = <Skeleton className="h-3.5" style={{
|
|
200
|
+
width: t8
|
|
201
|
+
}} />;
|
|
202
|
+
$[6] = t8;
|
|
203
|
+
$[7] = t9;
|
|
204
|
+
} else {
|
|
205
|
+
t9 = $[7];
|
|
206
|
+
}
|
|
207
|
+
let t10;
|
|
208
|
+
if ($[8] !== lines) {
|
|
209
|
+
t10 = lines === 2 ? <Skeleton className="h-3 w-1/3" /> : null;
|
|
210
|
+
$[8] = lines;
|
|
211
|
+
$[9] = t10;
|
|
212
|
+
} else {
|
|
213
|
+
t10 = $[9];
|
|
214
|
+
}
|
|
215
|
+
let t11;
|
|
216
|
+
if ($[10] !== t10 || $[11] !== t9) {
|
|
217
|
+
t11 = <View className="min-w-0 flex-1 gap-2">{t9}{t10}</View>;
|
|
218
|
+
$[10] = t10;
|
|
219
|
+
$[11] = t9;
|
|
220
|
+
$[12] = t11;
|
|
221
|
+
} else {
|
|
222
|
+
t11 = $[12];
|
|
223
|
+
}
|
|
224
|
+
let t12;
|
|
225
|
+
if ($[13] !== trailing) {
|
|
226
|
+
t12 = trailing ? <Skeleton className="h-3 w-8" /> : null;
|
|
227
|
+
$[13] = trailing;
|
|
228
|
+
$[14] = t12;
|
|
229
|
+
} else {
|
|
230
|
+
t12 = $[14];
|
|
231
|
+
}
|
|
232
|
+
let t13;
|
|
233
|
+
if ($[15] !== t11 || $[16] !== t12 || $[17] !== t5 || $[18] !== t6 || $[19] !== t7) {
|
|
234
|
+
t13 = <View className={t5} style={t6}>{t7}{t11}{t12}</View>;
|
|
235
|
+
$[15] = t11;
|
|
236
|
+
$[16] = t12;
|
|
237
|
+
$[17] = t5;
|
|
238
|
+
$[18] = t6;
|
|
239
|
+
$[19] = t7;
|
|
240
|
+
$[20] = t13;
|
|
241
|
+
} else {
|
|
242
|
+
t13 = $[20];
|
|
243
|
+
}
|
|
244
|
+
return t13;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Placeholder rows where a list is loading, in place of a centred spinner:
|
|
248
|
+
* the screen keeps the shape it will have. Screen readers hear one busy
|
|
249
|
+
* element named `label`.
|
|
250
|
+
*/
|
|
251
|
+
export function SkeletonList(t0) {
|
|
252
|
+
const $ = _c(14);
|
|
253
|
+
const {
|
|
254
|
+
label,
|
|
255
|
+
count: t1,
|
|
256
|
+
divided: t2,
|
|
257
|
+
renderRow,
|
|
258
|
+
className
|
|
259
|
+
} = t0;
|
|
260
|
+
const count = t1 === undefined ? 6 : t1;
|
|
261
|
+
const divided = t2 === undefined ? true : t2;
|
|
262
|
+
let t3;
|
|
263
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
264
|
+
t3 = {
|
|
265
|
+
busy: true
|
|
266
|
+
};
|
|
267
|
+
$[0] = t3;
|
|
268
|
+
} else {
|
|
269
|
+
t3 = $[0];
|
|
270
|
+
}
|
|
271
|
+
let t4;
|
|
272
|
+
if ($[1] !== className) {
|
|
273
|
+
t4 = cn("min-h-0 w-full flex-1 overflow-hidden", className);
|
|
274
|
+
$[1] = className;
|
|
275
|
+
$[2] = t4;
|
|
276
|
+
} else {
|
|
277
|
+
t4 = $[2];
|
|
278
|
+
}
|
|
279
|
+
let t5;
|
|
280
|
+
if ($[3] !== count || $[4] !== divided || $[5] !== renderRow) {
|
|
281
|
+
let t6;
|
|
282
|
+
if ($[7] !== divided || $[8] !== renderRow) {
|
|
283
|
+
t6 = (_, index) => <Fragment key={index}>{divided && index > 0 ? <ListDivider /> : null}{renderRow(index)}</Fragment>;
|
|
284
|
+
$[7] = divided;
|
|
285
|
+
$[8] = renderRow;
|
|
286
|
+
$[9] = t6;
|
|
287
|
+
} else {
|
|
288
|
+
t6 = $[9];
|
|
289
|
+
}
|
|
290
|
+
t5 = Array.from({
|
|
291
|
+
length: count
|
|
292
|
+
}, t6);
|
|
293
|
+
$[3] = count;
|
|
294
|
+
$[4] = divided;
|
|
295
|
+
$[5] = renderRow;
|
|
296
|
+
$[6] = t5;
|
|
297
|
+
} else {
|
|
298
|
+
t5 = $[6];
|
|
299
|
+
}
|
|
300
|
+
let t6;
|
|
301
|
+
if ($[10] !== label || $[11] !== t4 || $[12] !== t5) {
|
|
302
|
+
t6 = <View accessible={true} accessibilityRole="progressbar" accessibilityLabel={label} accessibilityState={t3} className={t4}>{t5}</View>;
|
|
303
|
+
$[10] = label;
|
|
304
|
+
$[11] = t4;
|
|
305
|
+
$[12] = t5;
|
|
306
|
+
$[13] = t6;
|
|
307
|
+
} else {
|
|
308
|
+
t6 = $[13];
|
|
309
|
+
}
|
|
310
|
+
return t6;
|
|
311
|
+
}
|
package/dist/Spinner.jsx
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { ActivityIndicator, Platform, View } from "react-native";
|
|
3
|
+
import { cn } from "./cn";
|
|
4
|
+
import { tokens } from "./tokens";
|
|
5
|
+
import { useScheme } from "./useScheme";
|
|
6
|
+
/** The system `"small"` spinner box on iOS, Android and React Native Web. */
|
|
7
|
+
const SYSTEM_SMALL = 20;
|
|
8
|
+
/** Web `size-4`. No platform has a 16 spinner, so `sm` is the small one scaled down in a 16 box. */
|
|
9
|
+
const SM = 16;
|
|
10
|
+
function systemSize(size) {
|
|
11
|
+
if (typeof size === "number") {
|
|
12
|
+
return Platform.OS === "android" ? size : size >= 30 ? "large" : "small";
|
|
13
|
+
}
|
|
14
|
+
return size === "lg" ? "large" : "small";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The platform `ActivityIndicator` with the web `Spinner` size and tone names.
|
|
19
|
+
* The web `mark`, `circle` and `ring` variants (animated SVG strokes) are not ported.
|
|
20
|
+
*/
|
|
21
|
+
export function Spinner(t0) {
|
|
22
|
+
const $ = _c(28);
|
|
23
|
+
let accessibilityLabel;
|
|
24
|
+
let color;
|
|
25
|
+
let props;
|
|
26
|
+
let style;
|
|
27
|
+
let t1;
|
|
28
|
+
let t2;
|
|
29
|
+
let t3;
|
|
30
|
+
if ($[0] !== t0) {
|
|
31
|
+
({
|
|
32
|
+
size: t1,
|
|
33
|
+
tone: t2,
|
|
34
|
+
color,
|
|
35
|
+
decorative: t3,
|
|
36
|
+
accessibilityLabel,
|
|
37
|
+
style,
|
|
38
|
+
...props
|
|
39
|
+
} = t0);
|
|
40
|
+
$[0] = t0;
|
|
41
|
+
$[1] = accessibilityLabel;
|
|
42
|
+
$[2] = color;
|
|
43
|
+
$[3] = props;
|
|
44
|
+
$[4] = style;
|
|
45
|
+
$[5] = t1;
|
|
46
|
+
$[6] = t2;
|
|
47
|
+
$[7] = t3;
|
|
48
|
+
} else {
|
|
49
|
+
accessibilityLabel = $[1];
|
|
50
|
+
color = $[2];
|
|
51
|
+
props = $[3];
|
|
52
|
+
style = $[4];
|
|
53
|
+
t1 = $[5];
|
|
54
|
+
t2 = $[6];
|
|
55
|
+
t3 = $[7];
|
|
56
|
+
}
|
|
57
|
+
const size = t1 === undefined ? "md" : t1;
|
|
58
|
+
const tone = t2 === undefined ? "muted" : t2;
|
|
59
|
+
const decorative = t3 === undefined ? false : t3;
|
|
60
|
+
const scheme = useScheme();
|
|
61
|
+
const small = size === "sm";
|
|
62
|
+
let t4;
|
|
63
|
+
if ($[8] !== size) {
|
|
64
|
+
t4 = systemSize(size);
|
|
65
|
+
$[8] = size;
|
|
66
|
+
$[9] = t4;
|
|
67
|
+
} else {
|
|
68
|
+
t4 = $[9];
|
|
69
|
+
}
|
|
70
|
+
const t5 = color ?? (tone === "muted" ? tokens.color.muted[scheme] : tokens.color.foreground[scheme]);
|
|
71
|
+
const t6 = decorative ? "no-hide-descendants" : "auto";
|
|
72
|
+
const t7 = decorative ? undefined : "progressbar";
|
|
73
|
+
const t8 = decorative ? undefined : accessibilityLabel ?? "Loading";
|
|
74
|
+
let t9;
|
|
75
|
+
if ($[10] !== small || $[11] !== style) {
|
|
76
|
+
t9 = small ? {
|
|
77
|
+
transform: [{
|
|
78
|
+
scale: SM / SYSTEM_SMALL
|
|
79
|
+
}]
|
|
80
|
+
} : style;
|
|
81
|
+
$[10] = small;
|
|
82
|
+
$[11] = style;
|
|
83
|
+
$[12] = t9;
|
|
84
|
+
} else {
|
|
85
|
+
t9 = $[12];
|
|
86
|
+
}
|
|
87
|
+
let t10;
|
|
88
|
+
if ($[13] !== decorative || $[14] !== props || $[15] !== t4 || $[16] !== t5 || $[17] !== t6 || $[18] !== t7 || $[19] !== t8 || $[20] !== t9) {
|
|
89
|
+
t10 = <ActivityIndicator size={t4} color={t5} accessibilityElementsHidden={decorative} importantForAccessibility={t6} accessibilityRole={t7} accessibilityLabel={t8} style={t9} {...props} />;
|
|
90
|
+
$[13] = decorative;
|
|
91
|
+
$[14] = props;
|
|
92
|
+
$[15] = t4;
|
|
93
|
+
$[16] = t5;
|
|
94
|
+
$[17] = t6;
|
|
95
|
+
$[18] = t7;
|
|
96
|
+
$[19] = t8;
|
|
97
|
+
$[20] = t9;
|
|
98
|
+
$[21] = t10;
|
|
99
|
+
} else {
|
|
100
|
+
t10 = $[21];
|
|
101
|
+
}
|
|
102
|
+
const indicator = t10;
|
|
103
|
+
if (!small) {
|
|
104
|
+
return indicator;
|
|
105
|
+
}
|
|
106
|
+
let t11;
|
|
107
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
108
|
+
t11 = {
|
|
109
|
+
width: SM,
|
|
110
|
+
height: SM,
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center"
|
|
113
|
+
};
|
|
114
|
+
$[22] = t11;
|
|
115
|
+
} else {
|
|
116
|
+
t11 = $[22];
|
|
117
|
+
}
|
|
118
|
+
let t12;
|
|
119
|
+
if ($[23] !== style) {
|
|
120
|
+
t12 = [t11, style];
|
|
121
|
+
$[23] = style;
|
|
122
|
+
$[24] = t12;
|
|
123
|
+
} else {
|
|
124
|
+
t12 = $[24];
|
|
125
|
+
}
|
|
126
|
+
let t13;
|
|
127
|
+
if ($[25] !== indicator || $[26] !== t12) {
|
|
128
|
+
t13 = <View style={t12}>{indicator}</View>;
|
|
129
|
+
$[25] = indicator;
|
|
130
|
+
$[26] = t12;
|
|
131
|
+
$[27] = t13;
|
|
132
|
+
} else {
|
|
133
|
+
t13 = $[27];
|
|
134
|
+
}
|
|
135
|
+
return t13;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** A `Spinner` centred in whatever box it is given. `label` names it for assistive tech. */
|
|
139
|
+
export function CenteredSpinner(t0) {
|
|
140
|
+
const $ = _c(13);
|
|
141
|
+
let className;
|
|
142
|
+
let label;
|
|
143
|
+
let props;
|
|
144
|
+
if ($[0] !== t0) {
|
|
145
|
+
({
|
|
146
|
+
label,
|
|
147
|
+
className,
|
|
148
|
+
...props
|
|
149
|
+
} = t0);
|
|
150
|
+
$[0] = t0;
|
|
151
|
+
$[1] = className;
|
|
152
|
+
$[2] = label;
|
|
153
|
+
$[3] = props;
|
|
154
|
+
} else {
|
|
155
|
+
className = $[1];
|
|
156
|
+
label = $[2];
|
|
157
|
+
props = $[3];
|
|
158
|
+
}
|
|
159
|
+
let t1;
|
|
160
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
161
|
+
t1 = {
|
|
162
|
+
busy: true
|
|
163
|
+
};
|
|
164
|
+
$[4] = t1;
|
|
165
|
+
} else {
|
|
166
|
+
t1 = $[4];
|
|
167
|
+
}
|
|
168
|
+
let t2;
|
|
169
|
+
if ($[5] !== className) {
|
|
170
|
+
t2 = cn("min-h-0 w-full flex-1 items-center justify-center p-6", className);
|
|
171
|
+
$[5] = className;
|
|
172
|
+
$[6] = t2;
|
|
173
|
+
} else {
|
|
174
|
+
t2 = $[6];
|
|
175
|
+
}
|
|
176
|
+
let t3;
|
|
177
|
+
if ($[7] !== label) {
|
|
178
|
+
t3 = <Spinner accessibilityLabel={label} />;
|
|
179
|
+
$[7] = label;
|
|
180
|
+
$[8] = t3;
|
|
181
|
+
} else {
|
|
182
|
+
t3 = $[8];
|
|
183
|
+
}
|
|
184
|
+
let t4;
|
|
185
|
+
if ($[9] !== props || $[10] !== t2 || $[11] !== t3) {
|
|
186
|
+
t4 = <View accessibilityState={t1} className={t2} {...props}>{t3}</View>;
|
|
187
|
+
$[9] = props;
|
|
188
|
+
$[10] = t2;
|
|
189
|
+
$[11] = t3;
|
|
190
|
+
$[12] = t4;
|
|
191
|
+
} else {
|
|
192
|
+
t4 = $[12];
|
|
193
|
+
}
|
|
194
|
+
return t4;
|
|
195
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
import { IconChevronLeft } from "@tabler/icons-react-native";
|
|
5
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
|
+
import { cn } from "./cn";
|
|
7
|
+
import { PAGE_HEADER_HEIGHT, sizeStyle, textStyle } from "./controlStyles";
|
|
8
|
+
import { HeaderIconButton } from "./HeaderIconButton";
|
|
9
|
+
import { PageTitle } from "./PageTitle";
|
|
10
|
+
import { useLargerText } from "./theme";
|
|
11
|
+
import { tokens } from "./tokens";
|
|
12
|
+
import { useScheme } from "./useScheme";
|
|
13
|
+
/**
|
|
14
|
+
* A stack screen header with no fill, for a screen over `AmbientBackground`:
|
|
15
|
+
* a back chevron `HeaderIconButton` at the start, `headerRight` at the end and
|
|
16
|
+
* a centred `PageTitle` (Instrument Sans 600 at 20 / 25) with an optional
|
|
17
|
+
* muted description. The two sides are the same width, the wider of the back
|
|
18
|
+
* button and `headerRight`, so the title stays centred on the screen and a
|
|
19
|
+
* long one is cut off before it reaches them. `centre` (0.12.0) replaces the
|
|
20
|
+
* `PageTitle` with custom content; `title` then names the header for
|
|
21
|
+
* VoiceOver and TalkBack. The row is at least 56 high
|
|
22
|
+
* below the top inset, as `PageHeader`, with the `px-4` screen padding.
|
|
23
|
+
*/
|
|
24
|
+
export function StackPageHeader(t0) {
|
|
25
|
+
const $ = _c(38);
|
|
26
|
+
const {
|
|
27
|
+
title,
|
|
28
|
+
centre,
|
|
29
|
+
description,
|
|
30
|
+
onBack,
|
|
31
|
+
backLabel: t1,
|
|
32
|
+
headerRight,
|
|
33
|
+
backTestID,
|
|
34
|
+
safeTop: t2,
|
|
35
|
+
testID,
|
|
36
|
+
className
|
|
37
|
+
} = t0;
|
|
38
|
+
const backLabel = t1 === undefined ? "Back" : t1;
|
|
39
|
+
const safeTop = t2 === undefined ? true : t2;
|
|
40
|
+
const insets = useSafeAreaInsets();
|
|
41
|
+
const scheme = useScheme();
|
|
42
|
+
const largerText = useLargerText();
|
|
43
|
+
const [rightWidth, setRightWidth] = useState(0);
|
|
44
|
+
const top = safeTop ? insets.top : 0;
|
|
45
|
+
const backWidth = onBack ? largerText ? 56 : 48 : 0;
|
|
46
|
+
const t3 = Math.max(backWidth, headerRight != null ? rightWidth : 0);
|
|
47
|
+
let t4;
|
|
48
|
+
if ($[0] !== t3) {
|
|
49
|
+
t4 = {
|
|
50
|
+
minWidth: t3
|
|
51
|
+
};
|
|
52
|
+
$[0] = t3;
|
|
53
|
+
$[1] = t4;
|
|
54
|
+
} else {
|
|
55
|
+
t4 = $[1];
|
|
56
|
+
}
|
|
57
|
+
const side = t4;
|
|
58
|
+
const descriptionSize = largerText ? "text-base" : "text-sm";
|
|
59
|
+
let t5;
|
|
60
|
+
if ($[2] !== className) {
|
|
61
|
+
t5 = cn("flex-row items-center gap-2 px-4", className);
|
|
62
|
+
$[2] = className;
|
|
63
|
+
$[3] = t5;
|
|
64
|
+
} else {
|
|
65
|
+
t5 = $[3];
|
|
66
|
+
}
|
|
67
|
+
const t6 = top + PAGE_HEADER_HEIGHT;
|
|
68
|
+
let t7;
|
|
69
|
+
if ($[4] !== t6 || $[5] !== top) {
|
|
70
|
+
t7 = {
|
|
71
|
+
paddingTop: top,
|
|
72
|
+
minHeight: t6
|
|
73
|
+
};
|
|
74
|
+
$[4] = t6;
|
|
75
|
+
$[5] = top;
|
|
76
|
+
$[6] = t7;
|
|
77
|
+
} else {
|
|
78
|
+
t7 = $[6];
|
|
79
|
+
}
|
|
80
|
+
let t8;
|
|
81
|
+
if ($[7] !== backLabel || $[8] !== backTestID || $[9] !== largerText || $[10] !== onBack || $[11] !== scheme) {
|
|
82
|
+
t8 = onBack ? <HeaderIconButton label={backLabel} testID={backTestID} onPress={onBack}><IconChevronLeft size={largerText ? 26 : 22} color={tokens.color.foreground[scheme]} /></HeaderIconButton> : null;
|
|
83
|
+
$[7] = backLabel;
|
|
84
|
+
$[8] = backTestID;
|
|
85
|
+
$[9] = largerText;
|
|
86
|
+
$[10] = onBack;
|
|
87
|
+
$[11] = scheme;
|
|
88
|
+
$[12] = t8;
|
|
89
|
+
} else {
|
|
90
|
+
t8 = $[12];
|
|
91
|
+
}
|
|
92
|
+
let t9;
|
|
93
|
+
if ($[13] !== side || $[14] !== t8) {
|
|
94
|
+
t9 = <View className="flex-1 flex-row items-center justify-start" style={side}>{t8}</View>;
|
|
95
|
+
$[13] = side;
|
|
96
|
+
$[14] = t8;
|
|
97
|
+
$[15] = t9;
|
|
98
|
+
} else {
|
|
99
|
+
t9 = $[15];
|
|
100
|
+
}
|
|
101
|
+
let t10;
|
|
102
|
+
if ($[16] !== centre || $[17] !== title) {
|
|
103
|
+
t10 = centre != null ? <View accessible={true} accessibilityRole="header" accessibilityLabel={title} className="min-w-0 max-w-full shrink flex-row items-center justify-center">{centre}</View> : <PageTitle className="text-center">{title}</PageTitle>;
|
|
104
|
+
$[16] = centre;
|
|
105
|
+
$[17] = title;
|
|
106
|
+
$[18] = t10;
|
|
107
|
+
} else {
|
|
108
|
+
t10 = $[18];
|
|
109
|
+
}
|
|
110
|
+
let t11;
|
|
111
|
+
if ($[19] !== description || $[20] !== descriptionSize || $[21] !== scheme) {
|
|
112
|
+
t11 = description ? <Text numberOfLines={2} className={cn("text-center font-instrument-sans", descriptionSize)} style={[textStyle("muted", scheme), sizeStyle(descriptionSize)]}>{description}</Text> : null;
|
|
113
|
+
$[19] = description;
|
|
114
|
+
$[20] = descriptionSize;
|
|
115
|
+
$[21] = scheme;
|
|
116
|
+
$[22] = t11;
|
|
117
|
+
} else {
|
|
118
|
+
t11 = $[22];
|
|
119
|
+
}
|
|
120
|
+
let t12;
|
|
121
|
+
if ($[23] !== t10 || $[24] !== t11) {
|
|
122
|
+
t12 = <View className="min-w-0 shrink items-center py-2">{t10}{t11}</View>;
|
|
123
|
+
$[23] = t10;
|
|
124
|
+
$[24] = t11;
|
|
125
|
+
$[25] = t12;
|
|
126
|
+
} else {
|
|
127
|
+
t12 = $[25];
|
|
128
|
+
}
|
|
129
|
+
let t13;
|
|
130
|
+
if ($[26] !== headerRight) {
|
|
131
|
+
t13 = headerRight != null ? <View className="flex-row items-center gap-2" onLayout={event => setRightWidth(event.nativeEvent.layout.width)}>{headerRight}</View> : null;
|
|
132
|
+
$[26] = headerRight;
|
|
133
|
+
$[27] = t13;
|
|
134
|
+
} else {
|
|
135
|
+
t13 = $[27];
|
|
136
|
+
}
|
|
137
|
+
let t14;
|
|
138
|
+
if ($[28] !== side || $[29] !== t13) {
|
|
139
|
+
t14 = <View className="flex-1 flex-row items-center justify-end" style={side}>{t13}</View>;
|
|
140
|
+
$[28] = side;
|
|
141
|
+
$[29] = t13;
|
|
142
|
+
$[30] = t14;
|
|
143
|
+
} else {
|
|
144
|
+
t14 = $[30];
|
|
145
|
+
}
|
|
146
|
+
let t15;
|
|
147
|
+
if ($[31] !== t12 || $[32] !== t14 || $[33] !== t5 || $[34] !== t7 || $[35] !== t9 || $[36] !== testID) {
|
|
148
|
+
t15 = <View testID={testID} className={t5} style={t7}>{t9}{t12}{t14}</View>;
|
|
149
|
+
$[31] = t12;
|
|
150
|
+
$[32] = t14;
|
|
151
|
+
$[33] = t5;
|
|
152
|
+
$[34] = t7;
|
|
153
|
+
$[35] = t9;
|
|
154
|
+
$[36] = testID;
|
|
155
|
+
$[37] = t15;
|
|
156
|
+
} else {
|
|
157
|
+
t15 = $[37];
|
|
158
|
+
}
|
|
159
|
+
return t15;
|
|
160
|
+
}
|