UNPKG

@base-ui/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

27 lines (25 loc) 718 B
'use client'; import * as React from 'react'; import { CSPContext } from "./CSPContext.js"; /** * Provides a default Content Security Policy (CSP) configuration for Base UI components that * require inline `<style>` or `<script>` tags. * * Documentation: [Base UI CSP Provider](https://base-ui.com/react/utils/csp-provider) */ import { jsx as _jsx } from "react/jsx-runtime"; export function CSPProvider(props) { const { children, nonce, disableStyleElements } = props; const contextValue = React.useMemo(() => ({ nonce, disableStyleElements }), [nonce, disableStyleElements]); return /*#__PURE__*/_jsx(CSPContext.Provider, { value: contextValue, children: children }); }