@carbon/ibm-products
Version:
Carbon for IBM Products
70 lines (69 loc) • 2.14 kB
TypeScript
/**
* Copyright IBM Corp. 2021, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
type Type = 'manual' | 'auto';
type Status = 'default' | 'in-progress' | 'success' | 'fail';
export interface SavingProps {
/**
* Provide an optional class to be applied to the containing node.
*/
className?: string;
/**
* Description for default state icon (manual).
*/
defaultIconDescription?: string;
/**
* Default text for the save button (manual). Per design guidelines you probably don't want to display this in the auto mode.
*/
defaultText?: string;
/**
* Description for fail state icon (manual).
*/
failIconDescription?: string;
/**
* Text for failure state.
*/
failText?: string;
/**
* Description for in progress state icon (manual).
*/
inProgressIconDescription?: string;
/**
* Text for in progress state.
*/
inProgressText?: string;
/**
* Function handler for cancel button (manual).
*/
onRequestCancel?(event: React.MouseEvent<HTMLButtonElement>): void;
/**
* Function handler for save button (manual).
*/
onRequestSave?(event: React.MouseEvent<HTMLButtonElement>): void;
/**
* Text for the secondary or cancel button (manual).
*/
secondaryButtonText?: string;
/**
* The status of the save. default being the untouched default state -> in-progress being a save has been initiated -> fail or success being the outcome.
*/
status: Status;
/**
* Description for success state icon (manual).
*/
successIconDescription?: string;
/**
* Text for success state
*/
successText?: string;
/**
* Designates the style of the save component. Manual uses a set of buttons and auto just displays a string. See usage guidelines for additional information.
*/
type: Type;
}
export declare let Saving: React.ForwardRefExoticComponent<SavingProps & React.RefAttributes<unknown>>;
export {};