@una-ui/nuxt 0.3.0-beta.1 → 0.4.0-beta.5
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 +10 -1
- package/dist/module.d.mts +35 -0
- package/dist/module.d.ts +11 -7
- package/dist/module.json +1 -1
- package/dist/module.mjs +12 -40
- package/dist/runtime/components/elements/Alert.vue +3 -2
- package/dist/runtime/components/elements/Link.vue +34 -3
- package/dist/runtime/components/elements/Link.vue.d.ts +8 -0
- package/dist/runtime/components/forms/Input.vue +49 -9
- package/dist/runtime/components/misc/ThemeSwitcher.vue +43 -40
- package/dist/runtime/components/navigation/NavLink.vue +36 -8
- package/dist/runtime/composables/useUnaSettings.d.ts +1 -0
- package/dist/runtime/composables/useUnaSettings.mjs +30 -0
- package/dist/runtime/composables/useUnaThemes.d.ts +7 -0
- package/dist/runtime/composables/{themes.mjs → useUnaThemes.mjs} +31 -17
- package/dist/runtime/plugins/theme.client.d.ts +0 -3
- package/dist/runtime/plugins/theme.client.mjs +4 -9
- package/dist/runtime/plugins/theme.server.mjs +6 -1
- package/dist/runtime/types/accordion.d.ts +15 -15
- package/dist/runtime/types/alert.d.ts +6 -6
- package/dist/runtime/types/avatar-group.d.ts +3 -3
- package/dist/runtime/types/avatar.d.ts +9 -9
- package/dist/runtime/types/badge.d.ts +4 -4
- package/dist/runtime/types/button.d.ts +10 -10
- package/dist/runtime/types/checkbox.d.ts +9 -9
- package/dist/runtime/types/form-group.d.ts +10 -10
- package/dist/runtime/types/icon.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +23 -0
- package/dist/runtime/types/indicator.d.ts +9 -9
- package/dist/runtime/types/input.d.ts +42 -13
- package/dist/runtime/types/kbd.d.ts +3 -3
- package/dist/runtime/types/link.d.ts +13 -4
- package/dist/runtime/types/nav-link.d.ts +10 -1
- package/dist/runtime/types/radio.d.ts +11 -11
- package/dist/runtime/types/switch.d.ts +8 -8
- package/dist/runtime/utils/index.d.ts +12 -12
- package/dist/types.d.mts +16 -0
- package/dist/types.d.ts +3 -2
- package/dist/una.config.d.mts +5 -0
- package/dist/una.config.d.ts +5 -0
- package/dist/una.config.mjs +35 -0
- package/package.json +23 -19
- package/playground/.nuxt/components.d.ts +196 -0
- package/playground/.nuxt/imports.d.ts +27 -0
- package/playground/.nuxt/nuxt.d.ts +18 -0
- package/playground/.nuxt/schema/nuxt.schema.d.ts +17 -0
- package/playground/.nuxt/types/app.config.d.ts +37 -0
- package/playground/.nuxt/types/imports.d.ts +1066 -0
- package/playground/.nuxt/types/nitro-config.d.ts +14 -0
- package/playground/.nuxt/types/nitro-imports.d.ts +121 -0
- package/playground/.nuxt/types/nitro-nuxt.d.ts +26 -0
- package/playground/.nuxt/types/nitro-routes.d.ts +11 -0
- package/playground/.nuxt/types/nitro.d.ts +3 -0
- package/playground/.nuxt/types/plugins.d.ts +30 -0
- package/playground/.nuxt/types/schema.d.ts +29 -0
- package/playground/.nuxt/types/vue-shim.d.ts +5 -0
- package/playground/.nuxt/vue-router-stub.d.ts +1 -0
- package/una.config.d.ts +1 -0
- package/dist/runtime/composables/themes.d.ts +0 -7
|
@@ -99,21 +99,35 @@ const filteredColors = {
|
|
|
99
99
|
...filteredPrimaryColors,
|
|
100
100
|
...filteredGrayColors
|
|
101
101
|
};
|
|
102
|
-
export function
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
export function useUnaThemes() {
|
|
103
|
+
const primaryThemes = Object.entries(filteredPrimaryColors).map(([color]) => [
|
|
104
|
+
color,
|
|
105
|
+
getColors(color, "primary")
|
|
106
|
+
]);
|
|
107
|
+
const grayThemes = Object.entries(filteredGrayColors).map(([color]) => [
|
|
108
|
+
color,
|
|
109
|
+
getColors(color, "gray")
|
|
110
|
+
]);
|
|
111
|
+
function getColors(color, prefix) {
|
|
112
|
+
const colorPalette = filteredColors[color];
|
|
113
|
+
if (!colorPalette)
|
|
114
|
+
throw new Error(`Invalid primary color: ${color}`);
|
|
115
|
+
const colors2 = {};
|
|
116
|
+
colors2[`--una-${prefix}-hex`] = colorPalette[600];
|
|
117
|
+
for (const shade of Object.keys(colorPalette))
|
|
118
|
+
colors2[`--una-${prefix}-${shade}`] = hexToRgb(colorPalette[shade]).join(", ");
|
|
119
|
+
return colors2;
|
|
120
|
+
}
|
|
121
|
+
function getPrimaryColors(color) {
|
|
122
|
+
return primaryThemes.filter(([colorName, _]) => colorName === color)[0][1];
|
|
123
|
+
}
|
|
124
|
+
function getGrayColors(color) {
|
|
125
|
+
return grayThemes.filter(([colorName, _]) => colorName === color)[0][1];
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
primaryThemes,
|
|
129
|
+
grayThemes,
|
|
130
|
+
getPrimaryColors,
|
|
131
|
+
getGrayColors
|
|
132
|
+
};
|
|
111
133
|
}
|
|
112
|
-
export const primaryThemes = Object.entries(filteredPrimaryColors).map(([color]) => [
|
|
113
|
-
color,
|
|
114
|
-
getColors(color, "primary")
|
|
115
|
-
]);
|
|
116
|
-
export const grayThemes = Object.entries(filteredGrayColors).map(([color]) => [
|
|
117
|
-
color,
|
|
118
|
-
getColors(color, "gray")
|
|
119
|
-
]);
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { useStorage } from "@vueuse/core";
|
|
2
1
|
import { watchEffect } from "vue";
|
|
2
|
+
import { useUnaSettings } from "../composables/useUnaSettings.mjs";
|
|
3
3
|
import { defineNuxtPlugin } from "#app";
|
|
4
4
|
let unaUIStyle;
|
|
5
5
|
export default defineNuxtPlugin(() => {
|
|
6
|
-
const settings =
|
|
7
|
-
primaryColors: void 0,
|
|
8
|
-
grayColors: void 0
|
|
9
|
-
// fontSize: 16, TODO: add font size
|
|
10
|
-
// --font-size: ${settings.value.fontSize}px; TODO: add font size
|
|
11
|
-
});
|
|
6
|
+
const { settings } = useUnaSettings();
|
|
12
7
|
unaUIStyle = document.createElement("style");
|
|
13
|
-
unaUIStyle.id = "una-ui";
|
|
8
|
+
unaUIStyle.id = "una-ui-colors";
|
|
14
9
|
document.head.appendChild(unaUIStyle);
|
|
15
10
|
const html = document.documentElement;
|
|
16
11
|
html.removeAttribute("style");
|
|
17
12
|
watchEffect(() => {
|
|
18
|
-
const styleTag = document.getElementById("una-ui");
|
|
13
|
+
const styleTag = document.getElementById("una-ui-colors");
|
|
19
14
|
if (styleTag) {
|
|
20
15
|
styleTag.innerHTML = `
|
|
21
16
|
:root {
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { useUnaSettings } from "../composables/useUnaSettings.mjs";
|
|
1
2
|
import { defineNuxtPlugin, useHead } from "#app";
|
|
2
3
|
export default defineNuxtPlugin(() => {
|
|
4
|
+
const { defaultSettings } = useUnaSettings();
|
|
3
5
|
useHead({
|
|
4
6
|
script: [
|
|
5
7
|
{
|
|
6
8
|
innerHTML: `
|
|
7
9
|
;(function() {
|
|
8
10
|
const settings = JSON.parse(localStorage.getItem('una-settings'))
|
|
9
|
-
|
|
11
|
+
|
|
12
|
+
if (!settings) {
|
|
13
|
+
settings = ${JSON.stringify(defaultSettings)}
|
|
14
|
+
}
|
|
10
15
|
|
|
11
16
|
const html = document.documentElement
|
|
12
17
|
${process.dev ? "console.log({ settings })" : ""}
|
|
@@ -6,35 +6,35 @@ export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
|
|
|
6
6
|
*
|
|
7
7
|
* By default, we don't add any options or variants to the accordion,
|
|
8
8
|
* But you can add your own in the configuration file.
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
accordion?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Update leading icon when accordion button item is open,
|
|
13
13
|
* Accepts icon name and utility classes
|
|
14
|
-
|
|
14
|
+
*/
|
|
15
15
|
trailingOpen?: string;
|
|
16
16
|
/**
|
|
17
17
|
* Update leading icon when accordion button item is closed,
|
|
18
18
|
* Accepts icon name and utility classes
|
|
19
|
-
|
|
19
|
+
*/
|
|
20
20
|
trailingClose?: string;
|
|
21
21
|
/**
|
|
22
22
|
* Allow multiple accordion items to be open at the same time
|
|
23
23
|
*
|
|
24
24
|
* @default false
|
|
25
|
-
|
|
25
|
+
*/
|
|
26
26
|
multiple?: boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Allow accordion item to be open by default
|
|
29
29
|
*
|
|
30
30
|
* @default false
|
|
31
|
-
|
|
31
|
+
*/
|
|
32
32
|
defaultOpen?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Removes border and divider from accordion
|
|
35
35
|
*
|
|
36
36
|
* @default false
|
|
37
|
-
|
|
37
|
+
*/
|
|
38
38
|
unstyle?: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* By default, the accordion is unmounted for performance reasons,
|
|
@@ -42,20 +42,20 @@ export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
|
|
|
42
42
|
* If you want to render the accordion when the page loads, you can use the `mounted` prop.
|
|
43
43
|
*
|
|
44
44
|
* @default false
|
|
45
|
-
|
|
45
|
+
*/
|
|
46
46
|
mounted?: boolean;
|
|
47
47
|
/**
|
|
48
48
|
* List of items to be rendered,
|
|
49
49
|
* It extends the `NButtonProps` interface
|
|
50
50
|
*
|
|
51
51
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/nuxt/src/runtime/types/button.ts
|
|
52
|
-
|
|
52
|
+
*/
|
|
53
53
|
items: NAccordionItemProps[];
|
|
54
54
|
/**
|
|
55
55
|
* `UnaUI` preset configuration
|
|
56
56
|
*
|
|
57
57
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/accordion.ts
|
|
58
|
-
|
|
58
|
+
*/
|
|
59
59
|
una?: {
|
|
60
60
|
accordion?: string;
|
|
61
61
|
accordionItem?: string;
|
|
@@ -72,7 +72,7 @@ export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
|
|
|
72
72
|
export interface NAccordionItemProps extends NButtonProps {
|
|
73
73
|
/**
|
|
74
74
|
* Accordion item content
|
|
75
|
-
|
|
75
|
+
*/
|
|
76
76
|
content?: string;
|
|
77
77
|
/**
|
|
78
78
|
* Update item leading icon when accordion button item is open,
|
|
@@ -80,7 +80,7 @@ export interface NAccordionItemProps extends NButtonProps {
|
|
|
80
80
|
*
|
|
81
81
|
* @example
|
|
82
82
|
* trailingOpen='i-heroicons-information-circle text-info'
|
|
83
|
-
|
|
83
|
+
*/
|
|
84
84
|
trailingOpen?: string;
|
|
85
85
|
/**
|
|
86
86
|
* Update item leading icon when accordion button item is closed,
|
|
@@ -88,25 +88,25 @@ export interface NAccordionItemProps extends NButtonProps {
|
|
|
88
88
|
*
|
|
89
89
|
* @example
|
|
90
90
|
* trailingClose='i-heroicons-information-circle text-info'
|
|
91
|
-
|
|
91
|
+
*/
|
|
92
92
|
trailingClose?: string;
|
|
93
93
|
/**
|
|
94
94
|
* Allow accordion item to be open by default
|
|
95
95
|
*
|
|
96
96
|
* @default false
|
|
97
|
-
|
|
97
|
+
*/
|
|
98
98
|
defaultOpen?: boolean;
|
|
99
99
|
/**
|
|
100
100
|
* Close other accordion items when item is open
|
|
101
101
|
*
|
|
102
102
|
* @default false
|
|
103
|
-
|
|
103
|
+
*/
|
|
104
104
|
closeOthers?: boolean;
|
|
105
105
|
/**
|
|
106
106
|
* By default, all the accordion item is unmounted for performance reasons,
|
|
107
107
|
* You can use the `mounted` prop to render the accordion specific on item.
|
|
108
108
|
*
|
|
109
109
|
* @default false
|
|
110
|
-
|
|
110
|
+
*/
|
|
111
111
|
mounted?: boolean;
|
|
112
112
|
}
|
|
@@ -6,7 +6,7 @@ export interface NAlertProps {
|
|
|
6
6
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/alert.ts
|
|
7
7
|
* @example
|
|
8
8
|
* alert="outline-pink"
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
alert?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Add icon to the alert,
|
|
@@ -17,27 +17,27 @@ export interface NAlertProps {
|
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* icon="i-heroicons-information-circle"
|
|
20
|
-
|
|
20
|
+
*/
|
|
21
21
|
icon?: string | boolean;
|
|
22
22
|
/**
|
|
23
23
|
* Add a close button to the alert.
|
|
24
24
|
*
|
|
25
25
|
* @default false
|
|
26
|
-
|
|
26
|
+
*/
|
|
27
27
|
closable?: boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Add a title to the alert.
|
|
30
|
-
|
|
30
|
+
*/
|
|
31
31
|
title?: string;
|
|
32
32
|
/**
|
|
33
33
|
* Add a description to the alert.
|
|
34
|
-
|
|
34
|
+
*/
|
|
35
35
|
description?: string;
|
|
36
36
|
/**
|
|
37
37
|
* `UnaUI` preset configuration
|
|
38
38
|
*
|
|
39
39
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/alert.ts
|
|
40
|
-
|
|
40
|
+
*/
|
|
41
41
|
una?: {
|
|
42
42
|
alert?: string;
|
|
43
43
|
alertTitle?: string;
|
|
@@ -3,20 +3,20 @@ import type { NAvatarProps } from './avatar';
|
|
|
3
3
|
* This extends the `NAvatarProps` interface.
|
|
4
4
|
*
|
|
5
5
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/nuxt/src/runtime/types/avatar.ts
|
|
6
|
-
*/
|
|
6
|
+
*/
|
|
7
7
|
export interface NAvatarGroupProps extends Omit<NAvatarProps, 'una'> {
|
|
8
8
|
/**
|
|
9
9
|
* Set the maximum number of avatars to show.
|
|
10
10
|
*
|
|
11
11
|
* @default 3
|
|
12
|
-
|
|
12
|
+
*/
|
|
13
13
|
max: number;
|
|
14
14
|
/**
|
|
15
15
|
* `Una
|
|
16
16
|
*
|
|
17
17
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar-group.ts
|
|
18
18
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar.ts
|
|
19
|
-
|
|
19
|
+
*/
|
|
20
20
|
una?: {
|
|
21
21
|
avatarGroup?: string;
|
|
22
22
|
avatarGroupChild?: string;
|
|
@@ -6,60 +6,60 @@ export interface NAvatarProps {
|
|
|
6
6
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar.ts
|
|
7
7
|
* @example
|
|
8
8
|
* avatar="solid-green"
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
avatar?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Add icon instead of image.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* icon="i-heroicons-information-circle"
|
|
16
|
-
|
|
16
|
+
*/
|
|
17
17
|
icon?: string;
|
|
18
18
|
/**
|
|
19
19
|
* Add a label to the avatar.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* label="PR"
|
|
23
|
-
|
|
23
|
+
*/
|
|
24
24
|
label?: string;
|
|
25
25
|
/**
|
|
26
26
|
* Add src of the image.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* src="https://i.pravatar.cc/300"
|
|
30
|
-
|
|
30
|
+
*/
|
|
31
31
|
src?: string;
|
|
32
32
|
/**
|
|
33
33
|
* Add alt of the image.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* alt="Profile"
|
|
37
|
-
|
|
37
|
+
*/
|
|
38
38
|
alt?: string;
|
|
39
39
|
/**
|
|
40
40
|
* Add fallback of the image.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* fallback="https://i.pravatar.cc/300"
|
|
44
|
-
|
|
44
|
+
*/
|
|
45
45
|
fallback?: string;
|
|
46
46
|
/**
|
|
47
47
|
* Add a delay before showing the avatar.
|
|
48
48
|
*
|
|
49
49
|
* @default 0
|
|
50
|
-
|
|
50
|
+
*/
|
|
51
51
|
delay?: number;
|
|
52
52
|
/**
|
|
53
53
|
* Add a skeleton effect to the avatar.
|
|
54
54
|
*
|
|
55
55
|
* @default false
|
|
56
|
-
|
|
56
|
+
*/
|
|
57
57
|
skeleton?: boolean;
|
|
58
58
|
/**
|
|
59
59
|
* `UnaUI` preset configuration
|
|
60
60
|
*
|
|
61
61
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar.ts
|
|
62
|
-
|
|
62
|
+
*/
|
|
63
63
|
una?: {
|
|
64
64
|
avatar?: string;
|
|
65
65
|
avatarLabel?: string;
|
|
@@ -6,11 +6,11 @@ export interface NBadgeProps {
|
|
|
6
6
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/badge.ts
|
|
7
7
|
* @example
|
|
8
8
|
* badge="solid-yellow"
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
badge?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Add a label to the badge.
|
|
13
|
-
|
|
13
|
+
*/
|
|
14
14
|
label?: string;
|
|
15
15
|
/**
|
|
16
16
|
* Display an icon on the left side of the badge,
|
|
@@ -24,13 +24,13 @@ export interface NBadgeProps {
|
|
|
24
24
|
* Display `close` icon on the right side of the badge,
|
|
25
25
|
*
|
|
26
26
|
* @default false
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
closable?: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* `UnaUI` preset configuration
|
|
31
31
|
*
|
|
32
32
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/badge.ts
|
|
33
|
-
|
|
33
|
+
*/
|
|
34
34
|
una?: {
|
|
35
35
|
badgeDefaultVariant?: string;
|
|
36
36
|
badge?: string;
|
|
@@ -3,13 +3,13 @@ export interface NButtonProps {
|
|
|
3
3
|
* Change the button type.
|
|
4
4
|
*
|
|
5
5
|
* @default 'button'
|
|
6
|
-
|
|
6
|
+
*/
|
|
7
7
|
type?: 'button' | 'submit' | 'reset';
|
|
8
8
|
/**
|
|
9
9
|
* Change the loading placement of the button.
|
|
10
10
|
*
|
|
11
11
|
* @default 'leading'
|
|
12
|
-
|
|
12
|
+
*/
|
|
13
13
|
loadingPlacement?: 'leading' | 'trailing' | 'label';
|
|
14
14
|
/**
|
|
15
15
|
* Convert `label` prop to icon component.
|
|
@@ -18,24 +18,24 @@ export interface NButtonProps {
|
|
|
18
18
|
* @example
|
|
19
19
|
* icon
|
|
20
20
|
* label="i-heroicons-information-circle"
|
|
21
|
-
|
|
21
|
+
*/
|
|
22
22
|
icon?: boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Disable the button.
|
|
25
25
|
*
|
|
26
26
|
* @default false
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Swap the position of the leading and trailing icons.
|
|
31
31
|
*
|
|
32
32
|
* @default false
|
|
33
|
-
|
|
33
|
+
*/
|
|
34
34
|
reverse?: boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Show loading state on button
|
|
37
37
|
* @default false
|
|
38
|
-
|
|
38
|
+
*/
|
|
39
39
|
loading?: boolean;
|
|
40
40
|
/**
|
|
41
41
|
* Change the button tag to `NuxtLink` component,
|
|
@@ -44,14 +44,14 @@ export interface NButtonProps {
|
|
|
44
44
|
* @see https://nuxt.com/docs/api/components/nuxt-link#props
|
|
45
45
|
* @example
|
|
46
46
|
* to="/"
|
|
47
|
-
|
|
47
|
+
*/
|
|
48
48
|
to?: string;
|
|
49
49
|
/**
|
|
50
50
|
* Add a label to the button.
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* label="Click me"
|
|
54
|
-
|
|
54
|
+
*/
|
|
55
55
|
label?: string;
|
|
56
56
|
/**
|
|
57
57
|
* Allows you to add `UnaUI` button preset properties,
|
|
@@ -60,7 +60,7 @@ export interface NButtonProps {
|
|
|
60
60
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/button.ts
|
|
61
61
|
* @example
|
|
62
62
|
* btn="solid-green block square"
|
|
63
|
-
|
|
63
|
+
*/
|
|
64
64
|
btn?: string;
|
|
65
65
|
/**
|
|
66
66
|
* Add leading icon the button,
|
|
@@ -82,7 +82,7 @@ export interface NButtonProps {
|
|
|
82
82
|
* `UnaUI` preset configuration
|
|
83
83
|
*
|
|
84
84
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/button.ts
|
|
85
|
-
|
|
85
|
+
*/
|
|
86
86
|
una?: {
|
|
87
87
|
btnDefaultVariant?: string;
|
|
88
88
|
btn?: string;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
export interface NCheckboxProps {
|
|
2
2
|
/**
|
|
3
3
|
* v-model binding value if the checkbox is checked.
|
|
4
|
-
|
|
4
|
+
*/
|
|
5
5
|
modelValue?: boolean | null;
|
|
6
6
|
/**
|
|
7
7
|
* Disable the checkbox.
|
|
8
|
-
|
|
8
|
+
*/
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Switch the position of label and checkbox.
|
|
12
|
-
|
|
12
|
+
*/
|
|
13
13
|
reverse?: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Allows you to add `UnaUI` checkbox preset properties,
|
|
16
16
|
* Think of it as a shortcut for adding options or variants to the preset if available.
|
|
17
|
-
|
|
17
|
+
*/
|
|
18
18
|
checkbox?: string;
|
|
19
19
|
/**
|
|
20
20
|
* Add name attribute to the checkbox.
|
|
21
21
|
*
|
|
22
22
|
* @default null
|
|
23
|
-
|
|
23
|
+
*/
|
|
24
24
|
name?: string;
|
|
25
25
|
/**
|
|
26
26
|
* Manually set the id attribute.
|
|
27
27
|
* By default, the id attribute is generated randomly for accessibility reasons.
|
|
28
28
|
*
|
|
29
29
|
* @default randomId
|
|
30
|
-
|
|
30
|
+
*/
|
|
31
31
|
id?: string;
|
|
32
32
|
/**
|
|
33
33
|
* Manually set the for attribute.
|
|
@@ -37,13 +37,13 @@ export interface NCheckboxProps {
|
|
|
37
37
|
* @default randomId
|
|
38
38
|
* @example
|
|
39
39
|
* for="options"
|
|
40
|
-
|
|
40
|
+
*/
|
|
41
41
|
for?: string;
|
|
42
42
|
/**
|
|
43
43
|
* Display label text.
|
|
44
44
|
*
|
|
45
45
|
* @default null
|
|
46
|
-
|
|
46
|
+
*/
|
|
47
47
|
label?: string;
|
|
48
48
|
/**
|
|
49
49
|
* Allows you to change the size of the checkbox.
|
|
@@ -52,7 +52,7 @@ export interface NCheckboxProps {
|
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* size="sm" | size="2cm" | size="2rem" | size="2px"
|
|
55
|
-
|
|
55
|
+
*/
|
|
56
56
|
size?: string;
|
|
57
57
|
/**
|
|
58
58
|
* `UnaUI` preset configuration
|
|
@@ -3,13 +3,13 @@ export interface NFormGroupProps {
|
|
|
3
3
|
* Update the form group status.
|
|
4
4
|
*
|
|
5
5
|
* @default null
|
|
6
|
-
|
|
6
|
+
*/
|
|
7
7
|
status?: 'info' | 'success' | 'warning' | 'error';
|
|
8
8
|
/**
|
|
9
9
|
* Add a required indicator to the form group.
|
|
10
10
|
*
|
|
11
11
|
* @default false
|
|
12
|
-
|
|
12
|
+
*/
|
|
13
13
|
required?: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Manually set the for attribute.
|
|
@@ -20,7 +20,7 @@ export interface NFormGroupProps {
|
|
|
20
20
|
* @default randomId
|
|
21
21
|
* @example
|
|
22
22
|
* for="email"
|
|
23
|
-
|
|
23
|
+
*/
|
|
24
24
|
for?: string | boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Manually set the id attribute.
|
|
@@ -30,28 +30,28 @@ export interface NFormGroupProps {
|
|
|
30
30
|
* @default randomId
|
|
31
31
|
* @example
|
|
32
32
|
* id="email"
|
|
33
|
-
|
|
33
|
+
*/
|
|
34
34
|
id?: string;
|
|
35
35
|
/**
|
|
36
36
|
* Label for the form group.
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* label="Email"
|
|
40
|
-
|
|
40
|
+
*/
|
|
41
41
|
label?: string;
|
|
42
42
|
/**
|
|
43
43
|
* Display `hint` message for the form group.
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* hint="Enter your email address"
|
|
47
|
-
|
|
47
|
+
*/
|
|
48
48
|
hint?: string;
|
|
49
49
|
/**
|
|
50
50
|
* Display `Description` message for the form group.
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* description="We will never share your email with anyone else."
|
|
54
|
-
|
|
54
|
+
*/
|
|
55
55
|
description?: string;
|
|
56
56
|
/**
|
|
57
57
|
* Display `Message` for the form group.
|
|
@@ -59,7 +59,7 @@ export interface NFormGroupProps {
|
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
61
61
|
* message="Email is required"
|
|
62
|
-
|
|
62
|
+
*/
|
|
63
63
|
message?: string;
|
|
64
64
|
/**
|
|
65
65
|
* Display `counter` for the form group.
|
|
@@ -67,7 +67,7 @@ export interface NFormGroupProps {
|
|
|
67
67
|
*
|
|
68
68
|
* @example
|
|
69
69
|
* counter="{ value: 0, max: 100 }"
|
|
70
|
-
|
|
70
|
+
*/
|
|
71
71
|
counter?: {
|
|
72
72
|
value: number;
|
|
73
73
|
max?: number;
|
|
@@ -76,7 +76,7 @@ export interface NFormGroupProps {
|
|
|
76
76
|
* `UnaUI` preset configuration
|
|
77
77
|
*
|
|
78
78
|
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/form-group.ts
|
|
79
|
-
|
|
79
|
+
*/
|
|
80
80
|
una?: {
|
|
81
81
|
formGroupTopWrapper?: string;
|
|
82
82
|
formGroupTopWrapperInner?: string;
|
|
@@ -15,3 +15,26 @@ export * from './nav-link-group';
|
|
|
15
15
|
export * from './link';
|
|
16
16
|
export * from './radio';
|
|
17
17
|
export * from './checkbox';
|
|
18
|
+
export interface Colors {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ColorPalette {
|
|
22
|
+
50: string;
|
|
23
|
+
100: string;
|
|
24
|
+
200: string;
|
|
25
|
+
300: string;
|
|
26
|
+
400: string;
|
|
27
|
+
500: string;
|
|
28
|
+
600: string;
|
|
29
|
+
700: string;
|
|
30
|
+
800: string;
|
|
31
|
+
900: string;
|
|
32
|
+
950: string;
|
|
33
|
+
}
|
|
34
|
+
export interface UnaSettings {
|
|
35
|
+
primaryColors: Colors;
|
|
36
|
+
grayColors: Colors;
|
|
37
|
+
primary: string;
|
|
38
|
+
gray: string;
|
|
39
|
+
fontSize: number;
|
|
40
|
+
}
|