desy-html 5.3.0 → 6.2.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 +11 -21
- package/docs/_include.template-header.njk +16 -4
- package/docs/_macro.example-render.njk +16 -0
- package/docs/componentes.html +12 -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-header-2.html +5 -0
- package/docs/examples-header-advanced-2.html +5 -0
- package/docs/examples-header-advanced.html +5 -0
- package/docs/examples-header-mini.html +5 -0
- package/docs/examples-menu-navigation.html +5 -0
- package/docs/index.html +53 -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 +220 -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 +34 -0
- package/src/templates/components/button/_template.button.njk +1 -1
- package/src/templates/components/button-loader/_styles.button-loader.css +6 -0
- package/src/templates/components/button-loader/_template.button-loader.njk +6 -6
- package/src/templates/components/checkboxes/_styles.checkboxes.css +7 -0
- package/src/templates/components/dropdown/_styles.dropdown.css +12 -4
- 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-2.njk +536 -0
- package/src/templates/components/header/_examples.header.njk +134 -1
- package/src/templates/components/header/_template.header.header__navigation.njk +3 -3
- package/src/templates/components/header/_template.header.header__offcanvasButton.njk +1 -1
- package/src/templates/components/header/_template.header.header__subnav.njk +2 -2
- package/src/templates/components/header/_template.header.njk +8 -9
- package/src/templates/components/header/params.header.yaml +24 -0
- package/src/templates/components/header-advanced/_examples.header-advanced-2.njk +851 -0
- package/src/templates/components/header-advanced/_examples.header-advanced.njk +761 -0
- package/src/templates/components/header-advanced/_macro.header-advanced.njk +3 -0
- package/src/templates/components/header-advanced/_template.header-advanced.njk +146 -0
- package/src/templates/components/header-advanced/params.header-advanced.yaml +298 -0
- package/src/templates/components/header-mini/_examples.header-mini.njk +30 -0
- package/src/templates/components/header-mini/_macro.header-mini.njk +3 -0
- package/src/templates/components/header-mini/_template.header-mini.njk +14 -0
- package/src/templates/components/header-mini/params.header-mini.yaml +25 -0
- package/src/templates/components/input/_styles.input.css +7 -0
- package/src/templates/components/item/_examples.item.njk +26 -1
- package/src/templates/components/item/_template.item.njk +4 -4
- package/src/templates/components/item/params.item.yaml +4 -0
- package/src/templates/components/listbox/_styles.listbox.css +14 -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 +224 -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 -1
- package/src/templates/components/menubar/_styles.menubar.css +33 -5
- 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/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/searchbar/_examples.searchbar.njk +12 -1
- package/src/templates/components/searchbar/_template.searchbar.njk +9 -9
- package/src/templates/components/select/_styles.select.css +8 -0
- 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 +27 -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 +3 -1
- package/src/templates/components/toggle/params.toggle.yaml +4 -0
- package/src/templates/components/tree/_examples.tree.njk +580 -32
- package/src/templates/components/tree/_styles.tree.css +8 -0
- 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.
|
|
@@ -67,6 +67,13 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
|
|
70
|
+
.c-button--base {
|
|
71
|
+
@apply px-3;
|
|
72
|
+
@apply py-2;
|
|
73
|
+
@apply text-base;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
70
77
|
.c-button--sm {
|
|
71
78
|
@apply px-2;
|
|
72
79
|
@apply py-1;
|
|
@@ -121,6 +128,33 @@
|
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
|
|
131
|
+
.c-button--has-selection {
|
|
132
|
+
@apply bg-primary-light;
|
|
133
|
+
@apply text-primary-dark;
|
|
134
|
+
@apply border-primary-base;
|
|
135
|
+
@apply shadow-none;
|
|
136
|
+
|
|
137
|
+
&:hover:not(disabled),
|
|
138
|
+
&:active:not(disabled),
|
|
139
|
+
&.ds-hover:not(disabled) {
|
|
140
|
+
@apply bg-primary-light;
|
|
141
|
+
@apply text-black;
|
|
142
|
+
@apply bg-opacity-50;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:active:not(disabled),
|
|
146
|
+
&.ds-active:not(disabled) {
|
|
147
|
+
@apply shadow-none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&[disabled],
|
|
151
|
+
&[disabled]:hover,
|
|
152
|
+
&[disabled]:focus {
|
|
153
|
+
@apply bg-primary-light;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
124
158
|
.c-button--transparent {
|
|
125
159
|
@apply bg-transparent;
|
|
126
160
|
@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 }}
|
|
@@ -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;
|
|
@@ -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,21 +158,22 @@
|
|
|
151
158
|
|
|
152
159
|
|
|
153
160
|
.c-dropdown--header {
|
|
154
|
-
@apply bg-
|
|
161
|
+
@apply bg-neutral-lighter;
|
|
155
162
|
@apply border-none;
|
|
156
163
|
@apply rounded-none;
|
|
157
164
|
@apply shadow-none;
|
|
158
165
|
@apply font-normal;
|
|
159
166
|
@apply text-sm;
|
|
160
|
-
@apply text-
|
|
167
|
+
@apply text-black;
|
|
161
168
|
|
|
162
169
|
&:hover:not(disabled),
|
|
163
170
|
&:active:not(disabled),
|
|
164
171
|
&.ds-hover:not(disabled) {
|
|
165
|
-
@apply bg-
|
|
172
|
+
@apply bg-neutral-lighter;
|
|
166
173
|
@apply border-none;
|
|
167
174
|
@apply shadow-none;
|
|
168
|
-
@apply text-
|
|
175
|
+
@apply text-black;
|
|
176
|
+
@apply underline;
|
|
169
177
|
}
|
|
170
178
|
|
|
171
179
|
&[disabled],
|
|
@@ -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 %}
|