Skip to content

Commit

Permalink
docs(label, list): update usage examples (#8192)
Browse files Browse the repository at this point in the history
**Related Issue:** #6374

Updates component usage examples for the label and list components

---------

Co-authored-by: JC Franco <jfranco@esri.com>
Co-authored-by: Matt Driscoll <mdriscoll@esri.com>
Co-authored-by: Ben Elan <no-reply@benelan.dev>
Co-authored-by: jcfranco <jcfranco@users.noreply.github.com>
Co-authored-by: Adam Tirella <adam@tirel.la>
  • Loading branch information
6 people committed Nov 26, 2023
1 parent 897a777 commit 6a1a3cc
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 72 deletions.
11 changes: 8 additions & 3 deletions packages/calcite-components/src/components/label/usage/Basic.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
```html
<calcite-label>
Invalid input
<calcite-input status="invalid" type="search" placeholder="Filter your files" value="adfo2h2"></calcite-input>
<calcite-input-message icon status="invalid"> Something doesn't look right </calcite-input-message>
Email address
<calcite-input
status="invalid"
type="email"
placeholder="Enter your email address"
value="invalidemailformat.com"
></calcite-input>
<calcite-input-message icon status="invalid">Enter a valid email address</calcite-input-message>
</calcite-label>
```
36 changes: 15 additions & 21 deletions packages/calcite-components/src/components/list/usage/Advanced.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
```html
<calcite-list>
<calcite-list-item label="Princess Bubblegum" description="Ruler of The Candy Kingdom">
<calcite-list-item
label="Dog"
description="Also known as Canis familiaris, a carnivorous mammal closely related to the gray wolf that has been domesticated as a pet."
>
<calcite-action icon="drag" label="drag" scale="s" slot="actions-start"></calcite-action>
<calcite-icon scale="l" icon="effects" slot="content-start"></calcite-icon>
<calcite-avatar
scale="l"
slot="content-start"
thumbnail="https://slm-assets.secondlife.com/assets/19947929/view_large/Capture_du_2018-03-04_20-40-56.jpg?1520192584"
></calcite-avatar>
<calcite-icon scale="l" icon="layer" slot="content-start"></calcite-icon>
<calcite-avatar scale="l" slot="content-start" thumbnail="https://placedog.net/300/300"></calcite-avatar>
<calcite-icon scale="s" icon="check" slot="content-end" style="color: var(--calcite-color-success)"></calcite-icon>
<calcite-action icon="ellipsis" label="menu" slot="actions-end"></calcite-action>
<calcite-action icon="x" label="remove" slot="actions-end"></calcite-action>
</calcite-list-item>
<calcite-list-item label="Finn Mertens" description="Part owner of the Tree House">
<calcite-list-item
label="Cat"
description="Also known as Felis catus, a carnivorous mammal that has long been domesticated as a pet and for catching rats and mice."
>
<calcite-action icon="drag" label="drag" scale="s" slot="actions-start"></calcite-action>
<calcite-icon scale="l" icon="running" slot="content-start"></calcite-icon>
<calcite-avatar
scale="l"
slot="content-start"
thumbnail="https://www.seekpng.com/png/detail/90-906849_89kib-1024x631-finn-finn-adventure-time-face.png"
></calcite-avatar>
<calcite-icon scale="l" icon="layer" slot="content-start"></calcite-icon>
<calcite-avatar scale="l" slot="content-start" thumbnail="https://placekitten.com/g/300/300"></calcite-avatar>
<calcite-icon scale="s" icon="check" slot="content-end" style="color: var(--calcite-color-success)"></calcite-icon>
<calcite-action icon="ellipsis" label="menu" slot="actions-end"></calcite-action>
<calcite-action icon="x" label="remove" slot="actions-end"></calcite-action>
</calcite-list-item>
<calcite-list-item label="Jake T. Dog" description="Part owner of the Tree House">
<calcite-list-item label="Bear" description="Carnivorous mammals of the family Ursidae.">
<calcite-action icon="drag" label="drag" scale="s" slot="actions-start"></calcite-action>
<calcite-icon scale="l" icon="walking" slot="content-start"></calcite-icon>
<calcite-avatar
scale="l"
slot="content-start"
thumbnail="https://static.wikia.nocookie.net/adventuretimewithfinnandjake/images/c/c9/603138_454321168018988_647044807_n.png/revision/latest/scale-to-width-down/250?cb=20140624024310"
></calcite-avatar>
<calcite-icon scale="l" icon="layer" slot="content-start"></calcite-icon>
<calcite-avatar scale="l" slot="content-start" thumbnail="https://placebear.com/g/400/400"></calcite-avatar>
<calcite-icon
scale="s"
icon="exclamation-mark-triangle"
Expand Down
14 changes: 6 additions & 8 deletions packages/calcite-components/src/components/list/usage/Basic.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
```html
<calcite-list>
<calcite-list-item
label="Cras iaculis ultricies nulla."
description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
label="Comet"
description="Cosmic snowballs of frozen gases, rock, and dust that orbit the Sun."
></calcite-list-item>
<calcite-list-item
label="Ut aliquam sollicitudin leo."
description="Aliquam tincidunt mauris eu risus."
label="Meteoroid"
description="A small body of matter from outer space that enters Earth's atmosphere and appears like a streak of light."
></calcite-list-item>
<calcite-list-item
label="Vestibulum commodo felis quis tortor.
"
description="Vestibulum auctor dapibus neque.
"
label="Asteroid"
description="A celestial body made of rock and metal that orbits the Sun."
></calcite-list-item>
</calcite-list>
```
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
```html
<calcite-list drag-enabled>
<calcite-list-item label="test1" value="test1" description="hello world 1">
<calcite-icon icon="banana" slot="content-start"></calcite-icon>
<calcite-list-item
label="Don Quixote"
value="1"
description="Don Quixote is a Spanish epic novel by Miguel de Cervantes."
>
<calcite-icon icon="book" slot="content-start"></calcite-icon>
</calcite-list-item>
<calcite-list-item label="test2" value="test2" description="hello world 2">
<calcite-icon icon="accessibility" slot="content-start"></calcite-icon>
<calcite-list-item
label="A Tale of Two Cities"
value="2"
description="A historical novel published in 1859 by Charles Dickens, set in London and Paris before and during the French Revolution."
>
<calcite-icon icon="book" slot="content-start"></calcite-icon>
</calcite-list-item>
<calcite-list-item label="test3" value="test3" description="hello world 3">
<calcite-icon icon="article" slot="content-start"></calcite-icon>
</calcite-list-item>
<calcite-list-item disabled label="test4" value="test4" description="hello world 4">
<calcite-icon icon="compass" slot="content-start"></calcite-icon>
<calcite-list-item
label="The Lord of the Rings"
value="3"
description="An epic high-fantasy novel by the English author and scholar J. R. R. Tolkien."
>
<calcite-icon icon="book" slot="content-start"></calcite-icon>
</calcite-list-item>
</calcite-list>
```
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
```html
<calcite-list drag-enabled group="mygroup" selection-mode="multiple">
<calcite-list-item open label="My Item 1" description="hello world">
<calcite-list drag-enabled group="mygroup" selection-mode="multiple">
<calcite-list-item open label="My Item 2" description="hello world">
<calcite-list drag-enabled group="mygroup" selection-mode="multiple">
<calcite-list-item label="My Item 3" description="hello world">
<calcite-list drag-enabled group="mygroup" selection-mode="multiple"></calcite-list>
</calcite-list-item>
<calcite-list-item label="My Item 4" description="hello world"></calcite-list-item>
</calcite-list>
</calcite-list-item>
<calcite-list-item label="My Item 5" description="hello world"></calcite-list-item>
</calcite-list>
<calcite-list drag-enabled group="Birds">
<calcite-list-item open label="Eagles">
<calcite-list-item
label="Bald Eagle"
description="The bald eagle is a bird of prey found in North America."
></calcite-list-item>
<calcite-list-item
label="Golden Eagle"
description="The golden eagle is a bird of prey living in the Northern Hemisphere."
></calcite-list-item>
</calcite-list-item>
<calcite-list-item open label="Owls">
<calcite-list-item
label="Great Horned Owl"
description="The great horned owl, also known as the tiger owl, or the hoot owl, is a large owl native to the Americas."
></calcite-list-item>
<calcite-list-item
label="Snow Owl"
description="The snowy owl, also known as the polar owl, the white owl and the Arctic owl, is a large, white owl of the true owl family."
></calcite-list-item>
</calcite-list-item>
<calcite-list-item label="My Item 6" description="hello world"></calcite-list-item>
<calcite-list-item label="My Item 7" description="hello world"></calcite-list-item>
</calcite-list>
```
31 changes: 20 additions & 11 deletions packages/calcite-components/src/components/list/usage/Grouped.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
```html
<calcite-list>
<calcite-list-item-group heading="Digits">
<calcite-list-item-group heading="Continents in order of size">
<calcite-list-item
label="One"
description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
label="Asia"
description="Asia is the largest continent in the world by both land area and population."
></calcite-list-item>
<calcite-list-item
label="Africa"
description="Africa is the world's second-largest and second-most populous continent, after Asia in both aspects."
></calcite-list-item>
<calcite-list-item
label="North America"
description="North America is the third largest continent, after Asia and Africa."
></calcite-list-item>
<calcite-list-item label="Two" description="Aliquam tincidunt mauris eu risus."></calcite-list-item>
<calcite-list-item label="Three" description="Vestibulum auctor dapibus neque."></calcite-list-item>
</calcite-list-item-group>
<calcite-list-item-group heading="Letters">
<calcite-list-item-group heading="Mountains in order of height">
<calcite-list-item
label="Mount Everest"
description="Mount Everest is the highest of the Himalayan mountains, and at 8,850 meters considered the highest point on Earth."
></calcite-list-item>
<calcite-list-item
label="A"
description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
label="Godwin Austen (K2)"
description="Mount Godwin-Austen also known as K2 is the second highest mountain in the world at 8,611 meters above sea level."
></calcite-list-item>
<calcite-list-item label="B" description="Aliquam tincidunt mauris eu risus."></calcite-list-item>
<calcite-list-item
label="C"
description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
label="Kangchenjunga"
description="Mount Kanchenjunga Main is the third highest mountain peak in the world with an elevation of 8,586 meters."
></calcite-list-item>
</calcite-list-item-group>
</calcite-list>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```html
<calcite-list selection-mode="multiple">
<calcite-list-item-group heading="Sports">
<calcite-list-item
label="Tennis"
description="Tennis is a racket sport that is played either individually against a single opponent or between two teams of two players each."
></calcite-list-item>
<calcite-list-item
label="Baseball"
description="Baseball is a bat-and-ball sport played between two teams of nine players each, taking turns batting and fielding."
></calcite-list-item>
<calcite-list-item
label="Golf"
description="Golf is a sport in which a small ball is struck with a club into a series of small holes in the ground, the object being to use the fewest possible strokes to complete the course."
></calcite-list-item>
</calcite-list-item-group>
</calcite-list>
```
10 changes: 5 additions & 5 deletions packages/calcite-components/src/components/list/usage/Nested.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
```html
<calcite-list>
<calcite-list-item
label="Cras iaculis ultricies nulla."
description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
label="United States of America"
description="A country located in North America consisting of 50 states."
>
<calcite-list-item label="Ut aliquam sollicitudin leo." description="Aliquam tincidunt mauris eu risus.">
<calcite-list-item label="California" description="A state on the western coast of the United States.">
<calcite-list-item
label="Vestibulum commodo felis quis tortor."
description="Vestibulum auctor dapibus neque."
label="Redlands"
description="A city in California and the hometown of Esri."
></calcite-list-item></calcite-list-item
></calcite-list-item>
</calcite-list>
Expand Down

0 comments on commit 6a1a3cc

Please sign in to comment.