blue-react 11.3.0 → 11.3.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.
|
@@ -7,8 +7,12 @@ export interface LayoutProps {
|
|
|
7
7
|
side?: React.ReactNode;
|
|
8
8
|
noPageBorder?: boolean;
|
|
9
9
|
drawerTitle?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* For SSR you can pass server's country code to solve hydration problems.
|
|
12
|
+
*/
|
|
13
|
+
countryCode?: string;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* A layout with header, side and main content area. Side is collapsible.
|
|
13
17
|
*/
|
|
14
|
-
export default function Layout({ children, className, style, header, side, noPageBorder, drawerTitle }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default function Layout({ children, className, style, header, side, noPageBorder, drawerTitle, countryCode }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,8 @@ export default function Layout(_ref) {
|
|
|
14
14
|
side = _ref.side,
|
|
15
15
|
_ref$noPageBorder = _ref.noPageBorder,
|
|
16
16
|
noPageBorder = _ref$noPageBorder === void 0 ? false : _ref$noPageBorder,
|
|
17
|
-
drawerTitle = _ref.drawerTitle
|
|
17
|
+
drawerTitle = _ref.drawerTitle,
|
|
18
|
+
countryCode = _ref.countryCode;
|
|
18
19
|
var ref = useRef(null);
|
|
19
20
|
var idPrefix = useId();
|
|
20
21
|
var sideId = "".concat(idPrefix, "side");
|
|
@@ -42,7 +43,7 @@ export default function Layout(_ref) {
|
|
|
42
43
|
/* @ts-ignore */,
|
|
43
44
|
command: "show-modal",
|
|
44
45
|
commandfor: drawerId,
|
|
45
|
-
"aria-label": getPhrase("Toggle menu"),
|
|
46
|
+
"aria-label": getPhrase("Toggle menu", countryCode),
|
|
46
47
|
children: /*#__PURE__*/_jsxs("svg", {
|
|
47
48
|
xmlns: "http://www.w3.org/2000/svg",
|
|
48
49
|
viewBox: "0 0 16 16",
|
|
@@ -63,7 +64,7 @@ export default function Layout(_ref) {
|
|
|
63
64
|
"data-blue-toggle": "layout-side",
|
|
64
65
|
"aria-controls": sideId,
|
|
65
66
|
"aria-expanded": "true",
|
|
66
|
-
"aria-label": getPhrase("Toggle sidebar"),
|
|
67
|
+
"aria-label": getPhrase("Toggle sidebar", countryCode),
|
|
67
68
|
children: /*#__PURE__*/_jsx("svg", {
|
|
68
69
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
70
|
viewBox: "0 0 16 16",
|
|
@@ -85,13 +86,13 @@ export default function Layout(_ref) {
|
|
|
85
86
|
id: drawerId,
|
|
86
87
|
"aria-describedby": drawerLabelId,
|
|
87
88
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
88
|
-
className: "offcanvas offcanvas-start
|
|
89
|
+
className: "offcanvas offcanvas-start",
|
|
89
90
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
90
91
|
className: "offcanvas-header",
|
|
91
92
|
children: [/*#__PURE__*/_jsx("h1", {
|
|
92
93
|
className: "h5 offcanvas-title",
|
|
93
94
|
id: drawerLabelId,
|
|
94
|
-
children: drawerTitle || getPhrase("Menu")
|
|
95
|
+
children: drawerTitle || getPhrase("Menu", countryCode)
|
|
95
96
|
}), /*#__PURE__*/_jsx("form", {
|
|
96
97
|
method: "dialog",
|
|
97
98
|
style: {
|
|
@@ -100,7 +101,7 @@ export default function Layout(_ref) {
|
|
|
100
101
|
children: /*#__PURE__*/_jsx("button", {
|
|
101
102
|
type: "submit",
|
|
102
103
|
className: "btn-close",
|
|
103
|
-
"aria-label": getPhrase("Close")
|
|
104
|
+
"aria-label": getPhrase("Close", countryCode)
|
|
104
105
|
})
|
|
105
106
|
})]
|
|
106
107
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -114,7 +115,7 @@ export default function Layout(_ref) {
|
|
|
114
115
|
method: "dialog",
|
|
115
116
|
className: "blue-modal-backdrop",
|
|
116
117
|
children: /*#__PURE__*/_jsx("button", {
|
|
117
|
-
children: getPhrase("Close")
|
|
118
|
+
children: getPhrase("Close", countryCode)
|
|
118
119
|
})
|
|
119
120
|
})]
|
|
120
121
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blue-react",
|
|
3
|
-
"version": "11.3.
|
|
3
|
+
"version": "11.3.2",
|
|
4
4
|
"description": "Blue React Components",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@popperjs/core": "^2.11.5",
|
|
38
|
-
"blue-web": "^1.
|
|
38
|
+
"blue-web": "^1.30.1",
|
|
39
39
|
"bootstrap": "~5.3.3",
|
|
40
40
|
"clsx": "^1.1.1"
|
|
41
41
|
},
|