Skip to content

[Snyk] Upgrade @nuxt/ui from 2.22.0 to 3.1.0 #131

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nerdy-tech-com-gitub
Copy link
Owner

@nerdy-tech-com-gitub nerdy-tech-com-gitub commented May 17, 2025

snyk-top-banner

Snyk has created this PR to upgrade @nuxt/ui from 2.22.0 to 3.1.0.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


⚠️ Warning: This PR contains major version upgrade(s), and may be a breaking change.

  • The recommended version is 22 versions ahead of your current version.

  • The recommended version was released 23 days ago.

Release notes
Package name: @nuxt/ui
  • 3.1.0 - 2025-04-24

    ✨ Highlights

    🎨 Improved Utility Classes

    We've enhanced the utility class system to make it more intuitive and easier to use. While CSS variables provided flexibility, writing classes like text-(--ui-text-muted) proved cumbersome. We've introduced three major improvements:

    • Default Color Shades (#3916): New utility classes for default color shades that automatically map to our design system variables. These shades automatically adapt to your color scheme and can be configured for both light and dark modes: https://ui.nuxt.com/getting-started/theme#colors
    - <div class="text-(--ui-primary)">
    + <div class="text-primary">

- <div class="bg-(--ui-error)">
+ <div class="bg-error">

  • Neutral Color Utilities (#3629): New utility classes for text, background, border, ring, divide and outline colors that map to our design system variables. These utilities work with opacity modifiers and automatically adapt to your color mode: https://ui.nuxt.com/getting-started/theme#neutral
- <div class="text-(--ui-text-muted)">
+ <div class="text-muted">

- <div class="border-(--ui-border)">
+ <div class="border-default">

- <div class="bg-(--ui-bg-elevated)/50">
+ <div class="bg-elevated/50">

- <div class="rounded-(--ui-radius)">
+ <div class="rounded-sm">

- <div class="rounded-[calc(var(--ui-radius)*1.5)]">
+ <div class="rounded-md">

- <div class="rounded-[calc(var(--ui-radius)*2)]">
+ <div class="rounded-lg">

These changes are fully backward compatible - existing CSS variable-based classes will continue to work while providing a more ergonomic alternative for new code.

🧩 New Components and Features

script setup lang="ts">
import type { CheckboxGroupItem, CheckboxGroupValue } from '@ nuxt/ui'

const items = ref<CheckboxGroupItem[]>(['System', 'Light', 'Dark'])
const value = ref<CheckboxGroupValue[]>(['System'])
</script>

<template>
<UCheckboxGroup v-model="value" :items="items" />
</template>

script setup lang="ts">
import type { RadioGroupItem, RadioGroupValue } from '@ nuxt/ui'

const items = ref<RadioGroupItem[]>(['System', 'Light', 'Dark'])
const value = ref<RadioGroupValue>('System')
</script>

<template>
<URadioGroup v-model="value" variant="table" :items="items" />
</template>

🌉 Inertia.js Integration

The Vue version now includes built-in support for Inertia.js. Enable it with the inertia: true option in your vite.config.ts:

import { defineConfig } from 'vite'
import vue from '@ vitejs/plugin-vue'
import ui from '@ nuxt/ui/vite'

export default defineConfig({
plugins: [
vue(),
ui({
inertia: true
})
]
})

This automatically replaces RouterLink with InertiaLink in all components, providing seamless integration with your Inertia.js applications: https://ui.nuxt.com/getting-started/installation/vue#inertia

⚡ Module Builder Update

The module has been updated to use nuxt/module-builder@1.0.0, bringing improved build performance and better TypeScript support.

Following this change, we've refactored how component types are handled which brings full HMR support with app.config.ts changes, this was only working when reloading the page previously.

🚨 Breaking Changes

  • OverlayProvider: return an overlay instance from .open() (#3829) (f3098df)

This PR changes .open() to return an overlay instance with a result promise property instead of returning the promise directly, providing more flexibility:

- const result = await modal.open({ count: count.value })
+ const instance = modal.open({ count: count.value })
+ const result = await instance.result
</script>

🚀 Features

  • App: add global portal prop (#3688) (29fa462)
  • Carousel: add select event (#3678) (22edfd7)
  • CheckboxGroup: new component (#3862) (9c3d53a)
  • components: add new content-top and content-bottom slots (#3886) (1a46394)
  • Form: add attach prop to opt-out of nested form attachement (#3939) (1a0d7a3)
  • Form: export loading state (#3861) (fdee252)
  • InputMenu/SelectMenu: handle resetSearchTermOnSelect (cea881a), closes #3782
  • InputNumber: add support for stepSnapping & disableWheelChange props (#3731) (f5e6284)
  • Modal/Popover/Slideover: add close:prevent event (#3958) (f486423)
  • module: define default color shades (#3916) (7ac7aa9)
  • module: define neutral utilities (#3629) (d49e0da)
  • module: dynamic rounded-* utilities (#3906) (f9737c8)
  • OverlayProvider: return an overlay instance from .open() (#3829) (f3098df)
  • PinInput: add autofocus / autofocus-delay props (0456670), closes #3717
  • RadioGroup: add card and table variants (#3178) (4d138ad)
  • Select: handle onSelect field in items (8640831)
  • Table: conditionally apply classes to tr and td (#3866) (80dfa88)
  • Tabs: add list-leading and list-trailing slots (#3837) (3447a06)
  • Textarea: add autoresize-delay prop (06414d3), closes #3730
  • Textarea: add icon, loading, etc. props to match Input (cb193f1)
  • Textarea: add resize-none class with autoresize prop (ffafd81)
  • unplugin: routing support for inertia (#3845) (d059efc)

🐛 Bug Fixes

  • Accordion: use div instead of h3 for header tag (75e4792), closes #3963
  • Alert/Toast: display actions when using slots (5086363), closes #3950
  • Carousel: move arrows inside container on mobile (d339dcb), closes #3813
  • CommandPalette: consistent alignement with other components (d25265c)
  • CommandPalette: increase input font size to avoid zoom (d227a10)
  • CommandPalette: prevent hover background on disabled items (ba534f1)
  • components: refactor types after @ nuxt/module-builder upgrade (#3855) (39c861a)
  • components: respect transform-origin in popper content (#3919) (01d8dc7)
  • ContextMenu/DropdownMenu: handle RTL mode (#3744) (1ae5cc0)
  • ContextMenuContent/DropdownMenuContent: remove unwanted any (#3741) (97274f1)
  • Form: input and output type inference (#3938) (f429498)
  • Form: loses focus on submit (#3796) (8e78eb1)
  • InputMenu/SelectMenu: correctly call onSelect events (#3735) (f25fed5)
  • InputMenu/SelectMenu: prevent disabled items to be selected (8435a0f), closes #3474
  • InputMenu/SelectMenu: remove valueKey string case (9ca213b), closes #3949 #3331
  • InputMenu/SelectMenu: support arbitrary value (#3779) (52a97e2)
  • InputMenu: emit change on multiple item removal (9d2fed1), closes #3756
  • Link: proxy download property (#3879) (47cdc2e)
  • NavigationMenu: add sm:w-auto content slot (abe0859), closes #3788
  • Skeleton: improve accessibility (#3613) (3484832)
  • Stepper: ui prop override on icon and content slots (1d45980), closes #3785
  • Table: improve data reactivity (#3967) (6e27304)
  • Table: pass header colspan to th (#3926) (122e8ac)
  • Tree: simplify reusable template types (#3836) (3deed4c)
  • types: allow color identifiers with dashes (#3896) (e5a1e26)
  • types: handle ClassValue in ui prop (eea1415), closes #3860
  • types: improve dynamic slots (#3857) (8dd9d08)
  • usePortal: adjust portal target resolution logic (#3954) (db11db6)
  • vite: vitest skipping nuxt imports transformations (#3925) (c31bffa)

🌐 Locales

👋 New Contributors

Full Changelog: v3.0.2...v3.1.0

  • 3.0.2 - 2025-03-28

    🚀 Features

    • Calendar: allow year and month buttons styling (#3672) (4a2b77d)
    • Table: add empty prop (afff54f)

    🐛 Bug Fixes

    • Avatar: proxy $attrs to default slot (#3712) (88f349d)
    • Button: use focus:outline-none instead of focus:outline-hidden (c231fe5), closes #3658
    • CommandPalette: use group.id as key (bc61d29)
    • components: improve generic types (#3331) (b998354)
    • Container: add w-full class (df00149)
    • defineShortcuts: remove @ __NO_SIDE_EFFECTS__ (82e2665)
    • Drawer: remove fadeFromIndex prop proxy (f7604e5)
    • Form: clear dirty state after submit (#3692) (3dd88ba)
    • FormField: add help to aria-describedby attribute (#3691) (20c3392)
    • InputMenu/SelectMenu: empty search results (94b6e52)
    • InputMenu: reset searchTerm on update:open (3074632), closes #3620
    • Link: handle aria-current like NuxtLink / RouterLink (c531d02)
    • Link: prevent active="true" binding on html (d73768b)
    • Link: properly pick all aria-* & data-* attrs (ade16b7)
    • Link: proxy onClick (370054b), closes #3631
    • NavigationMenu: add z-index on viewport (0095d89), closes #3654
    • Switch: prevent transition on focus outline (68787b2)
    • Table: wrong condition on caption slot (4ebb94c)
    • Tabs: remove focus:outline-hidden class (1769d5e)
    • types: add missing export for ButtonGroup (#3709) (e7e6745)
    • useOverlay: refine open method type to infer close emit return type (#3716) (bd99c2d)
    • vue: mock nuxtApp.hooks & useRuntimeHook (23bfeb9)

    🌐 Locales

    👋 New Contributors

    Full Changelog: v3.0.1...v3.0.2

  • 3.0.1 - 2025-03-21

    ✨ Highlights

    • module: handle tailwindcss import without theme(static) (#3630) (ecff9ab)

    You no longer need to use theme(static) when importing tailwindcss! 🎉

    - @ import "tailwindcss" theme(static);
    + @ import "tailwindcss";

    However, you might still need this when using Tailwind CSS variables in your code explicitly like this for example:

    <span
      :class="`bg-(--color-light) dark:bg-(--color-dark)`"
      :style="{
        '--color-light': `var(--color-${chip}-500)`,
        '--color-dark': `var(--color-${chip}-400)`
      }"
    />

    🚨 Breaking Changes

    • Form: drop explicit support for zod and valibot (#3617) (9a4bb34)

    We now rely on standard-schema for Form validation with valibot and zod. Make sure to upgrade to valibot@1.0.0 / zod@3.24.0 if you use them in your app.

    We've updated to vaul-vue@0.4.0 which powers the Drawer component. There's no longer a handle slot, the theme handle slot has changed a bit with some important values but you have access to a handle-only prop now: https://ui.nuxt.com/components/drawer#handle-only

    🚀 Features

    • components: handle events in content prop (5dec0e1)

    🐛 Bug Fixes

    • Calendar: grey out days outside of displayed month (#3639) (a516866)
    • ContextMenu/DropdownMenu: remove any from proxySlots (#3623) (764c41a)
    • Modal/Slideover/Toast: prevent unnecessary close instantiation (f4c417d)
    • module: handle tailwindcss import without theme(static) (#3630) (ecff9ab)
    • module: mark functions used in exports as pure (#3604) (57efc78)
    • RadioGroup: handle disabled on items (fe0bd83), closes nuxt/ui-pro#911
    • Table: allow links to be opened when @ select is used (#3580) (e80cc15)
    • types: add missing export for Icon (#3568) (5e62493)
    • unplugin: include @ compodium/examples in auto-imports paths (#3585) (cc504b8)
    • useLocale: unique symbol to use in @ nuxt/ui-pro (#3603) (dec2730)
    • vue: missing unhead context (#3589) (0897e9e)

    🌐 Locales

    👋 New Contribut...

    Summary by Sourcery

    Chores:

    • Bump @nuxt/ui from ^2.x to ^3.1.0 in package.json
  • Snyk has created this PR to upgrade @nuxt/ui from 2.22.0 to 3.1.0.
    
    See this package in npm:
    @nuxt/ui
    
    See this project in Snyk:
    https://app.snyk.io/org/nerds-github/project/8b4160ff-3510-4d06-a27b-7930a5e75719?utm_source=github&utm_medium=referral&page=upgrade-pr
    Copy link

    sourcery-ai bot commented May 17, 2025

    Reviewer's Guide

    This PR upgrades the @nuxt/ui dependency from v2.x to v3.1.0 by updating the version in package.json, ensuring your project uses the latest major release with its accompanying security and feature improvements.

    Class Diagram: New UCheckboxGroup and useOverlay API in @nuxt/ui v3.1.0

    classDiagram
        class UCheckboxGroup {
            +items: CheckboxGroupItem[]
            +modelValue: CheckboxGroupValue[]
            note "New component for managing groups of checkboxes."
        }
        class CheckboxGroupItem {
            <<DataType>>
            label: string
            value: any
            note "Type for items in UCheckboxGroup"
        }
        class CheckboxGroupValue {
            <<DataType>>
            note "Type for the value of UCheckboxGroup (array of selected values)"
        }
        UCheckboxGroup "1" -- "*" CheckboxGroupItem : contains
        UCheckboxGroup -- CheckboxGroupValue : uses value of
    
        class composable_useOverlay {
            <<Composable>>
            +useOverlay(): OverlayControls
        }
        class OverlayControls {
            +open(options: object): OverlayInstance
            note "BREAKING: .open() now returns an OverlayInstance instead of a direct Promise."
        }
        class OverlayInstance {
            +result: Promise~any~
            note "Instance returned by OverlayControls.open(), contains a 'result' promise."
        }
        composable_useOverlay ..> OverlayControls : returns
        OverlayControls ..> OverlayInstance : creates via open()
    
    Loading

    File-Level Changes

    Change Details Files
    Bump @nuxt/ui dependency to v3.1.0
    • Updated the version specifier for @nuxt/ui in package.json from ^2.17.0 to ^3.1.0
    • Ran dependency install to regenerate lock file
    lyx-ui/package.json

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants