@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,164 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Pressable, Text, View } from "react-native";
|
|
3
|
+
import { cn } from "../cn";
|
|
4
|
+
import { sizeStyle, textStyle, typeStyle } from "../controlStyles";
|
|
5
|
+
import { tokens } from "../tokens";
|
|
6
|
+
import { useLargerText } from "../theme";
|
|
7
|
+
import { useScheme } from "../useScheme";
|
|
8
|
+
|
|
9
|
+
/** Web `rounded-2xl` (16) on the card. */
|
|
10
|
+
const RADIUS = tokens.radius.lg;
|
|
11
|
+
|
|
12
|
+
// The web `Button` `sm` (`h-8 px-3 text-xs`) uses `max-sm:hit-target`, 8 on
|
|
13
|
+
// each side: 32 + 16 = 48, as the native `Button` `small`.
|
|
14
|
+
const HIT_SLOP = 8;
|
|
15
|
+
/**
|
|
16
|
+
* Upgrade prompt, the native `SidebarUpgradeCard`: the title and an "Upgrade"
|
|
17
|
+
* pill on a secondary surface, with no mark. It does not check the plan; the
|
|
18
|
+
* app hides it when the user is already on Pro.
|
|
19
|
+
*/
|
|
20
|
+
export function UpgradeToProCard(t0) {
|
|
21
|
+
const $ = _c(38);
|
|
22
|
+
const {
|
|
23
|
+
onUpgrade,
|
|
24
|
+
collapsed: t1,
|
|
25
|
+
title: t2,
|
|
26
|
+
ctaLabel: t3,
|
|
27
|
+
className,
|
|
28
|
+
testID
|
|
29
|
+
} = t0;
|
|
30
|
+
const collapsed = t1 === undefined ? false : t1;
|
|
31
|
+
const title = t2 === undefined ? "Upgrade to Pro" : t2;
|
|
32
|
+
const ctaLabel = t3 === undefined ? "Upgrade" : t3;
|
|
33
|
+
const scheme = useScheme();
|
|
34
|
+
const largerText = useLargerText();
|
|
35
|
+
const titleSize = largerText ? "text-lg" : "text-sm";
|
|
36
|
+
const ctaSize = largerText ? "text-base" : "text-sm";
|
|
37
|
+
let t4;
|
|
38
|
+
if ($[0] !== ctaSize || $[1] !== largerText || $[2] !== onUpgrade || $[3] !== scheme || $[4] !== testID) {
|
|
39
|
+
t4 = (label, accessibilityLabel) => <Pressable testID={testID ? `${testID}-cta` : undefined} accessibilityRole="button" accessibilityLabel={accessibilityLabel} onPress={onUpgrade} hitSlop={HIT_SLOP} className={cn("shrink-0 items-center justify-center rounded-full active:opacity-80", largerText ? "min-h-12 px-4" : "min-h-9 px-3")} style={{
|
|
40
|
+
backgroundColor: tokens.color.foreground[scheme]
|
|
41
|
+
}}><Text className={cn("font-instrument-sans-medium", ctaSize)} style={[{
|
|
42
|
+
color: tokens.color.background[scheme]
|
|
43
|
+
}, sizeStyle(ctaSize), typeStyle("medium")]}>{label}</Text></Pressable>;
|
|
44
|
+
$[0] = ctaSize;
|
|
45
|
+
$[1] = largerText;
|
|
46
|
+
$[2] = onUpgrade;
|
|
47
|
+
$[3] = scheme;
|
|
48
|
+
$[4] = testID;
|
|
49
|
+
$[5] = t4;
|
|
50
|
+
} else {
|
|
51
|
+
t4 = $[5];
|
|
52
|
+
}
|
|
53
|
+
const pill = t4;
|
|
54
|
+
if (collapsed) {
|
|
55
|
+
let t5;
|
|
56
|
+
if ($[6] !== pill || $[7] !== title) {
|
|
57
|
+
t5 = pill("Pro", title);
|
|
58
|
+
$[6] = pill;
|
|
59
|
+
$[7] = title;
|
|
60
|
+
$[8] = t5;
|
|
61
|
+
} else {
|
|
62
|
+
t5 = $[8];
|
|
63
|
+
}
|
|
64
|
+
let t6;
|
|
65
|
+
if ($[9] !== className || $[10] !== t5 || $[11] !== testID) {
|
|
66
|
+
t6 = <View testID={testID} className={className}>{t5}</View>;
|
|
67
|
+
$[9] = className;
|
|
68
|
+
$[10] = t5;
|
|
69
|
+
$[11] = testID;
|
|
70
|
+
$[12] = t6;
|
|
71
|
+
} else {
|
|
72
|
+
t6 = $[12];
|
|
73
|
+
}
|
|
74
|
+
return t6;
|
|
75
|
+
}
|
|
76
|
+
let t5;
|
|
77
|
+
if ($[13] !== className) {
|
|
78
|
+
t5 = cn("flex-row items-center justify-between gap-3 bg-surface-secondary px-3 py-2.5", className);
|
|
79
|
+
$[13] = className;
|
|
80
|
+
$[14] = t5;
|
|
81
|
+
} else {
|
|
82
|
+
t5 = $[14];
|
|
83
|
+
}
|
|
84
|
+
let t6;
|
|
85
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
86
|
+
t6 = {
|
|
87
|
+
borderRadius: RADIUS
|
|
88
|
+
};
|
|
89
|
+
$[15] = t6;
|
|
90
|
+
} else {
|
|
91
|
+
t6 = $[15];
|
|
92
|
+
}
|
|
93
|
+
let t7;
|
|
94
|
+
if ($[16] !== titleSize) {
|
|
95
|
+
t7 = cn("min-w-0 flex-1 font-instrument-sans-semibold", titleSize);
|
|
96
|
+
$[16] = titleSize;
|
|
97
|
+
$[17] = t7;
|
|
98
|
+
} else {
|
|
99
|
+
t7 = $[17];
|
|
100
|
+
}
|
|
101
|
+
let t8;
|
|
102
|
+
if ($[18] !== scheme) {
|
|
103
|
+
t8 = textStyle("foreground", scheme);
|
|
104
|
+
$[18] = scheme;
|
|
105
|
+
$[19] = t8;
|
|
106
|
+
} else {
|
|
107
|
+
t8 = $[19];
|
|
108
|
+
}
|
|
109
|
+
let t9;
|
|
110
|
+
if ($[20] !== titleSize) {
|
|
111
|
+
t9 = sizeStyle(titleSize);
|
|
112
|
+
$[20] = titleSize;
|
|
113
|
+
$[21] = t9;
|
|
114
|
+
} else {
|
|
115
|
+
t9 = $[21];
|
|
116
|
+
}
|
|
117
|
+
let t10;
|
|
118
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
119
|
+
t10 = typeStyle("semibold");
|
|
120
|
+
$[22] = t10;
|
|
121
|
+
} else {
|
|
122
|
+
t10 = $[22];
|
|
123
|
+
}
|
|
124
|
+
let t11;
|
|
125
|
+
if ($[23] !== t8 || $[24] !== t9) {
|
|
126
|
+
t11 = [t8, t9, t10];
|
|
127
|
+
$[23] = t8;
|
|
128
|
+
$[24] = t9;
|
|
129
|
+
$[25] = t11;
|
|
130
|
+
} else {
|
|
131
|
+
t11 = $[25];
|
|
132
|
+
}
|
|
133
|
+
let t12;
|
|
134
|
+
if ($[26] !== t11 || $[27] !== t7 || $[28] !== title) {
|
|
135
|
+
t12 = <Text numberOfLines={1} className={t7} style={t11}>{title}</Text>;
|
|
136
|
+
$[26] = t11;
|
|
137
|
+
$[27] = t7;
|
|
138
|
+
$[28] = title;
|
|
139
|
+
$[29] = t12;
|
|
140
|
+
} else {
|
|
141
|
+
t12 = $[29];
|
|
142
|
+
}
|
|
143
|
+
let t13;
|
|
144
|
+
if ($[30] !== ctaLabel || $[31] !== pill) {
|
|
145
|
+
t13 = pill(ctaLabel);
|
|
146
|
+
$[30] = ctaLabel;
|
|
147
|
+
$[31] = pill;
|
|
148
|
+
$[32] = t13;
|
|
149
|
+
} else {
|
|
150
|
+
t13 = $[32];
|
|
151
|
+
}
|
|
152
|
+
let t14;
|
|
153
|
+
if ($[33] !== t12 || $[34] !== t13 || $[35] !== t5 || $[36] !== testID) {
|
|
154
|
+
t14 = <View testID={testID} className={t5} style={t6}>{t12}{t13}</View>;
|
|
155
|
+
$[33] = t12;
|
|
156
|
+
$[34] = t13;
|
|
157
|
+
$[35] = t5;
|
|
158
|
+
$[36] = testID;
|
|
159
|
+
$[37] = t14;
|
|
160
|
+
} else {
|
|
161
|
+
t14 = $[37];
|
|
162
|
+
}
|
|
163
|
+
return t14;
|
|
164
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Plan types and pure helpers for `PricingModal`, the same shapes and rules as
|
|
2
|
+
// the web `PricingModal` multi-plan layout. No React Native imports.
|
|
3
|
+
|
|
4
|
+
import { V_PRO_APP_BENEFITS } from "../brand/vProAppBenefits";
|
|
5
|
+
/** `featured`, else `highlighted` (the web rule: `featured ?? highlighted`). */
|
|
6
|
+
export function isEmphasised(plan) {
|
|
7
|
+
return Boolean(plan.featured ?? plan.highlighted);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** The plan's app groups: its own, else `V_PRO_APP_BENEFITS` for the emphasised plan, else none. */
|
|
11
|
+
export function planAppBenefits(plan) {
|
|
12
|
+
return plan.appBenefits ?? (isEmphasised(plan) ? V_PRO_APP_BENEFITS : undefined);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Stable sort: the current app's group first, the rest in their order. */
|
|
16
|
+
export function sortAppBenefits(groups, currentApp) {
|
|
17
|
+
return [...groups].sort((a, b) => Number(b.app === currentApp) - Number(a.app === currentApp));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Label, variant and state of a plan's button, as on the web. */
|
|
21
|
+
export function planButton(plan) {
|
|
22
|
+
if (plan.current) {
|
|
23
|
+
return {
|
|
24
|
+
label: "Current plan",
|
|
25
|
+
variant: "outline",
|
|
26
|
+
disabled: true
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
label: plan.ctaLabel ?? "Get started",
|
|
31
|
+
variant: isEmphasised(plan) ? "default" : "secondary",
|
|
32
|
+
disabled: false
|
|
33
|
+
};
|
|
34
|
+
}
|