@glasshome/ui 1.41.0 → 1.43.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 +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/anchor-placement.d.ts +34 -0
- package/dist/lib/balance-rows.d.ts +10 -4
- package/dist/lib/behavior/anchored.d.ts +26 -0
- package/dist/lib/behavior/button-root.d.ts +7 -0
- package/dist/lib/behavior/collection.d.ts +32 -0
- package/dist/lib/behavior/controllable.d.ts +8 -0
- package/dist/lib/behavior/dismiss.d.ts +13 -0
- package/dist/lib/behavior/focus-scope.d.ts +24 -0
- package/dist/lib/behavior/hide-outside.d.ts +7 -0
- package/dist/lib/behavior/layer-stack.d.ts +34 -0
- package/dist/lib/behavior/menu.d.ts +59 -0
- package/dist/lib/behavior/modal-root.d.ts +68 -0
- package/dist/lib/behavior/polymorphic.d.ts +6 -0
- package/dist/lib/behavior/presence.d.ts +18 -0
- package/dist/lib/behavior/range.d.ts +44 -0
- package/dist/lib/behavior/solid.d.ts +13 -0
- package/dist/lib/color/color.d.ts +41 -0
- package/dist/lib/color/index.d.ts +2 -0
- package/dist/lib/color/intl.d.ts +40 -0
- package/dist/lib/dock-slot-classes.d.ts +2 -0
- package/dist/lib/hold.d.ts +1 -1
- package/dist/lib/locale.d.ts +3 -0
- package/dist/lib/menu-classes.d.ts +2 -0
- package/dist/lib/motion-classes.d.ts +5 -2
- package/dist/lib/overlay-classes.d.ts +4 -0
- package/dist/lib/page-cover.d.ts +8 -0
- package/dist/lib/scroll-track.d.ts +3 -2
- package/dist/lib/section-tokens.d.ts +1 -1
- package/dist/lib/segment-classes.d.ts +2 -0
- package/dist/lib/shadow-layer.d.ts +0 -43
- package/dist/lib/toggle-set.d.ts +44 -0
- package/dist/lib/visually-hidden.d.ts +3 -0
- package/dist/solid/accordion.d.ts +35 -11
- package/dist/solid/alert-dialog.d.ts +5 -8
- package/dist/solid/avatar.d.ts +8 -4
- package/dist/solid/bottom-sheet/bottom-sheet.d.ts +2 -2
- package/dist/solid/bottom-sheet/constants.d.ts +1 -1
- package/dist/solid/button.d.ts +5 -4
- package/dist/solid/charts.d.ts +1 -1
- package/dist/solid/checkbox.d.ts +14 -4
- package/dist/solid/collapsible.d.ts +33 -5
- package/dist/solid/color-disc.d.ts +1 -1
- package/dist/solid/color-slider.d.ts +1 -1
- package/dist/solid/color-wheel.d.ts +1 -1
- package/dist/solid/context-menu.d.ts +58 -24
- package/dist/solid/dialog-parts.d.ts +53 -16
- package/dist/solid/dialog.d.ts +7 -10
- package/dist/solid/dropdown-menu.d.ts +55 -24
- package/dist/solid/empty.d.ts +1 -1
- package/dist/solid/form.d.ts +5 -6
- package/dist/solid/hover-card.d.ts +65 -9
- package/dist/solid/index.d.ts +5 -2
- package/dist/solid/index.js +8671 -14317
- package/dist/solid/input-group.d.ts +6 -6
- package/dist/solid/item.d.ts +1 -1
- package/dist/solid/menu-parts.d.ts +175 -24
- package/dist/solid/option-card.d.ts +1 -4
- package/dist/solid/picker-row.d.ts +2 -0
- package/dist/solid/popover.d.ts +77 -12
- package/dist/solid/progress.d.ts +11 -3
- package/dist/solid/radio-group.d.ts +31 -6
- package/dist/solid/responsive-dialog.d.ts +3 -1
- package/dist/solid/scroll-area.d.ts +1 -1
- package/dist/solid/section-card.d.ts +2 -3
- package/dist/solid/select.d.ts +107 -10
- package/dist/solid/selection.d.ts +10 -1
- package/dist/solid/sheet.d.ts +6 -9
- package/dist/solid/sliding-indicator.d.ts +1 -1
- package/dist/solid/sonner.d.ts +1 -1
- package/dist/solid/stale-veil.d.ts +7 -0
- package/dist/solid/tabs.d.ts +28 -9
- package/dist/solid/toggle-group.d.ts +30 -5
- package/dist/solid/toggle.d.ts +11 -3
- package/dist/solid/tooltip.d.ts +71 -9
- package/dist/tokens/index.js +54 -51
- package/dist/{utils-CGN4X-2O.js → utils-3Codx-NZ.js} +848 -618
- package/package.json +6 -7
- package/src/index.ts +1 -0
- package/src/lib/anchor-placement.ts +77 -4
- package/src/lib/balance-rows.ts +115 -40
- package/src/lib/behavior/anchored.ts +106 -0
- package/src/lib/behavior/button-root.tsx +103 -0
- package/src/lib/behavior/collection.ts +218 -0
- package/src/lib/behavior/controllable.ts +22 -0
- package/src/lib/behavior/dismiss.ts +185 -0
- package/src/lib/behavior/focus-scope.ts +227 -0
- package/src/lib/behavior/hide-outside.ts +85 -0
- package/src/lib/behavior/layer-stack.ts +150 -0
- package/src/lib/behavior/menu.ts +470 -0
- package/src/lib/behavior/modal-root.tsx +452 -0
- package/src/lib/behavior/polymorphic.tsx +30 -0
- package/src/lib/behavior/presence.ts +89 -0
- package/src/lib/behavior/range.ts +212 -0
- package/src/lib/behavior/solid.ts +30 -0
- package/src/lib/clipboard.ts +4 -4
- package/src/lib/color/color.ts +746 -0
- package/src/lib/color/index.ts +2 -0
- package/src/lib/color/intl.ts +60 -0
- package/src/lib/dock-slot-classes.ts +3 -0
- package/src/lib/hold.ts +1 -1
- package/src/lib/locale.ts +62 -0
- package/src/lib/menu-classes.ts +3 -0
- package/src/lib/motion-classes.ts +33 -8
- package/src/lib/overlay-classes.ts +8 -3
- package/src/lib/page-cover.ts +47 -0
- package/src/lib/scroll-track.ts +11 -6
- package/src/lib/section-tokens.ts +1 -1
- package/src/lib/segment-classes.ts +3 -0
- package/src/lib/shadow-layer.ts +0 -136
- package/src/lib/toggle-set.ts +133 -0
- package/src/lib/visually-hidden.ts +15 -0
- package/src/solid/accordion.tsx +294 -20
- package/src/solid/alert-dialog.tsx +36 -85
- package/src/solid/area-picker.tsx +5 -3
- package/src/solid/avatar.tsx +98 -24
- package/src/solid/badge.tsx +5 -5
- package/src/solid/bottom-sheet/bottom-sheet.tsx +73 -129
- package/src/solid/bottom-sheet/constants.ts +3 -1
- package/src/solid/bottom-sheet/drag-controller.ts +11 -0
- package/src/solid/breadcrumb.tsx +4 -4
- package/src/solid/button-group.tsx +4 -4
- package/src/solid/button.tsx +12 -6
- package/src/solid/card.tsx +5 -4
- package/src/solid/charts.tsx +1 -1
- package/src/solid/checkbox.tsx +167 -44
- package/src/solid/collapsible.tsx +260 -12
- package/src/solid/color-disc.tsx +11 -12
- package/src/solid/color-slider.tsx +114 -47
- package/src/solid/color-wheel.tsx +137 -39
- package/src/solid/context-menu.tsx +287 -86
- package/src/solid/dialog-parts.tsx +135 -46
- package/src/solid/dialog.tsx +44 -76
- package/src/solid/dock-edit.tsx +5 -4
- package/src/solid/dock.tsx +6 -5
- package/src/solid/dropdown-menu.tsx +252 -107
- package/src/solid/empty.tsx +1 -1
- package/src/solid/entity-selector.tsx +5 -3
- package/src/solid/face-toggle.tsx +43 -18
- package/src/solid/form.tsx +9 -9
- package/src/solid/glyph-tile.tsx +48 -21
- package/src/solid/hover-card.tsx +288 -21
- package/src/solid/icon-picker.tsx +2 -1
- package/src/solid/image-picker.tsx +6 -5
- package/src/solid/index.ts +5 -4
- package/src/solid/input-group.tsx +7 -5
- package/src/solid/input-otp.tsx +2 -1
- package/src/solid/item.tsx +5 -5
- package/src/solid/logo.tsx +5 -4
- package/src/solid/menu-parts.tsx +619 -145
- package/src/solid/option-card.tsx +6 -10
- package/src/solid/picker-row.tsx +10 -5
- package/src/solid/picker-search.tsx +2 -1
- package/src/solid/popover.tsx +424 -71
- package/src/solid/preview-tile.tsx +1 -1
- package/src/solid/progress.tsx +84 -15
- package/src/solid/radio-group.tsx +271 -34
- package/src/solid/responsive-dialog.tsx +10 -10
- package/src/solid/schema-form.tsx +1 -6
- package/src/solid/scroll-area.tsx +1 -1
- package/src/solid/section-card.tsx +3 -4
- package/src/solid/select.tsx +950 -95
- package/src/solid/selection.tsx +142 -66
- package/src/solid/sheet.tsx +48 -80
- package/src/solid/slider.tsx +115 -65
- package/src/solid/sliding-indicator.tsx +1 -1
- package/src/solid/sonner.tsx +1 -1
- package/src/solid/spotlight.tsx +23 -11
- package/src/solid/stale-veil.tsx +20 -0
- package/src/solid/switch.tsx +8 -6
- package/src/solid/tabs.tsx +377 -52
- package/src/solid/term.tsx +3 -4
- package/src/solid/toggle-group.tsx +237 -95
- package/src/solid/toggle.tsx +43 -9
- package/src/solid/tooltip.tsx +285 -26
- package/src/styles/globals.css +64 -10
- package/src/styles/theme.css +12 -4
- package/src/tokens/material.ts +11 -2
- package/dist/lib/when-animations-settle.d.ts +0 -4
- package/dist/solid/bottom-sheet/focus-trap.d.ts +0 -6
- package/dist/solid/bottom-sheet/scroll-lock.d.ts +0 -2
- package/dist/solid/bottom-sheet/sheet-motion.d.ts +0 -1
- package/src/lib/when-animations-settle.ts +0 -12
- package/src/solid/bottom-sheet/focus-trap.ts +0 -63
- package/src/solid/bottom-sheet/scroll-lock.ts +0 -66
- package/src/solid/bottom-sheet/sheet-motion.ts +0 -4
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Show,
|
|
9
9
|
Switch,
|
|
10
10
|
} from "solid-js";
|
|
11
|
+
import { activeOf, focusWithoutTracking } from "../lib/behavior/focus-scope.js";
|
|
11
12
|
import { FIELD_CHROME } from "../lib/input-classes.js";
|
|
12
13
|
import { PICKER_LIST } from "../lib/picker-classes.js";
|
|
13
14
|
import { SECTION_INNER_RADIUS } from "../lib/section-tokens.js";
|
|
@@ -218,8 +219,8 @@ function ImageGallery(
|
|
|
218
219
|
const fail = (cause: unknown) => setError(toMediaStoreError(cause));
|
|
219
220
|
|
|
220
221
|
// A control that disables or leaves drops focus to the page, which a sealed dialog's trap moves outside, closing the gallery.
|
|
221
|
-
const holdFocus = () => panel
|
|
222
|
-
const focused = () => (panel
|
|
222
|
+
const holdFocus = () => focusWithoutTracking(panel);
|
|
223
|
+
const focused = () => (panel ? activeOf(panel) : null);
|
|
223
224
|
const focusLost = () => {
|
|
224
225
|
const at = focused();
|
|
225
226
|
return !at || at === document.body;
|
|
@@ -313,7 +314,7 @@ function ImageGallery(
|
|
|
313
314
|
// A key pressed as the gallery opens lands on the panel, never on a tile it would pick.
|
|
314
315
|
onOpenAutoFocus={(event: Event) => {
|
|
315
316
|
event.preventDefault();
|
|
316
|
-
panel
|
|
317
|
+
focusWithoutTracking(panel);
|
|
317
318
|
}}
|
|
318
319
|
onInteractOutside={(event) => {
|
|
319
320
|
// The delete confirmation takes focus; the gallery stays open to show the result.
|
|
@@ -353,7 +354,7 @@ function ImageGallery(
|
|
|
353
354
|
const again = panel?.querySelector<HTMLElement>(
|
|
354
355
|
'[data-slot="image-picker-retry"]',
|
|
355
356
|
);
|
|
356
|
-
if (focused() === panel) again
|
|
357
|
+
if (focused() === panel) focusWithoutTracking(again);
|
|
357
358
|
}}
|
|
358
359
|
>
|
|
359
360
|
Try again
|
|
@@ -510,7 +511,7 @@ function ImageGallery(
|
|
|
510
511
|
// The confirmation has no trigger to return to; the page would get focus and the gallery would close.
|
|
511
512
|
event.preventDefault();
|
|
512
513
|
if (!deleteConfirmed && deleteFrom instanceof HTMLElement && deleteFrom.isConnected) {
|
|
513
|
-
deleteFrom
|
|
514
|
+
focusWithoutTracking(deleteFrom);
|
|
514
515
|
} else holdFocus();
|
|
515
516
|
}}
|
|
516
517
|
>
|
package/src/solid/index.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Original components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
// don't need a direct @kobalte/core dependency.
|
|
5
|
-
export { type Color, parseColor } from "@kobalte/core/colors";
|
|
3
|
+
export { type Color, parseColor } from "../lib/color/index.js";
|
|
6
4
|
// Floating glass panel + its shared surface token.
|
|
7
5
|
export { SECTION_ROW_SURFACE } from "../lib/card-classes.js";
|
|
8
6
|
export { copyImage, copyText } from "../lib/clipboard.js";
|
|
9
7
|
export { createHold, HOLD_GRACE_MS, HOLD_MS, spendLongPress } from "../lib/hold.js";
|
|
10
8
|
export type { Hold, HoldOptions, HoldPress } from "../lib/hold.js";
|
|
11
|
-
export { RISE_MOTION, SETTLE_MOTION, TRAVEL_MOTION } from "../lib/motion-classes.js";
|
|
9
|
+
export { RISE_MOTION, SETTLE_MOTION, STALE_CONTENT, TRAVEL_MOTION } from "../lib/motion-classes.js";
|
|
10
|
+
export { COVERING_ATTR, coverPage } from "../lib/page-cover.js";
|
|
12
11
|
export { OVERLAY_SURFACE } from "../lib/overlay-classes.js";
|
|
13
12
|
// Section tokens re-exported from the Solid entry for convenience.
|
|
14
13
|
export {
|
|
@@ -154,6 +153,7 @@ export {
|
|
|
154
153
|
DialogTitle,
|
|
155
154
|
DialogTrigger,
|
|
156
155
|
} from "./dialog.js";
|
|
156
|
+
export { useDialogDormant } from "../lib/behavior/modal-root.js";
|
|
157
157
|
export { ConfirmDialog, type ConfirmDialogProps } from "./confirm-dialog.js";
|
|
158
158
|
export type { ModalHeadProps, ModalMedia, ModalSize } from "./dialog-parts.js";
|
|
159
159
|
export type { DockIconButtonProps, DockItem, DockPlacement, DockProps } from "./dock.js";
|
|
@@ -385,6 +385,7 @@ export { FaceToggle, FaceToggleGroup } from "./face-toggle.js";
|
|
|
385
385
|
export { GlyphTile, GlyphTileGroup } from "./glyph-tile.js";
|
|
386
386
|
export { Spinner } from "./spinner.js";
|
|
387
387
|
export { Spotlight } from "./spotlight.js";
|
|
388
|
+
export { StaleVeil } from "./stale-veil.js";
|
|
388
389
|
export { StepIndicator } from "./step-indicator.js";
|
|
389
390
|
export { SwatchPicker } from "./swatch-picker.js";
|
|
390
391
|
export { Switch } from "./switch.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "cva";
|
|
2
2
|
import { type Component, type ComponentProps, splitProps } from "solid-js";
|
|
3
|
+
import { focusWithoutTracking } from "../lib/behavior/focus-scope.js";
|
|
3
4
|
import { CONTROL_H, FIELD_TEXT, INPUT_SURFACE } from "../lib/input-classes.js";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
5
6
|
import { Button } from "./button.js";
|
|
@@ -63,9 +64,10 @@ const InputGroupAddon: Component<
|
|
|
63
64
|
if ((e.target as HTMLElement).closest("button")) {
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
|
-
(
|
|
67
|
-
?.querySelector<HTMLInputElement>("input")
|
|
68
|
-
|
|
67
|
+
focusWithoutTracking(
|
|
68
|
+
(e.currentTarget as HTMLElement).parentElement?.querySelector<HTMLInputElement>("input"),
|
|
69
|
+
{ preventScroll: false },
|
|
70
|
+
);
|
|
69
71
|
}}
|
|
70
72
|
{...rest}
|
|
71
73
|
/>
|
|
@@ -81,11 +83,11 @@ const inputGroupButtonVariants = cva({
|
|
|
81
83
|
base: "flex items-center gap-2 rounded-sm text-sm shadow-none",
|
|
82
84
|
variants: {
|
|
83
85
|
size: {
|
|
84
|
-
/** @deprecated
|
|
86
|
+
/** @deprecated `"sm"`; removed in 2.0.0. */
|
|
85
87
|
xs: GROUP_BUTTON_SM,
|
|
86
88
|
sm: GROUP_BUTTON_SM,
|
|
87
89
|
default: `${CONTROL_H.default} px-3 has-[>svg]:px-3`,
|
|
88
|
-
/** @deprecated
|
|
90
|
+
/** @deprecated `"icon-sm"`; removed in 2.0.0. */
|
|
89
91
|
"icon-xs": GROUP_BUTTON_ICON_SM,
|
|
90
92
|
"icon-sm": GROUP_BUTTON_ICON_SM,
|
|
91
93
|
"icon-default": "size-9 p-0 has-[>svg]:p-0",
|
package/src/solid/input-otp.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
splitProps,
|
|
9
9
|
useContext,
|
|
10
10
|
} from "solid-js";
|
|
11
|
+
import { focusWithoutTracking } from "../lib/behavior/focus-scope.js";
|
|
11
12
|
import { CONTROL_H, FOCUS_RING, INPUT_SURFACE } from "../lib/input-classes.js";
|
|
12
13
|
import { cn } from "../lib/utils.js";
|
|
13
14
|
import { Icon } from "./icon.js";
|
|
@@ -96,7 +97,7 @@ const InputOTP: ParentComponent<
|
|
|
96
97
|
<div
|
|
97
98
|
data-slot="input-otp"
|
|
98
99
|
class={cn("flex items-center gap-2 has-[:disabled]:opacity-50", local.containerClass)}
|
|
99
|
-
onClick={() => inputRef
|
|
100
|
+
onClick={() => focusWithoutTracking(inputRef, { preventScroll: false })}
|
|
100
101
|
{...rest}
|
|
101
102
|
>
|
|
102
103
|
<input
|
package/src/solid/item.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "cva";
|
|
2
2
|
import { type Component, type ComponentProps, splitProps, type ValidComponent } from "solid-js";
|
|
3
|
-
import {
|
|
3
|
+
import { Polymorphic } from "../lib/behavior/polymorphic.js";
|
|
4
4
|
import { ICON_PILL } from "../lib/pill-classes.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
6
|
import { Separator } from "./separator.js";
|
|
@@ -54,10 +54,10 @@ const Item: Component<
|
|
|
54
54
|
const [local, rest] = splitProps(props, ["class", "variant", "size", "as"] as const);
|
|
55
55
|
const variant = () => local.variant ?? "default";
|
|
56
56
|
const size = () => local.size ?? "default";
|
|
57
|
-
const Comp = () => local.as || "div";
|
|
58
57
|
return (
|
|
59
|
-
<
|
|
60
|
-
|
|
58
|
+
<Polymorphic
|
|
59
|
+
defaultAs="div"
|
|
60
|
+
as={local.as}
|
|
61
61
|
data-slot="item"
|
|
62
62
|
data-variant={variant()}
|
|
63
63
|
data-size={size()}
|
|
@@ -78,7 +78,7 @@ const ItemMedia: Component<
|
|
|
78
78
|
ComponentProps<"div"> & {
|
|
79
79
|
/** The well the media sits in. Omit for bare content. */
|
|
80
80
|
media?: ItemMediaKind;
|
|
81
|
-
/** @deprecated `media
|
|
81
|
+
/** @deprecated `media`; removed in 2.0.0. */
|
|
82
82
|
variant?: ItemMediaKind | "default";
|
|
83
83
|
}
|
|
84
84
|
> = (props) => {
|
package/src/solid/logo.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, type ComponentProps, type JSX, splitProps } from "solid-js";
|
|
2
|
-
import {
|
|
2
|
+
import { Polymorphic } from "../lib/behavior/polymorphic.js";
|
|
3
3
|
import {
|
|
4
4
|
LOGO_DEFAULT_SIZE,
|
|
5
5
|
LOGO_DEFAULT_SRC,
|
|
@@ -48,8 +48,9 @@ const Logo: Component<LogoProps> = (props) => {
|
|
|
48
48
|
const size = () => local.size ?? LOGO_DEFAULT_SIZE;
|
|
49
49
|
const s = () => LOGO_SIZES[size()];
|
|
50
50
|
return (
|
|
51
|
-
<
|
|
52
|
-
|
|
51
|
+
<Polymorphic
|
|
52
|
+
defaultAs="div"
|
|
53
|
+
as={local.href ? "a" : undefined}
|
|
53
54
|
data-slot="logo"
|
|
54
55
|
class={cn(LOGO_ROOT_CLASS, s().gap, local.class)}
|
|
55
56
|
href={local.href}
|
|
@@ -72,7 +73,7 @@ const Logo: Component<LogoProps> = (props) => {
|
|
|
72
73
|
</span>
|
|
73
74
|
)}
|
|
74
75
|
</span>
|
|
75
|
-
</
|
|
76
|
+
</Polymorphic>
|
|
76
77
|
);
|
|
77
78
|
};
|
|
78
79
|
|