@ai-matrx/design-system 0.61.10 → 0.61.12
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 +23 -0
- package/dist/controls.cjs +10 -1
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.css +24 -0
- package/dist/controls.d.cts +19 -1
- package/dist/controls.d.ts +19 -1
- package/dist/controls.js +10 -1
- package/dist/controls.js.map +1 -1
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.61.12 — the pill guard flags a pill that runs past its row or the screen
|
|
4
|
+
|
|
5
|
+
- Pill guard: a capsule whose box runs past its parent's box or the viewport is outlined. Measured:
|
|
6
|
+
/education/overview at 375px, "206 Flashcard Stu…" ran off the right edge once the pills stopped
|
|
7
|
+
stretching. A pill inside a sideways scroller (an ancestor with overflow-x auto/scroll) is
|
|
8
|
+
off-screen by design and not judged. Guard case red on 0.61.11.
|
|
9
|
+
|
|
10
|
+
No consumer action.
|
|
11
|
+
|
|
12
|
+
## 0.61.11 — a button collapses by its container, never the viewport
|
|
13
|
+
|
|
14
|
+
- `Button collapse="container"`: below 48rem of the nearest `matrx-controls` container the button
|
|
15
|
+
is its leading `icon` alone (the 28px circle); the label stays in the DOM as its accessible name
|
|
16
|
+
and becomes its `title`. No icon, or no such container, never collapses. Measured: /agents/all
|
|
17
|
+
beside the chat panel — a 540px list pane at a 1024px viewport kept full-width labelled actions,
|
|
18
|
+
because every collapse in the list header asked the viewport.
|
|
19
|
+
- New exports `CONTROLS_CONTAINER_NAME` (`matrx-controls`), `CONTROLS_CONTAINER_CLASS`
|
|
20
|
+
(`.matrx-controls-container`, `container: matrx-controls / inline-size`) and
|
|
21
|
+
`CONTROLS_COLLAPSE_BELOW_REM` (48). Guard: `controls/collapse-by-container.test.tsx`.
|
|
22
|
+
|
|
23
|
+
Consumer action: declare the container on the box whose width decides (a list pane: add
|
|
24
|
+
`matrx-controls` to its `container-name`), then pass `collapse="container"` to its actions.
|
|
25
|
+
|
|
3
26
|
## 0.61.10 — the pill guard flags a stretched pill
|
|
4
27
|
|
|
5
28
|
- Pill guard: a capsule whose content box is more than 8px wider than its own ink (text runs plus
|
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,
|