@ai-matrx/design-system 0.11.0 → 0.11.2
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 +108 -0
- 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/dist/styles.css
CHANGED
|
@@ -312,30 +312,55 @@
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
/* --- centred dialog card ----------------------------------------------
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
315
|
+
CENTRING AND MOTION ARE TWO DIFFERENT CSS PROPERTIES HERE, ON PURPOSE.
|
|
316
|
+
0.10.0 centred the card with `translate-x-[-50%] translate-y-[-50%]`
|
|
317
|
+
utilities and RE-STATED that centring inside the keyframes, on the
|
|
318
|
+
assumption an animation of `transform` replaces whatever positioned the
|
|
319
|
+
element. That assumption is a Tailwind v3 assumption, and it shipped a
|
|
320
|
+
live regression:
|
|
321
|
+
|
|
322
|
+
Tailwind v3 `translate-x-[-50%]` -> `transform: translate(…)` (replaced)
|
|
323
|
+
Tailwind v4 `translate-x-[-50%]` -> `translate: -50% -50%` (COMPOSES)
|
|
324
|
+
|
|
325
|
+
`translate` is an independent transform property: per spec it is applied
|
|
326
|
+
IN ADDITION to `transform`, not replaced by it. So on every v4 host the
|
|
327
|
+
card was centred twice for the animation's whole duration and snapped back
|
|
328
|
+
at the end. Measured live, 2560x1289, resting rect x=128 y=32:
|
|
329
|
+
currentTime=0 -> x=-966 y=-525 (off the top-left of the viewport);
|
|
330
|
+
`el.style.translate='none'` mid-animation -> x=137 y=41, i.e. resting.
|
|
331
|
+
Three of four consumers regressed (aidream/dashboard, workflow-studio,
|
|
332
|
+
matrx-extend went from instant-and-centred to flying in from off-screen).
|
|
333
|
+
|
|
334
|
+
The fix does not pick a Tailwind version. The package owns the centring
|
|
335
|
+
itself, in the `translate` property, on `.matrx-dialog-centered` below —
|
|
336
|
+
so it reads identically under v3 and v4 hosts — and the keyframes express
|
|
337
|
+
ONLY the delta: opacity, and a 2% rise scaled up from 95% carried by
|
|
338
|
+
`transform`, which now has no other job. Resting state is
|
|
339
|
+
`translate: -50% -50%; transform: none`, byte-identical to 0.10.0's
|
|
340
|
+
rendered rect. The two never restate each other again, and
|
|
341
|
+
`motion.test.tsx` fails the build if a centred surface goes back to
|
|
342
|
+
wearing a non-zero translate utility. */
|
|
343
|
+
.matrx-dialog-centered {
|
|
344
|
+
translate: -50% -50%;
|
|
345
|
+
}
|
|
321
346
|
@keyframes matrx-dialog-in {
|
|
322
347
|
from {
|
|
323
348
|
opacity: 0;
|
|
324
|
-
transform:
|
|
349
|
+
transform: translateY(2%) scale(0.95);
|
|
325
350
|
}
|
|
326
351
|
to {
|
|
327
352
|
opacity: 1;
|
|
328
|
-
transform:
|
|
353
|
+
transform: none;
|
|
329
354
|
}
|
|
330
355
|
}
|
|
331
356
|
@keyframes matrx-dialog-out {
|
|
332
357
|
from {
|
|
333
358
|
opacity: 1;
|
|
334
|
-
transform:
|
|
359
|
+
transform: none;
|
|
335
360
|
}
|
|
336
361
|
to {
|
|
337
362
|
opacity: 0;
|
|
338
|
-
transform:
|
|
363
|
+
transform: translateY(2%) scale(0.95);
|
|
339
364
|
}
|
|
340
365
|
}
|
|
341
366
|
.matrx-motion-dialog[data-state="open"] {
|
|
@@ -608,6 +633,30 @@
|
|
|
608
633
|
var(--matrx-motion-ease-in);
|
|
609
634
|
}
|
|
610
635
|
|
|
636
|
+
/* THE POPPER'S RESTING GAP — same law as `.matrx-dialog-centered` above, same
|
|
637
|
+
reason. `Select` in `popper` position used to nudge itself off its trigger
|
|
638
|
+
with `data-[side=bottom]:translate-y-1` and three siblings. Those are
|
|
639
|
+
Tailwind translate utilities on a surface whose keyframes animate
|
|
640
|
+
`transform` — the identical composite hazard the centred card shipped in
|
|
641
|
+
0.10.0, at 4px instead of half a viewport: on a v4 host the gap composed
|
|
642
|
+
correctly by luck, on a v3 host the animation replaced it and the surface
|
|
643
|
+
snapped 4px at the end. Stated as the `translate` property, it is the
|
|
644
|
+
resting offset in every host and the keyframes keep `transform` to
|
|
645
|
+
themselves. Sides are Radix's `data-side` (where the surface SITS), so a
|
|
646
|
+
surface below its trigger moves further down. */
|
|
647
|
+
.matrx-popper-offset[data-side="bottom"] {
|
|
648
|
+
translate: 0 var(--matrx-popper-offset);
|
|
649
|
+
}
|
|
650
|
+
.matrx-popper-offset[data-side="top"] {
|
|
651
|
+
translate: 0 calc(-1 * var(--matrx-popper-offset));
|
|
652
|
+
}
|
|
653
|
+
.matrx-popper-offset[data-side="right"] {
|
|
654
|
+
translate: var(--matrx-popper-offset) 0;
|
|
655
|
+
}
|
|
656
|
+
.matrx-popper-offset[data-side="left"] {
|
|
657
|
+
translate: calc(-1 * var(--matrx-popper-offset)) 0;
|
|
658
|
+
}
|
|
659
|
+
|
|
611
660
|
/* --- the two indefinite loops -----------------------------------------
|
|
612
661
|
`animate-pulse` and `animate-spin` ARE core Tailwind, so they survive in a
|
|
613
662
|
Tailwind host — but a Skeleton that does not pulse is indistinguishable
|
package/dist/tokens.css
CHANGED
|
@@ -142,6 +142,11 @@
|
|
|
142
142
|
/* The distance a popper travels toward its anchor as it opens. 0.5rem is
|
|
143
143
|
the `slide-in-from-*-2` the primitives carried. */
|
|
144
144
|
--matrx-motion-popper-travel: 0.5rem;
|
|
145
|
+
/* The RESTING gap between a `popper`-positioned surface and its trigger —
|
|
146
|
+
not motion, geometry. 0.25rem is the `translate-y-1` the primitives
|
|
147
|
+
carried before 0.10.1 moved it off Tailwind's translate utilities and
|
|
148
|
+
into the `translate` property (see `.matrx-popper-offset`). */
|
|
149
|
+
--matrx-popper-offset: 0.25rem;
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
/* Dark theme. Matches the `.dark`-class convention (Tailwind v4 hosts wire
|
package/package.json
CHANGED