@adia-ai/web-components 0.8.37 → 0.8.39

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/MIGRATION.md +9 -7
  3. package/README.md +3 -3
  4. package/bin/doc.mjs +27 -5
  5. package/components/calendar-picker/calendar-picker.css +4 -1
  6. package/components/card/card.css +1 -1
  7. package/components/combobox/combobox.css +6 -0
  8. package/components/command/command.a2ui.json +3 -0
  9. package/components/command/command.class.js +28 -6
  10. package/components/command/command.css +14 -3
  11. package/components/command/command.yaml +5 -0
  12. package/components/date-range-picker/date-range-picker.css +6 -0
  13. package/components/datetime-picker/datetime-picker.css +4 -0
  14. package/components/drilldown/drilldown.a2ui.json +244 -0
  15. package/components/drilldown/drilldown.class.js +550 -0
  16. package/components/drilldown/drilldown.css +304 -0
  17. package/components/drilldown/drilldown.d.ts +68 -0
  18. package/components/drilldown/drilldown.examples.md +20 -0
  19. package/components/drilldown/drilldown.js +17 -0
  20. package/components/drilldown/drilldown.yaml +273 -0
  21. package/components/index.js +1 -0
  22. package/components/modal/modal.class.js +68 -4
  23. package/components/nav/nav.a2ui.json +5 -0
  24. package/components/nav/nav.class.js +35 -12
  25. package/components/nav/nav.d.ts +2 -0
  26. package/components/nav/nav.yaml +18 -0
  27. package/components/nav-item/nav-item.class.js +9 -6
  28. package/components/page/page.a2ui.json +13 -1
  29. package/components/page/page.css +113 -0
  30. package/components/page/page.yaml +30 -3
  31. package/components/select/select.class.js +30 -12
  32. package/components/select/select.css +11 -2
  33. package/components/swatch/swatch.css +6 -4
  34. package/components/toggle-group/toggle-group.class.js +21 -11
  35. package/components/toggle-group/toggle-group.css +16 -8
  36. package/components/toggle-group/toggle-group.d.ts +6 -0
  37. package/components/toggle-group/toggle-group.yaml +10 -0
  38. package/components/toggle-group/toggle-option.a2ui.json +5 -0
  39. package/components/toggle-group/toggle-option.yaml +18 -2
  40. package/custom-elements.json +277 -100
  41. package/dist/theme-provider.min.js +3 -3
  42. package/dist/web-components.min.css +1 -1
  43. package/dist/web-components.min.js +110 -88
  44. package/dist/web-components.sheet.js +1 -1
  45. package/package.json +1 -1
  46. package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.html +1 -1
  47. package/styles/components.css +1 -0
  48. package/traits/view-transition/view-transition.js +7 -0
