@12-apps/ui 6.67.0 → 6.69.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/Chip/Chip.js +3 -3
- package/dist/_internal/components/data-display/Chip/Chip.metrics.js +5 -1
- package/dist/_internal/components/data-display/Chip/Chip.styles.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +12 -12
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +13 -13
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +11 -11
- 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/data-display/index.js +3 -3
- package/dist/_internal/components/feedback/StackedModal/StackedModal.js +3 -3
- package/dist/_internal/components/feedback/StackedModal/StackedModal.parts.js +2 -2
- package/dist/_internal/components/feedback/StackedModal/StackedModal.styles.js +1 -1
- package/dist/_internal/components/feedback/index.js +3 -3
- package/dist/_internal/components/index.js +14 -14
- package/dist/_internal/components/layout/SettingCard/SettingCard.js +6 -6
- package/dist/_internal/components/layout/SettingCard/SettingCard.parts.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingCard.summary.js +5 -5
- package/dist/_internal/components/layout/SettingCard/SettingGrid.js +5 -5
- package/dist/_internal/components/layout/SettingCard/SettingGroup.js +7 -7
- package/dist/_internal/components/layout/SettingCard/SettingSwitch.js +6 -6
- package/dist/_internal/components/layout/SettingCard/SettingToggle.js +7 -7
- package/dist/_internal/components/layout/index.js +10 -10
- package/dist/_internal/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/_internal/components/navigation/index.js +1 -1
- package/dist/{chunk-AAXLQFC7.js → chunk-3FIIMP7I.js} +2 -2
- package/dist/{chunk-6A6GZRXD.js → chunk-3VXS7O3X.js} +2 -2
- package/dist/{chunk-P3USTYIO.js → chunk-62YHJAWM.js} +2 -2
- package/dist/chunk-62YHJAWM.js.map +1 -0
- package/dist/{chunk-GCYGVWOI.js → chunk-AMT7IJYV.js} +2 -2
- package/dist/{chunk-HYQJJLBC.js → chunk-DHAXUVMR.js} +27 -3
- package/dist/chunk-DHAXUVMR.js.map +1 -0
- package/dist/{chunk-AHNEEFK6.js → chunk-E5GYHN4X.js} +3 -3
- package/dist/{chunk-KU6VHNRV.js → chunk-E5I776YW.js} +6 -2
- package/dist/{chunk-KU6VHNRV.js.map → chunk-E5I776YW.js.map} +1 -1
- 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-SAJDNO43.js → chunk-IGMD6S76.js} +3 -3
- package/dist/{chunk-EZFQO77P.js → chunk-IPYV7BLH.js} +2 -2
- package/dist/{chunk-QAZLQYSD.js → chunk-JCHJYBDG.js} +2 -2
- package/dist/{chunk-QAZLQYSD.js.map → chunk-JCHJYBDG.js.map} +1 -1
- package/dist/{chunk-TNVO3EVF.js → chunk-KT3TF2LT.js} +5 -3
- package/dist/chunk-KT3TF2LT.js.map +1 -0
- package/dist/{chunk-7JS2SPRW.js → chunk-LKRXLWCC.js} +3 -3
- package/dist/{chunk-5RC7WAHH.js → chunk-LY6L3DMB.js} +13 -9
- package/dist/chunk-LY6L3DMB.js.map +1 -0
- package/dist/{chunk-EWTSQTVR.js → chunk-NI67M453.js} +6 -5
- package/dist/chunk-NI67M453.js.map +1 -0
- package/dist/{chunk-CMLIWUBW.js → chunk-QPCHABOZ.js} +24 -1
- package/dist/chunk-QPCHABOZ.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-TQXB2OHP.js → chunk-TLPFSA55.js} +3 -3
- package/dist/{chunk-KUFDUXYB.js → chunk-U6ODZJCH.js} +2 -2
- package/dist/{chunk-3PGY4UL4.js → chunk-YKQA4NPM.js} +37 -7
- package/dist/chunk-YKQA4NPM.js.map +1 -0
- package/dist/{chunk-XMVPNCYM.js → chunk-YQGVO3ZU.js} +3 -3
- package/dist/{chunk-OJFE5PK6.js → chunk-ZZO5MRMV.js} +2 -2
- package/dist/data-display/Chip.js +3 -3
- package/dist/data-display/DataViews.js +13 -13
- package/dist/feedback/StackedModal.js +3 -3
- package/dist/layout/SettingCard.js +10 -10
- package/dist/native/data-display/Chip.js +20 -1
- package/dist/native/data-display/Chip.js.map +1 -1
- package/dist/navigation/Tabs.js +1 -1
- package/dist/types/components/data-display/Chip/Chip.base.d.ts +5 -1
- package/dist/types/components/data-display/Chip/Chip.base.d.ts.map +1 -1
- package/dist/types/components/data-display/Chip/Chip.d.ts.map +1 -1
- package/dist/types/components/data-display/Chip/Chip.metrics.d.ts +4 -0
- package/dist/types/components/data-display/Chip/Chip.metrics.d.ts.map +1 -1
- package/dist/types/components/data-display/Chip/Chip.styles.d.ts +2 -7
- package/dist/types/components/data-display/Chip/Chip.styles.d.ts.map +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/feedback/StackedModal/StackedModal.d.ts.map +1 -1
- package/dist/types/components/feedback/StackedModal/StackedModal.styles.d.ts +2 -1
- package/dist/types/components/feedback/StackedModal/StackedModal.styles.d.ts.map +1 -1
- package/dist/types/components/feedback/StackedModal/StackedModal.types.d.ts +17 -0
- package/dist/types/components/feedback/StackedModal/StackedModal.types.d.ts.map +1 -1
- package/dist/types/components/feedback/StackedModal/index.d.ts +1 -1
- package/dist/types/components/feedback/StackedModal/index.d.ts.map +1 -1
- package/dist/types/components/navigation/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/navigation/Tabs/Tabs.types.d.ts +12 -0
- package/dist/types/components/navigation/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/types/components/navigation/Tabs/index.d.ts +1 -1
- package/dist/types/components/navigation/Tabs/index.d.ts.map +1 -1
- package/dist/types-native/components/data-display/Chip/Chip.base.d.ts +5 -1
- package/dist/types-native/components/data-display/Chip/Chip.base.d.ts.map +1 -1
- package/dist/types-native/components/data-display/Chip/Chip.look.native.d.ts.map +1 -1
- package/dist/types-native/components/data-display/Chip/Chip.metrics.d.ts +4 -0
- package/dist/types-native/components/data-display/Chip/Chip.metrics.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/Chip/Chip.base.ts +5 -1
- package/src/components/data-display/Chip/Chip.look.native.ts +22 -1
- package/src/components/data-display/Chip/Chip.metrics.ts +5 -0
- package/src/components/data-display/Chip/Chip.styles.tsx +38 -1
- package/src/components/data-display/Chip/Chip.tsx +6 -2
- package/src/components/data-display/Chip/chip.md +2 -2
- 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/feedback/StackedModal/StackedModal.md +1 -0
- package/src/components/feedback/StackedModal/StackedModal.styles.ts +53 -6
- package/src/components/feedback/StackedModal/StackedModal.tsx +2 -1
- package/src/components/feedback/StackedModal/StackedModal.types.ts +17 -0
- package/src/components/feedback/StackedModal/index.ts +1 -1
- package/src/components/navigation/Tabs/Tabs.md +1 -0
- package/src/components/navigation/Tabs/Tabs.tsx +30 -1
- package/src/components/navigation/Tabs/Tabs.types.ts +14 -0
- package/src/components/navigation/Tabs/index.ts +1 -1
- package/dist/chunk-3PGY4UL4.js.map +0 -1
- package/dist/chunk-5RC7WAHH.js.map +0 -1
- package/dist/chunk-CMLIWUBW.js.map +0 -1
- package/dist/chunk-CSLBRJ7N.js.map +0 -1
- package/dist/chunk-EWTSQTVR.js.map +0 -1
- package/dist/chunk-HYQJJLBC.js.map +0 -1
- package/dist/chunk-P3USTYIO.js.map +0 -1
- package/dist/chunk-TNVO3EVF.js.map +0 -1
- /package/dist/{chunk-AAXLQFC7.js.map → chunk-3FIIMP7I.js.map} +0 -0
- /package/dist/{chunk-6A6GZRXD.js.map → chunk-3VXS7O3X.js.map} +0 -0
- /package/dist/{chunk-GCYGVWOI.js.map → chunk-AMT7IJYV.js.map} +0 -0
- /package/dist/{chunk-AHNEEFK6.js.map → chunk-E5GYHN4X.js.map} +0 -0
- /package/dist/{chunk-T7ZERP7A.js.map → chunk-EYW6KXUC.js.map} +0 -0
- /package/dist/{chunk-SAJDNO43.js.map → chunk-IGMD6S76.js.map} +0 -0
- /package/dist/{chunk-EZFQO77P.js.map → chunk-IPYV7BLH.js.map} +0 -0
- /package/dist/{chunk-7JS2SPRW.js.map → chunk-LKRXLWCC.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-KUFDUXYB.js.map → chunk-U6ODZJCH.js.map} +0 -0
- /package/dist/{chunk-XMVPNCYM.js.map → chunk-YQGVO3ZU.js.map} +0 -0
- /package/dist/{chunk-OJFE5PK6.js.map → chunk-ZZO5MRMV.js.map} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ModalStackProvider, StackedModal, StackedModalActions as StackedModalActions, StackedModalContent as StackedModalContent, ModalStackProvider as StackedModalProvider, useModalStack, useModalStack as useStackedModal, } from './StackedModal';
|
|
2
|
-
export type { PanelSize, StackedModalProps } from './StackedModal.types';
|
|
2
|
+
export type { PanelSize, PanelWidth, StackedModalProps } from './StackedModal.types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/feedback/StackedModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,IAAI,mBAAmB,EAC1C,mBAAmB,IAAI,mBAAmB,EAC1C,kBAAkB,IAAI,oBAAoB,EAC1C,aAAa,EACb,aAAa,IAAI,eAAe,GACjC,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/feedback/StackedModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,IAAI,mBAAmB,EAC1C,mBAAmB,IAAI,mBAAmB,EAC1C,kBAAkB,IAAI,oBAAoB,EAC1C,aAAa,EACb,aAAa,IAAI,eAAe,GACjC,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/Tabs.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/Tabs.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAqB,SAAS,EAAE,MAAM,cAAc,CAAC;AA0RjE,eAAO,MAAM,IAAI,+FA+ChB,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ColorValue, SizeValue } from '../../../tokens/scales';
|
|
2
2
|
import type { TabsProps as MuiTabsProps } from '@mui/material/Tabs/index.js';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
|
+
/** A tab's inline count — see `TabItem.count`. */
|
|
5
|
+
export interface TabCount {
|
|
6
|
+
value: string | number;
|
|
7
|
+
/** `warning` asks for attention, `danger` for action; neutral otherwise. */
|
|
8
|
+
tone?: 'neutral' | 'warning' | 'danger';
|
|
9
|
+
}
|
|
4
10
|
export interface TabItem {
|
|
5
11
|
/**
|
|
6
12
|
* Unique identifier for the tab
|
|
@@ -26,6 +32,12 @@ export interface TabItem {
|
|
|
26
32
|
* Badge content to show on the tab
|
|
27
33
|
*/
|
|
28
34
|
badge?: string | number;
|
|
35
|
+
/**
|
|
36
|
+
* A count said INSIDE the tab, after its label, as a small pill: how many
|
|
37
|
+
* lines, events or charges the pane holds. `tone` marks one that asks for
|
|
38
|
+
* action. Unlike `badge` it never floats over the label.
|
|
39
|
+
*/
|
|
40
|
+
count?: TabCount;
|
|
29
41
|
/**
|
|
30
42
|
* Custom className for the tab
|
|
31
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/Tabs.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,GAAG,gBAAgB,GAAG,eAAe,CAAC;IAChH,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;IAEzD;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OA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,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -7,7 +7,11 @@ import type { ColorValue, SizeValue } from '../../../tokens/vocabulary';
|
|
|
7
7
|
* declaration outputs (`dist/types` and `dist/types-native`), and a native
|
|
8
8
|
* consumer has no `@mui/material` to resolve a type import against.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* `soft` is a status chip's look: the colour's tint for a ground and its dark
|
|
12
|
+
* step for ink, so a row of states reads without a row of solid blocks.
|
|
13
|
+
*/
|
|
14
|
+
export type ChipVariant = 'filled' | 'outlined' | 'soft';
|
|
11
15
|
/**
|
|
12
16
|
* The house size scale, abbreviated like every other component's.
|
|
13
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.base.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Chip/Chip.base.ts"],"names":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AChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.look.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Chip/Chip.look.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"Chip.look.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Chip/Chip.look.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAWL,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAKrD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,uEAAuE;IACvE,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAgED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,OAAO,GAChB,SAAS,CAQX;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,CAWzF;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,WAAW,GACnB,SAAS,CASX;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,GAAG,QAAQ,GACtB,SAAS,CAYX;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,CAQ7F;AAED,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,UAAU,CAOpE;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,WAAW,KAAG,eAAmC,CAAC"}
|
|
@@ -58,4 +58,8 @@ export declare const HOVER_SHADOW: {
|
|
|
58
58
|
};
|
|
59
59
|
export declare const CHIP_TRANSITION_MS = 200;
|
|
60
60
|
export declare const CHIP_TRANSITION_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
61
|
+
/** A soft chip's ground: the colour at this alpha over the page. */
|
|
62
|
+
export declare const SOFT_GROUND_ALPHA = 0.14;
|
|
63
|
+
/** A soft chip's hover ground. */
|
|
64
|
+
export declare const SOFT_HOVER_ALPHA = 0.22;
|
|
61
65
|
//# sourceMappingURL=Chip.metrics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Chip/Chip.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;GASG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,WA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eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAIzC,yEAAyE;AACzE,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,YAAY;;;;;CAAsE,CAAC;AAChG,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AAErE,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,kCAAkC;AAClC,eAAO,MAAM,gBAAgB,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,11 @@ import type { ColorValue, SizeValue } from '../../../tokens/vocabulary';
|
|
|
9
9
|
* declaration outputs (`dist/types` and `dist/types-native`), and a native
|
|
10
10
|
* consumer has no `@mui/material` to resolve a type import against.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `soft` is a status chip's look: the colour's tint for a ground and its dark
|
|
14
|
+
* step for ink, so a row of states reads without a row of solid blocks.
|
|
15
|
+
*/
|
|
16
|
+
export type ChipVariant = 'filled' | 'outlined' | 'soft';
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* The house size scale, abbreviated like every other component's.
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
DELETE_ICON_ON_COLOR_ALPHA,
|
|
11
11
|
OUTLINED_BORDER_ALPHA,
|
|
12
12
|
OUTLINED_HOVER_ALPHA,
|
|
13
|
+
SOFT_GROUND_ALPHA,
|
|
14
|
+
SOFT_HOVER_ALPHA,
|
|
13
15
|
type ChipMuiSize,
|
|
14
16
|
type ChipSizeMetrics,
|
|
15
17
|
} from './Chip.metrics';
|
|
@@ -52,6 +54,24 @@ function filledPaint(theme: UiTheme, color: ChipColor): ChipPaint {
|
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
function softPaint(theme: UiTheme, color: ChipColor): ChipPaint {
|
|
58
|
+
if (!isAccented(color)) {
|
|
59
|
+
return {
|
|
60
|
+
container: { backgroundColor: theme.palette.action.selected },
|
|
61
|
+
pressed: { backgroundColor: theme.palette.action.hover },
|
|
62
|
+
label: { color: theme.palette.text.secondary, fontWeight: '600' },
|
|
63
|
+
deleteColor: alpha(theme.palette.text.secondary, DELETE_ICON_ALPHA),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const accent = theme.palette[color];
|
|
67
|
+
return {
|
|
68
|
+
container: { backgroundColor: alpha(accent.main, SOFT_GROUND_ALPHA) },
|
|
69
|
+
pressed: { backgroundColor: alpha(accent.main, SOFT_HOVER_ALPHA) },
|
|
70
|
+
label: { color: accent.dark, fontWeight: '600' },
|
|
71
|
+
deleteColor: alpha(accent.dark, DELETE_ICON_ALPHA),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
function outlinedPaint(theme: UiTheme, color: ChipColor): ChipPaint {
|
|
56
76
|
const border: ViewStyle = { backgroundColor: 'transparent', borderWidth: 1, borderStyle: 'solid' };
|
|
57
77
|
if (!isAccented(color)) {
|
|
@@ -82,7 +102,8 @@ export function chipPaint(
|
|
|
82
102
|
color: ChipColor,
|
|
83
103
|
selected: boolean,
|
|
84
104
|
): ChipPaint {
|
|
85
|
-
const paint =
|
|
105
|
+
const paint =
|
|
106
|
+
variant === 'outlined' ? outlinedPaint(theme, color) : variant === 'soft' ? softPaint(theme, color) : filledPaint(theme, color);
|
|
86
107
|
if (variant !== 'outlined' || !selected) return paint;
|
|
87
108
|
return {
|
|
88
109
|
...paint,
|
|
@@ -100,3 +100,8 @@ export const HOVER_LIFT_PX = 1;
|
|
|
100
100
|
export const HOVER_SHADOW = { offsetY: 4, blur: 12, alphaLight: 0.15, alphaDark: 0.3 } as const;
|
|
101
101
|
export const CHIP_TRANSITION_MS = 200;
|
|
102
102
|
export const CHIP_TRANSITION_EASING = 'cubic-bezier(0.4, 0, 0.2, 1)';
|
|
103
|
+
|
|
104
|
+
/** A soft chip's ground: the colour at this alpha over the page. */
|
|
105
|
+
export const SOFT_GROUND_ALPHA = 0.14;
|
|
106
|
+
/** A soft chip's hover ground. */
|
|
107
|
+
export const SOFT_HOVER_ALPHA = 0.22;
|
|
@@ -4,7 +4,17 @@ import type { KeyboardEvent, ReactElement } from 'react';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
6
|
import { chipKeyAction, type ChipKeyArgs } from './Chip.helpers';
|
|
7
|
-
import {
|
|
7
|
+
import { alpha } from '@mui/material/styles/index.js';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
CHIP_SIZES,
|
|
11
|
+
CHIP_TRANSITION_EASING,
|
|
12
|
+
CHIP_TRANSITION_MS,
|
|
13
|
+
HOVER_LIFT_PX,
|
|
14
|
+
HOVER_SHADOW,
|
|
15
|
+
SOFT_GROUND_ALPHA,
|
|
16
|
+
SOFT_HOVER_ALPHA,
|
|
17
|
+
} from './Chip.metrics';
|
|
8
18
|
import type { ChipProps } from './Chip.types';
|
|
9
19
|
import { shadowInk } from '../../../tokens/ink';
|
|
10
20
|
import { rem, rems, sxRem } from '../../../tokens/relative';
|
|
@@ -43,6 +53,7 @@ export const avatarFor = (
|
|
|
43
53
|
|
|
44
54
|
interface ChipStyleArgs {
|
|
45
55
|
variant: ChipProps['variant'];
|
|
56
|
+
color?: ChipProps['color'];
|
|
46
57
|
selected?: boolean;
|
|
47
58
|
clickable?: boolean;
|
|
48
59
|
disabled?: boolean;
|
|
@@ -61,8 +72,33 @@ const hoverShadow = (theme: Theme): string =>
|
|
|
61
72
|
* state); an outlined selected chip gets a subtle theme-driven `action.selected`
|
|
62
73
|
* tint so it reads as active without muddying the fill.
|
|
63
74
|
*/
|
|
75
|
+
/** The palette entry a colour paints with; `neutral` has none and takes the ink. */
|
|
76
|
+
const paletteKey = (color: NonNullable<ChipProps['color']>): 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | null => {
|
|
77
|
+
if (color === 'neutral') return null;
|
|
78
|
+
return color === 'danger' ? 'error' : color;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** `soft`: the colour's tint for a ground, its dark step for ink (and the icon). */
|
|
82
|
+
const softStyles = (color: NonNullable<ChipProps['color']>): SxProps<Theme> => {
|
|
83
|
+
const key = paletteKey(color);
|
|
84
|
+
const ground = (theme: Theme): string =>
|
|
85
|
+
key ? alpha(theme.palette[key].main, SOFT_GROUND_ALPHA) : theme.palette.action.selected;
|
|
86
|
+
const ink = (theme: Theme): string => (key ? theme.palette[key].dark : theme.palette.text.secondary);
|
|
87
|
+
return {
|
|
88
|
+
backgroundColor: ground,
|
|
89
|
+
color: ink,
|
|
90
|
+
// A state is read at a glance: the label is set semibold.
|
|
91
|
+
fontWeight: 600,
|
|
92
|
+
'& .MuiChip-icon': { color: ink },
|
|
93
|
+
'&.MuiChip-clickable:hover': {
|
|
94
|
+
backgroundColor: (theme: Theme) => (key ? alpha(theme.palette[key].main, SOFT_HOVER_ALPHA) : theme.palette.action.hover),
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
64
99
|
export const chipStyles = ({
|
|
65
100
|
variant,
|
|
101
|
+
color = 'primary',
|
|
66
102
|
selected,
|
|
67
103
|
clickable,
|
|
68
104
|
disabled,
|
|
@@ -70,6 +106,7 @@ export const chipStyles = ({
|
|
|
70
106
|
const lifts = clickable && !disabled;
|
|
71
107
|
|
|
72
108
|
return {
|
|
109
|
+
...(variant === 'soft' ? (softStyles(color) as object) : {}),
|
|
73
110
|
// Enhanced styling for outlined variant
|
|
74
111
|
...(variant === 'outlined' && {
|
|
75
112
|
borderWidth: '1px',
|
|
@@ -37,6 +37,10 @@ const muiColorFor = (color: NonNullable<ChipProps['color']>): MuiChipColor => {
|
|
|
37
37
|
return color === 'neutral' ? 'default' : color;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
/** `soft` is ours: MUI has two variants, so it paints as `filled` and `chipStyles` tints it. */
|
|
41
|
+
const muiVariantFor = (variant: NonNullable<ChipProps['variant']>): 'filled' | 'outlined' =>
|
|
42
|
+
variant === 'soft' ? 'filled' : variant;
|
|
43
|
+
|
|
40
44
|
export const Chip = forwardRef<HTMLDivElement, ChipProps>(({
|
|
41
45
|
label,
|
|
42
46
|
variant = 'filled',
|
|
@@ -66,7 +70,7 @@ export const Chip = forwardRef<HTMLDivElement, ChipProps>(({
|
|
|
66
70
|
<MuiChip
|
|
67
71
|
ref={ref}
|
|
68
72
|
label={<span data-testid={testId('label')}>{label}</span>}
|
|
69
|
-
variant={variant}
|
|
73
|
+
variant={muiVariantFor(variant)}
|
|
70
74
|
size={chipMuiSize(size)}
|
|
71
75
|
color={muiColorFor(color)}
|
|
72
76
|
avatar={avatarFor(avatar, avatarSrc)}
|
|
@@ -81,7 +85,7 @@ export const Chip = forwardRef<HTMLDivElement, ChipProps>(({
|
|
|
81
85
|
role={chipRole(selectable, onClick)}
|
|
82
86
|
aria-selected={selectable ? selected : undefined}
|
|
83
87
|
data-testid={chipId || 'chip'}
|
|
84
|
-
sx={chipStyles({ variant, selected, clickable, disabled })}
|
|
88
|
+
sx={chipStyles({ variant, color, selected, clickable, disabled })}
|
|
85
89
|
{...props}
|
|
86
90
|
/>
|
|
87
91
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
interface ChipProps {
|
|
7
7
|
label: string;
|
|
8
|
-
variant?: 'filled' | 'outlined';
|
|
8
|
+
variant?: 'filled' | 'outlined' | 'soft';
|
|
9
9
|
size?: SizeValue; // all five stops; MUI's two heights, xs/sm small and md up medium
|
|
10
10
|
/**
|
|
11
11
|
* The house vocabulary, identical to Button's. `danger` and `neutral` are
|
|
@@ -28,7 +28,7 @@ interface ChipProps {
|
|
|
28
28
|
|
|
29
29
|
**Features**
|
|
30
30
|
|
|
31
|
-
- Filled/Outlined variants; optional avatar or icon.
|
|
31
|
+
- Filled/Outlined/Soft variants; optional avatar or icon. `soft` is a status chip: the colour's tint for a ground and its dark step for ink.
|
|
32
32
|
- Selectable (toggle) and/or deletable (× button).
|
|
33
33
|
- Keyboard: Space/Enter activates; Delete/Backspace triggers remove when focused.
|
|
34
34
|
|
|
@@ -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
|
|
@@ -138,6 +138,7 @@ new component that portals should too.
|
|
|
138
138
|
| `fullScreen` | `boolean` | `false` | Full screen mode |
|
|
139
139
|
| `maxWidth` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| false` | `'md'` | Maximum modal width |
|
|
140
140
|
| `size` | `'default' \| 'wide'` | `'default'` | Viewport share of the top panel: default is 80vw (`sm`–`lg`), 60vw (`lg`+), 40vw (≥2200px); `wide` is 90vw up to `xl`, 75vw above, 60vw ≥2200px — for a dense two-column editor |
|
|
141
|
+
| `panelWidth` | `{ share: string; maxPx: number; fullBelowPx?: number }` | - | An exact width for the top panel: `min(share, maxPx)` of the viewport, the whole screen under `fullBelowPx`. Replaces `size` and `maxWidth`. Viewport only — nothing inside the panel feeds back into it |
|
|
141
142
|
| `disableBackdrop` | `boolean` | `false` | Hide backdrop |
|
|
142
143
|
| `disableFocusTrap` | `boolean` | `false` | Disable focus trapping |
|
|
143
144
|
| `keepMounted` | `boolean` | `false` | Keep modal mounted when closed |
|
|
@@ -3,7 +3,7 @@ import type { CSSObject, Theme } from '@mui/material/styles/index.js';
|
|
|
3
3
|
import { scrim } from '../../../tokens/ink';
|
|
4
4
|
import { rem } from '../../../tokens/relative';
|
|
5
5
|
import { dynamicViewportHeight } from '../../../utils/viewport';
|
|
6
|
-
import type { ModalPanelRole, PanelMaxWidth, PanelSize } from './StackedModal.types';
|
|
6
|
+
import type { ModalPanelRole, PanelMaxWidth, PanelSize, PanelWidth } from './StackedModal.types';
|
|
7
7
|
|
|
8
8
|
/** Props that drive the panel's look but must not reach the DOM. */
|
|
9
9
|
export interface PanelStyleProps {
|
|
@@ -13,10 +13,11 @@ export interface PanelStyleProps {
|
|
|
13
13
|
rtl?: boolean;
|
|
14
14
|
customMaxWidth?: PanelMaxWidth;
|
|
15
15
|
panelSize?: PanelSize;
|
|
16
|
+
panelWidth?: PanelWidth;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
/** Style-only props, filtered out before they can land on a DOM node. */
|
|
19
|
-
export const STYLE_ONLY_PROPS = ['modalRole', 'isAnimating', 'glass', 'rtl', 'customMaxWidth', 'panelSize'];
|
|
20
|
+
export const STYLE_ONLY_PROPS = ['modalRole', 'isAnimating', 'glass', 'rtl', 'customMaxWidth', 'panelSize', 'panelWidth'];
|
|
20
21
|
|
|
21
22
|
/** MUI breakpoint names mapped to the pixel width they cap the panel at. */
|
|
22
23
|
const MAX_WIDTH_PX: Record<Exclude<PanelMaxWidth, false>, number> = {
|
|
@@ -38,6 +39,15 @@ const ANIMATION_BY_ROLE: Partial<Record<ModalPanelRole, string>> = {
|
|
|
38
39
|
primary: 'contractModal 300ms ease-in-out forwards',
|
|
39
40
|
};
|
|
40
41
|
|
|
42
|
+
/** The custom property an exact-width panel's width and keyframes share. */
|
|
43
|
+
const EXACT_WIDTH_VAR = '--stacked-modal-width';
|
|
44
|
+
|
|
45
|
+
/** An exact-width panel settles at its own width, so its keyframes read it too. */
|
|
46
|
+
const EXACT_ANIMATION_BY_ROLE: Partial<Record<ModalPanelRole, string>> = {
|
|
47
|
+
secondary: 'expandModalExact 300ms ease-in-out forwards',
|
|
48
|
+
primary: 'contractModalExact 300ms ease-in-out forwards',
|
|
49
|
+
};
|
|
50
|
+
|
|
41
51
|
/** A wide panel settles at 90vw, so its keyframes must end there too, or it snaps. */
|
|
42
52
|
const WIDE_ANIMATION_BY_ROLE: Partial<Record<ModalPanelRole, string>> = {
|
|
43
53
|
secondary: 'expandModalWide 300ms ease-in-out forwards',
|
|
@@ -63,6 +73,15 @@ const KEYFRAMES: CSSObject = {
|
|
|
63
73
|
from: { width: '100vw', transform: 'translateX(0)' },
|
|
64
74
|
to: { width: '90vw', transform: 'translateX(0)' },
|
|
65
75
|
},
|
|
76
|
+
// An exact-width panel settles at its own width, carried by the custom property.
|
|
77
|
+
'@keyframes expandModalExact': {
|
|
78
|
+
from: { width: `var(${EXACT_WIDTH_VAR})`, transform: 'translateX(0)' },
|
|
79
|
+
to: { width: '100vw', transform: 'translateX(0)' },
|
|
80
|
+
},
|
|
81
|
+
'@keyframes contractModalExact': {
|
|
82
|
+
from: { width: '100vw', transform: 'translateX(0)' },
|
|
83
|
+
to: { width: `var(${EXACT_WIDTH_VAR})`, transform: 'translateX(0)' },
|
|
84
|
+
},
|
|
66
85
|
};
|
|
67
86
|
|
|
68
87
|
const cap = (customMaxWidth?: PanelMaxWidth): number | null =>
|
|
@@ -106,6 +125,22 @@ const widePrimaryPanelStyles = (theme: Theme, capPx: number | null): CSSObject =
|
|
|
106
125
|
[theme.breakpoints.up(2200)]: panelWidth(theme, '60vw', capPx),
|
|
107
126
|
});
|
|
108
127
|
|
|
128
|
+
/**
|
|
129
|
+
* `panelWidth`: `min(share, maxPx)` from `sm` up, the whole screen under `sm`
|
|
130
|
+
* and under `fullBelowPx`. Viewport media queries only — never the panel's size.
|
|
131
|
+
*/
|
|
132
|
+
const exactPrimaryPanelStyles = (theme: Theme, exact: PanelWidth): CSSObject => {
|
|
133
|
+
const width = `min(${exact.share}, ${rem(theme, exact.maxPx)})`;
|
|
134
|
+
const full = { [EXACT_WIDTH_VAR]: '100%', width: '100%', maxWidth: '100%' };
|
|
135
|
+
return {
|
|
136
|
+
[EXACT_WIDTH_VAR]: width,
|
|
137
|
+
width: `var(${EXACT_WIDTH_VAR})`,
|
|
138
|
+
maxWidth: `var(${EXACT_WIDTH_VAR})`,
|
|
139
|
+
[theme.breakpoints.down('sm')]: full,
|
|
140
|
+
...(exact.fullBelowPx ? { [theme.breakpoints.down(exact.fullBelowPx)]: full } : {}),
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
|
|
109
144
|
/** Panels below the top one expand to full width, producing the GTM stacking effect. */
|
|
110
145
|
const secondaryPanelStyles = (): CSSObject => ({
|
|
111
146
|
width: '100vw !important',
|
|
@@ -123,8 +158,10 @@ const rolePanelStyles = (
|
|
|
123
158
|
role: ModalPanelRole | undefined,
|
|
124
159
|
capPx: number | null,
|
|
125
160
|
size?: PanelSize,
|
|
161
|
+
exact?: PanelWidth,
|
|
126
162
|
): CSSObject => {
|
|
127
163
|
if (role === 'primary') {
|
|
164
|
+
if (exact) return exactPrimaryPanelStyles(theme, exact);
|
|
128
165
|
return size === 'wide' ? widePrimaryPanelStyles(theme, capPx) : primaryPanelStyles(theme, capPx);
|
|
129
166
|
}
|
|
130
167
|
if (role === 'secondary') return secondaryPanelStyles();
|
|
@@ -143,8 +180,18 @@ const glassStyles = (theme: Theme, glass?: boolean, role?: ModalPanelRole): CSSO
|
|
|
143
180
|
}
|
|
144
181
|
: {};
|
|
145
182
|
|
|
146
|
-
const
|
|
147
|
-
|
|
183
|
+
const animationByRole = (size?: PanelSize, exact?: PanelWidth): Partial<Record<ModalPanelRole, string>> => {
|
|
184
|
+
if (exact) return EXACT_ANIMATION_BY_ROLE;
|
|
185
|
+
return size === 'wide' ? WIDE_ANIMATION_BY_ROLE : ANIMATION_BY_ROLE;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const animationStyles = (
|
|
189
|
+
isAnimating?: boolean,
|
|
190
|
+
role?: ModalPanelRole,
|
|
191
|
+
size?: PanelSize,
|
|
192
|
+
exact?: PanelWidth,
|
|
193
|
+
): CSSObject => {
|
|
194
|
+
const byRole = animationByRole(size, exact);
|
|
148
195
|
return isAnimating ? { animation: (role && byRole[role]) ?? 'none' } : {};
|
|
149
196
|
};
|
|
150
197
|
|
|
@@ -169,9 +216,9 @@ const panelStyles = (theme: Theme, props: PanelStyleProps): CSSObject => {
|
|
|
169
216
|
const capPx = cap(props.customMaxWidth);
|
|
170
217
|
return {
|
|
171
218
|
...panelBaseStyles(theme),
|
|
172
|
-
...rolePanelStyles(theme, props.modalRole, capPx, props.panelSize),
|
|
219
|
+
...rolePanelStyles(theme, props.modalRole, capPx, props.panelSize, props.panelWidth),
|
|
173
220
|
...glassStyles(theme, props.glass, props.modalRole),
|
|
174
|
-
...animationStyles(props.isAnimating, props.modalRole, props.panelSize),
|
|
221
|
+
...animationStyles(props.isAnimating, props.modalRole, props.panelSize, props.panelWidth),
|
|
175
222
|
};
|
|
176
223
|
};
|
|
177
224
|
|
|
@@ -79,7 +79,7 @@ const useUnnamedDialogWarning = (unnamed: boolean): void => {
|
|
|
79
79
|
const StackedModalPanel: FC<ResolvedProps> = (props) => {
|
|
80
80
|
const {
|
|
81
81
|
open, onClose, glass, navigationTitle, backLabel, hideClose, hideHeader, children, actions, modalId,
|
|
82
|
-
closeOnClickOutside, closeOnEsc, loading, loadingText, fullScreen, maxWidth, size, disableBackdrop,
|
|
82
|
+
closeOnClickOutside, closeOnEsc, loading, loadingText, fullScreen, maxWidth, size, panelWidth, disableBackdrop,
|
|
83
83
|
disableFocusTrap, keepMounted, rtl, dataTestId,
|
|
84
84
|
'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...otherProps
|
|
85
85
|
} = props;
|
|
@@ -114,6 +114,7 @@ const StackedModalPanel: FC<ResolvedProps> = (props) => {
|
|
|
114
114
|
rtl={rtl}
|
|
115
115
|
customMaxWidth={maxWidth}
|
|
116
116
|
panelSize={size}
|
|
117
|
+
panelWidth={panelWidth}
|
|
117
118
|
TransitionComponent={SlideTransition}
|
|
118
119
|
maxWidth={maxWidth}
|
|
119
120
|
disableEscapeKeyDown={!closeOnEsc}
|