UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

37 lines (36 loc) 1.17 kB
import React from 'react'; import type { GetTranslationProps } from './Context'; export * from '../components/space/types'; export type ResponsiveProp<T> = { small?: T; medium?: T; large?: T; }; export type LocaleProps = GetTranslationProps; export type DataAttributeTypes = { /** * When using HTMLAttributes on object to define props, * we need not get data-* attributes as valid types: * * triggerAttributes={{ * 'data-testid': 'html-selector' * }} * * Effects: triggerAttributes, closeButtonAttributes */ 'data-testid'?: string; }; /** * The DynamicElement is a type to define a dynamic element type. */ export type DynamicElement<E = HTMLElement, P = React.DetailedHTMLProps<React.HTMLAttributes<E>, E>> = React.ElementType<P> | string; export type DynamicElementParams<T = Record<string, unknown>> = T; export type PropertiesTableProps = Record<string, { type: string | string[]; defaultValue?: string; doc: string; status: 'optional' | 'internal' | 'required' | 'deprecated'; }>; export type DeepPartial<T> = T extends object ? { [K in keyof T]?: DeepPartial<T[K]>; } : T;