@react-spectrum/s2
Version:
Spectrum 2 UI components in React
1 lines • 1.9 kB
Source Map (JSON)
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAc,KAAyB;IACrD,qBACE,gBAAC,CAAA,GAAA,oBAAgB;QAAG,GAAG,KAAK;kBAG1B,cAAA,gBAAC,CAAA,GAAA,qBAAa;YAAE,WAAW;sBACxB,MAAM,QAAQ;;;AAIvB","sources":["packages/@react-spectrum/s2/src/DialogTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {DialogTrigger as AriaDialogTrigger, DialogTriggerProps as AriaDialogTriggerProps} from 'react-aria-components';\nimport {PressResponder} from '@react-aria/interactions';\nimport {ReactNode} from 'react';\n\nexport interface DialogTriggerProps extends AriaDialogTriggerProps {}\n\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps): ReactNode {\n return (\n <AriaDialogTrigger {...props}>\n {/* RAC sets isPressed via PressResponder when the dialog is open.\n We don't want press scaling to appear to get \"stuck\", so override this. */}\n <PressResponder isPressed={false}>\n {props.children}\n </PressResponder>\n </AriaDialogTrigger>\n );\n}\n"],"names":[],"version":3,"file":"DialogTrigger.mjs.map"}