@usssa/component-library 1.0.0-alpha.4 → 1.0.0-alpha.6
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 +3 -3
- package/src/components/ComponentLink.vue +26 -0
- package/src/components/core/UAvatar.vue +146 -0
- package/src/components/core/UAvatarGroup.vue +119 -0
- package/src/components/core/UBadgeStd.vue +91 -0
- package/src/components/core/UBannerStd.vue +113 -0
- package/src/components/core/UBtnIcon.vue +148 -0
- package/src/components/core/UBtnStd.vue +125 -0
- package/src/components/core/UCheckboxStd.vue +78 -0
- package/src/components/core/UChip.vue +225 -0
- package/src/components/core/UInputTextStd.vue +270 -0
- package/src/components/core/UMultiSelectStd.vue +268 -0
- package/src/components/core/URadioStd.vue +58 -0
- package/src/components/core/USelectStd.vue +235 -0
- package/src/components/core/UTabBtnStd.vue +153 -0
- package/src/components/core/UTabsStd.vue +99 -0
- package/src/components/core/UToggleStd.vue +149 -0
- package/src/components/core/UTooltip.vue +52 -0
- package/src/components/index.js +24 -0
- package/dist/spa/assets/Avatar.45667392.js +0 -9
- package/dist/spa/assets/AvatarGroup.99557443.js +0 -9
- package/dist/spa/assets/AvatarGroup.bb4cd03a.css +0 -1
- package/dist/spa/assets/BadgeStd.ee4129c5.js +0 -6
- package/dist/spa/assets/BannerPage.6c6a98c4.js +0 -10
- package/dist/spa/assets/BannerPage.d195fcac.css +0 -1
- package/dist/spa/assets/BtnIcon.89e50d2e.css +0 -1
- package/dist/spa/assets/BtnIcon.934f8c5b.js +0 -10
- package/dist/spa/assets/BtnStd.95fc4510.js +0 -11
- package/dist/spa/assets/CheckBox.3c204a4b.css +0 -1
- package/dist/spa/assets/CheckBox.fbc0bd1a.js +0 -7
- package/dist/spa/assets/Chip.49ffc857.js +0 -11
- package/dist/spa/assets/Chip.74acaa33.css +0 -1
- package/dist/spa/assets/ComponentBase.1ae19b7e.js +0 -1
- package/dist/spa/assets/ErrorNotFound.6cccfaee.js +0 -1
- package/dist/spa/assets/IndexPage.17d09b76.js +0 -1
- package/dist/spa/assets/InputText.19c0d7d1.css +0 -1
- package/dist/spa/assets/InputText.3fcd97a4.js +0 -20
- package/dist/spa/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff +0 -0
- package/dist/spa/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff +0 -0
- package/dist/spa/assets/MainLayout.912bb0f8.js +0 -1
- package/dist/spa/assets/MultiSelectStd.644b108c.js +0 -17
- package/dist/spa/assets/MultiSelectStd.c7af49eb.css +0 -1
- package/dist/spa/assets/QAvatar.5940a79e.js +0 -1
- package/dist/spa/assets/QCheckbox.48b43f7d.js +0 -1
- package/dist/spa/assets/QPage.ca395ec4.js +0 -1
- package/dist/spa/assets/QRadio.0a7f5e2c.js +0 -1
- package/dist/spa/assets/QResizeObserver.30c3566c.js +0 -1
- package/dist/spa/assets/QSelect.a40eb786.js +0 -1
- package/dist/spa/assets/QTabs.72f2507e.js +0 -1
- package/dist/spa/assets/QToggle.376c48be.js +0 -1
- package/dist/spa/assets/QTooltip.5aa8e325.js +0 -1
- package/dist/spa/assets/Radio.0ac35288.js +0 -7
- package/dist/spa/assets/Radio.aca54a89.css +0 -1
- package/dist/spa/assets/SelectStd.5c6891db.css +0 -1
- package/dist/spa/assets/SelectStd.daf1def9.js +0 -16
- package/dist/spa/assets/TabButtonPage.20e871dd.js +0 -7
- package/dist/spa/assets/TabButtonPage.36ce9f9c.css +0 -1
- package/dist/spa/assets/TabsPage.9b94ff39.css +0 -1
- package/dist/spa/assets/TabsPage.b92cccee.js +0 -9
- package/dist/spa/assets/TogglePage.8129b631.css +0 -1
- package/dist/spa/assets/TogglePage.ba6e325c.js +0 -9
- package/dist/spa/assets/UAvatar.dda7e478.js +0 -1
- package/dist/spa/assets/UAvatar.ea8daa38.css +0 -1
- package/dist/spa/assets/UBadgeStd.3965db9a.css +0 -1
- package/dist/spa/assets/UBadgeStd.e165ee05.js +0 -1
- package/dist/spa/assets/UBtnStd.979ec4e8.js +0 -1
- package/dist/spa/assets/UBtnStd.bdd4f5e5.css +0 -1
- package/dist/spa/assets/UTooltip.d2e04d0c.js +0 -1
- package/dist/spa/assets/UTooltip.efa029a7.css +0 -1
- package/dist/spa/assets/dom.e9d4ad51.js +0 -1
- package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff +0 -0
- package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 +0 -0
- package/dist/spa/assets/format.41663636.js +0 -1
- package/dist/spa/assets/index.43c62a18.js +0 -21
- package/dist/spa/assets/index.4fbd73cf.css +0 -5
- package/dist/spa/assets/option-sizes.10cc02d3.js +0 -1
- package/dist/spa/assets/render.e67ff27a.js +0 -1
- package/dist/spa/assets/tooltip.7c0d0774.js +0 -8
- package/dist/spa/assets/touch.9135741d.js +0 -1
- package/dist/spa/assets/use-checkbox.44a623c0.js +0 -1
- package/dist/spa/favicon.ico +0 -0
- package/dist/spa/icons/caret-down.svg +0 -5
- package/dist/spa/icons/circle-xmark.svg +0 -6
- package/dist/spa/icons/favicon-128x128.png +0 -0
- package/dist/spa/icons/favicon-16x16.png +0 -0
- package/dist/spa/icons/favicon-32x32.png +0 -0
- package/dist/spa/icons/favicon-96x96.png +0 -0
- package/dist/spa/index.html +0 -3
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usssa/component-library",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.6",
|
|
4
4
|
"description": "A Quasar component library project",
|
|
5
5
|
"productName": "Quasar component library App",
|
|
6
6
|
"author": "Troy Moreland <troy.moreland@usssa.com>",
|
|
7
|
-
"main": "index.js",
|
|
7
|
+
"main": "src/components/index.js",
|
|
8
8
|
"files": [
|
|
9
|
-
"
|
|
9
|
+
"src/components",
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"publishConfig": {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-item clickable :to="path">
|
|
3
|
+
<q-item-section class="bg-neutral-4">
|
|
4
|
+
<q-item-label class="q-pa-sm">{{ title }}</q-item-label>
|
|
5
|
+
</q-item-section>
|
|
6
|
+
</q-item>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { defineComponent } from 'vue'
|
|
11
|
+
|
|
12
|
+
export default defineComponent({
|
|
13
|
+
name: 'ComponentLink',
|
|
14
|
+
props: {
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
path: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: '/',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import UBadgeStd from './UBadgeStd.vue'
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
color: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'primary',
|
|
8
|
+
},
|
|
9
|
+
icon: {
|
|
10
|
+
type: String,
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'xl',
|
|
15
|
+
},
|
|
16
|
+
image: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
indicatorColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'neutral-4',
|
|
22
|
+
},
|
|
23
|
+
name: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
showIndicator: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
icon: {
|
|
32
|
+
type: String,
|
|
33
|
+
},
|
|
34
|
+
round: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits(['onClick'])
|
|
41
|
+
|
|
42
|
+
const handleClick = () => {
|
|
43
|
+
return emit('onClick')
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const labelSize = computed(() => {
|
|
47
|
+
if (props.size === 'sm') {
|
|
48
|
+
return 'xs'
|
|
49
|
+
}
|
|
50
|
+
if (props.size === 'md') {
|
|
51
|
+
return 'sm'
|
|
52
|
+
}
|
|
53
|
+
if (props.size === 'lg') {
|
|
54
|
+
return 'md'
|
|
55
|
+
}
|
|
56
|
+
if (props.size === 'xl') {
|
|
57
|
+
return 'lg'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return props.size
|
|
61
|
+
})
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<q-avatar
|
|
66
|
+
class="u-avatar"
|
|
67
|
+
:class="`size-${size}`"
|
|
68
|
+
@click="handleClick"
|
|
69
|
+
:round="round"
|
|
70
|
+
:rounded="!round"
|
|
71
|
+
:icon="icon"
|
|
72
|
+
v-bind="$attrs"
|
|
73
|
+
>
|
|
74
|
+
<img v-if="image" :src="image" :alt="`avatar ${name}`" :aria-label="name" />
|
|
75
|
+
<span
|
|
76
|
+
v-if="!image"
|
|
77
|
+
class="name"
|
|
78
|
+
:class="`text-${color} text-caption-${labelSize}`"
|
|
79
|
+
>
|
|
80
|
+
{{ name }}
|
|
81
|
+
</span>
|
|
82
|
+
<UBadgeStd
|
|
83
|
+
v-if="showIndicator"
|
|
84
|
+
:color="indicatorColor"
|
|
85
|
+
:class="`indicator`"
|
|
86
|
+
size="xs"
|
|
87
|
+
type="indicator"
|
|
88
|
+
/>
|
|
89
|
+
<slot name="item" />
|
|
90
|
+
</q-avatar>
|
|
91
|
+
</template>
|
|
92
|
+
<style lang="sass">
|
|
93
|
+
.u-avatar
|
|
94
|
+
position: relative
|
|
95
|
+
background: $blue-1
|
|
96
|
+
|
|
97
|
+
&.rounded-borders
|
|
98
|
+
border-radius: $xxs
|
|
99
|
+
|
|
100
|
+
&.size-lg.rounded-borders,&.size-xl.rounded-borders
|
|
101
|
+
border-radius: $xs
|
|
102
|
+
|
|
103
|
+
&.size-sm
|
|
104
|
+
width: $ba
|
|
105
|
+
height: $ba
|
|
106
|
+
|
|
107
|
+
.indicator
|
|
108
|
+
width: $xs
|
|
109
|
+
height: $xs
|
|
110
|
+
|
|
111
|
+
.q-avatar__content .name
|
|
112
|
+
line-height: $xs !important
|
|
113
|
+
|
|
114
|
+
&.size-md
|
|
115
|
+
width: $ms
|
|
116
|
+
height: $ms
|
|
117
|
+
|
|
118
|
+
.indicator
|
|
119
|
+
width: $xs
|
|
120
|
+
height: $xs
|
|
121
|
+
|
|
122
|
+
&.size-lg
|
|
123
|
+
width: $md
|
|
124
|
+
height: $md
|
|
125
|
+
|
|
126
|
+
.indicator
|
|
127
|
+
width: $sm
|
|
128
|
+
height: $sm
|
|
129
|
+
|
|
130
|
+
&.size-xl
|
|
131
|
+
width: $lg
|
|
132
|
+
height: $lg
|
|
133
|
+
|
|
134
|
+
.indicator
|
|
135
|
+
width: $ba
|
|
136
|
+
height: $ba
|
|
137
|
+
|
|
138
|
+
.indicator
|
|
139
|
+
position: absolute
|
|
140
|
+
bottom: 0
|
|
141
|
+
right: 0
|
|
142
|
+
width: $sm
|
|
143
|
+
height: $sm
|
|
144
|
+
border: 1.5px solid $neutral-1
|
|
145
|
+
background: $neutral-4
|
|
146
|
+
</style>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import UTooltip from './UTooltip.vue'
|
|
4
|
+
import UAvatar from './UAvatar.vue'
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
color: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'primary',
|
|
9
|
+
},
|
|
10
|
+
icon: {
|
|
11
|
+
type: String,
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
type: String,
|
|
15
|
+
},
|
|
16
|
+
image: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
images: {
|
|
20
|
+
type: Array,
|
|
21
|
+
},
|
|
22
|
+
indicatorColor: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'neutral-4',
|
|
25
|
+
},
|
|
26
|
+
name: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
showIndicator: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
round: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true,
|
|
37
|
+
},
|
|
38
|
+
avatarLimit: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 4,
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const emit = defineEmits(['onClick'])
|
|
45
|
+
|
|
46
|
+
const handleClick = () => {
|
|
47
|
+
return emit('onClick')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const displayedAvatars = computed(() => {
|
|
51
|
+
return props.images.slice(0, props.avatarLimit)
|
|
52
|
+
})
|
|
53
|
+
const remainingAvatars = computed(() => {
|
|
54
|
+
return props.images.slice(props.avatarLimit)
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<UAvatar
|
|
60
|
+
v-for="(avatar, index) in displayedAvatars"
|
|
61
|
+
class="avatarGroup"
|
|
62
|
+
:name="avatar.name"
|
|
63
|
+
:size="size"
|
|
64
|
+
:showIndicator="showIndicator"
|
|
65
|
+
:indicatorColor="indicatorColor"
|
|
66
|
+
:round="round"
|
|
67
|
+
:image="avatar.image"
|
|
68
|
+
:key="index"
|
|
69
|
+
@click="handleClick"
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<q-icon
|
|
73
|
+
:class="`avatarGroup additonalUsersAvatar size-${size} fa-duotone fa-solid fa-circle-plus`"
|
|
74
|
+
color="primary"
|
|
75
|
+
aria-label="See more Avatar"
|
|
76
|
+
v-if="remainingAvatars.length"
|
|
77
|
+
>
|
|
78
|
+
<UTooltip
|
|
79
|
+
anchor="bottom middle"
|
|
80
|
+
description=""
|
|
81
|
+
self="top middle"
|
|
82
|
+
:offset="[4, 4]"
|
|
83
|
+
>
|
|
84
|
+
<template v-slot:item>
|
|
85
|
+
<div class="text-body-xs tooltip-text">
|
|
86
|
+
<span v-for="(avatar, index) in remainingAvatars" :key="index">
|
|
87
|
+
{{ avatar.name }}<br />
|
|
88
|
+
</span>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
</UTooltip>
|
|
92
|
+
</q-icon>
|
|
93
|
+
</template>
|
|
94
|
+
<style lang="sass">
|
|
95
|
+
.additonalUsersAvatar:after
|
|
96
|
+
background-color: $blue-1
|
|
97
|
+
border-radius:50%
|
|
98
|
+
|
|
99
|
+
.additonalUsersAvatar
|
|
100
|
+
cursor: pointer
|
|
101
|
+
|
|
102
|
+
&.size-sm
|
|
103
|
+
font-size: $ba !important
|
|
104
|
+
|
|
105
|
+
&.size-md
|
|
106
|
+
font-size: $ms !important
|
|
107
|
+
|
|
108
|
+
&.size-lg
|
|
109
|
+
font-size: $md !important
|
|
110
|
+
|
|
111
|
+
&.size-xl
|
|
112
|
+
font-size: $lg !important
|
|
113
|
+
|
|
114
|
+
.avatarGroup
|
|
115
|
+
margin: -0.125rem
|
|
116
|
+
.avatarGroup:not(:nth-child(1)) .q-avatar__content
|
|
117
|
+
border: 1.5px solid $neutral-1
|
|
118
|
+
background : lightgray 0px -0.033px / 100% 150.273% no-repeat
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
color: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'primary',
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'md',
|
|
16
|
+
validator: (val) => ['xxs', 'xs', 'sm', 'md', 'lg'].includes(val),
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'basic',
|
|
21
|
+
validator: (val) => ['basic', 'indicator'].includes(val),
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const currentColor = computed(() => {
|
|
26
|
+
if (props.color === 'neutral') {
|
|
27
|
+
return 'neutral-6'
|
|
28
|
+
}
|
|
29
|
+
return props.color
|
|
30
|
+
})
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<q-badge
|
|
35
|
+
class="u-badge"
|
|
36
|
+
:class="[
|
|
37
|
+
type === 'basic' ? 'type-basic' : 'type-indicator justify-center',
|
|
38
|
+
`size-${size}`,
|
|
39
|
+
type === 'basic'
|
|
40
|
+
? size === 'md'
|
|
41
|
+
? `text-overline-xs`
|
|
42
|
+
: `text-overline-sm`
|
|
43
|
+
: '',
|
|
44
|
+
]"
|
|
45
|
+
:color="currentColor"
|
|
46
|
+
rounded
|
|
47
|
+
tabindex="0"
|
|
48
|
+
:aria-label="label"
|
|
49
|
+
>
|
|
50
|
+
<div v-if="type === 'basic'">
|
|
51
|
+
{{ label }}
|
|
52
|
+
</div>
|
|
53
|
+
<slot name="default" />
|
|
54
|
+
</q-badge>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style lang="sass">
|
|
58
|
+
.u-badge
|
|
59
|
+
min-height:0px
|
|
60
|
+
|
|
61
|
+
&.size-xxs
|
|
62
|
+
width: $xs
|
|
63
|
+
height: $xs
|
|
64
|
+
padding: 0px
|
|
65
|
+
|
|
66
|
+
&.size-xs
|
|
67
|
+
width: $sm
|
|
68
|
+
height: $sm
|
|
69
|
+
padding: 0px
|
|
70
|
+
|
|
71
|
+
&.size-sm
|
|
72
|
+
width: $ba
|
|
73
|
+
height: $ba
|
|
74
|
+
padding: 0px
|
|
75
|
+
|
|
76
|
+
&.size-md
|
|
77
|
+
letter-spacing: 0.24px
|
|
78
|
+
line-height: 1.013rem
|
|
79
|
+
|
|
80
|
+
&.size-lg
|
|
81
|
+
width: $md
|
|
82
|
+
height: $ms
|
|
83
|
+
justify-content: center
|
|
84
|
+
line-height: 0
|
|
85
|
+
|
|
86
|
+
&.type-basic
|
|
87
|
+
border: 1.5px solid $neutral-1
|
|
88
|
+
|
|
89
|
+
&.type-indicator
|
|
90
|
+
border: 1px solid $neutral-1
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import UBtnStd from 'src/components/core/UBtnStd.vue'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
type: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'info',
|
|
9
|
+
},
|
|
10
|
+
icon: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'fa-kit-duotone fa-circle-info',
|
|
13
|
+
},
|
|
14
|
+
message: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
show: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
primaryActionLabel: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'Action 1',
|
|
27
|
+
},
|
|
28
|
+
secondaryActionLabel: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'Action 2',
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits(['primaryAction', 'secondaryAction'])
|
|
35
|
+
|
|
36
|
+
const handlePrimaryActionClick = () => {
|
|
37
|
+
emit('primaryAction')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const handleSecondaryActionClick = () => {
|
|
41
|
+
emit('secondaryAction')
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<q-banner
|
|
47
|
+
v-if="show && message"
|
|
48
|
+
inline-actions
|
|
49
|
+
:class="`u-banner u-banner-${type}`"
|
|
50
|
+
tabindex="0"
|
|
51
|
+
>
|
|
52
|
+
<template v-slot:avatar>
|
|
53
|
+
<q-icon
|
|
54
|
+
aria-label="Banner Icon"
|
|
55
|
+
:class="icon"
|
|
56
|
+
size="1.5rem"
|
|
57
|
+
:color="type"
|
|
58
|
+
alt="Banner Info Icon"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
<span class="text-caption-lg">{{ message }}</span>
|
|
62
|
+
<template v-slot:action>
|
|
63
|
+
<u-btn-std
|
|
64
|
+
v-if="primaryActionLabel"
|
|
65
|
+
:flat="false"
|
|
66
|
+
:label="primaryActionLabel"
|
|
67
|
+
@onClick="handlePrimaryActionClick"
|
|
68
|
+
:color="type"
|
|
69
|
+
size="md"
|
|
70
|
+
/>
|
|
71
|
+
<u-btn-std
|
|
72
|
+
class="q-ml-sm"
|
|
73
|
+
:outline="true"
|
|
74
|
+
v-if="secondaryActionLabel"
|
|
75
|
+
:label="secondaryActionLabel"
|
|
76
|
+
@onClick="handleSecondaryActionClick"
|
|
77
|
+
:color="type"
|
|
78
|
+
size="md"
|
|
79
|
+
/>
|
|
80
|
+
</template>
|
|
81
|
+
</q-banner>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<style lang="sass">
|
|
85
|
+
.u-banner
|
|
86
|
+
min-width: 24.563rem
|
|
87
|
+
padding: $sm
|
|
88
|
+
.q-banner__avatar
|
|
89
|
+
align-self: center
|
|
90
|
+
|
|
91
|
+
.q-banner__content
|
|
92
|
+
padding-left: $xs !important
|
|
93
|
+
|
|
94
|
+
.u-banner-positive
|
|
95
|
+
background: $green-1 !important
|
|
96
|
+
color: $green-6 !important
|
|
97
|
+
|
|
98
|
+
.u-banner-info
|
|
99
|
+
background: $purple-1 !important
|
|
100
|
+
color: $info !important
|
|
101
|
+
|
|
102
|
+
.u-banner-warning
|
|
103
|
+
background: $orange-1 !important
|
|
104
|
+
color: $orange-7 !important
|
|
105
|
+
|
|
106
|
+
.u-banner-accent
|
|
107
|
+
background: $red-1 !important
|
|
108
|
+
color: $red-7 !important
|
|
109
|
+
|
|
110
|
+
.u-banner-primary
|
|
111
|
+
background: $blue-1 !important
|
|
112
|
+
color: $primary !important
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import UTooltip from './UTooltip.vue'
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
iconClass: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
default: 'fa-kit-duotone fa-circle-bolt',
|
|
9
|
+
},
|
|
10
|
+
ariaLabel: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'primary',
|
|
17
|
+
},
|
|
18
|
+
round: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'md',
|
|
25
|
+
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
26
|
+
},
|
|
27
|
+
tooltip: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '',
|
|
30
|
+
},
|
|
31
|
+
tooltipPosition: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'top',
|
|
34
|
+
},
|
|
35
|
+
anchor: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'center left',
|
|
38
|
+
},
|
|
39
|
+
self: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'center end',
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits(['onClick'])
|
|
46
|
+
|
|
47
|
+
const handleClick = () => {
|
|
48
|
+
return emit('onClick')
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const iconSize = computed(() => {
|
|
52
|
+
if (props.size === 'sm') {
|
|
53
|
+
return 'xs'
|
|
54
|
+
}
|
|
55
|
+
if (props.size === 'md') {
|
|
56
|
+
return 'sm'
|
|
57
|
+
}
|
|
58
|
+
if (props.size === 'lg') {
|
|
59
|
+
return 'md'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return props.size
|
|
63
|
+
})
|
|
64
|
+
const iconColor = computed(() => {
|
|
65
|
+
if (props.color === 'neutral') {
|
|
66
|
+
return 'neutral-9'
|
|
67
|
+
}
|
|
68
|
+
return props.color
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const btnClass = computed(() => {
|
|
72
|
+
if (props.color === 'neutral') {
|
|
73
|
+
return 'neutral-4'
|
|
74
|
+
}
|
|
75
|
+
return props.color
|
|
76
|
+
})
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<q-btn
|
|
81
|
+
@click="handleClick"
|
|
82
|
+
flat="flat"
|
|
83
|
+
:round="round"
|
|
84
|
+
:aria-label="ariaLabel"
|
|
85
|
+
class="u-btn-icon"
|
|
86
|
+
:class="`size-${size} ${btnClass}`"
|
|
87
|
+
>
|
|
88
|
+
<q-icon
|
|
89
|
+
:color="iconColor"
|
|
90
|
+
:aria-hidden="true"
|
|
91
|
+
:class="`${iconClass} size-${size}`"
|
|
92
|
+
:size="iconSize"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<UTooltip
|
|
96
|
+
v-if="tooltip"
|
|
97
|
+
:description="tooltip"
|
|
98
|
+
:anchor="anchor"
|
|
99
|
+
:self="self"
|
|
100
|
+
:offset="[4, 4]"
|
|
101
|
+
/>
|
|
102
|
+
</q-btn>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<style lang="sass">
|
|
106
|
+
.u-btn-icon
|
|
107
|
+
&.neutral-4
|
|
108
|
+
color: $neutral-4
|
|
109
|
+
|
|
110
|
+
&.transparent
|
|
111
|
+
color: $neutral-1
|
|
112
|
+
|
|
113
|
+
&.size-sm
|
|
114
|
+
height: $md
|
|
115
|
+
width: $md
|
|
116
|
+
|
|
117
|
+
&.size-md
|
|
118
|
+
height: $lg
|
|
119
|
+
width: $lg
|
|
120
|
+
|
|
121
|
+
&.size-lg
|
|
122
|
+
height: $xl
|
|
123
|
+
width: $xl
|
|
124
|
+
|
|
125
|
+
.q-icon
|
|
126
|
+
&.text-transparent
|
|
127
|
+
color: $neutral-1 !important
|
|
128
|
+
|
|
129
|
+
&.size-sm
|
|
130
|
+
height: $ba
|
|
131
|
+
width: $ba
|
|
132
|
+
|
|
133
|
+
&.size-md
|
|
134
|
+
height: $ms
|
|
135
|
+
width: $ms
|
|
136
|
+
|
|
137
|
+
&.size-lg
|
|
138
|
+
height: $md
|
|
139
|
+
width: $md
|
|
140
|
+
&.neutral-9
|
|
141
|
+
color: $neutral-9
|
|
142
|
+
|
|
143
|
+
.icon-tooltip
|
|
144
|
+
background: $dark
|
|
145
|
+
border-radius: $xxs
|
|
146
|
+
padding: $xs $sm
|
|
147
|
+
box-shadow: 0px 0px 4px 0px rgba(16, 17, 20, 0.08)
|
|
148
|
+
</style>
|