From f9e97bce3a8f733ebb8a3b9738b222bef26982d9 Mon Sep 17 00:00:00 2001 From: HardJoe Date: Tue, 1 Sep 2020 15:44:58 +0700 Subject: [PATCH] Add Spinner doc and modify Carousel alt text --- docusaurus/docs/carousel.md | 6 +- docusaurus/docs/spinner.md | 147 ++++++++++++++++++++++++++++++++++++ docusaurus/sidebars.js | 3 +- 3 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 docusaurus/docs/spinner.md diff --git a/docusaurus/docs/carousel.md b/docusaurus/docs/carousel.md index 6a70e6b..ded1f4c 100644 --- a/docusaurus/docs/carousel.md +++ b/docusaurus/docs/carousel.md @@ -32,9 +32,9 @@ const content3 = "/img/carousel-card-img.png" prevButton={(prev button)} nextButton={(next button)} > -
tes
-
tes
-
tes
+
content 1
+
content 2
+
content 3
### Props diff --git a/docusaurus/docs/spinner.md b/docusaurus/docs/spinner.md new file mode 100644 index 0000000..60de1d4 --- /dev/null +++ b/docusaurus/docs/spinner.md @@ -0,0 +1,147 @@ +--- +id: spinner +title: Spinner +--- + +import { Spinner, Button } from 'jasper-ui' + +Spinner is a component that functions as a progress indicator while some content is being loaded, useful to show the loading state in your projects. + +## Usage + +Spinner will show at the center of a loading screen. Their appearance, alignment, and sizing can be easily customized in order to enhance visibility. + +## Animations + +The animation style can be configured with the `animation` property. Specifying the `animation` property is optional and by default is set to `linear`. + +### Linear Spinner - `linear` + +
+ +
+ +```jsx + +``` + +### Ease Spinner - `ease` + +
+ +
+ +```jsx + +``` + +### Bouncy Spinner - `bouncy` + +
+ +
+ +```jsx + +``` + +## Variants + +Two visual variants are available for all animation styles by setting the `variant` property. + +
+ + + + + + +
+ +```jsx +<> + + + + + + + +``` + +## Sizes + +In addition to the standard size, additional preconfigured sizes are available by configuring the `size` property. + +
+ + + + +
+ +```jsx +<> + + + + + +``` + +## Speed + +The rotation speed of a Spinner can be altered using the `speed` property. + +
+ + + + + + + + + +
+ +```jsx +<> + + + + + + + + + + +``` + +## Buttons + +Spinner can also be used with buttons. To use this component out-of-the-box you just need to wrap it with a `Button` component. + +
+ +
+ +```jsx +<> + + +``` + +## Props + +| Name | Type | Default | Description | +|--------------|----------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------| +| `variant` | `String` | `default` | Customize Spinner theme between `default` and `regular` | +| `size` | `String` | `md` | Specify the size of Spinner using `xs`, `sm`, `md`, `lg`, or `xl`. | +| `speed` | `String` | `normal` | Speed up or slow down Spinner rotating speed using `slow`, `normal`, or `fast` | +| `animation` | `String` | `linear` | Change Spinner animation type.

Spinner may use one of a variety of animation variants such as:
`linear`, `ease`, `bouncy`. | \ No newline at end of file diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js index 8ede420..6597837 100644 --- a/docusaurus/sidebars.js +++ b/docusaurus/sidebars.js @@ -6,10 +6,11 @@ module.exports = { "alert-box", "button", "card", + "carousel", "footer", "form-fields", "small-nav", - "carousel" + "spinner" ], Info: ["about"] }