diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cba84769..5e592168 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -42,6 +42,8 @@ jobs: - name: Build application run: pnpm run docs:build + env: + NODE_OPTIONS: '--max-old-space-size=8192' - name: Deploy to NuxtHub uses: nuxt-hub/action@v1 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 0ecb5bd1..00000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: integration - -on: - workflow_run: - workflows: ["module"] - types: - - completed - -jobs: - nuxt: - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repository: benjamincanac/app-ui3 - - - name: Set short SHA - run: echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install dependencies - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT }} - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - vue: - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repository: benjamincanac/app-ui3-vue - - - name: Set short SHA - run: echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install dependencies - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT }} - - # - name: Typecheck - # run: pnpm run typecheck - - - name: Build - run: pnpm run build \ No newline at end of file diff --git a/.github/workflows/module.yml b/.github/workflows/module.yml index dd6104bc..7df5b68a 100644 --- a/.github/workflows/module.yml +++ b/.github/workflows/module.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: - os: [ubuntu-latest] # macos-latest, windows-latest + os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "windows-latest"]') }} # macos-latest node: [22] env: @@ -50,16 +50,166 @@ jobs: run: pnpm run typecheck - name: Test - run: pnpm run test + run: pnpm run test run - name: Test (vue) - run: pnpm run test:vue + run: pnpm run test:vue run - name: Build run: pnpm run build - - name: Build vue fixture - run: pnpm run test:vue:build + - name: Build playground + run: pnpm run dev:build + + - name: Build playground (vue) + run: pnpm run dev:vue:build - name: Publish + # Only publish preview package on ubuntu during PRs + if: matrix.os == 'ubuntu-latest' run: pnpx pkg-pr-new publish --compact --no-template --pnpm + + starter-nuxt: + needs: build + + runs-on: ${{ matrix.os }} + + permissions: + contents: read + pull-requests: read + + strategy: + matrix: + os: [ubuntu-latest] # macos-latest, windows-latest + node: [22] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: nuxtlabs/nuxt-ui-starter + + - name: Store commit SHA + run: | + echo "COMMIT_SHA=$(echo ${{ github.workflow_sha }} | cut -c1-7)" >> $GITHUB_ENV + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install latest nuxt/ui + run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only + + - name: Install dependencies + run: pnpm install + + - name: Typecheck + run: pnpm run typecheck + + - name: Build + run: pnpm run build + + starter-vue: + needs: build + + runs-on: ${{ matrix.os }} + + permissions: + contents: read + pull-requests: read + + strategy: + matrix: + os: [ubuntu-latest] # macos-latest, windows-latest + node: [22] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: nuxtlabs/nuxt-ui-vue-starter + + - name: Store commit SHA + run: | + echo "COMMIT_SHA=$(echo ${{ github.workflow_sha }} | cut -c1-7)" >> $GITHUB_ENV + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install latest nuxt/ui + run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only + + - name: Install dependencies + run: pnpm install + + - name: Typecheck + run: pnpm run typecheck + + - name: Build + run: pnpm run build + + nuxt-ui-pro: + needs: build + + # Only run this job if not a fork PR (when push event or PR from same repo) + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository + + runs-on: ${{ matrix.os }} + + permissions: + contents: read + pull-requests: read + + strategy: + matrix: + os: [ubuntu-latest] # macos-latest, windows-latest + node: [22] + + env: + NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: nuxt/ui-pro + token: ${{ secrets.NUXT_GITHUB_TOKEN }} + + - name: Store commit SHA + run: | + echo "COMMIT_SHA=$(echo ${{ github.workflow_sha }} | cut -c1-7)" >> $GITHUB_ENV + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install latest nuxt/ui + run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only + + - name: Install dependencies + run: pnpm install + + - name: Prepare + run: pnpm run dev:prepare + + - name: Typecheck + run: pnpm run typecheck + + - name: Build + run: pnpm run build diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 637ec4ee..69563a54 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -10,14 +10,16 @@ jobs: permissions: issues: write - pull-requests: write steps: - uses: actions/stale@v9 with: - exempt-issue-labels: triage,v3 - stale-issue-message: 'This issue is stale because it has been open for 30 days with no activity.' - stale-issue-label: stale - stale-pr-label: stale - days-before-stale: 30 - days-before-close: -1 + days-before-stale: -1 # Issues and PR will never be flagged stale automatically. + stale-issue-label: 'needs reproduction' # Label that flags an issue as stale. + only-labels: 'needs reproduction' # Only process these issues + days-before-issue-close: 7 + ignore-updates: true + remove-stale-when-updated: false + close-issue-message: This issue was closed because it was open for 7 days without a reproduction. + close-issue-label: closed-by-bot + operations-per-run: 300 #default 30 diff --git a/.npmrc b/.npmrc index 1c851729..a6c380f6 100644 --- a/.npmrc +++ b/.npmrc @@ -1,4 +1,3 @@ shamefully-hoist=true auto-install-peers=true ignore-workspace-root-check=true -shell-emulator=true diff --git a/CHANGELOG.md b/CHANGELOG.md index 0368e3aa..36a8c6d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,71 @@ # Changelog +## [3.0.2](https://github.com/nuxt/ui/compare/v3.0.1...v3.0.2) (2025-03-28) + +### Features + +* **Calendar:** allow year and month buttons styling ([#3672](https://github.com/nuxt/ui/issues/3672)) ([4a2b77d](https://github.com/nuxt/ui/commit/4a2b77d86c28806234002340eda39de4dc78cce0)) +* **locale:** add Armenian language ([#3664](https://github.com/nuxt/ui/issues/3664)) ([c76f590](https://github.com/nuxt/ui/commit/c76f5900970e3f5c451192b1207ccea04771e8b3)) +* **Table:** add `empty` prop ([afff54f](https://github.com/nuxt/ui/commit/afff54fecd31497238461e0a44abd8668ed734c3)) + +### Bug Fixes + +* **Avatar:** proxy `$attrs` to default slot ([#3712](https://github.com/nuxt/ui/issues/3712)) ([88f349d](https://github.com/nuxt/ui/commit/88f349d0d74eb1c2ce5066818731759c25a9e83e)) +* **Button:** use `focus:outline-none` instead of `focus:outline-hidden` ([c231fe5](https://github.com/nuxt/ui/commit/c231fe5f26ca7614df46a7ec8a5ce7f4ec8884e7)), closes [#3658](https://github.com/nuxt/ui/issues/3658) +* **CommandPalette:** use `group.id` as key ([bc61d29](https://github.com/nuxt/ui/commit/bc61d29cce531715a6279444845f02a002a22af7)) +* **components:** improve generic types ([#3331](https://github.com/nuxt/ui/issues/3331)) ([b998354](https://github.com/nuxt/ui/commit/b9983549a4b743724ea3ef99cc4a243f5ca41e53)) +* **Container:** add `w-full` class ([df00149](https://github.com/nuxt/ui/commit/df001495980647cab1e67fd16154f1bc778de5e2)) +* **defineLocale/defineShortcuts:** remove `@__NO_SIDE_EFFECTS__` ([82e2665](https://github.com/nuxt/ui/commit/82e26655a40782555299516f32a76046fa0dbd3a)) +* **Drawer:** remove `fadeFromIndex` prop proxy ([f7604e5](https://github.com/nuxt/ui/commit/f7604e565f717001a4d4c2974cf23559a3f01c21)) +* **Form:** clear dirty state after submit ([#3692](https://github.com/nuxt/ui/issues/3692)) ([3dd88ba](https://github.com/nuxt/ui/commit/3dd88bacecb2945efba8cc3cb4fe59fcbc056e9a)) +* **FormField:** add `help` to `aria-describedby` attribute ([#3691](https://github.com/nuxt/ui/issues/3691)) ([20c3392](https://github.com/nuxt/ui/commit/20c33920d005332db3c83f33a8c54c7c227ce0a0)) +* **InputMenu/SelectMenu:** empty search results ([94b6e52](https://github.com/nuxt/ui/commit/94b6e520f5ccf011204e953421fcc5b44b637e51)) +* **InputMenu:** reset `searchTerm` on `update:open` ([3074632](https://github.com/nuxt/ui/commit/3074632523e67fa6a0ad3d9a71e5692c285bdc3a)), closes [#3620](https://github.com/nuxt/ui/issues/3620) +* **Link:** handle `aria-current` like `NuxtLink` / `RouterLink` ([c531d02](https://github.com/nuxt/ui/commit/c531d0248be7863980a1f676643c2dea8301c009)) +* **Link:** prevent `active="true"` binding on html ([d73768b](https://github.com/nuxt/ui/commit/d73768b70453d60dd4186a996c1cf808b0294bf6)) +* **Link:** properly pick all `aria-*` & `data-*` attrs ([ade16b7](https://github.com/nuxt/ui/commit/ade16b76cf535924a8d0f402b4d5d65cb67a55eb)) +* **Link:** proxy `onClick` ([370054b](https://github.com/nuxt/ui/commit/370054b20c0201c9dba84ddfcd1e916594619b93)), closes [#3631](https://github.com/nuxt/ui/issues/3631) +* **NavigationMenu:** add `z-index` on viewport ([0095d89](https://github.com/nuxt/ui/commit/0095d8916bf361c0c89972e2f86b79850510c6a9)), closes [#3654](https://github.com/nuxt/ui/issues/3654) +* **Switch:** prevent transition on focus outline ([68787b2](https://github.com/nuxt/ui/commit/68787b26fdf2bd5f9d9e812e5bfddb19abe45d1d)) +* **Table:** wrong condition on `caption` slot ([4ebb94c](https://github.com/nuxt/ui/commit/4ebb94cd7ef909b3547bce0922f75fe3ff74de4c)) +* **Tabs:** remove `focus:outline-hidden` class ([1769d5e](https://github.com/nuxt/ui/commit/1769d5ed6ea46b1f7eafdc48cb6456512229f98b)) +* **types:** add missing export for ButtonGroup ([#3709](https://github.com/nuxt/ui/issues/3709)) ([e7e6745](https://github.com/nuxt/ui/commit/e7e674559981177ad08be42418746060d7737df9)) +* **useOverlay:** refine `open` method type to infer close emit return type ([#3716](https://github.com/nuxt/ui/issues/3716)) ([bd99c2d](https://github.com/nuxt/ui/commit/bd99c2d850d57baccc51e049c0b578a6fc6ab431)) +* **vue:** mock `nuxtApp.hooks` & `useRuntimeHook` ([23bfeb9](https://github.com/nuxt/ui/commit/23bfeb937004d619187a67fb43e4c76b13d00069)) + +## [3.0.1](https://github.com/nuxt/ui/compare/v3.0.0...v3.0.1) (2025-03-21) + +### ⚠ BREAKING CHANGES + +* **Form:** drop explicit support for `zod` and `valibot` (#3617) + +### Features + +* **components:** handle events in `content` prop ([5dec0e1](https://github.com/nuxt/ui/commit/5dec0e16e28549b8833aaab17a87fada63d6598c)) +* **locale:** add Catalan language ([#3550](https://github.com/nuxt/ui/issues/3550)) ([53cf1b4](https://github.com/nuxt/ui/commit/53cf1b4c14a2a0e076e1e77688852e6bd0a28a74)) +* **locale:** add Central Kurdish language ([#3566](https://github.com/nuxt/ui/issues/3566)) ([b2034cc](https://github.com/nuxt/ui/commit/b2034ccc91eec6a2842c6f83d159e5aa6fd5f2fd)) +* **locale:** add Romanian language ([#3587](https://github.com/nuxt/ui/issues/3587)) ([0229b0f](https://github.com/nuxt/ui/commit/0229b0fd4644a97db7eb3154c3c87a26634dcfbb)) +* **locale:** add Urdu language ([#3611](https://github.com/nuxt/ui/issues/3611)) ([126ba23](https://github.com/nuxt/ui/commit/126ba2326f8153e155e1013db92c6ee417117610)) +* **locale:** add Uzbek language ([#3548](https://github.com/nuxt/ui/issues/3548)) ([302e04b](https://github.com/nuxt/ui/commit/302e04bd77ae8b165046b264c8d23626e92f8fb5)) + +### Bug Fixes + +* **Calendar:** grey out days outside of displayed month ([#3639](https://github.com/nuxt/ui/issues/3639)) ([a516866](https://github.com/nuxt/ui/commit/a5168666b7dff08e714d57f497737e7a670f457c)) +* **ContextMenu/DropdownMenu:** remove `any` from `proxySlots` ([#3623](https://github.com/nuxt/ui/issues/3623)) ([764c41a](https://github.com/nuxt/ui/commit/764c41a0c60dd1c12d39a86af9f5f11b9e6cdc8c)) +* **Modal/Slideover/Toast:** prevent unnecessary close instantiation ([f4c417d](https://github.com/nuxt/ui/commit/f4c417d9ef5409b52084bdf9d8cbccee3139709f)) +* **module:** handle tailwindcss import without `theme(static)` ([#3630](https://github.com/nuxt/ui/issues/3630)) ([ecff9ab](https://github.com/nuxt/ui/commit/ecff9abc720bdda3a279d5bcfb7b477ff885f2e4)) +* **module:** mark functions used in exports as pure ([#3604](https://github.com/nuxt/ui/issues/3604)) ([57efc78](https://github.com/nuxt/ui/commit/57efc78a3b3fa4a54bcd13df47d570a18fba2bc4)) +* **RadioGroup:** handle `disabled` on items ([fe0bd83](https://github.com/nuxt/ui/commit/fe0bd83d11b0dfa53b58d423bc917f8e21d73444)), closes [nuxt/ui-pro#911](https://github.com/nuxt/ui-pro/issues/911) +* **Table:** allow links to be opened when [@select](https://github.com/select) is used ([#3580](https://github.com/nuxt/ui/issues/3580)) ([e80cc15](https://github.com/nuxt/ui/commit/e80cc1592fb244dd7692486a4c1ca5b1c2008112)) +* **types:** add missing export for Icon ([#3568](https://github.com/nuxt/ui/issues/3568)) ([5e62493](https://github.com/nuxt/ui/commit/5e624933216db95cbfd1b8034b2eb0f13846ae55)) +* **unplugin:** include `@compodium/examples` in auto-imports paths ([#3585](https://github.com/nuxt/ui/issues/3585)) ([cc504b8](https://github.com/nuxt/ui/commit/cc504b8a4b69dd76b49659d5c206ef23dcb9e475)) +* **useLocale:** unique symbol to use in `@nuxt/ui-pro` ([#3603](https://github.com/nuxt/ui/issues/3603)) ([dec2730](https://github.com/nuxt/ui/commit/dec2730aaea1327434837cfa022ea04056757cbf)) +* **vue:** missing unhead context ([#3589](https://github.com/nuxt/ui/issues/3589)) ([0897e9e](https://github.com/nuxt/ui/commit/0897e9ef05fbee4f021f317bb7c2d0b7007f1b75)) + +### Code Refactoring + +* **Form:** drop explicit support for `zod` and `valibot` ([#3617](https://github.com/nuxt/ui/issues/3617)) ([9a4bb34](https://github.com/nuxt/ui/commit/9a4bb34d7d14add0a3199103f4b583e8307d1d6d)) + ## [3.0.0](https://github.com/nuxt/ui/compare/v3.0.0-beta.4...v3.0.0) (2025-03-12) ## [3.0.0-beta.4](https://github.com/nuxt/ui/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2025-03-12) diff --git a/README.md b/README.md index 8433e743..7b6d0579 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ export default defineNuxtConfig({ 2. Import Tailwind CSS and Nuxt UI in your CSS: ```css [assets/css/main.css] -@import "tailwindcss" theme(static); +@import "tailwindcss"; @import "@nuxt/ui"; ``` @@ -98,12 +98,23 @@ app.mount('#app') 3. Import Tailwind CSS and Nuxt UI in your CSS: ```css [assets/main.css] -@import "tailwindcss" theme(static); +@import "tailwindcss"; @import "@nuxt/ui"; ``` Learn more in the [installation guide](https://ui.nuxt.com/getting-started/installation/vue). +## Contribution + +Thank you for considering contributing to Nuxt UI. Here are a few ways you can get involved: + +- Reporting Bugs: If you come across any bugs or issues, please check out the reporting bugs guide to learn how to submit a bug report. +- Suggestions: Have any thoughts to enhance Nuxt UI? We'd love to hear them! Check out the [contribution guide](https://ui.nuxt.com/getting-started/contribution) to share your suggestions. + +## Local Development + +Follow the docs to [set up your local development environment](https://ui.nuxt.com/getting-started/contribution#local-development) and contribute. + ## Credits - [nuxt/nuxt](https://github.com/nuxt/nuxt) diff --git a/build.config.ts b/build.config.ts index 6f7143a7..1cacdf24 100644 --- a/build.config.ts +++ b/build.config.ts @@ -7,10 +7,13 @@ export default defineBuildConfig({ './src/vite' ], rollup: { - emitCJS: true - }, - replace: { - 'process.env.DEV': 'false' + replace: { + delimiters: ['', ''], + values: { + // Used in development to import directly from theme + 'const isUiDev = true': 'const isUiDev = false' + } + } }, hooks: { 'mkdist:entry:options'(ctx, entry, options) { diff --git a/cli/package.json b/cli/package.json index 41326640..c60e24e9 100644 --- a/cli/package.json +++ b/cli/package.json @@ -6,7 +6,7 @@ }, "dependencies": { "citty": "^0.1.6", - "consola": "^3.4.0", + "consola": "^3.4.2", "pathe": "^2.0.3", "scule": "^1.3.0" } diff --git a/cli/templates.mjs b/cli/templates.mjs index e89bfcba..4fc11c96 100644 --- a/cli/templates.mjs +++ b/cli/templates.mjs @@ -31,13 +31,10 @@ const component = ({ name, primitive, pro, prose, content }) => { ? `