@wordpress/boot 0.15.0 → 0.15.1

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build-module/components/canvas/back-button.mjs +3 -3
  3. package/build-module/components/canvas/back-button.mjs.map +2 -2
  4. package/build-module/components/navigation/index.mjs +2 -2
  5. package/build-module/components/navigation/index.mjs.map +2 -2
  6. package/build-module/components/root/index.mjs +121 -100
  7. package/build-module/components/root/index.mjs.map +2 -2
  8. package/build-module/components/root/single-page.mjs +45 -25
  9. package/build-module/components/root/single-page.mjs.map +2 -2
  10. package/build-module/components/save-button/index.mjs +33 -27
  11. package/build-module/components/save-button/index.mjs.map +2 -2
  12. package/build-module/components/site-icon-link/index.mjs +25 -17
  13. package/build-module/components/site-icon-link/index.mjs.map +2 -2
  14. package/build-module/index.mjs +3 -3
  15. package/build-module/index.mjs.map +2 -2
  16. package/build-style/style-rtl.css +23 -114
  17. package/build-style/style.css +23 -114
  18. package/build-style/view-transitions-rtl.css +6 -3
  19. package/build-style/view-transitions.css +6 -3
  20. package/build-types/components/root/index.d.ts.map +1 -1
  21. package/build-types/components/root/single-page.d.ts.map +1 -1
  22. package/build-types/components/save-button/index.d.ts.map +1 -1
  23. package/build-types/components/site-icon-link/index.d.ts.map +1 -1
  24. package/package.json +26 -25
  25. package/src/components/navigation/index.tsx +2 -2
  26. package/src/components/root/index.tsx +141 -120
  27. package/src/components/root/single-page.tsx +20 -7
  28. package/src/components/save-button/index.tsx +31 -20
  29. package/src/components/save-button/style.scss +6 -0
  30. package/src/components/site-icon-link/index.tsx +27 -18
  31. package/build-module/components/user-theme-provider/index.mjs +0 -33
  32. package/build-module/components/user-theme-provider/index.mjs.map +0 -7
  33. package/src/components/user-theme-provider/index.tsx +0 -35
  34. package/src/components/user-theme-provider/test/index.test.ts +0 -11
@@ -82,7 +82,7 @@
82
82
  /* Background color for interactive elements with error tone and weak emphasis that are hovered, focused, or active. */
83
83
  --wpds-color-bg-interactive-error-weak-active: #f6e6e3;
84
84
  /* Background color for tracks with a neutral tone and weak emphasis (eg. scrollbar track). */
85
- --wpds-color-bg-track-neutral-weak: #e4e4e4;
85
+ --wpds-color-bg-track-neutral-weak: #f0f0f0;
86
86
  /* Background color for tracks with a neutral tone and normal emphasis (eg. slider or progressbar track). */
87
87
  --wpds-color-bg-track-neutral: #dbdbdb;
88
88
  /* Background color for thumbs with a neutral tone and weak emphasis (eg. scrollbar thumb). */
@@ -154,27 +154,27 @@
154
154
  /* Decorative stroke color used to define neutrally-toned surface boundaries with normal emphasis. */
155
155
  --wpds-color-stroke-surface-neutral: #dbdbdb;
156
156
  /* Decorative stroke color used to define neutrally-toned surface boundaries with weak emphasis. */
157
- --wpds-color-stroke-surface-neutral-weak: #e4e4e4;
157
+ --wpds-color-stroke-surface-neutral-weak: #f0f0f0;
158
158
  /* Decorative stroke color used to define neutrally-toned surface boundaries with strong emphasis. */
159
159
  --wpds-color-stroke-surface-neutral-strong: #8d8d8d;
160
160
  /* Decorative stroke color used to define brand-toned surface boundaries with normal emphasis. */
161
- --wpds-color-stroke-surface-brand: #a3b1d4;
161
+ --wpds-color-stroke-surface-brand: #b0bbd6;
162
162
  /* Decorative stroke color used to define brand-toned surface boundaries with strong emphasis. */
163
163
  --wpds-color-stroke-surface-brand-strong: #3858e9;
164
164
  /* Decorative stroke color used to define success-toned surface boundaries with normal emphasis. */
