@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Stephen Hellicar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/app.css
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@layer theme, base, utilities;
|
|
2
|
+
|
|
3
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
4
|
+
@import "tailwindcss/preflight.css" layer(base);
|
|
5
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
6
|
+
|
|
7
|
+
@import "tw-animate-css";
|
|
8
|
+
|
|
9
|
+
@source ".";
|
|
10
|
+
|
|
11
|
+
@plugin "@tailwindcss/typography";
|
|
12
|
+
@plugin "@tailwindcss/forms";
|
|
13
|
+
|
|
14
|
+
@theme inline {
|
|
15
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
16
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
17
|
+
--radius-lg: var(--radius);
|
|
18
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
19
|
+
--color-background: var(--background);
|
|
20
|
+
--color-foreground: var(--foreground);
|
|
21
|
+
--color-card: var(--card);
|
|
22
|
+
--color-card-foreground: var(--card-foreground);
|
|
23
|
+
--color-popover: var(--popover);
|
|
24
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
25
|
+
--color-primary: var(--primary);
|
|
26
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
27
|
+
--color-secondary: var(--secondary);
|
|
28
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
29
|
+
--color-muted: var(--muted);
|
|
30
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
31
|
+
--color-accent: var(--accent);
|
|
32
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
33
|
+
--color-destructive: var(--destructive);
|
|
34
|
+
--color-border: var(--border);
|
|
35
|
+
--color-input: var(--input);
|
|
36
|
+
--color-ring: var(--ring);
|
|
37
|
+
--color-chart-1: var(--chart-1);
|
|
38
|
+
--color-chart-2: var(--chart-2);
|
|
39
|
+
--color-chart-3: var(--chart-3);
|
|
40
|
+
--color-chart-4: var(--chart-4);
|
|
41
|
+
--color-chart-5: var(--chart-5);
|
|
42
|
+
--color-sidebar: var(--sidebar);
|
|
43
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
44
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
45
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
46
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
47
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
48
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
49
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@layer base {
|
|
53
|
+
* {
|
|
54
|
+
@apply border-border outline-ring/50;
|
|
55
|
+
}
|
|
56
|
+
body {
|
|
57
|
+
@apply bg-background text-foreground;
|
|
58
|
+
}
|
|
59
|
+
button,
|
|
60
|
+
a[href],
|
|
61
|
+
[role="button"] {
|
|
62
|
+
touch-action: manipulation;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@layer utilities {
|
|
67
|
+
.touch-manipulation {
|
|
68
|
+
touch-action: manipulation;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import MoveLeft from '@lucide/svelte/icons/move-left';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<a href="/" class="inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors py-2 px-1 -ml-1 min-h-[44px] w-fit">
|
|
6
|
+
<MoveLeft class="h-4 w-4 stroke-[1.5]" />
|
|
7
|
+
<span>Home</span>
|
|
8
|
+
</a>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const HomeButton: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type HomeButton = InstanceType<typeof HomeButton>;
|
|
18
|
+
export default HomeButton;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
type Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const { title, description }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<header class="flex flex-col gap-2">
|
|
11
|
+
<h1 class="text-4xl sm:text-5xl font-extrabold tracking-tight text-foreground">{title}</h1>
|
|
12
|
+
{#if description}
|
|
13
|
+
<p class="max-w-2xl text-base sm:text-lg text-muted-foreground">{description}</p>
|
|
14
|
+
{/if}
|
|
15
|
+
</header>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils.js';
|
|
4
|
+
import HomeButton from './HomeButton.svelte';
|
|
5
|
+
import PageHeader from './PageHeader.svelte';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
header?: {
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
class?: string;
|
|
14
|
+
showHomeButton?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { header, children, class: className = '', showHomeButton = false }: Props = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<section class="w-full">
|
|
21
|
+
<div class={cn('mx-auto max-w-3xl lg:max-w-4xl xl:max-w-5xl 2xl:max-w-6xl px-4 sm:px-6 lg:px-8 xl:px-12 py-6 sm:py-8 lg:py-12 xl:py-16 flex flex-col gap-6 lg:gap-8 xl:gap-10', className)}>
|
|
22
|
+
{#if showHomeButton}
|
|
23
|
+
<HomeButton />
|
|
24
|
+
{/if}
|
|
25
|
+
|
|
26
|
+
{#if header}
|
|
27
|
+
<PageHeader title={header.title} description={header.description} />
|
|
28
|
+
{/if}
|
|
29
|
+
|
|
30
|
+
{@render children?.()}
|
|
31
|
+
</div>
|
|
32
|
+
</section>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
header?: {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
};
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
class?: string;
|
|
9
|
+
showHomeButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const PageSection: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type PageSection = ReturnType<typeof PageSection>;
|
|
13
|
+
export default PageSection;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
4
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
export const buttonVariants = tv({
|
|
7
|
+
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_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/90 shadow-xs',
|
|
11
|
+
destructive: 'bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs',
|
|
12
|
+
outline: 'bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs',
|
|
13
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs',
|
|
14
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
|
15
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
|
19
|
+
sm: 'h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5',
|
|
20
|
+
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
|
21
|
+
icon: 'size-9',
|
|
22
|
+
'icon-sm': 'size-8',
|
|
23
|
+
'icon-lg': 'size-10',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: 'default',
|
|
28
|
+
size: 'default',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
33
|
+
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
|
|
34
|
+
|
|
35
|
+
export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
|
|
36
|
+
WithElementRef<HTMLAnchorAttributes> & {
|
|
37
|
+
variant?: ButtonVariant;
|
|
38
|
+
size?: ButtonSize;
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
let {
|
|
44
|
+
class: className,
|
|
45
|
+
variant = "default",
|
|
46
|
+
size = "default",
|
|
47
|
+
ref = $bindable(null),
|
|
48
|
+
href = undefined,
|
|
49
|
+
type = "button",
|
|
50
|
+
disabled,
|
|
51
|
+
children,
|
|
52
|
+
...restProps
|
|
53
|
+
}: ButtonProps = $props();
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
{#if href}
|
|
57
|
+
<a
|
|
58
|
+
bind:this={ref}
|
|
59
|
+
data-slot="button"
|
|
60
|
+
class={cn(buttonVariants({ variant, size }), className)}
|
|
61
|
+
href={disabled ? undefined : href}
|
|
62
|
+
aria-disabled={disabled}
|
|
63
|
+
role={disabled ? "link" : undefined}
|
|
64
|
+
tabindex={disabled ? -1 : undefined}
|
|
65
|
+
{...restProps}
|
|
66
|
+
>
|
|
67
|
+
{@render children?.()}
|
|
68
|
+
</a>
|
|
69
|
+
{:else}
|
|
70
|
+
<button
|
|
71
|
+
bind:this={ref}
|
|
72
|
+
data-slot="button"
|
|
73
|
+
class={cn(buttonVariants({ variant, size }), className)}
|
|
74
|
+
{type}
|
|
75
|
+
{disabled}
|
|
76
|
+
{...restProps}
|
|
77
|
+
>
|
|
78
|
+
{@render children?.()}
|
|
79
|
+
</button>
|
|
80
|
+
{/if}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
4
|
+
export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
variant: {
|
|
6
|
+
default: string;
|
|
7
|
+
destructive: string;
|
|
8
|
+
outline: string;
|
|
9
|
+
secondary: string;
|
|
10
|
+
ghost: string;
|
|
11
|
+
link: string;
|
|
12
|
+
};
|
|
13
|
+
size: {
|
|
14
|
+
default: string;
|
|
15
|
+
sm: string;
|
|
16
|
+
lg: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
'icon-sm': string;
|
|
19
|
+
'icon-lg': string;
|
|
20
|
+
};
|
|
21
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
22
|
+
variant: {
|
|
23
|
+
default: string;
|
|
24
|
+
destructive: string;
|
|
25
|
+
outline: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
ghost: string;
|
|
28
|
+
link: string;
|
|
29
|
+
};
|
|
30
|
+
size: {
|
|
31
|
+
default: string;
|
|
32
|
+
sm: string;
|
|
33
|
+
lg: string;
|
|
34
|
+
icon: string;
|
|
35
|
+
'icon-sm': string;
|
|
36
|
+
'icon-lg': string;
|
|
37
|
+
};
|
|
38
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
39
|
+
variant: {
|
|
40
|
+
default: string;
|
|
41
|
+
destructive: string;
|
|
42
|
+
outline: string;
|
|
43
|
+
secondary: string;
|
|
44
|
+
ghost: string;
|
|
45
|
+
link: string;
|
|
46
|
+
};
|
|
47
|
+
size: {
|
|
48
|
+
default: string;
|
|
49
|
+
sm: string;
|
|
50
|
+
lg: string;
|
|
51
|
+
icon: string;
|
|
52
|
+
'icon-sm': string;
|
|
53
|
+
'icon-lg': string;
|
|
54
|
+
};
|
|
55
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", unknown, unknown, undefined>>;
|
|
56
|
+
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
57
|
+
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
|
|
58
|
+
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
|
|
59
|
+
variant?: ButtonVariant;
|
|
60
|
+
size?: ButtonSize;
|
|
61
|
+
};
|
|
62
|
+
declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
|
|
63
|
+
type Button = ReturnType<typeof Button>;
|
|
64
|
+
export default Button;
|
|
@@ -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="card-action"
|
|
11
|
+
class={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", 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 CardAction: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type CardAction = ReturnType<typeof CardAction>;
|
|
5
|
+
export default CardAction;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 bind:this={ref} data-slot="card-content" class={cn("px-6", className)} {...restProps}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const CardContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type CardContent = ReturnType<typeof CardContent>;
|
|
5
|
+
export default CardContent;
|
|
@@ -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<HTMLParagraphElement>> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<p
|
|
9
|
+
bind:this={ref}
|
|
10
|
+
data-slot="card-description"
|
|
11
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</p>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const CardDescription: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLParagraphElement>>, {}, "ref">;
|
|
4
|
+
type CardDescription = ReturnType<typeof CardDescription>;
|
|
5
|
+
export default CardDescription;
|
|
@@ -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="card-footer"
|
|
11
|
+
class={cn("flex items-center px-6 [.border-t]:pt-6", 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 CardFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type CardFooter = ReturnType<typeof CardFooter>;
|
|
5
|
+
export default CardFooter;
|
|
@@ -0,0 +1,18 @@
|
|
|
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="card-header"
|
|
11
|
+
class={cn(
|
|
12
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const CardHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type CardHeader = ReturnType<typeof CardHeader>;
|
|
5
|
+
export default CardHeader;
|
|
@@ -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="card-title"
|
|
11
|
+
class={cn("leading-none font-semibold", 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 CardTitle: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type CardTitle = ReturnType<typeof CardTitle>;
|
|
5
|
+
export default CardTitle;
|
|
@@ -0,0 +1,18 @@
|
|
|
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="card"
|
|
11
|
+
class={cn(
|
|
12
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const Card: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type Card = ReturnType<typeof Card>;
|
|
5
|
+
export default Card;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Root from './card.svelte';
|
|
2
|
+
import Action from './card-action.svelte';
|
|
3
|
+
import Content from './card-content.svelte';
|
|
4
|
+
import Description from './card-description.svelte';
|
|
5
|
+
import Footer from './card-footer.svelte';
|
|
6
|
+
import Header from './card-header.svelte';
|
|
7
|
+
import Title from './card-title.svelte';
|
|
8
|
+
export { Root, Content, Description, Footer, Header, Title, Action, Root as Card, Content as CardContent, Description as CardDescription, Footer as CardFooter, Header as CardHeader, Title as CardTitle, Action as CardAction, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Root from './card.svelte';
|
|
2
|
+
import Action from './card-action.svelte';
|
|
3
|
+
import Content from './card-content.svelte';
|
|
4
|
+
import Description from './card-description.svelte';
|
|
5
|
+
import Footer from './card-footer.svelte';
|
|
6
|
+
import Header from './card-header.svelte';
|
|
7
|
+
import Title from './card-title.svelte';
|
|
8
|
+
export { Root, Content, Description, Footer, Header, Title, Action,
|
|
9
|
+
//
|
|
10
|
+
Root as Card, Content as CardContent, Description as CardDescription, Footer as CardFooter, Header as CardHeader, Title as CardTitle, Action as CardAction, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type * as FormPrimitive from 'formsnap';
|
|
3
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
const { ref = $bindable(null), class: className, ...restProps }: WithoutChild<FormPrimitive.DescriptionProps> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<FormPrimitive.Description
|
|
9
|
+
bind:ref
|
|
10
|
+
data-slot="form-description"
|
|
11
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
12
|
+
{...restProps}
|
|
13
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPathLeaves<T>">
|
|
2
|
+
|
|
3
|
+
import * as FormPrimitive from "formsnap";
|
|
4
|
+
|
|
5
|
+
import type { FormPathLeaves } from "sveltekit-superforms";
|
|
6
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
7
|
+
|
|
8
|
+
import { cn, type WithElementRef, type WithoutChildren } from "../../../utils.js";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
class: className,
|
|
13
|
+
form,
|
|
14
|
+
name,
|
|
15
|
+
children: childrenProp,
|
|
16
|
+
...restProps
|
|
17
|
+
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> &
|
|
18
|
+
FormPrimitive.ElementFieldProps<T, U> = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<FormPrimitive.ElementField {form} {name}>
|
|
22
|
+
{#snippet children({ constraints, errors, tainted, value })}
|
|
23
|
+
<div bind:this={ref} class={cn("space-y-2", className)} {...restProps}>
|
|
24
|
+
{@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}
|
|
25
|
+
</div>
|
|
26
|
+
{/snippet}
|
|
27
|
+
</FormPrimitive.ElementField>
|