@wix/design-system
Version:
@wix/design-system
118 lines (117 loc) • 5.35 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
exports.__esModule = true;
exports["default"] = void 0;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _react = _interopRequireDefault(require("react"));
var _Sections = require("@wix/wix-storybook-utils/Sections");
var _storySettings = require("../test/storySettings");
var examples = _interopRequireWildcard(require("./examples"));
var _ = _interopRequireDefault(require(".."));
var _Box = _interopRequireDefault(require("../../Box"));
var _CounterBadge = _interopRequireDefault(require("../../CounterBadge"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SidebarSectionItem/docs/index.story.jsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var childrenExamples = [{
label: 'Text',
value: 'Some text'
}, {
label: 'Multiple lines',
value: 'This is an example of multiple lines'
}];
var _default = exports["default"] = {
category: "".concat(_storySettings.storySettings.category, "/Sidebar"),
storyName: 'SidebarSectionItem',
component: _["default"],
componentPath: '..',
componentProps: {
children: childrenExamples[0].value
},
exampleProps: {
children: childrenExamples,
prefix: [{
label: 'Green circle',
value: /*#__PURE__*/_react["default"].createElement(_Box["default"], {
width: "8px",
height: "8px",
borderRadius: "50%",
backgroundColor: "G10",
__self: void 0,
__source: {
fileName: _jsxFileName,
lineNumber: 50,
columnNumber: 11
}
})
}],
suffix: [{
label: 'Counter badge',
value: /*#__PURE__*/_react["default"].createElement(_CounterBadge["default"], {
skin: "standard",
__self: void 0,
__source: {
fileName: _jsxFileName,
lineNumber: 62,
columnNumber: 16
}
}, "5")
}]
},
sections: [(0, _Sections.header)(), (0, _Sections.tabs)([(0, _Sections.tab)({
title: 'Description',
sections: [(0, _Sections.columns)([(0, _Sections.description)({
title: 'Description',
text: 'An item for the section within the sidebar.'
})]), (0, _Sections.importExample)("import { SidebarSectionItem } from '@wix/design-system';"), (0, _Sections.divider)(), (0, _Sections.title)('Examples'), (0, _Sections.example)({
title: 'Plain Example',
text: 'A simple example for section item',
source: examples.plain
}), (0, _Sections.example)({
title: 'Selected Item',
text: 'An example that demonstrates a selected item',
source: examples.selected
}), (0, _Sections.example)({
title: 'Disabled Item',
text: 'An example that demonstrates a disabled item',
source: examples.disabled
}), (0, _Sections.example)({
title: 'Drillable Item',
text: 'An example that demonstrates an icon for drilling in when hovering the item',
source: examples.drillable
}), (0, _Sections.example)({
title: 'Drillable Item with always shown Chevron',
text: 'An example that demonstrates an icon for drilling even without hovering',
source: examples.drillableAndAlwaysShowChevron
}), (0, _Sections.example)({
title: 'Item with Multiple Lines',
text: 'An example that demonstrates an item with multiple lines',
source: examples.multipleLines
}), (0, _Sections.example)({
title: 'Item with Prefix',
text: 'An example that demonstrates an item with provided prefix element',
source: examples.prefix
}), (0, _Sections.example)({
title: 'Item with Suffix (Counter Badge)',
text: 'An example that demonstrates an item with a `<CounterBadge />` used as a suffix element',
source: examples.counterBadgeSuffix
}), (0, _Sections.example)({
title: 'Item with Suffix (Badge)',
text: 'An example that demonstrates an item with a `<Badge />` used as a suffix element',
source: examples.badgeSuffix
}), (0, _Sections.example)({
title: 'Light Skin',
text: 'This example uses the `<Sidebar/>` to demonstrate the "light" skin design. Notice that when `<SidebarSectionItem/>` is contained inside `<Sidebar/>`, it affected by the `skin` prop accordingly',
source: examples.lightSkin
})]
})].concat((0, _toConsumableArray2["default"])([{
title: 'API',
sections: [(0, _Sections.api)()]
}, {
title: 'Testkit',
sections: [(0, _Sections.testkit)()]
}, {
title: 'Playground',
sections: [(0, _Sections.playground)()]
}].map(_Sections.tab))))]
};