@polyxd/react 0.2.0 → 0.2.2
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/components/action-bar.d.ts +16 -0
- package/dist/components/action-bar.js +96 -0
- package/dist/components/action-bar.js.map +1 -0
- package/dist/components/content.js +53 -7
- package/dist/components/content.js.map +1 -1
- package/dist/components/flow.d.ts +0 -4
- package/dist/components/flow.js +84 -6
- package/dist/components/flow.js.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs.d.ts +6 -0
- package/dist/components/inputs.js +98 -8
- package/dist/components/inputs.js.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/skeleton.d.ts +16 -0
- package/dist/skeleton.js +30 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/surface.d.ts +7 -1
- package/dist/surface.js +7 -5
- package/dist/surface.js.map +1 -1
- package/package.json +2 -2
- package/src/styles.css +287 -0
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** What each pattern's surface usually looks like, so the placeholder has the right silhouette. */
|
|
3
|
+
const PATTERN_SHAPE = {
|
|
4
|
+
"multi-step-form": "form",
|
|
5
|
+
"filter-and-browse": "list",
|
|
6
|
+
"undo-over-confirm": "list",
|
|
7
|
+
"compare-and-choose": "compare",
|
|
8
|
+
"confirm-destructive": "dialog",
|
|
9
|
+
"review-and-submit": "detail",
|
|
10
|
+
};
|
|
11
|
+
/** One placeholder block. `kind` sets its height and radius; `size` its width as a share of the row. */
|
|
12
|
+
function Block({ kind, size }) {
|
|
13
|
+
return _jsx("span", { className: `pxd-skeleton-block pxd-skeleton-${kind}${size ? ` pxd-skeleton-${size}` : ""}` });
|
|
14
|
+
}
|
|
15
|
+
const Row = ({ children }) => _jsx("div", { className: "pxd-skeleton-row", children: children });
|
|
16
|
+
const times = (n, render) => Array.from({ length: n }, (_, i) => render(i));
|
|
17
|
+
const SHAPES = {
|
|
18
|
+
list: () => (_jsxs(_Fragment, { children: [_jsx(Block, { kind: "field", size: "full" }), times(5, (i) => (_jsxs(Row, { children: [_jsx(Block, { kind: "square" }), _jsxs("div", { className: "pxd-skeleton-lines", children: [_jsx(Block, { kind: "line", size: i % 2 ? "medium" : "long" }), _jsx(Block, { kind: "small", size: "short" })] })] }, i)))] })),
|
|
19
|
+
form: () => (_jsxs(_Fragment, { children: [times(4, (i) => (_jsxs("div", { className: "pxd-skeleton-lines", children: [_jsx(Block, { kind: "small", size: "short" }), _jsx(Block, { kind: "field", size: i === 1 ? "medium" : "long" })] }, i))), _jsxs("div", { className: "pxd-skeleton-actions", children: [_jsx(Block, { kind: "button" }), _jsx(Block, { kind: "button" })] })] })),
|
|
20
|
+
detail: () => (_jsxs(_Fragment, { children: [_jsxs(Row, { children: [_jsx(Block, { kind: "circle" }), _jsxs("div", { className: "pxd-skeleton-lines", children: [_jsxs(Row, { children: [_jsx(Block, { kind: "line", size: "medium" }), _jsx(Block, { kind: "badge" })] }), _jsx(Block, { kind: "small", size: "short" })] })] }), _jsx("div", { className: "pxd-skeleton-dl", children: times(6, (i) => (_jsxs(Row, { children: [_jsx(Block, { kind: "small", size: "short" }), _jsx(Block, { kind: "line", size: i % 3 === 2 ? "medium" : "long" })] }, i))) })] })),
|
|
21
|
+
dashboard: () => (_jsxs(_Fragment, { children: [_jsx("div", { className: "pxd-skeleton-cards", children: times(3, (i) => (_jsxs("div", { className: "pxd-skeleton-card", children: [_jsx(Block, { kind: "small", size: "short" }), _jsx(Block, { kind: "value", size: "medium" })] }, i))) }), _jsx(Block, { kind: "chart", size: "full" })] })),
|
|
22
|
+
dialog: () => (_jsxs(_Fragment, { children: [_jsx(Block, { kind: "line", size: "long" }), _jsx(Block, { kind: "line", size: "medium" }), _jsxs("div", { className: "pxd-skeleton-actions", children: [_jsx(Block, { kind: "button" }), _jsx(Block, { kind: "button" })] })] })),
|
|
23
|
+
compare: () => (_jsx("div", { className: "pxd-skeleton-cards", children: times(3, (c) => (_jsxs("div", { className: "pxd-skeleton-card", children: [_jsx(Block, { kind: "line", size: "medium" }), times(5, (i) => (_jsx(Block, { kind: "small", size: i % 2 ? "short" : "long" }, i)))] }, c))) })),
|
|
24
|
+
};
|
|
25
|
+
/** The loading state for a surface that has not arrived yet: the shape it will take, shimmering. */
|
|
26
|
+
export function PolyxdSkeleton({ title, pattern, shape, theme, mode, density, locale = "en-GB", className }) {
|
|
27
|
+
const chosen = shape ?? (pattern ? PATTERN_SHAPE[pattern] : undefined) ?? "detail";
|
|
28
|
+
return (_jsxs("div", { className: ["pxd-surface", "pxd-skeleton", `pxd-skeleton-${chosen}`, className].filter(Boolean).join(" "), "data-pxd-theme": theme, "data-pxd-mode": mode, "data-pxd-density": density, lang: locale, role: "status", "aria-busy": "true", children: [_jsx("span", { className: "pxd-sr-only", children: title ? `Preparing ${title}` : "Preparing" }), _jsxs("div", { className: "pxd-skeleton-body", "aria-hidden": "true", children: [_jsx(Block, { kind: "title", size: chosen === "dialog" ? "short" : "medium" }), SHAPES[chosen]()] })] }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../src/skeleton.tsx"],"names":[],"mappings":";AAkBA,mGAAmG;AACnG,MAAM,aAAa,GAAkC;IACnD,iBAAiB,EAAE,MAAM;IACzB,mBAAmB,EAAE,MAAM;IAC3B,mBAAmB,EAAE,MAAM;IAC3B,oBAAoB,EAAE,SAAS;IAC/B,qBAAqB,EAAE,QAAQ;IAC/B,mBAAmB,EAAE,QAAQ;CAC9B,CAAC;AAEF,wGAAwG;AACxG,SAAS,KAAK,CAAC,EAAE,IAAI,EA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AAE,SAAS,EAAuB;IAC9H,MAAM,MAAM,GAAG,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC;IACnF,OAAO,CACL,eACE,SAAS,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,oBACzF,KAAK,mBACN,IAAI,sBACD,OAAO,EACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAC,QAAQ,eACH,MAAM,aAEhB,eAAM,SAAS,EAAC,aAAa,YAAE,KAAK,CAAC,CAAC,CAAC,aAAa,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,GAAQ,EACjF,eAAK,SAAS,EAAC,mBAAmB,iBAAa,MAAM,aACnD,KAAC,KAAK,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,GAAI,EACrE,MAAM,CAAC,MAAM,CAAC,EAAE,IACb,IACF,CACP,CAAC;AACJ,CAAC"}
|
package/dist/surface.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export interface PolyxdSurfaceProps {
|
|
|
9
9
|
onAction?: (event: ActionEvent) => void;
|
|
10
10
|
/** Called with the new data whenever an input changes it. */
|
|
11
11
|
onDataChange?: (data: Data) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Derived data: called after every input change with the new data and may return a replacement,
|
|
14
|
+
* so a receipt, a total or a filtered list can follow what the person types without the host
|
|
15
|
+
* remounting the surface. Pure: same data in, same data out.
|
|
16
|
+
*/
|
|
17
|
+
derive?: (data: Data) => Data | void;
|
|
12
18
|
/** Called for ui.dismiss (Cancel on a dialog, closing the surface). */
|
|
13
19
|
onDismiss?: () => void;
|
|
14
20
|
/** Design-system pack name, e.g. "material3" (matching a loaded theme CSS file). */
|
|
@@ -26,7 +32,7 @@ export interface PolyxdSurfaceProps {
|
|
|
26
32
|
className?: string;
|
|
27
33
|
}
|
|
28
34
|
/** Renders one Polyxd UI document. */
|
|
29
|
-
export declare function PolyxdSurface({ document: doc, data: initial, onAction, onDataChange, onDismiss, theme, mode, density, disclosure, locale, resolveMedia, components: overrides, className }: PolyxdSurfaceProps): import("react").JSX.Element;
|
|
35
|
+
export declare function PolyxdSurface({ document: doc, data: initial, onAction, onDataChange, derive, onDismiss, theme, mode, density, disclosure, locale, resolveMedia, components: overrides, className }: PolyxdSurfaceProps): import("react").JSX.Element;
|
|
30
36
|
/** Renders a component by id in the current scope. */
|
|
31
37
|
export declare function Render({ id, scope }: {
|
|
32
38
|
id: string;
|
package/dist/surface.js
CHANGED
|
@@ -5,16 +5,18 @@ import { ROOT_SCOPE, resolve, resolveContext, set } from "./data.js";
|
|
|
5
5
|
import { registry } from "./components/index.js";
|
|
6
6
|
import { Avatar } from "./components/avatar.js";
|
|
7
7
|
/** Renders one Polyxd UI document. */
|
|
8
|
-
export function PolyxdSurface({ document: doc, data: initial, onAction, onDataChange, onDismiss, theme, mode, density, disclosure = "progressive", locale = "en-GB", resolveMedia, components: overrides, className }) {
|
|
8
|
+
export function PolyxdSurface({ document: doc, data: initial, onAction, onDataChange, derive, onDismiss, theme, mode, density, disclosure = "progressive", locale = "en-GB", resolveMedia, components: overrides, className }) {
|
|
9
9
|
const [data, setData] = useState(() => initial ?? doc.data ?? {});
|
|
10
10
|
const [portal, setPortal] = useState(null);
|
|
11
|
+
const [root, setRoot] = useState(null);
|
|
11
12
|
const byId = useMemo(() => new Map(doc.components.map((c) => [c.id, c])), [doc]);
|
|
12
13
|
const components = useMemo(() => ({ ...registry, ...overrides }), [overrides]);
|
|
13
14
|
const setValue = useCallback((pointer, value) => setData((d) => {
|
|
14
|
-
const
|
|
15
|
+
const written = set(d, pointer, value);
|
|
16
|
+
const next = derive?.(written) ?? written;
|
|
15
17
|
onDataChange?.(next);
|
|
16
18
|
return next;
|
|
17
|
-
}), [onDataChange]);
|
|
19
|
+
}), [onDataChange, derive]);
|
|
18
20
|
const dispatch = useCallback((action, scope, source) => {
|
|
19
21
|
if (!action)
|
|
20
22
|
return;
|
|
@@ -23,10 +25,10 @@ export function PolyxdSurface({ document: doc, data: initial, onAction, onDataCh
|
|
|
23
25
|
return onDismiss?.();
|
|
24
26
|
onAction?.({ name, context: resolveContext(context, data, scope), source });
|
|
25
27
|
}, [data, onAction, onDismiss]);
|
|
26
|
-
const value = { doc, byId, data, setValue, dispatch, locale, resolveMedia, portal, components, disclosure };
|
|
28
|
+
const value = { doc, byId, data, setValue, dispatch, locale, resolveMedia, portal, root, components, disclosure };
|
|
27
29
|
const rootIsDialog = byId.get(doc.root)?.component === "Confirm";
|
|
28
30
|
const nav = doc.components.find((c) => c.component === "Navigation" && (!c.kind || c.kind === "main"));
|
|
29
|
-
return (_jsx(SurfaceContext.Provider, { value: value, children: _jsxs("div", { className: ["pxd-surface", doc.surface.presentation === "panel" ? "pxd-surface-panel" : null, nav ? "pxd-surface-with-nav" : null, className].filter(Boolean).join(" "), "data-pxd-theme": theme, "data-pxd-mode": mode, "data-pxd-density": density, "data-pxd-surface": doc.surface.id, lang: locale, children: [nav && _jsx(Render, { id: nav.id }), _jsxs("div", { className: "pxd-surface-main", children: [!rootIsDialog && _jsx(SurfaceHeader, {}), _jsx(Render, { id: doc.root })] }), _jsx("div", { ref: setPortal, className: "pxd-portal" })] }) }));
|
|
31
|
+
return (_jsx(SurfaceContext.Provider, { value: value, children: _jsxs("div", { ref: setRoot, className: ["pxd-surface", doc.surface.presentation === "panel" ? "pxd-surface-panel" : null, nav ? "pxd-surface-with-nav" : null, className].filter(Boolean).join(" "), "data-pxd-theme": theme, "data-pxd-mode": mode, "data-pxd-density": density, "data-pxd-surface": doc.surface.id, lang: locale, children: [nav && _jsx(Render, { id: nav.id }), _jsxs("div", { className: "pxd-surface-main", children: [!rootIsDialog && _jsx(SurfaceHeader, {}), _jsx(Render, { id: doc.root })] }), _jsx("div", { ref: setPortal, className: "pxd-portal" })] }) }));
|
|
30
32
|
}
|
|
31
33
|
/** Title, and on a record page: where it sits, what state it's in, and what you can do to it. */
|
|
32
34
|
function SurfaceHeader() {
|
package/dist/surface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../src/surface.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAA0E,MAAM,cAAe,CAAC;AAC/J,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAyB,MAAM,WAAW,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAA0B,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../src/surface.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAA0E,MAAM,cAAe,CAAC;AAC/J,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAyB,MAAM,WAAW,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAA0B,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAyB,CAAC;AAiCjD,sCAAsC;AACtC,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAA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,CAAU,EAAE,EAAE;QAC1B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC;IACF,OAAO;QACL,GAAG,GAAG;QACN,YAAY,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QAC/D,kBAAkB,EAAE,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;QACjF,WAAW,EAAE,CAAC,CAAC,IAAI;QACnB,aAAa,EAAE,CAAC,CAAC,MAAM,IAAI,SAAS;KACV,CAAC;AAC/B,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polyxd/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "React renderer for Polyxd UI documents: Radix primitives styled by design-system tokens",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-dom": "^19.3.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@polyxd/spec": "^0.2.
|
|
40
|
+
"@polyxd/spec": "^0.2.2",
|
|
41
41
|
"radix-ui": "^1.6.7"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
package/src/styles.css
CHANGED
|
@@ -2687,6 +2687,7 @@ video.pxd-media {
|
|
|
2687
2687
|
}
|
|
2688
2688
|
.pxd-task-title {
|
|
2689
2689
|
flex: 1;
|
|
2690
|
+
min-height: var(--pxd-size-target-min);
|
|
2690
2691
|
padding: var(--pxd-space-inset-compact) 0;
|
|
2691
2692
|
border: 0;
|
|
2692
2693
|
background: none;
|
|
@@ -4120,3 +4121,289 @@ video.pxd-media {
|
|
|
4120
4121
|
transition: none;
|
|
4121
4122
|
}
|
|
4122
4123
|
}
|
|
4124
|
+
|
|
4125
|
+
/* Keyboard shortcut hints (Action.shortcut): one kbd per key after the label, hidden where there is
|
|
4126
|
+
no keyboard. The hint is decoration; aria-keyshortcuts on the button carries the meaning. */
|
|
4127
|
+
.pxd-kbd-hint {
|
|
4128
|
+
display: inline-flex;
|
|
4129
|
+
align-items: center;
|
|
4130
|
+
gap: calc(var(--pxd-space-inline-tight) / 2);
|
|
4131
|
+
margin-inline-start: var(--pxd-space-inline-tight);
|
|
4132
|
+
}
|
|
4133
|
+
.pxd-kbd {
|
|
4134
|
+
font-family: var(--pxd-type-label-small-family);
|
|
4135
|
+
font-size: var(--pxd-type-label-small-size);
|
|
4136
|
+
font-weight: var(--pxd-type-label-small-weight);
|
|
4137
|
+
line-height: var(--pxd-type-label-small-line-height);
|
|
4138
|
+
letter-spacing: var(--pxd-type-label-small-letter-spacing);
|
|
4139
|
+
font-variant-numeric: tabular-nums;
|
|
4140
|
+
min-width: 1.6em;
|
|
4141
|
+
padding: 0 var(--pxd-space-inline-tight);
|
|
4142
|
+
border: var(--pxd-border-width-default) solid var(--pxd-color-border-default);
|
|
4143
|
+
border-radius: var(--pxd-radius-small);
|
|
4144
|
+
color: var(--pxd-color-text-muted);
|
|
4145
|
+
text-align: center;
|
|
4146
|
+
white-space: nowrap;
|
|
4147
|
+
}
|
|
4148
|
+
/* On a filled button the muted grey is not guaranteed to contrast with the pack's primary, so the
|
|
4149
|
+
hint borrows the button's own foreground, only slightly faded, and the border fades further. */
|
|
4150
|
+
.pxd-button-primary .pxd-kbd,
|
|
4151
|
+
.pxd-button-danger .pxd-kbd {
|
|
4152
|
+
color: color-mix(in srgb, currentColor 85%, transparent);
|
|
4153
|
+
border-color: color-mix(in srgb, currentColor 55%, transparent);
|
|
4154
|
+
}
|
|
4155
|
+
/* A described button stacks label over description; the hint sits in the top trailing corner. */
|
|
4156
|
+
.pxd-button-described {
|
|
4157
|
+
position: relative;
|
|
4158
|
+
}
|
|
4159
|
+
.pxd-button-described .pxd-kbd-hint {
|
|
4160
|
+
position: absolute;
|
|
4161
|
+
inset-inline-end: var(--pxd-space-inset-default);
|
|
4162
|
+
top: var(--pxd-space-stack-tight);
|
|
4163
|
+
margin-inline-start: 0;
|
|
4164
|
+
}
|
|
4165
|
+
@container pxd (width < 30rem) {
|
|
4166
|
+
/* Stacked action bars are the phone layout, and phones have no keyboard. */
|
|
4167
|
+
.pxd-action-bar .pxd-kbd-hint {
|
|
4168
|
+
display: none;
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
/* Skeleton (PolyxdSkeleton): the loading state for a surface that has not arrived yet. Blocks are
|
|
4173
|
+
sized from the type and control tokens so the placeholder has the pack's rhythm, and shimmer
|
|
4174
|
+
with a sweep across two neutral mixes of the surface colour. */
|
|
4175
|
+
.pxd-skeleton-body {
|
|
4176
|
+
display: flex;
|
|
4177
|
+
flex-direction: column;
|
|
4178
|
+
gap: var(--polyxd-stack-apart);
|
|
4179
|
+
}
|
|
4180
|
+
.pxd-skeleton-block {
|
|
4181
|
+
--polyxd-skeleton-base: color-mix(in srgb, var(--pxd-color-text-muted) 14%, var(--pxd-color-surface-default));
|
|
4182
|
+
--polyxd-skeleton-sheen: color-mix(in srgb, var(--pxd-color-text-muted) 6%, var(--pxd-color-surface-default));
|
|
4183
|
+
display: block;
|
|
4184
|
+
flex: none;
|
|
4185
|
+
width: 100%;
|
|
4186
|
+
border-radius: var(--pxd-radius-small);
|
|
4187
|
+
background: linear-gradient(90deg, var(--polyxd-skeleton-base) 0 35%, var(--polyxd-skeleton-sheen) 50%, var(--polyxd-skeleton-base) 65% 100%);
|
|
4188
|
+
background-size: 300% 100%;
|
|
4189
|
+
animation: pxd-skeleton-sweep calc(var(--pxd-motion-duration-long) * 4) linear infinite;
|
|
4190
|
+
}
|
|
4191
|
+
@keyframes pxd-skeleton-sweep {
|
|
4192
|
+
from { background-position: 100% 0; }
|
|
4193
|
+
to { background-position: 0 0; }
|
|
4194
|
+
}
|
|
4195
|
+
/* Widths as a share of the row, so the lines look like text of varying length. */
|
|
4196
|
+
.pxd-skeleton-short { width: 30%; }
|
|
4197
|
+
.pxd-skeleton-medium { width: 55%; }
|
|
4198
|
+
.pxd-skeleton-long { width: 85%; }
|
|
4199
|
+
.pxd-skeleton-full { width: 100%; }
|
|
4200
|
+
/* Heights: each text block is one line of the role it stands in for. */
|
|
4201
|
+
.pxd-skeleton-title { height: calc(var(--pxd-type-title-page-size) * var(--pxd-type-title-page-line-height)); }
|
|
4202
|
+
.pxd-skeleton-line { height: calc(var(--pxd-type-body-default-size) * var(--pxd-type-body-default-line-height)); }
|
|
4203
|
+
.pxd-skeleton-small { height: calc(var(--pxd-type-body-small-size) * var(--pxd-type-body-small-line-height)); }
|
|
4204
|
+
.pxd-skeleton-value { height: calc(var(--pxd-type-numeric-display-size) * var(--pxd-type-numeric-display-line-height)); }
|
|
4205
|
+
.pxd-skeleton-field,
|
|
4206
|
+
.pxd-skeleton-button {
|
|
4207
|
+
height: var(--polyxd-control);
|
|
4208
|
+
border-radius: var(--pxd-radius-control);
|
|
4209
|
+
}
|
|
4210
|
+
.pxd-skeleton-button { width: calc(var(--pxd-size-target-min) * 2.5); }
|
|
4211
|
+
.pxd-skeleton-square {
|
|
4212
|
+
width: var(--polyxd-row-height);
|
|
4213
|
+
height: var(--polyxd-row-height);
|
|
4214
|
+
border-radius: var(--pxd-radius-default);
|
|
4215
|
+
}
|
|
4216
|
+
.pxd-skeleton-circle {
|
|
4217
|
+
width: var(--pxd-size-target-min);
|
|
4218
|
+
height: var(--pxd-size-target-min);
|
|
4219
|
+
border-radius: var(--pxd-radius-full);
|
|
4220
|
+
}
|
|
4221
|
+
.pxd-skeleton-badge {
|
|
4222
|
+
width: calc(var(--pxd-space-inset-comfortable) * 3);
|
|
4223
|
+
height: calc(var(--pxd-type-label-small-size) * var(--pxd-type-label-small-line-height));
|
|
4224
|
+
border-radius: var(--pxd-radius-full);
|
|
4225
|
+
}
|
|
4226
|
+
.pxd-skeleton-chart {
|
|
4227
|
+
height: 16rem; /* the chart's own max-height in .pxd-chart-svg */
|
|
4228
|
+
border-radius: var(--pxd-radius-default);
|
|
4229
|
+
}
|
|
4230
|
+
.pxd-skeleton-row {
|
|
4231
|
+
display: flex;
|
|
4232
|
+
align-items: center;
|
|
4233
|
+
gap: var(--pxd-space-inline-default);
|
|
4234
|
+
}
|
|
4235
|
+
.pxd-skeleton-lines {
|
|
4236
|
+
display: flex;
|
|
4237
|
+
flex: 1;
|
|
4238
|
+
min-width: 0;
|
|
4239
|
+
flex-direction: column;
|
|
4240
|
+
gap: var(--pxd-space-stack-tight);
|
|
4241
|
+
}
|
|
4242
|
+
.pxd-skeleton-actions {
|
|
4243
|
+
display: flex;
|
|
4244
|
+
flex-direction: row-reverse;
|
|
4245
|
+
justify-content: flex-end;
|
|
4246
|
+
gap: var(--pxd-space-inline-default);
|
|
4247
|
+
}
|
|
4248
|
+
.pxd-skeleton-dl {
|
|
4249
|
+
display: grid;
|
|
4250
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
|
|
4251
|
+
gap: var(--polyxd-stack) var(--pxd-space-inline-loose);
|
|
4252
|
+
}
|
|
4253
|
+
.pxd-skeleton-dl .pxd-skeleton-row {
|
|
4254
|
+
display: contents;
|
|
4255
|
+
}
|
|
4256
|
+
.pxd-skeleton-cards {
|
|
4257
|
+
display: grid;
|
|
4258
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
4259
|
+
gap: var(--pxd-space-inline-default);
|
|
4260
|
+
}
|
|
4261
|
+
.pxd-skeleton-card {
|
|
4262
|
+
display: flex;
|
|
4263
|
+
flex-direction: column;
|
|
4264
|
+
gap: var(--polyxd-stack);
|
|
4265
|
+
padding: var(--pxd-space-inset-default);
|
|
4266
|
+
background: var(--pxd-color-surface-raised);
|
|
4267
|
+
border: var(--pxd-border-width-default) solid var(--pxd-color-border-default);
|
|
4268
|
+
border-radius: var(--pxd-radius-default);
|
|
4269
|
+
}
|
|
4270
|
+
@container pxd (width < 30rem) {
|
|
4271
|
+
.pxd-skeleton-actions {
|
|
4272
|
+
flex-direction: column;
|
|
4273
|
+
align-items: stretch;
|
|
4274
|
+
}
|
|
4275
|
+
.pxd-skeleton-actions .pxd-skeleton-button {
|
|
4276
|
+
width: 100%;
|
|
4277
|
+
}
|
|
4278
|
+
.pxd-skeleton-cards {
|
|
4279
|
+
grid-template-columns: minmax(0, 1fr);
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
/* Reduced motion: flat blocks, no sweep. (The base sheet zeroes the duration; this also removes the gradient.) */
|
|
4283
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4284
|
+
.pxd-skeleton-block {
|
|
4285
|
+
background: var(--polyxd-skeleton-base);
|
|
4286
|
+
animation: none;
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
/* ---- Form error summary ---- */
|
|
4291
|
+
/* Said once at the top of the fields, in the danger tokens as .pxd-field-error is; the links are
|
|
4292
|
+
the surface's link style on the surface itself, where the link colour is guaranteed readable. */
|
|
4293
|
+
.pxd-error-summary {
|
|
4294
|
+
display: flex;
|
|
4295
|
+
flex-direction: column;
|
|
4296
|
+
gap: var(--pxd-space-stack-tight);
|
|
4297
|
+
padding: var(--pxd-space-inset-default);
|
|
4298
|
+
border-left: var(--pxd-border-width-strong) solid var(--pxd-color-status-danger-emphasis);
|
|
4299
|
+
background: var(--pxd-color-surface-default);
|
|
4300
|
+
color: var(--pxd-color-text-default);
|
|
4301
|
+
}
|
|
4302
|
+
.pxd-error-summary:focus-visible {
|
|
4303
|
+
outline-offset: var(--pxd-focus-ring-offset);
|
|
4304
|
+
}
|
|
4305
|
+
.pxd-error-summary-title {
|
|
4306
|
+
margin: 0;
|
|
4307
|
+
color: var(--pxd-color-status-danger-foreground);
|
|
4308
|
+
font-family: var(--pxd-type-title-item-family);
|
|
4309
|
+
font-size: var(--pxd-type-title-item-size);
|
|
4310
|
+
font-weight: var(--pxd-type-title-item-weight);
|
|
4311
|
+
line-height: var(--pxd-type-title-item-line-height);
|
|
4312
|
+
letter-spacing: var(--pxd-type-title-item-letter-spacing);
|
|
4313
|
+
}
|
|
4314
|
+
.pxd-error-summary-list {
|
|
4315
|
+
display: flex;
|
|
4316
|
+
flex-direction: column;
|
|
4317
|
+
gap: var(--pxd-space-stack-tight);
|
|
4318
|
+
margin: 0;
|
|
4319
|
+
padding-left: 1.25em;
|
|
4320
|
+
}
|
|
4321
|
+
/* A control the summary marked is drawn like one the browser marked. */
|
|
4322
|
+
.pxd-input[aria-invalid="true"] {
|
|
4323
|
+
border-color: var(--pxd-color-status-danger-emphasis);
|
|
4324
|
+
border-width: var(--pxd-border-width-strong);
|
|
4325
|
+
}
|
|
4326
|
+
|
|
4327
|
+
/* ---- ActionBar overflow ---- */
|
|
4328
|
+
/* The "More actions" control sits where the least important action would have been. */
|
|
4329
|
+
.pxd-action-bar-more {
|
|
4330
|
+
flex: none;
|
|
4331
|
+
align-self: center;
|
|
4332
|
+
}
|
|
4333
|
+
|
|
4334
|
+
/* ---- Media gallery viewer ---- */
|
|
4335
|
+
/* Each resolved picture is a button; the viewer shows one at a time over the surface's scrim. */
|
|
4336
|
+
.pxd-gallery-item {
|
|
4337
|
+
display: block;
|
|
4338
|
+
width: 100%;
|
|
4339
|
+
padding: 0;
|
|
4340
|
+
border: 0;
|
|
4341
|
+
background: none;
|
|
4342
|
+
border-radius: var(--pxd-radius-default);
|
|
4343
|
+
cursor: pointer;
|
|
4344
|
+
}
|
|
4345
|
+
.pxd-gallery-item .pxd-gallery-image {
|
|
4346
|
+
display: block;
|
|
4347
|
+
}
|
|
4348
|
+
.pxd-viewer {
|
|
4349
|
+
position: fixed;
|
|
4350
|
+
inset: 0;
|
|
4351
|
+
z-index: 11;
|
|
4352
|
+
display: flex;
|
|
4353
|
+
flex-direction: column;
|
|
4354
|
+
align-items: center;
|
|
4355
|
+
justify-content: center;
|
|
4356
|
+
gap: var(--pxd-space-stack-default);
|
|
4357
|
+
padding: var(--pxd-space-inset-default);
|
|
4358
|
+
color: var(--pxd-color-text-default);
|
|
4359
|
+
}
|
|
4360
|
+
.pxd-viewer-figure {
|
|
4361
|
+
display: flex;
|
|
4362
|
+
flex-direction: column;
|
|
4363
|
+
align-items: center;
|
|
4364
|
+
gap: var(--pxd-space-stack-tight);
|
|
4365
|
+
margin: 0;
|
|
4366
|
+
min-height: 0;
|
|
4367
|
+
max-width: 100%;
|
|
4368
|
+
}
|
|
4369
|
+
.pxd-viewer-image {
|
|
4370
|
+
max-width: 100%;
|
|
4371
|
+
max-height: 80vh;
|
|
4372
|
+
object-fit: contain;
|
|
4373
|
+
border-radius: var(--pxd-radius-default);
|
|
4374
|
+
}
|
|
4375
|
+
/* Text and controls sit on the overlay surface, so they are readable whatever is behind the scrim. */
|
|
4376
|
+
.pxd-viewer-bar {
|
|
4377
|
+
display: flex;
|
|
4378
|
+
align-items: center;
|
|
4379
|
+
gap: var(--pxd-space-inline-default);
|
|
4380
|
+
width: min(100%, 48rem);
|
|
4381
|
+
padding: var(--pxd-space-inline-tight) var(--pxd-space-inset-compact);
|
|
4382
|
+
background: var(--pxd-color-surface-overlay);
|
|
4383
|
+
border-radius: var(--pxd-radius-default);
|
|
4384
|
+
box-shadow: var(--pxd-shadow-overlay);
|
|
4385
|
+
}
|
|
4386
|
+
.pxd-viewer-nav {
|
|
4387
|
+
width: auto;
|
|
4388
|
+
}
|
|
4389
|
+
.pxd-viewer-counter {
|
|
4390
|
+
flex: 1;
|
|
4391
|
+
font-size: var(--pxd-type-body-small-size);
|
|
4392
|
+
}
|
|
4393
|
+
.pxd-viewer-caption {
|
|
4394
|
+
padding: var(--pxd-space-inline-tight) var(--pxd-space-inset-compact);
|
|
4395
|
+
background: var(--pxd-color-surface-overlay);
|
|
4396
|
+
border-radius: var(--pxd-radius-default);
|
|
4397
|
+
color: var(--pxd-color-text-default);
|
|
4398
|
+
font-size: var(--pxd-type-body-small-size);
|
|
4399
|
+
text-align: center;
|
|
4400
|
+
}
|
|
4401
|
+
.pxd-viewer-close,
|
|
4402
|
+
.pxd-viewer-step {
|
|
4403
|
+
min-width: var(--pxd-size-target-min);
|
|
4404
|
+
min-height: var(--pxd-size-target-min);
|
|
4405
|
+
}
|
|
4406
|
+
.pxd-viewer-step:disabled {
|
|
4407
|
+
opacity: var(--pxd-opacity-state-disabled);
|
|
4408
|
+
cursor: not-allowed;
|
|
4409
|
+
}
|