@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
package/src/appShell/TabBar.tsx
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TabBar — a phone app's bottom section switcher (LC-150 TAB-BAR-ANATOMY,
|
|
3
|
-
* iOS
|
|
3
|
+
* the iOS 26 floating tab bar).
|
|
4
4
|
*
|
|
5
5
|
* The bar owns the whole anatomy, so an app hands over an icon component and
|
|
6
|
-
* a label and nothing else.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* the
|
|
6
|
+
* a label and nothing else. It floats: a capsule of translucent material
|
|
7
|
+
* inset 16pt from the sides, 8pt above the home indicator, with content
|
|
8
|
+
* scrolling under it and no band or hairline across the screen. A Screen
|
|
9
|
+
* pads its scroll content by the height the capsule covers
|
|
10
|
+
* (`useBottomChromeInset`), so the last row clears it. The bottom accessory
|
|
11
|
+
* (LC-174, e.g. a pager) floats as its own smaller capsule above it. A theme
|
|
12
|
+
* changes the colours only: the active item is the theme's accent as
|
|
13
|
+
* readable ink on an accent-wash pill, inactive items are the secondary text
|
|
14
|
+
* ink.
|
|
13
15
|
*/
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
+
import {
|
|
17
|
+
hairlineWidth,
|
|
18
|
+
normalizeToHex,
|
|
19
|
+
useAccentOnSurface,
|
|
20
|
+
useAccentTintedSurface,
|
|
21
|
+
useGlyphColor,
|
|
22
|
+
} from "@multiplatform.one/theme";
|
|
23
|
+
import { zIndex } from "@multiplatform.one/forms";
|
|
16
24
|
import { isWeb } from "@multiplatform.one/platform";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
25
|
+
import { type ComponentType, type ReactNode, useEffect, useState } from "react";
|
|
26
|
+
import { XStack, YStack, useTheme } from "tamagui";
|
|
19
27
|
import { Text } from "../Text";
|
|
28
|
+
import { setBottomChromeInset, setFloatingBarMounted, useBottomAccessory } from "./bottomChrome";
|
|
29
|
+
import { useBottomInset } from "./bottomInset";
|
|
20
30
|
|
|
21
31
|
/** A phosphor-style glyph: the bar sets its size, colour and weight. */
|
|
22
32
|
export type TabBarIcon = ComponentType<{
|
|
@@ -36,21 +46,35 @@ export interface TabBarProps {
|
|
|
36
46
|
items: readonly TabBarItem[];
|
|
37
47
|
activeKey?: string;
|
|
38
48
|
onTabPress?: (key: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* The bottom accessory (LC-174): its own capsule floating above the bar. A
|
|
51
|
+
* page's `BottomAccessory` lands here when this prop is unset.
|
|
52
|
+
*/
|
|
53
|
+
accessory?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Default true: the bar floats over the screen and pads every Screen. False
|
|
56
|
+
* draws the same capsule in flow (a demo inside a page).
|
|
57
|
+
*/
|
|
58
|
+
floating?: boolean;
|
|
39
59
|
/** Accessible name of the tab list. Default "Tabs". */
|
|
40
60
|
label?: string;
|
|
41
61
|
testID?: string;
|
|
42
62
|
}
|
|
43
63
|
|
|
44
64
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
65
|
+
* The iOS 26 floating tab bar's metrics in points, fixed like the
|
|
66
|
+
* platform's: a preset's scale or a large Dynamic Type size never moves
|
|
67
|
+
* them. The capsule is 4 + 53 + 4 tall; each item is a pill of 7 + 25 + 2 +
|
|
68
|
+
* 12 + 7. Its bottom edge sits 8pt above the home indicator, whose band is
|
|
69
|
+
* the lowest 13pt of the device's bottom inset, or 8pt above the viewport
|
|
70
|
+
* edge where there is none.
|
|
50
71
|
*/
|
|
51
72
|
export const tabBarMetrics = {
|
|
52
|
-
|
|
53
|
-
|
|
73
|
+
sideInset: 16,
|
|
74
|
+
indicatorClearance: 8,
|
|
75
|
+
homeIndicatorBand: 13,
|
|
76
|
+
capsulePadding: 4,
|
|
77
|
+
itemPaddingY: 7,
|
|
54
78
|
iconSize: 25,
|
|
55
79
|
labelGap: 2,
|
|
56
80
|
labelSize: 10,
|
|
@@ -58,7 +82,23 @@ export const tabBarMetrics = {
|
|
|
58
82
|
labelWeight: "500",
|
|
59
83
|
/** A label that does not fit shrinks to 9pt at most, then clips. */
|
|
60
84
|
labelMinScale: 0.9,
|
|
85
|
+
accessoryGap: 8,
|
|
86
|
+
accessoryHeight: 44,
|
|
61
87
|
} as const;
|
|
88
|
+
|
|
89
|
+
/** The capsule's height: its padding around one item pill. */
|
|
90
|
+
export const tabBarCapsuleHeight =
|
|
91
|
+
2 * tabBarMetrics.capsulePadding +
|
|
92
|
+
2 * tabBarMetrics.itemPaddingY +
|
|
93
|
+
tabBarMetrics.iconSize +
|
|
94
|
+
tabBarMetrics.labelGap +
|
|
95
|
+
tabBarMetrics.labelLineHeight;
|
|
96
|
+
|
|
97
|
+
/** The capsule's bottom edge above the screen's bottom edge. */
|
|
98
|
+
export function tabBarBottomOffset(bottomInset: number): number {
|
|
99
|
+
return (bottomInset > 0 ? tabBarMetrics.homeIndicatorBand : 0) + tabBarMetrics.indicatorClearance;
|
|
100
|
+
}
|
|
101
|
+
|
|
62
102
|
/**
|
|
63
103
|
* Inactive ink: the theme's secondary text ink (LC-152), whatever the
|
|
64
104
|
* preset's textAccent. Bold sets textAccent "high", whose text colour is the
|
|
@@ -66,8 +106,39 @@ export const tabBarMetrics = {
|
|
|
66
106
|
* body text.
|
|
67
107
|
*/
|
|
68
108
|
export const tabBarInactiveInk = "$textMuted";
|
|
69
|
-
/** The
|
|
109
|
+
/** The material's base: the chrome step one off the page, as the SystemBar paints. */
|
|
70
110
|
export const tabBarMaterial = "$color2";
|
|
111
|
+
/** How much of the material shows through: web blurs what is behind it, native cannot. */
|
|
112
|
+
export const tabBarMaterialOpacity = isWeb ? 0.72 : 0.94;
|
|
113
|
+
|
|
114
|
+
function translucent(color: string | undefined, opacity: number): string | undefined {
|
|
115
|
+
const hex = color ? normalizeToHex(color) : null;
|
|
116
|
+
if (!hex) return color;
|
|
117
|
+
const [r, g, b] = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));
|
|
118
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function useMaterial() {
|
|
122
|
+
const theme = useTheme() as unknown as Record<string, { val?: unknown } | undefined>;
|
|
123
|
+
const base = theme[tabBarMaterial.slice(1)]?.val;
|
|
124
|
+
return {
|
|
125
|
+
backgroundColor:
|
|
126
|
+
translucent(typeof base === "string" ? base : undefined, tabBarMaterialOpacity) ??
|
|
127
|
+
tabBarMaterial,
|
|
128
|
+
borderWidth: hairlineWidth,
|
|
129
|
+
borderColor: "$borderColor",
|
|
130
|
+
shadowColor: "$shadow3",
|
|
131
|
+
shadowOffset: { width: 0, height: 4 },
|
|
132
|
+
shadowRadius: 16,
|
|
133
|
+
elevation: 6,
|
|
134
|
+
...(isWeb
|
|
135
|
+
? {
|
|
136
|
+
backdropFilter: "blur(20px) saturate(180%)",
|
|
137
|
+
WebkitBackdropFilter: "blur(20px) saturate(180%)",
|
|
138
|
+
}
|
|
139
|
+
: null),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
71
142
|
|
|
72
143
|
function TabBarButton({
|
|
73
144
|
item,
|
|
@@ -81,6 +152,7 @@ function TabBarButton({
|
|
|
81
152
|
testID: string;
|
|
82
153
|
}) {
|
|
83
154
|
const accent = useAccentOnSurface();
|
|
155
|
+
const wash = useAccentTintedSurface();
|
|
84
156
|
const secondaryInk = useGlyphColor(tabBarInactiveInk);
|
|
85
157
|
const ink = active ? accent : secondaryInk;
|
|
86
158
|
const Icon = item.icon;
|
|
@@ -95,8 +167,10 @@ function TabBarButton({
|
|
|
95
167
|
alignItems="center"
|
|
96
168
|
justifyContent="flex-start"
|
|
97
169
|
gap={tabBarMetrics.labelGap}
|
|
98
|
-
|
|
170
|
+
paddingVertical={tabBarMetrics.itemPaddingY}
|
|
99
171
|
paddingHorizontal="$1"
|
|
172
|
+
borderRadius={1000}
|
|
173
|
+
backgroundColor={active ? (wash ?? "$color4") : "transparent"}
|
|
100
174
|
cursor="pointer"
|
|
101
175
|
onPress={onPress}
|
|
102
176
|
data-testid={testID}
|
|
@@ -142,26 +216,78 @@ export function TabBar({
|
|
|
142
216
|
items,
|
|
143
217
|
activeKey,
|
|
144
218
|
onTabPress,
|
|
219
|
+
accessory: ownAccessory,
|
|
220
|
+
floating = true,
|
|
145
221
|
label = "Tabs",
|
|
146
222
|
testID = "tab-bar",
|
|
147
223
|
}: TabBarProps) {
|
|
224
|
+
const material = useMaterial();
|
|
225
|
+
const pageAccessory = useBottomAccessory();
|
|
226
|
+
const accessory = ownAccessory ?? (floating ? pageAccessory : null);
|
|
227
|
+
const deviceInset = useBottomInset();
|
|
228
|
+
const bottom = floating ? tabBarBottomOffset(deviceInset) : 0;
|
|
229
|
+
const [id] = useState(() => Symbol("tab-bar"));
|
|
230
|
+
const [accessoryHeight, setAccessoryHeight] = useState(0);
|
|
231
|
+
const covered =
|
|
232
|
+
bottom +
|
|
233
|
+
tabBarCapsuleHeight +
|
|
234
|
+
(accessory ? tabBarMetrics.accessoryGap + accessoryHeight : 0) +
|
|
235
|
+
tabBarMetrics.indicatorClearance;
|
|
236
|
+
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
setBottomChromeInset(id, floating ? covered : null);
|
|
239
|
+
}, [covered, floating, id]);
|
|
240
|
+
useEffect(() => {
|
|
241
|
+
setFloatingBarMounted(id, floating);
|
|
242
|
+
}, [floating, id]);
|
|
243
|
+
useEffect(
|
|
244
|
+
() => () => {
|
|
245
|
+
setBottomChromeInset(id, null);
|
|
246
|
+
setFloatingBarMounted(id, false);
|
|
247
|
+
},
|
|
248
|
+
[id],
|
|
249
|
+
);
|
|
250
|
+
|
|
148
251
|
return (
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
252
|
+
<YStack
|
|
253
|
+
{...(floating
|
|
254
|
+
? {
|
|
255
|
+
position: (isWeb ? "fixed" : "absolute") as "absolute",
|
|
256
|
+
left: 0,
|
|
257
|
+
right: 0,
|
|
258
|
+
bottom: 0,
|
|
259
|
+
zIndex: zIndex.stickyHeader,
|
|
260
|
+
paddingHorizontal: tabBarMetrics.sideInset,
|
|
261
|
+
}
|
|
262
|
+
: null)}
|
|
263
|
+
paddingBottom={bottom}
|
|
264
|
+
gap={tabBarMetrics.accessoryGap}
|
|
265
|
+
pointerEvents="box-none"
|
|
157
266
|
data-testid={testID}
|
|
158
267
|
>
|
|
268
|
+
{accessory ? (
|
|
269
|
+
<XStack
|
|
270
|
+
alignSelf="center"
|
|
271
|
+
alignItems="center"
|
|
272
|
+
minHeight={tabBarMetrics.accessoryHeight}
|
|
273
|
+
paddingHorizontal="$3"
|
|
274
|
+
borderRadius={1000}
|
|
275
|
+
{...material}
|
|
276
|
+
onLayout={(event) => setAccessoryHeight(Math.round(event.nativeEvent.layout.height))}
|
|
277
|
+
data-testid={`${testID}-accessory`}
|
|
278
|
+
>
|
|
279
|
+
{accessory}
|
|
280
|
+
</XStack>
|
|
281
|
+
) : null}
|
|
159
282
|
<XStack
|
|
160
283
|
role="tablist"
|
|
161
284
|
aria-label={label}
|
|
162
|
-
height={
|
|
285
|
+
height={tabBarCapsuleHeight}
|
|
286
|
+
padding={tabBarMetrics.capsulePadding}
|
|
163
287
|
alignItems="stretch"
|
|
164
|
-
|
|
288
|
+
borderRadius={1000}
|
|
289
|
+
{...material}
|
|
290
|
+
data-testid={`${testID}-capsule`}
|
|
165
291
|
>
|
|
166
292
|
{items.map((item) => (
|
|
167
293
|
<TabBarButton
|
|
@@ -173,6 +299,6 @@ export function TabBar({
|
|
|
173
299
|
/>
|
|
174
300
|
))}
|
|
175
301
|
</XStack>
|
|
176
|
-
</
|
|
302
|
+
</YStack>
|
|
177
303
|
);
|
|
178
304
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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, useSyncExternalStore } from "react";
|
|
10
|
+
|
|
11
|
+
function createStore<T>(empty: T) {
|
|
12
|
+
const entries = new Map<symbol, T>();
|
|
13
|
+
const listeners = new Set<() => void>();
|
|
14
|
+
let current = empty;
|
|
15
|
+
return {
|
|
16
|
+
set(id: symbol, value: T | null, pick: (values: T[]) => T) {
|
|
17
|
+
if (value === null) entries.delete(id);
|
|
18
|
+
else entries.set(id, value);
|
|
19
|
+
const next = entries.size ? pick([...entries.values()]) : empty;
|
|
20
|
+
if (Object.is(next, current)) return;
|
|
21
|
+
current = next;
|
|
22
|
+
for (const listener of listeners) listener();
|
|
23
|
+
},
|
|
24
|
+
subscribe(listener: () => void) {
|
|
25
|
+
listeners.add(listener);
|
|
26
|
+
return () => {
|
|
27
|
+
listeners.delete(listener);
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
get: () => current,
|
|
31
|
+
empty: () => empty,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const insets = createStore(0);
|
|
36
|
+
|
|
37
|
+
/** Publish (or with null, withdraw) one floating bar's covered height. */
|
|
38
|
+
export function setBottomChromeInset(id: symbol, next: number | null) {
|
|
39
|
+
insets.set(id, next, (values) => Math.max(...values));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Points of screen the bottom chrome covers; 0 when no floating tab bar is mounted. */
|
|
43
|
+
export function useBottomChromeInset(): number {
|
|
44
|
+
return useSyncExternalStore(insets.subscribe, insets.get, insets.empty);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const accessories = createStore<ReactNode>(null);
|
|
48
|
+
const bars = createStore(false);
|
|
49
|
+
|
|
50
|
+
/** Publish (or with null, withdraw) a page's bottom accessory. The latest wins. */
|
|
51
|
+
export function setBottomAccessory(id: symbol, node: ReactNode | null) {
|
|
52
|
+
accessories.set(id, node, (values) => values[values.length - 1]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The accessory a page published, for the floating TabBar to host. */
|
|
56
|
+
export function useBottomAccessory(): ReactNode {
|
|
57
|
+
return useSyncExternalStore(accessories.subscribe, accessories.get, accessories.empty);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A floating TabBar announces itself so accessories move into it. */
|
|
61
|
+
export function setFloatingBarMounted(id: symbol, mounted: boolean) {
|
|
62
|
+
bars.set(id, mounted ? true : null, () => true);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** True while a floating TabBar is mounted and hosts the accessory. */
|
|
66
|
+
export function useFloatingBarMounted(): boolean {
|
|
67
|
+
return useSyncExternalStore(bars.subscribe, bars.get, bars.empty);
|
|
68
|
+
}
|
package/src/appShell/index.ts
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { cleanup, screen } from "@testing-library/react";
|
|
3
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
import * as components from "../index";
|
|
5
|
+
import { FormCard, LoginLayout, SettingsFormLayout, SignUpLayout } from "./FormLayouts";
|
|
6
|
+
import { PreferencePanel } from "./PreferencePanel";
|
|
7
|
+
|
|
8
|
+
afterEach(cleanup);
|
|
9
|
+
|
|
10
|
+
describe("form layouts ride the MPO Card (FZ-8001, LC-175)", () => {
|
|
11
|
+
it("the components barrel exports every former @package/ui form layout", () => {
|
|
12
|
+
for (const name of [
|
|
13
|
+
"FormCard",
|
|
14
|
+
"LoginLayout",
|
|
15
|
+
"SignUpLayout",
|
|
16
|
+
"SettingsFormLayout",
|
|
17
|
+
"SocialButton",
|
|
18
|
+
"GithubButton",
|
|
19
|
+
"Hide",
|
|
20
|
+
"PreferencePanel",
|
|
21
|
+
])
|
|
22
|
+
expect((components as Record<string, unknown>)[name], name).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("FormCard paints the Card content tier as a form", () => {
|
|
26
|
+
const { container } = renderWithProviders(
|
|
27
|
+
<FormCard testID="form-card">
|
|
28
|
+
<span>child</span>
|
|
29
|
+
</FormCard>,
|
|
30
|
+
);
|
|
31
|
+
const card = container.querySelector('[data-tier="content"]');
|
|
32
|
+
expect(card).not.toBeNull();
|
|
33
|
+
expect(card?.tagName).toBe("FORM");
|
|
34
|
+
expect(card?.textContent).toBe("child");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("LoginLayout and SignUpLayout sit in one Card each", () => {
|
|
38
|
+
renderWithProviders(<LoginLayout title="Sign in" onSignUp={vi.fn()} />);
|
|
39
|
+
expect(screen.getByText("Sign in")).toBeTruthy();
|
|
40
|
+
expect(document.querySelectorAll('[data-tier="content"]')).toHaveLength(1);
|
|
41
|
+
cleanup();
|
|
42
|
+
renderWithProviders(<SignUpLayout title="Create an account" onSignIn={vi.fn()} />);
|
|
43
|
+
expect(screen.getByText("Create an account")).toBeTruthy();
|
|
44
|
+
expect(document.querySelectorAll('[data-tier="content"]')).toHaveLength(1);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("SettingsFormLayout is one Card holding every section", () => {
|
|
48
|
+
renderWithProviders(
|
|
49
|
+
<SettingsFormLayout
|
|
50
|
+
title="Account"
|
|
51
|
+
sections={[
|
|
52
|
+
{ title: "Profile", content: <span>profile</span> },
|
|
53
|
+
{ title: "Notifications", content: <span>notifications</span> },
|
|
54
|
+
]}
|
|
55
|
+
/>,
|
|
56
|
+
);
|
|
57
|
+
const cards = document.querySelectorAll('[data-tier="content"]');
|
|
58
|
+
expect(cards).toHaveLength(1);
|
|
59
|
+
expect(cards[0]?.textContent).toContain("profile");
|
|
60
|
+
expect(cards[0]?.textContent).toContain("notifications");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("a PreferencePanel section banner is the MPO Alert with the banner's intent", () => {
|
|
64
|
+
renderWithProviders(
|
|
65
|
+
<PreferencePanel
|
|
66
|
+
sections={[
|
|
67
|
+
{
|
|
68
|
+
title: "Sync",
|
|
69
|
+
banner: { message: "Saved to every device" },
|
|
70
|
+
items: [],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: "Danger",
|
|
74
|
+
banner: { message: "Signing out clears drafts", theme: "warning" },
|
|
75
|
+
items: [],
|
|
76
|
+
},
|
|
77
|
+
]}
|
|
78
|
+
/>,
|
|
79
|
+
);
|
|
80
|
+
const saved = screen.getByText("Saved to every device").closest("[data-accent-stripe]");
|
|
81
|
+
const warning = screen.getByText("Signing out clears drafts").closest("[data-accent-stripe]");
|
|
82
|
+
expect(saved, "success banner renders Alert").not.toBeNull();
|
|
83
|
+
expect(warning, "warning banner renders Alert").not.toBeNull();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
+
import { Input, Switch } from "@multiplatform.one/forms";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { YStack } from "tamagui";
|
|
5
|
+
import {
|
|
6
|
+
FormCard,
|
|
7
|
+
GithubButton,
|
|
8
|
+
LoginLayout,
|
|
9
|
+
SettingsFormLayout,
|
|
10
|
+
SignUpLayout,
|
|
11
|
+
} from "./FormLayouts";
|
|
12
|
+
import { PreferencePanel } from "./PreferencePanel";
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof FormCard> = {
|
|
15
|
+
title: "Components/FormLayouts",
|
|
16
|
+
component: FormCard,
|
|
17
|
+
parameters: {
|
|
18
|
+
status: { type: "stable" },
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
"Sign-in, sign-up, settings and preference panels for every MPO app, built on the MPO Card and Alert (LC-175). The app template re-exports them from @package/ui.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
export const Card: Story = {
|
|
32
|
+
render: () => (
|
|
33
|
+
<FormCard>
|
|
34
|
+
<YStack gap="$3">
|
|
35
|
+
<Input label="Name" placeholder="Enter name" />
|
|
36
|
+
<Input label="Email" placeholder="Enter email" />
|
|
37
|
+
</YStack>
|
|
38
|
+
</FormCard>
|
|
39
|
+
),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const SignIn: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<LoginLayout
|
|
45
|
+
title="Sign in"
|
|
46
|
+
onSubmit={() => {}}
|
|
47
|
+
onForgotPassword={() => {}}
|
|
48
|
+
onSignUp={() => {}}
|
|
49
|
+
socialButtons={<GithubButton onPress={() => {}} />}
|
|
50
|
+
/>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const SignUp: Story = {
|
|
55
|
+
render: () => <SignUpLayout title="Create an account" onSubmit={() => {}} onSignIn={() => {}} />,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const Settings: Story = {
|
|
59
|
+
render: () => (
|
|
60
|
+
<SettingsFormLayout
|
|
61
|
+
title="Account Settings"
|
|
62
|
+
sections={[
|
|
63
|
+
{
|
|
64
|
+
title: "Personal Information",
|
|
65
|
+
description: "Update your personal details",
|
|
66
|
+
content: (
|
|
67
|
+
<YStack gap="$3">
|
|
68
|
+
<Input label="Display Name" defaultValue="John Doe" />
|
|
69
|
+
<Input label="Email" defaultValue="john@example.com" />
|
|
70
|
+
</YStack>
|
|
71
|
+
),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: "Notifications",
|
|
75
|
+
description: "Configure your notification preferences",
|
|
76
|
+
content: <Switch label="Email notifications" />,
|
|
77
|
+
},
|
|
78
|
+
]}
|
|
79
|
+
/>
|
|
80
|
+
),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
function PreferencesDemo() {
|
|
84
|
+
const [sync, setSync] = useState(true);
|
|
85
|
+
const [language, setLanguage] = useState("en");
|
|
86
|
+
return (
|
|
87
|
+
<PreferencePanel
|
|
88
|
+
title="Settings"
|
|
89
|
+
subtitle="Manage your preferences"
|
|
90
|
+
sections={[
|
|
91
|
+
{
|
|
92
|
+
title: "Sync",
|
|
93
|
+
description: "Keep settings the same on every device",
|
|
94
|
+
banner: { message: "Synced a minute ago" },
|
|
95
|
+
items: [
|
|
96
|
+
{
|
|
97
|
+
type: "toggle",
|
|
98
|
+
key: "sync",
|
|
99
|
+
label: "Sync settings",
|
|
100
|
+
value: sync,
|
|
101
|
+
onValueChange: setSync,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: "Language",
|
|
107
|
+
items: [
|
|
108
|
+
{
|
|
109
|
+
type: "radio",
|
|
110
|
+
key: "lang",
|
|
111
|
+
label: "Language",
|
|
112
|
+
value: language,
|
|
113
|
+
onValueChange: setLanguage,
|
|
114
|
+
options: [
|
|
115
|
+
{ label: "English", value: "en" },
|
|
116
|
+
{ label: "Spanish", value: "es" },
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
]}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const Preferences: Story = {
|
|
127
|
+
render: () => <PreferencesDemo />,
|
|
128
|
+
};
|