+
+
+ %sveltekit.head%
+
+
+ %sveltekit.body%
+
+
\ No newline at end of file
diff --git a/src/components/AdSlot/stories/docs/inline.md b/src/components/AdSlot/InlineAd.mdx
similarity index 78%
rename from src/components/AdSlot/stories/docs/inline.md
rename to src/components/AdSlot/InlineAd.mdx
index abac191c..5be76a80 100644
--- a/src/components/AdSlot/stories/docs/inline.md
+++ b/src/components/AdSlot/InlineAd.mdx
@@ -1,3 +1,11 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as InlineAdStories from './InlineAd.stories.svelte';
+
+
+
+# InlineAd
+
Add programmatic ads inline on your page.
> **IMPORTANT!** Make sure ads are only used on dotcom pages, never on embeds.
@@ -38,9 +46,11 @@ You may add **up to three** inline ads per page, but must set the `n` prop on mu
```svelte
-
+
-
+
-
+
```
+
+
diff --git a/src/components/AdSlot/InlineAd.stories.svelte b/src/components/AdSlot/InlineAd.stories.svelte
index baff62a7..cac455cb 100644
--- a/src/components/AdSlot/InlineAd.stories.svelte
+++ b/src/components/AdSlot/InlineAd.stories.svelte
@@ -1,27 +1,20 @@
-
-
-
+{#snippet template()}
-
+{/snippet}
-
+
diff --git a/src/components/AdSlot/InlineAd.svelte b/src/components/AdSlot/InlineAd.svelte
index 502b6619..6a0e8331 100644
--- a/src/components/AdSlot/InlineAd.svelte
+++ b/src/components/AdSlot/InlineAd.svelte
@@ -5,15 +5,16 @@
import type { InlineAd } from './@types/ads';
import ResponsiveAd from './ResponsiveAd.svelte';
- /** Add an ID to target with SCSS. */
- export let id: string = '';
+ interface Props {
+ /** Add an ID to target with SCSS. */
+ id?: string;
+ /** Number of the inline ad in sequence. Use to add multiple inline ads to a page. */
+ n?: 1 | 2 | 3 | '1' | '2' | '3';
+ /** Add a class to target with SCSS. Defaults to `my-12`. */
+ class?: string;
+ }
- /** Number of the inline ad in sequence. Use to add multiple inline ads to a page. */
- export let n: 1 | 2 | 3 | '1' | '2' | '3' = 1;
-
- /** Add a class to target with SCSS. */
- let cls: string = 'my-12';
- export { cls as class };
+ let { id = '', class: cls = 'my-12', n = 1 }: Props = $props();
const desktopPlacementName: InlineAd['desktop']['placementName'] = `reuters_desktop_native_${n}`;
diff --git a/src/components/AdSlot/stories/docs/leaderboard.md b/src/components/AdSlot/LeaderboardAd.mdx
similarity index 67%
rename from src/components/AdSlot/stories/docs/leaderboard.md
rename to src/components/AdSlot/LeaderboardAd.mdx
index b2c51125..a2550aac 100644
--- a/src/components/AdSlot/stories/docs/leaderboard.md
+++ b/src/components/AdSlot/LeaderboardAd.mdx
@@ -1,3 +1,11 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as LeaderboardAdStories from './LeaderboardAd.stories.svelte';
+
+
+
+# LeaderboardAd
+
Add a leaderboard ad to your page.
> **IMPORTANT!** Make sure ads are only used on dotcom pages, never on embeds.
@@ -19,3 +27,5 @@ Add a leaderboard ad to your page.
```
+
+
diff --git a/src/components/AdSlot/LeaderboardAd.stories.svelte b/src/components/AdSlot/LeaderboardAd.stories.svelte
index 754f4d3c..f86c4fc4 100644
--- a/src/components/AdSlot/LeaderboardAd.stories.svelte
+++ b/src/components/AdSlot/LeaderboardAd.stories.svelte
@@ -1,29 +1,22 @@
-
-
-
+{#snippet template()}
-
+{/snippet}
-
+
+```
+
+... or you can make your component entirely configurable within the article well doing something like this:
+
+```svelte
+
+
+
+
+
+
+
+```
+
+Here's an example of how custom\* `columnWidths` can be used to change the article well columns:
diff --git a/src/components/Article/Article.stories.svelte b/src/components/Article/Article.stories.svelte
index ed06940c..c0683455 100644
--- a/src/components/Article/Article.stories.svelte
+++ b/src/components/Article/Article.stories.svelte
@@ -1,36 +1,27 @@
-
- {#snippet children({ args })}
-
- {/snippet}
-
-
@@ -54,13 +45,13 @@
narrower*
@@ -91,8 +82,8 @@
background-color: #bbb;
}
:global(
- #article-column-widths-demo .article-boundaries.custom div.article-block
- ) {
+ #article-column-widths-demo .article-boundaries.custom div.article-block
+ ) {
background: rgb(211, 132, 123);
}
:global(#article-column-widths-demo div.article-block) {
diff --git a/src/components/Article/Article.svelte b/src/components/Article/Article.svelte
index 680cacfc..df103673 100644
--- a/src/components/Article/Article.svelte
+++ b/src/components/Article/Article.svelte
@@ -1,11 +1,5 @@
-
+
{@render children?.()}
diff --git a/src/components/Byline/Byline.stories.svelte b/src/components/Byline/Byline.stories.svelte
index acdc5d71..5855ceef 100644
--- a/src/components/Byline/Byline.stories.svelte
+++ b/src/components/Byline/Byline.stories.svelte
@@ -1,11 +1,14 @@
-
-
-
- {#snippet children({ args })}
-
- {/snippet}
-
+{#snippet template(args: ComponentProps)}
+
+{/snippet}
diff --git a/src/components/DatawrapperChart/stories/docs/component.md b/src/components/DatawrapperChart/DatawrapperChart.mdx
similarity index 57%
rename from src/components/DatawrapperChart/stories/docs/component.md
rename to src/components/DatawrapperChart/DatawrapperChart.mdx
index 6e7a8501..e444f37a 100644
--- a/src/components/DatawrapperChart/stories/docs/component.md
+++ b/src/components/DatawrapperChart/DatawrapperChart.mdx
@@ -1,3 +1,11 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as DatawrapperChartStories from './DatawrapperChart.stories.svelte';
+
+
+
+# DatawrapperChart
+
Easily add a responsive Datawrapper embed on your page.
```svelte
@@ -23,3 +31,15 @@ You can get this from the published url on Reuters Graphics.
- Inside **Embed code (for developers only)**, find and copy the url inside the `src` prop. (It ends in `media-embed.html`.)
**Note:** There is no need to update the url if you update the chart inside Datawrapper. Any changes will be automatically reflected.
+
+
+
+## With chatter
+
+By default, Datawrapper will export your chart with the chart chatter like title, description and notes.
+
+At the moment, these don't _exactly_ match our styles and can't be made to fit into the article well.
+
+Instead, it's often better to remove all the text from your Datawrapper chart before publishing it and add that text back via the component props.
+
+
diff --git a/src/components/DatawrapperChart/DatawrapperChart.stories.svelte b/src/components/DatawrapperChart/DatawrapperChart.stories.svelte
index d2019f40..412d1adc 100644
--- a/src/components/DatawrapperChart/DatawrapperChart.stories.svelte
+++ b/src/components/DatawrapperChart/DatawrapperChart.stories.svelte
@@ -16,18 +16,19 @@
diff --git a/src/components/DatawrapperChart/DatawrapperChart.svelte b/src/components/DatawrapperChart/DatawrapperChart.svelte
index ab50ad4e..47864058 100644
--- a/src/components/DatawrapperChart/DatawrapperChart.svelte
+++ b/src/components/DatawrapperChart/DatawrapperChart.svelte
@@ -1,62 +1,71 @@
- {#if $$slots.title}
+ {#if titleSnippet}
-
+ {@render titleSnippet()}
{/if}
- {#if $$slots.notes}
-
-
+ {#if notesSnippet}
+ {@render notesSnippet()}
{/if}
diff --git a/src/components/DatawrapperChart/stories/docs/withChatter.md b/src/components/DatawrapperChart/stories/docs/withChatter.md
deleted file mode 100644
index c11a170e..00000000
--- a/src/components/DatawrapperChart/stories/docs/withChatter.md
+++ /dev/null
@@ -1,5 +0,0 @@
-By default, Datawrapper will export your chart with the chart chatter like title, description and notes.
-
-At the moment, these don't _exactly_ match our styles and can't be made to fit into the article well.
-
-Instead, it's often better to remove all the text from your Datawrapper chart before publishing it and add that text back via the component props.
diff --git a/bin/css-to-js/index.d.ts b/src/docs/utils/css-to-js/index.d.ts
similarity index 100%
rename from bin/css-to-js/index.d.ts
rename to src/docs/utils/css-to-js/index.d.ts
diff --git a/bin/css-to-js/index.js b/src/docs/utils/css-to-js/index.js
similarity index 99%
rename from bin/css-to-js/index.js
rename to src/docs/utils/css-to-js/index.js
index 2add6ca5..e7310751 100644
--- a/bin/css-to-js/index.js
+++ b/src/docs/utils/css-to-js/index.js
@@ -112,6 +112,7 @@ function _iterableToArrayLimit(arr, i) {
try {
if (!_n && _i.return != null) _i.return();
} finally {
+ // eslint-disable-next-line
if (_d) throw _e;
}
}
@@ -353,7 +354,7 @@ const convert = function convert(input) {
const config =
arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
const outputType = config.outputType;
- const outputPath = config.outputPath;
+ const _outputPath = config.outputPath;
let mediaReverse = config.mediaReverse;
let convertedCss;
diff --git a/src/docs/utils/parseCss.js b/src/docs/utils/parseCss.js
index 29031e77..4f4af80a 100644
--- a/src/docs/utils/parseCss.js
+++ b/src/docs/utils/parseCss.js
@@ -1,5 +1,5 @@
import { compileString } from 'sass';
-import { convert } from '../../../bin/css-to-js/index.js';
+import { convert } from './css-to-js/index.js';
import { kebabCase } from 'lodash-es';
export const cssStringToTableArray = (cssString, withInclude = false) => {
diff --git a/src/stories/Button.stories.svelte b/src/stories/Button.stories.svelte
deleted file mode 100644
index 4c8c7cce..00000000
--- a/src/stories/Button.stories.svelte
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/stories/Button.svelte b/src/stories/Button.svelte
deleted file mode 100644
index b31f5bff..00000000
--- a/src/stories/Button.svelte
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
diff --git a/src/stories/Configure.mdx b/src/stories/Configure.mdx
deleted file mode 100644
index 549973e9..00000000
--- a/src/stories/Configure.mdx
+++ /dev/null
@@ -1,364 +0,0 @@
-import { Meta } from "@storybook/blocks";
-
-import Github from "./assets/github.svg";
-import Discord from "./assets/discord.svg";
-import Youtube from "./assets/youtube.svg";
-import Tutorials from "./assets/tutorials.svg";
-import Styling from "./assets/styling.png";
-import Context from "./assets/context.png";
-import Assets from "./assets/assets.png";
-import Docs from "./assets/docs.png";
-import Share from "./assets/share.png";
-import FigmaPlugin from "./assets/figma-plugin.png";
-import Testing from "./assets/testing.png";
-import Accessibility from "./assets/accessibility.png";
-import Theming from "./assets/theming.png";
-import AddonLibrary from "./assets/addon-library.png";
-
-export const RightArrow = () =>
-
-
-
-
-
- # Configure your project
-
- Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
-
-
-
-
-
Add styling and CSS
-
Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.
To link static files (like fonts) to your projects and stories, use the
- `staticDirs` configuration option to specify folders to load when
- starting Storybook.
- # Do more with Storybook
-
- Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
-
-
-
-
-
-
-
Autodocs
-
Auto-generate living,
- interactive reference documentation from your components and stories.
- We recommend building UIs with a
-
- component-driven
-
- process starting with atomic components and ending with pages.
-
-
- Render pages with mock data. This makes it easy to build and review page states without
- needing to navigate to them in your app. Here are some handy patterns for managing page data
- in Storybook:
-
-
-
- Use a higher-level connected component. Storybook helps you compose such data from the
- "args" of child component stories
-
-
- Assemble data in the page component from your services. You can mock these services out
- using Storybook.
-
-
-
- Get a guided tutorial on component-driven development at
-
- Storybook tutorials
-
- . Read more in the
- docs
- .
-
-
- Tip
- Adjust the width of the canvas with the
-
- Viewports addon in the toolbar
-