@awes-io/ui 2.71.0 → 2.71.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.71.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.71.0...@awes-io/ui@2.71.1) (2023-09-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * menu styles updated ([febfcaf](https://github.com/awes-io/client/commit/febfcaf2c93d0ecbf17501faed24b277013163b0))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.71.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.70.0...@awes-io/ui@2.71.0) (2023-09-08)
7
18
 
8
19
 
@@ -2,7 +2,7 @@
2
2
  @apply bg-surface;
3
3
 
4
4
  display: grid;
5
- grid-template-columns: 72px auto;
5
+ grid-template-columns: 4.5rem auto;
6
6
  grid-template-rows: 80px minmax(0, 2fr) minmax(0, 1fr) 80px minmax(0, auto);
7
7
 
8
8
  z-index: 4;
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
 
5
5
  &__aw-layout-menu {
6
- max-width: 290px;
6
+ max-width: 300px;
7
7
  height: 100vh;
8
8
 
9
9
  flex-shrink: 0;
@@ -16,17 +16,17 @@
16
16
  bottom: 0;
17
17
 
18
18
  &.aw-layout-menu--no-submenu {
19
- max-width: 60px;
19
+ max-width: 4.5rem;
20
20
  }
21
21
 
22
22
  & ~ * {
23
- max-width: calc(100% - 290px);
24
- margin-left: 290px;
23
+ max-width: calc(100% - 300px);
24
+ margin-left: 300px;
25
25
  }
26
26
 
27
27
  &.aw-layout-menu--no-submenu ~ * {
28
- max-width: calc(100% - 60px);
29
- margin-left: 60px;
28
+ max-width: calc(100% - 4.5rem);
29
+ margin-left: 4.5rem;
30
30
  }
31
31
  }
32
32
  }
@@ -1,4 +1,4 @@
1
- .aw-subheadline {
1
+ .aw-sub-headline {
2
2
  @apply font-heading;
3
3
 
4
4
  font-weight: bold;
@@ -6,18 +6,18 @@
6
6
  border-radius: 0.625rem;
7
7
 
8
8
  &:focus-within {
9
- @apply border-mono-400;
9
+ @apply border-mono-400;
10
10
  }
11
11
 
12
12
  & > div:first-child:not(.aw-tooltip),
13
13
  & > span:first-child:not(.aw-tooltip) {
14
- border-top-left-radius: 0.625rem;
15
- border-bottom-left-radius: 0.625rem;
14
+ border-top-left-radius: 0.625rem;
15
+ border-bottom-left-radius: 0.625rem;
16
16
  }
17
17
 
18
18
  & > div:last-child {
19
- border-top-right-radius: 0.625rem;
20
- border-bottom-right-radius: 0.625rem;
19
+ border-top-right-radius: 0.625rem;
20
+ border-bottom-right-radius: 0.625rem;
21
21
  }
22
22
 
23
23
  &.has-label::before {
@@ -76,7 +76,7 @@
76
76
 
77
77
  &::placeholder {
78
78
  color: inherit;
79
- opacity: .5;
79
+ opacity: 0.5;
80
80
  }
81
81
  }
82
82
 
@@ -89,6 +89,77 @@
89
89
  max-width: calc(100% - calc(var(--icon-count) * var(--icon-width)));
90
90
  }
91
91
 
92
+ /**
93
+ * Native select styles
94
+ */
95
+ &.is-select,
96
+ &.is-select &__element {
97
+ cursor: pointer;
98
+ position: relative;
99
+ z-index: 1;
100
+ background-color: transparent;
101
+ }
102
+
103
+ &__caret {
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+
108
+ opacity: 0.4;
109
+ transition: 200ms opacity;
110
+
111
+ position: absolute;
112
+ right: 0;
113
+ top: 0;
114
+ bottom: 0;
115
+
116
+ & > svg {
117
+ transition: 200ms transform;
118
+ }
119
+ }
120
+
121
+ &:hover &__caret {
122
+ opacity: 1;
123
+ }
124
+
125
+ &.is-select &__element:focus ~ &__caret > svg {
126
+ transform: rotate(-180deg);
127
+ }
128
+
129
+ &.is-select {
130
+ select::-webkit-scrollbar {
131
+ width: 12px;
132
+ height: 12px;
133
+ background-color: var(--c-surface);
134
+ }
135
+
136
+ select::-webkit-scrollbar-thumb {
137
+ background-color: rgba(var(--c-on-surface-rgb), 0.1);
138
+ }
139
+
140
+ option {
141
+ background: var(--c-surface)
142
+ linear-gradient(
143
+ 0deg,
144
+ var(--c-surface) 0%,
145
+ var(--c-surface) 100%
146
+ );
147
+ color: var(--c-on-surface);
148
+ }
149
+
150
+ option:hover {
151
+ background: var(--c-info)
152
+ linear-gradient(0deg, var(--c-info) 0%, var(--c-info) 100%);
153
+ color: var(--c-on-info);
154
+ }
155
+
156
+ option:checked {
157
+ background: var(--c-accent)
158
+ linear-gradient(0deg, var(--c-accent) 0%, var(--c-accent) 100%);
159
+ color: var(--c-on-accent);
160
+ }
161
+ }
162
+
92
163
  /**
93
164
  * Textarea styles
94
165
  */
@@ -113,7 +184,7 @@
113
184
  }
114
185
 
115
186
  &.is-tel .vue-tel-input {
116
- border-radius: 0.625rem;
187
+ border-radius: 0.625rem;
117
188
 
118
189
  .vti__dropdown {
119
190
  border-top-left-radius: 0.625rem;
@@ -132,8 +203,8 @@
132
203
  opacity: 0;
133
204
  }
134
205
 
135
- &:not([readonly]):focus::placeholder {
136
- opacity: .5;
206
+ &:not([readonly]):focus::placeholder {
207
+ opacity: 0.5;
137
208
  }
138
209
  }
139
210
 
@@ -164,7 +235,6 @@
164
235
  transform: scale(0.67) translateY(-50%);
165
236
  }
166
237
 
167
-
168
238
  /**
169
239
  * Icon styles
170
240
  */
@@ -174,7 +244,7 @@
174
244
  }
175
245
 
176
246
  &.has-icon &__label {
177
- max-width: calc(100% - theme('spacing.12'))
247
+ max-width: calc(100% - theme('spacing.12'));
178
248
  }
179
249
 
180
250
  &__icon {
@@ -188,7 +258,6 @@
188
258
  fill: currentColor;
189
259
  }
190
260
 
191
-
192
261
  /**
193
262
  * Error styles
194
263
  */
@@ -217,7 +286,6 @@
217
286
  @apply rounded-r-none;
218
287
  }
