@awes-io/ui 2.91.0 → 2.92.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,35 @@
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.92.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.91.1...@awes-io/ui@2.92.0) (2024-01-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **aw-modal:** remove get param if non closable ([3a591b5](https://github.com/awes-io/client/commit/3a591b502a12fda867c22e60e5c12e1464716207))
12
+
13
+
14
+ ### Features
15
+
16
+ * add btn for close mobile select ([b590540](https://github.com/awes-io/client/commit/b590540cc235075dfd9071ba0be42e57bd610a65))
17
+ * add props for not closing modal ([00bd65c](https://github.com/awes-io/client/commit/00bd65c7741ec12b1314c15158cbd3d57c40e7b9))
18
+ * create page for mobile menu ([9b9b80a](https://github.com/awes-io/client/commit/9b9b80a67f97b6126e6196ffbcb862d4629df0a3))
19
+
20
+
21
+
22
+
23
+
24
+ ## [2.91.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.91.0...@awes-io/ui@2.91.1) (2024-01-25)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * conditional chainig removed ([9c2cd3e](https://github.com/awes-io/client/commit/9c2cd3ea940c809a615435edc5d219495ee0e9a7))
30
+
31
+
32
+
33
+
34
+
6
35
  # [2.91.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.90.0...@awes-io/ui@2.91.0) (2024-01-19)
7
36
 
8
37
 
@@ -63,8 +63,8 @@
63
63
  @import './layout-menu.css';
64
64
  @import './mobile-menu-nav.css';
65
65
  @import './mobile-menu-item.css';
66
- @import './mobile-menu-item-new.css';
67
66
  @import './mobile-menu.css';
67
+ @import './more.css';
68
68
  @import './icon-menu-item.css';
69
69
  @import './user-menu.css';
70
70
  @import './nav.css';
@@ -4,7 +4,6 @@
4
4
  display: flex;
5
5
  align-items: center;
6
6
  width: 100%;
7
- padding: 1rem 1.5rem;
8
7
 
9
8
  &:hover,
10
9
  &:focus {
@@ -13,24 +12,16 @@
13
12
  }
14
13
 
15
14
  &--active {
16
- color: var(--c-accent);
15
+ color: var(--c-mono-100);
17
16
  font-weight: bold;
18
- }
19
17
 
20
- &__icon-bg {
21
- border-radius: 0.3125rem;
22
- line-height: 1;
23
- flex: none;
18
+ .aw-mobile-menu-item__icon-bg {
19
+ color: var(--c-mono-100);
20
+ }
24
21
  }
25
22
 
26
- /* &__icon {} */
27
-
28
- &__text {
29
- display: flex;
30
- flex-direction: column;
31
- justify-content: center;
32
- padding: 0 1rem;
33
- flex-grow: 1;
23
+ &__icon-bg {
24
+ color: var(--c-mono-300);
34
25
  }
35
26
 
36
27
  &__description {
@@ -42,4 +33,52 @@
42
33
  &__arrow {
43
34
  flex: none;
44
35
  }
36
+
37
+ &--primary {
38
+ padding: 1rem 1.5rem;
39
+
40
+ .aw-mobile-menu-item {
41
+ &__icon-bg {
42
+ border-radius: 0.3125rem;
43
+ line-height: 1;
44
+ flex: none;
45
+ }
46
+
47
+ &__text {
48
+ display: flex;
49
+ flex-direction: column;
50
+ justify-content: center;
51
+ padding: 0 1rem;
52
+ flex-grow: 1;
53
+ }
54
+ }
55
+ }
56
+
57
+ &--island {
58
+ padding: 1.5rem;
59
+ border-radius: 1.25rem;
60
+
61
+ .aw-mobile-menu-item {
62
+ &__icon-bg {
63
+ margin-right: 1rem;
64
+ align-self: start;
65
+ }
66
+
67
+ &__text {
68
+ font-size: 1rem;
69
+ line-height: 1.5rem;
70
+ margin-right: 1rem;
71
+ }
72
+
73
+ &__description {
74
+ display: block;
75
+ font-weight: 400;
76
+ margin-top: 0.25rem;
77
+ }
78
+
79
+ &__arrow {
80
+ margin-left: auto;
81
+ }
82
+ }
83
+ }
45
84
  }
@@ -34,7 +34,7 @@
34
34
  }
35
35
  }
36
36
 
37
- li + li .aw-mobile-menu-item-new {
37
+ li + li .aw-mobile-menu-item--island {
38
38
  position: relative;
39
39
  margin-top: 0.125rem;
40
40
  }
@@ -115,6 +115,7 @@
115
115
  padding: 0.8125rem 1.5rem;
116
116
 
117
117
  &-icon {
118
+ color: var(--c-mono-300);
118
119
  margin-right: 1rem;
119
120
  }
120
121
 
@@ -0,0 +1,48 @@
1
+ .aw-more {
2
+ @apply bg-page-bg;
3
+ width: 100%;
4
+ min-height: 100vh;
5
+ padding-bottom: calc(5rem + var(--page-buttons-bottom, 0px));
6
+
7
+ &__profile {
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ flex-direction: column;
12
+
13
+ background: var(--c-surface);
14
+ border-radius: 0 0 0.9375rem 0.9375rem;
15
+ padding: 1.9375rem 1.5rem 1.5rem;
16
+ }
17
+
18
+ &__theme {
19
+ @apply bg-surface;
20
+
21
+ display: flex;
22
+ align-items: center;
23
+ position: relative;
24
+
25
+ padding: 0.8125rem 1.5rem;
26
+
27
+ &-icon {
28
+ color: var(--c-mono-300);
29
+ margin-right: 1rem;
30
+ }
31
+
32
+ &-text {
33
+ font-size: 1rem;
34
+ font-weight: 400;
35
+ line-height: 1.3125rem;
36
+ }
37
+
38
+ &-switcher {
39
+ margin-left: auto;
40
+ padding-top: 0;
41
+ padding-bottom: 0;
42
+
43
+ .aw-switch-field__switch {
44
+ margin: 0.1875rem;
45
+ }
46
+ }
47
+ }
48
+ }
@@ -66,6 +66,11 @@
66
66
  width: 100%;
67
67
  max-height: 1px;
68
68
  } */
69
+
70
+ .aw-text-field__prefix {
71
+ background: transparent;
72
+ padding-left: 0.25rem;
73
+ }
69
74
  }
70
75
 
71
76
  &__notify {
@@ -85,7 +90,7 @@
85
90
  &__mobile-input {
86
91
  position: sticky;
87
92
  top: 0;
88
-
93
+
89
94
  &.opened,
90
95
  & .aw-text-field__element {
91
96
  border-bottom-left-radius: 0;
@@ -109,6 +114,11 @@
109
114
  &.opened .aw-text-field__label {
110
115
  left: 1rem;
111
116
  }
117
+
118
+ .aw-text-field__prefix {
119
+ background: transparent;
120
+ padding-left: 0.25rem;
121
+ }
112
122
  }
113
123
 
114
124
  &--mobile-opened .aw-select__dropdown {
package/assets/js/url.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { pathOr } from 'rambdax'
2
+
1
3
  const FILENAME_RE = /([^\n?/]+)(?:\?.*)?$/g
2
4
 
3
- export const getFileName = (val) => String(val).match(FILENAME_RE)?.[0] || ''
5
+ export const getFileName = (val) =>
6
+ pathOr('', '0', String(val).match(FILENAME_RE))
@@ -138,6 +138,14 @@
138
138
  autocomplete="off"
139
139
  @input="_applySearch"
140
140
  >
141
+ <template #prefix>
142
+ <AwButton color="mono" v-if="isOpened" @click="_close">
143
+ <template #icon>
144
+ <AwIconSystemMono name="arrow" />
145
+ </template>
146
+ </AwButton>
147
+ </template>
148
+
141
149
  <template #icon>
142
150
  <AwButton
143
151
  v-if="_isCreateButton"
@@ -151,15 +151,15 @@
151
151
  @clear="clear"
152
152
  >
153
153
  <template #prefix>
154
- <slot
155
- name="icon"
156
- v-bind="{
157
- option: value,
158
- optionLabel: _selectedLabel,
159
- isLoading,
160
- isOpened
161
- }"
162
- ></slot>
154
+ <AwButton
155
+ color="mono"
156
+ v-if="isOpened"
157
+ @click="close"
158
+ >
159
+ <template #icon>
160
+ <AwIconSystemMono name="arrow" />
161
+ </template>
162
+ </AwButton>
163
163
  </template>
164
164
 
165
165
  <template #caret="data">
@@ -15,7 +15,8 @@
15
15
  :text="$t('Menu')"
16
16
  icon="menu-dots"
17
17
  :size="$options.ICON_SIZE"
18
- @click="$store.commit('awesIo/TOGGLE_MOBILE_MENU')"
18
+ href="/more"
19
+ :active="!activeMenu"
19
20
  >
20
21
  <template #default="{ text }">
21
22
  <span
@@ -28,6 +28,7 @@
28
28
  </div>
29
29
 
30
30
  <AwButton
31
+ v-if="!notClosing"
31
32
  :class="elClasses.close"
32
33
  :title="$t('Close')"
33
34
  :aria-label="$t('Close')"
@@ -133,6 +134,8 @@ export default {
133
134
  }
134
135
  },
135
136
 
137
+ notClosing: Boolean,
138
+
136
139
  name: {
137
140
  type: String,
138
141
  default: () => `modal-${_uniqModalId++}`
@@ -206,6 +209,10 @@ export default {
206
209
  },
207
210
 
208
211
  paramComputed() {
212
+ if (this.notClosing) {
213
+ return null
214
+ }
215
+
209
216
  switch (typeof this.param) {
210
217
  case 'string':
211
218
  return this.param || DEFAULT_GET_PARAM
@@ -245,9 +252,15 @@ export default {
245
252
  if (typeof document === 'undefined') return
246
253
  this.lastFocused = document.activeElement
247
254
  this.$nextTick(() => this.$refs.header.focus())
248
- window.addEventListener('keyup', this._escButtonHandler)
255
+
256
+ if (!this.notClosing) {
257
+ window.addEventListener('keyup', this._escButtonHandler)
258
+ }
249
259
  } else {
250
- window.removeEventListener('keyup', this._escButtonHandler)
260
+ if (!this.notClosing) {
261
+ window.removeEventListener('keyup', this._escButtonHandler)
262
+ }
263
+
251
264
  if (this.lastFocused) {
252
265
  this.lastFocused.focus()
253
266
  this.lastFocused = null // clear reference
@@ -293,7 +306,7 @@ export default {
293
306
  },
294
307
 
295
308
  selfClose() {
296
- if (this.fullscreen || !this.bgClickClose) return
309
+ if (this.fullscreen || !this.bgClickClose || this.notClosing) return
297
310
  let self = this
298
311
  window.addEventListener('mouseup', function onUp(e) {
299
312
  window.removeEventListener('mouseup', onUp)
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <AwLayoutProvider class="aw-layout">
3
- <AwMobileMenu v-if="!$screen.lg">
4
- <template
5
- v-for="(index, name) in $scopedSlots"
6
- v-slot:[name]="data"
7
- >
8
- <slot :name="name" v-bind="data"></slot>
9
- </template>
10
- </AwMobileMenu>
3
+ <!-- <AwMobileMenu v-if="!$screen.lg">-->
4
+ <!-- <template-->
5
+ <!-- v-for="(index, name) in $scopedSlots"-->
6
+ <!-- v-slot:[name]="data"-->
7
+ <!-- >-->
8
+ <!-- <slot :name="name" v-bind="data"></slot>-->
9
+ <!-- </template>-->
10
+ <!-- </AwMobileMenu>-->
11
11
 
12
12
  <AwLayoutMenu v-if="$screen.lg" class="aw-layout__aw-layout-menu">
13
13
  <template
@@ -25,7 +25,7 @@
25
25
  </template>
26
26
 
27
27
  <script>
28
- import AwMobileMenu from '@AwLayouts/_AwMobileMenu.vue'
28
+ // import AwMobileMenu from '@AwLayouts/_AwMobileMenu.vue'
29
29
  import AwLayoutMenu from '@AwLayouts/_AwLayoutMenu.vue'
30
30
  import AwHeaderNotification from '@AwLayouts/_AwHeaderNotification.vue'
31
31
 
@@ -33,7 +33,7 @@ export default {
33
33
  name: 'AwLayout',
34
34
 
35
35
  components: {
36
- AwMobileMenu,
36
+ // AwMobileMenu,
37
37
  AwLayoutMenu,
38
38
  AwHeaderNotification
39
39
  }
@@ -70,11 +70,12 @@
70
70
  >
71
71
  <template #default="{items, _getChildrenCount, isActive }">
72
72
  <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
73
- <AwMobileMenuItemNew
73
+ <AwMobileMenuItem
74
74
  v-bind="item"
75
75
  :href="_getChildrenCount(item) ? null : item.href"
76
76
  :arrow="!!(item.href || _getChildrenCount(item))"
77
77
  :active="isActive(item)"
78
+ theme="island"
78
79
  v-on="
79
80
  _getChildrenCount(item)
80
81
  ? {
@@ -101,11 +102,12 @@
101
102
  >
102
103
  <template #default="{items, _getChildrenCount, isActive }">
103
104
  <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
104
- <AwMobileMenuItemNew
105
+ <AwMobileMenuItem
105
106
  v-bind="item"
106
107
  :href="_getChildrenCount(item) ? null : item.href"
107
108
  :arrow="!!(item.href || _getChildrenCount(item))"
108
109
  :active="isActive(item)"
110
+ theme="isalnd"
109
111
  v-on="
110
112
  _getChildrenCount(item)
111
113
  ? {
@@ -214,7 +216,7 @@ import { LINK_REGEX } from '@AwConfig'
214
216
  import { conf } from '@AwUtils/component'
215
217
  import { getPath } from '@AwUtils/router'
216
218
  import AwMobileMenuNav from '@AwLayouts/_AwMobileMenuNav.vue'
217
- import AwMobileMenuItemNew from '@AwLayouts/_AwMobileMenuItemNew.vue'
219
+ import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
218
220
  // import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
219
221
 
220
222
  export default {
@@ -223,7 +225,7 @@ export default {
223
225
  components: {
224
226
  AwMobileMenuNav,
225
227
  AwLayoutLogo: () => import('@AwLayouts/_AwLayoutLogo.vue'),
226
- AwMobileMenuItemNew
228
+ AwMobileMenuItem
227
229
  // AwMobileMenuItem
228
230
  },
229
231
 
@@ -2,7 +2,11 @@
2
2
  <Component
3
3
  :is="_linkComponent"
4
4
  v-bind="_linkAttrs"
5
- :class="{ 'aw-mobile-menu-item--active': active }"
5
+ :class="{
6
+ 'aw-mobile-menu-item--active': active,
7
+ 'aw-mobile-menu-item--primary': theme === 'primary',
8
+ 'aw-mobile-menu-item--island': theme === 'island'
9
+ }"
6
10
  class="aw-mobile-menu-item focus-outline"
7
11
  v-on="$listeners"
8
12
  >
@@ -27,6 +31,13 @@
27
31
  v-html="$sanitize(description)"
28
32
  class="aw-mobile-menu-item__description"
29
33
  ></span>
34
+
35
+ <span
36
+ v-else-if="childrenDescription && theme === 'island'"
37
+ class="aw-mobile-menu-item__description"
38
+ >
39
+ {{ childrenDescription }}
40
+ </span>
30
41
  </span>
31
42
 
32
43
  <AwBadge v-if="badge" v-bind="badge" class="mr-2" />
@@ -35,13 +46,14 @@
35
46
  v-if="_linkExternal"
36
47
  name="external"
37
48
  size="24"
38
- class="aw-mobile-menu-item__arrow text-on-surface"
49
+ class="aw-mobile-menu-item__arrow text-mono-400"
39
50
  />
40
51
 
41
52
  <AwIconSystemMono
42
53
  v-else-if="arrow"
43
54
  name="angle"
44
55
  rotate="180"
56
+ size="24"
45
57
  class="aw-mobile-menu-item__arrow text-mono-400"
46
58
  />
47
59
  </slot>
@@ -67,11 +79,21 @@ export default {
67
79
  default: ''
68
80
  },
69
81
 
82
+ theme: {
83
+ type: String,
84
+ default: 'primary' // primary, island
85
+ },
86
+
70
87
  href: {
71
88
  type: [String, Object],
72
89
  default: ''
73
90
  },
74
91
 
92
+ children: {
93
+ type: Array,
94
+ default: () => []
95
+ },
96
+
75
97
  icon: {
76
98
  type: String,
77
99
  default: ''
@@ -105,6 +127,12 @@ export default {
105
127
  color: '#fff'
106
128
  }
107
129
  : null
130
+ },
131
+
132
+ childrenDescription() {
133
+ const childrenText = this.children.map((item) => this.$t(item.text))
134
+
135
+ return childrenText.join(' • ')
108
136
  }
109
137
  }
110
138
  }
package/nuxt/index.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  notify as configNotify
12
12
  } from './awes.config.js'
13
13
  import defaultTailwindConfig from '../tailwind.config.js'
14
+ import { mergeRoutes } from '@awes-io/nuxt-admin/src/utils/merge-routes'
14
15
 
15
16
  const DEFAULT_DAYJS_LOCALE = 'en'
16
17
 
@@ -409,6 +410,15 @@ async function AwesIoUi() {
409
410
  })
410
411
  }
411
412
  })
413
+
414
+ this.nuxt.hook('build:extendRoutes', (routes = []) => {
415
+ mergeRoutes(routes, [
416
+ {
417
+ path: '/more',
418
+ component: resolve(__dirname, './pages/more.vue')
419
+ }
420
+ ])
421
+ })
412
422
  }
413
423
 
414
424
  AwesIoUi.meta = JSON.parse(
@@ -0,0 +1,173 @@
1
+ <template>
2
+ <div class="aw-more">
3
+ <div class="aw-more__profile" v-if="user">
4
+ <AwAvatar :src="user.src" :name="user.name" size="144" />
5
+
6
+ <AwHeadline tag="span" class="aw-more__profile-name mt-2">
7
+ {{ user.name }}
8
+ </AwHeadline>
9
+
10
+ <AwDescription
11
+ v-if="user.description"
12
+ tag="div"
13
+ class="aw-more__profile-description mt-2"
14
+ >
15
+ {{ user.description }}
16
+ </AwDescription>
17
+
18
+ <AwButton
19
+ class="mt-6 w-full"
20
+ :text="$t('Your profile')"
21
+ color="dark"
22
+ :href="profileUrl"
23
+ />
24
+ </div>
25
+
26
+ <slot name="before-mobile-menu">
27
+ <Component
28
+ v-if="beforeMobileMenuComponent"
29
+ :is="beforeMobileMenuComponent.is"
30
+ v-bind="beforeMobileMenuComponent.props"
31
+ />
32
+ </slot>
33
+
34
+ <AwMobileMenuNav :title="$t('More')" :items="mainMenu" class="mt-6">
35
+ <template #default="{items, _getChildrenCount, isActive }">
36
+ <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
37
+ <AwMobileMenuItem
38
+ v-bind="item"
39
+ :href="item.href"
40
+ theme="island"
41
+ :arrow="!!(item.href || _getChildrenCount(item))"
42
+ :active="isActive(item)"
43
+ v-on="item.listeners"
44
+ />
45
+ </li>
46
+ </template>
47
+ </AwMobileMenuNav>
48
+
49
+ <AwMobileMenuNav :items="secondaryMenu" class="mt-6">
50
+ <template #default="{items, _getChildrenCount, isActive }">
51
+ <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
52
+ <AwMobileMenuItem
53
+ v-bind="item"
54
+ :href="item.href"
55
+ theme="island"
56
+ :arrow="!!(item.href || _getChildrenCount(item))"
57
+ :active="isActive(item)"
58
+ v-on="item.listeners"
59
+ />
60
+ </li>
61
+ </template>
62
+ </AwMobileMenuNav>
63
+
64
+ <AwMobileMenuNav :items="userMenu" class="mt-6">
65
+ <template #before>
66
+ <div class="aw-more__theme">
67
+ <AwIconSystemMono
68
+ :size="24"
69
+ class="aw-more__theme-icon"
70
+ name="light"
71
+ />
72
+
73
+ <span class="aw-more__theme-text">{{
74
+ $t('Dark theme')
75
+ }}</span>
76
+
77
+ <AwSwitcher
78
+ v-model="isDarkTheme"
79
+ class="aw-more__theme-switcher"
80
+ />
81
+ </div>
82
+ </template>
83
+ </AwMobileMenuNav>
84
+
85
+ <AwMobileMenuNav :items="tertiaryMenu" class="my-6" />
86
+
87
+ <slot name="after-mobile-menu">
88
+ <Component
89
+ v-if="afterMobileMenuComponent"
90
+ :is="afterMobileMenuComponent.is"
91
+ v-bind="afterMobileMenuComponent.props"
92
+ />
93
+ </slot>
94
+
95
+ <AwBottomBar />
96
+ </div>
97
+ </template>
98
+
99
+ <script>
100
+ import { mapGetters } from 'vuex'
101
+ import { lensProp, pathOr, viewOr } from 'rambdax'
102
+
103
+ import AwMobileMenuNav from '@AwLayouts/_AwMobileMenuNav.vue'
104
+ import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
105
+
106
+ export default {
107
+ name: 'More',
108
+
109
+ layout: 'empty',
110
+
111
+ inject: {
112
+ layoutProvider: {
113
+ default: null
114
+ }
115
+ },
116
+
117
+ components: {
118
+ AwMobileMenuNav,
119
+ AwMobileMenuItem
120
+ },
121
+
122
+ computed: {
123
+ ...mapGetters('awesIo', [
124
+ 'user',
125
+ 'logoComponent',
126
+ 'afterMobileMenuComponent',
127
+ 'beforeMobileMenuComponent'
128
+ ]),
129
+
130
+ profileUrl() {
131
+ return pathOr(null, 'awesIo.profileUrl', this.$store.state)
132
+ },
133
+
134
+ mainMenu() {
135
+ return viewOr([], lensProp('mainMenu'), this.layoutProvider).filter(
136
+ ({ is }) => !is
137
+ )
138
+ },
139
+
140
+ secondaryMenu() {
141
+ return viewOr(
142
+ [],
143
+ lensProp('secondaryMenu'),
144
+ this.layoutProvider
145
+ ).filter(({ is }) => !is)
146
+ },
147
+
148
+ tertiaryMenu() {
149
+ return viewOr(
150
+ [],
151
+ lensProp('tertiaryMenu'),
152
+ this.layoutProvider
153
+ ).filter(({ is }) => !is)
154
+ },
155
+
156
+ userMenu() {
157
+ return viewOr([], lensProp('userMenu'), this.layoutProvider).filter(
158
+ ({ is }) => !is
159
+ )
160
+ },
161
+
162
+ isDarkTheme: {
163
+ get() {
164
+ return this.$store.getters['awesIo/isDarkTheme']
165
+ },
166
+
167
+ set(val) {
168
+ this.$store.commit('awesIo/SET_DARK_THEME', val)
169
+ }
170
+ }
171
+ }
172
+ }
173
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.91.0",
3
+ "version": "2.92.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": "af9a908d480297a008fa11bd735db9bb1aa394eb"
117
+ "gitHead": "eb28d05b048c7d2545694dbf4ac607e0267971d0"
118
118
  }
@@ -1,45 +0,0 @@
1
- .aw-mobile-menu-item-new {
2
- @apply bg-surface;
3
- font-size: theme('fontSize.base', 1rem);
4
- display: flex;
5
- align-items: center;
6
- width: 100%;
7
- padding: 1.5rem;
8
- border-radius: 1.25rem;
9
-
10
- &:hover,
11
- &:focus {
12
- oultine: none;
13
- text-decoration: none;
14
- }
15
-
16
- &--active {
17
- color: var(--c-accent);
18
- font-weight: bold;
19
- }
20
-
21
- &__icon-bg {
22
- margin-right: 1rem;
23
- align-self: start;
24
- }
25
-
26
- &__text {
27
- font-size: 1rem;
28
- line-height: 1.5rem;
29
- margin-right: 1rem;
30
- }
31
-
32
- &__description {
33
- display: block;
34
- font-weight: 400;
35
- color: var(--c-mono-400);
36
- font-size: 0.875rem;
37
- line-height: 1rem;
38
- margin-top: 0.25rem;
39
- }
40
-
41
- &__arrow {
42
- margin-left: auto;
43
- flex: none;
44
- }
45
- }
@@ -1,128 +0,0 @@
1
- <template>
2
- <Component
3
- :is="_linkComponent"
4
- v-bind="_linkAttrs"
5
- :class="{ 'aw-mobile-menu-item-new--active': active }"
6
- class="aw-mobile-menu-item-new focus-outline"
7
- v-on="$listeners"
8
- >
9
- <slot>
10
- <span
11
- v-if="icon"
12
- class="aw-mobile-menu-item-new__icon-bg"
13
- :style="iconColor"
14
- >
15
- <AwIcon
16
- :name="(active && iconActive) || icon"
17
- size="24"
18
- class="aw-mobile-menu-item-new__icon"
19
- />
20
- </span>
21
-
22
- <span class="aw-mobile-menu-item-new__text" tabindex="-1">
23
- {{ text }}
24
-
25
- <span
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"
33
- class="aw-mobile-menu-item-new__description"
34
- >
35
- {{ childrenDescription }}
36
- </span>
37
- </span>
38
-
39
- <AwBadge v-if="badge" v-bind="badge" class="mr-2" />
40
-
41
- <AwIconSystemMono
42
- v-if="_linkExternal"
43
- name="external"
44
- class="aw-mobile-menu-item-new__arrow text-on-surface"
45
- />
46
-
47
- <AwIconSystemMono
48
- v-else-if="arrow"
49
- name="angle"
50
- rotate="180"
51
- class="aw-mobile-menu-item-new__arrow text-mono-400"
52
- />
53
- </slot>
54
- </Component>
55
- </template>
56
-
57
- <script>
58
- import linkMixin from '@AwMixins/link'
59
-
60
- export default {
61
- name: 'AwMobileMenuItemNew',
62
-
63
- mixins: [linkMixin],
64
-
65
- props: {
66
- text: {
67
- type: String,
68
- required: true
69
- },
70
-
71
- description: {
72
- type: String,
73
- default: ''
74
- },
75
-
76
- href: {
77
- type: [String, Object],
78
- default: ''
79
- },
80
-
81
- children: {
82
- type: Array,
83
- default: () => []
84
- },
85
-
86
- icon: {
87
- type: String,
88
- default: ''
89
- },
90
-
91
- iconBg: {
92
- type: String,
93
- default: ''
94
- },
95
-
96
- iconActive: {
97
- type: String,
98
- default: ''
99
- },
100
-
101
- badge: {
102
- type: Object,
103
- default: null
104
- },
105
-
106
- arrow: Boolean,
107
-
108
- active: Boolean
109
- },
110
-
111
- computed: {
112
- iconColor() {
113
- return this.iconBg
114
- ? {
115
- backgroundColor: this.iconBg,
116
- color: '#fff'
117
- }
118
- : null
119
- },
120
-
121
- childrenDescription() {
122
- const childrenText = this.children.map((item) => this.$t(item.text))
123
-
124
- return childrenText.join(' • ')
125
- }
126
- }
127
- }
128
- </script>