desy-html 6.1.0 → 6.3.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/README.md +2 -2
- package/docs/_global.head.njk +1 -2
- package/docs/_include.template-header.njk +0 -4
- package/docs/_macro.example-render.njk +11 -9
- package/docs/ds/_ds.example.header.njk +0 -6
- package/docs/ds/_ds.example.menu-navigation.njk +1 -1
- package/docs/ds/_ds.example.menubar-variaciones.njk +1 -2
- package/docs/ds/_ds.macro.code-snippet.njk +6 -4
- package/docs/examples-header-2.html +5 -0
- package/docs/examples-header-advanced-2.html +5 -0
- package/docs/index.html +24 -2
- package/package.json +1 -1
- package/src/css/component.form-group.css +1 -0
- package/src/js/aria/accordion.js +24 -17
- package/src/js/aria/collapsible.js +35 -0
- package/src/js/aria/disclosureMenu.js +1 -2
- package/src/js/aria/tabs.js +43 -1
- package/src/js/aria/toggle.js +25 -0
- package/src/js/aria/treeitem.js +11 -20
- package/src/js/desy-html.js +10 -1
- package/src/js/index.js +12 -0
- package/src/templates/components/accordion/_examples.accordion.njk +1 -1
- package/src/templates/components/accordion/_template.accordion.njk +6 -34
- package/src/templates/components/accordion-history/_template.accordion-history.njk +13 -30
- package/src/templates/components/button/_styles.button.css +7 -0
- package/src/templates/components/button-loader/_styles.button-loader.css +6 -0
- package/src/templates/components/checkboxes/_styles.checkboxes.css +7 -0
- package/src/templates/components/checkboxes/_template.checkboxes.njk +4 -8
- package/src/templates/components/collapsible/_template.collapsible.njk +7 -13
- package/src/templates/components/dropdown/_styles.dropdown.css +9 -2
- package/src/templates/components/footer/_examples.footer.njk +2 -2
- package/src/templates/components/footer/_template.footer.njk +1 -1
- package/src/templates/components/header/_examples.header-2.njk +536 -0
- package/src/templates/components/header/_examples.header.njk +0 -33
- package/src/templates/components/header/_template.header.njk +2 -2
- package/src/templates/components/header-advanced/_examples.header-advanced-2.njk +911 -0
- package/src/templates/components/header-advanced/_examples.header-advanced.njk +108 -48
- package/src/templates/components/header-advanced/_template.header-advanced.njk +34 -14
- package/src/templates/components/header-advanced/params.header-advanced.yaml +61 -1
- package/src/templates/components/header-mini/_template.header-mini.njk +3 -3
- package/src/templates/components/input/_styles.input.css +7 -0
- package/src/templates/components/item/_examples.item.njk +25 -0
- package/src/templates/components/item/_template.item.njk +1 -1
- package/src/templates/components/item/params.item.yaml +4 -0
- package/src/templates/components/listbox/_styles.listbox.css +12 -4
- package/src/templates/components/menu-navigation/_styles.menu-navigation.css +7 -0
- package/src/templates/components/menu-navigation/_template.menu-navigation.njk +3 -3
- package/src/templates/components/menu-navigation/params.menu-navigation.yaml +0 -5
- package/src/templates/components/menubar/_examples.menubar.njk +1 -1
- package/src/templates/components/menubar/_styles.menubar.css +12 -4
- package/src/templates/components/notification/_template.notification.njk +3 -11
- package/src/templates/components/pagination/_examples.pagination.njk +60 -0
- package/src/templates/components/pagination/_template.pagination.njk +16 -2
- package/src/templates/components/pagination/params.pagination.yaml +49 -0
- package/src/templates/components/radios/_styles.radios.css +7 -0
- package/src/templates/components/radios/_template.radios.njk +4 -8
- package/src/templates/components/select/_styles.select.css +8 -0
- package/src/templates/components/table-advanced/_template.table-advanced.njk +5 -4
- package/src/templates/components/tabs/_examples.tabs.njk +35 -1
- package/src/templates/components/tabs/_styles.tabs.css +0 -17
- package/src/templates/components/tabs/_template.tabs.njk +4 -4
- package/src/templates/components/tabs/params.tabs.yaml +5 -1
- package/src/templates/components/toggle/_examples.toggle.njk +2 -2
- package/src/templates/components/toggle/_template.toggle.njk +7 -28
- package/src/templates/components/tree/_styles.tree.css +8 -0
- package/src/templates/components/tree/_template.tree.njk +2 -2
|
@@ -24,31 +24,6 @@
|
|
|
24
24
|
-#}
|
|
25
25
|
<!-- accordion -->
|
|
26
26
|
<div
|
|
27
|
-
x-ref="accordion"
|
|
28
|
-
x-data="{
|
|
29
|
-
showAll: true,
|
|
30
|
-
buttonText: 'Mostrar todo',
|
|
31
|
-
toggleShow: function(){
|
|
32
|
-
var buttons = this.$refs.accordion.querySelectorAll('.Accordion-trigger');
|
|
33
|
-
buttons.forEach((button) => {
|
|
34
|
-
if(this.showAll == true){
|
|
35
|
-
if(button.getAttribute('aria-expanded') == 'false'){
|
|
36
|
-
button.click();
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
if(button.getAttribute('aria-expanded') == 'true'){
|
|
40
|
-
button.click();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
this.showAll = !this.showAll;
|
|
45
|
-
if(this.showAll) {
|
|
46
|
-
this.buttonText = 'Mostrar todo';
|
|
47
|
-
} else {
|
|
48
|
-
this.buttonText = 'Ocultar todo';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}"
|
|
52
27
|
{%- if params.classes %} class="{{ params.classes }}"{% endif %}
|
|
53
28
|
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
|
54
29
|
<div class="flex justify-between">
|
|
@@ -71,15 +46,12 @@ x-data="{
|
|
|
71
46
|
{% endif %}
|
|
72
47
|
{% if params.showControl %}
|
|
73
48
|
<button
|
|
74
|
-
x-ref="button"
|
|
75
|
-
@click="toggleShow"
|
|
76
|
-
x-text="buttonText"
|
|
77
49
|
class="ml-auto py-base text-sm text-neutral-dark underline focus:text-black focus:bg-warning-base focus:outline-none focus:shadow-outline-focus">
|
|
78
50
|
Mostrar todo
|
|
79
51
|
</button>
|
|
80
52
|
{% endif %}
|
|
81
53
|
</div>
|
|
82
|
-
<div class="
|
|
54
|
+
<div class="c-accordion" {%- if params.allowToggle == true %} data-allow-toggle{% endif %} {%- if params.allowMultiple == true %} data-allow-multiple{% endif %}>
|
|
83
55
|
{% for item in params.items %}
|
|
84
56
|
{% if item %}
|
|
85
57
|
{%- if item.id -%}
|
|
@@ -97,7 +69,7 @@ x-data="{
|
|
|
97
69
|
{% set insideContent %}
|
|
98
70
|
<button
|
|
99
71
|
id="{{ id }}-title"
|
|
100
|
-
class="
|
|
72
|
+
class="c-accordion-trigger group relative w-full py-sm font-semibold text-left cursor-pointer focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black {%- if item.disabled %} cursor-not-allowed{% endif %}"
|
|
101
73
|
aria-controls="{{ id }}"
|
|
102
74
|
{% if item.open %}
|
|
103
75
|
aria-expanded = "true"
|
|
@@ -109,14 +81,14 @@ x-data="{
|
|
|
109
81
|
{{ item.headerHtml | safe if item.headerHtml else item.headerText }}
|
|
110
82
|
<span
|
|
111
83
|
class="absolute inset-y-0 right-0 py-sm font-normal text-sm text-neutral-dark underline group-focus:text-black pointer-events-none {%- if item.disabled %} hidden{% endif %}" aria-hidden="true">
|
|
112
|
-
<span class="
|
|
84
|
+
<span class="c-accordion-show {%- if item.open %} hidden{%else%}{%endif%} {%- if item.show.classes %} {{ item.show.classes }}{%endif%}">
|
|
113
85
|
{% if item.show %}
|
|
114
86
|
{{ item.show.html | safe if item.show.html else item.show.text }}
|
|
115
87
|
{% else %}
|
|
116
88
|
Mostrar
|
|
117
89
|
{% endif %}
|
|
118
90
|
</span>
|
|
119
|
-
<span class="
|
|
91
|
+
<span class="c-accordion-hide {%- if item.open %}{%else%} hidden{%endif%} {%- if item.hide.classes %} {{ item.hide.classes }}{%endif%}">
|
|
120
92
|
{% if item.hide %}
|
|
121
93
|
{{ item.hide.html | safe if item.hide.html else item.hide.text }}
|
|
122
94
|
{% else %}
|
|
@@ -147,7 +119,7 @@ x-data="{
|
|
|
147
119
|
{%- if id %}
|
|
148
120
|
id="{{ id }}"
|
|
149
121
|
{% endif %}
|
|
150
|
-
class="
|
|
122
|
+
class="c-accordion-panel {%- if item.classes %} {{ item.classes }}{% endif %}"
|
|
151
123
|
{%- for attribute, value in item.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
|
152
124
|
{{ item.html | safe if item.html else item.text }}
|
|
153
125
|
</div>
|
|
@@ -156,4 +128,4 @@ x-data="{
|
|
|
156
128
|
{% endfor %}
|
|
157
129
|
</div>
|
|
158
130
|
</div>
|
|
159
|
-
<!-- /accordion -->
|
|
131
|
+
<!-- /accordion -->
|
|
@@ -24,34 +24,9 @@
|
|
|
24
24
|
-#}
|
|
25
25
|
<!-- accordion-history -->
|
|
26
26
|
<div
|
|
27
|
-
x-ref="accordion"
|
|
28
|
-
x-data="{
|
|
29
|
-
showAll: true,
|
|
30
|
-
buttonText: 'Mostrar todo',
|
|
31
|
-
toggleShow: function(){
|
|
32
|
-
var buttons = this.$refs.accordion.querySelectorAll('.Accordion-trigger');
|
|
33
|
-
buttons.forEach((button) => {
|
|
34
|
-
if(this.showAll == true){
|
|
35
|
-
if(button.getAttribute('aria-expanded') == 'false'){
|
|
36
|
-
button.click();
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
if(button.getAttribute('aria-expanded') == 'true'){
|
|
40
|
-
button.click();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
this.showAll = !this.showAll;
|
|
45
|
-
if(this.showAll) {
|
|
46
|
-
this.buttonText = 'Mostrar todo';
|
|
47
|
-
} else {
|
|
48
|
-
this.buttonText = 'Ocultar todo';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}"
|
|
52
27
|
{%- if params.classes %} class="{{ params.classes }}"{% endif %}
|
|
53
28
|
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
|
54
|
-
|
|
29
|
+
<div class="flex justify-between">
|
|
55
30
|
{% if params.heading.html or params.heading.text %}
|
|
56
31
|
{% set headingAttributes %}class="{% if params.heading.classes %}{{ params.heading.classes }}{% else %}c-h2 mb-base{% endif %}"{% endset %}
|
|
57
32
|
{% set headingContent %}{{ params.heading.html | safe if params.heading.html else params.heading.text }}{% endset %}
|
|
@@ -71,9 +46,6 @@ x-data="{
|
|
|
71
46
|
{% endif %}
|
|
72
47
|
{% if params.showControl %}
|
|
73
48
|
<button
|
|
74
|
-
x-ref="button"
|
|
75
|
-
@click="toggleShow"
|
|
76
|
-
x-text="buttonText"
|
|
77
49
|
class="ml-auto py-base text-sm text-neutral-dark underline focus:text-black focus:bg-warning-base focus:outline-none focus:shadow-outline-focus">
|
|
78
50
|
Mostrar todo
|
|
79
51
|
</button>
|
|
@@ -107,6 +79,17 @@ x-data="{
|
|
|
107
79
|
{% if item.disabled %} disabled{% endif %}
|
|
108
80
|
>
|
|
109
81
|
{{ item.headerHtml | safe if item.headerHtml else item.headerText }}
|
|
82
|
+
{% if item.status == 'current' %}
|
|
83
|
+
<span class="sr-only">(Estado: actual) </span>
|
|
84
|
+
{% elseif item.status == 'pending' %}
|
|
85
|
+
<span class="sr-only">(Estado: pendiente) </span>
|
|
86
|
+
{% elseif item.status == 'muted' %}
|
|
87
|
+
<span class="sr-only">(Estado: pasado) </span>
|
|
88
|
+
{% elseif item.status == 'currentmuted' %}
|
|
89
|
+
<span class="sr-only">(Estado: actual) </span>
|
|
90
|
+
{% else %}
|
|
91
|
+
<span class="sr-only">(Estado: pasado) </span>
|
|
92
|
+
{% endif %}
|
|
110
93
|
<span
|
|
111
94
|
class="absolute inset-y-0 right-0 py-sm font-normal text-sm text-neutral-dark underline group-focus:text-black pointer-events-none {%- if item.disabled %} hidden{% endif %}" aria-hidden="true">
|
|
112
95
|
<span class="Accordion-show {%- if item.open %} hidden{%else%}{%endif%} {%- if item.show.classes %} {{ item.show.classes }}{%endif%}">
|
|
@@ -206,4 +189,4 @@ x-data="{
|
|
|
206
189
|
{% endfor %}
|
|
207
190
|
</div>
|
|
208
191
|
</div>
|
|
209
|
-
<!-- /accordion-history -->
|
|
192
|
+
<!-- /accordion-history -->
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
========================================================================== */
|
|
4
4
|
|
|
5
5
|
@layer components {
|
|
6
|
+
.c-checkboxes--base {
|
|
7
|
+
input[type="checkbox"] {
|
|
8
|
+
@apply w-6;
|
|
9
|
+
@apply h-6;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
.c-checkboxes--sm {
|
|
7
14
|
input[type="checkbox"] {
|
|
8
15
|
@apply w-base !important;
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
{% set itemHintId = id + "-item-hint" if hasHint else "" %}
|
|
71
71
|
{% set itemDescribedBy = describedBy if not hasFieldset else "" %}
|
|
72
72
|
{% set itemDescribedBy = (itemDescribedBy + " " + itemHintId) | trim %}
|
|
73
|
-
<div
|
|
73
|
+
<div class="{%- if params.hasDividers %} border-t border-b border-neutral-base -mb-px{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %}">
|
|
74
74
|
<div class="relative flex items-start py-base">
|
|
75
75
|
<div class="flex items-center mx-sm">
|
|
76
|
-
<input
|
|
76
|
+
<input class="w-6 h-6 transition duration-150 ease-in-out border-black focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-offset-0 focus:ring-warning-base disabled:bg-neutral-base disabled:border-neutral-base text-primary-base" id="{{ id }}" name="{{ name }}" type="checkbox" value="{{ item.value }}"
|
|
77
77
|
{{-" checked" if item.checked }}
|
|
78
78
|
{{-" disabled" if item.disabled }}
|
|
79
79
|
{%- if item.conditional.html %} aria-controls="{{ conditionalId }}"{% endif -%}
|
|
@@ -102,11 +102,7 @@
|
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
{% if item.conditional.html %}
|
|
105
|
-
<div
|
|
106
|
-
x-transition:enter="transition ease-out duration-100 transform"
|
|
107
|
-
x-transition:enter-start="opacity-0 scale-95"
|
|
108
|
-
x-transition:enter-end="opacity-100 scale-100"
|
|
109
|
-
class="mb-base ml-5 py-sm pl-6 origin-top-left border-l-2 border-primary-base" id="{{ conditionalId }}">
|
|
105
|
+
<div class="mb-base ml-5 py-sm pl-6 origin-top-left border-l-2 border-primary-base" id="{{ conditionalId }}">
|
|
110
106
|
{{ item.conditional.html | safe }}
|
|
111
107
|
</div>
|
|
112
108
|
{% endif %}
|
|
@@ -133,4 +129,4 @@
|
|
|
133
129
|
{{ innerHtml | trim | safe }}
|
|
134
130
|
{% endif %}
|
|
135
131
|
</div>
|
|
136
|
-
<!-- /checkboxes -->
|
|
132
|
+
<!-- /checkboxes -->
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
<!-- collapsible -->
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
x-transition:enter="transition ease-out duration-100 transform"
|
|
9
|
-
x-transition:enter-start="opacity-0 scale-y-95"
|
|
10
|
-
x-transition:enter-end="opacity-100 scale-y-100"
|
|
11
|
-
x-transition:leave="transition ease-in duration-75 transform"
|
|
12
|
-
x-transition:leave-start="opacity-100 scale-y-100"
|
|
13
|
-
x-transition:leave-end="opacity-0 scale-y-95" class="py-sm">
|
|
2
|
+
<div class="{%- if params.classes %} {{ params.classes }}{% else -%} -my-px py-sm border-t border-b border-neutral-base{% endif %} c-collapsible" {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
|
3
|
+
<button aria-expanded="false" {%- if params.id %} id="{{params.id}}-title"{% endif %} class="group relative w-full py-sm font-semibold text-left cursor-pointer focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black" {%- if params.id %} aria-controls="{{params.id}}"{% endif %}>{{ params.headerHtml | safe if params.headerHtml else params.headerText }}
|
|
4
|
+
<span class="c-collapsible__show absolute inset-y-0 right-0 py-sm font-normal text-sm text-neutral-dark underline group-focus:text-black pointer-events-none " aria-hidden="false">Mostrar</span>
|
|
5
|
+
<span class="c-collapsible__hide absolute inset-y-0 right-0 py-sm font-normal text-sm text-neutral-dark underline group-focus:text-black pointer-events-none hidden" aria-hidden="true">Ocultar</span>
|
|
6
|
+
</button>
|
|
7
|
+
<div aria-hidden="true" class="c-collapsible__content hidden py-sm" {%- if params.id %} id="{{params.id}}"{% endif %}
|
|
14
8
|
{% if params.html %}
|
|
15
9
|
{{ params.html | safe }}
|
|
16
10
|
{% else %}
|
|
@@ -20,4 +14,4 @@
|
|
|
20
14
|
{% endif %}
|
|
21
15
|
</div>
|
|
22
16
|
</div>
|
|
23
|
-
<!-- /collapsible -->
|
|
17
|
+
<!-- /collapsible -->
|
|
@@ -62,6 +62,13 @@
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
|
|
65
|
+
.c-dropdown--base {
|
|
66
|
+
@apply px-3;
|
|
67
|
+
@apply py-2;
|
|
68
|
+
@apply text-base;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
65
72
|
.c-dropdown--sm {
|
|
66
73
|
@apply px-2;
|
|
67
74
|
@apply py-1;
|
|
@@ -151,7 +158,7 @@
|
|
|
151
158
|
|
|
152
159
|
|
|
153
160
|
.c-dropdown--header {
|
|
154
|
-
@apply bg-
|
|
161
|
+
@apply bg-transparent;
|
|
155
162
|
@apply border-none;
|
|
156
163
|
@apply rounded-none;
|
|
157
164
|
@apply shadow-none;
|
|
@@ -162,7 +169,7 @@
|
|
|
162
169
|
&:hover:not(disabled),
|
|
163
170
|
&:active:not(disabled),
|
|
164
171
|
&.ds-hover:not(disabled) {
|
|
165
|
-
@apply bg-
|
|
172
|
+
@apply bg-transparent;
|
|
166
173
|
@apply border-none;
|
|
167
174
|
@apply shadow-none;
|
|
168
175
|
@apply text-black;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"description": "Substitute default text for custom one",
|
|
63
63
|
"data": {
|
|
64
64
|
"description": {
|
|
65
|
-
"html": '<div><p>Copyright © AST. Aragonesa de Servicios Telemáticos.</p></div><div><p>Avda. Ranillas 3A. Planta 3
|
|
65
|
+
"html": '<div><p>Copyright © AST. Aragonesa de Servicios Telemáticos.</p></div><div><p>Avda. Ranillas 3A. Planta 3ª. Oficina J. 50018 Zaragoza. Teléfono: 976 714 495. <a href="mailto:ast@aragon.es" class="c-link c-link--neutral">ast@aragon.es</a></p></div>'
|
|
66
66
|
},
|
|
67
67
|
"classes": "lg:mt-48"
|
|
68
68
|
}
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"data": {
|
|
116
116
|
"noLogo": true,
|
|
117
117
|
"description": {
|
|
118
|
-
"html": '<p>Copyright © AST. Aragonesa de Servicios Telemáticos.</p><p>Avda. Ranillas 3A. Planta 3ª
|
|
118
|
+
"html": '<p>Copyright © AST. Aragonesa de Servicios Telemáticos.</p><p>Avda. Ranillas 3A. Planta 3ª Oficina J. 50018 Zaragoza. Teléfono: 976 714 495. <a href="mailto:ast@aragon.es" class="c-link c-link--neutral">ast@aragon.es</a></p>'
|
|
119
119
|
},
|
|
120
120
|
"classes": "lg:mt-48"
|
|
121
121
|
}
|
|
@@ -73,7 +73,7 @@ text-neutral-dark {{ params.classes if params.classes }}"
|
|
|
73
73
|
<a
|
|
74
74
|
class="c-link c-link--neutral"
|
|
75
75
|
href="https://www.aragon.es/"
|
|
76
|
-
>Gobierno de Aragón</a>. Edificio Pignatelli. <abbr title
|
|
76
|
+
>Gobierno de Aragón</a>. Edificio Pignatelli. <abbr title="Paseo">Pº</abbr> María Agustín, 36. 50004 - Zaragoza - <abbr title="Teléfono">Tel.</abbr> <a href="tel:+976714000" class="c-link c-link--neutral">976 714 000</a>
|
|
77
77
|
</p>
|
|
78
78
|
</div>
|
|
79
79
|
{% endif %}
|