apphouse
Version:
Component library for React that uses observable state management and theme-able components.
73 lines (72 loc) • 1.9 kB
TypeScript
import React, { CSSProperties } from 'react';
import { BoxSizeStyles, ButtonAppearanceOptions } from '../../styles/defaults/themes.interface';
import { ButtonProps, ButtonStyles } from '../Button';
import { IconSizes } from '../../styles/defaults/app.token.values';
export interface ButtonDownloadStyles {
/**
* The styles for the button
* @optional
* @default {}
*/
button?: ButtonStyles;
/**
* The styles for the icon
*/
icon?: CSSProperties;
/**
* The styles for the text
*/
text?: CSSProperties;
}
export interface ButtonDownload extends ButtonProps {
/**
* The content of the file
*/
content: string;
/**
* The name you want to save your file as
* if promptFilename is true, this will be ignored in favor of the user filename
*/
filename: string;
/**
* Variant of the button
* @default 'primary'
* @optional
*/
variant?: ButtonAppearanceOptions;
/**
* The size of the icon
* @default m
* @optional
*/
iconSize?: keyof typeof IconSizes;
/**
* The content of the button
*/
children?: React.ReactNode;
/**
* If true, the user will be prompted to specify the filename
* @optional
* @default false (current date will be used)
*/
promptFilename?: boolean;
/**
* The extension of the file
* @required if promptFilename is true
* if not provided, the extension will be txt
*/
extension?: string;
size?: keyof BoxSizeStyles;
/**
* The width of the button
* @optional
* @default 100
*/
width?: string | number;
/**
* if true, all animations and will be reset and the button will be rendered as a simple button
* @default false
*/
raw?: boolean;
}
export declare const ButtonDownload: React.FC<ButtonDownload>;