webcake-ui-kit 1.1.28 → 1.1.29

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.1.28",
3
+ "version": "1.1.29",
4
4
  "description": "UI Kit for Vue 2 && 3 - Pure Options API",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -29,7 +29,8 @@ const ICON_BY_TYPE = {
29
29
  neutral: 'WkiCircleCheck',
30
30
  error: 'WkiCircleAlert',
31
31
  warning: 'WkiTriangleAlert',
32
- info: 'WkiInfo'
32
+ info: 'WkiInfo',
33
+ success: 'WkiCircleCheck'
33
34
  }
34
35
 
35
36
  export default {
@@ -40,7 +41,7 @@ export default {
40
41
  type: String,
41
42
  default: 'neutral',
42
43
  validator: function (v) {
43
- return ['neutral', 'error', 'warning', 'info'].includes(v)
44
+ return ['neutral', 'error', 'warning', 'info', 'success'].includes(v)
44
45
  }
45
46
  },
46
47
  title: {
@@ -42,6 +42,7 @@
42
42
  letter-spacing: var(--paragraph-small-letter-spacing);
43
43
  font-weight: var(--paragraph-medium-font-weight);
44
44
  word-break: break-word;
45
+ color: var(--primary-fg);
45
46
  }
46
47
 
47
48
  .ui-alert__description {
@@ -69,7 +70,7 @@
69
70
  padding: 0;
70
71
  border: none;
71
72
  background: none;
72
- color: inherit;
73
+ color: var(--primary-fg);
73
74
  cursor: pointer;
74
75
  border-radius: var(--rounded-md);
75
76
  outline: none;
@@ -95,6 +96,9 @@
95
96
  .ui-alert--neutral {
96
97
  background: var(--card);
97
98
  border-color: var(--border-primary);
99
+ }
100
+
101
+ .ui-alert--neutral .ui-alert__icon {
98
102
  color: var(--primary-fg);
99
103
  }
100
104
 
@@ -104,14 +108,36 @@
104
108
  color: var(--destructive-text);
105
109
  }
106
110
 
111
+ .ui-alert--error .ui-alert__icon {
112
+ color: var(--destructive);
113
+ }
114
+
107
115
  .ui-alert--warning {
108
116
  background: var(--warning-subtle);
109
117
  border-color: var(--warning-border-subtle);
110
- color: var(--warning-text);
118
+ color: var(--warning);
119
+ }
120
+
121
+ .ui-alert--warning .ui-alert__icon {
122
+ color: var(--warning);
111
123
  }
112
124
 
113
125
  .ui-alert--info {
114
126
  background: var(--infor-subtle);
115
127
  border-color: var(--infor-border-subtle);
116
- color: var(--infor-text);
128
+ color: var(--infor);
129
+ }
130
+
131
+ .ui-alert--info .ui-alert__icon {
132
+ color: var(--infor);
133
+ }
134
+
135
+ .ui-alert--success {
136
+ background: var(--positive-subtle);
137
+ border-color: var(--positive-border-subtle);
138
+ color: var(--positive);
139
+ }
140
+
141
+ .ui-alert--success .ui-alert__icon {
142
+ color: var(--positive);
117
143
  }
@@ -9,6 +9,8 @@
9
9
  @open="$emit('open')"
10
10
  @close="$emit('close')"
11
11
  :width="width"
12
+ :overlay-class-name="overlayClassName"
13
+ :overlay-style="overlayStyle"
12
14
  >
13
15
  <template #trigger="{ triggerRef }">
14
16
  <span
@@ -21,7 +23,14 @@
21
23
  <slot></slot>
22
24
  </span>
23
25
  </template>
24
- <DropdownMenuItems v-if="hasItems" :items="items" :value="value" @select="onItemSelect" :size="size" />
26
+ <DropdownMenuItems
27
+ v-if="hasItems"
28
+ :items="items"
29
+ :value="value"
30
+ @select="onItemSelect"
31
+ :size="size"
32
+ :showChecked="showChecked"
33
+ />
25
34
  <slot v-else name="overlay"></slot>
26
35
  </Menu>
27
36
  </template>
@@ -80,7 +89,10 @@ export default {
80
89
  type: String,
81
90
  default: 'md',
82
91
  validator: v => ['sm', 'md', 'lg'].includes(v)
83
- }
92
+ },
93
+ overlayClassName: { type: [String, Array, Object], default: null },
94
+ overlayStyle: { type: [Object, Array], default: null },
95
+ showChecked: { type: Boolean, default: false }
84
96
  },
