diff --git a/vue-components/src/components/Link.vue b/vue-components/src/components/Link.vue new file mode 100644 index 000000000..d4496b461 --- /dev/null +++ b/vue-components/src/components/Link.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/vue-components/src/styles/main.scss b/vue-components/src/styles/main.scss index 381eec3fc..df2dea0cc 100644 --- a/vue-components/src/styles/main.scss +++ b/vue-components/src/styles/main.scss @@ -1,4 +1,5 @@ @import '~ress'; @import '~@wmde/wikit-tokens/dist/variables'; @import './mixins/Label'; +@import './mixins/Link'; @import './mixins/Typography'; diff --git a/vue-components/src/styles/mixins/Link.scss b/vue-components/src/styles/mixins/Link.scss new file mode 100644 index 000000000..7f9e7530b --- /dev/null +++ b/vue-components/src/styles/mixins/Link.scss @@ -0,0 +1,26 @@ +@mixin Link { + font-family: $wikit-Link-font-family; + font-size: $wikit-Link-font-size; + font-weight: $wikit-Link-font-weight; + color: $wikit-Link-font-color; + line-height: $wikit-Link-line-height; + transition-property: $wikit-Link-transition-property; + transition-duration: $wikit-Link-transition-duration; + &:hover { + text-decoration: underline; + cursor: pointer; + } + &:active { + color: $wikit-Link-active-font-color; + text-decoration: underline; + cursor: pointer; + } + &:focus { + outline-color: $wikit-Link-focus-outline-color; + } + &:visited { + color: $wikit-Link-visited-font-color; + transition-property: color; + transition-duration: $wikit-Link-transition-duration; + } +} diff --git a/vue-components/stories/Link.stories.ts b/vue-components/stories/Link.stories.ts new file mode 100644 index 000000000..7b7dd63b6 --- /dev/null +++ b/vue-components/stories/Link.stories.ts @@ -0,0 +1,58 @@ +import WikitLink from '@/components/Link'; +import { Component } from 'vue'; + +export default { + component: WikitLink, + // the `/` prefix in the title is needed for "Message" to appear as a folded navigation item, and not a headline + title: '/Link', +}; + +export function basic( args: { content: string; underlined: boolean } ): Component { + return { + data: () => args, + components: { WikitLink }, + template: ` +
+

+
+ `, + }; +} + +basic.args = { + underlined: false, + content: 'Controllable link', +}; + +basic.argTypes = { + underlined: { + control: { + type: 'boolean', + }, + }, + content: { + control: { + type: 'text', + }, + }, +}; + +export function all(): Component { + return { + components: { WikitLink }, + template: ` +
+

Click here

+

Click here

+

About Wikidata

+

About Wikidata

+
+ `, + }; +} +all.parameters = { + controls: { hideNoControlsWarning: true }, +};