clean install

This commit is contained in:
2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 changed files with 3555714 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
{#
/**
* @file
* Theme override for a 'checkboxes' #type form element.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The rendered checkboxes.
*
* @see template_preprocess_checkboxes()
*/
@todo: remove this file once https://www.drupal.org/node/1819284 is resolved.
This is identical to core/modules/system/templates/container.html.twig
#}
<div{{ attributes.addClass('form-checkboxes') }}>{{ children }}</div>

View File

@@ -0,0 +1,56 @@
{#
/**
* @file
* Theme override of a datetime form wrapper.
*
* @todo Refactor when https://www.drupal.org/node/3010558 is fixed.
*
* @see template_preprocess_form_element()
*/
#}
{% set show_description_toggle = description_toggle and description %}
{%
set classes = [
'form-item',
'form-datetime-wrapper',
show_description_toggle ? 'help-icon__description-container',
]
%}
{%
set title_classes = [
'form-item__label',
required ? 'js-form-required',
required ? 'form-required',
errors ? 'has-error',
]
%}
{%
set description_classes = [
'form-item__description',
description_display == 'invisible' ? 'visually-hidden',
]
%}
<div {{ attributes.addClass(classes) }}>
{% if show_description_toggle %}
<div class="help-icon">
{% endif %}
{% if title %}
<h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
{% endif %}
{% if show_description_toggle %}
{{ attach_library('gin/gin_description_toggle') }}
<button class="help-icon__description-toggle"></button>
</div>
{% endif %}
{{ content }}
{% if errors %}
<div class="form-item__error-message">
{{ errors }}
</div>
{% endif %}
{% if description %}
<div{{ description_attributes.addClass(description_classes) }}>
{{ description }}
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,102 @@
{#
/**
* @file
* Theme override for a details element.
*
* Available variables
* - attributes: A list of HTML attributes for the details element.
* - errors: (optional) Any errors for this details element, may not be set.
* - title: (optional) The title of the element, may not be set.
* - description: (optional) The description of the element, may not be set.
* - children: (optional) The children of the element, may not be set.
* - value: (optional) The value of the element, may not be set.
* - accordion: whether the details element should look as an accordion.
* - accordion_item: whether the details element is an item of an accordion
* list.
* - disabled: whether the details is disabled.
*
* @see template_preprocess_details()
* @see claro_preprocess_details()
*/
#}
{#
Prefix 'details' class to avoid collision with Modernizr.
@todo Remove prefix after https://www.drupal.org/node/2981732 has been solved.
#}
{% set show_description_toggle = description_toggle and description %}
{%
set classes = [
'claro-details',
accordion ? 'claro-details--accordion',
accordion_item ? 'claro-details--accordion-item',
show_description_toggle ? 'help-icon__description-container',
]
%}
{%
set content_wrapper_classes = [
'claro-details__wrapper',
'details-wrapper',
accordion ? 'claro-details__wrapper--accordion',
accordion_item ? 'claro-details__wrapper--accordion-item',
]
%}
{%
set inner_wrapper_classes = [
'claro-details__content',
accordion ? 'claro-details__content--accordion',
accordion_item ? 'claro-details__content--accordion-item',
]
%}
{%
set description_classes = [
'claro-details__description',
disabled ? 'is-disabled',
description_display == 'invisible' ? 'visually-hidden',
]
%}
<details{{ attributes.addClass(classes) }}>
{%- if title -%}
{%
set summary_classes = [
'claro-details__summary',
required ? 'js-form-required',
required ? 'form-required',
accordion ? 'claro-details__summary--accordion',
accordion_item ? 'claro-details__summary--accordion-item',
]
%}
<summary{{ summary_attributes.addClass(summary_classes) }}>
{{- title -}}
<span class="required-mark"></span>
{% if show_description_toggle %}
{{ attach_library('gin/gin_description_toggle') }}
<button class="help-icon__description-toggle"></button>
{% endif %}
</summary>
{%- endif -%}
<div{{ content_attributes.addClass(content_wrapper_classes) }}>
{% if accordion or accordion_item %}
<div{{ create_attribute({class: inner_wrapper_classes}) }}>
{% endif %}
{% if errors %}
<div class="form-item form-item--error-message">
{{ errors }}
</div>
{% endif %}
{%- if description -%}
<div{{ create_attribute().addClass(description_classes) }}>{{ description }}</div>
{%- endif -%}
{%- if children -%}
{{ children }}
{%- endif -%}
{%- if value -%}
{{ value }}
{%- endif -%}
{% if accordion or accordion_item %}
</div>
{% endif %}
</div>
</details>

View File

@@ -0,0 +1,112 @@
{#
/**
* @file
* Theme override for a fieldset element and its children.
*
* Available variables:
* - attributes: HTML attributes for the fieldset element.
* - errors: (optional) Any errors for this fieldset element, may not be set.
* - required: Boolean indicating whether the fieldset element is required.
* - legend: The legend element containing the following properties:
* - title: Title of the fieldset, intended for use as the text of the legend.
* - attributes: HTML attributes to apply to the legend.
* - description: The description element containing the following properties:
* - content: The description content of the fieldset.
* - attributes: HTML attributes to apply to the description container.
* - description_display: Description display setting. It can have these values:
* - before: The description is output before the element.
* - after: The description is output after the element (default).
* - invisible: The description is output after the element, hidden visually
* but available to screen readers.
* - children: The rendered child elements of the fieldset.
* - prefix: The content to add before the fieldset children.
* - suffix: The content to add after the fieldset children.
*
* @see template_preprocess_fieldset()
* @see claro_preprocess_fieldset()
*/
#}
{% set show_description_toggle = description_toggle and description.content %}
{%
set classes = [
'fieldset',
attributes.hasClass('fieldgroup') ? 'fieldset--group',
'js-form-item',
'form-item',
'js-form-wrapper',
'form-wrapper',
show_description_toggle ? 'help-icon__description-container',
]
%}
{%
set wrapper_classes = [
'fieldset__wrapper',
attributes.hasClass('fieldgroup') ? 'fieldset__wrapper--group',
]
%}
{%
set legend_span_classes = [
'fieldset__label',
attributes.hasClass('fieldgroup') ? 'fieldset__label--group',
required ? 'js-form-required',
required ? 'form-required',
]
%}
{%
set legend_classes = [
'fieldset__legend',
attributes.hasClass('fieldgroup') and not attributes.hasClass('form-composite') ? 'fieldset__legend--group',
attributes.hasClass('form-composite') ? 'fieldset__legend--composite',
title_display == 'invisible' ? 'fieldset__legend--invisible' : 'fieldset__legend--visible',
]
%}
{%
set description_classes = [
'fieldset__description',
show_description_toggle == 'invisible' ? 'visually-hidden',
]
%}
<fieldset{{ attributes.addClass(classes) }}>
{% if show_description_toggle %}
<div class="help-icon">
{% endif %}
{# Always wrap fieldset legends in a <span> for CSS positioning. #}
{% if legend.title %}
<legend{{ legend.attributes.addClass(legend_classes) }}>
<span{{ legend_span.attributes.addClass(legend_span_classes) }}>{{ legend.title }}</span>
</legend>
{% endif %}
{% if show_description_toggle %}
{{ attach_library('gin/gin_description_toggle') }}
<button class="help-icon__description-toggle"></button>
</div>
{% endif %}
<div{{ content_attributes.addClass(wrapper_classes) }}>
{% if description_display == 'before' and description.content %}
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
{% endif %}
{% if inline_items %}
<div class="container-inline">
{% endif %}
{% if prefix %}
<span class="fieldset__prefix">{{ prefix }}</span>
{% endif %}
{{ children }}
{% if suffix %}
<span class="fieldset__suffix">{{ suffix }}</span>
{% endif %}
{% if errors %}
<div class="fieldset__error-message">
{{ errors }}
</div>
{% endif %}
{% if description_display in ['after', 'invisible'] and description.content %}
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
{% endif %}
{% if inline_items %}
</div>
{% endif %}
</div>
</fieldset>

View File

@@ -0,0 +1,86 @@
{#
/**
* @file
* Theme override for a form element.
*
* @see template_preprocess_form_element()
*/
#}
{#
Most of core-provided js assumes that the CSS class pattern js-form-item-[something] or
js-form-type-[something] exists on form items. We have to keep them.
#}
{% set show_description_toggle = description_toggle and description.content %}
{%
set classes = [
'js-form-item',
'form-item',
'js-form-type-' ~ type|clean_class,
'form-type--' ~ type|clean_class,
type in ['checkbox', 'radio'] ? 'form-type--boolean',
'js-form-item-' ~ name|clean_class,
'form-item--' ~ name|clean_class,
title_display not in ['after', 'before'] ? 'form-item--no-label',
disabled == 'disabled' ? 'form-item--disabled',
errors ? 'form-item--error',
show_description_toggle ? 'help-icon__description-container'
]
%}
{%
set description_classes = [
'form-item__description',
description_display == 'invisible' ? 'visually-hidden',
]
%}
<div{{ attributes.addClass(classes) }}>
{% if label_display in ['before', 'invisible'] %}
{% if show_description_toggle %}
<div class="help-icon">
{{ label }}
{{ attach_library('gin/gin_description_toggle') }}
<button class="help-icon__description-toggle"></button>
</div>
{% else %}
{{ label }}
{% endif %}
{% endif %}
{% if show_description_toggle %}
<div class="help-icon__element-has-description">
{% endif %}
{% if prefix is not empty %}
<span class="form-item__prefix{{disabled == 'disabled' ? ' is-disabled'}}">{{ prefix }}</span>
{% endif %}
{% if description_display == 'before' and description.content %}
<div{{ description.attributes.addClass(description_classes) }}>
{{ description.content }}
</div>
{% endif %}
{{ children }}
{% if suffix is not empty %}
<span class="form-item__suffix{{disabled == 'disabled' ? ' is-disabled'}}">{{ suffix }}</span>
{% endif %}
{% if label_display == 'after' %}
{% if show_description_toggle %}
<div class="help-icon">
{{ label }}
{{ attach_library('gin/gin_description_toggle') }}
<button class="help-icon__description-toggle"></button>
</div>
{% else %}
{{ label }}
{% endif %}
{% endif %}
{% if show_description_toggle %}
</div>
{% endif %}
{% if errors %}
<div class="form-item__error-message">
{{ errors }}
</div>
{% endif %}
{% if description_display in ['after', 'invisible'] and description.content %}
<div{{ description.attributes.addClass(description_classes) }}>
{{ description.content }}
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,25 @@
{#
/**
* @file
* Theme override for an 'input' #type form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
*
* @see template_preprocess_input()
* @see claro_preprocess_input()
*/
#}
{% if autocomplete_message %}
<div class="claro-autocomplete">
<input{{ attributes }}/>
<div hidden class="claro-autocomplete__message">{{autocomplete_message}}</div>
</div>
{{ children }}
{% else %}
<input{{ attributes }}/>{{ children }}
<span class="checkbox-toggle">
<span class="checkbox-toggle__inner"></span>
</span>
{% endif %}

View File

@@ -0,0 +1,22 @@
{#
/**
* @file
* Theme override for an 'input' #type form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
*
* @see template_preprocess_input()
* @see claro_preprocess_input()
*/
#}
{% if autocomplete_message %}
<div class="claro-autocomplete">
<input{{ attributes }}/>
<div hidden class="claro-autocomplete__message">{{autocomplete_message}}</div>
</div>
{{ children }}
{% else %}
<input{{ attributes }}/>{{ children }}
{% endif %}

View File

@@ -0,0 +1,14 @@
{#
/**
* @file
* Theme override for an 'input' #type form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
*
* @see template_preprocess_input()
*/
#}
<input{{ attributes.addClass('button--small') }} />{{ children }}

View File

@@ -0,0 +1,63 @@
{#
/**
* @file
* Theme override for a set of links.
*
* Available variables:
* - attributes: Attributes for the UL containing the list of links.
* - links: Links to be output.
* Each link will have the following elements:
* - link: (optional) A render array that returns a link. See
* template_preprocess_links() for details how it is generated.
* - text: The link text.
* - attributes: HTML attributes for the list item element.
* - text_attributes: (optional) HTML attributes for the span element if no
* 'url' was supplied.
* - heading: (optional) A heading to precede the links.
* - text: The heading text.
* - level: The heading level (e.g. 'h2', 'h3').
* - attributes: (optional) A keyed list of attributes for the heading.
* If the heading is a string, it will be used as the text of the heading and
* the level will default to 'h2'.
*
* Headings should be used on navigation menus and any list of links that
* consistently appears on multiple pages. To make the heading invisible use
* the 'visually-hidden' CSS class. Do not use 'display:none', which
* removes it from screen readers and assistive technology. Headings allow
* screen reader and keyboard only users to navigate to or skip the links.
* See http://juicystudio.com/article/screen-readers-display-none.php and
* http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
*
* @see template_preprocess_links()
*/
#}
{% if links -%}
{%- if heading -%}
{%- if heading.level -%}
<{{ heading.level }}{{ heading.attributes }}>{{ heading.text }}</{{ heading.level }}>
{%- else -%}
<h2{{ heading.attributes }}>{{ heading.text }}</h2>
{%- endif -%}
{%- endif -%}
<ul{{ attributes.addClass('dropbutton--gin') }}>
{%- for item in links -%}
{% if loop.index == 2 %}
<li class="dropbutton__item">
<ul class="dropbutton__items">
{% endif %}
<li{{ item.attributes.addClass('dropbutton__item') }}>
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
</li>
{% if loop.length > 1 and loop.last %}
</ul>
</li>
{% endif %}
{%- endfor -%}
</ul>
{%- endif %}

View File

@@ -0,0 +1,43 @@
{#
/**
* @file
* Theme override for a text format-enabled form element.
*
* @todo Remove when https://www.drupal.org/node/3016346 and
* https://www.drupal.org/node/3016343 are fixed.
*
* Available variables:
* - children: Text format element children.
* - description: Text format element description.
* - attributes: HTML attributes for the containing element.
* - aria_description: Flag for whether or not an ARIA description has been
* added to the description container.
* - description_attributes: attributes for the description.
* @see https://www.drupal.org/node/3016343
* - disabled: An indicator for whether the associated form element is disabled,
* added by this theme.
* @see https://www.drupal.org/node/3016346
*
* @see template_preprocess_text_format_wrapper()
*/
#}
{%
set classes = [
'js-form-item',
'form-item',
description_toggle ? 'help-icon__description-container',
]
%}
<div{{ attributes.addClass(classes) }}>
{{ children }}
{% if description %}
{%
set description_classes = [
aria_description ? 'form-item__description',
disabled ? 'is-disabled',
description_display == 'invisible' ? 'visually-hidden',
]
%}
<div{{ description_attributes.addClass(description_classes) }}>{{ description }}</div>
{% endif %}
</div>