@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.
Files changed (105) hide show
  1. package/SPEC.md +25 -2
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/lib/anchor-placement.d.ts +30 -0
  5. package/dist/lib/behavior/anchored.d.ts +12 -0
  6. package/dist/lib/behavior/collection.d.ts +24 -0
  7. package/dist/lib/behavior/controllable.d.ts +8 -0
  8. package/dist/lib/behavior/dismiss.d.ts +11 -0
  9. package/dist/lib/behavior/focus-scope.d.ts +18 -0
  10. package/dist/lib/behavior/hide-outside.d.ts +7 -0
  11. package/dist/lib/behavior/layer-stack.d.ts +33 -0
  12. package/dist/lib/behavior/modal-root.d.ts +66 -0
  13. package/dist/lib/behavior/polymorphic.d.ts +6 -0
  14. package/dist/lib/behavior/presence.d.ts +18 -0
  15. package/dist/lib/behavior/solid.d.ts +13 -0
  16. package/dist/lib/motion-classes.d.ts +5 -2
  17. package/dist/lib/overlay-classes.d.ts +4 -1
  18. package/dist/lib/page-cover.d.ts +8 -0
  19. package/dist/lib/shadow-layer.d.ts +8 -6
  20. package/dist/solid/alert-dialog.d.ts +13 -15
  21. package/dist/solid/bottom-sheet/bottom-sheet.d.ts +2 -6
  22. package/dist/solid/bottom-sheet/constants.d.ts +1 -1
  23. package/dist/solid/confirm-dialog.d.ts +22 -0
  24. package/dist/solid/dialog-parts.d.ts +78 -15
  25. package/dist/solid/dialog.d.ts +9 -15
  26. package/dist/solid/docked-panel.d.ts +1 -5
  27. package/dist/solid/icon-nodes.d.ts +13 -0
  28. package/dist/solid/index.d.ts +9 -5
  29. package/dist/solid/index.js +8211 -7974
  30. package/dist/solid/responsive-dialog.d.ts +5 -6
  31. package/dist/solid/sheet.d.ts +6 -13
  32. package/dist/solid/stale-veil.d.ts +7 -0
  33. package/dist/solid/tabs.d.ts +29 -8
  34. package/dist/solid/toggle-group.d.ts +30 -5
  35. package/dist/solid/tooltip.d.ts +71 -9
  36. package/dist/{utils-DXEj_oXa.js → utils-CxAii-e9.js} +606 -414
  37. package/package.json +4 -2
  38. package/src/index.ts +1 -0
  39. package/src/lib/anchor-placement.ts +68 -2
  40. package/src/lib/behavior/anchored.ts +88 -0
  41. package/src/lib/behavior/collection.ts +181 -0
  42. package/src/lib/behavior/controllable.ts +22 -0
  43. package/src/lib/behavior/dismiss.ts +145 -0
  44. package/src/lib/behavior/focus-scope.ts +202 -0
  45. package/src/lib/behavior/hide-outside.ts +85 -0
  46. package/src/lib/behavior/layer-stack.ts +125 -0
  47. package/src/lib/behavior/modal-root.tsx +446 -0
  48. package/src/lib/behavior/polymorphic.tsx +30 -0
  49. package/src/lib/behavior/presence.ts +89 -0
  50. package/src/lib/behavior/solid.ts +30 -0
  51. package/src/lib/clipboard.ts +3 -2
  52. package/src/lib/motion-classes.ts +27 -2
  53. package/src/lib/overlay-classes.ts +9 -4
  54. package/src/lib/page-cover.ts +47 -0
  55. package/src/lib/shadow-layer.ts +48 -66
  56. package/src/solid/alert-dialog.tsx +45 -81
  57. package/src/solid/alert.tsx +1 -1
  58. package/src/solid/area-picker.tsx +2 -1
  59. package/src/solid/badge.tsx +5 -5
  60. package/src/solid/bottom-sheet/bottom-sheet.tsx +72 -128
  61. package/src/solid/bottom-sheet/constants.ts +3 -1
  62. package/src/solid/bottom-sheet/drag-controller.ts +11 -0
  63. package/src/solid/breadcrumb.tsx +4 -4
  64. package/src/solid/button-group.tsx +4 -4
  65. package/src/solid/card.tsx +5 -4
  66. package/src/solid/confirm-dialog.tsx +62 -0
  67. package/src/solid/context-menu.tsx +12 -2
  68. package/src/solid/dialog-parts.tsx +181 -42
  69. package/src/solid/dialog.tsx +46 -74
  70. package/src/solid/dock-edit.tsx +5 -4
  71. package/src/solid/dock.tsx +3 -3
  72. package/src/solid/dropdown-menu.tsx +15 -7
  73. package/src/solid/entity-selector.tsx +2 -1
  74. package/src/solid/form.tsx +4 -3
  75. package/src/solid/hover-card.tsx +7 -2
  76. package/src/solid/icon-nodes.ts +71 -0
  77. package/src/solid/icon-picker.tsx +2 -1
  78. package/src/solid/icon.tsx +42 -39
  79. package/src/solid/image-picker.tsx +14 -13
  80. package/src/solid/index.ts +9 -2
  81. package/src/solid/input-group.tsx +5 -3
  82. package/src/solid/input-otp.tsx +2 -1
  83. package/src/solid/item.tsx +4 -4
  84. package/src/solid/logo.tsx +5 -4
  85. package/src/solid/picker-row.tsx +5 -4
  86. package/src/solid/picker-search.tsx +2 -1
  87. package/src/solid/popover.tsx +18 -10
  88. package/src/solid/responsive-dialog.tsx +17 -10
  89. package/src/solid/sheet.tsx +47 -79
  90. package/src/solid/spotlight.tsx +23 -11
  91. package/src/solid/stale-veil.tsx +20 -0
  92. package/src/solid/switch.tsx +8 -6
  93. package/src/solid/tabs.tsx +373 -53
  94. package/src/solid/toggle-group.tsx +305 -93
  95. package/src/solid/tooltip.tsx +285 -26
  96. package/src/styles/globals.css +6 -2
  97. package/src/styles/theme.css +10 -5
  98. package/dist/lib/when-animations-settle.d.ts +0 -4
  99. package/dist/solid/bottom-sheet/focus-trap.d.ts +0 -6
  100. package/dist/solid/bottom-sheet/scroll-lock.d.ts +0 -2
  101. package/dist/solid/bottom-sheet/sheet-motion.d.ts +0 -1
  102. package/src/lib/when-animations-settle.ts +0 -12
  103. package/src/solid/bottom-sheet/focus-trap.ts +0 -63
  104. package/src/solid/bottom-sheet/scroll-lock.ts +0 -66
  105. 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, };
