@12-apps/ui 6.77.0 → 6.77.2
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/Alert/Alert.content.js +2 -2
- package/dist/_internal/components/data-display/Alert/Alert.js +4 -4
- package/dist/_internal/components/data-display/Alert/Alert.metrics.js +1 -1
- package/dist/_internal/components/data-display/Alert/Alert.styles.js +2 -2
- package/dist/_internal/components/data-display/Banner/Banner.js +3 -3
- package/dist/_internal/components/data-display/Banner/Banner.styles.js +2 -2
- package/dist/_internal/components/data-display/CardKit/CardKebab.js +2 -2
- package/dist/_internal/components/data-display/CardKit/card-actions-context.js +5 -5
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +8 -8
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +17 -17
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +27 -27
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +2 -2
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +3 -3
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-card-body.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-columns.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-empty.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-export.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-grid-helpers.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +14 -14
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-select-all-strip.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-view-nav.js +2 -2
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +4 -4
- package/dist/_internal/components/data-display/index.js +6 -6
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +2 -2
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +6 -6
- package/dist/_internal/components/feedback/index.js +7 -7
- package/dist/_internal/components/form/Button/Button.js +1 -1
- package/dist/_internal/components/form/index.js +1 -1
- package/dist/_internal/components/form/total-form/SubmitButton.js +2 -2
- package/dist/_internal/components/index.js +17 -17
- package/dist/_internal/components/layout/SettingCard/SettingCard.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingCard.parts.js +2 -2
- package/dist/_internal/components/layout/SettingCard/SettingCard.summary.js +3 -3
- package/dist/_internal/components/layout/SettingCard/SettingGrid.js +3 -3
- package/dist/_internal/components/layout/SettingCard/SettingGroup.js +5 -5
- package/dist/_internal/components/layout/SettingCard/SettingSwitch.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingToggle.js +5 -5
- package/dist/_internal/components/layout/index.js +8 -8
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +2 -2
- package/dist/_internal/components/navigation/index.js +2 -2
- package/dist/_internal/social-login-button/social-login-button.js +2 -2
- package/dist/_internal/user-avatar/user-avatar.js +2 -2
- package/dist/{chunk-BF3SGOWT.js → chunk-2ONUSNPZ.js} +2 -2
- package/dist/{chunk-ULK4AGG4.js → chunk-3EIRRLCQ.js} +2 -2
- package/dist/{chunk-TVXUOJAL.js → chunk-4NG3LTRX.js} +2 -2
- package/dist/{chunk-XZE5FIRB.js → chunk-5IIHAYFF.js} +2 -2
- package/dist/{chunk-72L5C74V.js → chunk-5M7T36AT.js} +3 -3
- package/dist/{chunk-J32XJALK.js → chunk-5WUXJDFP.js} +2 -2
- package/dist/{chunk-JNVUB2D4.js → chunk-5ZY3IIIG.js} +2 -2
- package/dist/chunk-5ZY3IIIG.js.map +1 -0
- package/dist/{chunk-3MQZBBUW.js → chunk-7FFY4LJY.js} +2 -2
- package/dist/{chunk-IVI574Y5.js → chunk-7HZ36QDH.js} +16 -7
- package/dist/chunk-7HZ36QDH.js.map +1 -0
- package/dist/{chunk-ENXGWNCX.js → chunk-7LMR2H7O.js} +4 -4
- package/dist/{chunk-H7QTDKA6.js → chunk-BGSUSSAV.js} +2 -2
- package/dist/{chunk-FR2RJXHS.js → chunk-C2NNJMVY.js} +3 -3
- package/dist/{chunk-NIZUFPV3.js → chunk-CW5Z67NA.js} +2 -2
- package/dist/{chunk-BEHM2VLH.js → chunk-FVNY5BNV.js} +2 -2
- package/dist/{chunk-X2SJJZFH.js → chunk-GG7IOJAG.js} +4 -4
- package/dist/{chunk-J5QNJERV.js → chunk-HHFVDOA7.js} +3 -3
- package/dist/{chunk-HVGQH54G.js → chunk-HMWSMRLM.js} +2 -2
- package/dist/{chunk-MA6ENJDP.js → chunk-HXCUKZOB.js} +3 -3
- package/dist/{chunk-CCJJTLF7.js → chunk-L5RS6QAT.js} +2 -2
- package/dist/{chunk-ZSCKXOKE.js → chunk-NQCTANF3.js} +4 -4
- package/dist/{chunk-NIENIKZ5.js → chunk-NRADSKGH.js} +2 -2
- package/dist/{chunk-725H45MT.js → chunk-NZXRPWPW.js} +4 -4
- package/dist/{chunk-LBEZ7A3F.js → chunk-OK3OJGJY.js} +3 -3
- package/dist/{chunk-WJEJ65TF.js → chunk-OY437NRJ.js} +2 -2
- package/dist/{chunk-QZX43FIC.js → chunk-QIP37Y2C.js} +2 -2
- package/dist/{chunk-Y2CCXB7R.js → chunk-QITQFCFY.js} +2 -2
- package/dist/{chunk-P4LR2GLN.js → chunk-R2ODLE6G.js} +2 -2
- package/dist/{chunk-UFNXYOHZ.js → chunk-RCTHCXS6.js} +2 -2
- package/dist/{chunk-VQSBZPKO.js → chunk-RVZMKGWQ.js} +2 -2
- package/dist/{chunk-QWSYHENP.js → chunk-SKIAWOUC.js} +4 -4
- package/dist/{chunk-3FDSXSEP.js → chunk-TDWA2XFJ.js} +2 -2
- package/dist/{chunk-VWVA74JY.js → chunk-UXQVJXQ3.js} +2 -2
- package/dist/{chunk-BEYLI32I.js → chunk-WOUJSKQB.js} +3 -3
- package/dist/{chunk-NDQJDA7O.js → chunk-WULEQKU7.js} +2 -2
- package/dist/{chunk-4QGPRORO.js → chunk-X2GWR75Q.js} +2 -2
- package/dist/{chunk-NKBCUR4V.js → chunk-X3DN2BE3.js} +2 -2
- package/dist/{chunk-B34WHRKH.js → chunk-XGKUXYAD.js} +2 -2
- package/dist/{chunk-TRYYYWV3.js → chunk-Y2CHJLWD.js} +6 -6
- package/dist/{chunk-QDG6V7OC.js → chunk-YNZUYZ2O.js} +3 -3
- package/dist/{chunk-364NH2NY.js → chunk-YOXYSAUI.js} +20 -11
- package/dist/chunk-YOXYSAUI.js.map +1 -0
- package/dist/{chunk-T2KONJ45.js → chunk-Z4ZFJ565.js} +3 -3
- package/dist/{chunk-JA3WJPXH.js → chunk-ZAZOBTVS.js} +2 -2
- package/dist/{chunk-SZSS5KKX.js → chunk-ZCXQ4ZB6.js} +2 -2
- package/dist/{chunk-P7VAMJFJ.js → chunk-ZE4HF3KC.js} +3 -3
- package/dist/data-display/Alert.js +4 -4
- package/dist/data-display/Banner.js +3 -3
- package/dist/data-display/CardKit.js +9 -9
- package/dist/data-display/DataViews.js +27 -27
- package/dist/feedback/ConfirmAction.js +2 -2
- package/dist/feedback/NotificationStatusNotice.js +6 -6
- package/dist/form/Button.js +1 -1
- package/dist/form/total-form.js +2 -2
- package/dist/layout/SettingCard.js +8 -8
- package/dist/native/chunks/{chunk-2MFMON74.js → chunk-EZHCNYQO.js} +67 -33
- package/dist/native/chunks/chunk-EZHCNYQO.js.map +1 -0
- package/dist/native/chunks/{chunk-H22XVP5O.js → chunk-TZPNJ4AU.js} +2 -2
- package/dist/native/data-display/Alert.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 +2 -2
- package/dist/social-login-button.js +2 -2
- package/dist/types/components/data-display/Alert/Alert.content.d.ts.map +1 -1
- package/dist/types/components/data-display/Alert/Alert.metrics.d.ts +2 -1
- package/dist/types/components/data-display/Alert/Alert.metrics.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.native.loading.d.ts +36 -0
- package/dist/types/components/form/Button/Button.native.loading.d.ts.map +1 -0
- package/dist/types-native/components/data-display/Alert/Alert.metrics.d.ts +2 -1
- package/dist/types-native/components/data-display/Alert/Alert.metrics.d.ts.map +1 -1
- package/dist/types-native/components/form/Button/Button.native.d.ts.map +1 -1
- package/dist/types-native/components/form/Button/Button.native.loading.d.ts +36 -0
- package/dist/types-native/components/form/Button/Button.native.loading.d.ts.map +1 -0
- package/dist/user-avatar.js +2 -2
- package/package.json +1 -1
- package/src/components/data-display/Alert/Alert.content.tsx +16 -5
- package/src/components/data-display/Alert/Alert.metrics.ts +2 -2
- package/src/components/form/Button/Button.md +4 -3
- package/src/components/form/Button/Button.native.loading.tsx +89 -0
- package/src/components/form/Button/Button.native.tsx +14 -24
- package/src/components/form/Button/Button.tsx +47 -16
- package/dist/chunk-364NH2NY.js.map +0 -1
- package/dist/chunk-IVI574Y5.js.map +0 -1
- package/dist/chunk-JNVUB2D4.js.map +0 -1
- package/dist/native/chunks/chunk-2MFMON74.js.map +0 -1
- /package/dist/{chunk-BF3SGOWT.js.map → chunk-2ONUSNPZ.js.map} +0 -0
- /package/dist/{chunk-ULK4AGG4.js.map → chunk-3EIRRLCQ.js.map} +0 -0
- /package/dist/{chunk-TVXUOJAL.js.map → chunk-4NG3LTRX.js.map} +0 -0
- /package/dist/{chunk-XZE5FIRB.js.map → chunk-5IIHAYFF.js.map} +0 -0
- /package/dist/{chunk-72L5C74V.js.map → chunk-5M7T36AT.js.map} +0 -0
- /package/dist/{chunk-J32XJALK.js.map → chunk-5WUXJDFP.js.map} +0 -0
- /package/dist/{chunk-3MQZBBUW.js.map → chunk-7FFY4LJY.js.map} +0 -0
- /package/dist/{chunk-ENXGWNCX.js.map → chunk-7LMR2H7O.js.map} +0 -0
- /package/dist/{chunk-H7QTDKA6.js.map → chunk-BGSUSSAV.js.map} +0 -0
- /package/dist/{chunk-FR2RJXHS.js.map → chunk-C2NNJMVY.js.map} +0 -0
- /package/dist/{chunk-NIZUFPV3.js.map → chunk-CW5Z67NA.js.map} +0 -0
- /package/dist/{chunk-BEHM2VLH.js.map → chunk-FVNY5BNV.js.map} +0 -0
- /package/dist/{chunk-X2SJJZFH.js.map → chunk-GG7IOJAG.js.map} +0 -0
- /package/dist/{chunk-J5QNJERV.js.map → chunk-HHFVDOA7.js.map} +0 -0
- /package/dist/{chunk-HVGQH54G.js.map → chunk-HMWSMRLM.js.map} +0 -0
- /package/dist/{chunk-MA6ENJDP.js.map → chunk-HXCUKZOB.js.map} +0 -0
- /package/dist/{chunk-CCJJTLF7.js.map → chunk-L5RS6QAT.js.map} +0 -0
- /package/dist/{chunk-ZSCKXOKE.js.map → chunk-NQCTANF3.js.map} +0 -0
- /package/dist/{chunk-NIENIKZ5.js.map → chunk-NRADSKGH.js.map} +0 -0
- /package/dist/{chunk-725H45MT.js.map → chunk-NZXRPWPW.js.map} +0 -0
- /package/dist/{chunk-LBEZ7A3F.js.map → chunk-OK3OJGJY.js.map} +0 -0
- /package/dist/{chunk-WJEJ65TF.js.map → chunk-OY437NRJ.js.map} +0 -0
- /package/dist/{chunk-QZX43FIC.js.map → chunk-QIP37Y2C.js.map} +0 -0
- /package/dist/{chunk-Y2CCXB7R.js.map → chunk-QITQFCFY.js.map} +0 -0
- /package/dist/{chunk-P4LR2GLN.js.map → chunk-R2ODLE6G.js.map} +0 -0
- /package/dist/{chunk-UFNXYOHZ.js.map → chunk-RCTHCXS6.js.map} +0 -0
- /package/dist/{chunk-VQSBZPKO.js.map → chunk-RVZMKGWQ.js.map} +0 -0
- /package/dist/{chunk-QWSYHENP.js.map → chunk-SKIAWOUC.js.map} +0 -0
- /package/dist/{chunk-3FDSXSEP.js.map → chunk-TDWA2XFJ.js.map} +0 -0
- /package/dist/{chunk-VWVA74JY.js.map → chunk-UXQVJXQ3.js.map} +0 -0
- /package/dist/{chunk-BEYLI32I.js.map → chunk-WOUJSKQB.js.map} +0 -0
- /package/dist/{chunk-NDQJDA7O.js.map → chunk-WULEQKU7.js.map} +0 -0
- /package/dist/{chunk-4QGPRORO.js.map → chunk-X2GWR75Q.js.map} +0 -0
- /package/dist/{chunk-NKBCUR4V.js.map → chunk-X3DN2BE3.js.map} +0 -0
- /package/dist/{chunk-B34WHRKH.js.map → chunk-XGKUXYAD.js.map} +0 -0
- /package/dist/{chunk-TRYYYWV3.js.map → chunk-Y2CHJLWD.js.map} +0 -0
- /package/dist/{chunk-QDG6V7OC.js.map → chunk-YNZUYZ2O.js.map} +0 -0
- /package/dist/{chunk-T2KONJ45.js.map → chunk-Z4ZFJ565.js.map} +0 -0
- /package/dist/{chunk-JA3WJPXH.js.map → chunk-ZAZOBTVS.js.map} +0 -0
- /package/dist/{chunk-SZSS5KKX.js.map → chunk-ZCXQ4ZB6.js.map} +0 -0
- /package/dist/{chunk-P7VAMJFJ.js.map → chunk-ZE4HF3KC.js.map} +0 -0
- /package/dist/native/chunks/{chunk-H22XVP5O.js.map → chunk-TZPNJ4AU.js.map} +0 -0
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "../chunk-IQU4HKND.js";
|
|
18
18
|
import {
|
|
19
19
|
AppHeaderDetails
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-RVZMKGWQ.js";
|
|
21
21
|
import "../chunk-7K23NEZO.js";
|
|
22
22
|
import "../chunk-5MMAV7XK.js";
|
|
23
23
|
import "../chunk-3ROCD7XF.js";
|
|
@@ -31,7 +31,7 @@ import "../chunk-Z2JH5KW5.js";
|
|
|
31
31
|
import "../chunk-AL5E624U.js";
|
|
32
32
|
import "../chunk-GYXUCS37.js";
|
|
33
33
|
import "../chunk-LV7LSPBF.js";
|
|
34
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-YOXYSAUI.js";
|
|
35
35
|
import "../chunk-PPEHBI5O.js";
|
|
36
36
|
import "../chunk-G2FUZALJ.js";
|
|
37
37
|
import "../chunk-TAMIZE4Q.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
GoogleIcon,
|
|
5
5
|
SocialLoginButton,
|
|
6
6
|
SocialLoginContainer
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-X3DN2BE3.js";
|
|
8
8
|
import "./chunk-INGPH3YQ.js";
|
|
9
9
|
import "./chunk-6GP2DOOO.js";
|
|
10
10
|
import "./chunk-GBVVI35T.js";
|
|
@@ -20,7 +20,7 @@ import "./chunk-FKUYRQSP.js";
|
|
|
20
20
|
import "./chunk-PLB6WWXW.js";
|
|
21
21
|
import "./chunk-HDBP55R3.js";
|
|
22
22
|
import "./chunk-BA4RHQ3B.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-YOXYSAUI.js";
|
|
24
24
|
import "./chunk-PPEHBI5O.js";
|
|
25
25
|
import "./chunk-G2FUZALJ.js";
|
|
26
26
|
import "./chunk-TAMIZE4Q.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.content.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Alert/Alert.content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQhD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,
|
|
1
|
+
{"version":3,"file":"Alert.content.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Alert/Alert.content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQhD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CA2DA,CAAC"}
|
|
@@ -54,9 +54,10 @@ export declare const DESCRIPTION: {
|
|
|
54
54
|
readonly fontSize: 14.8;
|
|
55
55
|
readonly opacity: 0.9;
|
|
56
56
|
};
|
|
57
|
-
/** The icon on the title's line (`iconPlacement: 'title'`): 10px from the title. */
|
|
57
|
+
/** The icon on the title's line (`iconPlacement: 'title'`): 10px from the title, centred on its first line (1.5). */
|
|
58
58
|
export declare const TITLE_ICON: {
|
|
59
59
|
readonly gapUnits: 1.25;
|
|
60
|
+
readonly lineHeight: 1.5;
|
|
60
61
|
};
|
|
61
62
|
/** The icon slot: MUI's 22px glyph at 0.9, 14px from the words, 2px down (MUI's 7px stays below). */
|
|
62
63
|
export declare const ICON_SLOT: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Alert/Alert.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEpF;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,mBAAmB;;;CAA6C,CAAC;AAC9E,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,YAAY,iCAAiC,CAAC;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,OAAO;;;;CAA8C,CAAC;AACnE,eAAO,MAAM,SAAS;;;;CAA4C,CAAC;AACnE,oEAAoE;AACpE,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,2FAA2F;AAC3F,eAAO,MAAM,cAAc;;;CAAsD,CAAC;AAElF,2GAA2G;AAC3G,eAAO,MAAM,KAAK;;;;;CAAsF,CAAC;AACzG,iDAAiD;AACjD,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AAErE,
|
|
1
|
+
{"version":3,"file":"Alert.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Alert/Alert.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEpF;;;;;;;;;;GAUG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AAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAIvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,gBAAgB,CAAC;AAkOnE;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAiB,eAAe,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { TextStyle } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* The native Button's loading state (FUT-3646): the label and icon stay laid
|
|
5
|
+
* out under the spinner — so the button keeps its width and shape — and the
|
|
6
|
+
* button keeps its name. Split from `Button.native.tsx` to keep that file
|
|
7
|
+
* under the line ceiling.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The spinner over the label while loading, across the whole button; `role`
|
|
11
|
+
* comes from react-native's ActivityIndicator. It used to REPLACE the label, so
|
|
12
|
+
* a loading button had no accessible name (FUT-3646).
|
|
13
|
+
*/
|
|
14
|
+
export declare function Spinner({ color, testID }: {
|
|
15
|
+
color: string;
|
|
16
|
+
testID: string;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* The button's name while loading: its text label, said outright. The label
|
|
20
|
+
* stays laid out (transparent) so the width holds, but a screen reader may skip
|
|
21
|
+
* a view at opacity 0 — VoiceOver does — so the name cannot ride on it alone.
|
|
22
|
+
* A caller's own `aria-label` still wins, being spread after this.
|
|
23
|
+
*/
|
|
24
|
+
export declare const loadingName: (loading: boolean | undefined, children: React.ReactNode) => string | undefined;
|
|
25
|
+
/** Laid out but unseen under the spinner while loading, so the width holds. */
|
|
26
|
+
export declare const hiddenWhile: (loading: boolean | undefined) => {
|
|
27
|
+
opacity: number;
|
|
28
|
+
} | null;
|
|
29
|
+
/** The text label; while loading, kept laid out but unseen under the spinner. */
|
|
30
|
+
export declare function Label({ loading, label, testID, children, }: {
|
|
31
|
+
loading: boolean | undefined;
|
|
32
|
+
label: TextStyle;
|
|
33
|
+
testID: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}): React.ReactNode;
|
|
36
|
+
//# sourceMappingURL=Button.native.loading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.native.loading.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.native.loading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C;;;;;GAKG;AAEH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAW/F;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,GAAG,SAAS,EAAE,UAAU,KAAK,CAAC,SAAS,KAAG,MAAM,GAAG,SACvD,CAAC;AAazC,+EAA+E;AAC/E,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,GAAG,SAAS;;QAAqC,CAAC;AAE9F,iFAAiF;AACjF,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,KAAK,CAAC,SAAS,CASlB"}
|
|
@@ -54,9 +54,10 @@ export declare const DESCRIPTION: {
|
|
|
54
54
|
readonly fontSize: 14.8;
|
|
55
55
|
readonly opacity: 0.9;
|
|
56
56
|
};
|
|
57
|
-
/** The icon on the title's line (`iconPlacement: 'title'`): 10px from the title. */
|
|
57
|
+
/** The icon on the title's line (`iconPlacement: 'title'`): 10px from the title, centred on its first line (1.5). */
|
|
58
58
|
export declare const TITLE_ICON: {
|
|
59
59
|
readonly gapUnits: 1.25;
|
|
60
|
+
readonly lineHeight: 1.5;
|
|
60
61
|
};
|
|
61
62
|
/** The icon slot: MUI's 22px glyph at 0.9, 14px from the words, 2px down (MUI's 7px stays below). */
|
|
62
63
|
export declare const ICON_SLOT: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Alert/Alert.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEpF;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,mBAAmB;;;CAA6C,CAAC;AAC9E,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,YAAY,iCAAiC,CAAC;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,OAAO;;;;CAA8C,CAAC;AACnE,eAAO,MAAM,SAAS;;;;CAA4C,CAAC;AACnE,oEAAoE;AACpE,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,2FAA2F;AAC3F,eAAO,MAAM,cAAc;;;CAAsD,CAAC;AAElF,2GAA2G;AAC3G,eAAO,MAAM,KAAK;;;;;CAAsF,CAAC;AACzG,iDAAiD;AACjD,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AAErE,
|
|
1
|
+
{"version":3,"file":"Alert.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Alert/Alert.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEpF;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,mBAAmB;;;CAA6C,CAAC;AAC9E,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,YAAY,iCAAiC,CAAC;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,OAAO;;;;CAA8C,CAAC;AACnE,eAAO,MAAM,SAAS;;;;CAA4C,CAAC;AACnE,oEAAoE;AACpE,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,2FAA2F;AAC3F,eAAO,MAAM,cAAc;;;CAAsD,CAAC;AAElF,2GAA2G;AAC3G,eAAO,MAAM,KAAK;;;;;CAAsF,CAAC;AACzG,iDAAiD;AACjD,eAAO,MAAM,WAAW;;;CAA4C,CAAC;AAErE,qHAAqH;AACrH,eAAO,MAAM,UAAU;;;CAA+C,CAAC;AACvE,qGAAqG;AACrG,eAAO,MAAM,SA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;CACnB;AAED,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAAqD,CAAC;AAE9G,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAUnF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAOzD;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAKjF;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAGnE;AAED,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAIvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAML,IAAI,EACJ,KAAK,qBAAqB,EAE1B,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAuQtB,eAAO,MAAM,MAAM;;;;;;8BAgDjB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { TextStyle } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* The native Button's loading state (FUT-3646): the label and icon stay laid
|
|
5
|
+
* out under the spinner — so the button keeps its width and shape — and the
|
|
6
|
+
* button keeps its name. Split from `Button.native.tsx` to keep that file
|
|
7
|
+
* under the line ceiling.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The spinner over the label while loading, across the whole button; `role`
|
|
11
|
+
* comes from react-native's ActivityIndicator. It used to REPLACE the label, so
|
|
12
|
+
* a loading button had no accessible name (FUT-3646).
|
|
13
|
+
*/
|
|
14
|
+
export declare function Spinner({ color, testID }: {
|
|
15
|
+
color: string;
|
|
16
|
+
testID: string;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* The button's name while loading: its text label, said outright. The label
|
|
20
|
+
* stays laid out (transparent) so the width holds, but a screen reader may skip
|
|
21
|
+
* a view at opacity 0 — VoiceOver does — so the name cannot ride on it alone.
|
|
22
|
+
* A caller's own `aria-label` still wins, being spread after this.
|
|
23
|
+
*/
|
|
24
|
+
export declare const loadingName: (loading: boolean | undefined, children: React.ReactNode) => string | undefined;
|
|
25
|
+
/** Laid out but unseen under the spinner while loading, so the width holds. */
|
|
26
|
+
export declare const hiddenWhile: (loading: boolean | undefined) => {
|
|
27
|
+
opacity: number;
|
|
28
|
+
} | null;
|
|
29
|
+
/** The text label; while loading, kept laid out but unseen under the spinner. */
|
|
30
|
+
export declare function Label({ loading, label, testID, children, }: {
|
|
31
|
+
loading: boolean | undefined;
|
|
32
|
+
label: TextStyle;
|
|
33
|
+
testID: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}): React.ReactNode;
|
|
36
|
+
//# sourceMappingURL=Button.native.loading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.native.loading.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Button/Button.native.loading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C;;;;;GAKG;AAEH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAW/F;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,GAAG,SAAS,EAAE,UAAU,KAAK,CAAC,SAAS,KAAG,MAAM,GAAG,SACvD,CAAC;AAazC,+EAA+E;AAC/E,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,GAAG,SAAS;;QAAqC,CAAC;AAE9F,iFAAiF;AACjF,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,KAAK,CAAC,SAAS,CASlB"}
|
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-TDWA2XFJ.js";
|
|
5
5
|
import "./chunk-UDQSIRAP.js";
|
|
6
6
|
import "./chunk-KARMRTTM.js";
|
|
7
7
|
import "./chunk-7XSCEHGA.js";
|
|
@@ -15,7 +15,7 @@ import "./chunk-FKUYRQSP.js";
|
|
|
15
15
|
import "./chunk-PLB6WWXW.js";
|
|
16
16
|
import "./chunk-HDBP55R3.js";
|
|
17
17
|
import "./chunk-BA4RHQ3B.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-YOXYSAUI.js";
|
|
19
19
|
import "./chunk-PPEHBI5O.js";
|
|
20
20
|
import "./chunk-G2FUZALJ.js";
|
|
21
21
|
import "./chunk-TAMIZE4Q.js";
|
package/package.json
CHANGED
|
@@ -35,9 +35,11 @@ export const AlertContent: React.FC<{
|
|
|
35
35
|
sx={{
|
|
36
36
|
fontWeight: TITLE.fontWeight,
|
|
37
37
|
fontSize: sxRem(TITLE.fontSize),
|
|
38
|
-
// On the icon's row
|
|
39
|
-
//
|
|
40
|
-
...(titleIcon
|
|
38
|
+
// On the icon's row MUI's 2px lift would push the title off the glyph,
|
|
39
|
+
// and the line height is stated so the glyph can be centred on it.
|
|
40
|
+
...(titleIcon
|
|
41
|
+
? { margin: 0, lineHeight: TITLE_ICON.lineHeight }
|
|
42
|
+
: { marginBottom: description ? TITLE.marginBottomUnits : 0 }),
|
|
41
43
|
...BREAK_WORDS,
|
|
42
44
|
}}
|
|
43
45
|
>
|
|
@@ -52,10 +54,19 @@ export const AlertContent: React.FC<{
|
|
|
52
54
|
data-testid={testIdFor(dataTestId, 'title-row')}
|
|
53
55
|
sx={{
|
|
54
56
|
display: 'flex',
|
|
55
|
-
|
|
57
|
+
// The FIRST line, not the block: a title that wraps to three lines
|
|
58
|
+
// on a phone would otherwise float its icon beside the second.
|
|
59
|
+
alignItems: 'flex-start',
|
|
56
60
|
gap: TITLE_ICON.gapUnits,
|
|
57
61
|
marginBottom: description ? TITLE.marginBottomUnits : 0,
|
|
58
|
-
'& > span': {
|
|
62
|
+
'& > span': {
|
|
63
|
+
display: 'flex',
|
|
64
|
+
flex: 'none',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
fontSize: sxRem(ICON_SLOT.size),
|
|
67
|
+
// One title line tall, so the glyph is centred on that line.
|
|
68
|
+
height: sxRem(TITLE.fontSize * TITLE_ICON.lineHeight),
|
|
69
|
+
},
|
|
59
70
|
}}
|
|
60
71
|
>
|
|
61
72
|
{titleIcon}
|
|
@@ -40,8 +40,8 @@ export const TITLE = { fontSize: 16.8, fontWeight: 600, marginTop: -2, marginBot
|
|
|
40
40
|
/** The description: 0.925rem, slightly faded. */
|
|
41
41
|
export const DESCRIPTION = { fontSize: 14.8, opacity: 0.9 } as const;
|
|
42
42
|
|
|
43
|
-
/** The icon on the title's line (`iconPlacement: 'title'`): 10px from the title. */
|
|
44
|
-
export const TITLE_ICON = { gapUnits: 1.25 } as const;
|
|
43
|
+
/** The icon on the title's line (`iconPlacement: 'title'`): 10px from the title, centred on its first line (1.5). */
|
|
44
|
+
export const TITLE_ICON = { gapUnits: 1.25, lineHeight: 1.5 } as const;
|
|
45
45
|
/** The icon slot: MUI's 22px glyph at 0.9, 14px from the words, 2px down (MUI's 7px stays below). */
|
|
46
46
|
export const ICON_SLOT = { size: 22, opacity: 0.9, marginRightUnits: 1.75, paddingTopUnits: 0.25, paddingBottom: 7 } as const;
|
|
47
47
|
/** The action slot: MUI's `4px 0 0 16px` with the 16px ours, pushed right, 8px into the padding. */
|
|
@@ -10,11 +10,11 @@ The Button component is a versatile and highly customizable interactive element
|
|
|
10
10
|
- **Color Themes**: primary, secondary, success, warning, info, danger, neutral
|
|
11
11
|
- **Size Options**: xs, sm, md, lg, xl
|
|
12
12
|
- **Special Effects**: glow, pulse animations
|
|
13
|
-
- **Loading States**: Built-in loading spinner
|
|
13
|
+
- **Loading States**: Built-in loading spinner over the label, which stays as the button's accessible name
|
|
14
14
|
- **Icon Support**: Leading icons with automatic loading state handling
|
|
15
15
|
- **Renders As Anything**: `component` swaps the element, carrying that
|
|
16
16
|
component's own props through the types (a router link, an `<a>`, a label)
|
|
17
|
-
- **Accessibility**:
|
|
17
|
+
- **Accessibility**: Native `<button>` semantics, keyboard navigation; a loading button keeps its name and sets `aria-busy`
|
|
18
18
|
- **Responsive Design**: Adapts to different screen sizes
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
@@ -56,7 +56,7 @@ import { Button } from '@procurement/ui';
|
|
|
56
56
|
| `variant` | `'solid' \| 'outline' \| 'ghost' \| 'text' \| 'glass' \| 'gradient'` | `'solid'` | Visual style variant |
|
|
57
57
|
| `color` | `'primary' \| 'secondary' \| 'success' \| 'warning' \| 'info' \| 'danger' \| 'neutral'` | `'primary'` | Color theme |
|
|
58
58
|
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Button size |
|
|
59
|
-
| `loading` | `boolean` | `false` | Shows loading spinner
|
|
59
|
+
| `loading` | `boolean` | `false` | Shows loading spinner over the label, sets `aria-busy`, disables button |
|
|
60
60
|
| `disabled` | `boolean` | `false` | Disables button interaction |
|
|
61
61
|
| `icon` | `ReactNode` | - | Icon element to display before text |
|
|
62
62
|
| `glow` | `boolean` | `false` | Adds glow visual effect |
|
|
@@ -274,6 +274,7 @@ The Button component includes comprehensive test IDs for reliable automated test
|
|
|
274
274
|
| Button | `{dataTestId}` or `'button'` | Main button element |
|
|
275
275
|
| Icon | `{dataTestId}-icon` or `'button-icon'` | Icon wrapper when icon prop provided |
|
|
276
276
|
| Loading Spinner | `{dataTestId}-loading` or `'button-loading'` | Circular progress during loading state |
|
|
277
|
+
| Loading Label | `{dataTestId}-busy-label` or `'button-busy-label'` | The label kept, transparent, under the spinner while loading |
|
|
277
278
|
|
|
278
279
|
### Testing Best Practices
|
|
279
280
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ActivityIndicator, Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import type { TextStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { BUTTON_SPINNER_SIZE } from './Button.metrics';
|
|
6
|
+
import { renderTextChildren } from '../../../platform/text-children';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The native Button's loading state (FUT-3646): the label and icon stay laid
|
|
10
|
+
* out under the spinner — so the button keeps its width and shape — and the
|
|
11
|
+
* button keeps its name. Split from `Button.native.tsx` to keep that file
|
|
12
|
+
* under the line ceiling.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The spinner over the label while loading, across the whole button; `role`
|
|
17
|
+
* comes from react-native's ActivityIndicator. It used to REPLACE the label, so
|
|
18
|
+
* a loading button had no accessible name (FUT-3646).
|
|
19
|
+
*/
|
|
20
|
+
export function Spinner({ color, testID }: { color: string; testID: string }): React.JSX.Element {
|
|
21
|
+
return (
|
|
22
|
+
<View style={styles.spinner}>
|
|
23
|
+
<ActivityIndicator
|
|
24
|
+
size={Platform.OS === 'ios' ? 'small' : BUTTON_SPINNER_SIZE}
|
|
25
|
+
color={color}
|
|
26
|
+
testID={testID}
|
|
27
|
+
accessibilityLabel="loading"
|
|
28
|
+
/>
|
|
29
|
+
</View>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The button's name while loading: its text label, said outright. The label
|
|
35
|
+
* stays laid out (transparent) so the width holds, but a screen reader may skip
|
|
36
|
+
* a view at opacity 0 — VoiceOver does — so the name cannot ride on it alone.
|
|
37
|
+
* A caller's own `aria-label` still wins, being spread after this.
|
|
38
|
+
*/
|
|
39
|
+
export const loadingName = (loading: boolean | undefined, children: React.ReactNode): string | undefined =>
|
|
40
|
+
loading ? textOf(children) : undefined;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The text of a label made only of strings and numbers — `Salvar`, or
|
|
44
|
+
* `Salvar {n}`, which React hands over as an array. Anything else (an element)
|
|
45
|
+
* has no text to say here, so the name is left to the label itself.
|
|
46
|
+
*/
|
|
47
|
+
function textOf(children: React.ReactNode): string | undefined {
|
|
48
|
+
const parts = React.Children.toArray(children);
|
|
49
|
+
const textual = parts.every((part) => typeof part === 'string' || typeof part === 'number');
|
|
50
|
+
return textual && parts.length > 0 ? parts.join('') : undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Laid out but unseen under the spinner while loading, so the width holds. */
|
|
54
|
+
export const hiddenWhile = (loading: boolean | undefined) => (loading ? styles.hidden : null);
|
|
55
|
+
|
|
56
|
+
/** The text label; while loading, kept laid out but unseen under the spinner. */
|
|
57
|
+
export function Label({
|
|
58
|
+
loading,
|
|
59
|
+
label,
|
|
60
|
+
testID,
|
|
61
|
+
children,
|
|
62
|
+
}: {
|
|
63
|
+
loading: boolean | undefined;
|
|
64
|
+
label: TextStyle;
|
|
65
|
+
testID: string;
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
}): React.ReactNode {
|
|
68
|
+
const text = renderTextChildren(children, label, 1);
|
|
69
|
+
return loading ? (
|
|
70
|
+
<View style={styles.hidden} testID={testID}>
|
|
71
|
+
{text}
|
|
72
|
+
</View>
|
|
73
|
+
) : (
|
|
74
|
+
text
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
// The label and icon under the spinner: laid out, so the width holds, but unseen.
|
|
80
|
+
hidden: {
|
|
81
|
+
opacity: 0,
|
|
82
|
+
},
|
|
83
|
+
spinner: {
|
|
84
|
+
...StyleSheet.absoluteFillObject,
|
|
85
|
+
pointerEvents: 'none',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
justifyContent: 'center',
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
ActivityIndicator,
|
|
4
3
|
Animated,
|
|
5
4
|
Easing,
|
|
6
5
|
Platform,
|
|
@@ -20,7 +19,6 @@ import {
|
|
|
20
19
|
BUTTON_ICON_GAP_UNITS,
|
|
21
20
|
BUTTON_LINE_HEIGHT,
|
|
22
21
|
BUTTON_SIZES,
|
|
23
|
-
BUTTON_SPINNER_SIZE,
|
|
24
22
|
BUTTON_WASH_ALPHA,
|
|
25
23
|
GLASS_BACKGROUND_ALPHA,
|
|
26
24
|
GLASS_BACKGROUND_ALPHA_PRESSED,
|
|
@@ -35,7 +33,7 @@ import {
|
|
|
35
33
|
quietInk,
|
|
36
34
|
} from './Button.metrics';
|
|
37
35
|
import type { ButtonProps, ButtonVariant } from './Button.types.native';
|
|
38
|
-
import {
|
|
36
|
+
import { hiddenWhile, Label, loadingName, Spinner } from './Button.native.loading';
|
|
39
37
|
import { childTestId, resolveTestId, withoutTestIdProps } from '../../../platform/test-id';
|
|
40
38
|
import { useUiTheme } from '../../../provider/use-ui-theme.native';
|
|
41
39
|
import { resolveFieldEdge } from '../../../tokens/field-edge.core';
|
|
@@ -238,7 +236,8 @@ interface ButtonLook {
|
|
|
238
236
|
function buttonLook(theme: UiTheme, props: ResolvedProps): ButtonLook {
|
|
239
237
|
const { variant, color, size, loading, icon, children, glow, pulse, active, disabled, style } = props;
|
|
240
238
|
const palette = buttonPalette(theme, color);
|
|
241
|
-
|
|
239
|
+
// Loading keeps the icon (transparent), so it changes neither the shape nor the gap (FUT-3646).
|
|
240
|
+
const iconOnly = icon != null && children == null;
|
|
242
241
|
const inactive = Boolean(disabled) || loading;
|
|
243
242
|
const paint = inactive ? disabledPaint(theme, variant) : paintFor(theme, variant, color, palette, active);
|
|
244
243
|
// The theme's one field radius, so a button and the input beside it agree.
|
|
@@ -248,7 +247,7 @@ function buttonLook(theme: UiTheme, props: ResolvedProps): ButtonLook {
|
|
|
248
247
|
// ring turns it visible; on native the glow's shadow needs it visible too,
|
|
249
248
|
// because a view's own shadow is clipped by its own overflow there.
|
|
250
249
|
const overflow: ViewStyle['overflow'] = pulse || glow ? 'visible' : 'hidden';
|
|
251
|
-
const sized = sizeStyle(theme, size, iconOnly, icon != null
|
|
250
|
+
const sized = sizeStyle(theme, size, iconOnly, icon != null);
|
|
252
251
|
const glowing = glow && !inactive ? glowStyle(palette) : null;
|
|
253
252
|
|
|
254
253
|
return {
|
|
@@ -275,18 +274,6 @@ function buttonLook(theme: UiTheme, props: ResolvedProps): ButtonLook {
|
|
|
275
274
|
};
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
/** The spinner that replaces the label while loading; `role` comes from react-native's ActivityIndicator. */
|
|
279
|
-
function Spinner({ color, testID }: { color: string; testID: string }): React.JSX.Element {
|
|
280
|
-
return (
|
|
281
|
-
<ActivityIndicator
|
|
282
|
-
size={Platform.OS === 'ios' ? 'small' : BUTTON_SPINNER_SIZE}
|
|
283
|
-
color={color}
|
|
284
|
-
testID={testID}
|
|
285
|
-
accessibilityLabel="loading"
|
|
286
|
-
/>
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
277
|
export const Button = React.forwardRef<View, ButtonProps>((rawProps, ref) => {
|
|
291
278
|
const resolved = resolveButtonProps(rawProps);
|
|
292
279
|
const { loading, icon, iconPosition, pulse, ripple, children, onClick, onPress, ...others } = resolved;
|
|
@@ -306,12 +293,11 @@ export const Button = React.forwardRef<View, ButtonProps>((rawProps, ref) => {
|
|
|
306
293
|
onPress?.(event);
|
|
307
294
|
};
|
|
308
295
|
|
|
309
|
-
const iconNode =
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
) : null;
|
|
296
|
+
const iconNode = icon ? (
|
|
297
|
+
<View style={[styles.icon, hiddenWhile(loading)]} testID={idFor('icon')}>
|
|
298
|
+
{icon}
|
|
299
|
+
</View>
|
|
300
|
+
) : null;
|
|
315
301
|
|
|
316
302
|
return (
|
|
317
303
|
<Pressable
|
|
@@ -319,6 +305,7 @@ export const Button = React.forwardRef<View, ButtonProps>((rawProps, ref) => {
|
|
|
319
305
|
role="button"
|
|
320
306
|
aria-disabled={look.inactive}
|
|
321
307
|
aria-busy={loading}
|
|
308
|
+
aria-label={loadingName(loading, children)}
|
|
322
309
|
disabled={look.inactive}
|
|
323
310
|
onPress={handlePress}
|
|
324
311
|
android_ripple={ripple && !look.inactive ? { color: alpha(look.palette.main, 0.2), borderless: false } : undefined}
|
|
@@ -328,8 +315,11 @@ export const Button = React.forwardRef<View, ButtonProps>((rawProps, ref) => {
|
|
|
328
315
|
>
|
|
329
316
|
{pulse && !look.inactive ? <Pulse color={look.palette.main} radius={look.radius} testID={idFor('pulse')} /> : null}
|
|
330
317
|
{iconPosition === 'left' ? iconNode : null}
|
|
331
|
-
{loading
|
|
318
|
+
<Label loading={loading} label={look.label} testID={idFor('busy-label')}>
|
|
319
|
+
{children}
|
|
320
|
+
</Label>
|
|
332
321
|
{iconPosition === 'right' ? iconNode : null}
|
|
322
|
+
{loading ? <Spinner color={look.label.color as string} testID={idFor('loading')} /> : null}
|
|
333
323
|
</Pressable>
|
|
334
324
|
);
|
|
335
325
|
});
|
|
@@ -100,20 +100,44 @@ const muiColorFor = (color: NonNullable<ButtonProps['color']>): MuiButtonColor =
|
|
|
100
100
|
*/
|
|
101
101
|
const iconGlyphStyle = (theme: Theme) => ({ fontSize: rem(theme, BUTTON_ICON_GLYPH_SIZE) });
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* The label while the button loads (FUT-3646): still in the DOM and in the
|
|
105
|
+
* accessibility tree, only transparent. The spinner used to REPLACE it, which
|
|
106
|
+
* left the button with no accessible name — a screen reader on it heard just
|
|
107
|
+
* "button, dimmed" — and let it shrink to the spinner's width mid-press.
|
|
108
|
+
*
|
|
109
|
+
* `opacity`, never `visibility: hidden` or `display: none`: those two take the
|
|
110
|
+
* text out of the accessibility tree, which is the bug again.
|
|
111
|
+
*/
|
|
112
|
+
const LOADING_LABEL_STYLE: React.CSSProperties = { opacity: 0 };
|
|
113
|
+
|
|
114
|
+
/** The spinner, centred over the label it stands in for. */
|
|
115
|
+
const LOADING_SPINNER_STYLE: React.CSSProperties = {
|
|
116
|
+
position: 'absolute',
|
|
117
|
+
inset: 0,
|
|
118
|
+
display: 'flex',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
justifyContent: 'center',
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The icon slot while loading keeps its glyph, transparent like the label
|
|
125
|
+
* (FUT-3646): dropping it made an icon-and-label button jump 28px narrower the
|
|
126
|
+
* moment it started loading, and a square icon button turn into a 64px slab.
|
|
127
|
+
*/
|
|
128
|
+
const iconSlotStyle = (theme: Theme, loading: boolean | undefined): React.CSSProperties =>
|
|
129
|
+
loading ? { ...iconGlyphStyle(theme), ...LOADING_LABEL_STYLE } : iconGlyphStyle(theme);
|
|
130
|
+
|
|
103
131
|
/**
|
|
104
132
|
* An icon and nothing else — the shape that should render square.
|
|
105
133
|
*
|
|
106
134
|
* A separate predicate rather than three clauses inline: the component function
|
|
107
135
|
* is already at the complexity ceiling, and "what counts as an icon button" is
|
|
108
|
-
* a rule worth naming anyway.
|
|
109
|
-
*
|
|
136
|
+
* a rule worth naming anyway. Loading does not change it: the icon stays,
|
|
137
|
+
* transparent under the spinner, so the button keeps its square.
|
|
110
138
|
*/
|
|
111
|
-
function isIconOnly({
|
|
112
|
-
|
|
113
|
-
icon,
|
|
114
|
-
children,
|
|
115
|
-
}: Pick<ButtonProps, 'loading' | 'icon' | 'children'>): boolean {
|
|
116
|
-
return !loading && icon != null && children == null;
|
|
139
|
+
function isIconOnly({ icon, children }: Pick<ButtonProps, 'icon' | 'children'>): boolean {
|
|
140
|
+
return icon != null && children == null;
|
|
117
141
|
}
|
|
118
142
|
|
|
119
143
|
/**
|
|
@@ -163,15 +187,14 @@ const ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
163
187
|
const theme = useTheme();
|
|
164
188
|
|
|
165
189
|
// Wrap icon with testId if provided
|
|
166
|
-
const iconWithTestId =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
) : undefined;
|
|
190
|
+
const iconWithTestId = icon ? (
|
|
191
|
+
<span data-testid={testId('icon')} style={iconSlotStyle(theme, loading)}>
|
|
192
|
+
{icon}
|
|
193
|
+
</span>
|
|
194
|
+
) : undefined;
|
|
172
195
|
|
|
173
196
|
// Only an icon, so the button is a square rather than a 64px slab.
|
|
174
|
-
const iconOnly = isIconOnly({
|
|
197
|
+
const iconOnly = isIconOnly({ icon, children });
|
|
175
198
|
|
|
176
199
|
const mergedClassName =
|
|
177
200
|
[active ? 'active' : '', props.className].filter(Boolean).join(' ') || undefined;
|
|
@@ -188,6 +211,7 @@ const ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
188
211
|
pulse={pulse}
|
|
189
212
|
ripple={ripple}
|
|
190
213
|
disabled={disabled || loading}
|
|
214
|
+
aria-busy={loading ? true : undefined}
|
|
191
215
|
disableRipple={!ripple}
|
|
192
216
|
startIcon={iconPosition === 'left' ? iconWithTestId : undefined}
|
|
193
217
|
endIcon={iconPosition === 'right' ? iconWithTestId : undefined}
|
|
@@ -200,7 +224,14 @@ const ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
200
224
|
className={mergedClassName}
|
|
201
225
|
>
|
|
202
226
|
{loading ? (
|
|
203
|
-
|
|
227
|
+
<>
|
|
228
|
+
<span style={LOADING_LABEL_STYLE} data-testid={testId('busy-label')}>
|
|
229
|
+
{children}
|
|
230
|
+
</span>
|
|
231
|
+
<span style={LOADING_SPINNER_STYLE}>
|
|
232
|
+
<CircularProgress size={rem(theme, 16)} color="inherit" data-testid={testId('loading')} />
|
|
233
|
+
</span>
|
|
234
|
+
</>
|
|
204
235
|
) : (
|
|
205
236
|
children
|
|
206
237
|
)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/form/Button/Button.tsx"],"sourcesContent":["import MuiButton from '@mui/material/Button/index.js';\nimport CircularProgress from '@mui/material/CircularProgress/index.js';\nimport { styled, useTheme } from '@mui/material/styles/index.js';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport * as React from 'react';\n\nimport { resolveButtonProps } from './Button.helpers';\nimport { BUTTON_ICON_GLYPH_SIZE } from './Button.metrics';\nimport { childTestId, resolveTestId, withoutTestIdProps } from '../../../platform/test-id';\nimport { fieldRadius } from '../../../tokens/field-radius';\nimport { rem } from '../../../tokens/relative';\nimport {\n buttonEmphasisStyles,\n buttonVariantStyles,\n getColorFromTheme,\n iconAlignmentStyles,\n buttonSize,\n} from './Button.styles';\nimport type { ButtonComponent, ButtonProps } from './Button.types';\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) =>\n ['glow', 'pulse', 'loading', 'customVariant', 'customColor', 'ripple'].indexOf(\n prop as string,\n ) === -1,\n})<{\n customVariant?: string;\n customColor?: string;\n glow?: boolean;\n pulse?: boolean;\n ripple?: boolean;\n}>(({ theme, customVariant, customColor = 'primary', glow, pulse }) => {\n const colorPalette = getColorFromTheme(theme, customColor);\n\n return {\n textTransform: 'none',\n fontWeight: 500,\n borderRadius: fieldRadius(theme),\n transition: 'all 0.3s ease',\n position: 'relative',\n overflow: 'hidden',\n ...iconAlignmentStyles(theme),\n ...buttonVariantStyles(theme, customVariant, colorPalette, customColor),\n ...buttonEmphasisStyles(theme, colorPalette, glow, pulse),\n };\n});\n\n/** Our six variants collapse onto MUI's three; only outline and text differ. */\nconst muiVariantFor = (variant?: string): 'outlined' | 'text' | 'contained' => {\n if (variant === 'outline') return 'outlined';\n return variant === 'text' ? 'text' : 'contained';\n};\n\ntype MuiButtonColor = 'inherit' | 'primary' | 'secondary' | 'success' | 'warning' | 'info' | 'error';\n\n/**\n * Our five sizes collapse onto MUI's three, so the rendered class NAMES the\n * size the button actually is (12-74).\n *\n * It was never forwarded, so every button — `xs` through `xl` — carried\n * `MuiButton-sizeMedium`. The pixels were right (they come from `buttonSize`'s\n * `sx`, which still decides them) but the DOM said \"medium\" about a large\n * button: a test could never assert the size, and devtools lied to whoever\n * opened them.\n *\n * MUI's own size styles are padding, font-size and the icon glyph. The first\n * two are overridden by that same `sx`; the third is pinned by\n * `BUTTON_ICON_GLYPH_SIZE`, so forwarding this moves nothing on screen.\n */\nconst muiSizeFor = (size: NonNullable<ButtonProps['size']>): 'small' | 'medium' | 'large' => {\n if (size === 'xs' || size === 'sm') return 'small';\n return size === 'md' ? 'medium' : 'large';\n};\n\n/** `danger` and `neutral` are ours; the rest are MUI's own names already. */\nconst muiColorFor = (color: NonNullable<ButtonProps['color']>): MuiButtonColor => {\n if (color === 'danger') return 'error';\n return color === 'neutral' ? 'inherit' : color;\n};\n\n/**\n * The icon slot's font-size, pinned on the wrapper this component already owns\n * (12-74).\n *\n * MUI writes 18/20/22 there off its own `size`, and that prop is now forwarded,\n * so a glyph that takes its size by INHERITANCE would start moving with the\n * button — measured at 18px on `xs` and 22px on `lg` against the 20px every\n * size has always drawn. See {@link BUTTON_ICON_GLYPH_SIZE} for what that does\n * and does not reach.\n *\n * Written as an inline style rather than a selector in `sx` because MUI's own\n * rule sits on the start/end-icon span itself. Beating it from the root means\n * winning a specificity contest at a distance — true in a browser, but not\n * something a test can hold, since jsdom resolves `getComputedStyle` by\n * document order and never by specificity. Inline wins both, and it sits on the\n * one element we already render for this glyph.\n *\n * Through the theme's type scale (FUT-2594): `1.25rem` at MUI's defaults, which\n * is the 20px MUI was emitting before at a 16px root.\n */\nconst iconGlyphStyle = (theme: Theme) => ({ fontSize: rem(theme, BUTTON_ICON_GLYPH_SIZE) });\n\n/**\n * An icon and nothing else — the shape that should render square.\n *\n * A separate predicate rather than three clauses inline: the component function\n * is already at the complexity ceiling, and \"what counts as an icon button\" is\n * a rule worth naming anyway. `loading` disqualifies, because a spinner\n * replaces the children and would otherwise make every loading button square.\n */\nfunction isIconOnly({\n loading,\n icon,\n children,\n}: Pick<ButtonProps, 'loading' | 'icon' | 'children'>): boolean {\n return !loading && icon != null && children == null;\n}\n\n/**\n * The design system's button.\n *\n * Typed as an `OverridableComponent` (12-70) rather than a plain `forwardRef`,\n * which is how MUI models a component that can render as something else. The\n * practical difference is one line at a call site:\n *\n * ```tsx\n * <Button component={Link} to=\"/account/compras/42\">Acompanhar pedido</Button>\n * ```\n *\n * `to` is typed here because the generic carries the target component's own\n * props through. A plain `component?: React.ElementType` — what this was —\n * accepts the component and throws its props away, so `to` typechecked\n * nowhere even though it arrived intact at runtime. A host wanting a router\n * navigation painted as a button had to choose between a type assertion and\n * losing the `href`; both were shipped, and both are the reason this ticket\n * exists.\n */\nconst ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (rawProps, ref) => {\n const {\n variant,\n color,\n size,\n loading,\n icon,\n iconPosition,\n glow,\n pulse,\n ripple,\n active,\n children,\n disabled,\n onClick,\n onFocus,\n onBlur,\n ...others\n } = resolveButtonProps(rawProps);\n // Every spelling of the test id the shared contract allows, mapped to the\n // one the DOM reads; the native Button does the same in reverse.\n const ownTestId = resolveTestId(others, 'button');\n const testId = (suffix: string) => childTestId(others, suffix, 'button');\n const props = withoutTestIdProps(others);\n const theme = useTheme();\n\n // Wrap icon with testId if provided\n const iconWithTestId =\n !loading && icon ? (\n <span data-testid={testId('icon')} style={iconGlyphStyle(theme)}>\n {icon}\n </span>\n ) : undefined;\n\n // Only an icon, so the button is a square rather than a 64px slab.\n const iconOnly = isIconOnly({ loading, icon, children });\n\n const mergedClassName =\n [active ? 'active' : '', props.className].filter(Boolean).join(' ') || undefined;\n\n return (\n <StyledButton\n ref={ref}\n variant={muiVariantFor(variant)}\n color={muiColorFor(color)}\n size={muiSizeFor(size)}\n customVariant={variant}\n customColor={color}\n glow={glow}\n pulse={pulse}\n ripple={ripple}\n disabled={disabled || loading}\n disableRipple={!ripple}\n startIcon={iconPosition === 'left' ? iconWithTestId : undefined}\n endIcon={iconPosition === 'right' ? iconWithTestId : undefined}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n sx={buttonSize(size, iconOnly)}\n data-testid={ownTestId}\n {...props}\n className={mergedClassName}\n >\n {loading ? (\n <CircularProgress size={rem(theme, 16)} color=\"inherit\" data-testid={testId('loading')} />\n ) : (\n children\n )}\n </StyledButton>\n );\n },\n);\n\nButtonRoot.displayName = 'Button';\n\n/**\n * The cast is what publishes the generic — `forwardRef` cannot express\n * \"renders as C, and takes C's props\" on its own, so MUI's own components do\n * exactly this. `ButtonRoot` above is the implementation and is not exported.\n */\nexport const Button = ButtonRoot as ButtonComponent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe;AACtB,OAAO,sBAAsB;AAC7B,SAAS,QAAQ,gBAAgB;AAEjC,YAAY,WAAW;AAmKf;A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"sourcesContent":["import AlertTitle from '@mui/material/AlertTitle/index.js';\nimport Box from '@mui/material/Box/index.js';\nimport React from 'react';\n\nimport { sxRem } from '../../../tokens/relative';\n\nimport { testIdFor } from './Alert.helpers';\nimport { DESCRIPTION, ICON_SLOT, TITLE, TITLE_ICON } from './Alert.metrics';\nimport type { AlertProps } from './Alert.types';\n\nconst BREAK_WORDS = {\n wordWrap: 'break-word',\n overflowWrap: 'break-word',\n wordBreak: 'break-word',\n} as const;\n\n/**\n * The message column: title, description, then whatever the caller put inside.\n *\n * `titleIcon` is the icon when it sits on the title's line\n * (`iconPlacement: 'title'`, see `Alert.placement.ts`). The title then shares\n * a row with it, and the description below is a sibling of that row — so it\n * starts at the column's own edge rather than under the title's first letter.\n */\nexport const AlertContent: React.FC<{\n title?: AlertProps['title'];\n description?: AlertProps['description'];\n titleIcon?: React.ReactNode;\n dataTestId?: string;\n children?: React.ReactNode;\n}> = ({ title, description, titleIcon, dataTestId, children }) => {\n const heading = title ? (\n <AlertTitle\n data-testid={testIdFor(dataTestId, 'title')}\n sx={{\n fontWeight: TITLE.fontWeight,\n fontSize: sxRem(TITLE.fontSize),\n // On the icon's row the title is centred against the glyph, so MUI's\n // 2px lift would only push it off that centre.\n ...(titleIcon ? { margin: 0 } : { marginBottom: description ? TITLE.marginBottomUnits : 0 }),\n ...BREAK_WORDS,\n }}\n >\n {title}\n </AlertTitle>\n ) : null;\n\n return (\n <>\n {titleIcon && heading ? (\n <Box\n data-testid={testIdFor(dataTestId, 'title-row')}\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: TITLE_ICON.gapUnits,\n marginBottom: description ? TITLE.marginBottomUnits : 0,\n '& > span': { display: 'flex', flex: 'none', fontSize: sxRem(ICON_SLOT.size) },\n }}\n >\n {titleIcon}\n {heading}\n </Box>\n ) : (\n heading\n )}\n {description && (\n <Box\n component=\"div\"\n data-testid={testIdFor(dataTestId, 'message')}\n sx={{ opacity: DESCRIPTION.opacity, fontSize: sxRem(DESCRIP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