Skip to content

Commit 1fc31d7

Browse files
authored
fix(next): misplaced className in cn functions (#1585)
1 parent 1dfa7cd commit 1fc31d7

38 files changed

+202
-214
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"prettier-plugin-svelte": "^3.2.7",
5151
"prettier-plugin-tailwindcss": "^0.6.8",
5252
"pretty-quick": "^4.0.0",
53-
"svelte": "^5.15.0",
53+
"svelte": "^5.16.0",
5454
"svelte-eslint-parser": "^0.42.0",
5555
"typescript": "^5.6.3",
5656
"typescript-eslint": "^8.10.0"

pnpm-lock.yaml

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

sites/docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@prettier/sync": "0.3.0",
3131
"@sveltejs/adapter-cloudflare": "4.6.1",
3232
"@sveltejs/enhanced-img": "^0.3.9",
33-
"@sveltejs/kit": "^2.5.28",
33+
"@sveltejs/kit": "^2.12.0",
3434
"@sveltejs/vite-plugin-svelte": "^4.0.0",
3535
"@tanstack/table-core": "^8.20.5",
3636
"@types/d3-scale": "^4.0.8",
@@ -69,7 +69,7 @@
6969
"remark-gfm": "^4.0.0",
7070
"rimraf": "^4.4.1",
7171
"shiki": "^1.2.1",
72-
"svelte": "^5.15.0",
72+
"svelte": "^5.16.0",
7373
"svelte-check": "^4.0.5",
7474
"svelte-local-storage-store": "^0.6.4",
7575
"svelte-persisted-store": "^0.11.0",

sites/docs/src/lib/components/docs/docs-pager.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import ChevronLeft from "lucide-svelte/icons/chevron-left";
33
import ChevronRight from "lucide-svelte/icons/chevron-right";
44
import type { NavItem, NavItemWithChildren } from "$lib/types/nav.js";
5-
import { page } from "$app/stores";
5+
import { page } from "$app/state";
66
import { Button } from "$lib/registry/new-york/ui/button/index.js";
77
import { docsConfig } from "$lib/config/docs.js";
88
@@ -32,7 +32,7 @@
3232
.filter((link) => !link?.disabled);
3333
}
3434
35-
const pager = $derived(getPagerForDoc($page.params.slug));
35+
const pager = $derived(getPagerForDoc(page.params.slug));
3636
</script>
3737

3838
<div class="flex flex-row items-center justify-between">

sites/docs/src/lib/components/docs/examples-nav/example-code-link.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script lang="ts">
22
import ArrowRight from "lucide-svelte/icons/arrow-right";
3-
import { page } from "$app/stores";
3+
import { page } from "$app/state";
44
import { examples } from "$lib/config/docs.js";
55
66
const example = $derived(
7-
examples.find((example) => $page.url.pathname.startsWith(example.href))
7+
examples.find((example) => page.url.pathname.startsWith(example.href))
88
);
99
</script>
1010

sites/docs/src/lib/components/docs/examples-nav/examples-nav.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { cubicInOut } from "svelte/easing";
33
import { crossfade } from "svelte/transition";
44
import ExampleCodeLink from "./example-code-link.svelte";
5-
import { page } from "$app/stores";
5+
import { page } from "$app/state";
66
import { examples } from "$lib/config/docs.js";
77
import { type PrimitiveElementAttributes, cn } from "$lib/utils.js";
88
import { ScrollArea } from "$lib/registry/new-york/ui/scroll-area/index.js";
@@ -24,8 +24,8 @@
2424
>
2525
{#each examples as example, index (index)}
2626
{@const isActive =
27-
$page.url.pathname.startsWith(example.href) ||
28-
($page.url.pathname === "/" && index === 0)}
27+
page.url.pathname.startsWith(example.href) ||
28+
(page.url.pathname === "/" && index === 0)}
2929

3030
<a
3131
href={example.href}

sites/docs/src/lib/components/docs/metadata.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script lang="ts">
22
import { dev } from "$app/environment";
3-
import { page } from "$app/stores";
3+
import { page } from "$app/state";
44
import { siteConfig } from "$lib/config/site.js";
55
66
const title = $derived(
7-
$page.data?.title ? `${$page.data.title} - ${siteConfig.name}` : siteConfig.name
7+
page.data?.title ? `${page.data.title} - ${siteConfig.name}` : siteConfig.name
88
);
99
</script>
1010

