From a74c0eef6ef62276a971ee13a5200cb3c70e4c81 Mon Sep 17 00:00:00 2001 From: rinaok Date: Tue, 2 Nov 2021 17:03:52 +0200 Subject: [PATCH] feat(usage-examples): add example with top bar fixed (#1113) * Side Drawer with Top App Bar Fixed * Side Drawer With Top App Bar Fixed Template * controls * duplications * WithSideDrawer * With Side Drawer And Top App Bar Fixed * semantic fixes * semantic fixes * vwc-layout --- .../side-drawer-as-container.stories.js | 42 +++---- .../top-app-bar-as-container.stories.js | 116 ++++++++++++++++++ 2 files changed, 135 insertions(+), 23 deletions(-) create mode 100644 docs/stories/getting-started/usage-examples/top-app-bar-as-container.stories.js diff --git a/docs/stories/getting-started/usage-examples/side-drawer-as-container.stories.js b/docs/stories/getting-started/usage-examples/side-drawer-as-container.stories.js index 1785809a4..0e93b6b25 100644 --- a/docs/stories/getting-started/usage-examples/side-drawer-as-container.stories.js +++ b/docs/stories/getting-started/usage-examples/side-drawer-as-container.stories.js @@ -6,6 +6,7 @@ import '@vonage/vwc-layout'; import '@vonage/vwc-list'; import '@vonage/vwc-list/vwc-list-item'; import '@vonage/vwc-list/vwc-list-expansion-panel'; +import '@vonage/vwc-text'; import { html } from 'lit-element'; import { spread } from '@open-wc/lit-helpers'; @@ -39,10 +40,6 @@ const style = html` .sb-show-main.sb-main-padded { padding: 0; } - p { - color: "#C0C0C0"; - font-weight: "bold"; - } vwc-side-drawer#side-drawer{ --side-drawer-background-color: var(--vvd-color-neutral-10); } @@ -62,7 +59,7 @@ const loremIpsum = () => html` `; -const content = () => Array(8).fill().map(loremIpsum); +const content = () => Array(20).fill().map(loremIpsum); const sideDrawerContent = html` @@ -73,9 +70,9 @@ const sideDrawerContent = html` 1st level item - -

SECTION TITLE

- +

+ SECTION TITLE +

1st level item @@ -90,9 +87,9 @@ const sideDrawerContent = html` 3rd level item - -

SECTION TITLE

- +

+ SECTION TITLE +

1st level item @@ -103,15 +100,7 @@ const sideDrawerContent = html` `; const topAppBarContent = html` - - - - - -`; - -const topAppBarFixedContent = html` - +
@@ -121,7 +110,15 @@ const topAppBarFixedContent = html` - +
+`; + +const topAppBarFixedContent = html` +
+ + + +
`; const WithAppContentTemplate = args => html` @@ -155,13 +152,12 @@ const WithTopAppBarTemplate = args => html` export const WithTopAppBar = WithTopAppBarTemplate.bind({}); WithTopAppBar.args = {}; - const WithTopAppBarFixedTemplate = args => html` ${style} ${sideDrawerContent} - + ${topAppBarFixedContent}
${content()} diff --git a/docs/stories/getting-started/usage-examples/top-app-bar-as-container.stories.js b/docs/stories/getting-started/usage-examples/top-app-bar-as-container.stories.js new file mode 100644 index 000000000..ddbbea7c6 --- /dev/null +++ b/docs/stories/getting-started/usage-examples/top-app-bar-as-container.stories.js @@ -0,0 +1,116 @@ +import '@vonage/vwc-side-drawer'; +import '@vonage/vwc-top-app-bar'; +import '@vonage/vwc-top-app-bar-fixed'; +import '@vonage/vwc-icon'; +import '@vonage/vwc-layout'; +import '@vonage/vwc-list'; +import '@vonage/vwc-list/vwc-list-item'; +import '@vonage/vwc-list/vwc-list-expansion-panel'; +import '@vonage/vwc-text'; + +import { html } from 'lit-element'; +import { spread } from '@open-wc/lit-helpers'; + +export default { + title: 'Getting Started/Usage Examples/Top App Bar', +}; + +const style = html` + +`; + +const loremIpsum = () => html` + +
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's + standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make + a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, + remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing + Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions + of Lorem Ipsum. +
+
+`; + +const content = () => Array(20).fill().map(loremIpsum); + +const listItems = () => html` + + 1st level item + +

+ SECTION TITLE +

+ + + 1st level item + + + 2nd level item + 3rd level item + 3rd level item + + +`; + +const sideDrawerContent = html` + + + VONAGE + + + + 1st level item + +

+ SECTION TITLE +

+ ${Array(8).fill().map(listItems)} +
`; + +const topAppBarFixedContent = html` + +
+ + + +
+`; + +const WithSideDrawerAndTopAppBarTemplate = args => html` + ${style} + + ${topAppBarFixedContent} + + ${sideDrawerContent} +
${content()}
+
+
+`; + +export const WithSideDrawerAndTopAppBar = WithSideDrawerAndTopAppBarTemplate.bind({}); +WithSideDrawerAndTopAppBar.args = {}; + +const WithSideDrawerAndTopAppBarFixedTemplate = args => html` + ${style} + + ${topAppBarFixedContent} + + ${sideDrawerContent} +
${content()}
+
+
+`; + +export const WithSideDrawerAndTopAppBarFixed = WithSideDrawerAndTopAppBarFixedTemplate.bind({}); +WithSideDrawerAndTopAppBarFixed.args = {}; +