@carbon/ibm-security
Version:
Carbon for Cloud & Cognitive IBM Security UI components
65 lines (64 loc) • 2.66 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/**
* @file Action bar module stories.
* @copyright IBM Security 2020 - 2021
*/
import { Add16, Edit16, Filter16, OverflowMenuVertical16, Search16, Table16 } from '@carbon/icons-react';
import React from 'react';
import { getDocsParameters } from '../../../../.storybook';
import withResponsive from '../../../../.storybook/decorators';
import { ActionBarModule, ActionBarModuleItems, Button, IconButtonBar } from '../../..';
import getTitle from '../stories';
import page from './index.mdx';
export default {
title: getTitle(ActionBarModule.name),
component: ActionBarModule,
subcomponents: {
ActionBarModuleItems: ActionBarModuleItems
},
parameters: _objectSpread({
docs: {
page: page
}
}, getDocsParameters()),
decorators: [withResponsive]
};
export var Default = function Default() {
return /*#__PURE__*/React.createElement(ActionBarModule, null, /*#__PURE__*/React.createElement(Button, {
kind: "ghost"
}, "Ghost button"), /*#__PURE__*/React.createElement(ActionBarModuleItems, null, /*#__PURE__*/React.createElement(IconButtonBar, {
actions: [{
label: 'Action 2',
renderIcon: Search16
}, {
label: 'Action 3',
renderIcon: Table16
}, {
label: 'Action 4',
renderIcon: OverflowMenuVertical16
}],
size: "lg"
})));
};
export var Variant = function Variant() {
return /*#__PURE__*/React.createElement(ActionBarModule, null, /*#__PURE__*/React.createElement(Button, {
iconDescription: "Action 1",
kind: "ghost",
renderIcon: Filter16,
hasIconOnly: true
}), /*#__PURE__*/React.createElement(ActionBarModuleItems, null, /*#__PURE__*/React.createElement(IconButtonBar, {
actions: [{
label: 'Action 2',
renderIcon: Add16
}, {
label: 'Action 3',
renderIcon: Edit16
}],
size: "lg"
})));
};
Variant.parameters = {
viewMode: 'canvas'
};