@vvedantb/native-ui 0.38.0 → 0.40.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/Avatar.jsx +22 -19
- package/dist/BottomSheetContainer.jsx +0 -6
- package/dist/BulkActionBar.jsx +0 -24
- package/dist/Button.jsx +92 -116
- package/dist/Card.jsx +56 -50
- package/dist/ColorSwatches.jsx +0 -6
- package/dist/Dialog.jsx +0 -12
- package/dist/DropdownMenu.jsx +0 -10
- package/dist/EmptyState.jsx +0 -3
- package/dist/ExpoWebRoot.jsx +0 -6
- package/dist/Field.jsx +0 -17
- package/dist/FloatingSurface.jsx +95 -80
- package/dist/FloatingTabBar.jsx +0 -23
- package/dist/IconButton.jsx +0 -1
- package/dist/LoadingState.jsx +0 -6
- package/dist/PasswordInput.jsx +0 -15
- package/dist/PillTabs.jsx +39 -36
- package/dist/SearchInput.jsx +0 -13
- package/dist/SectionLabel.jsx +0 -1
- package/dist/SharedTransition.jsx +0 -3
- package/dist/Skeleton.jsx +0 -2
- package/dist/Spinner.jsx +0 -2
- package/dist/StatusDot.jsx +0 -5
- package/dist/Switch.jsx +32 -22
- package/dist/Tabs.jsx +27 -26
- package/dist/Textarea.jsx +0 -1
- package/dist/ThemeToggle.jsx +0 -1
- package/dist/Toast.jsx +80 -91
- package/dist/UpdateChecker.jsx +0 -1
- package/dist/ai/activity-question.jsx +0 -6
- package/dist/ai/activity-step-label.js +0 -6
- package/dist/ai/activity-step-types.js +0 -4
- package/dist/ai/activity-tasks-utils.js +0 -17
- package/dist/ai/activity-timeline.js +0 -8
- package/dist/ai/attachments.jsx +0 -2
- package/dist/ai/chain-of-thought.jsx +0 -3
- package/dist/ai/chat-text.js +2 -3
- package/dist/ai/chat-thread.jsx +0 -1
- package/dist/ai/choice-question.jsx +0 -10
- package/dist/ai/code-block.jsx +0 -31
- package/dist/ai/collapsible.jsx +0 -14
- package/dist/ai/conversation-context.js +0 -3
- package/dist/ai/conversation.jsx +2 -48
- package/dist/ai/file-chip.jsx +0 -2
- package/dist/ai/icon-button.jsx +10 -18
- package/dist/ai/index.js +0 -5
- package/dist/ai/message-context-menu.jsx +0 -7
- package/dist/ai/message.jsx +0 -21
- package/dist/ai/prompt-input-menu.jsx +0 -3
- package/dist/ai/prompt-input.jsx +2 -29
- package/dist/ai/response-text.jsx +0 -6
- package/dist/ai/sources.jsx +0 -1
- package/dist/ai/suggestion.jsx +0 -1
- package/dist/ai/trace.jsx +0 -11
- package/dist/ai/unified-diff.jsx +0 -4
- package/dist/auth/AuthScreen.jsx +0 -5
- package/dist/auth/GoogleSignInButton.jsx +0 -3
- package/dist/auth/SecondFactorScreen.jsx +0 -2
- package/dist/auth/SignInScreen.jsx +0 -17
- package/dist/auth/authErrors.js +0 -4
- package/dist/auth/clerkCore3.js +0 -7
- package/dist/auth/index.js +0 -4
- package/dist/auth/totp.js +0 -2
- package/dist/brand/GoogleMark.jsx +0 -1
- package/dist/brand/ProviderIcon.jsx +0 -2
- package/dist/brand/index.js +0 -3
- package/dist/brand/svg.js +0 -6
- package/dist/configureTheme.js +0 -9
- package/dist/controlStyles.js +0 -14
- package/dist/crash/lastCrash.js +3 -24
- package/dist/entries/ai.js +0 -3
- package/dist/entries/ambient.js +0 -2
- package/dist/entries/app-root.js +0 -5
- package/dist/entries/auth.js +0 -4
- package/dist/entries/bottom-sheet.js +0 -2
- package/dist/entries/brand.js +0 -1
- package/dist/entries/button.js +0 -1
- package/dist/entries/crash.js +0 -3
- package/dist/entries/date-time.js +0 -2
- package/dist/entries/expo-router.js +0 -3
- package/dist/entries/expo-web-root.js +0 -2
- package/dist/entries/floating.js +0 -2
- package/dist/entries/generative-ui.js +0 -4
- package/dist/entries/gesture-handler.js +0 -3
- package/dist/entries/keyboard-controller.js +0 -3
- package/dist/entries/layout.js +0 -2
- package/dist/entries/markdown.js +0 -3
- package/dist/entries/marketing.js +0 -1
- package/dist/entries/page-title.js +0 -5
- package/dist/entries/password-input.js +0 -2
- package/dist/entries/paste-input.js +0 -3
- package/dist/entries/primitives.js +0 -6
- package/dist/entries/search-input.js +0 -2
- package/dist/entries/tab-bar.js +0 -2
- package/dist/entries/theme.js +1 -2
- package/dist/entries/toast.js +0 -3
- package/dist/entries/video.js +0 -2
- package/dist/entries/webview.js +0 -2
- package/dist/examples/AiChatGallery.jsx +0 -11
- package/dist/examples/ParityGallery.jsx +0 -12
- package/dist/floating.js +0 -8
- package/dist/generative-ui/GenerativeUiPanel.jsx +0 -2
- package/dist/generative-ui/components.jsx +0 -8
- package/dist/glass.js +55 -0
- package/dist/glassBlur.jsx +0 -12
- package/dist/highlight.js +0 -26
- package/dist/index.js +1 -2
- package/dist/loadingGrid.js +0 -13
- package/dist/markdown/Markdown.jsx +0 -59
- package/dist/markdown/MarkdownTable.jsx +0 -18
- package/dist/markdown/tableText.js +0 -5
- package/dist/marketing/UpgradeToProCard.jsx +0 -5
- package/dist/marketing/pricing.js +0 -3
- package/dist/media/ImageGallery.jsx +0 -16
- package/dist/media/imageZoom.js +0 -4
- package/dist/media/zoom-image-gesture.jsx +0 -8
- package/dist/media/zoomImage.js +0 -3
- package/dist/motion.js +0 -3
- package/dist/neutralTheme.js +0 -5
- package/dist/pagerSwipe.js +0 -16
- package/dist/palette.js +0 -10
- package/dist/primitives/button.jsx +0 -5
- package/dist/primitives/keyboard-controller.jsx +0 -27
- package/dist/primitives/native-only-animated-view.jsx +0 -5
- package/dist/primitives/overlay.jsx +0 -2
- package/dist/primitives/pager-gesture.jsx +3 -29
- package/dist/primitives/paste-input.jsx +0 -5
- package/dist/primitives/select.jsx +0 -8
- package/dist/primitives/sheet-drag.jsx +0 -3
- package/dist/primitives/sheet-gesture.jsx +0 -8
- package/dist/primitives/swipe-row-gesture.jsx +3 -45
- package/dist/primitives/text.jsx +0 -5
- package/dist/primitives/toast-drag-gesture.jsx +4 -24
- package/dist/primitives/web-click-guard.js +0 -3
- package/dist/primitives/window-layer.jsx +0 -14
- package/dist/push.js +0 -6
- package/dist/relativeTime.js +0 -13
- package/dist/settings/MoreFromProjectV.jsx +0 -5
- package/dist/settings/ThemeModePicker.jsx +0 -4
- package/dist/settings/projectVMobileApps.js +1 -6
- package/dist/sheetDrag.js +0 -10
- package/dist/swipeRow.js +0 -15
- package/dist/tabBarRoutes.js +0 -4
- package/dist/tabIndicator.js +0 -4
- package/dist/tailwind-preset.cjs +0 -54
- package/dist/tailwind-preset.d.cts +0 -8
- package/dist/theme.jsx +29 -21
- package/dist/themeModeStore.js +0 -5
- package/dist/toastChrome.js +0 -6
- package/dist/toastDrag.js +0 -14
- package/dist/toastStore.js +0 -4
- package/dist/updateCheck.js +0 -7
- package/dist/video/InlineVideo.jsx +0 -2
- package/dist/webview/htmlView.js +0 -5
- package/package.json +3 -3
- package/src/ArtifactList.tsx +0 -2
- package/src/Avatar.tsx +3 -3
- package/src/Badge.tsx +0 -1
- package/src/BottomSheetContainer.tsx +0 -11
- package/src/BulkActionBar.tsx +0 -66
- package/src/Button.tsx +4 -40
- package/src/CaptureButton.tsx +0 -1
- package/src/Card.tsx +3 -15
- package/src/Checkbox.tsx +0 -2
- package/src/ColorSwatches.tsx +0 -9
- package/src/ConfirmDialog.tsx +0 -7
- package/src/DateTimeField.tsx +0 -5
- package/src/Dialog.tsx +0 -27
- package/src/DividedList.tsx +0 -1
- package/src/DropdownMenu.tsx +0 -51
- package/src/EmptyState.tsx +0 -5
- package/src/ExpoWebRoot.tsx +0 -10
- package/src/Field.tsx +0 -14
- package/src/FloatingFAB.tsx +0 -3
- package/src/FloatingSurface.tsx +11 -8
- package/src/FloatingTabBar.tsx +0 -25
- package/src/IconButton.tsx +0 -5
- package/src/Input.tsx +0 -1
- package/src/Label.tsx +0 -1
- package/src/LabeledSwitchRow.tsx +0 -2
- package/src/ListRow.tsx +0 -12
- package/src/LoadingState.tsx +0 -12
- package/src/MenuSheet.tsx +0 -2
- package/src/PageIndicator.tsx +0 -2
- package/src/PageTitle.tsx +0 -15
- package/src/Pager.tsx +0 -9
- package/src/PasswordInput.tsx +0 -24
- package/src/PillTabs.tsx +3 -11
- package/src/PinnedBotTile.tsx +0 -6
- package/src/Progress.tsx +0 -3
- package/src/ReactionRow.tsx +0 -8
- package/src/ScreenContainer.tsx +0 -4
- package/src/SearchInput.tsx +0 -25
- package/src/SectionLabel.tsx +0 -2
- package/src/Select.tsx +0 -6
- package/src/Separator.tsx +0 -2
- package/src/SharedTransition.tsx +0 -7
- package/src/Sheet.tsx +0 -3
- package/src/SheetRow.tsx +0 -12
- package/src/Skeleton.tsx +0 -10
- package/src/Spinner.tsx +0 -6
- package/src/StackPageHeader.tsx +0 -16
- package/src/StatGrid.tsx +0 -1
- package/src/StatusDot.tsx +0 -6
- package/src/SurfaceRow.tsx +0 -12
- package/src/SwipeableRow.tsx +0 -4
- package/src/Switch.tsx +3 -4
- package/src/Tabs.tsx +3 -27
- package/src/Textarea.tsx +0 -2
- package/src/ThemeToggle.tsx +0 -1
- package/src/Toast.tsx +3 -19
- package/src/UpdateChecker.tsx +0 -46
- package/src/ai/activity-question.tsx +0 -8
- package/src/ai/activity-step-detail.tsx +0 -5
- package/src/ai/activity-step-label.ts +0 -5
- package/src/ai/activity-step-types.ts +0 -24
- package/src/ai/activity-step.tsx +0 -4
- package/src/ai/activity-tasks-utils.ts +0 -13
- package/src/ai/activity-timeline.ts +0 -6
- package/src/ai/attachments.tsx +0 -13
- package/src/ai/chain-of-thought.tsx +0 -5
- package/src/ai/chat-jump-rail.tsx +0 -2
- package/src/ai/chat-text.ts +2 -3
- package/src/ai/chat-thread.tsx +0 -9
- package/src/ai/choice-question.tsx +0 -36
- package/src/ai/code-block.tsx +0 -52
- package/src/ai/collapsible.tsx +0 -12
- package/src/ai/conversation-context.ts +0 -14
- package/src/ai/conversation.tsx +0 -58
- package/src/ai/file-chip.tsx +0 -1
- package/src/ai/icon-button.tsx +5 -22
- package/src/ai/index.ts +0 -5
- package/src/ai/message-action-sheet.tsx +0 -8
- package/src/ai/message-context-menu.tsx +0 -22
- package/src/ai/message-quote.tsx +0 -4
- package/src/ai/message.tsx +0 -66
- package/src/ai/prompt-input-menu.tsx +0 -19
- package/src/ai/prompt-input.tsx +1 -98
- package/src/ai/reasoning.tsx +0 -6
- package/src/ai/reply-quote-chip.tsx +0 -5
- package/src/ai/response-text.tsx +0 -8
- package/src/ai/shimmer.tsx +0 -2
- package/src/ai/sources.tsx +0 -3
- package/src/ai/subagent-cards.tsx +0 -13
- package/src/ai/suggestion.tsx +0 -4
- package/src/ai/tool-approval-card.tsx +0 -14
- package/src/ai/trace.tsx +0 -23
- package/src/ai/unified-diff.tsx +0 -16
- package/src/ai/use-streaming-disclosure.ts +0 -4
- package/src/app-root/AuthGroupGate.tsx +0 -8
- package/src/app-root/SsoCallbackScreen.tsx +0 -10
- package/src/app-root/fonts.ts +0 -2
- package/src/auth/AccountScreens.tsx +0 -16
- package/src/auth/AuthProviders.tsx +0 -13
- package/src/auth/AuthScreen.tsx +0 -12
- package/src/auth/GoogleSignInButton.tsx +0 -12
- package/src/auth/SecondFactorScreen.tsx +0 -16
- package/src/auth/SignInScreen.tsx +0 -68
- package/src/auth/authErrors.ts +0 -6
- package/src/auth/clerkCore3.ts +0 -6
- package/src/auth/index.ts +0 -4
- package/src/auth/totp.ts +0 -13
- package/src/brand/AppIcons.tsx +0 -6
- package/src/brand/AppMark.tsx +0 -5
- package/src/brand/AppWordmark.tsx +0 -7
- package/src/brand/GoogleMark.tsx +0 -4
- package/src/brand/ProviderIcon.tsx +0 -6
- package/src/brand/familyApps.ts +0 -2
- package/src/brand/index.ts +0 -3
- package/src/brand/svg.ts +0 -9
- package/src/configureTheme.ts +0 -10
- package/src/controlStyles.ts +0 -12
- package/src/crash/LastCrashDialog.tsx +0 -6
- package/src/crash/lastCrash.ts +0 -21
- package/src/entries/ai.ts +0 -3
- package/src/entries/ambient.ts +0 -2
- package/src/entries/app-root.ts +0 -5
- package/src/entries/auth.ts +0 -4
- package/src/entries/bottom-sheet.ts +0 -2
- package/src/entries/brand.ts +0 -1
- package/src/entries/button.ts +0 -1
- package/src/entries/crash.ts +0 -3
- package/src/entries/date-time.ts +0 -2
- package/src/entries/expo-router.ts +0 -3
- package/src/entries/expo-web-root.ts +0 -2
- package/src/entries/floating.ts +0 -2
- package/src/entries/generative-ui.ts +0 -4
- package/src/entries/gesture-handler.ts +0 -3
- package/src/entries/keyboard-controller.ts +0 -3
- package/src/entries/layout.ts +0 -2
- package/src/entries/markdown.ts +0 -3
- package/src/entries/marketing.ts +0 -1
- package/src/entries/page-title.ts +0 -5
- package/src/entries/password-input.ts +0 -2
- package/src/entries/paste-input.ts +0 -3
- package/src/entries/primitives.ts +0 -6
- package/src/entries/search-input.ts +0 -2
- package/src/entries/tab-bar.ts +0 -2
- package/src/entries/theme.ts +2 -2
- package/src/entries/toast.ts +0 -3
- package/src/entries/video.ts +0 -2
- package/src/entries/webview.ts +0 -2
- package/src/examples/AiChatGallery.tsx +0 -11
- package/src/examples/ParityGallery.tsx +0 -25
- package/src/floating.ts +0 -6
- package/src/generative-ui/GenerativeUiPanel.tsx +0 -15
- package/src/generative-ui/components.tsx +0 -9
- package/src/generative-ui/context.ts +0 -2
- package/src/glass.ts +31 -0
- package/src/glassBlur.tsx +0 -15
- package/src/highlight.ts +0 -20
- package/src/index.ts +2 -2
- package/src/loadingGrid.ts +0 -12
- package/src/markdown/Markdown.tsx +0 -71
- package/src/markdown/MarkdownTable.tsx +0 -23
- package/src/markdown/tableText.ts +0 -3
- package/src/marketing/PricingModal.tsx +0 -13
- package/src/marketing/UpgradeToProCard.tsx +0 -14
- package/src/marketing/pricing.ts +0 -12
- package/src/media/ImageGallery.tsx +0 -18
- package/src/media/MediaCard.tsx +0 -8
- package/src/media/imageZoom.ts +0 -4
- package/src/media/zoom-image-gesture.tsx +0 -9
- package/src/media/zoomImage.ts +0 -5
- package/src/motion.ts +0 -3
- package/src/neutralTheme.ts +0 -3
- package/src/pagerSwipe.ts +0 -13
- package/src/palette.ts +0 -10
- package/src/pressScale.ts +0 -7
- package/src/primitives/button.tsx +0 -4
- package/src/primitives/card.tsx +0 -1
- package/src/primitives/input.tsx +0 -4
- package/src/primitives/keyboard-controller.tsx +0 -25
- package/src/primitives/keyboard-parts.tsx +0 -27
- package/src/primitives/native-only-animated-view.tsx +0 -5
- package/src/primitives/overlay.tsx +0 -25
- package/src/primitives/pager-gesture.tsx +0 -20
- package/src/primitives/paste-input.tsx +0 -4
- package/src/primitives/paste-parts.tsx +0 -1
- package/src/primitives/select.tsx +0 -16
- package/src/primitives/sheet-drag.tsx +0 -19
- package/src/primitives/sheet-gesture.tsx +0 -22
- package/src/primitives/swipe-row-gesture.tsx +0 -33
- package/src/primitives/switch.tsx +0 -4
- package/src/primitives/text.tsx +0 -4
- package/src/primitives/toast-drag-gesture.tsx +0 -13
- package/src/primitives/web-click-guard.ts +0 -2
- package/src/primitives/window-layer.tsx +0 -18
- package/src/push.ts +0 -15
- package/src/relativeTime.ts +0 -21
- package/src/router/RouterStackPageHeader.tsx +0 -1
- package/src/settings/MoreFromProjectV.tsx +0 -8
- package/src/settings/SettingsEmptyState.tsx +0 -2
- package/src/settings/SettingsSection.tsx +0 -3
- package/src/settings/SettingsToggleRow.tsx +0 -4
- package/src/settings/ThemeModePicker.tsx +0 -11
- package/src/settings/projectVMobileApps.ts +0 -8
- package/src/sheetDrag.ts +0 -9
- package/src/swipeRow.ts +0 -23
- package/src/tabBarRoutes.ts +0 -13
- package/src/tabIndicator.ts +0 -5
- package/src/tailwind-preset.cjs +0 -54
- package/src/tailwind-preset.d.cts +0 -8
- package/src/theme.tsx +11 -2
- package/src/themeModeStore.ts +0 -9
- package/src/toastChrome.ts +0 -6
- package/src/toastDrag.ts +0 -13
- package/src/toastStore.ts +0 -7
- package/src/updateCheck.ts +0 -15
- package/src/video/InlineVideo.tsx +0 -5
- package/src/webview/HtmlView.tsx +0 -23
- package/src/webview/HtmlView.web.tsx +0 -1
- package/src/webview/htmlView.ts +0 -5
package/src/Tabs.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { selectionHaptic } from "./haptics";
|
|
16
16
|
import { useControllableState } from "./primitives/use-controllable-state";
|
|
17
17
|
import { useTabIndicator, useTabLabelStyle } from "./tabIndicator";
|
|
18
|
+
import { useGlass } from "./glass";
|
|
18
19
|
import { useLargerText } from "./theme";
|
|
19
20
|
import { useScheme } from "./useScheme";
|
|
20
21
|
|
|
@@ -33,7 +34,6 @@ const TabsListContext = createContext<{
|
|
|
33
34
|
indicator?: ReturnType<typeof useTabIndicator>;
|
|
34
35
|
}>({ variant: "pills", size: "default" });
|
|
35
36
|
|
|
36
|
-
/** A trigger's place in its list, for the linked indicator and label colour. */
|
|
37
37
|
const TabIndexContext = createContext(0);
|
|
38
38
|
|
|
39
39
|
function useTabs(part: string) {
|
|
@@ -43,9 +43,7 @@ function useTabs(part: string) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export type TabsProps = ViewProps & {
|
|
46
|
-
/** Active tab when the parent controls it. */
|
|
47
46
|
value?: string;
|
|
48
|
-
/** Initial tab when `value` is not set. */
|
|
49
47
|
defaultValue?: string;
|
|
50
48
|
onValueChange?: (value: string) => void;
|
|
51
49
|
className?: string;
|
|
@@ -73,14 +71,7 @@ export function Tabs({
|
|
|
73
71
|
|
|
74
72
|
export type TabsListProps = ViewProps & {
|
|
75
73
|
variant?: TabsListVariant;
|
|
76
|
-
/** `sm` makes the triggers smaller. */
|
|
77
74
|
size?: TabsSize;
|
|
78
|
-
/**
|
|
79
|
-
* Where a linked `Pager` is, in pages: the first trigger is page 0. With it,
|
|
80
|
-
* as in `PillTabs`, the selected fill is one indicator that slides with the
|
|
81
|
-
* pages and each label blends to the selected colour with it. The triggers
|
|
82
|
-
* are the list's direct children, in page order.
|
|
83
|
-
*/
|
|
84
75
|
progress?: SharedValue<number>;
|
|
85
76
|
className?: string;
|
|
86
77
|
};
|
|
@@ -95,6 +86,7 @@ export function TabsList({
|
|
|
95
86
|
...props
|
|
96
87
|
}: TabsListProps) {
|
|
97
88
|
const scheme = useScheme();
|
|
89
|
+
const glass = useGlass("control");
|
|
98
90
|
const triggers = Children.toArray(children);
|
|
99
91
|
const indicator = useTabIndicator(progress, triggers.length);
|
|
100
92
|
return (
|
|
@@ -103,10 +95,6 @@ export function TabsList({
|
|
|
103
95
|
accessibilityRole="tablist"
|
|
104
96
|
className={cn(
|
|
105
97
|
"flex-row",
|
|
106
|
-
// The web lists: `segmented` and `pills` are `inline-flex` (as wide
|
|
107
|
-
// as their tabs), `soft` a full-width row of centred, wrapping pills.
|
|
108
|
-
// Pills wrap rather than run off a phone screen, except under a
|
|
109
|
-
// linked indicator, which slides along one line.
|
|
110
98
|
variant === "segmented"
|
|
111
99
|
? "max-w-full gap-[3px] self-start rounded-full p-[3px]"
|
|
112
100
|
: variant === "soft"
|
|
@@ -120,12 +108,12 @@ export function TabsList({
|
|
|
120
108
|
{...props}
|
|
121
109
|
>
|
|
122
110
|
{indicator.measured ? (
|
|
123
|
-
// The selected fill under the triggers, as `PillTabs`.
|
|
124
111
|
<Animated.View
|
|
125
112
|
pointerEvents="none"
|
|
126
113
|
style={[
|
|
127
114
|
{ position: "absolute", left: 0, borderRadius: 9999 },
|
|
128
115
|
{ backgroundColor: tabColors(variant, true, scheme).backgroundColor },
|
|
116
|
+
glass,
|
|
129
117
|
indicator.style,
|
|
130
118
|
]}
|
|
131
119
|
/>
|
|
@@ -145,11 +133,6 @@ export type TabsTriggerProps = {
|
|
|
145
133
|
children: ReactNode;
|
|
146
134
|
disabled?: boolean;
|
|
147
135
|
className?: string;
|
|
148
|
-
/**
|
|
149
|
-
* The trigger height on screen, for an app whose web call site sizes its
|
|
150
|
-
* list (a `h-8` list with `p-1` has 24-high triggers). Default: the web
|
|
151
|
-
* `.t-tab` 30, or the larger-text size. The hit slop still reaches 44.
|
|
152
|
-
*/
|
|
153
136
|
minHeight?: number;
|
|
154
137
|
testID?: string;
|
|
155
138
|
accessibilityLabel?: string;
|
|
@@ -170,8 +153,6 @@ export function TabsTrigger({
|
|
|
170
153
|
const largerText = useLargerText();
|
|
171
154
|
const scheme = useScheme();
|
|
172
155
|
const selected = current === value;
|
|
173
|
-
// Fill and label are styles from `tabColors`: apps' `bg-secondary` and
|
|
174
|
-
// `bg-surface` can stay light in dark mode, under a light label.
|
|
175
156
|
const colors = tabColors(variant, selected, scheme);
|
|
176
157
|
const labelStyle = useTabLabelStyle(
|
|
177
158
|
progress,
|
|
@@ -181,7 +162,6 @@ export function TabsTrigger({
|
|
|
181
162
|
);
|
|
182
163
|
const trigger = tabTriggerSize(variant, size, largerText);
|
|
183
164
|
const height = minHeight ?? trigger.minHeight;
|
|
184
|
-
// The web `.t-tab` is `font-medium`; the soft trigger is regular.
|
|
185
165
|
const medium = variant !== "soft";
|
|
186
166
|
|
|
187
167
|
return (
|
|
@@ -192,7 +172,6 @@ export function TabsTrigger({
|
|
|
192
172
|
accessibilityLabel ?? (typeof children === "string" ? children : undefined)
|
|
193
173
|
}
|
|
194
174
|
accessibilityState={{ selected, disabled: Boolean(disabled) }}
|
|
195
|
-
// The trigger height on screen (the web 30 by default), a 44 target to touch.
|
|
196
175
|
hitSlop={touchSlop(MIN_TOUCH_TARGET, height)}
|
|
197
176
|
disabled={disabled}
|
|
198
177
|
onPress={() => {
|
|
@@ -207,9 +186,6 @@ export function TabsTrigger({
|
|
|
207
186
|
disabled ? "opacity-50" : "active:opacity-70",
|
|
208
187
|
className,
|
|
209
188
|
)}
|
|
210
|
-
// A plain object: NativeWind puts the class styles and `style` in an
|
|
211
|
-
// array, where a `({ pressed }) => ...` style is dropped.
|
|
212
|
-
// When linked and measured, the list's indicator draws the selected fill.
|
|
213
189
|
style={{ backgroundColor: indicator?.measured ? "transparent" : colors.backgroundColor, minHeight: height }}
|
|
214
190
|
onLayout={progress ? indicator?.onLayout(index) : undefined}
|
|
215
191
|
>
|
package/src/Textarea.tsx
CHANGED
|
@@ -10,7 +10,6 @@ type TextareaProps = React.ComponentPropsWithoutRef<typeof PrimitiveInput> & {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
/** Multiline `Input`: same fill, border, radius and type. Grows from 4 lines. */
|
|
14
13
|
const Textarea = React.forwardRef<
|
|
15
14
|
React.ElementRef<typeof PrimitiveInput>,
|
|
16
15
|
TextareaProps
|
|
@@ -25,7 +24,6 @@ const Textarea = React.forwardRef<
|
|
|
25
24
|
textAlignVertical="top"
|
|
26
25
|
placeholderTextColor={placeholderTextColor ?? palette.fieldPlaceholder[scheme]}
|
|
27
26
|
className={cn(
|
|
28
|
-
// The web textarea: min-h-20 px-3.5 py-2.5, 16 px type.
|
|
29
27
|
"min-h-20 border px-3.5 py-2.5 text-base font-instrument-sans",
|
|
30
28
|
largerText && "min-h-32 px-4 py-3 text-xl font-instrument-sans-medium",
|
|
31
29
|
className,
|
package/src/ThemeToggle.tsx
CHANGED
|
@@ -9,7 +9,6 @@ export type ThemeToggleProps = {
|
|
|
9
9
|
testID?: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
/** Logged when NativeWind's `setColorScheme` throws. */
|
|
13
12
|
const DARK_MODE_CLASS_HINT =
|
|
14
13
|
'ThemeToggle could not set the colour scheme. NativeWind throws while Tailwind darkMode is "media" (the default): set darkMode: "class" in tailwind.config.js. See the @vvedantb/native-ui README, Theme.';
|
|
15
14
|
|
package/src/Toast.tsx
CHANGED
|
@@ -24,20 +24,17 @@ import {
|
|
|
24
24
|
toastSurfaceStyle,
|
|
25
25
|
} from "./toastChrome";
|
|
26
26
|
import { tokens } from "./tokens";
|
|
27
|
+
import { useGlass } from "./glass";
|
|
27
28
|
import { useLargerText } from "./theme";
|
|
28
29
|
import { useScheme } from "./useScheme";
|
|
29
30
|
import { NativeOnlyAnimatedView } from "./primitives/native-only-animated-view";
|
|
30
31
|
import { ToastDragContext } from "./toastDrag";
|
|
31
32
|
import { getToasts, subscribeToasts, toast, type ToastItem } from "./toastStore";
|
|
32
33
|
|
|
33
|
-
// On iOS the overlay draws above RN `Modal`s, so toasts show over dialogs (as
|
|
34
|
-
// sonner does on the web). On Android a `Modal` still covers them.
|
|
35
34
|
const FullWindowOverlay = Platform.OS === "ios" ? RNFullWindowOverlay : Fragment;
|
|
36
35
|
|
|
37
36
|
const toastShadow = toastShadowStyle(Platform.OS);
|
|
38
37
|
|
|
39
|
-
// Down from the top edge and back up the way it came, the exit 20% quicker:
|
|
40
|
-
// the reader is done with it.
|
|
41
38
|
const TOAST_ENTER = FadeInUp.duration(200).easing(EASE_OUT);
|
|
42
39
|
const TOAST_EXIT = FadeOutUp.duration(160).easing(EASE_OUT);
|
|
43
40
|
|
|
@@ -70,7 +67,6 @@ export function Toaster({ offset = 8 }: { offset?: number }) {
|
|
|
70
67
|
);
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
/** The web filled 24 icons (`toastChrome`), or a spinner while loading. */
|
|
74
70
|
function ToastIcon({ item }: { item: ToastItem }) {
|
|
75
71
|
const scheme = useScheme();
|
|
76
72
|
if (item.variant === "loading") {
|
|
@@ -91,13 +87,7 @@ function ToastIcon({ item }: { item: ToastItem }) {
|
|
|
91
87
|
);
|
|
92
88
|
}
|
|
93
89
|
|
|
94
|
-
/**
|
|
95
|
-
* Closes `item` after its `duration`, counting only while it is not `held`:
|
|
96
|
-
* a finger on the toast pauses the time left, and lifting it resumes. A
|
|
97
|
-
* toast replaced in place (same id, new item) starts its own time afresh.
|
|
98
|
-
*/
|
|
99
90
|
function useToastTimer(item: ToastItem, held: boolean) {
|
|
100
|
-
// The time left, and the item it counts for. Only the effect reads and writes it.
|
|
101
91
|
const left = useRef({ item, ms: item.duration });
|
|
102
92
|
useEffect(() => {
|
|
103
93
|
if (left.current.item !== item) left.current = { item, ms: item.duration };
|
|
@@ -114,13 +104,11 @@ function useToastTimer(item: ToastItem, held: boolean) {
|
|
|
114
104
|
function ToastCard({ item }: { item: ToastItem }) {
|
|
115
105
|
const largerText = useLargerText();
|
|
116
106
|
const scheme = useScheme();
|
|
117
|
-
|
|
107
|
+
const glass = useGlass("surface");
|
|
118
108
|
const Drag = useContext(ToastDragContext);
|
|
119
109
|
const [held, setHeld] = useState(false);
|
|
120
110
|
useToastTimer(item, held);
|
|
121
111
|
|
|
122
|
-
// A success or error toast reports an operation the user started: one
|
|
123
|
-
// notification haptic as it shows (or turns from loading into a result).
|
|
124
112
|
useEffect(() => {
|
|
125
113
|
if (item.variant === "success" || item.variant === "error") notificationHaptic(item.variant);
|
|
126
114
|
}, [item.id, item.variant]);
|
|
@@ -132,12 +120,9 @@ function ToastCard({ item }: { item: ToastItem }) {
|
|
|
132
120
|
}, [item.title, item.description]);
|
|
133
121
|
|
|
134
122
|
const surface = (
|
|
135
|
-
|
|
136
|
-
<View style={[toastSurfaceStyle(scheme), toastShadow]}>
|
|
123
|
+
<View style={[toastSurfaceStyle(scheme), toastShadow, glass]}>
|
|
137
124
|
<Pressable
|
|
138
125
|
testID={`toast-${item.id}`}
|
|
139
|
-
// With an action, the text and the action button stay separate
|
|
140
|
-
// elements for VoiceOver and TalkBack instead of one grouped button.
|
|
141
126
|
accessible={!item.action}
|
|
142
127
|
accessibilityRole="button"
|
|
143
128
|
accessibilityHint="Closes the message"
|
|
@@ -146,7 +131,6 @@ function ToastCard({ item }: { item: ToastItem }) {
|
|
|
146
131
|
>
|
|
147
132
|
<ToastIcon item={item} />
|
|
148
133
|
<View className="min-w-0 flex-1">
|
|
149
|
-
{/* Web `text-sm font-medium leading-snug` (14 / 19.25, 500); `text-lg` with larger text. */}
|
|
150
134
|
<Text
|
|
151
135
|
className={cn(
|
|
152
136
|
"font-instrument-sans-medium",
|
package/src/UpdateChecker.tsx
CHANGED
|
@@ -24,42 +24,22 @@ export const V_STORE_UPDATES_URL = "vstore://updates";
|
|
|
24
24
|
type UpdateText = ReactNode | ((update: AvailableUpdate) => ReactNode);
|
|
25
25
|
|
|
26
26
|
export type UpdatePromptProps = {
|
|
27
|
-
/** The update to offer. The prompt is open while this is set. */
|
|
28
27
|
update: AvailableUpdate | null;
|
|
29
|
-
/** The app's display name, used in the default description. */
|
|
30
28
|
appName: string;
|
|
31
|
-
/** Default "Update available". */
|
|
32
29
|
title?: ReactNode;
|
|
33
|
-
/** Default "`<appName> <version>` is ready to install.". A function receives the update. */
|
|
34
30
|
description?: UpdateText;
|
|
35
|
-
/** Default "Later". */
|
|
36
31
|
laterLabel?: ReactNode;
|
|
37
|
-
/** Default "Download". */
|
|
38
32
|
downloadLabel?: ReactNode;
|
|
39
|
-
/** Default "Install from V Store". */
|
|
40
33
|
vStoreLabel?: ReactNode;
|
|
41
|
-
/** Shown once V Store could not be opened. Default "V Store is not installed on this device.". */
|
|
42
34
|
vStoreMissingText?: ReactNode;
|
|
43
|
-
/** Show Download, which opens `update.url` (the APK or its release page). Default `true`. */
|
|
44
35
|
showDownload?: boolean;
|
|
45
|
-
/** Show "Install from V Store", which only opens V Store. Default `true`. */
|
|
46
36
|
showVStore?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* The link that opens V Store. Default `V_STORE_UPDATES_URL`, its Updates
|
|
49
|
-
* tab. Pass the app's own page there when the app knows its link.
|
|
50
|
-
*/
|
|
51
37
|
vStoreUrl?: string;
|
|
52
|
-
/** Later, Android back and the VoiceOver escape. */
|
|
53
38
|
onLater?: (update: AvailableUpdate) => void;
|
|
54
|
-
/** After Download opened `update.url`. Close the prompt here. */
|
|
55
39
|
onDownload?: (update: AvailableUpdate) => void;
|
|
56
|
-
/** After V Store opened. Close the prompt here. */
|
|
57
40
|
onOpenVStore?: (update: AvailableUpdate) => void;
|
|
58
|
-
/** V Store could not be opened (not installed). The prompt stays open, without the V Store button. */
|
|
59
41
|
onVStoreMissing?: (update: AvailableUpdate) => void;
|
|
60
|
-
/** Opens a link. Default `Linking.openURL`, which rejects when no app handles it. */
|
|
61
42
|
openUrl?: (url: string) => Promise<unknown>;
|
|
62
|
-
/** The buttons get `<testID>-later`, `-download` and `-vstore`; the notice `-vstore-missing`. */
|
|
63
43
|
testID?: string;
|
|
64
44
|
};
|
|
65
45
|
|
|
@@ -98,9 +78,7 @@ export function UpdatePrompt({
|
|
|
98
78
|
openUrl = Linking.openURL,
|
|
99
79
|
testID,
|
|
100
80
|
}: UpdatePromptProps) {
|
|
101
|
-
// The version V Store failed to open for, so the next version asks afresh.
|
|
102
81
|
const [missingFor, setMissingFor] = useState<string | null>(null);
|
|
103
|
-
// The last update, so the text stays while the dialog closes.
|
|
104
82
|
const [shown, setShown] = useState(update);
|
|
105
83
|
if (update && update !== shown) setShown(update);
|
|
106
84
|
|
|
@@ -133,7 +111,6 @@ export function UpdatePrompt({
|
|
|
133
111
|
) : null}
|
|
134
112
|
</AlertDialogHeader>
|
|
135
113
|
<AlertDialogFooter>
|
|
136
|
-
{/* Closes the dialog, and so calls `onLater`. */}
|
|
137
114
|
<AlertDialogCancel size="lg" testID={testID ? `${testID}-later` : undefined}>
|
|
138
115
|
{laterLabel}
|
|
139
116
|
</AlertDialogCancel>
|
|
@@ -162,7 +139,6 @@ export function UpdatePrompt({
|
|
|
162
139
|
testID={testID ? `${testID}-download` : undefined}
|
|
163
140
|
onPress={() => {
|
|
164
141
|
if (!update) return;
|
|
165
|
-
// A link that does not open leaves nothing to do here.
|
|
166
142
|
openUrl(update.url).catch(() => undefined);
|
|
167
143
|
onDownload?.(update);
|
|
168
144
|
}}
|
|
@@ -182,7 +158,6 @@ export type UpdateDismissStorage = {
|
|
|
182
158
|
setItem: (key: string, value: string) => Promise<unknown> | unknown;
|
|
183
159
|
};
|
|
184
160
|
|
|
185
|
-
/** The version Later hid. An unreadable store means nothing was dismissed. */
|
|
186
161
|
async function readDismissed(storage: UpdateDismissStorage, key: string): Promise<string | null> {
|
|
187
162
|
try {
|
|
188
163
|
return await storage.getItem(key);
|
|
@@ -195,29 +170,12 @@ export type UpdateCheckerProps = Omit<
|
|
|
195
170
|
UpdatePromptProps,
|
|
196
171
|
"update" | "onLater" | "onDownload" | "onOpenVStore"
|
|
197
172
|
> & {
|
|
198
|
-
/**
|
|
199
|
-
* The installed version, "1.2.3". `null` or `undefined` skips the check, for
|
|
200
|
-
* a local or preview build that has no release to compare with.
|
|
201
|
-
*/
|
|
202
173
|
currentVersion: string | null | undefined;
|
|
203
|
-
/** GitHub releases to read: the repository and the tag prefix before the version. Public repositories only. */
|
|
204
174
|
source?: GitHubReleaseSource;
|
|
205
|
-
/**
|
|
206
|
-
* Ask V Store for the newest version, used instead of `source`. It works
|
|
207
|
-
* for a private repository too. Without `vStore.downloadUrl`, Download is
|
|
208
|
-
* hidden unless `showDownload` says otherwise.
|
|
209
|
-
*/
|
|
210
175
|
vStore?: VStoreSource;
|
|
211
|
-
/** Your own check, used instead of `source` and `vStore`. Returns the update to offer, or null. */
|
|
212
176
|
check?: (currentVersion: string) => Promise<AvailableUpdate | null>;
|
|
213
|
-
/** `false` skips the check. Default `true`. */
|
|
214
177
|
enabled?: boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Remembers the version "Later" hid, so it is not offered again until a
|
|
217
|
-
* newer one is out. Without it, Later hides the prompt until the next start.
|
|
218
|
-
*/
|
|
219
178
|
storage?: UpdateDismissStorage;
|
|
220
|
-
/** Key in `storage`. Default `"updateDismissed"`. */
|
|
221
179
|
storageKey?: string;
|
|
222
180
|
onLater?: (update: AvailableUpdate) => void;
|
|
223
181
|
onDownload?: (update: AvailableUpdate) => void;
|
|
@@ -251,7 +209,6 @@ export function UpdateChecker({
|
|
|
251
209
|
...prompt
|
|
252
210
|
}: UpdateCheckerProps) {
|
|
253
211
|
const [update, setUpdate] = useState<AvailableUpdate | null>(null);
|
|
254
|
-
// The latest callbacks, so a new function each render does not check again.
|
|
255
212
|
const latest = useRef({ check, vStore, storage, storageKey });
|
|
256
213
|
useEffect(() => {
|
|
257
214
|
latest.current = { check, vStore, storage, storageKey };
|
|
@@ -262,7 +219,6 @@ export function UpdateChecker({
|
|
|
262
219
|
const hasCheck = check !== undefined;
|
|
263
220
|
const vStorePackage = vStore?.packageName;
|
|
264
221
|
const vStoreSite = vStore?.siteUrl;
|
|
265
|
-
// Without a download link, the update's link is the one that opens V Store.
|
|
266
222
|
const vStoreUrl = prompt.vStoreUrl ?? V_STORE_UPDATES_URL;
|
|
267
223
|
useEffect(() => {
|
|
268
224
|
if (!enabled || !currentVersion) return;
|
|
@@ -280,7 +236,6 @@ export function UpdateChecker({
|
|
|
280
236
|
const dismissed = store ? await readDismissed(store, key) : null;
|
|
281
237
|
if (!cancelled && dismissed !== found.version) setUpdate(found);
|
|
282
238
|
};
|
|
283
|
-
// A failed check must never get in the way of the app.
|
|
284
239
|
run().catch(() => undefined);
|
|
285
240
|
return () => {
|
|
286
241
|
cancelled = true;
|
|
@@ -296,7 +251,6 @@ export function UpdateChecker({
|
|
|
296
251
|
setUpdate(null);
|
|
297
252
|
const { storage: store, storageKey: key } = latest.current;
|
|
298
253
|
if (store) {
|
|
299
|
-
// A failed write only means the prompt returns at the next start.
|
|
300
254
|
Promise.resolve()
|
|
301
255
|
.then(() => store.setItem(key, current.version))
|
|
302
256
|
.catch(() => undefined);
|
|
@@ -31,9 +31,7 @@ export function freeTextAnswer(answer: string | undefined, chosen: readonly stri
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export type ActivityQuestionCardProps = {
|
|
34
|
-
/** The prompt's questions, as the agent asked them. */
|
|
35
34
|
questions: ActivityQuestion[];
|
|
36
|
-
/** The answers, keyed by question text (`ChoiceQuestion`'s `onSubmit` shape). */
|
|
37
35
|
answers?: Record<string, string>;
|
|
38
36
|
};
|
|
39
37
|
|
|
@@ -103,11 +101,6 @@ export function ActivityQuestionCard({ questions, answers }: ActivityQuestionCar
|
|
|
103
101
|
);
|
|
104
102
|
}
|
|
105
103
|
|
|
106
|
-
/**
|
|
107
|
-
* One option as recorded (web `OptionRow`): a 20 rounded mark (the letter, a
|
|
108
|
-
* check when picked, a pencil for "Other"), the label and its description.
|
|
109
|
-
* Picked: the row on the tertiary fill, the mark on primary, the label medium.
|
|
110
|
-
*/
|
|
111
104
|
function RecordRow({
|
|
112
105
|
mark,
|
|
113
106
|
label,
|
|
@@ -144,7 +137,6 @@ function RecordRow({
|
|
|
144
137
|
width: markSize,
|
|
145
138
|
height: markSize,
|
|
146
139
|
marginTop: 2,
|
|
147
|
-
// A small rounded square, as the web `rounded-md` mark.
|
|
148
140
|
borderRadius: 6,
|
|
149
141
|
alignItems: "center",
|
|
150
142
|
justifyContent: "center",
|
|
@@ -13,21 +13,16 @@ import { CodeBlock } from "./code-block";
|
|
|
13
13
|
export type ActivityStepDetailStep = {
|
|
14
14
|
type: string;
|
|
15
15
|
detail?: string;
|
|
16
|
-
/** Bash command, fuller than `detail`. */
|
|
17
16
|
command?: string;
|
|
18
17
|
output?: { text: string; exitCode?: number; truncated?: boolean };
|
|
19
18
|
edits?: ReadonlyArray<{ oldText: string; newText: string }>;
|
|
20
|
-
/** A written file's preview. */
|
|
21
19
|
contentPreview?: string;
|
|
22
|
-
/** The transcript copy dropped the output, edits or preview; the full step is still loading. */
|
|
23
20
|
hasHiddenDetail?: boolean;
|
|
24
21
|
};
|
|
25
22
|
|
|
26
23
|
export type ActivityStepDetailProps = {
|
|
27
24
|
step: ActivityStepDetailStep;
|
|
28
|
-
/** Copy button on the transcript and preview blocks (native-ui adds no clipboard). */
|
|
29
25
|
onCopy?: (text: string) => void | Promise<void>;
|
|
30
|
-
/** Default "Loading output...". */
|
|
31
26
|
loadingLabel?: string;
|
|
32
27
|
};
|
|
33
28
|
|
|
@@ -810,10 +810,6 @@ function joinCommandText(verb: string, target: string): string {
|
|
|
810
810
|
return `${verb} ${target}`;
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
/**
|
|
814
|
-
* Past-tense phrase used when a step type is folded into a group summary line.
|
|
815
|
-
* Deliberately plural/vague — the exact call is one click away in the fold.
|
|
816
|
-
*/
|
|
817
813
|
const GROUP_PHRASES: Record<ActivityStep["type"], string> = {
|
|
818
814
|
read: "read files",
|
|
819
815
|
edit: "edited files",
|
|
@@ -841,7 +837,6 @@ function groupPhraseForStep(step: ActivityStep): string {
|
|
|
841
837
|
if (step.type !== "tool") {
|
|
842
838
|
return GROUP_PHRASES[step.type];
|
|
843
839
|
}
|
|
844
|
-
// Codex reports edits as a `file_change` tool call, not an edit step.
|
|
845
840
|
if (isFileChangeTool(step)) {
|
|
846
841
|
return GROUP_PHRASES.edit;
|
|
847
842
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// Pure step types for the activity timeline: no React, so `@vvedantb/native-ui`
|
|
2
|
-
// keeps a byte-identical copy (`src/ai/activity-step-types.ts`), with the step
|
|
3
|
-
// labels and grouping that read them.
|
|
4
|
-
|
|
5
1
|
/** One item in a todo checklist step (type "todos"). */
|
|
6
2
|
export interface ActivityTodoItem {
|
|
7
3
|
content: string;
|
|
@@ -54,43 +50,23 @@ export interface ActivityStep {
|
|
|
54
50
|
| "notice"
|
|
55
51
|
| "hook"
|
|
56
52
|
| "status"
|
|
57
|
-
/** A queued user message the agent took into this live turn (Steer). */
|
|
58
53
|
| "steer";
|
|
59
54
|
label: string;
|
|
60
55
|
detail?: string;
|
|
61
|
-
/** Full, unshortened path for file-type steps. Powers the chat File Viewer. */
|
|
62
56
|
path?: string;
|
|
63
|
-
/** `pending`: a planned step that has not started (sandbox startup stages). */
|
|
64
57
|
status: "complete" | "active" | "pending";
|
|
65
|
-
/** The tool_use id that produced this step (Claude only). */
|
|
66
58
|
toolUseId?: string;
|
|
67
|
-
/** Parent `Agent` tool_use id — set on steps that ran inside a subagent. */
|
|
68
59
|
parentToolUseId?: string;
|
|
69
|
-
/** Todo checklist snapshot (type "todos" only). */
|
|
70
60
|
todos?: ActivityTodoItem[];
|
|
71
|
-
/** Bash command (fuller than detail, capped). */
|
|
72
61
|
command?: string;
|
|
73
|
-
/** Tool result transcript (tail-capped). */
|
|
74
62
|
output?: ActivityStepOutput;
|
|
75
|
-
/** Edit before/after snippets. */
|
|
76
63
|
edits?: ActivityStepEdit[];
|
|
77
|
-
/** Codex file_change paths. */
|
|
78
64
|
files?: string[];
|
|
79
|
-
/** Write tool content head preview. */
|
|
80
65
|
contentPreview?: string;
|
|
81
|
-
/** True when the tool failed or exited non-zero. */
|
|
82
66
|
isError?: boolean;
|
|
83
|
-
/** Wall time from push → complete (ms). */
|
|
84
67
|
durationMs?: number;
|
|
85
|
-
/** AskUserQuestion prompt (type "question" only): the questions and options shown to the user. */
|
|
86
68
|
questions?: ActivityQuestion[];
|
|
87
|
-
/** AskUserQuestion answers keyed by question text. Absent when the turn ended without a structured answer. */
|
|
88
69
|
answers?: Record<string, string>;
|
|
89
|
-
/**
|
|
90
|
-
* The transcript query stripped this step's expanded-only fields (`output`,
|
|
91
|
-
* `edits`, `contentPreview`) to keep the chat subscription small. The row
|
|
92
|
-
* still opens; the body fills in once the full payload is fetched.
|
|
93
|
-
*/
|
|
94
70
|
hasHiddenDetail?: boolean;
|
|
95
71
|
}
|
|
96
72
|
|
package/src/ai/activity-step.tsx
CHANGED
|
@@ -7,13 +7,9 @@ import { AgentTraceDescription, AgentTraceIcon, AgentTraceLine, AgentTraceTitle
|
|
|
7
7
|
export type ActivityStepStatus = "running" | "complete" | "error";
|
|
8
8
|
|
|
9
9
|
export type ActivityStepProps = {
|
|
10
|
-
/** What the AI is doing, such as "Searching the web" or "Reading 3 files". */
|
|
11
10
|
label: string;
|
|
12
|
-
/** The tool's icon. Without one, the line shows the status icon only. */
|
|
13
11
|
icon?: ComponentType<IconProps>;
|
|
14
|
-
/** `running` pulses the label and shows a spinner; `complete` a check; `error` a warning in the danger colour. Default `complete`. */
|
|
15
12
|
status?: ActivityStepStatus;
|
|
16
|
-
/** Faded detail after the label, such as "Worked for 12s" (see `formatElapsed`). */
|
|
17
13
|
description?: string;
|
|
18
14
|
testID?: string;
|
|
19
15
|
};
|
|
@@ -9,11 +9,6 @@ export interface ActivityRow {
|
|
|
9
9
|
children?: ActivityRow[];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Status-filler thinking labels emitted by older callback versions (and by
|
|
14
|
-
* prod until the current callback deploys). The response/reasoning text is
|
|
15
|
-
* shown directly, so these narration rows are pure noise — hide them.
|
|
16
|
-
*/
|
|
17
12
|
const LEGACY_NOISE_LABELS = new Set([
|
|
18
13
|
"Generating response...",
|
|
19
14
|
"Generated response",
|
|
@@ -22,10 +17,8 @@ const LEGACY_NOISE_LABELS = new Set([
|
|
|
22
17
|
"Finalizing response...",
|
|
23
18
|
]);
|
|
24
19
|
|
|
25
|
-
/** Thinking labels that mark model reasoning rather than status narration. */
|
|
26
20
|
const REASONING_LABELS = new Set(["Thinking...", "Thought"]);
|
|
27
21
|
|
|
28
|
-
/** Placeholder details older callbacks attached to reasoning-label steps. */
|
|
29
22
|
const FILLER_DETAILS = new Set([
|
|
30
23
|
"Claude is reasoning...",
|
|
31
24
|
"Codex is reasoning...",
|
|
@@ -51,7 +44,6 @@ export function normalizeStep(step: ActivityStep): ActivityStep | null {
|
|
|
51
44
|
return step;
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
/** Builds one row per normalized step (no consecutive-type merging). */
|
|
55
47
|
function stepsToRows(steps: ActivityStep[]): ActivityRow[] {
|
|
56
48
|
const rows: ActivityRow[] = [];
|
|
57
49
|
for (const raw of steps) {
|
|
@@ -62,10 +54,6 @@ function stepsToRows(steps: ActivityStep[]): ActivityRow[] {
|
|
|
62
54
|
return rows;
|
|
63
55
|
}
|
|
64
56
|
|
|
65
|
-
/**
|
|
66
|
-
* Row types that read as narration rather than work: they already summarise
|
|
67
|
-
* themselves, so folding them into an action group would hide their only text.
|
|
68
|
-
*/
|
|
69
57
|
const STANDALONE_TYPES = new Set<ActivityStep["type"]>([
|
|
70
58
|
"todos",
|
|
71
59
|
"notice",
|
|
@@ -95,7 +83,6 @@ export function groupActivityRows(rows: ActivityRow[]): ActivitySegment[] {
|
|
|
95
83
|
segments.push({ kind: "reasoning", step: row.step });
|
|
96
84
|
continue;
|
|
97
85
|
}
|
|
98
|
-
// Mid-turn reply text: it ends the tool run before it, like reasoning.
|
|
99
86
|
if (row.step.type === "response") {
|
|
100
87
|
segments.push({ kind: "response", step: row.step });
|
|
101
88
|
continue;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// The folded (Codex-style) rules of the web `ActivityTasks`
|
|
2
|
-
// (`@vvedantb/ui` `activity-tasks.tsx`), as pure logic for an app that draws
|
|
3
|
-
// the rows with the `AgentTrace` parts. The row text, the grouping and the
|
|
4
|
-
// step types are byte-identical copies of the web files
|
|
5
|
-
// (`activity-step-label.ts`, `activity-tasks-utils.ts`, `activity-step-types.ts`).
|
|
6
1
|
import type { ActivityRow, ActivitySegment } from "./activity-tasks-utils";
|
|
7
2
|
import { buildActivityRows, groupActivityRows } from "./activity-tasks-utils";
|
|
8
3
|
import type { ActivityStep } from "./activity-step-types";
|
|
@@ -13,7 +8,6 @@ export const ACTIVITY_MAX_VISIBLE_BLOCKS = 8;
|
|
|
13
8
|
/** Child rows a subagent step shows before "+N more" (web `MAX_VISIBLE_CHILDREN`). */
|
|
14
9
|
export const ACTIVITY_MAX_VISIBLE_CHILDREN = 8;
|
|
15
10
|
|
|
16
|
-
/** Step types the folded layout hides: the reply text and the status thinking lines. */
|
|
17
11
|
const HIDDEN_TYPES = new Set<ActivityStep["type"]>(["thinking", "response"]);
|
|
18
12
|
|
|
19
13
|
/**
|
package/src/ai/attachments.tsx
CHANGED
|
@@ -23,14 +23,10 @@ import { ResponseText } from "./response-text";
|
|
|
23
23
|
*/
|
|
24
24
|
export type AttachmentData = {
|
|
25
25
|
id: string;
|
|
26
|
-
/** `"source-document"` for a referenced source. Default a file. */
|
|
27
26
|
type?: "file" | "source-document";
|
|
28
27
|
filename?: string;
|
|
29
|
-
/** MIME type, such as `image/png`. */
|
|
30
28
|
mediaType?: string;
|
|
31
|
-
/** A local or remote URI. An image with one shows a thumbnail. */
|
|
32
29
|
url?: string;
|
|
33
|
-
/** A source document's title. */
|
|
34
30
|
title?: string;
|
|
35
31
|
};
|
|
36
32
|
|
|
@@ -86,14 +82,8 @@ export function Attachments({ variant = "inline", className, ...props }: Attachm
|
|
|
86
82
|
|
|
87
83
|
export type AttachmentProps = {
|
|
88
84
|
data: AttachmentData;
|
|
89
|
-
/** Shows a remove button, labelled "Remove" and the attachment name. */
|
|
90
85
|
onRemove?: () => void;
|
|
91
|
-
/**
|
|
92
|
-
* Makes the chip a button, such as to open the file. The remove button stays a
|
|
93
|
-
* separate target and does not call this. Without it the chip is not pressable.
|
|
94
|
-
*/
|
|
95
86
|
onPress?: () => void;
|
|
96
|
-
/** Names the chip button, with `onPress`. Default the attachment name (`getAttachmentLabel`). */
|
|
97
87
|
accessibilityLabel?: string;
|
|
98
88
|
testID?: string;
|
|
99
89
|
};
|
|
@@ -101,7 +91,6 @@ export type AttachmentProps = {
|
|
|
101
91
|
/** The hit target of a pressable chip, in points, on each axis. */
|
|
102
92
|
export const ATTACHMENT_PRESS_TARGET = 48;
|
|
103
93
|
|
|
104
|
-
/** A remove cross of 20 in a 32 row: the slop brings it to 44. */
|
|
105
94
|
const REMOVE_SIZE = 20;
|
|
106
95
|
|
|
107
96
|
/**
|
|
@@ -175,8 +164,6 @@ export function Attachment({ data, onRemove, onPress, accessibilityLabel, testID
|
|
|
175
164
|
<Pressable
|
|
176
165
|
accessibilityRole="button"
|
|
177
166
|
accessibilityLabel={`Remove ${label}`}
|
|
178
|
-
// A pressable label sits 6 before it, and the next chip 8 past this
|
|
179
|
-
// chip's edge: the slop stops short of both, so neither steals a tap.
|
|
180
167
|
hitSlop={{ ...touchSlop(REMOVE_SIZE), left: onPress ? 3 : touchSlop(REMOVE_SIZE).left, right: 8 }}
|
|
181
168
|
onPress={onRemove}
|
|
182
169
|
className="items-center justify-center rounded-full active:opacity-70"
|
|
@@ -19,16 +19,12 @@ import {
|
|
|
19
19
|
} from "./collapsible";
|
|
20
20
|
import { ResponseText } from "./response-text";
|
|
21
21
|
|
|
22
|
-
// The web `ChainOfThought`, simplified: a fold of steps with search-result
|
|
23
|
-
// chips. `ChainOfThoughtImage` and the step enter animation are not ported.
|
|
24
|
-
|
|
25
22
|
/** Holds its open state (default closed), or takes `open` and `onOpenChange`. */
|
|
26
23
|
export function ChainOfThought({ className, ...props }: CollapsibleProps) {
|
|
27
24
|
return <Collapsible className={cn("w-full gap-4", className)} {...props} />;
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
export type ChainOfThoughtHeaderProps = Omit<CollapsibleTriggerProps, "children"> & {
|
|
31
|
-
/** Default "Chain of Thought". A string, as it is also the accessibility label. */
|
|
32
28
|
children?: string;
|
|
33
29
|
icon?: ComponentType<IconProps>;
|
|
34
30
|
};
|
|
@@ -71,7 +67,6 @@ export type ChainOfThoughtStepProps = ViewProps & {
|
|
|
71
67
|
icon?: ComponentType<IconProps>;
|
|
72
68
|
label: string;
|
|
73
69
|
description?: string;
|
|
74
|
-
/** `active` is the foreground, `complete` muted, `pending` muted at half opacity, as on the web. Default `complete`. */
|
|
75
70
|
status?: ChainOfThoughtStepStatus;
|
|
76
71
|
className?: string;
|
|
77
72
|
children?: ReactNode;
|
|
@@ -5,9 +5,7 @@ import { cn } from "../cn";
|
|
|
5
5
|
export type ChatJumpRailItem = { id: string; label: string };
|
|
6
6
|
|
|
7
7
|
export type ChatJumpRailProps = {
|
|
8
|
-
/** The messages to jump between, such as the user messages of a long thread. */
|
|
9
8
|
items: ChatJumpRailItem[];
|
|
10
|
-
/** Called with the `id` of the pressed item. */
|
|
11
9
|
onJump: (id: string) => void;
|
|
12
10
|
className?: string;
|
|
13
11
|
testID?: string;
|
package/src/ai/chat-text.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/** Type and copy shared by the AI chat parts. */
|
|
2
1
|
import { Platform } from "react-native";
|
|
3
2
|
import type { TextSize } from "../controlStyles";
|
|
4
3
|
|
|
5
4
|
export type ChatTextKind = "body" | "small" | "caption";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
|
-
* `body` is message text: `text-
|
|
7
|
+
* `body` is message text: `text-base` (16 / 24), the phone body size.
|
|
9
8
|
* `small` is the secondary text of triggers, trace lines and sources: also
|
|
10
9
|
* `text-sm` (the web sources trigger is `text-xs`). `caption` is `text-xs`
|
|
11
10
|
* (12 / 16): step descriptions, file chips and code headers. Larger text
|
|
12
11
|
* steps each up, as `Textarea` does.
|
|
13
12
|
*/
|
|
14
13
|
export function chatTextSize(kind: ChatTextKind, largerText: boolean): TextSize {
|
|
15
|
-
if (kind === "body") return largerText ? "text-xl" : "text-
|
|
14
|
+
if (kind === "body") return largerText ? "text-xl" : "text-base";
|
|
16
15
|
if (kind === "small") return largerText ? "text-lg" : "text-sm";
|
|
17
16
|
return largerText ? "text-base" : "text-xs";
|
|
18
17
|
}
|