Skip to content

Commit

Permalink
Merge pull request #46 from etchteam/feature/etch-453-size-prop-needs…
Browse files Browse the repository at this point in the history
…-to-be-omitted-from-jsxelement-type-or

Omit size prop from jsx element
  • Loading branch information
mergify[bot] authored Mar 20, 2024
2 parents f029486 + acb303f commit b0b5faa
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/canvas/Card/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-card': CardAttributes & JSXCustomElement;
'diamond-card': JSXCustomElement<CardAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/canvas/Section/Section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-section': SectionAttributes & JSXCustomElement;
'diamond-section': JSXCustomElement<SectionAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/App/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-app': AppAttributes & JSXCustomElement;
'diamond-app': JSXCustomElement<AppAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Enter/Enter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-enter': EnterAttributes & JSXCustomElement;
'diamond-enter': JSXCustomElement<EnterAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/FormGroup/FormGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-form-group': FormGroupAttributes & JSXCustomElement;
'diamond-form-group': JSXCustomElement<FormGroupAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Grid/Grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-grid': GridAttributes & JSXCustomElement;
'diamond-grid': JSXCustomElement<GridAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Grid/GridItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-grid-item': GridItemAttributes & JSXCustomElement;
'diamond-grid-item': JSXCustomElement<GridItemAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Wrap/Wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-wrap': WrapAttributes & JSXCustomElement;
'diamond-wrap': JSXCustomElement<WrapAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/content/Img/Img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-img': ImgAttributes & JSXCustomElement;
'diamond-img': JSXCustomElement<ImgAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/control/Button/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-button': ButtonAttributes & JSXCustomElement;
'diamond-button': JSXCustomElement<ButtonAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/control/Input/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-input': InputAttributes & JSXCustomElement;
'diamond-input': JSXCustomElement<InputAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/control/RadioCheckbox/RadioCheckbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-radio-checkbox': RadioCheckboxAttributes & JSXCustomElement;
'diamond-radio-checkbox': JSXCustomElement<RadioCheckboxAttributes>;
}
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
"node_modules",
"dist"
]
}
11 changes: 7 additions & 4 deletions types/jsx-custom-element.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export type JSXCustomElement = React.HTMLAttributes<HTMLElement> & {
key?: string | number;
class?: string;
};
export type JSXCustomElement<T = object> = T &
Omit<React.HTMLAttributes<HTMLElement>, 'size'> & {
key?: string | number;
class?: string;
slot?: string;
shadowRoot?: ShadowRoot;
};

0 comments on commit b0b5faa

Please sign in to comment.