Skip to content

Commit 0c64901

Browse files
committed
Update shadcn components
1 parent bc0a34c commit 0c64901

160 files changed

Lines changed: 249 additions & 241 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@changesets/cli": "^2.29.4",
2121
"@eslint/compat": "^1.2.9",
2222
"@eslint/js": "^9.28.0",
23+
"@internationalized/date": "^3.8.1",
2324
"@lucide/svelte": "^0.511.0",
2425
"@microsoft/signalr": "^8.0.7",
2526
"@playwright/test": "^1.52.0",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/ui/README.md

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,45 @@
11
## Post-Update Checklist for shadcn Components
22

3-
After updating your `shadcn` components with the CLI, complete the following steps to ensure everything integrates correctly:
3+
After running the shadcn CLI to update your components, follow these steps to ensure everything integrates correctly.
4+
This process helps you isolate and address any changes the CLI made, then reapply your custom modifications.
45

5-
### Modifications
6+
### Steps to Follow
67

7-
##### `sidebar.svelte`
8-
Change `ease-linear` for the sidebar to `ease-in-out` and increase the duration from 200ms to 300ms (`duration-300`)
8+
To start off, we want to eliminate the bulk of the changes that the CLI made, this will make it easier to see what actual changes were made by inspecting the git diff.
99

10-
1. **Update `sonner` component if modified**
10+
To do this we will first migrate all the tailwindcss classes to tailwindcss v4, then format all the code to our code style.
1111

12-
If the `sonner` component was modified by the CLI, it most likely went back to using the `svelte-sonner` package.
13-
* Update it to use our own `ColorSchemeStore` implementation instead of the one from the `svelte-sonner` package.
14-
* Remove `svelte-sonner` from `package.json`
15-
16-
2. **Redirect utility imports**
17-
18-
* Replace every instance of
19-
20-
```js
21-
import ... from '$lib/utils.js'
22-
```
23-
24-
with:
25-
26-
```js
27-
import ... from '$lib/utils/shadcn'
28-
```
29-
30-
This can be done easily with a search and replace tool in your code editor.
12+
```bash
13+
pnpx @tailwindcss/upgrade --force
14+
pnpm run format
15+
```
3116

32-
3. **Replace `shadcn` utils file if CLI generated one**
17+
Now it should be easier to see what the CLI actually changed, and we can now proceed with the following steps:
3318

34-
* If the CLI created `src/lib/utils.ts`, overwrite your existing `src/lib/utils/shadcn.ts` with it.
19+
1. **Update `sidebar` component if modified**
3520

36-
4. **Run tailwindcss migration utility**
21+
If the `sidebar` component was modified by the CLI, it most likely went back to using `ease-linear` and `duration-200`.
22+
* Change `ease-linear` for the sidebar to `ease-in-out`.
23+
* Increase the duration from `duration-200` to `duration-300`.
3724

38-
* Shadcn-svelte still hasnt migrated to tailwindcss v4, so we need to run the migration utility to ensure everything is up to date.
25+
2. **Update `sonner` component if modified**
3926

40-
```bash
41-
pnpx @tailwindcss/upgrade --force
42-
```
27+
If the `sonner` component was modified by the CLI, it most likely went back to using the `svelte-sonner` package.
28+
* Update it to use our own `ColorSchemeStore` implementation instead of the one from the `svelte-sonner` package.
29+
* Remove `svelte-sonner` from `package.json`
4330

44-
5. **Apply consistent styling**
31+
3. **Run code formatting again**
4532

46-
* Run the following command to apply consistent styling:
33+
Now we need to run the code formatting again to ensure everything is consistent after the changes made in steps 1 and 2.
4734

48-
```bash
49-
pnpm run format
50-
```
35+
```bash
36+
pnpm run format
37+
```
5138

52-
6. **Check code for any issues**
39+
4. **Check code for any issues**
5340

5441
* Run the following commands to check for any issues:
5542

5643
```bash
57-
pnpm run lint
5844
pnpm run check
5945
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Accordion as AccordionPrimitive } from "bits-ui";
3-
import { cn, type WithoutChild } from "$lib/utils/shadcn";
3+
import { cn, type WithoutChild } from "$lib/utils/shadcn.js";
44
55
let {
66
ref = $bindable(null),

src/lib/components/ui/accordion/accordion-item.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Accordion as AccordionPrimitive } from "bits-ui";
3-
import { cn } from "$lib/utils/shadcn";
3+
import { cn } from "$lib/utils/shadcn.js";
44
55
let {
66
ref = $bindable(null),

src/lib/components/ui/accordion/accordion-trigger.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { Accordion as AccordionPrimitive } from "bits-ui";
33
import ChevronDownIcon from "@lucide/svelte/icons/chevron-down";
4-
import { cn, type WithoutChild } from "$lib/utils/shadcn";
4+
import { cn, type WithoutChild } from "$lib/utils/shadcn.js";
55
66
let {
77
ref = $bindable(null),

src/lib/components/ui/avatar/avatar-fallback.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Avatar as AvatarPrimitive } from "bits-ui";
3-
import { cn } from "$lib/utils/shadcn";
3+
import { cn } from "$lib/utils/shadcn.js";
44
55
let {
66
ref = $bindable(null),

src/lib/components/ui/avatar/avatar-image.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Avatar as AvatarPrimitive } from "bits-ui";
3-
import { cn } from "$lib/utils/shadcn";
3+
import { cn } from "$lib/utils/shadcn.js";
44
55
let {
66
ref = $bindable(null),

src/lib/components/ui/avatar/avatar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Avatar as AvatarPrimitive } from "bits-ui";
3-
import { cn } from "$lib/utils/shadcn";
3+
import { cn } from "$lib/utils/shadcn.js";
44
55
let {
66
ref = $bindable(null),

src/lib/components/ui/badge/badge.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<script lang="ts">
2626
import type { HTMLAnchorAttributes } from "svelte/elements";
27-
import { cn, type WithElementRef } from "$lib/utils/shadcn";
27+
import { cn, type WithElementRef } from "$lib/utils/shadcn.js";
2828
2929
let {
3030
ref = $bindable(null),

0 commit comments

Comments
 (0)