-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Callin Mullaney
committed
Sep 16, 2024
1 parent
bd116df
commit 0c1283f
Showing
10 changed files
with
198 additions
and
16 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/components/navigation/breadcrumbs/breadcrumbs.component.yml
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,63 @@ | ||
{% set item__modifiers = item__modifiers|default([]) %} | ||
{% set item__modifiers = item__modifiers|default([]) %} | ||
{% set item__attributes = item__attributes|default({}) %} | ||
|
||
{# Set link component as default #} | ||
{% set list__item %} | ||
{% if item.title %} | ||
{% set link__content = item.title %} | ||
{% endif %} | ||
|
||
{% if item.text %} | ||
{% set link__content = item.text %} | ||
{% endif %} | ||
|
||
{% if not item.url and not item.href %} | ||
{% set link__attributes = link__attributes|merge({ | ||
'class': bem('placeholder', item__modifiers, menu__base_class), | ||
}) %} | ||
<span {{ add_attributes(link__attributes) }}>{{- link__content -}}</span> | ||
{% else %} | ||
{# If drupal stringify the url object #} | ||
{# See variable passed to menu_links macro #} | ||
{% if directory %} | ||
{% if item.url %} | ||
{% set link__url = item.url|render %} | ||
{% endif %} | ||
{% if item.href %} | ||
{% set link__url = item.href %} | ||
{% endif %} | ||
{% else %} | ||
{% set link__url = item.url %} | ||
{% endif %} | ||
|
||
{% if link__url is empty %} | ||
{% set link__base_class = 'placeholder' %} | ||
{% set link__url = '#' %} | ||
{% else %} | ||
{% set link__blockname = menu__base_class %} | ||
{% endif %} | ||
{% embed "@components/link/link.twig" with { | ||
link__style: 'icon', | ||
} %} | ||
{% block link__content %} | ||
{% include "@components/icons/_icon.twig" with { | ||
icon__name: item.title|lower, | ||
icon__blockname: menu__base_class, | ||
} %} | ||
<span {{ bem('text', [], menu_class, ['visually-hidden']) }}>{{ item.title }}</span> | ||
{% endblock %} | ||
{% endembed %} | ||
{% endif %} | ||
{% endset %} | ||
|
||
{% embed "@components/lists/_list-item.twig" with { | ||
list__item__base_class: 'item', | ||
list__item__modifiers: item__modifiers, | ||
list__item__blockname: item__blockname, | ||
list__item__attributes: item__attributes, | ||
} %} | ||
{% block list__item__content %} | ||
{{- list__item -}} | ||
{% endblock %} | ||
{% endembed %} |
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,20 @@ | ||
{% set item__blockname = menu__base_class %} | ||
|
||
{% set menu__item %} | ||
{% block menu__item__content %} | ||
{% for item in items %} | ||
{% include "@components/navigation/social/_social-item.twig" %} | ||
{% endfor %} | ||
{% endblock %} | ||
{% endset %} | ||
|
||
{# List #} | ||
{% embed "@components/lists/list.twig" with { | ||
list__base_class: 'menu-list', | ||
list__blockname: menu__base_class, | ||
list__type: menu__list__type, | ||
}%} | ||
{% block list__content %} | ||
{{ menu__item }} | ||
{% endblock %} | ||
{% endembed %} |
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 @@ | ||
$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json | ||
|
||
name: Social Menu | ||
group: Components/Navigation | ||
status: stable | ||
props: | ||
type: object | ||
required: | ||
- items | ||
properties: | ||
items: | ||
type: array | ||
title: Social menu items | ||
description: The items of the social menu. | ||
data: | ||
- title: 'Twitter' | ||
url: '#' | ||
icon: 'twitter' | ||
- title: 'Facebook' | ||
url: '#' | ||
icon: 'facebook' | ||
- title: 'Instagram' | ||
url: '#' | ||
icon: 'instagram' | ||
- title: 'LinkedIn' | ||
url: '#' | ||
icon: 'linkedin' |
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,35 @@ | ||
@use '../../../foundation/utility/utility' as *; | ||
@use '../../link/link.scss' as *; | ||
|
||
.social-nav__menu-list { | ||
@include list-reset; | ||
|
||
& { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
gap: var(--spacing-md); | ||
} | ||
} | ||
|
||
.social-nav__link { | ||
@include link; | ||
|
||
& { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
gap: var(--spacing-sm); | ||
text-decoration: none; | ||
} | ||
|
||
&:focus, | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
|
||
.social-nav__icon { | ||
height: var(--size-xl); | ||
width: var(--size-xl); | ||
fill: currentColor; | ||
} |
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,13 @@ | ||
// Markup. | ||
import socialNavTwig from './social.twig'; | ||
import socialNavDataProps from './social.component.yml'; | ||
|
||
// Data. | ||
const socialNavData = socialNavDataProps.props.properties.items.data; | ||
|
||
/** | ||
* Storybook Definition. | ||
*/ | ||
export default { title: 'Components/Navigation/Social' }; | ||
|
||
export const social = () => socialNavTwig({ items: socialNavData }); |
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,8 @@ | ||
{% embed "@components/navigation/base/menu.twig" with { | ||
menu__name: 'Social Navigation', | ||
menu__base_class: 'social-nav', | ||
} %} | ||
{% block menu_list__content %} | ||
{% include "@components/navigation/social/_social-list.twig" %} | ||
{% endblock %} | ||
{% endembed %} |