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.
Files changed (66) hide show
  1. package/README.md +2 -2
  2. package/docs/_global.head.njk +1 -2
  3. package/docs/_include.template-header.njk +0 -4
  4. package/docs/_macro.example-render.njk +11 -9
  5. package/docs/ds/_ds.example.header.njk +0 -6
  6. package/docs/ds/_ds.example.menu-navigation.njk +1 -1
  7. package/docs/ds/_ds.example.menubar-variaciones.njk +1 -2
  8. package/docs/ds/_ds.macro.code-snippet.njk +6 -4
  9. package/docs/examples-header-2.html +5 -0
  10. package/docs/examples-header-advanced-2.html +5 -0
  11. package/docs/index.html +24 -2
  12. package/package.json +1 -1
  13. package/src/css/component.form-group.css +1 -0
  14. package/src/js/aria/accordion.js +24 -17
  15. package/src/js/aria/collapsible.js +35 -0
  16. package/src/js/aria/disclosureMenu.js +1 -2
  17. package/src/js/aria/tabs.js +43 -1
  18. package/src/js/aria/toggle.js +25 -0
  19. package/src/js/aria/treeitem.js +11 -20
  20. package/src/js/desy-html.js +10 -1
  21. package/src/js/index.js +12 -0
  22. package/src/templates/components/accordion/_examples.accordion.njk +1 -1
  23. package/src/templates/components/accordion/_template.accordion.njk +6 -34
  24. package/src/templates/components/accordion-history/_template.accordion-history.njk +13 -30
  25. package/src/templates/components/button/_styles.button.css +7 -0
  26. package/src/templates/components/button-loader/_styles.button-loader.css +6 -0
  27. package/src/templates/components/checkboxes/_styles.checkboxes.css +7 -0
  28. package/src/templates/components/checkboxes/_template.checkboxes.njk +4 -8
  29. package/src/templates/components/collapsible/_template.collapsible.njk +7 -13
  30. package/src/templates/components/dropdown/_styles.dropdown.css +9 -2
  31. package/src/templates/components/footer/_examples.footer.njk +2 -2
  32. package/src/templates/components/footer/_template.footer.njk +1 -1
  33. package/src/templates/components/header/_examples.header-2.njk +536 -0
  34. package/src/templates/components/header/_examples.header.njk +0 -33
  35. package/src/templates/components/header/_template.header.njk +2 -2
  36. package/src/templates/components/header-advanced/_examples.header-advanced-2.njk +911 -0
  37. package/src/templates/components/header-advanced/_examples.header-advanced.njk +108 -48
  38. package/src/templates/components/header-advanced/_template.header-advanced.njk +34 -14
  39. package/src/templates/components/header-advanced/params.header-advanced.yaml +61 -1
  40. package/src/templates/components/header-mini/_template.header-mini.njk +3 -3
  41. package/src/templates/components/input/_styles.input.css +7 -0
  42. package/src/templates/components/item/_examples.item.njk +25 -0
  43. package/src/templates/components/item/_template.item.njk +1 -1
  44. package/src/templates/components/item/params.item.yaml +4 -0
  45. package/src/templates/components/listbox/_styles.listbox.css +12 -4
  46. package/src/templates/components/menu-navigation/_styles.menu-navigation.css +7 -0
  47. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +3 -3
  48. package/src/templates/components/menu-navigation/params.menu-navigation.yaml +0 -5
  49. package/src/templates/components/menubar/_examples.menubar.njk +1 -1
  50. package/src/templates/components/menubar/_styles.menubar.css +12 -4
  51. package/src/templates/components/notification/_template.notification.njk +3 -11
  52. package/src/templates/components/pagination/_examples.pagination.njk +60 -0
  53. package/src/templates/components/pagination/_template.pagination.njk +16 -2
  54. package/src/templates/components/pagination/params.pagination.yaml +49 -0
  55. package/src/templates/components/radios/_styles.radios.css +7 -0
  56. package/src/templates/components/radios/_template.radios.njk +4 -8
  57. package/src/templates/components/select/_styles.select.css +8 -0
  58. package/src/templates/components/table-advanced/_template.table-advanced.njk +5 -4
  59. package/src/templates/components/tabs/_examples.tabs.njk +35 -1
  60. package/src/templates/components/tabs/_styles.tabs.css +0 -17
  61. package/src/templates/components/tabs/_template.tabs.njk +4 -4
  62. package/src/templates/components/tabs/params.tabs.yaml +5 -1
  63. package/src/templates/components/toggle/_examples.toggle.njk +2 -2
  64. package/src/templates/components/toggle/_template.toggle.njk +7 -28
  65. package/src/templates/components/tree/_styles.tree.css +8 -0
  66. package/src/templates/components/tree/_template.tree.njk +2 -2
@@ -40,6 +40,10 @@ params:
40
40
  type: boolean
41
41
  required: false
42
42
  description: If true, nav item will be disabled.
