desy-html 5.2.1 → 6.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/config/tailwind.config.js +10 -10
- package/docs/_include.template-header.njk +8 -0
- package/docs/_macro.example-render.njk +8 -0
- package/docs/componentes.html +6 -0
- package/docs/ds/_ds.example.accordion.njk +61 -0
- package/docs/ds/_ds.example.footer.njk +7 -128
- package/docs/ds/_ds.example.header.njk +118 -0
- package/docs/ds/_ds.example.layout.njk +16 -6
- package/docs/ds/_ds.example.menu-navigation.njk +494 -0
- package/docs/ds/_ds.example.searchbar.njk +39 -0
- package/docs/ds/_ds.example.table.njk +432 -0
- package/docs/ds/_ds.example.toggle.njk +55 -35
- package/docs/ds/_ds.section.layout.njk +12 -12
- package/docs/ds/_ds.section.navigation.njk +5 -0
- package/docs/ds/_ds.section.textos.njk +27 -0
- package/docs/examples-accordion-history.html +5 -0
- package/docs/examples-menu-navigation.html +5 -0
- package/docs/index.html +49 -0
- package/gulpfile.js +7 -6
- package/package.json +6 -7
- package/src/css/base.css +4 -0
- package/src/css/styles.css +1 -0
- package/src/js/aria/accordion.js +16 -5
- package/src/js/aria/disclosureMenu.js +153 -0
- package/src/js/desy-html.js +15 -0
- package/src/js/index.js +2 -0
- package/src/templates/components/accordion/_examples.accordion.njk +70 -2
- package/src/templates/components/accordion/_template.accordion.njk +18 -8
- package/src/templates/components/accordion/params.accordion.yaml +38 -0
- package/src/templates/components/accordion-history/_examples.accordion-history.njk +356 -0
- package/src/templates/components/accordion-history/_macro.accordion-history.njk +3 -0
- package/src/templates/components/accordion-history/_template.accordion-history.njk +209 -0
- package/src/templates/components/accordion-history/params.accordion-history.yaml +125 -0
- package/src/templates/components/button/_examples.button.njk +7 -0
- package/src/templates/components/button/_styles.button.css +27 -0
- package/src/templates/components/button/_template.button.njk +1 -1
- package/src/templates/components/button-loader/_template.button-loader.njk +6 -6
- package/src/templates/components/file-upload/_examples.file-upload.njk +11 -5
- package/src/templates/components/file-upload/_template.file-upload.njk +1 -1
- package/src/templates/components/footer/_examples.footer.njk +46 -136
- package/src/templates/components/footer/_template.footer.njk +35 -28
- package/src/templates/components/footer/params.footer.yaml +18 -0
- package/src/templates/components/header/_examples.header.njk +166 -0
- package/src/templates/components/header/_template.header.header__navigation.njk +2 -2
- package/src/templates/components/header/_template.header.njk +7 -3
- package/src/templates/components/header/params.header.yaml +24 -0
- package/src/templates/components/input-group/_template.input-group.njk +2 -0
- package/src/templates/components/input-group/params.input-group.yaml +13 -5
- package/src/templates/components/item/_examples.item.njk +1 -1
- package/src/templates/components/item/_template.item.njk +3 -3
- package/src/templates/components/listbox/_styles.listbox.css +7 -4
- package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +25 -0
- package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +26 -0
- package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +1 -1
- package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +1080 -0
- package/src/templates/components/menu-navigation/_macro.menu-navigation.njk +3 -0
- package/src/templates/components/menu-navigation/_styles.menu-navigation.css +216 -0
- package/src/templates/components/menu-navigation/_template.menu-navigation.njk +116 -0
- package/src/templates/components/menu-navigation/params.menu-navigation.yaml +93 -0
- package/src/templates/components/menubar/_examples.menubar.njk +1 -170
- package/src/templates/components/menubar/_styles.menubar.css +26 -5
- package/src/templates/components/menubar/_template.menubar.njk +1 -1
- package/src/templates/components/modal/_examples.modal.njk +62 -0
- package/src/templates/components/modal/_template.modal.njk +21 -4
- package/src/templates/components/modal/params.modal.yaml +2 -2
- package/src/templates/components/searchbar/_examples.searchbar.njk +12 -1
- package/src/templates/components/searchbar/_template.searchbar.njk +8 -8
- package/src/templates/components/spinner/_styles.spinner.css +1 -0
- package/src/templates/components/spinner/_template.spinner.njk +4 -4
- package/src/templates/components/table-advanced/_examples.table-advanced.njk +182 -5
- package/src/templates/components/table-advanced/_template.table-advanced.njk +26 -2
- package/src/templates/components/table-advanced/params.table-advanced.yaml +5 -0
- package/src/templates/components/toggle/_examples.toggle.njk +33 -11
- package/src/templates/components/toggle/_template.toggle.njk +6 -2
- package/src/templates/components/toggle/params.toggle.yaml +4 -0
- package/src/templates/components/tooltip/_template.tooltip.njk +2 -2
- package/src/templates/components/tree/_examples.tree.njk +580 -32
- package/src/templates/components/tree/_template.tree.njk +1 -1
- package/config/clean-css.js +0 -25
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
params:
|
|
2
|
+
- name: idPrefix
|
|
3
|
+
type: string
|
|
4
|
+
required: true
|
|
5
|
+
description: String to prefix id for each accordion item if no id is specified on each item.
|
|
6
|
+
- name: headingLevel
|
|
7
|
+
type: number
|
|
8
|
+
required: false
|
|
9
|
+
description: If headingLevel is 1, the parent heading tag needed inside this component will be a h1, if 2 will be a h2, and so on.
|
|
10
|
+
- name: allowToggle
|
|
11
|
+
type: boolean
|
|
12
|
+
required: false
|
|
13
|
+
description: Defaults to `false`. Allow for each toggle to both open and close its section. Makes it possible for all sections to be closed. Assumes only one section may be open.
|
|
14
|
+
- name: allowMultiple
|
|
15
|
+
type: boolean
|
|
16
|
+
required: false
|
|
17
|
+
description: Defaults to `false`. Allow for multiple accordion sections to be expanded at the same time. Assumes data-allow-toggle otherwise the toggle on open sections would be disabled.
|
|
18
|
+
- name: heading
|
|
19
|
+
type: object
|
|
20
|
+
required: false
|
|
21
|
+
description: Options for the heading
|
|
22
|
+
params:
|
|
23
|
+
- name: text
|
|
24
|
+
type: string
|
|
25
|
+
required: true
|
|
26
|
+
description: If `html` is set, this is not required. Text to use within the heading. If `html` is provided, the `text` argument will be ignored.
|
|
27
|
+
- name: html
|
|
28
|
+
type: string
|
|
29
|
+
required: true
|
|
30
|
+
description: If `text` is set, this is not required. HTML to use within the heading. If `html` is provided, the `text` argument will be ignored.
|
|
31
|
+
- name: classes
|
|
32
|
+
type: string
|
|
33
|
+
required: false
|
|
34
|
+
description: Classes to add to the heading.
|
|
35
|
+
- name: showControl
|
|
36
|
+
type: boolean
|
|
37
|
+
required: false
|
|
38
|
+
description: Defaults to `false`. If `true` a Show/Hide all button is displayed on top
|
|
39
|
+
- name: items
|
|
40
|
+
type: array
|
|
41
|
+
required: true
|
|
42
|
+
description: Array of accordion items objects.
|
|
43
|
+
params:
|
|
44
|
+
- name: headerText
|
|
45
|
+
type: string
|
|
46
|
+
required: true
|
|
47
|
+
description: If `summmaryHtml` is set, this is not required. Text to use within the header element (the visible part of the accordion item element). If `headerHtml` is provided, the `headerText` argument will be ignored.
|
|
48
|
+
- name: headerHtml
|
|
49
|
+
type: string
|
|
50
|
+
required: true
|
|
51
|
+
description: If `summmaryText` is set, this is not required. HTML to use within the header element (the visible part of the accordion item element). If `headerHtml` is provided, the `headerText` argument will be ignored.
|
|
52
|
+
- name: text
|
|
53
|
+
type: string
|
|
54
|
+
required: true
|
|
55
|
+
description: If `html` is set, this is not required. Text to use within the disclosed part of the accordion item element. If `html` is provided, the `text` argument will be ignored.
|
|
56
|
+
- name: html
|
|
57
|
+
type: string
|
|
58
|
+
required: true
|
|
59
|
+
description: If `text` is set, this is not required. HTML to use within the disclosed part of the accordion item element. If `html` is provided, the `text` argument will be ignored.
|
|
60
|
+
- name: id
|
|
61
|
+
type: string
|
|
62
|
+
required: false
|
|
63
|
+
description: Id to add to the item. Not required, but recommended to improve the accessibility.
|
|
64
|
+
- name: open
|
|
65
|
+
type: boolean
|
|
66
|
+
required: false
|
|
67
|
+
description: If true, accordion item will be expanded.
|
|
68
|
+
- name: disabled
|
|
69
|
+
type: boolean
|
|
70
|
+
required: false
|
|
71
|
+
description: If true, accordion item will be disabled and will not show the show/hide control.
|
|
72
|
+
- name: status
|
|
73
|
+
type: string
|
|
74
|
+
required: false
|
|
75
|
+
description: Available values: `current`,`past`,`pending`,`muted`, `currentmuted`. Defaults to `past`. If `current`, the item will show with primary border and white background. If `past`, the item will show with primary color. If `pending` the item has neutral color and dashed line. If `muted` the item has neutral color and background. `currentmuted` is like `current` but with `muted` styles.
|
|
76
|
+
- name: show
|
|
77
|
+
type: object
|
|
78
|
+
required: false
|
|
79
|
+
description: Options to customize the show info
|
|
80
|
+
params:
|
|
81
|
+
- name: text
|
|
82
|
+
type: string
|
|
83
|
+
required: true
|
|
84
|
+
description: If `html` is set, this is not required. Text to use in show info. If `html` is provided, the `text` argument will be ignored.
|
|
85
|
+
- name: html
|
|
86
|
+
type: string
|
|
87
|
+
required: true
|
|
88
|
+
description: If `text` is set, this is not required. HTML to use within the show info. If `html` is provided, the `text` argument will be ignored.
|
|
89
|
+
- name: classes
|
|
90
|
+
type: string
|
|
91
|
+
required: false
|
|
92
|
+
description: Classes to add to the show info.
|
|
93
|
+
- name: hide
|
|
94
|
+
type: object
|
|
95
|
+
required: false
|
|
96
|
+
description: Options to customize the hide info
|
|
97
|
+
params:
|
|
98
|
+
- name: text
|
|
99
|
+
type: string
|
|
100
|
+
required: true
|
|
101
|
+
description: If `html` is set, this is not required. Text to use in hide info. If `html` is provided, the `text` argument will be ignored.
|
|
102
|
+
- name: html
|
|
103
|
+
type: string
|
|
104
|
+
required: true
|
|
105
|
+
description: If `text` is set, this is not required. HTML to use within the hide info. If `html` is provided, the `text` argument will be ignored.
|
|
106
|
+
- name: classes
|
|
107
|
+
type: string
|
|
108
|
+
required: false
|
|
109
|
+
description: Classes to add to the hide info.
|
|
110
|
+
- name: classes
|
|
111
|
+
type: string
|
|
112
|
+
required: false
|
|
113
|
+
description: Classes to add to the accordion item element.
|
|
114
|
+
- name: attributes
|
|
115
|
+
type: object
|
|
116
|
+
required: false
|
|
117
|
+
description: HTML attributes (for example data attributes) to add to the accordion item.
|
|
118
|
+
- name: classes
|
|
119
|
+
type: string
|
|
120
|
+
required: false
|
|
121
|
+
description: Classes to add to the accordion container.
|
|
122
|
+
- name: attributes
|
|
123
|
+
type: object
|
|
124
|
+
required: false
|
|
125
|
+
description: HTML attributes (for example data attributes) to add to the accordion container.
|
|
@@ -121,6 +121,33 @@
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
|
|
124
|
+
.c-button--has-selection {
|
|
125
|
+
@apply bg-primary-light;
|
|
126
|
+
@apply text-primary-dark;
|
|
127
|
+
@apply border-primary-base;
|
|
128
|
+
@apply shadow-none;
|
|
129
|
+
|
|
130
|
+
&:hover:not(disabled),
|
|
131
|
+
&:active:not(disabled),
|
|
132
|
+
&.ds-hover:not(disabled) {
|
|
133
|
+
@apply bg-primary-light;
|
|
134
|
+
@apply text-black;
|
|
135
|
+
@apply bg-opacity-50;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&:active:not(disabled),
|
|
139
|
+
&.ds-active:not(disabled) {
|
|
140
|
+
@apply shadow-none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&[disabled],
|
|
144
|
+
&[disabled]:hover,
|
|
145
|
+
&[disabled]:focus {
|
|
146
|
+
@apply bg-primary-light;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
124
151
|
.c-button--transparent {
|
|
125
152
|
@apply bg-transparent;
|
|
126
153
|
@apply border-transparent;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
<!-- button -->
|
|
33
33
|
{%- if element == 'a' %}
|
|
34
|
-
<a href="{{ params.href if params.href else '#' }}" role="button" draggable="false" {%- if params.disabled %} tabindex="-1"
|
|
34
|
+
<a href="{{ params.href if params.href else '#' }}" role="button" draggable="false" {%- if params.disabled %} tabindex="-1"{% endif %}{% if params.target %} target="{{ params.target }}"{% endif %} {{- commonAttributes | safe }}>
|
|
35
35
|
{{ params.html | safe if params.html else params.text }}
|
|
36
36
|
</a>
|
|
37
37
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
{% set iconLoader %}
|
|
26
26
|
<span class="c-button-loader__spinner flex items-center justify-center absolute inset-0">
|
|
27
27
|
{{ componentSpinner({
|
|
28
|
-
text: params.loader.text,
|
|
28
|
+
text: params.loader.text if params.loader.text else 'Acción en curso',
|
|
29
29
|
classes: params.loader.classes,
|
|
30
30
|
attributes: {
|
|
31
31
|
"x-ref": "spinnerText"
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
{# Set success icon html #}
|
|
38
38
|
{% set iconSuccess %}
|
|
39
39
|
<span class="c-button-loader__success flex items-center justify-center absolute inset-0">
|
|
40
|
-
<
|
|
41
|
-
</
|
|
42
|
-
<span aria-hidden="true"
|
|
40
|
+
<span x-ref="successText" class="sr-only" role="alert" aria-live="assertive">
|
|
41
|
+
</span>
|
|
42
|
+
<span aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" 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"></path></svg></span>
|
|
43
43
|
</span>
|
|
44
44
|
{% endset %}
|
|
45
45
|
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
</button>
|
|
83
83
|
|
|
84
84
|
{%- elseif element == 'input' %}
|
|
85
|
-
<div {{-
|
|
85
|
+
<div {{- commonAttributes | safe }}>
|
|
86
86
|
<span class="c-button-loader__content inline-flex align-baseline">
|
|
87
|
-
<input value="{{ params.text }}" type="{{ params.type if params.type else 'submit' }}" class="bg-transparent font-semibold">
|
|
87
|
+
<input {{- buttonAttributes | safe }} value="{{ params.text }}" type="{{ params.type if params.type else 'submit' }}" class="bg-transparent font-semibold">
|
|
88
88
|
</span>
|
|
89
89
|
{{ iconLoader | safe }}
|
|
90
90
|
{{ iconSuccess | safe }}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"name": "file-upload-1",
|
|
8
8
|
"label": {
|
|
9
9
|
"text": "Sube un archivo"
|
|
10
|
-
}
|
|
10
|
+
},
|
|
11
|
+
"classes": "overflow-x-auto max-w-64 lg:max-w-none"
|
|
11
12
|
}
|
|
12
13
|
},
|
|
13
14
|
{
|
|
@@ -20,7 +21,8 @@
|
|
|
20
21
|
},
|
|
21
22
|
"hint": {
|
|
22
23
|
"text": "Tu foto puede estar en tus Imágenes, Fotos, Descargas o el Escritorio. O en una aplicación como Fotos."
|
|
23
|
-
}
|
|
24
|
+
},
|
|
25
|
+
"classes": "overflow-x-auto max-w-64 lg:max-w-none"
|
|
24
26
|
}
|
|
25
27
|
},
|
|
26
28
|
{
|
|
@@ -36,7 +38,8 @@
|
|
|
36
38
|
},
|
|
37
39
|
"errorMessage": {
|
|
38
40
|
"text": "Error: Error message goes here"
|
|
39
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"classes": "overflow-x-auto max-w-64 lg:max-w-none"
|
|
40
43
|
}
|
|
41
44
|
},
|
|
42
45
|
{
|
|
@@ -49,7 +52,8 @@
|
|
|
49
52
|
},
|
|
50
53
|
"attributes": {
|
|
51
54
|
"accept": ".jpg, .jpeg, .png"
|
|
52
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"classes": "overflow-x-auto max-w-64 lg:max-w-none"
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
59
|
{
|
|
@@ -60,7 +64,8 @@
|
|
|
60
64
|
"label": {
|
|
61
65
|
"text": "Sube un archivo",
|
|
62
66
|
"isPageHeading": true
|
|
63
|
-
}
|
|
67
|
+
},
|
|
68
|
+
"classes": "overflow-x-auto max-w-64 lg:max-w-none"
|
|
64
69
|
}
|
|
65
70
|
},
|
|
66
71
|
{
|
|
@@ -71,6 +76,7 @@
|
|
|
71
76
|
"label": {
|
|
72
77
|
"text": "Sube un archivo"
|
|
73
78
|
},
|
|
79
|
+
"classes": "overflow-x-auto max-w-64 lg:max-w-none",
|
|
74
80
|
"formGroup": {
|
|
75
81
|
"classes": "p-base bg-warning-light"
|
|
76
82
|
}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
visuallyHiddenText: params.errorMessage.visuallyHiddenText
|
|
39
39
|
}) | indent(2) | trim }}
|
|
40
40
|
{% endif %}
|
|
41
|
-
<input class="mt-sm focus:outline-none focus:bg-warning-base focus:shadow-outline-focus {%- if params.classes %} {{ params.classes }}{% endif %} {%- if params.errorMessage %} c-file-upload--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" type="file"
|
|
41
|
+
<input class="mt-sm p-xs file:mr-base focus:outline-none file:inline-flex file:items-baseline file:px-3 file:py-2 file:bg-white file:border file:border-solid file:border-primary-base file:rounded file:align-baseline file:font-semibold file:text-primary-base file:transition-all file:duration-100 file:ease-out file:whitespace-nowrap file:cursor-pointer file:focus:bg-warning-base file:focus:border-warning-base file:focus:shadow-outline-black file:focus:text-black file:focus:outline-none file:hover:bg-neutral-light file:hover:border-primary-base file:hover:text-primary-base {%- if params.classes %} {{ params.classes }}{% endif %} {%- if params.errorMessage %} c-file-upload--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" type="file"
|
|
42
42
|
{%- if params.value %} value="{{ params.value }}"{% endif %}
|
|
43
43
|
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
|
|
44
44
|
{%- if params.errorMessage %} aria-errormessage="{{ errorId }}" aria-invalid="true"{% endif %}
|