@ai-matrx/design-system 0.10.0 → 0.10.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/CHANGELOG.md +95 -2
- package/dist/index.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/styles.css +59 -10
- package/dist/tokens.css +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.1 — 2026-09-07
|
|
4
|
+
|
|
5
|
+
**THE CENTRED DIALOG FLEW IN FROM OFF THE SCREEN.** 0.10.0 shipped a live
|
|
6
|
+
regression: `Dialog`, `AlertDialog` and `CommandDialog` entered from beyond the
|
|
7
|
+
top-left corner of the viewport and SNAPPED into place at the end of their
|
|
8
|
+
200ms animation. Independent review caught it on the live surface, measured it,
|
|
9
|
+
and proved the cause rather than inferring it.
|
|
10
|
+
|
|
11
|
+
**The cause is that one Tailwind class means two different things.**
|
|
12
|
+
|
|
13
|
+
| | `translate-x-[-50%] translate-y-[-50%]` compiles to |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Tailwind **v3** | `transform: translate(-50%, -50%)` — REPLACED by an animation of `transform` |
|
|
16
|
+
| Tailwind **v4** | `translate: -50% -50%` — an independent property that **composes with** `transform` |
|
|
17
|
+
|
|
18
|
+
0.10.0's keyframes restated the centring inside `transform`
|
|
19
|
+
(`translate(-50%,-48%)` -> `translate(-50%,-50%)`), which is correct under v3
|
|
20
|
+
and doubles the centring under v4. Measured on the live element, viewport
|
|
21
|
+
2560x1289, `getComputedStyle(el).translate === "-50% -50%"` while
|
|
22
|
+
`transform === "none"` at rest:
|
|
23
|
+
|
|
24
|
+
| | x | y |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| resting (correct) | 128 | 32 |
|
|
27
|
+
| `currentTime = 0` | **-966** | **-525** |
|
|
28
|
+
| `currentTime = 100` | **-1015** | **-571** |
|
|
29
|
+
| `currentTime = 199`, `el.style.translate = "none"` | 137 | 41 |
|
|
30
|
+
|
|
31
|
+
That last row is the proof: removing the `translate` property mid-animation
|
|
32
|
+
restores the resting position exactly, because the element was wearing the
|
|
33
|
+
centring twice.
|
|
34
|
+
|
|
35
|
+
**The fix is not a different spelling of the keyframes** — there isn't one that
|
|
36
|
+
works in both hosts. Restate the offset and v4 applies it twice; omit it and v3
|
|
37
|
+
drops it for the animation's duration and snaps at the end. So the offset stops
|
|
38
|
+
being a Tailwind utility at all. This package now owns it, in the `translate`
|
|
39
|
+
property, in its own stylesheet:
|
|
40
|
+
|
|
41
|
+
- `.matrx-dialog-centered` (`translate: -50% -50%`) carries the centring, and
|
|
42
|
+
the keyframes carry ONLY the delta — `opacity`, plus a 2% rise scaled up from
|
|
43
|
+
95% in `transform`, ending on `transform: none`. Resting geometry is
|
|
44
|
+
byte-identical to 0.10.0's; `transform` and `translate` never restate each
|
|
45
|
+
other again, in any host.
|
|
46
|
+
- **Census — the same hazard, one more surface.** `Select` in `popper` position
|
|
47
|
+
held its 4px gap from the trigger with `data-[side=bottom]:translate-y-1` and
|
|
48
|
+
three siblings, while `matrx-popper-*` keyframes animate `transform`. Same
|
|
49
|
+
defect, 4px instead of half a viewport, failing the other way round (a v3
|
|
50
|
+
host ate the gap for the animation and snapped it back). It is now
|
|
51
|
+
`.matrx-popper-offset`, sized by the new `--matrx-popper-offset` token.
|
|
52
|
+
- `Sheet`, the mobile bottom sheet and every other popper were **not** affected
|
|
53
|
+
and are unchanged — their translate utilities are zero-valued or absent.
|
|
54
|
+
|
|
55
|
+
**The guard, proven failing-then-passing.** jsdom cannot measure a composite
|
|
56
|
+
transform, so the hazard is asserted as a RULE over the sources in
|
|
57
|
+
`motion.test.tsx`: *no component may pair a NON-ZERO Tailwind translate utility
|
|
58
|
+
with a package motion class*, plus the centred keyframes may not mention `-50%`
|
|
59
|
+
and must end on `transform: none`, plus each of the three surfaces must render
|
|
60
|
+
the package's centring class. Restoring 0.10.0's exact shape (the utility in
|
|
61
|
+
`DIALOG_DESKTOP_CLASSES` and the centring back in the keyframes) turns 4 of
|
|
62
|
+
these red; the fix turns them green. `motion.test.tsx`'s old assertion that
|
|
63
|
+
`translate-x-[-50%]` survives `animated={false}` PINNED the defect — it now
|
|
64
|
+
asserts the centring class survives and the utility is gone. The C26 canaries
|
|
65
|
+
grew too: both new rules are required in `styles.test.ts` and in the packed
|
|
66
|
+
tarball.
|
|
67
|
+
|
|
68
|
+
### Consumer action (C28)
|
|
69
|
+
|
|
70
|
+
**None.** No API changed, no class a consumer writes changed, and resting
|
|
71
|
+
geometry is identical. Take the patch.
|
|
72
|
+
|
|
73
|
+
Named, because they are the ones that regressed: **aidream/dashboard**,
|
|
74
|
+
**aidream/workflow-studio** and **matrx-extend** loaded no animation rules at
|
|
75
|
+
all before 0.10.0, so their dialogs had always appeared instantly and correctly
|
|
76
|
+
centred — 0.10.0 is what gave them a dialog that flies in from off-screen.
|
|
77
|
+
matrx-frontend was NOT visibly changed by either release: its pre-0.10.0
|
|
78
|
+
`tw-animate-css` spelling had the identical stacking flaw. All four are correct
|
|
79
|
+
on 0.10.1.
|
|
80
|
+
|
|
3
81
|
## 0.10.0 — 2026-09-07
|
|
4
82
|
|
|
5
83
|
**THE MOTION SWEEP. Ten more primitives were animating with a host plugin this
|
|
@@ -378,9 +456,19 @@ Install `@ai-matrx/design-system@0.7.0` (and `@ai-matrx/tap-target@0.2.0`), then
|
|
|
378
456
|
`alert-dialog.tsx`, `alert.tsx`, `slider.tsx`, `resizable.tsx`,
|
|
379
457
|
`matrx/resizable.tsx`, `radio-group.tsx`, `hover-card.tsx`,
|
|
380
458
|
`toggle-group.tsx`, `toggle.tsx`, `radix-dialog-modal-context.tsx`.
|
|
381
|
-
- No other consumer repo carries a fork of these — verified by census on
|
|
459
|
+
- ~~No other consumer repo carries a fork of these — verified by census on
|
|
382
460
|
2026-09-07 across matrx-extend, matrx-games, aidream `apps/dashboard` and
|
|
383
|
-
`apps/workflow-studio
|
|
461
|
+
`apps/workflow-studio`.~~ 🚨 **WRONG, corrected 2026-09-07.** That census
|
|
462
|
+
swept FOUR repos and there are FIVE: **matrx-local** (`desktop/`, the
|
|
463
|
+
Tauri app) carried its own `tooltip.tsx`, `slider.tsx`, `popover.tsx` and
|
|
464
|
+
`select.tsx` the whole time — plus ten more from the 0.5.0 list below,
|
|
465
|
+
whose Consumer action omitted it for the same reason. The sentence was
|
|
466
|
+
repeated verbatim into census row 19, and every later wave that read it
|
|
467
|
+
kept skipping the repo. matrx-local was adopted on 0.10.0 the same day
|
|
468
|
+
this was found: all seventeen forks swapped, fourteen files deleted, 131
|
|
469
|
+
files repointed, 56 twin-register rows added. **The lesson is the
|
|
470
|
+
sentence, not the repo — a "no other consumer" claim must name the repos
|
|
471
|
+
it swept, and the list must be checked against the actual consumer set.**
|
|
384
472
|
3. **`matrx/resizable.tsx` callers keep their `size` prop** — it is the same
|
|
385
473
|
eight-step scale, now on the one component. Callers of the plain
|
|
386
474
|
`resizable.tsx` get the identical 2px default (`size="sm"`).
|
|
@@ -567,6 +655,11 @@ copy of something this version now ships:
|
|
|
567
655
|
Bind `Card size="lg"` to keep this app's density (Table defaults to md as of 0.5.1).
|
|
568
656
|
- **aidream/apps/workflow-studio** — `src/components/ui/{dialog,dropdown-menu,scroll-area,switch,tabs,textarea}.tsx`.
|
|
569
657
|
Its ScrollArea viewport hack becomes `viewportClassName="[&>div]:!block [&>div]:min-w-0"`.
|
|
658
|
+
- **matrx-local** — `desktop/src/components/ui/{avatar,card,checkbox,dialog,progress,scroll-area,switch,tabs,textarea}.tsx`.
|
|
659
|
+
**Added 2026-09-07**: this repo was missing from the list above (see the
|
|
660
|
+
correction under 0.7.0 Consumer action 2). Adopted on 0.10.0 — `card` and
|
|
661
|
+
`dialog` keep one-prop binding shims for this app's `lg` density and its
|
|
662
|
+
glass surface; everything else re-points straight at the package.
|
|
570
663
|
|
|
571
664
|
Hosts that do not already import the stylesheets must, or the new structural
|
|
572
665
|
rules do nothing:
|
package/dist/index.cjs
CHANGED
|
@@ -62,6 +62,7 @@ __export(src_exports, {
|
|
|
62
62
|
BottomSheetFooter: () => BottomSheetFooter,
|
|
63
63
|
BottomSheetHeader: () => BottomSheetHeader,
|
|
64
64
|
Button: () => Button,
|
|
65
|
+
CENTERED_DIALOG: () => CENTERED_DIALOG,
|
|
65
66
|
Card: () => Card,
|
|
66
67
|
CardAction: () => CardAction,
|
|
67
68
|
CardContent: () => CardContent,
|
|
@@ -155,6 +156,7 @@ __export(src_exports, {
|
|
|
155
156
|
MOTION_SHEET: () => MOTION_SHEET,
|
|
156
157
|
MOTION_SPIN: () => MOTION_SPIN,
|
|
157
158
|
OverflowToolbar: () => OverflowToolbar,
|
|
159
|
+
POPPER_OFFSET: () => POPPER_OFFSET,
|
|
158
160
|
Popover: () => Popover,
|
|
159
161
|
PopoverAnchor: () => PopoverAnchor,
|
|
160
162
|
PopoverContent: () => PopoverContent,
|
|
@@ -950,6 +952,8 @@ Button.displayName = "Button";
|
|
|
950
952
|
// src/motion.ts
|
|
951
953
|
var MOTION_OVERLAY = "matrx-motion-overlay";
|
|
952
954
|
var MOTION_DIALOG = "matrx-motion-dialog";
|
|
955
|
+
var CENTERED_DIALOG = "matrx-dialog-centered";
|
|
956
|
+
var POPPER_OFFSET = "matrx-popper-offset";
|
|
953
957
|
var MOTION_BOTTOM_SHEET = "matrx-motion-bottom-sheet";
|
|
954
958
|
var MOTION_POPPER = "matrx-motion-popper";
|
|
955
959
|
var MOTION_SHEET = {
|
|
@@ -1054,7 +1058,7 @@ var AlertDialogContent = React7.forwardRef(({ className, children, container, an
|
|
|
1054
1058
|
ref,
|
|
1055
1059
|
"data-slot": "alert-dialog-content",
|
|
1056
1060
|
className: cn(
|
|
1057
|
-
|
|
1061
|
+
`fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 border bg-background p-6 shadow-lg`,
|
|
1058
1062
|
// Ruling 3 — never taller than the viewport, always scrollable, and
|
|
1059
1063
|
// the footer stays reachable via --dialog-pad like Dialog's.
|
|
1060
1064
|
"max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full",
|
|
@@ -1395,7 +1399,7 @@ var Command = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1395
1399
|
}
|
|
1396
1400
|
));
|
|
1397
1401
|
Command.displayName = import_cmdk.Command.displayName;
|
|
1398
|
-
var DIALOG_DESKTOP_CLASSES =
|
|
1402
|
+
var DIALOG_DESKTOP_CLASSES = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;
|
|
1399
1403
|
var DIALOG_MOBILE_SHEET_CLASSES = "fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
1400
1404
|
var DIALOG_MOBILE_SHEET_OVERRIDE = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
1401
1405
|
var CommandDialogContent = React13.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
@@ -2008,7 +2012,7 @@ var DialogContentPrimitive = React16.forwardRef((props, ref) => {
|
|
|
2008
2012
|
);
|
|
2009
2013
|
});
|
|
2010
2014
|
DialogContentPrimitive.displayName = "DialogContentPrimitive";
|
|
2011
|
-
var DIALOG_DESKTOP_CLASSES2 =
|
|
2015
|
+
var DIALOG_DESKTOP_CLASSES2 = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;
|
|
2012
2016
|
var DIALOG_MOBILE_SHEET_CLASSES2 = "matrx-mobile-sheet fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
2013
2017
|
var DIALOG_MOBILE_SHEET_OVERRIDE2 = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
2014
2018
|
var DialogContent = React16.forwardRef(
|
|
@@ -3069,7 +3073,12 @@ var SelectContent = React23.forwardRef(
|
|
|
3069
3073
|
className: cn(
|
|
3070
3074
|
"relative z-[10001] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
3071
3075
|
animated && MOTION_POPPER,
|
|
3072
|
-
|
|
3076
|
+
// The resting gap from the trigger. It is the `translate` property
|
|
3077
|
+
// (POPPER_OFFSET), never Tailwind translate utilities: those compose
|
|
3078
|
+
// with `transform` on a v4 host and are REPLACED by it on a v3 one,
|
|
3079
|
+
// so on v3 the animation ate the gap and the surface snapped 4px at
|
|
3080
|
+
// the end. Same law as the centred dialog card — see motion.ts.
|
|
3081
|
+
position === "popper" && POPPER_OFFSET,
|
|
3073
3082
|
className
|
|
3074
3083
|
),
|
|
3075
3084
|
position,
|