@fasl-work/caos-app-shell 0.14.0 → 0.14.1

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
@@ -250,6 +250,9 @@ interface CaseSelectorProps {
250
250
  * category structure is preserved either way; only the height changes.
251
251
  */
252
252
  layout?: 'chips' | 'select';
253
+ /** A control that sits on the select's row, after it (the workbench's Focus button, shell 0.14.1): the select shrinks to make
254
+ * room, so the selector is no taller with it. With `layout: 'chips'` it gets a row of its own, after the chips. */
255
+ accessory?: ReactNode;
253
256
  }
254
257
  /**
255
258
  * CaseSelector v2, the shared source + case picker. Renders (1) an optional first-level source
package/dist/index.js CHANGED
@@ -740,6 +740,17 @@ function CaseSelector(props) {
740
740
  const visible = casesInSource(cases, source);
741
741
  const groups = groupByCategory(visible);
742
742
  const modified = cases.find((c) => c.id === modifiedFromId) ?? null;
743
+ const select = /* @__PURE__ */ jsx(
744
+ "select",
745
+ {
746
+ "data-control": "case",
747
+ className: "select cs-select",
748
+ "aria-label": ariaLabel ?? "Case selector",
749
+ value: selectedId,
750
+ onChange: (e) => onSelect(e.target.value),
751
+ 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.name }, c.id)) }, g.category || "_"))
752
+ }
753
+ );
743
754
  return /* @__PURE__ */ jsxs("div", { className: `cs${className ? ` ${className}` : ""}`, role: "group", "aria-label": ariaLabel ?? "Case selector", children: [
744
755
  source && lanes.length > 1 && /* @__PURE__ */ jsxs("div", { className: "cs-source", children: [
745
756
  /* @__PURE__ */ jsx("span", { className: "cs-source-label", children: t2.source }),
@@ -757,17 +768,10 @@ function CaseSelector(props) {
757
768
  )) })
758
769
  ] }),
759
770
  source && source !== "synthetic" && /* @__PURE__ */ jsx("p", { className: "cs-locked banner", children: lockedNote ?? t2.lockedNote }),
760
- layout === "select" && /* @__PURE__ */ jsx(
761
- "select",
762
- {
763
- "data-control": "case",
764
- className: "select cs-select",
765
- "aria-label": ariaLabel ?? "Case selector",
766
- value: selectedId,
767
- onChange: (e) => onSelect(e.target.value),
768
- 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.name }, c.id)) }, g.category || "_"))
769
- }
770
- ),
771
+ layout === "select" && (props.accessory ? /* @__PURE__ */ jsxs("div", { className: "cs-select-row", children: [
772
+ select,
773
+ props.accessory
774
+ ] }) : select),
771
775
  layout === "chips" && groups.map((g) => /* @__PURE__ */ jsxs("div", { className: "cs-group", role: "group", "aria-label": g.category || void 0, "data-control": "case", children: [
772
776
  g.category && /* @__PURE__ */ jsx("span", { className: "cs-group-label", children: g.category }),
773
777
  /* @__PURE__ */ jsx("div", { className: "cs-chips", children: g.cases.map((c) => {
@@ -793,6 +797,7 @@ function CaseSelector(props) {
793
797
  );
794
798
  }) })
795
799
  ] }, g.category || "_")),
800
+ layout === "chips" && props.accessory,
796
801
  modified && /* @__PURE__ */ jsxs("div", { className: "cs-modified", children: [
797
802
  /* @__PURE__ */ jsxs("span", { className: "badge accent", children: [
798
803
  t2.modifiedPrefix,
@@ -3329,10 +3334,6 @@ function CaseWorkbench(props) {
3329
3334
  );
3330
3335
  }
3331
3336
  const [openGroup, selectGroup] = useUrlView(tabs.map((t2) => t2.id), viewParamOf(deepLinkView), group, onGroupChange);
3332
- const pickers = cases || variants ? /* @__PURE__ */ jsxs(Fragment, { children: [
3333
- cases && /* @__PURE__ */ jsx(CaseSelector, { lang, ...cases }),
3334
- variants && /* @__PURE__ */ jsx(VariantBar, { ...variants })
3335
- ] }) : null;
3336
3337
  const enter = focusCfg && /* @__PURE__ */ jsxs(
3337
3338
  "button",
3338
3339
  {
@@ -3349,9 +3350,14 @@ function CaseWorkbench(props) {
3349
3350
  ]
3350
3351
  }
3351
3352
  );
3353
+ const besideSelect = Boolean(cases && (cases.layout ?? "chips") === "select");
3354
+ const pickers = cases || variants ? /* @__PURE__ */ jsxs(Fragment, { children: [
3355
+ cases && /* @__PURE__ */ jsx(CaseSelector, { lang, ...cases, accessory: besideSelect ? enter : cases.accessory }),
3356
+ variants && /* @__PURE__ */ jsx(VariantBar, { ...variants })
3357
+ ] }) : null;
3352
3358
  const railHead = pickers || enter ? /* @__PURE__ */ jsxs(Fragment, { children: [
3353
3359
  pickers,
3354
- enter
3360
+ besideSelect ? null : enter
3355
3361
  ] }) : null;
3356
3362
  const instrumentData = {
3357
3363
  "data-case-workbench": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fasl-work/caos-app-shell",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Shared web-app shell, workbench primitives, content primitives, design system and measured gate for the CAOS / Faena public apps (ADR-0016, ADR-0017, ADR-0071).",
5
5
  "license": "MIT",
6
6
  "author": "Felipe Santibáñez-Leal",
@@ -198,6 +198,7 @@
198
198
  "cs-modified",
199
199
  "cs-reset",
200
200
  "cs-select",
201
+ "cs-select-row",
201
202
  "cs-source",
202
203
  "cs-source-label",
203
204
  "cs-source-tabs",
@@ -506,6 +507,7 @@
506
507
  "cs-modified",
507
508
  "cs-reset",
508
509
  "cs-select",
510
+ "cs-select-row",
509
511
  "cs-source",
510
512
  "cs-source-label",
511
513
  "cs-source-tabs",
package/styles.css CHANGED
@@ -508,6 +508,10 @@ svg.lucide { flex: none; }
508
508
  /* The compact one-of-N case picker (ADR-0071 rule 7): ten cases in four categories cost a 308px chip block, 21% of a
509
509
  2560x1440 viewport, and one row as a dropdown. */
510
510
  .cs-select { width: 100%; max-width: 460px; }
511
+ /* the select and a control beside it (the workbench's Focus button): one row, the select shrinks, the control keeps its size */
512
+ .cs-select-row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
513
+ .cs-select-row > .cs-select { flex: 1 1 auto; min-width: 0; }
514
+ .cs-select-row > :not(.cs-select) { flex: none; }
511
515
 
512
516
  /* == 9 workbench ================================================================================================ */
513
517