@cbinsights/fds
Version:
Form: A design system by CB Insights
32 lines (23 loc) • 1.99 kB
JavaScript
;
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ImportPath = void 0;
var _react = _interopRequireWildcard(require("react"));
var _addonDocs = require("@storybook/addon-docs");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var ImportPath = function ImportPath() {
var _context$kind;
var context = (0, _react.useContext)(_addonDocs.DocsContext);
var componentName = (_context$kind = context.kind) === null || _context$kind === void 0 ? void 0 : _context$kind.split('/')[1];
var path = "import { ".concat(componentName, " } from '@cbinsights/fds/lib/components'");
return /*#__PURE__*/_react.default.createElement(_addonDocs.Source, {
language: "js",
code: path
});
};
exports.ImportPath = ImportPath;
var _default = ImportPath;
exports.default = _default;