Skip to content

Commit 7f6d46d

Browse files
authored
Merge branch 'main' into pr-factory/issue-9780-switch-class-style
2 parents ecc4992 + dbe1fa7 commit 7f6d46d

Some content is hidden

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

76 files changed

+680
-161
lines changed

.github/workflows/validate-registries.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
check-registry-sync:
1717
if: github.event_name == 'pull_request'
1818
runs-on: ubuntu-latest
19-
name: Check registry sync
19+
name: check-registry-sync
2020
permissions:
2121
contents: read
2222
pull-requests: write
@@ -66,6 +66,44 @@ jobs:
6666
with:
6767
node-version: 20
6868

69+
- name: Block reserved registry namespaces
70+
env:
71+
RESERVED_NAMESPACES: "@shadcn,@ui,@blocks,@components,@block,@component,@util,@utils,@registry,@lib,@hook,@hooks,@theme,@themes,@chart,@charts"
72+
run: |
73+
node <<'EOF'
74+
const fs = require("node:fs")
75+
76+
const files = [
77+
"apps/v4/public/r/registries.json",
78+
"apps/v4/registry/directory.json",
79+
]
80+
const reservedNamespaces = new Set(
81+
process.env.RESERVED_NAMESPACES.split(",").filter(Boolean)
82+
)
83+
84+
function readNames(filePath) {
85+
return JSON.parse(fs.readFileSync(filePath, "utf8")).map(
86+
(entry) => entry.name
87+
)
88+
}
89+
90+
const violations = files.flatMap((filePath) => {
91+
return readNames(filePath)
92+
.filter((name) => reservedNamespaces.has(name))
93+
.map((name) => `${filePath}: ${name}`)
94+
})
95+
96+
if (violations.length > 0) {
97+
console.error("Reserved registry namespaces are not allowed:")
98+
99+
for (const violation of violations) {
100+
console.error(`- ${violation}`)
101+
}
102+
103+
process.exit(1)
104+
}
105+
EOF
106+
69107
- uses: pnpm/action-setup@v4
70108
name: Install pnpm
71109
id: pnpm-install

apps/v4/components/mode-switcher.tsx

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ import { useTheme } from "next-themes"
77
import { cn } from "@/lib/utils"
88
import { useMetaColor } from "@/hooks/use-meta-color"
99
import { Button } from "@/registry/new-york-v4/ui/button"
10-
import { Kbd } from "@/registry/new-york-v4/ui/kbd"
11-
import {
12-
Tooltip,
13-
TooltipContent,
14-
TooltipTrigger,
15-
} from "@/registry/new-york-v4/ui/tooltip"
1610

1711
export const DARK_MODE_FORWARD_TYPE = "dark-mode-forward"
1812

@@ -35,40 +29,33 @@ export function ModeSwitcher({
3529
}, [resolvedTheme, setTheme])
3630

3731
return (
38-
<Tooltip>
39-
<TooltipTrigger asChild>
40-
<Button
41-
variant={variant}
42-
size="icon"
43-
className={cn("group/toggle extend-touch-target size-8", className)}
44-
onClick={toggleTheme}
45-
>
46-
<svg
47-
xmlns="http://www.w3.org/2000/svg"
48-
width="24"
49-
height="24"
50-
viewBox="0 0 24 24"
51-
fill="none"
52-
stroke="currentColor"
53-
strokeWidth="2"
54-
strokeLinecap="round"
55-
strokeLinejoin="round"
56-
className="size-4.5"
57-
>
58-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
59-
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
60-
<path d="M12 3l0 18" />
61-
<path d="M12 9l4.65 -4.65" />
62-
<path d="M12 14.3l7.37 -7.37" />
63-
<path d="M12 19.6l8.85 -8.85" />
64-
</svg>
65-
<span className="sr-only">Toggle theme</span>
66-
</Button>
67-
</TooltipTrigger>
68-
<TooltipContent className="flex items-center gap-2 pr-1">
69-
Toggle Mode <Kbd>D</Kbd>
70-
</TooltipContent>
71-
</Tooltip>
32+
<Button
33+
variant={variant}
34+
size="icon"
35+
className={cn("group/toggle extend-touch-target size-8", className)}
36+
onClick={toggleTheme}
37+
>
38+
<svg
39+
xmlns="http://www.w3.org/2000/svg"
40+
width="24"
41+
height="24"
42+
viewBox="0 0 24 24"
43+
fill="none"
44+
stroke="currentColor"
45+
strokeWidth="2"
46+
strokeLinecap="round"
47+
strokeLinejoin="round"
48+
className="size-4.5"
49+
>
50+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
51+
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
52+
<path d="M12 3l0 18" />
53+
<path d="M12 9l4.65 -4.65" />
54+
<path d="M12 14.3l7.37 -7.37" />
55+
<path d="M12 19.6l8.85 -8.85" />
56+
</svg>
57+
<span className="sr-only">Toggle theme</span>
58+
</Button>
7259
)
7360
}
7461

apps/v4/content/docs/(root)/figma.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ description: Every component recreated in Figma. With customizable props, typogr
1616

1717
## Paid
1818

