webcake-ui-kit 1.2.3 → 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",
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",
@@ -28,7 +28,6 @@
28
28
  display: flex;
29
29
  flex-direction: column;
30
30
  gap: var(--spacing-2xs);
31
- max-height: 320px;
32
31
  overflow-y: auto;
33
32
  border-radius: var(--rounded-lg);
34
33
  }
@@ -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
+ }
@@ -66,7 +66,7 @@ export default {
66
66
  default: 'bottom-start',
67
67
  validator: v => PLACEMENTS.indexOf(v) !== -1
68
68
  },
69
- offset: { type: Number, default: 8 },
69
+ offset: { type: Number, default: 4 },
70
70
  // 'click', 'hover', or both
71
71
  trigger: {
72
72
  type: Array,
@@ -87,6 +87,9 @@
87
87
  </div>
88
88
  </template>
89
89
  <div class="ui-select__list" :style="listStyle">
90
+ <div v-if="hasContentHeader">
91
+ <slot name="contentHeader"></slot>
92
+ </div>
90
93
  <slot>
91
94
  <SelectOption
92
95
  v-for="opt in filteredOptions"
@@ -107,6 +110,9 @@
107
110
  </template>
108
111
  </Empty>
109
112
  </slot>
113
+ <div v-if="hasContentFooter">
114
+ <slot name="contentFooter"></slot>
115
+ </div>
110
116
  </div>
111
117
  </Menu>
112
118
  </template>
@@ -148,6 +154,10 @@ export default {
148
154
  default: 'md',
149
155
  validator: v => ['sm', 'md', 'lg'].indexOf(v) !== -1
150
156
  },
157
+ showChecked: {
158
+ type: Boolean,
159
+ default: false
160
+ },
151
161
  value: {
152
162
  type: [String, Array],
153
163
  default: null
@@ -287,6 +297,12 @@ export default {
287
297
  if (this.normalizedOptions.length === 0 && Object.keys(this.slotOptionVisible).length === 0) return true
288
298
  return false
289
299
  },
300
+ hasContentFooter() {
301
+ return !!((this.$scopedSlots && this.$scopedSlots['contentFooter']) || this.$slots['contentFooter'])
302
+ },
303
+ hasContentHeader() {
304
+ return !!((this.$scopedSlots && this.$scopedSlots['contentHeader']) || this.$slots['contentHeader'])
305
+ },
290
306
  hasIconSlot() {
291
307
  return !!((this.$scopedSlots && this.$scopedSlots['icon']) || this.$slots['icon'])
292
308
  },
@@ -24,7 +24,7 @@
24
24
  <span v-if="hasSuffix" class="ui-select-option__suffix">
25
25
  <slot name="suffix" />
26
26
  </span>
27
- <WkiCheck v-if="isSelected && isMultiMode" :size="16" color="var(--muted-fg)" />
27
+ <WkiCheck v-if="isSelected && (isMultiMode || isShowChecked)" :size="16" color="var(--muted-fg)" />
28
28
  </div>
29
29
  </template>
30
30
 
@@ -128,6 +128,9 @@ export default {
128
128
  },
129
129
  isMultiMode() {
130
130
  return !!(this.select && this.select.isMultiMode)
131
+ },
132
+ isShowChecked() {
133
+ return !!(this.select && this.select.showChecked)
131
134
  }
132
135
  },
133
136
 
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'
@@ -6,13 +6,13 @@
6
6
  --chart-4: #ffb900;
7
7
  --chart-5: #fe9a00;
8
8
 
9
- --positive: #009689;
10
- --negative: #f54a00;
9
+ --chart-positive: #009689;
10
+ --chart-negative: #f54a00;
11
11
 
12
12
  --fill: #bfdeffb3;
13
- --stroke: #8ec5ff;
13
+ --chart-stroke: #8ec5ff;
14
14
  --fill-2: #aaccffb3;
15
- --stroke-2: #3f8dff;
15
+ --chart-stroke-2: #3f8dff;
16
16
  }
17
17
 
18
18
  .dark {
@@ -23,11 +23,11 @@
23
23
  --chart-4: #ad46ff;
24
24
  --chart-5: #ff2056;
25
25
 
26
- --positive: #00bc7d;
27
- --negative: #ff2056;
26
+ --chart-positive: #00bc7d;
27
+ --chart-negative: #ff2056;
28
28
 
29
29
  --fill: #475d75b3;
30
- --stroke: #8ec5ff;
30
+ --chart-stroke: #8ec5ff;
31
31
  --fill-2: #1f4176b3;
32
- --stroke-2: #3f8dff;
32
+ --chart-stroke-2: #3f8dff;
33
33
  }
@@ -120,6 +120,18 @@
120
120
  /* Effect */
121
121
  --focus-ring: var(--color-neutral-200);
122
122
  --focus-ring-error: var(--color-red-300);
123
+
124
+ /* Builder */
125
+ --layer-fg: var(--color-brand-neutrals-700);
126
+ --layer-hover-bg: var(--color-brand-neutrals-50);
127
+ --layer-accent-bg: var(--color-brand-neutrals-200);
128
+ --non-delete-layer-hover: var(--color-violet-50);
129
+ --non-delete-layer-accent: var(--color-violet-200);
130
+
131
+ --stroke: #3f8dff;
132
+ --stroke-hover: #8fbcff;
133
+ --non-delete-stroke: var(--color-violet-600);
134
+ --non-delete-stroke-hover: var(--color-violet-400);
123
135
  }
124
136
 
125
137
  .dark {