165
- --wpds-color-stroke-surface-success: #8ac894;
165
+ --wpds-color-stroke-surface-success: #94d29e;
166
166
  /* Decorative stroke color used to define success-toned surface boundaries with strong emphasis. */
167
167
  --wpds-color-stroke-surface-success-strong: #008030;
168
168
  /* Decorative stroke color used to define info-toned surface boundaries with normal emphasis. */
169
- --wpds-color-stroke-surface-info: #9fbcdc;
169
+ --wpds-color-stroke-surface-info: #a9c6e7;
170
170
  /* Decorative stroke color used to define info-toned surface boundaries with strong emphasis. */
171
171
  --wpds-color-stroke-surface-info-strong: #006bd7;
172
172
  /* Decorative stroke color used to define warning-toned surface boundaries with normal emphasis. */
173
- --wpds-color-stroke-surface-warning: #d0b481;
173
+ --wpds-color-stroke-surface-warning: #e1bc7c;
174
174
  /* Decorative stroke color used to define warning-toned surface boundaries with strong emphasis. */
175
175
  --wpds-color-stroke-surface-warning-strong: #926300;
176
176
  /* Decorative stroke color used to define error-toned surface boundaries with normal emphasis. */
177
- --wpds-color-stroke-surface-error: #daa39b;
177
+ --wpds-color-stroke-surface-error: #dab1aa;
178
178
  /* Decorative stroke color used to define error-toned surface boundaries with strong emphasis. */
179
179
  --wpds-color-stroke-surface-error-strong: #cc1818;
180
180
  /* Accessible stroke color used for interactive neutrally-toned elements with normal emphasis. */
@@ -229,6 +229,22 @@
229
229
  --wpds-dimension-gap-2xl: 32px;
230
230
  /* 3x extra large gap */
231
231
  --wpds-dimension-gap-3xl: 40px;
232
+ /* Notification indicators */
233
+ --wpds-dimension-size-5xs: 4px;
234
+ /* Visual size for small interactive elements like resize handles */
235
+ --wpds-dimension-size-4xs: 8px;
236
+ /* Small markers */
237
+ --wpds-dimension-size-3xs: 12px;
238
+ /* For small controls like checkboxes and radios, or small decorative icons */
239
+ --wpds-dimension-size-2xs: 16px;
240
+ /* For medium sized icons */
241
+ --wpds-dimension-size-xs: 20px;
242
+ /* For icons and small buttons */
243
+ --wpds-dimension-size-sm: 24px;
244
+ /* For medium-sized buttons and inputs */
245
+ --wpds-dimension-size-md: 32px;
246
+ /* Default size for buttons and inputs */
247
+ --wpds-dimension-size-lg: 40px;
232
248
  /* Extra small surface width */
233
249
  --wpds-dimension-surface-width-xs: 240px;
234
250
  /* Small surface width */
@@ -309,113 +325,6 @@
309
325
  --wpds-typography-font-weight-medium: 499;
310
326
  }
311
327
 
