@glasshome/ui 1.29.1 → 1.31.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
@@ -191,6 +191,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
191
191
  | rows that belong to the row above them | `<FieldSubGroup>` | a bare `<Separator>` and a left pad |
192
192
  | picking one of a few described choices | `<OptionCardGroup>` + `<OptionCard>` | a hand-rolled `role="radio"` card list |
193
193
  | picking one of a few results you can see (pictures, shapes, previews) | `<PreviewTileGroup>` + `<PreviewTile>` | a grid of `aria-pressed` buttons by hand |
194
+ | where a catalog item comes from (official, community, built in) | `<SourceMarks official builtIn>`, in a tile through `<PreviewTile marks>` | a `badge-check` icon or a "Built in" byline by hand |
194
195
  | one colour out of a few | `<SwatchPicker>` (+ a picker as its child) | round buttons by hand |
195
196
  | an editor that leaves the page live behind it | `<DockedPanel>` + its Header, Body, Footer | a `<Sheet>` with its scrim hidden |
196
197
  | tabs above a stack of toggle groups | `<TabsTrigger icon>` | an `<Icon>` placed inside the trigger by hand |
@@ -201,6 +202,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
201
202
  | tinted text alone | `glassToneText(tone)` | ad-hoc color-mix |
202
203
  | a metallic tier chip | `<TierBadge>` | gradients by hand |
203
204
  | the ambient motion window | `startMotionWindow()` | an app-local timer writing `data-motion` |
205
+ | copying text or an image | `<CopyButton>`, `useCopyText()`, `copyText()` / `copyImage()` (from the click; text still loading goes in as a promise) | `navigator.clipboard`, `document.execCommand("copy")` |
204
206
  | a built-in wallpaper | `GEOMETRIC_HOUSES_SVG` from `@glasshome/ui/backgrounds` | an app's own copy of the SVG |
205
207
  | pointing at a control while the user operates it | `<Spotlight>` (`blocking` on a targetless veil so the action inside the bubble is the only press that lands; a target taller than half the viewport places the bubble inside it, near the top, instead of above or below; the bubble carries a tail toward its `anchor`, which defaults to `target` and may point at a different element than the hole) | a hand-rolled fixed overlay with a cutout |
206
208
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { ALERT_CLASS, ALERT_CONTENT_CLASS, ALERT_DESCRIPTION_CLASS, ALERT_ICON_BG_CLASS, ALERT_ICON_CLASS, ALERT_ICON_PATHS, ALERT_TITLE_CLASS, ALERT_TONES, type AlertTone, type AlertToneStyle, alertBorder, alertFill, alertIconBgStyle, alertIconFill, } from "./lib/alert-tones.js";
2
2
  export { BUTTON_DEFAULT_CLASS, BUTTON_OUTLINE_CLASS, buttonVariants, ICON_BUTTON_CLASS, OUTLINE_SURFACE, } from "./lib/button-variants.js";
3
3
  export { CARD_BLUR, CARD_SURFACE, CARD_SURFACE_BASE, CARD_SURFACE_OPAQUE, SECTION_ROW_SURFACE, TRACK_SURFACE, } from "./lib/card-classes.js";
4
+ export { copyImage, copyText } from "./lib/clipboard.js";
4
5
  export { CAROUSEL_DOTS, CAROUSEL_VIEWPORT, type CarouselTransition, carouselDot, carouselItem, carouselTrack, } from "./lib/carousel-classes.js";
5
6
  export { glassToneText, toneTextMix } from "./lib/glass-tone.js";
