@mkbabb/glass-ui 10.1.1 → 10.1.2

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/MIGRATION.md CHANGED
@@ -5,6 +5,51 @@ records the breaking changes that landed in that cut, newest first. Clean breaks
5
5
  — no legacy aliases, no back-compat shims (L invariant 4); every break is a one-line
6
6
  rename or import re-point per call site.
7
7
 
8
+ ## 10.1.2
9
+
10
+ Two behaviour changes, no type change. **A custom dock seat must now carry
11
+ `data-glass-dock-seat` to rove.**
12
+
13
+ - **O-101: a morph reserves the size it settles at.** The dock no longer reserves an
14
+ old width on an expand or for the rest of a morph when its full pane changes (a
15
+ breakpoint that swaps its controls) or its host changes (a viewport or container that
16
+ resizes) while it is collapsed or morphing. So the page no longer scrolls sideways
17
+ for the length of the morph, and the box no longer snaps at settle. Both endpoints are
18
+ the root laid out at rest in their posture, read from the live layout on every
19
+ capture, under whatever constrains the dock, including while it morphs. A consumer
20
+ that clipped the page or the dock band, or overrode `--dock-expanded-px`, to hide that
21
+ overflow can delete the workaround. A dock whose pane and host are stable morphs as
22
+ before.
23
+
24
+ - The dock run roves a direct child only when it carries `data-glass-dock-seat`.
25
+ `DockControl`, `DockTrigger` and `DockBackgroundToggle` set it. A consumer's own seat
26
+ that should share the run's one tab stop and answer its arrow keys (a `RouterLink`, a
27
+ bespoke button, a `[role=button]` element) adds the attribute itself:
28
+ `<RouterLink data-glass-dock-seat to="/a">`. A `DockControl as-child` already sets it
29
+ on the child.
30
+ - A declared seat must stay focusable. A custom seat that is disabled carries
31
+ `aria-disabled="true"` and blocks its own activation, never the native `disabled`
32
+ attribute: `<button data-glass-dock-seat aria-disabled="true">`. A native-disabled seat
33
+ that holds the run's stop takes every seat out of the Tab order. A disabled
34
+ `DockTrigger` now renders `aria-disabled`, like `DockControl`, so it stays in the Tab
35
+ and arrow order as a disabled stop where 10.1.1 skipped it, and paints disabled from
36
+ `.dock-trigger[aria-disabled="true"]`. A rule of yours that dims or suppresses a dock
37
+ trigger on `:disabled` keys on `[aria-disabled="true"]` instead.
38
+ - An undeclared child is left alone. It keeps its natural tab stop and its own keys, so a
39
+ filter trigger, a settings button, a handle, an input pair, a dark toggle or a composite
40
+ stays in the Tab order. A consumer that pulled such a control out of its dock run, or
41
+ restored its `tabindex`, to get it back into the Tab order can undo that.
42
+ - `.dock-run` carries `role="toolbar"` and `aria-orientation` only when every child is a
43
+ declared seat, glass's `<DockSeparator>` and the native
44
+ `<select aria-hidden="true" tabindex="-1">` a named `Select` renders inside a `<form>`
45
+ aside. A consumer's own `role="separator"` splitter, or an `aria-hidden` wrapper around a
46
+ control that still takes Tab, is an undeclared child and voids the claim. A dock whose run mixes declared seats
47
+ with other controls no longer announces as a toolbar. To keep the role, declare every
48
+ seat, or move the undeclared controls to `#persistent` / `#persistent-end`.
49
+ - A test or probe that read `role="toolbar"` off an empty run, or off a run of plain
50
+ buttons, now finds no role. Seat the run with declared controls.
51
+ - Atlas and value.js: the contract and the build path are in `CHANGELOG.md` §10.1.2.
52
+
8
53
  ## 10.1.1
9
54
 
10
55
  One type-level change, below; no runtime break. Behaviour a consumer may notice:
@@ -2,7 +2,7 @@ import { t as e } from "./class-names-FlXcvRRT.js";
2
2
  import { t } from "./primitive-B2t2jdqM.js";
3
3
  import { t as n } from "./selection-DqIULxRG.js";
4
4
  import { n as r, t as i } from "./DialogContent-CwIBvou_.js";
5
- import { t as a } from "./participation-Cs_UX_Dc.js";
5
+ import { t as a } from "./participation-B7UFdgXB.js";
6
6
  import { t as o } from "./rowClass-DYOXwxhO.js";
