@compositive/components-controls
Version:
Compositive component library including form controls.
36 lines • 1.56 kB
TypeScript
import type { Theme, ThemedSxProp, UnknownTheme } from "@compositive/foundation";
import type { ReactElement, SyntheticEvent } from "react";
export declare namespace Button {
type Props<T extends UnknownTheme> = {
/**
* The color scheme the button should be using.
*/
palette?: Theme.Reference<T, "palette">;
/**
* The text that should be displayed on the button.
*/
children: string;
state?: "default" | "pressed" | "hovered" | "disabled";
onPress?: (e: SyntheticEvent) => void;
onPressIn?: (e: SyntheticEvent) => void;
onPressOut?: (e: SyntheticEvent) => void;
onHoverStart?: (e: SyntheticEvent) => void;
onHoverEnd?: (e: SyntheticEvent) => void;
sx?: ThemedSxProp<T>;
};
type SurfaceProps<T extends UnknownTheme> = {
palette?: Theme.Reference<T, "palette">;
};
}
/**
* A Button allows users to perform an action or to navigate to another page.
*
* They have multiple styles for various needs, and are ideal for calling attention
* to where a user needs to do something in order to move forward in a flow.
*/
export declare const Button: <T extends UnknownTheme = UnknownTheme>({ children, palette, onPress, onPressIn, onPressOut, onHoverStart, onHoverEnd, state, sx, }: Button.Props<T>) => ReactElement;
export declare const $Button: {
readonly surface: readonly [symbol, "button", "default"];
readonly typography: readonly [symbol, "button", "default"];
};
//# sourceMappingURL=Button.d.ts.map