@nuxt/ui 4.11.1 → 4.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.d.vue.ts +1 -1
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/App.vue +2 -1
- package/dist/runtime/components/AuthForm.d.vue.ts +4 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +4 -0
- package/dist/runtime/components/Breadcrumb.d.vue.ts +1 -1
- package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/Carousel.d.vue.ts +1 -1
- package/dist/runtime/components/Carousel.vue.d.ts +1 -1
- package/dist/runtime/components/ChatPrompt.vue +1 -1
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
- package/dist/runtime/components/CommandPalette.d.vue.ts +1 -1
- package/dist/runtime/components/CommandPalette.vue.d.ts +1 -1
- package/dist/runtime/components/ContextMenu.d.vue.ts +1 -1
- package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardNavbar.vue +1 -1
- package/dist/runtime/components/DashboardSearch.vue +3 -3
- package/dist/runtime/components/DashboardSidebar.vue +3 -3
- package/dist/runtime/components/DropdownMenu.d.vue.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/runtime/components/EditorToolbar.vue +6 -5
- package/dist/runtime/components/FooterColumns.d.vue.ts +1 -1
- package/dist/runtime/components/FooterColumns.vue.d.ts +1 -1
- package/dist/runtime/components/Form.d.vue.ts +2 -0
- package/dist/runtime/components/Form.vue +57 -30
- package/dist/runtime/components/Form.vue.d.ts +2 -0
- package/dist/runtime/components/Header.vue +3 -3
- package/dist/runtime/components/Input.vue +5 -5
- package/dist/runtime/components/InputDate.vue +12 -6
- package/dist/runtime/components/InputMenu.d.vue.ts +1 -1
- package/dist/runtime/components/InputMenu.vue +18 -7
- package/dist/runtime/components/InputMenu.vue.d.ts +1 -1
- package/dist/runtime/components/InputTime.vue +12 -6
- package/dist/runtime/components/LinkBase.vue +3 -1
- package/dist/runtime/components/Listbox.d.vue.ts +1 -1
- package/dist/runtime/components/Listbox.vue.d.ts +1 -1
- package/dist/runtime/components/NavigationMenu.d.vue.ts +1 -1
- package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
- package/dist/runtime/components/PageAnchors.d.vue.ts +1 -1
- package/dist/runtime/components/PageAnchors.vue.d.ts +1 -1
- package/dist/runtime/components/PageLinks.d.vue.ts +1 -1
- package/dist/runtime/components/PageLinks.vue.d.ts +1 -1
- package/dist/runtime/components/PinInput.d.vue.ts +5 -3
- package/dist/runtime/components/PinInput.vue +15 -7
- package/dist/runtime/components/PinInput.vue.d.ts +5 -3
- package/dist/runtime/components/ProgressGroup.d.vue.ts +1 -1
- package/dist/runtime/components/ProgressGroup.vue.d.ts +1 -1
- package/dist/runtime/components/RadioGroup.d.vue.ts +1 -1
- package/dist/runtime/components/RadioGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Select.d.vue.ts +1 -1
- package/dist/runtime/components/Select.vue +7 -1
- package/dist/runtime/components/Select.vue.d.ts +1 -1
- package/dist/runtime/components/SelectMenu.d.vue.ts +1 -1
- package/dist/runtime/components/SelectMenu.vue +22 -3
- package/dist/runtime/components/SelectMenu.vue.d.ts +1 -1
- package/dist/runtime/components/Splitter.d.vue.ts +1 -1
- package/dist/runtime/components/Splitter.vue.d.ts +1 -1
- package/dist/runtime/components/Stepper.d.vue.ts +1 -1
- package/dist/runtime/components/Stepper.vue.d.ts +1 -1
- package/dist/runtime/components/Table.vue +24 -2
- package/dist/runtime/components/Tabs.d.vue.ts +1 -1
- package/dist/runtime/components/Tabs.vue.d.ts +1 -1
- package/dist/runtime/components/Textarea.vue +5 -5
- package/dist/runtime/components/Timeline.d.vue.ts +1 -1
- package/dist/runtime/components/Timeline.vue.d.ts +1 -1
- package/dist/runtime/components/Toaster.vue +1 -1
- package/dist/runtime/components/Tree.d.vue.ts +1 -1
- package/dist/runtime/components/Tree.vue +1 -1
- package/dist/runtime/components/Tree.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.d.vue.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentSearch.vue +3 -3
- package/dist/runtime/components/content/ContentSurround.d.vue.ts +1 -1
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentToc.d.vue.ts +1 -1
- package/dist/runtime/components/content/ContentToc.vue.d.ts +1 -1
- package/dist/runtime/composables/useFilter.js +7 -1
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useFormField.js +8 -4
- package/dist/runtime/composables/useForwardProps.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +2 -2
- package/dist/runtime/composables/useOverlay.js +5 -5
- package/dist/runtime/composables/useResizable.js +1 -1
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/types/form.d.ts +3 -0
- package/dist/runtime/utils/form.js +3 -20
- package/dist/runtime/utils/index.js +22 -18
- package/dist/runtime/utils/virtualizer.d.ts +1 -1
- package/dist/runtime/utils/virtualizer.js +9 -11
- package/dist/runtime/vue/overrides/inertia/LinkBase.vue +3 -1
- package/dist/shared/{ui.DCJ9twx8.mjs → ui.CNAeRcb0.mjs} +45 -13
- package/dist/unplugin.d.mts +2 -1
- package/dist/unplugin.mjs +22 -10
- package/dist/vite.mjs +1 -1
- package/package.json +57 -60
- package/cli/commands/make/component.mjs +0 -86
- package/cli/commands/make/index.mjs +0 -14
- package/cli/commands/make/locale.mjs +0 -93
- package/cli/index.mjs +0 -15
- package/cli/package.json +0 -13
- package/cli/templates.mjs +0 -256
- package/cli/utils.mjs +0 -50
|
@@ -180,7 +180,7 @@ function applyDefaultVariants(result, defaultVariants) {
|
|
|
180
180
|
function createComponentPattern(prefix) {
|
|
181
181
|
const escapedPrefix = prefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
182
182
|
const kebabPrefix = kebabCase(prefix).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
183
|
-
return new RegExp(`<(?:Lazy)?${escapedPrefix}([A-Z][a-zA-Z]+)
|
|
183
|
+
return new RegExp(`<(?:Lazy)?${escapedPrefix}([A-Z][a-zA-Z]+)|(?:<|#\\[|^[ \\t]*|:[ \\t]+)(?:lazy-)?${kebabPrefix}-([a-z][a-z0-9-]*)|\\b(?:Lazy)?${escapedPrefix}([A-Z][a-zA-Z]+)\\b`, "gm");
|
|
184
184
|
}
|
|
185
185
|
function getMatchedComponent(match) {
|
|
186
186
|
if (match[2]) {
|
|
@@ -581,6 +581,9 @@ const fieldGroup$1 = {
|
|
|
581
581
|
horizontal: "inline-flex -space-x-px",
|
|
582
582
|
vertical: "flex flex-col -space-y-px"
|
|
583
583
|
}
|
|
584
|
+
},
|
|
585
|
+
defaultVariants: {
|
|
586
|
+
size: "md"
|
|
584
587
|
}
|
|
585
588
|
};
|
|
586
589
|
|
|
@@ -2009,7 +2012,7 @@ const checkboxGroup = (options) => ({
|
|
|
2009
2012
|
variant: "table",
|
|
2010
2013
|
highlight: false,
|
|
2011
2014
|
class: {
|
|
2012
|
-
item: `${hover}border-accented`
|
|
2015
|
+
item: `${hover}border-accented ${hover}z-[1]`
|
|
2013
2016
|
}
|
|
2014
2017
|
},
|
|
2015
2018
|
{ size: "xs", variant: "table", class: { item: "p-2.5" } },
|
|
@@ -2037,14 +2040,14 @@ const checkboxGroup = (options) => ({
|
|
|
2037
2040
|
color,
|
|
2038
2041
|
variant: "table",
|
|
2039
2042
|
class: {
|
|
2040
|
-
item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[
|
|
2043
|
+
item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[2]`
|
|
2041
2044
|
}
|
|
2042
2045
|
})),
|
|
2043
2046
|
{
|
|
2044
2047
|
color: "neutral",
|
|
2045
2048
|
variant: "table",
|
|
2046
2049
|
class: {
|
|
2047
|
-
item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[
|
|
2050
|
+
item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[2]"
|
|
2048
2051
|
}
|
|
2049
2052
|
},
|
|
2050
2053
|
{
|
|
@@ -3651,6 +3654,14 @@ const inputMenu = (options) => {
|
|
|
3651
3654
|
tagsInput: "flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
3652
3655
|
},
|
|
3653
3656
|
variants: {
|
|
3657
|
+
// `root` and `base` are the same element in `multiple` mode, so the
|
|
3658
|
+
// `group-*` rounding utilities inherited from `input` never match there.
|
|
3659
|
+
// Keep the `group` marker here and pick the right rounding in
|
|
3660
|
+
// `compoundVariants` depending on `multiple`.
|
|
3661
|
+
fieldGroup: {
|
|
3662
|
+
horizontal: () => ({ root: fieldGroupVariantWithRoot.fieldGroup.horizontal.root }),
|
|
3663
|
+
vertical: () => ({ root: fieldGroupVariantWithRoot.fieldGroup.vertical.root })
|
|
3664
|
+
},
|
|
3654
3665
|
virtualize: {
|
|
3655
3666
|
true: {
|
|
3656
3667
|
viewport: "p-1 isolate"
|
|
@@ -3731,6 +3742,22 @@ const inputMenu = (options) => {
|
|
|
3731
3742
|
}
|
|
3732
3743
|
},
|
|
3733
3744
|
compoundVariants: [{
|
|
3745
|
+
multiple: false,
|
|
3746
|
+
fieldGroup: "horizontal",
|
|
3747
|
+
class: { base: fieldGroupVariantWithRoot.fieldGroup.horizontal.base }
|
|
3748
|
+
}, {
|
|
3749
|
+
multiple: false,
|
|
3750
|
+
fieldGroup: "vertical",
|
|
3751
|
+
class: { base: fieldGroupVariantWithRoot.fieldGroup.vertical.base }
|
|
3752
|
+
}, {
|
|
3753
|
+
multiple: true,
|
|
3754
|
+
fieldGroup: "horizontal",
|
|
3755
|
+
class: { base: fieldGroupVariant.fieldGroup.horizontal }
|
|
3756
|
+
}, {
|
|
3757
|
+
multiple: true,
|
|
3758
|
+
fieldGroup: "vertical",
|
|
3759
|
+
class: { base: fieldGroupVariant.fieldGroup.vertical }
|
|
3760
|
+
}, {
|
|
3734
3761
|
variant: "soft",
|
|
3735
3762
|
multiple: true,
|
|
3736
3763
|
class: "has-focus:bg-elevated has-focus-visible:outline-3"
|
|
@@ -3905,7 +3932,7 @@ const inputTags = (options) => {
|
|
|
3905
3932
|
slots: {
|
|
3906
3933
|
root: (prev) => [prev, "flex-wrap"],
|
|
3907
3934
|
base: () => ["rounded-md", options.theme.transitions && "transition-colors"],
|
|
3908
|
-
item:
|
|
3935
|
+
item: "px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75 wrap-anywhere data-[state=active]:bg-accented",
|
|
3909
3936
|
itemText: "",
|
|
3910
3937
|
itemDelete: ["inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none", options.theme.transitions && "transition-colors"],
|
|
3911
3938
|
itemDeleteIcon: "shrink-0",
|
|
@@ -4258,7 +4285,7 @@ const marquee = {
|
|
|
4258
4285
|
},
|
|
4259
4286
|
overlay: {
|
|
4260
4287
|
true: {
|
|
4261
|
-
root:
|
|
4288
|
+
root: "before:absolute before:pointer-events-none before:content-[''] before:z-2 before:from-default before:to-transparent after:absolute after:pointer-events-none after:content-[''] after:z-2 after:from-default after:to-transparent"
|
|
4262
4289
|
}
|
|
4263
4290
|
}
|
|
4264
4291
|
},
|
|
@@ -5902,7 +5929,7 @@ const radioGroup = (options) => ({
|
|
|
5902
5929
|
variant: ["card", "table"],
|
|
5903
5930
|
highlight: false,
|
|
5904
5931
|
class: {
|
|
5905
|
-
item: `${hover}border-accented`
|
|
5932
|
+
item: `${hover}border-accented ${hover}z-[1]`
|
|
5906
5933
|
}
|
|
5907
5934
|
},
|
|
5908
5935
|
{ size: "xs", indicator: "hidden", class: { icon: "size-3" } },
|
|
@@ -5972,14 +5999,14 @@ const radioGroup = (options) => ({
|
|
|
5972
5999
|
color,
|
|
5973
6000
|
variant: "table",
|
|
5974
6001
|
class: {
|
|
5975
|
-
item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[
|
|
6002
|
+
item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[2]`
|
|
5976
6003
|
}
|
|
5977
6004
|
})),
|
|
5978
6005
|
{
|
|
5979
6006
|
color: "neutral",
|
|
5980
6007
|
variant: "table",
|
|
5981
6008
|
class: {
|
|
5982
|
-
item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[
|
|
6009
|
+
item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[2]"
|
|
5983
6010
|
}
|
|
5984
6011
|
},
|
|
5985
6012
|
{
|
|
@@ -6064,7 +6091,7 @@ const select = (options) => {
|
|
|
6064
6091
|
value: "truncate pointer-events-none",
|
|
6065
6092
|
placeholder: "truncate text-dimmed",
|
|
6066
6093
|
arrow: "fill-bg stroke-default",
|
|
6067
|
-
content: "max-h-[min(15rem,var(--reka-select-content-available-height,15rem))] w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col",
|
|
6094
|
+
content: "max-h-[min(15rem,var(--reka-select-content-available-height,15rem))] w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden origin-(--reka-select-content-transform-origin) pointer-events-auto data-[state=closed]:pointer-events-none! flex flex-col",
|
|
6068
6095
|
viewport: "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",
|
|
6069
6096
|
group: "p-1 isolate",
|
|
6070
6097
|
empty: "text-center text-muted",
|
|
@@ -7005,8 +7032,8 @@ const table$1 = (options) => ({
|
|
|
7005
7032
|
base: "min-w-full overflow-clip",
|
|
7006
7033
|
caption: "sr-only",
|
|
7007
7034
|
thead: "relative",
|
|
7008
|
-
tbody: "isolate [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:outline-primary/25 [&>tr]:data-[selectable=true]:focus-visible:outline-3 divide-y divide-default",
|
|
7009
|
-
tfoot: "relative",
|
|
7035
|
+
tbody: "isolate [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:outline-primary/25 [&>tr]:data-[selectable=true]:focus-visible:outline-3 [&>tr]:data-[selectable=true]:-outline-offset-3 divide-y divide-default",
|
|
7036
|
+
tfoot: "relative [&>[data-slot=separator]]:z-2",
|
|
7010
7037
|
tr: "data-[selected=true]:bg-elevated/50",
|
|
7011
7038
|
th: "px-4 py-3.5 text-sm text-highlighted text-start font-semibold [&:has([role=checkbox])]:pe-0",
|
|
7012
7039
|
td: "p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0",
|
|
@@ -7877,7 +7904,7 @@ const theme = {
|
|
|
7877
7904
|
};
|
|
7878
7905
|
|
|
7879
7906
|
const a = (options) => ({
|
|
7880
|
-
base: ["text-primary border-b border-transparent hover:border-primary font-medium rounded-xs outline-primary/25 focus-visible:outline-3 focus-visible:has-[>code]:outline-0 [&>code]:border-dashed [&>code]:outline-primary/25 focus-visible:[&>code]:outline-3 hover:[&>code]:border-primary hover:[&>code]:text-primary focus-visible:[&>code]:border-primary focus-visible:[&>code]:text-primary", options.theme.transitions && "transition-colors [&>code]:transition-colors"]
|
|
7907
|
+
base: ["text-primary border-b border-transparent hover:border-primary font-medium focus-visible:rounded-xs outline-primary/25 focus-visible:outline-3 focus-visible:has-[>code]:outline-0 [&>code]:border-dashed [&>code]:outline-primary/25 focus-visible:[&>code]:outline-3 hover:[&>code]:border-primary hover:[&>code]:text-primary focus-visible:[&>code]:border-primary focus-visible:[&>code]:text-primary", options.theme.transitions && "transition-colors [&>code]:transition-colors"]
|
|
7881
7908
|
});
|
|
7882
7909
|
|
|
7883
7910
|
const accordion = {
|
|
@@ -8725,6 +8752,7 @@ const themeContent = {
|
|
|
8725
8752
|
contentToc: contentToc
|
|
8726
8753
|
};
|
|
8727
8754
|
|
|
8755
|
+
const prefixedClasses = ["absolute", "dark:block", "dark:hidden", "dark:inline-block", "focus:outline-none", "hidden", "inset-0", "lg:block", "lg:flex", "lg:hidden", "peer", "sm:block"];
|
|
8728
8756
|
function getTemplates(options, uiConfig, nuxt, resolve, vue) {
|
|
8729
8757
|
const templates = [];
|
|
8730
8758
|
let hasProse = false;
|
|
@@ -8801,6 +8829,10 @@ function getTemplates(options, uiConfig, nuxt, resolve, vue) {
|
|
|
8801
8829
|
}
|
|
8802
8830
|
}
|
|
8803
8831
|
}
|
|
8832
|
+
const prefix = options.theme?.prefix;
|
|
8833
|
+
if (prefix) {
|
|
8834
|
+
sources.push(`@source inline(${JSON.stringify(prefixedClasses.map((cls) => `${prefix}:${cls}`).join(" "))});`);
|
|
8835
|
+
}
|
|
8804
8836
|
const componentDir = resolve ? resolve("./runtime/components") : void 0;
|
|
8805
8837
|
if (options.experimental?.componentDetection && nuxt && componentDir && layers.length) {
|
|
8806
8838
|
const detectedComponents = await detectUsedComponents(
|
package/dist/unplugin.d.mts
CHANGED
|
@@ -123,7 +123,8 @@ interface NuxtUIOptions extends Omit<ModuleOptions, 'fonts' | 'colorMode' | 'con
|
|
|
123
123
|
root?: string;
|
|
124
124
|
}
|
|
125
125
|
declare const runtimeDir: string;
|
|
126
|
+
declare const runtimeUrl: string;
|
|
126
127
|
declare const NuxtUIPlugin: unplugin.UnpluginInstance<NuxtUIOptions | undefined, boolean>;
|
|
127
128
|
|
|
128
|
-
export { NuxtUIPlugin, runtimeDir };
|
|
129
|
+
export { NuxtUIPlugin, runtimeDir, runtimeUrl };
|
|
129
130
|
export type { NuxtUIOptions };
|
package/dist/unplugin.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url';
|
|
1
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
2
|
import { join, normalize, relative } from 'pathe';
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import tailwind from '@tailwindcss/vite';
|
|
6
|
-
import { e as getTemplates, h as resolveExtraScanDirs, b as detectUsedComponents, f as publicComposables, g as getClientBundleIcons, p as parseIconName, d as defaultOptions, r as resolveColors, c as getDefaultConfig } from './shared/ui.
|
|
6
|
+
import { e as getTemplates, h as resolveExtraScanDirs, b as detectUsedComponents, f as publicComposables, g as getClientBundleIcons, p as parseIconName, d as defaultOptions, r as resolveColors, c as getDefaultConfig } from './shared/ui.CNAeRcb0.mjs';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import { consola } from 'consola';
|
|
@@ -99,11 +99,11 @@ function TemplatePlugin(options, appConfig, componentDir) {
|
|
|
99
99
|
|
|
100
100
|
function PluginsPlugin(options) {
|
|
101
101
|
const plugins = globSync(["**/*", "!*.d.ts"], { cwd: join(runtimeDir, "plugins"), absolute: true });
|
|
102
|
-
plugins.unshift(resolvePathSync("
|
|
103
|
-
plugins.unshift(resolvePathSync("
|
|
104
|
-
plugins.unshift(resolvePathSync("
|
|
102
|
+
plugins.unshift(resolvePathSync("./vue/plugins/router", { extensions: [".ts", ".mjs", ".js"], url: runtimeUrl }));
|
|
103
|
+
plugins.unshift(resolvePathSync("./vue/plugins/head", { extensions: [".ts", ".mjs", ".js"], url: runtimeUrl }));
|
|
104
|
+
plugins.unshift(resolvePathSync("./vue/plugins/icons", { extensions: [".ts", ".mjs", ".js"], url: runtimeUrl }));
|
|
105
105
|
if (options.colorMode) {
|
|
106
|
-
plugins.push(resolvePathSync("
|
|
106
|
+
plugins.push(resolvePathSync("./vue/plugins/color-mode", { extensions: [".ts", ".mjs", ".js"], url: runtimeUrl }));
|
|
107
107
|
}
|
|
108
108
|
const proseComponents = options.prose || options.mdc ? globSync(["**/*.vue"], { cwd: join(runtimeDir, "components/prose"), absolute: true }) : [];
|
|
109
109
|
return {
|
|
@@ -222,7 +222,8 @@ function createComponentSource(cwd, prefix, ignore = []) {
|
|
|
222
222
|
const relativePath = paths.get(componentName);
|
|
223
223
|
if (!relativePath) return;
|
|
224
224
|
return join(cwd, relativePath);
|
|
225
|
-
}
|
|
225
|
+
},
|
|
226
|
+
resolvePath: (relativePath) => files.includes(relativePath) ? join(cwd, relativePath) : void 0
|
|
226
227
|
};
|
|
227
228
|
}
|
|
228
229
|
function ComponentImportPlugin(options, meta) {
|
|
@@ -239,6 +240,7 @@ function ComponentImportPlugin(options, meta) {
|
|
|
239
240
|
colorModeIgnore
|
|
240
241
|
);
|
|
241
242
|
const overrideSources = [routerOverrides[routerMode], unpluginComponents].filter((s) => !!s);
|
|
243
|
+
const componentsDir = `${join(runtimeDir, "components")}/`;
|
|
242
244
|
const internalResolverPlugin = {
|
|
243
245
|
/**
|
|
244
246
|
* This plugin aims to ensure we override certain components with Vue-compatible versions:
|
|
@@ -247,6 +249,15 @@ function ComponentImportPlugin(options, meta) {
|
|
|
247
249
|
name: "nuxt:ui:components",
|
|
248
250
|
enforce: "pre",
|
|
249
251
|
resolveId(id, importer) {
|
|
252
|
+
const normalizedId = normalize(id);
|
|
253
|
+
const packagePath = normalizedId.match(PACKAGE_IMPORT_RE)?.[1] ?? (normalizedId.startsWith(componentsDir) && normalizedId.endsWith(".vue") ? normalizedId.slice(componentsDir.length) : void 0);
|
|
254
|
+
if (packagePath) {
|
|
255
|
+
for (const source of overrideSources) {
|
|
256
|
+
const resolved = source.resolvePath(packagePath);
|
|
257
|
+
if (resolved) return resolved;
|
|
258
|
+
}
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
250
261
|
if (!importer || !normalize(importer).includes(runtimeDir)) {
|
|
251
262
|
return;
|
|
252
263
|
}
|
|
@@ -303,11 +314,11 @@ function ComponentImportPlugin(options, meta) {
|
|
|
303
314
|
];
|
|
304
315
|
}
|
|
305
316
|
const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
|
|
317
|
+
const PACKAGE_IMPORT_RE = /(?:^|\/node_modules\/)@nuxt\/ui\/(?:dist\/)?(?:runtime\/)?components\/(.+\.vue)$/;
|
|
306
318
|
|
|
307
319
|
function NuxtEnvironmentPlugin(options) {
|
|
308
320
|
const routerMode = resolveRouterMode(options);
|
|
309
|
-
const
|
|
310
|
-
const stubPath = resolvePathSync(stubsPath, { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
|
|
321
|
+
const stubPath = resolvePathSync(`./vue/stubs/${routerMode}`, { extensions: [".ts", ".mjs", ".js"], url: runtimeUrl });
|
|
311
322
|
return {
|
|
312
323
|
name: "nuxt:ui",
|
|
313
324
|
enforce: "pre",
|
|
@@ -443,6 +454,7 @@ function IconsPlugin(options, appConfig) {
|
|
|
443
454
|
}
|
|
444
455
|
|
|
445
456
|
const runtimeDir = normalize(fileURLToPath(new URL("./runtime", import.meta.url)));
|
|
457
|
+
const runtimeUrl = pathToFileURL(`${runtimeDir}/`).href;
|
|
446
458
|
const NuxtUIPlugin = createUnplugin((_options = {}, meta) => {
|
|
447
459
|
const options = defu(_options, { fonts: false }, defaultOptions);
|
|
448
460
|
options.theme = options.theme || {};
|
|
@@ -475,4 +487,4 @@ const NuxtUIPlugin = createUnplugin((_options = {}, meta) => {
|
|
|
475
487
|
].flat(1);
|
|
476
488
|
});
|
|
477
489
|
|
|
478
|
-
export { NuxtUIPlugin, runtimeDir };
|
|
490
|
+
export { NuxtUIPlugin, runtimeDir, runtimeUrl };
|
package/dist/vite.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/ui",
|
|
3
3
|
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
|
4
|
-
"version": "4.11.
|
|
5
|
-
"packageManager": "pnpm@11.25.0",
|
|
4
|
+
"version": "4.11.3",
|
|
6
5
|
"repository": {
|
|
7
6
|
"type": "git",
|
|
8
7
|
"url": "git+https://github.com/nuxt/ui.git"
|
|
@@ -93,9 +92,6 @@
|
|
|
93
92
|
"imports": {
|
|
94
93
|
"#build/ui.css": "./.nuxt/ui.static.css"
|
|
95
94
|
},
|
|
96
|
-
"bin": {
|
|
97
|
-
"nuxt-ui": "./cli/index.mjs"
|
|
98
|
-
},
|
|
99
95
|
"style": "./dist/runtime/index.css",
|
|
100
96
|
"main": "./dist/module.mjs",
|
|
101
97
|
"sideEffects": [
|
|
@@ -104,35 +100,11 @@
|
|
|
104
100
|
"files": [
|
|
105
101
|
".nuxt/ui.static.css",
|
|
106
102
|
"dist",
|
|
107
|
-
"cli",
|
|
108
103
|
"vue-plugin.d.ts"
|
|
109
104
|
],
|
|
110
|
-
"scripts": {
|
|
111
|
-
"build": "nuxt-module-build build",
|
|
112
|
-
"prepack": "pnpm build",
|
|
113
|
-
"dev": "nuxt dev playgrounds/nuxt --uiDev",
|
|
114
|
-
"dev:build": "nuxt build playgrounds/nuxt",
|
|
115
|
-
"dev:vue": "pnpm --filter './playgrounds/vue' dev -- --uiDev",
|
|
116
|
-
"dev:vue:build": "pnpm --filter './playgrounds/vue' build",
|
|
117
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playgrounds/nuxt && nuxt prepare docs && pnpm dev:vue:build",
|
|
118
|
-
"repl": "pnpm --filter './playgrounds/repl' dev",
|
|
119
|
-
"repl:bundle": "pnpm --filter './playgrounds/repl' bundle",
|
|
120
|
-
"repl:build": "pnpm --filter './playgrounds/repl' build",
|
|
121
|
-
"repl:prepare": "nuxt-module-build build --stub && mkdir -p .nuxt && echo '{\"compilerOptions\":{}}' > .nuxt/tsconfig.json",
|
|
122
|
-
"docs": "nuxt dev docs --uiDev",
|
|
123
|
-
"docs:build": "nuxt build docs",
|
|
124
|
-
"lint": "eslint .",
|
|
125
|
-
"lint:fix": "eslint . --fix",
|
|
126
|
-
"typecheck": "vue-tsc --noEmit && nuxt typecheck playgrounds/nuxt && nuxt typecheck docs && cd playgrounds/vue && vue-tsc --noEmit",
|
|
127
|
-
"test": "vitest",
|
|
128
|
-
"test:vue": "vitest --project vue",
|
|
129
|
-
"test:nuxt": "vitest --project nuxt",
|
|
130
|
-
"bench": "vitest bench --project vue",
|
|
131
|
-
"release": "release-it"
|
|
132
|
-
},
|
|
133
105
|
"dependencies": {
|
|
134
106
|
"@floating-ui/dom": "^1.8.0",
|
|
135
|
-
"@iconify/vue": "^5.0.
|
|
107
|
+
"@iconify/vue": "^5.0.3",
|
|
136
108
|
"@internationalized/date": "^3.12.4",
|
|
137
109
|
"@internationalized/number": "^3.6.8",
|
|
138
110
|
"@nuxt/fonts": "^0.14.0",
|
|
@@ -144,7 +116,7 @@
|
|
|
144
116
|
"@tailwindcss/postcss": "^4.3.3",
|
|
145
117
|
"@tailwindcss/vite": "^4.3.3",
|
|
146
118
|
"@tanstack/vue-table": "^8.21.3",
|
|
147
|
-
"@tanstack/vue-virtual": "^3.13.
|
|
119
|
+
"@tanstack/vue-virtual": "^3.13.39",
|
|
148
120
|
"@tiptap/core": "^3.31.3",
|
|
149
121
|
"@tiptap/extension-bubble-menu": "^3.31.3",
|
|
150
122
|
"@tiptap/extension-code": "^3.31.3",
|
|
@@ -162,7 +134,7 @@
|
|
|
162
134
|
"@tiptap/starter-kit": "^3.31.3",
|
|
163
135
|
"@tiptap/suggestion": "^3.31.3",
|
|
164
136
|
"@tiptap/vue-3": "^3.31.3",
|
|
165
|
-
"@unhead/vue": "^3.4.
|
|
137
|
+
"@unhead/vue": "^3.4.1",
|
|
166
138
|
"@vueuse/core": "^14.4.0",
|
|
167
139
|
"@vueuse/integrations": "^14.4.0",
|
|
168
140
|
"@vueuse/shared": "^14.4.0",
|
|
@@ -177,21 +149,21 @@
|
|
|
177
149
|
"embla-carousel-vue": "^8.6.0",
|
|
178
150
|
"embla-carousel-wheel-gestures": "^8.1.0",
|
|
179
151
|
"fuse.js": "^7.5.0",
|
|
180
|
-
"hookable": "^6.1.
|
|
152
|
+
"hookable": "^6.1.2",
|
|
181
153
|
"knitwork": "^1.3.0",
|
|
182
|
-
"magic-string": "^1.2
|
|
154
|
+
"magic-string": "^1.4.2",
|
|
183
155
|
"mlly": "^1.8.2",
|
|
184
|
-
"motion-v": "^2.4.
|
|
156
|
+
"motion-v": "^2.4.4",
|
|
185
157
|
"ohash": "^2.0.12",
|
|
186
158
|
"pathe": "^2.0.3",
|
|
187
|
-
"reka-ui": "2.10.
|
|
159
|
+
"reka-ui": "2.10.5",
|
|
188
160
|
"scule": "^1.3.0",
|
|
189
|
-
"tailwind-merge": "^3.
|
|
161
|
+
"tailwind-merge": "^3.7.0",
|
|
190
162
|
"tailwind-variants": "^3.2.2",
|
|
191
163
|
"tailwindcss": "^4.3.3",
|
|
192
164
|
"tinyglobby": "^0.2.17",
|
|
193
165
|
"ufo": "^1.6.4",
|
|
194
|
-
"unplugin": "^3.
|
|
166
|
+
"unplugin": "^3.4.0",
|
|
195
167
|
"unplugin-auto-import": "^21.1.0",
|
|
196
168
|
"unplugin-vue-components": "^32.1.0",
|
|
197
169
|
"vaul-vue": "0.4.1",
|
|
@@ -201,29 +173,30 @@
|
|
|
201
173
|
"@codspeed/vitest-plugin": "^5.7.1",
|
|
202
174
|
"@nuxt/eslint-config": "^1.17.0",
|
|
203
175
|
"@nuxt/module-builder": "^1.0.3",
|
|
204
|
-
"@nuxt/test-utils": "^4.2
|
|
205
|
-
"@release-it/conventional-changelog": "^12.0.
|
|
176
|
+
"@nuxt/test-utils": "^4.3.2",
|
|
177
|
+
"@release-it/conventional-changelog": "^12.0.2",
|
|
206
178
|
"@tanstack/table-core": "^8.21.3",
|
|
207
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
208
|
-
"@vue/test-utils": "^2.5.
|
|
209
|
-
"ai": "^7.0.
|
|
179
|
+
"@vitejs/plugin-vue": "^6.0.9",
|
|
180
|
+
"@vue/test-utils": "^2.5.1",
|
|
181
|
+
"ai": "^7.0.116",
|
|
210
182
|
"embla-carousel": "^8.6.0",
|
|
211
|
-
"eslint": "^10.
|
|
212
|
-
"
|
|
183
|
+
"eslint": "^10.11.0",
|
|
184
|
+
"eslint-plugin-better-tailwindcss": "^4.7.0",
|
|
185
|
+
"happy-dom": "^20.14.5",
|
|
213
186
|
"nuxt": "^4.5.2",
|
|
214
|
-
"release-it": "^21.0
|
|
187
|
+
"release-it": "^21.1.0",
|
|
215
188
|
"unbuild": "^3.6.1",
|
|
216
189
|
"vitest": "^4.1.11",
|
|
217
190
|
"vitest-axe": "^0.1.0",
|
|
218
191
|
"vitest-environment-nuxt": "^2.0.0",
|
|
219
|
-
"vue": "^3.5.
|
|
192
|
+
"vue": "^3.5.43",
|
|
220
193
|
"vue-tsc": "^3.3.11"
|
|
221
194
|
},
|
|
222
195
|
"peerDependencies": {
|
|
223
|
-
"@inertiajs/vue3": "^2.0.7 || ^3
|
|
224
|
-
"@internationalized/date": "^3
|
|
225
|
-
"@internationalized/number": "^3
|
|
226
|
-
"@nuxt/content": "^3
|
|
196
|
+
"@inertiajs/vue3": "^2.0.7 || ^3",
|
|
197
|
+
"@internationalized/date": "^3",
|
|
198
|
+
"@internationalized/number": "^3",
|
|
199
|
+
"@nuxt/content": "^3",
|
|
227
200
|
"@tiptap/core": "^3",
|
|
228
201
|
"@tiptap/extension-bubble-menu": "^3",
|
|
229
202
|
"@tiptap/extension-code": "^3",
|
|
@@ -242,14 +215,14 @@
|
|
|
242
215
|
"@tiptap/suggestion": "^3",
|
|
243
216
|
"@tiptap/vue-3": "^3",
|
|
244
217
|
"ai": "^6 || ^7",
|
|
245
|
-
"joi": "^18
|
|
246
|
-
"superstruct": "^2
|
|
247
|
-
"tailwindcss": "^4
|
|
248
|
-
"typescript": "^5.6.3 || ^6
|
|
249
|
-
"valibot": "^1
|
|
250
|
-
"vue-router": "^4.5.0 || ^5
|
|
218
|
+
"joi": "^18",
|
|
219
|
+
"superstruct": "^2",
|
|
220
|
+
"tailwindcss": "^4",
|
|
221
|
+
"typescript": "^5.6.3 || ^6 || ^7",
|
|
222
|
+
"valibot": "^1",
|
|
223
|
+
"vue-router": "^4.5.0 || ^5",
|
|
251
224
|
"yup": "^1.7.0",
|
|
252
|
-
"zod": "^3.24.0 || ^4
|
|
225
|
+
"zod": "^3.24.0 || ^4"
|
|
253
226
|
},
|
|
254
227
|
"peerDependenciesMeta": {
|
|
255
228
|
"@inertiajs/vue3": {
|
|
@@ -301,5 +274,29 @@
|
|
|
301
274
|
"tailwind",
|
|
302
275
|
"framework",
|
|
303
276
|
"ui-framework"
|
|
304
|
-
]
|
|
305
|
-
|
|
277
|
+
],
|
|
278
|
+
"scripts": {
|
|
279
|
+
"build": "nuxt-module-build build",
|
|
280
|
+
"cli": "node ./cli/index.mjs",
|
|
281
|
+
"dev": "nuxt dev playgrounds/nuxt --uiDev",
|
|
282
|
+
"dev:build": "nuxt build playgrounds/nuxt",
|
|
283
|
+
"dev:vue": "pnpm --filter './playgrounds/vue' dev -- --uiDev",
|
|
284
|
+
"dev:vue:build": "pnpm --filter './playgrounds/vue' build",
|
|
285
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playgrounds/nuxt && nuxt prepare docs && pnpm dev:vue:build",
|
|
286
|
+
"repl": "pnpm --filter './playgrounds/repl' dev",
|
|
287
|
+
"repl:bundle": "pnpm --filter './playgrounds/repl' bundle",
|
|
288
|
+
"repl:build": "pnpm --filter './playgrounds/repl' build",
|
|
289
|
+
"repl:prepare": "nuxt-module-build build --stub && mkdir -p .nuxt && echo '{\"compilerOptions\":{}}' > .nuxt/tsconfig.json",
|
|
290
|
+
"docs": "nuxt dev docs --uiDev",
|
|
291
|
+
"docs:build": "nuxt build docs",
|
|
292
|
+
"lint": "eslint .",
|
|
293
|
+
"lint:fix": "eslint . --fix",
|
|
294
|
+
"typecheck": "vue-tsc --noEmit && nuxt typecheck playgrounds/nuxt && nuxt typecheck docs",
|
|
295
|
+
"test": "vitest",
|
|
296
|
+
"test:vue": "vitest --project vue",
|
|
297
|
+
"test:nuxt": "vitest --project nuxt",
|
|
298
|
+
"bench": "vitest bench --project vue",
|
|
299
|
+
"size": "node test/bundle/size.mjs",
|
|
300
|
+
"release": "release-it"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { existsSync, promises as fsp } from 'node:fs'
|
|
2
|
-
import { resolve } from 'pathe'
|
|
3
|
-
import { defineCommand } from 'citty'
|
|
4
|
-
import { consola } from 'consola'
|
|
5
|
-
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
|
|
6
|
-
import { appendFile, appendThemeDefault, sortFile } from '../../utils.mjs'
|
|
7
|
-
import templates from '../../templates.mjs'
|
|
8
|
-
|
|
9
|
-
export default defineCommand({
|
|
10
|
-
meta: {
|
|
11
|
-
name: 'component',
|
|
12
|
-
description: 'Make a new component.'
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
name: {
|
|
16
|
-
type: 'positional',
|
|
17
|
-
required: true,
|
|
18
|
-
description: 'Name of the component.'
|
|
19
|
-
},
|
|
20
|
-
primitive: {
|
|
21
|
-
type: 'boolean',
|
|
22
|
-
description: 'Create a primitive component.'
|
|
23
|
-
},
|
|
24
|
-
prose: {
|
|
25
|
-
type: 'boolean',
|
|
26
|
-
description: 'Create a prose component.'
|
|
27
|
-
},
|
|
28
|
-
content: {
|
|
29
|
-
type: 'boolean',
|
|
30
|
-
description: 'Create a content component.'
|
|
31
|
-
},
|
|
32
|
-
template: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Only generate template.'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
async setup({ args }) {
|
|
38
|
-
const name = args.name
|
|
39
|
-
if (!name) {
|
|
40
|
-
consola.error('`name` argument is missing!')
|
|
41
|
-
process.exit(1)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const path = resolve('.')
|
|
45
|
-
|
|
46
|
-
for (const template of Object.keys(templates)) {
|
|
47
|
-
if (args.template && template !== args.template) {
|
|
48
|
-
continue
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const { filename, contents } = templates[template](args)
|
|
52
|
-
if (!contents) {
|
|
53
|
-
continue
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const filePath = resolve(path, filename)
|
|
57
|
-
|
|
58
|
-
if (existsSync(filePath)) {
|
|
59
|
-
consola.error(`🚨 ${filePath} already exists!`)
|
|
60
|
-
continue
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
await fsp.writeFile(filePath, contents.trim() + '\n')
|
|
64
|
-
|
|
65
|
-
consola.success(`🪄 Generated ${filePath}!`)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (args.template) {
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const themePath = resolve(path, `src/theme/${args.prose ? 'prose/' : ''}${args.content ? 'content/' : ''}index.ts`)
|
|
73
|
-
await appendFile(themePath, `export { default as ${camelCase(name)} } from './${kebabCase(name)}'`)
|
|
74
|
-
await sortFile(themePath)
|
|
75
|
-
|
|
76
|
-
if (!args.prose) {
|
|
77
|
-
const typesPath = resolve(path, 'src/runtime/types/index.ts')
|
|
78
|
-
const pascal = splitByCase(name).map(p => upperFirst(p)).join('')
|
|
79
|
-
await appendFile(typesPath, `export * from '../components/${args.content ? 'content/' : ''}${pascal}.vue'`)
|
|
80
|
-
await sortFile(typesPath)
|
|
81
|
-
|
|
82
|
-
const useComponentPropsPath = resolve(path, 'src/runtime/composables/useComponentProps.ts')
|
|
83
|
-
await appendThemeDefault(useComponentPropsPath, camelCase(name), `${pascal}Props`)
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
})
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty'
|
|
2
|
-
import component from './component.mjs'
|
|
3
|
-
import locale from './locale.mjs'
|
|
4
|
-
|
|
5
|
-
export default defineCommand({
|
|
6
|
-
meta: {
|
|
7
|
-
name: 'make',
|
|
8
|
-
description: 'Commands to create new Nuxt UI entities.'
|
|
9
|
-
},
|
|
10
|
-
subCommands: {
|
|
11
|
-
component,
|
|
12
|
-
locale
|
|
13
|
-
}
|
|
14
|
-
})
|