@react-spectrum/s2
Version:
Spectrum 2 UI components in React
142 lines (130 loc) • 8.26 kB
JavaScript
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $bwC5I$reactjsxruntime = require("react/jsx-runtime");
var $bwC5I$reactariacomponents = require("react-aria-components");
var $bwC5I$react = require("react");
var $bwC5I$reactariautils = require("@react-aria/utils");
var $bwC5I$reactspectrumutils = require("@react-spectrum/utils");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "HeadingContext", () => $6367bc87eb7d24ad$export$d688439359537581);
$parcel$export(module.exports, "Heading", () => $6367bc87eb7d24ad$export$a8a3e93435678ff9);
$parcel$export(module.exports, "HeaderContext", () => $6367bc87eb7d24ad$export$e0e4026c12a8bdbb);
$parcel$export(module.exports, "Header", () => $6367bc87eb7d24ad$export$8b251419efc915eb);
$parcel$export(module.exports, "ContentContext", () => $6367bc87eb7d24ad$export$1cbdd774077931b4);
$parcel$export(module.exports, "Content", () => $6367bc87eb7d24ad$export$7c6e2c02157bb7d2);
$parcel$export(module.exports, "TextContext", () => $6367bc87eb7d24ad$export$9afb8bc826b033ea);
$parcel$export(module.exports, "Text", () => $6367bc87eb7d24ad$export$5f1af8db9871e1d6);
$parcel$export(module.exports, "KeyboardContext", () => $6367bc87eb7d24ad$export$744d98a3b8a94e1c);
$parcel$export(module.exports, "Keyboard", () => $6367bc87eb7d24ad$export$16e4d70cc375e707);
$parcel$export(module.exports, "FooterContext", () => $6367bc87eb7d24ad$export$5630640b68817ed6);
$parcel$export(module.exports, "Footer", () => $6367bc87eb7d24ad$export$a06f1c675e846f6f);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $6367bc87eb7d24ad$export$d688439359537581 = /*#__PURE__*/ (0, $bwC5I$react.createContext)(null);
const $6367bc87eb7d24ad$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $bwC5I$react.forwardRef)(function Heading(props, ref) {
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6367bc87eb7d24ad$export$d688439359537581);
let domRef = (0, $bwC5I$reactspectrumutils.useDOMRef)(ref);
let { UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles = '', isHidden: isHidden, slot: slot, ...otherProps } = props;
if (isHidden) return null;
return /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)((0, $bwC5I$reactariacomponents.Heading), {
...otherProps,
ref: domRef,
className: UNSAFE_className + styles,
style: UNSAFE_style,
slot: slot || undefined
});
});
const $6367bc87eb7d24ad$export$e0e4026c12a8bdbb = /*#__PURE__*/ (0, $bwC5I$react.createContext)(null);
const $6367bc87eb7d24ad$export$8b251419efc915eb = /*#__PURE__*/ (0, $bwC5I$react.forwardRef)(function Header(props, ref) {
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6367bc87eb7d24ad$export$e0e4026c12a8bdbb);
let domRef = (0, $bwC5I$reactspectrumutils.useDOMRef)(ref);
let { UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles = '', isHidden: isHidden, slot: slot, ...otherProps } = props;
if (isHidden) return null;
return /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)((0, $bwC5I$reactariacomponents.Header), {
...otherProps,
ref: domRef,
className: UNSAFE_className + styles,
style: UNSAFE_style,
slot: slot || undefined
});
});
const $6367bc87eb7d24ad$export$1cbdd774077931b4 = /*#__PURE__*/ (0, $bwC5I$react.createContext)(null);
const $6367bc87eb7d24ad$export$7c6e2c02157bb7d2 = /*#__PURE__*/ (0, $bwC5I$react.forwardRef)(function Content(props, ref) {
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6367bc87eb7d24ad$export$1cbdd774077931b4);
let domRef = (0, $bwC5I$reactspectrumutils.useDOMRef)(ref);
let { UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles = '', isHidden: isHidden, slot: slot, ...otherProps } = props;
if (isHidden) return null;
return /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)("div", {
...otherProps,
ref: domRef,
className: UNSAFE_className + styles,
style: UNSAFE_style,
slot: slot || undefined
});
});
const $6367bc87eb7d24ad$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $bwC5I$react.createContext)(null);
const $6367bc87eb7d24ad$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $bwC5I$react.forwardRef)(function Text(props, ref) {
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6367bc87eb7d24ad$export$9afb8bc826b033ea);
let domRef = (0, $bwC5I$reactspectrumutils.useDOMRef)(ref);
let { UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles = '', isHidden: isHidden, slot: slot, children: children, ...otherProps } = props;
let racContext = (0, $bwC5I$react.useContext)((0, $bwC5I$reactariacomponents.TextContext));
let isSkeleton = (0, $5eb75e0c130e0669$exports.useIsSkeleton)();
[children, UNSAFE_style] = (0, $5eb75e0c130e0669$exports.useSkeletonText)(children, UNSAFE_style);
if (isHidden) return null;
let text = /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)((0, $bwC5I$reactariacomponents.Text), {
...otherProps,
ref: domRef,
// @ts-ignore - compatibility with React < 19
inert: (0, $bwC5I$reactariautils.inertValue)(isSkeleton),
className: UNSAFE_className + styles,
style: UNSAFE_style,
slot: slot || undefined,
"data-rsp-slot": "text",
children: children
});
if (slot && racContext && 'slots' in racContext && !racContext.slots?.[slot]) return /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)((0, $bwC5I$reactariacomponents.TextContext).Provider, {
value: null,
children: text
});
return text;
});
const $6367bc87eb7d24ad$export$744d98a3b8a94e1c = /*#__PURE__*/ (0, $bwC5I$react.createContext)({});
const $6367bc87eb7d24ad$export$16e4d70cc375e707 = /*#__PURE__*/ (0, $bwC5I$react.forwardRef)(function Keyboard(props, ref) {
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6367bc87eb7d24ad$export$744d98a3b8a94e1c);
let domRef = (0, $bwC5I$reactspectrumutils.useDOMRef)(ref);
let { UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles = '', isHidden: isHidden, slot: slot, ...otherProps } = props;
if (isHidden) return null;
return /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)((0, $bwC5I$reactariacomponents.Keyboard), {
...otherProps,
ref: domRef,
className: UNSAFE_className + styles,
style: UNSAFE_style,
slot: slot || undefined
});
});
const $6367bc87eb7d24ad$export$5630640b68817ed6 = /*#__PURE__*/ (0, $bwC5I$react.createContext)({});
const $6367bc87eb7d24ad$export$a06f1c675e846f6f = /*#__PURE__*/ (0, $bwC5I$react.forwardRef)(function Footer(props, ref) {
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $6367bc87eb7d24ad$export$5630640b68817ed6);
let domRef = (0, $bwC5I$reactspectrumutils.useDOMRef)(ref);
let { UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, styles: styles = '', isHidden: isHidden, slot: slot, ...otherProps } = props;
if (isHidden) return null;
return /*#__PURE__*/ (0, $bwC5I$reactjsxruntime.jsx)("footer", {
...otherProps,
ref: domRef,
className: UNSAFE_className + styles,
style: UNSAFE_style,
slot: slot || undefined
});
});
//# sourceMappingURL=Content.cjs.map