From 880c025242b8187e3f5045287c8da1184c16c799 Mon Sep 17 00:00:00 2001 From: GaziYucel Date: Thu, 12 Dec 2024 16:11:30 +0100 Subject: [PATCH] Initial commit --- src/components/Form/fields/FieldCitations.mdx | 17 ++++ .../Form/fields/FieldCitations.stories.js | 28 ++++++ src/components/Form/fields/FieldCitations.vue | 99 +++++++++++++++++++ src/components/Form/mocks/field-citations.js | 11 +++ 4 files changed, 155 insertions(+) create mode 100644 src/components/Form/fields/FieldCitations.mdx create mode 100644 src/components/Form/fields/FieldCitations.stories.js create mode 100644 src/components/Form/fields/FieldCitations.vue create mode 100644 src/components/Form/mocks/field-citations.js diff --git a/src/components/Form/fields/FieldCitations.mdx b/src/components/Form/fields/FieldCitations.mdx new file mode 100644 index 000000000..d23205b40 --- /dev/null +++ b/src/components/Form/fields/FieldCitations.mdx @@ -0,0 +1,17 @@ +import {Primary, Controls, Stories, Meta, ArgTypes} from '@storybook/blocks'; + +import * as FieldCitationsStories from './FieldCitations.stories.js'; + + + +# FieldCitations + +## Usage + +A special component to maintain structured citations of publications. + +The `value` are an array of Citation objects. + + + + diff --git a/src/components/Form/fields/FieldCitations.stories.js b/src/components/Form/fields/FieldCitations.stories.js new file mode 100644 index 000000000..a732e8d8c --- /dev/null +++ b/src/components/Form/fields/FieldCitations.stories.js @@ -0,0 +1,28 @@ +import FieldCitations from './FieldCitations.vue'; +import FieldCitationsMock from '@/components/Form/mocks/field-citations.js'; + +const args = {...FieldCitationsMock}; + +export default { + title: 'Forms/FieldCitations', + component: FieldCitations, + args: {}, + parameters: {}, + render: (args) => ({ + components: {FieldCitations}, + setup() { + return {args}; + }, + template: ` + `, + }), + decorators: [ + () => ({ + template: '
', + }), + ], +}; + +export const Base = { + args: {...FieldCitationsMock}, +}; diff --git a/src/components/Form/fields/FieldCitations.vue b/src/components/Form/fields/FieldCitations.vue new file mode 100644 index 000000000..e7b3c15a0 --- /dev/null +++ b/src/components/Form/fields/FieldCitations.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/components/Form/mocks/field-citations.js b/src/components/Form/mocks/field-citations.js new file mode 100644 index 000000000..717f748a8 --- /dev/null +++ b/src/components/Form/mocks/field-citations.js @@ -0,0 +1,11 @@ +export default { + name: 'author-citations', + component: 'author-citations', + primaryLocale: 'en', + locales: [ + {key: 'en', label: 'English'}, + {key: 'fr_CA', label: 'French (Canada)'}, + {key: 'de', label: 'German'}, + ], + value: [], +};