312
- [data-wpds-theme-provider-id][data-wpds-density=compact] {
313
- /* Extra small padding */
314
- --wpds-dimension-padding-xs: 4px;
315
- /* Small padding */
316
- --wpds-dimension-padding-sm: 4px;
317
- /* Medium padding */
318
- --wpds-dimension-padding-md: 8px;
319
- /* Large padding */
320
- --wpds-dimension-padding-lg: 12px;
321
- /* Extra large padding */
322
- --wpds-dimension-padding-xl: 16px;
323
- /* 2x extra large padding */
324
- --wpds-dimension-padding-2xl: 20px;
325
- /* 3x extra large padding */
326
- --wpds-dimension-padding-3xl: 24px;
327
- /* Extra small gap */
328
- --wpds-dimension-gap-xs: 4px;
329
- /* Small gap */
330
- --wpds-dimension-gap-sm: 4px;
331
- /* Medium gap */
332
- --wpds-dimension-gap-md: 8px;
333
- /* Large gap */
334
- --wpds-dimension-gap-lg: 12px;
335
- /* Extra large gap */
336
- --wpds-dimension-gap-xl: 20px;
337
- /* 2x extra large gap */
338
- --wpds-dimension-gap-2xl: 24px;
339
- /* 3x extra large gap */
340
- --wpds-dimension-gap-3xl: 32px;
341
- }
342
-
343
- [data-wpds-theme-provider-id][data-wpds-density=comfortable] {
344
- /* Extra small padding */
345
- --wpds-dimension-padding-xs: 8px;
346
- /* Small padding */
347
- --wpds-dimension-padding-sm: 12px;
348
- /* Medium padding */
349
- --wpds-dimension-padding-md: 16px;
350
- /* Large padding */
351
- --wpds-dimension-padding-lg: 20px;
352
- /* Extra large padding */
353
- --wpds-dimension-padding-xl: 24px;
354
- /* 2x extra large padding */
355
- --wpds-dimension-padding-2xl: 32px;
356
- /* 3x extra large padding */
357
- --wpds-dimension-padding-3xl: 40px;
358
- /* Extra small gap */
359
- --wpds-dimension-gap-xs: 8px;
360
- /* Small gap */
361
- --wpds-dimension-gap-sm: 12px;
362
- /* Medium gap */
363
- --wpds-dimension-gap-md: 16px;
364
- /* Large gap */
365
- --wpds-dimension-gap-lg: 20px;
366
- /* Extra large gap */
367
- --wpds-dimension-gap-xl: 32px;
368
- /* 2x extra large gap */
369
- --wpds-dimension-gap-2xl: 40px;
370
- /* 3x extra large gap */
371
- --wpds-dimension-gap-3xl: 48px;
372
- }
373
-
374
- [data-wpds-theme-provider-id][data-wpds-density=default] {
375
- /* Base dimension unit */
376
- --wpds-dimension-base: 4px;
377
- /* Extra small padding */
378
- --wpds-dimension-padding-xs: 4px;
379
- /* Small padding */
380
- --wpds-dimension-padding-sm: 8px;
381
- /* Medium padding */
382
- --wpds-dimension-padding-md: 12px;
383
- /* Large padding */
384
- --wpds-dimension-padding-lg: 16px;
385
- /* Extra large padding */
386
- --wpds-dimension-padding-xl: 20px;
387
- /* 2x extra large padding */
388
- --wpds-dimension-padding-2xl: 24px;
389
- /* 3x extra large padding */
390
- --wpds-dimension-padding-3xl: 32px;
391
- /* Extra small gap */
392
- --wpds-dimension-gap-xs: 4px;
393
- /* Small gap */
394
- --wpds-dimension-gap-sm: 8px;
395
- /* Medium gap */
396
- --wpds-dimension-gap-md: 12px;
397
- /* Large gap */
398
- --wpds-dimension-gap-lg: 16px;
399
- /* Extra large gap */
400
- --wpds-dimension-gap-xl: 24px;
401
- /* 2x extra large gap */
402
- --wpds-dimension-gap-2xl: 32px;
403
- /* 3x extra large gap */
404
- --wpds-dimension-gap-3xl: 40px;
405
- /* Extra small surface width */
406
- --wpds-dimension-surface-width-xs: 240px;
407
- /* Small surface width */
408
- --wpds-dimension-surface-width-sm: 320px;
409
- /* Medium surface width */
410
- --wpds-dimension-surface-width-md: 400px;
411
- /* Large surface width */
412
- --wpds-dimension-surface-width-lg: 560px;
413
- /* Extra large surface width */
414
- --wpds-dimension-surface-width-xl: 720px;
415
- /* 2x extra large surface width */
416
- --wpds-dimension-surface-width-2xl: 960px;
417
- }
418
-
419
328
  @media (min-resolution: 192dpi) {
420
329
  :root {
421
330
  /* Border width for focus ring */
@@ -83,14 +83,17 @@
83
83
  border-radius: 8px;
84
84
  width: 100%;
85
85
  height: 100%;
86
- object-fit: none;
87
- object-position: right top;
86
+ -o-object-fit: none;
87
+ object-fit: none;
88
+ -o-object-position: right top;
89
+ object-position: right top;
88
90
  overflow: hidden;
89
91
  }
90
92
 
91
93
  ::view-transition-new(boot--canvas),
92
94
  ::view-transition-old(boot--canvas) {
93
- object-position: center top;
95
+ -o-object-position: center top;
96
+ object-position: center top;
94
97
  }
95
98
 
96
99
  ::view-transition-old(boot-safari--inspector):only-child,
@@ -83,14 +83,17 @@
83
83
  border-radius: 8px;
84
84
  width: 100%;
85
85
  height: 100%;
86
- object-fit: none;
87
- object-position: left top;
86
+ -o-object-fit: none;
87
+ object-fit: none;
88
+ -o-object-position: left top;
89
+ object-position: left top;
88
90
  overflow: hidden;
89
91
  }
