@usssa/component-library 1.0.0-alpha.1 → 1.0.0-alpha.10
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/README.md +15 -37
- package/package.json +3 -7
- 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/README.md
CHANGED
|
@@ -1,54 +1,32 @@
|
|
|
1
|
-
# Prerequesites
|
|
2
|
-
|
|
3
|
-
1. 'quasar' should be installed in the project using the library
|
|
4
|
-
|
|
5
|
-
2. Your package.json should include the pacakge in the dependencies like this:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
dependencies: {
|
|
9
|
-
@usssa-org/component-library: 'latest'
|
|
10
|
-
}
|
|
11
|
-
```
|
|
12
|
-
3. Your .npmrc file in the root of the project should look like this:
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
{
|
|
16
|
-
shamefully-hoist=true
|
|
17
|
-
strict-peer-dependencies=false
|
|
18
|
-
resolution-mode=highest
|
|
19
|
-
@usssa-org:registry = https://npm.pkg.github.com/
|
|
20
|
-
//npm.pkg.github.com/:_authToken=<YOUR_GITHUB_TOKEN>
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
## Install the dependencies
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
yarn
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Start the app in development mode (hot-code reloading, error reporting, etc.)
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
quasar dev
|
|
33
|
-
```
|
|
34
|
-
|
|
35
1
|
# Component Library
|
|
36
2
|
|
|
37
|
-
This library provides custom
|
|
3
|
+
This library provides custom UI components for USSSA applications.
|
|
38
4
|
|
|
39
|
-
|
|
5
|
+
## Installation
|
|
40
6
|
|
|
41
7
|
1. Install the packge using command 'yarn'
|
|
42
8
|
2. Go to specific page where you want to use a component from that library.
|
|
43
9
|
a. Import the library in your Quasar project: `import { UBtnStd } from 'component-library'`
|
|
44
10
|
b. Use the BtnStd component in your Nuxt app: `<UBtnStd label="Test" size="lg" />`
|
|
45
11
|
|
|
46
|
-
|
|
12
|
+
## Development
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Clone with appropriate credentials
|
|
16
|
+
git clone https://github.com/usssa-org/component-library
|
|
17
|
+
|
|
18
|
+
cd component-library
|
|
19
|
+
yarn install
|
|
20
|
+
yarn dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage in other local projects
|
|
47
24
|
|
|
48
25
|
1. Clone the component-library repo and install dependencies
|
|
49
26
|
2. In component-library directory run `yarn link`
|
|
50
27
|
3. In Nuxt or Quasar project directory run `yarn link @usssa/component-library`
|
|
51
28
|
|
|
52
29
|
When done:
|
|
30
|
+
|
|
53
31
|
1. In Nuxt or Quasar project directory run `yarn unlink @usssa/component-library`
|
|
54
32
|
2. In component-library directory run `yarn unlink`
|
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.10",
|
|
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": {
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
"build": "quasar build",
|
|
23
23
|
"start": "node --experimental-detect-module index.js"
|
|
24
24
|
},
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "git+https://github.com/usssa-org/component-library.git"
|
|
28
|
-
},
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"@quasar/extras": "^1.16.4",
|
|
31
27
|
"quasar": "^2.16.0",
|
|
@@ -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>
|