@fasl-work/caos-app-shell 0.6.0 → 0.6.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/index.d.ts CHANGED
@@ -262,6 +262,18 @@ interface CaseSelectorProps {
262
262
  deepLink?: boolean | string;
263
263
  ariaLabel?: string;
264
264
  className?: string;
265
+ /**
266
+ * How the one-of-N choice is presented. Default 'chips' keeps the labelled chip
267
+ * blocks; 'select' renders a native dropdown with one optgroup per category.
268
+ *
269
+ * ADR-0071 rule 7 asks for the dropdown whenever the deck is a categorised
270
+ * one-of-N choice, because the chip layout spends vertical space linearly in the
271
+ * number of cases and that space is taken from the instrument on every render.
272
+ * Measured on Porvenir at 2560x1440: ten cases in four categories occupied a
273
+ * 308px block, 21% of the viewport, for a choice one control expresses. The
274
+ * category structure is preserved either way; only the height changes.
275
+ */
276
+ layout?: 'chips' | 'select';
265
277
  }
266
278
  /**
267
279
  * CaseSelector v2 — the shared source + case picker. Renders (1) an optional first-level source
package/dist/index.js CHANGED
@@ -568,7 +568,8 @@ function CaseSelector(props) {
568
568
  text,
569
569
  deepLink,
570
570
  ariaLabel,
571
- className
571
+ className,
572
+ layout = "chips"
572
573
  } = props;
573
574
  const t = { ...TEXT[lang], ...text };
574
575
  const baseId = useId();
@@ -606,7 +607,17 @@ function CaseSelector(props) {
606
607
  )) })
607
608
  ] }),
608
609
  source && source !== "synthetic" && /* @__PURE__ */ jsx("p", { className: "cs-locked banner", children: lockedNote ?? t.lockedNote }),
