From f2efa73e20cc80dc725b4055608baa1df2bd7d02 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Tue, 6 Dec 2022 11:18:14 -0500 Subject: [PATCH] improve documentation --- docs/components/button-group.md | 60 +++++++------- docs/components/button.md | 2 +- docs/components/popup.md | 2 +- docs/components/visually-hidden.md | 4 +- docs/getting-started/usage.md | 4 +- docs/resources/changelog.md | 5 ++ .../plop/templates/component/component.hbs | 2 +- src/components/alert/alert.styles.ts | 1 - src/components/alert/alert.ts | 28 +++---- .../animated-image/animated-image.styles.ts | 6 ++ .../animated-image/animated-image.ts | 16 ++-- src/components/animation/animation.ts | 11 ++- src/components/avatar/avatar.ts | 10 +-- src/components/badge/badge.ts | 4 +- .../breadcrumb-item/breadcrumb-item.ts | 8 +- src/components/breadcrumb/breadcrumb.ts | 10 +-- src/components/button-group/button-group.ts | 7 +- src/components/button/button.ts | 39 ++++++---- src/components/card/card.ts | 24 +++--- src/components/checkbox/checkbox.ts | 40 ++++++---- src/components/color-picker/color-picker.ts | 51 ++++++------ src/components/details/details.ts | 21 ++--- src/components/dialog/dialog.ts | 28 +++---- src/components/drawer/drawer.ts | 28 +++---- src/components/dropdown/dropdown.ts | 18 +++-- src/components/format-bytes/format-bytes.ts | 2 +- src/components/format-date/format-date.ts | 8 +- src/components/format-number/format-number.ts | 12 +-- src/components/icon-button/icon-button.ts | 13 ++-- src/components/icon/icon.ts | 14 ++-- .../image-comparer/image-comparer.ts | 6 +- src/components/include/include.ts | 9 +-- src/components/input/input.ts | 78 ++++++++++--------- src/components/menu-item/menu-item.ts | 2 +- src/components/menu-label/menu-label.ts | 2 +- .../mutation-observer/mutation-observer.ts | 4 +- src/components/popup/popup.ts | 2 +- src/components/progress-bar/progress-bar.ts | 18 ++--- src/components/progress-ring/progress-ring.ts | 11 +-- src/components/qr-code/qr-code.styles.ts | 12 --- src/components/qr-code/qr-code.ts | 26 +++---- src/components/radio-button/radio-button.ts | 30 +++---- src/components/radio-group/radio-group.ts | 19 ++--- src/components/radio/radio.ts | 12 +-- src/components/range/range.ts | 43 +++++----- src/components/rating/rating.ts | 15 +++- src/components/relative-time/relative-time.ts | 8 +- src/components/select/select.ts | 54 ++++++------- src/components/skeleton/skeleton.ts | 2 +- src/components/spinner/spinner.ts | 4 +- src/components/split-panel/split-panel.ts | 12 ++- src/components/switch/switch.ts | 14 ++-- src/components/tab-group/tab-group.ts | 24 +++--- src/components/tab-panel/tab-panel.ts | 2 +- src/components/tab/tab.ts | 12 +-- src/components/tag/tag.ts | 12 +-- src/components/textarea/textarea.ts | 47 +++++------ src/components/tooltip/tooltip.ts | 15 ++-- src/components/tree-item/tree-item.ts | 32 ++++---- src/components/tree/tree.ts | 16 ++-- .../visually-hidden/visually-hidden.ts | 2 +- src/themes/_utility.css | 5 +- 62 files changed, 553 insertions(+), 475 deletions(-) diff --git a/docs/components/button-group.md b/docs/components/button-group.md index fd99a8e1..841d8bd1 100644 --- a/docs/components/button-group.md +++ b/docs/components/button-group.md @@ -3,7 +3,7 @@ [component-header:sl-button-group] ```html preview - + Left Center Right @@ -14,7 +14,7 @@ import { SlButton, SlButtonGroup } from '@shoelace-style/shoelace/dist/react'; const App = () => ( - + Left Center Right @@ -29,7 +29,7 @@ const App = () => ( All button sizes are supported, but avoid mixing sizes within the same button group. ```html preview - + Left Center Right @@ -37,7 +37,7 @@ All button sizes are supported, but avoid mixing sizes within the same button gr

- + Left Center Right @@ -45,7 +45,7 @@ All button sizes are supported, but avoid mixing sizes within the same button gr