19-
- [shadcn/ui kit](https://shadcndesign.com) by [ Matt Wierzbicki](https://x.com/matsugfx) - A premium, always up-to-date UI kit for Figma - shadcn/ui compatible and optimized for smooth design-to-dev handoff.
19+
- [shadcn/ui kit](https://shadcndesign.com) by [Matt Wierzbicki](https://x.com/matsugfx) - A premium, always up-to-date UI kit for Figma - shadcn/ui compatible and optimized for smooth design-to-dev handoff.
2020
- [Shadcraft UI Kit](https://shadcraft.com) - The most advanced shadcn-compatible kit with instant theming via [tweakcn](https://tweakcn.com), a pro library of components and templates, and complete coverage of shadcn components and blocks.
2121
- [shadcn/studio UI Kit](https://shadcnstudio.com/figma) - Accelerate design & development with a shadcn/ui compatible Figma kit with updated components, 550+ blocks, 10+ templates, 20+ themes, and an AI tool that converts designs into shadcn/ui code.
2222
- [Shadcnblocks.com](https://www.shadcnblocks.com) - A Premium Shadcn Figma UI Kit with components, 500+ pro blocks, shadcn theme variables, light/dark mode and Figma MCP ready.

apps/v4/content/docs/(root)/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ shadcn/ui hands you the actual component code. You have full control to customiz
2727

2828
_In a typical library, if you need to change a button’s behavior, you have to override styles or wrap the component. With shadcn/ui, you simply edit the button code directly._
2929

30-
<Accordion collapsible>
30+
<Accordion type="single" collapsible>
3131
<AccordionItem value="faq-1" className="border-none">
3232
<AccordionTrigger>
3333
How do I pull upstream updates in an Open Code approach?

apps/v4/content/docs/(root)/new.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Your project is ready!
33
description: You've created a new project with shadcn/ui.
44
---
55

6-
Here's a few things you can do to get started building with shadcn/ui.
6+
Here are a few things you can do to get started building with shadcn/ui.
77

88
## Add Components
99

apps/v4/content/docs/(root)/react-19.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The process for adding components is the same as above. Select a flag to resolve
121121

122122
## Upgrade Status
123123

124-
To make it easy for you track the progress of the upgrade, I've created a table below with React 19 support status for the shadcn/ui dependencies.
124+
To make it easy for you to track the progress of the upgrade, here is a table with the React 19 support status for the shadcn/ui dependencies.
125125

126126
- ✅ - Works with React 19 using npm, pnpm, and bun.
127127
- 🚧 - Works with React 19 using pnpm and bun. Requires flag for npm. PR is in progress.

apps/v4/content/docs/(root)/tailwind-v4.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Here's how you do it:
193193
}
194194
```
195195

196-
This change makes it much simpler to access your theme variables in both utility classes and outside of CSS for eg. using color values in JavaScript.
196+
This change makes it much simpler to access your theme variables in both utility classes and outside of CSS, e.g. using color values in JavaScript.
197197

198198
### 3. Update colors for charts
199199

@@ -281,7 +281,7 @@ function AccordionItem({
281281

282282
We've deprecated `tailwindcss-animate` in favor of `tw-animate-css`.
283283

284-
New project will have `tw-animate-css` installed by default.
284+
New projects will have `tw-animate-css` installed by default.
285285

286286
For existing projects, follow the steps below to migrate.
287287

apps/v4/content/docs/changelog/2024-03-blocks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ date: 2024-03-22
66

77
One of the most requested features since launch has been layouts: admin dashboards with sidebar, marketing page sections, cards and more.
88

9-
**Today, we're launching [**Blocks**](/blocks)**.
9+
**Today, we're launching [Blocks](/blocks).**
1010

1111
<a href="/blocks">
1212
<Image

apps/v4/content/docs/changelog/2024-03-breadcrumb-otp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ A fully featured input OTP component. It has support for numeric and alphanumeri
2222

2323
[Read the docs](/docs/components/input-otp)
2424

25-
If you have a [v0](https://v0.dev), the new components are available for generation.
25+
If you have a [v0](https://v0.dev) account, the new components are available for generation.

apps/v4/content/docs/changelog/2024-08-npx-shadcn-init.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ The new CLI is now available. It's a complete rewrite with a lot of new features
88

99
This is a major step towards distributing code that you and your LLMs can access and use.
1010

11-
1. First up, the cli now has support for all major React framework out of the box. Next.js, Remix, Vite and Laravel. And when you init into a new app, we update your existing Tailwind files instead of overriding.
12-
2. A component now ship its own dependencies. Take the accordion for example, it can define its Tailwind keyframes. When you add it to your project, we'll update your tailwind.config.ts file accordingly.
11+
1. First up, the CLI now has support for all major React frameworks out of the box. Next.js, Remix, Vite and Laravel. And when you init into a new app, we update your existing Tailwind files instead of overriding.
12+
2. A component now ships its own dependencies. Take the accordion for example, it can define its Tailwind keyframes. When you add it to your project, we'll update your tailwind.config.ts file accordingly.
1313
3. You can also install remote components using url. `npx shadcn add https://acme.com/registry/navbar.json`.
14-
4. We have also improve the init command. It does framework detection and can even init a brand new Next.js app in one command. `npx shadcn init`.
14+
4. We have also improved the init command. It does framework detection and can even init a brand new Next.js app in one command. `npx shadcn init`.
1515
5. We have created a new schema that you can use to ship your own component registry. And since it has support for urls, you can even use it to distribute private components.
1616
6. And a few more updates like better error handling and monorepo support.
1717

@@ -42,4 +42,4 @@ To update an existing project to use the new CLI, update your `components.json`
4242
}
4343
```
4444

45-
If you're using a different import alias prefix eg `~`, replace `@` with your prefix.
45+
If you're using a different import alias prefix, e.g. `~`, replace `@` with your prefix.

0 commit comments

Comments
 (0)