From e76eae360fc78a98c5f55b5ff613f8594be1764a Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Fri, 20 Dec 2024 23:00:44 +0100 Subject: [PATCH] feat(design-system:newsletter_form): add base component --- packages/design-system/.storybook/preview.ts | 4 ++ packages/design-system/package.json | 2 +- .../footer/footer.stories.ts | 2 +- .../footer/footer.vue | 13 +++++ .../footer/footer_section.vue | 0 .../footer/social_network.vue | 0 .../newsletter_confirmation_dialog.vue | 54 +++++++++++++++++++ .../newsletter_form.stories.ts | 13 +++++ .../newsletter_form/newsletter_form.vue | 27 ++++++++++ 9 files changed, 113 insertions(+), 2 deletions(-) rename packages/design-system/src/{molecules => organisms}/footer/footer.stories.ts (90%) rename packages/design-system/src/{molecules => organisms}/footer/footer.vue (88%) rename packages/design-system/src/{molecules => organisms}/footer/footer_section.vue (100%) rename packages/design-system/src/{molecules => organisms}/footer/social_network.vue (100%) create mode 100644 packages/design-system/src/organisms/newsletter_form/newsletter_confirmation_dialog.vue create mode 100644 packages/design-system/src/organisms/newsletter_form/newsletter_form.stories.ts create mode 100644 packages/design-system/src/organisms/newsletter_form/newsletter_form.vue diff --git a/packages/design-system/.storybook/preview.ts b/packages/design-system/.storybook/preview.ts index d085ed7..456ee9e 100644 --- a/packages/design-system/.storybook/preview.ts +++ b/packages/design-system/.storybook/preview.ts @@ -3,6 +3,10 @@ import 'virtual:uno.css'; import type { Preview } from '@storybook/vue3'; +globalThis.RomainLanz = { + appUrl: 'http://romainlanz.localhost:3333', +}; + const preview: Preview = { parameters: { layout: 'centered', diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 4dc785b..ee13a82 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -31,10 +31,10 @@ "./dialog": "./src/molecules/dialog/dialog.vue", "./field": "./src/molecules/field/field.vue", "./field-select": "./src/molecules/field_select/field_select.vue", - "./footer": "./src/molecules/footer/footer.vue", "./headline": "./src/molecules/headline/headline.vue", "./pagination": "./src/molecules/pagination/pagination.vue", "./user-action-menu": "./src/molecules/user_action_menu/user_action_menu.vue", + "./footer": "./src/organisms/footer/footer.vue", "./top-bar": "./src/organisms/top_bar/top_bar.vue" }, "scripts": { diff --git a/packages/design-system/src/molecules/footer/footer.stories.ts b/packages/design-system/src/organisms/footer/footer.stories.ts similarity index 90% rename from packages/design-system/src/molecules/footer/footer.stories.ts rename to packages/design-system/src/organisms/footer/footer.stories.ts index 1f68ca6..ee4db5b 100644 --- a/packages/design-system/src/molecules/footer/footer.stories.ts +++ b/packages/design-system/src/organisms/footer/footer.stories.ts @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'; const meta = { component: Footer, - title: 'Molecules/Footer', + title: 'Organisms/Footer', parameters: { layout: 'padded', }, diff --git a/packages/design-system/src/molecules/footer/footer.vue b/packages/design-system/src/organisms/footer/footer.vue similarity index 88% rename from packages/design-system/src/molecules/footer/footer.vue rename to packages/design-system/src/organisms/footer/footer.vue index 1049ea6..63c8abf 100644 --- a/packages/design-system/src/molecules/footer/footer.vue +++ b/packages/design-system/src/organisms/footer/footer.vue @@ -4,9 +4,18 @@ import FooterSection from './footer_section.vue'; import SocialNetwork from './social_network.vue'; import { client } from '@rlanz/rpc/client'; + import NewsletterForm from '../newsletter_form/newsletter_form.vue'; + + const emit = defineEmits<{ + register: [email: string]; + }>(); const contactUrl = client.$url('pages.contact'); const aboutUrl = client.$url('pages.about'); + + function onRegister(email: string) { + emit('register', email); + }