actual-css 0.4.2 → 0.5.0
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 +49 -2
- package/README.md +2 -2
- package/dist/actual.css +53 -14
- package/dist/actual.full.css +287 -91
- package/dist/actual.full.js +1 -1
- package/dist/actual.full.min.css +1 -1
- package/dist/actual.min.css +1 -1
- package/docs/design-notes/spacing-units.md +286 -0
- package/docs/navigation.json +1 -0
- package/docs/pages/components/alert.md +1 -1
- package/docs/pages/components/app-navigation.md +2 -0
- package/docs/pages/components/badge.md +17 -3
- package/docs/pages/components/button.md +9 -2
- package/docs/pages/components/card.md +13 -0
- package/docs/pages/components/data-list.md +72 -0
- package/docs/pages/components/dialog.md +2 -0
- package/docs/pages/components/drawer.md +2 -0
- package/docs/pages/components/fab.md +2 -0
- package/docs/pages/components/meter.md +56 -1
- package/docs/pages/components/progress.md +10 -0
- package/docs/pages/components/skeleton.md +2 -0
- package/docs/pages/components/steps.md +10 -2
- package/docs/pages/components/table.md +1 -0
- package/docs/pages/enhancements/flyout.md +2 -0
- package/docs/pages/enhancements/status-bar.md +10 -1
- package/docs/pages/examples/overview.md +2 -1
- package/docs/pages/forms/joined-controls.md +2 -0
- package/docs/pages/forms/overview.md +1 -1
- package/docs/pages/forms/range.md +2 -0
- package/docs/pages/forms/states-and-sizes.md +1 -1
- package/docs/pages/forms/validation.md +2 -0
- package/docs/pages/foundations/philosophy.md +11 -1
- package/docs/pages/foundations/tokens.md +7 -3
- package/docs/pages/foundations/typography.md +10 -2
- package/docs/pages/guides/introduction.md +1 -1
- package/docs/pages/layout/scroll-snap.md +2 -0
- package/docs/pages/layout/sidebar-layout.md +2 -0
- package/docs/pages/layout/topbar.md +2 -0
- package/docs/pages/utilities/accessibility.md +18 -0
- package/package.json +1 -1
- package/scripts/reserved-classes.json +4 -0
- package/src/css/components/data-list.css +27 -0
- package/src/css/components/drawer.css +30 -11
- package/src/css/components/flyout.css +17 -12
- package/src/css/components/index.css +1 -0
- package/src/css/components/meter.css +28 -1
- package/src/css/components/modal.css +28 -11
- package/src/css/components/progress.css +5 -0
- package/src/css/components/status-bar.css +31 -15
- package/src/css/components/steps.css +35 -9
- package/src/css/components/surface.css +5 -3
- package/src/css/components/tooltip.css +5 -8
- package/src/css/core/base.css +7 -1
- package/src/css/core/intents.css +6 -0
- package/src/css/core/tokens.css +23 -9
- package/src/css/core/variants.css +17 -4
- package/src/css/forms/form.css +4 -4
- package/src/css/typography/prose.css +2 -3
- package/src/css/utilities/base.css +16 -0
- package/src/js/selectors.js +1 -0
- package/src/js/status.js +88 -7
- package/src/js/surface.js +2 -11
- package/src/js/transition.js +20 -0
package/src/js/surface.js
CHANGED
|
@@ -4,6 +4,7 @@ import { EVENTS } from "./events.js";
|
|
|
4
4
|
import { autoUpdate, reposition, repositionAt } from "./floating.js";
|
|
5
5
|
|
|
6
6
|
import { CLASSES } from "./selectors.js";
|
|
7
|
+
import { waitForTransitions } from "./transition.js";
|
|
7
8
|
|
|
8
9
|
const openSurfaces = new Set();
|
|
9
10
|
const surfaceMap = new WeakMap();
|
|
@@ -46,16 +47,6 @@ function reaperFor(menu) {
|
|
|
46
47
|
return reaper;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
function waitForAnimations(...elements) {
|
|
50
|
-
const animations = elements
|
|
51
|
-
.filter(Boolean)
|
|
52
|
-
.flatMap((el) =>
|
|
53
|
-
typeof el.getAnimations === "function" ? el.getAnimations({ subtree: true }) : [],
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
return Promise.allSettled(animations.map((animation) => animation.finished));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
50
|
function getSurfaceRoot(menu, anchor) {
|
|
60
51
|
return anchor?.closest("dialog") || menu.closest("dialog") || menu.ownerDocument.body;
|
|
61
52
|
}
|
|
@@ -360,7 +351,7 @@ export function closeSurface(menu, opts = {}) {
|
|
|
360
351
|
state.restoreFocusTo.focus({ preventScroll: true });
|
|
361
352
|
}
|
|
362
353
|
|
|
363
|
-
|
|
354
|
+
waitForTransitions(menu, backdrop).then(() => {
|
|
364
355
|
if (!state || state.closeId !== closeId) return;
|
|
365
356
|
state.isSheet = false;
|
|
366
357
|
menu.classList.remove(CLASSES.sheet);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* CSS transition lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* getAnimations() exposes both CSS transitions and keyframe animations.
|
|
5
|
+
* Cleanup that belongs to a state transition must not wait for arbitrary
|
|
6
|
+
* author animations, which may be infinite. CSSTransition instances expose
|
|
7
|
+
* transitionProperty; using that structural contract avoids a global check
|
|
8
|
+
* and keeps component JavaScript independent from the properties CSS owns.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export function waitForTransitions(...elements) {
|
|
12
|
+
const transitions = elements
|
|
13
|
+
.filter(Boolean)
|
|
14
|
+
.flatMap((element) =>
|
|
15
|
+
typeof element.getAnimations === "function" ? element.getAnimations({ subtree: true }) : [],
|
|
16
|
+
)
|
|
17
|
+
.filter((animation) => typeof animation.transitionProperty === "string");
|
|
18
|
+
|
|
19
|
+
return Promise.allSettled(transitions.map((transition) => transition.finished));
|
|
20
|
+
}
|