@qite/tide-booking-component 1.4.64 → 1.4.66
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/build/build-cjs/index.js +223 -0
- package/build/build-cjs/src/content/components/breadcrumb.d.ts +3 -5
- package/build/build-cjs/src/content/components/gallery.d.ts +5 -4
- package/build/build-cjs/src/index.d.ts +17 -1
- package/build/build-esm/index.js +232 -1
- package/build/build-esm/src/content/components/breadcrumb.d.ts +3 -5
- package/build/build-esm/src/content/components/gallery.d.ts +5 -4
- package/build/build-esm/src/index.d.ts +17 -1
- package/package.json +1 -1
- package/src/content/components/breadcrumb.tsx +11 -16
- package/src/content/components/gallery.tsx +80 -72
- package/src/index.ts +17 -1
package/build/build-cjs/index.js
CHANGED
|
@@ -45001,6 +45001,227 @@ var ImageWithTextSection = function (_a) {
|
|
|
45001
45001
|
);
|
|
45002
45002
|
};
|
|
45003
45003
|
|
|
45004
|
+
var PhotoGallery = function (_a) {
|
|
45005
|
+
var _b, _c, _d;
|
|
45006
|
+
var images = _a.images,
|
|
45007
|
+
title = _a.title,
|
|
45008
|
+
intro = _a.intro;
|
|
45009
|
+
var _e = React.useState(null),
|
|
45010
|
+
activeIndex = _e[0],
|
|
45011
|
+
setActiveIndex = _e[1];
|
|
45012
|
+
var isOpen = activeIndex !== null;
|
|
45013
|
+
var activeImage = activeIndex !== null ? images[activeIndex] : null;
|
|
45014
|
+
var close = function () {
|
|
45015
|
+
return setActiveIndex(null);
|
|
45016
|
+
};
|
|
45017
|
+
var next = function () {
|
|
45018
|
+
if (activeIndex === null) return;
|
|
45019
|
+
setActiveIndex((activeIndex + 1) % images.length);
|
|
45020
|
+
};
|
|
45021
|
+
var prev = function () {
|
|
45022
|
+
if (activeIndex === null) return;
|
|
45023
|
+
setActiveIndex((activeIndex - 1 + images.length) % images.length);
|
|
45024
|
+
};
|
|
45025
|
+
React.useEffect(
|
|
45026
|
+
function () {
|
|
45027
|
+
if (!isOpen) return;
|
|
45028
|
+
var onKeyDown = function (e) {
|
|
45029
|
+
if (e.key === 'Escape') close();
|
|
45030
|
+
if (e.key === 'ArrowRight') next();
|
|
45031
|
+
if (e.key === 'ArrowLeft') prev();
|
|
45032
|
+
};
|
|
45033
|
+
document.addEventListener('keydown', onKeyDown);
|
|
45034
|
+
document.body.style.overflow = 'hidden';
|
|
45035
|
+
return function () {
|
|
45036
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
45037
|
+
document.body.style.overflow = '';
|
|
45038
|
+
};
|
|
45039
|
+
},
|
|
45040
|
+
[isOpen, activeIndex, images.length]
|
|
45041
|
+
);
|
|
45042
|
+
if (!images.length) {
|
|
45043
|
+
return React__default['default'].createElement(
|
|
45044
|
+
'section',
|
|
45045
|
+
{ className: 'gallery' },
|
|
45046
|
+
React__default['default'].createElement('p', { className: 'gallery__empty' }, 'No photos available.')
|
|
45047
|
+
);
|
|
45048
|
+
}
|
|
45049
|
+
var big = images[0];
|
|
45050
|
+
var thumbs = images.slice(1, 6);
|
|
45051
|
+
var extraCount = Math.max(0, images.length - 6);
|
|
45052
|
+
var openAt = function (index) {
|
|
45053
|
+
if (!images[index]) return;
|
|
45054
|
+
setActiveIndex(index);
|
|
45055
|
+
};
|
|
45056
|
+
return React__default['default'].createElement(
|
|
45057
|
+
'div',
|
|
45058
|
+
{ className: 'content' },
|
|
45059
|
+
React__default['default'].createElement(
|
|
45060
|
+
'div',
|
|
45061
|
+
{ className: 'content__container' },
|
|
45062
|
+
React__default['default'].createElement(
|
|
45063
|
+
'div',
|
|
45064
|
+
{ className: 'content__colums content__colums--2-1' },
|
|
45065
|
+
React__default['default'].createElement(
|
|
45066
|
+
'section',
|
|
45067
|
+
{ className: 'gallery' },
|
|
45068
|
+
React__default['default'].createElement(
|
|
45069
|
+
'div',
|
|
45070
|
+
{ className: 'gallery__layout' },
|
|
45071
|
+
React__default['default'].createElement(
|
|
45072
|
+
'button',
|
|
45073
|
+
{
|
|
45074
|
+
type: 'button',
|
|
45075
|
+
className: 'gallery__big',
|
|
45076
|
+
onClick: function () {
|
|
45077
|
+
return openAt(0);
|
|
45078
|
+
},
|
|
45079
|
+
'aria-label': 'Open image 1'
|
|
45080
|
+
},
|
|
45081
|
+
React__default['default'].createElement('img', {
|
|
45082
|
+
className: 'gallery__big__img',
|
|
45083
|
+
src: big.src,
|
|
45084
|
+
alt: (_b = big.alt) !== null && _b !== void 0 ? _b : '',
|
|
45085
|
+
loading: 'eager'
|
|
45086
|
+
})
|
|
45087
|
+
),
|
|
45088
|
+
React__default['default'].createElement(
|
|
45089
|
+
'div',
|
|
45090
|
+
{ className: 'gallery__thumbs', 'aria-label': 'Gallery thumbnails' },
|
|
45091
|
+
thumbs.map(function (img, i) {
|
|
45092
|
+
var _a;
|
|
45093
|
+
var realIndex = i + 1;
|
|
45094
|
+
var isLastThumbSlot = i === 4;
|
|
45095
|
+
var shouldShowMoreOverlay = isLastThumbSlot && extraCount > 0;
|
|
45096
|
+
return React__default['default'].createElement(
|
|
45097
|
+
'button',
|
|
45098
|
+
{
|
|
45099
|
+
key: ''.concat(img.src, '-').concat(realIndex),
|
|
45100
|
+
type: 'button',
|
|
45101
|
+
className: 'gallery__thumb '.concat(shouldShowMoreOverlay ? 'gallery__thumb--more' : ''),
|
|
45102
|
+
onClick: function () {
|
|
45103
|
+
return openAt(realIndex);
|
|
45104
|
+
},
|
|
45105
|
+
'aria-label': 'Open image '.concat(realIndex + 1)
|
|
45106
|
+
},
|
|
45107
|
+
React__default['default'].createElement('img', {
|
|
45108
|
+
className: 'gallery__thumb__img',
|
|
45109
|
+
src: img.src,
|
|
45110
|
+
alt: (_a = img.alt) !== null && _a !== void 0 ? _a : '',
|
|
45111
|
+
loading: 'lazy'
|
|
45112
|
+
}),
|
|
45113
|
+
shouldShowMoreOverlay &&
|
|
45114
|
+
React__default['default'].createElement(
|
|
45115
|
+
'span',
|
|
45116
|
+
{ className: 'gallery__thumb__overlay', 'aria-label': ''.concat(extraCount, ' more photos') },
|
|
45117
|
+
'+',
|
|
45118
|
+
extraCount
|
|
45119
|
+
)
|
|
45120
|
+
);
|
|
45121
|
+
})
|
|
45122
|
+
)
|
|
45123
|
+
),
|
|
45124
|
+
isOpen &&
|
|
45125
|
+
activeImage &&
|
|
45126
|
+
React__default['default'].createElement(
|
|
45127
|
+
'div',
|
|
45128
|
+
{
|
|
45129
|
+
className: 'gallery__lightbox',
|
|
45130
|
+
role: 'dialog',
|
|
45131
|
+
'aria-modal': 'true',
|
|
45132
|
+
onMouseDown: function (e) {
|
|
45133
|
+
if (e.target === e.currentTarget) close();
|
|
45134
|
+
}
|
|
45135
|
+
},
|
|
45136
|
+
React__default['default'].createElement(
|
|
45137
|
+
'div',
|
|
45138
|
+
{ className: 'gallery__lightbox__panel' },
|
|
45139
|
+
React__default['default'].createElement(
|
|
45140
|
+
'button',
|
|
45141
|
+
{ type: 'button', className: 'gallery__btn__icon gallery__btn__icon--close', 'aria-label': 'Close', onClick: close },
|
|
45142
|
+
React__default['default'].createElement(Icon$3, { name: 'ui-close', width: 16, height: 16 })
|
|
45143
|
+
),
|
|
45144
|
+
React__default['default'].createElement(
|
|
45145
|
+
'div',
|
|
45146
|
+
{ className: 'gallery__lightbox__media' },
|
|
45147
|
+
React__default['default'].createElement('img', {
|
|
45148
|
+
className: 'gallery__lightbox__img',
|
|
45149
|
+
src: activeImage.src,
|
|
45150
|
+
alt: (_c = activeImage.alt) !== null && _c !== void 0 ? _c : ''
|
|
45151
|
+
})
|
|
45152
|
+
),
|
|
45153
|
+
React__default['default'].createElement(
|
|
45154
|
+
'div',
|
|
45155
|
+
{ className: 'gallery__lightbox__footer' },
|
|
45156
|
+
React__default['default'].createElement(
|
|
45157
|
+
'div',
|
|
45158
|
+
{ className: 'gallery__lightbox__info' },
|
|
45159
|
+
React__default['default'].createElement('span', { className: 'gallery__lightbox__index' }, activeIndex + 1, ' / ', images.length),
|
|
45160
|
+
(activeImage.caption || activeImage.alt) &&
|
|
45161
|
+
React__default['default'].createElement(
|
|
45162
|
+
'span',
|
|
45163
|
+
{ className: 'gallery__lightbox__caption' },
|
|
45164
|
+
(_d = activeImage.caption) !== null && _d !== void 0 ? _d : activeImage.alt
|
|
45165
|
+
)
|
|
45166
|
+
),
|
|
45167
|
+
React__default['default'].createElement(
|
|
45168
|
+
'div',
|
|
45169
|
+
{ className: 'gallery__lightbox__controls' },
|
|
45170
|
+
React__default['default'].createElement('button', { type: 'button', className: 'gallery__btn', onClick: prev }, '\u2190'),
|
|
45171
|
+
React__default['default'].createElement('button', { type: 'button', className: 'gallery__btn', onClick: next }, '\u2192')
|
|
45172
|
+
)
|
|
45173
|
+
)
|
|
45174
|
+
)
|
|
45175
|
+
)
|
|
45176
|
+
),
|
|
45177
|
+
React__default['default'].createElement(
|
|
45178
|
+
'div',
|
|
45179
|
+
null,
|
|
45180
|
+
React__default['default'].createElement('h2', null, title),
|
|
45181
|
+
React__default['default'].createElement('p', null, intro)
|
|
45182
|
+
)
|
|
45183
|
+
)
|
|
45184
|
+
)
|
|
45185
|
+
);
|
|
45186
|
+
};
|
|
45187
|
+
|
|
45188
|
+
var Breadcrumbs = function (_a) {
|
|
45189
|
+
var items = _a.items,
|
|
45190
|
+
_b = _a.noHeader,
|
|
45191
|
+
noHeader = _b === void 0 ? false : _b;
|
|
45192
|
+
var lastIndex = items.length - 1;
|
|
45193
|
+
return React__default['default'].createElement(
|
|
45194
|
+
'nav',
|
|
45195
|
+
{ className: 'breadcrumb'.concat(noHeader ? ' breadcrumb--no-header' : ''), 'aria-label': 'Breadcrumb' },
|
|
45196
|
+
React__default['default'].createElement(
|
|
45197
|
+
'div',
|
|
45198
|
+
{ className: 'breadcrumb__container' },
|
|
45199
|
+
React__default['default'].createElement(
|
|
45200
|
+
'ol',
|
|
45201
|
+
{ className: 'breadcrumb__list' },
|
|
45202
|
+
items.map(function (item, idx) {
|
|
45203
|
+
var _a;
|
|
45204
|
+
var isCurrent = (_a = item.isCurrent) !== null && _a !== void 0 ? _a : idx === lastIndex;
|
|
45205
|
+
var content = React__default['default'].createElement(
|
|
45206
|
+
'span',
|
|
45207
|
+
{ className: 'breadcrumb__content' },
|
|
45208
|
+
item.icon && React__default['default'].createElement('span', { className: 'breadcrumb__icon', 'aria-hidden': 'true' }, item.icon),
|
|
45209
|
+
item.label && React__default['default'].createElement('span', { className: 'breadcrumb__label', title: item.label }, item.label)
|
|
45210
|
+
);
|
|
45211
|
+
return React__default['default'].createElement(
|
|
45212
|
+
'li',
|
|
45213
|
+
{ key: idx, className: 'breadcrumb__item' },
|
|
45214
|
+
idx > 0 && React__default['default'].createElement('span', { className: 'breadcrumb__separator', 'aria-hidden': 'true' }, '/'),
|
|
45215
|
+
isCurrent || !item.href
|
|
45216
|
+
? React__default['default'].createElement('span', { className: 'breadcrumb__current', 'aria-current': isCurrent ? 'page' : undefined }, content)
|
|
45217
|
+
: React__default['default'].createElement('a', { className: 'breadcrumb__link', href: item.href, onClick: item.onClick }, content)
|
|
45218
|
+
);
|
|
45219
|
+
})
|
|
45220
|
+
)
|
|
45221
|
+
)
|
|
45222
|
+
);
|
|
45223
|
+
};
|
|
45224
|
+
|
|
45004
45225
|
var signalR$1 = {};
|
|
45005
45226
|
|
|
45006
45227
|
var jqueryDeferred$1 = { exports: {} };
|
|
@@ -48897,12 +49118,14 @@ var signalR = /*#__PURE__*/ _mergeNamespaces(
|
|
|
48897
49118
|
|
|
48898
49119
|
exports.BookingProduct = BookingProduct;
|
|
48899
49120
|
exports.BookingWizard = BookingWizard;
|
|
49121
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
48900
49122
|
exports.Footer = Footer;
|
|
48901
49123
|
exports.Header = Header;
|
|
48902
49124
|
exports.ImageCardGrid = ImageCardGrid;
|
|
48903
49125
|
exports.ImageWithTextSection = ImageWithTextSection;
|
|
48904
49126
|
exports.Login = Login;
|
|
48905
49127
|
exports.Navbar = Navbar;
|
|
49128
|
+
exports.PhotoGallery = PhotoGallery;
|
|
48906
49129
|
exports.QSM = QSM;
|
|
48907
49130
|
exports.SearchResults = SearchResults;
|
|
48908
49131
|
exports.Slider = Slider;
|
|
@@ -6,11 +6,9 @@ export type BreadcrumbItem = {
|
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
isCurrent?: boolean;
|
|
8
8
|
};
|
|
9
|
-
type BreadcrumbsProps = {
|
|
9
|
+
export type BreadcrumbsProps = {
|
|
10
10
|
items: BreadcrumbItem[];
|
|
11
|
-
separator?: React.ReactNode;
|
|
12
|
-
ariaLabel?: string;
|
|
13
11
|
noHeader?: boolean;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
|
-
export
|
|
13
|
+
declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
14
|
+
export default Breadcrumbs;
|
|
@@ -4,9 +4,10 @@ export interface GalleryImage {
|
|
|
4
4
|
alt?: string;
|
|
5
5
|
caption?: string;
|
|
6
6
|
}
|
|
7
|
-
interface GalleryProps {
|
|
8
|
-
images: GalleryImage[];
|
|
7
|
+
export interface GalleryProps {
|
|
9
8
|
title?: string;
|
|
9
|
+
intro?: string;
|
|
10
|
+
images: GalleryImage[];
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
export
|
|
12
|
+
declare const PhotoGallery: React.FC<GalleryProps>;
|
|
13
|
+
export default PhotoGallery;
|
|
@@ -9,6 +9,8 @@ import ImageCardGrid from './content/image-card-grid';
|
|
|
9
9
|
import Login from './content/login';
|
|
10
10
|
import ImageWithTextSection from './content/image-with-text-section';
|
|
11
11
|
import Slider from './content/components/slider';
|
|
12
|
+
import PhotoGallery from './content/components/gallery';
|
|
13
|
+
import Breadcrumbs from './content/components/breadcrumb';
|
|
12
14
|
export * from './content/navbar/types';
|
|
13
15
|
export * from './content/header/types';
|
|
14
16
|
export * from './content/footer/types';
|
|
@@ -18,4 +20,18 @@ export * from './content/image-with-text-section/types';
|
|
|
18
20
|
export * from './search-results/types';
|
|
19
21
|
export * from './qsm/types';
|
|
20
22
|
export * from './shared/types';
|
|
21
|
-
export {
|
|
23
|
+
export {
|
|
24
|
+
BookingProduct,
|
|
25
|
+
BookingWizard,
|
|
26
|
+
QSM,
|
|
27
|
+
SearchResults,
|
|
28
|
+
Navbar,
|
|
29
|
+
Header,
|
|
30
|
+
Footer,
|
|
31
|
+
ImageCardGrid,
|
|
32
|
+
Login,
|
|
33
|
+
ImageWithTextSection,
|
|
34
|
+
Slider,
|
|
35
|
+
PhotoGallery,
|
|
36
|
+
Breadcrumbs
|
|
37
|
+
};
|
package/build/build-esm/index.js
CHANGED
|
@@ -44709,6 +44709,222 @@ var ImageWithTextSection = function (_a) {
|
|
|
44709
44709
|
);
|
|
44710
44710
|
};
|
|
44711
44711
|
|
|
44712
|
+
var PhotoGallery = function (_a) {
|
|
44713
|
+
var _b, _c, _d;
|
|
44714
|
+
var images = _a.images,
|
|
44715
|
+
title = _a.title,
|
|
44716
|
+
intro = _a.intro;
|
|
44717
|
+
var _e = useState(null),
|
|
44718
|
+
activeIndex = _e[0],
|
|
44719
|
+
setActiveIndex = _e[1];
|
|
44720
|
+
var isOpen = activeIndex !== null;
|
|
44721
|
+
var activeImage = activeIndex !== null ? images[activeIndex] : null;
|
|
44722
|
+
var close = function () {
|
|
44723
|
+
return setActiveIndex(null);
|
|
44724
|
+
};
|
|
44725
|
+
var next = function () {
|
|
44726
|
+
if (activeIndex === null) return;
|
|
44727
|
+
setActiveIndex((activeIndex + 1) % images.length);
|
|
44728
|
+
};
|
|
44729
|
+
var prev = function () {
|
|
44730
|
+
if (activeIndex === null) return;
|
|
44731
|
+
setActiveIndex((activeIndex - 1 + images.length) % images.length);
|
|
44732
|
+
};
|
|
44733
|
+
useEffect(
|
|
44734
|
+
function () {
|
|
44735
|
+
if (!isOpen) return;
|
|
44736
|
+
var onKeyDown = function (e) {
|
|
44737
|
+
if (e.key === 'Escape') close();
|
|
44738
|
+
if (e.key === 'ArrowRight') next();
|
|
44739
|
+
if (e.key === 'ArrowLeft') prev();
|
|
44740
|
+
};
|
|
44741
|
+
document.addEventListener('keydown', onKeyDown);
|
|
44742
|
+
document.body.style.overflow = 'hidden';
|
|
44743
|
+
return function () {
|
|
44744
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
44745
|
+
document.body.style.overflow = '';
|
|
44746
|
+
};
|
|
44747
|
+
},
|
|
44748
|
+
[isOpen, activeIndex, images.length]
|
|
44749
|
+
);
|
|
44750
|
+
if (!images.length) {
|
|
44751
|
+
return React__default.createElement(
|
|
44752
|
+
'section',
|
|
44753
|
+
{ className: 'gallery' },
|
|
44754
|
+
React__default.createElement('p', { className: 'gallery__empty' }, 'No photos available.')
|
|
44755
|
+
);
|
|
44756
|
+
}
|
|
44757
|
+
var big = images[0];
|
|
44758
|
+
var thumbs = images.slice(1, 6);
|
|
44759
|
+
var extraCount = Math.max(0, images.length - 6);
|
|
44760
|
+
var openAt = function (index) {
|
|
44761
|
+
if (!images[index]) return;
|
|
44762
|
+
setActiveIndex(index);
|
|
44763
|
+
};
|
|
44764
|
+
return React__default.createElement(
|
|
44765
|
+
'div',
|
|
44766
|
+
{ className: 'content' },
|
|
44767
|
+
React__default.createElement(
|
|
44768
|
+
'div',
|
|
44769
|
+
{ className: 'content__container' },
|
|
44770
|
+
React__default.createElement(
|
|
44771
|
+
'div',
|
|
44772
|
+
{ className: 'content__colums content__colums--2-1' },
|
|
44773
|
+
React__default.createElement(
|
|
44774
|
+
'section',
|
|
44775
|
+
{ className: 'gallery' },
|
|
44776
|
+
React__default.createElement(
|
|
44777
|
+
'div',
|
|
44778
|
+
{ className: 'gallery__layout' },
|
|
44779
|
+
React__default.createElement(
|
|
44780
|
+
'button',
|
|
44781
|
+
{
|
|
44782
|
+
type: 'button',
|
|
44783
|
+
className: 'gallery__big',
|
|
44784
|
+
onClick: function () {
|
|
44785
|
+
return openAt(0);
|
|
44786
|
+
},
|
|
44787
|
+
'aria-label': 'Open image 1'
|
|
44788
|
+
},
|
|
44789
|
+
React__default.createElement('img', {
|
|
44790
|
+
className: 'gallery__big__img',
|
|
44791
|
+
src: big.src,
|
|
44792
|
+
alt: (_b = big.alt) !== null && _b !== void 0 ? _b : '',
|
|
44793
|
+
loading: 'eager'
|
|
44794
|
+
})
|
|
44795
|
+
),
|
|
44796
|
+
React__default.createElement(
|
|
44797
|
+
'div',
|
|
44798
|
+
{ className: 'gallery__thumbs', 'aria-label': 'Gallery thumbnails' },
|
|
44799
|
+
thumbs.map(function (img, i) {
|
|
44800
|
+
var _a;
|
|
44801
|
+
var realIndex = i + 1;
|
|
44802
|
+
var isLastThumbSlot = i === 4;
|
|
44803
|
+
var shouldShowMoreOverlay = isLastThumbSlot && extraCount > 0;
|
|
44804
|
+
return React__default.createElement(
|
|
44805
|
+
'button',
|
|
44806
|
+
{
|
|
44807
|
+
key: ''.concat(img.src, '-').concat(realIndex),
|
|
44808
|
+
type: 'button',
|
|
44809
|
+
className: 'gallery__thumb '.concat(shouldShowMoreOverlay ? 'gallery__thumb--more' : ''),
|
|
44810
|
+
onClick: function () {
|
|
44811
|
+
return openAt(realIndex);
|
|
44812
|
+
},
|
|
44813
|
+
'aria-label': 'Open image '.concat(realIndex + 1)
|
|
44814
|
+
},
|
|
44815
|
+
React__default.createElement('img', {
|
|
44816
|
+
className: 'gallery__thumb__img',
|
|
44817
|
+
src: img.src,
|
|
44818
|
+
alt: (_a = img.alt) !== null && _a !== void 0 ? _a : '',
|
|
44819
|
+
loading: 'lazy'
|
|
44820
|
+
}),
|
|
44821
|
+
shouldShowMoreOverlay &&
|
|
44822
|
+
React__default.createElement(
|
|
44823
|
+
'span',
|
|
44824
|
+
{ className: 'gallery__thumb__overlay', 'aria-label': ''.concat(extraCount, ' more photos') },
|
|
44825
|
+
'+',
|
|
44826
|
+
extraCount
|
|
44827
|
+
)
|
|
44828
|
+
);
|
|
44829
|
+
})
|
|
44830
|
+
)
|
|
44831
|
+
),
|
|
44832
|
+
isOpen &&
|
|
44833
|
+
activeImage &&
|
|
44834
|
+
React__default.createElement(
|
|
44835
|
+
'div',
|
|
44836
|
+
{
|
|
44837
|
+
className: 'gallery__lightbox',
|
|
44838
|
+
role: 'dialog',
|
|
44839
|
+
'aria-modal': 'true',
|
|
44840
|
+
onMouseDown: function (e) {
|
|
44841
|
+
if (e.target === e.currentTarget) close();
|
|
44842
|
+
}
|
|
44843
|
+
},
|
|
44844
|
+
React__default.createElement(
|
|
44845
|
+
'div',
|
|
44846
|
+
{ className: 'gallery__lightbox__panel' },
|
|
44847
|
+
React__default.createElement(
|
|
44848
|
+
'button',
|
|
44849
|
+
{ type: 'button', className: 'gallery__btn__icon gallery__btn__icon--close', 'aria-label': 'Close', onClick: close },
|
|
44850
|
+
React__default.createElement(Icon$3, { name: 'ui-close', width: 16, height: 16 })
|
|
44851
|
+
),
|
|
44852
|
+
React__default.createElement(
|
|
44853
|
+
'div',
|
|
44854
|
+
{ className: 'gallery__lightbox__media' },
|
|
44855
|
+
React__default.createElement('img', {
|
|
44856
|
+
className: 'gallery__lightbox__img',
|
|
44857
|
+
src: activeImage.src,
|
|
44858
|
+
alt: (_c = activeImage.alt) !== null && _c !== void 0 ? _c : ''
|
|
44859
|
+
})
|
|
44860
|
+
),
|
|
44861
|
+
React__default.createElement(
|
|
44862
|
+
'div',
|
|
44863
|
+
{ className: 'gallery__lightbox__footer' },
|
|
44864
|
+
React__default.createElement(
|
|
44865
|
+
'div',
|
|
44866
|
+
{ className: 'gallery__lightbox__info' },
|
|
44867
|
+
React__default.createElement('span', { className: 'gallery__lightbox__index' }, activeIndex + 1, ' / ', images.length),
|
|
44868
|
+
(activeImage.caption || activeImage.alt) &&
|
|
44869
|
+
React__default.createElement(
|
|
44870
|
+
'span',
|
|
44871
|
+
{ className: 'gallery__lightbox__caption' },
|
|
44872
|
+
(_d = activeImage.caption) !== null && _d !== void 0 ? _d : activeImage.alt
|
|
44873
|
+
)
|
|
44874
|
+
),
|
|
44875
|
+
React__default.createElement(
|
|
44876
|
+
'div',
|
|
44877
|
+
{ className: 'gallery__lightbox__controls' },
|
|
44878
|
+
React__default.createElement('button', { type: 'button', className: 'gallery__btn', onClick: prev }, '\u2190'),
|
|
44879
|
+
React__default.createElement('button', { type: 'button', className: 'gallery__btn', onClick: next }, '\u2192')
|
|
44880
|
+
)
|
|
44881
|
+
)
|
|
44882
|
+
)
|
|
44883
|
+
)
|
|
44884
|
+
),
|
|
44885
|
+
React__default.createElement('div', null, React__default.createElement('h2', null, title), React__default.createElement('p', null, intro))
|
|
44886
|
+
)
|
|
44887
|
+
)
|
|
44888
|
+
);
|
|
44889
|
+
};
|
|
44890
|
+
|
|
44891
|
+
var Breadcrumbs = function (_a) {
|
|
44892
|
+
var items = _a.items,
|
|
44893
|
+
_b = _a.noHeader,
|
|
44894
|
+
noHeader = _b === void 0 ? false : _b;
|
|
44895
|
+
var lastIndex = items.length - 1;
|
|
44896
|
+
return React__default.createElement(
|
|
44897
|
+
'nav',
|
|
44898
|
+
{ className: 'breadcrumb'.concat(noHeader ? ' breadcrumb--no-header' : ''), 'aria-label': 'Breadcrumb' },
|
|
44899
|
+
React__default.createElement(
|
|
44900
|
+
'div',
|
|
44901
|
+
{ className: 'breadcrumb__container' },
|
|
44902
|
+
React__default.createElement(
|
|
44903
|
+
'ol',
|
|
44904
|
+
{ className: 'breadcrumb__list' },
|
|
44905
|
+
items.map(function (item, idx) {
|
|
44906
|
+
var _a;
|
|
44907
|
+
var isCurrent = (_a = item.isCurrent) !== null && _a !== void 0 ? _a : idx === lastIndex;
|
|
44908
|
+
var content = React__default.createElement(
|
|
44909
|
+
'span',
|
|
44910
|
+
{ className: 'breadcrumb__content' },
|
|
44911
|
+
item.icon && React__default.createElement('span', { className: 'breadcrumb__icon', 'aria-hidden': 'true' }, item.icon),
|
|
44912
|
+
item.label && React__default.createElement('span', { className: 'breadcrumb__label', title: item.label }, item.label)
|
|
44913
|
+
);
|
|
44914
|
+
return React__default.createElement(
|
|
44915
|
+
'li',
|
|
44916
|
+
{ key: idx, className: 'breadcrumb__item' },
|
|
44917
|
+
idx > 0 && React__default.createElement('span', { className: 'breadcrumb__separator', 'aria-hidden': 'true' }, '/'),
|
|
44918
|
+
isCurrent || !item.href
|
|
44919
|
+
? React__default.createElement('span', { className: 'breadcrumb__current', 'aria-current': isCurrent ? 'page' : undefined }, content)
|
|
44920
|
+
: React__default.createElement('a', { className: 'breadcrumb__link', href: item.href, onClick: item.onClick }, content)
|
|
44921
|
+
);
|
|
44922
|
+
})
|
|
44923
|
+
)
|
|
44924
|
+
)
|
|
44925
|
+
);
|
|
44926
|
+
};
|
|
44927
|
+
|
|
44712
44928
|
var signalR$1 = {};
|
|
44713
44929
|
|
|
44714
44930
|
var jqueryDeferred$1 = { exports: {} };
|
|
@@ -48603,4 +48819,19 @@ var signalR = /*#__PURE__*/ _mergeNamespaces(
|
|
|
48603
48819
|
[signalR$1]
|
|
48604
48820
|
);
|
|
48605
48821
|
|
|
48606
|
-
export {
|
|
48822
|
+
export {
|
|
48823
|
+
BookingProduct,
|
|
48824
|
+
BookingWizard,
|
|
48825
|
+
Breadcrumbs,
|
|
48826
|
+
DepartureRange,
|
|
48827
|
+
Footer,
|
|
48828
|
+
Header,
|
|
48829
|
+
ImageCardGrid,
|
|
48830
|
+
ImageWithTextSection,
|
|
48831
|
+
Login,
|
|
48832
|
+
Navbar,
|
|
48833
|
+
PhotoGallery,
|
|
48834
|
+
QSM,
|
|
48835
|
+
SearchResults,
|
|
48836
|
+
Slider
|
|
48837
|
+
};
|
|
@@ -6,11 +6,9 @@ export type BreadcrumbItem = {
|
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
isCurrent?: boolean;
|
|
8
8
|
};
|
|
9
|
-
type BreadcrumbsProps = {
|
|
9
|
+
export type BreadcrumbsProps = {
|
|
10
10
|
items: BreadcrumbItem[];
|
|
11
|
-
separator?: React.ReactNode;
|
|
12
|
-
ariaLabel?: string;
|
|
13
11
|
noHeader?: boolean;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
|
-
export
|
|
13
|
+
declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
14
|
+
export default Breadcrumbs;
|
|
@@ -4,9 +4,10 @@ export interface GalleryImage {
|
|
|
4
4
|
alt?: string;
|
|
5
5
|
caption?: string;
|
|
6
6
|
}
|
|
7
|
-
interface GalleryProps {
|
|
8
|
-
images: GalleryImage[];
|
|
7
|
+
export interface GalleryProps {
|
|
9
8
|
title?: string;
|
|
9
|
+
intro?: string;
|
|
10
|
+
images: GalleryImage[];
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
export
|
|
12
|
+
declare const PhotoGallery: React.FC<GalleryProps>;
|
|
13
|
+
export default PhotoGallery;
|
|
@@ -9,6 +9,8 @@ import ImageCardGrid from './content/image-card-grid';
|
|
|
9
9
|
import Login from './content/login';
|
|
10
10
|
import ImageWithTextSection from './content/image-with-text-section';
|
|
11
11
|
import Slider from './content/components/slider';
|
|
12
|
+
import PhotoGallery from './content/components/gallery';
|
|
13
|
+
import Breadcrumbs from './content/components/breadcrumb';
|
|
12
14
|
export * from './content/navbar/types';
|
|
13
15
|
export * from './content/header/types';
|
|
14
16
|
export * from './content/footer/types';
|
|
@@ -18,4 +20,18 @@ export * from './content/image-with-text-section/types';
|
|
|
18
20
|
export * from './search-results/types';
|
|
19
21
|
export * from './qsm/types';
|
|
20
22
|
export * from './shared/types';
|
|
21
|
-
export {
|
|
23
|
+
export {
|
|
24
|
+
BookingProduct,
|
|
25
|
+
BookingWizard,
|
|
26
|
+
QSM,
|
|
27
|
+
SearchResults,
|
|
28
|
+
Navbar,
|
|
29
|
+
Header,
|
|
30
|
+
Footer,
|
|
31
|
+
ImageCardGrid,
|
|
32
|
+
Login,
|
|
33
|
+
ImageWithTextSection,
|
|
34
|
+
Slider,
|
|
35
|
+
PhotoGallery,
|
|
36
|
+
Breadcrumbs
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -8,27 +8,16 @@ export type BreadcrumbItem = {
|
|
|
8
8
|
isCurrent?: boolean;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
type BreadcrumbsProps = {
|
|
11
|
+
export type BreadcrumbsProps = {
|
|
12
12
|
items: BreadcrumbItem[];
|
|
13
|
-
separator?: React.ReactNode;
|
|
14
|
-
ariaLabel?: string;
|
|
15
13
|
noHeader?: boolean;
|
|
16
14
|
};
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
items,
|
|
20
|
-
separator = (
|
|
21
|
-
<span className="breadcrumb__separator" aria-hidden="true">
|
|
22
|
-
/
|
|
23
|
-
</span>
|
|
24
|
-
),
|
|
25
|
-
ariaLabel = 'Breadcrumb',
|
|
26
|
-
noHeader = false
|
|
27
|
-
}: BreadcrumbsProps) {
|
|
16
|
+
const Breadcrumbs: React.FC<BreadcrumbsProps> = ({ items, noHeader = false }) => {
|
|
28
17
|
const lastIndex = items.length - 1;
|
|
29
18
|
|
|
30
19
|
return (
|
|
31
|
-
<nav className={`breadcrumb${noHeader ? ' breadcrumb--no-header' : ''}`} aria-label=
|
|
20
|
+
<nav className={`breadcrumb${noHeader ? ' breadcrumb--no-header' : ''}`} aria-label="Breadcrumb">
|
|
32
21
|
<div className="breadcrumb__container">
|
|
33
22
|
<ol className="breadcrumb__list">
|
|
34
23
|
{items.map((item, idx) => {
|
|
@@ -51,7 +40,11 @@ export default function Breadcrumbs({
|
|
|
51
40
|
|
|
52
41
|
return (
|
|
53
42
|
<li key={idx} className="breadcrumb__item">
|
|
54
|
-
{idx > 0 &&
|
|
43
|
+
{idx > 0 && (
|
|
44
|
+
<span className="breadcrumb__separator" aria-hidden="true">
|
|
45
|
+
/
|
|
46
|
+
</span>
|
|
47
|
+
)}
|
|
55
48
|
|
|
56
49
|
{isCurrent || !item.href ? (
|
|
57
50
|
<span className="breadcrumb__current" aria-current={isCurrent ? 'page' : undefined}>
|
|
@@ -69,4 +62,6 @@ export default function Breadcrumbs({
|
|
|
69
62
|
</div>
|
|
70
63
|
</nav>
|
|
71
64
|
);
|
|
72
|
-
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default Breadcrumbs;
|
|
@@ -7,12 +7,13 @@ export interface GalleryImage {
|
|
|
7
7
|
caption?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
interface GalleryProps {
|
|
11
|
-
images: GalleryImage[];
|
|
10
|
+
export interface GalleryProps {
|
|
12
11
|
title?: string;
|
|
12
|
+
intro?: string;
|
|
13
|
+
images: GalleryImage[];
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const PhotoGallery: React.FC<GalleryProps> = ({ images, title, intro }) => {
|
|
16
17
|
const [activeIndex, setActiveIndex] = useState<number | null>(null);
|
|
17
18
|
|
|
18
19
|
const isOpen = activeIndex !== null;
|
|
@@ -66,80 +67,87 @@ export default function PhotoGallery({ images, title = 'Gallery' }: GalleryProps
|
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
return (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<button type="button" className="gallery__big" onClick={() => openAt(0)} aria-label="Open image 1">
|
|
77
|
-
<img className="gallery__big__img" src={big.src} alt={big.alt ?? ''} loading="eager" />
|
|
78
|
-
</button>
|
|
79
|
-
|
|
80
|
-
<div className="gallery__thumbs" aria-label="Gallery thumbnails">
|
|
81
|
-
{thumbs.map((img, i) => {
|
|
82
|
-
const realIndex = i + 1;
|
|
83
|
-
const isLastThumbSlot = i === 4;
|
|
84
|
-
const shouldShowMoreOverlay = isLastThumbSlot && extraCount > 0;
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<button
|
|
88
|
-
key={`${img.src}-${realIndex}`}
|
|
89
|
-
type="button"
|
|
90
|
-
className={`gallery__thumb ${shouldShowMoreOverlay ? 'gallery__thumb--more' : ''}`}
|
|
91
|
-
onClick={() => openAt(realIndex)}
|
|
92
|
-
aria-label={`Open image ${realIndex + 1}`}>
|
|
93
|
-
<img className="gallery__thumb__img" src={img.src} alt={img.alt ?? ''} loading="lazy" />
|
|
94
|
-
|
|
95
|
-
{shouldShowMoreOverlay && (
|
|
96
|
-
<span className="gallery__thumb__overlay" aria-label={`${extraCount} more photos`}>
|
|
97
|
-
+{extraCount}
|
|
98
|
-
</span>
|
|
99
|
-
)}
|
|
70
|
+
<div className="content">
|
|
71
|
+
<div className="content__container">
|
|
72
|
+
<div className="content__colums content__colums--2-1">
|
|
73
|
+
<section className="gallery">
|
|
74
|
+
<div className="gallery__layout">
|
|
75
|
+
<button type="button" className="gallery__big" onClick={() => openAt(0)} aria-label="Open image 1">
|
|
76
|
+
<img className="gallery__big__img" src={big.src} alt={big.alt ?? ''} loading="eager" />
|
|
100
77
|
</button>
|
|
101
|
-
);
|
|
102
|
-
})}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
{isOpen && activeImage && (
|
|
107
|
-
<div
|
|
108
|
-
className="gallery__lightbox"
|
|
109
|
-
role="dialog"
|
|
110
|
-
aria-modal="true"
|
|
111
|
-
onMouseDown={(e) => {
|
|
112
|
-
if (e.target === e.currentTarget) close();
|
|
113
|
-
}}>
|
|
114
|
-
<div className="gallery__lightbox__panel">
|
|
115
|
-
<button type="button" className="gallery__btn__icon gallery__btn__icon--close" aria-label="Close" onClick={close}>
|
|
116
|
-
<Icon name="ui-close" width={16} height={16} />
|
|
117
|
-
</button>
|
|
118
|
-
|
|
119
|
-
<div className="gallery__lightbox__media">
|
|
120
|
-
<img className="gallery__lightbox__img" src={activeImage.src} alt={activeImage.alt ?? ''} />
|
|
121
|
-
</div>
|
|
122
78
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
79
|
+
<div className="gallery__thumbs" aria-label="Gallery thumbnails">
|
|
80
|
+
{thumbs.map((img, i) => {
|
|
81
|
+
const realIndex = i + 1;
|
|
82
|
+
const isLastThumbSlot = i === 4;
|
|
83
|
+
const shouldShowMoreOverlay = isLastThumbSlot && extraCount > 0;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<button
|
|
87
|
+
key={`${img.src}-${realIndex}`}
|
|
88
|
+
type="button"
|
|
89
|
+
className={`gallery__thumb ${shouldShowMoreOverlay ? 'gallery__thumb--more' : ''}`}
|
|
90
|
+
onClick={() => openAt(realIndex)}
|
|
91
|
+
aria-label={`Open image ${realIndex + 1}`}>
|
|
92
|
+
<img className="gallery__thumb__img" src={img.src} alt={img.alt ?? ''} loading="lazy" />
|
|
93
|
+
|
|
94
|
+
{shouldShowMoreOverlay && (
|
|
95
|
+
<span className="gallery__thumb__overlay" aria-label={`${extraCount} more photos`}>
|
|
96
|
+
+{extraCount}
|
|
97
|
+
</span>
|
|
98
|
+
)}
|
|
99
|
+
</button>
|
|
100
|
+
);
|
|
101
|
+
})}
|
|
129
102
|
</div>
|
|
103
|
+
</div>
|
|
130
104
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
105
|
+
{isOpen && activeImage && (
|
|
106
|
+
<div
|
|
107
|
+
className="gallery__lightbox"
|
|
108
|
+
role="dialog"
|
|
109
|
+
aria-modal="true"
|
|
110
|
+
onMouseDown={(e) => {
|
|
111
|
+
if (e.target === e.currentTarget) close();
|
|
112
|
+
}}>
|
|
113
|
+
<div className="gallery__lightbox__panel">
|
|
114
|
+
<button type="button" className="gallery__btn__icon gallery__btn__icon--close" aria-label="Close" onClick={close}>
|
|
115
|
+
<Icon name="ui-close" width={16} height={16} />
|
|
116
|
+
</button>
|
|
117
|
+
|
|
118
|
+
<div className="gallery__lightbox__media">
|
|
119
|
+
<img className="gallery__lightbox__img" src={activeImage.src} alt={activeImage.alt ?? ''} />
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div className="gallery__lightbox__footer">
|
|
123
|
+
<div className="gallery__lightbox__info">
|
|
124
|
+
<span className="gallery__lightbox__index">
|
|
125
|
+
{activeIndex + 1} / {images.length}
|
|
126
|
+
</span>
|
|
127
|
+
{(activeImage.caption || activeImage.alt) && <span className="gallery__lightbox__caption">{activeImage.caption ?? activeImage.alt}</span>}
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div className="gallery__lightbox__controls">
|
|
131
|
+
<button type="button" className="gallery__btn" onClick={prev}>
|
|
132
|
+
←
|
|
133
|
+
</button>
|
|
134
|
+
<button type="button" className="gallery__btn" onClick={next}>
|
|
135
|
+
→
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
138
140
|
</div>
|
|
139
|
-
|
|
141
|
+
)}
|
|
142
|
+
</section>
|
|
143
|
+
<div>
|
|
144
|
+
<h2>{title}</h2>
|
|
145
|
+
<p>{intro}</p>
|
|
140
146
|
</div>
|
|
141
147
|
</div>
|
|
142
|
-
|
|
143
|
-
</
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
144
150
|
);
|
|
145
|
-
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export default PhotoGallery;
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,8 @@ import ImageCardGrid from './content/image-card-grid';
|
|
|
9
9
|
import Login from './content/login';
|
|
10
10
|
import ImageWithTextSection from './content/image-with-text-section';
|
|
11
11
|
import Slider from './content/components/slider';
|
|
12
|
+
import PhotoGallery from './content/components/gallery';
|
|
13
|
+
import Breadcrumbs from './content/components/breadcrumb';
|
|
12
14
|
|
|
13
15
|
export * from './content/navbar/types';
|
|
14
16
|
export * from './content/header/types';
|
|
@@ -20,4 +22,18 @@ export * from './search-results/types';
|
|
|
20
22
|
export * from './qsm/types';
|
|
21
23
|
export * from './shared/types';
|
|
22
24
|
|
|
23
|
-
export {
|
|
25
|
+
export {
|
|
26
|
+
BookingProduct,
|
|
27
|
+
BookingWizard,
|
|
28
|
+
QSM,
|
|
29
|
+
SearchResults,
|
|
30
|
+
Navbar,
|
|
31
|
+
Header,
|
|
32
|
+
Footer,
|
|
33
|
+
ImageCardGrid,
|
|
34
|
+
Login,
|
|
35
|
+
ImageWithTextSection,
|
|
36
|
+
Slider,
|
|
37
|
+
PhotoGallery,
|
|
38
|
+
Breadcrumbs
|
|
39
|
+
};
|