diff --git a/.prettierignore b/.prettierignore index 95f357225c..82fde398d4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -16,4 +16,6 @@ package-lock.json /packages/clay-css/src/scss/bootstrap/**/*.scss /packages/generator-clay-component/app/templates yarn.lock -.next \ No newline at end of file +.next +.netlify +out \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 53e3c8c354..965ebbaf89 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,5 +3,16 @@ "singleQuote": true, "tabWidth": 4, "trailingComma": "es5", - "useTabs": true -} + "useTabs": true, + "overrides": [ + { + "files": [ + "*.mdx" + ], + "options": { + "useTabs": false, + "tabWidth": 2 + } + } + ] +} \ No newline at end of file diff --git a/packages/clay-alert/docs/alert.mdx b/packages/clay-alert/docs/alert.mdx index 6af518076a..b59eabf6aa 100644 --- a/packages/clay-alert/docs/alert.mdx +++ b/packages/clay-alert/docs/alert.mdx @@ -5,11 +5,11 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/alerts/' packageNpm: '@clayui/alert' packageUse: "import Alert from '@clayui/alert';" packageTypes: - [ - 'clay-alert/src/index.tsx', - 'clay-alert/src/Footer.tsx', - 'clay-alert/src/ToastContainer.tsx', - ] + [ + 'clay-alert/src/index.tsx', + 'clay-alert/src/Footer.tsx', + 'clay-alert/src/ToastContainer.tsx', + ] --- ## Display Types @@ -21,30 +21,28 @@ import {Provider} from '@clayui/core'; import Alert from '@clayui/alert'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - This is an info message. - - - - This is a success message. - - - - This is a warning message. - - - - This is a danger message. - -
-
- ); + return ( + +
+ + This is an info message. + + + + This is a success message. + + + + This is a warning message. + + + + This is a danger message. + +
+
+ ); } ``` @@ -59,60 +57,53 @@ import {Provider, Button} from '@clayui/core'; import Alert from '@clayui/alert'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
-
- - - - - } - displayType="warning" - onClose={() => {}} - title="Alert" - variant="inline" - > - A file with this name already exists. - -
- - - This is a stripe variant. - - -
- -
- -
- -
-
-
- ); + return ( + +
+
+ + + + + } + displayType="warning" + onClose={() => {}} + title="Alert" + variant="inline" + > + A file with this name already exists. + +
+ + + This is a stripe variant. + + +
+ +
+ +
+ +
+
+
+ ); } ``` @@ -125,24 +116,22 @@ import {Provider} from '@clayui/core'; import Alert from '@clayui/alert'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - This is a stripe variant. - -
-
- ); + return ( + +
+ + This is a stripe variant. + +
+
+ ); } ``` @@ -153,21 +142,19 @@ import {Provider, Button} from '@clayui/core'; import Alert from '@clayui/alert'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - This is an alert with a button! - - - - -
-
- ); + return ( + +
+ + This is an alert with a button! + + + + +
+
+ ); } ``` @@ -178,24 +165,22 @@ import {Provider, Button} from '@clayui/core'; import Alert from '@clayui/alert'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- View} - displayType="info" - title="With a Button" - variant="inline" - role={null} - > - This is an alert with a button! - -
-
- ); + return ( + +
+ View} + displayType="info" + title="With a Button" + variant="inline" + role={null} + > + This is an alert with a button! + +
+
+ ); } ``` @@ -208,42 +193,38 @@ import {Provider, Button} from '@clayui/core'; import Alert from '@clayui/alert'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [toastItems, setToastItems] = useState([]); - - return ( - -
-
- -
- - - {toastItems.map((value) => ( - { - setToastItems((prevItems) => - prevItems.filter((item) => item !== value) - ); - }} - title="Hola:" - > - My value is {value} - - ))} - -
-
- ); + const [toastItems, setToastItems] = useState([]); + + return ( + +
+
+ +
+ + + {toastItems.map((value) => ( + { + setToastItems((prevItems) => + prevItems.filter((item) => item !== value) + ); + }} + title="Hola:" + > + My value is {value} + + ))} + +
+
+ ); } ``` diff --git a/packages/clay-alert/docs/alert/markup.mdx b/packages/clay-alert/docs/alert/markup.mdx index 0eedfba2b6..aa9080c2c1 100644 --- a/packages/clay-alert/docs/alert/markup.mdx +++ b/packages/clay-alert/docs/alert/markup.mdx @@ -7,9 +7,9 @@ packageUse: "import Alert from '@clayui/alert';" ---
- Don't forget to check{' '} - WAI-ARIA{' '} - accessibility pratices for alerts when writting your markup. + Don't forget to check{' '} + WAI-ARIA{' '} + accessibility pratices for alerts when writting your markup.
## Colors @@ -17,26 +17,26 @@ packageUse: "import Alert from '@clayui/alert';" Lexicon adopts in its design system the following colors below:
-
-
- .alert.alert-success -
-
-
-
- .alert.alert-info -
-
-
-
- .alert.alert-warning -
-
-
-
- .alert.alert-danger -
-
+
+
+ .alert.alert-success +
+
+
+
+ .alert.alert-info +
+
+
+
+ .alert.alert-warning +
+
+
+
+ .alert.alert-danger +
+
### Non-standard Colors @@ -44,26 +44,26 @@ Lexicon adopts in its design system the following colors below: The colors below do not follow Lexicon standards but follow the idea of [​​satellite components](https://liferay.design/lexicon), Clay provides non-standard colors to give you more flexibility to build UI that belong to the product.
-
-
- .alert.alert-primary -
-
-
-
- .alert.alert-secondary -
-
-
-
- .alert.alert-dark -
-
-
-
- .alert.alert-light -
-
+
+
+ .alert.alert-primary +
+
+
+
+ .alert.alert-secondary +
+
+
+
+ .alert.alert-dark +
+
+
+
+ .alert.alert-light +
+
### Variant Sass API @@ -72,18 +72,18 @@ The map `$alert-palette` allows generating any number of alert variants. If a ke ```css $alert-palette: ( - primary: ( - background-color: $primary - ), - '%alert-tertiary': ( - background-color: green - ), - '.alert-tertiary': ( - extend: '%alert-tertiary' - ), - '.alert-quaternary': ( - extend: '%alert-tertiary' - ) + primary: ( + background-color: $primary + ), + '%alert-tertiary': ( + background-color: green + ), + '.alert-tertiary': ( + extend: '%alert-tertiary' + ), + '.alert-quaternary': ( + extend: '%alert-tertiary' + ) ); ``` @@ -91,12 +91,12 @@ Outputs: ```css .alert-primary { - background-color: #0b5fff; + background-color: #0b5fff; } .alert-tertiary, .alert-quaternary { - background-color: green; + background-color: green; } ``` @@ -107,179 +107,177 @@ Outputs: This type of alert is specific for toast messages. These type of messages appear on the top right corner of the screen. The maximum width of a toast message is 360px, and the height can vary depending on the number of rows. It always has a close action.
-
-
-
-
- - - - - - Error: This is an error message - -
-
-
-
- - - - - - Info: This is an info message. - -
-
-
-
-
-
- - - - - - Success: This is a success - message - -
-
-
-
- - - - - - Warning: This is a warning - message. - -
-
-
-
+
+
+
+
+ + + + + + Error: This is an error message + +
+
+
+
+ + + + + + Info: This is an info message. + +
+
+
+
+
+
+ + + + + + Success: This is a success message + +
+
+
+
+ + + + + + Warning: This is a warning message. + +
+
+
+
```html
- ... - Error: This is an error message - + ... + Error: This is an error message +
- ... - Info: This is an info message. - + ... + Info: This is an info message. +
- ... - Success: This is a success message - + ... + Success: This is a success message +
- ... - Warning: This is a warning message. - + ... + Warning: This is a warning message. +
``` @@ -288,75 +286,75 @@ This type of alert is specific for toast messages. These type of messages appear Embedded alerts are meant for use in forms. Usually you will only need to use the information once. Its width depends on the width of the container it is placed in, always respecting the container margins to the content. The close action is not required for embedded alerts.
-
- - - - - - Error: This is an error message -
-
- - - - - - Error: This is a success message -
-
- - - - - - Error: This is an info message -
-
- - - - - - Error: This is a warning message -
+
+ + + + + + Error: This is an error message +
+
+ + + + + + Error: This is a success message +
+
+ + + + + + Error: This is an info message +
+
+ + + + + + Error: This is a warning message +
```html
- ... - Error:This is an error message + ... + Error:This is an error message
- ... - Error:This is a success message + ... + Error:This is a success message
- ... - Error:This is an info message + ... + Error:This is an info message
- ... - Error:This is a warning message + ... + Error:This is a warning message
``` @@ -365,179 +363,179 @@ Embedded alerts are meant for use in forms. Usually you will only need to use th Stripe alerts are always placed below the last navigation element, either the header or the navigation bar. This alert usually appears on "Save" action, communicating the status of the action once received from the server. The close action is mandatory in this alert type. Its width is always full container width and pushes all the content below it.
-
-
- - - - - - Danger This is an error message - -
-
-
-
- - - - - - Success This is a success message - -
-
-
-
- - - - - - Info This is an info message - -
-
-
-
- - - - - - Warning This is a warning message - -
-
+
+
+ + + + + + Danger This is an error message + +
+
+
+
+ + + + + + Success This is a success message + +
+
+
+
+ + + + + + Info This is an info message + +
+
+
+
+ + + + + + Warning This is a warning message + +
+
```html
-
- ... - Danger This is an error message - -
+
+ ... + Danger This is an error message + +
-
- ... - Success This is a success message - -
+
+ ... + Success This is a success message + +
-
- ... - Info This is an info message - -
+
+ ... + Info This is an info message + +
-
- ... - Warning This is a warning message - -
+
+ ... + Warning This is a warning message + +
``` @@ -546,695 +544,681 @@ Stripe alerts are always placed below the last navigation element, either the he Add the modifier `alert-feedback` on the `alert` element to remove the `background`, `border`, and `padding`.
-
-
-
-
- - - - - -
-
-
-
- Primary Indicator: - - with some additional text and a{' '} - - link - - . - -
-
-
-
-
-
-
-
- - - - - -
-
-
-
- Autofit Primary Indicator -
-
-
- -
-
-
-
-
- - - - - -
-
-
-
- Secondary Indicator: - - with some additional text and a{' '} - - link - - . - -
-
-
-
-
- - - - - - Secondary Indicator - -
-
-
-
-
- - - - - -
-
-
-
- Success Indicator: - - with some additional text and a{' '} - - link - - . - -
-
-
-
-
- - - - - - Success Indicator - -
-
-
-
-
- - - - - -
-
-
-
- Info Indicator: - - with some additional text and a{' '} - - link - - . - -
-
-
-
-
- - - - - - Info Indicator - -
-
-
-
-
- - - - - -
-
-
-
- Warning Indicator: - - with some additional text and a{' '} - - link - - . - -
-
-
-
-
- - - - - - Warning Indicator - -
-
-
-
-
- - - - - -
-
-
-
- Danger Indicator: - - with some additional text and a{' '} - - link - - . - -
-
-
-
-
- - - - - - Danger Indicator - -
+
+
+
+
+ + + + + +
+
+
+
+ Primary Indicator: + + with some additional text and a{' '} + + link + + . + +
+
+
+
+
+
+
+
+ + + + + +
+
+
+
+ Autofit Primary Indicator +
+
+
+ +
+
+
+
+
+ + + + + +
+
+
+
+ Secondary Indicator: + + with some additional text and a{' '} + + link + + . + +
+
+
+
+
+ + + + + + Secondary Indicator + +
+
+
+
+
+ + + + + +
+
+
+
+ Success Indicator: + + with some additional text and a{' '} + + link + + . + +
+
+
+
+
+ + + + + + Success Indicator + +
+
+
+
+
+ + + + + +
+
+
+
+ Info Indicator: + + with some additional text and a{' '} + + link + + . + +
+
+
+
+
+ + + + + + Info Indicator + +
+
+
+
+
+ + + + + +
+
+
+
+ Warning Indicator: + + with some additional text and a{' '} + + link + + . + +
+
+
+
+
+ + + + + + Warning Indicator + +
+
+
+
+
+ + + + + +
+
+
+
+ Danger Indicator: + + with some additional text and a{' '} + + link + + . + +
+
+
+
+
+ + + + + + Danger Indicator + +
```html
-
-
-
- - - - - -
-
-
-
- Primary Indicator: - with some additional text and a - link. -
-
-
+
+
+
+ + + + + +
+
+
+
+ Primary Indicator: + with some additional text and a + link. +
+
+
-
-
-
- - - - - -
-
-
-
- Autofit Primary Indicator -
-
-
- +
+
+
+ + + + + +
+
+
+
+ Autofit Primary Indicator +
+
+
+
-
-
-
- - - - - -
-
-
-
- Secondary Indicator: - with some additional text and a - link. -
-
-
+
+
+
+ + + + + +
+
+
+
+ Secondary Indicator: + with some additional text and a + link. +
+
+
- - - - - - Secondary Indicator - + + + + + + Secondary Indicator +
-
-
-
- - - - - -
-
-
-
- Success Indicator: - with some additional text and a - link. -
-
-
+
+
+
+ + + + + +
+
+
+
+ Success Indicator: + with some additional text and a + link. +
+
+
- - - - - - Success Indicator - + + + + + + Success Indicator +
-
-
-
- - - - - -
-
-
-
- Info Indicator: - with some additional text and a - link. -
-
-
+
+
+
+ + + + + +
+
+
+
+ Info Indicator: + with some additional text and a + link. +
+
+
- - - - - - Info Indicator - + + + + + + Info Indicator +
-
-
-
- - - - - -
-
-
-
- Warning Indicator: - with some additional text and a - link. -
-
-
+
+
+
+ + + + + +
+
+
+
+ Warning Indicator: + with some additional text and a + link. +
+
+
- - - - - - Warning Indicator - + + + + + + Warning Indicator +
-
-
-
- - - - - -
-
-
-
- Danger Indicator: - with some additional text and a - link. -
-
-
+
+
+
+ + + + + +
+
+
+
+ Danger Indicator: + with some additional text and a + link. +
+
+
- - - - - - Danger Indicator - + + + + + + Danger Indicator +
``` @@ -1243,207 +1227,201 @@ Add the modifier `alert-feedback` on the `alert` element to remove the `backgrou An alternative to using autofit utilities, this keeps the text after the indicator icon from flowing under the icon when it breaks to a new line.
-

alert-dismissible

-
-
-
-
- - - - - - Success: - - Strong kopi-luwak half and half single origin single - shot, half and half instant latte brewed latte. At, - decaffeinated, blue mountain viennese barista, spoon - carajillo shop viennese dark. And ristretto caffeine, - plunger pot black, café au lait galão flavour foam - strong. Macchiato roast, breve fair trade seasonal et - cultivar. - -
-
-
- -
-

alert-fluid

-
-
- - - - - - Primary: - - Strong kopi-luwak half and half single origin single shot, half - and half instant latte brewed latte. At, decaffeinated, blue - mountain viennese barista, spoon carajillo shop viennese dark. - And ristretto caffeine, plunger pot black, café au lait galão - flavour foam strong. Macchiato roast, breve fair trade seasonal - et cultivar. - -
-
-

alert-feedback

-
- - - - - - Danger: - - Strong kopi-luwak half and half single origin single shot, half and - half instant latte brewed latte. At, decaffeinated, blue mountain - viennese barista, spoon carajillo shop viennese dark. And ristretto - caffeine, plunger pot black, café au lait galão flavour foam strong. - Macchiato roast, breve fair trade seasonal et cultivar. - - -
+

alert-dismissible

+
+
+
+
+ + + + + + Success: + + Strong kopi-luwak half and half single origin single shot, half and + half instant latte brewed latte. At, decaffeinated, blue mountain + viennese barista, spoon carajillo shop viennese dark. And ristretto + caffeine, plunger pot black, café au lait galão flavour foam strong. + Macchiato roast, breve fair trade seasonal et cultivar. + +
+
+
+ +
+

alert-fluid

+
+
+ + + + + + Primary: + + Strong kopi-luwak half and half single origin single shot, half and half + instant latte brewed latte. At, decaffeinated, blue mountain viennese + barista, spoon carajillo shop viennese dark. And ristretto caffeine, + plunger pot black, café au lait galão flavour foam strong. Macchiato + roast, breve fair trade seasonal et cultivar. + +
+
+

alert-feedback

+
+ + + + + + Danger: + + Strong kopi-luwak half and half single origin single shot, half and half + instant latte brewed latte. At, decaffeinated, blue mountain viennese + barista, spoon carajillo shop viennese dark. And ristretto caffeine, + plunger pot black, café au lait galão flavour foam strong. Macchiato + roast, breve fair trade seasonal et cultivar. + + +
```html
-
-
-
- - - - - - Success: - Strong kopi-luwak half and half single origin single shot, - half and half instant latte brewed latte. At, decaffeinated, - blue mountain viennese barista, spoon carajillo shop - viennese dark. And ristretto caffeine, plunger pot black, - café au lait galão flavour foam strong. Macchiato roast, - breve fair trade seasonal et cultivar. -
-
-
- +
+
+
+ + + + + + Success: + Strong kopi-luwak half and half single origin single shot, half and + half instant latte brewed latte. At, decaffeinated, blue mountain + viennese barista, spoon carajillo shop viennese dark. And ristretto + caffeine, plunger pot black, café au lait galão flavour foam strong. + Macchiato roast, breve fair trade seasonal et cultivar. +
+
+
+
-
- - - - - - Primary: - Strong kopi-luwak half and half single origin single shot, half and - half instant latte brewed latte. At, decaffeinated, blue mountain - viennese barista, spoon carajillo shop viennese dark. And ristretto - caffeine, plunger pot black, café au lait galão flavour foam strong. - Macchiato roast, breve fair trade seasonal et cultivar. -
+
+ + + + + + Primary: + Strong kopi-luwak half and half single origin single shot, half and half + instant latte brewed latte. At, decaffeinated, blue mountain viennese + barista, spoon carajillo shop viennese dark. And ristretto caffeine, + plunger pot black, café au lait galão flavour foam strong. Macchiato + roast, breve fair trade seasonal et cultivar. +
- - - - - - Danger: - Strong kopi-luwak half and half single origin single shot, half and - half instant latte brewed latte. At, decaffeinated, blue mountain - viennese barista, spoon carajillo shop viennese dark. And ristretto - caffeine, plunger pot black, café au lait galão flavour foam strong. - Macchiato roast, breve fair trade seasonal et cultivar. - + + + + + + Danger: + Strong kopi-luwak half and half single origin single shot, half and half + instant latte brewed latte. At, decaffeinated, blue mountain viennese + barista, spoon carajillo shop viennese dark. And ristretto caffeine, plunger + pot black, café au lait galão flavour foam strong. Macchiato roast, breve + fair trade seasonal et cultivar. +
``` @@ -1452,522 +1430,480 @@ An alternative to using autofit utilities, this keeps the text after the indicat This changes an alert to use `display: inline-block`. It will only expand to be as wide as its content and max out at the parent container's width.
-
-
-
-
- - - - - - Success: - - File uploaded. Would you like to add categories - automatically? - -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- - - - - - Alert: - A file with this name already exists. -
-
-
-
-
-
- -
-
- -
-
-
-
-
- -
-
-
-
-
-
- - - - - - Info: - Would you like to add categories automatically? -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - - Info: - - Would you like to add categories automatically? - -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - - Error: - The file wasn't uploaded. -
-
-
-
-
-
- -
-
-
-
-
- -
+
+
+
+
+ + + + + + Success: + + File uploaded. Would you like to add categories automatically? + +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + Alert: + A file with this name already exists. +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + Info: + Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + Info: + Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + Error: + The file wasn't uploaded. +
+
+
+
+
+
+ +
+
+
+
+
+ +
```html
-
-
-
- - - - - - Success: - File uploaded. Would you like to add categories - automatically? -
-
-
-
-
-
- -
-
-
-
-
- +
+
+
+ + + + + + Success: + File uploaded. Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+
-
-
-
- - - - - - Alert: - A file with this name already exists. -
-
-
-
-
-
- -
-
- -
-
-
-
-
- +
+
+
+ + + + + + Alert: + A file with this name already exists. +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
-
-
-
- - - - - - Info: - Would you like to add categories automatically? -
-
-
-
-
-
- -
-
-
-
-
- +
+
+
+ + + + + + Info: + Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+
-
-
-
-
- - - - - - Info: - Would you like to add categories automatically? -
-
-
-
-
-
- -
-
-
-
-
- -
+
+
+
+
+ + + + + + Info: + Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+ +
-
-
-
- - - - - - Error: - The file wasn't uploaded. -
-
-
-
-
-
- -
-
-
-
-
- +
+
+
+ + + + + + Error: + The file wasn't uploaded. +
+
+
+
+
+
+ +
+
+
+
+
+
``` @@ -1976,112 +1912,102 @@ This changes an alert to use `display: inline-block`. It will only expand to be The class `alert-autofit-stacked` forces each `autofit-col` to stack on top of each other, apply it on the `alert` element.
-
-
-
-
- - - - - - Success: - - File uploaded. Would you like to add categories - automatically? - -
-
-
-
-
-
- -
-
-
-
-
- -
+
+
+
+
+ + + + + + Success: + + File uploaded. Would you like to add categories automatically? + +
+
+
+
+
+
+ +
+
+
+
+
+ +
```html
-
-
-
- - - - - - Success: - File uploaded. Would you like to add categories - automatically? -
-
-
-
-
-
- -
-
-
-
-
- +
+
+
+ + + + + + Success: + File uploaded. Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+
``` @@ -2090,112 +2016,102 @@ The class `alert-autofit-stacked` forces each `autofit-col` to stack on top of e The class `alert-autofit-stacked-sm-down` forces each `autofit-col` to stack on top of each other at screen sizes 767px and below, apply it on the `alert` element.
-
-
-
-
- - - - - - Success: - - File uploaded. Would you like to add categories - automatically? - -
-
-
-
-
-
- -
-
-
-
-
- -
+
+
+
+
+ + + + + + Success: + + File uploaded. Would you like to add categories automatically? + +
+
+
+
+
+
+ +
+
+
+
+
+ +
```html
-
-
-
- - - - - - Success: - File uploaded. Would you like to add categories - automatically? -
-
-
-
-
-
- -
-
-
-
-
- +
+
+
+ + + + + + Success: + File uploaded. Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+
``` @@ -2204,112 +2120,102 @@ The class `alert-autofit-stacked-sm-down` forces each `autofit-col` to stack on The class `alert-autofit-stacked-xs-down` forces each `autofit-col` to stack on top of each other at screen sizes 575px and below, apply it on the `alert` element.
-
-
-
-
- - - - - - Success: - - File uploaded. Would you like to add categories - automatically? - -
-
-
-
-
-
- -
-
-
-
-
- -
+
+
+
+
+ + + + + + Success: + + File uploaded. Would you like to add categories automatically? + +
+
+
+
+
+
+ +
+
+
+
+
+ +
```html
-
-
-
- - - - - - Success: - File uploaded. Would you like to add categories - automatically? -
-
-
-
-
-
- -
-
-
-
-
- +
+
+
+ + + + + + Success: + File uploaded. Would you like to add categories automatically? +
+
+
+
+
+
+ +
+
+
+
+
+
``` @@ -2320,350 +2226,322 @@ These examples are not included in the Lexicon design system but they are built ### Alert Lists
- +
```html ``` @@ -2673,79 +2551,79 @@ These examples are not included in the Lexicon design system but they are built All alerts accept HTML as their content. You can use the following modifiers: -- `.lead` inside of an alert to make the beginning of your message stand out -- `.alert-link` to style a link inside your alert +- `.lead` inside of an alert to make the beginning of your message stand out +- `.alert-link` to style a link inside your alert
-
- - - - - - Warning: This alert is a - - warning message - - . -
+
+ + + + + + Warning: This alert is a + + warning message + + . +
```html
- ... - Warning: This alert is a - warning message. + ... + Warning: This alert is a + warning message.
``` ### Dismissible Alerts
-
- - - - - - Success: This is a success closeable alert - -
+
+ + + + + + Success: This is a success closeable alert + +
```html
- ... - Success: This is a success closeable alert - + ... + Success: This is a success closeable alert +
``` @@ -2755,7 +2633,7 @@ An absolute positioned container for placing alerts on the top right corner rela ```html
-
...
+
...
``` @@ -2765,8 +2643,8 @@ A fixed positioned container for placing alerts on the top right corner of the p ```html
-
- ... -
+
+ ... +
``` diff --git a/packages/clay-autocomplete/docs/autocomplete.mdx b/packages/clay-autocomplete/docs/autocomplete.mdx index 36a3aa4aa5..dd25e7dd4d 100644 --- a/packages/clay-autocomplete/docs/autocomplete.mdx +++ b/packages/clay-autocomplete/docs/autocomplete.mdx @@ -5,10 +5,10 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/forms/text-in packageNpm: '@clayui/autocomplete' packageUse: "import Autocomplete from '@clayui/autocomplete';" packageTypes: - [ - 'clay-autocomplete/src/LegacyAutocomplete.tsx', - 'clay-autocomplete/src/Item.tsx', - ] + [ + 'clay-autocomplete/src/LegacyAutocomplete.tsx', + 'clay-autocomplete/src/Item.tsx', + ] --- ## Example @@ -19,39 +19,30 @@ import Autocomplete from '@clayui/autocomplete'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - {(item) => ( - - {item} - - )} - - -
-
- ); + return ( + +
+ + + + {(item) => {item}} + + +
+
+ ); } ``` @@ -67,18 +58,18 @@ Autocomplete follows the Collection pattern, the same as TreeView and VerticalBa ```jsx - Apples - Bananas - Cantaloupe - Mangos - Oranges - Strawberries + Apples + Bananas + Cantaloupe + Mangos + Oranges + Strawberries ``` @@ -86,26 +77,26 @@ Autocomplete follows the Collection pattern, the same as TreeView and VerticalBa Dynamic content works when the data comes from a service, there are two possible scenarios: -- All data exists on the client and the filter is done on the client -- The filter is done on the server +- All data exists on the client and the filter is done on the client +- The filter is done on the server ```jsx - {(item) => {item}} + {(item) => {item}} ``` @@ -113,36 +104,34 @@ The most common scenario for a large list of data is the filter is done on the s ```jsx function Example() { - const [value, setValue] = useState(''); - - const [networkStatus, setNetworkStatus] = useState(4); - const {resource} = useResource({ - fetchPolicy: 'cache-first', - link: 'https://api.clay.example/devs/', - onNetworkStatusChange: setNetworkStatus, - variables: {name: value}, - }); - - return ( - {}} - placeholder="Enter the name of a fruit" - value={value} - > - {(item) => ( - - {item.name} - - )} - - ); + const [value, setValue] = useState(''); + + const [networkStatus, setNetworkStatus] = useState(4); + const {resource} = useResource({ + fetchPolicy: 'cache-first', + link: 'https://api.clay.example/devs/', + onNetworkStatusChange: setNetworkStatus, + variables: {name: value}, + }); + + return ( + {}} + placeholder="Enter the name of a fruit" + value={value} + > + {(item) => ( + {item.name} + )} + + ); } ``` @@ -156,44 +145,40 @@ The value of Autocomplete by default is an empty value, but it can start with a ```jsx function Example() { - const [value, setValue] = useState('Apples'); - - return ( - <> - - {(item) => ( - {item} - )} - - - - {(item) => ( - {item} - )} - - - ); + const [value, setValue] = useState('Apples'); + + return ( + <> + + {(item) => {item}} + + + + {(item) => {item}} + + + ); } ``` @@ -203,37 +188,35 @@ Autocomplete supports loading data asynchronously, and displays the loading indi ```jsx function Example() { - const [value, setValue] = useState(''); - - const [networkStatus, setNetworkStatus] = useState(4); - const {resource} = useResource({ - fetchPolicy: 'cache-first', - link: 'https://api.clay.example/devs/', - onNetworkStatusChange: setNetworkStatus, - variables: {name: value}, - }); - - return ( - {}} - placeholder="Enter a name" - value={value} - > - {(item) => ( - - {item.name} - - )} - - ); + const [value, setValue] = useState(''); + + const [networkStatus, setNetworkStatus] = useState(4); + const {resource} = useResource({ + fetchPolicy: 'cache-first', + link: 'https://api.clay.example/devs/', + onNetworkStatusChange: setNetworkStatus, + variables: {name: value}, + }); + + return ( + {}} + placeholder="Enter a name" + value={value} + > + {(item) => ( + {item.name} + )} + + ); } ``` @@ -241,47 +224,45 @@ Autocomplete also supports infinite scrolling to load more data on demand as the ```jsx function Example() { - const [value, setValue] = useState(''); - - const [networkStatus, setNetworkStatus] = useState(4); - const {loadMore, resource} = useResource({ - fetch: async (link, options) => { - const result = await fetch(link, options); - const json = await result.json(); - - return { - cursor: json.next, - items: json.results, - }; - }, - fetchPolicy: 'cache-first', - link: 'https://api.clay.example/devs/', - onNetworkStatusChange: setNetworkStatus, - variables: {name: value}, - }); - - return ( - {}} - onLoadMore={loadMore} - placeholder="Enter a name" - value={value} - > - {(item) => ( - - {item.name} - - )} - - ); + const [value, setValue] = useState(''); + + const [networkStatus, setNetworkStatus] = useState(4); + const {loadMore, resource} = useResource({ + fetch: async (link, options) => { + const result = await fetch(link, options); + const json = await result.json(); + + return { + cursor: json.next, + items: json.results, + }; + }, + fetchPolicy: 'cache-first', + link: 'https://api.clay.example/devs/', + onNetworkStatusChange: setNetworkStatus, + variables: {name: value}, + }); + + return ( + {}} + onLoadMore={loadMore} + placeholder="Enter a name" + value={value} + > + {(item) => ( + {item.name} + )} + + ); } ``` @@ -291,40 +272,38 @@ By default, Autocomplete uses the `contains` string filtering strategy to decide ```jsx function Example() { - const options = [ - 'Apples', - 'Bananas', - 'Cantaloupe', - 'Mangos', - 'Oranges', - 'Strawberries', - ]; - - const [value, setValue] = useState(''); - - const filteredItems = useMemo( - () => - options.filter( - (item) => value.match(new RegExp(value, 'i')) !== null - ), - [value] - ); - - return ( - {}} - placeholder="Enter the name of a fruit" - value={value} - > - {(item) => {item}} - - ); + const options = [ + 'Apples', + 'Bananas', + 'Cantaloupe', + 'Mangos', + 'Oranges', + 'Strawberries', + ]; + + const [value, setValue] = useState(''); + + const filteredItems = useMemo( + () => + options.filter((item) => value.match(new RegExp(value, 'i')) !== null), + [value] + ); + + return ( + {}} + placeholder="Enter the name of a fruit" + value={value} + > + {(item) => {item}} + + ); } ``` @@ -338,46 +317,37 @@ import Autocomplete from '@clayui/autocomplete'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - {(item) => ( - - {item} - - )} - - -
-
- ); + return ( + +
+ + + + {(item) => {item}} + + +
+
+ ); } ``` diff --git a/packages/clay-autocomplete/docs/autocomplete/markup.mdx b/packages/clay-autocomplete/docs/autocomplete/markup.mdx index 62ca1aa283..d11f1e3686 100644 --- a/packages/clay-autocomplete/docs/autocomplete/markup.mdx +++ b/packages/clay-autocomplete/docs/autocomplete/markup.mdx @@ -11,296 +11,282 @@ packageUse: "import Autocomplete from '@clayui/autocomplete';" Add the class `.autocomplete-dropdown-menu` to `dropdown-menu` to size the Dropdown Menu according to Lexicon Design specifications.
- This requires external javascript to populate and show/hide the{' '} - .dropdown-menu. + This requires external javascript to populate and show/hide the{' '} + .dropdown-menu.
-
-
- -
-
- -
-
- You can use a comma to enter tags. - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual. -
-
-
-
-
-
+
+
+ +
+
+ +
+
+ You can use a comma to enter tags. + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual. +
+
+
+
+
+
```html
- -
-
-
- - -
-
-
- You can use a comma to enter tags. - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual. -
-
-
-
+ +
+
+
+ + +
+
+
+ You can use a comma to enter tags. + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual. +
+
+
+
``` ## Search Field
-
- -
-
-
- - - - - - -
-
-
-
+
+ +
+
+
+ + + + + + +
+
+
+
```html
- -
-
-
- - - - - - -
-
-
+ +
+
+
+ + + + + + +
+
+
``` ## Loading
-
- -
-
-
- - - - - - -
    -
  • - - Loading... - -
  • -
-
-
-
-
+
+ +
+
+
+ + + + + + +
    +
  • + Loading... +
  • +
+
+
+
+
```html
- -
-
-
- - - - - - -
    -
  • - Loading... -
  • -