- + Left Center Right @@ -57,7 +57,7 @@ import { SlButton, SlButtonGroup } from '@shoelace-style/shoelace/dist/react'; const App = () => ( <> - + Left Center Right @@ -66,7 +66,7 @@ const App = () => (

- + Left Center Right @@ -75,7 +75,7 @@ const App = () => (

- + Left Center Right @@ -89,7 +89,7 @@ const App = () => ( Theme buttons are supported through the button's `variant` attribute. ```html preview - + Left Center Right @@ -97,7 +97,7 @@ Theme buttons are supported through the button's `variant` attribute.

- + Left Center Right @@ -105,7 +105,7 @@ Theme buttons are supported through the button's `variant` attribute.

- + Left Center Right @@ -113,7 +113,7 @@ Theme buttons are supported through the button's `variant` attribute.

- + Left Center Right @@ -121,7 +121,7 @@ Theme buttons are supported through the button's `variant` attribute.

- + Left Center Right @@ -133,7 +133,7 @@ import { SlButton, SlButtonGroup } from '@shoelace-style/shoelace/dist/react'; const App = () => ( <> - + Left Center Right @@ -142,7 +142,7 @@ const App = () => (

- + Left Center Right @@ -151,7 +151,7 @@ const App = () => (

- + Left Center Right @@ -160,7 +160,7 @@ const App = () => (

- + Left Center Right @@ -169,7 +169,7 @@ const App = () => (

- + Left Center Right @@ -183,7 +183,7 @@ const App = () => ( Pill buttons are supported through the button's `pill` attribute. ```html preview - + Left Center Right @@ -191,7 +191,7 @@ Pill buttons are supported through the button's `pill` attribute.

- + Left Center Right @@ -199,7 +199,7 @@ Pill buttons are supported through the button's `pill` attribute.

- + Left Center Right @@ -211,7 +211,7 @@ import { SlButton, SlButtonGroup } from '@shoelace-style/shoelace/dist/react'; const App = () => ( <> - + Left @@ -226,7 +226,7 @@ const App = () => (

- + Left @@ -241,7 +241,7 @@ const App = () => (

- + Left @@ -261,7 +261,7 @@ const App = () => ( Dropdowns can be placed inside button groups as long as the trigger is an `` element. ```html preview - + Button Button @@ -279,7 +279,7 @@ Dropdowns can be placed inside button groups as long as the trigger is an ` ( - + Button Button @@ -301,7 +301,7 @@ const App = () => ( Create a split button using a button and a dropdown. Use a [visually hidden](/components/visually-hidden) label to ensure the dropdown is accessible to users with assistive devices. ```html preview - + Save @@ -320,7 +320,7 @@ Create a split button using a button and a dropdown. Use a [visually hidden](/co import { SlButton, SlButtonGroup, SlDropdown, SlMenu, SlMenuItem } from '@shoelace-style/shoelace/dist/react'; const App = () => ( - + Save @@ -339,7 +339,7 @@ const App = () => ( Buttons can be wrapped in tooltips to provide more detail when the user interacts with them. ```html preview - + Left @@ -359,7 +359,7 @@ import { SlButton, SlButtonGroup, SlTooltip } from '@shoelace-style/shoelace/dis const App = () => ( <> - + Left diff --git a/docs/components/button.md b/docs/components/button.md index d023e1f7..649d928f 100644 --- a/docs/components/button.md +++ b/docs/components/button.md @@ -134,7 +134,7 @@ const App = () => ( ### Circle Buttons -Use the `circle` attribute to create circular icon buttons. +Use the `circle` attribute to create circular icon buttons. When this attribute is set, the button expects a single `` in the default slot. ```html preview diff --git a/docs/components/popup.md b/docs/components/popup.md index 54755865..33da2eab 100644 --- a/docs/components/popup.md +++ b/docs/components/popup.md @@ -6,7 +6,7 @@ This component's name is inspired by [``](https://github.com/MicrosoftEdg Popup doesn't provide any styles — just positioning! The popup's preferred placement, distance, and skidding (offset) can be configured using attributes. An arrow that points to the anchor can be shown and customized to your liking. Additional positioning options are available and described in more detail below. -!> Popup is a low-level utility built specifically for positioning elements. Do not mistake it for a [tooltip](/components/tooltip) or similar because _it does not facilitate an accessible experience!_ Almost every correct usage of `` will involve building other components. It should rarely, if ever, occur in your own HTML. +!> Popup is a low-level utility built specifically for positioning elements. Do not mistake it for a [tooltip](/components/tooltip) or similar because _it does not facilitate an accessible experience!_ Almost every correct usage of `` will involve building other components. It should rarely, if ever, occur directly in your HTML. ```html preview