{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport React from 'react';\nimport { AlertDialog, Button, Center } from \"/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/src/index\";\nexport var Example = function Example() {\n  var _React$useState = React.useState(false),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      isOpen = _React$useState2[0],\n      setIsOpen = _React$useState2[1];\n\n  var onClose = function onClose() {\n    return setIsOpen(false);\n  };\n\n  var cancelRef = React.useRef(null);\n  return React.createElement(Center, null, React.createElement(Button, {\n    colorScheme: \"danger\",\n    onPress: function onPress() {\n      return setIsOpen(!isOpen);\n    }\n  }, \"Delete Customer\"), React.createElement(AlertDialog, {\n    leastDestructiveRef: cancelRef,\n    isOpen: isOpen,\n    onClose: onClose\n  }, React.createElement(AlertDialog.Content, null, React.createElement(AlertDialog.CloseButton, null), React.createElement(AlertDialog.Header, null, \"Delete Customer\"), React.createElement(AlertDialog.Body, null, \"This will remove all data relating to Alex. This action cannot be reversed. Deleted data can not be recovered.\"), React.createElement(AlertDialog.Footer, null, React.createElement(Button.Group, {\n    space: 2\n  }, React.createElement(Button, {\n    variant: \"unstyled\",\n    colorScheme: \"coolGray\",\n    onPress: onClose,\n    ref: cancelRef\n  }, \"Cancel\"), React.createElement(Button, {\n    colorScheme: \"danger\",\n    onPress: onClose\n  }, \"Delete\"))))));\n};","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/storybook/stories/components/composites/AlertDialog/Basic.tsx"],"names":["React","AlertDialog","Button","Center","Example","useState","isOpen","setIsOpen","onClose","cancelRef","useRef"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,WAAT,EAAsBC,MAAtB,EAA8BC,MAA9B;AAEA,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAU,GAAM;AAAA,wBACCJ,KAAK,CAACK,QAAN,CAAe,KAAf,CADD;AAAA;AAAA,MACpBC,MADoB;AAAA,MACZC,SADY;;AAE3B,MAAMC,OAAO,GAAG,SAAVA,OAAU;AAAA,WAAMD,SAAS,CAAC,KAAD,CAAf;AAAA,GAAhB;;AACA,MAAME,SAAS,GAAGT,KAAK,CAACU,MAAN,CAAa,IAAb,CAAlB;AACA,SACE,oBAAC,MAAD,QACE,oBAAC,MAAD;AAAQ,IAAA,WAAW,EAAC,QAApB;AAA6B,IAAA,OAAO,EAAE;AAAA,aAAMH,SAAS,CAAC,CAACD,MAAF,CAAf;AAAA;AAAtC,uBADF,EAIE,oBAAC,WAAD;AACE,IAAA,mBAAmB,EAAEG,SADvB;AAEE,IAAA,MAAM,EAAEH,MAFV;AAGE,IAAA,OAAO,EAAEE;AAHX,KAKE,oBAAC,WAAD,CAAa,OAAb,QACE,oBAAC,WAAD,CAAa,WAAb,OADF,EAEE,oBAAC,WAAD,CAAa,MAAb,0BAFF,EAGE,oBAAC,WAAD,CAAa,IAAb,yHAHF,EAOE,oBAAC,WAAD,CAAa,MAAb,QACE,oBAAC,MAAD,CAAQ,KAAR;AAAc,IAAA,KAAK,EAAE;AAArB,KACE,oBAAC,MAAD;AACE,IAAA,OAAO,EAAC,UADV;AAEE,IAAA,WAAW,EAAC,UAFd;AAGE,IAAA,OAAO,EAAEA,OAHX;AAIE,IAAA,GAAG,EAAEC;AAJP,cADF,EASE,oBAAC,MAAD;AAAQ,IAAA,WAAW,EAAC,QAApB;AAA6B,IAAA,OAAO,EAAED;AAAtC,cATF,CADF,CAPF,CALF,CAJF,CADF;AAoCD,CAxCM","sourcesContent":["import React from 'react';\nimport { AlertDialog, Button, Center } from 'native-base';\n\nexport const Example = () => {\n  const [isOpen, setIsOpen] = React.useState(false);\n  const onClose = () => setIsOpen(false);\n  const cancelRef = React.useRef(null);\n  return (\n    <Center>\n      <Button colorScheme=\"danger\" onPress={() => setIsOpen(!isOpen)}>\n        Delete Customer\n      </Button>\n      <AlertDialog\n        leastDestructiveRef={cancelRef}\n        isOpen={isOpen}\n        onClose={onClose}\n      >\n        <AlertDialog.Content>\n          <AlertDialog.CloseButton />\n          <AlertDialog.Header>Delete Customer</AlertDialog.Header>\n          <AlertDialog.Body>\n            This will remove all data relating to Alex. This action cannot be\n            reversed. Deleted data can not be recovered.\n          </AlertDialog.Body>\n          <AlertDialog.Footer>\n            <Button.Group space={2}>\n              <Button\n                variant=\"unstyled\"\n                colorScheme=\"coolGray\"\n                onPress={onClose}\n                ref={cancelRef}\n              >\n                Cancel\n              </Button>\n              <Button colorScheme=\"danger\" onPress={onClose}>\n                Delete\n              </Button>\n            </Button.Group>\n          </AlertDialog.Footer>\n        </AlertDialog.Content>\n      </AlertDialog>\n    </Center>\n  );\n};\n"]},"metadata":{},"sourceType":"module"}