import { define } from '../preactement/define';
import { placements, Tooltip } from '../../Tooltip';
import { parseBooleanAttr } from '../wrapperUtils';
import { isPossibleValue } from '../utils';
import { jsx as _jsx } from "react/jsx-runtime";
const attributes = ['active-class-name', 'class-name', 'close-button-label', 'component', 'content-heading', 'dialog', 'interactive-border', 'inversed', 'max-width', 'placement', 'root-id', 'show-close-button', 'title', 'transition-duration', 'trigger-aria-label', 'z-index'];

/* eslint-disable @typescript-eslint/no-namespace */

/* eslint-enable */

const Wrapper = _ref => {
  let {
    contentHeading,
    dialog,
    inversed,
    rootId,
    title,
    ...otherProps
  } = _ref;
  return /*#__PURE__*/_jsx(Tooltip, {
    ...otherProps,
    ariaLabel: otherProps.triggerAriaLabel,
    contentHeading: contentHeading,
    dialog: parseBooleanAttr(dialog),
    inversed: parseBooleanAttr(inversed),
    showCloseButton: parseBooleanAttr(otherProps.showCloseButton),
    id: rootId,
    title: title,
    placement: isPossibleValue(otherProps.placement, placements) ? otherProps.placement : Tooltip.defaultProps.placement
  });
};
define('ds-tooltip', () => Wrapper, {
  attributes
});