webcake-ui-kit 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcake-ui-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "UI Kit for Vue 2 && 3 - Pure Options API",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"./WkInputCounter": "./src/components/input-counter/InputCounter.vue",
|
|
41
41
|
"./WkInputNumber": "./src/components/input-number/InputNumber.vue",
|
|
42
42
|
"./WkMenu": "./src/components/menu/Menu.vue",
|
|
43
|
+
"./WkMenuItem": "./src/components/menuitem/MenuItem.vue",
|
|
43
44
|
"./WkPagination": "./src/components/pagination/Pagination.vue",
|
|
44
45
|
"./WkPopover": "./src/components/popover/Popover.vue",
|
|
45
46
|
"./WkProgress": "./src/components/progress/Progress.vue",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="ui-menuitem"
|
|
4
|
+
:class="{
|
|
5
|
+
'ui-menuitem--active': active,
|
|
6
|
+
'ui-menuitem--disabled': disabled,
|
|
7
|
+
'ui-menuitem--error': type === 'error',
|
|
8
|
+
[`ui-menuitem--${size}`]: size
|
|
9
|
+
}"
|
|
10
|
+
:title="label"
|
|
11
|
+
@click="handleClick"
|
|
12
|
+
>
|
|
13
|
+
<span v-if="$slots.prefix" class="ui-menuitem__prefix">
|
|
14
|
+
<slot name="prefix"></slot>
|
|
15
|
+
</span>
|
|
16
|
+
<span class="ui-menuitem__label">{{ label }}</span>
|
|
17
|
+
<span v-if="$slots.suffix" class="ui-menuitem__suffix">
|
|
18
|
+
<slot name="suffix"></slot>
|
|
19
|
+
</span>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'MenuItem',
|
|
26
|
+
|
|
27
|
+
props: {
|
|
28
|
+
type: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'default',
|
|
31
|
+
validator: function (value) {
|
|
32
|
+
return ['default', 'error'].indexOf(value) !== -1
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
active: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
value: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: null
|
|
46
|
+
},
|
|
47
|
+
label: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'md',
|
|
54
|
+
validator: function (value) {
|
|
55
|
+
return ['sm', 'md', 'lg'].indexOf(value) !== -1
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
emits: ['click'],
|
|
61
|
+
|
|
62
|
+
methods: {
|
|
63
|
+
handleClick() {
|
|
64
|
+
if (!this.disabled) {
|
|
65
|
+
this.$emit('click', this.value)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style src="./menuitem.css" scoped></style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.ui-menuitem {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
min-height: 36px;
|
|
5
|
+
border-radius: var(--radius-8, 8px);
|
|
6
|
+
font-family: var(--font-family-body);
|
|
7
|
+
font-size: var(--paragraph-small-font-size);
|
|
8
|
+
line-height: var(--paragraph-small-line-height);
|
|
9
|
+
color: var(--primary-fg);
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
user-select: none;
|
|
12
|
+
transition: background 0.1s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ui-menuitem:hover:not(.ui-menuitem--disabled) {
|
|
16
|
+
background: var(--accent-bg);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ui-menuitem--active {
|
|
20
|
+
background: var(--accent-2);
|
|
21
|
+
font-weight: var(--paragraph-medium-font-weight);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ui-menuitem--disabled {
|
|
25
|
+
opacity: 0.4;
|
|
26
|
+
cursor: not-allowed;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ui-menuitem--error {
|
|
31
|
+
color: var(--destructive-text);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ui-menuitem--error:hover {
|
|
35
|
+
background: var(--destructive-subtle) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ui-menuitem--error.ui-menuitem--active {
|
|
39
|
+
background: var(--destructive-subtle) !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Sizes */
|
|
43
|
+
|
|
44
|
+
.ui-menuitem--sm {
|
|
45
|
+
min-height: 28px;
|
|
46
|
+
padding: var(--spacing-2xs) var(--spacing-xs);
|
|
47
|
+
gap: var(--spacing-xs);
|
|
48
|
+
font-size: var(--paragraph-mini-font-size);
|
|
49
|
+
line-height: var(--paragraph-mini-line-height);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ui-menuitem--md {
|
|
53
|
+
min-height: 32px;
|
|
54
|
+
padding: var(--spacing-5p5) var(--spacing-xs);
|
|
55
|
+
gap: var(--spacing-xs);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ui-menuitem--lg {
|
|
59
|
+
min-height: 36px;
|
|
60
|
+
padding: var(--spacing-7p5) var(--spacing-sm);
|
|
61
|
+
gap: var(--spacing-sm);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Slots */
|
|
65
|
+
|
|
66
|
+
.ui-menuitem__prefix {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
width: 20px;
|
|
73
|
+
height: 20px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ui-menuitem--sm .ui-menuitem__prefix {
|
|
77
|
+
width: 16px;
|
|
78
|
+
height: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ui-menuitem__label {
|
|
82
|
+
flex: 1;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
text-overflow: ellipsis;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ui-menuitem__suffix {
|
|
90
|
+
font-size: var(--paragraph-small-font-size);
|
|
91
|
+
line-height: var(--paragraph-small-line-height);
|
|
92
|
+
color: var(--muted-fg);
|
|
93
|
+
flex-shrink: 0;
|
|
94
|
+
margin-left: auto;
|
|
95
|
+
padding-left: var(--spacing-sm);
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ui-menuitem--sm .ui-menuitem__suffix {
|
|
100
|
+
font-size: var(--paragraph-mini-font-size);
|
|
101
|
+
line-height: var(--paragraph-mini-line-height);
|
|
102
|
+
}
|
package/src/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { default as WkInput } from './components/input/Input.vue'
|
|
|
22
22
|
export { default as WkInputCounter } from './components/input-counter/InputCounter.vue'
|
|
23
23
|
export { default as WkInputNumber } from './components/input-number/InputNumber.vue'
|
|
24
24
|
export { default as WkMenu } from './components/menu/Menu.vue'
|
|
25
|
+
export { default as WkMenuItem } from './components/menuitem/MenuItem.vue'
|
|
25
26
|
export { default as WkPagination } from './components/pagination/Pagination.vue'
|
|
26
27
|
export { default as WkPopover } from './components/popover/Popover.vue'
|
|
27
28
|
export { default as WkProgress } from './components/progress/Progress.vue'
|