85
97
  emits: ['change', 'update:modelValue', 'open', 'close', 'select'],
86
98
  data() {
@@ -35,7 +35,7 @@
35
35
  child.label
36
36
  }}</span>
37
37
  <span v-if="child.extra" class="ui-dropdown-items__extra">{{ child.extra }}</span>
38
- <WkiCheck v-if="isActive(child.key)" :size="16" color="var(--muted-fg)" />
38
+ <WkiCheck v-if="isActive(child.key) && showChecked" :size="16" color="var(--muted-fg)" />
39
39
  </div>
40
40
  </div>
41
41
 
@@ -87,7 +87,7 @@
87
87
  child.label
88
88
  }}</span>
89
89
  <span v-if="child.extra" class="ui-dropdown-items__extra">{{ child.extra }}</span>
90
- <WkiCheck v-if="isActive(child.key)" :size="16" color="var(--muted-fg)" />
90
+ <WkiCheck v-if="isActive(child.key) && showChecked" :size="16" color="var(--muted-fg)" />
91
91
  </div>
92
92
  </div>
93
93
 
@@ -116,7 +116,7 @@
116
116
  item.label
117
117
  }}</span>
118
118
  <span v-if="item.extra" class="ui-dropdown-items__extra">{{ item.extra }}</span>
119
- <WkiCheck v-if="isActive(item.key)" :size="16" color="var(--muted-fg)" />
119
+ <WkiCheck v-if="isActive(item.key) && showChecked" :size="16" color="var(--muted-fg)" />
120
120
  </div>
121
121
  </div>
122
122
  </div>
@@ -150,6 +150,10 @@ export default {
150
150
  size: {
151
151
  type: String,
152
152
  default: 'md'
153
+ },
154
+ showChecked: {
155
+ type: Boolean,
156
+ default: false
153
157
  }
154
158
  },
155
159
 
@@ -54,6 +54,10 @@
54
54
  background: var(--destructive-subtle) !important;
55
55
  }
56
56
 
57
+ .ui-dropdown-items__item--destructive.ui-dropdown-items__item--active {
58
+ background: var(--destructive-subtle) !important;
59
+ }
60
+
57
61
  .ui-dropdown-items__item--sub {
58
62
  padding-left: calc(var(--spacing-sm) + var(--spacing-md));
59
63
  }
@@ -139,17 +143,6 @@
139
143
  user-select: none;
140
144
  }
141
145
 
142
- /* 20px container — icon SVG inside is typically 16px, centred */
143
- .ui-dropdown-items__icon {
144
- width: 20px;
145
- height: 20px;
146
- flex-shrink: 0;
147
- display: flex;
148
- align-items: center;
149
- justify-content: center;
150
- color: inherit;
151
- }
152
-
153
146
  .ui-dropdown-items__label {
154
147
  flex: 1;
155
148
  min-width: 0;
@@ -132,13 +132,13 @@
132
132
  align-items: center;
133
133
  justify-content: center;
134
134
  flex-shrink: 0;
135
- width: 20px;
135
+ min-width: 20px;
136
136
  height: 20px;
137
137
  color: var(--muted-fg);
138
138
  }
139
139
 
140
140
  .ui-input--size-xs .ui-input__decoration,
141
141
  .ui-input--size-tiny .ui-input__decoration {
142
- width: 16px;
142
+ min-width: 16px;
143
143
  height: 16px;
144
144
  }
@@ -14,7 +14,7 @@
14
14
  role="menu"
15
15
  @keydown="_kmOnKeydown"
16
16
  >
17
- <div class="ui-menu__content">
17
+ <div :class="['ui-menu__content', overlayClassName]" :style="overlayStyle">
18
18
  <slot></slot>
19
19
  </div>
20
20
  </div>
@@ -67,7 +67,9 @@ export default {
67
67
  closeOnEsc: { type: Boolean, default: true },
68
68
  disabled: { type: Boolean, default: false },
69
69
  anchorWidth: { type: Boolean, default: false },
70
- width: { type: [String, Number], default: null }
70
+ width: { type: [String, Number], default: null },
71
+ overlayClassName: { type: [String, Array, Object], default: null },
72
+ overlayStyle: { type: [Object, Array], default: null }
71
73
  },
72
74
  emits: ['change', 'update:modelValue', 'open', 'close', 'select'],