90
92
 
91
93
  ::view-transition-new(boot--canvas),
92
94
  ::view-transition-old(boot--canvas) {
93
- object-position: center top;
95
+ -o-object-position: center top;
96
+ object-position: center top;
94
97
  }
95
98
 
96
99
  ::view-transition-old(boot-safari--inspector):only-child,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/root/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,cAAc,CAAC;AAKtB,MAAM,CAAC,OAAO,UAAU,IAAI,gCAuJ3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/root/index.tsx"],"names":[],"mappings":"AAkCA,OAAO,cAAc,CAAC;AAKtB,MAAM,CAAC,OAAO,UAAU,IAAI,gCAyK3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"single-page.d.ts","sourceRoot":"","sources":["../../../src/components/root/single-page.tsx"],"names":[],"mappings":"AAmBA,OAAO,cAAc,CAAC;AAMtB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,gCAiDrC"}
1
+ {"version":3,"file":"single-page.d.ts","sourceRoot":"","sources":["../../../src/components/root/single-page.tsx"],"names":[],"mappings":"AAsBA,OAAO,cAAc,CAAC;AAMtB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,gCA2DrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/save-button/index.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,cAAc,CAAC;AAGtB,MAAM,CAAC,OAAO,UAAU,UAAU,uCAsGjC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/save-button/index.tsx"],"names":[],"mappings":"AAcA;;GAEG;AACH,OAAO,cAAc,CAAC;AAGtB,MAAM,CAAC,OAAO,UAAU,UAAU,uCA+GjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-icon-link/index.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAC;AAItB,iBAAS,YAAY,CAAE,EACtB,EAAE,EACF,YAAY,EACZ,GAAG,KAAK,EACR,EAAE;IACF,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,+BAuBA;eAEc,YAAY"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-icon-link/index.tsx"],"names":[],"mappings":"AAaA,OAAO,cAAc,CAAC;AAItB,iBAAS,YAAY,CAAE,EACtB,EAAE,EACF,YAAY,EACZ,GAAG,KAAK,EACR,EAAE;IACF,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,+BA8BA;eAEc,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/boot",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Minimal boot package for WordPress admin pages.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,32 +37,33 @@
37
37
  },
38
38
  "./package.json": "./package.json"
39
39
  },
40
- "react-native": "src/index",
41
40
  "wpScriptModuleExports": "./build-module/index.mjs",
42
41
  "types": "build-types",
