From a56131a8dba35d056cd51bceb9be798ca145358a Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Thu, 1 Sep 2022 14:16:31 -0400 Subject: [PATCH 1/5] dosc(avatar): add component playgrounds --- docs/api/avatar.md | 181 ++---------------- static/usage/avatar/basic/angular.md | 5 + static/usage/avatar/basic/demo.html | 27 +++ static/usage/avatar/basic/index.md | 8 + static/usage/avatar/basic/javascript.md | 5 + static/usage/avatar/basic/react.md | 15 ++ static/usage/avatar/basic/vue.md | 16 ++ static/usage/avatar/chip/angular.md | 8 + static/usage/avatar/chip/demo.html | 30 +++ static/usage/avatar/chip/index.md | 8 + static/usage/avatar/chip/javascript.md | 8 + static/usage/avatar/chip/react.md | 17 ++ static/usage/avatar/chip/vue.md | 19 ++ static/usage/avatar/item/angular.md | 8 + static/usage/avatar/item/demo.html | 30 +++ static/usage/avatar/item/index.md | 8 + static/usage/avatar/item/javascript.md | 8 + static/usage/avatar/item/react.md | 17 ++ static/usage/avatar/item/vue.md | 19 ++ .../avatar/theming/angular/angular-css.md | 5 + .../avatar/theming/angular/angular-html.md | 5 + static/usage/avatar/theming/demo.html | 32 ++++ static/usage/avatar/theming/index.md | 32 ++++ static/usage/avatar/theming/javascript.md | 11 ++ static/usage/avatar/theming/react.md | 20 ++ .../usage/avatar/theming/react/react-css.md | 5 + .../usage/avatar/theming/react/react-tsx.md | 18 ++ static/usage/avatar/theming/vue.md | 22 +++ 28 files changed, 419 insertions(+), 168 deletions(-) create mode 100644 static/usage/avatar/basic/angular.md create mode 100644 static/usage/avatar/basic/demo.html create mode 100644 static/usage/avatar/basic/index.md create mode 100644 static/usage/avatar/basic/javascript.md create mode 100644 static/usage/avatar/basic/react.md create mode 100644 static/usage/avatar/basic/vue.md create mode 100644 static/usage/avatar/chip/angular.md create mode 100644 static/usage/avatar/chip/demo.html create mode 100644 static/usage/avatar/chip/index.md create mode 100644 static/usage/avatar/chip/javascript.md create mode 100644 static/usage/avatar/chip/react.md create mode 100644 static/usage/avatar/chip/vue.md create mode 100644 static/usage/avatar/item/angular.md create mode 100644 static/usage/avatar/item/demo.html create mode 100644 static/usage/avatar/item/index.md create mode 100644 static/usage/avatar/item/javascript.md create mode 100644 static/usage/avatar/item/react.md create mode 100644 static/usage/avatar/item/vue.md create mode 100644 static/usage/avatar/theming/angular/angular-css.md create mode 100644 static/usage/avatar/theming/angular/angular-html.md create mode 100644 static/usage/avatar/theming/demo.html create mode 100644 static/usage/avatar/theming/index.md create mode 100644 static/usage/avatar/theming/javascript.md create mode 100644 static/usage/avatar/theming/react.md create mode 100644 static/usage/avatar/theming/react/react-css.md create mode 100644 static/usage/avatar/theming/react/react-tsx.md create mode 100644 static/usage/avatar/theming/vue.md diff --git a/docs/api/avatar.md b/docs/api/avatar.md index 86fb904812a..e7a005fa719 100644 --- a/docs/api/avatar.md +++ b/docs/api/avatar.md @@ -1,11 +1,6 @@ --- title: "ion-avatar" -hide_table_of_contents: true -demoUrl: "/docs/demos/api/avatar/index.html" -demoSourceUrl: "https://github.com/ionic-team/ionic-docs/tree/main/static/demos/api/avatar/index.html" --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; import Props from '@site/static/auto-generated/avatar/props.md'; import Events from '@site/static/auto-generated/avatar/events.md'; @@ -20,186 +15,36 @@ import Slots from '@site/static/auto-generated/avatar/slots.md'; import EncapsulationPill from '@components/page/api/EncapsulationPill'; -import APITOCInline from '@components/page/api/APITOCInline'; -

Contents

