From b35f0a4b03046330ecf802ef6db8a9d5bac590c4 Mon Sep 17 00:00:00 2001 From: Eduardo Diaz Ugarte Date: Sun, 20 Nov 2022 17:14:23 -0500 Subject: [PATCH] fix: missing types components in global components Add type string[] in HstButtonGroup, HstCheckboxList --- .../src/components/button/HstButtonGroup.vue | 2 +- .../src/components/checkbox/HstCheckboxList.vue | 2 +- packages/histoire-plugin-vue/components.d.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/histoire-controls/src/components/button/HstButtonGroup.vue b/packages/histoire-controls/src/components/button/HstButtonGroup.vue index a9ce4e9b..784e9588 100644 --- a/packages/histoire-controls/src/components/button/HstButtonGroup.vue +++ b/packages/histoire-controls/src/components/button/HstButtonGroup.vue @@ -13,7 +13,7 @@ import HstButton from './HstButton.vue' const props = defineProps<{ title?: string modelValue: string - options: HstControlOption[] + options: string[] | HstControlOption[] }>() const formattedOptions: ComputedRef> = computed(() => { diff --git a/packages/histoire-controls/src/components/checkbox/HstCheckboxList.vue b/packages/histoire-controls/src/components/checkbox/HstCheckboxList.vue index 67739ec8..7f948475 100644 --- a/packages/histoire-controls/src/components/checkbox/HstCheckboxList.vue +++ b/packages/histoire-controls/src/components/checkbox/HstCheckboxList.vue @@ -13,7 +13,7 @@ import HstSimpleCheckbox from './HstSimpleCheckbox.vue' const props = defineProps<{ title?: string modelValue: Array - options: HstControlOption[] + options: string[] | HstControlOption[] }>() const formattedOptions: ComputedRef> = computed(() => { diff --git a/packages/histoire-plugin-vue/components.d.ts b/packages/histoire-plugin-vue/components.d.ts index 73738f70..11ad19cb 100644 --- a/packages/histoire-plugin-vue/components.d.ts +++ b/packages/histoire-plugin-vue/components.d.ts @@ -13,6 +13,12 @@ import type { HstTokenGrid, HstTokenList, HstColorShades, + HstSelect, + HstButton, + HstButtonGroup, + HstCheckboxList, + HstJson, + HstSlider, } from '@histoire/controls' // Utils @@ -139,5 +145,11 @@ declare module '@vue/runtime-core' { HstTokenGrid: typeof HstTokenGrid HstTokenList: typeof HstTokenList HstColorShades: typeof HstColorShades + HstSelect: typeof HstSelect + HstButton: typeof HstButton + HstButtonGroup: typeof HstButtonGroup + HstCheckboxList: typeof HstCheckboxList + HstJson: typeof HstJson + HstSlider: typeof HstSlider } }