@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
38 lines (37 loc) • 1.75 kB
TypeScript
import type { Generic } from 'adopted-style-sheets';
import type { Callback } from '../enums';
import type { PropAlign, PropDisabled, PropHideLabel, PropLabel, PropTabBehavior, PropTooltipAlign } from '../props';
import type { EventCallback, EventValueOrEventCallback, KoliBriIconsProp, Stringified } from '../types';
import type { PropHasCreateButton } from '../props/has-create-button';
export type KoliBriTabsCallbacks = {
onCreate?: EventCallback<Event>;
} & {
[Callback.onSelect]?: EventValueOrEventCallback<CustomEvent | KeyboardEvent | MouseEvent | PointerEvent, number>;
};
export type KoliBriTabButtonCallbacks = {
[Callback.onSelect]?: EventValueOrEventCallback<CustomEvent | KeyboardEvent | MouseEvent | PointerEvent, number>;
};
type RequiredTabButtonProps = PropLabel;
type OptionalTabButtonProps = {
icons: Stringified<KoliBriIconsProp>;
on: KoliBriTabButtonCallbacks;
} & PropDisabled & PropHideLabel & PropTooltipAlign;
export type TabButtonProps = Generic.Element.Members<RequiredTabButtonProps, OptionalTabButtonProps>;
type RequiredProps = {
tabs: Stringified<TabButtonProps[]>;
} & PropLabel;
type OptionalProps = {
on: KoliBriTabsCallbacks;
selected: number;
} & PropAlign & PropHasCreateButton & PropTabBehavior;
type RequiredStates = {
selected: number;
tabs: TabButtonProps[];
} & PropLabel & PropAlign;
type OptionalStates = {
on: KoliBriTabsCallbacks;
} & PropTabBehavior & PropHasCreateButton;
export type TabsProps = Generic.Element.Members<RequiredProps, OptionalProps>;
export type TabsStates = Generic.Element.Members<RequiredStates, OptionalStates>;
export type TabsAPI = Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates>;
export {};