609
- groups.map((g) => /* @__PURE__ */ jsxs("div", { className: "cs-group", role: "group", "aria-label": g.category || void 0, children: [
610
+ layout === "select" && /* @__PURE__ */ jsx(
611
+ "select",
612
+ {
613
+ className: "select cs-select",
614
+ "aria-label": ariaLabel ?? "Case selector",
615
+ value: selectedId,
616
+ onChange: (e) => onSelect(e.target.value),
617
+ children: groups.map((g) => /* @__PURE__ */ jsx("optgroup", { label: g.category || " ", children: g.cases.map((c) => /* @__PURE__ */ jsx("option", { value: c.id, disabled: c.disabled, title: caseTooltip(c) || void 0, children: `${c.id} \xB7 ${c.name}` }, c.id)) }, g.category || "_"))
618
+ }
619
+ ),
620
+ layout === "chips" && groups.map((g) => /* @__PURE__ */ jsxs("div", { className: "cs-group", role: "group", "aria-label": g.category || void 0, children: [
610
621
  g.category && /* @__PURE__ */ jsx("span", { className: "cs-group-label", children: g.category }),
611
622
  /* @__PURE__ */ jsx("div", { className: "cs-chips", children: g.cases.map((c) => {
612
623
  const on = c.id === selectedId;
package/package.json CHANGED
@@ -1,59 +1,59 @@
1
- {
2
- "name": "@fasl-work/caos-app-shell",
3
- "version": "0.6.0",
4
- "description": "Shared web-app shell + content primitives + design system for the CAOS / Faena public apps (ADR-0016).",
5
- "license": "MIT",
6
- "author": "Felipe Santibáñez-Leal",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/fsantibanezleal/CAOS_APP_SHELL.git"
10
- },
11
- "type": "module",
12
- "publishConfig": {
13
- "access": "public"
14
- },
15
- "sideEffects": [
16
- "*.css"
17
- ],
18
- "exports": {
19
- ".": {
20
- "types": "./dist/index.d.ts",
21
- "import": "./dist/index.js"
22
- },
23
- "./styles.css": "./styles.css"
24
- },
25
- "files": [
26
- "dist",
27
- "styles.css"
28
- ],
29
- "scripts": {
30
- "build": "tsup",
31
- "test": "node --import tsx --test \"test/**/*.test.ts\" \"test/**/*.test.tsx\"",
32
- "prepublishOnly": "npm run build"
33
- },
34
- "peerDependencies": {
35
- "katex": "^0.16.0",
36
- "lucide-react": ">=0.400.0",
37
- "react": "^18 || ^19",
38
- "react-dom": "^18 || ^19",
39
- "react-router": "^6 || ^7 || ^8",
40
- "zustand": "^4 || ^5"
41
- },
42
- "devDependencies": {
43
- "@types/katex": "^0.16.7",
44
- "@types/react": "^19.0.0",
45
- "@types/react-dom": "^19.0.0",
46
- "katex": "^0.16.11",
47
- "lucide-react": "^0.469.0",
48
- "react": "^19.0.0",
49
- "react-dom": "^19.0.0",
50
- "react-router": "^8.3.0",
51
- "tsup": "^8.3.5",
52
- "tsx": "^4.23.0",
53
- "typescript": "^5.7.3",
54
- "zustand": "^5.0.2"
55
- },
56
- "overrides": {
57
- "esbuild": "0.28.1"
58
- }
59
- }
1
+ {
2
+ "name": "@fasl-work/caos-app-shell",
3
+ "version": "0.6.2",
4
+ "description": "Shared web-app shell + content primitives + design system for the CAOS / Faena public apps (ADR-0016).",
5
+ "license": "MIT",
6
+ "author": "Felipe Santibáñez-Leal",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/fsantibanezleal/CAOS_APP_SHELL.git"
10
+ },
11
+ "type": "module",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "sideEffects": [
16
+ "*.css"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ },
23
+ "./styles.css": "./styles.css"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "styles.css"
28
+ ],
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "test": "node --import tsx --test \"test/**/*.test.ts\" \"test/**/*.test.tsx\"",
32
+ "prepublishOnly": "npm run build"
33
+ },
34
+ "peerDependencies": {
35
+ "katex": "^0.16.0",
36
+ "lucide-react": ">=0.400.0",
37
+ "react": "^18 || ^19",
38
+ "react-dom": "^18 || ^19",
39
+ "react-router": "^6 || ^7 || ^8",
40
+ "zustand": "^4 || ^5"
41
+ },
42
+ "devDependencies": {
43
+ "@types/katex": "^0.16.7",
44
+ "@types/react": "^19.0.0",
45
+ "@types/react-dom": "^19.0.0",
46
+ "katex": "^0.16.11",
47
+ "lucide-react": "^0.469.0",
48
+ "react": "^19.0.0",
49
+ "react-dom": "^19.0.0",
50
+ "react-router": "^8.3.0",
51
+ "tsup": "^8.3.5",
52
+ "tsx": "^4.23.0",
53
+ "typescript": "^5.7.3",
54
+ "zustand": "^5.0.2"
55
+ },
56
+ "overrides": {
57
+ "esbuild": "0.28.1"
58
+ }
59
+ }
package/styles.css CHANGED
@@ -285,7 +285,14 @@ code, kbd { font-family: var(--font-mono); }
285
285
  the tab bar a single scrollable row pushes the whole page wider than the viewport and the user has to
286
286
  drag sideways to reach the right edge. Measured on ChargeCascade: scrollWidth 1817 on a 1600 viewport. */
287
287
  html, body { overflow-x: hidden; }
288
- .page-body { max-width: 100%; }
288
+ /* `min-width: 0`, NOT `max-width: 100%`. Containment is about letting a box SHRINK below its
289
+ content; capping it at 100% does nothing for that and, because this rule comes after the
290
+ `.page-body` definition above, it silently OVERRODE `max-width: var(--maxw)` and removed the
291
+ 1200px reading cap from every prose page in every product on this shell. Measured on Porvenir at
292
+ 1600x900: doc routes rendered 1600px wide instead of 1200px centered, so body text ran the full
293
+ width of the display, which is the opposite of what ADR-0017 s1.1 specifies. The wide workbench
294
+ opt-in is `.page-body.wide`; a prose page must keep the measure. */
295
+ .page-body { min-width: 0; }
289
296
  .tabs, .tabpanel { min-width: 0; max-width: 100%; }
290
297
  .tablist { min-width: 0; max-width: 100%; width: 100%; }
291
298
 
@@ -301,11 +308,15 @@ html, body { overflow-x: hidden; }
301
308
  /* A viewport-filling app must not carry the prose footer margin: it becomes dead space between the
302
309
  content and the chrome. Measured on ChargeCascade as exactly 48px (3rem). */
303
310
  .app-shell.fixed .site-footer { margin-top: 0; }
311
+
312
+ /* ADR-0058 diagram i18n. A hand-authored architecture SVG carries BOTH languages inside ONE file,
313
+ and the modal wrapper picks one. Two files would be two things to keep in step, and the one not
314
+ on screen is the one that goes stale. The rules are scoped to [data-arch-lang] so the short class
315
+ names cannot collide with an app's own styles. */
316
+ [data-arch-lang] .l-es { display: none; }
317
+ [data-arch-lang="es"] .l-en { display: none; }
318
+ [data-arch-lang="es"] .l-es { display: inline; }
304
319
 
305
- /* ADR-0058 diagram i18n. A hand-authored architecture SVG carries BOTH languages inside ONE file,
306
- and the modal wrapper picks one. Two files would be two things to keep in step, and the one not
307
- on screen is the one that goes stale. The rules are scoped to [data-arch-lang] so the short class
308
- names cannot collide with an app's own styles. */
309
- [data-arch-lang] .l-es { display: none; }
310
- [data-arch-lang="es"] .l-en { display: none; }
311
- [data-arch-lang="es"] .l-es { display: inline; }
320
+ /* The compact one-of-N case picker (ADR-0071 rule 7). Ten cases in four categories
321
+ cost a 308px chip block, 21% of a 2560x1440 viewport, and one row as a dropdown. */
322
+ .cs-select { width: 100%; max-width: 460px; }