From 8b9f3f7958262b9bfa10aee5fc4fc846682a60e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krystian=20Droz=CC=87dz=CC=87yn=CC=81ski?= Date: Sat, 1 Jun 2024 20:05:20 +0200 Subject: [PATCH] Fix elements attributes per type in Vue --- .changeset/stupid-clocks-provide.md | 5 +++++ packages/vue/src/component.ts | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/stupid-clocks-provide.md diff --git a/.changeset/stupid-clocks-provide.md b/.changeset/stupid-clocks-provide.md new file mode 100644 index 0000000..af41f84 --- /dev/null +++ b/.changeset/stupid-clocks-provide.md @@ -0,0 +1,5 @@ +--- +"@teiler/vue": patch +--- + +Fix elements attributes per type diff --git a/packages/vue/src/component.ts b/packages/vue/src/component.ts index f82fca1..57aa3d4 100644 --- a/packages/vue/src/component.ts +++ b/packages/vue/src/component.ts @@ -1,12 +1,13 @@ import type { Compiler, DefaultTheme, HTMLElements, Properties, Sheet, StyleDefinition, TeilerComponent } from '@teiler/core' -import type { DefineComponent, HTMLAttributes } from 'vue' +import type { DefineComponent, IntrinsicElementAttributes } from 'vue' import Styled from './Styled' import { component, global, keyframes, styled, tags } from '@teiler/core' +type Attributes = Pick[Target] type VueRawBindings = { styleSheet: Sheet; theme: DefaultTheme } -type VueTeilerComponent = TeilerComponent & DefineComponent +type VueTeilerComponent = TeilerComponent & DefineComponent, VueRawBindings, {}, {}, {}> const createComponent = (styleDefinition: StyleDefinition): VueTeilerComponent => { const component = Styled(styleDefinition) @@ -14,7 +15,7 @@ const createComponent = (styleDefinition: St } type InferProps = Component extends VueTeilerComponent ? P & Props : Props -type InferComponent = Component extends VueTeilerComponent ? VueTeilerComponent : VueTeilerComponent +type InferComponent = Component extends VueTeilerComponent ? VueTeilerComponent : VueTeilerComponent type Component = { (string: TemplateStringsArray, ...properties: Properties[]): VueTeilerComponent