mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-31 12:17:54 +01:00
fix(Avatar): remove gradient support
This commit is contained in:
@@ -32,7 +32,6 @@
|
|||||||
"@unocss/nuxt": "^0.22.6",
|
"@unocss/nuxt": "^0.22.6",
|
||||||
"@vueuse/core": "^7.5.5",
|
"@vueuse/core": "^7.5.5",
|
||||||
"defu": "^5.0.1",
|
"defu": "^5.0.1",
|
||||||
"gradient-avatar": "^1.0.2",
|
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"nanoid": "^3.2.0",
|
"nanoid": "^3.2.0",
|
||||||
"pathe": "^0.2.0"
|
"pathe": "^0.2.0"
|
||||||
|
|||||||
@@ -222,11 +222,5 @@ export default defineNuxtModule<ModuleOptions>({
|
|||||||
|
|
||||||
// Add CSS
|
// Add CSS
|
||||||
nuxt.options.css.push(resolve(runtimeDir, 'css', 'forms.css'))
|
nuxt.options.css.push(resolve(runtimeDir, 'css', 'forms.css'))
|
||||||
|
|
||||||
nuxt.options.vite = {
|
|
||||||
optimizeDeps: {
|
|
||||||
exclude: ['gradient-avatar']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<span class="relative inline-flex items-center justify-center" :class="avatarClass" @click="goto">
|
<span class="relative inline-flex items-center justify-center" :class="avatarClass" @click="goto">
|
||||||
<img v-if="url" :src="url" :alt="alt" :class="[sizeClass, roundedClass]">
|
<img v-if="url" :src="url" :alt="alt" :class="[sizeClass, roundedClass]">
|
||||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
||||||
<span v-else-if="gradientPlaceholder" class="w-full h-full overflow-hidden" :class="roundedClass" v-html="gradientPlaceholder" />
|
|
||||||
<span
|
<span
|
||||||
v-else-if="placeholder"
|
v-else-if="placeholder"
|
||||||
class="font-medium leading-none u-text-gray-900 uppercase"
|
class="font-medium leading-none u-text-gray-900 uppercase"
|
||||||
@@ -31,8 +29,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import avatar from 'gradient-avatar'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
src: {
|
src: {
|
||||||
@@ -62,10 +58,6 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
gradient: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
status: {
|
status: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
@@ -88,13 +80,6 @@ export default {
|
|||||||
|
|
||||||
return this.alt.split(' ').map(word => word.charAt(0)).join('')
|
return this.alt.split(' ').map(word => word.charAt(0)).join('')
|
||||||
},
|
},
|
||||||
gradientPlaceholder () {
|
|
||||||
if (!this.gradient) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return avatar(this.alt || new Date().toString())
|
|
||||||
},
|
|
||||||
sizeClass () {
|
sizeClass () {
|
||||||
return ({
|
return ({
|
||||||
xxxs: 'h-4 w-4 text-xs',
|
xxxs: 'h-4 w-4 text-xs',
|
||||||
|
|||||||
24
yarn.lock
24
yarn.lock
@@ -3773,15 +3773,6 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4,
|
|||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
|
||||||
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
|
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
|
||||||
|
|
||||||
gradient-avatar@^1.0.2:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/gradient-avatar/-/gradient-avatar-1.0.2.tgz#42bb408e402b1f21aafba3878858721055515224"
|
|
||||||
integrity sha512-Od9KI2YImV60wnsvU/u6GEyBm2fiHUUHgiLySE243GYl/T/tiJMJ5QYey8o7tepugmlnUGQRaCItHv19UnUjUg==
|
|
||||||
dependencies:
|
|
||||||
hsl-rgb "^1.0.0"
|
|
||||||
hsl-triad "^1.0.0"
|
|
||||||
string-hash "^1.1.3"
|
|
||||||
|
|
||||||
gzip-size@^6.0.0:
|
gzip-size@^6.0.0:
|
||||||
version "6.0.0"
|
version "6.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462"
|
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462"
|
||||||
@@ -3904,16 +3895,6 @@ hosted-git-info@^4.0.0, hosted-git-info@^4.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
lru-cache "^6.0.0"
|
lru-cache "^6.0.0"
|
||||||
|
|
||||||
hsl-rgb@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/hsl-rgb/-/hsl-rgb-1.0.0.tgz#05ca49f6d960c9d8e237f27d7bdf284b656de5ab"
|
|
||||||
integrity sha512-cNq+7sfwzSDoiG/jiu8wZpOmjScUZrMKiI33tH3aQ1MZsXWQd0yJjMpPwu2OZFYa4D/bOT1aCbB5gS1kOqFx1A==
|
|
||||||
|
|
||||||
hsl-triad@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/hsl-triad/-/hsl-triad-1.0.0.tgz#0d27f397f75e8beb6cf9c361970ffbe104652220"
|
|
||||||
integrity sha512-PKnjrMugS6sHC5dVh4VQZYOHEKG2QILjVwbpEtNjEV19RyswuIxrIiGhumVJjya/FjK/p9gX6+zRMXFGTvaQAA==
|
|
||||||
|
|
||||||
html-entities@^2.1.0:
|
html-entities@^2.1.0:
|
||||||
version "2.3.2"
|
version "2.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.2.tgz#760b404685cb1d794e4f4b744332e3b00dcfe488"
|
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.2.tgz#760b404685cb1d794e4f4b744332e3b00dcfe488"
|
||||||
@@ -6374,11 +6355,6 @@ std-env@^3.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.0.1.tgz#bc4cbc0e438610197e34c2d79c3df30b491f5182"
|
resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.0.1.tgz#bc4cbc0e438610197e34c2d79c3df30b491f5182"
|
||||||
integrity sha512-mC1Ps9l77/97qeOZc+HrOL7TIaOboHqMZ24dGVQrlxFcpPpfCHpH+qfUT7Dz+6mlG8+JPA1KfBQo19iC/+Ngcw==
|
integrity sha512-mC1Ps9l77/97qeOZc+HrOL7TIaOboHqMZ24dGVQrlxFcpPpfCHpH+qfUT7Dz+6mlG8+JPA1KfBQo19iC/+Ngcw==
|
||||||
|
|
||||||
string-hash@^1.1.3:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
|
|
||||||
integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=
|
|
||||||
|
|
||||||
string-width@^1.0.1:
|
string-width@^1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||||
|
|||||||
Reference in New Issue
Block a user