diff --git a/dev/storybook/src/stories/shared/Button.stories.ts b/dev/storybook/src/stories/shared/Button.stories.ts index 3569bafad..aaa2b85ba 100644 --- a/dev/storybook/src/stories/shared/Button.stories.ts +++ b/dev/storybook/src/stories/shared/Button.stories.ts @@ -9,13 +9,33 @@ const meta = { component: FSButton, tags: ['autodocs'], argTypes: { - onClick: { action: 'clicked' } + ...addSubcomponentsArgTypes([FSCard], FSButton), + ...addComponentEmits(FSButton), + variant: { + control: { type: 'radio' }, + options: ['standard', 'full', 'icon'] + } } } satisfies Meta; export default meta; type Story = StoryObj; +export const Default: Story = { + args: { + label: "I am a button", + icon: "mdi-plus-circle-outline" + }, + render: (args) => ({ + components: { FSButton }, + setup() { + return { args }; + }, + template: ` + ` + }) +} + export const Variations: Story = { render: () => ({ components: { FSButton, FSIcon, FSSpan }, @@ -131,30 +151,33 @@ export const ColorVariations: Story = { }) } -import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue"; import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue"; import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue"; export const ContentVariant: Story = { - render: () => ({ - components: { FSClickable, FSRow, FSIcon, FSText }, + args: { + variant: 'standard', + color: 'primary', + padding: '12px' + }, + render: (args) => ({ + components: { FSCard, FSRow, FSIcon, FSText }, + setup() { + return { args }; + }, template: ` -
-
- - - -
-
` + + + ` }) } @@ -469,6 +492,8 @@ export const Submit: Story = { import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue"; import FSTagField from '@dative-gpi/foundation-shared-components/components/fields/FSTagField.vue'; +import { addComponentEmits, addSubcomponentsArgTypes } from '@/utils/properties'; +import FSCard from '@dative-gpi/foundation-shared-components/components/FSCard.vue'; export const Checkbox: Story = { args: { diff --git a/dev/storybook/src/stories/shared/Calendar.stories.ts b/dev/storybook/src/stories/shared/Calendar.stories.ts index 48b6b8a15..ac4f854d7 100644 --- a/dev/storybook/src/stories/shared/Calendar.stories.ts +++ b/dev/storybook/src/stories/shared/Calendar.stories.ts @@ -6,7 +6,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'; import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue"; import FSSimpleCalendarHeader from "@dative-gpi/foundation-shared-components/components/calendar/FSSimpleCalendarHeader.vue"; import FSSimpleCalendar from "@dative-gpi/foundation-shared-components/components/calendar/FSSimpleCalendar.vue"; -import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue"; +import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue"; const meta = { title: 'Foundation/Shared/Calendar', @@ -21,7 +21,7 @@ export const Default: Story = { args: { }, render: (args, { argTypes }) => ({ - components: { FSCol, FSSimpleCalendarHeader, FSSimpleCalendar, FSClickable }, + components: { FSCol, FSSimpleCalendarHeader, FSSimpleCalendar, FSCard }, props: Object.keys(argTypes), setup() { const disabledDates = ref([]); @@ -48,18 +48,18 @@ export const Default: Story = { diff --git a/dev/storybook/src/stories/shared/Card.stories.ts b/dev/storybook/src/stories/shared/Card.stories.ts index 9c3261780..f090157f0 100644 --- a/dev/storybook/src/stories/shared/Card.stories.ts +++ b/dev/storybook/src/stories/shared/Card.stories.ts @@ -1,73 +1,162 @@ import type { Meta, StoryObj } from '@storybook/vue3'; -import { VDivider } from 'vuetify/lib/components/index.mjs'; - -import FSButton from "@dative-gpi/foundation-shared-components/components/FSButton.vue"; import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue"; -import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue"; -import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue"; +import { ColorEnum } from '@dative-gpi/foundation-shared-components/models'; +import { CardVariants } from '@dative-gpi/foundation-shared-components/models'; +import FSIcon from '@dative-gpi/foundation-shared-components/components/FSIcon.vue'; +import { addComponentEmits } from '@/utils/properties'; +import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue'; const meta = { title: 'Foundation/Shared/Card', component: FSCard, tags: ['autodocs'], argTypes: { - onClick: { action: 'clicked' } + variant: { + control: { type: 'select' }, + options: [CardVariants.Standard, CardVariants.Background, CardVariants.Gradient, CardVariants.Full], + description: 'Mode of the agenda view', + }, + clickable: { + control: { type: 'boolean' } + }, + ...addComponentEmits(FSCard) }, } satisfies Meta; export default meta; type Story = StoryObj; -export const Variations: Story = { - render: () => ({ - components: { VDivider, FSCard, FSText, FSRow, FSButton }, +export const Default: Story = { + render: (args) => ({ + components: { FSCard, FSSpan }, + setup() { + return { args }; + }, + template: ` + + I am a card content + ` + }), + args: { + padding: '16px', + clickable: false, + }, +}; + +export const Variants: Story = { + render: (args) => ({ + components: { FSCard, FSSpan }, + setup() { + return { args, ColorEnum }; + }, + inheritAttrs: false, template: ` -
-
- - - - -
-
- - - - - - - - - -
-
-
- - - - - - - - - - -
-
` - }) -} \ No newline at end of file +
+ + Variant : background + + + Variant : standard + + + Variant : full + + + Variant : gradient + +
+ ` + }), + args: { + padding: '16px', + color: ColorEnum.Primary + }, +}; + +export const Clickables: Story = { + render: (args) => ({ + components: { + FSCard, + FSSpan, + FSIcon + }, + setup() { + return { args, ColorEnum }; + }, + inheritAttrs: false, + template: ` +
+ + + Href + + + + + Router Link + + + + + + + + + Clickable submit + + +
+ ` + }), + args: { + padding: '16px', + color: ColorEnum.Primary, + variant: 'standard' + }, +}; diff --git a/dev/storybook/src/stories/shared/Chip.stories.ts b/dev/storybook/src/stories/shared/Chip.stories.ts index 04563066c..008dbdef9 100644 --- a/dev/storybook/src/stories/shared/Chip.stories.ts +++ b/dev/storybook/src/stories/shared/Chip.stories.ts @@ -1,18 +1,20 @@ import type { Meta, StoryObj } from '@storybook/vue3'; +import { addComponentEmits, addSubcomponentsArgTypes } from '@/utils/properties'; + import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue"; import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue"; import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue"; import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue"; -import { addSubcomponentsArgTypes } from '@/utils/properties'; -import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue'; +import FSCard from '@dative-gpi/foundation-shared-components/components/FSCard.vue'; const meta = { title: 'Foundation/Shared/Chip', component: FSChip, tags: ['autodocs'], argTypes: { - ...addSubcomponentsArgTypes([FSRow], FSChip) + ...addSubcomponentsArgTypes([FSCard], FSChip), + ...addComponentEmits(FSChip) }, } satisfies Meta; @@ -23,8 +25,8 @@ export const Default: Story = { args: { color: 'primary', variant: 'standard', - label: 'I am a chip', - to: { name: 'About' } + label: 'I am a chip to dative-gpi', + clickable: false, }, render: (args) => ({ components: { FSChip, FSText, FSSpan, FSIcon }, @@ -40,52 +42,77 @@ export const Default: Story = { } export const Variations: Story = { - render: () => ({ + args: { + clickable: true + }, + render: (args) => ({ components: { FSChip, FSText, FSSpan, FSIcon }, + inheritAttrs: false, + setup() { + return { args } + }, template: `
With slots (default & button)
- + mdi-emoticon-cool-outline - Primary, full, clickable + Primary, full - - Success, standard, unclickable + + Success, standard - - Warning, full, clickable + + Warning, full - + mdi-thermometer - Error, standard, unclickable + Error, standard - - Light, full, unclickable + + Light, full - - Dark, standard, clickable + +
With props
- - - - - - + + + + + + +
+
+ Variants +
+ + + + + +
Text align
- - + +
- - + +
` }) diff --git a/dev/storybook/src/stories/shared/EditImageUI.stories.ts b/dev/storybook/src/stories/shared/EditImageUI.stories.ts index 5539ee1a9..1e9f4e8e8 100644 --- a/dev/storybook/src/stories/shared/EditImageUI.stories.ts +++ b/dev/storybook/src/stories/shared/EditImageUI.stories.ts @@ -89,7 +89,7 @@ export const VariationFull: Story = { v-model="args.modelValue" @update:modelValue="args['onUpdate:modelValue']" @update:source="args['onUpdate:source']" - >` + />` }) } @@ -124,6 +124,6 @@ export const VariationFullSource: Story = { v-model="args.modelValue" @update:modelValue="args['onUpdate:modelValue']" @update:source="args['onUpdate:source']" - >` + />` }) } \ No newline at end of file diff --git a/dev/storybook/src/stories/shared/Link.stories.ts b/dev/storybook/src/stories/shared/Link.stories.ts index b95ffcc75..36174178b 100644 --- a/dev/storybook/src/stories/shared/Link.stories.ts +++ b/dev/storybook/src/stories/shared/Link.stories.ts @@ -7,7 +7,6 @@ const meta = { component: FSLink, tags: ['autodocs'], argTypes: { - onClick: { action: 'clicked' } } } satisfies Meta; @@ -16,8 +15,6 @@ type Story = StoryObj; export const Variations: Story = { args: { - args: { - } }, render: (args, { argTypes }) => ({ components: { FSLink }, diff --git a/src/core/foundation-core-components/components/lists/dataCategories/FSBaseDataCategoriesList.vue b/src/core/foundation-core-components/components/lists/dataCategories/FSBaseDataCategoriesList.vue index 681ef790f..5b2e5efdb 100644 --- a/src/core/foundation-core-components/components/lists/dataCategories/FSBaseDataCategoriesList.vue +++ b/src/core/foundation-core-components/components/lists/dataCategories/FSBaseDataCategoriesList.vue @@ -41,17 +41,18 @@ @@ -81,7 +82,7 @@ import { defineComponent, type PropType, ref, watch } from "vue"; import _ from "lodash"; -import {ColorEnum} from "@dative-gpi/foundation-shared-components/models"; +import {CardVariants, ColorEnum} from "@dative-gpi/foundation-shared-components/models"; import { useDataCategories } from "@dative-gpi/foundation-core-services/composables"; import type { DataCategoryFilters } from "@dative-gpi/foundation-core-domain/models"; @@ -89,10 +90,10 @@ import type { DataCategoryFilters } from "@dative-gpi/foundation-core-domain/mod import FSDataTable from "../FSDataTable.vue"; import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue"; import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue"; +import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue"; import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue"; import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue"; import FSFadeOut from "@dative-gpi/foundation-shared-components/components/FSFadeOut.vue"; -import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue"; import FSSearchField from "@dative-gpi/foundation-shared-components/components/fields/FSSearchField.vue"; import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue"; @@ -102,7 +103,7 @@ export default defineComponent({ FSDataTable, FSCol, FSFadeOut, - FSClickable, + FSCard, FSRow, FSSpan, FSSearchField, @@ -146,6 +147,7 @@ export default defineComponent({ return { fetchingDataCategories, dataCategories, + CardVariants, ColorEnum, search, correlated, diff --git a/src/core/foundation-core-components/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue b/src/core/foundation-core-components/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue index 2d7e0df85..0379a32fa 100644 --- a/src/core/foundation-core-components/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +++ b/src/core/foundation-core-components/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue @@ -28,17 +28,18 @@ @@ -67,7 +69,7 @@ import { defineComponent, type PropType, watch } from "vue"; import _ from "lodash"; -import {ColorEnum} from "@dative-gpi/foundation-shared-components/models"; +import { CardVariants, ColorEnum } from "@dative-gpi/foundation-shared-components/models"; import { useDataDefinitions } from "@dative-gpi/foundation-core-services/composables"; import type { DataDefinitionFilters } from "@dative-gpi/foundation-core-domain/models"; @@ -76,7 +78,7 @@ import FSDataTable from "../FSDataTable.vue"; import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue"; import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue"; import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue"; -import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue"; +import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue"; import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue"; export default defineComponent({ @@ -84,7 +86,7 @@ export default defineComponent({ components: { FSButtonCheckbox, FSDataTable, - FSClickable, + FSCard, FSSpan, FSIcon, FSRow, @@ -123,6 +125,7 @@ export default defineComponent({ return { fetchingDataDefinitions, dataDefinitions, + CardVariants, ColorEnum, isSelected }; diff --git a/src/shared/foundation-shared-components/components/FSButton.vue b/src/shared/foundation-shared-components/components/FSButton.vue index 164fac212..1c02eeece 100644 --- a/src/shared/foundation-shared-components/components/FSButton.vue +++ b/src/shared/foundation-shared-components/components/FSButton.vue @@ -1,6 +1,7 @@ + + \ No newline at end of file + diff --git a/src/shared/foundation-shared-components/components/agenda/FSAgendaHorizontalEvent.vue b/src/shared/foundation-shared-components/components/agenda/FSAgendaHorizontalEvent.vue index aa9e3766f..73af93414 100644 --- a/src/shared/foundation-shared-components/components/agenda/FSAgendaHorizontalEvent.vue +++ b/src/shared/foundation-shared-components/components/agenda/FSAgendaHorizontalEvent.vue @@ -29,7 +29,7 @@ /> - - +