@multiplatform.one/components 7.66.0 → 7.68.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/Alert/index.cjs +5 -0
- package/dist/cjs/Alert/index.native.js +5 -0
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.cjs +6 -34
- package/dist/cjs/Avatar/getInitials.native.js +8 -34
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.cjs +28 -23
- package/dist/cjs/Avatar/index.native.js +30 -25
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Card.cjs +67 -11
- package/dist/cjs/Card.native.js +71 -11
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/Chip/index.cjs +54 -8
- package/dist/cjs/Chip/index.native.js +57 -10
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.cjs +5 -2
- package/dist/cjs/DropdownMenu/index.native.js +5 -2
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.cjs +3 -1
- package/dist/cjs/OverflowRow/index.native.js +3 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +4 -6
- package/dist/cjs/Pagination.native.js +4 -6
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.cjs +5 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js +5 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.cjs +104 -0
- package/dist/cjs/SheetModal/SheetNavigation.native.js +132 -0
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/cjs/SheetModal/index.cjs +30 -17
- package/dist/cjs/SheetModal/index.native.js +86 -58
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/ThemePlayground/index.cjs +1 -2
- package/dist/cjs/actions/StandardAction.cjs +131 -0
- package/dist/cjs/actions/StandardAction.native.js +136 -0
- package/dist/cjs/actions/StandardAction.native.js.map +1 -0
- package/dist/cjs/actions/index.cjs +9 -2
- package/dist/cjs/actions/index.native.js +8 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.cjs +51 -0
- package/dist/cjs/appShell/TabHost.native.js +151 -0
- package/dist/cjs/appShell/TabHost.native.js.map +1 -0
- package/dist/cjs/appShell/index.cjs +2 -0
- package/dist/cjs/appShell/index.native.js +2 -0
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +8 -20
- package/dist/cjs/charts/ChartDataView.native.js +10 -20
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +87 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js +91 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.cjs +0 -1
- package/dist/cjs/layouts/EmptyState.native.js +0 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.cjs +1 -0
- package/dist/cjs/layouts/PageTemplates.native.js +2 -0
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +22 -12
- package/dist/cjs/layouts/page.native.js +27 -16
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.cjs +51 -21
- package/dist/cjs/layouts/sidebar.native.js +53 -23
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.cjs +9 -6
- package/dist/cjs/layouts/toolbar.native.js +9 -6
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.cjs +55 -14
- package/dist/cjs/views/ImageGrid.native.js +58 -15
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +19 -25
- package/dist/cjs/views/ListGroup.native.js +19 -25
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.cjs +3 -6
- package/dist/cjs/views/ReportBuilder.native.js +3 -6
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +2 -0
- package/dist/cjs/views/index.native.js +2 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/esm/Alert/index.mjs +5 -0
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/Alert/index.native.js +5 -0
- package/dist/esm/Alert/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.mjs +7 -32
- package/dist/esm/Avatar/getInitials.mjs.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js +9 -32
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.mjs +30 -24
- package/dist/esm/Avatar/index.mjs.map +1 -1
- package/dist/esm/Avatar/index.native.js +32 -26
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Card.mjs +69 -13
- package/dist/esm/Card.mjs.map +1 -1
- package/dist/esm/Card.native.js +73 -13
- package/dist/esm/Card.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +54 -9
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +57 -11
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +5 -2
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +5 -2
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.mjs +4 -2
- package/dist/esm/OverflowRow/index.mjs.map +1 -1
- package/dist/esm/OverflowRow/index.native.js +4 -2
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.mjs +4 -6
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +4 -6
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.mjs +5 -1
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +5 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetNavigation.mjs +79 -0
- package/dist/esm/SheetModal/SheetNavigation.mjs.map +1 -0
- package/dist/esm/SheetModal/SheetNavigation.native.js +104 -0
- package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/esm/SheetModal/index.mjs +32 -19
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +88 -60
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/ThemePlayground/index.mjs +1 -2
- package/dist/esm/ThemePlayground/index.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.mjs +104 -0
- package/dist/esm/actions/StandardAction.mjs.map +1 -0
- package/dist/esm/actions/StandardAction.native.js +106 -0
- package/dist/esm/actions/StandardAction.native.js.map +1 -0
- package/dist/esm/actions/index.mjs +3 -1
- package/dist/esm/actions/index.mjs.map +1 -1
- package/dist/esm/actions/index.native.js +3 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.mjs.map +1 -1
- package/dist/esm/appShell/TabHost.mjs +25 -0
- package/dist/esm/appShell/TabHost.mjs.map +1 -0
- package/dist/esm/appShell/TabHost.native.js +118 -0
- package/dist/esm/appShell/TabHost.native.js.map +1 -0
- package/dist/esm/appShell/index.mjs +2 -1
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +2 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +8 -20
- package/dist/esm/charts/ChartDataView.mjs.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js +10 -20
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +87 -0
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +91 -0
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.mjs +0 -1
- package/dist/esm/layouts/EmptyState.mjs.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js +0 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.mjs +2 -1
- package/dist/esm/layouts/PageTemplates.mjs.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js +3 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +22 -12
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +27 -16
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.mjs +51 -21
- package/dist/esm/layouts/sidebar.mjs.map +1 -1
- package/dist/esm/layouts/sidebar.native.js +53 -23
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.mjs +9 -6
- package/dist/esm/layouts/toolbar.mjs.map +1 -1
- package/dist/esm/layouts/toolbar.native.js +9 -6
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.mjs +53 -14
- package/dist/esm/views/ImageGrid.mjs.map +1 -1
- package/dist/esm/views/ImageGrid.native.js +56 -15
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +20 -26
- package/dist/esm/views/ListGroup.mjs.map +1 -1
- package/dist/esm/views/ListGroup.native.js +20 -26
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.mjs +4 -7
- package/dist/esm/views/ReportBuilder.mjs.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js +4 -7
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -2
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -2
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/jsx/Accordion/index.native.js +1 -1
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/Alert/index.mjs +5 -0
- package/dist/jsx/Alert/index.mjs.map +1 -1
- package/dist/jsx/Alert/index.native.js +5 -0
- package/dist/jsx/Alert/index.native.js.map +1 -1
- package/dist/jsx/AnimateHeight/index.native.js.map +1 -1
- package/dist/jsx/Avatar/getInitials.mjs +7 -32
- package/dist/jsx/Avatar/getInitials.mjs.map +1 -1
- package/dist/jsx/Avatar/getInitials.native.js +8 -34
- package/dist/jsx/Avatar/getInitials.native.js.map +1 -1
- package/dist/jsx/Avatar/index.mjs +30 -24
- package/dist/jsx/Avatar/index.mjs.map +1 -1
- package/dist/jsx/Avatar/index.native.js +30 -25
- package/dist/jsx/Avatar/index.native.js.map +1 -1
- package/dist/jsx/Badge/index.native.js.map +1 -1
- package/dist/jsx/Button.native.js.map +1 -1
- package/dist/jsx/Card.mjs +69 -13
- package/dist/jsx/Card.mjs.map +1 -1
- package/dist/jsx/Card.native.js +71 -11
- package/dist/jsx/Card.native.js.map +1 -1
- package/dist/jsx/CardFooter.native.js.map +1 -1
- package/dist/jsx/CardHeader.native.js.map +1 -1
- package/dist/jsx/Carousel/index.native.js +3 -3
- package/dist/jsx/Carousel/index.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +54 -9
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +57 -10
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/Collapsible.native.js.map +1 -1
- package/dist/jsx/ContextMenu/index.native.js.map +1 -1
- package/dist/jsx/CopyField/index.native.js.map +1 -1
- package/dist/jsx/Dialog.native.js.map +1 -1
- package/dist/jsx/DotIndicator/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +5 -2
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +5 -2
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/jsx/ErrorBoundary/index.native.js.map +1 -1
- package/dist/jsx/Heading.native.js.map +1 -1
- package/dist/jsx/Kbd/index.native.js.map +1 -1
- package/dist/jsx/Kbd/keys.native.js.map +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js +1 -1
- package/dist/jsx/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.native.js +1 -1
- package/dist/jsx/Lightbox/shared.native.js.map +1 -1
- package/dist/jsx/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/jsx/Material/index.native.js.map +1 -1
- package/dist/jsx/Meter/index.native.js +1 -1
- package/dist/jsx/Meter/index.native.js.map +1 -1
- package/dist/jsx/Meter/meter.native.js.map +1 -1
- package/dist/jsx/OverflowRow/index.mjs +4 -2
- package/dist/jsx/OverflowRow/index.mjs.map +1 -1
- package/dist/jsx/OverflowRow/index.native.js +4 -2
- package/dist/jsx/OverflowRow/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +4 -6
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +5 -7
- package/dist/jsx/Pagination.native.js.map +1 -1
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/ProgressSteps/index.native.js.map +1 -1
- package/dist/jsx/Quote/index.native.js.map +1 -1
- package/dist/jsx/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/jsx/Separator/index.native.js.map +1 -1
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs +5 -1
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +5 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetNavigation.mjs +79 -0
- package/dist/jsx/SheetModal/SheetNavigation.mjs.map +1 -0
- package/dist/jsx/SheetModal/SheetNavigation.native.js +132 -0
- package/dist/jsx/SheetModal/SheetNavigation.native.js.map +1 -0
- package/dist/jsx/SheetModal/detents.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +32 -19
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +86 -58
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/jsx/Skeleton/index.native.js.map +1 -1
- package/dist/jsx/SkipLink/index.native.js.map +1 -1
- package/dist/jsx/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/jsx/SortableList/index.native.js.map +1 -1
- package/dist/jsx/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/jsx/Tabs/index.native.js +1 -1
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Text.native.js.map +1 -1
- package/dist/jsx/ThemePlayground/index.mjs +1 -2
- package/dist/jsx/ThemePlayground/index.mjs.map +1 -1
- package/dist/jsx/ThemePresetPicker/index.native.js +2 -2
- package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/jsx/Toast/index.native.js.map +1 -1
- package/dist/jsx/Toast/store.native.js.map +1 -1
- package/dist/jsx/Tooltip/nativePress.native.js.map +1 -1
- package/dist/jsx/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/jsx/TreeSelect/index.native.js +1 -1
- package/dist/jsx/TreeSelect/index.native.js.map +1 -1
- package/dist/jsx/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/jsx/Video/PlayerChrome.native.js.map +1 -1
- package/dist/jsx/Video/VideoFrame.native.js.map +1 -1
- package/dist/jsx/Video/types.native.js.map +1 -1
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/Wizard/index.native.js +2 -2
- package/dist/jsx/Wizard/index.native.js.map +1 -1
- package/dist/jsx/actions/ActionBar.native.js.map +1 -1
- package/dist/jsx/actions/DangerSection.native.js.map +1 -1
- package/dist/jsx/actions/DestructiveAction.native.js.map +1 -1
- package/dist/jsx/actions/HeaderActions.native.js +2 -2
- package/dist/jsx/actions/HeaderActions.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.mjs +104 -0
- package/dist/jsx/actions/StandardAction.mjs.map +1 -0
- package/dist/jsx/actions/StandardAction.native.js +136 -0
- package/dist/jsx/actions/StandardAction.native.js.map +1 -0
- package/dist/jsx/actions/devWarn.native.js.map +1 -1
- package/dist/jsx/actions/index.mjs +3 -1
- package/dist/jsx/actions/index.mjs.map +1 -1
- package/dist/jsx/actions/index.native.js +8 -1
- package/dist/jsx/actions/index.native.js.map +1 -1
- package/dist/jsx/actions/severity.native.js.map +1 -1
- package/dist/jsx/appShell/BottomAccessory.native.js.map +1 -1
- package/dist/jsx/appShell/Dock.native.js.map +1 -1
- package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js +1 -1
- package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js +1 -1
- package/dist/jsx/appShell/Springboard.native.js.map +1 -1
- package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabBar.mjs.map +1 -1
- package/dist/jsx/appShell/TabBar.native.js +1 -1
- package/dist/jsx/appShell/TabBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.mjs +25 -0
- package/dist/jsx/appShell/TabHost.mjs.map +1 -0
- package/dist/jsx/appShell/TabHost.native.js +151 -0
- package/dist/jsx/appShell/TabHost.native.js.map +1 -0
- package/dist/jsx/appShell/appTile.native.js +1 -1
- package/dist/jsx/appShell/appTile.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +2 -1
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +2 -0
- package/dist/jsx/appShell/index.native.js.map +1 -1
- package/dist/jsx/charts/Axis.native.js.map +1 -1
- package/dist/jsx/charts/BarChart.native.js.map +1 -1
- package/dist/jsx/charts/ChartDataView.mjs +8 -20
- package/dist/jsx/charts/ChartDataView.mjs.map +1 -1
- package/dist/jsx/charts/ChartDataView.native.js +11 -21
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
- package/dist/jsx/charts/ChartSurface.native.js.map +1 -1
- package/dist/jsx/charts/LineChart.native.js.map +1 -1
- package/dist/jsx/charts/PieChart.native.js.map +1 -1
- package/dist/jsx/charts/Sparkline.native.js.map +1 -1
- package/dist/jsx/charts/accessibility.native.js.map +1 -1
- package/dist/jsx/charts/chartHeight.native.js.map +1 -1
- package/dist/jsx/charts/composeChart.native.js.map +1 -1
- package/dist/jsx/charts/index.native.js.map +1 -1
- package/dist/jsx/charts/math.native.js.map +1 -1
- package/dist/jsx/charts/series.native.js.map +1 -1
- package/dist/jsx/charts/svg.native.js.map +1 -1
- package/dist/jsx/charts/types.native.js.map +1 -1
- package/dist/jsx/charts/useChartTheme.native.js.map +1 -1
- package/dist/jsx/code/Code/index.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +7 -7
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/index.native.js.map +1 -1
- package/dist/jsx/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/jsx/code/Pre/index.native.js.map +1 -1
- package/dist/jsx/code/index.native.js +5 -5
- package/dist/jsx/code/index.native.js.map +1 -1
- package/dist/jsx/componentColors.native.js.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +2 -2
- package/dist/jsx/feedback/NotifyHost.native.js.map +1 -1
- package/dist/jsx/feedback/copy.native.js.map +1 -1
- package/dist/jsx/feedback/index.native.js.map +1 -1
- package/dist/jsx/feedback/notify.native.js.map +1 -1
- package/dist/jsx/feedback/route.native.js.map +1 -1
- package/dist/jsx/feedback/store.native.js.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/jsx/formLayouts/index.native.js.map +1 -1
- package/dist/jsx/hooks/index.native.js +1 -1
- package/dist/jsx/hooks/index.native.js.map +1 -1
- package/dist/jsx/hooks/useClipboard.native.js.map +1 -1
- package/dist/jsx/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/jsx/hooks/useHoldCue.native.js.map +1 -1
- package/dist/jsx/icons/CheckRegular.native.js.map +1 -1
- package/dist/jsx/icons/MinusRegular.native.js.map +1 -1
- package/dist/jsx/icons/index.native.js.map +1 -1
- package/dist/jsx/icons/lucide.native.js.map +1 -1
- package/dist/jsx/icons/themed.native.js.map +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js +1 -1
- package/dist/jsx/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/jsx/images/Image/framing.native.js.map +1 -1
- package/dist/jsx/images/Image/index.native.js +1 -1
- package/dist/jsx/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/jsx/images/Image/shared.native.js +1 -1
- package/dist/jsx/images/Image/shared.native.js.map +1 -1
- package/dist/jsx/images/Image/types.native.js.map +1 -1
- package/dist/jsx/images/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +37 -35
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +87 -0
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +93 -2
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/Debug/index.native.js.map +1 -1
- package/dist/jsx/layouts/EmptyState.mjs +0 -1
- package/dist/jsx/layouts/EmptyState.mjs.map +1 -1
- package/dist/jsx/layouts/EmptyState.native.js +0 -1
- package/dist/jsx/layouts/EmptyState.native.js.map +1 -1
- package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/jsx/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/jsx/layouts/PageTemplates.mjs +2 -1
- package/dist/jsx/layouts/PageTemplates.mjs.map +1 -1
- package/dist/jsx/layouts/PageTemplates.native.js +2 -0
- package/dist/jsx/layouts/PageTemplates.native.js.map +1 -1
- package/dist/jsx/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/jsx/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/jsx/layouts/StatusDot.native.js.map +1 -1
- package/dist/jsx/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +1 -1
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/layouts/index.native.js +3 -3
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +22 -12
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +29 -18
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/jsx/layouts/sidebar.mjs +51 -21
- package/dist/jsx/layouts/sidebar.mjs.map +1 -1
- package/dist/jsx/layouts/sidebar.native.js +54 -24
- package/dist/jsx/layouts/sidebar.native.js.map +1 -1
- package/dist/jsx/layouts/tags.native.js +2 -2
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.native.js +2 -2
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/layouts/toolbar.mjs +9 -6
- package/dist/jsx/layouts/toolbar.mjs.map +1 -1
- package/dist/jsx/layouts/toolbar.native.js +10 -7
- package/dist/jsx/layouts/toolbar.native.js.map +1 -1
- package/dist/jsx/shared/actionScan.native.js.map +1 -1
- package/dist/jsx/shared/i18n.native.js.map +1 -1
- package/dist/jsx/shared/restoreRetries.native.js.map +1 -1
- package/dist/jsx/shared/t.native.js.map +1 -1
- package/dist/jsx/shared/textRidesText.native.js.map +1 -1
- package/dist/jsx/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/jsx/surfaces.native.js +1 -1
- package/dist/jsx/surfaces.native.js.map +1 -1
- package/dist/jsx/tamagui.native.js +1 -1
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/dist/jsx/testSetup.native.js.map +1 -1
- package/dist/jsx/utils/setTinted.native.js.map +1 -1
- package/dist/jsx/utils/unwrapText.native.js.map +1 -1
- package/dist/jsx/views/Calendar.native.js +1 -1
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +2 -2
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/Gantt.native.js +2 -2
- package/dist/jsx/views/Gantt.native.js.map +1 -1
- package/dist/jsx/views/GanttDateGrip.native.js.map +1 -1
- package/dist/jsx/views/ImageGrid.mjs +53 -14
- package/dist/jsx/views/ImageGrid.mjs.map +1 -1
- package/dist/jsx/views/ImageGrid.native.js +60 -17
- package/dist/jsx/views/ImageGrid.native.js.map +1 -1
- package/dist/jsx/views/Kanban.native.js +1 -1
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.mjs +20 -26
- package/dist/jsx/views/ListGroup.mjs.map +1 -1
- package/dist/jsx/views/ListGroup.native.js +19 -25
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/ListRow.native.js.map +1 -1
- package/dist/jsx/views/Matrix.native.js +2 -2
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.mjs +4 -7
- package/dist/jsx/views/ReportBuilder.mjs.map +1 -1
- package/dist/jsx/views/ReportBuilder.native.js +5 -8
- package/dist/jsx/views/ReportBuilder.native.js.map +1 -1
- package/dist/jsx/views/ShortcutCard.native.js.map +1 -1
- package/dist/jsx/views/TreeView.native.js.map +1 -1
- package/dist/jsx/views/calendarMath.native.js.map +1 -1
- package/dist/jsx/views/ganttIntervals.native.js.map +1 -1
- package/dist/jsx/views/ganttMath.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -2
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +3 -1
- package/dist/jsx/views/index.native.js.map +1 -1
- package/dist/jsx/views/kanbanDnd.native.js.map +1 -1
- package/dist/jsx/views/matrixMath.native.js.map +1 -1
- package/dist/jsx/views/treeViewDnd.native.js.map +1 -1
- package/dist/jsx/views/treeViewLayout.native.js.map +1 -1
- package/dist/jsx/views/treeViewMotion.native.js.map +1 -1
- package/dist/jsx/views/treeViewReveal.native.js.map +1 -1
- package/dist/jsx/views/widgetChrome.native.js.map +1 -1
- package/package.json +13 -9
- package/src/Alert/Alert.spec.tsx +22 -0
- package/src/Alert/index.tsx +5 -0
- package/src/AlertDialogContent.stories.tsx +4 -3
- package/src/Avatar/Avatar.ink.spec.tsx +74 -0
- package/src/Avatar/Avatar.spec.tsx +35 -8
- package/src/Avatar/getInitials.ts +12 -30
- package/src/Avatar/index.tsx +37 -22
- package/src/Button.stories.tsx +1 -1
- package/src/Card.spec.tsx +45 -0
- package/src/Card.stories.tsx +7 -6
- package/src/Card.tsx +57 -18
- package/src/CardFooter.stories.tsx +3 -2
- package/src/CardHeader.stories.tsx +2 -1
- package/src/Chip/Chip.spec.tsx +72 -1
- package/src/Chip/index.tsx +86 -7
- package/src/DialogContent.stories.tsx +9 -11
- package/src/DropdownMenu/DropdownMenu.avatarTrigger.spec.tsx +62 -0
- package/src/DropdownMenu/DropdownMenu.stories.tsx +47 -1
- package/src/DropdownMenu/index.tsx +7 -3
- package/src/OverflowRow/OverflowRow.native.spec.tsx +17 -2
- package/src/OverflowRow/index.tsx +6 -2
- package/src/Pagination.spec.tsx +43 -15
- package/src/Pagination.tsx +11 -9
- package/src/Panel.stories.tsx +5 -6
- package/src/SheetModal/SheetHeader.tsx +3 -2
- package/src/SheetModal/SheetModal.fill.spec.tsx +1 -1
- package/src/SheetModal/SheetModal.menus.spec.tsx +125 -26
- package/src/SheetModal/SheetModal.native.spec.tsx +35 -0
- package/src/SheetModal/SheetModal.regularWidth.native.spec.tsx +117 -0
- package/src/SheetModal/SheetModal.stories.spec.tsx +7 -3
- package/src/SheetModal/SheetModal.stories.tsx +30 -20
- package/src/SheetModal/SheetNavigation.tsx +93 -0
- package/src/SheetModal/index.native.tsx +108 -69
- package/src/SheetModal/index.tsx +39 -22
- package/src/SkipLink/SkipLink.stories.tsx +2 -2
- package/src/Tabs/Tabs.stories.tsx +2 -2
- package/src/ThemePlayground/index.tsx +1 -2
- package/src/Tooltip/Tooltip.spec.tsx +2 -2
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/actions/ActionBar.stories.spec.tsx +5 -5
- package/src/actions/ActionBar.stories.tsx +8 -25
- package/src/actions/ActionButton.spec.tsx +125 -0
- package/src/actions/ActionButton.stories.tsx +113 -0
- package/src/actions/DestructiveAction.stories.tsx +4 -3
- package/src/actions/StandardAction.tsx +185 -0
- package/src/actions/index.ts +14 -0
- package/src/appShell/TabBar.tsx +5 -0
- package/src/appShell/TabHost.native.spec.tsx +188 -0
- package/src/appShell/TabHost.native.tsx +154 -0
- package/src/appShell/TabHost.tsx +36 -0
- package/src/appShell/index.ts +1 -0
- package/src/charts/ChartDataView.tsx +9 -14
- package/src/icons/nativeIconInk.dark.spec.tsx +159 -0
- package/src/index.ts +2 -0
- package/src/layouts/AsyncBoundary.spec.tsx +24 -1
- package/src/layouts/AsyncBoundary.stories.tsx +8 -1
- package/src/layouts/AsyncBoundary.tsx +71 -2
- package/src/layouts/AsyncSkeleton.stories.tsx +9 -1
- package/src/layouts/EmptyState.stories.tsx +3 -2
- package/src/layouts/EmptyState.tsx +0 -1
- package/src/layouts/PageHeader.stories.tsx +88 -4
- package/src/layouts/PageTemplates.spec.tsx +28 -1
- package/src/layouts/PageTemplates.stories.tsx +6 -7
- package/src/layouts/PageTemplates.tsx +8 -1
- package/src/layouts/ScreenToolbar.stories.tsx +3 -2
- package/src/layouts/Sidebar.spec.tsx +48 -0
- package/src/layouts/layouts.spec.tsx +33 -0
- package/src/layouts/navBar.spec.tsx +22 -0
- package/src/layouts/page.tsx +31 -13
- package/src/layouts/pageChrome.phone.spec.tsx +11 -5
- package/src/layouts/sidebar.tsx +84 -31
- package/src/layouts/toolbar.tsx +16 -2
- package/src/overlayElevation.spec.tsx +3 -4
- package/src/surfaces.spec.tsx +60 -0
- package/src/views/ImageGrid.photos.spec.tsx +46 -0
- package/src/views/ImageGrid.tsx +52 -27
- package/src/views/ListGroup.native-press.spec.tsx +66 -0
- package/src/views/ListGroup.spec.tsx +25 -6
- package/src/views/ListGroup.tsx +20 -30
- package/src/views/ReportBuilder.tsx +2 -10
- package/src/views/index.ts +8 -1
- package/types/Alert/index.d.ts.map +1 -1
- package/types/Avatar/getInitials.d.ts +3 -27
- package/types/Avatar/getInitials.d.ts.map +1 -1
- package/types/Avatar/index.d.ts +15 -2
- package/types/Avatar/index.d.ts.map +1 -1
- package/types/Card.d.ts +15 -1
- package/types/Card.d.ts.map +1 -1
- package/types/Chip/index.d.ts +38 -3
- package/types/Chip/index.d.ts.map +1 -1
- package/types/DropdownMenu/index.d.ts +2 -1
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/OverflowRow/index.d.ts.map +1 -1
- package/types/Pagination.d.ts +4 -1
- package/types/Pagination.d.ts.map +1 -1
- package/types/SheetModal/SheetHeader.d.ts +1 -1
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/SheetModal/SheetNavigation.d.ts +14 -0
- package/types/SheetModal/SheetNavigation.d.ts.map +1 -0
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +6 -0
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/ThemePlayground/index.d.ts.map +1 -1
- package/types/actions/StandardAction.d.ts +64 -0
- package/types/actions/StandardAction.d.ts.map +1 -0
- package/types/actions/index.d.ts +2 -0
- package/types/actions/index.d.ts.map +1 -1
- package/types/appShell/TabBar.d.ts +8 -0
- package/types/appShell/TabBar.d.ts.map +1 -1
- package/types/appShell/TabHost.d.ts +23 -0
- package/types/appShell/TabHost.d.ts.map +1 -0
- package/types/appShell/TabHost.native.d.ts +56 -0
- package/types/appShell/TabHost.native.d.ts.map +1 -0
- package/types/appShell/index.d.ts +1 -0
- package/types/appShell/index.d.ts.map +1 -1
- package/types/charts/ChartDataView.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts +13 -2
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/layouts/EmptyState.d.ts.map +1 -1
- package/types/layouts/PageTemplates.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/sidebar.d.ts +25 -3
- package/types/layouts/sidebar.d.ts.map +1 -1
- package/types/layouts/toolbar.d.ts +9 -0
- package/types/layouts/toolbar.d.ts.map +1 -1
- package/types/views/ImageGrid.d.ts +19 -1
- package/types/views/ImageGrid.d.ts.map +1 -1
- package/types/views/ListGroup.d.ts +4 -1
- package/types/views/ListGroup.d.ts.map +1 -1
- package/types/views/ReportBuilder.d.ts.map +1 -1
- package/types/views/index.d.ts +1 -1
- package/types/views/index.d.ts.map +1 -1
package/src/Card.stories.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
// Catalog Button (G-15 story honesty / LC-18, UX-P06).
|
|
3
3
|
import {
|
|
4
|
-
Button,
|
|
5
4
|
DescriptionList,
|
|
6
5
|
Form,
|
|
7
6
|
FormActions,
|
|
@@ -17,6 +16,8 @@ import {
|
|
|
17
16
|
StarIcon,
|
|
18
17
|
} from "@phosphor-icons/react";
|
|
19
18
|
import { XStack, YStack } from "tamagui";
|
|
19
|
+
import { ActionBar } from "./actions/ActionBar";
|
|
20
|
+
import { ActionButton } from "./actions/StandardAction";
|
|
20
21
|
import { Card } from "./Card";
|
|
21
22
|
import { StatusDot } from "./layouts/StatusDot";
|
|
22
23
|
import { reportCopy } from "./feedback/copy";
|
|
@@ -77,10 +78,10 @@ export const WithHeaderFooter: Story = {
|
|
|
77
78
|
</Card.Header>
|
|
78
79
|
<Paragraph>Main content between header and footer.</Paragraph>
|
|
79
80
|
<Card.Footer>
|
|
80
|
-
<
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
81
|
+
<ActionBar
|
|
82
|
+
cancel={<ActionButton kind="cancel" />}
|
|
83
|
+
primary={<ActionButton kind="confirm" />}
|
|
84
|
+
/>
|
|
84
85
|
</Card.Footer>
|
|
85
86
|
</Card>
|
|
86
87
|
),
|
|
@@ -110,7 +111,7 @@ export const WithForm: Story = {
|
|
|
110
111
|
<Input label="Username" name="username" required />
|
|
111
112
|
<Input label="Email" name="email" required />
|
|
112
113
|
<FormActions>
|
|
113
|
-
<
|
|
114
|
+
<ActionButton kind="submit" formAction="submit" />
|
|
114
115
|
</FormActions>
|
|
115
116
|
</Form>
|
|
116
117
|
</Card>
|
package/src/Card.tsx
CHANGED
|
@@ -6,11 +6,13 @@ import {
|
|
|
6
6
|
} from "@multiplatform.one/theme";
|
|
7
7
|
import { CardFooter } from "./CardFooter";
|
|
8
8
|
import { CardHeader } from "./CardHeader";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
9
10
|
import {
|
|
10
11
|
Card as TamaguiCard,
|
|
11
12
|
type CardProps as TamaguiCardProps,
|
|
12
13
|
type SizeTokens,
|
|
13
14
|
withStaticProperties,
|
|
15
|
+
YStack,
|
|
14
16
|
} from "tamagui";
|
|
15
17
|
|
|
16
18
|
/**
|
|
@@ -31,6 +33,11 @@ import {
|
|
|
31
33
|
*
|
|
32
34
|
* Padding contract: Card owns the inset (knob `panelPadding`) on every tier —
|
|
33
35
|
* Header/Footer are zero-padding rows (LC-09); vertical rhythm is the Card gap.
|
|
36
|
+
*
|
|
37
|
+
* Media (full bleed): `media` sits flush at the top edge, clipped by the
|
|
38
|
+
* card's own radius, and the inset moves to the body under it (a record's
|
|
39
|
+
* image well over its title, Material's media card). `overlay` lays one
|
|
40
|
+
* layer over the whole card, such as a stretched link.
|
|
34
41
|
*/
|
|
35
42
|
|
|
36
43
|
export type SurfaceTier = "content" | "elevated" | "feature";
|
|
@@ -39,6 +46,14 @@ export interface CardProps extends Omit<TamaguiCardProps, "size"> {
|
|
|
39
46
|
tier?: SurfaceTier;
|
|
40
47
|
/** Control size forwarded to every part inside the card. */
|
|
41
48
|
size?: SizeTokens;
|
|
49
|
+
/** Full-bleed media above the body: no inset, clipped by the card radius. */
|
|
50
|
+
media?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* A layer over the whole card, above media and body: the stretched link
|
|
53
|
+
* that makes a routed card one target (LC-74). A control that must stay
|
|
54
|
+
* pressable over it (a favorite toggle) sits at a higher `zIndex`.
|
|
55
|
+
*/
|
|
56
|
+
overlay?: ReactNode;
|
|
42
57
|
}
|
|
43
58
|
|
|
44
59
|
export type { CardFooterProps } from "./CardFooter";
|
|
@@ -62,7 +77,17 @@ function hostData(attrs: Record<string, string>): Record<string, unknown> {
|
|
|
62
77
|
return { dataSet };
|
|
63
78
|
}
|
|
64
79
|
|
|
65
|
-
|
|
80
|
+
const paddingKey = /^padding/;
|
|
81
|
+
|
|
82
|
+
function CardOverlay({ children }: { children: ReactNode }) {
|
|
83
|
+
return (
|
|
84
|
+
<YStack position="absolute" top={0} left={0} right={0} bottom={0} zIndex={1}>
|
|
85
|
+
{children}
|
|
86
|
+
</YStack>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function CardRoot({ children, tier = "content", size, media, overlay, ...props }: CardProps) {
|
|
66
91
|
const { knobProps } = useResolvedKnobs({ component: "Card", size });
|
|
67
92
|
const parentPainted = SurfaceContext.useStyledContext().painted ?? false;
|
|
68
93
|
// Axiom 1 child-clip cap: the padded container's radius may not exceed its
|
|
@@ -80,28 +105,42 @@ function CardRoot({ children, tier = "content", size, ...props }: CardProps) {
|
|
|
80
105
|
const radiusKnob = Object.entries(borderRadiusMap).find(
|
|
81
106
|
([, token]) => token === knobProps.borderRadius.borderRadius,
|
|
82
107
|
)?.[0];
|
|
108
|
+
const data = hostData({
|
|
109
|
+
"data-tier": tier,
|
|
110
|
+
"data-size-token": knobProps.sizeToken,
|
|
111
|
+
"data-nested-px": String(knobProps.nestedControl.px),
|
|
112
|
+
...(media != null ? { "data-card-media": "" } : {}),
|
|
113
|
+
...(tier !== "feature" && radiusKnob
|
|
114
|
+
? {
|
|
115
|
+
"data-constraint-container": "Card",
|
|
116
|
+
"data-radius-knob": radiusKnob,
|
|
117
|
+
}
|
|
118
|
+
: {}),
|
|
119
|
+
});
|
|
120
|
+
if (media != null) {
|
|
121
|
+
const inset = {
|
|
122
|
+
...knobProps.panelPadding,
|
|
123
|
+
...Object.fromEntries(Object.entries(tierProps).filter(([key]) => paddingKey.test(key))),
|
|
124
|
+
};
|
|
125
|
+
return (
|
|
126
|
+
<TamaguiCard {...tierProps} {...data} padding={0} gap={0} overflow="hidden" {...props}>
|
|
127
|
+
<Surface size={size} painted elevated={tier === "elevated" && !parentPainted}>
|
|
128
|
+
<YStack {...hostData({ "data-card-media-slot": "" })}>{media}</YStack>
|
|
129
|
+
<YStack {...inset} {...knobProps.gap} {...hostData({ "data-card-body": "" })}>
|
|
130
|
+
{children}
|
|
131
|
+
</YStack>
|
|
132
|
+
{overlay != null ? <CardOverlay>{overlay}</CardOverlay> : null}
|
|
133
|
+
</Surface>
|
|
134
|
+
</TamaguiCard>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
83
137
|
// panelPadding first so tier recipes may override (feature uses a larger
|
|
84
138
|
// inset); elevatedSurface carries no padding of its own.
|
|
85
139
|
return (
|
|
86
|
-
<TamaguiCard
|
|
87
|
-
{...knobProps.panelPadding}
|
|
88
|
-
{...tierProps}
|
|
89
|
-
{...knobProps.gap}
|
|
90
|
-
{...hostData({
|
|
91
|
-
"data-tier": tier,
|
|
92
|
-
"data-size-token": knobProps.sizeToken,
|
|
93
|
-
"data-nested-px": String(knobProps.nestedControl.px),
|
|
94
|
-
...(tier !== "feature" && radiusKnob
|
|
95
|
-
? {
|
|
96
|
-
"data-constraint-container": "Card",
|
|
97
|
-
"data-radius-knob": radiusKnob,
|
|
98
|
-
}
|
|
99
|
-
: {}),
|
|
100
|
-
})}
|
|
101
|
-
{...props}
|
|
102
|
-
>
|
|
140
|
+
<TamaguiCard {...knobProps.panelPadding} {...tierProps} {...knobProps.gap} {...data} {...props}>
|
|
103
141
|
<Surface size={size} painted elevated={tier === "elevated" && !parentPainted}>
|
|
104
142
|
{children}
|
|
143
|
+
{overlay != null ? <CardOverlay>{overlay}</CardOverlay> : null}
|
|
105
144
|
</Surface>
|
|
106
145
|
</TamaguiCard>
|
|
107
146
|
);
|
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
|
2
2
|
// Catalog Button (G-15 story honesty / LC-18, UX-P06).
|
|
3
3
|
import { Button } from "@multiplatform.one/forms";
|
|
4
4
|
import { XStack, YStack } from "tamagui";
|
|
5
|
+
import { ActionButton } from "./actions/StandardAction";
|
|
5
6
|
import { Card } from "./Card";
|
|
6
7
|
import { Paragraph } from "./Text";
|
|
7
8
|
|
|
@@ -32,8 +33,8 @@ export const Default: Story = {
|
|
|
32
33
|
<Card.Footer>
|
|
33
34
|
Ready to submit
|
|
34
35
|
<XStack gap="$2">
|
|
35
|
-
<
|
|
36
|
-
<
|
|
36
|
+
<ActionButton kind="cancel" />
|
|
37
|
+
<ActionButton kind="confirm" />
|
|
37
38
|
</XStack>
|
|
38
39
|
</Card.Footer>
|
|
39
40
|
</Card>
|
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
|
2
2
|
// Catalog Button (G-15 story honesty / LC-18, UX-P06).
|
|
3
3
|
import { Button } from "@multiplatform.one/forms";
|
|
4
4
|
import { XStack, YStack } from "tamagui";
|
|
5
|
+
import { ActionButton } from "./actions/StandardAction";
|
|
5
6
|
import { Card } from "./Card";
|
|
6
7
|
import { SizableText } from "./Text";
|
|
7
8
|
|
|
@@ -41,7 +42,7 @@ export const WithActions: Story = {
|
|
|
41
42
|
<Card.Header>
|
|
42
43
|
<XStack justifyContent="space-between" alignItems="center" gap="$2" flexWrap="wrap">
|
|
43
44
|
<SizableText fontWeight="700">Header with actions</SizableText>
|
|
44
|
-
<
|
|
45
|
+
<ActionButton kind="edit" />
|
|
45
46
|
</XStack>
|
|
46
47
|
</Card.Header>
|
|
47
48
|
</Card>
|
package/src/Chip/Chip.spec.tsx
CHANGED
|
@@ -12,7 +12,23 @@ import {
|
|
|
12
12
|
defaultScaleInputs,
|
|
13
13
|
} from "@multiplatform.one/theme";
|
|
14
14
|
import { TagIcon } from "@phosphor-icons/react";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
Chip,
|
|
17
|
+
ChipFrame,
|
|
18
|
+
ChipText,
|
|
19
|
+
chipFrameGeometry,
|
|
20
|
+
chipIconSize,
|
|
21
|
+
chipSwatch,
|
|
22
|
+
chipTone,
|
|
23
|
+
} from "./index";
|
|
24
|
+
|
|
25
|
+
const greenSteps = {
|
|
26
|
+
tint: "$green4",
|
|
27
|
+
hoverTint: "$green5",
|
|
28
|
+
fill: "$green11",
|
|
29
|
+
text: "$green12",
|
|
30
|
+
border: "$green7",
|
|
31
|
+
};
|
|
16
32
|
|
|
17
33
|
describe("Chip", () => {
|
|
18
34
|
it("renders its label", () => {
|
|
@@ -308,3 +324,58 @@ it("forwards an explicit accessible label to the interactive chip", () => {
|
|
|
308
324
|
);
|
|
309
325
|
expect(result.getByRole("button", { name: "Preset: Bold" })).toBeDefined();
|
|
310
326
|
});
|
|
327
|
+
|
|
328
|
+
describe("Chip for data-driven facets (FZ-8000)", () => {
|
|
329
|
+
it("paints any theme ramp at the named colours' steps", () => {
|
|
330
|
+
expect(chipSwatch("teal")).toEqual({
|
|
331
|
+
tint: "$teal4",
|
|
332
|
+
hoverTint: "$teal5",
|
|
333
|
+
fill: "$teal11",
|
|
334
|
+
fillText: "$color1",
|
|
335
|
+
text: "$teal12",
|
|
336
|
+
border: "$teal7",
|
|
337
|
+
});
|
|
338
|
+
expect(chipSwatch("green")).toEqual({ ...chipSwatch("teal"), ...greenSteps });
|
|
339
|
+
expect(chipSwatch(undefined)).toEqual(chipSwatch("gray"));
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it("shows a count after the label in the label's ink", () => {
|
|
343
|
+
const result = renderWithProviders(
|
|
344
|
+
<Chip color="red" count={12}>
|
|
345
|
+
Fire
|
|
346
|
+
</Chip>,
|
|
347
|
+
);
|
|
348
|
+
const count = result.container.querySelector("[data-chip-count]") as HTMLElement;
|
|
349
|
+
expect(count.textContent).toBe("12");
|
|
350
|
+
expect(count.className).toContain("_col-red12");
|
|
351
|
+
expect(
|
|
352
|
+
result.getByText("Fire").compareDocumentPosition(count) & Node.DOCUMENT_POSITION_FOLLOWING,
|
|
353
|
+
).toBeTruthy();
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
it("is a radio inside a single-select group: aria-checked and a roving tab stop", () => {
|
|
357
|
+
const onKeyDown = vi.fn((event: KeyboardEvent) => event.preventDefault());
|
|
358
|
+
const onPress = vi.fn();
|
|
359
|
+
const result = renderWithProviders(
|
|
360
|
+
<>
|
|
361
|
+
<Chip role="radio" selected tabIndex={0} onPress={onPress} onKeyDown={onKeyDown}>
|
|
362
|
+
On
|
|
363
|
+
</Chip>
|
|
364
|
+
<Chip role="radio" selected={false} tabIndex={-1} onPress={onPress}>
|
|
365
|
+
Off
|
|
366
|
+
</Chip>
|
|
367
|
+
</>,
|
|
368
|
+
);
|
|
369
|
+
const [on, off] = result.getAllByRole("radio");
|
|
370
|
+
expect(on.getAttribute("aria-checked")).toBe("true");
|
|
371
|
+
expect(on.hasAttribute("aria-pressed")).toBe(false);
|
|
372
|
+
expect(on.getAttribute("tabindex")).toBe("0");
|
|
373
|
+
expect(off.getAttribute("aria-checked")).toBe("false");
|
|
374
|
+
expect(off.getAttribute("tabindex")).toBe("-1");
|
|
375
|
+
fireEvent.keyDown(on, { key: "Enter" });
|
|
376
|
+
expect(onKeyDown).toHaveBeenCalledTimes(1);
|
|
377
|
+
expect(onPress).not.toHaveBeenCalled();
|
|
378
|
+
fireEvent.keyDown(off, { key: "Enter" });
|
|
379
|
+
expect(onPress).toHaveBeenCalledTimes(1);
|
|
380
|
+
});
|
|
381
|
+
});
|
package/src/Chip/index.tsx
CHANGED
|
@@ -23,7 +23,9 @@ import {
|
|
|
23
23
|
isValidElement,
|
|
24
24
|
useState,
|
|
25
25
|
type ComponentType,
|
|
26
|
+
type FocusEvent,
|
|
26
27
|
type ReactNode,
|
|
28
|
+
type Ref,
|
|
27
29
|
} from "react";
|
|
28
30
|
import { useTranslation } from "react-i18next";
|
|
29
31
|
import type { ColorTokens, FontSizeTokens, GetProps } from "tamagui";
|
|
@@ -35,6 +37,12 @@ import { Text, View, getTokenValue, styled } from "tamagui";
|
|
|
35
37
|
export type ChipTone = "filled" | "outlined" | "ghost";
|
|
36
38
|
export type ChipVariant = ChipTone | "solid" | "subtle" | "outline";
|
|
37
39
|
export type ChipColor = "gray" | "red" | "green" | "blue" | "yellow" | "orange" | "purple";
|
|
40
|
+
/**
|
|
41
|
+
* A named colour, or any other ramp the theme carries (`"grass"`, `"teal"`):
|
|
42
|
+
* data-driven tints such as a record's facet value paint from their own ramp
|
|
43
|
+
* at the same steps the named colours use (LC-147).
|
|
44
|
+
*/
|
|
45
|
+
export type ChipHue = ChipColor | (string & {});
|
|
38
46
|
export type ChipSize = "$2" | "$3" | "$4" | "$5";
|
|
39
47
|
|
|
40
48
|
export interface ChipProps {
|
|
@@ -42,7 +50,7 @@ export interface ChipProps {
|
|
|
42
50
|
children: ReactNode;
|
|
43
51
|
size?: ChipSize;
|
|
44
52
|
variant?: ChipVariant;
|
|
45
|
-
color?:
|
|
53
|
+
color?: ChipHue;
|
|
46
54
|
/** Leading glyph (assist / input). Sized to the chip; omit to get a check when selected. */
|
|
47
55
|
icon?: ReactNode;
|
|
48
56
|
/** Selected/filter-on. LC-131: the theme's selected recipe on the neutral selection surface. */
|
|
@@ -52,9 +60,27 @@ export interface ChipProps {
|
|
|
52
60
|
/** Press the pill (filter / assist). Makes the pill a keyboard stop. */
|
|
53
61
|
onPress?: () => void;
|
|
54
62
|
onDismiss?: () => void;
|
|
63
|
+
/** The dismiss button's accessible name, saying what it clears. Defaults to "Remove". */
|
|
64
|
+
dismissLabel?: string;
|
|
55
65
|
disabled?: boolean;
|
|
56
66
|
/** Cap the pill; the label ellipsizes. */
|
|
57
67
|
maxWidth?: number | string;
|
|
68
|
+
/** A count after the label (a facet's records), in the label's ink at the secondary weight. */
|
|
69
|
+
count?: number;
|
|
70
|
+
/**
|
|
71
|
+
* `radio` makes a pressable chip one option of a single-select group: it
|
|
72
|
+
* reports `aria-checked` instead of `aria-pressed`, and the group owns the
|
|
73
|
+
* tab stop (`tabIndex`) and the arrow keys (`onKeyDown`).
|
|
74
|
+
*/
|
|
75
|
+
role?: "button" | "radio";
|
|
76
|
+
/** Roving tab stop for a chip inside a composite group. */
|
|
77
|
+
tabIndex?: number;
|
|
78
|
+
/** Runs before the chip's own Enter / Space activation; `preventDefault` skips it. */
|
|
79
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
80
|
+
onFocus?: (event: FocusEvent) => void;
|
|
81
|
+
onBlur?: (event: FocusEvent) => void;
|
|
82
|
+
testID?: string;
|
|
83
|
+
ref?: Ref<unknown>;
|
|
58
84
|
}
|
|
59
85
|
|
|
60
86
|
// ── Color mappings ────────────────────────────────────────────
|
|
@@ -130,6 +156,23 @@ const colorMap: Record<ChipColor, ChipSwatch> = {
|
|
|
130
156
|
},
|
|
131
157
|
};
|
|
132
158
|
|
|
159
|
+
/** The swatch for a theme ramp outside the named colours, at the named colours' steps. */
|
|
160
|
+
function rampSwatch(hue: string): ChipSwatch {
|
|
161
|
+
return {
|
|
162
|
+
tint: `$${hue}4` as ColorTokens,
|
|
163
|
+
hoverTint: `$${hue}5` as ColorTokens,
|
|
164
|
+
fill: `$${hue}11` as ColorTokens,
|
|
165
|
+
fillText: "$color1",
|
|
166
|
+
text: `$${hue}12` as ColorTokens,
|
|
167
|
+
border: `$${hue}7` as ColorTokens,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** The swatch a chip paints for `color`: a named colour's, or any theme ramp's at the same steps. */
|
|
172
|
+
export function chipSwatch(color: ChipHue | undefined): ChipSwatch {
|
|
173
|
+
return colorMap[color as ChipColor] ?? (color ? rampSwatch(color) : colorMap.gray);
|
|
174
|
+
}
|
|
175
|
+
|
|
133
176
|
export function chipTone(variant: ChipVariant | undefined): ChipTone {
|
|
134
177
|
switch (variant) {
|
|
135
178
|
case "filled":
|
|
@@ -348,12 +391,21 @@ export function Chip({
|
|
|
348
391
|
swatch,
|
|
349
392
|
onPress,
|
|
350
393
|
onDismiss,
|
|
394
|
+
dismissLabel,
|
|
351
395
|
disabled,
|
|
352
396
|
maxWidth,
|
|
397
|
+
count,
|
|
398
|
+
role = "button",
|
|
399
|
+
tabIndex,
|
|
400
|
+
onKeyDown,
|
|
401
|
+
onFocus,
|
|
402
|
+
onBlur,
|
|
403
|
+
testID,
|
|
404
|
+
ref,
|
|
353
405
|
}: ChipProps) {
|
|
354
406
|
const { t } = useTranslation();
|
|
355
407
|
const { knobProps, control, disabledState, state } = useResolvedKnobs({ component: "Chip" });
|
|
356
|
-
const colors =
|
|
408
|
+
const colors = chipSwatch(color);
|
|
357
409
|
const tone = chipTone(variant);
|
|
358
410
|
const resolvedSize = size ?? (knobProps.sizeToken as ChipSize);
|
|
359
411
|
if (typeof document !== "undefined") ensureCompositeFocusRing();
|
|
@@ -428,6 +480,7 @@ export function Chip({
|
|
|
428
480
|
};
|
|
429
481
|
|
|
430
482
|
const handleKeyDown = (e: KeyboardEvent) => {
|
|
483
|
+
onKeyDown?.(e);
|
|
431
484
|
if (e.defaultPrevented || e.repeat) return;
|
|
432
485
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
433
486
|
e.preventDefault();
|
|
@@ -436,6 +489,8 @@ export function Chip({
|
|
|
436
489
|
|
|
437
490
|
return (
|
|
438
491
|
<ChipFrame
|
|
492
|
+
ref={ref as never}
|
|
493
|
+
testID={testID}
|
|
439
494
|
aria-label={ariaLabel}
|
|
440
495
|
size={resolvedSize}
|
|
441
496
|
{...chipFrameGeometry(resolvedSize)}
|
|
@@ -459,9 +514,13 @@ export function Chip({
|
|
|
459
514
|
data-selected={isSelected ? "true" : undefined}
|
|
460
515
|
{...(interactive
|
|
461
516
|
? {
|
|
462
|
-
role
|
|
463
|
-
tabIndex: 0,
|
|
464
|
-
...(
|
|
517
|
+
role,
|
|
518
|
+
tabIndex: tabIndex ?? 0,
|
|
519
|
+
...(role === "radio"
|
|
520
|
+
? { "aria-checked": isSelected }
|
|
521
|
+
: selected != null
|
|
522
|
+
? { "aria-pressed": isSelected }
|
|
523
|
+
: undefined),
|
|
465
524
|
...pressSlopOutsetProps(chipBodySlop(knobProps.borderRadius.borderWidth), "vertical"),
|
|
466
525
|
}
|
|
467
526
|
: undefined)}
|
|
@@ -499,7 +558,11 @@ export function Chip({
|
|
|
499
558
|
}
|
|
500
559
|
onPress={interactive ? activate : undefined}
|
|
501
560
|
{...(interactive && isWeb
|
|
502
|
-
? {
|
|
561
|
+
? {
|
|
562
|
+
onKeyDown: handleKeyDown as unknown as () => void,
|
|
563
|
+
...(onFocus ? { onFocus: onFocus as unknown as () => void } : undefined),
|
|
564
|
+
...(onBlur ? { onBlur: onBlur as unknown as () => void } : undefined),
|
|
565
|
+
}
|
|
503
566
|
: undefined)}
|
|
504
567
|
>
|
|
505
568
|
{swatch ? (
|
|
@@ -531,10 +594,26 @@ export function Chip({
|
|
|
531
594
|
>
|
|
532
595
|
{children}
|
|
533
596
|
</ChipText>
|
|
597
|
+
{count != null ? (
|
|
598
|
+
<ChipText
|
|
599
|
+
size={resolvedSize}
|
|
600
|
+
fontSize={chipTextSize(resolvedSize)}
|
|
601
|
+
lineHeight={sizeKeyBelow(resolvedSize) as FontSizeTokens}
|
|
602
|
+
{...knobProps.body}
|
|
603
|
+
fontWeight="400"
|
|
604
|
+
flexShrink={0}
|
|
605
|
+
color={textColor as ColorTokens}
|
|
606
|
+
opacity={0.7}
|
|
607
|
+
data-chip-count=""
|
|
608
|
+
{...(disabled ? disabledState.textKnobProps : undefined)}
|
|
609
|
+
>
|
|
610
|
+
{count}
|
|
611
|
+
</ChipText>
|
|
612
|
+
) : null}
|
|
534
613
|
{showDismiss ? (
|
|
535
614
|
<DismissButton
|
|
536
615
|
role="button"
|
|
537
|
-
aria-label={t("Remove")}
|
|
616
|
+
aria-label={dismissLabel ?? t("Remove")}
|
|
538
617
|
tabIndex={0}
|
|
539
618
|
className="mp-chip-dismiss"
|
|
540
619
|
borderRadius={dismissRadius}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
// Catalog Button (G-15 story honesty / LC-18, UX-P06).
|
|
4
|
-
// DialogContent so it inherits the compact nested-scale step (LC-73);
|
|
5
|
-
// dialog frame itself does not ring (LC-71).
|
|
3
|
+
// Catalog Button (G-15 story honesty / LC-18, UX-P06). The header's close sits
|
|
4
|
+
// inside DialogContent so it inherits the compact nested-scale step (LC-73);
|
|
5
|
+
// the dialog frame itself does not ring (LC-71).
|
|
6
6
|
import { Button } from "@multiplatform.one/forms";
|
|
7
|
-
import {
|
|
7
|
+
import { YStack } from "tamagui";
|
|
8
|
+
import { OverlayHeader } from "./actions/StandardAction";
|
|
8
9
|
import { Dialog } from "./Dialog";
|
|
9
10
|
import { DialogContent, DialogOverlay } from "./surfaces";
|
|
10
11
|
import { Paragraph } from "./Text";
|
|
@@ -26,8 +27,10 @@ function DialogHarness({
|
|
|
26
27
|
<Dialog.Portal>
|
|
27
28
|
<DialogOverlay key="overlay" />
|
|
28
29
|
<DialogContent key="content" maxWidth={480} maxHeight={520}>
|
|
29
|
-
<
|
|
30
|
-
|
|
30
|
+
<OverlayHeader
|
|
31
|
+
title={<Dialog.Title size="$7">Dialog title</Dialog.Title>}
|
|
32
|
+
onClose={() => setOpen(false)}
|
|
33
|
+
/>
|
|
31
34
|
{long ? (
|
|
32
35
|
<YStack gap="$2" maxHeight={280} overflow="scroll">
|
|
33
36
|
{Array.from({ length: 30 }).map((_, i) => (
|
|
@@ -37,11 +40,6 @@ function DialogHarness({
|
|
|
37
40
|
) : (
|
|
38
41
|
<Paragraph>Short dialog body content.</Paragraph>
|
|
39
42
|
)}
|
|
40
|
-
<XStack justifyContent="flex-end">
|
|
41
|
-
<Dialog.Close asChild>
|
|
42
|
-
<Button>Close</Button>
|
|
43
|
-
</Dialog.Close>
|
|
44
|
-
</XStack>
|
|
45
43
|
</DialogContent>
|
|
46
44
|
</Dialog.Portal>
|
|
47
45
|
</Dialog>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-8220, LC-112, LC-262: an avatar trigger is an icon trigger. The account
|
|
3
|
+
* menu opens attached under it with no echo row, the avatar alone or inside
|
|
4
|
+
* the press boxes an app wraps around it.
|
|
5
|
+
*/
|
|
6
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
7
|
+
import { waitFor } from "@testing-library/react";
|
|
8
|
+
import { describe, expect, it } from "vitest";
|
|
9
|
+
import { ListItem, Text, XStack } from "tamagui";
|
|
10
|
+
import { Avatar } from "../Avatar";
|
|
11
|
+
import { DropdownMenu, isIconTrigger } from "./index";
|
|
12
|
+
|
|
13
|
+
const avatarInPressBox = (
|
|
14
|
+
<XStack width={44} height={44}>
|
|
15
|
+
<XStack width={32} height={32} borderRadius={16} overflow="hidden">
|
|
16
|
+
<Avatar size={32} name="Clay Risser" />
|
|
17
|
+
</XStack>
|
|
18
|
+
</XStack>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
describe("DropdownMenu avatar trigger (FZ-8220)", () => {
|
|
22
|
+
it("counts an avatar as an icon trigger, alone or inside single-child press boxes", () => {
|
|
23
|
+
expect(isIconTrigger(<Avatar name="Clay Risser" />)).toBe(true);
|
|
24
|
+
expect(isIconTrigger(avatarInPressBox)).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("still echoes a trigger that carries a label beside its avatar", () => {
|
|
28
|
+
expect(
|
|
29
|
+
isIconTrigger(
|
|
30
|
+
<XStack>
|
|
31
|
+
<Avatar size={32} name="Clay Risser" />
|
|
32
|
+
<Text>Clay Risser</Text>
|
|
33
|
+
</XStack>,
|
|
34
|
+
),
|
|
35
|
+
).toBe(false);
|
|
36
|
+
expect(isIconTrigger(<XStack>{"Account"}</XStack>)).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("opens the account menu with no echo row, its identity row intact", async () => {
|
|
40
|
+
renderWithProviders(
|
|
41
|
+
<DropdownMenu defaultOpen placement="bottom-end">
|
|
42
|
+
<DropdownMenu.Trigger>{avatarInPressBox}</DropdownMenu.Trigger>
|
|
43
|
+
<DropdownMenu.Content aria-label="Account">
|
|
44
|
+
<ListItem
|
|
45
|
+
testID="account-identity"
|
|
46
|
+
backgroundColor="transparent"
|
|
47
|
+
icon={<Avatar size="$4" name="Clay Risser" />}
|
|
48
|
+
title="Clay Risser"
|
|
49
|
+
subTitle="clayrisser@gmail.com"
|
|
50
|
+
/>
|
|
51
|
+
<DropdownMenu.Separator />
|
|
52
|
+
<DropdownMenu.Item>Sign out</DropdownMenu.Item>
|
|
53
|
+
</DropdownMenu.Content>
|
|
54
|
+
</DropdownMenu>,
|
|
55
|
+
);
|
|
56
|
+
await waitFor(() => expect(document.querySelector('[role="menu"]')).toBeTruthy());
|
|
57
|
+
expect(document.querySelector("[data-fp-trigger-row]")).toBeNull();
|
|
58
|
+
const identity = document.querySelector('[data-testid="account-identity"]');
|
|
59
|
+
expect(identity?.textContent).toContain("Clay Risser");
|
|
60
|
+
expect(identity?.textContent).toContain("clayrisser@gmail.com");
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -8,12 +8,17 @@ import {
|
|
|
8
8
|
DownloadSimpleIcon,
|
|
9
9
|
PencilSimpleIcon,
|
|
10
10
|
ShareNetworkIcon,
|
|
11
|
+
SignOutIcon,
|
|
11
12
|
TrashIcon,
|
|
13
|
+
UserIcon,
|
|
12
14
|
} from "@phosphor-icons/react";
|
|
13
15
|
// Catalog Button (G-15 story honesty / LC-18, UX-P06).
|
|
14
16
|
import { Button } from "@multiplatform.one/forms";
|
|
15
17
|
import { XStack, YStack } from "tamagui";
|
|
18
|
+
import { ActionButton } from "../actions/StandardAction";
|
|
16
19
|
import { DropdownMenu, type DropdownMenuEntry } from "./index";
|
|
20
|
+
import { Avatar } from "../Avatar";
|
|
21
|
+
import { ListItem } from "../tamagui";
|
|
17
22
|
import { Text } from "../Text";
|
|
18
23
|
|
|
19
24
|
const meta: Meta<typeof DropdownMenu> = {
|
|
@@ -88,7 +93,7 @@ export const IconsAndShortcuts: Story = {
|
|
|
88
93
|
<YStack minHeight={380} paddingTop="$4" alignItems="center">
|
|
89
94
|
<DropdownMenu {...args}>
|
|
90
95
|
<DropdownMenu.Trigger asChild>
|
|
91
|
-
<
|
|
96
|
+
<ActionButton kind="more" />
|
|
92
97
|
</DropdownMenu.Trigger>
|
|
93
98
|
<DropdownMenu.Content>
|
|
94
99
|
<DropdownMenu.Item icon={<PencilSimpleIcon size={16} />} shortcut="⌘E">
|
|
@@ -250,6 +255,47 @@ export const Controlled: Story = {
|
|
|
250
255
|
},
|
|
251
256
|
};
|
|
252
257
|
|
|
258
|
+
/**
|
|
259
|
+
* FZ-8220: the account menu at phone width (390). The avatar is an icon
|
|
260
|
+
* trigger, so the menu opens attached under it with no echo row (LC-112,
|
|
261
|
+
* LC-262), and on native it opens at least the platform pull-down's width,
|
|
262
|
+
* so the identity row's fill-width text reads in full. Light and dark come
|
|
263
|
+
* from the theme toolbar (web) or the theme picker (Kitchen Sink).
|
|
264
|
+
*/
|
|
265
|
+
export const AccountMenu: Story = {
|
|
266
|
+
args: { defaultOpen: true },
|
|
267
|
+
render: (args) => (
|
|
268
|
+
<YStack width={390} maxWidth="100%" minHeight={360}>
|
|
269
|
+
<XStack
|
|
270
|
+
paddingHorizontal="$3"
|
|
271
|
+
paddingVertical="$2"
|
|
272
|
+
alignItems="center"
|
|
273
|
+
justifyContent="space-between"
|
|
274
|
+
>
|
|
275
|
+
<Text fontWeight="600">Console</Text>
|
|
276
|
+
<DropdownMenu {...args} placement="bottom-end">
|
|
277
|
+
<DropdownMenu.Trigger>
|
|
278
|
+
<XStack padding="$1.5">
|
|
279
|
+
<Avatar size="$3" name="Clay Risser" />
|
|
280
|
+
</XStack>
|
|
281
|
+
</DropdownMenu.Trigger>
|
|
282
|
+
<DropdownMenu.Content aria-label="Account">
|
|
283
|
+
<ListItem
|
|
284
|
+
backgroundColor="transparent"
|
|
285
|
+
icon={<Avatar size="$4" name="Clay Risser" />}
|
|
286
|
+
title="Clay Risser"
|
|
287
|
+
subTitle="clayrisser@gmail.com"
|
|
288
|
+
/>
|
|
289
|
+
<DropdownMenu.Separator />
|
|
290
|
+
<DropdownMenu.Item icon={<UserIcon size={16} />}>Account</DropdownMenu.Item>
|
|
291
|
+
<DropdownMenu.Item icon={<SignOutIcon size={16} />}>Sign out</DropdownMenu.Item>
|
|
292
|
+
</DropdownMenu.Content>
|
|
293
|
+
</DropdownMenu>
|
|
294
|
+
</XStack>
|
|
295
|
+
</YStack>
|
|
296
|
+
),
|
|
297
|
+
};
|
|
298
|
+
|
|
253
299
|
export const CheckedRows: Story = {
|
|
254
300
|
name: "Checked rows",
|
|
255
301
|
args: { defaultOpen: true },
|
|
@@ -253,15 +253,19 @@ const coverContract = {
|
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* A trigger that shows only a glyph: an `icon` and no label children, or a
|
|
256
|
-
* component marked `iconOnly` (PageMenuButton, PageBarButton)
|
|
256
|
+
* component marked `iconOnly` (PageMenuButton, PageBarButton, Avatar), on its
|
|
257
|
+
* own or as the only child of plain wrappers (a press box around an avatar).
|
|
257
258
|
*/
|
|
258
259
|
export function isIconTrigger(trigger: ReactNode): boolean {
|
|
259
260
|
if (!isValidElement(trigger)) return false;
|
|
260
261
|
if ((trigger.type as { iconOnly?: boolean } | null)?.iconOnly) return true;
|
|
261
262
|
const props = trigger.props as { icon?: unknown; children?: ReactNode };
|
|
262
|
-
if (props.icon == null) return false;
|
|
263
263
|
const kids = props.children;
|
|
264
|
-
|
|
264
|
+
if (props.icon != null) {
|
|
265
|
+
return kids == null || kids === false || (Array.isArray(kids) && kids.length === 0);
|
|
266
|
+
}
|
|
267
|
+
const only = Array.isArray(kids) ? (kids.length === 1 ? kids[0] : null) : kids;
|
|
268
|
+
return isIconTrigger(only);
|
|
265
269
|
}
|
|
266
270
|
|
|
267
271
|
function decorateTrigger(
|