@12-apps/ui 6.24.7 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components-catalog.md +1 -1
- package/dist/_internal/components/data-display/CardKit/CardKebab.js +4 -4
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +4 -4
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +4 -4
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +34 -34
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +40 -40
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +4 -4
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +5 -5
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +15 -15
- package/dist/_internal/components/data-display/DataViews/data-views-columns.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-empty.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-export.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +16 -16
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-grid-helpers.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +31 -31
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +20 -20
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-select-all-strip.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-view-nav.js +4 -4
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +6 -6
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +4 -4
- package/dist/_internal/components/feedback/index.js +4 -4
- package/dist/_internal/components/form/Button/Button.js +3 -3
- package/dist/_internal/components/form/Button/Button.metrics.js +3 -1
- package/dist/_internal/components/form/Button/Button.styles.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategoryPanel.js +8 -8
- package/dist/_internal/components/form/CategorySelect/CategoryPanelFoot.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategoryPanelHead.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategoryPanelList.js +4 -4
- package/dist/_internal/components/form/CategorySelect/CategoryQuickActions.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategoryRows.js +7 -9
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +14 -14
- package/dist/_internal/components/form/CategorySelect/CategorySelect.styles.js +3 -1
- package/dist/_internal/components/form/CategorySelect/CategoryTrigger.js +2 -2
- package/dist/_internal/components/form/CategorySelect/category-keyboard.js +2 -2
- package/dist/_internal/components/form/CategorySelect/category-tree.js +11 -3
- package/dist/_internal/components/form/CategorySelect/useCategoryCommit.js +2 -2
- package/dist/_internal/components/form/CategorySelect/useCategoryKeyHandler.js +3 -3
- package/dist/_internal/components/form/CategorySelect/useCategorySelect.js +2 -2
- package/dist/_internal/components/form/index.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +15 -15
- package/dist/_internal/components/form/total-form/Fields/index.js +16 -16
- package/dist/_internal/components/form/total-form/SubmitButton.js +4 -4
- package/dist/_internal/components/index.js +5 -5
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +4 -4
- package/dist/_internal/components/navigation/index.js +4 -4
- package/dist/_internal/social-login-button/social-login-button.js +4 -4
- package/dist/_internal/user-avatar/user-avatar.js +4 -4
- package/dist/{chunk-6JGPPTLX.js → chunk-2GI7ANEL.js} +3 -3
- package/dist/{chunk-U2ZDN2AL.js → chunk-2PBGVMM2.js} +2 -2
- package/dist/{chunk-ITGG5OKP.js → chunk-5LQ7PKMW.js} +3 -1
- package/dist/chunk-5LQ7PKMW.js.map +1 -0
- package/dist/{chunk-4T7TXRGM.js → chunk-6ZY5XU4J.js} +3 -3
- package/dist/{chunk-CHPZTF34.js → chunk-7KWBGMQC.js} +2 -2
- package/dist/{chunk-6NSIZ2ZO.js → chunk-7MN6I5NK.js} +3 -3
- package/dist/{chunk-PN5CQKA2.js → chunk-AXTLFK4T.js} +2 -2
- package/dist/{chunk-JT6TERQL.js → chunk-BB2OUERT.js} +2 -2
- package/dist/{chunk-XUJG2HFW.js → chunk-BH5BXLGI.js} +2 -2
- package/dist/{chunk-4TXIZ5WI.js → chunk-CJUOBTLL.js} +2 -2
- package/dist/{chunk-NWNSUHEB.js → chunk-CT5K725B.js} +2 -2
- package/dist/{chunk-6OORHAE7.js → chunk-EQ7PWGBN.js} +3 -3
- package/dist/{chunk-EJQW2IYW.js → chunk-FPFUXRD2.js} +2 -2
- package/dist/{chunk-ZRPGVHTR.js → chunk-GGI7GM5O.js} +2 -2
- package/dist/{chunk-KIHQE5YA.js → chunk-GVDJQMFI.js} +2 -2
- package/dist/{chunk-TX5V42AY.js → chunk-HEBQS7QP.js} +3 -3
- package/dist/{chunk-BUQ2JUND.js → chunk-JO6BBSGY.js} +2 -2
- package/dist/{chunk-4ZV7N5CU.js → chunk-JXPHU3K5.js} +4 -4
- package/dist/{chunk-TW3BXVEU.js → chunk-KMXAPYU2.js} +2 -2
- package/dist/{chunk-CJBBGMIA.js → chunk-MNXVXW4T.js} +2 -2
- package/dist/{chunk-OFOYMZRY.js → chunk-NPN7JTRM.js} +22 -47
- package/dist/chunk-NPN7JTRM.js.map +1 -0
- package/dist/{chunk-BPLFM2GL.js → chunk-NYEA7JAI.js} +3 -3
- package/dist/{chunk-O6AZDQJJ.js → chunk-OE2ZVL67.js} +2 -2
- package/dist/{chunk-4523RYE7.js → chunk-OG2FP6SE.js} +2 -2
- package/dist/{chunk-XKV5ZIBG.js → chunk-OGGPQVIG.js} +2 -2
- package/dist/{chunk-SQNW22ZZ.js → chunk-OV4WREMW.js} +3 -3
- package/dist/{chunk-OVLNF4AZ.js → chunk-P7IVAMAU.js} +24 -35
- package/dist/chunk-P7IVAMAU.js.map +1 -0
- package/dist/{chunk-6LGWJFQK.js → chunk-PFDM2OIP.js} +2 -2
- package/dist/chunk-PN4HVM43.js +160 -0
- package/dist/chunk-PN4HVM43.js.map +1 -0
- package/dist/{chunk-WWM2YTW4.js → chunk-R2AZOWEZ.js} +21 -27
- package/dist/chunk-R2AZOWEZ.js.map +1 -0
- package/dist/{chunk-2GB5CIN6.js → chunk-RZVUY2MO.js} +8 -4
- package/dist/chunk-RZVUY2MO.js.map +1 -0
- package/dist/{chunk-YTOYMJPM.js → chunk-SLVQ33AN.js} +15 -5
- package/dist/chunk-SLVQ33AN.js.map +1 -0
- package/dist/{chunk-H5VEJDEK.js → chunk-TVPPA4RD.js} +7 -7
- package/dist/{chunk-ISH42UC7.js → chunk-USJPZ5Q7.js} +2 -2
- package/dist/{chunk-5OIH36KX.js → chunk-V4FKHLEB.js} +2 -2
- package/dist/{chunk-ZUIJ3N7N.js → chunk-V6Z4XS3I.js} +5 -3
- package/dist/chunk-V6Z4XS3I.js.map +1 -0
- package/dist/{chunk-JM64OEU6.js → chunk-WAPJ2DL3.js} +10 -13
- package/dist/chunk-WAPJ2DL3.js.map +1 -0
- package/dist/{chunk-QPLWDSYG.js → chunk-WM6Y2S6W.js} +4 -4
- package/dist/{chunk-EMMPNB6D.js → chunk-X4Z62ZQY.js} +2 -2
- package/dist/{chunk-ZAB65STX.js → chunk-XHHR6G35.js} +2 -2
- package/dist/{chunk-OP65D4UR.js → chunk-XR6WBW23.js} +2 -2
- package/dist/{chunk-WIT3Y7JT.js → chunk-Y2B3I3IH.js} +2 -2
- package/dist/{chunk-R6SNYC3D.js → chunk-Y3KRUT7O.js} +2 -2
- package/dist/{chunk-TPLKJHNN.js → chunk-ZC7RQDZ5.js} +8 -7
- package/dist/chunk-ZC7RQDZ5.js.map +1 -0
- package/dist/{chunk-TFO6GBW7.js → chunk-ZS44PY7T.js} +5 -1
- package/dist/chunk-ZS44PY7T.js.map +1 -0
- package/dist/{chunk-AJ6XEO4E.js → chunk-ZUY65MFH.js} +2 -2
- package/dist/{chunk-4X4KM4ZB.js → chunk-ZZMZF7PZ.js} +2 -2
- package/dist/data-display/CardKit.js +5 -5
- package/dist/data-display/DataViews.js +40 -40
- package/dist/feedback/ConfirmAction.js +4 -4
- package/dist/form/Button.js +3 -3
- package/dist/form/CategorySelect.js +24 -16
- package/dist/form/total-form.js +20 -20
- package/dist/native/chunks/{chunk-ZAQ3AZJM.js → chunk-2R2R35C5.js} +2 -2
- package/dist/native/chunks/{chunk-ATS7STZJ.js → chunk-WL5LXVCK.js} +1 -1
- package/dist/native/chunks/{chunk-ATS7STZJ.js.map → chunk-WL5LXVCK.js.map} +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/form/Button.js +1 -1
- package/dist/navigation/AppHeader.js +4 -4
- package/dist/social-login-button.js +4 -4
- package/dist/types/components/form/Button/Button.d.ts +7 -3
- package/dist/types/components/form/Button/Button.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.metrics.d.ts +25 -0
- package/dist/types/components/form/Button/Button.metrics.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.types.d.ts +37 -4
- package/dist/types/components/form/Button/Button.types.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryPanel.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryPanelList.d.ts +6 -0
- package/dist/types/components/form/CategorySelect/CategoryPanelList.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryQuickActions.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryRows.d.ts +12 -24
- package/dist/types/components/form/CategorySelect/CategoryRows.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategorySelect.d.ts +10 -7
- package/dist/types/components/form/CategorySelect/CategorySelect.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategorySelect.styles.d.ts +11 -0
- package/dist/types/components/form/CategorySelect/CategorySelect.styles.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategorySelect.types.d.ts +10 -2
- package/dist/types/components/form/CategorySelect/CategorySelect.types.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/category-keyboard.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/category-tree.d.ts +52 -20
- package/dist/types/components/form/CategorySelect/category-tree.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/index.d.ts +1 -1
- package/dist/types/components/form/CategorySelect/index.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/useCategorySelect.d.ts +2 -0
- package/dist/types/components/form/CategorySelect/useCategorySelect.d.ts.map +1 -1
- package/dist/types-native/components/form/Button/Button.metrics.d.ts +25 -0
- package/dist/types-native/components/form/Button/Button.metrics.d.ts.map +1 -1
- package/dist/user-avatar.js +4 -4
- package/package.json +1 -1
- package/src/components/form/Button/Button.md +39 -0
- package/src/components/form/Button/Button.metrics.ts +26 -0
- package/src/components/form/Button/Button.tsx +77 -4
- package/src/components/form/Button/Button.types.ts +47 -5
- package/src/components/form/CategorySelect/CategoryPanel.tsx +1 -0
- package/src/components/form/CategorySelect/CategoryPanelList.tsx +42 -34
- package/src/components/form/CategorySelect/CategoryQuickActions.tsx +6 -4
- package/src/components/form/CategorySelect/CategoryRows.tsx +45 -81
- package/src/components/form/CategorySelect/CategorySelect.md +47 -13
- package/src/components/form/CategorySelect/CategorySelect.styles.ts +13 -0
- package/src/components/form/CategorySelect/CategorySelect.tsx +16 -14
- package/src/components/form/CategorySelect/CategorySelect.types.ts +10 -2
- package/src/components/form/CategorySelect/category-keyboard.ts +27 -31
- package/src/components/form/CategorySelect/category-tree.ts +143 -63
- package/src/components/form/CategorySelect/index.ts +4 -0
- package/src/components/form/CategorySelect/useCategorySelect.ts +15 -1
- package/dist/chunk-2GB5CIN6.js.map +0 -1
- package/dist/chunk-ITGG5OKP.js.map +0 -1
- package/dist/chunk-JM64OEU6.js.map +0 -1
- package/dist/chunk-LR6MSKTT.js +0 -124
- package/dist/chunk-LR6MSKTT.js.map +0 -1
- package/dist/chunk-OFOYMZRY.js.map +0 -1
- package/dist/chunk-OVLNF4AZ.js.map +0 -1
- package/dist/chunk-TFO6GBW7.js.map +0 -1
- package/dist/chunk-TPLKJHNN.js.map +0 -1
- package/dist/chunk-WWM2YTW4.js.map +0 -1
- package/dist/chunk-YTOYMJPM.js.map +0 -1
- package/dist/chunk-ZUIJ3N7N.js.map +0 -1
- /package/dist/{chunk-6JGPPTLX.js.map → chunk-2GI7ANEL.js.map} +0 -0
- /package/dist/{chunk-U2ZDN2AL.js.map → chunk-2PBGVMM2.js.map} +0 -0
- /package/dist/{chunk-4T7TXRGM.js.map → chunk-6ZY5XU4J.js.map} +0 -0
- /package/dist/{chunk-CHPZTF34.js.map → chunk-7KWBGMQC.js.map} +0 -0
- /package/dist/{chunk-6NSIZ2ZO.js.map → chunk-7MN6I5NK.js.map} +0 -0
- /package/dist/{chunk-PN5CQKA2.js.map → chunk-AXTLFK4T.js.map} +0 -0
- /package/dist/{chunk-JT6TERQL.js.map → chunk-BB2OUERT.js.map} +0 -0
- /package/dist/{chunk-XUJG2HFW.js.map → chunk-BH5BXLGI.js.map} +0 -0
- /package/dist/{chunk-4TXIZ5WI.js.map → chunk-CJUOBTLL.js.map} +0 -0
- /package/dist/{chunk-NWNSUHEB.js.map → chunk-CT5K725B.js.map} +0 -0
- /package/dist/{chunk-6OORHAE7.js.map → chunk-EQ7PWGBN.js.map} +0 -0
- /package/dist/{chunk-EJQW2IYW.js.map → chunk-FPFUXRD2.js.map} +0 -0
- /package/dist/{chunk-ZRPGVHTR.js.map → chunk-GGI7GM5O.js.map} +0 -0
- /package/dist/{chunk-KIHQE5YA.js.map → chunk-GVDJQMFI.js.map} +0 -0
- /package/dist/{chunk-TX5V42AY.js.map → chunk-HEBQS7QP.js.map} +0 -0
- /package/dist/{chunk-BUQ2JUND.js.map → chunk-JO6BBSGY.js.map} +0 -0
- /package/dist/{chunk-4ZV7N5CU.js.map → chunk-JXPHU3K5.js.map} +0 -0
- /package/dist/{chunk-TW3BXVEU.js.map → chunk-KMXAPYU2.js.map} +0 -0
- /package/dist/{chunk-CJBBGMIA.js.map → chunk-MNXVXW4T.js.map} +0 -0
- /package/dist/{chunk-BPLFM2GL.js.map → chunk-NYEA7JAI.js.map} +0 -0
- /package/dist/{chunk-O6AZDQJJ.js.map → chunk-OE2ZVL67.js.map} +0 -0
- /package/dist/{chunk-4523RYE7.js.map → chunk-OG2FP6SE.js.map} +0 -0
- /package/dist/{chunk-XKV5ZIBG.js.map → chunk-OGGPQVIG.js.map} +0 -0
- /package/dist/{chunk-SQNW22ZZ.js.map → chunk-OV4WREMW.js.map} +0 -0
- /package/dist/{chunk-6LGWJFQK.js.map → chunk-PFDM2OIP.js.map} +0 -0
- /package/dist/{chunk-H5VEJDEK.js.map → chunk-TVPPA4RD.js.map} +0 -0
- /package/dist/{chunk-ISH42UC7.js.map → chunk-USJPZ5Q7.js.map} +0 -0
- /package/dist/{chunk-5OIH36KX.js.map → chunk-V4FKHLEB.js.map} +0 -0
- /package/dist/{chunk-QPLWDSYG.js.map → chunk-WM6Y2S6W.js.map} +0 -0
- /package/dist/{chunk-EMMPNB6D.js.map → chunk-X4Z62ZQY.js.map} +0 -0
- /package/dist/{chunk-ZAB65STX.js.map → chunk-XHHR6G35.js.map} +0 -0
- /package/dist/{chunk-OP65D4UR.js.map → chunk-XR6WBW23.js.map} +0 -0
- /package/dist/{chunk-WIT3Y7JT.js.map → chunk-Y2B3I3IH.js.map} +0 -0
- /package/dist/{chunk-R6SNYC3D.js.map → chunk-Y3KRUT7O.js.map} +0 -0
- /package/dist/{chunk-AJ6XEO4E.js.map → chunk-ZUY65MFH.js.map} +0 -0
- /package/dist/{chunk-4X4KM4ZB.js.map → chunk-ZZMZF7PZ.js.map} +0 -0
- /package/dist/native/chunks/{chunk-ZAQ3AZJM.js.map → chunk-2R2R35C5.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategorySelect.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/CategorySelect.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAIlF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"CategorySelect.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/CategorySelect.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAIlF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;IAYlB,+CAA+C;;;;IAI/C,yDAAyD;;CAEjD,CAAC;AAWX,sFAAsF;AACtF,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,EAAE,UAAU,OAAO,EAAE,MAAM,OAAO,KAAG,SA0B1E,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,SAU5C,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,cAAc,EAAE,SAc5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,OAAO,KAAG,SAO/C,CAAC;AAEH,0BAA0B;AAC1B,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,KAAG,SAUrC,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,KAAG,SAkBrC,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,EAAE,OAAO,OAAO,KAAG,SAGzD,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OAAO,KAAK,KAAG,SAWrC,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,UAAU,EAAE,SAIxB,CAAC"}
|
|
@@ -20,10 +20,18 @@ export interface CategorySelectOption {
|
|
|
20
20
|
*/
|
|
21
21
|
count?: number;
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* One node of the category tree: an option together with whatever sits under it.
|
|
25
|
+
*
|
|
26
|
+
* Recursive rather than "a category and its flat subcategories" because the tree
|
|
27
|
+
* a caller hands over is not always two deep — a picker can file ITEMS under a
|
|
28
|
+
* subcategory, and the level below still has to nest, fold and search like the
|
|
29
|
+
* one above it. A node with an empty `subcategories` is the leaf.
|
|
30
|
+
*/
|
|
24
31
|
export interface CategoryGroup {
|
|
25
32
|
category: CategorySelectOption;
|
|
26
|
-
|
|
33
|
+
/** The nodes directly below it, each a group in its own right. */
|
|
34
|
+
subcategories: CategoryGroup[];
|
|
27
35
|
}
|
|
28
36
|
/** One entry in the "selected" summary: a whole category, or a single leaf. */
|
|
29
37
|
export interface CategorySelectionChip {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategorySelect.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/CategorySelect.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"CategorySelect.types.d.ts","sourceRoot":"","sources":["../../../../../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;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAyB,SAAQ,uBAAuB;IACvE,kEAAkE;IAClE,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kEAAkE;IAClE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACpC;AAED,iFAAiF;AACjF,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE,kEAAkE;IAClE,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,wDAAwD;IACxD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,wDAAwD;IACxD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-keyboard.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/category-keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"category-keyboard.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/category-keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,2EAA2E;IAC3E,MAAM,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,oBAAoB,EAAE,OAAO,CAAC;IAC9B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B;AAgHD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAMT"}
|
|
@@ -9,15 +9,17 @@ import type { CategoryGroup, CategorySelectionChip, CategorySelectOption } from
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function foldText(text: string): string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Nest a flat `parentId` list into a tree of ANY depth, preserving input order
|
|
13
|
+
* at every level.
|
|
13
14
|
*
|
|
14
|
-
* An option whose `parentId` names
|
|
15
|
-
* rather than dropped — a category is never invisible just because its
|
|
16
|
-
* was filtered out of the
|
|
15
|
+
* An option whose `parentId` names nothing in the payload is promoted to top
|
|
16
|
+
* level rather than dropped — a category is never invisible just because its
|
|
17
|
+
* parent was filtered out of the response. A duplicate id keeps its first row,
|
|
18
|
+
* so a repeated payload cannot place the same node twice.
|
|
17
19
|
*/
|
|
18
20
|
export declare function buildCategoryGroups(options: CategorySelectOption[]): CategoryGroup[];
|
|
19
21
|
/**
|
|
20
|
-
* Whether this
|
|
22
|
+
* Whether this node IS the leaf, because nothing sits under it.
|
|
21
23
|
*
|
|
22
24
|
* The leaf-only default makes a category a heading and the subcategory the thing
|
|
23
25
|
* you pick — but a childless category has no subcategory to offer instead, so
|
|
@@ -28,10 +30,34 @@ export declare function buildCategoryGroups(options: CategorySelectOption[]): Ca
|
|
|
28
30
|
* filter while `Marcar tudo` could still select it.
|
|
29
31
|
*/
|
|
30
32
|
export declare function isLeafCategory(group: CategoryGroup): boolean;
|
|
31
|
-
/** Every selectable leaf id across
|
|
33
|
+
/** Every selectable leaf id across the whole tree, in display order. */
|
|
32
34
|
export declare function collectLeafIds(groups: CategoryGroup[]): string[];
|
|
33
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The leaves a node stands for — every leaf BELOW it, or itself when childless.
|
|
37
|
+
*
|
|
38
|
+
* Recursive rather than one level down, so a category three levels deep still
|
|
39
|
+
* stands for the items at the bottom of it and not for the subcategories in
|
|
40
|
+
* between: the value a caller receives stays uniformly leaves, which is the
|
|
41
|
+
* property that lets a chip, a tri-state checkbox and `Marcar tudo` agree.
|
|
42
|
+
*/
|
|
34
43
|
export declare function leavesOf(group: CategoryGroup): string[];
|
|
44
|
+
/** Every node that can be unfolded, at any depth — what "Expandir tudo" opens. */
|
|
45
|
+
export declare function collectBranchIds(groups: CategoryGroup[]): string[];
|
|
46
|
+
/** The node carrying `id`, searched at every depth. */
|
|
47
|
+
export declare function findGroup(groups: CategoryGroup[], id: string): CategoryGroup | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The names from the top-level category down to `id`, or `null` when absent.
|
|
50
|
+
*
|
|
51
|
+
* The single-select trigger reads this back as `Pai › Filha › Item`, so a chosen
|
|
52
|
+
* row keeps the context that tells `Massas` (mercearia) from `Massas` (pratos
|
|
53
|
+
* principais) once the panel has closed over it.
|
|
54
|
+
*/
|
|
55
|
+
export declare function categoryPath(groups: CategoryGroup[], id: string): string[] | null;
|
|
56
|
+
/**
|
|
57
|
+
* How many levels the deepest branch has. A flat list is 1, the classic
|
|
58
|
+
* category/subcategory tree is 2, anything more is a tree with items in it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function treeDepth(groups: CategoryGroup[]): number;
|
|
35
61
|
export type CategoryCheckState = 'off' | 'partial' | 'on';
|
|
36
62
|
/** Whether none, some, or all of a category's leaves are selected. */
|
|
37
63
|
export declare function categoryCheckState(group: CategoryGroup, selected: ReadonlySet<string>): CategoryCheckState;
|
|
@@ -40,23 +66,26 @@ export declare function toggleCategoryLeaves(group: CategoryGroup, selected: Rea
|
|
|
40
66
|
/** Add an id when absent, remove it when present. */
|
|
41
67
|
export declare function toggleLeaf(id: string, selected: ReadonlySet<string>): Set<string>;
|
|
42
68
|
/**
|
|
43
|
-
* Collapse a raw id set into the chips a human reads: a
|
|
44
|
-
* selected becomes ONE chip bearing
|
|
45
|
-
*
|
|
69
|
+
* Collapse a raw id set into the chips a human reads: a node that is fully
|
|
70
|
+
* selected becomes ONE chip bearing its name, rather than one chip per leaf —
|
|
71
|
+
* "Bebidas" instead of six drinks.
|
|
72
|
+
*
|
|
73
|
+
* A partly-selected node hands the question down to its own children, so the
|
|
74
|
+
* chip that appears is always the DEEPEST node that is completely selected.
|
|
46
75
|
*/
|
|
47
76
|
export declare function summarizeSelection(groups: CategoryGroup[], selected: ReadonlySet<string>): CategorySelectionChip[];
|
|
48
77
|
/**
|
|
49
|
-
* Drop the leaves a chip stands for. A
|
|
50
|
-
*
|
|
78
|
+
* Drop the leaves a chip stands for. A chip naming a node removes everything
|
|
79
|
+
* under it; a chip naming nothing in the tree removes just that id.
|
|
51
80
|
*/
|
|
52
81
|
export declare function removeChip(groups: CategoryGroup[], chipId: string, selected: ReadonlySet<string>): Set<string>;
|
|
53
82
|
/**
|
|
54
|
-
* Search
|
|
83
|
+
* Search every level, keeping each hit under its parents.
|
|
55
84
|
*
|
|
56
|
-
* A
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
85
|
+
* A node that matches keeps its whole subtree, so "Bebidas" shows the entire
|
|
86
|
+
* group. A node that does not match keeps only the descendants that do — the hit
|
|
87
|
+
* still arrives with its parents visible above it, which is the context that
|
|
88
|
+
* tells "Massas" (mercearia) from "Massas" (pratos principais).
|
|
60
89
|
*/
|
|
61
90
|
export declare function filterCategoryGroups(groups: CategoryGroup[], query: string): CategoryGroup[];
|
|
62
91
|
/** A run of text, flagged when it is the part that matched the query. */
|
|
@@ -74,12 +103,15 @@ interface HighlightSegment {
|
|
|
74
103
|
export declare function highlightSegments(text: string, query: string): HighlightSegment[];
|
|
75
104
|
/** A flattened row, so keyboard navigation can walk what is actually on screen. */
|
|
76
105
|
export interface CategoryRowRef {
|
|
77
|
-
kind: 'category' | 'subcategory';
|
|
78
106
|
id: string;
|
|
79
|
-
/**
|
|
107
|
+
/** 0 for a top-level category, one more for each level below it. */
|
|
108
|
+
depth: number;
|
|
109
|
+
/** True when the row has children to unfold — what → and ← act on. */
|
|
110
|
+
branch: boolean;
|
|
111
|
+
/** Owning node id — lets ← jump from a child back to its parent. */
|
|
80
112
|
parentId?: string;
|
|
81
113
|
}
|
|
82
|
-
/** The visible rows, in order, honouring which
|
|
114
|
+
/** The visible rows, in order, honouring which nodes are expanded. */
|
|
83
115
|
export declare function flattenRows(groups: CategoryGroup[], isExpanded: (categoryId: string) => boolean): CategoryRowRef[];
|
|
84
116
|
export {};
|
|
85
117
|
//# sourceMappingURL=category-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/category-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;
|
|
1
|
+
{"version":3,"file":"category-tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/category-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,aAAa,EAAE,CAiBpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAE5D;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAGvD;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAIlE;AAED,uDAAuD;AACvD,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAOxF;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAOjF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAKzD;AAED,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;AAE1D,sE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AAM,CAAC;CACnB;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EAAE,EACvB,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,GAC1C,cAAc,EAAE,CAUlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { CategorySelect } from './CategorySelect';
|
|
2
2
|
export type { CategoryGroup, CategoryMultiSelectProps, CategorySelectBaseProps, CategorySelectionChip, CategorySelectOption, CategorySelectProps, CategorySingleSelectProps, } from './CategorySelect.types';
|
|
3
|
-
export { buildCategoryGroups, categoryCheckState, collectLeafIds, filterCategoryGroups, foldText, leavesOf, summarizeSelection, } from './category-tree';
|
|
3
|
+
export { buildCategoryGroups, categoryCheckState, categoryPath, collectBranchIds, collectLeafIds, filterCategoryGroups, findGroup, foldText, leavesOf, summarizeSelection, treeDepth, } from './category-tree';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,QAAQ,EACR,QAAQ,EACR,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,SAAS,GACV,MAAM,iBAAiB,CAAC"}
|
|
@@ -22,6 +22,8 @@ export interface CategorySelectState extends ExpansionState, DraftState {
|
|
|
22
22
|
visibleGroups: CategoryGroup[];
|
|
23
23
|
/** All groups, unfiltered — the basis for chips and "select all". */
|
|
24
24
|
allGroups: CategoryGroup[];
|
|
25
|
+
/** True when the tree runs deeper than category/subcategory. */
|
|
26
|
+
deepTree: boolean;
|
|
25
27
|
rows: CategoryRowRef[];
|
|
26
28
|
activeIndex: number;
|
|
27
29
|
setQuery: (next: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCategorySelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/useCategorySelect.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"useCategorySelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/CategorySelect/useCategorySelect.ts"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAElF,oEAAoE;AACpE,UAAU,cAAc;IACtB,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,SAAS,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CAC9C;AAiDD,+DAA+D;AAC/D,UAAU,UAAU;IAClB,KAAK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is square: uniform padding, no min-width. */
|
|
19
19
|
export declare const ICON_ONLY_PADDING: Record<SizeValue, number>;
|
|
20
|
+
/**
|
|
21
|
+
* The start/end icon slot's font-size, in px — MUI's `medium` value, pinned
|
|
22
|
+
* (12-74).
|
|
23
|
+
*
|
|
24
|
+
* MUI sizes that slot off its OWN `size` prop, writing 18/20/22 onto the first
|
|
25
|
+
* child of `.MuiButton-startIcon`. We never passed a `size`, so every button in
|
|
26
|
+
* every size has always drawn medium's 20px; now that `size` IS forwarded — so
|
|
27
|
+
* the rendered class finally names the size the button actually is — the number
|
|
28
|
+
* would start moving with it.
|
|
29
|
+
*
|
|
30
|
+
* WHAT THAT ACTUALLY REACHES, measured in a browser rather than assumed: this
|
|
31
|
+
* Button renders its own wrapper span around the icon (it carries the child
|
|
32
|
+
* test id), so MUI's rule lands on the WRAPPER and reaches the glyph only when
|
|
33
|
+
* the glyph takes its size by inheritance — `fontSize="inherit"`, an em-sized
|
|
34
|
+
* SVG, a text or emoji glyph. With the pin removed, such a glyph measured 18px
|
|
35
|
+
* at `xs`/`sm` and 22px at `lg`/`xl` against the 20px it has always been. An
|
|
36
|
+
* icon carrying an absolute size of its own does not move at all: a default
|
|
37
|
+
* `SvgIcon` stayed 24×24 across all five.
|
|
38
|
+
*
|
|
39
|
+
* A silent resize of the inherited case is still a design decision arriving as
|
|
40
|
+
* a side effect of a class-name fix, so it is pinned to what shipped before —
|
|
41
|
+
* `Button.tsx` puts it on that same wrapper. Scaling the glyph with the button
|
|
42
|
+
* is a ticket of its own.
|
|
43
|
+
*/
|
|
44
|
+
export declare const BUTTON_ICON_GLYPH_SIZE = 20;
|
|
20
45
|
export declare const BUTTON_FONT_WEIGHT = 500;
|
|
21
46
|
/** `theme.spacing(1)`. */
|
|
22
47
|
export declare const BUTTON_RADIUS_UNITS = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.metrics.ts"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,QAAQ,GAAI,OAAO,OAAO,EAAE,SAAS,cAAc,KAAG,MACc,CAAC;AAElF,sFAAsF;AACtF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,cAAc,GACtB,CAAC,MAAM,EAAE,MAAM,CAAC,CAclB"}
|
|
1
|
+
{"version":3,"file":"Button.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.metrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAM7D,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAMvD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,0BAA0B;AAC1B,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAClD,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,cAAc,CAU/E;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,SAAS,cAAc,KAAG,MACc,CAAC;AAElF,sFAAsF;AACtF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,cAAc,GACtB,CAAC,MAAM,EAAE,MAAM,CAAC,CAclB"}
|
package/dist/user-avatar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UserAvatar,
|
|
3
3
|
UserMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GGI7GM5O.js";
|
|
5
5
|
import "./chunk-UDQSIRAP.js";
|
|
6
6
|
import "./chunk-JUHUKZGU.js";
|
|
7
7
|
import "./chunk-NA7MIEG6.js";
|
|
@@ -15,9 +15,9 @@ import "./chunk-BEBLRL5D.js";
|
|
|
15
15
|
import "./chunk-6Q6T3FW5.js";
|
|
16
16
|
import "./chunk-FKUYRQSP.js";
|
|
17
17
|
import "./chunk-BA4RHQ3B.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-SLVQ33AN.js";
|
|
19
|
+
import "./chunk-BB2OUERT.js";
|
|
20
|
+
import "./chunk-5LQ7PKMW.js";
|
|
21
21
|
import "./chunk-TAMIZE4Q.js";
|
|
22
22
|
import "./chunk-73BEVJCS.js";
|
|
23
23
|
import "./chunk-343TTIHD.js";
|
package/package.json
CHANGED
|
@@ -12,6 +12,8 @@ The Button component is a versatile and highly customizable interactive element
|
|
|
12
12
|
- **Special Effects**: glow, pulse animations
|
|
13
13
|
- **Loading States**: Built-in loading spinner
|
|
14
14
|
- **Icon Support**: Leading icons with automatic loading state handling
|
|
15
|
+
- **Renders As Anything**: `component` swaps the element, carrying that
|
|
16
|
+
component's own props through the types (a router link, an `<a>`, a label)
|
|
15
17
|
- **Accessibility**: Full ARIA support, keyboard navigation
|
|
16
18
|
- **Responsive Design**: Adapts to different screen sizes
|
|
17
19
|
|
|
@@ -37,6 +39,14 @@ import { Button } from '@procurement/ui';
|
|
|
37
39
|
<Button variant="gradient" glow pulse>
|
|
38
40
|
Special Button
|
|
39
41
|
</Button>
|
|
42
|
+
|
|
43
|
+
// As a navigation, painted as a button
|
|
44
|
+
<Button component={Link} to="/orders/42">
|
|
45
|
+
Track my order
|
|
46
|
+
</Button>
|
|
47
|
+
|
|
48
|
+
// Or a plain anchor, when there is no router in the tree
|
|
49
|
+
<Button href="/orders/42">Track my order</Button>
|
|
40
50
|
```
|
|
41
51
|
|
|
42
52
|
## Props
|
|
@@ -60,6 +70,35 @@ import { Button } from '@procurement/ui';
|
|
|
60
70
|
| `onBlur` | `(event: FocusEvent) => void` | - | Blur event handler |
|
|
61
71
|
| `children` | `ReactNode` | - | Button content |
|
|
62
72
|
| `className` | `string` | - | Additional CSS classes |
|
|
73
|
+
| `component` | `ElementType` | `'button'` | Render as this element/component instead |
|
|
74
|
+
| `href` | `string` | - | Renders an `<a>` (MUI's own behaviour) |
|
|
75
|
+
|
|
76
|
+
## Rendering as something else
|
|
77
|
+
|
|
78
|
+
`component` swaps the element the button renders as, and the button's props are
|
|
79
|
+
typed against it — so the target's own props are checked at the call site rather
|
|
80
|
+
than silently dropped:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { Link } from 'react-router-dom';
|
|
84
|
+
|
|
85
|
+
<Button component={Link} to="/orders/42" variant="solid" size="lg">
|
|
86
|
+
Track my order
|
|
87
|
+
</Button>;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Three things are worth knowing:
|
|
91
|
+
|
|
92
|
+
- **`to` is typed.** `Button` is an `OverridableComponent`, so the generic
|
|
93
|
+
carries the target's props through. Misspell `to` and it fails to compile.
|
|
94
|
+
- **The paint does not change.** Measured against the same button rendered as a
|
|
95
|
+
`<button>`: identical box, background, padding, radius and type; hover still
|
|
96
|
+
darkens; the class still names the size.
|
|
97
|
+
- **`href` alone is enough** when there is no router involved — MUI renders an
|
|
98
|
+
`<a>` for it without a `component`.
|
|
99
|
+
|
|
100
|
+
The event handlers are typed on `HTMLElement` rather than `HTMLButtonElement`
|
|
101
|
+
for this reason: the element under the pointer is not always a button.
|
|
63
102
|
|
|
64
103
|
## Variants
|
|
65
104
|
|
|
@@ -34,6 +34,32 @@ export const ICON_ONLY_PADDING: Record<SizeValue, number> = {
|
|
|
34
34
|
xl: 11,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* The start/end icon slot's font-size, in px — MUI's `medium` value, pinned
|
|
39
|
+
* (12-74).
|
|
40
|
+
*
|
|
41
|
+
* MUI sizes that slot off its OWN `size` prop, writing 18/20/22 onto the first
|
|
42
|
+
* child of `.MuiButton-startIcon`. We never passed a `size`, so every button in
|
|
43
|
+
* every size has always drawn medium's 20px; now that `size` IS forwarded — so
|
|
44
|
+
* the rendered class finally names the size the button actually is — the number
|
|
45
|
+
* would start moving with it.
|
|
46
|
+
*
|
|
47
|
+
* WHAT THAT ACTUALLY REACHES, measured in a browser rather than assumed: this
|
|
48
|
+
* Button renders its own wrapper span around the icon (it carries the child
|
|
49
|
+
* test id), so MUI's rule lands on the WRAPPER and reaches the glyph only when
|
|
50
|
+
* the glyph takes its size by inheritance — `fontSize="inherit"`, an em-sized
|
|
51
|
+
* SVG, a text or emoji glyph. With the pin removed, such a glyph measured 18px
|
|
52
|
+
* at `xs`/`sm` and 22px at `lg`/`xl` against the 20px it has always been. An
|
|
53
|
+
* icon carrying an absolute size of its own does not move at all: a default
|
|
54
|
+
* `SvgIcon` stayed 24×24 across all five.
|
|
55
|
+
*
|
|
56
|
+
* A silent resize of the inherited case is still a design decision arriving as
|
|
57
|
+
* a side effect of a class-name fix, so it is pinned to what shipped before —
|
|
58
|
+
* `Button.tsx` puts it on that same wrapper. Scaling the glyph with the button
|
|
59
|
+
* is a ticket of its own.
|
|
60
|
+
*/
|
|
61
|
+
export const BUTTON_ICON_GLYPH_SIZE = 20;
|
|
62
|
+
|
|
37
63
|
export const BUTTON_FONT_WEIGHT = 500;
|
|
38
64
|
/** `theme.spacing(1)`. */
|
|
39
65
|
export const BUTTON_RADIUS_UNITS = 1;
|
|
@@ -4,6 +4,7 @@ import { styled } from '@mui/material/styles/index.js';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
import { resolveButtonProps } from './Button.helpers';
|
|
7
|
+
import { BUTTON_ICON_GLYPH_SIZE } from './Button.metrics';
|
|
7
8
|
import { childTestId, resolveTestId, withoutTestIdProps } from '../../../platform/test-id';
|
|
8
9
|
import {
|
|
9
10
|
buttonEmphasisStyles,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
iconAlignmentStyles,
|
|
13
14
|
buttonSize,
|
|
14
15
|
} from './Button.styles';
|
|
15
|
-
import type { ButtonProps } from './Button.types';
|
|
16
|
+
import type { ButtonComponent, ButtonProps } from './Button.types';
|
|
16
17
|
|
|
17
18
|
const StyledButton = styled(MuiButton, {
|
|
18
19
|
shouldForwardProp: (prop) =>
|
|
@@ -49,12 +50,53 @@ const muiVariantFor = (variant?: string): 'outlined' | 'text' | 'contained' => {
|
|
|
49
50
|
|
|
50
51
|
type MuiButtonColor = 'inherit' | 'primary' | 'secondary' | 'success' | 'warning' | 'info' | 'error';
|
|
51
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Our five sizes collapse onto MUI's three, so the rendered class NAMES the
|
|
55
|
+
* size the button actually is (12-74).
|
|
56
|
+
*
|
|
57
|
+
* It was never forwarded, so every button — `xs` through `xl` — carried
|
|
58
|
+
* `MuiButton-sizeMedium`. The pixels were right (they come from `buttonSize`'s
|
|
59
|
+
* `sx`, which still decides them) but the DOM said "medium" about a large
|
|
60
|
+
* button: a test could never assert the size, and devtools lied to whoever
|
|
61
|
+
* opened them.
|
|
62
|
+
*
|
|
63
|
+
* MUI's own size styles are padding, font-size and the icon glyph. The first
|
|
64
|
+
* two are overridden by that same `sx`; the third is pinned by
|
|
65
|
+
* `BUTTON_ICON_GLYPH_SIZE`, so forwarding this moves nothing on screen.
|
|
66
|
+
*/
|
|
67
|
+
const muiSizeFor = (size: NonNullable<ButtonProps['size']>): 'small' | 'medium' | 'large' => {
|
|
68
|
+
if (size === 'xs' || size === 'sm') return 'small';
|
|
69
|
+
return size === 'md' ? 'medium' : 'large';
|
|
70
|
+
};
|
|
71
|
+
|
|
52
72
|
/** `danger` and `neutral` are ours; the rest are MUI's own names already. */
|
|
53
73
|
const muiColorFor = (color: NonNullable<ButtonProps['color']>): MuiButtonColor => {
|
|
54
74
|
if (color === 'danger') return 'error';
|
|
55
75
|
return color === 'neutral' ? 'inherit' : color;
|
|
56
76
|
};
|
|
57
77
|
|
|
78
|
+
/**
|
|
79
|
+
* The icon slot's font-size, pinned on the wrapper this component already owns
|
|
80
|
+
* (12-74).
|
|
81
|
+
*
|
|
82
|
+
* MUI writes 18/20/22 there off its own `size`, and that prop is now forwarded,
|
|
83
|
+
* so a glyph that takes its size by INHERITANCE would start moving with the
|
|
84
|
+
* button — measured at 18px on `xs` and 22px on `lg` against the 20px every
|
|
85
|
+
* size has always drawn. See {@link BUTTON_ICON_GLYPH_SIZE} for what that does
|
|
86
|
+
* and does not reach.
|
|
87
|
+
*
|
|
88
|
+
* Written as an inline style rather than a selector in `sx` because MUI's own
|
|
89
|
+
* rule sits on the start/end-icon span itself. Beating it from the root means
|
|
90
|
+
* winning a specificity contest at a distance — true in a browser, but not
|
|
91
|
+
* something a test can hold, since jsdom resolves `getComputedStyle` by
|
|
92
|
+
* document order and never by specificity. Inline wins both, and it sits on the
|
|
93
|
+
* one element we already render for this glyph.
|
|
94
|
+
*
|
|
95
|
+
* A number, not `px()`: React writes `font-size: 20px`, which is exactly the
|
|
96
|
+
* declaration MUI was emitting before.
|
|
97
|
+
*/
|
|
98
|
+
const ICON_GLYPH_STYLE = { fontSize: BUTTON_ICON_GLYPH_SIZE } as const;
|
|
99
|
+
|
|
58
100
|
/**
|
|
59
101
|
* An icon and nothing else — the shape that should render square.
|
|
60
102
|
*
|
|
@@ -71,7 +113,26 @@ function isIconOnly({
|
|
|
71
113
|
return !loading && icon != null && children == null;
|
|
72
114
|
}
|
|
73
115
|
|
|
74
|
-
|
|
116
|
+
/**
|
|
117
|
+
* The design system's button.
|
|
118
|
+
*
|
|
119
|
+
* Typed as an `OverridableComponent` (12-70) rather than a plain `forwardRef`,
|
|
120
|
+
* which is how MUI models a component that can render as something else. The
|
|
121
|
+
* practical difference is one line at a call site:
|
|
122
|
+
*
|
|
123
|
+
* ```tsx
|
|
124
|
+
* <Button component={Link} to="/account/compras/42">Acompanhar pedido</Button>
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* `to` is typed here because the generic carries the target component's own
|
|
128
|
+
* props through. A plain `component?: React.ElementType` — what this was —
|
|
129
|
+
* accepts the component and throws its props away, so `to` typechecked
|
|
130
|
+
* nowhere even though it arrived intact at runtime. A host wanting a router
|
|
131
|
+
* navigation painted as a button had to choose between a type assertion and
|
|
132
|
+
* losing the `href`; both were shipped, and both are the reason this ticket
|
|
133
|
+
* exists.
|
|
134
|
+
*/
|
|
135
|
+
const ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
75
136
|
(rawProps, ref) => {
|
|
76
137
|
const {
|
|
77
138
|
variant,
|
|
@@ -99,7 +160,11 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
99
160
|
|
|
100
161
|
// Wrap icon with testId if provided
|
|
101
162
|
const iconWithTestId =
|
|
102
|
-
!loading && icon ?
|
|
163
|
+
!loading && icon ? (
|
|
164
|
+
<span data-testid={testId('icon')} style={ICON_GLYPH_STYLE}>
|
|
165
|
+
{icon}
|
|
166
|
+
</span>
|
|
167
|
+
) : undefined;
|
|
103
168
|
|
|
104
169
|
// Only an icon, so the button is a square rather than a 64px slab.
|
|
105
170
|
const iconOnly = isIconOnly({ loading, icon, children });
|
|
@@ -112,6 +177,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
112
177
|
ref={ref}
|
|
113
178
|
variant={muiVariantFor(variant)}
|
|
114
179
|
color={muiColorFor(color)}
|
|
180
|
+
size={muiSizeFor(size)}
|
|
115
181
|
customVariant={variant}
|
|
116
182
|
customColor={color}
|
|
117
183
|
glow={glow}
|
|
@@ -139,4 +205,11 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
139
205
|
},
|
|
140
206
|
);
|
|
141
207
|
|
|
142
|
-
|
|
208
|
+
ButtonRoot.displayName = 'Button';
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The cast is what publishes the generic — `forwardRef` cannot express
|
|
212
|
+
* "renders as C, and takes C's props" on its own, so MUI's own components do
|
|
213
|
+
* exactly this. `ButtonRoot` above is the implementation and is not exported.
|
|
214
|
+
*/
|
|
215
|
+
export const Button = ButtonRoot as ButtonComponent;
|
|
@@ -1,25 +1,67 @@
|
|
|
1
1
|
import type { ButtonProps as MuiButtonProps } from '@mui/material/Button/index.js';
|
|
2
|
+
import type { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent/index.js';
|
|
2
3
|
import type * as React from 'react';
|
|
3
4
|
|
|
4
5
|
import type { ButtonBaseProps } from './Button.base';
|
|
5
6
|
|
|
6
7
|
export type { ButtonBaseProps, ButtonVariant } from './Button.base';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Everything this Button adds, WITHOUT the element it renders as.
|
|
11
|
+
*
|
|
12
|
+
* `component` is deliberately omitted here and reintroduced by the type map
|
|
13
|
+
* below: MUI models "render as something else" with a generic, and taking
|
|
14
|
+
* `component?: React.ElementType` as a plain prop is exactly what threw the
|
|
15
|
+
* target's own props away (12-70).
|
|
16
|
+
*/
|
|
17
|
+
export interface ButtonOwnProps
|
|
9
18
|
extends ButtonBaseProps,
|
|
10
|
-
Omit<MuiButtonProps, 'variant' | 'color' | 'size' | keyof ButtonBaseProps> {
|
|
19
|
+
Omit<MuiButtonProps, 'variant' | 'color' | 'size' | 'component' | keyof ButtonBaseProps> {
|
|
11
20
|
/**
|
|
12
21
|
* Click handler
|
|
13
22
|
*/
|
|
14
|
-
onClick?: React.MouseEventHandler<
|
|
23
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
15
24
|
|
|
16
25
|
/**
|
|
17
26
|
* Focus handler
|
|
18
27
|
*/
|
|
19
|
-
onFocus?: React.FocusEventHandler<
|
|
28
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
20
29
|
|
|
21
30
|
/**
|
|
22
31
|
* Blur handler
|
|
23
32
|
*/
|
|
24
|
-
onBlur?: React.FocusEventHandler<
|
|
33
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
25
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* What `Button` renders as, and what that brings with it.
|
|
38
|
+
*
|
|
39
|
+
* This is the shape MUI's `OverridableComponent` reads. Handing `component` a
|
|
40
|
+
* router `Link` now also hands the call site that Link's OWN props — `to`,
|
|
41
|
+
* `replace`, `state` — typed, which is the whole point of 12-70. Before this,
|
|
42
|
+
* `component` was `React.ElementType` and `to` typechecked nowhere, so a host
|
|
43
|
+
* that wanted a navigation painted as a button had to reach for a type
|
|
44
|
+
* assertion or throw the `href` away.
|
|
45
|
+
*/
|
|
46
|
+
export interface ButtonTypeMap<
|
|
47
|
+
AdditionalProps = object,
|
|
48
|
+
RootComponent extends React.ElementType = 'button',
|
|
49
|
+
> {
|
|
50
|
+
props: AdditionalProps & ButtonOwnProps;
|
|
51
|
+
defaultComponent: RootComponent;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The props of a Button rendered as `RootComponent` — `button` by default.
|
|
56
|
+
*
|
|
57
|
+
* Generic WITH defaults, so every existing `ButtonProps` (no arguments) keeps
|
|
58
|
+
* meaning exactly what it meant before this change: the button-rendered case.
|
|
59
|
+
*/
|
|
60
|
+
export type ButtonProps<
|
|
61
|
+
RootComponent extends React.ElementType = 'button',
|
|
62
|
+
AdditionalProps = object,
|
|
63
|
+
> = OverrideProps<ButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
|
64
|
+
component?: React.ElementType;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type ButtonComponent = OverridableComponent<ButtonTypeMap>;
|
|
@@ -94,6 +94,7 @@ export function CategoryPanel({
|
|
|
94
94
|
loading={loading}
|
|
95
95
|
showCounts={showCounts}
|
|
96
96
|
allowParentSelection={allowParentSelection}
|
|
97
|
+
deepTree={state.deepTree}
|
|
97
98
|
isExpanded={state.isExpanded}
|
|
98
99
|
onToggleExpanded={state.toggleExpanded}
|
|
99
100
|
onActivateCategory={onActivateCategory}
|