@hadoku/game-ui 0.1.47 → 0.1.48

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.
@@ -0,0 +1,56 @@
1
+ /*
2
+ * The front page's shell (`./LobbyShell.tsx`): a column that fits the window and scrolls inside
3
+ * it, its tools row, the page's main column and its footer line. Theme tokens only.
4
+ *
5
+ * Under its own `lobby-shell` class, never `.shell`'s: `shell` is the host's own screen shell, and
6
+ * where the host styles it (cardtable's `screens.css`, which wins on `.shell.shell--fit`) these
7
+ * rules only fill in what it leaves out. The defaults are cardtable's front page; a game sets:
8
+ *
9
+ * --lobby-shell-padding, --lobby-shell-max-width, --lobby-shell-gap, --lobby-shell-flex,
10
+ * --lobby-shell-overflow the shell itself (overflow: where the page scrolls)
11
+ * --lobby-shell-tools-gap, --lobby-shell-tools-padding
12
+ * --lobby-shell-front-gap, --lobby-shell-front-flex, --lobby-shell-front-overflow,
13
+ * --lobby-shell-front-min-height
14
+ */
15
+
16
+ .lobby-shell {
17
+ display: flex;
18
+ flex: var(--lobby-shell-flex, 0 1 auto);
19
+ flex-direction: column;
20
+ gap: var(--lobby-shell-gap, 24px);
21
+ box-sizing: border-box;
22
+ width: 100%;
23
+ max-width: var(--lobby-shell-max-width, 1400px);
24
+ height: 100%;
25
+ min-height: 0;
26
+ margin: 0 auto;
27
+ padding: var(--lobby-shell-padding, 24px);
28
+ overflow-y: var(--lobby-shell-overflow, auto);
29
+ }
30
+
31
+ /* The header's tools, at the right end, holding their size. */
32
+ .lobby-shell > .shell__tools {
33
+ display: flex;
34
+ flex: none;
35
+ align-items: center;
36
+ justify-content: flex-end;
37
+ gap: var(--lobby-shell-tools-gap, 8px);
38
+ padding: var(--lobby-shell-tools-padding, 0);
39
+ }
40
+
41
+ /* The page's footer line (a licensing disclaimer), pushed to the foot of a short page. */
42
+ .lobby-shell > .shell__disclaimer {
43
+ margin: auto 0 0;
44
+ color: var(--color-text-secondary);
45
+ font-size: 11px;
46
+ }
47
+
48
+ /* The page's own column: banner, rooms, whatever a game adds. */
49
+ .front {
50
+ display: flex;
51
+ flex: var(--lobby-shell-front-flex, 0 1 auto);
52
+ flex-direction: column;
53
+ gap: var(--lobby-shell-front-gap, 24px);
54
+ min-height: var(--lobby-shell-front-min-height, auto);
55
+ overflow: var(--lobby-shell-front-overflow, visible);
56
+ }
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
+ import './LobbyShell.css';
2
3
  export interface LobbyShellProps {
3
4
  /** The header's own tools row (settings, decks, stats, …) — omitted renders no `<nav>` at all. */
4
5
  navTools?: ReactNode;
@@ -12,6 +12,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  * Content Policy line) and hands them in as children/props. What stays here is what was already
13
13
  * game-agnostic: the shell chrome, the page-reveal gate (`./gate.ts`) and the trim-loaded settle.
14
14
  *
15
+ * Its paint is `./LobbyShell.css`, on its own `lobby-shell` class: the `shell` block is the host
16
+ * app's screen shell (cardtable's `screens.css` draws every screen with it), so this module adds to
17
+ * it rather than restyling it.
18
+ *
15
19
  * `LobbyScreen.tsx`'s own DOM is unchanged by this lift: it still always passes a `navTools` and
16
20
  * a `disclaimer`, so its rendered markup is the same `<nav>`/`<p className="shell__disclaimer">`
17
21
  * it always drew (this lane's closing note has the render diff). A caller that omits either slot
@@ -21,6 +25,7 @@ import { useEffect } from 'react';
21
25
  import { FrontGateContext, useFrontGateState } from "./gate.js";
22
26
  import { useSiteTrim } from "../settings/siteTrim.js";
23
27
  import { useChromeShell } from '@wolffm/ui-shell/chrome/shell';
28
+ import './LobbyShell.css';
24
29
  export function LobbyShell({ navTools, banner, children, disclaimer }) {
25
30
  const shellRef = useChromeShell('fit');
26
31
  const gate = useFrontGateState();
@@ -30,5 +35,5 @@ export function LobbyShell({ navTools, banner, children, disclaimer }) {
30
35
  if (trimLoaded)
31
36
  settle('trim');
32
37
  }, [trimLoaded, settle]);
33
- return (_jsxs("div", { ref: shellRef, className: "shell shell--fit", "data-testid": "lobby", children: [navTools !== undefined && _jsx("nav", { className: "shell__tools", children: navTools }), _jsx(FrontGateContext.Provider, { value: gate, children: _jsxs("main", { className: "front", "aria-busy": !gate.revealed, children: [banner, children] }) }), disclaimer !== undefined && _jsx("p", { className: "shell__disclaimer", children: disclaimer })] }));
38
+ return (_jsxs("div", { ref: shellRef, className: "shell shell--fit lobby-shell", "data-testid": "lobby", children: [navTools !== undefined && _jsx("nav", { className: "shell__tools", children: navTools }), _jsx(FrontGateContext.Provider, { value: gate, children: _jsxs("main", { className: "front", "aria-busy": !gate.revealed, children: [banner, children] }) }), disclaimer !== undefined && _jsx("p", { className: "shell__disclaimer", children: disclaimer })] }));
34
39
  }