-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: upgrade to Preact v10 * refactor: break apart Nav into smaller more maintainable pieces; significantly reduce UI logic required under the hood * refactor: minor tweaks to Pattern State UI * fix: fix the drag offset of the drawer resizer * chore: update yarn.lock * refactor: rename root Nav component files * #1102 After merge fixes * fix: yarn lock after merge * fix: review findings in css and js * fix: remove unused code and reimplement utility func Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com> Co-authored-by: Josef Bredreck <slime.games@outlook.de> Co-authored-by: Josef Bredreck <13408112+JosefBredereck@users.noreply.github.com>
- Loading branch information
1 parent
31891cb
commit f95f4f9
Showing
31 changed files
with
3,503 additions
and
3,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/uikit-workshop/src/scripts/components/pl-nav/index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/*------------------------------------*\ | ||
#NAVIGATION | ||
\*------------------------------------*/ | ||
|
||
@import './nav.scss'; | ||
@import './nav-link.scss'; | ||
@import './nav-list.scss'; | ||
@import './nav-dropdown.scss'; | ||
@import './nav-accordion.scss'; |
27 changes: 27 additions & 0 deletions
27
packages/uikit-workshop/src/scripts/components/pl-nav/nav-accordion.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@import '../../../sass/scss/core.scss'; | ||
|
||
.pl-c-nav__accordion { | ||
background-color: inherit; // allows the nav's children inherit from the parent header | ||
@include listReset(); | ||
@include accordionPanel(); | ||
display: flex; | ||
flex-flow: row wrap; | ||
opacity: 0; | ||
visibility: hidden; | ||
} | ||
|
||
.is-open ~ .pl-c-nav__accordion { | ||
visibility: visible; | ||
max-height: none; | ||
transform: translateY(0); | ||
opacity: 1; | ||
|
||
.pl-c-body--theme-horizontal & { | ||
overflow: auto; | ||
} | ||
|
||
@media all and (min-width: $pl-bp-med) { | ||
height: auto; | ||
max-height: calc(100vh - #{$offset-top} - 2rem); /* 1 */ | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
packages/uikit-workshop/src/scripts/components/pl-nav/nav-dropdown.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@import '../../../sass/scss/core.scss'; | ||
|
||
/** | ||
* Nav Dropdown | ||
* 1) On larger screens, display as dropdowns that | ||
* hangs over the header | ||
*/ | ||
.pl-c-nav__dropdown { | ||
@media all and (min-width: $pl-bp-med) { | ||
position: absolute; | ||
top: 100%; /* 1 */ | ||
left: 0; | ||
min-width: 14rem; | ||
border-radius: $pl-border-radius-med; | ||
border-style: solid; | ||
border-width: 1px; | ||
box-shadow: 0 2px 5px rgba($pl-color-black, 0.1); | ||
transition: all 0.2s ease; | ||
transform: translateY(-12px); | ||
z-index: 1; | ||
transition: all $pl-animate-quick ease-out; | ||
|
||
.pl-c-body--theme-sidebar & { | ||
position: relative; | ||
} | ||
} | ||
|
||
.pl-c-body--theme-light & { | ||
border-color: rgba($pl-color-black, 0.2); | ||
} | ||
|
||
.pl-c-body--theme-dark & { | ||
border-color: rgba($pl-color-white, 0.2); | ||
} | ||
|
||
.pl-c-body--theme-sidebar & { | ||
border-width: 0; | ||
transform: none; | ||
box-shadow: none; | ||
border-radius: 0; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
packages/uikit-workshop/src/scripts/components/pl-nav/nav-link.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// this line is required for rendering even if it is note used in the code | ||
import { h, Fragment } from 'preact'; | ||
const classNames = require('classnames'); | ||
|
||
export const NavLink = (props) => { | ||
const classes = classNames('pl-c-nav__link', { | ||
[`pl-c-nav__link--level-${props.level}`]: props.level !== undefined, | ||
'pl-c-nav__link--icon-only': props.iconOnly, | ||
'pl-c-nav__link--title': props.isTitle, | ||
}); | ||
|
||
const Tag = props.href ? 'a' : 'button'; | ||
|
||
return ( | ||
<Tag className={`${classes}`} role="tab" {...props}> | ||
{props.iconPos === 'before' && props.iconName && ( | ||
<span | ||
class="pl-c-nav__link-icon" | ||
dangerouslySetInnerHTML={{ | ||
__html: `<pl-icon name="${props.iconName}"></pl-icon>`, | ||
}} | ||
/> | ||
)} | ||
<span | ||
className={`pl-c-nav__link-text ${ | ||
props.iconOnly ? 'is-vishidden' : '' | ||
}`} | ||
> | ||
{props.children} | ||
{props.status && ( | ||
<span | ||
class={`pl-c-pattern-state pl-c-pattern-state--${props.status}`} | ||
title={props.status} | ||
/> | ||
)} | ||
</span> | ||
{props.iconPos !== 'before' && props.iconName && ( | ||
<span | ||
class="pl-c-nav__link-icon" | ||
dangerouslySetInnerHTML={{ | ||
__html: `<pl-icon name="${props.iconName}"></pl-icon>`, | ||
}} | ||
/> | ||
)} | ||
</Tag> | ||
); | ||
}; |
Oops, something went wrong.