@carbon/ibm-security
Version:
Carbon for Cloud & Cognitive IBM Security UI components
53 lines (51 loc) • 2.89 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children"],
_excluded2 = ["className"];
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 Getting started module.
* @copyright IBM Security 2021
*/
import classnames from 'classnames';
import { func } from 'prop-types';
import React from 'react';
import Microlayout, { microlayoutNamespace } from './Microlayout';
var namespace = 'getting-started';
/**
* The Getting Started Module provides the means to create a consistent and orderly getting started experience.
*/
var GettingStartedLayout = function GettingStartedLayout(_ref) {
var children = _ref.children,
other = _objectWithoutProperties(_ref, _excluded);
var content = children({
getLayoutProps: function getLayoutProps() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
className = _ref2.className,
rest = _objectWithoutProperties(_ref2, _excluded2);
var assignClassName = function assignClassName(type) {
return _objectSpread({
className: classnames(className, _defineProperty({}, "".concat(microlayoutNamespace, "--").concat(namespace, "__").concat(type), type))
}, rest);
};
return _objectSpread({
description: assignClassName('description'),
primaryButton: assignClassName('primary-button'),
secondaryButton: assignClassName('secondary-button'),
tertiaryButton: assignClassName('tertiary-button'),
illustration: assignClassName('illustration'),
additionalInfo: assignClassName('additional-info')
}, rest);
}
});
return /*#__PURE__*/React.createElement(Microlayout, _extends({
namespace: "".concat(namespace, " ").concat(microlayoutNamespace, "--").concat(namespace)
}, other), content);
};
GettingStartedLayout.propTypes = {
/** Provide the `DescriptionModule`, `Button` elements, `Grid` elements, and optionally `image` and `paragraph` elements, for the `GettingStartedLayout` */
children: func.isRequired
};
export default GettingStartedLayout;