@q2devel/q2-storybook 1.0.21 → 1.0.22

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 (81) hide show
  1. package/dist/components/badge/Badge.js +0 -1
  2. package/dist/components/{Heading1 → head}/Heading1.js +2 -3
  3. package/dist/index.d.ts +2 -12
  4. package/dist/index.js +3 -12
  5. package/package.json +3 -12
  6. package/dist/auth/Auth.types.d.ts +0 -32
  7. package/dist/auth/Auth.types.js +0 -1
  8. package/dist/auth/components/AuthenticatedFactory.d.ts +0 -8
  9. package/dist/auth/components/AuthenticatedFactory.js +0 -21
  10. package/dist/auth/components/AuthenticatedFactory.types.d.ts +0 -4
  11. package/dist/auth/components/AuthenticatedFactory.types.js +0 -1
  12. package/dist/auth/config/Config.d.ts +0 -3
  13. package/dist/auth/config/Config.js +0 -19
  14. package/dist/auth/config/config.types.d.ts +0 -27
  15. package/dist/auth/config/config.types.js +0 -1
  16. package/dist/auth/context/AuthContextFactory.d.ts +0 -4
  17. package/dist/auth/context/AuthContextFactory.js +0 -19
  18. package/dist/auth/hooks/useCurrentUserHookFactory.d.ts +0 -12
  19. package/dist/auth/hooks/useCurrentUserHookFactory.js +0 -18
  20. package/dist/auth/hooks/useCurrentUserUpdateHookFactory.d.ts +0 -9
  21. package/dist/auth/hooks/useCurrentUserUpdateHookFactory.js +0 -73
  22. package/dist/auth/hooks/useCurrentUserUpdatePasswordHookFactory.d.ts +0 -7
  23. package/dist/auth/hooks/useCurrentUserUpdatePasswordHookFactory.js +0 -76
  24. package/dist/auth/hooks/useForgotPasswordHookFactory.d.ts +0 -7
  25. package/dist/auth/hooks/useForgotPasswordHookFactory.js +0 -70
  26. package/dist/auth/hooks/useResetPasswordHookFactory.d.ts +0 -7
  27. package/dist/auth/hooks/useResetPasswordHookFactory.js +0 -74
  28. package/dist/auth/hooks/useSignInHookFactory.d.ts +0 -7
  29. package/dist/auth/hooks/useSignInHookFactory.js +0 -74
  30. package/dist/auth/hooks/useSignOutHookFactory.d.ts +0 -6
  31. package/dist/auth/hooks/useSignOutHookFactory.js +0 -74
  32. package/dist/auth/hooks/useSignUpHookFactory.d.ts +0 -7
  33. package/dist/auth/hooks/useSignUpHookFactory.js +0 -74
  34. package/dist/auth/index.d.ts +0 -53
  35. package/dist/auth/index.js +0 -30
  36. package/dist/auth/provider/AuthContextProviderFactory.d.ts +0 -7
  37. package/dist/auth/provider/AuthContextProviderFactory.js +0 -55
  38. package/dist/auth/service/AuthService.d.ts +0 -15
  39. package/dist/auth/service/AuthService.js +0 -206
  40. package/dist/auth/service/AuthService.types.d.ts +0 -26
  41. package/dist/auth/service/AuthService.types.js +0 -1
  42. package/dist/auth/service/index.d.ts +0 -2
  43. package/dist/auth/service/index.js +0 -3
  44. package/dist/auth/types/index.d.ts +0 -14
  45. package/dist/auth/types/index.js +0 -1
  46. package/dist/auth/utils/Helper.d.ts +0 -1
  47. package/dist/auth/utils/Helper.js +0 -25
  48. package/dist/auth/utils/Storage.d.ts +0 -6
  49. package/dist/auth/utils/Storage.js +0 -57
  50. package/dist/components/banner/Banner.d.ts +0 -48
  51. package/dist/components/banner/Banner.js +0 -137
  52. package/dist/components/basket-dialog/BasketDialog.d.ts +0 -55
  53. package/dist/components/basket-dialog/BasketDialog.js +0 -167
  54. package/dist/components/icon/CloseIcon.d.ts +0 -3
  55. package/dist/components/icon/CloseIcon.js +0 -14
  56. package/dist/components/icon/InfoIcon.d.ts +0 -3
  57. package/dist/components/icon/InfoIcon.js +0 -15
  58. package/dist/components/label/Label.d.ts +0 -12
  59. package/dist/components/label/Label.js +0 -11
  60. package/dist/components/nav-bar/NavBar.d.ts +0 -19
  61. package/dist/components/nav-bar/NavBar.js +0 -36
  62. package/dist/components/product-card/ProductCard.d.ts +0 -61
  63. package/dist/components/product-card/ProductCard.js +0 -148
  64. package/dist/components/select-field/SelectField.d.ts +0 -27
  65. package/dist/components/select-field/SelectField.js +0 -132
  66. package/dist/components/select-field/SelectFieldOption.d.ts +0 -5
  67. package/dist/components/select-field/SelectFieldOption.js +0 -31
  68. package/dist/components/text-field/TextField.d.ts +0 -21
  69. package/dist/components/text-field/TextField.js +0 -87
  70. package/dist/components/text-field/TextField.types.d.ts +0 -22
  71. package/dist/components/text-field/TextField.types.js +0 -1
  72. package/dist/components/tooltip/Tooltip.d.ts +0 -18
  73. package/dist/components/tooltip/Tooltip.js +0 -18
  74. package/dist/global.css +0 -1
  75. package/dist/utils/Helper.d.ts +0 -0
  76. package/dist/utils/Helper.js +0 -1
  77. package/dist/utils/StyleHelper.d.ts +0 -4
  78. package/dist/utils/StyleHelper.js +0 -12
  79. package/dist/utils/StylingHelper.d.ts +0 -4
  80. package/dist/utils/StylingHelper.js +0 -12
  81. /package/dist/components/{Heading1 → head}/Heading1.d.ts +0 -0
