@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
35 lines (34 loc) • 1.04 kB
TypeScript
/**
* combobox.ts
*
* Type definitions for the combobox and listbox components.
* Used by both Elements and React implementations
* and by the shared combobox helper functions.
*/
/**
* Tag skin colors available for combobox option tags.
* Matches the TTagSkin values from the tag component.
*/
export type TPktComboboxTagSkin = 'blue' | 'blue-dark' | 'blue-light' | 'green' | 'red' | 'yellow' | 'beige' | 'gray' | 'grey';
/**
* Represents a single option in a combobox or listbox.
*/
export interface IPktComboboxOption {
description?: string;
disabled?: boolean;
fulltext?: string;
label?: string;
prefix?: string;
selected?: boolean;
tagSkinColor?: TPktComboboxTagSkin;
userAdded?: boolean;
value: string;
}
/**
* How the selected value is displayed in the combobox input.
*/
export type TPktComboboxDisplayValue = 'label' | 'value' | 'prefixAndValue';
/**
* Placement of selected value tags in multiple selection mode.
*/
export type TPktComboboxTagPlacement = 'inside' | 'outside';