@q2devel/q2-storybook 1.0.12 → 1.0.13

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.
Files changed (35) hide show
  1. package/dist/components/badge/Badge.js +1 -0
  2. package/dist/components/banner/Banner.d.ts +48 -0
  3. package/dist/components/banner/Banner.js +137 -0
  4. package/dist/components/basket-dialog/BasketDialog.d.ts +55 -0
  5. package/dist/components/basket-dialog/BasketDialog.js +167 -0
  6. package/dist/components/icon/CloseIcon.d.ts +3 -0
  7. package/dist/components/icon/CloseIcon.js +14 -0
  8. package/dist/components/icon/InfoIcon.d.ts +3 -0
  9. package/dist/components/icon/InfoIcon.js +15 -0
  10. package/dist/components/label/Label.d.ts +12 -0
  11. package/dist/components/label/Label.js +11 -0
  12. package/dist/components/nav-bar/NavBar.d.ts +19 -0
  13. package/dist/components/nav-bar/NavBar.js +36 -0
  14. package/dist/components/product-card/ProductCard.d.ts +61 -0
  15. package/dist/components/product-card/ProductCard.js +148 -0
  16. package/dist/components/select-field/SelectField.d.ts +27 -0
  17. package/dist/components/select-field/SelectField.js +132 -0
  18. package/dist/components/select-field/SelectFieldOption.d.ts +5 -0
  19. package/dist/components/select-field/SelectFieldOption.js +31 -0
  20. package/dist/components/text-field/TextField.d.ts +21 -0
  21. package/dist/components/text-field/TextField.js +87 -0
  22. package/dist/components/text-field/TextField.types.d.ts +22 -0
  23. package/dist/components/text-field/TextField.types.js +1 -0
  24. package/dist/components/tooltip/Tooltip.d.ts +18 -0
  25. package/dist/components/tooltip/Tooltip.js +18 -0
  26. package/dist/global.css +1 -0
  27. package/dist/index.d.ts +7 -1
  28. package/dist/index.js +7 -2
  29. package/dist/utils/Helper.d.ts +0 -0
  30. package/dist/utils/Helper.js +1 -0
  31. package/dist/utils/StyleHelper.d.ts +4 -0
  32. package/dist/utils/StyleHelper.js +12 -0
  33. package/package.json +10 -3
  34. package/dist/components/heading/Heading.d.ts +0 -6
  35. package/dist/components/heading/Heading.js +0 -6
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import React from 'react';
2
3
  var Badge = function (_a) {
3
4
  var children = _a.children, onClick = _a.onClick, _b = _a.color, color = _b === void 0 ? 'bg-blue-100 text-blue-800' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.labelClassName, labelClassName = _d === void 0 ? '' : _d, rightIcon = _a.rightIcon;
@@ -0,0 +1,48 @@
1
+ import React, { ReactNode } from 'react';
2
+ export type BannerItem = {
3
+ id: string;
4
+ imageSrc: string;
5
+ imageAlt?: string;
6
+ title: string;
7
+ subtitle: string;
8
+ buttonText?: string;
9
+ buttonLink?: string;
10
+ customContent?: ReactNode;
11
+ overlayOpacity?: number;
12
+ buttonVariant?: 'primary' | 'secondary' | 'ghost' | 'outline';
13
+ buttonSize?: 'sm' | 'md' | 'lg';
14
+ };
15
+ export type ControlsType = 'arrows' | 'dots' | 'both' | 'none';
16
+ export type BannerProps = {
17
+ items: BannerItem[];
18
+ height?: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'auto';
19
+ autoplay?: boolean;
20
+ autoplayInterval?: number;
21
+ controls?: ControlsType;
22
+ overlayStyle?: 'dark' | 'light' | 'gradient' | 'none';
23
+ textAlignment?: 'left' | 'center' | 'right';
24
+ textPosition?: 'top' | 'center' | 'bottom';
25
+ className?: string;
26
+ imageClassName?: string;
27
+ titleClassName?: string;
28
+ subtitleClassName?: string;
29
+ buttonClassName?: string;
30
+ indicatorsClassName?: string;
31
+ controlsClassName?: string;
32
+ contentClassName?: string;
33
+ rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
34
+ buttonRounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
35
+ animation?: 'slide' | 'fade' | 'zoom' | 'none';
36
+ animationDuration?: number;
37
+ pauseOnHover?: boolean;
38
+ infiniteLoop?: boolean;
39
+ objectFit?: 'cover' | 'contain' | 'fill' | 'none';
40
+ objectPosition?: 'center' | 'top' | 'bottom' | 'left' | 'right';
41
+ renderItem?: (item: BannerItem, index: number) => ReactNode;
42
+ renderControls?: (goToNext: () => void, goToPrev: () => void) => ReactNode;
43
+ renderIndicators?: (current: number, total: number, goToSlide: (index: number) => void) => ReactNode;
44
+ onSlideChange?: (currentIndex: number, previousIndex: number) => void;
45
+ withOverlay?: boolean;
46
+ overlayOpacity?: number;
47
+ };
48
+ export declare const Banner: ({ items, height, autoplay, autoplayInterval, controls, overlayStyle, textAlignment, textPosition, className, imageClassName, titleClassName, subtitleClassName, buttonClassName, indicatorsClassName, controlsClassName, contentClassName, rounded, buttonRounded, animation, animationDuration, pauseOnHover, infiniteLoop, objectFit, objectPosition, renderItem, renderControls, renderIndicators, onSlideChange, withOverlay, overlayOpacity, }: BannerProps) => React.JSX.Element | null;
@@ -0,0 +1,137 @@
1
+ 'use client';
2
+ import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline';
3
+ import React, { useEffect, useState } from 'react';
4
+ import buildClassesByJoining from '../../utils/StyleHelper';
5
+ export var Banner = function (_a) {
6
+ var items = _a.items, _b = _a.height, height = _b === void 0 ? 'md' : _b, _c = _a.autoplay, autoplay = _c === void 0 ? false : _c, _d = _a.autoplayInterval, autoplayInterval = _d === void 0 ? 5000 : _d, _e = _a.controls, controls = _e === void 0 ? 'both' : _e, _f = _a.overlayStyle, overlayStyle = _f === void 0 ? 'gradient' : _f, _g = _a.textAlignment, textAlignment = _g === void 0 ? 'center' : _g, _h = _a.textPosition, textPosition = _h === void 0 ? 'center' : _h, _j = _a.className, className = _j === void 0 ? '' : _j, _k = _a.imageClassName, imageClassName = _k === void 0 ? '' : _k, _l = _a.titleClassName, titleClassName = _l === void 0 ? '' : _l, _m = _a.subtitleClassName, subtitleClassName = _m === void 0 ? '' : _m, _o = _a.buttonClassName, buttonClassName = _o === void 0 ? '' : _o, _p = _a.indicatorsClassName, indicatorsClassName = _p === void 0 ? '' : _p, _q = _a.controlsClassName, controlsClassName = _q === void 0 ? '' : _q, _r = _a.contentClassName, contentClassName = _r === void 0 ? '' : _r, _s = _a.rounded, rounded = _s === void 0 ? 'none' : _s, _t = _a.buttonRounded, buttonRounded = _t === void 0 ? 'md' : _t, _u = _a.animation, animation = _u === void 0 ? 'slide' : _u, _v = _a.animationDuration, animationDuration = _v === void 0 ? 500 : _v, _w = _a.pauseOnHover, pauseOnHover = _w === void 0 ? true : _w, _x = _a.infiniteLoop, infiniteLoop = _x === void 0 ? true : _x, _y = _a.objectFit, objectFit = _y === void 0 ? 'cover' : _y, _z = _a.objectPosition, objectPosition = _z === void 0 ? 'center' : _z, renderItem = _a.renderItem, renderControls = _a.renderControls, renderIndicators = _a.renderIndicators, onSlideChange = _a.onSlideChange, _0 = _a.withOverlay, withOverlay = _0 === void 0 ? true : _0, _1 = _a.overlayOpacity, overlayOpacity = _1 === void 0 ? 0.5 : _1;
7
+ var _2 = useState(0), currentIndex = _2[0], setCurrentIndex = _2[1];
8
+ var _3 = useState(0), prevIndex = _3[0], setPrevIndex = _3[1];
9
+ var _4 = useState(false), isHovered = _4[0], setIsHovered = _4[1];
10
+ var showArrows = controls === 'arrows' || controls === 'both';
11
+ var showDots = controls === 'dots' || controls === 'both';
12
+ var heightClasses = {
13
+ sm: 'h-48 sm:h-64',
14
+ md: 'h-64 sm:h-96',
15
+ lg: 'h-80 sm:h-[32rem]',
16
+ xl: 'h-96 sm:h-[40rem]',
17
+ full: 'h-screen',
18
+ auto: 'h-auto',
19
+ };
20
+ var overlayClasses = {
21
+ dark: "bg-black/".concat(Math.round(overlayOpacity * 100)),
22
+ light: "bg-white/".concat(Math.round(overlayOpacity * 100)),
23
+ gradient: 'bg-gradient-to-t from-black/70 via-black/30 to-transparent',
24
+ none: '',
25
+ };
26
+ var textAlignmentClasses = {
27
+ left: 'text-left items-start',
28
+ center: 'text-center items-center',
29
+ right: 'text-right items-end',
30
+ };
31
+ var textPositionClasses = {
32
+ top: 'justify-start pt-10',
33
+ center: 'justify-center',
34
+ bottom: 'justify-end pb-10',
35
+ };
36
+ var roundedClasses = {
37
+ none: 'rounded-none',
38
+ sm: 'rounded-sm',
39
+ md: 'rounded-md',
40
+ lg: 'rounded-lg',
41
+ xl: 'rounded-xl',
42
+ full: 'rounded-full',
43
+ };
44
+ var buttonRoundedClasses = {
45
+ none: 'rounded-none',
46
+ sm: 'rounded-sm',
47
+ md: 'rounded-md',
48
+ lg: 'rounded-lg',
49
+ xl: 'rounded-xl',
50
+ full: 'rounded-full',
51
+ };
52
+ var objectFitClasses = {
53
+ cover: 'object-cover',
54
+ contain: 'object-contain',
55
+ fill: 'object-fill',
56
+ none: 'object-none',
57
+ };
58
+ var objectPositionClasses = {
59
+ center: 'object-center',
60
+ top: 'object-top',
61
+ bottom: 'object-bottom',
62
+ left: 'object-left',
63
+ right: 'object-right',
64
+ };
65
+ var animationClasses = {
66
+ slide: "transition-transform duration-".concat(animationDuration),
67
+ fade: "transition-opacity duration-".concat(animationDuration),
68
+ zoom: "transform transition-transform duration-".concat(animationDuration),
69
+ none: '',
70
+ };
71
+ var goToNext = function () {
72
+ setPrevIndex(currentIndex);
73
+ setCurrentIndex(function (prev) {
74
+ var newIndex = prev === items.length - 1 ? (infiniteLoop ? 0 : prev) : prev + 1;
75
+ onSlideChange && onSlideChange(newIndex, prev);
76
+ return newIndex;
77
+ });
78
+ };
79
+ var goToPrev = function () {
80
+ setPrevIndex(currentIndex);
81
+ setCurrentIndex(function (prev) {
82
+ var newIndex = prev === 0 ? (infiniteLoop ? items.length - 1 : prev) : prev - 1;
83
+ onSlideChange && onSlideChange(newIndex, prev);
84
+ return newIndex;
85
+ });
86
+ };
87
+ var goToSlide = function (index) {
88
+ if (index === currentIndex)
89
+ return;
90
+ setPrevIndex(currentIndex);
91
+ setCurrentIndex(index);
92
+ onSlideChange && onSlideChange(index, currentIndex);
93
+ };
94
+ // Autoplay effet
95
+ useEffect(function () {
96
+ if (!autoplay || (pauseOnHover && isHovered) || items.length <= 1)
97
+ return;
98
+ var interval = setInterval(goToNext, autoplayInterval);
99
+ return function () { return clearInterval(interval); };
100
+ }, [autoplay, autoplayInterval, isHovered, items.length, pauseOnHover]);
101
+ if (!items || items.length === 0) {
102
+ return null;
103
+ }
104
+ // Renderovanie individuálneho slide
105
+ var renderDefaultItem = function (item, index) { return (React.createElement("div", { key: item.id, className: "min-w-full h-full relative ".concat(animation === 'fade' ? (index === currentIndex ? 'opacity-100' : 'opacity-0') : '') },
106
+ React.createElement("div", { className: "absolute inset-0 w-full h-full" },
107
+ React.createElement("img", { src: item.imageSrc, alt: item.imageAlt || item.title, className: buildClassesByJoining('w-full h-full', roundedClasses[rounded], objectFitClasses[objectFit], objectPositionClasses[objectPosition], imageClassName), style: { objectFit: objectFit } }),
108
+ withOverlay && (React.createElement("div", { className: buildClassesByJoining('absolute inset-0', overlayClasses[overlayStyle], roundedClasses[rounded]), style: item.overlayOpacity ? { opacity: item.overlayOpacity } : {} }))),
109
+ item.customContent || (React.createElement("div", { className: buildClassesByJoining('relative h-full w-full flex flex-col px-6', textPositionClasses[textPosition], textAlignmentClasses[textAlignment], contentClassName) },
110
+ React.createElement("h2", { className: buildClassesByJoining('text-3xl sm:text-4xl md:text-5xl font-bold text-white mb-2', titleClassName) }, item.title),
111
+ React.createElement("p", { className: buildClassesByJoining('text-xl text-white/80 max-w-2xl', subtitleClassName) }, item.subtitle),
112
+ item.buttonText && item.buttonLink && (React.createElement("a", { href: item.buttonLink, className: buildClassesByJoining('mt-4 px-6 py-2 bg-white text-black font-medium hover:bg-opacity-90 transition-colors inline-block', buttonRoundedClasses[buttonRounded], buttonClassName) }, item.buttonText)))))); };
113
+ // Pre jeden slide použijeme zjednodušený výstup
114
+ if (items.length === 1) {
115
+ var item = items[0];
116
+ return (React.createElement("div", { className: buildClassesByJoining('relative overflow-hidden w-full', heightClasses[height], roundedClasses[rounded], className) }, renderItem ? renderItem(item, 0) : renderDefaultItem(item, 0)));
117
+ }
118
+ // Pre viac slideov vytvoríme karusel
119
+ return (React.createElement("div", { className: buildClassesByJoining('relative overflow-hidden w-full', heightClasses[height], roundedClasses[rounded], className), onMouseEnter: function () { return pauseOnHover && setIsHovered(true); }, onMouseLeave: function () { return pauseOnHover && setIsHovered(false); } },
120
+ React.createElement("div", { className: buildClassesByJoining('flex h-full', animationClasses[animation]), style: animation === 'slide'
121
+ ? { transform: "translateX(-".concat(currentIndex * 100, "%)") }
122
+ : {} }, items.map(function (item, index) {
123
+ return renderItem ? renderItem(item, index) : renderDefaultItem(item, index);
124
+ })),
125
+ showArrows &&
126
+ items.length > 1 &&
127
+ (renderControls ? (renderControls(goToNext, goToPrev)) : (React.createElement(React.Fragment, null,
128
+ React.createElement("button", { onClick: goToPrev, className: buildClassesByJoining('absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 flex items-center justify-center rounded-full bg-black/30 hover:bg-black/50 text-white transition-colors', controlsClassName), "aria-label": "P\u0159edchoz\u00ED" },
129
+ React.createElement(ChevronLeftIcon, { className: "h-6 w-6" })),
130
+ React.createElement("button", { onClick: goToNext, className: buildClassesByJoining('absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 flex items-center justify-center rounded-full bg-black/30 hover:bg-black/50 text-white transition-colors', controlsClassName), "aria-label": "Dal\u0161\u00ED" },
131
+ React.createElement(ChevronRightIcon, { className: "h-6 w-6" }))))),
132
+ showDots &&
133
+ items.length > 1 &&
134
+ (renderIndicators ? (renderIndicators(currentIndex, items.length, goToSlide)) : (React.createElement("div", { className: buildClassesByJoining('absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2', indicatorsClassName) }, items.map(function (_, index) { return (React.createElement("button", { key: index, onClick: function () { return goToSlide(index); }, className: buildClassesByJoining('w-3 h-3 rounded-full transition-colors', index === currentIndex
135
+ ? 'bg-white'
136
+ : 'bg-white/40 hover:bg-white/60'), "aria-label": "P\u0159ej\u00EDt na slide ".concat(index + 1) })); }))))));
137
+ };
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ export type BasketProduct = {
3
+ id: string;
4
+ name: string;
5
+ price: number;
6
+ quantity: number;
7
+ image?: {
8
+ src: string;
9
+ alt: string;
10
+ };
11
+ href?: string;
12
+ color?: string;
13
+ [key: string]: any;
14
+ };
15
+ export type BasketDialogVariant = 'default' | 'compact' | 'full';
16
+ export type BasketDialogPosition = 'right' | 'left';
17
+ export type BasketDialogProps = {
18
+ isOpen: boolean;
19
+ onClose: () => void;
20
+ products: BasketProduct[];
21
+ subtotal: string | number;
22
+ onQuantityChange?: (productId: string, quantity: number) => void;
23
+ onRemoveProduct?: (productId: string) => void;
24
+ onCheckout?: () => void;
25
+ onContinueShopping?: () => void;
26
+ onProductClick?: (product: BasketProduct) => void;
27
+ title?: string;
28
+ checkoutText?: string;
29
+ continueShoppingText?: string;
30
+ emptyCartText?: string;
31
+ quantityLabel?: string;
32
+ removeButtonText?: string;
33
+ totalLabel?: string;
34
+ shippingNoteText?: string;
35
+ variant?: BasketDialogVariant;
36
+ position?: BasketDialogPosition;
37
+ showProductImages?: boolean;
38
+ showProductColors?: boolean;
39
+ showProductLinks?: boolean;
40
+ showRemoveButton?: boolean;
41
+ showSubtotal?: boolean;
42
+ showCheckoutButton?: boolean;
43
+ showContinueShoppingButton?: boolean;
44
+ showShippingNote?: boolean;
45
+ showQuantityControls?: boolean;
46
+ customClassName?: string;
47
+ maxHeight?: string;
48
+ animationDuration?: number;
49
+ backdropOpacity?: number;
50
+ renderCustomProduct?: (product: BasketProduct) => React.ReactNode;
51
+ renderCustomFooter?: () => React.ReactNode;
52
+ pendingUpdates?: Record<string, number>;
53
+ processingItems?: Record<string, boolean>;
54
+ };
55
+ export declare const BasketDialog: ({ isOpen, onClose, products, subtotal, onQuantityChange, onRemoveProduct, onCheckout, onContinueShopping, onProductClick, title, checkoutText, continueShoppingText, emptyCartText, quantityLabel, removeButtonText, totalLabel, shippingNoteText, variant, position, showProductImages, showProductColors, showProductLinks, showRemoveButton, showSubtotal, showCheckoutButton, showContinueShoppingButton, showShippingNote, showQuantityControls, customClassName, maxHeight, animationDuration, backdropOpacity, renderCustomProduct, renderCustomFooter, pendingUpdates, processingItems, }: BasketDialogProps) => React.JSX.Element;
@@ -0,0 +1,167 @@
1
+ 'use client';
2
+ import { Dialog, DialogBackdrop, DialogPanel, DialogTitle } from '@headlessui/react';
3
+ import { MinusIcon, PlusIcon, XMarkIcon } from '@heroicons/react/24/outline';
4
+ import React from 'react';
5
+ // Helper funkcia pre formátovanie ceny
6
+ var formatPrice = function (price) {
7
+ return new Intl.NumberFormat('cs-CZ', {
8
+ style: 'currency',
9
+ currency: 'CZK',
10
+ }).format(price);
11
+ };
12
+ export var BasketDialog = function (_a) {
13
+ var
14
+ // Základné props
15
+ isOpen = _a.isOpen, onClose = _a.onClose, products = _a.products, subtotal = _a.subtotal,
16
+ // Callback funkcie
17
+ onQuantityChange = _a.onQuantityChange, onRemoveProduct = _a.onRemoveProduct, onCheckout = _a.onCheckout, onContinueShopping = _a.onContinueShopping, onProductClick = _a.onProductClick,
18
+ // Texty s predvolenými hodnotami
19
+ _b = _a.title,
20
+ // Texty s predvolenými hodnotami
21
+ title = _b === void 0 ? 'Váš košík' : _b, _c = _a.checkoutText, checkoutText = _c === void 0 ? 'Pokračovat k objednávce' : _c, _d = _a.continueShoppingText, continueShoppingText = _d === void 0 ? 'Pokračovat v nákupu' : _d, _e = _a.emptyCartText, emptyCartText = _e === void 0 ? 'Váš košík je prázdný' : _e, _f = _a.quantityLabel, quantityLabel = _f === void 0 ? 'Množství:' : _f, _g = _a.removeButtonText, removeButtonText = _g === void 0 ? 'Odstranit' : _g, _h = _a.totalLabel, totalLabel = _h === void 0 ? 'Celkem' : _h, _j = _a.shippingNoteText, shippingNoteText = _j === void 0 ? 'Doprava a daně budou vypočítány při dokončení objednávky.' : _j,
22
+ // Zobrazenie/konfigurácia s predvolenými hodnotami
23
+ _k = _a.variant,
24
+ // Zobrazenie/konfigurácia s predvolenými hodnotami
25
+ variant = _k === void 0 ? 'default' : _k, _l = _a.position, position = _l === void 0 ? 'right' : _l, _m = _a.showProductImages, showProductImages = _m === void 0 ? true : _m, _o = _a.showProductColors, showProductColors = _o === void 0 ? true : _o, _p = _a.showProductLinks, showProductLinks = _p === void 0 ? true : _p, _q = _a.showRemoveButton, showRemoveButton = _q === void 0 ? true : _q, _r = _a.showSubtotal, showSubtotal = _r === void 0 ? true : _r, _s = _a.showCheckoutButton, showCheckoutButton = _s === void 0 ? true : _s, _t = _a.showContinueShoppingButton, showContinueShoppingButton = _t === void 0 ? true : _t, _u = _a.showShippingNote, showShippingNote = _u === void 0 ? true : _u, _v = _a.showQuantityControls, showQuantityControls = _v === void 0 ? true : _v,
26
+ // Štýlovanie s predvolenými hodnotami
27
+ _w = _a.customClassName,
28
+ // Štýlovanie s predvolenými hodnotami
29
+ customClassName = _w === void 0 ? '' : _w, _x = _a.maxHeight, maxHeight = _x === void 0 ? '100vh' : _x, _y = _a.animationDuration, animationDuration = _y === void 0 ? 500 : _y, _z = _a.backdropOpacity, backdropOpacity = _z === void 0 ? 0.75 : _z,
30
+ // Vlastné renderovanie
31
+ renderCustomProduct = _a.renderCustomProduct, renderCustomFooter = _a.renderCustomFooter,
32
+ // Stav
33
+ _0 = _a.pendingUpdates,
34
+ // Stav
35
+ pendingUpdates = _0 === void 0 ? {} : _0, _1 = _a.processingItems, processingItems = _1 === void 0 ? {} : _1;
36
+ var handleCheckout = function () {
37
+ if (onCheckout) {
38
+ onCheckout();
39
+ }
40
+ };
41
+ var handleContinueShopping = function () {
42
+ if (onContinueShopping) {
43
+ onContinueShopping();
44
+ }
45
+ else {
46
+ onClose();
47
+ }
48
+ };
49
+ var handleIncrement = function (productId, quantity) {
50
+ if (onQuantityChange) {
51
+ onQuantityChange(productId, quantity + 1);
52
+ }
53
+ };
54
+ var handleDecrement = function (productId, quantity) {
55
+ if (onQuantityChange) {
56
+ if (quantity > 1) {
57
+ onQuantityChange(productId, quantity - 1);
58
+ }
59
+ else {
60
+ onQuantityChange(productId, 0);
61
+ }
62
+ }
63
+ };
64
+ var getVariantClasses = function () {
65
+ switch (variant) {
66
+ case 'compact':
67
+ return 'max-w-sm';
68
+ case 'full':
69
+ return 'max-w-2xl';
70
+ default:
71
+ return 'max-w-md';
72
+ }
73
+ };
74
+ var getPositionClasses = function () {
75
+ return position === 'left' ? 'left-0' : 'right-0';
76
+ };
77
+ return (React.createElement(Dialog, { open: isOpen, onClose: onClose, className: "relative z-60" },
78
+ React.createElement(DialogBackdrop, { transition: true, className: "fixed inset-0 bg-gray-500/75 transition-opacity duration-".concat(animationDuration, " ease-in-out data-closed:opacity-0"), style: { opacity: backdropOpacity } }),
79
+ React.createElement("div", { className: "fixed inset-0 overflow-hidden" },
80
+ React.createElement("div", { className: "absolute inset-0 overflow-hidden" },
81
+ React.createElement("div", { className: "pointer-events-none fixed inset-y-0 ".concat(getPositionClasses(), " flex max-w-full pl-10") },
82
+ React.createElement(DialogPanel, { transition: true, className: "pointer-events-auto w-screen ".concat(getVariantClasses(), " transform transition duration-").concat(animationDuration, " ease-in-out data-closed:translate-x-full sm:duration-700 ").concat(customClassName) },
83
+ React.createElement("div", { className: "flex h-full flex-col overflow-y-scroll bg-white shadow-xl", style: { maxHeight: maxHeight } },
84
+ React.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-6 sm:px-6" },
85
+ React.createElement("div", { className: "flex items-start justify-between" },
86
+ React.createElement(DialogTitle, { className: "text-lg font-medium text-gray-900" }, title),
87
+ React.createElement("div", { className: "ml-3 flex h-7 items-center" },
88
+ React.createElement("button", { type: "button", onClick: onClose, className: "relative -m-2 p-2 text-gray-400 hover:text-gray-500" },
89
+ React.createElement("span", { className: "absolute -inset-0.5" }),
90
+ React.createElement("span", { className: "sr-only" }, "Close panel"),
91
+ React.createElement(XMarkIcon, { "aria-hidden": "true", className: "size-6" })))),
92
+ React.createElement("div", { className: "mt-8" },
93
+ React.createElement("div", { className: "flow-root" }, products.length === 0 ? (React.createElement("div", { className: "py-6 text-center text-gray-500" }, emptyCartText)) : (React.createElement("ul", { role: "list", className: "-my-6 divide-y divide-gray-200" }, products.map(function (product) {
94
+ if (renderCustomProduct) {
95
+ return renderCustomProduct(product);
96
+ }
97
+ var displayQuantity = product.id in pendingUpdates
98
+ ? pendingUpdates[product.id]
99
+ : product.quantity;
100
+ var isProcessing = processingItems[product.id] === true;
101
+ return (React.createElement("li", { key: product.id, className: "flex py-6" },
102
+ showProductImages &&
103
+ product.image && (React.createElement("div", { className: "size-24 shrink-0 overflow-hidden rounded-md border border-gray-200" },
104
+ React.createElement("img", { alt: product.image
105
+ .alt, src: product.image
106
+ .src, className: "size-full object-cover" }))),
107
+ React.createElement("div", { className: "ml-4 flex flex-1 flex-col" },
108
+ React.createElement("div", null,
109
+ React.createElement("div", { className: "flex justify-between text-base font-medium text-gray-900" },
110
+ React.createElement("h3", null, showProductLinks &&
111
+ product.href ? (React.createElement("a", { href: product.href, onClick: function (e) {
112
+ if (onProductClick) {
113
+ e.preventDefault();
114
+ onProductClick(product);
115
+ }
116
+ } }, product.name)) : (product.name)),
117
+ React.createElement("p", { className: "ml-4" }, formatPrice(product.price))),
118
+ showProductColors &&
119
+ product.color && (React.createElement("p", { className: "mt-1 text-sm text-gray-500" }, product.color))),
120
+ React.createElement("div", { className: "flex flex-1 items-end justify-between text-sm" },
121
+ showQuantityControls &&
122
+ onQuantityChange ? (React.createElement("div", { className: "flex items-center gap-2" },
123
+ React.createElement("p", { className: "text-gray-500 mr-2" }, quantityLabel),
124
+ React.createElement("div", { className: "flex items-center" },
125
+ React.createElement("button", { type: "button", onClick: function () {
126
+ return !isProcessing &&
127
+ handleDecrement(product.id, displayQuantity);
128
+ }, disabled: isProcessing, className: "rounded-full p-1 text-gray-600 ".concat(isProcessing
129
+ ? 'bg-gray-100 cursor-not-allowed opacity-50'
130
+ : 'bg-gray-200 hover:bg-gray-300') },
131
+ React.createElement(MinusIcon, { className: "h-4 w-4" })),
132
+ React.createElement("span", { className: "mx-2 min-w-[20px] text-center text-black" }, displayQuantity),
133
+ React.createElement("button", { type: "button", onClick: function () {
134
+ return !isProcessing &&
135
+ handleIncrement(product.id, displayQuantity);
136
+ }, disabled: isProcessing, className: "rounded-full p-1 text-gray-600 ".concat(isProcessing
137
+ ? 'bg-gray-100 cursor-not-allowed opacity-50'
138
+ : 'bg-gray-200 hover:bg-gray-300') },
139
+ React.createElement(PlusIcon, { className: "h-4 w-4" }))))) : (React.createElement("p", { className: "text-gray-500" },
140
+ quantityLabel,
141
+ ' ',
142
+ displayQuantity)),
143
+ showRemoveButton &&
144
+ onRemoveProduct && (React.createElement("div", { className: "flex" },
145
+ React.createElement("button", { type: "button", className: "font-medium ".concat(isProcessing
146
+ ? 'text-gray-400 cursor-not-allowed'
147
+ : 'text-green-600 hover:text-green-500'), onClick: function () {
148
+ return !isProcessing &&
149
+ onRemoveProduct(product.id);
150
+ }, disabled: isProcessing }, removeButtonText)))))));
151
+ })))))),
152
+ React.createElement("div", { className: "border-t border-gray-200 px-4 py-6 sm:px-6" },
153
+ showSubtotal && (React.createElement("div", { className: "flex justify-between text-base font-medium text-gray-900" },
154
+ React.createElement("p", null, totalLabel),
155
+ React.createElement("p", null, typeof subtotal === 'number'
156
+ ? formatPrice(subtotal)
157
+ : subtotal))),
158
+ showShippingNote && (React.createElement("p", { className: "mt-0.5 text-sm text-gray-500" }, shippingNoteText)),
159
+ products.length > 0 && showCheckoutButton && onCheckout && (React.createElement("div", { className: "mt-6" },
160
+ React.createElement("button", { onClick: handleCheckout, className: "flex w-full items-center justify-center rounded-md border border-transparent bg-green-600 px-6 py-3 text-base font-medium text-white shadow-xs hover:bg-green-700" }, checkoutText))),
161
+ showContinueShoppingButton && (React.createElement("div", { className: "mt-6 flex justify-center text-center text-sm text-gray-500" },
162
+ React.createElement("p", null,
163
+ React.createElement("button", { type: "button", onClick: handleContinueShopping, className: "font-medium text-green-600 hover:text-green-500" },
164
+ continueShoppingText,
165
+ React.createElement("span", { "aria-hidden": "true" }, " \u2192"))))),
166
+ renderCustomFooter && renderCustomFooter()))))))));
167
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { SVGProps } from 'react';
3
+ export declare const CloseIcon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ export var CloseIcon = function (props) { return (React.createElement("svg", __assign({ width: 16, height: 16, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", className: props.className, onClick: props.onClick, onMouseDown: props.onMouseDown }, props),
14
+ React.createElement("path", { d: "M6 18L18 6M6 6l12 12", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }))); };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { SVGProps } from 'react';
3
+ export declare const InfoIcon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ export var InfoIcon = function (props) { return (React.createElement("svg", __assign({ className: "w-4 h-4 text-blue-600 ".concat(props.className || ''), fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24" }, props),
14
+ React.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor" }),
15
+ React.createElement("path", { d: "M12 8v4m0 4h.01", stroke: "currentColor" }))); };
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ interface LabelProps {
3
+ text?: string;
4
+ i18nKey?: string;
5
+ isRequired?: boolean;
6
+ htmlFor?: string;
7
+ subtitle?: string;
8
+ srOnly?: boolean;
9
+ className?: string;
10
+ }
11
+ declare const Label: ({ text, i18nKey, isRequired, htmlFor, subtitle, srOnly, className, }: LabelProps) => React.JSX.Element | null;
12
+ export default Label;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ var Label = function (_a) {
3
+ var text = _a.text, i18nKey = _a.i18nKey, isRequired = _a.isRequired, htmlFor = _a.htmlFor, subtitle = _a.subtitle, srOnly = _a.srOnly, _b = _a.className, className = _b === void 0 ? '' : _b;
4
+ if (!text && !i18nKey)
5
+ return null;
6
+ return (React.createElement("label", { htmlFor: htmlFor, className: "text-sm font-medium text-gray-700 flex flex-col ".concat(srOnly ? 'sr-only' : '', " ").concat(className) },
7
+ React.createElement("span", null, text || i18nKey),
8
+ isRequired && React.createElement("span", { className: "ml-1 text-red-500" }, "*"),
9
+ subtitle && React.createElement("span", { className: "text-xs text-gray-500" }, subtitle)));
10
+ };
11
+ export default Label;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export type NavItem = {
3
+ name: string;
4
+ href: string;
5
+ };
6
+ export type NavBarProps = {
7
+ items?: NavItem[];
8
+ logo?: React.ReactNode;
9
+ rightContent?: React.ReactNode;
10
+ backgroundColor?: string;
11
+ textColor?: string;
12
+ activeColor?: string;
13
+ mobileMenuBgColor?: string;
14
+ containerClassName?: string;
15
+ navClassName?: string;
16
+ itemClassName?: string;
17
+ mobileItemClassName?: string;
18
+ };
19
+ export declare const NavBar: ({ items, logo, rightContent, backgroundColor, textColor, activeColor, mobileMenuBgColor, containerClassName, navClassName, itemClassName, mobileItemClassName, }: NavBarProps) => React.JSX.Element;
@@ -0,0 +1,36 @@
1
+ 'use client';
2
+ import { Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline';
3
+ import React, { useState } from 'react';
4
+ import buildClassesByJoining from '../../utils/StyleHelper';
5
+ export var NavBar = function (_a) {
6
+ var
7
+ // Structure
8
+ _b = _a.items,
9
+ // Structure
10
+ items = _b === void 0 ? [] : _b,
11
+ // Logo
12
+ _c = _a.logo,
13
+ // Logo
14
+ logo = _c === void 0 ? React.createElement("div", { className: "h-8 w-8 bg-indigo-600 rounded-md" }) : _c,
15
+ // Right side elements
16
+ rightContent = _a.rightContent,
17
+ // Styling
18
+ _d = _a.backgroundColor,
19
+ // Styling
20
+ backgroundColor = _d === void 0 ? 'bg-white' : _d, _e = _a.textColor, textColor = _e === void 0 ? 'text-gray-600' : _e, _f = _a.activeColor, activeColor = _f === void 0 ? 'text-indigo-600' : _f, _g = _a.mobileMenuBgColor, mobileMenuBgColor = _g === void 0 ? 'bg-white' : _g, _h = _a.containerClassName, containerClassName = _h === void 0 ? '' : _h, _j = _a.navClassName, navClassName = _j === void 0 ? '' : _j, _k = _a.itemClassName, itemClassName = _k === void 0 ? '' : _k, _l = _a.mobileItemClassName, mobileItemClassName = _l === void 0 ? '' : _l;
21
+ var _m = useState(false), mobileMenuOpen = _m[0], setMobileMenuOpen = _m[1];
22
+ return (React.createElement("header", { className: buildClassesByJoining(backgroundColor, containerClassName) },
23
+ React.createElement("nav", { className: buildClassesByJoining('mx-auto max-w-7xl px-4 sm:px-6 lg:px-8', navClassName) },
24
+ React.createElement("div", { className: "flex h-16 items-center justify-between" },
25
+ React.createElement("div", { className: "flex-shrink-0" }, logo),
26
+ React.createElement("div", { className: "flex md:hidden" },
27
+ React.createElement("button", { type: "button", className: buildClassesByJoining('inline-flex items-center justify-center rounded-md p-2', textColor, "hover:".concat(activeColor, " hover:bg-gray-100")), onClick: function () { return setMobileMenuOpen(!mobileMenuOpen); } },
28
+ React.createElement("span", { className: "sr-only" }, "Open main menu"),
29
+ mobileMenuOpen ? (React.createElement(XMarkIcon, { className: "block h-6 w-6", "aria-hidden": "true" })) : (React.createElement(Bars3Icon, { className: "block h-6 w-6", "aria-hidden": "true" })))),
30
+ React.createElement("div", { className: "hidden md:flex md:flex-1 md:items-center md:justify-center md:space-x-8" }, items.map(function (item) { return (React.createElement("a", { key: item.name, href: item.href, className: buildClassesByJoining('text-sm font-medium', textColor, "hover:".concat(activeColor), itemClassName) }, item.name)); })),
31
+ rightContent && (React.createElement("div", { className: "hidden md:flex md:items-center" }, rightContent)))),
32
+ mobileMenuOpen && (React.createElement("div", { className: buildClassesByJoining('md:hidden', mobileMenuBgColor) },
33
+ React.createElement("div", { className: "space-y-1 px-2 pb-3 pt-2" }, items.map(function (item) { return (React.createElement("a", { key: item.name, href: item.href, className: buildClassesByJoining('block rounded-md px-3 py-2 text-base font-medium', textColor, "hover:".concat(activeColor, " hover:bg-gray-100"), mobileItemClassName) }, item.name)); })),
34
+ rightContent && (React.createElement("div", { className: "border-t border-gray-200 pb-3 pt-4" },
35
+ React.createElement("div", { className: "flex items-center px-5" }, rightContent)))))));
36
+ };
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ export type Product = {
3
+ id: string;
4
+ imageSrc: string;
5
+ imageAlt: string;
6
+ href: string;
7
+ name: string;
8
+ color?: string;
9
+ price: string;
10
+ description?: string;
11
+ badges?: Array<{
12
+ text: string;
13
+ color: string;
14
+ }>;
15
+ };
16
+ export type QuantityControlProps = {
17
+ quantity: number;
18
+ onIncrement: (e: React.MouseEvent) => void;
19
+ onDecrement: (e: React.MouseEvent) => void;
20
+ minQuantity?: number;
21
+ maxQuantity?: number;
22
+ controlsClassName?: string;
23
+ buttonClassName?: string;
24
+ quantityClassName?: string;
25
+ };
26
+ export type ProductCardProps = {
27
+ product: Product;
28
+ className?: string;
29
+ imageClassName?: string;
30
+ contentClassName?: string;
31
+ titleClassName?: string;
32
+ colorClassName?: string;
33
+ priceClassName?: string;
34
+ descriptionClassName?: string;
35
+ badgeClassName?: string;
36
+ aspectRatio?: 'square' | 'auto' | 'video' | 'wide';
37
+ imagePosition?: 'top' | 'bottom' | 'center';
38
+ imageObjectFit?: 'cover' | 'contain' | 'fill' | 'none';
39
+ layout?: 'default' | 'compact' | 'horizontal';
40
+ hoverEffect?: 'opacity' | 'scale' | 'shadow' | 'border' | 'none';
41
+ renderBadges?: boolean;
42
+ renderColor?: boolean;
43
+ renderDescription?: boolean;
44
+ elevationLevel?: 0 | 1 | 2 | 3;
45
+ rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';
46
+ titleLines?: 1 | 2 | 3;
47
+ onCardClick?: (product: Product) => void;
48
+ onImageClick?: (product: Product) => void;
49
+ renderFooter?: (product: Product) => React.ReactNode;
50
+ renderHeader?: (product: Product) => React.ReactNode;
51
+ actionButton?: React.ReactNode;
52
+ showAddButton?: boolean;
53
+ initialQuantity?: number;
54
+ onQuantityChange?: (product: Product, quantity: number) => void;
55
+ addButtonIcon?: React.ReactNode;
56
+ maxQuantity?: number;
57
+ quantityControlProps?: Partial<QuantityControlProps>;
58
+ customAddButton?: React.ReactNode;
59
+ customQuantityControl?: React.ReactNode;
60
+ };
61
+ export declare const ProductCard: ({ product, className, imageClassName, contentClassName, titleClassName, colorClassName, priceClassName, descriptionClassName, badgeClassName, aspectRatio, imagePosition, imageObjectFit, layout, hoverEffect, renderBadges, renderColor, renderDescription, elevationLevel, rounded, titleLines, onCardClick, onImageClick, renderFooter, renderHeader, actionButton, showAddButton, initialQuantity, onQuantityChange, addButtonIcon, maxQuantity, quantityControlProps, customAddButton, customQuantityControl, }: ProductCardProps) => React.JSX.Element;