@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,198 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Pressable, Text, View } from "react-native";
|
|
3
|
+
import { IconFile } from "@tabler/icons-react-native";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
|
+
import { MIN_TOUCH_TARGET, sizeStyle, textStyle, touchSlop } from "../controlStyles";
|
|
6
|
+
import { palette } from "../palette";
|
|
7
|
+
import { useLargerText } from "../theme";
|
|
8
|
+
import { tokens } from "../tokens";
|
|
9
|
+
import { useScheme } from "../useScheme";
|
|
10
|
+
import { MONO_FONT, chatTextSize } from "./chat-text";
|
|
11
|
+
|
|
12
|
+
/** A `text-xs` line with the web `py-0.5` and border: 22 high. The slop brings it to 44. */
|
|
13
|
+
const CHIP_HEIGHT = 22;
|
|
14
|
+
function FileChipLabel(t0) {
|
|
15
|
+
const $ = _c(36);
|
|
16
|
+
const {
|
|
17
|
+
name
|
|
18
|
+
} = t0;
|
|
19
|
+
const scheme = useScheme();
|
|
20
|
+
const largerText = useLargerText();
|
|
21
|
+
let T0;
|
|
22
|
+
let T1;
|
|
23
|
+
let t1;
|
|
24
|
+
let t2;
|
|
25
|
+
let t3;
|
|
26
|
+
let t4;
|
|
27
|
+
let t5;
|
|
28
|
+
let t6;
|
|
29
|
+
let t7;
|
|
30
|
+
if ($[0] !== largerText || $[1] !== scheme) {
|
|
31
|
+
const size = chatTextSize("caption", largerText);
|
|
32
|
+
T1 = View;
|
|
33
|
+
t5 = "max-w-full flex-row items-center gap-1.5 self-start border px-1.5 py-0.5";
|
|
34
|
+
const t8 = tokens.color.border[scheme];
|
|
35
|
+
const t9 = palette.default[scheme];
|
|
36
|
+
if ($[11] !== t8 || $[12] !== t9) {
|
|
37
|
+
t6 = {
|
|
38
|
+
borderRadius: tokens.radius.md,
|
|
39
|
+
borderColor: t8,
|
|
40
|
+
backgroundColor: t9
|
|
41
|
+
};
|
|
42
|
+
$[11] = t8;
|
|
43
|
+
$[12] = t9;
|
|
44
|
+
$[13] = t6;
|
|
45
|
+
} else {
|
|
46
|
+
t6 = $[13];
|
|
47
|
+
}
|
|
48
|
+
const t10 = largerText ? 16 : 12;
|
|
49
|
+
const t11 = tokens.color.foreground[scheme];
|
|
50
|
+
if ($[14] !== t10 || $[15] !== t11) {
|
|
51
|
+
t7 = <IconFile size={t10} color={t11} />;
|
|
52
|
+
$[14] = t10;
|
|
53
|
+
$[15] = t11;
|
|
54
|
+
$[16] = t7;
|
|
55
|
+
} else {
|
|
56
|
+
t7 = $[16];
|
|
57
|
+
}
|
|
58
|
+
T0 = Text;
|
|
59
|
+
t2 = 1;
|
|
60
|
+
t3 = "middle";
|
|
61
|
+
t4 = cn(size, "shrink");
|
|
62
|
+
t1 = sizeStyle(size);
|
|
63
|
+
$[0] = largerText;
|
|
64
|
+
$[1] = scheme;
|
|
65
|
+
$[2] = T0;
|
|
66
|
+
$[3] = T1;
|
|
67
|
+
$[4] = t1;
|
|
68
|
+
$[5] = t2;
|
|
69
|
+
$[6] = t3;
|
|
70
|
+
$[7] = t4;
|
|
71
|
+
$[8] = t5;
|
|
72
|
+
$[9] = t6;
|
|
73
|
+
$[10] = t7;
|
|
74
|
+
} else {
|
|
75
|
+
T0 = $[2];
|
|
76
|
+
T1 = $[3];
|
|
77
|
+
t1 = $[4];
|
|
78
|
+
t2 = $[5];
|
|
79
|
+
t3 = $[6];
|
|
80
|
+
t4 = $[7];
|
|
81
|
+
t5 = $[8];
|
|
82
|
+
t6 = $[9];
|
|
83
|
+
t7 = $[10];
|
|
84
|
+
}
|
|
85
|
+
let t8;
|
|
86
|
+
if ($[17] !== scheme) {
|
|
87
|
+
t8 = textStyle("foreground", scheme);
|
|
88
|
+
$[17] = scheme;
|
|
89
|
+
$[18] = t8;
|
|
90
|
+
} else {
|
|
91
|
+
t8 = $[18];
|
|
92
|
+
}
|
|
93
|
+
let t9;
|
|
94
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
95
|
+
t9 = {
|
|
96
|
+
fontFamily: MONO_FONT
|
|
97
|
+
};
|
|
98
|
+
$[19] = t9;
|
|
99
|
+
} else {
|
|
100
|
+
t9 = $[19];
|
|
101
|
+
}
|
|
102
|
+
let t10;
|
|
103
|
+
if ($[20] !== t1 || $[21] !== t8) {
|
|
104
|
+
t10 = [t1, t8, t9];
|
|
105
|
+
$[20] = t1;
|
|
106
|
+
$[21] = t8;
|
|
107
|
+
$[22] = t10;
|
|
108
|
+
} else {
|
|
109
|
+
t10 = $[22];
|
|
110
|
+
}
|
|
111
|
+
let t11;
|
|
112
|
+
if ($[23] !== T0 || $[24] !== name || $[25] !== t10 || $[26] !== t2 || $[27] !== t3 || $[28] !== t4) {
|
|
113
|
+
t11 = <T0 numberOfLines={t2} ellipsizeMode={t3} className={t4} style={t10}>{name}</T0>;
|
|
114
|
+
$[23] = T0;
|
|
115
|
+
$[24] = name;
|
|
116
|
+
$[25] = t10;
|
|
117
|
+
$[26] = t2;
|
|
118
|
+
$[27] = t3;
|
|
119
|
+
$[28] = t4;
|
|
120
|
+
$[29] = t11;
|
|
121
|
+
} else {
|
|
122
|
+
t11 = $[29];
|
|
123
|
+
}
|
|
124
|
+
let t12;
|
|
125
|
+
if ($[30] !== T1 || $[31] !== t11 || $[32] !== t5 || $[33] !== t6 || $[34] !== t7) {
|
|
126
|
+
t12 = <T1 className={t5} style={t6}>{t7}{t11}</T1>;
|
|
127
|
+
$[30] = T1;
|
|
128
|
+
$[31] = t11;
|
|
129
|
+
$[32] = t5;
|
|
130
|
+
$[33] = t6;
|
|
131
|
+
$[34] = t7;
|
|
132
|
+
$[35] = t12;
|
|
133
|
+
} else {
|
|
134
|
+
t12 = $[35];
|
|
135
|
+
}
|
|
136
|
+
return t12;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* A file name in a trace line or step body: the web `rounded-md border
|
|
140
|
+
* bg-secondary px-1.5 py-0.5 font-mono text-xs` chip. It is a button that
|
|
141
|
+
* opens the file when both `path` and `onOpenFile` are given, and plain text
|
|
142
|
+
* otherwise. Long names are cut in the middle, so the extension shows.
|
|
143
|
+
*/
|
|
144
|
+
export function FileChip(t0) {
|
|
145
|
+
const $ = _c(13);
|
|
146
|
+
const {
|
|
147
|
+
name,
|
|
148
|
+
path,
|
|
149
|
+
onOpenFile
|
|
150
|
+
} = t0;
|
|
151
|
+
if (!path || !onOpenFile) {
|
|
152
|
+
let t1;
|
|
153
|
+
if ($[0] !== name) {
|
|
154
|
+
t1 = <FileChipLabel name={name} />;
|
|
155
|
+
$[0] = name;
|
|
156
|
+
$[1] = t1;
|
|
157
|
+
} else {
|
|
158
|
+
t1 = $[1];
|
|
159
|
+
}
|
|
160
|
+
return t1;
|
|
161
|
+
}
|
|
162
|
+
let t1;
|
|
163
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
164
|
+
t1 = touchSlop(MIN_TOUCH_TARGET, CHIP_HEIGHT);
|
|
165
|
+
$[2] = t1;
|
|
166
|
+
} else {
|
|
167
|
+
t1 = $[2];
|
|
168
|
+
}
|
|
169
|
+
let t2;
|
|
170
|
+
if ($[3] !== onOpenFile || $[4] !== path) {
|
|
171
|
+
t2 = () => onOpenFile(path);
|
|
172
|
+
$[3] = onOpenFile;
|
|
173
|
+
$[4] = path;
|
|
174
|
+
$[5] = t2;
|
|
175
|
+
} else {
|
|
176
|
+
t2 = $[5];
|
|
177
|
+
}
|
|
178
|
+
let t3;
|
|
179
|
+
if ($[6] !== name) {
|
|
180
|
+
t3 = <FileChipLabel name={name} />;
|
|
181
|
+
$[6] = name;
|
|
182
|
+
$[7] = t3;
|
|
183
|
+
} else {
|
|
184
|
+
t3 = $[7];
|
|
185
|
+
}
|
|
186
|
+
let t4;
|
|
187
|
+
if ($[8] !== name || $[9] !== path || $[10] !== t2 || $[11] !== t3) {
|
|
188
|
+
t4 = <Pressable accessibilityRole="button" accessibilityLabel={name} accessibilityHint={path} hitSlop={t1} onPress={t2} className="min-w-0 max-w-full active:opacity-70">{t3}</Pressable>;
|
|
189
|
+
$[8] = name;
|
|
190
|
+
$[9] = path;
|
|
191
|
+
$[10] = t2;
|
|
192
|
+
$[11] = t3;
|
|
193
|
+
$[12] = t4;
|
|
194
|
+
} else {
|
|
195
|
+
t4 = $[12];
|
|
196
|
+
}
|
|
197
|
+
return t4;
|
|
198
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Button } from "../Button";
|
|
3
|
+
import { cn } from "../cn";
|
|
4
|
+
import { MIN_TOUCH_TARGET, buttonColors, touchSlop } from "../controlStyles";
|
|
5
|
+
import { useLargerText } from "../theme";
|
|
6
|
+
import { tokens } from "../tokens";
|
|
7
|
+
import { useScheme } from "../useScheme";
|
|
8
|
+
|
|
9
|
+
/** The web `icon-sm` button: 32 square with a 16 icon. */
|
|
10
|
+
export const CHAT_ICON_BUTTON_SIZE = 32;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Side and icon per size: `sm` is the web `icon-sm` (32, 16 icon), `xs` the
|
|
14
|
+
* web `icon-xs` (28, 14 icon) and `md` the web `size-9` (36, 16 icon), Eva's
|
|
15
|
+
* composer send button. `touch` has no web twin: a 44 square with a 16 icon,
|
|
16
|
+
* for a row of ghost buttons a thumb taps (the message actions), where the
|
|
17
|
+
* web 28 squares 2 apart are a mouse's density.
|
|
18
|
+
*/
|
|
19
|
+
const CHAT_ICON_BUTTON = {
|
|
20
|
+
xs: {
|
|
21
|
+
side: 28,
|
|
22
|
+
icon: 14,
|
|
23
|
+
className: "h-7 w-7"
|
|
24
|
+
},
|
|
25
|
+
sm: {
|
|
26
|
+
side: CHAT_ICON_BUTTON_SIZE,
|
|
27
|
+
icon: 16,
|
|
28
|
+
className: "h-8 w-8"
|
|
29
|
+
},
|
|
30
|
+
md: {
|
|
31
|
+
side: 36,
|
|
32
|
+
icon: 16,
|
|
33
|
+
className: "h-9 w-9"
|
|
34
|
+
},
|
|
35
|
+
touch: {
|
|
36
|
+
side: MIN_TOUCH_TARGET,
|
|
37
|
+
icon: 16,
|
|
38
|
+
className: "h-11 w-11"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A round `Button` at the web `icon-sm` size (32), or another
|
|
43
|
+
* `ChatIconButtonSize`, with the slop to 44. With larger text it is painted
|
|
44
|
+
* 44 with a 20 icon. The message
|
|
45
|
+
* actions, the composer tools and its send button, and the code copy button.
|
|
46
|
+
* Round from the `Button` pill default; `shape="rounded"` gives radius 16.
|
|
47
|
+
*/
|
|
48
|
+
export function ChatIconButton(t0) {
|
|
49
|
+
const $ = _c(42);
|
|
50
|
+
let Icon;
|
|
51
|
+
let className;
|
|
52
|
+
let iconColor;
|
|
53
|
+
let label;
|
|
54
|
+
let props;
|
|
55
|
+
let t1;
|
|
56
|
+
let t2;
|
|
57
|
+
let t3;
|
|
58
|
+
if ($[0] !== t0) {
|
|
59
|
+
({
|
|
60
|
+
icon: Icon,
|
|
61
|
+
label,
|
|
62
|
+
iconColor,
|
|
63
|
+
variant: t1,
|
|
64
|
+
size: t2,
|
|
65
|
+
slop: t3,
|
|
66
|
+
className,
|
|
67
|
+
...props
|
|
68
|
+
} = t0);
|
|
69
|
+
$[0] = t0;
|
|
70
|
+
$[1] = Icon;
|
|
71
|
+
$[2] = className;
|
|
72
|
+
$[3] = iconColor;
|
|
73
|
+
$[4] = label;
|
|
74
|
+
$[5] = props;
|
|
75
|
+
$[6] = t1;
|
|
76
|
+
$[7] = t2;
|
|
77
|
+
$[8] = t3;
|
|
78
|
+
} else {
|
|
79
|
+
Icon = $[1];
|
|
80
|
+
className = $[2];
|
|
81
|
+
iconColor = $[3];
|
|
82
|
+
label = $[4];
|
|
83
|
+
props = $[5];
|
|
84
|
+
t1 = $[6];
|
|
85
|
+
t2 = $[7];
|
|
86
|
+
t3 = $[8];
|
|
87
|
+
}
|
|
88
|
+
const variant = t1 === undefined ? "ghost" : t1;
|
|
89
|
+
const size = t2 === undefined ? "sm" : t2;
|
|
90
|
+
const slop = t3 === undefined ? "square" : t3;
|
|
91
|
+
const scheme = useScheme();
|
|
92
|
+
const largerText = useLargerText();
|
|
93
|
+
let T0;
|
|
94
|
+
let color;
|
|
95
|
+
let metrics;
|
|
96
|
+
let t4;
|
|
97
|
+
let t5;
|
|
98
|
+
let t6;
|
|
99
|
+
let t7;
|
|
100
|
+
let t8;
|
|
101
|
+
if ($[9] !== className || $[10] !== iconColor || $[11] !== label || $[12] !== largerText || $[13] !== scheme || $[14] !== size || $[15] !== slop || $[16] !== variant) {
|
|
102
|
+
metrics = largerText ? {
|
|
103
|
+
side: MIN_TOUCH_TARGET,
|
|
104
|
+
icon: 20,
|
|
105
|
+
className: "h-11 w-11"
|
|
106
|
+
} : CHAT_ICON_BUTTON[size];
|
|
107
|
+
let t9;
|
|
108
|
+
if ($[25] !== iconColor || $[26] !== scheme || $[27] !== variant) {
|
|
109
|
+
t9 = iconColor ?? buttonColors(variant, scheme)?.color ?? tokens.color.foreground[scheme];
|
|
110
|
+
$[25] = iconColor;
|
|
111
|
+
$[26] = scheme;
|
|
112
|
+
$[27] = variant;
|
|
113
|
+
$[28] = t9;
|
|
114
|
+
} else {
|
|
115
|
+
t9 = $[28];
|
|
116
|
+
}
|
|
117
|
+
color = t9;
|
|
118
|
+
T0 = Button;
|
|
119
|
+
t4 = variant;
|
|
120
|
+
t5 = "icon";
|
|
121
|
+
t6 = label;
|
|
122
|
+
t7 = slop === "square" ? touchSlop(metrics.side) : {
|
|
123
|
+
...touchSlop(MIN_TOUCH_TARGET, metrics.side),
|
|
124
|
+
...(slop === "vertical" ? null : slop)
|
|
125
|
+
};
|
|
126
|
+
t8 = cn(metrics.className, className);
|
|
127
|
+
$[9] = className;
|
|
128
|
+
$[10] = iconColor;
|
|
129
|
+
$[11] = label;
|
|
130
|
+
$[12] = largerText;
|
|
131
|
+
$[13] = scheme;
|
|
132
|
+
$[14] = size;
|
|
133
|
+
$[15] = slop;
|
|
134
|
+
$[16] = variant;
|
|
135
|
+
$[17] = T0;
|
|
136
|
+
$[18] = color;
|
|
137
|
+
$[19] = metrics;
|
|
138
|
+
$[20] = t4;
|
|
139
|
+
$[21] = t5;
|
|
140
|
+
$[22] = t6;
|
|
141
|
+
$[23] = t7;
|
|
142
|
+
$[24] = t8;
|
|
143
|
+
} else {
|
|
144
|
+
T0 = $[17];
|
|
145
|
+
color = $[18];
|
|
146
|
+
metrics = $[19];
|
|
147
|
+
t4 = $[20];
|
|
148
|
+
t5 = $[21];
|
|
149
|
+
t6 = $[22];
|
|
150
|
+
t7 = $[23];
|
|
151
|
+
t8 = $[24];
|
|
152
|
+
}
|
|
153
|
+
let t9;
|
|
154
|
+
if ($[29] !== Icon || $[30] !== color || $[31] !== metrics.icon) {
|
|
155
|
+
t9 = <Icon size={metrics.icon} color={color} />;
|
|
156
|
+
$[29] = Icon;
|
|
157
|
+
$[30] = color;
|
|
158
|
+
$[31] = metrics.icon;
|
|
159
|
+
$[32] = t9;
|
|
160
|
+
} else {
|
|
161
|
+
t9 = $[32];
|
|
162
|
+
}
|
|
163
|
+
let t10;
|
|
164
|
+
if ($[33] !== T0 || $[34] !== props || $[35] !== t4 || $[36] !== t5 || $[37] !== t6 || $[38] !== t7 || $[39] !== t8 || $[40] !== t9) {
|
|
165
|
+
t10 = <T0 variant={t4} size={t5} accessibilityLabel={t6} hitSlop={t7} className={t8} {...props}>{t9}</T0>;
|
|
166
|
+
$[33] = T0;
|
|
167
|
+
$[34] = props;
|
|
168
|
+
$[35] = t4;
|
|
169
|
+
$[36] = t5;
|
|
170
|
+
$[37] = t6;
|
|
171
|
+
$[38] = t7;
|
|
172
|
+
$[39] = t8;
|
|
173
|
+
$[40] = t9;
|
|
174
|
+
$[41] = t10;
|
|
175
|
+
} else {
|
|
176
|
+
t10 = $[41];
|
|
177
|
+
}
|
|
178
|
+
return t10;
|
|
179
|
+
}
|
package/dist/ai/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// AI chat parts, ported from the `@vvedantb/ui` AI elements for touch. On the
|
|
2
|
+
// `@vvedantb/native-ui/ai` entry only, so apps without a chat do not bundle
|
|
3
|
+
// them. Generic: no model names and no app logic.
|
|
4
|
+
export { useStreamingDisclosure } from "./use-streaming-disclosure";
|
|
5
|
+
export { chatTextSize, formatElapsed, META_TEXT_STYLE, MONO_FONT } from "./chat-text";
|
|
6
|
+
export { Shimmer, SHIMMER_LOW_OPACITY } from "./shimmer";
|
|
7
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent, CollapsibleChevron, useCollapsible } from "./collapsible";
|
|
8
|
+
export { Conversation, ConversationContent, ConversationList, ConversationEmptyState, ConversationScrollButton, ConversationDock, useConversation, isScrolledToBottom, AT_BOTTOM_THRESHOLD } from "./conversation";
|
|
9
|
+
export { Message, MessageContent, MessageActionsBar, MessageAction, MessageMeta, MessageBotLabel, MESSAGE_ACTIONS, MESSAGE_HIGHLIGHT_MS, userBubbleStyle, tintBubbleStyle } from "./message";
|
|
10
|
+
export { MessageActionSheet } from "./message-action-sheet";
|
|
11
|
+
export { ReplyQuoteChip } from "./reply-quote-chip";
|
|
12
|
+
export { MessageQuote, QUOTE_MAX_LINES } from "./message-quote";
|
|
13
|
+
export { Reasoning, ReasoningTrigger, ReasoningContent, useReasoning, reasoningMessage } from "./reasoning";
|
|
14
|
+
export { AgentTrace, AgentTraceLine, AgentTraceIcon, AgentTraceTitle, AgentTraceDescription, AgentTraceCollapsible, AgentTraceCollapsibleTrigger, AgentTraceCollapsibleContent, AgentTraceFold, traceLineColor } from "./trace";
|
|
15
|
+
export { ChainOfThought, ChainOfThoughtHeader, ChainOfThoughtContent, ChainOfThoughtStep, ChainOfThoughtSearchResults, ChainOfThoughtSearchResult } from "./chain-of-thought";
|
|
16
|
+
export { ActivityStep } from "./activity-step";
|
|
17
|
+
// The web timeline's pure logic (byte-identical copies) and its folded rules.
|
|
18
|
+
// The step type is `ActivityTimelineStep` here: `ActivityStep` is the line above.
|
|
19
|
+
export { activityStepHasRichDetail } from "./activity-step-types";
|
|
20
|
+
export { deriveActionGroupSummary, deriveReadableCommandDisplay, deriveStepRowPresentation, resolveCommandVisualKind } from "./activity-step-label";
|
|
21
|
+
export { activityRowKey, activitySegmentKey, buildActivityRows, groupActivityRows } from "./activity-tasks-utils";
|
|
22
|
+
export { ACTIVITY_MAX_VISIBLE_BLOCKS, ACTIVITY_MAX_VISIBLE_CHILDREN, activityChildRows, activityStepSeconds, foldedActivitySegments } from "./activity-timeline";
|
|
23
|
+
export { PromptInput, PromptInputButton, PromptInputChip, PromptInputSubmit, PROMPT_INPUT_CHIP, isGenerating } from "./prompt-input";
|
|
24
|
+
export { PromptInputMenu, PromptInputMenuItem, PROMPT_INPUT_MENU, promptInputMenuHeight } from "./prompt-input-menu";
|
|
25
|
+
export { Suggestions, Suggestion } from "./suggestion";
|
|
26
|
+
export { Sources, SourcesTrigger, SourcesContent, Source, sourcesLabel } from "./sources";
|
|
27
|
+
export { FileChip } from "./file-chip";
|
|
28
|
+
export { Attachments, Attachment, getMediaCategory, getAttachmentLabel, ATTACHMENT_PRESS_TARGET } from "./attachments";
|
|
29
|
+
export { ChatThread } from "./chat-thread";
|
|
30
|
+
export { ChatJumpRail } from "./chat-jump-rail";
|
|
31
|
+
export { CodeBlock, CodeBlockCopyButton } from "./code-block";
|
|
32
|
+
export { ResponseText, ChatTextColorContext } from "./response-text";
|
|
33
|
+
export { ChoiceQuestion, choiceAnswers } from "./choice-question";
|
|
34
|
+
export { ActivityStepDetail } from "./activity-step-detail";
|
|
35
|
+
export { UnifiedDiff, DiffStat, UNIFIED_DIFF } from "./unified-diff";
|
|
36
|
+
export { ToolApprovalCard, ToolDraftCard, summarizeArgs, ARGS_MAX_CHARS, changedDraftEdits, DRAFT_ROLE_LABELS } from "./tool-approval-card";
|
|
37
|
+
export { SubagentRunCard, SubagentResultCard, subagentStatusColors } from "./subagent-cards";
|