actual-css 0.16.1 → 0.17.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 +101 -0
- package/README.md +8 -4
- package/components.json +19 -4
- package/dist/actual.full.css +464 -80
- package/dist/actual.full.js +2 -1
- package/dist/actual.full.min.css +1 -1
- package/docs/design-notes/app-ui.md +37 -3
- package/docs/design-notes/enhancement-contract.md +3 -1
- package/docs/navigation.json +17 -3
- package/docs/pages/components/accordion.md +8 -0
- package/docs/pages/components/alert.md +47 -17
- package/docs/pages/components/app-navigation.md +2 -2
- package/docs/pages/components/aura.md +2 -2
- package/docs/pages/components/badge.md +4 -3
- package/docs/pages/components/button.md +3 -0
- package/docs/pages/components/card.md +1 -1
- package/docs/pages/components/chat.md +2 -2
- package/docs/pages/components/dialog.md +36 -0
- package/docs/pages/components/drawer.md +52 -8
- package/docs/pages/components/fab.md +2 -1
- package/docs/pages/components/list.md +1 -1
- package/docs/pages/components/meter.md +1 -1
- package/docs/pages/components/navbar.md +27 -3
- package/docs/pages/components/overview.md +17 -0
- package/docs/pages/components/rating.md +111 -12
- package/docs/pages/components/segmented.md +36 -1
- package/docs/pages/components/shimmer.md +2 -2
- package/docs/pages/components/spinner.md +2 -0
- package/docs/pages/components/table.md +77 -0
- package/docs/pages/components/timeline.md +3 -1
- package/docs/pages/enhancements/flyout.md +83 -14
- package/docs/pages/enhancements/overview.md +2 -2
- package/docs/pages/enhancements/status-bar.md +1 -1
- package/docs/pages/enhancements/tabs.md +5 -0
- package/docs/pages/examples/overview.md +5 -1
- package/docs/pages/forms/ajax.md +101 -0
- package/docs/pages/forms/choice-cards.md +1 -1
- package/docs/pages/forms/color-swatches.md +31 -2
- package/docs/pages/forms/detached-actions.md +1 -1
- package/docs/pages/forms/floating-field.md +5 -3
- package/docs/pages/forms/form-actions.md +1 -1
- package/docs/pages/forms/input-policy.md +1 -1
- package/docs/pages/forms/joined-controls.md +9 -4
- package/docs/pages/forms/otp.md +2 -2
- package/docs/pages/forms/overview.md +1 -1
- package/docs/pages/forms/password.md +1 -1
- package/docs/pages/forms/states-and-sizes.md +1 -1
- package/docs/pages/forms/sticky-actions.md +1 -1
- package/docs/pages/forms/unsaved-changes.md +198 -0
- package/docs/pages/foundations/philosophy.md +2 -1
- package/docs/pages/foundations/theming.md +4 -3
- package/docs/pages/foundations/tokens.md +30 -5
- package/docs/pages/foundations/typography.md +1 -1
- package/docs/pages/guides/introduction.md +1 -1
- package/docs/pages/guides/progressive-enhancement.md +31 -50
- package/docs/pages/guides/upgrading.md +15 -2
- package/docs/pages/layout/app-layout.md +1 -1
- package/docs/pages/layout/app-shell.md +1 -1
- package/docs/pages/layout/choosing.md +5 -0
- package/docs/pages/layout/column-layout.md +23 -9
- package/docs/pages/layout/media.md +1 -1
- package/docs/pages/layout/overview.md +1 -1
- package/docs/pages/layout/scroll-snap.md +1 -1
- package/docs/pages/layout/scroll-target.md +1 -1
- package/docs/pages/layout/sidebar-layout.md +1 -1
- package/docs/pages/layout/sidebar-shell.md +68 -0
- package/docs/pages/patterns/code-block.md +1 -1
- package/docs/pages/patterns/empty-state.md +74 -0
- package/docs/pages/patterns/exclusive-accordion.md +1 -1
- package/docs/pages/patterns/hierarchical-nav.md +41 -20
- package/docs/pages/patterns/icon-input.md +1 -1
- package/docs/pages/patterns/intent-nesting.md +1 -1
- package/docs/pages/patterns/navigation-list.md +5 -62
- package/docs/pages/patterns/overview.md +1 -1
- package/docs/pages/patterns/stat.md +61 -0
- package/docs/pages/patterns/structured-lists.md +1 -1
- package/docs/pages/utilities/accessibility.md +32 -10
- package/docs/pages/utilities/flex.md +1 -1
- package/docs/pages/utilities/links.md +1 -1
- package/docs/pages/utilities/list.md +1 -1
- package/docs/pages/utilities/shape.md +1 -1
- package/docs/pages/utilities/sizing-wrapping.md +1 -1
- package/docs/pages/utilities/spacing.md +1 -1
- package/docs/pages/utilities/text.md +1 -1
- package/package.json +4 -1
- package/reserved-classes.json +2 -0
- package/src/cli/actual-css.js +4 -4
- package/src/css/components/accordion.css +10 -6
- package/src/css/components/alert.css +4 -0
- package/src/css/components/busy.css +25 -0
- package/src/css/components/button.css +3 -0
- package/src/css/components/drawer.css +37 -3
- package/src/css/components/flyout.css +37 -0
- package/src/css/components/join.css +14 -0
- package/src/css/components/modal.css +3 -0
- package/src/css/components/navbar.css +102 -38
- package/src/css/components/rating.css +50 -5
- package/src/css/components/segmented.css +25 -2
- package/src/css/core/theme.css +20 -1
- package/src/css/core/tokens.css +4 -1
- package/src/css/forms/color-swatch.css +38 -19
- package/src/css/forms/custom-select.css +10 -0
- package/src/css/forms/input-icon.css +5 -3
- package/src/css/layout/index.css +2 -0
- package/src/css/layout/sidebar-shell.css +67 -0
- package/src/css/typography/prose.css +6 -0
- package/src/js/ajax.js +148 -0
- package/src/js/dialog.js +59 -2
- package/src/js/dirty.js +140 -0
- package/src/js/dismiss.js +25 -0
- package/src/js/events.js +17 -0
- package/src/js/focus.js +12 -0
- package/src/js/form-submission.js +34 -0
- package/src/js/full.js +2 -0
- package/src/js/tab.js +16 -2
- package/src/js/validation.js +12 -4
- package/src/tooling/design-tokens.js +1 -0
- package/src/tooling/theme-contrast.js +44 -4
- package/tokens.json +1 -0
|
@@ -4,9 +4,10 @@ Actual CSS provides application chrome and content composition without owning
|
|
|
4
4
|
the application lifecycle.
|
|
5
5
|
|
|
6
6
|
```text
|
|
7
|
-
app-shell
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
app-shell full-height single-column document flow
|
|
8
|
+
sidebar-shell persistent side region + main, each scrolling, on a wide viewport
|
|
9
|
+
topbar persistent top application chrome
|
|
10
|
+
app-layout specialized topbar + internal scroll + adaptive navigation recipe
|
|
10
11
|
app-nav primary application destinations
|
|
11
12
|
list repeated application rows with leading/content/trailing regions
|
|
12
13
|
status-bar passive transient feedback
|
|
@@ -22,6 +23,39 @@ application. Actual does not prescribe Material breakpoints or device classes;
|
|
|
22
23
|
the application layout changes when its available viewport can accommodate
|
|
23
24
|
labelled side navigation.
|
|
24
25
|
|
|
26
|
+
## Sidebar shell
|
|
27
|
+
|
|
28
|
+
An admin or dashboard keeps a sidebar beside its content on a wide screen and
|
|
29
|
+
hands it to a drawer on a phone. None of the existing shapes is that:
|
|
30
|
+
`.app-shell` is one column, `.sidebar-layout` a wrapping pair inside a page,
|
|
31
|
+
and `.app-layout` moves navigation to a bottom bar.
|
|
32
|
+
|
|
33
|
+
Contract:
|
|
34
|
+
|
|
35
|
+
- Two direct children: an `aside` (the side region, any content) and one
|
|
36
|
+
other element (the main region). The drawer is a separate `dialog.drawer`
|
|
37
|
+
outside the shell; the two are never one element transformed.
|
|
38
|
+
- At `64rem` and up, a viewport-height grid, side then main. Each region
|
|
39
|
+
scrolls on its own, so the sidebar never scrolls away with the content.
|
|
40
|
+
- Below `64rem`, the side region is hidden and the document scrolls. A phone
|
|
41
|
+
keeps its native behaviors: the collapsing URL bar, tap-to-top, and a
|
|
42
|
+
virtual keyboard that resizes the document rather than a fixed box.
|
|
43
|
+
- The breakpoint is a literal: a custom property cannot sit in a media
|
|
44
|
+
condition. A project that needs another one copies the two rules.
|
|
45
|
+
- Hidden with `(width < 64rem)`, not shown above it: the side region keeps
|
|
46
|
+
the author's own `display` (an `aside.stack`). Where range syntax is
|
|
47
|
+
unsupported the rule drops and the sidebar stacks above the content, still
|
|
48
|
+
reachable.
|
|
49
|
+
- CSS only. Closing an open drawer when the viewport widens belongs to the
|
|
50
|
+
page (`matchMedia` change → `dialog.close()`), a documented recipe rather
|
|
51
|
+
than a watcher in the primitive.
|
|
52
|
+
- Print is one flow, side then main, nothing clipped. The narrow rule is
|
|
53
|
+
`screen` only: print never hides framework content, so leaving the sidebar
|
|
54
|
+
off paper is the application's print stylesheet.
|
|
55
|
+
|
|
56
|
+
Rejected: a bottom navigation (that is `.app-layout`), a collapsible icon rail
|
|
57
|
+
(an application state), and a breakpoint hook (impossible in a media query).
|
|
58
|
+
|
|
25
59
|
Compact UI vocabulary remains semantic rather than shape-driven:
|
|
26
60
|
|
|
27
61
|
- use `.btn.sm` for compact actions and `aria-pressed` filters;
|
|
@@ -178,5 +178,7 @@ of the contract itself.
|
|
|
178
178
|
| `range` | Fill share and named-value synchronization | `.range` |
|
|
179
179
|
| `scrollspy` | Scroll-driven nav highlighting | `.scrollspy` |
|
|
180
180
|
| `validation` | Form validation, focus management, server errors | `.needs-validation` |
|
|
181
|
+
| `dirty` | Unsaved-changes state on a form | — |
|
|
182
|
+
| `ajax` | Form submission through `fetch` | — |
|
|
181
183
|
|
|
182
|
-
|
|
184
|
+
Seven tokens. Everything else stays self-describing.
|
package/docs/navigation.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"destinations": [
|
|
3
|
+
{ "title": "Get started", "icon": "rocket", "groups": ["guides", "foundations", "examples"] },
|
|
4
|
+
{ "title": "Layout", "icon": "layout-grid", "groups": ["layout"] },
|
|
5
|
+
{ "title": "Components", "icon": "components", "groups": ["components", "patterns"] },
|
|
6
|
+
{ "title": "Forms", "icon": "forms", "groups": ["forms"] },
|
|
7
|
+
{ "title": "Utilities", "icon": "tool", "groups": ["utilities"] },
|
|
8
|
+
{ "title": "Enhancements", "icon": "bolt", "groups": ["enhancements"] }
|
|
9
|
+
],
|
|
2
10
|
"groups": [
|
|
3
11
|
{
|
|
4
12
|
"title": "Guides",
|
|
@@ -38,6 +46,7 @@
|
|
|
38
46
|
"scroll-target",
|
|
39
47
|
"frame",
|
|
40
48
|
"app-shell",
|
|
49
|
+
"sidebar-shell",
|
|
41
50
|
"app-layout"
|
|
42
51
|
]
|
|
43
52
|
},
|
|
@@ -45,6 +54,7 @@
|
|
|
45
54
|
"title": "Components",
|
|
46
55
|
"slug": "components",
|
|
47
56
|
"pages": [
|
|
57
|
+
"overview",
|
|
48
58
|
"accordion",
|
|
49
59
|
"alert",
|
|
50
60
|
"app-navigation",
|
|
@@ -57,10 +67,10 @@
|
|
|
57
67
|
"card",
|
|
58
68
|
"chat",
|
|
59
69
|
"close",
|
|
60
|
-
"dialog",
|
|
61
|
-
"drawer",
|
|
62
70
|
"data-list",
|
|
63
71
|
"diagrams",
|
|
72
|
+
"dialog",
|
|
73
|
+
"drawer",
|
|
64
74
|
"fab",
|
|
65
75
|
"indicator",
|
|
66
76
|
"key",
|
|
@@ -102,6 +112,8 @@
|
|
|
102
112
|
"password",
|
|
103
113
|
"input-policy",
|
|
104
114
|
"validation",
|
|
115
|
+
"unsaved-changes",
|
|
116
|
+
"ajax",
|
|
105
117
|
"detached-actions",
|
|
106
118
|
"sticky-actions"
|
|
107
119
|
]
|
|
@@ -118,7 +130,9 @@
|
|
|
118
130
|
"hierarchical-nav",
|
|
119
131
|
"code-block",
|
|
120
132
|
"exclusive-accordion",
|
|
121
|
-
"intent-nesting"
|
|
133
|
+
"intent-nesting",
|
|
134
|
+
"empty-state",
|
|
135
|
+
"stat"
|
|
122
136
|
]
|
|
123
137
|
},
|
|
124
138
|
{
|
|
@@ -52,6 +52,14 @@ The default builds one raised shell around the whole group. `.flush` and `.separ
|
|
|
52
52
|
<summary>Edge to edge</summary>
|
|
53
53
|
<p>The summary and panel follow the surrounding surface's own gutter.</p>
|
|
54
54
|
</details>
|
|
55
|
+
|
|
56
|
+
<details>
|
|
57
|
+
<summary>With a list</summary>
|
|
58
|
+
<ul>
|
|
59
|
+
<li>A direct list keeps its marker gutter</li>
|
|
60
|
+
<li>Even with the inline padding removed</li>
|
|
61
|
+
</ul>
|
|
62
|
+
</details>
|
|
55
63
|
</div>
|
|
56
64
|
```
|
|
57
65
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> Inline status messages for confirmations, warnings, and errors, with intents, icons, and action lists.
|
|
4
4
|
|
|
5
|
+
**Related terms:** banner, callout, notice, inline notification, install prompt, trailing action.
|
|
6
|
+
|
|
5
7
|
- Supports intent colors.
|
|
6
8
|
- Supports longer text and lists.
|
|
7
9
|
- Links inherit alert color by default.
|
|
@@ -35,6 +37,23 @@ itself needs to change, not `.soft`.
|
|
|
35
37
|
| Shared variants | Variant | `.solid`, `.outline`, `.surface`. |
|
|
36
38
|
| Density contexts | Density | Descendant rhythm; inline padding stays stable. |
|
|
37
39
|
|
|
40
|
+
## Anatomy
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
.alert
|
|
44
|
+
├── .alert-icon (optional)
|
|
45
|
+
├── content any HTML, one or more blocks
|
|
46
|
+
└── .close (optional)
|
|
47
|
+
|
|
48
|
+
.alert.admonition
|
|
49
|
+
├── .alert-title
|
|
50
|
+
│ ├── icon (optional)
|
|
51
|
+
│ ├── title text
|
|
52
|
+
│ └── .close (optional)
|
|
53
|
+
└── .alert-body
|
|
54
|
+
└── content any HTML
|
|
55
|
+
```
|
|
56
|
+
|
|
38
57
|
## Basic usage
|
|
39
58
|
|
|
40
59
|
`.surface` comes first on purpose: it keeps the theme's own chrome and puts the
|
|
@@ -64,16 +83,12 @@ intent treatment when the color itself carries the meaning.
|
|
|
64
83
|
</div>
|
|
65
84
|
|
|
66
85
|
<div class="alert danger" role="alert">
|
|
67
|
-
<strong>
|
|
68
|
-
<div>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div class="alert danger" role="alert">
|
|
72
|
-
I'm a simple error
|
|
86
|
+
<strong>Couldn't save the draft.</strong>
|
|
87
|
+
<div>The connection dropped. Your changes are kept on this device.</div>
|
|
73
88
|
</div>
|
|
74
89
|
|
|
75
90
|
<div class="alert danger" role="alert">
|
|
76
|
-
|
|
91
|
+
Your session expired. <a href="#">Sign in again</a>.
|
|
77
92
|
</div>
|
|
78
93
|
</div>
|
|
79
94
|
```
|
|
@@ -103,19 +118,34 @@ intent treatment when the color itself carries the meaning.
|
|
|
103
118
|
The grid pins `.alert-icon` and `.close` to the outer columns. A
|
|
104
119
|
trailing link or button is content, not anatomy, so it lives in the text column:
|
|
105
120
|
wrap the row in a `.cluster` and push the two ends apart. Same recipe as any
|
|
106
|
-
split / spread row — there is no `.alert-action` class.
|
|
121
|
+
split / spread row — there is no `.alert-action` class. The action sits before
|
|
122
|
+
`.close` on a wide alert and wraps under the message on a narrow one.
|
|
107
123
|
|
|
108
124
|
The alert aligns its columns to the block start, so a multi-line message keeps
|
|
109
|
-
its icon on the first line. A trailing control makes that
|
|
110
|
-
|
|
111
|
-
center.
|
|
125
|
+
its icon and `.close` on the first line. A trailing control makes that line
|
|
126
|
+
taller than its text and pushes the text down. On a one-line message, add
|
|
127
|
+
`.items-center` to put the icon, the text and the button on one center. When
|
|
128
|
+
the message can wrap, add `.items-baseline` instead: it keeps the icon and
|
|
129
|
+
`.close` on the first line of text, where `.items-center` would center them on
|
|
130
|
+
the whole block.
|
|
112
131
|
|
|
113
132
|
```html demo
|
|
114
|
-
<div class="
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
133
|
+
<div class="stack">
|
|
134
|
+
<div class="alert surface items-center">
|
|
135
|
+
<i class="ti ti-info-circle alert-icon" aria-hidden="true"></i>
|
|
136
|
+
<div class="cluster justify-content-space-between">
|
|
137
|
+
<strong>New message!</strong>
|
|
138
|
+
<a class="btn sm outline" href="#">Open</a>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div class="alert primary items-baseline" id="install-alert">
|
|
143
|
+
<i class="ti ti-download alert-icon" aria-hidden="true"></i>
|
|
144
|
+
<div class="cluster justify-content-space-between">
|
|
145
|
+
<p><strong>Recommended</strong> · Install the desktop app for notifications and offline access.</p>
|
|
146
|
+
<a class="btn sm" href="#">Install app</a>
|
|
147
|
+
</div>
|
|
148
|
+
<button class="close" type="button" commandfor="install-alert" command="--dismiss" aria-label="Dismiss"></button>
|
|
119
149
|
</div>
|
|
120
150
|
</div>
|
|
121
151
|
```
|
|
@@ -140,7 +170,7 @@ center.
|
|
|
140
170
|
|
|
141
171
|
## Dismiss
|
|
142
172
|
|
|
143
|
-
Add a `.close` button to let a user remove an inline alert. Inside an alert it is compact and at reduced opacity, and it follows the alert's ink with any intent.
|
|
173
|
+
Add a `.close` button to let a user remove an inline alert. Inside an alert it is compact and at reduced opacity, and it follows the alert's ink with any intent. Give the alert an `id` and point the button at it with `commandfor` and `command="--dismiss"`: the runtime hides the alert (`hidden`) and moves focus to the next control — no custom script. See [Dismiss command](../guides/progressive-enhancement.md#dismiss-command).
|
|
144
174
|
|
|
145
175
|
```html demo
|
|
146
176
|
<div class="alert warning" id="warning-alert">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# App
|
|
1
|
+
# App navigation
|
|
2
2
|
|
|
3
3
|
> Primary application destinations in a persistent bottom bar or labelled side navigation.
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ permits. The component contains no JavaScript and does not manage routing.
|
|
|
36
36
|
The icon slot accepts SVGs, images, and decorative elements such as icon-font
|
|
37
37
|
`i` elements marked with `aria-hidden="true"`.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
## Hooks
|
|
40
40
|
|
|
41
41
|
- `--app-nav-size` controls the minimum bottom-bar size.
|
|
42
42
|
- `--app-nav-gap` controls spacing between destinations.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Aura
|
|
2
2
|
|
|
3
|
-
> **Module** — import `actual-css/css/effects/aura` or `actual-css/css/effects`.
|
|
4
|
-
|
|
5
3
|
Aura adds a decorative intent-colored border and halo around one direct child.
|
|
6
4
|
It is visual emphasis only and does not change the child's semantics.
|
|
7
5
|
|
|
6
|
+
> **Module** — import `actual-css/css/effects/aura` or `actual-css/css/effects`.
|
|
7
|
+
|
|
8
8
|
```html demo
|
|
9
9
|
<div class="cluster" style="gap: 2.5rem">
|
|
10
10
|
<span class="aura primary">
|
|
@@ -171,15 +171,16 @@ keeps its height and `.sm` / `.lg` scale both together. Wrap the chips in a
|
|
|
171
171
|
@rin-moreau
|
|
172
172
|
</a>
|
|
173
173
|
<span class="badge primary">
|
|
174
|
-
<span class="avatar"><abbr>
|
|
174
|
+
<span class="avatar"><abbr title="Ada Morgan">A</abbr></span>
|
|
175
175
|
Ada Morgan
|
|
176
176
|
<button class="close" type="button" aria-label="Remove Ada Morgan"></button>
|
|
177
177
|
</span>
|
|
178
178
|
</div>
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
Keep `alt=""` when the handle or name sits next to the image.
|
|
182
|
-
|
|
181
|
+
Keep `alt=""` when the handle or name sits next to the image. On the default
|
|
182
|
+
and `.sm` badges, prefer a photo or a single initial; two-letter initials need
|
|
183
|
+
`.lg` to stay legible.
|
|
183
184
|
|
|
184
185
|
## Loading status
|
|
185
186
|
|
|
@@ -149,6 +149,9 @@ and collapses the shared edges.
|
|
|
149
149
|
</div>
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
+
Name a button group with `role="group"` and a label; an input with one
|
|
153
|
+
attached button takes neither (see [joined controls](../forms/joined-controls.md)).
|
|
154
|
+
|
|
152
155
|
Use the same variant across a group. Change a button's variant to mark a
|
|
153
156
|
meaningful state, such as a solid pressed [toggle](#toggle) among outlines.
|
|
154
157
|
For one choice among a few on a shared track, use a
|
|
@@ -46,7 +46,7 @@ to let that primitive control its layout and gap.
|
|
|
46
46
|
<p>Using the right HTML tags improves both SEO and accessibility. Lean on landmarks and live lists.</p>
|
|
47
47
|
|
|
48
48
|
<ul class="cluster tight" aria-label="Tags">
|
|
49
|
-
<li><span class="badge
|
|
49
|
+
<li><span class="badge soft secondary">HTML</span></li>
|
|
50
50
|
<li><span class="badge soft primary">Accessibility</span></li>
|
|
51
51
|
<li><span class="badge outline">5 min read</span></li>
|
|
52
52
|
</ul>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Chat
|
|
2
2
|
|
|
3
|
-
> **Module** — import `actual-css/css/components/chat` or `actual-css/css/components`.
|
|
4
|
-
|
|
5
3
|
Chat lays out message metadata, an optional avatar, and a content-sized bubble
|
|
6
4
|
at either edge of a conversation.
|
|
7
5
|
|
|
6
|
+
> **Module** — import `actual-css/css/components/chat` or `actual-css/css/components`.
|
|
7
|
+
|
|
8
8
|
```html demo
|
|
9
9
|
<div class="stack" aria-label="Conversation">
|
|
10
10
|
<div class="chat chat-start">
|
|
@@ -519,6 +519,8 @@ Available options:
|
|
|
519
519
|
* `data-dialog-modal="false"` makes direct `openDialog()` calls use `show()`
|
|
520
520
|
instead of `showModal()`. The `show-modal` and `--show` commands override
|
|
521
521
|
this default.
|
|
522
|
+
* `data-dialog-open` opens the dialog once after parsing, using its
|
|
523
|
+
`data-dialog-modal` mode. See [Open on load](#open-on-load).
|
|
522
524
|
* `data-dialog-view-transition` enables a view transition that morphs the dialog to/from its trigger. Only active when the browser supports `document.startViewTransition` and the user allows motion.
|
|
523
525
|
* `closedby` keeps its native meaning: `"any"` closes on backdrop click and
|
|
524
526
|
Escape, `"closerequest"` closes on Escape only, `"none"` disables both. The
|
|
@@ -527,6 +529,40 @@ Available options:
|
|
|
527
529
|
`closedby="none"`. Use `closedby="none"` for critical dialogs that must be
|
|
528
530
|
closed by an explicit action.
|
|
529
531
|
|
|
532
|
+
### Open on load
|
|
533
|
+
|
|
534
|
+
Add `data-dialog-open` to show a dialog without a trigger, for example a
|
|
535
|
+
confirmation rendered by the server after a form submission. Load
|
|
536
|
+
`actual-css/js/dialog` or the full runtime; no application script is needed.
|
|
537
|
+
|
|
538
|
+
```html
|
|
539
|
+
<dialog class="modal" id="confirmation" open data-dialog-open>
|
|
540
|
+
<form method="dialog" class="stack">
|
|
541
|
+
<h2>Check your inbox</h2>
|
|
542
|
+
<p>We sent you a link to confirm your email address.</p>
|
|
543
|
+
<footer class="cluster justify-content-end">
|
|
544
|
+
<button class="btn primary" value="done">Got it</button>
|
|
545
|
+
</footer>
|
|
546
|
+
</form>
|
|
547
|
+
</dialog>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
The native `open` attribute keeps the confirmation visible, non-modally,
|
|
551
|
+
without JavaScript. The runtime upgrades it to a modal after parsing. Omit
|
|
552
|
+
`open` to keep it hidden without JavaScript, or add `data-dialog-modal="false"`
|
|
553
|
+
to keep the automatic opening non-modal. `data-dialog-open="false"` disables
|
|
554
|
+
automatic opening; it does not hide a dialog that already has `open`.
|
|
555
|
+
|
|
556
|
+
Automatic opening runs once per element: moving or reinserting a dismissed
|
|
557
|
+
dialog does not reopen it, while a fresh node inserted by an Ajax response
|
|
558
|
+
opens on connection. A dialog already opened modally by a command stays open.
|
|
559
|
+
Automatic opening skips the trigger view transition and leaves focus
|
|
560
|
+
restoration on close to the browser.
|
|
561
|
+
|
|
562
|
+
The [Settings modal demo](../../demo/templates/settings-modal.html) uses
|
|
563
|
+
`open data-dialog-open` to show its preferences on load. Close the dialog to
|
|
564
|
+
reach its Open settings button and reopen it with a command.
|
|
565
|
+
|
|
530
566
|
## Browser support
|
|
531
567
|
|
|
532
568
|
Actual relies on the native `<dialog>` API in its supported JavaScript range
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Drawer
|
|
2
2
|
|
|
3
|
-
> Modal side
|
|
3
|
+
> Modal side or bottom sheet that overlays the page for navigation, filters or actions.
|
|
4
4
|
|
|
5
|
-
**Related terms:** off-canvas, side panel, side sheet, navigation drawer.
|
|
5
|
+
**Related terms:** off-canvas, side panel, side sheet, navigation drawer, bottom sheet, action sheet.
|
|
6
6
|
|
|
7
7
|
## Class reference
|
|
8
8
|
|
|
9
|
-
| Class | Kind | Description
|
|
10
|
-
| --------- | ----------- |
|
|
11
|
-
| `.drawer` | Component | Modal side
|
|
12
|
-
| `.close` | Composition | Icon-only close button, at the top end.
|
|
9
|
+
| Class | Kind | Description |
|
|
10
|
+
| --------- | ----------- | ---------------------------------------------------- |
|
|
11
|
+
| `.drawer` | Component | Modal side or bottom sheet on the native `<dialog>`. |
|
|
12
|
+
| `.close` | Composition | Icon-only close button, at the top end. |
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
only gates backdrop click: Escape and the close button always close.
|
|
21
21
|
- Use `closedby="none"` when the drawer must not be dismissed by the user at all
|
|
22
22
|
(e.g. a form with unsaved changes): no backdrop close and no Escape close.
|
|
23
|
-
- Use `[data-side="end"]` for a right-side drawer
|
|
23
|
+
- Use `[data-side="end"]` for a right-side drawer, `[data-side="bottom"]` for
|
|
24
|
+
a [bottom sheet](#bottom-sheet).
|
|
24
25
|
- Put the body between a `header` and a `footer`: the panel is a three-row grid
|
|
25
26
|
whose middle region scrolls, so the footer stays reachable however long the
|
|
26
27
|
content gets.
|
|
@@ -119,9 +120,52 @@ so the two never double-handle. Without `data-dialog-dismissible`, a native
|
|
|
119
120
|
light dismiss briefly flash instead of closing when the backdrop is clicked —
|
|
120
121
|
useful for drawers that should not be dismissed accidentally.
|
|
121
122
|
|
|
123
|
+
## Bottom sheet
|
|
124
|
+
|
|
125
|
+
`data-side="bottom"` puts the drawer on the bottom edge: full width, as tall as
|
|
126
|
+
its content up to `--drawer-size` or 85% of the viewport, with rounded top
|
|
127
|
+
corners. The header, scrolling body and footer work as on a side drawer, and
|
|
128
|
+
the bottom padding clears the iOS home indicator. Use it for filters, pickers
|
|
129
|
+
and contextual actions on a phone.
|
|
130
|
+
|
|
131
|
+
```html demo
|
|
132
|
+
<button class="btn"
|
|
133
|
+
type="button"
|
|
134
|
+
command="show-modal"
|
|
135
|
+
commandfor="sort-sheet"
|
|
136
|
+
aria-haspopup="dialog"
|
|
137
|
+
aria-controls="sort-sheet">
|
|
138
|
+
Sort
|
|
139
|
+
</button>
|
|
140
|
+
|
|
141
|
+
<dialog class="drawer" id="sort-sheet" data-side="bottom" aria-labelledby="sort-sheet-title" closedby="any">
|
|
142
|
+
<form method="dialog">
|
|
143
|
+
<header>
|
|
144
|
+
<strong id="sort-sheet-title">Sort by</strong>
|
|
145
|
+
<button class="close" type="submit" aria-label="Close"></button>
|
|
146
|
+
</header>
|
|
147
|
+
|
|
148
|
+
<fieldset class="field-group flush stack">
|
|
149
|
+
<legend class="sr-only">Sort by</legend>
|
|
150
|
+
<label class="choice"><input class="radio" type="radio" name="sort" value="relevance" checked><span>Relevance</span></label>
|
|
151
|
+
<label class="choice"><input class="radio" type="radio" name="sort" value="date"><span>Soonest date</span></label>
|
|
152
|
+
<label class="choice"><input class="radio" type="radio" name="sort" value="price"><span>Lowest price</span></label>
|
|
153
|
+
</fieldset>
|
|
154
|
+
|
|
155
|
+
<footer class="cluster justify-content-end">
|
|
156
|
+
<button class="btn primary" value="apply">Apply</button>
|
|
157
|
+
</footer>
|
|
158
|
+
</form>
|
|
159
|
+
</dialog>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
No drag handle and no swipe to close: those are gestures, not layout. When the
|
|
163
|
+
same task is a flyout on a desktop and a sheet on a phone, the page picks the
|
|
164
|
+
surface; see [Adaptive filter surface](../../demo/templates/adaptive-surface.html).
|
|
165
|
+
|
|
122
166
|
## CSS hooks
|
|
123
167
|
|
|
124
|
-
- `--drawer-size` — panel width.
|
|
168
|
+
- `--drawer-size` — panel width; the maximum height of a bottom sheet.
|
|
125
169
|
- `--drawer-pad` — panel padding.
|
|
126
170
|
- `--close-size` / `--close-icon-size` — size of the corner [`.close`](close.md)
|
|
127
171
|
and of its X. The header reserves the close size plus `--space-30` on its
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Floating action button
|
|
2
2
|
|
|
3
|
+
FAB fixes a primary action near the viewport's block-end and inline-end edges.
|
|
4
|
+
|
|
3
5
|
> **Module** — import `actual-css/css/components/fab` or `actual-css/css/components`.
|
|
4
6
|
|
|
5
|
-
FAB fixes a primary action near the viewport's block-end and inline-end edges.
|
|
6
7
|
The existing button component owns its size, shape, intent, and interaction.
|
|
7
8
|
As a direct child of `.app-layout`, it instead overlays the main grid area so
|
|
8
9
|
the layout keeps it clear of adaptive application navigation and safe areas.
|
|
@@ -99,7 +99,7 @@ shows a current row with trailing actions and a flyout. Navigable rows usually
|
|
|
99
99
|
want a non-zero `--list-item-pad-inline`: without that gutter, the current
|
|
100
100
|
indicator touches the leading region and the trailing touches the row edge.
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
## Hooks
|
|
103
103
|
|
|
104
104
|
- `--list-item-min-size` controls the row's minimum touch height.
|
|
105
105
|
- `--list-item-pad-block` and `--list-item-pad-inline` control row padding.
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
- Horizontal links live in a `.cluster`; its items are `.nav-link`.
|
|
8
8
|
- `.nav-list` is the shared vertical navigation list, reused by `.drawer` for stacked links.
|
|
9
9
|
- Mark the current page with `aria-current="page"` on the active `.nav-link`,
|
|
10
|
-
|
|
11
|
-
scrollspy sets)
|
|
10
|
+
the current section of the page with `aria-current="location"` (what
|
|
11
|
+
scrollspy sets), or a section link whose section holds the current page with
|
|
12
|
+
`aria-current="true"` (a top bar of site sections). Any other value is inert.
|
|
13
|
+
Mark one current item per navigation; a header and a sidebar are two
|
|
14
|
+
navigations, so each has its own — "Components" (`true`) in the header and
|
|
15
|
+
"Rating" (`page`) in the sidebar.
|
|
12
16
|
|
|
13
17
|
For a public or normally scrolling page, `.navbar` belongs inside the semantic
|
|
14
18
|
site header. Do not use `.topbar` or `.app-layout` unless the page actually has
|
|
@@ -23,7 +27,7 @@ normal document scrolling. `.app-nav` is not merely a stacked-icon flavour of it
|
|
|
23
27
|
reach for that component only when the destinations are part of a persistent
|
|
24
28
|
application shell — bottom navigation or labelled side navigation via
|
|
25
29
|
`.app-layout`. The choice follows the shell contract, not a preference for
|
|
26
|
-
icons. See [App
|
|
30
|
+
icons. See [App navigation](app-navigation.md).
|
|
27
31
|
|
|
28
32
|
## Class reference
|
|
29
33
|
|
|
@@ -53,6 +57,26 @@ full-row hit target for vertical navigation. The [Workspaces example](../example
|
|
|
53
57
|
shows the sectioned-sidebar composition: grouped `.nav-list` blocks with
|
|
54
58
|
section titles, a pinned account footer, and the native current state.
|
|
55
59
|
|
|
60
|
+
## Current link
|
|
61
|
+
|
|
62
|
+
The current link (active page, selected item, highlighted menu entry) takes
|
|
63
|
+
full text ink on a neutral fill, one step stronger than hover, in a bar and in
|
|
64
|
+
a `.nav-list` alike. Forced colors adds a shape: an underline on horizontal
|
|
65
|
+
links, an inline-start trait in `.nav-list`.
|
|
66
|
+
|
|
67
|
+
Restyle it with `--nav-current-bg` and `--nav-current-fg`, for example as a
|
|
68
|
+
solid selected pill:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
.app-sidebar {
|
|
72
|
+
--nav-current-bg: var(--state-selected);
|
|
73
|
+
--nav-current-fg: var(--state-selected-fg);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Keep the pair's contrast: a brand-colored ink on a tinted fill falls under
|
|
78
|
+
4.5:1 on several light themes.
|
|
79
|
+
|
|
56
80
|
## Responsive: navbar + drawer
|
|
57
81
|
|
|
58
82
|
There is no collapse/toggler mechanism. For a responsive navigation, keep the
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Components
|
|
2
|
+
|
|
3
|
+
> Every component and pattern on one page, to find the one that fits before opening its reference.
|
|
4
|
+
|
|
5
|
+
Components carry a visual identity, states and interaction styling. Patterns
|
|
6
|
+
normalize a recurring semantic shape, such as a navigation list or an icon
|
|
7
|
+
slot, so it composes with the components and the layout primitives.
|
|
8
|
+
|
|
9
|
+
## Components
|
|
10
|
+
|
|
11
|
+
<!--docs-index:components-->
|
|
12
|
+
|
|
13
|
+
## Patterns
|
|
14
|
+
|
|
15
|
+
How patterns relate to layout and components: [Patterns overview](../patterns/overview.md).
|
|
16
|
+
|
|
17
|
+
<!--docs-index:patterns-->
|