@12-apps/ui 6.59.0 → 6.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/Avatar/Avatar.js +3 -3
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.js +2 -2
- package/dist/_internal/components/data-display/Chart/Chart.js +4 -4
- package/dist/_internal/components/data-display/Chart/SpecChart.js +7 -7
- package/dist/_internal/components/data-display/Chart/chart-context.js +2 -2
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +3 -3
- package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +25 -23
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +26 -24
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +6 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card-gutters.js +1 -1
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +7 -5
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +11 -6
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +14 -10
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-export.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +5 -3
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +20 -18
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +5 -5
- package/dist/_internal/components/data-display/DataViews/list-card-breaks.js +12 -0
- package/dist/_internal/components/data-display/DataViews/list-card-breaks.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/list-card-cells.js +3 -1
- package/dist/_internal/components/data-display/DataViews/list-card-group-tracks.js +14 -0
- package/dist/_internal/components/data-display/DataViews/list-card-group-tracks.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +4 -2
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +4 -4
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js +1 -1
- package/dist/_internal/components/data-display/Popover/Popover.js +1 -1
- package/dist/_internal/components/data-display/index.js +16 -16
- package/dist/_internal/components/index.js +23 -23
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +6 -6
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +9 -9
- package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +3 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +5 -5
- package/dist/_internal/components/navigation/SectionNav/SectionNav.railCreate.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +4 -4
- package/dist/_internal/components/navigation/index.js +9 -9
- package/dist/_internal/en-US.data-display.js +1 -1
- package/dist/_internal/pt-BR.data-display.js +1 -1
- package/dist/_internal/user-avatar/user-avatar.js +4 -4
- package/dist/charts.js +10 -10
- package/dist/{chunk-V4V2N6YJ.js → chunk-36RYXV4R.js} +9 -6
- package/dist/chunk-36RYXV4R.js.map +1 -0
- package/dist/{chunk-W7N4ORCV.js → chunk-3JYCS7VO.js} +5 -5
- package/dist/{chunk-YIKFYWKD.js → chunk-46ZATLQV.js} +3 -3
- package/dist/{chunk-TF27Z27K.js → chunk-4JZ6XDVA.js} +2 -2
- package/dist/{chunk-EDBP62WG.js → chunk-53ACGKBW.js} +3 -3
- package/dist/{chunk-ZWBGQYVO.js → chunk-56PBNYXF.js} +8 -6
- package/dist/chunk-56PBNYXF.js.map +1 -0
- package/dist/{chunk-EWIKSTJV.js → chunk-5WJFCQFN.js} +7 -7
- package/dist/{chunk-WBDQSBLV.js → chunk-5XFJCWPY.js} +5 -5
- package/dist/{chunk-QKAYXAQE.js → chunk-6FAYTKXW.js} +24 -20
- package/dist/chunk-6FAYTKXW.js.map +1 -0
- package/dist/{chunk-62E2X66R.js → chunk-72BVL6VF.js} +8 -4
- package/dist/{chunk-62E2X66R.js.map → chunk-72BVL6VF.js.map} +1 -1
- package/dist/{chunk-HPO7PB4F.js → chunk-7AAJYWC3.js} +2 -2
- package/dist/{chunk-XW5SEW3H.js → chunk-AKC5GRJF.js} +2 -2
- package/dist/{chunk-NHVL2QPG.js → chunk-D7PVIC33.js} +2 -1
- package/dist/chunk-D7PVIC33.js.map +1 -0
- package/dist/{chunk-4QKS5Y35.js → chunk-EBSA4EYR.js} +2 -2
- package/dist/{chunk-2W2MWEP2.js → chunk-EFLRNSE6.js} +11 -11
- package/dist/{chunk-PC4H5LVB.js → chunk-EUPUEMFX.js} +7 -7
- package/dist/{chunk-COYGTEN5.js → chunk-F5S5UFGD.js} +8 -1
- package/dist/chunk-F5S5UFGD.js.map +1 -0
- package/dist/{chunk-4PPNCZWY.js → chunk-GS5EPYB4.js} +3 -3
- package/dist/{chunk-JVOEVTCZ.js → chunk-HQCZT6TO.js} +5 -5
- package/dist/{chunk-GK7JNSMK.js → chunk-IK2ZVV3M.js} +2 -2
- package/dist/{chunk-CMBZ3J6I.js → chunk-JA6GKU65.js} +2 -11
- package/dist/chunk-JA6GKU65.js.map +1 -0
- package/dist/{chunk-3FMWQQW6.js → chunk-L4Z7B7KL.js} +2 -2
- package/dist/{chunk-3K7WN2PO.js → chunk-NBM3YJ4P.js} +3 -3
- package/dist/{chunk-CTIMTEH7.js → chunk-NFCAXQ3F.js} +4 -4
- package/dist/{chunk-GYDUXL3D.js → chunk-NVXRV3PL.js} +7 -7
- package/dist/{chunk-6OSUK2C7.js → chunk-PJ5HXNBG.js} +11 -11
- package/dist/{chunk-6OSUK2C7.js.map → chunk-PJ5HXNBG.js.map} +1 -1
- package/dist/{chunk-ILNO4ZJ6.js → chunk-PKGBW7KS.js} +2 -2
- package/dist/{chunk-NTJUAPJM.js → chunk-PZPTTAO5.js} +7 -7
- package/dist/{chunk-HCYRCU4W.js → chunk-QJWIX4YZ.js} +2 -2
- package/dist/{chunk-IL4FCC54.js → chunk-RREWYOKS.js} +2 -2
- package/dist/{chunk-6D2PFC5C.js → chunk-SKOAJPOS.js} +2 -2
- package/dist/{chunk-PIIPEXRM.js → chunk-TVMSXL3R.js} +1 -1
- package/dist/chunk-TVMSXL3R.js.map +1 -0
- package/dist/chunk-U3HEYECF.js +68 -0
- package/dist/chunk-U3HEYECF.js.map +1 -0
- package/dist/{chunk-QHP5PZNC.js → chunk-U57NFQYE.js} +2 -1
- package/dist/chunk-U57NFQYE.js.map +1 -0
- package/dist/{chunk-6QBT5TPS.js → chunk-USZMUOI6.js} +3 -3
- package/dist/{chunk-ARJIKW56.js → chunk-UZCQHNXC.js} +2 -2
- package/dist/{chunk-ZYJZHXFU.js → chunk-VWW2EXH7.js} +4 -4
- package/dist/{chunk-PQ7RWH7L.js → chunk-VZCZAHMX.js} +5 -5
- package/dist/{chunk-I3CQBEKS.js → chunk-WF3P7GE5.js} +2 -2
- package/dist/{chunk-U47KRLEW.js → chunk-YP7SQ5DM.js} +22 -10
- package/dist/chunk-YP7SQ5DM.js.map +1 -0
- package/dist/chunk-ZMUXC3VB.js +11 -0
- package/dist/chunk-ZMUXC3VB.js.map +1 -0
- package/dist/{chunk-HH7PM5HT.js → chunk-ZUQX7XHJ.js} +2 -2
- package/dist/data-display/Avatar.js +3 -3
- package/dist/data-display/Badge.js +2 -2
- package/dist/data-display/CardKit.js +9 -9
- package/dist/data-display/Chart.js +10 -10
- package/dist/data-display/DataViews.js +38 -36
- package/dist/data-display/Popover.js +1 -1
- package/dist/en-US.js +1 -1
- package/dist/locales.js +2 -2
- package/dist/mui/styles.js +2 -1
- package/dist/mui/styles.js.map +1 -1
- package/dist/navigation/SectionNav.js +9 -9
- package/dist/pt-BR.js +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-geometry.d.ts +9 -3
- package/dist/types/components/data-display/DataViews/base-list-card-geometry.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-gutters.d.ts +2 -2
- package/dist/types/components/data-display/DataViews/base-list-card-gutters.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-layout.d.ts +1 -0
- package/dist/types/components/data-display/DataViews/base-list-card-layout.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-slots.d.ts +1 -10
- package/dist/types/components/data-display/DataViews/base-list-card-slots.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card.d.ts +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts +7 -0
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-export.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/list-card-breaks.d.ts +21 -0
- package/dist/types/components/data-display/DataViews/list-card-breaks.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/list-card-cells.d.ts +8 -0
- package/dist/types/components/data-display/DataViews/list-card-cells.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/list-card-group-tracks.d.ts +51 -0
- package/dist/types/components/data-display/DataViews/list-card-group-tracks.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/list-card-rails.d.ts +33 -13
- package/dist/types/components/data-display/DataViews/list-card-rails.d.ts.map +1 -1
- package/dist/types/components/data-display/Popover/Popover.d.ts.map +1 -1
- package/dist/types/en-US.data-display.d.ts.map +1 -1
- package/dist/types/mui/styles.d.ts +1 -1
- package/dist/types/mui/styles.d.ts.map +1 -1
- package/dist/types/pt-BR.data-display.d.ts.map +1 -1
- package/dist/user-avatar.js +4 -4
- package/package.json +1 -1
- package/src/components/data-display/DataViews/base-list-card-geometry.tsx +22 -8
- package/src/components/data-display/DataViews/base-list-card-gutters.tsx +2 -2
- package/src/components/data-display/DataViews/base-list-card-layout.tsx +6 -3
- package/src/components/data-display/DataViews/base-list-card-slots.tsx +5 -5
- package/src/components/data-display/DataViews/base-list-card.tsx +3 -3
- package/src/components/data-display/DataViews/data-views-copy.ts +7 -0
- package/src/components/data-display/DataViews/data-views-export.tsx +1 -9
- package/src/components/data-display/DataViews/list-card-breaks.ts +21 -0
- package/src/components/data-display/DataViews/list-card-cells.tsx +16 -0
- package/src/components/data-display/DataViews/list-card-group-tracks.tsx +127 -0
- package/src/components/data-display/DataViews/list-card-rails.tsx +58 -30
- package/src/components/data-display/Popover/Popover.tsx +10 -3
- package/src/en-US.data-display.ts +4 -0
- package/src/mui/styles.ts +1 -1
- package/src/pt-BR.data-display.ts +4 -0
- package/dist/chunk-CMBZ3J6I.js.map +0 -1
- package/dist/chunk-COYGTEN5.js.map +0 -1
- package/dist/chunk-NHVL2QPG.js.map +0 -1
- package/dist/chunk-PIIPEXRM.js.map +0 -1
- package/dist/chunk-QHP5PZNC.js.map +0 -1
- package/dist/chunk-QKAYXAQE.js.map +0 -1
- package/dist/chunk-U47KRLEW.js.map +0 -1
- package/dist/chunk-V4V2N6YJ.js.map +0 -1
- package/dist/chunk-ZWBGQYVO.js.map +0 -1
- /package/dist/{chunk-W7N4ORCV.js.map → chunk-3JYCS7VO.js.map} +0 -0
- /package/dist/{chunk-YIKFYWKD.js.map → chunk-46ZATLQV.js.map} +0 -0
- /package/dist/{chunk-TF27Z27K.js.map → chunk-4JZ6XDVA.js.map} +0 -0
- /package/dist/{chunk-EDBP62WG.js.map → chunk-53ACGKBW.js.map} +0 -0
- /package/dist/{chunk-EWIKSTJV.js.map → chunk-5WJFCQFN.js.map} +0 -0
- /package/dist/{chunk-WBDQSBLV.js.map → chunk-5XFJCWPY.js.map} +0 -0
- /package/dist/{chunk-HPO7PB4F.js.map → chunk-7AAJYWC3.js.map} +0 -0
- /package/dist/{chunk-XW5SEW3H.js.map → chunk-AKC5GRJF.js.map} +0 -0
- /package/dist/{chunk-4QKS5Y35.js.map → chunk-EBSA4EYR.js.map} +0 -0
- /package/dist/{chunk-2W2MWEP2.js.map → chunk-EFLRNSE6.js.map} +0 -0
- /package/dist/{chunk-PC4H5LVB.js.map → chunk-EUPUEMFX.js.map} +0 -0
- /package/dist/{chunk-4PPNCZWY.js.map → chunk-GS5EPYB4.js.map} +0 -0
- /package/dist/{chunk-JVOEVTCZ.js.map → chunk-HQCZT6TO.js.map} +0 -0
- /package/dist/{chunk-GK7JNSMK.js.map → chunk-IK2ZVV3M.js.map} +0 -0
- /package/dist/{chunk-3FMWQQW6.js.map → chunk-L4Z7B7KL.js.map} +0 -0
- /package/dist/{chunk-3K7WN2PO.js.map → chunk-NBM3YJ4P.js.map} +0 -0
- /package/dist/{chunk-CTIMTEH7.js.map → chunk-NFCAXQ3F.js.map} +0 -0
- /package/dist/{chunk-GYDUXL3D.js.map → chunk-NVXRV3PL.js.map} +0 -0
- /package/dist/{chunk-ILNO4ZJ6.js.map → chunk-PKGBW7KS.js.map} +0 -0
- /package/dist/{chunk-NTJUAPJM.js.map → chunk-PZPTTAO5.js.map} +0 -0
- /package/dist/{chunk-HCYRCU4W.js.map → chunk-QJWIX4YZ.js.map} +0 -0
- /package/dist/{chunk-IL4FCC54.js.map → chunk-RREWYOKS.js.map} +0 -0
- /package/dist/{chunk-6D2PFC5C.js.map → chunk-SKOAJPOS.js.map} +0 -0
- /package/dist/{chunk-6QBT5TPS.js.map → chunk-USZMUOI6.js.map} +0 -0
- /package/dist/{chunk-ARJIKW56.js.map → chunk-UZCQHNXC.js.map} +0 -0
- /package/dist/{chunk-ZYJZHXFU.js.map → chunk-VWW2EXH7.js.map} +0 -0
- /package/dist/{chunk-PQ7RWH7L.js.map → chunk-VZCZAHMX.js.map} +0 -0
- /package/dist/{chunk-I3CQBEKS.js.map → chunk-WF3P7GE5.js.map} +0 -0
- /package/dist/{chunk-HH7PM5HT.js.map → chunk-ZUQX7XHJ.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-export.tsx"],"sourcesContent":["\"use client\";\n\nimport DownloadRoundedIcon from \"@mui/icons-material/DownloadRounded\";\nimport KeyboardArrowDownRoundedIcon from \"@mui/icons-material/KeyboardArrowDownRounded\";\nimport CircularProgress from \"@mui/material/CircularProgress/index.js\";\nimport Popover from \"@mui/material/Popover/index.js\";\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\nimport { useState } from \"react\";\n\nimport { useDataViewsCopy } from \"./data-views-copy-context\";\nimport { Button } from \"../../form/Button\";\nimport { Box } from \"../../../mui/Box\";\nimport { Text } from \"../../typography/Text\";\n\nimport type { DataViewQuery } from \"./data-views-types\";\nimport { rem, sxRem } from \"../../../tokens/relative\";\n\n/**\n * EXPORT — the current QUERY, never the rendered page.\n *\n * Exporting what happens to be on screen is the single most common bug in an\n * admin table: the operator filtered 214 records, sees 25, exports, and gets\n * 25 — with nothing anywhere saying so. So this control does not touch the\n * loaded rows at all. It hands the host the same `DataViewQuery` the grid is\n * showing, unpaginated, and the HOST re-queries the backend — the same\n * division as everywhere else here: the component emits, the host fetches.\n *\n * The menu states the number it is about to export before the click, so the\n * two possible answers (the selection, or the whole filtered set) are never a\n * guess.\n */\n\n/** What a host can be asked to produce. */\nexport type DataViewExportFormat = \"xlsx\" | \"csv\" | \"json\";\n\n/** The request handed to the host when the operator picks a format. */\nexport interface DataViewExportRequest {\n format: DataViewExportFormat;\n /**\n * The live query with `page: 1` and `pageSize` set to the whole matched\n * total — i.e. \"everything this filter selects\", not this page.\n */\n query: DataViewQuery;\n /**\n * The selected row ids, when the operator has a selection. The host filters\n * the re-queried rows to these; absent means the whole filtered set.\n */\n selectedIds?: Array<string | number>;\n /** The visible columns, in the operator's current order. */\n columns: { id: string; label: string }[];\n}\n\n/** Injected export. Absent ⇒ no Exportar control, exactly like `renderCard`. */\nexport interface DataViewExport {\n /** Runs the export. Awaited, so the trigger can show it is working. */\n onExport: (request: DataViewExportRequest) => Promise<void> | void;\n /** Formats to offer, in menu order. Defaults to all three. */\n formats?: DataViewExportFormat[];\n}\n\n/** One line per format: what it is, and when to reach for it. */\n\nconst ALL_FORMATS: DataViewExportFormat[] = [\"xlsx\", \"csv\", \"json\"];\n\ninterface ExportMenuProps {\n config: DataViewExport;\n /** The live query — copied and unpaginated before it reaches the host. */\n query: DataViewQuery;\n /** The unpaginated total, so the label can state what \"tudo\" means. */\n totalCount: number;\n selectedIds: Array<string | number>;\n columns: { id: string; label: string }[];\n testIdPrefix: string;\n /** Render icon-only (measured upstream). */\n compact?: boolean;\n}\n\n/** \"Exportando 214 itens filtrados\" / \"3 itens selecionados\" — never a guess. */\nfunction scopeLabel(selected: number, total: number): string {\n if (selected > 0) {\n return `${selected} ${selected === 1 ? \"item selecionado\" : \"itens selecionados\"}`;\n }\n return `${total} ${total === 1 ? \"item filtrado\" : \"itens filtrados\"}`;\n}\n\n/** The trigger. Shows a spinner while the host's export is still running. */\nfunction ExportTrigger({\n busy,\n onOpen,\n testIdPrefix,\n compact,\n}: {\n busy: boolean;\n onOpen: (anchor: HTMLElement) => void;\n testIdPrefix: string;\n /** Icon only — step 2 of the toolbar's degradation ladder. */\n compact?: boolean;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n const theme = useTheme();\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n color=\"neutral\"\n disabled={busy}\n onClick={(event) => onOpen(event.currentTarget as HTMLElement)}\n dataTestId={`${testIdPrefix}-export-trigger`}\n aria-label={copy.export.trigger}\n // The label is gone, so the tooltip is the only thing naming the control.\n title={compact ? copy.export.trigger : undefined}\n >\n <Box component=\"span\" sx={{ display: \"inline-flex\", alignItems: \"center\", gap: 0.5 }}>\n {busy ? <CircularProgress size={rem(theme, 14)} /> : <DownloadRoundedIcon fontSize=\"small\" />}\n {!compact && (\n <Box component=\"span\" sx={{ display: { xs: \"none\", sm: \"inline\" } }}>\n {copy.export.triggerLabel}\n </Box>\n )}\n {/* Dropped with the label — see the note on the Exibir trigger. */}\n {!compact && <KeyboardArrowDownRoundedIcon fontSize=\"small\" />}\n </Box>\n </Button>\n );\n}\n\n/** One format row: what it produces, and when to reach for it. */\nfunction FormatRow({\n format,\n onPick,\n testIdPrefix,\n}: {\n format: DataViewExportFormat;\n onPick: () => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n return (\n <Box\n component=\"button\"\n type=\"button\"\n onClick={onPick}\n data-testid={`${testIdPrefix}-export-${format}`}\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n width: \"100%\",\n px: 1.5,\n py: 1,\n border: 0,\n background: \"none\",\n cursor: \"pointer\",\n font: \"inherit\",\n textAlign: \"left\",\n \"&:hover\": { bgcolor: \"action.hover\" },\n }}\n >\n <Box component=\"span\" sx={{ fontSize: sxRem(13) }}>\n {copy.export.formats[format]?.label ?? format}\n </Box>\n <Box component=\"span\" sx={{ fontSize: sxRem(11), color: \"text.disabled\" }}>\n {copy.export.formats[format]?.hint ?? \"\"}\n </Box>\n </Box>\n );\n}\n\n/** The panel: what is about to be exported, then the formats. */\nfunction ExportPanel({\n formats,\n selectedCount,\n totalCount,\n columnCount,\n onPick,\n testIdPrefix,\n}: {\n formats: DataViewExportFormat[];\n selectedCount: number;\n totalCount: number;\n columnCount: number;\n onPick: (format: DataViewExportFormat) => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n return (\n <Box data-testid={`${testIdPrefix}-export-panel`}>\n <Box sx={{ px: 1.5, pt: 1, pb: 1, borderBottom: 1, borderColor: \"divider\" }}>\n <Text variant=\"caption\" as=\"p\">\n <Box component=\"span\" data-testid={`${testIdPrefix}-export-scope`}>\n Exportando {scopeLabel(selectedCount, totalCount)}\n </Box>\n </Text>\n <Text variant=\"caption\" as=\"p\">\n <Box component=\"span\" sx={{ color: \"text.disabled\" }}>\n {copy.export.visibleColumns(columnCount)}\n </Box>\n </Text>\n </Box>\n {formats.map((format) => (\n <FormatRow\n key={format}\n format={format}\n onPick={() => onPick(format)}\n testIdPrefix={testIdPrefix}\n />\n ))}\n </Box>\n );\n}\n\n/** The toolbar's Exportar control. Renders nothing when no host wired it. */\nexport function DataViewsExportMenu({\n config,\n query,\n totalCount,\n selectedIds,\n columns,\n testIdPrefix,\n compact,\n}: ExportMenuProps): React.JSX.Element {\n const [anchor, setAnchor] = useState<HTMLElement | null>(null);\n const [busy, setBusy] = useState(false);\n\n const run = async (format: DataViewExportFormat): Promise<void> => {\n setAnchor(null);\n setBusy(true);\n try {\n await config.onExport({\n format,\n // UNPAGINATED: page 1 of a page as large as the whole result. The host\n // re-queries with this; nothing here reads the loaded rows.\n query: { ...query, page: 1, pageSize: Math.max(1, totalCount) },\n selectedIds: selectedIds.length > 0 ? [...selectedIds] : undefined,\n columns,\n });\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <>\n <ExportTrigger busy={busy} onOpen={setAnchor} testIdPrefix={testIdPrefix} compact={compact} />\n <Popover\n open={Boolean(anchor)}\n anchorEl={anchor}\n onClose={() => setAnchor(null)}\n anchorOrigin={{ vertical: \"bottom\", horizontal: \"right\" }}\n transformOrigin={{ vertical: \"top\", horizontal: \"right\" }}\n slotProps={{ paper: { sx: { width: sxRem(260), maxWidth: (theme: Theme) => `calc(100vw - ${rem(theme, 32)})` } } }}\n >\n <ExportPanel\n formats={config.formats ?? ALL_FORMATS}\n selectedCount={selectedIds.length}\n totalCount={totalCount}\n columnCount={columns.length}\n onPick={(format) => void run(format)}\n testIdPrefix={testIdPrefix}\n />\n </Popover>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,OAAO,yBAAyB;AAChC,OAAO,kCAAkC;AACzC,OAAO,sB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A,UAAC;AAAA;AAAA,YACC,SAAS,OAAO,WAAW;AAAA,YAC3B,eAAe,YAAY;AAAA,YAC3B;AAAA,YACA,aAAa,QAAQ;AAAA,YACrB,QAAQ,CAAC,WAAW,KAAK,IAAI,MAAM;AAAA,YACnC;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/list-card-cells.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\nimport { Box } from \"../../../mui/Box\";\nimport { sxRem } from \"../../../tokens/relative\";\n\n/**\n * THE CELL CONFIG — the list declares its columns once, every row obeys them.\n *\n * The row used to name its middle slots: a title, a subtitle beneath it, then\n * labelled `meta` pairs, then a value, then a status. That vocabulary was the\n * mistake twice over. It reads as a description of every list, and no list is\n * quite that shape — so a consumer wanting a date over a time, or an order\n * number over the client who placed it, had to pick whichever named slot was\n * least wrong and take its styling with it. And because each row decided its own\n * content, alignment across a list was a convention the rows could break.\n *\n * So cells are CONFIGURED, the way a data grid's columns are: the list declares\n * them once, and every card renders the same columns in the same tracks from its\n * own row. Two cards cannot disagree about the shape of the list, because\n * neither of them is deciding it.\n *\n * THE SECOND LINE IS AN OPTION, NOT A SUBTITLE. `secondary` is not \"the small\n * grey text under the title\" — it is the cell's second line, for whatever pairs\n * naturally in this list: date over time, name over e-mail, pedido over cliente.\n * It carries no meaning the config did not put there, and a cell that wants one\n * line simply omits it.\n */\nexport interface ListCardCellConfig<T extends Record<string, unknown> = Record<string, unknown>> {\n /** Stable key. Also the cell's `data-slot`, so a test can find it by name. */\n id: string;\n /** The cell's first line, from the row. */\n primary: (row: T) => ReactNode;\n /** An optional second line beneath it. Anything that pairs with the first. */\n secondary?: (row: T) => ReactNode;\n /**\n * Which edge the lines sit on. `end` is what a column of numbers wants, so its\n * digits line up with the values above and below it — and it switches the cell\n * to tabular figures, since nothing else ever asks for that alignment.\n */\n align?: \"start\" | \"center\" | \"end\";\n /**\n * This cell's track, as a `grid-template-columns` entry. Defaults to an even\n * share of the spare width.\n *\n * A cell holding a number usually wants `max-content`: the rail is then as\n * wide as the widest amount in the list and no wider, and its right edge does\n * not move when a longer row arrives.\n */\n width?: string;\n /** Emphasise the first line — for the one figure the row is really about. */\n strong?: boolean;\n}\n\nconst ALIGN_ITEMS = { start: \"flex-start\", center: \"center\", end: \"flex-end\" } as const;\nconst TEXT_ALIGN = { start: \"left\", center: \"center\", end: \"right\" } as const;\n\n/** The default track: an even share of whatever width the row has spare. */\nexport const DEFAULT_CELL_WIDTH = \"minmax(0, 1fr)\";\n\n/** The tracks a cell config asks for, in order. */\nexport function cellTracks(cells: readonly ListCardCellConfig<never>[] | undefined): string[] {\n return (cells ?? []).map((cell) => cell.width ?? DEFAULT_CELL_WIDTH);\n}\n\n/**\n * The config handed down by the list.\n *\n * A card inside a group takes its columns from here rather than from props, so\n * there is exactly one declaration of the list's shape and no way for a row to\n * hold a different one.\n */\nconst CellConfigContext = createContext<readonly ListCardCellConfig<never>[] | null>(null);\n\nexport function CellConfigProvider({\n cells,\n children,\n}: {\n cells: readonly ListCardCellConfig<never>[] | undefined;\n children: ReactNode;\n}): React.JSX.Element {\n return <CellConfigContext.Provider value={cells ?? null}>{children}</CellConfigContext.Provider>;\n}\n\n/** The list's cell config, if it declared one. */\nexport function useCellConfig(): readonly ListCardCellConfig<never>[] | null {\n return useContext(CellConfigContext);\n}\n\n/**\n * One cell rendered from its config.\n *\n * Both lines truncate rather than wrap: a row is a fixed-height scanning unit,\n * and a cell that grows to two lines because one name was long drags every rail\n * on that row down with it. Whatever does not fit belongs in the expandable\n * body, which is the entire reason the body exists.\n */\nfunction Cell<T extends Record<string, unknown>>({\n config,\n row,\n}: {\n config: ListCardCellConfig<T>;\n row: T;\n}): React.JSX.Element {\n const align = config.align ?? \"start\";\n const numeric = align === \"end\" ? { fontVariantNumeric: \"tabular-nums\" } : {};\n const clamp = {\n minWidth: 0,\n maxWidth: \"100%\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n } as const;\n const secondary = config.secondary?.(row);\n return (\n <Box\n data-slot={`cell-${config.id}`}\n sx={{\n minWidth: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: ALIGN_ITEMS[align],\n justifyContent: \"center\",\n textAlign: TEXT_ALIGN[align],\n }}\n >\n <Box\n component=\"span\"\n sx={{ ...clamp, fontSize: sxRem(14), fontWeight: config.strong ? 700 : 600, lineHeight: 1.25, ...numeric }}\n >\n {config.primary(row)}\n </Box>\n {secondary != null && (\n <Box\n component=\"span\"\n sx={{ ...clamp, fontSize: sxRem(12.5), lineHeight: 1.3, color: \"text.secondary\", ...numeric }}\n >\n {secondary}\n </Box>\n )}\n </Box>\n );\n}\n\n/** Every configured cell of a row, in the list's declared order. */\nexport function ListCardCells<T extends Record<string, unknown>>({\n cells,\n row,\n}: {\n cells: readonly ListCardCellConfig<T>[];\n row: T;\n}): React.JSX.Element {\n return (\n <>\n {cells.map((config) => (\n <Cell key={config.id} config={config} row={row} />\n ))}\n </>\n );\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,eAAe,kBAAkC;AAgFjD,SAwEL,UAxEK,KAkCL,YAlCK;AA3BT,IAAM,cAAc,EAAE,OAAO,cAAc,QAAQ,UAAU,KAAK,WAAW;AAC7E,IAAM,aAAa,EAAE,OAAO,QAAQ,QAAQ,UAAU,KAAK,QAAQ;AAG5D,IAAM,qBAAqB;AAG3B,SAAS,WAAW,OAAmE;AAC5F,UAAQ,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,KAAK,SAAS,kBAAkB;AACrE;AASA,IAAM,oBAAoB,cAA2D,IAAI;AAElF,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AACF,GAGsB;AACpB,SAAO,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,SAAS,MAAO,UAAS;AACrE;AAGO,SAAS,gB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version":3,"sources":["../src/en-US.data-display.ts"],"sourcesContent":["/**\n * The en-US pack for the data-display family. Split the same way\n * `pt-BR.data-display.ts` is — see `en-US.ts` for why.\n */\nimport type { DataViewsCopy } from \"./components/data-display/DataViews/data-views-copy\";\nimport type {\n CarouselCopy,\n DataGridCopy,\n DataStateCopy,\n LightboxCopy,\n MapPreviewCopy,\n TimingDiagramCopy,\n} from './copy';\nimport { EN_US_TABLE_FILTER_COPY } from './en-US.layout';\nimport {\n EN_US_CATEGORY_SELECT_COPY,\n EN_US_CONFIRM_ACTION_COPY,\n EN_US_SAVED_VIEWS_LABELS,\n} from './en-US.shared';\n\nexport const EN_US_LIGHTBOX_COPY: LightboxCopy = {\n close: \"Close\",\n previous: \"Previous\",\n next: \"Next\",\n zoomIn: \"Zoom in\",\n zoomOut: \"Zoom out\",\n resetZoom: \"Reset zoom\",\n play: \"Start the slideshow\",\n pause: \"Pause the slideshow\",\n dialogLabel: \"Lightbox\",\n itemPosition: (index, total) => `Item ${index} of ${total}`,\n videoFallback: (index, total) => `Video ${index} of ${total}`,\n imageFallback: (index, total) => `Image ${index} of ${total}`,\n thumbnailFallback: (index) => `Thumbnail ${index}`,\n};\n\nexport const EN_US_DATA_GRID_COPY: DataGridCopy = {\n sortBy: (header) => `Sort by ${header}`,\n selectRow: (rowNumber) => `Select row ${rowNumber}`,\n selectAllRows: \"Select all rows\",\n expandRow: \"Expand row\",\n collapseRow: \"Collapse row\",\n gridLabel: \"Data grid\",\n};\n\nexport const EN_US_MAP_PREVIEW_COPY: MapPreviewCopy = {\n zoomIn: \"Zoom in\",\n zoomOut: \"Zoom out\",\n center: \"Centre the map\",\n mapType: \"Change the map type\",\n fullscreen: \"Full screen\",\n search: \"Search for an address\",\n};\n\nexport const EN_US_CAROUSEL_COPY: CarouselCopy = {\n previous: \"Previous\",\n next: \"Next\",\n};\n\nexport const EN_US_TIMING_DIAGRAM_COPY: TimingDiagramCopy = {\n regionLabel: \"Timing diagram\",\n heading: \"Request timing\",\n dns: \"DNS Lookup\",\n connect: \"Connection\",\n ssl: \"SSL/TLS\",\n request: \"Request\",\n response: \"Response\",\n total: (formatted) => `Total: ${formatted}`,\n totalTime: (formatted) => `Total Time: ${formatted}`,\n};\n\nexport const EN_US_DATA_STATE_COPY: DataStateCopy = {\n empty: \"Nothing here\",\n loading: \"Loading…\",\n endOfList: \"No more items to load\",\n dismissAlert: \"Dismiss\",\n dismissBanner: \"Dismiss this banner\",\n};\n\nexport const EN_US_DATA_VIEWS_COPY: DataViewsCopy = {\n savedViewsMenu: EN_US_SAVED_VIEWS_LABELS,\n confirmAction: EN_US_CONFIRM_ACTION_COPY,\n categorySelect: EN_US_CATEGORY_SELECT_COPY,\n board: {\n countOnPage: (label, count) => `${label}: ${count} on this page`,\n onThisPage: (count) => `${count} on this page`,\n pageSum: (sum) => `This page totals ${sum}`,\n emptyColumn: \"Nothing at this stage\",\n pageScopeNote: \"The counts and totals below cover only the items on this page.\",\n },\n deleteView: {\n title: \"Delete view\",\n target: (viewName) => `Delete \"${viewName}\"?`,\n sharedWarning: \"This view is shared — the team will lose access to it.\",\n // `entityLabel` is the HOST's word for what the rows are, so the sentence is\n // built around it rather than naming a noun of its own.\n rowsUnaffected: (entityLabel) =>\n `${entityLabel} are not affected; only the saved slice is removed.`,\n confirm: \"Delete view\",\n cancel: \"Cancel\",\n },\n manageViews: {\n title: \"Manage views\",\n empty: \"No saved views.\",\n edit: \"Edit\",\n defaultTag: \"Default\",\n otherUserTag: \"Another user's\",\n deleteTitle: \"Delete this saved view?\",\n deleteBody: \"The filters and columns it holds are lost. This cannot be undone.\",\n deleteConfirm: \"Delete\",\n },\n saveView: {\n sharedDescription: \"Anyone in the store will be able to open and use this view.\",\n setDefaultTitle: \"Set as default\",\n setDefaultDescription: \"This screen opens on this view instead of the Main view.\",\n previewHeading: \"What this view holds\",\n previewUnchanged: \"Nothing has changed — this view will match the Main view.\",\n sortRowLabel: \"Sorting\",\n saveFailed: \"Could not save the view.\",\n titleEditing: \"Edit view\",\n titleCreating: \"Save view\",\n descriptionLabel: \"Description — optional\",\n descriptionPlaceholder: \"What this view is for\",\n submitEditing: \"Save changes\",\n submitCreating: \"Save view\",\n nameLabel: \"Name\",\n cancel: \"Cancel\",\n pinnedTitle: \"Pin to the sidebar\",\n pinnedDescription: \"Appears as a shortcut in the menu, under this screen.\",\n sharedTitle: \"Share with the team\",\n namePlaceholder: \"e.g. Declined card payments this week\",\n previewFilters: \"Filters\",\n previewHiddenColumns: \"Hidden columns\",\n },\n columns: {\n visibleCount: (visible, total) => `${visible} of ${total} visible`,\n reset: \"Default\",\n showAll: \"Show all\",\n dragHint: \"Drag to reorder the columns.\",\n moveUp: (columnLabel) => `Move ${columnLabel} up`,\n moveDown: (columnLabel) => `Move ${columnLabel} down`,\n },\n display: {\n sortTab: \"Sort\",\n columnsTab: \"Columns\",\n panelTab: \"Display\",\n direction: \"Direction\",\n layoutHints: {\n table: \"Comparable columns, good for scanning numbers.\",\n list: \"One row per item, with the key fields.\",\n cards: \"Larger blocks, good for a handful of items.\",\n board: \"A column per stage, for tracking what is where.\",\n },\n densityHeadings: {\n table: \"Row height\",\n list: \"Row height\",\n cards: \"Cards per row\",\n board: \"Column width\",\n },\n densityLabels: {\n table: { compact: \"Low\", cozy: \"Medium\", comfortable: \"High\" },\n list: { compact: \"Low\", cozy: \"Medium\", comfortable: \"High\" },\n cards: { compact: \"Many\", cozy: \"Some\", comfortable: \"Few\" },\n board: { compact: \"Narrow\", cozy: \"Medium\", comfortable: \"Wide\" },\n },\n boardUnavailable: \"This screen declares no stages, so it offers no board.\",\n densityUnavailableNarrow:\n \"One card per row at this width — density returns on larger screens.\",\n trigger: \"Display\",\n fieldHeading: \"Field\",\n formatHeading: \"Format\",\n cardZoom: \"Card size\",\n },\n export: {\n formats: {\n // The extension is the file's, not a word: it stays as it is written on\n // disk in every language.\n json: { label: \"JSON (.json)\", hint: \"For integrations\" },\n },\n visibleColumns: (columnCount) => `${columnCount} visible columns, in their current order`,\n trigger: \"Export\",\n triggerLabel: \"Export\",\n },\n tableFilter: EN_US_TABLE_FILTER_COPY,\n grid: {\n ...EN_US_DATA_GRID_COPY,\n rowActions: \"Actions\",\n bulkActions: (selectedCount) => `Actions (${selectedCount}) ▾`,\n emptyFilteredTitle: \"No results for these filters\",\n emptyFilteredHint: \"Adjust or remove the filters.\",\n emptyFilteredAction: \"Clear filters\",\n },\n filters: {\n moreFilters: (count) => `More filters: ${count} did not fit in the bar`,\n moreFiltersApplied: (count, appliedCount) =>\n `More filters: ${count} did not fit in the bar, ${appliedCount} applied`,\n moreTriggerLabel: \"More\",\n moreHeading: \"More filters\",\n overflowNote: \"did not fit in the bar\",\n rangeEnd: \"To\",\n rangeInvalid: \"The start must be earlier than the end.\",\n rangeInclusiveNote: \"Both dates are included in the result.\",\n rangeStart: \"From\",\n // The mask is what the reader TYPES, so it follows their own date order\n // rather than being carried over. A translated label above an unchanged\n // mask is the shape that gets a date entered backwards.\n dayMask: \"mm/dd/yyyy\",\n clearAllFilters: \"Clear all filters\",\n // The KEYS are the package's own preset ids and stay as they are — the\n // surface matches on them. Only the labels beside them are words.\n rangePresets: {\n hoje: \"Today\",\n ontem: \"Yesterday\",\n semana: \"This week\",\n mes: \"This month\",\n ano: \"This year\",\n },\n scopesLabel: \"Status\",\n panelTitle: \"Filters\",\n clear: \"Clear\",\n clearAll: \"Clear filters\",\n clearRange: (label) => `Clear ${label}`,\n allOption: \"All\",\n optionSearchPlaceholder: \"Search…\",\n optionsEmpty: \"No results\",\n optionsHeading: \"Options\",\n },\n selection: {\n selectAllOnPage: \"Select all on this page\",\n clearSelection: \"Clear selection\",\n selectAll: \"Select all\",\n onThisPage: (count) => `${count} on this page`,\n selectedCount: (count) => `${count} ${count === 1 ? \"item selected\" : \"items selected\"}`,\n selectRow: \"Select\",\n expandRow: \"Expand details\",\n collapseRow: \"Collapse details\",\n },\n nav: {\n mainView: \"Main view\",\n defaultTag: \"Default\",\n viewOptions: (viewName) => `${viewName} options`,\n emptyHint: \"No saved views. Adjust filters, columns or sorting and save below.\",\n setDefault: \"Set as default\",\n deleteView: \"Delete view\",\n unsavedChanges: \"Unsaved changes\",\n label: \"View\",\n update: \"Update view\",\n save: \"Save view\",\n saveAs: \"Save as new\",\n reset: \"Reset\",\n updateFailed: \"Could not update the view\",\n dismissError: \"Dismiss\",\n goBack: \"Back\",\n pageSize: \"Show:\",\n saveFailed: \"Could not save the change to the view.\",\n editView: \"Rename and edit\",\n pinToSidebar: \"Pin to the sidebar\",\n shareWithTeam: \"Share with the team\",\n },\n search: {\n placeholder: \"Search…\",\n allColumnsLabel: \"Search every column\",\n keywordPlaceholder: \"Press Enter to filter\",\n open: \"Search\",\n close: \"Close search\",\n clear: \"Clear search\",\n },\n};\n"],"mappings":";;;;;;;;;;AAoBO,IAAM,sBAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc,CAAC,OAAO,UAAU,QAAQ,KAAK,OAAO,KAAK;AAAA,EACzD,eAAe,CAAC,OAAO,UAAU,SAAS,KAAK,OAAO,KAAK;AAAA,EAC3D,eAAe,CAAC,OAAO,UAAU,SAAS,KAAK,OAAO,KAAK;AAAA,EAC3D,mBAAmB,CAAC,UAAU,aAAa,KAAK;AAClD;AAEO,IAAM,uBAAqC;AAAA,EAChD,QAAQ,CAAC,WAAW,WAAW,MAAM;AAAA,EACrC,WAAW,CAAC,cAAc,cAAc,SAAS;AAAA,EACjD,eAAe;AAAA,EACf,WAAW;AAAA,EACX,aAAa;AAAA,EACb,WAAW;AACb;AAEO,IAAM,yBAAyC;AAAA,EACpD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AACV;AAEO,IAAM,sBAAoC;AAA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YAAY;AAAA,IACZ,aAAa,CAAC,aAAa,GAAG,QAAQ;AAAA,IACtC,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,cAAc;AAAA,IACd,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,eAAe;AAAA,EACjB;AAAA,EACA,QAAQ;AAAA,IACN,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/base-list-card-gutters.tsx"],"sourcesContent":["\"use client\";\n\nimport KeyboardArrowRightIcon from \"@mui/icons-material/KeyboardArrowRight\";\nimport IconButton from \"@mui/material/IconButton/index.js\";\n\nimport { Checkbox } from \"../../form/Checkbox\";\nimport { Box } from \"../../../mui/Box\";\nimport { sxRem } from \"../../../tokens/relative\";\n\nimport { DragHandle, useDragItem } from \"./data-views-drag\";\nimport { useDataViewsCopy } from \"./data-views-copy-context\";\n\n/**\n * THE THREE GUTTERS AT THE HEAD OF A ROW — the disclosure chevron, the drag grip\n * and the select checkbox.\n *\n * Split from `base-list-card` at the size gate. All three answer the same\n * question in the same way: whether to occupy a rail, hold one open, or leave\n * the template altogether. See `railsTemplateFor` for why the third option has\n * to exist.\n */\n\n/**\n * MUI's Checkbox carries 9px of hit-area padding on every side.\n *\n * Left uncancelled, a row asking for 8px of padding puts the checkbox SQUARE 17px\n * in — and with the empty drag gutter's gap ahead of it, 46px in, which is what\n * made the left edge look like a mistake. The hit area is worth keeping; the\n * optical inset is not, so the padding is cancelled with a negative margin and\n * the glyph lands where the row's own padding says it should.\n */\nconst CHECKBOX_PAD = sxRem(-9);\n\n/** The grip. Its gutter is reserved only when the list says to reserve it. */\nexport function DragSlot({\n drag,\n reserve,\n testId,\n}: {\n drag: ReturnType<typeof useDragItem>;\n reserve: boolean;\n testId?: string;\n}): React.JSX.Element | null {\n if (!drag.draggable) return reserve ? <Box data-slot=\"drag\" /> : null;\n return (\n // display:flex, as on the checkbox below: the grip is an inline-grid, and in\n // a block parent an inline box sits on the text baseline — the line box adds\n // descender leading under it (21px glyph in a 31px slot) and drops the grip\n // 5px below the row's centre. A flex parent has no baseline to sit on.\n <Box\n data-slot=\"drag\"\n sx={{ position: \"relative\", zIndex: 1, display: \"flex\", alignItems: \"center\" }}\n >\n <DragHandle\n handleProps={drag.handleProps}\n gated={drag.handleProps !== undefined}\n testId={testId}\n />\n </Box>\n );\n}\n\n/** The select checkbox. Its gutter is reserved only when the list says to. */\nexport function SelectSlot({\n selectable,\n selected,\n reserve,\n onToggleSelect,\n testId,\n}: {\n selectable: boolean;\n selected: boolean;\n reserve: boolean;\n onToggleSelect?: (event?: React.MouseEvent) => void;\n testId?: string;\n}): React.JSX.Element | null {\n const copy = useDataViewsCopy();\n if (!selectable) return reserve ? <Box data-slot=\"select\" /> : null;\n return (\n // z-index 1: above the stretched link, or the anchor swallows the click.\n <Box\n data-slot=\"select\"\n sx={{ position: \"relative\", zIndex: 1, mx: CHECKBOX_PAD, display: \"flex\" }}\n >\n <Checkbox\n checked={selected}\n onChange={() => onToggleSelect?.()}\n onClick={(event) => {\n event.stopPropagation();\n onToggleSelect?.(event);\n }}\n size=\"small\"\n data-testid={testId}\n aria-label={copy.selection.selectRow}\n />\n </Box>\n );\n}\n\n/**\n * THE DISCLOSURE CHEVRON — the affordance that says this row has more.\n *\n * Rendered only when the card was given a body to reveal. A chevron on a row\n * that opens onto nothing is worse than no chevron: it is a promise the row\n * cannot keep, and an operator who presses it twice learns to stop trusting the\n * column. So `BaseListCard` passes `null` here when it has no children, the\n * slot returns nothing, and — standalone — the rail leaves the template\n * entirely.\n *\n * ROTATED, NOT SWAPPED. One glyph turned 90° rather than a right-chevron\n * exchanged for a down-chevron: the rotation is animatable and reads as the\n * same object moving, where a swap is two icons flickering. It also keeps the\n * button's box identical in both states, so the caption beside it cannot shift\n * as the row opens.\n *\n * `stopPropagation`, because a row is frequently clickable in its own right —\n * opening the record is not the same act as peeking at its detail, and without\n * this the chevron would do both at once.\n */\nexport function DiscloseSlot({\n expandable,\n expanded,\n reserve,\n onToggle,\n controls,\n testId,\n}: {\n expandable: boolean;\n expanded: boolean;\n reserve: boolean;\n onToggle: () => void;\n /** The id of the region this button opens, for `aria-controls`. */\n controls: string;\n testId?: string;\n}): React.JSX.Element | null {\n const copy = useDataViewsCopy();\n if (!expandable) return reserve ? <Box data-slot=\"disclose\" /> : null;\n return (\n // z-index 1 and flex for the same reasons the other two gutters use them:\n // above a stretched link that would otherwise swallow the click, and out of\n // a baseline that would drop the glyph below the row's centre.\n <Box\n data-slot=\"disclose\"\n sx={{ position: \"relative\", zIndex: 1, display: \"flex\", alignItems: \"center\" }}\n >\n <IconButton\n size=\"small\"\n aria-expanded={expanded}\n aria-controls={expanded ? controls : undefined}\n aria-label={expanded ? copy.selection.collapseRow : copy.selection.expandRow}\n data-testid={testId}\n onClick={(event) => {\n event.stopPropagation();\n onToggle();\n }}\n // The row's own keyboard handler treats Enter/Space as \"open the\n // record\"; the button already handles both, so the event must not reach\n // it and fire the second action too.\n onKeyDown={(event) => event.stopPropagation()}\n sx={{\n p: 0.25,\n transform: expanded ? \"rotate(90deg)\" : \"rotate(0deg)\",\n transition: \"transform 150ms ease\",\n // Honour a reduced-motion preference: the state is carried by the\n // angle, not by the animation, so dropping the tween loses nothing.\n \"@media (prefers-reduced-motion: reduce)\": { transition: \"none\" },\n }}\n >\n <KeyboardArrowRightIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,OAAO,4BAA4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iBAAiB;AAC9B,MAAI,CAAC,WAAY,QAAO,UAAU,oBAACA,UAAA,EAAI,aAAU,YAAW,IAAK;AACjE;AAAA;AAAA;AAAA;AAAA,IAIE;AAAA,MAACA;AAAA,MAAA;AAAA,QACC,aAAU;AAAA,QACV,IAAI,EAAE,UAAU,YAAY,QAAQ,GAAG,SAAS,QAAQ,YAAY,SAAS;AAAA,QAE7E;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,iBAAe;AAAA,YACf,iBAAe,WAAW,WAAW;AAAA,YACrC,cAAY,WAAW,KAAK,UAAU,cAAc,KAAK,UAAU;AAAA,YACnE,eAAa;AAAA,YACb,SAAS,CAAC,UAAU;AAClB,oBAAM,gBAAgB;AACtB,uBAAS;AAAA,YACX;AAAA,YAIA,WAAW,CAAC,UAAU,MAAM,gBAAgB;AAAA,YAC5C,IAAI;AAAA,cACF,GAAG;AAAA,cACH,WAAW,WAAW,kBAAkB;AAAA,cACxC,YAAY;AAAA;AAAA;AAAA,cAGZ,2CAA2C,EAAE,YAAY,OAAO;AAAA,YAClE;AAAA,YAEA,8BAAC,0BAAuB,UAAS,SAAQ;AAAA;AAAA,QAC3C;AAAA;AAAA,IACF;AAAA;AAEJ;","names":["default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pt-BR.data-display.ts"],"sourcesContent":["/**\n * The pt-BR pack for the data-display family. Split out of `pt-BR.ts`, which is a\n * barrel over this folder — see that file for why.\n */\nimport type { DataViewsCopy } from \"./components/data-display/DataViews/data-views-copy\";\nimport type {\n CarouselCopy,\n DataGridCopy,\n DataStateCopy,\n LightboxCopy,\n MapPreviewCopy,\n TimingDiagramCopy,\n} from './copy';\nimport { PT_BR_TABLE_FILTER_COPY } from './pt-BR.layout';\nimport {\n PT_BR_CATEGORY_SELECT_COPY,\n PT_BR_CONFIRM_ACTION_COPY,\n PT_BR_SAVED_VIEWS_LABELS,\n} from './pt-BR.shared';\n\nexport const PT_BR_LIGHTBOX_COPY: LightboxCopy = {\n close: \"Fechar\",\n previous: \"Anterior\",\n next: \"Próximo\",\n zoomIn: \"Aproximar\",\n zoomOut: \"Afastar\",\n resetZoom: \"Restaurar o zoom\",\n play: \"Iniciar a apresentação\",\n pause: \"Pausar a apresentação\",\n dialogLabel: \"Galeria de imagens\",\n itemPosition: (index, total) => `Item ${index} de ${total}`,\n videoFallback: (index, total) => `Vídeo ${index} de ${total}`,\n imageFallback: (index, total) => `Imagem ${index} de ${total}`,\n thumbnailFallback: (index) => `Miniatura ${index}`,\n};\n\nexport const PT_BR_DATA_GRID_COPY: DataGridCopy = {\n sortBy: (header) => `Ordenar por ${header}`,\n selectRow: (rowNumber) => `Selecionar linha ${rowNumber}`,\n selectAllRows: \"Selecionar todas as linhas\",\n expandRow: \"Expandir linha\",\n collapseRow: \"Recolher linha\",\n gridLabel: \"Grade de dados\",\n};\n\nexport const PT_BR_MAP_PREVIEW_COPY: MapPreviewCopy = {\n zoomIn: \"Aproximar\",\n zoomOut: \"Afastar\",\n center: \"Centralizar o mapa\",\n mapType: \"Trocar o tipo de mapa\",\n fullscreen: \"Tela cheia\",\n search: \"Buscar endereço\",\n};\n\nexport const PT_BR_CAROUSEL_COPY: CarouselCopy = {\n previous: \"Anterior\",\n next: \"Próximo\",\n};\n\nexport const PT_BR_TIMING_DIAGRAM_COPY: TimingDiagramCopy = {\n regionLabel: \"Diagrama de tempos\",\n heading: \"Tempo da requisição\",\n dns: \"Busca de DNS\",\n connect: \"Conexão\",\n ssl: \"SSL/TLS\",\n request: \"Requisição\",\n response: \"Resposta\",\n total: (formatted) => `Total: ${formatted}`,\n totalTime: (formatted) => `Tempo total: ${formatted}`,\n};\n\nexport const PT_BR_DATA_STATE_COPY: DataStateCopy = {\n empty: \"Nenhum dado por aqui\",\n loading: \"Carregando…\",\n endOfList: \"Não há mais itens para carregar\",\n dismissAlert: \"Fechar o aviso\",\n dismissBanner: \"Fechar a faixa\",\n};\n\nexport const PT_BR_DATA_VIEWS_COPY: DataViewsCopy = {\n savedViewsMenu: PT_BR_SAVED_VIEWS_LABELS,\n confirmAction: PT_BR_CONFIRM_ACTION_COPY,\n categorySelect: PT_BR_CATEGORY_SELECT_COPY,\n board: {\n countOnPage: (label, count) => `${label}: ${count} nesta página`,\n onThisPage: (count) => `${count} nesta página`,\n pageSum: (sum) => `Soma desta página: ${sum}`,\n emptyColumn: \"Nada nesta etapa\",\n pageScopeNote:\n \"As contagens e somas abaixo referem-se apenas aos itens desta página.\",\n },\n deleteView: {\n title: \"Excluir visão\",\n target: (viewName) => `Excluir \"${viewName}\"?`,\n sharedWarning: \"Esta visão está compartilhada — a equipe perderá o acesso a ela.\",\n rowsUnaffected: (entityLabel) =>\n `${entityLabel} não são afetados; apenas o recorte salvo é removido.`,\n confirm: \"Excluir visão\",\n cancel: \"Cancelar\",\n },\n manageViews: {\n title: \"Gerenciar visões\",\n empty: \"Nenhuma visão salva.\",\n edit: \"Editar\",\n defaultTag: \"Padrão\",\n otherUserTag: \"De outro usuário\",\n deleteTitle: \"Excluir a visão salva?\",\n deleteBody: \"Os filtros e colunas guardados nela são perdidos. Não é possível restaurar.\",\n deleteConfirm: \"Excluir\",\n },\n saveView: {\n sharedDescription: \"Qualquer pessoa da loja poderá abrir e usar esta visão.\",\n setDefaultTitle: \"Definir como padrão\",\n setDefaultDescription: \"Esta tela abre nesta visão em vez da Visão principal.\",\n previewHeading: \"O que esta visão guarda\",\n previewUnchanged: \"Nada foi alterado — esta visão ficará igual à Visão principal.\",\n sortRowLabel: \"Ordenação\",\n saveFailed: \"Não foi possível salvar a visão.\",\n titleEditing: \"Editar visão\",\n titleCreating: \"Salvar visão\",\n descriptionLabel: \"Descrição — opcional\",\n descriptionPlaceholder: \"Para que serve esta visão\",\n submitEditing: \"Salvar alterações\",\n submitCreating: \"Salvar visão\",\n nameLabel: \"Nome\",\n cancel: \"Cancelar\",\n pinnedTitle: \"Fixar na barra lateral\",\n pinnedDescription: \"Aparece como atalho no menu, abaixo desta tela.\",\n sharedTitle: \"Compartilhar com a equipe\",\n namePlaceholder: \"Ex.: Recusados no PIX desta semana\",\n previewFilters: \"Filtros\",\n previewHiddenColumns: \"Colunas ocultas\",\n },\n columns: {\n visibleCount: (visible, total) => `${visible} de ${total} visíveis`,\n reset: \"Padrão\",\n showAll: \"Mostrar todas\",\n dragHint: \"Arraste para reordenar as colunas.\",\n moveUp: (columnLabel) => `Mover ${columnLabel} para cima`,\n moveDown: (columnLabel) => `Mover ${columnLabel} para baixo`,\n },\n display: {\n sortTab: \"Ordenar\",\n columnsTab: \"Colunas\",\n panelTab: \"Exibição\",\n direction: \"Direção\",\n layoutHints: {\n table: \"Colunas comparáveis, boa para varrer números.\",\n list: \"Uma linha por item, com os dados principais.\",\n cards: \"Blocos maiores, bom para poucos itens.\",\n board: \"Colunas por etapa, para acompanhar o que está onde.\",\n },\n densityHeadings: {\n table: \"Altura das linhas\",\n list: \"Altura das linhas\",\n cards: \"Cards por linha\",\n board: \"Largura das colunas\",\n },\n densityLabels: {\n table: { compact: \"Baixa\", cozy: \"Média\", comfortable: \"Alta\" },\n list: { compact: \"Baixa\", cozy: \"Média\", comfortable: \"Alta\" },\n cards: { compact: \"Muitos\", cozy: \"Médio\", comfortable: \"Poucos\" },\n board: { compact: \"Estreita\", cozy: \"Média\", comfortable: \"Larga\" },\n },\n boardUnavailable: \"Esta tela não declara etapas, então não oferece quadro.\",\n densityUnavailableNarrow:\n \"Um card por linha nesta largura — a densidade volta em telas maiores.\",\n trigger: \"Exibir\",\n fieldHeading: \"Campo\",\n formatHeading: \"Formato\",\n cardZoom: \"Tamanho dos cards\",\n },\n export: {\n formats: {\n json: { label: \"JSON (.json)\", hint: \"Para integrações\" },\n },\n visibleColumns: (columnCount) => `${columnCount} colunas visíveis, na ordem atual`,\n trigger: \"Exportar\",\n triggerLabel: \"Exportar\",\n },\n tableFilter: PT_BR_TABLE_FILTER_COPY,\n grid: {\n ...PT_BR_DATA_GRID_COPY,\n rowActions: \"Ações\",\n bulkActions: (selectedCount) => `Ações (${selectedCount}) ▾`,\n emptyFilteredTitle: \"Nenhum resultado para esses filtros\",\n emptyFilteredHint: \"Ajuste ou remova os filtros.\",\n emptyFilteredAction: \"Limpar filtros\",\n },\n filters: {\n moreFilters: (count) => `Mais filtros: ${count} sem espaço na barra`,\n moreFiltersApplied: (count, appliedCount) =>\n `Mais filtros: ${count} sem espaço na barra, ${appliedCount} aplicado(s)`,\n moreTriggerLabel: \"Mais\",\n moreHeading: \"Mais filtros\",\n overflowNote: \"sem espaço na barra\",\n rangeEnd: \"Até\",\n rangeInvalid: \"O início precisa ser menor que o fim.\",\n rangeInclusiveNote: \"Ambas as datas entram no resultado.\",\n rangeStart: \"De\",\n dayMask: \"dd/mm/aaaa\",\n clearAllFilters: \"Limpar todos os filtros\",\n rangePresets: {\n hoje: \"Hoje\",\n ontem: \"Ontem\",\n semana: \"Esta semana\",\n mes: \"Este mês\",\n ano: \"Este ano\",\n },\n scopesLabel: \"Situação\",\n panelTitle: \"Filtros\",\n clear: \"Limpar\",\n clearAll: \"Limpar filtros\",\n clearRange: (label) => `Limpar ${label}`,\n allOption: \"Todas\",\n optionSearchPlaceholder: \"Buscar…\",\n optionsEmpty: \"Nenhum resultado\",\n optionsHeading: \"Opções\",\n },\n selection: {\n selectAllOnPage: \"Selecionar todos nesta página\",\n clearSelection: \"Limpar seleção\",\n selectAll: \"Selecionar tudo\",\n onThisPage: (count) => `${count} nesta página`,\n selectedCount: (count) => `${count} ${count === 1 ? \"selecionado\" : \"selecionados\"}`,\n selectRow: \"Selecionar\",\n expandRow: \"Expandir detalhes\",\n collapseRow: \"Recolher detalhes\",\n },\n nav: {\n mainView: \"Visão principal\",\n defaultTag: \"Padrão\",\n viewOptions: (viewName) => `Opções de ${viewName}`,\n emptyHint: \"Nenhuma visão salva. Ajuste filtros, colunas ou ordenação e salve abaixo.\",\n setDefault: \"Definir como padrão\",\n deleteView: \"Excluir visão\",\n unsavedChanges: \"Alterações não salvas\",\n label: \"Visão\",\n update: \"Atualizar visão\",\n save: \"Salvar visão\",\n saveAs: \"Salvar como nova\",\n reset: \"Redefinir\",\n updateFailed: \"Não foi possível atualizar a visão\",\n dismissError: \"Fechar o aviso\",\n goBack: \"Voltar\",\n pageSize: \"Mostrar:\",\n saveFailed: \"Não foi possível salvar a alteração da visão.\",\n editView: \"Renomear e editar\",\n pinToSidebar: \"Fixar na barra lateral\",\n shareWithTeam: \"Compartilhar com a equipe\",\n },\n search: {\n placeholder: \"Buscar…\",\n allColumnsLabel: \"Buscar em todas as colunas\",\n keywordPlaceholder: \"Pressione Enter para filtrar\",\n open: \"Buscar\",\n close: \"Fechar busca\",\n clear: \"Limpar busca\",\n },\n};\n"],"mappings":";;;;;;;;;;AAoBO,IAAM,sBAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc,CAAC,OAAO,UAAU,QAAQ,KAAK,OAAO,KAAK;AAAA,EACzD,eAAe,CAAC,OAAO,UAAU,YAAS,KAAK,OAAO,KAAK;AAAA,EAC3D,eAAe,CAAC,OAAO,UAAU,UAAU,KAAK,OAAO,KAAK;AAAA,EAC5D,mBAAmB,CAAC,UAAU,aAAa,KAAK;AAClD;AAEO,IAAM,uBAAqC;AAAA,EAChD,QAAQ,CAAC,WAAW,eAAe,MAAM;AAAA,EACzC,WAAW,CAAC,cAAc,oBAAoB,SAAS;AAAA,EACvD,eAAe;AAAA,EACf,WAAW;AAAA,EACX,aAAa;AAAA,EACb,WAAW;AACb;AAEO,IAAM,yBAAyC;AAAA,EACpD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AACV;AAEO,IAAM,sBAAoC;AAAA,EAC/C,UAAU;AAAA,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AY;AAAA,IACZ,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,cAAc;AAAA,IACd,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,eAAe;AAAA,EACjB;AAAA,EACA,QAAQ;AAAA,IACN,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/list-card-rails.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\nimport { Box } from \"../../../mui/Box\";\nimport { DENSITY_ROW_PADDING, type DataViewsDensity } from \"./data-views-layout-context\";\nimport { CellConfigProvider, cellTracks, type ListCardCellConfig } from \"./list-card-cells\";\n\n/**\n * THE LIST OWNS THE COLUMNS, NOT THE ROW.\n *\n * Every row laying itself out with flex produces a list where nothing lines up.\n * The caption takes `flex: 1` and shoves the rest right; the value sits after\n * the meta cluster with the same gap as any other pair, so `MÉTODO PIX\n * R$ 13,90` reads as one continuous run and the only unlabelled thing in the\n * row is the number that matters most; and because the status chip's width\n * varies with its text (`Pago` vs `Em aberto` vs `Cancelado`), the money jitters\n * left and right on every row down the page.\n *\n * So the rails are declared ONCE, here, and each card is `grid-template-columns:\n * subgrid` spanning them. One set of edges for the whole list, the value on its\n * own rail, the status in a slot wide enough for the longest label it will ever\n * hold. Adding a row cannot move the column.\n *\n * Subgrid needs the card to be a DIRECT child of this grid — no wrapper element\n * between them, which is why the group renders its children bare.\n */\n\n/** One rail. Fixed where alignment matters, flexible where it does not. */\nexport interface ListRails {\n /**\n * The disclosure chevron, ahead of everything.\n *\n * Reserved on the same terms as the gutters behind it: a list where only SOME\n * rows carry an expandable body would otherwise indent those rows and no\n * others, and a column of captions that starts at two different offsets reads\n * as a rendering fault rather than as a row you can open.\n */\n disclose: string;\n /** Reserved even when nothing drags: toggling drag mode must not shift the list. */\n drag: string;\n /** Reserved even when nothing is selectable, for the same reason. */\n select: string;\n leading: string;\n /** Absorbs spare width, alongside `meta`. */\n caption: string;\n /** Also absorbs spare width, so the middle columns spread rather than bunch. */\n meta: string;\n /** The value's own rail, with a fixed right edge. */\n value: string;\n actions: string;\n}\n\n/**\n * The meta rail, sized to sit its pairs on even intervals WITH the caption.\n *\n * ONE SHARE OF THE SPARE WIDTH PER PAIR, not one for the cluster. A single `1fr`\n * handed the whole cluster as much room as the title and then split it between\n * the pairs, so the title sat on a full share while `DATA` and `MÉTODO` had half\n * a share each — which is why the gap after the title came out twice the gap\n * between the pairs. Even columns need even shares, so the rail grows with the\n * number of pairs it has to hold.\n *\n * `max-content` still floors it: the evenness is never paid for with a clipped\n * label on a row too narrow to afford it.\n */\nexport function metaRail(columns: number): string {\n return `minmax(max-content, ${Math.max(columns, 1)}fr)`;\n}\n\n/**\n * The caption and meta rails, resolved TOGETHER — because exactly one of them\n * has to be the flexible track, and which one depends on whether the row has any\n * middle columns at all.\n *\n * A grid distributes its free space to `fr` tracks; with no `fr` present it\n * spreads it across every `auto` track instead — including the empty gutters,\n * the empty meta rail and the empty status rail. So a row with a title and a\n * value and nothing between them drifted its title into the middle of the row,\n * each empty rail having claimed an equal share of the slack.\n *\n * With pairs to place, `meta` is the flexible one and the caption sizes to its\n * title (the spare width belongs to the only rail with several things to space\n * out). With no pairs, there is nothing to distribute and the caption takes the\n * slack back, which is what it always did.\n */\nexport function contentRails(metaColumns: number): Pick<ListRails, \"caption\" | \"meta\"> {\n return metaColumns > 0\n ? { caption: \"minmax(0, auto)\", meta: metaRail(metaColumns) }\n : { caption: \"minmax(0, 1fr)\", meta: \"auto\" };\n}\n\nexport const DEFAULT_RAILS: ListRails = {\n disclose: \"auto\",\n drag: \"auto\",\n select: \"auto\",\n leading: \"auto\",\n // Two is the canonical row (a date and a method); a list carrying a different\n // number says so with `metaColumns`, and a standalone card counts its own.\n ...contentRails(2),\n // `max-content` on the value, so the rail is as wide as the widest amount in\n // the list and no wider — a fixed px guess is either clipping or dead space.\n // NOT an `fr`: the value's whole promise is a fixed right edge, and a rail\n // that grows with the spare width moves that edge on every list.\n value: \"max-content\",\n actions: \"auto\",\n};\n\nexport interface ListRailsValue {\n density: DataViewsDensity;\n /** Whether the gutters are held open even when empty. */\n reserveGutters: boolean;\n /**\n * How many tracks a row spans.\n *\n * Fixed at {@link RAIL_COUNT} for the named-slot layout, but a cell-configured\n * list has as many tracks as the config declares, and every row must span the\n * same number or subgrid tears.\n */\n railCount: number;\n}\n\nconst ListRailsContext = createContext<ListRailsValue | null>(null);\n\n/** Is this card inside a group that owns the rails? */\nexport function useListRails(): ListRailsValue | null {\n return useContext(ListRailsContext);\n}\n\n/**\n * The column template, as one `grid-template-columns` value.\n *\n * A rail set to `null` is DROPPED rather than sized to zero. The two are not the\n * same: a zero-width track still takes a `column-gap` beside it, so a gutter\n * nobody is using still pushes the row's contents inward. Only a standalone card\n * may drop one — inside a group the rails are subgrid over a shared template and\n * every row must span the same count.\n */\nexport function railsTemplate(rails: RailOverrides): string {\n return [\n rails.disclose,\n rails.drag,\n rails.select,\n rails.leading,\n rails.caption,\n rails.meta,\n rails.value,\n rails.actions,\n ]\n .filter((rail): rail is string => rail != null)\n .join(\" \");\n}\n\n/** A rail set, where `null` means \"this rail is not in the template at all\". */\ntype RailOverrides = { [K in keyof ListRails]: ListRails[K] | null };\n\n/** The gap between rails, in theme spacing units. */\nexport const RAIL_GAP = 3;\n\n/** …the same gap in pixels, for anything drawing INTO it. */\nexport const RAIL_GAP_PX = RAIL_GAP * 8;\n\n/**\n * AN EMPTY GUTTER COSTS ITS OWN WIDTH *AND* THE RAIL GAP BESIDE IT.\n *\n * A zero-width grid track still gets a `column-gap`, and no margin on the item\n * inside it can win that back — gaps sit between TRACKS, and a track's position\n * is settled before any item's margin is applied. (Tried it; the box simply\n * overhangs its own track and everything after it stays put.) So a row with\n * nothing to drag was paying 24px for a rail holding nothing, which was the\n * single biggest contributor to the left inset the checkbox appeared to have.\n *\n * The only way out is for the track NOT TO EXIST: the slot renders nothing and\n * the rail leaves the template, which is safe because grid auto-placement fills\n * the remaining tracks in DOM order. Standalone only — inside a\n * {@link ListCardGroup} the rails are subgrid across a shared template and the\n * count cannot vary per row, which is also where `reserveGutters` earns its\n * keep: a selectable list and a read-only one still line up, and turning drag\n * mode on does not shift every row sideways.\n */\nexport function railsTemplateFor(\n gutters: { disclose: boolean; drag: boolean; select: boolean },\n metaColumns: number,\n): string {\n return railsTemplate({\n ...DEFAULT_RAILS,\n // Standalone, the card can simply COUNT its pairs — no `metaColumns` to be\n // told, and no guess.\n ...contentRails(metaColumns),\n ...(gutters.disclose ? {} : { disclose: null }),\n ...(gutters.drag ? {} : { drag: null }),\n ...(gutters.select ? {} : { select: null }),\n });\n}\n\n/** How many rails the named-slot layout has — the span such a card claims. */\nexport const RAIL_COUNT = 8;\n\n/**\n * The gutters and the trailing menu that bracket a CONFIGURED row.\n *\n * A cell-configured list still has a head and a tail the config does not\n * describe: the disclosure chevron, the drag grip and the checkbox in front, and\n * the overflow menu behind. The menu is not optional — it is where a row's\n * actions live, and a list that hid it would have nowhere to put them.\n */\nconst CELL_FIXED_RAILS = 4;\n\n/**\n * Tracks for a cell-configured row: gutters, leading, the cells, then the menu.\n *\n * `gutters` says which of the three head gutters RENDER. A group reserves all\n * three (the default), so every row spans the same tracks. A standalone row\n * renders a gutter only when it uses it, and a track whose slot renders nothing\n * is not a reserved gap: grid auto-placement fills it with the NEXT slot. So the\n * checkbox landed in the disclosure track, the glyph in the drag track, and\n * every cell two tracks early, in a column sized for something else. The named-\n * slot layout already drops absent gutters ({@link railsTemplateFor}); this is\n * the same rule for configured cells.\n */\nexport function cellRailsTemplate(\n cells: readonly string[],\n gutters: { disclose: boolean; drag: boolean; select: boolean } = { disclose: true, drag: true, select: true },\n): string {\n return [\n gutters.disclose ? DEFAULT_RAILS.disclose : null,\n gutters.drag ? DEFAULT_RAILS.drag : null,\n gutters.select ? DEFAULT_RAILS.select : null,\n DEFAULT_RAILS.leading,\n ...cells,\n DEFAULT_RAILS.actions,\n ]\n .filter((rail): rail is string => rail != null)\n .join(\" \");\n}\n\n/** How many tracks such a row spans — the fixed head/tail plus one per cell. */\nexport function cellRailCount(cells: number): number {\n return CELL_FIXED_RAILS + cells + 1;\n}\n\n/**\n * A {@link ListCardGroup}'s configuration, as a value a caller can pass around.\n *\n * The same fields the group takes as props, named once so a table can accept\n * \"the list's columns\" as a single prop and hand them straight over. It is what\n * makes a list line up BY CONSTRUCTION rather than by convention: without it\n * every row resolves its own tracks from its own copy of the config, which\n * agrees with its neighbours right until one row carries an unusually wide value.\n */\nexport interface ListGroupConfig<T extends Record<string, unknown>> {\n /**\n * The cells every row renders. Supplying these replaces the named-slot layout\n * (title/subtitle/meta/value/status) for the rows inside.\n */\n cells?: readonly ListCardCellConfig<T>[];\n /**\n * How many labelled pairs the rows carry, in the named-slot layout. The group\n * renders its children opaquely and cannot count them.\n */\n metaColumns?: number;\n /** Override individual rails; anything omitted keeps its default. */\n rails?: Partial<ListRails>;\n /**\n * Hold the drag and select gutters open even when nothing uses them. On by\n * default, so a selectable list and a read-only one still line up.\n */\n reserveGutters?: boolean;\n}\n\n/**\n * A list of {@link BaseListCard}s that share one set of columns.\n *\n * Also the natural home for the things a review pointed out belong to the list\n * rather than the card: the density every row answers, and — when it lands —\n * shift-click range selection and the single `aria-live` region a list needs\n * (fifty polite live regions is a screen-reader nightmare, which is why the\n * card no longer takes one).\n */\nexport function ListCardGroup({\n children,\n density = \"cozy\",\n cells,\n metaColumns,\n rails,\n reserveGutters = true,\n gap,\n dataTestId,\n}: {\n children: ReactNode;\n density?: DataViewsDensity;\n /**\n * The list's CELL CONFIG — declared once here, obeyed by every row.\n *\n * This is what makes the columns line up by construction rather than by\n * convention: the group resolves the tracks and hands the same config to every\n * card, so two rows cannot disagree about the shape of the list because\n * neither of them decides it.\n *\n * Supplying this replaces the named-slot layout (title/subtitle/meta/value/\n * status) for the rows inside — they render `row` through these cells instead.\n * The gutters and the overflow menu are unaffected; they bracket the cells and\n * are not the config's to describe.\n */\n cells?: readonly ListCardCellConfig<never>[];\n /**\n * How many labelled pairs the rows in this list carry.\n *\n * The rail claims one share of the spare width per pair, so the title and\n * every pair land on even intervals. A list is homogeneous — its rows show\n * the same fields — but the group renders its children opaquely and cannot\n * count them, so this is the one thing it has to be told.\n */\n metaColumns?: number;\n /** Override individual rails; anything omitted keeps its default. */\n rails?: Partial<ListRails>;\n /**\n * Hold the drag and select gutters open even when nothing uses them.\n *\n * On by default: a selectable list and a read-only one should line up, and\n * turning drag mode on should not shift every row sideways.\n */\n reserveGutters?: boolean;\n /** Row gap. Defaults to the density's own spacing. */\n gap?: number;\n dataTestId?: string;\n}): React.JSX.Element {\n const resolved = {\n ...DEFAULT_RAILS,\n ...(metaColumns == null ? {} : contentRails(metaColumns)),\n ...rails,\n };\n const configured = cells != null && cells.length > 0;\n const template = configured ? cellRailsTemplate(cellTracks(cells)) : railsTemplate(resolved);\n const railCount = configured ? cellRailCount(cells.length) : RAIL_COUNT;\n return (\n <ListRailsContext.Provider value={{ density, reserveGutters, railCount }}>\n <CellConfigProvider cells={cells}>\n <Box\n data-testid={dataTestId}\n sx={{\n // The query container for every row inside it — a row cannot be one\n // itself and a subgrid at the same time (containment drops subgrid).\n // Every row in a list is the same width anyway, so the group is the\n // honest place to ask the question.\n containerType: \"inline-size\",\n display: \"grid\",\n gridTemplateColumns: template,\n alignItems: \"center\",\n rowGap: gap ?? DENSITY_ROW_PADDING[density],\n }}\n >\n {children}\n </Box>\n </CellConfigProvider>\n </ListRailsContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAEA,SAAS,eAAe,kBAAkC;A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KAAK,GACpG;AACR,SAAO;AAAA,IACL,QAAQ,WAAW,cAAc,WAAW;AAAA,IAC5C,QAAQ,OAAO,cAAc,OAAO;AAAA,IACpC,QAAQ,SAAS,cAAc,SAAS;AAAA,IACxC,cAAc;AAAA,IACd,GAAG;AAAA,IACH,cAAc;AAAA,EAChB,EACG,OAAO,CAAC,SAAyB,QAAQ,IAAI,EAC7C,KAAK,GAAG;AACb;AAGO,SAAS,cAAc,OAAuB;AACnD,SAAO,mBAAmB,QAAQ;AACpC;AAwCO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AACF,GAsCsB;AACpB,QAAM,WAAW;AAAA,IACf,GAAG;AAAA,IACH,GAAI,eAAe,OAAO,CAAC,IAAI,aAAa,WAAW;AAAA,IACvD,GAAG;AAAA,EACL;AACA,QAAM,aAAa,SAAS,QAAQ,MAAM,SAAS;AACnD,QAAM,WAAW,aAAa,kBAAkB,WAAW,KAAK,CAAC,IAAI,cAAc,QAAQ;AAC3F,QAAM,YAAY,aAAa,cAAc,MAAM,MAAM,IAAI;AAC7D,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,SAAS,gBAAgB,UAAU,GACtE,8BAAC,sBAAmB,OACnB;AAAA,IAACA;AAAA,IAAA;AAAA,MACC,eAAa;AAAA,MACb,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,QAKF,eAAe;AAAA,QACf,SAAS;AAAA,QACT,qBAAqB;AAAA,QACrB,YAAY;AAAA,QACZ,QAAQ,OAAO,oBAAoB,OAAO;AAAA,MAC5C;AAAA,MAEC;AAAA;AAAA,EACH,GACD,GACD;AAEJ;","names":["default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/base-list-card-geometry.tsx"],"sourcesContent":["\"use client\";\n\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\n\nimport {\n CARD_RADIUS,\n cardSurfaceStyles,\n isActionable,\n isSelectable,\n slotTestIds,\n} from \"./card-surface\";\nimport { useDragItem } from \"./data-views-drag\";\nimport { DENSITY_ROW_PADDING } from \"./data-views-layout-context\";\nimport { RAIL_COUNT, RAIL_GAP, railsTemplateFor, useListRails } from \"./list-card-rails\";\nimport { STACK_BREAK } from \"./base-list-card-slots\";\nimport type { BaseListCardProps } from \"./base-list-card\";\nimport { rem } from \"../../../tokens/relative\";\n\n/**\n * THE ROW'S GEOMETRY AND SURFACE, split from the component at the size gate.\n *\n * Everything here answers \"what shape is this row, and where do its slots land\"\n * — the rails, the density padding, the two-line collapse, the drag and\n * selection plumbing. None of it renders anything, which is why the two halves\n * can live apart without either becoming harder to follow.\n */\n/**\n * Whether a click was really a click, or the tail of a text selection.\n *\n * Without this, selecting an order id to copy it navigates away instead — the\n * single most annoying thing a clickable row does.\n */\nfunction isTextSelection(): boolean {\n return (globalThis.getSelection?.()?.toString().length ?? 0) > 0;\n}\n\n/** Keyboard equivalence for a card that acts but does not navigate. */\nfunction clickKeys(onClick: () => void) {\n return (event: React.KeyboardEvent): void => {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n onClick();\n };\n}\n\n/**\n * Geometry: the rails, the density padding, the two-line collapse.\n *\n * SCALE IS `zoom`, NOT A SET OF MULTIPLIED FONT SIZES.\n *\n * It used to be the latter, on exactly three values — title, value, row padding\n * — so the slider left the subtitle, the meta labels, the rules, the checkbox,\n * the grip, the chip and the menu at their fixed sizes, and the row came apart\n * as you dragged it. Multiplying the rest is not a fix: the checkbox and the\n * chip are MUI internals sized in their own px, and no prop we pass reaches\n * them.\n *\n * `zoom` scales the used value of every length in the subtree — ours and theirs\n * — and unlike `transform: scale` it REFLOWS, so the row still occupies the\n * space it draws and the rails still resolve. Verified against the group: at\n * 1.4 all four rows keep identical rail edges, because subgrid tracks and the\n * zoom that reads them are the same for every row.\n */\n/** What {@link rowSx} needs to know about the row it lays out. */\ninterface RowSxOptions {\n inGroup: boolean;\n railCount: number;\n cellTemplate: string | null;\n gutters: { disclose: boolean; drag: boolean; select: boolean };\n metaColumns: number;\n pad: number;\n padY: number;\n scale: number;\n divider: boolean;\n interactive: boolean;\n draggable: boolean;\n /** What the two-line layout below `STACK_BREAK` has to place by name. */\n stack: StackPlacement;\n}\n\n/**\n * The slots the stacked row places that the named-slot rules cannot know about.\n *\n * For a CONFIGURED row, `firstCell` is the cell that takes the title's place and\n * `valueCell` the one that takes the value's (null for a named-slot row, or for\n * a one-cell row with no value to show). `expandable` decides whether the\n * disclosure button gets a place or, when it is only a reserved empty gutter,\n * none at all.\n */\nexport interface StackPlacement {\n firstCell: string | null;\n valueCell: string | null;\n expandable: boolean;\n}\n\n/** A `[data-slot=\"cell-<id>\"]` child selector, quoted so any id is safe. */\nconst cellSlot = (id: string): string => `& > [data-slot=${JSON.stringify(`cell-${id}`)}]`;\n\n/**\n * A configured row, stacked, keeps the SAME two facts a named-slot row keeps:\n * what the record is (the first cell, in the title's place on line 1) and the\n * figure it is about (the value cell, on line 2 from under the title to the\n * right edge, where an `end` cell sits flush right). Every other cell goes, as\n * `meta` goes — a row is a fixed-height scanning unit, and what does not fit\n * belongs in its expandable body.\n *\n * Left to auto-placement these cells had flowed into whatever track was free:\n * a name squeezed beside the glyph, an amount clipped to \"R$ …\".\n *\n * The hide-all rule comes first and the two named cells after it: the\n * selectors have equal specificity, so the later rule wins for those cells.\n */\nfunction stackedCells(stack: StackPlacement): Record<string, unknown> {\n if (stack.firstCell == null) return {};\n return {\n '& > [data-slot^=\"cell-\"]': { display: \"none\" },\n [cellSlot(stack.firstCell)]: { display: \"flex\", gridArea: \"1 / 3\" },\n ...(stack.valueCell == null ? {} : { [cellSlot(stack.valueCell)]: { display: \"flex\", gridArea: \"2 / 3 / 3 / 5\" } }),\n };\n}\n\n/**\n * TWO-LINE, below the point where the shared rails stop helping.\n *\n * The standard mobile transaction row: what the record IS on the first line,\n * what it COSTS under it at the right edge. Better than\n * truncating four columns into ellipses, and the reason each slot carries a\n * `data-slot` — the placement is explicit rather than whatever order the\n * children happen to be in.\n *\n * [ select ][ leading ][ title …………… ][ menu ]\n * [ (disclose) ] [ (cells) …………… ][ value ]\n *\n * The MENU stays in the top-right corner at every width. It is the row's\n * one fixed landmark — an overflow that moves to the second line on a phone\n * is an overflow nobody finds twice.\n */\nconst stackedRowSx = (inGroup: boolean, railCount: number, stack: StackPlacement): Record<string, unknown> => ({\n gridTemplateColumns: \"auto auto minmax(0, 1fr) max-content\",\n // The GROUP's track count, which a configured list sets from its cells\n // (`cellRailCount`) — not the named-slot RAIL_COUNT, which over-spans a\n // configured group and adds an implicit track at its end.\n ...(inGroup ? { gridColumn: `span ${railCount}` } : {}),\n rowGap: 0.75,\n columnGap: 1,\n '& > [data-slot=\"drag\"]': { display: \"none\" },\n // The disclosure button, when there is one, under the checkbox: the head of\n // the row, where it sits at every other width — never beside the menu, where\n // it read as an \"open\" arrow. A reserved empty gutter takes no place at all.\n '& > [data-slot=\"disclose\"]': stack.expandable ? { gridArea: \"2 / 1\", justifySelf: \"center\" } : { display: \"none\" },\n '& > [data-slot=\"select\"]': { gridArea: \"1 / 1\" },\n '& > [data-slot=\"leading\"]': { gridArea: \"1 / 2\" },\n '& > [data-slot=\"caption\"]': { gridArea: \"1 / 3\" },\n '& > [data-slot=\"actions\"]': { gridArea: \"1 / 4\", justifyContent: \"flex-end\" },\n '& > [data-slot=\"meta\"]': { display: \"none\" },\n // Second line, starting under the title rather than under the checkbox.\n '& > [data-slot=\"value\"]': { gridArea: \"2 / 4\", textAlign: \"right\" },\n ...stackedCells(stack),\n});\n\n/**\n * DIVIDER COMPOSES WITH THE VARIANT — it changes the row's SHAPE, not its\n * surface.\n *\n * It used to set `border: 0` and hard-code its own rule colour, which discarded\n * whatever the variant had drawn: `outline`, `text` and `ghost` all collapsed\n * to one identical flush row, and the variant control silently stopped meaning\n * anything the moment `divider` was on.\n *\n * Now only the GEOMETRY changes here — the box's sides go, one edge stays — and\n * no `borderColor` is written, so the colour set by `cardSurfaceStyles` survives.\n * A variant that draws no border of its own gets the neutral rule from\n * {@link rowStyles}.\n */\nexport const rowSx = (theme: Theme, opts: RowSxOptions): Record<string, unknown> => {\n const { inGroup, railCount, cellTemplate, gutters, metaColumns, pad, padY, scale, divider, interactive, draggable, stack } = opts;\n return {\n position: \"relative\",\n borderRadius: CARD_RADIUS,\n display: \"grid\",\n zoom: scale,\n // SUBGRID AND `container-type` CANNOT COEXIST on one element: containment\n // makes the box size independently of its parent, so the browser drops the\n // subgrid and every slot stacks into one column. (Observed exactly that —\n // computed `grid-template-columns: 1222px` on a card asking for subgrid.)\n //\n // So inside a group the GROUP is the query container and the row is the\n // subgrid. Standalone, the row is its own grid but NOT its own container:\n // a container query matches an ANCESTOR, never the element itself, so a\n // row that was its own container placed its children for two lines while\n // its own template stayed wide. A standalone card renders inside a wrapper\n // that is the container (`BaseListCard`).\n ...(inGroup\n ? { gridColumn: `span ${railCount}`, gridTemplateColumns: \"subgrid\" }\n : { gridTemplateColumns: cellTemplate ?? railsTemplateFor(gutters, metaColumns) }),\n alignItems: \"center\",\n // Wide enough that the meta cluster, the value and the status read as three\n // columns rather than one run of text — the complaint that started all this\n // was `MÉTODO PIX R$ 13,90` scanning as a single phrase.\n columnGap: RAIL_GAP,\n width: \"100%\",\n px: pad,\n py: padY,\n cursor: draggable ? \"grab\" : interactive ? \"pointer\" : undefined,\n ...(draggable ? { touchAction: \"none\", \"&:active\": { cursor: \"grabbing\" } } : {}),\n ...(interactive ? { \"&:hover\": { backgroundColor: \"action.hover\" } } : {}),\n // A real focus ring, which a clickable <div> never had.\n \"&:focus-visible\": {\n outline: `${rem(theme, 2)} solid`,\n outlineStyle: \"solid\",\n outlineColor: \"primary.main\",\n outlineOffset: rem(theme, 2),\n },\n // TWO-LINE below STACK_BREAK: see {@link stackedRowSx}.\n [`@container (max-width: ${rem(theme, STACK_BREAK)})`]: stackedRowSx(inGroup, railCount, stack),\n ...(divider\n ? { borderRadius: 0, borderWidth: 0, borderBottomWidth: 1, borderStyle: \"solid\" }\n : {}),\n };\n};\n\n/**\n * A selectable full-width row: a marker, a title over a subtitle, labelled\n * middle columns, a value, a status, actions and a menu.\n *\n * A SHELL, like {@link BaseCard}. Domain rows live in the app and compose it.\n */\n/**\n * The id this row drags under, or nothing.\n *\n * `undefined` is the inert answer: `useDragItem` treats a missing id as \"no\n * drag\", which is how the card's own veto (`draggable={false}`) and an\n * unactionable record both switch dragging off without the card knowing\n * anything about the container above it.\n */\nfunction dragIdFor(\n props: BaseListCardProps,\n actionable: boolean,\n): string | number | undefined {\n return props.draggable === false || !actionable ? undefined : props.dragId;\n}\n\n/**\n * What the meta cluster amounts to — asked once, used three times: to size the\n * rail, to close the cluster with a rule, and to decide whether the value has\n * anything to be divided FROM.\n */\nexport function metaShape(props: BaseListCardProps): { columns: number; present: boolean } {\n const columns = props.meta?.length ?? 0;\n return { columns, present: columns > 0 || props.metaSlot != null };\n}\n\n/**\n * Everything the row derives before it can render — extracted so the component\n * stays inside the size budget.\n */\nexport function useRowShell(props: BaseListCardProps) {\n const actionable = isActionable(props.state);\n const group = useListRails();\n const scale = props.scale ?? 1;\n return {\n group,\n actionable,\n scale,\n theme: useTheme(),\n selectable: isSelectable(props),\n slot: slotTestIds(props.testId),\n drag: useDragItem(dragIdFor(props, actionable)),\n // Standalone holds no gutter open: there is no list beside it to line up\n // with, so a reserved-but-empty rail is pure inset.\n reserve: group?.reserveGutters ?? false,\n // 1, not 1.5. The row's contents still have to line up with the toolbar\n // above them, but 12px of card padding stacked on the checkbox's own 9px\n // and an empty drag gutter's 24px read as a row indented for no reason.\n //\n // Not multiplied by `scale` — the row's `zoom` already scales it, and doing\n // both would square the factor on padding alone.\n pad: 1,\n padY: DENSITY_ROW_PADDING[group?.density ?? props.density ?? \"cozy\"],\n // A card that navigates does so with a real anchor, so it takes no click\n // handler of its own — the stretched link IS the target.\n acts: props.onClick != null && props.href == null && actionable,\n };\n}\n\n/** The click/keyboard props a row that acts (but does not navigate) needs. */\nexport function actionProps(onClick: (() => void) | undefined) {\n return {\n role: \"button\",\n tabIndex: 0,\n onClick: () => {\n if (isTextSelection()) return;\n onClick?.();\n },\n onKeyDown: clickKeys(() => onClick?.()),\n };\n}\n\n/** The surface and the geometry, merged — the row's whole `sx` in one place. */\n\n/**\n * The row's painted surface, plus the divider's colour fallback.\n *\n * A variant with no border of its own (`text`, `ghost`) would draw its rule in\n * the inherited colour — the TEXT colour, i.e. a black bar across the row. The\n * neutral divider token is supplied only in that case; a variant that has a\n * border keeps it, which is the whole point of composing the two.\n */\nfunction rowSurface(\n props: BaseListCardProps,\n shell: ReturnType<typeof useRowShell>,\n): Record<string, unknown> {\n const { theme, selectable, drag } = shell;\n const surface = cardSurfaceStyles(\n { ...props, selectable, shape: \"row\", state: drag.dragging ? \"disabled\" : props.state },\n theme,\n );\n if (props.divider !== true || surface.borderColor != null) return surface;\n return { ...surface, borderBottomColor: theme.palette.divider };\n}\n\n/**\n * Which head gutters this row renders: the ones it uses, or all three when its\n * group reserves them. The template is built from this; the three gutter slots\n * (`base-list-card-gutters.tsx`) apply the SAME conditions on their own — keep\n * the two in step, because a template that disagrees with the slots is exactly\n * how cells slid two tracks.\n */\nexport function rowGutters(\n props: BaseListCardProps,\n shell: ReturnType<typeof useRowShell>,\n): { disclose: boolean; drag: boolean; select: boolean } {\n const { selectable, drag, reserve } = shell;\n return {\n disclose: reserve || props.children != null,\n drag: reserve || drag.draggable,\n select: reserve || selectable,\n };\n}\n\nexport function rowStyles(\n props: BaseListCardProps,\n shell: ReturnType<typeof useRowShell>,\n cellTemplate: string | null,\n stack: StackPlacement,\n): Record<string, unknown> {\n const { theme, group, drag, pad, padY, scale, acts } = shell;\n return {\n ...rowSurface(props, shell),\n ...rowSx(theme, {\n inGroup: group !== null,\n railCount: group?.railCount ?? RAIL_COUNT,\n cellTemplate,\n gutters: rowGutters(props, shell),\n metaColumns: metaShape(props).columns,\n pad,\n padY,\n scale,\n divider: props.divider ?? false,\n interactive: acts || props.href != null,\n draggable: drag.draggable && drag.handleProps === undefined,\n stack,\n }),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,gBAA4B;AA8BrC,SAAS,kBAA2B;AAClC,UAAQ,WAAW,eAAe,GAAG,SAAS,EAAE,UAAU,KAAK;AACjE;AAGA,SAAS,UAAU,SAAqB;AACtC,SAAO,CAAC,UAAqC;AAC3C,QAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,IAAK;AAChD,UAAM,eAAe;AACrB,YAAQ;AAAA,EACV;AACF;AAqDA,IAAM,WAAW,CAAC,OAAuB,kBAAkB,KAAK,UAAU,QAAQ,EAAE,EAAE,CAAC;AAgBvF,SAAS,aAAa,OAAgD;AACpE,MAAI,MAAM,aAAa,KAAM,QAAO,CAAC;AACrC,SAAO;AAAA,IACL,4BAA4B,EAAE,SAAS,OAAO;AAAA,IAC9C,CAAC,SAAS,MAAM,SAAS,CAAC,GAAG,EAAE,SAAS,QAAQ,UAAU,QAAQ;AAAA,IAClE,GAAI,MAAM,aAAa,OAAO,CAAC,IAAI,EAAE,CAAC,SAAS,MAAM,SAAS,CAAC,GAAG,EAAE,SAAS,QAAQ,UAAU,gBAAgB,EAAE;AAAA,EACnH;AACF;AAkBA,IAAM,eAAe,CAAC,SAAkB,WAAmB,WAAoD;AAAA,EAC7G,qBAAqB;AAAA;AAAA;AAAA;AAAA,EAIrB,GAAI,UAAU,EAAE,YAAY,QAAQ,SAAS,GAAG,IAAI,CAAC;AAAA,EACrD,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,0BAA0B,EAAE,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA,EAI5C,8BAA8B,MAAM,aAAa,EAAE,UAAU,SAAS,aAAa,SAAS,IAAI,EAAE,SAAS,OAAO;AAAA,EAClH,4BAA4B,EAAE,UAAU,QAAQ;AAAA,EAChD,6BAA6B,EAAE,UAAU,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IACtF;AAAA,EACF;AACA,MAAI,MAAM,YAAY,QAAQ,QAAQ,eAAe,KAAM,QAAO;AAClE,SAAO,EAAE,GAAG,SAAS,mBAAmB,MAAM,QAAQ,QAAQ;AAChE;AASO,SAAS,WACd,OACA,OACuD;AACvD,QAAM,EAAE,YAAY,MAAM,QAAQ,IAAI;AACtC,SAAO;AAAA,IACL,UAAU,WAAW,MAAM,YAAY;AAAA,IACvC,MAAM,WAAW,KAAK;AAAA,IACtB,QAAQ,WAAW;AAAA,EACrB;AACF;AAEO,SAAS,UACd,OACA,OACA,cACA,OACyB;AACzB,QAAM,EAAE,OAAO,OAAO,MAAM,KAAK,MAAM,OAAO,KAAK,IAAI;AACvD,SAAO;AAAA,IACL,GAAG,WAAW,OAAO,KAAK;AAAA,IAC1B,GAAG,MAAM,OAAO;AAAA,MACd,SAAS,UAAU;AAAA,MACnB,WAAW,OAAO,aAAa;AAAA,MAC/B;AAAA,MACA,SAAS,WAAW,OAAO,KAAK;AAAA,MAChC,aAAa,UAAU,KAAK,EAAE;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,MAAM,WAAW;AAAA,MAC1B,aAAa,QAAQ,MAAM,QAAQ;AAAA,MACnC,WAAW,KAAK,aAAa,KAAK,gBAAgB;AAAA,MAClD;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/base-list-card-layout.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode } from \"react\";\n\nimport { Box } from \"../../../mui/Box\";\nimport type { BaseListCardProps } from \"./base-list-card\";\nimport { rowGutters, type StackPlacement, type useRowShell } from \"./base-list-card-geometry\";\nimport { cellRailsTemplate } from \"./list-card-rails\";\nimport { cellTracks, useCellConfig, type ListCardCellConfig } from \"./list-card-cells\";\n\n/**\n * WHAT SHAPE A ROW TAKES, resolved once: its cells and their template, whether\n * it ends in the \"this opens\" chevron, and what its two-line form keeps.\n *\n * Split from the card at the file-size gate. Everything here decides; nothing\n * here renders but the standalone container.\n */\n\n/**\n * Which cell config applies, and whether this row resolves its own tracks.\n *\n * The list's config wins over the card's: one declaration of the list's shape is\n * the point, so a row inside a group cannot introduce a column of its own. And\n * the template is standalone-only — inside a group the GROUP owns it and the row\n * is subgrid over it, because a row resolving its own tracks is exactly what\n * stops a list from lining up.\n */\nfunction useResolvedCells(\n props: BaseListCardProps,\n inGroup: boolean,\n gutters: { disclose: boolean; drag: boolean; select: boolean },\n): {\n cells: readonly ListCardCellConfig<never>[] | null;\n configured: boolean;\n cellTemplate: string | null;\n} {\n const groupCells = useCellConfig();\n const cells = groupCells ?? props.cells ?? null;\n const configured = cells != null && cells.length > 0 && props.row != null;\n const cellTemplate = configured && !inGroup ? cellRailsTemplate(cellTracks(cells), gutters) : null;\n return { cells, configured, cellTemplate };\n}\n\n/**\n * Whether the row ends in the \"this opens\" chevron: it is live and leads\n * somewhere it can actually go — a click handler, or a link the row renders.\n * Only a named-slot row with a title renders an anchor for `href` (the caption\n * wraps the title), so an `href` alone does not count elsewhere: a chevron on\n * a row that cannot open is the promise the disclosure chevron's docblock\n * warns about. Not when the row expands either:\n * the disclosure chevron already speaks, and a second arrow meaning something\n * else beside it would contradict it.\n */\nfunction rowOpens(\n props: BaseListCardProps,\n shell: ReturnType<typeof useRowShell>,\n configured: boolean,\n expandable: boolean,\n): boolean {\n if (expandable) return false;\n // The named-slot caption renders its anchor only around a title.\n return shell.acts || (shell.actionable && props.href != null && props.title != null && !configured);\n}\n\n/**\n * The cell that takes the VALUE's place when the row stacks: the one the config\n * marks `strong` (\"the figure the row is really about\"), else the last — as\n * long as it is not the first cell, which already holds the title's place.\n */\nfunction valueCellId(cells: readonly ListCardCellConfig<never>[]): string | null {\n const first = cells[0];\n const candidate = cells.find((cell) => cell.strong === true && cell !== first) ?? cells[cells.length - 1];\n return candidate != null && candidate !== first ? candidate.id : null;\n}\n\n/** Everything the row's shape depends on, resolved once. */\nexport function useRowLayout(\n props: BaseListCardProps,\n shell: ReturnType<typeof useRowShell>,\n expandable: boolean,\n): ReturnType<typeof useResolvedCells> & { opens: boolean; stack: StackPlacement } {\n const resolved = useResolvedCells(props, shell.group != null, rowGutters(props, shell));\n const cells = resolved.configured ? resolved.cells : null;\n return {\n ...resolved,\n opens: rowOpens(props, shell, resolved.configured, expandable),\n stack: {\n firstCell: cells?.[0]?.id ?? null,\n valueCell: cells == null ? null : valueCellId(cells),\n expandable,\n },\n };\n}\n\n/**\n * A standalone row's QUERY CONTAINER. A container query matches an ancestor,\n * never the element itself, so the row cannot be the container its own\n * two-line template asks about. In a group the group is the container, and the\n * row must stay its direct child for subgrid, so no wrapper there.\n */\nexport function StandaloneContainer({ inGroup, children }: { inGroup: boolean; children: ReactNode }): React.JSX.Element {\n if (inGroup) return <>{children}</>;\n return <Box sx={{ containerType: \"inline-size\", width: \"100%\", minWidth: 0 }}>{children}</Box>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqGsB;AA1EtB,SAAS,iBACP,OACA,SACA,SAKA;AACA,QAAM,aAAa,cAAc;AACjC,QAAM,QAAQ,cAAc,MAAM,SAAS;AAC3C,QAAM,aAAa,SAAS,QAAQ,MAAM,SAAS,KAAK,MAAM,OAAO;AACrE,QAAM,eAAe,cAAc,CAAC,UAAU,kBAAkB,WAAW,KAAK,GAAG,OAAO,IAAI;AAC9F,SAAO,EAAE,OAAO,YAAY,aAAa;AAC3C;AAYA,SAAS,SACP,OACA,OACA,YACA,YACS;AACT,MAAI,WAAY,QAAO;AAEvB,SAAO,MAAM,QAAS,MAAM,cAAc,MAAM,QAAQ,QAAQ,MAAM,SAAS,QAAQ,CAAC;AAC1F;AAOA,SAAS,YAAY,OAA4D;AAC/E,QAAM,QAAQ,MAAM,CAAC;AACrB,QAAM,YAAY,MAAM,KAAK,CAAC,SAAS,KAAK,WAAW,QAAQ,SAAS,KAAK,KAAK,MAAM,MAAM,SAAS,CAAC;AACxG,SAAO,aAAa,QAAQ,cAAc,QAAQ,UAAU,KAAK;AACnE;AAGO,SAAS,aACd,OACA,OACA,YACiF;AACjF,QAAM,WAAW,iBAAiB,OAAO,MAAM,SAAS,MAAM,WAAW,OAAO,KAAK,CAAC;AACtF,QAAM,QAAQ,SAAS,aAAa,SAAS,QAAQ;AACrD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,OAAO,SAAS,OAAO,OAAO,SAAS,YAAY,UAAU;AAAA,IAC7D,OAAO;AAAA,MACL,WAAW,QAAQ,CAAC,GAAG,MAAM;AAAA,MAC7B,WAAW,SAAS,OAAO,OAAO,YAAY,KAAK;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AACF;AAQO,SAAS,oBAAoB,EAAE,SAAS,SAAS,GAAiE;AACvH,MAAI,QAAS,QAAO,gCAAG,UAAS;AAChC,SAAO,oBAACA,UAAA,EAAI,IAAI,EAAE,eAAe,eAAe,OAAO,QAAQ,UAAU,EAAE,GAAI,UAAS;AAC1F;","names":["default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/base-list-card-slots.tsx"],"sourcesContent":["\"use client\";\n\nimport KeyboardArrowRightIcon from \"@mui/icons-material/KeyboardArrowRight\";\nimport { Fragment, type ReactNode } from \"react\";\n\nimport { DescriptionItem, type DescriptionItemProps } from \"../DescriptionItem\";\nimport { RAIL_GAP_PX } from \"./list-card-rails\";\nimport { Box } from \"../../../mui/Box\";\nimport { Text } from \"../../typography/Text\";\nimport type { Theme } from \"@mui/material/styles/index.js\";\n\nimport { rem, sxRem } from \"../../../tokens/relative\";\n\n/**\n * WHAT SITS IN EACH RAIL.\n *\n * Split from `base-list-card` at the size gate: that module is the shell, the\n * rails and the states; this is the content of each column.\n */\n\n/** Below this the row drops its middle columns. */\nexport const META_BREAK = 520;\n/** …and below this it leaves the shared rails and goes two-line. */\nexport const STACK_BREAK = 360;\n\n/** Money and dates line up only if their digits are the same width. */\nconst TABULAR = { fontVariantNumeric: \"tabular-nums\" } as const;\n\nconst CLAMP = {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n} as const;\n\n/**\n * Title over subtitle — and, when the row navigates, the anchor that covers it.\n *\n * The link is a real `<a>` stretched by `::after` over the whole card rather\n * than a click handler on a `<div>`. That buys cmd-click, middle-click, \"copy\n * link address\", the status bar preview and correct tab order, and it stops the\n * buttons elsewhere in the row from being interactive elements nested inside a\n * clickable one.\n */\nexport function ListCardCaption({\n title,\n subtitle,\n href,\n target,\n testId,\n}: {\n title?: ReactNode;\n subtitle?: ReactNode;\n href?: string;\n target?: string;\n testId?: string;\n}): React.JSX.Element {\n return (\n <Box data-slot=\"caption\" sx={{ minWidth: 0 }}>\n {title != null && (\n <Text variant=\"heading\" size=\"sm\" weight=\"bold\" as=\"p\">\n <Box\n {...(href ? { component: \"a\", href, target } : { component: \"span\" })}\n data-testid={testId}\n sx={{\n display: \"block\",\n lineHeight: 1.2,\n fontSize: sxRem(14.4),\n color: \"inherit\",\n textDecoration: \"none\",\n ...CLAMP,\n ...(href\n ? {\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n inset: 0,\n // Under the checkbox, drag grip, actions and menu, which\n // all raise themselves to 1.\n zIndex: 0,\n },\n \"&:hover\": { textDecoration: \"underline\" },\n }\n : {}),\n }}\n >\n {title}\n </Box>\n </Text>\n )}\n {subtitle != null && (\n <Text variant=\"caption\" size=\"xs\" color=\"secondary\" as=\"p\">\n <Box component=\"span\" sx={{ display: \"block\", ...CLAMP }}>\n {subtitle}\n </Box>\n </Text>\n )}\n </Box>\n );\n}\n\n/** One rule between two columns. Shared, so every gap gets the same mark. */\nfunction MetaRule(): React.JSX.Element {\n return (\n <Box\n aria-hidden\n sx={{\n flex: \"0 0 auto\",\n color: \"text.disabled\",\n opacity: 0.5,\n userSelect: \"none\",\n fontSize: sxRem(14),\n // A cancelled row strikes the whole meta cluster, and a struck `|` is a\n // dagger. The rule is punctuation, not data — nothing to void.\n textDecoration: \"none\",\n }}\n >\n |\n </Box>\n );\n}\n\n/**\n * The middle columns: stacked label-over-value pairs, separated by a rule.\n *\n * Stacked rather than side by side because `DATA 05/08/2026` inline spends the\n * horizontal room the value rail needs, and the separator is what stops two\n * adjacent pairs reading as one four-word phrase.\n *\n * EVEN GAPS, NOT EVEN BOXES. The rail takes a share of the row's spare width\n * per pair (see `metaRail`), and the obvious way to spend it — give every pair\n * an equal-width box and centre its content — puts the separator on the BOX\n * boundary, which is only the visual midpoint when both pairs are the same\n * width. They never are: `05/08/2026, 13:45` reaches almost to the edge of its\n * box while `PIX` stops well short of its own, so the rule ends up crowded\n * against the date and adrift from the method.\n *\n * So the pairs are sized to their content and the SPARE space is what gets\n * divided evenly. `space-evenly` gives every gap — including the two either\n * side of each separator — the same width, which puts each rule exactly halfway\n * between the two labels it separates, whatever they happen to say.\n */\nexport function ListCardMeta({\n meta,\n metaSlot,\n trailingRule,\n}: {\n meta?: DescriptionItemProps[];\n metaSlot?: ReactNode;\n /** Close the run with a rule, dividing the last pair from the value. */\n trailingRule?: boolean;\n}): React.JSX.Element {\n const items = meta ?? [];\n return (\n <Box\n data-slot=\"meta\"\n sx={(theme) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-evenly\",\n // A FLOOR, not the spacing itself: `space-evenly` supplies the rest, and\n // this is only what keeps a rail with no room to spare from running the\n // date straight into the rule.\n gap: 1,\n whiteSpace: \"nowrap\",\n ...TABULAR,\n // Rung 1 of the ladder.\n [`@container (max-width: ${rem(theme, META_BREAK)})`]: { display: \"none\" },\n })}\n >\n {items.map((item, index) => (\n <Fragment key={`${item.label}-${index}`}>\n {/* ITS OWN ITEM, not the first child of the pair that follows it.\n Nested inside, the rule travelled with that pair's centred content\n and came to rest nearer one label than the other — a separator\n visibly closer to MÉTODO than to DATA reads as belonging to it. */}\n {index > 0 && <MetaRule />}\n {/* Centred: a stacked pair sitting in its own column reads as one\n unit only when the label is over the value rather than flush left\n of a value shorter than it — `MÉTODO` above `PIX` was visibly\n unhinged from it. Overridable per item. */}\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: 0,\n // Sized to the pair, so the gaps either side of it are free space\n // that `space-evenly` can equalise.\n flex: \"0 0 auto\",\n }}\n >\n <DescriptionItem orientation=\"vertical\" align=\"center\" {...item} />\n </Box>\n </Fragment>\n ))}\n {metaSlot}\n {trailingRule && items.length > 0 && <MetaRule />}\n </Box>\n );\n}\n\n/**\n * The value sits flush against the meta rail, with no gap of its own.\n *\n * Its divider is now the LAST ITEM OF THE META CLUSTER, placed by the same\n * `space-evenly` that places the rules between the pairs — so it is equidistant\n * from `PIX` and from `R$ 13,90` for free, which a rule centred in the rail gap\n * could never be: the cluster's content stops well short of the rail's right\n * edge, leaving that rule 150px from the method and 12px from the money.\n *\n * Cancelling this one gap is what makes the two distances equal. Below\n * `META_BREAK` the cluster (and its rule) are gone, so the gap comes back —\n * otherwise the value would sit straight against the title.\n */\nconst valueFlush = (theme: Theme) => ({\n marginLeft: rem(theme, -RAIL_GAP_PX),\n [`@container (max-width: ${rem(theme, META_BREAK)})`]: { marginLeft: 0 },\n});\n\n/** The value, on its own rail, never truncated and never shunted by the chip. */\nfunction ListCardValue({ value }: { value: ReactNode }): React.JSX.Element {\n return (\n <Text variant=\"body\" size=\"sm\" weight=\"medium\" as=\"span\">\n <Box\n component=\"span\"\n sx={{ fontSize: sxRem(14), whiteSpace: \"nowrap\", ...TABULAR }}\n >\n {value}\n </Box>\n </Text>\n );\n}\n\n/**\n * The actions and the menu, at the end of the row.\n *\n * Actions are revealed on hover and `:focus-within` — always-visible buttons on\n * every row of fifty is a lot of chrome for something used on one of them.\n * `:focus-within` is what keeps them reachable by keyboard, and `visibility`\n * rather than `display` keeps their space reserved so nothing shifts.\n */\nexport function ListCardActions({\n actions,\n alwaysVisible,\n menu,\n opens = false,\n testId,\n}: {\n actions?: ReactNode;\n alwaysVisible?: boolean;\n menu?: ReactNode;\n /** End the row with the \"this opens\" chevron. */\n opens?: boolean;\n testId: (slot: string) => string | undefined;\n}): React.JSX.Element | null {\n if (actions == null && menu == null && !opens) return null;\n return (\n // z-index 1: above the stretched link, so these stay clickable. The box\n // itself lets clicks through (`pointer-events: none`, re-enabled on its\n // children): only the controls inside it are meant to catch one, and the\n // chevron, which re-disables it, must hand its click to the row or link\n // underneath rather than swallow it.\n <Box\n data-slot=\"actions\"\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 0.5,\n position: \"relative\",\n zIndex: 1,\n pointerEvents: \"none\",\n \"& > *\": { pointerEvents: \"auto\" },\n }}\n >\n {actions && (\n <Box\n data-testid={testId(\"actions\")}\n onClick={(event) => event.stopPropagation()}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 0.5,\n ...(alwaysVisible\n ? {}\n : {\n visibility: \"hidden\",\n \".MuiPaper-root:hover &, .MuiPaper-root:focus-within &\": {\n visibility: \"visible\",\n },\n }),\n }}\n >\n {actions}\n </Box>\n )}\n {menu && (\n <Box data-testid={testId(\"menu\")} onClick={(event) => event.stopPropagation()}>\n {menu}\n </Box>\n )}\n {opens && <OpenChevron testId={testId(\"open\")} />}\n </Box>\n );\n}\n\n/**\n * THE \"THIS OPENS\" CHEVRON, at the end of a row that leads somewhere.\n *\n * A row that navigates or opens a record looked exactly like a row that does\n * nothing until a pointer hovered it, and a phone has no hover. Always visible —\n * unlike `actions`, it is a statement about the row, not a control to reveal.\n *\n * Decorative to assistive tech (`aria-hidden`): the row itself is the button or\n * the link, and already says so. It takes no click of its own for the same\n * reason; the click falls through to the row.\n */\nfunction OpenChevron({ testId }: { testId?: string }): React.JSX.Element {\n return (\n <Box\n component=\"span\"\n aria-hidden\n data-testid={testId}\n sx={{ display: \"flex\", alignItems: \"center\", color: \"text.secondary\", pointerEvents: \"none !important\" }}\n >\n <KeyboardArrowRightIcon fontSize=\"small\" />\n </Box>\n );\n}\n\n/** Value and actions — separate rails, not one flex run. */\nexport function ListCardTail({\n value,\n separated,\n actions,\n actionsAlwaysVisible,\n menu,\n opens,\n testId,\n}: {\n value?: ReactNode;\n /** Whether a meta cluster precedes the value and wants dividing from it. */\n separated?: boolean;\n actions?: ReactNode;\n actionsAlwaysVisible?: boolean;\n menu?: ReactNode;\n opens?: boolean;\n testId: (slot: string) => string | undefined;\n}): React.JSX.Element {\n return (\n <>\n <Box\n data-slot=\"value\"\n sx={(theme) => ({\n textAlign: \"right\",\n ...(separated && value != null ? valueFlush(theme) : {}),\n })}\n data-testid={testId(\"value\")}\n >\n {value != null && <ListCardValue value={value} />}\n </Box>\n <ListCardActions\n actions={actions}\n alwaysVisible={actionsAlwaysVisible}\n menu={menu}\n opens={opens}\n testId={testId}\n />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,OAAO,4BAA4B;AACnC,SAAS,gBAAgC;AAsDrC,SAoSA,YAAAA,WAjSM,KAHN;AApCG,IAAM,aAAa;AAEnB,IAAM,cAAc;AAG3B,IAAM,UAAU,EAAE,oBAAoB,eAAe;AAErD,IAAM,QAAQ;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAWO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMsB;AACpB,SACE,qBAACC,UAAA,EAAI,aAAU,WAAU,IAAI,EAAE,UAAU,EAAE,GACxC;AAAA,aAAS,QACR,oBAAC,QAAK,SAAQ,WAAU,MAAK,MAAK,QAAO,QAAO,IAAG,KACjD;AAAA,MAACA;AAAA,MAAA;AAAA,QACE,GAAI,OAAO,EAAE,WAAW,KAAK,MAAM,OAAO,IAAI,EAAE,WAAW,OAAO;AAAA,QACnE,eAAa;AAAA,QACb,IAAI;AAAA,UACF,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,UAAU,MAAM,IAAI;AAAA,UACpB,OAAO;AAAA,UACP,gBAAgB;AAAA,UAChB,GAAG;AAAA,UACH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AAA,QACf;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["Fragment","default"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|