Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tailwind variants upgrade #4386

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .changeset/stupid-pants-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
"@nextui-org/use-intersection-observer": patch
"@nextui-org/use-data-scroll-overflow": patch
"@nextui-org/use-aria-accordion-item": patch
"@nextui-org/use-aria-modal-overlay": patch
"@nextui-org/use-safe-layout-effect": patch
"@nextui-org/use-aria-multiselect": patch
"@nextui-org/use-infinite-scroll": patch
"@nextui-org/use-scroll-position": patch
"@nextui-org/react-rsc-utils": patch
"@nextui-org/scroll-shadow": patch
"@nextui-org/use-aria-accordion": patch
"@nextui-org/autocomplete": patch
"@nextui-org/use-update-effect": patch
"@nextui-org/breadcrumbs": patch
"@nextui-org/date-picker": patch
"@nextui-org/use-callback-ref": patch
"@nextui-org/framer-utils": patch
"@nextui-org/shared-icons": patch
"@nextui-org/date-input": patch
"@nextui-org/pagination": patch
"@nextui-org/use-aria-button": patch
"@nextui-org/react-utils": patch
"@nextui-org/accordion": patch
"@nextui-org/input-otp": patch
"@nextui-org/use-disclosure": patch
"@nextui-org/use-is-mounted": patch
"@nextui-org/use-pagination": patch
"@nextui-org/use-real-shape": patch
"@nextui-org/aria-utils": patch
"@nextui-org/test-utils": patch
"@nextui-org/calendar": patch
"@nextui-org/checkbox": patch
"@nextui-org/dropdown": patch
"@nextui-org/progress": patch
"@nextui-org/skeleton": patch
"@nextui-org/use-aria-link": patch
"@nextui-org/use-clipboard": patch
"@nextui-org/use-draggable": patch
"@nextui-org/use-is-mobile": patch
"@nextui-org/use-ref-state": patch
"@nextui-org/divider": patch
"@nextui-org/listbox": patch
"@nextui-org/popover": patch
"@nextui-org/snippet": patch
"@nextui-org/spinner": patch
"@nextui-org/tooltip": patch
"@nextui-org/avatar": patch
"@nextui-org/button": patch
"@nextui-org/drawer": patch
"@nextui-org/navbar": patch
"@nextui-org/ripple": patch
"@nextui-org/select": patch
"@nextui-org/slider": patch
"@nextui-org/spacer": patch
"@nextui-org/switch": patch
"@nextui-org/use-measure": patch
"@nextui-org/alert": patch
"@nextui-org/badge": patch
"@nextui-org/image": patch
"@nextui-org/input": patch
"@nextui-org/modal": patch
"@nextui-org/radio": patch
"@nextui-org/table": patch
"@nextui-org/use-resize": patch
"@nextui-org/card": patch
"@nextui-org/chip": patch
"@nextui-org/code": patch
"@nextui-org/form": patch
"@nextui-org/link": patch
"@nextui-org/menu": patch
"@nextui-org/tabs": patch
"@nextui-org/user": patch
"@nextui-org/system-rsc": patch
"@nextui-org/use-image": patch
"@nextui-org/use-theme": patch
"@nextui-org/kbd": patch
"@nextui-org/use-ssr": patch
"@nextui-org/system": patch
"@nextui-org/react": patch
"@nextui-org/theme": patch
---

