Skip to content

Commit 66471ec

Browse files
committed
fix: use proper heading
1 parent d284ad5 commit 66471ec

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

packages/ui-webc/src/components.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export namespace Components {
148148
"type": ItemType1;
149149
}
150150
interface ScoutListViewSubheading {
151+
/**
152+
* @default "h2"
153+
*/
154+
"headingLevel": "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
151155
"text": string;
152156
}
153157
interface ScoutLoader {
@@ -601,6 +605,10 @@ declare namespace LocalJSX {
601605
"type"?: ItemType1;
602606
}
603607
interface ScoutListViewSubheading {
608+
/**
609+
* @default "h2"
610+
*/
611+
"headingLevel"?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
604612
"text"?: string;
605613
}
606614
interface ScoutLoader {

packages/ui-webc/src/components/list-view-subheading/list-view-subheading.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
padding: var(--spacing-2) var(--spacing-4) var(--spacing-1) !important;
88
border: none !important;
99
background-color: transparent;
10+
}
11+
12+
.heading {
13+
margin: 0;
14+
padding: 0;
1015
font: var(--type-body-sm);
1116
color: var(--color-text-base);
1217
font-weight: 500;

packages/ui-webc/src/components/list-view-subheading/list-view-subheading.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ import { Component, Host, h, Prop } from "@stencil/core";
99
})
1010
export class ScoutListViewSubheading {
1111
@Prop() text: string;
12+
@Prop() headingLevel: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" = "h2";
1213

1314
render() {
14-
return <Host role="listitem">{this.text}</Host>;
15+
return (
16+
<Host role="listitem">
17+
<this.headingLevel class="heading">{this.text}</this.headingLevel>
18+
</Host>
19+
);
1520
}
1621
}

packages/ui-webc/src/components/list-view-subheading/readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
## Properties
77

8-
| Property | Attribute | Description | Type | Default |
9-
| -------- | --------- | ----------- | -------- | ----------- |
10-
| `text` | `text` | | `string` | `undefined` |
8+
| Property | Attribute | Description | Type | Default |
9+
| -------------- | --------------- | ----------- | ---------------------------------------------- | ----------- |
10+
| `headingLevel` | `heading-level` | | `"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6"` | `"h2"` |
11+
| `text` | `text` | | `string` | `undefined` |
1112

1213

1314
----------------------------------------------

0 commit comments

Comments
 (0)