@adea-ai/ui 0.22.2 → 0.23.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/README.md +6 -3
- package/dist/components/account-drawer.d.ts +3 -3
- package/dist/components/account-drawer.js +119 -19
- package/dist/components/on-screen-controls.d.ts +2 -1
- package/dist/components/on-screen-controls.js +158 -46
- package/dist/components/scene-settings.d.ts +3 -3
- package/dist/components/scene-settings.js +247 -28
- package/dist/components/theme-provider.d.ts +27 -5
- package/dist/components/theme-provider.js +96 -7
- package/dist/components/theme-toggle.d.ts +4 -4
- package/dist/components/theme-toggle.js +62 -18
- package/dist/components/ui/badge.d.ts +4 -3
- package/dist/components/ui/badge.js +31 -30
- package/dist/components/ui/button.d.ts +4 -3
- package/dist/components/ui/button.js +49 -32
- package/dist/components/ui/card.d.ts +3 -3
- package/dist/components/ui/card.js +25 -6
- package/dist/components/ui/dialog.d.ts +13 -13
- package/dist/components/ui/dialog.js +94 -26
- package/dist/components/ui/drawer.d.ts +23 -15
- package/dist/components/ui/drawer.js +109 -64
- package/dist/components/ui/dropdown-menu.d.ts +28 -22
- package/dist/components/ui/dropdown-menu.js +165 -36
- package/dist/components/ui/empty.d.ts +7 -6
- package/dist/components/ui/empty.js +78 -26
- package/dist/components/ui/field.d.ts +15 -14
- package/dist/components/ui/field.js +177 -55
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.js +20 -5
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.js +15 -5
- package/dist/components/ui/radio-group.d.ts +4 -4
- package/dist/components/ui/radio-group.js +36 -9
- package/dist/components/ui/separator.d.ts +6 -2
- package/dist/components/ui/separator.js +18 -6
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +15 -4
- package/dist/components/ui/spinner.d.ts +4 -3
- package/dist/components/ui/spinner.js +15 -5
- package/dist/components/ui/switch.d.ts +6 -3
- package/dist/components/ui/switch.js +57 -6
- package/dist/components/ui/tabs.d.ts +6 -5
- package/dist/components/ui/tabs.js +52 -24
- package/dist/components/ui/toggle-group.d.ts +10 -8
- package/dist/components/ui/toggle-group.js +91 -20
- package/dist/components/ui/toggle.d.ts +4 -2
- package/dist/components/ui/toggle.js +38 -23
- package/dist/components/ui/tooltip.d.ts +13 -6
- package/dist/components/ui/tooltip.js +51 -14
- package/dist/components/version-dialog.d.ts +2 -2
- package/dist/components/version-dialog.js +322 -129
- package/dist/components/workspace-brand.d.ts +1 -1
- package/dist/components/workspace-brand.js +12 -3
- package/dist/components/workspace-logo.d.ts +2 -2
- package/dist/components/workspace-logo.js +15 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -19
- package/dist/lib/utils.js +7 -4
- package/dist/lib/version-notes.js +14 -29
- package/package.json +18 -16
- package/src/components/account-drawer.tsx +48 -67
- package/src/components/on-screen-controls.tsx +55 -62
- package/src/components/scene-settings.tsx +97 -100
- package/src/components/theme-provider.tsx +122 -22
- package/src/components/theme-toggle.tsx +29 -54
- package/src/components/ui/badge.tsx +14 -23
- package/src/components/ui/button.tsx +9 -11
- package/src/components/ui/card.tsx +9 -6
- package/src/components/ui/dialog.tsx +58 -55
- package/src/components/ui/drawer.tsx +84 -125
- package/src/components/ui/dropdown-menu.tsx +130 -153
- package/src/components/ui/empty.tsx +29 -26
- package/src/components/ui/field.tsx +83 -87
- package/src/components/ui/input.tsx +8 -8
- package/src/components/ui/label.tsx +6 -7
- package/src/components/ui/radio-group.tsx +22 -19
- package/src/components/ui/separator.tsx +16 -9
- package/src/components/ui/skeleton.tsx +6 -3
- package/src/components/ui/spinner.tsx +9 -5
- package/src/components/ui/switch.tsx +47 -20
- package/src/components/ui/tabs.tsx +31 -30
- package/src/components/ui/toggle-group.tsx +65 -54
- package/src/components/ui/toggle.tsx +9 -12
- package/src/components/ui/tooltip.tsx +41 -36
- package/src/components/version-dialog.tsx +144 -144
- package/src/components/workspace-brand.tsx +5 -5
- package/src/components/workspace-logo.tsx +9 -8
- package/src/index.tsx +7 -1
- package/src/styles/base.css +637 -0
- package/src/styles/globals.css +1 -1
- package/tsconfig.json +2 -1
- package/components.json +0 -19
|
@@ -1,29 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cva } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Tabs as Tabs$1 } from "@kobalte/core/tabs";
|
|
6
|
+
//#region src/components/ui/tabs.tsx
|
|
7
|
+
function Tabs(props) {
|
|
8
|
+
const [local, rest] = splitProps(props, ["class", "orientation"]);
|
|
9
|
+
return createComponent(Tabs$1, mergeProps({
|
|
10
|
+
"data-slot": "tabs",
|
|
11
|
+
get orientation() {
|
|
12
|
+
return local.orientation;
|
|
13
|
+
},
|
|
14
|
+
get ["class"]() {
|
|
15
|
+
return cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", local.class);
|
|
16
|
+
}
|
|
17
|
+
}, rest));
|
|
8
18
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
variant: 'default',
|
|
18
|
-
},
|
|
19
|
+
var tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-8 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
20
|
+
variants: { variant: {
|
|
21
|
+
default: "bg-muted",
|
|
22
|
+
line: "gap-1 bg-transparent"
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { variant: "default" }
|
|
19
25
|
});
|
|
20
|
-
function TabsList(
|
|
21
|
-
|
|
26
|
+
function TabsList(props) {
|
|
27
|
+
const [local, rest] = splitProps(props, ["class", "variant"]);
|
|
28
|
+
return createComponent(Tabs$1.List, mergeProps({
|
|
29
|
+
"data-slot": "tabs-list",
|
|
30
|
+
get ["data-variant"]() {
|
|
31
|
+
return local.variant ?? "default";
|
|
32
|
+
},
|
|
33
|
+
get ["class"]() {
|
|
34
|
+
return cn(tabsListVariants({ variant: local.variant }), local.class);
|
|
35
|
+
}
|
|
36
|
+
}, rest));
|
|
22
37
|
}
|
|
23
|
-
function TabsTrigger(
|
|
24
|
-
|
|
38
|
+
function TabsTrigger(props) {
|
|
39
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
40
|
+
return createComponent(Tabs$1.Trigger, mergeProps({
|
|
41
|
+
"data-slot": "tabs-trigger",
|
|
42
|
+
get ["class"]() {
|
|
43
|
+
return cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-selected:shadow-sm group-data-[variant=line]/tabs-list:data-selected:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-selected:bg-transparent dark:group-data-[variant=line]/tabs-list:data-selected:border-transparent dark:group-data-[variant=line]/tabs-list:data-selected:bg-transparent", "data-selected:bg-background data-selected:text-foreground dark:data-selected:border-input dark:data-selected:bg-input/30 dark:data-selected:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-selected:after:opacity-100", local.class);
|
|
44
|
+
}
|
|
45
|
+
}, rest));
|
|
25
46
|
}
|
|
26
|
-
function TabsContent(
|
|
27
|
-
|
|
47
|
+
function TabsContent(props) {
|
|
48
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
49
|
+
return createComponent(Tabs$1.Content, mergeProps({
|
|
50
|
+
"data-slot": "tabs-content",
|
|
51
|
+
get ["class"]() {
|
|
52
|
+
return cn("flex-1 text-sm outline-none", local.class);
|
|
53
|
+
}
|
|
54
|
+
}, rest));
|
|
28
55
|
}
|
|
29
|
-
|
|
56
|
+
//#endregion
|
|
57
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Toggle as TogglePrimitive } from '@base-ui/react/toggle';
|
|
3
|
-
import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
|
|
1
|
+
import { ToggleGroup as ToggleGroupPrimitive } from '@kobalte/core/toggle-group';
|
|
4
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { type ComponentProps } from 'solid-js';
|
|
5
4
|
import { toggleVariants } from '#components/ui/toggle';
|
|
6
|
-
|
|
5
|
+
type ToggleGroupProps = Omit<ComponentProps<typeof ToggleGroupPrimitive>, 'multiple' | 'onChange' | 'value'> & VariantProps<typeof toggleVariants> & {
|
|
7
6
|
spacing?: number;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
value?: string[];
|
|
8
|
+
onChange?: (value: string[]) => void;
|
|
9
|
+
};
|
|
10
|
+
declare function ToggleGroup(props: ToggleGroupProps): import("solid-js").JSX.Element;
|
|
11
|
+
type ToggleGroupItemProps = ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>;
|
|
12
|
+
declare function ToggleGroupItem(props: ToggleGroupItemProps): import("solid-js").JSX.Element;
|
|
13
|
+
export { ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps };
|
|
@@ -1,24 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { ToggleGroup as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
spacing: 2,
|
|
12
|
-
orientation: 'horizontal',
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { toggleVariants } from "./toggle.js";
|
|
3
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
4
|
+
import { createContext, splitProps, useContext } from "solid-js";
|
|
5
|
+
import { ToggleGroup as ToggleGroup$1 } from "@kobalte/core/toggle-group";
|
|
6
|
+
//#region src/components/ui/toggle-group.tsx
|
|
7
|
+
var ToggleGroupContext = createContext({
|
|
8
|
+
size: "default",
|
|
9
|
+
variant: "default",
|
|
10
|
+
spacing: 2
|
|
13
11
|
});
|
|
14
|
-
function ToggleGroup(
|
|
15
|
-
|
|
12
|
+
function ToggleGroup(props) {
|
|
13
|
+
const [local, rest] = splitProps(props, [
|
|
14
|
+
"class",
|
|
15
|
+
"variant",
|
|
16
|
+
"size",
|
|
17
|
+
"spacing",
|
|
18
|
+
"orientation",
|
|
19
|
+
"children",
|
|
20
|
+
"value",
|
|
21
|
+
"onChange"
|
|
22
|
+
]);
|
|
23
|
+
return createComponent(ToggleGroup$1, mergeProps({
|
|
24
|
+
"data-slot": "toggle-group",
|
|
25
|
+
get ["data-variant"]() {
|
|
26
|
+
return local.variant ?? "default";
|
|
27
|
+
},
|
|
28
|
+
get ["data-size"]() {
|
|
29
|
+
return local.size ?? "default";
|
|
30
|
+
},
|
|
31
|
+
get ["data-spacing"]() {
|
|
32
|
+
return local.spacing ?? 2;
|
|
33
|
+
},
|
|
34
|
+
get ["data-orientation"]() {
|
|
35
|
+
return local.orientation ?? "horizontal";
|
|
36
|
+
},
|
|
37
|
+
multiple: true,
|
|
38
|
+
get value() {
|
|
39
|
+
return local.value;
|
|
40
|
+
},
|
|
41
|
+
get onChange() {
|
|
42
|
+
return local.onChange;
|
|
43
|
+
},
|
|
44
|
+
get style() {
|
|
45
|
+
return { "--gap": local.spacing ?? 2 };
|
|
46
|
+
},
|
|
47
|
+
get ["class"]() {
|
|
48
|
+
return cn("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", local.class);
|
|
49
|
+
}
|
|
50
|
+
}, rest, { get children() {
|
|
51
|
+
return createComponent(ToggleGroupContext.Provider, {
|
|
52
|
+
get value() {
|
|
53
|
+
return {
|
|
54
|
+
variant: local.variant,
|
|
55
|
+
size: local.size,
|
|
56
|
+
spacing: local.spacing ?? 2
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
return local.children;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
} }));
|
|
16
64
|
}
|
|
17
|
-
function ToggleGroupItem(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
65
|
+
function ToggleGroupItem(props) {
|
|
66
|
+
const [local, rest] = splitProps(props, [
|
|
67
|
+
"class",
|
|
68
|
+
"children",
|
|
69
|
+
"variant",
|
|
70
|
+
"size"
|
|
71
|
+
]);
|
|
72
|
+
const context = useContext(ToggleGroupContext);
|
|
73
|
+
return createComponent(ToggleGroup$1.Item, mergeProps({
|
|
74
|
+
"data-slot": "toggle-group-item",
|
|
75
|
+
get ["data-variant"]() {
|
|
76
|
+
return context.variant ?? local.variant;
|
|
77
|
+
},
|
|
78
|
+
get ["data-size"]() {
|
|
79
|
+
return context.size ?? local.size;
|
|
80
|
+
},
|
|
81
|
+
get ["data-spacing"]() {
|
|
82
|
+
return context.spacing;
|
|
83
|
+
},
|
|
84
|
+
get ["class"]() {
|
|
85
|
+
return cn("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants({
|
|
86
|
+
variant: context.variant ?? local.variant,
|
|
87
|
+
size: context.size ?? local.size
|
|
88
|
+
}), local.class);
|
|
89
|
+
}
|
|
90
|
+
}, rest, { get children() {
|
|
91
|
+
return local.children;
|
|
92
|
+
} }));
|
|
23
93
|
}
|
|
94
|
+
//#endregion
|
|
24
95
|
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ToggleButton as TogglePrimitive } from '@kobalte/core/toggle-button';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { type ComponentProps } from 'solid-js';
|
|
3
4
|
declare const toggleVariants: (props?: ({
|
|
4
5
|
variant?: "default" | "outline" | null | undefined;
|
|
5
6
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
+
type ToggleProps = ComponentProps<typeof TogglePrimitive> & VariantProps<typeof toggleVariants>;
|
|
9
|
+
declare function Toggle(props: ToggleProps): import("solid-js").JSX.Element;
|
|
8
10
|
export { Toggle, toggleVariants };
|
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cva } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { ToggleButton } from "@kobalte/core/toggle-button";
|
|
6
|
+
//#region src/components/ui/toggle.tsx
|
|
7
|
+
var toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-transparent",
|
|
11
|
+
outline: "border border-input bg-transparent hover:bg-muted"
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
15
|
+
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
16
|
+
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
size: "default"
|
|
22
|
+
}
|
|
22
23
|
});
|
|
23
|
-
function Toggle(
|
|
24
|
-
|
|
24
|
+
function Toggle(props) {
|
|
25
|
+
const [local, rest] = splitProps(props, [
|
|
26
|
+
"class",
|
|
27
|
+
"variant",
|
|
28
|
+
"size"
|
|
29
|
+
]);
|
|
30
|
+
return createComponent(ToggleButton, mergeProps({
|
|
31
|
+
"data-slot": "toggle",
|
|
32
|
+
get ["class"]() {
|
|
33
|
+
return cn(toggleVariants({
|
|
34
|
+
variant: local.variant,
|
|
35
|
+
size: local.size
|
|
36
|
+
}), local.class);
|
|
37
|
+
}
|
|
38
|
+
}, rest));
|
|
25
39
|
}
|
|
40
|
+
//#endregion
|
|
26
41
|
export { Toggle, toggleVariants };
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from '@kobalte/core/tooltip';
|
|
2
|
+
import { type ComponentProps, type ParentProps } from 'solid-js';
|
|
3
3
|
declare const TOOLTIP_DELAY = 200;
|
|
4
|
-
declare function TooltipProvider(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare function
|
|
4
|
+
declare function TooltipProvider(props: ParentProps<{
|
|
5
|
+
delay?: number;
|
|
6
|
+
}>): import("solid-js").JSX.Element;
|
|
7
|
+
declare function Tooltip(props: ComponentProps<typeof TooltipPrimitive>): import("solid-js").JSX.Element;
|
|
8
|
+
declare function TooltipTrigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>): import("solid-js").JSX.Element;
|
|
9
|
+
type TooltipContentProps = ComponentProps<typeof TooltipPrimitive.Content> & {
|
|
10
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
11
|
+
sideOffset?: number;
|
|
12
|
+
align?: 'start' | 'center' | 'end';
|
|
13
|
+
};
|
|
14
|
+
declare function TooltipContent(props: TooltipContentProps): import("solid-js").JSX.Element;
|
|
8
15
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TOOLTIP_DELAY };
|
|
@@ -1,18 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
3
|
+
import { createContext, splitProps, useContext } from "solid-js";
|
|
4
|
+
import { Tooltip as Tooltip$1 } from "@kobalte/core/tooltip";
|
|
5
|
+
//#region src/components/ui/tooltip.tsx
|
|
6
|
+
var TOOLTIP_DELAY = 200;
|
|
7
|
+
var TooltipDelayContext = createContext(200);
|
|
8
|
+
function TooltipProvider(props) {
|
|
9
|
+
return createComponent(TooltipDelayContext.Provider, {
|
|
10
|
+
get value() {
|
|
11
|
+
return props.delay ?? 200;
|
|
12
|
+
},
|
|
13
|
+
get children() {
|
|
14
|
+
return props.children;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
8
17
|
}
|
|
9
|
-
function Tooltip(
|
|
10
|
-
|
|
18
|
+
function Tooltip(props) {
|
|
19
|
+
const delay = useContext(TooltipDelayContext);
|
|
20
|
+
return createComponent(Tooltip$1, mergeProps({
|
|
21
|
+
openDelay: delay,
|
|
22
|
+
"data-slot": "tooltip"
|
|
23
|
+
}, props));
|
|
11
24
|
}
|
|
12
|
-
function TooltipTrigger(
|
|
13
|
-
|
|
25
|
+
function TooltipTrigger(props) {
|
|
26
|
+
return createComponent(Tooltip$1.Trigger, mergeProps({ "data-slot": "tooltip-trigger" }, props));
|
|
14
27
|
}
|
|
15
|
-
function TooltipContent(
|
|
16
|
-
|
|
28
|
+
function TooltipContent(props) {
|
|
29
|
+
const [local, rest] = splitProps(props, [
|
|
30
|
+
"class",
|
|
31
|
+
"side",
|
|
32
|
+
"sideOffset",
|
|
33
|
+
"align",
|
|
34
|
+
"children"
|
|
35
|
+
]);
|
|
36
|
+
const placement = () => `${local.side ?? "top"}${local.align ? `-${local.align}` : ""}`;
|
|
37
|
+
return createComponent(Tooltip$1.Portal, { get children() {
|
|
38
|
+
return createComponent(Tooltip$1.Content, mergeProps({
|
|
39
|
+
"data-slot": "tooltip-content",
|
|
40
|
+
get placement() {
|
|
41
|
+
return placement();
|
|
42
|
+
},
|
|
43
|
+
get gutter() {
|
|
44
|
+
return local.sideOffset ?? 4;
|
|
45
|
+
},
|
|
46
|
+
get ["class"]() {
|
|
47
|
+
return cn("z-[160] max-w-72 rounded-md bg-popover px-2.5 py-1.5 text-sm leading-5 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-closed:animate-out data-closed:fade-out-0 data-expanded:animate-in data-expanded:fade-in-0", local.class);
|
|
48
|
+
}
|
|
49
|
+
}, rest, { get children() {
|
|
50
|
+
return local.children;
|
|
51
|
+
} }));
|
|
52
|
+
} });
|
|
17
53
|
}
|
|
18
|
-
|
|
54
|
+
//#endregion
|
|
55
|
+
export { TOOLTIP_DELAY, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -17,9 +17,9 @@ export type VersionDialogAdapter = Readonly<{
|
|
|
17
17
|
install(expectedVersion: string): Promise<SharedDesktopUpdate>;
|
|
18
18
|
isDesktopRuntime(): boolean;
|
|
19
19
|
}>;
|
|
20
|
-
export declare function VersionDialog(
|
|
20
|
+
export declare function VersionDialog(props: {
|
|
21
21
|
adapter: VersionDialogAdapter;
|
|
22
22
|
fallbackVersion?: string;
|
|
23
23
|
onOpenChange?: (open: boolean) => void;
|
|
24
24
|
open?: boolean;
|
|
25
|
-
}
|
|
25
|
+
}): import("solid-js").JSX.Element;
|