@multiplatform.one/components 7.59.0 → 7.61.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/cjs/appShell/BottomAccessory.cjs +43 -0
- package/dist/cjs/appShell/BottomAccessory.native.js +53 -0
- package/dist/cjs/appShell/BottomAccessory.native.js.map +1 -0
- package/dist/cjs/appShell/TabBar.cjs +99 -17
- package/dist/cjs/appShell/TabBar.native.js +109 -17
- package/dist/cjs/appShell/TabBar.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.cjs +76 -0
- package/dist/cjs/appShell/bottomChrome.native.js +110 -0
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -0
- package/dist/cjs/appShell/bottomInset.cjs +30 -0
- package/dist/cjs/appShell/bottomInset.native.js +34 -0
- package/dist/cjs/appShell/bottomInset.native.js.map +1 -0
- package/dist/cjs/appShell/index.cjs +13 -1
- package/dist/cjs/appShell/index.native.js +12 -0
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.cjs +540 -0
- package/dist/cjs/formLayouts/FormLayouts.native.js +571 -0
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -0
- package/dist/cjs/formLayouts/PreferencePanel.cjs +215 -0
- package/dist/cjs/formLayouts/PreferencePanel.native.js +237 -0
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -0
- package/dist/cjs/formLayouts/index.cjs +36 -0
- package/dist/cjs/formLayouts/index.native.js +39 -0
- package/dist/cjs/formLayouts/index.native.js.map +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +11 -3
- package/dist/cjs/layouts/page.native.js +11 -3
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/Quote/index.native.js.map +1 -1
- package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
- package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
- package/dist/esm/Video/VideoFrame.native.js.map +1 -1
- package/dist/esm/Video/types.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wizard/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/actions/DangerSection.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/actions/HeaderActions.native.js.map +1 -1
- package/dist/esm/actions/devWarn.native.js.map +1 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/actions/severity.native.js.map +1 -1
- package/dist/esm/appShell/BottomAccessory.mjs +18 -0
- package/dist/esm/appShell/BottomAccessory.mjs.map +1 -0
- package/dist/esm/appShell/BottomAccessory.native.js +25 -0
- package/dist/esm/appShell/BottomAccessory.native.js.map +1 -0
- package/dist/esm/appShell/Dock.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.mjs +99 -20
- package/dist/esm/appShell/TabBar.mjs.map +1 -1
- package/dist/esm/appShell/TabBar.native.js +109 -20
- package/dist/esm/appShell/TabBar.native.js.map +1 -1
- package/dist/esm/appShell/appTile.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.mjs +46 -0
- package/dist/esm/appShell/bottomChrome.mjs.map +1 -0
- package/dist/esm/appShell/bottomChrome.native.js +77 -0
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -0
- package/dist/esm/appShell/bottomInset.mjs +5 -0
- package/dist/esm/appShell/bottomInset.mjs.map +1 -0
- package/dist/esm/appShell/bottomInset.native.js +6 -0
- package/dist/esm/appShell/bottomInset.native.js.map +1 -0
- package/dist/esm/appShell/index.mjs +3 -0
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +3 -0
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/esm/code/Highlighter/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.mjs +509 -0
- package/dist/esm/formLayouts/FormLayouts.mjs.map +1 -0
- package/dist/esm/formLayouts/FormLayouts.native.js +537 -0
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -0
- package/dist/esm/formLayouts/PreferencePanel.mjs +190 -0
- package/dist/esm/formLayouts/PreferencePanel.mjs.map +1 -0
- package/dist/esm/formLayouts/PreferencePanel.native.js +209 -0
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -0
- package/dist/esm/formLayouts/index.mjs +4 -0
- package/dist/esm/formLayouts/index.mjs.map +1 -0
- package/dist/esm/formLayouts/index.native.js +4 -0
- package/dist/esm/formLayouts/index.native.js.map +1 -0
- package/dist/esm/hooks/index.native.js.map +1 -1
- package/dist/esm/hooks/useClipboard.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/index.native.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/Debug/index.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +11 -3
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +11 -3
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/shared/actionScan.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/restoreRetries.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/textRidesText.native.js.map +1 -1
- package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/setTinted.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/esm/views/ganttIntervals.native.js.map +1 -1
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/kanbanDnd.native.js.map +1 -1
- package/dist/esm/views/matrixMath.native.js.map +1 -1
- package/dist/esm/views/treeViewDnd.native.js.map +1 -1
- package/dist/esm/views/treeViewLayout.native.js.map +1 -1
- package/dist/esm/views/treeViewMotion.native.js.map +1 -1
- package/dist/esm/views/treeViewReveal.native.js.map +1 -1
- package/dist/jsx/appShell/BottomAccessory.mjs +18 -0
- package/dist/jsx/appShell/BottomAccessory.mjs.map +1 -0
- package/dist/jsx/appShell/BottomAccessory.native.js +53 -0
- package/dist/jsx/appShell/BottomAccessory.native.js.map +1 -0
- package/dist/jsx/appShell/TabBar.mjs +99 -20
- package/dist/jsx/appShell/TabBar.mjs.map +1 -1
- package/dist/jsx/appShell/TabBar.native.js +109 -17
- package/dist/jsx/appShell/TabBar.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.mjs +46 -0
- package/dist/jsx/appShell/bottomChrome.mjs.map +1 -0
- package/dist/jsx/appShell/bottomChrome.native.js +110 -0
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -0
- package/dist/jsx/appShell/bottomInset.mjs +5 -0
- package/dist/jsx/appShell/bottomInset.mjs.map +1 -0
- package/dist/jsx/appShell/bottomInset.native.js +34 -0
- package/dist/jsx/appShell/bottomInset.native.js.map +1 -0
- package/dist/jsx/appShell/index.mjs +3 -0
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +12 -0
- package/dist/jsx/appShell/index.native.js.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.mjs +509 -0
- package/dist/jsx/formLayouts/FormLayouts.mjs.map +1 -0
- package/dist/jsx/formLayouts/FormLayouts.native.js +571 -0
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -0
- package/dist/jsx/formLayouts/PreferencePanel.mjs +190 -0
- package/dist/jsx/formLayouts/PreferencePanel.mjs.map +1 -0
- package/dist/jsx/formLayouts/PreferencePanel.native.js +237 -0
- package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -0
- package/dist/jsx/formLayouts/index.mjs +4 -0
- package/dist/jsx/formLayouts/index.mjs.map +1 -0
- package/dist/jsx/formLayouts/index.native.js +39 -0
- package/dist/jsx/formLayouts/index.native.js.map +1 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +1 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +11 -3
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +11 -3
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/package.json +9 -9
- package/src/appShell/BottomAccessory.tsx +18 -0
- package/src/appShell/TabBar.spec.tsx +97 -26
- package/src/appShell/TabBar.stories.tsx +24 -6
- package/src/appShell/TabBar.tsx +158 -32
- package/src/appShell/bottomChrome.ts +68 -0
- package/src/appShell/bottomInset.native.ts +6 -0
- package/src/appShell/bottomInset.ts +7 -0
- package/src/appShell/index.ts +2 -0
- package/src/formLayouts/FormLayouts.spec.tsx +85 -0
- package/src/formLayouts/FormLayouts.stories.tsx +128 -0
- package/src/formLayouts/FormLayouts.tsx +530 -0
- package/src/formLayouts/PreferencePanel.spec.tsx +45 -0
- package/src/formLayouts/PreferencePanel.tsx +263 -0
- package/src/formLayouts/formLayouts.designLaw.spec.ts +78 -0
- package/src/formLayouts/index.ts +26 -0
- package/src/index.ts +1 -0
- package/src/layouts/Screen.chromeClearance.spec.tsx +41 -0
- package/src/layouts/page.tsx +16 -0
- package/types/appShell/BottomAccessory.d.ts +11 -0
- package/types/appShell/BottomAccessory.d.ts.map +1 -0
- package/types/appShell/TabBar.d.ts +32 -10
- package/types/appShell/TabBar.d.ts.map +1 -1
- package/types/appShell/bottomChrome.d.ts +22 -0
- package/types/appShell/bottomChrome.d.ts.map +1 -0
- package/types/appShell/bottomInset.d.ts +6 -0
- package/types/appShell/bottomInset.d.ts.map +1 -0
- package/types/appShell/bottomInset.native.d.ts +3 -0
- package/types/appShell/bottomInset.native.d.ts.map +1 -0
- package/types/appShell/index.d.ts +2 -0
- package/types/appShell/index.d.ts.map +1 -1
- package/types/formLayouts/FormLayouts.d.ts +74 -0
- package/types/formLayouts/FormLayouts.d.ts.map +1 -0
- package/types/formLayouts/PreferencePanel.d.ts +74 -0
- package/types/formLayouts/PreferencePanel.d.ts.map +1 -0
- package/types/formLayouts/index.d.ts +5 -0
- package/types/formLayouts/index.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { RadioGroup, Switch } from "@multiplatform.one/forms";
|
|
3
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
|
+
import {
|
|
5
|
+
ListItem,
|
|
6
|
+
Theme,
|
|
7
|
+
View,
|
|
8
|
+
YStack,
|
|
9
|
+
type FontSizeTokens,
|
|
10
|
+
type SizeTokens,
|
|
11
|
+
type ViewProps,
|
|
12
|
+
} from "tamagui";
|
|
13
|
+
import { Alert, type AlertIntent } from "../Alert";
|
|
14
|
+
import { Card } from "../Card";
|
|
15
|
+
import { H3, Heading } from "../Heading";
|
|
16
|
+
import { Separator } from "../Separator";
|
|
17
|
+
import { Paragraph, Text } from "../Text";
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Types
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
export interface PreferenceToggleItem {
|
|
24
|
+
type: "toggle";
|
|
25
|
+
/** Unique key for the preference. */
|
|
26
|
+
key: string;
|
|
27
|
+
/** Display label. */
|
|
28
|
+
label: string;
|
|
29
|
+
/** Optional description text. */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Current value. */
|
|
32
|
+
value: boolean;
|
|
33
|
+
/** Called when the toggle changes. */
|
|
34
|
+
onValueChange: (value: boolean) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface PreferenceRadioItem {
|
|
38
|
+
type: "radio";
|
|
39
|
+
/** Unique key for the preference. */
|
|
40
|
+
key: string;
|
|
41
|
+
/** Display label. */
|
|
42
|
+
label: string;
|
|
43
|
+
/** Optional description text. */
|
|
44
|
+
description?: string;
|
|
45
|
+
/** Radio options. */
|
|
46
|
+
options: { label: string; value: string }[];
|
|
47
|
+
/** Currently selected value. */
|
|
48
|
+
value: string;
|
|
49
|
+
/** Called when the selection changes. */
|
|
50
|
+
onValueChange: (value: string) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface PreferenceCustomItem {
|
|
54
|
+
type: "custom";
|
|
55
|
+
/** Unique key for the preference. */
|
|
56
|
+
key: string;
|
|
57
|
+
/** Display label. */
|
|
58
|
+
label: string;
|
|
59
|
+
/** Optional description text. */
|
|
60
|
+
description?: string;
|
|
61
|
+
/** Custom content rendered on the trailing side. */
|
|
62
|
+
content: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type PreferenceItem = PreferenceToggleItem | PreferenceRadioItem | PreferenceCustomItem;
|
|
66
|
+
|
|
67
|
+
export interface PreferenceSection {
|
|
68
|
+
/** Section heading. */
|
|
69
|
+
title: string;
|
|
70
|
+
/** Optional section icon. */
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
/** Optional section description. */
|
|
73
|
+
description?: string;
|
|
74
|
+
/** Optional informational banner rendered after the items. */
|
|
75
|
+
banner?: { message: string; theme?: string };
|
|
76
|
+
/** Preference items in this section. */
|
|
77
|
+
items: PreferenceItem[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface PreferencePanelProps extends Omit<ViewProps, "size"> {
|
|
81
|
+
/** Control size forwarded to every row's switch and radio group. Default `$3`. */
|
|
82
|
+
size?: SizeTokens;
|
|
83
|
+
/** Panel heading. Defaults to "Preferences". */
|
|
84
|
+
title?: string;
|
|
85
|
+
/** Optional subtitle. */
|
|
86
|
+
subtitle?: string;
|
|
87
|
+
/** Sections of preference items. */
|
|
88
|
+
sections: PreferenceSection[];
|
|
89
|
+
/** Footer actions (e.g. Save / Cancel). */
|
|
90
|
+
footer?: ReactNode;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const alertIntents: readonly AlertIntent[] = ["info", "success", "warning", "error"];
|
|
94
|
+
|
|
95
|
+
function bannerIntent(theme = "success"): AlertIntent {
|
|
96
|
+
return alertIntents.find((intent) => intent === theme) ?? "info";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Internal: Preference row renderers
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
function ToggleRow({ item }: { item: PreferenceToggleItem; size: SizeTokens }) {
|
|
104
|
+
return (
|
|
105
|
+
<ListItem
|
|
106
|
+
title={item.label}
|
|
107
|
+
subTitle={item.description}
|
|
108
|
+
backgroundColor="transparent"
|
|
109
|
+
iconAfter={
|
|
110
|
+
<Switch
|
|
111
|
+
checked={item.value}
|
|
112
|
+
onChange={item.onValueChange}
|
|
113
|
+
switchProps={{ "aria-label": item.label }}
|
|
114
|
+
/>
|
|
115
|
+
}
|
|
116
|
+
pressStyle={{ opacity: 0.8 }}
|
|
117
|
+
onPress={() => item.onValueChange(!item.value)}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function RadioRow({ item, size }: { item: PreferenceRadioItem; size: SizeTokens }) {
|
|
123
|
+
const { knobProps } = useResolvedKnobs();
|
|
124
|
+
return (
|
|
125
|
+
<View flexDirection="column" {...knobProps.gap}>
|
|
126
|
+
<Text {...knobProps.body}>{item.label}</Text>
|
|
127
|
+
{item.description && (
|
|
128
|
+
<Theme name="alt1">
|
|
129
|
+
<Paragraph size="$2">{item.description}</Paragraph>
|
|
130
|
+
</Theme>
|
|
131
|
+
)}
|
|
132
|
+
<RadioGroup
|
|
133
|
+
value={item.value}
|
|
134
|
+
onChange={item.onValueChange}
|
|
135
|
+
size={size}
|
|
136
|
+
options={item.options}
|
|
137
|
+
/>
|
|
138
|
+
</View>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function CustomRow({ item }: { item: PreferenceCustomItem }) {
|
|
143
|
+
return (
|
|
144
|
+
<ListItem title={item.label} subTitle={item.description} iconAfter={item.content as any} />
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function PreferenceRow({ item, size }: { item: PreferenceItem; size: SizeTokens }) {
|
|
149
|
+
switch (item.type) {
|
|
150
|
+
case "toggle":
|
|
151
|
+
return <ToggleRow item={item} size={size} />;
|
|
152
|
+
case "radio":
|
|
153
|
+
return <RadioRow item={item} size={size} />;
|
|
154
|
+
case "custom":
|
|
155
|
+
return <CustomRow item={item} />;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* A section's rows grouped in one box. It sits inside the panel's Card, a
|
|
161
|
+
* painted ancestor, so `elevatedSurface` resolves border only: nested
|
|
162
|
+
* surfaces never re-elevate.
|
|
163
|
+
*/
|
|
164
|
+
function SectionGroup({ children }: { children?: ReactNode }) {
|
|
165
|
+
const { knobProps } = useResolvedKnobs();
|
|
166
|
+
return (
|
|
167
|
+
<YStack
|
|
168
|
+
testID="preference-section-group"
|
|
169
|
+
overflow="hidden"
|
|
170
|
+
{...knobProps.elevatedSurface}
|
|
171
|
+
{...knobProps.containerRadius}
|
|
172
|
+
>
|
|
173
|
+
{children}
|
|
174
|
+
</YStack>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
// PreferencePanel
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
|
|
182
|
+
export function PreferencePanel({
|
|
183
|
+
title = "Preferences",
|
|
184
|
+
subtitle,
|
|
185
|
+
sections,
|
|
186
|
+
footer,
|
|
187
|
+
size = "$3",
|
|
188
|
+
...props
|
|
189
|
+
}: PreferencePanelProps) {
|
|
190
|
+
const { knobProps } = useResolvedKnobs();
|
|
191
|
+
const inset = knobProps.panelPadding.padding;
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<Card
|
|
195
|
+
{...knobProps.surface}
|
|
196
|
+
paddingVertical={inset}
|
|
197
|
+
paddingHorizontal={0}
|
|
198
|
+
width="100%"
|
|
199
|
+
maxWidth={560}
|
|
200
|
+
alignSelf="center"
|
|
201
|
+
{...knobProps.gap}
|
|
202
|
+
$sm={{ maxWidth: "100%" }}
|
|
203
|
+
size={size}
|
|
204
|
+
{...props}
|
|
205
|
+
>
|
|
206
|
+
{/* Header */}
|
|
207
|
+
<View flexDirection="column" gap="$1" paddingHorizontal={inset}>
|
|
208
|
+
<H3 fontWeight="700" color="$color12">
|
|
209
|
+
{title}
|
|
210
|
+
</H3>
|
|
211
|
+
{subtitle && (
|
|
212
|
+
<Theme name="alt1">
|
|
213
|
+
<Paragraph size="$3">{subtitle}</Paragraph>
|
|
214
|
+
</Theme>
|
|
215
|
+
)}
|
|
216
|
+
</View>
|
|
217
|
+
<Separator />
|
|
218
|
+
|
|
219
|
+
{/* Sections */}
|
|
220
|
+
{sections.map((section, si) => (
|
|
221
|
+
<View key={section.title} flexDirection="column" {...knobProps.gap}>
|
|
222
|
+
<View flexDirection="column" {...knobProps.gap} paddingHorizontal={inset}>
|
|
223
|
+
<View flexDirection="row" alignItems="center" {...knobProps.gap}>
|
|
224
|
+
{section.icon}
|
|
225
|
+
<Heading margin={0} size={knobProps.sizeToken as FontSizeTokens} color="$color12">
|
|
226
|
+
{section.title}
|
|
227
|
+
</Heading>
|
|
228
|
+
</View>
|
|
229
|
+
{section.description && (
|
|
230
|
+
<Theme name="alt1">
|
|
231
|
+
<Paragraph size="$2" paddingHorizontal="$1">
|
|
232
|
+
{section.description}
|
|
233
|
+
</Paragraph>
|
|
234
|
+
</Theme>
|
|
235
|
+
)}
|
|
236
|
+
|
|
237
|
+
<SectionGroup>
|
|
238
|
+
{section.items.map((item) => (
|
|
239
|
+
<PreferenceRow key={item.key} item={item} size={size} />
|
|
240
|
+
))}
|
|
241
|
+
</SectionGroup>
|
|
242
|
+
|
|
243
|
+
{section.banner && (
|
|
244
|
+
<Alert intent={bannerIntent(section.banner.theme)}>{section.banner.message}</Alert>
|
|
245
|
+
)}
|
|
246
|
+
</View>
|
|
247
|
+
|
|
248
|
+
{si < sections.length - 1 && <Separator />}
|
|
249
|
+
</View>
|
|
250
|
+
))}
|
|
251
|
+
|
|
252
|
+
{/* Footer */}
|
|
253
|
+
{footer && (
|
|
254
|
+
<>
|
|
255
|
+
<Separator />
|
|
256
|
+
<View flexDirection="row" {...knobProps.gap} paddingHorizontal={inset}>
|
|
257
|
+
{footer}
|
|
258
|
+
</View>
|
|
259
|
+
</>
|
|
260
|
+
)}
|
|
261
|
+
</Card>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MPO-116 / MPO-119 CONTAINER-CAP and LC-175 MPO-ONLY-REUSE for the form
|
|
3
|
+
* layouts the app template used to fork in packages/ui (FZ-8001).
|
|
4
|
+
*
|
|
5
|
+
* FormCard and SettingsFormLayout render the MPO Card, so the cap is Card's
|
|
6
|
+
* (cardSurface carries it) and neither re-derives it. PreferencePanel's
|
|
7
|
+
* section banner is the MPO Alert; the section stack keeps its own cap
|
|
8
|
+
* after elevatedSurface.
|
|
9
|
+
*/
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { describe, expect, it } from "vitest";
|
|
13
|
+
|
|
14
|
+
const read = (file: string) => fs.readFileSync(path.resolve(import.meta.dirname, file), "utf-8");
|
|
15
|
+
|
|
16
|
+
const formLayoutsSrc = read("FormLayouts.tsx");
|
|
17
|
+
const preferencePanelSrc = read("PreferencePanel.tsx");
|
|
18
|
+
|
|
19
|
+
function declaration(source: string, name: string): string {
|
|
20
|
+
const start = source.indexOf(`function ${name}(`);
|
|
21
|
+
expect(start, `${name} not found`).toBeGreaterThan(-1);
|
|
22
|
+
const rest = source.slice(start + 1);
|
|
23
|
+
const next = rest.search(/\n(?:export )?function /);
|
|
24
|
+
return next === -1 ? rest : rest.slice(0, next);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function elevatedStackTag(source: string): string {
|
|
28
|
+
const start = source.indexOf("<YStack");
|
|
29
|
+
expect(start, "section stack not found").toBeGreaterThan(-1);
|
|
30
|
+
return source.slice(start, source.indexOf(">", start) + 1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
describe("FZ-8001: FormCard and SettingsFormLayout render the MPO Card", () => {
|
|
34
|
+
it("FormCard is the MPO Card rendered as a form, with no frame of its own", () => {
|
|
35
|
+
const formCard = declaration(formLayoutsSrc, "FormCard");
|
|
36
|
+
expect(formCard).toContain('<Card render="form"');
|
|
37
|
+
expect(formLayoutsSrc).not.toContain("FormCardFrame");
|
|
38
|
+
expect(formLayoutsSrc).not.toMatch(/\bstyled\(/);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("SettingsFormLayout is the MPO Card, so the radius cap is Card's", () => {
|
|
42
|
+
const settings = declaration(formLayoutsSrc, "SettingsFormLayout");
|
|
43
|
+
expect(settings).toContain("<Card");
|
|
44
|
+
expect(settings).not.toContain("knobProps.surface");
|
|
45
|
+
expect(settings).not.toContain("knobProps.containerRadius");
|
|
46
|
+
expect(settings).not.toContain("knobProps.borderRadius");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("neither surface re-derives the cap locally", () => {
|
|
50
|
+
expect(formLayoutsSrc).not.toContain("capContainerRadius");
|
|
51
|
+
expect(formLayoutsSrc).not.toContain("panelPaddingPx");
|
|
52
|
+
expect(formLayoutsSrc).not.toContain("knobProps.fieldRadius");
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe("FZ-8001 / MPO-119: PreferencePanel banner and section stack", () => {
|
|
57
|
+
it("the section banner is the MPO Alert, not a local painted row", () => {
|
|
58
|
+
expect(preferencePanelSrc).toContain("<Alert intent=");
|
|
59
|
+
expect(preferencePanelSrc).not.toMatch(/function Banner\(/);
|
|
60
|
+
expect(preferencePanelSrc).not.toContain('backgroundColor="$color7"');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("the section stack spreads the cap AFTER elevatedSurface, so the cap wins", () => {
|
|
64
|
+
const stack = elevatedStackTag(preferencePanelSrc);
|
|
65
|
+
expect(stack).toContain("knobProps.elevatedSurface");
|
|
66
|
+
expect(stack).toContain("knobProps.containerRadius");
|
|
67
|
+
expect(stack.indexOf("knobProps.containerRadius")).toBeGreaterThan(
|
|
68
|
+
stack.indexOf("knobProps.elevatedSurface"),
|
|
69
|
+
);
|
|
70
|
+
expect(stack).not.toContain("knobProps.borderRadius");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("the panel does not re-derive the cap locally", () => {
|
|
74
|
+
expect(preferencePanelSrc).not.toContain("capContainerRadius");
|
|
75
|
+
expect(preferencePanelSrc).not.toContain("panelPaddingPx");
|
|
76
|
+
expect(preferencePanelSrc).not.toContain("knobProps.fieldRadius");
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
FormCard,
|
|
3
|
+
LoginLayout,
|
|
4
|
+
SignUpLayout,
|
|
5
|
+
SettingsFormLayout,
|
|
6
|
+
SocialButton,
|
|
7
|
+
GithubButton,
|
|
8
|
+
Hide,
|
|
9
|
+
} from "./FormLayouts";
|
|
10
|
+
export type {
|
|
11
|
+
FormCardProps,
|
|
12
|
+
LoginLayoutProps,
|
|
13
|
+
SignUpLayoutProps,
|
|
14
|
+
SocialButtonProps,
|
|
15
|
+
SettingsFormSection,
|
|
16
|
+
SettingsFormLayoutProps,
|
|
17
|
+
} from "./FormLayouts";
|
|
18
|
+
export { PreferencePanel } from "./PreferencePanel";
|
|
19
|
+
export type {
|
|
20
|
+
PreferenceToggleItem,
|
|
21
|
+
PreferenceRadioItem,
|
|
22
|
+
PreferenceCustomItem,
|
|
23
|
+
PreferenceItem,
|
|
24
|
+
PreferenceSection,
|
|
25
|
+
PreferencePanelProps,
|
|
26
|
+
} from "./PreferencePanel";
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from "./hooks/index";
|
|
|
40
40
|
export * from "./icons/index";
|
|
41
41
|
export * from "./images/index";
|
|
42
42
|
export * from "./layouts/index";
|
|
43
|
+
export * from "./formLayouts/index";
|
|
43
44
|
// MPO app shell (FZ-7158 WP-h): SystemBar, ScopeMenu, Dock, TabBar, Springboard, SettingsSplit.
|
|
44
45
|
export * from "./appShell/index";
|
|
45
46
|
// MDX components are now in @multiplatform.one/markdown package
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-150 (FZ-7995 round 2): the tab bar floats over content, so a Screen
|
|
3
|
+
* pads its scroll content by the height the bar covers. Without a mounted
|
|
4
|
+
* bar there is no clearance.
|
|
5
|
+
*/
|
|
6
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
7
|
+
import { act, cleanup, screen } from "@testing-library/react";
|
|
8
|
+
import { afterEach, expect, it } from "vitest";
|
|
9
|
+
import { setBottomChromeInset } from "../appShell/bottomChrome";
|
|
10
|
+
import { Screen } from "./page";
|
|
11
|
+
|
|
12
|
+
const bar = Symbol("bar");
|
|
13
|
+
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
cleanup();
|
|
16
|
+
act(() => setBottomChromeInset(bar, null));
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("adds no clearance when no tab bar is mounted", () => {
|
|
20
|
+
renderWithProviders(<Screen>row</Screen>);
|
|
21
|
+
expect(screen.queryByTestId("screen-chrome-clearance")).toBeNull();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("ends its scroll content with the height the floating tab bar covers", () => {
|
|
25
|
+
act(() => setBottomChromeInset(bar, 77));
|
|
26
|
+
renderWithProviders(<Screen>row</Screen>);
|
|
27
|
+
const clearance = screen.getByTestId("screen-chrome-clearance");
|
|
28
|
+
expect(
|
|
29
|
+
getComputedStyle(clearance).height === "77px" ||
|
|
30
|
+
/\b_h-77px\b|height: 77px/.test(clearance.outerHTML),
|
|
31
|
+
).toBe(true);
|
|
32
|
+
expect(
|
|
33
|
+
screen.getByText("row").compareDocumentPosition(clearance) & Node.DOCUMENT_POSITION_FOLLOWING,
|
|
34
|
+
).toBeTruthy();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("clears the bar on a screen that does not scroll", () => {
|
|
38
|
+
act(() => setBottomChromeInset(bar, 77));
|
|
39
|
+
renderWithProviders(<Screen scroll={false}>row</Screen>);
|
|
40
|
+
expect(screen.getByTestId("screen-chrome-clearance")).toBeTruthy();
|
|
41
|
+
});
|
package/src/layouts/page.tsx
CHANGED
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
YStack,
|
|
48
48
|
isWeb,
|
|
49
49
|
} from "tamagui";
|
|
50
|
+
import { useBottomChromeInset } from "../appShell/bottomChrome";
|
|
50
51
|
import { componentColors, sectionHeading } from "../componentColors";
|
|
51
52
|
import { useDirection } from "../hooks/useDirection";
|
|
52
53
|
import { useTranslation } from "../shared/i18n";
|
|
@@ -137,6 +138,7 @@ export function Screen({
|
|
|
137
138
|
}: ScreenProps) {
|
|
138
139
|
const { knobProps } = useResolvedKnobs({ component: "Screen" });
|
|
139
140
|
const scrollState = useScreenScrollController();
|
|
141
|
+
const chromeInset = useBottomChromeInset();
|
|
140
142
|
const inset = noPadding ? null : (knobProps.panelPadding.padding as string);
|
|
141
143
|
const cap = maxWidth && !bleed ? maxWidth : null;
|
|
142
144
|
|
|
@@ -176,11 +178,24 @@ export function Screen({
|
|
|
176
178
|
);
|
|
177
179
|
};
|
|
178
180
|
|
|
181
|
+
// The floating tab bar covers the bottom of the screen; content scrolls
|
|
182
|
+
// under it, and this clears its last row.
|
|
183
|
+
const chromeClearance =
|
|
184
|
+
chromeInset > 0 ? (
|
|
185
|
+
<YStack
|
|
186
|
+
height={chromeInset}
|
|
187
|
+
flexShrink={0}
|
|
188
|
+
aria-hidden
|
|
189
|
+
data-testid="screen-chrome-clearance"
|
|
190
|
+
/>
|
|
191
|
+
) : null;
|
|
192
|
+
|
|
179
193
|
if (!scroll) {
|
|
180
194
|
return shell(
|
|
181
195
|
<YStack flex={1} backgroundColor="$background">
|
|
182
196
|
{bar}
|
|
183
197
|
{inner}
|
|
198
|
+
{chromeClearance}
|
|
184
199
|
</YStack>,
|
|
185
200
|
);
|
|
186
201
|
}
|
|
@@ -200,6 +215,7 @@ export function Screen({
|
|
|
200
215
|
}}
|
|
201
216
|
>
|
|
202
217
|
{inner}
|
|
218
|
+
{chromeClearance}
|
|
203
219
|
</ScrollView>
|
|
204
220
|
);
|
|
205
221
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BottomAccessory — a page's bottom accessory (LC-174 BOTTOM-ACCESSORY, e.g.
|
|
3
|
+
* a pager). Under a floating TabBar it moves into the bar, which floats it as
|
|
4
|
+
* its own smaller capsule above the tab capsule (LC-150); with no bar it
|
|
5
|
+
* renders where the page put it.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactNode } from "react";
|
|
8
|
+
export declare function BottomAccessory({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=BottomAccessory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomAccessory.d.ts","sourceRoot":"","sources":["../../src/appShell/BottomAccessory.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAG5D,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,kDAQpE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
2
|
/** A phosphor-style glyph: the bar sets its size, colour and weight. */
|
|
3
3
|
export type TabBarIcon = ComponentType<{
|
|
4
4
|
size?: number;
|
|
@@ -15,20 +15,34 @@ export interface TabBarProps {
|
|
|
15
15
|
items: readonly TabBarItem[];
|
|
16
16
|
activeKey?: string;
|
|
17
17
|
onTabPress?: (key: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The bottom accessory (LC-174): its own capsule floating above the bar. A
|
|
20
|
+
* page's `BottomAccessory` lands here when this prop is unset.
|
|
21
|
+
*/
|
|
22
|
+
accessory?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Default true: the bar floats over the screen and pads every Screen. False
|
|
25
|
+
* draws the same capsule in flow (a demo inside a page).
|
|
26
|
+
*/
|
|
27
|
+
floating?: boolean;
|
|
18
28
|
/** Accessible name of the tab list. Default "Tabs". */
|
|
19
29
|
label?: string;
|
|
20
30
|
testID?: string;
|
|
21
31
|
}
|
|
22
32
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
33
|
+
* The iOS 26 floating tab bar's metrics in points, fixed like the
|
|
34
|
+
* platform's: a preset's scale or a large Dynamic Type size never moves
|
|
35
|
+
* them. The capsule is 4 + 53 + 4 tall; each item is a pill of 7 + 25 + 2 +
|
|
36
|
+
* 12 + 7. Its bottom edge sits 8pt above the home indicator, whose band is
|
|
37
|
+
* the lowest 13pt of the device's bottom inset, or 8pt above the viewport
|
|
38
|
+
* edge where there is none.
|
|
28
39
|
*/
|
|
29
40
|
export declare const tabBarMetrics: {
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
41
|
+
readonly sideInset: 16;
|
|
42
|
+
readonly indicatorClearance: 8;
|
|
43
|
+
readonly homeIndicatorBand: 13;
|
|
44
|
+
readonly capsulePadding: 4;
|
|
45
|
+
readonly itemPaddingY: 7;
|
|
32
46
|
readonly iconSize: 25;
|
|
33
47
|
readonly labelGap: 2;
|
|
34
48
|
readonly labelSize: 10;
|
|
@@ -36,7 +50,13 @@ export declare const tabBarMetrics: {
|
|
|
36
50
|
readonly labelWeight: "500";
|
|
37
51
|
/** A label that does not fit shrinks to 9pt at most, then clips. */
|
|
38
52
|
readonly labelMinScale: 0.9;
|
|
53
|
+
readonly accessoryGap: 8;
|
|
54
|
+
readonly accessoryHeight: 44;
|
|
39
55
|
};
|
|
56
|
+
/** The capsule's height: its padding around one item pill. */
|
|
57
|
+
export declare const tabBarCapsuleHeight: number;
|
|
58
|
+
/** The capsule's bottom edge above the screen's bottom edge. */
|
|
59
|
+
export declare function tabBarBottomOffset(bottomInset: number): number;
|
|
40
60
|
/**
|
|
41
61
|
* Inactive ink: the theme's secondary text ink (LC-152), whatever the
|
|
42
62
|
* preset's textAccent. Bold sets textAccent "high", whose text colour is the
|
|
@@ -44,7 +64,9 @@ export declare const tabBarMetrics: {
|
|
|
44
64
|
* body text.
|
|
45
65
|
*/
|
|
46
66
|
export declare const tabBarInactiveInk = "$textMuted";
|
|
47
|
-
/** The
|
|
67
|
+
/** The material's base: the chrome step one off the page, as the SystemBar paints. */
|
|
48
68
|
export declare const tabBarMaterial = "$color2";
|
|
49
|
-
|
|
69
|
+
/** How much of the material shows through: web blurs what is behind it, native cannot. */
|
|
70
|
+
export declare const tabBarMaterialOpacity: number;
|
|
71
|
+
export declare function TabBar({ items, activeKey, onTabPress, accessory: ownAccessory, floating, label, testID, }: TabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
50
72
|
//# sourceMappingURL=TabBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/appShell/TabBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/appShell/TabBar.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAMhF,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;IAWxB,oEAAoE;;;;CAI5D,CAAC;AAEX,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,QAKD,CAAC;AAEhC,gEAAgE;AAChE,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,sFAAsF;AACtF,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,QAAsB,CAAC;AAuGzD,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EAAE,YAAY,EACvB,QAAe,EACf,KAAc,EACd,MAAkB,GACnB,EAAE,WAAW,2CAiFb"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The floating bottom chrome's shared state. A mounted floating TabBar
|
|
3
|
+
* publishes the height it covers, so a Screen pads its scroll content by it
|
|
4
|
+
* and its last row clears the capsule. A page publishes its bottom accessory
|
|
5
|
+
* (LC-174, e.g. a pager) here, so the bar floats it as its own capsule. The
|
|
6
|
+
* bar and the page are siblings in every host, so both live in a store, not
|
|
7
|
+
* a context a host would have to wire.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from "react";
|
|
10
|
+
/** Publish (or with null, withdraw) one floating bar's covered height. */
|
|
11
|
+
export declare function setBottomChromeInset(id: symbol, next: number | null): void;
|
|
12
|
+
/** Points of screen the bottom chrome covers; 0 when no floating tab bar is mounted. */
|
|
13
|
+
export declare function useBottomChromeInset(): number;
|
|
14
|
+
/** Publish (or with null, withdraw) a page's bottom accessory. The latest wins. */
|
|
15
|
+
export declare function setBottomAccessory(id: symbol, node: ReactNode | null): void;
|
|
16
|
+
/** The accessory a page published, for the floating TabBar to host. */
|
|
17
|
+
export declare function useBottomAccessory(): ReactNode;
|
|
18
|
+
/** A floating TabBar announces itself so accessories move into it. */
|
|
19
|
+
export declare function setFloatingBarMounted(id: symbol, mounted: boolean): void;
|
|
20
|
+
/** True while a floating TabBar is mounted and hosts the accessory. */
|
|
21
|
+
export declare function useFloatingBarMounted(): boolean;
|
|
22
|
+
//# sourceMappingURL=bottomChrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomChrome.d.ts","sourceRoot":"","sources":["../../src/appShell/bottomChrome.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AA4B7D,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,QAEnE;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAKD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,QAEpE;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,IAAI,SAAS,CAE9C;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,QAEjE;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomInset.d.ts","sourceRoot":"","sources":["../../src/appShell/bottomInset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomInset.native.d.ts","sourceRoot":"","sources":["../../src/appShell/bottomInset.native.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
|
@@ -5,4 +5,6 @@ export * from "./TabBar";
|
|
|
5
5
|
export * from "./Springboard";
|
|
6
6
|
export type { AppEntry } from "./appTile";
|
|
7
7
|
export * from "./SettingsSplit";
|
|
8
|
+
export { useBottomChromeInset } from "./bottomChrome";
|
|
9
|
+
export { BottomAccessory } from "./BottomAccessory";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appShell/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appShell/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|