Skip to content

Commit 70cb15b

Browse files
committed
Upgraded shadcn
1 parent d4f16e4 commit 70cb15b

File tree

12 files changed

+57
-28
lines changed

12 files changed

+57
-28
lines changed

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/badge/badge.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { type VariantProps, tv } from "tailwind-variants";
33
44
export const badgeVariants = tv({
5-
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 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
5+
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 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-full border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
66
variants: {
77
variant: {
88
default:

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/button-group/button-group-separator.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
import { Separator } from "$comp/ui/separator/index.js";
55
66
let {
7+
ref = $bindable(null),
78
class: className,
89
orientation = "vertical",
910
...restProps
1011
}: ComponentProps<typeof Separator> = $props();
1112
</script>
1213

1314
<Separator
15+
bind:ref
1416
data-slot="button-group-separator"
1517
{orientation}
1618
class={cn("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className)}
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
<script lang="ts">
2-
import { cn } from "$lib/utils.js";
2+
import { cn, type WithElementRef } from "$lib/utils.js";
33
import type { HTMLAttributes } from "svelte/elements";
44
import type { Snippet } from "svelte";
55
66
let {
7+
ref = $bindable(null),
78
class: className,
89
child,
910
...restProps
10-
}: HTMLAttributes<HTMLDivElement> & {
11+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
1112
child?: Snippet<[{ props: Record<string, unknown> }]>;
1213
} = $props();
1314
14-
const classes = $derived(
15-
cn(
16-
"bg-muted shadow-xs flex items-center gap-2 rounded-md border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
17-
className
18-
)
19-
);
20-
2115
const mergedProps = $derived({
2216
...restProps,
23-
class: classes,
17+
class: cn(
18+
"bg-muted shadow-xs flex items-center gap-2 rounded-md border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
19+
className
20+
),
2421
});
2522
</script>
2623

2724
{#if child}
2825
{@render child({ props: mergedProps })}
2926
{:else}
30-
<div {...mergedProps}>
27+
<div bind:this={ref} {...mergedProps}>
3128
{@render mergedProps.children?.()}
3229
</div>
3330
{/if}

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/button-group/button-group.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" module>
22
import { tv, type VariantProps } from "tailwind-variants";
33
4-
const buttonGroupVariants = tv({
4+
export const buttonGroupVariants = tv({
55
base: "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
66
variants: {
77
orientation: {
@@ -20,20 +20,22 @@
2020
</script>
2121

2222
<script lang="ts">
23-
import { cn } from "$lib/utils.js";
23+
import { cn, type WithElementRef } from "$lib/utils.js";
2424
import type { HTMLAttributes } from "svelte/elements";
2525
2626
let {
27+
ref = $bindable(null),
2728
class: className,
2829
children,
2930
orientation = "horizontal",
3031
...restProps
31-
}: HTMLAttributes<HTMLDivElement> & {
32+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
3233
orientation?: ButtonGroupOrientation;
3334
} = $props();
3435
</script>
3536

3637
<div
38+
bind:this={ref}
3739
role="group"
3840
data-slot="button-group"
3941
data-orientation={orientation}

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/input-group/input-group-addon.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" module>
22
import { tv, type VariantProps } from "tailwind-variants";
3-
const inputGroupAddonVariants = tv({
3+
export const inputGroupAddonVariants = tv({
44
base: "text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
55
variants: {
66
align: {
@@ -23,20 +23,22 @@
2323
</script>
2424

2525
<script lang="ts">
26-
import { cn } from "$lib/utils.js";
26+
import { cn, type WithElementRef } from "$lib/utils.js";
2727
import type { HTMLAttributes } from "svelte/elements";
2828
2929
let {
30+
ref = $bindable(null),
3031
class: className,
3132
children,
3233
align = "inline-start",
3334
...restProps
34-
}: HTMLAttributes<HTMLDivElement> & {
35+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
3536
align?: InputGroupAddonAlign;
3637
} = $props();
3738
</script>
3839

3940
<div
41+
bind:this={ref}
4042
role="group"
4143
data-slot="input-group-addon"
4244
data-align={align}

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/input-group/input-group-button.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import { Button } from "$comp/ui/button/index.js";
2626
2727
let {
28+
ref = $bindable(null),
2829
class: className,
2930
children,
3031
type = "button",
@@ -37,6 +38,7 @@
3738
</script>
3839

3940
<Button
41+
bind:ref
4042
{type}
4143
data-size={size}
4244
{variant}

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/input-group/input-group-input.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
import { Input } from "$comp/ui/input/index.js";
55
66
let {
7+
ref = $bindable(null),
78
value = $bindable(),
89
class: className,
910
...props
1011
}: ComponentProps<typeof Input> = $props();
1112
</script>
1213

1314
<Input
15+
bind:ref
1416
data-slot="input-group-control"
1517
class={cn(
1618
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/input-group/input-group-text.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
<script lang="ts">
2-
import { cn } from "$lib/utils.js";
2+
import { cn, type WithElementRef } from "$lib/utils.js";
33
import type { HTMLAttributes } from "svelte/elements";
44
5-
let { class: className, children, ...restProps }: HTMLAttributes<HTMLSpanElement> = $props();
5+
let {
6+
ref = $bindable(null),
7+
class: className,
8+
children,
9+
...restProps
10+
}: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
611
</script>
712

813
<span
14+
bind:this={ref}
915
class={cn(
1016
"text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
1117
className

src/Exceptionless.Web/ClientApp/src/lib/features/shared/components/ui/input-group/input-group-textarea.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
import type { ComponentProps } from "svelte";
55
66
let {
7+
ref = $bindable(null),
78
value = $bindable(),
89
class: className,
910
...props
1011
}: ComponentProps<typeof Textarea> = $props();
1112
</script>
1213

1314
<Textarea
15+
bind:ref
1416
data-slot="input-group-control"
1517
class={cn(
1618
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
<script lang="ts">
2-
import { cn } from "$lib/utils.js";
2+
import { cn, type WithElementRef } from "$lib/utils.js";
33
import type { HTMLAttributes } from "svelte/elements";
44
5-
let { class: className, children, ...restProps }: HTMLAttributes<HTMLElement> = $props();
5+
let {
6+
ref = $bindable(null),
7+
class: className,
8+
children,
9+
...restProps
10+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props();
611
</script>
712

8-
<kbd data-slot="kbd-group" class={cn("inline-flex items-center gap-1", className)} {...restProps}>
13+
<kbd
14+
bind:this={ref}
15+
data-slot="kbd-group"
16+
class={cn("inline-flex items-center gap-1", className)}
17+
{...restProps}
18+
>
919
{@render children?.()}
1020
</kbd>

0 commit comments

Comments
 (0)