-
-
-
+ +
+
+
+ + + + + + +
    +
  • + Loading... +
  • +
+
+
+
``` diff --git a/packages/clay-badge/docs/badge.mdx b/packages/clay-badge/docs/badge.mdx index 7d322fc809..0919f289f3 100644 --- a/packages/clay-badge/docs/badge.mdx +++ b/packages/clay-badge/docs/badge.mdx @@ -17,21 +17,19 @@ import {Provider} from '@clayui/core'; import Badge from '@clayui/badge'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - - - -
-
- ); + return ( + +
+ + + + + + +
+
+ ); } ``` @@ -46,20 +44,18 @@ import {Provider} from '@clayui/core'; import Badge from '@clayui/badge'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - - -
-
- ); + return ( + +
+ + + + + +
+
+ ); } ``` @@ -72,29 +68,27 @@ import {Provider} from '@clayui/core'; import Badge from '@clayui/badge'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - - -
-
- ); + return ( + +
+ + + + + +
+
+ ); } ``` ## Beta (Deprecated)
- The property displayType="beta" has been deprecated in favor of - semantic attributes displayType="info" and{' '} - translucent. + The property displayType="beta" has been deprecated in favor of + semantic attributes displayType="info" and{' '} + translucent.
A component to indicate beta features in DXP. The `badge-beta` variant doesn’t have any interaction. It just informs the user. It uses a Badge component with custom visual states. @@ -104,25 +98,23 @@ import {Provider} from '@clayui/core'; import Badge from '@clayui/badge'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- -
-
- ); + return ( + +
+ +
+
+ ); } ``` ## Beta Dark (Deprecated)
- The property displayType="beta-dark" has been deprecated in - favor of semantic attributes dark,{' '} - displayType="info" and translucent. + The property displayType="beta-dark" has been deprecated in favor + of semantic attributes dark, displayType="info" and{' '} + translucent.
`badge-beta-dark` is a dark variant of `badge-beta` to be used with dark backgrounds. @@ -132,15 +124,13 @@ import {Provider} from '@clayui/core'; import Badge from '@clayui/badge'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- -
-
- ); + return ( + +
+ +
+
+ ); } ``` diff --git a/packages/clay-badge/docs/badge/markup.mdx b/packages/clay-badge/docs/badge/markup.mdx index f7f00f6688..4396a7cdc6 100644 --- a/packages/clay-badge/docs/badge/markup.mdx +++ b/packages/clay-badge/docs/badge/markup.mdx @@ -7,11 +7,11 @@ packageUse: "import Badge from '@clayui/badge';" ---
- Badge Sizes have been removed. Use the{' '} - - clay-badge-size($map) mixin - - to create custom badge sizes for your app. + Badge Sizes have been removed. Use the{' '} + + clay-badge-size($map) mixin + + to create custom badge sizes for your app.
## Variations @@ -19,63 +19,63 @@ packageUse: "import Badge from '@clayui/badge';" Add any of the below mentioned modifier classes to change the appearance of a badge.
- - Primary - - - Secondary - - - Success - - - Info - - - Warning - - - Danger - - - Light - - - Dark - + + Primary + + + Secondary + + + Success + + + Info + + + Warning + + + Danger + + + Light + + + Dark +
```html - Primary + Primary - Secondary + Secondary - Success + Success - Info + Info - Warning + Warning - Danger + Danger - Light + Light - Dark + Dark ``` @@ -85,21 +85,21 @@ The map `$badge-palette` allows generating any number of badge variants. If a ke ```css $badge-palette: ( - primary: ( - background-color: $primary - ), - '.badge-primary-2': ( - extend: '%badge-primary' - ), - '%badge-tertiary': ( - background-color: green - ), - '.badge-tertiary': ( - extend: '%badge-tertiary' - ), - '.badge-quaternary': ( - extend: '%badge-tertiary' - ) + primary: ( + background-color: $primary + ), + '.badge-primary-2': ( + extend: '%badge-primary' + ), + '%badge-tertiary': ( + background-color: green + ), + '.badge-tertiary': ( + extend: '%badge-tertiary' + ), + '.badge-quaternary': ( + extend: '%badge-tertiary' + ) ); ``` @@ -108,12 +108,12 @@ Outputs: ```css .badge-primary, .badge-primary-2 { - background-color: #0b5fff; + background-color: #0b5fff; } .badge-tertiary, .badge-quaternary { - background-color: green; + background-color: green; } ``` @@ -122,139 +122,139 @@ Outputs: Use the `.badge-pill` modifier class to make badges more rounded.
- - Primary - - - Secondary - - - Success - - - Info - - - Warning - - - Danger - - - Light - - - Dark - + + Primary + + + Secondary + + + Success + + + Info + + + Warning + + + Danger + + + Light + + + Dark +
```html - Primary + Primary - Secondary + Secondary - Success + Success - Info + Info - Warning + Warning - Danger + Danger - Light + Light - Dark + Dark ``` ## Anchor
- - Primary - + + Primary +
```html - Primary + Primary ``` ## Links Inside
- - - - - - - - - - Secondary - - - - - + + + + + + + + + + Secondary + + + + +
```html - - - - - - - - - Primary - - - - + + + + + + + + + Primary + + + + ``` @@ -263,26 +263,26 @@ Use the `.badge-pill` modifier class to make badges more rounded. Wrap the text inside the `.text-truncate-inline` and `.text-truncate` modifier class.
- - - - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre - - - - + + + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre + + + +
```html - - - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre - - - + + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre + + + ``` diff --git a/packages/clay-breadcrumb/docs/breadcrumb.mdx b/packages/clay-breadcrumb/docs/breadcrumb.mdx index 80d4dafa8b..5e5b476045 100644 --- a/packages/clay-breadcrumb/docs/breadcrumb.mdx +++ b/packages/clay-breadcrumb/docs/breadcrumb.mdx @@ -16,39 +16,37 @@ import {Provider} from '@clayui/core'; import Breadcrumb from '@clayui/breadcrumb'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- -
-
- ); + return ( + +
+ +
+
+ ); } ``` diff --git a/packages/clay-breadcrumb/docs/breadcrumb/markup.mdx b/packages/clay-breadcrumb/docs/breadcrumb/markup.mdx index d6956d89b7..a0cd56c6a0 100644 --- a/packages/clay-breadcrumb/docs/breadcrumb/markup.mdx +++ b/packages/clay-breadcrumb/docs/breadcrumb/markup.mdx @@ -11,222 +11,218 @@ A navigation aid for your site, provide a quick way to jump back to previously v Use `` inside breadcrumb links to truncate text based on a max-width.
- Breadcrumb will use{' '} - $breadcrumb-divider-svg-icon by - default, set $breadcrumb-divider-svg-icon: none; if you wish to use the - UTF-8 charset or third-party icon font. + Breadcrumb will use{' '} + $breadcrumb-divider-svg-icon by + default, set $breadcrumb-divider-svg-icon: none; if you wish to use the UTF-8 + charset or third-party icon font.
- Don't forget to check{' '} - WAI-ARIA{' '} - accessibility pratices for alerts when writting your markup. + Don't forget to check{' '} + WAI-ARIA{' '} + accessibility pratices for alerts when writting your markup.
## Collapsed
- +
```html ``` ## Expanded
- +
```html ``` diff --git a/packages/clay-button/docs/button.mdx b/packages/clay-button/docs/button.mdx index 8ee2c1c2d2..303eed32a4 100644 --- a/packages/clay-button/docs/button.mdx +++ b/packages/clay-button/docs/button.mdx @@ -5,11 +5,11 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/buttons/' packageNpm: '@clayui/button' packageUse: "import Button from '@clayui/button';" packageTypes: - [ - 'clay-button/src/Button.tsx', - 'clay-button/src/ButtonWithIcon.tsx', - 'clay-button/src/Group.tsx', - ] + [ + 'clay-button/src/Button.tsx', + 'clay-button/src/ButtonWithIcon.tsx', + 'clay-button/src/Group.tsx', + ] --- ## Display Types @@ -23,21 +23,19 @@ import {Provider} from '@clayui/core'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - - - -
-
- ); + return ( + +
+ + + + + + +
+
+ ); } ``` @@ -52,22 +50,20 @@ import {Provider} from '@clayui/core'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - - - - - - -
-
- ); + return ( + +
+ + + + + + + +
+
+ ); } ``` @@ -81,25 +77,19 @@ import Button, {ClayButtonWithIcon} from '@clayui/button'; import Icon from '@clayui/icon'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - -
-
- ); + return ( + +
+ + +
+
+ ); } ``` diff --git a/packages/clay-button/docs/button/markup.mdx b/packages/clay-button/docs/button/markup.mdx index f091e85396..d200d250d4 100644 --- a/packages/clay-button/docs/button/markup.mdx +++ b/packages/clay-button/docs/button/markup.mdx @@ -7,35 +7,35 @@ packageUse: "import Button from '@clayui/button';" ---
- Don't forget to check{' '} - WAI-ARIA{' '} - accessibility pratices for buttons when writting your markup. + Don't forget to check{' '} + WAI-ARIA{' '} + accessibility pratices for buttons when writting your markup.
## Examples
- - - - - - - + + + + + + +
```html @@ -54,18 +54,18 @@ The map `$btn-palette` allows generating any number of button variants. If a key ```css $btn-palette: ( - primary: ( - background-color: $primary - ), - '%btn-tertiary': ( - background-color: green - ), - '.btn-tertiary': ( - extend: '%btn-tertiary' - ), - '.btn-quaternary': ( - extend: '%btn-tertiary' - ) + primary: ( + background-color: $primary + ), + '%btn-tertiary': ( + background-color: green + ), + '.btn-tertiary': ( + extend: '%btn-tertiary' + ), + '.btn-quaternary': ( + extend: '%btn-tertiary' + ) ); ``` @@ -73,27 +73,27 @@ Outputs: ```css .btn-primary { - background-color: #0b5fff; + background-color: #0b5fff; } .btn-tertiary, .btn-quaternary { - background-color: green; + background-color: green; } ``` ## Sizes
- - - + + +
```html @@ -105,26 +105,26 @@ Outputs: Create block level buttons—those that span the full width of a parent—by adding `.btn-block`.
- - - + + +
```html ``` @@ -134,18 +134,18 @@ The map `$btn-sizes` allows generating any number of button size variants. If a ```css $btn-sizes: ( - btn-sm: ( - font-size: 14px - ), - '.btn-xs': ( - extend: '%clay-btn-sm' - ), - '%btn-xxs': ( - font-size: 12px - ), - '.btn-xxs': ( - extend: '%btn-xxs' - ) + btn-sm: ( + font-size: 14px + ), + '.btn-xs': ( + extend: '%clay-btn-sm' + ), + '%btn-xxs': ( + font-size: 12px + ), + '.btn-xxs': ( + extend: '%btn-xxs' + ) ); ``` @@ -154,11 +154,11 @@ Outputs: ```css .btn-sm, .btn-xs { - font-size: 14px; + font-size: 14px; } .btn-xxs { - font-size: 12px; + font-size: 12px; } ``` @@ -167,12 +167,12 @@ Outputs: Buttons will appear pressed when active. However, you can still force the same active appearance with `.active` (and include the `aria-pressed="true"` attribute) should you need to replicate the state programmatically.
- - + +
```html @@ -185,18 +185,18 @@ Buttons will appear pressed when active. However, you can still force the same a Make buttons look inactive by adding the `disabled` boolean attribute to any ` - + + ```html ``` @@ -207,84 +207,84 @@ Make buttons look inactive by adding the `disabled` boolean attribute to any ` -
- - -
- - Action - -
- - Scope - -
-
-
- - -
- - Action - -
- - Scope - -
-
+
+ + +
+ + Action + +
+ + Scope + +
+
+
+ + +
+ + Action + +
+ + Scope + +
+
```html
- - + +
``` @@ -293,42 +293,42 @@ Split buttons are used when you need to offer the user a quick main action along Button groups are used to switch between complementary views for example, but they must never be used for complementary actions, "Change and Cancel" actions, or "Save and Cancel" actions. In those cases, single buttons are the correct solution.
-
-
- - - -
-
-
-
- - - - -
-
+
+
+ + + +
+
+
+
+ + + + +
+
```html
- - - + + +
``` @@ -339,187 +339,187 @@ Buttons can display icons instead of text. The icons, however, must be monospace Try adding the modifier class `.btn-monospaced`.
-
- - -
-
- - -
-
- - -
+
+ + +
+
+ + +
+
+ + +
```html ``` @@ -529,18 +529,18 @@ The map `$btn-monospaced-sizes` allows generating any number of button monospace ```css $btn-monospaced-sizes: ( - btn-monospaced-sm: ( - font-size: 14px - ), - '.btn-monospaced.btn-xs': ( - extend: '%clay-btn-monospaced-sm' - ), - '%btn-monospaced-xxs': ( - font-size: 12px - ), - '.btn-monospaced.btn-xxs': ( - extend: '%btn-monospaced-xxs' - ) + btn-monospaced-sm: ( + font-size: 14px + ), + '.btn-monospaced.btn-xs': ( + extend: '%clay-btn-monospaced-sm' + ), + '%btn-monospaced-xxs': ( + font-size: 12px + ), + '.btn-monospaced.btn-xxs': ( + extend: '%btn-monospaced-xxs' + ) ); ``` @@ -549,11 +549,11 @@ Outputs: ```css .btn-monospaced.btn-sm, .btn-monospaced.btn-xs { - font-size: 14px; + font-size: 14px; } .btn-monospaced.btn-xxs { - font-size: 12px; + font-size: 12px; } ``` @@ -564,82 +564,82 @@ This button type is only used in sites, outside of administration. The icon emph Wrap the icon with the `` tag and adding the [Inline Item](/docs/css/inline-item) utilities, try adding the `.inline-item.inline-item-(before|after)` modifier class.
- - - + + +
```html ``` @@ -650,79 +650,79 @@ Wrap the icon with the `` tag and adding the [Inline Item](/docs/css/inl The class `rounded-pill` will make the button pill shaped.
- - - + + +
```html ``` diff --git a/packages/clay-card/docs/card.mdx b/packages/clay-card/docs/card.mdx index 14c62ec76f..1b71cd1518 100644 --- a/packages/clay-card/docs/card.mdx +++ b/packages/clay-card/docs/card.mdx @@ -5,19 +5,19 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/cards/' packageNpm: '@clayui/card' packageUse: "import ClayCard from '@clayui/card';" packageTypes: - [ - 'clay-card/src/Card.tsx', - 'clay-card/src/CardWithHorizontal.tsx', - 'clay-card/src/CardWithInfo.tsx', - 'clay-card/src/CardWithNavigation.tsx', - 'clay-card/src/CardWithUser.tsx', - 'clay-card/src/AspectRatio.tsx', - 'clay-card/src/Body.tsx', - 'clay-card/src/Caption.tsx', - 'clay-card/src/Description.tsx', - 'clay-card/src/Group.tsx', - 'clay-card/src/Row.tsx', - ] + [ + 'clay-card/src/Card.tsx', + 'clay-card/src/CardWithHorizontal.tsx', + 'clay-card/src/CardWithInfo.tsx', + 'clay-card/src/CardWithNavigation.tsx', + 'clay-card/src/CardWithUser.tsx', + 'clay-card/src/AspectRatio.tsx', + 'clay-card/src/Body.tsx', + 'clay-card/src/Caption.tsx', + 'clay-card/src/Description.tsx', + 'clay-card/src/Group.tsx', + 'clay-card/src/Row.tsx', + ] --- ## Composing @@ -34,33 +34,28 @@ import Card from '@clayui/card'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
-
- - - - {'Card Title'} - - - { - 'Some quick example text to build on the card title and make up the bulk of the card content.' - } - - - - -
-
-
- ); + return ( + +
+
+ + + + {'Card Title'} + + + { + 'Some quick example text to build on the card title and make up the bulk of the card content.' + } + + + + +
+
+
+ ); } ``` @@ -73,40 +68,35 @@ import {Provider} from '@clayui/core'; import Card from '@clayui/card'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - -
- thumbnail -
-
-
- - {'So ristretto cappuccino'} - - - {'Wings eu, pumpkin spice robusta.'} - -
-
-
-
-
-
- ); + return ( + +
+ + +
+ thumbnail +
+
+
+ + {'So ristretto cappuccino'} + + + {'Wings eu, pumpkin spice robusta.'} + +
+
+
+
+
+
+ ); } ``` @@ -124,49 +114,42 @@ import Sticker from '@clayui/sticker'; import Label from '@clayui/label'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
-
- - -
- -
- - {'DOC'} - -
- - -
-
- - {'deliverable.doc'} - - - {'Stevie Ray Vaughn'} - - - - -
-
-
-
-
-
-
-
- ); + return ( + +
+
+ + +
+ +
+ + {'DOC'} + +
+ + +
+
+ + {'deliverable.doc'} + + + {'Stevie Ray Vaughn'} + + + + +
+
+
+
+
+
+
+
+ ); } ``` @@ -174,11 +157,11 @@ export default function App() { ClayCard's high-level components predict the major cases of the Lexicon specification: -- Cards with Images -- Card for user listing -- Card for docs listing -- Card for folder -- Card for navigation +- Cards with Images +- Card for user listing +- Card for docs listing +- Card for folder +- Card for navigation #### CardWithInfo @@ -189,53 +172,51 @@ import {Provider} from '@clayui/core'; import {ClayCardWithInfo} from '@clayui/card'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
-
- { - alert('you clicked!'); - }, - }, - {type: 'divider'}, - { - href: '#', - label: 'linkable', - }, - ]} - description="A cool description" - href="#" - labels={[ - { - displayType: 'success', - value: 'Awesome', - }, - { - displayType: 'danger', - value: 'Crazy', - }, - ]} - onSelectChange={(newVal) => setValue(newVal)} - selected={value} - stickerProps={{ - content: 'DOC', - displayType: 'danger', - }} - title="Selectable File" - /> -
-
-
- ); + const [value, setValue] = useState(false); + + return ( + +
+
+ { + alert('you clicked!'); + }, + }, + {type: 'divider'}, + { + href: '#', + label: 'linkable', + }, + ]} + description="A cool description" + href="#" + labels={[ + { + displayType: 'success', + value: 'Awesome', + }, + { + displayType: 'danger', + value: 'Crazy', + }, + ]} + onSelectChange={(newVal) => setValue(newVal)} + selected={value} + stickerProps={{ + content: 'DOC', + displayType: 'danger', + }} + title="Selectable File" + /> +
+
+
+ ); } ``` @@ -247,28 +228,26 @@ import {ClayCardWithNavigation} from '@clayui/card'; import Icon from '@clayui/icon'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
-
-
- alert('clicked')} - title="onClick Card with icon" - > - - -
-
-
-
- ); + const [value, setValue] = useState(false); + + return ( + +
+
+
+ alert('clicked')} + title="onClick Card with icon" + > + + +
+
+
+
+ ); } ``` @@ -279,51 +258,49 @@ import {Provider} from '@clayui/core'; import {ClayCardWithUser} from '@clayui/card'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
-
-
- { - alert('you clicked!'); - }, - }, - {type: 'divider'}, - { - href: '#', - label: 'linkable', - }, - ]} - description="Assistant to the regional manager" - href="#" - labels={[ - { - displayType: 'success', - value: 'Awesome', - }, - { - displayType: 'danger', - value: 'Crazy', - }, - ]} - name="Abraham Kuyper" - onSelectChange={() => {}} - selected={true} - /> -
-
-
-
- ); + const [value, setValue] = useState(false); + + return ( + +
+
+
+ { + alert('you clicked!'); + }, + }, + {type: 'divider'}, + { + href: '#', + label: 'linkable', + }, + ]} + description="Assistant to the regional manager" + href="#" + labels={[ + { + displayType: 'success', + value: 'Awesome', + }, + { + displayType: 'danger', + value: 'Crazy', + }, + ]} + name="Abraham Kuyper" + onSelectChange={() => {}} + selected={true} + /> +
+
+
+
+ ); } ``` @@ -334,39 +311,37 @@ import {Provider} from '@clayui/core'; import {ClayCardWithHorizontal} from '@clayui/card'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
-
-
- { - alert('you clicked!'); - }, - }, - {type: 'divider'}, - { - href: '#', - label: 'linkable', - }, - ]} - href="#" - onSelectChange={setValue} - selected={value} - title="Selectable Folder" - /> -
-
-
-
- ); + const [value, setValue] = useState(false); + + return ( + +
+
+
+ { + alert('you clicked!'); + }, + }, + {type: 'divider'}, + { + href: '#', + label: 'linkable', + }, + ]} + href="#" + onSelectChange={setValue} + selected={value} + title="Selectable Folder" + /> +
+
+
+
+ ); } ``` diff --git a/packages/clay-card/docs/card/markup.mdx b/packages/clay-card/docs/card/markup.mdx index 3e8aac6d7f..3051492780 100644 --- a/packages/clay-card/docs/card/markup.mdx +++ b/packages/clay-card/docs/card/markup.mdx @@ -9,18 +9,18 @@ packageUse: "import ClayCard from '@clayui/card';" ## Example
-
-
-
Card title
-

- Some quick example text to build on the card title and make up - the bulk of the card's content. -

- - Go somewhere - -
-
+
+
+
Card title
+

+ Some quick example text to build on the card title and make up the bulk + of the card's content. +

+ + Go somewhere + +
+
```html @@ -45,14 +45,14 @@ Cards support a wide variety of content, including images, text, list groups, li The building block of a card is the `.card-body`. Use it whenever you need a padded section within a card.
-
-
This is some text within a card body.
-
+
+
This is some text within a card body.
+
```html
-
This is some text within a card body.
+
This is some text within a card body.
``` @@ -63,22 +63,22 @@ Card titles are used by adding `.card-title` to a `` tag. In the same way, l Subtitles are used by adding a `.card-subtitle` to a `` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-body` item, the card title and subtitle are aligned nicely.
-
-
-
Card title
-
Card subtitle
-

- Some quick example text to build on the card title and make up - the bulk of the card's content. -

- - Card link - - - Another link - -
-
+
+
+
Card title
+
Card subtitle
+

+ Some quick example text to build on the card title and make up the bulk + of the card's content. +

+ + Card link + + + Another link + +
+
```html @@ -101,49 +101,49 @@ Subtitles are used by adding a `.card-subtitle` to a `` tag. If the `.card-t Use classes `card-item-first` and `card-item-last` on elements that appear at the beginning or ending of your card. It styles the `border-radius` to match the card's `border-radius`. These classes work similar to Bootstrap 4's `.card-img-top` and `.card-img-bottom` but also covers left and right.
-
-
-
-
- thumbnail -
-
-

Joe Bloggs

-

Administrator

-

- Wings eu, pumpkin spice robusta, kopi-luwak mocha - caffeine froth grounds. -

-
-
-
-
-
-
-
-
-

Space Program

-
-

- Because you live life on the edge of space. -

-
-
-
- -
-
-
-
-
+
+
+
+
+ thumbnail +
+
+

Joe Bloggs

+

Administrator

+

+ Wings eu, pumpkin spice robusta, kopi-luwak mocha caffeine froth + grounds. +

+
+
+
+
+
+
+
+
+

Space Program

+
+

+ Because you live life on the edge of space. +

+
+
+
+ +
+
+
+
+
```html @@ -191,64 +191,60 @@ Use classes `card-item-first` and `card-item-last` on elements that appear at th Add an optional header and/or footer within a card.
-
-
Featured
-
-
Special title treatment
-

- With supporting text below as a natural lead-in to additional - content. -

- - Go somewhere - -
-
+
+
Featured
+
+
Special title treatment
+

+ With supporting text below as a natural lead-in to additional content. +

+ + Go somewhere + +
+
```html
-
Featured
-
-
Special title treatment
-

- With supporting text below as a natural lead-in to additional - content. -

- Go somewhere -
+
Featured
+
+
Special title treatment
+

+ With supporting text below as a natural lead-in to additional content. +

+ Go somewhere +
``` Card headers can be styled by adding `.card-header` to `` elements.
-
-
Featured
-
-
Special title treatment
-

- With supporting text below as a natural lead-in to additional - content. -

- - Go somewhere - -
-
+
+
Featured
+
+
Special title treatment
+

+ With supporting text below as a natural lead-in to additional content. +

+ + Go somewhere + +
+
```html
-
Featured
-
-
Special title treatment
-

- With supporting text below as a natural lead-in to additional - content. -

- Go somewhere -
+
Featured
+
+
Special title treatment
+

+ With supporting text below as a natural lead-in to additional content. +

+ Go somewhere +
``` @@ -257,38 +253,36 @@ Card headers can be styled by adding `.card-header` to `` elements. Use `
` to create a horizontal division between content inside a card.
-
-
-
-
- autofit-col-expand -
-
-
-
-

Title

-
-

autofit-col-expand

-
-
-
-
+
+
+
+
autofit-col-expand
+
+
+
+

Title

+
+

autofit-col-expand

+
+
+
+
```html
-
-
-
autofit-col-expand
-
-
-
-

Title

-
-

autofit-col-expand

-
-
-
+
+
+
autofit-col-expand
+
+
+
+

Title

+
+

autofit-col-expand

+
+
+
``` @@ -299,547 +293,492 @@ Use `
` to create a horizontal division betwe Just add `image-card` class on the same element that `card` class have being added.
-
-
-
-
- thumbnail - - JPG - -
-
-
-
-
-

- - - thumbnail_coffee.jpg - - -

-

- - - Author Action - - -

-
-
-
-
-
-
-
-
-
- - PNG - -
-
-
-
-
-

- - - empty-background.png - - -

-

- - - Author Action - - -

-
-
-
-
-
-
-
-
-
-
- - - -
- - SVG - -
-
-
-
-
-

- - - lexicon_icon_camera_av93ii2oofffmmmsjf2332.svg - - -

-

- - - Author Action - - -

-
-
-
-
-
-
-
+
+
+
+
+ thumbnail + + JPG + +
+
+
+
+
+

+ + + thumbnail_coffee.jpg + + +

+

+ + Author Action + +

+
+
+
+
+
+
+
+
+
+ PNG +
+
+
+
+
+

+ + + empty-background.png + + +

+

+ + Author Action + +

+
+
+
+
+
+
+
+
+
+
+ + + +
+ + SVG + +
+
+
+
+
+

+ + + lexicon_icon_camera_av93ii2oofffmmmsjf2332.svg + + +

+

+ + Author Action + +

+
+
+
+
+
+
+
```html
-
- thumbnail - JPG -
-
-
-
-
-

- - thumbnail_coffee.jpg - -

-

- - Author Action - -

-
-
-
-
+
+ thumbnail + JPG +
+
+
+
+
+

+ + thumbnail_coffee.jpg + +

+

+ + Author Action + +

+
+
+
+
-
- PNG -
-
-
-
-
-

- - empty-background.png - -

-

- - Author Action - -

-
-
-
-
+
+ PNG +
+
+
+
+
+

+ + empty-background.png + +

+

+ + Author Action + +

+
+
+
+
-
-
- - - -
- SVG -
-
-
-
-
-

- - lexicon_icon_camera_av93ii2oofffmmmsjf2332.svg - -

-

- - Author Action - -

-
-
-
-
+
+
+ + + +
+ SVG +
+
+
+
+
+

+ + lexicon_icon_camera_av93ii2oofffmmmsjf2332.svg + +

+

+ + Author Action + +

+
+
+
+
``` ### File Card
-
-
-
-
- - - -
- - DOC - -
-
-
-
-
-

- - - deliverable.doc - - -

-

- - - Stevie Ray Vaughn - - -

-
- - - Approved - - -
-
-
-
-
-
-
+
+
+
+
+ + + +
+ DOC +
+
+
+
+
+

+ + + deliverable.doc + + +

+

+ + Stevie Ray Vaughn + +

+
+ + Approved + +
+
+
+
+
+
+
```html
-
-
- - - -
- DOC -
-
-
-
-
-

- - deliverable.doc - -

-

- - Stevie Ray Vaughn - -

-
- - Approved - -
-
-
-
-
+
+
+ + + +
+ DOC +
+
+
+
+
+

+ + deliverable.doc + +

+

+ + Stevie Ray Vaughn + +

+
+ + Approved + +
+
+
+
+
``` ### User Card
-
-
-
-
-
- - - thumbnail - - -
-
-
-
-
-
-

- - - User Name - - -

-

- - - Latest Action - - -

-
-
-
-
-
-
-
-
-
-
-
- - - - - - - -
-
-
-
-
-
-

- - - User Name - - -

-

- - - Latest Action - - -

-
-
-
-
-
-
-
-
+
+
+
+
+
+ + + thumbnail + + +
+
+
+
+
+
+

+ + + User Name + + +

+

+ + Latest Action + +

+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + +
+
+
+
+
+
+

+ + + User Name + + +

+

+ + Latest Action + +

+
+
+
+
+
+
+
+
```html
-
-
- - - thumbnail - - -
-
-
-
-
-
-

- - User Name - -

-

- - Latest Action - -

-
-
-
-
+
+
+ + + thumbnail + + +
+
+
+
+
+
+

+ + User Name + +

+

+ + Latest Action + +

+
+
+
+
``` ### Horizontal Card ```html ``` @@ -848,125 +787,122 @@ Just add `image-card` class on the same element that `card` class have being add #### Default
-
-
-
-
-
- -
-
-
-

Widget Page

-
- Build a page by adding widgets and content. -
-
-
-
- -
-
-
-
- - - -
-
-
-

Blog

-
-
-
-
+
+
+
+
+
+ +
+
+
+

Widget Page

+
+ Build a page by adding widgets and content. +
+
+
+
+ +
+
+
+
+ + + +
+
+
+

Blog

+
+
+
+
```html
-
-
- -
-
-
-

Widget Page

-
- Build a page by adding widgets and content. -
-
+
+
+ +
+
+
+

Widget Page

+
Build a page by adding widgets and content.
+
- - - - - - - Content Page - This is an example of card-type-template using an anchor tag. - + + + + + + + Content Page + This is an example of card-type-template using an anchor tag. +
-
-
- - - -
-
-
-

Blog

-
+
+
+ + + +
+
+
+

Blog

+
``` @@ -982,7 +918,7 @@ Just add `image-card` class on the same element that `card` class have being add - + @@ -1010,7 +946,7 @@ Just add `image-card` class on the same element that `card` class have being add - + @@ -1037,7 +973,7 @@ Just add `image-card` class on the same element that `card` class have being add - + @@ -1061,103 +997,97 @@ Just add `image-card` class on the same element that `card` class have being add ```html
-
-
-
- - - - - - - -
-
-
-
- - Content Page - -
-
-
-
-
+
+
+
+ + + + + + + +
+
+
+
+ + Content Page + +
+
+
+
+
- - - - - - - - - - - - - - - - Full Page Application - - - - - - + + + + + + + + + + + + + + + + Full Page Application + + + + + +
-
-
-
- - - - - - - -
-
-
-
- - Link to a Page of This Site - -
-
-
-
-
+
+
+
+ + + + + + + +
+
+
+
+ + Link to a Page of This Site + +
+
+
+
+
``` @@ -1166,184 +1096,163 @@ Just add `image-card` class on the same element that `card` class have being add ### Hover
-
-
-
-
-
- -
-
-
-
-
-
-

- - - thumbnail_coffee.jpg - - -

-

- - - Author Action - - -

-
- - - Approved - - -
-
-
-
- -
-
-
-
-
-
+
+
+
+
+
+ +
+
+
+
+
+
+

+ + + thumbnail_coffee.jpg + + +

+

+ + Author Action + +

+
+ + + Approved + + +
+
+
+
+ +
+
+
+
+
+
```html
-
-
-
- -
-
-
-
-
-
-

- - thumbnail_coffee.jpg - -

-

- - Author Action - -

-
- - Approved - -
-
-
-
-
- - -
-
-
-
-
+
+
+
+ +
+
+
+
+
+
+

+ + thumbnail_coffee.jpg + +

+

+ + Author Action + +

+
+ + Approved + +
+
+
+
+
+ + +
+
+
+
+
``` @@ -1352,44 +1261,42 @@ Just add `image-card` class on the same element that `card` class have being add Just add `active` class on the element where `card` class was placed.
-
-
-
-
- -
-
-
-

Widget Page

-
- Build a page by adding widgets and content. -
-
-
-
+
+
+
+
+ +
+
+
+