6
7
  export { CONTROL_H, CONTROL_ON, FIELD_CHROME, FIELD_CONTROL, FIELD_TEXT, FOCUS_RING, INPUT_CLASS, INPUT_SURFACE, INVALID_RING, } from "./lib/input-classes.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as e, A as t, At as n, B as r, C as i, Ct as a, D as ee, Dt as te, E as ne, F as o, Ft as s, G as c, Gt as l, H as u, Ht as d, I as f, Jt as p, K as m, L as h, Lt as g, M as _, Mt as v, N as y, Nt as b, O as x, Ot as S, P as C, Pt as w, Q as T, Qt as E, R as D, Rt as O, S as k, St as A, U as j, Ut as M, V as N, Vt as P, W as F, Wt as I, Xt as L, Y as R, Yt as z, Z as B, Zt as V, _ as H, an as U, at as W, b as G, c as K, ct as q, d as J, dt as Y, en as X, et as Z, f as re, ft as ie, g as ae, h as oe, ht as se, i as ce, in as le, it as ue, j as de, k as fe, l as pe, lt as me, m as he, n as ge, nn as _e, nt as ve, o as ye, ot as be, p as xe, pt as Se, q as Ce, qt as we, r as Te, rn as Ee, rt as De, s as Oe, st as ke, t as Ae, tn as je, tt as Me, u as Ne, ut as Pe, v as Fe, w as Q, wt as Ie, x as Le, y as Re, z as ze, zt as Be } from "./utils-DcRd0bwQ.js";
1
+ import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as ee, D as te, E as ne, Et as o, F as s, Ft as c, G as l, Gt as u, H as d, I as f, It as p, K as m, Kt as h, L as g, Lt as _, M as v, Mt as y, N as b, O as x, P as S, Pt as C, Q as w, Qt as T, R as E, S as D, Tt as O, U as k, Ut as A, V as j, Vt as M, W as N, Wt as P, Xt as F, Y as I, Yt as L, Z as R, Zt as z, _ as B, _t as V, an as H, at as U, b as W, c as G, ct as K, d as q, dt as J, en as Y, et as X, f as Z, ft as re, g as ie, h as ae, ht as oe, i as se, in as ce, it as le, j as ue, k as de, kt as fe, l as pe, lt as me, m as he, mt as ge, n as _e, nn as ve, nt as ye, o as be, on as xe, ot as Se, p as Ce, pt as we, q as Te, qt as Ee, r as De, rn as Oe, rt as ke, s as Ae, sn as je, st as Me, t as Ne, tt as Pe, u as Fe, ut as Q, v as Ie, w as Le, wt as Re, x as ze, y as Be, z as Ve, zt as He } from "./utils-C0qKxkyh.js";
2
2
  //#region src/lib/motion-window.ts
3
3
  var $ = 3e4;
