Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix dependencies and improve types #1068

Merged
merged 2 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/components/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
},
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-core": "^4.0.0",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-icon": "^4.0.0",
"@contentful/f36-icons": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/components/empty-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-core": "^4.0.0",
"@contentful/f36-typography": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/forms/src/Label/Label.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cx, css } from 'emotion';
import React, { forwardRef } from 'react';
import type { HTMLProps, ReactNode } from 'react';
import type { ReactNode } from 'react';
import tokens from '@contentful/f36-tokens';
import { Box } from '@contentful/f36-core';
import type { BoxProps } from '@contentful/f36-core';
Expand All @@ -13,7 +13,7 @@ export type LabelInternalProps = {
/**
* ID of the input to associate the label with
*/
htmlFor: HTMLProps<HTMLLabelElement>['htmlFor'];
htmlFor: JSX.IntrinsicElements['label']['htmlFor'];
/**
* Whether or not the associated input element is required
*
Expand Down
1 change: 1 addition & 0 deletions packages/components/helptext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-core": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/components/icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-core": "^4.0.0",
"emotion": "^10.0.17"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/components/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@babel/runtime": "^7.6.2",
"@contentful/f36-icon": "^4.0.0",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-core": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export interface ControlledInputProps extends Omit<BoxProps<'div'>, 'ref'> {
testId?: string;
canBlurOnEsc?: boolean;
isIndeterminate?: boolean;
inputProps?: Partial<React.InputHTMLAttributes<HTMLInputElement>>;
labelProps?: Partial<React.InputHTMLAttributes<HTMLLabelElement>>;
inputProps?: Partial<JSX.IntrinsicElements['input']>;
labelProps?: Partial<JSX.IntrinsicElements['label']>;
}

const _ControlledInput = (
Expand Down
1 change: 1 addition & 0 deletions packages/components/list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-core": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions packages/components/note/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-button": "^4.0.0",
"@contentful/f36-typography": "^4.0.0",
"@contentful/f36-icons": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions packages/components/pill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"dependencies": {
"@babel/runtime": "^7.6.2",
"@contentful/f36-tokens": "^4.0.0",
"@contentful/f36-core": "^4.0.0",
"@contentful/f36-utils": "^4.0.0",
"@contentful/f36-icons": "^4.0.0",
"emotion": "^10.0.17"
},
"peerDependencies": {
Expand Down
8 changes: 3 additions & 5 deletions packages/components/table/src/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { cx, css } from 'emotion';
import React, { forwardRef } from 'react';
import type { HTMLProps } from 'react';
import { Box } from '@contentful/f36-core';
import type { BoxProps } from '@contentful/f36-core';
import tokens from '@contentful/f36-tokens';
Expand All @@ -27,10 +26,9 @@ const styles = {
}),
};

export type TableInternalProps = HTMLProps<HTMLTableElement> &
Omit<BoxProps<'table'>, 'as'> & {
layout?: 'inline' | 'embedded';
};
export type TableInternalProps = Omit<BoxProps<'table'>, 'as'> & {
layout?: 'inline' | 'embedded';
};

export type TableProps = TableInternalProps;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface BaseCardProps {
/**
* Used with href to specify target attribute value
*/
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
target?: JSX.IntrinsicElements['a']['target'];
/**
* Applies selected styles to the element
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ type IconPositionType = 'right' | 'left';
export interface TextLinkProps {
children?: React.ReactNode;
linkType?: TextLinkType;
href?: React.AnchorHTMLAttributes<HTMLAnchorElement>['href'];
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
rel?: React.AnchorHTMLAttributes<HTMLInputElement>['rel'];
href?: JSX.IntrinsicElements['a']['href'];
target?: JSX.IntrinsicElements['a']['target'];
rel?: JSX.IntrinsicElements['a']['rel'];
disabled?: boolean;
testId?: string;
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
Expand Down