@adea-ai/ui 0.22.1 → 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,35 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
//#region src/components/ui/button.tsx
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template(`<button data-slot=button>`);
|
|
7
|
+
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 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-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
14
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
15
|
+
success: "bg-success/10 text-success hover:bg-success/20 focus-visible:border-success/40 focus-visible:ring-success/20 dark:bg-success/20 dark:hover:bg-success/30 dark:focus-visible:ring-success/40",
|
|
16
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
20
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
21
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
22
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
23
|
+
icon: "size-8",
|
|
24
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
25
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
26
|
+
"icon-lg": "size-9"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "default"
|
|
32
|
+
}
|
|
31
33
|
});
|
|
32
|
-
function Button(
|
|
33
|
-
|
|
34
|
+
function Button(props) {
|
|
35
|
+
const [local, rest] = splitProps(props, [
|
|
36
|
+
"class",
|
|
37
|
+
"variant",
|
|
38
|
+
"size"
|
|
39
|
+
]);
|
|
40
|
+
return (() => {
|
|
41
|
+
var _el$ = _tmpl$();
|
|
42
|
+
spread(_el$, mergeProps({ get ["class"]() {
|
|
43
|
+
return cn(buttonVariants({
|
|
44
|
+
variant: local.variant,
|
|
45
|
+
size: local.size
|
|
46
|
+
}), local.class);
|
|
47
|
+
} }, rest), false, false);
|
|
48
|
+
return _el$;
|
|
49
|
+
})();
|
|
34
50
|
}
|
|
51
|
+
//#endregion
|
|
35
52
|
export { Button, buttonVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
declare function Card(
|
|
3
|
-
declare function CardContent(
|
|
1
|
+
import { type ComponentProps } from 'solid-js';
|
|
2
|
+
declare function Card(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
3
|
+
declare function CardContent(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
4
4
|
export { Card, CardContent };
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
//#region src/components/ui/card.tsx
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=card>`);
|
|
6
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=card-content>`);
|
|
7
|
+
function Card(props) {
|
|
8
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
9
|
+
return (() => {
|
|
10
|
+
var _el$ = _tmpl$();
|
|
11
|
+
spread(_el$, mergeProps({ get ["class"]() {
|
|
12
|
+
return cn("rounded-xl border bg-card text-card-foreground shadow-sm", local.class);
|
|
13
|
+
} }, rest), false, false);
|
|
14
|
+
return _el$;
|
|
15
|
+
})();
|
|
5
16
|
}
|
|
6
|
-
function CardContent(
|
|
7
|
-
|
|
17
|
+
function CardContent(props) {
|
|
18
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
19
|
+
return (() => {
|
|
20
|
+
var _el$2 = _tmpl$2();
|
|
21
|
+
spread(_el$2, mergeProps({ get ["class"]() {
|
|
22
|
+
return cn("p-4", local.class);
|
|
23
|
+
} }, rest), false, false);
|
|
24
|
+
return _el$2;
|
|
25
|
+
})();
|
|
8
26
|
}
|
|
27
|
+
//#endregion
|
|
9
28
|
export { Card, CardContent };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare function Dialog(
|
|
4
|
-
declare function DialogTrigger(
|
|
5
|
-
declare function DialogPortal(
|
|
6
|
-
declare function DialogClose(
|
|
7
|
-
declare function DialogOverlay(
|
|
8
|
-
declare function DialogContent(
|
|
1
|
+
import { Dialog as DialogPrimitive } from '@kobalte/core/dialog';
|
|
2
|
+
import { type ComponentProps } from 'solid-js';
|
|
3
|
+
declare function Dialog(props: ComponentProps<typeof DialogPrimitive>): import("solid-js").JSX.Element;
|
|
4
|
+
declare function DialogTrigger(props: ComponentProps<typeof DialogPrimitive.Trigger>): import("solid-js").JSX.Element;
|
|
5
|
+
declare function DialogPortal(props: ComponentProps<typeof DialogPrimitive.Portal>): import("solid-js").JSX.Element;
|
|
6
|
+
declare function DialogClose(props: ComponentProps<typeof DialogPrimitive.CloseButton>): import("solid-js").JSX.Element;
|
|
7
|
+
declare function DialogOverlay(props: ComponentProps<typeof DialogPrimitive.Overlay>): import("solid-js").JSX.Element;
|
|
8
|
+
declare function DialogContent(props: ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
|
-
}):
|
|
11
|
-
declare function DialogHeader(
|
|
12
|
-
declare function DialogFooter(
|
|
13
|
-
declare function DialogTitle(
|
|
14
|
-
declare function DialogDescription(
|
|
10
|
+
}): import("solid-js").JSX.Element;
|
|
11
|
+
declare function DialogHeader(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
12
|
+
declare function DialogFooter(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
13
|
+
declare function DialogTitle(props: ComponentProps<typeof DialogPrimitive.Title>): import("solid-js").JSX.Element;
|
|
14
|
+
declare function DialogDescription(props: ComponentProps<typeof DialogPrimitive.Description>): import("solid-js").JSX.Element;
|
|
15
15
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -1,36 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { X } from "lucide-solid";
|
|
4
|
+
import { splitProps } from "solid-js";
|
|
5
|
+
import { Dialog as Dialog$1 } from "@kobalte/core/dialog";
|
|
6
|
+
//#region src/components/ui/dialog.tsx
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div class="fixed inset-0 z-[120] flex items-center justify-center p-4">`);
|
|
8
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=dialog-header>`);
|
|
9
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=dialog-footer>`);
|
|
10
|
+
function Dialog(props) {
|
|
11
|
+
return createComponent(Dialog$1, mergeProps({
|
|
12
|
+
"data-slot": "dialog",
|
|
13
|
+
modal: false
|
|
14
|
+
}, props));
|
|
8
15
|
}
|
|
9
|
-
function DialogTrigger(
|
|
10
|
-
|
|
16
|
+
function DialogTrigger(props) {
|
|
17
|
+
return createComponent(Dialog$1.Trigger, mergeProps({ "data-slot": "dialog-trigger" }, props));
|
|
11
18
|
}
|
|
12
|
-
function DialogPortal(
|
|
13
|
-
|
|
19
|
+
function DialogPortal(props) {
|
|
20
|
+
return createComponent(Dialog$1.Portal, mergeProps({ "data-slot": "dialog-portal" }, props));
|
|
14
21
|
}
|
|
15
|
-
function DialogClose(
|
|
16
|
-
|
|
22
|
+
function DialogClose(props) {
|
|
23
|
+
return createComponent(Dialog$1.CloseButton, mergeProps({ "data-slot": "dialog-close" }, props));
|
|
17
24
|
}
|
|
18
|
-
function DialogOverlay(
|
|
19
|
-
|
|
25
|
+
function DialogOverlay(props) {
|
|
26
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
27
|
+
return createComponent(Dialog$1.Overlay, mergeProps({
|
|
28
|
+
"data-slot": "dialog-overlay",
|
|
29
|
+
get ["class"]() {
|
|
30
|
+
return cn("fixed inset-0 z-[120] bg-slate-950/55 backdrop-blur-[2px]", local.class);
|
|
31
|
+
}
|
|
32
|
+
}, rest));
|
|
20
33
|
}
|
|
21
|
-
function DialogContent(
|
|
22
|
-
|
|
34
|
+
function DialogContent(props) {
|
|
35
|
+
const [local, rest] = splitProps(props, [
|
|
36
|
+
"class",
|
|
37
|
+
"children",
|
|
38
|
+
"showCloseButton"
|
|
39
|
+
]);
|
|
40
|
+
return createComponent(DialogPortal, { get children() {
|
|
41
|
+
return [createComponent(DialogOverlay, {}), (() => {
|
|
42
|
+
var _el$ = _tmpl$();
|
|
43
|
+
insert(_el$, createComponent(Dialog$1.Content, mergeProps({
|
|
44
|
+
"data-slot": "dialog-content",
|
|
45
|
+
get ["class"]() {
|
|
46
|
+
return cn("relative grid max-h-[min(44rem,calc(100dvh-2rem))] w-full max-w-2xl gap-0 overflow-hidden rounded-2xl border bg-card text-card-foreground shadow-2xl outline-none", local.class);
|
|
47
|
+
}
|
|
48
|
+
}, rest, { get children() {
|
|
49
|
+
return [memo(() => local.children), memo(() => memo(() => !!(local.showCloseButton ?? true))() ? createComponent(Dialog$1.CloseButton, {
|
|
50
|
+
"data-slot": "dialog-close",
|
|
51
|
+
"class": "absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
52
|
+
"aria-label": "Close dialog",
|
|
53
|
+
get children() {
|
|
54
|
+
return createComponent(X, {
|
|
55
|
+
"class": "size-4",
|
|
56
|
+
"aria-hidden": "true"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}) : null)];
|
|
60
|
+
} })));
|
|
61
|
+
return _el$;
|
|
62
|
+
})()];
|
|
63
|
+
} });
|
|
23
64
|
}
|
|
24
|
-
function DialogHeader(
|
|
25
|
-
|
|
65
|
+
function DialogHeader(props) {
|
|
66
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
67
|
+
return (() => {
|
|
68
|
+
var _el$2 = _tmpl$2();
|
|
69
|
+
spread(_el$2, mergeProps({ get ["class"]() {
|
|
70
|
+
return cn("flex flex-col gap-1.5 border-b px-6 py-5 pr-14", local.class);
|
|
71
|
+
} }, rest), false, false);
|
|
72
|
+
return _el$2;
|
|
73
|
+
})();
|
|
26
74
|
}
|
|
27
|
-
function DialogFooter(
|
|
28
|
-
|
|
75
|
+
function DialogFooter(props) {
|
|
76
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
77
|
+
return (() => {
|
|
78
|
+
var _el$3 = _tmpl$3();
|
|
79
|
+
spread(_el$3, mergeProps({ get ["class"]() {
|
|
80
|
+
return cn("flex flex-col-reverse gap-2 border-t px-6 py-4 sm:flex-row sm:justify-end", local.class);
|
|
81
|
+
} }, rest), false, false);
|
|
82
|
+
return _el$3;
|
|
83
|
+
})();
|
|
29
84
|
}
|
|
30
|
-
function DialogTitle(
|
|
31
|
-
|
|
85
|
+
function DialogTitle(props) {
|
|
86
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
87
|
+
return createComponent(Dialog$1.Title, mergeProps({
|
|
88
|
+
"data-slot": "dialog-title",
|
|
89
|
+
get ["class"]() {
|
|
90
|
+
return cn("text-base font-semibold tracking-tight", local.class);
|
|
91
|
+
}
|
|
92
|
+
}, rest));
|
|
32
93
|
}
|
|
33
|
-
function DialogDescription(
|
|
34
|
-
|
|
94
|
+
function DialogDescription(props) {
|
|
95
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
96
|
+
return createComponent(Dialog$1.Description, mergeProps({
|
|
97
|
+
"data-slot": "dialog-description",
|
|
98
|
+
get ["class"]() {
|
|
99
|
+
return cn("text-sm leading-5 text-muted-foreground", local.class);
|
|
100
|
+
}
|
|
101
|
+
}, rest));
|
|
35
102
|
}
|
|
36
|
-
|
|
103
|
+
//#endregion
|
|
104
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import DrawerPrimitive from '@corvu/drawer';
|
|
2
|
+
import type { Side } from '@corvu/drawer';
|
|
3
|
+
import { type ComponentProps } from 'solid-js';
|
|
4
|
+
type DrawerSide = Side;
|
|
5
|
+
type DrawerProps = ComponentProps<typeof DrawerPrimitive> & {
|
|
6
|
+
/** Base UI spoke of swipe directions; corvu speaks of the side the drawer attaches to. */
|
|
7
|
+
swipeDirection?: DrawerSide;
|
|
4
8
|
showSwipeHandle?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
declare function
|
|
9
|
-
declare function
|
|
10
|
-
declare function
|
|
11
|
-
declare function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare function
|
|
16
|
-
|
|
9
|
+
};
|
|
10
|
+
declare function Drawer(props: DrawerProps): import("solid-js").JSX.Element;
|
|
11
|
+
declare function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>): import("solid-js").JSX.Element;
|
|
12
|
+
declare function DrawerPortal(props: ComponentProps<typeof DrawerPrimitive.Portal>): import("solid-js").JSX.Element;
|
|
13
|
+
declare function DrawerClose(props: ComponentProps<typeof DrawerPrimitive.Close>): import("solid-js").JSX.Element;
|
|
14
|
+
declare function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>): import("solid-js").JSX.Element;
|
|
15
|
+
declare function DrawerSwipeHandle(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
16
|
+
type DrawerContentProps = ComponentProps<typeof DrawerPrimitive.Content> & {
|
|
17
|
+
showSwipeHandle?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare function DrawerContent(props: DrawerContentProps): import("solid-js").JSX.Element;
|
|
20
|
+
declare function DrawerHeader(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
21
|
+
declare function DrawerFooter(props: ComponentProps<'div'>): import("solid-js").JSX.Element;
|
|
22
|
+
declare function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>): import("solid-js").JSX.Element;
|
|
23
|
+
declare function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>): import("solid-js").JSX.Element;
|
|
24
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerSwipeHandle, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, type DrawerProps, };
|
|
@@ -1,75 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { createComponent, memo, mergeProps, spread, template } from "solid-js/web";
|
|
3
|
+
import { Show, splitProps } from "solid-js";
|
|
4
|
+
import DrawerPrimitive from "@corvu/drawer";
|
|
5
|
+
//#region src/components/ui/drawer.tsx
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=drawer-swipe-handle aria-hidden=true>`);
|
|
7
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=drawer-header>`);
|
|
8
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=drawer-footer>`);
|
|
9
|
+
var SIDE_DRAWER_WIDTH = "w-[var(--drawer-content-width,min(24rem,90vw))]";
|
|
10
|
+
var SIDE_CLASSES = {
|
|
11
|
+
bottom: "inset-x-0 bottom-0 max-h-[calc(100dvh-2rem)] rounded-t-xl border-t",
|
|
12
|
+
top: "inset-x-0 top-0 max-h-[calc(100dvh-2rem)] rounded-b-xl border-b",
|
|
13
|
+
left: `inset-y-0 left-0 h-full ${SIDE_DRAWER_WIDTH} rounded-r-xl border-r`,
|
|
14
|
+
right: `inset-y-0 right-0 h-full ${SIDE_DRAWER_WIDTH} rounded-l-xl border-l`
|
|
15
|
+
};
|
|
16
|
+
function Drawer(props) {
|
|
17
|
+
const [local, rest] = splitProps(props, ["swipeDirection", "side"]);
|
|
18
|
+
return createComponent(DrawerPrimitive, mergeProps({
|
|
19
|
+
"data-slot": "drawer",
|
|
20
|
+
get side() {
|
|
21
|
+
return local.side ?? local.swipeDirection ?? "bottom";
|
|
22
|
+
}
|
|
23
|
+
}, rest));
|
|
13
24
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
const contextValue = React.useMemo(() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }), [hasSnapPoints, modal, showSwipeHandle, swipeDirection]);
|
|
17
|
-
return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", modal: modal, snapPoints: snapPoints, swipeDirection: swipeDirection, ...props }) }));
|
|
25
|
+
function DrawerTrigger(props) {
|
|
26
|
+
return createComponent(DrawerPrimitive.Trigger, mergeProps({ "data-slot": "drawer-trigger" }, props));
|
|
18
27
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
28
|
+
function DrawerPortal(props) {
|
|
29
|
+
return createComponent(DrawerPrimitive.Portal, mergeProps({ "data-slot": "drawer-portal" }, props));
|
|
21
30
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
31
|
+
function DrawerClose(props) {
|
|
32
|
+
return createComponent(DrawerPrimitive.Close, mergeProps({ "data-slot": "drawer-close" }, props));
|
|
24
33
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
34
|
+
function DrawerOverlay(props) {
|
|
35
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
36
|
+
return createComponent(DrawerPrimitive.Overlay, mergeProps({
|
|
37
|
+
"data-slot": "drawer-overlay",
|
|
38
|
+
get ["class"]() {
|
|
39
|
+
return cn("fixed inset-0 z-[110] bg-black/10 backdrop-blur-xs transition-opacity duration-300 data-closed:opacity-0", local.class);
|
|
40
|
+
}
|
|
41
|
+
}, rest));
|
|
27
42
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
43
|
+
function DrawerSwipeHandle(props) {
|
|
44
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
45
|
+
return (() => {
|
|
46
|
+
var _el$ = _tmpl$();
|
|
47
|
+
spread(_el$, mergeProps({ get ["class"]() {
|
|
48
|
+
return cn("relative z-10 flex shrink-0 cursor-grab items-center justify-center py-2 active:cursor-grabbing after:block after:h-1 after:w-24 after:shrink-0 after:rounded-full after:bg-muted", local.class);
|
|
49
|
+
} }, rest), false, false);
|
|
50
|
+
return _el$;
|
|
51
|
+
})();
|
|
30
52
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
53
|
+
function DrawerContent(props) {
|
|
54
|
+
const [local, rest] = splitProps(props, [
|
|
55
|
+
"class",
|
|
56
|
+
"children",
|
|
57
|
+
"showSwipeHandle"
|
|
58
|
+
]);
|
|
59
|
+
const side = DrawerPrimitive.useContext().side;
|
|
60
|
+
return createComponent(DrawerPortal, {
|
|
61
|
+
"data-slot": "drawer-portal",
|
|
62
|
+
get children() {
|
|
63
|
+
return [createComponent(DrawerOverlay, {}), createComponent(DrawerPrimitive.Content, mergeProps({
|
|
64
|
+
"data-slot": "drawer-content",
|
|
65
|
+
get ["class"]() {
|
|
66
|
+
return cn("group/drawer-content fixed z-[110] flex flex-col overflow-hidden bg-popover text-sm text-popover-foreground shadow-lg outline-none transition-transform duration-300 ease-out will-change-transform", SIDE_CLASSES[side()], local.class);
|
|
67
|
+
}
|
|
68
|
+
}, rest, { get children() {
|
|
69
|
+
return [createComponent(Show, {
|
|
70
|
+
get when() {
|
|
71
|
+
return local.showSwipeHandle;
|
|
72
|
+
},
|
|
73
|
+
get children() {
|
|
74
|
+
return createComponent(DrawerSwipeHandle, {});
|
|
75
|
+
}
|
|
76
|
+
}), memo(() => local.children)];
|
|
77
|
+
} }))];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
33
80
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full',
|
|
44
|
-
// Sizing.
|
|
45
|
-
'[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]',
|
|
46
|
-
// Stack.
|
|
47
|
-
'[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]',
|
|
48
|
-
// Transitions.
|
|
49
|
-
'data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]',
|
|
50
|
-
// Axis: y.
|
|
51
|
-
'data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)',
|
|
52
|
-
// Axis: x.
|
|
53
|
-
'data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row',
|
|
54
|
-
// Direction: down.
|
|
55
|
-
'data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]',
|
|
56
|
-
// Direction: up.
|
|
57
|
-
'data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]',
|
|
58
|
-
// Direction: left.
|
|
59
|
-
'data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]',
|
|
60
|
-
// Direction: right.
|
|
61
|
-
'data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]', className), ...props, children: [showSwipeHandle && _jsx(DrawerSwipeHandle, {}), _jsx(DrawerPrimitive.Content, { "data-slot": "drawer-content", className: cn('flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none'), children: children })] }) })] }));
|
|
81
|
+
function DrawerHeader(props) {
|
|
82
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
83
|
+
return (() => {
|
|
84
|
+
var _el$2 = _tmpl$2();
|
|
85
|
+
spread(_el$2, mergeProps({ get ["class"]() {
|
|
86
|
+
return cn("flex shrink-0 flex-col gap-0.5 p-4 pb-0 text-center md:text-left", local.class);
|
|
87
|
+
} }, rest), false, false);
|
|
88
|
+
return _el$2;
|
|
89
|
+
})();
|
|
62
90
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
91
|
+
function DrawerFooter(props) {
|
|
92
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
93
|
+
return (() => {
|
|
94
|
+
var _el$3 = _tmpl$3();
|
|
95
|
+
spread(_el$3, mergeProps({ get ["class"]() {
|
|
96
|
+
return cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", local.class);
|
|
97
|
+
} }, rest), false, false);
|
|
98
|
+
return _el$3;
|
|
99
|
+
})();
|
|
65
100
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
101
|
+
function DrawerTitle(props) {
|
|
102
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
103
|
+
return createComponent(DrawerPrimitive.Label, mergeProps({
|
|
104
|
+
"data-slot": "drawer-title",
|
|
105
|
+
get ["class"]() {
|
|
106
|
+
return cn("text-base font-medium text-foreground", local.class);
|
|
107
|
+
}
|
|
108
|
+
}, rest));
|
|
68
109
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
110
|
+
function DrawerDescription(props) {
|
|
111
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
112
|
+
return createComponent(DrawerPrimitive.Description, mergeProps({
|
|
113
|
+
"data-slot": "drawer-description",
|
|
114
|
+
get ["class"]() {
|
|
115
|
+
return cn("text-sm text-balance text-muted-foreground", local.class);
|
|
116
|
+
}
|
|
117
|
+
}, rest));
|
|
71
118
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerSwipeHandle, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
119
|
+
//#endregion
|
|
120
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger };
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from '@kobalte/core/dropdown-menu';
|
|
2
|
+
import { type ComponentProps } from 'solid-js';
|
|
3
|
+
type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content> & {
|
|
4
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
+
align?: 'start' | 'center' | 'end';
|
|
6
|
+
sideOffset?: number;
|
|
7
|
+
alignOffset?: number;
|
|
8
|
+
};
|
|
9
|
+
declare function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive>): import("solid-js").JSX.Element;
|
|
10
|
+
declare function DropdownMenuPortal(props: ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("solid-js").JSX.Element;
|
|
11
|
+
declare function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("solid-js").JSX.Element;
|
|
12
|
+
declare function DropdownMenuContent(props: DropdownMenuContentProps): import("solid-js").JSX.Element;
|
|
13
|
+
declare function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>): import("solid-js").JSX.Element;
|
|
14
|
+
declare function DropdownMenuLabel(props: ComponentProps<typeof DropdownMenuPrimitive.GroupLabel> & {
|
|
9
15
|
inset?: boolean;
|
|
10
|
-
}):
|
|
11
|
-
declare function DropdownMenuItem(
|
|
16
|
+
}): import("solid-js").JSX.Element;
|
|
17
|
+
declare function DropdownMenuItem(props: ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
12
18
|
inset?: boolean;
|
|
13
19
|
variant?: 'default' | 'destructive';
|
|
14
|
-
}):
|
|
15
|
-
declare function DropdownMenuSub(
|
|
16
|
-
declare function DropdownMenuSubTrigger(
|
|
20
|
+
}): import("solid-js").JSX.Element;
|
|
21
|
+
declare function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("solid-js").JSX.Element;
|
|
22
|
+
declare function DropdownMenuSubTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
17
23
|
inset?: boolean;
|
|
18
|
-
}):
|
|
19
|
-
declare function DropdownMenuSubContent(
|
|
20
|
-
declare function DropdownMenuCheckboxItem(
|
|
24
|
+
}): import("solid-js").JSX.Element;
|
|
25
|
+
declare function DropdownMenuSubContent(props: ComponentProps<typeof DropdownMenuContent>): import("solid-js").JSX.Element;
|
|
26
|
+
declare function DropdownMenuCheckboxItem(props: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
21
27
|
inset?: boolean;
|
|
22
|
-
}):
|
|
23
|
-
declare function DropdownMenuRadioGroup(
|
|
24
|
-
declare function DropdownMenuRadioItem(
|
|
28
|
+
}): import("solid-js").JSX.Element;
|
|
29
|
+
declare function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("solid-js").JSX.Element;
|
|
30
|
+
declare function DropdownMenuRadioItem(props: ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
25
31
|
inset?: boolean;
|
|
26
|
-
}):
|
|
27
|
-
declare function DropdownMenuSeparator(
|
|
28
|
-
declare function DropdownMenuShortcut(
|
|
32
|
+
}): import("solid-js").JSX.Element;
|
|
33
|
+
declare function DropdownMenuSeparator(props: ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("solid-js").JSX.Element;
|
|
34
|
+
declare function DropdownMenuShortcut(props: ComponentProps<'span'>): import("solid-js").JSX.Element;
|
|
29
35
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|