@@ -22,7 +22,7 @@
2222
<meta name="twitter:creator" content="huntabyte" />
2323
<meta property="og:title" content={title} />
2424
<meta property="og:type" content="article" />
25-
<meta property="og:url" content={siteConfig.url + $page.url.pathname} />
25+
<meta property="og:url" content={siteConfig.url + page.url.pathname} />
2626
<meta property="og:image" content={siteConfig.ogImage} />
2727
<meta property="og:image:alt" content={siteConfig.name} />
2828
<meta property="og:image:width" content="1200" />

sites/docs/src/lib/components/docs/nav/docs-sidebar-nav-items.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import type { SidebarNavItem } from "$lib/types/nav.js";
3-
import { page } from "$app/stores";
3+
import { page } from "$app/state";
44
import { cn } from "$lib/utils.js";
55
66
let { items }: { items: SidebarNavItem[] } = $props();
@@ -15,7 +15,7 @@
1515
class={cn(
1616
"group flex w-full items-center rounded-md border border-transparent px-2 py-1 hover:underline",
1717
item.disabled && "cursor-not-allowed opacity-60",
18-
$page.url.pathname === item.href
18+
page.url.pathname === item.href
1919
? "text-foreground font-medium"
2020
: "text-muted-foreground"
2121
)}

sites/docs/src/lib/components/docs/nav/main-nav.svelte

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import * as Icon from "../icons/index.js";
3-
import { page } from "$app/stores";
3+
import { page } from "$app/state";
44
import { siteConfig } from "$lib/config/site.js";
55
import { cn } from "$lib/utils.js";
66
</script>
@@ -17,7 +17,7 @@
1717
href="/docs"
1818
class={cn(
1919
"hover:text-foreground/80 transition-colors",
20-
$page.url.pathname === "/docs" ? "text-foreground" : "text-foreground/60"
20+
page.url.pathname === "/docs" ? "text-foreground" : "text-foreground/60"
2121
)}
2222
>
2323
Docs
@@ -26,7 +26,7 @@
2626
href="/docs/components"
2727
class={cn(
2828
"hover:text-foreground/80 transition-colors",
29-
$page.url.pathname.startsWith("/docs/components")
29+
page.url.pathname.startsWith("/docs/components")
3030
? "text-foreground"
3131
: "text-foreground/60"
3232
)}
@@ -37,7 +37,7 @@
3737
href="/blocks"
3838
class={cn(
3939
"hover:text-foreground/80 transition-colors",
40-
$page.url.pathname.startsWith("/blocks") ? "text-foreground" : "text-foreground/60"
40+
page.url.pathname.startsWith("/blocks") ? "text-foreground" : "text-foreground/60"
4141
)}
4242
>
4343
Blocks
@@ -46,7 +46,7 @@
4646
href="/themes"
4747
class={cn(
4848
"hover:text-foreground/80 transition-colors",
49-
$page.url.pathname.startsWith("/themes") ? "text-foreground" : "text-foreground/60"
49+
page.url.pathname.startsWith("/themes") ? "text-foreground" : "text-foreground/60"
5050
)}
5151
>
5252
Themes
@@ -55,9 +55,7 @@
5555
href="/examples"
5656
class={cn(
5757
"hover:text-foreground/80 transition-colors",
58-
$page.url.pathname.startsWith("/examples")
59-
? "text-foreground"
60-
: "text-foreground/60"
58+
page.url.pathname.startsWith("/examples") ? "text-foreground" : "text-foreground/60"
6159
)}
6260
>
6361
Examples
@@ -67,7 +65,7 @@
6765
href="/colors"
6866
class={cn(
6967
"hover:text-foreground/80 transition-colors",
70-
$page.url.pathname.startsWith("/colors") ? "text-foreground" : "text-foreground/60"
68+
page.url.pathname.startsWith("/colors") ? "text-foreground" : "text-foreground/60"
7169
)}
7270
>
7371
Colors

sites/docs/src/lib/components/docs/nav/mobile-link.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { page } from "$app/stores";
2+
import { page } from "$app/state";
33
import { type PrimitiveAnchorAttributes, cn } from "$lib/utils.js";
44
55
let {
@@ -17,7 +17,7 @@
1717

1818
<a
1919
{href}
20-
class={cn($page.url.pathname === href ? "text-foreground" : "text-foreground/60", className)}
20+
class={cn(page.url.pathname === href ? "text-foreground" : "text-foreground/60", className)}
2121
onclick={handleClick}
2222
{...restProps}
2323
>

0 commit comments

Comments
 (0)