@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/layouts/sidebar.tsx
CHANGED
|
@@ -23,7 +23,16 @@ export interface SidebarSection {
|
|
|
23
23
|
* sidebar has a single group, the caption is noise (Axiom 16).
|
|
24
24
|
*/
|
|
25
25
|
title?: string;
|
|
26
|
+
/** Glyph before the caption. */
|
|
27
|
+
icon?: React.ReactNode;
|
|
28
|
+
/** Rows; empty when the section carries `content` instead. */
|
|
26
29
|
items: SidebarItem[];
|
|
30
|
+
/** A body in place of rows (tags, an image, a custom list), inset on the row text edge. */
|
|
31
|
+
content?: React.ReactNode;
|
|
32
|
+
/** Shown when `items` is empty. */
|
|
33
|
+
emptyText?: string;
|
|
34
|
+
/** Trailing control on the caption line (an add button). */
|
|
35
|
+
action?: React.ReactNode;
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
export interface SidebarItem {
|
|
@@ -35,19 +44,35 @@ export interface SidebarItem {
|
|
|
35
44
|
icon?: React.ReactNode;
|
|
36
45
|
/** Secondary text displayed below the label */
|
|
37
46
|
subTitle?: string;
|
|
47
|
+
/** Trailing control on the row (a remove button); it is a sibling press, not the row's. */
|
|
48
|
+
trailing?: React.ReactNode;
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
export interface SidebarProps {
|
|
41
52
|
sections: SidebarSection[];
|
|
42
|
-
width?: number;
|
|
43
|
-
/** Accessible name for the
|
|
53
|
+
width?: number | string;
|
|
54
|
+
/** Accessible name for the landmark. */
|
|
44
55
|
"aria-label"?: string;
|
|
56
|
+
/**
|
|
57
|
+
* `navigation` (default) for a nav rail; `complementary` for a rail that
|
|
58
|
+
* describes the page beside it (a document's image, people and metadata).
|
|
59
|
+
*/
|
|
60
|
+
role?: "navigation" | "complementary";
|
|
61
|
+
/**
|
|
62
|
+
* The end-edge hairline (default on). Off when the rail sits in a pane
|
|
63
|
+
* whose seam already divides it from the page.
|
|
64
|
+
*/
|
|
65
|
+
divider?: boolean;
|
|
66
|
+
testID?: string;
|
|
45
67
|
}
|
|
46
68
|
|
|
47
69
|
export function Sidebar({
|
|
48
70
|
sections,
|
|
49
71
|
width = 250,
|
|
50
72
|
"aria-label": ariaLabel = "Sidebar",
|
|
73
|
+
role = "navigation",
|
|
74
|
+
divider = true,
|
|
75
|
+
testID,
|
|
51
76
|
}: SidebarProps) {
|
|
52
77
|
const { knobProps } = useResolvedKnobs();
|
|
53
78
|
const headingId = useId();
|
|
@@ -63,9 +88,9 @@ export function Sidebar({
|
|
|
63
88
|
|
|
64
89
|
return (
|
|
65
90
|
<YStack
|
|
66
|
-
role=
|
|
91
|
+
role={role}
|
|
67
92
|
aria-label={ariaLabel}
|
|
68
|
-
width={width}
|
|
93
|
+
width={width as number}
|
|
69
94
|
flex={1}
|
|
70
95
|
alignSelf="stretch"
|
|
71
96
|
height="100%"
|
|
@@ -75,13 +100,16 @@ export function Sidebar({
|
|
|
75
100
|
{...knobProps.surface}
|
|
76
101
|
borderWidth={0}
|
|
77
102
|
borderColor="$borderColor"
|
|
78
|
-
{...(
|
|
79
|
-
?
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
{...(!divider
|
|
104
|
+
? undefined
|
|
105
|
+
: isWeb
|
|
106
|
+
? {
|
|
107
|
+
borderInlineEndWidth: hairlineWidth,
|
|
108
|
+
borderInlineEndStyle: "solid" as any,
|
|
109
|
+
className: "mp-hairline-ie",
|
|
110
|
+
}
|
|
111
|
+
: { borderEndWidth: hairlineWidth })}
|
|
112
|
+
testID={testID}
|
|
85
113
|
>
|
|
86
114
|
<ScrollView flex={1}>
|
|
87
115
|
<YStack {...knobProps.panelPadding} paddingHorizontal={0} {...knobProps.gapLg}>
|
|
@@ -95,34 +123,52 @@ export function Sidebar({
|
|
|
95
123
|
{...knobProps.gap}
|
|
96
124
|
width="100%"
|
|
97
125
|
>
|
|
98
|
-
{section.title ? (
|
|
126
|
+
{section.title || section.action ? (
|
|
99
127
|
// Align with row text (LC-02): the inset rides on this slot's
|
|
100
128
|
// padding so the caption's box starts at the shared row text
|
|
101
129
|
// edge — padding on the Label itself left the box at the panel
|
|
102
130
|
// edge, which is the exact anti-pattern the rule's origin fixed.
|
|
131
|
+
<XStack paddingHorizontal={rowPad} alignItems="center" {...knobProps.gap}>
|
|
132
|
+
<XStack alignItems="center" {...knobProps.gapSm} flex={1} minWidth={0}>
|
|
133
|
+
{section.icon}
|
|
134
|
+
<Label
|
|
135
|
+
id={titleId}
|
|
136
|
+
size={knobProps.sizeToken}
|
|
137
|
+
{...knobProps.body}
|
|
138
|
+
fontSize="$2"
|
|
139
|
+
fontWeight="400"
|
|
140
|
+
textTransform="uppercase"
|
|
141
|
+
color={knobProps.textAccentColor}
|
|
142
|
+
// Drop the size-derived control height — a section
|
|
143
|
+
// caption should not consume a 44px row.
|
|
144
|
+
paddingHorizontal={0}
|
|
145
|
+
height="auto"
|
|
146
|
+
lineHeight="$1"
|
|
147
|
+
>
|
|
148
|
+
{section.title}
|
|
149
|
+
</Label>
|
|
150
|
+
</XStack>
|
|
151
|
+
{section.action}
|
|
152
|
+
</XStack>
|
|
153
|
+
) : null}
|
|
154
|
+
|
|
155
|
+
{section.content != null ? (
|
|
156
|
+
<YStack paddingHorizontal={rowPad} {...knobProps.gap}>
|
|
157
|
+
{section.content}
|
|
158
|
+
</YStack>
|
|
159
|
+
) : null}
|
|
160
|
+
|
|
161
|
+
{section.items.length === 0 && section.emptyText ? (
|
|
103
162
|
<YStack paddingHorizontal={rowPad}>
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
{...knobProps.body}
|
|
108
|
-
fontSize="$2"
|
|
109
|
-
fontWeight="400"
|
|
110
|
-
textTransform="uppercase"
|
|
111
|
-
color={knobProps.textAccentColor}
|
|
112
|
-
// Drop the size-derived control height — a section
|
|
113
|
-
// caption should not consume a 44px row.
|
|
114
|
-
paddingHorizontal={0}
|
|
115
|
-
height="auto"
|
|
116
|
-
lineHeight="$1"
|
|
117
|
-
>
|
|
118
|
-
{section.title}
|
|
119
|
-
</Label>
|
|
163
|
+
<Text color={knobProps.textAccentColor} {...knobProps.label}>
|
|
164
|
+
{section.emptyText}
|
|
165
|
+
</Text>
|
|
120
166
|
</YStack>
|
|
121
167
|
) : null}
|
|
122
168
|
|
|
123
169
|
<YStack width="100%">
|
|
124
|
-
{section.items.map((item, itemIdx) => {
|
|
125
|
-
const position = getGroupPosition(itemIdx,
|
|
170
|
+
{section.items.map((item, itemIdx, items) => {
|
|
171
|
+
const position = getGroupPosition(itemIdx, items.length);
|
|
126
172
|
const corners = stackRadiusProps(position, knobProps.borderRadius.borderRadius);
|
|
127
173
|
const itemKey = `${sectionIdx}:${String(item.value ?? item.label)}`;
|
|
128
174
|
const ink = item.active
|
|
@@ -142,7 +188,9 @@ export function Sidebar({
|
|
|
142
188
|
return (
|
|
143
189
|
<Fragment key={itemKey}>
|
|
144
190
|
{itemIdx > 0 ? (
|
|
145
|
-
<
|
|
191
|
+
<YStack alignSelf="stretch" paddingStart={rowPad}>
|
|
192
|
+
<Separator alignSelf="stretch" {...hairline.line} />
|
|
193
|
+
</YStack>
|
|
146
194
|
) : null}
|
|
147
195
|
<XStack
|
|
148
196
|
data-group-position={position}
|
|
@@ -238,6 +286,11 @@ export function Sidebar({
|
|
|
238
286
|
({item.count})
|
|
239
287
|
</Text>
|
|
240
288
|
) : null}
|
|
289
|
+
{item.trailing != null ? (
|
|
290
|
+
<XStack flexShrink={0} alignItems="center">
|
|
291
|
+
{item.trailing}
|
|
292
|
+
</XStack>
|
|
293
|
+
) : null}
|
|
241
294
|
</XStack>
|
|
242
295
|
</Fragment>
|
|
243
296
|
);
|
package/src/layouts/toolbar.tsx
CHANGED
|
@@ -43,6 +43,15 @@ export interface ToolbarProps {
|
|
|
43
43
|
loadingLabel?: string;
|
|
44
44
|
/** Control size of every action. Default `$3`, one key below the page. */
|
|
45
45
|
size?: SizeTokens;
|
|
46
|
+
/**
|
|
47
|
+
* Controls that are not plain actions (a menu trigger, a popover, a filter
|
|
48
|
+
* chip) after the primary actions, in the scrolling start slot.
|
|
49
|
+
*/
|
|
50
|
+
start?: React.ReactNode;
|
|
51
|
+
/** Controls that are not plain actions, pinned at the end before the secondary actions. */
|
|
52
|
+
end?: React.ReactNode;
|
|
53
|
+
/** Accessible name for the toolbar (default "Toolbar"). */
|
|
54
|
+
"aria-label"?: string;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
type ActionCluster =
|
|
@@ -97,6 +106,9 @@ function ToolbarInner({
|
|
|
97
106
|
secondaryActions = [],
|
|
98
107
|
position = "top",
|
|
99
108
|
loadingLabel: loadingLabelProp,
|
|
109
|
+
start,
|
|
110
|
+
end,
|
|
111
|
+
"aria-label": ariaLabel,
|
|
100
112
|
}: ToolbarProps) {
|
|
101
113
|
const { t } = useTranslation();
|
|
102
114
|
const loadingLabel = loadingLabelProp ?? t("Loading...");
|
|
@@ -179,7 +191,7 @@ function ToolbarInner({
|
|
|
179
191
|
|
|
180
192
|
const { neutral: secondaryNeutral, destructive: secondaryDestructive } =
|
|
181
193
|
partitionByDestructive(secondaryActions);
|
|
182
|
-
const hasTrailing = secondaryNeutral.length > 0 || secondaryDestructive.length > 0;
|
|
194
|
+
const hasTrailing = end != null || secondaryNeutral.length > 0 || secondaryDestructive.length > 0;
|
|
183
195
|
|
|
184
196
|
// Two bar children only (start cluster + trailing cluster). The separator
|
|
185
197
|
// lives INSIDE the trailing cluster between neutral and destructive so it
|
|
@@ -189,7 +201,7 @@ function ToolbarInner({
|
|
|
189
201
|
return (
|
|
190
202
|
<XStack
|
|
191
203
|
role="toolbar"
|
|
192
|
-
aria-label={t("Toolbar")}
|
|
204
|
+
aria-label={ariaLabel ?? t("Toolbar")}
|
|
193
205
|
// LC-39 EARNED-INSET (Axiom 16 ALIGNMENT): the bar paints no
|
|
194
206
|
// distinguishable surface — SF-TRANSPARENT, so it earns no horizontal
|
|
195
207
|
// inset. Spread the panelPadding recipe whole, then eject the
|
|
@@ -233,6 +245,7 @@ function ToolbarInner({
|
|
|
233
245
|
data-toolbar-slot="start"
|
|
234
246
|
>
|
|
235
247
|
{renderClusters(primaryActions, "primary")}
|
|
248
|
+
{start}
|
|
236
249
|
</XStack>
|
|
237
250
|
</ScrollView>
|
|
238
251
|
|
|
@@ -245,6 +258,7 @@ function ToolbarInner({
|
|
|
245
258
|
justifyContent="flex-end"
|
|
246
259
|
data-toolbar-slot="end"
|
|
247
260
|
>
|
|
261
|
+
{end}
|
|
248
262
|
{renderClusters(secondaryNeutral, "secondary")}
|
|
249
263
|
{secondaryNeutral.length > 0 && secondaryDestructive.length > 0 && (
|
|
250
264
|
<Separator
|
|
@@ -30,7 +30,6 @@ afterEach(cleanup);
|
|
|
30
30
|
// the fragment reaches the frame and still never reaches the pixel.
|
|
31
31
|
|
|
32
32
|
const dialogStopPaint = "0px 13px 26px var(--shadowColor)";
|
|
33
|
-
const dialogStopPaintDark = dialogStopPaint;
|
|
34
33
|
const overlayMediumPaint = "0px 12px 24px var(--shadowColor)";
|
|
35
34
|
const overlaySmallPaint = "0px 11px 22px var(--shadowColor)";
|
|
36
35
|
const controlLargePaint = "0px 11px 22px var(--shadowColor)";
|
|
@@ -117,7 +116,7 @@ describe("overlay elevation is a different distance off the surface (MPO-49, MPO
|
|
|
117
116
|
expect(paintedShadow("alertdialog")).toBe(paintedShadow("dialog"));
|
|
118
117
|
});
|
|
119
118
|
|
|
120
|
-
it("dark
|
|
119
|
+
it("dark drops the black shadow and lifts the fill to surface2 (LC-85, FZ-8116)", () => {
|
|
121
120
|
renderWithProviders(
|
|
122
121
|
<Theme name="dark">
|
|
123
122
|
<Preset overrides={{ elevation: "large" }}>
|
|
@@ -129,8 +128,8 @@ describe("overlay elevation is a different distance off the surface (MPO-49, MPO
|
|
|
129
128
|
</Preset>
|
|
130
129
|
</Theme>,
|
|
131
130
|
);
|
|
132
|
-
expect(paintedShadow("dialog")).toBe(
|
|
133
|
-
expect(
|
|
131
|
+
expect(paintedShadow("dialog") || "").toBe("");
|
|
132
|
+
expect(shadowAtoms("dialog")).toEqual([]);
|
|
134
133
|
expect(bgAtoms("dialog")).toEqual(["_bg-color4"]);
|
|
135
134
|
expect(frame("dialog").className).toMatch(/\b_btc-transparent\b/);
|
|
136
135
|
expect(frame("dialog").className).not.toMatch(/\b_btc-color\d+\b/);
|
package/src/surfaces.spec.tsx
CHANGED
|
@@ -305,6 +305,66 @@ describe("overlay containers take the Axiom 1 child-clip cap (MPO-150)", () => {
|
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
|
|
308
|
+
// FZ-8020 (Clay, Filter dialog dark at 390pt: "the left right padding seems
|
|
309
|
+
// to almost be none or most importantly isn't consistent with the rest of the
|
|
310
|
+
// app"). FilterManager asked minWidth 400 on a 390pt window, so the frame
|
|
311
|
+
// overflowed and clipped its own inset. A dialog keeps the sheet's inset and
|
|
312
|
+
// fits the window less one inset each side.
|
|
313
|
+
describe("DialogContent keeps the sheet's content inset on a phone (FZ-8020)", () => {
|
|
314
|
+
const sides = ["paddingLeft", "paddingRight"] as const;
|
|
315
|
+
let savedWidth = 0;
|
|
316
|
+
// tamagui's useWindowDimensions measures the root element's clientWidth,
|
|
317
|
+
// which jsdom leaves at 0, so the phone width goes there as well.
|
|
318
|
+
beforeEach(() => {
|
|
319
|
+
savedWidth = window.innerWidth;
|
|
320
|
+
Object.defineProperty(window, "innerWidth", { configurable: true, value: 390 });
|
|
321
|
+
Object.defineProperty(document.documentElement, "clientWidth", {
|
|
322
|
+
configurable: true,
|
|
323
|
+
value: 390,
|
|
324
|
+
});
|
|
325
|
+
window.dispatchEvent(new Event("resize"));
|
|
326
|
+
});
|
|
327
|
+
afterEach(() => {
|
|
328
|
+
cleanup();
|
|
329
|
+
Object.defineProperty(window, "innerWidth", { configurable: true, value: savedWidth });
|
|
330
|
+
delete (document.documentElement as { clientWidth?: number }).clientWidth;
|
|
331
|
+
window.dispatchEvent(new Event("resize"));
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it("pads its content by the same inset as the sheet, and never wider than the window allows", () => {
|
|
335
|
+
render(
|
|
336
|
+
<TamaguiProvider config={overlayCapConfig} defaultTheme="light">
|
|
337
|
+
<Preset>
|
|
338
|
+
<Dialog modal open>
|
|
339
|
+
<Dialog.Portal>
|
|
340
|
+
<DialogContent testID="inset-dialog" minWidth={400}>
|
|
341
|
+
dialog
|
|
342
|
+
</DialogContent>
|
|
343
|
+
</Dialog.Portal>
|
|
344
|
+
</Dialog>
|
|
345
|
+
<Sheet open>
|
|
346
|
+
<SheetFrame testID="inset-sheet">sheet</SheetFrame>
|
|
347
|
+
</Sheet>
|
|
348
|
+
</Preset>
|
|
349
|
+
</TamaguiProvider>,
|
|
350
|
+
);
|
|
351
|
+
const dialog = getComputedStyle(
|
|
352
|
+
document.querySelector('[data-testid="inset-dialog"]') as Element,
|
|
353
|
+
);
|
|
354
|
+
const sheet = getComputedStyle(
|
|
355
|
+
document.querySelector('[data-testid="inset-sheet"]') as Element,
|
|
356
|
+
);
|
|
357
|
+
const inset = themePackage.panelPaddingPx();
|
|
358
|
+
for (const side of sides) {
|
|
359
|
+
expect(sheet[side], `sheet ${side}`).toBe(`${inset}px`);
|
|
360
|
+
expect(dialog[side], `dialog ${side} matches the sheet`).toBe(sheet[side]);
|
|
361
|
+
}
|
|
362
|
+
const room = 390 - 2 * inset;
|
|
363
|
+
expect(parseFloat(dialog.minWidth), "minWidth fits the window").toBeLessThanOrEqual(room);
|
|
364
|
+
expect(parseFloat(dialog.maxWidth), "maxWidth fits the window").toBeLessThanOrEqual(room);
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
|
|
308
368
|
// MPO-452: tamagui's FocusScope checks "focus already inside?" before an idle
|
|
309
369
|
// wait of up to 200 ms, then focuses the first tabbable that does not hold
|
|
310
370
|
// focus. A click into the name field during that wait had focus moved on to
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-264 PHOTOS-GRID: `variant="photos"` is the iOS Photos library grid,
|
|
3
|
+
* square tiles edge to edge with a 2pt gutter, no tile radius, and three
|
|
4
|
+
* columns on a phone. jsdom cannot cascade Tamagui's atomic CSS; these read
|
|
5
|
+
* the atoms and the grid's ARIA geometry.
|
|
6
|
+
*/
|
|
7
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
8
|
+
import { cleanup } from "@testing-library/react";
|
|
9
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
10
|
+
import { ImageGrid, PHOTOS_GRID_GUTTER } from "./ImageGrid";
|
|
11
|
+
|
|
12
|
+
const initialWidth = window.innerWidth;
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
cleanup();
|
|
15
|
+
window.innerWidth = initialWidth;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const items = Array.from({ length: 7 }, (_, i) => ({ id: String(i), title: `Photo ${i}` }));
|
|
19
|
+
|
|
20
|
+
describe("ImageGrid photos variant (LC-264)", () => {
|
|
21
|
+
it("lays three square-cornered columns on a phone with a 2pt gutter", () => {
|
|
22
|
+
window.innerWidth = 390;
|
|
23
|
+
const { container } = renderWithProviders(
|
|
24
|
+
<ImageGrid variant="photos" items={items} renderItem={(item) => <div>{item.title}</div>} />,
|
|
25
|
+
);
|
|
26
|
+
expect(PHOTOS_GRID_GUTTER).toBe(2);
|
|
27
|
+
const grid = container.querySelector('[role="grid"]');
|
|
28
|
+
expect(grid?.getAttribute("aria-colcount")).toBe("3");
|
|
29
|
+
const rows = container.querySelector("[data-image-grid-variant='photos']");
|
|
30
|
+
expect(String((rows as HTMLElement | null)?.className)).toMatch(/_(gap|rg)-2px/);
|
|
31
|
+
const cells = container.querySelectorAll('[role="gridcell"]');
|
|
32
|
+
expect(cells.length).toBe(items.length);
|
|
33
|
+
for (const cell of cells) {
|
|
34
|
+
expect(String((cell as HTMLElement).className)).toMatch(/_(btlr|br)-0px/);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("keeps the theme-gapped card grid by default", () => {
|
|
39
|
+
window.innerWidth = 390;
|
|
40
|
+
const { container } = renderWithProviders(
|
|
41
|
+
<ImageGrid items={items} renderItem={(item) => <div>{item.title}</div>} />,
|
|
42
|
+
);
|
|
43
|
+
expect(container.querySelector('[role="grid"]')?.getAttribute("aria-colcount")).toBe("2");
|
|
44
|
+
expect(container.querySelector("[data-image-grid-variant='cards']")).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
});
|
package/src/views/ImageGrid.tsx
CHANGED
|
@@ -114,6 +114,53 @@ export interface ImageGridProps<T> extends Omit<YStackProps, "children"> {
|
|
|
114
114
|
* pages through the whole grid.
|
|
115
115
|
*/
|
|
116
116
|
lightbox?: (item: T) => LightboxItem;
|
|
117
|
+
/**
|
|
118
|
+
* `"photos"` is the iOS Photos library grid (LC-264): square tiles edge to
|
|
119
|
+
* edge, `PHOTOS_GRID_GUTTER` between them, no tile radius, and denser
|
|
120
|
+
* columns. The default `"cards"` spaces tiles at the theme gap.
|
|
121
|
+
*/
|
|
122
|
+
variant?: ImageGridVariant;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type ImageGridVariant = "cards" | "photos";
|
|
126
|
+
|
|
127
|
+
/** The hairline gutter between Photos tiles (LC-264), the iOS library's 2pt. */
|
|
128
|
+
export const PHOTOS_GRID_GUTTER = 2;
|
|
129
|
+
|
|
130
|
+
const columnsBySizeClass: Record<ImageGridVariant, Record<LayoutSizeClass, number>> = {
|
|
131
|
+
cards: { compact: 2, medium: 3, expanded: 4, large: 5, xl: 5 },
|
|
132
|
+
photos: { compact: 3, medium: 4, expanded: 5, large: 6, xl: 7 },
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The grid's live column count and gutter, so a neighbour (a shuffle panel
|
|
137
|
+
* above a card grid) can size one track exactly like a tile. Explicit
|
|
138
|
+
* `columns` wins, then a `tileSize` rung, then the size class.
|
|
139
|
+
*/
|
|
140
|
+
export function useImageGridGeometry({
|
|
141
|
+
columns,
|
|
142
|
+
tileSize,
|
|
143
|
+
variant = "cards",
|
|
144
|
+
}: Pick<ImageGridProps<unknown>, "columns" | "tileSize" | "variant"> = {}): {
|
|
145
|
+
columns: number;
|
|
146
|
+
gutter: number;
|
|
147
|
+
} {
|
|
148
|
+
const { knobProps } = useResolvedKnobs({ component: "ImageGrid" });
|
|
149
|
+
const { width: windowWidth } = useWindowDimensions();
|
|
150
|
+
const gapToken = knobProps.gap.gap;
|
|
151
|
+
const themeGutter =
|
|
152
|
+
typeof gapToken === "number"
|
|
153
|
+
? gapToken
|
|
154
|
+
: ((getTokenValue(gapToken as Parameters<typeof getTokenValue>[0], "space") as number) ?? 16);
|
|
155
|
+
const gutter = variant === "photos" ? PHOTOS_GRID_GUTTER : themeGutter;
|
|
156
|
+
return {
|
|
157
|
+
gutter,
|
|
158
|
+
columns:
|
|
159
|
+
columns ??
|
|
160
|
+
(tileSize
|
|
161
|
+
? tileColumnsForWidth(windowWidth, tileSizeLadder[tileSize], gutter)
|
|
162
|
+
: columnsBySizeClass[variant][getLayoutSizeClass(windowWidth)]),
|
|
163
|
+
};
|
|
117
164
|
}
|
|
118
165
|
|
|
119
166
|
const tileTrack = { flexGrow: 1, flexShrink: 1, flexBasis: 0, minWidth: 0 } as const;
|
|
@@ -273,6 +320,7 @@ export function ImageGrid<T>({
|
|
|
273
320
|
height: heightProp,
|
|
274
321
|
emptyMessage: emptyMessageProp,
|
|
275
322
|
hotkeys: hotkeyOverrides,
|
|
323
|
+
variant = "cards",
|
|
276
324
|
lightbox,
|
|
277
325
|
...stackProps
|
|
278
326
|
}: ImageGridProps<T>) {
|
|
@@ -300,31 +348,7 @@ export function ImageGrid<T>({
|
|
|
300
348
|
// topped up with empty tracks so its tiles keep the full-row width.
|
|
301
349
|
// Never a negative half-gutter margin — that widened scrollWidth past
|
|
302
350
|
// the viewport at 390 (FB-390-grid-overflow-x).
|
|
303
|
-
const
|
|
304
|
-
const gutter =
|
|
305
|
-
typeof gapToken === "number"
|
|
306
|
-
? gapToken
|
|
307
|
-
: ((getTokenValue(gapToken as Parameters<typeof getTokenValue>[0], "space") as number) ?? 16);
|
|
308
|
-
|
|
309
|
-
// Responsive default: a fixed count that looks right on desktop renders
|
|
310
|
-
// skinny slivers on a phone. Explicit `columns` always wins; a `tileSize`
|
|
311
|
-
// rung derives the count from the theme's generated ladder (MPO-31) at the
|
|
312
|
-
// live gutter. Otherwise column count is a structural layout decision, so
|
|
313
|
-
// it consumes the canonical layout size classes (LC-28 / DG-LAY-01)
|
|
314
|
-
// instead of a raw pixel ladder.
|
|
315
|
-
const { width: windowWidth } = useWindowDimensions();
|
|
316
|
-
const columnsBySizeClass: Record<LayoutSizeClass, number> = {
|
|
317
|
-
compact: 2,
|
|
318
|
-
medium: 3,
|
|
319
|
-
expanded: 4,
|
|
320
|
-
large: 5,
|
|
321
|
-
xl: 5,
|
|
322
|
-
};
|
|
323
|
-
const columns =
|
|
324
|
-
columnsProp ??
|
|
325
|
-
(tileSize
|
|
326
|
-
? tileColumnsForWidth(windowWidth, tileSizeLadder[tileSize], gutter)
|
|
327
|
-
: columnsBySizeClass[getLayoutSizeClass(windowWidth)]);
|
|
351
|
+
const { columns, gutter } = useImageGridGeometry({ columns: columnsProp, tileSize, variant });
|
|
328
352
|
const height = heightProp;
|
|
329
353
|
const gridId = useId();
|
|
330
354
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
@@ -431,13 +455,14 @@ export function ImageGrid<T>({
|
|
|
431
455
|
// media-19 UNCLAMPED: spread the scale radius fragment, never
|
|
432
456
|
// `containerRadius` / `cardSurface` (R11). Tile has no padding for
|
|
433
457
|
// CONTAINER-CAP to bite on.
|
|
434
|
-
const radiusFragment = knobProps.borderRadius;
|
|
458
|
+
const radiusFragment = variant === "photos" ? { borderRadius: 0 } : knobProps.borderRadius;
|
|
435
459
|
|
|
436
460
|
const gridBody =
|
|
437
461
|
items.length === 0 ? null : (
|
|
438
462
|
<View
|
|
439
463
|
ref={containerRef as any}
|
|
440
464
|
role="grid"
|
|
465
|
+
width="100%"
|
|
441
466
|
aria-label={t("Image grid")}
|
|
442
467
|
aria-colcount={columns}
|
|
443
468
|
aria-rowcount={rowCount}
|
|
@@ -464,7 +489,7 @@ export function ImageGrid<T>({
|
|
|
464
489
|
}
|
|
465
490
|
: null)}
|
|
466
491
|
>
|
|
467
|
-
<YStack gap={gutter} maxWidth="100%">
|
|
492
|
+
<YStack gap={gutter} width="100%" maxWidth="100%" data-image-grid-variant={variant}>
|
|
468
493
|
{Array.from({ length: rowCount }, (_, row) => {
|
|
469
494
|
const start = row * columns;
|
|
470
495
|
const rowItems = items.slice(start, start + columns);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { cleanup } from "@testing-library/react";
|
|
2
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
3
|
+
import { isWeb } from "tamagui";
|
|
4
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
+
import { ListGroup, ListGroupItem, ListRow } from "./List";
|
|
6
|
+
|
|
7
|
+
afterEach(cleanup);
|
|
8
|
+
|
|
9
|
+
const insetStyles = [
|
|
10
|
+
"paddingLeft",
|
|
11
|
+
"paddingRight",
|
|
12
|
+
"paddingInlineStart",
|
|
13
|
+
"paddingInlineEnd",
|
|
14
|
+
"marginLeft",
|
|
15
|
+
"marginRight",
|
|
16
|
+
"marginInlineStart",
|
|
17
|
+
"marginInlineEnd",
|
|
18
|
+
"left",
|
|
19
|
+
"right",
|
|
20
|
+
"width",
|
|
21
|
+
"maxWidth",
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
function inset(el: HTMLElement): Record<string, string> {
|
|
25
|
+
const found: Record<string, string> = {};
|
|
26
|
+
for (const key of insetStyles) {
|
|
27
|
+
const value = el.style[key as keyof CSSStyleDeclaration];
|
|
28
|
+
if (typeof value === "string" && value !== "" && value !== "0px" && value !== "0")
|
|
29
|
+
found[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return found;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
describe("ListGroup hairlines under tamagui's NATIVE build", () => {
|
|
35
|
+
it("runs tamagui's native build", () => {
|
|
36
|
+
expect(isWeb).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("run the group's full width past a leading icon: no inset wrapper, spacer, padding, margin or width (rv_c512b641aaa877af)", () => {
|
|
40
|
+
const { container } = renderWithProviders(
|
|
41
|
+
<ListGroup>
|
|
42
|
+
<ListGroupItem>
|
|
43
|
+
<ListRow icon={<span />} title="Wi-Fi" />
|
|
44
|
+
</ListGroupItem>
|
|
45
|
+
<ListGroupItem>
|
|
46
|
+
<ListRow icon={<span />} title="Notifications" subtitle="Banners, sounds" />
|
|
47
|
+
</ListGroupItem>
|
|
48
|
+
<ListGroupItem>
|
|
49
|
+
<ListRow icon={<span />} title="Focus" meta="Off" />
|
|
50
|
+
</ListGroupItem>
|
|
51
|
+
</ListGroup>,
|
|
52
|
+
);
|
|
53
|
+
const lines = Array.from(
|
|
54
|
+
container.querySelectorAll<HTMLElement>('[data-testid="list-hairline"]'),
|
|
55
|
+
);
|
|
56
|
+
expect(lines).toHaveLength(2);
|
|
57
|
+
for (const line of lines) {
|
|
58
|
+
const item = line.parentElement!;
|
|
59
|
+
expect(item.children).toHaveLength(2);
|
|
60
|
+
expect(item.firstElementChild).toBe(line);
|
|
61
|
+
expect(line.children).toHaveLength(0);
|
|
62
|
+
expect(inset(line)).toEqual({});
|
|
63
|
+
expect(inset(item)).toEqual({});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -12,6 +12,22 @@ function rows(container: HTMLElement): HTMLElement[] {
|
|
|
12
12
|
return Array.from(container.querySelectorAll<HTMLElement>("[data-list-row]"));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
function hairlines(container: HTMLElement): HTMLElement[] {
|
|
16
|
+
return Array.from(container.querySelectorAll<HTMLElement>("[data-list-hairline]"));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const horizontalInset = /(^|\s)_(pl|pr|ps|pe|ml|mr|ms|me|w)-/;
|
|
20
|
+
|
|
21
|
+
// jsdom has no layout: left = group left and right = group right is read from structure.
|
|
22
|
+
function expectFullWidth(line: HTMLElement) {
|
|
23
|
+
const item = line.parentElement!;
|
|
24
|
+
expect(item.getAttribute("role")).toBe("listitem");
|
|
25
|
+
expect(line.children).toHaveLength(0);
|
|
26
|
+
expect(String(line.className)).not.toMatch(horizontalInset);
|
|
27
|
+
expect(String(item.className)).not.toMatch(horizontalInset);
|
|
28
|
+
expect(line.style.paddingLeft + line.style.marginLeft + line.style.width).toBe("");
|
|
29
|
+
}
|
|
30
|
+
|
|
15
31
|
describe("ListGroup (LC-175 MPO-ONLY-REUSE: the inset-grouped list apps used to build)", () => {
|
|
16
32
|
it("ships from the views barrel", () => {
|
|
17
33
|
expect(ViewExports).toHaveProperty("ListGroup");
|
|
@@ -58,25 +74,26 @@ describe("ListGroup (LC-175 MPO-ONLY-REUSE: the inset-grouped list apps used to
|
|
|
58
74
|
expect(rows(container)).toHaveLength(2);
|
|
59
75
|
});
|
|
60
76
|
|
|
61
|
-
it("
|
|
77
|
+
it("runs each hairline the group's full width, leading edge to trailing edge (rv_c512b641aaa877af)", () => {
|
|
62
78
|
const { container } = renderWithProviders(
|
|
63
79
|
<ListGroup>
|
|
64
80
|
<ListGroupItem>
|
|
65
81
|
<ListRow icon={<span />} title="Wi-Fi" />
|
|
66
82
|
</ListGroupItem>
|
|
67
83
|
<ListGroupItem>
|
|
68
|
-
<ListRow
|
|
84
|
+
<ListRow media={<span />} title="Bluetooth" />
|
|
69
85
|
</ListGroupItem>
|
|
70
86
|
<ListGroupItem>
|
|
71
87
|
<ListRow title="About" />
|
|
72
88
|
</ListGroupItem>
|
|
73
89
|
</ListGroup>,
|
|
74
90
|
);
|
|
75
|
-
const lines =
|
|
76
|
-
expect(lines.map((line) => line.getAttribute("data-list-hairline"))).toEqual(["
|
|
91
|
+
const lines = hairlines(container);
|
|
92
|
+
expect(lines.map((line) => line.getAttribute("data-list-hairline"))).toEqual(["full", "full"]);
|
|
93
|
+
for (const line of lines) expectFullWidth(line);
|
|
77
94
|
});
|
|
78
95
|
|
|
79
|
-
it("the inset variant sits on the Card surface; plain paints none", () => {
|
|
96
|
+
it("the inset variant sits on the Card surface, framed and unlifted; plain paints none", () => {
|
|
80
97
|
const { container, unmount } = renderWithProviders(
|
|
81
98
|
<ListGroup>
|
|
82
99
|
<ListGroupItem>
|
|
@@ -84,7 +101,9 @@ describe("ListGroup (LC-175 MPO-ONLY-REUSE: the inset-grouped list apps used to
|
|
|
84
101
|
</ListGroupItem>
|
|
85
102
|
</ListGroup>,
|
|
86
103
|
);
|
|
87
|
-
|
|
104
|
+
const group = container.querySelector<HTMLElement>('[data-tier="content"]');
|
|
105
|
+
expect(group).toBeTruthy();
|
|
106
|
+
expect(group!.style.boxShadow).not.toMatch(/px/);
|
|
88
107
|
unmount();
|
|
89
108
|
const plain = renderWithProviders(
|
|
90
109
|
<ListGroup variant="plain">
|