@carbon/react
Version:
React components for the Carbon Design System
38 lines (30 loc) • 1.08 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var PropTypes = require('prop-types');
var React = require('react');
var usePrefix = require('../../internal/usePrefix.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
function ClassPrefix({
children,
prefix
}) {
return /*#__PURE__*/React__default["default"].createElement(usePrefix.PrefixContext.Provider, {
value: prefix
}, children);
}
ClassPrefix.propTypes = {
children: PropTypes__default["default"].node,
/**
* The value used to prefix the CSS selectors used by Carbon components
*/
prefix: PropTypes__default["default"].string.isRequired
};
exports.ClassPrefix = ClassPrefix;