@glasshome/ui 1.29.1 → 1.30.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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/lib/clipboard.d.ts +8 -0
- package/dist/solid/index.d.ts +2 -0
- package/dist/solid/index.js +4041 -4030
- package/dist/solid/use-copy-text.d.ts +6 -0
- package/dist/{utils-DcRd0bwQ.js → utils-C0qKxkyh.js} +171 -123
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/lib/clipboard.ts +84 -0
- package/src/solid/copy-button.tsx +7 -12
- package/src/solid/index.ts +2 -0
- package/src/solid/use-copy-text.ts +22 -0
package/SPEC.md
CHANGED
|
@@ -201,6 +201,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
|
|
|
201
201
|
| tinted text alone | `glassToneText(tone)` | ad-hoc color-mix |
|
|
202
202
|
| a metallic tier chip | `<TierBadge>` | gradients by hand |
|
|
203
203
|
| the ambient motion window | `startMotionWindow()` | an app-local timer writing `data-motion` |
|
|
204
|
+
| 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
205
|
| a built-in wallpaper | `GEOMETRIC_HOUSES_SVG` from `@glasshome/ui/backgrounds` | an app's own copy of the SVG |
|
|
205
206
|
| 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
207
|
|
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,
|
|
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
|
|
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 {
|
|
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>;
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -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";
|