43
42
  "dependencies": {
44
- "@wordpress/a11y": "^4.48.0",
45
- "@wordpress/admin-ui": "^2.3.0",
46
- "@wordpress/base-styles": "^9.1.0",
47
- "@wordpress/commands": "^1.48.0",
48
- "@wordpress/components": "^35.0.0",
49
- "@wordpress/compose": "^8.1.0",
50
- "@wordpress/core-data": "^7.48.0",
51
- "@wordpress/data": "^10.48.0",
52
- "@wordpress/editor": "^14.48.0",
53
- "@wordpress/element": "^8.0.0",
54
- "@wordpress/html-entities": "^4.48.0",
55
- "@wordpress/i18n": "^6.21.0",
56
- "@wordpress/icons": "^13.3.0",
57
- "@wordpress/keyboard-shortcuts": "^5.48.0",
58
- "@wordpress/keycodes": "^4.48.0",
59
- "@wordpress/lazy-editor": "^1.14.0",
60
- "@wordpress/notices": "^5.48.0",
61
- "@wordpress/primitives": "^4.48.0",
62
- "@wordpress/private-apis": "^1.48.0",
63
- "@wordpress/route": "^0.14.0",
64
- "@wordpress/theme": "^0.15.0",
65
- "@wordpress/url": "^4.48.0",
43
+ "@types/react": "^18.3.27",
44
+ "@wordpress/a11y": "^4.48.1",
45
+ "@wordpress/admin-ui": "^2.3.1",
46
+ "@wordpress/base-styles": "^10.0.1",
47
+ "@wordpress/commands": "^1.48.1",
48
+ "@wordpress/components": "^35.0.1",
49
+ "@wordpress/compose": "^8.1.1",
50
+ "@wordpress/core-data": "^7.48.1",
51
+ "@wordpress/data": "^10.48.1",
52
+ "@wordpress/editor": "^14.48.1",
53
+ "@wordpress/element": "^8.0.1",
54
+ "@wordpress/html-entities": "^4.48.1",
55
+ "@wordpress/i18n": "^6.21.1",
56
+ "@wordpress/icons": "^14.0.1",
57
+ "@wordpress/keyboard-shortcuts": "^5.48.1",
58
+ "@wordpress/keycodes": "^4.48.1",
59
+ "@wordpress/lazy-editor": "^1.14.1",
60
+ "@wordpress/notices": "^5.48.1",
61
+ "@wordpress/primitives": "^4.48.1",
62
+ "@wordpress/private-apis": "^1.48.1",
63
+ "@wordpress/route": "^0.14.1",
64
+ "@wordpress/theme": "^0.15.1",
65
+ "@wordpress/ui": "^0.15.1",
66
+ "@wordpress/url": "^4.48.1",
66
67
  "clsx": "^2.1.1"
67
68
  },
68
69
  "peerDependencies": {
@@ -72,5 +73,5 @@
72
73
  "publishConfig": {
73
74
  "access": "public"
74
75
  },
75
- "gitHead": "e7856693aeb4e2522d13608cd32c994e4a97cb9c"
76
+ "gitHead": "99df7432c5c7cb83ba41146fd1f57f3c19004305"
76
77
  }
