@awes-io/ui 2.71.0 → 2.72.0

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,33 @@
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.72.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.71.1...@awes-io/ui@2.72.0) (2023-09-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **aw-file:** bind all attrs to input ([7cb6690](https://github.com/awes-io/client/commit/7cb66900c5fe33305f89f9b86a27c4b7e23baaef))
12
+
13
+
14
+ ### Features
15
+
16
+ * change styles and logic in components ([9888bed](https://github.com/awes-io/client/commit/9888bed0290beb06b656bfd12f9493a72c149428))
17
+
18
+
19
+
20
+
21
+
22
+ ## [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)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * menu styles updated ([febfcaf](https://github.com/awes-io/client/commit/febfcaf2c93d0ecbf17501faed24b277013163b0))
28
+
29
+
30
+
31
+
32
+
6
33
  # [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
34
 
8
35
 
@@ -22,11 +22,11 @@
22
22
  }
23
23
 
24
24
  &__toggler {
25
- @apply px-0 font-bold tracking-widest;
25
+ @apply font-bold tracking-widest;
26
26
 
27
27
  position: relative;
28
28
  flex-shrink: 0;
29
- padding: 0 theme('spacing.1');
29
+ padding: 0;
30
30
  min-width: theme('spacing.8');
31
31
  white-space: nowrap;
32
32
 
@@ -443,10 +443,6 @@
443
443
  @apply opacity-90;
444
444
  }
445
445
 
446
- &.theme-outline > &__overlay {
447
- @apply rounded-none;
448
- }
449
-
450
446
  /* System */
451
447
  &.theme-system {
452
448
  @apply text-mono-400;
@@ -5,18 +5,6 @@
5
5
  padding: 0;
6
6
  }
7
7
 
8
- & > .aw-button.theme-ghost {
9
- border-radius: 0.9375rem;
10
- width: auto;
11
- height: 3rem;
12
-
13
- .aw-button__content_md {
14
- width: auto;
15
- height: 3rem;
16
- padding: 0.5rem;
17
- }
18
- }
19
-
20
8
  &--highlight {
21
9
  .aw-button.theme-icon {
22
10
  background: var(--c-mono-800);
@@ -32,16 +20,3 @@
32
20
  }
33
21
  }
34
22
  }
35
-
36
- @screen lg {
37
- .aw-context-menu {
38
- & > .aw-button.theme-ghost {
39
- border-radius: 0.625rem;
40
- height: 2.5rem;
41
-
42
- .aw-button__content_md {
43
- height: 2.5rem;
44
- }
45
- }
46
- }
47
- }
@@ -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
  }
@@ -32,7 +32,8 @@
32
32
  display: block;
33
33
  font-weight: 400;
34
34
  color: var(--c-mono-400);
35
- font-size: theme('fontSize.xs', 0.75rem);
35
+ font-size: 0.875rem;
36
+ line-height: 1rem;
36
37
  margin-top: 0.25rem;
37
38
  }
38
39
 
@@ -37,7 +37,8 @@
37
37
 
38
38
  &__description {
39
39
  color: var(--c-mono-400);
40
- font-size: theme('fontSize.xs', 0.75rem);
40
+ font-size: 0.875rem;
41
+ line-height: 1rem;
41
42
  }
42
43
 
43
44
  &__arrow {
@@ -50,7 +50,8 @@
50
50
  padding: 1.5rem;
51
51
 
52
52
  position: relative;
53
- border-radius: 1.25rem;
53
+ border-top-right-radius: 1.25rem;
54
+ border-top-left-radius: 1.25rem;
54
55
 
55
56
  &:after {
56
57
  @apply bg-mono-900;
@@ -115,6 +115,19 @@
115
115
  }
116
116
  }
117
117
 
118
+ :root[data-dark="false"] {
119
+ .aw-page-headline {
120
+ &__back {
121
+ background: var(--c-mono-800);
122
+ color: var(--c-on-mono-800);
123
+
124
+ &:hover {
125
+ background: var(--c-mono-700);
126
+ }
127
+ }
128
+ }
129
+ }
130
+
118
131
  :root[data-dark="true"] {
119
132
  .aw-page-headline {
120
133
  &__back {
@@ -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
  }
@@ -71,8 +71,6 @@
71
71
  color: var(--c-on-surface);
72
72
  min-width: 250px;
73
73
  max-height: auto;
74
- box-shadow: theme('boxShadow.default');
75
- border-radius: theme('borderRadius.md');
76
74
 
77
75
  &.aw-dropdown--desktop {
78
76
  max-width: 17.625rem;
@@ -10,6 +10,8 @@
10
10
  export default {
11
11
  name: 'AwFile',
12
12
 
13
+ inheritAttrs: false,
14
+
13
15
  methods: {
14
16
  loadFile($event) {
15
17
  const files = [...$event.target.files]
@@ -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>
@@ -77,10 +77,9 @@ export default {
77
77
  props: {
78
78
  theme: 'ghost',
79
79
  color: 'default',
80
- contentClass: 'p-2',
81
80
  text: this.text
82
81
  },
83
- staticClass: 'h-10 w-auto ' + this.buttonClass,
82
+ staticClass: this.buttonClass,
84
83
  attrs: {
85
84
  'data-arrow-focus': ''
86
85
  },
@@ -69,7 +69,7 @@
69
69
 
70
70
  <div
71
71
  v-if="$scopedSlots.buttons"
72
- :class="[elClasses.buttons, 'aw-button-group']"
72
+ :class="[elClasses.buttons]"
73
73
  >
74
74
  <slot name="buttons"></slot>
75
75
  </div>
@@ -229,7 +229,7 @@ export default {
229
229
 
230
230
  return acc.concat({
231
231
  ...pick(
232
- 'icon,iconBg,iconActive,class,expanded,target,rel,listeners,abstract,key,badge,back',
232
+ 'icon,iconBg,iconActive,class,expanded,target,rel,listeners,abstract,key,badge,back,isDivide',
233
233
  props
234
234
  ),
235
235
  text,
@@ -20,7 +20,7 @@
20
20
  </span>
21
21
 
22
22
  <span class="aw-mobile-menu-item__text" tabindex="-1">
23
- {{ text }}
23
+ <span v-html="text" />
24
24
 
25
25
  <span
26
26
  v-if="description"
@@ -23,7 +23,13 @@
23
23
  {{ text }}
24
24
 
25
25
  <span
26
- v-if="childrenDescription"
26
+ v-if="description"
27
+ v-html="$sanitize(description)"
28
+ class="aw-mobile-menu-item-new__description"
29
+ ></span>
30
+
31
+ <span
32
+ v-else-if="childrenDescription"
27
33
  class="aw-mobile-menu-item-new__description"
28
34
  >
29
35
  {{ childrenDescription }}
@@ -16,9 +16,13 @@
16
16
  <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
17
17
  <AwMobileMenuItem
18
18
  v-bind="item"
19
- :class="{
20
- 'aw-mobile-menu-nav__item--divide': item.isDivide
21
- }"
19
+ :class="[
20
+ item.class,
21
+ {
22
+ 'aw-mobile-menu-nav__item--divide':
23
+ item.isDivide && i !== items.length - 1
24
+ }
25
+ ]"
22
26
  :href="_getChildrenCount(item) ? null : item.href"
23
27
  :arrow="!!(item.href || _getChildrenCount(item))"
24
28
  :active="isActive(item)"
@@ -77,7 +77,8 @@
77
77
  :name="item.icon"
78
78
  class="mr-2"
79
79
  />
80
- {{ item.text }}
80
+
81
+ <span v-html="item.text" />
81
82
  </AwNavItem>
82
83
  </template>
83
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.71.0",
3
+ "version": "2.72.0",
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": "74d401ffcbf4bd9871a13dffddac961b8d5dabc5"
116
116
  }