Skip to content

Commit

Permalink
Replaces deprecated <Meta /> with object export
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Nov 29, 2023
1 parent 0177cff commit 702a2d2
Show file tree
Hide file tree
Showing 35 changed files with 289 additions and 292 deletions.
16 changes: 8 additions & 8 deletions src/addons/browser/stories/AddOnList.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import defaultAddons from "../../fixtures/addons.json";
import AddOnList from "../AddOnList.svelte";
Expand All @@ -9,13 +9,13 @@
loading: false,
error: null,
};
</script>
<Meta
title="Add-Ons / Browser / Components / List"
component={AddOnList}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Browser / Components / List",
component: AddOnList,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<AddOnList {...args} />
Expand Down
18 changes: 9 additions & 9 deletions src/addons/browser/stories/Browser.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
<script lang="ts" context="module">
import { rest } from "msw";
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
import { Story, Template } from "@storybook/addon-svelte-csf";
import Browser from "../Browser.svelte";
import listFixture from "../../fixtures/addon-list.json";
Expand All @@ -22,14 +22,14 @@
const empty = rest.get(mockUrl, (req, res, ctx) =>
res(ctx.json({ next: null, previous: null, results: [] })),
);
</script>
<Meta
title="Add-Ons / Browser"
tags={["autodocs"]}
parameters={{ layout: "fullscreen" }}
component={Browser}
/>
export const meta = {
title: "Add-Ons / Browser",
tags: ["autodocs"],
parameters: { layout: "fullscreen" },
component: Browser,
};
</script>

<Template let:args>
<Browser {...args} />
Expand Down
18 changes: 9 additions & 9 deletions src/addons/browser/stories/Filters.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Filters from "../Filters.svelte";
const args = {};
</script>
<Meta
title="Add-Ons / Browser / Components / Filters"
tags={["autodocs"]}
parameters={{ layout: "centered" }}
component={Filters}
/>
export const meta = {
title: "Add-Ons / Browser / Components / Filters",
tags: ["autodocs"],
parameters: { layout: "centered" },
component: Filters,
};
</script>

<Template let:args>
<Filters {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/fields/stories/ArrayField.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import ArrayField from "../ArrayField.svelte";
Expand All @@ -8,13 +8,13 @@
title: "Array Field",
description: "An array of items",
};
</script>
<Meta
title="Add-Ons / Dispatch / Form / Fields / Array Field"
component={ArrayField}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch / Form / Fields / Array Field",
component: ArrayField,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<ArrayField {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/fields/stories/Checkbox.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Checkbox from "../Checkbox.svelte";
Expand All @@ -10,13 +10,13 @@
required: false,
value: true,
};
</script>
<Meta
title="Add-Ons / Dispatch / Form / Fields / Checkbox"
component={Checkbox}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch / Form / Fields / Checkbox",
component: Checkbox,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<Checkbox {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/fields/stories/Number.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Number from "../Number.svelte";
Expand All @@ -13,13 +13,13 @@
min: "0",
max: "2",
};
</script>
<Meta
title="Add-Ons / Dispatch / Form / Fields / Number"
component={Number}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch / Form / Fields / Number",
component: Number,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<Number {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/fields/stories/Text.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Text from "../Text.svelte";
Expand All @@ -10,13 +10,13 @@
required: false,
value: "Lorem ipsum dolor sit amet",
};
</script>
<Meta
title="Add-Ons / Dispatch / Form / Fields / Text"
component={Number}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch / Form / Fields / Text",
component: Number,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<Text {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/stories/Dispatch.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
<script lang="ts" context="module">
import { rest } from "msw";
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
import { Story, Template } from "@storybook/addon-svelte-csf";
import Dispatch from "../Dispatch.svelte";
import * as addons from "../../fixtures/addons.json";
Expand Down Expand Up @@ -48,13 +48,13 @@
addon: null,
event: null,
};
</script>
<Meta
title="Add-Ons / Dispatch"
component={Dispatch}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch",
component: Dispatch,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<Dispatch {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/stories/Premium.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Premium from "../Premium.svelte";
Expand Down Expand Up @@ -44,13 +44,13 @@
username: "lasser.allan",
verified_journalist: true,
};
</script>
<Meta
title="Add-Ons / Dispatch / Premium"
component={Premium}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch / Premium",
component: Premium,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<Premium {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/dispatch/stories/ScheduledInset.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import ScheduledInset from "../ScheduledInset.svelte";
import addon from "../../fixtures/addon.json";
import klaxon from "../../fixtures/klaxon-scheduled.json";
</script>
<Meta
title="Add-Ons / Dispatch / Scheduled Inset"
component={ScheduledInset}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Dispatch / Scheduled Inset",
component: ScheduledInset,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<ScheduledInset addon={args.addon} events={args.events} open />
Expand Down
11 changes: 7 additions & 4 deletions src/addons/progress/stories/AddonRun.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
<script lang="ts" context="module">
import { rest } from "msw";
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
import { Story, Template } from "@storybook/addon-svelte-csf";
import run from "../../fixtures/run.json";
import { baseApiUrl } from "../../../api/base";
import AddonRun from "../AddonRun.svelte";
Expand All @@ -16,9 +16,12 @@
}),
rest.delete(mockUpdateUrl, (req, res, ctx) => res(ctx.json({}))),
];
</script>
<Meta title="Add-Ons / Progress / Run" component={AddonRun} />
export const meta = {
title: "Add-Ons / Progress / Run",
component: AddonRun,
};
</script>

<Template let:args>
<AddonRun {...args} />
Expand Down
11 changes: 7 additions & 4 deletions src/addons/progress/stories/AddonStatus.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
<script lang="ts" context="module">
import { rest } from "msw";
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
import { Story, Template } from "@storybook/addon-svelte-csf";
import runList from "../../fixtures/run-list.json";
import { baseApiUrl } from "../../../api/base";
import AddonStatus from "../AddonStatus.svelte";
Expand All @@ -18,9 +18,12 @@
}),
rest.delete(mockUpdateUrl, (req, res, ctx) => res(ctx.json({}))),
];
</script>
<Meta title="Add-Ons / Progress / Status" component={AddonStatus} />
export const meta = {
title: "Add-Ons / Progress / Status",
component: AddonStatus,
};
</script>

<Template let:args>
<AddonStatus {...args} />
Expand Down
22 changes: 10 additions & 12 deletions src/addons/runs/stories/History.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<script context="module">
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import History from "../History.svelte";
import { rest } from "msw";
import runListFixture from "../../fixtures/run-list.json";
import { baseApiUrl } from "../../../api/base";
Expand All @@ -21,20 +24,15 @@
res(ctx.json({ next: null, previous: null, results: [] })),
);
export const handlers = { data, loading, error, empty };
</script>

<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
import History from "../History.svelte";
const args = {};
</script>
<Meta
title="Add-Ons / Runs / History"
component={History}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Runs / History",
component: History,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<History {...args} />
Expand Down
16 changes: 8 additions & 8 deletions src/addons/runs/stories/HistoryEvent.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<script>
import { Meta, Story, Template } from "@storybook/addon-svelte-csf";
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import run from "../../fixtures/run.json";
import Event from "../HistoryEvent.svelte";
const args = { run };
</script>
<Meta
title="Add-Ons / Runs / History / Event"
component={Event}
parameters={{ layout: "centered" }}
/>
export const meta = {
title: "Add-Ons / Runs / History / Event",
component: Event,
parameters: { layout: "centered" },
};
</script>

<Template let:args>
<Event {...args} />
Expand Down
Loading

0 comments on commit 702a2d2

Please sign in to comment.