@gopherium/godmin 0.8.0 → 0.8.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.
@@ -10,5 +10,5 @@ export interface AdminRootProps extends ThemeSettings {
10
10
  * @param props - The theme settings, root element type and children.
11
11
  * @returns The host element wrapping the themed children.
12
12
  */
13
- export declare function AdminRoot({ children, as: Root, ...theme }: AdminRootProps): import("react").JSX.Element;
13
+ export declare function AdminRoot({ children, as: Root, color, ...theme }: AdminRootProps): import("react").JSX.Element;
14
14
  export {};
@@ -2,12 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { ThemeProvider } from '@wordpress/theme';
4
4
  import { useEnableWpCompatOverlaySlot } from '@wordpress/ui';
5
+ /** The design system's own primary color, seeded when an application names none. */
6
+ const DEFAULT_COLOR = { primary: '#3858e9' };
5
7
  /**
6
8
  * Hosts a design system application in its own stacking context.
7
9
  * @param props - The theme settings, root element type and children.
8
10
  * @returns The host element wrapping the themed children.
9
11
  */
10
- export function AdminRoot({ children, as: Root = 'div', ...theme }) {
12
+ export function AdminRoot({ children, as: Root = 'div', color = DEFAULT_COLOR, ...theme }) {
11
13
  useEnableWpCompatOverlaySlot();
12
- return (_jsx(Root, { style: { isolation: 'isolate' }, children: _jsx(ThemeProvider, { ...theme, isRoot: true, children: children }) }));
14
+ return (_jsx(Root, { style: { isolation: 'isolate' }, children: _jsx(ThemeProvider, { color: color, ...theme, isRoot: true, children: children }) }));
13
15
  }
package/dist/frame.js CHANGED
@@ -42,7 +42,7 @@ function Rail({ children, brand, menuLabel = 'Open navigation' }) {
42
42
  * @param props - The rail content, the brand, and the menu button label.
43
43
  * @returns The top bar element.
44
44
  */
45
- function TopBar({ children, brand, menuLabel }) {
45
+ function TopBar({ children, brand, menuLabel, }) {
46
46
  const { location, layout } = useContext(FrameContext);
47
47
  const [open, setOpen] = useState(false);
48
48
  useEffect(() => {
package/dist/testing.js CHANGED
@@ -129,8 +129,17 @@ function installFeatureDetection() {
129
129
  function installResizeObserver() {
130
130
  if (typeof globalThis.ResizeObserver !== 'function') {
131
131
  globalThis.ResizeObserver = class {
132
+ /**
133
+ * Watches an element.
134
+ */
132
135
  observe() { }
136
+ /**
137
+ * Stops watching an element.
138
+ */
133
139
  unobserve() { }
140
+ /**
141
+ * Stops watching every element.
142
+ */
134
143
  disconnect() { }
135
144
  };
136
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gopherium/godmin",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "The admin kit for Gopherium projects: host layer for React admin applications on the WordPress Design System.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",