@12-apps/ui 6.50.1 → 6.51.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.
Files changed (60) hide show
  1. package/components-catalog.md +2 -2
  2. package/dist/_internal/components/index.js +7 -7
  3. package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +5 -5
  4. package/dist/_internal/components/navigation/SectionNav/SectionNav.helpers.js +5 -1
  5. package/dist/_internal/components/navigation/SectionNav/SectionNav.js +7 -7
  6. package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +8 -2
  7. package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +3 -3
  8. package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +3 -3
  9. package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +3 -3
  10. package/dist/_internal/components/navigation/SectionNav/__stories__/fixtures.js +12 -0
  11. package/dist/_internal/components/navigation/SectionNav/__stories__/fixtures.js.map +1 -1
  12. package/dist/_internal/components/navigation/index.js +7 -7
  13. package/dist/{chunk-GLKQT2DS.js → chunk-A436VORP.js} +33 -4
  14. package/dist/chunk-A436VORP.js.map +1 -0
  15. package/dist/{chunk-RX7J6VRI.js → chunk-HKEBTPKY.js} +119 -42
  16. package/dist/chunk-HKEBTPKY.js.map +1 -0
  17. package/dist/{chunk-VHVI3D4R.js → chunk-P3GBXE73.js} +11 -2
  18. package/dist/chunk-P3GBXE73.js.map +1 -0
  19. package/dist/{chunk-32JMSHEA.js → chunk-S4ZUZ6DS.js} +10 -6
  20. package/dist/chunk-S4ZUZ6DS.js.map +1 -0
  21. package/dist/{chunk-SA2ERYVV.js → chunk-VAO63IIP.js} +3 -3
  22. package/dist/{chunk-43Q6CVPB.js → chunk-VELGOFCL.js} +127 -78
  23. package/dist/chunk-VELGOFCL.js.map +1 -0
  24. package/dist/chunk-WNKRFMSI.js +113 -0
  25. package/dist/chunk-WNKRFMSI.js.map +1 -0
  26. package/dist/navigation/SectionNav.js +7 -7
  27. package/dist/types/components/navigation/SectionNav/SectionNav.bar.d.ts.map +1 -1
  28. package/dist/types/components/navigation/SectionNav/SectionNav.helpers.d.ts +12 -1
  29. package/dist/types/components/navigation/SectionNav/SectionNav.helpers.d.ts.map +1 -1
  30. package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts +36 -2
  31. package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts.map +1 -1
  32. package/dist/types/components/navigation/SectionNav/SectionNav.primary.d.ts +22 -4
  33. package/dist/types/components/navigation/SectionNav/SectionNav.primary.d.ts.map +1 -1
  34. package/dist/types/components/navigation/SectionNav/SectionNav.rail.d.ts.map +1 -1
  35. package/dist/types/components/navigation/SectionNav/SectionNav.sheet.d.ts.map +1 -1
  36. package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts +81 -5
  37. package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts.map +1 -1
  38. package/dist/types/components/navigation/SectionNav/__stories__/fixtures.d.ts +11 -1
  39. package/dist/types/components/navigation/SectionNav/__stories__/fixtures.d.ts.map +1 -1
  40. package/dist/types/components/navigation/SectionNav/index.d.ts +1 -1
  41. package/dist/types/components/navigation/SectionNav/index.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/components/navigation/SectionNav/SectionNav.bar.tsx +161 -88
  44. package/src/components/navigation/SectionNav/SectionNav.helpers.ts +16 -1
  45. package/src/components/navigation/SectionNav/SectionNav.md +40 -4
  46. package/src/components/navigation/SectionNav/SectionNav.parts.tsx +59 -1
  47. package/src/components/navigation/SectionNav/SectionNav.primary.tsx +107 -30
  48. package/src/components/navigation/SectionNav/SectionNav.rail.tsx +154 -41
  49. package/src/components/navigation/SectionNav/SectionNav.sheet.tsx +6 -2
  50. package/src/components/navigation/SectionNav/SectionNav.types.ts +82 -5
  51. package/src/components/navigation/SectionNav/__stories__/fixtures.tsx +21 -1
  52. package/src/components/navigation/SectionNav/index.ts +1 -0
  53. package/dist/chunk-32JMSHEA.js.map +0 -1
  54. package/dist/chunk-43Q6CVPB.js.map +0 -1
  55. package/dist/chunk-GLKQT2DS.js.map +0 -1
  56. package/dist/chunk-RX7J6VRI.js.map +0 -1
  57. package/dist/chunk-RZ4SBSLP.js +0 -62
  58. package/dist/chunk-RZ4SBSLP.js.map +0 -1
  59. package/dist/chunk-VHVI3D4R.js.map +0 -1
  60. /package/dist/{chunk-SA2ERYVV.js.map → chunk-VAO63IIP.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  CountedIcon,
5
5
  controlProps,
6
6
  focusRing
7
- } from "./chunk-GLKQT2DS.js";
7
+ } from "./chunk-A436VORP.js";
8
8
  import {
9
9
  Drawer,
10
10
  DrawerContent,
@@ -26,13 +26,14 @@ function GridEntry({ entry, linkComponent, copy, testId, onDone }) {
26
26
  ...controlProps({
27
27
  href: entry.href,
28
28
  linkComponent,
29
+ inert: entry.disabled === true,
29
30
  onClick: () => {
30
31
  entry.onSelect?.();
31
32
  onDone();
32
33
  }
33
34
  }),
34
35
  "aria-current": entry.active ? "page" : void 0,
35
- "data-testid": `${testId}-entry-${entry.id}`,
36
+ "data-testid": entry.dataTestId ?? `${testId}-entry-${entry.id}`,
36
37
  sx: {
37
38
  ...CONTROL_RESET,
38
39
  ...focusRing(theme),
@@ -48,7 +49,8 @@ function GridEntry({ entry, linkComponent, copy, testId, onDone }) {
48
49
  textAlign: "center",
49
50
  bgcolor: entry.active ? "action.selected" : "action.hover",
50
51
  color: entry.active ? "primary.main" : "text.primary",
51
- "& svg": { color: "primary.main" }
52
+ "& svg": { color: "primary.main" },
53
+ "&:disabled": { color: "text.disabled", "& svg": { color: "text.disabled" } }
52
54
  },
53
55
  children: [
54
56
  /* @__PURE__ */ jsx(CountedIcon, { icon: entry.icon, count: entry.badge, label: copy.badge, testId: `${testId}-badge-${entry.id}` }),
@@ -65,13 +67,14 @@ function ListEntry({ entry, linkComponent, copy, testId, onDone }) {
65
67
  ...controlProps({
66
68
  href: entry.href,
67
69
  linkComponent,
70
+ inert: entry.disabled === true,
68
71
  onClick: () => {
69
72
  entry.onSelect?.();
70
73
  onDone();
71
74
  }
72
75
  }),
73
76
  "aria-current": entry.active ? "page" : void 0,
74
- "data-testid": `${testId}-entry-${entry.id}`,
77
+ "data-testid": entry.dataTestId ?? `${testId}-entry-${entry.id}`,
75
78
  sx: {
76
79
  ...CONTROL_RESET,
77
80
  ...focusRing(theme),
@@ -85,7 +88,8 @@ function ListEntry({ entry, linkComponent, copy, testId, onDone }) {
85
88
  borderRadius: 1.5,
86
89
  textAlign: "start",
87
90
  bgcolor: entry.active ? "action.selected" : "action.hover",
88
- "& svg": { color: "primary.main" }
91
+ "& svg": { color: "primary.main" },
92
+ "&:disabled": { color: "text.disabled", "& svg": { color: "text.disabled" } }
89
93
  },
90
94
  children: [
91
95
  /* @__PURE__ */ jsx(CountedIcon, { icon: entry.icon, count: entry.badge, label: copy.badge, testId: `${testId}-badge-${entry.id}` }),
@@ -171,4 +175,4 @@ function SectionNavSheet({
171
175
  export {
172
176
  SectionNavSheet
173
177
  };
174
- //# sourceMappingURL=chunk-32JMSHEA.js.map
178
+ //# sourceMappingURL=chunk-S4ZUZ6DS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/navigation/SectionNav/SectionNav.sheet.tsx"],"sourcesContent":["import Typography from '@mui/material/Typography/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport type { ElementType } from 'react';\n\nimport { rem } from '../../../tokens/scales';\nimport { Drawer, DrawerContent, DrawerHeader } from '../../layout/Drawer';\n\nimport { Box, CONTROL_RESET, CountedIcon, controlProps, focusRing } from './SectionNav.parts';\nimport type { SectionNavEntry, SectionNavGroup, SectionNavMenu } from './SectionNav.types';\nimport type { SectionNavCopy } from '../../../copy';\n\ninterface EntryProps {\n entry: SectionNavEntry;\n linkComponent: ElementType | undefined;\n copy: SectionNavCopy;\n testId: string;\n onDone: () => void;\n}\n\n/** A tile in a `grid` group: icon over a short label. */\nfunction GridEntry({ entry, linkComponent, copy, testId, onDone }: EntryProps): React.JSX.Element {\n const theme = useTheme();\n return (\n <Box\n {...controlProps({\n href: entry.href,\n linkComponent,\n inert: entry.disabled === true,\n onClick: () => {\n entry.onSelect?.();\n onDone();\n },\n })}\n aria-current={entry.active ? 'page' : undefined}\n data-testid={entry.dataTestId ?? `${testId}-entry-${entry.id}`}\n sx={{\n ...CONTROL_RESET,\n ...focusRing(theme),\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 0.75,\n minHeight: rem(theme, 76),\n px: 0.5,\n py: 1,\n borderRadius: 1.5,\n textAlign: 'center',\n bgcolor: entry.active ? 'action.selected' : 'action.hover',\n color: entry.active ? 'primary.main' : 'text.primary',\n '& svg': { color: 'primary.main' },\n '&:disabled': { color: 'text.disabled', '& svg': { color: 'text.disabled' } },\n }}\n >\n <CountedIcon icon={entry.icon} count={entry.badge} label={copy.badge} testId={`${testId}-badge-${entry.id}`} />\n <Typography component=\"span\" variant=\"caption\" sx={{ lineHeight: 1.2, fontWeight: entry.active ? 700 : 500 }}>\n {entry.label}\n </Typography>\n </Box>\n );\n}\n\n/** A row in a `list` group: icon, label, and the description under it. */\nfunction ListEntry({ entry, linkComponent, copy, testId, onDone }: EntryProps): React.JSX.Element {\n const theme = useTheme();\n return (\n <Box\n {...controlProps({\n href: entry.href,\n linkComponent,\n inert: entry.disabled === true,\n onClick: () => {\n entry.onSelect?.();\n onDone();\n },\n })}\n aria-current={entry.active ? 'page' : undefined}\n data-testid={entry.dataTestId ?? `${testId}-entry-${entry.id}`}\n sx={{\n ...CONTROL_RESET,\n ...focusRing(theme),\n display: 'flex',\n alignItems: 'center',\n gap: 1.5,\n width: '100%',\n minHeight: rem(theme, 52),\n px: 1.5,\n py: 1,\n borderRadius: 1.5,\n textAlign: 'start',\n bgcolor: entry.active ? 'action.selected' : 'action.hover',\n '& svg': { color: 'primary.main' },\n '&:disabled': { color: 'text.disabled', '& svg': { color: 'text.disabled' } },\n }}\n >\n <CountedIcon icon={entry.icon} count={entry.badge} label={copy.badge} testId={`${testId}-badge-${entry.id}`} />\n <Box component=\"span\" sx={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>\n <Typography component=\"span\" variant=\"body2\" sx={{ fontWeight: 600 }}>\n {entry.label}\n </Typography>\n {entry.description ? (\n <Typography component=\"span\" variant=\"caption\" color=\"text.secondary\">\n {entry.description}\n </Typography>\n ) : null}\n </Box>\n </Box>\n );\n}\n\n/** One titled run of entries, as tiles or rows. */\nfunction SheetGroup({\n group,\n linkComponent,\n copy,\n testId,\n onDone,\n}: Omit<EntryProps, 'entry'> & { group: SectionNavGroup }): React.JSX.Element {\n const grid = group.layout === 'grid';\n const Entry = grid ? GridEntry : ListEntry;\n return (\n <Box component=\"section\" data-testid={`${testId}-group-${group.id}`} sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>\n {group.title ? (\n <Typography variant=\"overline\" color=\"text.secondary\" sx={{ lineHeight: 1.6 }}>\n {group.title}\n </Typography>\n ) : null}\n <Box\n sx={\n grid\n ? { display: 'grid', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))', gap: 1 }\n : { display: 'flex', flexDirection: 'column', gap: 0.75 }\n }\n >\n {group.entries.map((entry) => (\n <Entry key={entry.id} entry={entry} linkComponent={linkComponent} copy={copy} testId={testId} onDone={onDone} />\n ))}\n </Box>\n </Box>\n );\n}\n\n/**\n * A menu opened from the bar: a bottom sheet over the page.\n *\n * Choosing an entry closes it — a link has somewhere to go and an action has\n * something to do, and neither wants the sheet still covering the screen.\n */\nexport function SectionNavSheet({\n menu,\n open,\n onClose,\n linkComponent,\n copy,\n testId,\n bottomOffset,\n}: {\n menu: SectionNavMenu;\n open: boolean;\n onClose: () => void;\n linkComponent: ElementType | undefined;\n copy: SectionNavCopy;\n testId: string;\n /** How far above the viewport's foot the sheet stops — the bar's own height, so the bar stays visible. */\n bottomOffset: string;\n}): React.JSX.Element {\n const theme = useTheme();\n return (\n <Drawer\n open={open}\n onClose={onClose}\n anchor=\"bottom\"\n height=\"auto\"\n dataTestId={testId}\n paperSx={{\n borderTopLeftRadius: rem(theme, Number(theme.shape.borderRadius) * 3),\n borderTopRightRadius: rem(theme, Number(theme.shape.borderRadius) * 3),\n maxHeight: `calc(85dvh - ${bottomOffset})`,\n bottom: bottomOffset,\n }}\n >\n {/* The library Drawer names nothing: the dialog role and its name live\n here, around everything the focus trap holds. */}\n <Box\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={menu.title}\n sx={{ display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 }}\n >\n <DrawerHeader onClose={onClose} closeLabel={copy.close} dataTestId={`${testId}-header`}>\n {menu.title}\n </DrawerHeader>\n <DrawerContent>\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n {menu.groups.map((group) => (\n <SheetGroup\n key={group.id}\n group={group}\n linkComponent={linkComponent}\n copy={copy}\n testId={testId}\n onDone={onClose}\n />\n ))}\n </Box>\n </DrawerContent>\n </Box>\n </Drawer>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAsBrB,SA+BE,KA/BF;AAHJ,SAAS,UAAU,EAAE,OAAO,eAAe,MAAM,QAAQ,OAAO,GAAkC;AAChG,QAAM,QAAQ,SAAS;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG,aAAa;AAAA,QACf,MAAM,MAAM;AAAA,QACZ;AAAA,QACA,OAAO,MAAM,aAAa;AAAA,QAC1B,SAAS,MAAM;AACb,gBAAM,WAAW;AACjB,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AAAA,MACD,gBAAc,MAAM,SAAS,SAAS;AAAA,MACtC,eAAa,MAAM,cAAc,GAAG,MAAM,UAAU,MAAM,EAAE;AAAA,MAC5D,IAAI;AAAA,QACF,GAAG;AAAA,QACH,GAAG,UAAU,KAAK;AAAA,QAClB,SAAS;AAAA,QACT,eAAe;AAAA,QACf,YA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k-RX7J6VRI.js";
6
+ } from "./chunk-HKEBTPKY.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-SA2ERYVV.js.map
55
+ //# sourceMappingURL=chunk-VAO63IIP.js.map
@@ -1,21 +1,26 @@
1
1
  import {
2
2
  SectionNavSheet
3
- } from "./chunk-32JMSHEA.js";
3
+ } from "./chunk-S4ZUZ6DS.js";
4
4
  import {
5
5
  RaisedActionButton
6
- } from "./chunk-RZ4SBSLP.js";
6
+ } from "./chunk-WNKRFMSI.js";
7
7
  import {
8
8
  Box,
9
9
  CONTROL_RESET,
10
10
  CountedIcon,
11
+ NOT_LIVE,
12
+ SlotIcon,
11
13
  controlProps,
14
+ destinationControl,
12
15
  focusRing
13
- } from "./chunk-GLKQT2DS.js";
16
+ } from "./chunk-A436VORP.js";
14
17
  import {
15
18
  barSlots,
19
+ destinationState,
20
+ isMenu,
16
21
  menuActive,
17
22
  menuCount
18
- } from "./chunk-VHVI3D4R.js";
23
+ } from "./chunk-P3GBXE73.js";
19
24
  import {
20
25
  rem
21
26
  } from "./chunk-YKCAJ2TN.js";
@@ -38,7 +43,8 @@ function Slot({
38
43
  copy,
39
44
  testId,
40
45
  control,
41
- expanded
46
+ expanded,
47
+ loading = false
42
48
  }) {
43
49
  const theme = useTheme();
44
50
  return /* @__PURE__ */ jsxs(
@@ -47,36 +53,20 @@ function Slot({
47
53
  ...control,
48
54
  "aria-current": current ? "page" : void 0,
49
55
  "aria-expanded": expanded,
56
+ "aria-busy": loading || void 0,
50
57
  "data-lit": lit ? "true" : void 0,
51
58
  "data-testid": testId,
52
- sx: {
53
- ...CONTROL_RESET,
54
- ...focusRing(theme),
55
- flex: 1,
56
- minWidth: 0,
57
- display: "flex",
58
- flexDirection: "column",
59
- alignItems: "center",
60
- justifyContent: "center",
61
- gap: 0.25,
62
- position: "relative",
63
- color: lit ? "primary.main" : "text.secondary",
64
- // The current slot is marked by more than its colour: a short rule on
65
- // its top edge, so the state survives a colour-blind reading.
66
- '&[data-lit="true"]::before': {
67
- content: '""',
68
- position: "absolute",
69
- top: 0,
70
- insetInline: "22%",
71
- height: rem(theme, 3),
72
- borderBottomLeftRadius: rem(theme, 3),
73
- borderBottomRightRadius: rem(theme, 3),
74
- bgcolor: "primary.main"
75
- },
76
- "& svg": { fontSize: rem(theme, 22) }
77
- },
59
+ sx: slotSx(theme, lit),
78
60
  children: [
79
- /* @__PURE__ */ jsx(CountedIcon, { icon, count, label: copy.badge, testId: `${testId}-badge` }),
61
+ /* @__PURE__ */ jsx(
62
+ CountedIcon,
63
+ {
64
+ icon: /* @__PURE__ */ jsx(SlotIcon, { icon, loading }),
65
+ count,
66
+ label: copy.badge,
67
+ testId: `${testId}-badge`
68
+ }
69
+ ),
80
70
  /* @__PURE__ */ jsx(
81
71
  Typography,
82
72
  {
@@ -97,62 +87,125 @@ function Slot({
97
87
  }
98
88
  );
99
89
  }
100
- function BarSlotView({
101
- slot,
90
+ function slotSx(theme, lit) {
91
+ return {
92
+ ...CONTROL_RESET,
93
+ ...focusRing(theme),
94
+ flex: 1,
95
+ minWidth: 0,
96
+ display: "flex",
97
+ flexDirection: "column",
98
+ alignItems: "center",
99
+ justifyContent: "center",
100
+ gap: 0.25,
101
+ position: "relative",
102
+ color: lit ? "primary.main" : "text.secondary",
103
+ // The current slot is marked by more than its colour: a short rule on
104
+ // its top edge, so the state survives a colour-blind reading.
105
+ '&[data-lit="true"]::before': {
106
+ content: '""',
107
+ position: "absolute",
108
+ top: 0,
109
+ insetInline: "22%",
110
+ height: rem(theme, 3),
111
+ borderBottomLeftRadius: rem(theme, 3),
112
+ borderBottomRightRadius: rem(theme, 3),
113
+ bgcolor: "primary.main"
114
+ },
115
+ "& svg": { fontSize: rem(theme, 22) },
116
+ [NOT_LIVE]: { color: "text.disabled" }
117
+ };
118
+ }
119
+ function PrimarySlot({
102
120
  primary,
103
- more,
104
- open,
105
- toggle,
106
- close,
107
- linkComponent,
108
- copy,
109
- dataTestId
121
+ context
110
122
  }) {
111
- if (slot.kind === "primary" && primary) {
123
+ const testId = primary.dataTestId ?? `${context.dataTestId}-primary`;
124
+ if (!isMenu(primary)) {
112
125
  return /* @__PURE__ */ jsx(
113
126
  RaisedActionButton,
114
127
  {
115
128
  label: primary.label,
116
129
  icon: primary.icon,
117
- open: open === "primary",
118
- closeLabel: copy.close,
119
- dataTestId: `${dataTestId}-primary`,
120
- onClick: () => toggle("primary")
121
- }
122
- );
123
- }
124
- if (slot.kind === "more" && more) {
125
- return /* @__PURE__ */ jsx(
126
- Slot,
127
- {
128
- label: more.label,
129
- icon: more.icon,
130
- count: menuCount(more),
131
- current: false,
132
- lit: open === "more" || open === null && menuActive(more),
133
- expanded: open === "more",
134
- copy,
135
- testId: `${dataTestId}-more`,
136
- control: controlProps({ href: void 0, linkComponent, onClick: () => toggle("more") })
130
+ captioned: true,
131
+ disabled: primary.disabled,
132
+ loading: primary.loading,
133
+ dataTestId: testId,
134
+ onClick: () => {
135
+ context.close();
136
+ primary.onSelect();
137
+ }
137
138
  }
138
139
  );
139
140
  }
140
- if (slot.kind !== "destination") return null;
141
- const { destination } = slot;
141
+ return /* @__PURE__ */ jsx(
142
+ RaisedActionButton,
143
+ {
144
+ label: primary.label,
145
+ icon: primary.icon,
146
+ open: context.open === "primary",
147
+ closeLabel: context.copy.close,
148
+ disabled: primary.disabled,
149
+ dataTestId: testId,
150
+ onClick: () => context.toggle("primary")
151
+ }
152
+ );
153
+ }
154
+ function MoreSlot({ more, context }) {
155
+ const { open } = context;
156
+ return /* @__PURE__ */ jsx(
157
+ Slot,
158
+ {
159
+ label: more.label,
160
+ icon: more.icon,
161
+ count: menuCount(more),
162
+ current: false,
163
+ lit: open === "more" || open === null && menuActive(more),
164
+ expanded: open === "more",
165
+ copy: context.copy,
166
+ testId: more.dataTestId ?? `${context.dataTestId}-more`,
167
+ control: controlProps({
168
+ href: void 0,
169
+ linkComponent: context.linkComponent,
170
+ inert: more.disabled === true,
171
+ onClick: () => context.toggle("more")
172
+ })
173
+ }
174
+ );
175
+ }
176
+ function DestinationSlot({
177
+ destination,
178
+ context
179
+ }) {
180
+ const { current, lit } = destinationState(destination);
142
181
  return /* @__PURE__ */ jsx(
143
182
  Slot,
144
183
  {
145
184
  label: destination.label,
146
185
  icon: destination.icon,
147
186
  count: destination.badge,
148
- current: destination.active === true,
149
- lit: open === null && destination.active === true,
150
- copy,
151
- testId: `${dataTestId}-dest-${destination.id}`,
152
- control: controlProps({ href: destination.href, linkComponent, onClick: close })
187
+ current,
188
+ lit: context.open === null && lit,
189
+ copy: context.copy,
190
+ testId: destination.dataTestId ?? `${context.dataTestId}-dest-${destination.id}`,
191
+ loading: destination.loading === true,
192
+ control: destinationControl(destination, context.linkComponent, () => {
193
+ context.close();
194
+ destination.onSelect?.();
195
+ })
153
196
  }
154
197
  );
155
198
  }
199
+ function BarSlotView({
200
+ slot,
201
+ primary,
202
+ more,
203
+ context
204
+ }) {
205
+ if (slot.kind === "primary") return primary ? /* @__PURE__ */ jsx(PrimarySlot, { primary, context }) : null;
206
+ if (slot.kind === "more") return more ? /* @__PURE__ */ jsx(MoreSlot, { more, context }) : null;
207
+ return /* @__PURE__ */ jsx(DestinationSlot, { destination: slot.destination, context });
208
+ }
156
209
  function SectionNavBar({
157
210
  label,
158
211
  destinations,
@@ -162,6 +215,7 @@ function SectionNavBar({
162
215
  copy,
163
216
  dataTestId
164
217
  }) {
218
+ const sheetMenu = isMenu(primary) ? primary : void 0;
165
219
  const theme = useTheme();
166
220
  const [open, setOpen] = useState(null);
167
221
  const toggle = (menu) => setOpen((current) => current === menu ? null : menu);
@@ -195,21 +249,16 @@ function SectionNavBar({
195
249
  slot,
196
250
  primary,
197
251
  more,
198
- open,
199
- toggle,
200
- close,
201
- linkComponent,
202
- copy,
203
- dataTestId
252
+ context: { open, toggle, close, linkComponent, copy, dataTestId }
204
253
  },
205
254
  slot.kind === "destination" ? `dest-${slot.destination.id}` : `menu-${slot.kind}`
206
255
  ))
207
256
  }
208
257
  ),
209
- primary ? /* @__PURE__ */ jsx(
258
+ sheetMenu ? /* @__PURE__ */ jsx(
210
259
  SectionNavSheet,
211
260
  {
212
- menu: primary,
261
+ menu: sheetMenu,
213
262
  open: open === "primary",
214
263
  onClose: close,
215
264
  linkComponent,
@@ -237,4 +286,4 @@ export {
237
286
  sectionNavBarInset,
238
287
  SectionNavBar
239
288
  };
240
- //# sourceMappingURL=chunk-43Q6CVPB.js.map
289
+ //# sourceMappingURL=chunk-VELGOFCL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/navigation/SectionNav/SectionNav.bar.tsx"],"sourcesContent":["import Typography from '@mui/material/Typography/index.js';\nimport { useTheme, type SxProps, type Theme } from '@mui/material/styles/index.js';\nimport { useState, type ElementType, type ReactNode } from 'react';\n\nimport type { SectionNavCopy } from '../../../copy';\nimport { rem } from '../../../tokens/scales';\n\nimport { barSlots, destinationState, isMenu, menuActive, menuCount, type BarSlot } from './SectionNav.helpers';\nimport {\n Box,\n CONTROL_RESET,\n CountedIcon,\n NOT_LIVE,\n SlotIcon,\n controlProps,\n destinationControl,\n focusRing,\n} from './SectionNav.parts';\nimport { RaisedActionButton } from './SectionNav.primary';\nimport { SectionNavSheet } from './SectionNav.sheet';\nimport type { SectionNavAction, SectionNavDestination, SectionNavMenu, SectionNavProps } from './SectionNav.types';\n\n/** Which of the bar's two menus is open, if any. */\ntype OpenMenu = 'primary' | 'more' | null;\n\n/** The bar's height above the safe area — tall enough for an icon over a label. */\nconst barHeight = (theme: Parameters<typeof rem>[0]): string => rem(theme, 60);\n\n/**\n * The bar's full height on screen, the safe area included — where its sheets\n * stop, and what a host reserves at the foot of its content so nothing it\n * floats (a toast, a receipt) lands under the bar.\n */\nexport function sectionNavBarInset(theme: Parameters<typeof rem>[0]): string {\n return `calc(${barHeight(theme)} + env(safe-area-inset-bottom))`;\n}\n\n/**\n * One slot: icon over label, a count on the icon.\n *\n * `current` is the page the viewer is on and is what `aria-current` reports —\n * a link's claim only; an action slot that is ON says so with `aria-pressed`,\n * which arrives in `control`. `lit` is only how the slot looks, and goes out\n * while a sheet is open so the bar shows where the thumb is. Opening a sheet\n * is `aria-expanded`'s to say.\n *\n * A destination is a link or an action; the \"more\" slot is a button that\n * opens its sheet. Either way the whole slot is the target, so a thumb landing\n * on the label lands on the control. A `disabled` slot is a disabled button,\n * dimmed — the act is still where the hand expects it. A `loading` or\n * `dimmed` slot is drawn the same and stays focusable (`aria-disabled`).\n */\nfunction Slot({\n label,\n icon,\n count,\n current,\n lit,\n copy,\n testId,\n control,\n expanded,\n loading = false,\n}: {\n label: string;\n icon: ReactNode;\n count: number | undefined;\n current: boolean;\n lit: boolean;\n copy: SectionNavCopy;\n testId: string;\n control: Record<string, unknown>;\n expanded?: boolean;\n loading?: boolean;\n}): React.JSX.Element {\n const theme = useTheme();\n return (\n <Box\n {...control}\n aria-current={current ? 'page' : undefined}\n aria-expanded={expanded}\n aria-busy={loading || undefined}\n data-lit={lit ? 'true' : undefined}\n data-testid={testId}\n sx={slotSx(theme, lit)}\n >\n <CountedIcon\n icon={<SlotIcon icon={icon} loading={loading} />}\n count={count}\n label={copy.badge}\n testId={`${testId}-badge`}\n />\n <Typography\n component=\"span\"\n variant=\"caption\"\n sx={{\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n lineHeight: 1.3,\n fontWeight: lit ? 700 : 400,\n }}\n >\n {label}\n </Typography>\n </Box>\n );\n}\n\n/** A slot's look: icon over label, the lit rule on its top edge, dimmed when disabled. */\nfunction slotSx(theme: Theme, lit: boolean): SxProps<Theme> {\n return {\n ...CONTROL_RESET,\n ...focusRing(theme),\n flex: 1,\n minWidth: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 0.25,\n position: 'relative',\n color: lit ? 'primary.main' : 'text.secondary',\n // The current slot is marked by more than its colour: a short rule on\n // its top edge, so the state survives a colour-blind reading.\n '&[data-lit=\"true\"]::before': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n insetInline: '22%',\n height: rem(theme, 3),\n borderBottomLeftRadius: rem(theme, 3),\n borderBottomRightRadius: rem(theme, 3),\n bgcolor: 'primary.main',\n },\n '& svg': { fontSize: rem(theme, 22) },\n [NOT_LIVE]: { color: 'text.disabled' },\n } as SxProps<Theme>;\n}\n\n/** What every slot kind is handed: the bar's open state and how to change it. */\ninterface SlotContext {\n open: OpenMenu;\n toggle: (menu: Exclude<OpenMenu, null>) => void;\n close: () => void;\n linkComponent: ElementType | undefined;\n copy: SectionNavCopy;\n dataTestId: string;\n}\n\n/** The raised button: an action runs on tap; a menu opens its sheet. */\nfunction PrimarySlot({\n primary,\n context,\n}: {\n primary: SectionNavMenu | SectionNavAction;\n context: SlotContext;\n}): React.JSX.Element {\n const testId = primary.dataTestId ?? `${context.dataTestId}-primary`;\n if (!isMenu(primary)) {\n return (\n <RaisedActionButton\n label={primary.label}\n icon={primary.icon}\n captioned\n disabled={primary.disabled}\n loading={primary.loading}\n dataTestId={testId}\n onClick={() => {\n context.close();\n primary.onSelect();\n }}\n />\n );\n }\n return (\n <RaisedActionButton\n label={primary.label}\n icon={primary.icon}\n open={context.open === 'primary'}\n closeLabel={context.copy.close}\n disabled={primary.disabled}\n dataTestId={testId}\n onClick={() => context.toggle('primary')}\n />\n );\n}\n\n/** The \"more\" slot: a button that opens its sheet, carrying its entries' counts. */\nfunction MoreSlot({ more, context }: { more: SectionNavMenu; context: SlotContext }): React.JSX.Element {\n const { open } = context;\n return (\n <Slot\n label={more.label}\n icon={more.icon}\n count={menuCount(more)}\n current={false}\n lit={open === 'more' || (open === null && menuActive(more))}\n expanded={open === 'more'}\n copy={context.copy}\n testId={more.dataTestId ?? `${context.dataTestId}-more`}\n control={controlProps({\n href: undefined,\n linkComponent: context.linkComponent,\n inert: more.disabled === true,\n onClick: () => context.toggle('more'),\n })}\n />\n );\n}\n\n/** A destination: a link, or an action slot (a toggle when it carries `active`). */\nfunction DestinationSlot({\n destination,\n context,\n}: {\n destination: SectionNavDestination;\n context: SlotContext;\n}): React.JSX.Element {\n const { current, lit } = destinationState(destination);\n return (\n <Slot\n label={destination.label}\n icon={destination.icon}\n count={destination.badge}\n current={current}\n lit={context.open === null && lit}\n copy={context.copy}\n testId={destination.dataTestId ?? `${context.dataTestId}-dest-${destination.id}`}\n loading={destination.loading === true}\n control={destinationControl(destination, context.linkComponent, () => {\n context.close();\n destination.onSelect?.();\n })}\n />\n );\n}\n\n/** One slot of the bar, whichever kind it is. */\nfunction BarSlotView({\n slot,\n primary,\n more,\n context,\n}: {\n slot: BarSlot;\n primary: SectionNavMenu | SectionNavAction | undefined;\n more: SectionNavMenu | undefined;\n context: SlotContext;\n}): React.JSX.Element | null {\n if (slot.kind === 'primary') return primary ? <PrimarySlot primary={primary} context={context} /> : null;\n if (slot.kind === 'more') return more ? <MoreSlot more={more} context={context} /> : null;\n return <DestinationSlot destination={slot.destination} context={context} />;\n}\n\n/** The phone layout: a bottom bar, with its menus as bottom sheets. */\nexport function SectionNavBar({\n label,\n destinations,\n primary,\n more,\n linkComponent,\n copy,\n dataTestId,\n}: Required<Pick<SectionNavProps, 'label' | 'destinations' | 'copy' | 'dataTestId'>> &\n Pick<SectionNavProps, 'primary' | 'more'> & { linkComponent: ElementType | undefined }): React.JSX.Element {\n const sheetMenu = isMenu(primary) ? primary : undefined;\n const theme = useTheme();\n const [open, setOpen] = useState<OpenMenu>(null);\n const toggle = (menu: Exclude<OpenMenu, null>): void => setOpen((current) => (current === menu ? null : menu));\n const close = (): void => setOpen(null);\n\n return (\n <>\n <Box\n component=\"nav\"\n aria-label={label}\n data-testid={dataTestId}\n sx={{\n flex: 'none',\n display: 'flex',\n alignItems: 'stretch',\n boxSizing: 'border-box',\n height: sectionNavBarInset(theme),\n paddingBottom: 'env(safe-area-inset-bottom)',\n borderTop: `1px solid ${theme.palette.divider}`,\n bgcolor: 'background.paper',\n // Above the backdrop ONLY while one of its own sheets is open, so the\n // primary button can close what it opened. Raised all the time it\n // would sit over every dialog the page opens, and on a small phone a\n // dialog's own footer is exactly where the bar is.\n position: 'relative',\n zIndex: open === null ? 'auto' : theme.zIndex.modal + 1,\n }}\n >\n {barSlots(destinations, more !== undefined, primary !== undefined).map((slot) => (\n <BarSlotView\n key={slot.kind === 'destination' ? `dest-${slot.destination.id}` : `menu-${slot.kind}`}\n slot={slot}\n primary={primary}\n more={more}\n context={{ open, toggle, close, linkComponent, copy, dataTestId }}\n />\n ))}\n </Box>\n {sheetMenu ? (\n <SectionNavSheet\n menu={sheetMenu}\n open={open === 'primary'}\n onClose={close}\n linkComponent={linkComponent}\n copy={copy}\n testId={`${dataTestId}-primary-sheet`}\n bottomOffset={sectionNavBarInset(theme)}\n />\n ) : null}\n {more ? (\n <SectionNavSheet\n menu={more}\n open={open === 'more'}\n onClose={close}\n linkComponent={linkComponent}\n copy={copy}\n testId={`${dataTestId}-more-sheet`}\n bottomOffset={sectionNavBarInset(theme)}\n />\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AACvB,SAAS,gBAA0C;AACnD,SAAS,gBAAkD;AA2EvD,SAqMA,UA3LU,KAVV;AAnDJ,IAAM,YAAY,CAAC,UAA6C,IAAI,OAAO,EAAE;AAOtE,SAAS,mBAAmB,OAA0C;AAC3E,SAAO,QAAQ,UAAU,KAAK,CAAC;AACjC;AAiBA,SAAS,KAAK;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAWsB;AACpB,QAAM,QAAQ,SAAS;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAc,UAAU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,WAAW;AAAA,UACX,QAAQ,mBAAmB,KAAK;AAAA,UAChC,eAAe;AAAA,UACf,WAAW,aAAa,MAAM,QAAQ,OAAO;AAAA,UAC7C,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,UAKT,UAAU;AAAA,UACV,QAAQ,SAAS,OAAO,SAAS,MAAM,OAAO,QAAQ;AAAA,QACxD;AAAA,QAEC,mBAAS,cAAc,SAAS,QAAW,YAAY,MAAS,EAAE,IAAI,CAAC,SACtE;AAAA,UAAC;AAAA;AAAA,YAEC;AAAA,YACA;AAAA,YACA;AAAA,YACA,SAAS,EAAE,MAAM,QAAQ,OAAO,eAAe,MAAM,WAAW;AAAA;AAAA,UAJ3D,KAAK,SAAS,gBAAgB,QAAQ,KAAK,YAAY,EAAE,KAAK,QAAQ,KAAK,IAAI;AAAA,QAKtF,CACD;AAAA;AAAA,IACH;AAAA,IACC,YACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,MAAM,SAAS;AAAA,QACf,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,QAAQ,GAAG,UAAU;AAAA,QACrB,cAAc,mBAAmB,KAAK;AAAA;AAAA,IACxC,IACE;AAAA,IACH,OACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,MAAM,SAAS;AAAA,QACf,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,QAAQ,GAAG,UAAU;AAAA,QACrB,cAAc,mBAAmB,KAAK;AAAA;AAAA,IACxC,IACE;AAAA,KACN;AAEJ;","names":[]}
@@ -0,0 +1,113 @@
1
+ import {
2
+ Box,
3
+ CONTROL_RESET,
4
+ NOT_LIVE,
5
+ SlotIcon,
6
+ focusRing
7
+ } from "./chunk-A436VORP.js";
8
+ import {
9
+ rem
10
+ } from "./chunk-YKCAJ2TN.js";
11
+
12
+ // src/components/navigation/SectionNav/SectionNav.primary.tsx
13
+ import Typography from "@mui/material/Typography/index.js";
14
+ import { useTheme } from "@mui/material/styles/index.js";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function RaisedActionButton({
17
+ label,
18
+ icon,
19
+ onClick,
20
+ open,
21
+ closeLabel,
22
+ captioned = false,
23
+ disabled = false,
24
+ loading = false,
25
+ dataTestId = "raised-action"
26
+ }) {
27
+ const theme = useTheme();
28
+ const expanded = open === true;
29
+ return /* @__PURE__ */ jsxs(
30
+ Box,
31
+ {
32
+ sx: {
33
+ flex: "none",
34
+ display: "flex",
35
+ flexDirection: "column",
36
+ alignItems: "center",
37
+ justifyContent: "flex-start",
38
+ px: 0.5
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ jsx(
42
+ Box,
43
+ {
44
+ component: "button",
45
+ type: "button",
46
+ ...raisedState({ onClick, disabled, loading }),
47
+ "aria-label": expanded && closeLabel ? closeLabel : label,
48
+ "aria-expanded": open,
49
+ "data-testid": dataTestId,
50
+ sx: raisedSx(theme, expanded),
51
+ children: /* @__PURE__ */ jsx(SlotIcon, { icon, loading })
52
+ }
53
+ ),
54
+ captioned ? /* @__PURE__ */ jsx(RaisedCaption, { label, inert: disabled || loading }) : null
55
+ ]
56
+ }
57
+ );
58
+ }
59
+ function raisedState({
60
+ onClick,
61
+ disabled,
62
+ loading
63
+ }) {
64
+ const busy = loading && !disabled;
65
+ return {
66
+ onClick: busy ? void 0 : onClick,
67
+ disabled,
68
+ "aria-disabled": busy ? "true" : void 0,
69
+ "aria-busy": loading || void 0
70
+ };
71
+ }
72
+ function RaisedCaption({ label, inert }) {
73
+ return /* @__PURE__ */ jsx(
74
+ Typography,
75
+ {
76
+ component: "span",
77
+ variant: "caption",
78
+ "aria-hidden": true,
79
+ sx: { lineHeight: 1.3, mt: 0.25, whiteSpace: "nowrap", color: inert ? "text.disabled" : "text.primary" },
80
+ children: label
81
+ }
82
+ );
83
+ }
84
+ function raisedSx(theme, expanded) {
85
+ const size = rem(theme, 52);
86
+ return {
87
+ ...CONTROL_RESET,
88
+ ...focusRing(theme),
89
+ width: size,
90
+ height: size,
91
+ // Lifted half out of the bar: the one control that is not a place.
92
+ marginTop: rem(theme, -18),
93
+ borderRadius: "50%",
94
+ display: "flex",
95
+ alignItems: "center",
96
+ justifyContent: "center",
97
+ bgcolor: "primary.main",
98
+ color: "primary.contrastText",
99
+ boxShadow: theme.shadows[6],
100
+ [NOT_LIVE]: { cursor: "default", bgcolor: "action.disabledBackground", color: "text.disabled", boxShadow: "none" },
101
+ "& svg": {
102
+ fontSize: rem(theme, 26),
103
+ transition: theme.transitions.create("transform", { duration: theme.transitions.duration.shorter }),
104
+ transform: expanded ? "rotate(45deg)" : "none"
105
+ },
106
+ "@media (prefers-reduced-motion: reduce)": { "& svg": { transition: "none" } }
107
+ };
108
+ }
109
+
110
+ export {
111
+ RaisedActionButton
112
+ };
113
+ //# sourceMappingURL=chunk-WNKRFMSI.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, focusRing } 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 /** 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 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 aria-label={expanded && closeLabel ? closeLabel : label}\n aria-expanded={open}\n data-testid={dataTestId}\n sx={raisedSx(theme, expanded)}\n >\n <SlotIcon icon={icon} loading={loading} />\n </Box>\n {captioned ? <RaisedCaption label={label} inert={disabled || loading} /> : null}\n </Box>\n );\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. Hidden from assistive tech: the button\n * already carries the same words as its name, and reading them twice is noise.\n */\nfunction RaisedCaption({ label, inert }: { label: string; inert: boolean }): React.JSX.Element {\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): SxProps<Theme> {\n const size = rem(theme, 52);\n return {\n ...CONTROL_RESET,\n ...focusRing(theme),\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, -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, 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;AAkE/C,SAmBI,KAnBJ;AAdG,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,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,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H,SAAS;AAAA,MACP,UAAU,IAAI,OAAO,EAAE;AAAA,MACvB,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":[]}
@@ -1,17 +1,17 @@
1
1
  import "../chunk-R26KYJHK.js";
2
2
  import {
3
3
  SectionNav
4
- } from "../chunk-SA2ERYVV.js";
4
+ } from "../chunk-VAO63IIP.js";
5
5
  import {
6
6
  sectionNavBarInset
7
- } from "../chunk-43Q6CVPB.js";
8
- import "../chunk-32JMSHEA.js";
9
- import "../chunk-RX7J6VRI.js";
7
+ } from "../chunk-VELGOFCL.js";
8
+ import "../chunk-S4ZUZ6DS.js";
9
+ import "../chunk-HKEBTPKY.js";
10
10
  import {
11
11
  RaisedActionButton
12
- } from "../chunk-RZ4SBSLP.js";
13
- import "../chunk-GLKQT2DS.js";
14
- import "../chunk-VHVI3D4R.js";
12
+ } from "../chunk-WNKRFMSI.js";
13
+ import "../chunk-A436VORP.js";
14
+ import "../chunk-P3GBXE73.js";
15
15
  import "../chunk-TMSWLFL4.js";
16
16
  import "../chunk-KIHGTL2D.js";
17
17
  import "../chunk-5AK2EZG5.js";
@@ -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;AAGnE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAM7C,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQ1E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAE3E;AAyJD,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,UAAU,GACX,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,GAClF,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG;IAAE,aAAa,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAoE3G"}
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;AAGnE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAe7C,OAAO,KAAK,EAA2D,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQnH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAE3E;AA6ND,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,UAAU,GACX,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,GAClF,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG;IAAE,aAAa,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAgE3G"}
@@ -1,4 +1,4 @@
1
- import type { SectionNavDestination, SectionNavMenu } from './SectionNav.types';
1
+ import type { SectionNavAction, SectionNavDestination, SectionNavMenu } from './SectionNav.types';
2
2
  /** A count worth drawing: positive and finite. Zero and "unknown" draw nothing. */
3
3
  export declare function shownCount(count: number | undefined): number | undefined;
4
4
  /**
@@ -29,4 +29,15 @@ export type BarSlot = {
29
29
  * is the right one, under the thumb of a right-handed phone.
30
30
  */
31
31
  export declare function barSlots(destinations: readonly SectionNavDestination[], hasMore: boolean, hasPrimary: boolean): BarSlot[];
32
+ /** A primary that opens a sheet, as opposed to one that acts on tap. */
33
+ export declare function isMenu(primary: SectionNavMenu | SectionNavAction | undefined): primary is SectionNavMenu;
34
+ /**
35
+ * How a destination reads. `current` is `aria-current="page"` and belongs to a
36
+ * LINK only — an action slot that is ON reports `aria-pressed` instead. `lit`
37
+ * is the look, and a `dimmed` slot is never lit: it says "not now".
38
+ */
39
+ export declare function destinationState(destination: SectionNavDestination): {
40
+ current: boolean;
41
+ lit: boolean;
42
+ };
32
43
  //# sourceMappingURL=SectionNav.helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionNav.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEhF,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM9E;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAEpE;AAED,uDAAuD;AACvD,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,qBAAqB,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,GAClB,OAAO,EAAE,CAKX"}
1
+ {"version":3,"file":"SectionNav.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAElG,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM9E;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAEpE;AAED,uDAAuD;AACvD,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,qBAAqB,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,GAClB,OAAO,EAAE,CAKX;AAED,wEAAwE;AACxE,wBAAgB,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,GAAG,SAAS,GAAG,OAAO,IAAI,cAAc,CAExG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,qBAAqB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAGvG"}