import type { Meta, StoryObj } from "@storybook/nextjs-vite" import { Lang } from "@scandic-hotels/common/constants/language" import { VideoWithCard } from "." import { config } from "./variants" const meta: Meta = { title: "Core Components/Video/VideoWithCard", component: VideoWithCard, parameters: { docs: { description: { component: "A component to display a VideoPlayer and content inside a card connected to the video. The size and gaps are determined by the parent container.", }, }, }, argTypes: { variant: { control: "select", options: Object.keys(config.variants.variant), table: { defaultValue: { summary: config.defaultVariants.variant, }, type: { summary: Object.keys(config.variants.variant).join(" | "), }, }, description: "The variant of the card, which determines its style of the text and what content is shown.", }, style: { control: "select", options: Object.keys(config.variants.style), table: { defaultValue: { summary: config.defaultVariants.style, }, type: { summary: Object.keys(config.variants.style).join(" | "), }, }, description: "This decides the background color and text color of the card.", }, heading: { table: { type: { summary: "string" }, }, description: "The heading text. Only applicable for the text variant.", }, text: { table: { type: { summary: "string" }, }, description: "The body text. Only applicable for the text variant.", }, quote: { table: { type: { summary: "string" }, }, description: "The quote text. Only applicable for the quote variant.", }, author: { table: { type: { summary: "string" }, }, description: "The author of the quote. Only applicable for the quote variant.", }, authorDescription: { table: { type: { summary: "string" }, }, description: "The description of the author. Only applicable for the quote variant.", }, video: { control: false, table: { type: { summary: "{ sources: { src: string; type: string }[]; poster?: { src: string; dimensions?: { width: number; height: number } }; captions?: Caption[]; focalPoint?: FocalPoint}", }, }, description: "The video props including source URL, captions and focal point. Please note that not all props from the VideoPlayer component are supported in this wrapper component.", }, }, } export default meta type Story = StoryObj const videoProps = { sources: [ { src: "https://eu-assets.contentstack.com/v3/assets/bltfd73aa2de3a5c4e3/bltc3aa53ac9bf6798c/693ad4b65b0889d6348893f3/Test_video.mp4", type: "video/mp4", }, { src: "https://eu-assets.contentstack.com/v3/assets/bltfd73aa2de3a5c4e3/blt029be07ddd444eea/693c251c09e17b33c93c1dd6/hero-banner-1920-vp9.webm", type: "video/webm", }, ], poster: { src: "https://imagevault.scandichotels.com/publishedmedia/dtpv2wgm6jhix2pqpp88/Scandic_Downtown_Camper_restaurang_bar_The_Nest_lounge_eld.jpg", }, captions: [ { src: "./video/captions_en.vtt", srcLang: Lang.en, isDefault: false, }, { src: "./video/captions_sv.vtt", srcLang: Lang.sv, isDefault: false, }, ], fullHeight: true, } const quoteCardProps = { variant: "quote" as const, quote: "Download our membership App for smoother & richer experience", author: "Hans Christian Andersen", authorDescription: "The famed Danish storyteller.", video: videoProps, } const textCardProps = { variant: "text" as const, heading: "Download our membership App now", text: "Hans Christian Andersen, the famed Danish storyteller, spent many years of his life in Nyhavn, drawing inspiration from its lively atmosphere and picturesque setting.", video: videoProps, } const smallDecorator = (Story: React.FC) => (
) const largeDecorator = (Story: React.FC) => (
) export const QuotePrimary1Small: Story = { args: { ...quoteCardProps, style: "primary-1", }, decorators: [smallDecorator], render: (args) => , } export const QuotePrimary2Small: Story = { args: { ...quoteCardProps, style: "primary-2", }, decorators: [smallDecorator], render: (args) => , } export const TextPrimary1Small: Story = { args: { ...textCardProps, style: "primary-1", }, decorators: [smallDecorator], render: (args) => , } export const TextPrimary2Small: Story = { args: { ...textCardProps, style: "primary-2", }, decorators: [smallDecorator], render: (args) => , } export const QuotePrimary1Large: Story = { args: { ...quoteCardProps, style: "primary-1", }, decorators: [largeDecorator], render: (args) => , } export const QuotePrimary2Large: Story = { args: { ...quoteCardProps, style: "primary-2", }, decorators: [largeDecorator], render: (args) => , } export const TextPrimary1Large: Story = { args: { ...textCardProps, style: "primary-1", }, decorators: [largeDecorator], render: (args) => , } export const TextPrimary2Large: Story = { args: { ...textCardProps, style: "primary-2", }, decorators: [largeDecorator], render: (args) => , }