@nuxt/ui 3.0.0 → 3.0.1
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/.nuxt/ui/calendar.ts +1 -1
- package/.nuxt/ui/drawer.ts +8 -5
- package/.nuxt/ui.css +1 -1
- package/README.md +11 -11
- package/cli/package.json +1 -1
- package/dist/module.cjs +2 -2
- package/dist/module.d.cts +6 -6
- package/dist/module.d.mts +6 -6
- package/dist/module.d.ts +6 -6
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +2 -0
- package/dist/runtime/components/Breadcrumb.vue +2 -0
- package/dist/runtime/components/ColorPicker.vue +2 -0
- package/dist/runtime/components/CommandPalette.vue +2 -0
- package/dist/runtime/components/ContextMenu.vue +8 -6
- package/dist/runtime/components/Drawer.vue +12 -13
- package/dist/runtime/components/DropdownMenu.vue +7 -5
- package/dist/runtime/components/Form.vue +21 -1
- package/dist/runtime/components/FormField.vue +5 -0
- package/dist/runtime/components/InputMenu.vue +3 -3
- package/dist/runtime/components/Modal.vue +10 -7
- package/dist/runtime/components/NavigationMenu.vue +5 -3
- package/dist/runtime/components/PinInput.vue +2 -0
- package/dist/runtime/components/Popover.vue +3 -2
- package/dist/runtime/components/RadioGroup.vue +2 -2
- package/dist/runtime/components/Select.vue +3 -3
- package/dist/runtime/components/SelectMenu.vue +3 -3
- package/dist/runtime/components/Slideover.vue +10 -7
- package/dist/runtime/components/Stepper.vue +2 -0
- package/dist/runtime/components/Table.vue +1 -1
- package/dist/runtime/components/Tabs.vue +2 -0
- package/dist/runtime/components/Toast.vue +1 -1
- package/dist/runtime/components/Tooltip.vue +3 -2
- package/dist/runtime/components/Tree.vue +2 -0
- package/dist/runtime/composables/defineLocale.js +1 -0
- package/dist/runtime/composables/defineShortcuts.js +1 -0
- package/dist/runtime/composables/useKbd.js +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.js +1 -1
- package/dist/runtime/locale/ca.d.ts +3 -0
- package/dist/runtime/locale/ca.js +54 -0
- package/dist/runtime/locale/ckb.d.ts +3 -0
- package/dist/runtime/locale/ckb.js +55 -0
- package/dist/runtime/locale/index.d.ts +5 -0
- package/dist/runtime/locale/index.js +5 -0
- package/dist/runtime/locale/ro.d.ts +3 -0
- package/dist/runtime/locale/ro.js +54 -0
- package/dist/runtime/locale/ur.d.ts +3 -0
- package/dist/runtime/locale/ur.js +55 -0
- package/dist/runtime/locale/uz.d.ts +3 -0
- package/dist/runtime/locale/uz.js +54 -0
- package/dist/runtime/plugins/colors.js +19 -15
- package/dist/runtime/types/form.d.ts +1 -3
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/utils/form.d.ts +0 -4
- package/dist/runtime/utils/form.js +2 -47
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/utils/tv.js +1 -1
- package/dist/runtime/vue/plugins/head.js +3 -0
- package/dist/runtime/vue/stubs.d.ts +0 -1
- package/dist/runtime/vue/stubs.js +1 -2
- package/dist/shared/{ui.yjbGE7Dx.mjs → ui.BCaWD5Ek.mjs} +10 -10
- package/dist/shared/{ui.COBs1u5H.cjs → ui.C6uTSFTI.cjs} +10 -10
- package/dist/unplugin.cjs +6 -2
- package/dist/unplugin.mjs +6 -2
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +17 -17
package/.nuxt/ui/calendar.ts
CHANGED
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
"headCell": "rounded-[calc(var(--ui-radius)*1.5)]",
|
|
30
30
|
"cell": "relative text-center",
|
|
31
31
|
"cellTrigger": [
|
|
32
|
-
"m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-(--ui-text-muted) data-unavailable:line-through data-unavailable:text-(--ui-text-muted) data-unavailable:pointer-events-none data-[selected]:text-(--ui-bg) data-today:font-semibold",
|
|
32
|
+
"m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-(--ui-text-muted) data-unavailable:line-through data-unavailable:text-(--ui-text-muted) data-unavailable:pointer-events-none data-[selected]:text-(--ui-bg) data-today:font-semibold data-[outside-view]:text-(--ui-text-muted)",
|
|
33
33
|
"transition"
|
|
34
34
|
]
|
|
35
35
|
},
|
package/.nuxt/ui/drawer.ts
CHANGED
|
@@ -9,7 +9,10 @@ export default {
|
|
|
9
9
|
"slots": {
|
|
10
10
|
"overlay": "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
11
11
|
"content": "fixed bg-(--ui-bg) ring ring-(--ui-border) flex focus:outline-none",
|
|
12
|
-
"handle":
|
|
12
|
+
"handle": [
|
|
13
|
+
"shrink-0 !bg-(--ui-bg-accented)",
|
|
14
|
+
"transition-opacity"
|
|
15
|
+
],
|
|
13
16
|
"container": "w-full flex flex-col gap-4 p-4 overflow-y-auto",
|
|
14
17
|
"header": "",
|
|
15
18
|
"title": "text-(--ui-text-highlighted) font-semibold",
|
|
@@ -25,7 +28,7 @@ export default {
|
|
|
25
28
|
},
|
|
26
29
|
"right": {
|
|
27
30
|
"content": "flex-row",
|
|
28
|
-
"handle": "ml-4"
|
|
31
|
+
"handle": "!ml-4"
|
|
29
32
|
},
|
|
30
33
|
"bottom": {
|
|
31
34
|
"content": "mt-24 flex-col",
|
|
@@ -33,7 +36,7 @@ export default {
|
|
|
33
36
|
},
|
|
34
37
|
"left": {
|
|
35
38
|
"content": "flex-row-reverse",
|
|
36
|
-
"handle": "mr-4"
|
|
39
|
+
"handle": "!mr-4"
|
|
37
40
|
}
|
|
38
41
|
},
|
|
39
42
|
"inset": {
|
|
@@ -50,7 +53,7 @@ export default {
|
|
|
50
53
|
],
|
|
51
54
|
"class": {
|
|
52
55
|
"content": "h-auto max-h-[96%]",
|
|
53
|
-
"handle": "w-12 h-1.5 mx-auto"
|
|
56
|
+
"handle": "!w-12 !h-1.5 mx-auto"
|
|
54
57
|
}
|
|
55
58
|
},
|
|
56
59
|
{
|
|
@@ -60,7 +63,7 @@ export default {
|
|
|
60
63
|
],
|
|
61
64
|
"class": {
|
|
62
65
|
"content": "w-auto max-w-[calc(100%-2rem)]",
|
|
63
|
-
"handle": "h-12 w-1.5 mt-auto mb-auto"
|
|
66
|
+
"handle": "!h-12 !w-1.5 mt-auto mb-auto"
|
|
64
67
|
}
|
|
65
68
|
},
|
|
66
69
|
{
|
package/.nuxt/ui.css
CHANGED
package/README.md
CHANGED
|
@@ -11,31 +11,31 @@
|
|
|
11
11
|
[![License][license-src]][license-href]
|
|
12
12
|
[![Nuxt][nuxt-src]][nuxt-href]
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Nuxt UI harnesses the combined strengths of [Reka UI](https://reka-ui.com/), [Tailwind CSS](https://tailwindcss.com/), and [Tailwind Variants](https://www.tailwind-variants.org/) to offer developers an unparalleled set of tools for creating sophisticated, accessible, and highly performant user interfaces.
|
|
15
15
|
|
|
16
16
|
> [!NOTE]
|
|
17
17
|
> You are on the `v3` development branch, check out the [v2 branch](https://github.com/nuxt/ui/tree/v2) for Nuxt UI v2.
|
|
18
18
|
|
|
19
19
|
## Documentation
|
|
20
20
|
|
|
21
|
-
Visit https://
|
|
21
|
+
Visit https://ui.nuxt.com to explore the documentation.
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
25
|
```bash [pnpm]
|
|
26
|
-
pnpm add @nuxt/ui
|
|
26
|
+
pnpm add @nuxt/ui
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
```bash [yarn]
|
|
30
|
-
yarn add @nuxt/ui
|
|
30
|
+
yarn add @nuxt/ui
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
```bash [npm]
|
|
34
|
-
npm install @nuxt/ui
|
|
34
|
+
npm install @nuxt/ui
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
```bash [bun]
|
|
38
|
-
bun add @nuxt/ui
|
|
38
|
+
bun add @nuxt/ui
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### Nuxt
|
|
@@ -51,11 +51,11 @@ export default defineNuxtConfig({
|
|
|
51
51
|
2. Import Tailwind CSS and Nuxt UI in your CSS:
|
|
52
52
|
|
|
53
53
|
```css [assets/css/main.css]
|
|
54
|
-
@import "tailwindcss"
|
|
54
|
+
@import "tailwindcss";
|
|
55
55
|
@import "@nuxt/ui";
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
Learn more in the [installation guide](https://
|
|
58
|
+
Learn more in the [installation guide](https://ui.nuxt.com/getting-started/installation/nuxt).
|
|
59
59
|
|
|
60
60
|
### Vue
|
|
61
61
|
|
|
@@ -98,11 +98,11 @@ app.mount('#app')
|
|
|
98
98
|
3. Import Tailwind CSS and Nuxt UI in your CSS:
|
|
99
99
|
|
|
100
100
|
```css [assets/main.css]
|
|
101
|
-
@import "tailwindcss"
|
|
101
|
+
@import "tailwindcss";
|
|
102
102
|
@import "@nuxt/ui";
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
Learn more in the [installation guide](https://
|
|
105
|
+
Learn more in the [installation guide](https://ui.nuxt.com/getting-started/installation/vue).
|
|
106
106
|
|
|
107
107
|
## Credits
|
|
108
108
|
|
|
@@ -119,7 +119,7 @@ Learn more in the [installation guide](https://ui3.nuxt.dev/getting-started/inst
|
|
|
119
119
|
Licensed under the [MIT license](https://github.com/nuxt/ui/blob/v3/LICENSE.md).
|
|
120
120
|
|
|
121
121
|
<!-- Badges -->
|
|
122
|
-
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/ui/
|
|
122
|
+
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/ui/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
123
123
|
[npm-version-href]: https://npmjs.com/package/@nuxt/ui
|
|
124
124
|
|
|
125
125
|
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxt/ui.svg?style=flat&colorA=18181B&colorB=28CF8D
|
package/cli/package.json
CHANGED
package/dist/module.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const defu = require('defu');
|
|
4
4
|
const kit = require('@nuxt/kit');
|
|
5
|
-
const templates = require('./shared/ui.
|
|
5
|
+
const templates = require('./shared/ui.C6uTSFTI.cjs');
|
|
6
6
|
require('../dist/runtime/utils/index.js');
|
|
7
7
|
require('node:url');
|
|
8
8
|
require('scule');
|
|
@@ -16,7 +16,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
16
16
|
compatibility: {
|
|
17
17
|
nuxt: ">=3.16.0"
|
|
18
18
|
},
|
|
19
|
-
docs: "https://
|
|
19
|
+
docs: "https://ui.nuxt.com/getting-started/installation/nuxt"
|
|
20
20
|
},
|
|
21
21
|
defaults: templates.defaultOptions,
|
|
22
22
|
async setup(options, nuxt) {
|
package/dist/module.d.cts
CHANGED
|
@@ -5,36 +5,36 @@ interface ModuleOptions {
|
|
|
5
5
|
/**
|
|
6
6
|
* Prefix for components
|
|
7
7
|
* @defaultValue `U`
|
|
8
|
-
* @link https://
|
|
8
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#prefix
|
|
9
9
|
*/
|
|
10
10
|
prefix?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Enable or disable `@nuxt/fonts` module
|
|
13
13
|
* @defaultValue `true`
|
|
14
|
-
* @link https://
|
|
14
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#fonts
|
|
15
15
|
*/
|
|
16
16
|
fonts?: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Enable or disable `@nuxtjs/color-mode` module
|
|
19
19
|
* @defaultValue `true`
|
|
20
|
-
* @link https://
|
|
20
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#colormode
|
|
21
21
|
*/
|
|
22
22
|
colorMode?: boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Customize how the theme is generated
|
|
25
|
-
* @link https://
|
|
25
|
+
* @link https://ui.nuxt.com/getting-started/theme
|
|
26
26
|
*/
|
|
27
27
|
theme?: {
|
|
28
28
|
/**
|
|
29
29
|
* Define the color aliases available for components
|
|
30
30
|
* @defaultValue `['primary', 'secondary', 'success', 'info', 'warning', 'error']`
|
|
31
|
-
* @link https://
|
|
31
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themecolors
|
|
32
32
|
*/
|
|
33
33
|
colors?: string[];
|
|
34
34
|
/**
|
|
35
35
|
* Enable or disable transitions on components
|
|
36
36
|
* @defaultValue `true`
|
|
37
|
-
* @link https://
|
|
37
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themetransitions
|
|
38
38
|
*/
|
|
39
39
|
transitions?: boolean;
|
|
40
40
|
};
|
package/dist/module.d.mts
CHANGED
|
@@ -5,36 +5,36 @@ interface ModuleOptions {
|
|
|
5
5
|
/**
|
|
6
6
|
* Prefix for components
|
|
7
7
|
* @defaultValue `U`
|
|
8
|
-
* @link https://
|
|
8
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#prefix
|
|
9
9
|
*/
|
|
10
10
|
prefix?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Enable or disable `@nuxt/fonts` module
|
|
13
13
|
* @defaultValue `true`
|
|
14
|
-
* @link https://
|
|
14
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#fonts
|
|
15
15
|
*/
|
|
16
16
|
fonts?: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Enable or disable `@nuxtjs/color-mode` module
|
|
19
19
|
* @defaultValue `true`
|
|
20
|
-
* @link https://
|
|
20
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#colormode
|
|
21
21
|
*/
|
|
22
22
|
colorMode?: boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Customize how the theme is generated
|
|
25
|
-
* @link https://
|
|
25
|
+
* @link https://ui.nuxt.com/getting-started/theme
|
|
26
26
|
*/
|
|
27
27
|
theme?: {
|
|
28
28
|
/**
|
|
29
29
|
* Define the color aliases available for components
|
|
30
30
|
* @defaultValue `['primary', 'secondary', 'success', 'info', 'warning', 'error']`
|
|
31
|
-
* @link https://
|
|
31
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themecolors
|
|
32
32
|
*/
|
|
33
33
|
colors?: string[];
|
|
34
34
|
/**
|
|
35
35
|
* Enable or disable transitions on components
|
|
36
36
|
* @defaultValue `true`
|
|
37
|
-
* @link https://
|
|
37
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themetransitions
|
|
38
38
|
*/
|
|
39
39
|
transitions?: boolean;
|
|
40
40
|
};
|
package/dist/module.d.ts
CHANGED
|
@@ -5,36 +5,36 @@ interface ModuleOptions {
|
|
|
5
5
|
/**
|
|
6
6
|
* Prefix for components
|
|
7
7
|
* @defaultValue `U`
|
|
8
|
-
* @link https://
|
|
8
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#prefix
|
|
9
9
|
*/
|
|
10
10
|
prefix?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Enable or disable `@nuxt/fonts` module
|
|
13
13
|
* @defaultValue `true`
|
|
14
|
-
* @link https://
|
|
14
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#fonts
|
|
15
15
|
*/
|
|
16
16
|
fonts?: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Enable or disable `@nuxtjs/color-mode` module
|
|
19
19
|
* @defaultValue `true`
|
|
20
|
-
* @link https://
|
|
20
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#colormode
|
|
21
21
|
*/
|
|
22
22
|
colorMode?: boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Customize how the theme is generated
|
|
25
|
-
* @link https://
|
|
25
|
+
* @link https://ui.nuxt.com/getting-started/theme
|
|
26
26
|
*/
|
|
27
27
|
theme?: {
|
|
28
28
|
/**
|
|
29
29
|
* Define the color aliases available for components
|
|
30
30
|
* @defaultValue `['primary', 'secondary', 'success', 'info', 'warning', 'error']`
|
|
31
|
-
* @link https://
|
|
31
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themecolors
|
|
32
32
|
*/
|
|
33
33
|
colors?: string[];
|
|
34
34
|
/**
|
|
35
35
|
* Enable or disable transitions on components
|
|
36
36
|
* @defaultValue `true`
|
|
37
|
-
* @link https://
|
|
37
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themetransitions
|
|
38
38
|
*/
|
|
39
39
|
transitions?: boolean;
|
|
40
40
|
};
|
package/dist/module.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"compatibility": {
|
|
5
5
|
"nuxt": ">=3.16.0"
|
|
6
6
|
},
|
|
7
|
-
"docs": "https://
|
|
8
|
-
"version": "3.0.
|
|
7
|
+
"docs": "https://ui.nuxt.com/getting-started/installation/nuxt",
|
|
8
|
+
"version": "3.0.1",
|
|
9
9
|
"builder": {
|
|
10
10
|
"@nuxt/module-builder": "0.8.4",
|
|
11
11
|
"unbuild": "2.0.0"
|
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.BCaWD5Ek.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
@@ -13,7 +13,7 @@ const module = defineNuxtModule({
|
|
|
13
13
|
compatibility: {
|
|
14
14
|
nuxt: ">=3.16.0"
|
|
15
15
|
},
|
|
16
|
-
docs: "https://
|
|
16
|
+
docs: "https://ui.nuxt.com/getting-started/installation/nuxt"
|
|
17
17
|
},
|
|
18
18
|
defaults: defaultOptions,
|
|
19
19
|
async setup(options, nuxt) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import type { AccordionRootProps, AccordionRootEmits } from 'reka-ui'
|
|
3
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
@@ -60,6 +61,7 @@ export type AccordionSlots<T extends { slot?: string }> = {
|
|
|
60
61
|
content: SlotProps<T>
|
|
61
62
|
body: SlotProps<T>
|
|
62
63
|
} & DynamicSlots<T, SlotProps<T>>
|
|
64
|
+
|
|
63
65
|
</script>
|
|
64
66
|
|
|
65
67
|
<script setup lang="ts" generic="T extends AccordionItem">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
3
4
|
import _appConfig from '#build/app.config'
|
|
@@ -51,6 +52,7 @@ export type BreadcrumbSlots<T extends { slot?: string }> = {
|
|
|
51
52
|
'item-trailing': SlotProps<T>
|
|
52
53
|
'separator'(props?: {}): any
|
|
53
54
|
} & DynamicSlots<T, SlotProps<T>>
|
|
55
|
+
|
|
54
56
|
</script>
|
|
55
57
|
|
|
56
58
|
<script setup lang="ts" generic="T extends BreadcrumbItem">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import type { VariantProps } from 'tailwind-variants'
|
|
3
4
|
import type { MaybeRefOrGetter } from '@vueuse/shared'
|
|
@@ -70,6 +71,7 @@ export type ColorPickerProps = {
|
|
|
70
71
|
class?: any
|
|
71
72
|
ui?: Partial<typeof colorPicker.slots>
|
|
72
73
|
}
|
|
74
|
+
|
|
73
75
|
</script>
|
|
74
76
|
|
|
75
77
|
<script setup lang="ts">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import type { ListboxRootProps, ListboxRootEmits } from 'reka-ui'
|
|
3
4
|
import type { FuseResult } from 'fuse.js'
|
|
@@ -130,6 +131,7 @@ export type CommandPaletteSlots<G extends { slot?: string }, T extends { slot?:
|
|
|
130
131
|
'item-label': SlotProps<T>
|
|
131
132
|
'item-trailing': SlotProps<T>
|
|
132
133
|
} & DynamicSlots<G, SlotProps<T>> & DynamicSlots<T, SlotProps<T>>
|
|
134
|
+
|
|
133
135
|
</script>
|
|
134
136
|
|
|
135
137
|
<script setup lang="ts" generic="G extends CommandPaletteGroup<T>, T extends CommandPaletteItem">
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
-
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps } from 'reka-ui'
|
|
4
|
+
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuContentEmits } from 'reka-ui'
|
|
4
5
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
6
|
import _appConfig from '#build/app.config'
|
|
6
7
|
import theme from '#build/ui/context-menu'
|
|
7
8
|
import { tv } from '../utils/tv'
|
|
8
9
|
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
|
9
|
-
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
10
|
+
import type { DynamicSlots, PartialString, EmitsToProps } from '../types/utils'
|
|
10
11
|
|
|
11
12
|
const appConfigContextMenu = _appConfig as AppConfig & { ui: { contextMenu: Partial<typeof theme> } }
|
|
12
13
|
|
|
@@ -22,7 +23,7 @@ export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custo
|
|
|
22
23
|
icon?: string
|
|
23
24
|
color?: ContextMenuVariants['color']
|
|
24
25
|
avatar?: AvatarProps
|
|
25
|
-
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
26
|
+
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ContextMenuContentEmits>>
|
|
26
27
|
kbds?: KbdProps['value'][] | KbdProps[]
|
|
27
28
|
/**
|
|
28
29
|
* The item type.
|
|
@@ -66,7 +67,7 @@ export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'> {
|
|
|
66
67
|
*/
|
|
67
68
|
externalIcon?: boolean | string
|
|
68
69
|
/** The content of the menu. */
|
|
69
|
-
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
70
|
+
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ContextMenuContentEmits>>
|
|
70
71
|
/**
|
|
71
72
|
* Render the menu in a portal.
|
|
72
73
|
* @defaultValue true
|
|
@@ -93,6 +94,7 @@ export type ContextMenuSlots<T extends { slot?: string }> = {
|
|
|
93
94
|
'item-label': SlotProps<T>
|
|
94
95
|
'item-trailing': SlotProps<T>
|
|
95
96
|
} & DynamicSlots<T, SlotProps<T>>
|
|
97
|
+
|
|
96
98
|
</script>
|
|
97
99
|
|
|
98
100
|
<script setup lang="ts" generic="T extends ContextMenuItem">
|
|
@@ -112,7 +114,7 @@ const emits = defineEmits<ContextMenuEmits>()
|
|
|
112
114
|
const slots = defineSlots<ContextMenuSlots<T>>()
|
|
113
115
|
|
|
114
116
|
const rootProps = useForwardPropsEmits(reactivePick(props, 'modal'), emits)
|
|
115
|
-
const contentProps = toRef(() => props.content
|
|
117
|
+
const contentProps = toRef(() => props.content)
|
|
116
118
|
const proxySlots = omit(slots, ['default']) as Record<string, ContextMenuSlots<T>[string]>
|
|
117
119
|
|
|
118
120
|
const ui = computed(() => contextMenu({
|
|
@@ -138,7 +140,7 @@ const ui = computed(() => contextMenu({
|
|
|
138
140
|
:loading-icon="loadingIcon"
|
|
139
141
|
:external-icon="externalIcon"
|
|
140
142
|
>
|
|
141
|
-
<template v-for="(_, name) in proxySlots" #[name]="slotData
|
|
143
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
142
144
|
<slot :name="name" v-bind="slotData" />
|
|
143
145
|
</template>
|
|
144
146
|
</UContextMenuContent>
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { DrawerRootProps, DrawerRootEmits } from 'vaul-vue'
|
|
3
|
-
import type { DialogContentProps } from 'reka-ui'
|
|
3
|
+
import type { DialogContentProps, DialogContentEmits } from 'reka-ui'
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
5
|
import _appConfig from '#build/app.config'
|
|
6
6
|
import theme from '#build/ui/drawer'
|
|
7
7
|
import { tv } from '../utils/tv'
|
|
8
|
+
import type { EmitsToProps } from '../types/utils'
|
|
8
9
|
|
|
9
10
|
const appConfigDrawer = _appConfig as AppConfig & { ui: { drawer: Partial<typeof theme> } }
|
|
10
11
|
|
|
11
12
|
const drawer = tv({ extend: tv(theme), ...(appConfigDrawer.ui?.drawer || {}) })
|
|
12
13
|
|
|
13
|
-
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | '
|
|
14
|
+
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'shouldScaleBackground' | 'setBackgroundColorOnScale' | 'scrollLockTimeout' | 'fixed' | 'dismissible' | 'modal' | 'open' | 'defaultOpen' | 'nested' | 'direction' | 'noBodyStyles' | 'handleOnly' | 'preventScrollRestoration' | 'snapPoints'> {
|
|
14
15
|
/**
|
|
15
16
|
* The element or component this component should render as.
|
|
16
17
|
* @defaultValue 'div'
|
|
@@ -24,7 +25,7 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
|
|
|
24
25
|
*/
|
|
25
26
|
inset?: boolean
|
|
26
27
|
/** The content of the drawer. */
|
|
27
|
-
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
28
|
+
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>
|
|
28
29
|
/**
|
|
29
30
|
* Render an overlay behind the drawer.
|
|
30
31
|
* @defaultValue true
|
|
@@ -41,10 +42,9 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
|
|
|
41
42
|
*/
|
|
42
43
|
portal?: boolean
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @defaultValue true
|
|
45
|
+
* Index of a `snapPoint` from which the overlay fade should be applied. Defaults to the last snap point.
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
fadeFromIndex?: any
|
|
48
48
|
class?: any
|
|
49
49
|
ui?: Partial<typeof drawer.slots>
|
|
50
50
|
}
|
|
@@ -53,7 +53,6 @@ export interface DrawerEmits extends DrawerRootEmits {}
|
|
|
53
53
|
|
|
54
54
|
export interface DrawerSlots {
|
|
55
55
|
default(props?: {}): any
|
|
56
|
-
handle(props?: {}): any
|
|
57
56
|
content(props?: {}): any
|
|
58
57
|
header(props?: {}): any
|
|
59
58
|
title(props?: {}): any
|
|
@@ -66,19 +65,21 @@ export interface DrawerSlots {
|
|
|
66
65
|
<script setup lang="ts">
|
|
67
66
|
import { computed, toRef } from 'vue'
|
|
68
67
|
import { useForwardPropsEmits } from 'reka-ui'
|
|
69
|
-
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription } from 'vaul-vue'
|
|
68
|
+
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription, DrawerHandle } from 'vaul-vue'
|
|
70
69
|
import { reactivePick } from '@vueuse/core'
|
|
71
70
|
|
|
72
71
|
const props = withDefaults(defineProps<DrawerProps>(), {
|
|
73
72
|
direction: 'bottom',
|
|
74
73
|
portal: true,
|
|
75
74
|
overlay: true,
|
|
76
|
-
handle: true
|
|
75
|
+
handle: true,
|
|
76
|
+
modal: true,
|
|
77
|
+
dismissible: true
|
|
77
78
|
})
|
|
78
79
|
const emits = defineEmits<DrawerEmits>()
|
|
79
80
|
const slots = defineSlots<DrawerSlots>()
|
|
80
81
|
|
|
81
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', '
|
|
82
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', 'shouldScaleBackground', 'setBackgroundColorOnScale', 'scrollLockTimeout', 'fixed', 'dismissible', 'modal', 'open', 'defaultOpen', 'nested', 'direction', 'noBodyStyles', 'handleOnly', 'preventScrollRestoration', 'snapPoints', 'fadeFromIndex'), emits)
|
|
82
83
|
const contentProps = toRef(() => props.content)
|
|
83
84
|
const contentEvents = {
|
|
84
85
|
closeAutoFocus: (e: Event) => e.preventDefault()
|
|
@@ -100,9 +101,7 @@ const ui = computed(() => drawer({
|
|
|
100
101
|
<DrawerOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
|
101
102
|
|
|
102
103
|
<DrawerContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" v-on="contentEvents">
|
|
103
|
-
<
|
|
104
|
-
<div v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
|
|
105
|
-
</slot>
|
|
104
|
+
<DrawerHandle v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
|
|
106
105
|
|
|
107
106
|
<slot name="content">
|
|
108
107
|
<div :class="ui.container({ class: props.ui?.container })">
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
-
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps } from 'reka-ui'
|
|
4
|
+
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuContentEmits, DropdownMenuArrowProps } from 'reka-ui'
|
|
4
5
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
6
|
import _appConfig from '#build/app.config'
|
|
6
7
|
import theme from '#build/ui/dropdown-menu'
|
|
7
8
|
import { tv } from '../utils/tv'
|
|
8
9
|
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
|
9
|
-
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
10
|
+
import type { DynamicSlots, PartialString, EmitsToProps } from '../types/utils'
|
|
10
11
|
|
|
11
12
|
const appConfigDropdownMenu = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }
|
|
12
13
|
|
|
@@ -22,7 +23,7 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
|
|
|
22
23
|
icon?: string
|
|
23
24
|
color?: DropdownMenuVariants['color']
|
|
24
25
|
avatar?: AvatarProps
|
|
25
|
-
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
26
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
|
|
26
27
|
kbds?: KbdProps['value'][] | KbdProps[]
|
|
27
28
|
/**
|
|
28
29
|
* The item type.
|
|
@@ -69,7 +70,7 @@ export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>
|
|
|
69
70
|
* The content of the menu.
|
|
70
71
|
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
71
72
|
*/
|
|
72
|
-
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
73
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
|
|
73
74
|
/**
|
|
74
75
|
* Display an arrow alongside the menu.
|
|
75
76
|
* @defaultValue false
|
|
@@ -101,6 +102,7 @@ export type DropdownMenuSlots<T extends { slot?: string }> = {
|
|
|
101
102
|
'item-label': SlotProps<T>
|
|
102
103
|
'item-trailing': SlotProps<T>
|
|
103
104
|
} & DynamicSlots<T, SlotProps<T>>
|
|
105
|
+
|
|
104
106
|
</script>
|
|
105
107
|
|
|
106
108
|
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
@@ -148,7 +150,7 @@ const ui = computed(() => dropdownMenu({
|
|
|
148
150
|
:loading-icon="loadingIcon"
|
|
149
151
|
:external-icon="externalIcon"
|
|
150
152
|
>
|
|
151
|
-
<template v-for="(_, name) in proxySlots" #[name]="slotData
|
|
153
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
152
154
|
<slot :name="name" v-bind="slotData" />
|
|
153
155
|
</template>
|
|
154
156
|
|
|
@@ -12,14 +12,34 @@ const form = tv({ extend: tv(theme), ...(appConfigForm.ui?.form || {}) })
|
|
|
12
12
|
|
|
13
13
|
export interface FormProps<T extends object> {
|
|
14
14
|
id?: string | number
|
|
15
|
+
/** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
|
|
15
16
|
schema?: FormSchema<T>
|
|
17
|
+
/** An object representing the current state of the form. */
|
|
16
18
|
state: Partial<T>
|
|
19
|
+
/**
|
|
20
|
+
* Custom validation function to validate the form state.
|
|
21
|
+
* @param state - The current state of the form.
|
|
22
|
+
* @returns A promise that resolves to an array of FormError objects, or an array of FormError objects directly.
|
|
23
|
+
*/
|
|
17
24
|
validate?: (state: Partial<T>) => Promise<FormError[]> | FormError[]
|
|
25
|
+
/**
|
|
26
|
+
* The list of input events that trigger the form validation.
|
|
27
|
+
* @defaultValue `['blur', 'change', 'input']`
|
|
28
|
+
*/
|
|
18
29
|
validateOn?: FormInputEvents[]
|
|
30
|
+
/** Disable all inputs inside the form. */
|
|
19
31
|
disabled?: boolean
|
|
32
|
+
/**
|
|
33
|
+
* Delay in milliseconds before validating the form on input events.
|
|
34
|
+
* @defaultValue `300`
|
|
35
|
+
*/
|
|
20
36
|
validateOnInputDelay?: number
|
|
21
|
-
|
|
37
|
+
/**
|
|
38
|
+
* If true, schema transformations will be applied to the state on submit.
|
|
39
|
+
* @defaultValue `true`
|
|
40
|
+
*/
|
|
22
41
|
transform?: boolean
|
|
42
|
+
class?: any
|
|
23
43
|
onSubmit?: ((event: FormSubmitEvent<T>) => void | Promise<void>) | (() => void | Promise<void>)
|
|
24
44
|
}
|
|
25
45
|
|
|
@@ -31,7 +31,12 @@ export interface FormFieldProps {
|
|
|
31
31
|
*/
|
|
32
32
|
size?: FormFieldVariants['size']
|
|
33
33
|
required?: boolean
|
|
34
|
+
/** If true, validation on input will be active immediately instead of waiting for a blur event. */
|
|
34
35
|
eagerValidation?: boolean
|
|
36
|
+
/**
|
|
37
|
+
* Delay in milliseconds before validating the form on input events.
|
|
38
|
+
* @defaultValue `300`
|
|
39
|
+
*/
|
|
35
40
|
validateOnInputDelay?: number
|
|
36
41
|
class?: any
|
|
37
42
|
ui?: Partial<typeof formField.slots>
|