webcake-ui-kit 1.2.7 → 1.2.9
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 +2 -1
- package/src/components/item/Item.vue +74 -0
- package/src/components/item/item.css +55 -0
- package/src/index.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcake-ui-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"description": "UI Kit for Vue 2 && 3 - Pure Options API",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"./WkInput": "./src/components/input/Input.vue",
|
|
40
40
|
"./WkInputCounter": "./src/components/input-counter/InputCounter.vue",
|
|
41
41
|
"./WkInputNumber": "./src/components/input-number/InputNumber.vue",
|
|
42
|
+
"./WkItem": "./src/components/item/Item.vue",
|
|
42
43
|
"./WkMenu": "./src/components/menu/Menu.vue",
|
|
43
44
|
"./WkMenuItem": "./src/components/menuitem/MenuItem.vue",
|
|
44
45
|
"./WkPagination": "./src/components/pagination/Pagination.vue",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="ui-item"
|
|
4
|
+
:class="[
|
|
5
|
+
`ui-item--variant-${variant}`,
|
|
6
|
+
asChild && `ui-item--as-child`,
|
|
7
|
+
active && 'ui-item--active',
|
|
8
|
+
`ui-item--size-${size}`,
|
|
9
|
+
`ui-item--layout-${layout}`
|
|
10
|
+
]"
|
|
11
|
+
:style="{ width: typeof width == 'string' ? width : `${width}px` }"
|
|
12
|
+
>
|
|
13
|
+
<div class="ui-item--prefix">
|
|
14
|
+
<slot name="prefix"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
<slot>
|
|
17
|
+
<div class="ui-item-label-wrapper">
|
|
18
|
+
<div class="ui-item--label wk-paragraph-small wk-weight-medium">
|
|
19
|
+
{{ label }}
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="description && layout == 'vertical'" class="ui-item--description wk-paragraph-mini">
|
|
22
|
+
{{ description }}
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</slot>
|
|
26
|
+
<div class="ui-item--suffix">
|
|
27
|
+
<slot name="suffix"></slot>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
name: 'WkItem',
|
|
35
|
+
props: {
|
|
36
|
+
label: String,
|
|
37
|
+
variant: {
|
|
38
|
+
type: String,
|
|
39
|
+
validator: v => ['default', 'muted', 'outline'].includes(v),
|
|
40
|
+
default: 'default'
|
|
41
|
+
},
|
|
42
|
+
asChild: Boolean,
|
|
43
|
+
active: Boolean,
|
|
44
|
+
size: {
|
|
45
|
+
type: String,
|
|
46
|
+
validator: v => ['md', 'sm'].includes(v),
|
|
47
|
+
default: 'md'
|
|
48
|
+
},
|
|
49
|
+
layout: {
|
|
50
|
+
type: String,
|
|
51
|
+
validator: v => ['horizontal', 'vertical'].includes(v),
|
|
52
|
+
default: 'horizontal'
|
|
53
|
+
},
|
|
54
|
+
description: String,
|
|
55
|
+
width: {
|
|
56
|
+
type: [String, Number]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
emits: [],
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
// Add component state
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
// Add computed properties
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
// Add methods
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style src="./item.css" scoped></style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.ui-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--spacing-md);
|
|
5
|
+
padding: var(--spacing-md);
|
|
6
|
+
border: 1px solid transparent;
|
|
7
|
+
border-radius: var(--rounded-xl);
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
min-height: 52px;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
.ui-item.ui-item--as-child.ui-item--variant-outline {
|
|
13
|
+
border: 1px solid var(--border-primary);
|
|
14
|
+
background: #ffffff;
|
|
15
|
+
}
|
|
16
|
+
.ui-item--variant-muted {
|
|
17
|
+
background: var(--muted-bg);
|
|
18
|
+
}
|
|
19
|
+
.ui-item.ui-item--as-child:hover,
|
|
20
|
+
.ui-item.ui-item--as-child.ui-item--variant-outline:hover {
|
|
21
|
+
background: var(--primary-hover);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ui-item.ui-item--as-child.ui-item--active {
|
|
25
|
+
border: 1px solid var(--border-brand);
|
|
26
|
+
}
|
|
27
|
+
.ui-item.ui-item--size-sm {
|
|
28
|
+
min-height: 44px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ui-item.ui-item--layout-vertical {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
gap: var(--spacing-xs);
|
|
35
|
+
padding: var(--spacing-sm) var(--spacing-md);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ui-item-label-wrapper {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: var(--spacing-2xs);
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ui-item--label {
|
|
46
|
+
color: var(--primary-fg);
|
|
47
|
+
}
|
|
48
|
+
.ui-item--description {
|
|
49
|
+
color: var(--muted-fg);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ui-item--prefix,
|
|
53
|
+
.ui-item--suffix {
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
}
|
package/src/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { default as WkField } from './components/field/Field.vue'
|
|
|
20
20
|
export { default as WkHoverCard } from './components/hover-card/HoverCard.vue'
|
|
21
21
|
export { default as WkInput } from './components/input/Input.vue'
|
|
22
22
|
export { default as WkInputCounter } from './components/input-counter/InputCounter.vue'
|
|
23
|
+
export { default as WkItem } from './components/item/Item.vue'
|
|
23
24
|
export { default as WkInputNumber } from './components/input-number/InputNumber.vue'
|
|
24
25
|
export { default as WkMenu } from './components/menu/Menu.vue'
|
|
25
26
|
export { default as WkMenuItem } from './components/menuitem/MenuItem.vue'
|