@gopherium/godmin 0.9.0 → 0.10.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 +23 -0
- package/dist/page.d.ts +4 -3
- package/dist/page.js +15 -4
- package/package.json +1 -1
package/dist/base.css
CHANGED
|
@@ -118,6 +118,29 @@ body {
|
|
|
118
118
|
color: var(--wpds-color-foreground-content-neutral-weak);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
.godmin-page__split {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-wrap: wrap;
|
|
124
|
+
align-items: flex-start;
|
|
125
|
+
gap: var(--wpds-dimension-gap-xl);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.godmin-page__main {
|
|
129
|
+
flex: 999 1 0;
|
|
130
|
+
min-inline-size: min(50%, var(--wpds-dimension-surface-width-xl));
|
|
131
|
+
max-inline-size: var(--wpds-dimension-surface-width-xl);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.godmin-page__aside {
|
|
135
|
+
flex: 0 1 var(--wpds-dimension-surface-width-sm);
|
|
136
|
+
min-inline-size: 0;
|
|
137
|
+
overflow-wrap: anywhere;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.godmin-page__aside:empty {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
121
144
|
.godmin-form {
|
|
122
145
|
display: flex;
|
|
123
146
|
flex-direction: column;
|
package/dist/page.d.ts
CHANGED
|
@@ -14,16 +14,17 @@ export interface PageProps {
|
|
|
14
14
|
title: string;
|
|
15
15
|
subtitle?: string;
|
|
16
16
|
actions?: ReactNode;
|
|
17
|
+
aside?: ReactNode;
|
|
17
18
|
className?: string;
|
|
18
19
|
children: ReactNode;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Renders a screen: its title top left, an optional subtitle under it,
|
|
22
|
-
* optional actions top right, and the content below.
|
|
23
|
-
* @param props - The title, subtitle, actions, extra class and content.
|
|
23
|
+
* optional actions top right, and the content below, beside an optional aside.
|
|
24
|
+
* @param props - The title, subtitle, actions, aside, extra class and content.
|
|
24
25
|
* @returns The page element.
|
|
25
26
|
*/
|
|
26
|
-
export declare function Page({ title, subtitle, actions, className, children }: PageProps): import("react").JSX.Element;
|
|
27
|
+
export declare function Page({ title, subtitle, actions, aside, className, children }: PageProps): import("react").JSX.Element;
|
|
27
28
|
/**
|
|
28
29
|
* Renders a failure message that a screen reader announces.
|
|
29
30
|
* @param props - The message to announce.
|
package/dist/page.js
CHANGED
|
@@ -12,13 +12,24 @@ export function PageTitle({ children, variant = 'heading-xl', }) {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Renders a screen: its title top left, an optional subtitle under it,
|
|
15
|
-
* optional actions top right, and the content below.
|
|
16
|
-
* @param props - The title, subtitle, actions, extra class and content.
|
|
15
|
+
* optional actions top right, and the content below, beside an optional aside.
|
|
16
|
+
* @param props - The title, subtitle, actions, aside, extra class and content.
|
|
17
17
|
* @returns The page element.
|
|
18
18
|
*/
|
|
19
|
-
export function Page({ title, subtitle, actions, className, children }) {
|
|
19
|
+
export function Page({ title, subtitle, actions, aside, className, children }) {
|
|
20
20
|
const classes = className === undefined ? 'godmin-page' : `godmin-page ${className}`;
|
|
21
|
-
return (_jsxs(Stack, { direction: "column", gap: "lg", className: classes, children: [_jsxs(Stack, { direction: "row", gap: "md", align: "center", justify: "space-between", children: [_jsxs(Stack, { direction: "column", gap: "xs", children: [_jsx(PageTitle, { children: title }), subtitle !== undefined && (_jsx(Text, { variant: "body-sm", className: "godmin-page__subtitle", children: subtitle }))] }), actions !== undefined && (_jsx(Stack, { direction: "row", gap: "sm", align: "center", children: actions }))] }), children] }));
|
|
21
|
+
return (_jsxs(Stack, { direction: "column", gap: "lg", className: classes, children: [_jsxs(Stack, { direction: "row", gap: "md", align: "center", justify: "space-between", children: [_jsxs(Stack, { direction: "column", gap: "xs", children: [_jsx(PageTitle, { children: title }), subtitle !== undefined && (_jsx(Text, { variant: "body-sm", className: "godmin-page__subtitle", children: subtitle }))] }), actions !== undefined && (_jsx(Stack, { direction: "row", gap: "sm", align: "center", children: actions }))] }), _jsx(PageBody, { aside: aside, children: children })] }));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Renders a page's content, beside its aside when it has one.
|
|
25
|
+
* @param props - The content and the optional aside.
|
|
26
|
+
* @returns The content alone, or a main column followed by the aside.
|
|
27
|
+
*/
|
|
28
|
+
function PageBody({ aside, children }) {
|
|
29
|
+
if (aside === undefined) {
|
|
30
|
+
return children;
|
|
31
|
+
}
|
|
32
|
+
return (_jsxs("div", { className: "godmin-page__split", children: [_jsx(Stack, { direction: "column", gap: "lg", className: "godmin-page__main", children: children }), _jsx(Stack, { direction: "column", gap: "lg", className: "godmin-page__aside", children: aside })] }));
|
|
22
33
|
}
|
|
23
34
|
/**
|
|
24
35
|
* Renders a failure message that a screen reader announces.
|
package/package.json
CHANGED