desy-html 8.13.0 → 9.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 +189 -189
- package/docs/_global.foot.njk +1 -0
- package/docs/_include.template-header.njk +5 -0
- package/docs/_macro.example-render.njk +4 -0
- package/docs/componentes.html +3 -0
- package/docs/ds/_ds.example.dropdowns-en-uso.njk +2 -2
- package/docs/ds/_ds.example.nav.njk +2 -2
- package/docs/ds/_ds.section.layout.njk +5 -0
- package/docs/examples-datepicker.html +8 -0
- package/docs/index.html +10 -0
- package/gulpfile.js +32 -36
- package/package.json +9 -2
- package/src/css/styles.css +1 -0
- package/src/js/cally.js +1114 -0
- package/src/js/desy-html.js +88 -0
- package/src/js/filters/filter-caller.js +2 -2
- package/src/js/filters/filter-slugify.js +2 -2
- package/src/js/filters/highlight.js +4 -4
- package/src/js/filters/index.js +6 -5
- package/src/js/globals/get-html-code-from-example.js +8 -6
- package/src/js/globals/get-html-code-from-file.js +7 -7
- package/src/js/globals/get-nunjucks-code-from-example.js +9 -10
- package/src/js/globals/get-nunjucks-code-from-file.js +6 -6
- package/src/js/globals/index.js +6 -6
- package/src/js/index.js +3 -1
- package/src/templates/components/datepicker/_examples.datepicker.njk +347 -0
- package/src/templates/components/datepicker/_macro.datepicker.njk +3 -0
- package/src/templates/components/datepicker/_styles.datepicker.css +85 -0
- package/src/templates/components/datepicker/_template.datepicker.njk +124 -0
- package/src/templates/components/datepicker/params.datepicker.yaml +105 -0
- package/src/templates/components/dropdown/_examples.dropdown.njk +1 -1
- package/src/templates/components/header/_template.header.njk +2 -2
- package/src/templates/components/header-advanced/_template.header-advanced.njk +1 -1
- package/src/templates/components/listbox/_examples.listbox.njk +1 -1
- package/src/templates/components/menu-navigation/_template.menu-navigation.njk +1 -1
- package/src/templates/components/menubar/_template.menubar.njk +1 -1
- package/src/templates/components/nav/_examples.nav.njk +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
params:
|
|
2
|
+
- name: containerClasses
|
|
3
|
+
type: string
|
|
4
|
+
required: false
|
|
5
|
+
description: Classes for the container.
|
|
6
|
+
- name: containerAttributes
|
|
7
|
+
type: object
|
|
8
|
+
required: false
|
|
9
|
+
description: HTML attributes (for example data attributes) to add to the container element.
|
|
10
|
+
- name: standalone
|
|
11
|
+
type: boolean
|
|
12
|
+
required: false
|
|
13
|
+
description: If `true` the datepicker only shows the months and navigation without the input. Defaults to `false.
|
|
14
|
+
- name: id
|
|
15
|
+
type: string
|
|
16
|
+
required: true
|
|
17
|
+
description: The id of the input.
|
|
18
|
+
- name: name
|
|
19
|
+
type: string
|
|
20
|
+
required: true
|
|
21
|
+
description: The name of the input, which is submitted with the form data.
|
|
22
|
+
- name: type
|
|
23
|
+
type: string
|
|
24
|
+
required: false
|
|
25
|
+
description: Type of input control to render. Defaults to "text".
|
|
26
|
+
- name: inputmode
|
|
27
|
+
type: string
|
|
28
|
+
require: false
|
|
29
|
+
description: Optional value for [inputmode](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode).
|
|
30
|
+
- name: value
|
|
31
|
+
type: string
|
|
32
|
+
required: false
|
|
33
|
+
description: Optional initial value of the input.
|
|
34
|
+
- name: describedBy
|
|
35
|
+
type: string
|
|
36
|
+
required: false
|
|
37
|
+
description: One or more element IDs to add to the `aria-describedby` attribute, used to provide additional descriptive information for screenreader users.
|
|
38
|
+
- name: label
|
|
39
|
+
type: object
|
|
40
|
+
required: true
|
|
41
|
+
description: Options for the label component.
|
|
42
|
+
isComponent: true
|
|
43
|
+
- name: hint
|
|
44
|
+
type: object
|
|
45
|
+
required: false
|
|
46
|
+
description: Options for the hint component.
|
|
47
|
+
isComponent: true
|
|
48
|
+
- name: errorMessage
|
|
49
|
+
type: object
|
|
50
|
+
required: false
|
|
51
|
+
description: Options for the error message component. The error message component will not display if you use a falsy value for `errorMessage`, for example `false` or `null`.
|
|
52
|
+
isComponent: true
|
|
53
|
+
- name: errorId
|
|
54
|
+
type: string
|
|
55
|
+
required: false
|
|
56
|
+
description: Custom ID to add to the `aria-errormessage` attribute, used to provide additional descriptive information for screenreader users. Used in date-input component with errors.
|
|
57
|
+
- name: describedBy
|
|
58
|
+
type: string
|
|
59
|
+
required: false
|
|
60
|
+
description: One or more element IDs to add to the `aria-describedby` attribute, used to provide additional descriptive information for screenreader users.
|
|
61
|
+
- name: formGroup
|
|
62
|
+
type: object
|
|
63
|
+
required: false
|
|
64
|
+
description: Options for the form-group wrapper
|
|
65
|
+
params:
|
|
66
|
+
- name: classes
|
|
67
|
+
type: string
|
|
68
|
+
required: false
|
|
69
|
+
description: Classes to add to the form group (e.g. to show error state for the whole group)
|
|
70
|
+
- name: classes
|
|
71
|
+
type: string
|
|
72
|
+
required: false
|
|
73
|
+
description: Classes to add to the input.
|
|
74
|
+
- name: autocomplete
|
|
75
|
+
type: string
|
|
76
|
+
required: false
|
|
77
|
+
description: Attribute to [identify input purpose](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html), for instance "postal-code" or "username". See [autofill](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill) for full list of attributes that can be used.
|
|
78
|
+
- name: pattern
|
|
79
|
+
type: string
|
|
80
|
+
required: false
|
|
81
|
+
description: Attribute to [provide a regular expression pattern](https://www.w3.org/TR/html51/sec-forms.html#the-pattern-attribute), used to match allowed character combinations for the input value.
|
|
82
|
+
- name: placeholder
|
|
83
|
+
type: string
|
|
84
|
+
required: false
|
|
85
|
+
description: Placeholder text
|
|
86
|
+
- name: disabled
|
|
87
|
+
type: boolean
|
|
88
|
+
required: false
|
|
89
|
+
description: If true, input will be disabled.
|
|
90
|
+
- name: attributes
|
|
91
|
+
type: object
|
|
92
|
+
required: false
|
|
93
|
+
description: HTML attributes (for example data attributes) to add to the anchor tag.
|
|
94
|
+
- name: dropdown
|
|
95
|
+
type: component
|
|
96
|
+
required: false
|
|
97
|
+
description: dropdown component parameters. If there are any, the datepicker will show a dropdown after the input instead of the calendar icon.
|
|
98
|
+
- name: dropdownClasses
|
|
99
|
+
type: string
|
|
100
|
+
required: false
|
|
101
|
+
description: Classes to add to the dropdown.
|
|
102
|
+
- name: caller
|
|
103
|
+
type: nunjucks-block
|
|
104
|
+
required: false
|
|
105
|
+
description: Not strictly a parameter but [Nunjucks code convention](https://mozilla.github.io/nunjucks/templating.html#call). Using a `call` block enables you to call a macro with all the text inside the tag. This is helpful if you want to pass a lot of content into a macro. To use it, you will need to wrap the entire dropdown component in a `call` block.
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"data": {
|
|
109
109
|
"text": "Dropdown anchura completa",
|
|
110
110
|
"classes": "w-full justify-between",
|
|
111
|
-
"classesTooltip": "max-h-64 overflow-y-auto",
|
|
111
|
+
"classesTooltip": "w-max max-h-64 overflow-y-auto",
|
|
112
112
|
"caller": "<div class=\" p-2 \"><div class=\" border-4 border-dashed border-gray-200 rounded-lg h-64 \"><div style=\" width:900px \"></div></div></div>"
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
isMenu: true,
|
|
50
50
|
idPrefix: "header-subnav-nav-item",
|
|
51
51
|
items: params.subnav.items,
|
|
52
|
-
classes: "max-w-64",
|
|
52
|
+
classes: "w-max max-w-64",
|
|
53
53
|
attributes: {
|
|
54
54
|
"id": "id-subnav-nav",
|
|
55
55
|
"aria-label": "Aplicaciones"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
isMenu: true,
|
|
101
101
|
idPrefix: "header-dropdown-nav-item",
|
|
102
102
|
items: params.dropdown.items,
|
|
103
|
-
classes: "max-w-64",
|
|
103
|
+
classes: "w-max max-w-64",
|
|
104
104
|
attributes: {
|
|
105
105
|
"id": "id-dropdown-nav",
|
|
106
106
|
"aria-label": "Menú de usuario"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
{% endif %}
|
|
39
39
|
{% if item.sub.items %}
|
|
40
40
|
<div class="c-menu-navigation__sub absolute bottom-0 left-0">
|
|
41
|
-
<ul id="{{ id }}-sub-list" class="c-menu-navigation__sub--list {% if item.sub.classes %}{{ item.sub.classes }}{% else-%} c-menu-navigation__tooltip max-w-64 border border-neutral-base shadow-md bg-white text-sm{% endif %}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
|
41
|
+
<ul id="{{ id }}-sub-list" class="c-menu-navigation__sub--list {% if item.sub.classes %}{{ item.sub.classes }}{% else-%} c-menu-navigation__tooltip w-max max-w-64 border border-neutral-base shadow-md bg-white text-sm{% endif %}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
|
42
42
|
{% for subitem in item.sub.items %}
|
|
43
43
|
{% if subitem %}
|
|
44
44
|
{#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</a>
|
|
38
38
|
{% endif %}
|
|
39
39
|
{% if item.sub.items %}
|
|
40
|
-
<ul role="menu" class="c-menubar__tooltip max-w-64 hidden border border-neutral-base shadow-md bg-white text-sm {%- if item.sub.classes %} {{ item.sub.classes }}{% endif %}" aria-label="{{ item.ariaLabel }}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
|
40
|
+
<ul role="menu" class="c-menubar__tooltip w-max max-w-64 hidden border border-neutral-base shadow-md bg-white text-sm {%- if item.sub.classes %} {{ item.sub.classes }}{% endif %}" aria-label="{{ item.ariaLabel }}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
|
41
41
|
{% for subitem in item.sub.items %}
|
|
42
42
|
{% if subitem %}
|
|
43
43
|
{#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
"text": "Clases max-width aplicadas para evitar demasiada anchura dentro de los menus y forzar a saltos de línea"
|
|
395
395
|
}
|
|
396
396
|
],
|
|
397
|
-
"classes": "max-w-64",
|
|
397
|
+
"classes": "w-max max-w-64",
|
|
398
398
|
"attributes": {
|
|
399
399
|
"aria-label": "Navegación local"
|
|
400
400
|
}
|