From 59089551ef7860c3dbd781a2f8f57d49b51e114e Mon Sep 17 00:00:00 2001 From: Florent Schildknecht Date: Fri, 23 Apr 2021 16:54:55 +0200 Subject: [PATCH] feat(theme-ui__components): remove theme-ui__components package @theme-ui/components provides its own types as of v0.6.0 (https://github.com/system-ui/theme-ui/issues/1582)) --- notNeededPackages.json | 4 + types/theme-ui__components/index.d.ts | 354 ------------------ types/theme-ui__components/package.json | 7 - .../theme-ui__components-tests.tsx | 349 ----------------- types/theme-ui__components/tsconfig.json | 29 -- types/theme-ui__components/tslint.json | 1 - 6 files changed, 4 insertions(+), 740 deletions(-) delete mode 100644 types/theme-ui__components/index.d.ts delete mode 100644 types/theme-ui__components/package.json delete mode 100644 types/theme-ui__components/theme-ui__components-tests.tsx delete mode 100644 types/theme-ui__components/tsconfig.json delete mode 100644 types/theme-ui__components/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 96fbb70383d412..c52ec2046fa5ce 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -3838,6 +3838,10 @@ "libraryName": "theme-ui", "asOfVersion": "0.3.1" }, + "theme-ui__components": { + "libraryName": "@theme-ui/components", + "asOfVersion": "0.6.0" + }, "theming": { "libraryName": "theming", "asOfVersion": "2.0.0" diff --git a/types/theme-ui__components/index.d.ts b/types/theme-ui__components/index.d.ts deleted file mode 100644 index 4e8bf69a7db79e..00000000000000 --- a/types/theme-ui__components/index.d.ts +++ /dev/null @@ -1,354 +0,0 @@ -// Type definitions for @theme-ui/components 0.3 -// Project: https://github.com/system-ui/theme-ui -// Definitions by: Piotr Monwid-Olechnowicz -// Kristóf Poduszló -// Jesús Jiménez Ballano -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.5 - -import * as React from 'react'; -import { StyledComponent } from '@emotion/styled'; -import { InterpolationWithTheme } from '@emotion/core'; -import { SxStyleProp } from 'theme-ui'; -import { SpaceProps, ColorProps, ResponsiveValue, MarginProps } from 'styled-system'; - -export {}; - -type Omit = Pick>; - -type Assign = { - [P in keyof (T & U)]: P extends keyof T ? T[P] : P extends keyof U ? U[P] : never; -}; - -type ForwardRef = React.ForwardRefExoticComponent & React.RefAttributes>; - -export interface BoxOwnProps extends SpaceProps, ColorProps { - as?: React.ElementType; - variant?: string; - sx?: SxStyleProp; - css?: InterpolationWithTheme; -} -export interface BoxProps extends Assign, BoxOwnProps> {} -/** - * Use the Box component as a layout primitive to add margin, padding, and colors to content. - * @see https://theme-ui.com/components/box - */ -export const Box: StyledComponent, BoxOwnProps, {}>; - -export type FlexStyleProps = BoxOwnProps; -export type FlexProps = BoxProps; -/** - * Use the Flex component to create flexbox layouts. - * @see https://theme-ui.com/components/flex - */ -export const Flex: StyledComponent, FlexStyleProps, {}>; - -export interface GridProps extends BoxProps { - /** - * Minimum width of child elements - */ - width?: ResponsiveValue; - /** - * Number of columns to use for the layout (cannot be used in conjunction with the width prop) - */ - columns?: ResponsiveValue; - /** - * Space between child elements - */ - gap?: ResponsiveValue; -} -/** - * CSS grid layout component to arrange direct child elements in a tiled grid layout. - * @see https://theme-ui.com/components/grid - */ -export const Grid: ForwardRef; - -export interface ButtonProps extends Assign, BoxOwnProps> {} -/** - * Primitive button component with variants - * @see https://theme-ui.com/components/button - */ -export const Button: ForwardRef; - -export interface LinkProps extends Assign, BoxOwnProps> {} -/** - * Link variants can be defined in the `theme.links` object. - * By default the Link component will use styles defined in `theme.styles.a`. - * @see https://theme-ui.com/components/link - */ -export const Link: ForwardRef; - -export type TextProps = BoxProps; -/** - * Primitive typographic component. - * - * Text style variants can be defined in the theme.text object. - * @see https://theme-ui.com/components/text - */ -export const Text: ForwardRef; - -export interface HeadingProps extends Assign, BoxOwnProps> {} -/** - * Primitive heading component, defaults to

. - * - * Text style variants can be defined in the theme.text object. - * The Heading component uses theme.text.heading as its default variant style. - * @see https://theme-ui.com/components/heading - */ -export const Heading: ForwardRef; - -export interface ImageProps extends Assign, BoxOwnProps> {} -/** - * Image style variants can be defined in the theme.images object. - * @see https://theme-ui.com/components/image/ - */ -export const Image: ForwardRef; - -export type CardProps = BoxProps; -/** - * Card style variants can be defined in the `theme.cards` object. - * By default the Card component uses the `theme.cards.primary` variant. - * @see https://theme-ui.com/components/card - */ -export const Card: ForwardRef; - -export interface LabelProps extends Assign, BoxOwnProps> {} -/** - * Label variants can be defined in `theme.forms` - * and the component uses the `theme.forms.label` variant by default. - * @see https://theme-ui.com/components/label/ - */ -export const Label: ForwardRef; - -export interface InputProps extends Assign, BoxOwnProps> {} -/** - * Input variants can be defined in `theme.forms` - * and the component uses the `theme.forms.input` variant by default. - * @see https://theme-ui.com/components/input/ - */ -export const Input: ForwardRef; - -export interface SelectProps extends Assign, BoxOwnProps> {} -/** - * Select variants can be defined in `theme.forms` - * and the component uses the `theme.forms.select` variant by default. - * @see https://theme-ui.com/components/select/ - */ -export const Select: ForwardRef; - -export interface TextareaProps extends Assign, BoxOwnProps> {} -/** - * Form textarea component - * - * Textarea variants can be defined in `theme.forms` - * and the component uses the `theme.forms.textarea` variant by default. - * @see https://theme-ui.com/components/textarea/ - */ -export const Textarea: ForwardRef; - -export interface RadioProps extends Assign, BoxOwnProps> {} -/** - * Form radio input component - * - * Radio variants can be defined in `theme.forms` and the - * component uses the `theme.forms.radio variant` by default. - * @see https://theme-ui.com/components/radio/ - */ -export const Radio: ForwardRef; - -export interface CheckboxProps extends Assign, BoxOwnProps> {} -/** - * Form checkbox input component - * - * Checkbox variants can be defined in `theme.forms` and the - * component uses the `theme.forms.checkbox` variant by default. - * @see https://theme-ui.com/components/checkbox/ - */ -export const Checkbox: ForwardRef; - -export interface SliderProps extends Assign, BoxOwnProps> {} -/** - * Range input element - * - * Slider variants can be defined in the `theme.forms` object. - * The Slider component uses `theme.forms.slider` as its default variant style. - * @see https://theme-ui.com/components/slider/ - */ -export const Slider: ForwardRef; - -export interface FieldOwnProps extends MarginProps { - /** - * Text for Label component - */ - label: string; - /** - * Used for the for, id, and name attributes - */ - name: string; -} -export type FieldProps = FieldOwnProps & - Omit, 'as' | keyof FieldOwnProps> & { - /** - * form control to render, default Input - */ - as?: T; - }; - -// `T` is far from unnecessary. We derive component props from it. -// tslint:disable-next-line no-unnecessary-generics -export function Field>(props: FieldProps): JSX.Element; - -export interface ProgressProps extends Assign, BoxOwnProps> {} -/** - * @see https://theme-ui.com/components/progress/ - */ -export const Progress: ForwardRef; - -export interface DonutProps - extends Assign< - Omit, 'opacity' | 'color' | 'css' | 'sx' | 'max' | 'min'>, - BoxOwnProps - > { - value: number; - min?: number; - max?: number; - title?: string; - size?: string | number; -} -/** - * Single value SVG donut chart - * @see https://theme-ui.com/components/donut/ - */ -export const Donut: ForwardRef; - -export interface SpinnerProps - extends Assign, 'opacity' | 'color' | 'css' | 'sx'>, BoxOwnProps> { - size?: number | string; -} -export const Spinner: ForwardRef; - -export interface AvatarProps extends ImageProps { - size?: number | string; -} -export const Avatar: ForwardRef; - -export type BadgeProps = BoxProps; -export const Badge: ForwardRef; - -export interface CloseProps extends Omit {} -/** - * Button with close (×) icon. - * - * The Close component renders as a