Widget Page

+
+ Build a page by adding widgets and content. +
+
+
+
```html
-
-
- -
-
-
-

Widget Page

-
- Build a page by adding widgets and content. -
-
+
+
+ +
+
+
+

Widget Page

+
Build a page by adding widgets and content.
+
``` @@ -1398,67 +1305,58 @@ Just add `active` class on the element where `card` class was placed. By default, when adding `image-card` class and inside the element that contains `image-card`, exists a `aspect-ratio` class. A transparent background will be setted.
-
-
-
- - PNG - -
-
-
-
-
-

- - - empty-background.png - - -

-

- - - Author Action - - -

-
-
-
-
-
-
+
+
+
+ PNG +
+
+
+
+
+

+ + + empty-background.png + + +

+

+ + Author Action + +

+
+
+
+
+
+
```html
-
- PNG -
-
-
-
-
-

- - empty-background.png - -

-

- - Author Action - -

-
-
-
-
+
+ PNG +
+
+
+
+
+

+ + empty-background.png + +

+

+ + Author Action + +

+
+
+
+
``` @@ -1470,715 +1368,629 @@ To make the whole card clickable just wrap the checkbox and card in: ```html
- +
```
-
-
-
-
-
- -
-
-
-
-
-

- - - Aldcott Gage George - Polwarth-Kitchener - - -

-

- - - empty.jpg - - -

-
- - - Approved - - -
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
+
+
+
+
+
+ +
+
+
+
+
+

+ + + Aldcott Gage George Polwarth-Kitchener + + +

+

+ + empty.jpg + +

+
+ + + Approved + + +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
```html
-
-
- -
-
-
-
-
-

- - Aldcott Gage George - Polwarth-Kitchener - -

-

- - empty.jpg - -

-
- - Approved - -
-
-
-
-
- - -
-
-
-
-
+
+
+ +
+
+
+
+
+

+ + Aldcott Gage George Polwarth-Kitchener + +

+

+ + empty.jpg + +

+
+ + Approved + +
+
+
+
+
+ + +
+
+
+
+
- -
-``` - + + +``` + ### Radio To make the whole card clickable just wrap the radio input and card in: ```html
- +
```
-
-
-
- -
-
-
-
- -
-
-
+
+
+
+ +
+
+
+
+ +
+
+
```html
- +
- +
``` @@ -2187,36 +1999,33 @@ To make the whole card clickable just wrap the radio input and card in: Use `card-row` with `autofit-col-expand` and `autofit-col` to create a number of custom horizontal cards. `autofit-col-expand` fills the remaining space and `autofit-col` is only as wide as its content inside.
-
-
-
-
- - - - - - - -
-
-
- Fills remaining space. -
-
-
-
-
+
+
+
+
+ + + + + + + +
+
+
+ Fills remaining space. +
+
+
+
+
```html @@ -2231,7 +2040,7 @@ Use `card-row` with `autofit-col-expand` and `autofit-col` to create a number of focusable="false" role="presentation" > - +
@@ -2252,34 +2061,31 @@ Use `card-row` with `autofit-col-expand` and `autofit-col` to create a number of Two `.autofit-col`'s no `.autofit-col-expand`.
-
-
-
-
- - - - - - - -
-
- Only as wide as this text. -
-
-
-
+
+
+
+
+ + + + + + + +
+
+ Only as wide as this text. +
+
+
+
```html @@ -2294,7 +2100,7 @@ Two `.autofit-col`'s no `.autofit-col-expand`. focusable="false" role="presentation" > - + @@ -2313,38 +2119,38 @@ Two `.autofit-col`'s no `.autofit-col-expand`. Two `.autofit-col-expand`'s no `.autofit-col`.
-
-
-
-
-
- - - - - - - -
-
-
-
- This will split the space in half. -
-
-
-
-
+
+
+
+
+
+ + + + + + + +
+
+
+
+ This will split the space in half. +
+
+
+
+
```html @@ -2364,7 +2170,7 @@ Two `.autofit-col-expand`'s no `.autofit-col`. role="presentation" > @@ -2389,49 +2195,44 @@ Two `.autofit-col-expand`'s no `.autofit-col`. Nest `card-row` in `card-body` on to add some spacing around a horizontal card.
-
-
-
-
- thumbnail -
-
-
-

So ristretto cappuccino

-

- Wings eu, pumpkin spice robusta. -

-
-
-
-
-
+
+
+
+
+ thumbnail +
+
+
+

So ristretto cappuccino

+

Wings eu, pumpkin spice robusta.

+
+
+
+
+
```html
-
-
-
- thumbnail -
-
-
-

So ristretto cappuccino

-

- Wings eu, pumpkin spice robusta. -

-
-
-
-
+
+
+
+ thumbnail +
+
+
+

So ristretto cappuccino

+

Wings eu, pumpkin spice robusta.

+
+
+
+
``` @@ -2440,59 +2241,58 @@ Nest `card-row` in `card-body` on to add some spacing around a horizontal card. Add class `text-truncate` on whatever text you want to be truncated.
-
-
-
-
- thumbnail -
-
-
-

So ristretto cappuccino

-

- - - Wings eu, pumpkin spice robusta, kopi-luwak - mocha caffeine froth grounds. - - -

-
-
-
-
-
+
+
+
+
+ thumbnail +
+
+
+

So ristretto cappuccino

+

+ + + Wings eu, pumpkin spice robusta, kopi-luwak mocha caffeine + froth grounds. + + +

+
+
+
+
+
```html
-
-
-
- thumbnail -
-
-
-

So ristretto cappuccino

-

- - Wings eu, pumpkin spice robusta, kopi-luwak - mocha caffeine froth grounds. - -

-
-
-
-
+
+
+
+ thumbnail +
+
+
+

So ristretto cappuccino

+

+ + Wings eu, pumpkin spice robusta, kopi-luwak mocha caffeine + froth grounds. + +

+
+
+
+
``` @@ -2505,78 +2305,76 @@ Horizontally align content by setting `text-align` to `left`, `center`, or `righ You can also use the Bootstrap 4's helper classes `justify-content-start`, `justify-content-center`, or `justify-content-end` on `card-row` to align content in all columns inside the row.
-
-
-
-
-
top
-
-
-
middle
-
-
-
bottom
-
-
-
-
+
+
+
+
+
top
+
+
+
middle
+
+
+
bottom
+
+
+
+
```html
-
-
-
top
-
-
-
middle
-
-
-
bottom
-
-
+
+
+
top
+
+
+
middle
+
+
+
bottom
+
+
``` Add gutters to a specific card card column by using the class `autofit-col-gutters`.
-
-
-
- thumbnail -
-
-
-

So ristretto cappuccino

-

- Wings eu, pumpkin spice robusta. -

-
-
-
-
+
+
+
+ thumbnail +
+
+
+

So ristretto cappuccino

+

Wings eu, pumpkin spice robusta.

+
+
+
+
```html
-
-
- thumbnail -
-
-
-

So ristretto cappuccino

-

Wings eu, pumpkin spice robusta.

-
-
-
+
+
+ thumbnail +
+
+
+

So ristretto cappuccino

+

Wings eu, pumpkin spice robusta.

