@awes-io/ui 2.100.0 → 2.101.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.101.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.100.1...@awes-io/ui@2.101.0) (2024-04-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * tel updated ([808bb10](https://github.com/awes-io/client/commit/808bb104783bd7a98a417cf0aeff9fa0cd8e71c0))
12
+
13
+
14
+ ### Features
15
+
16
+ * add description for aw card ([2961740](https://github.com/awes-io/client/commit/2961740faae3ebb93c2cf7a5efe74bef93f03522))
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.100.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.100.0...@awes-io/ui@2.100.1) (2024-04-05)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * styles fixes ([baf58ba](https://github.com/awes-io/client/commit/baf58ba2e65709e5faed5203246c07c609c945f8))
28
+
29
+
30
+
31
+
32
+
6
33
  # [2.100.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.99.0...@awes-io/ui@2.100.0) (2024-04-04)
7
34
 
8
35
 
@@ -12,7 +12,7 @@
12
12
  );
13
13
  gap: 0 1rem;
14
14
 
15
- padding: 2rem;
15
+ padding: 1.5rem;
16
16
  border-radius: 1rem;
17
17
 
18
18
  width: 100%;
@@ -19,6 +19,9 @@
19
19
  }
20
20
 
21
21
  &__title {
22
+ font-size: 1rem;
23
+ line-height: 1.5;
24
+
22
25
  margin-top: 0;
23
26
  margin-bottom: 0;
24
27
  margin-inline-end: auto;
@@ -33,4 +36,16 @@
33
36
  left: 0;
34
37
  top: 0;
35
38
  }
39
+
40
+ :where(.container, .container-small, .container-full) & {
41
+ margin-left: calc(-1 * var(--container-padding));
42
+ margin-right: calc(-1 * var(--container-padding));
43
+ width: calc(100% + 2 * var(--container-padding));
44
+
45
+ @screen lg {
46
+ margin-left: initial;
47
+ margin-right: initial;
48
+ width: 100%;
49
+ }
50
+ }
36
51
  }
@@ -13,14 +13,16 @@
13
13
  box-shadow: none;
14
14
 
15
15
  &__title {
16
- margin-bottom: 0;
16
+ display: flex;
17
17
  }
18
18
 
19
19
  &__header {
20
20
  display: flex;
21
+ flex-direction: column;
22
+ gap: 0.25rem;
21
23
 
22
24
  &--offset {
23
- margin-bottom: 0.75rem;
25
+ margin-bottom: 1.5rem;
24
26
  }
25
27
  }
26
28
 
@@ -42,10 +44,6 @@
42
44
  .aw-card {
43
45
  --card-padding-x: 1.875rem;
44
46
  --card-padding-y: 1.875rem;
45
-
46
- &__header--offset {
47
- margin-bottom: 1.25rem;
48
- }
49
47
  }
50
48
 
51
49
  .container .aw-card,
@@ -20,8 +20,10 @@ $modal-aside-width-large: 75vw;
20
20
  }
21
21
 
22
22
  &__dialog {
23
- @apply relative max-w-full mx-auto bg-surface;
23
+ @apply relative max-w-full mx-auto;
24
24
 
25
+ background-color: var(--c-surface);
26
+ color: var(--c-on-surface);
25
27
  border-top-left-radius: 0.9375rem;
26
28
  border-top-right-radius: 0.9375rem;
27
29
  }
@@ -229,7 +231,8 @@ $modal-aside-width-large: 75vw;
229
231
  width: calc(100% + 4rem);
230
232
  }
231
233
 
232
- &[class*='is-fullscreen'] &, &[class*='is-overlay-aside'] & {
234
+ &[class*='is-fullscreen'] &,
235
+ &[class*='is-overlay-aside'] & {
233
236
  &__dialog {
234
237
  border-radius: 0;
235
238
  }
@@ -261,9 +264,9 @@ $modal-aside-width-large: 75vw;
261
264
  @apply p-8;
262
265
  }
263
266
 
264
- &[class*='is-overlay-aside'] &__content--buttons {
267
+ /* &[class*='is-overlay-aside'] &__content--buttons {
265
268
  padding-bottom: 7rem;
266
- }
269
+ } */
267
270
 
268
271
  &__buttons {
269
272
  @apply static;
@@ -297,6 +300,7 @@ $modal-aside-width-large: 75vw;
297
300
  margin-top: auto;
298
301
  position: sticky;
299
302
  bottom: 0;
303
+ z-index: 1;
300
304
 
301
305
  & > .aw-button {
302
306
  flex-grow: 1;
@@ -367,7 +371,8 @@ $modal-aside-width-large: 75vw;
367
371
  max-width: 580px;
368
372
  }
369
373
 
370
- &.is-fullscreen &__dialog, &.is-overlay-aside &__dialog {
374
+ &.is-fullscreen &__dialog,
375
+ &.is-overlay-aside &__dialog {
371
376
  border-radius: 0;
372
377
  }
373
378
 
@@ -84,7 +84,7 @@
84
84
 
85
85
  &__breadcrumbs,
86
86
  &__buttons {
87
- flex: 1 10 calc(100% / 3);
87
+ flex: 1 10 max-content;
88
88
  }
89
89
 
90
90
  &__buttons {
@@ -52,7 +52,8 @@
52
52
  margin-bottom: -0.1875rem;
53
53
  }
54
54
 
55
- &--uncolor-prefix &__prefix {
55
+ &--uncolor-prefix &__prefix,
56
+ &--uncolor-postfix &__postfix {
56
57
  background-color: inherit;
57
58
  color: inherit;
58
59
  }
@@ -7,13 +7,13 @@
7
7
 
8
8
  line-height: 1.5;
9
9
 
10
- overscroll-behavior-y: none;
10
+ overscroll-behavior: none;
11
11
  scrollbar-color: rgba(var(--c-on-page-bg-rgb), 0.1) transparent;
12
12
 
13
13
  &::-webkit-scrollbar {
14
14
  width: 12px;
15
15
  height: 12px;
16
- background-color: transparent;
16
+ background-color: var(--c-page-bg);
17
17
  }
18
18
 
19
19
  &::-webkit-scrollbar-thumb {
@@ -11,7 +11,10 @@ export const CUSTOM_COLORS = {
11
11
  green: '#2bb611',
12
12
  lime: '#a4bf00',
13
13
  grey: '#565656',
14
- 'light-grey': '#8b9aab'
14
+ 'light-grey': '#8b9aab',
15
+ black: '#000',
16
+ forest: '#177200',
17
+ brown: '#b55700'
15
18
  }
16
19
 
17
20
  const CUSTOM_COLORS_KEYS = keys(CUSTOM_COLORS)
@@ -27,7 +30,10 @@ export const CUSTOM_COLORS_BG_LIGHT = {
27
30
  green: '#ddefd9',
28
31
  lime: '#f1f5d9',
29
32
  grey: '#eceded',
30
- 'light-grey': '#ecf0f5'
33
+ 'light-grey': '#ecf0f5',
34
+ black: '#d8d9da',
35
+ forest: '#d1e3cc',
36
+ brown: '#f0ddcc'
31
37
  }
32
38
 
33
39
  export const CUSTOM_COLORS_BG_DARK = {
@@ -41,7 +47,10 @@ export const CUSTOM_COLORS_BG_DARK = {
41
47
  green: '#2D4A2C',
42
48
  lime: '#464C29',
43
49
  grey: '#393A3D',
44
- 'light-grey': '#41444B'
50
+ 'light-grey': '#41444B',
51
+ black: '#252629',
52
+ forest: '#293c29',
53
+ brown: '#493729'
45
54
  }
46
55
 
47
56
  export default {
@@ -6,14 +6,23 @@
6
6
  class="aw-card__header"
7
7
  :class="{ 'aw-card__header--offset': hasContent }"
8
8
  >
9
- <slot name="title">
10
- <AwSubHeadline class="aw-card__title" :tag="titleTag">
11
- {{ title }}
12
- </AwSubHeadline>
13
- </slot>
14
- <div class="aw-card__header-badge">
15
- <slot name="badge"></slot>
9
+ <div class="aw-card__title">
10
+ <slot name="title">
11
+ <AwSubHeadline class="my-0" :tag="titleTag">
12
+ {{ title }}
13
+ </AwSubHeadline>
14
+ </slot>
15
+
16
+ <div class="aw-card__header-badge">
17
+ <slot name="badge"></slot>
18
+ </div>
16
19
  </div>
20
+
21
+ <slot name="description">
22
+ <AwDescription v-if="description" tag="div">
23
+ {{ description }}
24
+ </AwDescription>
25
+ </slot>
17
26
  </div>
18
27
  </slot>
19
28
 
@@ -22,9 +31,13 @@
22
31
  </template>
23
32
 
24
33
  <script>
34
+ import AwDescription from '@AwAtoms/AwDescription.vue'
35
+
25
36
  export default {
26
37
  name: 'AwCard',
27
38
 
39
+ components: { AwDescription },
40
+
28
41
  inheritAttrs: false,
29
42
 
30
43
  props: {
@@ -41,6 +54,11 @@ export default {
41
54
  title: {
42
55
  type: String,
43
56
  default: ''
57
+ },
58
+
59
+ description: {
60
+ type: String,
61
+ default: ''
44
62
  }
45
63
  },
46
64
 
@@ -141,18 +141,12 @@ export default {
141
141
  computed: {
142
142
  elClasses() {
143
143
  let base = this.$options._config.baseClass
144
- const theme = String(this.theme)
144
+ const theme = String(this.theme || '')
145
+ .split(',')
146
+ .map((modifier) => `${base}--${modifier}`)
145
147
 
146
148
  return {
147
- base: [
148
- base,
149
- {
150
- [`${base}--page`]: theme.includes('page'),
151
- [`${base}--uncolor-prefix`]: theme.includes(
152
- 'uncolor-prefix'
153
- )
154
- }
155
- ],
149
+ base: [base].concat(theme),
156
150
  el: `${base}__element`,
157
151
  label: `${base}__label`,
158
152
  labelRequired: `${base}__label--required`,
@@ -2,15 +2,18 @@
2
2
  <div
3
3
  ref="element"
4
4
  class="aw-select-fake-input flex max-w-full aw-text-field is-text"
5
- :class="{
6
- 'is-filled': value === 0 || !!value,
7
- 'has-label': !!label,
8
- 'has-error': hasError,
9
- 'is-disabled': isDisabled,
10
- 'has-icon': $slots.icon,
11
- 'has-prefix': prefix,
12
- 'has-postfix': postfix
13
- }"
5
+ :class="[
6
+ themeClasses,
7
+ {
8
+ 'is-filled': value === 0 || !!value,
9
+ 'has-label': !!label,
10
+ 'has-error': hasError,
11
+ 'is-disabled': isDisabled,
12
+ 'has-icon': $slots.icon,
13
+ 'has-prefix': prefix,
14
+ 'has-postfix': postfix
15
+ }
16
+ ]"
14
17
  @click="$emit('open')"
15
18
  >
16
19
  <span
@@ -95,6 +98,7 @@
95
98
  </template>
96
99
 
97
100
  <script>
101
+ import { isType } from 'rambdax'
98
102
  import TextFieldMixin from '@AwMixins/text-field'
99
103
 
100
104
  export default {
@@ -123,6 +127,11 @@ export default {
123
127
  default: ''
124
128
  },
125
129
 
130
+ theme: {
131
+ type: String,
132
+ default: ''
133
+ },
134
+
126
135
  clearable: Boolean,
127
136
 
128
137
  caret: Boolean,
@@ -135,6 +144,14 @@ export default {
135
144
  return this.size === 'md' ? 'p-3' : 'p-2'
136
145
  },
137
146
 
147
+ themeClasses() {
148
+ return isType('String', this.theme)
149
+ ? this.theme
150
+ .split(',')
151
+ .map((modifier) => `aw-text-field--${modifier.trim()}`)
152
+ : []
153
+ },
154
+
138
155
  iconCount() {
139
156
  return 0 + this.clearable + this.caret
140
157
  }
@@ -1,9 +1,23 @@
1
1
  <template>
2
- <div class="aw-modal-buttons" :class="{ 'aw-modal-buttons--desktop': isDesktop, 'aw-modal-buttons--mobile': !isDesktop }">
2
+ <div
3
+ class="aw-modal-buttons"
4
+ :class="{
5
+ 'aw-modal-buttons--desktop': isDesktop,
6
+ 'aw-modal-buttons--mobile': !isDesktop
7
+ }"
8
+ >
3
9
  <!-- visible buttons -->
4
10
  <slot name="buttons" :buttons="groupedButtons.buttons">
5
11
  <AwButton
6
- v-for="({ listeners, tooltip, size, cssClass, autoWidth, ...attrs }, i) in groupedButtons.buttons"
12
+ v-for="({
13
+ listeners,
14
+ tooltip,
15
+ size,
16
+ cssClass,
17
+ autoWidth,
18
+ ...attrs
19
+ },
20
+ i) in groupedButtons.buttons"
7
21
  :key="i"
8
22
  v-tooltip.prepend="tooltip"
9
23
  v-bind="attrs"
@@ -12,22 +26,38 @@
12
26
  :class="[
13
27
  cssClass,
14
28
  {
15
- 'aw-modal-buttons__button--equal': !isDesktop && !autoWidth
29
+ 'aw-modal-buttons__button--equal':
30
+ !isDesktop && !autoWidth
16
31
  }
17
32
  ]"
18
33
  v-on="listeners"
19
34
  />
20
35
  </slot>
21
36
 
37
+ <!-- single non-cta button -->
38
+ <AwButton
39
+ v-if="singleDropdownButton"
40
+ v-bind="singleDropdownButton.attrs"
41
+ v-tooltip.prepend="singleDropdownButton.tooltip"
42
+ v-on="singleDropdownButton.listeners"
43
+ />
44
+
22
45
  <!-- dropdown buttons -->
23
- <template v-if="groupedButtons.dropdown.length">
24
- <slot name="toggler" :v-bind="{ togglerProps, isOpened, open, close }">
46
+ <template v-else-if="groupedButtons.dropdown.length">
47
+ <slot
48
+ name="toggler"
49
+ :v-bind="{ togglerProps, isOpened, open, close }"
50
+ >
25
51
  <AwButton v-bind="togglerProps" @click="open" />
26
52
  </slot>
27
- <AwDropdown :show.sync="isOpened" :options="$options.dropdownOptions">
53
+ <AwDropdown
54
+ :show.sync="isOpened"
55
+ :options="$options.dropdownOptions"
56
+ >
28
57
  <slot name="dropdown" :buttons="groupedButtons.dropdown">
29
58
  <AwDropdownButton
30
- v-for="({ listeners, tooltip, ...attrs }, i) in groupedButtons.dropdown"
59
+ v-for="({ listeners, tooltip, ...attrs },
60
+ i) in groupedButtons.dropdown"
31
61
  :key="i"
32
62
  v-tooltip.prepend="tooltip"
33
63
  v-bind="attrs"
@@ -88,7 +118,10 @@ export default {
88
118
  groupedButtons() {
89
119
  return this.items.reduce(
90
120
  (acc, item) => {
91
- const { cta, dropdown, show = true, ...itemProps } = { ...this.options, ...item }
121
+ const { cta, dropdown, show = true, ...itemProps } = {
122
+ ...this.options,
123
+ ...item
124
+ }
92
125
 
93
126
  // rename class prop
94
127
  if (itemProps.class) {
@@ -98,10 +131,20 @@ export default {
98
131
 
99
132
  // add button if visible
100
133
  if (show !== false) {
101
- const group = this.isDesktop ? (dropdown ? 'dropdown' : 'buttons') : cta ? 'buttons' : 'dropdown'
134
+ const group = this.isDesktop
135
+ ? dropdown
136
+ ? 'dropdown'
137
+ : 'buttons'
138
+ : cta
139
+ ? 'buttons'
140
+ : 'dropdown'
102
141
 
103
142
  // omit not available colors
104
- if (group === 'dropdown' && itemProps.color && !DROPDOWN_BUTTON_COLORS.includes(itemProps.color)) {
143
+ if (
144
+ group === 'dropdown' &&
145
+ itemProps.color &&
146
+ !DROPDOWN_BUTTON_COLORS.includes(itemProps.color)
147
+ ) {
105
148
  itemProps.color = undefined
106
149
  }
107
150
 
@@ -114,12 +157,42 @@ export default {
114
157
  )
115
158
  },
116
159
 
160
+ singleDropdownButton() {
161
+ const singleButton =
162
+ this.groupedButtons.dropdown.length === 1
163
+ ? this.groupedButtons.dropdown[0]
164
+ : null
165
+
166
+ if (
167
+ singleButton &&
168
+ !!singleButton.icon &&
169
+ (singleButton.hideText || !singleButton.text)
170
+ ) {
171
+ const {
172
+ listeners,
173
+ tooltip,
174
+ ...attrs
175
+ } = this.groupedButtons.dropdown[0]
176
+
177
+ return { listeners, tooltip, attrs }
178
+ }
179
+
180
+ return null
181
+ },
182
+
117
183
  togglerSize() {
118
- return path([this.groupedButtons.buttons.length - 1, 'size'], this.groupedButtons.buttons)
184
+ return path(
185
+ [this.groupedButtons.buttons.length - 1, 'size'],
186
+ this.groupedButtons.buttons
187
+ )
119
188
  },
120
189
 
121
190
  togglerProps() {
122
- return { ...omit(['cta'], this.options || {}), size: this.togglerSize, ...this.togglerOptions }
191
+ return {
192
+ ...omit(['cta'], this.options || {}),
193
+ size: this.togglerSize,
194
+ ...this.togglerOptions
195
+ }
123
196
  }
124
197
  },
125
198
 
@@ -249,12 +249,13 @@ export default {
249
249
  const value = $event.target.value
250
250
  const phoneNumber = this._parsePhoneNumber(value, this.country)
251
251
  const phoneValue = this._getPhoneValue(phoneNumber)
252
+ const isTyping = $event.data !== null
252
253
 
253
254
  // open dropdown on backspace
254
255
  if (
255
256
  phoneNumber.number === '' &&
256
257
  phoneValue === this.phoneValue &&
257
- $event.data === null
258
+ !isTyping
258
259
  ) {
259
260
  this.$nextTick(this._openCountriesDropdown)
260
261
  return
@@ -262,9 +263,20 @@ export default {
262
263
 
263
264
  // save caret position
264
265
  let pos = $event.target.selectionStart
265
- const digit = pos > 0 ? value[pos - 1] : '_'
266
+ let digit = pos > 0 ? value[pos - 1] : '_'
266
267
  let adjustPosition = false
267
268
 
269
+ if (isTyping && digit === ' ') {
270
+ adjustPosition = true
271
+
272
+ const max = value.length
273
+
274
+ while (pos < max && digit === ' ') {
275
+ pos++
276
+ digit = value[pos - 1]
277
+ }
278
+ }
279
+
268
280
  if (phoneValue !== this.phoneValue) {
269
281
  adjustPosition = true
270
282
 
@@ -288,7 +300,7 @@ export default {
288
300
  this.$refs.input.setError('')
289
301
  }
290
302
 
291
- if ($event.data !== null && this.showCountries) {
303
+ if (isTyping && this.showCountries) {
292
304
  this.showCountries = false
293
305
  }
294
306
 
@@ -308,6 +320,10 @@ export default {
308
320
  pos++
309
321
  }
310
322
 
323
+ while (isTyping && newValue[pos - 1] === ' ' && pos < max) {
324
+ pos++
325
+ }
326
+
311
327
  $event.target.setSelectionRange(pos, pos)
312
328
  })
313
329
  }
@@ -84,7 +84,11 @@
84
84
  >
85
85
  <!-- eslint-disable prettier/prettier -->
86
86
  <div :class="[containerClass, { 'aw-page__grid': hasAside }]">
87
- <div class="aw-page__mobile-title" aria-hidden="true">
87
+ <div
88
+ v-if="_title"
89
+ class="aw-page__mobile-title"
90
+ aria-hidden="true"
91
+ >
88
92
  {{ _title }}
89
93
  </div>
90
94
 
@@ -138,7 +138,7 @@ export default {
138
138
 
139
139
  computed: {
140
140
  teleportButtonsTo() {
141
- return this.injectedTeleportButtonsTo || this.teleportButtonsTo
141
+ return this.injectedTeleportButtonsTo || this.teleportFixedTo
142
142
  },
143
143
 
144
144
  isExpanded() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.100.0",
3
+ "version": "2.101.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -114,5 +114,5 @@
114
114
  "rollup-plugin-visualizer": "^2.6.0",
115
115
  "rollup-plugin-vue": "^5.0.1"
116
116
  },
117
- "gitHead": "baa508bf9c8f07ebbc9de17976c63215e6a05952"
117
+ "gitHead": "681e292d386de18b2ae3fd98a3de3b71d8b6742d"
118
118
  }