wix-style-react
Version:
wix-style-react
100 lines (92 loc) • 2.78 kB
JavaScript
import React from 'react';
import CodeExample from 'wix-storybook-utils/CodeExample';
import { default as PopoverMenu } from '../../src/PopoverMenu';
import { default as PopoverMenuItem } from '../../src/PopoverMenuItem';
import { storySettings } from './storySettings';
import ExampleBasic from './ExampleBasic';
import ExampleBasicRaw from '!raw-loader!./ExampleBasic';
import ExampleDisabled from './ExampleDisabled';
import ExampleDisabledRaw from '!raw-loader!./ExampleDisabled';
import ExampleDisabledLarge from './ExampleDisabledLarge';
import ExampleDisabledLargeRaw from '!raw-loader!./ExampleDisabledLarge';
import { createAutoExampleWrapper } from '../AutoExampleWrapper';
var exampleContainerStyle = {
display: 'flex',
backgroundColor: '#f6f8fa',
minHeight: '50px',
alignItems: 'center',
justifyContent: 'center'
};
var exampleItems = [React.createElement(PopoverMenuItem, {
dataHook: storySettings.itemDataHook,
text: 'Edit',
onClick: function onClick() {}
}), React.createElement(PopoverMenuItem, {
dataHook: storySettings.itemDataHook,
text: 'Hide',
onClick: function onClick() {}
}), React.createElement(PopoverMenuItem, {
dataHook: storySettings.itemDataHook,
text: 'Delete',
onClick: function onClick() {}
})];
var exampleChildren = [{
label: 'One item',
value: exampleItems.slice(0, 1)
}, {
label: 'Two items',
value: exampleItems.slice(0, 2)
}, {
label: 'Three items',
value: exampleItems
}];
export default {
category: storySettings.kind,
storyName: storySettings.storyName,
component: createAutoExampleWrapper(PopoverMenu),
componentPath: '../../src/PopoverMenu/PopoverMenu.js',
componentProps: {
dataHook: storySettings.dataHook,
size: 'normal',
placement: 'right',
buttonTheme: 'icon-greybackground',
children: exampleChildren[0].value
},
exampleProps: {
children: exampleChildren
},
examples: React.createElement(
'div',
null,
React.createElement(
CodeExample,
{ title: 'Standard with icons', code: ExampleBasicRaw },
React.createElement(
'div',
{ style: exampleContainerStyle },
React.createElement(ExampleBasic, null)
)
),
React.createElement(
CodeExample,
{ title: 'Disabled item', code: ExampleDisabledRaw },
React.createElement(
'div',
{ style: exampleContainerStyle },
React.createElement(ExampleDisabled, null)
)
),
React.createElement(
CodeExample,
{
title: 'Disabled item within a large popover menu',
code: ExampleDisabledLargeRaw
},
React.createElement(
'div',
{ style: exampleContainerStyle },
React.createElement(ExampleDisabledLarge, null)
)
)
)
};