-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new global nav * remove package * Add unified draft trigger workflow * Add branch to unified draft trigger push arguments * scrolling nav buttons * highlight active menu item * shift dropdown middleware * conditionally render global nav styles * version switcher, component title link, dropdown a11y improvements * title styles * page version changes * Undo unintentional changes to draft workflow * design review changes * icon color change * global nav change --------- Co-authored-by: Ronnie Miller <[email protected]>
- Loading branch information
1 parent
cc59403
commit b466aa7
Showing
24 changed files
with
474 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@layer components { | ||
.dropdown .dropdown-content { | ||
@apply invisible fixed left-0 top-0 origin-top scale-95 transform opacity-0 motion-safe:transition motion-safe:duration-300 motion-safe:ease-in-out; | ||
|
||
/* Shadow-100 */ | ||
box-shadow: | ||
0px 4px 5px 0px rgba(10, 10, 10, 0.08), | ||
0px 1px 10px 0px rgba(10, 10, 10, 0.08), | ||
0px 2px 4px 0px rgba(32, 41, 58, 0.14); | ||
} | ||
|
||
.dropdown .dropdown-content.active { | ||
@apply visible scale-100 opacity-100; | ||
} | ||
} |
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,32 @@ | ||
.global-nav > .scroll-btn-left, | ||
.global-nav > .scroll-btn-right { | ||
@apply invisible absolute opacity-0 motion-safe:transition-all; | ||
|
||
&.active { | ||
@apply visible opacity-100; | ||
} | ||
} | ||
|
||
.global-nav > .scroll-btn-left { | ||
@apply left-0 rounded-tl py-3 pl-2 pr-4; | ||
} | ||
|
||
.global-nav > .scroll-btn-right { | ||
@apply right-0 rounded-tr py-3 pl-4 pr-2; | ||
} | ||
|
||
html[data-theme="light"] .global-nav > .scroll-btn-left { | ||
background: linear-gradient(to left, rgba(255, 255, 255, 0), rgb(255, 255, 255), rgb(255, 255, 255) 50%); | ||
} | ||
|
||
html[data-theme="dark"] .global-nav > .scroll-btn-left { | ||
background: linear-gradient(to left, rgba(9, 9, 9, 0), rgb(9, 9, 9), rgb(9, 9, 9) 50%); | ||
} | ||
|
||
html[data-theme="light"] .global-nav > .scroll-btn-right { | ||
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgb(255, 255, 255), rgb(255, 255, 255) 50%); | ||
} | ||
|
||
html[data-theme="dark"] .global-nav > .scroll-btn-right { | ||
background: linear-gradient(to right, rgba(9, 9, 9, 0), rgb(9, 9, 9), rgb(9, 9, 9) 50%); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict' | ||
|
||
module.exports = module.exports = (navItem, { | ||
data: { | ||
root: { page }, | ||
}, | ||
}) => { | ||
const pageVersion = page.componentVersion?.version | ||
const pageComponent = page.component?.name | ||
|
||
const matchesComponentAndVersion = (item) => { | ||
if (pageVersion) { | ||
return item.component === pageComponent && item.version === pageVersion | ||
} else { | ||
return item.component === pageComponent | ||
} | ||
} | ||
|
||
if (navItem.component) { | ||
return matchesComponentAndVersion(navItem) | ||
} | ||
|
||
if (navItem.items) { | ||
return navItem.items.some(matchesComponentAndVersion) | ||
} | ||
|
||
return false | ||
} |
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,44 @@ | ||
'use strict' | ||
|
||
const mapNavList = (list, contentCatalog) => { | ||
return list.map((item) => { | ||
if (item.xref) { | ||
const page = contentCatalog.resolvePage(item.xref) | ||
if (page) item.url = page.pub.url | ||
if (page?.src?.component) { | ||
item.component = page.src.component | ||
} | ||
if (page?.src?.version) { | ||
item.version = page.src.version | ||
} | ||
item.urlType = 'internal' | ||
delete item.xref | ||
} | ||
if (item.url && item.url.startsWith('http')) item.urlType = 'external' | ||
if (item.items) { | ||
item.items = mapNavList(item.items, contentCatalog) | ||
} | ||
return item | ||
}) | ||
} | ||
|
||
module.exports = ({ | ||
data: { | ||
root: { | ||
contentCatalog = { resolvePage: () => undefined, getComponent: () => undefined }, | ||
site, | ||
}, | ||
}, | ||
}) => { | ||
let globalNav = site?.keys?.globalNav | ||
|
||
if (!globalNav) return [] | ||
if (globalNav._compiled) return globalNav | ||
|
||
globalNav = mapNavList(JSON.parse(globalNav), contentCatalog) | ||
|
||
globalNav._compiled = true | ||
|
||
site.keys.globalNav = globalNav | ||
return globalNav | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.