@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.
@@ -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 decoration"',
37
- gridTemplateColumns: '16px 1fr auto minmax(8px, 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
- export const variant = styleVariants({
59
- primary: {
60
- color: themeVars.color.blue[500],
61
- ':hover': {
62
- vars: {
63
- [vars.backgroundColor]: themeVars.color.blue[50],
64
- [vars.color]: themeVars.color.blue[500]
65
- }
66
- }
67
- },
68
- dark: {
69
- ':hover': {
70
- vars: {
71
- [vars.backgroundColor]: themeVars.color.gray[100],
72
- [vars.color]: themeVars.color.font.text
73
- }
74
- }
75
- },
76
- default: {
77
- ':hover': {
78
- vars: {
79
- [vars.backgroundColor]: themeVars.color.gray[100],
80
- [vars.color]: themeVars.color.font.text
81
- }
82
- }
83
- },
84
- tertiary: {
85
- ':hover': {
86
- vars: {
87
- [vars.backgroundColor]: themeVars.color.gray[100],
88
- [vars.color]: themeVars.color.font.text
89
- }
90
- }
91
- },
92
- success: {
93
- color: themeVars.color.green[600],
94
- ':hover': {
95
- vars: {
96
- [vars.backgroundColor]: themeVars.color.green[50],
97
- [vars.color]: themeVars.color.green[600]
98
- }
99
- }
100
- },
101
- warning: {
102
- color: themeVars.color.amber[600],
103
- ':hover': {
104
- vars: {
105
- [vars.backgroundColor]: themeVars.color.amber[50],
106
- [vars.color]: themeVars.color.amber[600]
107
- }
108
- }
109
- },
110
- error: {
111
- color: themeVars.color.red[600],
112
- ':hover': {
113
- vars: {
114
- [vars.backgroundColor]: themeVars.color.red[50],
115
- [vars.color]: themeVars.color.red[500]
116
- }
117
- }
118
- }
119
- });
120
-
121
- export const menuItemTextContainer = style({
122
- margin: `0 ${themeVars.space[0.5]}`,
123
- gridArea: 'name',
124
- overflow: 'hidden',
125
- display: 'flex',
126
- alignItems: 'center',
127
- gap: themeVars.space[2]
128
- });
129
-
130
- export const menuItemText = style({
131
- flex: `0 1 auto`,
132
- overflow: 'hidden',
133
- whiteSpace: 'nowrap',
134
- textOverflow: 'ellipsis'
135
- });
136
-
137
- export const menuItemIcon = style({
138
- gridArea: 'icon',
139
- flexShrink: 0,
140
- display: 'flex',
141
- position: 'relative',
142
- top: '1px',
143
- opacity: 0.8
144
- });
145
-
146
- export const menuSeperator = style({
147
- height: '1px',
148
- backgroundColor: themeVars.color.gray[200],
149
- width: `calc(100% + 10px)`,
150
- margin: `5px -5px`
151
- });
152
-
153
- export const heading = style({
154
- padding: `${themeVars.space[2]} ${themeVars.space[2.5]}`,
155
- fontWeight: 500,
156
- fontSize: themeVars.fontSize.small,
157
- color: themeVars.color.gray[600]
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
+ });
@@ -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 { default as MDropdownWrapper } from './dropdown/DropdownWrapper.vue';
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';
@@ -5,7 +5,7 @@
5
5
  @mouseenter="show"
6
6
  @mouseleave="hide"
7
7
  ref="wrapper">
8
- <TooltipTrigger ref="reference" >
8
+ <TooltipTrigger ref="reference" >
9
9
  <slot/>
10
10
  </TooltipTrigger>
11
11
 
@@ -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,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -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>