From 7ff79c97b97e052b6735f44077dfb408fd015584 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Thu, 6 Mar 2025 10:24:29 -0800 Subject: [PATCH] migrated, updated BodyText --- src/components/BodyText/BodyText.mdx | 66 ++++++++++ .../BodyText/BodyText.stories.svelte | 119 ++---------------- src/components/BodyText/BodyText.svelte | 27 ++-- .../BodyText/stories/docs/component.md | 46 ------- 4 files changed, 85 insertions(+), 173 deletions(-) create mode 100644 src/components/BodyText/BodyText.mdx delete mode 100644 src/components/BodyText/stories/docs/component.md diff --git a/src/components/BodyText/BodyText.mdx b/src/components/BodyText/BodyText.mdx new file mode 100644 index 00000000..660719cf --- /dev/null +++ b/src/components/BodyText/BodyText.mdx @@ -0,0 +1,66 @@ +import { Meta, Canvas } from '@storybook/blocks'; + +import * as BodyTextStories from './BodyText.stories.svelte'; + + + +# BodyText + +The `BodyText` creates the main text of +your page. You can pass the `text` prop a +[markdown-formatted](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) +string, which will be parsed into paragraphs, headers, lists, blockquotes or +whatever else you need. + +Use it like this: + +```svelte + + + +``` + +... or more commonly, you'll use it with a **ArchieML doc** in the **Graphics Kit** like this: + +```yaml +# Archie ML doc +[blocks] + +type: text +text: Lorem ipsum ... + +... etc. +:end + +[] +``` + +```svelte + + + +# Graphics Kit +{#each content.blocks as block} + {#if block.type === 'text'} + + + {/if} +{/each} +``` + +### Typography and styling + +{/* Add link to components-text-elements-bodytext--typography-sample */} +You can also style the typography by adding CSS and markdown annotations such as `##`, like in this [example](/story/components-text-elements-bodytext--typography-sample). diff --git a/src/components/BodyText/BodyText.stories.svelte b/src/components/BodyText/BodyText.stories.svelte index 9bc698ed..965113ed 100644 --- a/src/components/BodyText/BodyText.stories.svelte +++ b/src/components/BodyText/BodyText.stories.svelte @@ -1,30 +1,16 @@ - - - - - - - diff --git a/src/components/BodyText/BodyText.svelte b/src/components/BodyText/BodyText.svelte index 46ac7256..fca78da8 100644 --- a/src/components/BodyText/BodyText.svelte +++ b/src/components/BodyText/BodyText.svelte @@ -1,24 +1,19 @@ - - + diff --git a/src/components/BodyText/stories/docs/component.md b/src/components/BodyText/stories/docs/component.md deleted file mode 100644 index 2a3fe288..00000000 --- a/src/components/BodyText/stories/docs/component.md +++ /dev/null @@ -1,46 +0,0 @@ -The `BodyText` creates the main text of your page. You can pass the `text` prop a [markdown-formatted](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) string, which will be parsed into paragraphs, headers, lists, blockquotes or whatever else you need. - -Use it like this: - -```svelte - - - -``` - -... or more commonly, you'll use it with a ArchieML doc in the Graphics Kit like this: - -```yaml -[blocks] - -type: text -text: Lorem ipsum ... - -... etc. -:end - -[] -``` - -```svelte - - -{#each content.blocks as block} - {#if block.type === 'text'} - - - {/if} -{/each} -```