actual-css 0.2.0 → 0.3.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 +38 -1
- package/README.md +24 -9
- package/dist/actual-themes.min.css +1 -0
- package/dist/actual.css +1244 -915
- package/dist/actual.js +1 -3
- package/dist/actual.min.css +1 -1
- package/dist/optional.css +1048 -0
- package/dist/optional.min.css +1 -0
- package/docs/design-notes/browser-support.md +94 -14
- package/docs/design-notes/cascade-layer.md +1 -1
- package/docs/design-notes/enhancement-contract.md +11 -14
- package/docs/design-notes/forced-colors.md +105 -0
- package/docs/design-notes/naming.md +2 -1
- package/docs/design-notes/platform-alignment.md +492 -0
- package/docs/design-notes/references.md +8 -0
- package/docs/design-notes/widget-primitives.md +37 -1
- package/docs/navigation.json +135 -0
- package/docs/pages/components/accordion.md +80 -0
- package/docs/pages/components/alert.md +203 -0
- package/docs/pages/components/aura.md +35 -0
- package/docs/pages/components/avatar.md +95 -0
- package/docs/pages/components/badge.md +102 -0
- package/docs/pages/components/breadcrumb.md +19 -0
- package/docs/pages/components/button.md +205 -0
- package/docs/pages/components/card.md +183 -0
- package/docs/pages/components/chat.md +50 -0
- package/docs/pages/components/dialog.md +367 -0
- package/docs/pages/components/drawer.md +113 -0
- package/docs/pages/components/fab.md +118 -0
- package/docs/pages/components/key.md +33 -0
- package/docs/pages/components/meter.md +23 -0
- package/docs/pages/components/navbar.md +92 -0
- package/docs/pages/components/pagination.md +55 -0
- package/docs/pages/components/progress.md +29 -0
- package/docs/pages/components/skeleton.md +38 -0
- package/docs/pages/components/spinner.md +93 -0
- package/docs/pages/components/table.md +102 -0
- package/docs/pages/enhancements/flyout.md +391 -0
- package/docs/pages/enhancements/overview.md +36 -0
- package/docs/pages/enhancements/scrollspy.md +71 -0
- package/docs/pages/enhancements/status-bar.md +72 -0
- package/docs/pages/enhancements/tabs.md +80 -0
- package/docs/pages/enhancements/tooltip.md +130 -0
- package/docs/pages/examples/overview.md +41 -0
- package/docs/pages/forms/choice-cards.md +102 -0
- package/docs/pages/forms/controls.md +32 -0
- package/docs/pages/forms/detached-actions.md +59 -0
- package/docs/pages/forms/floating-field.md +88 -0
- package/docs/pages/forms/form-actions.md +56 -0
- package/docs/pages/forms/input-policy.md +91 -0
- package/docs/pages/forms/joined-controls.md +37 -0
- package/docs/pages/forms/labels.md +42 -0
- package/docs/pages/forms/otp.md +50 -0
- package/docs/pages/forms/overview.md +188 -0
- package/docs/pages/forms/password.md +40 -0
- package/docs/pages/forms/range.md +17 -0
- package/docs/pages/forms/states-and-sizes.md +321 -0
- package/docs/pages/forms/sticky-actions.md +187 -0
- package/docs/pages/forms/switch.md +31 -0
- package/docs/pages/forms/validation.md +241 -0
- package/docs/{mental-model.md → pages/foundations/philosophy.md} +33 -18
- package/docs/pages/foundations/theming.md +92 -0
- package/docs/pages/foundations/tokens.md +421 -0
- package/docs/{typography.md → pages/foundations/typography.md} +27 -9
- package/docs/pages/guides/bootstrap.md +438 -0
- package/docs/pages/guides/introduction.md +157 -0
- package/docs/pages/guides/optional-components.md +33 -0
- package/docs/pages/guides/progressive-enhancement.md +686 -0
- package/docs/pages/guides/tailwind.md +455 -0
- package/docs/pages/layout/app-shell.md +25 -0
- package/docs/pages/layout/center.md +29 -0
- package/docs/pages/layout/cluster.md +57 -0
- package/docs/pages/layout/frame.md +30 -0
- package/docs/pages/layout/grid.md +142 -0
- package/docs/pages/layout/list.md +41 -0
- package/docs/pages/layout/media.md +21 -0
- package/docs/pages/layout/overview.md +37 -0
- package/docs/pages/layout/scroll-snap.md +54 -0
- package/docs/pages/layout/sidebar-layout.md +27 -0
- package/docs/pages/layout/stack.md +18 -0
- package/docs/pages/layout/switcher.md +36 -0
- package/docs/pages/layout/topbar.md +23 -0
- package/docs/pages/patterns/actions.md +52 -0
- package/docs/pages/patterns/code-block.md +36 -0
- package/docs/pages/patterns/exclusive-accordion.md +16 -0
- package/docs/pages/patterns/hierarchical-nav.md +26 -0
- package/docs/pages/patterns/icon-input.md +25 -0
- package/docs/pages/patterns/intent-nesting.md +3 -0
- package/docs/pages/patterns/navigation-list.md +235 -0
- package/docs/pages/patterns/overview.md +58 -0
- package/docs/pages/patterns/structured-lists.md +47 -0
- package/docs/pages/utilities/accessibility.md +34 -0
- package/docs/pages/utilities/flex.md +105 -0
- package/docs/pages/utilities/links.md +18 -0
- package/docs/pages/utilities/list.md +31 -0
- package/docs/pages/utilities/overflow.md +43 -0
- package/docs/pages/utilities/overview.md +18 -0
- package/docs/pages/utilities/shape.md +25 -0
- package/docs/pages/utilities/sizing-wrapping.md +115 -0
- package/docs/pages/utilities/spacing.md +79 -0
- package/docs/pages/utilities/text.md +43 -0
- package/llms.txt +4 -4
- package/package.json +20 -12
- package/src/css/actual.css +12 -1
- package/src/css/base.css +3 -5
- package/src/css/components/accordion.css +18 -30
- package/src/css/components/actions.css +4 -1
- package/src/css/components/alert.css +126 -99
- package/src/css/components/avatar.css +16 -10
- package/src/css/components/badge.css +55 -35
- package/src/css/components/breadcrumb.css +7 -15
- package/src/css/components/busy.css +6 -0
- package/src/css/components/button.css +78 -32
- package/src/css/components/card.css +17 -37
- package/src/css/components/drawer.css +30 -13
- package/src/css/components/flyout.css +39 -109
- package/src/css/components/index.css +1 -0
- package/src/css/components/join.css +14 -2
- package/src/css/components/key.css +2 -0
- package/src/css/components/menu.css +125 -0
- package/src/css/components/meter.css +0 -23
- package/src/css/components/modal.css +162 -7
- package/src/css/components/navbar.css +17 -18
- package/src/css/components/overline.css +0 -7
- package/src/css/components/pagination.css +1 -1
- package/src/css/components/progress.css +8 -26
- package/src/css/components/skeleton.css +7 -0
- package/src/css/components/spinner.css +6 -7
- package/src/css/components/status-bar.css +15 -24
- package/src/css/components/surface.css +2 -8
- package/src/css/components/tab.css +19 -48
- package/src/css/components/table.css +7 -5
- package/src/css/components/tooltip.css +14 -7
- package/src/css/focus.css +14 -38
- package/src/css/forms/choice-card.css +13 -14
- package/src/css/forms/choice.css +21 -27
- package/src/css/forms/control.css +16 -17
- package/src/css/forms/custom-select.css +9 -11
- package/src/css/forms/form-actions.css +14 -3
- package/src/css/forms/form.css +7 -4
- package/src/css/forms/index.css +4 -4
- package/src/css/forms/input-icon.css +30 -12
- package/src/css/forms/native.css +50 -11
- package/src/css/forms/range.css +17 -9
- package/src/css/forms/select.css +8 -8
- package/src/css/forms/switch.css +14 -12
- package/src/css/forms/validation.css +32 -5
- package/src/css/grid.css +19 -18
- package/src/css/intents.css +2 -2
- package/src/css/layout.css +29 -1
- package/src/css/optional/aura.css +93 -0
- package/src/css/optional/chat.css +105 -0
- package/src/css/optional/fab.css +104 -0
- package/src/css/optional/floating-field.css +87 -0
- package/src/css/optional/index.css +5 -0
- package/src/css/optional/layout-extra.css +7 -4
- package/src/css/optional/otp.css +115 -0
- package/src/css/optional/scroll-snap.css +6 -0
- package/src/css/optional/scroller.css +13 -7
- package/src/css/optional/typography-fluid.css +5 -0
- package/src/css/optional/utilities-extra.css +17 -2
- package/src/css/prose.css +18 -8
- package/src/css/reset.css +0 -10
- package/src/css/theme.css +21 -5
- package/src/css/themes/cyberpunk.css +1 -1
- package/src/css/themes/dim.css +3 -3
- package/src/css/themes/edge.css +8 -10
- package/src/css/themes/index.css +3 -3
- package/src/css/themes/{dark.css → indigo.css} +5 -4
- package/src/css/themes/neon.css +5 -5
- package/src/css/themes/square.css +0 -3
- package/src/css/tokens.css +74 -20
- package/src/css/utilities.css +8 -10
- package/src/css/variants.css +37 -65
- package/src/js/command.js +1 -3
- package/src/js/context-menu.js +67 -35
- package/src/js/dialog.js +68 -79
- package/src/js/dismiss.js +15 -0
- package/src/js/enhance.js +54 -23
- package/src/js/enhancement-loader.js +301 -0
- package/src/js/events.js +3 -0
- package/src/js/filter.js +3 -3
- package/src/js/floating.js +101 -131
- package/src/js/flyout.js +104 -87
- package/src/js/focus-group.js +116 -0
- package/src/js/focus.js +6 -1
- package/src/js/index.js +4 -2
- package/src/js/input.js +1 -1
- package/src/js/keys.js +27 -0
- package/src/js/mask.js +7 -6
- package/src/js/menu.js +87 -34
- package/src/js/parse-config.js +47 -0
- package/src/js/password.js +9 -1
- package/src/js/scrollspy.js +12 -4
- package/src/js/selectors.js +0 -7
- package/src/js/status.js +3 -1
- package/src/js/surface.js +185 -136
- package/src/js/tab.js +36 -53
- package/src/js/tooltip.js +53 -31
- package/src/js/validation.js +34 -8
- package/dist/actual.js.map +0 -31
- package/docs/README.md +0 -28
- package/docs/components.md +0 -860
- package/docs/design-notes/previous-work.md +0 -5
- package/docs/forms.md +0 -1265
- package/docs/javascript.md +0 -496
- package/docs/layout.md +0 -480
- package/docs/patterns.md +0 -504
- package/docs/reserved.md +0 -7
- package/docs/tokens.md +0 -455
- package/docs/ui.md +0 -929
- package/docs/utilities.md +0 -384
- package/src/css/dialog-fallback.css +0 -56
- package/src/js/dialog-fallback.js +0 -163
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Navbar
|
|
2
|
+
|
|
3
|
+
> Horizontal top-level navigation bar with a brand, an inline link list, and a vertical nav-list for drawers.
|
|
4
|
+
|
|
5
|
+
- Use `.navbar` for the horizontal bar shell.
|
|
6
|
+
- `.navbar-brand` is the brand link at the inline start.
|
|
7
|
+
- `.navbar-nav` is the horizontal link list; its items are `.nav-link`.
|
|
8
|
+
- `.nav-list` is the shared vertical navigation list, reused by `.drawer` for stacked links.
|
|
9
|
+
- Mark the current page with `aria-current="page"` on the active `.nav-link`.
|
|
10
|
+
|
|
11
|
+
`.navbar-nav` and `.nav-list` are mutually exclusive: `.navbar-nav` is a horizontal
|
|
12
|
+
flex list, `.nav-list` a vertical grid. Putting both on one element resolves to
|
|
13
|
+
`.nav-list` (vertical) — pick one per container.
|
|
14
|
+
|
|
15
|
+
## Class reference
|
|
16
|
+
|
|
17
|
+
| Class | Kind | Description |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `.navbar` | Component | Horizontal bar shell. |
|
|
20
|
+
| `.navbar-brand` | Composition | Brand link at the inline start. |
|
|
21
|
+
| `.navbar-nav` | Composition | Horizontal link list. |
|
|
22
|
+
| `.nav-link` | Component | A link item; current page via `aria-current="page"`. |
|
|
23
|
+
| `.nav-list` | Component | Shared vertical navigation list, reused by `.drawer`. |
|
|
24
|
+
|
|
25
|
+
## Basic usage
|
|
26
|
+
|
|
27
|
+
```html demo
|
|
28
|
+
<nav class="navbar" aria-label="Main">
|
|
29
|
+
<a class="navbar-brand" href="/">Actual CSS</a>
|
|
30
|
+
<ul class="navbar-nav">
|
|
31
|
+
<li><a class="nav-link" href="/docs" aria-current="page">Docs</a></li>
|
|
32
|
+
<li><a class="nav-link" href="/components">Components</a></li>
|
|
33
|
+
<li><a class="nav-link" href="/examples">Examples</a></li>
|
|
34
|
+
</ul>
|
|
35
|
+
</nav>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For a vertical sidebar nav, use `.nav-list` inside the drawer or sidebar.
|
|
39
|
+
|
|
40
|
+
## Responsive: navbar + drawer
|
|
41
|
+
|
|
42
|
+
There is no collapse/toggler mechanism. For a responsive navigation, keep the
|
|
43
|
+
horizontal `.navbar` for the desktop bar and compose the mobile experience from
|
|
44
|
+
a `.drawer` with a vertical `.nav-list`, opened by a `command="show-modal"` /
|
|
45
|
+
`commandfor` trigger.
|
|
46
|
+
|
|
47
|
+
```html demo
|
|
48
|
+
<nav class="navbar" aria-label="Main">
|
|
49
|
+
<a class="navbar-brand" href="/">Actual CSS</a>
|
|
50
|
+
<ul class="navbar-nav">
|
|
51
|
+
<li><a class="nav-link" href="/" aria-current="page">Home</a></li>
|
|
52
|
+
<li><a class="nav-link" href="/docs">Docs</a></li>
|
|
53
|
+
</ul>
|
|
54
|
+
</nav>
|
|
55
|
+
|
|
56
|
+
<button class="btn ghost"
|
|
57
|
+
type="button"
|
|
58
|
+
command="show-modal"
|
|
59
|
+
commandfor="site-nav"
|
|
60
|
+
aria-haspopup="dialog"
|
|
61
|
+
aria-controls="site-nav"
|
|
62
|
+
aria-label="Open menu">
|
|
63
|
+
<i class="ti ti-menu-2" aria-hidden="true"></i>
|
|
64
|
+
</button>
|
|
65
|
+
|
|
66
|
+
<dialog class="drawer"
|
|
67
|
+
id="site-nav"
|
|
68
|
+
aria-label="Main navigation"
|
|
69
|
+
closedby="any"
|
|
70
|
+
data-dialog-dismissible>
|
|
71
|
+
<header>
|
|
72
|
+
<strong>Menu</strong>
|
|
73
|
+
<form method="dialog">
|
|
74
|
+
<button class="drawer-close" type="submit" aria-label="Close navigation"></button>
|
|
75
|
+
</form>
|
|
76
|
+
</header>
|
|
77
|
+
|
|
78
|
+
<nav>
|
|
79
|
+
<ul class="nav-list stack">
|
|
80
|
+
<li><a href="#" aria-current="page">Home</a></li>
|
|
81
|
+
<li><a href="#">Docs</a></li>
|
|
82
|
+
<li><a href="#">Components</a></li>
|
|
83
|
+
</ul>
|
|
84
|
+
</nav>
|
|
85
|
+
</dialog>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The drawer can be hidden until opened: give the `dialog` the `hidden` attribute
|
|
89
|
+
in the HTML and let the command runtime manage it, or rely on the drawer being
|
|
90
|
+
rendered only on the mobile layout. `command` and `commandfor` work without
|
|
91
|
+
JavaScript, and the drawer follows the same `closedby` / `data-dialog-dismissible`
|
|
92
|
+
rules as the [Drawer component](drawer.md).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
> Navigation controls to move between pages of content.
|
|
4
|
+
|
|
5
|
+
- Use a semantic `<nav>` landmark.
|
|
6
|
+
- Put `.pagination` on the ordered list.
|
|
7
|
+
- Use `aria-current="page"` for the current page.
|
|
8
|
+
- Put `.sm` or `.lg` on `.pagination` to change the density of its controls.
|
|
9
|
+
- Numeric links may use `aria-label="Page N"` for clearer screen reader output.
|
|
10
|
+
- Prefer text labels for Previous and Next. Icon-only controls need an accessible name.
|
|
11
|
+
- Page links can compose with `.btn` for button-like hit targets.
|
|
12
|
+
- Truncated ranges are plain text with `.muted` and `aria-hidden="true"`, not `.btn` — they are decorative, not actionable.
|
|
13
|
+
|
|
14
|
+
## Class reference
|
|
15
|
+
|
|
16
|
+
| Class | Kind | Description |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `.pagination` | Component | Ordered list of page controls. |
|
|
19
|
+
| `.sm` / `.lg` | Size | Control density. |
|
|
20
|
+
|
|
21
|
+
## Basic usage
|
|
22
|
+
|
|
23
|
+
```html demo
|
|
24
|
+
<nav aria-label="Pagination">
|
|
25
|
+
<ol class="pagination sm">
|
|
26
|
+
<li><a href="?page=2" class="btn outline" rel="prev">Previous</a></li>
|
|
27
|
+
<li><a href="?page=1" class="btn outline" aria-label="Page 1">1</a></li>
|
|
28
|
+
<li><a href="?page=2" class="btn outline" aria-label="Page 2">2</a></li>
|
|
29
|
+
<li><a href="?page=3" class="btn" aria-current="page" aria-label="Page 3">3</a></li>
|
|
30
|
+
<li><a href="?page=4" class="btn outline" aria-label="Page 4">4</a></li>
|
|
31
|
+
<li><a href="?page=5" class="btn outline" rel="next">Next</a></li>
|
|
32
|
+
</ol>
|
|
33
|
+
</nav>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Truncated ranges
|
|
37
|
+
|
|
38
|
+
Truncated ranges are plain text (`<span class="muted" aria-hidden="true">`), not
|
|
39
|
+
buttons — they are decorative, not actionable.
|
|
40
|
+
|
|
41
|
+
```html demo
|
|
42
|
+
<nav aria-label="Pagination">
|
|
43
|
+
<ol class="pagination sm">
|
|
44
|
+
<li><a href="?page=1" class="btn outline" rel="prev">Previous</a></li>
|
|
45
|
+
<li><a href="?page=1" class="btn outline" aria-label="Page 1">1</a></li>
|
|
46
|
+
<li><span class="muted" aria-hidden="true">…</span></li>
|
|
47
|
+
<li><a href="?page=7" class="btn outline" aria-label="Page 7">7</a></li>
|
|
48
|
+
<li><a href="?page=8" class="btn" aria-current="page" aria-label="Page 8">8</a></li>
|
|
49
|
+
<li><a href="?page=9" class="btn outline" aria-label="Page 9">9</a></li>
|
|
50
|
+
<li><span class="muted" aria-hidden="true">…</span></li>
|
|
51
|
+
<li><a href="?page=20" class="btn outline" aria-label="Page 20">20</a></li>
|
|
52
|
+
<li><a href="?page=9" class="btn outline" rel="next">Next</a></li>
|
|
53
|
+
</ol>
|
|
54
|
+
</nav>
|
|
55
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
> Indeterminate or determinate indicator of task completion.
|
|
4
|
+
|
|
5
|
+
- Use native `<progress class="progress">`.
|
|
6
|
+
- Shares meter styling DNA.
|
|
7
|
+
- Supports indeterminate progress by omitting `value`.
|
|
8
|
+
- Can be connected to a busy region with `aria-describedby`.
|
|
9
|
+
- Never self-close `<progress>`.
|
|
10
|
+
|
|
11
|
+
```html demo
|
|
12
|
+
<div class="stack">
|
|
13
|
+
<progress class="progress" value="60" max="100"></progress>
|
|
14
|
+
<progress class="progress" value="30" max="100"></progress>
|
|
15
|
+
<progress class="progress" value="90" max="100"></progress>
|
|
16
|
+
<progress class="progress"></progress>
|
|
17
|
+
|
|
18
|
+
<section aria-busy="true" aria-describedby="upload-progress">
|
|
19
|
+
<h2>Uploading files</h2>
|
|
20
|
+
<progress class="progress" id="upload-progress" value="60" max="100">60%</progress>
|
|
21
|
+
</section>
|
|
22
|
+
</div>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## CSS hooks
|
|
26
|
+
|
|
27
|
+
- `--progress-track` — unfilled track color.
|
|
28
|
+
- `--progress-value` — filled bar color. Prefer an intent class over setting this directly.
|
|
29
|
+
- `--bar-height` — bar thickness, shared with `.meter`.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
> Placeholder shapes for content that is loading.
|
|
4
|
+
|
|
5
|
+
- Use `.skeleton` for loading placeholders.
|
|
6
|
+
- Use `data-shape` for common placeholder forms: `text`, `title`, `avatar`, `box`.
|
|
7
|
+
- Put `role="status"` and accessible text on the loading region, not on every placeholder.
|
|
8
|
+
- Use layout utilities for placeholder arrangement.
|
|
9
|
+
- Only relevant for simple placeholders - use more structural solutions like phantom-ui for complex cases.
|
|
10
|
+
|
|
11
|
+
## Class reference
|
|
12
|
+
|
|
13
|
+
| Class | Kind | Description |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `.skeleton` | Component | Animated placeholder shape. |
|
|
16
|
+
| `data-shape` | Modifier | Geometry presets: `text`, `title`, `avatar`, `box`. |
|
|
17
|
+
|
|
18
|
+
## Basic usage
|
|
19
|
+
|
|
20
|
+
```html demo
|
|
21
|
+
<article class="card" role="status" aria-label="Loading profile">
|
|
22
|
+
<div class="cluster">
|
|
23
|
+
<div class="skeleton" data-shape="avatar" aria-hidden="true"></div>
|
|
24
|
+
<div class="stack grow">
|
|
25
|
+
<div class="skeleton" data-shape="title" aria-hidden="true"></div>
|
|
26
|
+
<div class="skeleton" data-shape="text" aria-hidden="true"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</article>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## CSS hooks
|
|
33
|
+
|
|
34
|
+
- `--skeleton-track` — base placeholder color.
|
|
35
|
+
- `--skeleton-highlight` — sweeping highlight color.
|
|
36
|
+
- `--skeleton-radius` — corner radius; `data-shape` presets override it.
|
|
37
|
+
- `--skeleton-size` — block size; `data-shape` presets override it.
|
|
38
|
+
- `--skeleton-width` — inline size; `data-shape` presets override it.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
> Loading indicator for actions or regions that may take noticeable time.
|
|
4
|
+
|
|
5
|
+
- Most actions do not need a spinner. Use `disabled` alone for fast actions or to prevent duplicate submissions.
|
|
6
|
+
- Use `aria-busy="true"` with a loading label for actions that are visibly in progress.
|
|
7
|
+
- Add `.spinner` only when the operation may take long enough that users need explicit loading feedback.
|
|
8
|
+
- The spinner uses `currentColor`, so it adapts to its context.
|
|
9
|
+
- Decorative spinners should be `aria-hidden="true"`.
|
|
10
|
+
- Use `role="status"` with accessible text when the loading state needs to be announced.
|
|
11
|
+
- Put a direct last-child `.spinner` inside a busy region to show a centered loading overlay. In buttons, spinners remain inline.
|
|
12
|
+
|
|
13
|
+
## Class reference
|
|
14
|
+
|
|
15
|
+
| Class | Kind | Description |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `.spinner` | Component | Circular loading indicator using `currentColor`. |
|
|
18
|
+
| `.sm` / `.lg` | Size | Smaller (`0.75em`) or larger (`2rem`) spinner. |
|
|
19
|
+
| Shared intents | Intent | `.primary`, `.secondary`, `.success`, `.warning`, `.danger` color. |
|
|
20
|
+
|
|
21
|
+
## Basic usage
|
|
22
|
+
|
|
23
|
+
```html demo
|
|
24
|
+
<span class="spinner"></span>
|
|
25
|
+
<span class="spinner sm primary"></span>
|
|
26
|
+
<span class="spinner lg danger"></span>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
In buttons, the spinner stays inline and inherits the button size.
|
|
30
|
+
|
|
31
|
+
```html demo
|
|
32
|
+
<button class="btn primary" type="submit" aria-busy="true" disabled>
|
|
33
|
+
<span class="spinner" aria-hidden="true"></span>
|
|
34
|
+
Saving…
|
|
35
|
+
</button>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
A direct last-child `.spinner` in a busy container becomes a centered overlay.
|
|
39
|
+
|
|
40
|
+
```html demo
|
|
41
|
+
<article class="card" aria-busy="true" aria-label="Loading card content">
|
|
42
|
+
<hgroup>
|
|
43
|
+
<h3>Card Title</h3>
|
|
44
|
+
<p class="muted">Card description goes here.</p>
|
|
45
|
+
</hgroup>
|
|
46
|
+
|
|
47
|
+
<p>This is the card content. It can contain any HTML.</p>
|
|
48
|
+
|
|
49
|
+
<footer class="cluster">
|
|
50
|
+
<button class="btn outline" disabled>Cancel</button>
|
|
51
|
+
<button class="btn" disabled>Save</button>
|
|
52
|
+
</footer>
|
|
53
|
+
|
|
54
|
+
<span class="spinner lg" aria-hidden="true"></span>
|
|
55
|
+
</article>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Announce the loading state when it needs to be spoken.
|
|
59
|
+
|
|
60
|
+
```html demo
|
|
61
|
+
<div role="status">
|
|
62
|
+
<span class="spinner" aria-hidden="true"></span>
|
|
63
|
+
<span class="sr-only">Loading results</span>
|
|
64
|
+
</div>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Size follows the font (`1em`); use `.sm` / `.lg` rather than sizing it directly.
|
|
68
|
+
|
|
69
|
+
## Busy state
|
|
70
|
+
|
|
71
|
+
A container-wide loading state that keeps the underlying content in place. It is
|
|
72
|
+
driven by `aria-busy="true"` plus a direct last-child `.spinner` — there is no
|
|
73
|
+
separate `.busy` class. The spinner is shown as a centered overlay over a faded
|
|
74
|
+
surface; buttons keep their spinners inline instead (see Button).
|
|
75
|
+
|
|
76
|
+
- Set `aria-busy="true"` on the container and add `<span class="spinner" aria-hidden="true"></span>` as its last direct child.
|
|
77
|
+
- The overlay uses `--busy-overlay-bg`; an inverted surface (`.inverted`) already composes with it.
|
|
78
|
+
- Decorative spinners stay `aria-hidden="true"`; announce progress on the region with `role="status"` and a label when needed.
|
|
79
|
+
|
|
80
|
+
```html demo
|
|
81
|
+
<article class="card" aria-busy="true" aria-label="Loading card content">
|
|
82
|
+
<h3>Card Title</h3>
|
|
83
|
+
<p>This is the card content.</p>
|
|
84
|
+
<span class="spinner" aria-hidden="true"></span>
|
|
85
|
+
</article>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## CSS hooks
|
|
89
|
+
|
|
90
|
+
- `--spinner-track` — the ring color.
|
|
91
|
+
- `--spinner-value` — the moving gap; swap the two for an inverted spinner.
|
|
92
|
+
- `--busy-overlay-bg` — background of the busy overlay. An inverted surface
|
|
93
|
+
(`.inverted`) overrides it to blend with its own surface.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
> Data table with caption and scope attributes, and an accessible scroll region for wide content.
|
|
4
|
+
|
|
5
|
+
- Use native `<table class="table">` inside a `.table-wrap` for surface, border, radius, and overflow.
|
|
6
|
+
- Use `<caption>`, `scope="col"`, and `scope="row"` for accessibility.
|
|
7
|
+
- Use `.text-end` for numeric columns and `.text-nowrap` for non-wrapping cells.
|
|
8
|
+
- For wide tables, make the wrapper an accessible scroll region with `role="region"`, `aria-labelledby`, and `tabindex="0"`.
|
|
9
|
+
- Tables stay content-first and neutral by default.
|
|
10
|
+
- `.table` does not consume shared variants or intent colors (`--ui-bg` / `--intent`): a `.soft` + intent combo on a `<tr>` has no effect. To tint rows or headers, style them with a class of your own.
|
|
11
|
+
|
|
12
|
+
## Class reference
|
|
13
|
+
|
|
14
|
+
| Class | Kind | Description |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `.table-wrap` | Component | Scroll container and outer chrome (surface, border, radius). |
|
|
17
|
+
| `.table` | Component | The table itself; row and cell rules. |
|
|
18
|
+
|
|
19
|
+
## Basic usage
|
|
20
|
+
|
|
21
|
+
```html demo
|
|
22
|
+
<div class="table-wrap">
|
|
23
|
+
<table class="table">
|
|
24
|
+
<caption>Team members</caption>
|
|
25
|
+
<thead>
|
|
26
|
+
<tr>
|
|
27
|
+
<th scope="col">Name</th>
|
|
28
|
+
<th scope="col">Email</th>
|
|
29
|
+
<th scope="col">Role</th>
|
|
30
|
+
<th scope="col">Status</th>
|
|
31
|
+
</tr>
|
|
32
|
+
</thead>
|
|
33
|
+
<tbody>
|
|
34
|
+
<tr>
|
|
35
|
+
<td>Alice Johnson</td>
|
|
36
|
+
<td>alice@example.com</td>
|
|
37
|
+
<td>Admin</td>
|
|
38
|
+
<td><span class="badge success soft">Active</span></td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td>Bob Smith</td>
|
|
42
|
+
<td>bob@example.com</td>
|
|
43
|
+
<td>Editor</td>
|
|
44
|
+
<td><span class="badge success soft">Active</span></td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td>Carol White</td>
|
|
48
|
+
<td>carol@example.com</td>
|
|
49
|
+
<td>Viewer</td>
|
|
50
|
+
<td><span class="badge secondary soft">Pending</span></td>
|
|
51
|
+
</tr>
|
|
52
|
+
</tbody>
|
|
53
|
+
</table>
|
|
54
|
+
</div>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Accessible scroll region
|
|
58
|
+
|
|
59
|
+
For wide tables, add `role="region"`, `aria-labelledby`, and `tabindex="0"` to
|
|
60
|
+
the wrapper so keyboard users can scroll it. `--table-min` sets the minimum
|
|
61
|
+
table width before the wrapper scrolls horizontally.
|
|
62
|
+
|
|
63
|
+
```html demo
|
|
64
|
+
<div class="table-wrap" role="region" aria-labelledby="revenue-table" tabindex="0">
|
|
65
|
+
<table class="table" style="--table-min: 64rem">
|
|
66
|
+
<caption id="revenue-table">Revenue by month</caption>
|
|
67
|
+
<thead>
|
|
68
|
+
<tr>
|
|
69
|
+
<th scope="col">Month</th>
|
|
70
|
+
<th scope="col">Plan</th>
|
|
71
|
+
<th scope="col" class="text-end">Revenue</th>
|
|
72
|
+
<th scope="col" class="text-end">Churn</th>
|
|
73
|
+
</tr>
|
|
74
|
+
</thead>
|
|
75
|
+
<tbody>
|
|
76
|
+
<tr>
|
|
77
|
+
<td>March 2026</td>
|
|
78
|
+
<td>Team</td>
|
|
79
|
+
<td class="text-end text-nowrap">$42,128</td>
|
|
80
|
+
<td class="text-end text-nowrap">1.2%</td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<td>April 2026</td>
|
|
84
|
+
<td>Team + Business</td>
|
|
85
|
+
<td class="text-end text-nowrap">$48,902</td>
|
|
86
|
+
<td class="text-end text-nowrap">0.9%</td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<td>May 2026</td>
|
|
90
|
+
<td>Team + Business</td>
|
|
91
|
+
<td class="text-end text-nowrap">$53,470</td>
|
|
92
|
+
<td class="text-end text-nowrap">0.7%</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</tbody>
|
|
95
|
+
</table>
|
|
96
|
+
</div>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## CSS hooks
|
|
100
|
+
|
|
101
|
+
- `--table-cell-pad` — cell padding.
|
|
102
|
+
- `--table-min` — minimum table width before `.table-wrap` scrolls horizontally.
|