@cosmicdrift/kumiko-renderer-web 0.114.0 → 0.115.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.114.0",
3
+ "version": "0.115.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.114.0",
20
- "@cosmicdrift/kumiko-headless": "0.114.0",
21
- "@cosmicdrift/kumiko-renderer": "0.114.0",
19
+ "@cosmicdrift/kumiko-dispatcher-live": "0.115.0",
20
+ "@cosmicdrift/kumiko-headless": "0.115.0",
21
+ "@cosmicdrift/kumiko-renderer": "0.115.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",
@@ -980,7 +980,7 @@ describe("Card", () => {
980
980
  <span>body</span>
981
981
  </Card>,
982
982
  );
983
- expect(screen.getByTestId("c").innerHTML).toContain("p-6");
983
+ expect(screen.getByTestId("c").innerHTML).toContain("p-[var(--card-padding)]");
984
984
  });
985
985
 
986
986
  test("padded=false renders body without padding classes", () => {
@@ -83,13 +83,18 @@ import { useToast } from "./toast";
83
83
 
84
84
  // ---- Card-Chrome (eine Definition für Form/Section/Card) ----
85
85
 
86
- // Die eine Card-Surface. Radius ist die einzige real gebrauchte Variante:
87
- // xl = Card/Screen-Fläche (Default), lg = "innen"-Fläche wie Tabellen.
88
- const cardSurface = cva("flex flex-col border bg-card text-card-foreground shadow-sm", {
89
- variants: { radius: { xl: "rounded-xl", lg: "rounded-lg" } },
90
- defaultVariants: { radius: "xl" },
91
- });
92
- const cardFooter = "flex items-center justify-end gap-2 px-6 py-4";
86
+ // Die eine Card-Surface. Maße (Padding/Radius/Shadow) kommen aus --card-*
87
+ // CSS-Tokens (Defaults in styles.css), damit eine App sie einmal zentral in
88
+ // ihrer styles.css überschreiben kann wie die Farben. Radius-Variante:
89
+ // xl = Card/Screen-Fläche (Default, token-getrieben), lg = "innen"-Fläche.
90
+ const cardSurface = cva(
91
+ "flex flex-col border bg-card text-card-foreground shadow-[var(--card-shadow)]",
92
+ {
93
+ variants: { radius: { xl: "rounded-[var(--card-radius)]", lg: "rounded-lg" } },
94
+ defaultVariants: { radius: "xl" },
95
+ },
96
+ );
97
+ const cardFooter = "flex items-center justify-end gap-2 px-[var(--card-padding)] py-4";
93
98
  const cardFooterBorder = "border-t bg-muted/30";
94
99
 
95
100
  // ---- Button (vendored shadcn ui/button) ----
@@ -1582,7 +1587,7 @@ export function DefaultCard({ slots, options, className, testId, children }: Car
1582
1587
  const s = slots ?? {};
1583
1588
  const defaultHeader =
1584
1589
  s.title !== undefined || s.subtitle !== undefined || s.headerActions !== undefined ? (
1585
- <div className="flex flex-wrap items-start justify-between gap-3 px-6 pt-6 pb-4">
1590
+ <div className="flex flex-wrap items-start justify-between gap-3 px-[var(--card-padding)] pt-6 pb-4">
1586
1591
  <div className="flex flex-col gap-1">
1587
1592
  {s.title !== undefined && (
1588
1593
  <h3 className="text-base font-semibold leading-none tracking-tight">{s.title}</h3>
@@ -1602,7 +1607,17 @@ export function DefaultCard({ slots, options, className, testId, children }: Car
1602
1607
  {/* != null covers undefined AND explicit null; a `false` child (from
1603
1608
  `cond && <El/>`) still renders no visible content either way. */}
1604
1609
  {children != null && (
1605
- <div className={cn("grow", padded && (hasHeader ? "px-6 pb-6" : "p-6"))}>{children}</div>
1610
+ <div
1611
+ className={cn(
1612
+ "grow",
1613
+ padded &&
1614
+ (hasHeader
1615
+ ? "px-[var(--card-padding)] pb-[var(--card-padding)]"
1616
+ : "p-[var(--card-padding)]"),
1617
+ )}
1618
+ >
1619
+ {children}
1620
+ </div>
1606
1621
  )}
1607
1622
  {s.footer !== undefined && (
1608
1623
  <div className={cn(cardFooter, footerBordered && cardFooterBorder)}>{s.footer}</div>
package/src/styles.css CHANGED
@@ -82,6 +82,17 @@
82
82
  --radius-xl: calc(var(--radius) + 4px);
83
83
  }
84
84
 
85
+ /* Card-Chrome-Maße — Framework-Defaults. Eine App überschreibt selektiv in
86
+ ihrer eigenen styles.css (@theme oder :root, kommt in der Cascade nach dem
87
+ @import und gewinnt); nicht-überschriebene bleiben auf diesen Werten.
88
+ Plain :root (nicht @theme) → immer emittiert, kein Tree-Shaking. Defaults
89
+ reproduzieren exakt p-6 / rounded-xl / shadow-sm. */
90
+ :root {
91
+ --card-padding: 1.5rem;
92
+ --card-radius: var(--radius-xl);
93
+ --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
94
+ }
95
+
85
96
  /* Light-Mode-Overrides — aktiv wenn `<html>` KEINE `.dark` Klasse
86
97
  hat. Dark ist der Default (siehe @theme oben); toggled der User
87
98
  auf light, greifen diese Werte. */