@adia-ai/web-components 0.8.13 → 0.8.15
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 +25 -0
- package/components/adia-mark/adia-mark.examples.md +3 -12
- package/components/adia-wordmark/adia-wordmark.examples.md +4 -12
- package/components/agent-artifact/agent-artifact.examples.md +0 -9
- package/components/agent-feedback-bar/agent-feedback-bar.examples.md +0 -11
- package/components/alert/alert.examples.md +1 -1
- package/components/badge/badge.examples.md +35 -4
- package/components/block/block.examples.md +5 -5
- package/components/blockquote/blockquote.examples.md +22 -0
- package/components/button/button.css +10 -4
- package/components/button/button.examples.md +4 -4
- package/components/card/card.examples.md +1 -1
- package/components/check/check.examples.md +23 -4
- package/components/col/col.examples.md +29 -0
- package/components/combobox/combobox.examples.md +9 -15
- package/components/command/command.examples.md +3 -3
- package/components/context-menu/context-menu.a2ui.json +1 -1
- package/components/context-menu/context-menu.css +3 -1
- package/components/context-menu/context-menu.examples.md +50 -0
- package/components/context-menu/context-menu.yaml +1 -1
- package/components/date-range-picker/date-range-picker.examples.md +9 -21
- package/components/datetime-picker/datetime-picker.examples.md +9 -30
- package/components/demo-toggle/demo-toggle.examples.md +1 -1
- package/components/display-field/display-field.examples.md +5 -30
- package/components/drawer/drawer.examples.md +17 -32
- package/components/field/field.examples.md +30 -11
- package/components/grid/grid.examples.md +27 -0
- package/components/heatmap/heatmap.examples.md +2 -2
- package/components/inline-edit/inline-edit.examples.md +32 -0
- package/components/integration-card/integration-card.examples.md +10 -27
- package/components/list-window/list-window.examples.md +5 -59
- package/components/loading-overlay/loading-overlay.examples.md +19 -36
- package/components/mark/mark.examples.md +62 -0
- package/components/menu/menu.css +8 -2
- package/components/nav/nav.examples.md +2 -2
- package/components/nav-group/nav-group.examples.md +2 -2
- package/components/nav-item/nav-item.css +21 -6
- package/components/noodles/noodles.examples.md +11 -11
- package/components/number-format/number-format.examples.md +19 -0
- package/components/page/page.examples.md +43 -20
- package/components/password-strength/password-strength.examples.md +28 -0
- package/components/popover/popover.css +7 -1
- package/components/preview/preview.examples.md +30 -0
- package/components/progress/progress.examples.md +3 -3
- package/components/qr-code/qr-code.examples.md +19 -0
- package/components/radio/radio.examples.md +23 -4
- package/components/relative-time/relative-time.examples.md +19 -0
- package/components/row/row.examples.md +20 -0
- package/components/skip-nav/skip-nav.examples.md +27 -0
- package/components/spinner/spinner.examples.md +5 -12
- package/components/stack/stack.examples.md +17 -0
- package/components/stat/stat.examples.md +23 -4
- package/components/swatch/swatch.examples.md +2 -2
- package/components/switch/switch.examples.md +23 -4
- package/components/table-toolbar/table-toolbar.examples.md +46 -0
- package/components/tabs/tabs.examples.md +13 -16
- package/components/tag/tag.examples.md +4 -4
- package/components/tags-input/tags-input.examples.md +6 -73
- package/components/text/text.examples.md +37 -6
- package/components/time-picker/time-picker.examples.md +3 -15
- package/components/toc/toc.examples.md +69 -0
- package/components/tour/tour.examples.md +119 -0
- package/components/visually-hidden/visually-hidden.examples.md +26 -0
- package/dist/host.min.css +1 -1
- package/dist/host.sheet.js +1 -1
- package/dist/theme-provider.min.js +6 -6
- package/dist/themes.min.css +1 -1
- package/dist/themes.sheet.js +1 -1
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.sheet.js +1 -1
- package/package.json +1 -1
- package/styles/colors/material-static.css +8 -8
- package/styles/themes.css +460 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog — @adia-ai/web-components
|
|
2
2
|
|
|
3
|
+
## [0.8.15] — 2026-07-26
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- **Hover fills darken toward the ladder in both schemes** (`styles/colors/material-static.css`) — all 8 families' `--md-sys-color-<family>-hover` move from `light-dark(<family>-650, <family>-350)` to `light-dark(<family>-600, <family>-550)` (base fill is `<family>-500` in both modes; ladder stops are 50 points, higher = darker). Light-mode hover lands two stops darker than base (`500 → 600`, softened from the old three-stop `-650`); dark-mode hover lands one stop darker (`500 → 550`), where it previously *lightened* three stops to `-350`. Measured with the gate's own culori converter: light-mode white hover text is 6/8 families ≥ AA 4.5:1 (from 8/8 at the old stronger jump); dark-mode — which failed AA for **all 8 families** at `-350` (ratios ≈ 2.0–2.5) — now passes for 5/8. Flows through the `--a-*-hover` alias layer and all 12 `[theme]` recolors with no component changes. Filled buttons bypassed this role via `--a-<family>-strong` — corrected in the Fixed entry below, same release.
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
- **Filled buttons hover on the hover role, not the active role** (`components/button/button.css`) — `button-ui[variant="primary"]` and the `danger`/`success`/`info` filled colors set their hover fill from `--a-<family>-strong`, which aliases `--md-sys-color-<family>-active` (`light-dark(750, 250)`). In dark mode that meant hover *lightened five stops* to the pale `-250` tint — the washed-out hover the role change above couldn't reach, because these rules bypassed the hover role entirely. They now ride `--a-<family>-hover` (`light-dark(600, 550)`). Verified live in dark mode: primary idle computes exactly `primary-500`, hover exactly `primary-550`. `warning` keeps its documented `-bg` tint exception (dark-label contrast, dogfood-audited); ghost/outline **text** hovers keep `-strong` deliberately — lighter text on a dark canvas is more contrast, not less; `-strong` remains the pressed/active fill.
|
|
10
|
+
|
|
11
|
+
### Maintenance
|
|
12
|
+
- **`dist/` bundles rebuilt** from the token change above.
|
|
13
|
+
|
|
14
|
+
## [0.8.14] — 2026-07-25
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- **Every theme's neutral chrome now carries its own hue** (`styles/themes.css`; PR #414) — canvas, borders and on-surface text stayed a fixed cool grey across all 12 `[theme]` identities while only the accent families rotated. The same hue-rotation mechanism (own L/C curve untouched, hue shifted by a constant delta, per-theme chroma multiplier) now extends to the neutral family, targeting each theme's own primary hue. Neutral's chroma stays low (≈0.002–0.044, the top end being signal's 1.3× and arcade's 1.4×), so the tint reads as a whisper rather than a recolor — chrome belongs to the theme's identity instead of sitting as a fixed grey under a rotating accent. `npm run verify:contrast` still passes 42/42 WCAG AA 4.5:1 pairs in both schemes for every theme (L values are byte-identical to the shipped ramp; only hue and chroma moved).
|
|
18
|
+
- **All floating overlays share one elevated surface** (`components/{popover,menu,context-menu}/`) — `popover-ui` used `--md-sys-color-neutral-surface-dimmer` (neutral-925, *darker* than the neutral-875 page it floats over, so a popover panel read near-black), while `menu-ui` and `context-menu-ui` sat at page level (`--a-bg-subtle` = `neutral-surface`). All three now use `--md-sys-color-neutral-surface-bright`, matching `select-ui`'s own dropdown exactly: a select menu and a popover panel opened from the same topbar sit on one plane. Verified live in dark mode — both surfaces measure the identical computed color. `drawer-ui` deliberately keeps `surface-dimmer` (edge-anchored, not floating) and `tooltip-ui` keeps its inverted surface.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **`nav-item-ui`'s selected state is distinguishable from hover again** (`components/nav-item/nav-item.css`) — v0.8.13 (PR #417) unified both states onto `--a-bg-muted` (container-low). Wherever no *other* selected affordance shows, that made them pixel-identical: a `[variant="section"]` item with no icon — the docs-site subnav shape — suppresses the accent bar and resolves `--a-ui-text-selected` and `--a-ui-text-hover` to the same `--a-fg-strong`, leaving the background as the only signal. Selected now reads `--a-bg-selected` (`neutral-container-active`) while hover keeps container-low, so v0.8.13's actual win — dropping the `--a-canvas-0-scrim` opacity synth from hover — is preserved. Verified live in dark mode: plain / hovered / selected measure transparent, α0.1, α0.4.
|
|
22
|
+
- **55 drifted or missing `.examples.md` regenerated, plus a drift gate** (gh#395; PR #416) — the size-model migration (PR #396) edited ~100 components' `.examples.html` without re-running `generate-examples-md.mjs`, so 42 committed `.md` files still described pre-migration markup and 13 components had no `.md` at all. Nothing caught either gap: unlike `.a2ui.json`, this generator had no drift check. `generate-examples-md.mjs --verify` (mirroring `components.mjs --verify`) and the new `check:examples-md-fresh` script close it.
|
|
23
|
+
- **Stale token-table defaults in the docs** — `menu.examples.html` documented a `--menu-bg` token that does not exist (the shipped token is `--menu-popover-bg`), `popover.examples.html` documented a default the CSS had not used for two releases, and `context-menu.yaml`'s `--context-menu-bg` default was equally stale. All three now state the shipped value.
|
|
24
|
+
|
|
25
|
+
### Maintenance
|
|
26
|
+
- **`dist/` bundles rebuilt** — CSS + JS + `theme-provider.min.js`, which inlines the changed component CSS.
|
|
27
|
+
|
|
3
28
|
## [0.8.13] — 2026-07-25
|
|
4
29
|
|
|
5
30
|
### Added
|
|
@@ -6,19 +6,10 @@
|
|
|
6
6
|
<adia-mark-ui></adia-mark-ui>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## size
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<
|
|
13
|
-
<adia-mark-ui size="md"></adia-mark-ui>
|
|
14
|
-
<adia-mark-ui size="lg"></adia-mark-ui>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Topbar brand slot
|
|
18
|
-
|
|
19
|
-
```html
|
|
20
|
-
<row-ui gap="2" align="center">
|
|
12
|
+
<div scale="ui-sm">
|
|
21
13
|
<adia-mark-ui size="sm"></adia-mark-ui>
|
|
22
|
-
|
|
23
|
-
</row-ui>
|
|
14
|
+
</div>
|
|
24
15
|
```
|
|
@@ -6,18 +6,10 @@
|
|
|
6
6
|
<adia-wordmark-ui></adia-wordmark-ui>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## size
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<
|
|
13
|
-
<adia-wordmark-ui size="
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Login header
|
|
18
|
-
|
|
19
|
-
```html
|
|
20
|
-
<row-ui gap="2" align="center">
|
|
21
|
-
<adia-wordmark-ui size="lg"></adia-wordmark-ui>
|
|
22
|
-
</row-ui>
|
|
12
|
+
<div scale="ui-sm">
|
|
13
|
+
<adia-wordmark-ui size="sm"></adia-wordmark-ui>
|
|
14
|
+
</div>
|
|
23
15
|
```
|
|
@@ -17,12 +17,3 @@
|
|
|
17
17
|
<div style="font-size: var(--a-ui-sm); color: var(--a-fg-muted); line-height: 1.5;">Validation score 62/100 — the output is missing a price badge and has an unlabeled button. Retrying would help.</div>
|
|
18
18
|
</agent-artifact-ui>
|
|
19
19
|
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```html
|
|
24
|
-
<agent-artifact-ui title="product-card" kind="A2UI" icon="layout">
|
|
25
|
-
<button-ui slot="primary" text="Open in canvas" icon="arrows-out-simple"></button-ui>
|
|
26
|
-
<button-ui slot="secondary" text="Copy" icon="copy"></button-ui>
|
|
27
|
-
</agent-artifact-ui>
|
|
28
|
-
```
|
|
@@ -11,14 +11,3 @@
|
|
|
11
11
|
```html
|
|
12
12
|
<agent-feedback-bar-ui id="demo-save" save-label="Save pattern"></agent-feedback-bar-ui>
|
|
13
13
|
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```html
|
|
18
|
-
<agent-feedback-bar-ui save-label="Save pattern"></agent-feedback-bar-ui>
|
|
19
|
-
el.addEventListener('feedback-rate', (e) => persist(e.detail.rating));
|
|
20
|
-
el.addEventListener('feedback-save', async () => {
|
|
21
|
-
const name = await savePattern(...);
|
|
22
|
-
el.setStatus(`Saved as "${name}"`, { lock: 'save' });
|
|
23
|
-
});
|
|
24
|
-
```
|
|
@@ -6,14 +6,45 @@
|
|
|
6
6
|
<badge-ui text="Default"></badge-ui>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Typography registers
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<
|
|
12
|
+
<row-ui gap="6" align="start" wrap>
|
|
13
|
+
<col-ui gap="2">
|
|
14
|
+
<text-ui variant="caption" color="muted">verse</text-ui>
|
|
15
|
+
<div verse>
|
|
16
|
+
<row-ui gap="2">
|
|
17
|
+
<badge-ui text="New" variant="success"></badge-ui>
|
|
18
|
+
<badge-ui text="Beta" variant="info"></badge-ui>
|
|
19
|
+
<badge-ui text="3" variant="danger"></badge-ui>
|
|
20
|
+
</row-ui>
|
|
21
|
+
</div>
|
|
22
|
+
</col-ui>
|
|
23
|
+
<col-ui gap="2">
|
|
24
|
+
<text-ui variant="caption" color="muted">regular</text-ui>
|
|
25
|
+
<div>
|
|
26
|
+
<row-ui gap="2">
|
|
27
|
+
<badge-ui text="New" variant="success"></badge-ui>
|
|
28
|
+
<badge-ui text="Beta" variant="info"></badge-ui>
|
|
29
|
+
<badge-ui text="3" variant="danger"></badge-ui>
|
|
30
|
+
</row-ui>
|
|
31
|
+
</div>
|
|
32
|
+
</col-ui>
|
|
33
|
+
<col-ui gap="2">
|
|
34
|
+
<text-ui variant="caption" color="muted">prose</text-ui>
|
|
35
|
+
<div prose>
|
|
36
|
+
<row-ui gap="2">
|
|
37
|
+
<badge-ui text="New" variant="success"></badge-ui>
|
|
38
|
+
<badge-ui text="Beta" variant="info"></badge-ui>
|
|
39
|
+
<badge-ui text="3" variant="danger"></badge-ui>
|
|
40
|
+
</row-ui>
|
|
41
|
+
</div>
|
|
42
|
+
</col-ui>
|
|
43
|
+
</row-ui>
|
|
13
44
|
```
|
|
14
45
|
|
|
15
|
-
##
|
|
46
|
+
## tone
|
|
16
47
|
|
|
17
48
|
```html
|
|
18
|
-
<badge-ui text="
|
|
49
|
+
<badge-ui text="Info" variant="info" tone="solid"></badge-ui>
|
|
19
50
|
```
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## padding
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
|
-
<block-ui padding="none" style="border:1px dashed var(--
|
|
6
|
+
<block-ui padding="none" style="border:1px dashed var(--md-sys-color-neutral-outline);">
|
|
7
7
|
<p>padding: none</p>
|
|
8
8
|
</block-ui>
|
|
9
9
|
```
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
## margin
|
|
12
12
|
|
|
13
13
|
```html
|
|
14
|
-
<div style="background:var(--a-
|
|
15
|
-
<block-ui margin="none" padding="sm" style="border:1px dashed var(--
|
|
14
|
+
<div style="background:var(--a-primary-10-tint); display:inline-block;">
|
|
15
|
+
<block-ui margin="none" padding="sm" style="border:1px dashed var(--md-sys-color-neutral-outline); background:var(--a-canvas-bg);">
|
|
16
16
|
<p>margin: none</p>
|
|
17
17
|
</block-ui>
|
|
18
18
|
</div>
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
## Combinations
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
|
-
<div style="background:var(--a-
|
|
25
|
-
<block-ui padding="lg" margin="md" style="border:1px dashed var(--
|
|
24
|
+
<div style="background:var(--a-primary-10-tint); display:inline-block;">
|
|
25
|
+
<block-ui padding="lg" margin="md" style="border:1px dashed var(--md-sys-color-neutral-outline); background:var(--a-canvas-bg);">
|
|
26
26
|
<p>padding: lg + margin: md</p>
|
|
27
27
|
</block-ui>
|
|
28
28
|
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# blockquote — Examples
|
|
2
|
+
|
|
3
|
+
## default
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<blockquote-ui>Stay hungry. Stay foolish.</blockquote-ui>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## cite (attribute)
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<blockquote-ui cite="Steve Jobs, Stanford Commencement, 2005">Stay hungry. Stay foolish.</blockquote-ui>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## cite (slot — rich attribution)
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<blockquote-ui>
|
|
19
|
+
The best way to predict the future is to invent it.
|
|
20
|
+
<link-ui slot="cite" href="https://en.wikipedia.org/wiki/Alan_Kay">Alan Kay (1971)</link-ui>
|
|
21
|
+
</blockquote-ui>
|
|
22
|
+
```
|
|
@@ -19,10 +19,16 @@ button-ui:active { transform: scale(0.97); }
|
|
|
19
19
|
untouched (primary/danger/etc. keep their light label). */
|
|
20
20
|
button-ui:not([disabled]):hover { --button-bg: var(--button-bg-hover); }
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/* Filled hovers ride the HOVER role (light-dark 600/550 — one rule: darker
|
|
23
|
+
than the 500 base in both schemes). They previously rode `-strong`, which
|
|
24
|
+
aliases the ACTIVE role (750/250): in dark mode that hover LIGHTENED five
|
|
25
|
+
stops to the pale -250 tint — the washed-out hover the 600/550 role change
|
|
26
|
+
couldn't reach because these rules bypassed it. `-strong` remains the
|
|
27
|
+
pressed/active fill. */
|
|
28
|
+
button-ui[variant="primary"]:not([disabled]):hover { --button-bg: var(--a-primary-hover); }
|
|
29
|
+
button-ui[color="danger"]:not([disabled]):hover { --button-bg: var(--a-danger-hover); }
|
|
30
|
+
button-ui[color="success"]:not([disabled]):hover { --button-bg: var(--a-success-hover); }
|
|
31
|
+
button-ui[color="info"]:not([disabled]):hover { --button-bg: var(--a-info-hover); }
|
|
26
32
|
/* warning fill → -bg (NOT -strong like the rest): warning's -strong mid-tone
|
|
27
33
|
reads muddy under the dark --a-warning-fg, so the hover surface uses the
|
|
28
34
|
-20 tint (--a-warning-bg) for clean contrast. (dogfood-audit: warning-strong-vs-bg) */
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
<button-ui text="Default"></button-ui>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## color
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<button-ui text="
|
|
12
|
+
<button-ui text="Info" color="info"></button-ui>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## size
|
|
16
16
|
|
|
17
17
|
```html
|
|
18
|
-
<button-ui
|
|
18
|
+
<button-ui text="Small" size="sm"></button-ui>
|
|
19
19
|
```
|
|
@@ -6,14 +6,33 @@
|
|
|
6
6
|
<check-ui label="Unchecked"></check-ui>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Typography registers
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<
|
|
12
|
+
<row-ui gap="6" align="start" wrap>
|
|
13
|
+
<col-ui gap="2">
|
|
14
|
+
<text-ui variant="caption" color="muted">verse</text-ui>
|
|
15
|
+
<div verse>
|
|
16
|
+
<check-ui label="Notify me" checked></check-ui>
|
|
17
|
+
</div>
|
|
18
|
+
</col-ui>
|
|
19
|
+
<col-ui gap="2">
|
|
20
|
+
<text-ui variant="caption" color="muted">regular</text-ui>
|
|
21
|
+
<div>
|
|
22
|
+
<check-ui label="Notify me" checked></check-ui>
|
|
23
|
+
</div>
|
|
24
|
+
</col-ui>
|
|
25
|
+
<col-ui gap="2">
|
|
26
|
+
<text-ui variant="caption" color="muted">prose</text-ui>
|
|
27
|
+
<div prose>
|
|
28
|
+
<check-ui label="Notify me" checked></check-ui>
|
|
29
|
+
</div>
|
|
30
|
+
</col-ui>
|
|
31
|
+
</row-ui>
|
|
13
32
|
```
|
|
14
33
|
|
|
15
|
-
##
|
|
34
|
+
## indeterminate
|
|
16
35
|
|
|
17
36
|
```html
|
|
18
|
-
<check-ui label="
|
|
37
|
+
<check-ui label="Select All" indeterminate></check-ui>
|
|
19
38
|
```
|
|
@@ -9,3 +9,32 @@
|
|
|
9
9
|
<button-ui text="Sign in" variant="solid" stretch></button-ui>
|
|
10
10
|
</col-ui>
|
|
11
11
|
```
|
|
12
|
+
|
|
13
|
+
## Responsive (@bp)
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<!-- Mobile: center-aligned single column; md+: start-aligned with larger gap -->
|
|
17
|
+
<col-ui gap="sm lg@md" align="center start@md">
|
|
18
|
+
<card-ui>...</card-ui>
|
|
19
|
+
<card-ui>...</card-ui>
|
|
20
|
+
</col-ui>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Rendered demos
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<col-ui gap="3">
|
|
27
|
+
<field-ui label="Full name">
|
|
28
|
+
<input-ui placeholder="Maya Chen"></input-ui>
|
|
29
|
+
</field-ui>
|
|
30
|
+
<field-ui label="Email">
|
|
31
|
+
<input-ui type="email" placeholder="maya@example.com"></input-ui>
|
|
32
|
+
</field-ui>
|
|
33
|
+
<field-ui label="Role">
|
|
34
|
+
<select-ui value="member">
|
|
35
|
+
<option value="admin">Admin</option>
|
|
36
|
+
<option value="member">Member</option>
|
|
37
|
+
</select-ui>
|
|
38
|
+
</field-ui>
|
|
39
|
+
</col-ui>
|
|
40
|
+
```
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
<option value="fr">France</option>
|
|
12
12
|
<option value="es">Spain</option>
|
|
13
13
|
<option value="it">Italy</option>
|
|
14
|
+
<option value="jp">Japan</option>
|
|
15
|
+
<option value="kr">South Korea</option>
|
|
14
16
|
</combobox-ui>
|
|
15
17
|
</field-ui>
|
|
16
18
|
```
|
|
@@ -23,16 +25,22 @@
|
|
|
23
25
|
<optgroup label="Americas">
|
|
24
26
|
<option value="nyc">New York</option>
|
|
25
27
|
<option value="sf">San Francisco</option>
|
|
28
|
+
<option value="toronto">Toronto</option>
|
|
26
29
|
</optgroup>
|
|
27
30
|
<optgroup label="Europe">
|
|
28
31
|
<option value="london">London</option>
|
|
29
32
|
<option value="paris">Paris</option>
|
|
33
|
+
<option value="berlin">Berlin</option>
|
|
34
|
+
</optgroup>
|
|
35
|
+
<optgroup label="Asia">
|
|
36
|
+
<option value="tokyo">Tokyo</option>
|
|
37
|
+
<option value="singapore">Singapore</option>
|
|
30
38
|
</optgroup>
|
|
31
39
|
</combobox-ui>
|
|
32
40
|
</field-ui>
|
|
33
41
|
```
|
|
34
42
|
|
|
35
|
-
## creatable
|
|
43
|
+
## creatable
|
|
36
44
|
|
|
37
45
|
```html
|
|
38
46
|
<field-ui label="Tag">
|
|
@@ -43,17 +51,3 @@
|
|
|
43
51
|
</combobox-ui>
|
|
44
52
|
</field-ui>
|
|
45
53
|
```
|
|
46
|
-
|
|
47
|
-
Typing "regression" + Enter fires the `create` event with `detail.value === "regression"`.
|
|
48
|
-
|
|
49
|
-
## clearable
|
|
50
|
-
|
|
51
|
-
```html
|
|
52
|
-
<field-ui label="Role">
|
|
53
|
-
<combobox-ui clearable value="user" placeholder="Pick a role…">
|
|
54
|
-
<option value="user">User</option>
|
|
55
|
-
<option value="admin">Admin</option>
|
|
56
|
-
<option value="guest">Guest</option>
|
|
57
|
-
</combobox-ui>
|
|
58
|
-
</field-ui>
|
|
59
|
-
```
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## inline (not in dialog)
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
|
-
<command-ui placeholder="Search commands..." style="width:32rem; max-height:24rem; border:1px solid var(--
|
|
6
|
+
<command-ui placeholder="Search commands..." style="width:32rem; max-height:24rem; border:1px solid var(--md-sys-color-neutral-outline); border-radius:var(--a-radius-lg);">
|
|
7
7
|
<optgroup label="Pages">
|
|
8
8
|
<option value="home" data-icon="house">Home</option>
|
|
9
9
|
<option value="dashboard" data-icon="chart-bar">Dashboard</option>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
## grouped options with icons
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
|
-
<command-ui placeholder="Type a command..." style="width:32rem; max-height:24rem; border:1px solid var(--
|
|
22
|
+
<command-ui placeholder="Type a command..." style="width:32rem; max-height:24rem; border:1px solid var(--md-sys-color-neutral-outline); border-radius:var(--a-radius-lg);">
|
|
23
23
|
<optgroup label="Navigation">
|
|
24
24
|
<option value="home" data-icon="house">Go to Home</option>
|
|
25
25
|
<option value="projects" data-icon="folder">Go to Projects</option>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
## with shortcuts
|
|
42
42
|
|
|
43
43
|
```html
|
|
44
|
-
<command-ui placeholder="Search..." style="width:32rem; max-height:24rem; border:1px solid var(--
|
|
44
|
+
<command-ui placeholder="Search..." style="width:32rem; max-height:24rem; border:1px solid var(--md-sys-color-neutral-outline); border-radius:var(--a-radius-lg);">
|
|
45
45
|
<optgroup label="Actions">
|
|
46
46
|
<option value="new-file" data-icon="file-plus" data-shortcut="⌘N">New File</option>
|
|
47
47
|
<option value="open" data-icon="folder-open" data-shortcut="⌘O">Open File</option>
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"tokens": {
|
|
139
139
|
"--context-menu-bg": {
|
|
140
140
|
"description": "Menu surface background color.",
|
|
141
|
-
"default": "var(--
|
|
141
|
+
"default": "var(--md-sys-color-neutral-surface-bright)"
|
|
142
142
|
},
|
|
143
143
|
"--context-menu-border": {
|
|
144
144
|
"description": "Menu surface border color.",
|
|
@@ -28,7 +28,9 @@
|
|
|
28
28
|
padding: var(--a-space-1);
|
|
29
29
|
border: 1px solid var(--md-sys-color-neutral-outline-variant);
|
|
30
30
|
border-radius: var(--a-radius-lg);
|
|
31
|
-
|
|
31
|
+
/* surface-bright — same elevated-overlay plane as menu-ui (whose surface
|
|
32
|
+
this must match), select-ui's dropdown, and popover-ui. */
|
|
33
|
+
background: var(--md-sys-color-neutral-surface-bright);
|
|
32
34
|
box-shadow: var(--a-shadow-lg);
|
|
33
35
|
min-width: 10rem;
|
|
34
36
|
font-family: var(--context-menu-font-family, var(--a-font-family-ui));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# context-menu — Examples
|
|
2
|
+
|
|
3
|
+
## Wrap mode — target is the first non-item child
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<context-menu-ui>
|
|
7
|
+
<div tabindex="0" style="padding: var(--a-space-3); border: 1px dashed var(--md-sys-color-neutral-outline); border-radius: var(--a-radius-md); background: var(--md-sys-color-neutral-background); cursor: context-menu; outline: none;">
|
|
8
|
+
<icon-ui name="file-text"></icon-ui>
|
|
9
|
+
<strong>Q4-budget-draft.xlsx</strong>
|
|
10
|
+
<text-ui color="subtle" size="sm">— right-click me</text-ui>
|
|
11
|
+
</div>
|
|
12
|
+
<menu-item-ui value="open" text="Open"></menu-item-ui>
|
|
13
|
+
<menu-item-ui value="rename" text="Rename…"></menu-item-ui>
|
|
14
|
+
<menu-item-ui value="download" text="Download"></menu-item-ui>
|
|
15
|
+
<menu-divider-ui></menu-divider-ui>
|
|
16
|
+
<menu-item-ui value="delete" text="Delete" variant="danger"></menu-item-ui>
|
|
17
|
+
</context-menu-ui>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## [for] selector mode — point at existing targets
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<div style="display: grid; gap: var(--a-space-2);">
|
|
24
|
+
<div data-row tabindex="0" style="padding: var(--a-space-3); border: 1px solid var(--md-sys-color-neutral-outline); border-radius: var(--a-radius-sm); background: var(--md-sys-color-neutral-background);">Row A — right-click</div>
|
|
25
|
+
<div data-row tabindex="0" style="padding: var(--a-space-3); border: 1px solid var(--md-sys-color-neutral-outline); border-radius: var(--a-radius-sm); background: var(--md-sys-color-neutral-background);">Row B — right-click</div>
|
|
26
|
+
<div data-row tabindex="0" style="padding: var(--a-space-3); border: 1px solid var(--md-sys-color-neutral-outline); border-radius: var(--a-radius-sm); background: var(--md-sys-color-neutral-background);">Row C — right-click</div>
|
|
27
|
+
</div>
|
|
28
|
+
<context-menu-ui for='[data-chunk="context-menu-for"] [data-row]'>
|
|
29
|
+
<menu-item-ui value="edit" text="Edit"></menu-item-ui>
|
|
30
|
+
<menu-item-ui value="duplicate" text="Duplicate"></menu-item-ui>
|
|
31
|
+
<menu-divider-ui></menu-divider-ui>
|
|
32
|
+
<menu-item-ui value="archive" text="Archive" variant="warning"></menu-item-ui>
|
|
33
|
+
</context-menu-ui>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## open · long-press-ms
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<context-menu-ui open long-press-ms="800">
|
|
40
|
+
<div tabindex="0" style="padding: var(--a-space-3); border: 1px dashed var(--md-sys-color-neutral-outline); border-radius: var(--a-radius-md); background: var(--md-sys-color-neutral-background); cursor: context-menu; outline: none;">
|
|
41
|
+
<icon-ui name="dots-three"></icon-ui>
|
|
42
|
+
<strong>Canvas object</strong>
|
|
43
|
+
<text-ui color="subtle" size="sm">— long-press 800 ms, or open programmatically</text-ui>
|
|
44
|
+
</div>
|
|
45
|
+
<menu-item-ui value="front" text="Bring to front"></menu-item-ui>
|
|
46
|
+
<menu-item-ui value="back" text="Send to back"></menu-item-ui>
|
|
47
|
+
<menu-divider-ui></menu-divider-ui>
|
|
48
|
+
<menu-item-ui value="delete" text="Delete" variant="danger"></menu-item-ui>
|
|
49
|
+
</context-menu-ui>
|
|
50
|
+
```
|
|
@@ -85,7 +85,7 @@ traits: []
|
|
|
85
85
|
tokens:
|
|
86
86
|
--context-menu-bg:
|
|
87
87
|
description: Menu surface background color.
|
|
88
|
-
default: var(--
|
|
88
|
+
default: var(--md-sys-color-neutral-surface-bright)
|
|
89
89
|
--context-menu-border:
|
|
90
90
|
description: Menu surface border color.
|
|
91
91
|
default: var(--a-border-subtle)
|
|
@@ -4,34 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
6
|
<field-ui label="Report period">
|
|
7
|
-
<date-range-picker-ui
|
|
8
|
-
name="report-period"
|
|
9
|
-
min="2026-01-01"
|
|
10
|
-
max="2026-12-31">
|
|
11
|
-
</date-range-picker-ui>
|
|
7
|
+
<date-range-picker-ui name="report-period" min="2026-01-01" max="2026-12-31"></date-range-picker-ui>
|
|
12
8
|
</field-ui>
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
##
|
|
11
|
+
## Pre-selected
|
|
16
12
|
|
|
17
13
|
```html
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
value='{"from":"2026-05-01","to":"2026-05-31"}'
|
|
22
|
-
compare-value='{"from":"2026-04-01","to":"2026-04-30"}'>
|
|
23
|
-
</date-range-picker-ui>
|
|
14
|
+
<field-ui label="Booking dates">
|
|
15
|
+
<date-range-picker-ui value='{"from":"2026-03-01","to":"2026-03-15"}'></date-range-picker-ui>
|
|
16
|
+
</field-ui>
|
|
24
17
|
```
|
|
25
18
|
|
|
26
|
-
##
|
|
19
|
+
## Comparison mode
|
|
27
20
|
|
|
28
21
|
```html
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
{ label: 'Q1', range: { from: '2026-01-01', to: '2026-03-31' } },
|
|
33
|
-
{ label: 'Q2', range: { from: '2026-04-01', to: '2026-06-30' } },
|
|
34
|
-
{ label: 'YTD', range: { from: '2026-01-01', to: '2026-05-24' } },
|
|
35
|
-
];
|
|
36
|
-
</script>
|
|
22
|
+
<field-ui label="Analytics period">
|
|
23
|
+
<date-range-picker-ui name="period" comparison value='{"from":"2026-05-01","to":"2026-05-31"}' compare-value='{"from":"2026-04-01","to":"2026-04-30"}'></date-range-picker-ui>
|
|
24
|
+
</field-ui>
|
|
37
25
|
```
|
|
@@ -4,43 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
6
|
<field-ui label="Appointment">
|
|
7
|
-
<datetime-picker-ui
|
|
8
|
-
name="appointment"
|
|
9
|
-
min="2026-01-01T00:00"
|
|
10
|
-
max="2026-12-31T23:59">
|
|
11
|
-
</datetime-picker-ui>
|
|
7
|
+
<datetime-picker-ui name="appointment" min="2026-01-01T00:00" max="2026-12-31T23:59"></datetime-picker-ui>
|
|
12
8
|
</field-ui>
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
##
|
|
11
|
+
## Pre-selected
|
|
16
12
|
|
|
17
13
|
```html
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
value="2026-05-24T14:30:45">
|
|
22
|
-
</datetime-picker-ui>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Forced 24-hour cycle
|
|
26
|
-
|
|
27
|
-
```html
|
|
28
|
-
<datetime-picker-ui hour-cycle="h23"></datetime-picker-ui>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Explicit commit (Apply / Cancel)
|
|
32
|
-
|
|
33
|
-
```html
|
|
34
|
-
<datetime-picker-ui name="explicit">
|
|
35
|
-
<div slot="footer">
|
|
36
|
-
<button-ui data-action="cancel" variant="ghost" text="Cancel"></button-ui>
|
|
37
|
-
<button-ui data-action="apply" variant="primary" text="Apply"></button-ui>
|
|
38
|
-
</div>
|
|
39
|
-
</datetime-picker-ui>
|
|
14
|
+
<field-ui label="Meeting start">
|
|
15
|
+
<datetime-picker-ui value="2026-05-24T14:30"></datetime-picker-ui>
|
|
16
|
+
</field-ui>
|
|
40
17
|
```
|
|
41
18
|
|
|
42
|
-
##
|
|
19
|
+
## precision
|
|
43
20
|
|
|
44
21
|
```html
|
|
45
|
-
<
|
|
22
|
+
<field-ui label="Minute precision">
|
|
23
|
+
<datetime-picker-ui value="2026-05-24T14:30"></datetime-picker-ui>
|
|
24
|
+
</field-ui>
|
|
46
25
|
```
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
```html
|
|
6
6
|
<demo-toggle-ui label-on="With trait" label-off="Without trait" initial="off">
|
|
7
7
|
<div slot="off" style="padding:var(--a-space-4);text-align:center;color:var(--a-fg-muted);">Bare surface — no trait attached.</div>
|
|
8
|
-
<div slot="on" style="padding:var(--a-space-4);text-align:center;color:var(--
|
|
8
|
+
<div slot="on" style="padding:var(--a-space-4);text-align:center;color:var(--md-sys-color-neutral-on-surface);">Same surface, with trait attached.</div>
|
|
9
9
|
</demo-toggle-ui>
|
|
10
10
|
```
|
|
11
11
|
|