+
+
+
``` @@ -2585,61 +2383,51 @@ Add gutters to a specific card card column by using the class `autofit-col-gutte Use classes `rounded`, `rounded-circle`, or `rounded-0` on the card to quickly shape the borders.
-
-
-
-
-
- autofit-col-expand -
-
-
-
- autofit-col-expand -
-
-
-
-
-
-
-
-
-
- thumbnail -
-
-
-
- autofit-col-expand -
-
-
-
-
-
-
-
-
-
- autofit-col-expand -
-
-
-
- autofit-col-expand -
-
-
-
-
+
+
+
+
+
autofit-col-expand
+
+
+
autofit-col-expand
+
+
+
+
+
+
+
+
+
+ thumbnail +
+
+
+
autofit-col-expand
+
+
+
+
+
+
+
+
+
autofit-col-expand
+
+
+
autofit-col-expand
+
+
+
+
```html @@ -2728,239 +2516,235 @@ The example below adds the custom modifier class `my-custom-grid` to `card-page` ```
- +
```html ``` @@ -2969,104 +2753,103 @@ The example below adds the custom modifier class `my-custom-grid` to `card-page` The modifier class `card-page-equal-height` forces all cards in a row to maintain the same height.
- +
```html ``` @@ -3080,107 +2863,106 @@ The modifier class `card-page-equal-height` forces all cards in a row to maintai Card Page is compatible with Bootstrap's Grid System, just add `row` to `card-page` and the column utilities you want on `card-page-item`.
- +
```html ``` @@ -3189,552 +2971,424 @@ Card Page is compatible with Bootstrap's Grid System, just add `row` to `card-pa A predefined `card-page` column used in Liferay Portal's card view layouts, generally used for vertical cards.
- +
```html ``` @@ -3743,486 +3397,381 @@ A predefined `card-page` column used in Liferay Portal's card view layouts, gene A predefined `card-page` column used in Liferay Portal's card view layouts, generally used for horizontal cards.
- +
```html ``` diff --git a/packages/clay-charts/docs/charts.mdx b/packages/clay-charts/docs/charts.mdx index 85750dfd71..a7d23a8076 100644 --- a/packages/clay-charts/docs/charts.mdx +++ b/packages/clay-charts/docs/charts.mdx @@ -7,10 +7,10 @@ storybookPath: 'design-system-charts-react-billboard' ---
- Charts in its current state will be deprecated soon in favor of a wrapper - around [Recharts](https://recharts.org/). See examples of charts built with - recharts on  - [Storybook](https://storybook.clayui.com/?path=/story/design-system-charts-react-billboard--bar). + Charts in its current state will be deprecated soon in favor of a wrapper + around [Recharts](https://recharts.org/). See examples of charts built with + recharts on  + [Storybook](https://storybook.clayui.com/?path=/story/design-system-charts-react-billboard--bar).
## Basic diff --git a/packages/clay-color-picker/docs/color-picker.mdx b/packages/clay-color-picker/docs/color-picker.mdx index 92704d79ff..292e76630e 100644 --- a/packages/clay-color-picker/docs/color-picker.mdx +++ b/packages/clay-color-picker/docs/color-picker.mdx @@ -12,30 +12,32 @@ packageTypes: ['clay-color-picker/src/index.tsx'] ```jsx preview import {Provider} from '@clayui/core'; import ColorPicker from '@clayui/color-picker'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [customColors, setCustoms] = useState(['008000', '00FFFF', '0000FF']); - const [color, setColor] = useState(customColors[0]); - - return ( - -
- -
-
- ); + const [customColors, setCustoms] = React.useState([ + '008000', + '00FFFF', + '0000FF', + ]); + const [color, setColor] = React.useState(customColors[0]); + + return ( + +
+ +
+
+ ); } ``` @@ -43,9 +45,9 @@ export default function App() { Color Picker is delivered in 4 different ways: default colors, custom colors, native and small. -- **Default colors**: a predefined list of colors to the dropdown that is not allowed to change or manipulate. -- **Custom colors**: using the [`colors`](#api-colors) API in conjunction with [`onColorsChange`](#api-onColorsChange) enables the user to modify colors and add new ones. -- **Native**: use the [`useNative`](#api-useNative) API when the color picker is being used in a native environment, it changes to the browser default color picker. -- **Small**: use the [`small`](#api-small) API to size the color picker input to match other small inputs. +- **Default colors**: a predefined list of colors to the dropdown that is not allowed to change or manipulate. +- **Custom colors**: using the [`colors`](#api-colors) API in conjunction with [`onColorsChange`](#api-onColorsChange) enables the user to modify colors and add new ones. +- **Native**: use the [`useNative`](#api-useNative) API when the color picker is being used in a native environment, it changes to the browser default color picker. +- **Small**: use the [`small`](#api-small) API to size the color picker input to match other small inputs. We recommend that you review the [use cases in the Storybook](https://storybook.clayui.com/?path=/story/design-system-components-colorpicker--default). diff --git a/packages/clay-color-picker/docs/color-picker/markup.mdx b/packages/clay-color-picker/docs/color-picker/markup.mdx index d790e4d4eb..2479259d0d 100644 --- a/packages/clay-color-picker/docs/color-picker/markup.mdx +++ b/packages/clay-color-picker/docs/color-picker/markup.mdx @@ -7,367 +7,367 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" ---
- This requires custom javascript. + This requires custom javascript.
## Example
- -
-
-
- -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- Custom Colors - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
- -
-
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ Custom Colors + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +
+
```html @@ -413,7 +413,7 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" focusable="false" role="presentation" > - + @@ -452,85 +452,85 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" ## Variations
-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
```html @@ -549,324 +549,324 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" ```
-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- Custom Colors - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ Custom Colors + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
```html @@ -888,7 +888,7 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" focusable="false" role="presentation" > - + @@ -913,218 +913,214 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" ```
-
-
-
- Custom Colors - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- -
-
-
- -
-
-
-
- - -
-
-
-
-
-
+
+
+
+ Custom Colors + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
```html @@ -1137,7 +1133,7 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" focusable="false" role="presentation" > - + @@ -1262,45 +1258,45 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" ## Sizes
-
- -
-
-
- -
-
-
-
- - -
-
-
+
+ +
+
+
+ +
+
+
+
+ + +
+
+
```html @@ -1348,30 +1344,30 @@ packageUse: "import ColorPicker from '@clayui/color-picker';" ```
-
- -
-
-
- -
-
-
-
-
+
+ +
+
+
+ +
+
+
+
+
```html diff --git a/packages/clay-core/docs/application-bar.mdx b/packages/clay-core/docs/application-bar.mdx index 4364a0463b..1a4c66a0ff 100644 --- a/packages/clay-core/docs/application-bar.mdx +++ b/packages/clay-core/docs/application-bar.mdx @@ -5,531 +5,467 @@ lexiconDefinition: 'https://liferay.design/lexicon/satellite-components/navigati ---
- Bootstrap 4 doesn't support Dropdown Menu's with Popper.js positioning - inside Navbars. They align them manually via CSS classes. See [Dropdown - Alignment](/docs/components/drop-down#alignment). + Bootstrap 4 doesn't support Dropdown Menu's with Popper.js positioning inside + Navbars. They align them manually via CSS classes. See [Dropdown + Alignment](/docs/components/drop-down#alignment).
## Dark
- +
```html ``` ## Using Buttons
- +
```html ``` diff --git a/packages/clay-core/docs/aspect-ratio.mdx b/packages/clay-core/docs/aspect-ratio.mdx index 5ca4ac8a22..547cf4e715 100644 --- a/packages/clay-core/docs/aspect-ratio.mdx +++ b/packages/clay-core/docs/aspect-ratio.mdx @@ -10,32 +10,32 @@ Sometimes you can't control the size of an image, you can constrain your images Use `aspect-ratio-3-to-2`, `aspect-ratio-4-to-3`, `aspect-ratio-8-to-3`, `aspect-ratio-8-to-5`, or `aspect-ratio-16-to-9` to maintain the specific ratio relative to its container or create your own by setting `padding-bottom` to the ratio you want e.g. 2 to 1 `.aspect-ratio-2-to-1 { padding-bottom: 50% }`.
-
-
-
1:1
-
-
-
-
3:2
-
-
-
-
4:3
-
-
-
-
8:3
-
-
-
-
8:5
-
-
-
-
16:9
-
-
-
+
+
+
1:1
+
+
+
+
3:2
+
+
+
+
4:3
+
+
+
+
8:3
+
+
+
+
8:5
+
+
+
+
16:9
+
+
+
```html @@ -53,20 +53,20 @@ The map `$aspect-ratio-sizes` allows generating any number of aspect ratio varia ```scss $aspect-ratio-sizes: ( - aspect-ratio-16-to-9: ( - height: 9, - width: 16, - ), - '.card .aspect-ratio': ( - extend: '%aspect-ratio-16-to-9', - ), - '%aspect-ratio-4-to-1': ( - height: 1, - width: 4, - ), - '.aspect-ratio-4-to-1': ( - extend: '%aspect-ratio-4-to-1', - ), + aspect-ratio-16-to-9: ( + height: 9, + width: 16, + ), + '.card .aspect-ratio': ( + extend: '%aspect-ratio-16-to-9', + ), + '%aspect-ratio-4-to-1': ( + height: 1, + width: 4, + ), + '.aspect-ratio-4-to-1': ( + extend: '%aspect-ratio-4-to-1', + ), ); ``` @@ -75,11 +75,11 @@ Outputs: ```css .aspect-ratio-16-to-9, .card .aspect-ratio { - padding-bottom: calc(9 / 16 * 100%); + padding-bottom: calc(9 / 16 * 100%); } .aspect-ratio-4-to-1 { - padding-bottom: calc(1 / 4 * 100%); + padding-bottom: calc(1 / 4 * 100%); } ``` @@ -88,17 +88,16 @@ Outputs: The class `aspect-ratio-bg-contain` on `aspect-ratio` centers the `background-image` and scales the image as large as possible without cropping or stretching the image.
-
-
-
-
-
+
+
+
+
+
```html @@ -113,17 +112,16 @@ The class `aspect-ratio-bg-contain` on `aspect-ratio` centers the `background-im The class `aspect-ratio-bg-cover` on `aspect-ratio` centers the `background-image` and scales the image to fill the container. It will stretch and change the proportions of the image to achieve this.
-
-
-
-
-
+
+
+
+
+
```html @@ -138,16 +136,16 @@ The class `aspect-ratio-bg-cover` on `aspect-ratio` centers the `background-imag The class `aspect-ratio-bg-center` on `aspect-ratio` will center the `background-image`.
-
-
-
-
-
+
+
+
+
+
```html @@ -162,26 +160,26 @@ The class `aspect-ratio-bg-center` on `aspect-ratio` will center the `background Use `aspect-ratio-item` on the nested `img` if you want to keep the content's original size and crop the visible area.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -190,135 +188,135 @@ Use `aspect-ratio-item` on the nested `img` if you want to keep the content's or The class `aspect-ratio-item-fluid` should be used on `aspect-ratio-item` to keep wide images viewable inside the `aspect-ratio` container. It sets the max-width to be 100%, similar to `img-fluid`.
-
Original Image
- thumbnail of a hot air balloon -
-
-
16:9
-
- thumbnail -
-
-
-
1:1
-
- thumbnail -
-
-
-
3:2
-
- thumbnail -
-
-
-
4:3
-
- thumbnail -
-
-
-
8:3
-
- thumbnail -
-
-
-
8:5
-
- thumbnail -
-
-
-
16:9
-
- thumbnail -
-
-
+
Original Image
+ thumbnail of a hot air balloon +
+
+
16:9
+
+ thumbnail +
+
+
+
1:1
+
+ thumbnail +
+
+
+
3:2
+
+ thumbnail +
+
+
+
4:3
+
+ thumbnail +
+
+
+
8:3
+
+ thumbnail +
+
+
+
8:5
+
+ thumbnail +
+
+
+
16:9
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
``` @@ -327,112 +325,112 @@ The class `aspect-ratio-item-fluid` should be used on `aspect-ratio-item` to kee The class `aspect-ratio-item-vertical-fluid` should be used on `aspect-ratio-item` to keep tall images viewable inside the `aspect-ratio` container. It sets the max-height to be 100%.
-
-
-
1:1
-
- thumbnail -
-
-
-
3:2
-
- thumbnail -
-
-
-
4:3
-
- thumbnail -
-
-
-
8:3
-
- thumbnail -
-
-
-
8:5
-
- thumbnail -
-
-
-
16:9
-
- thumbnail -
-
-
+
+
+
1:1
+
+ thumbnail +
+
+
+
3:2
+
+ thumbnail +
+
+
+
4:3
+
+ thumbnail +
+
+
+
8:3
+
+ thumbnail +
+
+
+
8:5
+
+ thumbnail +
+
+
+
16:9
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
- thumbnail + thumbnail
``` @@ -441,48 +439,48 @@ The class `aspect-ratio-item-vertical-fluid` should be used on `aspect-ratio-ite The class `aspect-ratio-item-flush` should be used for images that are too narrow and want it to fill the remaining space. It forces the width to be 100.6%.
- The 100.6% width is to account for browser subpixel rendering issues. + The 100.6% width is to account for browser subpixel rendering issues.
-
-
-
16:9
-
- thumbnail -
-
-
-
16:9
-
- thumbnail -
-
-
+
+
+
16:9
+
+ thumbnail +
+
+
+
16:9
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
- thumbnail + thumbnail
``` @@ -491,48 +489,48 @@ The class `aspect-ratio-item-flush` should be used for images that are too narro The class `aspect-ratio-item-vertical-flush` should be used for images that are too short and want it to fill the remaining vertical space. It forces the height to be 100.6%.
- The 100.6% height is to account for browser subpixel rendering issues. + The 100.6% height is to account for browser subpixel rendering issues.
-
-
-
16:9
-
- thumbnail -
-
-
-
16:9
-
- thumbnail -
-
-
+
+
+
16:9
+
+ thumbnail +
+
+
+
16:9
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
- thumbnail + thumbnail
``` @@ -541,26 +539,26 @@ The class `aspect-ratio-item-vertical-flush` should be used for images that are The class `aspect-ratio-item-center-middle` centers an item horizontally and vertically.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -569,26 +567,26 @@ The class `aspect-ratio-item-center-middle` centers an item horizontally and ver The class `aspect-ratio-item-top-center` vertically aligns the item at the top and centers it horizontally.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -597,26 +595,26 @@ The class `aspect-ratio-item-top-center` vertically aligns the item at the top a The class `aspect-ratio-item-top-right` aligns the item at the top right corner.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -625,26 +623,26 @@ The class `aspect-ratio-item-top-right` aligns the item at the top right corner. The class `aspect-ratio-item-right-middle` aligns an item in the middle vertically and right side horizontally.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -653,26 +651,26 @@ The class `aspect-ratio-item-right-middle` aligns an item in the middle vertical The class `aspect-ratio-item-bottom-right` aligns an item at the bottom right corner.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -681,26 +679,26 @@ The class `aspect-ratio-item-bottom-right` aligns an item at the bottom right co The class `aspect-ratio-item-bottom-center` aligns an item at the bottom vertically and centers it horizontally.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -709,26 +707,26 @@ The class `aspect-ratio-item-bottom-center` aligns an item at the bottom vertica The class `aspect-ratio-item-bottom-left` aligns an item at the bottom left corner.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` @@ -737,25 +735,25 @@ The class `aspect-ratio-item-bottom-left` aligns an item at the bottom left corn The class `aspect-ratio-item-left-middle` aligns an item on the left horizontally and in the middle vertically.
-
-
-
- thumbnail -
-
-
+
+
+
+ thumbnail +
+
+
```html
- thumbnail + thumbnail
``` diff --git a/packages/clay-core/docs/focus-trap.mdx b/packages/clay-core/docs/focus-trap.mdx index 2d7e874992..d9a8745884 100644 --- a/packages/clay-core/docs/focus-trap.mdx +++ b/packages/clay-core/docs/focus-trap.mdx @@ -15,49 +15,45 @@ Focus Trap is a component that wraps elements in the DOM and prevents focus from It definitely is used when trying to build accessible components, blocking all interactions outside of it while Focus Trap is active.
- It's the responsibility of the user to add an escape method for the focus - trap, either with a button or the escape key. + It's the responsibility of the user to add an escape method for the focus + trap, either with a button or the escape key.
## Example ```jsx preview import {Provider, Button, FocusTrap} from '@clayui/core'; -import React, {useEffect, useRef, useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [active, setActive] = useState(false); - const activateButtonRef = useRef(null); - - useEffect(() => { - if (active) { - return () => activateButtonRef.current?.focus(); - } - }, [active]); - - return ( - -
- - {active && ( - -
- - -
- -
-
-
- )} -
-
- ); + const [active, setActive] = React.useState(false); + const activateButtonRef = React.useRef(null); + + React.useEffect(() => { + if (active) { + return () => activateButtonRef.current?.focus(); + } + }, [active]); + + return ( + +
+ + {active && ( + +
+ + +
+ +
+
+
+ )} +
+
+ ); } ``` diff --git a/packages/clay-core/docs/forms-hierarchy.mdx b/packages/clay-core/docs/forms-hierarchy.mdx index 40b41cbe5d..89fe988ed8 100644 --- a/packages/clay-core/docs/forms-hierarchy.mdx +++ b/packages/clay-core/docs/forms-hierarchy.mdx @@ -5,529 +5,504 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/forms/' ---
- Don't forget to check - [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#accordion) - accessibility pratices for Forms Hierarchy when writting your markup. + Don't forget to check + [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#accordion) accessibility + pratices for Forms Hierarchy when writting your markup.
## Example
-
-
-

Sheet Title

-
- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-header. -
-
-
-

Sheet Subtitle

-

- - - Sheet Subtitle with Button - - - - - - - -

-

Sheet Tertiary Title

-
- Sheet Subtitle and Sheet Tertiary Title are contained inside a - sheet-section. -
-
-
-
- - First Level Collapse 1 - - - - - - - - - - - -
-
-
- This is an example of explanatory text. -
-
-
-
-
-
-
-
- -
-
- -
-
-
-
+
+
+

Sheet Title

+
+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-header. +
+
+
+

Sheet Subtitle

+

+ + Sheet Subtitle with Button + + + + + + +

+

Sheet Tertiary Title

+
+ Sheet Subtitle and Sheet Tertiary Title are contained inside a + sheet-section. +
+
+
+
+ + First Level Collapse 1 + + + + + + + + + + + +
+
+
+ This is an example of explanatory text. +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
```html
-
-

Sheet Title

-
- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-header. -
-
-
-

Sheet Subtitle

-

- - Sheet Subtitle with Button - - - - - - -

-

Sheet Tertiary Title

-
- Sheet Subtitle and Sheet Tertiary Title are contained inside a - sheet-section. -
-
-
-
- - First Level Collapse 1 - - - - - - - - - - - -
-
-
- This is an example of explanatory text. -
-
-
-
-
-
-
-
- -
-
- -
-
-
+
+

Sheet Title

+
+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-header. +
+
+
+

Sheet Subtitle

+

+ + Sheet Subtitle with Button + + + + + + +

+

Sheet Tertiary Title

+
+ Sheet Subtitle and Sheet Tertiary Title are contained inside a + sheet-section. +
+
+
+
+ + First Level Collapse 1 + + + + + + + + + + + +
+
+
+ This is an example of explanatory text. +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
``` ## One Column
-
-
-

Sheet Title

-
- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-header. -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
-
- -
-
- -
-
-
-
+
+
+

Sheet Title

+
+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-header. +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+ +
+
+
+
```html
-
-

Sheet Title

-
- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-header. -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
-
- -
-
- -
-
-
+
+

Sheet Title

+
+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-header. +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+ +
+
+
``` ## Two Columns
-
-
-

Sheet Title

-
- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-header. -
-
-
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
-
-
- -
-
- -
-
-
-
+
+
+

Sheet Title

+
+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-header. +
+
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+ +
+
+ +
+
+
+
```html
-
-

Sheet Title

-
- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-header. -
-
-
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
-
-
- -
-
- -
-
-
+
+

Sheet Title

+
+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-header. +
+
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+ +
+
+ +
+
+
``` @@ -536,366 +511,343 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/forms/' The `sheet-row` aligns content flush with the sheet borders using negative margins.
-
-
-

Sheet Title

-
-
- -
-
- Single origin, extra id beans, eu to go, skinny americano ut - aftertaste sugar. At americano, viennese variety iced - grounds, grinder froth and pumpkin spice aromatic. Cultivar - aged lungo, grounds café au lait, skinny, blue mountain, in - variety sugar shop roast. Wings, blue mountain affogato - organic cappuccino java plunger pot. Single shot variety - pumpkin spice seasonal skinny barista carajillo robust - cream. -
-
- Iced, crema, coffee id kopi-luwak coffee variety. Skinny - extraction, id trifecta qui trifecta grinder. Barista - robusta arabica breve ut skinny milk beans macchiato - carajillo espresso. Cultivar single shot brewed, coffee - steamed to go wings to go cortado. Grinder, siphon coffee - acerbic espresso cinnamon crema breve. -
-
- Cultivar single shot brewed, coffee steamed to go wings to - go cortado. Grinder, siphon coffee acerbic espresso cinnamon - crema breve. -
-
- Skinny extraction, id trifecta qui trifecta grinder. Barista - robusta arabica breve ut skinny milk beans macchiato - carajillo espresso. Cultivar single shot brewed, coffee - steamed to go wings to go cortado. Grinder, siphon coffee - acerbic espresso cinnamon crema breve. -
-
- At americano, viennese variety iced grounds, grinder froth - and pumpkin spice aromatic. Cultivar aged lungo, grounds - café au lait, skinny, blue mountain, in variety sugar shop - roast. Wings, blue mountain affogato organic cappuccino java - plunger pot. Single shot variety pumpkin spice seasonal - skinny barista carajillo robust cream. -
-
-
-
+
+
+

Sheet Title

+
+
+ +
+
+ Single origin, extra id beans, eu to go, skinny americano ut + aftertaste sugar. At americano, viennese variety iced grounds, grinder + froth and pumpkin spice aromatic. Cultivar aged lungo, grounds café au + lait, skinny, blue mountain, in variety sugar shop roast. Wings, blue + mountain affogato organic cappuccino java plunger pot. Single shot + variety pumpkin spice seasonal skinny barista carajillo robust cream. +
+
+ Iced, crema, coffee id kopi-luwak coffee variety. Skinny extraction, + id trifecta qui trifecta grinder. Barista robusta arabica breve ut + skinny milk beans macchiato carajillo espresso. Cultivar single shot + brewed, coffee steamed to go wings to go cortado. Grinder, siphon + coffee acerbic espresso cinnamon crema breve. +
+
+ Cultivar single shot brewed, coffee steamed to go wings to go cortado. + Grinder, siphon coffee acerbic espresso cinnamon crema breve. +
+
+ Skinny extraction, id trifecta qui trifecta grinder. Barista robusta + arabica breve ut skinny milk beans macchiato carajillo espresso. + Cultivar single shot brewed, coffee steamed to go wings to go cortado. + Grinder, siphon coffee acerbic espresso cinnamon crema breve. +
+
+ At americano, viennese variety iced grounds, grinder froth and pumpkin + spice aromatic. Cultivar aged lungo, grounds café au lait, skinny, + blue mountain, in variety sugar shop roast. Wings, blue mountain + affogato organic cappuccino java plunger pot. Single shot variety + pumpkin spice seasonal skinny barista carajillo robust cream. +
+
+
+
```html
-
-

Sheet Title

-
-
- -
-
- Single origin, extra id beans, eu to go, skinny americano ut - aftertaste sugar. At americano, viennese variety iced grounds, - grinder froth and pumpkin spice aromatic. Cultivar aged lungo, - grounds café au lait, skinny, blue mountain, in variety sugar - shop roast. Wings, blue mountain affogato organic cappuccino - java plunger pot. Single shot variety pumpkin spice seasonal - skinny barista carajillo robust cream. -
-
- Iced, crema, coffee id kopi-luwak coffee variety. Skinny - extraction, id trifecta qui trifecta grinder. Barista robusta - arabica breve ut skinny milk beans macchiato carajillo espresso. - Cultivar single shot brewed, coffee steamed to go wings to go - cortado. Grinder, siphon coffee acerbic espresso cinnamon crema - breve. -
-
- Cultivar single shot brewed, coffee steamed to go wings to go - cortado. Grinder, siphon coffee acerbic espresso cinnamon crema - breve. -
-
- Skinny extraction, id trifecta qui trifecta grinder. Barista - robusta arabica breve ut skinny milk beans macchiato carajillo - espresso. Cultivar single shot brewed, coffee steamed to go - wings to go cortado. Grinder, siphon coffee acerbic espresso - cinnamon crema breve. -
-
- At americano, viennese variety iced grounds, grinder froth and - pumpkin spice aromatic. Cultivar aged lungo, grounds café au - lait, skinny, blue mountain, in variety sugar shop roast. Wings, - blue mountain affogato organic cappuccino java plunger pot. - Single shot variety pumpkin spice seasonal skinny barista - carajillo robust cream. -
-
-
+
+

Sheet Title

+
+
+ +
+
+ Single origin, extra id beans, eu to go, skinny americano ut aftertaste + sugar. At americano, viennese variety iced grounds, grinder froth and + pumpkin spice aromatic. Cultivar aged lungo, grounds café au lait, + skinny, blue mountain, in variety sugar shop roast. Wings, blue mountain + affogato organic cappuccino java plunger pot. Single shot variety + pumpkin spice seasonal skinny barista carajillo robust cream. +
+
+ Iced, crema, coffee id kopi-luwak coffee variety. Skinny extraction, id + trifecta qui trifecta grinder. Barista robusta arabica breve ut skinny + milk beans macchiato carajillo espresso. Cultivar single shot brewed, + coffee steamed to go wings to go cortado. Grinder, siphon coffee acerbic + espresso cinnamon crema breve. +
+
+ Cultivar single shot brewed, coffee steamed to go wings to go cortado. + Grinder, siphon coffee acerbic espresso cinnamon crema breve. +
+
+ Skinny extraction, id trifecta qui trifecta grinder. Barista robusta + arabica breve ut skinny milk beans macchiato carajillo espresso. + Cultivar single shot brewed, coffee steamed to go wings to go cortado. + Grinder, siphon coffee acerbic espresso cinnamon crema breve. +
+
+ At americano, viennese variety iced grounds, grinder froth and pumpkin + spice aromatic. Cultivar aged lungo, grounds café au lait, skinny, blue + mountain, in variety sugar shop roast. Wings, blue mountain affogato + organic cappuccino java plunger pot. Single shot variety pumpkin spice + seasonal skinny barista carajillo robust cream. +
+
+
``` @@ -904,104 +856,80 @@ The `sheet-row` aligns content flush with the sheet borders using negative margi Use `autofit` utilities with `component-title` in `sheet-title` to vertically align the text with small sized buttons (32px tall). This pattern allows long text to break to new line while keeping the button(s) text centered on the first line of text.
-
-
-

Sheet Title

-

- - - One Line Title - - - - Add - - - - - - -

-

- - - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual - - - - - Add - - - - - - -

-
-
+
+
+

Sheet Title

+

+ + + One Line Title + + + + Add + + + + + + +

+

+ + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual + + + + + Add + + + + + + +

+
+
```html

Sheet Title

- - - One Line Title - - - Add - - - - - + + + One Line Title + + + Add + + + + +

- - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual - - - Add - - - - - + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual + + + Add + + + + +

``` @@ -1010,216 +938,160 @@ Use `autofit` utilities with `component-title` in `sheet-title` to vertically al Nest `autofit` utilities with `component-title` in `sheet-subtitle` to vertically align the text with small sized buttons (32px tall). This pattern, from the Lexicon specs, aligns the text to the bottom of the button(s) when there is only one line of text. Multiple lines of text aligns the text to the top of the button(s).
-
-
-

Sheet Subtitle

-

- - - - One Line Subtitle - - - - - Add - - - - - - -

-

- - - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual - - - - - Add - - - - - - -

-
-
+
+
+

Sheet Subtitle

+

+ + + One Line Subtitle + + + + Add + + + + + + +

+

+ + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual + + + + + Add + + + + + + +

+
+
```html

Sheet Subtitle

- - - One Line Subtitle - - - Add - - - - - + + + One Line Subtitle + + + Add + + + + +

- - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual - - - Add - - - - - + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual + + + Add + + + + +

``` ## Sheet Tertiary Title
-
-
-

Sheet Tertiary Title

-

- - - - One Line Tertiary Title - - - - - Add - - - - - - -

-

- - - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual - - - - - Add - - - - - - -

-
-
+
+
+

Sheet Tertiary Title

+

+ + + One Line Tertiary Title + + + + Add + + + + + + +

+

+ + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual + + + + + Add + + + + + + +

+
+
```html

Sheet Tertiary Title

- - - One Line Tertiary Title - - - Add - - - - - + + + One Line Tertiary Title + + + Add + + + + +

- - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual - - - Add - - - - - + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual + + + Add + + + + +

``` @@ -1232,202 +1104,186 @@ The modifier class `sheet-multiple-form` on `sheet` provides alternative sizing This pattern is used in form scenarios, usually to display a form, multiple forms or a combination of single/multiple forms and one or several sheets to display information. See Lexicon.
-
-
-
-
-

- Sheet Header -

-
- -
-
-
-
Sheet Title
-

- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-section. -

-
-
-
Sheet Subtitle 01
-
- - -
-
-
-
Sheet Subtitle 02
-
-
-
-
- -
-
- -
-
-
-
+
+
+
+
+

+ Sheet Header +

+
+ +
+
+
+
Sheet Title
+

+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-section. +

+
+
+
Sheet Subtitle 01
+
+ + +
+
+
+
Sheet Subtitle 02
+
+
+
+
+ +
+
+ +
+
+
+
```html
-
-
-
-

- Sheet Header -

-
-
-
- - -
-
-
-
-
-
Sheet Title
-

- Sheet text should be used for any kind of explanatory text. The - Sheet Title and Sheet Text are contained inside a sheet-section. -

-
-
-
Sheet Subtitle 01
-
- - -
-
-
-
Sheet Subtitle 02
-
-
-
-
- -
-
- -
-
-
+
+
+
+

+ Sheet Header +

+
+
+
+ + +
+
+
+
+
+
Sheet Title
+

+ Sheet text should be used for any kind of explanatory text. The Sheet + Title and Sheet Text are contained inside a sheet-section. +

+
+
+
Sheet Subtitle 01
+
+ + +
+
+
+
Sheet Subtitle 02
+
+
+
+
+ +
+
+ +
+
+
``` @@ -1436,705 +1292,643 @@ This pattern is used in form scenarios, usually to display a form, multiple form This is an example of the `sheet-multiple-form` modifier with `card-page card-page-equal-height` used to layout the Commerce Product Screen.
-
-
-
-
-
-
-
- - - -
-
-
-
Units Sold
-
- 128 - / Sales - $459k -
-
27% last 30 days
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
Units Sold
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
Units Sold
-
- 128 - / Sales - $459k -
-
27% last 30 days
-
-
-
-
-
-
-
-
-
-

SEO

-
-
-
-
- -
- https://www.your-domain.com -
-
-
- - /p/ - -
-
- -
-
-
-
-
-
-
- - -
-
-
-
-
-
-
- -
-
- -
-
-
-
- Description should be - under 155 characters -
-
-
-
- 114/160 -
-
-
-
-
- -
-
-
- -
-
-
-
- -
-
- - - This is an example of a very - long title - - -
- https://liferay.com -
-
- Optimal title length Google - typically displays the first 50-60 - characters of a title tag. If you - keep your titles under 60 - characters, our research suggest... -
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ + + +
+
+
+
Units Sold
+
+ 128 + / Sales + $459k +
+
27% last 30 days
+
+
+
+
+
+
+
+
+
+ + + +
+
+
+
Units Sold
+
+
+
+
+
+
+
+
+
+ + + +
+
+
+
Units Sold
+
+ 128 + / Sales + $459k +
+
27% last 30 days
+
+
+
+
+
+
+
+
+
+

SEO

+
+
+
+
+ +
https://www.your-domain.com
+
+
+ /p/ +
+
+ +
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ Description should be under 155 characters +
+
+
+
114/160
+
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+ + This is an example of a very long title + +
https://liferay.com
+
+ Optimal title length Google typically displays the first + 50-60 characters of a title tag. If you keep your titles + under 60 characters, our research suggest... +
+
+
+
+
+
+
+
+
+
```html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

SEO

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

SEO

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
``` @@ -2145,432 +1939,387 @@ The modifier `sheet-dataset-content` should be added to `sheet` for sheets conta A common usage of the `sheet` is to present a dataset display inside. This case benefits of the `sheet-title` and the content free space to place elements such as the dataset display. See Lexicon.
-
-
-
-

- - - col1 - - - - - -

-
- - -
-
-
-
-
- Image of a satellite in space -
-
-
- - - No page templates yet - - -
-
- Page Templates allow you to create pages faster with - reusable elements. -
-
- -
-
-
-
-
-
+
+
+
+

+ + + col1 + + + + + +

+
+ + +
+
+
+
+
+ Image of a satellite in space +
+
+
+ + No page templates yet + +
+
+ Page Templates allow you to create pages faster with reusable + elements. +
+
+ +
+
+
+
+
+
```html
-
-
-

- - - col1 - - - - - -

-
- - -
-
-
-
-
- Image of a satellite in space -
-
-
- - No page templates yet - -
-
- Page Templates allow you to create pages faster with - reusable elements. -
-
- -
-
-
-
-
+
+
+

+ + + col1 + + + + + +

+
+ + +
+
+
+
+
+ Image of a satellite in space +
+
+
+ + No page templates yet + +
+
+ Page Templates allow you to create pages faster with reusable + elements. +
+
+ +
+
+
+
+
``` diff --git a/packages/clay-core/docs/heading.mdx b/packages/clay-core/docs/heading.mdx index 7328d895a9..988a548282 100644 --- a/packages/clay-core/docs/heading.mdx +++ b/packages/clay-core/docs/heading.mdx @@ -20,33 +20,31 @@ By default, the semantic of the heading level is level 1 in which the component import {Provider, Heading} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - h1. Heading Level 1 - - - h2. Heading Level 2 - - - h3. Heading Level 3 - - - h4. Heading Level 4 - - - h5. Heading Level 5 - - - h6. Heading Level 6 - -
-
- ); + return ( + +
+ + h1. Heading Level 1 + + + h2. Heading Level 2 + + + h3. Heading Level 3 + + + h4. Heading Level 4 + + + h5. Heading Level 5 + + + h6. Heading Level 6 + +
+
+ ); } ``` @@ -58,32 +56,30 @@ In the same way, Heading component provides some styles depending on the `weight import {Provider, Heading} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- - Heading with ligther weight - - - Heading with light weight - - - Heading with normal weight - - - Heading with semi-bold weight - - - Heading with bold weight - - - Heading with bolder weight - -
-
- ); + return ( + +
+ + Heading with ligther weight + + + Heading with light weight + + + Heading with normal weight + + + Heading with semi-bold weight + + + Heading with bold weight + + + Heading with bolder weight + +
+
+ ); } ``` diff --git a/packages/clay-core/docs/icon-selector.mdx b/packages/clay-core/docs/icon-selector.mdx index 4df0dfa97a..33a56afc79 100644 --- a/packages/clay-core/docs/icon-selector.mdx +++ b/packages/clay-core/docs/icon-selector.mdx @@ -15,18 +15,18 @@ Icon Selector is a field type that allows users to choose an icon from a predefi ## Example ```jsx preview -import {IconSelector} from '@clayui/core'; +import {Provider, IconSelector} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - const spritemap = '/icons.svg'; export default function App() { - return ( -
- -
- ); + return ( +
+ + + +
+ ); } ``` diff --git a/packages/clay-core/docs/language-picker.mdx b/packages/clay-core/docs/language-picker.mdx index 17629a6670..84464ab4ce 100644 --- a/packages/clay-core/docs/language-picker.mdx +++ b/packages/clay-core/docs/language-picker.mdx @@ -14,67 +14,65 @@ packageTypes: ['clay-core/src/language-picker/LanguagePicker.tsx'] import {Provider, LanguagePicker} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- -
-
- ); + return ( + +
+ +
+
+ ); } ``` @@ -93,57 +91,57 @@ For the `` component you can control the `selectedLocaleId` an If you just need to set the initial state of the `selectedLocaleId`, use the `defaultSelectedLocaleId` property which is appropriate for that use case. In case `defaultSelectedLocaleId` is not defined, it will take the first locale as the default locale.
- Info - The selectedLocaleId property is equivalent - to selectedKey in the Picker, which is represented - by the key property configured in the - Option - component, so the component can identify which value is selected and - which should be shown in the trigger.
+ Info + The selectedLocaleId property is equivalent + to selectedKey in the Picker, which is represented + by the key property configured in the + Option + component, so the component can identify which value is selected and which + should be shown in the trigger.
```jsx function Example() { - // Controlled - const [active, setActive] = useState(false); - - // Controlled - const [selectedLocaleId, setSelectedLocaleId] = useState(''); - - return ( - - ); + // Controlled + const [active, setActive] = useState(false); + + // Controlled + const [selectedLocaleId, setSelectedLocaleId] = useState(''); + + return ( + + ); } ``` @@ -155,58 +153,56 @@ Unlike the default Language Picker, translations variant is used to select a tra import {Provider, LanguagePicker} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const translations = { - 'ca-ES': {total: 4, translated: 2}, - 'nl-NL': {total: 4, translated: 4}, - }; - - return ( - -
- -
-
- ); + const translations = { + 'ca-ES': {total: 4, translated: 2}, + 'nl-NL': {total: 4, translated: 4}, + }; + + return ( + +
+ +
+
+ ); } ``` This variant shows translation status labels next to each translation language to indicate the translation status for the content. The states are described below: -- **Default**: Indentifies the default language. This default language is set with the property `defaultLocaleId`. If there is no `defaultLocaleId` it will take the first of the locales. -- **Translated**: Used when all fields have been translated. -- **Not Translated**: Used when none of the localizable fields have been translated. -- **Translating x/x**: Used when at least one of the localizable fields of a content item has been translated. This label indicates the number of fields translated compared to the total number of fields. +- **Default**: Indentifies the default language. This default language is set with the property `defaultLocaleId`. If there is no `defaultLocaleId` it will take the first of the locales. +- **Translated**: Used when all fields have been translated. +- **Not Translated**: Used when none of the localizable fields have been translated. +- **Translating x/x**: Used when at least one of the localizable fields of a content item has been translated. This label indicates the number of fields translated compared to the total number of fields. ## Trigger Options @@ -218,44 +214,42 @@ You can customize the Language Picker trigger to display only the icon by settin import {Provider, LanguagePicker} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- -
-
- ); + return ( + +
+ +
+
+ ); } ``` @@ -267,43 +261,41 @@ You can reduce the size of the Language Picker trigger by setting the `small` pr import {Provider, LanguagePicker} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
- -
-
- ); + return ( + +
+ +
+
+ ); } ``` diff --git a/packages/clay-core/docs/menubar.mdx b/packages/clay-core/docs/menubar.mdx index 0782e11230..5bc3359ae6 100644 --- a/packages/clay-core/docs/menubar.mdx +++ b/packages/clay-core/docs/menubar.mdx @@ -9,1077 +9,969 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/navigation/ve A pattern for collapsing vertical navigations, collapses at 767px. For vertical navigations that don't collapse use [Nav Stacked](/docs/components/nav/markup#css-nav-stacked) or [Nav Nested](/docs/components/nav/markup#css-nav-nested).
- +
```html ``` ### Menubar Vertical Expand Md with Buttons
- +
```html ``` @@ -1088,590 +980,514 @@ A pattern for collapsing vertical navigations, collapses at 767px. For vertical Collapses at 991px.
- +
```html ``` diff --git a/packages/clay-core/docs/overlay-mask.mdx b/packages/clay-core/docs/overlay-mask.mdx index 0606ea56db..c6c436fc22 100644 --- a/packages/clay-core/docs/overlay-mask.mdx +++ b/packages/clay-core/docs/overlay-mask.mdx @@ -12,34 +12,29 @@ packageTypes: ['clay-core/src/overlay-mask/OverlayMask.tsx'] ```jsx preview import {Provider, Button, OverlayMask} from '@clayui/core'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [visible, setVisible] = useState(false); - - return ( - -
- - - setVisible(false)} - visible={visible} - > - - - -
-
- ); + const [visible, setVisible] = React.useState(false); + + return ( + +
+ + + setVisible(false)} visible={visible}> + + + +
+
+ ); } ``` @@ -55,7 +50,7 @@ There are two different ways to create the highlighted area for a component, thi ```jsx - Button + Button ``` @@ -63,12 +58,12 @@ Another option is for cases where it is not possible to define the component as ```jsx - {(ref) => ( - <> - Button A - Button B - - )} + {(ref) => ( + <> + Button A + Button B + + )} ``` @@ -81,22 +76,22 @@ const logo = document.body.querySelector('.logo'); const {height, width, x, y} = logo.getBoundingClientRect(); ; // or const [bounds, setBounds] = useState({ - height: 0, - width: 0, - x: 0, - y: 0, + height: 0, + width: 0, + x: 0, + y: 0, }); useEffect(() => {}, []); diff --git a/packages/clay-core/docs/picker.mdx b/packages/clay-core/docs/picker.mdx index bfb8e4d4bc..1f3c2d4806 100644 --- a/packages/clay-core/docs/picker.mdx +++ b/packages/clay-core/docs/picker.mdx @@ -6,7 +6,7 @@ packageStatus: 'Beta' packageUse: "import {Option, Picker} from '@clayui/core';" storybookPath: 'design-system-components-picker' packageTypes: - ['clay-core/src/picker/Picker.tsx', 'clay-core/src/picker/Option.tsx'] + ['clay-core/src/picker/Picker.tsx', 'clay-core/src/picker/Option.tsx'] --- ## Example @@ -16,41 +16,39 @@ import {Provider, Option, Picker} from '@clayui/core'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
-
- - - - {(item) => } - - -
-
-
- ); + return ( + +
+
+ + + + {(item) => } + + +
+
+
+ ); } ``` @@ -70,17 +68,17 @@ Static content is when the `` options do not change during the lifecyc ```jsx - - - - - - - + + + + + + + ``` @@ -90,16 +88,16 @@ Unlike static content, dynamic content is when the options can change during the ```jsx - - - {(item) => } - + + + {(item) => } + ``` @@ -112,46 +110,47 @@ For the `` component you can control the `selectedKey` and `active` st If you just need to set the initial state of the `selectedKey`, use the `defaultSelectedKey` property which is appropriate for that use case.
- Info - The selectedKey property is represented - by the key property configured in the{' '} - Option component, so the component can - identify which value is selected and which should be shown in the trigger.
-
- When the content rendering is dynamic and the data has - id - property defined, the component uses - id - instead of key. + Info + The selectedKey property is represented + by the key property configured in the + Option + component, so the component can identify which value is selected and which + should be shown in the trigger.
+
+ When the content rendering is dynamic and the data has + id + property defined, the component uses + id + instead of key.
```jsx function Example() { - // Controlled - const [active, setActive] = useState(false); - - // Controlled - const [selectedKey, setSelectedKey] = useState(''); - - return ( - - - - - - - - - ); + // Controlled + const [active, setActive] = useState(false); + + // Controlled + const [selectedKey, setSelectedKey] = useState(''); + + return ( + + + + + + + + + ); } ``` @@ -163,44 +162,41 @@ The composition allows you to customize the component or add new features. See s ```jsx preview import {Provider, Option, Picker, Icon} from '@clayui/core'; -import {useId} from '@clayui/shared'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - const Trigger = React.forwardRef(({children, ...otherProps}, ref) => ( -
- - {children} -
+
+ + {children} +
)); export default function App() { - const pickerId = useId(); - const labelId = useId(); - - return ( - -
-
- - - - {(item) => } - - -
-
-
- ); + const pickerId = React.useId(); + const labelId = React.useId(); + + return ( + +
+
+ + + + {(item) => } + + +
+
+
+ ); } ``` @@ -208,63 +204,53 @@ export default function App() { ```jsx preview import {Provider, Option, Picker, Text} from '@clayui/core'; -import {useId} from '@clayui/shared'; import Layout from '@clayui/layout'; import Label from '@clayui/label'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const pickerId = useId(); - const labelId = useId(); - - return ( - -
-
- - - - {(item) => ( - - )} - - -
-
-
- ); + const pickerId = React.useId(); + const labelId = React.useId(); + + return ( + +
+
+ + + + {(item) => ( + + )} + + +
+
+
+ ); } ``` @@ -272,65 +258,55 @@ export default function App() { ```jsx preview import {Provider, Option, Picker} from '@clayui/core'; -import {useId} from '@clayui/shared'; import DropDown from '@clayui/drop-down'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const pickerId = useId(); - const labelId = useId(); - - return ( - -
-
- - - - {(group) => ( - - {(item) => ( - - )} - - )} - - -
-
-
- ); + const pickerId = React.useId(); + const labelId = React.useId(); + + return ( + +
+
+ + + + {(group) => ( + + {(item) => } + + )} + + +
+
+
+ ); } ``` @@ -341,41 +317,39 @@ import {Provider, Option, Picker} from '@clayui/core'; import Form from '@clayui/form'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
-
- - - - {(item) => } - - -
-
-
- ); + return ( + +
+
+ + + + {(item) => } + + +
+
+
+ ); } ``` @@ -384,21 +358,21 @@ export default function App() { Native select for mobile devices offers a better experience compared to Picker in some cases. The Picker offers the possibility to render using the native selector of the browser of the device when it is detected that it is on a mobile device, by default this property is disabled but it can be enabled by setting the `native` property to `true`.
- Warning - If the content of the Option component is not simple text, for it to work correctly - set the property textValue to ensure that - the component knows what the option label is. + Warning + If the content of the Option component is not simple text, for it to work correctly + set the property textValue to ensure that + the component knows what the option label is.
```jsx - - - - - - + + + + + + ``` diff --git a/packages/clay-core/docs/reduced-motion.mdx b/packages/clay-core/docs/reduced-motion.mdx index cf77ed5760..bc103420aa 100644 --- a/packages/clay-core/docs/reduced-motion.mdx +++ b/packages/clay-core/docs/reduced-motion.mdx @@ -14,15 +14,15 @@ Setting the motion reduction of animations can be done in two different ways in To remove transition from components in React, you need to declare the [`Provider`](/docs/components/provider) component at the root of your application and set the `reducedMotion` property to whichever option you want. -- `user`: Respect user's device setting. -- `always`: Enforce reduced motion. -- `never`: Don't reduce motion. +- `user`: Respect user's device setting. +- `always`: Enforce reduced motion. +- `never`: Don't reduce motion. ```jsx import {Provider} from '@clayui/core'; - + ; ``` diff --git a/packages/clay-core/docs/sidebar.mdx b/packages/clay-core/docs/sidebar.mdx index 40c01c97b6..f5aed385c5 100644 --- a/packages/clay-core/docs/sidebar.mdx +++ b/packages/clay-core/docs/sidebar.mdx @@ -25,986 +25,902 @@ Is composed by: ## Size
-
-
-
-
- -
-
-
-
-
-
-
- -
- - -
-
-
-
- -
-
-
    -
  • -
    - -
    -
    -
    - - - - - -
    -
    -
    -
    Text
    -
    - Single line or multiline text area -
    -
    -
  • -
  • -
    - -
    -
    -
    - - - - - -
    -
    -
    -
    - Select from List -
    -
    - Select options from a list -
    -
    -
  • -
  • -
    - -
    -
    -
    - - - - - -
    -
    -
    -
    - Single Selection -
    -
    - Select only one option -
    -
    -
  • -
-
-
- -
-
- - Password - - - - - - - - - - - -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- -
-
- -
-
-
-
- -
-
-
-
- - - - - thumbnail - - - - - wall - - - - - - - - - - thumbnail - - - - - wallpaper - - - - - - - - - - thumbnail - - - - - wonderwall - - - - - - - - winterfell - - - - - - - - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre - - - - - - -
-
-
-
- You can use a comma to - enter tags. - ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual. -
-
-
-
- -
-
-
-
-
-
-
- -
-
- In organic dripper so, body, robust medium - pumpkin spice cup, in aged dripper latte - extra cup white. And viennese redeye - carajillo, beans, mug viennese, carajillo id - breve decaffeinated americano crema chicory - whipped arabica variety aged robusta. - Affogato lungo eu, cultivar at, aged breve - and blue mountain roast breve americano - aged. Sugar acerbic sweet variety aged café - au lait chicory, java, single shot - percolator aromatic brewed wings, a, sugar, - body, aftertaste organic barista espresso - dripper to go. Flavour to go strong steamed - mazagran trifecta decaffeinated percolator - crema, aged americano rich chicory - frappuccino foam white. -
-
-
-
- -
-
- Flavour filter fair trade kopi-luwak robusta - viennese, trifecta grinder, grounds lungo - beans, half and half cup steamed cappuccino - cinnamon. Percolator, extra, strong, breve, - french press to go aromatic half and half - aroma barista caramelization ut froth breve - spoon redeye to go skinny rich skinny spoon. - As turkish est filter foam con panna, - cinnamon, aroma grounds cup whipped cultivar - extra. Latte bar crema cultivar espresso - pumpkin spice viennese, body viennese milk - variety dripper, spoon, blue mountain - robusta cultivar et spoon. Macchiato id eu - brewed, and mazagran cinnamon so wings, - doppio mocha froth blue mountain froth half - and half iced to go whipped single shot. -
-
-
-
- -
-
- Eu ristretto ut sugar rich saucer milk - aftertaste, froth dark, cultivar blue - mountain as coffee cappuccino. Saucer - grounds mocha, aroma, half and half coffee - eu robusta roast, doppio skinny galão, - extraction, frappuccino aromatic breve crema - frappuccino aroma. Froth half and half so - java, grounds half and half, macchiato at - est sugar mug redeye, strong, cream seasonal - qui doppio robusta. Wings, at, cup dark, a, - breve french press decaffeinated acerbic, - black extra, and, saucer barista rich - seasonal barista blue mountain. Roast - mazagran a and id mug in est trifecta - pumpkin spice coffee and mug trifecta, ut - breve, mug frappuccino mug, breve mocha qui - aged aftertaste. -
-
-
-
-
-
- Fieldsets -
- - - - - - -
- -
- - - -
-
- - - - - - -
- -
- - -
-
-
-
-
-
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+ + +
+
+
+
+ +
+
+
    +
  • +
    + +
    +
    +
    + + + + + +
    +
    +
    +
    Text
    +
    + Single line or multiline text area +
    +
    +
  • +
  • +
    + +
    +
    +
    + + + + + +
    +
    +
    +
    Select from List
    +
    + Select options from a list +
    +
    +
  • +
  • +
    + +
    +
    +
    + + + + + +
    +
    +
    +
    Single Selection
    +
    + Select only one option +
    +
    +
  • +
+
+
+ +
+
+ + Password + + + + + + + + + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ + + + + thumbnail + + + + + wall + + + + + + + + + + thumbnail + + + + + wallpaper + + + + + + + + + + thumbnail + + + + + wonderwall + + + + + + + + winterfell + + + + + + + + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAre + + + + + + +
+
+
+
+ You can use a comma to enter tags. + ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual. +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ In organic dripper so, body, robust medium pumpkin spice cup, + in aged dripper latte extra cup white. And viennese redeye + carajillo, beans, mug viennese, carajillo id breve + decaffeinated americano crema chicory whipped arabica variety + aged robusta. Affogato lungo eu, cultivar at, aged breve and + blue mountain roast breve americano aged. Sugar acerbic sweet + variety aged café au lait chicory, java, single shot + percolator aromatic brewed wings, a, sugar, body, aftertaste + organic barista espresso dripper to go. Flavour to go strong + steamed mazagran trifecta decaffeinated percolator crema, aged + americano rich chicory frappuccino foam white. +
+
+
+
+ +
+
+ Flavour filter fair trade kopi-luwak robusta viennese, + trifecta grinder, grounds lungo beans, half and half cup + steamed cappuccino cinnamon. Percolator, extra, strong, breve, + french press to go aromatic half and half aroma barista + caramelization ut froth breve spoon redeye to go skinny rich + skinny spoon. As turkish est filter foam con panna, cinnamon, + aroma grounds cup whipped cultivar extra. Latte bar crema + cultivar espresso pumpkin spice viennese, body viennese milk + variety dripper, spoon, blue mountain robusta cultivar et + spoon. Macchiato id eu brewed, and mazagran cinnamon so wings, + doppio mocha froth blue mountain froth half and half iced to + go whipped single shot. +
+
+
+
+ +
+
+ Eu ristretto ut sugar rich saucer milk aftertaste, froth dark, + cultivar blue mountain as coffee cappuccino. Saucer grounds + mocha, aroma, half and half coffee eu robusta roast, doppio + skinny galão, extraction, frappuccino aromatic breve crema + frappuccino aroma. Froth half and half so java, grounds half + and half, macchiato at est sugar mug redeye, strong, cream + seasonal qui doppio robusta. Wings, at, cup dark, a, breve + french press decaffeinated acerbic, black extra, and, saucer + barista rich seasonal barista blue mountain. Roast mazagran a + and id mug in est trifecta pumpkin spice coffee and mug + trifecta, ut breve, mug frappuccino mug, breve mocha qui aged + aftertaste. +
+
+
+
+
+
+ Fieldsets +
+ + + + + + +
+ +
+ + + +
+
+ + + + + + +
+ +
+ + +
+
+
+
+
+
## Variations @@ -1014,397 +930,358 @@ Is composed by: Just add `sidebar-light` class on the same element that you are using `sidebar`.
-
- -
-
-
-

- - - Image1.jpg - - -

-

Basic Document

-
- -
-
-
- -
-
-
- thumbnail -
- JPG -
-
-
-
Url
-
- - http://localhost:8080/documents/20140/ - -
-
Created
-
- Helen Smith -
-
Description
-
- A picture of a person using a ruler and exacto knife - to cut construction paper. -
-
Size
-
745KB
-
Tags
-
- - - Tag One - - - - - Tag Two - - -
-
Related Assets
-
- -
-
-
-
- -
-
- In organic dripper so, body, robust medium - pumpkin spice cup, in aged dripper latte - extra cup white. -
-
-
-
-
-
- -
-
-
-
+
+ +
+
+
+

+ + + Image1.jpg + + +

+

Basic Document

+
+ +
+
+
+ +
+
+
+ thumbnail +
+ JPG +
+
+
+
Url
+
+ http://localhost:8080/documents/20140/ +
+
Created
+
+ Helen Smith +
+
Description
+
+ A picture of a person using a ruler and exacto knife to cut + construction paper. +
+
Size
+
745KB
+
Tags
+
+ + Tag One + + + Tag Two + +
+
Related Assets
+
+ +
+
+
+
+ +
+
+ In organic dripper so, body, robust medium pumpkin spice cup, + in aged dripper latte extra cup white. +
+
+
+
+
+
+ +
+
+
+
```html @@ -1425,7 +1302,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. role="presentation" > @@ -1448,7 +1325,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. role="presentation" > @@ -1460,7 +1337,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. focusable="false" role="presentation" > - + @@ -1493,7 +1370,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. role="presentation" > @@ -1536,7 +1413,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. focusable="false" role="presentation" > - +
@@ -1689,7 +1566,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. role="presentation" > @@ -1700,7 +1577,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. role="presentation" > @@ -1754,7 +1631,7 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. role="presentation" > @@ -1794,130 +1671,120 @@ Just add `sidebar-light` class on the same element that you are using `sidebar`. Just add `sidebar-dark` class on the same element that you are using `sidebar`. ```html
-
-
-
- -
-
- -
-
-
- +
+
+
+ +
+
+ +
+
+
+
``` @@ -1926,129 +1793,119 @@ Just add `sidebar-dark` class on the same element that you are using `sidebar`. Just add `sidebar-dark-l2` class on the same element that you are using `sidebar`. ```html
-
-
-
- -
-
- -
-
-
- +
+
+
+ +
+
+ +
+
+
+
``` diff --git a/packages/clay-core/docs/table.mdx b/packages/clay-core/docs/table.mdx index 692117ae1f..62ebc9589c 100644 --- a/packages/clay-core/docs/table.mdx +++ b/packages/clay-core/docs/table.mdx @@ -7,95 +7,93 @@ packageStatus: 'Beta' packageUse: "import {Body, Cell, Head, Row, Table} from '@clayui/core';" storybookPath: 'design-system-components-table--dynamic' packageTypes: - [ - 'clay-core/src/table/Table.tsx', - 'clay-core/src/table/Body.tsx', - 'clay-core/src/table/Head.tsx', - 'clay-core/src/table/Cell.tsx', - 'clay-core/src/table/Row.tsx', - ] + [ + 'clay-core/src/table/Table.tsx', + 'clay-core/src/table/Body.tsx', + 'clay-core/src/table/Head.tsx', + 'clay-core/src/table/Cell.tsx', + 'clay-core/src/table/Row.tsx', + ] --- ## Example ```jsx preview -import React, {useCallback, useState} from 'react'; +import React from 'react'; import {Body, Cell, Text, Head, Row, Table, Provider} from '@clayui/core'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [sort, setSort] = useState(null); - const [items, setItems] = useState([ - {files: 22, id: 1, name: 'Games', type: 'File folder'}, - {files: 7, id: 2, name: 'Program Files', type: 'File folder'}, - ]); - - const onSortChange = useCallback((sort) => { - if (sort) { - setItems((items) => - items.sort((a, b) => { - let cmp = new Intl.Collator('en', {numeric: true}).compare( - a[sort.column], - b[sort.column] - ); - - if (sort.direction === 'descending') { - cmp *= -1; - } - - return cmp; - }) - ); - } - - setSort(sort); - }, []); - - return ( - -
- - - {(column) => ( - - {column.name} - - )} - - - - {(row) => ( - - - - {row['name']} - - - {row['files']} - {row['type']} - - )} - -
-
-
- ); + const [sort, setSort] = React.useState(null); + const [items, setItems] = React.useState([ + {files: 22, id: 1, name: 'Games', type: 'File folder'}, + {files: 7, id: 2, name: 'Program Files', type: 'File folder'}, + ]); + + const onSortChange = React.useCallback((sort) => { + if (sort) { + setItems((items) => + items.sort((a, b) => { + let cmp = new Intl.Collator('en', {numeric: true}).compare( + a[sort.column], + b[sort.column] + ); + + if (sort.direction === 'descending') { + cmp *= -1; + } + + return cmp; + }) + ); + } + + setSort(sort); + }, []); + + return ( + +
+ + + {(column) => ( + + {column.name} + + )} + + + + {(row) => ( + + + + {row['name']} + + + {row['files']} + {row['type']} + + )} + +
+
+
+ ); } ``` @@ -106,9 +104,9 @@ Table allows the rendering of static and dynamic content for data-oriented and d The component covers the [W3C accessibility](https://www.w3.org/WAI/ARIA) patterns for the [simplest table implementation](https://www.w3.org/WAI/tutorials/tables/) and also the [treegrid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/examples/treegrid-1/) for when [nested row](#nested-row) is used without requiring the developer to have to configure something extremely complex.
- Warning - To use the new Table implementation it is necessary to consume the component - using the package @clayui/core. + Warning + To use the new Table implementation it is necessary to consume the component using + the package @clayui/core.
## Content @@ -121,21 +119,21 @@ Static content is when the `` options do not change during the lifecycl ```jsx
- - Name - Type - - - - - Games - File Folder - - - Program Files - File Folder - - + + Name + Type + + + + + Games + File Folder + + + Program Files + File Folder + +
``` @@ -145,82 +143,82 @@ Unlike static content, dynamic content is when the options can change during the ```jsx - - {(column) => {column.name}} - - - { - // do something - }} - > - {(row) => ( - - {row.name} - {row.type} - - )} - + + {(column) => {column.name}} + + + { + // do something + }} + > + {(row) => ( + + {row.name} + {row.type} + + )} +
``` ## Icons
- Warning - When implementing ClayTable from a React application, the icons may not render. - The - Application Provider - method will make the icons available for use. + Warning + When implementing ClayTable from a React application, the icons may not render. + The + Application Provider + method will make the icons available for use.
```jsx - - - {(column) => {column.name}} - - - - {(row) => ( - - {row.name} - {row.type} - - )} - -
+ + + {(column) => {column.name}} + + + + {(row) => ( + + {row.name} + {row.type} + + )} + +
``` @@ -231,77 +229,75 @@ Column sorting is implemented OOTB so the developer doesn't need to worry about It is also possible to implement your own logic on the client side when your data is predictable, check out the pseudocode.
- Info - Column sorting is only enabled for columns that contain the - sortable - API defined. + Info + Column sorting is only enabled for columns that contain the + sortable + API defined.
```jsx preview -import React, {useMemo, useState} from 'react'; +import React from 'react'; import {Body, Cell, Text, Head, Row, Table, Provider} from '@clayui/core'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [sort, setSort] = useState(null); - const [items, setItems] = useState([ - {files: 22, id: 1, name: 'Games', type: 'File folder'}, - {files: 7, id: 2, name: 'Program Files', type: 'File folder'}, - ]); - - const filteredItems = useMemo(() => { - if (!sort) { - return items; - } - - return items.sort((a, b) => { - let cmp = new Intl.Collator('en', {numeric: true}).compare( - a[sort.column], - b[sort.column] - ); - - if (sort.direction === 'descending') { - cmp *= -1; - } - - return cmp; - }); - }, [sort, items]); - - return ( - -
- - - - Name - - - Files - - - Type - - - - - {(row) => ( - - - - {row['name']} - - - {row['files']} - {row['type']} - - )} - -
-
-
- ); + const [sort, setSort] = React.useState(null); + const [items, setItems] = React.useState([ + {files: 22, id: 1, name: 'Games', type: 'File folder'}, + {files: 7, id: 2, name: 'Program Files', type: 'File folder'}, + ]); + + const filteredItems = React.useMemo(() => { + if (!sort) { + return items; + } + + return items.sort((a, b) => { + let cmp = new Intl.Collator('en', {numeric: true}).compare( + a[sort.column], + b[sort.column] + ); + + if (sort.direction === 'descending') { + cmp *= -1; + } + + return cmp; + }); + }, [sort, items]); + + return ( + +
+ + + + Name + + + Files + + + Type + + + + + {(row) => ( + + + + {row['name']} + + + {row['files']} + {row['type']} + + )} + +
+
+
+ ); } ``` @@ -311,39 +307,39 @@ Most tables with sorting can have a lot of data and are paged so the sorting mus ```jsx function App() { - const { - resource: items, - sort, - sortChange, - } = useResource({ - fetch: (link, init, sort) => { - const url = new URL(link); - - if (sort) { - url.searchParams.append('column', String(sort.column)); - url.searchParams.append('direction', sort.direction); - } - - return fetch(url, init); - }, - link: 'https://example.com/api/items', - }); - - return ( - - - - Name - - - Files - - Type - - - ... -
- ); + const { + resource: items, + sort, + sortChange, + } = useResource({ + fetch: (link, init, sort) => { + const url = new URL(link); + + if (sort) { + url.searchParams.append('column', String(sort.column)); + url.searchParams.append('direction', sort.direction); + } + + return fetch(url, init); + }, + link: 'https://example.com/api/items', + }); + + return ( + + + + Name + + + Files + + Type + + + ... +
+ ); } ``` @@ -354,79 +350,70 @@ Implementing nested row allows you to render a table as a tree view. It is not n When using the nested row pattern, Clay automatically changes the accessibility behavior to use the [treegrid](https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/examples/treegrid-1/) recommendation instead of the default behavior.
- Limitation - The unique id of a row does not work properly when configured via - key - in the Row component property - to deal with the nodes expandability, it is necessary that the - id - key is defined in your row data to use as unique id. + Limitation + The unique id of a row does not work properly when configured via + key + in the Row component property to + deal with the nodes expandability, it is necessary that the + id + key is defined in your row data to use as unique id.
```jsx preview import React from 'react'; import {Body, Cell, Head, Row, Table, Provider} from '@clayui/core'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const columns = [ - { - id: 'name', - name: 'Name', - }, - { - id: 'type', - name: 'Type', - }, - ]; - - return ( - -
- - - {(column) => ( - - {column.name} - - )} - - - - {(row) => ( - - {(column) => ( - - {row[column.id]} - - )} - - )} - -
-
-
- ); + const columns = [ + { + id: 'name', + name: 'Name', + }, + { + id: 'type', + name: 'Type', + }, + ]; + + return ( + +
+ + + {(column) => ( + + {column.name} + + )} + + + + {(row) => ( + + {(column) => ( + {row[column.id]} + )} + + )} + +
+
+
+ ); } ``` @@ -434,33 +421,33 @@ export default function App() { Expanding nodes is done OOTB in the component but it is also possible to control the state to modify behaviors if necessary or use it to save a session to improve the user experience. -
- Warning - If your data structure does not have a key property - id - that is used as a unique identifier for each item, you need to configure - which key will be used to identify the item by using the - itemIdKey - API in the Table component. +
+ Warning + If your data structure does not have a key property + id + that is used as a unique identifier for each item, you need to configure + which key will be used to identify the item by using the + itemIdKey + API in the Table component.
```jsx const [expandedKeys, setExpandedKeys] = useState(new Set()); - - {(column) => {column.name}} - - - - {(row) => ( - - {(column) => ( - {row[column.id]} - )} - - )} - + + {(column) => {column.name}} + + + + {(row) => ( + + {(column) => ( + {row[column.id]} + )} + + )} +
; ``` @@ -468,40 +455,40 @@ const [expandedKeys, setExpandedKeys] = useState(new Set()); When the tree is very large with a lot of data on a single node, loading the data asynchronously is essential to reduce the initial data payload and memory space. Table supports asynchronous node loading when the user expands a node. -- When returning `void`, `null` or `undefined` the Table will do nothing. -- When returning the `items` will add to the tree. +- When returning `void`, `null` or `undefined` the Table will do nothing. +- When returning the `items` will add to the tree.
- Warning - If you have an error in the asynchronous call of the - onLoadMore - method, only the suppression is done and an error is thrown on the console. + Warning + If you have an error in the asynchronous call of the + onLoadMore + method, only the suppression is done and an error is thrown on the console.
When adding a new asynchronous item to the tree, the `onItemsChange` method is respectively called to update the tree with a new value if the `items` prop is controlled. ```jsx { - return await fetch(`example.com/tree/item?parent_id=${item.id}`); - }} + onLoadMore={async (item) => { + return await fetch(`example.com/tree/item?parent_id=${item.id}`); + }} > - - {(column) => {column.name}} - - - - {(row) => ( - - {row.name} - {row.type} - - )} - + + {(column) => {column.name}} + + + + {(row) => ( + + {row.name} + {row.type} + + )} +
``` diff --git a/packages/clay-core/docs/text.mdx b/packages/clay-core/docs/text.mdx index 925ce9bcc4..5d856e32ac 100644 --- a/packages/clay-core/docs/text.mdx +++ b/packages/clay-core/docs/text.mdx @@ -20,46 +20,44 @@ The same way as [Heading](/docs/components/heading), Text provides its own font import {Text} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
-
- Text Size Level 11 -
-
- Text Size Level 10 -
-
- Text Size Level 9 -
-
- Text Size Level 8 -
-
- Text Size Level 7 -
-
- Text Size Level 6 -
-
- Text Size Level 5 -
-
- Text Size Level 4 -
-
- Text Size Level 3 -
-
- Text Size Level 2 -
-
- Text Size Level 1 -
-
- ); + return ( +
+
+ Text Size Level 11 +
+
+ Text Size Level 10 +
+
+ Text Size Level 9 +
+
+ Text Size Level 8 +
+
+ Text Size Level 7 +
+
+ Text Size Level 6 +
+
+ Text Size Level 5 +
+
+ Text Size Level 4 +
+
+ Text Size Level 3 +
+
+ Text Size Level 2 +
+
+ Text Size Level 1 +
+
+ ); } ``` @@ -85,22 +83,19 @@ Likewise, Text provides a new property that allows you change the font weight of import {Text} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
- - Single origin, extra id beans, eu to go, skinny americano ut - aftertas te sugar. At americano, viennese variety iced grounds, - grinder froth and pumpkin spice aromatic. Cultivar aged lungo, - grounds café au lait, skinny, blue mountain, in variety sugar - shop roast. Wings, blue mountain affogato organic cappuccino - java plunger pot. Single shot variety pumpkin spice seasonal - skinny barista carajillo robust cream. - -
- ); + return ( +
+ + Single origin, extra id beans, eu to go, skinny americano ut aftertas te + sugar. At americano, viennese variety iced grounds, grinder froth and + pumpkin spice aromatic. Cultivar aged lungo, grounds café au lait, + skinny, blue mountain, in variety sugar shop roast. Wings, blue mountain + affogato organic cappuccino java plunger pot. Single shot variety + pumpkin spice seasonal skinny barista carajillo robust cream. + +
+ ); } ``` @@ -112,22 +107,19 @@ If you want to shortening Text content because it doesn't fit the layout correct import {Text} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
- - Single origin, extra id beans, eu to go, skinny americano ut - aftertas te sugar. At americano, viennese variety iced grounds, - grinder froth and pumpkin spice aromatic. Cultivar aged lungo, - grounds café au lait, skinny, blue mountain, in variety sugar - shop roast. Wings, blue mountain affogato organic cappuccino - java plunger pot. Single shot variety pumpkin spice seasonal - skinny barista carajillo robust cream. - -
- ); + return ( +
+ + Single origin, extra id beans, eu to go, skinny americano ut aftertas te + sugar. At americano, viennese variety iced grounds, grinder froth and + pumpkin spice aromatic. Cultivar aged lungo, grounds café au lait, + skinny, blue mountain, in variety sugar shop roast. Wings, blue mountain + affogato organic cappuccino java plunger pot. Single shot variety + pumpkin spice seasonal skinny barista carajillo robust cream. + +
+ ); } ``` @@ -139,22 +131,19 @@ Text provides a property which sets a font whose letters and characters each occ import {Text} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
- - Single origin, extra id beans, eu to go, skinny americano ut - aftertas te sugar. At americano, viennese variety iced grounds, - grinder froth and pumpkin spice aromatic. Cultivar aged lungo, - grounds café au lait, skinny, blue mountain, in variety sugar - shop roast. Wings, blue mountain affogato organic cappuccino - java plunger pot. Single shot variety pumpkin spice seasonal - skinny barista carajillo robust cream. - -
- ); + return ( +
+ + Single origin, extra id beans, eu to go, skinny americano ut aftertas te + sugar. At americano, viennese variety iced grounds, grinder froth and + pumpkin spice aromatic. Cultivar aged lungo, grounds café au lait, + skinny, blue mountain, in variety sugar shop roast. Wings, blue mountain + affogato organic cappuccino java plunger pot. Single shot variety + pumpkin spice seasonal skinny barista carajillo robust cream. + +
+ ); } ``` @@ -166,34 +155,32 @@ Text has the ability to apply different `color` fonts giving emphasis to the tex import {Text} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
- - primary - - - secondary - - - muted - - - success - - - warning - - - danger - - - info - -
- ); + return ( +
+ + primary + + + secondary + + + muted + + + success + + + warning + + + danger + + + info + +
+ ); } ``` @@ -205,31 +192,29 @@ As well as [Heading](/docs/components/heading), Text provides its own font weigh import {Text} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
- - Text with ligther weight - - - Text with light weight - - - Text with normal weight - - - Text with semi-bold weight - - - Text with bold weight - - - Text with bolder weight - -
- ); + return ( +
+ + Text with ligther weight + + + Text with light weight + + + Text with normal weight + + + Text with semi-bold weight + + + Text with bold weight + + + Text with bolder weight + +
+ ); } ``` @@ -238,16 +223,14 @@ export default function App() { The `` component adds a highlight to the text characters that match the value that can be entered by the user, for example can be used in an Autocomplete component. ```jsx preview -import {Text} from '@clayui/core'; +import {TextHighlight} from '@clayui/core'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( -
- Rick Sanchez -
- ); + return ( +
+ Rick Sanchez +
+ ); } ``` diff --git a/packages/clay-core/docs/timelines.mdx b/packages/clay-core/docs/timelines.mdx index d9feac88b7..15ab040ca3 100644 --- a/packages/clay-core/docs/timelines.mdx +++ b/packages/clay-core/docs/timelines.mdx @@ -11,200 +11,188 @@ The icon can be any size as long as it is wrapped inside `timeline-increment`. F ## Default
-
    -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id - breve decaffeinated americano crema chicory whipped - arabica variety aged robusta. Affogato lungo eu, - cultivar at, aged breve and blue mountain roast breve - americano aged. Sugar acerbic sweet variety aged café au - lait chicory, java, single shot percolator aromatic - brewed wings, a, sugar, body, aftertaste organic barista - espresso dripper to go. Flavour to go strong steamed - mazagran trifecta decaffeinated percolator crema, aged - americano rich chicory frappuccino foam white. -
    -
    -
    -
  • -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id - breve decaffeinated americano crema chicory whipped - arabica variety aged robusta. Affogato lungo eu, - cultivar at, aged breve and blue mountain roast breve - americano aged. Sugar acerbic sweet variety aged café au - lait chicory, java, single shot percolator aromatic - brewed wings, a, sugar, body, aftertaste organic barista - espresso dripper to go. Flavour to go strong steamed - mazagran trifecta decaffeinated percolator crema, aged - americano rich chicory frappuccino foam white. -
    -
    -
    -
  • -
  • -
    -
    - -
    -
    - The icon can be any size as long as it is wrapped inside - timeline-increment. For larger icons, the spacing between - the content and label must be adjusted to accomodate it. The - spacing can be adjusted by modifying the $timeline-spacing - sass variable, or manually overriding in your css. -
    -
    -
  • -
+
    +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in + aged dripper latte extra cup white. And viennese redeye carajillo, + beans, mug viennese, carajillo id breve decaffeinated americano + crema chicory whipped arabica variety aged robusta. Affogato lungo + eu, cultivar at, aged breve and blue mountain roast breve americano + aged. Sugar acerbic sweet variety aged café au lait chicory, java, + single shot percolator aromatic brewed wings, a, sugar, body, + aftertaste organic barista espresso dripper to go. Flavour to go + strong steamed mazagran trifecta decaffeinated percolator crema, + aged americano rich chicory frappuccino foam white. +
    +
    +
    +
  • +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in + aged dripper latte extra cup white. And viennese redeye carajillo, + beans, mug viennese, carajillo id breve decaffeinated americano + crema chicory whipped arabica variety aged robusta. Affogato lungo + eu, cultivar at, aged breve and blue mountain roast breve americano + aged. Sugar acerbic sweet variety aged café au lait chicory, java, + single shot percolator aromatic brewed wings, a, sugar, body, + aftertaste organic barista espresso dripper to go. Flavour to go + strong steamed mazagran trifecta decaffeinated percolator crema, + aged americano rich chicory frappuccino foam white. +
    +
    +
    +
  • +
  • +
    +
    + +
    +
    + The icon can be any size as long as it is wrapped inside + timeline-increment. For larger icons, the spacing between the content + and label must be adjusted to accomodate it. The spacing can be + adjusted by modifying the $timeline-spacing sass variable, or manually + overriding in your css. +
    +
    +
  • +
```html
    -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id breve - decaffeinated americano crema chicory whipped arabica - variety aged robusta. Affogato lungo eu, cultivar at, aged - breve and blue mountain roast breve americano aged. Sugar - acerbic sweet variety aged café au lait chicory, java, - single shot percolator aromatic brewed wings, a, sugar, - body, aftertaste organic barista espresso dripper to go. - Flavour to go strong steamed mazagran trifecta decaffeinated - percolator crema, aged americano rich chicory frappuccino - foam white. -
    -
    -
    -
  • -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id breve - decaffeinated americano crema chicory whipped arabica - variety aged robusta. Affogato lungo eu, cultivar at, aged - breve and blue mountain roast breve americano aged. Sugar - acerbic sweet variety aged café au lait chicory, java, - single shot percolator aromatic brewed wings, a, sugar, - body, aftertaste organic barista espresso dripper to go. - Flavour to go strong steamed mazagran trifecta decaffeinated - percolator crema, aged americano rich chicory frappuccino - foam white. -
    -
    -
    -
  • -
  • -
    -
    - -
    -
    - The icon can be any size as long as it is wrapped inside - timeline-increment. For larger icons, the spacing between the - content and label must be adjusted to accomodate it. The spacing - can be adjusted by modifying the $timeline-spacing sass - variable, or manually overriding in your css. -
    -
    -
  • +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in aged + dripper latte extra cup white. And viennese redeye carajillo, beans, + mug viennese, carajillo id breve decaffeinated americano crema chicory + whipped arabica variety aged robusta. Affogato lungo eu, cultivar at, + aged breve and blue mountain roast breve americano aged. Sugar acerbic + sweet variety aged café au lait chicory, java, single shot percolator + aromatic brewed wings, a, sugar, body, aftertaste organic barista + espresso dripper to go. Flavour to go strong steamed mazagran trifecta + decaffeinated percolator crema, aged americano rich chicory + frappuccino foam white. +
    +
    +
    +
  • +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in aged + dripper latte extra cup white. And viennese redeye carajillo, beans, + mug viennese, carajillo id breve decaffeinated americano crema chicory + whipped arabica variety aged robusta. Affogato lungo eu, cultivar at, + aged breve and blue mountain roast breve americano aged. Sugar acerbic + sweet variety aged café au lait chicory, java, single shot percolator + aromatic brewed wings, a, sugar, body, aftertaste organic barista + espresso dripper to go. Flavour to go strong steamed mazagran trifecta + decaffeinated percolator crema, aged americano rich chicory + frappuccino foam white. +
    +
    +
    +
  • +
  • +
    +
    + +
    +
    + The icon can be any size as long as it is wrapped inside + timeline-increment. For larger icons, the spacing between the content + and label must be adjusted to accomodate it. The spacing can be adjusted + by modifying the $timeline-spacing sass variable, or manually overriding + in your css. +
    +
    +
