desy-html 10.1.0 → 10.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 +2 -2
- package/docs/ds/_ds.section.layout.njk +2 -2
- package/docs/index.html +13 -0
- package/package.json +1 -1
- package/src/templates/components/card/_examples.card.njk +8 -0
- package/src/templates/components/collapsible/_examples.collapsible.njk +19 -0
- package/src/templates/components/collapsible/_template.collapsible.njk +4 -4
- package/src/templates/components/collapsible/params.collapsible.yaml +16 -0
- package/src/templates/components/footer/_examples.footer.njk +49 -32
- package/src/templates/components/footer/_template.footer.njk +1 -1
- package/src/templates/components/footer/params.footer.yaml +1 -1
- package/src/templates/components/header-advanced/_template.header-advanced.njk +2 -2
- package/src/templates/components/header-advanced/params.header-advanced.yaml +8 -0
- package/src/templates/components/header-mini/_examples.header-mini.njk +283 -8
- package/src/templates/components/header-mini/_template.header-mini.njk +26 -0
- package/src/templates/components/header-mini/params.header-mini.yaml +56 -0
- package/src/templates/components/links-list/_examples.links-list.njk +97 -4
- package/src/templates/components/links-list/_template.links-list.njk +37 -3
- package/src/templates/components/links-list/params.links-list.yaml +21 -1
- package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +187 -12
- package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +72 -5
- package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +3 -3
- package/src/templates/components/menu-vertical/_template.menu-vertical.njk +1 -1
- package/src/templates/components/table/_examples.table.njk +118 -118
- package/src/templates/components/table/_template.table.njk +10 -6
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
{% set headArray = [] %}
|
|
2
|
+
|
|
1
3
|
{#- Capture the HTML so we can optionally nest it in a wrapper -#}
|
|
2
4
|
{% set innerHtml %}
|
|
3
5
|
<table class="c-table
|
|
@@ -6,9 +8,10 @@
|
|
|
6
8
|
<caption {%- if params.captionClasses %} class="{{ params.captionClasses }}"{% endif %}>{{ params.caption }}</caption>
|
|
7
9
|
{% endif %}
|
|
8
10
|
{% if params.head %}
|
|
9
|
-
<thead>
|
|
11
|
+
<thead class="sr-only lg:not-sr-only">
|
|
10
12
|
<tr class="border-t border-b border-neutral-base">
|
|
11
13
|
{% for item in params.head %}
|
|
14
|
+
{% set headArray = (headArray.push(item.html |safe | striptags if item.html else item.text), headArray) %}
|
|
12
15
|
<th scope="col" class="align-top px-base py-sm text-left font-normal text-sm text-neutral-dark {%- if item.classes %} {{ item.classes }}{% endif %}"
|
|
13
16
|
{%- if item.colspan %} colspan="{{ item.colspan }}"{% endif %}
|
|
14
17
|
{%- if item.rowspan %} rowspan="{{ item.rowspan }}"{% endif %}{% for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{{ item.html |safe if item.html else item.text }}</th>
|
|
@@ -19,18 +22,19 @@
|
|
|
19
22
|
<tbody>
|
|
20
23
|
{% for row in params.rows %}
|
|
21
24
|
{% if row %}
|
|
22
|
-
<tr class="border-t border-b border-neutral-base">
|
|
25
|
+
<tr class="block lg:table-row -mb-px lg:mb-0 text-left border-t border-b border-neutral-base">
|
|
23
26
|
{% for cell in row %}
|
|
24
27
|
{% set commonAttributes %}
|
|
28
|
+
data-label="{{ headArray[loop.index0] }}"
|
|
25
29
|
{%- if cell.colspan %} colspan="{{ cell.colspan }}"{% endif %}
|
|
26
30
|
{%- if cell.rowspan %} rowspan="{{ cell.rowspan }}"{% endif %}{% for attribute, value in cell.attributes %} {{ attribute }}="{{ value }}"{% endfor %}
|
|
27
31
|
{% endset %}
|
|
28
32
|
{% if loop.first and params.firstCellIsHeader %}
|
|
29
|
-
<th scope="row" class="align-top px-base py-sm text-left font-normal text-sm text-neutral-dark{%- if cell.classes %} {{ cell.classes }}{% endif %}"
|
|
33
|
+
<th scope="row" class="block lg:table-cell text-left before:block before:text-neutral-dark before:lg:hidden before:content-[attr(data-label)] before:text-sm align-top px-base py-sm text-left font-normal text-sm text-neutral-dark{%- if cell.classes %} {{ cell.classes }}{% endif %}"
|
|
30
34
|
{{- commonAttributes | safe -}}
|
|
31
35
|
>{{ cell.html | safe if cell.html else cell.text }}</th>
|
|
32
36
|
{% else %}
|
|
33
|
-
<td class="px-base py-sm {%- if cell.classes %} {{ cell.classes }}{% endif %}"
|
|
37
|
+
<td class="block lg:table-cell text-left before:block before:text-neutral-dark before:lg:hidden before:content-[attr(data-label)] before:text-sm px-base py-sm {%- if cell.classes %} {{ cell.classes }}{% endif %}"
|
|
34
38
|
{{- commonAttributes | safe -}}
|
|
35
39
|
>{{ cell.html | safe if cell.html else cell.text }}</td>
|
|
36
40
|
{% endif %}
|
|
@@ -43,9 +47,9 @@
|
|
|
43
47
|
<tfoot>
|
|
44
48
|
<tr class="border-t-2 border-b border-neutral-base">
|
|
45
49
|
{% for item in params.foot %}
|
|
46
|
-
<td scope="col" class="px-base py-sm {%- if item.classes %} {{ item.classes }}{% endif %}"
|
|
50
|
+
<td scope="col" class="block lg:table-cell text-left before:block before:text-neutral-dark before:lg:hidden before:content-[attr(data-label)] before:text-sm px-base py-sm {%- if item.classes %} {{ item.classes }}{% endif %}"
|
|
47
51
|
{%- if item.colspan %} colspan="{{ item.colspan }}"{% endif %}
|
|
48
|
-
{%- if item.rowspan %} rowspan="{{ item.rowspan }}"{% endif %}{% for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{{ item.html |safe if item.html else item.text }}</td>
|
|
52
|
+
{%- if item.rowspan %} rowspan="{{ item.rowspan }}"{% endif %}{% for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-label="{{ headArray[loop.index0] }}">{{ item.html |safe if item.html else item.text }}</td>
|
|
49
53
|
{% endfor %}
|
|
50
54
|
</tr>
|
|
51
55
|
</tfoot>
|