UNPKG

@stratakit/structures

Version:

Medium-sized component structures for the Strata design system

83 lines (82 loc) 3.53 kB
import * as React from "react"; import type { BaseProps } from "@stratakit/foundations/secret-internals"; interface ChipRootProps extends BaseProps<"div"> { /** * The variant style of the Chip. * Use "solid" for primary states and "outline" for less prominent states. * * @default "solid" */ variant?: "solid" | "outline"; } /** * Root component of the compositional Chip component. * * Example: * ```tsx * <Chip.Root> * <Chip.Label>Label</Chip.Label> * <Chip.DismissButton onClick={onClick} /> * </Chip.Root> * ``` * * @deprecated Use MUI [`Chip`](https://mui.com/material-ui/api/chip/) component instead. * See [migration guide](https://stratakit.bentley.com/docs/getting-started/migration-from-legacy-stratakit/#chip). */ declare const ChipRoot: React.ForwardRefExoticComponent<ChipRootProps & React.RefAttributes<HTMLDivElement | HTMLElement>>; interface ChipLabelProps extends BaseProps<"span"> { } /** * Label component that should be used with the compositional Chip component. * * @deprecated Use [`label`](https://mui.com/material-ui/api/chip/#chip-prop-label) prop of MUI [`Chip`](https://mui.com/material-ui/api/chip/) component instead. * See [migration guide](https://stratakit.bentley.com/docs/getting-started/migration-from-legacy-stratakit/#chip). */ declare const ChipLabel: React.ForwardRefExoticComponent<ChipLabelProps & React.RefAttributes<HTMLElement | HTMLSpanElement>>; interface ChipDismissButtonProps extends Omit<BaseProps<"button">, "children"> { /** * Label for the dismiss button. * * The final accessible name of the dismiss button is a combination of this `label` and the text content of `Chip.Label`. * * @default "Dismiss" */ label?: string; } /** * Dismiss button component that should be used with the compositional Chip component. * * @deprecated Use [`onDelete`](https://mui.com/material-ui/api/chip/#chip-prop-onDelete), [`deleteIcon`](https://mui.com/material-ui/api/chip/#chip-prop-deleteIcon) props of MUI [`Chip`](https://mui.com/material-ui/api/chip/) component instead. * See [migration guide](https://stratakit.bentley.com/docs/getting-started/migration-from-legacy-stratakit/#chip). */ declare const ChipDismissButton: React.ForwardRefExoticComponent<ChipDismissButtonProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>; interface ChipProps extends Omit<BaseProps<"div">, "children">, Pick<ChipRootProps, "variant"> { /** * The label displayed inside the chip. */ label: React.ReactNode; /** * Callback invoked when the dismiss ("❌") button is clicked. * * If `undefined`, the dismiss button will not be rendered. * * @default undefined */ onDismiss?: () => void; } /** * Chip is a UI component used to represent an item, attribute, or action in a compact visual style. * It supports two visual variants: `solid` for primary emphasis and `outline` for less prominent states. * * Example: * ```tsx * <Chip label="Value" /> * <Chip label="Value" variant="outline" /> * ``` * * @deprecated Use MUI [`Chip`](https://mui.com/material-ui/api/chip/) component instead. * See [migration guide](https://stratakit.bentley.com/docs/getting-started/migration-from-legacy-stratakit/#chip). */ declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement | HTMLElement>>; export default Chip; export { ChipDismissButton as DismissButton, ChipLabel as Label, ChipRoot as Root, };