@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/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Peers the app must already have (Expo SDK 57 / RN 0.76+):
|
|
|
16
16
|
- `nativewind` `>=4`
|
|
17
17
|
- `react-native-reanimated`, `react-native-safe-area-context`, `react-native-screens`
|
|
18
18
|
- `@rn-primitives/slot`, `@rn-primitives/switch`, `@rn-primitives/select`
|
|
19
|
-
- `@expo/vector-icons`, `@tabler/icons-react-native
|
|
19
|
+
- `@expo/vector-icons`, `@tabler/icons-react-native`
|
|
20
20
|
- `class-variance-authority`, `clsx`, `tailwind-merge`
|
|
21
21
|
|
|
22
22
|
Optional, only if you import those components:
|
|
@@ -27,7 +27,7 @@ Optional, only if you import those components:
|
|
|
27
27
|
- `@clerk/expo`, `convex`, `expo-auth-session`, `expo-web-browser` and `expo-router` — `@vvedantb/native-ui/auth` (0.7.0). `expo-router` also for `@vvedantb/native-ui/expo-web-root`.
|
|
28
28
|
- `react-native-gesture-handler` (`>=2.0.0`) — `@vvedantb/native-ui/gesture-handler` (Unreleased). Wrap the app in `GestureHandlerRootView`, and put `GestureHandlerProvider` from that entry inside it: the sheet drags (`SheetContent`, the compact `DialogContent`) then run on Gesture Handler, on the UI thread, and each overlay's `Modal` gets its own root view (Android needs one in every `Modal`). It also turns on the `SwipeableRow` swipe. Without the provider, the sheets drag with `PanResponder`, with the same rules, and a `SwipeableRow` does not swipe. Only that entry imports the peer, so an app without it bundles as before. In a Metro monorepo, resolve the peer from the app (one copy), as for `react`.
|
|
29
29
|
- `react-native-keyboard-controller` (`>=1.21.0`) — `@vvedantb/native-ui/keyboard-controller` (Unreleased). Put `KeyboardControllerProvider` from that entry inside the app's `KeyboardProvider`: the chat transcript (`ConversationList`), the dock (`ConversationDock`) and its scroll button then follow the keyboard frame by frame, a drag down on the transcript moves the keyboard with the finger (iOS, Android 11+; Android 10 and below lower it at once), and `PromptInput`, `ChatThread`, the overlays and `KeyboardAvoidingView` pad frame by frame. The dock moves by the keyboard less the bottom inset: its content pads that inset, as `PromptInput` does. Without the provider, every part keeps React Native's `KeyboardAvoidingView`. Only that entry imports the peer. In a Metro monorepo, resolve the peer from the app (one copy): the parts read its provider's context.
|
|
30
|
-
- `react-native-svg` — the app marks (`APP_ICONS`, `Icon*`, `AppMark`, `AppWordmark`), `GoogleMark` and `PricingModal`. Apps with the icon peers above already have it:
|
|
30
|
+
- `react-native-svg` — the app marks (`APP_ICONS`, `Icon*`, `AppMark`, `AppWordmark`), `GoogleMark` and `PricingModal`. Apps with the icon peers above already have it: `@tabler/icons-react-native` requires it.
|
|
31
31
|
|
|
32
32
|
Optional and loaded only when installed, so the package imports and runs without them:
|
|
33
33
|
|
|
@@ -69,7 +69,7 @@ pnpm --filter native-gallery start
|
|
|
69
69
|
# or cd apps/native-gallery && npx expo start
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
`tests/galleryRegistry.test.ts` fails when a React component export has no entry in `apps/native-gallery/src/galleryRegistry.ts`. Maestro flows in `apps/native-gallery/.maestro/` drive the dropdown, composer, sheets and select.
|
|
72
|
+
`tests/galleryRegistry.test.ts` fails when a React component export has no entry in `apps/native-gallery/src/galleryRegistry.ts`. Maestro flows in `apps/native-gallery/.maestro/` drive the dropdown, composer, sheets and select. No workflow runs them on a pull request: run `pnpm --filter native-gallery maestro` on an emulator and report the result in the pull request body. The pre-push hook runs the typecheck, lint and tests of this package. A new or changed component needs a gallery entry, a Maestro flow and a hand test on an Android emulator.
|
|
73
73
|
|
|
74
74
|
The `Select` note stays: mount one `<PortalHost />` from `@rn-primitives/portal` at the app root, outside any `Modal`. The gallery does so in `app/_layout.tsx`.
|
|
75
75
|
|
|
@@ -89,7 +89,7 @@ The root entry exports everything. It still imports `BottomSheetContainer` and `
|
|
|
89
89
|
| `@vvedantb/native-ui/toast` | `toast`, `Toaster`, `ToastOptions`, `ToastVariant` | none (from 0.3.12) |
|
|
90
90
|
| `@vvedantb/native-ui/theme` | `NativeUiProvider`, `useNativeUi`, `useLargerText`, `useAccentColor`, `DEFAULT_ACCENT`, `tokens`, `palette`, `withAlpha`, `configureTheme` (with the `ThemeConfig`, `ThemeColors` and `ThemePalette` types), `fontClass`, `fontFamily` (with the `ThemeFonts` type), `cn`, `Colors` and the colour constants | none |
|
|
91
91
|
| `@vvedantb/native-ui/floating` | `FloatingSurface`, `GlassSheetBackground`, `LiquidGlass`, `GlassBlurProvider`, `GlassBlurTarget`, `FloatingFAB`, `useReduceTransparency`, the floating metrics and styles | `expo-blur` (loader) |
|
|
92
|
-
| `@vvedantb/native-ui/layout` | `ScreenContainer`, `SafeAreaContainer`, `PageTitle`, `PageHeader`, `StackPageHeader` (0.5.0) and their props types, `SectionLabel` (0.5.0), `SettingsSection`, `SettingsField`, `SettingsToggleRow`, `SettingsStack`, `MoreFromProjectV` and `FromProjectV` (0.8.0), `ScreenContainerProps`, `SettingsEmptyState`, `PinnedBotTile`, `BotPinGrid`, `ArtifactList` (0.12.0).
|
|
92
|
+
| `@vvedantb/native-ui/layout` | `ScreenContainer`, `SafeAreaContainer`, `PageTitle`, `PageHeader`, `StackPageHeader` (0.5.0) and their props types, `SectionLabel` (0.5.0), `SettingsSection`, `SettingsField`, `SettingsToggleRow`, `SettingsStack`, `MoreFromProjectV` and `FromProjectV` (0.8.0), `ScreenContainerProps`, `SettingsEmptyState`, `PinnedBotTile`, `BotPinGrid`, `ArtifactList` (0.12.0). From 0.35.0: `ThemeModePicker`, `THEME_MODES` and `ThemeMode`, the web theme tiles for an Appearance section (needs `react-native-svg`). The Neutral store, `paintDarkFamily` and `createThemeModeStore` live on `@vvedantb/native-ui/theme`. `ScreenContainer` takes `refreshing`, `onRefresh` and `refreshControl` (0.12.0). `StackPageHeader` takes `centre` (0.12.0) | `expo-blur` (loader) |
|
|
93
93
|
| `@vvedantb/native-ui/marketing` | `UpgradeToProCard`, `PricingModal` and the pricing types | none |
|
|
94
94
|
| `@vvedantb/native-ui/ambient` | `AmbientBackground` | `expo-linear-gradient` (loader) |
|
|
95
95
|
| `@vvedantb/native-ui/blur`, `/haptics` | the loaders | `expo-blur`, `expo-haptics` (loaders) |
|
|
@@ -102,6 +102,7 @@ The root entry exports everything. It still imports `BottomSheetContainer` and `
|
|
|
102
102
|
| `@vvedantb/native-ui/ai-gallery` | `AiChatGallery`, `AiChatSamples` (from 0.4.0) | none |
|
|
103
103
|
| `@vvedantb/native-ui/auth` | From 0.7.0: `AuthProviders`, `SignInScreen`, `SignUpScreen`, `ChangePasswordScreen`, `DeleteAccountScreen` (0.32.0), `GoogleSignInButton`, `useGoogleSignIn`, `AuthScreen`, `OrDivider`, `FieldError`, `authErrorMessage`, `SecondFactorScreen`, `useSecondFactor`, `submitTotpSecondFactor`, `submitSecondFactor`, `prepareSecondFactorIfNeeded`, `prepareFirstFactorIfNeeded`, `submitFirstFactor`, `pickFirstFactorStrategy`, `TOTP_MESSAGES` and their props types. See [Auth](#auth-070). Not on the root entry. | `@clerk/expo`, `convex`, `expo-auth-session`, `expo-web-browser`, `expo-router` (import) |
|
|
104
104
|
| `@vvedantb/native-ui/expo-router` | From 0.12.0: `RouterStackPageHeader`, `RouterStackPageHeaderProps`, `goBackOrReplace`. Not on the root, `/layout` or `/page-title` entries. | `expo-router` (import) |
|
|
105
|
+
| `@vvedantb/native-ui/app-root` | `instrumentSansFontMap`, `useInstrumentSansFonts`, `useHideSplashWhenReady`, `AuthGroupGate`, `SsoCallbackScreen` and their props types. Apps keep their own provider trees. Not on the root entry. | `@clerk/expo`, `expo-router`, `expo-font`, `expo-splash-screen`, `@expo-google-fonts/instrument-sans` (import) |
|
|
105
106
|
| `@vvedantb/native-ui/expo-web-root` | From 0.7.0: `ExpoWebRoot`, `ExpoWebRootProps`, `ExpoWebRootViewport`, `EXPO_WEB_VIEWPORT`, `expoWebBackgroundCss`. Not on the root entry. | `expo-router` (import of `expo-router/html`) |
|
|
106
107
|
| `@vvedantb/native-ui/tailwind-preset` | From 0.7.0, CommonJS for `tailwind.config.js`: `nativeUiPreset`, `nativeUiContent`, `cssVar`, `hslVar`, `rgbAlpha`, `cssVariables`, `schemeColors` and a default preset. See [Expo / NativeWind](#expo--nativewind). | `nativewind` (`require`, when installed) |
|
|
107
108
|
|
|
@@ -384,7 +385,7 @@ configureTheme({ font: { regular: "Inter_400Regular", medium: "Inter_500Medium",
|
|
|
384
385
|
|
|
385
386
|
**Settings at web sizes (0.14.0).** `SettingsSection`, `SettingsToggleRow`, `SettingsField` and `SettingsEmptyState` take the web type: titles and labels `text-sm` (14 / 20; the section title semibold, the others medium), descriptions and help `text-xs leading-relaxed` (12 / 19.5; the section description `text-sm leading-relaxed`, 14 / 22.75). `SettingsToggleRow` steps up one size with larger text and has no minimum height; its control keeps the 44 target.
|
|
386
387
|
|
|
387
|
-
**`Button` aliases and `Field` (
|
|
388
|
+
**`Button` aliases and `Field` (0.36.0).** `variant` also accepts `tertiary` (= `ghost`), `danger` (= `destructive`), `success`, `warning` and `flat`, as the web `Button`. `tinted` stays as a legacy alias (the pink tint of `outline` before 0.3.0). `size` accepts `md` (= `default`/`medium`), and `Spinner` `size="default"` equals `md`. Roles: `primary`/`default` is the one main action, `secondary` an alternative, `tertiary`/`ghost` a dismissive action, `destructive`/`danger` a destructive action, `success` and `warning` show status, and `outline`, `link` and `flat` are visual.
|
|
388
389
|
|
|
389
390
|
`Field`, `FieldLabel`, `FieldControl`, `FieldDescription` and `FieldError` (root and `/primitives`) link a label to a control. `FieldLabel` sets `nativeID`; `FieldControl` sets `accessibilityLabelledBy` while a `FieldLabel` renders, and otherwise keeps the `accessibilityLabel` you pass (the fallback, and what iOS reads). A plain `Input` is unchanged. The `FieldError` in `@vvedantb/native-ui/auth` is a different component (it takes a `message` prop).
|
|
390
391
|
|
|
@@ -772,7 +773,7 @@ The components keep the web sizes on screen and reach a 44 pt touch target with
|
|
|
772
773
|
|
|
773
774
|
Text scales with the system font size. Labelled controls have minimum heights, so a large Dynamic Type size grows them instead of clipping the label (the `SearchInput` lock grows with the font scale); only the `FloatingTabBar` labels are capped (1.5×), to fit the fixed bar. With Reduce Motion on, dialogs, sheets, toasts, the `Select` popover, `PricingModal`, `Progress`, `Skeleton` and the `FloatingTabBar` pill do not animate. Dialogs, sheets, toasts, `FloatingTabBar` and `FloatingFAB` stay inside the safe-area insets, and dialog and sheet fields stay above the keyboard on iOS and Android.
|
|
774
775
|
|
|
775
|
-
The brand marks (`APP_ICONS`, the `Icon*` exports, `AppMark` and `GoogleMark`) are images named by `title`, and hidden from assistive tech without one. From 0.3.14 they set the props each platform reads: `accessibilityRole="image"` and `accessibilityLabel` on iOS and Android, `role="img"` and `aria-label` on web. Without a title they set `accessibilityElementsHidden` and `importantForAccessibility="no-hide-descendants"` on native and `aria-hidden` on web. `testID` is `data-testid` on web. On web `react-native-svg` passes its props straight to the DOM `<svg>`, and React Native Web does not map `accessible`, the `accessibility*` props or `testID` there. So do not put them on an `Svg` or on a Tabler icon: put them on the parent `View` or `Pressable`.
|
|
776
|
+
The brand marks (`APP_ICONS`, the `Icon*` exports, `AppMark` and `GoogleMark`) are images named by `title`, and hidden from assistive tech without one. From 0.3.14 they set the props each platform reads: `accessibilityRole="image"` and `accessibilityLabel` on iOS and Android, `role="img"` and `aria-label` on web. Without a title they set `accessibilityElementsHidden` and `importantForAccessibility="no-hide-descendants"` on native and `aria-hidden` on web. `testID` is `data-testid` on web. On web `react-native-svg` passes its props straight to the DOM `<svg>`, and React Native Web does not map `accessible`, the `accessibility*` props or `testID` there. So do not put them on an `Svg` or on a Tabler icon: put them on the parent `View` or `Pressable`. On web the `Select` options are Radix DOM nodes, so from 0.3.14 they take their name and test id as `aria-label` and `data-testid` there, and as `accessibilityLabel` and `testID` on iOS and Android.
|
|
776
777
|
|
|
777
778
|
`ThemeToggle` (from 0.3.16) is a `HeaderIconButton` that switches between light and dark with NativeWind's `setColorScheme`, the scheme every component reads through `useColorScheme`. It shows and names the scheme it switches to: a moon and "Switch to dark mode" in light, a sun and "Switch to light mode" in dark. It stores nothing: to restore the choice on the next launch, store `useColorScheme().colorScheme` in the app. It takes `testID`. It needs `darkMode: "class"` (see [Theme](#theme)). Without it, from 0.5.0, a press logs that fix with `console.error` and leaves the scheme as it is, instead of throwing from the press handler.
|
|
778
779
|
|
|
@@ -819,7 +820,7 @@ The brand files `src/brand/svg.ts`, `familyApps.ts` and `vProAppBenefits.ts` are
|
|
|
819
820
|
|
|
820
821
|
## Type checking
|
|
821
822
|
|
|
822
|
-
`pnpm --filter @vvedantb/native-ui typecheck` runs `tsc` against `types/peers.d.ts`, local declarations of the React Native peers, because they are not installed in this repository. The declarations are looser than the real types. Apps type-check the source against the real packages.
|
|
823
|
+
`pnpm --filter @vvedantb/native-ui typecheck` runs `tsc` against `types/peers.d.ts`, local declarations of the React Native peers, because they are not installed in this repository. The declarations are looser than the real types. Apps type-check the source against the real packages. `types/peers.d.ts` is not published: its `declare module "react-native"` would replace an app's real types. The one optional peer that apps may not install, `prism-react-renderer`, has a published module file instead (`types/prism-react-renderer.d.ts`, in `files`). `src/highlight.ts` imports it by relative path, so no `exports` or `typesVersions` entry is needed.
|
|
823
824
|
|
|
824
825
|
## Publish
|
|
825
826
|
|
package/dist/Avatar.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
|
3
3
|
import { Image, StyleSheet, Text, View } from "react-native";
|
|
4
4
|
import { cn } from "./cn";
|
|
5
5
|
import { typeStyle } from "./controlStyles";
|
|
6
|
+
import { useGlass } from "./glass";
|
|
6
7
|
import { palette } from "./palette";
|
|
7
8
|
import { tokens } from "./tokens";
|
|
8
9
|
import { useScheme } from "./useScheme";
|
|
@@ -16,7 +17,7 @@ function useAvatar(part) {
|
|
|
16
17
|
}
|
|
17
18
|
/** Round frame for `AvatarImage` and `AvatarFallback`, as the web `Avatar`. The fallback shows until the image loads, and stays if it fails. */
|
|
18
19
|
export function Avatar(t0) {
|
|
19
|
-
const $ = _c(
|
|
20
|
+
const $ = _c(28);
|
|
20
21
|
let children;
|
|
21
22
|
let className;
|
|
22
23
|
let props;
|
|
@@ -45,6 +46,7 @@ export function Avatar(t0) {
|
|
|
45
46
|
}
|
|
46
47
|
const size = t1 === undefined ? 40 : t1;
|
|
47
48
|
const scheme = useScheme();
|
|
49
|
+
const glass = useGlass("small");
|
|
48
50
|
const [status, setStatus] = useState("idle");
|
|
49
51
|
let t2;
|
|
50
52
|
if ($[6] !== size || $[7] !== status) {
|
|
@@ -88,33 +90,34 @@ export function Avatar(t0) {
|
|
|
88
90
|
t7 = $[15];
|
|
89
91
|
}
|
|
90
92
|
let t8;
|
|
91
|
-
if ($[16] !==
|
|
92
|
-
t8 = [t7, style];
|
|
93
|
-
$[16] =
|
|
94
|
-
$[17] =
|
|
95
|
-
$[18] =
|
|
93
|
+
if ($[16] !== glass || $[17] !== style || $[18] !== t7) {
|
|
94
|
+
t8 = [t7, glass, style];
|
|
95
|
+
$[16] = glass;
|
|
96
|
+
$[17] = style;
|
|
97
|
+
$[18] = t7;
|
|
98
|
+
$[19] = t8;
|
|
96
99
|
} else {
|
|
97
|
-
t8 = $[
|
|
100
|
+
t8 = $[19];
|
|
98
101
|
}
|
|
99
102
|
let t9;
|
|
100
|
-
if ($[
|
|
103
|
+
if ($[20] !== children || $[21] !== props || $[22] !== t3 || $[23] !== t8) {
|
|
101
104
|
t9 = <View className={t3} style={t8} {...props}>{children}</View>;
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
105
|
+
$[20] = children;
|
|
106
|
+
$[21] = props;
|
|
107
|
+
$[22] = t3;
|
|
108
|
+
$[23] = t8;
|
|
109
|
+
$[24] = t9;
|
|
107
110
|
} else {
|
|
108
|
-
t9 = $[
|
|
111
|
+
t9 = $[24];
|
|
109
112
|
}
|
|
110
113
|
let t10;
|
|
111
|
-
if ($[
|
|
114
|
+
if ($[25] !== t2 || $[26] !== t9) {
|
|
112
115
|
t10 = <AvatarContext.Provider value={t2}>{t9}</AvatarContext.Provider>;
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
+
$[25] = t2;
|
|
117
|
+
$[26] = t9;
|
|
118
|
+
$[27] = t10;
|
|
116
119
|
} else {
|
|
117
|
-
t10 = $[
|
|
120
|
+
t10 = $[27];
|
|
118
121
|
}
|
|
119
122
|
return t10;
|
|
120
123
|
}
|
|
@@ -11,13 +11,7 @@ import { useLargerText } from "./theme";
|
|
|
11
11
|
import { tokens } from "./tokens";
|
|
12
12
|
import { useScheme } from "./useScheme";
|
|
13
13
|
const SHEET_RADIUS = 20;
|
|
14
|
-
|
|
15
|
-
// A single open detent at 40% by default. A caller can pass several detents for
|
|
16
|
-
// multi-detent sizing. The closed detent (0) is added by the component.
|
|
17
14
|
const DEFAULT_DETENTS = ["40%"];
|
|
18
|
-
|
|
19
|
-
// A dimming scrim. The library scales this alpha to 0 at the closed detent and to
|
|
20
|
-
// full at an open one.
|
|
21
15
|
const SCRIM_COLOR = "rgba(0, 0, 0, 0.5)";
|
|
22
16
|
|
|
23
17
|
/**
|
package/dist/BulkActionBar.jsx
CHANGED
|
@@ -21,13 +21,6 @@ import { NativeOnlyAnimatedView } from "./primitives/native-only-animated-view";
|
|
|
21
21
|
|
|
22
22
|
/** The web `sm` breakpoint: below it, bar buttons are icon-only and "selected" is hidden. */
|
|
23
23
|
export const BULK_BAR_LABEL_MIN_WIDTH = 640;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Web `h-9` buttons with a 17 icon and `text-sm`; with larger text 48 high, a
|
|
27
|
-
* 22 icon and `text-lg`. In the tab bar slot: 48 high with a 20 icon over a
|
|
28
|
-
* `text-xs` label; with larger text 56, a 24 icon and `text-sm`. `caption` is
|
|
29
|
-
* the count chip, or the label under a docked icon.
|
|
30
|
-
*/
|
|
31
24
|
function barMetrics(largerText, docked) {
|
|
32
25
|
if (docked) {
|
|
33
26
|
return largerText ? {
|
|
@@ -54,9 +47,6 @@ function barMetrics(largerText, docked) {
|
|
|
54
47
|
caption: sizeStyle("text-xs")
|
|
55
48
|
};
|
|
56
49
|
}
|
|
57
|
-
|
|
58
|
-
// Docked at the bottom: it rises into place and sinks back out, the exit 20%
|
|
59
|
-
// quicker.
|
|
60
50
|
const BAR_ENTER = FadeInDown.duration(150).easing(EASE_OUT);
|
|
61
51
|
const BAR_EXIT = FadeOutDown.duration(120).easing(EASE_OUT);
|
|
62
52
|
|
|
@@ -443,13 +433,6 @@ export function BulkActionBar(t0) {
|
|
|
443
433
|
}
|
|
444
434
|
return t27;
|
|
445
435
|
}
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* A bar button box: the web `h-9 rounded-lg`, at least 44 wide and slopped to
|
|
449
|
-
* 44 high, `surface-secondary` while pressed (a 10% danger tint for a
|
|
450
|
-
* destructive one), faded to 30% when off. Docked: a pill (as the tab bar's
|
|
451
|
-
* active pill), at least 48 wide.
|
|
452
|
-
*/
|
|
453
436
|
function barButtonStyle(height, paddingX, pressed, disabled, destructive, docked, scheme) {
|
|
454
437
|
const pressedFill = destructive ? withAlpha(palette.danger[scheme], 0.1) : tokens.color.surfaceSecondary[scheme];
|
|
455
438
|
return {
|
|
@@ -540,11 +523,6 @@ function BarPressable(t0) {
|
|
|
540
523
|
}
|
|
541
524
|
return t7;
|
|
542
525
|
}
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* One action: the icon, and on wide screens the short label beside it
|
|
546
|
-
* (`text-sm` medium). Docked, the short label sits under the icon (`caption`).
|
|
547
|
-
*/
|
|
548
526
|
function BarButton(t0) {
|
|
549
527
|
const $ = _c(44);
|
|
550
528
|
const {
|
|
@@ -694,8 +672,6 @@ function BarButton(t0) {
|
|
|
694
672
|
}
|
|
695
673
|
return t6;
|
|
696
674
|
}
|
|
697
|
-
|
|
698
|
-
/** The web vertical `Separator`: `mx-1.5 h-5 bg-border`. */
|
|
699
675
|
function BarDivider() {
|
|
700
676
|
const $ = _c(2);
|
|
701
677
|
const scheme = useScheme();
|
package/dist/Button.jsx
CHANGED
|
@@ -9,15 +9,11 @@ import { cn } from "./cn";
|
|
|
9
9
|
import { buttonColors, sizeStyle, typeStyle } from "./controlStyles";
|
|
10
10
|
import { useDialogLayout } from "./dialogLayout";
|
|
11
11
|
import { floatingShadow } from "./floating";
|
|
12
|
+
import { useGlass } from "./glass";
|
|
12
13
|
import { Spinner } from "./Spinner";
|
|
13
14
|
import { useLargerText } from "./theme";
|
|
14
15
|
import { tokens } from "./tokens";
|
|
15
16
|
import { useScheme } from "./useScheme";
|
|
16
|
-
|
|
17
|
-
/** `sm`, `default` (or `md`) and `lg` are the web names for `small`, `medium` and `large`. `icon` is a square button. */
|
|
18
|
-
|
|
19
|
-
/** The web `shape`. `"pill"` (default) is fully round; `"rounded"` is radius 16, the look before 0.6.0. */
|
|
20
|
-
|
|
21
17
|
const SIZE_ALIAS = {
|
|
22
18
|
small: "small",
|
|
23
19
|
medium: "medium",
|
|
@@ -28,13 +24,6 @@ const SIZE_ALIAS = {
|
|
|
28
24
|
lg: "large",
|
|
29
25
|
icon: "icon"
|
|
30
26
|
};
|
|
31
|
-
|
|
32
|
-
// `regular` is the web `Button` (`default` h-10 px-4, `lg` h-11 px-6, `icon`
|
|
33
|
-
// h-10 w-10), except `sm`: the web h-8 `text-xs` is a desktop size, so here it
|
|
34
|
-
// is 36 high with a 14 label (`text-sm`). `larger` is the larger-text step-up from
|
|
35
|
-
// 0.3.2. Labelled sizes are minimum heights (`h-auto` drops the primitive's
|
|
36
|
-
// `h-10`), so a large Dynamic Type size grows the button instead of clipping
|
|
37
|
-
// the label.
|
|
38
27
|
const HEIGHT = {
|
|
39
28
|
regular: {
|
|
40
29
|
small: "h-auto min-h-9 px-3",
|
|
@@ -49,8 +38,6 @@ const HEIGHT = {
|
|
|
49
38
|
icon: "h-14 w-14 px-0"
|
|
50
39
|
}
|
|
51
40
|
};
|
|
52
|
-
|
|
53
|
-
// Each class is also set as a style (`sizeStyle`): web `text-sm` is 14 / 20.
|
|
54
41
|
const TEXT = {
|
|
55
42
|
regular: {
|
|
56
43
|
small: "text-sm",
|
|
@@ -65,11 +52,6 @@ const TEXT = {
|
|
|
65
52
|
icon: "text-base"
|
|
66
53
|
}
|
|
67
54
|
};
|
|
68
|
-
|
|
69
|
-
// The web sizes are under the 44 pt touch target; the slop brings each to 44
|
|
70
|
-
// or more. `small` (32) slops only above and below: small buttons sit 4 apart
|
|
71
|
-
// in a row (Cancel and Delete), and side slop would let one steal the other's
|
|
72
|
-
// taps. The larger sizes are 56 or more and need none.
|
|
73
55
|
const HIT_SLOP = {
|
|
74
56
|
regular: {
|
|
75
57
|
small: {
|
|
@@ -89,20 +71,10 @@ const HIT_SLOP = {
|
|
|
89
71
|
icon: undefined
|
|
90
72
|
}
|
|
91
73
|
};
|
|
92
|
-
|
|
93
|
-
// The web `shape` (from @vvedantb/ui 0.31.0). `pill` is `rounded-full`:
|
|
94
|
-
// `tokens.radius.pill` (999), far more than half the tallest minimum height
|
|
95
|
-
// (72), so the ends are half circles. `rounded` is `rounded-lg` (`--radius`, 16). The web
|
|
96
|
-
// `rounded` is `rounded-md` on `xs` and `icon-xs`, sizes native does not have,
|
|
97
|
-
// so here it is 16 at every size. Styles, because apps' NativeWind themes set
|
|
98
|
-
// their own `rounded-lg`.
|
|
99
74
|
const RADIUS = {
|
|
100
75
|
pill: tokens.radius.pill,
|
|
101
76
|
rounded: tokens.radius.lg
|
|
102
77
|
};
|
|
103
|
-
|
|
104
|
-
// Colours come from `buttonColors` as styles, except `tinted` (a legacy
|
|
105
|
-
// alias), which keeps the pink classes that `outline` used before 0.3.0.
|
|
106
78
|
const VARIANT_CLASS = {
|
|
107
79
|
link: "h-auto border-0 px-0",
|
|
108
80
|
tinted: "border-0 bg-pink-50 dark:bg-pink-900/20"
|
|
@@ -131,7 +103,7 @@ const PRIMITIVE_VARIANT = {
|
|
|
131
103
|
* asChild`) can measure it.
|
|
132
104
|
*/
|
|
133
105
|
export const Button = React.forwardRef(function Button(t0, ref) {
|
|
134
|
-
const $ = _c(
|
|
106
|
+
const $ = _c(69);
|
|
135
107
|
let children;
|
|
136
108
|
let className;
|
|
137
109
|
let endContent;
|
|
@@ -215,6 +187,8 @@ export const Button = React.forwardRef(function Button(t0, ref) {
|
|
|
215
187
|
const colors = t6;
|
|
216
188
|
const contentColor = colors?.color ?? PINK_600;
|
|
217
189
|
const elevate = shadowType === "shadow" && (variant === "primary" || variant === "default");
|
|
190
|
+
const glass = useGlass("control");
|
|
191
|
+
const filled = variant === "primary" || variant === "default" || variant === "secondary";
|
|
218
192
|
const t7 = RADIUS[shape];
|
|
219
193
|
let t8;
|
|
220
194
|
if ($[18] !== t7) {
|
|
@@ -227,129 +201,131 @@ export const Button = React.forwardRef(function Button(t0, ref) {
|
|
|
227
201
|
t8 = $[19];
|
|
228
202
|
}
|
|
229
203
|
const t9 = elevate ? floatingShadow : null;
|
|
230
|
-
|
|
204
|
+
const t10 = filled ? glass : null;
|
|
205
|
+
let t11;
|
|
231
206
|
if ($[20] !== colors) {
|
|
232
|
-
|
|
207
|
+
t11 = colors ? {
|
|
233
208
|
backgroundColor: colors.backgroundColor,
|
|
234
209
|
borderColor: colors.borderColor
|
|
235
210
|
} : null;
|
|
236
211
|
$[20] = colors;
|
|
237
|
-
$[21] =
|
|
212
|
+
$[21] = t11;
|
|
238
213
|
} else {
|
|
239
|
-
|
|
214
|
+
t11 = $[21];
|
|
240
215
|
}
|
|
241
|
-
let
|
|
242
|
-
if ($[22] !== t10 || $[23] !==
|
|
243
|
-
|
|
216
|
+
let t12;
|
|
217
|
+
if ($[22] !== t10 || $[23] !== t11 || $[24] !== t8 || $[25] !== t9) {
|
|
218
|
+
t12 = [t8, t9, t10, t11];
|
|
244
219
|
$[22] = t10;
|
|
245
|
-
$[23] =
|
|
246
|
-
$[24] =
|
|
247
|
-
$[25] =
|
|
220
|
+
$[23] = t11;
|
|
221
|
+
$[24] = t8;
|
|
222
|
+
$[25] = t9;
|
|
223
|
+
$[26] = t12;
|
|
248
224
|
} else {
|
|
249
|
-
|
|
225
|
+
t12 = $[26];
|
|
250
226
|
}
|
|
251
|
-
const baseStyle =
|
|
227
|
+
const baseStyle = t12;
|
|
252
228
|
const callerStyle = props.style;
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
229
|
+
let t13;
|
|
230
|
+
if ($[27] !== contentColor || $[28] !== icon || $[29] !== leftIcon || $[30] !== loading || $[31] !== scale || $[32] !== startContent) {
|
|
231
|
+
t13 = loading ? <Spinner size="sm" color={contentColor} decorative={true} /> : leftIcon ?? startContent ?? (icon ? <MaterialIcons name={icon} size={scale === "larger" ? 26 : 16} color={contentColor} /> : null);
|
|
232
|
+
$[27] = contentColor;
|
|
233
|
+
$[28] = icon;
|
|
234
|
+
$[29] = leftIcon;
|
|
235
|
+
$[30] = loading;
|
|
236
|
+
$[31] = scale;
|
|
237
|
+
$[32] = startContent;
|
|
238
|
+
$[33] = t13;
|
|
263
239
|
} else {
|
|
264
|
-
|
|
240
|
+
t13 = $[33];
|
|
265
241
|
}
|
|
266
|
-
const start =
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
let
|
|
274
|
-
if ($[
|
|
275
|
-
|
|
276
|
-
$[
|
|
277
|
-
$[34] = t15;
|
|
242
|
+
const start = t13;
|
|
243
|
+
const t14 = PRIMITIVE_VARIANT[variant];
|
|
244
|
+
const t15 = HIT_SLOP[scale][resolvedSize];
|
|
245
|
+
const t16 = HEIGHT[scale][resolvedSize];
|
|
246
|
+
const t17 = resolvedSize !== "icon" && (fullWidth || dialog.stacked ? "w-full" : "self-start");
|
|
247
|
+
const t18 = dialog.compact && scale === "regular" && resolvedSize !== "icon" && "min-h-11";
|
|
248
|
+
const t19 = VARIANT_CLASS[variant];
|
|
249
|
+
let t20;
|
|
250
|
+
if ($[34] !== className || $[35] !== t16 || $[36] !== t17 || $[37] !== t18 || $[38] !== t19) {
|
|
251
|
+
t20 = cn("relative border", t16, t17, t18, t19, className);
|
|
252
|
+
$[34] = className;
|
|
278
253
|
$[35] = t16;
|
|
279
254
|
$[36] = t17;
|
|
280
255
|
$[37] = t18;
|
|
281
256
|
$[38] = t19;
|
|
257
|
+
$[39] = t20;
|
|
282
258
|
} else {
|
|
283
|
-
|
|
259
|
+
t20 = $[39];
|
|
284
260
|
}
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
let
|
|
290
|
-
if ($[
|
|
291
|
-
|
|
292
|
-
...
|
|
293
|
-
disabled:
|
|
294
|
-
busy:
|
|
261
|
+
const t21 = loading || props.disabled;
|
|
262
|
+
const t22 = props.accessibilityState;
|
|
263
|
+
const t23 = Boolean(loading || props.disabled);
|
|
264
|
+
const t24 = Boolean(loading);
|
|
265
|
+
let t25;
|
|
266
|
+
if ($[40] !== props.accessibilityState || $[41] !== t23 || $[42] !== t24) {
|
|
267
|
+
t25 = {
|
|
268
|
+
...t22,
|
|
269
|
+
disabled: t23,
|
|
270
|
+
busy: t24
|
|
295
271
|
};
|
|
296
|
-
$[
|
|
297
|
-
$[40] = t22;
|
|
272
|
+
$[40] = props.accessibilityState;
|
|
298
273
|
$[41] = t23;
|
|
299
274
|
$[42] = t24;
|
|
275
|
+
$[43] = t25;
|
|
300
276
|
} else {
|
|
301
|
-
|
|
277
|
+
t25 = $[43];
|
|
302
278
|
}
|
|
303
|
-
let
|
|
304
|
-
if ($[
|
|
305
|
-
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
279
|
+
let t26;
|
|
280
|
+
if ($[44] !== baseStyle || $[45] !== callerStyle) {
|
|
281
|
+
t26 = typeof callerStyle === "function" ? state => [baseStyle, callerStyle(state)] : [baseStyle, callerStyle];
|
|
282
|
+
$[44] = baseStyle;
|
|
283
|
+
$[45] = callerStyle;
|
|
284
|
+
$[46] = t26;
|
|
309
285
|
} else {
|
|
310
|
-
|
|
286
|
+
t26 = $[46];
|
|
311
287
|
}
|
|
312
|
-
let
|
|
313
|
-
if ($[
|
|
314
|
-
|
|
288
|
+
let t27;
|
|
289
|
+
if ($[47] !== children || $[48] !== colors || $[49] !== resolvedSize || $[50] !== scale || $[51] !== variant) {
|
|
290
|
+
t27 = typeof children === "string" || typeof children === "number" ? <PrimitiveText className={cn(TEXT[scale][resolvedSize], "font-instrument-sans-medium", TEXT_CLASS[variant])} style={[colors ? {
|
|
315
291
|
color: colors.color
|
|
316
292
|
} : null, sizeStyle(TEXT[scale][resolvedSize]), typeStyle("medium")]}>{children}</PrimitiveText> : children;
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
293
|
+
$[47] = children;
|
|
294
|
+
$[48] = colors;
|
|
295
|
+
$[49] = resolvedSize;
|
|
296
|
+
$[50] = scale;
|
|
297
|
+
$[51] = variant;
|
|
298
|
+
$[52] = t27;
|
|
323
299
|
} else {
|
|
324
|
-
|
|
300
|
+
t27 = $[52];
|
|
325
301
|
}
|
|
326
|
-
let
|
|
327
|
-
if ($[
|
|
328
|
-
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[54] = t26;
|
|
302
|
+
let t28;
|
|
303
|
+
if ($[53] !== endContent || $[54] !== start || $[55] !== t27) {
|
|
304
|
+
t28 = <View className="flex-row items-center justify-center gap-2">{start}{t27}{endContent}</View>;
|
|
305
|
+
$[53] = endContent;
|
|
306
|
+
$[54] = start;
|
|
332
307
|
$[55] = t27;
|
|
308
|
+
$[56] = t28;
|
|
333
309
|
} else {
|
|
334
|
-
|
|
310
|
+
t28 = $[56];
|
|
335
311
|
}
|
|
336
|
-
let
|
|
337
|
-
if ($[
|
|
338
|
-
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[60] = t13;
|
|
312
|
+
let t29;
|
|
313
|
+
if ($[57] !== onPress || $[58] !== props || $[59] !== ref || $[60] !== shape || $[61] !== t14 || $[62] !== t15 || $[63] !== t20 || $[64] !== t21 || $[65] !== t25 || $[66] !== t26 || $[67] !== t28) {
|
|
314
|
+
t29 = <PrimitiveButton ref={ref} onPress={onPress} variant={t14} shape={shape} hitSlop={t15} accessibilityRole="button" className={t20} {...props} disabled={t21} accessibilityState={t25} style={t26}>{t28}</PrimitiveButton>;
|
|
315
|
+
$[57] = onPress;
|
|
316
|
+
$[58] = props;
|
|
317
|
+
$[59] = ref;
|
|
318
|
+
$[60] = shape;
|
|
344
319
|
$[61] = t14;
|
|
345
|
-
$[62] =
|
|
320
|
+
$[62] = t15;
|
|
346
321
|
$[63] = t20;
|
|
347
|
-
$[64] =
|
|
322
|
+
$[64] = t21;
|
|
348
323
|
$[65] = t25;
|
|
349
|
-
$[66] =
|
|
324
|
+
$[66] = t26;
|
|
350
325
|
$[67] = t28;
|
|
326
|
+
$[68] = t29;
|
|
351
327
|
} else {
|
|
352
|
-
|
|
328
|
+
t29 = $[68];
|
|
353
329
|
}
|
|
354
|
-
return
|
|
330
|
+
return t29;
|
|
355
331
|
});
|