@@ -0,0 +1,304 @@
1
+ @scope (drilldown-ui) {
2
+ :where(:scope) {
3
+ /* ── Layout ── */
4
+ --drilldown-row-height: var(--a-size, 2.25rem);
5
+ --drilldown-row-radius: var(--a-radius-sm);
6
+ --drilldown-row-px: var(--a-space-2);
7
+ --drilldown-row-gap: var(--a-space-2);
8
+ --drilldown-header-px: var(--a-space-3);
9
+ --drilldown-header-py: var(--a-space-2);
10
+ --drilldown-list-py: var(--a-space-1);
11
+ --drilldown-dot-size: 0.5rem;
12
+ --drilldown-chevron-size: var(--a-caret-size);
13
+
14
+ /* ── Typography ── */
15
+ --drilldown-font-size: var(--a-ui-size);
16
+ --drilldown-meta-font-size: var(--a-ui-xs);
17
+ --drilldown-title-font-size: var(--a-ui-size);
18
+ --drilldown-title-weight: var(--a-weight-medium);
19
+
20
+ /* ── Colors ── */
21
+ --drilldown-fg: var(--md-sys-color-neutral-on-surface);
22
+ --drilldown-fg-muted: var(--a-fg-muted);
23
+ --drilldown-bg-hover: var(--a-bg-hover);
24
+ --drilldown-bg-active: var(--a-bg-muted);
25
+ --drilldown-border: var(--md-sys-color-neutral-outline-variant);
26
+
27
+ /* ── Count chip (row-native — deliberately NOT badge-ui's chrome,
28
+ which reads oversized at this row density; gh#1285) ── */
29
+ --drilldown-count-chip-px: var(--a-space-1);
30
+ --drilldown-count-chip-py: var(--a-space-px);
31
+ --drilldown-count-chip-font-size: var(--a-ui-2xs, 0.6875rem);
32
+ --drilldown-count-chip-radius: var(--a-radius-sm);
33
+ --drilldown-count-chip-bg: var(--md-sys-color-neutral-container-low);
34
+ --drilldown-count-chip-fg: var(--a-fg-muted);
35
+
36
+ /* ── Transition ── */
37
+ --drilldown-duration: var(--a-duration-fast);
38
+ --drilldown-easing: var(--a-easing);
39
+
40
+ /* ── Focus ── */
41
+ --drilldown-focus-ring: var(--a-focus-ring);
42
+ }
43
+
44
+ :scope {
45
+ box-sizing: border-box;
46
+ display: flex;
47
+ flex-direction: column;
48
+ font-size: var(--drilldown-font-size);
49
+ color: var(--drilldown-fg);
50
+ }
51
+
52
+ /* ── Header ── */
53
+ [slot="header"] {
54
+ display: flex;
55
+ align-items: center;
56
+ gap: var(--drilldown-row-gap);
57
+ padding: var(--drilldown-header-py) var(--drilldown-header-px);
58
+ border-bottom: 1px solid var(--drilldown-border);
59
+ flex-shrink: 0;
60
+ }
61
+
62
+ [slot="back"] {
63
+ display: inline-flex;
64
+ align-items: center;
65
+ gap: var(--a-space-1);
66
+ border: none;
67
+ background: transparent;
68
+ color: var(--drilldown-fg-muted);
69
+ font: inherit;
70
+ font-size: var(--drilldown-meta-font-size);
71
+ padding: var(--a-space-1);
72
+ margin-inline-start: calc(-1 * var(--a-space-1));
73
+ border-radius: var(--drilldown-row-radius);
74
+ cursor: pointer;
75
+ white-space: nowrap;
76
+ max-width: 40%;
77
+ overflow: hidden;
78
+ }
79
+ [slot="back"] icon-ui {
80
+ --a-icon-size: var(--drilldown-chevron-size);
81
+ flex-shrink: 0;
82
+ }
83
+ [slot="back"] [data-back-label] {
84
+ overflow: hidden;
85
+ text-overflow: ellipsis;
86
+ }
87
+ [slot="back"]:hover {
88
+ background: var(--drilldown-bg-hover);
89
+ color: var(--drilldown-fg);
90
+ }
91
+ [slot="back"]:focus-visible {
92
+ box-shadow: var(--drilldown-focus-ring);
93
+ outline: none;
94
+ }
95
+ [slot="back"][hidden] {
96
+ display: none;
97
+ }
98
+
99
+ [slot="breadcrumb"]:empty {
100
+ display: none;
101
+ }
102
+
103
+ [slot="title"] {
104
+ display: flex;
105
+ align-items: baseline;
106
+ gap: var(--a-space-1-5);
107
+ min-width: 0;
108
+ flex: 1;
109
+ }
110
+ [data-level-title] {
111
+ font-weight: var(--drilldown-title-weight);
112
+ font-size: var(--drilldown-title-font-size);
113
+ overflow: hidden;
114
+ text-overflow: ellipsis;
115
+ white-space: nowrap;
116
+ }
117
+ [data-level-title]:empty {
118
+ display: none;
119
+ }
120
+ [data-level-count] {
121
+ color: var(--drilldown-fg-muted);
122
+ font-size: var(--drilldown-meta-font-size);
123
+ font-variant-numeric: tabular-nums;
124
+ flex-shrink: 0;
125
+ }
126
+ [data-level-count]:empty {
127
+ display: none;
128
+ }
129
+
130
+ /* ── Filter ── */
131
+ [slot="filter"] {
132
+ display: flex;
133
+ align-items: center;
134
+ gap: var(--a-space-2);
135
+ padding: var(--a-space-2) var(--drilldown-header-px);
136
+ border-bottom: 1px solid var(--drilldown-border);
137
+ flex-shrink: 0;
138
+ }
139
+ [slot="filter"][hidden] {
140
+ display: none;
141
+ }
142
+ [slot="filter"] icon-ui {
143
+ --a-icon-size: 0.875rem;
144
+ color: var(--drilldown-fg-muted);
145
+ flex-shrink: 0;
146
+ }
147
+ /* Composed <input-ui raw> (per ADR-0055 / ADR-0025 — no native <input>
148
+ wrap; the search-ui precedent). `raw` already strips input-ui's own
149
+ border/background/padding (input.css); re-point its own tokens so the
150
+ text inherits this row's chrome instead of input-ui's defaults. */
151
+ [slot="filter"] input-ui {
152
+ flex: 1;
153
+ min-width: 0;
154
+ --input-fg: var(--drilldown-fg);
155
+ --input-placeholder-fg: var(--drilldown-fg-muted);
156
+ font: inherit;
157
+ }
158
+
159
+ /* ── Viewport / panel ── */
160
+ [slot="viewport"] {
161
+ flex: 1;
162
+ min-height: 0;
163
+ overflow: hidden;
164
+ position: relative;
165
+ }
166
+
167
+ [slot="panel"] {
168
+ display: flex;
169
+ flex-direction: column;
170
+ gap: var(--a-space-0-5);
171
+ padding: var(--drilldown-list-py) var(--a-space-1);
172
+ height: 100%;
173
+ overflow-y: auto;
174
+ }
175
+
176
+ [slot="panel"][data-anim="forward"] {
177
+ animation: drilldown-enter-forward var(--drilldown-duration) var(--drilldown-easing);
178
+ }
179
+ [slot="panel"][data-anim="backward"] {
180
+ animation: drilldown-enter-backward var(--drilldown-duration) var(--drilldown-easing);
181
+ }
182
+
183
+ @keyframes drilldown-enter-forward {
184
+ from { transform: translateX(var(--a-space-4)); opacity: 0; }
185
+ to { transform: none; opacity: 1; }
186
+ }
187
+ @keyframes drilldown-enter-backward {
188
+ from { transform: translateX(calc(-1 * var(--a-space-4))); opacity: 0; }
189
+ to { transform: none; opacity: 1; }
190
+ }
191
+
192
+ /* ── Rows ── */
193
+ [role="option"] {
194
+ display: flex;
195
+ align-items: center;
196
+ gap: var(--drilldown-row-gap);
197
+ min-height: var(--drilldown-row-height);
198
+ padding-inline: var(--drilldown-row-px);
199
+ border-radius: var(--drilldown-row-radius);
200
+ cursor: pointer;
201
+ outline: none;
202
+ transition: background var(--drilldown-duration) var(--drilldown-easing);
203
+ }
204
+ [role="option"]:hover {
205
+ background: var(--drilldown-bg-hover);
206
+ }
207
+ [role="option"]:focus-visible,
208
+ [role="option"][tabindex="0"] {
209
+ background: var(--drilldown-bg-active);
210
+ }
211
+ [role="option"]:focus-visible {
212
+ box-shadow: var(--drilldown-focus-ring);
213
+ }
214
+
215
+ [slot="dot"] {
216
+ inline-size: var(--drilldown-dot-size);
217
+ block-size: var(--drilldown-dot-size);
218
+ border-radius: var(--a-radius-full);
219
+ flex-shrink: 0;
220
+ background: var(--md-sys-color-neutral);
221
+ }
222
+ [slot="dot"][data-tone="info"] { background: var(--a-info-bg); }
223
+ [slot="dot"][data-tone="success"] { background: var(--a-success-bg); }
224
+ [slot="dot"][data-tone="warning"] { background: var(--a-warning-bg); }
225
+ [slot="dot"][data-tone="danger"] { background: var(--a-danger-bg); }
226
+ [slot="dot"][data-tone="primary"] { background: var(--a-primary-bg); }
227
+
228
+ [slot="main"] {
229
+ display: flex;
230
+ flex-direction: column;
231
+ min-width: 0;
232
+ flex: 1;
233
+ line-height: 1.3;
234
+ }
235
+ [slot="label"] {
236
+ overflow: hidden;
237
+ text-overflow: ellipsis;
238
+ white-space: nowrap;
239
+ }
240
+ [slot="meta"] {
241
+ overflow: hidden;
242
+ text-overflow: ellipsis;
243
+ white-space: nowrap;
244
+ color: var(--drilldown-fg-muted);
245
+ font-size: var(--drilldown-meta-font-size);
246
+ }
247
+
248
+ [slot="counts"] {
249
+ display: flex;
250
+ align-items: center;
251
+ gap: var(--a-space-1);
252
+ flex-shrink: 0;
253
+ }
254
+ [data-count-chip] {
255
+ padding: var(--drilldown-count-chip-py) var(--drilldown-count-chip-px);
256
+ border-radius: var(--drilldown-count-chip-radius);
257
+ font-size: var(--drilldown-count-chip-font-size);
258
+ font-variant-numeric: tabular-nums;
259
+ line-height: 1;
260
+ background: var(--drilldown-count-chip-bg);
261
+ color: var(--drilldown-count-chip-fg);
262
+ white-space: nowrap;
263
+ }
264
+ [data-count-chip][data-tone="info"] { background: var(--a-info-bg); color: var(--md-sys-color-info-on-info); }
265
+ [data-count-chip][data-tone="success"] { background: var(--a-success-bg); color: var(--md-sys-color-success-on-success); }
266
+ [data-count-chip][data-tone="warning"] { background: var(--a-warning-bg); color: var(--md-sys-color-warning-on-warning); }
267
+ [data-count-chip][data-tone="danger"] { background: var(--a-danger-bg); color: var(--md-sys-color-danger-on-danger); }
268
+ [data-count-chip][data-tone="primary"] { background: var(--a-primary-bg); color: var(--md-sys-color-primary-on-primary); }
269
+
270
+ [slot="chevron"] {
271
+ --a-icon-size: var(--drilldown-chevron-size);
272
+ color: var(--drilldown-fg-muted);
273
+ flex-shrink: 0;
274
+ }
275
+
276
+ /* ── Loading / empty ── */
277
+ [data-drilldown-skeleton] {
278
+ margin: var(--a-space-0-5) var(--a-space-1);
279
+ }
280
+
281
+ /* ── Live region (visually hidden, still announced) ── */
282
+ [data-visually-hidden] {
283
+ position: absolute;
284
+ width: 1px;
285
+ height: 1px;
286
+ padding: 0;
287
+ margin: -1px;
288
+ overflow: hidden;
289
+ clip: rect(0, 0, 0, 0);
290
+ white-space: nowrap;
291
+ border: 0;
292
+ }
293
+
294
+ @media (prefers-reduced-motion: reduce) {
295
+ [slot="panel"][data-anim] {
296
+ animation: none;
297
+ }
298
+ }
299
+
300
+ /* `[static]` — explicit opt-out, same effect as prefers-reduced-motion. */
301
+ :scope[static] [slot="panel"][data-anim] {
302
+ animation: none;
303
+ }
304
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * `<drilldown-ui>` — Single-panel, multi-level drill-in menu. One list panel slides between
3
+ levels (a level header with back navigation replaces stacking a column
4
+ per level) — for hierarchical data where miller columns don't fit the
5
+ viewport (>2 levels, >12 top-level entries, or narrow layouts). Rows
6
+ compose a leading dot/icon, primary label, optional meta line, and
7
+ trailing row-native count chips (not full <badge-ui>, which reads
8
+ oversized at row density) — plus a drill-in chevron on branch items.
9
+ Set `.items` to a tree of `{value, label, meta?, dot?, counts?, children?}`
10
+ nodes; `children` may be an array (sync) or a function returning an
11
+ array/Promise (lazy, fetched on drill-in — a loading level is shown via
12
+ <skeleton-ui> while it resolves). Distinct from <tree-ui> (inline
13
+ expand/collapse — right for file-tree shapes, wrong for wide/deep data
14
+ where the expanded tree becomes a wall of rows), <nav-ui> (flat app
15
+ navigation, not hierarchical drill-in), and <context-menu> (transient
16
+ popover submenus, not a persistent content panel).
17
+
18
+ *
19
+ * @see https://ui-kit.exe.xyz/site/components/drilldown
20
+ *
21
+ * Type declarations generated by scripts/build/dts-codegen.mjs from
22
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
23
+ * run `npm run build:components`, then `npm run codegen:dts` to
24
+ * regenerate; or hand-author this file fully if rich event types are
25
+ * needed beyond what the yaml `events:` block can express.
26
+ */
27
+
28
+ import { UIElement } from '../../core/element.js';
29
+
30
+ export interface DrilldownNavigateEventDetail {
31
+ /** The newly-shown level's ancestor value chain. */
32
+ path: string[];
33
+ }
34
+
35
+ export type DrilldownNavigateEvent = CustomEvent<DrilldownNavigateEventDetail>;
36
+ export interface DrilldownSelectEventDetail {
37
+ /** The activated node object. */
38
+ item: Record<string, unknown>;
39
+ /** Ancestor value chain the selected item lives at. */
40
+ path: string[];
41
+ }
42
+
43
+ export type DrilldownSelectEvent = CustomEvent<DrilldownSelectEventDetail>;
44
+
45
+ export class UIDrilldown extends UIElement {
46
+ /** Root-level array of node objects: {value, label, meta?, dot?, counts?, children?, leaf?}. `value` is the stable id used in `path` and event details. `dot` names a semantic tone (info, success, warning, danger, primary, neutral) rendered as a small leading color swatch. `counts` is an array of {variant?, value} rendered as compact trailing chips. `children` is either an array of child nodes (resolved synchronously) or a function `(item) => array | Promise<array>` for lazy per-level fetch — a loading level renders while the promise is pending. `leaf: true` forces no drill chevron even when `children` is present (rare — normally omit `children` instead). */
47
+ items: string;
48
+ /** Show a filter input pinned above the list, filtering the current level's rows by label/meta. */
49
+ filterable: boolean;
50
+ /** Current drilled-in level, as an array of ancestor item `value`s (root = `[]`). Setting `.path` restores directly to that nested level without animating through every intermediate level — the deep-link/URL-restore path. Hand-managed (not the generic `reflect:` mechanism, which can't JSON-encode arrays) — it still genuinely reflects to a JSON-encoded `path` attribute both ways (property → attribute and attribute → property), unlike most array props on this kit. */
51
+ path: string;
52
+ /** Placeholder text for the filter input (only rendered when `[filterable]`). */
53
+ placeholder: string;
54
+ /** Level-header title shown at the root level (depth 0). Empty by default (no title row). */
55
+ rootLabel: string;
56
+ /** When true, clicking/activating a branch item (one with children) BOTH fires `select` and drills into it — the Schema Manager shape, where picking a namespace is both a selection and a navigation. Default false: branch activation only drills in; only leaf activation fires `select`. */
57
+ selectOnDrill: boolean;
58
+ /** Suppress the horizontal slide transition between levels — instant swap. Also honored automatically under `prefers-reduced-motion: reduce`. */
59
+ static: boolean;
60
+
61
+ addEventListener(type: 'navigate', listener: (ev: DrilldownNavigateEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
62
+ addEventListener(type: 'select', listener: (ev: DrilldownSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
63
+ addEventListener<K extends keyof HTMLElementEventMap>(
64
+ type: K,
65
+ listener: (this: UIDrilldown, ev: HTMLElementEventMap[K]) => unknown,
66
+ options?: boolean | AddEventListenerOptions,
67
+ ): void;
68
+ }
@@ -0,0 +1,20 @@
1
+ # drilldown — Examples
2
+
3
+ ## Schema Manager — namespace → node type → detail
4
+
5
+ ```html
6
+ <drilldown-ui id="drilldown-schema" root-label="Namespaces" style="width:22rem; height:24rem; border:1px solid var(--md-sys-color-neutral-outline); border-radius:var(--a-radius-lg);"></drilldown-ui>
7
+ ```
8
+
9
+ ## filterable
10
+
11
+ ```html
12
+ <drilldown-ui id="drilldown-filter" filterable placeholder="Filter namespaces…" root-label="Namespaces" style="width:22rem; height:20rem; border:1px solid var(--md-sys-color-neutral-outline); border-radius:var(--a-radius-lg);"></drilldown-ui>
13
+ ```
14
+
15
+ ## select-on-drill
16
+
17
+ ```html
18
+ <drilldown-ui id="drilldown-select-on-drill" select-on-drill root-label="Namespaces" style="width:22rem; height:18rem; border:1px solid var(--md-sys-color-neutral-outline); border-radius:var(--a-radius-lg);"></drilldown-ui>
19
+ <p data-drilldown-log style="margin-top: var(--a-space-2);">Activate a namespace — it selects AND drills in.</p>
20
+ ```
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `<drilldown-ui>` — auto-registers the tag on import.
3
+ *
4
+ * For non-side-effect class import (test isolation, tag override), use
5
+ * the `class` subpath:
6
+ *
7
+ * import { UIDrilldown } from '@adia-ai/web-components/components/drilldown/class';
8
+ *
9
+ * @see ../../USAGE.md#registration--auto-vs-explicit
10
+ */
11
+
12
+ import { defineIfFree } from '../../core/register.js';
13
+ import { UIDrilldown } from './drilldown.class.js';
14
+
15
+ defineIfFree('drilldown-ui', UIDrilldown);
16
+
17
+ export { UIDrilldown };
@@ -0,0 +1,273 @@
1
+ $schema: ../../../../scripts/schemas/component.yaml.schema.json
2
+ name: UIDrilldown
3
+ tag: drilldown-ui
4
+ status: beta
5
+ component: Drilldown
6
+ category: navigation
7
+ version: 1
8
+ description: |
9
+ Single-panel, multi-level drill-in menu. One list panel slides between
10
+ levels (a level header with back navigation replaces stacking a column
11
+ per level) — for hierarchical data where miller columns don't fit the
12
+ viewport (>2 levels, >12 top-level entries, or narrow layouts). Rows
13
+ compose a leading dot/icon, primary label, optional meta line, and
14
+ trailing row-native count chips (not full <badge-ui>, which reads
15
+ oversized at row density) — plus a drill-in chevron on branch items.
16
+ Set `.items` to a tree of `{value, label, meta?, dot?, counts?, children?}`
17
+ nodes; `children` may be an array (sync) or a function returning an
18
+ array/Promise (lazy, fetched on drill-in — a loading level is shown via
19
+ <skeleton-ui> while it resolves). Distinct from <tree-ui> (inline
20
+ expand/collapse — right for file-tree shapes, wrong for wide/deep data
21
+ where the expanded tree becomes a wall of rows), <nav-ui> (flat app
22
+ navigation, not hierarchical drill-in), and <context-menu> (transient
23
+ popover submenus, not a persistent content panel).
24
+ # Per ADR-0027 — primitives that programmatically create other primitives
25
+ # do NOT auto-import them. Consumer (or demo shell) must explicitly import.
26
+ composes:
27
+ - icon-ui
28
+ - skeleton-ui
29
+ - empty-state-ui
30
+ - input-ui # filter row's text field (ADR-0055 — no native <input> in stamped DOM)
31
+ - button-ui # back-navigation affordance
32
+ props:
33
+ items:
34
+ description: >-
35
+ Root-level array of node objects: {value, label, meta?, dot?,
36
+ counts?, children?, leaf?}. `value` is the stable id used in `path`
37
+ and event details. `dot` names a semantic tone (info, success,
38
+ warning, danger, primary, neutral) rendered as a small leading
39
+ color swatch. `counts` is an array of {variant?, value} rendered as
40
+ compact trailing chips. `children` is either an array of child
41
+ nodes (resolved synchronously) or a function `(item) => array |
42
+ Promise<array>` for lazy per-level fetch — a loading level renders
43
+ while the promise is pending. `leaf: true` forces no drill chevron
44
+ even when `children` is present (rare — normally omit `children`
45
+ instead).
46
+ type: array
47
+ items:
48
+ type: object
49
+ default: []
50
+ dynamic: true
51
+ path:
52
+ description: >-
53
+ Current drilled-in level, as an array of ancestor item `value`s
54
+ (root = `[]`). Setting `.path` restores directly to that nested
55
+ level without animating through every intermediate level — the
56
+ deep-link/URL-restore path. Hand-managed (not the generic
57
+ `reflect:` mechanism, which can't JSON-encode arrays) — it still
58
+ genuinely reflects to a JSON-encoded `path` attribute both ways
59
+ (property → attribute and attribute → property), unlike most array
60
+ props on this kit.
61
+ type: array
62
+ items:
63
+ type: string
64
+ default: []
65
+ dynamic: true
66
+ rootLabel:
67
+ description: Level-header title shown at the root level (depth 0). Empty by default (no title row).
68
+ type: string
69
+ default: ""
70
+ reflect: true
71
+ filterable:
72
+ description: Show a filter input pinned above the list, filtering the current level's rows by label/meta.
73
+ type: boolean
74
+ default: false
75
+ reflect: true
76
+ placeholder:
77
+ description: Placeholder text for the filter input (only rendered when `[filterable]`).
78
+ type: string
79
+ default: "Filter…"
80
+ reflect: true
81
+ selectOnDrill:
82
+ description: >-
83
+ When true, clicking/activating a branch item (one with children)
84
+ BOTH fires `select` and drills into it — the Schema Manager shape,
85
+ where picking a namespace is both a selection and a navigation.
86
+ Default false: branch activation only drills in; only leaf
87
+ activation fires `select`.
88
+ type: boolean
89
+ default: false
90
+ reflect: true
91
+ attribute: select-on-drill
92
+ static:
93
+ description: >-
94
+ Suppress the horizontal slide transition between levels — instant
95
+ swap. Also honored automatically under `prefers-reduced-motion: reduce`.
96
+ type: boolean
97
+ default: false
98
+ reflect: true
99
+ events:
100
+ select:
101
+ description: >
102
+ Fired when a leaf item is activated (click/Enter), or when a branch
103
+ item is activated with `[select-on-drill]` set. detail: { path,
104
+ item }. `path` is the drilled-in level the item lives at (the
105
+ current `.path` at the time of activation); `item` is the raw node
106
+ object.
107
+ detail:
108
+ path:
109
+ type: array
110
+ items:
111
+ type: string
112
+ description: Ancestor value chain the selected item lives at.
113
+ item:
114
+ type: object
115
+ description: The activated node object.
116
+ navigate:
117
+ description: >
118
+ Fired whenever the shown level changes — drill-in, back, breadcrumb
119
+ jump, or a programmatic `.path` assignment. detail: { path }. Hosts
120
+ mirror this to the URL instead of listening to `select`.
121
+ detail:
122
+ path:
123
+ type: array
124
+ items:
125
+ type: string
126
+ description: The newly-shown level's ancestor value chain.
127
+ slots:
128
+ breadcrumb:
129
+ description: >-
130
+ Optional slot for a consumer-supplied <breadcrumb-ui> in the level
131
+ header, for deep hierarchies. Not managed by drilldown-ui — the
132
+ consumer wires jump clicks to `.path = [...]` itself.
133
+ header:
134
+ description: Auto-stamped level-header container (back affordance + breadcrumb + title/count). Structural — not consumer-overridable.
135
+ back:
136
+ description: Auto-stamped back-affordance <button> (chevron + parent-level label). Hidden at the root level.
137
+ title:
138
+ description: Auto-stamped title cluster (current-level label + item count) inside the header.
139
+ filter:
140
+ description: Auto-stamped filter-input row, shown only when `[filterable]` is set.
141
+ viewport:
142
+ description: Auto-stamped clipping container for the current level's panel (hosts the slide-transition overflow clip).
143
+ dot:
144
+ description: Auto-stamped per-row leading color swatch, rendered when the row's data item declares a `dot` tone.
145
+ main:
146
+ description: Auto-stamped per-row content column (label + optional meta line).
147
+ meta:
148
+ description: Auto-stamped per-row secondary meta line, rendered when the row's data item declares `meta`.
149
+ counts:
150
+ description: Auto-stamped per-row trailing count-chip cluster, rendered when the row's data item declares `counts`.
151
+ states:
152
+ - name: idle
153
+ description: Default, ready for interaction.
154
+ - name: loading
155
+ description: A lazy level's children are being resolved (async `children` function pending).
156
+ - name: empty
157
+ description: The current level has no items.
158
+ traits: []
159
+ tokens:
160
+ --drilldown-row-height:
161
+ description: Height of each row.
162
+ --drilldown-row-radius:
163
+ description: Border radius of each row.
164
+ --drilldown-row-px:
165
+ description: Inline padding of each row.
166
+ --drilldown-row-gap:
167
+ description: Gap between row elements (dot / main / counts / chevron).
168
+ --drilldown-bg-hover:
169
+ description: Row background on hover.
170
+ --drilldown-bg-active:
171
+ description: Row background when focused/active (roving tabindex).
172
+ --drilldown-fg:
173
+ description: Primary row text color.
174
+ --drilldown-fg-muted:
175
+ description: Muted text color (meta line, chevron, back affordance).
176
+ --drilldown-dot-size:
177
+ description: Diameter of the leading color dot.
178
+ --drilldown-count-chip-px:
179
+ description: Inline padding of a trailing count chip.
180
+ --drilldown-count-chip-font-size:
181
+ description: Font size of a trailing count chip.
182
+ --drilldown-count-chip-radius:
183
+ description: Border radius of a trailing count chip.
184
+ --drilldown-header-px:
185
+ description: Inline padding of the level header.
186
+ --drilldown-header-py:
187
+ description: Block padding of the level header.
188
+ --drilldown-duration:
189
+ description: Slide-transition duration.
190
+ --drilldown-easing:
191
+ description: Slide-transition easing function.
192
+ --drilldown-focus-ring:
193
+ description: Focus ring box-shadow for rows and the back button.
194
+ requiredIcons:
195
+ - caret-left
196
+ - caret-right
197
+ - magnifying-glass
198
+ a2ui:
199
+ rules:
200
+ - >-
201
+ Use <drilldown-ui> for a hierarchical namespace/category → item
202
+ drill-in over a SINGLE panel — the sibling shape to miller columns,
203
+ chosen when the viewport can't afford a column per level (>2
204
+ levels, or a level with more than ~12 entries). For inline
205
+ expand/collapse trees, use <tree-ui>. For flat app navigation, use
206
+ <nav-ui>. For a small non-searchable popover of actions, use
207
+ <menu-ui> or <context-menu>.
208
+ - >-
209
+ Set `.items` programmatically (array of node objects), NOT
210
+ declarative children — drilldown-ui is a content-only, data-driven
211
+ primitive with no children markup contract.
212
+ - >-
213
+ Listen for `select` (leaf activation, or branch activation with
214
+ `[select-on-drill]`) and `navigate` (any level change) — mirror
215
+ `navigate`'s `path` to the URL, not `select`'s.
216
+ - >-
217
+ A `path` array restores directly to a nested level (deep link)
218
+ without animating through intermediates — set it once on mount
219
+ rather than calling drill-in repeatedly.
220
+ anti_patterns: []
221
+ examples:
222
+ - name: basic-drilldown
223
+ description: Basic Drilldown usage
224
+ a2ui: >-
225
+ [
226
+ {
227
+ "id": "root",
228
+ "component": "Card",
229
+ "children": [
230
+ "sec"
231
+ ]
232
+ },
233
+ {
234
+ "id": "sec",
235
+ "component": "Section",
236
+ "children": [
237
+ "comp"
238
+ ]
239
+ },
240
+ {
241
+ "id": "comp",
242
+ "component": "Drilldown"
243
+ }
244
+ ]
245
+ keywords:
246
+ - drilldown
247
+ - drill-down
248
+ - miller
249
+ - miller-columns
250
+ - namespace
251
+ - hierarchy
252
+ - navigator
253
+ - catalog-browser
254
+ synonyms:
255
+ hierarchy:
256
+ - tree
257
+ - nav
258
+ - drilldown
259
+ miller:
260
+ - drilldown
261
+ - tree
262
+ - column
263
+ navigator:
264
+ - tree
265
+ - nav
266
+ - drilldown
267
+ - sidebar
268
+ related:
269
+ - Tree
270
+ - List
271
+ - Nav
272
+ - Breadcrumb
273
+ - Menu
@@ -34,6 +34,7 @@ export { UISegment } from './segment/segment.js';
34
34
  export { UISegmented } from './segmented/segmented.js';
35
35
  export { UIRange } from './range/range.js';
36
36
  export { UITree, UITreeItem } from './tree/tree.js';
37
+ export { UIDrilldown } from './drilldown/drilldown.js';
37
38
  export { UIPane } from './pane/pane.js';
38
39
  export { UIPage } from './page/page.js';
39
40
  export { UIChatInput } from './chat-thread/chat-input.js';