@agent-ui-kit/components 0.0.3
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/dist/base-styles.css +8 -0
- package/dist/component-styles.css +147 -0
- package/dist/controls/_base/index.d.ts +3 -0
- package/dist/controls/_base/index.js +9 -0
- package/dist/controls/_base/indicator-element.d.ts +132 -0
- package/dist/controls/_base/indicator-element.js +158 -0
- package/dist/controls/_base/listbox-element.d.ts +70 -0
- package/dist/controls/_base/listbox-element.js +74 -0
- package/dist/controls/_base/range-element.d.ts +120 -0
- package/dist/controls/_base/range-element.js +158 -0
- package/dist/controls/_surface/container-box.css +301 -0
- package/dist/controls/_surface/container.css +156 -0
- package/dist/controls/_token-surface/token-surface.d.ts +35 -0
- package/dist/controls/_token-surface/token-surface.js +97 -0
- package/dist/controls/attachment/attachment-meta.d.ts +8 -0
- package/dist/controls/attachment/attachment-meta.js +84 -0
- package/dist/controls/attachment/attachment.css +91 -0
- package/dist/controls/attachment/attachment.d.ts +40 -0
- package/dist/controls/attachment/attachment.js +70 -0
- package/dist/controls/avatar/avatar-initials.d.ts +4 -0
- package/dist/controls/avatar/avatar-initials.js +30 -0
- package/dist/controls/avatar/avatar.css +87 -0
- package/dist/controls/avatar/avatar.d.ts +40 -0
- package/dist/controls/avatar/avatar.js +77 -0
- package/dist/controls/badge/badge.css +175 -0
- package/dist/controls/badge/badge.d.ts +36 -0
- package/dist/controls/badge/badge.js +71 -0
- package/dist/controls/bar-chart/bar-chart.css +110 -0
- package/dist/controls/bar-chart/bar-chart.d.ts +26 -0
- package/dist/controls/bar-chart/bar-chart.js +80 -0
- package/dist/controls/bar-chart/bar-math.d.ts +31 -0
- package/dist/controls/bar-chart/bar-math.js +106 -0
- package/dist/controls/button/button.css +263 -0
- package/dist/controls/button/button.d.ts +61 -0
- package/dist/controls/button/button.js +115 -0
- package/dist/controls/calendar/calendar.css +495 -0
- package/dist/controls/calendar/calendar.d.ts +161 -0
- package/dist/controls/calendar/calendar.js +1004 -0
- package/dist/controls/card/card-content.d.ts +24 -0
- package/dist/controls/card/card-content.js +133 -0
- package/dist/controls/card/card-footer.d.ts +3 -0
- package/dist/controls/card/card-footer.js +16 -0
- package/dist/controls/card/card-header.d.ts +3 -0
- package/dist/controls/card/card-header.js +18 -0
- package/dist/controls/card/card.css +445 -0
- package/dist/controls/card/card.d.ts +51 -0
- package/dist/controls/card/card.js +61 -0
- package/dist/controls/checkbox/checkbox.css +204 -0
- package/dist/controls/checkbox/checkbox.d.ts +114 -0
- package/dist/controls/checkbox/checkbox.js +130 -0
- package/dist/controls/code/code.css +72 -0
- package/dist/controls/code/code.d.ts +23 -0
- package/dist/controls/code/code.js +40 -0
- package/dist/controls/color-picker/color-picker.css +209 -0
- package/dist/controls/color-picker/color-picker.d.ts +84 -0
- package/dist/controls/color-picker/color-picker.js +545 -0
- package/dist/controls/color-picker/color.d.ts +40 -0
- package/dist/controls/color-picker/color.js +159 -0
- package/dist/controls/column/column.css +151 -0
- package/dist/controls/column/column.d.ts +107 -0
- package/dist/controls/column/column.js +57 -0
- package/dist/controls/combo-box/combo-box.css +397 -0
- package/dist/controls/combo-box/combo-box.d.ts +133 -0
- package/dist/controls/combo-box/combo-box.js +680 -0
- package/dist/controls/command-modal/command-modal.css +226 -0
- package/dist/controls/command-modal/command-modal.d.ts +42 -0
- package/dist/controls/command-modal/command-modal.js +315 -0
- package/dist/controls/disclosure/disclosure.css +162 -0
- package/dist/controls/disclosure/disclosure.d.ts +37 -0
- package/dist/controls/disclosure/disclosure.js +207 -0
- package/dist/controls/field/field.css +140 -0
- package/dist/controls/field/field.d.ts +27 -0
- package/dist/controls/field/field.js +228 -0
- package/dist/controls/form-provider/form-provider.css +40 -0
- package/dist/controls/form-provider/form-provider.d.ts +42 -0
- package/dist/controls/form-provider/form-provider.js +105 -0
- package/dist/controls/grid/grid.css +72 -0
- package/dist/controls/grid/grid.d.ts +60 -0
- package/dist/controls/grid/grid.js +56 -0
- package/dist/controls/icon/icon.css +37 -0
- package/dist/controls/icon/icon.d.ts +25 -0
- package/dist/controls/icon/icon.js +55 -0
- package/dist/controls/index.d.ts +57 -0
- package/dist/controls/index.js +136 -0
- package/dist/controls/ladder/ladder.css +89 -0
- package/dist/controls/ladder/ladder.d.ts +27 -0
- package/dist/controls/ladder/ladder.js +78 -0
- package/dist/controls/list/list.css +118 -0
- package/dist/controls/list/list.d.ts +84 -0
- package/dist/controls/list/list.js +48 -0
- package/dist/controls/menu/menu.css +195 -0
- package/dist/controls/menu/menu.d.ts +44 -0
- package/dist/controls/menu/menu.js +248 -0
- package/dist/controls/modal/modal.css +99 -0
- package/dist/controls/modal/modal.d.ts +61 -0
- package/dist/controls/modal/modal.js +155 -0
- package/dist/controls/popover/popover.css +83 -0
- package/dist/controls/popover/popover.d.ts +44 -0
- package/dist/controls/popover/popover.js +164 -0
- package/dist/controls/progress/progress.css +106 -0
- package/dist/controls/progress/progress.d.ts +28 -0
- package/dist/controls/progress/progress.js +80 -0
- package/dist/controls/radio/radio-group.css +84 -0
- package/dist/controls/radio/radio-group.d.ts +152 -0
- package/dist/controls/radio/radio-group.js +350 -0
- package/dist/controls/radio/radio.css +219 -0
- package/dist/controls/radio/radio.d.ts +19 -0
- package/dist/controls/radio/radio.js +75 -0
- package/dist/controls/ramp/ramp.css +75 -0
- package/dist/controls/ramp/ramp.d.ts +29 -0
- package/dist/controls/ramp/ramp.js +72 -0
- package/dist/controls/row/row.css +152 -0
- package/dist/controls/row/row.d.ts +95 -0
- package/dist/controls/row/row.js +45 -0
- package/dist/controls/segment/segment.css +66 -0
- package/dist/controls/segment/segment.d.ts +3 -0
- package/dist/controls/segment/segment.js +26 -0
- package/dist/controls/segmented-control/segmented-control.css +189 -0
- package/dist/controls/segmented-control/segmented-control.d.ts +20 -0
- package/dist/controls/segmented-control/segmented-control.js +64 -0
- package/dist/controls/select/select.css +467 -0
- package/dist/controls/select/select.d.ts +147 -0
- package/dist/controls/select/select.js +538 -0
- package/dist/controls/slider/slider.css +231 -0
- package/dist/controls/slider/slider.d.ts +111 -0
- package/dist/controls/slider/slider.js +60 -0
- package/dist/controls/slider-multi/slider-multi.css +197 -0
- package/dist/controls/slider-multi/slider-multi.d.ts +149 -0
- package/dist/controls/slider-multi/slider-multi.js +380 -0
- package/dist/controls/sparkline/sparkline-math.d.ts +23 -0
- package/dist/controls/sparkline/sparkline-math.js +79 -0
- package/dist/controls/sparkline/sparkline.css +61 -0
- package/dist/controls/sparkline/sparkline.d.ts +27 -0
- package/dist/controls/sparkline/sparkline.js +74 -0
- package/dist/controls/split/constrain.d.ts +44 -0
- package/dist/controls/split/constrain.js +126 -0
- package/dist/controls/split/split-pane.css +63 -0
- package/dist/controls/split/split-pane.d.ts +49 -0
- package/dist/controls/split/split-pane.js +42 -0
- package/dist/controls/split/split.css +127 -0
- package/dist/controls/split/split.d.ts +42 -0
- package/dist/controls/split/split.js +364 -0
- package/dist/controls/stat/stat-model.d.ts +22 -0
- package/dist/controls/stat/stat-model.js +69 -0
- package/dist/controls/stat/stat.css +101 -0
- package/dist/controls/stat/stat.d.ts +30 -0
- package/dist/controls/stat/stat.js +73 -0
- package/dist/controls/status-stream/status-stream.css +151 -0
- package/dist/controls/status-stream/status-stream.d.ts +108 -0
- package/dist/controls/status-stream/status-stream.js +417 -0
- package/dist/controls/swatch/swatch.css +66 -0
- package/dist/controls/swatch/swatch.d.ts +28 -0
- package/dist/controls/swatch/swatch.js +74 -0
- package/dist/controls/swiper/swiper-item.css +17 -0
- package/dist/controls/swiper/swiper-item.d.ts +31 -0
- package/dist/controls/swiper/swiper-item.js +47 -0
- package/dist/controls/swiper/swiper-label.css +10 -0
- package/dist/controls/swiper/swiper-label.d.ts +4 -0
- package/dist/controls/swiper/swiper-label.js +20 -0
- package/dist/controls/swiper/swiper-paddles.css +26 -0
- package/dist/controls/swiper/swiper-paddles.d.ts +10 -0
- package/dist/controls/swiper/swiper-paddles.js +62 -0
- package/dist/controls/swiper/swiper-pagination.css +60 -0
- package/dist/controls/swiper/swiper-pagination.d.ts +31 -0
- package/dist/controls/swiper/swiper-pagination.js +78 -0
- package/dist/controls/swiper/swiper.css +153 -0
- package/dist/controls/swiper/swiper.d.ts +158 -0
- package/dist/controls/swiper/swiper.js +659 -0
- package/dist/controls/switch/switch.css +194 -0
- package/dist/controls/switch/switch.d.ts +5 -0
- package/dist/controls/switch/switch.js +18 -0
- package/dist/controls/table/table-model.d.ts +43 -0
- package/dist/controls/table/table-model.js +124 -0
- package/dist/controls/table/table.css +90 -0
- package/dist/controls/table/table.d.ts +29 -0
- package/dist/controls/table/table.js +178 -0
- package/dist/controls/tabs/tab-panel.d.ts +10 -0
- package/dist/controls/tabs/tab-panel.js +89 -0
- package/dist/controls/tabs/tab.d.ts +26 -0
- package/dist/controls/tabs/tab.js +67 -0
- package/dist/controls/tabs/tabs.css +181 -0
- package/dist/controls/tabs/tabs.d.ts +61 -0
- package/dist/controls/tabs/tabs.js +176 -0
- package/dist/controls/text/href.d.ts +26 -0
- package/dist/controls/text/href.js +48 -0
- package/dist/controls/text/text.css +328 -0
- package/dist/controls/text/text.d.ts +85 -0
- package/dist/controls/text/text.js +273 -0
- package/dist/controls/text-field/text-field.css +498 -0
- package/dist/controls/text-field/text-field.d.ts +226 -0
- package/dist/controls/text-field/text-field.js +905 -0
- package/dist/controls/textarea/textarea.css +251 -0
- package/dist/controls/textarea/textarea.d.ts +136 -0
- package/dist/controls/textarea/textarea.js +312 -0
- package/dist/controls/theme-provider/theme-provider.css +48 -0
- package/dist/controls/theme-provider/theme-provider.d.ts +59 -0
- package/dist/controls/theme-provider/theme-provider.js +40 -0
- package/dist/controls/timeline/timeline.css +33 -0
- package/dist/controls/timeline/timeline.d.ts +39 -0
- package/dist/controls/timeline/timeline.js +52 -0
- package/dist/controls/timeline-item/timeline-item.css +495 -0
- package/dist/controls/timeline-item/timeline-item.d.ts +79 -0
- package/dist/controls/timeline-item/timeline-item.js +360 -0
- package/dist/controls/toast/toast-region.css +56 -0
- package/dist/controls/toast/toast-region.d.ts +20 -0
- package/dist/controls/toast/toast-region.js +113 -0
- package/dist/controls/toast/toast.css +96 -0
- package/dist/controls/toast/toast.d.ts +28 -0
- package/dist/controls/toast/toast.js +191 -0
- package/dist/controls/toolbar/toolbar.css +125 -0
- package/dist/controls/toolbar/toolbar.d.ts +108 -0
- package/dist/controls/toolbar/toolbar.js +68 -0
- package/dist/controls/tooltip/tooltip.css +80 -0
- package/dist/controls/tooltip/tooltip.d.ts +57 -0
- package/dist/controls/tooltip/tooltip.js +205 -0
- package/dist/descriptor/component-descriptor.d.ts +112 -0
- package/dist/descriptor/component-descriptor.js +492 -0
- package/dist/descriptor/index.d.ts +1 -0
- package/dist/descriptor/index.js +5 -0
- package/dist/dom/container.d.ts +45 -0
- package/dist/dom/container.js +60 -0
- package/dist/dom/element.d.ts +98 -0
- package/dist/dom/element.js +221 -0
- package/dist/dom/form.d.ts +240 -0
- package/dist/dom/form.js +399 -0
- package/dist/dom/index.d.ts +10 -0
- package/dist/dom/index.js +31 -0
- package/dist/dom/props.d.ts +56 -0
- package/dist/dom/props.js +231 -0
- package/dist/dom/repeat.d.ts +10 -0
- package/dist/dom/repeat.js +202 -0
- package/dist/dom/template.d.ts +161 -0
- package/dist/dom/template.js +634 -0
- package/dist/dom/watch.d.ts +11 -0
- package/dist/dom/watch.js +82 -0
- package/dist/foundation-styles.css +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/reactive/graph.d.ts +65 -0
- package/dist/reactive/graph.js +310 -0
- package/dist/reactive/index.d.ts +3 -0
- package/dist/reactive/index.js +4 -0
- package/dist/reactive/scheduler.d.ts +13 -0
- package/dist/reactive/scheduler.js +49 -0
- package/dist/traits/area-drag.d.ts +12 -0
- package/dist/traits/area-drag.js +70 -0
- package/dist/traits/form-registry.d.ts +36 -0
- package/dist/traits/form-registry.js +108 -0
- package/dist/traits/index.d.ts +24 -0
- package/dist/traits/index.js +19 -0
- package/dist/traits/overlay.d.ts +50 -0
- package/dist/traits/overlay.js +277 -0
- package/dist/traits/pane-resize.d.ts +26 -0
- package/dist/traits/pane-resize.js +103 -0
- package/dist/traits/press-activation.d.ts +11 -0
- package/dist/traits/press-activation.js +55 -0
- package/dist/traits/roving-focus.d.ts +52 -0
- package/dist/traits/roving-focus.js +214 -0
- package/dist/traits/scroll-fade.d.ts +28 -0
- package/dist/traits/scroll-fade.js +120 -0
- package/dist/traits/selection-commit.d.ts +30 -0
- package/dist/traits/selection-commit.js +146 -0
- package/dist/traits/tabbable.d.ts +12 -0
- package/dist/traits/tabbable.js +59 -0
- package/dist/traits/track-user-invalid.d.ts +36 -0
- package/dist/traits/track-user-invalid.js +52 -0
- package/dist/traits/value-codec.d.ts +120 -0
- package/dist/traits/value-codec.js +497 -0
- package/dist/traits/value-drag.d.ts +18 -0
- package/dist/traits/value-drag.js +84 -0
- package/package.json +263 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UIElement, type ReactiveProps } from '../../dom/index.js';
|
|
2
|
+
declare const props: {
|
|
3
|
+
glyph: import("../../index.js").PropConfig<string>;
|
|
4
|
+
label: {
|
|
5
|
+
reflect: true;
|
|
6
|
+
type: import("../../index.js").PropType<string>;
|
|
7
|
+
default: string;
|
|
8
|
+
attribute?: string | false;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export interface UIIconElement extends ReactiveProps<typeof props> {
|
|
12
|
+
}
|
|
13
|
+
export declare class UIIconElement extends UIElement {
|
|
14
|
+
static props: {
|
|
15
|
+
glyph: import("../../index.js").PropConfig<string>;
|
|
16
|
+
label: {
|
|
17
|
+
reflect: true;
|
|
18
|
+
type: import("../../index.js").PropType<string>;
|
|
19
|
+
default: string;
|
|
20
|
+
attribute?: string | false;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
protected connected(): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// icon.ts — UIIconElement, the Display-class icon-adapter consumer (LLD-C5, ADR-0065/0066). The
|
|
2
|
+
// declarative surface over `@agent-ui-kit/icons`: <ui-icon glyph="caret-down"> resolves the active pack's
|
|
3
|
+
// SVG body and injects it via `setIcon` (the cross-package edge the layering trip-wire admits — icons
|
|
4
|
+
// as a second lower-tier sibling, mirroring components → shared). Light-DOM, self-defining, no traits.
|
|
5
|
+
//
|
|
6
|
+
// Two props, two connected() effects — nothing else:
|
|
7
|
+
// • `glyph` — reacts ONLY to glyph (and re-runs setIcon on every change); empty clears the host. Live
|
|
8
|
+
// pack-swap reactivity is DEFERRED (ADR-0065 clause 4) — the registry exposes no subscribable
|
|
9
|
+
// signal, so an already-rendered <ui-icon> does not auto-update when a pack is swapped AFTER first
|
|
10
|
+
// render; re-setting `glyph` reflects a swap.
|
|
11
|
+
// • `label` — decorative by default (aria-hidden, no role); non-empty makes the icon MEANINGFUL
|
|
12
|
+
// (role=img + aria-label). ARIA via ElementInternals only — never a host attribute (the FACE rule),
|
|
13
|
+
// so aria-hidden is toggled through `internals.ariaHidden`, not `setAttribute`, and is explicitly
|
|
14
|
+
// CLEARED when a label is supplied (so a labelled icon is never simultaneously aria-hidden).
|
|
15
|
+
//
|
|
16
|
+
// `glyph` is typed `prop.string('')`, not `prop.enum(ICON_NAMES, ...)`, deliberately: the swappable-pack
|
|
17
|
+
// architecture means a consumer's own pack can register names beyond the shipped nine, so the prop stays
|
|
18
|
+
// an open string; the IconName cast happens only at the internal setIcon call (an unregistered name is a
|
|
19
|
+
// non-throwing `data-icon-missing` render, per resolve.ts).
|
|
20
|
+
//
|
|
21
|
+
// render() stays the inherited no-op — there is no template; `setIcon`/`replaceChildren` manage the host's
|
|
22
|
+
// only child imperatively (the fleet's existing imperative-injection idiom, ADR-0065 context).
|
|
23
|
+
import { UIElement, prop } from "../../dom/index.js";
|
|
24
|
+
import { setIcon } from '@agent-ui-kit/icons';
|
|
25
|
+
const props = {
|
|
26
|
+
glyph: prop.string(''), // an IconName; empty → renders nothing (clears the host). Renamed from `name` (TKT-0069 item 1 ruling: `name` is reserved fleet-wide for the FORM name; the A2UI catalog keeps the wire field `name`, mapped in its bespoke factory)
|
|
27
|
+
label: { ...prop.string(''), reflect: true }, // non-empty → meaningful: role=img + aria-label; empty → decorative (aria-hidden)
|
|
28
|
+
};
|
|
29
|
+
export class UIIconElement extends UIElement {
|
|
30
|
+
static props = props;
|
|
31
|
+
connected() {
|
|
32
|
+
// glyph effect: (re)inject the active pack's svg on glyph change; an empty glyph clears the host.
|
|
33
|
+
this.effect(() => {
|
|
34
|
+
if (this.glyph)
|
|
35
|
+
setIcon(this, this.glyph);
|
|
36
|
+
else
|
|
37
|
+
this.replaceChildren();
|
|
38
|
+
});
|
|
39
|
+
// label effect: decorative (aria-hidden) vs meaningful (role=img + aria-label). ElementInternals only.
|
|
40
|
+
this.effect(() => {
|
|
41
|
+
if (this.label) {
|
|
42
|
+
this.internals.role = 'img';
|
|
43
|
+
this.internals.ariaLabel = this.label;
|
|
44
|
+
this.internals.ariaHidden = null;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.internals.role = null;
|
|
48
|
+
this.internals.ariaLabel = null;
|
|
49
|
+
this.internals.ariaHidden = 'true';
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (!customElements.get('ui-icon'))
|
|
55
|
+
customElements.define('ui-icon', UIIconElement); // idempotent self-define
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export * from './button/button.js';
|
|
2
|
+
export * from './text-field/text-field.js';
|
|
3
|
+
export * from './textarea/textarea.js';
|
|
4
|
+
export * from './text/text.js';
|
|
5
|
+
export * from './icon/icon.js';
|
|
6
|
+
export * from './checkbox/checkbox.js';
|
|
7
|
+
export * from './switch/switch.js';
|
|
8
|
+
export * from './radio/radio.js';
|
|
9
|
+
export * from './radio/radio-group.js';
|
|
10
|
+
export * from './slider/slider.js';
|
|
11
|
+
export * from './slider-multi/slider-multi.js';
|
|
12
|
+
export * from './segment/segment.js';
|
|
13
|
+
export * from './segmented-control/segmented-control.js';
|
|
14
|
+
export * from './row/row.js';
|
|
15
|
+
export * from './column/column.js';
|
|
16
|
+
export * from './list/list.js';
|
|
17
|
+
export * from './grid/grid.js';
|
|
18
|
+
export * from './card/card.js';
|
|
19
|
+
export * from './tabs/tabs.js';
|
|
20
|
+
export * from './modal/modal.js';
|
|
21
|
+
export * from './toolbar/toolbar.js';
|
|
22
|
+
export * from './popover/popover.js';
|
|
23
|
+
export * from './tooltip/tooltip.js';
|
|
24
|
+
export * from './menu/menu.js';
|
|
25
|
+
export * from './select/select.js';
|
|
26
|
+
export * from './combo-box/combo-box.js';
|
|
27
|
+
export * from './calendar/calendar.js';
|
|
28
|
+
export * from './color-picker/color-picker.js';
|
|
29
|
+
export * from './field/field.js';
|
|
30
|
+
export * from './form-provider/form-provider.js';
|
|
31
|
+
export * from './theme-provider/theme-provider.js';
|
|
32
|
+
export * from './sparkline/sparkline.js';
|
|
33
|
+
export * from './bar-chart/bar-chart.js';
|
|
34
|
+
export * from './table/table.js';
|
|
35
|
+
export * from './stat/stat.js';
|
|
36
|
+
export * from './badge/badge.js';
|
|
37
|
+
export * from './code/code.js';
|
|
38
|
+
export * from './disclosure/disclosure.js';
|
|
39
|
+
export * from './swatch/swatch.js';
|
|
40
|
+
export * from './ramp/ramp.js';
|
|
41
|
+
export * from './ladder/ladder.js';
|
|
42
|
+
export * from './progress/progress.js';
|
|
43
|
+
export * from './avatar/avatar.js';
|
|
44
|
+
export * from './attachment/attachment.js';
|
|
45
|
+
export * from './toast/toast.js';
|
|
46
|
+
export * from './toast/toast-region.js';
|
|
47
|
+
export * from './split/split.js';
|
|
48
|
+
export * from './split/split-pane.js';
|
|
49
|
+
export * from './timeline-item/timeline-item.js';
|
|
50
|
+
export * from './timeline/timeline.js';
|
|
51
|
+
export * from './status-stream/status-stream.js';
|
|
52
|
+
export * from './swiper/swiper.js';
|
|
53
|
+
export * from './swiper/swiper-item.js';
|
|
54
|
+
export * from './swiper/swiper-pagination.js';
|
|
55
|
+
export * from './swiper/swiper-paddles.js';
|
|
56
|
+
export * from './swiper/swiper-label.js';
|
|
57
|
+
export * from './command-modal/command-modal.js';
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// components — the self-defining ui-* FACE-control family barrel (ADR-0003). Importing this module pulls in
|
|
2
|
+
// every control, each of which `customElements.define`s its tag as a top-level side effect, so importing the
|
|
3
|
+
// package `./components` entry registers the whole family in one line. Re-exporting each control's module ALSO
|
|
4
|
+
// surfaces its element class (e.g. UIButtonElement, UITextFieldElement, UIRowElement, UICardElement) for typed
|
|
5
|
+
// references. Layer-4 barrel: composes the controls layer only; never reaches into kernel internals.
|
|
6
|
+
//
|
|
7
|
+
// Today's family:
|
|
8
|
+
// • form controls — ui-button (G5), ui-text-field (G6).
|
|
9
|
+
// • display controls — ui-text (ADR-0025), the Display-class text primitive (typographic scale leaf);
|
|
10
|
+
// ui-icon (ADR-0065/0066), the icon-adapter's declarative consumer (imports @agent-ui-kit/icons).
|
|
11
|
+
// • Indicator controls — Wave 1 (ADR-0041/0042): ui-checkbox · ui-switch · ui-radio · ui-radio-group.
|
|
12
|
+
// All four extend UIIndicatorElement (boolean form value + checked-state machine + pressActivation
|
|
13
|
+
// toggle); ui-radio-group extends UIFormElement directly and owns the group value + rovingFocus.
|
|
14
|
+
// • the G9 container/layout family (extends the dom UIContainerElement surface base, NOT form-associated):
|
|
15
|
+
// the flex/grid layout primitives ui-row · ui-column · ui-list · ui-grid; the compound ui-card (whose
|
|
16
|
+
// family entry transitively self-defines its region sub-elements ui-card-header/-content/-footer); the
|
|
17
|
+
// compound ui-tabs (transitively self-defines ui-tab/-tab-panel); and ui-modal (native <dialog>).
|
|
18
|
+
// • Coordination controls — G7 (ADR-0050/ADR-0051): ui-field (the label/description/error wrapper around
|
|
19
|
+
// ONE slotted form control) and ui-form-provider (the discovery/aggregation layer over UIFormElement
|
|
20
|
+
// descendants). Neither carries a form value of its own — both extend UIElement directly.
|
|
21
|
+
// • Chart family — Wave M1 (ADR-0107, chart-family.lld.md): ui-sparkline (series-shape mark) and
|
|
22
|
+
// ui-bar-chart (magnitude-comparison bar list). Both Display-class, axis-free, non-interactive,
|
|
23
|
+
// non-form-associated leaves — extend UIElement directly, tier=display, no [size]/[scale] geometry row.
|
|
24
|
+
// • Report family — Wave M1 (ADR-0111, report-family.lld.md): ui-table (native <table>, scroll-preserving
|
|
25
|
+
// re-render), ui-stat (metric tile, direction-as-text delta), ui-badge (compact-realm intent badge). All
|
|
26
|
+
// Display-class, non-interactive, non-form-associated leaves — extend UIElement directly.
|
|
27
|
+
// • Content family — Wave M1 (ADR-0113, content-family.lld.md): ui-code (zero-machinery verbatim code
|
|
28
|
+
// leaf, host-as-content) and ui-disclosure (native <details>/<summary> fold, Pattern-class). The
|
|
29
|
+
// hyperlink capability (`as='a'`/`href`) is an in-place extension of ui-text (exported above).
|
|
30
|
+
// A compound's main `.ts` imports its sub-element modules so `export * from './{family}/{family}.ts'` here
|
|
31
|
+
// registers the WHOLE family — importing the barrel self-defines all ~20+ tags.
|
|
32
|
+
export * from "./button/button.js";
|
|
33
|
+
export * from "./text-field/text-field.js";
|
|
34
|
+
export * from "./textarea/textarea.js"; // ui-textarea (ADR-0134) — the multi-line FACE sibling of ui-text-field
|
|
35
|
+
export * from "./text/text.js";
|
|
36
|
+
export * from "./icon/icon.js"; // ui-icon (ADR-0065/0066) — the icon-adapter's declarative consumer surface
|
|
37
|
+
// Indicator controls — Wave 1 (ADR-0041/0042).
|
|
38
|
+
export * from "./checkbox/checkbox.js";
|
|
39
|
+
export * from "./switch/switch.js";
|
|
40
|
+
export * from "./radio/radio.js"; // self-defines ui-radio
|
|
41
|
+
export * from "./radio/radio-group.js"; // self-defines ui-radio-group
|
|
42
|
+
// Range controls — Wave 2 (ADR-0042 Range half): single + dual-thumb slider.
|
|
43
|
+
export * from "./slider/slider.js";
|
|
44
|
+
export * from "./slider-multi/slider-multi.js";
|
|
45
|
+
// Pattern controls — ADR-0095 (supersedes ADR-0086's ui-radio-group[variant='segmented'], hard cutover):
|
|
46
|
+
// the standalone segmented control. segmented-control.ts imports segment.ts as a side effect (both tags
|
|
47
|
+
// self-define together), but each still gets its own `export *` line here — the barrel↔exports-map
|
|
48
|
+
// three-way bijection (barrels.test.ts T4) requires one per public `./controls/{name}` entry, and
|
|
49
|
+
// `segment`/`segmented-control` live in SEPARATE folders (the family-coherence naming trip-wire's
|
|
50
|
+
// `name === folder || name.startsWith(folder + '-')` rule has no prefix relationship between them, unlike
|
|
51
|
+
// the radio/radio-group one-folder precedent — see segmented-control.ts's own note).
|
|
52
|
+
export * from "./segment/segment.js";
|
|
53
|
+
export * from "./segmented-control/segmented-control.js";
|
|
54
|
+
// G9 container / layout family — surface axes + the shared flex grammar (ADR-0015/0016).
|
|
55
|
+
export * from "./row/row.js";
|
|
56
|
+
export * from "./column/column.js";
|
|
57
|
+
export * from "./list/list.js";
|
|
58
|
+
export * from "./grid/grid.js";
|
|
59
|
+
export * from "./card/card.js"; // transitively self-defines ui-card-header / -content / -footer
|
|
60
|
+
export * from "./tabs/tabs.js"; // transitively self-defines ui-tab / -tab-panel
|
|
61
|
+
export * from "./modal/modal.js";
|
|
62
|
+
export * from "./toolbar/toolbar.js"; // Pattern-class action bar (ADR-0121) — role=toolbar + roving focus, posture via elevation/brightness
|
|
63
|
+
// Overlay controls — Wave 4 (ADR-0043 / overlay-controller.lld): the `overlay` controller composed into five
|
|
64
|
+
// controls. Non-form disclosure/hover/action overlays (UIElement hosts) + the two form-associated pickers
|
|
65
|
+
// (UIFormElement + a role=listbox popup). All emit the family two-way-`open` contract (toggle/close, ADR-0019).
|
|
66
|
+
export * from "./popover/popover.js"; // disclosure overlay — proves the overlay controller
|
|
67
|
+
export * from "./tooltip/tooltip.js"; // hover/focus overlay (popover=manual, never steals focus)
|
|
68
|
+
export * from "./menu/menu.js"; // action overlay — rovingFocus over [role=menuitem], commit→select
|
|
69
|
+
export * from "./select/select.js"; // form-associated single-select (overlay + roving + selectionCommit)
|
|
70
|
+
export * from "./combo-box/combo-box.js"; // form-associated filter combobox (overlay + active-descendant)
|
|
71
|
+
// Picker controls — Wave 5B (ADR-0048): standalone month-grid date picker; also the popup body
|
|
72
|
+
// for ui-text-field type=date (lazily imported there in slice 5B-3).
|
|
73
|
+
export * from "./calendar/calendar.js"; // form-associated date picker (bespoke 2D grid, UIFormElement base)
|
|
74
|
+
// ADR-0123 — ui-color-picker, the OKLCH-internal 2-axis color-input control (color-picker.lld.md): a
|
|
75
|
+
// Pattern-class UIFormElement composite (pad + composed ui-slider channels + ui-text-field readout +
|
|
76
|
+
// ui-swatch preview). Also the popup body for ui-text-field type=color (lazily imported there, LLD-C9),
|
|
77
|
+
// the ADR-0048 type=date→ui-calendar seam verbatim.
|
|
78
|
+
export * from "./color-picker/color-picker.js";
|
|
79
|
+
// Coordination controls — G7 (ADR-0050/ADR-0051): the labelling wrapper + the aggregation/discovery provider.
|
|
80
|
+
export * from "./field/field.js"; // the label/description/error wrapper (LLD-C4)
|
|
81
|
+
export * from "./form-provider/form-provider.js"; // also surfaces FormSubmitDetail (LLD-C7)
|
|
82
|
+
// Coordination/carrier controls — ADR-0117: the fleet's SECOND pure UIElement coordination primitive (after
|
|
83
|
+
// ui-form-provider). Establishes a color-scheme subtree + reflects scale/density/theme as pure carriers.
|
|
84
|
+
export * from "./theme-provider/theme-provider.js";
|
|
85
|
+
// Chart family — Wave M1 (ADR-0107, chart-family.lld.md): Display-class, axis-free chart marks. Neither is
|
|
86
|
+
// form-associated or interactive (extends UIElement directly, tier=display, no [size]/[scale] geometry row).
|
|
87
|
+
export * from "./sparkline/sparkline.js"; // series-shape mark (LLD-C1/C2/C3)
|
|
88
|
+
export * from "./bar-chart/bar-chart.js"; // magnitude-comparison bar list (LLD-C4/C5/C6)
|
|
89
|
+
// Report family — Wave M1 (ADR-0111, report-family.lld.md): the real native <table>, the metric tile, and
|
|
90
|
+
// the compact-realm intent badge. All Display-class, non-interactive, non-form-associated leaves.
|
|
91
|
+
export * from "./table/table.js"; // scroll-preserving static data table (LLD-C1/C2/C3)
|
|
92
|
+
export * from "./stat/stat.js"; // metric tile, direction-as-text delta (LLD-C4/C5/C6)
|
|
93
|
+
export * from "./badge/badge.js"; // compact-realm intent badge (LLD-C7/C8)
|
|
94
|
+
// Content family — Wave M1 (ADR-0113, content-family.lld.md): the zero-machinery code leaf and the native
|
|
95
|
+
// <details>/<summary> disclosure. (The ui-text hyperlink extension lives in ./text/text.ts, exported above.)
|
|
96
|
+
export * from "./code/code.js"; // verbatim code leaf, host-as-content (LLD-C5/C6/C7)
|
|
97
|
+
export * from "./disclosure/disclosure.js"; // native details/summary fold (LLD-C8/C9/C10)
|
|
98
|
+
// Token-surface family — M1 (ADR-0118, token-surfaces.lld.md): show-never-edit color/dimension primitives.
|
|
99
|
+
// All three Display-class, non-interactive, non-form-associated leaves — extend UIElement directly, tier=
|
|
100
|
+
// display, no [size]/[scale] geometry row. Share the DOM-free value-lane helper `_token-surface/token-surface.ts`.
|
|
101
|
+
export * from "./swatch/swatch.js"; // color-identity leaf, role=img + composed name (LLD-C2/C3)
|
|
102
|
+
export * from "./ramp/ramp.js"; // ordered color series, role=list (LLD-C4/C5)
|
|
103
|
+
export * from "./ladder/ladder.js"; // labeled dimensional tiers, literal-length bars, role=list (LLD-C6/C7)
|
|
104
|
+
// Feed family — Wave M1 (ADR-0112, feed-family.lld.md): agent-activity primitives. All Display/Indicator-
|
|
105
|
+
// class, non-form-associated leaves except the toast pair (pattern/layout, no catalog row — ADR-0112 cl.6).
|
|
106
|
+
export * from "./progress/progress.js"; // thin-rail progress bar (LLD-C1)
|
|
107
|
+
export * from "./avatar/avatar.js"; // compact identity mark (LLD-C2/C3)
|
|
108
|
+
export * from "./attachment/attachment.js"; // FilePart-aligned file card, metadata surface only (LLD-C4/C5)
|
|
109
|
+
export * from "./toast/toast.js"; // transient notification card (LLD-C7)
|
|
110
|
+
export * from "./toast/toast-region.js"; // toast's top-layer host, same-folder sibling (LLD-C8)
|
|
111
|
+
// M4 Phase 1 — the split primitive (ADR-0120 cl.2, app-surfaces-m4.lld.md LLD-C1): a Container/layout
|
|
112
|
+
// control (tier: layout, sibling to ui-row/-column/-grid) — one folder, TWO real components (the
|
|
113
|
+
// radio/radio-group precedent): ui-split (the N-pane resizable container) + ui-split-pane (the generic
|
|
114
|
+
// pane child, own descriptor/contract per ADR-0080's radio-group special case).
|
|
115
|
+
export * from "./split/split.js";
|
|
116
|
+
export * from "./split/split-pane.js";
|
|
117
|
+
// Timeline family — ADR-0122 (timeline-family.lld.md): a three-tag event-rail family — the shared inert
|
|
118
|
+
// visual atom (ui-timeline-item), its durable authored-children host (ui-timeline, role=list), and its
|
|
119
|
+
// live imperatively-fed sibling (ui-status-stream, role=log). The item lands first — both hosts depend on it.
|
|
120
|
+
export * from "./timeline-item/timeline-item.js"; // the shared marker+content+detail rail row (F1/F2/F3/F6)
|
|
121
|
+
export * from "./timeline/timeline.js"; // the durable host — authored children, static (F1/F6)
|
|
122
|
+
export * from "./status-stream/status-stream.js"; // the live host — append/update/finalize, tail-follow (F4)
|
|
123
|
+
// ADR-0124 — the ui-swiper family: a CSS-native scroll-snap carousel (swiper-family.lld.md). swiper.ts
|
|
124
|
+
// imports the four leaf modules (registering all five family tags on its own import), but each of the
|
|
125
|
+
// five carries its own `{name}.md` descriptor (LLD §10 — unlike ui-tab/ui-tab-panel, which have none), so
|
|
126
|
+
// every one gets its own barrel export line too (the C1 lifecycle bijection, family-coherence.test.ts) —
|
|
127
|
+
// a harmless re-export of an already-registered module, and it surfaces each leaf's class at the barrel.
|
|
128
|
+
export * from "./swiper/swiper.js";
|
|
129
|
+
export * from "./swiper/swiper-item.js";
|
|
130
|
+
export * from "./swiper/swiper-pagination.js";
|
|
131
|
+
export * from "./swiper/swiper-paddles.js";
|
|
132
|
+
export * from "./swiper/swiper-label.js";
|
|
133
|
+
// ADR-0125 — ui-command-modal, the CMD-K command palette (command-modal.lld.md): a Pattern-class coordinator
|
|
134
|
+
// that nests a ui-modal for the surface and re-derives ui-combo-box's active-descendant filter. Permanently
|
|
135
|
+
// catalog-excluded (app-owner launcher chrome, F8) — still a fleet member, exported like any other control.
|
|
136
|
+
export * from "./command-modal/command-modal.js";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* ladder.css — ui-ladder, the Display-class labeled-dimensional-tiers leaf (LLD-C7, token-surfaces.lld.md
|
|
2
|
+
* §3.3; SPEC-R10/R13/R14/R15/R16). Two clearly-SECTIONED blocks:
|
|
3
|
+
*
|
|
4
|
+
* [1] TOKEN BLOCK — `:where(ui-ladder)` (specificity 0,0,0) declares the `--ui-ladder-*` chain: the
|
|
5
|
+
* whole-shape floor (SPEC-R13 AC1), bar THICKNESS (density-invariant mark geometry), the fill ink
|
|
6
|
+
* (>=3:1 vs surface — WCAG 1.4.11), and the density-RESPONSIVE row/column rhythm (rides `--md-sys-space`
|
|
7
|
+
* × `[density]` for free, the `ui-bar-chart` precedent).
|
|
8
|
+
* [2] STYLES BLOCK — `@scope (ui-ladder)` consumes ONLY `--ui-ladder-*` (∪ the shared `--md-sys-color-*`/
|
|
9
|
+
* `--md-sys-typescale-*` namespaces). Display-class (SPEC-R16): no `[size]`/`[scale]` row.
|
|
10
|
+
*
|
|
11
|
+
* The literal-length ruling (SPEC-R10): `inline-size: min(100%, var(--_mag, 0px))` renders each tier at its
|
|
12
|
+
* REAL length, capped to the track — a deliberate departure from `ui-bar-chart`'s normalized proportion math
|
|
13
|
+
* (ADR-0118 cl.2/3: a ladder has no math module, a dimensional value already IS a renderable length). The
|
|
14
|
+
* `var(--_mag, 0px)` fallback is the zero-bar floor for BOTH the LLD-C6 non-length route (`--_mag` set to
|
|
15
|
+
* `0px` directly) AND an undefined `--var` (whose `var(--…)` substitution is guaranteed-invalid, so
|
|
16
|
+
* `var(--_mag, 0px)` genuinely falls to `0px`) — SPEC-R11's unified no-silent-state rule.
|
|
17
|
+
*
|
|
18
|
+
* Rows are real `role="listitem"` SUBGRID children (NOT `display: contents`, whose role-semantics engine-bug
|
|
19
|
+
* history the fleet avoids — the `ui-bar-chart` precedent).
|
|
20
|
+
*
|
|
21
|
+
* RTL is free (SPEC-R15): logical grid + `inline-size` mirror under `dir="rtl"` — no physical property
|
|
22
|
+
* anywhere in this file. WHCM (SPEC-R14): the bar paints `CanvasText` (a system ink is never forced away) —
|
|
23
|
+
* magnitude still travels by length + the printed value.
|
|
24
|
+
*
|
|
25
|
+
* Standalone stylesheet — linked via the component-styles barrel; NEVER injected from ladder.ts
|
|
26
|
+
* (behaviour-only `.ts`, no runtime style injection — plan §2).
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/* ════════════════ [1] TOKEN BLOCK — :where(ui-ladder) declares --ui-ladder-* ════════════════ */
|
|
30
|
+
|
|
31
|
+
:where(ui-ladder) {
|
|
32
|
+
--ui-ladder-min-inline-size: 16em; /* the whole-shape floor */
|
|
33
|
+
--ui-ladder-bar-size: 0.75rem; /* bar THICKNESS — density-invariant */
|
|
34
|
+
--ui-ladder-bar-radius: 2px;
|
|
35
|
+
--ui-ladder-bar-ink: var(--md-sys-color-primary); /* the magnitude fill — >=3:1 vs surface (WCAG 1.4.11) */
|
|
36
|
+
--ui-ladder-row-gap: var(--md-sys-space-sm); /* rides [density] for free (ADR-0103) */
|
|
37
|
+
--ui-ladder-col-gap: var(--md-sys-space-sm);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ════════════════ [2] STYLES BLOCK — @scope (ui-ladder) consumes ONLY --ui-ladder-* ════════════════ */
|
|
41
|
+
|
|
42
|
+
@scope (ui-ladder) {
|
|
43
|
+
:scope {
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-columns: fit-content(30%) 1fr auto;
|
|
46
|
+
column-gap: var(--ui-ladder-col-gap);
|
|
47
|
+
row-gap: var(--ui-ladder-row-gap);
|
|
48
|
+
align-items: center;
|
|
49
|
+
min-inline-size: var(--ui-ladder-min-inline-size);
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
52
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:scope [role='listitem'] {
|
|
56
|
+
display: grid;
|
|
57
|
+
grid-template-columns: subgrid;
|
|
58
|
+
grid-column: 1 / -1;
|
|
59
|
+
align-items: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:scope [data-part='label'] {
|
|
63
|
+
overflow-wrap: anywhere;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:scope [data-part='track'] {
|
|
67
|
+
display: block;
|
|
68
|
+
block-size: var(--ui-ladder-bar-size);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:scope [data-part='bar'] {
|
|
72
|
+
display: block;
|
|
73
|
+
block-size: 100%;
|
|
74
|
+
inline-size: min(100%, var(--_mag, 0px)); /* LITERAL length, track-capped — NO normalization (SPEC-R10) */
|
|
75
|
+
background: var(--ui-ladder-bar-ink);
|
|
76
|
+
border-radius: var(--ui-ladder-bar-radius);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:scope [data-part='value'] {
|
|
80
|
+
text-align: end;
|
|
81
|
+
font-variant-numeric: tabular-nums;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (forced-colors: active) {
|
|
85
|
+
:scope [data-part='bar'] {
|
|
86
|
+
background: CanvasText; /* a system ink is never forced away — magnitude still carries by length */
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UIElement, type ReactiveProps } from '../../dom/index.js';
|
|
2
|
+
import { type TokenEntry } from '../_token-surface/token-surface.js';
|
|
3
|
+
declare const props: {
|
|
4
|
+
tiers: import("../../index.js").PropConfig<TokenEntry[]>;
|
|
5
|
+
label: {
|
|
6
|
+
reflect: true;
|
|
7
|
+
type: import("../../index.js").PropType<string>;
|
|
8
|
+
default: string;
|
|
9
|
+
attribute?: string | false;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export interface UILadderElement extends ReactiveProps<typeof props> {
|
|
13
|
+
}
|
|
14
|
+
export declare class UILadderElement extends UIElement {
|
|
15
|
+
#private;
|
|
16
|
+
static props: {
|
|
17
|
+
tiers: import("../../index.js").PropConfig<TokenEntry[]>;
|
|
18
|
+
label: {
|
|
19
|
+
reflect: true;
|
|
20
|
+
type: import("../../index.js").PropType<string>;
|
|
21
|
+
default: string;
|
|
22
|
+
attribute?: string | false;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
protected connected(): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// ladder.ts — UILadderElement, the Display-class labeled-dimensional-tiers leaf (LLD-C6, token-surfaces.lld.md
|
|
2
|
+
// §3.3; SPEC-R9…R12; ADR-0118 cl.1/2/4). BEHAVIOUR + props + list-semantics ARIA + the component-built rows +
|
|
3
|
+
// self-define ONLY — the value-lane/hardening/length-routing logic lives in the shared
|
|
4
|
+
// `_token-surface/token-surface.ts` (LLD-C1), the row/bar geometry in ladder.css.
|
|
5
|
+
//
|
|
6
|
+
// A ladder is data, not decoration (ADR-0118 cl.4): the host carries `role=list` via `ElementInternals` (the
|
|
7
|
+
// `ui-bar-chart`/`ui-ramp` precedent) — never a host attribute — named by `label` when non-empty (SPEC-R12).
|
|
8
|
+
// Each rendered row is a real `role=listitem` element whose text content is its label plus the printed value;
|
|
9
|
+
// the magnitude bar (`[data-part='track']`) is `aria-hidden` — the printed value is the accessible datum either
|
|
10
|
+
// way, whether the bar rendered a real length or degraded to zero (the unified no-silent-state rule, SPEC-R11).
|
|
11
|
+
//
|
|
12
|
+
// The literal-length ruling (SPEC-R10, the deliberate ui-bar-chart departure): NO cross-tier normalization math
|
|
13
|
+
// — a tier's magnitude bar is its LITERAL length, capped to the track (`min(100%, …)`, ladder.css). Length
|
|
14
|
+
// VALIDITY is a rendering ROUTER, not a drop gate (SPEC-R11): `isRenderableLength` decides whether a tier's
|
|
15
|
+
// value drives a real bar or a `0px` zero-bar — the row + its printed value survive either way, so `cleanEntries`
|
|
16
|
+
// runs with NO further length-based filtering (only a genuinely malformed {label,value} shape drops an entry).
|
|
17
|
+
//
|
|
18
|
+
// Imports inward only (controls → dom + the sibling shared helper).
|
|
19
|
+
import { UIElement, prop } from "../../dom/index.js";
|
|
20
|
+
import { cleanEntries, cssValue, isRenderableLength, tokenEntriesProp } from "../_token-surface/token-surface.js";
|
|
21
|
+
const props = {
|
|
22
|
+
tiers: tokenEntriesProp(), // { label: string; value: string }[] · safe JSON codec (LLD-C1) · default []
|
|
23
|
+
label: { ...prop.string(''), reflect: true }, // the list's accessible name — SPEC-R12: unlabeled is legal, never a silent state
|
|
24
|
+
// NO `scheme` — dimensions are scheme-invariant (SPEC-R9).
|
|
25
|
+
};
|
|
26
|
+
export class UILadderElement extends UIElement {
|
|
27
|
+
static props = props;
|
|
28
|
+
connected() {
|
|
29
|
+
// List semantics (SPEC-R12, the `ui-bar-chart`/`ui-ramp` precedent) — a constant semantic role, set
|
|
30
|
+
// directly (not inside an effect); re-set on each connect (idempotent).
|
|
31
|
+
this.internals.role = 'list';
|
|
32
|
+
// The label effect — `label` names the list when non-empty; an unlabeled list is legal (SPEC-R12 AC2).
|
|
33
|
+
this.effect(() => {
|
|
34
|
+
this.internals.ariaLabel = this.label || null;
|
|
35
|
+
});
|
|
36
|
+
// The tiers effect (SPEC-R10/R11): whole-array derived state — every `tiers` change rebuilds the full
|
|
37
|
+
// light-DOM row list via one `replaceChildren`. `cleanEntries` runs again here (not just inside the
|
|
38
|
+
// codec) — the SPEC-R7-sibling property-write guard the codec alone cannot cover. NO length-based drop:
|
|
39
|
+
// a non-length tier value KEEPS its row (routed to a zero-length bar by `#rowNode`, SPEC-R11).
|
|
40
|
+
this.effect(() => {
|
|
41
|
+
const rendered = cleanEntries(this.tiers);
|
|
42
|
+
this.replaceChildren(...rendered.map((tier) => this.#rowNode(tier)));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Build one component-owned row: `label · track(aria-hidden) > bar · value` (LLD-C6's markup). The bar's
|
|
47
|
+
* magnitude rides the row-scoped custom property `--_mag`, set imperatively — ladder.css owns every paint
|
|
48
|
+
* decision, this method never writes a `width`. A resolvable length (SPEC-R11: `isRenderableLength` — a
|
|
49
|
+
* `--var` counts, its own resolution is the browser's job) passes through `cssValue` (the LOAD-BEARING
|
|
50
|
+
* transform, LLD-C6: a `--`-prefixed value becomes `var(--…)`, never a bare dashed-ident, which is invalid at
|
|
51
|
+
* computed-value time inside `min(100%, …)`); a non-length value (`"red"`) routes to a literal `'0px'` — the
|
|
52
|
+
* row + printed value survive either way (SPEC-R11 the unified no-silent-state rule). AT reading (SPEC-R12):
|
|
53
|
+
* the listitem's text content is `{label}{value}` (the two real text spans, the `ui-bar-chart`/`ui-ramp`
|
|
54
|
+
* listitem-text precedent); the track subtree is `aria-hidden` and text-free.
|
|
55
|
+
*/
|
|
56
|
+
#rowNode(tier) {
|
|
57
|
+
const item = document.createElement('div');
|
|
58
|
+
item.setAttribute('role', 'listitem');
|
|
59
|
+
const label = document.createElement('span');
|
|
60
|
+
label.setAttribute('data-part', 'label');
|
|
61
|
+
label.textContent = tier.label;
|
|
62
|
+
const bar = document.createElement('span');
|
|
63
|
+
bar.setAttribute('data-part', 'bar');
|
|
64
|
+
const mag = isRenderableLength(tier.value) ? cssValue(tier.value) : '0px';
|
|
65
|
+
bar.style.setProperty('--_mag', mag);
|
|
66
|
+
const track = document.createElement('span');
|
|
67
|
+
track.setAttribute('data-part', 'track');
|
|
68
|
+
track.setAttribute('aria-hidden', 'true');
|
|
69
|
+
track.appendChild(bar);
|
|
70
|
+
const value = document.createElement('span');
|
|
71
|
+
value.setAttribute('data-part', 'value');
|
|
72
|
+
value.textContent = tier.value;
|
|
73
|
+
item.append(label, track, value);
|
|
74
|
+
return item;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!customElements.get('ui-ladder'))
|
|
78
|
+
customElements.define('ui-ladder', UILadderElement); // idempotent self-define
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* list.css — ui-list, the single-file component stylesheet (ADR-0003). Two clearly-SECTIONED blocks:
|
|
2
|
+
*
|
|
3
|
+
* [1] TOKEN BLOCK — `:where(ui-list)` (specificity 0,0,0) DECLARES the `--ui-list-*` flex chain. Each
|
|
4
|
+
* `flexProps` literal-union (align/justify/gap/wrap — ADR-0016 cl.1) is mapped here to its CSS keyword
|
|
5
|
+
* (start→start, end→end, between→space-between, … — box-alignment dialect, ADR-0039) or to a `--md-sys-space` ladder step, via `[attr=value]`
|
|
6
|
+
* attribute selectors. The `--md-sys-space-*` layout-spacing ladder (the SHARED, density-responsive gap
|
|
7
|
+
* vocabulary — dimensions.css / ADR-0015 cl.4) is read ONLY here, on the declaration side — exactly as
|
|
8
|
+
* button.css reads the `--md-sys-color-*` colour roles only in its `:where()` token block.
|
|
9
|
+
* [2] STYLES BLOCK — `@scope (ui-list)` CONSUMES only `--ui-list-*` for its layout. `ui-list` is a
|
|
10
|
+
* `ui-column` SPECIALIZATION: `display:flex; flex-direction:column` (the vertical stack — the tag's
|
|
11
|
+
* identity, A2UI-faithful, ADR-0016 cl.2/3). No control height (geometry.md "Container/layout" class —
|
|
12
|
+
* spacing rides `--md-sys-space` × `[density]`, never `--md-sys-height-*`).
|
|
13
|
+
*
|
|
14
|
+
* Surface — NOT here. The role-pure surface seam (`--ui-container-bg`/`-tint` consumption, the
|
|
15
|
+
* `[elevation]`/`[brightness]` mapping) + the forced-colors surface survival are owned by the SHARED
|
|
16
|
+
* `controls/_surface/container.css` (ADR-0015), which lists `ui-list` among the surface-bearing tags.
|
|
17
|
+
* list.css therefore carries NO colour opinion and needs no forced-colors block — there is nothing of its own
|
|
18
|
+
* to protect (it owns layout only). `ui-list` establishes NO query container of its own (ADR-0100 — it is
|
|
19
|
+
* intrinsically sized, like every layout primitive, so it can never safely be one); a `ui-list` has no
|
|
20
|
+
* `@container` rule of its own anyway (its direction is fixed — always a column), so this only matters for
|
|
21
|
+
* children that might want to query — an externally-sized ancestor boundary provides that context, not the
|
|
22
|
+
* list.
|
|
23
|
+
*
|
|
24
|
+
* Standalone stylesheet — linked via the component-styles barrel (wired in s12, AFTER container.css); NEVER
|
|
25
|
+
* injected from list.ts (behaviour-only `.ts`, no runtime style injection — plan §2).
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/* ════════════════ [1] TOKEN BLOCK — :where(ui-list) declares --ui-list-* ════════════════ */
|
|
29
|
+
|
|
30
|
+
:where(ui-list) {
|
|
31
|
+
/* The flex chain — defaults are each `flexProps` prop's value, with the ADR-0030 column-parity override:
|
|
32
|
+
`align` defaults to `stretch` (the cross-axis inline default for a vertical stack — a list IS a column;
|
|
33
|
+
flexProps.align default stays `start` for row). A custom property holds the resolved CSS keyword;
|
|
34
|
+
`[attr=value]` repoints the NON-DEFAULT keywords below. A default is NOT reflected as an attribute
|
|
35
|
+
(ADR-0005), so the base token must carry the new default. */
|
|
36
|
+
--ui-list-align: stretch; /* align (cross-axis) → align-items: stretch (ADR-0030 flip start→stretch) */
|
|
37
|
+
--ui-list-justify: start; /* justify (main-axis distribution) → justify-content; box-alignment start (ADR-0039) */
|
|
38
|
+
--ui-list-gap: var(--md-sys-space-none); /* gap → a --md-sys-space ladder step (0 = no gap) */
|
|
39
|
+
--ui-list-wrap: nowrap; /* wrap → flex-wrap (boolean presence) */
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* align → align-items (stretch = the new default above; start is now a non-default needing its own repoint).
|
|
43
|
+
ADR-0030: `start` gains a repoint rule; the now-redundant `stretch` rule is removed (stretch = the base). */
|
|
44
|
+
:where(ui-list[align='start']) {
|
|
45
|
+
--ui-list-align: start; /* start is a non-default: the [align='start'] repoint (box-alignment start — ADR-0039) */
|
|
46
|
+
}
|
|
47
|
+
:where(ui-list[align='center']) {
|
|
48
|
+
--ui-list-align: center;
|
|
49
|
+
}
|
|
50
|
+
:where(ui-list[align='end']) {
|
|
51
|
+
--ui-list-align: end; /* box-alignment end (ADR-0039) */
|
|
52
|
+
}
|
|
53
|
+
:where(ui-list[align='baseline']) {
|
|
54
|
+
--ui-list-align: baseline;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* justify → justify-content (start is the default; between/around/evenly map to the space-* keywords) */
|
|
58
|
+
:where(ui-list[justify='center']) {
|
|
59
|
+
--ui-list-justify: center;
|
|
60
|
+
}
|
|
61
|
+
:where(ui-list[justify='end']) {
|
|
62
|
+
--ui-list-justify: end; /* box-alignment end (ADR-0039) */
|
|
63
|
+
}
|
|
64
|
+
:where(ui-list[justify='between']) {
|
|
65
|
+
--ui-list-justify: space-between;
|
|
66
|
+
}
|
|
67
|
+
:where(ui-list[justify='around']) {
|
|
68
|
+
--ui-list-justify: space-around;
|
|
69
|
+
}
|
|
70
|
+
:where(ui-list[justify='evenly']) {
|
|
71
|
+
--ui-list-justify: space-evenly;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* gap → the SHARED density-responsive --md-sys-space ladder (read only here, the declaration side). `none` is the
|
|
75
|
+
default above; each step is `calc(<base px> * var(--md-sys-density))`, so a subtree [density] re-multiplies the
|
|
76
|
+
list's row-gap (the one density-bearing quantity — the geometry smoke proves it CHANGES with [density]). */
|
|
77
|
+
:where(ui-list[gap='xs']) {
|
|
78
|
+
--ui-list-gap: var(--md-sys-space-xs);
|
|
79
|
+
}
|
|
80
|
+
:where(ui-list[gap='sm']) {
|
|
81
|
+
--ui-list-gap: var(--md-sys-space-sm);
|
|
82
|
+
}
|
|
83
|
+
:where(ui-list[gap='md']) {
|
|
84
|
+
--ui-list-gap: var(--md-sys-space-md);
|
|
85
|
+
}
|
|
86
|
+
:where(ui-list[gap='lg']) {
|
|
87
|
+
--ui-list-gap: var(--md-sys-space-lg);
|
|
88
|
+
}
|
|
89
|
+
:where(ui-list[gap='xl']) {
|
|
90
|
+
--ui-list-gap: var(--md-sys-space-xl);
|
|
91
|
+
}
|
|
92
|
+
:where(ui-list[gap='2xl']) {
|
|
93
|
+
--ui-list-gap: var(--md-sys-space-2xl);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* wrap → flex-wrap (boolean presence: present ⇒ wrap) */
|
|
97
|
+
:where(ui-list[wrap]) {
|
|
98
|
+
--ui-list-wrap: wrap;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ════════════════ [2] STYLES BLOCK — @scope (ui-list) consumes ONLY --ui-list-* ════════════════ */
|
|
102
|
+
|
|
103
|
+
@scope (ui-list) {
|
|
104
|
+
:scope {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column; /* the vertical stack — the list's identity (ADR-0016 cl.2/3) */
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
|
|
109
|
+
/* The flex mapping — every value reads the own `--ui-list-*` chain (role-pure; no raw --md-sys-space/--md-sys-color-*
|
|
110
|
+
leaks into the consumption, mirroring button.css's @scope hygiene). The surface background rides the
|
|
111
|
+
shared controls/_surface/container.css; NO `container-type` (ADR-0100 — ui-list is never a query
|
|
112
|
+
container). NO control height. */
|
|
113
|
+
align-items: var(--ui-list-align);
|
|
114
|
+
justify-content: var(--ui-list-justify);
|
|
115
|
+
gap: var(--ui-list-gap); /* the density-bearing quantity — rides --md-sys-space × [density] */
|
|
116
|
+
flex-wrap: var(--ui-list-wrap);
|
|
117
|
+
}
|
|
118
|
+
}
|