actual-css 0.4.0 → 0.4.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 +84 -35
- package/dist/actual.css +1 -20
- package/dist/actual.full.css +692 -221
- 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/app-ui.md +33 -0
- package/docs/design-notes/enhancement-contract.md +25 -0
- package/docs/design-notes/grid.md +177 -4
- package/docs/design-notes/references.md +1 -1
- package/docs/navigation.json +7 -1
- package/docs/pages/components/alert.md +5 -0
- package/docs/pages/components/app-navigation.md +34 -0
- package/docs/pages/components/avatar.md +10 -0
- package/docs/pages/components/badge.md +2 -0
- package/docs/pages/components/button.md +30 -0
- package/docs/pages/components/card.md +5 -1
- package/docs/pages/components/fab.md +2 -0
- package/docs/pages/components/indicator.md +52 -0
- package/docs/pages/components/list.md +62 -0
- package/docs/pages/components/navbar.md +6 -0
- package/docs/pages/components/rating.md +68 -0
- package/docs/pages/components/steps.md +57 -0
- package/docs/pages/enhancements/flyout.md +2 -2
- package/docs/pages/enhancements/tabs.md +1 -2
- package/docs/pages/examples/overview.md +8 -0
- package/docs/pages/forms/otp.md +32 -0
- package/docs/pages/forms/states-and-sizes.md +3 -3
- package/docs/pages/guides/integrating-actual-css.md +6 -0
- package/docs/pages/layout/app-layout.md +57 -0
- package/docs/pages/layout/app-shell.md +28 -7
- package/docs/pages/layout/center.md +12 -1
- package/docs/pages/layout/choosing.md +15 -0
- package/docs/pages/layout/grid.md +41 -8
- package/docs/pages/layout/sidebar-layout.md +19 -0
- package/docs/pages/layout/stack.md +17 -0
- package/docs/pages/patterns/icon-slot.md +61 -0
- package/docs/pages/patterns/structured-lists.md +38 -40
- package/package.json +3 -2
- package/scripts/reserved-classes.json +17 -0
- package/src/css/components/actions.css +1 -0
- package/src/css/components/app-nav.css +76 -0
- package/src/css/components/avatar.css +4 -0
- package/src/css/components/badge.css +1 -13
- package/src/css/components/breadcrumb.css +1 -0
- package/src/css/components/button.css +8 -38
- package/src/css/components/card.css +11 -11
- package/src/css/components/chat.css +0 -6
- package/src/css/components/drawer.css +0 -6
- package/src/css/components/fab.css +1 -7
- package/src/css/components/index.css +5 -0
- package/src/css/components/indicator.css +47 -0
- package/src/css/components/list.css +83 -0
- package/src/css/components/menu.css +0 -7
- package/src/css/components/modal.css +0 -17
- package/src/css/components/navbar.css +8 -15
- package/src/css/components/pagination.css +1 -0
- package/src/css/components/rating.css +101 -0
- package/src/css/components/steps.css +123 -0
- package/src/css/components/tab.css +21 -22
- package/src/css/components/tooltip.css +1 -10
- package/src/css/core/focus.css +0 -8
- package/src/css/core/theme.css +0 -10
- package/src/css/core/tokens.css +1 -2
- package/src/css/effects/aura.css +1 -10
- package/src/css/forms/choice-card.css +6 -15
- package/src/css/forms/form-actions.css +1 -0
- package/src/css/forms/otp.css +7 -2
- package/src/css/forms/range.css +14 -4
- package/src/css/layout/app-layout.css +102 -0
- package/src/css/layout/app-shell.css +1 -1
- package/src/css/layout/center.css +1 -0
- package/src/css/layout/cluster.css +1 -0
- package/src/css/layout/container-query.css +6 -4
- package/src/css/layout/grid.css +25 -11
- package/src/css/layout/index.css +4 -2
- package/src/css/layout/scroll-snap.css +1 -0
- package/src/css/layout/sidebar-layout.css +23 -1
- package/src/css/layout/switcher.css +1 -0
- package/src/css/layout/topbar.css +1 -0
- package/src/css/typography/prose.css +4 -0
- package/src/js/tooltip.js +2 -1
- package/docs/pages/layout/list.md +0 -41
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Convenience helper: establishes a query container named actual-grid for
|
|
2
2
|
descendants. Use it for a component that changes representation according
|
|
3
|
-
to its allocated inline size, and to
|
|
4
|
-
(see grid.css).
|
|
3
|
+
to its allocated inline size, and to give .grid-N the named context it needs
|
|
4
|
+
for balanced subdivision (see grid.css). The name matters: grids only respond
|
|
5
|
+
to an explicitly actual-grid-named container, never to an incidental
|
|
6
|
+
query container. Layout primitives are responsive without it; this adds
|
|
5
7
|
precision, it is never a prerequisite.
|
|
6
8
|
|
|
7
9
|
The element takes inline-size containment, so put it on a normal
|
|
@@ -9,5 +11,5 @@
|
|
|
9
11
|
float, an inline-block): its contents would stop contributing to its own
|
|
10
12
|
inline size and it would collapse. */
|
|
11
13
|
.container-query {
|
|
12
|
-
container
|
|
14
|
+
container: actual-grid / inline-size;
|
|
13
15
|
}
|
package/src/css/layout/grid.css
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
/* Recipe:
|
|
25
25
|
- collection whose item width is the contract -> .grid, tune --grid-min
|
|
26
26
|
- collection whose column density is the contract -> .grid-2/3/4/6
|
|
27
|
-
- balanced subdivision of that density ->
|
|
27
|
+
- balanced subdivision of that density -> place it inside any size query
|
|
28
|
+
container (.container-query is the convenience helper for that context)
|
|
28
29
|
- peer regions that switch as a group -> .switcher
|
|
29
30
|
- content + aside -> .sidebar-layout
|
|
30
31
|
- exact custom track templates -> --grid-columns with an explicit collapse
|
|
@@ -85,7 +86,13 @@
|
|
|
85
86
|
min-inline-size: 0;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
/* Balanced subdivision,
|
|
89
|
+
/* Balanced subdivision, activated by an ancestor container named actual-grid.
|
|
90
|
+
* A .grid-N inside such a container enters only divisor states of N. The name
|
|
91
|
+
* is deliberate: a grid must not key off the nearest anonymous query container,
|
|
92
|
+
* or a region that sets container-type: inline-size for an unrelated reason
|
|
93
|
+
* would silently change the grid. The author opts the grid in by naming the
|
|
94
|
+
* context — .container-query is the official helper, or declare
|
|
95
|
+
* container: actual-grid / inline-size on your own region.
|
|
89
96
|
*
|
|
90
97
|
* .grid-2 2 -> 1
|
|
91
98
|
* .grid-3 3 -> 1
|
|
@@ -102,6 +109,11 @@
|
|
|
102
109
|
* inline contribution and collapses it inside .cluster, .topbar, floats, and
|
|
103
110
|
* any shrink-to-fit box. See docs/design-notes/grid.md.
|
|
104
111
|
*
|
|
112
|
+
* Without an actual-grid ancestor none of these @container rules resolve, so
|
|
113
|
+
* the auto-fill baseline above stays. The min-width: 0 rule is the lowest
|
|
114
|
+
* step: it pins the grid to one column inside a container before any larger
|
|
115
|
+
* threshold fires (a bare grid would otherwise show a 2 + 1 orphan at 28-48rem).
|
|
116
|
+
*
|
|
105
117
|
* Three shared thresholds, not one calibrated per preset: 28rem opens the
|
|
106
118
|
* first horizontal density, 48rem opens three columns, 64rem opens the dense
|
|
107
119
|
* 4 and 6. N already carries the author's statement about item size, so
|
|
@@ -113,28 +125,30 @@
|
|
|
113
125
|
* Ascending min-width only: the last matching step wins by cascade order.
|
|
114
126
|
*/
|
|
115
127
|
@supports (container-type: inline-size) {
|
|
116
|
-
|
|
117
|
-
grid-
|
|
128
|
+
@container actual-grid (min-width: 0px) {
|
|
129
|
+
:where(.grid-2, .grid-3, .grid-4, .grid-6) {
|
|
130
|
+
grid-template-columns: 1fr;
|
|
131
|
+
}
|
|
118
132
|
}
|
|
119
133
|
|
|
120
|
-
@container (min-width: 28rem) {
|
|
121
|
-
|
|
134
|
+
@container actual-grid (min-width: 28rem) {
|
|
135
|
+
:where(.grid-2, .grid-4, .grid-6) {
|
|
122
136
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
123
137
|
}
|
|
124
138
|
}
|
|
125
139
|
|
|
126
|
-
@container (min-width: 48rem) {
|
|
127
|
-
|
|
140
|
+
@container actual-grid (min-width: 48rem) {
|
|
141
|
+
:where(.grid-3, .grid-6) {
|
|
128
142
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
129
143
|
}
|
|
130
144
|
}
|
|
131
145
|
|
|
132
|
-
@container (min-width: 64rem) {
|
|
133
|
-
|
|
146
|
+
@container actual-grid (min-width: 64rem) {
|
|
147
|
+
:where(.grid-4) {
|
|
134
148
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
135
149
|
}
|
|
136
150
|
|
|
137
|
-
|
|
151
|
+
:where(.grid-6) {
|
|
138
152
|
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
139
153
|
}
|
|
140
154
|
}
|
package/src/css/layout/index.css
CHANGED
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
* .center centered content column
|
|
9
9
|
* .frame fixed-ratio media frame
|
|
10
10
|
* .app-shell full-height application shell
|
|
11
|
+
* .app-layout topbar + scrolling main + bottom/side app navigation
|
|
11
12
|
* .media fixed media + flexible content
|
|
12
13
|
* .switcher peer regions: all horizontal or all stacked
|
|
13
14
|
* .sidebar-layout main content + secondary aside
|
|
14
15
|
* .grid responsive collection; item width is the contract
|
|
15
|
-
*
|
|
16
|
-
*
|
|
16
|
+
* .grid-N structural density of N; balanced inside a container named
|
|
17
|
+
* actual-grid (in grid.css)
|
|
17
18
|
* .column-layout explicit 12-column region composition; the author owns
|
|
18
19
|
* narrow-container recomposition
|
|
19
20
|
* .scroller theme-aware scrollbar density and colour
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
@import "./center.css";
|
|
31
32
|
@import "./frame.css";
|
|
32
33
|
@import "./app-shell.css";
|
|
34
|
+
@import "./app-layout.css";
|
|
33
35
|
@import "./media.css";
|
|
34
36
|
@import "./switcher.css";
|
|
35
37
|
@import "./sidebar-layout.css";
|
|
@@ -10,22 +10,44 @@
|
|
|
10
10
|
* --sidebar-content-min
|
|
11
11
|
* --sidebar-layout-size
|
|
12
12
|
*
|
|
13
|
-
* Child contract: the first and
|
|
13
|
+
* Child contract: the main region is first and the aside second by default
|
|
14
|
+
* (aside on the inline end). .reverse expects the aside first in the DOM, so
|
|
15
|
+
* visual, reading and keyboard order all agree — the role rules swap so the
|
|
16
|
+
* aside still takes its preferred width and the main still reclaims the row.
|
|
14
17
|
*/
|
|
15
18
|
.sidebar-layout {
|
|
16
19
|
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
17
21
|
flex-wrap: wrap;
|
|
18
22
|
gap: var(--gap);
|
|
19
23
|
align-items: flex-start;
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
/* Main region — flexible, reclaims the full row when the aside wraps. */
|
|
22
27
|
.sidebar-layout > :first-child {
|
|
23
28
|
flex-basis: 0;
|
|
24
29
|
flex-grow: 999;
|
|
25
30
|
min-inline-size: min(100%, var(--sidebar-content-min, 30rem));
|
|
26
31
|
}
|
|
27
32
|
|
|
33
|
+
/* Aside region — preferred width, never forces content min-width. */
|
|
28
34
|
.sidebar-layout > :last-child {
|
|
29
35
|
flex-basis: var(--sidebar-layout-size, 18rem);
|
|
30
36
|
flex-grow: 1;
|
|
37
|
+
min-inline-size: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* .reverse: the aside is first in the DOM and the main last, so each role
|
|
41
|
+
rule above would hit the wrong element. Swap the sizing per child; the
|
|
42
|
+
higher-specificity reverse rules outrank the positional defaults. */
|
|
43
|
+
.sidebar-layout.reverse > :last-child {
|
|
44
|
+
flex-basis: 0;
|
|
45
|
+
flex-grow: 999;
|
|
46
|
+
min-inline-size: min(100%, var(--sidebar-content-min, 30rem));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.sidebar-layout.reverse > :first-child {
|
|
50
|
+
flex-basis: var(--sidebar-layout-size, 18rem);
|
|
51
|
+
flex-grow: 1;
|
|
52
|
+
min-inline-size: 0;
|
|
31
53
|
}
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
/* Vertical rhythm belongs to the direct block that participates in the
|
|
39
39
|
document, so it must not be injected into the internals of a nested
|
|
40
40
|
component (e.g. a .table-wrap around a .table would trap the margin). */
|
|
41
|
+
.prose > * {
|
|
42
|
+
margin-block-end: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
41
45
|
.prose > * + * {
|
|
42
46
|
margin-block-start: var(--prose-flow);
|
|
43
47
|
}
|
package/src/js/tooltip.js
CHANGED
|
@@ -358,7 +358,8 @@ function ensureTip(trigger) {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
function cleanupTrigger(trigger) {
|
|
361
|
-
|
|
361
|
+
// The enhancement runtime owns the root-membership decision; a trigger may
|
|
362
|
+
// still be connected after moving beyond that lifecycle boundary.
|
|
362
363
|
triggerStates.get(trigger)?.cleanup?.();
|
|
363
364
|
}
|
|
364
365
|
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# List
|
|
2
|
-
|
|
3
|
-
Lists stay native by default. Compose visual list rows from existing primitives.
|
|
4
|
-
|
|
5
|
-
Use `.list-reset` only when markers are not part of the content. Combine `.stack`, `.media`, `.cluster`, spacing helpers, and local styles for application-style rows.
|
|
6
|
-
|
|
7
|
-
```html demo
|
|
8
|
-
<figure class="stack">
|
|
9
|
-
<figcaption><strong>Most played songs this week</strong></figcaption>
|
|
10
|
-
|
|
11
|
-
<ul class="list-reset stack gap-none">
|
|
12
|
-
<li class="media items-center py" style="border-block-end: var(--border-width) solid var(--border)">
|
|
13
|
-
<div class="avatar">
|
|
14
|
-
<img src="https://i.pravatar.cc/48?img=5" alt="Dio Lupa" />
|
|
15
|
-
</div>
|
|
16
|
-
<div class="cluster">
|
|
17
|
-
<div class="stack grow" style="--gap: var(--space-10)">
|
|
18
|
-
<strong>Dio Lupa</strong>
|
|
19
|
-
<span class="muted">Remaining Reason</span>
|
|
20
|
-
</div>
|
|
21
|
-
<span class="muted">3:45</span>
|
|
22
|
-
</div>
|
|
23
|
-
</li>
|
|
24
|
-
|
|
25
|
-
<li class="media items-center py" style="border-block-end: var(--border-width) solid var(--border)">
|
|
26
|
-
<div class="avatar">
|
|
27
|
-
<img src="https://i.pravatar.cc/48?img=10" alt="Astral Planes" />
|
|
28
|
-
</div>
|
|
29
|
-
<div class="cluster">
|
|
30
|
-
<div class="stack grow" style="--gap: var(--space-10)">
|
|
31
|
-
<strong>Astral Planes</strong>
|
|
32
|
-
<span class="muted">Neon Drift</span>
|
|
33
|
-
</div>
|
|
34
|
-
<span class="muted">4:12</span>
|
|
35
|
-
</div>
|
|
36
|
-
</li>
|
|
37
|
-
</ul>
|
|
38
|
-
</figure>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Keep semantic lists unstyled when the markers carry meaning.
|