@gopherium/godmin 0.16.0 → 0.16.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.
package/dist/confirm.d.ts CHANGED
@@ -16,7 +16,7 @@ export interface ConfirmBodyProps {
16
16
  onCancel?: () => void;
17
17
  }
18
18
  /**
19
- * Renders the body of a confirmation modal: the question, a failure notice, a minimal Cancel and the confirm button.
19
+ * Renders the body of a confirmation modal: the question, a failure notice, a neutral Cancel and the confirm button.
20
20
  * @param props - The question, the labels, the busy flag, the failure and the handlers.
21
21
  * @returns The confirmation body.
22
22
  */
package/dist/confirm.js CHANGED
@@ -3,10 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Button, Stack, Text } from '@wordpress/ui';
4
4
  import { ErrorNotice } from './page.js';
5
5
  /**
6
- * Renders the body of a confirmation modal: the question, a failure notice, a minimal Cancel and the confirm button.
6
+ * Renders the body of a confirmation modal: the question, a failure notice, a neutral Cancel and the confirm button.
7
7
  * @param props - The question, the labels, the busy flag, the failure and the handlers.
8
8
  * @returns The confirmation body.
9
9
  */
10
10
  export function ConfirmBody({ children, confirmLabel, cancelLabel, busy = false, failure, onConfirm, onCancel, }) {
11
- return (_jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(Text, { children: children }), failure === undefined ? null : _jsx(ErrorNotice, { children: failure }), _jsxs(Stack, { direction: "row", gap: "sm", justify: "flex-end", children: [_jsx(Button, { variant: "minimal", disabled: busy, onClick: onCancel, children: cancelLabel }), _jsx(Button, { loading: busy, onClick: onConfirm, children: confirmLabel })] })] }));
11
+ return (_jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(Text, { children: children }), failure === undefined ? null : _jsx(ErrorNotice, { children: failure }), _jsxs(Stack, { direction: "row", gap: "sm", justify: "flex-end", children: [_jsx(Button, { variant: "minimal", tone: "neutral", disabled: busy, onClick: onCancel, children: cancelLabel }), _jsx(Button, { loading: busy, onClick: onConfirm, children: confirmLabel })] })] }));
12
12
  }
package/dist/rename.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface RenameBodyProps {
17
17
  onCancel?: () => void;
18
18
  }
19
19
  /**
20
- * Renders the body of a rename modal: the name field, a failure notice, a minimal Cancel and the submit button.
20
+ * Renders the body of a rename modal: the name field, a failure notice, a minimal neutral Cancel and the submit button.
21
21
  * @param props - The current name, the labels, the busy flag, the failure and the handlers.
22
22
  * @returns The rename form.
23
23
  */
package/dist/rename.js CHANGED
@@ -4,7 +4,7 @@ import { Button, InputControl, Stack } from '@wordpress/ui';
4
4
  import { useState } from 'react';
5
5
  import { ErrorNotice } from './page.js';
6
6
  /**
7
- * Renders the body of a rename modal: the name field, a failure notice, a minimal Cancel and the submit button.
7
+ * Renders the body of a rename modal: the name field, a failure notice, a minimal neutral Cancel and the submit button.
8
8
  * @param props - The current name, the labels, the busy flag, the failure and the handlers.
9
9
  * @returns The rename form.
10
10
  */
@@ -16,5 +16,5 @@ export function RenameBody({ name, fieldLabel, submitLabel, cancelLabel, busy =
16
16
  if (writable) {
17
17
  onSubmit(value);
18
18
  }
19
- }, children: _jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(InputControl, { label: fieldLabel, value: value, onChange: (event) => setValue(event.target.value) }), failure === undefined ? null : _jsx(ErrorNotice, { children: failure }), _jsxs(Stack, { direction: "row", gap: "sm", justify: "flex-end", children: [_jsx(Button, { variant: "minimal", disabled: busy, onClick: onCancel, children: cancelLabel }), _jsx(Button, { type: "submit", loading: busy, disabled: !writable, children: submitLabel })] })] }) }));
19
+ }, children: _jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(InputControl, { label: fieldLabel, value: value, onChange: (event) => setValue(event.target.value) }), failure === undefined ? null : _jsx(ErrorNotice, { children: failure }), _jsxs(Stack, { direction: "row", gap: "sm", justify: "flex-end", children: [_jsx(Button, { variant: "minimal", tone: "neutral", disabled: busy, onClick: onCancel, children: cancelLabel }), _jsx(Button, { type: "submit", loading: busy, disabled: !writable, children: submitLabel })] })] }) }));
20
20
  }
package/dist/testing.d.ts CHANGED
@@ -56,9 +56,10 @@ export declare function badgeClasses(intent: ComponentProps<typeof Badge>['inten
56
56
  * Returns the classes a design system button draws at the given variant and size.
57
57
  * @param variant - The button variant to sample.
58
58
  * @param size - The button size, the default one when absent.
59
+ * @param tone - The button tone, the brand one when absent.
59
60
  * @returns The class names, in order.
60
61
  */
61
- export declare function buttonClasses(variant: ComponentProps<typeof Button>['variant'], size?: ComponentProps<typeof Button>['size']): string[];
62
+ export declare function buttonClasses(variant: ComponentProps<typeof Button>['variant'], size?: ComponentProps<typeof Button>['size'], tone?: ComponentProps<typeof Button>['tone']): string[];
62
63
  /**
63
64
  * Renders the given tree inside the design system host.
64
65
  * @param ui - The tree to render.
package/dist/testing.js CHANGED
@@ -188,10 +188,11 @@ export function badgeClasses(intent) {
188
188
  * Returns the classes a design system button draws at the given variant and size.
189
189
  * @param variant - The button variant to sample.
190
190
  * @param size - The button size, the default one when absent.
191
+ * @param tone - The button tone, the brand one when absent.
191
192
  * @returns The class names, in order.
192
193
  */
193
- export function buttonClasses(variant, size) {
194
- return classesOf(_jsx(Button, { variant: variant, size: size, children: "probe" }));
194
+ export function buttonClasses(variant, size, tone) {
195
+ return classesOf(_jsx(Button, { variant: variant, size: size, tone: tone, children: "probe" }));
195
196
  }
196
197
  /**
197
198
  * Renders the given tree inside the design system host.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gopherium/godmin",
3
- "version": "0.16.0",
3
+ "version": "0.16.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",