@adia-ai/web-components 0.6.35 → 0.6.37
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 +56 -0
- package/components/badge/badge.a2ui.json +10 -0
- package/components/badge/badge.css +70 -0
- package/components/badge/badge.yaml +20 -0
- package/components/blockquote/blockquote.a2ui.json +121 -0
- package/components/blockquote/blockquote.class.js +68 -0
- package/components/blockquote/blockquote.css +46 -0
- package/components/blockquote/blockquote.d.ts +31 -0
- package/components/blockquote/blockquote.js +17 -0
- package/components/blockquote/blockquote.yaml +124 -0
- package/components/button/button.css +11 -3
- package/components/calendar-picker/calendar-picker.a2ui.json +15 -0
- package/components/calendar-picker/calendar-picker.class.js +7 -1
- package/components/calendar-picker/calendar-picker.yaml +14 -0
- package/components/color-input/color-input.a2ui.json +2 -2
- package/components/color-input/color-input.class.js +9 -2
- package/components/color-input/color-input.yaml +2 -2
- package/components/combobox/combobox.class.js +4 -0
- package/components/combobox/combobox.css +12 -0
- package/components/context-menu/context-menu.a2ui.json +159 -0
- package/components/context-menu/context-menu.class.js +275 -0
- package/components/context-menu/context-menu.css +56 -0
- package/components/context-menu/context-menu.d.ts +70 -0
- package/components/context-menu/context-menu.js +17 -0
- package/components/context-menu/context-menu.yaml +136 -0
- package/components/date-range-picker/date-range-picker.a2ui.json +15 -0
- package/components/date-range-picker/date-range-picker.class.js +3 -1
- package/components/date-range-picker/date-range-picker.css +4 -1
- package/components/date-range-picker/date-range-picker.yaml +14 -0
- package/components/datetime-picker/datetime-picker.a2ui.json +15 -0
- package/components/datetime-picker/datetime-picker.class.js +3 -1
- package/components/datetime-picker/datetime-picker.css +7 -1
- package/components/datetime-picker/datetime-picker.d.ts +2 -0
- package/components/datetime-picker/datetime-picker.yaml +14 -0
- package/components/empty-state/empty-state.class.js +2 -0
- package/components/feed/feed.class.js +13 -5
- package/components/feed/feed.css +14 -0
- package/components/index.js +9 -0
- package/components/input/input.css +15 -1
- package/components/input/input.test.js +40 -0
- package/components/integration-card/integration-card.class.js +9 -0
- package/components/integration-card/integration-card.test.js +4 -3
- package/components/nav-group/nav-group.css +7 -1
- package/components/number-format/number-format.a2ui.json +180 -0
- package/components/number-format/number-format.class.js +96 -0
- package/components/number-format/number-format.css +18 -0
- package/components/number-format/number-format.d.ts +68 -0
- package/components/number-format/number-format.js +17 -0
- package/components/number-format/number-format.yaml +204 -0
- package/components/pagination/pagination.a2ui.json +19 -2
- package/components/pagination/pagination.class.js +90 -37
- package/components/pagination/pagination.css +32 -127
- package/components/pagination/pagination.d.ts +8 -2
- package/components/pagination/pagination.test.js +195 -0
- package/components/pagination/pagination.yaml +22 -1
- package/components/password-strength/password-strength.a2ui.json +152 -0
- package/components/password-strength/password-strength.class.js +157 -0
- package/components/password-strength/password-strength.css +80 -0
- package/components/password-strength/password-strength.d.ts +59 -0
- package/components/password-strength/password-strength.js +17 -0
- package/components/password-strength/password-strength.yaml +153 -0
- package/components/popover/popover.css +43 -23
- package/components/popover/popover.yaml +8 -4
- package/components/qr-code/QR-TEST.svg +4 -0
- package/components/qr-code/qr-code.a2ui.json +154 -0
- package/components/qr-code/qr-code.class.js +129 -0
- package/components/qr-code/qr-code.css +41 -0
- package/components/qr-code/qr-code.d.ts +83 -0
- package/components/qr-code/qr-code.js +17 -0
- package/components/qr-code/qr-code.yaml +203 -0
- package/components/qr-code/qr-encoder.js +633 -0
- package/components/relative-time/relative-time.a2ui.json +120 -0
- package/components/relative-time/relative-time.class.js +136 -0
- package/components/relative-time/relative-time.css +22 -0
- package/components/relative-time/relative-time.d.ts +51 -0
- package/components/relative-time/relative-time.js +17 -0
- package/components/relative-time/relative-time.yaml +133 -0
- package/components/search/search.class.js +2 -0
- package/components/segmented/segmented.class.js +5 -1
- package/components/select/select.class.js +4 -0
- package/components/skip-nav/skip-nav.a2ui.json +92 -0
- package/components/skip-nav/skip-nav.class.js +45 -0
- package/components/skip-nav/skip-nav.css +54 -0
- package/components/skip-nav/skip-nav.d.ts +27 -0
- package/components/skip-nav/skip-nav.js +12 -0
- package/components/skip-nav/skip-nav.yaml +68 -0
- package/components/slider/slider.a2ui.json +16 -1
- package/components/slider/slider.class.js +264 -122
- package/components/slider/slider.css +82 -2
- package/components/slider/slider.d.ts +19 -3
- package/components/slider/slider.test.js +55 -0
- package/components/slider/slider.yaml +28 -6
- package/components/table/table.class.js +29 -6
- package/components/table/table.css +31 -4
- package/components/table-toolbar/table-toolbar.class.js +4 -1
- package/components/tag/tag.a2ui.json +10 -0
- package/components/tag/tag.class.js +8 -1
- package/components/tag/tag.css +108 -20
- package/components/tag/tag.d.ts +14 -0
- package/components/tag/tag.test.js +99 -1
- package/components/tag/tag.yaml +20 -0
- package/components/tags-input/tags-input.class.js +10 -3
- package/components/tags-input/tags-input.css +12 -3
- package/components/textarea/textarea.css +10 -1
- package/components/toast/toast.class.js +12 -4
- package/components/toc/toc.a2ui.json +159 -0
- package/components/toc/toc.class.js +222 -0
- package/components/toc/toc.css +92 -0
- package/components/toc/toc.d.ts +61 -0
- package/components/toc/toc.js +17 -0
- package/components/toc/toc.yaml +180 -0
- package/components/toolbar/toolbar.class.js +3 -0
- package/components/visually-hidden/visually-hidden.a2ui.json +71 -0
- package/components/visually-hidden/visually-hidden.class.js +14 -0
- package/components/visually-hidden/visually-hidden.css +25 -0
- package/components/visually-hidden/visually-hidden.d.ts +26 -0
- package/components/visually-hidden/visually-hidden.js +12 -0
- package/components/visually-hidden/visually-hidden.yaml +54 -0
- package/core/anchor.js +19 -3
- package/core/provider.js +19 -2
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +101 -89
- package/package.json +1 -1
- package/styles/colors/semantics.css +11 -2
- package/styles/components.css +9 -0
- package/styles/resets.css +10 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@scope (skip-nav-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
--skip-nav-bg-default: var(--a-accent-bg);
|
|
4
|
+
--skip-nav-fg-default: var(--a-accent-fg);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Host renders nothing in flow — pure behavioral wrapper. The inner
|
|
8
|
+
<a> is position:fixed (anchored to viewport) and sr-only by default;
|
|
9
|
+
becomes visible only on keyboard focus. */
|
|
10
|
+
:scope {
|
|
11
|
+
display: contents;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:scope a {
|
|
15
|
+
/* sr-only — same canonical pattern as visually-hidden-ui. */
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
z-index: 9999;
|
|
20
|
+
width: 1px;
|
|
21
|
+
height: 1px;
|
|
22
|
+
padding: 0;
|
|
23
|
+
margin: -1px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
clip: rect(0, 0, 0, 0);
|
|
26
|
+
clip-path: inset(100%);
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
border: 0;
|
|
29
|
+
/* Visible-state colors set here so the focus rule doesn't have to
|
|
30
|
+
re-set them; UA's default <a> color is overridden either way. */
|
|
31
|
+
background: var(--skip-nav-bg, var(--skip-nav-bg-default));
|
|
32
|
+
color: var(--skip-nav-fg, var(--skip-nav-fg-default));
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
border-radius: var(--a-radius-md);
|
|
35
|
+
font-weight: var(--a-weight-medium);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:scope a:focus-visible,
|
|
39
|
+
:scope a:focus {
|
|
40
|
+
/* Reveal — drop the sr-only clip + restore intrinsic size + nudge
|
|
41
|
+
down/right from the viewport edge so it doesn't kiss the corner. */
|
|
42
|
+
top: var(--a-space-2);
|
|
43
|
+
left: var(--a-space-2);
|
|
44
|
+
width: auto;
|
|
45
|
+
height: auto;
|
|
46
|
+
padding: var(--a-space-2) var(--a-space-3);
|
|
47
|
+
margin: 0;
|
|
48
|
+
overflow: visible;
|
|
49
|
+
clip: auto;
|
|
50
|
+
clip-path: none;
|
|
51
|
+
outline: 2px solid var(--a-accent-bg);
|
|
52
|
+
outline-offset: 2px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<skip-nav-ui>` — Accessibility utility — visually-hidden link that becomes visible on
|
|
3
|
+
keyboard focus, letting keyboard users skip past repetitive navigation
|
|
4
|
+
to the main content. WCAG 2.1 Success Criterion 2.4.1 "Bypass Blocks".
|
|
5
|
+
|
|
6
|
+
Place as the FIRST focusable element on the page (typically inside
|
|
7
|
+
`<body>` before any nav / shell chrome). Target an `id` on your main
|
|
8
|
+
content region (commonly `#main` / `#main-content`).
|
|
9
|
+
|
|
10
|
+
*
|
|
11
|
+
* @see https://ui-kit.exe.xyz/site/components/skip-nav
|
|
12
|
+
*
|
|
13
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
14
|
+
* the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
|
|
15
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
16
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
17
|
+
* needed beyond what the yaml `events:` block can express.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { UIElement } from '../../core/element.js';
|
|
21
|
+
|
|
22
|
+
export class UISkipNav extends UIElement {
|
|
23
|
+
/** CSS id (with leading `#`) of the main content region the link skips to. */
|
|
24
|
+
target: string;
|
|
25
|
+
/** Link label. Defaults to "Skip to main content"; localize per site. */
|
|
26
|
+
text: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<skip-nav-ui>` — auto-registers the tag on import.
|
|
3
|
+
*
|
|
4
|
+
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { defineIfFree } from '../../core/register.js';
|
|
8
|
+
import { UISkipNav } from './skip-nav.class.js';
|
|
9
|
+
|
|
10
|
+
defineIfFree('skip-nav-ui', UISkipNav);
|
|
11
|
+
|
|
12
|
+
export { UISkipNav };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
+
name: UISkipNav
|
|
3
|
+
tag: skip-nav-ui
|
|
4
|
+
status: stable
|
|
5
|
+
component: SkipNav
|
|
6
|
+
category: utility
|
|
7
|
+
version: 1
|
|
8
|
+
description: |
|
|
9
|
+
Accessibility utility — visually-hidden link that becomes visible on
|
|
10
|
+
keyboard focus, letting keyboard users skip past repetitive navigation
|
|
11
|
+
to the main content. WCAG 2.1 Success Criterion 2.4.1 "Bypass Blocks".
|
|
12
|
+
|
|
13
|
+
Place as the FIRST focusable element on the page (typically inside
|
|
14
|
+
`<body>` before any nav / shell chrome). Target an `id` on your main
|
|
15
|
+
content region (commonly `#main` / `#main-content`).
|
|
16
|
+
props:
|
|
17
|
+
target:
|
|
18
|
+
description: 'CSS id (with leading `#`) of the main content region the link skips to.'
|
|
19
|
+
type: string
|
|
20
|
+
default: "#main"
|
|
21
|
+
reflect: true
|
|
22
|
+
text:
|
|
23
|
+
description: 'Link label. Defaults to "Skip to main content"; localize per site.'
|
|
24
|
+
type: string
|
|
25
|
+
default: "Skip to main content"
|
|
26
|
+
reflect: true
|
|
27
|
+
events: {}
|
|
28
|
+
slots: {}
|
|
29
|
+
states:
|
|
30
|
+
- name: idle
|
|
31
|
+
description: Default — link is visually hidden but focusable.
|
|
32
|
+
- name: focused
|
|
33
|
+
description: Link is focused via keyboard and visible at the top of the viewport.
|
|
34
|
+
attribute: ':focus-within'
|
|
35
|
+
traits: []
|
|
36
|
+
tokens:
|
|
37
|
+
--skip-nav-bg:
|
|
38
|
+
description: Background of the visible (focused) skip link.
|
|
39
|
+
default: var(--a-accent-bg)
|
|
40
|
+
--skip-nav-fg:
|
|
41
|
+
description: Foreground of the visible (focused) skip link.
|
|
42
|
+
default: var(--a-accent-fg)
|
|
43
|
+
a2ui:
|
|
44
|
+
rules:
|
|
45
|
+
- rule: 'Place as the FIRST focusable element on the page — inside <body> before any nav / shell chrome. Otherwise keyboard users still tab through the nav before hitting the skip link.'
|
|
46
|
+
reason: 'WCAG 2.4.1 — the bypass must come BEFORE the block being bypassed.'
|
|
47
|
+
- rule: 'Target [#main] (or whatever id wraps the routed content). The target element should have tabindex="-1" so focus lands on it after the link is activated (otherwise focus may move to nothing perceptible).'
|
|
48
|
+
reason: 'Programmatic focus needs a focusable target.'
|
|
49
|
+
anti_patterns:
|
|
50
|
+
- wrong: '<header>…nav…</header><skip-nav-ui></skip-nav-ui><main id="main">…</main>'
|
|
51
|
+
why: 'The skip link comes AFTER the nav — keyboard users have already tabbed through everything you wanted them to skip.'
|
|
52
|
+
fix: '<body><skip-nav-ui></skip-nav-ui><header>…nav…</header><main id="main" tabindex="-1">…</main></body>'
|
|
53
|
+
examples:
|
|
54
|
+
- name: default
|
|
55
|
+
description: Standard skip-nav at the top of the page.
|
|
56
|
+
a2ui: |
|
|
57
|
+
[
|
|
58
|
+
{ "id": "skip", "component": "SkipNav", "target": "#main" }
|
|
59
|
+
]
|
|
60
|
+
keywords:
|
|
61
|
+
- skip-nav
|
|
62
|
+
- skip-link
|
|
63
|
+
- bypass-blocks
|
|
64
|
+
- a11y
|
|
65
|
+
- accessibility
|
|
66
|
+
- keyboard-navigation
|
|
67
|
+
related:
|
|
68
|
+
- visually-hidden
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"type": "boolean",
|
|
27
27
|
"default": false
|
|
28
28
|
},
|
|
29
|
+
"dual": {
|
|
30
|
+
"description": "Two-thumb range slider mode. When enabled, [lower-value] and\n[upper-value] are authoritative and [value] is ignored. The fill\nrenders between the two thumbs (not from left to thumb). Form-data\nunder [name] serializes as \"<lower>,<upper>\". Use for price filters,\ndate ranges, audio range gates, etc.",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
29
34
|
"error": {
|
|
30
35
|
"description": "Validation error",
|
|
31
36
|
"type": "string",
|
|
@@ -41,6 +46,11 @@
|
|
|
41
46
|
"type": "string",
|
|
42
47
|
"default": ""
|
|
43
48
|
},
|
|
49
|
+
"lowerValue": {
|
|
50
|
+
"description": "Lower thumb value (dual mode only; clamped to ≤ [upper-value]).",
|
|
51
|
+
"type": "number",
|
|
52
|
+
"default": 0
|
|
53
|
+
},
|
|
44
54
|
"max": {
|
|
45
55
|
"description": "Maximum slider value",
|
|
46
56
|
"type": "number",
|
|
@@ -71,8 +81,13 @@
|
|
|
71
81
|
"type": "number",
|
|
72
82
|
"default": 0
|
|
73
83
|
},
|
|
84
|
+
"upperValue": {
|
|
85
|
+
"description": "Upper thumb value (dual mode only; clamped to ≥ [lower-value]).",
|
|
86
|
+
"type": "number",
|
|
87
|
+
"default": 100
|
|
88
|
+
},
|
|
74
89
|
"value": {
|
|
75
|
-
"description": "Current slider value",
|
|
90
|
+
"description": "Current slider value (single-thumb mode; ignored when [dual] is set)",
|
|
76
91
|
"type": "number",
|
|
77
92
|
"default": 50
|
|
78
93
|
}
|