@cosmicdrift/kumiko-renderer-web 0.243.4 → 0.244.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.244.0",
|
|
4
4
|
"description": "Web-platform bindings for @cosmicdrift/kumiko-renderer. HTML default-primitives, browser history-based navigation, EventSource-backed live events, and a one-call createKumikoApp that mounts the whole stack via react-dom.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"./styles.css": "./src/styles.css"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.
|
|
20
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
21
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
19
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.244.0",
|
|
20
|
+
"@cosmicdrift/kumiko-headless": "0.244.0",
|
|
21
|
+
"@cosmicdrift/kumiko-renderer": "0.244.0",
|
|
22
22
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
23
23
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
24
24
|
"@radix-ui/react-label": "^2.1.8",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@types/react-dom": "^19.2.3",
|
|
65
65
|
"jsdom": "^29.1.1",
|
|
66
66
|
"tailwindcss": "^4.3.0",
|
|
67
|
-
"@cosmicdrift/kumiko-locale-de": "0.
|
|
67
|
+
"@cosmicdrift/kumiko-locale-de": "0.244.0"
|
|
68
68
|
},
|
|
69
69
|
"repository": {
|
|
70
70
|
"type": "git",
|
|
@@ -1743,10 +1743,27 @@ describe("PageSection", () => {
|
|
|
1743
1743
|
<span data-testid="child">x</span>
|
|
1744
1744
|
</PageSection>,
|
|
1745
1745
|
);
|
|
1746
|
-
expect(screen.getByTestId("p").className).toContain("
|
|
1746
|
+
expect(screen.getByTestId("p").className).toContain("px-6");
|
|
1747
1747
|
expect(screen.getByTestId("child")).toBeDefined();
|
|
1748
1748
|
});
|
|
1749
1749
|
|
|
1750
|
+
test("renders the same padding classes as FormScreenShell (fw#2640)", () => {
|
|
1751
|
+
render(
|
|
1752
|
+
<>
|
|
1753
|
+
<PageSection testId="page-pad">x</PageSection>
|
|
1754
|
+
<FormScreenShell testId="shell-pad">x</FormScreenShell>
|
|
1755
|
+
</>,
|
|
1756
|
+
);
|
|
1757
|
+
const paddingOf = (testId: string): string[] =>
|
|
1758
|
+
screen
|
|
1759
|
+
.getByTestId(testId)
|
|
1760
|
+
.className.split(" ")
|
|
1761
|
+
.filter((c) => /^p[xytblr]?-/.test(c))
|
|
1762
|
+
.sort();
|
|
1763
|
+
expect(paddingOf("page-pad")).toEqual(["pb-12", "pt-6", "px-6"]);
|
|
1764
|
+
expect(paddingOf("page-pad")).toEqual(paddingOf("shell-pad"));
|
|
1765
|
+
});
|
|
1766
|
+
|
|
1750
1767
|
test("maxWidth=4xl sets the same width class as FormScreenShell maxWidth=4xl (fw#2640)", () => {
|
|
1751
1768
|
render(
|
|
1752
1769
|
<>
|
package/src/primitives/index.tsx
CHANGED
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
import { EmbeddedListInput } from "./embedded-list-input";
|
|
111
111
|
import { FileUploadInput } from "./file-upload";
|
|
112
112
|
import { DefaultJsonView } from "./json-view";
|
|
113
|
-
import { screenWidthClassName } from "./layout";
|
|
113
|
+
import { screenPaddingClassName, screenWidthClassName } from "./layout";
|
|
114
114
|
import { DefaultLightbox } from "./lightbox";
|
|
115
115
|
import { LocatedTimestampInput } from "./located-timestamp-input";
|
|
116
116
|
import { DefaultMetric } from "./metric";
|
|
@@ -2261,7 +2261,7 @@ export function FormScreenShell({
|
|
|
2261
2261
|
return (
|
|
2262
2262
|
<div
|
|
2263
2263
|
data-testid={testId}
|
|
2264
|
-
className={cn("
|
|
2264
|
+
className={cn(screenPaddingClassName, "w-full", screenWidthClassName[width], className)}
|
|
2265
2265
|
>
|
|
2266
2266
|
{children}
|
|
2267
2267
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Layout primitives for custom screens: one place for vertical spacing and
|
|
2
|
-
// screen padding, so consumers don't hand-roll `flex flex-col gap-*` /
|
|
2
|
+
// screen padding, so consumers don't hand-roll `flex flex-col gap-*` / screen insets.
|
|
3
3
|
// Deliberately thin — not a generic box-with-20-props system.
|
|
4
4
|
|
|
5
5
|
import type { FormWidth } from "@cosmicdrift/kumiko-renderer";
|
|
@@ -17,6 +17,12 @@ export const screenWidthClassName: Record<ScreenWidth, string> = {
|
|
|
17
17
|
full: "max-w-full",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
// Shared screen padding for both screen containers (PageSection and
|
|
21
|
+
// FormScreenShell). The wider bottom inset keeps the last field or table row
|
|
22
|
+
// off the viewport edge; applying it everywhere makes footer spacing
|
|
23
|
+
// independent of the screen type (fw#2640).
|
|
24
|
+
export const screenPaddingClassName = "px-6 pt-6 pb-12";
|
|
25
|
+
|
|
20
26
|
const STACK_GAP = { sm: "gap-2", md: "gap-4", lg: "gap-6" } as const;
|
|
21
27
|
|
|
22
28
|
type StackGap = keyof typeof STACK_GAP;
|
|
@@ -50,7 +56,10 @@ export function PageSection({
|
|
|
50
56
|
maxWidth = "full",
|
|
51
57
|
}: PageSectionProps): ReactNode {
|
|
52
58
|
return (
|
|
53
|
-
<div
|
|
59
|
+
<div
|
|
60
|
+
data-testid={testId}
|
|
61
|
+
className={cn(screenPaddingClassName, screenWidthClassName[maxWidth], className)}
|
|
62
|
+
>
|
|
54
63
|
{children}
|
|
55
64
|
</div>
|
|
56
65
|
);
|