@12-apps/ui 6.93.1 → 6.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/AsyncStateContainer/AsyncStateContainer.js +3 -3
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +5 -5
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +4 -4
- package/dist/_internal/components/data-display/ErrorState/ErrorState.js +2 -2
- package/dist/_internal/components/data-display/ErrorState/ErrorState.metrics.js +3 -1
- package/dist/_internal/components/data-display/index.js +3 -3
- package/dist/_internal/components/form/CepField/CepField.js +3 -3
- package/dist/_internal/components/form/Input/Input.factory.js +1 -1
- package/dist/_internal/components/form/Input/Input.js +2 -2
- package/dist/_internal/components/form/NumberField/NumberField.js +3 -3
- package/dist/_internal/components/form/index.js +5 -5
- package/dist/_internal/components/form/total-form/Fields/CepField.js +4 -4
- package/dist/_internal/components/form/total-form/Fields/TextField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/index.js +7 -7
- package/dist/_internal/components/index.js +8 -8
- package/dist/{chunk-BR3WBTTQ.js → chunk-3ODEBPGT.js} +3 -3
- package/dist/{chunk-I4DG3PP4.js → chunk-43EFQ3DU.js} +2 -2
- package/dist/{chunk-FXECKKPW.js → chunk-ASBFGGJB.js} +6 -1
- package/dist/chunk-ASBFGGJB.js.map +1 -0
- package/dist/{chunk-3IX2TP4I.js → chunk-GB7NTXL2.js} +2 -2
- package/dist/{chunk-HBH7V3IP.js → chunk-I6IFUFLW.js} +5 -3
- package/dist/chunk-I6IFUFLW.js.map +1 -0
- package/dist/{chunk-YGWLMTPB.js → chunk-KXVWH3JM.js} +2 -2
- package/dist/{chunk-TLGGVE56.js → chunk-OTVOQHZB.js} +3 -1
- package/dist/{chunk-TLGGVE56.js.map → chunk-OTVOQHZB.js.map} +1 -1
- package/dist/{chunk-7F6D73NL.js → chunk-RLTGD5WJ.js} +2 -2
- package/dist/{chunk-GXGHEOWC.js → chunk-USHVG4UQ.js} +2 -2
- package/dist/{chunk-2GDPZ53K.js → chunk-UTWEHMAP.js} +2 -2
- package/dist/{chunk-4JNC5AEF.js → chunk-WGKBZ7DN.js} +2 -2
- package/dist/{chunk-ASEHJIIV.js → chunk-Y3FYOKWF.js} +2 -2
- package/dist/{chunk-RHVJ3L4U.js → chunk-ZJY7OK6H.js} +2 -2
- package/dist/{chunk-LABIUXDM.js → chunk-ZYXXAWDF.js} +2 -2
- package/dist/data-display/AsyncStateContainer.js +3 -3
- package/dist/data-display/DataViews.js +5 -5
- package/dist/data-display/ErrorState.js +2 -2
- package/dist/form/CepField.js +3 -3
- package/dist/form/Input/outlined.js +2 -2
- package/dist/form/Input.js +2 -2
- package/dist/form/NumberField.js +3 -3
- package/dist/form/total-form.js +7 -7
- package/dist/native/data-display/ErrorState.js.map +1 -1
- package/dist/types/components/data-display/ErrorState/ErrorState.d.ts.map +1 -1
- package/dist/types/components/data-display/ErrorState/ErrorState.metrics.d.ts +5 -0
- package/dist/types/components/data-display/ErrorState/ErrorState.metrics.d.ts.map +1 -1
- package/dist/types/components/form/Input/Input.factory.d.ts.map +1 -1
- package/dist/types/components/form/Input/Input.types.d.ts +3 -2
- package/dist/types/components/form/Input/Input.types.d.ts.map +1 -1
- package/dist/types-native/components/data-display/ErrorState/ErrorState.metrics.d.ts +5 -0
- package/dist/types-native/components/data-display/ErrorState/ErrorState.metrics.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/ErrorState/ErrorState.metrics.ts +5 -0
- package/src/components/data-display/ErrorState/ErrorState.tsx +2 -0
- package/src/components/form/Input/Input.factory.tsx +12 -0
- package/src/components/form/Input/Input.types.ts +3 -2
- package/dist/chunk-FXECKKPW.js.map +0 -1
- package/dist/chunk-HBH7V3IP.js.map +0 -1
- /package/dist/{chunk-BR3WBTTQ.js.map → chunk-3ODEBPGT.js.map} +0 -0
- /package/dist/{chunk-I4DG3PP4.js.map → chunk-43EFQ3DU.js.map} +0 -0
- /package/dist/{chunk-3IX2TP4I.js.map → chunk-GB7NTXL2.js.map} +0 -0
- /package/dist/{chunk-YGWLMTPB.js.map → chunk-KXVWH3JM.js.map} +0 -0
- /package/dist/{chunk-7F6D73NL.js.map → chunk-RLTGD5WJ.js.map} +0 -0
- /package/dist/{chunk-GXGHEOWC.js.map → chunk-USHVG4UQ.js.map} +0 -0
- /package/dist/{chunk-2GDPZ53K.js.map → chunk-UTWEHMAP.js.map} +0 -0
- /package/dist/{chunk-4JNC5AEF.js.map → chunk-WGKBZ7DN.js.map} +0 -0
- /package/dist/{chunk-ASEHJIIV.js.map → chunk-Y3FYOKWF.js.map} +0 -0
- /package/dist/{chunk-RHVJ3L4U.js.map → chunk-ZJY7OK6H.js.map} +0 -0
- /package/dist/{chunk-LABIUXDM.js.map → chunk-ZYXXAWDF.js.map} +0 -0
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
ViewDialogs,
|
|
16
16
|
ViewMutationErrorAlert
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-USHVG4UQ.js";
|
|
18
18
|
import {
|
|
19
19
|
useSavedViewsController
|
|
20
20
|
} from "./chunk-B2JSUFDX.js";
|
|
@@ -166,4 +166,4 @@ function renderViewDialogs(ctl, fields, columns, views, testIdPrefix, onSaved) {
|
|
|
166
166
|
export {
|
|
167
167
|
DataViewsTableBase
|
|
168
168
|
};
|
|
169
|
-
//# sourceMappingURL=chunk-
|
|
169
|
+
//# sourceMappingURL=chunk-Y3FYOKWF.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZLMKGVB2.js";
|
|
4
4
|
import {
|
|
5
5
|
createInput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ASBFGGJB.js";
|
|
7
7
|
|
|
8
8
|
// src/components/form/Input/Input.tsx
|
|
9
9
|
var Input = createInput(TextFieldSlim);
|
|
@@ -11,4 +11,4 @@ var Input = createInput(TextFieldSlim);
|
|
|
11
11
|
export {
|
|
12
12
|
Input
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-ZJY7OK6H.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-Q4JWWTL4.js";
|
|
8
8
|
import {
|
|
9
9
|
Input
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZJY7OK6H.js";
|
|
11
11
|
|
|
12
12
|
// src/components/form/NumberField/NumberField.tsx
|
|
13
13
|
import React, { useCallback, useId } from "react";
|
|
@@ -82,4 +82,4 @@ NumberField.displayName = "NumberField";
|
|
|
82
82
|
export {
|
|
83
83
|
NumberField
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-ZYXXAWDF.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-SX3E6UC2.js";
|
|
2
2
|
import {
|
|
3
3
|
AsyncStateContainer
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-RLTGD5WJ.js";
|
|
5
|
+
import "../chunk-I6IFUFLW.js";
|
|
6
|
+
import "../chunk-OTVOQHZB.js";
|
|
7
7
|
import "../chunk-3Z6JX7UN.js";
|
|
8
8
|
import "../chunk-7DFEKTT7.js";
|
|
9
9
|
import "../chunk-YSTHOE66.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../chunk-MBMZNSBP.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsTableBase
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-Y3FYOKWF.js";
|
|
7
7
|
import "../chunk-YNVTUQ5B.js";
|
|
8
8
|
import {
|
|
9
9
|
DataViewsGrid
|
|
@@ -65,8 +65,8 @@ import "../chunk-WSAUWJFO.js";
|
|
|
65
65
|
import "../chunk-YLGY3D52.js";
|
|
66
66
|
import "../chunk-4NG3LTRX.js";
|
|
67
67
|
import "../chunk-2MT6VSS2.js";
|
|
68
|
-
import "../chunk-
|
|
69
|
-
import "../chunk-
|
|
68
|
+
import "../chunk-USHVG4UQ.js";
|
|
69
|
+
import "../chunk-43EFQ3DU.js";
|
|
70
70
|
import "../chunk-VNMD6BA4.js";
|
|
71
71
|
import "../chunk-5M4TYFR3.js";
|
|
72
72
|
import "../chunk-7CUZTWKW.js";
|
|
@@ -145,7 +145,7 @@ import "../chunk-SZS7VZJN.js";
|
|
|
145
145
|
import "../chunk-L6YTVXGN.js";
|
|
146
146
|
import "../chunk-SUTOAW7I.js";
|
|
147
147
|
import "../chunk-QYKDY4EI.js";
|
|
148
|
-
import "../chunk-
|
|
148
|
+
import "../chunk-ZJY7OK6H.js";
|
|
149
149
|
import "../chunk-ZLMKGVB2.js";
|
|
150
150
|
import "../chunk-BO6S47KI.js";
|
|
151
151
|
import "../chunk-FYAW5GBF.js";
|
|
@@ -180,7 +180,7 @@ import "../chunk-RZVUY2MO.js";
|
|
|
180
180
|
import "../chunk-VPGDYI63.js";
|
|
181
181
|
import "../chunk-DMNZD3Q7.js";
|
|
182
182
|
import "../chunk-PN4HVM43.js";
|
|
183
|
-
import "../chunk-
|
|
183
|
+
import "../chunk-ASBFGGJB.js";
|
|
184
184
|
import "../chunk-PD7MKJCM.js";
|
|
185
185
|
import "../chunk-KLJYIS5L.js";
|
|
186
186
|
import "../chunk-SJRTT3PA.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../chunk-UCYU56FO.js";
|
|
2
2
|
import {
|
|
3
3
|
ErrorState
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-I6IFUFLW.js";
|
|
5
|
+
import "../chunk-OTVOQHZB.js";
|
|
6
6
|
import "../chunk-XOXXG7Q5.js";
|
|
7
7
|
import "../chunk-TYJR4GOF.js";
|
|
8
8
|
import "../chunk-YKCAJ2TN.js";
|
package/dist/form/CepField.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-6XLMTOJ3.js";
|
|
2
2
|
import {
|
|
3
3
|
CepField
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-UTWEHMAP.js";
|
|
5
|
+
import "../chunk-WGKBZ7DN.js";
|
|
6
|
+
import "../chunk-ASBFGGJB.js";
|
|
7
7
|
import "../chunk-PD7MKJCM.js";
|
|
8
8
|
import "../chunk-KLJYIS5L.js";
|
|
9
9
|
import "../chunk-C3UKR3NT.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Input
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-WGKBZ7DN.js";
|
|
4
|
+
import "../../chunk-ASBFGGJB.js";
|
|
5
5
|
import "../../chunk-PD7MKJCM.js";
|
|
6
6
|
import "../../chunk-KLJYIS5L.js";
|
|
7
7
|
import "../../chunk-LZRVUOMU.js";
|
package/dist/form/Input.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-QYKDY4EI.js";
|
|
2
2
|
import {
|
|
3
3
|
Input
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZJY7OK6H.js";
|
|
5
5
|
import "../chunk-ZLMKGVB2.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-ASBFGGJB.js";
|
|
7
7
|
import "../chunk-PD7MKJCM.js";
|
|
8
8
|
import "../chunk-KLJYIS5L.js";
|
|
9
9
|
import "../chunk-EEB66IVH.js";
|
package/dist/form/NumberField.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../chunk-HALFOXSZ.js";
|
|
2
2
|
import {
|
|
3
3
|
NumberField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZYXXAWDF.js";
|
|
5
5
|
import "../chunk-Q4JWWTL4.js";
|
|
6
6
|
import "../chunk-QYKDY4EI.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZJY7OK6H.js";
|
|
8
8
|
import "../chunk-ZLMKGVB2.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-ASBFGGJB.js";
|
|
10
10
|
import "../chunk-PD7MKJCM.js";
|
|
11
11
|
import "../chunk-KLJYIS5L.js";
|
|
12
12
|
import "../chunk-EEB66IVH.js";
|
package/dist/form/total-form.js
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
} from "../chunk-CPAJYJUD.js";
|
|
10
10
|
import {
|
|
11
11
|
Fields_exports
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-3ODEBPGT.js";
|
|
13
13
|
import {
|
|
14
14
|
TextField
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-GB7NTXL2.js";
|
|
16
16
|
import {
|
|
17
17
|
SelectField
|
|
18
18
|
} from "../chunk-6YSGP2WS.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-KXVWH3JM.js";
|
|
20
20
|
import {
|
|
21
21
|
CategoryField
|
|
22
22
|
} from "../chunk-NQ6P7O7C.js";
|
|
@@ -34,12 +34,12 @@ import "../chunk-OQW4OERS.js";
|
|
|
34
34
|
import "../chunk-6VTOGR36.js";
|
|
35
35
|
import "../chunk-IYC7NPX7.js";
|
|
36
36
|
import "../chunk-6XLMTOJ3.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-UTWEHMAP.js";
|
|
38
|
+
import "../chunk-WGKBZ7DN.js";
|
|
39
39
|
import "../chunk-JD5BVIM7.js";
|
|
40
40
|
import "../chunk-T77OVQEO.js";
|
|
41
41
|
import "../chunk-QYKDY4EI.js";
|
|
42
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-ZJY7OK6H.js";
|
|
43
43
|
import "../chunk-ZLMKGVB2.js";
|
|
44
44
|
import "../chunk-N5ZWC6CB.js";
|
|
45
45
|
import "../chunk-TSID4257.js";
|
|
@@ -58,7 +58,7 @@ import "../chunk-RZVUY2MO.js";
|
|
|
58
58
|
import "../chunk-VPGDYI63.js";
|
|
59
59
|
import "../chunk-DMNZD3Q7.js";
|
|
60
60
|
import "../chunk-PN4HVM43.js";
|
|
61
|
-
import "../chunk-
|
|
61
|
+
import "../chunk-ASBFGGJB.js";
|
|
62
62
|
import "../chunk-PD7MKJCM.js";
|
|
63
63
|
import "../chunk-KLJYIS5L.js";
|
|
64
64
|
import "../chunk-C3UKR3NT.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/data-display/ErrorState/ErrorState.native.tsx","../../../src/components/data-display/ErrorState/ErrorState.metrics.ts"],"sourcesContent":["import * as React from 'react';\nimport { StyleSheet, Text as RNText, View, type TextStyle, type ViewStyle } from 'react-native';\n\nimport {\n ERROR_ICON_BOX,\n ERROR_ICON_BOX_OPACITY,\n ERROR_ICON_SIZE,\n ERROR_MESSAGE_LINE_HEIGHT,\n ERROR_MESSAGE_MAX_WIDTH,\n ERROR_STATE_GAP_UNITS,\n ERROR_STATE_MIN_HEIGHT,\n ERROR_STATE_PADDING_UNITS,\n ERROR_TEXT_GAP_UNITS,\n RETRY_BUTTON,\n RETRY_MARGIN_TOP_UNITS,\n RETRY_MIN_WIDTH,\n errorStatePalette,\n} from './ErrorState.metrics';\nimport type { ErrorStateProps, ErrorStateSeverity } from './ErrorState.types.native';\nimport { Icon } from '../../../icons/Icon.native';\nimport { webAria } from '../../../platform/aria';\nimport { resolveTestId, withoutTestIdProps } from '../../../platform/test-id';\nimport { useUiTheme } from '../../../provider/use-ui-theme.native';\nimport { MUI_FONT_WEIGHT_MEDIUM, MUI_TYPE, muiTypeStyle } from '../../../tokens/mui-type';\nimport type { UiTheme } from '../../../tokens/theme';\nimport { Button } from '../../form/Button/Button.native';\nimport { EN_US_UI_LABELS } from '../../../en-US.labels';\n\nconst makeTestId =\n (dataTestId?: string) =>\n (suffix: string): string =>\n dataTestId ? `${dataTestId}-${suffix}` : `error-state-${suffix}`;\n\n/** MUI's `h6` as an `h3`, medium weight, in the body ink — what the web `Typography` renders. */\nexport function titleStyle(theme: UiTheme): TextStyle {\n return {\n ...muiTypeStyle(theme, 'h6'),\n fontWeight: `${MUI_FONT_WEIGHT_MEDIUM}`,\n color: theme.palette.text.primary,\n textAlign: 'center',\n };\n}\n\n/** MUI's `body2` on a 1.6 line height, muted, wrapping at 400px. */\nexport function messageStyle(theme: UiTheme): TextStyle {\n return {\n ...muiTypeStyle(theme, 'body2'),\n lineHeight: MUI_TYPE.body2.fontSize * ERROR_MESSAGE_LINE_HEIGHT,\n color: theme.palette.text.secondary,\n maxWidth: ERROR_MESSAGE_MAX_WIDTH,\n textAlign: 'center',\n };\n}\n\n/** The 80px disc behind the glyph, in the severity's `light` shade. */\nexport function iconBoxStyle(theme: UiTheme, severity: ErrorStateSeverity): ViewStyle {\n return {\n width: ERROR_ICON_BOX,\n height: ERROR_ICON_BOX,\n borderRadius: ERROR_ICON_BOX / 2,\n backgroundColor: errorStatePalette(theme, severity).light,\n opacity: ERROR_ICON_BOX_OPACITY,\n alignItems: 'center',\n justifyContent: 'center',\n };\n}\n\n/** The web retry is MUI's medium outlined button; the house `Button` is sized to it here. */\nexport function retryStyle(theme: UiTheme): ViewStyle {\n return {\n marginTop: theme.spacing(RETRY_MARGIN_TOP_UNITS),\n minWidth: RETRY_MIN_WIDTH,\n paddingVertical: RETRY_BUTTON.paddingVertical,\n paddingHorizontal: RETRY_BUTTON.paddingHorizontal,\n borderRadius: theme.radius.md,\n };\n}\n\nfunction ErrorIcon({\n severity,\n icon,\n testId,\n}: {\n severity: ErrorStateSeverity;\n icon?: React.ReactNode;\n testId: string;\n}): React.JSX.Element {\n const theme = useUiTheme();\n const glyph = severity === 'error' ? 'ErrorOutline' : 'WarningAmber';\n return (\n <View testID={testId} style={iconBoxStyle(theme, severity)}>\n {icon || <Icon name={glyph} size={ERROR_ICON_SIZE} color={errorStatePalette(theme, severity).main} />}\n </View>\n );\n}\n\nfunction ErrorText({\n title,\n message,\n titleId,\n testId,\n}: {\n title?: string;\n message: string;\n titleId: string;\n testId: (suffix: string) => string;\n}): React.JSX.Element {\n const theme = useUiTheme();\n return (\n <View style={[styles.text, { gap: theme.spacing(ERROR_TEXT_GAP_UNITS) }]}>\n {title ? (\n <RNText\n id={titleId}\n role=\"heading\"\n {...webAria({ 'aria-level': 3 })}\n testID={testId('title')}\n style={titleStyle(theme)}\n >\n {title}\n </RNText>\n ) : null}\n <RNText id={`${titleId}-message`} testID={testId('message')} style={messageStyle(theme)}>\n {message}\n </RNText>\n </View>\n );\n}\n\nexport const ErrorState: React.FC<ErrorStateProps> = React.memo(function ErrorState(props) {\n const {\n message,\n title,\n onRetry,\n retryLabel = EN_US_UI_LABELS.errorState.retry,\n severity = 'error',\n icon,\n style,\n ...others\n } = props;\n const theme = useUiTheme();\n const titleId = React.useId();\n const dataTestId = resolveTestId(others);\n const testId = makeTestId(dataTestId);\n const rest = withoutTestIdProps(others);\n\n return (\n <View\n role=\"alert\"\n aria-labelledby={title ? titleId : undefined}\n {...webAria({ 'aria-describedby': `${titleId}-message` })}\n testID={dataTestId || 'error-state'}\n style={[\n styles.root,\n {\n padding: theme.spacing(ERROR_STATE_PADDING_UNITS),\n minHeight: ERROR_STATE_MIN_HEIGHT,\n gap: theme.spacing(ERROR_STATE_GAP_UNITS),\n },\n style,\n ]}\n {...rest}\n >\n <ErrorIcon severity={severity} icon={icon} testId={testId('icon')} />\n\n <ErrorText title={title} message={message} titleId={titleId} testId={testId} />\n\n {onRetry ? (\n <Button\n variant=\"outline\"\n color={severity === 'error' ? 'danger' : 'warning'}\n size=\"sm\"\n icon={<Icon name=\"Refresh\" size={RETRY_BUTTON.iconSize} color={severity === 'error' ? 'danger' : 'warning'} />}\n onClick={onRetry}\n testID={testId('retry-button')}\n style={retryStyle(theme)}\n >\n {retryLabel}\n </Button>\n ) : null}\n </View>\n );\n});\n\nErrorState.displayName = 'ErrorState';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n text: {\n alignItems: 'center',\n },\n});\n","import type { ErrorStateSeverity } from './ErrorState.base';\nimport type { UiPaletteColor, UiTheme } from '../../../tokens/theme';\n\n/**\n * THE NUMBERS BOTH `ErrorState` RENDERERS DRAW WITH.\n *\n * `ErrorState.tsx` (MUI) and `ErrorState.native.tsx` (React Native) read this\n * one table. Spacing is in SPACING UNITS where the web writes\n * `theme.spacing(n)`; everything else is px or a ratio.\n */\n\n/** The region: a centred column, `theme.spacing(6)` of padding, at least 200px tall, its parts 16px apart. */\nexport const ERROR_STATE_PADDING_UNITS = 6;\nexport const ERROR_STATE_MIN_HEIGHT = 200;\nexport const ERROR_STATE_GAP_UNITS = 2;\n\n/** The glyph sits in an 80px disc of the severity's `light` shade at 0.9 opacity. */\nexport const ERROR_ICON_BOX = 80;\nexport const ERROR_ICON_BOX_OPACITY = 0.9;\nexport const ERROR_ICON_SIZE = 48;\n\n/** Title and message are 8px apart; the message wraps at 400px on a 1.6 line height. */\nexport const ERROR_TEXT_GAP_UNITS = 1;\nexport const ERROR_MESSAGE_MAX_WIDTH = 400;\nexport const ERROR_MESSAGE_LINE_HEIGHT = 1.6;\n\n/** The retry button: 8px below the text, no narrower than 120px. */\nexport const RETRY_MARGIN_TOP_UNITS = 1;\nexport const RETRY_MIN_WIDTH = 120;\n/**\n * The web retry IS MUI's medium outlined `Button`: 5px 15px inside its 1px\n * border, 14px type, the theme's radius, a 20px start icon. The native side\n * sizes the house `Button` to these.\n */\nexport const RETRY_BUTTON = {\n paddingVertical: 5,\n paddingHorizontal: 15,\n iconSize: 20,\n} as const;\n\n/** `error` is MUI's name for the `danger` slot; `warning` is its own. */\nexport function errorStatePalette(theme: UiTheme, severity: ErrorStateSeverity): UiPaletteColor {\n return severity === 'error' ? theme.palette.danger : theme.palette.warning;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY,QAAQ,QAAQ,YAA4C;;;ACW1E,IAAM,4BAA4B;AAClC,IAAM,yBAAyB;AAC/B,IAAM,wBAAwB;AAG9B,IAAM,iBAAiB;AACvB,IAAM,yBAAyB;AAC/B,IAAM,kBAAkB;AAGxB,IAAM,uBAAuB;AAC7B,IAAM,0BAA0B;AAChC,IAAM,4BAA4B;AAGlC,IAAM,yBAAyB;AAC/B,IAAM,kBAAkB;AAMxB,IAAM,eAAe;AAAA,EAC1B,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,UAAU;AACZ;AAGO,SAAS,kBAAkB,OAAgB,UAA8C;AAC9F,SAAO,aAAa,UAAU,MAAM,QAAQ,SAAS,MAAM,QAAQ;AACrE;;;ADgDe,cAkBX,YAlBW;AA/Df,IAAM,aACJ,CAAC,eACD,CAAC,WACC,aAAa,GAAG,UAAU,IAAI,MAAM,KAAK,eAAe,MAAM;AAG3D,SAAS,WAAW,OAA2B;AACpD,SAAO;AAAA,IACL,GAAG,aAAa,OAAO,IAAI;AAAA,IAC3B,YAAY,GAAG,sBAAsB;AAAA,IACrC,OAAO,MAAM,QAAQ,KAAK;AAAA,IAC1B,WAAW;AAAA,EACb;AACF;AAGO,SAAS,aAAa,OAA2B;AACtD,SAAO;AAAA,IACL,GAAG,aAAa,OAAO,OAAO;AAAA,IAC9B,YAAY,SAAS,MAAM,WAAW;AAAA,IACtC,OAAO,MAAM,QAAQ,KAAK;AAAA,IAC1B,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF;AAGO,SAAS,aAAa,OAAgB,UAAyC;AACpF,SAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,cAAc,iBAAiB;AAAA,IAC/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;AAAA,EACd;AACF,CAAC;","names":["ErrorState"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/data-display/ErrorState/ErrorState.native.tsx","../../../src/components/data-display/ErrorState/ErrorState.metrics.ts"],"sourcesContent":["import * as React from 'react';\nimport { StyleSheet, Text as RNText, View, type TextStyle, type ViewStyle } from 'react-native';\n\nimport {\n ERROR_ICON_BOX,\n ERROR_ICON_BOX_OPACITY,\n ERROR_ICON_SIZE,\n ERROR_MESSAGE_LINE_HEIGHT,\n ERROR_MESSAGE_MAX_WIDTH,\n ERROR_STATE_GAP_UNITS,\n ERROR_STATE_MIN_HEIGHT,\n ERROR_STATE_PADDING_UNITS,\n ERROR_TEXT_GAP_UNITS,\n RETRY_BUTTON,\n RETRY_MARGIN_TOP_UNITS,\n RETRY_MIN_WIDTH,\n errorStatePalette,\n} from './ErrorState.metrics';\nimport type { ErrorStateProps, ErrorStateSeverity } from './ErrorState.types.native';\nimport { Icon } from '../../../icons/Icon.native';\nimport { webAria } from '../../../platform/aria';\nimport { resolveTestId, withoutTestIdProps } from '../../../platform/test-id';\nimport { useUiTheme } from '../../../provider/use-ui-theme.native';\nimport { MUI_FONT_WEIGHT_MEDIUM, MUI_TYPE, muiTypeStyle } from '../../../tokens/mui-type';\nimport type { UiTheme } from '../../../tokens/theme';\nimport { Button } from '../../form/Button/Button.native';\nimport { EN_US_UI_LABELS } from '../../../en-US.labels';\n\nconst makeTestId =\n (dataTestId?: string) =>\n (suffix: string): string =>\n dataTestId ? `${dataTestId}-${suffix}` : `error-state-${suffix}`;\n\n/** MUI's `h6` as an `h3`, medium weight, in the body ink — what the web `Typography` renders. */\nexport function titleStyle(theme: UiTheme): TextStyle {\n return {\n ...muiTypeStyle(theme, 'h6'),\n fontWeight: `${MUI_FONT_WEIGHT_MEDIUM}`,\n color: theme.palette.text.primary,\n textAlign: 'center',\n };\n}\n\n/** MUI's `body2` on a 1.6 line height, muted, wrapping at 400px. */\nexport function messageStyle(theme: UiTheme): TextStyle {\n return {\n ...muiTypeStyle(theme, 'body2'),\n lineHeight: MUI_TYPE.body2.fontSize * ERROR_MESSAGE_LINE_HEIGHT,\n color: theme.palette.text.secondary,\n maxWidth: ERROR_MESSAGE_MAX_WIDTH,\n textAlign: 'center',\n };\n}\n\n/** The 80px disc behind the glyph, in the severity's `light` shade. */\nexport function iconBoxStyle(theme: UiTheme, severity: ErrorStateSeverity): ViewStyle {\n return {\n width: ERROR_ICON_BOX,\n height: ERROR_ICON_BOX,\n borderRadius: ERROR_ICON_BOX / 2,\n backgroundColor: errorStatePalette(theme, severity).light,\n opacity: ERROR_ICON_BOX_OPACITY,\n alignItems: 'center',\n justifyContent: 'center',\n };\n}\n\n/** The web retry is MUI's medium outlined button; the house `Button` is sized to it here. */\nexport function retryStyle(theme: UiTheme): ViewStyle {\n return {\n marginTop: theme.spacing(RETRY_MARGIN_TOP_UNITS),\n minWidth: RETRY_MIN_WIDTH,\n paddingVertical: RETRY_BUTTON.paddingVertical,\n paddingHorizontal: RETRY_BUTTON.paddingHorizontal,\n borderRadius: theme.radius.md,\n };\n}\n\nfunction ErrorIcon({\n severity,\n icon,\n testId,\n}: {\n severity: ErrorStateSeverity;\n icon?: React.ReactNode;\n testId: string;\n}): React.JSX.Element {\n const theme = useUiTheme();\n const glyph = severity === 'error' ? 'ErrorOutline' : 'WarningAmber';\n return (\n <View testID={testId} style={iconBoxStyle(theme, severity)}>\n {icon || <Icon name={glyph} size={ERROR_ICON_SIZE} color={errorStatePalette(theme, severity).main} />}\n </View>\n );\n}\n\nfunction ErrorText({\n title,\n message,\n titleId,\n testId,\n}: {\n title?: string;\n message: string;\n titleId: string;\n testId: (suffix: string) => string;\n}): React.JSX.Element {\n const theme = useUiTheme();\n return (\n <View style={[styles.text, { gap: theme.spacing(ERROR_TEXT_GAP_UNITS) }]}>\n {title ? (\n <RNText\n id={titleId}\n role=\"heading\"\n {...webAria({ 'aria-level': 3 })}\n testID={testId('title')}\n style={titleStyle(theme)}\n >\n {title}\n </RNText>\n ) : null}\n <RNText id={`${titleId}-message`} testID={testId('message')} style={messageStyle(theme)}>\n {message}\n </RNText>\n </View>\n );\n}\n\nexport const ErrorState: React.FC<ErrorStateProps> = React.memo(function ErrorState(props) {\n const {\n message,\n title,\n onRetry,\n retryLabel = EN_US_UI_LABELS.errorState.retry,\n severity = 'error',\n icon,\n style,\n ...others\n } = props;\n const theme = useUiTheme();\n const titleId = React.useId();\n const dataTestId = resolveTestId(others);\n const testId = makeTestId(dataTestId);\n const rest = withoutTestIdProps(others);\n\n return (\n <View\n role=\"alert\"\n aria-labelledby={title ? titleId : undefined}\n {...webAria({ 'aria-describedby': `${titleId}-message` })}\n testID={dataTestId || 'error-state'}\n style={[\n styles.root,\n {\n padding: theme.spacing(ERROR_STATE_PADDING_UNITS),\n minHeight: ERROR_STATE_MIN_HEIGHT,\n gap: theme.spacing(ERROR_STATE_GAP_UNITS),\n },\n style,\n ]}\n {...rest}\n >\n <ErrorIcon severity={severity} icon={icon} testId={testId('icon')} />\n\n <ErrorText title={title} message={message} titleId={titleId} testId={testId} />\n\n {onRetry ? (\n <Button\n variant=\"outline\"\n color={severity === 'error' ? 'danger' : 'warning'}\n size=\"sm\"\n icon={<Icon name=\"Refresh\" size={RETRY_BUTTON.iconSize} color={severity === 'error' ? 'danger' : 'warning'} />}\n onClick={onRetry}\n testID={testId('retry-button')}\n style={retryStyle(theme)}\n >\n {retryLabel}\n </Button>\n ) : null}\n </View>\n );\n});\n\nErrorState.displayName = 'ErrorState';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n text: {\n alignItems: 'center',\n },\n});\n","import type { ErrorStateSeverity } from './ErrorState.base';\nimport type { UiPaletteColor, UiTheme } from '../../../tokens/theme';\n\n/**\n * THE NUMBERS BOTH `ErrorState` RENDERERS DRAW WITH.\n *\n * `ErrorState.tsx` (MUI) and `ErrorState.native.tsx` (React Native) read this\n * one table. Spacing is in SPACING UNITS where the web writes\n * `theme.spacing(n)`; everything else is px or a ratio.\n */\n\n/** The region: a centred column, `theme.spacing(6)` of padding, at least 200px tall, its parts 16px apart. */\nexport const ERROR_STATE_PADDING_UNITS = 6;\nexport const ERROR_STATE_MIN_HEIGHT = 200;\nexport const ERROR_STATE_GAP_UNITS = 2;\n\n/** The glyph sits in an 80px disc of the severity's `light` shade at 0.9 opacity. */\nexport const ERROR_ICON_BOX = 80;\nexport const ERROR_ICON_BOX_OPACITY = 0.9;\nexport const ERROR_ICON_SIZE = 48;\n\n/** Title and message are 8px apart; the message wraps at 400px on a 1.6 line height. */\nexport const ERROR_TEXT_GAP_UNITS = 1;\nexport const ERROR_MESSAGE_MAX_WIDTH = 400;\nexport const ERROR_MESSAGE_LINE_HEIGHT = 1.6;\n\n/** The retry button: 8px below the text, no narrower than 120px. */\nexport const RETRY_MARGIN_TOP_UNITS = 1;\nexport const RETRY_MIN_WIDTH = 120;\n/**\n * The web retry is never shorter than the 40px tap floor. MUI's medium outlined\n * button is 37px tall on its own (FUT-1310), so the floor is stated, not inherited.\n */\nexport const RETRY_MIN_HEIGHT = 40;\n/**\n * The web retry IS MUI's medium outlined `Button`: 5px 15px inside its 1px\n * border, 14px type, the theme's radius, a 20px start icon. The native side\n * sizes the house `Button` to these.\n */\nexport const RETRY_BUTTON = {\n paddingVertical: 5,\n paddingHorizontal: 15,\n iconSize: 20,\n} as const;\n\n/** `error` is MUI's name for the `danger` slot; `warning` is its own. */\nexport function errorStatePalette(theme: UiTheme, severity: ErrorStateSeverity): UiPaletteColor {\n return severity === 'error' ? theme.palette.danger : theme.palette.warning;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY,QAAQ,QAAQ,YAA4C;;;ACW1E,IAAM,4BAA4B;AAClC,IAAM,yBAAyB;AAC/B,IAAM,wBAAwB;AAG9B,IAAM,iBAAiB;AACvB,IAAM,yBAAyB;AAC/B,IAAM,kBAAkB;AAGxB,IAAM,uBAA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AAE,oBAAoB,GAAG,OAAO,WAAW,CAAC;AAAA,MACxD,QAAQ,cAAc;AAAA,MACtB,OAAO;AAAA,QACL,OAAO;AAAA,QACP;AAAA,UACE,SAAS,MAAM,QAAQ,yBAAyB;AAAA,UAChD,WAAW;AAAA,UACX,KAAK,MAAM,QAAQ,qBAAqB;AAAA,QAC1C;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,aAAU,UAAoB,MAAY,QAAQ,OAAO,MAAM,GAAG;AAAA,QAEnE,oBAAC,aAAU,OAAc,SAAkB,SAAkB,QAAgB;AAAA,QAE5E,UACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAO,aAAa,UAAU,WAAW;AAAA,YACzC,MAAK;AAAA,YACL,MAAM,oBAAC,QAAK,MAAK,WAAU,MAAM,aAAa,UAAU,OAAO,aAAa,UAAU,WAAW,WAAW;AAAA,YAC5G,SAAS;AAAA,YACT,QAAQ,OAAO,cAAc;AAAA,YAC7B,OAAO,WAAW,KAAK;AAAA,YAEtB;AAAA;AAAA,QACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,WAAW,cAAc;AAEzB,IAAM,SAAS,WAAW,OAAO;AAAA,EAC/B,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,gBAAgB;AAAA,EAClB;AAAA,EACA,MAAM;AAAA,IACJ,YAAY;AAAA,EACd;AACF,CAAC;","names":["ErrorState"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/ErrorState/ErrorState.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorState.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/ErrorState/ErrorState.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,oBAAoB,CAAC;AAkF9E,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyD/C,CAAC;AAIH,eAAe,UAAU,CAAC"}
|
|
@@ -22,6 +22,11 @@ export declare const ERROR_MESSAGE_LINE_HEIGHT = 1.6;
|
|
|
22
22
|
/** The retry button: 8px below the text, no narrower than 120px. */
|
|
23
23
|
export declare const RETRY_MARGIN_TOP_UNITS = 1;
|
|
24
24
|
export declare const RETRY_MIN_WIDTH = 120;
|
|
25
|
+
/**
|
|
26
|
+
* The web retry is never shorter than the 40px tap floor. MUI's medium outlined
|
|
27
|
+
* button is 37px tall on its own (FUT-1310), so the floor is stated, not inherited.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RETRY_MIN_HEIGHT = 40;
|
|
25
30
|
/**
|
|
26
31
|
* The web retry IS MUI's medium outlined `Button`: 5px 15px inside its 1px
|
|
27
32
|
* border, 14px type, the theme's radius, a 20px start icon. The native side
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/ErrorState/ErrorState.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AAEH,8GAA8G;AAC9G,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,qFAAqF;AACrF,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,GAAG,cAAc,CAE9F"}
|
|
1
|
+
{"version":3,"file":"ErrorState.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/ErrorState/ErrorState.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AAEH,8GAA8G;AAC9G,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,qFAAqF;AACrF,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,GAAG,cAAc,CAE9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.factory.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Input/Input.factory.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAaxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.factory.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Input/Input.factory.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAaxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAsMhD,iDAAiD;AACjD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,KAAK,CAAC,yBAAyB,CAC7F,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAC1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,sBAAsB,GAAG,cAAc,CAI7E"}
|
|
@@ -29,8 +29,9 @@ export interface InputProps extends InputBaseProps, Omit<InputHTMLAttributes<HTM
|
|
|
29
29
|
InputLabelProps?: Partial<MuiInputLabelProps>;
|
|
30
30
|
/**
|
|
31
31
|
* Attributes for the `<input>` element itself. Anything else this component
|
|
32
|
-
* does not recognise lands on the text field's ROOT `<div>`, where
|
|
33
|
-
* `
|
|
32
|
+
* does not recognise lands on the text field's ROOT `<div>`, where `pattern`,
|
|
33
|
+
* `role` and `aria-value*` do nothing. A top-level `inputMode` is routed to
|
|
34
|
+
* the `<input>` (FUT-1440); one given here wins over it. Merged, not
|
|
34
35
|
* spread over: the field's own `data-testid` stays the default a caller can
|
|
35
36
|
* override, and the ARIA it builds from `aria-label` / `aria-describedby` /
|
|
36
37
|
* `aria-busy` still lands last.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,WAAW,UACf,SAAQ,cAAc,EACpB,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,cAAc,CAAC;IACtF,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9C
|
|
1
|
+
{"version":3,"file":"Input.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,WAAW,UACf,SAAQ,cAAc,EACpB,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,cAAc,CAAC;IACtF,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9C;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC"}
|
|
@@ -22,6 +22,11 @@ export declare const ERROR_MESSAGE_LINE_HEIGHT = 1.6;
|
|
|
22
22
|
/** The retry button: 8px below the text, no narrower than 120px. */
|
|
23
23
|
export declare const RETRY_MARGIN_TOP_UNITS = 1;
|
|
24
24
|
export declare const RETRY_MIN_WIDTH = 120;
|
|
25
|
+
/**
|
|
26
|
+
* The web retry is never shorter than the 40px tap floor. MUI's medium outlined
|
|
27
|
+
* button is 37px tall on its own (FUT-1310), so the floor is stated, not inherited.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RETRY_MIN_HEIGHT = 40;
|
|
25
30
|
/**
|
|
26
31
|
* The web retry IS MUI's medium outlined `Button`: 5px 15px inside its 1px
|
|
27
32
|
* border, 14px type, the theme's radius, a 20px start icon. The native side
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/ErrorState/ErrorState.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AAEH,8GAA8G;AAC9G,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,qFAAqF;AACrF,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,GAAG,cAAc,CAE9F"}
|
|
1
|
+
{"version":3,"file":"ErrorState.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/ErrorState/ErrorState.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AAEH,8GAA8G;AAC9G,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,qFAAqF;AACrF,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,GAAG,cAAc,CAE9F"}
|
package/package.json
CHANGED
|
@@ -27,6 +27,11 @@ export const ERROR_MESSAGE_LINE_HEIGHT = 1.6;
|
|
|
27
27
|
/** The retry button: 8px below the text, no narrower than 120px. */
|
|
28
28
|
export const RETRY_MARGIN_TOP_UNITS = 1;
|
|
29
29
|
export const RETRY_MIN_WIDTH = 120;
|
|
30
|
+
/**
|
|
31
|
+
* The web retry is never shorter than the 40px tap floor. MUI's medium outlined
|
|
32
|
+
* button is 37px tall on its own (FUT-1310), so the floor is stated, not inherited.
|
|
33
|
+
*/
|
|
34
|
+
export const RETRY_MIN_HEIGHT = 40;
|
|
30
35
|
/**
|
|
31
36
|
* The web retry IS MUI's medium outlined `Button`: 5px 15px inside its 1px
|
|
32
37
|
* border, 14px type, the theme's radius, a 20px start icon. The native side
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ERROR_STATE_PADDING_UNITS,
|
|
21
21
|
ERROR_TEXT_GAP_UNITS,
|
|
22
22
|
RETRY_MARGIN_TOP_UNITS,
|
|
23
|
+
RETRY_MIN_HEIGHT,
|
|
23
24
|
RETRY_MIN_WIDTH,
|
|
24
25
|
} from './ErrorState.metrics';
|
|
25
26
|
import type { ErrorStateProps, ErrorStateSeverity } from './ErrorState.types';
|
|
@@ -153,6 +154,7 @@ export const ErrorState: React.FC<ErrorStateProps> = React.memo((props) => {
|
|
|
153
154
|
sx={{
|
|
154
155
|
mt: theme.spacing(RETRY_MARGIN_TOP_UNITS),
|
|
155
156
|
minWidth: rem(theme, RETRY_MIN_WIDTH),
|
|
157
|
+
minHeight: rem(theme, RETRY_MIN_HEIGHT),
|
|
156
158
|
}}
|
|
157
159
|
>
|
|
158
160
|
{retryLabel}
|
|
@@ -126,6 +126,14 @@ function inputAriaOf(a: {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* A top-level `inputMode`, for the `<input>` (FUT-1440). Left with the rest it
|
|
131
|
+
* landed on the text field's root `<div>`, where it raised no keypad at all.
|
|
132
|
+
*/
|
|
133
|
+
function keyboardOf(inputMode: InputProps['inputMode']): Pick<InputProps, 'inputMode'> {
|
|
134
|
+
return inputMode === undefined ? {} : { inputMode };
|
|
135
|
+
}
|
|
136
|
+
|
|
129
137
|
/** The render function `createInput` hands `forwardRef`, over a given styled field. */
|
|
130
138
|
function inputRenderer(
|
|
131
139
|
StyledTextField: ReturnType<typeof styledField>,
|
|
@@ -150,6 +158,7 @@ function inputRenderer(
|
|
|
150
158
|
'aria-label': ariaLabel,
|
|
151
159
|
'aria-describedby': ariaDescribedBy,
|
|
152
160
|
'aria-busy': ariaBusy,
|
|
161
|
+
inputMode,
|
|
153
162
|
inputProps,
|
|
154
163
|
...rest
|
|
155
164
|
},
|
|
@@ -183,9 +192,12 @@ function inputRenderer(
|
|
|
183
192
|
* disagreed with the DOM. The reports search box and the block-title
|
|
184
193
|
* inputs were both named in source and anonymous to a screen reader.
|
|
185
194
|
* `aria-describedby` and `aria-busy` are the same case: `inputAriaOf`.
|
|
195
|
+
* So is a top-level `inputMode` (FUT-1440, `keyboardOf`); a caller's
|
|
196
|
+
* `inputProps.inputMode` still wins.
|
|
186
197
|
*/
|
|
187
198
|
inputProps={{
|
|
188
199
|
'data-testid': dataTestId,
|
|
200
|
+
...keyboardOf(inputMode),
|
|
189
201
|
...inputProps,
|
|
190
202
|
...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy }),
|
|
191
203
|
}}
|
|
@@ -34,8 +34,9 @@ export interface InputProps
|
|
|
34
34
|
InputLabelProps?: Partial<MuiInputLabelProps>;
|
|
35
35
|
/**
|
|
36
36
|
* Attributes for the `<input>` element itself. Anything else this component
|
|
37
|
-
* does not recognise lands on the text field's ROOT `<div>`, where
|
|
38
|
-
* `
|
|
37
|
+
* does not recognise lands on the text field's ROOT `<div>`, where `pattern`,
|
|
38
|
+
* `role` and `aria-value*` do nothing. A top-level `inputMode` is routed to
|
|
39
|
+
* the `<input>` (FUT-1440); one given here wins over it. Merged, not
|
|
39
40
|
* spread over: the field's own `data-testid` stays the default a caller can
|
|
40
41
|
* override, and the ARIA it builds from `aria-label` / `aria-describedby` /
|
|
41
42
|
* `aria-busy` still lands last.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/form/Input/Input.factory.tsx"],"sourcesContent":["import CircularProgress from '@mui/material/CircularProgress/index.js';\nimport InputAdornment from '@mui/material/InputAdornment/index.js';\nimport { styled, useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { INPUT_LOADING } from './Input.metrics';\nimport type { TextFieldSlimComponent } from './text-field-slim.factory';\n\nimport {\n filledStyles,\n floatingLabelStyles,\n glowStyles,\n inputBaseStyles,\n inputRadiusStyles,\n muiVariantFor,\n outlinedStyles,\n pulseStyles,\n SIZE_MAP,\n} from './Input.styles';\nimport type { InputProps } from './Input.types';\nimport { splitTestId } from '../../../platform/test-id';\nimport { fieldControlStyles } from '../../../tokens/field-height';\nimport { rem } from '../../../tokens/relative';\nimport type { SizeValue } from '../../../tokens/vocabulary';\n\n/**\n * The field `Input` renders, styled, over whichever text field it is given.\n *\n * Always a `TextFieldSlim`, never MUI's `TextField` — see `text-field-slim.tsx`.\n * MUI's own `TextField` imports `Select` unconditionally, and through it `Menu`,\n * `Popover`, `Modal` and seven more component modules, so every screen with one\n * text box shipped a dropdown it can never render. Same composition, same DOM,\n * same prop routing; the select branch is the only thing missing.\n */\nfunction styledField(TextField: TextFieldSlimComponent) {\n return styled(TextField, {\n shouldForwardProp: (prop) =>\n !['customVariant', 'fieldSize', 'floating', 'glow', 'pulse', 'loading'].includes(prop as string),\n })<{\n customVariant?: InputProps['variant'];\n fieldSize: SizeValue;\n floating?: boolean;\n glow?: boolean;\n pulse?: boolean;\n loading?: boolean;\n }>(({ theme, customVariant, fieldSize, floating, glow, pulse, loading }) => ({\n position: 'relative',\n // The theme's field height for this size (outlined family, one line).\n ...fieldControlStyles(theme, fieldSize),\n opacity: loading ? INPUT_LOADING.opacity : 1,\n\n ...(glow ? glowStyles(theme) : {}),\n ...(pulse ? pulseStyles(theme, fieldSize) : {}),\n ...(floating ? floatingLabelStyles(theme) : {}),\n\n '& .MuiInputBase-root': {\n transition: 'all 0.3s ease',\n ...inputRadiusStyles(theme, customVariant),\n ...inputBaseStyles(theme, customVariant),\n },\n\n '& .MuiOutlinedInput-root': outlinedStyles(theme),\n '& .MuiFilledInput-root': filledStyles(theme),\n }));\n}\n\n/** Only one adornment shows at a time: the spinner replaces the caller's while loading. */\nconst EndAdornment: React.FC<{ loading: boolean; endAdornment?: React.ReactNode }> = ({\n loading,\n endAdornment,\n}) => {\n const theme = useTheme();\n if (loading) {\n return (\n <InputAdornment position=\"end\">\n <CircularProgress size={rem(theme, INPUT_LOADING.spinnerSize)} />\n </InputAdornment>\n );\n }\n\n if (!endAdornment) return null;\n\n return <InputAdornment position=\"end\">{endAdornment}</InputAdornment>;\n};\n\n/** While loading the field is inert: no clicks, and disabled to assistive tech. */\nconst interactionProps = (\n loading: boolean,\n onClick: InputProps['onClick'],\n disabled?: boolean,\n) => ({\n disabled: loading || disabled,\n onClick: loading ? undefined : onClick,\n});\n\n/**\n * The ARIA that describes the field has to sit on the `<input>`: the text\n * field puts every attribute it does not recognise on its root `FormControl`,\n * a `<div>` with no role, where a screen reader never reads it.\n *\n * `aria-label` has ridden `inputProps` since FUT-755. `aria-describedby` and\n * `aria-busy` fell through to the div until FUT-2619, so CepField's input\n * pointed at nothing while its lookup status lived in a live region beside it.\n *\n * `inputProps` are spread onto the `<input>` AFTER the `aria-describedby` MUI\n * writes for helper text, so a caller's ids REPLACE the helper text's: MUI's\n * `TextField` on its own keeps only one of the two. This joins both, helper\n * text first. The helper id is MUI's `<id>-helper-text` (the parity test pins\n * that spelling), which is why the field's id is fixed here rather than left\n * to the text field.\n */\nfunction inputAriaOf(a: {\n id: string;\n helperText: React.ReactNode;\n label?: string;\n describedBy?: string;\n busy?: InputProps['aria-busy'];\n}): Record<string, unknown> {\n const describedBy = [a.helperText ? `${a.id}-helper-text` : undefined, a.describedBy]\n .filter(Boolean)\n .join(' ');\n return {\n ...(a.label === undefined ? {} : { 'aria-label': a.label }),\n ...(a.describedBy === undefined ? {} : { 'aria-describedby': describedBy }),\n ...(a.busy === undefined ? {} : { 'aria-busy': a.busy }),\n };\n}\n\n/** The render function `createInput` hands `forwardRef`, over a given styled field. */\nfunction inputRenderer(\n StyledTextField: ReturnType<typeof styledField>,\n): React.ForwardRefRenderFunction<HTMLInputElement, InputProps> {\n return (\n {\n variant = 'outlined',\n size = 'md',\n label,\n error,\n helperText,\n startAdornment,\n endAdornment,\n fullWidth = true,\n floating = false,\n glow = false,\n pulse = false,\n loading = false,\n onClick,\n onFocus,\n onBlur,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n 'aria-busy': ariaBusy,\n inputProps,\n ...rest\n },\n ref,\n ) => {\n const { testId: dataTestId, rest: props } = splitTestId(rest);\n const generatedId = React.useId();\n const id = props.id ?? generatedId;\n return (\n <StyledTextField\n ref={ref}\n variant={muiVariantFor(variant)}\n customVariant={variant}\n fieldSize={size}\n floating={floating}\n glow={glow}\n pulse={pulse}\n loading={loading}\n label={label}\n error={error}\n helperText={helperText}\n fullWidth={fullWidth}\n {...interactionProps(loading, onClick, props.disabled)}\n onFocus={onFocus}\n onBlur={onBlur}\n /*\n * `aria-label` has to ride `inputProps` to reach the `<input>` (FUT-755).\n * Spread with the rest it lands on the FormControl DIV that the text\n * field renders as its root, which carries no role — so the field kept\n * no accessible name, and a source grep saying \"this input is labelled\"\n * disagreed with the DOM. The reports search box and the block-title\n * inputs were both named in source and anonymous to a screen reader.\n * `aria-describedby` and `aria-busy` are the same case: `inputAriaOf`.\n */\n inputProps={{\n 'data-testid': dataTestId,\n ...inputProps,\n ...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy }),\n }}\n InputProps={{\n startAdornment: startAdornment && (\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\n ),\n endAdornment: <EndAdornment loading={loading} endAdornment={endAdornment} />,\n }}\n {...SIZE_MAP[size]}\n {...props}\n id={id}\n />\n );\n };\n}\n\n/** The `Input` component every entry exports. */\nexport type InputComponent<P extends InputProps = InputProps> = React.ForwardRefExoticComponent<\n P & React.RefAttributes<HTMLInputElement>\n>;\n\n/**\n * `Input` over a given text field (FUT-1054). The generic entry passes the\n * field that renders any MUI variant; `./outlined` passes one that only ever\n * imports `OutlinedInput`. Everything else — styles, adornments, the ARIA\n * routing — is this one body, so the two cannot drift.\n */\nexport function createInput(TextField: TextFieldSlimComponent): InputComponent {\n const Input = React.forwardRef<HTMLInputElement, InputProps>(inputRenderer(styledField(TextField)));\n Input.displayName = 'Input';\n return Input;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,O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nG;AAAA,QACA,YAAY;AAAA,UACV,gBAAgB,kBACd,oBAAC,kBAAe,UAAS,SAAS,0BAAe;AAAA,UAEnD,cAAc,oBAAC,gBAAa,SAAkB,cAA4B;AAAA,QAC5E;AAAA,QACC,GAAG,SAAS,IAAI;AAAA,QAChB,GAAG;AAAA,QACJ;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAaO,SAAS,YAAY,WAAmD;AAC7E,QAAM,QAAQ,MAAM,WAAyC,cAAc,YAAY,SAAS,CAAC,CAAC;AAClG,QAAM,cAAc;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/ErrorState/ErrorState.tsx"],"sourcesContent":["import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';\nimport RefreshIcon from '@mui/icons-material/Refresh';\nimport WarningAmberIcon from '@mui/icons-material/WarningAmber';\nimport Box from '@mui/material/Box/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport Stack from '@mui/material/Stack/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport {\n ERROR_ICON_BOX,\n ERROR_ICON_BOX_OPACITY,\n ERROR_ICON_SIZE,\n ERROR_MESSAGE_LINE_HEIGHT,\n ERROR_MESSAGE_MAX_WIDTH,\n ERROR_STATE_GAP_UNITS,\n ERROR_STATE_MIN_HEIGHT,\n ERROR_STATE_PADDING_UNITS,\n ERROR_TEXT_GAP_UNITS,\n RETRY_MARGIN_TOP_UNITS,\n RETRY_MIN_WIDTH,\n} from './ErrorState.metrics';\nimport type { ErrorStateProps, ErrorStateSeverity } from './ErrorState.types';\nimport { resolveTestId } from '../../../platform/test-id';\nimport { rem, sxRem } from '../../../tokens/relative';\nimport { EN_US_UI_LABELS } from '../../../en-US.labels';\n\nconst makeTestId =\n (dataTestId?: string) =>\n (suffix: string): string =>\n dataTestId ? `${dataTestId}-${suffix}` : `error-state-${suffix}`;\n\nconst paletteFor = (theme: Theme, severity: ErrorStateSeverity) =>\n severity === 'error' ? theme.palette.error : theme.palette.warning;\n\nconst ErrorIcon: React.FC<{\n severity: ErrorStateSeverity;\n icon?: React.ReactNode;\n testId: string;\n}> = ({ severity, icon, testId }) => {\n const theme = useTheme();\n const color = paletteFor(theme, severity);\n const Fallback = severity === 'error' ? ErrorOutlineIcon : WarningAmberIcon;\n\n return (\n <Box\n data-testid={testId}\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: rem(theme, ERROR_ICON_BOX),\n height: rem(theme, ERROR_ICON_BOX),\n borderRadius: '50%',\n backgroundColor: color.light,\n opacity: ERROR_ICON_BOX_OPACITY,\n }}\n >\n {icon || <Fallback sx={{ fontSize: sxRem(ERROR_ICON_SIZE), color: color.main }} />}\n </Box>\n );\n};\n\nconst ErrorText: React.FC<{\n title?: string;\n message: string;\n titleId: string;\n testId: (suffix: string) => string;\n}> = ({ title, message, titleId, testId }) => {\n const theme = useTheme();\n\n return (\n <Stack spacing={ERROR_TEXT_GAP_UNITS} alignItems=\"center\">\n {title && (\n <Typography\n id={titleId}\n variant=\"h6\"\n component=\"h3\"\n data-testid={testId('title')}\n sx={{\n fontWeight: theme.typography.fontWeightMedium,\n color: theme.palette.text.primary,\n }}\n >\n {title}\n </Typography>\n )}\n\n <Typography\n id={`${titleId}-message`}\n variant=\"body2\"\n color=\"text.secondary\"\n data-testid={testId('message')}\n sx={{\n maxWidth: rem(theme, ERROR_MESSAGE_MAX_WIDTH),\n lineHeight: ERROR_MESSAGE_LINE_HEIGHT,\n }}\n >\n {message}\n </Typography>\n </Stack>\n );\n};\n\nexport const ErrorState: React.FC<ErrorStateProps> = React.memo((props) => {\n const {\n message,\n title,\n onRetry,\n retryLabel = EN_US_UI_LABELS.errorState.retry,\n severity = 'error',\n icon,\n className,\n } = props;\n const theme = useTheme();\n const titleId = React.useId();\n // `dataTestId` is the documented spelling; `testID`, the shared contract's\n // other one, resolves to the same id.\n const dataTestId = resolveTestId(props);\n const testId = makeTestId(dataTestId);\n\n return (\n <Box\n role=\"alert\"\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={`${titleId}-message`}\n className={className}\n data-testid={dataTestId || 'error-state'}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n padding: theme.spacing(ERROR_STATE_PADDING_UNITS),\n minHeight: rem(theme, ERROR_STATE_MIN_HEIGHT),\n gap: theme.spacing(ERROR_STATE_GAP_UNITS),\n }}\n >\n <ErrorIcon severity={severity} icon={icon} testId={testId('icon')} />\n\n <ErrorText title={title} message={message} titleId={titleId} testId={testId} />\n\n {onRetry && (\n <Button\n variant=\"outlined\"\n color={severity}\n onClick={onRetry}\n startIcon={<RefreshIcon />}\n data-testid={testId('retry-button')}\n sx={{\n mt: theme.spacing(RETRY_MARGIN_TOP_UNITS),\n minWidth: rem(theme, RETRY_MIN_WIDTH),\n }}\n >\n {retryLabel}\n </Button>\n )}\n </Box>\n );\n});\n\nErrorState.displayName = 'ErrorState';\n\nexport default ErrorState;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,sBAAsB;AAC7B,OAAO,iBAAiB;AACxB,OAAO,sBAAsB;AAC7B,OAAO,SAAS;AAChB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAEzB,OAAO,WAAW;AAmDH,cAcX,YAdW;AA/Bf,IAAM,aACJ,CAAC,eACD,CAAC,WACC,aAAa,GAAG,UAAU,IAAI,MAAM,KAAK,eAAe,MAAM;AAElE,IAAM,aAAa,CAAC,OAAc,aAChC,aAAa,UAAU,MAAM,QAAQ,QAAQ,MAAM,QAAQ;AAE7D,IAAM,YAID,CAAC,EAAE,UAAU,MAAM,OAAO,MAAM;AACnC,QAAM,QAAQ,SAAS;AACvB,QAAM,QAAQ,WAAW,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AA,EACF,IAAI;AACJ,QAAM,QAAQ,SAAS;AACvB,QAAM,UAAU,MAAM,MAAM;AAG5B,QAAM,aAAa,cAAc,KAAK;AACtC,QAAM,SAAS,WAAW,UAAU;AAEpC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,mBAAiB,QAAQ,UAAU;AAAA,MACnC,oBAAkB,GAAG,OAAO;AAAA,MAC5B;AAAA,MACA,eAAa,cAAc;AAAA,MAC3B,IAAI;AAAA,QACF,SAAS;AAAA,QACT,eAAe;AAAA,QACf,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,WAAW;AAAA,QACX,SAAS,MAAM,QAAQ,yBAAyB;AAAA,QAChD,WAAW,IAAI,OAAO,sBAAsB;AAAA,QAC5C,KAAK,MAAM,QAAQ,qBAAqB;AAAA,MAC1C;AAAA,MAEA;AAAA,4BAAC,aAAU,UAAoB,MAAY,QAAQ,OAAO,MAAM,GAAG;AAAA,QAEnE,oBAAC,aAAU,OAAc,SAAkB,SAAkB,QAAgB;AAAA,QAE5E,WACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAO;AAAA,YACP,SAAS;AAAA,YACT,WAAW,oBAAC,eAAY;AAAA,YACxB,eAAa,OAAO,cAAc;AAAA,YAClC,IAAI;AAAA,cACF,IAAI,MAAM,QAAQ,sBAAsB;AAAA,cACxC,UAAU,IAAI,OAAO,eAAe;AAAA,YACtC;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;AAED,WAAW,cAAc;AAEzB,IAAO,qBAAQ;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|