@heyramzi/ui 3.2.0 → 3.3.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/dist/shadcn/drawer/index.js +14 -0
- package/package.json +7 -2
- package/scripts/sync-shadcn.mjs +0 -1
- package/src/shadcn/drawer/drawer-close.svelte +7 -0
- package/src/shadcn/drawer/drawer-close.svelte.d.ts +4 -0
- package/src/shadcn/drawer/drawer-content.svelte +36 -0
- package/src/shadcn/drawer/drawer-content.svelte.d.ts +10 -0
- package/src/shadcn/drawer/drawer-description.svelte +17 -0
- package/src/shadcn/drawer/drawer-description.svelte.d.ts +4 -0
- package/src/shadcn/drawer/drawer-footer.svelte +20 -0
- package/src/shadcn/drawer/drawer-footer.svelte.d.ts +5 -0
- package/src/shadcn/drawer/drawer-header.svelte +23 -0
- package/src/shadcn/drawer/drawer-header.svelte.d.ts +5 -0
- package/src/shadcn/drawer/drawer-nested.svelte +12 -0
- package/src/shadcn/drawer/drawer-nested.svelte.d.ts +3 -0
- package/src/shadcn/drawer/drawer-overlay.svelte +20 -0
- package/src/shadcn/drawer/drawer-overlay.svelte.d.ts +4 -0
- package/src/shadcn/drawer/drawer-portal.svelte +7 -0
- package/src/shadcn/drawer/drawer-portal.svelte.d.ts +3 -0
- package/src/shadcn/drawer/drawer-title.svelte +17 -0
- package/src/shadcn/drawer/drawer-title.svelte.d.ts +4 -0
- package/src/shadcn/drawer/drawer-trigger.svelte +7 -0
- package/src/shadcn/drawer/drawer-trigger.svelte.d.ts +4 -0
- package/src/shadcn/drawer/drawer.svelte +12 -0
- package/src/shadcn/drawer/drawer.svelte.d.ts +3 -0
- package/src/shadcn/drawer/index.ts +38 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Close from "../../../src/shadcn/drawer/drawer-close.svelte";
|
|
2
|
+
import Content from "../../../src/shadcn/drawer/drawer-content.svelte";
|
|
3
|
+
import Description from "../../../src/shadcn/drawer/drawer-description.svelte";
|
|
4
|
+
import Footer from "../../../src/shadcn/drawer/drawer-footer.svelte";
|
|
5
|
+
import Header from "../../../src/shadcn/drawer/drawer-header.svelte";
|
|
6
|
+
import NestedRoot from "../../../src/shadcn/drawer/drawer-nested.svelte";
|
|
7
|
+
import Overlay from "../../../src/shadcn/drawer/drawer-overlay.svelte";
|
|
8
|
+
import Portal from "../../../src/shadcn/drawer/drawer-portal.svelte";
|
|
9
|
+
import Title from "../../../src/shadcn/drawer/drawer-title.svelte";
|
|
10
|
+
import Trigger from "../../../src/shadcn/drawer/drawer-trigger.svelte";
|
|
11
|
+
import Root from "../../../src/shadcn/drawer/drawer.svelte";
|
|
12
|
+
export { Root, NestedRoot, Content, Description, Overlay, Footer, Header, Title, Trigger, Portal, Close,
|
|
13
|
+
//
|
|
14
|
+
Root as Drawer, NestedRoot as DrawerNestedRoot, Content as DrawerContent, Description as DrawerDescription, Overlay as DrawerOverlay, Footer as DrawerFooter, Header as DrawerHeader, Title as DrawerTitle, Trigger as DrawerTrigger, Portal as DrawerPortal, Close as DrawerClose };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyramzi/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Svelte 5 UI for apps: primitives, effects and animations, plus work (tasks and docs), charts, slides, an editor, onboarding and a canvas as subpaths.",
|
|
5
5
|
"homepage": "https://ui.heyramzi.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -353,6 +353,7 @@
|
|
|
353
353
|
"svelte-sonner": "^1.2.3",
|
|
354
354
|
"svelte2tsx": "^0.7.63",
|
|
355
355
|
"typescript": "~7.0.2",
|
|
356
|
+
"vaul-svelte": "1.0.0-next.7",
|
|
356
357
|
"vite-plus": "1.5.0"
|
|
357
358
|
},
|
|
358
359
|
"peerDependencies": {
|
|
@@ -361,7 +362,8 @@
|
|
|
361
362
|
"bits-ui": "^2.19.5",
|
|
362
363
|
"mode-watcher": "^1.1.0",
|
|
363
364
|
"svelte": "^5.57.2",
|
|
364
|
-
"svelte-sonner": "^1.2.1"
|
|
365
|
+
"svelte-sonner": "^1.2.1",
|
|
366
|
+
"vaul-svelte": "^1.0.0-next.7"
|
|
365
367
|
},
|
|
366
368
|
"peerDependenciesMeta": {
|
|
367
369
|
"mode-watcher": {
|
|
@@ -375,6 +377,9 @@
|
|
|
375
377
|
},
|
|
376
378
|
"@xyflow/svelte": {
|
|
377
379
|
"optional": true
|
|
380
|
+
},
|
|
381
|
+
"vaul-svelte": {
|
|
382
|
+
"optional": true
|
|
378
383
|
}
|
|
379
384
|
},
|
|
380
385
|
"scripts": {
|
package/scripts/sync-shadcn.mjs
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import type { WithoutChildrenOrChild } from "../../lib/utils.js";
|
|
5
|
+
import DrawerOverlay from "./drawer-overlay.svelte";
|
|
6
|
+
import DrawerPortal from "./drawer-portal.svelte";
|
|
7
|
+
import type { ComponentProps } from "svelte";
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
class: className,
|
|
12
|
+
portalProps,
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
}: DrawerPrimitive.ContentProps & {
|
|
16
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DrawerPortal>>;
|
|
17
|
+
} = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<DrawerPortal {...portalProps}>
|
|
21
|
+
<DrawerOverlay />
|
|
22
|
+
<DrawerPrimitive.Content
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="drawer-content"
|
|
25
|
+
class={cn(
|
|
26
|
+
"bg-popover text-popover-foreground flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50 data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
class="bg-muted mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block"
|
|
33
|
+
></div>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</DrawerPrimitive.Content>
|
|
36
|
+
</DrawerPortal>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
2
|
+
import type { WithoutChildrenOrChild } from "../../lib/utils.js";
|
|
3
|
+
import DrawerPortal from "./drawer-portal.svelte";
|
|
4
|
+
import type { ComponentProps } from "svelte";
|
|
5
|
+
type $$ComponentProps = DrawerPrimitive.ContentProps & {
|
|
6
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DrawerPortal>>;
|
|
7
|
+
};
|
|
8
|
+
declare const $$Component: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
9
|
+
type $$Component = ReturnType<typeof $$Component>;
|
|
10
|
+
export default $$Component;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DrawerPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DrawerPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="drawer-description"
|
|
15
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "../../lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="drawer-footer"
|
|
16
|
+
class={cn("gap-2 p-4 mt-auto flex flex-col", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from "../../lib/utils.js";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
declare const $$Component: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type $$Component = ReturnType<typeof $$Component>;
|
|
5
|
+
export default $$Component;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "../../lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="drawer-header"
|
|
16
|
+
class={cn(
|
|
17
|
+
"gap-0.5 p-4 md:gap-1.5 md:text-left flex flex-col group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from "../../lib/utils.js";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
declare const $$Component: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type $$Component = ReturnType<typeof $$Component>;
|
|
5
|
+
export default $$Component;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
shouldScaleBackground = true,
|
|
6
|
+
open = $bindable(false),
|
|
7
|
+
activeSnapPoint = $bindable(null),
|
|
8
|
+
...restProps
|
|
9
|
+
}: DrawerPrimitive.RootProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DrawerPrimitive.NestedRoot {shouldScaleBackground} bind:open bind:activeSnapPoint {...restProps} />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DrawerPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DrawerPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="drawer-overlay"
|
|
15
|
+
class={cn(
|
|
16
|
+
"bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DrawerPrimitive.TitleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DrawerPrimitive.Title
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="drawer-title"
|
|
15
|
+
class={cn("cn-font-heading text-foreground font-medium", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul-svelte";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
shouldScaleBackground = true,
|
|
6
|
+
open = $bindable(false),
|
|
7
|
+
activeSnapPoint = $bindable(null),
|
|
8
|
+
...restProps
|
|
9
|
+
}: DrawerPrimitive.RootProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DrawerPrimitive.Root {shouldScaleBackground} bind:open bind:activeSnapPoint {...restProps} />
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Close from "./drawer-close.svelte";
|
|
2
|
+
import Content from "./drawer-content.svelte";
|
|
3
|
+
import Description from "./drawer-description.svelte";
|
|
4
|
+
import Footer from "./drawer-footer.svelte";
|
|
5
|
+
import Header from "./drawer-header.svelte";
|
|
6
|
+
import NestedRoot from "./drawer-nested.svelte";
|
|
7
|
+
import Overlay from "./drawer-overlay.svelte";
|
|
8
|
+
import Portal from "./drawer-portal.svelte";
|
|
9
|
+
import Title from "./drawer-title.svelte";
|
|
10
|
+
import Trigger from "./drawer-trigger.svelte";
|
|
11
|
+
import Root from "./drawer.svelte";
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
Root,
|
|
15
|
+
NestedRoot,
|
|
16
|
+
Content,
|
|
17
|
+
Description,
|
|
18
|
+
Overlay,
|
|
19
|
+
Footer,
|
|
20
|
+
Header,
|
|
21
|
+
Title,
|
|
22
|
+
Trigger,
|
|
23
|
+
Portal,
|
|
24
|
+
Close,
|
|
25
|
+
|
|
26
|
+
//
|
|
27
|
+
Root as Drawer,
|
|
28
|
+
NestedRoot as DrawerNestedRoot,
|
|
29
|
+
Content as DrawerContent,
|
|
30
|
+
Description as DrawerDescription,
|
|
31
|
+
Overlay as DrawerOverlay,
|
|
32
|
+
Footer as DrawerFooter,
|
|
33
|
+
Header as DrawerHeader,
|
|
34
|
+
Title as DrawerTitle,
|
|
35
|
+
Trigger as DrawerTrigger,
|
|
36
|
+
Portal as DrawerPortal,
|
|
37
|
+
Close as DrawerClose,
|
|
38
|
+
};
|