@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
package/dist/Dialog.jsx
ADDED
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Text, View, useWindowDimensions } from "react-native";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
import { IconX } from "@tabler/icons-react-native";
|
|
5
|
+
import { FloatingSurface } from "./FloatingSurface";
|
|
6
|
+
import { cn } from "./cn";
|
|
7
|
+
import { isCompactOverlay, textStyle, typeStyle } from "./controlStyles";
|
|
8
|
+
import { DialogLayoutContext, useDialogLayout } from "./dialogLayout";
|
|
9
|
+
import { palette } from "./palette";
|
|
10
|
+
import { tokens } from "./tokens";
|
|
11
|
+
import { useLargerText } from "./theme";
|
|
12
|
+
import { useScheme } from "./useScheme";
|
|
13
|
+
import { SheetDragView, SheetScrollView } from "./primitives/sheet-drag";
|
|
14
|
+
import { OverlayClose, OverlayModal, OverlayRoot, OverlayTrigger } from "./primitives/overlay";
|
|
15
|
+
/** Holds the open state (controlled with `open` / `onOpenChange`, or `defaultOpen`). Renders no view. */
|
|
16
|
+
export function Dialog(props) {
|
|
17
|
+
const $ = _c(2);
|
|
18
|
+
let t0;
|
|
19
|
+
if ($[0] !== props) {
|
|
20
|
+
t0 = <OverlayRoot {...props} />;
|
|
21
|
+
$[0] = props;
|
|
22
|
+
$[1] = t0;
|
|
23
|
+
} else {
|
|
24
|
+
t0 = $[1];
|
|
25
|
+
}
|
|
26
|
+
return t0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Opens the dialog. `asChild` merges the press into its child, for example a `Button`. */
|
|
30
|
+
export function DialogTrigger(props) {
|
|
31
|
+
const $ = _c(2);
|
|
32
|
+
let t0;
|
|
33
|
+
if ($[0] !== props) {
|
|
34
|
+
t0 = <OverlayTrigger part="DialogTrigger" {...props} />;
|
|
35
|
+
$[0] = props;
|
|
36
|
+
$[1] = t0;
|
|
37
|
+
} else {
|
|
38
|
+
t0 = $[1];
|
|
39
|
+
}
|
|
40
|
+
return t0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Closes the dialog. `asChild` merges the press into its child. */
|
|
44
|
+
export function DialogClose(props) {
|
|
45
|
+
const $ = _c(2);
|
|
46
|
+
let t0;
|
|
47
|
+
if ($[0] !== props) {
|
|
48
|
+
t0 = <OverlayClose part="DialogClose" {...props} />;
|
|
49
|
+
$[0] = props;
|
|
50
|
+
$[1] = t0;
|
|
51
|
+
} else {
|
|
52
|
+
t0 = $[1];
|
|
53
|
+
}
|
|
54
|
+
return t0;
|
|
55
|
+
}
|
|
56
|
+
/** Web `rounded-t-2xl` (16) on the compact sheet. */
|
|
57
|
+
const SHEET_RADIUS = tokens.radius.lg;
|
|
58
|
+
|
|
59
|
+
/** The centred panel: at most 480 wide. */
|
|
60
|
+
const PANEL = {
|
|
61
|
+
width: "100%",
|
|
62
|
+
maxWidth: 480,
|
|
63
|
+
alignSelf: "center"
|
|
64
|
+
};
|
|
65
|
+
/** The compact sheet: its bottom corners sit below the screen edge, and it shrinks to the room, as `SheetContent`. */
|
|
66
|
+
const SHEET = {
|
|
67
|
+
marginBottom: -SHEET_RADIUS,
|
|
68
|
+
flexShrink: 1
|
|
69
|
+
};
|
|
70
|
+
const SHRINK = {
|
|
71
|
+
flexShrink: 1
|
|
72
|
+
};
|
|
73
|
+
const CENTRED = {
|
|
74
|
+
compact: false,
|
|
75
|
+
stacked: false
|
|
76
|
+
};
|
|
77
|
+
const COMPACT = {
|
|
78
|
+
compact: true,
|
|
79
|
+
stacked: false
|
|
80
|
+
};
|
|
81
|
+
const STACKED = {
|
|
82
|
+
compact: true,
|
|
83
|
+
stacked: true
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Centred panel in an RN `Modal`: opaque surface (card radius 24, floating
|
|
88
|
+
* shadow, no blur), at most 480 wide, padding 24 as on the web. Android back
|
|
89
|
+
* closes it.
|
|
90
|
+
*
|
|
91
|
+
* In a compact window (the web `COMPACT_OVERLAY_QUERY`, from the window size)
|
|
92
|
+
* it is the web phone bottom sheet: full width, top corners 16, a handle,
|
|
93
|
+
* `pt-3 px-6`, the bottom safe-area inset (at least 24) below, and it slides
|
|
94
|
+
* up on open and down on close unless Reduce Motion is on. Drag it down to
|
|
95
|
+
* close, as `SheetContent`
|
|
96
|
+
* (when `dismissible`). Its bottom corners sit below the screen edge,
|
|
97
|
+
* as `SheetContent`'s do. `DialogFooter` stacks its buttons there. Taller than
|
|
98
|
+
* the room, it shrinks to fit, so a `DialogBody` inside scrolls.
|
|
99
|
+
*/
|
|
100
|
+
export function DialogContent(t0) {
|
|
101
|
+
const $ = _c(52);
|
|
102
|
+
let children;
|
|
103
|
+
let className;
|
|
104
|
+
let onShow;
|
|
105
|
+
let props;
|
|
106
|
+
let style;
|
|
107
|
+
let t1;
|
|
108
|
+
let t2;
|
|
109
|
+
let t3;
|
|
110
|
+
if ($[0] !== t0) {
|
|
111
|
+
({
|
|
112
|
+
children,
|
|
113
|
+
className,
|
|
114
|
+
hideCloseButton: t1,
|
|
115
|
+
dismissible: t2,
|
|
116
|
+
viewportAware: t3,
|
|
117
|
+
onShow,
|
|
118
|
+
style,
|
|
119
|
+
...props
|
|
120
|
+
} = t0);
|
|
121
|
+
$[0] = t0;
|
|
122
|
+
$[1] = children;
|
|
123
|
+
$[2] = className;
|
|
124
|
+
$[3] = onShow;
|
|
125
|
+
$[4] = props;
|
|
126
|
+
$[5] = style;
|
|
127
|
+
$[6] = t1;
|
|
128
|
+
$[7] = t2;
|
|
129
|
+
$[8] = t3;
|
|
130
|
+
} else {
|
|
131
|
+
children = $[1];
|
|
132
|
+
className = $[2];
|
|
133
|
+
onShow = $[3];
|
|
134
|
+
props = $[4];
|
|
135
|
+
style = $[5];
|
|
136
|
+
t1 = $[6];
|
|
137
|
+
t2 = $[7];
|
|
138
|
+
t3 = $[8];
|
|
139
|
+
}
|
|
140
|
+
const hideCloseButton = t1 === undefined ? false : t1;
|
|
141
|
+
const dismissible = t2 === undefined ? true : t2;
|
|
142
|
+
const viewportAware = t3 === undefined ? true : t3;
|
|
143
|
+
const {
|
|
144
|
+
width,
|
|
145
|
+
height
|
|
146
|
+
} = useWindowDimensions();
|
|
147
|
+
const insets = useSafeAreaInsets();
|
|
148
|
+
let t4;
|
|
149
|
+
if ($[9] !== height || $[10] !== viewportAware || $[11] !== width) {
|
|
150
|
+
t4 = viewportAware && isCompactOverlay(width, height);
|
|
151
|
+
$[9] = height;
|
|
152
|
+
$[10] = viewportAware;
|
|
153
|
+
$[11] = width;
|
|
154
|
+
$[12] = t4;
|
|
155
|
+
} else {
|
|
156
|
+
t4 = $[12];
|
|
157
|
+
}
|
|
158
|
+
const compact = t4;
|
|
159
|
+
const t5 = compact ? COMPACT : CENTRED;
|
|
160
|
+
const t6 = compact ? "bottom" : "center";
|
|
161
|
+
const t7 = compact ? SHEET : PANEL;
|
|
162
|
+
const t8 = compact && dismissible;
|
|
163
|
+
const t9 = compact ? SHRINK : undefined;
|
|
164
|
+
const t10 = compact ? SHEET_RADIUS : tokens.radius.card;
|
|
165
|
+
const t11 = compact ? SHRINK : undefined;
|
|
166
|
+
const t12 = compact ? "gap-4 px-6 pt-3" : "gap-4 p-6";
|
|
167
|
+
let t13;
|
|
168
|
+
if ($[13] !== className || $[14] !== t12) {
|
|
169
|
+
t13 = cn(t12, className);
|
|
170
|
+
$[13] = className;
|
|
171
|
+
$[14] = t12;
|
|
172
|
+
$[15] = t13;
|
|
173
|
+
} else {
|
|
174
|
+
t13 = $[15];
|
|
175
|
+
}
|
|
176
|
+
let t14;
|
|
177
|
+
if ($[16] !== compact || $[17] !== insets) {
|
|
178
|
+
t14 = compact ? {
|
|
179
|
+
paddingBottom: Math.max(24, insets.bottom) + SHEET_RADIUS,
|
|
180
|
+
flexShrink: 1
|
|
181
|
+
} : null;
|
|
182
|
+
$[16] = compact;
|
|
183
|
+
$[17] = insets;
|
|
184
|
+
$[18] = t14;
|
|
185
|
+
} else {
|
|
186
|
+
t14 = $[18];
|
|
187
|
+
}
|
|
188
|
+
let t15;
|
|
189
|
+
if ($[19] !== style || $[20] !== t14) {
|
|
190
|
+
t15 = [t14, style];
|
|
191
|
+
$[19] = style;
|
|
192
|
+
$[20] = t14;
|
|
193
|
+
$[21] = t15;
|
|
194
|
+
} else {
|
|
195
|
+
t15 = $[21];
|
|
196
|
+
}
|
|
197
|
+
let t16;
|
|
198
|
+
if ($[22] !== compact) {
|
|
199
|
+
t16 = compact ? <DialogHandle /> : null;
|
|
200
|
+
$[22] = compact;
|
|
201
|
+
$[23] = t16;
|
|
202
|
+
} else {
|
|
203
|
+
t16 = $[23];
|
|
204
|
+
}
|
|
205
|
+
let t17;
|
|
206
|
+
if ($[24] !== children || $[25] !== props || $[26] !== t13 || $[27] !== t15 || $[28] !== t16) {
|
|
207
|
+
t17 = <View accessibilityViewIsModal={true} className={t13} {...props} style={t15}>{t16}{children}</View>;
|
|
208
|
+
$[24] = children;
|
|
209
|
+
$[25] = props;
|
|
210
|
+
$[26] = t13;
|
|
211
|
+
$[27] = t15;
|
|
212
|
+
$[28] = t16;
|
|
213
|
+
$[29] = t17;
|
|
214
|
+
} else {
|
|
215
|
+
t17 = $[29];
|
|
216
|
+
}
|
|
217
|
+
let t18;
|
|
218
|
+
if ($[30] !== hideCloseButton) {
|
|
219
|
+
t18 = hideCloseButton ? null : <DialogCloseButton />;
|
|
220
|
+
$[30] = hideCloseButton;
|
|
221
|
+
$[31] = t18;
|
|
222
|
+
} else {
|
|
223
|
+
t18 = $[31];
|
|
224
|
+
}
|
|
225
|
+
let t19;
|
|
226
|
+
if ($[32] !== t10 || $[33] !== t11 || $[34] !== t17 || $[35] !== t18) {
|
|
227
|
+
t19 = <FloatingSurface blur={false} radius={t10} style={t11}>{t17}{t18}</FloatingSurface>;
|
|
228
|
+
$[32] = t10;
|
|
229
|
+
$[33] = t11;
|
|
230
|
+
$[34] = t17;
|
|
231
|
+
$[35] = t18;
|
|
232
|
+
$[36] = t19;
|
|
233
|
+
} else {
|
|
234
|
+
t19 = $[36];
|
|
235
|
+
}
|
|
236
|
+
let t20;
|
|
237
|
+
if ($[37] !== t19 || $[38] !== t8 || $[39] !== t9) {
|
|
238
|
+
t20 = <SheetDragView enabled={t8} style={t9}>{t19}</SheetDragView>;
|
|
239
|
+
$[37] = t19;
|
|
240
|
+
$[38] = t8;
|
|
241
|
+
$[39] = t9;
|
|
242
|
+
$[40] = t20;
|
|
243
|
+
} else {
|
|
244
|
+
t20 = $[40];
|
|
245
|
+
}
|
|
246
|
+
let t21;
|
|
247
|
+
if ($[41] !== t20 || $[42] !== t7) {
|
|
248
|
+
t21 = <View style={t7}>{t20}</View>;
|
|
249
|
+
$[41] = t20;
|
|
250
|
+
$[42] = t7;
|
|
251
|
+
$[43] = t21;
|
|
252
|
+
} else {
|
|
253
|
+
t21 = $[43];
|
|
254
|
+
}
|
|
255
|
+
let t22;
|
|
256
|
+
if ($[44] !== dismissible || $[45] !== onShow || $[46] !== t21 || $[47] !== t6) {
|
|
257
|
+
t22 = <OverlayModal part="DialogContent" placement={t6} dismissible={dismissible} onShow={onShow}>{t21}</OverlayModal>;
|
|
258
|
+
$[44] = dismissible;
|
|
259
|
+
$[45] = onShow;
|
|
260
|
+
$[46] = t21;
|
|
261
|
+
$[47] = t6;
|
|
262
|
+
$[48] = t22;
|
|
263
|
+
} else {
|
|
264
|
+
t22 = $[48];
|
|
265
|
+
}
|
|
266
|
+
let t23;
|
|
267
|
+
if ($[49] !== t22 || $[50] !== t5) {
|
|
268
|
+
t23 = <DialogLayoutContext.Provider value={t5}>{t22}</DialogLayoutContext.Provider>;
|
|
269
|
+
$[49] = t22;
|
|
270
|
+
$[50] = t5;
|
|
271
|
+
$[51] = t23;
|
|
272
|
+
} else {
|
|
273
|
+
t23 = $[51];
|
|
274
|
+
}
|
|
275
|
+
return t23;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* The web compact handle: an `h-1 w-12` pill in `surface-tertiary`, in a
|
|
280
|
+
* 44-high row. The whole sheet drags (`SheetDragView`), the handle with it.
|
|
281
|
+
*/
|
|
282
|
+
function DialogHandle() {
|
|
283
|
+
const $ = _c(2);
|
|
284
|
+
const scheme = useScheme();
|
|
285
|
+
const t0 = palette.surfaceTertiary[scheme];
|
|
286
|
+
let t1;
|
|
287
|
+
if ($[0] !== t0) {
|
|
288
|
+
t1 = <View accessibilityElementsHidden={true} importantForAccessibility="no-hide-descendants" className="mb-1 min-h-11 items-center justify-center"><View className="h-1 w-12 rounded-full" style={{
|
|
289
|
+
backgroundColor: t0
|
|
290
|
+
}} /></View>;
|
|
291
|
+
$[0] = t0;
|
|
292
|
+
$[1] = t1;
|
|
293
|
+
} else {
|
|
294
|
+
t1 = $[1];
|
|
295
|
+
}
|
|
296
|
+
return t1;
|
|
297
|
+
}
|
|
298
|
+
function DialogCloseButton() {
|
|
299
|
+
const $ = _c(3);
|
|
300
|
+
const largerText = useLargerText();
|
|
301
|
+
const scheme = useScheme();
|
|
302
|
+
const t0 = largerText ? 26 : 16;
|
|
303
|
+
const t1 = tokens.color.muted[scheme];
|
|
304
|
+
let t2;
|
|
305
|
+
if ($[0] !== t0 || $[1] !== t1) {
|
|
306
|
+
t2 = <DialogClose testID="dialog-close" accessibilityLabel="Close" hitSlop={8} className="absolute right-2 top-2 h-11 w-11 items-center justify-center rounded-lg active:opacity-70"><IconX size={t0} color={t1} /></DialogClose>;
|
|
307
|
+
$[0] = t0;
|
|
308
|
+
$[1] = t1;
|
|
309
|
+
$[2] = t2;
|
|
310
|
+
} else {
|
|
311
|
+
t2 = $[2];
|
|
312
|
+
}
|
|
313
|
+
return t2;
|
|
314
|
+
}
|
|
315
|
+
export function DialogHeader(t0) {
|
|
316
|
+
const $ = _c(8);
|
|
317
|
+
let className;
|
|
318
|
+
let props;
|
|
319
|
+
if ($[0] !== t0) {
|
|
320
|
+
({
|
|
321
|
+
className,
|
|
322
|
+
...props
|
|
323
|
+
} = t0);
|
|
324
|
+
$[0] = t0;
|
|
325
|
+
$[1] = className;
|
|
326
|
+
$[2] = props;
|
|
327
|
+
} else {
|
|
328
|
+
className = $[1];
|
|
329
|
+
props = $[2];
|
|
330
|
+
}
|
|
331
|
+
let t1;
|
|
332
|
+
if ($[3] !== className) {
|
|
333
|
+
t1 = cn("gap-1.5 pr-10", className);
|
|
334
|
+
$[3] = className;
|
|
335
|
+
$[4] = t1;
|
|
336
|
+
} else {
|
|
337
|
+
t1 = $[4];
|
|
338
|
+
}
|
|
339
|
+
let t2;
|
|
340
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
341
|
+
t2 = <View className={t1} {...props} />;
|
|
342
|
+
$[5] = props;
|
|
343
|
+
$[6] = t1;
|
|
344
|
+
$[7] = t2;
|
|
345
|
+
} else {
|
|
346
|
+
t2 = $[7];
|
|
347
|
+
}
|
|
348
|
+
return t2;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Text colours are styles (`textStyle`), so they follow the colour scheme in
|
|
352
|
+
// apps whose `text-foreground` does not. Recolour with `style`, not `className`.
|
|
353
|
+
|
|
354
|
+
/** Web `text-lg font-semibold`. */
|
|
355
|
+
export function DialogTitle(t0) {
|
|
356
|
+
const $ = _c(17);
|
|
357
|
+
let className;
|
|
358
|
+
let props;
|
|
359
|
+
let style;
|
|
360
|
+
if ($[0] !== t0) {
|
|
361
|
+
({
|
|
362
|
+
className,
|
|
363
|
+
style,
|
|
364
|
+
...props
|
|
365
|
+
} = t0);
|
|
366
|
+
$[0] = t0;
|
|
367
|
+
$[1] = className;
|
|
368
|
+
$[2] = props;
|
|
369
|
+
$[3] = style;
|
|
370
|
+
} else {
|
|
371
|
+
className = $[1];
|
|
372
|
+
props = $[2];
|
|
373
|
+
style = $[3];
|
|
374
|
+
}
|
|
375
|
+
const largerText = useLargerText();
|
|
376
|
+
const scheme = useScheme();
|
|
377
|
+
const t1 = largerText ? "text-2xl" : "text-lg";
|
|
378
|
+
let t2;
|
|
379
|
+
if ($[4] !== className || $[5] !== t1) {
|
|
380
|
+
t2 = cn("font-instrument-sans-semibold", t1, className);
|
|
381
|
+
$[4] = className;
|
|
382
|
+
$[5] = t1;
|
|
383
|
+
$[6] = t2;
|
|
384
|
+
} else {
|
|
385
|
+
t2 = $[6];
|
|
386
|
+
}
|
|
387
|
+
let t3;
|
|
388
|
+
if ($[7] !== scheme) {
|
|
389
|
+
t3 = textStyle("foreground", scheme);
|
|
390
|
+
$[7] = scheme;
|
|
391
|
+
$[8] = t3;
|
|
392
|
+
} else {
|
|
393
|
+
t3 = $[8];
|
|
394
|
+
}
|
|
395
|
+
let t4;
|
|
396
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
397
|
+
t4 = typeStyle("semibold");
|
|
398
|
+
$[9] = t4;
|
|
399
|
+
} else {
|
|
400
|
+
t4 = $[9];
|
|
401
|
+
}
|
|
402
|
+
let t5;
|
|
403
|
+
if ($[10] !== style || $[11] !== t3) {
|
|
404
|
+
t5 = [t3, t4, style];
|
|
405
|
+
$[10] = style;
|
|
406
|
+
$[11] = t3;
|
|
407
|
+
$[12] = t5;
|
|
408
|
+
} else {
|
|
409
|
+
t5 = $[12];
|
|
410
|
+
}
|
|
411
|
+
let t6;
|
|
412
|
+
if ($[13] !== props || $[14] !== t2 || $[15] !== t5) {
|
|
413
|
+
t6 = <Text accessibilityRole="header" className={t2} style={t5} {...props} />;
|
|
414
|
+
$[13] = props;
|
|
415
|
+
$[14] = t2;
|
|
416
|
+
$[15] = t5;
|
|
417
|
+
$[16] = t6;
|
|
418
|
+
} else {
|
|
419
|
+
t6 = $[16];
|
|
420
|
+
}
|
|
421
|
+
return t6;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** Web `text-sm leading-relaxed`, in the web description colour (`palette.overlayMuted`). */
|
|
425
|
+
export function DialogDescription(t0) {
|
|
426
|
+
const $ = _c(16);
|
|
427
|
+
let className;
|
|
428
|
+
let props;
|
|
429
|
+
let style;
|
|
430
|
+
if ($[0] !== t0) {
|
|
431
|
+
({
|
|
432
|
+
className,
|
|
433
|
+
style,
|
|
434
|
+
...props
|
|
435
|
+
} = t0);
|
|
436
|
+
$[0] = t0;
|
|
437
|
+
$[1] = className;
|
|
438
|
+
$[2] = props;
|
|
439
|
+
$[3] = style;
|
|
440
|
+
} else {
|
|
441
|
+
className = $[1];
|
|
442
|
+
props = $[2];
|
|
443
|
+
style = $[3];
|
|
444
|
+
}
|
|
445
|
+
const largerText = useLargerText();
|
|
446
|
+
const scheme = useScheme();
|
|
447
|
+
const t1 = largerText ? "text-lg" : "text-sm";
|
|
448
|
+
let t2;
|
|
449
|
+
if ($[4] !== className || $[5] !== t1) {
|
|
450
|
+
t2 = cn("font-instrument-sans leading-relaxed", t1, className);
|
|
451
|
+
$[4] = className;
|
|
452
|
+
$[5] = t1;
|
|
453
|
+
$[6] = t2;
|
|
454
|
+
} else {
|
|
455
|
+
t2 = $[6];
|
|
456
|
+
}
|
|
457
|
+
let t3;
|
|
458
|
+
if ($[7] !== scheme) {
|
|
459
|
+
t3 = textStyle("overlayMuted", scheme);
|
|
460
|
+
$[7] = scheme;
|
|
461
|
+
$[8] = t3;
|
|
462
|
+
} else {
|
|
463
|
+
t3 = $[8];
|
|
464
|
+
}
|
|
465
|
+
let t4;
|
|
466
|
+
if ($[9] !== style || $[10] !== t3) {
|
|
467
|
+
t4 = [t3, style];
|
|
468
|
+
$[9] = style;
|
|
469
|
+
$[10] = t3;
|
|
470
|
+
$[11] = t4;
|
|
471
|
+
} else {
|
|
472
|
+
t4 = $[11];
|
|
473
|
+
}
|
|
474
|
+
let t5;
|
|
475
|
+
if ($[12] !== props || $[13] !== t2 || $[14] !== t4) {
|
|
476
|
+
t5 = <Text className={t2} style={t4} {...props} />;
|
|
477
|
+
$[12] = props;
|
|
478
|
+
$[13] = t2;
|
|
479
|
+
$[14] = t4;
|
|
480
|
+
$[15] = t5;
|
|
481
|
+
} else {
|
|
482
|
+
t5 = $[15];
|
|
483
|
+
}
|
|
484
|
+
return t5;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Scrolling body for long content. Height is capped at `maxHeight` (default
|
|
489
|
+
* 60% of the window). In a bottom sheet (`SheetScrollView`) dragging down
|
|
490
|
+
* scrolls it back first and moves the sheet only from the top, and it holds
|
|
491
|
+
* still while the sheet follows the finger.
|
|
492
|
+
*/
|
|
493
|
+
export function DialogBody(t0) {
|
|
494
|
+
const $ = _c(12);
|
|
495
|
+
let maxHeight;
|
|
496
|
+
let props;
|
|
497
|
+
let style;
|
|
498
|
+
if ($[0] !== t0) {
|
|
499
|
+
({
|
|
500
|
+
maxHeight,
|
|
501
|
+
style,
|
|
502
|
+
...props
|
|
503
|
+
} = t0);
|
|
504
|
+
$[0] = t0;
|
|
505
|
+
$[1] = maxHeight;
|
|
506
|
+
$[2] = props;
|
|
507
|
+
$[3] = style;
|
|
508
|
+
} else {
|
|
509
|
+
maxHeight = $[1];
|
|
510
|
+
props = $[2];
|
|
511
|
+
style = $[3];
|
|
512
|
+
}
|
|
513
|
+
const {
|
|
514
|
+
height
|
|
515
|
+
} = useWindowDimensions();
|
|
516
|
+
const t1 = maxHeight ?? height * 0.6;
|
|
517
|
+
let t2;
|
|
518
|
+
if ($[4] !== t1) {
|
|
519
|
+
t2 = {
|
|
520
|
+
maxHeight: t1
|
|
521
|
+
};
|
|
522
|
+
$[4] = t1;
|
|
523
|
+
$[5] = t2;
|
|
524
|
+
} else {
|
|
525
|
+
t2 = $[5];
|
|
526
|
+
}
|
|
527
|
+
let t3;
|
|
528
|
+
if ($[6] !== style || $[7] !== t2) {
|
|
529
|
+
t3 = [t2, style];
|
|
530
|
+
$[6] = style;
|
|
531
|
+
$[7] = t2;
|
|
532
|
+
$[8] = t3;
|
|
533
|
+
} else {
|
|
534
|
+
t3 = $[8];
|
|
535
|
+
}
|
|
536
|
+
let t4;
|
|
537
|
+
if ($[9] !== props || $[10] !== t3) {
|
|
538
|
+
t4 = <SheetScrollView bounces={false} keyboardShouldPersistTaps="handled" scrollEventThrottle={16} style={t3} {...props} />;
|
|
539
|
+
$[9] = props;
|
|
540
|
+
$[10] = t3;
|
|
541
|
+
$[11] = t4;
|
|
542
|
+
} else {
|
|
543
|
+
t4 = $[11];
|
|
544
|
+
}
|
|
545
|
+
return t4;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Buttons in a row at the end, as the web footer from `sm` up (Cancel, then
|
|
550
|
+
* Save). Give each `Button` `fullWidth={false}`; `AlertDialogAction` and
|
|
551
|
+
* `AlertDialogCancel` already do. Wraps when the labels do not fit.
|
|
552
|
+
*
|
|
553
|
+
* In the compact sheet it is the web phone footer: the buttons stack, the last
|
|
554
|
+
* child on top, each full width (whatever `fullWidth` says) and at least 44
|
|
555
|
+
* high.
|
|
556
|
+
*/
|
|
557
|
+
export function DialogFooter(t0) {
|
|
558
|
+
const $ = _c(13);
|
|
559
|
+
let className;
|
|
560
|
+
let props;
|
|
561
|
+
if ($[0] !== t0) {
|
|
562
|
+
({
|
|
563
|
+
className,
|
|
564
|
+
...props
|
|
565
|
+
} = t0);
|
|
566
|
+
$[0] = t0;
|
|
567
|
+
$[1] = className;
|
|
568
|
+
$[2] = props;
|
|
569
|
+
} else {
|
|
570
|
+
className = $[1];
|
|
571
|
+
props = $[2];
|
|
572
|
+
}
|
|
573
|
+
const {
|
|
574
|
+
compact
|
|
575
|
+
} = useDialogLayout();
|
|
576
|
+
if (compact) {
|
|
577
|
+
let t1;
|
|
578
|
+
if ($[3] !== className) {
|
|
579
|
+
t1 = cn("flex-col-reverse gap-2 pt-2", className);
|
|
580
|
+
$[3] = className;
|
|
581
|
+
$[4] = t1;
|
|
582
|
+
} else {
|
|
583
|
+
t1 = $[4];
|
|
584
|
+
}
|
|
585
|
+
let t2;
|
|
586
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
587
|
+
t2 = <DialogLayoutContext.Provider value={STACKED}><View className={t1} {...props} /></DialogLayoutContext.Provider>;
|
|
588
|
+
$[5] = props;
|
|
589
|
+
$[6] = t1;
|
|
590
|
+
$[7] = t2;
|
|
591
|
+
} else {
|
|
592
|
+
t2 = $[7];
|
|
593
|
+
}
|
|
594
|
+
return t2;
|
|
595
|
+
}
|
|
596
|
+
let t1;
|
|
597
|
+
if ($[8] !== className) {
|
|
598
|
+
t1 = cn("flex-row flex-wrap items-center justify-end gap-2", className);
|
|
599
|
+
$[8] = className;
|
|
600
|
+
$[9] = t1;
|
|
601
|
+
} else {
|
|
602
|
+
t1 = $[9];
|
|
603
|
+
}
|
|
604
|
+
let t2;
|
|
605
|
+
if ($[10] !== props || $[11] !== t1) {
|
|
606
|
+
t2 = <View className={t1} {...props} />;
|
|
607
|
+
$[10] = props;
|
|
608
|
+
$[11] = t1;
|
|
609
|
+
$[12] = t2;
|
|
610
|
+
} else {
|
|
611
|
+
t2 = $[12];
|
|
612
|
+
}
|
|
613
|
+
return t2;
|
|
614
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Children, Fragment, isValidElement } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { tokens } from "./tokens";
|
|
5
|
+
import { useScheme } from "./useScheme";
|
|
6
|
+
/**
|
|
7
|
+
* Flat rows with a hairline between each pair, as the web `divide-y
|
|
8
|
+
* divide-border` lists (Eva's inbox rows). Rows keep their own padding; the
|
|
9
|
+
* list draws no fill, radius or outer border. `null` children are skipped, so
|
|
10
|
+
* no divider is left hanging.
|
|
11
|
+
*/
|
|
12
|
+
export function DividedList(t0) {
|
|
13
|
+
const $ = _c(24);
|
|
14
|
+
let children;
|
|
15
|
+
let className;
|
|
16
|
+
let props;
|
|
17
|
+
let style;
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== t0) {
|
|
20
|
+
({
|
|
21
|
+
children,
|
|
22
|
+
inset: t1,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
...props
|
|
26
|
+
} = t0);
|
|
27
|
+
$[0] = t0;
|
|
28
|
+
$[1] = children;
|
|
29
|
+
$[2] = className;
|
|
30
|
+
$[3] = props;
|
|
31
|
+
$[4] = style;
|
|
32
|
+
$[5] = t1;
|
|
33
|
+
} else {
|
|
34
|
+
children = $[1];
|
|
35
|
+
className = $[2];
|
|
36
|
+
props = $[3];
|
|
37
|
+
style = $[4];
|
|
38
|
+
t1 = $[5];
|
|
39
|
+
}
|
|
40
|
+
const inset = t1 === undefined ? 0 : t1;
|
|
41
|
+
let T0;
|
|
42
|
+
let t2;
|
|
43
|
+
let t3;
|
|
44
|
+
let t4;
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[6] !== children || $[7] !== className || $[8] !== inset || $[9] !== props || $[10] !== style) {
|
|
47
|
+
const rows = Children.toArray(children).filter(isValidElement);
|
|
48
|
+
T0 = View;
|
|
49
|
+
t2 = className;
|
|
50
|
+
t3 = style;
|
|
51
|
+
t4 = props;
|
|
52
|
+
let t6;
|
|
53
|
+
if ($[16] !== inset) {
|
|
54
|
+
t6 = (row, index) => <Fragment key={row.key ?? index}>{index > 0 ? <ListDivider inset={inset} /> : null}{row}</Fragment>;
|
|
55
|
+
$[16] = inset;
|
|
56
|
+
$[17] = t6;
|
|
57
|
+
} else {
|
|
58
|
+
t6 = $[17];
|
|
59
|
+
}
|
|
60
|
+
t5 = rows.map(t6);
|
|
61
|
+
$[6] = children;
|
|
62
|
+
$[7] = className;
|
|
63
|
+
$[8] = inset;
|
|
64
|
+
$[9] = props;
|
|
65
|
+
$[10] = style;
|
|
66
|
+
$[11] = T0;
|
|
67
|
+
$[12] = t2;
|
|
68
|
+
$[13] = t3;
|
|
69
|
+
$[14] = t4;
|
|
70
|
+
$[15] = t5;
|
|
71
|
+
} else {
|
|
72
|
+
T0 = $[11];
|
|
73
|
+
t2 = $[12];
|
|
74
|
+
t3 = $[13];
|
|
75
|
+
t4 = $[14];
|
|
76
|
+
t5 = $[15];
|
|
77
|
+
}
|
|
78
|
+
let t6;
|
|
79
|
+
if ($[18] !== T0 || $[19] !== t2 || $[20] !== t3 || $[21] !== t4 || $[22] !== t5) {
|
|
80
|
+
t6 = <T0 className={t2} style={t3} {...t4}>{t5}</T0>;
|
|
81
|
+
$[18] = T0;
|
|
82
|
+
$[19] = t2;
|
|
83
|
+
$[20] = t3;
|
|
84
|
+
$[21] = t4;
|
|
85
|
+
$[22] = t5;
|
|
86
|
+
$[23] = t6;
|
|
87
|
+
} else {
|
|
88
|
+
t6 = $[23];
|
|
89
|
+
}
|
|
90
|
+
return t6;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The hairline `DividedList` draws between two rows (1 high, `border`
|
|
95
|
+
* colour), on its own: the `ItemSeparatorComponent` of a `FlatList` or
|
|
96
|
+
* `SectionList` whose rows should look like a `DividedList`.
|
|
97
|
+
*/
|
|
98
|
+
export function ListDivider(t0) {
|
|
99
|
+
const $ = _c(3);
|
|
100
|
+
const {
|
|
101
|
+
inset: t1
|
|
102
|
+
} = t0;
|
|
103
|
+
const inset = t1 === undefined ? 0 : t1;
|
|
104
|
+
const scheme = useScheme();
|
|
105
|
+
const t2 = tokens.color.border[scheme];
|
|
106
|
+
let t3;
|
|
107
|
+
if ($[0] !== inset || $[1] !== t2) {
|
|
108
|
+
t3 = <View accessible={false} style={{
|
|
109
|
+
height: 1,
|
|
110
|
+
marginLeft: inset,
|
|
111
|
+
backgroundColor: t2
|
|
112
|
+
}} />;
|
|
113
|
+
$[0] = inset;
|
|
114
|
+
$[1] = t2;
|
|
115
|
+
$[2] = t3;
|
|
116
|
+
} else {
|
|
117
|
+
t3 = $[2];
|
|
118
|
+
}
|
|
119
|
+
return t3;
|
|
120
|
+
}
|