{"version":3,"sources":["../src/close-button.tsx"],"sourcesContent":["import { Icon, IconProps } from \"@chakra-ui/icon\"\nimport {\n  chakra,\n  forwardRef,\n  omitThemingProps,\n  SystemStyleObject,\n  ThemingProps,\n  useStyleConfig,\n  HTMLChakraProps,\n} from \"@chakra-ui/system\"\n\nfunction CloseIcon(props: IconProps) {\n  return (\n    <Icon focusable=\"false\" aria-hidden {...props}>\n      <path\n        fill=\"currentColor\"\n        d=\"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z\"\n      />\n    </Icon>\n  )\n}\n\nexport interface CloseButtonProps\n  extends HTMLChakraProps<\"button\">,\n    ThemingProps<\"CloseButton\"> {\n  /**\n   * If `true`, the close button will be disabled.\n   * @default false\n   */\n  isDisabled?: boolean\n}\n\n/**\n * A button with a close icon.\n *\n * It is used to handle the close functionality in feedback and overlay components\n * like Alerts, Toasts, Drawers and Modals.\n *\n * @see Docs https://chakra-ui.com/docs/components/close-button\n */\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n  function CloseButton(props, ref) {\n    const styles = useStyleConfig(\"CloseButton\", props)\n    const { children, isDisabled, __css, ...rest } = omitThemingProps(props)\n\n    const baseStyle: SystemStyleObject = {\n      outline: 0,\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"center\",\n      flexShrink: 0,\n    }\n\n    return (\n      <chakra.button\n        type=\"button\"\n        aria-label=\"Close\"\n        ref={ref}\n        disabled={isDisabled}\n        __css={{\n          ...baseStyle,\n          ...styles,\n          ...__css,\n        }}\n        {...rest}\n      >\n        {children || <CloseIcon width=\"1em\" height=\"1em\" />}\n      </chakra.button>\n    )\n  },\n)\n\nCloseButton.displayName = \"CloseButton\"\n"],"mappings":";;;AAAA,SAAS,YAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,OAEK;AAKD;AAHN,SAAS,UAAU,OAAkB;AACnC,SACE,oBAAC,QAAK,WAAU,SAAQ,eAAW,MAAE,GAAG,OACtC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAoBO,IAAM,cAAc;AAAA,EACzB,SAASA,aAAY,OAAO,KAAK;AAC/B,UAAM,SAAS,eAAe,eAAe,KAAK;AAClD,UAAM,EAAE,UAAU,YAAY,OAAO,GAAG,KAAK,IAAI,iBAAiB,KAAK;AAEvE,UAAM,YAA+B;AAAA,MACnC,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACd;AAEA,WACE;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACC,MAAK;AAAA,QACL,cAAW;AAAA,QACX;AAAA,QACA,UAAU;AAAA,QACV,OAAO;AAAA,UACL,GAAG;AAAA,UACH,GAAG;AAAA,UACH,GAAG;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QAEH,sBAAY,oBAAC,aAAU,OAAM,OAAM,QAAO,OAAM;AAAA;AAAA,IACnD;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["CloseButton"]}