@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,47 @@
|
|
|
1
|
+
// swiper-item.ts — UISwiperItemElement, the slide of the ui-swiper family (swiper-family.lld.md LLD-C4 ·
|
|
2
|
+
// swiper-family.spec.md SPEC-R9 · ADR-0124). BEHAVIOUR + the coordinator-applied `labelAs` seam + self-define
|
|
3
|
+
// ONLY; geometry lives in swiper.css (the family's single sheet), the public contract in swiper-item.md.
|
|
4
|
+
//
|
|
5
|
+
// A `ui-swiper-item` is NOT a standalone control — it is a component-native ChildList child the owning
|
|
6
|
+
// `ui-swiper` coordinates (the `ui-tab` "regions = sub-elements" precedent). It extends the plain `UIElement`
|
|
7
|
+
// (it needs the protected `internals` for `role=group` + `aria-roledescription='slide'` + `aria-label`, none
|
|
8
|
+
// of which a sibling can reach), and owns no surface axes (not a `UIContainerElement` — swiper.css lists only
|
|
9
|
+
// `ui-swiper` in the surface seam). The host carries NO `role`/`aria-*` attribute — every ARIA fact rides
|
|
10
|
+
// `this.internals`. `render()` stays the inherited void: a slide's content is its light-DOM children, placed
|
|
11
|
+
// by swiper.css (host-as-content), never clobbered.
|
|
12
|
+
//
|
|
13
|
+
// `labelAs` is PUBLIC but coordinator-driven (the `ui-tab.setSelected` precedent): the owning `ui-swiper` holds
|
|
14
|
+
// the real/clone/count truth (a sibling cannot set another element's protected internals), so it pushes each
|
|
15
|
+
// REAL item's position label in. A clone (an inert, id-stripped `cloneNode` copy the coordinator creates in
|
|
16
|
+
// loop mode) is never labelled this way — it is marked `aria-hidden`/`inert` directly on the cloned node by
|
|
17
|
+
// the coordinator, not through this method. `controls → dom` is the allowed import direction.
|
|
18
|
+
import { UIElement } from "../../dom/element.js";
|
|
19
|
+
import { prop } from "../../dom/index.js";
|
|
20
|
+
const props = {
|
|
21
|
+
// `key` — the slide's optional STABLE identity (the agent's slide id), REFLECTED so the attribute mirrors
|
|
22
|
+
// it. ui-swiper resolves `active` against `key` first, then falls back to the real DOM index, so a
|
|
23
|
+
// `key`-less item is addressed positionally (the ui-tab `key` precedent, though ui-tab does not reflect —
|
|
24
|
+
// swiper-family.lld.md §3.1 is explicit that THIS one does).
|
|
25
|
+
key: { ...prop.string(), reflect: true }, // renamed from `value` (TKT-0069 item 1 ruling: `value` = the FACE form value, reserved)
|
|
26
|
+
};
|
|
27
|
+
export class UISwiperItemElement extends UIElement {
|
|
28
|
+
static props = props;
|
|
29
|
+
// No self-driven ARIA on connect — the coordinator (which alone knows the real/clone/count truth) applies
|
|
30
|
+
// role/roledescription/label via `labelAs` once it has captured this item. Overridden only to document the
|
|
31
|
+
// deliberate no-op (matches the LLD's "no self-driven ARIA on connect" contract, probed by descriptor/source
|
|
32
|
+
// trip-wires expecting zero customStates and no host role/aria-* attribute here).
|
|
33
|
+
connected() { }
|
|
34
|
+
/**
|
|
35
|
+
* Label this REAL slide (called by the owning `ui-swiper`, never a sibling — `internals` is protected).
|
|
36
|
+
* Sets `role=group`, `aria-roledescription='slide'`, and `aria-label` to the supplied position string
|
|
37
|
+
* (`"{n} of {realCount}"`, SPEC-R9/R11) — all via `ElementInternals`, never a host attribute. Idempotent:
|
|
38
|
+
* safe to call again with a new position string as the real-slide set shifts (resize/mutation rebuilds).
|
|
39
|
+
*/
|
|
40
|
+
labelAs(position) {
|
|
41
|
+
this.internals.role = 'group';
|
|
42
|
+
this.internals.ariaRoleDescription = 'slide';
|
|
43
|
+
this.internals.ariaLabel = position;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!customElements.get('ui-swiper-item'))
|
|
47
|
+
customElements.define('ui-swiper-item', UISwiperItemElement);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* swiper-label.css — ui-swiper-label's own sheet (ADR-0124 Consequences, the family-root resolution;
|
|
2
|
+
* swiper-family.lld.md LLD-C11/§7 REV). No `--ui-swiper-label-*` tokens of its own — display-only author
|
|
3
|
+
* text with no geometry law beyond inline flow. Standalone; never injected from a .ts (behaviour-only .ts,
|
|
4
|
+
* no runtime style injection — plan §2). */
|
|
5
|
+
|
|
6
|
+
@scope (ui-swiper-label) {
|
|
7
|
+
:scope {
|
|
8
|
+
display: inline;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// swiper-label.ts — UISwiperLabelElement, the accessible-name anchor of the ui-swiper family
|
|
2
|
+
// (swiper-family.lld.md LLD-C11 · swiper-family.spec.md SPEC-R12/R15 · ADR-0124 F3). EMPTY by design — the
|
|
3
|
+
// same posture as `ui-toast-region` (present for the fleet convention + the descriptor trip-wire's empty
|
|
4
|
+
// bijection), because ALL of its behaviour lives on the owning `ui-swiper`, never on this element itself:
|
|
5
|
+
//
|
|
6
|
+
// - the author's light-DOM text IS the carousel's accessible name (no re-rendering, no own ARIA);
|
|
7
|
+
// - the coordinator (`ui-swiper`) reads this element's `id` (assigning one if absent) and points its OWN
|
|
8
|
+
// region `aria-labelledby` at it via the internals element-reflection (`reflectAriaElements`,
|
|
9
|
+
// `ariaLabelledByElements`) — a sibling cannot set another element's protected internals, so the
|
|
10
|
+
// coordinator drives that wiring, not this class;
|
|
11
|
+
// - absent a `ui-swiper-label` anchor, the region falls back to `internals.ariaLabel = 'Carousel'`
|
|
12
|
+
// (swiper.ts's own concern, not this element's).
|
|
13
|
+
//
|
|
14
|
+
// `controls → dom` is the allowed import direction.
|
|
15
|
+
import { UIElement } from "../../dom/element.js";
|
|
16
|
+
export class UISwiperLabelElement extends UIElement {
|
|
17
|
+
static props = {};
|
|
18
|
+
}
|
|
19
|
+
if (!customElements.get('ui-swiper-label'))
|
|
20
|
+
customElements.define('ui-swiper-label', UISwiperLabelElement);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* swiper-paddles.css — ui-swiper-paddles's own sheet (ADR-0124 Consequences, the family-root resolution;
|
|
2
|
+
* swiper-family.lld.md LLD-C10/§7 REV). No `--ui-swiper-paddles-*` tokens of its own — each composed
|
|
3
|
+
* ui-button keeps its OWN geometry (icon-only square structure, default md size); this sheet contributes
|
|
4
|
+
* only the flex layout wrapping them + the default-stamped overlay placement. Standalone; never injected
|
|
5
|
+
* from a .ts (behaviour-only .ts, no runtime style injection — plan §2). */
|
|
6
|
+
|
|
7
|
+
@scope (ui-swiper-paddles) {
|
|
8
|
+
:scope {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
}
|
|
13
|
+
/* Default-stamped placement: overlaid on the track, spanning its full extent (author-placed anchors keep
|
|
14
|
+
whatever layout the author gave them — only the DEFAULT stamp gets this positioning). The host
|
|
15
|
+
(ui-swiper) is `position: relative` (swiper.css), the anchor for this overlay. */
|
|
16
|
+
:scope[data-default] {
|
|
17
|
+
position: absolute;
|
|
18
|
+
inset-block: 0;
|
|
19
|
+
inset-inline: 0;
|
|
20
|
+
pointer-events: none; /* only the buttons themselves are hit-testable */
|
|
21
|
+
z-index: 1;
|
|
22
|
+
}
|
|
23
|
+
:scope[data-default] ui-button {
|
|
24
|
+
pointer-events: auto;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UIElement } from '../../dom/element.js';
|
|
2
|
+
export declare class UISwiperPaddlesElement extends UIElement {
|
|
3
|
+
#private;
|
|
4
|
+
static props: {};
|
|
5
|
+
/**
|
|
6
|
+
* Coordinator command (swiper.ts's `#driveChrome`) — fill this anchor with two real, wired `ui-button`s
|
|
7
|
+
* (idempotent: built once, reused on every re-drive) and rotate their glyphs to `orientation`.
|
|
8
|
+
*/
|
|
9
|
+
fill(onPrev: () => void, onNext: () => void, orientation: 'horizontal' | 'vertical'): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// swiper-paddles.ts — UISwiperPaddlesElement, the prev/next anchor of the ui-swiper family
|
|
2
|
+
// (swiper-family.lld.md LLD-C10 · swiper-family.spec.md SPEC-R12 · ADR-0124 F3). BEHAVIOUR + the coordinator-
|
|
3
|
+
// driven `fill` seam + self-define ONLY; geometry lives in swiper.css, the public contract in
|
|
4
|
+
// swiper-paddles.md.
|
|
5
|
+
//
|
|
6
|
+
// An author-placed ANCHOR the owning `ui-swiper` fills and wires (`#driveChrome`, swiper.ts): TWO composed
|
|
7
|
+
// `<ui-button icon-only variant=ghost>` (the toast.ts close-button precedent — an icon-only composed button
|
|
8
|
+
// named by `aria-label`, a plain HTML global attribute set from OUTSIDE the button's own FACE internals, not
|
|
9
|
+
// a violation of the "ARIA via internals" rule which governs a control's OWN self-applied state). Marked
|
|
10
|
+
// `data-part='prev'`/`'next'` so the coordinator can toggle their `disabled` PUBLIC prop directly in non-loop
|
|
11
|
+
// mode (LLD §5 — "the coordinator toggles the composed ui-buttons' disabled"; no second method on this class
|
|
12
|
+
// is needed for that — `disabled` is public). Icons rotate with `orientation` (caret-left/right horizontal,
|
|
13
|
+
// caret-up/down vertical) — `@agent-ui-kit/icons` is a zero-dep sibling package (disclosure.ts's own import
|
|
14
|
+
// precedent), never a CSS transform hack.
|
|
15
|
+
//
|
|
16
|
+
// `controls → dom + @agent-ui-kit/icons` is the allowed import direction.
|
|
17
|
+
import { UIElement } from "../../dom/element.js";
|
|
18
|
+
import { setIcon } from '@agent-ui-kit/icons';
|
|
19
|
+
export class UISwiperPaddlesElement extends UIElement {
|
|
20
|
+
static props = {};
|
|
21
|
+
#prev = null;
|
|
22
|
+
#next = null;
|
|
23
|
+
#prevIcon = null;
|
|
24
|
+
#nextIcon = null;
|
|
25
|
+
/**
|
|
26
|
+
* Coordinator command (swiper.ts's `#driveChrome`) — fill this anchor with two real, wired `ui-button`s
|
|
27
|
+
* (idempotent: built once, reused on every re-drive) and rotate their glyphs to `orientation`.
|
|
28
|
+
*/
|
|
29
|
+
fill(onPrev, onNext, orientation) {
|
|
30
|
+
this.#ensureButtons();
|
|
31
|
+
setIcon(this.#prevIcon, orientation === 'vertical' ? 'caret-up' : 'caret-left');
|
|
32
|
+
setIcon(this.#nextIcon, orientation === 'vertical' ? 'caret-down' : 'caret-right');
|
|
33
|
+
this.#prev.onclick = () => onPrev(); // reassigning .onclick replaces cleanly — no accumulation across re-drives
|
|
34
|
+
this.#next.onclick = () => onNext();
|
|
35
|
+
}
|
|
36
|
+
#ensureButtons() {
|
|
37
|
+
if (this.#prev)
|
|
38
|
+
return;
|
|
39
|
+
this.#prev = document.createElement('ui-button');
|
|
40
|
+
this.#prev.setAttribute('data-part', 'prev');
|
|
41
|
+
this.#prev.setAttribute('variant', 'ghost');
|
|
42
|
+
this.#prev.setAttribute('icon-only', '');
|
|
43
|
+
this.#prev.setAttribute('aria-label', 'Previous slide');
|
|
44
|
+
this.#prevIcon = document.createElement('ui-icon');
|
|
45
|
+
this.#prevIcon.setAttribute('slot', 'leading');
|
|
46
|
+
this.#prevIcon.setAttribute('data-role', 'icon');
|
|
47
|
+
this.#prev.appendChild(this.#prevIcon);
|
|
48
|
+
this.appendChild(this.#prev);
|
|
49
|
+
this.#next = document.createElement('ui-button');
|
|
50
|
+
this.#next.setAttribute('data-part', 'next');
|
|
51
|
+
this.#next.setAttribute('variant', 'ghost');
|
|
52
|
+
this.#next.setAttribute('icon-only', '');
|
|
53
|
+
this.#next.setAttribute('aria-label', 'Next slide');
|
|
54
|
+
this.#nextIcon = document.createElement('ui-icon');
|
|
55
|
+
this.#nextIcon.setAttribute('slot', 'leading');
|
|
56
|
+
this.#nextIcon.setAttribute('data-role', 'icon');
|
|
57
|
+
this.#next.appendChild(this.#nextIcon);
|
|
58
|
+
this.appendChild(this.#next);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!customElements.get('ui-swiper-paddles'))
|
|
62
|
+
customElements.define('ui-swiper-paddles', UISwiperPaddlesElement);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* swiper-pagination.css — ui-swiper-pagination's own sheet (ADR-0124 Consequences, the family-root
|
|
2
|
+
* resolution; swiper-family.lld.md LLD-C9/§7 REV). No `--ui-swiper-pagination-*` tokens of its own — the
|
|
3
|
+
* dot ladder (`--ui-swiper-dot-*`) is declared once in the family root (swiper.css) and CONSUMED here
|
|
4
|
+
* (the family-root rule the amended family-coherence.test.ts invariant B allows). Standalone; never
|
|
5
|
+
* injected from a .ts (behaviour-only .ts, no runtime style injection — plan §2). */
|
|
6
|
+
|
|
7
|
+
@scope (ui-swiper-pagination) {
|
|
8
|
+
:scope {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: var(--ui-swiper-pagination-gap);
|
|
13
|
+
}
|
|
14
|
+
/* Default-stamped placement: below the track, in normal flow (the coordinator's boolean-stamp fallback). */
|
|
15
|
+
:scope[data-default] {
|
|
16
|
+
margin-block-start: var(--ui-swiper-pagination-margin-block-start);
|
|
17
|
+
}
|
|
18
|
+
:scope [data-part='dot'] {
|
|
19
|
+
inline-size: var(--ui-swiper-dot-size);
|
|
20
|
+
block-size: var(--ui-swiper-dot-size);
|
|
21
|
+
padding: 0;
|
|
22
|
+
border: 0;
|
|
23
|
+
border-radius: 50%;
|
|
24
|
+
background: var(--ui-swiper-dot-color);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
/* The active dot is SIZE-larger — the non-colour signifier (ADR-0057); colour is a secondary cue. */
|
|
28
|
+
:scope [data-part='dot'][aria-current='true'] {
|
|
29
|
+
inline-size: var(--ui-swiper-dot-size-active);
|
|
30
|
+
block-size: var(--ui-swiper-dot-size-active);
|
|
31
|
+
background: var(--ui-swiper-dot-color-active);
|
|
32
|
+
}
|
|
33
|
+
:scope [data-part='dot']:focus-visible {
|
|
34
|
+
outline: var(--md-sys-state-focus-ring-width) solid var(--md-sys-color-focus-ring);
|
|
35
|
+
outline-offset: var(--md-sys-state-focus-ring-offset);
|
|
36
|
+
}
|
|
37
|
+
:scope [data-part='fraction'] {
|
|
38
|
+
font-size: var(--ui-swiper-pagination-fraction-font);
|
|
39
|
+
color: var(--ui-swiper-pagination-fraction-ink);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* NOTE: the ready-gated dot-transition motion rule lives in swiper.css (the PRIMARY sheet), not here —
|
|
43
|
+
`ready` is a custom state ui-swiper alone owns (sets via its own internals.states); a rule referencing
|
|
44
|
+
it, even one styling a descendant, belongs with its owner so customStates stays truthful per file (the
|
|
45
|
+
contract-to-source trip-wire is file-scoped: swiper-pagination.md declares customStates as empty, and
|
|
46
|
+
this file carries no state-selector text of its own). See swiper.css's own "cross-tag motion" section.
|
|
47
|
+
|
|
48
|
+
Forced-colors (WHCM) — the pagination dots need a non-colour signifier that also survives WHCM (they
|
|
49
|
+
already carry SIZE; here the idle/active dots additionally map to system colours so they remain visible
|
|
50
|
+
against Canvas). */
|
|
51
|
+
@media (forced-colors: active) {
|
|
52
|
+
:scope [data-part='dot'] {
|
|
53
|
+
background: CanvasText;
|
|
54
|
+
forced-color-adjust: none;
|
|
55
|
+
}
|
|
56
|
+
:scope [data-part='dot'][aria-current='true'] {
|
|
57
|
+
background: Highlight;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UIElement } from '../../dom/element.js';
|
|
2
|
+
import { type ReactiveProps } from '../../dom/index.js';
|
|
3
|
+
declare const props: {
|
|
4
|
+
type: {
|
|
5
|
+
reflect: true;
|
|
6
|
+
type: import("../../index.js").PropType<"fraction" | "dots">;
|
|
7
|
+
default: "fraction" | "dots";
|
|
8
|
+
attribute?: string | false;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export interface UISwiperPaginationElement extends ReactiveProps<typeof props> {
|
|
12
|
+
}
|
|
13
|
+
export declare class UISwiperPaginationElement extends UIElement {
|
|
14
|
+
#private;
|
|
15
|
+
static props: {
|
|
16
|
+
type: {
|
|
17
|
+
reflect: true;
|
|
18
|
+
type: import("../../index.js").PropType<"fraction" | "dots">;
|
|
19
|
+
default: "fraction" | "dots";
|
|
20
|
+
attribute?: string | false;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Coordinator command (swiper.ts's `#driveChrome`) — render `count` indicators (or the `'n / count'`
|
|
25
|
+
* fraction) and mark `active`. `onSelect(i)` is the coordinator's `goTo` — called with the clicked dot's
|
|
26
|
+
* REAL index. Idempotent: re-running with the same `count` reuses the existing dot nodes (only the
|
|
27
|
+
* `aria-current`/label state updates), so a settle-time re-drive never steals focus from an operated dot.
|
|
28
|
+
*/
|
|
29
|
+
renderInto(count: number, active: number, onSelect: (i: number) => void): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// swiper-pagination.ts — UISwiperPaginationElement, the dots/fraction anchor of the ui-swiper family
|
|
2
|
+
// (swiper-family.lld.md LLD-C9 · swiper-family.spec.md SPEC-R12 · ADR-0124 F3). BEHAVIOUR + the coordinator-
|
|
3
|
+
// driven `renderInto` seam + self-define ONLY; geometry lives in swiper.css, the public contract in
|
|
4
|
+
// swiper-pagination.md.
|
|
5
|
+
//
|
|
6
|
+
// An author-placed ANCHOR the owning `ui-swiper` fills and wires (`#driveChrome`, swiper.ts) — this element
|
|
7
|
+
// holds no slide/active state of its own; it is a pure render target the coordinator commands. `type=dots`
|
|
8
|
+
// renders one real `<button>` indicator per REAL slide (native buttons are keyboard-operable — Enter/Space —
|
|
9
|
+
// for free, no roving-focus trait needed: each dot is its own tab stop, exactly like a native radio-less
|
|
10
|
+
// button group); `type=fraction` renders a single "n / realCount" text readout. The active dot is
|
|
11
|
+
// distinguished by `aria-current="true"` (a real ARIA fact, not a decorative class) — swiper.css keys its
|
|
12
|
+
// SIZE-larger treatment off that same attribute (ADR-0057: never colour alone).
|
|
13
|
+
//
|
|
14
|
+
// `renderInto` REBUILDS the dot list only when the slide COUNT changes (cheap incremental update otherwise —
|
|
15
|
+
// re-running on every `active` change must not thrash focus/DOM identity mid-interaction). `controls → dom` is
|
|
16
|
+
// the allowed import direction.
|
|
17
|
+
import { UIElement } from "../../dom/element.js";
|
|
18
|
+
import { prop } from "../../dom/index.js";
|
|
19
|
+
const PAGINATION_TYPES = ['dots', 'fraction'];
|
|
20
|
+
const props = {
|
|
21
|
+
type: { ...prop.enum(PAGINATION_TYPES, 'dots'), reflect: true },
|
|
22
|
+
};
|
|
23
|
+
export class UISwiperPaginationElement extends UIElement {
|
|
24
|
+
static props = props;
|
|
25
|
+
#dots = [];
|
|
26
|
+
#fraction = null;
|
|
27
|
+
/**
|
|
28
|
+
* Coordinator command (swiper.ts's `#driveChrome`) — render `count` indicators (or the `'n / count'`
|
|
29
|
+
* fraction) and mark `active`. `onSelect(i)` is the coordinator's `goTo` — called with the clicked dot's
|
|
30
|
+
* REAL index. Idempotent: re-running with the same `count` reuses the existing dot nodes (only the
|
|
31
|
+
* `aria-current`/label state updates), so a settle-time re-drive never steals focus from an operated dot.
|
|
32
|
+
*/
|
|
33
|
+
renderInto(count, active, onSelect) {
|
|
34
|
+
if (this.type === 'fraction') {
|
|
35
|
+
this.#renderFraction(count, active);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.#renderDots(count, active, onSelect);
|
|
39
|
+
}
|
|
40
|
+
#renderFraction(count, active) {
|
|
41
|
+
if (this.#dots.length > 0) {
|
|
42
|
+
for (const dot of this.#dots)
|
|
43
|
+
dot.remove();
|
|
44
|
+
this.#dots = [];
|
|
45
|
+
}
|
|
46
|
+
if (!this.#fraction) {
|
|
47
|
+
this.#fraction = document.createElement('span');
|
|
48
|
+
this.#fraction.setAttribute('data-part', 'fraction');
|
|
49
|
+
this.appendChild(this.#fraction);
|
|
50
|
+
}
|
|
51
|
+
this.#fraction.textContent = count === 0 ? '0 / 0' : `${active + 1} / ${count}`;
|
|
52
|
+
}
|
|
53
|
+
#renderDots(count, active, onSelect) {
|
|
54
|
+
if (this.#fraction) {
|
|
55
|
+
this.#fraction.remove();
|
|
56
|
+
this.#fraction = null;
|
|
57
|
+
}
|
|
58
|
+
if (this.#dots.length !== count) {
|
|
59
|
+
for (const dot of this.#dots)
|
|
60
|
+
dot.remove();
|
|
61
|
+
this.#dots = [];
|
|
62
|
+
for (let i = 0; i < count; i++) {
|
|
63
|
+
const dot = document.createElement('button');
|
|
64
|
+
dot.type = 'button';
|
|
65
|
+
dot.setAttribute('data-part', 'dot');
|
|
66
|
+
this.appendChild(dot);
|
|
67
|
+
this.#dots.push(dot);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
this.#dots.forEach((dot, i) => {
|
|
71
|
+
dot.setAttribute('aria-label', `Go to slide ${i + 1}`);
|
|
72
|
+
dot.setAttribute('aria-current', i === active ? 'true' : 'false');
|
|
73
|
+
dot.onclick = () => onSelect(i); // reassigning .onclick replaces cleanly — no accumulation across re-drives
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!customElements.get('ui-swiper-pagination'))
|
|
78
|
+
customElements.define('ui-swiper-pagination', UISwiperPaginationElement);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* swiper.css — the PRIMARY sheet for the ui-swiper family (ADR-0124 Consequences, the family-root
|
|
2
|
+
* resolution; swiper-family.lld.md §2/§7/§13 REV). Declares the WHOLE family's `--ui-swiper-*` token
|
|
3
|
+
* table (columns/gap/align/duration/easing + the pagination dot ladder) — the four leaf sheets
|
|
4
|
+
* (swiper-item/-pagination/-paddles/-label.css) CONSUME this prefix as family-shared but declare NONE of
|
|
5
|
+
* it themselves (family-coherence.test.ts's amended invariant B). This sheet's OWN styles block covers
|
|
6
|
+
* only the HOST (`ui-swiper` itself: the track + the live region) — each leaf's own anatomy lives in its
|
|
7
|
+
* own file, the fleet's one-file-per-descriptor law (ADR-0081 A4) held for every tag.
|
|
8
|
+
*
|
|
9
|
+
* Two sectioned blocks (ADR-0003): a :where() TOKEN block (specificity 0 — declares the --ui-swiper-*
|
|
10
|
+
* chain from the colour roles + the space/motion ladders) then an @scope STYLES block (consumes ONLY
|
|
11
|
+
* --ui-swiper-* + the shared fleet focus-ring/motion tokens). Linked via the component-styles barrel;
|
|
12
|
+
* NEVER injected from a .ts (behaviour holds no runtime style; plan §2).
|
|
13
|
+
*
|
|
14
|
+
* Geometry (swiper-family.lld.md §7 — the fleet's FIRST scroll-snap surface, ADR-0124 F1): the track is a
|
|
15
|
+
* `grid-auto-flow` scroll container sized off `--ui-swiper-columns` + `--ui-swiper-gap`; slides snap via
|
|
16
|
+
* `scroll-snap-type`/`scroll-snap-align`/`scroll-snap-stop` (declared here, consumed by swiper-item.css).
|
|
17
|
+
* `ui-swiper` is `tier: pattern` (geometry.md — container + control-height rows). The surface (elevation/
|
|
18
|
+
* brightness) is the shared container.css seam — this sheet does not repoint --ui-container-bg (the
|
|
19
|
+
* ui-tabs precedent): a bare <ui-swiper> is transparent by default (ADR-0015 cl.1). */
|
|
20
|
+
|
|
21
|
+
/* ════════════════════════ [1] TOKEN BLOCK — :where() declarations (the WHOLE family's chain) ════════════════════════ */
|
|
22
|
+
|
|
23
|
+
:where(ui-swiper) {
|
|
24
|
+
/* Track geometry — the responsive-auto column count (real @container repoint below); `[slides-in-view="n"]`
|
|
25
|
+
pins it. */
|
|
26
|
+
--ui-swiper-columns: 1;
|
|
27
|
+
--ui-swiper-align: start; /* repointed by [align=center|end]; consumed by swiper-item.css's scroll-snap-align */
|
|
28
|
+
--ui-swiper-gap: var(--md-sys-space-md); /* inter-slide gap off the space ladder (density-responsive) */
|
|
29
|
+
|
|
30
|
+
/* Programmatic-advance timing (F1 Consequences — native gesture snaps use the UA's own timing and cannot be
|
|
31
|
+
shaped by these; `goTo`/paddle/dot/keyboard read them via the JS scroll animation, swiper.ts). The fleet
|
|
32
|
+
motion ramp has no "medium" step — `--md-sys-motion-duration-fast` (300ms) + `--md-sys-motion-easing-standard` are the real tokens
|
|
33
|
+
every other control's transition consumes (tabs.css/button.css); reused here rather than inventing a new one. */
|
|
34
|
+
--ui-swiper-duration: var(--md-sys-motion-duration-fast);
|
|
35
|
+
--ui-swiper-easing: var(--md-sys-motion-easing-standard);
|
|
36
|
+
|
|
37
|
+
/* Pagination dots — the compact widget ramp; the ACTIVE dot is size-larger (non-colour signifier, ADR-0057).
|
|
38
|
+
Declared HERE (the family root) though only swiper-pagination.css consumes them — the family-root rule
|
|
39
|
+
(ADR-0124 Consequences): a leaf never DECLARES another tag's private token, but MAY consume the primary's
|
|
40
|
+
`--ui-swiper-*` prefix. The +2px bump is a flat literal (the compact-realm box is density-invariant,
|
|
41
|
+
geometry.md — density rides the pad/gap, never the box), not a --md-sys-space step. */
|
|
42
|
+
--ui-swiper-dot-size: var(--md-sys-compact-sm);
|
|
43
|
+
--ui-swiper-dot-size-active: calc(var(--md-sys-compact-sm) + 2px);
|
|
44
|
+
--ui-swiper-dot-color: var(--md-sys-color-neutral-outline-variant);
|
|
45
|
+
--ui-swiper-dot-color-active: var(--md-sys-color-primary);
|
|
46
|
+
--ui-swiper-pagination-fraction-ink: var(--md-sys-color-neutral-on-surface-variant); /* TKT-0066: the fraction readout's ink — was a direct role read in swiper-pagination.css's @scope; declared HERE per the family token tunnel (pagination declares nothing of its own, its pin test enforces that) */
|
|
47
|
+
/* TKT-0066 item 5 ruling: pagination's dimensional constants ALSO route through the tunnel. */
|
|
48
|
+
--ui-swiper-pagination-gap: var(--md-sys-space-xs);
|
|
49
|
+
--ui-swiper-pagination-margin-block-start: var(--md-sys-space-sm);
|
|
50
|
+
--ui-swiper-pagination-fraction-font: var(--md-sys-font-sm);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* [slides-in-view="n"] — pin the visible column count (a numeric string; '' stays responsive-auto below). */
|
|
54
|
+
:where(ui-swiper[slides-in-view='2']) { --ui-swiper-columns: 2; }
|
|
55
|
+
:where(ui-swiper[slides-in-view='3']) { --ui-swiper-columns: 3; }
|
|
56
|
+
:where(ui-swiper[slides-in-view='4']) { --ui-swiper-columns: 4; }
|
|
57
|
+
:where(ui-swiper[slides-in-view='5']) { --ui-swiper-columns: 5; }
|
|
58
|
+
:where(ui-swiper[slides-in-view='6']) { --ui-swiper-columns: 6; }
|
|
59
|
+
|
|
60
|
+
:where(ui-swiper[align='center']) { --ui-swiper-align: center; }
|
|
61
|
+
:where(ui-swiper[align='end']) { --ui-swiper-align: end; }
|
|
62
|
+
|
|
63
|
+
/* ════════════════════════ [2] STYLES BLOCK — @scope (ui-swiper) — the HOST only ════════════════════════ */
|
|
64
|
+
|
|
65
|
+
@scope (ui-swiper) {
|
|
66
|
+
:scope {
|
|
67
|
+
display: block;
|
|
68
|
+
position: relative; /* the anchor for a default-stamped [data-default] paddles overlay */
|
|
69
|
+
container-type: inline-size; /* the responsive-auto @container basis for --ui-swiper-columns below */
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* The owned scroll track (SPEC-R3 — the ONLY scrolling element). Horizontal (default): column flow, x-axis
|
|
73
|
+
scroll/snap. Slides are sized off the columns + gap formula (the prior-art formula). */
|
|
74
|
+
:scope > [data-part='track'] {
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-auto-flow: column;
|
|
77
|
+
grid-auto-columns: calc((100% - (var(--ui-swiper-columns) - 1) * var(--ui-swiper-gap)) / var(--ui-swiper-columns));
|
|
78
|
+
gap: var(--ui-swiper-gap);
|
|
79
|
+
overflow-x: auto;
|
|
80
|
+
overflow-y: hidden;
|
|
81
|
+
scroll-snap-type: x mandatory;
|
|
82
|
+
scrollbar-width: none;
|
|
83
|
+
outline: none; /* the shared focus-ring (:focus-visible) below replaces the UA default */
|
|
84
|
+
}
|
|
85
|
+
:scope > [data-part='track']::-webkit-scrollbar {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:scope[orientation='vertical'] > [data-part='track'] {
|
|
90
|
+
grid-auto-flow: row;
|
|
91
|
+
grid-auto-rows: calc((100% - (var(--ui-swiper-columns) - 1) * var(--ui-swiper-gap)) / var(--ui-swiper-columns));
|
|
92
|
+
overflow-x: hidden;
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
scroll-snap-type: y mandatory;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* [data-part=live] — visually hidden, announced (the stat.css delta-word idiom). */
|
|
98
|
+
:scope > [data-part='live'] {
|
|
99
|
+
position: absolute;
|
|
100
|
+
inline-size: 1px;
|
|
101
|
+
block-size: 1px;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
clip-path: inset(50%);
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* The shared focus ring (ADR-0009) on the track's single tab stop. */
|
|
108
|
+
:scope > [data-part='track']:focus-visible {
|
|
109
|
+
outline: var(--md-sys-state-focus-ring-width) solid var(--md-sys-color-focus-ring);
|
|
110
|
+
outline-offset: calc(-1 * var(--md-sys-state-focus-ring-offset));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Reduced motion — native snap loses its smooth-scroll animation; the JS scroll animation (swiper.ts)
|
|
114
|
+
already checks prefers-reduced-motion and skips its own rAF loop, so this rule only needs to neutralise
|
|
115
|
+
any UA-applied smooth-scroll behaviour on the track itself. */
|
|
116
|
+
@media (prefers-reduced-motion: reduce) {
|
|
117
|
+
:scope > [data-part='track'] {
|
|
118
|
+
scroll-behavior: auto;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Responsive-auto columns (slides-in-view='') — a real @container basis; a built-output-only truth. */
|
|
123
|
+
@container (min-width: 40rem) {
|
|
124
|
+
:scope:not([slides-in-view]) > [data-part='track'],
|
|
125
|
+
:scope[slides-in-view=''] > [data-part='track'] {
|
|
126
|
+
--ui-swiper-columns: 2;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
@container (min-width: 64rem) {
|
|
130
|
+
:scope:not([slides-in-view]) > [data-part='track'],
|
|
131
|
+
:scope[slides-in-view=''] > [data-part='track'] {
|
|
132
|
+
--ui-swiper-columns: 3;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Cross-tag motion (interaction-states standard) — the pagination dot's size/colour swap transitions
|
|
137
|
+
ONLY after first paint, gated behind THIS host's :state(ready) (the ui-tabs ready-gate precedent: the
|
|
138
|
+
synchronous initial position snaps; only later changes animate). Lives HERE, not in
|
|
139
|
+
swiper-pagination.css, because `ready` is a state ui-swiper alone owns (sets via its own
|
|
140
|
+
internals.states) — the contract↔source trip-wire is file-scoped, so a rule referencing a state
|
|
141
|
+
belongs in its owner's file even when it styles a descendant. Geometry never animates. */
|
|
142
|
+
:scope:state(ready) ui-swiper-pagination [data-part='dot'] {
|
|
143
|
+
transition:
|
|
144
|
+
inline-size var(--md-sys-motion-duration-fast) var(--md-sys-motion-easing-standard),
|
|
145
|
+
block-size var(--md-sys-motion-duration-fast) var(--md-sys-motion-easing-standard),
|
|
146
|
+
background-color var(--md-sys-motion-duration-fast) var(--md-sys-motion-easing-standard);
|
|
147
|
+
}
|
|
148
|
+
@media (prefers-reduced-motion: reduce) {
|
|
149
|
+
:scope:state(ready) ui-swiper-pagination [data-part='dot'] {
|
|
150
|
+
transition: none;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|