diff --git a/src/assets/svg/icon-right-arrow.svg b/src/assets/svg/icon-right-arrow.svg new file mode 100644 index 0000000..4d78b73 --- /dev/null +++ b/src/assets/svg/icon-right-arrow.svg @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/src/assets/svg/rightArrow.svg b/src/assets/svg/rightArrow.svg deleted file mode 100644 index 40c36d7..0000000 --- a/src/assets/svg/rightArrow.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - \ No newline at end of file diff --git a/src/assets/svg/slashes.svg b/src/assets/svg/slashes.svg new file mode 100644 index 0000000..8505ca2 --- /dev/null +++ b/src/assets/svg/slashes.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/Button/AnimatedArrow.vue b/src/components/AnimatedArrow/AnimatedArrow.vue similarity index 99% rename from src/components/Button/AnimatedArrow.vue rename to src/components/AnimatedArrow/AnimatedArrow.vue index 583c208..cabcd5f 100644 --- a/src/components/Button/AnimatedArrow.vue +++ b/src/components/AnimatedArrow/AnimatedArrow.vue @@ -7,7 +7,6 @@ + diff --git a/src/components/Card/WCard.spec.ts b/src/components/Card/WCard.spec.ts new file mode 100644 index 0000000..82865ca --- /dev/null +++ b/src/components/Card/WCard.spec.ts @@ -0,0 +1,54 @@ +import { describe, it, expect } from 'vitest' + +import { mount } from '@vue/test-utils' +import WCard from './WCard.vue' +import { CardType } from './WCard' +import AnimatedArrow from '../AnimatedArrow/AnimatedArrow.vue' + +describe('WCard', () => { + it('base', () => { + const wrapper = mount(WCard, { + props: { + type: CardType.Base + }, + slots: { + default: 'Button' + } + }) + expect(wrapper.element).toMatchSnapshot() + }) + + it('icon', () => { + const wrapper = mount(WCard, { + props: { + type: CardType.Icon, + title: 'Lorem ipsum', + description: + 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + url: '#url', + urlLabel: 'Link to' + }, + slots: { + icon: 'WIcon' + } + }) + + expect(wrapper.element).toMatchSnapshot() + }) + + it('link', () => { + const wrapper = mount(WCard, { + props: { + type: CardType.Link, + title: 'Lorem ipsum' + }, + slots: { + description: + '

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

' + } + }) + + const found = wrapper.findComponent(AnimatedArrow) + expect(found.exists()).toBe(true) + }) +}) diff --git a/src/components/Card/WCard.stories.ts b/src/components/Card/WCard.stories.ts new file mode 100644 index 0000000..9272b46 --- /dev/null +++ b/src/components/Card/WCard.stories.ts @@ -0,0 +1,79 @@ +import type { Meta, StoryObj } from '@storybook/vue3' +import WCard from './WCard.vue' +import { CardType } from './WCard' + +const meta: any = { + title: 'Example/WCard', + component: WCard, + tags: ['autodocs'], + argTypes: { + type: { control: 'select', options: ['base', 'icon', 'link'] } + }, + args: { + type: CardType.Base + } +} satisfies Meta + +export default meta +type Story = StoryObj + +export const Base: Story = { + render: (args: any) => ({ + components: { WCard }, + setup() { + return { args } + }, + template: `` + }), + args: { + type: 'base' + } +} + +export const Icon: Story = { + parameters: { + backgrounds: { default: 'grey' } + }, + render: (args: any) => ({ + components: { WCard }, + setup() { + return { args } + }, + template: `` + }), + args: { + type: 'icon', + title: 'Lorem ipsum', + description: + 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.', + url: '#url', + urlLabel: 'Link to' + } +} + +export const Link: Story = { + render: (args: any) => ({ + components: { WCard }, + setup() { + return { args } + }, + template: `` + }), + args: { + type: 'link', + title: 'Lorem ipsum' + } +} diff --git a/src/components/Card/WCard.ts b/src/components/Card/WCard.ts new file mode 100644 index 0000000..ac29952 --- /dev/null +++ b/src/components/Card/WCard.ts @@ -0,0 +1,7 @@ +export enum CardType { + Base = 'base', + Icon = 'icon', + Link = 'link' +} + +export const cardTypes = Object.values(CardType) diff --git a/src/components/Card/WCard.vue b/src/components/Card/WCard.vue new file mode 100644 index 0000000..047ba2c --- /dev/null +++ b/src/components/Card/WCard.vue @@ -0,0 +1,138 @@ + + + + + diff --git a/src/components/Card/__snapshots__/WCard.spec.ts.snap b/src/components/Card/__snapshots__/WCard.spec.ts.snap new file mode 100644 index 0000000..2f9c773 --- /dev/null +++ b/src/components/Card/__snapshots__/WCard.spec.ts.snap @@ -0,0 +1,136 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`WCard > base 1`] = ` +
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+`; + +exports[`WCard > icon 1`] = ` +
+ + + +
+
+ + + WIcon + + +
+
+

+ Lorem ipsum +

+
+
+

+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. +

+ + + + + + +
+ +
+`; diff --git a/src/components/IconRounded/WIconRounded.stories.ts b/src/components/IconRounded/WIconRounded.stories.ts index 11fe8bf..f9809a5 100644 --- a/src/components/IconRounded/WIconRounded.stories.ts +++ b/src/components/IconRounded/WIconRounded.stories.ts @@ -36,6 +36,7 @@ export const Default: Story = { } }), args: { - size: 70 + size: 70, + disableHoverEffect: false } } diff --git a/src/components/IconRounded/WIconRounded.vue b/src/components/IconRounded/WIconRounded.vue index 75d58fd..a5cf7db 100644 --- a/src/components/IconRounded/WIconRounded.vue +++ b/src/components/IconRounded/WIconRounded.vue @@ -1,6 +1,7 @@