Hello World
diff --git a/e2e/config/src/hello.show.tsx b/e2e/config/src/hello.show.tsx
index 7507e8a3..433dae99 100644
--- a/e2e/config/src/hello.show.tsx
+++ b/e2e/config/src/hello.show.tsx
@@ -1,4 +1,6 @@
-export const World = () => {
+import type { Story } from "@ladle/react";
+
+export const World: Story = () => {
return
Hello World
;
};
diff --git a/e2e/config/src/specific-file.custom.tsx b/e2e/config/src/specific-file.custom.tsx
index 399feb8f..6b1ac720 100644
--- a/e2e/config/src/specific-file.custom.tsx
+++ b/e2e/config/src/specific-file.custom.tsx
@@ -1,3 +1,5 @@
-export const Custom = () => {
+import type { Story } from "@ladle/react";
+
+export const Custom: Story = () => {
return
Custom path
;
};
diff --git a/e2e/css/src/hello.stories.tsx b/e2e/css/src/hello.stories.tsx
index 6b55e4f8..ee132797 100644
--- a/e2e/css/src/hello.stories.tsx
+++ b/e2e/css/src/hello.stories.tsx
@@ -1,7 +1,9 @@
+import type { Story } from "@ladle/react";
+
// @ts-ignore
import classes from "./more.module.css";
-export const World = () => {
+export const World: Story = () => {
return (
<>
Yellow
diff --git a/e2e/decorators/src/args.stories.tsx b/e2e/decorators/src/args.stories.tsx
index 2b5aa93f..7cf80708 100644
--- a/e2e/decorators/src/args.stories.tsx
+++ b/e2e/decorators/src/args.stories.tsx
@@ -1,5 +1,7 @@
import type { Story, StoryDecorator } from "@ladle/react";
+type Props = { label: string };
+
export default {
decorators: [
(Component, context) => {
@@ -32,9 +34,7 @@ export default {
] as StoryDecorator[],
};
-const Card: Story<{
- label: string;
-}> = ({ label }) => (
+const Card: Story
= ({ label }) => (
<>
Label: {label}
diff --git a/e2e/decorators/src/hello.stories.tsx b/e2e/decorators/src/hello.stories.tsx
index 6a5e7956..86585dd6 100644
--- a/e2e/decorators/src/hello.stories.tsx
+++ b/e2e/decorators/src/hello.stories.tsx
@@ -1,3 +1,5 @@
+import type { Story, StoryDecorator } from "@ladle/react";
+
export default {
decorators: [
(Stories: React.FC) => (
@@ -10,10 +12,10 @@ export default {
Decorator 2
>
),
- ],
+ ] as StoryDecorator[],
};
-export const World = () => {
+export const World: Story = () => {
return world
;
};
diff --git a/e2e/decorators/src/params.stories.tsx b/e2e/decorators/src/params.stories.tsx
index 87452509..55f46fd4 100644
--- a/e2e/decorators/src/params.stories.tsx
+++ b/e2e/decorators/src/params.stories.tsx
@@ -1,3 +1,5 @@
+import type { Story } from "@ladle/react";
+
export default {
title: "Root / Examples",
meta: {
@@ -6,11 +8,11 @@ export default {
},
};
-export const First = () => {
+export const First: Story = () => {
return first
;
};
-export const Second = () => {
+export const Second: Story = () => {
return second
;
};
Second.storyName = "Second Renamed";
diff --git a/e2e/decorators/tests/params.spec.ts b/e2e/decorators/tests/params.spec.ts
index a1f68468..acec6fe8 100644
--- a/e2e/decorators/tests/params.spec.ts
+++ b/e2e/decorators/tests/params.spec.ts
@@ -27,32 +27,32 @@ test("meta.json is correctly using defaults and overrides", async ({
"args--card-hello": {
filePath: "src/args.stories.tsx",
levels: ["Args"],
- locEnd: 44,
locStart: 44,
+ locEnd: 44,
meta: {},
name: "Card hello",
},
"hello--world": {
name: "World",
levels: ["Hello"],
- locStart: 16,
- locEnd: 18,
+ locStart: 18,
+ locEnd: 20,
filePath: "src/hello.stories.tsx",
meta: {},
},
"root--examples--first": {
name: "First",
levels: ["Root", "Examples"],
- locStart: 9,
- locEnd: 11,
+ locStart: 11,
+ locEnd: 13,
filePath: "src/params.stories.tsx",
meta: { drink: "coke", food: "burger" },
},
"root--examples--second-renamed": {
name: "Second renamed",
levels: ["Root", "Examples"],
- locStart: 13,
- locEnd: 15,
+ locStart: 15,
+ locEnd: 17,
filePath: "src/params.stories.tsx",
meta: { drink: "water", food: "burger" },
},
diff --git a/e2e/playwright/src/abc.stories.tsx b/e2e/playwright/src/abc.stories.tsx
index ab7239d0..a1ae81ad 100644
--- a/e2e/playwright/src/abc.stories.tsx
+++ b/e2e/playwright/src/abc.stories.tsx
@@ -1,4 +1,6 @@
-export const First = () => {
+import type { Story } from "@ladle/react";
+
+export const First: Story = () => {
// not rendering a text since fonts render differently in different operation systems
// and we use this package in our Github Actions CI which runs Ubuntu and Windows
// so doing a blue rectangle instead to keep the setup simple
@@ -7,7 +9,7 @@ export const First = () => {
return ;
};
-export const Second = () => {
+export const Second: Story = () => {
return Second
;
};
Second.meta = {
diff --git a/e2e/programmatic/src/hello.stories.tsx b/e2e/programmatic/src/hello.stories.tsx
index bef6e1f7..5c5666c6 100644
--- a/e2e/programmatic/src/hello.stories.tsx
+++ b/e2e/programmatic/src/hello.stories.tsx
@@ -1,3 +1,5 @@
-export const World = () => {
+import type { Story } from "@ladle/react";
+
+export const World: Story = () => {
return Hello World
;
};
diff --git a/e2e/programmatic/tests/hello.spec.ts b/e2e/programmatic/tests/hello.spec.ts
index ea217863..e5da6523 100644
--- a/e2e/programmatic/tests/hello.spec.ts
+++ b/e2e/programmatic/tests/hello.spec.ts
@@ -18,8 +18,8 @@ test("meta.json has a single story ok", async ({ request }) => {
"hello--world": {
name: "World",
levels: ["Hello"],
- locEnd: 3,
- locStart: 1,
+ locStart: 3,
+ locEnd: 5,
filePath: "src/hello.stories.tsx",
meta: {},
},
diff --git a/e2e/provider/src/hello.stories.tsx b/e2e/provider/src/hello.stories.tsx
index 8b3c24ae..9e5c4c3d 100644
--- a/e2e/provider/src/hello.stories.tsx
+++ b/e2e/provider/src/hello.stories.tsx
@@ -1,7 +1,8 @@
+import type { Story } from "@ladle/react";
import { useContext } from "react";
import { MyContext } from "../.ladle/components";
-export const World = () => {
+export const World: Story = () => {
const value = useContext(MyContext);
return Hello World - {value}
;
};
diff --git a/e2e/provider/src/hmr.stories.tsx b/e2e/provider/src/hmr.stories.tsx
index 4bda4f29..3e55ad2d 100644
--- a/e2e/provider/src/hmr.stories.tsx
+++ b/e2e/provider/src/hmr.stories.tsx
@@ -1,4 +1,6 @@
-export const WithState = () => {
+import type { Story } from "@ladle/react";
+
+export const WithState: Story = () => {
return (
<>
diff --git a/e2e/provider/tests/hello.spec.ts b/e2e/provider/tests/hello.spec.ts
index f11d749c..463c65fc 100644
--- a/e2e/provider/tests/hello.spec.ts
+++ b/e2e/provider/tests/hello.spec.ts
@@ -19,8 +19,8 @@ test("meta.json has a single story ok", async ({ request }) => {
"hello--world": {
name: "World",
levels: ["Hello"],
- locEnd: 7,
locStart: 4,
+ locEnd: 7,
filePath: "src/hello.stories.tsx",
meta: {},
},