diff --git a/docs/content/docs/2.components/navigation-menu.md b/docs/content/docs/2.components/navigation-menu.md index 80b52bd9..2bbbd34d 100644 --- a/docs/content/docs/2.components/navigation-menu.md +++ b/docs/content/docs/2.components/navigation-menu.md @@ -79,6 +79,7 @@ Use the `items` prop as an array of objects with the following properties: - `label?: string`{lang="ts-type"} - `icon?: IconComponent`{lang="ts-type"} - `avatar?: AvatarProps`{lang="ts-type"} +- `color?: AvatarProps['color']`{lang="ts-type"} - `badge?: string | number | BadgeProps`{lang="ts-type"} - [`chip?: boolean | ChipProps`{lang="ts-type"}](#with-chip-in-items) - `hint?: string`{lang="ts-type"} diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index eb56304c..7a22e4a8 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -32,6 +32,10 @@ export interface NavigationMenuItem extends Omit { ...orientations.map((orientation: string) => [`with content orientation ${orientation}`, { props: { ...props, orientation } }]), [`with def`, { props: { ...props } }], ['with chip', { props: { items: [[{ label: 'Guide', icon: Cross30Icon, chip: true }, { label: 'Components', icon: SignIcon, chip: { color: 'air-primary' } }]] } }], + ['with item color', { props: { items: [[{ label: 'Engineer', avatar: { src: 'https://github.com/bitrix24.png' }, color: 'air-primary' as const }, { label: 'Designer', avatar: { src: 'https://github.com/bitrix24.png' }, color: 'air-primary-success' as const }]], orientation: 'vertical' as const } }], ['with trailingIcon', { props: { ...props, trailingIcon: SignIcon } }], ['with externalIcon', { props: { ...props, externalIcon: Cross30Icon } }], ['without externalIcon', { props: { ...props, externalIcon: false } }], diff --git a/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap b/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap index 201c9ec0..efbd2bcb 100644 --- a/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap +++ b/test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap @@ -621,6 +621,33 @@ exports[`NavigationMenu > renders with externalIcon correctly 1`] = ` " `; +exports[`NavigationMenu > renders with item color correctly 1`] = ` +"" +`; + exports[`NavigationMenu > renders with item slot correctly 1`] = ` "" `; +exports[`NavigationMenu > renders with item color correctly 1`] = ` +"" +`; + exports[`NavigationMenu > renders with item slot correctly 1`] = ` "