"use client";
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
import { ChipButton } from "./ChipButton.js";
import { ChipDismissible } from "./ChipDismissible.js";
import { ChipLink } from "./ChipLink.js";
import { ChipToggle } from "./ChipToggle.js";
import React, { forwardRef } from "react";
import { jsx } from "react/jsx-runtime";

//#region src/components/client/Chip/Chip.tsx
/**
* **⚙️️ A chip.
*
* @componentType Client component
*
* @description
* Chips help people make selections, filter content, link out to other spaces or trigger actions. These actions are contextually driven and are not persistent across the product experiences differing them from buttons.
*
* @see
* Check out the {@link https://uds.build/docs/components/chip Chip Docs} for more info
*
* @example
* ```tsx
* 'use client';
* import { Chip } from "@yahoo/uds";
*
* <Chip>Label</Chip>
*```
*
* @related [Badge](https://uds.build/docs/components/badge), [Link](https://uds.build/docs/components/link).
**/
const Chip = forwardRef(function Chip({ onClick, href, linkProps, onDismiss, onToggle, isToggled, slotProps, ...rest }, ref) {
	const { anchor: anchorProps, ...restSlotProps } = slotProps ?? {};
	if (onDismiss) return /* @__PURE__ */ jsx(ChipDismissible, {
		ref,
		onDismiss,
		slotProps: restSlotProps,
		...rest
	});
	if (onToggle) return /* @__PURE__ */ jsx(ChipToggle, {
		ref,
		onToggle,
		isToggled,
		slotProps: restSlotProps,
		...rest
	});
	if (href) return /* @__PURE__ */ jsx(ChipLink, {
		ref,
		href,
		slotProps: restSlotProps,
		...rest,
		...linkProps,
		...anchorProps
	});
	return /* @__PURE__ */ jsx(ChipButton, {
		ref,
		onClick,
		slotProps: restSlotProps,
		...rest
	});
});
Chip.displayName = "Chip";

//#endregion
export { Chip };