Skip to content

Commit

Permalink
feat(@dpc-sdp/ripple-ui-core): add default primary logo inline
Browse files Browse the repository at this point in the history
  • Loading branch information
David Featherston committed Aug 15, 2023
1 parent 3a58251 commit 7def1aa
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/nuxt-ripple/components/TideBaseLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<slot name="primaryNav">
<RplPrimaryNav
:primaryLogo="{
src: '/img/primary-nav-logo-primary.svg',
printSrc: '/img/primary-nav-logo-primary-print.svg',
altText: 'Victoria government logo',
href: '/'
Expand Down
3 changes: 3 additions & 0 deletions packages/ripple-ui-core/src/assets/logos/logo-vic-gov.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,48 @@ export const CustomLoginButtonTemplate = (args) => ({

<ArgsTable of={RplPrimaryNav} />

## Default

This uses the default primary SVG logo inline.

<Canvas>
<Story
name='Default'
play={a11yStoryCheck}
parameters={{
layout: 'fullscreen'
}}
args={{
primaryLogo: {
href: '#',
altText: 'Primary logo alt text'
}
}}
>
{SingleTemplate.bind()}
</Story>
</Canvas>

## With primary logo

This example uses a supplied primary logo.

<Canvas>
<Story
name='With primary logo'
play={a11yStoryCheck}
parameters={{
layout: 'fullscreen'
}}
>
{SingleTemplate.bind()}
</Story>
</Canvas>

## With secondary logo

This example uses a supplied secondary logo.

<Canvas>
<Story
name='With secondary logo'
Expand All @@ -99,6 +129,10 @@ export const CustomLoginButtonTemplate = (args) => ({
</Story>
</Canvas>

## Default / With secondary logo

This example shows the userAction slot in use.

<Canvas>
<Story
name='With custom user action'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
display: block;
width: 106px;
height: 16px;
fill: var(--rpl-clr-primary-logo, var(--rpl-clr-type-primary-contrast));

@media print {
width: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
useRippleEvent,
rplEventPayload
} from '../../../../composables/useRippleEvent'
import VicGovLogo from './../../../../assets/logos/logo-vic-gov.svg?component'
interface Props {
primaryLogo: IRplPrimaryNavLogo
Expand Down Expand Up @@ -77,7 +78,13 @@ const handleToggleItem = (level: number, item) => {
class="rpl-primary-nav__primary-logo-link rpl-u-focusable-outline rpl-u-focusable-outline--no-border"
:url="primaryLogo.href"
>
<VicGovLogo
v-if="!primaryLogo?.src"
:aria-label="primaryLogo.altText"
class="rpl-primary-nav__primary-logo-image rpl-u-screen-only"
/>
<img
v-else
class="rpl-primary-nav__primary-logo-image rpl-u-screen-only"
:src="primaryLogo.src"
:alt="primaryLogo.altText"
Expand Down

0 comments on commit 7def1aa

Please sign in to comment.