Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(local-nav): token updates #322

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"prepare": "npx husky install"
},
"dependencies": {
"@kyndryl-design-system/shidoka-icons": "^1.9.0",
"@kyndryl-design-system/shidoka-icons": "^2.0.0-next.1",
"@lit/context": "^1.1.0",
"deepmerge-ts": "^7.1.0",
"flatpickr": "^4.6.13",
Expand Down
49 changes: 7 additions & 42 deletions src/components/global/localNav/localNav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ nav {
padding: 4px 8px;
left: 0;
width: 100%;
background: var(--kd-color-background-ui-soft);
background: var(--kd-color-background-container-soft);
overflow: hidden;

@media (min-width: 42rem) {
Expand Down Expand Up @@ -61,7 +61,7 @@ nav {
visibility: hidden;

.nav--expanded + & {
background-color: var(--kd-color-light-opacity-50);
background-color: var(--kd-color-background-opacity-4);
visibility: visible;

&.pinned {
Expand Down Expand Up @@ -101,7 +101,7 @@ slot[name='search'] {
top: 100%;
left: 0;
width: 100%;
background: var(--kd-color-background-ui-soft);
background: var(--kd-color-background-container-soft);
padding-top: 4px;
transition: height 250ms ease-out, visibility 250ms ease-out;
height: 0;
Expand Down Expand Up @@ -137,7 +137,7 @@ slot[name='search'] {
outline: 2px solid transparent;
outline-offset: -2px;
font: inherit;
color: var(--kd-color-text-secondary);
color: var(--kd-color-text-level-secondary);
padding: 8px 12px;
cursor: pointer;
display: flex;
Expand All @@ -147,7 +147,7 @@ slot[name='search'] {
height: 48px;

&:focus {
outline-color: var(--kd-color-border-focus);
outline-color: var(--kd-color-border-variants-focus);
}

// kd-icon {
Expand All @@ -166,49 +166,14 @@ slot[name='search'] {

.toggle-container {
display: none;
padding-top: 4px;
border-top: 1px solid var(--kd-color-border-light);
padding: 8px 4px 4px;
border-top: 1px solid var(--kd-color-border-variants-light);

@media (min-width: 42rem) {
display: flex;
}
}

.nav-toggle {
display: flex;
justify-content: center;
align-items: center;
width: 40px;
height: 40px;
border-radius: 4px;
border: none;
cursor: pointer;
background: none;
color: var(--kd-color-text-link);
outline: 2px solid transparent;
outline-offset: -2px;
transition: background-color 150ms ease-out, color 150ms ease-out,
outline-color 150ms ease-out;

.pin-icon {
display: block;
}

&:hover {
background-color: var(--kd-color-background-primary);
color: var(--kd-color-text-inversed);
}

&:focus {
outline-color: var(--kd-color-border-focus);
}

&:active {
background-color: var(--kd-color-background-primary-pressed);
color: var(--kd-color-text-inversed);
}
}

.pin-icon {
transition: transform 150ms ease-out;

Expand Down
21 changes: 10 additions & 11 deletions src/components/global/localNav/localNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import {
} from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { deepmerge } from 'deepmerge-ts';
import '@kyndryl-design-system/shidoka-foundation/components/button';
import LocalNavScss from './localNav.scss';

import arrowIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/16/chevron-down.svg';
import pinIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/pin.svg';
import pinIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/side-drawer-out.svg';

const _defaultTextStrings = {
pin: 'Pin',
Expand Down Expand Up @@ -118,18 +119,16 @@ export class LocalNav extends LitElement {
</div>

<div class="toggle-container">
<button
class="nav-toggle"
@click=${(e: Event) => this._handleNavToggle(e)}
title="${this.pinned
<kd-button
kind="tertiary"
size="small"
description=${this.pinned
? this._textStrings.unpin
: this._textStrings.pin}"
aria-label="${this.pinned
? this._textStrings.unpin
: this._textStrings.pin}"
: this._textStrings.pin}
@on-click=${(e: Event) => this._handleNavToggle(e)}
>
<span class="pin-icon">${unsafeSVG(pinIcon)}</span>
</button>
<span class="pin-icon" slot="icon"> ${unsafeSVG(pinIcon)} </span>
</kd-button>
</div>
</nav>

Expand Down
4 changes: 2 additions & 2 deletions src/components/global/localNav/localNavDivider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

.divider {
display: none;
border-bottom: 1px solid var(--kd-color-border-light);
border-bottom: 1px solid var(--kd-color-border-variants-light);
margin: 4px 0;

&.nav-expanded {
Expand All @@ -17,7 +17,7 @@

.heading {
@include typography.type-ui-03;
color: var(--kd-color-text-tertiary-bold);
color: var(--kd-color-text-level-tertiary-bold);
font-weight: 500;
text-transform: uppercase;
margin: 8px;
Expand Down
55 changes: 26 additions & 29 deletions src/components/global/localNav/localNavLink.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,42 @@ a {
text-decoration: none;
outline: 2px solid transparent;
outline-offset: -2px;
color: var(--kd-color-text-secondary);
color: var(--kd-color-text-level-primary);
transition: background-color 150ms ease-out, color 150ms ease-out,
outline-color 150ms ease-out;

.icon.slotted {
width: 24px;
height: 24px;
flex-shrink: 0;
::slotted(*) {
display: flex;
align-items: center;
justify-content: center;

@media (min-width: 42rem) {
width: 32px;
}
flex-shrink: 0;
width: 24px;
height: 24px;
}

.link-active & {
color: var(--kd-color-text-tertiary);
color: var(--kd-color-text-link-level-hover);
font-weight: 500;
}

.link-expanded & {
color: var(--kd-color-text-tertiary);
background: var(--kd-color-background-button-primary-state-hover);
color: var(--kd-color-text-button-dark-primary);
font-weight: 500;
}

&:hover {
background: var(--kd-color-background-primary-hover);
color: var(--kd-color-text-inversed);
background: var(--kd-color-background-button-primary-state-hover);
color: var(--kd-color-text-button-dark-primary);
}

&:focus {
outline-color: var(--kd-color-border-tertiary-bold);
outline-color: var(--kd-color-border-ui-pressed);
}

&:active {
background-color: var(--kd-color-background-primary-pressed);
color: var(--kd-color-text-inversed);
background-color: var(--kd-color-background-button-primary-state-pressed);
color: var(--kd-color-text-button-dark-primary);
}

.link-disabled &,
Expand Down Expand Up @@ -143,7 +140,7 @@ a {
bottom: 19px;
left: 20px;
width: 1px;
background: var(--kd-color-border-light);
background: var(--kd-color-border-variants-light);
}
}

Expand All @@ -158,7 +155,7 @@ a {
left: -7px;
width: 10px;
height: 1px;
background: var(--kd-color-border-light);
background: var(--kd-color-border-variants-light);
z-index: -1;
}

Expand All @@ -171,7 +168,7 @@ a {
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--kd-color-border-light);
background: var(--kd-color-border-variants-light);
z-index: -1;
}
}
Expand All @@ -193,24 +190,24 @@ a {
outline-color 150ms ease-out;
outline: 2px solid transparent;
outline-offset: -2px;
color: var(--kd-color-text-secondary);
color: var(--kd-color-text-level-primary);

span {
svg {
margin-right: 16px;
}

&:hover {
background: var(--kd-color-background-primary);
color: var(--kd-color-text-inversed);
background: var(--kd-color-background-button-primary-state-hover);
color: var(--kd-color-text-button-dark-primary);
}

&:active {
background: var(--kd-color-background-primary-pressed);
color: var(--kd-color-text-inversed);
background-color: var(--kd-color-background-button-primary-state-pressed);
color: var(--kd-color-text-button-dark-primary);
}

&:focus {
outline-color: var(--kd-color-border-focus);
outline-color: var(--kd-color-border-ui-pressed);
}

@media (min-width: 42rem) {
Expand All @@ -221,10 +218,10 @@ a {
.category {
@include typography.type-ui-03;
font-weight: 500;
color: var(--kd-color-text-tertiary-bold);
color: var(--kd-color-text-level-tertiary-bold);
text-transform: uppercase;
padding: 8px;
border-bottom: 1px solid var(--kd-color-border-light);
border-bottom: 1px solid var(--kd-color-border-variants-light);

@media (min-width: 42rem) {
display: none;
Expand Down Expand Up @@ -263,7 +260,7 @@ a {
height: 24px;
}

span {
svg {
display: block;
}
}
19 changes: 4 additions & 15 deletions src/components/global/localNav/localNavLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,12 @@ export class LocalNavLink extends LitElement {
return html`
<div class=${classMap(classes)}>
<a href=${this.href} @click=${(e: Event) => this.handleClick(e)}>
<span class="icon ${this._icon.length ? 'slotted' : ''}">
<slot name="icon"></slot>
</span>

<span class="text">
<slot @slotchange=${this._handleTextSlotChange}></slot>
</span>

${this._navLinks.length
? html`
<span class="expand-icon">
<span
>${this.expanded
? unsafeSVG(subtractIcon)
: unsafeSVG(addIcon)}</span
>
${this.expanded
? unsafeSVG(subtractIcon)
: unsafeSVG(addIcon)}
</span>
`
: null}
Expand All @@ -136,8 +126,7 @@ export class LocalNavLink extends LitElement {
${this._navLinks.length
? html`
<button class="go-back" @click=${() => this._handleBack()}>
<span>${unsafeSVG(backIcon)}</span>
${this.backText}
${unsafeSVG(backIcon)} ${this.backText}
</button>
`
: null}
Expand Down
2 changes: 1 addition & 1 deletion src/components/reusable/pagetitle/pageTitle.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';
import { html } from 'lit';
import './index';
import cloudDownloadIcon from '@kyndryl-design-system/shidoka-icons/svg/duotone/cloud-download.svg';
import cloudDownloadIcon from '@kyndryl-design-system/shidoka-icons/svg/duotone/48/cloud-download.svg';

export default {
title: 'Components/PageTitle',
Expand Down
Loading