nuance-ui 0.2.9 → 0.2.11
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/dist/module.json +1 -1
- package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +11 -10
- package/dist/runtime/components/action-icon/action-icon-section.vue +17 -20
- package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +11 -10
- package/dist/runtime/components/action-icon/action-icon.d.vue.ts +17 -14
- package/dist/runtime/components/action-icon/action-icon.vue +18 -17
- package/dist/runtime/components/action-icon/action-icon.vue.d.ts +17 -14
- package/dist/runtime/components/alert.d.vue.ts +8 -6
- package/dist/runtime/components/alert.vue +15 -101
- package/dist/runtime/components/alert.vue.d.ts +8 -6
- package/dist/runtime/components/app-shell/app-shell-aside.vue +2 -28
- package/dist/runtime/components/app-shell/app-shell-footer.vue +2 -27
- package/dist/runtime/components/app-shell/app-shell-header.vue +2 -28
- package/dist/runtime/components/app-shell/app-shell-main.vue +2 -16
- package/dist/runtime/components/app-shell/app-shell-navbar.vue +2 -32
- package/dist/runtime/components/app-shell/app-shell-section.vue +2 -8
- package/dist/runtime/components/app-shell/app-shell.vue +20 -44
- package/dist/runtime/components/avatar/avatar-group.d.vue.ts +2 -2
- package/dist/runtime/components/avatar/avatar-group.vue +1 -1
- package/dist/runtime/components/avatar/avatar-group.vue.d.ts +2 -2
- package/dist/runtime/components/avatar/avatar.d.vue.ts +9 -5
- package/dist/runtime/components/avatar/avatar.vue +26 -26
- package/dist/runtime/components/avatar/avatar.vue.d.ts +9 -5
- package/dist/runtime/components/background-image.d.vue.ts +2 -2
- package/dist/runtime/components/background-image.vue +3 -19
- package/dist/runtime/components/background-image.vue.d.ts +2 -2
- package/dist/runtime/components/badge.d.vue.ts +9 -8
- package/dist/runtime/components/badge.vue +18 -154
- package/dist/runtime/components/badge.vue.d.ts +9 -8
- package/dist/runtime/components/breadcrumbs.d.vue.ts +4 -4
- package/dist/runtime/components/breadcrumbs.vue +2 -48
- package/dist/runtime/components/breadcrumbs.vue.d.ts +4 -4
- package/dist/runtime/components/button/button.d.vue.ts +21 -26
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +36 -42
- package/dist/runtime/components/button/button.vue.d.ts +21 -26
- package/dist/runtime/components/button/unstyled-button.vue +2 -21
- package/dist/runtime/components/calendar/calendar.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/calendar.vue +3 -10
- package/dist/runtime/components/calendar/calendar.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +3 -114
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-header.vue +2 -67
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +3 -25
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +9 -34
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +3 -25
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox-card.vue +2 -28
- package/dist/runtime/components/checkbox/checkbox-group.vue +3 -3
- package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +5 -4
- package/dist/runtime/components/checkbox/checkbox-indicator.vue +15 -123
- package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +5 -4
- package/dist/runtime/components/checkbox/checkbox.d.vue.ts +5 -7
- package/dist/runtime/components/checkbox/checkbox.vue +30 -136
- package/dist/runtime/components/checkbox/checkbox.vue.d.ts +5 -7
- package/dist/runtime/components/chip/chip.d.vue.ts +3 -2
- package/dist/runtime/components/chip/chip.vue +29 -212
- package/dist/runtime/components/chip/chip.vue.d.ts +3 -2
- package/dist/runtime/components/combobox/combobox-dropdown.vue +2 -4
- package/dist/runtime/components/container.d.vue.ts +2 -2
- package/dist/runtime/components/container.vue +1 -1
- package/dist/runtime/components/container.vue.d.ts +2 -2
- package/dist/runtime/components/date-time-picker.vue +6 -10
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -7
- package/dist/runtime/components/dialog/ui/dialog-root.d.vue.ts +11 -9
- package/dist/runtime/components/dialog/ui/dialog-root.vue +5 -5
- package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +11 -9
- package/dist/runtime/components/dialog/ui/dialog-title.vue +2 -2
- package/dist/runtime/components/drawer/drawer-close-button.vue +6 -6
- package/dist/runtime/components/drawer/drawer-root.vue +4 -4
- package/dist/runtime/components/drawer/drawer-title.vue +2 -2
- package/dist/runtime/components/files/file-upload-button.vue +8 -7
- package/dist/runtime/components/files/file-upload-icon.vue +5 -5
- package/dist/runtime/components/input/date-picker.vue +6 -10
- package/dist/runtime/components/input/email-input.vue +4 -4
- package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +5 -5
- package/dist/runtime/components/input/number-input.vue +6 -84
- package/dist/runtime/components/input/password-input.vue +4 -4
- package/dist/runtime/components/input/text-input.vue +4 -4
- package/dist/runtime/components/input/ui/button-input.vue +6 -25
- package/dist/runtime/components/input/ui/input-base.vue +6 -265
- package/dist/runtime/components/input/ui/input-inline.d.vue.ts +2 -2
- package/dist/runtime/components/input/ui/input-inline.vue +3 -82
- package/dist/runtime/components/input/ui/input-inline.vue.d.ts +2 -2
- package/dist/runtime/components/input/ui/input-label.d.vue.ts +2 -2
- package/dist/runtime/components/input/ui/input-label.vue +1 -1
- package/dist/runtime/components/input/ui/input-label.vue.d.ts +2 -2
- package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +5 -1
- package/dist/runtime/components/input/ui/input-wrapper.vue +13 -65
- package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +5 -1
- package/dist/runtime/components/input/ui/spin-input.vue +2 -53
- package/dist/runtime/components/link/link-button.vue +9 -8
- package/dist/runtime/components/link/link.vue +2 -2
- package/dist/runtime/components/loader/loader.d.vue.ts +7 -7
- package/dist/runtime/components/loader/loader.vue +8 -7
- package/dist/runtime/components/loader/loader.vue.d.ts +7 -7
- package/dist/runtime/components/modal/modal-close-button.vue +6 -6
- package/dist/runtime/components/modal/modal-root.vue +4 -4
- package/dist/runtime/components/modal/modal-title.vue +2 -2
- package/dist/runtime/components/nav-link/nav-icon-link.vue +4 -4
- package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -5
- package/dist/runtime/components/nav-link/nav-link.vue +30 -113
- package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -5
- package/dist/runtime/components/paper.vue +2 -31
- package/dist/runtime/components/popover/popover-dropdown.vue +2 -54
- package/dist/runtime/components/progress/progress-root.d.vue.ts +3 -3
- package/dist/runtime/components/progress/progress-root.vue +2 -2
- package/dist/runtime/components/progress/progress-root.vue.d.ts +3 -3
- package/dist/runtime/components/progress/progress-section.d.vue.ts +3 -0
- package/dist/runtime/components/progress/progress-section.vue +8 -6
- package/dist/runtime/components/progress/progress-section.vue.d.ts +3 -0
- package/dist/runtime/components/progress/progress.vue +2 -2
- package/dist/runtime/components/select.vue +6 -10
- package/dist/runtime/components/switch/switch-group.vue +3 -3
- package/dist/runtime/components/switch/switch.d.vue.ts +3 -0
- package/dist/runtime/components/switch/switch.vue +15 -205
- package/dist/runtime/components/switch/switch.vue.d.ts +3 -0
- package/dist/runtime/components/table/types.d.ts +4 -3
- package/dist/runtime/components/table/ui/table-sortable-header.vue +9 -8
- package/dist/runtime/components/table/ui/table.vue +9 -174
- package/dist/runtime/components/tabs/tabs-root.d.vue.ts +14 -16
- package/dist/runtime/components/tabs/tabs-root.vue +14 -12
- package/dist/runtime/components/tabs/tabs-root.vue.d.ts +14 -16
- package/dist/runtime/components/text.d.vue.ts +10 -9
- package/dist/runtime/components/text.vue +16 -77
- package/dist/runtime/components/text.vue.d.ts +10 -9
- package/dist/runtime/components/textarea.vue +4 -4
- package/dist/runtime/components/time-picker/time-picker.vue +6 -132
- package/dist/runtime/components/title.vue +4 -8
- package/dist/runtime/components/tree/_ui/tree-item.vue +2 -62
- package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +7 -6
- package/dist/runtime/components/tree/_ui/tree-root.vue +13 -19
- package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +7 -6
- package/dist/runtime/components/tree/tree.vue +5 -5
- package/dist/runtime/composables/index.d.ts +1 -1
- package/dist/runtime/composables/index.js +1 -1
- package/dist/runtime/composables/use-vars-resolver.d.ts +4 -0
- package/dist/runtime/composables/use-vars-resolver.js +6 -0
- package/dist/runtime/types/index.d.ts +2 -2
- package/dist/runtime/types/styling.d.ts +6 -0
- package/dist/runtime/types/styling.js +0 -0
- package/dist/runtime/types/theme.d.ts +10 -15
- package/dist/runtime/utils/color/parse-theme-color.d.ts +2 -2
- package/dist/runtime/utils/style/create-variant-color-resolver.d.ts +2 -2
- package/package.json +2 -2
- package/dist/runtime/composables/use-style-resolver.d.ts +0 -6
- package/dist/runtime/composables/use-style-resolver.js +0 -5
|
@@ -26,11 +26,11 @@ const props = defineProps({
|
|
|
26
26
|
inline: { type: Boolean, required: false },
|
|
27
27
|
inherit: { type: Boolean, required: false },
|
|
28
28
|
gradient: { type: Object, required: false },
|
|
29
|
-
variant: { type: String, required: false },
|
|
30
29
|
fz: { type: null, required: false },
|
|
31
|
-
lh: { type: String, required: false },
|
|
30
|
+
lh: { type: [String, Object], required: false },
|
|
32
31
|
fw: { type: void 0, required: false },
|
|
33
32
|
c: { type: null, required: false },
|
|
33
|
+
variant: { type: String, required: false },
|
|
34
34
|
mod: { type: [Object, Array, null], required: false }
|
|
35
35
|
});
|
|
36
36
|
const { link, rest: { underline, ...rest } } = pickLinkProps(props);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { NuanceColor, NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceColor, NuanceSize } from '@nui/types';
|
|
2
2
|
export type LoaderType = 'bars' | 'dots' | 'oval';
|
|
3
|
+
export interface LoaderVars {
|
|
4
|
+
root: '--loader-size' | '--loader-color';
|
|
5
|
+
}
|
|
3
6
|
export interface LoaderProps {
|
|
4
7
|
/** Component size */
|
|
5
|
-
size?: NuanceSize | `compact-${NuanceSize}` |
|
|
8
|
+
size?: NuanceSize | `compact-${NuanceSize}` | AnyString;
|
|
6
9
|
/** Color from theme */
|
|
7
|
-
color?: NuanceColor |
|
|
8
|
-
/**
|
|
9
|
-
* Loader animation type
|
|
10
|
-
* @default `'oval'`
|
|
11
|
-
*/
|
|
10
|
+
color?: NuanceColor | AnyString;
|
|
11
|
+
/** Loader animation type @default `'oval'` */
|
|
12
12
|
type?: LoaderType;
|
|
13
13
|
}
|
|
14
14
|
declare const __VLS_export: import("vue").DefineComponent<LoaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LoaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
3
|
import { getSize, parseThemeColor } from "@nui/utils";
|
|
4
|
-
import { computed } from "vue";
|
|
5
4
|
import BarsLoader from "./_loaders/bars-loader.vue";
|
|
6
5
|
import DotsLoader from "./_loaders/dots-loader.vue";
|
|
7
6
|
import OvalLoader from "./_loaders/oval-loader.vue";
|
|
@@ -15,17 +14,19 @@ const loaders = {
|
|
|
15
14
|
oval: OvalLoader,
|
|
16
15
|
dots: DotsLoader
|
|
17
16
|
};
|
|
18
|
-
const style =
|
|
17
|
+
const style = useVarsResolver((theme) => {
|
|
19
18
|
const _color = parseThemeColor({ color, theme });
|
|
20
19
|
return {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
root: {
|
|
21
|
+
"--loader-size": getSize(size, "loader-size"),
|
|
22
|
+
"--loader-color": _color.value
|
|
23
|
+
}
|
|
23
24
|
};
|
|
24
|
-
})
|
|
25
|
+
});
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
28
|
<template>
|
|
28
|
-
<component :is='loaders[type]' :class='$style.root' :style />
|
|
29
|
+
<component :is='loaders[type]' :class='$style.root' :style='style.root' />
|
|
29
30
|
</template>
|
|
30
31
|
|
|
31
32
|
<style module>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { NuanceColor, NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceColor, NuanceSize } from '@nui/types';
|
|
2
2
|
export type LoaderType = 'bars' | 'dots' | 'oval';
|
|
3
|
+
export interface LoaderVars {
|
|
4
|
+
root: '--loader-size' | '--loader-color';
|
|
5
|
+
}
|
|
3
6
|
export interface LoaderProps {
|
|
4
7
|
/** Component size */
|
|
5
|
-
size?: NuanceSize | `compact-${NuanceSize}` |
|
|
8
|
+
size?: NuanceSize | `compact-${NuanceSize}` | AnyString;
|
|
6
9
|
/** Color from theme */
|
|
7
|
-
color?: NuanceColor |
|
|
8
|
-
/**
|
|
9
|
-
* Loader animation type
|
|
10
|
-
* @default `'oval'`
|
|
11
|
-
*/
|
|
10
|
+
color?: NuanceColor | AnyString;
|
|
11
|
+
/** Loader animation type @default `'oval'` */
|
|
12
12
|
type?: LoaderType;
|
|
13
13
|
}
|
|
14
14
|
declare const __VLS_export: import("vue").DefineComponent<LoaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LoaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import DialogCloseButton from "../dialog/ui/dialog-close-button.vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
size: { type: null, required: false },
|
|
5
|
-
variant: { type: String, required: false },
|
|
6
5
|
gradient: { type: Object, required: false },
|
|
7
|
-
loading: { type: Boolean, required: false },
|
|
8
6
|
color: { type: null, required: false },
|
|
9
|
-
radius: { type: [String, Number], required: false },
|
|
10
|
-
|
|
11
|
-
mod: { type: [Object, Array, null], required: false },
|
|
7
|
+
radius: { type: [String, Number, Object], required: false },
|
|
8
|
+
loading: { type: Boolean, required: false },
|
|
12
9
|
icon: { type: String, required: false },
|
|
13
|
-
disabled: { type: Boolean, required: false }
|
|
10
|
+
disabled: { type: Boolean, required: false },
|
|
11
|
+
mod: { type: [Object, Array, null], required: false },
|
|
12
|
+
variant: { type: String, required: false },
|
|
13
|
+
classes: { type: Object, required: false }
|
|
14
14
|
});
|
|
15
15
|
</script>
|
|
16
16
|
|
|
@@ -15,16 +15,16 @@ const {
|
|
|
15
15
|
closeOnClickOutside: { type: Boolean, required: false },
|
|
16
16
|
withinPortal: { type: Boolean, required: false },
|
|
17
17
|
withoutOverlay: { type: Boolean, required: false },
|
|
18
|
+
portalTarget: { type: [String, Object, null], required: false },
|
|
19
|
+
is: { type: null, required: false },
|
|
20
|
+
mod: { type: [Object, Array, null], required: false },
|
|
18
21
|
yOffset: { type: void 0, required: false },
|
|
19
22
|
xOffset: { type: void 0, required: false },
|
|
20
23
|
radius: { type: [String, Number], required: false },
|
|
21
24
|
size: { type: String, required: false },
|
|
22
25
|
shadow: { type: String, required: false },
|
|
23
26
|
padding: { type: [String, Number], required: false },
|
|
24
|
-
transition: { type: String, required: false }
|
|
25
|
-
portalTarget: { type: [String, Object, null], required: false },
|
|
26
|
-
is: { type: null, required: false },
|
|
27
|
-
mod: { type: [Object, Array, null], required: false }
|
|
27
|
+
transition: { type: String, required: false }
|
|
28
28
|
});
|
|
29
29
|
defineEmits(["open", "close"]);
|
|
30
30
|
const opened = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
@@ -9,11 +9,11 @@ const props = defineProps({
|
|
|
9
9
|
inline: { type: Boolean, required: false },
|
|
10
10
|
inherit: { type: Boolean, required: false },
|
|
11
11
|
gradient: { type: Object, required: false },
|
|
12
|
-
variant: { type: String, required: false },
|
|
13
12
|
fz: { type: null, required: false },
|
|
14
|
-
lh: { type: String, required: false },
|
|
13
|
+
lh: { type: [String, Object], required: false },
|
|
15
14
|
fw: { type: void 0, required: false },
|
|
16
15
|
c: { type: null, required: false },
|
|
16
|
+
variant: { type: String, required: false },
|
|
17
17
|
mod: { type: [Object, Array, null], required: false }
|
|
18
18
|
});
|
|
19
19
|
</script>
|
|
@@ -14,13 +14,13 @@ const {
|
|
|
14
14
|
active: { type: String, required: false },
|
|
15
15
|
notActive: { type: String, required: false },
|
|
16
16
|
size: { type: null, required: false },
|
|
17
|
-
variant: { type: String, required: false },
|
|
18
17
|
gradient: { type: Object, required: false },
|
|
18
|
+
radius: { type: [String, Number, Object], required: false },
|
|
19
19
|
loading: { type: Boolean, required: false },
|
|
20
|
-
radius: { type: [String, Number], required: false },
|
|
21
|
-
classes: { type: Object, required: false },
|
|
22
|
-
mod: { type: [Object, Array, null], required: false },
|
|
23
20
|
disabled: { type: Boolean, required: false },
|
|
21
|
+
mod: { type: [Object, Array, null], required: false },
|
|
22
|
+
variant: { type: String, required: false },
|
|
23
|
+
classes: { type: Object, required: false },
|
|
24
24
|
external: { type: Boolean, required: false },
|
|
25
25
|
target: { type: [String, Object, null], required: false },
|
|
26
26
|
rel: { type: [String, Object, null], required: false },
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { NuanceColor, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { NuxtLinkProps } from 'nuxt/app';
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
|
+
export type NavLinkVariant = 'filled' | 'light' | 'subtle';
|
|
5
|
+
export interface NavLinkVars {
|
|
6
|
+
root: '--nl-bg' | '--nl-hover' | '--nl-color' | '--nl-spacing';
|
|
7
|
+
}
|
|
4
8
|
export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
5
9
|
/** Link description displayed below the label */
|
|
6
10
|
description?: string;
|
|
@@ -14,13 +18,10 @@ export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'cu
|
|
|
14
18
|
noWrap?: boolean;
|
|
15
19
|
/** Disables the component */
|
|
16
20
|
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Visual variant
|
|
19
|
-
* @default `'filled'`
|
|
20
|
-
*/
|
|
21
|
-
variant?: 'filled' | 'light' | 'subtle';
|
|
22
21
|
/** Icon displayed before the label */
|
|
23
22
|
icon?: string;
|
|
23
|
+
/** Visual variant */
|
|
24
|
+
variant?: NavLinkVariant;
|
|
24
25
|
}
|
|
25
26
|
declare var __VLS_16: {}, __VLS_29: {}, __VLS_37: {}, __VLS_39: {};
|
|
26
27
|
type __VLS_Slots = {} & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
3
|
import { createVariantColorResolver, getSize } from "@nui/utils";
|
|
4
|
-
import { computed } from "vue";
|
|
5
4
|
import Box from "../box.vue";
|
|
6
5
|
import UnstyledButton from "../button/unstyled-button.vue";
|
|
7
6
|
import { pickLinkProps } from "../link";
|
|
@@ -12,8 +11,8 @@ const props = defineProps({
|
|
|
12
11
|
spacing: { type: [String, Number], required: false },
|
|
13
12
|
noWrap: { type: Boolean, required: false },
|
|
14
13
|
disabled: { type: Boolean, required: false },
|
|
15
|
-
variant: { type: String, required: false },
|
|
16
14
|
icon: { type: String, required: false },
|
|
15
|
+
variant: { type: String, required: false },
|
|
17
16
|
is: { type: null, required: false },
|
|
18
17
|
mod: { type: [Object, Array, null], required: false },
|
|
19
18
|
to: { type: null, required: false },
|
|
@@ -35,6 +34,7 @@ const props = defineProps({
|
|
|
35
34
|
const {
|
|
36
35
|
link,
|
|
37
36
|
rest: {
|
|
37
|
+
active,
|
|
38
38
|
disabled,
|
|
39
39
|
mod,
|
|
40
40
|
variant = "filled",
|
|
@@ -45,15 +45,21 @@ const {
|
|
|
45
45
|
icon
|
|
46
46
|
}
|
|
47
47
|
} = pickLinkProps(props);
|
|
48
|
-
const style =
|
|
49
|
-
const {
|
|
48
|
+
const style = useVarsResolver((theme) => {
|
|
49
|
+
const {
|
|
50
|
+
background,
|
|
51
|
+
hover,
|
|
52
|
+
text
|
|
53
|
+
} = createVariantColorResolver({ variant, color, theme });
|
|
50
54
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
root: {
|
|
56
|
+
"--nl-bg": variant ? background : void 0,
|
|
57
|
+
"--nl-hover": variant ? hover : void 0,
|
|
58
|
+
"--nl-color": variant ? text : void 0,
|
|
59
|
+
"--nl-spacing": getSize(spacing, "nl-spacing")
|
|
60
|
+
}
|
|
55
61
|
};
|
|
56
|
-
})
|
|
62
|
+
});
|
|
57
63
|
</script>
|
|
58
64
|
|
|
59
65
|
<template>
|
|
@@ -61,15 +67,19 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
61
67
|
<UnstyledButton
|
|
62
68
|
is='a'
|
|
63
69
|
:href
|
|
64
|
-
:style
|
|
70
|
+
:style='style.root'
|
|
65
71
|
:class='$style.root'
|
|
66
|
-
:mod='[{ active: isActive, disabled }, mod]'
|
|
72
|
+
:mod='[{ active: active ?? isActive, disabled }, mod]'
|
|
67
73
|
:aria-current="isActive ? 'page' : void 0"
|
|
68
74
|
:rel='"rel" in linkProps ? linkProps?.rel : void 0'
|
|
69
75
|
:target='"target" in linkProps ? linkProps?.target : void 0'
|
|
70
76
|
@click='navigate'
|
|
71
77
|
>
|
|
72
|
-
<span
|
|
78
|
+
<span
|
|
79
|
+
v-if='$slots.leftSection || icon'
|
|
80
|
+
:class='$style.section'
|
|
81
|
+
data-position='left'
|
|
82
|
+
>
|
|
73
83
|
<slot name='leftSection'>
|
|
74
84
|
<Icon v-if='icon' :name='icon' />
|
|
75
85
|
</slot>
|
|
@@ -86,110 +96,17 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
86
96
|
</Box>
|
|
87
97
|
</Box>
|
|
88
98
|
|
|
89
|
-
<span
|
|
99
|
+
<span
|
|
100
|
+
v-if='$slots.rightSection'
|
|
101
|
+
:class='$style.section'
|
|
102
|
+
data-position='right'
|
|
103
|
+
>
|
|
90
104
|
<slot name='rightSection' />
|
|
91
105
|
</span>
|
|
92
106
|
</UnstyledButton>
|
|
93
107
|
</NuxtLink>
|
|
94
108
|
</template>
|
|
95
109
|
|
|
96
|
-
<style module
|
|
97
|
-
.root {
|
|
98
|
-
--nl-spacing-xs: .25rem;
|
|
99
|
-
--nl-spacing-sm: .5rem;
|
|
100
|
-
--nl-spacing-md: .75rem;
|
|
101
|
-
--nl-spacing-lg: 1rem;
|
|
102
|
-
--nl-spacing-xl: 1.25rem;
|
|
103
|
-
|
|
104
|
-
--nl-bg: var(--color-primary-light);
|
|
105
|
-
--nl-hover: var(--color-primary-light-hover);
|
|
106
|
-
--nl-color: var(--color-primary-light-color);
|
|
107
|
-
--nl-spacing: var(--nl-spacing-xs);
|
|
108
|
-
|
|
109
|
-
user-select: none;
|
|
110
|
-
|
|
111
|
-
display: flex;
|
|
112
|
-
gap: var(--nl-spacing);
|
|
113
|
-
align-items: center;
|
|
114
|
-
|
|
115
|
-
width: 100%;
|
|
116
|
-
padding: .25rem var(--spacing-sm);
|
|
117
|
-
border-radius: var(--radius-default);
|
|
118
|
-
|
|
119
|
-
&:where([data-disabled]) {
|
|
120
|
-
pointer-events: none;
|
|
121
|
-
|
|
122
|
-
opacity: 0.4;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:hover {
|
|
126
|
-
@mixin where-light {
|
|
127
|
-
background-color: var(--color-gray-0);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@mixin where-dark {
|
|
131
|
-
background-color: var(--color-dark-6);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&:where([data-active]) {
|
|
136
|
-
color: var(--nl-color);
|
|
137
|
-
|
|
138
|
-
background-color: var(--nl-bg);
|
|
139
|
-
|
|
140
|
-
.description {
|
|
141
|
-
--description-opacity: 0.9;
|
|
142
|
-
--description-color: var(--nl-color);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&:hover {
|
|
146
|
-
background-color: var(--nl-hover);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.section {
|
|
152
|
-
display: flex;
|
|
153
|
-
align-items: center;
|
|
154
|
-
justify-content: center;
|
|
155
|
-
|
|
156
|
-
transition: transform 150ms ease;
|
|
157
|
-
|
|
158
|
-
&>svg {
|
|
159
|
-
display: block;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
&:where([data-rotate]) {
|
|
163
|
-
transform: rotate(90deg);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.label {
|
|
168
|
-
font-size: var(--font-size-sm);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.body {
|
|
172
|
-
overflow: hidden;
|
|
173
|
-
flex: 1;
|
|
174
|
-
|
|
175
|
-
text-overflow: ellipsis;
|
|
176
|
-
|
|
177
|
-
&:where([data-no-wrap]) {
|
|
178
|
-
white-space: nowrap;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.description {
|
|
183
|
-
overflow: hidden;
|
|
184
|
-
|
|
185
|
-
font-size: var(--font-size-xs);
|
|
186
|
-
color: var(--description-color, var(--color-dimmed));
|
|
187
|
-
text-overflow: ellipsis;
|
|
188
|
-
|
|
189
|
-
opacity: var(--description-opacity, 1);
|
|
190
|
-
|
|
191
|
-
:where([data-no-wrap]) & {
|
|
192
|
-
white-space: nowrap;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
110
|
+
<style module>
|
|
111
|
+
.root{--nl-spacing-xs:.25rem;--nl-spacing-sm:.5rem;--nl-spacing-md:.75rem;--nl-spacing-lg:1rem;--nl-spacing-xl:1.25rem;--nl-bg:var(--color-primary-light);--nl-hover:var(--color-primary-light-hover);--nl-color:var(--color-primary-light-color);--nl-spacing:var(--nl-spacing-xs);align-items:center;border-radius:var(--radius-default);display:flex;gap:var(--nl-spacing);padding:.25rem var(--spacing-sm);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.root:where([data-disabled]){opacity:.4;pointer-events:none}.root:hover{@mixin where-light{background-color:var(--color-gray-0)}@mixin where-dark{background-color:var(--color-dark-6)}}.root:where([data-active]){background-color:var(--nl-bg);color:var(--nl-color)}.root:where([data-active]) .description{--description-opacity:0.9;--description-color:var(--nl-color)}.root:where([data-active]):hover{background-color:var(--nl-hover)}.section{align-items:center;display:flex;justify-content:center;transition:transform .15s ease}.section>svg{display:block}.section:where([data-rotate]){transform:rotate(90deg)}.label{font-size:var(--font-size-sm)}.body{flex:1;overflow:hidden;text-overflow:ellipsis}.body:where([data-no-wrap]){white-space:nowrap}.description{color:var(--description-color,var(--color-dimmed));font-size:var(--font-size-xs);opacity:var(--description-opacity,1);overflow:hidden;text-overflow:ellipsis}:where([data-no-wrap]) .description{white-space:nowrap}
|
|
195
112
|
</style>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { NuanceColor, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { NuxtLinkProps } from 'nuxt/app';
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
|
+
export type NavLinkVariant = 'filled' | 'light' | 'subtle';
|
|
5
|
+
export interface NavLinkVars {
|
|
6
|
+
root: '--nl-bg' | '--nl-hover' | '--nl-color' | '--nl-spacing';
|
|
7
|
+
}
|
|
4
8
|
export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
5
9
|
/** Link description displayed below the label */
|
|
6
10
|
description?: string;
|
|
@@ -14,13 +18,10 @@ export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'cu
|
|
|
14
18
|
noWrap?: boolean;
|
|
15
19
|
/** Disables the component */
|
|
16
20
|
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Visual variant
|
|
19
|
-
* @default `'filled'`
|
|
20
|
-
*/
|
|
21
|
-
variant?: 'filled' | 'light' | 'subtle';
|
|
22
21
|
/** Icon displayed before the label */
|
|
23
22
|
icon?: string;
|
|
23
|
+
/** Visual variant */
|
|
24
|
+
variant?: NavLinkVariant;
|
|
24
25
|
}
|
|
25
26
|
declare var __VLS_16: {}, __VLS_29: {}, __VLS_37: {}, __VLS_39: {};
|
|
26
27
|
type __VLS_Slots = {} & {
|
|
@@ -21,35 +21,6 @@ const style = computed(() => ({
|
|
|
21
21
|
</Box>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
|
-
<style module
|
|
25
|
-
.root {
|
|
26
|
-
--paper-radius: var(--radius-default);
|
|
27
|
-
--paper-shadow: none;
|
|
28
|
-
|
|
29
|
-
touch-action: manipulation;
|
|
30
|
-
|
|
31
|
-
display: block;
|
|
32
|
-
|
|
33
|
-
border-radius: var(--paper-radius);
|
|
34
|
-
|
|
35
|
-
text-decoration: none;
|
|
36
|
-
|
|
37
|
-
background-color: var(--color-body);
|
|
38
|
-
|
|
39
|
-
outline: 0;
|
|
40
|
-
box-shadow: var(--paper-shadow);
|
|
41
|
-
-webkit-tap-highlight-color: transparent;
|
|
42
|
-
|
|
43
|
-
&:where([data-with-border]) {
|
|
44
|
-
border: rem(1px) solid var(--paper-border-color);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@mixin light {
|
|
48
|
-
--paper-border-color: var(--color-gray-3);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@mixin dark {
|
|
52
|
-
--paper-border-color: var(--color-slate-7);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
24
|
+
<style module>
|
|
25
|
+
.root{--paper-radius:var(--radius-default);--paper-shadow:none;background-color:var(--color-body);border-radius:var(--paper-radius);box-shadow:var(--paper-shadow);display:block;outline:0;text-decoration:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.root:where([data-with-border]){border:rem(1px) solid var(--paper-border-color)}.root{@mixin light{--paper-border-color:var(--color-gray-3)}}.root{@mixin dark{--paper-border-color:var(--color-slate-7)}}
|
|
55
26
|
</style>
|
|
@@ -35,58 +35,6 @@ const style = computed(() => ({
|
|
|
35
35
|
</div>
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
|
-
<style module
|
|
39
|
-
.dropdown {
|
|
40
|
-
--popover-radius: var(--radius-default);
|
|
41
|
-
--popover-shadow: none;
|
|
42
|
-
|
|
43
|
-
overflow: visible;
|
|
44
|
-
|
|
45
|
-
padding: var(--spacing-xs) var(--spacing-sm);
|
|
46
|
-
border: 1px solid var(--popover-border-color);
|
|
47
|
-
border-radius: var(--popover-radius);
|
|
48
|
-
|
|
49
|
-
color: var(--color-text);
|
|
50
|
-
|
|
51
|
-
opacity: 0;
|
|
52
|
-
box-shadow: var(--popover-shadow);
|
|
53
|
-
|
|
54
|
-
transition: opacity 0.2s, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
|
|
55
|
-
|
|
56
|
-
&:popover-open {
|
|
57
|
-
opacity: 1;
|
|
58
|
-
|
|
59
|
-
@starting-style {
|
|
60
|
-
opacity: 0;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@mixin where-light {
|
|
65
|
-
--popover-border-color: var(--color-gray-2);
|
|
66
|
-
|
|
67
|
-
background-color: var(--color-white);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@mixin where-dark {
|
|
71
|
-
--popover-border-color: var(--color-dark-4);
|
|
72
|
-
|
|
73
|
-
background-color: var(--color-dark-6);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.arrow {
|
|
78
|
-
--arrow-size: 7px;
|
|
79
|
-
--arrow-radius: 0px;
|
|
80
|
-
--arrow-placement: calc(var(--arrow-size) / 2 * -1);
|
|
81
|
-
|
|
82
|
-
position: absolute;
|
|
83
|
-
transform: rotate(45deg);
|
|
84
|
-
|
|
85
|
-
width: var(--arrow-size);
|
|
86
|
-
height: var(--arrow-size);
|
|
87
|
-
|
|
88
|
-
border: 1px solid var(--popover-border-color);
|
|
89
|
-
|
|
90
|
-
background-color: inherit;
|
|
91
|
-
}
|
|
38
|
+
<style module>
|
|
39
|
+
.dropdown{--popover-radius:var(--radius-default);--popover-shadow:none;border:1px solid var(--popover-border-color);border-radius:var(--popover-radius);box-shadow:var(--popover-shadow);color:var(--color-text);opacity:0;overflow:visible;padding:var(--spacing-xs) var(--spacing-sm);transition:opacity .2s,overlay allow-discrete .2s,display allow-discrete .2s}.dropdown:popover-open{opacity:1}@starting-style{.dropdown:popover-open{opacity:0}}.dropdown{@mixin where-light{--popover-border-color:var(--color-gray-2);background-color:var(--color-white)}}.dropdown{@mixin where-dark{--popover-border-color:var(--color-dark-4);background-color:var(--color-dark-6)}}.arrow{--arrow-size:7px;--arrow-radius:0px;--arrow-placement:calc(var(--arrow-size)/2*-1);background-color:inherit;border:1px solid var(--popover-border-color);height:var(--arrow-size);position:absolute;transform:rotate(45deg);width:var(--arrow-size)}
|
|
92
40
|
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BoxProps } from '@nui/components';
|
|
2
|
-
import type { NuanceRadius, NuanceSize } from '@nui/types';
|
|
2
|
+
import type { AnyString, NuanceRadius, NuanceSize } from '@nui/types';
|
|
3
3
|
export interface ProgressRootProps extends BoxProps {
|
|
4
4
|
/** Component size @default `'md'` */
|
|
5
|
-
size?: NuanceSize |
|
|
5
|
+
size?: NuanceSize | AnyString;
|
|
6
6
|
/** Border radius @default `theme.defaultRadius` */
|
|
7
|
-
radius?: NuanceRadius;
|
|
7
|
+
radius?: NuanceRadius | AnyString;
|
|
8
8
|
/** Sections width transition duration in ms @default `100` */
|
|
9
9
|
transitionDuration?: number;
|
|
10
10
|
/** Orientation @default `'horizontal'` */
|
|
@@ -10,8 +10,8 @@ const {
|
|
|
10
10
|
radius,
|
|
11
11
|
transitionDuration
|
|
12
12
|
} = defineProps({
|
|
13
|
-
size: { type: String, required: false },
|
|
14
|
-
radius: { type: [String, Number], required: false },
|
|
13
|
+
size: { type: [String, Object], required: false },
|
|
14
|
+
radius: { type: [String, Number, Object], required: false },
|
|
15
15
|
transitionDuration: { type: Number, required: false },
|
|
16
16
|
orientation: { type: String, required: false },
|
|
17
17
|
is: { type: null, required: false },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BoxProps } from '@nui/components';
|
|
2
|
-
import type { NuanceRadius, NuanceSize } from '@nui/types';
|
|
2
|
+
import type { AnyString, NuanceRadius, NuanceSize } from '@nui/types';
|
|
3
3
|
export interface ProgressRootProps extends BoxProps {
|
|
4
4
|
/** Component size @default `'md'` */
|
|
5
|
-
size?: NuanceSize |
|
|
5
|
+
size?: NuanceSize | AnyString;
|
|
6
6
|
/** Border radius @default `theme.defaultRadius` */
|
|
7
|
-
radius?: NuanceRadius;
|
|
7
|
+
radius?: NuanceRadius | AnyString;
|
|
8
8
|
/** Sections width transition duration in ms @default `100` */
|
|
9
9
|
transitionDuration?: number;
|
|
10
10
|
/** Orientation @default `'horizontal'` */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { BoxProps } from '@nui/components';
|
|
2
2
|
import type { NuanceColor } from '@nui/types';
|
|
3
|
+
export interface ProgressSectionVars {
|
|
4
|
+
root: '--progress-section-size' | '--progress-section-color';
|
|
5
|
+
}
|
|
3
6
|
export interface ProgressSectionProps extends BoxProps {
|
|
4
7
|
/** Determines whether `aria-*` props should be added to the root element @default `true` */
|
|
5
8
|
withAria?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
3
|
import { getThemeColor } from "@nui/utils";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import Box from "../box.vue";
|
|
@@ -26,15 +26,17 @@ const ariaAttributes = computed(() => withAria ? {
|
|
|
26
26
|
"aria-valuenow": value.value,
|
|
27
27
|
"aria-valuetext": `${value.value}%`
|
|
28
28
|
} : {});
|
|
29
|
-
const style =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const style = useVarsResolver((theme) => ({
|
|
30
|
+
root: {
|
|
31
|
+
"--progress-section-size": `${value.value}%`,
|
|
32
|
+
"--progress-section-color": getThemeColor(color, theme)
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
33
35
|
</script>
|
|
34
36
|
|
|
35
37
|
<template>
|
|
36
38
|
<Box
|
|
37
|
-
:style
|
|
39
|
+
:style='style.root'
|
|
38
40
|
v-bind='ariaAttributes'
|
|
39
41
|
:class='css.section'
|
|
40
42
|
:mod='[{ striped: striped || animated, animated }, mod]'
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { BoxProps } from '@nui/components';
|
|
2
2
|
import type { NuanceColor } from '@nui/types';
|
|
3
|
+
export interface ProgressSectionVars {
|
|
4
|
+
root: '--progress-section-size' | '--progress-section-color';
|
|
5
|
+
}
|
|
3
6
|
export interface ProgressSectionProps extends BoxProps {
|
|
4
7
|
/** Determines whether `aria-*` props should be added to the root element @default `true` */
|
|
5
8
|
withAria?: boolean;
|
|
@@ -12,8 +12,8 @@ const {
|
|
|
12
12
|
orientation,
|
|
13
13
|
transitionDuration
|
|
14
14
|
} = defineProps({
|
|
15
|
-
size: { type: String, required: false },
|
|
16
|
-
radius: { type: [String, Number], required: false },
|
|
15
|
+
size: { type: [String, Object], required: false },
|
|
16
|
+
radius: { type: [String, Number, Object], required: false },
|
|
17
17
|
transitionDuration: { type: Number, required: false },
|
|
18
18
|
orientation: { type: String, required: false },
|
|
19
19
|
is: { type: null, required: false },
|
|
@@ -40,11 +40,11 @@ const {
|
|
|
40
40
|
description: { type: String, required: false },
|
|
41
41
|
label: { type: String, required: false },
|
|
42
42
|
required: { type: Boolean, required: false },
|
|
43
|
-
radius: { type: String, required: false },
|
|
44
|
-
size: { type: String, required: false },
|
|
43
|
+
radius: { type: [String, Number, Object], required: false },
|
|
44
|
+
size: { type: [String, Object], required: false },
|
|
45
45
|
variant: { type: String, required: false },
|
|
46
|
-
leftSectionPE: { type:
|
|
47
|
-
rightSectionPE: { type:
|
|
46
|
+
leftSectionPE: { type: void 0, required: false },
|
|
47
|
+
rightSectionPE: { type: void 0, required: false },
|
|
48
48
|
readonly: { type: Boolean, required: false },
|
|
49
49
|
disabled: { type: Boolean, required: false }
|
|
50
50
|
});
|
|
@@ -166,10 +166,6 @@ function onSubmit(val) {
|
|
|
166
166
|
</ComboboxRoot>
|
|
167
167
|
</template>
|
|
168
168
|
|
|
169
|
-
<style module
|
|
170
|
-
.input {
|
|
171
|
-
:where([readonly]) {
|
|
172
|
-
cursor: pointer;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
169
|
+
<style module>
|
|
170
|
+
.input :where([readonly]){cursor:pointer}
|
|
175
171
|
</style>
|