- - - - - Avatars are circular components that usually wrap an image or icon. They can be used to represent a person or an object. Avatars can be used by themselves or inside of any element. If placed inside of an `ion-chip` or `ion-item`, the avatar will resize to fit the parent component. To position an avatar on the left or right side of an item, set the slot to `start` or `end`, respectively. +## Basic +import Basic from '@site/static/usage/avatar/basic/index.md'; + -## Usage +## Chip Avatar - +import Chip from '@site/static/usage/avatar/chip/index.md'; - + -```html - - - +## Item Avatar - - - - - Chip Avatar - - - - - - - Item Avatar - -``` +import Item from '@site/static/usage/avatar/item/index.md'; - + +## Theming - +import Theming from '@site/static/usage/avatar/theming/index.md'; -```html - - - - - - - - - Chip Avatar - - - - - - - Item Avatar - -``` - - - - - - -```tsx -import React from 'react'; -import { IonAvatar, IonChip, IonItem, IonLabel, IonContent } from '@ionic/react'; - -export const AvatarExample: React.FC = () => ( - - - - - - - - - - Chip Avatar - - - - - - - Item Avatar - - -); -``` - - - - - - -```tsx -import { Component, h } from '@stencil/core'; - -@Component({ - tag: 'avatar-example', - styleUrl: 'avatar-example.css' -}) -export class AvatarExample { - render() { - return [ - - - , - - - - - - Chip Avatar - , - - - - - - Item Avatar - - ]; - } -} -``` - - - - - - -```html - - - -``` - - - - + ## Properties @@ -217,4 +62,4 @@ export default defineComponent({ ## Slots - \ No newline at end of file + diff --git a/static/usage/avatar/basic/angular.md b/static/usage/avatar/basic/angular.md new file mode 100644 index 00000000000..e3ccf947b3b --- /dev/null +++ b/static/usage/avatar/basic/angular.md @@ -0,0 +1,5 @@ +```html + + + +``` diff --git a/static/usage/avatar/basic/demo.html b/static/usage/avatar/basic/demo.html new file mode 100644 index 00000000000..d6225f09842 --- /dev/null +++ b/static/usage/avatar/basic/demo.html @@ -0,0 +1,27 @@ + + + + + + + Avatar + + + + + + + + + + +
+ + + +
+
+
+ + + diff --git a/static/usage/avatar/basic/index.md b/static/usage/avatar/basic/index.md new file mode 100644 index 00000000000..5c31f3f5306 --- /dev/null +++ b/static/usage/avatar/basic/index.md @@ -0,0 +1,8 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; +import react from './react.md'; +import vue from './vue.md'; +import angular from './angular.md'; + + diff --git a/static/usage/avatar/basic/javascript.md b/static/usage/avatar/basic/javascript.md new file mode 100644 index 00000000000..e3ccf947b3b --- /dev/null +++ b/static/usage/avatar/basic/javascript.md @@ -0,0 +1,5 @@ +```html + + + +``` diff --git a/static/usage/avatar/basic/react.md b/static/usage/avatar/basic/react.md new file mode 100644 index 00000000000..bb27eded1f9 --- /dev/null +++ b/static/usage/avatar/basic/react.md @@ -0,0 +1,15 @@ +```tsx +import React from 'react'; +import { IonAvatar } from '@ionic/react'; + +function Example() { + return ( + <> + + + + + ); +} +export default Example; +``` diff --git a/static/usage/avatar/basic/vue.md b/static/usage/avatar/basic/vue.md new file mode 100644 index 00000000000..8c52bbd218e --- /dev/null +++ b/static/usage/avatar/basic/vue.md @@ -0,0 +1,16 @@ +```html + + + +``` diff --git a/static/usage/avatar/chip/angular.md b/static/usage/avatar/chip/angular.md new file mode 100644 index 00000000000..5acbe12c940 --- /dev/null +++ b/static/usage/avatar/chip/angular.md @@ -0,0 +1,8 @@ +```html + + + + + Chip Avatar + +``` diff --git a/static/usage/avatar/chip/demo.html b/static/usage/avatar/chip/demo.html new file mode 100644 index 00000000000..07ea3911c49 --- /dev/null +++ b/static/usage/avatar/chip/demo.html @@ -0,0 +1,30 @@ + + + + + + + Avatar + + + + + + + + + + +
+ + + + + Chip Avatar + +
+
+
+ + + diff --git a/static/usage/avatar/chip/index.md b/static/usage/avatar/chip/index.md new file mode 100644 index 00000000000..2acfeb4b578 --- /dev/null +++ b/static/usage/avatar/chip/index.md @@ -0,0 +1,8 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; +import react from './react.md'; +import vue from './vue.md'; +import angular from './angular.md'; + + diff --git a/static/usage/avatar/chip/javascript.md b/static/usage/avatar/chip/javascript.md new file mode 100644 index 00000000000..5acbe12c940 --- /dev/null +++ b/static/usage/avatar/chip/javascript.md @@ -0,0 +1,8 @@ +```html + + + + + Chip Avatar + +``` diff --git a/static/usage/avatar/chip/react.md b/static/usage/avatar/chip/react.md new file mode 100644 index 00000000000..3a7fe5ea297 --- /dev/null +++ b/static/usage/avatar/chip/react.md @@ -0,0 +1,17 @@ +```tsx +import React from 'react'; +import { IonAvatar, IonChip, IonLabel } from '@ionic/react'; +function Example() { + return ( + <> + + + + + Chip Avatar + + + ); +} +export default Example; +``` diff --git a/static/usage/avatar/chip/vue.md b/static/usage/avatar/chip/vue.md new file mode 100644 index 00000000000..0a53d354695 --- /dev/null +++ b/static/usage/avatar/chip/vue.md @@ -0,0 +1,19 @@ +```html + + + +``` diff --git a/static/usage/avatar/item/angular.md b/static/usage/avatar/item/angular.md new file mode 100644 index 00000000000..d62beaf7585 --- /dev/null +++ b/static/usage/avatar/item/angular.md @@ -0,0 +1,8 @@ +```html + + + + + Item Avatar + +``` diff --git a/static/usage/avatar/item/demo.html b/static/usage/avatar/item/demo.html new file mode 100644 index 00000000000..2fa12cc176f --- /dev/null +++ b/static/usage/avatar/item/demo.html @@ -0,0 +1,30 @@ + + + + + + + Avatar + + + + + + + + + + +
+ + + + + Item Avatar + +
+
+
+ + + diff --git a/static/usage/avatar/item/index.md b/static/usage/avatar/item/index.md new file mode 100644 index 00000000000..43630dba17e --- /dev/null +++ b/static/usage/avatar/item/index.md @@ -0,0 +1,8 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; +import react from './react.md'; +import vue from './vue.md'; +import angular from './angular.md'; + + diff --git a/static/usage/avatar/item/javascript.md b/static/usage/avatar/item/javascript.md new file mode 100644 index 00000000000..d62beaf7585 --- /dev/null +++ b/static/usage/avatar/item/javascript.md @@ -0,0 +1,8 @@ +```html + + + + + Item Avatar + +``` diff --git a/static/usage/avatar/item/react.md b/static/usage/avatar/item/react.md new file mode 100644 index 00000000000..6ca08a3b506 --- /dev/null +++ b/static/usage/avatar/item/react.md @@ -0,0 +1,17 @@ +```tsx +import React from 'react'; +import { IonAvatar, IonItem, IonLabel } from '@ionic/react'; +function Example() { + return ( + <> + + + + + Item Avatar + + + ); +} +export default Example; +``` diff --git a/static/usage/avatar/item/vue.md b/static/usage/avatar/item/vue.md new file mode 100644 index 00000000000..4a2d22dc035 --- /dev/null +++ b/static/usage/avatar/item/vue.md @@ -0,0 +1,19 @@ +```html + + + +``` diff --git a/static/usage/avatar/theming/angular/angular-css.md b/static/usage/avatar/theming/angular/angular-css.md new file mode 100644 index 00000000000..5a97e1fc6ae --- /dev/null +++ b/static/usage/avatar/theming/angular/angular-css.md @@ -0,0 +1,5 @@ +```css +ion-avatar { + --border-radius: 4px; +} +``` diff --git a/static/usage/avatar/theming/angular/angular-html.md b/static/usage/avatar/theming/angular/angular-html.md new file mode 100644 index 00000000000..e3ccf947b3b --- /dev/null +++ b/static/usage/avatar/theming/angular/angular-html.md @@ -0,0 +1,5 @@ +```html + + + +``` diff --git a/static/usage/avatar/theming/demo.html b/static/usage/avatar/theming/demo.html new file mode 100644 index 00000000000..5681d43e6be --- /dev/null +++ b/static/usage/avatar/theming/demo.html @@ -0,0 +1,32 @@ + + + + + + + Avatar + + + + + + + + + + + +
+ + + +
+
+
+ + + diff --git a/static/usage/avatar/theming/index.md b/static/usage/avatar/theming/index.md new file mode 100644 index 00000000000..af3b37d8532 --- /dev/null +++ b/static/usage/avatar/theming/index.md @@ -0,0 +1,32 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; + +import reactTSX from './react/react-tsx.md'; +import reactCSS from './react/react-css.md'; + +import vue from './vue.md'; + +import angularHTML from './angular/angular-html.md'; +import angularCSS from './angular/angular-css.md'; + + diff --git a/static/usage/avatar/theming/javascript.md b/static/usage/avatar/theming/javascript.md new file mode 100644 index 00000000000..ab0223d5dcb --- /dev/null +++ b/static/usage/avatar/theming/javascript.md @@ -0,0 +1,11 @@ +```html + + + + + +``` diff --git a/static/usage/avatar/theming/react.md b/static/usage/avatar/theming/react.md new file mode 100644 index 00000000000..53f534195ee --- /dev/null +++ b/static/usage/avatar/theming/react.md @@ -0,0 +1,20 @@ +```tsx +import React from 'react'; +import { IonAvatar, IonItem, IonLabel } from '@ionic/react'; + +import './main.css'; + +function Example() { + return ( + <> + + + + + Item Avatar + + + ); +} +export default Example; +``` diff --git a/static/usage/avatar/theming/react/react-css.md b/static/usage/avatar/theming/react/react-css.md new file mode 100644 index 00000000000..5a97e1fc6ae --- /dev/null +++ b/static/usage/avatar/theming/react/react-css.md @@ -0,0 +1,5 @@ +```css +ion-avatar { + --border-radius: 4px; +} +``` diff --git a/static/usage/avatar/theming/react/react-tsx.md b/static/usage/avatar/theming/react/react-tsx.md new file mode 100644 index 00000000000..9620ab43d94 --- /dev/null +++ b/static/usage/avatar/theming/react/react-tsx.md @@ -0,0 +1,18 @@ + +```tsx +import React from 'react'; +import { IonAvatar } from '@ionic/react'; + +import './main.css'; + +function Example() { + return ( + <> + + + + + ); +} +export default Example; +``` diff --git a/static/usage/avatar/theming/vue.md b/static/usage/avatar/theming/vue.md new file mode 100644 index 00000000000..df9372ffa92 --- /dev/null +++ b/static/usage/avatar/theming/vue.md @@ -0,0 +1,22 @@ +```html + + + + + +``` From c19da7af253782b53f3fb078f8931a539de52d64 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Thu, 1 Sep 2022 14:16:52 -0400 Subject: [PATCH 2/5] docs(chip): update avatar URL to match avatar demos --- static/usage/chip/slots/angular.md | 2 +- static/usage/chip/slots/demo.html | 2 +- static/usage/chip/slots/javascript.md | 2 +- static/usage/chip/slots/react.md | 2 +- static/usage/chip/slots/vue.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/usage/chip/slots/angular.md b/static/usage/chip/slots/angular.md index 6387a0e55ba..0013a8297f4 100644 --- a/static/usage/chip/slots/angular.md +++ b/static/usage/chip/slots/angular.md @@ -1,7 +1,7 @@ ```html - + Avatar Chip diff --git a/static/usage/chip/slots/demo.html b/static/usage/chip/slots/demo.html index fd3f22a72df..f83fcba81b0 100644 --- a/static/usage/chip/slots/demo.html +++ b/static/usage/chip/slots/demo.html @@ -18,7 +18,7 @@
- + Avatar Chip diff --git a/static/usage/chip/slots/javascript.md b/static/usage/chip/slots/javascript.md index 6387a0e55ba..0013a8297f4 100644 --- a/static/usage/chip/slots/javascript.md +++ b/static/usage/chip/slots/javascript.md @@ -1,7 +1,7 @@ ```html - + Avatar Chip diff --git a/static/usage/chip/slots/react.md b/static/usage/chip/slots/react.md index 25fd0d192b1..89163651806 100644 --- a/static/usage/chip/slots/react.md +++ b/static/usage/chip/slots/react.md @@ -8,7 +8,7 @@ function Example() { <> - + Avatar Chip diff --git a/static/usage/chip/slots/vue.md b/static/usage/chip/slots/vue.md index 29e12166788..fba86728e52 100644 --- a/static/usage/chip/slots/vue.md +++ b/static/usage/chip/slots/vue.md @@ -2,7 +2,7 @@