Skip to content

Commit

Permalink
chore(OrbitProvider): migrate from CSF2 to CSF3
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkaaa committed Sep 10, 2024
1 parent 056387c commit d3239cc
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,32 @@ import type { Meta, StoryObj } from "@storybook/react";

import Button from "../Button";
import getTokens from "../getTokens";
// import type { Theme } from "../defaultTheme";

import OrbitProvider from ".";

const meta: Meta<typeof OrbitProvider & { orbitTheme: any }> = {
interface OrbitThemeCustomProps {
orbitTheme: {
palette: {
[key: string]: {
[colorName: string]: string;
};
};
};
customTheme: {
[key: string]: string;
};
}

type OrbitProviderPropsAndCustomArgs = React.ComponentProps<typeof OrbitProvider> &
OrbitThemeCustomProps;

const meta: Meta<OrbitProviderPropsAndCustomArgs> = {
title: "OrbitProvider",
component: OrbitProvider,

parameters: {
info: "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.",
info: "Example how OrbitProvider component can be used. Visit Orbit.Kiwi for more detailed guidelines.",
},

args: {
Expand All @@ -36,11 +53,11 @@ const meta: Meta<typeof OrbitProvider & { orbitTheme: any }> = {
},
};

type Story = StoryObj<typeof OrbitProvider>;
type Story = StoryObj<OrbitProviderPropsAndCustomArgs>;

export default meta;

export const OwnTheme: Story = {
export const Default: Story = {
render: ({ orbitTheme, customTheme }) => (
<OrbitProvider
theme={{ orbit: { ...getTokens(orbitTheme), ...customTheme } }}
Expand Down

0 comments on commit d3239cc

Please sign in to comment.