@12-apps/ui 6.72.0 → 6.73.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/components-catalog.md +1 -1
- package/dist/_internal/components/index.js +7 -7
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +5 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +8 -7
- package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +8 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +3 -2
- package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +4 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.railCreate.js +3 -2
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +3 -2
- package/dist/_internal/components/navigation/index.js +8 -7
- package/dist/{chunk-XS4NQ6LD.js → chunk-23LPXHR2.js} +61 -35
- package/dist/chunk-23LPXHR2.js.map +1 -0
- package/dist/{chunk-WP7KPWCP.js → chunk-24HHUCWB.js} +14 -2
- package/dist/chunk-24HHUCWB.js.map +1 -0
- package/dist/{chunk-WY7FR7I4.js → chunk-ILJ3FXIC.js} +17 -8
- package/dist/chunk-ILJ3FXIC.js.map +1 -0
- package/dist/{chunk-VI2IXBOO.js → chunk-KPEKD5SG.js} +24 -13
- package/dist/chunk-KPEKD5SG.js.map +1 -0
- package/dist/{chunk-2STYL5PF.js → chunk-NM46HQSW.js} +2 -2
- package/dist/{chunk-LWQGIN2M.js → chunk-NQP72RTD.js} +9 -6
- package/dist/chunk-NQP72RTD.js.map +1 -0
- package/dist/{chunk-OBGUD2PG.js → chunk-SNWCT6JN.js} +91 -42
- package/dist/chunk-SNWCT6JN.js.map +1 -0
- package/dist/navigation/SectionNav.js +8 -7
- package/dist/types/components/navigation/SectionNav/SectionNav.bar.d.ts +6 -2
- package/dist/types/components/navigation/SectionNav/SectionNav.bar.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.d.ts +4 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts +12 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.primary.d.ts +7 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.primary.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.rail.d.ts +3 -2
- package/dist/types/components/navigation/SectionNav/SectionNav.rail.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.railCreate.d.ts +3 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.railCreate.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts +12 -0
- package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/index.d.ts +1 -0
- package/dist/types/components/navigation/SectionNav/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/navigation/SectionNav/SectionNav.bar.tsx +77 -29
- package/src/components/navigation/SectionNav/SectionNav.md +24 -3
- package/src/components/navigation/SectionNav/SectionNav.parts.tsx +19 -1
- package/src/components/navigation/SectionNav/SectionNav.primary.tsx +39 -11
- package/src/components/navigation/SectionNav/SectionNav.rail.tsx +90 -35
- package/src/components/navigation/SectionNav/SectionNav.railCreate.tsx +23 -5
- package/src/components/navigation/SectionNav/SectionNav.tsx +6 -0
- package/src/components/navigation/SectionNav/SectionNav.types.ts +12 -0
- package/src/components/navigation/SectionNav/index.ts +1 -0
- package/dist/chunk-LWQGIN2M.js.map +0 -1
- package/dist/chunk-OBGUD2PG.js.map +0 -1
- package/dist/chunk-VI2IXBOO.js.map +0 -1
- package/dist/chunk-WP7KPWCP.js.map +0 -1
- package/dist/chunk-WY7FR7I4.js.map +0 -1
- package/dist/chunk-XS4NQ6LD.js.map +0 -1
- /package/dist/{chunk-2STYL5PF.js.map → chunk-NM46HQSW.js.map} +0 -0
|
@@ -2,9 +2,8 @@ import {
|
|
|
2
2
|
Box,
|
|
3
3
|
CONTROL_RESET,
|
|
4
4
|
NOT_LIVE,
|
|
5
|
-
SlotIcon
|
|
6
|
-
|
|
7
|
-
} from "./chunk-WP7KPWCP.js";
|
|
5
|
+
SlotIcon
|
|
6
|
+
} from "./chunk-24HHUCWB.js";
|
|
8
7
|
import {
|
|
9
8
|
rem
|
|
10
9
|
} from "./chunk-YKCAJ2TN.js";
|
|
@@ -20,6 +19,7 @@ function RaisedActionButton({
|
|
|
20
19
|
open,
|
|
21
20
|
closeLabel,
|
|
22
21
|
captioned = false,
|
|
22
|
+
compact = false,
|
|
23
23
|
disabled = false,
|
|
24
24
|
loading = false,
|
|
25
25
|
dataTestId = "raised-action"
|
|
@@ -44,18 +44,26 @@ function RaisedActionButton({
|
|
|
44
44
|
component: "button",
|
|
45
45
|
type: "button",
|
|
46
46
|
...raisedState({ onClick, disabled, loading }),
|
|
47
|
-
|
|
47
|
+
...raisedNames({ label, closeLabel, expanded, compact }),
|
|
48
48
|
"aria-expanded": open,
|
|
49
49
|
"data-testid": dataTestId,
|
|
50
|
-
sx: raisedSx(theme, expanded),
|
|
50
|
+
sx: raisedSx(theme, expanded, compact),
|
|
51
51
|
children: /* @__PURE__ */ jsx(SlotIcon, { icon, loading })
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
|
-
|
|
54
|
+
/* @__PURE__ */ jsx(RaisedCaption, { shown: captioned && !compact, label, inert: disabled || loading })
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
+
function raisedNames({
|
|
60
|
+
label,
|
|
61
|
+
closeLabel,
|
|
62
|
+
expanded,
|
|
63
|
+
compact
|
|
64
|
+
}) {
|
|
65
|
+
return { "aria-label": expanded && closeLabel ? closeLabel : label, title: compact ? label : void 0 };
|
|
66
|
+
}
|
|
59
67
|
function raisedState({
|
|
60
68
|
onClick,
|
|
61
69
|
disabled,
|
|
@@ -69,7 +77,8 @@ function raisedState({
|
|
|
69
77
|
"aria-busy": loading || void 0
|
|
70
78
|
};
|
|
71
79
|
}
|
|
72
|
-
function RaisedCaption({ label, inert }) {
|
|
80
|
+
function RaisedCaption({ shown, label, inert }) {
|
|
81
|
+
if (!shown) return null;
|
|
73
82
|
return /* @__PURE__ */ jsx(
|
|
74
83
|
Typography,
|
|
75
84
|
{
|
|
@@ -81,15 +90,17 @@ function RaisedCaption({ label, inert }) {
|
|
|
81
90
|
}
|
|
82
91
|
);
|
|
83
92
|
}
|
|
84
|
-
function raisedSx(theme, expanded) {
|
|
85
|
-
const size = rem(theme, 52);
|
|
93
|
+
function raisedSx(theme, expanded, compact) {
|
|
94
|
+
const size = rem(theme, compact ? 40 : 52);
|
|
86
95
|
return {
|
|
87
96
|
...CONTROL_RESET,
|
|
88
|
-
|
|
97
|
+
// The ring OUTSIDE the button: the shared ring sits inside the box, in the
|
|
98
|
+
// primary colour, where this button's own fill swallowed it whole.
|
|
99
|
+
"&:focus-visible": { outline: `${rem(theme, 2)} solid ${theme.palette.primary.main}`, outlineOffset: rem(theme, 2) },
|
|
89
100
|
width: size,
|
|
90
101
|
height: size,
|
|
91
102
|
// Lifted half out of the bar: the one control that is not a place.
|
|
92
|
-
marginTop: rem(theme, -18),
|
|
103
|
+
marginTop: rem(theme, compact ? -12 : -18),
|
|
93
104
|
borderRadius: "50%",
|
|
94
105
|
display: "flex",
|
|
95
106
|
alignItems: "center",
|
|
@@ -99,7 +110,7 @@ function raisedSx(theme, expanded) {
|
|
|
99
110
|
boxShadow: theme.shadows[6],
|
|
100
111
|
[NOT_LIVE]: { cursor: "default", bgcolor: "action.disabledBackground", color: "text.disabled", boxShadow: "none" },
|
|
101
112
|
"& svg": {
|
|
102
|
-
fontSize: rem(theme, 26),
|
|
113
|
+
fontSize: rem(theme, compact ? 22 : 26),
|
|
103
114
|
transition: theme.transitions.create("transform", { duration: theme.transitions.duration.shorter }),
|
|
104
115
|
transform: expanded ? "rotate(45deg)" : "none"
|
|
105
116
|
},
|
|
@@ -110,4 +121,4 @@ function raisedSx(theme, expanded) {
|
|
|
110
121
|
export {
|
|
111
122
|
RaisedActionButton
|
|
112
123
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-KPEKD5SG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation/SectionNav/SectionNav.primary.tsx"],"sourcesContent":["import Typography from '@mui/material/Typography/index.js';\nimport { useTheme, type SxProps, type Theme } from '@mui/material/styles/index.js';\nimport type { ReactNode } from 'react';\n\nimport { rem } from '../../../tokens/scales';\n\nimport { Box, CONTROL_RESET, NOT_LIVE, SlotIcon } from './SectionNav.parts';\n\nexport interface RaisedActionButtonProps {\n /**\n * The button's accessible name. Drawn under the button only when\n * `captioned`; the caption is hidden from assistive tech, so the name is\n * read once either way.\n */\n label: string;\n icon: ReactNode;\n onClick: () => void;\n /**\n * Whether what the button opens is open. Omit for a button that opens\n * nothing (a plain action): it then carries no `aria-expanded` and its icon\n * never turns.\n */\n open?: boolean;\n /** The name it takes while `open` — the same control closes what it opened. REQUIRED with `open`. */\n closeLabel?: string;\n /**\n * Draw `label` under the button. A bar of VERBS names the act it is for; a\n * bar of places can leave its one action to the icon.\n */\n captioned?: boolean;\n /**\n * A size down — 40px rather than 52, lifted less — for a compact bar. It\n * draws no caption: a compact bar is icons only, and the name stays the\n * button's `aria-label`.\n */\n compact?: boolean;\n /** Dimmed and not operable: a native `disabled` button. */\n disabled?: boolean;\n /**\n * A write it started is in flight: a spinner replaces the icon, it reports\n * `aria-busy` and `aria-disabled`, and a tap is ignored. It stays focusable,\n * so the keyboard does not lose its place while the write answers.\n */\n loading?: boolean;\n dataTestId?: string;\n}\n\n/**\n * The raised round button in the middle of a bottom bar — the one control in\n * the row that is an ACTION rather than a place.\n *\n * Lifted half out of the bar so it reads as different in kind from the tabs\n * beside it. Uncaptioned it costs the row less width than a tab: that width is\n * what lets a bar keep four labelled tabs AND this button at 320px. A bar of\n * verbs captions it, naming the act under the button.\n *\n * `SectionNav` draws it for its `primary` menu. It is exported on its own for\n * a bar the host already draws — drop it between two tabs, in a flex row.\n */\nexport function RaisedActionButton({\n label,\n icon,\n onClick,\n open,\n closeLabel,\n captioned = false,\n compact = false,\n disabled = false,\n loading = false,\n dataTestId = 'raised-action',\n}: RaisedActionButtonProps): React.JSX.Element {\n const theme = useTheme();\n const expanded = open === true;\n return (\n <Box\n sx={{\n flex: 'none',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'flex-start',\n px: 0.5,\n }}\n >\n <Box\n component=\"button\"\n type=\"button\"\n {...raisedState({ onClick, disabled, loading })}\n {...raisedNames({ label, closeLabel, expanded, compact })}\n aria-expanded={open}\n data-testid={dataTestId}\n sx={raisedSx(theme, expanded, compact)}\n >\n <SlotIcon icon={icon} loading={loading} />\n </Box>\n <RaisedCaption shown={captioned && !compact} label={label} inert={disabled || loading} />\n </Box>\n );\n}\n\n/**\n * The button's name — `closeLabel` while what it opened is open — and, on a\n * compact bar where no word is drawn, the label as its tooltip.\n */\nfunction raisedNames({\n label,\n closeLabel,\n expanded,\n compact,\n}: {\n label: string;\n closeLabel: string | undefined;\n expanded: boolean;\n compact: boolean;\n}): { 'aria-label': string; title: string | undefined } {\n return { 'aria-label': expanded && closeLabel ? closeLabel : label, title: compact ? label : undefined };\n}\n\n/**\n * The button's operability. Only `disabled` is native: an in-flight button\n * keeps its focus, reports `aria-busy` and `aria-disabled`, and drops the click.\n */\nfunction raisedState({\n onClick,\n disabled,\n loading,\n}: {\n onClick: () => void;\n disabled: boolean;\n loading: boolean;\n}): Record<string, unknown> {\n const busy = loading && !disabled;\n return {\n onClick: busy ? undefined : onClick,\n disabled,\n 'aria-disabled': busy ? 'true' : undefined,\n 'aria-busy': loading || undefined,\n };\n}\n\n/**\n * The label under a captioned button — none on a compact bar. Hidden from assistive tech: the button\n * already carries the same words as its name, and reading them twice is noise.\n */\nfunction RaisedCaption({ shown, label, inert }: { shown: boolean; label: string; inert: boolean }): React.JSX.Element | null {\n if (!shown) return null;\n return (\n <Typography\n component=\"span\"\n variant=\"caption\"\n aria-hidden\n sx={{ lineHeight: 1.3, mt: 0.25, whiteSpace: 'nowrap', color: inert ? 'text.disabled' : 'text.primary' }}\n >\n {label}\n </Typography>\n );\n}\n\n/** The round button: lifted half out of the bar, its icon turning while what it opened is open. */\nfunction raisedSx(theme: Theme, expanded: boolean, compact: boolean): SxProps<Theme> {\n const size = rem(theme, compact ? 40 : 52);\n return {\n ...CONTROL_RESET,\n // The ring OUTSIDE the button: the shared ring sits inside the box, in the\n // primary colour, where this button's own fill swallowed it whole.\n '&:focus-visible': { outline: `${rem(theme, 2)} solid ${theme.palette.primary.main}`, outlineOffset: rem(theme, 2) },\n width: size,\n height: size,\n // Lifted half out of the bar: the one control that is not a place.\n marginTop: rem(theme, compact ? -12 : -18),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n bgcolor: 'primary.main',\n color: 'primary.contrastText',\n boxShadow: theme.shadows[6],\n [NOT_LIVE]: { cursor: 'default', bgcolor: 'action.disabledBackground', color: 'text.disabled', boxShadow: 'none' },\n '& svg': {\n fontSize: rem(theme, compact ? 22 : 26),\n transition: theme.transitions.create('transform', { duration: theme.transitions.duration.shorter }),\n transform: expanded ? 'rotate(45deg)' : 'none',\n },\n '@media (prefers-reduced-motion: reduce)': { '& svg': { transition: 'none' } },\n } as SxProps<Theme>;\n}\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,gBAAgB;AACvB,SAAS,gBAA0C;AAyE/C,SAmBI,KAnBJ;AAfG,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AACf,GAA+C;AAC7C,QAAM,QAAQ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,kBAAkB,eAAe;AAAA,MAEtG;AAAA;AAAA,EACH;AAEJ;AAGA,SAAS,SAAS,OAAc,UAAmB,SAAkC;AACnF,QAAM,OAAO,IAAI,OAAO,UAAU,KAAK,EAAE;AACzC,SAAO;AAAA,IACL,GAAG;AAAA;AAAA;AAAA,IAGH,mBAAmB,EAAE,SAAS,GAAG,IAAI,OAAO,CAAC,CAAC,UAAU,MAAM,QAAQ,QAAQ,IAAI,IAAI,eAAe,IAAI,OAAO,CAAC,EAAE;AAAA,IACnH,OAAO;AAAA,IACP,QAAQ;AAAA;AAAA,IAER,WAAW,IAAI,OAAO,UAAU,MAAM,GAAG;AAAA,IACzC,cAAc;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,WAAW,MAAM,QAAQ,CAAC;AAAA,IAC1B,CAAC,QAAQ,GAAG,EAAE,QAAQ,WAAW,SAAS,6BAA6B,OAAO,iBAAiB,WAAW,OAAO;AAAA,IACjH,SAAS;AAAA,MACP,UAAU,IAAI,OAAO,UAAU,KAAK,EAAE;AAAA,MACtC,YAAY,MAAM,YAAY,OAAO,aAAa,EAAE,UAAU,MAAM,YAAY,SAAS,QAAQ,CAAC;AAAA,MAClG,WAAW,WAAW,kBAAkB;AAAA,IAC1C;AAAA,IACA,2CAA2C,EAAE,SAAS,EAAE,YAAY,OAAO,EAAE;AAAA,EAC/E;AACF;","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CountedIcon,
|
|
5
5
|
controlProps,
|
|
6
6
|
focusRing
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-24HHUCWB.js";
|
|
8
8
|
import {
|
|
9
9
|
Drawer,
|
|
10
10
|
DrawerContent,
|
|
@@ -175,4 +175,4 @@ function SectionNavSheet({
|
|
|
175
175
|
export {
|
|
176
176
|
SectionNavSheet
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-NM46HQSW.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SectionNavRail
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SNWCT6JN.js";
|
|
4
4
|
import {
|
|
5
5
|
SectionNavBar
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-23LPXHR2.js";
|
|
7
7
|
|
|
8
8
|
// src/components/navigation/SectionNav/SectionNav.tsx
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -17,7 +17,8 @@ function SectionNav({
|
|
|
17
17
|
heading,
|
|
18
18
|
linkComponent,
|
|
19
19
|
copy,
|
|
20
|
-
dataTestId = "section-nav"
|
|
20
|
+
dataTestId = "section-nav",
|
|
21
|
+
compact = false
|
|
21
22
|
}) {
|
|
22
23
|
if (layout === "rail") {
|
|
23
24
|
return /* @__PURE__ */ jsx(
|
|
@@ -31,7 +32,8 @@ function SectionNav({
|
|
|
31
32
|
heading,
|
|
32
33
|
linkComponent,
|
|
33
34
|
copy,
|
|
34
|
-
dataTestId
|
|
35
|
+
dataTestId,
|
|
36
|
+
compact
|
|
35
37
|
}
|
|
36
38
|
);
|
|
37
39
|
}
|
|
@@ -44,7 +46,8 @@ function SectionNav({
|
|
|
44
46
|
more,
|
|
45
47
|
linkComponent,
|
|
46
48
|
copy,
|
|
47
|
-
dataTestId
|
|
49
|
+
dataTestId,
|
|
50
|
+
compact
|
|
48
51
|
}
|
|
49
52
|
);
|
|
50
53
|
}
|
|
@@ -52,4 +55,4 @@ function SectionNav({
|
|
|
52
55
|
export {
|
|
53
56
|
SectionNav
|
|
54
57
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-NQP72RTD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation/SectionNav/SectionNav.tsx"],"sourcesContent":["import { SectionNavBar } from './SectionNav.bar';\nimport { SectionNavRail } from './SectionNav.rail';\nimport type { SectionNavProps } from './SectionNav.types';\n\n/**\n * A section's own navigation — the handful of screens one kind of work moves\n * between — as a bottom bar on a phone or a rail on a wide screen.\n *\n * It knows no product. The host decides every destination, label, icon,\n * count and which one is current, and renders links through its own router\n * (`linkComponent`). The nav decides only how they are drawn: the order of the\n * bar's slots, the raised primary action, the sheets, the rail's sections.\n *\n * `compact` draws either layout as icons only, a size down, for a host that\n * folds its chrome; the labels stay the controls' names.\n *\n * Which layout to use is the host's call too, because the host knows what\n * else is on screen: a bar next to a sidebar is two navigations competing for\n * one glance.\n */\nexport function SectionNav({\n layout,\n label,\n destinations,\n primary,\n more,\n back,\n heading,\n linkComponent,\n copy,\n dataTestId = 'section-nav',\n compact = false,\n}: SectionNavProps): React.JSX.Element {\n if (layout === 'rail') {\n return (\n <SectionNavRail\n label={label}\n destinations={destinations}\n primary={primary}\n more={more}\n back={back}\n heading={heading}\n linkComponent={linkComponent}\n copy={copy}\n dataTestId={dataTestId}\n compact={compact}\n />\n );\n }\n return (\n <SectionNavBar\n label={label}\n destinations={destinations}\n primary={primary}\n more={more}\n linkComponent={linkComponent}\n copy={copy}\n dataTestId={dataTestId}\n compact={compact}\n />\n );\n}\n"],"mappings":";;;;;;;;AAmCM;AAfC,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,UAAU;AACZ,GAAuC;AACrC,MAAI,WAAW,QAAQ;AACrB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RailCreateMenu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ILJ3FXIC.js";
|
|
4
4
|
import {
|
|
5
5
|
Box,
|
|
6
6
|
CONTROL_RESET,
|
|
7
7
|
CountedIcon,
|
|
8
8
|
NOT_LIVE,
|
|
9
9
|
SlotIcon,
|
|
10
|
+
VISUALLY_HIDDEN,
|
|
10
11
|
controlProps,
|
|
11
12
|
destinationControl,
|
|
12
13
|
focusRing
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-24HHUCWB.js";
|
|
14
15
|
import {
|
|
15
16
|
destinationState,
|
|
16
17
|
isMenu
|
|
@@ -20,9 +21,33 @@ import {
|
|
|
20
21
|
} from "./chunk-YKCAJ2TN.js";
|
|
21
22
|
|
|
22
23
|
// src/components/navigation/SectionNav/SectionNav.rail.tsx
|
|
24
|
+
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
|
23
25
|
import Typography from "@mui/material/Typography/index.js";
|
|
24
26
|
import { useTheme } from "@mui/material/styles/index.js";
|
|
25
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
var ROW_WORDS_SX = { display: "flex", flexDirection: "column", minWidth: 0 };
|
|
29
|
+
function railRowSx(theme, active, compact) {
|
|
30
|
+
return {
|
|
31
|
+
...CONTROL_RESET,
|
|
32
|
+
...focusRing(theme),
|
|
33
|
+
position: compact ? "relative" : void 0,
|
|
34
|
+
display: "flex",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: compact ? "center" : "flex-start",
|
|
37
|
+
gap: compact ? 0 : 1.5,
|
|
38
|
+
width: "100%",
|
|
39
|
+
minHeight: rem(theme, 40),
|
|
40
|
+
px: compact ? 0 : 1.25,
|
|
41
|
+
py: 0.75,
|
|
42
|
+
borderRadius: 1,
|
|
43
|
+
textAlign: "start",
|
|
44
|
+
color: active ? "primary.main" : "text.primary",
|
|
45
|
+
bgcolor: active ? "action.selected" : "transparent",
|
|
46
|
+
"&:hover": { bgcolor: active ? "action.selected" : "action.hover" },
|
|
47
|
+
"& svg": { color: "primary.main", fontSize: rem(theme, 20) },
|
|
48
|
+
[NOT_LIVE]: { color: "text.disabled", "& svg": { color: "text.disabled" } }
|
|
49
|
+
};
|
|
50
|
+
}
|
|
26
51
|
function RailRow({
|
|
27
52
|
label,
|
|
28
53
|
description,
|
|
@@ -33,7 +58,8 @@ function RailRow({
|
|
|
33
58
|
copy,
|
|
34
59
|
testId,
|
|
35
60
|
control,
|
|
36
|
-
loading = false
|
|
61
|
+
loading = false,
|
|
62
|
+
compact = false
|
|
37
63
|
}) {
|
|
38
64
|
const theme = useTheme();
|
|
39
65
|
return /* @__PURE__ */ jsxs(
|
|
@@ -42,25 +68,9 @@ function RailRow({
|
|
|
42
68
|
...control,
|
|
43
69
|
"aria-current": current ? "page" : void 0,
|
|
44
70
|
"aria-busy": loading || void 0,
|
|
71
|
+
title: compact ? label : void 0,
|
|
45
72
|
"data-testid": testId,
|
|
46
|
-
sx:
|
|
47
|
-
...CONTROL_RESET,
|
|
48
|
-
...focusRing(theme),
|
|
49
|
-
display: "flex",
|
|
50
|
-
alignItems: "center",
|
|
51
|
-
gap: 1.5,
|
|
52
|
-
width: "100%",
|
|
53
|
-
minHeight: rem(theme, 40),
|
|
54
|
-
px: 1.25,
|
|
55
|
-
py: 0.75,
|
|
56
|
-
borderRadius: 1,
|
|
57
|
-
textAlign: "start",
|
|
58
|
-
color: active ? "primary.main" : "text.primary",
|
|
59
|
-
bgcolor: active ? "action.selected" : "transparent",
|
|
60
|
-
"&:hover": { bgcolor: active ? "action.selected" : "action.hover" },
|
|
61
|
-
"& svg": { color: "primary.main", fontSize: rem(theme, 20) },
|
|
62
|
-
[NOT_LIVE]: { color: "text.disabled", "& svg": { color: "text.disabled" } }
|
|
63
|
-
},
|
|
73
|
+
sx: railRowSx(theme, active, compact),
|
|
64
74
|
children: [
|
|
65
75
|
/* @__PURE__ */ jsx(
|
|
66
76
|
CountedIcon,
|
|
@@ -72,7 +82,7 @@ function RailRow({
|
|
|
72
82
|
testId: `${testId}-badge`
|
|
73
83
|
}
|
|
74
84
|
),
|
|
75
|
-
/* @__PURE__ */ jsxs(Box, { component: "span", sx:
|
|
85
|
+
/* @__PURE__ */ jsxs(Box, { component: "span", sx: compact ? VISUALLY_HIDDEN : ROW_WORDS_SX, children: [
|
|
76
86
|
/* @__PURE__ */ jsx(Typography, { component: "span", variant: "body2", sx: { fontWeight: active ? 700 : 500 }, children: label }),
|
|
77
87
|
description ? /* @__PURE__ */ jsx(Typography, { component: "span", variant: "caption", color: "text.secondary", children: description }) : null
|
|
78
88
|
] })
|
|
@@ -80,19 +90,28 @@ function RailRow({
|
|
|
80
90
|
}
|
|
81
91
|
);
|
|
82
92
|
}
|
|
83
|
-
function RailHeading({ children }) {
|
|
84
|
-
return /* @__PURE__ */ jsx(
|
|
93
|
+
function RailHeading({ children, compact = false }) {
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
Typography,
|
|
96
|
+
{
|
|
97
|
+
variant: "overline",
|
|
98
|
+
color: "text.secondary",
|
|
99
|
+
sx: compact ? VISUALLY_HIDDEN : { px: 1.25, pt: 1.5, lineHeight: 1.6 },
|
|
100
|
+
children
|
|
101
|
+
}
|
|
102
|
+
);
|
|
85
103
|
}
|
|
86
104
|
function RailMenu({
|
|
87
105
|
menu,
|
|
88
106
|
linkComponent,
|
|
89
107
|
copy,
|
|
90
|
-
testId
|
|
108
|
+
testId,
|
|
109
|
+
compact
|
|
91
110
|
}) {
|
|
92
111
|
return /* @__PURE__ */ jsxs(Box, { component: "section", "data-testid": testId, sx: { display: "flex", flexDirection: "column", gap: 0.25 }, children: [
|
|
93
|
-
/* @__PURE__ */ jsx(RailHeading, { children: menu.title }),
|
|
112
|
+
/* @__PURE__ */ jsx(RailHeading, { compact, children: menu.title }),
|
|
94
113
|
menu.groups.map((group) => /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 0.25 }, children: [
|
|
95
|
-
group.title ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", sx: { px: 1.25, pt: 0.5 }, children: group.title }) : null,
|
|
114
|
+
group.title ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", sx: compact ? VISUALLY_HIDDEN : { px: 1.25, pt: 0.5 }, children: group.title }) : null,
|
|
96
115
|
group.entries.map((entry) => /* @__PURE__ */ jsx(
|
|
97
116
|
RailRow,
|
|
98
117
|
{
|
|
@@ -101,6 +120,7 @@ function RailMenu({
|
|
|
101
120
|
icon: entry.icon,
|
|
102
121
|
count: entry.badge,
|
|
103
122
|
active: entry.active === true,
|
|
123
|
+
compact,
|
|
104
124
|
copy,
|
|
105
125
|
testId: entry.dataTestId ?? `${testId}-entry-${entry.id}`,
|
|
106
126
|
control: controlProps({
|
|
@@ -118,21 +138,26 @@ function RailMenu({
|
|
|
118
138
|
function RailBack({
|
|
119
139
|
back,
|
|
120
140
|
linkComponent,
|
|
121
|
-
testId
|
|
141
|
+
testId,
|
|
142
|
+
compact
|
|
122
143
|
}) {
|
|
123
144
|
const theme = useTheme();
|
|
124
145
|
return /* @__PURE__ */ jsxs(
|
|
125
146
|
Box,
|
|
126
147
|
{
|
|
127
148
|
...controlProps({ href: back.href, linkComponent }),
|
|
149
|
+
title: compact ? back.label : void 0,
|
|
128
150
|
"data-testid": testId,
|
|
129
151
|
sx: {
|
|
130
152
|
...CONTROL_RESET,
|
|
131
153
|
...focusRing(theme),
|
|
154
|
+
position: compact ? "relative" : void 0,
|
|
132
155
|
display: "flex",
|
|
133
156
|
alignItems: "center",
|
|
134
|
-
|
|
135
|
-
|
|
157
|
+
justifyContent: compact ? "center" : "flex-start",
|
|
158
|
+
gap: compact ? 0 : 1,
|
|
159
|
+
minHeight: compact ? rem(theme, 40) : void 0,
|
|
160
|
+
px: compact ? 0 : 1.25,
|
|
136
161
|
py: 0.75,
|
|
137
162
|
mb: 0.5,
|
|
138
163
|
borderRadius: 1,
|
|
@@ -141,8 +166,8 @@ function RailBack({
|
|
|
141
166
|
"& svg": { fontSize: rem(theme, 20) }
|
|
142
167
|
},
|
|
143
168
|
children: [
|
|
144
|
-
back.icon,
|
|
145
|
-
/* @__PURE__ */ jsx(Typography, { component: "span", variant: "body2", sx: { fontWeight: 600 }, children: back.label })
|
|
169
|
+
back.icon ?? (compact ? /* @__PURE__ */ jsx(ArrowBackIcon, { "aria-hidden": true }) : null),
|
|
170
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", variant: "body2", sx: compact ? VISUALLY_HIDDEN : { fontWeight: 600 }, children: back.label })
|
|
146
171
|
]
|
|
147
172
|
}
|
|
148
173
|
);
|
|
@@ -151,11 +176,13 @@ function RailAction({
|
|
|
151
176
|
action,
|
|
152
177
|
linkComponent,
|
|
153
178
|
copy,
|
|
154
|
-
testId
|
|
179
|
+
testId,
|
|
180
|
+
compact
|
|
155
181
|
}) {
|
|
156
182
|
return /* @__PURE__ */ jsx(
|
|
157
183
|
RailRow,
|
|
158
184
|
{
|
|
185
|
+
compact,
|
|
159
186
|
label: action.label,
|
|
160
187
|
icon: action.icon,
|
|
161
188
|
count: void 0,
|
|
@@ -177,12 +204,14 @@ function RailDestination({
|
|
|
177
204
|
destination,
|
|
178
205
|
linkComponent,
|
|
179
206
|
copy,
|
|
180
|
-
testId
|
|
207
|
+
testId,
|
|
208
|
+
compact
|
|
181
209
|
}) {
|
|
182
210
|
const { current, lit } = destinationState(destination);
|
|
183
211
|
return /* @__PURE__ */ jsx(
|
|
184
212
|
RailRow,
|
|
185
213
|
{
|
|
214
|
+
compact,
|
|
186
215
|
label: destination.label,
|
|
187
216
|
icon: destination.icon,
|
|
188
217
|
count: destination.badge,
|
|
@@ -204,7 +233,8 @@ function SectionNavRail({
|
|
|
204
233
|
heading,
|
|
205
234
|
linkComponent,
|
|
206
235
|
copy,
|
|
207
|
-
dataTestId
|
|
236
|
+
dataTestId,
|
|
237
|
+
compact = false
|
|
208
238
|
}) {
|
|
209
239
|
return /* @__PURE__ */ jsxs(
|
|
210
240
|
Box,
|
|
@@ -223,21 +253,40 @@ function SectionNavRail({
|
|
|
223
253
|
bgcolor: "background.paper"
|
|
224
254
|
},
|
|
225
255
|
children: [
|
|
226
|
-
back ? /* @__PURE__ */ jsx(RailBack, { back, linkComponent, testId: `${dataTestId}-back
|
|
227
|
-
heading ? /* @__PURE__ */ jsx(RailHeading, { children: heading }) : null,
|
|
228
|
-
isMenu(primary) ? /* @__PURE__ */ jsx(
|
|
256
|
+
back ? /* @__PURE__ */ jsx(RailBack, { back, linkComponent, testId: `${dataTestId}-back`, compact }) : null,
|
|
257
|
+
heading ? /* @__PURE__ */ jsx(RailHeading, { compact, children: heading }) : null,
|
|
258
|
+
isMenu(primary) ? /* @__PURE__ */ jsx(
|
|
259
|
+
RailCreateMenu,
|
|
260
|
+
{
|
|
261
|
+
menu: primary,
|
|
262
|
+
linkComponent,
|
|
263
|
+
copy,
|
|
264
|
+
testId: `${dataTestId}-primary`,
|
|
265
|
+
compact
|
|
266
|
+
}
|
|
267
|
+
) : null,
|
|
229
268
|
destinations.map((destination) => /* @__PURE__ */ jsx(
|
|
230
269
|
RailDestination,
|
|
231
270
|
{
|
|
232
271
|
destination,
|
|
233
272
|
linkComponent,
|
|
234
273
|
copy,
|
|
235
|
-
testId: destination.dataTestId ?? `${dataTestId}-dest-${destination.id}
|
|
274
|
+
testId: destination.dataTestId ?? `${dataTestId}-dest-${destination.id}`,
|
|
275
|
+
compact
|
|
236
276
|
},
|
|
237
277
|
destination.id
|
|
238
278
|
)),
|
|
239
|
-
primary && !isMenu(primary) ? /* @__PURE__ */ jsx(
|
|
240
|
-
|
|
279
|
+
primary && !isMenu(primary) ? /* @__PURE__ */ jsx(
|
|
280
|
+
RailAction,
|
|
281
|
+
{
|
|
282
|
+
action: primary,
|
|
283
|
+
linkComponent,
|
|
284
|
+
copy,
|
|
285
|
+
testId: `${dataTestId}-primary`,
|
|
286
|
+
compact
|
|
287
|
+
}
|
|
288
|
+
) : null,
|
|
289
|
+
more ? /* @__PURE__ */ jsx(RailMenu, { menu: more, linkComponent, copy, testId: `${dataTestId}-more`, compact }) : null
|
|
241
290
|
]
|
|
242
291
|
}
|
|
243
292
|
);
|
|
@@ -246,4 +295,4 @@ function SectionNavRail({
|
|
|
246
295
|
export {
|
|
247
296
|
SectionNavRail
|
|
248
297
|
};
|
|
249
|
-
//# sourceMappingURL=chunk-
|
|
298
|
+
//# sourceMappingURL=chunk-SNWCT6JN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation/SectionNav/SectionNav.rail.tsx"],"sourcesContent":["import ArrowBackIcon from '@mui/icons-material/ArrowBack';\nimport Typography from '@mui/material/Typography/index.js';\nimport { useTheme, type SxProps, type Theme } from '@mui/material/styles/index.js';\nimport type { ElementType, ReactNode } from 'react';\n\nimport type { SectionNavCopy } from '../../../copy';\nimport { rem } from '../../../tokens/scales';\n\nimport { destinationState, isMenu } from './SectionNav.helpers';\nimport {\n Box,\n CONTROL_RESET,\n CountedIcon,\n NOT_LIVE,\n SlotIcon,\n VISUALLY_HIDDEN,\n controlProps,\n destinationControl,\n focusRing,\n} from './SectionNav.parts';\nimport { RailCreateMenu } from './SectionNav.railCreate';\nimport type {\n SectionNavAction,\n SectionNavBack,\n SectionNavDestination,\n SectionNavMenu,\n SectionNavProps,\n} from './SectionNav.types';\nimport type { SectionNavBadge } from './SectionNav.types';\n\n/** The row's words, stacked: the label over its description. */\nconst ROW_WORDS_SX = { display: 'flex', flexDirection: 'column', minWidth: 0 } as const;\n\n/** A rail row's look: icon and words, or the icon alone, centred, when compact. */\nfunction railRowSx(theme: Theme, active: boolean, compact: boolean): SxProps<Theme> {\n return {\n ...CONTROL_RESET,\n ...focusRing(theme),\n position: compact ? 'relative' : undefined,\n display: 'flex',\n alignItems: 'center',\n justifyContent: compact ? 'center' : 'flex-start',\n gap: compact ? 0 : 1.5,\n width: '100%',\n minHeight: rem(theme, 40),\n px: compact ? 0 : 1.25,\n py: 0.75,\n borderRadius: 1,\n textAlign: 'start',\n color: active ? 'primary.main' : 'text.primary',\n bgcolor: active ? 'action.selected' : 'transparent',\n '&:hover': { bgcolor: active ? 'action.selected' : 'action.hover' },\n '& svg': { color: 'primary.main', fontSize: rem(theme, 20) },\n [NOT_LIVE]: { color: 'text.disabled', '& svg': { color: 'text.disabled' } },\n } as SxProps<Theme>;\n}\n\n/**\n * One rail row: icon, label, and the count at the far end.\n *\n * Destinations and menu entries draw the same row — in the rail there is room\n * for everything, so the difference between \"a place\" and \"an action\" is the\n * section it sits in, not its shape.\n *\n * `active` is the look; `current` is what `aria-current` reports, and is a\n * link's claim only — an action row that is ON says so with `aria-pressed`,\n * which arrives in `control`. Omitted, `current` follows `active`.\n */\nfunction RailRow({\n label,\n description,\n icon,\n count,\n active,\n current = active,\n copy,\n testId,\n control,\n loading = false,\n compact = false,\n}: {\n label: string;\n description?: string;\n icon: ReactNode;\n count: SectionNavBadge | undefined;\n active: boolean;\n current?: boolean;\n copy: SectionNavCopy;\n testId: string;\n control: Record<string, unknown>;\n loading?: boolean;\n /** Icon only, centred: the label stays the row's name, out of sight, and its tooltip. */\n compact?: boolean;\n}): React.JSX.Element {\n const theme = useTheme();\n return (\n <Box\n {...control}\n aria-current={current ? 'page' : undefined}\n aria-busy={loading || undefined}\n title={compact ? label : undefined}\n data-testid={testId}\n sx={railRowSx(theme, active, compact)}\n >\n <CountedIcon\n icon={<SlotIcon icon={icon} loading={loading} />}\n count={count}\n label={copy.badge}\n attentionLabel={copy.attention}\n testId={`${testId}-badge`}\n />\n <Box component=\"span\" sx={compact ? VISUALLY_HIDDEN : ROW_WORDS_SX}>\n <Typography component=\"span\" variant=\"body2\" sx={{ fontWeight: active ? 700 : 500 }}>\n {label}\n </Typography>\n {description ? (\n <Typography component=\"span\" variant=\"caption\" color=\"text.secondary\">\n {description}\n </Typography>\n ) : null}\n </Box>\n </Box>\n );\n}\n\n/** A heading between the rail's sections, in the sidebar's small-caps voice. */\nfunction RailHeading({ children, compact = false }: { children: ReactNode; compact?: boolean }): React.JSX.Element {\n return (\n <Typography\n variant=\"overline\"\n color=\"text.secondary\"\n sx={compact ? VISUALLY_HIDDEN : { px: 1.25, pt: 1.5, lineHeight: 1.6 }}\n >\n {children}\n </Typography>\n );\n}\n\n/**\n * The `more` menu's groups, listed under its title — the rail has room for the\n * places it holds. A `disabled` menu has no trigger here to refuse, so every\n * row of it is inert instead. (`primary` folds behind one button instead —\n * `RailCreateMenu`.)\n */\nfunction RailMenu({\n menu,\n linkComponent,\n copy,\n testId,\n compact,\n}: {\n menu: SectionNavMenu;\n linkComponent: ElementType | undefined;\n copy: SectionNavCopy;\n testId: string;\n compact: boolean;\n}): React.JSX.Element {\n return (\n <Box component=\"section\" data-testid={testId} sx={{ display: 'flex', flexDirection: 'column', gap: 0.25 }}>\n <RailHeading compact={compact}>{menu.title}</RailHeading>\n {menu.groups.map((group) => (\n <Box key={group.id} sx={{ display: 'flex', flexDirection: 'column', gap: 0.25 }}>\n {group.title ? (\n <Typography variant=\"caption\" color=\"text.secondary\" sx={compact ? VISUALLY_HIDDEN : { px: 1.25, pt: 0.5 }}>\n {group.title}\n </Typography>\n ) : null}\n {group.entries.map((entry) => (\n <RailRow\n key={entry.id}\n label={entry.label}\n description={entry.description}\n icon={entry.icon}\n count={entry.badge}\n active={entry.active === true}\n compact={compact}\n copy={copy}\n testId={entry.dataTestId ?? `${testId}-entry-${entry.id}`}\n control={controlProps({\n href: entry.href,\n linkComponent,\n inert: menu.disabled === true || entry.disabled === true,\n onClick: () => entry.onSelect?.(),\n })}\n />\n ))}\n </Box>\n ))}\n </Box>\n );\n}\n\n/** The way back out of the section, at the top of the rail. */\nfunction RailBack({\n back,\n linkComponent,\n testId,\n compact,\n}: {\n back: SectionNavBack;\n linkComponent: ElementType | undefined;\n testId: string;\n compact: boolean;\n}): React.JSX.Element {\n const theme = useTheme();\n return (\n <Box\n {...controlProps({ href: back.href, linkComponent })}\n title={compact ? back.label : undefined}\n data-testid={testId}\n sx={{\n ...CONTROL_RESET,\n ...focusRing(theme),\n position: compact ? 'relative' : undefined,\n display: 'flex',\n alignItems: 'center',\n justifyContent: compact ? 'center' : 'flex-start',\n gap: compact ? 0 : 1,\n minHeight: compact ? rem(theme, 40) : undefined,\n px: compact ? 0 : 1.25,\n py: 0.75,\n mb: 0.5,\n borderRadius: 1,\n color: 'text.secondary',\n '&:hover': { bgcolor: 'action.hover', color: 'text.primary' },\n '& svg': { fontSize: rem(theme, 20) },\n }}\n >\n {/* Compact, the icon is all that is drawn: a back with none gets the arrow. */}\n {back.icon ?? (compact ? <ArrowBackIcon aria-hidden /> : null)}\n <Typography component=\"span\" variant=\"body2\" sx={compact ? VISUALLY_HIDDEN : { fontWeight: 600 }}>\n {back.label}\n </Typography>\n </Box>\n );\n}\n\n/** A primary that ACTS, as one row: there is no sheet to list on a wide screen. */\nfunction RailAction({\n action,\n linkComponent,\n copy,\n testId,\n compact,\n}: {\n action: SectionNavAction;\n linkComponent: ElementType | undefined;\n copy: SectionNavCopy;\n testId: string;\n compact: boolean;\n}): React.JSX.Element {\n return (\n <RailRow\n compact={compact}\n label={action.label}\n icon={action.icon}\n count={undefined}\n active={false}\n copy={copy}\n testId={action.dataTestId ?? testId}\n loading={action.loading === true}\n control={controlProps({\n href: undefined,\n linkComponent,\n inert: action.disabled === true,\n busy: action.loading === true,\n onClick: action.onSelect,\n })}\n />\n );\n}\n\n/** A destination as a row: a link, or an action (a toggle when it carries `active`). */\nfunction RailDestination({\n destination,\n linkComponent,\n copy,\n testId,\n compact,\n}: {\n destination: SectionNavDestination;\n linkComponent: ElementType | undefined;\n copy: SectionNavCopy;\n testId: string;\n compact: boolean;\n}): React.JSX.Element {\n const { current, lit } = destinationState(destination);\n return (\n <RailRow\n compact={compact}\n label={destination.label}\n icon={destination.icon}\n count={destination.badge}\n active={lit}\n current={current}\n copy={copy}\n testId={testId}\n loading={destination.loading === true}\n control={destinationControl(destination, linkComponent, () => destination.onSelect?.())}\n />\n );\n}\n\n/**\n * The wide-screen layout: a vertical rail — the way back, the heading, a\n * `primary` menu as one button that opens it (FUT-3015), the destinations, a\n * `primary` action as a row, then `more` listed in full.\n *\n * It fills the column the host gives it and scrolls on its own, like the\n * sidebar it stands in for. `compact` draws every row as its icon for a\n * column 64px wide; the words stay the rows' names.\n */\nexport function SectionNavRail({\n label,\n destinations,\n primary,\n more,\n back,\n heading,\n linkComponent,\n copy,\n dataTestId,\n compact = false,\n}: Required<Pick<SectionNavProps, 'label' | 'destinations' | 'copy' | 'dataTestId'>> &\n Pick<SectionNavProps, 'primary' | 'more' | 'back' | 'heading' | 'compact'> & {\n linkComponent: ElementType | undefined;\n }): React.JSX.Element {\n return (\n <Box\n component=\"nav\"\n aria-label={label}\n data-testid={dataTestId}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n gap: 0.25,\n height: '100%',\n overflowY: 'auto',\n px: 1,\n py: 1.5,\n bgcolor: 'background.paper',\n }}\n >\n {back ? (\n <RailBack back={back} linkComponent={linkComponent} testId={`${dataTestId}-back`} compact={compact} />\n ) : null}\n {heading ? <RailHeading compact={compact}>{heading}</RailHeading> : null}\n {isMenu(primary) ? (\n <RailCreateMenu\n menu={primary}\n linkComponent={linkComponent}\n copy={copy}\n testId={`${dataTestId}-primary`}\n compact={compact}\n />\n ) : null}\n {destinations.map((destination) => (\n <RailDestination\n key={destination.id}\n destination={destination}\n linkComponent={linkComponent}\n copy={copy}\n testId={destination.dataTestId ?? `${dataTestId}-dest-${destination.id}`}\n compact={compact}\n />\n ))}\n {primary && !isMenu(primary) ? (\n <RailAction\n action={primary}\n linkComponent={linkComponent}\n copy={copy}\n testId={`${dataTestId}-primary`}\n compact={compact}\n />\n ) : null}\n {more ? (\n <RailMenu menu={more}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AAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAY;AAAA,MACZ,eAAa;AAAA,MACb,IAAI;AAAA,QACF,SAAS;AAAA,QACT,eAAe;AAAA,QACf,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,MACX;AAAA,MAEC;AAAA,eACC,oBAAC,YAAS,MAAY,eAA8B,QAAQ,GAAG,UAAU,SAAS,SAAkB,IAClG;AAAA,QACH,UAAU,oBAAC,eAAY,SAAmB,mBAAQ,IAAiB;AAAA,QACnE,OAAO,OAAO,IACb;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA,QAAQ,GAAG,UAAU;AAAA,YACrB;AAAA;AAAA,QACF,IACE;AAAA,QACH,aAAa,IAAI,CAAC,gBACjB;AAAA,UAAC;AAAA;AAAA,YAEC;AAAA,YACA;AAAA,YACA;AAAA,YACA,QAAQ,YAAY,cAAc,GAAG,UAAU,SAAS,YAAY,EAAE;AAAA,YACtE;AAAA;AAAA,UALK,YAAY;AAAA,QAMnB,CACD;AAAA,QACA,WAAW,CAAC,OAAO,OAAO,IACzB;AAAA,UAAC;AAAA;AAAA,YACC,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YACA,QAAQ,GAAG,UAAU;AAAA,YACrB;AAAA;AAAA,QACF,IACE;AAAA,QACH,OACC,oBAAC,YAAS,MAAM,MAAM,eAA8B,MAAY,QAAQ,GAAG,UAAU,SAAS,SAAkB,IAC9G;AAAA;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import "../chunk-R26KYJHK.js";
|
|
2
2
|
import {
|
|
3
3
|
SectionNav
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-NQP72RTD.js";
|
|
5
|
+
import "../chunk-SNWCT6JN.js";
|
|
6
|
+
import "../chunk-ILJ3FXIC.js";
|
|
7
7
|
import {
|
|
8
8
|
sectionNavBarInset
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-23LPXHR2.js";
|
|
10
|
+
import "../chunk-NM46HQSW.js";
|
|
11
11
|
import {
|
|
12
12
|
RaisedActionButton
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-KPEKD5SG.js";
|
|
14
|
+
import "../chunk-24HHUCWB.js";
|
|
15
15
|
import "../chunk-YCCWJ5XQ.js";
|
|
16
16
|
import "../chunk-TMSWLFL4.js";
|
|
17
17
|
import "../chunk-UALPKKAY.js";
|
|
18
|
+
import "../chunk-PUFA7FQ7.js";
|
|
18
19
|
import "../chunk-5AK2EZG5.js";
|
|
19
20
|
import "../chunk-N5PVD4J5.js";
|
|
20
21
|
import "../chunk-6C5D6O3D.js";
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { type ElementType } from 'react';
|
|
2
2
|
import { rem } from '../../../tokens/scales';
|
|
3
3
|
import type { SectionNavProps } from './SectionNav.types';
|
|
4
|
+
/** How the bar is drawn — `compact` is `SectionNavProps.compact`. */
|
|
5
|
+
export interface SectionNavBarOptions {
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* The bar's full height on screen, the safe area included — where its sheets
|
|
6
10
|
* stop, and what a host reserves at the foot of its content so nothing it
|
|
7
11
|
* floats (a toast, a receipt) lands under the bar.
|
|
8
12
|
*/
|
|
9
|
-
export declare function sectionNavBarInset(theme: Parameters<typeof rem>[0]): string;
|
|
13
|
+
export declare function sectionNavBarInset(theme: Parameters<typeof rem>[0], options?: SectionNavBarOptions): string;
|
|
10
14
|
/** The phone layout: a bottom bar, with its menus as bottom sheets. */
|
|
11
|
-
export declare function SectionNavBar({ label, destinations, primary, more, linkComponent, copy, dataTestId, }: Required<Pick<SectionNavProps, 'label' | 'destinations' | 'copy' | 'dataTestId'>> & Pick<SectionNavProps, 'primary' | 'more'> & {
|
|
15
|
+
export declare function SectionNavBar({ label, destinations, primary, more, linkComponent, copy, dataTestId, compact, }: Required<Pick<SectionNavProps, 'label' | 'destinations' | 'copy' | 'dataTestId'>> & Pick<SectionNavProps, 'primary' | 'more' | 'compact'> & {
|
|
12
16
|
linkComponent: ElementType | undefined;
|
|
13
17
|
}): React.JSX.Element;
|
|
14
18
|
//# sourceMappingURL=SectionNav.bar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.bar.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,WAAW,EAAkB,MAAM,OAAO,CAAC;AAInE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionNav.bar.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,WAAW,EAAkB,MAAM,OAAO,CAAC;AAInE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAgB7C,OAAO,KAAK,EAA4E,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAWpI,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAE/G;AA6RD,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,UAAU,EACV,OAAe,GAChB,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,GAClF,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG;IAAE,aAAa,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkDvH"}
|
|
@@ -8,9 +8,12 @@ import type { SectionNavProps } from './SectionNav.types';
|
|
|
8
8
|
* (`linkComponent`). The nav decides only how they are drawn: the order of the
|
|
9
9
|
* bar's slots, the raised primary action, the sheets, the rail's sections.
|
|
10
10
|
*
|
|
11
|
+
* `compact` draws either layout as icons only, a size down, for a host that
|
|
12
|
+
* folds its chrome; the labels stay the controls' names.
|
|
13
|
+
*
|
|
11
14
|
* Which layout to use is the host's call too, because the host knows what
|
|
12
15
|
* else is on screen: a bar next to a sidebar is two navigations competing for
|
|
13
16
|
* one glance.
|
|
14
17
|
*/
|
|
15
|
-
export declare function SectionNav({ layout, label, destinations, primary, more, back, heading, linkComponent, copy, dataTestId, }: SectionNavProps): React.JSX.Element;
|
|
18
|
+
export declare function SectionNav({ layout, label, destinations, primary, more, back, heading, linkComponent, copy, dataTestId, compact, }: SectionNavProps): React.JSX.Element;
|
|
16
19
|
//# sourceMappingURL=SectionNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"SectionNav.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,IAAI,EACJ,UAA0B,EAC1B,OAAe,GAChB,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA6BrC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Box from '@mui/material/Box/index.js';
|
|
2
2
|
import type { SxProps, Theme } from '@mui/material/styles/index.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ElementType, type ReactNode } from 'react';
|
|
4
4
|
import type { SectionNavBadge, SectionNavDestination } from './SectionNav.types';
|
|
5
5
|
/**
|
|
6
6
|
* An icon with its count on the shoulder.
|
|
@@ -74,5 +74,16 @@ export declare const CONTROL_RESET: {
|
|
|
74
74
|
readonly cursor: "default";
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Out of sight, still read: a compact nav keeps each label as its control's
|
|
79
|
+
* accessible name. The same box `Label`'s `srOnly` draws.
|
|
80
|
+
*/
|
|
81
|
+
export declare const VISUALLY_HIDDEN: SxProps<Theme>;
|
|
82
|
+
/**
|
|
83
|
+
* False on the first render, true from then on — so a fold animates when the
|
|
84
|
+
* host CHANGES `compact`, never when a page simply opens folded (which drew
|
|
85
|
+
* the labels sliding out over the neighbouring badges on every load).
|
|
86
|
+
*/
|
|
87
|
+
export declare function useMounted(): boolean;
|
|
77
88
|
export { Box };
|
|
78
89
|
//# sourceMappingURL=SectionNav.parts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.parts.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SectionNav.parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.parts.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAuB,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9E,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,cAAc,GACf,EAAE;IACD,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAyBpB;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAOtD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAa,EACb,IAAY,EACZ,MAAc,GACf,EAAE;IACD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM1B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,qBAAqB,EAClC,aAAa,EAAE,WAAW,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,IAAI,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,0CAAwC,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAGpG;AAED,wFAAwF;AACxF,eAAO,MAAM,aAAa;;;;;;;;;;;CAShB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,eAAe,gBAAa,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAIpC;AAED,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -21,6 +21,12 @@ export interface RaisedActionButtonProps {
|
|
|
21
21
|
* bar of places can leave its one action to the icon.
|
|
22
22
|
*/
|
|
23
23
|
captioned?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A size down — 40px rather than 52, lifted less — for a compact bar. It
|
|
26
|
+
* draws no caption: a compact bar is icons only, and the name stays the
|
|
27
|
+
* button's `aria-label`.
|
|
28
|
+
*/
|
|
29
|
+
compact?: boolean;
|
|
24
30
|
/** Dimmed and not operable: a native `disabled` button. */
|
|
25
31
|
disabled?: boolean;
|
|
26
32
|
/**
|
|
@@ -43,5 +49,5 @@ export interface RaisedActionButtonProps {
|
|
|
43
49
|
* `SectionNav` draws it for its `primary` menu. It is exported on its own for
|
|
44
50
|
* a bar the host already draws — drop it between two tabs, in a flex row.
|
|
45
51
|
*/
|
|
46
|
-
export declare function RaisedActionButton({ label, icon, onClick, open, closeLabel, captioned, disabled, loading, dataTestId, }: RaisedActionButtonProps): React.JSX.Element;
|
|
52
|
+
export declare function RaisedActionButton({ label, icon, onClick, open, closeLabel, captioned, compact, disabled, loading, dataTestId, }: RaisedActionButtonProps): React.JSX.Element;
|
|
47
53
|
//# sourceMappingURL=SectionNav.primary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.primary.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.primary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qGAAqG;IACrG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,UAAU,EACV,SAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,UAA4B,GAC7B,EAAE,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4B7C"}
|
|
1
|
+
{"version":3,"file":"SectionNav.primary.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.primary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qGAAqG;IACrG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,UAAU,EACV,SAAiB,EACjB,OAAe,EACf,QAAgB,EAChB,OAAe,EACf,UAA4B,GAC7B,EAAE,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4B7C"}
|