7
7
  import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeProps as m, normalizeClass as h, openBlock as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as b, withCtx as x } from "vue";
8
8
  import { ComboboxContent as S, ComboboxEmpty as C, ComboboxGroup as w, ComboboxInput as T, ComboboxItem as E, ComboboxLabel as D, ComboboxRoot as O, ComboboxSeparator as k } from "reka-ui";
package/dist/command.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./command-CTQCaHVA.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./command-CatrAsrl.js";
2
2
  export { r as Command, t as CommandDialog, s as CommandEmpty, a as CommandGroup, e as CommandInput, n as CommandItem, o as CommandList, i as CommandSeparator, c as CommandShortcut };
@@ -15,6 +15,9 @@ import { type ButtonHTMLAttributes, type Component, type HTMLAttributes } from "
15
15
  * `--dock-control-size` (≥44px on coarse via the density clamp) — hit box ≠ paint
16
16
  * box. `overflow: visible` keeps the painted inset unclipped.
17
17
  *
18
+ * A DECLARED SEAT. The host carries `data-glass-dock-seat` (`DOCK_SEAT_ATTR`), so a
19
+ * control seated directly in a dock run is roved by it (atlas G-4, b-ii).
20
+ *
18
21
  * Role rides the consumer: an `active` control stamps `aria-pressed` (the
19
22
  * AT-selectable semantic) + `data-active` (the CSS hook reading the
20
23
  * `--dock-control-active-bg` "selected reads as glass" tier — never a saturated
@@ -4,15 +4,15 @@ type __VLS_Props = {
4
4
  for?: "select" | "dropdown" | "popover";
5
5
  class?: HTMLAttributes["class"];
6
6
  };
7
- declare var __VLS_8: {}, __VLS_16: {}, __VLS_30: {}, __VLS_39: {};
7
+ declare var __VLS_14: {}, __VLS_22: {}, __VLS_42: {}, __VLS_57: {};
8
8
  type __VLS_Slots = {} & {
9
- default?: (props: typeof __VLS_8) => any;
9
+ default?: (props: typeof __VLS_14) => any;
10
10
  } & {
11
- icon?: (props: typeof __VLS_16) => any;
11
+ icon?: (props: typeof __VLS_22) => any;
12
12
  } & {
13
- default?: (props: typeof __VLS_30) => any;
13
+ default?: (props: typeof __VLS_42) => any;
14
14
  } & {
15
- default?: (props: typeof __VLS_39) => any;
15
+ default?: (props: typeof __VLS_57) => any;
16
16
  };
17
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
18
18
  for: "select" | "dropdown" | "popover";
@@ -1,16 +1,40 @@
1
1
  import { type Ref } from "vue";
2
+ type Axis = "horizontal" | "vertical";
2
3
  export interface UseDockExpandedSizeOptions {
3
4
  rootEl: Ref<HTMLElement | null>;
4
5
  contentEl: Ref<HTMLElement | null>;
5
6
  expandedEl: Ref<HTMLElement | null>;
6
7
  collapsedEl: Ref<HTMLElement | null>;
7
- axis: Ref<"horizontal" | "vertical">;
8
- expanded: Ref<boolean>;
8
+ axis: Ref<Axis>;
9
+ }
10
+ export interface UseDockExpandedSizeReturn {
11
+ /**
12
+ * Measure the endpoints now. The morph calls this when it arms, after the posture's
13
+ * DOM is patched and before `[data-morphing]` reserves one.
14
+ */
15
+ measure: () => void;
9
16
  }
10
17
  /**
11
- * Measure the dock's two rendered pane compositions. The inactive pane remains
12
- * laid out (visibility, never display, hides it), so the first morph can derive
13
- * both endpoints from real content—coarse controls bring their own 44px floor;
14
- * non-interactive visuals receive no invented one.
18
+ * Measure the dock's two endpoints, `--dock-expanded-px` and `--dock-collapsed-px`.
19
+ *
20
+ * An endpoint is the root's box at rest in its posture, laid out from the live DOM on
21
+ * every capture (`restSize`). Nothing is latched but each posture's chrome, the root
22
+ * less its pane, read only from a root at rest in that posture (no `[data-morphing]`).
23
+ * The chrome holds padding, border, gaps and the persistent regions, none of which
24
+ * depends on the host. So an endpoint follows the pane and the host in every posture and
25
+ * through a morph (O-101, O-101a).
26
+ *
27
+ * The expanded endpoint is read in both postures, since a morph reserves it in both
28
+ * directions. The collapsed endpoint is read while the dock is collapsed, where its pane
29
+ * lays out; while expanded it keeps the last value, which the next collapse re-reads
30
+ * when it arms. The posture is the DOM's (the full pane's `.is-active`), never the
31
+ * posture ref, which flips before the DOM is patched: no endpoint can be read from a
32
+ * box laid out in the other posture (the W7 MORPH guard, BK #47).
33
+ *
34
+ * The capture runs when the morph arms (`measure`), on a ResizeObserver hit on the root,
35
+ * its parent (the host constraint), the layers, both panes or any pane's direct child,
36
+ * on a MutationObserver record in either pane, on a window resize (in the resize step,
37
+ * before the frame's layout), and once fonts are ready.
15
38
  */
16
- export declare function useDockExpandedSize(options: UseDockExpandedSizeOptions): void;
39
+ export declare function useDockExpandedSize(options: UseDockExpandedSizeOptions): UseDockExpandedSizeReturn;
40
+ export {};
@@ -11,6 +11,11 @@ export interface UseDockMorphOrchestratorOptions {
11
11
  outerActiveLayer: Ref<string>;
12
12
  /** Notifies the shell when the spring arms and settles. */
13
13
  onMorphActiveChange?: (active: boolean) => void;
14
+ /**
15
+ * Measures the endpoints from the posture just patched in (`useDockExpandedSize`'s
16
+ * `measure`). Called when the morph arms, before `[data-morphing]` reserves one.
17
+ */
18
+ measure: () => void;
14
19
  }
15
20
  export interface UseDockMorphOrchestratorReturn {
16
21
  /** The outer face that currently owns layout and interaction. */
@@ -16,5 +16,10 @@ export interface UseDockRunReturn {
16
16
  reach: (seat: HTMLElement) => void;
17
17
  /** Re-derive the tab stop. Called on mount, on focus moves, and on content change. */
18
18
  syncRoving: () => void;
19
+ /**
20
+ * True while the run has a declared seat and every child is one, glass's
21
+ * `<DockSeparator>` and reka's form `<select>` aside: the run's `role="toolbar"`.
22
+ */
23
+ toolbar: Readonly<Ref<boolean>>;
19
24
  }
20
25
  export declare function useDockRun(options: UseDockRunOptions): UseDockRunReturn;
@@ -49,3 +49,13 @@ export declare const HOVER_INTENT_MS = 60;
49
49
  */
50
50
  export declare const DOCK_COLLAPSE_DELAY_MS = 3600;
51
51
  export declare const MORPH_SETTLE_MS = 840;
52
+ /**
53
+ * THE DECLARED SEAT MARKER (atlas G-4, arm b-ii; INBOUND O-102d). The dock run roves a
54
+ * direct child only when it carries this attribute, and claims `role="toolbar"` only
55
+ * when it has one and every direct child carries it, glass's `<DockSeparator>` and
56
+ * reka's form `<select aria-hidden="true" tabindex="-1">` (beside a named `Select`'s
57
+ * trigger) aside. Glass's seat primitives, `<DockControl>` and `<DockTrigger>`, set it;
58
+ * a consumer's own seat sets it by hand. Nothing is inferred from focusability: an
59
+ * undeclared child keeps its natural tab stop and its own keys.
60
+ */
61
+ export declare const DOCK_SEAT_ATTR = "data-glass-dock-seat";
@@ -1 +1 @@
1
- @layer components{.dock-trigger,.dock-select-trigger,.dock-dropdown-trigger{display: inline-flex;align-items: center;justify-content: center;flex-shrink: 0;scale: 1;gap: var(--dock-trigger-gap,0.25rem);min-height: var(--dock-trigger-min-height,auto);padding: var(--dock-trigger-padding-block,0.25rem) var(--dock-trigger-padding-inline,0.5rem);white-space: nowrap;cursor: pointer;border: none;background: transparent;background-clip: content-box;border-radius: var(--dock-control-radius,var(--radius-pill));color: color-mix( in srgb,var(--dock-fg-on-aurora,var(--foreground)) calc(var(--opacity-icon-muted) * 100%),transparent );outline: none;transition: background-color var(--dock-motion-fast),color var(--dock-motion-fast),scale var(--dock-press-spring),opacity var(--dock-motion-fast);}.dock-trigger:hover:not(:disabled),.dock-select-trigger:hover:not(:disabled),.dock-dropdown-trigger:hover:not(:disabled){background: var(--dock-control-hover-bg);color: var(--btn-hover-color,var(--foreground));}.dock-trigger:active:not(:disabled),.dock-select-trigger:active:not(:disabled),.dock-dropdown-trigger:active:not(:disabled){background: var(--dock-control-press-bg);scale: var(--scale-press-dock);}.dock-trigger:focus:not(:focus-visible),.dock-select-trigger:focus:not(:focus-visible),.dock-dropdown-trigger:focus:not(:focus-visible){outline: none;}.dock-trigger:focus-visible,.dock-select-trigger:focus-visible,.dock-dropdown-trigger:focus-visible{transition: background-color var(--dock-motion-fast),color var(--dock-motion-fast),scale var(--dock-press-spring),opacity var(--dock-motion-fast),box-shadow var(--dock-motion-fast);}.dock-trigger:is( .is-active,.active,[aria-expanded="true"],[aria-pressed="true"] ),.dock-select-trigger:is( .is-active,.active,[aria-expanded="true"],[aria-pressed="true"] ),.dock-dropdown-trigger:is( .is-active,.active,[aria-expanded="true"],[aria-pressed="true"] ){background: var(--dock-control-active-bg);color: var(--foreground);}.dock-select-trigger__chevron{width: var(--dock-trigger-icon-size,0.75rem);height: var(--dock-trigger-icon-size,0.75rem);flex-shrink: 0;opacity: 0.5;rotate: 0deg;transition: rotate var(--dock-press-spring);}.dock-select-trigger[data-state="open"] .dock-select-trigger__chevron{rotate: 180deg;}}
1
+ @layer components{.dock-trigger,.dock-select-trigger,.dock-dropdown-trigger{display: inline-flex;align-items: center;justify-content: center;flex-shrink: 0;scale: 1;gap: var(--dock-trigger-gap,0.25rem);min-height: var(--dock-trigger-min-height,auto);padding: var(--dock-trigger-padding-block,0.25rem) var(--dock-trigger-padding-inline,0.5rem);white-space: nowrap;cursor: pointer;border: none;background: transparent;background-clip: content-box;border-radius: var(--dock-control-radius,var(--radius-pill));color: color-mix( in srgb,var(--dock-fg-on-aurora,var(--foreground)) calc(var(--opacity-icon-muted) * 100%),transparent );outline: none;transition: background-color var(--dock-motion-fast),color var(--dock-motion-fast),scale var(--dock-press-spring),opacity var(--dock-motion-fast);}.dock-trigger:hover:not([aria-disabled="true"]){background: var(--dock-control-hover-bg);color: var(--btn-hover-color,var(--foreground));}.dock-trigger:active:not([aria-disabled="true"]){background: var(--dock-control-press-bg);scale: var(--scale-press-dock);}.dock-trigger:focus:not(:focus-visible),.dock-select-trigger:focus:not(:focus-visible),.dock-dropdown-trigger:focus:not(:focus-visible){outline: none;}.dock-trigger:focus-visible,.dock-select-trigger:focus-visible,.dock-dropdown-trigger:focus-visible{transition: background-color var(--dock-motion-fast),color var(--dock-motion-fast),scale var(--dock-press-spring),opacity var(--dock-motion-fast),box-shadow var(--dock-motion-fast);}.dock-trigger:is( .is-active,.active,[aria-expanded="true"],[aria-pressed="true"] ),.dock-select-trigger:is( .is-active,.active,[aria-expanded="true"],[aria-pressed="true"] ),.dock-dropdown-trigger:is( .is-active,.active,[aria-expanded="true"],[aria-pressed="true"] ){background: var(--dock-control-active-bg);color: var(--foreground);}.dock-select-trigger__chevron{width: var(--dock-trigger-icon-size,0.75rem);height: var(--dock-trigger-icon-size,0.75rem);flex-shrink: 0;opacity: 0.5;rotate: 0deg;transition: rotate var(--dock-press-spring);}.dock-select-trigger[data-state="open"] .dock-select-trigger__chevron{rotate: 180deg;}}
@@ -1 +1 @@
1
- @import "./shell.css";@import "./shell-regions.css";@import "./dock.css";@import "./morph.css";@import "./adaptive-legibility.css";@import "./density.css";@import "./shape.css";@import "./layers.css";@import "./layer-group.css";@import "./crossfade.css";@import "./run.css";@import "./cta-seat.css";@import "./search.css";@property --dock-morph-t{syntax: "<number>";inherits: true;initial-value: 0;}@property --dock-t{syntax: "<number>";inherits: false;initial-value: 0;}@property --dock-local-scale{syntax: "<number>";inherits: true;initial-value: 1;}@property --dock-scale{syntax: "<number>";inherits: true;initial-value: 1;}@property --dock-pitch{syntax: "<length>";inherits: true;initial-value: 0px;}@property --dock-open-pitches{syntax: "<number>";inherits: true;initial-value: 3;}@layer components{:where( .glass-dock,.dock-layer-tab,.dock-icon-button,.dark-mode-toggle-button,.dock-tab-button,.dock-select-trigger,.dock-dropdown-trigger ){--dock-motion-fast: var(--duration-fast) var(--ease-standard);--dock-motion-standard: var(--duration-normal) var(--ease-standard);--dock-motion-resize: var(--spring-dock-duration) var(--dock-resize-spring);--dock-ring-width: var(--focus-ring-width);--dock-ring-offset: var(--focus-ring-width);--dock-ring-color: color-mix(in srgb,var(--focus-ring-color) 48%,transparent);--dock-ring-reserve: calc(var(--dock-ring-width) + var(--dock-ring-offset));}.dock-icon-button:focus-visible,.dock-tab-button:focus-visible,.dock-select-trigger:focus-visible,.dock-dropdown-trigger:focus-visible{outline: var(--dock-ring-width) solid var(--dock-ring-color);outline-offset: var(--dock-ring-offset);}.glass-dock [data-ring-yield]:focus-visible{outline: none;}.dock-icon-button:disabled,.dock-tab-button:disabled,.dock-select-trigger:disabled,.dock-dropdown-trigger:disabled,.dock-icon-button[aria-disabled="true"],.dock-tab-button[aria-disabled="true"]{opacity: var(--opacity-disabled);cursor: not-allowed;}}
1
+ @import "./shell.css";@import "./shell-regions.css";@import "./dock.css";@import "./morph.css";@import "./adaptive-legibility.css";@import "./density.css";@import "./shape.css";@import "./layers.css";@import "./layer-group.css";@import "./crossfade.css";@import "./run.css";@import "./cta-seat.css";@import "./search.css";@property --dock-morph-t{syntax: "<number>";inherits: true;initial-value: 0;}@property --dock-t{syntax: "<number>";inherits: false;initial-value: 0;}@property --dock-local-scale{syntax: "<number>";inherits: true;initial-value: 1;}@property --dock-scale{syntax: "<number>";inherits: true;initial-value: 1;}@property --dock-pitch{syntax: "<length>";inherits: true;initial-value: 0px;}@property --dock-open-pitches{syntax: "<number>";inherits: true;initial-value: 3;}@layer components{:where( .glass-dock,.dock-layer-tab,.dock-icon-button,.dark-mode-toggle-button,.dock-tab-button,.dock-select-trigger,.dock-dropdown-trigger ){--dock-motion-fast: var(--duration-fast) var(--ease-standard);--dock-motion-standard: var(--duration-normal) var(--ease-standard);--dock-motion-resize: var(--spring-dock-duration) var(--dock-resize-spring);--dock-ring-width: var(--focus-ring-width);--dock-ring-offset: var(--focus-ring-width);--dock-ring-color: color-mix(in srgb,var(--focus-ring-color) 48%,transparent);--dock-ring-reserve: calc(var(--dock-ring-width) + var(--dock-ring-offset));}.dock-icon-button:focus-visible,.dock-tab-button:focus-visible,.dock-select-trigger:focus-visible,.dock-dropdown-trigger:focus-visible{outline: var(--dock-ring-width) solid var(--dock-ring-color);outline-offset: var(--dock-ring-offset);}.glass-dock [data-ring-yield]:focus-visible{outline: none;}.dock-icon-button:disabled,.dock-tab-button:disabled,.dock-icon-button[aria-disabled="true"],.dock-tab-button[aria-disabled="true"],.dock-trigger[aria-disabled="true"]{opacity: var(--opacity-disabled);cursor: not-allowed;}}