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.
Browse files
Browse the repository at this point in the history
* chore(#111): social links organism * chore(#111): update social links --------- Co-authored-by: Brian Gilbert <[email protected]> Co-authored-by: Stuart Clark <[email protected]>
- Loading branch information
1 parent
6d4fe30
commit f900c8c
Showing
3 changed files
with
122 additions
and
2 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,53 @@ | ||
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: [ | ||
{ | ||
id: 'facebook', | ||
icon: 'facebook', | ||
link: 'https://facebook.com', | ||
title: 'Facebook' | ||
}, | ||
{ | ||
id: 'twitter', | ||
icon: 'twitter', | ||
link: 'https://twitter.com', | ||
title: 'Twitter' | ||
}, | ||
{ | ||
id: 'linkedin', | ||
icon: 'linkedin', | ||
link: 'https://linkedin.com', | ||
title: 'LinkedIn' | ||
} | ||
] | ||
} |
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,55 @@ | ||
<template> | ||
<div | ||
class="ct-social-links" | ||
:class="{ | ||
[themeClass]: true, | ||
'ct-social-links--with-border': border | ||
}" | ||
> | ||
<CTItemList class="ct-social-links__list" :items="items" type="horizontal"> | ||
<template #default="{ item }"> | ||
<CTButton | ||
class="ct-social-links__button" | ||
:icon="item.icon" | ||
kind="link" | ||
target="_blank" | ||
:title="item.title" | ||
type="tertiary" | ||
:theme="theme" | ||
:url="item.link" | ||
> | ||
<span class="ct-visually-hidden">(Opens in a new tab/window)</span> | ||
</CTButton> | ||
</template> | ||
</CTItemList> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import ThemeMixin from '../mixins/theme' | ||
export default { | ||
mixins: [ThemeMixin], | ||
props: { | ||
border: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
items: { | ||
type: Array, | ||
default: () => ([]), | ||
}, | ||
}, | ||
data: () => ({ | ||
page: 1 | ||
}), | ||
watch: { | ||
page() { | ||
this.$emit('page', this.page) | ||
} | ||
} | ||
} | ||
</script> |