Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 24, 2024. It is now read-only.

Commit 8f96876

Browse files
Merge pull request #155 from selemondev/fix/avatarGroup
fix(app): avatarGroup theme
2 parents 8862e44 + 97d9e3c commit 8f96876

File tree

4 files changed

+10
-76
lines changed

4 files changed

+10
-76
lines changed

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,13 @@ const toast = useToast()
396396
</script>
397397
398398
<template>
399-
<UButton label="Show toast" @click="toast.add({
400-
title: 'Update downloaded.',
401-
description: 'It will be installed on restart. Restart now?',
402-
icon: 'octicon:desktop-download-24',
403-
})" />
399+
<UButton
400+
label="Show toast" @click="toast.add({
401+
title: 'Update downloaded.',
402+
description: 'It will be installed on restart. Restart now?',
403+
icon: 'octicon:desktop-download-24',
404+
})"
405+
/>
404406
</template>
405407
```
406408

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
"pnpm lint:fix"
4444
]
4545
}
46-
}
46+
}

‎packages/nuxt-ui-vue/src/components/elements/Avatar/UAvatarGroup.vue‎

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,3 @@
1-
<!-- <script lang="ts">
2-
import { cloneVNode, computed, defineComponent, h } from 'vue'
3-
import type { PropType, VNode } from 'vue'
4-
import classNames from 'classnames'
5-
import nuxtLabsTheme from '../../../theme/nuxtLabsTheme'
6-
import { getSlotsFromChildren } from './Types'
7-
import UAvatar from './UAvatar.vue'
8-
import { getVariantPropsWithClassesList } from '@/utils/getVariantProps'
9-
import type { UAvatarGroup } from '@/Types/componentsTypes/components'
10-
import { Components } from '@/Types/enums/Components'
11-
12-
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'
13-
14-
export default defineComponent({
15-
name: Components.UAvatarGroup,
16-
17-
props: {
18-
...getVariantPropsWithClassesList<UAvatarGroup>(),
19-
size: {
20-
type: String as PropType<AvatarSize>,
21-
default: 'md',
22-
},
23-
max: {
24-
type: Number,
25-
default: null,
26-
},
27-
},
28-
setup(props, { slots }) {
29-
const children = computed(() => getSlotsFromChildren(slots))
30-
31-
// if max is passed as a string, we go ahead and convert it into an integer
32-
33-
const max = computed(() => typeof props.max === 'string' ? Number.parseInt(props.max) : props.max)
34-
35-
const clones = computed(() => children.value.map((node: VNode<unknown, unknown, { [key: string]: any }>, index: number) => {
36-
const vProps: Record<string, string> = {}
37-
38-
if (!props.max || (max.value && index < max.value)) {
39-
if (props.size)
40-
vProps.size = props.size
41-
42-
vProps.class = node.props?.class || ''
43-
vProps.class += `${classNames(
44-
nuxtLabsTheme.UAvatarGroup.base.avatarGroupMargin,
45-
)}`
46-
47-
return cloneVNode(node, vProps)
48-
}
49-
50-
if (max.value !== undefined && index === max.value) {
51-
return h(UAvatar, {
52-
size: props.size,
53-
text: `${children.value.length - max.value}`,
54-
name: `${children.value.length - max.value}`,
55-
alt: `${children.value.length - max.value}`,
56-
})
57-
}
58-
59-
return null
60-
}).filter(Boolean).reverse())
61-
62-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
63-
// @ts-expect-error
64-
return () => h('div', { class: nuxtLabsTheme.UAvatarGroup.base.root }, clones.value)
65-
},
66-
})
67-
</script> -->
68-
691
<script lang="ts">
702
import { cloneVNode, computed, defineComponent, h } from 'vue'
713
import type { PropType, VNode } from 'vue'

‎packages/nuxt-ui-vue/src/theme/nuxtLabsTheme.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ export default {
125125
UAvatarGroup: {
126126
base: {
127127
root: 'flex flex-row-reverse justify-end',
128-
avatarGroupMargin: '-mx-2.5',
128+
avatarGroupMargin: '-mx-2',
129129
},
130130

131131
variants: {
132132
root: 'flex flex-row-reverse justify-end',
133-
avatarGroupMargin: '-mx-2.5',
133+
avatarGroupMargin: '-mx-2',
134134
},
135135
},
136136

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /