@shellicar/ui-shadcn 1.0.2
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/app.css +70 -0
- package/dist/components/page/HomeButton.svelte +8 -0
- package/dist/components/page/HomeButton.svelte.d.ts +18 -0
- package/dist/components/page/PageHeader.svelte +15 -0
- package/dist/components/page/PageHeader.svelte.d.ts +7 -0
- package/dist/components/page/PageSection.svelte +32 -0
- package/dist/components/page/PageSection.svelte.d.ts +13 -0
- package/dist/components/page/index.d.ts +4 -0
- package/dist/components/page/index.js +4 -0
- package/dist/components/ui/button/button.svelte +80 -0
- package/dist/components/ui/button/button.svelte.d.ts +64 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/index.js +4 -0
- package/dist/components/ui/card/card-action.svelte +15 -0
- package/dist/components/ui/card/card-action.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-content.svelte +10 -0
- package/dist/components/ui/card/card-content.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-description.svelte +15 -0
- package/dist/components/ui/card/card-description.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-footer.svelte +15 -0
- package/dist/components/ui/card/card-footer.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-header.svelte +18 -0
- package/dist/components/ui/card/card-header.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-title.svelte +15 -0
- package/dist/components/ui/card/card-title.svelte.d.ts +5 -0
- package/dist/components/ui/card/card.svelte +18 -0
- package/dist/components/ui/card/card.svelte.d.ts +5 -0
- package/dist/components/ui/card/index.d.ts +8 -0
- package/dist/components/ui/card/index.js +10 -0
- package/dist/components/ui/form/form-button.svelte +7 -0
- package/dist/components/ui/form/form-button.svelte.d.ts +4 -0
- package/dist/components/ui/form/form-description.svelte +13 -0
- package/dist/components/ui/form/form-description.svelte.d.ts +4 -0
- package/dist/components/ui/form/form-element-field.svelte +27 -0
- package/dist/components/ui/form/form-element-field.svelte.d.ts +28 -0
- package/dist/components/ui/form/form-field-errors.svelte +30 -0
- package/dist/components/ui/form/form-field-errors.svelte.d.ts +8 -0
- package/dist/components/ui/form/form-field.svelte +33 -0
- package/dist/components/ui/form/form-field.svelte.d.ts +28 -0
- package/dist/components/ui/form/form-fieldset.svelte +18 -0
- package/dist/components/ui/form/form-fieldset.svelte.d.ts +27 -0
- package/dist/components/ui/form/form-label.svelte +19 -0
- package/dist/components/ui/form/form-label.svelte.d.ts +4 -0
- package/dist/components/ui/form/form-legend.svelte +12 -0
- package/dist/components/ui/form/form-legend.svelte.d.ts +4 -0
- package/dist/components/ui/form/index.d.ts +11 -0
- package/dist/components/ui/form/index.js +13 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/index.js +4 -0
- package/dist/components/ui/input/input.svelte +41 -0
- package/dist/components/ui/input/input.svelte.d.ts +13 -0
- package/dist/components/ui/label/index.d.ts +2 -0
- package/dist/components/ui/label/index.js +4 -0
- package/dist/components/ui/label/label.svelte +16 -0
- package/dist/components/ui/label/label.svelte.d.ts +4 -0
- package/dist/components/ui/popover/index.d.ts +6 -0
- package/dist/components/ui/popover/index.js +8 -0
- package/dist/components/ui/popover/popover-close.svelte +7 -0
- package/dist/components/ui/popover/popover-close.svelte.d.ts +4 -0
- package/dist/components/ui/popover/popover-content.svelte +31 -0
- package/dist/components/ui/popover/popover-content.svelte.d.ts +10 -0
- package/dist/components/ui/popover/popover-portal.svelte +7 -0
- package/dist/components/ui/popover/popover-portal.svelte.d.ts +3 -0
- package/dist/components/ui/popover/popover-trigger.svelte +13 -0
- package/dist/components/ui/popover/popover-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/popover/popover.svelte +7 -0
- package/dist/components/ui/popover/popover.svelte.d.ts +3 -0
- package/dist/components/ui/select/index.d.ts +12 -0
- package/dist/components/ui/select/index.js +14 -0
- package/dist/components/ui/select/select-content.svelte +45 -0
- package/dist/components/ui/select/select-content.svelte.d.ts +11 -0
- package/dist/components/ui/select/select-group-heading.svelte +16 -0
- package/dist/components/ui/select/select-group-heading.svelte.d.ts +10 -0
- package/dist/components/ui/select/select-group.svelte +7 -0
- package/dist/components/ui/select/select-group.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-item.svelte +31 -0
- package/dist/components/ui/select/select-item.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-label.svelte +15 -0
- package/dist/components/ui/select/select-label.svelte.d.ts +6 -0
- package/dist/components/ui/select/select-portal.svelte +7 -0
- package/dist/components/ui/select/select-portal.svelte.d.ts +3 -0
- package/dist/components/ui/select/select-scroll-down-button.svelte +16 -0
- package/dist/components/ui/select/select-scroll-down-button.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-scroll-up-button.svelte +16 -0
- package/dist/components/ui/select/select-scroll-up-button.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-separator.svelte +14 -0
- package/dist/components/ui/select/select-separator.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-trigger.svelte +29 -0
- package/dist/components/ui/select/select-trigger.svelte.d.ts +8 -0
- package/dist/components/ui/select/select.svelte +7 -0
- package/dist/components/ui/select/select.svelte.d.ts +3 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/index.js +4 -0
- package/dist/components/ui/separator/separator.svelte +16 -0
- package/dist/components/ui/separator/separator.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/index.d.ts +11 -0
- package/dist/components/ui/sheet/index.js +13 -0
- package/dist/components/ui/sheet/sheet-close.svelte +7 -0
- package/dist/components/ui/sheet/sheet-close.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/sheet-content.svelte +60 -0
- package/dist/components/ui/sheet/sheet-content.svelte.d.ts +37 -0
- package/dist/components/ui/sheet/sheet-description.svelte +13 -0
- package/dist/components/ui/sheet/sheet-description.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/sheet-footer.svelte +15 -0
- package/dist/components/ui/sheet/sheet-footer.svelte.d.ts +5 -0
- package/dist/components/ui/sheet/sheet-header.svelte +15 -0
- package/dist/components/ui/sheet/sheet-header.svelte.d.ts +5 -0
- package/dist/components/ui/sheet/sheet-overlay.svelte +16 -0
- package/dist/components/ui/sheet/sheet-overlay.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/sheet-portal.svelte +7 -0
- package/dist/components/ui/sheet/sheet-portal.svelte.d.ts +3 -0
- package/dist/components/ui/sheet/sheet-title.svelte +13 -0
- package/dist/components/ui/sheet/sheet-title.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/sheet-trigger.svelte +7 -0
- package/dist/components/ui/sheet/sheet-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/sheet.svelte +7 -0
- package/dist/components/ui/sheet/sheet.svelte.d.ts +3 -0
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/index.js +4 -0
- package/dist/components/ui/textarea/textarea.svelte +17 -0
- package/dist/components/ui/textarea/textarea.svelte.d.ts +5 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +5 -0
- package/package.json +81 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
3
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
const { ref = $bindable(null), class: className, value, label, children: childrenProp, ...restProps }: WithoutChild<SelectPrimitive.ItemProps> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<SelectPrimitive.Item
|
|
10
|
+
bind:ref
|
|
11
|
+
{value}
|
|
12
|
+
data-slot="select-item"
|
|
13
|
+
class={cn(
|
|
14
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{#snippet children({ selected, highlighted })}
|
|
20
|
+
<span class="absolute end-2 flex size-3.5 items-center justify-center">
|
|
21
|
+
{#if selected}
|
|
22
|
+
<CheckIcon class="size-4" />
|
|
23
|
+
{/if}
|
|
24
|
+
</span>
|
|
25
|
+
{#if childrenProp}
|
|
26
|
+
{@render childrenProp({ selected, highlighted })}
|
|
27
|
+
{:else}
|
|
28
|
+
{label || value}
|
|
29
|
+
{/if}
|
|
30
|
+
{/snippet}
|
|
31
|
+
</SelectPrimitive.Item>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {} = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
bind:this={ref}
|
|
10
|
+
data-slot="select-label"
|
|
11
|
+
class={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {};
|
|
4
|
+
declare const SelectLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
5
|
+
type SelectLabel = ReturnType<typeof SelectLabel>;
|
|
6
|
+
export default SelectLabel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
3
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
const { ref = $bindable(null), class: className, ...restProps }: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<SelectPrimitive.ScrollDownButton
|
|
10
|
+
bind:ref
|
|
11
|
+
data-slot="select-scroll-down-button"
|
|
12
|
+
class={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
13
|
+
{...restProps}
|
|
14
|
+
>
|
|
15
|
+
<ChevronDownIcon class="size-4" />
|
|
16
|
+
</SelectPrimitive.ScrollDownButton>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const SelectScrollDownButton: import("svelte").Component<Omit<Omit<SelectPrimitive.ScrollDownButtonProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type SelectScrollDownButton = ReturnType<typeof SelectScrollDownButton>;
|
|
4
|
+
export default SelectScrollDownButton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronUpIcon from '@lucide/svelte/icons/chevron-up';
|
|
3
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
const { ref = $bindable(null), class: className, ...restProps }: WithoutChildrenOrChild<SelectPrimitive.ScrollUpButtonProps> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<SelectPrimitive.ScrollUpButton
|
|
10
|
+
bind:ref
|
|
11
|
+
data-slot="select-scroll-up-button"
|
|
12
|
+
class={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
13
|
+
{...restProps}
|
|
14
|
+
>
|
|
15
|
+
<ChevronUpIcon class="size-4" />
|
|
16
|
+
</SelectPrimitive.ScrollUpButton>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
declare const SelectScrollUpButton: import("svelte").Component<Omit<Omit<SelectPrimitive.ScrollUpButtonProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type SelectScrollUpButton = ReturnType<typeof SelectScrollUpButton>;
|
|
4
|
+
export default SelectScrollUpButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Separator as SeparatorPrimitive } from 'bits-ui';
|
|
3
|
+
import { Separator } from '../separator/index.js';
|
|
4
|
+
import { cn } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
const { ref = $bindable(null), class: className, ...restProps }: SeparatorPrimitive.RootProps = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<Separator
|
|
10
|
+
bind:ref
|
|
11
|
+
data-slot="select-separator"
|
|
12
|
+
class={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
13
|
+
{...restProps}
|
|
14
|
+
/>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
|
3
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
4
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
size = 'default',
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
13
|
+
size?: 'sm' | 'default';
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<SelectPrimitive.Trigger
|
|
18
|
+
bind:ref
|
|
19
|
+
data-slot="select-trigger"
|
|
20
|
+
data-size={size}
|
|
21
|
+
class={cn(
|
|
22
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none select-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
<ChevronDownIcon class="size-4 opacity-50" />
|
|
29
|
+
</SelectPrimitive.Trigger>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
2
|
+
import { type WithoutChild } from '../../../utils.js';
|
|
3
|
+
type $$ComponentProps = WithoutChild<SelectPrimitive.TriggerProps> & {
|
|
4
|
+
size?: 'sm' | 'default';
|
|
5
|
+
};
|
|
6
|
+
declare const SelectTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type SelectTrigger = ReturnType<typeof SelectTrigger>;
|
|
8
|
+
export default SelectTrigger;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Select as SelectPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
const { open = $bindable(false), value = $bindable(), ...restProps }: SelectPrimitive.RootProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<SelectPrimitive.Root bind:open bind:value={value as never} {...restProps} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Separator as SeparatorPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, 'data-slot': dataSlot = 'separator', ...restProps }: SeparatorPrimitive.RootProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SeparatorPrimitive.Root
|
|
9
|
+
bind:ref
|
|
10
|
+
data-slot={dataSlot}
|
|
11
|
+
class={cn(
|
|
12
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Root from './sheet.svelte';
|
|
2
|
+
import Close from './sheet-close.svelte';
|
|
3
|
+
import Content from './sheet-content.svelte';
|
|
4
|
+
import Description from './sheet-description.svelte';
|
|
5
|
+
import Footer from './sheet-footer.svelte';
|
|
6
|
+
import Header from './sheet-header.svelte';
|
|
7
|
+
import Overlay from './sheet-overlay.svelte';
|
|
8
|
+
import Portal from './sheet-portal.svelte';
|
|
9
|
+
import Title from './sheet-title.svelte';
|
|
10
|
+
import Trigger from './sheet-trigger.svelte';
|
|
11
|
+
export { Root, Close, Trigger, Portal, Overlay, Content, Header, Footer, Title, Description, Root as Sheet, Close as SheetClose, Trigger as SheetTrigger, Portal as SheetPortal, Overlay as SheetOverlay, Content as SheetContent, Header as SheetHeader, Footer as SheetFooter, Title as SheetTitle, Description as SheetDescription, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Root from './sheet.svelte';
|
|
2
|
+
import Close from './sheet-close.svelte';
|
|
3
|
+
import Content from './sheet-content.svelte';
|
|
4
|
+
import Description from './sheet-description.svelte';
|
|
5
|
+
import Footer from './sheet-footer.svelte';
|
|
6
|
+
import Header from './sheet-header.svelte';
|
|
7
|
+
import Overlay from './sheet-overlay.svelte';
|
|
8
|
+
import Portal from './sheet-portal.svelte';
|
|
9
|
+
import Title from './sheet-title.svelte';
|
|
10
|
+
import Trigger from './sheet-trigger.svelte';
|
|
11
|
+
export { Root, Close, Trigger, Portal, Overlay, Content, Header, Footer, Title, Description,
|
|
12
|
+
//
|
|
13
|
+
Root as Sheet, Close as SheetClose, Trigger as SheetTrigger, Portal as SheetPortal, Overlay as SheetOverlay, Content as SheetContent, Header as SheetHeader, Footer as SheetFooter, Title as SheetTitle, Description as SheetDescription, };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
3
|
+
export const sheetVariants = tv({
|
|
4
|
+
base: 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
5
|
+
variants: {
|
|
6
|
+
side: {
|
|
7
|
+
top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
8
|
+
bottom: 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
9
|
+
left: 'data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start inset-y-0 start-0 h-full w-3/4 border-e sm:max-w-sm',
|
|
10
|
+
right: 'data-[state=closed]:slide-out-to-end data-[state=open]:slide-in-from-end inset-y-0 end-0 h-full w-3/4 border-s sm:max-w-sm',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
side: 'right',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type Side = VariantProps<typeof sheetVariants>['side'];
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
23
|
+
import XIcon from "@lucide/svelte/icons/x";
|
|
24
|
+
import type { Snippet } from "svelte";
|
|
25
|
+
import SheetPortal from "./sheet-portal.svelte";
|
|
26
|
+
import SheetOverlay from "./sheet-overlay.svelte";
|
|
27
|
+
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
28
|
+
import type { ComponentProps } from "svelte";
|
|
29
|
+
|
|
30
|
+
let {
|
|
31
|
+
ref = $bindable(null),
|
|
32
|
+
class: className,
|
|
33
|
+
side = "right",
|
|
34
|
+
portalProps,
|
|
35
|
+
children,
|
|
36
|
+
...restProps
|
|
37
|
+
}: WithoutChildrenOrChild<SheetPrimitive.ContentProps> & {
|
|
38
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>;
|
|
39
|
+
side?: Side;
|
|
40
|
+
children: Snippet;
|
|
41
|
+
} = $props();
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<SheetPortal {...portalProps}>
|
|
45
|
+
<SheetOverlay />
|
|
46
|
+
<SheetPrimitive.Content
|
|
47
|
+
bind:ref
|
|
48
|
+
data-slot="sheet-content"
|
|
49
|
+
class={cn(sheetVariants({ side }), className)}
|
|
50
|
+
{...restProps}
|
|
51
|
+
>
|
|
52
|
+
{@render children?.()}
|
|
53
|
+
<SheetPrimitive.Close
|
|
54
|
+
class="ring-offset-background focus-visible:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none"
|
|
55
|
+
>
|
|
56
|
+
<XIcon class="size-4" />
|
|
57
|
+
<span class="sr-only">Close</span>
|
|
58
|
+
</SheetPrimitive.Close>
|
|
59
|
+
</SheetPrimitive.Content>
|
|
60
|
+
</SheetPortal>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const sheetVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
side: {
|
|
4
|
+
top: string;
|
|
5
|
+
bottom: string;
|
|
6
|
+
left: string;
|
|
7
|
+
right: string;
|
|
8
|
+
};
|
|
9
|
+
}, undefined, "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
|
|
10
|
+
side: {
|
|
11
|
+
top: string;
|
|
12
|
+
bottom: string;
|
|
13
|
+
left: string;
|
|
14
|
+
right: string;
|
|
15
|
+
};
|
|
16
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
17
|
+
side: {
|
|
18
|
+
top: string;
|
|
19
|
+
bottom: string;
|
|
20
|
+
left: string;
|
|
21
|
+
right: string;
|
|
22
|
+
};
|
|
23
|
+
}, undefined, "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", unknown, unknown, undefined>>;
|
|
24
|
+
export type Side = VariantProps<typeof sheetVariants>['side'];
|
|
25
|
+
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
26
|
+
import type { Snippet } from "svelte";
|
|
27
|
+
import SheetPortal from "./sheet-portal.svelte";
|
|
28
|
+
import { type WithoutChildrenOrChild } from "../../../utils.js";
|
|
29
|
+
import type { ComponentProps } from "svelte";
|
|
30
|
+
type $$ComponentProps = WithoutChildrenOrChild<SheetPrimitive.ContentProps> & {
|
|
31
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>;
|
|
32
|
+
side?: Side;
|
|
33
|
+
children: Snippet;
|
|
34
|
+
};
|
|
35
|
+
declare const SheetContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
36
|
+
type SheetContent = ReturnType<typeof SheetContent>;
|
|
37
|
+
export default SheetContent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Dialog as SheetPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, ...restProps }: SheetPrimitive.DescriptionProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SheetPrimitive.Description
|
|
9
|
+
bind:ref
|
|
10
|
+
data-slot="sheet-description"
|
|
11
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
/>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
bind:this={ref}
|
|
10
|
+
data-slot="sheet-footer"
|
|
11
|
+
class={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const SheetFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type SheetFooter = ReturnType<typeof SheetFooter>;
|
|
5
|
+
export default SheetFooter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
bind:this={ref}
|
|
10
|
+
data-slot="sheet-header"
|
|
11
|
+
class={cn("flex flex-col gap-1.5 p-4", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const SheetHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type SheetHeader = ReturnType<typeof SheetHeader>;
|
|
5
|
+
export default SheetHeader;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Dialog as SheetPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, ...restProps }: SheetPrimitive.OverlayProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SheetPrimitive.Overlay
|
|
9
|
+
bind:ref
|
|
10
|
+
data-slot="sheet-overlay"
|
|
11
|
+
class={cn(
|
|
12
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Dialog as SheetPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, ...restProps }: SheetPrimitive.TitleProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<SheetPrimitive.Title
|
|
9
|
+
bind:ref
|
|
10
|
+
data-slot="sheet-title"
|
|
11
|
+
class={cn("text-foreground font-semibold", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef, type WithoutChildren } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), value = $bindable(), class: className, 'data-slot': dataSlot = 'textarea', ...restProps }: WithoutChildren<WithElementRef<HTMLTextareaAttributes>> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<textarea
|
|
9
|
+
bind:this={ref}
|
|
10
|
+
data-slot={dataSlot}
|
|
11
|
+
class={cn(
|
|
12
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
bind:value
|
|
16
|
+
{...restProps}
|
|
17
|
+
></textarea>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const Textarea: import("svelte").Component<Omit<WithElementRef<HTMLTextareaAttributes>, "children">, {}, "ref" | "value">;
|
|
4
|
+
type Textarea = ReturnType<typeof Textarea>;
|
|
5
|
+
export default Textarea;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Form from './components/ui/form/index.js';
|
|
2
|
+
import { Input } from './components/ui/input/index.js';
|
|
3
|
+
import * as Select from './components/ui/select/index.js';
|
|
4
|
+
import { Textarea } from './components/ui/textarea/index.js';
|
|
5
|
+
import { PageSection } from './components/page/index.js';
|
|
6
|
+
import { default as Button, buttonVariants } from './components/ui/button/button.svelte';
|
|
7
|
+
import * as Card from './components/ui/card/index.ts';
|
|
8
|
+
import * as Popover from './components/ui/popover/index.js';
|
|
9
|
+
import { Separator } from './components/ui/separator/index.ts';
|
|
10
|
+
import * as Sheet from './components/ui/sheet/index.js';
|
|
11
|
+
export { Sheet, Separator, Card, Popover, Button, buttonVariants, Form, Input, Select, Textarea, PageSection };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Form from './components/ui/form/index.js';
|
|
2
|
+
import { Input } from './components/ui/input/index.js';
|
|
3
|
+
import * as Select from './components/ui/select/index.js';
|
|
4
|
+
import { Textarea } from './components/ui/textarea/index.js';
|
|
5
|
+
import { PageSection } from './components/page/index.js';
|
|
6
|
+
import { default as Button, buttonVariants } from './components/ui/button/button.svelte';
|
|
7
|
+
import * as Card from "./components/ui/card/index.js";
|
|
8
|
+
import * as Popover from './components/ui/popover/index.js';
|
|
9
|
+
import { Separator } from "./components/ui/separator/index.js";
|
|
10
|
+
import * as Sheet from './components/ui/sheet/index.js';
|
|
11
|
+
export { Sheet, Separator, Card, Popover, Button, buttonVariants, Form, Input, Select, Textarea, PageSection };
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export type WithoutChild<T> = T extends {
|
|
4
|
+
child?: any;
|
|
5
|
+
} ? Omit<T, 'child'> : T;
|
|
6
|
+
export type WithoutChildren<T> = T extends {
|
|
7
|
+
children?: any;
|
|
8
|
+
} ? Omit<T, 'children'> : T;
|
|
9
|
+
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
|
|
10
|
+
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
|
|
11
|
+
ref?: U | null;
|
|
12
|
+
};
|