Skip to content

Commit

Permalink
docs(block, button, checkbox, combobox): update component use (#7762)
Browse files Browse the repository at this point in the history
**Related Issue:** #6374

## Summary
Audits the b-named and c-named component usages.

Changes included:
- `block`: spelling change
- `button`: adds `type` to submit example
- `checkbox`: 
  - remove hover use
  - add `calcite-label` to use example
- `combobox`
  - add `"single-persist"` `selectionMode`
  • Loading branch information
geospatialem authored Sep 18, 2023
1 parent a1abc4e commit f4fb2f6
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Renders a header and content that remains open - no collapsible option.

```html
<calcite-block heading="When your son becomes a priest, do you call him..." open>
<div>Father or Son?</div>
<calcite-block heading="Dogs" open>
<ul>
<li>The first species to be domesticated</li>
<li>Domesticated from wolves over 15,000 years ago</li>
<li>Adapted to human behavior performing many roles such as hunting, protection, military, therapy, etc.</li>
</ul>
</calcite-block>
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ Renders a header with a clickable icon to toggle the block open and closed.

```html
<calcite-block heading="Domestic pets" open collapsible>
<calcite-block-section text="puppers rool, kittehs drule"> </calcite-block-section>
<calcite-block-section text="Dogs" open>
<ul>
<li>The first species to be domesticated</li>
<li>Domesticated from wolves over 15,000 years ago</li>
<li>Adapted to human behavior performing many roles such as hunting, protection, military, therapy, etc.</li>
</ul>
</calcite-block-section>
</calcite-block>
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Renders a header and control with a slot for adding a single HTML element (in the header).

```html
<calcite-block heading="This header" description="it has an input">
<calcite-block heading="A fantastic heading" description="Add a control, such as an editing action">
<calcite-action icon="pencil" text="edit" slot="control"></calcite-action>
</calcite-block>
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Renders a header and icon with the icon.

```html
<calcite-block heading="Icon't believe it!">
<div slot="icon">🤯</div>
<calcite-block heading="Dogs">
<div slot="icon">🐕</div>
</calcite-block>
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</calcite-label>
<calcite-button type="reset">I should reset the form (type reset)</calcite-button>
<calcite-button type="button">I should not submit the form (type button)</calcite-button>
<calcite-button>Submit</calcite-button>
<calcite-button type="submit">Submit</calcite-button>
</form>
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
```html
<label for="checked-indeterminate">
Status
<calcite-checkbox checked indeterminate id="checked-indeterminate" name="checked-indeterminate"></calcite-checkbox>
</label>
<calcite-label for="checked-indeterminate">Status</calcite-label>
<calcite-checkbox checked indeterminate id="checked-indeterminate" name="checked-indeterminate"></calcite-checkbox>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```html
<calcite-chip-group label="Basemaps">
<calcite-chip value="topographic">Topographic</calcite-chip>
<calcite-chip value="navigation">Navigation</calcite-chip>
<calcite-chip value="streets">Streets</calcite-chip>
<calcite-chip value="imagery">Imagery</calcite-chip>
</calcite-chip-group>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```html
<calcite-chip-group label="Basemaps" selection-mode="single-persist">
<calcite-chip value="topographic" selected>Topographic</calcite-chip>
<calcite-chip value="navigation">Navigation</calcite-chip>
<calcite-chip value="streets">Streets</calcite-chip>
<calcite-chip value="imagery">Imagery</calcite-chip>
</calcite-chip-group>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```html
<calcite-combobox label="Single selection-mode combobox" selection-mode="single-persist">
<calcite-combobox-item value="Trees" text-label="Trees">
<calcite-combobox-item
value="CommercialDamageAssessment - Damage to Commercial Buildings"
text-label="CommercialDamageAssessment - Damage to Commercial Buildings"
selected
></calcite-combobox-item>
<calcite-combobox-item value="Sequoia" disabled text-label="Sequoia"></calcite-combobox-item>
<calcite-combobox-item value="Douglas Fir" text-label="Douglas Fir"></calcite-combobox-item>
</calcite-combobox-item>
<calcite-combobox-item value="Rivers" text-label="Rivers"></calcite-combobox-item>
</calcite-combobox>
```

0 comments on commit f4fb2f6

Please sign in to comment.