Skip to content

Commit 401e70d

Browse files
committed
Update shadcn-ui
1 parent f229b88 commit 401e70d

8 files changed

Lines changed: 24 additions & 12 deletions

File tree

src/lib/components/ui/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Now it should be easier to see what the CLI actually changed, and we can now pro
2828
* Update it to use our own `ColorSchemeStore` implementation instead of the one from the `svelte-sonner` package.
2929
* Remove `svelte-sonner` from `package.json`
3030

31+
3. **Update `slider` component if modified**
32+
33+
If the `slider` component was modified by the CLI, it most likely removed the `cursor-w-resize` tailwind class.
34+
* Revert the change before committing.
35+
3136
3. **Run code formatting again**
3237

3338
Now we need to run the code formatting again to ensure everything is consistent after the changes made in steps 1 and 2.

src/lib/components/ui/command/command-input.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}: CommandPrimitive.InputProps = $props();
1212
</script>
1313

14-
<div class="flex h-9 items-center gap-2 border-b px-3" data-slot="command-input-wrapper">
14+
<div class="flex h-9 items-center gap-2 border-b pl-3 pr-8" data-slot="command-input-wrapper">
1515
<SearchIcon class="size-4 shrink-0 opacity-50" />
1616
<CommandPrimitive.Input
1717
data-slot="command-input"

src/lib/components/ui/data-table/data-table.svelte.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export function mergeObjects<Sources extends readonly MaybeThunk<any>[]>(
114114
},
115115

116116
ownKeys(): (string | symbol)[] {
117+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
117118
const all = new Set<string | symbol>();
118119
for (const s of sources) {
119120
const obj = resolve(s);

src/lib/components/ui/data-table/flex-render.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
>
55
import type { CellContext, ColumnDefTemplate, HeaderContext } from "@tanstack/table-core";
66
import { RenderComponentConfig, RenderSnippetConfig } from "./render-helpers.js";
7+
import type { Attachment } from "svelte/attachments";
78
type Props = {
89
/** The cell or header field of the current cell's column definition. */
910
content?: TContext extends HeaderContext<TData, TValue>
@@ -13,9 +14,12 @@
1314
: never;
1415
/** The result of the `getContext()` function of the header or cell */
1516
context: TContext;
17+
18+
/** Used to pass attachments that can't be gotten through context */
19+
attach?: Attachment;
1620
};
1721
18-
let { content, context }: Props = $props();
22+
let { content, context, attach }: Props = $props();
1923
</script>
2024

2125
{#if typeof content === "string"}
@@ -26,10 +30,10 @@
2630
{@const result = content(context as any)}
2731
{#if result instanceof RenderComponentConfig}
2832
{@const { component: Component, props } = result}
29-
<Component {...props} />
33+
<Component {...props} {attach} />
3034
{:else if result instanceof RenderSnippetConfig}
3135
{@const { snippet, params } = result}
32-
{@render snippet(params)}
36+
{@render snippet({ ...params, attach })}
3337
{:else}
3438
{result}
3539
{/if}

src/lib/components/ui/dialog/dialog-content.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{@render children?.()}
3434
{#if showCloseButton}
3535
<DialogPrimitive.Close
36-
class="ring-offset-background focus:ring-ring rounded-xs focus:outline-hidden absolute right-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"
36+
class="ring-offset-background focus:ring-ring rounded-xs focus:outline-hidden absolute end-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"
3737
>
3838
<XIcon />
3939
<span class="sr-only">Close</span>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
2-
import * as Button from "$lib/components/ui/button/index.js";
2+
import { Button, type ButtonProps } from "$lib/components/ui/button/index.js";
33
4-
let { ref = $bindable(null), ...restProps }: Button.Props = $props();
4+
let { ref = $bindable(null), ...restProps }: ButtonProps = $props();
55
</script>
66

7-
<Button.Root bind:ref type="submit" {...restProps} />
7+
<Button bind:ref type="submit" {...restProps} />

src/lib/components/ui/input/input.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
type,
1616
files = $bindable(),
1717
class: className,
18+
"data-slot": dataSlot = "input",
1819
...restProps
1920
}: Props = $props();
2021
</script>
2122

2223
{#if type === "file"}
2324
<input
2425
bind:this={ref}
25-
data-slot="input"
26+
data-slot={dataSlot}
2627
class={cn(
27-
"selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
28+
"selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50",
2829
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
2930
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
3031
className
@@ -37,7 +38,7 @@
3738
{:else}
3839
<input
3940
bind:this={ref}
40-
data-slot="input"
41+
data-slot={dataSlot}
4142
class={cn(
4243
"border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
4344
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",

src/lib/components/ui/separator/separator.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
let {
66
ref = $bindable(null),
77
class: className,
8+
"data-slot": dataSlot = "separator",
89
...restProps
910
}: SeparatorPrimitive.RootProps = $props();
1011
</script>
1112

1213
<SeparatorPrimitive.Root
1314
bind:ref
14-
data-slot="separator"
15+
data-slot={dataSlot}
1516
class={cn(
1617
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px",
1718
className

0 commit comments

Comments
 (0)