Skip to content

Commit 10de645

Browse files
authored
Merge pull request pattern-lab#1143 from JosefBredereck/dev
Update pattern discovery and fix "view all" issues
2 parents 0a5283d + 55489b7 commit 10de645

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

packages/uikit-workshop/src/sass/scss/04-components/_pattern-category.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
*/
1111
.pl-c-category {
1212
margin-top: 6rem;
13-
font: $pl-font !important;
13+
font-family: $pl-font !important;
1414

1515
&:first-of-type {
1616
margin-top: 2rem;
1717
}
18+
19+
& + & {
20+
margin-top: 2rem;
21+
}
1822
}
1923

2024
/**
@@ -25,13 +29,18 @@
2529
color: $pl-color-gray-87 !important;
2630
margin: 0 0 0.2rem;
2731
text-transform: capitalize;
32+
33+
&:hover {
34+
color: $pl-color-gray-70 !important;
35+
}
2836
}
2937

3038
/**
3139
* Pattern Category Link
3240
*/
3341
.pl-c-category__title-link {
3442
transition: color $pl-animate-quick ease-out;
43+
color: inherit;
3544
}
3645

3746
/**

packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ class Nav extends BaseComponent {
269269
return (
270270
<NavList
271271
elem={this.elem}
272-
category={patternSubtype.patternSubtypeUC}
272+
category={patternSubtype.patternSubtypeLC}
273+
categoryName={patternSubtype.patternSubtypeUC}
273274
>
274275
{patternSubtype.patternSubtypeItems}
275276
</NavList>
@@ -296,19 +297,20 @@ class Nav extends BaseComponent {
296297
{(window.ishControls === undefined ||
297298
window.ishControls.ishControlsHide === undefined ||
298299
(window.ishControls.ishControlsHide['views-all'] !== true &&
299-
window.ishControls.ishControlsHide.all !== true)) && (
300-
<NavItem>
301-
<a
302-
onClick={e => this.handleClick(e, 'all')}
303-
href="styleguide/html/styleguide.html"
304-
class="pl-c-nav__link pl-c-nav__link--pattern"
305-
data-patternpartial="all"
306-
tabindex="0"
307-
>
308-
All
309-
</a>
310-
</NavItem>
311-
)}
300+
window.ishControls.ishControlsHide.all !== true)) &&
301+
!this.noViewAll && (
302+
<NavItem>
303+
<a
304+
onClick={e => this.handleClick(e, 'all')}
305+
href="styleguide/html/styleguide.html"
306+
class="pl-c-nav__link pl-c-nav__link--pattern"
307+
data-patternpartial="all"
308+
tabindex="0"
309+
>
310+
All
311+
</a>
312+
</NavItem>
313+
)}
312314
</ol>
313315
);
314316
}

packages/uikit-workshop/src/scripts/components/pl-nav/src/NavLink.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ export const NavLink = props => {
77
href={`patterns/${props.item.patternPath}`}
88
className={`pl-c-nav__link pl-c-nav__link--sublink
99
${
10-
props.item.patternName === 'View All'
10+
props.item.isDocPattern
1111
? 'pl-c-nav__link--overview'
1212
: 'pl-c-nav__link--subsublink'
1313
}
1414
`}
1515
onClick={e => props.elem.handleClick(e, props.item.patternPartial)}
1616
data-patternpartial={props.item.patternPartial}
1717
>
18-
{props.item.patternName === 'View All' && props.category
19-
? `${props.category}`
18+
{props.item.isDocPattern && props.category
19+
? `${props.categoryName}`
2020
: props.item.patternName}
2121
{props.item.patternState && (
2222
<PatternState variant={props.item.patternState} />

packages/uikit-workshop/src/scripts/components/pl-nav/src/NavList.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ import { NavItem } from './NavItem';
55
import { NavButton } from './NavButton';
66

77
export const NavList = props => {
8-
const { children, category, elem } = props;
8+
const { children, category, categoryName, elem } = props;
99
const reorderedChildren = [];
1010

1111
const nonViewAllItems = elem.noViewAll
12-
? children.filter(item => item.patternName !== 'View All')
12+
? children.filter(item => !item.isDocPattern)
1313
: children.filter(
14-
item =>
15-
item.patternName !== 'View All' && !item.patternName.includes(' Docs')
14+
item => !item.isDocPattern && !item.patternName.includes(' Docs')
1615
);
1716
const viewAllItems = elem.noViewAll
1817
? []
19-
: children.filter(item => item.patternName === 'View All');
18+
: children.filter(item => item.isDocPattern);
2019

2120
reorderedChildren.push(...viewAllItems, ...nonViewAllItems);
2221

@@ -27,6 +26,7 @@ export const NavList = props => {
2726
<div class="pl-c-nav__link--overview-wrapper">
2827
<NavLink
2928
category={category}
29+
categoryName={categoryName}
3030
item={patternSubtypeItem}
3131
elem={elem}
3232
/>
@@ -43,7 +43,7 @@ export const NavList = props => {
4343
))
4444
) : (
4545
<NavButton aria-controls={category} onClick={elem.toggleNavPanel}>
46-
{category}
46+
{categoryName}
4747
</NavButton>
4848
)}
4949

@@ -57,6 +57,7 @@ export const NavList = props => {
5757
<NavItem>
5858
<NavLink
5959
category={category}
60+
categoryName={categoryName}
6061
item={patternSubtypeItem}
6162
elem={elem}
6263
/>

0 commit comments

Comments
 (0)