@@ -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 ComponentProps, type JSX, type ParentComponent } from "solid-js";
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<ComponentProps<typeof DialogPrimitive>>;
7
- declare const SheetTrigger: Component<ComponentProps<typeof DialogPrimitive.Trigger>>;
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 = ComponentProps<typeof DialogPrimitive.Content> & {
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, };
@@ -0,0 +1,7 @@
1
+ import { type Component } from "solid-js";
2
+ /** Fills its positioned parent; no z-index, so it paints over earlier siblings: render it last. */
3
+ declare const StaleVeil: Component<{
4
+ shown: boolean;
5
+ class?: string;
6
+ }>;
7
+ export { StaleVeil };
@@ -1,17 +1,38 @@
1
- import { Tabs as TabsPrimitive } from "@kobalte/core/tabs";
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 TabsProps = ComponentProps<typeof TabsPrimitive> & {
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
- declare const TabsList: Component<ComponentProps<typeof TabsPrimitive.List>>;
12
- /** `icon` stacks a glyph over the word, so a tab row reads apart from the toggle groups under it. */
13
- declare const TabsTrigger: Component<ComponentProps<typeof TabsPrimitive.Trigger> & {
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
- declare const TabsContent: Component<ComponentProps<typeof TabsPrimitive.Content>>;
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
- declare const ToggleGroup: ParentComponent<ComponentProps<typeof ToggleGroupPrimitive> & VariantProps<typeof toggleVariants> & {
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 ToggleGroupItem: Component<ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>>;
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 };
@@ -1,11 +1,73 @@
1
- import { Tooltip as TooltipPrimitive } from "@kobalte/core/tooltip";
2
- import { type Component, type ComponentProps } from "solid-js";
3
- declare const Tooltip: Component<import("@kobalte/core/tooltip").TooltipRootProps> & typeof import("@kobalte/core/tooltip").Root & {
4
- Arrow: typeof import("@kobalte/core/popover").Arrow;
5
- Content: typeof import("@kobalte/core/tooltip").Content;
6
- Portal: typeof import("@kobalte/core/tooltip").Portal;
7
- Trigger: typeof import("@kobalte/core/tooltip").Trigger;
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 };