carbon-react 104.7.3 → 104.8.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/lib/components/dialog/dialog.component.js +4 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +4 -1
- package/lib/components/sidebar/sidebar.component.js +4 -1
- package/lib/components/toast/toast.component.js +4 -0
- package/lib/locales/en-gb.js +20 -0
- package/lib/locales/locale.d.ts +23 -0
- package/lib/locales/pl-pl.js +20 -0
- package/package.json +1 -1
|
@@ -29,6 +29,8 @@ var _form = _interopRequireDefault(require("../form"));
|
|
|
29
29
|
|
|
30
30
|
var _dialog2 = require("./dialog.config");
|
|
31
31
|
|
|
32
|
+
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -56,6 +58,7 @@ const Dialog = ({
|
|
|
56
58
|
role = "dialog",
|
|
57
59
|
...rest
|
|
58
60
|
}) => {
|
|
61
|
+
const locale = (0, _useLocale.default)();
|
|
59
62
|
const dialogRef = (0, _react.useRef)();
|
|
60
63
|
const innerContentRef = (0, _react.useRef)();
|
|
61
64
|
const titleRef = (0, _react.useRef)();
|
|
@@ -124,7 +127,7 @@ const Dialog = ({
|
|
|
124
127
|
if (!showCloseIcon || !onCancel) return null;
|
|
125
128
|
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
126
129
|
"data-element": "close",
|
|
127
|
-
"aria-label":
|
|
130
|
+
"aria-label": locale.dialog.ariaLabels.close(),
|
|
128
131
|
onAction: onCancel,
|
|
129
132
|
disabled: disableClose
|
|
130
133
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -27,6 +27,8 @@ var _iconButton = _interopRequireDefault(require("../icon-button"));
|
|
|
27
27
|
|
|
28
28
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
29
29
|
|
|
30
|
+
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
31
|
+
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
33
|
|
|
32
34
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -56,6 +58,7 @@ const DialogFullScreen = ({
|
|
|
56
58
|
role = "dialog",
|
|
57
59
|
...rest
|
|
58
60
|
}) => {
|
|
61
|
+
const locale = (0, _useLocale.default)();
|
|
59
62
|
const dialogRef = (0, _react.useRef)();
|
|
60
63
|
const headingRef = (0, _react.useRef)();
|
|
61
64
|
const {
|
|
@@ -69,7 +72,7 @@ const DialogFullScreen = ({
|
|
|
69
72
|
if (!showCloseIcon || !onCancel) return null;
|
|
70
73
|
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
71
74
|
"data-element": "close",
|
|
72
|
-
"aria-label":
|
|
75
|
+
"aria-label": locale.dialogFullScreen.ariaLabels.close(),
|
|
73
76
|
onAction: onCancel
|
|
74
77
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
75
78
|
type: "close"
|
|
@@ -25,6 +25,8 @@ var _box = _interopRequireDefault(require("../box"));
|
|
|
25
25
|
|
|
26
26
|
var _sidebar2 = require("./sidebar.config");
|
|
27
27
|
|
|
28
|
+
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -52,13 +54,14 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
52
54
|
role = "dialog",
|
|
53
55
|
...rest
|
|
54
56
|
}, ref) => {
|
|
57
|
+
const locale = (0, _useLocale.default)();
|
|
55
58
|
let sidebarRef = (0, _react.useRef)();
|
|
56
59
|
if (ref) sidebarRef = ref;
|
|
57
60
|
|
|
58
61
|
const closeIcon = () => {
|
|
59
62
|
if (!onCancel) return null;
|
|
60
63
|
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
61
|
-
"aria-label":
|
|
64
|
+
"aria-label": locale.sidebar.ariaLabels.close(),
|
|
62
65
|
onAction: onCancel,
|
|
63
66
|
"data-element": "close"
|
|
64
67
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -25,6 +25,8 @@ var _modalManager = _interopRequireDefault(require("../modal/__internal__/modal-
|
|
|
25
25
|
|
|
26
26
|
var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
|
|
27
27
|
|
|
28
|
+
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -47,6 +49,7 @@ const Toast = ({
|
|
|
47
49
|
variant,
|
|
48
50
|
...restProps
|
|
49
51
|
}) => {
|
|
52
|
+
const locale = (0, _useLocale.default)();
|
|
50
53
|
const toastRef = (0, _react.useRef)();
|
|
51
54
|
const timer = (0, _react.useRef)();
|
|
52
55
|
const componentClasses = (0, _react.useMemo)(() => {
|
|
@@ -85,6 +88,7 @@ const Toast = ({
|
|
|
85
88
|
function renderCloseIcon() {
|
|
86
89
|
if (!onDismiss) return null;
|
|
87
90
|
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
91
|
+
"aria-label": locale.toast.ariaLabels.close(),
|
|
88
92
|
"data-element": "close",
|
|
89
93
|
onAction: onDismiss
|
|
90
94
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
package/lib/locales/en-gb.js
CHANGED
|
@@ -28,6 +28,16 @@ var _default = {
|
|
|
28
28
|
date: {
|
|
29
29
|
dateFnsLocale: () => _dateFnsLocales.enGB
|
|
30
30
|
},
|
|
31
|
+
dialog: {
|
|
32
|
+
ariaLabels: {
|
|
33
|
+
close: () => "Close"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
dialogFullScreen: {
|
|
37
|
+
ariaLabels: {
|
|
38
|
+
close: () => "Close"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
31
41
|
errors: {
|
|
32
42
|
messages: {
|
|
33
43
|
formSummary:
|
|
@@ -85,6 +95,11 @@ var _default = {
|
|
|
85
95
|
link: {
|
|
86
96
|
skipLinkLabel: () => "Skip to main content"
|
|
87
97
|
},
|
|
98
|
+
sidebar: {
|
|
99
|
+
ariaLabels: {
|
|
100
|
+
close: () => "Close"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
88
103
|
switch: {
|
|
89
104
|
on: () => "ON",
|
|
90
105
|
off: () => "OFF"
|
|
@@ -106,6 +121,11 @@ var _default = {
|
|
|
106
121
|
tileSelect: {
|
|
107
122
|
deselect: () => "Deselect"
|
|
108
123
|
},
|
|
124
|
+
toast: {
|
|
125
|
+
ariaLabels: {
|
|
126
|
+
close: () => "Close"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
109
129
|
wizards: {
|
|
110
130
|
multiStep: {
|
|
111
131
|
buttons: {
|
package/lib/locales/locale.d.ts
CHANGED
|
@@ -19,6 +19,16 @@ interface Locale {
|
|
|
19
19
|
date: {
|
|
20
20
|
dateFnsLocale: () => DateFnsLocale;
|
|
21
21
|
};
|
|
22
|
+
dialog: {
|
|
23
|
+
ariaLabels: {
|
|
24
|
+
close: () => string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
dialogFullScreen: {
|
|
28
|
+
ariaLabels: {
|
|
29
|
+
close: () => string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
22
32
|
errors: {
|
|
23
33
|
messages: {
|
|
24
34
|
formSummary: (
|
|
@@ -53,6 +63,14 @@ interface Locale {
|
|
|
53
63
|
placeholder: () => string;
|
|
54
64
|
noResultsForTerm: (term: string) => string;
|
|
55
65
|
};
|
|
66
|
+
link: {
|
|
67
|
+
skipLinkLabel: () => string;
|
|
68
|
+
};
|
|
69
|
+
sidebar: {
|
|
70
|
+
ariaLabels: {
|
|
71
|
+
close: () => string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
56
74
|
switch: {
|
|
57
75
|
on: () => string;
|
|
58
76
|
off: () => string;
|
|
@@ -74,6 +92,11 @@ interface Locale {
|
|
|
74
92
|
tileSelect: {
|
|
75
93
|
deselect: () => string;
|
|
76
94
|
};
|
|
95
|
+
toast: {
|
|
96
|
+
ariaLabels: {
|
|
97
|
+
close: () => string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
77
100
|
wizards: {
|
|
78
101
|
multiStep: {
|
|
79
102
|
buttons: {
|
package/lib/locales/pl-pl.js
CHANGED
|
@@ -28,6 +28,16 @@ var _default = {
|
|
|
28
28
|
date: {
|
|
29
29
|
dateFnsLocale: () => _dateFnsLocales.pl
|
|
30
30
|
},
|
|
31
|
+
dialog: {
|
|
32
|
+
ariaLabels: {
|
|
33
|
+
close: () => "Zamknij"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
dialogFullScreen: {
|
|
37
|
+
ariaLabels: {
|
|
38
|
+
close: () => "Zamknij"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
31
41
|
errors: {
|
|
32
42
|
messages: {
|
|
33
43
|
formSummary:
|
|
@@ -83,6 +93,11 @@ var _default = {
|
|
|
83
93
|
link: {
|
|
84
94
|
skipLinkLabel: () => "Przejdź do treści"
|
|
85
95
|
},
|
|
96
|
+
sidebar: {
|
|
97
|
+
ariaLabels: {
|
|
98
|
+
close: () => "Zamknij"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
86
101
|
switch: {
|
|
87
102
|
on: () => "WŁ",
|
|
88
103
|
off: () => "WYŁ"
|
|
@@ -104,6 +119,11 @@ var _default = {
|
|
|
104
119
|
tileSelect: {
|
|
105
120
|
deselect: () => "Odznacz"
|
|
106
121
|
},
|
|
122
|
+
toast: {
|
|
123
|
+
ariaLabels: {
|
|
124
|
+
close: () => "Zamknij"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
107
127
|
wizards: {
|
|
108
128
|
multiStep: {
|
|
109
129
|
buttons: {
|