@@ -1,2 +0,0 @@
1
- export * from './AuthService.types';
2
- export * from './AuthService';
@@ -1,3 +0,0 @@
1
- // src/service/index.ts
2
- export * from './AuthService.types';
3
- export * from './AuthService';
@@ -1,14 +0,0 @@
1
- export type DeepNonRequired<T> = {
2
- [K in keyof T]?: DeepNonRequired<T[K]>;
3
- };
4
- export type TokenStorageProvider = {
5
- get: (key: string) => AccessToken | undefined;
6
- set: (key: string, accessToken?: AccessToken) => void;
7
- };
8
- export type AccessToken = {
9
- plainTextToken: string;
10
- expiresAt?: string;
11
- };
12
- export type MakeUserWithAccessToken<UserType> = UserType & {
13
- token: AccessToken;
14
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const removeKeysFromObject: <T extends object>(object: T) => <K extends keyof T>(...parts: K[]) => Omit<T, K>;
@@ -1,25 +0,0 @@
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
- // src/utils/Helper.tsx
13
- export var removeKeysFromObject = function (object) {
14
- return function () {
15
- var parts = [];
16
- for (var _i = 0; _i < arguments.length; _i++) {
17
- parts[_i] = arguments[_i];
18
- }
19
- var newObject = __assign({}, object);
20
- parts.forEach(function (part) {
21
- delete newObject[part];
22
- });
23
- return newObject;
24
- };
25
- };
@@ -1,6 +0,0 @@
1
- import { TokenStorageProvider } from '../types';
2
- import { TokenStorageType } from '../config/config.types';
3
- export declare const getLocalStorageProvider: () => TokenStorageProvider;
4
- export declare const getCookieStorageProvider: () => TokenStorageProvider;
5
- declare const Storage: Partial<Record<TokenStorageType, TokenStorageProvider>>;
6
- export default Storage;
@@ -1,57 +0,0 @@
1
- export var getLocalStorageProvider = function () {
2
- return {
3
- get: function (key) {
4
- var storedValue = localStorage.getItem(key);
5
- if (!storedValue)
6
- return undefined;
7
- try {
8
- return JSON.parse(storedValue);
9
- }
10
- catch (e) {
11
- return undefined;
12
- }
13
- },
14
- set: function (key, accessToken) {
15
- if (!accessToken) {
16
- localStorage.removeItem(key);
17
- return;
18
- }
19
- localStorage.setItem(key, JSON.stringify(accessToken));
20
- },
21
- };
22
- };
23
- export var getCookieStorageProvider = function () {
24
- return {
25
- get: function (key) {
26
- var _a;
27
- var cookieValue = (_a = document.cookie
28
- .split('; ')
29
- .find(function (row) { return row.startsWith("".concat(key, "=")); })) === null || _a === void 0 ? void 0 : _a.split('=')[1];
30
- if (!cookieValue)
31
- return undefined;
32
- try {
33
- return JSON.parse(decodeURIComponent(cookieValue));
34
- }
35
- catch (e) {
36
- return undefined;
37
- }
38
- },
39
- set: function (key, accessToken) {
40
- if (!accessToken) {
41
- document.cookie = "".concat(key, "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");
42
- return;
43
- }
44
- var value = encodeURIComponent(JSON.stringify(accessToken));
45
- document.cookie = "".concat(key, "=").concat(value, "; path=/;");
46
- },
47
- };
48
- };
49
- var Storage = {
50
- localStorage: getLocalStorageProvider(),
51
- cookie: getCookieStorageProvider(),
52
- memory: {
53
- get: function () { return undefined; },
54
- set: function () { },
55
- },
56
- };
57
- export default Storage;
@@ -1,48 +0,0 @@
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;
@@ -1,137 +0,0 @@
1
- 'use client';
2
- import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline';
3
- import React, { useEffect, useState } from 'react';
4
- import buildClassesByJoining from '../../utils/StylingHelper';
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
- };
@@ -1,55 +0,0 @@
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;
@@ -1,167 +0,0 @@
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
- };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { SVGProps } from 'react';
3
- export declare const CloseIcon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -1,14 +0,0 @@
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" }))); };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { SVGProps } from 'react';
3
- export declare const InfoIcon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -1,15 +0,0 @@
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" }))); };
@@ -1,12 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,19 +0,0 @@
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;