@teammodlr/ui-kit 2.2.2 → 2.3.0
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/lib/components/dialog/Dialog.vue.d.ts +1 -1
- package/lib/components/dropdown/Dropdown.vue.d.ts +16 -27
- package/lib/components/dropdown/DropdownItem.vue.d.ts +1 -2
- package/lib/components/index.d.ts +1 -2
- package/lib/components/messageprovider/Message.vue.d.ts +1 -1
- package/lib/components/modal/Modal.vue.d.ts +1 -1
- package/lib/components/primative/primitive.d.ts +1 -1
- package/lib/index.cjs.js +10 -8
- package/lib/index.es.js +8345 -4236
- package/lib/style.css +1 -1
- package/package.json +2 -1
- package/src/components/dropdown/Dropdown.vue +203 -331
- package/src/components/dropdown/DropdownHeading.vue +23 -23
- package/src/components/dropdown/DropdownItem.vue +116 -151
- package/src/components/dropdown/examples/basic.vue +126 -119
- package/src/components/dropdown/examples/context.vue +52 -71
- package/src/components/dropdown/style/Dropdown.css.ts +159 -158
- package/src/components/index.ts +1 -2
- package/src/components/tooltip/Tooltip.vue +1 -1
- package/lib/components/dropdown/DropdownSeperator.vue.d.ts +0 -4
- package/lib/components/dropdown/DropdownTrigger.vue.d.ts +0 -11
- package/lib/components/dropdown/DropdownWrapper.vue.d.ts +0 -2
- package/src/components/dropdown/DropdownSeperator.vue +0 -23
- package/src/components/dropdown/DropdownTrigger.vue +0 -20
- package/src/components/dropdown/DropdownWrapper.vue +0 -18
|
@@ -1,158 +1,159 @@
|
|
|
1
|
-
import { createVar, style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { themeVars } from '../../../styles/theme.css';
|
|
3
|
-
|
|
4
|
-
export const menu = style({
|
|
5
|
-
backgroundColor: '#ffffff',
|
|
6
|
-
borderRadius: '5px',
|
|
7
|
-
padding: '5px',
|
|
8
|
-
zIndex: 4000,
|
|
9
|
-
boxSizing: 'border-box',
|
|
10
|
-
position: 'relative',
|
|
11
|
-
minWidth: '130px',
|
|
12
|
-
maxWidth: '350px',
|
|
13
|
-
border: `1px solid ${themeVars.color.gray[300]}`,
|
|
14
|
-
boxShadow: themeVars.shadow.md,
|
|
15
|
-
overflow: 'auto'
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const menuItems = style({
|
|
19
|
-
listStyle: 'none',
|
|
20
|
-
margin: 0,
|
|
21
|
-
padding: 0
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const vars = {
|
|
25
|
-
backgroundColor: createVar(),
|
|
26
|
-
color: createVar()
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const menuItem = style({
|
|
30
|
-
vars: {
|
|
31
|
-
[vars.backgroundColor]: 'transparent',
|
|
32
|
-
[vars.color]: themeVars.color.font.text
|
|
33
|
-
},
|
|
34
|
-
display: 'grid',
|
|
35
|
-
alignItems: 'center',
|
|
36
|
-
gridTemplateAreas: '"icon name kbd
|
|
37
|
-
gridTemplateColumns: '16px 1fr auto
|
|
38
|
-
gridTemplateRows: '16px',
|
|
39
|
-
columnGap: themeVars.space['1.5'],
|
|
40
|
-
rowGap: themeVars.space['0.5'],
|
|
41
|
-
borderRadius: themeVars.rounded.default,
|
|
42
|
-
padding: `${themeVars.space['2']} ${themeVars.space['1.5']}`,
|
|
43
|
-
fontSize: themeVars.fontSize.base,
|
|
44
|
-
color: themeVars.color.font.text,
|
|
45
|
-
cursor: 'pointer',
|
|
46
|
-
transition: 'background-color 0.14s ease',
|
|
47
|
-
textDecoration: 'none',
|
|
48
|
-
':hover': {
|
|
49
|
-
vars: {
|
|
50
|
-
[vars.backgroundColor]: themeVars.color.gray[100],
|
|
51
|
-
[vars.color]: themeVars.color.font.text
|
|
52
|
-
},
|
|
53
|
-
backgroundColor: vars.backgroundColor,
|
|
54
|
-
color: vars.color
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[vars.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[vars.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
[vars.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
[vars.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
[vars.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
[vars.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
[vars.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
import { createVar, style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
|
+
|
|
4
|
+
export const menu = style({
|
|
5
|
+
backgroundColor: '#ffffff',
|
|
6
|
+
borderRadius: '5px',
|
|
7
|
+
padding: '5px',
|
|
8
|
+
zIndex: 4000,
|
|
9
|
+
boxSizing: 'border-box',
|
|
10
|
+
position: 'relative',
|
|
11
|
+
minWidth: '130px',
|
|
12
|
+
maxWidth: '350px',
|
|
13
|
+
border: `1px solid ${themeVars.color.gray[300]}`,
|
|
14
|
+
boxShadow: themeVars.shadow.md,
|
|
15
|
+
overflow: 'auto'
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const menuItems = style({
|
|
19
|
+
listStyle: 'none',
|
|
20
|
+
margin: 0,
|
|
21
|
+
padding: 0
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const vars = {
|
|
25
|
+
backgroundColor: createVar(),
|
|
26
|
+
color: createVar()
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const menuItem = style({
|
|
30
|
+
vars: {
|
|
31
|
+
[vars.backgroundColor]: 'transparent',
|
|
32
|
+
[vars.color]: themeVars.color.font.text
|
|
33
|
+
},
|
|
34
|
+
display: 'grid',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
gridTemplateAreas: '"icon name kbd"',
|
|
37
|
+
gridTemplateColumns: '16px 1fr auto',
|
|
38
|
+
gridTemplateRows: '16px',
|
|
39
|
+
columnGap: themeVars.space['1.5'],
|
|
40
|
+
rowGap: themeVars.space['0.5'],
|
|
41
|
+
borderRadius: themeVars.rounded.default,
|
|
42
|
+
padding: `${themeVars.space['2']} ${themeVars.space['1.5']}`,
|
|
43
|
+
fontSize: themeVars.fontSize.base,
|
|
44
|
+
color: themeVars.color.font.text,
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
transition: 'background-color 0.14s ease',
|
|
47
|
+
textDecoration: 'none',
|
|
48
|
+
':hover': {
|
|
49
|
+
vars: {
|
|
50
|
+
[vars.backgroundColor]: themeVars.color.gray[100],
|
|
51
|
+
[vars.color]: themeVars.color.font.text
|
|
52
|
+
},
|
|
53
|
+
backgroundColor: vars.backgroundColor,
|
|
54
|
+
color: vars.color,
|
|
55
|
+
outline: 'none'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const variant = styleVariants({
|
|
60
|
+
primary: {
|
|
61
|
+
color: themeVars.color.blue[500],
|
|
62
|
+
':hover': {
|
|
63
|
+
vars: {
|
|
64
|
+
[vars.backgroundColor]: themeVars.color.blue[50],
|
|
65
|
+
[vars.color]: themeVars.color.blue[500]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
dark: {
|
|
70
|
+
':hover': {
|
|
71
|
+
vars: {
|
|
72
|
+
[vars.backgroundColor]: themeVars.color.gray[100],
|
|
73
|
+
[vars.color]: themeVars.color.font.text
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
default: {
|
|
78
|
+
':hover': {
|
|
79
|
+
vars: {
|
|
80
|
+
[vars.backgroundColor]: themeVars.color.gray[100],
|
|
81
|
+
[vars.color]: themeVars.color.font.text
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
tertiary: {
|
|
86
|
+
':hover': {
|
|
87
|
+
vars: {
|
|
88
|
+
[vars.backgroundColor]: themeVars.color.gray[100],
|
|
89
|
+
[vars.color]: themeVars.color.font.text
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
success: {
|
|
94
|
+
color: themeVars.color.green[600],
|
|
95
|
+
':hover': {
|
|
96
|
+
vars: {
|
|
97
|
+
[vars.backgroundColor]: themeVars.color.green[50],
|
|
98
|
+
[vars.color]: themeVars.color.green[600]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
warning: {
|
|
103
|
+
color: themeVars.color.amber[600],
|
|
104
|
+
':hover': {
|
|
105
|
+
vars: {
|
|
106
|
+
[vars.backgroundColor]: themeVars.color.amber[50],
|
|
107
|
+
[vars.color]: themeVars.color.amber[600]
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
error: {
|
|
112
|
+
color: themeVars.color.red[600],
|
|
113
|
+
':hover': {
|
|
114
|
+
vars: {
|
|
115
|
+
[vars.backgroundColor]: themeVars.color.red[50],
|
|
116
|
+
[vars.color]: themeVars.color.red[500]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const menuItemTextContainer = style({
|
|
123
|
+
margin: `0 ${themeVars.space[0.5]}`,
|
|
124
|
+
gridArea: 'name',
|
|
125
|
+
overflow: 'hidden',
|
|
126
|
+
display: 'flex',
|
|
127
|
+
alignItems: 'center',
|
|
128
|
+
gap: themeVars.space[2]
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const menuItemText = style({
|
|
132
|
+
flex: `0 1 auto`,
|
|
133
|
+
overflow: 'hidden',
|
|
134
|
+
whiteSpace: 'nowrap',
|
|
135
|
+
textOverflow: 'ellipsis'
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const menuItemIcon = style({
|
|
139
|
+
gridArea: 'icon',
|
|
140
|
+
flexShrink: 0,
|
|
141
|
+
display: 'flex',
|
|
142
|
+
position: 'relative',
|
|
143
|
+
top: '1px',
|
|
144
|
+
opacity: 0.8
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export const menuSeperator = style({
|
|
148
|
+
height: '1px',
|
|
149
|
+
backgroundColor: themeVars.color.gray[200],
|
|
150
|
+
width: `calc(100% + 10px)`,
|
|
151
|
+
margin: `5px -5px`
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export const heading = style({
|
|
155
|
+
padding: `${themeVars.space[2]} ${themeVars.space[2.5]}`,
|
|
156
|
+
fontWeight: 500,
|
|
157
|
+
fontSize: themeVars.fontSize.small,
|
|
158
|
+
color: themeVars.color.gray[600]
|
|
159
|
+
});
|
package/src/components/index.ts
CHANGED
|
@@ -15,9 +15,8 @@ export { default as MColorPicker } from './colorpicker/ColorPicker.vue';
|
|
|
15
15
|
export { default as MDropdown } from './dropdown/Dropdown.vue';
|
|
16
16
|
export { default as MDropdownItem } from './dropdown/DropdownItem.vue';
|
|
17
17
|
export { default as MDropdownList } from './dropdown/DropdownList.vue';
|
|
18
|
-
export { default as MDropdownSeperator } from './dropdown/DropdownSeperator.vue';
|
|
19
18
|
export { default as MDropdownHeading } from './dropdown/DropdownHeading.vue';
|
|
20
|
-
export {
|
|
19
|
+
export { DropdownMenuSub as MDropdownMenuSub, DropdownMenuSubTrigger as MDropdownMenuSubTrigger, DropdownMenuSubContent as MDropdownMenuSubContent } from 'radix-vue';
|
|
21
20
|
export { default as MForm } from './form/Form.vue';
|
|
22
21
|
export { default as MImage } from './image/Image.vue';
|
|
23
22
|
export { default as MInput } from './input/Input.vue';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
computedClasses: import("vue").ComputedRef<string[]>;
|
|
3
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
4
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare function __VLS_template(): {
|
|
2
|
-
default?(_: {}): any;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
5
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
6
|
-
export default _default;
|
|
7
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
8
|
-
new (): {
|
|
9
|
-
$slots: S;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li :class="computedClasses"></li>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import {computed, defineComponent} from "vue";
|
|
7
|
-
import * as style from "./style";
|
|
8
|
-
|
|
9
|
-
export default defineComponent({
|
|
10
|
-
name: "DropdownSeperator",
|
|
11
|
-
setup() {
|
|
12
|
-
const computedClasses = computed(() => {
|
|
13
|
-
return [
|
|
14
|
-
style.menuSeperator
|
|
15
|
-
]
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
computedClasses
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
</script>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {Primitive} from "../primative/primitive";
|
|
3
|
-
import { useForwardExpose } from "../../utils/useForwardExpose";
|
|
4
|
-
import {onMounted} from "vue";
|
|
5
|
-
import { injectDropdownContext } from "./Dropdown.vue";
|
|
6
|
-
|
|
7
|
-
const { forwardRef, currentElement } = useForwardExpose();
|
|
8
|
-
|
|
9
|
-
const dropdownContext = injectDropdownContext();
|
|
10
|
-
|
|
11
|
-
onMounted(() => {
|
|
12
|
-
dropdownContext.onReferenceChange(currentElement.value);
|
|
13
|
-
})
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<Primitive as-child :ref="forwardRef">
|
|
18
|
-
<slot />
|
|
19
|
-
</Primitive>
|
|
20
|
-
</template>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<slot />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import { defineComponent, inject, provide } from 'vue';
|
|
7
|
-
import {DROPDOWN_STATE} from "./symbol";
|
|
8
|
-
|
|
9
|
-
export default defineComponent({
|
|
10
|
-
name: 'DropdownWrapper',
|
|
11
|
-
setup() {
|
|
12
|
-
const state = inject(DROPDOWN_STATE, null);
|
|
13
|
-
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
provide('dropdown-select', state?.handleSelect);
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
</script>
|