/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-6a365ba
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { useFocusableRef } from '@react-spectrum/utils';
import { forwardRef } from 'react';
import { useFocusable, useHover } from 'react-aria';
import { CONTAINER_STYLES, Element, extractStyles, filterBaseProps, TEXT_STYLES, } from '../../../tasty/index.js';
import { mergeProps } from '../../../utils/react/index.js';
import { useFocus } from '../../../utils/react/interactions.js';
const DEFAULT_STYLES = {
    display: 'inline-grid',
    position: 'relative',
    opacity: {
        '': 1,
        disabled: 0.4,
    },
    transition: 'theme',
};
const STYLE_PROPS = [...CONTAINER_STYLES, ...TEXT_STYLES];
function ActiveZone({ as, label, onClick, ...props }, ref) {
    const isDisabled = props.isDisabled;
    const styles = extractStyles(props, STYLE_PROPS, DEFAULT_STYLES);
    const domRef = useFocusableRef(ref);
    let { hoverProps, isHovered } = useHover({ isDisabled });
    let { focusProps, isFocused } = useFocus({ isDisabled });
    let { focusableProps } = useFocusable(props, domRef);
    return (_jsx(Element, { "data-hovered": isHovered && !isDisabled ? '' : null, "data-focused": isFocused && !isDisabled ? '' : null, "data-disabled": isDisabled || null, "aria-label": label, ...mergeProps(hoverProps, focusProps, focusableProps, { onClick }, filterBaseProps(props, { eventProps: true })), ref: domRef, tabIndex: props.excludeFromTabOrder || isDisabled ? -1 : 0, as: as, styles: styles }));
}
const _ActiveZone = forwardRef(ActiveZone);
_ActiveZone.displayName = 'ActiveZone';
export { _ActiveZone as ActiveZone };

        