@12-apps/ui 6.68.0 → 6.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +8 -8
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-overflow-costs.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-overflow-fields.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-overflow.js +3 -3
- package/dist/_internal/components/index.js +17 -17
- package/dist/_internal/components/layout/SettingCard/SettingCard.js +5 -5
- package/dist/_internal/components/layout/SettingCard/SettingCard.parts.js +3 -3
- package/dist/_internal/components/layout/SettingCard/SettingCard.summary.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingGrid.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingGroup.js +6 -6
- package/dist/_internal/components/layout/SettingCard/SettingSwitch.js +5 -5
- package/dist/_internal/components/layout/SettingCard/SettingToggle.js +6 -6
- package/dist/_internal/components/layout/index.js +9 -9
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +5 -5
- package/dist/_internal/components/navigation/SectionNav/SectionNav.helpers.js +1 -1
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +8 -8
- package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +2 -2
- package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +3 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.railCreate.js +3 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +3 -3
- package/dist/_internal/components/navigation/index.js +8 -8
- package/dist/_internal/en-US.navigation.js +1 -1
- package/dist/_internal/icons/Icon.js +2 -2
- package/dist/_internal/icons/paths.generated.js +1 -1
- package/dist/_internal/pt-BR.navigation.js +1 -1
- package/dist/{chunk-QQWW6T4Q.js → chunk-2STYL5PF.js} +4 -4
- package/dist/{chunk-QQWW6T4Q.js.map → chunk-2STYL5PF.js.map} +1 -1
- package/dist/{chunk-L7HKMTKR.js → chunk-62YHJAWM.js} +2 -2
- package/dist/chunk-62YHJAWM.js.map +1 -0
- package/dist/{chunk-LKRXLWCC.js → chunk-6VUVSYP4.js} +3 -3
- package/dist/{chunk-EDZYPHZT.js → chunk-7SYYGXC7.js} +3 -2
- package/dist/{chunk-EDZYPHZT.js.map → chunk-7SYYGXC7.js.map} +1 -1
- package/dist/{chunk-GCYGVWOI.js → chunk-AMT7IJYV.js} +2 -2
- package/dist/{chunk-IGMD6S76.js → chunk-EBMWYRXW.js} +4 -4
- package/dist/{chunk-T7ZERP7A.js → chunk-EYW6KXUC.js} +2 -2
- package/dist/{chunk-DNT5PZLF.js → chunk-GZOW6HNN.js} +4 -3
- package/dist/{chunk-DNT5PZLF.js.map → chunk-GZOW6HNN.js.map} +1 -1
- package/dist/{chunk-6CZC5S6O.js → chunk-JCHJYBDG.js} +2 -2
- package/dist/{chunk-6CZC5S6O.js.map → chunk-JCHJYBDG.js.map} +1 -1
- package/dist/{chunk-EPZ7B35I.js → chunk-KIL3OVLI.js} +3 -2
- package/dist/{chunk-EPZ7B35I.js.map → chunk-KIL3OVLI.js.map} +1 -1
- package/dist/{chunk-YQGVO3ZU.js → chunk-KYPHR4TT.js} +4 -4
- package/dist/{chunk-IPYV7BLH.js → chunk-L5R2FB4T.js} +2 -2
- package/dist/{chunk-67XUBKJC.js → chunk-LWQGIN2M.js} +3 -3
- package/dist/{chunk-EZAQIEYB.js → chunk-LY6L3DMB.js} +12 -8
- package/dist/chunk-LY6L3DMB.js.map +1 -0
- package/dist/{chunk-U6ODZJCH.js → chunk-NIZUFPV3.js} +2 -2
- package/dist/{chunk-ZDT4ZGP4.js → chunk-OBGUD2PG.js} +5 -4
- package/dist/chunk-OBGUD2PG.js.map +1 -0
- package/dist/{chunk-WTGIW7LX.js → chunk-SAXALTRL.js} +2 -2
- package/dist/{chunk-CSLBRJ7N.js → chunk-SOQIWXFO.js} +9 -9
- package/dist/chunk-SOQIWXFO.js.map +1 -0
- package/dist/{chunk-XC7YHO7Z.js → chunk-TB4UTV25.js} +3 -1
- package/dist/chunk-TB4UTV25.js.map +1 -0
- package/dist/{chunk-TQXB2OHP.js → chunk-TLPFSA55.js} +3 -3
- package/dist/{chunk-3FIIMP7I.js → chunk-U5YOOHR6.js} +3 -3
- package/dist/{chunk-ZZO5MRMV.js → chunk-ULK4AGG4.js} +2 -2
- package/dist/{chunk-KDQEJAKH.js → chunk-VI2IXBOO.js} +2 -2
- package/dist/{chunk-JXW6DZDN.js → chunk-WP7KPWCP.js} +7 -3
- package/dist/chunk-WP7KPWCP.js.map +1 -0
- package/dist/{chunk-AKGXNC4R.js → chunk-WY7FR7I4.js} +3 -2
- package/dist/chunk-WY7FR7I4.js.map +1 -0
- package/dist/{chunk-XBTSKYYY.js → chunk-XS4NQ6LD.js} +24 -20
- package/dist/chunk-XS4NQ6LD.js.map +1 -0
- package/dist/{chunk-P3GBXE73.js → chunk-YCCWJ5XQ.js} +2 -2
- package/dist/chunk-YCCWJ5XQ.js.map +1 -0
- package/dist/{chunk-SEWUYHSG.js → chunk-YEKPQAOW.js} +2 -2
- package/dist/data-display/DataViews.js +9 -9
- package/dist/en-US.js +1 -1
- package/dist/icons.js +2 -2
- package/dist/layout/SettingCard.js +9 -9
- package/dist/locales.js +2 -2
- package/dist/native/chunks/{chunk-CNTOS6KK.js → chunk-H22XVP5O.js} +2 -2
- package/dist/native/chunks/{chunk-JFKH5YHF.js → chunk-RHD3625Y.js} +3 -1
- package/dist/native/chunks/chunk-RHD3625Y.js.map +1 -0
- package/dist/native/data-display/Alert.js +1 -1
- package/dist/native/data-display/Avatar.js +1 -1
- package/dist/native/data-display/Badge.js +1 -1
- package/dist/native/data-display/Chip.js +1 -1
- package/dist/native/data-display/EmptyState.js +2 -2
- package/dist/native/data-display/ErrorState.js +1 -1
- package/dist/native/data-display/FleetMap.js +2 -2
- package/dist/native/feedback/Dialog.js +1 -1
- package/dist/native/form/Checkbox.js +1 -1
- package/dist/native/form/Select.js +1 -1
- package/dist/native/icons.js +1 -1
- package/dist/navigation/SectionNav.js +8 -8
- package/dist/pt-BR.js +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsGrid.d.ts +7 -0
- package/dist/types/components/data-display/DataViews/DataViewsGrid.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-grid-parts.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-grid-parts.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-overflow-costs.d.ts +6 -2
- package/dist/types/components/data-display/DataViews/data-views-overflow-costs.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-overflow.d.ts +1 -1
- package/dist/types/components/data-display/DataViews/data-views-overflow.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.bar.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.helpers.d.ts +2 -2
- package/dist/types/components/navigation/SectionNav/SectionNav.helpers.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts +5 -3
- package/dist/types/components/navigation/SectionNav/SectionNav.parts.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.rail.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.railCreate.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts +6 -3
- package/dist/types/components/navigation/SectionNav/SectionNav.types.d.ts.map +1 -1
- package/dist/types/components/navigation/SectionNav/index.d.ts +1 -1
- package/dist/types/components/navigation/SectionNav/index.d.ts.map +1 -1
- package/dist/types/copy/navigation.d.ts +5 -0
- package/dist/types/copy/navigation.d.ts.map +1 -1
- package/dist/types/en-US.navigation.d.ts.map +1 -1
- package/dist/types/icons/paths.generated.d.ts +2 -0
- package/dist/types/icons/paths.generated.d.ts.map +1 -1
- package/dist/types/pt-BR.navigation.d.ts.map +1 -1
- package/dist/types-native/icons/paths.generated.d.ts +2 -0
- package/dist/types-native/icons/paths.generated.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/DataViews/DataViewsGrid.tsx +7 -0
- package/src/components/data-display/DataViews/DataViewsTableBase.tsx +2 -0
- package/src/components/data-display/DataViews/RESPONSIVE-BEHAVIOUR.md +10 -0
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +11 -1
- package/src/components/data-display/DataViews/data-views-overflow-costs.ts +8 -3
- package/src/components/data-display/DataViews/data-views-overflow.ts +6 -4
- package/src/components/navigation/SectionNav/SectionNav.bar.tsx +28 -18
- package/src/components/navigation/SectionNav/SectionNav.helpers.ts +3 -3
- package/src/components/navigation/SectionNav/SectionNav.md +7 -0
- package/src/components/navigation/SectionNav/SectionNav.parts.tsx +12 -2
- package/src/components/navigation/SectionNav/SectionNav.rail.tsx +3 -1
- package/src/components/navigation/SectionNav/SectionNav.railCreate.tsx +1 -0
- package/src/components/navigation/SectionNav/SectionNav.sheet.tsx +2 -2
- package/src/components/navigation/SectionNav/SectionNav.types.ts +7 -3
- package/src/components/navigation/SectionNav/index.ts +1 -0
- package/src/copy/navigation.ts +5 -0
- package/src/en-US.navigation.ts +1 -0
- package/src/icons/glyphs.json +2 -0
- package/src/icons/paths.generated.ts +2 -0
- package/src/pt-BR.navigation.ts +1 -0
- package/dist/chunk-AKGXNC4R.js.map +0 -1
- package/dist/chunk-CSLBRJ7N.js.map +0 -1
- package/dist/chunk-EZAQIEYB.js.map +0 -1
- package/dist/chunk-JXW6DZDN.js.map +0 -1
- package/dist/chunk-L7HKMTKR.js.map +0 -1
- package/dist/chunk-P3GBXE73.js.map +0 -1
- package/dist/chunk-XBTSKYYY.js.map +0 -1
- package/dist/chunk-XC7YHO7Z.js.map +0 -1
- package/dist/chunk-ZDT4ZGP4.js.map +0 -1
- package/dist/native/chunks/chunk-JFKH5YHF.js.map +0 -1
- /package/dist/{chunk-LKRXLWCC.js.map → chunk-6VUVSYP4.js.map} +0 -0
- /package/dist/{chunk-GCYGVWOI.js.map → chunk-AMT7IJYV.js.map} +0 -0
- /package/dist/{chunk-IGMD6S76.js.map → chunk-EBMWYRXW.js.map} +0 -0
- /package/dist/{chunk-T7ZERP7A.js.map → chunk-EYW6KXUC.js.map} +0 -0
- /package/dist/{chunk-YQGVO3ZU.js.map → chunk-KYPHR4TT.js.map} +0 -0
- /package/dist/{chunk-IPYV7BLH.js.map → chunk-L5R2FB4T.js.map} +0 -0
- /package/dist/{chunk-67XUBKJC.js.map → chunk-LWQGIN2M.js.map} +0 -0
- /package/dist/{chunk-U6ODZJCH.js.map → chunk-NIZUFPV3.js.map} +0 -0
- /package/dist/{chunk-WTGIW7LX.js.map → chunk-SAXALTRL.js.map} +0 -0
- /package/dist/{chunk-TQXB2OHP.js.map → chunk-TLPFSA55.js.map} +0 -0
- /package/dist/{chunk-3FIIMP7I.js.map → chunk-U5YOOHR6.js.map} +0 -0
- /package/dist/{chunk-ZZO5MRMV.js.map → chunk-ULK4AGG4.js.map} +0 -0
- /package/dist/{chunk-KDQEJAKH.js.map → chunk-VI2IXBOO.js.map} +0 -0
- /package/dist/{chunk-SEWUYHSG.js.map → chunk-YEKPQAOW.js.map} +0 -0
- /package/dist/native/chunks/{chunk-CNTOS6KK.js.map → chunk-H22XVP5O.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Box from '@mui/material/Box/index.js';
|
|
2
2
|
import type { SxProps, Theme } from '@mui/material/styles/index.js';
|
|
3
3
|
import type { ElementType, ReactNode } from 'react';
|
|
4
|
-
import type { SectionNavDestination } from './SectionNav.types';
|
|
4
|
+
import type { SectionNavBadge, SectionNavDestination } from './SectionNav.types';
|
|
5
5
|
/**
|
|
6
6
|
* An icon with its count on the shoulder.
|
|
7
7
|
*
|
|
@@ -9,11 +9,13 @@ import type { SectionNavDestination } from './SectionNav.types';
|
|
|
9
9
|
* that announces itself every minute is noise. Its NAME carries the number,
|
|
10
10
|
* so it is read when the control is.
|
|
11
11
|
*/
|
|
12
|
-
export declare function CountedIcon({ icon, count, label, testId, }: {
|
|
12
|
+
export declare function CountedIcon({ icon, count, label, testId, attentionLabel, }: {
|
|
13
13
|
icon: ReactNode;
|
|
14
|
-
count:
|
|
14
|
+
count: SectionNavBadge | undefined;
|
|
15
15
|
label: (count: number) => string;
|
|
16
16
|
testId: string;
|
|
17
|
+
/** The "!" badge's accessible name (`SectionNavCopy.attention`). */
|
|
18
|
+
attentionLabel?: string;
|
|
17
19
|
}): React.JSX.Element;
|
|
18
20
|
/** The keyboard ring every control in the nav draws, in the theme's own colour. */
|
|
19
21
|
export declare function focusRing(theme: Theme): SxProps<Theme>;
|
|
@@ -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,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
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,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpD,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,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.rail.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.rail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,OAAO,CAAC;AAiBpD,OAAO,KAAK,EAKV,eAAe,EAChB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionNav.rail.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.rail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,OAAO,CAAC;AAiBpD,OAAO,KAAK,EAKV,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAkP5B;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,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,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG;IAC/D,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;CACxC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqCtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.railCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.railCreate.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAmB,KAAK,WAAW,EAAkB,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionNav.railCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.railCreate.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAmB,KAAK,WAAW,EAAkB,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAoD1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,cAAc,CAAC;IACrB,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2DpB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { SectionNavCopy } from '../../../copy';
|
|
3
|
+
/** A slot's badge: how many wait, or `'!'` for something that is not a count. */
|
|
4
|
+
export type SectionNavBadge = number | '!';
|
|
3
5
|
/**
|
|
4
6
|
* One slot of the section — a bar slot on a phone, a row in the rail.
|
|
5
7
|
*
|
|
@@ -48,9 +50,10 @@ export interface SectionNavDestination {
|
|
|
48
50
|
/**
|
|
49
51
|
* How many things behind this destination wait on the viewer. `0` and
|
|
50
52
|
* `undefined` render no badge — "nothing waiting" and "not known yet" are
|
|
51
|
-
* different claims and neither is a number.
|
|
53
|
+
* different claims and neither is a number. `'!'` says something waits that
|
|
54
|
+
* is not a count (money still owed, a state to resolve).
|
|
52
55
|
*/
|
|
53
|
-
badge?:
|
|
56
|
+
badge?: SectionNavBadge;
|
|
54
57
|
/**
|
|
55
58
|
* For a link: the destination the viewer is on (`aria-current="page"`). For
|
|
56
59
|
* an action slot: a toggle that is ON (`aria-pressed`). The host decides;
|
|
@@ -72,7 +75,7 @@ export interface SectionNavEntry {
|
|
|
72
75
|
icon: ReactNode;
|
|
73
76
|
href?: string;
|
|
74
77
|
onSelect?: () => void;
|
|
75
|
-
badge?:
|
|
78
|
+
badge?: SectionNavBadge;
|
|
76
79
|
active?: boolean;
|
|
77
80
|
/** Drawn dimmed and not operable — a print already on its way, an act this state refuses. */
|
|
78
81
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB
|
|
1
|
+
{"version":3,"file":"SectionNav.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/SectionNav.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,6 +2,6 @@ export { SectionNav } from './SectionNav';
|
|
|
2
2
|
export { sectionNavBarInset } from './SectionNav.bar';
|
|
3
3
|
export { RaisedActionButton } from './SectionNav.primary';
|
|
4
4
|
export type { RaisedActionButtonProps } from './SectionNav.primary';
|
|
5
|
-
export type { SectionNavAction, SectionNavBack, SectionNavDestination, SectionNavEntry, SectionNavGroup, SectionNavMenu, SectionNavProps, } from './SectionNav.types';
|
|
5
|
+
export type { SectionNavAction, SectionNavBack, SectionNavBadge, SectionNavDestination, SectionNavEntry, SectionNavGroup, SectionNavMenu, SectionNavProps, } from './SectionNav.types';
|
|
6
6
|
export type { SectionNavCopy } from '../../../copy';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/SectionNav/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -25,6 +25,11 @@ export interface SectionNavCopy {
|
|
|
25
25
|
close: string;
|
|
26
26
|
/** A badge's accessible name — "3 pending", for a count of 3. */
|
|
27
27
|
badge: (count: number) => string;
|
|
28
|
+
/**
|
|
29
|
+
* The "!" badge's accessible name — something waits on the viewer that is
|
|
30
|
+
* not a count. Optional for a host's own copy; the shipped packs carry it.
|
|
31
|
+
*/
|
|
32
|
+
attention?: string;
|
|
28
33
|
}
|
|
29
34
|
/** The breadcrumb's overflow control, in its two spellings. */
|
|
30
35
|
export interface BreadcrumbCopy {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/copy/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/copy/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.navigation.d.ts","sourceRoot":"","sources":["../../src/en-US.navigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,QAAQ,CAAC;AAEhB,eAAO,MAAM,0BAA0B,EAAE,kBAQxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAGnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"en-US.navigation.d.ts","sourceRoot":"","sources":["../../src/en-US.navigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,QAAQ,CAAC;AAEhB,eAAO,MAAM,0BAA0B,EAAE,kBAQxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAGnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare const ICON_PATHS: {
|
|
|
6
6
|
readonly ArrowDropDown: readonly ["m7 10 5 5 5-5z"];
|
|
7
7
|
readonly ArrowForward: readonly ["m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"];
|
|
8
8
|
readonly ArrowUpward: readonly ["m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"];
|
|
9
|
+
readonly Bolt: readonly ["M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66s.05-.08.07-.12C8.48 10.94 10.42 7.54 13 3h1l-1 7h3.5c.49 0 .56.33.47.51l-.07.15C12.96 17.55 11 21 11 21"];
|
|
9
10
|
readonly BrokenImage: readonly ["M21 5v6.59l-3-3.01-4 4.01-4-4-4 4-3-3.01V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2m-3 6.42 3 3.01V19c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2v-6.58l3 2.99 4-4 4 4z"];
|
|
10
11
|
readonly Cancel: readonly ["M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"];
|
|
11
12
|
readonly Check: readonly ["M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"];
|
|
@@ -41,6 +42,7 @@ export declare const ICON_PATHS: {
|
|
|
41
42
|
readonly Remove: readonly ["M19 13H5v-2h14z"];
|
|
42
43
|
readonly Save: readonly ["M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"];
|
|
43
44
|
readonly Search: readonly ["M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"];
|
|
45
|
+
readonly Send: readonly ["M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"];
|
|
44
46
|
readonly Settings: readonly ["M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"];
|
|
45
47
|
readonly Visibility: readonly ["M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"];
|
|
46
48
|
readonly VisibilityOff: readonly ["M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.generated.d.ts","sourceRoot":"","sources":["../../../src/icons/paths.generated.ts"],"names":[],"mappings":"AAOA,mDAAmD;AACnD,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"paths.generated.d.ts","sourceRoot":"","sources":["../../../src/icons/paths.generated.ts"],"names":[],"mappings":"AAOA,mDAAmD;AACnD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C,eAAO,MAAM,UAAU,EAA8B,SAAS,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt-BR.navigation.d.ts","sourceRoot":"","sources":["../../src/pt-BR.navigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,QAAQ,CAAC;AAEhB,eAAO,MAAM,0BAA0B,EAAE,kBAMxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAGnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"pt-BR.navigation.d.ts","sourceRoot":"","sources":["../../src/pt-BR.navigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,QAAQ,CAAC;AAEhB,eAAO,MAAM,0BAA0B,EAAE,kBAMxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAGnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare const ICON_PATHS: {
|
|
|
6
6
|
readonly ArrowDropDown: readonly ["m7 10 5 5 5-5z"];
|
|
7
7
|
readonly ArrowForward: readonly ["m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"];
|
|
8
8
|
readonly ArrowUpward: readonly ["m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"];
|
|
9
|
+
readonly Bolt: readonly ["M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66s.05-.08.07-.12C8.48 10.94 10.42 7.54 13 3h1l-1 7h3.5c.49 0 .56.33.47.51l-.07.15C12.96 17.55 11 21 11 21"];
|
|
9
10
|
readonly BrokenImage: readonly ["M21 5v6.59l-3-3.01-4 4.01-4-4-4 4-3-3.01V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2m-3 6.42 3 3.01V19c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2v-6.58l3 2.99 4-4 4 4z"];
|
|
10
11
|
readonly Cancel: readonly ["M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"];
|
|
11
12
|
readonly Check: readonly ["M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"];
|
|
@@ -41,6 +42,7 @@ export declare const ICON_PATHS: {
|
|
|
41
42
|
readonly Remove: readonly ["M19 13H5v-2h14z"];
|
|
42
43
|
readonly Save: readonly ["M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"];
|
|
43
44
|
readonly Search: readonly ["M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"];
|
|
45
|
+
readonly Send: readonly ["M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"];
|
|
44
46
|
readonly Settings: readonly ["M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"];
|
|
45
47
|
readonly Visibility: readonly ["M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"];
|
|
46
48
|
readonly VisibilityOff: readonly ["M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.generated.d.ts","sourceRoot":"","sources":["../../../src/icons/paths.generated.ts"],"names":[],"mappings":"AAOA,mDAAmD;AACnD,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"paths.generated.d.ts","sourceRoot":"","sources":["../../../src/icons/paths.generated.ts"],"names":[],"mappings":"AAOA,mDAAmD;AACnD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C,eAAO,MAAM,UAAU,EAA8B,SAAS,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -199,6 +199,13 @@ interface DataViewsGridProps<T extends Record<string, unknown>> {
|
|
|
199
199
|
* rather than relying on `position: sticky` (see `useStickyTableHead`).
|
|
200
200
|
*/
|
|
201
201
|
stickyToolbar?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Show the "N de N" counter (default `true`). `false` removes it from the
|
|
204
|
+
* bar AND from the ladder's budget, so nothing is shed to make room for it —
|
|
205
|
+
* for a list whose rows are not all records (section headings handed in as
|
|
206
|
+
* rows would be counted as results).
|
|
207
|
+
*/
|
|
208
|
+
showCounter?: boolean;
|
|
202
209
|
/** Server-mode wiring; when set the grid is backend-driven (no client filter/sort/paginate). */
|
|
203
210
|
server?: DataViewServer;
|
|
204
211
|
}
|
|
@@ -120,6 +120,8 @@ export interface DataViewsTableBaseProps<T extends Record<string, unknown>> {
|
|
|
120
120
|
quickFilters?: QuickFilterConfig[];
|
|
121
121
|
/** Pin the toolbar and the table header while the page scrolls — see `DataViewsGrid`. */
|
|
122
122
|
stickyToolbar?: boolean;
|
|
123
|
+
/** Show the "N de N" counter (default `true`) — see `DataViewsGrid`. */
|
|
124
|
+
showCounter?: boolean;
|
|
123
125
|
/** Server-mode wiring (FUT-180): backend-driven rows/total + re-fetch. Omit for client mode. */
|
|
124
126
|
server?: DataViewServer;
|
|
125
127
|
/** Seed the initial view state (search/pills/ranges/sort) from the URL when no saved view applies. */
|
|
@@ -142,6 +142,16 @@ but not without a way to search.
|
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
|
145
|
+
### A host without the counter (`showCounter={false}`)
|
|
146
|
+
|
|
147
|
+
A list whose rows are not all records — section headings handed in as rows —
|
|
148
|
+
cannot use the counter: it counts every row it is given, so six items under
|
|
149
|
+
three headings read "9 de 9". `showCounter={false}` takes it off the bar AND
|
|
150
|
+
out of the ladder's budget (it is priced at 0 at every rung), so nothing is shed
|
|
151
|
+
and no gap is left for a control that is not there. Hiding it from the outside
|
|
152
|
+
with CSS does neither: the ladder still pays for it. Pinned in
|
|
153
|
+
`__tests__/data-views-show-counter.test.tsx`.
|
|
154
|
+
|
|
145
155
|
## Behaviour by class
|
|
146
156
|
|
|
147
157
|
Read this as "what the Pedidos table does", not "what the code hard-codes".
|
|
@@ -105,6 +105,8 @@ interface GridShellFiltersArgs<T extends Record<string, unknown>> {
|
|
|
105
105
|
/** Is "Exportar" on the bar? Half the right cluster's cost when it is not. */
|
|
106
106
|
hasExport: boolean;
|
|
107
107
|
quickFilters: QuickFilterConfig[];
|
|
108
|
+
/** Is the "N de N" counter on the bar? Priced at 0 when it is not. */
|
|
109
|
+
showCounter: boolean;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
function useGridShellFilters<T extends Record<string, unknown>>({
|
|
@@ -116,12 +118,15 @@ function useGridShellFilters<T extends Record<string, unknown>>({
|
|
|
116
118
|
alwaysShowSearch,
|
|
117
119
|
hasExport,
|
|
118
120
|
quickFilters,
|
|
121
|
+
showCounter,
|
|
119
122
|
}: GridShellFiltersArgs<T>): {
|
|
120
123
|
showInline: boolean;
|
|
121
124
|
useModal: boolean;
|
|
122
125
|
inlineVisible: boolean;
|
|
123
126
|
filterProps: FilterSurfaceProps<T>;
|
|
124
127
|
split: OverflowSplit<T>;
|
|
128
|
+
/** The counter is off: the host turned it off, or the ladder shed it. */
|
|
129
|
+
counterHidden: boolean;
|
|
125
130
|
onControlOpenChange: (open: boolean) => void;
|
|
126
131
|
} {
|
|
127
132
|
const { state } = c;
|
|
@@ -137,6 +142,7 @@ function useGridShellFilters<T extends Record<string, unknown>>({
|
|
|
137
142
|
c.ranges,
|
|
138
143
|
openControls > 0,
|
|
139
144
|
hasExport,
|
|
145
|
+
showCounter,
|
|
140
146
|
);
|
|
141
147
|
// THE BAR RENDERS AT EVERY WIDTH. It used to be swapped for a full-screen
|
|
142
148
|
// filter MODAL below `lg`, which was the responsive strategy before the
|
|
@@ -178,6 +184,7 @@ function useGridShellFilters<T extends Record<string, unknown>>({
|
|
|
178
184
|
inlineVisible,
|
|
179
185
|
filterProps,
|
|
180
186
|
split,
|
|
187
|
+
counterHidden: !showCounter || (showInline && split.counterHidden),
|
|
181
188
|
onControlOpenChange: (open) =>
|
|
182
189
|
setOpenControls((count) => Math.max(0, count + (open ? 1 : -1))),
|
|
183
190
|
};
|
|
@@ -253,6 +260,8 @@ interface GridShellProps<T extends Record<string, unknown>> {
|
|
|
253
260
|
quickFilters?: QuickFilterConfig[];
|
|
254
261
|
/** Pin the toolbar and the table header while the page scrolls. */
|
|
255
262
|
stickyToolbar?: boolean;
|
|
263
|
+
/** Hide the "N de N" counter — see `DataViewsGrid`. */
|
|
264
|
+
showCounter?: boolean;
|
|
256
265
|
}
|
|
257
266
|
|
|
258
267
|
/** The scrollable content region: scope tabs, toolbar, filter bar, body, pager. */
|
|
@@ -298,7 +307,7 @@ function ShellStack<T extends Record<string, unknown>>({
|
|
|
298
307
|
allOnPageSelected={allOnPageSelected(c, props.getRowId)}
|
|
299
308
|
toolbarRightSlot={props.toolbarRightSlot}
|
|
300
309
|
compactControls={showInline && split.compactControls}
|
|
301
|
-
counterHidden={
|
|
310
|
+
counterHidden={filters.counterHidden}
|
|
302
311
|
showInline={showInline}
|
|
303
312
|
sticky={props.stickyToolbar === true}
|
|
304
313
|
/>
|
|
@@ -355,6 +364,7 @@ export function GridShell<T extends Record<string, unknown>>(props: GridShellPro
|
|
|
355
364
|
alwaysShowSearch,
|
|
356
365
|
hasExport: props.exportConfig !== undefined,
|
|
357
366
|
quickFilters: props.quickFilters ?? [],
|
|
367
|
+
showCounter: props.showCounter !== false,
|
|
358
368
|
});
|
|
359
369
|
return (
|
|
360
370
|
<DataViewsLayoutProvider
|
|
@@ -153,10 +153,15 @@ export const RESERVED = {
|
|
|
153
153
|
/** {@link RESERVED} at a theme's type scale — the px the measured bar is in. */
|
|
154
154
|
export type Prices = Record<keyof typeof RESERVED, number>;
|
|
155
155
|
|
|
156
|
-
/**
|
|
157
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Price the furniture for `theme`: every {@link RESERVED} entry through `remPx`.
|
|
158
|
+
* A counter the host turned off costs nothing at any rung: pricing it anyway
|
|
159
|
+
* left a gap where it would have been, and shed controls for it.
|
|
160
|
+
*/
|
|
161
|
+
export function pricesFor(theme: Theme, showCounter = true): Prices {
|
|
158
162
|
const entries = Object.entries(RESERVED).map(([key, px]) => [key, remPx(theme, px)]);
|
|
159
|
-
|
|
163
|
+
const prices = Object.fromEntries(entries) as Prices;
|
|
164
|
+
return showCounter ? prices : { ...prices, counter: 0 };
|
|
160
165
|
}
|
|
161
166
|
|
|
162
167
|
/** What the right-hand cluster costs, given what the host actually renders. */
|
|
@@ -235,6 +235,7 @@ function computeSplit<T extends Record<string, unknown>>(
|
|
|
235
235
|
/** Does the host render "Exportar" beside "Exibir"? Half the cluster if not. */
|
|
236
236
|
hasExport: boolean,
|
|
237
237
|
theme: Theme,
|
|
238
|
+
showCounter = true, // the host shows the "N de N" counter — priced at 0 when not
|
|
238
239
|
): Omit<OverflowSplit<T>, "barRef"> {
|
|
239
240
|
// Unmeasured (SSR, or jsdom without a ResizeObserver) ⇒ degrade nothing.
|
|
240
241
|
if (width === 0) {
|
|
@@ -248,7 +249,7 @@ function computeSplit<T extends Record<string, unknown>>(
|
|
|
248
249
|
searchTakeover: false,
|
|
249
250
|
};
|
|
250
251
|
}
|
|
251
|
-
const price = pricesFor(theme);
|
|
252
|
+
const price = pricesFor(theme, showCounter);
|
|
252
253
|
// Pass 1 prices the furniture at its widest — no rung has been taken yet.
|
|
253
254
|
let budget = furnitureCost(price, UNCOLLAPSED, hasExport);
|
|
254
255
|
let split = splitFilters(all, pills, ranges, width, budget, false, theme);
|
|
@@ -360,6 +361,7 @@ export function useFilterOverflow<T extends Record<string, unknown>>(
|
|
|
360
361
|
frozen = false,
|
|
361
362
|
/** Whether "Exportar" is on the bar — see `rightClusterCost`. */
|
|
362
363
|
hasExport = true,
|
|
364
|
+
showCounter = true, // whether the "N de N" counter is on the bar — see `computeSplit`
|
|
363
365
|
): OverflowSplit<T> {
|
|
364
366
|
// The measurement is `useMeasuredWidth` (`utility/Overflow`): the same
|
|
365
367
|
// ResizeObserver every collapsing cluster in the design system reads, so
|
|
@@ -370,18 +372,18 @@ export function useFilterOverflow<T extends Record<string, unknown>>(
|
|
|
370
372
|
// The prices follow the theme's type scale, so the answer does too.
|
|
371
373
|
const theme = useTheme();
|
|
372
374
|
const signature = JSON.stringify({
|
|
373
|
-
// A chip's count and
|
|
374
|
-
// without changing its id, so both are part of the key.
|
|
375
|
+
// A chip's count and `inMore` move its price or place, not its id: both key.
|
|
375
376
|
ids: all.map((field) => [field.id, field.quick?.count ?? null, field.pinned === true]),
|
|
376
377
|
pills,
|
|
377
378
|
ranges,
|
|
378
379
|
width,
|
|
379
380
|
hasExport,
|
|
381
|
+
showCounter,
|
|
380
382
|
scale: remPx(theme, 1),
|
|
381
383
|
});
|
|
382
384
|
const cache = useRef<{ signature: string; split: ReturnType<typeof computeSplit<T>> } | null>(null);
|
|
383
385
|
if (cache.current === null || (!frozen && cache.current.signature !== signature)) {
|
|
384
|
-
cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme) };
|
|
386
|
+
cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme, showCounter) };
|
|
385
387
|
}
|
|
386
388
|
// The cache holds the ARRANGEMENT — which ids sit on the bar, which in "Mais"
|
|
387
389
|
// — never the fields themselves. The signature keys on ids, so a field whose
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Typography from '@mui/material/Typography/index.js';
|
|
2
|
-
import { useTheme, type SxProps, type Theme } from '@mui/material/styles/index.js';
|
|
2
|
+
import { alpha, useTheme, type SxProps, type Theme } from '@mui/material/styles/index.js';
|
|
3
3
|
import { useState, type ElementType, type ReactNode } from 'react';
|
|
4
4
|
|
|
5
5
|
import type { SectionNavCopy } from '../../../copy';
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from './SectionNav.parts';
|
|
20
20
|
import { RaisedActionButton } from './SectionNav.primary';
|
|
21
21
|
import { SectionNavSheet } from './SectionNav.sheet';
|
|
22
|
-
import type { SectionNavAction, SectionNavDestination, SectionNavMenu, SectionNavProps } from './SectionNav.types';
|
|
22
|
+
import type { SectionNavAction, SectionNavBadge, SectionNavDestination, SectionNavMenu, SectionNavProps } from './SectionNav.types';
|
|
23
23
|
|
|
24
24
|
/** Which of the bar's two menus is open, if any. */
|
|
25
25
|
type OpenMenu = 'primary' | 'more' | null;
|
|
@@ -65,7 +65,7 @@ function Slot({
|
|
|
65
65
|
}: {
|
|
66
66
|
label: string;
|
|
67
67
|
icon: ReactNode;
|
|
68
|
-
count:
|
|
68
|
+
count: SectionNavBadge | undefined;
|
|
69
69
|
current: boolean;
|
|
70
70
|
lit: boolean;
|
|
71
71
|
copy: SectionNavCopy;
|
|
@@ -86,9 +86,14 @@ function Slot({
|
|
|
86
86
|
sx={slotSx(theme, lit)}
|
|
87
87
|
>
|
|
88
88
|
<CountedIcon
|
|
89
|
-
icon={
|
|
89
|
+
icon={
|
|
90
|
+
<Box component="span" data-slot-pill="" sx={pillSx(theme)}>
|
|
91
|
+
<SlotIcon icon={icon} loading={loading} />
|
|
92
|
+
</Box>
|
|
93
|
+
}
|
|
90
94
|
count={count}
|
|
91
95
|
label={copy.badge}
|
|
96
|
+
attentionLabel={copy.attention}
|
|
92
97
|
testId={`${testId}-badge`}
|
|
93
98
|
/>
|
|
94
99
|
<Typography
|
|
@@ -100,7 +105,8 @@ function Slot({
|
|
|
100
105
|
textOverflow: 'ellipsis',
|
|
101
106
|
whiteSpace: 'nowrap',
|
|
102
107
|
lineHeight: 1.3,
|
|
103
|
-
fontWeight: lit ? 700 :
|
|
108
|
+
fontWeight: lit ? 700 : 600,
|
|
109
|
+
color: lit ? 'text.primary' : 'inherit',
|
|
104
110
|
}}
|
|
105
111
|
>
|
|
106
112
|
{label}
|
|
@@ -109,7 +115,20 @@ function Slot({
|
|
|
109
115
|
);
|
|
110
116
|
}
|
|
111
117
|
|
|
112
|
-
/**
|
|
118
|
+
/** The pill behind a slot's icon — tinted while the slot is lit. */
|
|
119
|
+
function pillSx(theme: Theme): SxProps<Theme> {
|
|
120
|
+
return {
|
|
121
|
+
display: 'inline-flex',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
justifyContent: 'center',
|
|
124
|
+
px: 1.75,
|
|
125
|
+
py: 0.25,
|
|
126
|
+
borderRadius: rem(theme, 999),
|
|
127
|
+
transition: theme.transitions.create('background-color', { duration: theme.transitions.duration.shorter }),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** A slot's look: icon over label, a pill behind the lit icon, dimmed when disabled. */
|
|
113
132
|
function slotSx(theme: Theme, lit: boolean): SxProps<Theme> {
|
|
114
133
|
return {
|
|
115
134
|
...CONTROL_RESET,
|
|
@@ -123,18 +142,9 @@ function slotSx(theme: Theme, lit: boolean): SxProps<Theme> {
|
|
|
123
142
|
gap: 0.25,
|
|
124
143
|
position: 'relative',
|
|
125
144
|
color: lit ? 'primary.main' : 'text.secondary',
|
|
126
|
-
// The current slot is marked by more than its colour: a
|
|
127
|
-
// its
|
|
128
|
-
'&[data-lit="true"]
|
|
129
|
-
content: '""',
|
|
130
|
-
position: 'absolute',
|
|
131
|
-
top: 0,
|
|
132
|
-
insetInline: '22%',
|
|
133
|
-
height: rem(theme, 3),
|
|
134
|
-
borderBottomLeftRadius: rem(theme, 3),
|
|
135
|
-
borderBottomRightRadius: rem(theme, 3),
|
|
136
|
-
bgcolor: 'primary.main',
|
|
137
|
-
},
|
|
145
|
+
// The current slot is marked by more than its colour: a tinted pill behind
|
|
146
|
+
// its icon and a bolder label, so the state survives a colour-blind reading.
|
|
147
|
+
'&[data-lit="true"] [data-slot-pill]': { bgcolor: alpha(theme.palette.primary.main, 0.14) },
|
|
138
148
|
'& svg': { fontSize: rem(theme, 22) },
|
|
139
149
|
[NOT_LIVE]: { color: 'text.disabled' },
|
|
140
150
|
} as SxProps<Theme>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SectionNavAction, SectionNavDestination, SectionNavMenu } from './SectionNav.types';
|
|
1
|
+
import type { SectionNavAction, SectionNavBadge, SectionNavDestination, SectionNavMenu } from './SectionNav.types';
|
|
2
2
|
|
|
3
3
|
/** A count worth drawing: positive and finite. Zero and "unknown" draw nothing. */
|
|
4
|
-
export function shownCount(count:
|
|
5
|
-
return count
|
|
4
|
+
export function shownCount(count: SectionNavBadge | undefined): number | undefined {
|
|
5
|
+
return typeof count === 'number' && Number.isFinite(count) && count > 0 ? count : undefined;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -94,6 +94,13 @@ an entry closes the sheet.
|
|
|
94
94
|
numbers. The count's accessible name is `copy.badge(n)`, and it is quiet
|
|
95
95
|
(`aria-live="off"`) because it moves on a poll.
|
|
96
96
|
|
|
97
|
+
`badge: '!'` says something waits that is not a count — money still owed, a
|
|
98
|
+
state to resolve. It is named by `copy.attention` (optional on a host's own
|
|
99
|
+
copy, falling back to `copy.badge(1)`) and never adds to a menu's roll-up.
|
|
100
|
+
|
|
101
|
+
The bar's current slot wears a tinted pill behind its icon and a bolder label;
|
|
102
|
+
every label is semibold.
|
|
103
|
+
|
|
97
104
|
## Docking the bar
|
|
98
105
|
|
|
99
106
|
Dock the bar at the foot of a flex column. `sectionNavBarInset(theme)` is its
|
|
@@ -7,7 +7,7 @@ import { rem } from '../../../tokens/scales';
|
|
|
7
7
|
import { Badge } from '../../data-display/Badge';
|
|
8
8
|
|
|
9
9
|
import { shownCount } from './SectionNav.helpers';
|
|
10
|
-
import type { SectionNavDestination } from './SectionNav.types';
|
|
10
|
+
import type { SectionNavBadge, SectionNavDestination } from './SectionNav.types';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* An icon with its count on the shoulder.
|
|
@@ -21,12 +21,22 @@ export function CountedIcon({
|
|
|
21
21
|
count,
|
|
22
22
|
label,
|
|
23
23
|
testId,
|
|
24
|
+
attentionLabel,
|
|
24
25
|
}: {
|
|
25
26
|
icon: ReactNode;
|
|
26
|
-
count:
|
|
27
|
+
count: SectionNavBadge | undefined;
|
|
27
28
|
label: (count: number) => string;
|
|
28
29
|
testId: string;
|
|
30
|
+
/** The "!" badge's accessible name (`SectionNavCopy.attention`). */
|
|
31
|
+
attentionLabel?: string;
|
|
29
32
|
}): React.JSX.Element {
|
|
33
|
+
if (count === '!') {
|
|
34
|
+
return (
|
|
35
|
+
<Badge content="!" variant="count" color="warning" aria-label={attentionLabel ?? label(1)} aria-live="off" data-testid={testId}>
|
|
36
|
+
{icon}
|
|
37
|
+
</Badge>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
30
40
|
const shown = shownCount(count);
|
|
31
41
|
if (shown === undefined) return <>{icon}</>;
|
|
32
42
|
return (
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
SectionNavMenu,
|
|
25
25
|
SectionNavProps,
|
|
26
26
|
} from './SectionNav.types';
|
|
27
|
+
import type { SectionNavBadge } from './SectionNav.types';
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* One rail row: icon, label, and the count at the far end.
|
|
@@ -51,7 +52,7 @@ function RailRow({
|
|
|
51
52
|
label: string;
|
|
52
53
|
description?: string;
|
|
53
54
|
icon: ReactNode;
|
|
54
|
-
count:
|
|
55
|
+
count: SectionNavBadge | undefined;
|
|
55
56
|
active: boolean;
|
|
56
57
|
current?: boolean;
|
|
57
58
|
copy: SectionNavCopy;
|
|
@@ -89,6 +90,7 @@ function RailRow({
|
|
|
89
90
|
icon={<SlotIcon icon={icon} loading={loading} />}
|
|
90
91
|
count={count}
|
|
91
92
|
label={copy.badge}
|
|
93
|
+
attentionLabel={copy.attention}
|
|
92
94
|
testId={`${testId}-badge`}
|
|
93
95
|
/>
|
|
94
96
|
<Box component="span" sx={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
|
|
@@ -52,7 +52,7 @@ function GridEntry({ entry, linkComponent, copy, testId, onDone }: EntryProps):
|
|
|
52
52
|
'&:disabled': { color: 'text.disabled', '& svg': { color: 'text.disabled' } },
|
|
53
53
|
}}
|
|
54
54
|
>
|
|
55
|
-
<CountedIcon icon={entry.icon} count={entry.badge} label={copy.badge} testId={`${testId}-badge-${entry.id}`} />
|
|
55
|
+
<CountedIcon icon={entry.icon} count={entry.badge} label={copy.badge} attentionLabel={copy.attention} testId={`${testId}-badge-${entry.id}`} />
|
|
56
56
|
<Typography component="span" variant="caption" sx={{ lineHeight: 1.2, fontWeight: entry.active ? 700 : 500 }}>
|
|
57
57
|
{entry.label}
|
|
58
58
|
</Typography>
|
|
@@ -93,7 +93,7 @@ function ListEntry({ entry, linkComponent, copy, testId, onDone }: EntryProps):
|
|
|
93
93
|
'&:disabled': { color: 'text.disabled', '& svg': { color: 'text.disabled' } },
|
|
94
94
|
}}
|
|
95
95
|
>
|
|
96
|
-
<CountedIcon icon={entry.icon} count={entry.badge} label={copy.badge} testId={`${testId}-badge-${entry.id}`} />
|
|
96
|
+
<CountedIcon icon={entry.icon} count={entry.badge} label={copy.badge} attentionLabel={copy.attention} testId={`${testId}-badge-${entry.id}`} />
|
|
97
97
|
<Box component="span" sx={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
|
|
98
98
|
<Typography component="span" variant="body2" sx={{ fontWeight: 600 }}>
|
|
99
99
|
{entry.label}
|
|
@@ -2,6 +2,9 @@ import type { ElementType, ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { SectionNavCopy } from '../../../copy';
|
|
4
4
|
|
|
5
|
+
/** A slot's badge: how many wait, or `'!'` for something that is not a count. */
|
|
6
|
+
export type SectionNavBadge = number | '!';
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* One slot of the section — a bar slot on a phone, a row in the rail.
|
|
7
10
|
*
|
|
@@ -50,9 +53,10 @@ export interface SectionNavDestination {
|
|
|
50
53
|
/**
|
|
51
54
|
* How many things behind this destination wait on the viewer. `0` and
|
|
52
55
|
* `undefined` render no badge — "nothing waiting" and "not known yet" are
|
|
53
|
-
* different claims and neither is a number.
|
|
56
|
+
* different claims and neither is a number. `'!'` says something waits that
|
|
57
|
+
* is not a count (money still owed, a state to resolve).
|
|
54
58
|
*/
|
|
55
|
-
badge?:
|
|
59
|
+
badge?: SectionNavBadge;
|
|
56
60
|
/**
|
|
57
61
|
* For a link: the destination the viewer is on (`aria-current="page"`). For
|
|
58
62
|
* an action slot: a toggle that is ON (`aria-pressed`). The host decides;
|
|
@@ -75,7 +79,7 @@ export interface SectionNavEntry {
|
|
|
75
79
|
icon: ReactNode;
|
|
76
80
|
href?: string;
|
|
77
81
|
onSelect?: () => void;
|
|
78
|
-
badge?:
|
|
82
|
+
badge?: SectionNavBadge;
|
|
79
83
|
active?: boolean;
|
|
80
84
|
/** Drawn dimmed and not operable — a print already on its way, an act this state refuses. */
|
|
81
85
|
disabled?: boolean;
|