From fe5dcbf0a202bd0038e969bba258121fe434ce6e Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Thu, 31 Oct 2024 00:49:02 +0800 Subject: [PATCH] pkp/pkp-lib#9626 Add InitialsAvatar component --- .../InitialsAvatar/InitialsAvatar.stories.js | 31 +++++++++++ .../InitialsAvatar/InitialsAvatar.vue | 54 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 src/components/InitialsAvatar/InitialsAvatar.stories.js create mode 100644 src/components/InitialsAvatar/InitialsAvatar.vue diff --git a/src/components/InitialsAvatar/InitialsAvatar.stories.js b/src/components/InitialsAvatar/InitialsAvatar.stories.js new file mode 100644 index 000000000..407923ec9 --- /dev/null +++ b/src/components/InitialsAvatar/InitialsAvatar.stories.js @@ -0,0 +1,31 @@ +import InitialsAvatar from './InitialsAvatar.vue'; + +export default { + title: 'Components/InitialsAvatar', + component: InitialsAvatar, + render: (args) => ({ + components: {InitialsAvatar}, + setup() { + return {args}; + }, + template: ` + + `, + }), +}; + +export const Default = { + args: {givenName: 'Ramiro', familyName: 'Vaca'}, +}; + +export const GivenNameOnly = { + args: {givenName: 'Daniel'}, +}; + +export const IsSecondary = { + args: {givenName: 'David', familyName: 'Buskins', isSecondary: true}, +}; + +export const Undefined = { + args: {}, +}; diff --git a/src/components/InitialsAvatar/InitialsAvatar.vue b/src/components/InitialsAvatar/InitialsAvatar.vue new file mode 100644 index 000000000..762576ee8 --- /dev/null +++ b/src/components/InitialsAvatar/InitialsAvatar.vue @@ -0,0 +1,54 @@ + + +