first commit

This commit is contained in:
2024-07-15 12:33:27 +02:00
commit ce50ae282b
22084 changed files with 2623791 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
{#
/**
* @file
* Placeholder content for the shortcuts menu. This is used to eliminate layout
* shifts as BigPipe injects data.
*/
#}
{% include '@navigation/toolbar-button.html.twig' with {
attributes: create_attribute(),
extra_classes: 'invisible toolbar-button--icon--shortcuts toolbar-button--expand--side toolbar-button--collapsible toolbar-popover__control',
icon: 'shortcuts',
text: 'Shortcuts'|t,
} only %}

View File

@@ -0,0 +1,40 @@
{#
/**
* @file
* Default theme implementation to display a navigation_block.
*
* Available variables:
* - plugin_id: The ID of the navigation_block implementation.
* - label: The configured label of the navigation_block if visible.
* - configuration: A list of the navigation_block's configuration values.
* - label: The configured label for the navigation_block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this
navigation_block plugin.
* - Navigation block plugin specific settings will also be stored here.
* - content: The content of this navigation_block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_navigation_block()
*
* @ingroup themeable
*/
#}
<div{{ attributes.addClass('toolbar-block') }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes.addClass('toolbar-block__title').setAttribute('data-drupal-tooltip', label).setAttribute('data-drupal-tooltip-class', 'toolbar-block__title-tooltip') }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</div>

View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 32 32" role="img" aria-label="{{ label }}">
<rect fill="{{ bg_color|default('#347efe') }}" width="32" height="32" rx="8"/>
<path fill="{{ fg_color|default('#fff') }}" d="M19,10.3C17.67,9,16.38,7.68,16,6.23,15.62,7.67,14.33,9,13,10.3c-2,2-4.31,4.31-4.31,7.74a7.32,7.32,0,0,0,14.64,0C23.32,14.61,21,12.32,19,10.3Zm-7.22,9.44c-.45,0-2.11-2.87,1-5.91l2,2.22a.18.18,0,0,1,0,.25h0A19.3,19.3,0,0,0,12,19.6C11.92,19.75,11.83,19.74,11.79,19.74ZM16,23.51A2.52,2.52,0,0,1,13.48,21a2.56,2.56,0,0,1,.63-1.66c.45-.56,1.89-2.12,1.89-2.12s1.41,1.59,1.89,2.11A2.5,2.5,0,0,1,18.52,21,2.52,2.52,0,0,1,16,23.51Zm4.82-4.09c-.06.12-.18.32-.35.33s-.32-.14-.55-.47c-.48-.71-4.67-5.09-5.46-5.94s-.09-1.27.18-1.55L16,10.44a35.72,35.72,0,0,1,4.25,4.8A4.5,4.5,0,0,1,20.82,19.42Z"/>
</svg>

After

Width:  |  Height:  |  Size: 841 B

View File

@@ -0,0 +1,64 @@
{#
/**
* @file
* Default theme implementation to display the navigation footer menu.
*
* Available variables:
* - menu_name: The machine name of the user menu.
* - help: TRUE if "Help" module is enabled.
* - title: A name of account.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
* - title: The menu link title.
* - url: The menu link URL, instance of \Drupal\Core\Url
* - localized_options: Menu link localized options.
* - is_expanded: TRUE if the link has visible children within the current
* menu tree.
* - is_collapsed: TRUE if the link has children within the current menu tree
* that are not currently visible.
* - in_active_trail: TRUE if the link is in the active trail.
*
* @ingroup themeable
*/
#}
{% set menu_heading_id = 'menu--' ~ menu_name|clean_unique_id %}
<div class="admin-toolbar__item">
<h4 id="{{ menu_heading_id }}" class="toolbar-block__title visually-hidden focusable">{{ title }}</h4>
<ul class="toolbar-block__list">
{% if help %}
<li class="toolbar-block__list-item">
{% include '@navigation/toolbar-button.html.twig' with {
attributes: create_attribute({ 'href': path('help.main'), 'data-drupal-tooltip': 'Help'|t, 'data-drupal-tooltip-class': 'admin-toolbar__tooltip' }),
icon: 'help',
html_tag: 'a',
text: 'Help'|t,
extra_classes: 'toolbar-button--collapsible',
} only %}
</li>
{% endif %}
<li id="admin-toolbar-user-menu" class="toolbar-block__list-item toolbar-block__list-item--user toolbar-popover" data-toolbar-popover>
{% include '@navigation/toolbar-button.html.twig' with {
action: true,
attributes: create_attribute({'aria-expanded': 'false', 'aria-controls': 'admin-toolbar-user-menu', 'data-toolbar-popover-control': true}),
icon: menu_name|clean_class,
text: title,
extra_classes: 'toolbar-button--expand--side toolbar-button--collapsible toolbar-popover__control',
has_safe_triangle: TRUE,
} only %}
<div class="toolbar-popover__wrapper" data-toolbar-popover-wrapper>
<span class="toolbar-popover__header toolbar-button toolbar-button--large toolbar-button--dark toolbar-button--non-interactive">{{ title }}</span>
<ul class="toolbar-menu toolbar-popover__menu">
{% for item in items %}
<li class="toolbar-menu__item toolbar-menu__item--level-1">
<a
href="{{ item.url }}"
class="toolbar-button"
>{{ item.title }}</a>
</li>
{% endfor %}
</ul>
</div>
</li>
</ul>
</div>

View File

@@ -0,0 +1,95 @@
{% import _self as menus %}
{% set menu_heading_id = 'menu--' ~ menu_name|clean_unique_id %}
<div class="admin-toolbar__item">
<h4 id="{{ menu_heading_id }}" class="toolbar-block__title visually-hidden focusable">{{ title }}</h4>
<ul class="toolbar-block__list" aria-labelledby="{{ menu_heading_id }}">
{{ menus.menu_items(items, attributes, 0) }}
</ul>
</div>
{% macro menu_items(items, attributes, menu_level) %}
{% for item in items %}
{% set item_id = ('navigation-link--' ~ item.original_link.pluginId)|clean_unique_id %}
{% if menu_level == 0 %}
{% if item.below is empty %}
<li id="{{ item_id }}" class="toolbar-block__list-item">
{% include '@navigation/toolbar-button.html.twig' with {
attributes: create_attribute({ 'href': item.url|render, 'data-drupal-tooltip': item.title, 'data-drupal-tooltip-class': 'admin-toolbar__tooltip' }),
icon: item.class|clean_class,
html_tag: 'a',
text: item.title,
extra_classes: 'toolbar-button--collapsible',
} only %}
</li>
{% else %}
<li id="{{ item_id }}" class="toolbar-block__list-item toolbar-popover" data-toolbar-popover>
{% include '@navigation/toolbar-button.html.twig' with {
action: true,
attributes: create_attribute({'aria-expanded': 'false', 'aria-controls': item_id, 'data-toolbar-popover-control': true}),
icon: item.class|clean_class,
text: item.title,
extra_classes: 'toolbar-button--expand--side toolbar-button--collapsible toolbar-popover__control',
has_safe_triangle: TRUE,
} only %}
<div class="toolbar-popover__wrapper" data-toolbar-popover-wrapper inert>
{% if item.url %}
{{ link(item.title, item.url, create_attribute({'class': ['toolbar-popover__header', 'toolbar-button', 'toolbar-button--large', 'toolbar-button--dark']})) }}
{% else %}
<span class="toolbar-popover__header toolbar-button toolbar-button--large toolbar-button--dark toolbar-button--non-interactive">{{ item.title }}</span>
{% endif %}
<ul class="toolbar-menu toolbar-popover__menu">
{{ menus.menu_items(item.below, attributes, 1) }}
</ul>
</div>
</li>
{% endif %}
{% elseif menu_level == 1 %}
<li class="toolbar-menu__item toolbar-menu__item--level-{{ menu_level }}">
{% if item.below is empty %}
<a
href="{{ item.url }}"
class="toolbar-button"
data-index-text="{{ item.title|first|lower }}"
>{{ item.title }}</a>
{% else %}
<button
class="toolbar-button toolbar-button--expand--down"
data-toolbar-menu-trigger="{{ menu_level }}"
aria-expanded="false"
data-index-text="{{ item.title|first|lower }}"
>
<span class="toolbar-menu__link-action visually-hidden">{{ 'Extend'|t }}</span>
<span class="toolbar-menu__link-title">{{ item.title }}</span>
</button>
<ul class="toolbar-menu toolbar-menu--level-{{ menu_level + 1 }}" inert>
{{ menus.menu_items(item.below, attributes, menu_level + 1) }}
</ul>
{% endif %}
</li>
{% else %}
<li class="toolbar-menu__item toolbar-menu__item--level-{{ menu_level }}">
{% if item.below is empty %}
<a
href="{{ item.url }}"
class="toolbar-menu__link toolbar-menu__link--{{ menu_level }}"
data-index-text="{{ item.title|first|lower }}"
>{{ item.title }}</a>
{% else %}
<button
class="toolbar-menu__link toolbar-menu__link--{{ menu_level }}"
data-toolbar-menu-trigger="{{ menu_level }}"
aria-expanded="false"
data-index-text="{{ item.title|first|lower }}"
>
<span class="toolbar-menu__link-action visually-hidden">{{ 'Extend'|t }}</span>
<span class="toolbar-menu__link-title">{{ item.title }}</span>
</button>
<ul class="toolbar-menu toolbar-menu--level-{{ menu_level + 1 }}" inert>
{{ menus.menu_items(item.below, attributes, menu_level + 1) }}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
{% endmacro %}

View File

@@ -0,0 +1,33 @@
{# Extra classes variable added to be sure that modifiers will
appear after main classes #}
{%
set classes = [
'toolbar-button',
icon ? 'toolbar-button--icon--' ~ icon : '',
extra_classes,
]
%}
<{{html_tag|default('button')}}
{{ attributes.addClass(classes) }}
data-index-text="{{ text|first|lower }}"
data-icon-text={{- text|render|trim|slice(0, 2)|join('') }}
>
{% if avatar %}
<span class="toolbar-button__avatar">{{~ avatar ~}}</span>
{% endif %}
{% if action %}
<span data-toolbar-action class="visually-hidden">{{ 'Extend'|t }}</span>
{% endif %}
{% block content %}
{% if text %}
<span class="toolbar-button__label {{ label_classes }}" data-text>{{~ text ~}}</span>
{% endif %}
{% endblock %}
{# Element that improves sub-menu UX by implementing the Safe Triangle strategy.
More info at https://www.smashingmagazine.com/2023/08/better-context-menus-safe-triangles #}
{% if has_safe_triangle %}
<div data-toolbar-popover-safe-triangle></div>
{% endif %}
</{{html_tag|default('button')}}>

View File

@@ -0,0 +1,12 @@
{#
/**
* @file
* Default theme implementation for a single navigation top bar local task.
*
* Available variables:
* - link: Link render element.
*/
#}
<li class="toolbar-dropdown__item">
{{ link|add_class('toolbar-dropdown__link') }}
</li>

View File

@@ -0,0 +1,28 @@
{#
/**
* @file
* Default theme implementation for navigation top bar local tasks.
*
* Available variables:
* - local_tasks: Array of local tasks for the current route.
*/
#}
{% set dropdown_id = 'admin-local-tasks'|clean_unique_id %}
{% include '@navigation/toolbar-button.html.twig' with {
attributes: create_attribute(
{
'aria-expanded': 'false',
'aria-controls': dropdown_id,
'data-drupal-dropdown': 'true'
}
),
text: 'More actions'|t,
extra_classes: 'toolbar-button--expand--down toolbar-button--weight--400 toolbar-button--tertiary--expanded toolbar-button--actions',
} only %}
<div class="toolbar-dropdown__menu" id={{ dropdown_id }}>
<ul class="toolbar-dropdown__list">
{% for local_task in local_tasks %}
{{ local_task }}
{% endfor %}
</ul>
</div>

View File

@@ -0,0 +1,20 @@
{#
/**
* @file
* Default theme implementation for the navigation top bar.
*
* Available variables:
* - local_tasks: The local tasks for the current route.
*
* @ingroup themeable
*/
#}
{% set attributes = create_attribute() %}
{% if local_tasks %}
{% set attributes = attributes.setAttribute('data-offset-top', '') %}
<div {{ attributes.addClass('top-bar').setAttribute('data-drupal-admin-styles', '') }}>
<div class="top-bar__content">
{{ local_tasks }}
</div>
</div>
{% endif %}