Compare commits

..

22 Commits

Author SHA1 Message Date
HugoRCD
c326180f15 Merge remote-tracking branch 'origin/v3' into fix/3394 2025-05-20 14:58:39 +02:00
Benjamin Canac
6887e33aae chore(deps): update @nuxt/ui-pro 2025-05-20 14:22:31 +02:00
HugoRCD
d75093a160 revert 2025-05-19 16:05:36 +02:00
HugoRCD
47ed1e0f74 test 2025-05-19 15:56:18 +02:00
HugoRCD
d6a3a65b8e up 2025-05-19 14:14:34 +02:00
HugoRCD
a81d0e55c7 up 2025-05-19 13:35:23 +02:00
HugoRCD
5b172b0fb3 test 2025-05-19 12:48:33 +02:00
HugoRCD
fbf7475e0d up 2025-05-19 12:27:38 +02:00
HugoRCD
0f90645c84 up 2025-05-19 11:31:38 +02:00
HugoRCD
33193d782d up 2025-05-19 11:30:40 +02:00
HugoRCD
d1f2b50033 Merge remote-tracking branch 'origin/v3' into fix/3394 2025-05-19 11:26:00 +02:00
HugoRCD
bd75d2d184 up 2025-05-19 11:25:57 +02:00
renovate[bot]
28e869e8aa chore(deps): update all non-major dependencies (v3) (#4178)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 11:05:40 +02:00
HugoRCD
cabad480f9 test 2025-05-19 11:02:36 +02:00
zikju
d86956e1d5 feat(locale): add Lithuanian language (#4171)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
2025-05-19 10:53:02 +02:00
renovate[bot]
23e4f0ec4d chore(deps): update tailwindcss to ^4.1.7 (v3) (#4179)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 10:52:00 +02:00
HugoRCD
91d06d4d51 up 2025-05-19 10:49:49 +02:00
HugoRCD
f1128c2450 feat: implement csp, sty-src with nonce 2025-05-19 10:37:46 +02:00
Muhammad Syahmi Mohd Ikram
c00f6e8cdf feat(locale): add Malay language (#4160) 2025-05-16 12:14:21 +02:00
Benjamin Canac
d29e1481f2 chore(deps): update @nuxt/ui-pro 2025-05-15 15:57:54 +02:00
Benjamin Canac
79aa161c6d docs(showcase): remove submit button 2025-05-15 15:42:25 +02:00
Benjamin Canac
94ea75f441 docs(content): update badges 2025-05-15 15:30:02 +02:00
15 changed files with 586 additions and 668 deletions

View File

@@ -25,6 +25,7 @@ function getEmojiFlag(locale: string): string {
kk: 'kz', // Kazakh -> Kazakhstan
km: 'kh', // Khmer -> Cambodia
ko: 'kr', // Korean -> South Korea
ms: 'my', // Malay -> Malaysia
nb: 'no', // Norwegian Bokmål -> Norway
sl: 'si', // Slovenian -> Slovenia
sv: 'se', // Swedish -> Sweden

View File

@@ -67,17 +67,6 @@ defineOgImageComponent('Docs', {
</li>
</ul>
</div>
<div class="flex justify-center -mb-[36px]">
<UButton
label="Submit your project"
trailing-icon="i-lucide-plus"
color="neutral"
size="lg"
to="https://github.com/nuxt/ui/edit/v3/docs/content/showcase.yml"
target="_blank"
/>
</div>
</UPageHero>
</UMain>
</template>

View File

@@ -21,10 +21,10 @@ Use the `items` prop as an array of objects with the following properties:
- `icon?: string`{lang="ts-type"}
- `avatar?: AvatarProps`{lang="ts-type"}
- `badge?: string | number | BadgeProps`{lang="ts-type"}
- `tooltip?: TooltipProps`{lang="ts-type"} :badge{label="Soon"}
- `tooltip?: TooltipProps`{lang="ts-type"}
- `trailingIcon?: string`{lang="ts-type"}
- `type?: 'label' | 'link'`{lang="ts-type"}
- `collapsible?: boolean`{lang="ts-type"} :badge{label="Soon"}
- `collapsible?: boolean`{lang="ts-type"}
- `defaultOpen?: boolean`{lang="ts-type"}
- `open?: boolean`{lang="ts-type"}
- `value?: string`{lang="ts-type"}
@@ -885,7 +885,7 @@ You can inspect the DOM to see each item's content being rendered.
## Examples
### With tooltips in items :badge{label="Soon" class="align-text-top"}
### With tooltips in items :badge{label="New" class="align-text-top"}
You can use the `tooltip` property to display a [Tooltip](/components/tooltip) around an item. This can be useful when the menu is collapsed.

View File

@@ -136,7 +136,7 @@ props:
---
::
### Tooltip :badge{label="Soon" class="align-text-top"}
### Tooltip :badge{label="New" class="align-text-top"}
Use the `tooltip` prop to display a [Tooltip](/components/tooltip) around the Slider thumbs with the current value. You can set it to `true` for default behavior or pass an object to customize it with any property from the [Tooltip](/components/tooltip#props) component.

View File

@@ -5,20 +5,20 @@
"dependencies": {
"@ai-sdk/vue": "^1.2.12",
"@iconify-json/logos": "^1.2.4",
"@iconify-json/lucide": "^1.2.43",
"@iconify-json/lucide": "^1.2.44",
"@iconify-json/simple-icons": "^1.2.34",
"@iconify-json/vscode-icons": "^1.2.21",
"@nuxt/content": "^3.5.1",
"@nuxt/image": "^1.10.0",
"@nuxt/ui": "latest",
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@a30de4d",
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@9038c43",
"@nuxthub/core": "^0.8.27",
"@nuxtjs/plausible": "^1.2.0",
"@octokit/rest": "^21.1.1",
"@rollup/plugin-yaml": "^4.1.2",
"@vueuse/integrations": "^13.2.0",
"@vueuse/nuxt": "^13.2.0",
"ai": "^4.3.15",
"ai": "^4.3.16",
"capture-website": "^4.2.0",
"joi": "^17.13.3",
"motion-v": "^1.0.2",

View File

@@ -116,15 +116,15 @@
"@internationalized/date": "^3.8.0",
"@internationalized/number": "^3.6.1",
"@nuxt/fonts": "^0.11.4",
"@nuxt/icon": "^1.12.0",
"@nuxt/icon": "^1.13.0",
"@nuxt/kit": "^3.17.3",
"@nuxt/schema": "^3.17.3",
"@nuxtjs/color-mode": "^3.5.2",
"@standard-schema/spec": "^1.0.0",
"@tailwindcss/postcss": "^4.1.6",
"@tailwindcss/vite": "^4.1.6",
"@tailwindcss/postcss": "^4.1.7",
"@tailwindcss/vite": "^4.1.7",
"@tanstack/vue-table": "^8.21.3",
"@unhead/vue": "^2.0.8",
"@unhead/vue": "^2.0.9",
"@vueuse/core": "^13.2.0",
"@vueuse/integrations": "^13.2.0",
"colortranslator": "^4.1.0",
@@ -147,7 +147,7 @@
"reka-ui": "^2.2.1",
"scule": "^1.3.0",
"tailwind-variants": "^1.0.0",
"tailwindcss": "^4.1.6",
"tailwindcss": "^4.1.7",
"tinyglobby": "^0.2.13",
"unplugin": "^2.3.4",
"unplugin-auto-import": "^19.2.0",
@@ -156,13 +156,13 @@
"vue-component-type-helpers": "^2.2.10"
},
"devDependencies": {
"@nuxt/eslint-config": "^1.3.1",
"@nuxt/eslint-config": "^1.4.0",
"@nuxt/module-builder": "^1.0.1",
"@nuxt/test-utils": "^3.18.0",
"@nuxt/test-utils": "^3.19.0",
"@release-it/conventional-changelog": "^10.0.1",
"@vue/test-utils": "^2.4.6",
"embla-carousel": "^8.6.0",
"eslint": "^9.26.0",
"eslint": "^9.27.0",
"happy-dom": "^17.4.7",
"nuxt": "^3.17.3",
"release-it": "^19.0.2",

View File

@@ -9,7 +9,7 @@
"typecheck": "nuxt typecheck"
},
"dependencies": {
"@iconify-json/lucide": "^1.2.43",
"@iconify-json/lucide": "^1.2.44",
"@iconify-json/simple-icons": "^1.2.34",
"@nuxt/ui": "latest",
"@nuxthub/core": "^0.8.27",

1052
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@ import icons from './theme/icons'
import { pick } from './runtime/utils'
export const getDefaultUiConfig = (colors?: string[]) => ({
export const getDefaultUiConfig = (colors?: string[], csp?: { nonce?: string }) => ({
colors: pick({
primary: 'green',
secondary: 'blue',
@@ -12,7 +12,10 @@ export const getDefaultUiConfig = (colors?: string[]) => ({
error: 'red',
neutral: 'slate'
}, [...(colors || []), 'neutral' as any]),
icons
icons,
csp: csp || {
nonce: ''
}
})
export const defaultOptions = {
@@ -22,6 +25,9 @@ export const defaultOptions = {
theme: {
colors: undefined,
transitions: true
},
csp: {
nonce: ''
}
}

View File

@@ -28,6 +28,19 @@ export interface ModuleOptions {
*/
colorMode?: boolean
/**
* Configure Content Security Policy for Nuxt UI
* @defaultValue `{ nonce: '' }`
* @link https://ui.nuxt.com/getting-started/installation/nuxt#csp
*/
csp?: {
/**
* Enable nonce for inline styles.
* @defaultValue ``
*/
nonce?: string
}
/**
* Customize how the theme is generated
* @link https://ui.nuxt.com/getting-started/theme
@@ -70,7 +83,7 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.options.alias['#ui'] = resolve('./runtime')
nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, getDefaultUiConfig(options.theme.colors))
nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, getDefaultUiConfig(options.theme.colors, options.csp))
// Isolate root node from portaled components
nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {}

View File

@@ -21,9 +21,11 @@ export { default as hy } from './hy'
export { default as id } from './id'
export { default as it } from './it'
export { default as ja } from './ja'
export { default as km } from './km'
export { default as kk } from './kk'
export { default as km } from './km'
export { default as ko } from './ko'
export { default as lt } from './lt'
export { default as ms } from './ms'
export { default as nb_no } from './nb_no'
export { default as nl } from './nl'
export { default as pl } from './pl'
@@ -37,8 +39,8 @@ export { default as sv } from './sv'
export { default as th } from './th'
export { default as tj } from './tj'
export { default as tr } from './tr'
export { default as uk } from './uk'
export { default as ug_cn } from './ug_cn'
export { default as uk } from './uk'
export { default as ur } from './ur'
export { default as uz } from './uz'
export { default as vi } from './vi'

56
src/runtime/locale/lt.ts Normal file
View File

@@ -0,0 +1,56 @@
import type { Messages } from '../types'
import { defineLocale } from '../composables/defineLocale'
export default defineLocale<Messages>({
name: 'Lietuvių',
code: 'lt',
messages: {
inputMenu: {
noMatch: 'Nėra atitinkančių duomenų',
noData: 'Nėra duomenų',
create: 'Sukurti „{label}“'
},
calendar: {
prevYear: 'Ankstesni metai',
nextYear: 'Kiti metai',
prevMonth: 'Ankstesnis mėnuo',
nextMonth: 'Kitas mėnuo'
},
inputNumber: {
increment: 'Padidinti',
decrement: 'Sumažinti'
},
commandPalette: {
placeholder: 'Įveskite komandą arba ieškokite...',
noMatch: 'Nėra atitinkančių duomenų',
noData: 'Nėra duomenų',
close: 'Uždaryti'
},
selectMenu: {
noMatch: 'Nėra atitinkančių duomenų',
noData: 'Nėra duomenų',
create: 'Sukurti „{label}“',
search: 'Ieškoti...'
},
toast: {
close: 'Uždaryti'
},
carousel: {
prev: 'Atgal',
next: 'Pirmyn',
goto: 'Eiti į skaidrę {slide}'
},
modal: {
close: 'Uždaryti'
},
slideover: {
close: 'Uždaryti'
},
alert: {
close: 'Uždaryti'
},
table: {
noData: 'Nėra duomenų'
}
}
})

56
src/runtime/locale/ms.ts Normal file
View File

@@ -0,0 +1,56 @@
import type { Messages } from '../types'
import { defineLocale } from '../composables/defineLocale'
export default defineLocale<Messages>({
name: 'Melayu',
code: 'ms',
messages: {
inputMenu: {
noMatch: 'Tiada data yang sepadan',
noData: 'Tiada data',
create: 'Cipta "{label}"'
},
calendar: {
prevYear: 'Tahun sebelum',
nextYear: 'Tahun seterusnya',
prevMonth: 'Bulan sebelum',
nextMonth: 'Bulan seterusnya'
},
inputNumber: {
increment: 'Naikkan',
decrement: 'Kurangkan'
},
commandPalette: {
placeholder: 'Taip arahan atau carian...',
noMatch: 'Tiada data yang sepadan',
noData: 'Tiada data',
close: 'Tutup'
},
selectMenu: {
noMatch: 'Tiada data yang sepadan',
noData: 'Tiada data',
create: 'Cipta "{label}"',
search: 'Cari...'
},
toast: {
close: 'Tutup'
},
carousel: {
prev: 'Sebelum',
next: 'Seterusnya',
goto: 'Pergi ke slaid {slide}'
},
modal: {
close: 'Tutup'
},
slideover: {
close: 'Tutup'
},
alert: {
close: 'Tutup'
},
table: {
noData: 'Tiada data'
}
}
})

View File

@@ -23,6 +23,8 @@ export default defineNuxtPlugin(() => {
const appConfig = useAppConfig()
const nuxtApp = useNuxtApp()
const nonce = computed(() => appConfig.ui?.csp?.nonce)
const root = computed(() => {
const { neutral, ...colors } = appConfig.ui.colors
@@ -44,7 +46,8 @@ export default defineNuxtPlugin(() => {
style: [{
innerHTML: () => root.value,
tagPriority: -2,
id: 'nuxt-ui-colors'
id: 'nuxt-ui-colors',
...(nonce.value ? { nonce: nonce.value } : {})
}]
}
@@ -54,10 +57,15 @@ export default defineNuxtPlugin(() => {
style.innerHTML = root.value
style.setAttribute('data-nuxt-ui-colors', '')
if (nonce.value) {
style.setAttribute('nonce', nonce.value)
}
document.head.appendChild(style)
headData.script = [{
innerHTML: 'document.head.removeChild(document.querySelector(\'[data-nuxt-ui-colors]\'))'
innerHTML: 'document.head.removeChild(document.querySelector(\'[data-nuxt-ui-colors]\'))',
...(nonce.value ? { nonce: nonce.value } : {})
}]
}

View File

@@ -165,6 +165,9 @@ type AppConfigUI = {
}
icons?: Partial<typeof icons>
tv?: typeof defaultConfig
csp?: {
nonce?: string
}
} & TVConfig<typeof ui>
declare module '@nuxt/schema' {