desy-html 11.2.0 → 12.0.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/docs/_global.foot.njk +1 -1
- package/docs/_macro.example-render.njk +62 -18
- package/docs/ds/_ds.section.textos.njk +1 -1
- package/docs/index.html +10 -0
- package/docs/pagina-prueba.html +2 -2
- package/package.json +2 -2
- package/src/css/component.text.css +0 -1
- package/src/js/aria/utils.js +80 -15
- package/src/js/desy-html.js +239 -196
- package/src/js/filters/filter-caller.js +4 -2
- package/src/js/filters/filter-escape-ltgt.js +7 -0
- package/src/js/filters/filter-quotes.js +50 -0
- package/src/js/filters/filter-version.js +8 -0
- package/src/js/filters/index.js +7 -1
- package/src/templates/components/accordion/_examples.accordion.njk +107 -107
- package/src/templates/components/accordion/_template.accordion.njk +5 -5
- package/src/templates/components/accordion-history/_examples.accordion-history.njk +119 -119
- package/src/templates/components/accordion-history/_template.accordion-history.njk +11 -11
- package/src/templates/components/alert/_examples.alert.njk +2 -2
- package/src/templates/components/breadcrumbs/_examples.breadcrumbs.njk +4 -4
- package/src/templates/components/breadcrumbs/_template.breadcrumbs.njk +4 -4
- package/src/templates/components/button/_examples.button.njk +19 -19
- package/src/templates/components/button/_template.button.njk +2 -2
- package/src/templates/components/button-loader/_examples.button-loader.njk +17 -17
- package/src/templates/components/button-loader/_template.button-loader.njk +2 -2
- package/src/templates/components/card/_examples.card.njk +3 -3
- package/src/templates/components/card/_template.card.njk +4 -4
- package/src/templates/components/character-count/_examples.character-count.njk +2 -2
- package/src/templates/components/checkboxes/_examples.checkboxes.njk +6 -6
- package/src/templates/components/checkboxes/_template.checkboxes.njk +2 -2
- package/src/templates/components/collapsible/_examples.collapsible.njk +4 -4
- package/src/templates/components/collapsible/_template.collapsible.njk +1 -1
- package/src/templates/components/date-input/_template.date-input.njk +1 -1
- package/src/templates/components/datepicker/_examples.datepicker.njk +45 -62
- package/src/templates/components/datepicker/_styles.datepicker.css +4 -0
- package/src/templates/components/datepicker/_template.datepicker.njk +10 -2
- package/src/templates/components/description-list/_examples.description-list.njk +3 -3
- package/src/templates/components/description-list/_template.description-list.njk +2 -2
- package/src/templates/components/details/_examples.details.njk +3 -3
- package/src/templates/components/details/_template.details.njk +1 -1
- package/src/templates/components/dialog/_examples.dialog.njk +4 -4
- package/src/templates/components/dropdown/_examples.dropdown.njk +31 -17
- package/src/templates/components/dropdown/_template.dropdown.njk +1 -1
- package/src/templates/components/error-message/_examples.error-message.njk +1 -1
- package/src/templates/components/error-message/_template.error-message.njk +1 -1
- package/src/templates/components/error-summary/_template.error-summary.njk +2 -2
- package/src/templates/components/fieldset/_examples.fieldset.njk +3 -3
- package/src/templates/components/fieldset/_template.fieldset.njk +7 -7
- package/src/templates/components/footer/_examples.footer.njk +32 -32
- package/src/templates/components/footer/_template.footer.njk +6 -6
- package/src/templates/components/header/_examples.header.njk +14 -8
- package/src/templates/components/header/_template.header.header__navigation.njk +2 -2
- package/src/templates/components/header/_template.header.header__offcanvasButton.njk +1 -1
- package/src/templates/components/header/_template.header.header__subnav.njk +1 -1
- package/src/templates/components/header/_template.header.njk +2 -2
- package/src/templates/components/header-advanced/_examples.header-advanced.njk +14 -8
- package/src/templates/components/header-advanced/_template.header-advanced.njk +3 -3
- package/src/templates/components/header-mini/_examples.header-mini.njk +3 -3
- package/src/templates/components/header-mini/_template.header-mini.njk +2 -2
- package/src/templates/components/hint/_examples.hint.njk +1 -1
- package/src/templates/components/hint/_template.hint.njk +1 -1
- package/src/templates/components/input/_examples.input.njk +7 -7
- package/src/templates/components/input-group/_examples.input-group.njk +1 -1
- package/src/templates/components/input-group/_template.input-group.njk +1 -1
- package/src/templates/components/item/_examples.item.njk +23 -23
- package/src/templates/components/item/_template.item.njk +9 -9
- package/src/templates/components/label/_examples.label.njk +2 -2
- package/src/templates/components/label/_template.label.njk +1 -1
- package/src/templates/components/links-list/_examples.links-list.njk +29 -32
- package/src/templates/components/links-list/_template.links-list.njk +11 -11
- package/src/templates/components/listbox/_examples.listbox.njk +16 -16
- package/src/templates/components/listbox/_template.listbox.njk +3 -3
- package/src/templates/components/media-object/_examples.media-object.njk +5 -5
- package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +16 -16
- package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +2 -2
- package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +6 -6
- package/src/templates/components/menu-navigation/_template.menu-navigation.njk +4 -4
- package/src/templates/components/menu-vertical/_examples.menu-vertical.njk +8 -8
- package/src/templates/components/menu-vertical/_template.menu-vertical.njk +9 -9
- package/src/templates/components/menubar/_examples.menubar.njk +16 -16
- package/src/templates/components/menubar/_template.menubar.njk +7 -7
- package/src/templates/components/modal/_examples.modal.njk +18 -18
- package/src/templates/components/modal/_template.modal.njk +8 -8
- package/src/templates/components/nav/_examples.nav.njk +7 -7
- package/src/templates/components/nav/_template.nav.njk +2 -2
- package/src/templates/components/notification/_examples.notification.njk +9 -9
- package/src/templates/components/notification/_template.notification.njk +11 -11
- package/src/templates/components/pagination/_examples.pagination.njk +6 -6
- package/src/templates/components/pagination/_template.pagination.njk +3 -3
- package/src/templates/components/pill/_examples.pill.njk +8 -8
- package/src/templates/components/pill/_template.pill.njk +3 -3
- package/src/templates/components/radios/_examples.radios.njk +2 -2
- package/src/templates/components/radios/_template.radios.njk +1 -1
- package/src/templates/components/select/_examples.select.njk +1 -1
- package/src/templates/components/skip-link/_examples.skip-link.njk +1 -1
- package/src/templates/components/skip-link/_template.skip-link.njk +1 -1
- package/src/templates/components/status/_examples.status.njk +1 -1
- package/src/templates/components/status/_template.status.njk +1 -1
- package/src/templates/components/status-item/_examples.status-item.njk +15 -15
- package/src/templates/components/status-item/_template.status-item.njk +3 -3
- package/src/templates/components/table/_examples.table.njk +3 -3
- package/src/templates/components/table/_template.table.njk +2 -2
- package/src/templates/components/table-advanced/_examples.table-advanced.njk +7 -7
- package/src/templates/components/table-advanced/_template.table-advanced.njk +5 -5
- package/src/templates/components/tabs/_examples.tabs.njk +19 -19
- package/src/templates/components/tabs/_styles.tabs.css +2 -2
- package/src/templates/components/tabs/_template.tabs.njk +7 -7
- package/src/templates/components/textarea/_examples.textarea.njk +2 -2
- package/src/templates/components/toggle/_examples.toggle.njk +29 -29
- package/src/templates/components/toggle/_template.toggle.njk +2 -2
- package/src/templates/components/tooltip/_examples.tooltip.njk +11 -11
- package/src/templates/components/tooltip/_template.tooltip.njk +3 -3
- package/src/templates/components/tree/_examples.tree.njk +12 -60
- package/src/templates/components/tree/_template.tree.njk +4 -4
- package/src/templates/includes/_test-include.njk +2 -2
- package/src/templates/pages/_page.footer.njk +1 -1
- package/src/templates/pages/_template.logged-selector-subheader.njk +1 -1
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
{% set examples = [
|
|
3
3
|
{
|
|
4
4
|
"name": "por defecto",
|
|
5
|
-
"description":
|
|
5
|
+
"description": "Apariencia de botón, sin cambio en el texto del botón, sólo cambia su estado visual. Necesita un elemento externo con un <code>id</code> para referenciarlo con su <code>aria-controls</code> para mostrar/ocultar ese elemento externo.",
|
|
6
6
|
"data": {
|
|
7
7
|
"id": "toggle-default",
|
|
8
8
|
"classes": "c-button",
|
|
9
9
|
"offState": {
|
|
10
10
|
"classes": "",
|
|
11
|
-
"html":
|
|
11
|
+
"html": "Mostrar detalles"
|
|
12
12
|
},
|
|
13
13
|
"onState": {
|
|
14
14
|
"classes": "c-button--has-selection",
|
|
15
|
-
"html":
|
|
15
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M13.714 42.857A6.857 6.857 0 0 1 8.4 40.183L.857 31.646a3.429 3.429 0 0 1 .309-4.869A3.429 3.429 0 0 1 6 27.12l7.063 7.989a.72.72 0 0 0 .617.308.789.789 0 0 0 .617-.274L42.103 6.206a3.429 3.429 0 0 1 4.937 4.731L18.926 40.526a6.651 6.651 0 0 1-5.212 2.331Z' fill='currentColor'/></svg>Mostrar detalles</span>"
|
|
16
16
|
},
|
|
17
17
|
"attributes": {
|
|
18
18
|
"aria-controls": "id-panel-oculto"
|
|
@@ -21,33 +21,33 @@
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"name": "Expandir con JavaScript",
|
|
24
|
-
"description":
|
|
24
|
+
"description": "También puedes usar con javascript la función global <code>activateItemToggle(element, open)</code>, para expandir un item , usando su id, el parámetro <code>open</code> admite <code>true</code> o <code>false</code>, si le pasamos true se mostrará expandido, y si le pasamos false se mostrará cerrado. Ej: Abre la consola del navegador y escribe <code>activateItemToggle('toggle-expanded-js', true)</code> para mostrar el item actual expandido.",
|
|
25
25
|
"data": {
|
|
26
26
|
"classes": "c-button",
|
|
27
27
|
"id": "toggle-expanded-js",
|
|
28
28
|
"offState": {
|
|
29
29
|
"classes": "",
|
|
30
|
-
"html":
|
|
30
|
+
"html": "Mostrar detalles"
|
|
31
31
|
},
|
|
32
32
|
"onState": {
|
|
33
33
|
"classes": "c-button--has-selection",
|
|
34
|
-
"html":
|
|
34
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M13.714 42.857A6.857 6.857 0 0 1 8.4 40.183L.857 31.646a3.429 3.429 0 0 1 .309-4.869A3.429 3.429 0 0 1 6 27.12l7.063 7.989a.72.72 0 0 0 .617.308.789.789 0 0 0 .617-.274L42.103 6.206a3.429 3.429 0 0 1 4.937 4.731L18.926 40.526a6.651 6.651 0 0 1-5.212 2.331Z' fill='currentColor'/></svg>Mostrar detalles</span>"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"name": "2 iconos",
|
|
40
|
-
"description":
|
|
40
|
+
"description": "Apariencia de botón, sin cambio en el texto del botón, sólo cambian sus iconos. Necesita un elemento externo con un <code>id</code> para referenciarlo con su <code>aria-controls</code> para mostrar/ocultar ese elemento externo.",
|
|
41
41
|
"data": {
|
|
42
42
|
"id": "toggle-2-icons",
|
|
43
43
|
"classes": "c-button c-button--sm",
|
|
44
44
|
"offState": {
|
|
45
45
|
"classes": "",
|
|
46
|
-
"html":
|
|
46
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' focusable='false' width='1em' height='1em'><path d='M13.71 2.3a1.45 1.45 0 0 0 .14-1.51A1.41 1.41 0 0 0 12.57 0H1.43A1.4 1.4 0 0 0 .15.8a1.43 1.43 0 0 0 .16 1.52l5.13 6.32a.25.25 0 0 1 .06.16v4.7a.5.5 0 0 0 .31.46A.43.43 0 0 0 6 14a.47.47 0 0 0 .35-.15l2-2a.47.47 0 0 0 .15-.35V8.8a.25.25 0 0 1 .06-.16ZM7.6 6.65a.29.29 0 0 1-.2.09h-.8a.29.29 0 0 1-.2-.09L3 2.41a.26.26 0 0 1 0-.27.26.26 0 0 1 .15-.14h7.7a.26.26 0 0 1 .22.14.26.26 0 0 1 0 .27Z' fill='currentColor' transform='scale(3.42857)'/></svg>Mostrar filtros</span>"
|
|
47
47
|
},
|
|
48
48
|
"onState": {
|
|
49
49
|
"classes": "c-button--has-selection",
|
|
50
|
-
"html":
|
|
50
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' focusable='false' width='1em' height='1em'><path d='M13.9.8a.51.51 0 0 0 0-.52.51.51 0 0 0-.4-.28H.5a.51.51 0 0 0-.45.28A.51.51 0 0 0 .1.8l5.19 6.79a1 1 0 0 1 .21.61v5.3a.5.5 0 0 0 .31.46A.43.43 0 0 0 6 14a.47.47 0 0 0 .35-.15l2-2a.47.47 0 0 0 .15-.35V8.2a1 1 0 0 1 .21-.61Z' fill='currentColor' transform='scale(3.42857)'/></svg>Mostrar filtros</span>"
|
|
51
51
|
},
|
|
52
52
|
"attributes": {
|
|
53
53
|
"aria-controls": "id-panel-oculto"
|
|
@@ -56,69 +56,69 @@
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"name": "no expandible",
|
|
59
|
-
"description":
|
|
59
|
+
"description": "Usa <code>'isExpandible': false</code>. En lugar de usar <code>aria-expanded</code> usará <code>aria-pressed</code>.",
|
|
60
60
|
"data": {
|
|
61
61
|
"id": "toggle-not-expandible",
|
|
62
62
|
"isExpandible": false,
|
|
63
63
|
"classes": "c-button",
|
|
64
64
|
"offState": {
|
|
65
65
|
"classes": "",
|
|
66
|
-
"html":
|
|
66
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M6.41 10.78a.25.25 0 0 0 0 .34l2.16 2.41a1.35 1.35 0 0 0 .8.27 1.31 1.31 0 0 0 1.31-1.31V7.12a.26.26 0 0 0-.43-.18ZM.26 13.81a.76.76 0 0 0 1 0l12.5-12.5a.76.76 0 0 0 .18-.31.71.71 0 0 0 .06-.24.73.73 0 0 0-.19-.49.74.74 0 0 0-1.06 0l-2 2a.26.26 0 0 1-.19.07.25.25 0 0 1-.18-.08 1.23 1.23 0 0 0-1-.45 1.29 1.29 0 0 0-.8.27L5.74 5.21a.23.23 0 0 1-.19.09H4.42a1.75 1.75 0 0 0-1.75 1.75v1.5A1.78 1.78 0 0 0 3 9.61a.25.25 0 0 1 0 .33L.22 12.73a.75.75 0 0 0 0 1.06Z' fill='currentColor' transform='scale(3.42857)'/></svg>Reproducir sonido</span>"
|
|
67
67
|
},
|
|
68
68
|
"onState": {
|
|
69
69
|
"classes": "c-button--has-selection",
|
|
70
|
-
"html":
|
|
70
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M12 2.21a.75.75 0 0 0-1.06 0 .75.75 0 0 0 0 1.06 5.26 5.26 0 0 1 0 7.46.75.75 0 0 0 0 1.06.75.75 0 0 0 1.06 0 6.74 6.74 0 0 0 0-9.58Z' fill='currentColor' transform='scale(3.42857)'/><path d='M10.34 4.89a.75.75 0 0 0-1.23.85 2.23 2.23 0 0 1 0 2.52.74.74 0 0 0 .19 1 .75.75 0 0 0 1-.19 3.7 3.7 0 0 0 0-4.22ZM6.69 1a1.35 1.35 0 0 0-.8.27L3.07 4.42a.27.27 0 0 1-.19.08H1.75A1.76 1.76 0 0 0 0 6.25v1.5A1.76 1.76 0 0 0 1.75 9.5h1.13a.27.27 0 0 1 .19.08l2.82 3.15a1.35 1.35 0 0 0 .8.27A1.31 1.31 0 0 0 8 11.69V2.31A1.31 1.31 0 0 0 6.69 1Z' fill='currentColor' transform='scale(3.42857)'/></svg>Reproducir sonido</span>"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"name": "Pressed con Javascript",
|
|
76
|
-
"description":
|
|
76
|
+
"description": "También puedes usar con javascript la función global <code>activateItemToggle(element, toggle)</code>, para expandir un item , usando su id, el parámetro <code>toggle</code> admite <code>true</code> o <code>false</code>, si le pasamos true se mostrará expandido, y si le pasamos false se mostrará cerrado. Ej: Abre la consola del navegador y escribe <code>activateItemToggle('toggle-pressed-js', true)</code> para mostrar el item actual expandido.",
|
|
77
77
|
"data": {
|
|
78
78
|
"isExpandible": false,
|
|
79
79
|
"classes": "c-button",
|
|
80
80
|
"id": "toggle-pressed-js",
|
|
81
81
|
"offState": {
|
|
82
82
|
"classes": "",
|
|
83
|
-
"html":
|
|
83
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M6.41 10.78a.25.25 0 0 0 0 .34l2.16 2.41a1.35 1.35 0 0 0 .8.27 1.31 1.31 0 0 0 1.31-1.31V7.12a.26.26 0 0 0-.43-.18ZM.26 13.81a.76.76 0 0 0 1 0l12.5-12.5a.76.76 0 0 0 .18-.31.71.71 0 0 0 .06-.24.73.73 0 0 0-.19-.49.74.74 0 0 0-1.06 0l-2 2a.26.26 0 0 1-.19.07.25.25 0 0 1-.18-.08 1.23 1.23 0 0 0-1-.45 1.29 1.29 0 0 0-.8.27L5.74 5.21a.23.23 0 0 1-.19.09H4.42a1.75 1.75 0 0 0-1.75 1.75v1.5A1.78 1.78 0 0 0 3 9.61a.25.25 0 0 1 0 .33L.22 12.73a.75.75 0 0 0 0 1.06Z' fill='currentColor' transform='scale(3.42857)'/></svg>Reproducir sonido</span>"
|
|
84
84
|
},
|
|
85
85
|
"onState": {
|
|
86
86
|
"classes": "c-button--has-selection",
|
|
87
|
-
"html":
|
|
87
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M12 2.21a.75.75 0 0 0-1.06 0 .75.75 0 0 0 0 1.06 5.26 5.26 0 0 1 0 7.46.75.75 0 0 0 0 1.06.75.75 0 0 0 1.06 0 6.74 6.74 0 0 0 0-9.58Z' fill='currentColor' transform='scale(3.42857)'/><path d='M10.34 4.89a.75.75 0 0 0-1.23.85 2.23 2.23 0 0 1 0 2.52.74.74 0 0 0 .19 1 .75.75 0 0 0 1-.19 3.7 3.7 0 0 0 0-4.22ZM6.69 1a1.35 1.35 0 0 0-.8.27L3.07 4.42a.27.27 0 0 1-.19.08H1.75A1.76 1.76 0 0 0 0 6.25v1.5A1.76 1.76 0 0 0 1.75 9.5h1.13a.27.27 0 0 1 .19.08l2.82 3.15a1.35 1.35 0 0 0 .8.27A1.31 1.31 0 0 0 8 11.69V2.31A1.31 1.31 0 0 0 6.69 1Z' fill='currentColor' transform='scale(3.42857)'/></svg>Reproducir sonido</span>"
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"name": "Pressed",
|
|
93
|
-
"description":
|
|
93
|
+
"description": "Usa <code>'pressed': true</code> para activarlo inicialmente.",
|
|
94
94
|
"data": {
|
|
95
95
|
"id": "toggle-pressed",
|
|
96
96
|
"pressed": true,
|
|
97
97
|
"classes": "c-button",
|
|
98
98
|
"offState": {
|
|
99
99
|
"classes": "",
|
|
100
|
-
"html":
|
|
100
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M6.41 10.78a.25.25 0 0 0 0 .34l2.16 2.41a1.35 1.35 0 0 0 .8.27 1.31 1.31 0 0 0 1.31-1.31V7.12a.26.26 0 0 0-.43-.18ZM.26 13.81a.76.76 0 0 0 1 0l12.5-12.5a.76.76 0 0 0 .18-.31.71.71 0 0 0 .06-.24.73.73 0 0 0-.19-.49.74.74 0 0 0-1.06 0l-2 2a.26.26 0 0 1-.19.07.25.25 0 0 1-.18-.08 1.23 1.23 0 0 0-1-.45 1.29 1.29 0 0 0-.8.27L5.74 5.21a.23.23 0 0 1-.19.09H4.42a1.75 1.75 0 0 0-1.75 1.75v1.5A1.78 1.78 0 0 0 3 9.61a.25.25 0 0 1 0 .33L.22 12.73a.75.75 0 0 0 0 1.06Z' fill='currentColor' transform='scale(3.42857)'/></svg>Reproducir sonido</span>"
|
|
101
101
|
},
|
|
102
102
|
"onState": {
|
|
103
103
|
"classes": "c-button--has-selection",
|
|
104
|
-
"html":
|
|
104
|
+
"html": "<span class='inline-flex'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' class='self-center mr-2' aria-hidden='true' width='1em' height='1em'><path d='M12 2.21a.75.75 0 0 0-1.06 0 .75.75 0 0 0 0 1.06 5.26 5.26 0 0 1 0 7.46.75.75 0 0 0 0 1.06.75.75 0 0 0 1.06 0 6.74 6.74 0 0 0 0-9.58Z' fill='currentColor' transform='scale(3.42857)'/><path d='M10.34 4.89a.75.75 0 0 0-1.23.85 2.23 2.23 0 0 1 0 2.52.74.74 0 0 0 .19 1 .75.75 0 0 0 1-.19 3.7 3.7 0 0 0 0-4.22ZM6.69 1a1.35 1.35 0 0 0-.8.27L3.07 4.42a.27.27 0 0 1-.19.08H1.75A1.76 1.76 0 0 0 0 6.25v1.5A1.76 1.76 0 0 0 1.75 9.5h1.13a.27.27 0 0 1 .19.08l2.82 3.15a1.35 1.35 0 0 0 .8.27A1.31 1.31 0 0 0 8 11.69V2.31A1.31 1.31 0 0 0 6.69 1Z' fill='currentColor' transform='scale(3.42857)'/></svg>Reproducir sonido</span>"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"name": "isSwitch",
|
|
110
|
-
"description":
|
|
110
|
+
"description": "Apariencia de Switch con <code>'isSwitch': true</code>, sin cambio en el texto, sólo cambia su estado visual. Necesita un elemento externo con un <code>id</code> para referenciarlo con su <code>aria-labelledby</code>.",
|
|
111
111
|
"data": {
|
|
112
112
|
"id": "toggle-isswitch",
|
|
113
113
|
"classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
|
|
114
114
|
"isSwitch": true,
|
|
115
115
|
"offState": {
|
|
116
116
|
"classes": "",
|
|
117
|
-
"html":
|
|
117
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-sm' aria-hidden='true'>Off</span><span class='bg-neutral-base relative inline-flex flex-shrink-0 h-5 w-9 border-2 border-neutral-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>Off</span><span aria-hidden='true' class='translate-x-0 pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-sm' aria-hidden='true'>On</span></span>"
|
|
118
118
|
},
|
|
119
119
|
"onState": {
|
|
120
120
|
"classes": "",
|
|
121
|
-
"html":
|
|
121
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-sm' aria-hidden='true'>Off</span><span class='bg-primary-base relative inline-flex flex-shrink-0 h-5 w-9 border-2 border-primary-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>On</span><span aria-hidden='true' class='translate-x-4 pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-sm' aria-hidden='true'>On</span></span>"
|
|
122
122
|
},
|
|
123
123
|
"attributes": {
|
|
124
124
|
"aria-labelledby": "id-text"
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"name": "isSwitch pressed",
|
|
130
|
-
"description":
|
|
130
|
+
"description": "Usa <code>'pressed': true</code> para activarlo inicialmente.",
|
|
131
131
|
"data": {
|
|
132
132
|
"id": "toggle-isswitch-pressed",
|
|
133
133
|
"classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
|
|
@@ -135,11 +135,11 @@
|
|
|
135
135
|
"isSwitch": true,
|
|
136
136
|
"offState": {
|
|
137
137
|
"classes": "",
|
|
138
|
-
"html":
|
|
138
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-sm' aria-hidden='true'>Off</span><span class='bg-neutral-base relative inline-flex flex-shrink-0 h-5 w-9 border-2 border-neutral-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>Off</span><span aria-hidden='true' class='translate-x-0 pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-sm' aria-hidden='true'>On</span></span>"
|
|
139
139
|
},
|
|
140
140
|
"onState": {
|
|
141
141
|
"classes": "",
|
|
142
|
-
"html":
|
|
142
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-sm' aria-hidden='true'>Off</span><span class='bg-primary-base relative inline-flex flex-shrink-0 h-5 w-9 border-2 border-primary-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>On</span><span aria-hidden='true' class='translate-x-4 pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-sm' aria-hidden='true'>On</span></span>"
|
|
143
143
|
},
|
|
144
144
|
"attributes": {
|
|
145
145
|
"aria-labelledby": "id-text"
|
|
@@ -148,18 +148,18 @@
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"name": "isSwitch con JavaScript",
|
|
151
|
-
"description":
|
|
151
|
+
"description": "También puedes usar con javascript la función global <code>activateItemToggle(element, toggle)</code>, para modificar el estado del Switch, usando su id, el parámetro <code>toggle</code> admite <code>true</code> o <code>false</code>, si le pasamos true se mostrará activado, y si le pasamos false se mostrará desactivado. Ej: Abre la consola del navegador y escribe <code>activateItemToggle('toggle-switch-js', true)</code> para mostrar el switch activado.",
|
|
152
152
|
"data": {
|
|
153
153
|
"classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
|
|
154
154
|
"id": "toggle-switch-js",
|
|
155
155
|
"isSwitch": true,
|
|
156
156
|
"offState": {
|
|
157
157
|
"classes": "",
|
|
158
|
-
"html":
|
|
158
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-sm' aria-hidden='true'>Off</span><span class='bg-neutral-base relative inline-flex flex-shrink-0 h-5 w-9 border-2 border-neutral-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>Off</span><span aria-hidden='true' class='translate-x-0 pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-sm' aria-hidden='true'>On</span></span>"
|
|
159
159
|
},
|
|
160
160
|
"onState": {
|
|
161
161
|
"classes": "",
|
|
162
|
-
"html":
|
|
162
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-sm' aria-hidden='true'>Off</span><span class='bg-primary-base relative inline-flex flex-shrink-0 h-5 w-9 border-2 border-primary-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>On</span><span aria-hidden='true' class='translate-x-4 pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-sm' aria-hidden='true'>On</span></span>"
|
|
163
163
|
},
|
|
164
164
|
"attributes": {
|
|
165
165
|
"aria-labelledby": "id-text"
|
|
@@ -174,11 +174,11 @@
|
|
|
174
174
|
"isSwitch": true,
|
|
175
175
|
"offState": {
|
|
176
176
|
"classes": "",
|
|
177
|
-
"html":
|
|
177
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-xs' aria-hidden='true'>Off</span><span class='bg-neutral-base relative inline-flex flex-shrink-0 h-4 w-8 border-2 border-neutral-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>Off</span><span aria-hidden='true' class='translate-x-0 pointer-events-none inline-block h-3 w-3 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-xs' aria-hidden='true'>On</span></span>"
|
|
178
178
|
},
|
|
179
179
|
"onState": {
|
|
180
180
|
"classes": "",
|
|
181
|
-
"html":
|
|
181
|
+
"html": "<span class='flex align-center justify-between gap-xs'><span class='text-xs' aria-hidden='true'>Off</span><span class='bg-primary-base relative inline-flex flex-shrink-0 h-4 w-8 border-2 border-primary-base rounded-full cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'><span class='sr-only'>On</span><span aria-hidden='true' class='translate-x-4 pointer-events-none inline-block h-3 w-3 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200'></span></span><span class='text-xs' aria-hidden='true'>On</span></span>"
|
|
182
182
|
},
|
|
183
183
|
"attributes": {
|
|
184
184
|
"aria-labelledby": "id-text"
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
id="{{ params.id }}"
|
|
21
21
|
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
|
|
22
22
|
>
|
|
23
|
-
<span class="c-button--is-not-pressed pointer-events-none">{{ params.offState.html | safe if params.offState.html else params.offState.text }}</span>
|
|
24
|
-
<span class="c-button--is-pressed hidden pointer-events-none">{{ params.onState.html | safe if params.onState.html else params.onState.text }}</span>
|
|
23
|
+
<span class="c-button--is-not-pressed pointer-events-none">{{ params.offState.html | filterquotes | safe if params.offState.html else params.offState.text }}</span>
|
|
24
|
+
<span class="c-button--is-pressed hidden pointer-events-none">{{ params.onState.html | filterquotes | safe if params.onState.html else params.onState.text }}</span>
|
|
25
25
|
</button>
|
|
26
26
|
</div>
|
|
27
27
|
<!-- /toggle -->
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"icon": {
|
|
8
8
|
"type": "question"
|
|
9
9
|
},
|
|
10
|
-
"caller":
|
|
10
|
+
"caller": "<p class='c-paragraph-base mb-0'>Esto es un tooltip</p>"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
{
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"data": {
|
|
16
16
|
"id": "example-text",
|
|
17
17
|
"text": "Sólo texto",
|
|
18
|
-
"caller":
|
|
18
|
+
"caller": "<p class='c-paragraph-base mb-0'>Esto es un tooltip</p>"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"name": "con html",
|
|
23
23
|
"data": {
|
|
24
24
|
"id": "example-html",
|
|
25
|
-
"html":
|
|
26
|
-
"caller":
|
|
25
|
+
"html": "<p class='inline-flex items-center'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140' width='1em' height='1em' class='w-4 h-4 mr-xs text-primary-base' aria-hidden='true' focusable='false'><path d='M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zm0 117.51a10 10 0 1110-10 10 10 0 01-10 10zm9.17-39.08a2.5 2.5 0 00-1.67 2.36v1.71a7.5 7.5 0 01-15 0v-10A7.5 7.5 0 0170 65a12.5 12.5 0 10-12.5-12.5 7.5 7.5 0 01-15 0 27.5 27.5 0 1136.67 25.93z' fill='currentColor'/></svg><span>Sólo <strong>html</strong> con icono custom a la izquierda</span></p>",
|
|
26
|
+
"caller": "<p class='c-paragraph-base mb-0'>Si este contenido tiene texto extenso o con código, mira el ejemplo 'complex' más abajo.</p>"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"icon": {
|
|
35
35
|
"type": "question"
|
|
36
36
|
},
|
|
37
|
-
"caller": "<div class
|
|
37
|
+
"caller": "<div class=' w-48 p-2 '><div class=' border-4 border-dashed border-gray-200 rounded-lg h-40 '></div></div>"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"icon": {
|
|
46
46
|
"type": "info"
|
|
47
47
|
},
|
|
48
|
-
"caller": "<div class
|
|
48
|
+
"caller": "<div class=' w-48 p-2 '><div class=' border-4 border-dashed border-gray-200 rounded-lg h-40 '></div></div>"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
{
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"type": "alert"
|
|
58
58
|
},
|
|
59
59
|
"classes": "text-alert-base",
|
|
60
|
-
"caller": "<div class
|
|
60
|
+
"caller": "<div class=' w-48 p-2 '><div class=' border-4 border-dashed border-gray-200 rounded-lg h-40 '></div></div>"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -66,22 +66,22 @@
|
|
|
66
66
|
"id": "example-custom-icon",
|
|
67
67
|
"text": "Icono personalizado",
|
|
68
68
|
"icon": {
|
|
69
|
-
"html":
|
|
69
|
+
"html": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140' width='1em' height='1em' class='w-4 h-4 text-neutral-dark' role='img' aria-label='Ayuda'><path d='M140 15a15 15 0 00-15-15H15A15 15 0 000 15v110a15 15 0 0015 15h110a15 15 0 0015-15zM70 117.51a10 10 0 1110-10 10 10 0 01-10 10zm9.17-39.08a2.5 2.5 0 00-1.67 2.36v1.71a7.5 7.5 0 01-15 0v-10A7.5 7.5 0 0170 65a12.5 12.5 0 10-12.5-12.5 7.5 7.5 0 01-15 0 27.5 27.5 0 1136.67 25.93z' fill='currentColor'/></svg>"
|
|
70
70
|
},
|
|
71
71
|
"classes": "text-neutral-dark",
|
|
72
|
-
"caller":
|
|
72
|
+
"caller": "<p class='c-paragraph-base mb-0'>1520 - Subvención para actividades de educación de personas adultas</p>"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"name": "complejo",
|
|
77
|
-
"description":
|
|
77
|
+
"description": "Usa <code>'complex': true</code> para que el contenido del tooltip tenga textos largos o contenido mixto.",
|
|
78
78
|
"data": {
|
|
79
79
|
"id": "complex-html",
|
|
80
80
|
"icon": {
|
|
81
81
|
"type": "question"
|
|
82
82
|
},
|
|
83
83
|
"complex": true,
|
|
84
|
-
"caller":
|
|
84
|
+
"caller": "<p class='c-paragraph-base mb-0'>El código CVV se encuentra situado en la tarjeta por detrás. <strong>¡Compruébalo!</strong></p>"
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
] %}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
{% set idButton = params.id + "-button" %}
|
|
3
3
|
{% set idTooltip = params.id + "-tooltip" %}
|
|
4
4
|
<div id="{{ params.id }}" data-module="c-tooltip" {% if params.classes %}class="{{ params.classes }}"{% endif %} {%- if params.attributes %}{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}{% endif %}>
|
|
5
|
-
<div id="{{ idButton }}" data-module="c-tooltip-button" {%- if params.complex %} data-type="c-tooltip-button-complex"{% endif %} class="inline-flex items-center focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black" tabindex="0" role="button" aria-labelledby="{{ idButton }} {{ idTooltip }}">
|
|
5
|
+
<div id="{{ idButton }}" data-module="c-tooltip-button" {%- if params.complex %} data-type="c-tooltip-button-complex"{% endif %} class="inline-flex items-center focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black" tabindex="0" role="button" aria-labelledby="{{ idButton }}" aria-describedby="{{ idTooltip }}">
|
|
6
6
|
{% if params.text or params.html %}
|
|
7
7
|
{% if params.html %}
|
|
8
|
-
{{ params.html | safe }}
|
|
8
|
+
{{ params.html | filterquotes | safe }}
|
|
9
9
|
{% else %}
|
|
10
10
|
<p>
|
|
11
11
|
{{ params.text }}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
{% if params.icon %}
|
|
19
19
|
<span class="inline-block">
|
|
20
20
|
{% if params.icon.html %}
|
|
21
|
-
{{ params.icon.html | safe }}
|
|
21
|
+
{{ params.icon.html | filterquotes | safe }}
|
|
22
22
|
{% elseif params.icon.type == 'info' %}
|
|
23
23
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 text-primary-base" role="img" aria-label="Información"><path d="M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zm7.5 105a7.5 7.5 0 01-15 0V70a7.5 7.5 0 0115 0zM70 50a10 10 0 1110-10 10 10 0 01-10 10z" fill="currentColor"/></svg>
|
|
24
24
|
{% elseif params.icon.type == 'alert' %}
|