@ilo-org/twig 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/{accordion-item → accordion}/accordion-item.twig +2 -2
- package/dist/components/checkbox/checkbox.twig +1 -1
- package/dist/components/checkbox/checkbox.wingsuit.yml +1 -0
- package/dist/components/datepicker/datepicker.twig +2 -2
- package/dist/components/dropdown/dropdown.twig +1 -1
- package/dist/components/dropdown/dropdown.wingsuit.yml +2 -1
- package/dist/components/fileupload/fileupload.twig +1 -1
- package/dist/components/fileupload/fileupload.wingsuit.yml +1 -0
- package/dist/components/{fieldset → form}/fieldset.twig +1 -1
- package/dist/components/form/form.twig +1 -1
- package/dist/components/{formcontrol → form}/formcontrol.twig +1 -1
- package/dist/components/{input → form}/input.twig +1 -1
- package/dist/components/list/list-item.twig +6 -0
- package/dist/components/list/list.twig +2 -2
- package/dist/components/list/list.wingsuit.yml +11 -11
- package/dist/components/list-item/list-item.wingsuit.yml +1 -1
- package/dist/components/navigation/navigation.wingsuit.yml +1 -0
- package/dist/components/numberpicker/numberpicker.twig +2 -2
- package/dist/components/numberpicker/numberpicker.wingsuit.yml +1 -0
- package/dist/components/radio/radio.twig +1 -1
- package/dist/components/radio/radio.wingsuit.yml +1 -0
- package/dist/components/search/search.twig +3 -3
- package/dist/components/search/search.wingsuit.yml +1 -0
- package/dist/components/tag/tag.wingsuit.yml +4 -3
- package/dist/components/{tag → tags}/tag.twig +4 -4
- package/dist/components/tags/tags.twig +1 -1
- package/dist/components/tags/tags.wingsuit.yml +3 -3
- package/dist/components/textarea/textarea.twig +1 -1
- package/dist/components/textarea/textarea.wingsuit.yml +1 -0
- package/dist/components/textinput/textinput.twig +1 -1
- package/dist/components/textinput/textinput.wingsuit.yml +1 -0
- package/dist/components/toggle/toggle.twig +1 -1
- package/dist/components/toggle/toggle.wingsuit.yml +1 -0
- package/package.json +2 -2
- package/src/patterns/components/checkbox/checkbox.wingsuit.yml +1 -0
- package/src/patterns/components/dropdown/dropdown.wingsuit.yml +2 -1
- package/src/patterns/components/fileupload/fileupload.wingsuit.yml +1 -0
- package/src/patterns/components/list/list-item.twig +1 -1
- package/src/patterns/components/list/list-item.wingsuit.yml +1 -1
- package/src/patterns/components/list/list.twig +2 -2
- package/src/patterns/components/list/list.wingsuit.yml +11 -11
- package/src/patterns/components/navigation/navigation.wingsuit.yml +1 -0
- package/src/patterns/components/numberpicker/numberpicker.wingsuit.yml +1 -0
- package/src/patterns/components/radio/radio.wingsuit.yml +1 -0
- package/src/patterns/components/search/search.wingsuit.yml +1 -0
- package/src/patterns/components/tags/tag.twig +4 -4
- package/src/patterns/components/tags/tag.wingsuit.yml +4 -3
- package/src/patterns/components/tags/tags.twig +1 -1
- package/src/patterns/components/tags/tags.wingsuit.yml +3 -3
- package/src/patterns/components/textarea/textarea.wingsuit.yml +1 -0
- package/src/patterns/components/textinput/textinput.wingsuit.yml +1 -0
- package/src/patterns/components/toggle/toggle.wingsuit.yml +1 -0
- package/dist/components/list-item/list-item.twig +0 -6
- /package/dist/components/{videoplayer → video}/videoplayer.twig +0 -0
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
{% set accordion_id = id ~ uid %}
|
|
6
6
|
{% set button_id = 'button-' ~ accordion_id %}
|
|
7
7
|
{% set panel_id = 'panel-' ~ accordion_id %}
|
|
8
|
-
{% set expanded_class = defaultExpanded ?
|
|
9
|
-
{% set scroll_class = scroll ?
|
|
8
|
+
{% set expanded_class = defaultExpanded ? 'ilo' ~ '--accordion--panel--open' : '' %}
|
|
9
|
+
{% set scroll_class = scroll ? 'ilo' ~ '--accordion--panel__scroll' : '' %}
|
|
10
10
|
|
|
11
11
|
<li class="ilo--accordion--item" id="{{ accordion_id }}">
|
|
12
12
|
<div class="ilo--h3">
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
5
|
{% set disabled = disabled|default(false) %}
|
|
6
|
-
{% set baseClass =
|
|
6
|
+
{% set baseClass = 'ilo' ~ '--checkbox' %}
|
|
7
7
|
{% set errorClass = baseClass ~ '__error' %}
|
|
8
8
|
{% set CheckboxClasses = [baseClass] %}
|
|
9
9
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
{# Default values and input preparation #}
|
|
7
7
|
{% set disabled = disabled|default(false) %}
|
|
8
|
-
{% set inputClass =
|
|
9
|
-
{% set baseClass =
|
|
8
|
+
{% set inputClass = 'ilo' ~ '--input' %}
|
|
9
|
+
{% set baseClass = 'ilo' ~ '--datepicker' %}
|
|
10
10
|
{% set datePickerClasses = [inputClass, baseClass] %}
|
|
11
11
|
|
|
12
12
|
{% if error %}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
5
|
{% set disabled = disabled|default(false) %}
|
|
6
|
-
{% set baseClass =
|
|
6
|
+
{% set baseClass = 'ilo' ~ '--dropdown' %}
|
|
7
7
|
{% set dropdownClasses = [baseClass, class] %}
|
|
8
8
|
{% if error %}
|
|
9
9
|
{% set dropdownClasses = dropdownClasses|merge(['error']) %}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
dropdown:
|
|
2
|
-
namespace:
|
|
2
|
+
namespace: Components/Forms
|
|
3
3
|
use: "@components/dropdown/dropdown.twig"
|
|
4
4
|
label: Dropdown
|
|
5
5
|
description: The Dropdown displays a select element with options, and is most
|
|
@@ -13,6 +13,7 @@ dropdown:
|
|
|
13
13
|
preview: "Select a country"
|
|
14
14
|
tooltip:
|
|
15
15
|
type: string
|
|
16
|
+
label: Tooltip
|
|
16
17
|
description: The tooltip for the form element.
|
|
17
18
|
helper:
|
|
18
19
|
type: text
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# fieldset.twig #}
|
|
2
2
|
|
|
3
|
-
{% set baseClass =
|
|
3
|
+
{% set baseClass = 'ilo' ~ "--fieldset" %}
|
|
4
4
|
{% set wrapClass = baseClass ~ "--wrap__" ~ wrap %}
|
|
5
5
|
{% set directionClass = baseClass ~ "--direction__" ~ direction %}
|
|
6
6
|
{% set helperClass = baseClass ~ "--helper" %}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{# text-input.twig #}
|
|
2
2
|
{% extends "@components/form/formcontrol.twig" %}
|
|
3
3
|
|
|
4
|
-
{% set baseClass =
|
|
4
|
+
{% set baseClass = 'ilo' ~ "--text-input" %}
|
|
5
5
|
{% set inputClass = [baseClass] %}
|
|
6
6
|
{% if error %}
|
|
7
7
|
{% set inputClass = inputClass|merge([baseClass ~ "__error"]) %}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
prefix: prefix,
|
|
17
17
|
label: item.label,
|
|
18
18
|
content: item.content,
|
|
19
|
-
|
|
19
|
+
elementId: item.id,
|
|
20
20
|
} only %}
|
|
21
21
|
{% endfor %}
|
|
22
22
|
</ol>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
prefix: prefix,
|
|
28
28
|
label: item.label,
|
|
29
29
|
content: item.content,
|
|
30
|
-
|
|
30
|
+
elementId: item.id,
|
|
31
31
|
} only %}
|
|
32
32
|
{% endfor %}
|
|
33
33
|
</ul>
|
|
@@ -16,27 +16,27 @@ list:
|
|
|
16
16
|
required: true
|
|
17
17
|
preview:
|
|
18
18
|
- content: The International Labour Organization (ILO) was founded in 1919 as part of the League of Nations to promote workers' rights, encourage decent employment opportunities, and enhance social protection.
|
|
19
|
-
|
|
19
|
+
elementId: item1
|
|
20
20
|
- content: The ILO aims to promote rights at work, encourage decent job opportunities, enhance social protection, and strengthen dialogue on work-related issues.
|
|
21
|
-
|
|
21
|
+
elementId: item2
|
|
22
22
|
- content: The ILO advocates for social justice and internationally recognized human and labor rights.
|
|
23
|
-
|
|
23
|
+
elementId: item3
|
|
24
24
|
- content: The ILO develops international labor standards in the form of conventions and recommendations to improve working conditions and labor rights.
|
|
25
|
-
|
|
25
|
+
elementId: item4
|
|
26
26
|
- content: The ILO is unique in its tripartite structure that includes representatives from government, employer, and worker organizations.
|
|
27
|
-
|
|
27
|
+
elementId: item5
|
|
28
28
|
- content: The ILO works to eradicate child labor, targeting the worst forms of child labor through conventions and action programs.
|
|
29
|
-
|
|
29
|
+
elementId: item6
|
|
30
30
|
- content: The ILO promotes gender equality and empowers women through targeted policies and programs.
|
|
31
|
-
|
|
31
|
+
elementId: item7
|
|
32
32
|
- content: The ILO’s Decent Work agenda aims to secure fair income, safety at work, social protection, and respect for workers' rights.
|
|
33
|
-
|
|
33
|
+
elementId: item8
|
|
34
34
|
- content: The ILO provides research and data on global employment trends and labor market issues to inform policy development.
|
|
35
|
-
|
|
35
|
+
elementId: item9
|
|
36
36
|
- content: The ILO offers training and education programs to improve occupational skills and competencies.
|
|
37
|
-
|
|
37
|
+
elementId: item10
|
|
38
38
|
- content: The annual International Labor Conference is where ILO members convene to discuss and create labor standards.
|
|
39
|
-
|
|
39
|
+
elementId: item11
|
|
40
40
|
settings:
|
|
41
41
|
ordered:
|
|
42
42
|
type: select
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
|
-
{% set inputClass =
|
|
6
|
-
{% set baseClass =
|
|
5
|
+
{% set inputClass = 'ilo' ~ '--input' %}
|
|
6
|
+
{% set baseClass = 'ilo' ~ '--numberpicker' %}
|
|
7
7
|
{% set hasError = not disabled and error %}
|
|
8
8
|
{% set numberPickerClasses = [inputClass, baseClass] %}
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
|
-
{% set baseClass = (prefix is defined ?
|
|
5
|
+
{% set baseClass = (prefix is defined ? 'ilo' ~ "--radio" : "--radio") %}
|
|
6
6
|
{% set controlClass = baseClass ~ "--control" %}
|
|
7
7
|
|
|
8
8
|
{% set errorClass = baseClass ~ "__error" %}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
|
-
{% set baseClass =
|
|
5
|
+
{% set baseClass = 'ilo' ~ "--searchfield" %}
|
|
6
6
|
{% set searchClass = [baseClass, class] %}
|
|
7
|
-
{% set inputClass =
|
|
7
|
+
{% set inputClass = 'ilo' ~ "--input" %}
|
|
8
8
|
{% set buttonClass = baseClass ~ "--button" %}
|
|
9
|
-
{% set fieldSetClass =
|
|
9
|
+
{% set fieldSetClass = 'ilo' ~ "--fieldset" %}
|
|
10
10
|
{% set clearButtonClass = baseClass ~ "--clear-button" %}
|
|
11
11
|
|
|
12
12
|
{% if error %}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
tag:
|
|
2
|
+
namespace: Components/Navigation
|
|
2
3
|
use: "@components/tags/tag.twig"
|
|
3
4
|
label: Tag
|
|
4
|
-
description: A display
|
|
5
|
+
description: A display an interactive tag
|
|
5
6
|
fields:
|
|
6
7
|
content:
|
|
7
8
|
type: text
|
|
@@ -9,7 +10,7 @@ tag:
|
|
|
9
10
|
description: The tag text content.
|
|
10
11
|
preview:
|
|
11
12
|
faker: lorem.word
|
|
12
|
-
|
|
13
|
+
elementId:
|
|
13
14
|
type: text
|
|
14
15
|
label: ID
|
|
15
16
|
description: The tag's id.
|
|
@@ -32,7 +33,7 @@ tag:
|
|
|
32
33
|
preview: "false"
|
|
33
34
|
required: false
|
|
34
35
|
tagType:
|
|
35
|
-
type:
|
|
36
|
+
type: select
|
|
36
37
|
label: Tag Type
|
|
37
38
|
description: The type of tag. Anchor and button have potential user interactions where display is static.
|
|
38
39
|
options:
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
#}
|
|
4
4
|
{% if tagType == "button" and defaultActive %}
|
|
5
5
|
<li class="ilo--tags__item">
|
|
6
|
-
<button class="ilo--tag ilo--tag--button ilo--tag--active icon__position--right" id="{{
|
|
6
|
+
<button class="ilo--tag ilo--tag--button ilo--tag--active icon__position--right" id="{{ elementId }}" data-active={{ defaultActive }} type="button">
|
|
7
7
|
{{content}}
|
|
8
8
|
<span class="ilo--icon" title="Remove"></span>
|
|
9
9
|
</button>
|
|
10
10
|
</li>
|
|
11
11
|
{% elseif tagType == "reset" %}
|
|
12
12
|
<li class="ilo--tags__item">
|
|
13
|
-
<button class="ilo--tag ilo--tag--reset ilo--tag--active" id="{{
|
|
13
|
+
<button class="ilo--tag ilo--tag--reset ilo--tag--active" id="{{ elementId }}" data-active={{ defaultActive }} type="button">
|
|
14
14
|
{{content}}
|
|
15
15
|
</button>
|
|
16
16
|
</li>
|
|
17
17
|
{% elseif tagType == "anchor" %}
|
|
18
18
|
<li class="ilo--tags__item">
|
|
19
|
-
<a class="ilo--tag ilo--tag--anchor {% if defaultActive %} ilo--tag--active{% endif %}" href="{{ url }}" id="{{
|
|
19
|
+
<a class="ilo--tag ilo--tag--anchor {% if defaultActive %} ilo--tag--active{% endif %}" href="{{ url }}" id="{{ elementId }}" data-active={{ defaultActive }}>
|
|
20
20
|
{{content}}
|
|
21
21
|
</a>
|
|
22
22
|
</li>
|
|
23
23
|
{% elseif tagType == "display" %}
|
|
24
24
|
<li class="ilo--tags__item">
|
|
25
|
-
<span class="ilo--tag {% if defaultActive %} ilo--tag--active{% endif %}" id="{{
|
|
25
|
+
<span class="ilo--tag {% if defaultActive %} ilo--tag--active{% endif %}" id="{{ elementId }}" data-active={{ defaultActive }}>
|
|
26
26
|
{{content}}
|
|
27
27
|
</span>
|
|
28
28
|
</li>
|
|
@@ -11,15 +11,15 @@ tags:
|
|
|
11
11
|
required: true
|
|
12
12
|
preview:
|
|
13
13
|
- content: content 1
|
|
14
|
-
|
|
14
|
+
elementId: tag1
|
|
15
15
|
defaultActive: true
|
|
16
16
|
url: https://www.google.com/
|
|
17
17
|
- content: content 2
|
|
18
|
-
|
|
18
|
+
elementId: tag2
|
|
19
19
|
defaultActive: true
|
|
20
20
|
url: https://www.google.com/
|
|
21
21
|
- content: content 3
|
|
22
|
-
|
|
22
|
+
elementId: tag3
|
|
23
23
|
defaultActive: false
|
|
24
24
|
settings:
|
|
25
25
|
allowMultipleActive:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
|
-
{% set baseClass =
|
|
5
|
+
{% set baseClass = 'ilo' ~ '--textarea' %}
|
|
6
6
|
{% set textAreaClass = [baseClass] %}
|
|
7
7
|
{% if error %}
|
|
8
8
|
{% set textAreaClass = textAreaClass|merge([baseClass ~ "__error"]) %}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% extends "@components/form/formcontrol.twig" %}
|
|
4
4
|
|
|
5
|
-
{% set baseClass =
|
|
5
|
+
{% set baseClass = 'ilo' ~ "--text-input" %}
|
|
6
6
|
{% set inputClass = [baseClass] %}
|
|
7
7
|
{% if error %}
|
|
8
8
|
{% set inputClass = inputClass|merge([baseClass ~ "__error"]) %}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{% set ariaDescribedBy = ariaDescribedBy|default("") %}
|
|
14
14
|
|
|
15
15
|
{# Calculate dynamic classes based on the passed values. #}
|
|
16
|
-
{% set baseClass =
|
|
16
|
+
{% set baseClass = 'ilo' ~ "--input--toggle" %}
|
|
17
17
|
{% set sliderClass = baseClass ~ "--slider" %}
|
|
18
18
|
{% set toggleClass = [baseClass, class, baseClass ~ "__size__" ~ size] %}
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/twig",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Twig components for the ILO's Design System",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"videojs-youtube": "^3.0.1",
|
|
51
51
|
"@ilo-org/brand-assets": "0.5.1",
|
|
52
52
|
"@ilo-org/fonts": "0.2.1",
|
|
53
|
-
"@ilo-org/icons": "0.3.1",
|
|
54
53
|
"@ilo-org/styles": "0.16.1",
|
|
55
54
|
"@ilo-org/themes": "0.8.1",
|
|
55
|
+
"@ilo-org/icons": "0.3.1",
|
|
56
56
|
"@ilo-org/utils": "0.1.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
dropdown:
|
|
2
|
-
namespace:
|
|
2
|
+
namespace: Components/Forms
|
|
3
3
|
use: "@components/dropdown/dropdown.twig"
|
|
4
4
|
label: Dropdown
|
|
5
5
|
description: The Dropdown displays a select element with options, and is most
|
|
@@ -13,6 +13,7 @@ dropdown:
|
|
|
13
13
|
preview: "Select a country"
|
|
14
14
|
tooltip:
|
|
15
15
|
type: string
|
|
16
|
+
label: Tooltip
|
|
16
17
|
description: The tooltip for the form element.
|
|
17
18
|
helper:
|
|
18
19
|
type: text
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
prefix: prefix,
|
|
17
17
|
label: item.label,
|
|
18
18
|
content: item.content,
|
|
19
|
-
|
|
19
|
+
elementId: item.id,
|
|
20
20
|
} only %}
|
|
21
21
|
{% endfor %}
|
|
22
22
|
</ol>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
prefix: prefix,
|
|
28
28
|
label: item.label,
|
|
29
29
|
content: item.content,
|
|
30
|
-
|
|
30
|
+
elementId: item.id,
|
|
31
31
|
} only %}
|
|
32
32
|
{% endfor %}
|
|
33
33
|
</ul>
|
|
@@ -16,27 +16,27 @@ list:
|
|
|
16
16
|
required: true
|
|
17
17
|
preview:
|
|
18
18
|
- content: The International Labour Organization (ILO) was founded in 1919 as part of the League of Nations to promote workers' rights, encourage decent employment opportunities, and enhance social protection.
|
|
19
|
-
|
|
19
|
+
elementId: item1
|
|
20
20
|
- content: The ILO aims to promote rights at work, encourage decent job opportunities, enhance social protection, and strengthen dialogue on work-related issues.
|
|
21
|
-
|
|
21
|
+
elementId: item2
|
|
22
22
|
- content: The ILO advocates for social justice and internationally recognized human and labor rights.
|
|
23
|
-
|
|
23
|
+
elementId: item3
|
|
24
24
|
- content: The ILO develops international labor standards in the form of conventions and recommendations to improve working conditions and labor rights.
|
|
25
|
-
|
|
25
|
+
elementId: item4
|
|
26
26
|
- content: The ILO is unique in its tripartite structure that includes representatives from government, employer, and worker organizations.
|
|
27
|
-
|
|
27
|
+
elementId: item5
|
|
28
28
|
- content: The ILO works to eradicate child labor, targeting the worst forms of child labor through conventions and action programs.
|
|
29
|
-
|
|
29
|
+
elementId: item6
|
|
30
30
|
- content: The ILO promotes gender equality and empowers women through targeted policies and programs.
|
|
31
|
-
|
|
31
|
+
elementId: item7
|
|
32
32
|
- content: The ILO’s Decent Work agenda aims to secure fair income, safety at work, social protection, and respect for workers' rights.
|
|
33
|
-
|
|
33
|
+
elementId: item8
|
|
34
34
|
- content: The ILO provides research and data on global employment trends and labor market issues to inform policy development.
|
|
35
|
-
|
|
35
|
+
elementId: item9
|
|
36
36
|
- content: The ILO offers training and education programs to improve occupational skills and competencies.
|
|
37
|
-
|
|
37
|
+
elementId: item10
|
|
38
38
|
- content: The annual International Labor Conference is where ILO members convene to discuss and create labor standards.
|
|
39
|
-
|
|
39
|
+
elementId: item11
|
|
40
40
|
settings:
|
|
41
41
|
ordered:
|
|
42
42
|
type: select
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
#}
|
|
4
4
|
{% if tagType == "button" and defaultActive %}
|
|
5
5
|
<li class="{{prefix}}--tags__item">
|
|
6
|
-
<button class="{{prefix}}--tag {{prefix}}--tag--button {{prefix}}--tag--active icon__position--right" id="{{
|
|
6
|
+
<button class="{{prefix}}--tag {{prefix}}--tag--button {{prefix}}--tag--active icon__position--right" id="{{ elementId }}" data-active={{ defaultActive }} type="button">
|
|
7
7
|
{{content}}
|
|
8
8
|
<span class="ilo--icon" title="Remove"></span>
|
|
9
9
|
</button>
|
|
10
10
|
</li>
|
|
11
11
|
{% elseif tagType == "reset" %}
|
|
12
12
|
<li class="{{prefix}}--tags__item">
|
|
13
|
-
<button class="{{prefix}}--tag {{prefix}}--tag--reset {{prefix}}--tag--active" id="{{
|
|
13
|
+
<button class="{{prefix}}--tag {{prefix}}--tag--reset {{prefix}}--tag--active" id="{{ elementId }}" data-active={{ defaultActive }} type="button">
|
|
14
14
|
{{content}}
|
|
15
15
|
</button>
|
|
16
16
|
</li>
|
|
17
17
|
{% elseif tagType == "anchor" %}
|
|
18
18
|
<li class="{{prefix}}--tags__item">
|
|
19
|
-
<a class="{{prefix}}--tag {{prefix}}--tag--anchor {% if defaultActive %} {{prefix}}--tag--active{% endif %}" href="{{ url }}" id="{{
|
|
19
|
+
<a class="{{prefix}}--tag {{prefix}}--tag--anchor {% if defaultActive %} {{prefix}}--tag--active{% endif %}" href="{{ url }}" id="{{ elementId }}" data-active={{ defaultActive }}>
|
|
20
20
|
{{content}}
|
|
21
21
|
</a>
|
|
22
22
|
</li>
|
|
23
23
|
{% elseif tagType == "display" %}
|
|
24
24
|
<li class="{{prefix}}--tags__item">
|
|
25
|
-
<span class="{{prefix}}--tag {% if defaultActive %} {{prefix}}--tag--active{% endif %}" id="{{
|
|
25
|
+
<span class="{{prefix}}--tag {% if defaultActive %} {{prefix}}--tag--active{% endif %}" id="{{ elementId }}" data-active={{ defaultActive }}>
|
|
26
26
|
{{content}}
|
|
27
27
|
</span>
|
|
28
28
|
</li>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
tag:
|
|
2
|
+
namespace: Components/Navigation
|
|
2
3
|
use: "@components/tags/tag.twig"
|
|
3
4
|
label: Tag
|
|
4
|
-
description: A display
|
|
5
|
+
description: A display an interactive tag
|
|
5
6
|
fields:
|
|
6
7
|
content:
|
|
7
8
|
type: text
|
|
@@ -9,7 +10,7 @@ tag:
|
|
|
9
10
|
description: The tag text content.
|
|
10
11
|
preview:
|
|
11
12
|
faker: lorem.word
|
|
12
|
-
|
|
13
|
+
elementId:
|
|
13
14
|
type: text
|
|
14
15
|
label: ID
|
|
15
16
|
description: The tag's id.
|
|
@@ -32,7 +33,7 @@ tag:
|
|
|
32
33
|
preview: "false"
|
|
33
34
|
required: false
|
|
34
35
|
tagType:
|
|
35
|
-
type:
|
|
36
|
+
type: select
|
|
36
37
|
label: Tag Type
|
|
37
38
|
description: The type of tag. Anchor and button have potential user interactions where display is static.
|
|
38
39
|
options:
|
|
@@ -11,15 +11,15 @@ tags:
|
|
|
11
11
|
required: true
|
|
12
12
|
preview:
|
|
13
13
|
- content: content 1
|
|
14
|
-
|
|
14
|
+
elementId: tag1
|
|
15
15
|
defaultActive: true
|
|
16
16
|
url: https://www.google.com/
|
|
17
17
|
- content: content 2
|
|
18
|
-
|
|
18
|
+
elementId: tag2
|
|
19
19
|
defaultActive: true
|
|
20
20
|
url: https://www.google.com/
|
|
21
21
|
- content: content 3
|
|
22
|
-
|
|
22
|
+
elementId: tag3
|
|
23
23
|
defaultActive: false
|
|
24
24
|
settings:
|
|
25
25
|
allowMultipleActive:
|
|
File without changes
|