@12-apps/ui 6.72.0 → 6.73.1

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.
Files changed (57) hide show
  1. package/components-catalog.md +1 -1
  2. package/dist/_internal/components/index.js +7 -7
  3. package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +9 -6
  4. package/dist/_internal/components/navigation/SectionNav/SectionNav.js +8 -7
  5. package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +8 -3
  6. package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +11 -4
  7. package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +4 -3
  8. package/dist/_internal/components/navigation/SectionNav/SectionNav.railCreate.js +3 -2
  9. package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +3 -2
  10. package/dist/_internal/components/navigation/index.js +8 -7
  11. package/dist/{chunk-WP7KPWCP.js → chunk-24HHUCWB.js} +14 -2
  12. package/dist/chunk-24HHUCWB.js.map +1 -0
  13. package/dist/{chunk-LWQGIN2M.js → chunk-27F2VXS4.js} +9 -6
  14. package/dist/chunk-27F2VXS4.js.map +1 -0
  15. package/dist/{chunk-WY7FR7I4.js → chunk-ILJ3FXIC.js} +17 -8
  16. package/dist/chunk-ILJ3FXIC.js.map +1 -0
  17. package/dist/{chunk-2STYL5PF.js → chunk-NM46HQSW.js} +2 -2
  18. package/dist/{chunk-OBGUD2PG.js → chunk-SNWCT6JN.js} +91 -42
  19. package/dist/chunk-SNWCT6JN.js.map +1 -0
  20. package/dist/{chunk-VI2IXBOO.js → chunk-UKUGSU3Y.js} +33 -14
  21. package/dist/chunk-UKUGSU3Y.js.map +1 -0
  22. package/dist/{chunk-XS4NQ6LD.js → chunk-URSYEHPU.js} +68 -36
  23. package/dist/chunk-URSYEHPU.js.map +1 -0
  24. package/dist/navigation/SectionNav.js +8 -7
  25. package/dist/types/components/navigation/SectionNav/SectionNav.bar.d.ts +8 -2
  26. package/dist/types/components/navigation/SectionNav/SectionNav.bar.d.ts.map +1 -1
  27. package/dist/types/components/navigation/SectionNav/SectionNav.d.ts +4 -1
  28. package/dist/types/components/navigation/SectionNav/SectionNav.d.ts.map +1 -1
  29. package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts +12 -1
  30. package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts.map +1 -1
  31. package/dist/types/components/navigation/SectionNav/SectionNav.primary.d.ts +16 -1
  32. package/dist/types/components/navigation/SectionNav/SectionNav.primary.d.ts.map +1 -1
  33. package/dist/types/components/navigation/SectionNav/SectionNav.rail.d.ts +3 -2
  34. package/dist/types/components/navigation/SectionNav/SectionNav.rail.d.ts.map +1 -1
  35. package/dist/types/components/navigation/SectionNav/SectionNav.railCreate.d.ts +3 -1
  36. package/dist/types/components/navigation/SectionNav/SectionNav.railCreate.d.ts.map +1 -1
  37. package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts +12 -0
  38. package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts.map +1 -1
  39. package/dist/types/components/navigation/SectionNav/index.d.ts +1 -0
  40. package/dist/types/components/navigation/SectionNav/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/components/navigation/SectionNav/SectionNav.bar.tsx +84 -30
  43. package/src/components/navigation/SectionNav/SectionNav.md +25 -4
  44. package/src/components/navigation/SectionNav/SectionNav.parts.tsx +19 -1
  45. package/src/components/navigation/SectionNav/SectionNav.primary.tsx +52 -11
  46. package/src/components/navigation/SectionNav/SectionNav.rail.tsx +90 -35
  47. package/src/components/navigation/SectionNav/SectionNav.railCreate.tsx +23 -5
  48. package/src/components/navigation/SectionNav/SectionNav.tsx +6 -0
  49. package/src/components/navigation/SectionNav/SectionNav.types.ts +12 -0
  50. package/src/components/navigation/SectionNav/index.ts +1 -0
  51. package/dist/chunk-LWQGIN2M.js.map +0 -1
  52. package/dist/chunk-OBGUD2PG.js.map +0 -1
  53. package/dist/chunk-VI2IXBOO.js.map +0 -1
  54. package/dist/chunk-WP7KPWCP.js.map +0 -1
  55. package/dist/chunk-WY7FR7I4.js.map +0 -1
  56. package/dist/chunk-XS4NQ6LD.js.map +0 -1
  57. /package/dist/{chunk-2STYL5PF.js.map → chunk-NM46HQSW.js.map} +0 -0
