UNPKG

1.77 kBJavaScriptView Raw
1var $0294ea432cd92340$exports = require("./usePress.main.js");
2var $ev4bP$reactariautils = require("@react-aria/utils");
3var $ev4bP$react = require("react");
4
5
6function $parcel$interopDefault(a) {
7 return a && a.__esModule ? a.default : a;
8}
9
10function $parcel$export(e, n, v, s) {
11 Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12}
13
14$parcel$export(module.exports, "Pressable", () => $e1dbec26039c051d$export$27c701ed9e449e99);
15/*
16 * Copyright 2020 Adobe. All rights reserved.
17 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18 * you may not use this file except in compliance with the License. You may obtain a copy
19 * of the License at http://www.apache.org/licenses/LICENSE-2.0
20 *
21 * Unless required by applicable law or agreed to in writing, software distributed under
22 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23 * OF ANY KIND, either express or implied. See the License for the specific language
24 * governing permissions and limitations under the License.
25 */
26
27
28const $e1dbec26039c051d$export$27c701ed9e449e99 = /*#__PURE__*/ (0, ($parcel$interopDefault($ev4bP$react))).forwardRef(({ children: children, ...props }, ref)=>{
29 ref = (0, $ev4bP$reactariautils.useObjectRef)(ref);
30 let { pressProps: pressProps } = (0, $0294ea432cd92340$exports.usePress)({
31 ...props,
32 ref: ref
33 });
34 let child = (0, ($parcel$interopDefault($ev4bP$react))).Children.only(children);
35 return /*#__PURE__*/ (0, ($parcel$interopDefault($ev4bP$react))).cloneElement(child, // @ts-ignore
36 {
37 ref: ref,
38 ...(0, $ev4bP$reactariautils.mergeProps)(child.props, pressProps)
39 });
40});
41
42
43//# sourceMappingURL=Pressable.main.js.map