@glasshome/ui 1.10.1 → 1.11.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 CHANGED
@@ -107,6 +107,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
107
107
  | an avatar or icon beside a modal title | `<Header media={…}>` | a hand-rolled row inside the header |
108
108
  | a tab row in a modal header | `<Tabs layout="split">` around the parts, `<Header wrap action={<TabsList class="w-auto">…}>` | `class="contents"` on `Tabs` and `flex-wrap` by hand |
109
109
  | a form inside a modal | `<Body as="form" id="…">` + a footer button with `form="…"` | a `display: contents` form wrapper inside the Body |
110
+ | a glyph | `<Icon icon="lucide:plus" width={16}>` (inline svg from the host's `provideIcons` source) | `<iconify-icon>`, `@iconify-icon/solid` |
110
111
  | a status chip | `<Badge tone="var(--success)">` | `rounded-full bg-green-500/10` |
111
112
  | a callout | `<Alert tone="warning">` | `border-amber-500/30 bg-amber-500/10` |
112
113
  | a labelled group inside a card | `<SectionGroup icon label count action>` | a hand-rolled `SectionIcon` + `SectionSubtitle` header row |
@@ -144,6 +145,12 @@ Motion is one system, not per-component flair. Four rules, all held by
144
145
  read top to bottom as it opens. Mount-only: live re-renders never re-stagger.
145
146
  4. **Leaving is the same path, faster.** Contract on `--ease-contract` at half
146
147
  the arrival time. Pressables dip (`PRESS_DIP`).
148
+ 5. **Ambient motion is an event.** A wallpaper or decorative loop runs for a
149
+ window after mount or a touch, then freezes mid-phase; an idle screen
150
+ animates nothing. The host holds `html[data-motion="live"]` for the window
151
+ (dash: `createMotionWindow`, 30 s); light-DOM loops gate on that attribute,
152
+ widget shadow roots on the inherited `--motion-ambient` (1 live, else 0).
153
+ A wrapper with `data-motion="still"` opts out: thumbnails are stills.
147
154
 
148
155
  A new component with an open, pick or reveal state uses these doors before it
149
156
  gets any motion of its own; a motion need none of them covers is added to
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, Gt as m, H as h, Ht as g, I as _, It as v, J as y, Jt as b, Kt as x, L as S, M as C, Mt as w, N as T, Nt as E, O as D, Ot as O, P as k, Pt as A, Q as j, R as M, Rt as N, S as P, St as F, T as I, Tt as L, U as R, Ut as z, V as B, Vt as V, Wt as H, X as U, Y as W, Yt as G, Z as K, _ as q, _t as J, at as Y, b as X, c as Z, ct as Q, d as $, et as ee, f as te, g as ne, h as re, i as ie, it as ae, j as oe, jt as se, k as ce, kt as le, l as ue, m as de, n as fe, nt as pe, o as me, ot as he, p as ge, q as _e, qt as ve, r as ye, rt as be, s as xe, st as Se, t as Ce, tt as we, u as Te, ut as Ee, v as De, vt as Oe, w as ke, wt as Ae, x as je, y as Me, yt as Ne, z as Pe, zt as Fe } from "./utils-CIwpbaOd.js";
1
+ import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, Gt as m, H as h, Ht as g, I as _, It as v, J as y, Jt as b, Kt as x, L as S, M as C, Mt as w, N as T, Nt as E, O as D, Ot as O, P as k, Pt as A, Q as j, R as M, Rt as N, S as P, St as F, T as I, Tt as L, U as R, Ut as z, V as B, Vt as V, Wt as H, X as U, Y as W, Yt as G, Z as K, _ as q, _t as J, at as Y, b as X, c as Z, ct as Q, d as $, et as ee, f as te, g as ne, h as re, i as ie, it as ae, j as oe, jt as se, k as ce, kt as le, l as ue, m as de, n as fe, nt as pe, o as me, ot as he, p as ge, q as _e, qt as ve, r as ye, rt as be, s as xe, st as Se, t as Ce, tt as we, u as Te, ut as Ee, v as De, vt as Oe, w as ke, wt as Ae, x as je, y as Me, yt as Ne, z as Pe, zt as Fe } from "./utils-CdUh67Y9.js";
2
2
  export { N as ALERT_CLASS, Fe as ALERT_CONTENT_CLASS, i as ALERT_DESCRIPTION_CLASS, V as ALERT_ICON_BG_CLASS, g as ALERT_ICON_CLASS, z as ALERT_ICON_PATHS, H as ALERT_TITLE_CLASS, m as ALERT_TONES, w as BUTTON_DEFAULT_CLASS, E as BUTTON_OUTLINE_CLASS, Ee as CARD_BLUR, J as CARD_SURFACE, Oe as CARD_SURFACE_BASE, Ne as CARD_SURFACE_OPAQUE, y as CAROUSEL_DOTS, W as CAROUSEL_VIEWPORT, de as CHIP, we as CONTROL_H, q as CONTROL_H_TOUCH, pe as FIELD_CHROME, be as FIELD_CONTROL, Ae as FIELD_MOTION, ae as FIELD_TEXT, X as FLOATING_PANEL, Y as FOCUS_RING, A as ICON_BUTTON_CLASS, re as ICON_PILL, ne as ICON_PILL_TINT, he as INPUT_CLASS, Se as INPUT_SURFACE, Q as INVALID_RING, C as LOGO_DEFAULT_SIZE, T as LOGO_DEFAULT_SRC, k as LOGO_DEFAULT_SUB, d as LOGO_MARK_CLASS, _ as LOGO_MARK_PX, S as LOGO_NAME_CLASS, M as LOGO_ROOT_CLASS, Pe as LOGO_SIZES, r as LOGO_STACK_CLASS, B as LOGO_SUB_CLASS, s as MENU_ITEM, D as MENU_ITEM_BASE, ce as MENU_ITEM_X, t as MENU_LABEL, oe as MENU_SEPARATOR, fe as MOBILE_BREAKPOINT, L as MODAL_MOTION, u as MORPH_MOTION, f as OUTLINE_SURFACE, je as OVERLAY_BLUR, c as OVERLAY_MOTION, P as OVERLAY_SURFACE, a as OVERLAY_SURFACE_BASE, ke as OVERLAY_SURFACE_OPAQUE, De as PICKER_LIST, Me as PICKER_TRIGGER, e as POSITION_BAR, ee as POSITION_BAR_LIT, O as PRESS_DIP, I as SCRIM_CLASS, le as SCRIM_MOTION, Te as SECTION_INNER_RADIUS, $ as SECTION_OUTER_RADIUS, te as SECTION_PADDING, ge as SECTION_ROW_CLASS, F as SECTION_ROW_SURFACE, ue as SEGMENT_ITEM, n as SETTLE_MOTION, se as STAGGER, ie as THUMB_CLASS, me as THUMB_RAIL_BLEED, xe as THUMB_RAIL_PAD, Z as THUMB_SIZE, o as TRACK_SURFACE, h as Z, R as Z_CLASS, x as alertBorder, ve as alertFill, b as alertIconBgStyle, G as alertIconFill, l as anchorToTriggerTop, v as buttonVariants, U as carouselDot, K as carouselItem, j as carouselTrack, Ce as cn, ye as createIsMobile, p as glassToneText, _e as toneTextMix };