4
- function Ve(e = $) {
4
+ function Ue(e = $) {
5
5
  let t, n = document.documentElement, r = () => {
6
6
  clearTimeout(t), t = void 0, delete n.dataset.motion;
7
7
  }, i = () => {
@@ -17,4 +17,4 @@ function Ve(e = $) {
17
17
  };
18
18
  }
19
19
  //#endregion
20
- export { we as ALERT_CLASS, p as ALERT_CONTENT_CLASS, z as ALERT_DESCRIPTION_CLASS, L as ALERT_ICON_BG_CLASS, V as ALERT_ICON_CLASS, E as ALERT_ICON_PATHS, X as ALERT_TITLE_CLASS, je as ALERT_TONES, P as BUTTON_DEFAULT_CLASS, d as BUTTON_OUTLINE_CLASS, se as CARD_BLUR, A as CARD_SURFACE, a as CARD_SURFACE_BASE, Ie as CARD_SURFACE_OPAQUE, T as CAROUSEL_DOTS, e as CAROUSEL_VIEWPORT, he as CHIP, W as CONTROL_H, H as CONTROL_H_TOUCH, be as CONTROL_ON, ke as FIELD_CHROME, q as FIELD_CONTROL, n as FIELD_MOTION, me as FIELD_TEXT, G as FLOATING_PANEL, Pe as FOCUS_RING, x as HOLD_GRACE_MS, fe as HOLD_MS, M as ICON_BUTTON_CLASS, oe as ICON_PILL, ae as ICON_PILL_TINT, Y as INPUT_CLASS, ie as INPUT_SURFACE, Se as INVALID_RING, f as LOGO_DEFAULT_SIZE, h as LOGO_DEFAULT_SRC, D as LOGO_DEFAULT_SUB, ze as LOGO_MARK_CLASS, r as LOGO_MARK_PX, N as LOGO_NAME_CLASS, u as LOGO_ROOT_CLASS, j as LOGO_SIZES, F as LOGO_STACK_CLASS, c as LOGO_SUB_CLASS, de as MENU_ITEM, _ as MENU_ITEM_BASE, y as MENU_ITEM_X, C as MENU_LABEL, o as MENU_SEPARATOR, ge as MOBILE_BREAKPOINT, v as MODAL_MOTION, b as MORPH_MOTION, $ as MOTION_WINDOW_MS, I as OUTLINE_SURFACE, Le as OVERLAY_BLUR, w as OVERLAY_MOTION, k as OVERLAY_SURFACE, i as OVERLAY_SURFACE_BASE, Q as OVERLAY_SURFACE_OPAQUE, Fe as PICKER_LIST, Re as PICKER_TRIGGER, De as POSITION_BAR, ue as POSITION_BAR_LIT, s as PRESS_DIP, ne as SCRIM_CLASS, g as SCRIM_MOTION, Ne as SECTION_INNER_RADIUS, J as SECTION_OUTER_RADIUS, re as SECTION_PADDING, xe as SECTION_ROW_CLASS, te as SECTION_ROW_SURFACE, pe as SEGMENT_ITEM, O as SETTLE_MOTION, Be as STAGGER, ce as THUMB_CLASS, ye as THUMB_RAIL_BLEED, Oe as THUMB_RAIL_PAD, K as THUMB_SIZE, S as TRACK_SURFACE, m as Z, Ce as Z_CLASS, _e as alertBorder, Ee as alertFill, le as alertIconBgStyle, U as alertIconFill, ee as anchorToTriggerTop, l as buttonVariants, Z as carouselDot, Me as carouselItem, ve as carouselTrack, Ae as cn, Te as createIsMobile, R as glassToneText, t as spendLongPress, Ve as startMotionWindow, B as toneTextMix };
20
+ export { L as ALERT_CLASS, F as ALERT_CONTENT_CLASS, z as ALERT_DESCRIPTION_CLASS, T as ALERT_ICON_BG_CLASS, t as ALERT_ICON_CLASS, Y as ALERT_ICON_PATHS, ve as ALERT_TITLE_CLASS, Oe as ALERT_TONES, A as BUTTON_DEFAULT_CLASS, P as BUTTON_OUTLINE_CLASS, V as CARD_BLUR, Re as CARD_SURFACE, O as CARD_SURFACE_BASE, o as CARD_SURFACE_OPAQUE, w as CAROUSEL_DOTS, e as CAROUSEL_VIEWPORT, he as CHIP, U as CONTROL_H, B as CONTROL_H_TOUCH, Se as CONTROL_ON, Me as FIELD_CHROME, K as FIELD_CONTROL, y as FIELD_MOTION, me as FIELD_TEXT, W as FLOATING_PANEL, Q as FOCUS_RING, x as HOLD_GRACE_MS, de as HOLD_MS, u as ICON_BUTTON_CLASS, ae as ICON_PILL, ie as ICON_PILL_TINT, J as INPUT_CLASS, re as INPUT_SURFACE, we as INVALID_RING, f as LOGO_DEFAULT_SIZE, g as LOGO_DEFAULT_SRC, E as LOGO_DEFAULT_SUB, Ve as LOGO_MARK_CLASS, i as LOGO_MARK_PX, j as LOGO_NAME_CLASS, d as LOGO_ROOT_CLASS, k as LOGO_SIZES, N as LOGO_STACK_CLASS, l as LOGO_SUB_CLASS, ue as MENU_ITEM, v as MENU_ITEM_BASE, b as MENU_ITEM_X, S as MENU_LABEL, s as MENU_SEPARATOR, _e as MOBILE_BREAKPOINT, C as MODAL_MOTION, c as MORPH_MOTION, $ as MOTION_WINDOW_MS, h as OUTLINE_SURFACE, ze as OVERLAY_BLUR, p as OVERLAY_MOTION, D as OVERLAY_SURFACE, ee as OVERLAY_SURFACE_BASE, Le as OVERLAY_SURFACE_OPAQUE, Ie as PICKER_LIST, Be as PICKER_TRIGGER, ke as POSITION_BAR, le as POSITION_BAR_LIT, _ as PRESS_DIP, ne as SCRIM_CLASS, He as SCRIM_MOTION, Fe as SECTION_INNER_RADIUS, q as SECTION_OUTER_RADIUS, Z as SECTION_PADDING, Ce as SECTION_ROW_CLASS, fe as SECTION_ROW_SURFACE, pe as SEGMENT_ITEM, a as SETTLE_MOTION, M as STAGGER, se as THUMB_CLASS, be as THUMB_RAIL_BLEED, Ae as THUMB_RAIL_PAD, G as THUMB_SIZE, r as TRACK_SURFACE, m as Z, Te as Z_CLASS, ce as alertBorder, H as alertFill, xe as alertIconBgStyle, je as alertIconFill, te as anchorToTriggerTop, Ee as buttonVariants, X as carouselDot, Pe as carouselItem, ye as carouselTrack, Ne as cn, ge as copyImage, oe as copyText, De as createIsMobile, I as glassToneText, n as spendLongPress, Ue as startMotionWindow, R as toneTextMix };
@@ -0,0 +1,8 @@
1
+ /** The one door to the clipboard. Call it from the click: browsers refuse a
2
+ * copy more than a few seconds after it. Text still loading goes in as a
3
+ * promise so a ClipboardItem write keeps the gesture (Safari). */
4
+ export declare function copyText(text: string | Promise<string>): Promise<boolean>;
5
+ /** An image that is still being made: the promise goes into the ClipboardItem
6
+ * so the write keeps the gesture (Safari). False where there is no image
7
+ * clipboard (plain http, Firefox by default). */
8
+ export declare function copyImage(image: Promise<Blob>, type?: string): Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  export { type Color, parseColor } from "@kobalte/core/colors";
2
2
  export { SECTION_ROW_SURFACE } from "../lib/card-classes.js";
3
+ export { copyImage, copyText } from "../lib/clipboard.js";
3
4
  export { HOLD_GRACE_MS, HOLD_MS, spendLongPress } from "../lib/hold.js";
4
5
  export { RISE_MOTION, SETTLE_MOTION, TRAVEL_MOTION } from "../lib/motion-classes.js";
5
6
  export { OVERLAY_SURFACE } from "../lib/overlay-classes.js";
@@ -26,6 +27,7 @@ export { ColorSlider } from "./color-slider.js";
26
27
  export { ColorWheel } from "./color-wheel.js";
27
28
  export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "./context-menu.js";
28
29
  export { CopyButton } from "./copy-button.js";
30
+ export { type CopyState, useCopyText } from "./use-copy-text.js";
29
31
  export { CountPill } from "./count-pill.js";
30
32
  export { DashboardPreview, type DashboardPreviewTile } from "./dashboard-preview.js";
31
33
  export { DataTableHead, DataTableRow, type SortDirection, TABLE_BLEED, TABLE_CELL_X, TABLE_HEAD_CELL_CLASS, TABLE_HEAD_CLASS, TABLE_HEAD_LABEL_CLASS, TABLE_NUM_CELL_CLASS, TABLE_ROW_CLASS, TABLE_SCROLL_CLASS, TableBulkBar, TableEmpty, TableError, TableFilterSelect, TableLoadMore, TableSearchInput, TableSkeleton, TableSortHeader, createTableWindow, } from "./data-table.js";
@@ -96,4 +98,5 @@ export { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
96
98
  export { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
97
99
  export { WidgetCard } from "./widget-card.js";
98
100
  export { formatWidgetCount, WidgetIdentity, WidgetMeta, type WidgetSummary, widgetHref, } from "./widget-identity.js";
101
+ export { SourceMarks } from "./source-marks.js";
99
102
  export { WidgetTrustBadge } from "./widget-trust-badge.js";