@12-apps/ui 6.57.0 → 6.58.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 +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.js +2 -2
- package/dist/_internal/components/data-display/Carousel/Carousel.js +2 -2
- package/dist/_internal/components/data-display/Chart/Chart.js +4 -4
- package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
- 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/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +18 -18
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +20 -19
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +5 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +45 -0
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +5 -4
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.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 +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +17 -17
- 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 +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-selection-extra.js +3 -1
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-url-echo.js +13 -0
- package/dist/_internal/components/data-display/DataViews/data-views-url-echo.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +1 -1
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js +1 -1
- package/dist/_internal/components/data-display/index.js +14 -14
- package/dist/_internal/components/index.js +22 -22
- package/dist/_internal/components/layout/ContentToolbar/ContentToolbar.js +1 -1
- package/dist/_internal/components/layout/index.js +1 -1
- 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 +3 -3
- package/dist/charts.js +6 -6
- package/dist/{chunk-MKAA3YIJ.js → chunk-3K7WN2PO.js} +3 -3
- package/dist/{chunk-573XC4HK.js → chunk-4QKS5Y35.js} +2 -2
- package/dist/{chunk-KX75HM5U.js → chunk-5YDS6HO3.js} +7 -2
- package/dist/{chunk-KX75HM5U.js.map → chunk-5YDS6HO3.js.map} +1 -1
- package/dist/{chunk-N4MR4EMC.js → chunk-6D2PFC5C.js} +2 -2
- package/dist/{chunk-LJKWWXZD.js → chunk-6OSUK2C7.js} +28 -22
- package/dist/chunk-6OSUK2C7.js.map +1 -0
- package/dist/{chunk-ICSXPZXT.js → chunk-6QBT5TPS.js} +2 -2
- package/dist/{chunk-C67FDYG7.js → chunk-7CWZI6MQ.js} +5 -5
- package/dist/{chunk-JL77BSOL.js → chunk-AQI3UK6P.js} +2 -2
- package/dist/{chunk-A6EUQDRK.js → chunk-ARJIKW56.js} +4 -2
- package/dist/chunk-ARJIKW56.js.map +1 -0
- package/dist/{chunk-GI24X7XA.js → chunk-DZIRCD2W.js} +2 -2
- package/dist/{chunk-53ACGKBW.js → chunk-EDBP62WG.js} +3 -3
- package/dist/{chunk-YXIVQFNW.js → chunk-EWIKSTJV.js} +4 -4
- package/dist/{chunk-LWZ2K225.js → chunk-FXZUVZON.js} +6 -6
- package/dist/chunk-G6EJLEVV.js +75 -0
- package/dist/chunk-G6EJLEVV.js.map +1 -0
- package/dist/{chunk-IK2ZVV3M.js → chunk-GK7JNSMK.js} +2 -2
- package/dist/{chunk-HFBQCJNP.js → chunk-HCYRCU4W.js} +2 -2
- package/dist/{chunk-BJMNAPKH.js → chunk-HH7PM5HT.js} +10 -22
- package/dist/chunk-HH7PM5HT.js.map +1 -0
- package/dist/{chunk-7AAJYWC3.js → chunk-HPO7PB4F.js} +2 -2
- package/dist/{chunk-WF3P7GE5.js → chunk-I3CQBEKS.js} +2 -2
- package/dist/{chunk-RREWYOKS.js → chunk-IL4FCC54.js} +2 -2
- package/dist/{chunk-7M3DRP7Q.js → chunk-ILNO4ZJ6.js} +3 -3
- package/dist/{chunk-2CJZLL5Y.js → chunk-NHVL2QPG.js} +2 -1
- package/dist/{chunk-2CJZLL5Y.js.map → chunk-NHVL2QPG.js.map} +1 -1
- package/dist/{chunk-45PGSVOH.js → chunk-NTJUAPJM.js} +10 -8
- package/dist/chunk-NTJUAPJM.js.map +1 -0
- package/dist/{chunk-EUPUEMFX.js → chunk-PC4H5LVB.js} +7 -7
- package/dist/{chunk-KEKOPD43.js → chunk-PQ7RWH7L.js} +4 -2
- package/dist/chunk-PQ7RWH7L.js.map +1 -0
- package/dist/{chunk-HRMB72E4.js → chunk-QHP5PZNC.js} +2 -1
- package/dist/{chunk-HRMB72E4.js.map → chunk-QHP5PZNC.js.map} +1 -1
- package/dist/{chunk-GNBCSTXF.js → chunk-QKAYXAQE.js} +6 -6
- package/dist/{chunk-GNBCSTXF.js.map → chunk-QKAYXAQE.js.map} +1 -1
- package/dist/{chunk-TZFBJ47T.js → chunk-SFLNHCA2.js} +39 -15
- package/dist/chunk-SFLNHCA2.js.map +1 -0
- package/dist/{chunk-OBMPE6PW.js → chunk-SSDYEOU4.js} +5 -5
- package/dist/{chunk-I6ESCBY3.js → chunk-TF27Z27K.js} +2 -2
- package/dist/{chunk-JF5LQOGB.js → chunk-U47KRLEW.js} +57 -45
- package/dist/chunk-U47KRLEW.js.map +1 -0
- package/dist/{chunk-RBHBJDOZ.js → chunk-UEU5NSIG.js} +4 -4
- package/dist/chunk-V4V2N6YJ.js +55 -0
- package/dist/chunk-V4V2N6YJ.js.map +1 -0
- package/dist/{chunk-G76BNXWE.js → chunk-XW5SEW3H.js} +6 -6
- package/dist/{chunk-46ZATLQV.js → chunk-YIKFYWKD.js} +3 -3
- package/dist/{chunk-4JBS6NOT.js → chunk-ZWBGQYVO.js} +35 -6
- package/dist/chunk-ZWBGQYVO.js.map +1 -0
- package/dist/{chunk-VWW2EXH7.js → chunk-ZYJZHXFU.js} +4 -4
- package/dist/data-display/Avatar.js +2 -2
- package/dist/data-display/Badge.js +2 -2
- package/dist/data-display/CardKit.js +10 -10
- package/dist/data-display/Carousel.js +2 -2
- package/dist/data-display/Chart.js +6 -6
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +25 -23
- package/dist/en-US.js +1 -1
- package/dist/layout/ContentToolbar.js +1 -1
- package/dist/locales.js +2 -2
- package/dist/navigation/SectionNav.js +9 -9
- package/dist/pt-BR.js +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-geometry.d.ts +29 -1
- 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-layout.d.ts +46 -0
- package/dist/types/components/data-display/DataViews/base-list-card-layout.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/base-list-card-slots.d.ts +5 -2
- 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 +10 -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-grid-parts.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-selection-extra.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-selection-extra.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-shell-toolbar.d.ts +3 -1
- package/dist/types/components/data-display/DataViews/data-views-shell-toolbar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-toolbar.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-toolbar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-url-echo.d.ts +47 -0
- package/dist/types/components/data-display/DataViews/data-views-url-echo.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/list-card-rails.d.ts +17 -2
- package/dist/types/components/data-display/DataViews/list-card-rails.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.d.ts +3 -2
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.types.d.ts +14 -0
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.types.d.ts.map +1 -1
- package/dist/types/en-US.data-display.d.ts.map +1 -1
- package/dist/types/pt-BR.data-display.d.ts.map +1 -1
- package/dist/user-avatar.js +3 -3
- package/package.json +1 -1
- package/src/components/data-display/DataViews/DataViewsTableBase.tsx +7 -36
- package/src/components/data-display/DataViews/base-list-card-geometry.tsx +114 -40
- package/src/components/data-display/DataViews/base-list-card-layout.tsx +104 -0
- package/src/components/data-display/DataViews/base-list-card-slots.tsx +47 -3
- package/src/components/data-display/DataViews/base-list-card.tsx +65 -68
- package/src/components/data-display/DataViews/data-views-copy.ts +7 -0
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +2 -1
- package/src/components/data-display/DataViews/data-views-selection-extra.ts +10 -1
- package/src/components/data-display/DataViews/data-views-shell-toolbar.tsx +4 -0
- package/src/components/data-display/DataViews/data-views-toolbar.tsx +4 -0
- package/src/components/data-display/DataViews/data-views-url-echo.ts +134 -0
- package/src/components/data-display/DataViews/list-card-rails.tsx +22 -6
- package/src/components/layout/ContentToolbar/ContentToolbar.md +5 -2
- package/src/components/layout/ContentToolbar/ContentToolbar.tsx +51 -10
- package/src/components/layout/ContentToolbar/ContentToolbar.types.ts +14 -0
- package/src/en-US.data-display.ts +1 -0
- package/src/pt-BR.data-display.ts +1 -0
- package/dist/chunk-45PGSVOH.js.map +0 -1
- package/dist/chunk-4JBS6NOT.js.map +0 -1
- package/dist/chunk-A6EUQDRK.js.map +0 -1
- package/dist/chunk-BJMNAPKH.js.map +0 -1
- package/dist/chunk-JF5LQOGB.js.map +0 -1
- package/dist/chunk-KEKOPD43.js.map +0 -1
- package/dist/chunk-LJKWWXZD.js.map +0 -1
- package/dist/chunk-TZFBJ47T.js.map +0 -1
- /package/dist/{chunk-MKAA3YIJ.js.map → chunk-3K7WN2PO.js.map} +0 -0
- /package/dist/{chunk-573XC4HK.js.map → chunk-4QKS5Y35.js.map} +0 -0
- /package/dist/{chunk-N4MR4EMC.js.map → chunk-6D2PFC5C.js.map} +0 -0
- /package/dist/{chunk-ICSXPZXT.js.map → chunk-6QBT5TPS.js.map} +0 -0
- /package/dist/{chunk-C67FDYG7.js.map → chunk-7CWZI6MQ.js.map} +0 -0
- /package/dist/{chunk-JL77BSOL.js.map → chunk-AQI3UK6P.js.map} +0 -0
- /package/dist/{chunk-GI24X7XA.js.map → chunk-DZIRCD2W.js.map} +0 -0
- /package/dist/{chunk-53ACGKBW.js.map → chunk-EDBP62WG.js.map} +0 -0
- /package/dist/{chunk-YXIVQFNW.js.map → chunk-EWIKSTJV.js.map} +0 -0
- /package/dist/{chunk-LWZ2K225.js.map → chunk-FXZUVZON.js.map} +0 -0
- /package/dist/{chunk-IK2ZVV3M.js.map → chunk-GK7JNSMK.js.map} +0 -0
- /package/dist/{chunk-HFBQCJNP.js.map → chunk-HCYRCU4W.js.map} +0 -0
- /package/dist/{chunk-7AAJYWC3.js.map → chunk-HPO7PB4F.js.map} +0 -0
- /package/dist/{chunk-WF3P7GE5.js.map → chunk-I3CQBEKS.js.map} +0 -0
- /package/dist/{chunk-RREWYOKS.js.map → chunk-IL4FCC54.js.map} +0 -0
- /package/dist/{chunk-7M3DRP7Q.js.map → chunk-ILNO4ZJ6.js.map} +0 -0
- /package/dist/{chunk-EUPUEMFX.js.map → chunk-PC4H5LVB.js.map} +0 -0
- /package/dist/{chunk-OBMPE6PW.js.map → chunk-SSDYEOU4.js.map} +0 -0
- /package/dist/{chunk-I6ESCBY3.js.map → chunk-TF27Z27K.js.map} +0 -0
- /package/dist/{chunk-RBHBJDOZ.js.map → chunk-UEU5NSIG.js.map} +0 -0
- /package/dist/{chunk-G76BNXWE.js.map → chunk-XW5SEW3H.js.map} +0 -0
- /package/dist/{chunk-46ZATLQV.js.map → chunk-YIKFYWKD.js.map} +0 -0
- /package/dist/{chunk-VWW2EXH7.js.map → chunk-ZYJZHXFU.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
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/** Tracks for a cell-configured row: gutters, leading, the cells, then the menu. */\nexport function cellRailsTemplate(cells: readonly string[]): string {\n return [\n DEFAULT_RAILS.disclose,\n DEFAULT_RAILS.drag,\n DEFAULT_RAILS.select,\n DEFAULT_RAILS.leading,\n ...cells,\n DEFAULT_RAILS.actions,\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;AAgUpD;AAhQC,SAAS,SAAS,SAAyB;AAChD,SAAO,uBAAuB,KAAK,IAAI,SAAS,CAAC,CAAC;AACpD;AAkBO,SAAS,aAAa,aAA0D;AACrF,SAAO,cAAc,IACjB,EAAE,SAAS,mBAAmB,MAAM,SAAS,WAAW,EAAE,IAC1D,EAAE,SAAS,kBAAkB,MAAM,OAAO;AAChD;AAEO,IAAM,gBAA2B;AAAA,EACtC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA;AAAA;AAAA,EAGT,GAAG,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjB,OAAO;AAAA,EACP,SAAS;AACX;AAgBA,IAAM,mBAAmB,cAAqC,IAAI;AAG3D,SAAS,eAAsC;AACpD,SAAO,WAAW,gBAAgB;AACpC;AAWO,SAAS,cAAc,OAA8B;AAC1D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EACR,EACG,OAAO,CAAC,SAAyB,QAAQ,IAAI,EAC7C,KAAK,GAAG;AACb;AAMO,IAAM,WAAW;AAGjB,IAAM,cAAc,WAAW;AAoB/B,SAAS,iBACd,SACA,aACQ;AACR,SAAO,cAAc;AAAA,IACnB,GAAG;AAAA;AAAA;AAAA,IAGH,GAAG,aAAa,WAAW;AAAA,IAC3B,GAAI,QAAQ,WAAW,CAAC,IAAI,EAAE,UAAU,KAAK;AAAA,IAC7C,GAAI,QAAQ,OAAO,CAAC,IAAI,EAAE,MAAM,KAAK;AAAA,IACrC,GAAI,QAAQ,SAAS,CAAC,IAAI,EAAE,QAAQ,KAAK;AAAA,EAC3C,CAAC;AACH;AAGO,IAAM,aAAa;AAU1B,IAAM,mBAAmB;AAGlB,SAAS,kBAAkB,OAAkC;AAClE,SAAO;AAAA,IACL,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,GAAG;AAAA,IACH,cAAc;AAAA,EAChB,EAAE,KAAK,GAAG;AACZ;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
|
+
{"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;AAgVpD;AAhRC,SAAS,SAAS,SAAyB;AAChD,SAAO,uBAAuB,KAAK,IAAI,SAAS,CAAC,CAAC;AACpD;AAkBO,SAAS,aAAa,aAA0D;AACrF,SAAO,cAAc,IACjB,EAAE,SAAS,mBAAmB,MAAM,SAAS,WAAW,EAAE,IAC1D,EAAE,SAAS,kBAAkB,MAAM,OAAO;AAChD;AAEO,IAAM,gBAA2B;AAAA,EACtC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA;AAAA;AAAA,EAGT,GAAG,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjB,OAAO;AAAA,EACP,SAAS;AACX;AAgBA,IAAM,mBAAmB,cAAqC,IAAI;AAG3D,SAAS,eAAsC;AACpD,SAAO,WAAW,gBAAgB;AACpC;AAWO,SAAS,cAAc,OAA8B;AAC1D,SAAO;AAAA,I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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"]}
|
|
@@ -23,9 +23,32 @@ var selectionButtonSx = {
|
|
|
23
23
|
textTransform: "none",
|
|
24
24
|
color: "text.primary"
|
|
25
25
|
};
|
|
26
|
+
function SelectAllBox({
|
|
27
|
+
hasSelection,
|
|
28
|
+
allSelected,
|
|
29
|
+
selectAll,
|
|
30
|
+
clearSelection,
|
|
31
|
+
selectAllTestId,
|
|
32
|
+
selectAllLabel
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Checkbox,
|
|
36
|
+
{
|
|
37
|
+
size: "small",
|
|
38
|
+
checked: allSelected ?? hasSelection,
|
|
39
|
+
indeterminate: hasSelection && allSelected === false,
|
|
40
|
+
onChange: () => hasSelection && allSelected !== false ? clearSelection() : selectAll(),
|
|
41
|
+
"data-testid": `${selectAllTestId}-checkbox`,
|
|
42
|
+
inputProps: { "aria-label": selectAllLabel },
|
|
43
|
+
sx: { p: 0.5, display: { xs: "inline-flex", md: "none" } }
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
26
47
|
function SelectionCluster({
|
|
27
48
|
hasSelection,
|
|
49
|
+
allSelected,
|
|
28
50
|
selectedCount,
|
|
51
|
+
selectedCountLabel,
|
|
29
52
|
selectAll,
|
|
30
53
|
clearSelection,
|
|
31
54
|
actions,
|
|
@@ -78,20 +101,21 @@ function SelectionCluster({
|
|
|
78
101
|
}
|
|
79
102
|
),
|
|
80
103
|
/* @__PURE__ */ jsx(
|
|
81
|
-
|
|
104
|
+
SelectAllBox,
|
|
82
105
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
hasSelection,
|
|
107
|
+
allSelected,
|
|
108
|
+
selectAll,
|
|
109
|
+
clearSelection,
|
|
110
|
+
selectAllTestId,
|
|
111
|
+
selectAllLabel
|
|
89
112
|
}
|
|
90
113
|
),
|
|
91
114
|
hasSelection ? /* @__PURE__ */ jsx(
|
|
92
115
|
SelectionState,
|
|
93
116
|
{
|
|
94
117
|
selectedCount,
|
|
118
|
+
selectedCountLabel,
|
|
95
119
|
clearSelection,
|
|
96
120
|
clearAllTestId,
|
|
97
121
|
clearAllText,
|
|
@@ -105,6 +129,7 @@ function SelectionCluster({
|
|
|
105
129
|
}
|
|
106
130
|
function SelectionState({
|
|
107
131
|
selectedCount,
|
|
132
|
+
selectedCountLabel,
|
|
108
133
|
clearSelection,
|
|
109
134
|
clearAllTestId,
|
|
110
135
|
clearAllText,
|
|
@@ -124,18 +149,13 @@ function SelectionState({
|
|
|
124
149
|
}
|
|
125
150
|
),
|
|
126
151
|
/* @__PURE__ */ jsx(Divider, { orientation: "vertical", flexItem: true, sx: { height: sxRem(16), alignSelf: "center" } }),
|
|
127
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
128
153
|
Typography,
|
|
129
154
|
{
|
|
130
155
|
component: "span",
|
|
131
156
|
"data-testid": "selected-count-indicator",
|
|
132
157
|
sx: { fontSize: sxRem(14), color: "text.secondary", whiteSpace: "nowrap", flexShrink: 0 },
|
|
133
|
-
children:
|
|
134
|
-
selectedCount,
|
|
135
|
-
" ",
|
|
136
|
-
selectedCount === 1 ? "item" : "items",
|
|
137
|
-
" selected"
|
|
138
|
-
]
|
|
158
|
+
children: selectedCountLabel(selectedCount)
|
|
139
159
|
}
|
|
140
160
|
),
|
|
141
161
|
selectionExtra !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -202,7 +222,9 @@ function BrowsingClusters({
|
|
|
202
222
|
}
|
|
203
223
|
function ContentToolbar({
|
|
204
224
|
hasSelection,
|
|
225
|
+
allSelected,
|
|
205
226
|
selectedCount,
|
|
227
|
+
selectedCountLabel,
|
|
206
228
|
selectAll,
|
|
207
229
|
clearSelection,
|
|
208
230
|
rightControls,
|
|
@@ -244,7 +266,9 @@ function ContentToolbar({
|
|
|
244
266
|
selectAllText,
|
|
245
267
|
clearAllText,
|
|
246
268
|
hasSelection,
|
|
269
|
+
allSelected,
|
|
247
270
|
selectedCount,
|
|
271
|
+
selectedCountLabel,
|
|
248
272
|
selectAll,
|
|
249
273
|
clearSelection,
|
|
250
274
|
actions,
|
|
@@ -273,4 +297,4 @@ function ContentToolbar({
|
|
|
273
297
|
export {
|
|
274
298
|
ContentToolbar
|
|
275
299
|
};
|
|
276
|
-
//# sourceMappingURL=chunk-
|
|
300
|
+
//# sourceMappingURL=chunk-SFLNHCA2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/ContentToolbar/ContentToolbar.tsx"],"sourcesContent":["'use client';\n\nimport Box from '@mui/material/Box/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport Checkbox from '@mui/material/Checkbox/index.js';\nimport Divider from '@mui/material/Divider/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport React from 'react';\n\nimport type { ContentToolbarProps } from './ContentToolbar.types';\nimport { fieldRadiusPx } from '../../../tokens/field-radius';\nimport { sxRem } from '../../../tokens/relative';\n\nconst selectionButtonSx = {\n minWidth: 0,\n height: 'auto',\n borderRadius: fieldRadiusPx,\n fontWeight: 600,\n py: 0.5,\n px: 1.5,\n fontSize: sxRem(12),\n textTransform: 'none',\n color: 'text.primary',\n} as const;\n\ntype SelectionClusterProps = Pick<\n ContentToolbarProps,\n | 'hasSelection'\n | 'selectedCount'\n | 'selectedCountLabel'\n | 'allSelected'\n | 'selectAll'\n | 'clearSelection'\n | 'actions'\n | 'selectionExtra'\n | 'selectAllTestId'\n | 'clearAllTestId'\n | 'edgeAlign'\n | 'selectAllLabel'\n | 'selectAllText'\n | 'clearAllText'\n>;\n\n/**\n * The phone's select-all box. Checked only when everything is ticked and\n * partial while some is, when the host says which (`allSelected`) — the same\n * reading as the table's header checkbox. A partial box selects the rest, as\n * the header does; a full one clears.\n */\nfunction SelectAllBox({\n hasSelection,\n allSelected,\n selectAll,\n clearSelection,\n selectAllTestId,\n selectAllLabel,\n}: Pick<\n ContentToolbarProps,\n 'hasSelection' | 'allSelected' | 'selectAll' | 'clearSelection' | 'selectAllTestId' | 'selectAllLabel'\n>): React.JSX.Element {\n return (\n <Checkbox\n size=\"small\"\n checked={allSelected ?? hasSelection}\n indeterminate={hasSelection && allSelected === false}\n onChange={() => (hasSelection && allSelected !== false ? clearSelection() : selectAll())}\n data-testid={`${selectAllTestId}-checkbox`}\n inputProps={{ 'aria-label': selectAllLabel }}\n sx={{ p: 0.5, display: { xs: 'inline-flex', md: 'none' } }}\n />\n );\n}\n\n/** The left cluster: Select All + (when selecting) Clear All / count / actions. */\nfunction SelectionCluster({\n hasSelection,\n allSelected,\n selectedCount,\n selectedCountLabel,\n selectAll,\n clearSelection,\n actions,\n selectionExtra,\n selectAllTestId,\n clearAllTestId,\n edgeAlign = false,\n selectAllLabel,\n selectAllText,\n clearAllText,\n}: SelectionClusterProps): React.JSX.Element {\n const actionsSlot = actions !== undefined && (\n <Box sx={{ ml: 0.5, display: 'flex', flexShrink: 0, alignItems: 'center' }}>{actions}</Box>\n );\n return (\n <Box\n sx={{\n display: 'flex',\n minWidth: 0,\n // Browsing (mobile): don't grow, so the controls sit on the SAME line as\n // the checkbox (no orphaned selection row). Desktop: grow to push\n // controls right.\n //\n // SELECTING (mobile) it must be able to shrink instead. Its children are\n // all `flex-shrink: 0`, so a cluster pinned at content width cannot wrap\n // and the row painted past the toolbar's own edge — on Produtos at 390px\n // that took \"Ações\" off-screen behind a sideways scroll, which is the\n // one control the selection exists to reach.\n flex: { xs: hasSelection ? '1 1 auto' : '0 0 auto', md: 1 },\n alignItems: 'center',\n // Wrapping is the phone's answer, and only the phone's: below `md` the\n // cluster carries the count, the scope control and \"Ações\" at once, and\n // no combination of those fits 320px on one line. From `md` up it stays\n // a single line, where it always fitted.\n flexWrap: { xs: 'wrap', md: 'nowrap' },\n columnGap: 1.5,\n rowGap: 1,\n ml: edgeAlign ? -1.5 : 0,\n }}\n >\n {/* Desktop: a \"Select All\" text button (md+). Mobile: a compact checkbox\n that toggles select-all/clear — the text would eat the tight row. */}\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"inherit\"\n onClick={selectAll}\n data-testid={selectAllTestId}\n sx={{ ...selectionButtonSx, display: { xs: 'none', md: 'inline-flex' } }}\n >\n {selectAllText}\n </Button>\n <SelectAllBox\n hasSelection={hasSelection}\n allSelected={allSelected}\n selectAll={selectAll}\n clearSelection={clearSelection}\n selectAllTestId={selectAllTestId}\n selectAllLabel={selectAllLabel}\n />\n {hasSelection ? (\n <SelectionState\n selectedCount={selectedCount}\n selectedCountLabel={selectedCountLabel}\n clearSelection={clearSelection}\n clearAllTestId={clearAllTestId}\n clearAllText={clearAllText}\n selectionExtra={selectionExtra}\n />\n ) : null}\n {actionsSlot}\n </Box>\n );\n}\n\n/**\n * What the cluster shows once something IS ticked: Clear All, the count, and\n * the host's own `selectionExtra`.\n *\n * Its own component only because the cluster around it is at the complexity\n * gate's line ceiling — but the split falls where the meaning does. Everything\n * here exists only while a selection does, and the `actions` slot deliberately\n * stays OUTSIDE it: a toolbar may carry actions while browsing too.\n */\nfunction SelectionState({\n selectedCount,\n selectedCountLabel,\n clearSelection,\n clearAllTestId,\n clearAllText,\n selectionExtra,\n}: Pick<\n ContentToolbarProps,\n 'selectedCount' | 'selectedCountLabel' | 'clearSelection' | 'clearAllTestId' | 'clearAllText' | 'selectionExtra'\n>): React.JSX.Element {\n return (\n <>\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"inherit\"\n onClick={clearSelection}\n data-testid={clearAllTestId}\n sx={selectionButtonSx}\n >\n {clearAllText}\n </Button>\n <Divider orientation=\"vertical\" flexItem sx={{ height: sxRem(16), alignSelf: 'center' }} />\n <Typography\n component=\"span\"\n data-testid=\"selected-count-indicator\"\n sx={{ fontSize: sxRem(14), color: 'text.secondary', whiteSpace: 'nowrap', flexShrink: 0 }}\n >\n {selectedCountLabel(selectedCount)}\n </Typography>\n {selectionExtra !== undefined && (\n <>\n {/* A DELIBERATE break, not a wrap that happened to land here. What\n follows — \"Seleção: 48 produtos — todas as páginas\", its \"Limpar\n seleção\", and \"Ações\" — is a sentence about the selection plus the\n control that acts on it, and letting the phone break it wherever it\n ran out of room split that sentence mid-phrase. Zero height so it\n costs nothing but the row gap, and `display:none` from `md` up,\n where the line still fits. */}\n <Box\n aria-hidden\n sx={{ flexBasis: '100%', height: 0, display: { xs: 'block', md: 'none' } }}\n />\n {selectionExtra}\n </>\n )}\n </>\n );\n}\n\n/**\n * The BROWSING half of the toolbar: search + filters on the left, the page's\n * own controls on the right. Split out of {@link ContentToolbar} so that\n * function stays inside the complexity gate — it is layout only, and the\n * decision of whether to show it at all is made by the caller.\n */\nfunction BrowsingClusters({\n leadingControls,\n rightControls,\n hasSelection,\n edgeAlign,\n}: {\n leadingControls?: React.ReactNode;\n rightControls: React.ReactNode;\n hasSelection: boolean;\n edgeAlign: boolean;\n}): React.JSX.Element {\n return (\n <>\n {/* minWidth:0 lets this cluster be the one that gives up width as the row\n * tightens, which is what the filter overflow measures against. */}\n {leadingControls !== undefined && (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n flexGrow: 1,\n minWidth: 0,\n // The collapse ladder has a FLOOR — below roughly 400px even the\n // fully-collapsed row does not fit, and its controls cannot shrink\n // (they are flexShrink:0 so an over-packed row sheds instead of\n // squeezing). Past that point this scrolls rather than letting them\n // paint outside the toolbar, which is what a narrow phone did.\n overflowX: 'auto',\n // No scrollbar gutter stealing height on the common case.\n scrollbarWidth: 'thin',\n }}\n >\n {leadingControls}\n </Box>\n )}\n {/* ml:auto keeps the controls right-aligned even when the cluster wraps to\n * its own row (where justify-content:space-between would otherwise snap a\n * lone item to the left); it's a no-op on a shared row. */}\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n // Same single-line rule as the row itself: this cluster wrapping\n // INTERNALLY buys a second line just as surely as the row wrapping\n // does. It bit at exactly 900px, the `md` breakpoint where the \"N de\n // N\" counter appears and pushes Exibir/Exportar over the edge.\n flexWrap: leadingControls === undefined ? 'wrap' : 'nowrap',\n // Tight (5px) when browsing so the controls fit one line beside the\n // checkbox; roomier (14px) in selection mode where they get their own row.\n gap: hasSelection ? sxRem(14) : sxRem(5),\n ml: 'auto',\n mr: edgeAlign ? -1.5 : 0,\n '& > *': { flexShrink: 0 },\n }}\n >\n {rightControls}\n </Box>\n </>\n );\n}\n\n/**\n * Shared toolbar for content pages (Favorites, Personal Space, Recents, …). The\n * left cluster owns selection chrome — **Select All**, and once items are\n * selected, **Clear All** + the count (`selectedCountLabel`) + an optional `actions`\n * slot. The right cluster is a free `rightControls` slot for page-specific\n * controls (ViewSelector, SortByDropdown, MultiSelectDropdown, FilterTrigger).\n *\n * Faithful, generic MUI port of the reference `ContentPageToolbar` — the\n * domain-specific default actions are intentionally left to the consumer via\n * the `actions` slot so this stays agnostic and reusable across projects.\n *\n * @example\n * ```tsx\n * <ContentToolbar\n * hasSelection={selected.size > 0}\n * selectedCount={selected.size}\n * selectedCountLabel={(n) => `${n} ${n === 1 ? 'selecionado' : 'selecionados'}`}\n * selectAll={selectAll}\n * clearSelection={clear}\n * rightControls={\n * <>\n * <ViewSelector viewMode={view} onViewModeChange={setView} zoom={zoom} onZoomChange={setZoom} />\n * <SortByDropdown fields={FIELDS} activeField={field} onFieldChange={setField} />\n * <MultiSelectDropdown label=\"Content Type\" options={types} selected={typeSet} onToggle={toggle} onClear={clear} />\n * <FilterTrigger open={panelOpen} onOpenChange={setPanelOpen} hasActiveFilters={hasFilters} />\n * </>\n * }\n * />\n * ```\n */\nexport function ContentToolbar({\n hasSelection,\n allSelected,\n selectedCount,\n selectedCountLabel,\n selectAll,\n clearSelection,\n rightControls,\n leadingControls,\n actions,\n selectionExtra,\n selectAllTestId,\n clearAllTestId,\n edgeAlign = false,\n exclusiveSelection = false,\n selectAllLabel,\n selectAllText,\n clearAllText,\n}: ContentToolbarProps): React.JSX.Element {\n // Under `exclusiveSelection` the two states are alternatives, not neighbours:\n // browsing shows the controls and no checkbox, selecting shows the checkbox\n // and no controls. Anything else double-books the row.\n const showSelection = !exclusiveSelection || hasSelection;\n const showControls = !exclusiveSelection || !hasSelection;\n return (\n // Two clusters on one line. They may wrap onto separate rows ONLY for a\n // toolbar without `leadingControls` — one carrying search + filters is\n // driven by a measured collapse ladder (see `useFilterOverflow`), and a\n // wrap there is the ladder having failed: it would silently buy a second\n // row instead of shedding a control into \"Mais\", which is the one outcome\n // the ladder exists to prevent.\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 2,\n flexWrap: leadingControls === undefined ? 'wrap' : 'nowrap',\n rowGap: 1,\n }}\n >\n {showSelection && (\n <SelectionCluster\n selectAllText={selectAllText}\n clearAllText={clearAllText}\n hasSelection={hasSelection}\n allSelected={allSelected}\n selectedCount={selectedCount}\n selectedCountLabel={selectedCountLabel}\n selectAll={selectAll}\n clearSelection={clearSelection}\n actions={actions}\n selectionExtra={selectionExtra}\n selectAllTestId={selectAllTestId}\n clearAllTestId={clearAllTestId}\n selectAllLabel={selectAllLabel}\n edgeAlign={edgeAlign}\n />\n )}\n\n {showControls && (\n <BrowsingClusters\n leadingControls={leadingControls}\n rightControls={rightControls}\n hasSelection={hasSelection}\n edgeAlign={edgeAlign}\n />\n )}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;AAEA,OAAO,SAAS;AAChB,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,OAAO,aAAa;AACpB,OAAO,gBAAgB;AAuDnB,SAsII,UAtIJ,KAiCA,YAjCA;AAhDJ,IAAM,oBAAoB;AAAA,EACxB,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,UAAU,MAAM,EAAE;AAAA,EAClB,eAAe;AAAA,EACf,OAAO;AACT;AA0BA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAGsB;AACpB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,eAAe;AAAA,MACxB,eAAe,gBAAgB,gBAAgB;AAAA,MAC/C,UAAU,MAAO,gBAAgB,gBAAgB,QAAQ,eAAe,IAAI,UAAU;AAAA,MACtF,eAAa,GAAG,eAAe;AAAA,MAC/B,YAAY,EAAE,cAAc,eAAe;AAAA,MAC3C,IAAI,EAAE,GAAG,KAAK,SAAS,EAAE,IAAI,eAAe,IAAI,OAAO,EAAE;AAAA;AAAA,EAC3D;AAEJ;AAGA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AACF,GAA6C;AAC3C,QAAM,cAAc,YAAY,UAC9B,oBAAC,OAAI,IAAI,EAAE,IAAI,KAAK,SAAS,QAAQ,YAAY,GAAG,YAAY,SAAS,GAAI,mBAAQ;AAEvF,SACE;AAAA,IAAC;AAAA;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ACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACF,GAA2C;AAIzC,QAAM,gBAAgB,CAAC,sBAAsB;AAC7C,QAAM,eAAe,CAAC,sBAAsB,CAAC;AAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOE;AAAA,MAAC;AAAA;AAAA,QACC,IAAI;AAAA,UACF,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,gBAAgB;AAAA,UAChB,KAAK;AAAA,UACL,UAAU,oBAAoB,SAAY,SAAS;AAAA,UACnD,QAAQ;AAAA,QACV;AAAA,QAEC;AAAA,2BACC;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UAGD,gBACC;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA;AAEJ;","names":[]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
containerStyles,
|
|
3
|
+
frameBox
|
|
4
|
+
} from "./chunk-Z64TMGYT.js";
|
|
1
5
|
import {
|
|
2
6
|
CarouselTrack
|
|
3
7
|
} from "./chunk-EMNDJ57M.js";
|
|
@@ -7,10 +11,6 @@ import {
|
|
|
7
11
|
import {
|
|
8
12
|
CarouselChrome
|
|
9
13
|
} from "./chunk-QCTG7LIX.js";
|
|
10
|
-
import {
|
|
11
|
-
containerStyles,
|
|
12
|
-
frameBox
|
|
13
|
-
} from "./chunk-Z64TMGYT.js";
|
|
14
14
|
import {
|
|
15
15
|
withDefaults
|
|
16
16
|
} from "./chunk-HPK33ACY.js";
|
|
@@ -151,4 +151,4 @@ var Carousel = (props) => {
|
|
|
151
151
|
export {
|
|
152
152
|
Carousel
|
|
153
153
|
};
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-SSDYEOU4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Avatar
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XW5SEW3H.js";
|
|
4
4
|
import {
|
|
5
5
|
Card
|
|
6
6
|
} from "./chunk-J2QIICWP.js";
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
UserAvatar,
|
|
75
75
|
UserMenu
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
77
|
+
//# sourceMappingURL=chunk-TF27Z27K.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
STACK_BREAK
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZWBGQYVO.js";
|
|
4
4
|
import {
|
|
5
5
|
CARD_RADIUS,
|
|
6
6
|
cardSurfaceStyles,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
RAIL_GAP,
|
|
17
17
|
railsTemplateFor,
|
|
18
18
|
useListRails
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QKAYXAQE.js";
|
|
20
20
|
import {
|
|
21
21
|
DENSITY_ROW_PADDING
|
|
22
22
|
} from "./chunk-MUIBNHJW.js";
|
|
@@ -36,8 +36,39 @@ function clickKeys(onClick) {
|
|
|
36
36
|
onClick();
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
var cellSlot = (id) => `& > [data-slot=${JSON.stringify(`cell-${id}`)}]`;
|
|
40
|
+
function stackedCells(stack) {
|
|
41
|
+
if (stack.firstCell == null) return {};
|
|
42
|
+
return {
|
|
43
|
+
'& > [data-slot^="cell-"]': { display: "none" },
|
|
44
|
+
[cellSlot(stack.firstCell)]: { display: "flex", gridArea: "1 / 3" },
|
|
45
|
+
...stack.valueCell == null ? {} : { [cellSlot(stack.valueCell)]: { display: "flex", gridArea: "2 / 3 / 3 / 5" } }
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
var stackedRowSx = (inGroup, railCount, stack) => ({
|
|
49
|
+
gridTemplateColumns: "auto auto minmax(0, 1fr) max-content",
|
|
50
|
+
// The GROUP's track count, which a configured list sets from its cells
|
|
51
|
+
// (`cellRailCount`) — not the named-slot RAIL_COUNT, which over-spans a
|
|
52
|
+
// configured group and adds an implicit track at its end.
|
|
53
|
+
...inGroup ? { gridColumn: `span ${railCount}` } : {},
|
|
54
|
+
rowGap: 0.75,
|
|
55
|
+
columnGap: 1,
|
|
56
|
+
'& > [data-slot="drag"]': { display: "none" },
|
|
57
|
+
// The disclosure button, when there is one, under the checkbox: the head of
|
|
58
|
+
// the row, where it sits at every other width — never beside the menu, where
|
|
59
|
+
// it read as an "open" arrow. A reserved empty gutter takes no place at all.
|
|
60
|
+
'& > [data-slot="disclose"]': stack.expandable ? { gridArea: "2 / 1", justifySelf: "center" } : { display: "none" },
|
|
61
|
+
'& > [data-slot="select"]': { gridArea: "1 / 1" },
|
|
62
|
+
'& > [data-slot="leading"]': { gridArea: "1 / 2" },
|
|
63
|
+
'& > [data-slot="caption"]': { gridArea: "1 / 3" },
|
|
64
|
+
'& > [data-slot="actions"]': { gridArea: "1 / 4", justifyContent: "flex-end" },
|
|
65
|
+
'& > [data-slot="meta"]': { display: "none" },
|
|
66
|
+
// Second line, starting under the title rather than under the checkbox.
|
|
67
|
+
'& > [data-slot="value"]': { gridArea: "2 / 4", textAlign: "right" },
|
|
68
|
+
...stackedCells(stack)
|
|
69
|
+
});
|
|
39
70
|
var rowSx = (theme, opts) => {
|
|
40
|
-
const { inGroup, railCount, cellTemplate, gutters, metaColumns, pad, padY, scale, divider, interactive, draggable } = opts;
|
|
71
|
+
const { inGroup, railCount, cellTemplate, gutters, metaColumns, pad, padY, scale, divider, interactive, draggable, stack } = opts;
|
|
41
72
|
return {
|
|
42
73
|
position: "relative",
|
|
43
74
|
borderRadius: CARD_RADIUS,
|
|
@@ -49,11 +80,12 @@ var rowSx = (theme, opts) => {
|
|
|
49
80
|
// computed `grid-template-columns: 1222px` on a card asking for subgrid.)
|
|
50
81
|
//
|
|
51
82
|
// So inside a group the GROUP is the query container and the row is the
|
|
52
|
-
// subgrid
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
83
|
+
// subgrid. Standalone, the row is its own grid but NOT its own container:
|
|
84
|
+
// a container query matches an ANCESTOR, never the element itself, so a
|
|
85
|
+
// row that was its own container placed its children for two lines while
|
|
86
|
+
// its own template stayed wide. A standalone card renders inside a wrapper
|
|
87
|
+
// that is the container (`BaseListCard`).
|
|
88
|
+
...inGroup ? { gridColumn: `span ${railCount}`, gridTemplateColumns: "subgrid" } : { gridTemplateColumns: cellTemplate ?? railsTemplateFor(gutters, metaColumns) },
|
|
57
89
|
alignItems: "center",
|
|
58
90
|
// Wide enough that the meta cluster, the value and the status read as three
|
|
59
91
|
// columns rather than one run of text — the complaint that started all this
|
|
@@ -72,34 +104,8 @@ var rowSx = (theme, opts) => {
|
|
|
72
104
|
outlineColor: "primary.main",
|
|
73
105
|
outlineOffset: rem(theme, 2)
|
|
74
106
|
},
|
|
75
|
-
// TWO-LINE
|
|
76
|
-
|
|
77
|
-
// The standard mobile transaction row: what the record IS and what it COST
|
|
78
|
-
// on the first line, the supporting detail on the second. Better than
|
|
79
|
-
// truncating four columns into ellipses, and the reason each slot carries a
|
|
80
|
-
// `data-slot` — the placement is explicit rather than whatever order the
|
|
81
|
-
// children happen to be in.
|
|
82
|
-
//
|
|
83
|
-
// [ select ][ leading ][ title …………… ][ menu ]
|
|
84
|
-
// [ (cells) …………… ][ value ]
|
|
85
|
-
//
|
|
86
|
-
// The MENU stays in the top-right corner at every width. It is the row's
|
|
87
|
-
// one fixed landmark — an overflow that moves to the second line on a phone
|
|
88
|
-
// is an overflow nobody finds twice.
|
|
89
|
-
[`@container (max-width: ${rem(theme, STACK_BREAK)})`]: {
|
|
90
|
-
gridTemplateColumns: "auto auto minmax(0, 1fr) max-content",
|
|
91
|
-
...inGroup ? { gridColumn: `span ${RAIL_COUNT}` } : {},
|
|
92
|
-
rowGap: 0.75,
|
|
93
|
-
columnGap: 1,
|
|
94
|
-
'& > [data-slot="drag"]': { display: "none" },
|
|
95
|
-
'& > [data-slot="select"]': { gridArea: "1 / 1" },
|
|
96
|
-
'& > [data-slot="leading"]': { gridArea: "1 / 2" },
|
|
97
|
-
'& > [data-slot="caption"]': { gridArea: "1 / 3" },
|
|
98
|
-
'& > [data-slot="actions"]': { gridArea: "1 / 4", justifyContent: "flex-end" },
|
|
99
|
-
'& > [data-slot="meta"]': { display: "none" },
|
|
100
|
-
// Second line, starting under the title rather than under the checkbox.
|
|
101
|
-
'& > [data-slot="value"]': { gridArea: "2 / 4", textAlign: "right" }
|
|
102
|
-
},
|
|
107
|
+
// TWO-LINE below STACK_BREAK: see {@link stackedRowSx}.
|
|
108
|
+
[`@container (max-width: ${rem(theme, STACK_BREAK)})`]: stackedRowSx(inGroup, railCount, stack),
|
|
103
109
|
...divider ? { borderRadius: 0, borderWidth: 0, borderBottomWidth: 1, borderStyle: "solid" } : {}
|
|
104
110
|
};
|
|
105
111
|
};
|
|
@@ -158,26 +164,31 @@ function rowSurface(props, shell) {
|
|
|
158
164
|
if (props.divider !== true || surface.borderColor != null) return surface;
|
|
159
165
|
return { ...surface, borderBottomColor: theme.palette.divider };
|
|
160
166
|
}
|
|
161
|
-
function
|
|
162
|
-
const {
|
|
167
|
+
function rowGutters(props, shell) {
|
|
168
|
+
const { selectable, drag, reserve } = shell;
|
|
169
|
+
return {
|
|
170
|
+
disclose: reserve || props.children != null,
|
|
171
|
+
drag: reserve || drag.draggable,
|
|
172
|
+
select: reserve || selectable
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function rowStyles(props, shell, cellTemplate, stack) {
|
|
176
|
+
const { theme, group, drag, pad, padY, scale, acts } = shell;
|
|
163
177
|
return {
|
|
164
178
|
...rowSurface(props, shell),
|
|
165
179
|
...rowSx(theme, {
|
|
166
180
|
inGroup: group !== null,
|
|
167
181
|
railCount: group?.railCount ?? RAIL_COUNT,
|
|
168
182
|
cellTemplate,
|
|
169
|
-
gutters:
|
|
170
|
-
disclose: reserve || props.children != null,
|
|
171
|
-
drag: reserve || drag.draggable,
|
|
172
|
-
select: reserve || selectable
|
|
173
|
-
},
|
|
183
|
+
gutters: rowGutters(props, shell),
|
|
174
184
|
metaColumns: metaShape(props).columns,
|
|
175
185
|
pad,
|
|
176
186
|
padY,
|
|
177
187
|
scale,
|
|
178
188
|
divider: props.divider ?? false,
|
|
179
189
|
interactive: acts || props.href != null,
|
|
180
|
-
draggable: drag.draggable && drag.handleProps === void 0
|
|
190
|
+
draggable: drag.draggable && drag.handleProps === void 0,
|
|
191
|
+
stack
|
|
181
192
|
})
|
|
182
193
|
};
|
|
183
194
|
}
|
|
@@ -187,6 +198,7 @@ export {
|
|
|
187
198
|
metaShape,
|
|
188
199
|
useRowShell,
|
|
189
200
|
actionProps,
|
|
201
|
+
rowGutters,
|
|
190
202
|
rowStyles
|
|
191
203
|
};
|
|
192
|
-
//# sourceMappingURL=chunk-
|
|
204
|
+
//# sourceMappingURL=chunk-U47KRLEW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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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AAA,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,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildChartContext
|
|
3
|
+
} from "./chunk-7CWZI6MQ.js";
|
|
1
4
|
import {
|
|
2
5
|
ChartLegendContent,
|
|
3
6
|
ChartTooltipContent
|
|
4
7
|
} from "./chunk-RIRTW5EU.js";
|
|
5
|
-
import {
|
|
6
|
-
buildChartContext
|
|
7
|
-
} from "./chunk-C67FDYG7.js";
|
|
8
8
|
import {
|
|
9
9
|
uiInk
|
|
10
10
|
} from "./chunk-SSX5ITPM.js";
|
|
@@ -318,4 +318,4 @@ function renderChartByType(props, theme) {
|
|
|
318
318
|
export {
|
|
319
319
|
renderChartByType
|
|
320
320
|
};
|
|
321
|
-
//# sourceMappingURL=chunk-
|
|
321
|
+
//# sourceMappingURL=chunk-UEU5NSIG.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rowGutters
|
|
3
|
+
} from "./chunk-U47KRLEW.js";
|
|
4
|
+
import {
|
|
5
|
+
cellRailsTemplate
|
|
6
|
+
} from "./chunk-QKAYXAQE.js";
|
|
7
|
+
import {
|
|
8
|
+
cellTracks,
|
|
9
|
+
useCellConfig
|
|
10
|
+
} from "./chunk-COYGTEN5.js";
|
|
11
|
+
import {
|
|
12
|
+
default as default2
|
|
13
|
+
} from "./chunk-6DPAWXZ3.js";
|
|
14
|
+
|
|
15
|
+
// src/components/data-display/DataViews/base-list-card-layout.tsx
|
|
16
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
17
|
+
function useResolvedCells(props, inGroup, gutters) {
|
|
18
|
+
const groupCells = useCellConfig();
|
|
19
|
+
const cells = groupCells ?? props.cells ?? null;
|
|
20
|
+
const configured = cells != null && cells.length > 0 && props.row != null;
|
|
21
|
+
const cellTemplate = configured && !inGroup ? cellRailsTemplate(cellTracks(cells), gutters) : null;
|
|
22
|
+
return { cells, configured, cellTemplate };
|
|
23
|
+
}
|
|
24
|
+
function rowOpens(props, shell, configured, expandable) {
|
|
25
|
+
if (expandable) return false;
|
|
26
|
+
return shell.acts || shell.actionable && props.href != null && props.title != null && !configured;
|
|
27
|
+
}
|
|
28
|
+
function valueCellId(cells) {
|
|
29
|
+
const first = cells[0];
|
|
30
|
+
const candidate = cells.find((cell) => cell.strong === true && cell !== first) ?? cells[cells.length - 1];
|
|
31
|
+
return candidate != null && candidate !== first ? candidate.id : null;
|
|
32
|
+
}
|
|
33
|
+
function useRowLayout(props, shell, expandable) {
|
|
34
|
+
const resolved = useResolvedCells(props, shell.group != null, rowGutters(props, shell));
|
|
35
|
+
const cells = resolved.configured ? resolved.cells : null;
|
|
36
|
+
return {
|
|
37
|
+
...resolved,
|
|
38
|
+
opens: rowOpens(props, shell, resolved.configured, expandable),
|
|
39
|
+
stack: {
|
|
40
|
+
firstCell: cells?.[0]?.id ?? null,
|
|
41
|
+
valueCell: cells == null ? null : valueCellId(cells),
|
|
42
|
+
expandable
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function StandaloneContainer({ inGroup, children }) {
|
|
47
|
+
if (inGroup) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
48
|
+
return /* @__PURE__ */ jsx(default2, { sx: { containerType: "inline-size", width: "100%", minWidth: 0 }, children });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
useRowLayout,
|
|
53
|
+
StandaloneContainer
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-V4V2N6YJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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: \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AE,eAAe,eAAe,OAAO,QAAQ,UAAU,EAAE,GAAI,UAAS;AAC1F;","names":["default"]}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AVATAR_DEFAULTS,
|
|
3
|
-
contentTypeOf,
|
|
4
|
-
pickAvatarContent
|
|
5
|
-
} from "./chunk-3ZVUNSFF.js";
|
|
6
1
|
import {
|
|
7
2
|
AvatarView
|
|
8
3
|
} from "./chunk-GYDUXL3D.js";
|
|
@@ -12,6 +7,11 @@ import {
|
|
|
12
7
|
GROUP_MAX,
|
|
13
8
|
GROUP_OVERLAP
|
|
14
9
|
} from "./chunk-6ZZGK5DT.js";
|
|
10
|
+
import {
|
|
11
|
+
AVATAR_DEFAULTS,
|
|
12
|
+
contentTypeOf,
|
|
13
|
+
pickAvatarContent
|
|
14
|
+
} from "./chunk-3ZVUNSFF.js";
|
|
15
15
|
import {
|
|
16
16
|
rem
|
|
17
17
|
} from "./chunk-YKCAJ2TN.js";
|
|
@@ -175,4 +175,4 @@ export {
|
|
|
175
175
|
Avatar,
|
|
176
176
|
AvatarGroup
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-XW5SEW3H.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SectionNavRail
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EDBP62WG.js";
|
|
4
4
|
import {
|
|
5
5
|
SectionNavBar
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZYJZHXFU.js";
|
|
7
7
|
|
|
8
8
|
// src/components/navigation/SectionNav/SectionNav.tsx
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -52,4 +52,4 @@ function SectionNav({
|
|
|
52
52
|
export {
|
|
53
53
|
SectionNav
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-YIKFYWKD.js.map
|