Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOPLT-273] Adds FeatureInfo, ModuleCheckout and ModulePaymentNotice to Storybook #155

Merged
merged 9 commits into from
Nov 29, 2023
33 changes: 33 additions & 0 deletions stories/featureInfo/FeatureInfo.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";

import { FeatureInfo } from "../../src/components";

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
const meta = {
title: "IO-App Design System/Components/FeatureInfo/FeatureInfo",
component: FeatureInfo,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
layout: "centered"
},
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
tags: ["autodocs"],
args: {
pictogramName: "cie"
}
} satisfies Meta<typeof FeatureInfo>;

export default meta;
type Story = StoryObj<typeof meta>;

// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const Primary: Story = {
args: {
body: "Dopo questo passaggio non sarà più possibile annullare il pagamento",
actionLabel: "Conferma",
actionOnPress: e => {
action("clicked")(e);
}
}
};
42 changes: 42 additions & 0 deletions stories/modules/ModuleCheckout.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import React from "react";
import { IOThemeContext, IOThemes } from "../../src";

import { ModuleCheckout } from "../../src/components";

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
const meta = {
title: "IO-App Design System/Atoms/Modules/ModuleCheckout",
component: ModuleCheckout,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
layout: "centered"
},
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
tags: ["autodocs"]
} satisfies Meta<typeof ModuleCheckout>;

export default meta;
type Story = StoryObj<typeof meta>;

// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const Primary: Story = {
decorators: [
Story => (
<IOThemeContext.Provider value={IOThemes.dark}>
<div style={{ width: "300px" }}>
<Story />
</div>
</IOThemeContext.Provider>
)
],
args: {
ctaText: "Modifica",
isLoading: false,
paymentLogo: "maestro",
title: "Title",
subtitle: "Subtitle",
onPress: () => action("clicked")()
}
};
43 changes: 43 additions & 0 deletions stories/modules/ModulePaymentNotice.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import React from "react";
import { IOThemeContext, IOThemes } from "../../src";

import { ModulePaymentNotice } from "../../src/components";

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
const meta = {
title: "IO-App Design System/Atoms/Modules/ModulePaymentNotice",
component: ModulePaymentNotice,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
layout: "centered"
},
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
tags: ["autodocs"]
} satisfies Meta<typeof ModulePaymentNotice>;

export default meta;
type Story = StoryObj<typeof meta>;

// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const Primary: Story = {
decorators: [
Story => (
<IOThemeContext.Provider value={IOThemes.dark}>
<div style={{ width: "300px" }}>
<Story />
</div>
</IOThemeContext.Provider>
)
],
args: {
isLoading: false,
title: "Title",
paymentNoticeStatus: "default",
paymentNoticeAmount: "100,00€",
subtitle: "Subtitle",
accessibilityLabel: "accessibilityLabel",
onPress: () => action("clicked")()
}
};