73
75
  data() {
@@ -182,6 +184,9 @@ export default {
182
184
  this.$nextTick(() => {
183
185
  const float = this.$refs.floating
184
186
  if (!float) return
187
+ // Tag the floating panel with its trigger so click-outside-mixin can
188
+ // detect nested portals opened from within this panel.
189
+ float._wkTrigger = this._triggerEl
185
190
  this._coSetElements(this._triggerEl, float)
186
191
  this._kmSetFloatEl(float)
187
192
  this._pmAttach(this._triggerEl, float)
@@ -8,6 +8,8 @@
8
8
  :close-on-select="false"
9
9
  @change="onMenuChange"
10
10
  @close="onMenuClose"
11
+ :overlay-class-name="overlayClassName"
12
+ :overlay-style="overlayStyle"
11
13
  >
12
14
  <template #trigger="{ toggle, isOpen: open, attrs, triggerRef }">
13
15
  <div
@@ -187,7 +189,9 @@ export default {
187
189
  filterOption: {
188
190
  type: Function,
189
191
  default: null
190
- }
192
+ },
193
+ overlayClassName: { type: [String, Array, Object], default: null },
194
+ overlayStyle: { type: [Object, Array], default: null }
191
195
  },
192
196
 
193
197
  emits: ['change', 'update:modelValue'],
@@ -154,28 +154,30 @@
154
154
 
155
155
  /* — multiple mode — */
156
156
  .ui-select--multiple {
157
- height: 36px;
157
+ min-height: 36px;
158
+ height: auto;
158
159
  align-items: center;
159
160
  flex-wrap: wrap;
160
161
  padding: var(--spacing-2xs) var(--spacing-sm) var(--spacing-2xs) var(--spacing-xs);
161
162
  }
162
163
 
163
164
  .ui-select--multiple.ui-select--lg {
164
- height: 40px;
165
+ min-height: 40px;
165
166
  height: auto;
166
- padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-xs);
167
+ padding: var(--spacing-7) var(--spacing-md) var(--spacing-7) var(--spacing-xs);
167
168
  align-items: center;
168
169
  }
169
170
 
170
171
  .ui-select--multiple.ui-select--sm {
171
- height: 32px;
172
+ min-height: 32px;
172
173
  height: auto;
173
- padding: var(--spacing-5p5) var(--spacing-xs);
174
+ padding: var(--spacing-5) var(--spacing-xs);
174
175
  }
175
176
 
176
177
  .ui-select--multiple.ui-select--xs {
177
- height: 28px;
178
- padding: var(--spacing-2xs) var(--spacing-6) var(--spacing-2xs) var(--spacing-2xs);
178
+ min-height: 28px;
179
+ height: auto;
180
+ padding: var(--spacing-3) var(--spacing-6) var(--spacing-3) var(--spacing-2xs);
179
181
  }
180
182
 
181
183
  .ui-select--multiple .ui-select__chevron {
@@ -211,6 +213,10 @@
211
213
  font-size: 14px;
212
214
  }
213
215
 
216
+ .ui-select--multiple.ui-select--xs .ui-select__search::placeholder {
217
+ font-size: 12px;
218
+ }
219
+
214
220
  .ui-select__search--single {
215
221
  width: 100%;
216
222
  flex: 1;
@@ -15,9 +15,15 @@
15
15
  :aria-disabled="isDisabled ? 'true' : null"
16
16
  @click="handleClick"
17
17
  >
18
+ <span v-if="$slots.prefix" class="ui-select-option__prefix">
19
+ <slot name="prefix" />
20
+ </span>
18
21
  <span class="ui-select-option--label">
19
22
  <slot>{{ label || value }}</slot>
20
23
  </span>
24
+ <span v-if="$slots.suffix" class="ui-select-option__suffix">
25
+ <slot name="suffix" />
26
+ </span>
21
27
  <WkiCheck v-if="isSelected && isMultiMode" :size="16" color="var(--muted-fg)" />
22
28
  </div>
23
29
  </template>
@@ -78,3 +78,23 @@
78
78
  text-overflow: ellipsis;
79
79
  white-space: nowrap;
80
80
  }
81
+
82
+ .ui-select-option__prefix {
83
+ display: inline-flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ flex-shrink: 0;
87
+ overflow: hidden;
88
+ min-width: 20px;
89
+ height: 20px;
90
+ }
91
+
92
+ .ui-select-option--sm .ui-select-option__prefix {
93
+ min-width: 16px;
94
+ height: 16px;
95
+ }
96
+
97
+ .ui-select-option__suffix {
98
+ font-size: var(--paragraph-mini-font-size);
99
+ line-height: var(--paragraph-mini-line-height);
100
+ }