@vvedantb/native-ui 0.37.2 → 0.39.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/README.md +8 -7
- 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 +0 -1
- 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 +0 -8
- 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 +0 -27
- 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/app-root/AuthGroupGate.jsx +65 -0
- package/dist/app-root/SsoCallbackScreen.jsx +97 -0
- package/dist/app-root/fonts.js +88 -0
- package/dist/app-root/index.js +3 -0
- package/dist/auth/AuthScreen.jsx +250 -77
- package/dist/auth/GoogleSignInButton.jsx +0 -3
- package/dist/auth/SecondFactorScreen.jsx +18 -14
- package/dist/auth/SignInScreen.jsx +40 -34
- 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/LastCrashDialog.jsx +56 -0
- package/dist/crash/lastCrash.js +192 -0
- package/dist/entries/ai.js +0 -3
- package/dist/entries/ambient.js +0 -2
- package/dist/entries/app-root.js +1 -0
- 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 +2 -0
- 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 +4 -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 +4 -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 +158 -0
- package/dist/pagerSwipe.js +0 -16
- package/dist/palette.js +0 -10
- package/dist/primitives/button.jsx +0 -5
- package/dist/primitives/icon.jsx +0 -4
- 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 -10
- 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 +2 -9
- 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 +62 -0
- package/dist/themeModes.js +9 -0
- 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 +47 -19
- 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 +0 -1
- 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 +0 -17
- 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 +0 -97
- 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 +38 -0
- package/src/app-root/SsoCallbackScreen.tsx +52 -0
- package/src/app-root/fonts.ts +53 -0
- package/src/app-root/index.ts +6 -0
- package/src/auth/AccountScreens.tsx +0 -16
- package/src/auth/AuthProviders.tsx +0 -13
- package/src/auth/AuthScreen.tsx +95 -6
- package/src/auth/GoogleSignInButton.tsx +0 -12
- package/src/auth/SecondFactorScreen.tsx +17 -15
- package/src/auth/SignInScreen.tsx +103 -105
- 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 +36 -0
- package/src/crash/lastCrash.ts +218 -0
- package/src/entries/ai.ts +0 -3
- package/src/entries/ambient.ts +0 -2
- package/src/entries/app-root.ts +1 -0
- 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 +13 -0
- 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 +8 -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 +1 -21
- package/src/index.ts +7 -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 +127 -0
- 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/icon.tsx +0 -2
- 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 -18
- 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 +2 -16
- 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 +85 -0
- package/src/themeModes.ts +10 -0
- 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/types/prism-react-renderer.d.ts +22 -0
package/src/FloatingTabBar.tsx
CHANGED
|
@@ -17,13 +17,8 @@ import { useScheme } from "./useScheme";
|
|
|
17
17
|
import { FLOATING_PILL_RADIUS, tabBarHeight, tabBarSlotStyle } from "./floating";
|
|
18
18
|
import { usePressed } from "./usePressed";
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Space between the bar edge and the tabs, on every side of the active pill,
|
|
22
|
-
* in points. The same all round, so the pill follows the bar's curve.
|
|
23
|
-
*/
|
|
24
20
|
const TAB_BAR_PADDING = 4;
|
|
25
21
|
|
|
26
|
-
/** The web `--tabs-dur` (200ms) and `--tabs-ease` (`tokens.css`). */
|
|
27
22
|
const PILL_SLIDE = { duration: 200, easing: Easing.bezier(0.22, 1, 0.36, 1) };
|
|
28
23
|
|
|
29
24
|
/**
|
|
@@ -72,7 +67,6 @@ export function FloatingTabBar({
|
|
|
72
67
|
if (focusedRoute && isTabBarHidden(descriptors[focusedRoute.key]?.options)) {
|
|
73
68
|
return null;
|
|
74
69
|
}
|
|
75
|
-
// The pill counts only the tabs drawn. No pill while a hidden route is focused.
|
|
76
70
|
const visible = state.routes.filter((route) =>
|
|
77
71
|
isTabBarRouteVisible(descriptors[route.key]?.options),
|
|
78
72
|
);
|
|
@@ -81,7 +75,6 @@ export function FloatingTabBar({
|
|
|
81
75
|
return (
|
|
82
76
|
<View
|
|
83
77
|
pointerEvents="box-none"
|
|
84
|
-
// Inside the home indicator and, in landscape, the notch.
|
|
85
78
|
style={tabBarSlotStyle(insets)}
|
|
86
79
|
>
|
|
87
80
|
<FloatingSurface radius={FLOATING_PILL_RADIUS}>
|
|
@@ -98,7 +91,6 @@ export function FloatingTabBar({
|
|
|
98
91
|
if (!isTabBarRouteVisible(options)) {
|
|
99
92
|
return null;
|
|
100
93
|
}
|
|
101
|
-
// `index` counts hidden routes too, as `state.index` does.
|
|
102
94
|
const focused = state.index === index;
|
|
103
95
|
const label =
|
|
104
96
|
typeof options.tabBarLabel === "string"
|
|
@@ -146,12 +138,6 @@ type TabBarItemProps = {
|
|
|
146
138
|
accessibilityLabel: string;
|
|
147
139
|
};
|
|
148
140
|
|
|
149
|
-
/**
|
|
150
|
-
* One tab. React Compiler (the package build) memoises it, so a switch
|
|
151
|
-
* renders only the two tabs whose focus changed. Its props are stable between
|
|
152
|
-
* switches: `route`, `emitter` and `navigateToTab` keep their identity, and
|
|
153
|
-
* `tabBarIcon` is the caller's function.
|
|
154
|
-
*/
|
|
155
141
|
function TabBarItem({
|
|
156
142
|
route,
|
|
157
143
|
emitter,
|
|
@@ -192,8 +178,6 @@ function TabBarItem({
|
|
|
192
178
|
{renderIcon ? renderIcon({ focused, color, size: largerText ? 28 : 24 }) : null}
|
|
193
179
|
<Text
|
|
194
180
|
numberOfLines={1}
|
|
195
|
-
// The bar has a fixed height (`tabBarReserve`), so labels
|
|
196
|
-
// scale with Dynamic Type only up to what fits in it.
|
|
197
181
|
maxFontSizeMultiplier={1.5}
|
|
198
182
|
className={`font-instrument-sans-medium ${largerText ? "text-base" : "text-sm"}`}
|
|
199
183
|
style={[{ color }, typeStyle("medium")]}
|
|
@@ -204,15 +188,6 @@ function TabBarItem({
|
|
|
204
188
|
);
|
|
205
189
|
}
|
|
206
190
|
|
|
207
|
-
/**
|
|
208
|
-
* The pill behind tab `index` of `count` drawn tabs: one tab wide (they share
|
|
209
|
-
* the row equally), `TAB_BAR_PADDING` inside the bar, in
|
|
210
|
-
* `floatingTabPillColors` (the muted `--default` in light, `--segment` in
|
|
211
|
-
* dark, so it shows on the glass bar) and the `TabsTrigger` pills outline.
|
|
212
|
-
* It slides to a newly focused tab, as the web segmented pill does,
|
|
213
|
-
* and moves at once with Reduce Motion. Behind the tablist, so assistive tech
|
|
214
|
-
* reads only the tabs.
|
|
215
|
-
*/
|
|
216
191
|
function ActiveTabPill({ index, count }: { index: number; count: number }) {
|
|
217
192
|
const scheme = useScheme();
|
|
218
193
|
const reduceMotion = useReduceMotion();
|
package/src/IconButton.tsx
CHANGED
|
@@ -13,20 +13,15 @@ export type IconButtonSize = "sm" | "md" | "lg";
|
|
|
13
13
|
|
|
14
14
|
export type IconButtonProps = {
|
|
15
15
|
icon: ComponentType<IconProps>;
|
|
16
|
-
/** Names the button for VoiceOver and TalkBack; it has no text. */
|
|
17
16
|
label: string;
|
|
18
17
|
onPress?: () => void;
|
|
19
18
|
disabled?: boolean;
|
|
20
|
-
/** `overlay` is for camera chrome over a live preview. Default `default`. */
|
|
21
19
|
variant?: IconButtonVariant;
|
|
22
|
-
/** `sm` 32, `md` 40, `lg` 48 across. Default `md`. */
|
|
23
20
|
size?: IconButtonSize;
|
|
24
21
|
testID?: string;
|
|
25
|
-
/** Default: the foreground in `default`, white in `overlay`. */
|
|
26
22
|
iconColor?: string;
|
|
27
23
|
};
|
|
28
24
|
|
|
29
|
-
/** Diameter and icon size per size, a step up with larger text. */
|
|
30
25
|
const METRICS = {
|
|
31
26
|
regular: { sm: [32, 16], md: [40, 20], lg: [48, 24] },
|
|
32
27
|
larger: { sm: [44, 20], md: [48, 24], lg: [56, 28] },
|
package/src/Input.tsx
CHANGED
|
@@ -21,7 +21,6 @@ const Input = React.forwardRef<
|
|
|
21
21
|
ref={ref}
|
|
22
22
|
placeholderTextColor={placeholderTextColor ?? palette.fieldPlaceholder[scheme]}
|
|
23
23
|
className={cn(
|
|
24
|
-
// The web field px-3.5 py-2 with 16 px type (its phone size), 44 high (the web h-10 is a desktop 40).
|
|
25
24
|
"min-h-11 border px-3.5 py-2 text-base font-instrument-sans",
|
|
26
25
|
largerText && "min-h-16 px-4 py-4 text-xl font-instrument-sans-medium",
|
|
27
26
|
className,
|
package/src/Label.tsx
CHANGED
package/src/LabeledSwitchRow.tsx
CHANGED
|
@@ -13,7 +13,6 @@ export type LabeledSwitchRowProps = {
|
|
|
13
13
|
onCheckedChange?: (checked: boolean) => void;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
icon?: ReactNode;
|
|
16
|
-
/** Replaces the switch. */
|
|
17
16
|
trailing?: ReactNode;
|
|
18
17
|
className?: string;
|
|
19
18
|
testID?: string;
|
|
@@ -78,7 +77,6 @@ export function LabeledSwitchRow({
|
|
|
78
77
|
</View>
|
|
79
78
|
</Pressable>
|
|
80
79
|
{trailing ?? (
|
|
81
|
-
// The row above is the accessible switch, so this one is hidden from assistive tech.
|
|
82
80
|
<View
|
|
83
81
|
accessibilityElementsHidden
|
|
84
82
|
importantForAccessibility="no-hide-descendants"
|
package/src/ListRow.tsx
CHANGED
|
@@ -15,23 +15,14 @@ export type ListRowProps = {
|
|
|
15
15
|
detail?: ReactNode;
|
|
16
16
|
icon?: ComponentType<IconProps>;
|
|
17
17
|
iconColor?: string;
|
|
18
|
-
/** Any node at the start, such as an `Avatar` with an unread dot. Shown in place of `icon`. */
|
|
19
18
|
leading?: ReactNode;
|
|
20
|
-
/** At the end of the title line, such as a `Badge` or a time. The title is cut off first. */
|
|
21
19
|
titleEnd?: ReactNode;
|
|
22
|
-
/** At the end of the row, inside the pressable area. */
|
|
23
20
|
right?: ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* At the end of the row, outside the pressable area, such as a `Switch`:
|
|
26
|
-
* pressing it does not call `onPress`.
|
|
27
|
-
*/
|
|
28
21
|
control?: ReactNode;
|
|
29
22
|
onPress?: () => void;
|
|
30
23
|
onLongPress?: () => void;
|
|
31
|
-
/** Names the pressable row. Default `title`. */
|
|
32
24
|
accessibilityLabel?: string;
|
|
33
25
|
onCanvas?: boolean;
|
|
34
|
-
/** On the pressable area when there is a `control`, so a test can press it. */
|
|
35
26
|
testID?: string;
|
|
36
27
|
};
|
|
37
28
|
|
|
@@ -107,15 +98,12 @@ export function ListRow({
|
|
|
107
98
|
const pressable = Boolean(onPress || onLongPress);
|
|
108
99
|
const height = largerText ? "min-h-[72px]" : "min-h-16";
|
|
109
100
|
const paddingY = largerText ? "py-4" : "py-3";
|
|
110
|
-
// The fill is a style: an app theme that nests `dark` under `surface` keeps
|
|
111
|
-
// `bg-surface` and `bg-surface-secondary` light in dark mode.
|
|
112
101
|
const rowStyle = {
|
|
113
102
|
backgroundColor: tokens.color[onCanvas ? "surface" : "surfaceSecondary"][scheme],
|
|
114
103
|
borderRadius: FLOATING_ROW_RADIUS,
|
|
115
104
|
};
|
|
116
105
|
|
|
117
106
|
if (control != null) {
|
|
118
|
-
// The control is a sibling of the pressable area, so its presses stay its own.
|
|
119
107
|
const bodyClassName = cn("min-w-0 flex-1 flex-row items-center gap-3 self-stretch pl-4 pr-3", paddingY);
|
|
120
108
|
return (
|
|
121
109
|
<View className={cn("flex-row items-center", height)} style={rowStyle}>
|
package/src/LoadingState.tsx
CHANGED
|
@@ -19,18 +19,10 @@ import { useScheme } from "./useScheme";
|
|
|
19
19
|
export type { LoadingStateSize } from "./loadingGrid";
|
|
20
20
|
|
|
21
21
|
export type LoadingStateProps = {
|
|
22
|
-
/** What is running, for assistive tech. Default `"Working"`, as the web. */
|
|
23
22
|
label?: string;
|
|
24
|
-
/** `sm` is the web session-row grid (3 pt cells, 11 pt). Default `"default"` (4 pt cells, 15 pt). */
|
|
25
23
|
size?: LoadingStateSize;
|
|
26
|
-
/** Cell colour. Default the muted text colour. Native has no `currentColor`. */
|
|
27
24
|
color?: string;
|
|
28
|
-
/**
|
|
29
|
-
* One colour per column, left to right, as the web `LoadingState` `colors`
|
|
30
|
-
* (Eva's brand purple-to-blue sweep). Wins over `color`.
|
|
31
|
-
*/
|
|
32
25
|
colors?: readonly [string, string, string];
|
|
33
|
-
/** Hold a still frame, for example while the screen is not focused. Default `false`. */
|
|
34
26
|
paused?: boolean;
|
|
35
27
|
};
|
|
36
28
|
|
|
@@ -66,10 +58,8 @@ export function LoadingState({ label = "Working", size = "default", color, color
|
|
|
66
58
|
);
|
|
67
59
|
}
|
|
68
60
|
|
|
69
|
-
/** Column colours, left to right. */
|
|
70
61
|
type Fills = readonly [string, string, string];
|
|
71
62
|
|
|
72
|
-
/** Owns the clock, so unmounting it (Reduce Motion, `paused`) stops the frame callback. */
|
|
73
63
|
function RunningDriveGrid({ size, fill }: { size: LoadingStateSize; fill: Fills }) {
|
|
74
64
|
const elapsed = useSharedValue(0);
|
|
75
65
|
useFrameCallback((frame) => {
|
|
@@ -79,7 +69,6 @@ function RunningDriveGrid({ size, fill }: { size: LoadingStateSize; fill: Fills
|
|
|
79
69
|
return <DriveGrid size={size} fill={fill} elapsed={elapsed} />;
|
|
80
70
|
}
|
|
81
71
|
|
|
82
|
-
/** The nine cells. No `elapsed`: the still frame. */
|
|
83
72
|
function DriveGrid({
|
|
84
73
|
size,
|
|
85
74
|
fill,
|
|
@@ -90,7 +79,6 @@ function DriveGrid({
|
|
|
90
79
|
elapsed: SharedValue<number> | undefined;
|
|
91
80
|
}) {
|
|
92
81
|
const { gap } = DRIVE_SIZES[size];
|
|
93
|
-
// Three explicit rows, not a wrapping row: a fractional gap could wrap early.
|
|
94
82
|
return (
|
|
95
83
|
<View style={{ gap }}>
|
|
96
84
|
{[0, 1, 2].map((row) => (
|
package/src/MenuSheet.tsx
CHANGED
|
@@ -10,7 +10,6 @@ export type MenuSheetProps = {
|
|
|
10
10
|
open: boolean;
|
|
11
11
|
onOpenChange: (open: boolean) => void;
|
|
12
12
|
title: string;
|
|
13
|
-
/** Set on a submenu page: the header gets a 44 back button to the root page. */
|
|
14
13
|
onBack?: () => void;
|
|
15
14
|
children: ReactNode;
|
|
16
15
|
testID?: string;
|
|
@@ -50,7 +49,6 @@ export function MenuSheet({ open, onOpenChange, title, onBack, children, testID
|
|
|
50
49
|
|
|
51
50
|
export type SubmenuRowProps = {
|
|
52
51
|
icon?: ComponentType<IconProps>;
|
|
53
|
-
/** At the start in place of `icon`, such as a coloured status mark. */
|
|
54
52
|
leading?: ReactNode;
|
|
55
53
|
title: string;
|
|
56
54
|
detail?: string;
|
package/src/PageIndicator.tsx
CHANGED
|
@@ -7,9 +7,7 @@ import { useScheme } from "./useScheme";
|
|
|
7
7
|
|
|
8
8
|
export type PageIndicatorProps = {
|
|
9
9
|
count: number;
|
|
10
|
-
/** The current page, from 0. */
|
|
11
10
|
index: number;
|
|
12
|
-
/** Makes each dot a button that calls this with its page. */
|
|
13
11
|
onChange?: (index: number) => void;
|
|
14
12
|
testID?: string;
|
|
15
13
|
};
|
package/src/PageTitle.tsx
CHANGED
|
@@ -33,26 +33,11 @@ export function PageTitle({ className, style, ...props }: PageTitleProps) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export type PageHeaderProps = Omit<ViewProps, "children"> & {
|
|
36
|
-
/** The page title, drawn with `PageTitle`. */
|
|
37
36
|
title: string;
|
|
38
|
-
/**
|
|
39
|
-
* Content before the title, such as a close `HeaderIconButton` while the
|
|
40
|
-
* page is in select mode (Android's contextual action bar). It keeps its width.
|
|
41
|
-
*/
|
|
42
37
|
leading?: ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Content at the end of the row, such as an "Update all" `Button` (pass it
|
|
45
|
-
* `fullWidth={false}`). It keeps its width; a long title is cut off instead.
|
|
46
|
-
*/
|
|
47
38
|
action?: ReactNode;
|
|
48
|
-
/**
|
|
49
|
-
* Pad the top by the safe-area inset. Default `true`, for a header at the top
|
|
50
|
-
* of a screen with no navigation header. Pass `false` under a native header
|
|
51
|
-
* or inside a view that already pads the inset.
|
|
52
|
-
*/
|
|
53
39
|
safeTop?: boolean;
|
|
54
40
|
className?: string;
|
|
55
|
-
/** Classes on the title. */
|
|
56
41
|
titleClassName?: string;
|
|
57
42
|
};
|
|
58
43
|
|
package/src/Pager.tsx
CHANGED
|
@@ -3,18 +3,10 @@ import { View } from "react-native";
|
|
|
3
3
|
import type { SharedValue } from "react-native-reanimated";
|
|
4
4
|
|
|
5
5
|
export type PagerProps = {
|
|
6
|
-
/** The page shown, from 0. A change from outside (a tab press, a link) slides there in 220 ms, through the pages between (at once with Reduce Motion, and without the swipe). */
|
|
7
6
|
index: number;
|
|
8
7
|
count: number;
|
|
9
|
-
/** A swipe settled on another page. Set `index` to it. */
|
|
10
8
|
onIndexChange: (index: number) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Where the pages are, in pages (1.5 is halfway between the second and the
|
|
13
|
-
* third). Create it with `useSharedValue(index)` and pass the same value to
|
|
14
|
-
* `PillTabs` (`progress`), so its indicator moves with the pages.
|
|
15
|
-
*/
|
|
16
9
|
progress: SharedValue<number>;
|
|
17
|
-
/** Draws one page. A page is drawn once visited or once a swipe could reach it, and then stays, so it keeps its state. */
|
|
18
10
|
renderPage: (index: number) => ReactNode;
|
|
19
11
|
};
|
|
20
12
|
|
|
@@ -50,7 +42,6 @@ export function Pager(props: PagerProps) {
|
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
function StaticPager({ index, progress, renderPage }: PagerProps) {
|
|
53
|
-
// The linked indicator follows a page set from outside. An effect: a shared value is never written in render.
|
|
54
45
|
useEffect(() => {
|
|
55
46
|
progress.set(index);
|
|
56
47
|
}, [index, progress]);
|
package/src/PasswordInput.tsx
CHANGED
|
@@ -9,30 +9,15 @@ import { useLargerText } from "./theme";
|
|
|
9
9
|
import { useScheme } from "./useScheme";
|
|
10
10
|
|
|
11
11
|
type PasswordInputProps = Omit<React.ComponentPropsWithoutRef<typeof Input>, "secureTextEntry"> & {
|
|
12
|
-
/** Classes for the `View` around the field and the toggle. */
|
|
13
12
|
wrapperClassName?: string;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
|
-
/** Toggle metrics: painted 24 (32 with larger text), 44 with its hit slop. */
|
|
17
15
|
function passwordToggleSize(largerText: boolean) {
|
|
18
16
|
return largerText
|
|
19
17
|
? ({ button: 32, icon: 20, right: 12, paddingRight: 56 } as const)
|
|
20
18
|
: ({ button: 24, icon: 18, right: 8, paddingRight: 44 } as const);
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
/**
|
|
24
|
-
* `Input` for a password, with a show/hide eye button at the end. The text is
|
|
25
|
-
* hidden at first. The toggle flips `secureTextEntry` on the same mounted
|
|
26
|
-
* field, so focus and the cursor stay where they were. The `secureTextEntry`
|
|
27
|
-
* prop is not accepted: the toggle owns it. Every other `Input` prop, `ref`
|
|
28
|
-
* and `testID` pass through. The toggle is labelled "Show password" while the
|
|
29
|
-
* text is hidden and "Hide password" while it shows, has the test ID
|
|
30
|
-
* `${testID}-toggle` (`password-input-toggle` without a `testID`), is painted
|
|
31
|
-
* at 24 and reaches 44 with its hit slop (`touchSlop`). It is hidden when the
|
|
32
|
-
* field is not editable. Inside a `ScrollView`, set
|
|
33
|
-
* `keyboardShouldPersistTaps="handled"` so the first tap toggles while the
|
|
34
|
-
* keyboard is up.
|
|
35
|
-
*/
|
|
36
21
|
const PasswordInput = React.forwardRef<
|
|
37
22
|
React.ElementRef<typeof Input>,
|
|
38
23
|
PasswordInputProps
|
|
@@ -49,20 +34,12 @@ const PasswordInput = React.forwardRef<
|
|
|
49
34
|
{...props}
|
|
50
35
|
ref={ref}
|
|
51
36
|
testID={testID}
|
|
52
|
-
// The same size and font classes as `Input`, so the field has the same
|
|
53
|
-
// height and type. `Input` adds them too; `cn` merges the repeat.
|
|
54
|
-
// The type comes from these classes only (no style `fontSize`), so it
|
|
55
|
-
// cannot diverge from NativeWind's `text-base` / `text-xl`.
|
|
56
37
|
className={cn(
|
|
57
38
|
"min-h-11 border px-3.5 py-2 text-base font-instrument-sans",
|
|
58
39
|
largerText && "min-h-16 px-4 py-4 text-xl font-instrument-sans-medium",
|
|
59
40
|
className,
|
|
60
41
|
)}
|
|
61
|
-
// After the spread, so a caller cannot fight the toggle.
|
|
62
42
|
secureTextEntry={!visible}
|
|
63
|
-
// The `Input` styles. `fontSize` and `lineHeight` are not set: the field
|
|
64
|
-
// inherits `Input`'s type through the same className. Then room for the
|
|
65
|
-
// toggle, so text does not run under it.
|
|
66
43
|
style={[
|
|
67
44
|
fieldStyle(scheme),
|
|
68
45
|
fieldTextStyle(scheme),
|
|
@@ -86,7 +63,6 @@ const PasswordInput = React.forwardRef<
|
|
|
86
63
|
className="items-center justify-center rounded-md active:opacity-70"
|
|
87
64
|
style={{ width: metrics.button, height: metrics.button }}
|
|
88
65
|
>
|
|
89
|
-
{/* `strokeWidth`, not `stroke`: here `stroke` is the colour. */}
|
|
90
66
|
<Icon size={metrics.icon} color={muted} strokeWidth={1.75} />
|
|
91
67
|
</Pressable>
|
|
92
68
|
</View>
|
package/src/PillTabs.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from "./controlStyles";
|
|
18
18
|
import { centredTabScroll } from "./pagerSwipe";
|
|
19
19
|
import { useTabIndicator, useTabLabelStyle } from "./tabIndicator";
|
|
20
|
+
import { useGlass } from "./glass";
|
|
20
21
|
import { useLargerText } from "./theme";
|
|
21
22
|
import { useScheme } from "./useScheme";
|
|
22
23
|
|
|
@@ -41,11 +42,11 @@ export function PillTabs<T extends string>({
|
|
|
41
42
|
options: ReadonlyArray<{ id: T; label: string; testID?: string }>;
|
|
42
43
|
value: T;
|
|
43
44
|
onChange: (id: T) => void;
|
|
44
|
-
/** Where the linked `Pager` is, in pages: option 0 is page 0. */
|
|
45
45
|
progress?: SharedValue<number>;
|
|
46
46
|
}) {
|
|
47
47
|
const largerText = useLargerText();
|
|
48
48
|
const scheme = useScheme();
|
|
49
|
+
const glass = useGlass("control");
|
|
49
50
|
const trigger = tabTriggerSize("pills", "default", largerText);
|
|
50
51
|
const slop = touchSlop(MIN_TOUCH_TARGET, trigger.minHeight);
|
|
51
52
|
const indicator = useTabIndicator(progress, options.length);
|
|
@@ -53,8 +54,6 @@ export function PillTabs<T extends string>({
|
|
|
53
54
|
const selectedIndex = Math.max(0, options.findIndex((tab) => tab.id === value));
|
|
54
55
|
const scroll = useAnimatedRef<Animated.ScrollView>();
|
|
55
56
|
const viewport = useSharedValue(0);
|
|
56
|
-
// Keeps the active pill centred: with `progress` it follows the pages frame
|
|
57
|
-
// by frame (a swipe, or a press's slide), else it moves with `value`.
|
|
58
57
|
useAnimatedReaction(
|
|
59
58
|
() => (progress ? progress.get() : selectedIndex),
|
|
60
59
|
(at) => {
|
|
@@ -69,23 +68,18 @@ export function PillTabs<T extends string>({
|
|
|
69
68
|
horizontal
|
|
70
69
|
accessibilityRole="tablist"
|
|
71
70
|
showsHorizontalScrollIndicator={false}
|
|
72
|
-
// Android fades the pills out at an edge that scrolls.
|
|
73
71
|
fadingEdgeLength={16}
|
|
74
72
|
onLayout={(event) => viewport.set(event.nativeEvent.layout.width)}
|
|
75
|
-
// The slop above and below lies inside the row, where touches land; the
|
|
76
|
-
// negative margins keep the row's place in the layout.
|
|
77
73
|
style={{ flexGrow: 0, marginVertical: -slop.top }}
|
|
78
|
-
// The web pills' `gap-1.5`, as a style: the animated scroll view drops `contentContainerClassName`.
|
|
79
74
|
contentContainerStyle={{ flexDirection: "row", gap: 6, paddingVertical: slop.top }}
|
|
80
75
|
>
|
|
81
76
|
{indicator.measured ? (
|
|
82
|
-
// The selected fill, absolutely placed with no children: animating its
|
|
83
|
-
// width keeps the pill's radius, and lays out nothing else.
|
|
84
77
|
<Animated.View
|
|
85
78
|
pointerEvents="none"
|
|
86
79
|
style={[
|
|
87
80
|
{ position: "absolute", left: 0, borderRadius: 9999 },
|
|
88
81
|
{ backgroundColor: tabColors("pills", true, scheme).backgroundColor },
|
|
82
|
+
glass,
|
|
89
83
|
indicator.style,
|
|
90
84
|
]}
|
|
91
85
|
/>
|
|
@@ -97,7 +91,6 @@ export function PillTabs<T extends string>({
|
|
|
97
91
|
testID={tab.testID}
|
|
98
92
|
index={index}
|
|
99
93
|
selected={value === tab.id}
|
|
100
|
-
// Until the indicator is measured, the selected pill paints its own fill.
|
|
101
94
|
filled={!indicator.measured}
|
|
102
95
|
progress={progress}
|
|
103
96
|
trigger={trigger}
|
|
@@ -147,7 +140,6 @@ function PillTab({
|
|
|
147
140
|
accessibilityLabel={label}
|
|
148
141
|
onLayout={onLayout}
|
|
149
142
|
onPress={() => {
|
|
150
|
-
// A segmented choice ticking to a new value, as `TabsTrigger`.
|
|
151
143
|
if (!selected) selectionHaptic();
|
|
152
144
|
onPress();
|
|
153
145
|
}}
|
package/src/PinnedBotTile.tsx
CHANGED
|
@@ -9,16 +9,11 @@ import { useLargerText } from "./theme";
|
|
|
9
9
|
import { useScheme } from "./useScheme";
|
|
10
10
|
|
|
11
11
|
export type PinnedBotTileProps = {
|
|
12
|
-
/** The bot name, under the avatar. Up to two lines. */
|
|
13
12
|
title: string;
|
|
14
|
-
/** The avatar, above the name. */
|
|
15
13
|
leading: ReactNode;
|
|
16
|
-
/** Shows an unread dot at the top start and adds "unread" to the label. */
|
|
17
14
|
unread?: boolean;
|
|
18
|
-
/** Shows a spinner at the top end and adds "generating" to the label. It can show with the unread dot. */
|
|
19
15
|
generating?: boolean;
|
|
20
16
|
onPress: () => void;
|
|
21
|
-
/** Opens actions on a long press. */
|
|
22
17
|
onLongPress?: () => void;
|
|
23
18
|
testID?: string;
|
|
24
19
|
};
|
|
@@ -69,7 +64,6 @@ export function PinnedBotTile({ title, leading, unread = false, generating = fal
|
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
export type BotPinGridProps = ViewProps & {
|
|
72
|
-
/** `PinnedBotTile`s. */
|
|
73
67
|
children?: ReactNode;
|
|
74
68
|
className?: string;
|
|
75
69
|
};
|
package/src/Progress.tsx
CHANGED
|
@@ -13,11 +13,8 @@ import { useReduceMotion } from "./useReduceMotion";
|
|
|
13
13
|
import { useScheme } from "./useScheme";
|
|
14
14
|
|
|
15
15
|
export type ProgressProps = ViewProps & {
|
|
16
|
-
/** Current value, 0 to `max`. Default 0. */
|
|
17
16
|
value?: number | null;
|
|
18
|
-
/** Default 100. */
|
|
19
17
|
max?: number;
|
|
20
|
-
/** Indicator fill. Default the theme accent. */
|
|
21
18
|
indicatorColor?: string;
|
|
22
19
|
className?: string;
|
|
23
20
|
};
|
package/src/ReactionRow.tsx
CHANGED
|
@@ -8,22 +8,14 @@ export type ReactionRowItem = {
|
|
|
8
8
|
key: string;
|
|
9
9
|
label: string;
|
|
10
10
|
selected?: boolean;
|
|
11
|
-
/** The content, given whether it is on, so an icon can switch to its filled form or colour. */
|
|
12
11
|
render: (selected: boolean) => ReactNode;
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
export type ReactionRowProps = {
|
|
16
15
|
items: readonly ReactionRowItem[];
|
|
17
16
|
onPress: (key: string) => void;
|
|
18
|
-
/**
|
|
19
|
-
* How an item that is on looks. `"tint"` (default): the primary at 12%,
|
|
20
|
-
* for emoji, which a dark fill would hide. `"solid"`: the primary fill,
|
|
21
|
-
* for icons, whose colour the caller sets with `render`.
|
|
22
|
-
*/
|
|
23
17
|
selectedStyle?: "tint" | "solid";
|
|
24
|
-
/** `"spread"` (default) shares the width, as a reaction bar; `"start"` packs them at the start. */
|
|
25
18
|
layout?: "spread" | "start";
|
|
26
|
-
/** After the items: a round button with the same look, such as "More reactions". */
|
|
27
19
|
trailing?: { label: string; icon: ReactNode; onPress: () => void };
|
|
28
20
|
};
|
|
29
21
|
|
package/src/ScreenContainer.tsx
CHANGED
|
@@ -13,11 +13,8 @@ export interface ScreenContainerProps extends ViewProps {
|
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
reserveTabBar?: boolean;
|
|
15
15
|
footer?: React.ReactNode;
|
|
16
|
-
/** Shows the pull-to-refresh spinner while true. Controlled: no timer, no minimum duration. */
|
|
17
16
|
refreshing?: boolean;
|
|
18
|
-
/** Called on pull. May return a promise. Adds a `RefreshControl` tinted with the accent colour. */
|
|
19
17
|
onRefresh?: () => void | Promise<void>;
|
|
20
|
-
/** Full control. Takes precedence over `refreshing` and `onRefresh`. */
|
|
21
18
|
refreshControl?: React.ReactElement<RefreshControlProps>;
|
|
22
19
|
}
|
|
23
20
|
|
|
@@ -36,7 +33,6 @@ export function ScreenContainer({
|
|
|
36
33
|
const bottomPad = reserveTabBar
|
|
37
34
|
? tabBarReserve(largerText, insets.bottom)
|
|
38
35
|
: 40;
|
|
39
|
-
// No control unless the app asks for one.
|
|
40
36
|
const control =
|
|
41
37
|
refreshControl ??
|
|
42
38
|
(onRefresh ? (
|
package/src/SearchInput.tsx
CHANGED
|
@@ -24,19 +24,12 @@ type SearchInputProps = Omit<
|
|
|
24
24
|
"value" | "onChange" | "onChangeText"
|
|
25
25
|
> & {
|
|
26
26
|
value: string;
|
|
27
|
-
/** Called with the new text, as the web `onChange(value)`. */
|
|
28
27
|
onChange: (value: string) => void;
|
|
29
|
-
/** Accessibility label, and the placeholder when `placeholder` is not set. Default `"Search"`. */
|
|
30
28
|
label?: string;
|
|
31
|
-
/** `sm` is 32 high (web `h-8`), `md` is 40 (web `h-10`), border included. Default `"sm"`. */
|
|
32
29
|
size?: SearchInputSize;
|
|
33
|
-
/** Called after `onChange` whenever the value becomes empty (typed away or cleared). */
|
|
34
30
|
onClear?: () => void;
|
|
35
|
-
/** Accessibility label of the clear button. Default `"Clear search"`. */
|
|
36
31
|
clearLabel?: string;
|
|
37
|
-
/** Classes for the field. */
|
|
38
32
|
className?: string;
|
|
39
|
-
/** Classes for the `View` around the field, icon and clear button. */
|
|
40
33
|
wrapperClassName?: string;
|
|
41
34
|
};
|
|
42
35
|
|
|
@@ -48,18 +41,6 @@ export function searchChange(onChange: (value: string) => void, onClear?: () =>
|
|
|
48
41
|
};
|
|
49
42
|
}
|
|
50
43
|
|
|
51
|
-
/**
|
|
52
|
-
* Search field, the web `SearchInput`: a 16 search icon at the start and,
|
|
53
|
-
* while there is text, a clear button (a 14 cross labelled "Clear search") at
|
|
54
|
-
* the end. Controlled with `value` and `onChange(text)`, as on the web. The
|
|
55
|
-
* field has the `Input` look (`fieldStyle`) at the web sizes from
|
|
56
|
-
* `searchInputSize`. The clear button is painted at the web 24 and reaches 44
|
|
57
|
-
* with its hit slop (`touchSlop`). It clears at once and leaves focus where it
|
|
58
|
-
* was, as the default web clear does after its dissolve. It is hidden when the
|
|
59
|
-
* field is not editable. Inside a `ScrollView`, set
|
|
60
|
-
* `keyboardShouldPersistTaps="handled"` so the first tap clears while the
|
|
61
|
-
* keyboard is up. The web `shortcut` hint and `toolbar` variant are not ported.
|
|
62
|
-
*/
|
|
63
44
|
const SearchInput = React.forwardRef<
|
|
64
45
|
React.ElementRef<typeof PrimitiveInput>,
|
|
65
46
|
SearchInputProps
|
|
@@ -97,7 +78,6 @@ const SearchInput = React.forwardRef<
|
|
|
97
78
|
accessibilityLabel={label}
|
|
98
79
|
placeholder={placeholder ?? label}
|
|
99
80
|
placeholderTextColor={placeholderTextColor ?? palette.fieldPlaceholder[scheme]}
|
|
100
|
-
// The web `enterKeyHint="search"`.
|
|
101
81
|
returnKeyType="search"
|
|
102
82
|
className={cn(
|
|
103
83
|
"border font-instrument-sans",
|
|
@@ -110,15 +90,11 @@ const SearchInput = React.forwardRef<
|
|
|
110
90
|
fieldTextStyle(scheme),
|
|
111
91
|
{
|
|
112
92
|
minHeight: metrics.minHeight,
|
|
113
|
-
// The web border-box height, so the class line height cannot
|
|
114
|
-
// grow the field; it still grows with the system font size.
|
|
115
93
|
height: scaledFieldHeight(metrics.height, fontScale),
|
|
116
94
|
paddingTop: metrics.paddingY,
|
|
117
95
|
paddingBottom: metrics.paddingY,
|
|
118
96
|
paddingLeft: metrics.paddingLeft,
|
|
119
97
|
paddingRight: filled ? metrics.filledPaddingRight : metrics.paddingRight,
|
|
120
|
-
// The size without its line height: on a single-line field a
|
|
121
|
-
// line height can push the text off centre on iOS.
|
|
122
98
|
fontSize: sizeStyle(metrics.text).fontSize,
|
|
123
99
|
},
|
|
124
100
|
largerText ? typeStyle("medium") : null,
|
|
@@ -181,7 +157,6 @@ function ClearButton({
|
|
|
181
157
|
className="items-center justify-center rounded-md"
|
|
182
158
|
style={[{ width: size, height: size }, press.style]}
|
|
183
159
|
>
|
|
184
|
-
{/* `strokeWidth`, not the web `stroke`: here `stroke` is the colour. */}
|
|
185
160
|
<IconX size={iconSize} color={color} strokeWidth={1.75} />
|
|
186
161
|
</AnimatedPressable>
|
|
187
162
|
);
|
package/src/SectionLabel.tsx
CHANGED
|
@@ -8,11 +8,9 @@ import { useScheme } from "./useScheme";
|
|
|
8
8
|
export type SectionLabelProps = TextProps & {
|
|
9
9
|
className?: string;
|
|
10
10
|
children: ReactNode;
|
|
11
|
-
/** Capitals with the web menu label tracking (`uppercase tracking-widest`). Default `false`. */
|
|
12
11
|
uppercase?: boolean;
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
/** Letter spacing in em: slightly open, or the web `tracking-widest` (0.1em) in capitals. */
|
|
16
14
|
const TRACKING = { regular: 0.02, uppercase: 0.1 } as const;
|
|
17
15
|
|
|
18
16
|
/**
|
package/src/Select.tsx
CHANGED
|
@@ -38,7 +38,6 @@ interface SelectProps<TValue = string | number | null> {
|
|
|
38
38
|
triggerClassName?: string;
|
|
39
39
|
contentClassName?: string;
|
|
40
40
|
testID?: string;
|
|
41
|
-
/** Names the field for VoiceOver and TalkBack, which otherwise read only the value or placeholder. */
|
|
42
41
|
accessibilityLabel?: string;
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -107,11 +106,8 @@ function Select<TValue = string | number | null>({
|
|
|
107
106
|
accessibilityRole="combobox"
|
|
108
107
|
accessibilityLabel={accessibilityLabel}
|
|
109
108
|
accessibilityState={{ disabled: Boolean(disabled) }}
|
|
110
|
-
// 44 high on screen, as `Input` (the web h-10 is a desktop 40): a whole touch target.
|
|
111
109
|
hitSlop={touchSlop(MIN_TOUCH_TARGET, largerText ? 64 : 44)}
|
|
112
110
|
className={cn(
|
|
113
|
-
// The web trigger px-3.5 with 16 px type (its phone size), 44 high. A
|
|
114
|
-
// minimum height, so a large Dynamic Type size does not clip the value.
|
|
115
111
|
"h-auto min-h-11 w-full border px-3.5 py-0 shadow-none",
|
|
116
112
|
largerText && "min-h-16 px-4",
|
|
117
113
|
triggerClassName,
|
|
@@ -140,8 +136,6 @@ function Select<TValue = string | number | null>({
|
|
|
140
136
|
? `${testID}-${String(option.value ?? "null")}`
|
|
141
137
|
: undefined;
|
|
142
138
|
return (
|
|
143
|
-
// On web the item is a Radix DOM node: the name and test id
|
|
144
|
-
// go as `aria-label` and `data-testid` there.
|
|
145
139
|
<SelectItem
|
|
146
140
|
key={`${String(option.value)}-${option.label}`}
|
|
147
141
|
{...selectItemA11yProps({ label: option.label, testID: optionId }, Platform.OS)}
|
package/src/Separator.tsx
CHANGED
|
@@ -4,9 +4,7 @@ import { tokens } from "./tokens";
|
|
|
4
4
|
import { useScheme } from "./useScheme";
|
|
5
5
|
|
|
6
6
|
export type SeparatorProps = ViewProps & {
|
|
7
|
-
/** Default `"horizontal"`. */
|
|
8
7
|
orientation?: "horizontal" | "vertical";
|
|
9
|
-
/** Hidden from assistive tech. Default `true`, as on the web. */
|
|
10
8
|
decorative?: boolean;
|
|
11
9
|
className?: string;
|
|
12
10
|
};
|
package/src/SharedTransition.tsx
CHANGED
|
@@ -3,9 +3,6 @@ import { Text, View, type StyleProp, type TextProps, type TextStyle, type ViewPr
|
|
|
3
3
|
import Animated, { ReduceMotion, SharedTransition, type FadeContentConfig } from "react-native-reanimated";
|
|
4
4
|
import { useReduceMotion } from "./useReduceMotion";
|
|
5
5
|
|
|
6
|
-
// Shared element transitions (Reanimated 4.8): a view with the same
|
|
7
|
-
// `sharedTransitionTag` on two screens moves and resizes from one to the other
|
|
8
|
-
// as the screens change. Docs:
|
|
9
6
|
// https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/shared-transition/
|
|
10
7
|
// https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/children-of-shared-views/
|
|
11
8
|
|
|
@@ -29,11 +26,8 @@ export const DEFAULT_FADE_CONTENT: FadeContentConfig = {
|
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
export type SharedTransitionOverrides = {
|
|
32
|
-
/** Spring length in ms. Default `280`. */
|
|
33
29
|
duration?: number;
|
|
34
|
-
/** Default `1` (no bounce). */
|
|
35
30
|
dampingRatio?: number;
|
|
36
|
-
/** Default `DEFAULT_FADE_CONTENT`. Pass `false` to leave children as they are (no `fadeContent`). */
|
|
37
31
|
fadeContent?: FadeContentConfig | false;
|
|
38
32
|
};
|
|
39
33
|
|
|
@@ -69,7 +63,6 @@ export function useSharedTransitionStyle(): SharedTransition | undefined {
|
|
|
69
63
|
}
|
|
70
64
|
|
|
71
65
|
export type SharedTransitionViewProps = Omit<ViewProps, "style"> & {
|
|
72
|
-
/** The id both screens share. Namespaced with `sharedTransitionTag`. */
|
|
73
66
|
tag: string;
|
|
74
67
|
style?: StyleProp<ViewStyle>;
|
|
75
68
|
children?: ReactNode;
|