UNPKG

1.89 kBSource Map (JSON)View Raw
1{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWM,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,CAAC,YAAC,QAAQ,EAAE,GAAG,OAAsB,EAAE;IAC/E,MAAM,CAAA,GAAA,kCAAW,EAAE;IACnB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE;QAAC,GAAG,KAAK;aAAE;IAAG;IAC1C,IAAI,QAAQ,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAChC,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CACvB,OACA,aAAa;IACb;aAAC;QAAK,GAAG,CAAA,GAAA,gCAAS,EAAE,MAAM,KAAK,EAAE,WAAW;IAAA;AAEhD","sources":["packages/@react-aria/interactions/src/Pressable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps, useObjectRef} from '@react-aria/utils';\nimport {PressProps, usePress} from './usePress';\nimport React, {ForwardedRef, ReactElement} from 'react';\n\ninterface PressableProps extends PressProps {\n children: ReactElement<DOMAttributes, string>\n}\n\nexport const Pressable = React.forwardRef(({children, ...props}: PressableProps, ref: ForwardedRef<HTMLElement>) => {\n ref = useObjectRef(ref);\n let {pressProps} = usePress({...props, ref});\n let child = React.Children.only(children);\n return React.cloneElement(\n child,\n // @ts-ignore\n {ref, ...mergeProps(child.props, pressProps)}\n );\n});\n"],"names":[],"version":3,"file":"Pressable.main.js.map"}
\No newline at end of file