``` @@ -215,68 +203,68 @@ The icon can be any size as long as it is wrapped inside `timeline-increment`. F Place text inside `timeline-increment` by wrapping the text with ``.
-
    -
  • -
    -
    - Jan 1 -
    -
    - The icon can be any size as long as it is wrapped inside - timeline-increment. For larger icons, the spacing between - the content and label must be adjusted to accomodate it. The - spacing can be adjusted by modifying the $timeline-spacing - sass variable, or manually overriding in your css. -
    -
    -
  • -
  • -
    -
    - Dec 12 -
    -
    - The icon can be any size as long as it is wrapped inside - timeline-increment. For larger icons, the spacing between - the content and label must be adjusted to accomodate it. The - spacing can be adjusted by modifying the $timeline-spacing - sass variable, or manually overriding in your css. -
    -
    -
  • -
+
    +
  • +
    +
    + Jan 1 +
    +
    + The icon can be any size as long as it is wrapped inside + timeline-increment. For larger icons, the spacing between the content + and label must be adjusted to accomodate it. The spacing can be + adjusted by modifying the $timeline-spacing sass variable, or manually + overriding in your css. +
    +
    +
  • +
  • +
    +
    + Dec 12 +
    +
    + The icon can be any size as long as it is wrapped inside + timeline-increment. For larger icons, the spacing between the content + and label must be adjusted to accomodate it. The spacing can be + adjusted by modifying the $timeline-spacing sass variable, or manually + overriding in your css. +
    +
    +
  • +
```html
    -
  • -
    -
    - Jan 1 -
    -
    - The icon can be any size as long as it is wrapped inside - timeline-increment. For larger icons, the spacing between the - content and label must be adjusted to accomodate it. The spacing - can be adjusted by modifying the $timeline-spacing sass - variable, or manually overriding in your css. -
    -
    -
  • -
  • -
    -
    - Dec 12 -
    -
    - The icon can be any size as long as it is wrapped inside - timeline-increment. For larger icons, the spacing between the - content and label must be adjusted to accomodate it. The spacing - can be adjusted by modifying the $timeline-spacing sass - variable, or manually overriding in your css. -
    -
    -
  • +
  • +
    +
    + Jan 1 +
    +
    + The icon can be any size as long as it is wrapped inside + timeline-increment. For larger icons, the spacing between the content + and label must be adjusted to accomodate it. The spacing can be adjusted + by modifying the $timeline-spacing sass variable, or manually overriding + in your css. +
    +
    +
  • +
  • +
    +
    + Dec 12 +
    +
    + The icon can be any size as long as it is wrapped inside + timeline-increment. For larger icons, the spacing between the content + and label must be adjusted to accomodate it. The spacing can be adjusted + by modifying the $timeline-spacing sass variable, or manually overriding + in your css. +
    +
    +
``` @@ -285,108 +273,108 @@ Place text inside `timeline-increment` by wrapping the text with ` -
    -
  • -
    -
    - Panel Text #1 -
    - - - -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    - - - -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    - - - -
    -
    -
    -
  • -
+
    +
  • +
    +
    + Panel Text #1 +
    + + + +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    + + + +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    + + + +
    +
    +
    +
  • +
```html
    -
  • -
    -
    - Panel Text #1 -
    - - - -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    - - - -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    - - - -
    -
    -
    -
  • +
  • +
    +
    + Panel Text #1 +
    + + + +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    + + + +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    + + + +
    +
    +
    +
``` @@ -395,150 +383,144 @@ Align increments to the right with `timeline-right`. Add class `timeline-center` to center your timeline, it displays items on the right by default. To display items on the left, add class `timeline-item-reverse` to a timeline item.
-
    -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id - breve decaffeinated americano crema chicory whipped - arabica variety aged robusta. Affogato lungo eu, - cultivar at, aged breve and blue mountain roast breve - americano aged. Sugar acerbic sweet variety aged café au - lait chicory, java, single shot percolator aromatic - brewed wings, a, sugar, body, aftertaste organic barista - espresso dripper to go. Flavour to go strong steamed - mazagran trifecta decaffeinated percolator crema, aged - americano rich chicory frappuccino foam white. -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
+
    +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in + aged dripper latte extra cup white. And viennese redeye carajillo, + beans, mug viennese, carajillo id breve decaffeinated americano + crema chicory whipped arabica variety aged robusta. Affogato lungo + eu, cultivar at, aged breve and blue mountain roast breve americano + aged. Sugar acerbic sweet variety aged café au lait chicory, java, + single shot percolator aromatic brewed wings, a, sugar, body, + aftertaste organic barista espresso dripper to go. Flavour to go + strong steamed mazagran trifecta decaffeinated percolator crema, + aged americano rich chicory frappuccino foam white. +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
```html
    -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id breve - decaffeinated americano crema chicory whipped arabica - variety aged robusta. Affogato lungo eu, cultivar at, aged - breve and blue mountain roast breve americano aged. Sugar - acerbic sweet variety aged café au lait chicory, java, - single shot percolator aromatic brewed wings, a, sugar, - body, aftertaste organic barista espresso dripper to go. - Flavour to go strong steamed mazagran trifecta decaffeinated - percolator crema, aged americano rich chicory frappuccino - foam white. -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in aged + dripper latte extra cup white. And viennese redeye carajillo, beans, + mug viennese, carajillo id breve decaffeinated americano crema chicory + whipped arabica variety aged robusta. Affogato lungo eu, cultivar at, + aged breve and blue mountain roast breve americano aged. Sugar acerbic + sweet variety aged café au lait chicory, java, single shot percolator + aromatic brewed wings, a, sugar, body, aftertaste organic barista + espresso dripper to go. Flavour to go strong steamed mazagran trifecta + decaffeinated percolator crema, aged americano rich chicory + frappuccino foam white. +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
``` @@ -547,90 +529,90 @@ Add class `timeline-center` to center your timeline, it displays items on the ri Alternate every other timeline item on the left with class `timeline-even`.
-
    -
  • -
    -
    - Panel Text #1 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
+
    +
  • +
    +
    + Panel Text #1 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
```html
    -
  • -
    -
    - Panel Text #1 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • +
  • +
    +
    + Panel Text #1 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
``` @@ -639,90 +621,90 @@ Alternate every other timeline item on the left with class `timeline-even`. Alternate every other timeline item on the right with class `timeline-odd`.
-
    -
  • -
    -
    - Panel Text #1 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
+
    +
  • +
    +
    + Panel Text #1 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
```html
    -
  • -
    -
    - Panel Text #1 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • +
  • +
    +
    + Panel Text #1 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
``` @@ -731,90 +713,90 @@ Alternate every other timeline item on the right with class `timeline-odd`. Align timeline to the right at screen widths 767px and below with `timeline-right-xs-only`.
-
    -
  • -
    -
    - Panel Text #1 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    2 hours ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    3 hours ago
    -
    -
    -
  • -
+
    +
  • +
    +
    + Panel Text #1 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    2 hours ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    3 hours ago
    +
    +
    +
  • +
```html
    -
  • -
    -
    - Panel Text #1 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    2 hours ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    3 hours ago
    -
    -
    -
  • +
  • +
    +
    + Panel Text #1 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    2 hours ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    3 hours ago
    +
    +
    +
``` @@ -828,160 +810,148 @@ Adjust the spacing around the timeline with `@include timeline-spacing($outer-sp ```scss .timeline-spacing-xl { - @include timeline-spacing(25px, 50px); + @include timeline-spacing(25px, 50px); } ```
-
    -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id - breve decaffeinated americano crema chicory whipped - arabica variety aged robusta. Affogato lungo eu, - cultivar at, aged breve and blue mountain roast breve - americano aged. Sugar acerbic sweet variety aged café au - lait chicory, java, single shot percolator aromatic - brewed wings, a, sugar, body, aftertaste organic barista - espresso dripper to go. Flavour to go strong steamed - mazagran trifecta decaffeinated percolator crema, aged - americano rich chicory frappuccino foam white. -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
+
    +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in + aged dripper latte extra cup white. And viennese redeye carajillo, + beans, mug viennese, carajillo id breve decaffeinated americano + crema chicory whipped arabica variety aged robusta. Affogato lungo + eu, cultivar at, aged breve and blue mountain roast breve americano + aged. Sugar acerbic sweet variety aged café au lait chicory, java, + single shot percolator aromatic brewed wings, a, sugar, body, + aftertaste organic barista espresso dripper to go. Flavour to go + strong steamed mazagran trifecta decaffeinated percolator crema, + aged americano rich chicory frappuccino foam white. +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
```html
    -
  • -
    - -
    -
    - In organic dripper so, body, robust medium pumpkin spice - cup, in aged dripper latte extra cup white. And viennese - redeye carajillo, beans, mug viennese, carajillo id breve - decaffeinated americano crema chicory whipped arabica - variety aged robusta. Affogato lungo eu, cultivar at, aged - breve and blue mountain roast breve americano aged. Sugar - acerbic sweet variety aged café au lait chicory, java, - single shot percolator aromatic brewed wings, a, sugar, - body, aftertaste organic barista espresso dripper to go. - Flavour to go strong steamed mazagran trifecta decaffeinated - percolator crema, aged americano rich chicory frappuccino - foam white. -
    -
    -
    -
  • -
  • -
    -
    - Panel Text #2 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • -
  • -
    -
    - Panel Text #3 -
    -
    - LR -
    -
    -
    1 hour ago
    -
    -
    -
  • +
  • +
    + +
    +
    + In organic dripper so, body, robust medium pumpkin spice cup, in aged + dripper latte extra cup white. And viennese redeye carajillo, beans, + mug viennese, carajillo id breve decaffeinated americano crema chicory + whipped arabica variety aged robusta. Affogato lungo eu, cultivar at, + aged breve and blue mountain roast breve americano aged. Sugar acerbic + sweet variety aged café au lait chicory, java, single shot percolator + aromatic brewed wings, a, sugar, body, aftertaste organic barista + espresso dripper to go. Flavour to go strong steamed mazagran trifecta + decaffeinated percolator crema, aged americano rich chicory + frappuccino foam white. +
    +
    +
    +
  • +
  • +
    +
    + Panel Text #2 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
  • +
  • +
    +
    + Panel Text #3 +
    +
    + LR +
    +
    +
    1 hour ago
    +
    +
    +