43
+ - name: active
44
+ type: boolean
45
+ required: false
46
+ description: If true, tab item will be selected at start.
43
47
  - name: attributes
44
48
  type: object
45
49
  required: false
@@ -72,4 +76,4 @@ params:
72
76
  - name: attributes
73
77
  type: object
74
78
  required: false
75
- description: HTML attributes (for example data attributes) to add to the tabs component.
79
+ description: HTML attributes (for example data attributes) to add to the tabs component.
@@ -60,11 +60,11 @@
60
60
  "isSwitch": true,
61
61
  "offState": {
62
62
  "classes": "",
63
- "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">on</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>'
63
+ "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>'
64
64
  },
65
65
  "onState": {
66
66
  "classes": "",
67
- "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">off</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>'
67
+ "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>'
68
68
  },
69
69
  "attributes": {
70
70
  "aria-labelledby": "id-text"
@@ -1,41 +1,20 @@
1
1
  <!-- toggle -->
2
- <div
3
- x-data="{
4
- pressed: {{ params.pressed if params.pressed else 'false' }},
5
- offClasses: '{{ params.offState.classes if params.offState.classes else '' }}',
6
- onClasses: '{{ params.onState.classes if params.onState.classes else '' }}',
7
- toggle() {
8
- if (this.pressed) {
9
- return this.unpress()
10
- }
11
- this.pressed = true
12
- },
13
- unpress() {
14
- this.pressed = false
15
- }
16
- }"
17
- x-id="['toggle-button']"
18
- class="relative"
2
+ <div class="relative c-toggle"
19
3
  >
20
4
  <!-- Button -->
21
5
  <button
22
- x-ref="button"
23
- x-on:click="toggle()"
6
+ aria-checked="false"
7
+ aria-pressed="false"
8
+ aria-expanded="false"
24
9
  {% if params.isSwitch %}
25
10
  role = "switch"
26
- :aria-checked="pressed ? 'true' : 'false'"
27
- {% elseif params.isExpandible == false %}
28
- :aria-pressed="pressed ? 'true' : 'false'"
29
- {% else %}
30
- :aria-expanded="pressed ? 'true' : 'false'"
31
11
  {% endif %}
32
12
  type="button"
33
13
  class="{{ params.classes if params.classes else '' }}"
34
- :class="pressed ? onClasses : offClasses"
35
14
  {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
36
15
  >
37
- <span :class="pressed ? 'hidden' : ''">{{ params.offState.html | safe if params.offState.html else params.offState.text }}</span>
38
- <span :class="pressed ? '' : 'hidden'">{{ params.onState.html | safe if params.onState.html else params.onState.text }}</span>
16
+ <span class="c-button-is-not_pressed pointer-events-none">{{ params.offState.html | safe if params.offState.html else params.offState.text }}</span>
17
+ <span class="c-button-is_pressed hidden pointer-events-none">{{ params.onState.html | safe if params.onState.html else params.onState.text }}</span>
39
18
  </button>
40
19
  </div>
41
- <!-- /toggle -->
20
+ <!-- /toggle -->
@@ -3,6 +3,14 @@
3
3
  ========================================================================== */
4
4
 
5
5
  @layer components {
6
+ .c-tree--base {
7
+ input[type="checkbox"],
8
+ input[type="radio"] {
9
+ @apply w-6;
10
+ @apply h-6;
11
+ }
12
+ }
13
+
6
14
  .c-tree--sm {
7
15
  input[type="checkbox"],
8
16
  input[type="radio"] {
@@ -26,10 +26,10 @@
26
26
  {% set itemHintId = id + "-item-hint" if hasHint else "" %}
27
27
  {% set itemDescribedBy = describedBy if not hasFieldset else "" %}
28
28
  {% set itemDescribedBy = (itemDescribedBy + " " + itemHintId) | trim %}
29
- <div x-data="{ isChecked: {% if not item.checked %}false{% else %}true{% endif %} }" {%- if item.indeterminateChecked %} x-init="$refs.inputCheck.indeterminate=$refs.inputCheck.readOnly=true"{% endif %} class="{%- if params.hasDividers %} border-t border-b border-neutral-base -mb-px{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %}">
29
+ <div class="{%- if params.hasDividers %} border-t border-b border-neutral-base -mb-px{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %}">
30
30
  <div class="relative flex items-start py-xs">
31
31
  <div class="flex items-center mx-sm">
32
- <input x-model="isChecked" x-ref="inputCheck" 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 }}-input" name="{{ name }}" {%- if type == 'checkbox' %} type="checkbox"{% else %} type="radio"{% endif %} value="{{ item.value }}"
32
+ <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 }}-input" name="{{ name }}" {%- if type == 'checkbox' %} type="checkbox"{% else %} type="radio"{% endif %} value="{{ item.value }}"
33
33
  {{-" checked" if item.checked }}
34
34
  {{-" disabled" if item.disabled }}
35
35
  {%- if itemDescribedBy %} aria-describedby="{{ itemDescribedBy }}"{% endif -%}