Skip to content

Commit 9cae983

Browse files
committed
[shadcn] Update default components preset
1 parent 1c61651 commit 9cae983

File tree

13 files changed

+50
-49
lines changed

13 files changed

+50
-49
lines changed

.changeset/two-dragons-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sjsf/shadcn-theme": patch
3+
---
4+
5+
Update components presets

packages/shadcn-theme/components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://next.shadcn-svelte.com/schema.json",
3-
"style": "new-york",
3+
"style": "default",
44
"tailwind": {
55
"config": "tailwind.config.js",
66
"css": "src/app.css",
@@ -9,7 +9,7 @@
99
"aliases": {
1010
"components": "$lib/components",
1111
"utils": "$lib/utils",
12-
"ui": "$lib/new-york-ui",
12+
"ui": "$lib/default-ui",
1313
"hooks": "$lib/hooks"
1414
},
1515
"typescript": true,

packages/shadcn-theme/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"clsx": "^2.1.1",
6262
"lucide-svelte": "^0.453.0",
6363
"svelte": "^5.0.0",
64-
"svelte-radix": "^2.0.1",
6564
"tailwind-merge": "^2.5.4",
6665
"tailwind-variants": "^0.2.1"
6766
},
@@ -89,7 +88,6 @@
8988
"prettier-plugin-svelte": "catalog:",
9089
"svelte": "catalog:",
9190
"svelte-check": "catalog:",
92-
"svelte-radix": "^2.0.1",
9391
"tailwind-merge": "^2.5.5",
9492
"tailwind-variants": "^0.3.0",
9593
"tailwindcss": "catalog:",

packages/shadcn-theme/src/lib/default-ui/button/button.svelte

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
<script lang="ts" module>
2-
import type { WithElementRef } from 'bits-ui';
3-
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
4-
import { type VariantProps, tv } from 'tailwind-variants';
2+
import type { WithElementRef } from "bits-ui";
3+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
4+
import { type VariantProps, tv } from "tailwind-variants";
55
66
export const buttonVariants = tv({
7-
base: 'ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
7+
base: "ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
88
variants: {
99
variant: {
10-
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
11-
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
12-
outline: 'border-input bg-background hover:bg-accent hover:text-accent-foreground border',
13-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
14-
ghost: 'hover:bg-accent hover:text-accent-foreground',
15-
link: 'text-primary underline-offset-4 hover:underline'
10+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
11+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
12+
outline:
13+
"border-input bg-background hover:bg-accent hover:text-accent-foreground border",
14+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
15+
ghost: "hover:bg-accent hover:text-accent-foreground",
16+
link: "text-primary underline-offset-4 hover:underline",
1617
},
1718
size: {
18-
default: 'h-10 px-4 py-2',
19-
sm: 'h-9 rounded-md px-3',
20-
lg: 'h-11 rounded-md px-8',
21-
icon: 'h-10 w-10'
22-
}
19+
default: "h-10 px-4 py-2",
20+
sm: "h-9 rounded-md px-3",
21+
lg: "h-11 rounded-md px-8",
22+
icon: "h-10 w-10",
23+
},
2324
},
2425
defaultVariants: {
25-
variant: 'default',
26-
size: 'default'
27-
}
26+
variant: "default",
27+
size: "default",
28+
},
2829
});
2930
30-
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
31-
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
31+
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
32+
export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
3233
3334
export type ButtonProps = WithElementRef<HTMLButtonAttributes | HTMLAnchorAttributes> & {
3435
variant?: ButtonVariant;
@@ -37,12 +38,12 @@
3738
</script>
3839

3940
<script lang="ts">
40-
import { cn } from '$lib/utils.js';
41+
import { cn } from "$lib/utils.js";
4142
4243
let {
4344
class: className,
44-
variant = 'default',
45-
size = 'default',
45+
variant = "default",
46+
size = "default",
4647
ref = $bindable(null),
4748
type = 'button',
4849
children,

packages/shadcn-theme/src/lib/default-ui/calendar/calendar-next-button.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import type { Snippet } from 'svelte';
32
import { Calendar as CalendarPrimitive } from "bits-ui";
43
import ChevronRight from "lucide-svelte/icons/chevron-right";
54
import { buttonVariants } from "$lib/default-ui/button/index.js";
@@ -24,6 +23,6 @@
2423
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
2524
className
2625
)}
27-
children={children as Snippet || Fallback}
26+
children={children || Fallback}
2827
{...restProps}
2928
/>

packages/shadcn-theme/src/lib/default-ui/calendar/calendar-prev-button.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import type { Snippet } from 'svelte';
32
import { Calendar as CalendarPrimitive } from "bits-ui";
43
import ChevronLeft from "lucide-svelte/icons/chevron-left";
54
import { buttonVariants } from "$lib/default-ui/button/index.js";
@@ -24,6 +23,6 @@
2423
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
2524
className
2625
)}
27-
children={children as Snippet || Fallback}
26+
children={children || Fallback}
2827
{...restProps}
2928
/>

packages/shadcn-theme/src/lib/default-ui/checkbox/checkbox.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
{/if}
3333
</div>
3434
{/snippet}
35-
</CheckboxPrimitive.Root>
35+
</CheckboxPrimitive.Root>

packages/shadcn-theme/src/lib/default-ui/popover/popover-content.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
class: className,
88
sideOffset = 4,
99
align = "center",
10+
portalProps,
1011
...restProps
11-
}: PopoverPrimitive.ContentProps = $props();
12+
}: PopoverPrimitive.ContentProps & {
13+
portalProps?: PopoverPrimitive.PortalProps;
14+
} = $props();
1215
</script>
1316

14-
<PopoverPrimitive.Portal>
17+
<PopoverPrimitive.Portal {...portalProps}>
1518
<PopoverPrimitive.Content
1619
bind:ref
1720
{sideOffset}

packages/shadcn-theme/src/lib/default-ui/select/select-content.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
ref = $bindable(null),
99
class: className,
1010
sideOffset = 4,
11+
portalProps,
1112
children,
1213
...restProps
13-
}: WithoutChild<SelectPrimitive.ContentProps> = $props();
14+
}: WithoutChild<SelectPrimitive.ContentProps> & {
15+
portalProps?: SelectPrimitive.PortalProps;
16+
} = $props();
1417
</script>
1518

16-
<SelectPrimitive.Portal>
19+
<SelectPrimitive.Portal {...portalProps}>
1720
<SelectPrimitive.Content
1821
bind:ref
1922
{sideOffset}

packages/shadcn-theme/src/lib/default-ui/select/select-scroll-down-button.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import ChevronDown from "lucide-svelte/icons/chevron-up";
2+
import ChevronDown from "lucide-svelte/icons/chevron-down";
33
import { Select as SelectPrimitive, type WithoutChildrenOrChild } from "bits-ui";
44
import { cn } from "$lib/utils.js";
55

0 commit comments

Comments
 (0)