@q2devel/q2-storybook 1.0.131 → 1.0.134

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.
@@ -66,7 +66,7 @@ export const BasketDialog = ({ isOpen, onClose, products, subtotal, onQuantityCh
66
66
  product.variation_name, src: product
67
67
  .variation_images[0]
68
68
  ?.href ||
69
- '/lk_logo.png', className: "size-full object-contain" }), isTemporaryRow && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-75", children: _jsx(Spinner, { className: "h-8 w-8 text-[var(--primary)]" }) }))] }), _jsxs("div", { className: "ml-4 flex flex-1 flex-col", children: [_jsx("div", { children: _jsxs("div", { className: "flex justify-between text-base font-medium text-gray-900", children: [_jsx(Heading, { level: 3, className: "font-extralight text-lg", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { asLink: true, unstyled: true, href: productLink?.(product.product_name, product.variation_uuid), children: product.product_name }), isProcessing &&
69
+ '/lk_logo.png', className: "size-full object-contain" }), isTemporaryRow && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-75", children: _jsx(Spinner, { className: "h-8 w-8 text-[var(--primary)]" }) }))] }), _jsxs("div", { className: "ml-4 flex flex-1 flex-col", children: [_jsx("div", { children: _jsxs("div", { className: "flex justify-between text-base font-medium text-gray-900", children: [_jsx(Heading, { level: 3, className: "font-extralight text-lg", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { asLink: true, unstyled: true, href: productLink?.(product.product_name, product.variation_id), children: product.product_name }), isProcessing &&
70
70
  !isTemporaryRow && (_jsx(Spinner, { className: "h-4 w-4 text-gray-400" }))] }) }), _jsx(Price, { value: product.price, locale: locale, options: productPriceOptions, className: "ml-4 font-light" })] }) }), _jsxs("div", { className: "flex flex-1 items-end justify-between text-sm", children: [isTemporaryRow ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Spinner, { className: "h-4 w-4 text-[var(--primary)]" }), _jsx("p", { className: "text-gray-500 italic", children: "Prid\u00E1va sa do ko\u0161\u00EDka..." })] })) : showQuantityControls &&
71
71
  onQuantityChange ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-gray-500 mr-2", children: translations.amount }), _jsxs("div", { className: "flex items-center", children: [_jsx("button", { type: "button", onClick: () => !isProcessing &&
72
72
  handleDecrement(product.variation_uuid, displayQuantity), disabled: isProcessing, className: `rounded-full p-1 text-gray-600 ${isProcessing
@@ -1,10 +1,15 @@
1
1
  interface MediaItem {
2
2
  url: string;
3
3
  type: string;
4
+ title?: string;
5
+ description?: string;
4
6
  }
5
7
  interface MediaSliderProps {
6
8
  media: MediaItem[];
7
9
  interval?: number;
10
+ overlayClassName?: string;
11
+ titleClassName?: string;
12
+ descriptionClassName?: string;
8
13
  }
9
- export default function MediaSlider({ media, interval }: MediaSliderProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export default function MediaSlider({ media, interval, overlayClassName, titleClassName, descriptionClassName, }: MediaSliderProps): import("react/jsx-runtime").JSX.Element | null;
10
15
  export {};
@@ -1,8 +1,8 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import Image from "next/image";
4
- import { useEffect, useState, useRef } from "react";
5
- export default function MediaSlider({ media, interval = 5000 }) {
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from 'next/image';
4
+ import { useEffect, useRef, useState } from 'react';
5
+ export default function MediaSlider({ media, interval = 5000, overlayClassName = '', titleClassName = '', descriptionClassName = '', }) {
6
6
  const [currentSlide, setCurrentSlide] = useState(0);
7
7
  const intervalRef = useRef(null);
8
8
  useEffect(() => {
@@ -26,16 +26,23 @@ export default function MediaSlider({ media, interval = 5000 }) {
26
26
  }
27
27
  const renderMediaItem = (item, index) => {
28
28
  const isActive = index === currentSlide;
29
+ let mediaElement;
29
30
  switch (item.type) {
30
31
  case 'image':
31
- return (_jsx(Image, { src: process.env.NEXT_PUBLIC_DRUPAL_URL + item.url, alt: `Banner ${index + 1}`, width: 1200, height: 800, className: `absolute top-0 left-0 w-full h-full object-cover transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'}`, priority: index === 0 }, index));
32
+ mediaElement = (_jsx(Image, { src: process.env.NEXT_PUBLIC_DRUPAL_URL + item.url, alt: `Banner ${index + 1}`, width: 1200, height: 800, className: `absolute top-0 left-0 w-full h-full object-cover transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'}`, priority: index === 0 }, index));
33
+ break;
32
34
  case 'video':
33
- return (_jsx("video", { src: process.env.NEXT_PUBLIC_DRUPAL_URL + item.url, autoPlay: true, loop: true, muted: true, playsInline: true, className: `absolute top-0 left-0 w-full h-full object-cover transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'}` }, index));
35
+ mediaElement = (_jsx("video", { src: process.env.NEXT_PUBLIC_DRUPAL_URL + item.url, autoPlay: true, loop: true, muted: true, playsInline: true, className: `absolute top-0 left-0 w-full h-full object-cover transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'}` }, index));
36
+ break;
34
37
  case 'remote_video':
35
- return (_jsx("iframe", { src: `${item.url.replace('watch?v=', 'embed/').replace('youtu.be', 'youtube.com/embed/')}?autoplay=1&mute=1&controls=0`, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, className: `absolute top-0 left-0 w-full h-full transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'}` }, index));
38
+ mediaElement = (_jsx("iframe", { src: `${item.url
39
+ .replace('watch?v=', 'embed/')
40
+ .replace('youtu.be', 'youtube.com/embed/')}?autoplay=1&mute=1&controls=0`, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, className: `absolute top-0 left-0 w-full h-full transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'}` }, index));
41
+ break;
36
42
  default:
37
43
  return null;
38
44
  }
45
+ return (_jsxs("div", { children: [mediaElement, (item.title || item.description) && (_jsx("div", { className: `absolute inset-0 bg-black/30 flex items-center justify-center transition-opacity duration-1000 ${isActive ? 'opacity-100' : 'opacity-0'} ${overlayClassName}`, children: _jsxs("div", { className: "text-center text-white p-4", children: [item.title && (_jsx("h2", { className: `text-4xl font-bold mb-4 ${titleClassName}`, children: item.title })), item.description && (_jsx("p", { className: `text-lg ${descriptionClassName}`, children: item.description }))] }) }))] }, `slide-${index}`));
39
46
  };
40
47
  return (_jsx("div", { className: "relative w-full h-full", children: media.map((item, index) => renderMediaItem(item, index)) }));
41
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q2devel/q2-storybook",
3
- "version": "1.0.131",
3
+ "version": "1.0.134",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",