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

v3 #1289

Open
44 tasks done
benjamincanac opened this issue Jan 29, 2024 — with Volta.net · 263 comments
Open
44 tasks done

v3 #1289

benjamincanac opened this issue Jan 29, 2024 — with Volta.net · 263 comments
Assignees
Labels

Comments

Copy link
Member

benjamincanac commented Jan 29, 2024

The development is ongoing on the default branch of this repository: https://github.com/nuxt/ui.


A lot has changed since @nuxt/ui was made open-source (May 2023), so the plan here is to rewrite every component from scratch alongside their config.

I'll post regular updates on this issue and on https://twitter.com/benjamincanac.

Documentation

https://ui3.nuxt.dev

Roadmap (Nov 20, 2024)

  • Finish the migration to reka-ui@alpha on @nuxt/ui & @nuxt/ui-pro (feat(module)!: migrate to reka-ui #2448)
  • Write the docs for implemented @nuxt/ui-pro components
  • Finish @nuxt/ui-pro components (almost all are done except for Dashboard)
  • Make Nuxt UI Pro v3 work with Vue like Nuxt UI
  • Implement new components in @nuxt/ui like Calendar (feat(Calendar): implement component #2618), DateInput, Tree (feat(Tree): implement component #2757), Stepper (feat(Stepper): new component #2733), etc.
  • Migrate all the Nuxt UI Pro templates (starter, landing, docs, saas and dashboard)
  • Write a complete migration guide
  • Build the Nuxt UI docs marketing pages (landing, pricing, templates, etc.)
  • Migrate all the Nuxt apps (nuxt.com, image.nuxt.com, eslint.nuxt.com, devtools.nuxt.com, fonts.nuxt.com, hub.nuxt.com, nuxt.studio, etc.)
  • Release @nuxt/ui & @nuxt/ui-pro officially once tailwindcss and reka-ui are released
  • Make new @nuxt/ui-pro components & templates like Changelog, Portfolio, etc.

Breaking Changes

The biggest change is the switch to tailwind-variants, this will cause lots of breaking changes if you've used the ui prop or app.config.ts to override the config. I apologize in advance for this but I strongly believe this will be beneficial and will bring consistency across all components.

At the beginning the config was split in many keys for the same div to give more flexibility, but since then we introduced tailwind-merge which now allows us to group those keys together, this is a good opportunity to clean the whole thing.

The config will now have a slots amongst other keys that will specifically target dom nodes. The ui prop will only allow you to target those slots.

These changes alongside the refactor of all components will also improve the types, the app.config.ts and ui props are now perfectly typed, as well as all components props, slots, emits and expose.

Feel free to comment on this if you have any ideas for the next major.

Components

Preview Give feedback
@benjamincanac benjamincanac added the v3 #1289 label Jan 29, 2024 — with Volta.net
@benjamincanac benjamincanac pinned this issue Jan 29, 2024
@benjamincanac benjamincanac added release and removed v3 #1289 labels Jan 29, 2024
@benjamincanac benjamincanac changed the title Major v3.0 release v3.0 release Jan 29, 2024
@benjamincanac benjamincanac changed the title v3.0 release Next v3.0 release Jan 29, 2024
@sandros94
Copy link
Collaborator

I would like to help, if I'm able to. Is there going to be a dedicated branch or will it be done in the dev one?

Copy link
Member Author

Once we start this, there will be indeed a new branch with auto-release so we can try it out and especially keep working on the v2 as it might take some time. I'll create new issues once this gets started with the remaining things to do 😊

@jd-solanki
Copy link

Hi @benjamincanac

I have few design ideas if you are open to this I would like to share it for the future of Nuxt UI 3. Should we discuss this in this issue or it'll be better to discuss design ideas in seperate discussion thread?

Copy link
Member Author

@jd-solanki You can share them here!

@benjamincanac benjamincanac changed the title Next v3.0 release v3.0 Mar 4, 2024
@sawa-ko
Copy link

sawa-ko commented Mar 5, 2024

Since it is supposed to be a refactoring to all components, could we give the possibility of compatibility with unocss?

Copy link
Member Author

benjamincanac commented Mar 6, 2024

@sawa-ko It will be made with Tailwind v4. To what end would you make it compatible with Uno?

@benjamincanac benjamincanac self-assigned this Mar 6, 2024
Copy link
Member Author

benjamincanac commented Mar 6, 2024

I've started working on this in a private repository of mine, I'll open-source it once I'm satisfied with the base so you guys can check it out 😊.

A lot has changed since @nuxt/ui was made open-source (May 2023), so the plan here is to rewrite every component from scratch alongside their config. For example, at the beginning the config was split in many keys for the same div to give more flexibility, but since then we introduced tailwind-merge which now allows us to group those keys together.

I'll post regular updates on this issue.

@ghost
Copy link

ghost commented Mar 8, 2024

Please tell me how long it will take for this upgrade to be available.
Very much looking forward to this upgrade

Copy link
Member Author

I have no idea how long it will take and it's not entirely up to us, I hope to release it at the same time as the official release of Tailwind v4.

@robin-dongbin
Copy link

That's awesome. The new version of nuxt-ui uses exactly the tech stack I expected.

I tried to build my own UI library using radix-ui and tailwind-variants, but I immediately found that even with radix-ui, it is not easy to build a full UI library.

But I got an idea with an API that works with any design language. If you are interested, here is my demo repository:
https://github.com/vincajs/vinca-ui

Copy link
Member Author

@robin-dongbin It's already in the making. There are already 13 components done, 36 more to go 😅

@robin-dongbin
Copy link

Since the component library is based on radix-ui without styles, I thought it would be nice to provide an api that is abstracted from various design systems, so you can switch styles from one system to another at any time.

If people want to implement another design system, they can just customize it, share files, or even contribute to a repository.

Taking things a step further, it is possible to switch between different design systems at runtime.

Of course, I'm just offering an idea, and if you think it's too late, that's fine

Copy link
Member Author

This is actually already what we're doing with the App Config. You can customize the classes for every part of every component.

@aspitrine
Copy link

Thanks for the work!
i’m impatient to try this!

Just one question :

The biggest change is the switch to tailwind-variants, this will cause lots of breaking changes if you've used the ui prop or app.config.ts to override the config.

app.config.ts is deprecated and it will not port in v3? Or it’s something else?

Copy link
Member Author

No we keep the app.config.ts, what I meant is since we now use tailwind-variants the config itself changes.

For example the Kbd component, its config looked like this:

export default {
  base: 'inline-flex items-center justify-center text-gray-900 dark:text-white',
  padding: 'px-1',
  size: {
    xs: 'h-4 min-w-[16px] text-[10px]',
    sm: 'h-5 min-w-[20px] text-[11px]',
    md: 'h-6 min-w-[24px] text-[12px]'
  },
  rounded: 'rounded',
  font: 'font-medium font-sans',
  background: 'bg-gray-100 dark:bg-gray-800',
  ring: 'ring-1 ring-gray-300 dark:ring-gray-700 ring-inset',
  default: {
    size: 'sm'
  }
}

Here is the new version:

export default {
  base: 'inline-flex items-center justify-center text-gray-900 dark:text-white px-1 rounded font-medium font-sans bg-gray-50 dark:bg-gray-800 ring ring-gray-300 dark:ring-gray-700 ring-inset',
  variants: {
    size: {
      xs: 'h-4 min-w-[16px] text-[10px]',
      sm: 'h-5 min-w-[20px] text-[11px]',
      md: 'h-6 min-w-[24px] text-[12px]'
    }
  },
  defaultVariants: {
    size: 'sm'
  }
}

This is a breaking change if you've overridden its config in your app.config.ts or through the ui prop. I'm thinking of a CLI or something that would help people migrate from v2 to v3 without too much trouble but it might not be easy to achieve. Everything is fully typed so this will give some indications at least.

@aspitrine
Copy link

Ok !

Effectively, it's a breaking change but it seam ok for the future to have a better granularity with the variants.

Thanks for the explanation and the example 🙏🏻

@MickL
Copy link
Contributor

MickL commented Dec 18, 2024

Thats how I did it. But you also need to keep track of if the reset button should be shown. For example one would say v-if="value" but this doesnt work if the value is 0 for example.

Imo it would make sense for this components to have a reset function built into Nuxt UI. BUT maybe there would be too many different requirements: One might want to be able to deselect a value in the select menu, this currently works only with multiple. Some might want to have an X integrated in the dropdown. Some others may want a delete icon next to the dropdown or a reset link button under it.

Copy link
Member Author

@MickL That is exactly the reason why we've never implemented it, there are so many different possibilities to achieve this that it's easier to do it yourself honestly.

  1. You can add a clear button using the #trailing slot, something like https://ui3.nuxt.dev/components/input#with-clear-button
  2. You can use a ButtonGroup as @sandros94 mentioned
  3. You can add an item inside the items with onSelect: (e) => e.preventDefault() and handle the logic there

@MickL
Copy link
Contributor

MickL commented Dec 18, 2024

Oh wow this 1. is a nice solution. Maybe this example could be added to InputMenu and SelectMenu as well! Also maybe the other two points could be at least mentioned in the docs (may dont need a code example).

What could be done tho for SelectMenu is the possibility to check an item off again? It works with multiple but not for single values.

Copy link
Member Author

I'll add the examples! This would be an issue for Reka UI's Combobox component.

@MickL
Copy link
Contributor

MickL commented Dec 29, 2024

Shouldnt be Drawer and Slideover the same component? As far as I see the only difference is that a Drawer has an optional handle. Slideover is missing the "swipe to close" feature, but this I would definitely add to it as it is a common user behavior using mobile devices.

Personally I would remove Slideover, rename Drawer to Slideover and hide the handle by default.

@mrwwalmsley
Copy link

mrwwalmsley commented Dec 30, 2024

  1. Nuxt UI Pro v3
    You mentioned above that all the Nuxt UI Pro v3 components are implemented except for dashboard. When will these be made available as an alpha release? I'd love to start trying them out even if the documentation is not yet available.

  2. Nuxt UI Pro documentation feedback

One thing I found a little confusing in the Nuxt UI Pro v2 documentation was trying to work out the difference between components with similar names: e.g. LandingCard vs PageCard or LandingGrid vs PageGrid. I had to look at the config code, but it would be good if the opening description had a little more detail to explain what that component did.

  1. Nuxt UI Pro v3 Footer component issue

When you shrink the screen down to mobile mode, the default slot is left aligned instead of centre aligned like the left and right slots.

Image

@sandros94
Copy link
Collaborator

Shouldnt be Drawer and Slideover the same component? As far as I see the only difference is that a Drawer has an optional handle. Slideover is missing the "swipe to close" feature, but this I would definitely add to it as it is a common user behavior using mobile devices.

Personally I would remove Slideover, rename Drawer to Slideover and hide the handle by default.

Unfortunately, they are based on two completely separate tools, as you can read from the linked documentation.

  • Slideover comes from Reka UI's Dialog component, the same used for UModal. It is meant to be more stable and better supported since it is part of the main library.
  • Drawer on the other hand is still on its own project being only a Dialog replacement (in fact, it is built on top of it) for mobile and tablet use. More importantly it is still under a radix-vue implementation, last major before Reka UI. This means that there will be further breaking changes if that component will be kept active.

This would be more of an upstream discussion. But I personally use them both, depending on UI design and project's device target.

@MickL
Copy link
Contributor

MickL commented Dec 30, 2024

Doesnt it make sense to unify them when one is better supported? Personally I would love to use slideover but it doesnt have a swipe to close feature. Without the follow-pointer-movement, like Drawer has, it would be easily implemented by https://vueuse.org/core/useSwipe/

@neok
Copy link

neok commented Jan 1, 2025

When do you plan to release dashboard for v3?

@Buringcarbon
Copy link

When will the next version of v3.alpha10 come out, the current version does not seem to work in Windows and vue environments

@sandros94
Copy link
Collaborator

When will the next version of v3.alpha10 come out, the current version does not seem to work in Windows and vue environments

Could you please open up a new issue? Feel free to tag me in

@Buringcarbon
Copy link

When will the next version of v3.alpha10 come out, the current version does not seem to work in Windows and vue environments

Could you please open up a new issue? Feel free to tag me in

there was already an issue #2831 (comment)

@sandros94
Copy link
Collaborator

there was already an issue #2831 (comment)

Ah ok, not a new one.
Until a new release comes by the best thing you could do is to install it form the CI:
"@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@d4653e3", more info in the docs.

@ineshbose
Copy link
Member

Could possibly consider adding a next tag to npm:@nuxt/ui-edge?

@Buringcarbon
Copy link

there was already an issue #2831 (comment)

Ah ok, not a new one. Until a new release comes by the best thing you could do is to install it form the CI: "@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@d4653e3", more info in the docs.

I tried the method you suggested, and it indeed worked. Thank you very much.

@iEnzO233
Copy link

@benjamincanac i have an issue with drawer and modal .
inside drawe i have used a modal . when i open my modal inside the drawer after modal close body get this style :
and i cant scroll or click on anything else

@dannote
Copy link

dannote commented Jan 12, 2025

@benjamincanac the new stack and theming look great! Would you also be interested in migrating to a more modern-looking tailwindcss-motion?

@Lionad-Morotar
Copy link

Hello everyone, are there any docs about upgrade the nuxt/ui from v2 to v3 ?

@madsh93
Copy link

madsh93 commented Jan 20, 2025

@benjamincanac i have an issue with drawer and modal . inside drawe i have used a modal . when i open my modal inside the drawer after modal close body get this style : and i cant scroll or click on anything else

I also have this bug with the drawer where it scrolls when closing it, but only sometimes. It seems do to it everytime if I just used a selectmenu.

Image

@Archetipo95
Copy link

Button component is missing a cursor pointer in v3
I noticed it just by looking at the docs, maybe other accessibility features are missing?

@MickL
Copy link
Contributor

MickL commented Jan 20, 2025

I think they are ALL missing a pointer cursor. Not sure why, but it seems to be a feature not a bug.

First thing I did was adding pointers to all components I use in app.config

@HugoRCD
Copy link
Collaborator

HugoRCD commented Jan 20, 2025

@Archetipo95 @MickL Watch this issue for more explanation on why there's no cursor-pointer on the buttons! #2332

@MickL
Copy link
Contributor

MickL commented Jan 20, 2025

Maybe cursor: pointer could be added by default but opt-out with a config variable?

I guess most, if not all, of the developers will want to have a pointer for buttons, tabs, etc

@divine
Copy link

divine commented Jan 20, 2025

Maybe cursor: pointer could be added by default but opt-out with a config variable?

I guess most, if not all, of the developers will want to have a pointer for buttons, tabs, etc

This is a tailwind v4 change not something nuxt ui did in advance. Copy-pasting a CSS snippet is a way to go for now.

See @ tailwindlabs/tailwindcss#8961

@madsh93
Copy link

madsh93 commented Jan 20, 2025

Maybe cursor: pointer could be added by default but opt-out with a config variable?

I guess most, if not all, of the developers will want to have a pointer for buttons, tabs, etc

Just add this to your app.config.ts
ui: {
button: {
slots: {
base: 'cursor-pointer',
},
},
},

@MickL
Copy link
Contributor

MickL commented Jan 20, 2025

Yes I know but maybe this can be done by default by Nuxt UI BUT be opted-out in nuxt config?

Nuxt UI is all about convenience. It comes with Nuxt Icons and Nuxt Fonts, they dont need to be installed separately. Having no pointers will be something most, if not all, users will need to set manually. Therefore I would suggest to make this configurable and activated by default.

@gitamgadtaula
Copy link

Help I am getting this error

ERROR Pre-transform error: [@vue/compiler-sfc] Failed to resolve extends base type. 8:06:20 PM
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:

interface Props extends /* @vue-ignore */ Base {}

Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.

/Users/gitamgadtaula/Desktop/work/freelance/mixtiles/node_modules/@nuxt/ui/dist/runtime/components/App.vue
28 | import UToaster from './Toaster.vue'
29 | import UModalProvider from './ModalProvider.vue'
30 | import USlideoverProvider from './SlideoverProvider.vue'
| ^^^^
31 |
| ^
32 | const props = defineProps()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 | defineSlots()
| ^^^^^^^^^
Plugin: vite:vue
File: /Users/gitamgadtaula/Desktop/work/freelance/mixtiles/node_modules/@nuxt/ui/dist/runtime/components/App.vue

@sandros94
Copy link
Collaborator

Yes I know but maybe this can be done by default by Nuxt UI BUT be opted-out in nuxt config?

Nuxt UI is all about convenience. It comes with Nuxt Icons and Nuxt Fonts, they dont need to be installed separately. Having no pointers will be something most, if not all, users will need to set manually. Therefore I would suggest to make this configurable and activated by default.

as pointed out in the upstream PR the CSS spec defines:

pointer
The cursor is a pointer that indicates a link.

I invite you to have a read of the various sources shared in that PR to have a clear understanding why this is the standard. Also, as @madsh93 already replied, it is as simple as adding the following to your app.config.ts:

export default defineAppConfig({
  ui: {
    button: {
      slots: {
        base: 'cursor-pointer',
      },
    },
  },
})

@sandros94
Copy link
Collaborator

Help I am getting this error

ERROR Pre-transform error: [@vue/compiler-sfc] Failed to resolve extends base type. 8:06:20 PM If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:

interface Props extends /* @vue-ignore */ Base {}

Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.

/Users/gitamgadtaula/Desktop/work/freelance/mixtiles/node_modules/@nuxt/ui/dist/runtime/components/App.vue 28 | import UToaster from './Toaster.vue' 29 | import UModalProvider from './ModalProvider.vue' 30 | import USlideoverProvider from './SlideoverProvider.vue' | ^^^^ 31 | | ^ 32 | const props = defineProps() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 33 | defineSlots() | ^^^^^^^^^ Plugin: vite:vue File: /Users/gitamgadtaula/Desktop/work/freelance/mixtiles/node_modules/@nuxt/ui/dist/runtime/components/App.vue

@gitamgadtaula please create a new issue with a reproduction link, as I need to see the context of UApp to understand this error. Feel free to tag me in once you open it

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

No branches or pull requests