|
30 | 30 | {{- /* Generate a unique ID for each tab group. */ -}} |
31 | 31 | {{- $globalID := printf "tabs-%02v" $tabsID -}} |
32 | 32 |
|
| 33 | +{{- /* Keep HTML on single lines to avoid `>` being parsed as blockquote when nested in steps (#876) */ -}} |
33 | 34 | <div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain"> |
34 | | - <div |
35 | | - class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" |
36 | | - {{ if $enableSync }} data-tab-group="{{ delimit $dataTabGroup `,` }}"{{ end }} |
37 | | - > |
| 35 | + <div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800"{{- if $enableSync }} data-tab-group="{{ delimit $dataTabGroup `,` }}"{{- end }}> |
38 | 36 | {{- range $i, $item := $tabs -}} |
39 | | - <button |
40 | | - class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white" |
41 | | - role="tab" |
42 | | - type="button" |
43 | | - aria-controls="tabs-panel-{{ $globalID }}-{{ $item.id }}" |
44 | | - {{- if eq $i $selectedIndex -}} |
45 | | - aria-selected="true" |
46 | | - tabindex="0" |
47 | | - data-state="selected" |
48 | | - {{- end }} |
49 | | - > |
| 37 | + <button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white" role="tab" type="button" aria-controls="tabs-panel-{{ $globalID }}-{{ $item.id }}"{{- if eq $i $selectedIndex }} aria-selected="true" tabindex="0" data-state="selected"{{- end }}> |
50 | 38 | {{- $item.name -}} |
51 | 39 | </button> |
52 | 40 | {{- end -}} |
53 | 41 | </div> |
54 | 42 | </div> |
55 | 43 | <div> |
56 | | - {{- range $i, $item := $tabs -}} |
57 | | - <div |
58 | | - class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" |
59 | | - id="tabs-panel-{{ $globalID }}-{{ $item.id }}" |
60 | | - role="tabpanel" |
61 | | - {{- if eq $i $selectedIndex -}} |
62 | | - tabindex="0" |
63 | | - data-state="selected" |
64 | | - {{ end -}} |
65 | | - > |
66 | | - {{- $item.content | markdownify -}} |
67 | | - </div> |
68 | | - {{- end -}} |
| 44 | + {{- range $i, $item := $tabs -}} |
| 45 | + <div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-{{ $globalID }}-{{ $item.id }}" role="tabpanel"{{- if eq $i $selectedIndex }} tabindex="0" data-state="selected"{{- end }}> |
| 46 | + {{- $item.content | markdownify -}} |
| 47 | + </div> |
| 48 | + {{- end -}} |
69 | 49 | </div> |
0 commit comments