mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-09-14 20:00:35 +08:00
perf(v4): use cn for class merging (#11730)
This commit is contained in:
@@ -1,9 +1,4 @@
|
|||||||
import { clsx, type ClassValue } from "clsx"
|
export { cn } from "cn"
|
||||||
import { twMerge } from "tailwind-merge"
|
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
|
||||||
return twMerge(clsx(inputs))
|
|
||||||
}
|
|
||||||
|
|
||||||
export function absoluteUrl(path: string) {
|
export function absoluteUrl(path: string) {
|
||||||
return `${process.env.NEXT_PUBLIC_APP_URL}${path}`
|
return `${process.env.NEXT_PUBLIC_APP_URL}${path}`
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "^1.1.1",
|
||||||
|
"cn": "^0.2.2",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"dedent": "^1.6.0",
|
"dedent": "^1.6.0",
|
||||||
"embla-carousel-autoplay": "8.5.2",
|
"embla-carousel-autoplay": "8.5.2",
|
||||||
|
|||||||
Generated
+10
@@ -228,6 +228,9 @@ importers:
|
|||||||
cmdk:
|
cmdk:
|
||||||
specifier: ^1.1.1
|
specifier: ^1.1.1
|
||||||
version: 1.1.1(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
version: 1.1.1(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||||
|
cn:
|
||||||
|
specifier: ^0.2.2
|
||||||
|
version: 0.2.2
|
||||||
date-fns:
|
date-fns:
|
||||||
specifier: ^4.1.0
|
specifier: ^4.1.0
|
||||||
version: 4.1.0
|
version: 4.1.0
|
||||||
@@ -5145,6 +5148,11 @@ packages:
|
|||||||
react: ^18 || ^19 || ^19.0.0-rc
|
react: ^18 || ^19 || ^19.0.0-rc
|
||||||
react-dom: ^18 || ^19 || ^19.0.0-rc
|
react-dom: ^18 || ^19 || ^19.0.0-rc
|
||||||
|
|
||||||
|
cn@0.2.2:
|
||||||
|
resolution: {integrity: sha512-1TjHp2yGdFzu5Td2bc2bnceh/WKPEvLYVtcg6czWSifHBy5oN/bK5/I0eFNIr839Hlh5cxrV93Yh2ByrpO5Stw==}
|
||||||
|
engines: {node: '>=20'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
code-block-writer@13.0.3:
|
code-block-writer@13.0.3:
|
||||||
resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==}
|
resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==}
|
||||||
|
|
||||||
@@ -14249,6 +14257,8 @@ snapshots:
|
|||||||
- '@types/react'
|
- '@types/react'
|
||||||
- '@types/react-dom'
|
- '@types/react-dom'
|
||||||
|
|
||||||
|
cn@0.2.2: {}
|
||||||
|
|
||||||
code-block-writer@13.0.3: {}
|
code-block-writer@13.0.3: {}
|
||||||
|
|
||||||
collapse-white-space@2.1.0: {}
|
collapse-white-space@2.1.0: {}
|
||||||
|
|||||||
@@ -7,9 +7,12 @@ packages:
|
|||||||
- "!packages/tests/temp/**"
|
- "!packages/tests/temp/**"
|
||||||
|
|
||||||
minimumReleaseAge: 2880
|
minimumReleaseAge: 2880
|
||||||
|
# TODO: remove once cn@0.2.2 (published 2026-09-01) is older than the 48h
|
||||||
|
# minimumReleaseAge window.
|
||||||
# TODO: remove once @tanstack/react-table@9.0.0 (published 2026-08-04) is older
|
# TODO: remove once @tanstack/react-table@9.0.0 (published 2026-08-04) is older
|
||||||
# than the 48h minimumReleaseAge window.
|
# than the 48h minimumReleaseAge window.
|
||||||
minimumReleaseAgeExclude:
|
minimumReleaseAgeExclude:
|
||||||
|
- "cn"
|
||||||
- "@tanstack/react-table"
|
- "@tanstack/react-table"
|
||||||
- "@tanstack/table-core"
|
- "@tanstack/table-core"
|
||||||
- "@tanstack/react-store"
|
- "@tanstack/react-store"
|
||||||
|
|||||||
Reference in New Issue
Block a user