-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(core): cn utility adjusted and moved to the theme package * chore(root): changeset * fix(storybook): stories that used cn
- Loading branch information
1 parent
f8b917a
commit e3afa47
Showing
19 changed files
with
80 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@nextui-org/system": patch | ||
"@nextui-org/system-rsc": patch | ||
"@nextui-org/theme": patch | ||
--- | ||
|
||
The `cn` utility was moved the `theme` package and updated to support NextUI custom classes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ export type { | |
} from "./types"; | ||
|
||
export { | ||
cn, | ||
forwardRef, | ||
toIterator, | ||
mapPropsVariants, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type {ClassValue} from "clsx"; | ||
|
||
import clsx from "clsx"; | ||
import {extendTailwindMerge} from "tailwind-merge"; | ||
|
||
import {twMergeConfig} from "./tw-merge-config"; | ||
|
||
/** | ||
* We need to extend the tailwind merge to include NextUI's custom classes. | ||
* | ||
* So we can use classes like `text-small` or `text-default-500` and override them. | ||
*/ | ||
const twMerge = extendTailwindMerge(twMergeConfig); | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
export * from "./classes"; | ||
export * from "./types"; | ||
export * from "./variants"; | ||
export { | ||
baseStyles, | ||
ringClasses, | ||
focusVisibleClasses, | ||
dataFocusVisibleClasses, | ||
groupDataFocusVisibleClasses, | ||
translateCenterClasses, | ||
absoluteFullClasses, | ||
collapseAdjacentVariantBorders, | ||
} from "./classes"; | ||
export type {SlotsToClasses} from "./types"; | ||
export {colorVariants} from "./variants"; | ||
export {COMMON_UNITS, twMergeConfig} from "./tw-merge-config"; | ||
export {cn} from "./cn"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type {Config} from "tailwind-merge"; | ||
export const COMMON_UNITS = ["small", "medium", "large"]; | ||
|
||
export const twMergeConfig: Partial<Config> = { | ||
theme: { | ||
opacity: ["disabled"], | ||
spacing: ["divider"], | ||
borderWidth: COMMON_UNITS, | ||
borderRadius: COMMON_UNITS, | ||
}, | ||
classGroups: { | ||
shadow: [{shadow: COMMON_UNITS}], | ||
"font-size": [{text: ["tiny", ...COMMON_UNITS]}], | ||
"bg-image": ["bg-stripe-gradient"], | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.