@ai-matrx/design-system 0.61.8 → 0.61.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.61.10 — the pill guard flags a stretched pill
4
+
5
+ - Pill guard: a capsule whose content box is more than 8px wider than its own ink (text runs plus
6
+ in-flow glyphs) is outlined as STRETCHED — a pill hugs its label; a full-width tappable item is a
7
+ row, never a pill. Measured: /education/overview's metric pills filled their grid columns at 375px
8
+ (label left, up to 103px of empty capsule right). Only measured where the engine reports line
9
+ boxes; `data-matrx-pill="off"` still opts a deliberately wide capsule out. Guard case red on 0.61.9.
10
+
11
+ No consumer action.
12
+
13
+ ## 0.61.9
14
+ ### a scope lane is never clipped
15
+
16
+ - `TableScopeBar` measures its lane tabs against their slot: when they do not fit — at any width,
17
+ not only below `sm` — the slot holds the select of every lane (with counts) and the tab row stays
18
+ mounted, invisible and inert, only to be measured. It no longer scrolls sideways and cuts a lane
19
+ mid-word ("My Orgs 4" lost its digit at 800px).
20
+
21
+ No consumer action.
22
+
3
23
  ## 0.61.8 — the pill guard leaves capsule tracks to their tabs
4
24
 
5
25
  - Pill guard: text inside an interactive child (link, button, tab, radio, menu item, option) is not
@@ -1,5 +1,5 @@
1
1
  import { AgentPayloadInput } from './copy-types.cjs';
2
- import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-DL5BU8Mf.cjs';
2
+ import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-DDgNWqzw.cjs';
3
3
  import '../content-transfer.cjs';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,5 +1,5 @@
1
1
  import { AgentPayloadInput } from './copy-types.js';
2
- import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-CCWzLsOC.js';
2
+ import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-DnMvx2yK.js';
3
3
  import '../content-transfer.js';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-DL5BU8Mf.cjs';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-DDgNWqzw.cjs';
2
2
  import 'react';
3
3
  import '../content-transfer.cjs';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-CCWzLsOC.js';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-DnMvx2yK.js';
2
2
  import 'react';
3
3
  import '../content-transfer.js';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
3
  import { CopyControlProps } from './copy-types.cjs';
4
4
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.cjs';
5
- import { M as MatrxColumnDef, b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-DL5BU8Mf.cjs';
5
+ import { M as MatrxColumnDef, b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-DDgNWqzw.cjs';
6
6
  import { MatrxTableMenuItem, MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.cjs';
7
7
  export { MatrxTableMenuSection } from './menu-targets.cjs';
8
8
  import '../content-transfer.cjs';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
3
  import { CopyControlProps } from './copy-types.js';
4
4
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.js';
5
- import { M as MatrxColumnDef, b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-CCWzLsOC.js';
5
+ import { M as MatrxColumnDef, b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-DnMvx2yK.js';
6
6
  import { MatrxTableMenuItem, MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.js';
7
7
  export { MatrxTableMenuSection } from './menu-targets.js';
8
8
  import '../content-transfer.js';
@@ -34390,45 +34390,76 @@ function ScopeFilter({ filter, id }) {
34390
34390
  )
34391
34391
  ] }) });
34392
34392
  }
