@ai-matrx/design-system 0.61.9 → 0.61.11

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,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.61.11 — a button collapses by its container, never the viewport
4
+
5
+ - `Button collapse="container"`: below 48rem of the nearest `matrx-controls` container the button
6
+ is its leading `icon` alone (the 28px circle); the label stays in the DOM as its accessible name
7
+ and becomes its `title`. No icon, or no such container, never collapses. Measured: /agents/all
8
+ beside the chat panel — a 540px list pane at a 1024px viewport kept full-width labelled actions,
9
+ because every collapse in the list header asked the viewport.
10
+ - New exports `CONTROLS_CONTAINER_NAME` (`matrx-controls`), `CONTROLS_CONTAINER_CLASS`
11
+ (`.matrx-controls-container`, `container: matrx-controls / inline-size`) and
12
+ `CONTROLS_COLLAPSE_BELOW_REM` (48). Guard: `controls/collapse-by-container.test.tsx`.
13
+
14
+ Consumer action: declare the container on the box whose width decides (a list pane: add
15
+ `matrx-controls` to its `container-name`), then pass `collapse="container"` to its actions.
16
+
17
+ ## 0.61.10 — the pill guard flags a stretched pill
18
+
19
+ - Pill guard: a capsule whose content box is more than 8px wider than its own ink (text runs plus
20
+ in-flow glyphs) is outlined as STRETCHED — a pill hugs its label; a full-width tappable item is a
21
+ row, never a pill. Measured: /education/overview's metric pills filled their grid columns at 375px
22
+ (label left, up to 103px of empty capsule right). Only measured where the engine reports line
23
+ boxes; `data-matrx-pill="off"` still opts a deliberately wide capsule out. Guard case red on 0.61.9.
24
+
25
+ No consumer action.
26
+
3
27
  ## 0.61.9
4
28
  ### a scope lane is never clipped
5
29
 
package/dist/controls.cjs CHANGED
@@ -33,6 +33,9 @@ var controls_exports = {};
33
33
  __export(controls_exports, {
34
34
  Badge: () => Badge,
35
35
  Button: () => Button2,
36
+ CONTROLS_COLLAPSE_BELOW_REM: () => CONTROLS_COLLAPSE_BELOW_REM,
37
+ CONTROLS_CONTAINER_CLASS: () => CONTROLS_CONTAINER_CLASS,
38
+ CONTROLS_CONTAINER_NAME: () => CONTROLS_CONTAINER_NAME,
36
39
  ConfirmDelete: () => ConfirmDelete,
37
40
  ControlRow: () => ControlRow,
38
41
  ControlScope: () => ControlScope,
@@ -773,6 +776,9 @@ var ControlScope = React7.forwardRef(
773
776
  (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, "data-matrx-controls": "", ...props })
774
777
  );
775
778
  ControlScope.displayName = "ControlScope";
779
+ var CONTROLS_CONTAINER_NAME = "matrx-controls";
780
+ var CONTROLS_CONTAINER_CLASS = "matrx-controls-container";
781
+ var CONTROLS_COLLAPSE_BELOW_REM = 48;
776
782
  function glyphSlot(icon, iconEnd, label) {
777
783
  if (!label && (icon || iconEnd)) return "only";
778
784
  if (icon && iconEnd) return "both";
@@ -781,12 +787,13 @@ function glyphSlot(icon, iconEnd, label) {
781
787
  return void 0;
782
788
  }
783
789
  var Button2 = React7.forwardRef(
784
- ({ className, variant = "outline", tone, icon, iconEnd, asChild = false, children, onClick, type, ...props }, ref) => {
790
+ ({ className, variant = "outline", tone, icon, iconEnd, asChild = false, collapse, children, onClick, type, ...props }, ref) => {
785
791
  const Component = asChild ? import_react_slot2.Slot : "button";
786
792
  const ariaDisabled = props["aria-disabled"];
787
793
  const disabledChild = asChild && Boolean(props.disabled);
788
794
  const inert = disabledChild || ariaDisabled === true || ariaDisabled === "true";
789
795
  const label = asChild && React7.isValidElement(children) ? children.props.children : children;
796
+ const collapses = collapse === "container" && Boolean(icon) && Boolean(label);
790
797
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
791
798
  Component,
792
799
  {
@@ -796,7 +803,9 @@ var Button2 = React7.forwardRef(
796
803
  "data-variant": variant,
797
804
  "data-tone": tone && tone !== "neutral" ? tone : void 0,
798
805
  "data-glyph": glyphSlot(icon, iconEnd, label),
806
+ "data-collapse": collapses ? "container" : void 0,
799
807
  className: cn("matrx-control matrx-control-button matrx-glyph-trim", className),
808
+ title: collapses && typeof label === "string" && props.title === void 0 ? label : void 0,
800
809
  ...props,
801
810
  "aria-disabled": disabledChild ? true : ariaDisabled,
802
811
  tabIndex: disabledChild ? -1 : props.tabIndex,