@gopherium/godmin 0.12.0 → 0.13.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/dist/base.css +30 -3
- package/dist/rows.js +3 -5
- package/package.json +3 -1
package/dist/base.css
CHANGED
|
@@ -203,6 +203,19 @@ body {
|
|
|
203
203
|
white-space: nowrap;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
.godmin-table__actions * {
|
|
207
|
+
white-space: nowrap;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.godmin-table tbody tr:is(:hover, :has(:focus-visible)) > * {
|
|
211
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.godmin-table-scroll:focus-visible {
|
|
215
|
+
outline: var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus);
|
|
216
|
+
outline-offset: 2px;
|
|
217
|
+
}
|
|
218
|
+
|
|
206
219
|
.godmin-loading-screen,
|
|
207
220
|
.godmin-loading-rows {
|
|
208
221
|
opacity: 0;
|
|
@@ -292,6 +305,14 @@ body {
|
|
|
292
305
|
margin-inline-start: auto;
|
|
293
306
|
}
|
|
294
307
|
|
|
308
|
+
.godmin-rows__remove {
|
|
309
|
+
margin-inline-start: calc(var(--wpds-dimension-gap-md) - var(--wpds-dimension-gap-xs));
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.godmin-table__actions .godmin-rows__controls {
|
|
313
|
+
justify-content: flex-end;
|
|
314
|
+
}
|
|
315
|
+
|
|
295
316
|
.godmin-log-list {
|
|
296
317
|
margin: 0;
|
|
297
318
|
padding: 0;
|
|
@@ -368,9 +389,15 @@ body {
|
|
|
368
389
|
overflow-x: auto;
|
|
369
390
|
}
|
|
370
391
|
|
|
371
|
-
.godmin-table-scroll
|
|
372
|
-
|
|
373
|
-
|
|
392
|
+
.godmin-table-scroll .godmin-table__actions {
|
|
393
|
+
position: sticky;
|
|
394
|
+
inset-inline-end: 0;
|
|
395
|
+
background: var(--wpds-color-background-surface-neutral);
|
|
396
|
+
box-shadow: inset var(--wpds-border-width-xs) 0 0 var(--wpds-color-stroke-surface-neutral);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.godmin-table-scroll .godmin-table__actions:dir(rtl) {
|
|
400
|
+
box-shadow: inset calc(-1 * var(--wpds-border-width-xs)) 0 0 var(--wpds-color-stroke-surface-neutral);
|
|
374
401
|
}
|
|
375
402
|
}
|
|
376
403
|
}
|
package/dist/rows.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
3
|
+
import { chevronDown, chevronUp, trash } from '@wordpress/icons';
|
|
4
|
+
import { Button, IconButton, Stack, Text, Tooltip } from '@wordpress/ui';
|
|
4
5
|
import { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
5
6
|
import { useRowKeys } from './row-keys.js';
|
|
6
|
-
const upIcon = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("path", { d: "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" }) }));
|
|
7
|
-
const downIcon = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("path", { d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" }) }));
|
|
8
|
-
const removeIcon = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("path", { d: "M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z" }) }));
|
|
9
7
|
/**
|
|
10
8
|
* Renders the buttons that move a row among its siblings and take it away.
|
|
11
9
|
* @param props - The row's place, the list's length, the words and what to call on a change.
|
|
12
10
|
* @returns The controls element.
|
|
13
11
|
*/
|
|
14
12
|
export function RowControls({ at, count, removable = true, labels, onMove, onRemove }) {
|
|
15
|
-
return (_jsxs(Stack, { direction: "row", gap: "xs", align: "center", className: "godmin-rows__controls", children: [_jsx(IconButton, { icon:
|
|
13
|
+
return (_jsxs(Stack, { direction: "row", gap: "xs", align: "center", className: "godmin-rows__controls", children: [_jsx(IconButton, { icon: chevronUp, label: labels.moveUp, size: "compact", variant: "minimal", tone: "neutral", disabled: at === 0, onClick: () => onMove(-1) }), _jsx(IconButton, { icon: chevronDown, label: labels.moveDown, size: "compact", variant: "minimal", tone: "neutral", disabled: at === count - 1, onClick: () => onMove(1) }), _jsx(IconButton, { icon: trash, label: labels.remove, className: "godmin-rows__remove", positioner: _jsx(Tooltip.Positioner, { align: "end" }), size: "compact", variant: "minimal", tone: "neutral", disabled: !removable, onClick: onRemove })] }));
|
|
16
14
|
}
|
|
17
15
|
/**
|
|
18
16
|
* Returns where focus goes after the rows shown change.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gopherium/godmin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
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",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@tanstack/react-router": "^1.170.0",
|
|
60
60
|
"@testing-library/react": "^16.3.2",
|
|
61
|
+
"@wordpress/icons": ">=16.0.0 <17.0.0",
|
|
61
62
|
"@wordpress/style-runtime": ">=0.11.0 <0.12.0",
|
|
62
63
|
"@wordpress/theme": ">=2.1.0 <3.0.0",
|
|
63
64
|
"@wordpress/ui": ">=0.22.0 <0.23.0",
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
"@vitest/coverage-v8": "^4.1.10",
|
|
89
90
|
"@wordpress/a11y": "4.55.0",
|
|
90
91
|
"@wordpress/element": "8.7.0",
|
|
92
|
+
"@wordpress/icons": "16.0.0",
|
|
91
93
|
"@wordpress/style-runtime": "0.11.0",
|
|
92
94
|
"@wordpress/theme": "2.1.0",
|
|
93
95
|
"@wordpress/ui": "0.22.0",
|