@rarcifa/cronos-design-system
Version:
A typescript react component library following the Cronos branding standards
47 lines (46 loc) • 2.17 kB
TypeScript
import { SearchProps } from './interface';
export declare const helper: {
/**
* Determines the appropriate background color for the searchbar based on its props.
* Considers the state of the search and style props to apply the correct color.
*
* @param {ButtonProps} props - The props passed to the search bar component.
* @returns {string} The calculated background color.
*/
getBackgroundColor: (props: SearchProps) => string;
/**
* Determines the appropriate border color for the search bar based on its props.
* The function considers the states primary and secondary
* to apply the corresponding border color.
*
* @param {SearchProps} props - The props passed to the search bar component.
* @returns {string} The calculated border color.
*/
getBorderColor: (props: SearchProps) => string;
/**
* Calculates the appropriate border-radius for the search bar based on the 'rounded' prop.
* If 'rounded' is true, a larger border-radius is applied for a pill-shaped search bar.
* Otherwise, a standard border-radius is used.
*
* @param {SearchProps} props - The props passed to the search bar component.
* @returns {string} The border-radius value in pixels.
*/
getBorderRadius: (props: SearchProps) => string;
/**
* Determines the width of the search bar based on its variant.
* Uses the Variant enum to set specific width for different search bar variants.
* Defaults to a standard width of 255px if no matching variant is found.
*
* @param {ButtonProps} props - The props passed to the search bar component.
* @returns {string} The calculated width.
*/
getWidth: (props: SearchProps) => string;
/**
* Determines the padding of the search bar based on its variant.
* Uses the Variant enum to set specific padding for different search bar variants.
*
* @param {ButtonProps} props - The props passed to the search bar component.
* @returns {string} The calculated padding.
*/
getPadding: (props: SearchProps) => string;
};