diff --git a/src/components/Select/WSelect.spec.ts b/src/components/Select/WSelect.spec.ts index 381a92f..ceadc11 100644 --- a/src/components/Select/WSelect.spec.ts +++ b/src/components/Select/WSelect.spec.ts @@ -14,17 +14,19 @@ describe('WSelect', () => { label: 'English', icon: null }, - options: [{ + options: [ + { key: 'en', label: 'English', icon: null - },{ + }, + { key: 'es', label: 'Español', - icon: null, + icon: null } ] - }, + } }) expect(wrapper.element).toMatchSnapshot() @@ -39,17 +41,19 @@ describe('WSelect', () => { label: 'English', icon: Icon }, - options: [{ + options: [ + { key: 'en', label: 'English', icon: Icon - },{ + }, + { key: 'es', label: 'Español', - icon: Icon, + icon: Icon } ] - }, + } }) expect(wrapper.element).toMatchSnapshot() diff --git a/src/components/Select/WSelect.stories.ts b/src/components/Select/WSelect.stories.ts index 1736629..f364038 100644 --- a/src/components/Select/WSelect.stories.ts +++ b/src/components/Select/WSelect.stories.ts @@ -10,18 +10,22 @@ const meta: any = { component: WSelect, tags: ['autodocs'], argTypes: { - dropdownPosition: { control: 'select', options: dropdownPostions }, + dropdownPosition: { control: 'select', options: dropdownPostions } }, args: { - options: [{ - key: 'en', - label: 'English', - icon: null, - },{ - key: 'es', - label: 'Español', - icon: null, - }]} + options: [ + { + key: 'en', + label: 'English', + icon: null + }, + { + key: 'es', + label: 'Español', + icon: null + } + ] + } } satisfies Meta export default meta @@ -34,26 +38,29 @@ export const Default: Story = { const model = ref({ key: 'en', label: 'English', - icon: null, - }); + icon: null + }) function update($event: any) { model.value = $event } - - return { args, model, update }; + + return { args, model, update } }, template: ``, args: { - options: [{ - key: 'en', - label: 'English', - icon: null, - },{ - key: 'es', - label: 'Español', - icon: Icon, - }] + options: [ + { + key: 'en', + label: 'English', + icon: null + }, + { + key: 'es', + label: 'Español', + icon: Icon + } + ] } }) -} \ No newline at end of file +} diff --git a/src/components/Select/WSelect.ts b/src/components/Select/WSelect.ts index e5b0cd4..a9ef07c 100644 --- a/src/components/Select/WSelect.ts +++ b/src/components/Select/WSelect.ts @@ -1,6 +1,6 @@ -export type Option = {key: string, label: string, icon: string | null} +export type Option = { key: string; label: string; icon: string | null } export enum DropdownPosition { Top = 'top', Bottom = 'bottom' } -export const dropdownPostions = Object.values(DropdownPosition) \ No newline at end of file +export const dropdownPostions = Object.values(DropdownPosition) diff --git a/src/components/Select/WSelect.vue b/src/components/Select/WSelect.vue index 0a88bfc..25e249c 100644 --- a/src/components/Select/WSelect.vue +++ b/src/components/Select/WSelect.vue @@ -35,7 +35,7 @@ - diff --git a/src/components/Tooltip/WTooltip.spec.ts b/src/components/Tooltip/WTooltip.spec.ts index 291b2da..b632b8f 100644 --- a/src/components/Tooltip/WTooltip.spec.ts +++ b/src/components/Tooltip/WTooltip.spec.ts @@ -6,7 +6,7 @@ describe('WTooltip', () => { it('renders properly', () => { const wrapper = mount(WTooltip, { props: { - bgColor: '#000', + bgColor: '#000' }, slots: { main: `

Text

`, diff --git a/src/components/Tooltip/WTooltip.stories.ts b/src/components/Tooltip/WTooltip.stories.ts index 02c25a3..79ac600 100644 --- a/src/components/Tooltip/WTooltip.stories.ts +++ b/src/components/Tooltip/WTooltip.stories.ts @@ -1,14 +1,18 @@ import type { Meta, StoryObj } from '@storybook/vue3' import WTooltip from './WTooltip.vue' +import { TooltipPosition, tooltipPostions } from './WTooltip' const meta: any = { title: 'Example/WTooltip', component: WTooltip, tags: ['autodocs'], - argTypes: {}, + argTypes: { + position: { control: 'select', options: tooltipPostions } + }, args: { bgColor: '#000', - }, + position: TooltipPosition.CenterTop + } } satisfies Meta export default meta @@ -20,11 +24,11 @@ export const Default: Story = { setup() { return { args } }, - template: ``, args: { - bgColor: 'black-950', + bgColor: 'black-950' } }) } diff --git a/src/components/Tooltip/WTooltip.ts b/src/components/Tooltip/WTooltip.ts new file mode 100644 index 0000000..0ba88d9 --- /dev/null +++ b/src/components/Tooltip/WTooltip.ts @@ -0,0 +1,9 @@ +export enum TooltipPosition { + CenterTop = 'center-top', + RightTop = 'right-top', + LeftTop = 'left-top', + CenterBottom = 'center-bottom', + RightBottom = 'right-bottom', + LeftBottom = 'left-bottom' +} +export const tooltipPostions = Object.values(TooltipPosition) diff --git a/src/components/Tooltip/WTooltip.vue b/src/components/Tooltip/WTooltip.vue index 7b5c6d2..cba96f2 100644 --- a/src/components/Tooltip/WTooltip.vue +++ b/src/components/Tooltip/WTooltip.vue @@ -1,20 +1,42 @@ -