Tailwind variants upgraded to the latest version, classnames adjusted, tests fixed
12 changes: 6 additions & 6 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"posthog-js": "1.197.0",
"prism-react-renderer": "^1.2.1",
"querystring": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.0",
"react-dom": "18.3.0",
"react-hook-form": "^7.51.3",
"react-icons": "^4.10.1",
"react-live": "^4.1.8",
Expand All @@ -94,7 +94,7 @@
"sharp": "^0.32.1",
"shelljs": "^0.8.4",
"swr": "2.2.5",
"tailwind-variants": "^0.1.20",
"tailwind-variants": "^0.3.0",
"unified": "^11.0.5",
"unist-util-visit": "5.0.0",
"usehooks-ts": "3.1.0",
Expand Down Expand Up @@ -123,8 +123,8 @@
"algoliasearch": "^4.10.3",
"autoprefixer": "10.4.20",
"dotenv": "^16.0.1",
"esbuild-plugin-raw": "0.1.8",
"eslint-config-next": "15.0.3",
"esbuild-plugin-raw": "0.1.8",
"markdown-toc": "^1.2.0",
"mdx-bundler": "10.0.3",
"next-sitemap": "4.2.3",
Expand All @@ -138,8 +138,8 @@
},
"pnpm": {
"overrides": {
"react": "18.2.0",
"react-dom": "18.2.0"
"react": "18.3.0",
"react-dom": "18.3.0"
}
}
}
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
"@babel/preset-env": "^7.14.5",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@changesets/cli": "2.27.10",
"@changesets/changelog-github": "0.5.0",
"@changesets/get-release-plan": "4.0.5",
"@changesets/cli": "2.27.10",
"@changesets/get-github-info": "0.6.0",
"@changesets/get-release-plan": "4.0.5",
"@changesets/types": "6.0.0",
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
Expand Down Expand Up @@ -127,23 +127,22 @@
"prettier": "^2.2.1",
"prettier-eslint": "^12.0.0",
"prettier-eslint-cli": "^5.0.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "^18.3.0",
"rimraf": "^3.0.2",
"shelljs": "^0.8.4",
"tsup": "6.4.0",
"tsx": "^3.8.2",
"tsup": "8.3.5",
"tsx": "^4.19.2",
"turbo": "1.6.3",
"typescript": "^4.9.5",
"typescript": "^5.5.0",
"webpack": "^5.53.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^3.3.11",
"webpack-merge": "^5.8.0"
},
"pnpm": {
"overrides": {
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.0",
"react-dom": "18.3.0",
"@changesets/get-github-info": "0.6.0"
}
},
Expand Down
11 changes: 6 additions & 5 deletions packages/components/accordion/__tests__/accordion.test.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import "@testing-library/jest-dom";
import * as React from "react";
import {act, render} from "@testing-library/react";
import {focus} from "@nextui-org/test-utils";
import {focus, shouldIgnoreReactWarning, spy} from "@nextui-org/test-utils";
import userEvent, {UserEvent} from "@testing-library/user-event";
import {Input} from "@nextui-org/input";

import {Accordion, AccordionItem} from "../src";

// e.g. console.error Warning: Function components cannot be given refs.
// Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
const spy = jest.spyOn(console, "error").mockImplementation(() => {});

