nuance-ui 0.2.10 → 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 -31
- package/dist/runtime/components/button/button.vue +36 -45
- package/dist/runtime/components/button/button.vue.d.ts +21 -31
- 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 -8
- 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 -9
- 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 -9
- 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 +1 -2
- package/dist/runtime/types/styling.d.ts +3 -1
- package/dist/runtime/types/theme.d.ts +10 -15
- 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 -5
- package/dist/runtime/composables/use-style-resolver.js +0 -5
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { NuanceColor, NuanceRadius } from '@nui/types';
|
|
2
2
|
import type { BoxProps } from '../box.vue.js';
|
|
3
|
+
export type TabsVariant = 'default' | 'pills' | 'outline';
|
|
3
4
|
export interface TabsRootProps extends BoxProps {
|
|
4
|
-
/** Value of the tab activated by default (uncontrolled) */
|
|
5
|
-
defaultTab?: string;
|
|
6
5
|
/**
|
|
7
6
|
* Tabs orientation
|
|
8
7
|
* @default `'horizontal'`
|
|
@@ -13,11 +12,21 @@ export interface TabsRootProps extends BoxProps {
|
|
|
13
12
|
* @default `'left'`
|
|
14
13
|
*/
|
|
15
14
|
placement?: 'left' | 'right';
|
|
15
|
+
/** Visual variant */
|
|
16
|
+
variant?: TabsVariant;
|
|
17
|
+
/** Color from theme */
|
|
18
|
+
color?: NuanceColor;
|
|
19
|
+
/** Border radius */
|
|
20
|
+
radius?: NuanceRadius;
|
|
16
21
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @default `
|
|
22
|
+
* Inverts tab styles
|
|
23
|
+
* @default `false`
|
|
19
24
|
*/
|
|
20
|
-
|
|
25
|
+
inverted?: boolean;
|
|
26
|
+
/** Root element id */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Value of the tab activated by default (uncontrolled) */
|
|
29
|
+
defaultTab?: string;
|
|
21
30
|
/**
|
|
22
31
|
* Whether arrow key presses loop through items
|
|
23
32
|
* @default `true`
|
|
@@ -33,22 +42,11 @@ export interface TabsRootProps extends BoxProps {
|
|
|
33
42
|
* @default `false`
|
|
34
43
|
*/
|
|
35
44
|
allowTabDeactivation?: boolean;
|
|
36
|
-
/** Color from theme */
|
|
37
|
-
color?: NuanceColor;
|
|
38
|
-
/** Border radius */
|
|
39
|
-
radius?: NuanceRadius;
|
|
40
|
-
/**
|
|
41
|
-
* Inverts tab styles
|
|
42
|
-
* @default `false`
|
|
43
|
-
*/
|
|
44
|
-
inverted?: boolean;
|
|
45
45
|
/**
|
|
46
46
|
* If `false`, panel content is unmounted when inactive
|
|
47
47
|
* @default `true`
|
|
48
48
|
*/
|
|
49
49
|
keepMounted?: boolean;
|
|
50
|
-
/** Root element id */
|
|
51
|
-
id?: string;
|
|
52
50
|
}
|
|
53
51
|
type __VLS_Props = TabsRootProps;
|
|
54
52
|
type __VLS_ModelProps = {
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import type { NuanceColor, NuanceGradient, NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceColor, NuanceFontSize, NuanceGradient, NuanceSize } from '@nui/types';
|
|
2
2
|
import type { CSSProperties } from 'vue';
|
|
3
3
|
import type { BoxProps } from './box.vue.js';
|
|
4
4
|
type TitleOrder = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
type TextTruncate = 'end' | 'start' | boolean;
|
|
6
|
+
export type TextVariant = 'text' | 'gradient';
|
|
6
7
|
export interface TextProps extends BoxProps {
|
|
7
|
-
/** Controls `font-size` and `line-height
|
|
8
|
-
size?: NuanceSize | `h${TitleOrder}` |
|
|
8
|
+
/** Controls `font-size` and `line-height` */
|
|
9
|
+
size?: NuanceSize | `h${TitleOrder}` | AnyString;
|
|
9
10
|
/** Number of lines after which Text will be truncated */
|
|
10
11
|
lineClamp?: number;
|
|
11
12
|
/** Side on which Text must be truncated, if `true`, text is truncated from the start */
|
|
12
13
|
truncate?: TextTruncate;
|
|
13
|
-
/** Sets `line-height` to 1 for centering
|
|
14
|
+
/** Sets `line-height` to 1 for centering */
|
|
14
15
|
inline?: boolean;
|
|
15
|
-
/** Determines whether font properties should be inherited from the parent
|
|
16
|
+
/** Determines whether font properties should be inherited from the parent */
|
|
16
17
|
inherit?: boolean;
|
|
17
18
|
/** Gradient configuration (used with `variant="gradient"`) */
|
|
18
19
|
gradient?: NuanceGradient;
|
|
19
|
-
/** Visual variant */
|
|
20
|
-
variant?: 'text' | 'gradient';
|
|
21
20
|
/** Font size token */
|
|
22
|
-
fz?:
|
|
21
|
+
fz?: NuanceFontSize | `h${TitleOrder}` | AnyString;
|
|
23
22
|
/** Line height token */
|
|
24
|
-
lh?: NuanceSize |
|
|
23
|
+
lh?: NuanceSize | AnyString;
|
|
25
24
|
/** Font weight */
|
|
26
25
|
fw?: CSSProperties['font-weight'];
|
|
27
26
|
/** Text color from theme */
|
|
28
27
|
c?: NuanceColor | 'dimmed';
|
|
28
|
+
/** Visual variant */
|
|
29
|
+
variant?: TextVariant;
|
|
29
30
|
}
|
|
30
31
|
declare var __VLS_8: {};
|
|
31
32
|
type __VLS_Slots = {} & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
3
|
import { getFontSize, getGradient, getLineHeight, getThemeColor } from "@nui/utils";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import Box from "./box.vue";
|
|
@@ -25,11 +25,11 @@ const {
|
|
|
25
25
|
inline: { type: Boolean, required: false },
|
|
26
26
|
inherit: { type: Boolean, required: false },
|
|
27
27
|
gradient: { type: Object, required: false },
|
|
28
|
-
variant: { type: String, required: false },
|
|
29
28
|
fz: { type: null, required: false },
|
|
30
|
-
lh: { type: String, required: false },
|
|
29
|
+
lh: { type: [String, Object], required: false },
|
|
31
30
|
fw: { type: void 0, required: false },
|
|
32
31
|
c: { type: null, required: false },
|
|
32
|
+
variant: { type: String, required: false },
|
|
33
33
|
is: { type: null, required: false },
|
|
34
34
|
mod: { type: [Object, Array, null], required: false }
|
|
35
35
|
});
|
|
@@ -40,85 +40,24 @@ const _mod = computed(() => [{
|
|
|
40
40
|
inherit,
|
|
41
41
|
variant
|
|
42
42
|
}, mod]);
|
|
43
|
-
const style =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const style = useVarsResolver((theme) => ({
|
|
44
|
+
root: {
|
|
45
|
+
"--text-fz": getFontSize(fz || size),
|
|
46
|
+
"--text-fw": fw?.toString(),
|
|
47
|
+
"--text-lh": getLineHeight(lh || size),
|
|
48
|
+
"--text-gradient": variant === "gradient" ? getGradient(gradient, theme) : void 0,
|
|
49
|
+
"--text-line-clamp": lineClamp?.toString(),
|
|
50
|
+
"--text-color": c ? getThemeColor(c, theme) : void 0
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
51
53
|
</script>
|
|
52
54
|
|
|
53
55
|
<template>
|
|
54
|
-
<Box :is v-bind='rest' :mod='_mod' :class='$style.root' :style>
|
|
56
|
+
<Box :is v-bind='rest' :mod='_mod' :class='$style.root' :style='style.root'>
|
|
55
57
|
<slot />
|
|
56
58
|
</Box>
|
|
57
59
|
</template>
|
|
58
60
|
|
|
59
|
-
<style module
|
|
60
|
-
.root {
|
|
61
|
-
--text-fz: var(--font-size-sm);
|
|
62
|
-
--text-lh: var(--line-height-sm);
|
|
63
|
-
--text-color: inherit;
|
|
64
|
-
--text-fw: normal;
|
|
65
|
-
--text-gradient: none;
|
|
66
|
-
--text-line-clamp: none;
|
|
67
|
-
|
|
68
|
-
margin: 0;
|
|
69
|
-
padding: 0;
|
|
70
|
-
|
|
71
|
-
font-size: var(--text-fz);
|
|
72
|
-
font-weight: var(--text-fw);
|
|
73
|
-
line-height: var(--text-lh);
|
|
74
|
-
color: var(--text-color);
|
|
75
|
-
text-decoration: none;
|
|
76
|
-
-webkit-tap-highlight-color: transparent;
|
|
77
|
-
|
|
78
|
-
&:where([data-truncate]) {
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
|
|
81
|
-
text-overflow: ellipsis;
|
|
82
|
-
white-space: nowrap;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&:where([data-truncate='start']) {
|
|
86
|
-
direction: rtl;
|
|
87
|
-
|
|
88
|
-
text-align: right;
|
|
89
|
-
|
|
90
|
-
@mixin where-rtl {
|
|
91
|
-
direction: ltr;
|
|
92
|
-
|
|
93
|
-
text-align: left;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&:where([data-variant='gradient']) {
|
|
98
|
-
background-image: var(--text-gradient);
|
|
99
|
-
-webkit-background-clip: text;
|
|
100
|
-
background-clip: text;
|
|
101
|
-
-webkit-text-fill-color: transparent;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&:where([data-line-clamp]) {
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
display: -webkit-box;
|
|
107
|
-
-webkit-box-orient: vertical;
|
|
108
|
-
-webkit-line-clamp: var(--text-line-clamp);
|
|
109
|
-
|
|
110
|
-
text-overflow: ellipsis;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&:where([data-inherit]) {
|
|
114
|
-
font-size: inherit;
|
|
115
|
-
font-weight: inherit;
|
|
116
|
-
line-height: inherit;
|
|
117
|
-
color: inherit;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
&:where([data-inline]) {
|
|
121
|
-
line-height: 1;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
61
|
+
<style module>
|
|
62
|
+
.root{--text-fz:var(--font-size-sm);--text-lh:var(--line-height-sm);--text-color:inherit;--text-fw:normal;--text-gradient:none;--text-line-clamp:none;color:var(--text-color);font-size:var(--text-fz);font-weight:var(--text-fw);line-height:var(--text-lh);margin:0;padding:0;text-decoration:none;-webkit-tap-highlight-color:transparent}.root:where([data-truncate]){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.root:where([data-truncate=start]){direction:rtl;text-align:right;@mixin where-rtl{direction:ltr;text-align:left}}.root:where([data-variant=gradient]){-webkit-background-clip:text;background-clip:text;background-image:var(--text-gradient);-webkit-text-fill-color:transparent}.root:where([data-line-clamp]){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:var(--text-line-clamp);text-overflow:ellipsis}.root:where([data-inherit]){color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.root:where([data-inline]){line-height:1}
|
|
124
63
|
</style>
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import type { NuanceColor, NuanceGradient, NuanceSize } from '@nui/types';
|
|
1
|
+
import type { AnyString, NuanceColor, NuanceFontSize, NuanceGradient, NuanceSize } from '@nui/types';
|
|
2
2
|
import type { CSSProperties } from 'vue';
|
|
3
3
|
import type { BoxProps } from './box.vue.js';
|
|
4
4
|
type TitleOrder = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
type TextTruncate = 'end' | 'start' | boolean;
|
|
6
|
+
export type TextVariant = 'text' | 'gradient';
|
|
6
7
|
export interface TextProps extends BoxProps {
|
|
7
|
-
/** Controls `font-size` and `line-height
|
|
8
|
-
size?: NuanceSize | `h${TitleOrder}` |
|
|
8
|
+
/** Controls `font-size` and `line-height` */
|
|
9
|
+
size?: NuanceSize | `h${TitleOrder}` | AnyString;
|
|
9
10
|
/** Number of lines after which Text will be truncated */
|
|
10
11
|
lineClamp?: number;
|
|
11
12
|
/** Side on which Text must be truncated, if `true`, text is truncated from the start */
|
|
12
13
|
truncate?: TextTruncate;
|
|
13
|
-
/** Sets `line-height` to 1 for centering
|
|
14
|
+
/** Sets `line-height` to 1 for centering */
|
|
14
15
|
inline?: boolean;
|
|
15
|
-
/** Determines whether font properties should be inherited from the parent
|
|
16
|
+
/** Determines whether font properties should be inherited from the parent */
|
|
16
17
|
inherit?: boolean;
|
|
17
18
|
/** Gradient configuration (used with `variant="gradient"`) */
|
|
18
19
|
gradient?: NuanceGradient;
|
|
19
|
-
/** Visual variant */
|
|
20
|
-
variant?: 'text' | 'gradient';
|
|
21
20
|
/** Font size token */
|
|
22
|
-
fz?:
|
|
21
|
+
fz?: NuanceFontSize | `h${TitleOrder}` | AnyString;
|
|
23
22
|
/** Line height token */
|
|
24
|
-
lh?: NuanceSize |
|
|
23
|
+
lh?: NuanceSize | AnyString;
|
|
25
24
|
/** Font weight */
|
|
26
25
|
fw?: CSSProperties['font-weight'];
|
|
27
26
|
/** Text color from theme */
|
|
28
27
|
c?: NuanceColor | 'dimmed';
|
|
28
|
+
/** Visual variant */
|
|
29
|
+
variant?: TextVariant;
|
|
29
30
|
}
|
|
30
31
|
declare var __VLS_8: {};
|
|
31
32
|
type __VLS_Slots = {} & {
|
|
@@ -10,13 +10,13 @@ const { icon, ...props } = defineProps({
|
|
|
10
10
|
label: { type: String, required: false },
|
|
11
11
|
required: { type: Boolean, required: false },
|
|
12
12
|
id: { type: [String, null], required: false },
|
|
13
|
-
radius: { type: String, required: false },
|
|
14
|
-
size: { type: String, required: false },
|
|
13
|
+
radius: { type: [String, Number, Object], required: false },
|
|
14
|
+
size: { type: [String, Object], required: false },
|
|
15
15
|
variant: { type: String, required: false },
|
|
16
16
|
multiline: { type: Boolean, required: false },
|
|
17
17
|
resize: { type: void 0, required: false },
|
|
18
|
-
leftSectionPE: { type:
|
|
19
|
-
rightSectionPE: { type:
|
|
18
|
+
leftSectionPE: { type: void 0, required: false },
|
|
19
|
+
rightSectionPE: { type: void 0, required: false },
|
|
20
20
|
readonly: { type: Boolean, required: false },
|
|
21
21
|
disabled: { type: Boolean, required: false }
|
|
22
22
|
});
|
|
@@ -46,13 +46,13 @@ const {
|
|
|
46
46
|
label: { type: String, required: false },
|
|
47
47
|
required: { type: Boolean, required: false },
|
|
48
48
|
id: { type: [String, null], required: false },
|
|
49
|
-
radius: { type: String, required: false },
|
|
50
|
-
size: { type: String, required: false },
|
|
49
|
+
radius: { type: [String, Number, Object], required: false },
|
|
50
|
+
size: { type: [String, Object], required: false },
|
|
51
51
|
variant: { type: String, required: false },
|
|
52
52
|
multiline: { type: Boolean, required: false },
|
|
53
53
|
resize: { type: void 0, required: false },
|
|
54
|
-
leftSectionPE: { type:
|
|
55
|
-
rightSectionPE: { type:
|
|
54
|
+
leftSectionPE: { type: void 0, required: false },
|
|
55
|
+
rightSectionPE: { type: void 0, required: false },
|
|
56
56
|
readonly: { type: Boolean, required: false },
|
|
57
57
|
disabled: { type: Boolean, required: false }
|
|
58
58
|
});
|
|
@@ -188,132 +188,6 @@ const isClearable = computed(() => clearable && !readonly && !disabled && (hours
|
|
|
188
188
|
</InputWrapper>
|
|
189
189
|
</template>
|
|
190
190
|
|
|
191
|
-
<style
|
|
192
|
-
.root {
|
|
193
|
-
overflow: hidden;
|
|
194
|
-
display: flex;
|
|
195
|
-
align-items: center;
|
|
196
|
-
|
|
197
|
-
height: 100%;
|
|
198
|
-
|
|
199
|
-
@mixin where-rtl {
|
|
200
|
-
flex-direction: row-reverse;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.group {
|
|
205
|
-
display: flex;
|
|
206
|
-
align-items: center;
|
|
207
|
-
|
|
208
|
-
height: calc(var(--input-height) - rem(15px));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.controls {
|
|
212
|
-
display: flex;
|
|
213
|
-
flex-direction: column;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.controlsGroup {
|
|
217
|
-
display: flex;
|
|
218
|
-
gap: .25rem;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.dropdown {
|
|
222
|
-
padding: .25rem;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.control {
|
|
226
|
-
width: max-content;
|
|
227
|
-
min-width: 2.5em;
|
|
228
|
-
height: 2em;
|
|
229
|
-
border-radius: var(--radius-default);
|
|
230
|
-
|
|
231
|
-
font-size: var(--control-font-size, var(--font-size-sm));
|
|
232
|
-
text-align: center;
|
|
233
|
-
|
|
234
|
-
&:where([data-active]) {
|
|
235
|
-
color: var(--color-white);
|
|
236
|
-
|
|
237
|
-
background-color: var(--color-primary-filled);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
@mixin hover {
|
|
241
|
-
&:where(:not([data-active])) {
|
|
242
|
-
color: var(--color-bright);
|
|
243
|
-
|
|
244
|
-
@mixin where-dark {
|
|
245
|
-
background-color: var(--color-dark-5);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
@mixin where-light {
|
|
249
|
-
background-color: var(--color-gray-1);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.presetControl {
|
|
256
|
-
height: 2em;
|
|
257
|
-
padding-inline: 0.5em;
|
|
258
|
-
border-radius: var(--radius-default);
|
|
259
|
-
|
|
260
|
-
font-size: var(--control-font-size, var(--font-size-sm));
|
|
261
|
-
text-align: center;
|
|
262
|
-
|
|
263
|
-
&:where([data-active]) {
|
|
264
|
-
color: var(--color-white);
|
|
265
|
-
|
|
266
|
-
background-color: var(--color-primary-filled);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
@mixin hover {
|
|
270
|
-
&:where(:not([data-active])) {
|
|
271
|
-
color: var(--color-bright);
|
|
272
|
-
|
|
273
|
-
@mixin where-dark {
|
|
274
|
-
background-color: var(--color-dark-5);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
@mixin where-light {
|
|
278
|
-
background-color: var(--color-gray-1);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.presetsGroup {
|
|
285
|
-
&+& {
|
|
286
|
-
margin-top: var(--spacing-sm);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.presetsGroupLabel {
|
|
291
|
-
display: flex;
|
|
292
|
-
align-items: center;
|
|
293
|
-
|
|
294
|
-
margin-bottom: .25rem;
|
|
295
|
-
padding-inline-start: 7px;
|
|
296
|
-
|
|
297
|
-
font-size: calc(var(--control-font-size, var(--font-size-sm)) - 2px);
|
|
298
|
-
font-weight: 500;
|
|
299
|
-
color: var(--color-dimmed);
|
|
300
|
-
|
|
301
|
-
&::after {
|
|
302
|
-
content: '';
|
|
303
|
-
|
|
304
|
-
flex: 1;
|
|
305
|
-
|
|
306
|
-
width: 100%;
|
|
307
|
-
height: 1px;
|
|
308
|
-
margin-inline-start: var(--spacing-xs);
|
|
309
|
-
|
|
310
|
-
@mixin where-light {
|
|
311
|
-
background-color: var(--color-gray-2);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
@mixin where-dark {
|
|
315
|
-
background-color: var(--color-dark-4);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
191
|
+
<style module>
|
|
192
|
+
.root{align-items:center;display:flex;height:100%;overflow:hidden;@mixin where-rtl{flex-direction:row-reverse}}.group{align-items:center;display:flex;height:calc(var(--input-height) - rem(15px))}.controls{display:flex;flex-direction:column}.controlsGroup{display:flex;gap:.25rem}.dropdown{padding:.25rem}.control{border-radius:var(--radius-default);font-size:var(--control-font-size,var(--font-size-sm));height:2em;min-width:2.5em;text-align:center;width:-moz-max-content;width:max-content}.control:where([data-active]){background-color:var(--color-primary-filled);color:var(--color-white)}.control{@mixin hover{&:where(:not([data-active])){color:var(--color-bright);@mixin where-dark{background-color:var(--color-dark-5)}@mixin where-light{background-color:var(--color-gray-1)}}}}.presetControl{border-radius:var(--radius-default);font-size:var(--control-font-size,var(--font-size-sm));height:2em;padding-inline:.5em;text-align:center}.presetControl:where([data-active]){background-color:var(--color-primary-filled);color:var(--color-white)}.presetControl{@mixin hover{&:where(:not([data-active])){color:var(--color-bright);@mixin where-dark{background-color:var(--color-dark-5)}@mixin where-light{background-color:var(--color-gray-1)}}}}.presetsGroup+.presetsGroup{margin-top:var(--spacing-sm)}.presetsGroupLabel{align-items:center;color:var(--color-dimmed);display:flex;font-size:calc(var(--control-font-size, var(--font-size-sm)) - 2px);font-weight:500;margin-bottom:.25rem;padding-inline-start:7px}.presetsGroupLabel:after{content:"";flex:1;height:1px;margin-inline-start:var(--spacing-xs);width:100%;@mixin where-light{background-color:var(--color-gray-2)}@mixin where-dark{background-color:var(--color-dark-4)}}
|
|
319
193
|
</style>
|
|
@@ -15,11 +15,11 @@ const {
|
|
|
15
15
|
inline: { type: Boolean, required: false },
|
|
16
16
|
inherit: { type: Boolean, required: false },
|
|
17
17
|
gradient: { type: Object, required: false },
|
|
18
|
-
variant: { type: String, required: false },
|
|
19
18
|
fz: { type: null, required: false },
|
|
20
|
-
lh: { type: String, required: false },
|
|
19
|
+
lh: { type: [String, Object], required: false },
|
|
21
20
|
fw: { type: void 0, required: false },
|
|
22
21
|
c: { type: null, required: false },
|
|
22
|
+
variant: { type: String, required: false },
|
|
23
23
|
mod: { type: [Object, Array, null], required: false }
|
|
24
24
|
});
|
|
25
25
|
const style = computed(() => ({ "--title-text-wrap": textWrap }));
|
|
@@ -37,10 +37,6 @@ const style = computed(() => ({ "--title-text-wrap": textWrap }));
|
|
|
37
37
|
</Text>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<style module
|
|
41
|
-
.root
|
|
42
|
-
--title-text-wrap: pretty;
|
|
43
|
-
|
|
44
|
-
text-wrap: var(--title-text-wrap);
|
|
45
|
-
}
|
|
40
|
+
<style module>
|
|
41
|
+
.root{--title-text-wrap:pretty;text-wrap:var(--title-text-wrap)}
|
|
46
42
|
</style>
|
|
@@ -120,66 +120,6 @@ const { handleClick, handleKeyDown } = useTreeItemHandlers(path, isFolder, expan
|
|
|
120
120
|
</li>
|
|
121
121
|
</template>
|
|
122
122
|
|
|
123
|
-
<style module
|
|
124
|
-
.item {
|
|
125
|
-
display: grid;
|
|
126
|
-
gap: .25rem;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.icon {
|
|
130
|
-
--loader-size: var(--tree-icon-size);
|
|
131
|
-
|
|
132
|
-
width: var(--tree-icon-size);
|
|
133
|
-
height: var(--tree-icon-size);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.chevron {
|
|
137
|
-
color: var(--color-dimmed);
|
|
138
|
-
|
|
139
|
-
transition: transform .3s ease-in-out;
|
|
140
|
-
|
|
141
|
-
&:hover {
|
|
142
|
-
color: var(--color-dimmed);
|
|
143
|
-
|
|
144
|
-
background-color: transparent;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&[data-expanded] .chevron-icon {
|
|
148
|
-
transform: rotate(-180deg);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.list {
|
|
153
|
-
display: grid;
|
|
154
|
-
gap: .25rem;
|
|
155
|
-
|
|
156
|
-
margin-inline-start: 1rem;
|
|
157
|
-
|
|
158
|
-
padding-inline-start: .75rem;
|
|
159
|
-
border-left: 1px solid var(--color-gray-4);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.root {
|
|
163
|
-
.inner {
|
|
164
|
-
display: grid;
|
|
165
|
-
grid-template-columns: auto 1fr auto;
|
|
166
|
-
|
|
167
|
-
color: var(--color-text);
|
|
168
|
-
|
|
169
|
-
.label {
|
|
170
|
-
font-weight: 500;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&[data-active],
|
|
175
|
-
&[data-selected] {
|
|
176
|
-
.inner {
|
|
177
|
-
color: var(--button-color);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&[data-selected] {
|
|
182
|
-
background: alpha(var(--button-color), .1);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
123
|
+
<style module>
|
|
124
|
+
.item{display:grid;gap:.25rem}.icon{--loader-size:var(--tree-icon-size);height:var(--tree-icon-size);width:var(--tree-icon-size)}.chevron{transition:transform .3s ease-in-out}.chevron,.chevron:hover{color:var(--color-dimmed)}.chevron:hover{background-color:transparent}.chevron[data-expanded] .chevron-icon{transform:rotate(-180deg)}.list{border-left:1px solid var(--color-gray-4);display:grid;gap:.25rem;margin-inline-start:1rem;padding-inline-start:.75rem}.root .inner{color:var(--color-text);display:grid;grid-template-columns:auto 1fr auto}.root .inner .label{font-weight:500}.root[data-active] .inner,.root[data-selected] .inner{color:var(--button-color)}.root[data-selected]{background:alpha(var(--button-color),.1)}
|
|
185
125
|
</style>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ButtonProps } from '@nui/components';
|
|
1
|
+
import type { ButtonProps, ButtonVariant } from '@nui/components';
|
|
2
|
+
import type { NuanceColor } from '@nui/types';
|
|
2
3
|
import type { RovingFocusProps } from '../../roving-focus/roving-focus.vue.js';
|
|
3
4
|
import type { TreeFilter, TreeIconResolver, TreeLoader, TreeModels } from '../types.js';
|
|
4
|
-
export
|
|
5
|
+
export interface TreeRootProps extends RovingFocusProps {
|
|
5
6
|
/** Resolves the icon for a given tree item */
|
|
6
7
|
iconResolver?: TreeIconResolver;
|
|
7
8
|
/** If set, selected items can be deleted with the Delete key */
|
|
@@ -12,13 +13,13 @@ export type TreeRootProps = RovingFocusProps & {
|
|
|
12
13
|
loadBranch: TreeLoader;
|
|
13
14
|
/** Filters which items are rendered */
|
|
14
15
|
filter?: TreeFilter;
|
|
15
|
-
/** Visual variant */
|
|
16
|
-
variant?: ButtonProps['variant'];
|
|
17
16
|
/** Color from theme */
|
|
18
|
-
color?:
|
|
17
|
+
color?: NuanceColor;
|
|
19
18
|
/** Component size */
|
|
20
19
|
size?: ButtonProps['size'];
|
|
21
|
-
|
|
20
|
+
/** Visual variant */
|
|
21
|
+
variant?: ButtonVariant;
|
|
22
|
+
}
|
|
22
23
|
type __VLS_Props = TreeRootProps;
|
|
23
24
|
type __VLS_ModelProps = {
|
|
24
25
|
'active'?: TreeModels['active'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useVarsResolver } from "@nui/composables";
|
|
3
3
|
import { getSize } from "@nui/utils";
|
|
4
4
|
import { onClickOutside, useEventListener } from "@vueuse/core";
|
|
5
5
|
import { useTemplateRef } from "vue";
|
|
@@ -19,24 +19,26 @@ const {
|
|
|
19
19
|
loadBranch,
|
|
20
20
|
filter
|
|
21
21
|
} = defineProps({
|
|
22
|
-
loop: { type: Boolean, required: false },
|
|
23
|
-
orientation: { type: String, required: false },
|
|
24
|
-
attr: { type: String, required: false },
|
|
25
22
|
iconResolver: { type: Function, required: false },
|
|
26
23
|
removable: { type: Boolean, required: false },
|
|
27
24
|
selectable: { type: Boolean, required: false },
|
|
28
25
|
loadBranch: { type: Function, required: true },
|
|
29
26
|
filter: { type: [String, null, Function], required: false },
|
|
30
|
-
variant: { type: String, required: false },
|
|
31
27
|
color: { type: null, required: false },
|
|
32
|
-
size: { type: null, required: false }
|
|
28
|
+
size: { type: null, required: false },
|
|
29
|
+
variant: { type: String, required: false },
|
|
30
|
+
loop: { type: Boolean, required: false },
|
|
31
|
+
orientation: { type: String, required: false },
|
|
32
|
+
attr: { type: String, required: false }
|
|
33
33
|
});
|
|
34
34
|
const emit = defineEmits(["delete"]);
|
|
35
35
|
const active = defineModel("active", { type: [String, null], ...{ default: null } });
|
|
36
36
|
const selected = defineModel("selected", { type: Array, ...{ default: [] } });
|
|
37
37
|
const expanded = defineModel("expanded", { type: Array, ...{ default: [] } });
|
|
38
|
-
const style =
|
|
39
|
-
|
|
38
|
+
const style = useVarsResolver(() => ({
|
|
39
|
+
root: {
|
|
40
|
+
"--icon-size": getSize(size)
|
|
41
|
+
}
|
|
40
42
|
}));
|
|
41
43
|
const root = useTemplateRef("parent");
|
|
42
44
|
onClickOutside(root, () => selected.value = []);
|
|
@@ -69,7 +71,7 @@ if (removable) {
|
|
|
69
71
|
is='ul'
|
|
70
72
|
ref='parent'
|
|
71
73
|
role='tree'
|
|
72
|
-
:style
|
|
74
|
+
:style='style.root'
|
|
73
75
|
:class='$style.root'
|
|
74
76
|
@keydown.esc.prevent='selected = []'
|
|
75
77
|
>
|
|
@@ -78,14 +80,6 @@ if (removable) {
|
|
|
78
80
|
</RovingFocus>
|
|
79
81
|
</template>
|
|
80
82
|
|
|
81
|
-
<style module
|
|
82
|
-
.root
|
|
83
|
-
--tree-icon-size: var(--spacing-md);
|
|
84
|
-
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
gap: .25rem;
|
|
88
|
-
|
|
89
|
-
padding-inline-start: 0;
|
|
90
|
-
}
|
|
83
|
+
<style module>
|
|
84
|
+
.root{--tree-icon-size:var(--spacing-md);display:flex;flex-direction:column;gap:.25rem;padding-inline-start:0}
|
|
91
85
|
</style>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ButtonProps } from '@nui/components';
|
|
1
|
+
import type { ButtonProps, ButtonVariant } from '@nui/components';
|
|
2
|
+
import type { NuanceColor } from '@nui/types';
|
|
2
3
|
import type { RovingFocusProps } from '../../roving-focus/roving-focus.vue.js';
|
|
3
4
|
import type { TreeFilter, TreeIconResolver, TreeLoader, TreeModels } from '../types.js';
|
|
4
|
-
export
|
|
5
|
+
export interface TreeRootProps extends RovingFocusProps {
|
|
5
6
|
/** Resolves the icon for a given tree item */
|
|
6
7
|
iconResolver?: TreeIconResolver;
|
|
7
8
|
/** If set, selected items can be deleted with the Delete key */
|
|
@@ -12,13 +13,13 @@ export type TreeRootProps = RovingFocusProps & {
|
|
|
12
13
|
loadBranch: TreeLoader;
|
|
13
14
|
/** Filters which items are rendered */
|
|
14
15
|
filter?: TreeFilter;
|
|
15
|
-
/** Visual variant */
|
|
16
|
-
variant?: ButtonProps['variant'];
|
|
17
16
|
/** Color from theme */
|
|
18
|
-
color?:
|
|
17
|
+
color?: NuanceColor;
|
|
19
18
|
/** Component size */
|
|
20
19
|
size?: ButtonProps['size'];
|
|
21
|
-
|
|
20
|
+
/** Visual variant */
|
|
21
|
+
variant?: ButtonVariant;
|
|
22
|
+
}
|
|
22
23
|
type __VLS_Props = TreeRootProps;
|
|
23
24
|
type __VLS_ModelProps = {
|
|
24
25
|
'active'?: TreeModels['active'];
|
|
@@ -11,17 +11,17 @@ const {
|
|
|
11
11
|
filter = "directory",
|
|
12
12
|
...props
|
|
13
13
|
} = defineProps({
|
|
14
|
-
loop: { type: Boolean, required: false },
|
|
15
|
-
orientation: { type: String, required: false },
|
|
16
|
-
attr: { type: String, required: false },
|
|
17
14
|
iconResolver: { type: Function, required: false },
|
|
18
15
|
removable: { type: Boolean, required: false },
|
|
19
16
|
selectable: { type: Boolean, required: false },
|
|
20
17
|
loadBranch: { type: Function, required: true },
|
|
21
18
|
filter: { type: [String, null, Function], required: false },
|
|
22
|
-
variant: { type: String, required: false },
|
|
23
19
|
color: { type: null, required: false },
|
|
24
|
-
size: { type: null, required: false }
|
|
20
|
+
size: { type: null, required: false },
|
|
21
|
+
variant: { type: String, required: false },
|
|
22
|
+
loop: { type: Boolean, required: false },
|
|
23
|
+
orientation: { type: String, required: false },
|
|
24
|
+
attr: { type: String, required: false }
|
|
25
25
|
});
|
|
26
26
|
defineEmits(["delete"]);
|
|
27
27
|
const active = defineModel("active", { type: [String, null], ...{ default: null } });
|