diff --git a/lib/Styled/Box.tsx b/lib/Styled/Box.tsx index 25ce8be9d4b..0811606137f 100644 --- a/lib/Styled/Box.tsx +++ b/lib/Styled/Box.tsx @@ -1,6 +1,6 @@ import { Ref } from "react"; import styled from "styled-components"; -import { OneKeyFrom, Overflow, WhiteSpace, WordBreak } from "./Styled.types"; +import { Overflow, WhiteSpace, WordBreak } from "./Styled.types"; interface Column { col1?: boolean; @@ -68,7 +68,7 @@ export interface IBoxPropsBase { as?: React.ElementType | keyof JSX.IntrinsicElements; } -export type IBoxProps = IBoxPropsBase & OneKeyFrom; +export type IBoxProps = IBoxPropsBase & Column; export const Box = styled.div` display: flex; diff --git a/lib/Styled/Styled.types.ts b/lib/Styled/Styled.types.ts index 26b30bdd665..2d83724fc05 100644 --- a/lib/Styled/Styled.types.ts +++ b/lib/Styled/Styled.types.ts @@ -23,12 +23,6 @@ export type WhiteSpace = | "initial" | "inherit"; -export type OneKeyFrom = K extends any - ? Pick & Partial, never>> extends infer O - ? { [P in keyof O]: O[P] } - : never - : never; - /** * Types that can be used after upgrade to ts4. */ diff --git a/lib/Styled/Text.tsx b/lib/Styled/Text.tsx index 0e58759baab..73819e0ad4d 100644 --- a/lib/Styled/Text.tsx +++ b/lib/Styled/Text.tsx @@ -1,6 +1,5 @@ import { ComponentProps } from "react"; import styled from "styled-components"; -import { OneKeyFrom } from "./Styled.types"; interface ITextSize { noFontSize?: boolean; @@ -52,9 +51,9 @@ export interface ITextPropsBase { } export type ITextProps = ITextPropsBase & - OneKeyFrom & - OneKeyFrom & - OneKeyFrom & + ITextSize & + ITextColor & + ITextWeight & ComponentProps<"div">; // should it be a span or inline-block-div? - leaning to div