@navinc/base-react-components
Version:
Nav's Pattern Library
95 lines (94 loc) • 3.09 kB
TypeScript
import { DetailedHTMLProps, HTMLAttributes } from 'react';
export declare const defaultSize = "md";
export declare const sizeVariants: {
readonly xxs: {
readonly fontSize: "10px";
readonly lineHeight: "14px";
};
readonly xs: {
readonly fontSize: "12px";
readonly lineHeight: "18px";
};
readonly sm: {
readonly fontSize: "14px";
readonly lineHeight: "20px";
};
readonly md: {
readonly fontSize: "16px";
readonly lineHeight: "24px";
};
readonly lg: {
readonly fontSize: "18px";
readonly lineHeight: "27px";
};
};
declare const boldVariants: {
regular: {
fontWeight: number;
};
semiBold: {
fontWeight: number;
};
bold: {
fontWeight: number;
};
};
type BoldKey = keyof typeof boldVariants;
export type SizeKey = keyof typeof sizeVariants;
type SizeProp = keyof (typeof sizeVariants)['xxs'];
export declare const getSize: ({ size }: {
size?: "md" | "xxs" | "xs" | "sm" | "lg" | undefined;
}) => {
readonly fontSize: "10px";
readonly lineHeight: "14px";
} | {
readonly fontSize: "12px";
readonly lineHeight: "18px";
} | {
readonly fontSize: "14px";
readonly lineHeight: "20px";
} | {
readonly fontSize: "16px";
readonly lineHeight: "24px";
} | {
readonly fontSize: "18px";
readonly lineHeight: "27px";
};
export declare const getFromSize: (prop: SizeProp, fallback?: string) => ({ size }: {
size?: "md" | "xxs" | "xs" | "sm" | "lg" | undefined;
}) => "10px" | "14px" | "12px" | "18px" | "20px" | "16px" | "24px" | "27px";
export declare const getVariableSize: ({ size, shouldScaleFont, }: {
size?: "md" | "xxs" | "xs" | "sm" | "lg" | undefined;
shouldScaleFont?: boolean | undefined;
}) => {
readonly fontSize: "10px";
readonly lineHeight: "14px";
} | {
readonly fontSize: "12px";
readonly lineHeight: "18px";
} | {
readonly fontSize: "14px";
readonly lineHeight: "20px";
} | {
readonly fontSize: "16px";
readonly lineHeight: "24px";
} | {
readonly fontSize: "18px";
readonly lineHeight: "27px";
};
export declare const getFromVariableSize: (prop: SizeProp, fallback?: string) => ({ size, shouldScaleFont }: {
size?: "md" | "xxs" | "xs" | "sm" | "lg" | undefined;
shouldScaleFont?: boolean | undefined;
}) => "10px" | "14px" | "12px" | "18px" | "20px" | "16px" | "24px" | "27px";
export type CopyProps = {
bold?: boolean;
shouldScaleFont?: boolean;
light?: boolean;
size?: SizeKey;
boldType?: BoldKey;
} & DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
/**
* @deprecated Use `CopyVariant as Copy` instead. This component will be removed in a future release. CopyVariant replaces Header, Copy, and Text.
*/
export declare const Copy: import("styled-components").StyledComponent<({ bold: _bold, shouldScaleFont: _shouldScaleFont, boldType: _boldType, light: _light, ...props }: CopyProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
export {};