@@ -1,16 +1,17 @@
1
1
  import {
2
2
  RailCreateMenu
3
- } from "./chunk-WY7FR7I4.js";
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-WP7KPWCP.js";
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: { display: "flex", flexDirection: "column", minWidth: 0 }, children: [
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(Typography, { variant: "overline", color: "text.secondary", sx: { px: 1.25, pt: 1.5, lineHeight: 1.6 }, children });
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
- gap: 1,
135
- px: 1.25,
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` }) : null,
227
- heading ? /* @__PURE__ */ jsx(RailHeading, { children: heading }) : null,
228
- isMenu(primary) ? /* @__PURE__ */ jsx(RailCreateMenu, { menu: primary, linkComponent, copy, testId: `${dataTestId}-primary` }) : null,
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(RailAction, { action: primary, linkComponent, copy, testId: `${dataTestId}-primary` }) : null,
240
- more ? /* @__PURE__ */ jsx(RailMenu, { menu: more, linkComponent, copy, testId: `${dataTestId}-more` }) : null
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-OBGUD2PG.js.map
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} linkComponent={linkComponent} copy={copy} testId={`${dataTestId}-more`} compact={compact} />\n ) : null}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,mBAAmB;AAC1B,OAAO,gBAAgB;AACvB,SAAS,gBAA0C;AAuGrC,cAMR,YANQ;AA1Ed,IAAM,eAAe,EAAE,SAAS,QAAQ,eAAe,UAAU,UAA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ACC,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":[]}
@@ -2,9 +2,8 @@ import {
2
2
  Box,
3
3
  CONTROL_RESET,
4
4
  NOT_LIVE,
5
- SlotIcon,
6
- focusRing
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
- "aria-label": expanded && closeLabel ? closeLabel : label,
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
- captioned ? /* @__PURE__ */ jsx(RaisedCaption, { label, inert: disabled || loading }) : null
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,22 @@ function RaisedCaption({ label, inert }) {
81
90
  }
82
91
  );
83
92
  }
84
- function raisedSx(theme, expanded) {
85
- const size = rem(theme, 52);
93
+ var RAISED_LIFT = 18;
94
+ var RAISED_LIFT_COMPACT = 12;
95
+ function raisedLift(compact) {
96
+ return compact ? RAISED_LIFT_COMPACT : RAISED_LIFT;
97
+ }
98
+ function raisedSx(theme, expanded, compact) {
99
+ const size = rem(theme, compact ? 40 : 52);
86
100
  return {
87
101
  ...CONTROL_RESET,
88
- ...focusRing(theme),
102
+ // The ring OUTSIDE the button: the shared ring sits inside the box, in the
103
+ // primary colour, where this button's own fill swallowed it whole.
104
+ "&:focus-visible": { outline: `${rem(theme, 2)} solid ${theme.palette.primary.main}`, outlineOffset: rem(theme, 2) },
89
105
  width: size,
90
106
  height: size,
91
107
  // Lifted half out of the bar: the one control that is not a place.
92
- marginTop: rem(theme, -18),
108
+ marginTop: rem(theme, -raisedLift(compact)),
93
109
  borderRadius: "50%",
94
110
  display: "flex",
95
111
  alignItems: "center",
@@ -99,7 +115,7 @@ function raisedSx(theme, expanded) {
99
115
  boxShadow: theme.shadows[6],
100
116
  [NOT_LIVE]: { cursor: "default", bgcolor: "action.disabledBackground", color: "text.disabled", boxShadow: "none" },
101
117
  "& svg": {
102
- fontSize: rem(theme, 26),
118
+ fontSize: rem(theme, compact ? 22 : 26),
103
119
  transition: theme.transitions.create("transform", { duration: theme.transitions.duration.shorter }),
104
120
  transform: expanded ? "rotate(45deg)" : "none"
105
121
  },
@@ -108,6 +124,9 @@ function raisedSx(theme, expanded) {
108
124
  }
109
125
 
110
126
  export {
111
- RaisedActionButton
127
+ RaisedActionButton,
128
+ RAISED_LIFT,
129
+ RAISED_LIFT_COMPACT,
130
+ raisedLift
112
131
  };
113
- //# sourceMappingURL=chunk-VI2IXBOO.js.map
132
+ //# sourceMappingURL=chunk-UKUGSU3Y.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/**\n * How far the round button stands out of the bar's top edge, in design px — what\n * the bar's sheets must clear so the button never draws over one (FUT-3399).\n * The compact bar's smaller button stands out less.\n */\nexport const RAISED_LIFT = 18;\nexport const RAISED_LIFT_COMPACT = 12;\n\n/** The lift of the round button on a bar of this form. */\nexport function raisedLift(compact: boolean): number {\n return compact ? RAISED_LIFT_COMPACT : RAISED_LIFT;\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, -raisedLift(compact)),\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,SAAS;AACvB,QAAM,WAAW,SAAS;AAC1B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,QACF,MAAM;AAAA,QACN,SAAS;AAAA,QACT,eAAe;AAAA,QACf,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,IAAI;AAAA,MACN;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACJ,GAAG,YAAY,EAAE,SAAS,UAAU,QAAQ,CAAC;AAAA,YAC7C,GAAG,YAAY,EAAE,OAAO,YAAY,UAAU,QAAQ,CAAC;AAAA,YACxD,iBAAe;AAAA,YACf,eAAa;AAAA,YACb,IAAI,SAAS,OAAO,UAAU,OAAO;AAAA,YAErC,8BAAC,YAAS,MAAY,SAAkB;AAAA;AAAA,QAC1C;AAAA,QACA,oBAAC,iBAAc,OAAO,aAAa,CAAC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