``` diff --git a/packages/clay-core/docs/tree-view.mdx b/packages/clay-core/docs/tree-view.mdx index e281fc62ea..54fa18539a 100644 --- a/packages/clay-core/docs/tree-view.mdx +++ b/packages/clay-core/docs/tree-view.mdx @@ -7,11 +7,11 @@ packageUse: "import {TreeView} from '@clayui/core';" lexiconDefinition: 'https://liferay.design/lexicon/core-components/tree-view/' storybookPath: 'design-system-components-treeview' packageTypes: - [ - 'clay-core/src/tree-view/TreeView.tsx', - 'clay-core/src/tree-view/TreeViewItem.tsx', - 'clay-core/src/tree-view/TreeViewGroup.tsx', - ] + [ + 'clay-core/src/tree-view/TreeView.tsx', + 'clay-core/src/tree-view/TreeViewItem.tsx', + 'clay-core/src/tree-view/TreeViewGroup.tsx', + ] --- ## Example @@ -21,126 +21,122 @@ import React from 'react'; import {Provider, TreeView} from '@clayui/core'; import Icon from '@clayui/icon'; -import '@clayui/css/lib/css/atlas.css'; - -const spritemap = '/public/icons.svg'; - -export default function FileExplorer() { - const items = [ - { - children: [ - { - children: [ - { - children: [{name: 'Research 1'}], - name: 'Research', - }, - { - children: [{name: 'News 1'}], - name: 'News', - }, - ], - name: 'Blogs', - }, - { - children: [ - { - children: [ - { - name: 'Instructions.pdf', - status: 'success', - type: 'pdf', - }, - ], - name: 'PDF', - }, - { - children: [ - { - name: 'Treeview review.docx', - status: 'success', - type: 'document', - }, - { - name: 'Heuristics Evaluation.docx', - status: 'success', - type: 'document', - }, - ], - name: 'Word', - }, - ], - name: 'Documents and Media', - }, - ], - name: 'Liferay Drive', - type: 'cloud', - }, - { - children: [{name: 'Blogs'}, {name: 'Documents and Media'}], - name: 'Repositories', - type: 'repository', - }, - { - children: [{name: 'PDF'}, {name: 'Word'}], - name: 'Documents and Media', - status: 'warning', - }, - ]; - - const TYPES_TO_SYMBOLS = { - document: 'document-text', - pdf: 'document-pdf', - success: 'check-circle-full', - warning: 'warning-full', - }; - - const TYPES_TO_COLORS = { - document: 'text-primary', - pdf: 'text-danger', - success: 'text-success', - warning: 'text-warning', - }; - - return ( - - - {(item) => ( - - - - {item.name} - {item.status && ( - - )} - - - {({name, status, type}) => ( - - {type && ( - - )} - {name} - {status && ( - - )} - - )} - - - )} - - - ); +export default function App() { + const items = [ + { + children: [ + { + children: [ + { + children: [{name: 'Research 1'}], + name: 'Research', + }, + { + children: [{name: 'News 1'}], + name: 'News', + }, + ], + name: 'Blogs', + }, + { + children: [ + { + children: [ + { + name: 'Instructions.pdf', + status: 'success', + type: 'pdf', + }, + ], + name: 'PDF', + }, + { + children: [ + { + name: 'Treeview review.docx', + status: 'success', + type: 'document', + }, + { + name: 'Heuristics Evaluation.docx', + status: 'success', + type: 'document', + }, + ], + name: 'Word', + }, + ], + name: 'Documents and Media', + }, + ], + name: 'Liferay Drive', + type: 'cloud', + }, + { + children: [{name: 'Blogs'}, {name: 'Documents and Media'}], + name: 'Repositories', + type: 'repository', + }, + { + children: [{name: 'PDF'}, {name: 'Word'}], + name: 'Documents and Media', + status: 'warning', + }, + ]; + + const TYPES_TO_SYMBOLS = { + document: 'document-text', + pdf: 'document-pdf', + success: 'check-circle-full', + warning: 'warning-full', + }; + + const TYPES_TO_COLORS = { + document: 'text-primary', + pdf: 'text-danger', + success: 'text-success', + warning: 'text-warning', + }; + + return ( + + + {(item) => ( + + + + {item.name} + {item.status && ( + + )} + + + {({name, status, type}) => ( + + {type && ( + + )} + {name} + {status && ( + + )} + + )} + + + )} + + + ); } ``` @@ -172,42 +168,38 @@ The main components of the TreeView are ``, ` ```jsx - - - - NS - - nisi quis eleifend - - - - - - FP - - fusce ut placerat - - - - - UT - - ultrices dui sapien - - - - - - MC - - maecenas pharetra convallis - - - + + + + NS + + nisi quis eleifend + + + + + + FP + + fusce ut placerat + + + + + UT + + ultrices dui sapien + + + + + + MC + + maecenas pharetra convallis + + + ``` @@ -219,38 +211,36 @@ For the component to be dynamic it is necessary to convert `children` to render ```jsx function Example() { - const items = [ - { - children: [ - { - children: [{name: 'ultrices dui sapien'}], - name: 'fusce ut placerat', - }, - {name: 'maecenas pharetra convallis'}, - ], - name: 'nisi quis eleifend', - }, - ]; - - return ( - - {(item) => ( - - {item.name} - - {item.children && ( - - {(item) => ( - - {item.name} - - )} - - )} - - )} - - ); + const items = [ + { + children: [ + { + children: [{name: 'ultrices dui sapien'}], + name: 'fusce ut placerat', + }, + {name: 'maecenas pharetra convallis'}, + ], + name: 'nisi quis eleifend', + }, + ]; + + return ( + + {(item) => ( + + {item.name} + + {item.children && ( + + {(item) => ( + {item.name} + )} + + )} + + )} + + ); } ``` @@ -258,32 +248,32 @@ function Example() { When a tree is very large, loading items (nodes) asynchronously is preferred to decrease the initial payload and memory space. TreeView provides two ways to load asynchronous data: -- Load the children of an item when clicking on the item -- Load paginated data from an item +- Load the children of an item when clicking on the item +- Load paginated data from an item **Load the children of an item** The TreeView doesn't know when an item is asynchronous, so the developer must specify whether the item is asynchronous or not. The `onLoadMore` property is called every time the item is a leaf node of the tree and depending on the method's return value it will behave differently. -- When returning `void`, `null` or `undefined` the TreeView will do nothing. -- When returning the `item` will add to the tree. +- When returning `void`, `null` or `undefined` the TreeView will do nothing. +- When returning the `item` will add to the tree. When adding a new asynchronous item to the tree, the `onItemsChange` method is respectively called to update the tree with a new value if the `items` prop is controlled.
- Warning - If you have an error in the asynchronous call of the - onLoadMore - method, only the suppression is done and an error is thrown on the console. + Warning + If you have an error in the asynchronous call of the + onLoadMore + method, only the suppression is done and an error is thrown on the console.
```jsx { - return await fetch(`example.com/tree/item?parent_id=${item.id}`); - }} + onLoadMore={async (item) => { + return await fetch(`example.com/tree/item?parent_id=${item.id}`); + }} > - ... + ... ``` @@ -293,18 +283,18 @@ The `onLoadMore` API can also be used to load paginated data for a specific item ```jsx { - const result = await fetch( - cursor ?? `example.com/tree/item?parent_id=${item.id}` - ); - - return { - cursor: result.next, - items: result.data, - }; - }} + onLoadMore={async (item, cursor) => { + const result = await fetch( + cursor ?? `example.com/tree/item?parent_id=${item.id}` + ); + + return { + cursor: result.next, + items: result.data, + }; + }} > - ... + ... ``` @@ -312,24 +302,24 @@ The `cursor` helps to store the data that will be used to identify which will be ```jsx - {(item, selection, expand, load) => ( - - {item.name} - - {(item) => {item.name}} - - - {expand.has(item.id) && load.has(item.id) !== null && ( - - )} - - )} + {(item, selection, expand, load) => ( + + {item.name} + + {(item) => {item.name}} + + + {expand.has(item.id) && load.has(item.id) !== null && ( + + )} + + )} ``` @@ -347,7 +337,7 @@ In static content, it is also possible to define the `key` to be used in the sel ```jsx { - (item) => {item.name}; + (item) => {item.name}; } Drive; @@ -363,9 +353,9 @@ In static content, it is also possible to define the `key` to be used in the sel ```jsx - - - Drive + + + Drive ``` @@ -375,18 +365,18 @@ Creating a nested item is necessary to declare it inside the `` t ```jsx - - - - Drive - - - - - - Documents - - + + + + Drive + + + + + + Documents + + ``` @@ -396,26 +386,26 @@ Actions are added using the `actions` property on each item. The component abstr ```jsx - - - - - - } - /> - - } - > - - Folder - + + + + + + } + /> + + } + > + + Folder + ``` @@ -425,18 +415,18 @@ An item can be disabled by setting the `disabled` prop in the ` - - - - Drive - - - - - - Documents - - + + + + Drive + + + + + + Documents + + ``` @@ -448,16 +438,13 @@ The TreeView exposes the `expandedKeys` property and the `onExpandedChange` call ```jsx function Example() { - const [expandedKeys, setExpandedKeys] = useState(new Set(['1', '2', '3'])); - - return ( - - ... - - ); + const [expandedKeys, setExpandedKeys] = useState(new Set(['1', '2', '3'])); + + return ( + + ... + + ); } ``` @@ -467,12 +454,12 @@ Customizing the expander is possible using the `expanderIcons` property. Changin ```jsx , - open: , - }} + expanderIcons={{ + close: , + open: , + }} > - ... + ... ``` @@ -482,18 +469,18 @@ The `Expander` is automatically disabled when the item is disabled but you can o ```jsx - - - - Drive - - - - - - Documents - - + + + + Drive + + + + + + Documents + + ``` @@ -507,33 +494,33 @@ The `expand` method is available via render props only when the content is dynam ```jsx - {(item, selection, expand) => ( - { - clearTimeout(clickTimerRef.current); - - // Ignores the component's default behavior, clicking the - // item expands the item if it has any child items. - event.preventDefault(); - - switch (event.detail) { - case 1: - clickTimerRef.current = setTimeout(() => { - if (!selection.has(item.id)) { - selection.toggle(item.id); - } - }, 200); - break; - case 2: - expand.toggle(item.id); - default: - break; - } - }} - > - Item - - )} + {(item, selection, expand) => ( + { + clearTimeout(clickTimerRef.current); + + // Ignores the component's default behavior, clicking the + // item expands the item if it has any child items. + event.preventDefault(); + + switch (event.detail) { + case 1: + clickTimerRef.current = setTimeout(() => { + if (!selection.has(item.id)) { + selection.toggle(item.id); + } + }, 200); + break; + case 2: + expand.toggle(item.id); + default: + break; + } + }} + > + Item + + )} ``` @@ -541,9 +528,9 @@ The `expand` method is available via render props only when the content is dynam The selection allows the user to select one or more items in the TreeView, there are three main interactions that can be configured and are defined using the `selectionMode` prop. -- `single` select only one item. -- `multiple` select multiple items. -- `multiple-recursive` selects multiple items and the item's children recursively. When all children are selected, the parent will be marked as selected, otherwise it will be marked as intermediate. +- `single` select only one item. +- `multiple` select multiple items. +- `multiple-recursive` selects multiple items and the item's children recursively. When all children are selected, the parent will be marked as selected, otherwise it will be marked as intermediate. The selection can be configured and composed in different ways depending on each use case. Setting the selectionMode and using a `` in the item will respect the configuration of the selection. It is also possible to configure the selection manually to customize what will trigger the selection or modify the look of the selected state. For more information check the [manual selection](#manual-selection) section. @@ -553,25 +540,25 @@ Selection can be controlled and uncontrolled, this means you can keep the state const [selectedKeys, setSelectionChange] = useState(new Set()); return ( - setSelectionChange(keys)} - selectedKeys={selectedKeys} - > - ... - + setSelectionChange(keys)} + selectedKeys={selectedKeys} + > + ... + ); ``` Rendering the TreeView with pre-selected items will cause their parent items to be expanded so that the selected item is visible on the first render. In recursive multiple selection, the parents items will marked as intermediate.
- Info - Expanding selected items in the first render implies performance degradation - if the TreeView has too many items; but there are some possibilities to work - around depending on the use case, read the - Selection hydration - section for more information to mitigate this when viewing a noticeable - slowdown on the first render. + Info + Expanding selected items in the first render implies performance degradation if + the TreeView has too many items; but there are some possibilities to work around + depending on the use case, read the + Selection hydration + section for more information to mitigate this when viewing a noticeable slowdown + on the first render.
### Single Selection @@ -584,18 +571,18 @@ The multi-selection in TreeView is a achieved by composing with the ` - - Drive + + Drive
``` ```jsx - - - Drive - - ... + + + Drive + + ... ``` @@ -605,19 +592,17 @@ Multi-selection is also controlled in the same way as for the expander. It uses ```jsx function Example() { - const [selectedKeys, setSelectionChange] = useState( - new Set(['1', '2', '3']) - ); - - return ( - - ... - - ); + const [selectedKeys, setSelectionChange] = useState(new Set(['1', '2', '3'])); + + return ( + + ... + + ); } ``` @@ -628,8 +613,8 @@ By default, when selecting an item with nested items, its children are recursive There are some limitations: for static content the recursive selection only works if the item is expanded, (i.e visible). For dynamic content, it works independently.
- Warning - Recursive selection will not select items from an asynchronous Item. + Warning + Recursive selection will not select items from an asynchronous Item.
### Manual Selection @@ -640,14 +625,14 @@ The `selection` method is available via render props when the content is dynamic ```js - {(item, selection) => ( - selection.toggle(item.id)} - > - Drive - - )} + {(item, selection) => ( + selection.toggle(item.id)} + > + Drive + + )} ``` @@ -655,19 +640,19 @@ The default behavior of clicking the item is to expand and load the item asynchr ```js - {(item) => ( - { - event.preventDefault(); - - // You can do anything after that, for example in a Modal, - // close and select. - onClose(item); - }} - > - Drive - - )} + {(item) => ( + { + event.preventDefault(); + + // You can do anything after that, for example in a Modal, + // close and select. + onClose(item); + }} + > + Drive + + )} ``` @@ -679,13 +664,13 @@ The TreeView handles `items` immutably but follows a partial tree immutability i ```jsx function Example() { - const [items, setItems] = useState([]); + const [items, setItems] = useState([]); - return ( - - ... - - ); + return ( + + ... + + ); } ``` @@ -693,18 +678,14 @@ The component allows you to add rules in Drag and Drop like disabling an item to ```jsx - {(item) => ( - - - {item.name} - - - {(item) => ( - {item.name} - )} - - - )} + {(item) => ( + + {item.name} + + {(item) => {item.name}} + + + )} ``` @@ -712,15 +693,15 @@ In some cases it is necessary to check if the item can be dropped in another ite ```jsx { - // your logic here + dragAndDrop + onItemMove={(item, parentItem) => { + // your logic here - // Returning false does not allow the item to be dropped in the parentItem. - return false; - }} + // Returning false does not allow the item to be dropped in the parentItem. + return false; + }} > - ... + ... ``` @@ -729,10 +710,10 @@ In some cases it is necessary to check if the item can be dropped in another ite The TreeView implements shortcuts and manages the focus. Some shortcuts and focus trigger some actions like renaming, removing or asynchronous loading if any.
- Warning - If an Item is asynchronous the - onLoadMore - method will be called as described in the Asynchronous Item section. + Warning + If an Item is asynchronous the + onLoadMore + method will be called as described in the Asynchronous Item section.
### Rename Item @@ -743,12 +724,12 @@ The `onRenameItem` property receives the `item` object corresponding to the curr ```jsx { - return await openRenameModal(item); - }} + dragAndDrop + onRenameItem={async (item) => { + return await openRenameModal(item); + }} > - ... + ... ``` @@ -770,13 +751,13 @@ This implies some performance problems because the component only knows about th This can lead to a performance problem on the first render if you have too many items or too many selected items. It's possible to mitigate this on the first render by setting the `selectionHydrationMode` prop: it supports two rendering phases, `render-first` and `hydrate-first`, both have trade-offs that depend on the number of items being rendered: -- `render-first` will render first and then hydrate. It doesn't block the initial rendering but it is possible to see the items being expanded. -- `hydrate-first` will hydrate first and then render. This blocks rendering first until it traverses the tree, when rendered the items are already expanded. +- `render-first` will render first and then hydrate. It doesn't block the initial rendering but it is possible to see the items being expanded. +- `hydrate-first` will hydrate first and then render. This blocks rendering first until it traverses the tree, when rendered the items are already expanded.
- Info - The tree traversal implementation internally has some performance optimizations. - Depending on the number of selected items, the TreeView stops traversing the - tree when it finds all the selected items. In most scenarios, the TreeView will - almost never traverse the entire tree. + Info + The tree traversal implementation internally has some performance optimizations. + Depending on the number of selected items, the TreeView stops traversing the tree + when it finds all the selected items. In most scenarios, the TreeView will almost + never traverse the entire tree.
diff --git a/packages/clay-core/docs/tree-view/markup.mdx b/packages/clay-core/docs/tree-view/markup.mdx index 36b3829300..534306f512 100644 --- a/packages/clay-core/docs/tree-view/markup.mdx +++ b/packages/clay-core/docs/tree-view/markup.mdx @@ -13,19 +13,562 @@ storybookPath: 'design-system-components-treeview' The treeview provides a way to display information in a hierarchical structure by using collapsible items (nodes). You can navigate between these items using either your mouse device or keyboard. The most common example of a treeview is a folder structure for file systems, but it can be used for showing any hierarchical relationships.
- See - [https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html](https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html) - for accessibility patterns. + See + [https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html](https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html) + for accessibility patterns.
- Treeview Link indentation must be provided by javascript through inline - styles, use the styles `padding-left: 24px;` on `.treeview-link` and - `margin-left: -24px` on `.treeview-link > .c-inner`. Increase the - indentation for each level by increasing or decreasing `padding-left` or - `margin-left` by 24px. + Treeview Link indentation must be provided by javascript through inline + styles, use the styles `padding-left: 24px;` on `.treeview-link` and + `margin-left: -24px` on `.treeview-link > .c-inner`. Increase the indentation + for each level by increasing or decreasing `padding-left` or `margin-left` by + 24px.
+
    +
  • +
    + + + + + + + + + + + + + + + + Liferay Drive + + + + + +
    +
    +
      +
    • + +
      +
        +
      • +
        + + + + + + Details + + + + + +
        +
      • +
      • +
        + + + + + + + Categorization + + + + + + +
        +
      • +
      • +
        + + + + + + + Documents and Media + + + + + + +
        +
      • +
      • +
        + + + + + + Site Template + + + + + +
        +
      • +
      +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      + + + + + + Sitemap + + + + + +
      +
    • +
    • +
      + + + + + + Robots + + + + + +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      + + + + + + + Default User Associations + + + + + + +
      +
    • +
    • +
      + + + + + + Staging + + + + + +
      +
    • +
    • +
      + + + + + + Analytics + + + + + +
      +
    • +
    • +
      + + + + + + Maps + + + + + +
      +
    • +
    +
    +
  • +
+ +```html
  • - + - + @@ -74,7 +621,9 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + @@ -83,11 +632,10 @@ The treeview provides a way to display information in a hierarchical structure b Liferay Drive - - Liferay Drive - - @@ -128,14 +676,18 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + - + @@ -147,21 +699,24 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + - + Liferay Drive + (ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual) - - Liferay Drive - (ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual) - - @@ -182,17 +737,19 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-48px'}} > - - - + - - Details - - - + >Details @@ -211,17 +768,19 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-48px'}} > - - - + - - Categorization - - - + >Categorization @@ -240,17 +799,20 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-48px'}} > - - - + - - Documents and Media - - - + >Documents and + Media @@ -269,17 +831,19 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-48px'}} > - - - + - - Site Template - - - + >Site Template @@ -319,14 +883,18 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + - + @@ -338,7 +906,9 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + @@ -347,11 +917,10 @@ The treeview provides a way to display information in a hierarchical structure b Repositories - - Repositories - - @@ -372,17 +941,18 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-24px'}} > - - - + - - Sitemap - - - + >Sitemap @@ -401,17 +971,18 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-24px'}} > - - - + - - Robots - - - + >Robots @@ -448,14 +1019,18 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + - + @@ -467,7 +1042,9 @@ The treeview provides a way to display information in a hierarchical structure b focusable="false" role="presentation" > - + @@ -476,11 +1053,10 @@ The treeview provides a way to display information in a hierarchical structure b Documents and Media - - Documents and Media - - @@ -501,17 +1077,18 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-24px'}} > - - - + - - Default User Associations - - - + >Default User Associations @@ -530,17 +1107,18 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-24px'}} > - - - + - - Staging - - - + >Staging @@ -559,17 +1137,18 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-24px'}} > - - - + - - Analytics - - - + >Analytics @@ -588,17 +1167,18 @@ The treeview provides a way to display information in a hierarchical structure b style={{marginLeft: '-24px'}} > - - - + - - Maps - - - + >Maps @@ -608,39 +1188,908 @@ The treeview provides a way to display information in a hierarchical structure b
+``` + +### Treeview Group + +The class `treeview-group` must be applied to all nested `ul` elements inside `treeview`. This class helps provide the proper spacing for nested `treeview-link`s. ```html
  • - - - -
  • +
+``` + +### Treeview Item + +The class `treeview-item` must be applied to all `li` elements. This class helps provide the proper spacing for nested `treeview-link`s. + +```html +
    +
  • + +
  • +
+``` + +### Treeview Link + +This is the container for all nodes inside `treeview`. If there are auxiliary controls inside the `treeview-link` (e.g., `a` or `button`) it is recommended to use a `div` element with the `tabIndex` attribute. + +```html +
    +
  • + +
  • +
+``` + +### Treeview Link Disabled + +The modifier class `disabled` adds disabled styles to `treeview-link`. The class does not add disabled styles to form elements, links, or buttons inside. Those must be disabled individually. + +
+
+ +
+
+
+
    +
  • +
    + + + + + + + + + + + + + + + + + + + + + Liferay Drive + + + + + + + + + + + +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
  • +
+
+
+
+ +```html +
    +
  • +
    + ... +
    +
  • +
+ +
+
    +
  • +
    + ... +
    +
  • +
+
+``` + +### Component Expander + +The expander is used to expand or collapse the nodes and serves as an indicator for those states. The class `component-expander` marks the button as the toggle. The class `component-expanded-d-none` on `lexicon-icon` hides the icon when tree node is expanded. + +
    +
  • + +
    +
      +
    • +
      + + Tree Item + +
      +
    • +
    +
    +
  • +
+ +```html + +``` + +### Component Action + +The action button(s) are monospaced buttons used to supply additional features to a tree node, such as removal or a dropdown. + +
    +
  • +
    + + + + + + + + + + + + + + + + Liferay Drive + + + + + + + + + + + +
    +
    +
      +
    • +
      + + Tree Item + +
      +
    • +
    +
    +
  • +
+ +```html + +``` + +### Treeview Dragging + +The modifier class `treeview-dragging` displays an indicator showing the item being dragged. + +
Liferay Drive
+ +### Treeview Dropping Bottom + +The modifier class `treeview-dropping-bottom` adds a visual indicator to the bottom of `treeview-link` to show where a dragged `treeview-link` will be inserted. + +
    +
  • +
    + + + + + + + + + + + + + + + + Liferay Drive + + + + + + + + + + + +
    +
    +
      +
    • +
      + + Tree Item + +
      +
    • +
    +
    +
  • +
+ +```html +
    +
  • +
    + + + + + + + +
    -
    +
    • -
      -
        -
      • -
        - - - - Details - - - -
        -
      • -
      • -
        - - - - Categorization - - - -
        -
      • -
      • -
        - - - - Documents and - Media - - - -
        -
      • -
      • -
        - - - - Site Template - - - -
        -
      • -
  • +
+``` + +### Treeview Dropping Top + +The modifier class `treeview-dropping-top` adds a visual indicator to the bottom of `treeview-link` to show where a dragged `treeview-link` will be inserted. + +
    +
  • +
    + + + + + + + + + + + + + + + + Liferay Drive + + + + + + + + + + + +
    +
    +
      +
    • +
      + + Tree Item + +
      +
    • +
    +
    +
  • +
+ +```html +
  • -
    +
    • Tree Item - - - Sitemap - - - -
      -
    • -
    • -
      - - - - Robots - - -
  • +
+``` + +### Treeview Dropping Middle + +The modifier class `treeview-dropping-middle` adds a visual indicator around the `treeview-link` to show where a dragged `treeview-link` will be nested. + +
    +
  • +
    + + + + + + + + + + + + + + + + Liferay Drive + + + + + + + + + + + +
    +
    +
      +
    • +
      + + Tree Item + +
      +
    • +
    +
    +
  • +
+ +```html +
  • -
    -
      -
    • -
      - - - - Default User Associations - - - -
      -
    • -
    • -
      - +
      -
    • -
    • -
      - + + +
      -
    • + + + + +
    +
    +
    • Tree Item - - - Maps - - -
    @@ -1231,29 +2724,680 @@ The treeview provides a way to display information in a hierarchical structure b
``` -### Treeview Group +## Variations -The class `treeview-group` must be applied to all nested `ul` elements inside `treeview`. This class helps provide the proper spacing for nested `treeview-link`s. +### Show Component Expander on Hover + +The class `show-component-expander-on-hover` displays the `component-expander` when the mouse hovers over the `treeview` component. + +
    +
  • +
    + + + + + + + + + + + + + + + + Liferay Drive + + + + + +
    +
    +
      +
    • + +
      +
        +
      • +
        + + + + + + + Details + + + + + + +
        +
      • +
      • +
        + + + + + + + Categorization + + + + + + +
        +
      • +
      • +
        + + + + + + + Documents and Media + + + + + + +
        +
      • +
      • +
        + + + + + + Site Template + + + + + +
        +
      • +
      +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      + + + + + + Sitemap + + + + + +
      +
    • +
    • +
      + + + + + + Robots + + + + + +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      + + + + + + + Default User Associations + + + + + + +
      +
    • +
    • +
      + + + + + + Staging + + + + + +
      +
    • +
    • +
      + + + + + + Analytics + + + + + +
      +
    • +
    • +
      + + + + + + Maps + + + + + +
      +
    • +
    +
    +
  • +
```html -
    +
    • -
      +
      • -
      • -
      -
      -
    • -
    -``` - -### Treeview Item - -The class `treeview-item` must be applied to all `li` elements. This class helps provide the proper spacing for nested `treeview-link`s. - -```html -
      -
    • - -
    • -
    -``` - -### Treeview Link - -This is the container for all nodes inside `treeview`. If there are auxiliary controls inside the `treeview-link` (e.g., `a` or `button`) it is recommended to use a `div` element with the `tabIndex` attribute. - -```html -
      -
    • - -
    • -
    -``` - -### Treeview Link Disabled - -The modifier class `disabled` adds disabled styles to `treeview-link`. The class does not add disabled styles to form elements, links, or buttons inside. Those must be disabled individually. - -
    -
    - -
    -
    -
    -
      -
    • -
      - - - - - - - + - + Liferay Drive + (ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual) - - Liferay Drive - - - - - - - -
      • - +
    • - +
  • - +
  • -
-
- - - - - - -```html -
    -
  • -
    - ... +
  • +
    + + + + Site Template + + + +
    +
  • +
+ + + - - -
-
    -
  • -
    - ... -
    -
  • -
-
-``` - -### Component Expander - -The expander is used to expand or collapse the nodes and serves as an indicator for those states. The class `component-expander` marks the button as the toggle. The class `component-expanded-d-none` on `lexicon-icon` hides the icon when tree node is expanded. - -
  • -
    +
    • - Tree Item + + + Sitemap + + + +
      +
    • +
    • +
      + + + + Robots + +
  • -
- -```html - -``` - -### Component Action - -The action button(s) are monospaced buttons used to supply additional features to a tree node, such as removal or a dropdown. - -
  • @@ -1902,7 +3801,9 @@ The action button(s) are monospaced buttons used to supply additional features t focusable="false" role="presentation" > - + @@ -1910,52 +3811,18 @@ The action button(s) are monospaced buttons used to supply additional features t Documents and Media - - Liferay Drive - - - - - - - -
    -
    +
    • - Tree Item + + + Default User Associations + +
    • -
    -
    -
  • -
- -```html - -``` - -### Treeview Dragging - -The modifier class `treeview-dragging` displays an indicator showing the item being dragged. - -
Liferay Drive
- -### Treeview Dropping Bottom - -The modifier class `treeview-dropping-bottom` adds a visual indicator to the bottom of `treeview-link` to show where a dragged `treeview-link` will be inserted. - -
    -
  • -
    - - - - - - - - - - - - - - - - - Liferay Drive + Staging - - - - - -
  • +
  • +
    + - - + - - + Analytics + - - - - -
    -
    -
      + +
    +
  • - Tree Item + + + Maps + +
  • @@ -2132,30 +3952,833 @@ The modifier class `treeview-dropping-bottom` adds a visual indicator to the bot
+``` + +### Show Quick Actions on Hover + +The class `show-quick-actions-on-hover` on `treeview` will hide all `quick-action-item`'s except when `treeview-link` is hovered or focused. + +
    +
  • +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    + + + + + Liferay Drive + + + + + + + +
    +
    +
    +
    +
    +
      +
    • + +
      +
        +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Details + + + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Categorization + + + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Documents and Media + + + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Site Template + + +
        +
        +
        +
        +
      • +
      +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Sitemap + + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Robots + + +
      +
      +
      +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + + Default User Associations + + + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Staging + + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Analytics + + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Maps + + +
      +
      +
      +
      +
    • +
    +
    +
  • +
```html
  • - - - +
    +
    +
    - - - +
    +
    +
    + +
    +
    +
    +
    - - - +
    +
    +
    - Liferay Drive - - - - + - - - - - - - + +
    +
    +
    -
    +
    -
  • -
- - - -``` - -### Treeview Dropping Top - -The modifier class `treeview-dropping-top` adds a visual indicator to the bottom of `treeview-link` to show where a dragged `treeview-link` will be inserted. - -
    -
  • -
    - - - - - - - - - - - - - - - - - Liferay Drive - - - - - - - - - - - - -
    -
    -
      -
    • - - Tree Item - -
      -
    • -
    +
      +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + Details +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + Categorization +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + Documents and + Media +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + Site Template +
      +
      +
      +
      +
    • +
    +
    +
  • +
- - -```html -
  • - - - +
    +
    +
    - - - +
    +
    +
    + +
    +
    +
    +
    - - - +
    +
    +
    - Liferay Drive - - - - - - - + - - - - + +
    +
    +
    -
    +
    • - +
      +
      +
      + +
      +
      +
      + Sitemap +
      +
      +
      +
    +
  • +
  • +
    +
    Tree Item +
    +
    +
    + +
    +
    +
    + Robots +
    +
    +
- -``` - -### Treeview Dropping Middle - -The modifier class `treeview-dropping-middle` adds a visual indicator around the `treeview-link` to show where a dragged `treeview-link` will be nested. - -
  • - - - +
    +
    +
    - - - +
    +
    +
    + +
    +
    +
    +
    - + - - - +
    +
    +
    - - - Liferay Drive + + + Documents and Media + + + - - - - - - - - - +
    +
    +
    -
    +
    • - - Tree Item - +
      +
      +
      + +
      +
      +
      + Default User Associations +
      +
      +
      +
    +
  • +
  • +
    +
    +
    +
    +
    + +
    +
    +
    + Staging +
    +
    +
    +
    +
  • +
  • +
    +
    +
    +
    +
    + +
    +
    +
    + Analytics +
    +
    +
    +
    +
  • +
  • +
    +
    +
    +
    +
    + +
    +
    +
    + Maps +
    +
    +
+``` + +### Treeview Light + +A `treeview` variation for light colored backgrounds. + +
    +
  • +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    + + + Liferay Drive + + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
      +
    • + +
      +
        +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Details + + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Categorization + + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Documents and Media + + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Site Template + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Sitemap + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Robots + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
    • +
    +
    +
  • +
  • + +
    +
      +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + + Default User Associations + + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Staging + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Analytics + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
    • +
    • +
      +
      +
      +
      +
      + +
      +
      +
      + + + Maps + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
    • +
    +
    +
  • +
```html
  • - - - +
    +
    +
    - - - +
    +
    +
    + +
    +
    +
    +
    - - - +
    +
    +
    - - +
    +
    - - +
    +
    - - - +
    +
    +
    -
    +
    • - Tree Item -
      -
    • -
    -
    -
  • -
-``` - -## Variations - -### Show Component Expander on Hover - -The class `show-component-expander-on-hover` displays the `component-expander` when the mouse hovers over the `treeview` component. - -
    -
  • -
    - - - - - - - - - - - - - - - - - Liferay Drive - - - - - - -
    -
    -
      -
    • -
    • @@ -2976,57 +7124,179 @@ The class `show-component-expander-on-hover` displays the `component-expander` w tabIndex="-1" style={{paddingLeft: '48px'}} > - - - - - +
      +
      +
      + +
      +
      +
      + Details +
      +
      +
      -
    • -
    • -
      +
      +
      + +
      +
    + + +
  • +
  • +
    - - - - - +
    +
    + +
    +
    +
    + Categorization +
    +
    + +
    +
    + +
    +
    +
  • @@ -3036,27 +7306,89 @@ The class `show-component-expander-on-hover` displays the `component-expander` w tabIndex="-1" style={{paddingLeft: '48px'}} > - - - - - +
    +
    + +
    +
    +
    + Documents and + Media +
    +
    + +
    +
    + +
    + +
  • @@ -3066,53 +7398,114 @@ The class `show-component-expander-on-hover` displays the `component-expander` w tabIndex="-1" style={{paddingLeft: '48px'}} > - - - - - +
    +
    + +
    +
    +
    + Site Template +
    +
    +
    -
  • -
- - - - + + +
+ +
+ + + + + + + + +
  • -
  • - + -
    +
    • - - - - - +
      +
      + +
      +
      +
      + - - Default User Associations - - - - - - -
      -
    • -
    • -
      - - - - - - - Staging - - - - - - -
      -
    • -
    • -
      - - - - - - - Analytics - - - - - - -
      -
    • -
    • -
      - - - - - - - Maps - - - - - - -
      -
    • -
    -
    -
  • - - -```html -
      -
    • -
      - - - - - - - - - - - - - - - Liferay Drive - - - - -
      -
      -
        -
      • - +
        +
        +
        + - - - - - - - - - - - Liferay Drive - (ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual) - - - - +
        +
      + +
    • +
    • -
        -
      • -
        - - - - Details - - - -
        -
      • -
      • -
        - - - - Categorization - - - -
        -
      • -
      • -
        - - - - Documents and - Media - - - -
        -
      • -
      • -
        - - - - Site Template - - - -
        -
      • -
      -
      -
    • -
    - - -
  • - -
    -
      -
    • -
      - - - - Sitemap +
      +
      - - - -
      -
    • -
    • -
      - - - + +
      +
    +
    Robots - - - -
    -
  • - - - -
  • - -
    -
      -
    • -
      - - - - Default User Associations - - - -
      -
    • -
    • -
      - - - - Staging - - - -
      -
    • -
    • -
      - - - - Analytics - - - -
      -
    • -
    • -
      - - - - Maps - - - -
      -
    • -
    -
    -
  • - -``` - -### Show Quick Actions on Hover - -The class `show-quick-actions-on-hover` on `treeview` will hide all `quick-action-item`'s except when `treeview-link` is hovered or focused. - -
      -
    • -
      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      -
      - - - -
      -
      -
      - - - - - - Liferay Drive - - - - - - - - -
      -
      -
      -
      -
      -
        -
      • - -
        -
          -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Details - - - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Categorization - - - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Documents and Media - - - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Site Template - - - -
          -
          -
          -
          -
        • -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Sitemap - - - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Robots - - - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Default User Associations - - - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Staging - - - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Analytics - - - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Maps - - - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    - -```html -
      -
    • -
      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      -
      - - - -
      -
      -
      - - - - Liferay Drive - - - - - - -
      -
      -
      -
      -
      -
        -
      • - -
        -
          -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Details -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Categorization -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Documents and - Media -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Site Template -
          -
          -
          -
          -
        • -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Sitemap -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Robots -
        -
        -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Default User Associations -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Staging -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Analytics -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Maps -
        -
        -
        -
        -
      • -
      -
      -
    • -
    -``` - -### Treeview Light - -A `treeview` variation for light colored backgrounds. - -
      -
    • -
      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      -
      - - - -
      -
      -
      - - - - Liferay Drive - - - -
      -
      - -
      -
      - -
      -
      -
      -
      -
      -
        -
      • - -
        -
          -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Details - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Categorization - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Documents and Media - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Site Template - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Sitemap - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Robots - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Default User Associations - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Staging - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Analytics - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Maps - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    - -```html -
      -
    • -
      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      -
      - - - -
      -
      -
      - - Liferay Drive - -
      -
      - -
      -
      - -
      -
      -
      -
      -
      -
        -
      • - -
        -
          -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Details -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Categorization -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Documents and - Media -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - Site Template -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Sitemap -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Robots -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Default User Associations -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Staging -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Analytics -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - Maps -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    -``` - -### Treeview Dark - -A `treeview` variation for dark colored backgrounds. - -
    -
      -
    • -
      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      -
      - - - -
      -
      -
      - - - - Liferay Drive - - - -
      -
      - -
      -
      - -
      -
      -
      -
      -
      -
        -
      • - -
        -
          -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Details - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Categorization - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Documents and - Media - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        • -
          -
          -
          -
          -
          - -
          -
          -
          - - - - Site Template - - - -
          -
          - -
          -
          - -
          -
          -
          -
          -
        • -
        -
        -
      • -
      -
      -
    • -
    • - -
      -
        -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Sitemap - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      • -
        -
        -
        -
        -
        - -
        -
        -
        - - - - Robots - - - -
        -
        - -
        -
        - -
        -
        -
        -
        -
      • -
      -
      -
    • -
    • -
    • +
    +
    + +
  • + -
    -
      -
    • +
    +
    +
      +
    • +
      -
      -
      -
      -
      - -
      +
      +
      +
      +
      -
      - - +
      + Default User Associations +
      +
      +
      -
      - -
      -
      -
      +
      + -
      + + +
      +
      -
    • -
    • +
    +
  • +
  • +
    -
    -
    -
    -
    - -
    -
    -
    - +
    +
    +
    +
    -
    - -
    -
    - +
    +
    + -
    + + + +
    -
  • -
  • + +
  • +
  • +
    -
    -
    -
    -
    - -
    -
    -
    - + className="c-inner" + tabIndex="-2" + style={{marginLeft: '-24px'}} + > +
    +
    +
    +
    -
    - -
    -
    - +
    +
    + -
    + + + +
    -
  • -
  • + +
  • +
  • +
    -
    -
    -
    -
    - -
    -
    -
    - +
    +
    +
    +
    -
    - -
    -
    - +
    +
    + -
    + + + +
    -
  • - - - - + + + + + + +``` + +### Treeview Dark + +A `treeview` variation for dark colored backgrounds. + +
    +
      +
    • +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      + + + +
      +
      +
      + + + Liferay Drive + + +
      +
      + +
      +
      + +
      +
      +
      +
      +
      +
        +
      • + +
        +
          +
        • +
          +
          +
          +
          +
          + +
          +
          +
          + + + + Details + + + +
          +
          + +
          +
          + +
          +
          +
          +
          +
        • +
        • +
          +
          +
          +
          +
          + +
          +
          +
          + + + + Categorization + + + +
          +
          + +
          +
          + +
          +
          +
          +
          +
        • +
        • +
          +
          +
          +
          +
          + +
          +
          +
          + + + + Documents and Media + + + +
          +
          + +
          +
          + +
          +
          +
          +
          +
        • +
        • +
          +
          +
          +
          +
          + +
          +
          +
          + + + + Site Template + + + +
          +
          + +
          +
          + +
          +
          +
          +
          +
        • +
        +
        +
      • +
      +
      +
    • +
    • + +
      +
        +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Sitemap + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Robots + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      +
      +
    • +
    • + +
      +
        +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + + Default User Associations + + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Staging + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Analytics + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      • +
        +
        +
        +
        +
        + +
        +
        +
        + + + Maps + + +
        +
        + +
        +
        + +
        +
        +
        +
        +
      • +
      +
      +
    • +
    ```html @@ -9787,7 +9466,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -9824,7 +9503,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -9853,7 +9532,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -9872,7 +9551,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -9920,7 +9599,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -9959,7 +9638,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -9994,7 +9673,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10016,7 +9695,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10090,7 +9769,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10112,7 +9791,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10182,7 +9861,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10204,7 +9883,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10275,7 +9954,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10297,7 +9976,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10368,7 +10047,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10390,7 +10069,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10435,7 +10114,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10472,7 +10151,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10501,7 +10180,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10520,7 +10199,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10589,7 +10268,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10611,7 +10290,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10679,7 +10358,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10701,7 +10380,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10743,7 +10422,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10780,7 +10459,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10809,7 +10488,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10828,7 +10507,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10898,7 +10577,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10920,7 +10599,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -10988,7 +10667,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -11010,7 +10689,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -11078,7 +10757,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -11100,7 +10779,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -11168,7 +10847,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > @@ -11190,7 +10869,7 @@ A `treeview` variation for dark colored backgrounds. role="presentation" > diff --git a/packages/clay-core/docs/vertical-bar.mdx b/packages/clay-core/docs/vertical-bar.mdx index 29d143adde..e4f3f3cf04 100644 --- a/packages/clay-core/docs/vertical-bar.mdx +++ b/packages/clay-core/docs/vertical-bar.mdx @@ -6,13 +6,13 @@ packageStatus: 'Beta' packageUse: "import {VerticalBar} from '@clayui/core';" storybookPath: 'design-system-components-verticalbar' packageTypes: - [ - 'clay-core/src/vertical-bar/VerticalBar.tsx', - 'clay-core/src/vertical-bar/Bar.tsx', - 'clay-core/src/vertical-bar/Item.tsx', - 'clay-core/src/vertical-bar/Panel.tsx', - 'clay-core/src/vertical-bar/Content.tsx', - ] + [ + 'clay-core/src/vertical-bar/VerticalBar.tsx', + 'clay-core/src/vertical-bar/Bar.tsx', + 'clay-core/src/vertical-bar/Item.tsx', + 'clay-core/src/vertical-bar/Panel.tsx', + 'clay-core/src/vertical-bar/Content.tsx', + ] --- ## Example @@ -22,62 +22,52 @@ import {Button, Provider, VerticalBar} from '@clayui/core'; import Icon from '@clayui/icon'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - -const spritemap = '/public/icons.svg'; +const spritemap = '/icons.svg'; export default function App() { - const items = [ - { - icon: 'tag', - title: 'Tag', - }, - { - divider: true, - icon: 'message', - title: 'Message', - }, - { - icon: 'effects', - title: 'Effects', - }, - ]; - - return ( -
    - - - - {(item) => ( - -
    -
    - {item.title} -
    -
    -
    - )} -
    - - - {(item) => ( - - - - )} - -
    -
    -
    - ); + const items = [ + { + icon: 'tag', + title: 'Tag', + }, + { + divider: true, + icon: 'message', + title: 'Message', + }, + { + icon: 'effects', + title: 'Effects', + }, + ]; + + return ( +
    + + + + {(item) => ( + +
    +
    {item.title}
    +
    +
    + )} +
    + + + {(item) => ( + + + + )} + +
    +
    +
    + ); } ``` @@ -95,34 +85,34 @@ The component controls the OOTB state to toggle the visibility of the panels ie ```jsx - - Tag - Message - - - - - - - - - - - - + + Tag + Message + + + + + + + + + + + + ``` @@ -130,16 +120,16 @@ The declaration order is important for the component to know which Panel should ```jsx - - Tag - - - - - - + + Tag + + + + + + ``` @@ -149,28 +139,28 @@ Declaring components and the list of panels and hard coded items that are not co ```jsx - - Tag - Message - Effects - - - - - - - - - - - - + + Tag + Message + Effects + + + + + + + + + + + + ``` @@ -182,41 +172,39 @@ To make a component dynamic is only possible by using the properties of `items` ```jsx const items = [ - { - icon: 'tag', - title: 'Tag', - }, - { - divider: true, - icon: 'message', - title: 'Message', - }, - { - icon: 'effects', - title: 'Effects', - }, + { + icon: 'tag', + title: 'Tag', + }, + { + divider: true, + icon: 'message', + title: 'Message', + }, + { + icon: 'effects', + title: 'Effects', + }, ]; return ( - - - {(item) => ( - - {item.title} - - )} - - - - {(item) => ( - - - - )} - - + + + {(item) => ( + {item.title} + )} + + + + {(item) => ( + + + + )} + + ); ``` @@ -226,8 +214,8 @@ Positioning the VerticalBar on the right or left side is possible by setting the ```jsx - - + + ``` @@ -238,11 +226,11 @@ The property `resize` in `` enables the user to increase or d The property `onPanelWidthChange` accepts a callback function that executes when the `panelWidth` is updated. The callback function has the value of the panel width as the parameter. It can be used to make updates to other parts of your application, such as pushing body content over as the user resizes the Vertical Bar Panel.
    - When using the property `onPanelWidthChange`, you must also declare - `panelWidth`. Setting a fixed value for `panelWidth` will result in - `onPanelWidthChange` always returning that value, you must use - `React.useState` to get your callback function to return the correct value. - Please see the code example below. + When using the property `onPanelWidthChange`, you must also declare + `panelWidth`. Setting a fixed value for `panelWidth` will result in + `onPanelWidthChange` always returning that value, you must use + `React.useState` to get your callback function to return the correct value. + Please see the code example below.
    @@ -256,43 +244,43 @@ const TagPanel = React.lazy(() => import('./TagPanel')); const MessagePanel = React.lazy(() => import('./MessagePanel')); export const LoadLazyPanel = () => { - const items = [ - { - icon: 'tag', - panel: TagPanel, - title: 'Tag', - }, - { - divider: true, - icon: 'message', - panel: MessagePanel, - title: 'Message', - }, - ]; - - return ( - - - {({panel: PanelLazy, title}) => ( - - Loading...}> - - - - )} - - - - {(item) => ( - - - - )} - - - ); + const items = [ + { + icon: 'tag', + panel: TagPanel, + title: 'Tag', + }, + { + divider: true, + icon: 'message', + panel: MessagePanel, + title: 'Message', + }, + ]; + + return ( + + + {({panel: PanelLazy, title}) => ( + + Loading...}> + + + + )} + + + + {(item) => ( + + + + )} + + + ); }; ``` @@ -300,14 +288,14 @@ You can also use the `` above the `` to capture err ```jsx - {({panel: PanelLazy, title}) => ( - - - Loading...}> - - - - - )} + {({panel: PanelLazy, title}) => ( + + + Loading...}> + + + + + )} ``` diff --git a/packages/clay-core/src/icon-selector/IconSelector.tsx b/packages/clay-core/src/icon-selector/IconSelector.tsx index 2c36572c61..018966b2f8 100644 --- a/packages/clay-core/src/icon-selector/IconSelector.tsx +++ b/packages/clay-core/src/icon-selector/IconSelector.tsx @@ -442,7 +442,10 @@ export function IconSelector({ - + diff --git a/packages/clay-css/index.mjs b/packages/clay-css/index.mjs new file mode 100644 index 0000000000..6115043b7e --- /dev/null +++ b/packages/clay-css/index.mjs @@ -0,0 +1,18 @@ +/** + * SPDX-FileCopyrightText: © 2019 Liferay, Inc. + * SPDX-License-Identifier: BSD-3-Clause + */ + +import {dirname, join} from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +var srcDir = join(__dirname, 'src'); + +export default { + buildDir: join(__dirname, 'lib'), + includePaths: [join(srcDir, 'scss')], + libDir: join(__dirname, 'lib'), + srcDir, +}; diff --git a/packages/clay-data-provider/docs/data-provider.mdx b/packages/clay-data-provider/docs/data-provider.mdx index 3afac57350..e4f3641b69 100644 --- a/packages/clay-data-provider/docs/data-provider.mdx +++ b/packages/clay-data-provider/docs/data-provider.mdx @@ -5,21 +5,21 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/dropdowns/' packageNpm: '@clayui/data-provider' packageUse: "import DataProvider, {useResource} from '@clayui/data-provider';" packageTypes: - [ - 'clay-data-provider/src/DataProvider.tsx', - 'clay-data-provider/src/useResource.tsx', - ] + [ + 'clay-data-provider/src/DataProvider.tsx', + 'clay-data-provider/src/useResource.tsx', + ] --- ## Introduction ClayDataProvider gives functionality of data caching, attempts, polling, network status and avoiding [the thundering herd problem](https://en.wikipedia.org/wiki/Thundering_herd_problem). It is simple and powerful because: -- **Easy adoption**, you can incrementally use in your application and both `useResource` hook and `ClayDataProvider` component and have all the functionality available. -- **Simple to start**, use the basics you already know or take advantage of the full set of features to get the most out of it. -- **Built for data to reflect what users are doing in your application**, it works perfectly for cases where data changes according to user interaction. -- **Extensible**, enjoy the single cache in only one source of truth and save data between navigations to be used in future interactions. -- **Suspense and ErrorBoundary** do incremental adoption with `` and `` to the new React patterns. +- **Easy adoption**, you can incrementally use in your application and both `useResource` hook and `ClayDataProvider` component and have all the functionality available. +- **Simple to start**, use the basics you already know or take advantage of the full set of features to get the most out of it. +- **Built for data to reflect what users are doing in your application**, it works perfectly for cases where data changes according to user interaction. +- **Extensible**, enjoy the single cache in only one source of truth and save data between navigations to be used in future interactions. +- **Suspense and ErrorBoundary** do incremental adoption with `` and `` to the new React patterns. ## Getting started @@ -27,7 +27,7 @@ To consume data, you can work with two different ways in React, using the ` - {({data, error, loading, refetch}) => {}} + {({data, error, loading, refetch}) => {}} ``` @@ -37,11 +37,11 @@ The vast majority of APIs are the same between `useResource` and ` { - const {resource} = useResource({ - link: 'https://rickandmortyapi.com/api/character/', - }); + const {resource} = useResource({ + link: 'https://rickandmortyapi.com/api/character/', + }); - return null; + return null; }; ``` @@ -54,24 +54,24 @@ Make attempts on a request several times when a network or server error occurs. `fetchRetry` is easy to set up and is enabled by default with the `jitter` setting for delays between attempts by default.
    - Warning - The values ​​contained in the code below are the default value. + Warning + The values ​​contained in the code below are the default value.
    ```jsx const App = () => { - const {resource} = useResource({ - link: 'https://rickandmortyapi.com/api/character/', - fetchRetry: { - attempts: 5, - delay: { - initial: 300, - jitter: true, - }, - }, - }); - - return null; + const {resource} = useResource({ + link: 'https://rickandmortyapi.com/api/character/', + fetchRetry: { + attempts: 5, + delay: { + initial: 300, + jitter: true, + }, + }, + }); + + return null; }; ``` @@ -81,38 +81,38 @@ The DataProvider provides network status information for you if you want to crea ```jsx const App = () => ( - - {({data, error, loading, refetch, networkStatus}) => {}} - + + {({data, error, loading, refetch, networkStatus}) => {}} + ); ``` Using network status with hooks is another option, it does not provide an abstraction for `loading`, `error` and `networkStatus` and all information is collected through the `onNetworkStatusChange` callback. -- `loading` is equivalent to `networkStatus < 4` -- `error` is equivalent to `status === 5` +- `loading` is equivalent to `networkStatus < 4` +- `error` is equivalent to `status === 5` ```jsx const App = () => { - const [state, setState] = useState(() => ({ - error: false, - loading: false, - networkStatus: 4, - })); - const {resource} = useResource({ - link: 'https://rickandmortyapi.com/api/character/', - onNetworkStatusChange: (status) => - setState({ - error: status === 5, - loading: status < 4, - networkStatus: status, - }), - }); - - return null; + const [state, setState] = useState(() => ({ + error: false, + loading: false, + networkStatus: 4, + })); + const {resource} = useResource({ + link: 'https://rickandmortyapi.com/api/character/', + onNetworkStatusChange: (status) => + setState({ + error: status === 5, + loading: status < 4, + networkStatus: status, + }), + }); + + return null; }; ``` @@ -122,14 +122,14 @@ const App = () => { ```jsx const App = () => { - const [value, setValue] = useState('Rick'); - const {resource} = useResource({ - link: 'https://rickandmortyapi.com/api/character/', - fetchDelay: 300, - variables: {name: value}, - }); - - return null; + const [value, setValue] = useState('Rick'); + const {resource} = useResource({ + link: 'https://rickandmortyapi.com/api/character/', + fetchDelay: 300, + variables: {name: value}, + }); + + return null; }; ``` @@ -140,22 +140,22 @@ You can cache your requests so that in new user interactions a new request is no The cache is guided by a policy, use the `fetchPolicy` prop to enable and configure the cache according to your use case.
    - Warning - The cache is governed by the algorithm least recently used ( - LRU - ), you can set the amount of data that will be stored using the - storageMaxSize - API. Each new query is equivalent to 1 size. + Warning + The cache is governed by the algorithm least recently used ( + LRU + ), you can set the amount of data that will be stored using the + storageMaxSize + API. Each new query is equivalent to 1 size.
    - Warning - When suspense is enabled the hook automatically - changes the fetchPolicy to - FetchPolicy.CacheAndNetwork - if it is set to - FetchPolicy.NoCache - so it works properly. + Warning + When suspense is enabled the hook automatically + changes the fetchPolicy to + FetchPolicy.CacheAndNetwork + if it is set to + FetchPolicy.NoCache + so it works properly.
    ### Infinite loading @@ -165,24 +165,24 @@ Using the `useResource` hook also supports paginated data, which is common in AP Data is automatically aggregated as new requests are being made when the `loadMore` callback is called.
    - Info - Calling the refetch callback as an attempt - to refresh the data will not work since the data is already aggregated. + Info + Calling the refetch callback as an attempt + to refresh the data will not work since the data is already aggregated.
    ```javascript const {loadMore, resource} = useResource({ - fetch: async (link: string) => { - const result = await fetch(link); - const json = await result.json(); - - return { - cursor: json.info.next, - items: json.results, - }; - }, - link: 'https://rickandmortyapi.com/api/character', - variables: {limit: 10}, + fetch: async (link: string) => { + const result = await fetch(link); + const json = await result.json(); + + return { + cursor: json.info.next, + items: json.results, + }; + }, + link: 'https://rickandmortyapi.com/api/character', + variables: {limit: 10}, }); ``` @@ -216,11 +216,11 @@ If a network error happens you can also catch the error in render time using [`< ```javascript const Root = () => ( - - }> - - - + + }> + + + ); ``` @@ -238,8 +238,8 @@ This is an API that replaces the `link` behavior of receiving an async function, import fetch from 'unfetch'; const App = () => { - const {resource} = useResource({fetch, link: 'https://clay.dev'}); - // ... + const {resource} = useResource({fetch, link: 'https://clay.dev'}); + // ... }; ``` @@ -247,17 +247,17 @@ const App = () => { ```javascript const {resource, sort, sortChange} = useResource({ - fetch: (link, init, sort) => { - const url = new URL(link); + fetch: (link, init, sort) => { + const url = new URL(link); - if (sort) { - url.searchParams.append('column', sort.column); - url.searchParams.append('direction', sort.direction); - } + if (sort) { + url.searchParams.append('column', sort.column); + url.searchParams.append('direction', sort.direction); + } - return fetch(url, init); - }, - link: 'https://clay.dev', + return fetch(url, init); + }, + link: 'https://clay.dev', }); ``` @@ -272,10 +272,10 @@ With the `jitter` option enabled, delays are randomized anywhere between 0ms (in These two features combined help alleviate [the thundering herd problem](https://en.wikipedia.org/wiki/Thundering_herd_problem), by distributing load during major outages. Without these strategies, when your server comes back up it will be hit by all of your clients at once, possibly causing it to go down again.
    - Warning - The implementation of this was based on the - apollo-link-retry - plugin for React Apollo. + Warning + The implementation of this was based on the + apollo-link-retry + plugin for React Apollo.
    ### Caching data at root level @@ -283,26 +283,26 @@ These two features combined help alleviate [the thundering herd problem](https:/ The DataProvider can be used on small components that need some data and if it is very reused by the application in other pages, it does not make sense to consult this data every time the user interacts with it in other parts of your application, you can take advantage of the root level cache, ensuring that the next user interactions in the component are with data in the cache, even if it is on other pages.
    - Warning - The use of the storage property has been - deprecated since v3.67.0 in favor of declaring the - storageMaxSize={100} - component in the application root to control cache state and other internal - details. + Warning + The use of the storage property has been + deprecated since v3.67.0 in favor of declaring the + storageMaxSize={100} + component in the application root to control cache state and other internal + details.
    ```jsx const App = () => { - const storageContext = useContext(Store); - - return ( - - {({data, error, loading, refetch}) => {}} - - ); + const storageContext = useContext(Store); + + return ( + + {({data, error, loading, refetch}) => {}} + + ); }; ``` diff --git a/packages/clay-date-picker/docs/date-picker.mdx b/packages/clay-date-picker/docs/date-picker.mdx index ef47747973..74f5fd3afd 100644 --- a/packages/clay-date-picker/docs/date-picker.mdx +++ b/packages/clay-date-picker/docs/date-picker.mdx @@ -14,46 +14,44 @@ By default Date Picker does not handle input masking, letting you take control s For mobile viewing mode, Lexicon encourages you to use the native Date Picker, they are many robust and more accessible in the mobile view, Clay offers the [`useNative`](#api-useNative) API to replace the Date Picker view mode with the native and continue to get the features of the component.
    - Warning - These components are meant to cover desktop browser needs. The OS native component - must be used on mobile devices. + Warning + These components are meant to cover desktop browser needs. The OS native component + must be used on mobile devices.
    The component is treated as controlled, use the [`onValueChange`](#api-onValueChange) and [`value`](#api-value) APIs to control the flow of information.
    - Warning - You can set a range of years using the API - years - , which can be displayed in the Date Picker, if the user enters a year - that is not within the range will be treated as an invalid date. + Warning + You can set a range of years using the API + years + , which can be displayed in the Date Picker, if the user enters a year that + is not within the range will be treated as an invalid date.
    ```jsx preview import {Provider} from '@clayui/core'; import DatePicker from '@clayui/date-picker'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [value, setValue] = useState(null); - - return ( - -
    - -
    -
    - ); + const [value, setValue] = React.useState(null); + + return ( + +
    + +
    +
    + ); } ``` @@ -64,30 +62,28 @@ The ClayTimePicker by default is already implemented in the Date Picker, you can ```jsx preview import {Provider} from '@clayui/core'; import DatePicker from '@clayui/date-picker'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [value, setValue] = useState(null); - - return ( - -
    - -
    -
    - ); + const [value, setValue] = React.useState(null); + + return ( + +
    + +
    +
    + ); } ``` @@ -98,38 +94,36 @@ Range is used to allowing the user to select a date range using a single calenda When a range is selected using the `input` or the calendar, the [`onValueChange`](#api-onValueChange) callback is called with the value in `string` type, respecting the format of the [`dateFormat`](#api-dateFormat) for both dates together with the separator.
    - Warning - The time is not supported when the - range - is enabled. + Warning + The time is not supported when the + range + is enabled.
    ```jsx preview import {Provider} from '@clayui/core'; import DatePicker from '@clayui/date-picker'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [value, setValue] = useState(null); - - return ( - -
    - -
    -
    - ); + const [value, setValue] = React.useState(null); + + return ( + +
    + +
    +
    + ); } ``` @@ -140,62 +134,60 @@ To set internationalization of the component, you need to configure the props ac ```jsx preview import {Provider} from '@clayui/core'; import DatePicker from '@clayui/date-picker'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [value, setValue] = useState(null); - - return ( - -
    - -
    -
    - ); + const [value, setValue] = React.useState(null); + + return ( + +
    + +
    +
    + ); } ``` -- [`firstDayOfWeek`](#api-firstDayOfWeek) by default the value by default the value is 0 (Sunday) and its values are the days of the week, 1 (Monday), 2 (Tuesday), 3 (Wednesday), 4 (Thursday), 5 (Friday), 6 (Saturday). -- [`dateFormat`](#api-dateFormat) and `timeFormat` is defined according to the **formatting rules of [date-fns](https://date-fns.org/v2.14.0/docs/format)** which is an implementation of the [unicode technical standards](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). -- [`months`](#api-months) is an `Array` with available months **starting January to December**. -- [`weekdaysShort`](#api-weekdaysShort) is an `Array` with the **names of the days of the week in short form**, starting from **Sunday to Saturday**. +- [`firstDayOfWeek`](#api-firstDayOfWeek) by default the value by default the value is 0 (Sunday) and its values are the days of the week, 1 (Monday), 2 (Tuesday), 3 (Wednesday), 4 (Thursday), 5 (Friday), 6 (Saturday). +- [`dateFormat`](#api-dateFormat) and `timeFormat` is defined according to the **formatting rules of [date-fns](https://date-fns.org/v2.14.0/docs/format)** which is an implementation of the [unicode technical standards](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). +- [`months`](#api-months) is an `Array` with available months **starting January to December**. +- [`weekdaysShort`](#api-weekdaysShort) is an `Array` with the **names of the days of the week in short form**, starting from **Sunday to Saturday**.
    - Warning - It is not necessary to reverse or change the order of the values ​​of - weekdaysShort - the definition of the API - firstDayOfWeek - will take care of changing this, - keep the order from Sunday to Saturday - . + Warning + It is not necessary to reverse or change the order of the values ​​of + weekdaysShort + the definition of the API + firstDayOfWeek + will take care of changing this, + keep the order from Sunday to Saturday + .
    ## Custom Footer @@ -205,29 +197,27 @@ To customize the Date Picker content footer you can use the [`footerElement`](#a ```jsx preview import {Provider} from '@clayui/core'; import DatePicker from '@clayui/date-picker'; -import React, {useState} from 'react'; - -import '@clayui/css/lib/css/atlas.css'; +import React from 'react'; export default function App() { - const [value, setValue] = useState(null); - - return ( - -
    - Footer Content} - onChange={setValue} - placeholder="YYYY-MM-DD" - value={value} - years={{ - end: new Date().getFullYear(), - start: 2008, - }} - /> -
    -
    - ); + const [value, setValue] = React.useState(null); + + return ( + +
    + Footer Content} + onChange={setValue} + placeholder="YYYY-MM-DD" + value={value} + years={{ + end: new Date().getFullYear(), + start: 2008, + }} + /> +
    +
    + ); } ``` diff --git a/packages/clay-date-picker/docs/date-picker/markup.mdx b/packages/clay-date-picker/docs/date-picker/markup.mdx index fe942b0315..d71c572073 100644 --- a/packages/clay-date-picker/docs/date-picker/markup.mdx +++ b/packages/clay-date-picker/docs/date-picker/markup.mdx @@ -7,7 +7,7 @@ packageUse: "import DatePicker from '@clayui/date-picker';" ---
    - This requires custom javascript. + This requires custom javascript.
    ## Example @@ -15,30 +15,30 @@ packageUse: "import DatePicker from '@clayui/date-picker';" The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer`. `Footer`: You can add elements that complement the Date Picker like the Time Picker.
    -
    -
    -
    -
    - Date Picker Calendar Header -
    -
    - Date Picker Calendar Body -
    -
    - Date Picker Calendar Footer -
    -
    -
    -
    +
    +
    +
    +
    + Date Picker Calendar Header +
    +
    + Date Picker Calendar Body +
    +
    + Date Picker Calendar Footer +
    +
    +
    +
    ```html
    -
    -
    ...
    -
    ...
    -
    ...
    -
    +
    +
    ...
    +
    ...
    +
    ...
    +
    ``` @@ -46,13 +46,13 @@ The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer`
    - - + +
    @@ -113,23 +113,23 @@ The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer`
    @@ -162,117 +162,117 @@ The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer`
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    @@ -282,12 +282,12 @@ The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer`
    - +
    - +
    (GMT+01:00) @@ -303,1628 +303,1560 @@ The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer` ```html
    -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - S -
    -
    -
    -
    - M -
    -
    -
    -
    - T -
    -
    -
    -
    - W -
    -
    -
    -
    - T -
    -
    -
    -
    - F -
    -
    -
    -
    - S -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - - - - -
    -
    - -
    -
    - (GMT+01:00) -
    -
    -
    -
    -
    -
    +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + S +
    +
    +
    +
    + M +
    +
    +
    +
    + T +
    +
    +
    +
    + W +
    +
    +
    +
    + T +
    +
    +
    +
    + F +
    +
    +
    +
    + S +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    + +
    +
    + (GMT+01:00) +
    +
    +
    +
    +
    +
    ``` ## Date Picker
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - S -
    -
    -
    -
    - M -
    -
    -
    -
    - T -
    -
    -
    -
    - W -
    -
    -
    -
    - T -
    -
    -
    -
    - F -
    -
    -
    -
    - S -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + S +
    +
    +
    +
    + M +
    +
    +
    +
    + T +
    +
    +
    +
    + W +
    +
    +
    +
    + T +
    +
    +
    +
    + F +
    +
    +
    +
    + S +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    ```html
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - S -
    -
    -
    -
    - M -
    -
    -
    -
    - T -
    -
    -
    -
    - W -
    -
    -
    -
    - T -
    -
    -
    -
    - F -
    -
    -
    -
    - S -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + S +
    +
    +
    +
    + M +
    +
    +
    +
    + T +
    +
    +
    +
    + W +
    +
    +
    +
    + T +
    +
    +
    +
    + F +
    +
    +
    +
    + S +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    ``` @@ -1933,62 +1865,62 @@ The DropDown content of the DatePicker consists of `Header`, `Body` and `Footer` Add the class `focus` to the `input-group-item` to show the focus border.
    -
    -
    - - -
    - -
    -
    -
    +
    +
    + + +
    + +
    +
    +
    ```html
    -
    - - -
    - -
    -
    +
    + + +
    + +
    +
    ``` @@ -2001,1944 +1933,1900 @@ The modifier class `c-selected-start` must be added to `date-picker-col` for the The class `c-selected-end` must be added to `date-picker-col` for the last date in the range.
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - Mon -
    -
    -
    -
    - Tues -
    -
    -
    -
    - Wed -
    -
    -
    -
    - Thu -
    -
    -
    -
    - Fri -
    -
    -
    -
    - Sat -
    -
    -
    -
    - Sun -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + Mon +
    +
    +
    +
    + Tues +
    +
    +
    +
    + Wed +
    +
    +
    +
    + Thu +
    +
    +
    +
    + Fri +
    +
    +
    +
    + Sat +
    +
    +
    +
    + Sun +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    ```html
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - Mon -
    -
    -
    -
    - Tues -
    -
    -
    -
    - Wed -
    -
    -
    -
    - Thu -
    -
    -
    -
    - Fri -
    -
    -
    -
    - Sat -
    -
    -
    -
    - Sun -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + Mon +
    +
    +
    +
    + Tues +
    +
    +
    +
    + Wed +
    +
    +
    +
    + Thu +
    +
    +
    +
    + Fri +
    +
    +
    +
    + Sat +
    +
    +
    +
    + Sun +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    ``` ### Date Picker Old Markup
    - In Clay CSS versions 3.24.1 and below, Date Picker days and dates weren't - wrapped in an extra element date-picker-col. We added the - wrapping element for highlighting a range of dates. See{' '} - - #3986 - - . This old pattern is still supported, but we recommend updating your markup. + In Clay CSS versions 3.24.1 and below, Date Picker days and dates weren't + wrapped in an extra element date-picker-col. We added the + wrapping element for highlighting a range of dates. See{' '} + + #3986 + + . This old pattern is still supported, but we recommend updating your markup.
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    - Mon -
    -
    - Tues -
    -
    - Wed -
    -
    - Thu -
    -
    - Fri -
    -
    - Sat -
    -
    - Sun -
    -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    + Mon +
    +
    + Tues +
    +
    + Wed +
    +
    + Thu +
    +
    + Fri +
    +
    + Sat +
    +
    + Sun +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    +
    +
    +
    ```html
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    - Mon -
    -
    - Tues -
    -
    - Wed -
    -
    - Thu -
    -
    - Fri -
    -
    - Sat -
    -
    - Sun -
    -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    - - - - - - - -
    -
    -
    -
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    + Mon +
    +
    + Tues +
    +
    + Wed +
    +
    + Thu +
    +
    + Fri +
    +
    + Sat +
    +
    + Sun +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    +
    +
    ``` @@ -3947,954 +3835,918 @@ The class `c-selected-end` must be added to `date-picker-col` for the last date Check the browser support for `input[type="date"]` before deciding if it's a good fit for your application.
    -
    - - -
    +
    + + +
    ```html
    - - + +
    ``` ## Time Picker
    - This requires external javascript to change values of nested inputs and - increment/decrement buttons. We use input type="text" because - it gives us better cross browser support for formatting numbers and text. + This requires external javascript to change values of nested inputs and + increment/decrement buttons. We use input type="text" because it + gives us better cross browser support for formatting numbers and text.
    ### Time Picker 12H
    -
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    ```html
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    ``` ### Time Picker 12H With Time Zone
    -
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - (GMT+01:00) -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + (GMT+01:00) +
    +
    +
    +
    ### Time Picker 12H With Time Zone and Icon
    -
    - -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - (GMT+01:00) -
    -
    -
    -
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + (GMT+01:00) +
    +
    +
    +
    ```html
    - -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - (GMT+01:00) -
    -
    -
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + (GMT+01:00) +
    +
    +
    ``` ### Time Picker 24H
    -
    - -
    -
    -
    -
    -
    - - : - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    + + : + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    ```html
    - -
    -
    -
    -
    -
    - - : - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    + + : + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    ``` ### Time Picker With Seconds and Clear
    -
    - -
    -
    -
    -
    -
    - - : - - : - - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - : - - : - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    + + : + + : + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + : + + : + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    ```html
    - -
    -
    -
    -
    -
    - - : - - : - - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    + + : + + : + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    - -
    -
    -
    -
    -
    - - : - - : - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    + + : + + : + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    ``` @@ -4903,150 +4755,146 @@ Check the -
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    ```html
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    ``` @@ -5055,160 +4903,156 @@ Add the class `focus` to `form-control`. Add the class `disabled` to `form-control` and the attribute `disabled` to all nested `input`s and `button`s. The `label` can also be styled in a disabled state with the class `disabled`.
    -
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    ```html
    - -
    -
    -
    -
    -
    - - : - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    + + : + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    ``` @@ -5217,64 +5061,64 @@ Add the class `disabled` to `form-control` and the attribute `disabled` to all n Check the
    browser support for `input[type="time"]` before deciding if it's a good fit for your application.
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    - (GMT+01:00) -
    -
    -
    -
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    + (GMT+01:00) +
    +
    +
    +
    ```html
    - - + +
    -
    -
    - -
    -
    - (GMT+01:00) -
    -
    +
    +
    + +
    +
    + (GMT+01:00) +
    +
    ``` diff --git a/packages/clay-drop-down/docs/drop-down.mdx b/packages/clay-drop-down/docs/drop-down.mdx index 94f5342766..1560ac45b3 100644 --- a/packages/clay-drop-down/docs/drop-down.mdx +++ b/packages/clay-drop-down/docs/drop-down.mdx @@ -5,18 +5,18 @@ lexiconDefinition: 'https://liferay.design/lexicon/core-components/dropdowns/' packageNpm: '@clayui/drop-down' packageUse: "import DropDown from '@clayui/drop-down';" packageTypes: - [ - 'clay-drop-down/src/DropDown.tsx', - 'clay-drop-down/src/Action.tsx', - 'clay-drop-down/src/Item.tsx', - 'clay-drop-down/src/ItemList.tsx', - 'clay-drop-down/src/Section.tsx', - 'clay-drop-down/src/Group.tsx', - 'clay-drop-down/src/Help.tsx', - 'clay-drop-down/src/Caption.tsx', - 'clay-drop-down/src/DropDownWithDrilldown.tsx', - 'clay-drop-down/src/DropDownWithItems.tsx', - ] + [ + 'clay-drop-down/src/DropDown.tsx', + 'clay-drop-down/src/Action.tsx', + 'clay-drop-down/src/Item.tsx', + 'clay-drop-down/src/ItemList.tsx', + 'clay-drop-down/src/Section.tsx', + 'clay-drop-down/src/Group.tsx', + 'clay-drop-down/src/Help.tsx', + 'clay-drop-down/src/Caption.tsx', + 'clay-drop-down/src/DropDownWithDrilldown.tsx', + 'clay-drop-down/src/DropDownWithItems.tsx', + ] --- ## Example @@ -27,63 +27,61 @@ import DropDown from '@clayui/drop-down'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - const items = [ - { - children: [ - {id: 2, name: 'Apple'}, - {id: 3, name: 'Banana'}, - {id: 4, name: 'Mangos'}, - ], - id: 1, - name: 'Fruit', - }, - { - children: [ - {id: 6, name: 'Potatoes'}, - {id: 7, name: 'Tomatoes'}, - {id: 8, name: 'Onions'}, - ], - id: 5, - name: 'Vegetable', - }, + { + children: [ + {id: 2, name: 'Apple'}, + {id: 3, name: 'Banana'}, + {id: 4, name: 'Mangos'}, + ], + id: 1, + name: 'Fruit', + }, + { + children: [ + {id: 6, name: 'Potatoes'}, + {id: 7, name: 'Tomatoes'}, + {id: 8, name: 'Onions'}, + ], + id: 5, + name: 'Vegetable', + }, ]; export default function App() { - return ( - -
    - Select} - triggerIcon="caret-bottom" - > - - - {(item) => ( - - {(item) => ( - { - // logic stuff... - }} - > - {item.name} - - )} - - )} - - -
    -
    - ); + return ( + +
    + Select} + triggerIcon="caret-bottom" + > + + + {(item) => ( + + {(item) => ( + { + // logic stuff... + }} + > + {item.name} + + )} + + )} + + +
    +
    + ); } ``` @@ -103,11 +101,11 @@ The simplest example of a static menu is rendering a simple list of options. ```jsx Click Me}> - - one - two - three - + + one + two + three + ``` @@ -115,19 +113,19 @@ Other cases are also possible, for example rendering a group of options with a s ```jsx Click Me}> - - - - one - two - three - - - a - b - c - - + + + + one + two + three + + + a + b + c + + ``` @@ -137,7 +135,7 @@ The example above shows how Clay even with the explicit composition of the menu ```jsx Click Me}> - {(item) => {item}} + {(item) => {item}} ``` @@ -145,31 +143,25 @@ Compositing for dynamic content becomes simpler and also provides the same featu ```jsx Click Me}> - - - {(item) => ( - - {(item) => ( - {item.name} - )} - - )} - + + + {(item) => ( + + {(item) => {item.name}} + + )} + ``` @@ -179,34 +171,32 @@ The filter in a Menu works OOTB, just declaring the `` componen ```jsx function Example() { - const [value, setValue] = useState(''); - - const options = [{name: 'one'}, {name: 'two'}, {name: 'three'}]; - - const filteredOptions = useMemo(() => { - if (!value) { - return options; - } - - return options.filter( - (option) => option.match(new RegExp(value, 'i')) !== null - ); - }, [options, value]); - - return ( - Click Me}> - - - {(item) => ( - {item.name} - )} - - - ); + const [value, setValue] = useState(''); + + const options = [{name: 'one'}, {name: 'two'}, {name: 'three'}]; + + const filteredOptions = useMemo(() => { + if (!value) { + return options; + } + + return options.filter( + (option) => option.match(new RegExp(value, 'i')) !== null + ); + }, [options, value]); + + return ( + Click Me}> + + + {(item) => {item.name}} + + + ); } ``` @@ -214,10 +204,10 @@ If you just need to set an initial value, just use the `defaultValue` property. ```jsx Click Me}> - - - {(item) => {item.name}} - + + + {(item) => {item.name}} + ``` @@ -227,15 +217,15 @@ DropDown filters items according to the value rendered as `children` of `Click Me}> - - - {(item) => ( - - - {item.name} - - )} - + + + {(item) => ( + + + {item.name} + + )} + ``` @@ -246,8 +236,8 @@ You may want to create a trigger that is not necessarily in the same tree as Dro Using `` allows you to better control the state of DropDown but you will have to deal with visibility, focus management, and other details.
    - As a recommendation only use this component as a last resort, it doesn't - provide some OOTB features like focus control or accessibility at all. + As a recommendation only use this component as a last resort, it doesn't + provide some OOTB features like focus control or accessibility at all.
    ```jsx @@ -255,44 +245,44 @@ import ClayDropDown from '@clayui/drop-down'; import React, {useState, useRef} from 'react'; const Menu = ({children, hasLeftSymbols, hasRightSymbols}) => { - const triggerElementRef = useRef(null); - const [expand, setExpand] = useState(false); - const menuElementRef = useRef(null); - - const handleExpand = (event) => { - // This is not ideal for allowing you to have more than - // one trigger for the same content but it simulates the - // advantages of controlling `DropDown.Menu`. - triggerElementRef.current = event.target; - - setExpand(!expand); - }; - - return ( -
    -
    - -
    -
    - -
    - - setExpand(!expand)} - ref={menuElementRef} - > - {children} - -
    - ); + const triggerElementRef = useRef(null); + const [expand, setExpand] = useState(false); + const menuElementRef = useRef(null); + + const handleExpand = (event) => { + // This is not ideal for allowing you to have more than + // one trigger for the same content but it simulates the + // advantages of controlling `DropDown.Menu`. + triggerElementRef.current = event.target; + + setExpand(!expand); + }; + + return ( +
    +
    + +
    +
    + +
    + + setExpand(!expand)} + ref={menuElementRef} + > + {children} + +
    + ); }; ``` @@ -316,63 +306,61 @@ import DropDown from '@clayui/drop-down'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - const items = [ - { - children: [ - {id: 2, name: 'Apple'}, - {id: 3, name: 'Banana'}, - {id: 4, name: 'Mangos'}, - ], - id: 1, - name: 'Fruit', - }, - { - children: [ - {id: 6, name: 'Potatoes'}, - {id: 7, name: 'Tomatoes'}, - {id: 8, name: 'Onions'}, - ], - id: 5, - name: 'Vegetable', - }, + { + children: [ + {id: 2, name: 'Apple'}, + {id: 3, name: 'Banana'}, + {id: 4, name: 'Mangos'}, + ], + id: 1, + name: 'Fruit', + }, + { + children: [ + {id: 6, name: 'Potatoes'}, + {id: 7, name: 'Tomatoes'}, + {id: 8, name: 'Onions'}, + ], + id: 5, + name: 'Vegetable', + }, ]; export default function App() { - return ( - -
    - Select} - triggerIcon="caret-bottom" - > - - - {(item) => ( - - {(item) => ( - { - // logic stuff... - }} - > - {item.name} - - )} - - )} - - -
    -
    - ); + return ( + +
    + Select} + triggerIcon="caret-bottom" + > + + + {(item) => ( + + {(item) => ( + { + // logic stuff... + }} + > + {item.name} + + )} + + )} + + +
    +
    + ); } ``` @@ -388,21 +376,21 @@ To render a cascading menu it is necessary to set the `type` of the item to `con ```js const items = [ - {label: 'Folder'}, - {type: 'divider'}, - { - items: [ - {label: 'Basic Document'}, - {label: 'Contract'}, - {label: 'Marketing Banner'}, - {label: 'Spreadsheet'}, - {label: 'Presentation'}, - ], - label: 'Document', - type: 'contextual', - }, - {label: 'Shortcut'}, - {label: 'Repository'}, + {label: 'Folder'}, + {type: 'divider'}, + { + items: [ + {label: 'Basic Document'}, + {label: 'Contract'}, + {label: 'Marketing Banner'}, + {label: 'Spreadsheet'}, + {label: 'Presentation'}, + ], + label: 'Document', + type: 'contextual', + }, + {label: 'Shortcut'}, + {label: 'Repository'}, ]; ``` @@ -416,37 +404,31 @@ import {ClayDropDownWithDrilldown} from '@clayui/drop-down'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
    - alert('test'), title: 'Alert!'}, - {type: 'divider'}, - {child: 'x0a4', title: 'Subnav'}, - ], - x0a4: [ - {href: '#', title: '2nd hash link'}, - {child: 'x0a5', title: 'Subnav'}, - ], - x0a5: [ - {title: 'The'}, - {type: 'divider'}, - {title: 'End'}, - ], - }} - trigger={} - /> -
    -
    - ); + return ( + +
    + alert('test'), title: 'Alert!'}, + {type: 'divider'}, + {child: 'x0a4', title: 'Subnav'}, + ], + x0a4: [ + {href: '#', title: '2nd hash link'}, + {child: 'x0a5', title: 'Subnav'}, + ], + x0a5: [{title: 'The'}, {type: 'divider'}, {title: 'End'}], + }} + trigger={} + /> +
    +
    + ); } ``` @@ -454,7 +436,7 @@ The way the Drilldown component links the menus is done via reference, the menu ```js const menus = { - of23: [{title: 'First'}], + of23: [{title: 'First'}], }; ``` @@ -462,8 +444,8 @@ From the `id` you are able to link to another menu using the `child` property. ```js const menus = { - of23: [{title: 'First', child: 'of09'}], - of09: [{title: 'Three'}], + of23: [{title: 'First', child: 'of09'}], + of09: [{title: 'Three'}], }; ``` @@ -472,20 +454,16 @@ using an item that has this shape `{type: 'divider'}`. ```js const menus = { - of23: [ - {title: 'First', child: 'of09'}, - {type: 'divider'}, - {title: 'Second'}, - ], - of09: [{title: 'Three'}], + of23: [{title: 'First', child: 'of09'}, {type: 'divider'}, {title: 'Second'}], + of09: [{title: 'Three'}], }; ```
    - An important thing to have in mind, is that the `DropDownWithDrilldown` - component, will render its menus in the order that they are specified. This - means that if you specify the menus in the wrong order, the menu animation - will not behave correctly. + An important thing to have in mind, is that the `DropDownWithDrilldown` + component, will render its menus in the order that they are specified. This + means that if you specify the menus in the wrong order, the menu animation + will not behave correctly.
    ## Caveats diff --git a/packages/clay-drop-down/docs/drop-down/markup.mdx b/packages/clay-drop-down/docs/drop-down/markup.mdx index d4997f36cf..9bf0813594 100644 --- a/packages/clay-drop-down/docs/drop-down/markup.mdx +++ b/packages/clay-drop-down/docs/drop-down/markup.mdx @@ -7,12 +7,11 @@ packageUse: "import DropDown from '@clayui/drop-down';" ---
    - This page uses Bootstrap's dropdown plugin which requires JQuery. Liferay - 7.4 no longer includes JQuery by default. We have included a standalone - dropdown plugin in 7.4, just replace the attribute{' '} - data-toggle="dropdown" with{' '} - data-toggle="liferay-dropdown" on the{' '} - dropdown-toggle. + This page uses Bootstrap's dropdown plugin which requires JQuery. Liferay 7.4 + no longer includes JQuery by default. We have included a standalone dropdown + plugin in 7.4, just replace the attribute data-toggle="dropdown"{' '} + with data-toggle="liferay-dropdown" on the{' '} + dropdown-toggle.
    ## Variations @@ -22,46 +21,42 @@ packageUse: "import DropDown from '@clayui/drop-down';" The default dropdown is a panel that does not support scrolling of the content inside it. Use this type when the number of options you want to offer is short or the panel is big enough to contain all the elements you want to use. ```html ``` @@ -70,270 +65,232 @@ The default dropdown is a panel that does not support scrolling of the content i Use `.dropdown-wide` with `.dropdown` to make the dropdown menu big. The default width is 500px.
    - +
    ```html
    -
    -
    -
    - - -
    - -
    - -
    -
    -
    +
    +
    +
    + + +
    + +
    + +
    +
    +
    ``` @@ -342,346 +299,306 @@ Use `.dropdown-wide` with `.dropdown` to make the dropdown menu big. The default Use `.dropdown-full` to create a dropdown menu as wide as its relative parent.
    - +
    ```html
    - +
    ``` ### Dropdown Menu Width Full
    - This is a separate component from `.dropdown-full`, use one or the other. + This is a separate component from `.dropdown-full`, use one or the other.
    The modifier class `dropdown-menu-width-full` on `dropdown-menu` makes the menu expand the full width of the page. This should be used with the Clay Drop Down plugin which renders the `dropdown-menu` as a direct child of the `body` element. ```html ``` ### Dropdown Menu Width Sm
    - This is a separate component from `.dropdown-wide`, use one or the other. + This is a separate component from `.dropdown-wide`, use one or the other.
    The modifier class `dropdown-menu-width-sm` on `dropdown-menu` makes the menu 500px wide. The `dropdown-menu` becomes 100% wide at screen sizes 767px and below. This should be used with the Clay Drop Down plugin which renders the `dropdown-menu` as a direct child of the `body` element.
    -
    - -
    +
    + +
    ```html ``` @@ -690,47 +607,45 @@ The modifier class `dropdown-menu-width-sm` on `dropdown-menu` makes the menu 50 The modifier class `dropdown-menu-width-shrink` on `dropdown-menu` makes the menu only be as wide as the text inside and maxes out at 240px wide. This forces `dropdown-item` text to be on one line.
    -
    - -
    +
    + +
    ```html ``` @@ -740,18 +655,16 @@ The modifier class `dropdown-menu-height-auto` on `dropdown-menu` removes the `m ```html ``` @@ -760,52 +673,52 @@ The modifier class `dropdown-menu-height-auto` on `dropdown-menu` removes the `m ### Dividers
    - +
    ```html ``` @@ -814,457 +727,426 @@ The modifier class `dropdown-menu-height-auto` on `dropdown-menu` removes the `m #### Checkbox or Radio
    -
    -
    -
      -
    • Filter by
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • -
    -
    -
    -
      -
    • Order by
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • -
    -
    -
    +
    +
    +
      +
    • Filter by
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    • +
    +
    +
    +
      +
    • Order by
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    • +
    +
    +
    ```html
      -
    • Filter by
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • +
    • Filter by
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
      -
    • Order by
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • -
    • -
      -
      - -
      -
      -
    • +
    • Order by
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    • +
    • +
      +
      + +
      +
      +
    ``` #### Search
    -
    -
      -
    • -
      -
      - - - - -
      -
      -
    • -
    • Filter by
    • -
    • -
      -
      - -
      -
      -
    • -
    -
    +
    +
      +
    • +
      +
      + + + + +
      +
      +
    • +
    • Filter by
    • +
    • +
      +
      + +
      +
      +
    • +
    +
    ```html
      -
    • -
      -
      - - - - -
      -
      -
    • -
    • Filter by
    • -
    • -
      -
      - -
      -
      -
    • +
    • +
      +
      + + + + +
      +
      +
    • +
    • Filter by
    • +
    • +
      +
      + +
      +
      +
    ``` #### Form Groups
    -
    - -
    +
    + +
    ```html
      -
    • - - -
    • -
    • Form Section
    • -
    • -
      - - -
      -
    • -
    • -
      - - -
      -
      - - -
      -
    • -
    • Order by
    • -
    • Author
    • -
    • - Title Entry -
    • +
    • + + +
    • +
    • Form Section
    • +
    • +
      + + +
      +
    • +
    • +
      + + +
      +
      + + +
      +
    • +
    • Order by
    • +
    • Author
    • +
    • + Title Entry +
    ``` @@ -1273,392 +1155,390 @@ The modifier class `dropdown-menu-height-auto` on `dropdown-menu` removes the `m #### Start ```html ``` #### End
    -
    - -
    +
    + +
    ```html ``` #### Start and End ```html ``` @@ -1667,430 +1547,362 @@ The modifier class `dropdown-menu-height-auto` on `dropdown-menu` removes the `m Make content expand to fill remaining space in a `dropdown-item` or create equally spaced content with a nested `.autofit-row`, `.autofit-col`, `.autofit-col-shrink`, and `.autofit-col-expand`. ```html ``` ### Keyboard Shortcuts
    -
    - -
    +
    + +
    ```html ``` @@ -2099,138 +1911,136 @@ Make content expand to fill remaining space in a `dropdown-item` or create equal Nest `
    ` inside a `.dropdown-menu` list item to create a scrollable dropdown. The maximum height is 200px on screen sizes 768px and above, on screen sizes 767px and below the overflow is handled by `.dropdown-menu`. ```html ``` @@ -2241,172 +2051,172 @@ A monospaced `dropdown-toggle` for a dropdown containing several actions, add `d ### Anchors ```html ``` ### Buttons ```html ``` @@ -2417,154 +2227,154 @@ A monospaced `dropdown-toggle` for a dropdown containing several actions, add `d Align a dropdown menu on the top or bottom side with classes `dropdown-menu`, `dropdown-menu-right`, `dropdown-menu-top`, or `dropdown-menu-top-right`.
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    ```html @@ -2685,198 +2495,186 @@ Align a dropdown menu on the top or bottom side with classes `dropdown-menu`, `d Add the `dropdown-menu-right-side`, `dropdown-menu-left-side`, `dropdown-menu-right-side-bottom`, or `dropdown-menu-left-side-bottom` class to a dropdown menu to align it with the right side, left side, bottom-right side, or bottom-left side of the dropdown menu trigger, respectively:
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    ```html @@ -3011,152 +2809,146 @@ Add the `dropdown-menu-right-side`, `dropdown-menu-left-side`, `dropdown-menu-ri You can also center the dropdown menu to its trigger with these four helper classes: `dropdown-menu-center`, `dropdown-menu-top-center`, `dropdown-menu-left-side-middle`, or `dropdown-menu-right-side-middle`.
    -
    - - -
    -
    - - -
    +
    + + +
    +
    + + +
    ```html
    - - + +
    - - + +
    ``` @@ -3165,131 +2957,127 @@ You can also center the dropdown menu to its trigger with these four helper clas To center the dropdown menu in browsers that don't support CSS transforms, set a negative `margin-left` equal to the width of the `dropdown-menu` divided by two. To vertically align left-side and right-side dropdown-menus, set a negative `margin-top` equal to the height of the dropdown-menu divided by two.
    -
    - - -
    -
    - - -
    +
    + + +
    +
    + + +
    ```html
    - - + +
    - - + +
    ``` diff --git a/packages/clay-empty-state/docs/empty-state.mdx b/packages/clay-empty-state/docs/empty-state.mdx index 8df807a426..c499f83303 100644 --- a/packages/clay-empty-state/docs/empty-state.mdx +++ b/packages/clay-empty-state/docs/empty-state.mdx @@ -18,18 +18,16 @@ import EmptyState from '@clayui/empty-state'; import Button from '@clayui/button'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
    - - - -
    -
    - ); + return ( + +
    + + + +
    +
    + ); } ``` @@ -42,22 +40,20 @@ import {Provider} from '@clayui/core'; import EmptyState from '@clayui/empty-state'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
    - -
    -
    - ); + return ( + +
    + +
    +
    + ); } ``` @@ -70,8 +66,8 @@ The property `imgSrcReducedMotion` is used to provide an alternate image if a us There is an accompanying property, `imgPropsReducedMotion`, where specific properties can be passed to the reduced motion `img` tag. If it is not defined, it uses the properties defined in `imgProps`.
    - To see the system's reduce motion setting in action, refer to the example in - the With Animation section. + To see the system's reduce motion setting in action, refer to the example in + the With Animation section.
    ```jsx preview @@ -79,21 +75,19 @@ import {Provider} from '@clayui/core'; import EmptyState from '@clayui/empty-state'; import React from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - return ( - -
    - -
    -
    - ); + return ( + +
    + +
    +
    + ); } ``` diff --git a/packages/clay-empty-state/docs/empty-state/markup.mdx b/packages/clay-empty-state/docs/empty-state/markup.mdx index d0d8be2af9..de5aa84fff 100644 --- a/packages/clay-empty-state/docs/empty-state/markup.mdx +++ b/packages/clay-empty-state/docs/empty-state/markup.mdx @@ -7,231 +7,227 @@ packageUse: "import EmptyState from '@clayui/empty-state';" ---
    - The usage of animated GIFs are deprecated. + The usage of animated GIFs are deprecated.
    ## Without Animation
    -
    -
    - - No results found - -
    -
    - Sorry, there are no results found -
    -
    - -
    -
    +
    +
    + + No results found + +
    +
    Sorry, there are no results found
    +
    + +
    +
    ```html
    -
    - - No results found - -
    -
    Sorry, there are no results found
    -
    - -
    +
    + + No results found + +
    +
    Sorry, there are no results found
    +
    + +
    ``` ## Empty State
    -
    -
    -
    - empty-state-image -
    -
    -
    - - No results found - -
    -
    - Sorry, there are no results found -
    -
    - -
    -
    +
    +
    +
    + empty-state-image +
    +
    +
    + + No results found + +
    +
    Sorry, there are no results found
    +
    + +
    +
    ```html
    -
    -
    - empty-state-image -
    -
    -
    - No results found -
    -
    Sorry, there are no results found
    -
    - -
    +
    +
    + empty-state-image +
    +
    +
    + No results found +
    +
    Sorry, there are no results found
    +
    + +
    ``` ## Search State
    -
    -
    -
    - empty-state-image -
    -
    -
    - - No content yet - -
    -
    - This is a description of what the button will allow you to do -
    -
    +
    +
    +
    + empty-state-image +
    +
    +
    + + No content yet + +
    +
    + This is a description of what the button will allow you to do +
    +
    ```html
    -
    -
    - empty-state-image -
    -
    -
    - - No content yet - -
    -
    - This is a description of what the button will allow you to do -
    +
    +
    + empty-state-image +
    +
    +
    + + No content yet + +
    +
    + This is a description of what the button will allow you to do +
    ``` ## Success State
    -
    -
    -
    - empty-state-image -
    -
    -
    - - Hurray - -
    -
    - You don't have more notifications to review -
    -
    +
    +
    +
    + empty-state-image +
    +
    +
    + + Hurray + +
    +
    + You don't have more notifications to review +
    +
    ```html
    -
    -
    - empty-state-image -
    -
    -
    - Hurray -
    -
    - You don't have more notifications to review -
    +
    +
    + empty-state-image +
    +
    +
    + Hurray +
    +
    + You don't have more notifications to review +
    ``` ## With imageProps
    -
    -
    -
    - Alternative Text -
    -
    -
    - - Hurray - -
    -
    - You don't have more notifications to review -
    -
    +
    +
    +
    + Alternative Text +
    +
    +
    + + Hurray + +
    +
    + You don't have more notifications to review +
    +
    ```html
    -
    -
    - Alternative Text -
    -
    -
    - Hurray -
    -
    - You don't have more notifications to review -
    +
    +
    + Alternative Text +
    +
    +
    + Hurray +
    +
    + You don't have more notifications to review +
    ``` diff --git a/packages/clay-form/docs/checkbox.mdx b/packages/clay-form/docs/checkbox.mdx index e74e1f2eed..646024a3ad 100644 --- a/packages/clay-form/docs/checkbox.mdx +++ b/packages/clay-form/docs/checkbox.mdx @@ -17,21 +17,19 @@ import {Provider} from '@clayui/core'; import {ClayCheckbox} from '@clayui/form'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
    - setValue((val) => !val)} - /> -
    -
    - ); + const [value, setValue] = useState(false); + + return ( + +
    + setValue((val) => !val)} + /> +
    +
    + ); } ``` @@ -46,27 +44,25 @@ import {Provider} from '@clayui/core'; import {ClayCheckbox} from '@clayui/form'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - const data = { - id: 'test', - }; - - return ( - -
    - setValue((val) => !val)} - /> -
    -
    - ); + const [value, setValue] = useState(false); + + const data = { + id: 'test', + }; + + return ( + +
    + setValue((val) => !val)} + /> +
    +
    + ); } ``` @@ -79,23 +75,21 @@ import {Provider} from '@clayui/core'; import {ClayCheckbox} from '@clayui/form'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
    - setValue((val) => !val)} - label="Option 1" - /> -
    -
    - ); + const [value, setValue] = useState(false); + + return ( + +
    + setValue((val) => !val)} + label="Option 1" + /> +
    +
    + ); } ``` @@ -108,40 +102,38 @@ import {Provider} from '@clayui/core'; import {ClayCheckbox} from '@clayui/form'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
    - <> - setValue((val) => !val)} - label="Option 1" - inline - /> - setValue((val) => !val)} - label="Option 2" - inline - /> - setValue((val) => !val)} - label="Option 3" - inline - /> - -
    -
    - ); + const [value, setValue] = useState(false); + + return ( + +
    + <> + setValue((val) => !val)} + label="Option 1" + inline + /> + setValue((val) => !val)} + label="Option 2" + inline + /> + setValue((val) => !val)} + label="Option 3" + inline + /> + +
    +
    + ); } ``` @@ -154,22 +146,20 @@ import {Provider} from '@clayui/core'; import {ClayCheckbox} from '@clayui/form'; import React, {useState} from 'react'; -import '@clayui/css/lib/css/atlas.css'; - export default function App() { - const [value, setValue] = useState(false); - - return ( - -
    - setValue((val) => !val)} - indeterminate - /> -
    -
    - ); + const [value, setValue] = useState(false); + + return ( + +
    + setValue((val) => !val)} + indeterminate + /> +
    +
    + ); } ``` diff --git a/packages/clay-form/docs/checkbox/markup.mdx b/packages/clay-form/docs/checkbox/markup.mdx index 08a328a5d0..743b6c26b8 100644 --- a/packages/clay-form/docs/checkbox/markup.mdx +++ b/packages/clay-form/docs/checkbox/markup.mdx @@ -8,9 +8,9 @@ storybookPath: 'design-system-components-checkbox' ---
    - Don't forget to check - [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#checkbox) accessibility - pratices for checkboxes when writting your markup. + Don't forget to check + [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#checkbox) accessibility + pratices for checkboxes when writting your markup.
    Default checkboxes and radios are improved upon with the help of `.form-check`, **a single class for both input types that improves the layout and behavior of their HTML elements**. Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many. @@ -23,138 +23,138 @@ By default, any number of checkboxes and radios that are immediate sibling will ### Checkboxes
    -
    - - -
    -
    - - -
    +
    + + +
    +
    + + +
    ```html
    - - + +
    - - + +
    ``` ### Radios
    -
    - - -
    -
    - - -
    -
    - - -
    +
    + + +
    +
    + + +
    +
    + + +
    ```html
    - - + +
    - - + +
    - - + +
    ``` @@ -165,112 +165,112 @@ Group checkboxes or radios on the same horizontal row by adding `.form-check-inl ### Checkbox
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    ```html
    - +
    - +
    ``` ### Radio
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    ```html
    - +
    - +
    ``` @@ -279,70 +279,70 @@ Group checkboxes or radios on the same horizontal row by adding `.form-check-inl Disable checkboxes or radios by adding a `disabled` prop.
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    ```html
    - +
    - +
    ``` @@ -351,48 +351,48 @@ Disable checkboxes or radios by adding a `disabled` prop. Remember to still provide some form of label for assistive technologies (for instance, using `aria-label`).
    -
    - -
    -
    - -
    +
    + +
    +
    + +
    ```html
    - +
    - +
    ``` @@ -404,18 +404,14 @@ It is packaged in a classless `
    ``` @@ -423,48 +419,44 @@ Using the `id` binding engine with `