describe("Accordion", () => {
let user: UserEvent;

Expand All @@ -30,6 +27,10 @@ describe("Accordion", () => {

expect(() => wrapper.unmount()).not.toThrow();

if (shouldIgnoreReactWarning(spy)) {
return;
}

expect(spy).toHaveBeenCalledTimes(0);
});

Expand Down
4 changes: 2 additions & 2 deletions packages/components/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
"@nextui-org/test-utils": "workspace:*",
"framer-motion": "11.9.0",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/alert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"@nextui-org/system": "workspace:*",
"@nextui-org/theme": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
Comment on lines +58 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

React 18.3.0 is not a valid or released version

The npm registry shows that React 18.3.0 does not exist as a released version. The latest stable version is 19.0.0, with experimental and canary versions beyond that. This version specification across multiple package.json files needs to be corrected to use a valid React version.

  • The version "18.3.0" appears in numerous package.json files across the codebase, indicating a systematic issue
  • Latest stable version available is 19.0.0
  • Consider using the latest stable 18.x.x version (18.2.0) if the codebase needs to stay on React 18
🔗 Analysis chain

Verify React 18.3.0 stability and compatibility

The update to React 18.3.0 aligns with the PR objectives. However, let's verify the stability of this version.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check React 18.3.0 release status and compatibility

# Check if this version exists in npm registry
echo "Checking React 18.3.0 in npm registry..."
curl -s https://registry.npmjs.org/react | jq '."dist-tags"'

# Look for any React version references in the codebase
echo "Checking React version references in the codebase..."
rg -g '*.{json,tsx,ts}' '"react": ".*18\.3\.0"'

Length of output: 5794

},
"clean-package": "../../../clean-package.config.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "@testing-library/jest-dom";
import * as React from "react";
import {within, render, renderHook, act} from "@testing-library/react";
import userEvent, {UserEvent} from "@testing-library/user-event";
import {spy, shouldIgnoreReactWarning} from "@nextui-org/test-utils";
import {useForm} from "react-hook-form";
import {Form} from "@nextui-org/form";

Expand Down Expand Up @@ -88,6 +89,11 @@ describe("Autocomplete", () => {
it("should render correctly", () => {
const wrapper = render(<AutocompleteExample />);

if (shouldIgnoreReactWarning(spy)) {
return;
}

expect(spy).toHaveBeenCalledTimes(0);
expect(() => wrapper.unmount()).not.toThrow();
});

Expand Down
5 changes: 3 additions & 2 deletions packages/components/autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@
"@nextui-org/avatar": "workspace:*",
"@nextui-org/chip": "workspace:*",
"@nextui-org/stories-utils": "workspace:*",
"@nextui-org/test-utils": "workspace:*",
"@nextui-org/system": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/use-infinite-scroll": "workspace:*",
"@react-stately/data": "3.12.0",
"clean-package": "2.2.0",
"framer-motion": "11.9.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "18.3.0",
"react-dom": "18.3.0",
"react-hook-form": "^7.51.3"
},
"clean-package": "../../../clean-package.config.json"
Expand Down
4 changes: 2 additions & 2 deletions packages/components/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/test-utils": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/badge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/switch": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
Comment on lines +53 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

React version inconsistency detected across packages

Some packages are using exact version 18.3.0 while others are using caret range ^18.3.0. This inconsistency should be addressed to maintain uniform versioning across the monorepo.

Affected packages with caret range (^18.3.0):

  • @nextui-org/react-utils
  • @nextui-org/shared-icons
  • @nextui-org/system-rsc
  • @nextui-org/react-rsc-utils
  • @nextui-org/use-ssr
  • And many other utility packages
🔗 Analysis chain

Verify React version consistency across packages

The upgrade to React 18.3.0 aligns with the PR objectives. Let's verify this version is consistent across all packages.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check React version consistency across all package.json files
fd package.json packages/ -x jq -r '. | select(.devDependencies.react != null) | [.name, .devDependencies.react] | @tsv'

Length of output: 2462

},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/breadcrumbs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"@nextui-org/tooltip": "workspace:*",
"@nextui-org/button": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@nextui-org/shared-icons": "workspace:*",
"framer-motion": "11.9.0",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
Comment on lines +62 to +63
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Add @nextui-org/test-utils as a devDependency

The verification confirms that most components, including pagination and radio, have @nextui-org/test-utils as a devDependency. For consistency with the rest of the codebase, this package should be added to the button component's devDependencies.

  • Found 23 other packages using @nextui-org/test-utils, indicating it's a standard testing utility across the component library
  • Notable components using test-utils: pagination, radio, modal, dropdown, and other interactive components similar to button
🔗 Analysis chain

Consider adding test utilities

Other components like pagination and radio have added @nextui-org/test-utils. Consider adding it here for consistency.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check which components have test utils
fd -e package.json -x jq -r '. | select(.devDependencies["@nextui-org/test-utils"] != null) | .name'

Length of output: 102


Script:

#!/bin/bash
# Let's check the devDependencies of pagination and radio packages first
echo "=== Pagination package.json ==="
fd "package.json" --full-path "*pagination*" -x cat {}

echo -e "\n=== Radio package.json ==="
fd "package.json" --full-path "*radio*" -x cat {}

echo -e "\n=== All packages with test-utils ==="
rg -l "@nextui-org/test-utils" -g "package.json"

Length of output: 1519

},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"@nextui-org/test-utils": "workspace:*",
"framer-motion": "11.9.0",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"@nextui-org/image": "workspace:*",
"framer-motion": "11.9.0",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"@nextui-org/theme": "workspace:*",
"@nextui-org/user": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "18.3.0",
"react-dom": "18.3.0",
"react-hook-form": "^7.51.3"
},
"clean-package": "../../../clean-package.config.json"
Expand Down
4 changes: 2 additions & 2 deletions packages/components/chip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"@nextui-org/system": "workspace:*",
"@nextui-org/avatar": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
7 changes: 7 additions & 0 deletions packages/components/code/__tests__/code.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from "react";
import {render} from "@testing-library/react";
import {spy, shouldIgnoreReactWarning} from "@nextui-org/test-utils";

import {Code} from "../src";

Expand All @@ -8,6 +9,12 @@ describe("Code", () => {
const wrapper = render(<Code />);

expect(() => wrapper.unmount()).not.toThrow();

if (shouldIgnoreReactWarning(spy)) {
return;
}

expect(spy).toHaveBeenCalledTimes(0);
});

it("ref should be forwarded", () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/components/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
"@nextui-org/test-utils": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
4 changes: 2 additions & 2 deletions packages/components/date-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/test-utils": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"clean-package": "../../../clean-package.config.json"
}
Loading
Loading