From 86f4fe25db5c1273f9940195aba18b584e1a1d91 Mon Sep 17 00:00:00 2001 From: jacob-8 Date: Wed, 24 Apr 2024 15:33:01 +0800 Subject: [PATCH] fix check errors --- src/lib/data/BadgeArray.variants.ts | 31 +++++++++++++---------------- src/lib/shell/Avatar.variants.ts | 22 ++++++++++---------- src/lib/ui/MultiSelect.variants.ts | 8 ++++---- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/lib/data/BadgeArray.variants.ts b/src/lib/data/BadgeArray.variants.ts index 49e1c8c..799b52b 100644 --- a/src/lib/data/BadgeArray.variants.ts +++ b/src/lib/data/BadgeArray.variants.ts @@ -1,15 +1,15 @@ -import type { Variants } from 'kitbook'; -import type Component from './BadgeArray.svelte'; +import type { DeprecatedVariant } from 'kitbook' +import type Component from './BadgeArray.svelte' -const books = ['Lord of the Rings', 'www.books.com']; +const books = ['Lord of the Rings', 'www.books.com'] -export const variants: Variants = [ +export const variants: DeprecatedVariant[] = [ { name: 'Basic display', props: { strings: books, - promptMessage: "What is the book name?", - addMessage: "Add Book" + promptMessage: 'What is the book name?', + addMessage: 'Add Book', }, }, // rtl @@ -18,23 +18,20 @@ export const variants: Variants = [ props: { canEdit: true, strings: books, - promptMessage: "What is the book name?", - addMessage: "Add Book" + promptMessage: 'What is the book name?', + addMessage: 'Add Book', }, }, // editable rtl { - name: "handles strings", + name: 'handles strings', props: { - strings: "How about this?" as any as Array, - promptMessage: "Let's see how this works... Add something", - addMessage: "Add Something" - } - } + strings: 'How about this?' as any as string[], + promptMessage: 'Let\'s see how this works... Add something', + addMessage: 'Add Something', + }, + }, ] // automatically log events // on:valueupdated={(e) => console.log('valueupdated', e.detail)} - - - diff --git a/src/lib/shell/Avatar.variants.ts b/src/lib/shell/Avatar.variants.ts index 3b110f2..430989e 100644 --- a/src/lib/shell/Avatar.variants.ts +++ b/src/lib/shell/Avatar.variants.ts @@ -1,7 +1,7 @@ -import type { Variants } from 'kitbook'; -import type Component from './Avatar.svelte'; +import type { DeprecatedVariant } from 'kitbook' +import type Component from './Avatar.svelte' -export const variants: Variants = [ +export const variants: DeprecatedVariant[] = [ { name: 'image', props: { @@ -10,7 +10,7 @@ export const variants: Variants = [ email: 'b@gc.com', photoURL: 'https://lh5.googleusercontent.com/-qCXZXfIkRQ8/AAAAAAAAAAI/AAAAAAAAACc/wAdH8yns3QQ/photo.jpg', - } + }, }, }, { @@ -21,23 +21,25 @@ export const variants: Variants = [ email: 'b@gc.com', photoURL: 'https://broken-link.broken.jpg', - } + }, }, }, { name: 'full name', props: { user: { - displayName: 'John Smith', email: 'b@gc.com', - } + displayName: 'John Smith', + email: 'b@gc.com', + }, }, }, { name: 'single name', props: { user: { - displayName: 'John', email: 'b@gc.com', - } + displayName: 'John', + email: 'b@gc.com', + }, }, }, { @@ -45,7 +47,7 @@ export const variants: Variants = [ props: { user: { // email: 'b@gc.com', - } + }, }, }, ] diff --git a/src/lib/ui/MultiSelect.variants.ts b/src/lib/ui/MultiSelect.variants.ts index ebdf051..c7b2648 100644 --- a/src/lib/ui/MultiSelect.variants.ts +++ b/src/lib/ui/MultiSelect.variants.ts @@ -1,20 +1,20 @@ -import type { Variant, Viewport } from 'kitbook' +import type { DeprecatedVariant, Viewport } from 'kitbook' import type Component from './MultiSelect.svelte' export const viewports: Viewport[] = [ { width: 800, height: 600 }, ] -export const variants: Variant[] = [ +export const variants: DeprecatedVariant[] = [ { props: { options: [ - { value: 'en', name: 'English' }, + { value: 'en', name: 'English' }, { value: 'es', name: 'Spanish' }, { value: 'fr', name: 'French' }, ], selectedOptions: { - 'en': { value: 'en', name: 'English' } + en: { value: 'en', name: 'English' }, }, }, },