mirror of
https://github.com/penpot/penpot.git
synced 2025-06-14 09:31:38 +02:00
✨ Improve code organization for better integration with storybook
This commit is contained in:
parent
5621c2c394
commit
9c969f8b26
8 changed files with 885 additions and 3595 deletions
|
@ -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>
|
||||
),
|
||||
}
|
||||
|
|
|
@ -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})
|
Loading…
Add table
Add a link
Reference in a new issue