@myelmut/design-system 0.1.47 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/assets/fonts/PPMori-Regular.woff2 +0 -0
- package/src/assets/fonts/PPMori-RegularItalic.woff2 +0 -0
- package/src/assets/fonts/PPMori-SemiBold.woff2 +0 -0
- package/src/assets/fonts/PPPangaia-Medium.woff2 +0 -0
- package/src/assets/fonts/PPPangaia-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/PPPangaia-Ultralight.woff2 +0 -0
- package/src/assets/illustrations/balls-light.webp +0 -0
- package/src/assets/illustrations/balls.webp +0 -0
- package/src/assets/illustrations/basket-light.webp +0 -0
- package/src/assets/illustrations/basket.webp +0 -0
- package/src/assets/illustrations/bowl-2-light.webp +0 -0
- package/src/assets/illustrations/bowl-2.webp +0 -0
- package/src/assets/illustrations/bowl-light.webp +0 -0
- package/src/assets/illustrations/bowl.webp +0 -0
- package/src/assets/illustrations/box-2-light.webp +0 -0
- package/src/assets/illustrations/box-2.webp +0 -0
- package/src/assets/illustrations/box-light.webp +0 -0
- package/src/assets/illustrations/box.webp +0 -0
- package/src/assets/illustrations/calendar-light.webp +0 -0
- package/src/assets/illustrations/calendar.webp +0 -0
- package/src/assets/illustrations/can-light.webp +0 -0
- package/src/assets/illustrations/can.webp +0 -0
- package/src/assets/illustrations/carrot-light.webp +0 -0
- package/src/assets/illustrations/carrot.webp +0 -0
- package/src/assets/illustrations/cat-light.webp +0 -0
- package/src/assets/illustrations/cat.webp +0 -0
- package/src/assets/illustrations/check-rounded.webp +0 -0
- package/src/assets/illustrations/chicken-light.webp +0 -0
- package/src/assets/illustrations/chicken.webp +0 -0
- package/src/assets/illustrations/cross-rounded.webp +0 -0
- package/src/assets/illustrations/crown-light.webp +0 -0
- package/src/assets/illustrations/crown.webp +0 -0
- package/src/assets/illustrations/dog-light.webp +0 -0
- package/src/assets/illustrations/dog.webp +0 -0
- package/src/assets/illustrations/face-light.webp +0 -0
- package/src/assets/illustrations/face.webp +0 -0
- package/src/assets/illustrations/food-bag-light.webp +0 -0
- package/src/assets/illustrations/food-bag.webp +0 -0
- package/src/assets/illustrations/france-light.webp +0 -0
- package/src/assets/illustrations/france.webp +0 -0
- package/src/assets/illustrations/fridge-light.webp +0 -0
- package/src/assets/illustrations/fridge.webp +0 -0
- package/src/assets/illustrations/glasses-light.webp +0 -0
- package/src/assets/illustrations/glasses.webp +0 -0
- package/src/assets/illustrations/half-label-light.webp +0 -0
- package/src/assets/illustrations/half-label.webp +0 -0
- package/src/assets/illustrations/kitten-light.webp +0 -0
- package/src/assets/illustrations/kitten.webp +0 -0
- package/src/assets/illustrations/label-light.webp +0 -0
- package/src/assets/illustrations/label.webp +0 -0
- package/src/assets/illustrations/leaf-light.webp +0 -0
- package/src/assets/illustrations/leaf.webp +0 -0
- package/src/assets/illustrations/liquid-light.webp +0 -0
- package/src/assets/illustrations/liquid.webp +0 -0
- package/src/assets/illustrations/magnifying-glass-light.webp +0 -0
- package/src/assets/illustrations/magnifying-glass.webp +0 -0
- package/src/assets/illustrations/meat-light.webp +0 -0
- package/src/assets/illustrations/meat.webp +0 -0
- package/src/assets/illustrations/molecule-light.webp +0 -0
- package/src/assets/illustrations/molecule.webp +0 -0
- package/src/assets/illustrations/paws-light.webp +0 -0
- package/src/assets/illustrations/paws.webp +0 -0
- package/src/assets/illustrations/plate-light.webp +0 -0
- package/src/assets/illustrations/plate.webp +0 -0
- package/src/assets/illustrations/pot-big-2-light.webp +0 -0
- package/src/assets/illustrations/pot-big-2.webp +0 -0
- package/src/assets/illustrations/pot-big-light.webp +0 -0
- package/src/assets/illustrations/pot-big.webp +0 -0
- package/src/assets/illustrations/pot-light.webp +0 -0
- package/src/assets/illustrations/pot.webp +0 -0
- package/src/assets/illustrations/puppy-light.webp +0 -0
- package/src/assets/illustrations/puppy.webp +0 -0
- package/src/assets/illustrations/quantity-light.webp +0 -0
- package/src/assets/illustrations/quantity.webp +0 -0
- package/src/assets/illustrations/sausage-light.webp +0 -0
- package/src/assets/illustrations/sausage.webp +0 -0
- package/src/assets/illustrations/sausages-light.webp +0 -0
- package/src/assets/illustrations/sausages.webp +0 -0
- package/src/assets/illustrations/skeleton-light.webp +0 -0
- package/src/assets/illustrations/skeleton.webp +0 -0
- package/src/assets/illustrations/sofa-light.webp +0 -0
- package/src/assets/illustrations/sofa.webp +0 -0
- package/src/assets/illustrations/sport-light.webp +0 -0
- package/src/assets/illustrations/sport.webp +0 -0
- package/src/assets/illustrations/steak-light.webp +0 -0
- package/src/assets/illustrations/steak.webp +0 -0
- package/src/assets/illustrations/truck-light.webp +0 -0
- package/src/assets/illustrations/truck.webp +0 -0
- package/src/assets/illustrations/warning-light.webp +0 -0
- package/src/assets/illustrations/warning.webp +0 -0
- package/src/assets/images/cat.webp +0 -0
- package/src/assets/images/dog.webp +0 -0
- package/src/assets/images/frequency/food-in-fridge.webp +0 -0
- package/src/assets/images/ingredients/beef.webp +0 -0
- package/src/assets/images/ingredients/beer-yeast.webp +0 -0
- package/src/assets/images/ingredients/calcium.webp +0 -0
- package/src/assets/images/ingredients/carrot.webp +0 -0
- package/src/assets/images/ingredients/chicken.webp +0 -0
- package/src/assets/images/ingredients/courgette.webp +0 -0
- package/src/assets/images/ingredients/dry-apple.webp +0 -0
- package/src/assets/images/ingredients/dry-carrot.webp +0 -0
- package/src/assets/images/ingredients/duck.webp +0 -0
- package/src/assets/images/ingredients/fish.webp +0 -0
- package/src/assets/images/ingredients/liquid.webp +0 -0
- package/src/assets/images/ingredients/oil.webp +0 -0
- package/src/assets/images/ingredients/pork.webp +0 -0
- package/src/assets/images/ingredients/potato.webp +0 -0
- package/src/assets/images/ingredients/quinoa.webp +0 -0
- package/src/assets/images/ingredients/rice.webp +0 -0
- package/src/assets/images/ingredients/seaweed.webp +0 -0
- package/src/assets/images/ingredients/turkey.webp +0 -0
- package/src/assets/images/ingredients/vitamins.webp +0 -0
- package/src/assets/images/tips/claudine-head.webp +0 -0
- package/src/assets/images/tips/claudine-tips-head-mobile.webp +0 -0
- package/src/assets/images/tips/claudine-tips-head-mobile@2x.webp +0 -0
- package/src/assets/images/tips/claudine-tips-head.webp +0 -0
- package/src/assets/images/tips/claudine-tips-head@2x.webp +0 -0
- package/src/assets/images/tips/claudine-tips-mobile.webp +0 -0
- package/src/assets/images/tips/claudine-tips-mobile@2x.webp +0 -0
- package/src/assets/images/tips/claudine-tips.webp +0 -0
- package/src/assets/images/tips/claudine-tips@2x.webp +0 -0
- package/src/assets/images/tips/payment-mobile.webp +0 -0
- package/src/assets/images/tips/payment-mobile@2x.webp +0 -0
- package/src/assets/images/tips/payment.webp +0 -0
- package/src/assets/images/tips/payment@2x.webp +0 -0
- package/src/assets/images/trash/dog-product-mobile.webp +0 -0
- package/src/assets/images/trash/dog-product.webp +0 -0
- package/src/assets/images/trash/full-cat.png +0 -0
- package/src/assets/images/trash/testimonial-1-mobile.webp +0 -0
- package/src/assets/images/trash/testimonial-1-mobile@2x.webp +0 -0
- package/src/assets/images/trash/testimonial-1.webp +0 -0
- package/src/assets/images/trash/testimonial-1@2x.webp +0 -0
- package/src/components/Accordions/FAQ/FaqItem.stories.tsx +61 -0
- package/src/components/Accordions/FAQ/FaqItem.tsx +55 -0
- package/src/components/Accordions/Ingredient/Ingredient.stories.tsx +38 -0
- package/src/components/Accordions/Ingredient/Ingredient.tsx +93 -0
- package/src/components/Accordions/index.tsx +4 -0
- package/src/components/Base/Banner/Banner.stories.tsx +33 -0
- package/src/components/Base/Banner/Banner.tsx +23 -0
- package/src/components/Base/Emblem/Emblem.stories.tsx +40 -0
- package/src/components/Base/Emblem/Emblem.tsx +22 -0
- package/src/components/Base/Logo/Logo.stories.tsx +46 -0
- package/src/components/Base/Logo/Logo.tsx +34 -0
- package/src/components/Base/ResponsiveImage/ResponsiveImage.stories.tsx +78 -0
- package/src/components/Base/ResponsiveImage/ResponsiveImage.tsx +56 -0
- package/src/components/Base/Text/Text.stories.tsx +115 -0
- package/src/components/Base/Text/Text.tsx +60 -0
- package/src/components/Base/Title/Title.stories.tsx +145 -0
- package/src/components/Base/Title/Title.tsx +77 -0
- package/src/components/Base/VideoPlayer/VideoPlayer.stories.tsx +60 -0
- package/src/components/Base/VideoPlayer/VideoPlayer.tsx +78 -0
- package/src/components/Base/index.tsx +9 -0
- package/src/components/Buttons/Button/Button.stories.tsx +158 -0
- package/src/components/Buttons/Button/Button.tsx +68 -0
- package/src/components/Buttons/CardButton/CardButton.stories.tsx +47 -0
- package/src/components/Buttons/CardButton/CardButton.tsx +25 -0
- package/src/components/Buttons/ClearButton/ClearButton.stories.tsx +26 -0
- package/src/components/Buttons/ClearButton/ClearButton.tsx +18 -0
- package/src/components/Buttons/FAQButton/FAQButton.stories.tsx +33 -0
- package/src/components/Buttons/FAQButton/FAQButton.tsx +27 -0
- package/src/components/Buttons/IllustratedCardButton/IllustratedCardButton.stories.tsx +71 -0
- package/src/components/Buttons/IllustratedCardButton/IllustratedCardButton.tsx +45 -0
- package/src/components/Buttons/SimpleIllustratedCardButton/SimpleIllustratedCardButton.stories.tsx +74 -0
- package/src/components/Buttons/SimpleIllustratedCardButton/SimpleIllustratedCardButton.tsx +43 -0
- package/src/components/Buttons/SocialButton/SocialButton.stories.tsx +56 -0
- package/src/components/Buttons/SocialButton/SocialButton.tsx +28 -0
- package/src/components/Buttons/Toggle/Toggle.tsx +64 -0
- package/src/components/Buttons/Toggle/Toogle.stories.tsx +66 -0
- package/src/components/Buttons/index.ts +10 -0
- package/src/components/Cards/CTACard/CTACard.stories.tsx +83 -0
- package/src/components/Cards/CTACard/CTACard.tsx +47 -0
- package/src/components/Cards/FeatureCard/FeatureCard.stories.tsx +96 -0
- package/src/components/Cards/FeatureCard/FeatureCard.tsx +50 -0
- package/src/components/Cards/FeatureIllustration/FeatureIllustration.stories.tsx +96 -0
- package/src/components/Cards/FeatureIllustration/FeatureIllustration.tsx +56 -0
- package/src/components/Cards/FeatureIllustration/index.ts +2 -0
- package/src/components/Cards/FoodCard/FoodCard.stories.tsx +43 -0
- package/src/components/Cards/FoodCard/FoodCard.tsx +37 -0
- package/src/components/Cards/FrequencySelectorCard/FrequencySelectorCard.stories.tsx +140 -0
- package/src/components/Cards/FrequencySelectorCard/FrequencySelectorCard.tsx +90 -0
- package/src/components/Cards/FrequencySelectorCard/index.ts +2 -0
- package/src/components/Cards/IllustratedCard/IllustratedCard.stories.tsx +54 -0
- package/src/components/Cards/IllustratedCard/IllustratedCard.tsx +44 -0
- package/src/components/Cards/PaymentCard/PaymentCard.stories.tsx +35 -0
- package/src/components/Cards/PaymentCard/PaymentCard.tsx +31 -0
- package/src/components/Cards/PlanCard/PlanCard.stories.tsx +140 -0
- package/src/components/Cards/PlanCard/PlanCard.tsx +119 -0
- package/src/components/Cards/Polaroid/Polaroid.stories.tsx +118 -0
- package/src/components/Cards/Polaroid/Polaroid.tsx +66 -0
- package/src/components/Cards/RecetteCard/RecetteCard.stories.tsx +86 -0
- package/src/components/Cards/RecetteCard/RecetteCard.tsx +47 -0
- package/src/components/Cards/StatCard/StatCard.stories.tsx +69 -0
- package/src/components/Cards/StatCard/StatCard.tsx +45 -0
- package/src/components/Cards/Testimonial/Testimonial.stories.tsx +65 -0
- package/src/components/Cards/Testimonial/Testimonial.tsx +62 -0
- package/src/components/Cards/TestimonialSlider/TestimonialSlider.stories.ts +53 -0
- package/src/components/Cards/TestimonialSlider/TestimonialSlider.tsx +50 -0
- package/src/components/Cards/Tips/Tips.stories.tsx +32 -0
- package/src/components/Cards/Tips/Tips.tsx +40 -0
- package/src/components/Cards/TransitionCard/TransitionCard.stories.tsx +50 -0
- package/src/components/Cards/TransitionCard/TransitionCard.tsx +66 -0
- package/src/components/Cards/UpCard/UpCard.stories.tsx +94 -0
- package/src/components/Cards/UpCard/UpCard.tsx +50 -0
- package/src/components/Cards/WizardTips/WizardTips.stories.tsx +48 -0
- package/src/components/Cards/WizardTips/WizardTips.tsx +33 -0
- package/src/components/Cards/index.ts +19 -0
- package/src/components/Inputs/ButtonSelect/ButtonSelect.stories.tsx +51 -0
- package/src/components/Inputs/ButtonSelect/ButtonSelect.tsx +34 -0
- package/src/components/Inputs/Checkbox/Checkbox.stories.tsx +47 -0
- package/src/components/Inputs/Checkbox/Checkbox.tsx +35 -0
- package/src/components/Inputs/Dropdown/Dropdown.stories.tsx +61 -0
- package/src/components/Inputs/Dropdown/Dropdown.tsx +108 -0
- package/src/components/Inputs/DropdownMenu/DropdownMenu.stories.tsx +75 -0
- package/src/components/Inputs/DropdownMenu/DropdownMenu.tsx +109 -0
- package/src/components/Inputs/ErrorMessage/ErrorMessage.stories.tsx +33 -0
- package/src/components/Inputs/ErrorMessage/ErrorMessage.tsx +18 -0
- package/src/components/Inputs/Filters/Filters.stories.tsx +54 -0
- package/src/components/Inputs/Filters/Filters.tsx +75 -0
- package/src/components/Inputs/Label/Label.stories.tsx +34 -0
- package/src/components/Inputs/Label/Label.tsx +16 -0
- package/src/components/Inputs/Newsletter/Newsletter.stories.tsx +67 -0
- package/src/components/Inputs/Newsletter/Newsletter.tsx +70 -0
- package/src/components/Inputs/QuantityInput/QuantityInput.stories.tsx +54 -0
- package/src/components/Inputs/QuantityInput/QuantityInput.tsx +46 -0
- package/src/components/Inputs/Tag/Tag.stories.tsx +33 -0
- package/src/components/Inputs/Tag/Tag.tsx +19 -0
- package/src/components/Inputs/TagSelect/TagSelect.stories.tsx +50 -0
- package/src/components/Inputs/TagSelect/TagSelect.tsx +48 -0
- package/src/components/Inputs/TextInput/TextInput.stories.tsx +40 -0
- package/src/components/Inputs/TextInput/TextInput.tsx +38 -0
- package/src/components/Inputs/WizardDropdown/WizardDropdown.stories.tsx +59 -0
- package/src/components/Inputs/WizardDropdown/WizardDropdown.tsx +93 -0
- package/src/components/Inputs/WizardTextInput/WizardTextInput.stories.tsx +40 -0
- package/src/components/Inputs/WizardTextInput/WizardTextInput.tsx +31 -0
- package/src/components/Inputs/index.ts +16 -0
- package/src/components/Navigation/Footer/Footer.stories.tsx +28 -0
- package/src/components/Navigation/Footer/Footer.tsx +130 -0
- package/src/components/Navigation/FooterTips/FooterTips.stories.tsx +22 -0
- package/src/components/Navigation/FooterTips/FooterTips.tsx +24 -0
- package/src/components/Navigation/MobileMenu/MobileMenu.stories.tsx +56 -0
- package/src/components/Navigation/MobileMenu/MobileMenu.tsx +45 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +128 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +66 -0
- package/src/components/Navigation/NavbarDesktop/NavbarDesktop.stories.tsx +57 -0
- package/src/components/Navigation/NavbarDesktop/NavbarDesktop.tsx +48 -0
- package/src/components/Navigation/NavbarMobile/NavbarMobile.stories.tsx +59 -0
- package/src/components/Navigation/NavbarMobile/NavbarMobile.tsx +75 -0
- package/src/components/Navigation/Stepper/Stepper.stories.tsx +41 -0
- package/src/components/Navigation/Stepper/Stepper.tsx +19 -0
- package/src/components/Navigation/Tabs/Tabs.stories.tsx +120 -0
- package/src/components/Navigation/Tabs/Tabs.tsx +92 -0
- package/src/components/Navigation/WizardNavbar/WizardNavbar.stories.tsx +59 -0
- package/src/components/Navigation/WizardNavbar/WizardNavbar.tsx +83 -0
- package/src/components/Navigation/index.ts +11 -0
- package/src/components/SVG/Facebook.svg +3 -0
- package/src/components/SVG/Instagram.svg +5 -0
- package/src/components/SVG/Linkedin.svg +5 -0
- package/src/components/SVG/Tiktok.svg +7 -0
- package/src/components/SVG/arrow-plain.svg +3 -0
- package/src/components/SVG/arrow.svg +3 -0
- package/src/components/SVG/calendar.svg +4 -0
- package/src/components/SVG/check-circle.svg +5 -0
- package/src/components/SVG/check-rounded.svg +4 -0
- package/src/components/SVG/check.svg +3 -0
- package/src/components/SVG/cross-rounded.svg +3 -0
- package/src/components/SVG/cross.svg +4 -0
- package/src/components/SVG/dollar-rounded.svg +6 -0
- package/src/components/SVG/double-arrow.svg +3 -0
- package/src/components/SVG/filters.svg +8 -0
- package/src/components/SVG/hat-cook.svg +4 -0
- package/src/components/SVG/home-hero-shape-mobile.svg +3 -0
- package/src/components/SVG/home-hero-shape-small.svg +3 -0
- package/src/components/SVG/home-hero-shape.svg +3 -0
- package/src/components/SVG/index.ts +75 -0
- package/src/components/SVG/info.svg +3 -0
- package/src/components/SVG/magic-wand.svg +9 -0
- package/src/components/SVG/menu.svg +5 -0
- package/src/components/SVG/minus.svg +3 -0
- package/src/components/SVG/mute.svg +4 -0
- package/src/components/SVG/pause.svg +3 -0
- package/src/components/SVG/play.svg +3 -0
- package/src/components/SVG/plus.svg +4 -0
- package/src/components/SVG/polaroid-thread.svg +17 -0
- package/src/components/SVG/profil.svg +4 -0
- package/src/components/SVG/quote.svg +3 -0
- package/src/components/SVG/recipe-bg-shape.svg +3 -0
- package/src/components/SVG/star.svg +3 -0
- package/src/components/SVG/subtract.svg +3 -0
- package/src/components/SVG/trustpilot.svg +14 -0
- package/src/components/SVG/unmute.svg +5 -0
- package/src/components/index.ts +20 -0
- package/src/components/styles/Color/Color.stories.tsx +89 -0
- package/src/components/styles/Color/Color.tsx +47 -0
- package/src/components/styles/Icon/Icon.stories.tsx +103 -0
- package/src/components/styles/Icon/Icon.tsx +6 -0
- package/src/components/styles/Illustration/Illustration.stories.tsx +253 -0
- package/src/components/styles/Illustration/Illustration.tsx +45 -0
- package/src/components/styles/Typography/Typography.stories.tsx +37 -0
- package/src/components/styles/Typography/Typography.tsx +19 -0
- package/src/helpers/accordions.ts +39 -0
- package/src/helpers/clickoutside.ts +31 -0
- package/src/helpers/debounce.ts +10 -0
- package/src/helpers/index.ts +9 -0
- package/src/helpers/intersectionObserver.ts +101 -0
- package/src/helpers/keyboardControl.ts +58 -0
- package/src/helpers/responsive.ts +29 -0
- package/src/helpers/scroll.ts +16 -0
- package/src/index.ts +8 -0
- package/src/lib/i18n.ts +20 -0
- package/src/lib/locales/fr/design.json +42 -0
- package/src/styles/globals.css +205 -0
- package/src/types/svg.d.ts +8 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { FeatureCard } from './FeatureCard';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Cards/FeatureCard',
|
|
7
|
+
component: FeatureCard,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'padded',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
features: {
|
|
14
|
+
control: 'object',
|
|
15
|
+
description: 'Array of features to display',
|
|
16
|
+
},
|
|
17
|
+
backgroundColor: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['lavender', 'beige', 'white'],
|
|
20
|
+
description: 'Background color theme',
|
|
21
|
+
},
|
|
22
|
+
className: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Additional classes to apply to the component',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
features: [
|
|
29
|
+
{ id: '1', text: 'Complet et équilibré pour les [Race de chien/chat]' },
|
|
30
|
+
{ id: '2', text: 'Ingrédients de qualité humaine' },
|
|
31
|
+
{ id: '3', text: "Jusqu'à 70% de viande" }
|
|
32
|
+
],
|
|
33
|
+
backgroundColor: 'lavender',
|
|
34
|
+
},
|
|
35
|
+
globals: {
|
|
36
|
+
backgrounds: {
|
|
37
|
+
value: 'light',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
} satisfies Meta<typeof FeatureCard>;
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const Default: Story = {};
|
|
46
|
+
|
|
47
|
+
export const BeigeBackground: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
backgroundColor: 'beige',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const WhiteBackground: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
backgroundColor: 'white',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const TwoFeatures: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
features: [
|
|
62
|
+
{ id: '1', text: 'Nutrition complète et équilibrée' },
|
|
63
|
+
{ id: '2', text: 'Ingrédients premium sélectionnés' }
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const FourFeatures: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
features: [
|
|
71
|
+
{ id: '1', text: 'Complet et équilibré pour les [Race de chien/chat]' },
|
|
72
|
+
{ id: '2', text: 'Ingrédients de qualité humaine' },
|
|
73
|
+
{ id: '3', text: "Jusqu'à 70% de viande" },
|
|
74
|
+
{ id: '4', text: 'Sans céréales ni conservateurs artificiels' }
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const LongFeatureText: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
features: [
|
|
82
|
+
{
|
|
83
|
+
id: '1',
|
|
84
|
+
text: 'Une formule complète et équilibrée spécialement conçue pour répondre aux besoins nutritionnels de votre animal de compagnie'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: '2',
|
|
88
|
+
text: 'Des ingrédients de qualité humaine soigneusement sélectionnés par nos vétérinaires nutritionnistes'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: '3',
|
|
92
|
+
text: "Jusqu'à 70% de viande fraîche pour un apport protéique optimal et un goût irrésistible"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
import ClaudineTipsMobileImage from '../../../assets/images/tips/claudine-tips-mobile.webp';
|
|
8
|
+
import ClaudineTipsMobile2xImage from '../../../assets/images/tips/claudine-tips-mobile@2x.webp';
|
|
9
|
+
import ClaudineTipsImage from '../../../assets/images/tips/claudine-tips.webp';
|
|
10
|
+
import ClaudineTips2xImage from '../../../assets/images/tips/claudine-tips@2x.webp';
|
|
11
|
+
import { CheckRoundedIcon } from '../../../components';
|
|
12
|
+
import { ResponsiveImage, Text } from '../../Base';
|
|
13
|
+
|
|
14
|
+
export interface FeatureItem {
|
|
15
|
+
id: string;
|
|
16
|
+
text: string;
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface FeatureCardProps {
|
|
21
|
+
features: FeatureItem[];
|
|
22
|
+
className?: string;
|
|
23
|
+
backgroundColor?: 'lavender' | 'beige' | 'white';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const backgroundStyles = {
|
|
27
|
+
lavender: 'bg-lavender-blue-light',
|
|
28
|
+
beige: 'bg-beige-light',
|
|
29
|
+
white: 'bg-white',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const FeatureCard = ({ features, className = '', backgroundColor = 'lavender' }: FeatureCardProps) => {
|
|
33
|
+
return (
|
|
34
|
+
<div className={clsx('relative flex w-full items-center gap-[16px] overflow-hidden p-6 md:p-10 lg:gap-[32px] lg:rounded-2xl lg:p-[40px]', backgroundStyles[backgroundColor], 'flex-col md:flex-row', className)}>
|
|
35
|
+
{/* Features List */}
|
|
36
|
+
<div className={clsx('flex-1 space-y-4', 'md:pr-4')}>
|
|
37
|
+
{features.map((feature) => (
|
|
38
|
+
<div key={feature.id} className="flex items-start gap-[8px]">
|
|
39
|
+
{feature.icon || <CheckRoundedIcon className="text-claret-violet-light w-6 shrink-0" />}
|
|
40
|
+
<Text size="xl">{feature.text}</Text>
|
|
41
|
+
</div>
|
|
42
|
+
))}
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div className={clsx('relative flex-shrink-0', 'h-32 w-32 md:h-40 md:w-40', 'self-end', 'hidden md:block')}>
|
|
46
|
+
<ResponsiveImage mobile={ClaudineTipsMobileImage} desktop={ClaudineTipsImage} mobile2x={ClaudineTipsMobile2xImage} desktop2x={ClaudineTips2xImage} alt="Claudine" className="absolute right-0 -bottom-6 h-full w-full object-cover object-bottom" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
|
+
|
|
5
|
+
import { FeatureIllustration } from './FeatureIllustration';
|
|
6
|
+
|
|
7
|
+
import BoxIllustration from '../../../assets/illustrations/box.webp';
|
|
8
|
+
import FranceIllustration from '../../../assets/illustrations/france.webp';
|
|
9
|
+
import PawIllustration from '../../../assets/illustrations/paws.webp';
|
|
10
|
+
import PotIllustration from '../../../assets/illustrations/pot.webp';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof FeatureIllustration> = {
|
|
13
|
+
title: 'Components/Cards/FeatureIllustration',
|
|
14
|
+
component: FeatureIllustration,
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: 'centered',
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component: 'A component that displays an illustration with descriptive text below it. Perfect for feature highlights or service descriptions.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
tags: ['autodocs'],
|
|
24
|
+
argTypes: {
|
|
25
|
+
src: {
|
|
26
|
+
description: 'The source URL of the image to display',
|
|
27
|
+
control: { type: 'text' },
|
|
28
|
+
},
|
|
29
|
+
alt: {
|
|
30
|
+
description: 'Alternative text for the image (accessibility)',
|
|
31
|
+
control: { type: 'text' },
|
|
32
|
+
},
|
|
33
|
+
title: {
|
|
34
|
+
description: 'The text to display below the illustration',
|
|
35
|
+
control: { type: 'text' },
|
|
36
|
+
},
|
|
37
|
+
className: {
|
|
38
|
+
description: 'Additional CSS classes for the container',
|
|
39
|
+
control: { type: 'text' },
|
|
40
|
+
},
|
|
41
|
+
illustrationClassName: {
|
|
42
|
+
description: 'Additional CSS classes for the illustration container',
|
|
43
|
+
control: { type: 'text' },
|
|
44
|
+
},
|
|
45
|
+
titleClassName: {
|
|
46
|
+
description: 'Additional CSS classes for the title text',
|
|
47
|
+
control: { type: 'text' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default meta;
|
|
53
|
+
type Story = StoryObj<typeof meta>;
|
|
54
|
+
|
|
55
|
+
export const Default: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
src: BoxIllustration,
|
|
58
|
+
alt: 'Box illustration',
|
|
59
|
+
title: 'Interrompez vos futures livraisons quand vous le souhaitez',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const ThreeFeatures: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<div className="flex max-w-4xl flex-col gap-[23px] md:flex-row">
|
|
66
|
+
<FeatureIllustration src={BoxIllustration} alt="Box illustration" title="Interrompez vos futures livraisons quand vous le souhaitez" />
|
|
67
|
+
<FeatureIllustration src={FranceIllustration} alt="France illustration" title="Reprogrammez vos dates de livraison à tout moment" />
|
|
68
|
+
<FeatureIllustration src={PawIllustration} alt="Paws illustration" title="Modifiez vos produits ou les quantités dans votre espace personnel" />
|
|
69
|
+
</div>
|
|
70
|
+
),
|
|
71
|
+
parameters: {
|
|
72
|
+
docs: {
|
|
73
|
+
description: {
|
|
74
|
+
story: 'Example showing three feature illustrations together as they would appear in the actual design.',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const CustomStyling: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
src: PotIllustration,
|
|
83
|
+
alt: 'Pot illustration',
|
|
84
|
+
title: 'Custom styled feature',
|
|
85
|
+
className: 'bg-lavender-blue-light rounded-lg p-6',
|
|
86
|
+
illustrationClassName: 'scale-75',
|
|
87
|
+
titleClassName: 'text-purple-800 font-bold',
|
|
88
|
+
},
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
description: {
|
|
92
|
+
story: 'Example showing how to customize the styling with additional CSS classes.',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { Text } from '../../Base';
|
|
6
|
+
|
|
7
|
+
export interface FeatureIllustrationProps {
|
|
8
|
+
src: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
title: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
illustrationClassName?: string;
|
|
13
|
+
titleClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const FeatureIllustration = ({
|
|
17
|
+
src,
|
|
18
|
+
alt,
|
|
19
|
+
title,
|
|
20
|
+
className = '',
|
|
21
|
+
illustrationClassName = '',
|
|
22
|
+
titleClassName = '',
|
|
23
|
+
}: FeatureIllustrationProps) => {
|
|
24
|
+
return (
|
|
25
|
+
<div className={clsx(
|
|
26
|
+
'flex flex-col items-center text-center gap-[24px]',
|
|
27
|
+
'p-4',
|
|
28
|
+
className
|
|
29
|
+
)}>
|
|
30
|
+
{/* Illustration */}
|
|
31
|
+
<div className={clsx(
|
|
32
|
+
'flex items-center justify-center',
|
|
33
|
+
illustrationClassName
|
|
34
|
+
)}>
|
|
35
|
+
<img
|
|
36
|
+
src={src}
|
|
37
|
+
alt={alt}
|
|
38
|
+
className='w-16 h-16 object-contain'
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
{/* Title */}
|
|
43
|
+
<Text
|
|
44
|
+
variant="p"
|
|
45
|
+
size="md"
|
|
46
|
+
className={clsx(
|
|
47
|
+
'text-claret-violet leading-relaxed',
|
|
48
|
+
'max-w-xs',
|
|
49
|
+
titleClassName
|
|
50
|
+
)}
|
|
51
|
+
>
|
|
52
|
+
{title}
|
|
53
|
+
</Text>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { FoodCard } from './FoodCard';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Cards/FoodCard',
|
|
7
|
+
component: FoodCard,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
title: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
},
|
|
19
|
+
illustration: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Name of the illustration asset',
|
|
22
|
+
},
|
|
23
|
+
className: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'Additional classes to apply to the component',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
title: 'Le légume',
|
|
30
|
+
description: 'soutiennent le métabolisme énergétique et le système nerveux.',
|
|
31
|
+
illustration: '/illustrations/carrot.webp',
|
|
32
|
+
},
|
|
33
|
+
globals: {
|
|
34
|
+
backgrounds: {
|
|
35
|
+
value: 'light',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
} satisfies Meta<typeof FoodCard>;
|
|
39
|
+
export default meta;
|
|
40
|
+
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
42
|
+
|
|
43
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
import { Text } from '../../../components';
|
|
6
|
+
|
|
7
|
+
export interface FoodCardProps {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
illustration: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const FoodCard = forwardRef<HTMLDivElement, FoodCardProps>(({ title, description, illustration, className }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<div ref={ref} className={clsx('bg-lavender-blue-light text-claret-violet-dark rounded-food-card min-h-25 w-68 p-4', className)}>
|
|
17
|
+
<div key={`food-card-${title}`} className="flex animate-[fade-in_600ms_ease-in] gap-2.5">
|
|
18
|
+
<div className="w-12 shrink-0">
|
|
19
|
+
<img src={illustration} alt={title} className="object-contain" />
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
<Text size="sm" className="mb-2 font-semibold">
|
|
23
|
+
{title}
|
|
24
|
+
</Text>
|
|
25
|
+
<Text size="sm" className="hidden md:block">
|
|
26
|
+
{description}
|
|
27
|
+
</Text>
|
|
28
|
+
<Text size="md" className="block md:hidden">
|
|
29
|
+
{description}
|
|
30
|
+
</Text>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
FoodCard.displayName = 'FoodCard';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { FrequencySelectorCard } from './FrequencySelectorCard';
|
|
4
|
+
|
|
5
|
+
import FridgeImage from '../../../assets/images/frequency/food-in-fridge.webp';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof FrequencySelectorCard> = {
|
|
8
|
+
title: 'Components/Cards/FrequencySelectorCard',
|
|
9
|
+
component: FrequencySelectorCard,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {
|
|
15
|
+
isSelected: {
|
|
16
|
+
control: 'boolean',
|
|
17
|
+
},
|
|
18
|
+
badgeLabel: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
},
|
|
21
|
+
mobileImage: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
},
|
|
24
|
+
desktopImage: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
},
|
|
27
|
+
mobile2xImage: {
|
|
28
|
+
control: 'text',
|
|
29
|
+
},
|
|
30
|
+
desktop2xImage: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
},
|
|
33
|
+
imageAlt: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
},
|
|
36
|
+
onClick: { action: 'clicked' },
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
42
|
+
|
|
43
|
+
export const Default: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
title: 'Livraison toutes les 2 semaines',
|
|
46
|
+
description: 'Ne prends pas de place dans le frigo',
|
|
47
|
+
priceLabel: 'Un poil plus cher',
|
|
48
|
+
isSelected: false,
|
|
49
|
+
mobileImage: FridgeImage,
|
|
50
|
+
desktopImage: FridgeImage,
|
|
51
|
+
mobile2xImage: FridgeImage,
|
|
52
|
+
desktop2xImage: FridgeImage,
|
|
53
|
+
imageAlt: 'Nourriture dans le frigo',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const Selected: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
title: 'Livraison toutes les 3 semaines',
|
|
60
|
+
description: 'Convient à la majorité des frigos',
|
|
61
|
+
priceLabel: 'Tarifs abordables',
|
|
62
|
+
isSelected: true,
|
|
63
|
+
mobileImage: FridgeImage,
|
|
64
|
+
desktopImage: FridgeImage,
|
|
65
|
+
mobile2xImage: FridgeImage,
|
|
66
|
+
desktop2xImage: FridgeImage,
|
|
67
|
+
imageAlt: 'Nourriture dans le frigo',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const WithBadge: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
title: 'Livraison toutes les 6 semaines',
|
|
74
|
+
description: 'Va falloir faire de la place dans le frigo',
|
|
75
|
+
priceLabel: 'la bonne affaire',
|
|
76
|
+
isSelected: false,
|
|
77
|
+
badgeLabel: 'Le plus populaire',
|
|
78
|
+
mobileImage: FridgeImage,
|
|
79
|
+
desktopImage: FridgeImage,
|
|
80
|
+
mobile2xImage: FridgeImage,
|
|
81
|
+
desktop2xImage: FridgeImage,
|
|
82
|
+
imageAlt: 'Nourriture dans le frigo',
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const WithBadgeAndSelected: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
title: 'Livraison toutes les 6 semaines',
|
|
89
|
+
description: 'Va falloir faire de la place dans le frigo',
|
|
90
|
+
priceLabel: 'la bonne affaire',
|
|
91
|
+
isSelected: true,
|
|
92
|
+
badgeLabel: 'Le plus populaire',
|
|
93
|
+
mobileImage: FridgeImage,
|
|
94
|
+
desktopImage: FridgeImage,
|
|
95
|
+
mobile2xImage: FridgeImage,
|
|
96
|
+
desktop2xImage: FridgeImage,
|
|
97
|
+
imageAlt: 'Nourriture dans le frigo',
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const AllVariants: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 max-w-6xl">
|
|
104
|
+
<FrequencySelectorCard
|
|
105
|
+
title="Livraison toutes les 6 semaines"
|
|
106
|
+
description="Va falloir faire de la place dans le frigo"
|
|
107
|
+
priceLabel="la bonne affaire"
|
|
108
|
+
isSelected={false}
|
|
109
|
+
badgeLabel="Le plus populaire"
|
|
110
|
+
mobileImage={FridgeImage}
|
|
111
|
+
desktopImage={FridgeImage}
|
|
112
|
+
mobile2xImage={FridgeImage}
|
|
113
|
+
desktop2xImage={FridgeImage}
|
|
114
|
+
imageAlt="Nourriture dans le frigo"
|
|
115
|
+
/>
|
|
116
|
+
<FrequencySelectorCard
|
|
117
|
+
title="Livraison toutes les 3 semaines"
|
|
118
|
+
description="Convient à la majorité des frigos"
|
|
119
|
+
priceLabel="Tarifs abordables"
|
|
120
|
+
isSelected={true}
|
|
121
|
+
mobileImage={FridgeImage}
|
|
122
|
+
desktopImage={FridgeImage}
|
|
123
|
+
mobile2xImage={FridgeImage}
|
|
124
|
+
desktop2xImage={FridgeImage}
|
|
125
|
+
imageAlt="Nourriture dans le frigo"
|
|
126
|
+
/>
|
|
127
|
+
<FrequencySelectorCard
|
|
128
|
+
title="Livraison toutes les 2 semaines"
|
|
129
|
+
description="Ne prends pas de place dans le frigo"
|
|
130
|
+
priceLabel="Un poil plus cher"
|
|
131
|
+
isSelected={false}
|
|
132
|
+
mobileImage={FridgeImage}
|
|
133
|
+
desktopImage={FridgeImage}
|
|
134
|
+
mobile2xImage={FridgeImage}
|
|
135
|
+
desktop2xImage={FridgeImage}
|
|
136
|
+
imageAlt="Nourriture dans le frigo"
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
),
|
|
140
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { ResponsiveImage, Text } from '../../Base';
|
|
5
|
+
import { CheckIcon, DollarRoundedIcon } from '../../SVG';
|
|
6
|
+
|
|
7
|
+
export interface FrequencySelectorCardProps {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
priceLabel: string;
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
badgeLabel?: string;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
// Image props
|
|
16
|
+
mobileImage: string;
|
|
17
|
+
desktopImage: string;
|
|
18
|
+
mobile2xImage: string;
|
|
19
|
+
desktop2xImage: string;
|
|
20
|
+
imageAlt: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const FrequencySelectorCard = ({
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
priceLabel,
|
|
27
|
+
isSelected = false,
|
|
28
|
+
badgeLabel,
|
|
29
|
+
onClick,
|
|
30
|
+
className = '',
|
|
31
|
+
mobileImage,
|
|
32
|
+
desktopImage,
|
|
33
|
+
mobile2xImage,
|
|
34
|
+
desktop2xImage,
|
|
35
|
+
imageAlt
|
|
36
|
+
}: FrequencySelectorCardProps) => {
|
|
37
|
+
return (
|
|
38
|
+
<div className={clsx('relative cursor-pointer rounded-2xl transition-all duration-200 hover:shadow-lg', 'bg-beige-light', isSelected && 'ring-claret-violet-dark bg-lavender-blue-light ring-[3px]', className)} onClick={onClick}>
|
|
39
|
+
{/* Fridge Image - Full Width */}
|
|
40
|
+
<div className="relative h-40 w-full overflow-hidden rounded-t-2xl">
|
|
41
|
+
<ResponsiveImage
|
|
42
|
+
mobile={mobileImage}
|
|
43
|
+
desktop={desktopImage}
|
|
44
|
+
mobile2x={mobile2xImage}
|
|
45
|
+
desktop2x={desktop2xImage}
|
|
46
|
+
alt={imageAlt}
|
|
47
|
+
className="h-full w-full object-cover"
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
{/* Badge - Overlaid on Image */}
|
|
51
|
+
{badgeLabel ? (
|
|
52
|
+
<div className="absolute top-0 left-1/2 transform -translate-x-1/2 z-10">
|
|
53
|
+
<div className="bg-claret-violet-dark rounded-b-[20px] px-6 py-3 text-sm font-medium text-white whitespace-nowrap">
|
|
54
|
+
{badgeLabel}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
) : null}
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
{/* Content Container */}
|
|
61
|
+
<div className="gap-[24px] p-[24px] md:gap-[12px] md:p-[12px]">
|
|
62
|
+
<div className="gap-[24px] md:gap-[4.61px]">
|
|
63
|
+
{/* Title */}
|
|
64
|
+
<Text size="xl" className="text-claret-violet-dark mb-3">
|
|
65
|
+
{title}
|
|
66
|
+
</Text>
|
|
67
|
+
{/* Description */}
|
|
68
|
+
<Text size="md" className="text-claret-violet-dark mb-4 leading-relaxed">
|
|
69
|
+
{description}
|
|
70
|
+
</Text>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
{/* Price Label with Icon */}
|
|
74
|
+
<div className="flex items-center gap-[10px] md:gap-[4.61px]">
|
|
75
|
+
<DollarRoundedIcon className="w-6" />
|
|
76
|
+
<Text size="md" className="text-claret-violet-dark font-medium italic">
|
|
77
|
+
{priceLabel}
|
|
78
|
+
</Text>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
{/* Selected Check Icon */}
|
|
82
|
+
{isSelected ? (
|
|
83
|
+
<div className="bg-beige-light border-claret-violet-dark absolute -bottom-4 left-1/2 flex h-8 w-8 -translate-x-1/2 transform items-center justify-center rounded-full border-[2px]">
|
|
84
|
+
<CheckIcon className="w-4" />
|
|
85
|
+
</div>
|
|
86
|
+
) : null}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { IllustratedCard } from './IllustratedCard';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Cards/IllustratedCard',
|
|
7
|
+
component: IllustratedCard,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: { control: 'select', options: ['primary', 'secondary', 'tertiary'] },
|
|
14
|
+
title: { control: 'text' },
|
|
15
|
+
description: { control: 'text' },
|
|
16
|
+
illustration: { control: 'text', description: 'Illustration asset name without the .webp extension' },
|
|
17
|
+
className: { control: 'text', description: 'Additional class names' },
|
|
18
|
+
illustrationClassName: { control: 'text', description: 'Additional class names for the illustration' },
|
|
19
|
+
},
|
|
20
|
+
} satisfies Meta<typeof IllustratedCard>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
export const Primary: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
variant: 'primary',
|
|
28
|
+
title: '70% de viande de porc',
|
|
29
|
+
description: 'pour les carnivores oportunistes !',
|
|
30
|
+
illustration: '/illustrations/plate.webp',
|
|
31
|
+
className: 'max-md:w-67.5',
|
|
32
|
+
illustrationClassName: 'translate-y-4',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Secondary: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
variant: 'secondary',
|
|
39
|
+
title: 'Adapté à tous les chiens',
|
|
40
|
+
description: 'à partir de 4 mois',
|
|
41
|
+
illustration: '/illustrations/dog.webp',
|
|
42
|
+
illustrationClassName: 'md:!scale-120',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Tertiary: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
variant: 'tertiary',
|
|
49
|
+
title: 'Adapté à tous les chats',
|
|
50
|
+
description: 'à parir de 4 mois',
|
|
51
|
+
illustration: '/illustrations/cat.webp',
|
|
52
|
+
illustrationClassName: '-rotate-12 -translate-x-6 md:!scale-138 -mt-4',
|
|
53
|
+
},
|
|
54
|
+
};
|