34393
+ function useLanesFit(lanesKey) {
34394
+ const boxRef = (0, import_react.useRef)(null);
34395
+ const rowRef = (0, import_react.useRef)(null);
34396
+ const [fits, setFits] = (0, import_react.useState)(true);
34397
+ (0, import_react.useEffect)(() => {
34398
+ const box = boxRef.current;
34399
+ const row = rowRef.current;
34400
+ if (!box || !row || typeof ResizeObserver === "undefined") return;
34401
+ const measure = () => {
34402
+ const next = row.scrollWidth <= box.clientWidth + 1;
34403
+ setFits((prev) => prev === next ? prev : next);
34404
+ };
34405
+ measure();
34406
+ const observer = new ResizeObserver(measure);
34407
+ observer.observe(box);
34408
+ observer.observe(row);
34409
+ return () => observer.disconnect();
34410
+ }, [lanesKey]);
34411
+ return { boxRef, rowRef, fits };
34412
+ }
34393
34413
  function TableScopeBar({ lanes, value, onChange, dimension, organization }) {
34394
34414
  const id = (0, import_react.useId)();
34415
+ const { boxRef, rowRef, fits } = useLanesFit(lanes.map((lane) => `${lane.value}:${lane.count ?? ""}`).join("|"));
34395
34416
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { "data-matrx-table-scope-bar": true, className: "flex min-w-0 shrink-0 flex-col gap-1 sm:flex-row sm:items-center", children: [
34396
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "min-w-0 sm:flex-1", children: [
34417
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref: boxRef, "data-matrx-table-scope-lanes": fits ? "tabs" : "select", className: "relative min-w-0 sm:flex-1", children: [
34397
34418
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
34398
34419
  "select",
34399
34420
  {
34400
34421
  "aria-label": "Record scope",
34401
34422
  value,
34402
34423
  onChange: (event) => onChange(event.target.value),
34403
- className: "h-[var(--matrx-table-control-size,2rem)] w-full rounded-md border border-input bg-background px-2 text-sm sm:hidden",
34424
+ className: `h-[var(--matrx-table-control-size,2rem)] w-full rounded-md border border-input bg-background px-2 text-sm sm:w-auto sm:max-w-full ${fits ? "sm:hidden" : ""}`,
34404
34425
  children: lanes.map((lane) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: lane.value, disabled: lane.disabled, children: [
34405
34426
  lane.label,
34406
34427
  lane.count == null ? "" : ` (${lane.count.toLocaleString()})`
34407
34428
  ] }, lane.value))
34408
34429
  }
34409
34430
  ),
34410
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { role: "tablist", "aria-label": "Record scope", className: "hidden min-w-0 gap-1 overflow-x-auto sm:flex", children: lanes.map((lane) => {
34411
- const Icon3 = lane.icon ?? SCOPE_ICONS[lane.value] ?? Layers;
34412
- const active = value === lane.value;
34413
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
34414
- "button",
34415
- {
34416
- type: "button",
34417
- role: "tab",
34418
- "aria-selected": active,
34419
- "aria-label": lane.count == null ? lane.label : `${lane.label}, ${lane.count.toLocaleString()} records`,
34420
- disabled: lane.disabled,
34421
- onClick: () => onChange(lane.value),
34422
- className: `inline-flex h-[var(--matrx-table-control-size,2rem)] shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2.5 text-sm font-medium transition-colors disabled:opacity-50 ${active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"}`,
34423
- children: [
34424
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon3, { "aria-hidden": "true", className: "h-3.5 w-3.5 shrink-0" }),
34425
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: lane.label }),
34426
- lane.count == null ? null : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `rounded px-1 text-xs font-semibold tabular-nums ${active ? "bg-primary-foreground/20" : "bg-muted-foreground/15"}`, children: lane.count.toLocaleString() })
34427
- ]
34428
- },
34429
- lane.value
34430
- );
34431
- }) })
34431
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
34432
+ "div",
34433
+ {
34434
+ ref: rowRef,
34435
+ role: "tablist",
34436
+ "aria-label": "Record scope",
34437
+ ...fits ? {} : { "aria-hidden": true, inert: true },
34438
+ className: `hidden min-w-0 gap-1 overflow-hidden sm:flex ${fits ? "" : "pointer-events-none invisible absolute left-0 top-0 max-w-none"}`,
34439
+ children: lanes.map((lane) => {
34440
+ const Icon3 = lane.icon ?? SCOPE_ICONS[lane.value] ?? Layers;
34441
+ const active = value === lane.value;
34442
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
34443
+ "button",
34444
+ {
34445
+ type: "button",
34446
+ role: "tab",
34447
+ "aria-selected": active,
34448
+ "aria-label": lane.count == null ? lane.label : `${lane.label}, ${lane.count.toLocaleString()} records`,
34449
+ disabled: lane.disabled,
34450
+ onClick: () => onChange(lane.value),
34451
+ className: `inline-flex h-[var(--matrx-table-control-size,2rem)] shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2.5 text-sm font-medium transition-colors disabled:opacity-50 ${active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"}`,
34452
+ children: [
34453
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon3, { "aria-hidden": "true", className: "h-3.5 w-3.5 shrink-0" }),
34454
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: lane.label }),
34455
+ lane.count == null ? null : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `rounded px-1 text-xs font-semibold tabular-nums ${active ? "bg-primary-foreground/20" : "bg-muted-foreground/15"}`, children: lane.count.toLocaleString() })
34456
+ ]
34457
+ },
34458
+ lane.value
34459
+ );
34460
+ })
34461
+ }
34462
+ )
34432
34463
  ] }),
34433
34464
  dimension || organization ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "grid min-w-0 shrink-0 grid-cols-2 gap-1 sm:flex sm:max-w-[50%]", children: [
34434
34465
  dimension ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ScopeFilter, { filter: dimension, id: `${id}-dimension` }) : null,