From acb303f61ccf46cc8369b05fbf9f148576cb2a15 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 20 Mar 2024 10:19:04 +0000 Subject: [PATCH] fix: omit size prop from jsx element --- components/canvas/Card/Card.ts | 2 +- components/canvas/Section/Section.ts | 2 +- components/composition/App/App.ts | 2 +- components/composition/Enter/Enter.ts | 2 +- components/composition/FormGroup/FormGroup.ts | 2 +- components/composition/Grid/Grid.ts | 2 +- components/composition/Grid/GridItem.ts | 2 +- components/composition/Wrap/Wrap.ts | 2 +- components/content/Img/Img.ts | 2 +- components/control/Button/Button.ts | 2 +- components/control/Input/Input.ts | 2 +- components/control/RadioCheckbox/RadioCheckbox.ts | 2 +- tsconfig.json | 3 ++- types/jsx-custom-element.ts | 11 +++++++---- 14 files changed, 21 insertions(+), 17 deletions(-) diff --git a/components/canvas/Card/Card.ts b/components/canvas/Card/Card.ts index 7093e8f..b0e6b58 100644 --- a/components/canvas/Card/Card.ts +++ b/components/canvas/Card/Card.ts @@ -26,7 +26,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-card': CardAttributes & JSXCustomElement; + 'diamond-card': JSXCustomElement; } } } diff --git a/components/canvas/Section/Section.ts b/components/canvas/Section/Section.ts index b3ddce3..a58557c 100644 --- a/components/canvas/Section/Section.ts +++ b/components/canvas/Section/Section.ts @@ -22,7 +22,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-section': SectionAttributes & JSXCustomElement; + 'diamond-section': JSXCustomElement; } } } diff --git a/components/composition/App/App.ts b/components/composition/App/App.ts index aba410f..769e2b3 100644 --- a/components/composition/App/App.ts +++ b/components/composition/App/App.ts @@ -35,7 +35,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-app': AppAttributes & JSXCustomElement; + 'diamond-app': JSXCustomElement; } } } diff --git a/components/composition/Enter/Enter.ts b/components/composition/Enter/Enter.ts index 1d5a47b..aebceab 100644 --- a/components/composition/Enter/Enter.ts +++ b/components/composition/Enter/Enter.ts @@ -70,7 +70,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-enter': EnterAttributes & JSXCustomElement; + 'diamond-enter': JSXCustomElement; } } } diff --git a/components/composition/FormGroup/FormGroup.ts b/components/composition/FormGroup/FormGroup.ts index a34cd12..5fa660a 100644 --- a/components/composition/FormGroup/FormGroup.ts +++ b/components/composition/FormGroup/FormGroup.ts @@ -13,7 +13,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-form-group': FormGroupAttributes & JSXCustomElement; + 'diamond-form-group': JSXCustomElement; } } } diff --git a/components/composition/Grid/Grid.ts b/components/composition/Grid/Grid.ts index 813e5a1..753285b 100644 --- a/components/composition/Grid/Grid.ts +++ b/components/composition/Grid/Grid.ts @@ -24,7 +24,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-grid': GridAttributes & JSXCustomElement; + 'diamond-grid': JSXCustomElement; } } } diff --git a/components/composition/Grid/GridItem.ts b/components/composition/Grid/GridItem.ts index 9ddecc2..81f88d3 100644 --- a/components/composition/Grid/GridItem.ts +++ b/components/composition/Grid/GridItem.ts @@ -42,7 +42,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-grid-item': GridItemAttributes & JSXCustomElement; + 'diamond-grid-item': JSXCustomElement; } } } diff --git a/components/composition/Wrap/Wrap.ts b/components/composition/Wrap/Wrap.ts index b01a22f..9ab4e6e 100644 --- a/components/composition/Wrap/Wrap.ts +++ b/components/composition/Wrap/Wrap.ts @@ -14,7 +14,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-wrap': WrapAttributes & JSXCustomElement; + 'diamond-wrap': JSXCustomElement; } } } diff --git a/components/content/Img/Img.ts b/components/content/Img/Img.ts index 934ab6a..87cb082 100644 --- a/components/content/Img/Img.ts +++ b/components/content/Img/Img.ts @@ -48,7 +48,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-img': ImgAttributes & JSXCustomElement; + 'diamond-img': JSXCustomElement; } } } diff --git a/components/control/Button/Button.ts b/components/control/Button/Button.ts index 23ad794..b62c04b 100644 --- a/components/control/Button/Button.ts +++ b/components/control/Button/Button.ts @@ -15,7 +15,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-button': ButtonAttributes & JSXCustomElement; + 'diamond-button': JSXCustomElement; } } } diff --git a/components/control/Input/Input.ts b/components/control/Input/Input.ts index 510e179..05e1558 100644 --- a/components/control/Input/Input.ts +++ b/components/control/Input/Input.ts @@ -13,7 +13,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-input': InputAttributes & JSXCustomElement; + 'diamond-input': JSXCustomElement; } } } diff --git a/components/control/RadioCheckbox/RadioCheckbox.ts b/components/control/RadioCheckbox/RadioCheckbox.ts index 8f71ce9..06e47d6 100644 --- a/components/control/RadioCheckbox/RadioCheckbox.ts +++ b/components/control/RadioCheckbox/RadioCheckbox.ts @@ -45,7 +45,7 @@ declare global { declare module 'react' { namespace JSX { interface IntrinsicElements { - 'diamond-radio-checkbox': RadioCheckboxAttributes & JSXCustomElement; + 'diamond-radio-checkbox': JSXCustomElement; } } } diff --git a/tsconfig.json b/tsconfig.json index 63aa379..b929e59 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "allowSyntheticDefaultImports": true }, "exclude": [ - "node_modules" + "node_modules", + "dist" ] } diff --git a/types/jsx-custom-element.ts b/types/jsx-custom-element.ts index 3123ecf..e2e0382 100644 --- a/types/jsx-custom-element.ts +++ b/types/jsx-custom-element.ts @@ -1,4 +1,7 @@ -export type JSXCustomElement = React.HTMLAttributes & { - key?: string | number; - class?: string; -}; +export type JSXCustomElement = T & + Omit, 'size'> & { + key?: string | number; + class?: string; + slot?: string; + shadowRoot?: ShadowRoot; + };