@glasshome/ui 1.43.0 → 1.44.0
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/SPEC.md +8 -5
- package/dist/index.js +2 -2
- package/dist/lib/behavior/anchored.d.ts +7 -8
- package/dist/lib/behavior/focus-scope.d.ts +4 -2
- package/dist/lib/behavior/menu.d.ts +3 -0
- package/dist/lib/motion-classes.d.ts +1 -0
- package/dist/solid/data-table.d.ts +4 -2
- package/dist/solid/index.js +3115 -3123
- package/dist/{utils-3Codx-NZ.js → utils-BbIeGt7o.js} +524 -500
- package/package.json +1 -1
- package/src/lib/behavior/anchored.ts +17 -3
- package/src/lib/behavior/collection.ts +9 -18
- package/src/lib/behavior/focus-scope.ts +51 -10
- package/src/lib/behavior/menu.ts +20 -28
- package/src/lib/behavior/modal-root.tsx +2 -2
- package/src/lib/clipboard.ts +2 -2
- package/src/lib/motion-classes.ts +1 -2
- package/src/solid/area-picker.tsx +1 -2
- package/src/solid/bottom-sheet/arbitration.ts +4 -11
- package/src/solid/bottom-sheet/bottom-sheet.tsx +3 -4
- package/src/solid/bottom-sheet/drag-controller.ts +7 -20
- package/src/solid/data-table.tsx +48 -22
- package/src/solid/dialog-parts.tsx +30 -8
- package/src/solid/dock.tsx +41 -41
- package/src/solid/entity-selector.tsx +0 -1
- package/src/solid/icon-picker.tsx +1 -2
- package/src/solid/image-picker.tsx +2 -2
- package/src/solid/menu-parts.tsx +1 -20
- package/src/solid/option-card.tsx +1 -3
- package/src/solid/popover.tsx +10 -12
- package/src/solid/select.tsx +4 -15
- package/src/solid/selection.tsx +28 -13
- package/src/solid/sliding-indicator.tsx +3 -15
- package/src/solid/toggle-group.tsx +5 -2
- package/src/styles/globals.css +0 -43
- package/src/styles/theme.css +5 -2
package/SPEC.md
CHANGED
|
@@ -269,8 +269,8 @@ Held by the `dialog-anatomy` gate in apps and in this package.
|
|
|
269
269
|
|
|
270
270
|
## Motion (the pillar)
|
|
271
271
|
|
|
272
|
-
Motion is one system, not per-component flair.
|
|
273
|
-
`lib/motion-classes.ts
|
|
272
|
+
Motion is one system, not per-component flair. The rules are held by
|
|
273
|
+
`lib/motion-classes.ts` and the `--glass-*` transition in
|
|
274
274
|
`globals.css`, on the theme tokens `--duration-*` / `--ease-*` (zeroed under
|
|
275
275
|
`prefers-reduced-motion`):
|
|
276
276
|
|
|
@@ -284,9 +284,12 @@ Motion is one system, not per-component flair. Four rules, all held by
|
|
|
284
284
|
a card with sub-options grows to reveal them (OptionCard's drawer), an
|
|
285
285
|
indicator slides and stretches (SelectionScope, position bars). Nothing is
|
|
286
286
|
swapped in below or beside its origin.
|
|
287
|
-
3. **Children arrive
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
3. **Children arrive with their panel.** Rows never animate one by one: the
|
|
288
|
+
panel's own motion carries them. Animations that run beside each other and
|
|
289
|
+
end at different times keep the main thread drawing every frame, and each of
|
|
290
|
+
those frames restyles every animating element. New motion
|
|
291
|
+
animates `transform`, `translate`, `scale` or `opacity`, which the compositor
|
|
292
|
+
runs; `clip-path` and registered custom properties run on the main thread.
|
|
290
293
|
4. **Leaving is the same path, faster.** Contract on `--ease-contract` at half
|
|
291
294
|
the arrival time. Pressables dip (`PRESS_DIP`).
|
|
292
295
|
5. **Ambient motion is an event.** A wallpaper or decorative loop runs for a
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e,
|
|
1
|
+
import { $ as e, $t as t, An as n, B as r, C as i, Cn as a, Dn as ee, E as te, En as ne, F as o, G as s, Gt as c, H as l, I as u, It as d, J as f, Jt as p, K as m, L as h, M as g, N as _, O as v, On as y, P as b, Q as x, Sn as S, St as C, T as w, U as T, Ut as E, V as D, W as O, Wt as k, X as A, Y as j, Yt as M, Z as N, _ as P, _n as F, _t as I, an as L, at as R, b as z, bn as B, bt as V, c as H, cn as U, ct as W, d as G, dt as K, f as q, ft as J, g as Y, gn as X, gt as Z, h as re, hn as ie, ht as ae, i as oe, in as se, it as ce, j as le, jn as ue, kn as de, l as fe, ln as pe, lt as me, m as he, mn as ge, mt as _e, n as ve, nn as ye, nt as be, o as xe, ot as Se, p as Ce, pn as we, pt as Te, q as Ee, r as De, s as Oe, sn as ke, st as Ae, t as je, tn as Me, un as Ne, ut as Pe, v as Fe, vt as Q, w as Ie, wn as Le, x as Re, xn as ze, xt as Be, y as Ve, yn as He, yt as Ue, z as We } from "./utils-BbIeGt7o.js";
|
|
2
2
|
//#region src/lib/motion-window.ts
|
|
3
3
|
var $ = 3e4;
|
|
4
4
|
function Ge(e = $) {
|
|
@@ -17,4 +17,4 @@ function Ge(e = $) {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
|
-
export {
|
|
20
|
+
export { He as ALERT_CLASS, B as ALERT_CONTENT_CLASS, ze as ALERT_DESCRIPTION_CLASS, S as ALERT_ICON_BG_CLASS, a as ALERT_ICON_CLASS, Le as ALERT_ICON_PATHS, ne as ALERT_TITLE_CLASS, ee as ALERT_TONES, we as BUTTON_DEFAULT_CLASS, ge as BUTTON_OUTLINE_CLASS, d as CARD_BLUR, E as CARD_SURFACE, k as CARD_SURFACE_BASE, c as CARD_SURFACE_OPAQUE, R as CAROUSEL_DOTS, Se as CAROUSEL_VIEWPORT, re as CHIP, J as CONTROL_H, Fe as CONTROL_H_TOUCH, Te as CONTROL_ON, _e as FIELD_CHROME, ae as FIELD_CONTROL, t as FIELD_MOTION, Z as FIELD_TEXT, Re as FLOATING_PANEL, I as FOCUS_RING, g as HOLD_GRACE_MS, _ as HOLD_MS, ie as ICON_BUTTON_CLASS, Y as ICON_PILL, P as ICON_PILL_TINT, Q as INPUT_CLASS, Ue as INPUT_SURFACE, V as INVALID_RING, l as LOGO_DEFAULT_SIZE, T as LOGO_DEFAULT_SRC, O as LOGO_DEFAULT_SUB, s as LOGO_MARK_CLASS, m as LOGO_MARK_PX, Ee as LOGO_NAME_CLASS, f as LOGO_ROOT_CLASS, j as LOGO_SIZES, A as LOGO_STACK_CLASS, N as LOGO_SUB_CLASS, u as MENU_ITEM, h as MENU_ITEM_BASE, We as MENU_ITEM_X, r as MENU_LABEL, D as MENU_SEPARATOR, ve as MOBILE_BREAKPOINT, Me as MODAL_MOTION, ye as MORPH_MOTION, $ as MOTION_WINDOW_MS, X as OUTLINE_SURFACE, i as OVERLAY_BLUR, se as OVERLAY_MOTION, Ie as OVERLAY_SURFACE, w as OVERLAY_SURFACE_BASE, te as OVERLAY_SURFACE_OPAQUE, Ve as PICKER_LIST, z as PICKER_TRIGGER, Pe as POSITION_BAR, K as POSITION_BAR_LIT, L as PRESS_DIP, v as SCRIM_CLASS, ke as SCRIM_MOTION, G as SECTION_INNER_RADIUS, q as SECTION_OUTER_RADIUS, Ce as SECTION_PADDING, he as SECTION_ROW_CLASS, p as SECTION_ROW_SURFACE, fe as SEGMENT_ITEM, U as SETTLE_MOTION, pe as STAGGER, Ne as STALE_CONTENT, oe as THUMB_CLASS, xe as THUMB_RAIL_BLEED, Oe as THUMB_RAIL_PAD, H as THUMB_SIZE, M as TRACK_SURFACE, x as Z, e as Z_CLASS, y as alertBorder, de as alertFill, n as alertIconBgStyle, ue as alertIconFill, le as anchorToTriggerTop, F as buttonVariants, Ae as carouselDot, W as carouselItem, me as carouselTrack, je as cn, Be as copyImage, C as copyText, b as createHold, De as createIsMobile, be as glassToneText, o as spendLongPress, Ge as startMotionWindow, ce as toneTextMix };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Accessor } from "solid-js";
|
|
2
|
-
import { type Align, type Side } from "../anchor-placement.js";
|
|
2
|
+
import { type Align, type Box, type Side } from "../anchor-placement.js";
|
|
3
3
|
/** An element, or a point or box with no element of its own: a context menu opens at the pointer. */
|
|
4
4
|
export interface AnchorLike {
|
|
5
|
-
getBoundingClientRect()
|
|
6
|
-
left: number;
|
|
7
|
-
top: number;
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
};
|
|
5
|
+
getBoundingClientRect: () => Box;
|
|
11
6
|
getRootNode?(): Node;
|
|
12
7
|
}
|
|
8
|
+
export interface Anchored {
|
|
9
|
+
/** Where the part was last placed, from the measure that placed it. */
|
|
10
|
+
placed: () => Box | undefined;
|
|
11
|
+
}
|
|
13
12
|
export interface AnchoredOptions {
|
|
14
13
|
anchor: Accessor<AnchorLike | undefined>;
|
|
15
14
|
floating: Accessor<HTMLElement | undefined>;
|
|
@@ -23,4 +22,4 @@ export interface AnchoredOptions {
|
|
|
23
22
|
/** A custom property the part gets the anchor's width in, for styles sized by the anchor. */
|
|
24
23
|
widthVar?: string;
|
|
25
24
|
}
|
|
26
|
-
export declare function createAnchored(options: AnchoredOptions):
|
|
25
|
+
export declare function createAnchored(options: AnchoredOptions): Anchored;
|
|
@@ -11,8 +11,10 @@ export interface FocusScope {
|
|
|
11
11
|
skipRestore(): void;
|
|
12
12
|
untrap(): void;
|
|
13
13
|
}
|
|
14
|
-
/** The focused element in the node's own root,
|
|
15
|
-
export declare function
|
|
14
|
+
/** The focused element in the node's own root, kept from focusin and focusout, which a sealed widget receives without asking the page. */
|
|
15
|
+
export declare function focusedIn(node: Node): Element | null;
|
|
16
|
+
/** Whether focus sits on nothing, or still inside `el`, so a closing panel may hand it back. */
|
|
17
|
+
export declare function focusFell(el: Element): boolean;
|
|
16
18
|
/** Whether `el` holds focus, from its own focus and blur events, which a sealed widget receives without asking the page. */
|
|
17
19
|
export declare function trackFocus(el: Element): {
|
|
18
20
|
has: () => boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Accessor } from "solid-js";
|
|
2
2
|
import type { Align, Side } from "../anchor-placement.js";
|
|
3
|
+
import type { Box } from "../anchor-placement.js";
|
|
3
4
|
import { type AnchorLike } from "./anchored.js";
|
|
4
5
|
export declare const SUBMENU_OPEN_DELAY_MS = 100;
|
|
5
6
|
export declare const POINTER_GRACE_MS = 300;
|
|
@@ -32,6 +33,8 @@ export interface Menu {
|
|
|
32
33
|
open: Accessor<boolean>;
|
|
33
34
|
dir: Accessor<Dir>;
|
|
34
35
|
content: Accessor<HTMLElement | undefined>;
|
|
36
|
+
/** Where the open panel sits, as it was placed. */
|
|
37
|
+
placed: () => Box | undefined;
|
|
35
38
|
setContent: (el: HTMLElement | undefined) => void;
|
|
36
39
|
trigger: Accessor<HTMLElement | undefined>;
|
|
37
40
|
setTrigger: (el: HTMLElement | undefined) => void;
|
|
@@ -2,6 +2,7 @@ export declare const OVERLAY_MOTION = "origin-(--kb-popper-content-transform-ori
|
|
|
2
2
|
export declare const FIELD_MOTION = "data-[closed]:animate-select-out data-[expanded]:animate-select-in";
|
|
3
3
|
export declare const MORPH_MOTION = "[--morph-w:var(--kb-popper-anchor-width)] min-w-[var(--kb-popper-anchor-width)] data-[expanded]:animate-morph-in data-[closed]:animate-morph-out";
|
|
4
4
|
export declare const ANCHORED_MOTION = "data-[expanded]:animate-anchored-in data-[closed]:animate-morph-out";
|
|
5
|
+
/** @deprecated Rows arrive with their panel; the class does nothing. Removed in 2.0.0. */
|
|
5
6
|
export declare const STAGGER = "gh-stagger";
|
|
6
7
|
export declare const MODAL_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[expanded]:zoom-in-[0.94] data-[expanded]:slide-in-from-bottom-2 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fill-mode-forwards data-[closed]:fade-out-0 data-[closed]:zoom-out-[0.96]";
|
|
7
8
|
export declare const SCRIM_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fill-mode-forwards data-[closed]:fade-out-0";
|
|
@@ -24,8 +24,10 @@ export declare function TableFilterSelect(props: {
|
|
|
24
24
|
options: readonly string[];
|
|
25
25
|
value: string;
|
|
26
26
|
onChange: (value: string) => void;
|
|
27
|
-
label: (value: string) =>
|
|
27
|
+
label: (value: string) => JSX.Element;
|
|
28
28
|
ariaLabel: string;
|
|
29
|
+
/** Leading icon, `prefix:name`; defaults to the filter funnel. */
|
|
30
|
+
icon?: string;
|
|
29
31
|
class?: string;
|
|
30
32
|
}): JSX.Element;
|
|
31
33
|
/** Toolbar search box: leading icon, h-9, trailing clear. Debounce in caller. */
|
|
@@ -85,7 +87,7 @@ export declare function TableError(props: {
|
|
|
85
87
|
message: JSX.Element;
|
|
86
88
|
onRetry: () => void;
|
|
87
89
|
}): JSX.Element;
|
|
88
|
-
/** The end of a long table: asks for the next page as it nears the viewport
|
|
90
|
+
/** The end of a long table: once the page scrolls, asks for the next page as it nears the viewport; or on press. */
|
|
89
91
|
export declare function TableLoadMore(props: {
|
|
90
92
|
hasMore: boolean;
|
|
91
93
|
loading?: boolean;
|