webcake-ui-kit 1.1.5 → 1.1.7
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 +1 -1
- package/src/components/dialog/dialog.css +1 -1
- package/src/components/input/input.css +14 -4
- package/src/components/select/Select.vue +12 -5
- package/src/components/select/select.css +10 -5
- package/src/components/select-option/SelectOption.vue +1 -1
- package/src/components/slider/Slider.vue +42 -14
- package/src/components/tabs/Tabs.vue +29 -5
- package/src/components/tabs/tabs.css +3 -0
- package/src/icons/GenerateImage.vue +36 -0
- package/src/icons/index.js +1 -0
package/package.json
CHANGED
|
@@ -14,31 +14,34 @@
|
|
|
14
14
|
|
|
15
15
|
/* Size — paddings, gaps, heights, typography. Inner field inherits typography. */
|
|
16
16
|
.ui-input--size-md {
|
|
17
|
-
|
|
17
|
+
height: 36px;
|
|
18
18
|
gap: var(--spacing-xs);
|
|
19
19
|
padding: var(--spacing-7p5) var(--spacing-sm);
|
|
20
20
|
font-size: var(--paragraph-small-font-size);
|
|
21
21
|
line-height: var(--paragraph-small-line-height);
|
|
22
22
|
letter-spacing: var(--paragraph-small-letter-spacing);
|
|
23
23
|
}
|
|
24
|
+
|
|
24
25
|
.ui-input--size-lg {
|
|
25
|
-
|
|
26
|
+
height: 40px;
|
|
26
27
|
gap: var(--spacing-sm);
|
|
27
28
|
padding: var(--spacing-9p5) var(--spacing-md);
|
|
28
29
|
font-size: var(--paragraph-small-font-size);
|
|
29
30
|
line-height: var(--paragraph-small-line-height);
|
|
30
31
|
letter-spacing: var(--paragraph-small-letter-spacing);
|
|
31
32
|
}
|
|
33
|
+
|
|
32
34
|
.ui-input--size-sm {
|
|
33
|
-
|
|
35
|
+
height: 32px;
|
|
34
36
|
gap: var(--spacing-6);
|
|
35
37
|
padding: var(--spacing-5p5) var(--spacing-xs);
|
|
36
38
|
font-size: var(--paragraph-small-font-size);
|
|
37
39
|
line-height: var(--paragraph-small-line-height);
|
|
38
40
|
letter-spacing: var(--paragraph-small-letter-spacing);
|
|
39
41
|
}
|
|
42
|
+
|
|
40
43
|
.ui-input--size-xs {
|
|
41
|
-
|
|
44
|
+
height: 28px;
|
|
42
45
|
gap: var(--spacing-2xs);
|
|
43
46
|
padding: var(--spacing-6);
|
|
44
47
|
font-size: var(--paragraph-mini-font-size);
|
|
@@ -50,9 +53,11 @@
|
|
|
50
53
|
.ui-input--round-default {
|
|
51
54
|
border-radius: var(--rounded-xl);
|
|
52
55
|
}
|
|
56
|
+
|
|
53
57
|
.ui-input--size-xs.ui-input--round-default {
|
|
54
58
|
border-radius: var(--radius);
|
|
55
59
|
}
|
|
60
|
+
|
|
56
61
|
.ui-input--round-round {
|
|
57
62
|
border-radius: var(--rounded-full);
|
|
58
63
|
}
|
|
@@ -68,6 +73,7 @@
|
|
|
68
73
|
border-color: var(--destructive-border);
|
|
69
74
|
box-shadow: none;
|
|
70
75
|
}
|
|
76
|
+
|
|
71
77
|
.ui-input--error:focus-within {
|
|
72
78
|
border-color: var(--destructive-border);
|
|
73
79
|
box-shadow: 0 0 0 3px var(--focus-ring-error);
|
|
@@ -77,6 +83,7 @@
|
|
|
77
83
|
.ui-input--disabled {
|
|
78
84
|
opacity: 0.5;
|
|
79
85
|
}
|
|
86
|
+
|
|
80
87
|
.ui-input--disabled:focus-within {
|
|
81
88
|
border-color: var(--border-primary);
|
|
82
89
|
box-shadow: var(--shadow-xs);
|
|
@@ -96,10 +103,12 @@
|
|
|
96
103
|
font: inherit;
|
|
97
104
|
letter-spacing: inherit;
|
|
98
105
|
}
|
|
106
|
+
|
|
99
107
|
.ui-input__field::placeholder {
|
|
100
108
|
color: var(--muted-fg);
|
|
101
109
|
opacity: 1;
|
|
102
110
|
}
|
|
111
|
+
|
|
103
112
|
.ui-input__field:disabled {
|
|
104
113
|
cursor: not-allowed;
|
|
105
114
|
}
|
|
@@ -114,6 +123,7 @@
|
|
|
114
123
|
height: 20px;
|
|
115
124
|
color: var(--muted-fg);
|
|
116
125
|
}
|
|
126
|
+
|
|
117
127
|
.ui-input--size-xs .ui-input__decoration {
|
|
118
128
|
width: 16px;
|
|
119
129
|
height: 16px;
|
|
@@ -89,6 +89,9 @@ export default {
|
|
|
89
89
|
type: String,
|
|
90
90
|
default: ''
|
|
91
91
|
},
|
|
92
|
+
modelValue: {
|
|
93
|
+
default: null
|
|
94
|
+
},
|
|
92
95
|
options: {
|
|
93
96
|
type: Array,
|
|
94
97
|
default: () => []
|
|
@@ -119,7 +122,7 @@ export default {
|
|
|
119
122
|
}
|
|
120
123
|
},
|
|
121
124
|
|
|
122
|
-
emits: ['change'],
|
|
125
|
+
emits: ['change', 'update:modelValue'],
|
|
123
126
|
|
|
124
127
|
data() {
|
|
125
128
|
return {
|
|
@@ -129,6 +132,9 @@ export default {
|
|
|
129
132
|
},
|
|
130
133
|
|
|
131
134
|
computed: {
|
|
135
|
+
effectiveValue() {
|
|
136
|
+
return this.modelValue !== null ? this.modelValue : this.value
|
|
137
|
+
},
|
|
132
138
|
normalizedOptions() {
|
|
133
139
|
return this.options.map(opt =>
|
|
134
140
|
typeof opt === 'string'
|
|
@@ -137,10 +143,10 @@ export default {
|
|
|
137
143
|
)
|
|
138
144
|
},
|
|
139
145
|
selectedLabel() {
|
|
140
|
-
if (!this.
|
|
141
|
-
if (this.labelCache[this.
|
|
142
|
-
const opt = this.normalizedOptions.find(o => o.value === this.
|
|
143
|
-
return opt ? opt.label : this.
|
|
146
|
+
if (!this.effectiveValue) return ''
|
|
147
|
+
if (this.labelCache[this.effectiveValue]) return this.labelCache[this.effectiveValue]
|
|
148
|
+
const opt = this.normalizedOptions.find(o => o.value === this.effectiveValue)
|
|
149
|
+
return opt ? opt.label : this.effectiveValue
|
|
144
150
|
},
|
|
145
151
|
hasIconSlot() {
|
|
146
152
|
return !!((this.$scopedSlots && this.$scopedSlots['icon']) || this.$slots['icon'])
|
|
@@ -159,6 +165,7 @@ export default {
|
|
|
159
165
|
},
|
|
160
166
|
select(val) {
|
|
161
167
|
this.$emit('change', val)
|
|
168
|
+
this.$emit('update:modelValue', val)
|
|
162
169
|
this.isOpen = false
|
|
163
170
|
},
|
|
164
171
|
registerOption(value, label) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
gap: var(--spacing-xs);
|
|
6
|
-
|
|
6
|
+
height: 36px;
|
|
7
7
|
width: 100%;
|
|
8
8
|
padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-sm);
|
|
9
9
|
border: 1px solid var(--border-primary);
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
width: 16px;
|
|
103
103
|
height: 16px;
|
|
104
104
|
flex-shrink: 0;
|
|
105
|
-
color: var(--
|
|
105
|
+
color: var(--primary-fg);
|
|
106
106
|
transition: transform 0.2s ease;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -112,10 +112,11 @@
|
|
|
112
112
|
|
|
113
113
|
/* — sizes — */
|
|
114
114
|
.ui-select--lg {
|
|
115
|
-
|
|
115
|
+
height: 40px;
|
|
116
116
|
padding: var(--spacing-10) var(--spacing-xs) var(--spacing-10) var(--spacing-md);
|
|
117
117
|
gap: var(--spacing-sm);
|
|
118
118
|
}
|
|
119
|
+
|
|
119
120
|
.ui-select--lg .ui-select__left {
|
|
120
121
|
gap: var(--spacing-sm);
|
|
121
122
|
}
|
|
@@ -123,23 +124,26 @@
|
|
|
123
124
|
/* default size is the base — no extra rules needed */
|
|
124
125
|
|
|
125
126
|
.ui-select--sm {
|
|
126
|
-
|
|
127
|
+
height: 32px;
|
|
127
128
|
padding: var(--spacing-6) var(--spacing-xs);
|
|
128
129
|
gap: var(--spacing-6);
|
|
129
130
|
}
|
|
131
|
+
|
|
130
132
|
.ui-select--sm .ui-select__left {
|
|
131
133
|
gap: var(--spacing-6);
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
.ui-select--xs {
|
|
135
|
-
|
|
137
|
+
height: 28px;
|
|
136
138
|
padding: var(--spacing-2xs) var(--spacing-6);
|
|
137
139
|
gap: var(--spacing-2xs);
|
|
138
140
|
border-radius: var(--rounded-lg);
|
|
139
141
|
}
|
|
142
|
+
|
|
140
143
|
.ui-select--xs .ui-select__left {
|
|
141
144
|
gap: var(--spacing-2xs);
|
|
142
145
|
}
|
|
146
|
+
|
|
143
147
|
.ui-select--xs .ui-select__value,
|
|
144
148
|
.ui-select--xs .ui-select__prepend {
|
|
145
149
|
font-size: var(--paragraph-mini-font-size);
|
|
@@ -160,6 +164,7 @@
|
|
|
160
164
|
.ui-select__list::-webkit-scrollbar {
|
|
161
165
|
width: 6px;
|
|
162
166
|
}
|
|
167
|
+
|
|
163
168
|
.ui-select__list::-webkit-scrollbar-thumb {
|
|
164
169
|
background: var(--border-primary);
|
|
165
170
|
border-radius: 3px;
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
|
|
58
58
|
computed: {
|
|
59
59
|
isSelected() {
|
|
60
|
-
return !!(this.select && this.select.
|
|
60
|
+
return !!(this.select && this.select.effectiveValue !== undefined && this.select.effectiveValue === this.value)
|
|
61
61
|
},
|
|
62
62
|
isDisabled() {
|
|
63
63
|
return this.disabled || !!(this.select && this.select.disabled)
|
|
@@ -61,8 +61,15 @@
|
|
|
61
61
|
<script>
|
|
62
62
|
export default {
|
|
63
63
|
name: 'Slider',
|
|
64
|
+
|
|
65
|
+
model: {
|
|
66
|
+
prop: 'value',
|
|
67
|
+
event: 'input'
|
|
68
|
+
},
|
|
69
|
+
|
|
64
70
|
props: {
|
|
65
|
-
value: { type: Number, default: 50 },
|
|
71
|
+
value: { type: [Number, Array], default: 50 },
|
|
72
|
+
modelValue: { default: null },
|
|
66
73
|
rangeValue: {
|
|
67
74
|
type: Array,
|
|
68
75
|
default: function () {
|
|
@@ -82,12 +89,17 @@ export default {
|
|
|
82
89
|
},
|
|
83
90
|
disabled: { type: Boolean, default: false }
|
|
84
91
|
},
|
|
85
|
-
|
|
92
|
+
|
|
93
|
+
emits: ['change', 'input', 'update:modelValue'],
|
|
94
|
+
|
|
86
95
|
data: function () {
|
|
96
|
+
var mv = this.modelValue !== null ? this.modelValue : this.value
|
|
97
|
+
var singleInit = typeof mv === 'number' ? mv : 50
|
|
98
|
+
var rangeInit = Array.isArray(mv) ? mv : Array.isArray(this.rangeValue) ? this.rangeValue : [25, 75]
|
|
87
99
|
return {
|
|
88
|
-
localValue:
|
|
89
|
-
localRangeMin:
|
|
90
|
-
localRangeMax:
|
|
100
|
+
localValue: singleInit,
|
|
101
|
+
localRangeMin: rangeInit[0],
|
|
102
|
+
localRangeMax: rangeInit[1],
|
|
91
103
|
dragging: null,
|
|
92
104
|
boundMouseMove: null,
|
|
93
105
|
boundMouseUp: null,
|
|
@@ -95,9 +107,21 @@ export default {
|
|
|
95
107
|
boundTouchEnd: null
|
|
96
108
|
}
|
|
97
109
|
},
|
|
110
|
+
|
|
98
111
|
watch: {
|
|
99
112
|
value: function (v) {
|
|
100
|
-
this.localValue = v
|
|
113
|
+
if (typeof v === 'number') this.localValue = v
|
|
114
|
+
else if (Array.isArray(v)) {
|
|
115
|
+
this.localRangeMin = v[0]
|
|
116
|
+
this.localRangeMax = v[1]
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
modelValue: function (v) {
|
|
120
|
+
if (typeof v === 'number') this.localValue = v
|
|
121
|
+
else if (Array.isArray(v)) {
|
|
122
|
+
this.localRangeMin = v[0]
|
|
123
|
+
this.localRangeMax = v[1]
|
|
124
|
+
}
|
|
101
125
|
},
|
|
102
126
|
rangeValue: function (v) {
|
|
103
127
|
if (Array.isArray(v)) {
|
|
@@ -191,19 +215,23 @@ export default {
|
|
|
191
215
|
document.removeEventListener('touchend', this.boundTouchEnd)
|
|
192
216
|
},
|
|
193
217
|
applyValue: function (which, val) {
|
|
218
|
+
var arr
|
|
194
219
|
if (which === 'single') {
|
|
195
220
|
this.localValue = val
|
|
196
221
|
this.$emit('input', val)
|
|
222
|
+
this.$emit('update:modelValue', val)
|
|
197
223
|
this.$emit('change', val)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
this
|
|
202
|
-
} else
|
|
203
|
-
|
|
204
|
-
this.localRangeMax = this.snap(newMax)
|
|
205
|
-
this.$emit('change', [this.localRangeMin, this.localRangeMax])
|
|
224
|
+
return
|
|
225
|
+
}
|
|
226
|
+
if (which === 'min') {
|
|
227
|
+
this.localRangeMin = this.snap(Math.min(val, this.localRangeMax - this.step))
|
|
228
|
+
} else {
|
|
229
|
+
this.localRangeMax = this.snap(Math.max(val, this.localRangeMin + this.step))
|
|
206
230
|
}
|
|
231
|
+
arr = [this.localRangeMin, this.localRangeMax]
|
|
232
|
+
this.$emit('input', arr)
|
|
233
|
+
this.$emit('update:modelValue', arr)
|
|
234
|
+
this.$emit('change', arr)
|
|
207
235
|
},
|
|
208
236
|
onTrackClick: function (event) {
|
|
209
237
|
if (this.disabled) return
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
type="button"
|
|
7
7
|
class="ui-tabs__item"
|
|
8
8
|
:class="{
|
|
9
|
-
'ui-tabs__item--active': tab.value ===
|
|
9
|
+
'ui-tabs__item--active': tab.value === effectiveValue,
|
|
10
10
|
'ui-tabs__item--disabled': tab.disabled,
|
|
11
|
-
'ui-tabs__item--stretch': stretchItems
|
|
11
|
+
'ui-tabs__item--stretch': stretchItems,
|
|
12
|
+
'ui-tabs__item--allow-deselect': allowDeselect
|
|
12
13
|
}"
|
|
13
14
|
:disabled="tab.disabled || undefined"
|
|
14
15
|
@click="select(tab.value)"
|
|
@@ -31,8 +32,15 @@
|
|
|
31
32
|
<script>
|
|
32
33
|
export default {
|
|
33
34
|
name: 'Tabs',
|
|
35
|
+
|
|
36
|
+
model: {
|
|
37
|
+
prop: 'value',
|
|
38
|
+
event: 'input'
|
|
39
|
+
},
|
|
40
|
+
|
|
34
41
|
props: {
|
|
35
42
|
value: { type: [String, Number], default: null },
|
|
43
|
+
modelValue: { default: null },
|
|
36
44
|
tabs: {
|
|
37
45
|
type: Array,
|
|
38
46
|
default: function () {
|
|
@@ -49,13 +57,29 @@ export default {
|
|
|
49
57
|
stretchItems: {
|
|
50
58
|
type: Boolean,
|
|
51
59
|
default: () => false
|
|
60
|
+
},
|
|
61
|
+
allowDeselect: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: () => false
|
|
52
64
|
}
|
|
53
65
|
},
|
|
54
|
-
emits: ['input', 'change'],
|
|
66
|
+
emits: ['input', 'change', 'update:modelValue'],
|
|
67
|
+
|
|
68
|
+
computed: {
|
|
69
|
+
effectiveValue: function () {
|
|
70
|
+
return this.modelValue !== null ? this.modelValue : this.value
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
55
74
|
methods: {
|
|
56
|
-
select: function (
|
|
57
|
-
if (val
|
|
75
|
+
select: function (value) {
|
|
76
|
+
if (!this.allowDeselect && val == this.effectiveValue) return
|
|
77
|
+
let val = value
|
|
78
|
+
if (this.allowDeselect && val == this.effectiveValue) {
|
|
79
|
+
val = undefined
|
|
80
|
+
}
|
|
58
81
|
this.$emit('input', val)
|
|
82
|
+
this.$emit('update:modelValue', val)
|
|
59
83
|
this.$emit('change', val)
|
|
60
84
|
}
|
|
61
85
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BaseIcon v-bind="$attrs" v-on="listeners">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
4
|
+
<path
|
|
5
|
+
d="M21.4838 5.04818L20.0696 4.50868C19.9385 4.45858 19.8383 4.35839 19.7882 4.22737L19.2488 2.81311C19.0908 2.39693 18.5012 2.39693 18.3431 2.81311L17.8036 4.22737C17.7535 4.35839 17.6533 4.45858 17.5224 4.50868L16.108 5.04818C15.6919 5.20617 15.6919 5.79577 16.108 5.95376L17.5224 6.49326C17.6533 6.54336 17.7535 6.64356 17.8036 6.77457L18.3431 8.18884C18.5012 8.60502 19.0908 8.60502 19.2488 8.18884L19.7882 6.77457C19.8383 6.64356 19.9385 6.54336 20.0696 6.49326L21.4838 5.95376C21.9 5.79577 21.9 5.20617 21.4838 5.04818Z"
|
|
6
|
+
fill="currentColor"
|
|
7
|
+
/>
|
|
8
|
+
<path
|
|
9
|
+
d="M12.45 9.46744L13.1405 9.73221C13.2437 9.77092 13.3276 9.85489 13.3663 9.95821L13.6309 10.6491C13.76 10.9849 14.2375 10.9849 14.3634 10.6491L14.6279 9.95821C14.6666 9.85489 14.7505 9.77092 14.8538 9.73221L15.5443 9.46744C15.8798 9.33829 15.8798 8.86048 15.5443 8.73453L14.8538 8.46977C14.7505 8.43103 14.6666 8.34708 14.6279 8.24376L14.3634 7.55281C14.2343 7.21703 13.7567 7.21703 13.6309 7.55281L13.3663 8.24376C13.3276 8.34708 13.2437 8.43103 13.1405 8.46977L12.45 8.73453C12.1112 8.86365 12.1112 9.34153 12.45 9.46744Z"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
clip-rule="evenodd"
|
|
15
|
+
d="M12.45 3.20184C12.8642 3.20184 13.2 3.53763 13.2 3.95184C13.2 4.36605 12.8642 4.70184 12.45 4.70184H3.75001L3.75 15.6039L7.56328 11.7895C7.8445 11.5084 8.22626 11.3512 8.62383 11.3512C9.02143 11.3512 9.40311 11.5084 9.68438 11.7895L13.8094 15.9145L15.6844 14.0395C15.8235 13.9003 15.9889 13.7902 16.1707 13.7148C16.3526 13.6395 16.548 13.6 16.7449 13.6C16.9419 13.6 17.1371 13.6394 17.3191 13.7148C17.501 13.7902 17.6663 13.9003 17.8055 14.0395L20.25 16.4828V13.15C20.25 12.7358 20.5858 12.4 21 12.4C21.4142 12.4 21.75 12.7358 21.75 13.15V20.35C21.75 20.7478 21.5919 21.1293 21.3105 21.4106C21.0292 21.6919 20.6478 21.85 20.25 21.85H3.75C3.35218 21.85 2.97076 21.6919 2.68945 21.4106C2.40815 21.1293 2.25 20.7478 2.25 20.35L2.25001 4.70184C2.25001 4.30402 2.40816 3.9226 2.68947 3.64129C2.97077 3.35999 3.35219 3.20184 3.75001 3.20184H12.45ZM3.75 17.725V20.35H16.125L8.625 12.85L3.75 17.725ZM14.8711 16.975L18.2461 20.35H20.25V18.6039L16.7461 15.1L14.8711 16.975Z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
</BaseIcon>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import BaseIcon from './BaseIcon.vue'
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'GenerateImage',
|
|
27
|
+
components: { BaseIcon },
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
emits: [],
|
|
30
|
+
computed: {
|
|
31
|
+
listeners() {
|
|
32
|
+
return this.$listeners || {}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
package/src/icons/index.js
CHANGED
|
@@ -1730,4 +1730,5 @@ export { default as WkiZoomIn } from './ZoomIn.vue'
|
|
|
1730
1730
|
export { default as WkiZoomOut } from './ZoomOut.vue'
|
|
1731
1731
|
export { default as WkiClickButton } from './ClickButton.vue'
|
|
1732
1732
|
export { default as WkiSectionBuilder } from './SectionBuilder.vue'
|
|
1733
|
+
export { default as WkiGenerateImage } from './GenerateImage.vue'
|
|
1733
1734
|
// --- AUTO-GENERATED LUCIDE EXPORTS END ---
|