219
288
 
220
-
221
289
  /**
222
290
  * Disabled style
223
291
  */
@@ -226,7 +294,7 @@
226
294
  &__element[disabled] + &__label {
227
295
  cursor: not-allowed;
228
296
  user-select: none;
229
- opacity: .5;
297
+ opacity: 0.5;
230
298
  }
231
299
 
232
300
  &.is-disabled {
@@ -238,22 +306,24 @@
238
306
  }
239
307
  }
240
308
 
241
- .is-disabled .aw-text-field__fake-input { opacity: 0.5 }
309
+ .is-disabled .aw-text-field__fake-input {
310
+ opacity: 0.5;
311
+ }
242
312
 
243
313
  @keyframes autoFillStart {
244
314
  from {
245
- opacity: 1
315
+ opacity: 1;
246
316
  }
247
317
  to {
248
- opacity: 1
318
+ opacity: 1;
249
319
  }
250
320
  }
251
321
 
252
322
  @keyframes autoFillEnd {
253
323
  from {
254
- opacity: 1
324
+ opacity: 1;
255
325
  }
256
326
  to {
257
- opacity: 1
327
+ opacity: 1;
258
328
  }
259
329
  }
@@ -0,0 +1,151 @@
1
+ <template>
2
+ <div class="flex aw-text-field is-select" :class="wrapperClasses">
3
+ <div v-if="prefix || $scopedSlots.prefix" class="aw-text-field__prefix" :class="{ 'px-4': prefix }">
4
+ <slot name="prefix">{{ prefix }}</slot>
5
+ </div>
6
+
7
+ <div class="relative w-full">
8
+ <select
9
+ :id="id || defaultId"
10
+ ref="element"
11
+ v-model="selected"
12
+ v-tooltip.show.prepend="errorTooltip"
13
+ class="aw-text-field__element"
14
+ :class="size === 'md' ? 'p-3' : 'p-2'"
15
+ v-bind="$attrs"
16
+ >
17
+ <option v-for="(option, i) in options" :key="i" :value="_getOptionValue(option)" :disabled="optionDisabled(option)">
18
+ {{ _getOptionLabel(option) }}
19
+ </option>
20
+ </select>
21
+ <label
22
+ v-if="!!label || $scopedSlots.label"
23
+ :for="id || defaultId"
24
+ class="aw-text-field__label"
25
+ :class="{ 'aw-text-field__label--required': isRequired }"
26
+ >
27
+ <slot name="label">
28
+ {{ label }}
29
+ </slot>
30
+ </label>
31
+
32
+ <div class="aw-text-field__caret pl-2 pr-4">
33
+ <AwIcon name="triangle-d" size="12" />
34
+ </div>
35
+ </div>
36
+
37
+ <div v-if="postfix || $scopedSlots.postfix" class="aw-text-field__postfix" :class="{ 'px-4': postfix }">
38
+ <slot name="prefix">{{ postfix }}</slot>
39
+ </div>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import { path } from 'rambdax'
45
+ import fieldMixin from '@AwMixins/field'
46
+ import errorMixin from '@AwMixins/error'
47
+
48
+ const itself = (val) => val
49
+
50
+ export default {
51
+ name: 'AwSelectNative',
52
+
53
+ mixins: [fieldMixin, errorMixin],
54
+
55
+ inheritAttrs: false,
56
+
57
+ props: {
58
+ options: {
59
+ type: Array,
60
+ default: () => []
61
+ },
62
+
63
+ value: {
64
+ type: [String, Number, Object],
65
+ default: null
66
+ },
67
+
68
+ optionLabel: {
69
+ type: [String, Function],
70
+ default: ''
71
+ },
72
+
73
+ optionDisabled: {
74
+ type: Function,
75
+ default: () => false
76
+ },
77
+
78
+ trackBy: {
79
+ type: [String, Function],
80
+ default: ''
81
+ },
82
+
83
+ size: {
84
+ type: String,
85
+ default: 'md'
86
+ },
87
+
88
+ prefix: {
89
+ type: String,
90
+ default: ''
91
+ },
92
+
93
+ postfix: {
94
+ type: String,
95
+ default: ''
96
+ }
97
+ },
98
+
99
+ computed: {
100
+ _getOptionLabel() {
101
+ return this._generateGetterFunction(this.optionLabel)
102
+ },
103
+
104
+ _getOptionValue() {
105
+ return this._generateGetterFunction(this.trackBy)
106
+ },
107
+
108
+ selected: {
109
+ get() {
110
+ return this.value
111
+ },
112
+
113
+ set(val) {
114
+ if (this.hasError) {
115
+ this.setError('')
116
+ }
117
+
118
+ this.$emit('input', val)
119
+ }
120
+ },
121
+
122
+ _isFilled() {
123
+ return this.options.some((option) => this.value === this._getOptionValue(option))
124
+ },
125
+
126
+ wrapperClasses() {
127
+ return {
128
+ 'is-filled': this._isFilled,
129
+ 'has-label': !!this.label,
130
+ 'has-error': this.hasError,
131
+ 'is-disabled': this.isDisabled,
132
+ 'has-prefix': this.prefix,
133
+ 'has-postfix': this.postfix
134
+ }
135
+ }
136
+ },
137
+
138
+ methods: {
139
+ _generateGetterFunction(arg) {
140
+ switch (typeof arg) {
141
+ case 'function':
142
+ return arg
143
+ case 'string':
144
+ return arg.length ? path(arg) : itself
145
+ default:
146
+ return itself
147
+ }
148
+ }
149
+ }
150
+ }
151
+ </script>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div>
3
+ <slot />
4
+ <AwDescription v-if="text != ''" class="mt-2 inline-block" v-html="text" />
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ name: 'AwDescriptionInput',
11
+
12
+ props: {
13
+ text: {
14
+ type: String,
15
+ default: ''
16
+ }
17
+ }
18
+ }
19
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.71.0",
3
+ "version": "2.71.1",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -112,5 +112,5 @@
112
112
  "rollup-plugin-visualizer": "^2.6.0",
113
113
  "rollup-plugin-vue": "^5.0.1"
114
114
  },
115
- "gitHead": "0182a87e39c612296631ac487c64d7453af8fd2a"
115
+ "gitHead": "06094c5bdf9e8a6364d6382df3d9b095e61e06bc"
116
116
  }