Skip to content

Commit 3849b19

Browse files
committed
docs: add some documentation to components
1 parent 15a2849 commit 3849b19

File tree

17 files changed

+92
-2
lines changed

17 files changed

+92
-2
lines changed

.changeset/ten-schools-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@scouterna/ui-webc": patch
3+
---
4+
5+
Add more documentation.

packages/ui-webc/src/components/app-bar/app-bar.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Component, h, Prop } from "@stencil/core";
22

3+
/**
4+
* The App Bar component is used at the top of a page to display a title and
5+
* optional prefix and suffix actions. It's typically used to provide a
6+
* native-like navigation experience.
7+
*/
38
@Component({
49
tag: "scout-app-bar",
510
styleUrl: "app-bar.css",

packages/ui-webc/src/components/app-bar/readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
<!-- Auto Generated Below -->
44

55

6+
## Overview
7+
8+
The App Bar component is used at the top of a page to display a title and
9+
optional prefix and suffix actions. It's typically used to provide a
10+
native-like navigation experience.
11+
612
## Properties
713

814
| Property | Attribute | Description | Type | Default |

packages/ui-webc/src/components/button/button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { Component, Event, type EventEmitter, h, Prop } from "@stencil/core";
33
export type Variant = "primary" | "outlined" | "text" | "caution" | "danger";
44

55
/**
6-
* A simple button component.
6+
* A button component that can be used either as a normal button or as a link.
7+
* Will render a `<button>` element when the `type` is set to "button",
8+
* "submit", or "reset", and an `<a>` element when the `type` is set to "link".
79
*/
810
@Component({
911
tag: "scout-button",

packages/ui-webc/src/components/button/readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
## Overview
99

10-
A simple button component.
10+
A button component that can be used either as a normal button or as a link.
11+
Will render a `<button>` element when the `type` is set to "button",
12+
"submit", or "reset", and an `<a>` element when the `type` is set to "link".
1113

1214
## Properties
1315

packages/ui-webc/src/components/checkbox/checkbox.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ import {
1010
import checkIcon from "@tabler/icons/outline/check.svg";
1111
import { inputMixin } from "../../mixins/inputMixin";
1212

13+
/**
14+
* The checkbox component is used to let users select one or more options from a
15+
* set. For toggling a single option, consider using the Switch component
16+
* instead. When used in a form, make sure to wrap it in a Field component to
17+
* display a label, help text, and error messages.
18+
*/
1319
@Component({
1420
tag: "scout-checkbox",
1521
styleUrl: "checkbox.css",

packages/ui-webc/src/components/checkbox/readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
<!-- Auto Generated Below -->
44

55

6+
## Overview
7+
8+
The checkbox component is used to let users select one or more options from a
9+
set. For toggling a single option, consider using the Switch component
10+
instead. When used in a form, make sure to wrap it in a Field component to
11+
display a label, help text, and error messages.
12+
613
## Properties
714

815
| Property | Attribute | Description | Type | Default |

packages/ui-webc/src/components/field/field.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Component, Element, h, Listen, Prop, State } from "@stencil/core";
22

3+
/**
4+
* The field component is used to wrap form fields with a label, help text, and
5+
* error messages. It automatically captures validation events from its child
6+
* input components and displays error messages accordingly.
7+
*/
38
@Component({
49
tag: "scout-field",
510
styleUrl: "field.css",

packages/ui-webc/src/components/field/readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
<!-- Auto Generated Below -->
44

55

6+
## Overview
7+
8+
The field component is used to wrap form fields with a label, help text, and
9+
error messages. It automatically captures validation events from its child
10+
input components and displays error messages accordingly.
11+
612
## Properties
713

814
| Property | Attribute | Description | Type | Default |

packages/ui-webc/src/components/input/input.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ export type InputMode =
2929
// Hack to suggest above value but still allow any other string value
3030
| (string & {});
3131

32+
/**
33+
* The input component is a basic text input field that can be used to capture
34+
* user input. It supports various types and input modes for different use
35+
* cases. When used in a form, make sure to wrap it in a Field component to
36+
* display a label, help text, and error messages.
37+
*/
3238
@Component({
3339
tag: "scout-input",
3440
styleUrl: "input.css",

0 commit comments

Comments
 (0)