@glasshome/ui 1.40.0 → 1.42.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 +25 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/anchor-placement.d.ts +30 -0
- package/dist/lib/behavior/anchored.d.ts +12 -0
- package/dist/lib/behavior/collection.d.ts +24 -0
- package/dist/lib/behavior/controllable.d.ts +8 -0
- package/dist/lib/behavior/dismiss.d.ts +11 -0
- package/dist/lib/behavior/focus-scope.d.ts +18 -0
- package/dist/lib/behavior/hide-outside.d.ts +7 -0
- package/dist/lib/behavior/layer-stack.d.ts +33 -0
- package/dist/lib/behavior/modal-root.d.ts +66 -0
- package/dist/lib/behavior/polymorphic.d.ts +6 -0
- package/dist/lib/behavior/presence.d.ts +18 -0
- package/dist/lib/behavior/solid.d.ts +13 -0
- package/dist/lib/motion-classes.d.ts +5 -2
- package/dist/lib/overlay-classes.d.ts +4 -1
- package/dist/lib/page-cover.d.ts +8 -0
- package/dist/lib/shadow-layer.d.ts +8 -6
- package/dist/solid/alert-dialog.d.ts +13 -15
- package/dist/solid/bottom-sheet/bottom-sheet.d.ts +2 -6
- package/dist/solid/bottom-sheet/constants.d.ts +1 -1
- package/dist/solid/confirm-dialog.d.ts +22 -0
- package/dist/solid/dialog-parts.d.ts +78 -15
- package/dist/solid/dialog.d.ts +9 -15
- package/dist/solid/docked-panel.d.ts +1 -5
- package/dist/solid/icon-nodes.d.ts +13 -0
- package/dist/solid/index.d.ts +9 -5
- package/dist/solid/index.js +8211 -7974
- package/dist/solid/responsive-dialog.d.ts +5 -6
- package/dist/solid/sheet.d.ts +6 -13
- package/dist/solid/stale-veil.d.ts +7 -0
- package/dist/solid/tabs.d.ts +29 -8
- package/dist/solid/toggle-group.d.ts +30 -5
- package/dist/solid/tooltip.d.ts +71 -9
- package/dist/{utils-DXEj_oXa.js → utils-CxAii-e9.js} +606 -414
- package/package.json +4 -2
- package/src/index.ts +1 -0
- package/src/lib/anchor-placement.ts +68 -2
- package/src/lib/behavior/anchored.ts +88 -0
- package/src/lib/behavior/collection.ts +181 -0
- package/src/lib/behavior/controllable.ts +22 -0
- package/src/lib/behavior/dismiss.ts +145 -0
- package/src/lib/behavior/focus-scope.ts +202 -0
- package/src/lib/behavior/hide-outside.ts +85 -0
- package/src/lib/behavior/layer-stack.ts +125 -0
- package/src/lib/behavior/modal-root.tsx +446 -0
- package/src/lib/behavior/polymorphic.tsx +30 -0
- package/src/lib/behavior/presence.ts +89 -0
- package/src/lib/behavior/solid.ts +30 -0
- package/src/lib/clipboard.ts +3 -2
- package/src/lib/motion-classes.ts +27 -2
- package/src/lib/overlay-classes.ts +9 -4
- package/src/lib/page-cover.ts +47 -0
- package/src/lib/shadow-layer.ts +48 -66
- package/src/solid/alert-dialog.tsx +45 -81
- package/src/solid/alert.tsx +1 -1
- package/src/solid/area-picker.tsx +2 -1
- package/src/solid/badge.tsx +5 -5
- package/src/solid/bottom-sheet/bottom-sheet.tsx +72 -128
- 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/card.tsx +5 -4
- package/src/solid/confirm-dialog.tsx +62 -0
- package/src/solid/context-menu.tsx +12 -2
- package/src/solid/dialog-parts.tsx +181 -42
- package/src/solid/dialog.tsx +46 -74
- package/src/solid/dock-edit.tsx +5 -4
- package/src/solid/dock.tsx +3 -3
- package/src/solid/dropdown-menu.tsx +15 -7
- package/src/solid/entity-selector.tsx +2 -1
- package/src/solid/form.tsx +4 -3
- package/src/solid/hover-card.tsx +7 -2
- package/src/solid/icon-nodes.ts +71 -0
- package/src/solid/icon-picker.tsx +2 -1
- package/src/solid/icon.tsx +42 -39
- package/src/solid/image-picker.tsx +14 -13
- package/src/solid/index.ts +9 -2
- package/src/solid/input-group.tsx +5 -3
- package/src/solid/input-otp.tsx +2 -1
- package/src/solid/item.tsx +4 -4
- package/src/solid/logo.tsx +5 -4
- package/src/solid/picker-row.tsx +5 -4
- package/src/solid/picker-search.tsx +2 -1
- package/src/solid/popover.tsx +18 -10
- package/src/solid/responsive-dialog.tsx +17 -10
- package/src/solid/sheet.tsx +47 -79
- 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 +373 -53
- package/src/solid/toggle-group.tsx +305 -93
- package/src/solid/tooltip.tsx +285 -26
- package/src/styles/globals.css +6 -2
- package/src/styles/theme.css +10 -5
- 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
|
@@ -7,6 +7,8 @@ interface ResponsiveDialogProps {
|
|
|
7
7
|
open?: boolean;
|
|
8
8
|
onOpenChange?: (open: boolean) => void;
|
|
9
9
|
defaultOpen?: boolean;
|
|
10
|
+
/** The centred dialog stays mounted and dormant between opens; the bottom sheet ignores it. */
|
|
11
|
+
keep?: boolean;
|
|
10
12
|
}
|
|
11
13
|
/** Centred kobalte dialog from `sm` up, drag-to-dismiss bottom sheet below it.
|
|
12
14
|
* Both branches render the same parts, so a call site never branches. */
|
|
@@ -23,16 +25,13 @@ type ResponsiveDialogContentProps = ComponentProps<"div"> & {
|
|
|
23
25
|
anchor?: HTMLElement;
|
|
24
26
|
};
|
|
25
27
|
declare const ResponsiveDialogContent: ParentComponent<ResponsiveDialogContentProps>;
|
|
26
|
-
declare const ResponsiveDialogHeader: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
27
|
-
media?: JSX.Element;
|
|
28
|
-
action?: JSX.Element;
|
|
29
|
-
wrap?: boolean;
|
|
30
|
-
}>, ResponsiveDialogBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
28
|
+
declare const ResponsiveDialogHeader: Component<import("./dialog-parts.js").ModalHeaderProps>, ResponsiveDialogBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
31
29
|
as?: ValidComponent;
|
|
32
30
|
}>, ResponsiveDialogFooter: Component<JSX.HTMLAttributes<HTMLDivElement>>;
|
|
33
31
|
declare const ResponsiveDialogTitle: Component<ComponentProps<"h2">>;
|
|
34
32
|
declare const ResponsiveDialogDescription: Component<ComponentProps<"p">>;
|
|
33
|
+
declare const ResponsiveDialogHead: Component<import("./dialog-parts.js").ModalHeadProps>;
|
|
35
34
|
/** Defaults to the footer's outline button; an icon-only close passes `ghost`
|
|
36
35
|
* so the glyph is not boxed. */
|
|
37
36
|
declare const ResponsiveDialogClose: ParentComponent<ComponentProps<"button"> & VariantProps<typeof buttonVariants>>;
|
|
38
|
-
export { ResponsiveDialog, ResponsiveDialogBody, ResponsiveDialogClose, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogFooter, ResponsiveDialogHeader, ResponsiveDialogTitle, ResponsiveDialogTrigger, };
|
|
37
|
+
export { ResponsiveDialog, ResponsiveDialogBody, ResponsiveDialogClose, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogFooter, ResponsiveDialogHead, ResponsiveDialogHeader, ResponsiveDialogTitle, ResponsiveDialogTrigger, };
|
package/dist/solid/sheet.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Dialog as DialogPrimitive } from "@kobalte/core/dialog";
|
|
2
1
|
import type { VariantProps } from "cva";
|
|
3
|
-
import { type Component, type
|
|
2
|
+
import { type Component, type JSX, type ParentComponent } from "solid-js";
|
|
4
3
|
import { buttonVariants } from "../lib/button-variants.js";
|
|
5
|
-
import { type ModalDismissProps } from "./dialog-parts.js";
|
|
6
|
-
declare const Sheet: ParentComponent<
|
|
7
|
-
declare const SheetTrigger:
|
|
4
|
+
import { type ModalContentProps, type ModalDismissProps } from "./dialog-parts.js";
|
|
5
|
+
declare const Sheet: ParentComponent<import("./dialog-parts.js").ModalRootSkinProps>;
|
|
6
|
+
declare const SheetTrigger: <T extends import("solid-js").ValidComponent = "button">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element, SheetTitle: <T extends import("solid-js").ValidComponent = "h2">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element, SheetDescription: <T extends import("solid-js").ValidComponent = "p">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element;
|
|
8
7
|
type SheetCloseProps = ModalDismissProps & Partial<Pick<VariantProps<typeof buttonVariants>, "variant" | "size">>;
|
|
9
8
|
/** Already the outline button; see DialogClose on why `as={Button}` is wrong. */
|
|
10
9
|
declare const SheetClose: ParentComponent<SheetCloseProps>;
|
|
@@ -16,7 +15,7 @@ declare const SHEET_SIDE: {
|
|
|
16
15
|
readonly bottom: "data-[closed]:slide-out-to-bottom data-[expanded]:slide-in-from-bottom inset-x-3 bottom-3 [--modal-max-h:85dvh] max-h-[var(--modal-max-h)]";
|
|
17
16
|
};
|
|
18
17
|
type SheetSide = keyof typeof SHEET_SIDE;
|
|
19
|
-
type SheetContentProps =
|
|
18
|
+
type SheetContentProps = ModalContentProps & {
|
|
20
19
|
/** A modal belongs in `ResponsiveDialog`; this family slides from an edge. */
|
|
21
20
|
side?: SheetSide;
|
|
22
21
|
above?: JSX.Element;
|
|
@@ -24,13 +23,7 @@ type SheetContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
|
|
|
24
23
|
ariaLabel?: string;
|
|
25
24
|
};
|
|
26
25
|
declare const SheetContent: ParentComponent<SheetContentProps>;
|
|
27
|
-
declare const SheetHeader: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
28
|
-
media?: JSX.Element;
|
|
29
|
-
action?: JSX.Element;
|
|
30
|
-
wrap?: boolean;
|
|
31
|
-
}>, SheetBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
declare const SheetHeader: Component<import("./dialog-parts.js").ModalHeaderProps>, SheetBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
32
27
|
as?: import("solid-js").ValidComponent;
|
|
33
28
|
}>, SheetFooter: Component<JSX.HTMLAttributes<HTMLDivElement>>;
|
|
34
|
-
declare const SheetTitle: Component<ComponentProps<typeof DialogPrimitive.Title>>;
|
|
35
|
-
declare const SheetDescription: Component<ComponentProps<typeof DialogPrimitive.Description>>;
|
|
36
29
|
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
|
package/dist/solid/tabs.d.ts
CHANGED
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type Component, type ComponentProps } from "solid-js";
|
|
1
|
+
import { type Component, type ComponentProps, type ValidComponent } from "solid-js";
|
|
3
2
|
/** `split`: the root is `display: contents`, so a host (a modal panel) lays the
|
|
4
3
|
* list and the content out in its own regions while the tab state still spans
|
|
5
4
|
* them. */
|
|
6
5
|
type TabsLayout = "stack" | "split";
|
|
7
|
-
type
|
|
6
|
+
type Orientation = "horizontal" | "vertical";
|
|
7
|
+
type TabsProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
8
|
+
as?: ValidComponent;
|
|
8
9
|
layout?: TabsLayout;
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
orientation?: Orientation;
|
|
14
|
+
activationMode?: "automatic" | "manual";
|
|
15
|
+
disabled?: boolean;
|
|
9
16
|
};
|
|
10
17
|
declare const Tabs: Component<TabsProps>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
type TabsListProps = ComponentProps<"div"> & {
|
|
19
|
+
as?: ValidComponent;
|
|
20
|
+
};
|
|
21
|
+
declare const TabsList: Component<TabsListProps>;
|
|
22
|
+
type TabsTriggerProps = ComponentProps<"button"> & {
|
|
23
|
+
as?: ValidComponent;
|
|
24
|
+
value: string;
|
|
25
|
+
disabled?: boolean;
|
|
14
26
|
icon?: string;
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
inline?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** `icon` stacks a glyph over the word, so a tab row reads apart from the toggle groups under it.
|
|
30
|
+
* `inline` sets the glyph beside the word instead, for a row that stands alone. */
|
|
31
|
+
declare const TabsTrigger: Component<TabsTriggerProps>;
|
|
32
|
+
type TabsContentProps = ComponentProps<"div"> & {
|
|
33
|
+
as?: ValidComponent;
|
|
34
|
+
value: string;
|
|
35
|
+
forceMount?: boolean;
|
|
36
|
+
};
|
|
37
|
+
declare const TabsContent: Component<TabsContentProps>;
|
|
17
38
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import { ToggleGroup as ToggleGroupPrimitive } from "@kobalte/core/toggle-group";
|
|
2
1
|
import type { VariantProps } from "cva";
|
|
3
|
-
import { type Component, type ComponentProps, type ParentComponent } from "solid-js";
|
|
2
|
+
import { type Accessor, type Component, type ComponentProps, type JSX, type ParentComponent, type ValidComponent } from "solid-js";
|
|
4
3
|
import { toggleVariants } from "./toggle.js";
|
|
5
|
-
|
|
4
|
+
type Orientation = "horizontal" | "vertical";
|
|
5
|
+
type SingleSelection = {
|
|
6
|
+
multiple?: false;
|
|
7
|
+
value?: string | null;
|
|
8
|
+
defaultValue?: string | null;
|
|
9
|
+
onChange?: (value: string | null) => void;
|
|
10
|
+
};
|
|
11
|
+
type MultipleSelection = {
|
|
12
|
+
multiple: true;
|
|
13
|
+
value?: string[];
|
|
14
|
+
defaultValue?: string[];
|
|
15
|
+
onChange?: (value: string[]) => void;
|
|
16
|
+
};
|
|
17
|
+
type ToggleGroupProps = Omit<ComponentProps<"div">, "onChange"> & VariantProps<typeof toggleVariants> & (SingleSelection | MultipleSelection) & {
|
|
18
|
+
as?: ValidComponent;
|
|
19
|
+
orientation?: Orientation;
|
|
20
|
+
disabled?: boolean;
|
|
6
21
|
/** CSS colour for the selected segment's glass. Default `var(--material-accent)`. */
|
|
7
22
|
tone?: string;
|
|
8
23
|
/** One row that scrolls sideways when it outgrows its container, instead of wrapping. */
|
|
9
24
|
scroll?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const
|
|
25
|
+
};
|
|
26
|
+
declare const ToggleGroup: ParentComponent<ToggleGroupProps>;
|
|
27
|
+
type ToggleGroupItemState = {
|
|
28
|
+
pressed: Accessor<boolean>;
|
|
29
|
+
};
|
|
30
|
+
type ToggleGroupItemProps = Omit<ComponentProps<"button">, "children"> & VariantProps<typeof toggleVariants> & {
|
|
31
|
+
as?: ValidComponent;
|
|
32
|
+
value: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
children?: JSX.Element | ((state: ToggleGroupItemState) => JSX.Element);
|
|
35
|
+
};
|
|
36
|
+
declare const ToggleGroupItem: Component<ToggleGroupItemProps>;
|
|
12
37
|
export { ToggleGroup, ToggleGroupItem };
|
package/dist/solid/tooltip.d.ts
CHANGED
|
@@ -1,11 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { type Component, type ComponentProps, type JSX, type ValidComponent } from "solid-js";
|
|
2
|
+
import type { Align, Side } from "../lib/anchor-placement.js";
|
|
3
|
+
type Placement = Side | `${Side}-${Exclude<Align, "center">}`;
|
|
4
|
+
interface TooltipRootProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
gutter?: number;
|
|
10
|
+
openDelay?: number;
|
|
11
|
+
closeDelay?: number;
|
|
12
|
+
children?: JSX.Element;
|
|
13
|
+
/** @deprecated Ignored. */
|
|
14
|
+
id?: string;
|
|
15
|
+
/** @deprecated Ignored. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** @deprecated Ignored. */
|
|
18
|
+
skipDelayDuration?: number;
|
|
19
|
+
/** @deprecated Ignored. */
|
|
20
|
+
triggerOnFocusOnly?: boolean;
|
|
21
|
+
/** @deprecated Ignored. */
|
|
22
|
+
ignoreSafeArea?: boolean;
|
|
23
|
+
/** @deprecated Ignored. */
|
|
24
|
+
forceMount?: boolean;
|
|
25
|
+
/** @deprecated Ignored. */
|
|
26
|
+
getAnchorRect?: (anchor?: HTMLElement) => unknown;
|
|
27
|
+
/** @deprecated Ignored. */
|
|
28
|
+
shift?: number;
|
|
29
|
+
/** @deprecated Ignored. */
|
|
30
|
+
flip?: boolean | string;
|
|
31
|
+
/** @deprecated Ignored. */
|
|
32
|
+
slide?: boolean;
|
|
33
|
+
/** @deprecated Ignored. */
|
|
34
|
+
overlap?: boolean;
|
|
35
|
+
/** @deprecated Ignored. */
|
|
36
|
+
sameWidth?: boolean;
|
|
37
|
+
/** @deprecated Ignored. */
|
|
38
|
+
fitViewport?: boolean;
|
|
39
|
+
/** @deprecated Ignored. */
|
|
40
|
+
hideWhenDetached?: boolean;
|
|
41
|
+
/** @deprecated Ignored. */
|
|
42
|
+
detachedPadding?: number;
|
|
43
|
+
/** @deprecated Ignored. */
|
|
44
|
+
arrowPadding?: number;
|
|
45
|
+
/** @deprecated Ignored. */
|
|
46
|
+
overflowPadding?: number;
|
|
47
|
+
}
|
|
48
|
+
interface TooltipContentProps extends ComponentProps<"div"> {
|
|
49
|
+
/** @deprecated Ignored. */
|
|
50
|
+
forceMount?: boolean;
|
|
51
|
+
/** @deprecated Ignored. */
|
|
52
|
+
onEscapeKeyDown?: (event: Event) => void;
|
|
53
|
+
/** @deprecated Ignored. */
|
|
54
|
+
onPointerDownOutside?: (event: Event) => void;
|
|
55
|
+
/** @deprecated Ignored. */
|
|
56
|
+
onFocusOutside?: (event: Event) => void;
|
|
57
|
+
/** @deprecated Ignored. */
|
|
58
|
+
onInteractOutside?: (event: Event) => void;
|
|
59
|
+
}
|
|
60
|
+
type TooltipTriggerProps<T extends ValidComponent> = {
|
|
61
|
+
as?: T;
|
|
62
|
+
} & Omit<ComponentProps<T>, "as">;
|
|
63
|
+
declare function TooltipTrigger<T extends ValidComponent = "button">(props: TooltipTriggerProps<T>): JSX.Element;
|
|
64
|
+
declare const TooltipContent: Component<TooltipContentProps>;
|
|
65
|
+
declare const Tooltip: Component<TooltipRootProps> & {
|
|
66
|
+
Trigger: typeof TooltipTrigger;
|
|
67
|
+
Content: Component<TooltipContentProps>;
|
|
68
|
+
Portal: Component<{
|
|
69
|
+
children?: JSX.Element;
|
|
70
|
+
}>;
|
|
71
|
+
Arrow: Component;
|
|
8
72
|
};
|
|
9
|
-
declare const TooltipTrigger: typeof import("@kobalte/core/tooltip").Trigger;
|
|
10
|
-
declare const TooltipContent: Component<ComponentProps<typeof TooltipPrimitive.Content>>;
|
|
11
73
|
export { Tooltip, TooltipContent, TooltipTrigger };
|