From c562040741f5f2d6b7887fbec4d09a77961d17bc Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 30 May 2024 13:55:38 +0200 Subject: [PATCH] docs: add stories to test out different layouts and markdown --- .../property-layout.stories.ts | 119 ++++++++++++++++-- 1 file changed, 109 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.stories.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.stories.ts index 9bc6df0a3f..85d2e5c65a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.stories.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.stories.ts @@ -1,19 +1,118 @@ -import type { Meta, Story } from '@storybook/web-components'; +import type { Meta, StoryObj } from '@storybook/web-components'; import type { UmbPropertyLayoutElement } from './property-layout.element.js'; import { html } from '@umbraco-cms/backoffice/external/lit'; import './property-layout.element.js'; -export default { +const meta: Meta = { title: 'Workspaces/Property Layout', - component: 'umb-property-layout', id: 'umb-property-layout', -} as Meta; + component: 'umb-property-layout', + args: { + alias: 'Umb.PropertyLayout.Text', + label: 'Text', + description: 'Description', + orientation: 'horizontal', + }, + argTypes: { + orientation: { + options: ['horizontal', 'vertical'], + }, + }, + render: (storyObj) => { + return html` + +
Action Menu
+
Editor
+
+ `; + }, + parameters: { + docs: { + source: { + code: ` + +
Action Menu
+
Editor
+
+ `, + }, + }, + }, +}; -export const AAAOverview: Story = () => - html` -
Action Menu
+export default meta; +type Story = StoryObj; -
Editor
-
`; -AAAOverview.storyName = 'Overview'; +export const Overview: Story = {}; + +export const Vertical: Story = { + args: { + orientation: 'vertical', + }, + render: (storyObj) => { + return html` + + + + `; + }, +}; + +export const WithInvalid: Story = { + args: { + invalid: true, + }, +}; + +export const WithMarkdown: Story = { + decorators: [(story) => html`
${story()}
`], + args: { + alias: 'Umb.PropertyLayout.Markdown', + label: 'Markdown', + description: ` +# Markdown +This is a markdown description + +## Subtitle +- List item 1 +- List item 2 + +### Sub subtitle +1. Numbered list item 1 +2. Numbered list item 2 + +\`\`\`html + +
+
+ +\`\`\` + +> Blockquote + +**Bold text** + +*Italic text* + +[Link](https://umbraco.com) + +![Image](https://umbraco.com/media/sybjwfmh/umbraco-support-working.webp?anchor=center&mode=crop&width=870&height=628&rnd=133425316954430000&quality=80&format=webp&format=webp) + +
+Read more +Details content +
+ `, + }, +};