@multiplatform.one/components 7.66.0 → 7.67.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/Accordion/index.native.js +1 -1
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- 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/AnimateHeight/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/Badge/index.native.js.map +1 -1
- package/dist/cjs/Button.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/CardFooter.native.js.map +1 -1
- package/dist/cjs/CardHeader.native.js.map +1 -1
- package/dist/cjs/Carousel/index.native.js +3 -3
- package/dist/cjs/Carousel/index.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/Collapsible.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/DotIndicator/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/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/cjs/ErrorBoundary/index.native.js.map +1 -1
- package/dist/cjs/Heading.native.js.map +1 -1
- package/dist/cjs/Kbd/index.native.js.map +1 -1
- package/dist/cjs/Kbd/keys.native.js.map +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.native.js +1 -1
- package/dist/cjs/Lightbox/shared.native.js.map +1 -1
- package/dist/cjs/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/cjs/Material/index.native.js.map +1 -1
- package/dist/cjs/Meter/index.native.js +1 -1
- package/dist/cjs/Meter/index.native.js.map +1 -1
- package/dist/cjs/Meter/meter.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.cjs +3 -1
- package/dist/cjs/OverflowRow/index.native.js +4 -2
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.cjs +4 -4
- package/dist/cjs/Pagination.native.js +4 -4
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/ProgressSteps/index.native.js.map +1 -1
- package/dist/cjs/Quote/index.native.js.map +1 -1
- package/dist/cjs/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/cjs/Separator/index.native.js.map +1 -1
- package/dist/cjs/Sheet.native.js.map +1 -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/detents.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +24 -16
- package/dist/cjs/SheetModal/index.native.js +86 -58
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/cjs/Skeleton/index.native.js.map +1 -1
- package/dist/cjs/SkipLink/index.native.js.map +1 -1
- package/dist/cjs/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/cjs/SortableList/index.native.js.map +1 -1
- package/dist/cjs/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/cjs/Tabs/index.native.js +1 -1
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.native.js.map +1 -1
- package/dist/cjs/ThemePresetPicker/index.native.js +2 -2
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/Toast/index.native.js.map +1 -1
- package/dist/cjs/Toast/store.native.js.map +1 -1
- package/dist/cjs/Tooltip/nativePress.native.js.map +1 -1
- package/dist/cjs/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/cjs/TreeSelect/index.native.js +1 -1
- package/dist/cjs/TreeSelect/index.native.js.map +1 -1
- package/dist/cjs/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/cjs/Video/PlayerChrome.native.js.map +1 -1
- package/dist/cjs/Video/VideoFrame.native.js.map +1 -1
- package/dist/cjs/Video/types.native.js.map +1 -1
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/Wizard/index.native.js +2 -2
- package/dist/cjs/Wizard/index.native.js.map +1 -1
- package/dist/cjs/actions/ActionBar.native.js.map +1 -1
- package/dist/cjs/actions/DangerSection.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.native.js.map +1 -1
- package/dist/cjs/actions/HeaderActions.native.js +2 -2
- package/dist/cjs/actions/HeaderActions.native.js.map +1 -1
- package/dist/cjs/actions/devWarn.native.js.map +1 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/actions/severity.native.js.map +1 -1
- package/dist/cjs/appShell/BottomAccessory.native.js.map +1 -1
- package/dist/cjs/appShell/Dock.native.js.map +1 -1
- package/dist/cjs/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/cjs/appShell/Springboard.native.js +1 -1
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabBar.native.js +1 -1
- package/dist/cjs/appShell/TabBar.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/appTile.native.js +1 -1
- package/dist/cjs/appShell/appTile.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- 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/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.native.js +1 -1
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/charts/ChartSurface.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/PieChart.native.js.map +1 -1
- package/dist/cjs/charts/Sparkline.native.js.map +1 -1
- package/dist/cjs/charts/accessibility.native.js.map +1 -1
- package/dist/cjs/charts/chartHeight.native.js.map +1 -1
- package/dist/cjs/charts/composeChart.native.js.map +1 -1
- package/dist/cjs/charts/index.native.js.map +1 -1
- package/dist/cjs/charts/math.native.js.map +1 -1
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/charts/svg.native.js.map +1 -1
- package/dist/cjs/charts/types.native.js.map +1 -1
- package/dist/cjs/charts/useChartTheme.native.js.map +1 -1
- package/dist/cjs/code/Code/index.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.native.js +7 -7
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/cjs/code/Pre/index.native.js.map +1 -1
- package/dist/cjs/code/index.native.js +5 -5
- package/dist/cjs/code/index.native.js.map +1 -1
- package/dist/cjs/componentColors.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/NotifyHost.native.js +2 -2
- package/dist/cjs/feedback/NotifyHost.native.js.map +1 -1
- package/dist/cjs/feedback/copy.native.js.map +1 -1
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/feedback/notify.native.js.map +1 -1
- package/dist/cjs/feedback/route.native.js.map +1 -1
- package/dist/cjs/feedback/store.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/cjs/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/cjs/formLayouts/index.native.js.map +1 -1
- package/dist/cjs/hooks/index.native.js +1 -1
- package/dist/cjs/hooks/index.native.js.map +1 -1
- package/dist/cjs/hooks/useClipboard.native.js.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/cjs/hooks/useHoldCue.native.js.map +1 -1
- package/dist/cjs/icons/CheckRegular.native.js.map +1 -1
- package/dist/cjs/icons/MinusRegular.native.js.map +1 -1
- package/dist/cjs/icons/index.native.js.map +1 -1
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.native.js.map +1 -1
- package/dist/cjs/images/Image/index.native.js +1 -1
- package/dist/cjs/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/cjs/images/Image/shared.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/images/Image/types.native.js.map +1 -1
- package/dist/cjs/images/index.native.js.map +1 -1
- package/dist/cjs/index.native.js +35 -35
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +87 -0
- package/dist/cjs/layouts/AsyncBoundary.native.js +93 -2
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/Debug/index.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/KeyboardAvoidingWrapper/behavior.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/PaneScaffold.native.js.map +1 -1
- package/dist/cjs/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/cjs/layouts/StatusDot.native.js.map +1 -1
- package/dist/cjs/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.native.js +1 -1
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/cjs/layouts/index.native.js +3 -3
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +2 -11
- package/dist/cjs/layouts/page.native.js +8 -17
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/cjs/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.cjs +51 -21
- package/dist/cjs/layouts/sidebar.native.js +54 -24
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.native.js +2 -2
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.native.js +2 -2
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.cjs +9 -6
- package/dist/cjs/layouts/toolbar.native.js +10 -7
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/shared/actionScan.native.js.map +1 -1
- package/dist/cjs/shared/i18n.native.js.map +1 -1
- package/dist/cjs/shared/restoreRetries.native.js.map +1 -1
- package/dist/cjs/shared/t.native.js.map +1 -1
- package/dist/cjs/shared/textRidesText.native.js.map +1 -1
- package/dist/cjs/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/tamagui.native.js +1 -1
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/cjs/testSetup.native.js.map +1 -1
- package/dist/cjs/utils/setTinted.native.js.map +1 -1
- package/dist/cjs/utils/unwrapText.native.js.map +1 -1
- package/dist/cjs/views/Calendar.native.js +1 -1
- package/dist/cjs/views/Calendar.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.native.js +2 -2
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/Gantt.native.js +2 -2
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/GanttDateGrip.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.cjs +55 -14
- package/dist/cjs/views/ImageGrid.native.js +60 -17
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/Kanban.native.js +1 -1
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ListRow.native.js.map +1 -1
- package/dist/cjs/views/Matrix.native.js +2 -2
- package/dist/cjs/views/Matrix.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +2 -2
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -1
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/calendarMath.native.js.map +1 -1
- package/dist/cjs/views/ganttIntervals.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +2 -0
- package/dist/cjs/views/index.native.js +3 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/kanbanDnd.native.js.map +1 -1
- package/dist/cjs/views/matrixMath.native.js.map +1 -1
- package/dist/cjs/views/treeViewDnd.native.js.map +1 -1
- package/dist/cjs/views/treeViewLayout.native.js.map +1 -1
- package/dist/cjs/views/treeViewMotion.native.js.map +1 -1
- package/dist/cjs/views/treeViewReveal.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.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 -4
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +3 -3
- package/dist/esm/Pagination.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 +25 -17
- 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/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/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/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 +2 -11
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +6 -15
- 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/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/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/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/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/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/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/OverflowRow/index.mjs +4 -2
- package/dist/jsx/OverflowRow/index.mjs.map +1 -1
- package/dist/jsx/OverflowRow/index.native.js +3 -1
- package/dist/jsx/OverflowRow/index.native.js.map +1 -1
- package/dist/jsx/Pagination.mjs +4 -4
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +3 -3
- package/dist/jsx/Pagination.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/index.mjs +25 -17
- 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/appShell/TabBar.mjs.map +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/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/layouts/AsyncBoundary.mjs +87 -0
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +91 -0
- package/dist/jsx/layouts/AsyncBoundary.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/page.mjs +2 -11
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +6 -15
- package/dist/jsx/layouts/page.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 +53 -23
- package/dist/jsx/layouts/sidebar.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 +9 -6
- package/dist/jsx/layouts/toolbar.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 +58 -15
- package/dist/jsx/views/ImageGrid.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 +2 -0
- package/dist/jsx/views/index.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/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/Card.spec.tsx +45 -0
- package/src/Card.tsx +57 -18
- package/src/Chip/Chip.spec.tsx +72 -1
- package/src/Chip/index.tsx +86 -7
- package/src/DropdownMenu/DropdownMenu.avatarTrigger.spec.tsx +62 -0
- package/src/DropdownMenu/DropdownMenu.stories.tsx +45 -0
- 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.tsx +10 -6
- 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.tsx +16 -2
- package/src/SheetModal/SheetNavigation.tsx +93 -0
- package/src/SheetModal/index.native.tsx +108 -69
- package/src/SheetModal/index.tsx +33 -20
- package/src/Tabs/Tabs.stories.tsx +2 -2
- package/src/Tooltip/Tooltip.spec.tsx +2 -2
- 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/icons/nativeIconInk.dark.spec.tsx +159 -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/PageTemplates.spec.tsx +28 -1
- package/src/layouts/PageTemplates.tsx +8 -1
- package/src/layouts/Sidebar.spec.tsx +48 -0
- package/src/layouts/layouts.spec.tsx +33 -0
- package/src/layouts/page.tsx +5 -12
- 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/views/ImageGrid.photos.spec.tsx +46 -0
- package/src/views/ImageGrid.tsx +52 -27
- 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/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/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/layouts/AsyncBoundary.d.ts +13 -2
- package/types/layouts/AsyncBoundary.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/index.d.ts +1 -1
- package/types/views/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.67.0",
|
|
4
4
|
"description": "multiplatform.one ui components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@floating-ui/react": "^0.27.20",
|
|
61
|
-
"@multiplatform.one/forms": "^7.
|
|
62
|
-
"@multiplatform.one/i18n": "^7.
|
|
63
|
-
"@multiplatform.one/platform": "^7.
|
|
64
|
-
"@multiplatform.one/router": "^7.
|
|
65
|
-
"@multiplatform.one/theme": "^7.
|
|
61
|
+
"@multiplatform.one/forms": "^7.67.0",
|
|
62
|
+
"@multiplatform.one/i18n": "^7.67.0",
|
|
63
|
+
"@multiplatform.one/platform": "^7.67.0",
|
|
64
|
+
"@multiplatform.one/router": "^7.67.0",
|
|
65
|
+
"@multiplatform.one/theme": "^7.67.0",
|
|
66
66
|
"@phosphor-icons/react": "^2.1.10",
|
|
67
67
|
"@shopify/flash-list": "^2.3.1",
|
|
68
68
|
"@tamagui/colors": "2.7.6",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"tamagui": "2.7.6"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@multiplatform.one/config": "7.
|
|
93
|
-
"@multiplatform.one/storybook": "7.
|
|
94
|
-
"@multiplatform.one/test-utils": "7.
|
|
92
|
+
"@multiplatform.one/config": "7.67.0",
|
|
93
|
+
"@multiplatform.one/storybook": "7.67.0",
|
|
94
|
+
"@multiplatform.one/test-utils": "7.67.0",
|
|
95
95
|
"@tamagui/build": "2.7.6",
|
|
96
96
|
"@testing-library/jest-dom": "^7.0.1",
|
|
97
97
|
"@testing-library/react": "^16.3.3",
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
"react-native": ">=0.83.0",
|
|
127
127
|
"react-native-reanimated": "^4.2.0",
|
|
128
128
|
"react-native-safe-area-context": "*",
|
|
129
|
+
"react-native-screens": "*",
|
|
129
130
|
"react-native-svg": "*",
|
|
130
131
|
"refractor": "^4.9.0",
|
|
131
132
|
"rehype-autolink-headings": "^6.1.1 || ^7.0.0",
|
|
@@ -169,6 +170,9 @@
|
|
|
169
170
|
"react-native-safe-area-context": {
|
|
170
171
|
"optional": true
|
|
171
172
|
},
|
|
173
|
+
"react-native-screens": {
|
|
174
|
+
"optional": true
|
|
175
|
+
},
|
|
172
176
|
"react-native-svg": {
|
|
173
177
|
"optional": true
|
|
174
178
|
},
|
package/src/Alert/Alert.spec.tsx
CHANGED
|
@@ -298,6 +298,28 @@ describe("Alert action labels — weight 400 on the TEXT NODE (R7 / §6.1)", ()
|
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
|
|
301
|
+
describe("Alert action targets size to their labels on web (FZ-8000)", () => {
|
|
302
|
+
afterEach(cleanup);
|
|
303
|
+
|
|
304
|
+
it("keeps each press group out of CSS size containment", () => {
|
|
305
|
+
renderWithProviders(
|
|
306
|
+
<Alert
|
|
307
|
+
intent="error"
|
|
308
|
+
actionLabel="Try again"
|
|
309
|
+
secondaryActionLabel="Ignore"
|
|
310
|
+
onAction={() => {}}
|
|
311
|
+
onSecondaryAction={() => {}}
|
|
312
|
+
>
|
|
313
|
+
Custom labels
|
|
314
|
+
</Alert>,
|
|
315
|
+
);
|
|
316
|
+
for (const label of ["Try again", "Ignore"]) {
|
|
317
|
+
const target = document.querySelector(`[aria-label="${label}"]`) as HTMLElement;
|
|
318
|
+
expect(target.style.containerType).toBe("normal");
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
|
|
301
323
|
describe("Alert spacing roles hold at every size token (LC-100)", () => {
|
|
302
324
|
afterEach(cleanup);
|
|
303
325
|
|
package/src/Alert/index.tsx
CHANGED
|
@@ -258,6 +258,11 @@ function AlertAction({
|
|
|
258
258
|
return (
|
|
259
259
|
<AlertActionTarget
|
|
260
260
|
group={"alertAction" as unknown as undefined}
|
|
261
|
+
// A tamagui group is a CSS size container on web (container-type:
|
|
262
|
+
// inline-size), which drops the label from the target's intrinsic
|
|
263
|
+
// width: the pill collapsed to the 44px floor, "Try again" wrapped and
|
|
264
|
+
// two actions touched (FZ-8000). The group only carries press state.
|
|
265
|
+
{...(isWeb ? { style: { containerType: "normal" } } : {})}
|
|
261
266
|
className="mp-chip-dismiss"
|
|
262
267
|
aria-label={accessibilityLabel ?? label}
|
|
263
268
|
{...pressTargetStyle()}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { cleanup, render } from "@testing-library/react";
|
|
2
|
+
import { createDefaultThemeConfig, normalizeToHex } from "@multiplatform.one/theme";
|
|
3
|
+
import { expect, it } from "vitest";
|
|
4
|
+
import { TamaguiProvider, Theme } from "tamagui";
|
|
5
|
+
import { Avatar } from "./index";
|
|
6
|
+
|
|
7
|
+
// FZ-7889 / LC-08: the initials disc is the theme's accent tint and ink
|
|
8
|
+
// (LC-131), the same for every name, never a fixed hue palette.
|
|
9
|
+
it.each(["light", "dark"] as const)(
|
|
10
|
+
"paints the %s theme's accent tint and ink, the same for every name",
|
|
11
|
+
(scheme) => {
|
|
12
|
+
const config = createDefaultThemeConfig({});
|
|
13
|
+
const themes = config.tamagui.themes as unknown as Record<
|
|
14
|
+
string,
|
|
15
|
+
Record<string, { val: string } | undefined>
|
|
16
|
+
>;
|
|
17
|
+
for (const hue of ["orange", "purple", "blue"]) {
|
|
18
|
+
const token = (key: string) =>
|
|
19
|
+
normalizeToHex(themes[`${scheme}_${hue}`]?.[key]?.val ?? themes[scheme]?.[key]?.val ?? "");
|
|
20
|
+
const paint = (name: string) => {
|
|
21
|
+
const view = render(
|
|
22
|
+
<TamaguiProvider config={config.tamagui} defaultTheme={scheme}>
|
|
23
|
+
<Theme name={hue}>
|
|
24
|
+
<Avatar name={name} />
|
|
25
|
+
</Theme>
|
|
26
|
+
</TamaguiProvider>,
|
|
27
|
+
);
|
|
28
|
+
const face = view.container.querySelector("[data-avatar-px]") as HTMLElement;
|
|
29
|
+
const ink = view.container.querySelector("[data-avatar-initials]") as HTMLElement;
|
|
30
|
+
const result = {
|
|
31
|
+
fill: normalizeToHex(getComputedStyle(face).backgroundColor),
|
|
32
|
+
ink: normalizeToHex(getComputedStyle(ink).color),
|
|
33
|
+
};
|
|
34
|
+
cleanup();
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
const clay = paint("Clay Risser");
|
|
38
|
+
expect(clay).toEqual(paint("Ada Lovelace"));
|
|
39
|
+
expect(clay).toEqual({ fill: token("selectedBackground"), ink: token("selectedColor") });
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// LC-84: the no-name person glyph takes the same ink as the initials, resolved
|
|
45
|
+
// to a concrete paint, since native SVG has no currentColor to inherit.
|
|
46
|
+
it.each(["light", "dark"] as const)("paints the %s fallback glyph in the accent ink", (scheme) => {
|
|
47
|
+
const config = createDefaultThemeConfig({});
|
|
48
|
+
const themes = config.tamagui.themes as unknown as Record<
|
|
49
|
+
string,
|
|
50
|
+
Record<string, { val: string } | undefined>
|
|
51
|
+
>;
|
|
52
|
+
const view = render(
|
|
53
|
+
<TamaguiProvider config={config.tamagui} defaultTheme={scheme}>
|
|
54
|
+
<Theme name="orange">
|
|
55
|
+
<Avatar />
|
|
56
|
+
</Theme>
|
|
57
|
+
</TamaguiProvider>,
|
|
58
|
+
);
|
|
59
|
+
const glyph = view.container.querySelector("[data-avatar-glyph]") as HTMLElement;
|
|
60
|
+
const ink = themes[`${scheme}_orange`]?.selectedColor?.val ?? themes[scheme]?.selectedColor?.val;
|
|
61
|
+
expect(normalizeToHex(glyph.getAttribute("data-avatar-glyph") ?? "")).toBe(
|
|
62
|
+
normalizeToHex(ink ?? ""),
|
|
63
|
+
);
|
|
64
|
+
expect(glyph.querySelector("svg")?.getAttribute("fill")).toBe(
|
|
65
|
+
glyph.getAttribute("data-avatar-glyph"),
|
|
66
|
+
);
|
|
67
|
+
const px = Number(
|
|
68
|
+
view.container.querySelector("[data-avatar-px]")?.getAttribute("data-avatar-px"),
|
|
69
|
+
);
|
|
70
|
+
expect(Number(glyph.querySelector("svg")?.getAttribute("width")) / px).toBeGreaterThanOrEqual(
|
|
71
|
+
0.55,
|
|
72
|
+
);
|
|
73
|
+
cleanup();
|
|
74
|
+
});
|
|
@@ -3,7 +3,7 @@ import { Preset, Surface, useReadableTextOn } from "@multiplatform.one/theme";
|
|
|
3
3
|
import { cleanup, fireEvent } from "@testing-library/react";
|
|
4
4
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import { SizableText } from "tamagui";
|
|
6
|
-
import { Avatar,
|
|
6
|
+
import { Avatar, getInitials, initialsFill, initialsMetrics } from "./index";
|
|
7
7
|
|
|
8
8
|
afterEach(cleanup);
|
|
9
9
|
|
|
@@ -14,6 +14,8 @@ describe("getInitials", () => {
|
|
|
14
14
|
|
|
15
15
|
it("splits email / dotted local parts", () => {
|
|
16
16
|
expect(getInitials("john.doe@example.com")).toBe("JD");
|
|
17
|
+
expect(getInitials("jane@example.com")).toBe("J");
|
|
18
|
+
expect(getInitials("sam@example.com")).toBe("S");
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
it("falls back to two chars of a single token", () => {
|
|
@@ -25,14 +27,39 @@ describe("getInitials", () => {
|
|
|
25
27
|
});
|
|
26
28
|
});
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// FZ-7889: Clay's nav bar "CL" filled the circle edge to edge on a fixed
|
|
31
|
+
// purple disc. LC-08: the initials' em is 40% of the diameter, centred on a
|
|
32
|
+
// line of their own, on the theme's accent tint (LC-131), never a hue palette
|
|
33
|
+
// (Avatar.ink.spec.tsx, its own file: it mounts the default theme config).
|
|
34
|
+
describe("Avatar initials (LC-08)", () => {
|
|
35
|
+
const initialsNode = (container: HTMLElement) =>
|
|
36
|
+
container.querySelector("[data-avatar-initials]") as HTMLElement | null;
|
|
37
|
+
|
|
38
|
+
it.each([20, 28, 36, 44, 64, 96])(
|
|
39
|
+
"a %ipx circle sets its initials at 0.4 of its diameter",
|
|
40
|
+
(px) => {
|
|
41
|
+
const { fontPx, lineHeightPx } = initialsMetrics(px);
|
|
42
|
+
expect(initialsFill).toBe(0.4);
|
|
43
|
+
expect(fontPx / px).toBeGreaterThanOrEqual(0.38);
|
|
44
|
+
expect(fontPx / px).toBeLessThanOrEqual(0.42);
|
|
45
|
+
// Two capitals run about 1.4 em: they clear the circle's sides at every size.
|
|
46
|
+
expect(fontPx * 1.4).toBeLessThan(px);
|
|
47
|
+
// The line box holds the glyphs and still fits the circle, so centring the
|
|
48
|
+
// line centres the capitals.
|
|
49
|
+
expect(lineHeightPx).toBeGreaterThanOrEqual(fontPx);
|
|
50
|
+
expect(lineHeightPx).toBeLessThanOrEqual(px);
|
|
51
|
+
},
|
|
52
|
+
);
|
|
33
53
|
|
|
34
|
-
it("
|
|
35
|
-
|
|
54
|
+
it("renders the initials at that size, centred on their own line", () => {
|
|
55
|
+
const { container } = renderWithProviders(<Avatar name="Clay Risser" size={28} />);
|
|
56
|
+
const node = initialsNode(container);
|
|
57
|
+
expect(node?.textContent).toBe("CR");
|
|
58
|
+
expect(node?.getAttribute("data-avatar-initials")).toBe(String(initialsMetrics(28).fontPx));
|
|
59
|
+
const classes = String(node?.className);
|
|
60
|
+
expect(classes).toMatch(/_fos-11px/);
|
|
61
|
+
expect(classes).toMatch(/_lh-13px/);
|
|
62
|
+
expect(classes).toMatch(/_ta-center/);
|
|
36
63
|
});
|
|
37
64
|
});
|
|
38
65
|
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Derive up to two initials from a display name or email local-part.
|
|
3
|
-
* "Ada Lovelace" → "AL", "john.doe@x" → "JD", "Ada" → "AD".
|
|
3
|
+
* "Ada Lovelace" → "AL", "john.doe@x" → "JD", "Ada" → "AD", "jane@x" → "J".
|
|
4
|
+
* An email's domain is never a name: "jane@example.com" is one word, not
|
|
5
|
+
* "Jane Example".
|
|
4
6
|
*/
|
|
5
7
|
export function getInitials(name: string): string {
|
|
6
8
|
const trimmed = (name ?? "").trim();
|
|
7
9
|
if (!trimmed) return "?";
|
|
10
|
+
const at = trimmed.indexOf("@");
|
|
11
|
+
if (at > 0) {
|
|
12
|
+
const local = trimmed
|
|
13
|
+
.slice(0, at)
|
|
14
|
+
.split(/[._-]+/)
|
|
15
|
+
.filter(Boolean);
|
|
16
|
+
if (local.length >= 2) return ((local[0][0] ?? "") + (local[1][0] ?? "")).toUpperCase();
|
|
17
|
+
return (local[0]?.[0] ?? "?").toUpperCase();
|
|
18
|
+
}
|
|
8
19
|
const parts = trimmed.split(/[\s@._-]+/).filter(Boolean);
|
|
9
20
|
if (parts.length >= 2) {
|
|
10
21
|
const a = parts[0][0] ?? "";
|
|
@@ -13,32 +24,3 @@ export function getInitials(name: string): string {
|
|
|
13
24
|
}
|
|
14
25
|
return trimmed.substring(0, 2).toUpperCase();
|
|
15
26
|
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Polaris-style deterministic initials fill. Tokens only — the same seed
|
|
19
|
-
* always lands on the same ramp pair so two "AB" avatars match.
|
|
20
|
-
*/
|
|
21
|
-
export const FALLBACK_TONES = [
|
|
22
|
-
{ bg: "$blue4", fg: "$blue12" },
|
|
23
|
-
{ bg: "$green4", fg: "$green12" },
|
|
24
|
-
{ bg: "$orange4", fg: "$orange12" },
|
|
25
|
-
{ bg: "$purple4", fg: "$purple12" },
|
|
26
|
-
{ bg: "$yellow4", fg: "$yellow12" },
|
|
27
|
-
{ bg: "$red4", fg: "$red12" },
|
|
28
|
-
] as const;
|
|
29
|
-
|
|
30
|
-
export type FallbackTone = (typeof FALLBACK_TONES)[number];
|
|
31
|
-
|
|
32
|
-
export function fallbackToneIndex(seed: string): number {
|
|
33
|
-
let hash = 0;
|
|
34
|
-
for (let i = 0; i < seed.length; i++) {
|
|
35
|
-
hash = (Math.imul(hash, 31) + seed.charCodeAt(i)) | 0;
|
|
36
|
-
}
|
|
37
|
-
return Math.abs(hash) % FALLBACK_TONES.length;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function fallbackTone(seed: string | undefined): FallbackTone | undefined {
|
|
41
|
-
const trimmed = (seed ?? "").trim();
|
|
42
|
-
if (!trimmed) return undefined;
|
|
43
|
-
return FALLBACK_TONES[fallbackToneIndex(trimmed)];
|
|
44
|
-
}
|
package/src/Avatar/index.tsx
CHANGED
|
@@ -11,28 +11,27 @@ import {
|
|
|
11
11
|
radiusClassProps,
|
|
12
12
|
resolveRadiusClass,
|
|
13
13
|
stackRadiusProps,
|
|
14
|
+
useGlyphColor,
|
|
14
15
|
useReadableTextOn,
|
|
15
16
|
useResolvedKnobs,
|
|
16
17
|
sizeKeyBelow,
|
|
17
18
|
} from "@multiplatform.one/theme";
|
|
18
19
|
import type { BorderRadius, ControlStateProps } from "@multiplatform.one/theme";
|
|
19
|
-
import type {
|
|
20
|
+
import type { GetProps, SizeTokens } from "tamagui";
|
|
20
21
|
import {
|
|
21
22
|
Avatar as TamaguiAvatar,
|
|
22
23
|
SizableText,
|
|
23
24
|
View,
|
|
24
25
|
XStack,
|
|
25
|
-
getFontSize,
|
|
26
26
|
getVariableValue,
|
|
27
27
|
styled,
|
|
28
28
|
withStaticProperties,
|
|
29
29
|
} from "tamagui";
|
|
30
30
|
import { getSize } from "@tamagui/get-token";
|
|
31
31
|
import { componentColors } from "../componentColors";
|
|
32
|
-
import {
|
|
32
|
+
import { getInitials } from "./getInitials";
|
|
33
33
|
|
|
34
|
-
export {
|
|
35
|
-
export type { FallbackTone } from "./getInitials";
|
|
34
|
+
export { getInitials } from "./getInitials";
|
|
36
35
|
|
|
37
36
|
// ── Types ─────────────────────────────────────────────────────
|
|
38
37
|
|
|
@@ -162,15 +161,27 @@ function resolveVisualPx(
|
|
|
162
161
|
return ambientPx;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
/** LC-08: the initials' em is this share of the diameter, so two capitals sit well inside the circle. */
|
|
165
|
+
export const initialsFill = 0.4;
|
|
166
|
+
|
|
167
|
+
export interface InitialsMetrics {
|
|
168
|
+
fontPx: number;
|
|
169
|
+
lineHeightPx: number;
|
|
170
|
+
maxFontScale: number;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
|
-
/**
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
/**
|
|
174
|
+
* The initials' type for a `px` circle: the em at {@link initialsFill} of the
|
|
175
|
+
* diameter, a line of 1.2 em so the capitals centre on the circle's middle
|
|
176
|
+
* whatever line height the label knob carries, and the LC-158 Dynamic Type cap.
|
|
177
|
+
*/
|
|
178
|
+
export function initialsMetrics(px: number): InitialsMetrics {
|
|
179
|
+
const fontPx = Math.max(8, Math.round(px * initialsFill));
|
|
180
|
+
return {
|
|
181
|
+
fontPx,
|
|
182
|
+
lineHeightPx: Math.round(fontPx * 1.2),
|
|
183
|
+
maxFontScale: maxFontScaleToFit(px, fontPx, dynamicTypeFit.medallionFill),
|
|
184
|
+
};
|
|
174
185
|
}
|
|
175
186
|
|
|
176
187
|
// The RN/Tamagui `onPress` type is `((event: GestureResponderEvent) => void)
|
|
@@ -226,13 +237,10 @@ function AvatarRoot({
|
|
|
226
237
|
interactive && visualPx < MIN_PRESS_TARGET ? pressTargetHitSlop(visualPx) : undefined;
|
|
227
238
|
const explicitBg = backgroundColor ?? fallbackBackgroundColor;
|
|
228
239
|
const onExplicitBg = useReadableTextOn(explicitBg as string | undefined);
|
|
229
|
-
const
|
|
230
|
-
const fallbackBg = backgroundColor ?? fallbackBackgroundColor ?? tone?.bg ?? "$color4";
|
|
240
|
+
const fallbackBg = explicitBg ?? "$selectedBackground";
|
|
231
241
|
const fallbackFg =
|
|
232
242
|
fallbackColor ??
|
|
233
|
-
(explicitBg
|
|
234
|
-
? (onExplicitBg ?? componentColors.text.primary)
|
|
235
|
-
: (tone?.fg ?? componentColors.text.primary));
|
|
243
|
+
(explicitBg ? (onExplicitBg ?? componentColors.text.primary) : "$selectedColor");
|
|
236
244
|
const identityProps = circular ? identityShapeProps : null;
|
|
237
245
|
const squareRadiusPx = circular
|
|
238
246
|
? undefined
|
|
@@ -248,6 +256,8 @@ function AvatarRoot({
|
|
|
248
256
|
const label = alt ?? name ?? (interactive ? "Avatar" : undefined);
|
|
249
257
|
const initialsText = initials ?? (name ? getInitials(name) : "?");
|
|
250
258
|
const pipPx = Math.max(8, Math.round(visualPx * 0.28));
|
|
259
|
+
const initialsType = initialsMetrics(visualPx);
|
|
260
|
+
const glyphInk = useGlyphColor(fallbackFg);
|
|
251
261
|
|
|
252
262
|
const frame = (
|
|
253
263
|
<TamaguiAvatar
|
|
@@ -309,18 +319,21 @@ function AvatarRoot({
|
|
|
309
319
|
>
|
|
310
320
|
{fallback ??
|
|
311
321
|
(initialsText === "?" ? (
|
|
312
|
-
<View {
|
|
313
|
-
<UserIcon size={Math.round(visualPx * 0.
|
|
322
|
+
<View data-avatar-glyph={glyphInk}>
|
|
323
|
+
<UserIcon size={Math.round(visualPx * 0.56)} weight="fill" color={glyphInk} />
|
|
314
324
|
</View>
|
|
315
325
|
) : (
|
|
316
326
|
<SizableText
|
|
317
|
-
{
|
|
318
|
-
fontSize={
|
|
319
|
-
|
|
327
|
+
fontFamily={knobProps.label.fontFamily}
|
|
328
|
+
fontSize={initialsType.fontPx}
|
|
329
|
+
lineHeight={initialsType.lineHeightPx}
|
|
330
|
+
maxFontSizeMultiplier={initialsType.maxFontScale}
|
|
320
331
|
fontWeight="600"
|
|
332
|
+
letterSpacing={0}
|
|
321
333
|
color={fallbackFg}
|
|
322
334
|
textAlign="center"
|
|
323
335
|
userSelect="none"
|
|
336
|
+
data-avatar-initials={initialsType.fontPx}
|
|
324
337
|
>
|
|
325
338
|
{initialsText}
|
|
326
339
|
</SizableText>
|
|
@@ -424,6 +437,8 @@ export const Avatar = withStaticProperties(AvatarRoot, {
|
|
|
424
437
|
Image: TamaguiAvatar.Image,
|
|
425
438
|
Fallback: TamaguiAvatar.Fallback,
|
|
426
439
|
Group: AvatarGroup,
|
|
440
|
+
// A menu opened from an avatar is attached with no echo row (LC-112, LC-262).
|
|
441
|
+
iconOnly: true as const,
|
|
427
442
|
});
|
|
428
443
|
|
|
429
444
|
export type { AvatarProps as AvatarFrameProps };
|
package/src/Card.spec.tsx
CHANGED
|
@@ -226,3 +226,48 @@ describe("Card header / footer (LC-09)", () => {
|
|
|
226
226
|
expect(container.querySelector('[data-slot="footer"]')?.textContent).toContain("Actions");
|
|
227
227
|
});
|
|
228
228
|
});
|
|
229
|
+
|
|
230
|
+
describe("Card media and overlay (FZ-8000)", () => {
|
|
231
|
+
it("lays media flush over an inset body, clipped by the card radius", () => {
|
|
232
|
+
const result = renderWithProviders(
|
|
233
|
+
<Card testID="media-card" media={<span data-testid="art" />}>
|
|
234
|
+
<span data-testid="title" />
|
|
235
|
+
</Card>,
|
|
236
|
+
);
|
|
237
|
+
const card = result.getByTestId("media-card");
|
|
238
|
+
expect(card.getAttribute("data-card-media")).toBe("");
|
|
239
|
+
expect(card.className).toMatch(/_pt-0px/);
|
|
240
|
+
expect(card.className).toMatch(/_ox-hidden/);
|
|
241
|
+
const slot = card.querySelector("[data-card-media-slot]") as HTMLElement;
|
|
242
|
+
const body = card.querySelector("[data-card-body]") as HTMLElement;
|
|
243
|
+
expect(slot.contains(result.getByTestId("art"))).toBe(true);
|
|
244
|
+
expect(body.contains(result.getByTestId("title"))).toBe(true);
|
|
245
|
+
expect(slot.className).not.toMatch(/_pt-/);
|
|
246
|
+
expect(body.className).toMatch(/_pt-(?!0px)/);
|
|
247
|
+
expect(slot.compareDocumentPosition(body) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("keeps the inset on the frame when there is no media", () => {
|
|
251
|
+
const result = renderWithProviders(<Card testID="plain-card">body</Card>);
|
|
252
|
+
const card = result.getByTestId("plain-card");
|
|
253
|
+
expect(card.hasAttribute("data-card-media")).toBe(false);
|
|
254
|
+
expect(card.querySelector("[data-card-body]")).toBeNull();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("lays the overlay over the whole card, after media and body", () => {
|
|
258
|
+
const result = renderWithProviders(
|
|
259
|
+
<Card
|
|
260
|
+
testID="linked-card"
|
|
261
|
+
media={<span data-testid="art" />}
|
|
262
|
+
overlay={<a data-testid="stretched" href="/record" />}
|
|
263
|
+
>
|
|
264
|
+
title
|
|
265
|
+
</Card>,
|
|
266
|
+
);
|
|
267
|
+
const link = result.getByTestId("stretched");
|
|
268
|
+
const layer = link.parentElement as HTMLElement;
|
|
269
|
+
expect(layer.className).toMatch(/_pos-absolute/);
|
|
270
|
+
const body = result.getByTestId("linked-card").querySelector("[data-card-body]") as Element;
|
|
271
|
+
expect(body.compareDocumentPosition(link) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
|
272
|
+
});
|
|
273
|
+
});
|
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
|
);
|
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
|
+
});
|