@multiplatform.one/components 7.65.1 → 7.65.2
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 +26 -5
- package/dist/cjs/Alert/index.native.js +26 -5
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.cjs +29 -0
- package/dist/cjs/images/Image/framing.native.js +32 -0
- package/dist/cjs/images/Image/framing.native.js.map +1 -0
- package/dist/cjs/images/Image/shared.cjs +2 -2
- package/dist/cjs/images/Image/shared.native.js +2 -2
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +16 -131
- package/dist/cjs/views/Dashboard.native.js +16 -131
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/List.cjs +14 -189
- package/dist/cjs/views/List.native.js +14 -193
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +181 -0
- package/dist/cjs/views/ListGroup.native.js +194 -0
- package/dist/cjs/views/ListGroup.native.js.map +1 -0
- package/dist/cjs/views/ListRow.cjs +266 -0
- package/dist/cjs/views/ListRow.native.js +274 -0
- package/dist/cjs/views/ListRow.native.js.map +1 -0
- package/dist/cjs/views/ShortcutCard.cjs +100 -0
- package/dist/cjs/views/ShortcutCard.native.js +104 -0
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -0
- package/dist/cjs/views/index.cjs +3 -0
- package/dist/cjs/views/index.native.js +3 -0
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.cjs +93 -0
- package/dist/cjs/views/widgetChrome.native.js +95 -0
- package/dist/cjs/views/widgetChrome.native.js.map +1 -0
- package/dist/esm/Alert/index.mjs +27 -6
- package/dist/esm/Alert/index.mjs.map +1 -1
- package/dist/esm/Alert/index.native.js +27 -6
- package/dist/esm/Alert/index.native.js.map +1 -1
- package/dist/esm/images/Image/framing.mjs +4 -0
- package/dist/esm/images/Image/framing.mjs.map +1 -0
- package/dist/esm/images/Image/framing.native.js +4 -0
- package/dist/esm/images/Image/framing.native.js.map +1 -0
- package/dist/esm/images/Image/shared.mjs +2 -2
- package/dist/esm/images/Image/shared.mjs.map +1 -1
- package/dist/esm/images/Image/shared.native.js +2 -2
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +6 -121
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +6 -121
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/List.mjs +8 -186
- package/dist/esm/views/List.mjs.map +1 -1
- package/dist/esm/views/List.native.js +8 -190
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +144 -0
- package/dist/esm/views/ListGroup.mjs.map +1 -0
- package/dist/esm/views/ListGroup.native.js +154 -0
- package/dist/esm/views/ListGroup.native.js.map +1 -0
- package/dist/esm/views/ListRow.mjs +234 -0
- package/dist/esm/views/ListRow.mjs.map +1 -0
- package/dist/esm/views/ListRow.native.js +239 -0
- package/dist/esm/views/ListRow.native.js.map +1 -0
- package/dist/esm/views/ShortcutCard.mjs +75 -0
- package/dist/esm/views/ShortcutCard.mjs.map +1 -0
- package/dist/esm/views/ShortcutCard.native.js +76 -0
- package/dist/esm/views/ShortcutCard.native.js.map +1 -0
- 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/esm/views/widgetChrome.mjs +66 -0
- package/dist/esm/views/widgetChrome.mjs.map +1 -0
- package/dist/esm/views/widgetChrome.native.js +65 -0
- package/dist/esm/views/widgetChrome.native.js.map +1 -0
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/Alert/index.mjs +27 -6
- package/dist/jsx/Alert/index.mjs.map +1 -1
- package/dist/jsx/Alert/index.native.js +26 -5
- 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.native.js.map +1 -1
- 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.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.map +1 -1
- 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.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/Material/index.native.js.map +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.native.js.map +1 -1
- 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.native.js.map +1 -1
- package/dist/jsx/SheetModal/detents.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.map +1 -1
- package/dist/jsx/Text.native.js.map +1 -1
- 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.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.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.map +1 -1
- package/dist/jsx/actions/devWarn.native.js.map +1 -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.map +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.native.js.map +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.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.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.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.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 +1 -1
- 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.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +1 -1
- 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.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.map +1 -1
- package/dist/jsx/images/Image/framing.mjs +4 -0
- package/dist/jsx/images/Image/framing.mjs.map +1 -0
- package/dist/jsx/images/Image/framing.native.js +32 -0
- package/dist/jsx/images/Image/framing.native.js.map +1 -0
- package/dist/jsx/images/Image/shared.mjs +2 -2
- package/dist/jsx/images/Image/shared.mjs.map +1 -1
- package/dist/jsx/images/Image/shared.native.js +2 -2
- 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.native.js +1 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +1 -1
- 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.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.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.map +1 -1
- package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/jsx/layouts/index.native.js.map +1 -1
- 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.native.js.map +1 -1
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- 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.map +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.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +6 -121
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +16 -131
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- 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.native.js.map +1 -1
- package/dist/jsx/views/List.mjs +8 -186
- package/dist/jsx/views/List.mjs.map +1 -1
- package/dist/jsx/views/List.native.js +14 -193
- package/dist/jsx/views/List.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.mjs +144 -0
- package/dist/jsx/views/ListGroup.mjs.map +1 -0
- package/dist/jsx/views/ListGroup.native.js +194 -0
- package/dist/jsx/views/ListGroup.native.js.map +1 -0
- package/dist/jsx/views/ListRow.mjs +234 -0
- package/dist/jsx/views/ListRow.mjs.map +1 -0
- package/dist/jsx/views/ListRow.native.js +274 -0
- package/dist/jsx/views/ListRow.native.js.map +1 -0
- package/dist/jsx/views/Matrix.native.js.map +1 -1
- package/dist/jsx/views/ReportBuilder.native.js.map +1 -1
- package/dist/jsx/views/ShortcutCard.mjs +75 -0
- package/dist/jsx/views/ShortcutCard.mjs.map +1 -0
- package/dist/jsx/views/ShortcutCard.native.js +104 -0
- package/dist/jsx/views/ShortcutCard.native.js.map +1 -0
- 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 -0
- 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.mjs +66 -0
- package/dist/jsx/views/widgetChrome.mjs.map +1 -0
- package/dist/jsx/views/widgetChrome.native.js +95 -0
- package/dist/jsx/views/widgetChrome.native.js.map +1 -0
- package/package.json +9 -9
- package/src/Alert/Alert.spec.tsx +79 -0
- package/src/Alert/Alert.stories.tsx +32 -1
- package/src/Alert/index.tsx +54 -5
- package/src/images/Image/framing.ts +8 -0
- package/src/images/Image/shared.ts +2 -7
- package/src/overlayElevation.spec.tsx +3 -1
- package/src/views/Dashboard.tsx +5 -146
- package/src/views/Kanban.native.spec.tsx +2 -2
- package/src/views/List.tsx +22 -237
- package/src/views/ListGroup.spec.tsx +220 -0
- package/src/views/ListGroup.stories.tsx +83 -0
- package/src/views/ListGroup.tsx +189 -0
- package/src/views/ListRow.tsx +282 -0
- package/src/views/ShortcutCard.spec.tsx +40 -0
- package/src/views/ShortcutCard.stories.tsx +50 -1
- package/src/views/ShortcutCard.tsx +88 -0
- package/src/views/index.ts +6 -0
- package/src/views/widgetChrome.tsx +73 -0
- package/types/Alert/index.d.ts +9 -0
- package/types/Alert/index.d.ts.map +1 -1
- package/types/images/Image/framing.d.ts +7 -0
- package/types/images/Image/framing.d.ts.map +1 -0
- package/types/images/Image/shared.d.ts +1 -6
- package/types/images/Image/shared.d.ts.map +1 -1
- package/types/views/Dashboard.d.ts +2 -15
- package/types/views/Dashboard.d.ts.map +1 -1
- package/types/views/List.d.ts +3 -66
- package/types/views/List.d.ts.map +1 -1
- package/types/views/ListGroup.d.ts +43 -0
- package/types/views/ListGroup.d.ts.map +1 -0
- package/types/views/ListRow.d.ts +88 -0
- package/types/views/ListRow.d.ts.map +1 -0
- package/types/views/ShortcutCard.d.ts +26 -0
- package/types/views/ShortcutCard.d.ts.map +1 -0
- package/types/views/index.d.ts +1 -1
- package/types/views/index.d.ts.map +1 -1
- package/types/views/widgetChrome.d.ts +72 -0
- package/types/views/widgetChrome.d.ts.map +1 -0
package/src/views/Dashboard.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IconSlot } from "@multiplatform.one/theme";
|
|
2
1
|
import { Meter } from "../Meter";
|
|
3
2
|
import { ChartDataView } from "../charts/ChartDataView";
|
|
4
3
|
import { BarChart } from "../charts/BarChart";
|
|
@@ -13,26 +12,15 @@ import {
|
|
|
13
12
|
formatNumber,
|
|
14
13
|
formatPercent,
|
|
15
14
|
useResolvedKnobs,
|
|
16
|
-
useChartPalette,
|
|
17
|
-
useReadableTextOn,
|
|
18
15
|
} from "@multiplatform.one/theme";
|
|
19
16
|
import React, { useCallback, useMemo, useState, type ReactNode } from "react";
|
|
20
17
|
import { useTranslation } from "../shared/i18n";
|
|
21
|
-
import {
|
|
22
|
-
SizableText,
|
|
23
|
-
Text,
|
|
24
|
-
XStack,
|
|
25
|
-
YStack,
|
|
26
|
-
isWeb,
|
|
27
|
-
type YStackProps,
|
|
28
|
-
type FontSizeTokens,
|
|
29
|
-
H2,
|
|
30
|
-
H3,
|
|
31
|
-
H4,
|
|
32
|
-
H5,
|
|
33
|
-
H6,
|
|
34
|
-
} from "tamagui";
|
|
18
|
+
import { Text, XStack, YStack, isWeb, type YStackProps, H2, H3, H4, H5, H6 } from "tamagui";
|
|
35
19
|
import { ScrollView } from "../ScrollView";
|
|
20
|
+
import { NestedIconWell, useWidgetChrome } from "./widgetChrome";
|
|
21
|
+
import { ShortcutCard, type ShortcutConfig } from "./ShortcutCard";
|
|
22
|
+
|
|
23
|
+
export { ShortcutCard, type ShortcutCardProps, type ShortcutConfig } from "./ShortcutCard";
|
|
36
24
|
|
|
37
25
|
/**
|
|
38
26
|
* LC-17 SECTION-HEADING-SCALE + DG-A11Y-02: card sub-titles read at the ONE
|
|
@@ -42,20 +30,6 @@ import { ScrollView } from "../ScrollView";
|
|
|
42
30
|
const SECTION_HEADING_TAGS = { 2: H2, 3: H3, 4: H4, 5: H5, 6: H6 } as const;
|
|
43
31
|
export type CardHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
44
32
|
|
|
45
|
-
function splitNestedControl(nested: {
|
|
46
|
-
px: number;
|
|
47
|
-
hitSlop: { top: number; bottom: number; left: number; right: number };
|
|
48
|
-
width: number;
|
|
49
|
-
height: number;
|
|
50
|
-
minWidth: number;
|
|
51
|
-
maxWidth: number;
|
|
52
|
-
minHeight: number;
|
|
53
|
-
maxHeight: number;
|
|
54
|
-
}) {
|
|
55
|
-
const { px, hitSlop, ...box } = nested;
|
|
56
|
-
return { px, hitSlop, box };
|
|
57
|
-
}
|
|
58
|
-
|
|
59
33
|
function trendFill(color: string): string {
|
|
60
34
|
if (color === componentColors.semantic.success) return "$green4";
|
|
61
35
|
if (color === componentColors.semantic.error) return "$red4";
|
|
@@ -152,18 +126,6 @@ export interface ProgressConfig {
|
|
|
152
126
|
color?: string;
|
|
153
127
|
}
|
|
154
128
|
|
|
155
|
-
/**
|
|
156
|
-
* Frappe workspace shortcut: label + nested count pill.
|
|
157
|
-
*/
|
|
158
|
-
export interface ShortcutConfig {
|
|
159
|
-
id: string;
|
|
160
|
-
title: string;
|
|
161
|
-
count?: number | string;
|
|
162
|
-
icon?: React.ReactNode;
|
|
163
|
-
color?: string;
|
|
164
|
-
onClick?: () => void;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
129
|
/**
|
|
168
130
|
* Frappe link card / Polaris resource list / Grafana table-lite.
|
|
169
131
|
*/
|
|
@@ -235,55 +197,6 @@ export interface DashboardProps extends Omit<YStackProps, "children"> {
|
|
|
235
197
|
// Shared card chrome
|
|
236
198
|
// ============================================================================
|
|
237
199
|
|
|
238
|
-
function useWidgetChrome(onPress?: YStackProps["onPress"]) {
|
|
239
|
-
const resolved = useResolvedKnobs();
|
|
240
|
-
const { knobProps, control } = resolved;
|
|
241
|
-
const nested = splitNestedControl(knobProps.nestedControl);
|
|
242
|
-
const interactive = onPress
|
|
243
|
-
? {
|
|
244
|
-
cursor: "pointer" as const,
|
|
245
|
-
hoverStyle: control.hoverKnobProps,
|
|
246
|
-
pressStyle: control.pressKnobProps,
|
|
247
|
-
focusVisibleStyle: control.focusVisibleKnobProps,
|
|
248
|
-
onPress,
|
|
249
|
-
role: "button" as const,
|
|
250
|
-
}
|
|
251
|
-
: undefined;
|
|
252
|
-
return { knobProps, control, nested, interactive };
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
function NestedIconWell({
|
|
256
|
-
color,
|
|
257
|
-
box,
|
|
258
|
-
px,
|
|
259
|
-
radius,
|
|
260
|
-
children,
|
|
261
|
-
}: {
|
|
262
|
-
color?: string;
|
|
263
|
-
box: ReturnType<typeof splitNestedControl>["box"];
|
|
264
|
-
px: number;
|
|
265
|
-
radius: object;
|
|
266
|
-
children: ReactNode;
|
|
267
|
-
}) {
|
|
268
|
-
const identity = useChartPalette().single;
|
|
269
|
-
const fill = color || identity;
|
|
270
|
-
const ink = useReadableTextOn(fill);
|
|
271
|
-
return (
|
|
272
|
-
<YStack
|
|
273
|
-
{...box}
|
|
274
|
-
{...radius}
|
|
275
|
-
alignItems="center"
|
|
276
|
-
justifyContent="center"
|
|
277
|
-
backgroundColor={fill as any}
|
|
278
|
-
{...{ color: ink }}
|
|
279
|
-
overflow="hidden"
|
|
280
|
-
data-nested-px={px}
|
|
281
|
-
>
|
|
282
|
-
<IconSlot icon={children} color={ink} />
|
|
283
|
-
</YStack>
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
200
|
function TrendPill({
|
|
288
201
|
symbol,
|
|
289
202
|
value,
|
|
@@ -635,60 +548,6 @@ export function ProgressCard({ config, ...stackProps }: ProgressCardProps) {
|
|
|
635
548
|
);
|
|
636
549
|
}
|
|
637
550
|
|
|
638
|
-
export interface ShortcutCardProps extends Omit<YStackProps, "children"> {
|
|
639
|
-
config: ShortcutConfig;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
export function ShortcutCard({ config, ...stackProps }: ShortcutCardProps) {
|
|
643
|
-
const { knobProps, nested, interactive } = useWidgetChrome(config.onClick);
|
|
644
|
-
const { px, box, hitSlop } = nested;
|
|
645
|
-
|
|
646
|
-
return (
|
|
647
|
-
<Card
|
|
648
|
-
width="100%"
|
|
649
|
-
elevation={knobProps.elevation}
|
|
650
|
-
{...knobProps.surface}
|
|
651
|
-
{...interactive}
|
|
652
|
-
hitSlop={config.onClick ? hitSlop : undefined}
|
|
653
|
-
{...stackProps}
|
|
654
|
-
>
|
|
655
|
-
<XStack alignItems="center" {...knobProps.gap}>
|
|
656
|
-
{config.icon ? (
|
|
657
|
-
<NestedIconWell color={config.color} box={box} px={px} radius={knobProps.borderRadius}>
|
|
658
|
-
{config.icon}
|
|
659
|
-
</NestedIconWell>
|
|
660
|
-
) : null}
|
|
661
|
-
<SizableText
|
|
662
|
-
size={knobProps.sizeToken as FontSizeTokens}
|
|
663
|
-
{...knobProps.heading}
|
|
664
|
-
flex={1}
|
|
665
|
-
numberOfLines={1}
|
|
666
|
-
>
|
|
667
|
-
{config.title}
|
|
668
|
-
</SizableText>
|
|
669
|
-
{config.count != null && config.count !== "" ? (
|
|
670
|
-
<XStack
|
|
671
|
-
height={px}
|
|
672
|
-
minHeight={px}
|
|
673
|
-
maxHeight={px}
|
|
674
|
-
minWidth={px}
|
|
675
|
-
paddingHorizontal="$2"
|
|
676
|
-
alignItems="center"
|
|
677
|
-
justifyContent="center"
|
|
678
|
-
backgroundColor="$color4"
|
|
679
|
-
{...knobProps.borderRadius}
|
|
680
|
-
data-nested-px={px}
|
|
681
|
-
>
|
|
682
|
-
<Text {...knobProps.label} color={knobProps.textAccentColor}>
|
|
683
|
-
{config.count}
|
|
684
|
-
</Text>
|
|
685
|
-
</XStack>
|
|
686
|
-
) : null}
|
|
687
|
-
</XStack>
|
|
688
|
-
</Card>
|
|
689
|
-
);
|
|
690
|
-
}
|
|
691
|
-
|
|
692
551
|
export interface ListCardProps extends Omit<YStackProps, "children"> {
|
|
693
552
|
config: ListConfig;
|
|
694
553
|
headingLevel?: CardHeadingLevel;
|
|
@@ -71,8 +71,8 @@ describe("native Kanban card elevation (FZ-7740)", () => {
|
|
|
71
71
|
for (const stop of ["medium", "large"] as const) {
|
|
72
72
|
it(`paints the theme elevation recipe at ${stop} and keeps the shadow unclipped`, () => {
|
|
73
73
|
const card = renderBoard(stop);
|
|
74
|
-
expect(card.shadowColor).toBe("
|
|
75
|
-
expect(card.shadowOpacity).toBe(
|
|
74
|
+
expect(card.shadowColor).toBe("rgb(0,0,0)");
|
|
75
|
+
expect(card.shadowOpacity).toBe(0.12);
|
|
76
76
|
expect(card.shadowRadius).toBeGreaterThan(0);
|
|
77
77
|
expect(card.elevation).toBeGreaterThan(0);
|
|
78
78
|
expect(card.overflow).toBe("visible");
|
package/src/views/List.tsx
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { componentColors } from "../componentColors";
|
|
2
|
-
import { ImageFramingContext } from "../images/Image/shared";
|
|
3
2
|
import { AsyncBoundary } from "../layouts/AsyncBoundary";
|
|
4
3
|
import { Spinner } from "@multiplatform.one/forms";
|
|
5
4
|
import { FlashList, type FlashListRef } from "@shopify/flash-list";
|
|
6
5
|
import {
|
|
7
|
-
IconSlot,
|
|
8
6
|
MIN_PRESS_TARGET,
|
|
9
7
|
containerCapProps,
|
|
10
8
|
ensureKeyboardModalityTracking,
|
|
@@ -12,10 +10,7 @@ import {
|
|
|
12
10
|
hairline,
|
|
13
11
|
hairlineWidth,
|
|
14
12
|
keyboardFocusRingProps,
|
|
15
|
-
recipeKeyAbove,
|
|
16
|
-
sizeRecipeForToken,
|
|
17
13
|
stackRadiusProps,
|
|
18
|
-
type SizeRecipeToken,
|
|
19
14
|
Surface,
|
|
20
15
|
useResolvedKnobs,
|
|
21
16
|
useTouchSurface,
|
|
@@ -24,17 +19,29 @@ import {
|
|
|
24
19
|
} from "@multiplatform.one/theme";
|
|
25
20
|
import { useHotkey } from "@tanstack/react-hotkeys";
|
|
26
21
|
import type { RegisterableHotkey } from "@tanstack/react-hotkeys";
|
|
27
|
-
import React, {
|
|
28
|
-
createContext,
|
|
29
|
-
useCallback,
|
|
30
|
-
useContext,
|
|
31
|
-
useId,
|
|
32
|
-
useRef,
|
|
33
|
-
useState,
|
|
34
|
-
type ReactNode,
|
|
35
|
-
} from "react";
|
|
22
|
+
import React, { useCallback, useId, useRef, useState, type ReactNode } from "react";
|
|
36
23
|
import { useTranslation } from "../shared/i18n";
|
|
37
|
-
import {
|
|
24
|
+
import { View, XStack, YStack, type SizeTokens, type YStackProps } from "tamagui";
|
|
25
|
+
import { ListItemStateContext, listRowTouchProps, type ListItemState } from "./ListRow";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
ListRow,
|
|
29
|
+
ListRowFact,
|
|
30
|
+
ListRowMeta,
|
|
31
|
+
listLeadingIconSize,
|
|
32
|
+
listRowPressDelayMs,
|
|
33
|
+
listRowTouchProps,
|
|
34
|
+
useListItemState,
|
|
35
|
+
type ListItemState,
|
|
36
|
+
type ListRowProps,
|
|
37
|
+
} from "./ListRow";
|
|
38
|
+
export {
|
|
39
|
+
ListGroup,
|
|
40
|
+
ListGroupItem,
|
|
41
|
+
type ListGroupItemProps,
|
|
42
|
+
type ListGroupProps,
|
|
43
|
+
type ListGroupVariant,
|
|
44
|
+
} from "./ListGroup";
|
|
38
45
|
|
|
39
46
|
/**
|
|
40
47
|
* Configurable hotkey bindings for the List component.
|
|
@@ -56,228 +63,6 @@ export interface ListHotkeys {
|
|
|
56
63
|
pageUp?: RegisterableHotkey;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
|
-
/** Per-row interaction state passed to `renderItem` and `ListRow`. */
|
|
60
|
-
export interface ListItemState {
|
|
61
|
-
selected: boolean;
|
|
62
|
-
focused: boolean;
|
|
63
|
-
/** Ink for the selected row (LC-05 selection tier) */
|
|
64
|
-
selectedInk?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** True inside a ListRow with a subtitle: its trailing meta is a caption. */
|
|
68
|
-
const ListRowTwoLineContext = createContext(false);
|
|
69
|
-
|
|
70
|
-
const ListItemStateContext = createContext<ListItemState>({
|
|
71
|
-
selected: false,
|
|
72
|
-
focused: false,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
/** Read the current row's selection/focus. Defaults to idle outside a List. */
|
|
76
|
-
export function useListItemState(): ListItemState {
|
|
77
|
-
return useContext(ListItemStateContext);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Subject-led document row (Desk list / Linear / Finder): leading glyph or
|
|
82
|
-
* media, title (+ optional subtitle), trailing muted meta. Sits inside List's
|
|
83
|
-
* stacked-group chrome — does not paint its own radius, fill, or ring.
|
|
84
|
-
*
|
|
85
|
-
* LC-155 ROW-ANATOMY: the title is the headline role, the subtitle the meta
|
|
86
|
-
* role on one line, and with a subtitle the row is a two-line Mail row whose
|
|
87
|
-
* trailing meta is a caption at the top right.
|
|
88
|
-
*/
|
|
89
|
-
export interface ListRowProps {
|
|
90
|
-
/** Leading glyph slot — fixed box so titles share one x (LC-08). */
|
|
91
|
-
icon?: ReactNode;
|
|
92
|
-
/**
|
|
93
|
-
* Leading media slot (an avatar, a thumbnail): a `$true` square, and a
|
|
94
|
-
* thumbnail inside it draws no tile of its own.
|
|
95
|
-
*/
|
|
96
|
-
media?: ReactNode;
|
|
97
|
-
title: ReactNode;
|
|
98
|
-
subtitle?: ReactNode;
|
|
99
|
-
/** Trailing Finder/Desk columns (dates, size, kind, status). */
|
|
100
|
-
meta?: ReactNode;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function RowText({
|
|
104
|
-
children,
|
|
105
|
-
...props
|
|
106
|
-
}: { children: ReactNode } & React.ComponentProps<typeof Text>) {
|
|
107
|
-
if (children == null || children === false) return null;
|
|
108
|
-
if (typeof children === "string" || typeof children === "number") {
|
|
109
|
-
return <Text {...props}>{children}</Text>;
|
|
110
|
-
}
|
|
111
|
-
return <>{children}</>;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Trailing Finder/Desk column. Inherits selected fill ink (LC-71). `width`
|
|
116
|
-
* fixes the column (a size token or a measured px) so the same column lines
|
|
117
|
-
* up from row to row; rich cell content (pills, formatted cells) renders in a
|
|
118
|
-
* box of that width instead of a Text run.
|
|
119
|
-
*/
|
|
120
|
-
export function ListRowMeta({
|
|
121
|
-
children,
|
|
122
|
-
width,
|
|
123
|
-
color,
|
|
124
|
-
}: {
|
|
125
|
-
children: ReactNode;
|
|
126
|
-
width?: number | SizeTokens;
|
|
127
|
-
color?: string;
|
|
128
|
-
}) {
|
|
129
|
-
const { knobProps } = useResolvedKnobs();
|
|
130
|
-
const { selected, selectedInk } = useListItemState();
|
|
131
|
-
const twoLine = useContext(ListRowTwoLineContext);
|
|
132
|
-
const type = twoLine ? knobProps.textRole.caption : knobProps.label;
|
|
133
|
-
const ink = color ?? (twoLine ? knobProps.textRole.caption.color : knobProps.textAccentColor);
|
|
134
|
-
const resolved = selected && selectedInk ? selectedInk : ink;
|
|
135
|
-
if (typeof children !== "string" && typeof children !== "number") {
|
|
136
|
-
return (
|
|
137
|
-
<XStack
|
|
138
|
-
width={width}
|
|
139
|
-
flexShrink={0}
|
|
140
|
-
minWidth={0}
|
|
141
|
-
alignItems="center"
|
|
142
|
-
justifyContent="flex-end"
|
|
143
|
-
overflow="hidden"
|
|
144
|
-
{...({ "data-list-slot": "trailing", color: resolved } as Record<string, unknown>)}
|
|
145
|
-
>
|
|
146
|
-
{children}
|
|
147
|
-
</XStack>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
return (
|
|
151
|
-
<Text
|
|
152
|
-
{...type}
|
|
153
|
-
color={resolved}
|
|
154
|
-
numberOfLines={1}
|
|
155
|
-
width={width}
|
|
156
|
-
flexShrink={0}
|
|
157
|
-
textAlign="right"
|
|
158
|
-
userSelect="none"
|
|
159
|
-
>
|
|
160
|
-
{children}
|
|
161
|
-
</Text>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* The leading glyph of a (two-line) list row: the control icon two recipe
|
|
167
|
-
* keys above the row's size token (20 at the default `$true`), read off the
|
|
168
|
-
* scale so a preset restyles it with every other control icon.
|
|
169
|
-
*/
|
|
170
|
-
export function listLeadingIconSize(sizeToken: string): number {
|
|
171
|
-
return sizeRecipeForToken(recipeKeyAbove(recipeKeyAbove(sizeToken as SizeRecipeToken))).iconSize;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export function ListRow({ icon, media, title, subtitle, meta }: ListRowProps) {
|
|
175
|
-
const { knobProps } = useResolvedKnobs();
|
|
176
|
-
const { selected, selectedInk } = useListItemState();
|
|
177
|
-
const { headline, meta: metaRole } = knobProps.textRole;
|
|
178
|
-
const selectedOverride = selected && selectedInk ? selectedInk : undefined;
|
|
179
|
-
const ink = selectedOverride ?? knobProps.textAccentColor;
|
|
180
|
-
const iconSize = listLeadingIconSize(knobProps.sizeToken);
|
|
181
|
-
const leading = icon ? <IconSlot icon={icon} size={iconSize} color={ink} /> : null;
|
|
182
|
-
const twoLine = subtitle != null && subtitle !== false;
|
|
183
|
-
|
|
184
|
-
return (
|
|
185
|
-
<ListRowTwoLineContext.Provider value={twoLine}>
|
|
186
|
-
<XStack
|
|
187
|
-
alignItems="center"
|
|
188
|
-
{...knobProps.gap}
|
|
189
|
-
flex={1}
|
|
190
|
-
minWidth={0}
|
|
191
|
-
width="100%"
|
|
192
|
-
{...(twoLine ? { paddingVertical: "$1" } : null)}
|
|
193
|
-
>
|
|
194
|
-
{media ? (
|
|
195
|
-
<View
|
|
196
|
-
width="$true"
|
|
197
|
-
height="$true"
|
|
198
|
-
flexShrink={0}
|
|
199
|
-
alignItems="center"
|
|
200
|
-
justifyContent="center"
|
|
201
|
-
overflow="hidden"
|
|
202
|
-
{...({ "data-list-slot": "media" } as Record<string, unknown>)}
|
|
203
|
-
>
|
|
204
|
-
<ImageFramingContext.Provider value={false}>{media}</ImageFramingContext.Provider>
|
|
205
|
-
</View>
|
|
206
|
-
) : null}
|
|
207
|
-
{leading ? (
|
|
208
|
-
<View
|
|
209
|
-
width={iconSize}
|
|
210
|
-
height={iconSize}
|
|
211
|
-
flexShrink={0}
|
|
212
|
-
alignItems="center"
|
|
213
|
-
justifyContent="center"
|
|
214
|
-
{...({ "data-list-slot": "icon", color: ink } as Record<string, unknown>)}
|
|
215
|
-
>
|
|
216
|
-
{leading}
|
|
217
|
-
</View>
|
|
218
|
-
) : null}
|
|
219
|
-
<YStack
|
|
220
|
-
flex={1}
|
|
221
|
-
minWidth={0}
|
|
222
|
-
{...({ "data-list-slot": "title" } as Record<string, unknown>)}
|
|
223
|
-
>
|
|
224
|
-
<RowText
|
|
225
|
-
{...knobProps.body}
|
|
226
|
-
{...headline}
|
|
227
|
-
color={selectedOverride ?? headline.color}
|
|
228
|
-
numberOfLines={1}
|
|
229
|
-
userSelect="none"
|
|
230
|
-
>
|
|
231
|
-
{title}
|
|
232
|
-
</RowText>
|
|
233
|
-
{twoLine ? (
|
|
234
|
-
<RowText
|
|
235
|
-
{...knobProps.body}
|
|
236
|
-
{...metaRole}
|
|
237
|
-
color={selectedOverride ?? metaRole.color}
|
|
238
|
-
opacity={selected ? 0.85 : 1}
|
|
239
|
-
numberOfLines={1}
|
|
240
|
-
userSelect="none"
|
|
241
|
-
>
|
|
242
|
-
{subtitle}
|
|
243
|
-
</RowText>
|
|
244
|
-
) : null}
|
|
245
|
-
</YStack>
|
|
246
|
-
{meta != null && meta !== false ? (
|
|
247
|
-
<XStack
|
|
248
|
-
alignItems="center"
|
|
249
|
-
{...knobProps.gap}
|
|
250
|
-
flexShrink={0}
|
|
251
|
-
{...(twoLine ? { alignSelf: "flex-start" } : null)}
|
|
252
|
-
{...({ "data-list-slot": "meta" } as Record<string, unknown>)}
|
|
253
|
-
>
|
|
254
|
-
{typeof meta === "string" || typeof meta === "number" ? (
|
|
255
|
-
<ListRowMeta>{meta}</ListRowMeta>
|
|
256
|
-
) : (
|
|
257
|
-
meta
|
|
258
|
-
)}
|
|
259
|
-
</XStack>
|
|
260
|
-
) : null}
|
|
261
|
-
</XStack>
|
|
262
|
-
</ListRowTwoLineContext.Provider>
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* A row in a scroller waits this long before it paints its press, the delay
|
|
268
|
-
* UIScrollView gives its content: a touch that becomes a scroll never fills
|
|
269
|
-
* the row it started on (LC-147).
|
|
270
|
-
*/
|
|
271
|
-
export const listRowPressDelayMs = 150;
|
|
272
|
-
|
|
273
|
-
/** What a touch surface adds to a row: the 44 floor and, on native, the press delay. */
|
|
274
|
-
export function listRowTouchProps(touch: boolean, native = !isWeb) {
|
|
275
|
-
if (!touch) return {};
|
|
276
|
-
return native
|
|
277
|
-
? { minHeight: MIN_PRESS_TARGET, delayPressIn: listRowPressDelayMs }
|
|
278
|
-
: { minHeight: MIN_PRESS_TARGET };
|
|
279
|
-
}
|
|
280
|
-
|
|
281
66
|
/**
|
|
282
67
|
* Props for the generic List component.
|
|
283
68
|
*
|