baseui
Version:
A React Component library implementing the Base design language
45 lines (44 loc) • 1.41 kB
TypeScript
import type * as React from 'react';
import type { Override } from '../helpers/overrides';
import type { ACTION_POSITION, ARTWORK_TYPE, HIERARCHY, KIND } from './constants';
export type ActionPosition = (typeof ACTION_POSITION)[keyof typeof ACTION_POSITION];
export type ArtworkType = (typeof ARTWORK_TYPE)[keyof typeof ARTWORK_TYPE];
export type Hierarchy = (typeof HIERARCHY)[keyof typeof HIERARCHY];
export type Kind = (typeof KIND)[keyof typeof KIND];
export type ActionContent = {
label: string;
icon?: (a: {
size: string;
}) => React.ReactNode;
onClick: (a: React.SyntheticEvent<HTMLButtonElement>) => unknown;
position?: ActionPosition;
};
export type ArtworkIcon = (a: {
size: string;
}) => React.ReactNode;
export type ArtworkContent = {
icon: ArtworkIcon;
type?: ArtworkType;
};
export type BannerOverrides = {
BelowContent?: Override;
LeadingContent?: Override;
Message?: Override;
MessageContent?: Override;
Root?: Override;
Title?: Override;
TrailingContent?: Override;
TrailingButtonContainer?: Override;
TrailingButton?: Override;
TrailingIconButton?: Override;
};
export type BannerProps = {
action?: ActionContent;
artwork?: ArtworkContent;
children?: React.ReactNode;
hierarchy?: Hierarchy;
kind?: Kind;
overrides?: BannerOverrides;
nested?: boolean;
title?: React.ReactNode;
};