Skip to content

Commit

Permalink
fix(telekom-header): allow link for logo (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arturo Castillo Delgado authored May 3, 2023
1 parent 9d7f5b3 commit 5dd544a
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class LogoSvg {
@Prop() color?: string = 'magenta';
@Prop() innerRole?: 'link' | 'img' = 'img';
@Prop() focusable: boolean = true;
/** (optional) When using the icon standalone, make it meaningful for accessibility */
/** @deprecated (optional) When using the icon standalone, make it meaningful for accessibility */
@Prop() accessibilityTitle?: string;
/** (optional) When using the icon standalone, make it meaningful for accessibility */
@Prop() logoTitle?: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/telekom/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export class Logo {
@Prop() logoTitle?: string = 'Telekom Logo';
/** (optional) Hide all logo related titles */
@Prop() logoHideTitle?: boolean;
/** FIXME is this actually working? probably not because of shadow DOM? */
@Prop() logoAriaDescribedBy?: string;
/** FIXME this is also probably not working properly, see below (it needs a string value) */
@Prop() logoAriaHidden?: boolean = false;

componentDidRender() {
Expand Down
18 changes: 9 additions & 9 deletions packages/components/src/components/telekom/logo/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

## Properties

| Property | Attribute | Description | Type | Default |
| -------------------- | --------------------- | ------------------------------------------------------------------------------- | ----------------- | ----------- |
| `accessibilityTitle` | `accessibility-title` | (optional) When using the icon standalone, make it meaningful for accessibility | `string` | `undefined` |
| `color` | `color` | (optional) Sets the icon color via the `fill` attribute | `string` | `'magenta'` |
| `focusable` | `focusable` | | `boolean` | `true` |
| `innerRole` | `inner-role` | | `"img" \| "link"` | `'img'` |
| `language` | `language` | (optional) The languages for the Text behind the Logo | `string` | `'en'` |
| `logoHideTitle` | `logo-hide-title` | (optional) Hide all logo related titles | `boolean` | `undefined` |
| `logoTitle` | `logo-title` | (optional) When using the icon standalone, make it meaningful for accessibility | `string` | `undefined` |
| Property | Attribute | Description | Type | Default |
| -------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ----------- |
| `accessibilityTitle` | `accessibility-title` | <span style="color:red">**[DEPRECATED]**</span> (optional) When using the icon standalone, make it meaningful for accessibility<br/><br/> | `string` | `undefined` |
| `color` | `color` | (optional) Sets the icon color via the `fill` attribute | `string` | `'magenta'` |
| `focusable` | `focusable` | | `boolean` | `true` |
| `innerRole` | `inner-role` | | `"img" \| "link"` | `'img'` |
| `language` | `language` | (optional) The languages for the Text behind the Logo | `string` | `'en'` |
| `logoHideTitle` | `logo-hide-title` | (optional) Hide all logo related titles | `boolean` | `undefined` |
| `logoTitle` | `logo-title` | (optional) When using the icon standalone, make it meaningful for accessibility | `string` | `undefined` |


## Shadow Parts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

## Shadow Parts

| Part | Description |
| --------------------- | ----------- |
| `"heading"` | |
| `"heading-button"` | |
| `"heading-container"` | |
| Part | Description |
| ----------------------- | ----------- |
| `"heading"` | |
| `"heading-button"` | |
| `"heading-container"` | |
| `"heading-with-button"` | |


## Dependencies
Expand Down
23 changes: 13 additions & 10 deletions packages/components/src/components/telekom/telekom-header/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@

## Properties

| Property | Attribute | Description | Type | Default |
| -------------------------- | ------------------------------ | ----------- | -------- | ---------------------------- |
| `appName` | `app-name` | | `string` | `undefined` |
| `appNameClick` | `app-name-click` | | `any` | `undefined` |
| `appNameLink` | `app-name-link` | | `string` | `undefined` |
| `langSwitcherAriaLabel` | `lang-switcher-aria-label` | | `string` | `'Language switcher'` |
| `mainNavAriaLabel` | `main-nav-aria-label` | | `string` | `'Main navigation'` |
| `metaNavAriaLabel` | `meta-nav-aria-label` | | `string` | `'Meta navigation'` |
| `metaNavExternalAriaLabel` | `meta-nav-external-aria-label` | | `string` | `'External meta navigation'` |
| `type` | `type` | | `string` | `'default'` |
| Property | Attribute | Description | Type | Default |
| -------------------------- | ------------------------------ | ----------- | --------- | ---------------------------- |
| `appName` | `app-name` | | `string` | `undefined` |
| `appNameClick` | `app-name-click` | | `any` | `undefined` |
| `appNameLink` | `app-name-link` | | `string` | `undefined` |
| `langSwitcherAriaLabel` | `lang-switcher-aria-label` | | `string` | `'Language switcher'` |
| `logoHideTitle` | `logo-hide-title` | | `boolean` | `undefined` |
| `logoHref` | `logo-href` | | `string` | `undefined` |
| `logoTitle` | `logo-title` | | `string` | `undefined` |
| `mainNavAriaLabel` | `main-nav-aria-label` | | `string` | `'Main navigation'` |
| `metaNavAriaLabel` | `meta-nav-aria-label` | | `string` | `'Meta navigation'` |
| `metaNavExternalAriaLabel` | `meta-nav-external-aria-label` | | `string` | `'External meta navigation'` |
| `type` | `type` | | `string` | `'default'` |


## Shadow Parts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export class TelekomHeader {
@Prop({ reflect: true }) appName?: string;
@Prop() appNameLink?: string;
@Prop() appNameClick?: any;
@Prop() logoHref?: string;
@Prop() logoTitle?: string;
@Prop() logoHideTitle?: boolean;
@Prop() type: string = 'default';
@Prop() metaNavAriaLabel?: string = 'Meta navigation';
@Prop() metaNavExternalAriaLabel?: string = 'External meta navigation';
Expand Down Expand Up @@ -65,7 +68,13 @@ export class TelekomHeader {
<div part="fixed-wrapper">
<div part="container">
<slot name="logo">
<scale-logo part="app-logo" variant="white"></scale-logo>
<scale-logo
part="app-logo"
variant="white"
href={this.logoHref}
logoTitle={this.logoTitle}
logoHideTitle={this.logoHideTitle}
></scale-logo>
</slot>

<div part="body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@

## Properties

| Property | Attribute | Description | Type | Default |
| -------------- | ---------------- | ----------- | --------- | ----------- |
| `active` | `active` | | `boolean` | `false` |
| `navItemTitle` | `nav-item-title` | | `string` | `undefined` |
| `role` | `role` | | `string` | `'none'` |
| `variant` | `variant` | | `string` | `undefined` |
| Property | Attribute | Description | Type | Default |
| --------- | --------- | ----------- | --------- | ----------- |
| `active` | `active` | | `boolean` | `false` |
| `role` | `role` | | `string` | `'none'` |
| `variant` | `variant` | | `string` | `undefined` |


## Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const Template = (args, { argTypes }) => ({
props: {
...TelekomHeaderTemplate.props,
storyName: String,
// TODO remove these from here since they're included already in TelekomHeaderTemplate
mainNavAriaLabel: 'Main Navigation',
metaNavAriaLabel: 'Meta Navigation',
metaNavExternalAriaLabel: 'External Meta Navigation',
Expand All @@ -65,10 +66,13 @@ export const Template = (args, { argTypes }) => ({
:story-name="storyName"
:app-name="appName"
:app-name-link="appNameLink"
:logo-href="logoHref"
:logo-title="logoTitle"
:logo-hide-title="logoHideTitle"
:meta-nav-aria-label="metaNavAriaLabel"
:meta-nav-external-aria-label="metaNavExternalAriaLabel"
:lang-switcher-aria-label="langSwitcherAriaLabel"
:main-nav-aria-label="mainNavAriaLabel"
:main-nav-aria-label="mainNavAriaLabel"
/>
`,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
:app-name="appName"
:app-name-link="appNameLink"
:app-name-click="appNameClick"
:logo-ref="logoHref"
:logo-title="logoTitle"
:logo-hide-title="logoHideTitle"
:meta-nav-aria-label="metaNavAriaLabel"
:meta-nav-external-aria-label="metaNavExternalAriaLabel"
:lang-switcher-aria-label="langSwitcherAriaLabel"
Expand All @@ -23,6 +26,9 @@ export default {
appName: String,
appNameLink: String,
appNameClick: Function,
logoHref: String,
logoTitle: String,
logoHideTitle: String,
metaNavAriaLabel: String,
metaNavExternalAriaLabel: String,
langSwitcherAriaLabel: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<template>
<div class="wrapper">
<scale-telekom-app-shell>
<component slot="header" :is="storyName" :app-name="appName" :app-name-link="appNameLink"></component>
<component
slot="header"
:is="storyName"
:app-name="appName"
:app-name-link="appNameLink"
:logo-href="logoHref"
:logo-title="logoTitle"
:logo-hide-title="logoHideTitle"
></component>
<!-- content goes here -->
</scale-telekom-app-shell>
</div>
Expand All @@ -26,6 +34,9 @@ export default {
appName: String,
appNameLink: String,
appNameClick: Function,
logoHref: String,
logoTitle: String,
logoHideTitle: String,
storyName: String,
},
};
Expand Down

0 comments on commit 5dd544a

Please sign in to comment.