@vvedantb/native-ui 0.38.0 → 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/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/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 +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 +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
|
@@ -9,11 +9,6 @@ import { tokens } from "../tokens";
|
|
|
9
9
|
import { useScheme } from "../useScheme";
|
|
10
10
|
import { SettingsSection } from "./SettingsSection";
|
|
11
11
|
import { openProjectVApp, otherProjectVMobileApps } from "./projectVMobileApps";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The mark for each phone app. V Store has no mark of its own (it was left out
|
|
15
|
-
* of the brand marks in 0.3.9), so it shows the Project V mark.
|
|
16
|
-
*/
|
|
17
12
|
const MARK = {
|
|
18
13
|
vibot: "vibot",
|
|
19
14
|
verve: "verve",
|
|
@@ -22,10 +22,7 @@ const ICONS = {
|
|
|
22
22
|
dark: IconMoon,
|
|
23
23
|
system: IconDeviceDesktop
|
|
24
24
|
};
|
|
25
|
-
/** Web `bg-zinc-900`. */
|
|
26
25
|
const ZINC_900 = "#18181b";
|
|
27
|
-
// Swatches and icons show the theme itself, so they use the web's fixed colours, not tokens.
|
|
28
|
-
// System has no swatch colour (it is a hard split) and a muted icon.
|
|
29
26
|
const SWATCHES = {
|
|
30
27
|
light: "#ffffff",
|
|
31
28
|
neutral: "#3f3f46",
|
|
@@ -38,7 +35,6 @@ const ICON_COLOURS = {
|
|
|
38
35
|
dark: "#93c5fd",
|
|
39
36
|
system: null
|
|
40
37
|
};
|
|
41
|
-
/** The System swatch: white with a hard diagonal half in zinc-900, no gradient. */
|
|
42
38
|
function SplitSwatch() {
|
|
43
39
|
const $ = _c(1);
|
|
44
40
|
let t0;
|
|
@@ -8,9 +8,6 @@ import { familyApp } from "../brand/familyApps";
|
|
|
8
8
|
* know live Convex ids. So the store step opens V Store's home, not the app's page.
|
|
9
9
|
*/
|
|
10
10
|
export const VSTORE_HOME_URL = "vstore://";
|
|
11
|
-
|
|
12
|
-
// Names and sites come from `FAMILY_APPS` where it has the app. V Store is not
|
|
13
|
-
// a family app there (that file is a byte-identical copy of `@vvedantb/ui`).
|
|
14
11
|
const vibot = familyApp("vibot");
|
|
15
12
|
const verve = familyApp("verve");
|
|
16
13
|
const velth = familyApp("velth");
|
|
@@ -118,9 +115,7 @@ export async function openProjectVApp(id, linking, os) {
|
|
|
118
115
|
if (step.check && !(await linking.canOpenURL(step.url))) continue;
|
|
119
116
|
await linking.openURL(step.url);
|
|
120
117
|
return step.target;
|
|
121
|
-
} catch {
|
|
122
|
-
// Not installed, or no handler: try the next URL.
|
|
123
|
-
}
|
|
118
|
+
} catch {}
|
|
124
119
|
}
|
|
125
120
|
return null;
|
|
126
121
|
}
|
package/dist/sheetDrag.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The rules of a bottom sheet's drag to dismiss, as plain numbers, so they
|
|
3
|
-
* stay testable apart from the gesture. Distances are in points, `vy` in
|
|
4
|
-
* points per millisecond (the React Native `PanResponder` unit). Each is a
|
|
5
|
-
* worklet, so the Gesture Handler drag runs them on the UI thread.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/** How far ahead (ms) the release velocity carries the sheet when deciding to close. */
|
|
9
1
|
const PROJECTION_MS = 200;
|
|
10
|
-
|
|
11
|
-
/** A flick down at this speed (pt/ms, so 1000 pt/s) closes the sheet however short the drag. */
|
|
12
2
|
const FLICK_VELOCITY = 1;
|
|
13
3
|
|
|
14
4
|
/** How far an upward pull may lift the sheet: less than the corner radius hidden below the screen. */
|
package/dist/swipeRow.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The rules of a swipeable list row (`SwipeableRow`), as plain numbers, so
|
|
3
|
-
* they stay testable apart from the gesture. The offset is in points:
|
|
4
|
-
* positive when the row moves right (it reveals the leading actions),
|
|
5
|
-
* negative when it moves left (the trailing actions). Velocities are in
|
|
6
|
-
* points per second, the Gesture Handler unit. Each rule is a worklet, so the
|
|
7
|
-
* drag runs it on the UI thread.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
1
|
/** One action a swipe reveals behind a row. */
|
|
11
2
|
|
|
12
3
|
/** The revealed widths of each side (0 for a side with no actions) and the row's width. */
|
|
@@ -32,7 +23,6 @@ export function swipeRowActivation(sides, insidePager) {
|
|
|
32
23
|
activeOffsetX: [-SWIPE_ACTIVE_OFFSET_X, SWIPE_ACTIVE_OFFSET_X]
|
|
33
24
|
};
|
|
34
25
|
}
|
|
35
|
-
// Left (negative) reveals the trailing actions; right the leading ones.
|
|
36
26
|
return sides.trailing > 0 ? {
|
|
37
27
|
activeOffsetX: -SWIPE_ACTIVE_OFFSET_X,
|
|
38
28
|
failOffsetX: SWIPE_ACTIVE_OFFSET_X
|
|
@@ -41,11 +31,7 @@ export function swipeRowActivation(sides, insidePager) {
|
|
|
41
31
|
failOffsetX: -SWIPE_ACTIVE_OFFSET_X
|
|
42
32
|
};
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
/** How far ahead (s) the release velocity carries the row when deciding where it settles. */
|
|
46
34
|
const PROJECTION_S = 0.2;
|
|
47
|
-
|
|
48
|
-
/** How far a row moves past its reach: less and less the further the finger goes. */
|
|
49
35
|
function rubberband(overshoot) {
|
|
50
36
|
"worklet";
|
|
51
37
|
|
|
@@ -101,7 +87,6 @@ export function swipeRowSettle(x, vx, sides) {
|
|
|
101
87
|
if (reveal === 0) return {
|
|
102
88
|
kind: "close"
|
|
103
89
|
};
|
|
104
|
-
// The projected travel toward this side: negative after a flick back past rest.
|
|
105
90
|
const reach = Math.sign(x) * (x + vx * PROJECTION_S);
|
|
106
91
|
if (Math.abs(x) > reveal && reach >= swipeFullAt(reveal, sides.width)) return {
|
|
107
92
|
kind: "commit",
|
package/dist/tabBarRoutes.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
// Which routes `FloatingTabBar` draws. No React Native runtime import, so the
|
|
2
|
-
// tests can load this file.
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* The fields `FloatingTabBar` reads from a route's options (React
|
|
6
3
|
* Navigation's `BottomTabNavigationOptions`, and Expo Router's `href`).
|
|
7
4
|
*/
|
|
8
5
|
|
|
9
|
-
/** The `display` a style resolves to: in an array the last one set wins, as in `StyleSheet.flatten`. */
|
|
10
6
|
function displayOf(style) {
|
|
11
7
|
if (Array.isArray(style)) {
|
|
12
8
|
let display;
|
package/dist/tabIndicator.js
CHANGED
|
@@ -2,10 +2,6 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import { cssInterop } from "nativewind";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import Animated, { interpolate, interpolateColor, useAnimatedStyle } from "react-native-reanimated";
|
|
5
|
-
|
|
6
|
-
// The tab labels are `Animated.Text`s (their colour follows `progress`).
|
|
7
|
-
// NativeWind maps `className` only for components it knows, so it is told
|
|
8
|
-
// about this one, or the labels lose their font and size classes.
|
|
9
5
|
cssInterop(Animated.Text, {
|
|
10
6
|
className: "style"
|
|
11
7
|
});
|
package/dist/tailwind-preset.cjs
CHANGED
|
@@ -1,41 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@vvedantb/native-ui/tailwind-preset`: the NativeWind / Tailwind preset the
|
|
3
|
-
* Expo apps share. CommonJS, because `tailwind.config.js` `require`s it and
|
|
4
|
-
* Tailwind loads it outside Metro.
|
|
5
|
-
*
|
|
6
|
-
* const { nativeUiPreset, nativeUiContent } = require("@vvedantb/native-ui/tailwind-preset");
|
|
7
|
-
* module.exports = {
|
|
8
|
-
* content: ["./app/**\/*.{js,ts,tsx}", nativeUiContent()],
|
|
9
|
-
* presets: [nativeUiPreset()],
|
|
10
|
-
* };
|
|
11
|
-
*
|
|
12
|
-
* It nests `nativewind/preset`, so callers pass only this one. It sets
|
|
13
|
-
* `darkMode`, the `font-instrument-sans*` font classes (Instrument Sans unless
|
|
14
|
-
* `font` names other families), the colour keys native-ui
|
|
15
|
-
* classes use, `borderWidth.hairline` and, when asked, `borderRadius` from
|
|
16
|
-
* `--radius`.
|
|
17
|
-
* App colours, display fonts, keyframes and font-weight plugins stay in the
|
|
18
|
-
* app config.
|
|
19
|
-
*
|
|
20
|
-
* `color` maps a CSS variable name (without `--`) to a Tailwind colour, as the
|
|
21
|
-
* web `tokensPreset({ color })` of `@vvedantb/ui`. With `injectCssVariables`,
|
|
22
|
-
* the preset also writes those variables (light and dark) from `tokens.ts` and
|
|
23
|
-
* `palette.ts`, as space-separated RGB channels, and the default `color` is
|
|
24
|
-
* `rgbAlpha`.
|
|
25
|
-
*/
|
|
26
1
|
"use strict";
|
|
27
2
|
|
|
28
3
|
const fs = require("node:fs");
|
|
29
4
|
const path = require("node:path");
|
|
30
5
|
|
|
31
|
-
/** `var(--name)`. */
|
|
32
6
|
const cssVar = (name) => `var(--${name})`;
|
|
33
|
-
/** `hsl(var(--name))`, for variables that hold `h s% l%` channels. */
|
|
34
7
|
const hslVar = (name) => `hsl(var(--${name}))`;
|
|
35
|
-
/** `rgb(var(--name) / <alpha-value>)`, for variables that hold `r g b` channels. Keeps opacity modifiers. */
|
|
36
8
|
const rgbAlpha = (name) => `rgb(var(--${name}) / <alpha-value>)`;
|
|
37
9
|
|
|
38
|
-
/** The default families of the four font classes, as `fontFamily` in `typography.ts`. */
|
|
39
10
|
const INSTRUMENT_SANS = {
|
|
40
11
|
regular: "InstrumentSans_400Regular",
|
|
41
12
|
medium: "InstrumentSans_500Medium",
|
|
@@ -43,16 +14,10 @@ const INSTRUMENT_SANS = {
|
|
|
43
14
|
bold: "InstrumentSans_700Bold",
|
|
44
15
|
};
|
|
45
16
|
|
|
46
|
-
/** The glob Tailwind scans for native-ui class names: this package's `src`, at its real path (pnpm symlinks resolve). */
|
|
47
17
|
function nativeUiContent() {
|
|
48
18
|
return path.join(__dirname, "**/*.{js,ts,tsx}").split(path.sep).join("/");
|
|
49
19
|
}
|
|
50
20
|
|
|
51
|
-
/**
|
|
52
|
-
* Reads one `export const name = { … } as const;` object from a sibling
|
|
53
|
-
* `.ts` file. Plain object literals only, so no TypeScript loader is needed:
|
|
54
|
-
* `tokens.ts` and `palette.ts` stay the single source of the colours.
|
|
55
|
-
*/
|
|
56
21
|
function readConst(file, name) {
|
|
57
22
|
const source = fs.readFileSync(path.join(__dirname, file), "utf8");
|
|
58
23
|
const match = source.match(new RegExp(`export const ${name} = (\\{[\\s\\S]*?\\n\\}) as const;`));
|
|
@@ -62,7 +27,6 @@ function readConst(file, name) {
|
|
|
62
27
|
|
|
63
28
|
let cachedSchemeColors = null;
|
|
64
29
|
|
|
65
|
-
/** CSS variable name → `{ light, dark }` hex, from `tokens.ts` and `palette.ts`. */
|
|
66
30
|
function schemeColors() {
|
|
67
31
|
if (cachedSchemeColors) return cachedSchemeColors;
|
|
68
32
|
const tokens = readConst("tokens.ts", "tokens");
|
|
@@ -110,25 +74,21 @@ function schemeColors() {
|
|
|
110
74
|
return cachedSchemeColors;
|
|
111
75
|
}
|
|
112
76
|
|
|
113
|
-
/** `#rrggbb` as `r g b`. */
|
|
114
77
|
function channels(hex) {
|
|
115
78
|
const n = Number.parseInt(hex.slice(1, 7), 16);
|
|
116
79
|
return `${(n >> 16) & 255} ${(n >> 8) & 255} ${n & 255}`;
|
|
117
80
|
}
|
|
118
81
|
|
|
119
|
-
/** `--name: r g b` for every colour in one scheme. */
|
|
120
82
|
function cssVariables(scheme) {
|
|
121
83
|
return Object.fromEntries(
|
|
122
84
|
Object.entries(schemeColors()).map(([name, value]) => [`--${name}`, channels(value[scheme])]),
|
|
123
85
|
);
|
|
124
86
|
}
|
|
125
87
|
|
|
126
|
-
/** `--radius` from `tokens.radius.lg` (16), so `rounded-lg`, `-md` and `-sm` are 16, 14 and 12 as in `tokens.radius`. */
|
|
127
88
|
function radiusVariable() {
|
|
128
89
|
return { "--radius": `${readConst("tokens.ts", "tokens").radius.lg}px` };
|
|
129
90
|
}
|
|
130
91
|
|
|
131
|
-
/** The Tailwind colour keys native-ui classes and the apps share. */
|
|
132
92
|
function themeColors(v) {
|
|
133
93
|
return {
|
|
134
94
|
background: v("background"),
|
|
@@ -160,7 +120,6 @@ function themeColors(v) {
|
|
|
160
120
|
};
|
|
161
121
|
}
|
|
162
122
|
|
|
163
|
-
/** `nativewind/preset`, or none where NativeWind is not installed (this repository's tests). */
|
|
164
123
|
function nestedPresets() {
|
|
165
124
|
try {
|
|
166
125
|
return [require("nativewind/preset")];
|
|
@@ -169,7 +128,6 @@ function nestedPresets() {
|
|
|
169
128
|
}
|
|
170
129
|
}
|
|
171
130
|
|
|
172
|
-
/** `{ hairline: hairlineWidth() }` from `nativewind/theme`, or none without NativeWind. */
|
|
173
131
|
function hairlineBorder() {
|
|
174
132
|
try {
|
|
175
133
|
const { hairlineWidth } = require("nativewind/theme");
|
|
@@ -179,7 +137,6 @@ function hairlineBorder() {
|
|
|
179
137
|
}
|
|
180
138
|
}
|
|
181
139
|
|
|
182
|
-
/** A Tailwind plugin that writes the colour variables: `:root` (light) and the dark set for `darkMode`. */
|
|
183
140
|
function cssVariablesPlugin(darkMode) {
|
|
184
141
|
return function nativeUiCssVariables({ addBase }) {
|
|
185
142
|
const dark = cssVariables("dark");
|
|
@@ -197,17 +154,6 @@ function cssVariablesPlugin(darkMode) {
|
|
|
197
154
|
};
|
|
198
155
|
}
|
|
199
156
|
|
|
200
|
-
/**
|
|
201
|
-
* The preset. Options:
|
|
202
|
-
* - `darkMode`: `"class"` (default; `ThemeToggle` and `setColorScheme` need it) or `"media"`.
|
|
203
|
-
* - `color`: CSS variable name → colour value. Default `cssVar`, or `rgbAlpha` with `injectCssVariables`.
|
|
204
|
-
* - `injectCssVariables`: write the colour variables and `--radius` from `tokens.ts` and `palette.ts`. Default `false`.
|
|
205
|
-
* - `radiusVariable`: `rounded-lg`, `-md` and `-sm` from `var(--radius)`, as vibot and Velth. Default: on with
|
|
206
|
-
* `injectCssVariables`, else off, so an app without `--radius` keeps the Tailwind radii.
|
|
207
|
-
* - `font`: `{ regular, medium, semibold, bold }` family names for `sans` and the four `font-instrument-sans*`
|
|
208
|
-
* classes. Keys not given keep Instrument Sans. Pass the same names to `configureTheme({ font })`, which sets
|
|
209
|
-
* the JS styles; the app loads the font files.
|
|
210
|
-
*/
|
|
211
157
|
function nativeUiPreset(options = {}) {
|
|
212
158
|
const darkMode = options.darkMode === "media" ? "media" : "class";
|
|
213
159
|
const font = { ...INSTRUMENT_SANS };
|
|
@@ -6,18 +6,10 @@ type CssDeclarations = Record<string, string>;
|
|
|
6
6
|
type AddBase = (base: Record<string, CssDeclarations | Record<string, CssDeclarations>>) => void;
|
|
7
7
|
|
|
8
8
|
export interface NativeUiPresetOptions {
|
|
9
|
-
/** Default `"class"`: `ThemeToggle` and NativeWind `setColorScheme` need it. */
|
|
10
9
|
darkMode?: "class" | "media";
|
|
11
|
-
/** Default `cssVar`, or `rgbAlpha` with `injectCssVariables`. */
|
|
12
10
|
color?: ColorFn;
|
|
13
|
-
/** Write the colour variables (as `r g b` channels) and `--radius` from `tokens.ts` and `palette.ts`. Default `false`. */
|
|
14
11
|
injectCssVariables?: boolean;
|
|
15
|
-
/** `rounded-lg`, `-md` and `-sm` from `var(--radius)`. Default: the value of `injectCssVariables`. */
|
|
16
12
|
radiusVariable?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Family names for `sans` and the four `font-instrument-sans*` classes. Keys not given keep Instrument Sans.
|
|
19
|
-
* Pass the same names to `configureTheme({ font })`; the app loads the font files.
|
|
20
|
-
*/
|
|
21
13
|
font?: { regular?: string; medium?: string; semibold?: string; bold?: string };
|
|
22
14
|
}
|
|
23
15
|
|
package/dist/theme.jsx
CHANGED
|
@@ -6,49 +6,54 @@ import { ThemeVersionContext } from "./useScheme";
|
|
|
6
6
|
export const DEFAULT_ACCENT = "#db2777";
|
|
7
7
|
const NativeUiContext = createContext({
|
|
8
8
|
largerText: false,
|
|
9
|
-
accentColor: DEFAULT_ACCENT
|
|
9
|
+
accentColor: DEFAULT_ACCENT,
|
|
10
|
+
surface: "glass"
|
|
10
11
|
});
|
|
11
12
|
export function NativeUiProvider(t0) {
|
|
12
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(10);
|
|
13
14
|
const {
|
|
14
15
|
largerText: t1,
|
|
15
16
|
accentColor: t2,
|
|
17
|
+
surface: t3,
|
|
16
18
|
children
|
|
17
19
|
} = t0;
|
|
18
20
|
const largerText = t1 === undefined ? false : t1;
|
|
19
21
|
const accentColor = t2 === undefined ? DEFAULT_ACCENT : t2;
|
|
22
|
+
const surface = t3 === undefined ? "glass" : t3;
|
|
20
23
|
const themeVersion = useSyncExternalStore(subscribeTheme, getThemeVersion, getThemeVersion);
|
|
21
|
-
let
|
|
22
|
-
if ($[0] !== accentColor || $[1] !== largerText) {
|
|
23
|
-
|
|
24
|
+
let t4;
|
|
25
|
+
if ($[0] !== accentColor || $[1] !== largerText || $[2] !== surface) {
|
|
26
|
+
t4 = {
|
|
24
27
|
largerText,
|
|
25
|
-
accentColor
|
|
28
|
+
accentColor,
|
|
29
|
+
surface
|
|
26
30
|
};
|
|
27
31
|
$[0] = accentColor;
|
|
28
32
|
$[1] = largerText;
|
|
29
|
-
$[2] =
|
|
33
|
+
$[2] = surface;
|
|
34
|
+
$[3] = t4;
|
|
30
35
|
} else {
|
|
31
|
-
|
|
36
|
+
t4 = $[3];
|
|
32
37
|
}
|
|
33
|
-
let
|
|
34
|
-
if ($[
|
|
35
|
-
|
|
36
|
-
$[
|
|
37
|
-
$[
|
|
38
|
-
$[
|
|
38
|
+
let t5;
|
|
39
|
+
if ($[4] !== children || $[5] !== themeVersion) {
|
|
40
|
+
t5 = <ThemeVersionContext.Provider value={themeVersion}>{children}</ThemeVersionContext.Provider>;
|
|
41
|
+
$[4] = children;
|
|
42
|
+
$[5] = themeVersion;
|
|
43
|
+
$[6] = t5;
|
|
39
44
|
} else {
|
|
40
|
-
|
|
45
|
+
t5 = $[6];
|
|
41
46
|
}
|
|
42
|
-
let
|
|
43
|
-
if ($[
|
|
44
|
-
|
|
45
|
-
$[6] = t3;
|
|
47
|
+
let t6;
|
|
48
|
+
if ($[7] !== t4 || $[8] !== t5) {
|
|
49
|
+
t6 = <NativeUiContext.Provider value={t4}>{t5}</NativeUiContext.Provider>;
|
|
46
50
|
$[7] = t4;
|
|
47
51
|
$[8] = t5;
|
|
52
|
+
$[9] = t6;
|
|
48
53
|
} else {
|
|
49
|
-
|
|
54
|
+
t6 = $[9];
|
|
50
55
|
}
|
|
51
|
-
return
|
|
56
|
+
return t6;
|
|
52
57
|
}
|
|
53
58
|
export function useNativeUi() {
|
|
54
59
|
return useContext(NativeUiContext);
|
|
@@ -56,6 +61,9 @@ export function useNativeUi() {
|
|
|
56
61
|
export function useLargerText() {
|
|
57
62
|
return useContext(NativeUiContext).largerText;
|
|
58
63
|
}
|
|
64
|
+
export function useSurface() {
|
|
65
|
+
return useContext(NativeUiContext).surface;
|
|
66
|
+
}
|
|
59
67
|
export function useAccentColor() {
|
|
60
68
|
return useContext(NativeUiContext).accentColor;
|
|
61
69
|
}
|
package/dist/themeModeStore.js
CHANGED
|
@@ -20,12 +20,9 @@ export function createThemeModeStore({
|
|
|
20
20
|
onError
|
|
21
21
|
}) {
|
|
22
22
|
let current = "system";
|
|
23
|
-
/** True once the user picked a mode: a slow restore must not undo it. */
|
|
24
23
|
let chosen = false;
|
|
25
24
|
const listeners = new Set();
|
|
26
25
|
const report = error => onError?.(toError(error));
|
|
27
|
-
|
|
28
|
-
/** Paints `mode`. The dark slot goes first, so the scheme change redraws with it. */
|
|
29
26
|
function apply(mode) {
|
|
30
27
|
current = mode;
|
|
31
28
|
paintDarkFamily(mode === "neutral" ? "neutral" : "dark");
|
|
@@ -54,8 +51,6 @@ export function createThemeModeStore({
|
|
|
54
51
|
if (mode !== current) apply(mode);
|
|
55
52
|
Promise.resolve().then(() => storage.setItem(key, mode)).catch(report);
|
|
56
53
|
}
|
|
57
|
-
|
|
58
|
-
/** Server render and hydration: the mode is always "system" until `restore` runs on the client. */
|
|
59
54
|
const getServerSnapshot = () => "system";
|
|
60
55
|
return {
|
|
61
56
|
getMode,
|
package/dist/toastChrome.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `Toaster` look, from the web `SonnerToaster` at its default density
|
|
3
|
-
* (`createToasterClassNames` in `sonner.tsx`) with `toastIcons="filled24"`
|
|
4
|
-
* (`sonner-icons.tsx`). No React Native import, so the tests can load this
|
|
5
|
-
* file.
|
|
6
|
-
*/
|
|
7
1
|
import { palette, withAlpha } from "./palette";
|
|
8
2
|
import { tokens } from "./tokens";
|
|
9
3
|
/** Web `rounded-lg` (`--radius`, 16), the default `toastRadius`. */
|
package/dist/toastDrag.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* The rules of a toast's drag to dismiss, as plain numbers, so they stay
|
|
5
|
-
* testable apart from the gesture. A toast enters down from the top edge, so
|
|
6
|
-
* it leaves the same way: up. `dy` is the drag's travel in points (up
|
|
7
|
-
* negative) and `vy` the finger's speed in points per second (the Gesture
|
|
8
|
-
* Handler unit). Each rule is a worklet, so the drag runs it on the UI thread.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
3
|
/** Vertical travel (pt) before a drag takes the toast: a tap still presses it. */
|
|
12
4
|
export const TOAST_DRAG_ACTIVE_OFFSET_Y = 8;
|
|
13
|
-
|
|
14
|
-
/** A flick up at this speed (pt/s) dismisses the toast, however short the drag. */
|
|
15
5
|
const FLICK_VELOCITY = 500;
|
|
16
|
-
|
|
17
|
-
/** How far ahead (s) the release velocity carries the toast when deciding to dismiss it. */
|
|
18
6
|
const PROJECTION_S = 0.2;
|
|
19
|
-
|
|
20
|
-
/** How far a downward pull may move the toast: it is already as low as it goes. */
|
|
21
7
|
const DOWN_REACH = 24;
|
|
22
8
|
|
|
23
9
|
/**
|
package/dist/toastStore.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// Module-level toast queue behind `toast()` and `<Toaster />`. No React Native
|
|
2
|
-
// imports, so it runs anywhere (tests, non-component code).
|
|
3
|
-
|
|
4
1
|
/** At most this many toasts show; the oldest drop first. */
|
|
5
2
|
export const MAX_TOASTS = 3;
|
|
6
3
|
export const DEFAULT_TOAST_DURATION = 4000;
|
|
@@ -46,7 +43,6 @@ export const toast = Object.assign((title, options) => show("default", title, op
|
|
|
46
43
|
warning: (title, options) => show("warning", title, options),
|
|
47
44
|
info: (title, options) => show("info", title, options),
|
|
48
45
|
loading: (title, options) => show("loading", title, options),
|
|
49
|
-
/** Closes one toast, or every toast without an id. */
|
|
50
46
|
dismiss(id) {
|
|
51
47
|
toasts = id === undefined ? [] : toasts.filter(toast => toast.id !== id);
|
|
52
48
|
emit();
|
package/dist/updateCheck.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
// The update check behind `UpdateChecker`: for an app that ships its Android
|
|
2
|
-
// APK as GitHub releases tagged `<tagPrefix><version>`, with no store and no
|
|
3
|
-
// over-the-air updates. Plain functions, no React and no native module.
|
|
4
|
-
|
|
5
1
|
/** A newer version to offer. `url` is what Download opens: the APK itself, else its release page. */
|
|
6
2
|
|
|
7
3
|
/** The fields of a GitHub release the check reads (`GET /repos/{owner}/{repo}/releases`). */
|
|
8
4
|
|
|
9
|
-
/** `[major, minor, patch]` of "1.2.3", or null. */
|
|
10
5
|
function parseVersion(version) {
|
|
11
6
|
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
|
|
12
7
|
return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;
|
|
13
8
|
}
|
|
14
|
-
|
|
15
|
-
/** Positive when `a` is newer than `b`. */
|
|
16
9
|
function compareParts(a, b) {
|
|
17
10
|
return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
|
|
18
11
|
}
|
package/dist/webview/htmlView.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared React Native / Expo UI primitives. Floating surfaces, forms, overlays, toasts, settings chrome, tab bar, AI chat parts, the family app marks, a NativeWind preset, the Expo web root, the app root shell helpers and Clerk + Convex auth screens.",
|
|
6
6
|
"type": "module",
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"@rn-primitives/switch": "*",
|
|
212
212
|
"@swmansion/react-native-bottom-sheet": ">=1.1.0",
|
|
213
213
|
"@tabler/icons-react-native": "^3.52.0",
|
|
214
|
-
"@vvedantb/server": ">=0.
|
|
214
|
+
"@vvedantb/server": ">=0.19.0",
|
|
215
215
|
"class-variance-authority": ">=0.7.0",
|
|
216
216
|
"clsx": ">=2.0.0",
|
|
217
217
|
"convex": "*",
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
"react-native-worklets": "0.14.0",
|
|
365
365
|
"typescript": "7.0.2",
|
|
366
366
|
"vitest": "5.1.1",
|
|
367
|
-
"@vvedantb/server": "0.
|
|
367
|
+
"@vvedantb/server": "0.19.0"
|
|
368
368
|
},
|
|
369
369
|
"scripts": {
|
|
370
370
|
"build": "node scripts/build-dist.mjs && node scripts/check-exports.mjs",
|
package/src/ArtifactList.tsx
CHANGED
|
@@ -7,9 +7,7 @@ export type ArtifactRow = { id: string; title: string; description?: string };
|
|
|
7
7
|
|
|
8
8
|
export type ArtifactListProps = {
|
|
9
9
|
rows: ArtifactRow[];
|
|
10
|
-
/** Called with the `id` of the pressed row. */
|
|
11
10
|
onOpen: (id: string) => void;
|
|
12
|
-
/** Shown when `rows` is empty, such as an `EmptyState`. Nothing without it. */
|
|
13
11
|
empty?: ReactNode;
|
|
14
12
|
className?: string;
|
|
15
13
|
testID?: string;
|
package/src/Avatar.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from "react-native";
|
|
17
17
|
import { cn } from "./cn";
|
|
18
18
|
import { typeStyle } from "./controlStyles";
|
|
19
|
+
import { useGlass } from "./glass";
|
|
19
20
|
import { palette } from "./palette";
|
|
20
21
|
import { tokens } from "./tokens";
|
|
21
22
|
import { useScheme } from "./useScheme";
|
|
@@ -35,7 +36,6 @@ function useAvatar(part: string) {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export type AvatarProps = ViewProps & {
|
|
38
|
-
/** Diameter in points. Default 40 (the web `h-10 w-10`). */
|
|
39
39
|
size?: number;
|
|
40
40
|
className?: string;
|
|
41
41
|
};
|
|
@@ -43,6 +43,7 @@ export type AvatarProps = ViewProps & {
|
|
|
43
43
|
/** Round frame for `AvatarImage` and `AvatarFallback`, as the web `Avatar`. The fallback shows until the image loads, and stays if it fails. */
|
|
44
44
|
export function Avatar({ size = 40, className, style, children, ...props }: AvatarProps) {
|
|
45
45
|
const scheme = useScheme();
|
|
46
|
+
const glass = useGlass("small");
|
|
46
47
|
const [status, setStatus] = useState<ImageStatus>("idle");
|
|
47
48
|
return (
|
|
48
49
|
<AvatarContext.Provider value={{ size, status, setStatus }}>
|
|
@@ -56,6 +57,7 @@ export function Avatar({ size = 40, className, style, children, ...props }: Avat
|
|
|
56
57
|
borderColor: tokens.color.border[scheme],
|
|
57
58
|
backgroundColor: tokens.color.surfaceSecondary[scheme],
|
|
58
59
|
},
|
|
60
|
+
glass,
|
|
59
61
|
style,
|
|
60
62
|
]}
|
|
61
63
|
{...props}
|
|
@@ -72,7 +74,6 @@ export type AvatarImageProps = Omit<ImageProps, "style"> & {
|
|
|
72
74
|
|
|
73
75
|
export function AvatarImage({ onLoad, onError, className, ...props }: AvatarImageProps) {
|
|
74
76
|
const { status, setStatus } = useAvatar("AvatarImage");
|
|
75
|
-
// A new source gets a fresh try: back to the fallback until it loads.
|
|
76
77
|
const sourceKey = JSON.stringify(props.source);
|
|
77
78
|
const previousSource = useRef(sourceKey);
|
|
78
79
|
useEffect(() => {
|
|
@@ -100,7 +101,6 @@ export function AvatarImage({ onLoad, onError, className, ...props }: AvatarImag
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
export type AvatarFallbackProps = ViewProps & {
|
|
103
|
-
/** Usually initials (see `initials()`). A string is centred in Instrument Sans at 40% of the avatar size. */
|
|
104
104
|
children?: ReactNode;
|
|
105
105
|
className?: string;
|
|
106
106
|
textClassName?: string;
|
package/src/Badge.tsx
CHANGED
|
@@ -13,12 +13,8 @@ import { useScheme } from "./useScheme";
|
|
|
13
13
|
|
|
14
14
|
const SHEET_RADIUS = 20;
|
|
15
15
|
|
|
16
|
-
// A single open detent at 40% by default. A caller can pass several detents for
|
|
17
|
-
// multi-detent sizing. The closed detent (0) is added by the component.
|
|
18
16
|
const DEFAULT_DETENTS: readonly ModalDetent[] = ["40%"];
|
|
19
17
|
|
|
20
|
-
// A dimming scrim. The library scales this alpha to 0 at the closed detent and to
|
|
21
|
-
// full at an open one.
|
|
22
18
|
const SCRIM_COLOR = "rgba(0, 0, 0, 0.5)";
|
|
23
19
|
|
|
24
20
|
/**
|
|
@@ -46,24 +42,19 @@ export function BottomSheetContainer({
|
|
|
46
42
|
title: string;
|
|
47
43
|
children: React.ReactNode;
|
|
48
44
|
closeTestID?: string;
|
|
49
|
-
/** Open detents, shortest first. The closed detent is added automatically. */
|
|
50
45
|
detents?: readonly ModalDetent[];
|
|
51
46
|
}) {
|
|
52
47
|
const largerText = useLargerText();
|
|
53
48
|
const scheme = useScheme();
|
|
54
49
|
const isDark = scheme === "dark";
|
|
55
50
|
|
|
56
|
-
// The library sheet is controlled by a detent index. The first detent is the
|
|
57
|
-
// closed state (0); the open detents follow.
|
|
58
51
|
const detentList = useMemo<ModalDetent[]>(() => [0, ...detents], [detents]);
|
|
59
52
|
const [index, setIndex] = useState(0);
|
|
60
53
|
|
|
61
|
-
// Keep the index in step with `visible`: open to the first detent, close to 0.
|
|
62
54
|
useEffect(() => {
|
|
63
55
|
setIndex((current) => (visible ? (current === 0 ? 1 : current) : 0));
|
|
64
56
|
}, [visible]);
|
|
65
57
|
|
|
66
|
-
// A user-driven drag to the closed detent reports here; tell the parent.
|
|
67
58
|
const handleIndexChange = useCallback(
|
|
68
59
|
(next: number) => {
|
|
69
60
|
setIndex(next);
|
|
@@ -72,7 +63,6 @@ export function BottomSheetContainer({
|
|
|
72
63
|
[onClose],
|
|
73
64
|
);
|
|
74
65
|
|
|
75
|
-
// A scrim tap or system Back asks the sheet to close; close it and tell the parent.
|
|
76
66
|
const handleCloseRequest = useCallback(() => {
|
|
77
67
|
setIndex(0);
|
|
78
68
|
onClose();
|
|
@@ -88,7 +78,6 @@ export function BottomSheetContainer({
|
|
|
88
78
|
<ModalBottomSheet
|
|
89
79
|
index={index}
|
|
90
80
|
detents={detentList}
|
|
91
|
-
// Unmount the content once the sheet settles closed.
|
|
92
81
|
lazy
|
|
93
82
|
windowOverlay
|
|
94
83
|
scrimColor={SCRIM_COLOR}
|