Skip to content

Commit 98fa020

Browse files
authored
[showcase] Normalize code snippets headings level (#536)
* `[showcase][checkbox]` Apply `headingLevel="3"` to code-snippet's * `[showcase][combo-box]` Apply `headingLevel="3"` to code-snippet's * `[showcase][dialog]` Apply `headingLevel="3"` to code-snippet's * `[showcase][icon]` Apply `headingLevel="3"` to code-snippet's * `[showcase][input]` Apply `headingLevel="3"` to code-snippet's * `[showcase][label]` Apply `headingLevel="3"` to code-snippet's * `[showcase][radio-group]` Apply `headingLevel="3"` to code-snippet's * `[showcase][search]` Apply `headingLevel="3"` to code-snippet's * `[showcase][slider]` Apply `headingLevel="3"` to code-snippet's * `[showcase][tabular-grid]` Apply `headingLevel="3"` to code-snippet's * `[showcase][tree-view]` Apply `headingLevel="3"` to code-snippet's * `[showcase][elevation]` Apply `headingLevel="3"` to code-snippet's
1 parent 3035dfd commit 98fa020

File tree

12 files changed

+165
-68
lines changed

12 files changed

+165
-68
lines changed

packages/showcase/src/app/components/checkbox/checkbox.component.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,35 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
66

77
<p class="body-regular-l">{{ metadata.description }}</p>
88

9-
<code-snippet [codeSnippet]="codeSnippets.checked">
9+
<code-snippet [codeSnippet]="codeSnippets.checked" [headingLevel]="3">
1010
<ch-checkbox class="checkbox" caption="The caption"></ch-checkbox>
1111
</code-snippet>
1212

13-
<code-snippet [codeSnippet]="codeSnippets.unchecked">
13+
<code-snippet [codeSnippet]="codeSnippets.unchecked" [headingLevel]="3">
1414
<ch-checkbox
1515
class="checkbox"
1616
caption="The caption"
1717
checked-value="true"
1818
></ch-checkbox>
1919
</code-snippet>
2020

21-
<code-snippet [codeSnippet]="codeSnippets.indeterminate">
21+
<code-snippet [codeSnippet]="codeSnippets.indeterminate" [headingLevel]="3">
2222
<ch-checkbox
2323
class="checkbox"
2424
caption="The caption"
2525
indeterminate
2626
></ch-checkbox>
2727
</code-snippet>
2828

29-
<code-snippet [codeSnippet]="codeSnippets.disabled">
29+
<code-snippet [codeSnippet]="codeSnippets.disabled" [headingLevel]="3">
3030
<ch-checkbox class="checkbox" caption="The caption" disabled></ch-checkbox>
3131
</code-snippet>
3232

33-
<code-snippet [codeSnippet]="codeSnippets.withIcon" language="ts">
33+
<code-snippet
34+
[codeSnippet]="codeSnippets.withIcon"
35+
language="ts"
36+
[headingLevel]="3"
37+
>
3438
<ch-checkbox
3539
class="checkbox"
3640
caption="The caption"
@@ -39,7 +43,10 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
3943
></ch-checkbox>
4044
</code-snippet>
4145

42-
<code-snippet [codeSnippet]="codeSnippets.groupingCheckboxesBlock">
46+
<code-snippet
47+
[codeSnippet]="codeSnippets.groupingCheckboxesBlock"
48+
[headingLevel]="3"
49+
>
4350
<div class="field-group">
4451
<ch-checkbox
4552
class="checkbox"
@@ -59,7 +66,10 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
5966
</div>
6067
</code-snippet>
6168

62-
<code-snippet [codeSnippet]="codeSnippets.groupingCheckboxesInline">
69+
<code-snippet
70+
[codeSnippet]="codeSnippets.groupingCheckboxesInline"
71+
[headingLevel]="3"
72+
>
6373
<div class="field-group-inline">
6474
<ch-checkbox
6575
class="checkbox"

packages/showcase/src/app/components/combo-box/combo-box.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
66

77
<p class="body-regular-l">{{ metadata.description }}</p>
88

9-
<code-snippet [codeSnippet]="codeSnippets.default">
9+
<code-snippet [codeSnippet]="codeSnippets.default" [headingLevel]="3">
1010
<p class="body-regular-m">
1111
To display a combo box with a label, you will have to do the same as working
1212
with native HTML, adding a <code>for</code> attribute for the label with the
@@ -35,30 +35,30 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
3535
</div>
3636
</code-snippet>
3737

38-
<code-snippet [codeSnippet]="codeSnippets.noLabel">
38+
<code-snippet [codeSnippet]="codeSnippets.noLabel" [headingLevel]="3">
3939
<ch-combo-box-render
4040
class="combo-box"
4141
[model]="comboBoxModel"
4242
></ch-combo-box-render>
4343
</code-snippet>
4444

45-
<code-snippet [codeSnippet]="codeSnippets.disabled">
45+
<code-snippet [codeSnippet]="codeSnippets.disabled" [headingLevel]="3">
4646
<ch-combo-box-render
4747
class="combo-box"
4848
disabled
4949
[model]="comboBoxModel"
5050
></ch-combo-box-render>
5151
</code-snippet>
5252

53-
<code-snippet [codeSnippet]="codeSnippets.placeholder">
53+
<code-snippet [codeSnippet]="codeSnippets.placeholder" [headingLevel]="3">
5454
<ch-combo-box-render
5555
class="combo-box"
5656
[model]="comboBoxModel"
5757
[placeholder]="codeSnippets.placeholder.template.properties[1].value"
5858
></ch-combo-box-render>
5959
</code-snippet>
6060

61-
<code-snippet [codeSnippet]="codeSnippets.withIcons">
61+
<code-snippet [codeSnippet]="codeSnippets.withIcons" [headingLevel]="3">
6262
<ch-combo-box-render
6363
class="combo-box"
6464
[model]="comboBoxIconsModel"

packages/showcase/src/app/components/dialog/dialog.component.html

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
3131
</ol>
3232

3333
@if (showDefault()) {
34-
<code-snippet [codeSnippet]="codeSnippets.default" [language]="'ts'">
34+
<code-snippet
35+
[codeSnippet]="codeSnippets.default"
36+
[language]="'ts'"
37+
[headingLevel]="3"
38+
>
3539
<common-snippets
3640
[type]="'spacing-body-description-extended'"
3741
[componentName]="metadata.title"
@@ -80,7 +84,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
8084
}
8185

8286
@if (showWithoutPadding()) {
83-
<code-snippet [codeSnippet]="codeSnippets.withoutPadding" [language]="'ts'">
87+
<code-snippet
88+
[codeSnippet]="codeSnippets.withoutPadding"
89+
[language]="'ts'"
90+
[headingLevel]="3"
91+
>
8492
<button
8593
class="button-primary"
8694
type="button"
@@ -127,7 +135,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
127135
}
128136

129137
@if (showWithHeader()) {
130-
<code-snippet [codeSnippet]="codeSnippets.withHeader" [language]="'ts'">
138+
<code-snippet
139+
[codeSnippet]="codeSnippets.withHeader"
140+
[language]="'ts'"
141+
[headingLevel]="3"
142+
>
131143
<button
132144
class="button-primary"
133145
type="button"
@@ -175,7 +187,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
175187
}
176188

177189
@if (showWithFooter()) {
178-
<code-snippet [codeSnippet]="codeSnippets.withFooter" [language]="'ts'">
190+
<code-snippet
191+
[codeSnippet]="codeSnippets.withFooter"
192+
[language]="'ts'"
193+
[headingLevel]="3"
194+
>
179195
<button
180196
class="button-primary"
181197
type="button"
@@ -225,7 +241,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
225241
}
226242

227243
@if (showResizable()) {
228-
<code-snippet [codeSnippet]="codeSnippets.resizable" [language]="'ts'">
244+
<code-snippet
245+
[codeSnippet]="codeSnippets.resizable"
246+
[language]="'ts'"
247+
[headingLevel]="3"
248+
>
229249
<p class="body-regular-s">
230250
<code>resizable</code> allows you to resize the dialog by dragging from
231251
the edges. You might want in this case to set maximum and minimum block
@@ -295,7 +315,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
295315
}
296316

297317
@if (showAdjustPosition()) {
298-
<code-snippet [codeSnippet]="codeSnippets.adjustPosition" [language]="'ts'">
318+
<code-snippet
319+
[codeSnippet]="codeSnippets.adjustPosition"
320+
[language]="'ts'"
321+
[headingLevel]="3"
322+
>
299323
<p class="body-regular-s">
300324
<code>adjustPositionAfterResize</code> will reposition the dialog after
301325
being resized. This property goes hand in hand with <code>resizable</code>
@@ -350,7 +374,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
350374
}
351375

352376
@if (showNonModal()) {
353-
<code-snippet [codeSnippet]="codeSnippets.nonModal" [language]="'ts'">
377+
<code-snippet
378+
[codeSnippet]="codeSnippets.nonModal"
379+
[language]="'ts'"
380+
[headingLevel]="3"
381+
>
354382
<p class="body-regular-s">
355383
By default, the <code>ch-dialog</code> component functions as a modal,
356384
meaning it prevents interaction with the rest of the page's content when
@@ -402,7 +430,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
402430
}
403431

404432
@if (showAllowDrag()) {
405-
<code-snippet [codeSnippet]="codeSnippets.allowDrag" [language]="'ts'">
433+
<code-snippet
434+
[codeSnippet]="codeSnippets.allowDrag"
435+
[language]="'ts'"
436+
[headingLevel]="3"
437+
>
406438
<p class="body-regular-s">
407439
By default, the <code>ch-dialog</code> component does not support
408440
dragging. You can enable dragging by setting the

packages/showcase/src/app/components/icon/icon.component.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
66

77
<p class="body-regular-l">{{ metadata.description }}</p>
88

9-
<code-snippet [codeSnippet]="codeSnippets.iconSource" [language]="'ts'">
9+
<code-snippet
10+
[codeSnippet]="codeSnippets.iconSource"
11+
[language]="'ts'"
12+
[headingLevel]="3"
13+
>
1014
<p class="body-regular-s">
1115
Mercury provides an utility function to get
1216
<a class="hyperlink" [routerLink]="commonLinks.icons()"
@@ -35,19 +39,19 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
3539
</button>
3640
</code-snippet>
3741

38-
<code-snippet [codeSnippet]="codeSnippets.sizeSmall">
42+
<code-snippet [codeSnippet]="codeSnippets.sizeSmall" [headingLevel]="3">
3943
<button aria-label="Assistant" type="button">
4044
<ch-image class="icon-sm" [src]="ASSISTANT_ICON"></ch-image>
4145
</button>
4246
</code-snippet>
4347

44-
<code-snippet [codeSnippet]="codeSnippets.sizeMedium">
48+
<code-snippet [codeSnippet]="codeSnippets.sizeMedium" [headingLevel]="3">
4549
<button aria-label="Assistant" type="button">
4650
<ch-image class="icon-md" [src]="ASSISTANT_ICON"></ch-image>
4751
</button>
4852
</code-snippet>
4953

50-
<code-snippet [codeSnippet]="codeSnippets.mask">
54+
<code-snippet [codeSnippet]="codeSnippets.mask" [headingLevel]="3">
5155
<button aria-label="Assistant" type="button">
5256
<ch-image class="icon-md" [src]="ASSISTANT_ICON" [type]="'mask'"></ch-image>
5357
</button>

packages/showcase/src/app/components/input/input.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
2828
</ol>
2929

3030
@if (showDefault()) {
31-
<code-snippet [codeSnippet]="codeSnippets.default">
31+
<code-snippet [codeSnippet]="codeSnippets.default" [headingLevel]="3">
3232
<p class="body-regular-m">
3333
To display an input with a label, you will have to do the same as working
3434
with native HTML, adding a <code>for</code> attribute for the label with
@@ -55,19 +55,19 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
5555
}
5656

5757
@if (showNoLabel()) {
58-
<code-snippet [codeSnippet]="codeSnippets.noLabel">
58+
<code-snippet [codeSnippet]="codeSnippets.noLabel" [headingLevel]="3">
5959
<ch-edit accessibleName="Name" class="input"></ch-edit>
6060
</code-snippet>
6161
}
6262

6363
@if (showWithValue()) {
64-
<code-snippet [codeSnippet]="codeSnippets.withValue">
64+
<code-snippet [codeSnippet]="codeSnippets.withValue" [headingLevel]="3">
6565
<ch-edit accessibleName="Name" class="input" value="Pat Taylor"></ch-edit>
6666
</code-snippet>
6767
}
6868

6969
@if (showWithPlaceholder()) {
70-
<code-snippet [codeSnippet]="codeSnippets.withPlaceholder">
70+
<code-snippet [codeSnippet]="codeSnippets.withPlaceholder" [headingLevel]="3">
7171
<ch-edit
7272
accessibleName="Name"
7373
class="input"
@@ -77,7 +77,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
7777
}
7878

7979
@if (showDisabled()) {
80-
<code-snippet [codeSnippet]="codeSnippets.disabled">
80+
<code-snippet [codeSnippet]="codeSnippets.disabled" [headingLevel]="3">
8181
<ch-edit
8282
accessibleName="Name"
8383
class="input"
@@ -88,7 +88,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
8888
}
8989

9090
@if (showWithIcon()) {
91-
<code-snippet [codeSnippet]="codeSnippets.withIcon">
91+
<code-snippet [codeSnippet]="codeSnippets.withIcon" [headingLevel]="3">
9292
<ch-edit
9393
accessibleName="Name"
9494
class="input"

packages/showcase/src/app/components/label/label.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
66

77
<p class="body-regular-l">{{ metadata.description }}</p>
88

9-
<code-snippet [codeSnippet]="codeSnippets.default">
9+
<code-snippet [codeSnippet]="codeSnippets.default" [headingLevel]="3">
1010
<label class="label" for="element-1">{{
1111
codeSnippets.default.template.children
1212
}}</label>
1313
</code-snippet>
1414

15-
<code-snippet [codeSnippet]="codeSnippets.blockStart">
15+
<code-snippet [codeSnippet]="codeSnippets.blockStart" [headingLevel]="3">
1616
<div class="field field-block">
1717
<label class="label" for="element-2">{{
1818
codeSnippets.blockStart.template.children[0].children
@@ -22,7 +22,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
2222
</div>
2323
</code-snippet>
2424

25-
<code-snippet [codeSnippet]="codeSnippets.inlineStart">
25+
<code-snippet [codeSnippet]="codeSnippets.inlineStart" [headingLevel]="3">
2626
<div class="field field-inline">
2727
<label class="label" for="element-3">{{
2828
codeSnippets.inlineStart.template.children[0].children

packages/showcase/src/app/components/radio-group/radio-group.component.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
66

77
<p class="body-regular-l">{{ metadata.description }}</p>
88

9-
<code-snippet [codeSnippet]="codeSnippets.default" [language]="'ts'">
9+
<code-snippet
10+
[codeSnippet]="codeSnippets.default"
11+
[language]="'ts'"
12+
[headingLevel]="3"
13+
>
1014
<ch-radio-group-render
1115
class="radio-group"
1216
[model]="radioGroupModel"
1317
></ch-radio-group-render>
1418
</code-snippet>
1519

16-
<code-snippet [codeSnippet]="codeSnippets.vertical">
20+
<code-snippet [codeSnippet]="codeSnippets.vertical" [headingLevel]="3">
1721
<ch-radio-group-render
1822
class="radio-group"
1923
direction="vertical"

packages/showcase/src/app/components/search/search.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
88
{{ metadata.description }}
99
</p>
1010

11-
<code-snippet [codeSnippet]="codeSnippets.default">
11+
<code-snippet [codeSnippet]="codeSnippets.default" [headingLevel]="3">
1212
<p class="body-regular-m">
1313
To display an input with a label, you will have to do the same as working
1414
with native HTML, adding a <code>for</code> attribute for the label with the
@@ -31,11 +31,11 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
3131
</div>
3232
</code-snippet>
3333

34-
<code-snippet [codeSnippet]="codeSnippets.noLabel">
34+
<code-snippet [codeSnippet]="codeSnippets.noLabel" [headingLevel]="3">
3535
<ch-edit accessibleName="Search" class="input" [type]="'search'"></ch-edit>
3636
</code-snippet>
3737

38-
<code-snippet [codeSnippet]="codeSnippets.value">
38+
<code-snippet [codeSnippet]="codeSnippets.value" [headingLevel]="3">
3939
<ch-edit
4040
accessibleName="Search"
4141
class="input"
@@ -44,7 +44,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
4444
></ch-edit>
4545
</code-snippet>
4646

47-
<code-snippet [codeSnippet]="codeSnippets.placeholder">
47+
<code-snippet [codeSnippet]="codeSnippets.placeholder" [headingLevel]="3">
4848
<ch-edit
4949
accessibleName="Search"
5050
class="input"
@@ -53,7 +53,7 @@ <h1 class="heading-1">{{ metadata.title }}</h1>
5353
></ch-edit>
5454
</code-snippet>
5555

56-
<code-snippet [codeSnippet]="codeSnippets.disabled">
56+
<code-snippet [codeSnippet]="codeSnippets.disabled" [headingLevel]="3">
5757
<ch-edit
5858
accessibleName="Search"
5959
class="input"

0 commit comments

Comments
 (0)