'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var menuButton = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/menu/menu-button.cjs');
var React = require('react');
var triangleRight = require('../../icons/assets/triangle-right.svg.cjs');
var dropdownMenuItem = require('./dropdown-menu-item.cjs');
var dropdownMenuRoot = require('./dropdown-menu-root.cjs');
var utils = require('./utils.cjs');
var index = require('../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs');

const DropdownMenuTrigger = React.forwardRef(({ children, asChild, ...props }, ref) => {
    return (jsxRuntime.jsxRuntimeExports.jsx(menuButton.MenuButton, { ref: ref, render: asChild ? jsxRuntime.jsxRuntimeExports.jsx(index.Root, {}) : undefined, ...props, children: children }));
});
/**
 * `TriggerItem` is a helper component that renders a `Trigger` as a `MenuItem`.
 */
const DropdownMenuTriggerItem = React.forwardRef(({ children, value, trailingIcon = jsxRuntime.jsxRuntimeExports.jsx(triangleRight.ReactComponent, {}), ...props }, ref) => {
    const { parent } = dropdownMenuRoot.useDropdownContext();
    if (parent?.shouldFilter &&
        !utils.getMatch(value, children, parent?.searchValue)) {
        return null;
    }
    return (jsxRuntime.jsxRuntimeExports.jsx(menuButton.MenuButton, { ref: ref, render: jsxRuntime.jsxRuntimeExports.jsx(dropdownMenuItem.DropdownMenuItem, { value: value, trailingIcon: trailingIcon, ...props, forceRender: parent?.autocomplete ? 'combobox' : 'auto' }), children: children }));
});

exports.DropdownMenuTrigger = DropdownMenuTrigger;
exports.DropdownMenuTriggerItem = DropdownMenuTriggerItem;
//# sourceMappingURL=dropdown-menu-trigger.cjs.map
