UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

59 lines (58 loc) 2.55 kB
import { IconName } from '../../types'; import { ChipGroupProps } from './ChipGroup'; type ValidationProps = Pick<ChipGroupProps, 'chips' | 'id' | 'label'>; export declare const validateChipGroupProps: ({ chips, id, label, }: ValidationProps) => void; export declare const validateIsLiveRegionPresent: () => void; export interface Chip { /** Unique id for the Chip. */ id: string | number; /** Label text displayed inside the Chip. */ label: string; /** Disables the Chip, preventing user interaction. * @default false */ disabled?: boolean; /** Name of the icon to display */ iconName?: IconName; /** Displays the Chip as selected */ isSelected?: boolean; /** Callback function called when the Chip is clicked. */ onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void; } export declare const CHIP_GROUP_SIZE: readonly ["medium", "small"]; export type ChipGroupSize = (typeof CHIP_GROUP_SIZE)[number]; export type ChipGroupSelectionMode = 'single' | 'multiple'; export type ChipGroupLanguage = 'de' | 'en'; export type ChipGroupAriaTranslations = typeof DS_CHIP_GROUP_TRANSLATIONS_EN; export declare const DS_CHIP_GROUP_TRANSLATIONS_EN: { disabled: string; selected: string; selectChip: string; unselectAction: string; selectAction: string; addToSelection: string; removeFromSelection: string; removeChip: string; tooltipDisabled: string; tooltipRemovable: string; tooltipDeactivate: string; tooltipActivate: string; }; export declare const DS_CHIP_GROUP_TRANSLATIONS_DE: { disabled: string; selected: string; selectChip: string; unselectAction: string; selectAction: string; addToSelection: string; removeFromSelection: string; removeChip: string; tooltipDisabled: string; tooltipRemovable: string; tooltipDeactivate: string; tooltipActivate: string; }; export declare const DS_CHIP_GROUP_TRANSLATIONS: Record<ChipGroupLanguage, ChipGroupAriaTranslations>; export declare const getChipAriaLabel: (t: (key: keyof ChipGroupAriaTranslations, replacements?: string[]) => string, label: string, disabled: boolean | undefined, isSelected: boolean | undefined, selectionMode: ChipGroupSelectionMode, isRemovable: boolean | undefined) => string; export declare const getChipTooltip: (t: (key: keyof ChipGroupAriaTranslations, replacements?: string[]) => string, disabled: boolean | undefined, isSelected: boolean | undefined, isRemovable: boolean | undefined) => string; export {};