@@ -72,7 +72,7 @@ function Navigation() {
72
72
  navigationKey={ navigationKey }
73
73
  onNavigate={ handleNavigate }
74
74
  content={
75
- <>
75
+ <div role="list">
76
76
  { items.map( ( item: MenuItem ) => {
77
77
  if ( item.parent_type === 'dropdown' ) {
78
78
  return (
@@ -117,7 +117,7 @@ function Navigation() {
117
117
  </NavigationItem>
118
118
  );
119
119
  } ) }
120
- </>
120
+ </div>
121
121
  }
122
122
  />
123
123
  );
@@ -16,9 +16,12 @@ import {
16
16
  SlotFillProvider,
17
17
  } from '@wordpress/components';
18
18
  import { menu } from '@wordpress/icons';
19
- import { useState, useEffect } from '@wordpress/element';
19
+ import { useState, useEffect, useMemo } from '@wordpress/element';
20
20
  import { __ } from '@wordpress/i18n';
21
- import { Page } from '@wordpress/admin-ui';
21
+ import { Page, getAdminThemeColors } from '@wordpress/admin-ui';
22
+ // eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
23
+ import { Tooltip } from '@wordpress/ui';
24
+ import { privateApis as themePrivateApis } from '@wordpress/theme';
22
25
 
23
26
  /**
24
27
  * Internal dependencies
@@ -30,9 +33,9 @@ import useRouteTitle from '../app/use-route-title';
30
33
  import { unlock } from '../../lock-unlock';
31
34
  import type { CanvasData } from '../../store/types';
32
35
  import './style.scss';
33
- import { UserThemeProvider } from '../user-theme-provider';
34
36
 
35
37
  const { useLocation, useMatches, Outlet } = unlock( routePrivateApis );
38
+ const { ThemeProvider } = unlock( themePrivateApis );
36
39
 
37
40
  export default function Root() {
38
41
  const matches = useMatches();
@@ -57,132 +60,150 @@ export default function Root() {
57
60
  setIsMobileSidebarOpen( false );
58
61
  }, [ location.pathname, isMobileViewport ] );
59
62
 
63
+ const themeColors = useMemo( getAdminThemeColors, [] );
64
+
60
65
  return (
61
66
  <SlotFillProvider>
62
- <UserThemeProvider isRoot color={ { bg: '#f8f8f8' } }>
63
- <UserThemeProvider color={ { bg: '#1d2327' } }>
64
- <div
65
- className={ clsx( 'boot-layout', {
66
- 'has-canvas': !! canvas || canvas === null,
67
- 'has-full-canvas': isFullScreen,
68
- } ) }
69
- >
70
- <SavePanel />
71
- <SnackbarNotices className="boot-notices__snackbar" />
72
- { isMobileViewport && (
73
- <Page.SidebarToggleFill>
74
- <Button
75
- icon={ menu }
76
- onClick={ () =>
77
- setIsMobileSidebarOpen( true )
78
- }
79
- label={ __( 'Open navigation panel' ) }
80
- size="compact"
81
- />
82
- </Page.SidebarToggleFill>
83
- ) }
84
- { /* Mobile Sidebar Backdrop */ }
85
- <AnimatePresence>
86
- { isMobileViewport &&
87
- isMobileSidebarOpen &&
88
- ! isFullScreen && (
89
- <motion.div
90
- initial={ { opacity: 0 } }
91
- animate={ { opacity: 1 } }
92
- exit={ { opacity: 0 } }
93
- transition={ {
94
- type: 'tween',
95
- duration: disableMotion ? 0 : 0.2,
96
- ease: 'easeOut',
97
- } }
98
- className="boot-layout__sidebar-backdrop"
67
+ <Tooltip.Provider>
68
+ <ThemeProvider
69
+ isRoot
70
+ color={ { ...themeColors, background: '#f8f8f8' } }
71
+ >
72
+ <ThemeProvider color={ themeColors }>
73
+ <div
74
+ className={ clsx( 'boot-layout', {
75
+ 'has-canvas': !! canvas || canvas === null,
76
+ 'has-full-canvas': isFullScreen,
77
+ } ) }
78
+ >
79
+ <SavePanel />
80
+ <SnackbarNotices className="boot-notices__snackbar" />
81
+ { isMobileViewport && (
82
+ <Page.SidebarToggleFill>
83
+ <Button
84
+ icon={ menu }
99
85
  onClick={ () =>
100
- setIsMobileSidebarOpen( false )
86
+ setIsMobileSidebarOpen( true )
101
87
  }
102
- onKeyDown={ ( event ) => {
103
- if ( event.key === 'Escape' ) {
104
- setIsMobileSidebarOpen( false );
105
- }
106
- } }
107
- role="button"
108
- tabIndex={ -1 }
109
- aria-label={ __(
110
- 'Close navigation panel'
111
- ) }
88
+ label={ __( 'Open navigation panel' ) }
89
+ size="compact"
112
90
  />
113
- ) }
114
- </AnimatePresence>
115
- { /* Mobile Sidebar */ }
116
- <AnimatePresence>
117
- { isMobileViewport &&
118
- isMobileSidebarOpen &&
119
- ! isFullScreen && (
120
- <motion.div
121
- initial={ { x: '-100%' } }
122
- animate={ { x: 0 } }
123
- exit={ { x: '-100%' } }
124
- transition={ {
125
- type: 'tween',
126
- duration: disableMotion ? 0 : 0.2,
127
- ease: 'easeOut',
128
- } }
129
- className="boot-layout__sidebar is-mobile"
130
- >
131
- <Sidebar />
132
- </motion.div>
133
- ) }
134
- </AnimatePresence>
135
- { /* Desktop Sidebar */ }
136
- { ! isMobileViewport && ! isFullScreen && (
137
- <div className="boot-layout__sidebar">
138
- <Sidebar />
139
- </div>
140
- ) }
141
- <div className="boot-layout__surfaces">
142
- <UserThemeProvider color={ { bg: '#ffffff' } }>
143
- <Outlet />
144
- { /* Render Canvas in Root to prevent remounting on route changes */ }
145
- { ( canvas || canvas === null ) && (
146
- <div
147
- className={ clsx(
148
- 'boot-layout__canvas',
149
- {
150
- 'has-mobile-drawer':
151
- canvas?.isPreview &&
152
- isMobileViewport,
91
+ </Page.SidebarToggleFill>
92
+ ) }
93
+ { /* Mobile Sidebar Backdrop */ }
94
+ <AnimatePresence>
95
+ { isMobileViewport &&
96
+ isMobileSidebarOpen &&
97
+ ! isFullScreen && (
98
+ <motion.div
99
+ initial={ { opacity: 0 } }
100
+ animate={ { opacity: 1 } }
101
+ exit={ { opacity: 0 } }
102
+ transition={ {
103
+ type: 'tween',
104
+ duration: disableMotion
105
+ ? 0
106
+ : 0.2,
107
+ ease: 'easeOut',
108
+ } }
109
+ className="boot-layout__sidebar-backdrop"
110
+ onClick={ () =>
111
+ setIsMobileSidebarOpen( false )
153
112
  }
154
- ) }
155
- >
156
- { canvas?.isPreview &&
157
- isMobileViewport && (
158
- <div className="boot-layout__mobile-sidebar-drawer">
159
- <Button
160
- icon={ menu }
161
- onClick={ () =>
162
- setIsMobileSidebarOpen(
163
- true
164
- )
165
- }
166
- label={ __(
167
- 'Open navigation panel'
168
- ) }
169
- size="compact"
170
- />
171
- </div>
113
+ onKeyDown={ ( event ) => {
114
+ if ( event.key === 'Escape' ) {
115
+ setIsMobileSidebarOpen(
116
+ false
117
+ );
118
+ }
119
+ } }
120
+ role="button"
121
+ tabIndex={ -1 }
122
+ aria-label={ __(
123
+ 'Close navigation panel'
172
124
  ) }
173
- <CanvasRenderer
174
- canvas={ canvas }
175
- routeContentModule={
176
- routeContentModule
177
- }
178
125
  />
179
- </div>
180
- ) }
181
- </UserThemeProvider>
126
+ ) }
127
+ </AnimatePresence>
128
+ { /* Mobile Sidebar */ }
129
+ <AnimatePresence>
130
+ { isMobileViewport &&
131
+ isMobileSidebarOpen &&
132
+ ! isFullScreen && (
133
+ <motion.div
134
+ initial={ { x: '-100%' } }
135
+ animate={ { x: 0 } }
136
+ exit={ { x: '-100%' } }
137
+ transition={ {
138
+ type: 'tween',
139
+ duration: disableMotion
140
+ ? 0
141
+ : 0.2,
142
+ ease: 'easeOut',
143
+ } }
144
+ className="boot-layout__sidebar is-mobile"
145
+ >
146
+ <Sidebar />
147
+ </motion.div>
148
+ ) }
149
+ </AnimatePresence>
150
+ { /* Desktop Sidebar */ }
151
+ { ! isMobileViewport && ! isFullScreen && (
152
+ <div className="boot-layout__sidebar">
153
+ <Sidebar />
154
+ </div>
155
+ ) }
156
+ <div className="boot-layout__surfaces">
157
+ <ThemeProvider
158
+ color={ {
159
+ ...themeColors,
160
+ background: '#ffffff',
161
+ } }
162
+ >
163
+ <Outlet />
164
+ { /* Render Canvas in Root to prevent remounting on route changes */ }
165
+ { ( canvas || canvas === null ) && (
166
+ <div
167
+ className={ clsx(
168
+ 'boot-layout__canvas',
169
+ {
170
+ 'has-mobile-drawer':
171
+ canvas?.isPreview &&
172
+ isMobileViewport,
173
+ }
174
+ ) }
175
+ >
176
+ { canvas?.isPreview &&
177
+ isMobileViewport && (
178
+ <div className="boot-layout__mobile-sidebar-drawer">
179
+ <Button
180
+ icon={ menu }
181
+ onClick={ () =>
182
+ setIsMobileSidebarOpen(
183
+ true
184
+ )
185
+ }
186
+ label={ __(
187
+ 'Open navigation panel'
188
+ ) }
189
+ size="compact"
190
+ />
191
+ </div>
192
+ ) }
193
+ <CanvasRenderer
194
+ canvas={ canvas }
195
+ routeContentModule={
196
+ routeContentModule
197
+ }
198
+ />
199
+ </div>
200
+ ) }
201
+ </ThemeProvider>
202
+ </div>
182
203
  </div>
183
- </div>
184
- </UserThemeProvider>
185
- </UserThemeProvider>
204
+ </ThemeProvider>
205
+ </ThemeProvider>
206
+ </Tooltip.Provider>
186
207
  </SlotFillProvider>
187
208
  );
188
209
  }