@carbon/ibm-security
Version:
Carbon for Cloud & Cognitive IBM Security UI components
45 lines (44 loc) • 2.05 kB
JavaScript
/**
* @file Pill stories.
* @copyright IBM Security 2019 - 2021
*/
import React from 'react';
import { storiesOf } from '@storybook/react';
import { text } from '@storybook/addon-knobs';
import { components } from '../../../.storybook';
import { carbonPrefix } from '../../globals/namespace';
import Pill from './Pill';
import { InlineNotification, NotificationActionButton } from '../../';
import { Grid } from 'carbon-components-react';
storiesOf(components('Pill#legacy'), module).addDecorator(function (Story) {
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InlineNotification, {
className: "page-layouts__banner",
actions: /*#__PURE__*/React.createElement(NotificationActionButton, {
href: "https://v1-ibm-products.carbondesignsystem.com/?path=/story/security-components-decorator--default",
rel: "noopener noreferrer",
target: "_blank"
}, "View replacement"),
kind: "info",
subtitle: "Component no longer supported. The component will remain available, but plan to migrate to the component replacement.",
title: "",
hideCloseButton: true
}), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Story, null)));
}).add("default", function () {
return /*#__PURE__*/React.createElement("div", {
style: {
padding: '64px'
}
}, /*#__PURE__*/React.createElement(Pill, {
value: text('value', '127.0.0.1'),
type: text('type', 'IP')
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", {
style: {
width: '400px'
},
className: "".concat(carbonPrefix, "--type-body-long-01")
}, "This is an inline decorator that appears inside a paragraph, alongside text.", /*#__PURE__*/React.createElement(Pill, {
value: text('value', '127.0.0.1'),
type: text('type', 'IP'),
inline: true
}), "This variation of the decorator component is smaller to match the font size of the paragraph text."));
});