Improve InputSelect, Text components

This commit is contained in:
Tom Moor
2024-04-01 21:23:38 -04:00
parent 4b54686c76
commit ec30ef84af
2 changed files with 11 additions and 1 deletions

View File

@@ -1,11 +1,19 @@
import styled, { css } from "styled-components";
import { ellipsis } from "@shared/styles";
type Props = {
/** The type of text to render */
type?: "secondary" | "tertiary" | "danger";
/** The size of the text */
size?: "xlarge" | "large" | "medium" | "small" | "xsmall";
/** The direction of the text (defaults to ltr) */
dir?: "ltr" | "rtl" | "auto";
/** Whether the text should be selectable (defaults to false) */
selectable?: boolean;
/** The font weight of the text */
weight?: "bold" | "normal";
/** Whether the text should be truncated with an ellipsis */
ellipsis?: boolean;
};
/**
@@ -48,6 +56,8 @@ const Text = styled.span<Props>`
white-space: normal;
user-select: ${(props) => (props.selectable ? "text" : "none")};
${(props) => props.ellipsis && ellipsis()}
`;
export default Text;