@@ -1,5 +1,5 @@
1
- export declare const MENU_ITEM_BASE = "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&:not([data-tone])_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>iconify-icon]:shrink-0 [&>iconify-icon]:text-[16px]";
1
+ export declare const MENU_ITEM_BASE = "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&:not([data-tone])_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>[data-slot=icon]]:shrink-0 [&>[data-slot=icon]]:text-[16px]";
2
2
  export declare const MENU_ITEM_X = "px-2";
3
- export declare const MENU_ITEM = "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&:not([data-tone])_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>iconify-icon]:shrink-0 [&>iconify-icon]:text-[16px] px-2";
3
+ export declare const MENU_ITEM = "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&:not([data-tone])_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>[data-slot=icon]]:shrink-0 [&>[data-slot=icon]]:text-[16px] px-2";
4
4
  export declare const MENU_LABEL = "px-2 py-1.5 font-medium text-muted-foreground text-xs";
5
5
  export declare const MENU_SEPARATOR = "-mx-1 my-1 h-px bg-border";
@@ -1,14 +1,20 @@
1
- import "iconify-icon";
2
- import type { IconifyIconProperties } from "iconify-icon";
3
- import type { JSX } from "solid-js";
4
- declare module "solid-js" {
5
- namespace JSX {
6
- interface IntrinsicElements {
7
- "iconify-icon": HTMLAttributes<HTMLElement> & IconifyIconProperties & {
8
- rotate?: string | number;
9
- };
10
- }
11
- }
1
+ import type { IconifyIcon } from "@iconify/types";
2
+ import { type JSX } from "solid-js";
3
+ export type IconData = IconifyIcon;
4
+ export interface IconSource {
5
+ /** Icons known at build time, keyed `prefix:name`. */
6
+ bundled: Record<string, IconData>;
7
+ /** Resolves the rest in one batch; a name the source does not have maps to null. */
8
+ load?: (names: string[]) => Promise<Record<string, IconData | null>>;
12
9
  }
13
- export type IconProps = JSX.IntrinsicElements["iconify-icon"];
10
+ /** Host apps call this once at startup; every mounted Icon re-resolves. */
11
+ export declare function provideIcons(next: IconSource): void;
12
+ export interface IconProps extends Omit<JSX.SvgSVGAttributes<SVGSVGElement>, "width" | "height" | "children"> {
13
+ /** `prefix:name`, e.g. `lucide:plus`. */
14
+ icon: string;
15
+ /** Unitless = px; both omitted = 1em, one omitted = the icon's own ratio. */
16
+ width?: number | string;
17
+ height?: number | string;
18
+ }
19
+ /** One inline `<svg>` per icon: no shadow root, no observer, rendered once and kept. */
14
20
  export declare function Icon(props: IconProps): JSX.Element;
@@ -37,6 +37,7 @@ export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLab
37
37
  export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, } from "./form.js";
38
38
  export { HeroAction } from "./hero-action.js";
39
39
  export { HoverCard, HoverCardContent, HoverCardTrigger, } from "./hover-card.js";
40
+ export { Icon, type IconData, type IconProps, type IconSource, provideIcons } from "./icon.js";
40
41
  export { IconPicker, type IconPickerProps } from "./icon-picker.js";
41
42
  export { ImagePicker, type ImagePickerProps } from "./image-picker.js";
42
43
  export { Input } from "./input.js";