generated from druxt/module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d91d04
commit 73660f3
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import CTSocialLinks from './SocialLinks.vue' | ||
|
||
export default { | ||
title: 'CivicTheme/Organisms/SocialLinks', | ||
component: CTSocialLinks, | ||
argTypes: { | ||
theme: { | ||
options: ['dark', 'light'], | ||
control: 'select' | ||
} | ||
}, | ||
parameters: { | ||
status: { | ||
type: 'beta', | ||
} | ||
} | ||
} | ||
|
||
const Template = (args, { argTypes }) => { | ||
return { | ||
props: Object.keys(argTypes), | ||
template: `<CTSocialLinks v-bind="$props" v-on="$props"> | ||
<template v-if="$props.default">{{ $props.default }}</template> | ||
</CTSocialLinks>`, | ||
} | ||
} | ||
|
||
export const Default = Template.bind({}) | ||
Default.storyName = 'Social Links' | ||
Default.args = { | ||
border: true, | ||
theme: 'light', | ||
items: {'Facebook': 'https://facebook.com', 'Twitter': 'https://twitter.com', 'LinkedIn': 'https://linkedin.com'} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<template> | ||
<div :class="`ct-social-links ${themeClass} ${border ? 'ct-social-links--with-border': ''}`"> | ||
<ul class="ct-item-list ct-item-list--horizontal ct-item-list--regular ct-social-links__list"> | ||
|
||
<li | ||
v-for="(link, title) in items" | ||
:key="link" | ||
class="ct-item-list__item" | ||
> | ||
<CTButton | ||
class="ct-icon ct-button__icon" | ||
:icon="title.toLowerCase()" | ||
kind="link" | ||
target="_blank" | ||
:title="title" | ||
type="tertiary" | ||
:url="link" | ||
> | ||
<span class="ct-visually-hidden">(Opens in a new tab/window)</span> | ||
</CTButton> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import ThemeMixin from '../mixins/theme' | ||
export default { | ||
mixins: [ThemeMixin], | ||
props: { | ||
border: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
items: { | ||
type: Array, | ||
default: () => ([]), | ||
}, | ||
themeClass: { | ||
type: String, | ||
default: "ct-theme-light" | ||
} | ||
}, | ||
data: () => ({ | ||
page: 1 | ||
}), | ||
watch: { | ||
page() { | ||
this.$emit('page', this.page) | ||
} | ||
} | ||
} | ||
</script> |