@vvedantb/native-ui 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar.jsx +22 -19
- package/dist/BottomSheetContainer.jsx +0 -6
- package/dist/BulkActionBar.jsx +0 -24
- package/dist/Button.jsx +92 -116
- package/dist/Card.jsx +56 -50
- package/dist/ColorSwatches.jsx +0 -6
- package/dist/Dialog.jsx +0 -12
- package/dist/DropdownMenu.jsx +0 -10
- package/dist/EmptyState.jsx +0 -3
- package/dist/ExpoWebRoot.jsx +0 -6
- package/dist/Field.jsx +0 -17
- package/dist/FloatingSurface.jsx +95 -80
- package/dist/FloatingTabBar.jsx +0 -23
- package/dist/IconButton.jsx +0 -1
- package/dist/LoadingState.jsx +0 -6
- package/dist/PasswordInput.jsx +0 -15
- package/dist/PillTabs.jsx +39 -36
- package/dist/SearchInput.jsx +0 -13
- package/dist/SectionLabel.jsx +0 -1
- package/dist/SharedTransition.jsx +0 -3
- package/dist/Skeleton.jsx +0 -2
- package/dist/Spinner.jsx +0 -2
- package/dist/StatusDot.jsx +0 -5
- package/dist/Switch.jsx +32 -22
- package/dist/Tabs.jsx +27 -26
- package/dist/Textarea.jsx +0 -1
- package/dist/ThemeToggle.jsx +0 -1
- package/dist/Toast.jsx +80 -91
- package/dist/UpdateChecker.jsx +0 -1
- package/dist/ai/activity-question.jsx +0 -6
- package/dist/ai/activity-step-label.js +0 -6
- package/dist/ai/activity-step-types.js +0 -4
- package/dist/ai/activity-tasks-utils.js +0 -17
- package/dist/ai/activity-timeline.js +0 -8
- package/dist/ai/attachments.jsx +0 -2
- package/dist/ai/chain-of-thought.jsx +0 -3
- package/dist/ai/chat-text.js +2 -3
- package/dist/ai/chat-thread.jsx +0 -1
- package/dist/ai/choice-question.jsx +0 -10
- package/dist/ai/code-block.jsx +0 -31
- package/dist/ai/collapsible.jsx +0 -14
- package/dist/ai/conversation-context.js +0 -3
- package/dist/ai/conversation.jsx +2 -48
- package/dist/ai/file-chip.jsx +0 -2
- package/dist/ai/icon-button.jsx +10 -18
- package/dist/ai/index.js +0 -5
- package/dist/ai/message-context-menu.jsx +0 -7
- package/dist/ai/message.jsx +0 -21
- package/dist/ai/prompt-input-menu.jsx +0 -3
- package/dist/ai/prompt-input.jsx +2 -29
- package/dist/ai/response-text.jsx +0 -6
- package/dist/ai/sources.jsx +0 -1
- package/dist/ai/suggestion.jsx +0 -1
- package/dist/ai/trace.jsx +0 -11
- package/dist/ai/unified-diff.jsx +0 -4
- package/dist/auth/AuthScreen.jsx +0 -5
- package/dist/auth/GoogleSignInButton.jsx +0 -3
- package/dist/auth/SecondFactorScreen.jsx +0 -2
- package/dist/auth/SignInScreen.jsx +0 -17
- package/dist/auth/authErrors.js +0 -4
- package/dist/auth/clerkCore3.js +0 -7
- package/dist/auth/index.js +0 -4
- package/dist/auth/totp.js +0 -2
- package/dist/brand/GoogleMark.jsx +0 -1
- package/dist/brand/ProviderIcon.jsx +0 -2
- package/dist/brand/index.js +0 -3
- package/dist/brand/svg.js +0 -6
- package/dist/configureTheme.js +0 -9
- package/dist/controlStyles.js +0 -14
- package/dist/crash/lastCrash.js +3 -24
- package/dist/entries/ai.js +0 -3
- package/dist/entries/ambient.js +0 -2
- package/dist/entries/app-root.js +0 -5
- package/dist/entries/auth.js +0 -4
- package/dist/entries/bottom-sheet.js +0 -2
- package/dist/entries/brand.js +0 -1
- package/dist/entries/button.js +0 -1
- package/dist/entries/crash.js +0 -3
- package/dist/entries/date-time.js +0 -2
- package/dist/entries/expo-router.js +0 -3
- package/dist/entries/expo-web-root.js +0 -2
- package/dist/entries/floating.js +0 -2
- package/dist/entries/generative-ui.js +0 -4
- package/dist/entries/gesture-handler.js +0 -3
- package/dist/entries/keyboard-controller.js +0 -3
- package/dist/entries/layout.js +0 -2
- package/dist/entries/markdown.js +0 -3
- package/dist/entries/marketing.js +0 -1
- package/dist/entries/page-title.js +0 -5
- package/dist/entries/password-input.js +0 -2
- package/dist/entries/paste-input.js +0 -3
- package/dist/entries/primitives.js +0 -6
- package/dist/entries/search-input.js +0 -2
- package/dist/entries/tab-bar.js +0 -2
- package/dist/entries/theme.js +1 -2
- package/dist/entries/toast.js +0 -3
- package/dist/entries/video.js +0 -2
- package/dist/entries/webview.js +0 -2
- package/dist/examples/AiChatGallery.jsx +0 -11
- package/dist/examples/ParityGallery.jsx +0 -12
- package/dist/floating.js +0 -8
- package/dist/generative-ui/GenerativeUiPanel.jsx +0 -2
- package/dist/generative-ui/components.jsx +0 -8
- package/dist/glass.js +55 -0
- package/dist/glassBlur.jsx +0 -12
- package/dist/highlight.js +0 -26
- package/dist/index.js +1 -2
- package/dist/loadingGrid.js +0 -13
- package/dist/markdown/Markdown.jsx +0 -59
- package/dist/markdown/MarkdownTable.jsx +0 -18
- package/dist/markdown/tableText.js +0 -5
- package/dist/marketing/UpgradeToProCard.jsx +0 -5
- package/dist/marketing/pricing.js +0 -3
- package/dist/media/ImageGallery.jsx +0 -16
- package/dist/media/imageZoom.js +0 -4
- package/dist/media/zoom-image-gesture.jsx +0 -8
- package/dist/media/zoomImage.js +0 -3
- package/dist/motion.js +0 -3
- package/dist/neutralTheme.js +0 -5
- package/dist/pagerSwipe.js +0 -16
- package/dist/palette.js +0 -10
- package/dist/primitives/button.jsx +0 -5
- package/dist/primitives/keyboard-controller.jsx +0 -27
- package/dist/primitives/native-only-animated-view.jsx +0 -5
- package/dist/primitives/overlay.jsx +0 -2
- package/dist/primitives/pager-gesture.jsx +3 -29
- package/dist/primitives/paste-input.jsx +0 -5
- package/dist/primitives/select.jsx +0 -8
- package/dist/primitives/sheet-drag.jsx +0 -3
- package/dist/primitives/sheet-gesture.jsx +0 -8
- package/dist/primitives/swipe-row-gesture.jsx +3 -45
- package/dist/primitives/text.jsx +0 -5
- package/dist/primitives/toast-drag-gesture.jsx +4 -24
- package/dist/primitives/web-click-guard.js +0 -3
- package/dist/primitives/window-layer.jsx +0 -14
- package/dist/push.js +0 -6
- package/dist/relativeTime.js +0 -13
- package/dist/settings/MoreFromProjectV.jsx +0 -5
- package/dist/settings/ThemeModePicker.jsx +0 -4
- package/dist/settings/projectVMobileApps.js +1 -6
- package/dist/sheetDrag.js +0 -10
- package/dist/swipeRow.js +0 -15
- package/dist/tabBarRoutes.js +0 -4
- package/dist/tabIndicator.js +0 -4
- package/dist/tailwind-preset.cjs +0 -54
- package/dist/tailwind-preset.d.cts +0 -8
- package/dist/theme.jsx +29 -21
- package/dist/themeModeStore.js +0 -5
- package/dist/toastChrome.js +0 -6
- package/dist/toastDrag.js +0 -14
- package/dist/toastStore.js +0 -4
- package/dist/updateCheck.js +0 -7
- package/dist/video/InlineVideo.jsx +0 -2
- package/dist/webview/htmlView.js +0 -5
- package/package.json +3 -3
- package/src/ArtifactList.tsx +0 -2
- package/src/Avatar.tsx +3 -3
- package/src/Badge.tsx +0 -1
- package/src/BottomSheetContainer.tsx +0 -11
- package/src/BulkActionBar.tsx +0 -66
- package/src/Button.tsx +4 -40
- package/src/CaptureButton.tsx +0 -1
- package/src/Card.tsx +3 -15
- package/src/Checkbox.tsx +0 -2
- package/src/ColorSwatches.tsx +0 -9
- package/src/ConfirmDialog.tsx +0 -7
- package/src/DateTimeField.tsx +0 -5
- package/src/Dialog.tsx +0 -27
- package/src/DividedList.tsx +0 -1
- package/src/DropdownMenu.tsx +0 -51
- package/src/EmptyState.tsx +0 -5
- package/src/ExpoWebRoot.tsx +0 -10
- package/src/Field.tsx +0 -14
- package/src/FloatingFAB.tsx +0 -3
- package/src/FloatingSurface.tsx +11 -8
- package/src/FloatingTabBar.tsx +0 -25
- package/src/IconButton.tsx +0 -5
- package/src/Input.tsx +0 -1
- package/src/Label.tsx +0 -1
- package/src/LabeledSwitchRow.tsx +0 -2
- package/src/ListRow.tsx +0 -12
- package/src/LoadingState.tsx +0 -12
- package/src/MenuSheet.tsx +0 -2
- package/src/PageIndicator.tsx +0 -2
- package/src/PageTitle.tsx +0 -15
- package/src/Pager.tsx +0 -9
- package/src/PasswordInput.tsx +0 -24
- package/src/PillTabs.tsx +3 -11
- package/src/PinnedBotTile.tsx +0 -6
- package/src/Progress.tsx +0 -3
- package/src/ReactionRow.tsx +0 -8
- package/src/ScreenContainer.tsx +0 -4
- package/src/SearchInput.tsx +0 -25
- package/src/SectionLabel.tsx +0 -2
- package/src/Select.tsx +0 -6
- package/src/Separator.tsx +0 -2
- package/src/SharedTransition.tsx +0 -7
- package/src/Sheet.tsx +0 -3
- package/src/SheetRow.tsx +0 -12
- package/src/Skeleton.tsx +0 -10
- package/src/Spinner.tsx +0 -6
- package/src/StackPageHeader.tsx +0 -16
- package/src/StatGrid.tsx +0 -1
- package/src/StatusDot.tsx +0 -6
- package/src/SurfaceRow.tsx +0 -12
- package/src/SwipeableRow.tsx +0 -4
- package/src/Switch.tsx +3 -4
- package/src/Tabs.tsx +3 -27
- package/src/Textarea.tsx +0 -2
- package/src/ThemeToggle.tsx +0 -1
- package/src/Toast.tsx +3 -19
- package/src/UpdateChecker.tsx +0 -46
- package/src/ai/activity-question.tsx +0 -8
- package/src/ai/activity-step-detail.tsx +0 -5
- package/src/ai/activity-step-label.ts +0 -5
- package/src/ai/activity-step-types.ts +0 -24
- package/src/ai/activity-step.tsx +0 -4
- package/src/ai/activity-tasks-utils.ts +0 -13
- package/src/ai/activity-timeline.ts +0 -6
- package/src/ai/attachments.tsx +0 -13
- package/src/ai/chain-of-thought.tsx +0 -5
- package/src/ai/chat-jump-rail.tsx +0 -2
- package/src/ai/chat-text.ts +2 -3
- package/src/ai/chat-thread.tsx +0 -9
- package/src/ai/choice-question.tsx +0 -36
- package/src/ai/code-block.tsx +0 -52
- package/src/ai/collapsible.tsx +0 -12
- package/src/ai/conversation-context.ts +0 -14
- package/src/ai/conversation.tsx +0 -58
- package/src/ai/file-chip.tsx +0 -1
- package/src/ai/icon-button.tsx +5 -22
- package/src/ai/index.ts +0 -5
- package/src/ai/message-action-sheet.tsx +0 -8
- package/src/ai/message-context-menu.tsx +0 -22
- package/src/ai/message-quote.tsx +0 -4
- package/src/ai/message.tsx +0 -66
- package/src/ai/prompt-input-menu.tsx +0 -19
- package/src/ai/prompt-input.tsx +1 -98
- package/src/ai/reasoning.tsx +0 -6
- package/src/ai/reply-quote-chip.tsx +0 -5
- package/src/ai/response-text.tsx +0 -8
- package/src/ai/shimmer.tsx +0 -2
- package/src/ai/sources.tsx +0 -3
- package/src/ai/subagent-cards.tsx +0 -13
- package/src/ai/suggestion.tsx +0 -4
- package/src/ai/tool-approval-card.tsx +0 -14
- package/src/ai/trace.tsx +0 -23
- package/src/ai/unified-diff.tsx +0 -16
- package/src/ai/use-streaming-disclosure.ts +0 -4
- package/src/app-root/AuthGroupGate.tsx +0 -8
- package/src/app-root/SsoCallbackScreen.tsx +0 -10
- package/src/app-root/fonts.ts +0 -2
- package/src/auth/AccountScreens.tsx +0 -16
- package/src/auth/AuthProviders.tsx +0 -13
- package/src/auth/AuthScreen.tsx +0 -12
- package/src/auth/GoogleSignInButton.tsx +0 -12
- package/src/auth/SecondFactorScreen.tsx +0 -16
- package/src/auth/SignInScreen.tsx +0 -68
- package/src/auth/authErrors.ts +0 -6
- package/src/auth/clerkCore3.ts +0 -6
- package/src/auth/index.ts +0 -4
- package/src/auth/totp.ts +0 -13
- package/src/brand/AppIcons.tsx +0 -6
- package/src/brand/AppMark.tsx +0 -5
- package/src/brand/AppWordmark.tsx +0 -7
- package/src/brand/GoogleMark.tsx +0 -4
- package/src/brand/ProviderIcon.tsx +0 -6
- package/src/brand/familyApps.ts +0 -2
- package/src/brand/index.ts +0 -3
- package/src/brand/svg.ts +0 -9
- package/src/configureTheme.ts +0 -10
- package/src/controlStyles.ts +0 -12
- package/src/crash/LastCrashDialog.tsx +0 -6
- package/src/crash/lastCrash.ts +0 -21
- package/src/entries/ai.ts +0 -3
- package/src/entries/ambient.ts +0 -2
- package/src/entries/app-root.ts +0 -5
- package/src/entries/auth.ts +0 -4
- package/src/entries/bottom-sheet.ts +0 -2
- package/src/entries/brand.ts +0 -1
- package/src/entries/button.ts +0 -1
- package/src/entries/crash.ts +0 -3
- package/src/entries/date-time.ts +0 -2
- package/src/entries/expo-router.ts +0 -3
- package/src/entries/expo-web-root.ts +0 -2
- package/src/entries/floating.ts +0 -2
- package/src/entries/generative-ui.ts +0 -4
- package/src/entries/gesture-handler.ts +0 -3
- package/src/entries/keyboard-controller.ts +0 -3
- package/src/entries/layout.ts +0 -2
- package/src/entries/markdown.ts +0 -3
- package/src/entries/marketing.ts +0 -1
- package/src/entries/page-title.ts +0 -5
- package/src/entries/password-input.ts +0 -2
- package/src/entries/paste-input.ts +0 -3
- package/src/entries/primitives.ts +0 -6
- package/src/entries/search-input.ts +0 -2
- package/src/entries/tab-bar.ts +0 -2
- package/src/entries/theme.ts +2 -2
- package/src/entries/toast.ts +0 -3
- package/src/entries/video.ts +0 -2
- package/src/entries/webview.ts +0 -2
- package/src/examples/AiChatGallery.tsx +0 -11
- package/src/examples/ParityGallery.tsx +0 -25
- package/src/floating.ts +0 -6
- package/src/generative-ui/GenerativeUiPanel.tsx +0 -15
- package/src/generative-ui/components.tsx +0 -9
- package/src/generative-ui/context.ts +0 -2
- package/src/glass.ts +31 -0
- package/src/glassBlur.tsx +0 -15
- package/src/highlight.ts +0 -20
- package/src/index.ts +2 -2
- package/src/loadingGrid.ts +0 -12
- package/src/markdown/Markdown.tsx +0 -71
- package/src/markdown/MarkdownTable.tsx +0 -23
- package/src/markdown/tableText.ts +0 -3
- package/src/marketing/PricingModal.tsx +0 -13
- package/src/marketing/UpgradeToProCard.tsx +0 -14
- package/src/marketing/pricing.ts +0 -12
- package/src/media/ImageGallery.tsx +0 -18
- package/src/media/MediaCard.tsx +0 -8
- package/src/media/imageZoom.ts +0 -4
- package/src/media/zoom-image-gesture.tsx +0 -9
- package/src/media/zoomImage.ts +0 -5
- package/src/motion.ts +0 -3
- package/src/neutralTheme.ts +0 -3
- package/src/pagerSwipe.ts +0 -13
- package/src/palette.ts +0 -10
- package/src/pressScale.ts +0 -7
- package/src/primitives/button.tsx +0 -4
- package/src/primitives/card.tsx +0 -1
- package/src/primitives/input.tsx +0 -4
- package/src/primitives/keyboard-controller.tsx +0 -25
- package/src/primitives/keyboard-parts.tsx +0 -27
- package/src/primitives/native-only-animated-view.tsx +0 -5
- package/src/primitives/overlay.tsx +0 -25
- package/src/primitives/pager-gesture.tsx +0 -20
- package/src/primitives/paste-input.tsx +0 -4
- package/src/primitives/paste-parts.tsx +0 -1
- package/src/primitives/select.tsx +0 -16
- package/src/primitives/sheet-drag.tsx +0 -19
- package/src/primitives/sheet-gesture.tsx +0 -22
- package/src/primitives/swipe-row-gesture.tsx +0 -33
- package/src/primitives/switch.tsx +0 -4
- package/src/primitives/text.tsx +0 -4
- package/src/primitives/toast-drag-gesture.tsx +0 -13
- package/src/primitives/web-click-guard.ts +0 -2
- package/src/primitives/window-layer.tsx +0 -18
- package/src/push.ts +0 -15
- package/src/relativeTime.ts +0 -21
- package/src/router/RouterStackPageHeader.tsx +0 -1
- package/src/settings/MoreFromProjectV.tsx +0 -8
- package/src/settings/SettingsEmptyState.tsx +0 -2
- package/src/settings/SettingsSection.tsx +0 -3
- package/src/settings/SettingsToggleRow.tsx +0 -4
- package/src/settings/ThemeModePicker.tsx +0 -11
- package/src/settings/projectVMobileApps.ts +0 -8
- package/src/sheetDrag.ts +0 -9
- package/src/swipeRow.ts +0 -23
- package/src/tabBarRoutes.ts +0 -13
- package/src/tabIndicator.ts +0 -5
- package/src/tailwind-preset.cjs +0 -54
- package/src/tailwind-preset.d.cts +0 -8
- package/src/theme.tsx +11 -2
- package/src/themeModeStore.ts +0 -9
- package/src/toastChrome.ts +0 -6
- package/src/toastDrag.ts +0 -13
- package/src/toastStore.ts +0 -7
- package/src/updateCheck.ts +0 -15
- package/src/video/InlineVideo.tsx +0 -5
- package/src/webview/HtmlView.tsx +0 -23
- package/src/webview/HtmlView.web.tsx +0 -1
- package/src/webview/htmlView.ts +0 -5
package/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
|
});
|
package/dist/Card.jsx
CHANGED
|
@@ -3,10 +3,11 @@ import { Pressable, Text, View } from "react-native";
|
|
|
3
3
|
import { Card as PrimitiveCard, CardContent as PrimitiveCardContent, CardHeader as PrimitiveCardHeader, CardTitle as PrimitiveCardTitle } from "./primitives/card";
|
|
4
4
|
import { cn } from "./cn";
|
|
5
5
|
import { cardStyle, sizeStyle, textStyle, typeStyle } from "./controlStyles";
|
|
6
|
+
import { useGlass } from "./glass";
|
|
6
7
|
import { useAccentColor, useLargerText } from "./theme";
|
|
7
8
|
import { useScheme } from "./useScheme";
|
|
8
9
|
export function Card(t0) {
|
|
9
|
-
const $ = _c(
|
|
10
|
+
const $ = _c(33);
|
|
10
11
|
const {
|
|
11
12
|
children,
|
|
12
13
|
title,
|
|
@@ -21,6 +22,7 @@ export function Card(t0) {
|
|
|
21
22
|
const largerText = useLargerText();
|
|
22
23
|
const accentColor = useAccentColor();
|
|
23
24
|
const scheme = useScheme();
|
|
25
|
+
const glass = useGlass("surface");
|
|
24
26
|
const hasHeader = Boolean(title || action);
|
|
25
27
|
const titleSize = largerText ? "text-2xl" : "text-base";
|
|
26
28
|
const t1 = onPress ? undefined : testID;
|
|
@@ -41,74 +43,78 @@ export function Card(t0) {
|
|
|
41
43
|
t3 = $[3];
|
|
42
44
|
}
|
|
43
45
|
let t4;
|
|
44
|
-
if ($[4] !==
|
|
45
|
-
t4 =
|
|
46
|
-
$[4] =
|
|
47
|
-
$[5] =
|
|
48
|
-
$[6] =
|
|
49
|
-
$[7] = description;
|
|
50
|
-
$[8] = hasHeader;
|
|
51
|
-
$[9] = largerText;
|
|
52
|
-
$[10] = scheme;
|
|
53
|
-
$[11] = title;
|
|
54
|
-
$[12] = titleSize;
|
|
55
|
-
$[13] = t4;
|
|
46
|
+
if ($[4] !== glass || $[5] !== t3) {
|
|
47
|
+
t4 = [t3, glass];
|
|
48
|
+
$[4] = glass;
|
|
49
|
+
$[5] = t3;
|
|
50
|
+
$[6] = t4;
|
|
56
51
|
} else {
|
|
57
|
-
t4 = $[
|
|
52
|
+
t4 = $[6];
|
|
58
53
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
54
|
+
let t5;
|
|
55
|
+
if ($[7] !== Icon || $[8] !== accentColor || $[9] !== action || $[10] !== description || $[11] !== hasHeader || $[12] !== largerText || $[13] !== scheme || $[14] !== title || $[15] !== titleSize) {
|
|
56
|
+
t5 = hasHeader && <PrimitiveCardHeader className="px-4 py-0"><View className="flex-row items-center justify-between"><View className="flex-row items-center gap-2">{Icon && <Icon size={largerText ? 28 : 24} color={accentColor} />}{title ? <PrimitiveCardTitle className={cn("font-instrument-sans-medium leading-tight", titleSize)} style={[textStyle("foreground", scheme), sizeStyle(titleSize, "tight"), typeStyle("medium")]}>{title}</PrimitiveCardTitle> : null}</View>{action}</View>{description ? <CardDescription>{description}</CardDescription> : null}</PrimitiveCardHeader>;
|
|
57
|
+
$[7] = Icon;
|
|
58
|
+
$[8] = accentColor;
|
|
59
|
+
$[9] = action;
|
|
60
|
+
$[10] = description;
|
|
61
|
+
$[11] = hasHeader;
|
|
62
|
+
$[12] = largerText;
|
|
63
|
+
$[13] = scheme;
|
|
64
|
+
$[14] = title;
|
|
65
|
+
$[15] = titleSize;
|
|
66
|
+
$[16] = t5;
|
|
65
67
|
} else {
|
|
66
|
-
|
|
68
|
+
t5 = $[16];
|
|
67
69
|
}
|
|
70
|
+
const t6 = hasHeader && "pt-0";
|
|
68
71
|
let t7;
|
|
69
|
-
if ($[
|
|
70
|
-
t7 =
|
|
71
|
-
$[16] = children;
|
|
72
|
+
if ($[17] !== t6) {
|
|
73
|
+
t7 = cn(t6, "px-4");
|
|
72
74
|
$[17] = t6;
|
|
73
75
|
$[18] = t7;
|
|
74
76
|
} else {
|
|
75
77
|
t7 = $[18];
|
|
76
78
|
}
|
|
77
79
|
let t8;
|
|
78
|
-
if ($[19] !==
|
|
79
|
-
t8 = <
|
|
80
|
-
$[19] =
|
|
81
|
-
$[20] =
|
|
82
|
-
$[21] =
|
|
83
|
-
|
|
84
|
-
$[
|
|
85
|
-
|
|
80
|
+
if ($[19] !== children || $[20] !== t7) {
|
|
81
|
+
t8 = <PrimitiveCardContent className={t7}>{children}</PrimitiveCardContent>;
|
|
82
|
+
$[19] = children;
|
|
83
|
+
$[20] = t7;
|
|
84
|
+
$[21] = t8;
|
|
85
|
+
} else {
|
|
86
|
+
t8 = $[21];
|
|
87
|
+
}
|
|
88
|
+
let t9;
|
|
89
|
+
if ($[22] !== t1 || $[23] !== t2 || $[24] !== t4 || $[25] !== t5 || $[26] !== t8) {
|
|
90
|
+
t9 = <PrimitiveCard testID={t1} className={t2} style={t4}>{t5}{t8}</PrimitiveCard>;
|
|
91
|
+
$[22] = t1;
|
|
92
|
+
$[23] = t2;
|
|
93
|
+
$[24] = t4;
|
|
94
|
+
$[25] = t5;
|
|
95
|
+
$[26] = t8;
|
|
96
|
+
$[27] = t9;
|
|
86
97
|
} else {
|
|
87
|
-
|
|
98
|
+
t9 = $[27];
|
|
88
99
|
}
|
|
89
|
-
const card =
|
|
100
|
+
const card = t9;
|
|
90
101
|
if (!onPress) {
|
|
91
102
|
return card;
|
|
92
103
|
}
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
if ($[
|
|
96
|
-
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
104
|
+
const t10 = accessibilityLabel ?? title;
|
|
105
|
+
let t11;
|
|
106
|
+
if ($[28] !== card || $[29] !== onPress || $[30] !== t10 || $[31] !== testID) {
|
|
107
|
+
t11 = <Pressable testID={testID} accessibilityRole="button" accessibilityLabel={t10} onPress={onPress} className="active:opacity-70">{card}</Pressable>;
|
|
108
|
+
$[28] = card;
|
|
109
|
+
$[29] = onPress;
|
|
110
|
+
$[30] = t10;
|
|
111
|
+
$[31] = testID;
|
|
112
|
+
$[32] = t11;
|
|
102
113
|
} else {
|
|
103
|
-
|
|
114
|
+
t11 = $[32];
|
|
104
115
|
}
|
|
105
|
-
return
|
|
116
|
+
return t11;
|
|
106
117
|
}
|
|
107
|
-
|
|
108
|
-
// Parts for composing a card body with the web part names. They sit inside
|
|
109
|
-
// `Card`'s padded content, so they add no side padding of their own. Text
|
|
110
|
-
// colours are styles that follow the colour scheme; recolour with `style`.
|
|
111
|
-
|
|
112
118
|
export function CardHeader(t0) {
|
|
113
119
|
const $ = _c(8);
|
|
114
120
|
let className;
|
package/dist/ColorSwatches.jsx
CHANGED
|
@@ -9,7 +9,6 @@ import { withAlpha } from "./palette";
|
|
|
9
9
|
import { useLargerText } from "./theme";
|
|
10
10
|
import { tokens } from "./tokens";
|
|
11
11
|
import { useScheme } from "./useScheme";
|
|
12
|
-
/** Swatch diameters, one step up with larger text. */
|
|
13
12
|
const DIAMETER = {
|
|
14
13
|
regular: {
|
|
15
14
|
sm: 24,
|
|
@@ -22,8 +21,6 @@ const DIAMETER = {
|
|
|
22
21
|
lg: 48
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
|
-
|
|
26
|
-
/** Selection ring width and the gap between the ring and the swatch. */
|
|
27
24
|
const RING = 2;
|
|
28
25
|
const RING_GAP = 2;
|
|
29
26
|
|
|
@@ -42,7 +39,6 @@ export function swatchCheckColor(color) {
|
|
|
42
39
|
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
43
40
|
};
|
|
44
41
|
const luminance = 0.2126 * linear(n >> 16 & 255) + 0.7152 * linear(n >> 8 & 255) + 0.0722 * linear(n & 255);
|
|
45
|
-
// Contrast with white is 1.05 / (L + 0.05); with black, (L + 0.05) / 0.05.
|
|
46
42
|
return 1.05 / (luminance + 0.05) >= (luminance + 0.05) / 0.05 ? tokens.color.white : tokens.color.black;
|
|
47
43
|
}
|
|
48
44
|
|
|
@@ -140,8 +136,6 @@ export function ColorSwatches(t0) {
|
|
|
140
136
|
}
|
|
141
137
|
return t7;
|
|
142
138
|
}
|
|
143
|
-
|
|
144
|
-
/** One swatch: a radio that scales a little on press. The slop does not scale. */
|
|
145
139
|
function Swatch(t0) {
|
|
146
140
|
const $ = _c(38);
|
|
147
141
|
const {
|