@wordpress/admin-ui 1.4.0 → 1.4.1-next.6deb34194.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/build/page/header.js +26 -25
- package/build/page/header.js.map +2 -2
- package/build/page/index.js +6 -2
- package/build/page/index.js.map +2 -2
- package/build/page/sidebar-toggle-slot.js +34 -0
- package/build/page/sidebar-toggle-slot.js.map +7 -0
- package/build-module/page/header.js +26 -25
- package/build-module/page/header.js.map +2 -2
- package/build-module/page/index.js +6 -2
- package/build-module/page/index.js.map +2 -2
- package/build-module/page/sidebar-toggle-slot.js +8 -0
- package/build-module/page/sidebar-toggle-slot.js.map +7 -0
- package/build-style/style-rtl.css +5 -17
- package/build-style/style.css +5 -17
- package/build-types/page/header.d.ts +1 -1
- package/build-types/page/header.d.ts.map +1 -1
- package/build-types/page/index.d.ts +8 -1
- package/build-types/page/index.d.ts.map +1 -1
- package/build-types/page/sidebar-toggle-slot.d.ts +10 -0
- package/build-types/page/sidebar-toggle-slot.d.ts.map +1 -0
- package/package.json +7 -7
- package/src/page/header.tsx +14 -6
- package/src/page/index.tsx +6 -0
- package/src/page/sidebar-toggle-slot.tsx +9 -0
- package/src/page/style.scss +5 -14
- package/tsconfig.tsbuildinfo +1 -1
package/build/page/header.js
CHANGED
|
@@ -24,39 +24,40 @@ __export(header_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(header_exports);
|
|
26
26
|
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_sidebar_toggle_slot = require("./sidebar-toggle-slot");
|
|
27
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
29
|
function Header({
|
|
29
30
|
breadcrumbs,
|
|
30
31
|
badges,
|
|
31
32
|
title,
|
|
32
33
|
subTitle,
|
|
33
|
-
actions
|
|
34
|
+
actions,
|
|
35
|
+
showSidebarToggle = true
|
|
34
36
|
}) {
|
|
35
37
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { className: "admin-ui-page__header", as: "header", children: [
|
|
36
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
37
|
-
import_components.__experimentalHStack,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", spacing: 2, children: [
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { spacing: 2, justify: "left", children: [
|
|
40
|
+
showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_sidebar_toggle_slot.SidebarToggleSlot,
|
|
42
|
+
{
|
|
43
|
+
bubblesVirtually: true,
|
|
44
|
+
className: "admin-ui-page__sidebar-toggle-slot"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHeading, { as: "h2", level: 3, weight: 500, truncate: true, children: title }),
|
|
48
|
+
breadcrumbs,
|
|
49
|
+
badges
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
import_components.__experimentalHStack,
|
|
53
|
+
{
|
|
54
|
+
style: { width: "auto", flexShrink: 0 },
|
|
55
|
+
spacing: 2,
|
|
56
|
+
className: "admin-ui-page__header-actions",
|
|
57
|
+
children: actions
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] }),
|
|
60
61
|
subTitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle })
|
|
61
62
|
] });
|
|
62
63
|
}
|
package/build/page/header.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/page/header.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nexport default function Header( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tactions,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle: React.ReactNode;\n\tactions?: React.ReactNode;\n\tshowSidebarToggle?: boolean;\n} ) {\n\treturn (\n\t\t<VStack className=\"admin-ui-page__header\" as=\"header\">\n\t\t\t<HStack\n\t\t\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAIO;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { SidebarToggleSlot } from './sidebar-toggle-slot';\n\nexport default function Header( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tactions,\n\tshowSidebarToggle = true,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle: React.ReactNode;\n\tactions?: React.ReactNode;\n\tshowSidebarToggle?: boolean;\n} ) {\n\treturn (\n\t\t<VStack className=\"admin-ui-page__header\" as=\"header\">\n\t\t\t<HStack justify=\"space-between\" spacing={ 2 }>\n\t\t\t\t<HStack spacing={ 2 } justify=\"left\">\n\t\t\t\t\t{ showSidebarToggle && (\n\t\t\t\t\t\t<SidebarToggleSlot\n\t\t\t\t\t\t\tbubblesVirtually\n\t\t\t\t\t\t\tclassName=\"admin-ui-page__sidebar-toggle-slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ title && (\n\t\t\t\t\t\t<Heading as=\"h2\" level={ 3 } weight={ 500 } truncate>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t) }\n\t\t\t\t\t{ breadcrumbs }\n\t\t\t\t\t{ badges }\n\t\t\t\t</HStack>\n\t\t\t\t<HStack\n\t\t\t\t\tstyle={ { width: 'auto', flexShrink: 0 } }\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tclassName=\"admin-ui-page__header-actions\"\n\t\t\t\t>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t\t{ subTitle && (\n\t\t\t\t<p className=\"admin-ui-page__header-subtitle\">{ subTitle }</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAIO;AAKP,iCAAkC;AAoB9B;AAlBW,SAAR,OAAyB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AACrB,GAOI;AACH,SACC,6CAAC,kBAAAA,sBAAA,EAAO,WAAU,yBAAwB,IAAG,UAC5C;AAAA,iDAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBAAgB,SAAU,GACzC;AAAA,mDAAC,kBAAAA,sBAAA,EAAO,SAAU,GAAI,SAAQ,QAC3B;AAAA,6BACD;AAAA,UAAC;AAAA;AAAA,YACA,kBAAgB;AAAA,YAChB,WAAU;AAAA;AAAA,QACX;AAAA,QAEC,SACD,4CAAC,kBAAAC,uBAAA,EAAQ,IAAG,MAAK,OAAQ,GAAI,QAAS,KAAM,UAAQ,MACjD,iBACH;AAAA,QAEC;AAAA,QACA;AAAA,SACH;AAAA,MACA;AAAA,QAAC,kBAAAD;AAAA,QAAA;AAAA,UACA,OAAQ,EAAE,OAAO,QAAQ,YAAY,EAAE;AAAA,UACvC,SAAU;AAAA,UACV,WAAU;AAAA,UAER;AAAA;AAAA,MACH;AAAA,OACD;AAAA,IACE,YACD,4CAAC,OAAE,WAAU,kCAAmC,oBAAU;AAAA,KAE5D;AAEF;",
|
|
6
6
|
"names": ["VStack", "HStack", "Heading"]
|
|
7
7
|
}
|
package/build/page/index.js
CHANGED
|
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(page_exports);
|
|
|
36
36
|
var import_clsx = __toESM(require("clsx"));
|
|
37
37
|
var import_header = __toESM(require("./header"));
|
|
38
38
|
var import_navigable_region = __toESM(require("../navigable-region"));
|
|
39
|
+
var import_sidebar_toggle_slot = require("./sidebar-toggle-slot");
|
|
39
40
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
41
|
function Page({
|
|
41
42
|
breadcrumbs,
|
|
@@ -45,7 +46,8 @@ function Page({
|
|
|
45
46
|
children,
|
|
46
47
|
className,
|
|
47
48
|
actions,
|
|
48
|
-
hasPadding = false
|
|
49
|
+
hasPadding = false,
|
|
50
|
+
showSidebarToggle = true
|
|
49
51
|
}) {
|
|
50
52
|
const classes = (0, import_clsx.default)("admin-ui-page", className);
|
|
51
53
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigable_region.default, { className: classes, ariaLabel: title, children: [
|
|
@@ -56,11 +58,13 @@ function Page({
|
|
|
56
58
|
badges,
|
|
57
59
|
title,
|
|
58
60
|
subTitle,
|
|
59
|
-
actions
|
|
61
|
+
actions,
|
|
62
|
+
showSidebarToggle
|
|
60
63
|
}
|
|
61
64
|
),
|
|
62
65
|
hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children
|
|
63
66
|
] });
|
|
64
67
|
}
|
|
68
|
+
Page.SidebarToggleFill = import_sidebar_toggle_slot.SidebarToggleFill;
|
|
65
69
|
var page_default = Page;
|
|
66
70
|
//# sourceMappingURL=index.js.map
|
package/build/page/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/page/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\nimport NavigableRegion from '../navigable-region';\n\nfunction Page( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tclassName,\n\tactions,\n\thasPadding = false,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle?: React.ReactNode;\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\tactions?: React.ReactNode;\n\thasPadding?: boolean;\n} ) {\n\tconst classes = clsx( 'admin-ui-page', className );\n\n\treturn (\n\t\t<NavigableRegion className={ classes } ariaLabel={ title }>\n\t\t\t{ ( title || breadcrumbs || badges ) && (\n\t\t\t\t<Header\n\t\t\t\t\tbreadcrumbs={ breadcrumbs }\n\t\t\t\t\tbadges={ badges }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tsubTitle={ subTitle }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasPadding ? (\n\t\t\t\t<div className=\"admin-ui-page__content has-padding\">\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n\nexport default Page;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,oBAAmB;AACnB,8BAA4B;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\nimport NavigableRegion from '../navigable-region';\nimport { SidebarToggleFill } from './sidebar-toggle-slot';\n\nfunction Page( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tclassName,\n\tactions,\n\thasPadding = false,\n\tshowSidebarToggle = true,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle?: React.ReactNode;\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\tactions?: React.ReactNode;\n\thasPadding?: boolean;\n\tshowSidebarToggle?: boolean;\n} ) {\n\tconst classes = clsx( 'admin-ui-page', className );\n\n\treturn (\n\t\t<NavigableRegion className={ classes } ariaLabel={ title }>\n\t\t\t{ ( title || breadcrumbs || badges ) && (\n\t\t\t\t<Header\n\t\t\t\t\tbreadcrumbs={ breadcrumbs }\n\t\t\t\t\tbadges={ badges }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tsubTitle={ subTitle }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tshowSidebarToggle={ showSidebarToggle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasPadding ? (\n\t\t\t\t<div className=\"admin-ui-page__content has-padding\">\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n\nPage.SidebarToggleFill = SidebarToggleFill;\n\nexport default Page;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,oBAAmB;AACnB,8BAA4B;AAC5B,iCAAkC;AA0BhC;AAxBF,SAAS,KAAM;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,oBAAoB;AACrB,GAUI;AACH,QAAM,cAAU,YAAAA,SAAM,iBAAiB,SAAU;AAEjD,SACC,6CAAC,wBAAAC,SAAA,EAAgB,WAAY,SAAU,WAAY,OAC9C;AAAA,cAAS,eAAe,WAC3B;AAAA,MAAC,cAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IAEC,aACD,4CAAC,SAAI,WAAU,sCACZ,UACH,IAEA;AAAA,KAEF;AAEF;AAEA,KAAK,oBAAoB;AAEzB,IAAO,eAAQ;",
|
|
6
6
|
"names": ["clsx", "NavigableRegion", "Header"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/admin-ui/src/page/sidebar-toggle-slot.tsx
|
|
21
|
+
var sidebar_toggle_slot_exports = {};
|
|
22
|
+
__export(sidebar_toggle_slot_exports, {
|
|
23
|
+
SidebarToggleFill: () => SidebarToggleFill,
|
|
24
|
+
SidebarToggleSlot: () => SidebarToggleSlot
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(sidebar_toggle_slot_exports);
|
|
27
|
+
var import_components = require("@wordpress/components");
|
|
28
|
+
var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle");
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
SidebarToggleFill,
|
|
32
|
+
SidebarToggleSlot
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=sidebar-toggle-slot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/page/sidebar-toggle-slot.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } =\n\tcreateSlotFill( 'SidebarToggle' );\n\nexport { SidebarToggleFill, SidebarToggleSlot };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA+B;AAE/B,IAAM,EAAE,MAAM,mBAAmB,MAAM,kBAAkB,QACxD,kCAAgB,eAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -4,39 +4,40 @@ import {
|
|
|
4
4
|
__experimentalHStack as HStack,
|
|
5
5
|
__experimentalVStack as VStack
|
|
6
6
|
} from "@wordpress/components";
|
|
7
|
+
import { SidebarToggleSlot } from "./sidebar-toggle-slot";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
function Header({
|
|
9
10
|
breadcrumbs,
|
|
10
11
|
badges,
|
|
11
12
|
title,
|
|
12
13
|
subTitle,
|
|
13
|
-
actions
|
|
14
|
+
actions,
|
|
15
|
+
showSidebarToggle = true
|
|
14
16
|
}) {
|
|
15
17
|
return /* @__PURE__ */ jsxs(VStack, { className: "admin-ui-page__header", as: "header", children: [
|
|
16
|
-
/* @__PURE__ */ jsxs(
|
|
17
|
-
HStack,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
),
|
|
18
|
+
/* @__PURE__ */ jsxs(HStack, { justify: "space-between", spacing: 2, children: [
|
|
19
|
+
/* @__PURE__ */ jsxs(HStack, { spacing: 2, justify: "left", children: [
|
|
20
|
+
showSidebarToggle && /* @__PURE__ */ jsx(
|
|
21
|
+
SidebarToggleSlot,
|
|
22
|
+
{
|
|
23
|
+
bubblesVirtually: true,
|
|
24
|
+
className: "admin-ui-page__sidebar-toggle-slot"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
title && /* @__PURE__ */ jsx(Heading, { as: "h2", level: 3, weight: 500, truncate: true, children: title }),
|
|
28
|
+
breadcrumbs,
|
|
29
|
+
badges
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
HStack,
|
|
33
|
+
{
|
|
34
|
+
style: { width: "auto", flexShrink: 0 },
|
|
35
|
+
spacing: 2,
|
|
36
|
+
className: "admin-ui-page__header-actions",
|
|
37
|
+
children: actions
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }),
|
|
40
41
|
subTitle && /* @__PURE__ */ jsx("p", { className: "admin-ui-page__header-subtitle", children: subTitle })
|
|
41
42
|
] });
|
|
42
43
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/page/header.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nexport default function Header( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tactions,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle: React.ReactNode;\n\tactions?: React.ReactNode;\n\tshowSidebarToggle?: boolean;\n} ) {\n\treturn (\n\t\t<VStack className=\"admin-ui-page__header\" as=\"header\">\n\t\t\t<HStack\n\t\t\t\
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { SidebarToggleSlot } from './sidebar-toggle-slot';\n\nexport default function Header( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tactions,\n\tshowSidebarToggle = true,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle: React.ReactNode;\n\tactions?: React.ReactNode;\n\tshowSidebarToggle?: boolean;\n} ) {\n\treturn (\n\t\t<VStack className=\"admin-ui-page__header\" as=\"header\">\n\t\t\t<HStack justify=\"space-between\" spacing={ 2 }>\n\t\t\t\t<HStack spacing={ 2 } justify=\"left\">\n\t\t\t\t\t{ showSidebarToggle && (\n\t\t\t\t\t\t<SidebarToggleSlot\n\t\t\t\t\t\t\tbubblesVirtually\n\t\t\t\t\t\t\tclassName=\"admin-ui-page__sidebar-toggle-slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ title && (\n\t\t\t\t\t\t<Heading as=\"h2\" level={ 3 } weight={ 500 } truncate>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t) }\n\t\t\t\t\t{ breadcrumbs }\n\t\t\t\t\t{ badges }\n\t\t\t\t</HStack>\n\t\t\t\t<HStack\n\t\t\t\t\tstyle={ { width: 'auto', flexShrink: 0 } }\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tclassName=\"admin-ui-page__header-actions\"\n\t\t\t\t>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t\t{ subTitle && (\n\t\t\t\t<p className=\"admin-ui-page__header-subtitle\">{ subTitle }</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AAKP,SAAS,yBAAyB;AAoB9B,SAEE,KAFF;AAlBW,SAAR,OAAyB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AACrB,GAOI;AACH,SACC,qBAAC,UAAO,WAAU,yBAAwB,IAAG,UAC5C;AAAA,yBAAC,UAAO,SAAQ,iBAAgB,SAAU,GACzC;AAAA,2BAAC,UAAO,SAAU,GAAI,SAAQ,QAC3B;AAAA,6BACD;AAAA,UAAC;AAAA;AAAA,YACA,kBAAgB;AAAA,YAChB,WAAU;AAAA;AAAA,QACX;AAAA,QAEC,SACD,oBAAC,WAAQ,IAAG,MAAK,OAAQ,GAAI,QAAS,KAAM,UAAQ,MACjD,iBACH;AAAA,QAEC;AAAA,QACA;AAAA,SACH;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ,EAAE,OAAO,QAAQ,YAAY,EAAE;AAAA,UACvC,SAAU;AAAA,UACV,WAAU;AAAA,UAER;AAAA;AAAA,MACH;AAAA,OACD;AAAA,IACE,YACD,oBAAC,OAAE,WAAU,kCAAmC,oBAAU;AAAA,KAE5D;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Header from "./header";
|
|
4
4
|
import NavigableRegion from "../navigable-region";
|
|
5
|
+
import { SidebarToggleFill } from "./sidebar-toggle-slot";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
function Page({
|
|
7
8
|
breadcrumbs,
|
|
@@ -11,7 +12,8 @@ function Page({
|
|
|
11
12
|
children,
|
|
12
13
|
className,
|
|
13
14
|
actions,
|
|
14
|
-
hasPadding = false
|
|
15
|
+
hasPadding = false,
|
|
16
|
+
showSidebarToggle = true
|
|
15
17
|
}) {
|
|
16
18
|
const classes = clsx("admin-ui-page", className);
|
|
17
19
|
return /* @__PURE__ */ jsxs(NavigableRegion, { className: classes, ariaLabel: title, children: [
|
|
@@ -22,12 +24,14 @@ function Page({
|
|
|
22
24
|
badges,
|
|
23
25
|
title,
|
|
24
26
|
subTitle,
|
|
25
|
-
actions
|
|
27
|
+
actions,
|
|
28
|
+
showSidebarToggle
|
|
26
29
|
}
|
|
27
30
|
),
|
|
28
31
|
hasPadding ? /* @__PURE__ */ jsx("div", { className: "admin-ui-page__content has-padding", children }) : children
|
|
29
32
|
] });
|
|
30
33
|
}
|
|
34
|
+
Page.SidebarToggleFill = SidebarToggleFill;
|
|
31
35
|
var page_default = Page;
|
|
32
36
|
export {
|
|
33
37
|
page_default as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/page/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\nimport NavigableRegion from '../navigable-region';\n\nfunction Page( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tclassName,\n\tactions,\n\thasPadding = false,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle?: React.ReactNode;\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\tactions?: React.ReactNode;\n\thasPadding?: boolean;\n} ) {\n\tconst classes = clsx( 'admin-ui-page', className );\n\n\treturn (\n\t\t<NavigableRegion className={ classes } ariaLabel={ title }>\n\t\t\t{ ( title || breadcrumbs || badges ) && (\n\t\t\t\t<Header\n\t\t\t\t\tbreadcrumbs={ breadcrumbs }\n\t\t\t\t\tbadges={ badges }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tsubTitle={ subTitle }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasPadding ? (\n\t\t\t\t<div className=\"admin-ui-page__content has-padding\">\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n\nexport default Page;\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,OAAO,YAAY;AACnB,OAAO,qBAAqB;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\nimport NavigableRegion from '../navigable-region';\nimport { SidebarToggleFill } from './sidebar-toggle-slot';\n\nfunction Page( {\n\tbreadcrumbs,\n\tbadges,\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tclassName,\n\tactions,\n\thasPadding = false,\n\tshowSidebarToggle = true,\n}: {\n\tbreadcrumbs?: React.ReactNode;\n\tbadges?: React.ReactNode;\n\ttitle?: React.ReactNode;\n\tsubTitle?: React.ReactNode;\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\tactions?: React.ReactNode;\n\thasPadding?: boolean;\n\tshowSidebarToggle?: boolean;\n} ) {\n\tconst classes = clsx( 'admin-ui-page', className );\n\n\treturn (\n\t\t<NavigableRegion className={ classes } ariaLabel={ title }>\n\t\t\t{ ( title || breadcrumbs || badges ) && (\n\t\t\t\t<Header\n\t\t\t\t\tbreadcrumbs={ breadcrumbs }\n\t\t\t\t\tbadges={ badges }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tsubTitle={ subTitle }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tshowSidebarToggle={ showSidebarToggle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasPadding ? (\n\t\t\t\t<div className=\"admin-ui-page__content has-padding\">\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n\nPage.SidebarToggleFill = SidebarToggleFill;\n\nexport default Page;\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,OAAO,YAAY;AACnB,OAAO,qBAAqB;AAC5B,SAAS,yBAAyB;AA0BhC,SAEE,KAFF;AAxBF,SAAS,KAAM;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,oBAAoB;AACrB,GAUI;AACH,QAAM,UAAU,KAAM,iBAAiB,SAAU;AAEjD,SACC,qBAAC,mBAAgB,WAAY,SAAU,WAAY,OAC9C;AAAA,cAAS,eAAe,WAC3B;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IAEC,aACD,oBAAC,SAAI,WAAU,sCACZ,UACH,IAEA;AAAA,KAEF;AAEF;AAEA,KAAK,oBAAoB;AAEzB,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// packages/admin-ui/src/page/sidebar-toggle-slot.tsx
|
|
2
|
+
import { createSlotFill } from "@wordpress/components";
|
|
3
|
+
var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = createSlotFill("SidebarToggle");
|
|
4
|
+
export {
|
|
5
|
+
SidebarToggleFill,
|
|
6
|
+
SidebarToggleSlot
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=sidebar-toggle-slot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/page/sidebar-toggle-slot.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } =\n\tcreateSlotFill( 'SidebarToggle' );\n\nexport { SidebarToggleFill, SidebarToggleSlot };\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,sBAAsB;AAE/B,IAAM,EAAE,MAAM,mBAAmB,MAAM,kBAAkB,IACxD,eAAgB,eAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -91,25 +91,18 @@
|
|
|
91
91
|
position: relative;
|
|
92
92
|
z-index: 1;
|
|
93
93
|
flex-flow: column;
|
|
94
|
-
container: admin-ui-page/inline-size;
|
|
95
|
-
}
|
|
96
|
-
@media not (prefers-reduced-motion) {
|
|
97
|
-
.admin-ui-page {
|
|
98
|
-
transition: width ease-out 0.2s;
|
|
99
|
-
}
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
.admin-ui-page__header {
|
|
103
|
-
padding: 16px
|
|
97
|
+
padding: 16px 24px;
|
|
104
98
|
border-bottom: 1px solid #f0f0f0;
|
|
105
99
|
background: #fff;
|
|
106
100
|
position: sticky;
|
|
107
101
|
top: 0;
|
|
108
102
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
103
|
+
|
|
104
|
+
.admin-ui-page__sidebar-toggle-slot:empty {
|
|
105
|
+
display: none;
|
|
113
106
|
}
|
|
114
107
|
|
|
115
108
|
.admin-ui-page__header-subtitle {
|
|
@@ -129,12 +122,7 @@
|
|
|
129
122
|
flex-direction: column;
|
|
130
123
|
}
|
|
131
124
|
.admin-ui-page__content.has-padding {
|
|
132
|
-
padding: 16px
|
|
133
|
-
}
|
|
134
|
-
@container (max-width: 430px) {
|
|
135
|
-
.admin-ui-page__content.has-padding {
|
|
136
|
-
padding: 16px 24px;
|
|
137
|
-
}
|
|
125
|
+
padding: 16px 24px;
|
|
138
126
|
}
|
|
139
127
|
|
|
140
128
|
.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon {
|
package/build-style/style.css
CHANGED
|
@@ -91,25 +91,18 @@
|
|
|
91
91
|
position: relative;
|
|
92
92
|
z-index: 1;
|
|
93
93
|
flex-flow: column;
|
|
94
|
-
container: admin-ui-page/inline-size;
|
|
95
|
-
}
|
|
96
|
-
@media not (prefers-reduced-motion) {
|
|
97
|
-
.admin-ui-page {
|
|
98
|
-
transition: width ease-out 0.2s;
|
|
99
|
-
}
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
.admin-ui-page__header {
|
|
103
|
-
padding: 16px
|
|
97
|
+
padding: 16px 24px;
|
|
104
98
|
border-bottom: 1px solid #f0f0f0;
|
|
105
99
|
background: #fff;
|
|
106
100
|
position: sticky;
|
|
107
101
|
top: 0;
|
|
108
102
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
103
|
+
|
|
104
|
+
.admin-ui-page__sidebar-toggle-slot:empty {
|
|
105
|
+
display: none;
|
|
113
106
|
}
|
|
114
107
|
|
|
115
108
|
.admin-ui-page__header-subtitle {
|
|
@@ -129,12 +122,7 @@
|
|
|
129
122
|
flex-direction: column;
|
|
130
123
|
}
|
|
131
124
|
.admin-ui-page__content.has-padding {
|
|
132
|
-
padding: 16px
|
|
133
|
-
}
|
|
134
|
-
@container (max-width: 430px) {
|
|
135
|
-
.admin-ui-page__content.has-padding {
|
|
136
|
-
padding: 16px 24px;
|
|
137
|
-
}
|
|
125
|
+
padding: 16px 24px;
|
|
138
126
|
}
|
|
139
127
|
|
|
140
128
|
.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function Header({ breadcrumbs, badges, title, subTitle, actions, }: {
|
|
1
|
+
export default function Header({ breadcrumbs, badges, title, subTitle, actions, showSidebarToggle, }: {
|
|
2
2
|
breadcrumbs?: React.ReactNode;
|
|
3
3
|
badges?: React.ReactNode;
|
|
4
4
|
title?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/page/header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/page/header.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,EAC/B,WAAW,EACX,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAO,EACP,iBAAwB,GACxB,EAAE;IACF,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B,+BAgCA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare function Page({ breadcrumbs, badges, title, subTitle, children, className, actions, hasPadding, }: {
|
|
1
|
+
declare function Page({ breadcrumbs, badges, title, subTitle, children, className, actions, hasPadding, showSidebarToggle, }: {
|
|
2
2
|
breadcrumbs?: React.ReactNode;
|
|
3
3
|
badges?: React.ReactNode;
|
|
4
4
|
title?: React.ReactNode;
|
|
@@ -7,6 +7,13 @@ declare function Page({ breadcrumbs, badges, title, subTitle, children, classNam
|
|
|
7
7
|
className?: string;
|
|
8
8
|
actions?: React.ReactNode;
|
|
9
9
|
hasPadding?: boolean;
|
|
10
|
+
showSidebarToggle?: boolean;
|
|
10
11
|
}): import("react").JSX.Element;
|
|
12
|
+
declare namespace Page {
|
|
13
|
+
var SidebarToggleFill: {
|
|
14
|
+
(props: Omit<import("@wordpress/components/build-types/slot-fill/types").FillComponentProps, "name">): import("react").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
11
18
|
export default Page;
|
|
12
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page/index.tsx"],"names":[],"mappings":"AAYA,iBAAS,IAAI,CAAE,EACd,WAAW,EACX,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAkB,EAClB,iBAAwB,GACxB,EAAE;IACF,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B,+BAwBA;kBA5CQ,IAAI;;;;;;AAgDb,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const SidebarToggleFill: {
|
|
2
|
+
(props: Omit<import("@wordpress/components/build-types/slot-fill/types").FillComponentProps, "name">): import("react").JSX.Element;
|
|
3
|
+
displayName: string;
|
|
4
|
+
}, SidebarToggleSlot: {
|
|
5
|
+
(props: import("@wordpress/components/build-types/slot-fill/types").DistributiveOmit<import("@wordpress/components/build-types/slot-fill/types").SlotComponentProps, "name">): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
__unstableName: import("@wordpress/components/build-types/slot-fill/types").SlotKey;
|
|
8
|
+
};
|
|
9
|
+
export { SidebarToggleFill, SidebarToggleSlot };
|
|
10
|
+
//# sourceMappingURL=sidebar-toggle-slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-toggle-slot.d.ts","sourceRoot":"","sources":["../../src/page/sidebar-toggle-slot.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAc,iBAAiB;;;GAAQ,iBAAiB;;;;CACtB,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/admin-ui",
|
|
3
|
-
"version": "1.4.0",
|
|
3
|
+
"version": "1.4.1-next.6deb34194.0",
|
|
4
4
|
"description": "Generic components to be used in the Admin UI.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"types": "build-types",
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@wordpress/base-styles": "^6.12.0",
|
|
41
|
-
"@wordpress/components": "^
|
|
42
|
-
"@wordpress/element": "^6.36.0",
|
|
43
|
-
"@wordpress/i18n": "^6.9.0",
|
|
44
|
-
"@wordpress/route": "^0.2.0",
|
|
40
|
+
"@wordpress/base-styles": "^6.12.1-next.6deb34194.0",
|
|
41
|
+
"@wordpress/components": "^31.0.1-next.6deb34194.0",
|
|
42
|
+
"@wordpress/element": "^6.36.1-next.6deb34194.0",
|
|
43
|
+
"@wordpress/i18n": "^6.9.1-next.6deb34194.0",
|
|
44
|
+
"@wordpress/route": "^0.2.1-next.6deb34194.0",
|
|
45
45
|
"clsx": "^2.1.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "457096e9e9b3896d2d4fe54fc19d7fb571ee9a44"
|
|
54
54
|
}
|
package/src/page/header.tsx
CHANGED
|
@@ -7,12 +7,18 @@ import {
|
|
|
7
7
|
__experimentalVStack as VStack,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { SidebarToggleSlot } from './sidebar-toggle-slot';
|
|
14
|
+
|
|
10
15
|
export default function Header( {
|
|
11
16
|
breadcrumbs,
|
|
12
17
|
badges,
|
|
13
18
|
title,
|
|
14
19
|
subTitle,
|
|
15
20
|
actions,
|
|
21
|
+
showSidebarToggle = true,
|
|
16
22
|
}: {
|
|
17
23
|
breadcrumbs?: React.ReactNode;
|
|
18
24
|
badges?: React.ReactNode;
|
|
@@ -23,12 +29,14 @@ export default function Header( {
|
|
|
23
29
|
} ) {
|
|
24
30
|
return (
|
|
25
31
|
<VStack className="admin-ui-page__header" as="header">
|
|
26
|
-
<HStack
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
<HStack justify="space-between" spacing={ 2 }>
|
|
33
|
+
<HStack spacing={ 2 } justify="left">
|
|
34
|
+
{ showSidebarToggle && (
|
|
35
|
+
<SidebarToggleSlot
|
|
36
|
+
bubblesVirtually
|
|
37
|
+
className="admin-ui-page__sidebar-toggle-slot"
|
|
38
|
+
/>
|
|
39
|
+
) }
|
|
32
40
|
{ title && (
|
|
33
41
|
<Heading as="h2" level={ 3 } weight={ 500 } truncate>
|
|
34
42
|
{ title }
|
package/src/page/index.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import Header from './header';
|
|
10
10
|
import NavigableRegion from '../navigable-region';
|
|
11
|
+
import { SidebarToggleFill } from './sidebar-toggle-slot';
|
|
11
12
|
|
|
12
13
|
function Page( {
|
|
13
14
|
breadcrumbs,
|
|
@@ -18,6 +19,7 @@ function Page( {
|
|
|
18
19
|
className,
|
|
19
20
|
actions,
|
|
20
21
|
hasPadding = false,
|
|
22
|
+
showSidebarToggle = true,
|
|
21
23
|
}: {
|
|
22
24
|
breadcrumbs?: React.ReactNode;
|
|
23
25
|
badges?: React.ReactNode;
|
|
@@ -27,6 +29,7 @@ function Page( {
|
|
|
27
29
|
className?: string;
|
|
28
30
|
actions?: React.ReactNode;
|
|
29
31
|
hasPadding?: boolean;
|
|
32
|
+
showSidebarToggle?: boolean;
|
|
30
33
|
} ) {
|
|
31
34
|
const classes = clsx( 'admin-ui-page', className );
|
|
32
35
|
|
|
@@ -39,6 +42,7 @@ function Page( {
|
|
|
39
42
|
title={ title }
|
|
40
43
|
subTitle={ subTitle }
|
|
41
44
|
actions={ actions }
|
|
45
|
+
showSidebarToggle={ showSidebarToggle }
|
|
42
46
|
/>
|
|
43
47
|
) }
|
|
44
48
|
{ hasPadding ? (
|
|
@@ -52,4 +56,6 @@ function Page( {
|
|
|
52
56
|
);
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
Page.SidebarToggleFill = SidebarToggleFill;
|
|
60
|
+
|
|
55
61
|
export default Page;
|