apphouse
Version:
Component library for React that uses observable state management and theme-able components.
44 lines (43 loc) • 1.24 kB
TypeScript
import React from 'react';
import { ButtonAppearanceOptions } from '../../styles/defaults/themes.interface';
import { ButtonProps } from '../Button';
import { IconSizes } from '../../styles/defaults/app.token.values';
export interface ButtonSaveAsProps extends ButtonProps {
/**
* If true, the icon will not show
* @default false
* @optional
*/
hideIcon?: boolean;
/**
* 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;
/**
* The callback function that will be called when the user confirms the document name
*/
onSave: (filename: string) => void;
/**
* if provided, it will substitute the icon
* it will be ignored if hideIcon is true
* @optional
* @default <IoSave size={tokens.iconSize[iconSize || 'm']} />
*/
icon?: React.ReactNode;
}
/**
* A button that will prompt a filename before running the onClick function
*/
export declare const ButtonSaveAs: React.FC<ButtonSaveAsProps>;