Improve code organization for better integration with storybook

This commit is contained in:
Andrey Antukh 2023-12-21 11:37:42 +01:00 committed by Alonso Torres
parent 5621c2c394
commit 9c969f8b26
8 changed files with 885 additions and 3595 deletions

View file

@ -1,31 +1,30 @@
import * as React from "react";
import ds from "@target/design-system";
const { SimpleButton, StoryWrapper, icons } = ds;
import Components from "@target/components";
import Icons from "@target/icons";
export default {
title: 'Buttons/Simple Button',
component: SimpleButton,
component: Components.SimpleButton,
};
export const Default = {
render: () => (
<StoryWrapper>
<SimpleButton>
<Components.StoryWrapper>
<Components.SimpleButton>
Simple Button
</SimpleButton>
</StoryWrapper>
</Components.SimpleButton>
</Components.StoryWrapper>
),
};
export const WithIcon = {
render: () => (
<StoryWrapper>
<SimpleButton>
{icons.IconAddRefactor}
<Components.StoryWrapper>
<Components.SimpleButton>
{Icons.AddRefactor}
Simple Button
</SimpleButton>
</StoryWrapper>
</Components.SimpleButton>
</Components.StoryWrapper>
),
}

View file

@ -1,16 +0,0 @@
(ns app.main.ui.components.design-system
(:require
[app.main.ui.components.buttons.simple-button :as sb]
[app.main.ui.icons :as icons]
[rumext.v2 :as mf]))
(mf/defc story-wrapper
{::mf/wrap-props false}
[{:keys [children]}]
[:.default children])
(def ^export default #js
{:icons #js
{:IconAddRefactor icons/add-refactor}
:StoryWrapper story-wrapper
:SimpleButton sb/simple-button})