-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from brainstormforce/stories/MenuItem/Skeleton
SUR-288 SUR-296 SUR-302 Add stories to storybook
- Loading branch information
Showing
10 changed files
with
193 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'react-dom'), 'version' => '37a62a0e88dc6a48352f'); | ||
<?php return array('dependencies' => array('react', 'react-dom'), 'version' => 'fdf7a146fb9b70dc92fd'); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Menu from './menu-item.jsx'; | ||
import { Store } from 'lucide-react'; | ||
|
||
export default { | ||
title: 'Molecules/Menu Item', | ||
component: Menu.Item, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: [ 'autodocs' ], | ||
argTypes: { | ||
active: { | ||
description: 'Determines if the Menu Item is in an active state', | ||
control: { type: 'boolean' }, | ||
table: { | ||
type: { summary: 'boolean' }, | ||
defaultValue: { summary: 'false' }, | ||
}, | ||
}, | ||
disabled: { | ||
description: 'Disables the Menu Item if set to true', | ||
control: { type: 'boolean' }, | ||
table: { | ||
type: { summary: 'boolean' }, | ||
defaultValue: { summary: 'false' }, | ||
}, | ||
}, | ||
onClick: { | ||
action: 'clicked', | ||
description: 'Callback when Menu Item is clicked', | ||
table: { | ||
type: { summary: 'function' }, | ||
}, | ||
}, | ||
children: { | ||
description: 'Content inside the Menu Item', | ||
table: { | ||
type: { summary: 'ReactNode' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const MenuItem = ( args ) => ( | ||
<Menu> | ||
<Menu.Item { ...args }> | ||
<Store /> | ||
<div>Store Settings</div> | ||
</Menu.Item> | ||
</Menu> | ||
); | ||
|
||
MenuItem.args = { | ||
active: false, | ||
disabled: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import Menu from './menu-item.jsx'; | ||
import { CreditCard, | ||
Store, PenTool, ShoppingBag, ShoppingCart, Truck, MousePointer, ChartNoAxesColumnIncreasing, Layers, CloudUpload, Bell } from 'lucide-react'; | ||
|
||
export default { | ||
title: 'Molecules/Menu', | ||
component: Menu, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: [ 'autodocs' ], | ||
argTypes: { | ||
size: { | ||
description: 'Specifies the size of the Menu Item components inside Menu', | ||
control: { type: 'select' }, | ||
options: [ 'sm', 'md' ], | ||
table: { | ||
type: { summary: 'string' }, | ||
defaultValue: { summary: 'md' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const MenuSidebar = { | ||
render: ( args ) => ( | ||
<Menu size={ args.size }> | ||
<Menu.List heading="Store" open={ true } arrow={ true }> | ||
<Menu.Item> | ||
<Store /> | ||
<div>Store Settings</div> | ||
</Menu.Item> | ||
<Menu.Item disabled> | ||
<PenTool /> | ||
<div>Design & Branding</div> | ||
</Menu.Item> | ||
</Menu.List> | ||
<Menu.List heading="Orders & Sales" open={ true } arrow={ true }> | ||
<Menu.Item> | ||
<ShoppingBag /> | ||
<div>Orders & Receipts</div> | ||
</Menu.Item> | ||
<Menu.Item active={ true }> | ||
<ShoppingCart /> | ||
<div>Abandoned Checkout</div> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<Truck /> | ||
<div>Shipping</div> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<CreditCard /> | ||
<div>Payment Processors</div> | ||
</Menu.Item> | ||
</Menu.List> | ||
<Menu.Separator /> | ||
<Menu.List heading="Customers" open={ true } arrow={ true }> | ||
<Menu.Item> | ||
<MousePointer /> | ||
<div>Affiliates</div> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<ChartNoAxesColumnIncreasing /> | ||
<div>Subscriptions Saver</div> | ||
</Menu.Item> | ||
</Menu.List> | ||
<Menu.List heading="Others" open={ true } arrow={ true }> | ||
<Menu.Item> | ||
<Layers /> | ||
<div>Data Export</div> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<CloudUpload /> | ||
<div>Connection</div> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<Bell /> | ||
<div>Notification</div> | ||
</Menu.Item> | ||
</Menu.List> | ||
</Menu> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Skeleton from './skeleton.jsx'; | ||
|
||
export default { | ||
title: 'Atoms/Skeleton', | ||
component: Skeleton, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: [ 'autodocs' ], | ||
argTypes: { | ||
variant: { | ||
name: 'Variant', | ||
description: 'Defines the style variant of the skeleton.', | ||
control: 'select', | ||
options: [ 'rectangular', 'circular' ], | ||
table: { | ||
type: { summary: 'string' }, | ||
defaultValue: { summary: 'rectangular' }, | ||
}, | ||
}, | ||
className: { | ||
description: 'Allows you to pass custom classes to control the size and styles', | ||
control: 'text', | ||
}, | ||
}, | ||
}; | ||
|
||
export const Rectangular = ( args ) => ( | ||
<Skeleton { ...args } /> | ||
); | ||
|
||
Rectangular.args = { | ||
variant: 'rectangular', | ||
}; | ||
|
||
export const Circular = ( args ) => ( | ||
<Skeleton { ...args } /> | ||
); | ||
|
||
Circular.args = { | ||
variant: 'circular', | ||
}; |