chop-logic-components 4.1.1 → 4.2.0
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/dist/components/atoms/image/Image.css +1 -1
- package/dist/components/hocs/with-figure-caption/Figure.css +1 -1
- package/dist/components/organisms/gallery/Gallery.css +1 -0
- package/dist/components/organisms/gallery/Gallery.d.ts +4 -0
- package/dist/components/organisms/gallery/Gallery.helpers.d.ts +3 -0
- package/dist/components/organisms/gallery/Gallery.helpers.js +29 -0
- package/dist/components/organisms/gallery/Gallery2.js +57 -0
- package/dist/components/organisms/gallery/carousel-navigation/CarouselNavigation.css +1 -0
- package/dist/components/organisms/gallery/carousel-navigation/CarouselNavigation.d.ts +9 -0
- package/dist/components/organisms/gallery/carousel-navigation/CarouselNavigation2.js +25 -0
- package/dist/components/organisms/gallery/full-screen-viewer/FullscreenViewer.css +1 -0
- package/dist/components/organisms/gallery/full-screen-viewer/FullscreenViewer.d.ts +11 -0
- package/dist/components/organisms/gallery/full-screen-viewer/FullscreenViewer2.js +48 -0
- package/dist/components/organisms/gallery/gallery-image-item/GalleryImageItem.css +1 -0
- package/dist/components/organisms/gallery/gallery-image-item/GalleryImageItem.d.ts +10 -0
- package/dist/components/organisms/gallery/gallery-image-item/GalleryImageItem2.js +17 -0
- package/dist/components/organisms/gallery/hooks/use-carousel-scroll.d.ts +10 -0
- package/dist/components/organisms/gallery/hooks/use-carousel-scroll.js +50 -0
- package/dist/components/organisms/gallery/hooks/use-fullscreen-viewer.d.ts +11 -0
- package/dist/components/organisms/gallery/hooks/use-fullscreen-viewer.js +23 -0
- package/dist/components/organisms/gallery/viewer-close-button/ViewerCloseButton.css +1 -0
- package/dist/components/organisms/gallery/viewer-close-button/ViewerCloseButton.d.ts +6 -0
- package/dist/components/organisms/gallery/viewer-close-button/ViewerCloseButton2.js +15 -0
- package/dist/components/organisms/gallery/viewer-counter/ViewerCounter.css +1 -0
- package/dist/components/organisms/gallery/viewer-counter/ViewerCounter.d.ts +7 -0
- package/dist/components/organisms/gallery/viewer-counter/ViewerCounter2.js +14 -0
- package/dist/components/organisms/gallery/viewer-image-container/ViewerImageContainer.css +1 -0
- package/dist/components/organisms/gallery/viewer-image-container/ViewerImageContainer.d.ts +8 -0
- package/dist/components/organisms/gallery/viewer-image-container/ViewerImageContainer2.js +14 -0
- package/dist/components/organisms/gallery/viewer-navigation/ViewerNavigation.css +1 -0
- package/dist/components/organisms/gallery/viewer-navigation/ViewerNavigation.d.ts +8 -0
- package/dist/components/organisms/gallery/viewer-navigation/ViewerNavigation2.js +29 -0
- package/dist/components/organisms/gallery/viewer-overlay/ViewerOverlay.css +1 -0
- package/dist/components/organisms/gallery/viewer-overlay/ViewerOverlay.d.ts +12 -0
- package/dist/components/organisms/gallery/viewer-overlay/ViewerOverlay2.js +33 -0
- package/dist/components/organisms/index.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +5 -4
- package/dist/styles/main.css +1 -1
- package/dist/types/gallery.d.ts +13 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-image{object-fit:cover;border-radius:var(--cl-border-radius)}.cl-image__img{border-radius:var(--cl-border-radius);max-width:100%;height:auto}.cl-image__picture{object-fit:cover;border-radius:var(--cl-border-radius);display:block}.cl-image__fallback{flex-direction:column;justify-content:
|
|
1
|
+
.cl-image{object-fit:cover;border-radius:var(--cl-border-radius)}.cl-image__img{border-radius:var(--cl-border-radius);max-width:100%;height:auto}.cl-image__picture{object-fit:cover;border-radius:var(--cl-border-radius);display:block}.cl-image__fallback{flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex}.cl-image__fallback-icon{width:148px;height:148px}.cl-image__fallback-icon:before{font-size:6rem}.cl-image__fallback-text{text-align:center;padding-top:var(--cl-s-gap);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}@media (width>=640px){.cl-image__fallback-text{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-image__fallback-text{font-size:var(--cl-typography-small-desktop)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-figure{margin:0;display:block}.cl-figure__caption{text-align:center;padding-top:var(--cl-s-gap);color:var(--cl-base-font-color);font-size:var(--cl-typography-small-mobile)}@media (width>=640px){.cl-figure__caption{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-figure__caption{font-size:var(--cl-typography-small-desktop)}}
|
|
1
|
+
.cl-figure{margin:0;display:block}.cl-figure__caption{text-align:center;font-family:var(--cl-core-font);padding-top:var(--cl-s-gap);color:var(--cl-base-font-color);font-size:var(--cl-typography-small-mobile)}@media (width>=640px){.cl-figure__caption{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-figure__caption{font-size:var(--cl-typography-small-desktop)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-gallery{position:relative}.cl-gallery__container{width:100%}.cl-gallery__container_grid{grid-template-columns:repeat(min(var(--gallery-columns), 2), 1fr);gap:var(--gallery-gap,var(--cl-m-gap));grid-auto-rows:1fr;display:grid}.cl-gallery__container_grid[style*=--gallery-rows]{grid-template-rows:repeat(var(--gallery-rows), 1fr);max-height:calc((100% / var(--gallery-columns)) * var(--gallery-rows) + var(--gallery-gap,var(--cl-m-gap)) * (var(--gallery-rows) - 1));overflow:hidden}.cl-gallery__container_grid .cl-gallery__item{width:100%;height:100%}.cl-gallery__container_grid .cl-gallery__item img{object-fit:cover;width:100%;height:100%}.cl-gallery__container_masonry{column-count:1;column-gap:var(--gallery-gap,var(--cl-m-gap))}.cl-gallery__container_masonry .cl-gallery__item{break-inside:avoid;margin-bottom:var(--gallery-gap,var(--cl-m-gap))}.cl-gallery__container_carousel{scroll-behavior:smooth;gap:var(--gallery-gap,var(--cl-m-gap));scrollbar-width:none;flex-wrap:nowrap;display:flex;overflow-x:scroll}.cl-gallery__container_carousel::-webkit-scrollbar{display:none}.cl-gallery__container_carousel .cl-gallery__item{flex-shrink:0}@media (width>=640px){.cl-gallery__container_grid{grid-template-columns:repeat(var(--gallery-columns), 1fr)}.cl-gallery__container_masonry{column-count:2}}@media (width>=1024px){.cl-gallery__container_masonry{column-count:var(--gallery-columns,3)}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/components/organisms/gallery/Gallery.helpers.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
if (e.length === 0) return;
|
|
4
|
+
let t, n = 0;
|
|
5
|
+
for (let r of e) {
|
|
6
|
+
let e = r.descriptor?.trim();
|
|
7
|
+
if (e && e.endsWith("w")) {
|
|
8
|
+
let i = e.slice(0, -1), a = Number.parseInt(i, 10);
|
|
9
|
+
!Number.isNaN(a) && a > n && (n = a, t = r);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return t ?? e.at(-1);
|
|
13
|
+
}, t = (t) => {
|
|
14
|
+
let { caption: n, sources: r, ...i } = t;
|
|
15
|
+
if (r && r.length > 0) {
|
|
16
|
+
let t = e(r);
|
|
17
|
+
if (t) return {
|
|
18
|
+
...i,
|
|
19
|
+
src: t.src,
|
|
20
|
+
sources: void 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
...i,
|
|
25
|
+
sources: r
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { t as getFullscreenImageProps };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../utils/get-class-name.js";
|
|
2
|
+
import t from "./carousel-navigation/CarouselNavigation2.js";
|
|
3
|
+
import n from "./full-screen-viewer/FullscreenViewer2.js";
|
|
4
|
+
import './Gallery.css';/* empty css */
|
|
5
|
+
import r from "./gallery-image-item/GalleryImageItem2.js";
|
|
6
|
+
import { useCarouselScroll as i } from "./hooks/use-carousel-scroll.js";
|
|
7
|
+
import { useFullscreenViewer as a } from "./hooks/use-fullscreen-viewer.js";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
import { useRef as c } from "react";
|
|
10
|
+
//#region src/components/organisms/gallery/Gallery.tsx
|
|
11
|
+
var l = ({ images: l = [], layout: u = "grid", columns: d = 3, rows: f, gap: p, label: m, className: h, title: g, enableFullscreen: _ = !1, ...v }) => {
|
|
12
|
+
let y = c(null), { isViewerOpen: b, currentImageIndex: x, openViewer: S, closeViewer: C, handleNavigate: w } = a(), { showPrev: T, showNext: E, scrollForward: D, scrollBackward: O } = i(y, u), k = e(["cl-gallery", h]), A = e([
|
|
13
|
+
"cl-gallery__container",
|
|
14
|
+
{ "cl-gallery__container_grid": u === "grid" },
|
|
15
|
+
{ "cl-gallery__container_masonry": u === "masonry" },
|
|
16
|
+
{ "cl-gallery__container_carousel": u === "carousel" }
|
|
17
|
+
]), j = {
|
|
18
|
+
"--gallery-columns": d,
|
|
19
|
+
"--gallery-rows": f,
|
|
20
|
+
"--gallery-gap": p
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ s("section", {
|
|
23
|
+
className: k,
|
|
24
|
+
"aria-label": m ?? g ?? "Image gallery",
|
|
25
|
+
title: g,
|
|
26
|
+
...v,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ o("div", {
|
|
29
|
+
ref: y,
|
|
30
|
+
className: A,
|
|
31
|
+
style: j,
|
|
32
|
+
tabIndex: u === "carousel" ? 0 : void 0,
|
|
33
|
+
children: l.map((e, t) => /* @__PURE__ */ o(r, {
|
|
34
|
+
item: e,
|
|
35
|
+
index: t,
|
|
36
|
+
enableFullscreen: _,
|
|
37
|
+
onOpenViewer: S
|
|
38
|
+
}, e.src))
|
|
39
|
+
}),
|
|
40
|
+
u === "carousel" && /* @__PURE__ */ o(t, {
|
|
41
|
+
showPrev: T,
|
|
42
|
+
showNext: E,
|
|
43
|
+
onScrollBackward: O,
|
|
44
|
+
onScrollForward: D
|
|
45
|
+
}),
|
|
46
|
+
_ && /* @__PURE__ */ o(n, {
|
|
47
|
+
images: l,
|
|
48
|
+
currentIndex: x,
|
|
49
|
+
isOpen: b,
|
|
50
|
+
onClose: C,
|
|
51
|
+
onNavigate: w
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { l as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-gallery__button{height:100%;position:absolute;top:0}.cl-gallery__button_prev{left:var(--cl-l-gap)}.cl-gallery__button_next{right:var(--cl-l-gap)}.cl-gallery__button_prev .cl-icon-button__icon:before,.cl-gallery__button_next .cl-icon-button__icon:before{color:#fff!important}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface CarouselNavigationProps {
|
|
3
|
+
showPrev: boolean;
|
|
4
|
+
showNext: boolean;
|
|
5
|
+
onScrollBackward: () => void;
|
|
6
|
+
onScrollForward: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const CarouselNavigation: FC<CarouselNavigationProps>;
|
|
9
|
+
export default CarouselNavigation;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ButtonView as e } from "../../../../enums/button-view.js";
|
|
2
|
+
import { IconName as t } from "../../../../enums/icon-name.js";
|
|
3
|
+
import n from "../../../atoms/button/Button2.js";
|
|
4
|
+
import './CarouselNavigation.css';/* empty css */
|
|
5
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/organisms/gallery/carousel-navigation/CarouselNavigation.tsx
|
|
7
|
+
var o = ({ showPrev: o, showNext: s, onScrollBackward: c, onScrollForward: l }) => /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(n, {
|
|
8
|
+
view: e.Icon,
|
|
9
|
+
icon: t.ChevronLeft,
|
|
10
|
+
label: "Previous images",
|
|
11
|
+
className: "cl-gallery__button cl-gallery__button_prev",
|
|
12
|
+
onClick: c,
|
|
13
|
+
style: { visibility: o ? "visible" : "hidden" },
|
|
14
|
+
"aria-hidden": !o
|
|
15
|
+
}), /* @__PURE__ */ i(n, {
|
|
16
|
+
view: e.Icon,
|
|
17
|
+
icon: t.ChevronRight,
|
|
18
|
+
label: "Next images",
|
|
19
|
+
className: "cl-gallery__button cl-gallery__button_next",
|
|
20
|
+
onClick: l,
|
|
21
|
+
style: { visibility: s ? "visible" : "hidden" },
|
|
22
|
+
"aria-hidden": !s
|
|
23
|
+
})] });
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-fullscreen-viewer{width:100%;height:100%;z-index:var(--cl-z-index-modal);background-color:var(--cl-shadow-background-deep);justify-content:center;align-items:center;animation:.4s cl-fade-in;display:flex;position:fixed;top:0;left:0}.cl-fullscreen-viewer_closing{animation:.4s cl-fade-out}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GalleryItem } from '../../../../types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
interface FullscreenViewerProps {
|
|
4
|
+
images: GalleryItem[];
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onNavigate: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const FullscreenViewer: FC<FullscreenViewerProps>;
|
|
11
|
+
export default FullscreenViewer;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import t from "../../../atoms/portal/Portal.js";
|
|
3
|
+
import { useIsMounted as n } from "../../../../hooks/use-is-mounted/use-is-mounted.js";
|
|
4
|
+
import { useKeyPress as r } from "../../../../hooks/use-key-press/use-key-press.js";
|
|
5
|
+
import { useModalFocusTrap as i } from "../../../../hooks/use-modal-focus-trap/use-modal-focus-trap.js";
|
|
6
|
+
import './FullscreenViewer.css';/* empty css */
|
|
7
|
+
import { getFullscreenImageProps as a } from "../Gallery.helpers.js";
|
|
8
|
+
import o from "../viewer-close-button/ViewerCloseButton2.js";
|
|
9
|
+
import s from "../viewer-overlay/ViewerOverlay2.js";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
+
import { useEffect as u, useMemo as d, useRef as f } from "react";
|
|
12
|
+
//#region src/components/organisms/gallery/full-screen-viewer/FullscreenViewer.tsx
|
|
13
|
+
var p = ({ images: p, currentIndex: m, isOpen: h, onClose: g, onNavigate: _ }) => {
|
|
14
|
+
let v = f(null), y = n(h, 300), b = y && !h;
|
|
15
|
+
i({
|
|
16
|
+
modalRef: v,
|
|
17
|
+
isOpened: h
|
|
18
|
+
}), r({
|
|
19
|
+
keyCode: "Escape",
|
|
20
|
+
ref: v,
|
|
21
|
+
onKeyPress: g
|
|
22
|
+
}), u(() => {
|
|
23
|
+
let e = (e) => {
|
|
24
|
+
e.code === "ArrowLeft" && m > 0 ? _(m - 1) : e.code === "ArrowRight" && m < p.length - 1 && _(m + 1);
|
|
25
|
+
};
|
|
26
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
27
|
+
}, [
|
|
28
|
+
m,
|
|
29
|
+
p.length,
|
|
30
|
+
_
|
|
31
|
+
]);
|
|
32
|
+
let x = p[m], S = d(() => x ? a(x) : null, [x]);
|
|
33
|
+
return !y || !x || !S ? null : /* @__PURE__ */ c(t, { children: /* @__PURE__ */ l("div", {
|
|
34
|
+
ref: v,
|
|
35
|
+
className: e(["cl-fullscreen-viewer", { "cl-fullscreen-viewer_closing": b }]),
|
|
36
|
+
"data-testid": "fullscreen-image-viewer",
|
|
37
|
+
children: [/* @__PURE__ */ c(o, { onClose: g }), /* @__PURE__ */ c(s, {
|
|
38
|
+
fullscreenImageProps: S,
|
|
39
|
+
caption: x.caption,
|
|
40
|
+
currentIndex: m,
|
|
41
|
+
totalImages: p.length,
|
|
42
|
+
onClose: g,
|
|
43
|
+
onNavigate: _
|
|
44
|
+
})]
|
|
45
|
+
}) });
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { p as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-gallery__item{overflow:hidden}.cl-gallery__item_fullscreen{cursor:pointer}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GalleryItem } from '../../../../types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
interface GalleryImageItemProps {
|
|
4
|
+
item: GalleryItem;
|
|
5
|
+
index: number;
|
|
6
|
+
enableFullscreen: boolean;
|
|
7
|
+
onOpenViewer?: (index: number, element: HTMLElement) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const GalleryImageItem: FC<GalleryImageItemProps>;
|
|
10
|
+
export default GalleryImageItem;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import t from "../../../atoms/image/Image2.js";
|
|
3
|
+
import './GalleryImageItem.css';/* empty css */
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/organisms/gallery/gallery-image-item/GalleryImageItem.tsx
|
|
6
|
+
var r = ({ item: r, index: i, enableFullscreen: a, onOpenViewer: o }) => /* @__PURE__ */ n("div", {
|
|
7
|
+
className: e(["cl-gallery__item", { "cl-gallery__item_fullscreen": a }]),
|
|
8
|
+
onClick: (e) => {
|
|
9
|
+
a && o && o(i, e.currentTarget);
|
|
10
|
+
},
|
|
11
|
+
onKeyDown: (e) => {
|
|
12
|
+
a && o && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o(i, e.currentTarget));
|
|
13
|
+
},
|
|
14
|
+
children: /* @__PURE__ */ n(t, { ...r })
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GalleryMode } from '../../../../types';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
interface CarouselScrollState {
|
|
4
|
+
showPrev: boolean;
|
|
5
|
+
showNext: boolean;
|
|
6
|
+
scrollForward: () => void;
|
|
7
|
+
scrollBackward: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useCarouselScroll: (containerRef: RefObject<HTMLDivElement | null>, layout: GalleryMode) => CarouselScrollState;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useState as n } from "react";
|
|
2
|
+
//#region src/components/organisms/gallery/hooks/use-carousel-scroll.ts
|
|
3
|
+
var r = (r, i) => {
|
|
4
|
+
let [a, o] = n(!1), [s, c] = n(!1), l = e(() => {
|
|
5
|
+
let e = r.current;
|
|
6
|
+
if (!e) return;
|
|
7
|
+
let { scrollLeft: t, scrollWidth: n, clientWidth: i } = e;
|
|
8
|
+
if (n <= i) {
|
|
9
|
+
o(!1), c(!1);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
o(t > 1), c(t < n - i - 1);
|
|
13
|
+
}, [r]);
|
|
14
|
+
return t(() => {
|
|
15
|
+
if (i !== "carousel") {
|
|
16
|
+
o(!1), c(!1);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let e = r.current;
|
|
20
|
+
if (!e) return;
|
|
21
|
+
l();
|
|
22
|
+
let t = new ResizeObserver(l);
|
|
23
|
+
return t.observe(e), e.addEventListener("scroll", l), () => {
|
|
24
|
+
e.removeEventListener("scroll", l), t.disconnect();
|
|
25
|
+
};
|
|
26
|
+
}, [
|
|
27
|
+
i,
|
|
28
|
+
r,
|
|
29
|
+
l
|
|
30
|
+
]), {
|
|
31
|
+
showPrev: a,
|
|
32
|
+
showNext: s,
|
|
33
|
+
scrollForward: e(() => {
|
|
34
|
+
let e = r.current;
|
|
35
|
+
e && e.scrollBy({
|
|
36
|
+
left: e.clientWidth,
|
|
37
|
+
behavior: "smooth"
|
|
38
|
+
});
|
|
39
|
+
}, [r]),
|
|
40
|
+
scrollBackward: e(() => {
|
|
41
|
+
let e = r.current;
|
|
42
|
+
e && e.scrollBy({
|
|
43
|
+
left: -e.clientWidth,
|
|
44
|
+
behavior: "smooth"
|
|
45
|
+
});
|
|
46
|
+
}, [r])
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { r as useCarouselScroll };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface FullscreenViewerState {
|
|
3
|
+
isViewerOpen: boolean;
|
|
4
|
+
currentImageIndex: number;
|
|
5
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
6
|
+
openViewer: (index: number, element: HTMLElement) => void;
|
|
7
|
+
closeViewer: () => void;
|
|
8
|
+
handleNavigate: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const useFullscreenViewer: () => FullscreenViewerState;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback as e, useRef as t, useState as n } from "react";
|
|
2
|
+
//#region src/components/organisms/gallery/hooks/use-fullscreen-viewer.ts
|
|
3
|
+
var r = () => {
|
|
4
|
+
let [r, i] = n(!1), [a, o] = n(0), s = t(null);
|
|
5
|
+
return {
|
|
6
|
+
isViewerOpen: r,
|
|
7
|
+
currentImageIndex: a,
|
|
8
|
+
triggerRef: s,
|
|
9
|
+
openViewer: e((e, t) => {
|
|
10
|
+
s.current = t, o(e), i(!0);
|
|
11
|
+
}, []),
|
|
12
|
+
closeViewer: e(() => {
|
|
13
|
+
i(!1), setTimeout(() => {
|
|
14
|
+
s.current?.focus(), s.current = null;
|
|
15
|
+
}, 300);
|
|
16
|
+
}, []),
|
|
17
|
+
handleNavigate: e((e) => {
|
|
18
|
+
o(e);
|
|
19
|
+
}, [])
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { r as useFullscreenViewer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-fullscreen-viewer__close-button{top:var(--cl-m-gap);right:var(--cl-m-gap);z-index:var(--cl-z-index-menu);position:absolute}.cl-fullscreen-viewer__close-button .cl-icon-button__icon:before{color:#fff!important}@media (width>=640px){.cl-fullscreen-viewer__close-button{top:var(--cl-l-gap);right:var(--cl-l-gap)}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ButtonView as e } from "../../../../enums/button-view.js";
|
|
2
|
+
import { IconName as t } from "../../../../enums/icon-name.js";
|
|
3
|
+
import n from "../../../atoms/button/Button2.js";
|
|
4
|
+
import './ViewerCloseButton.css';/* empty css */
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/organisms/gallery/viewer-close-button/ViewerCloseButton.tsx
|
|
7
|
+
var i = ({ onClose: i }) => /* @__PURE__ */ r(n, {
|
|
8
|
+
view: e.Icon,
|
|
9
|
+
icon: t.X,
|
|
10
|
+
label: "Close fullscreen view",
|
|
11
|
+
onClick: i,
|
|
12
|
+
className: "cl-fullscreen-viewer__close-button"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { i as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-fullscreen-viewer__counter{bottom:var(--cl-l-gap);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);position:absolute;left:50%;color:#fff!important}@media (width>=640px){.cl-fullscreen-viewer__counter{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-fullscreen-viewer__counter{font-size:var(--cl-typography-base-desktop)}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './ViewerCounter.css';/* empty css */
|
|
2
|
+
import { jsxs as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/organisms/gallery/viewer-counter/ViewerCounter.tsx
|
|
4
|
+
var t = ({ currentIndex: t, totalImages: n }) => n <= 1 ? null : /* @__PURE__ */ e("span", {
|
|
5
|
+
className: "cl-fullscreen-viewer__counter",
|
|
6
|
+
"aria-live": "polite",
|
|
7
|
+
children: [
|
|
8
|
+
t + 1,
|
|
9
|
+
" / ",
|
|
10
|
+
n
|
|
11
|
+
]
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-fullscreen-viewer__image-container{flex-direction:column;align-items:center;max-width:90vw;max-height:90vh;display:flex}.cl-fullscreen-viewer__image-container .cl-image{min-height:0;display:flex}.cl-fullscreen-viewer__image-container .cl-figure{flex-direction:column;min-height:0;display:flex}.cl-fullscreen-viewer__image-container figcaption{color:#fff!important}@media (width>=640px){.cl-fullscreen-viewer__caption{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-fullscreen-viewer__caption{font-size:var(--cl-typography-base-desktop)}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GalleryItem, ImageProps } from '../../../../types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
interface ViewerImageContainerProps {
|
|
4
|
+
fullscreenImageProps: Omit<ImageProps, 'caption'>;
|
|
5
|
+
caption?: GalleryItem['caption'];
|
|
6
|
+
}
|
|
7
|
+
declare const ViewerImageContainer: FC<ViewerImageContainerProps>;
|
|
8
|
+
export default ViewerImageContainer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from "../../../atoms/image/Image2.js";
|
|
2
|
+
import './ViewerImageContainer.css';/* empty css */
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/organisms/gallery/viewer-image-container/ViewerImageContainer.tsx
|
|
5
|
+
var n = ({ fullscreenImageProps: n, caption: r }) => /* @__PURE__ */ t("div", {
|
|
6
|
+
className: "cl-fullscreen-viewer__image-container",
|
|
7
|
+
children: /* @__PURE__ */ t(e, {
|
|
8
|
+
...n,
|
|
9
|
+
caption: r,
|
|
10
|
+
loading: "eager"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-fullscreen-viewer__nav-button{height:90%;z-index:var(--cl-z-index-base);position:absolute;top:5%}.cl-fullscreen-viewer__nav-button .cl-icon-button__icon:before{color:#fff!important}.cl-fullscreen-viewer__nav-button_prev{left:var(--cl-l-gap)}.cl-fullscreen-viewer__nav-button_next{right:var(--cl-l-gap)}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import { ButtonView as t } from "../../../../enums/button-view.js";
|
|
3
|
+
import { IconName as n } from "../../../../enums/icon-name.js";
|
|
4
|
+
import r from "../../../atoms/button/Button2.js";
|
|
5
|
+
import './ViewerNavigation.css';/* empty css */
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/organisms/gallery/viewer-navigation/ViewerNavigation.tsx
|
|
8
|
+
var s = ({ currentIndex: s, totalImages: c, onNavigate: l }) => {
|
|
9
|
+
let u = s > 0, d = s < c - 1, f = () => {
|
|
10
|
+
l(s - 1);
|
|
11
|
+
}, p = () => {
|
|
12
|
+
l(s + 1);
|
|
13
|
+
}, m = e(["cl-fullscreen-viewer__nav-button", "cl-fullscreen-viewer__nav-button_prev"]), h = e(["cl-fullscreen-viewer__nav-button", "cl-fullscreen-viewer__nav-button_next"]);
|
|
14
|
+
return /* @__PURE__ */ o(i, { children: [u && /* @__PURE__ */ a(r, {
|
|
15
|
+
view: t.Icon,
|
|
16
|
+
icon: n.ChevronLeft,
|
|
17
|
+
label: "Previous image",
|
|
18
|
+
onClick: f,
|
|
19
|
+
className: m
|
|
20
|
+
}), d && /* @__PURE__ */ a(r, {
|
|
21
|
+
view: t.Icon,
|
|
22
|
+
icon: n.ChevronRight,
|
|
23
|
+
label: "Next image",
|
|
24
|
+
onClick: p,
|
|
25
|
+
className: h
|
|
26
|
+
})] });
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { s as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cl-fullscreen-viewer__overlay{justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GalleryItem, ImageProps } from '../../../../types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface ViewerOverlayProps {
|
|
4
|
+
fullscreenImageProps: Omit<ImageProps, 'caption'>;
|
|
5
|
+
caption?: GalleryItem['caption'];
|
|
6
|
+
currentIndex: number;
|
|
7
|
+
totalImages: number;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onNavigate: (index: number) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ViewerOverlay: FC<ViewerOverlayProps>;
|
|
12
|
+
export default ViewerOverlay;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import e from "../viewer-counter/ViewerCounter2.js";
|
|
2
|
+
import t from "../viewer-image-container/ViewerImageContainer2.js";
|
|
3
|
+
import n from "../viewer-navigation/ViewerNavigation2.js";
|
|
4
|
+
import './ViewerOverlay.css';/* empty css */
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/organisms/gallery/viewer-overlay/ViewerOverlay.tsx
|
|
7
|
+
var a = ({ fullscreenImageProps: a, caption: o, currentIndex: s, totalImages: c, onClose: l, onNavigate: u }) => /* @__PURE__ */ i("div", {
|
|
8
|
+
className: "cl-fullscreen-viewer__overlay",
|
|
9
|
+
onClick: (e) => {
|
|
10
|
+
e.target === e.currentTarget && l();
|
|
11
|
+
},
|
|
12
|
+
onKeyDown: (e) => {
|
|
13
|
+
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), l());
|
|
14
|
+
},
|
|
15
|
+
"data-testid": "viewer-overlay",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ r(t, {
|
|
18
|
+
fullscreenImageProps: a,
|
|
19
|
+
caption: o
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ r(e, {
|
|
22
|
+
currentIndex: s,
|
|
23
|
+
totalImages: c
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ r(n, {
|
|
26
|
+
currentIndex: s,
|
|
27
|
+
totalImages: c,
|
|
28
|
+
onNavigate: u
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { a as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Dialog } from './dialog/Dialog';
|
|
2
2
|
export { default as Form } from './form/Form';
|
|
3
|
+
export { default as Gallery } from './gallery/Gallery';
|
|
3
4
|
export { default as Grid } from './grid/Grid';
|
|
4
5
|
export { default as Menu } from './menu/Menu';
|
|
5
6
|
export { default as Tabs } from './tabs/Tabs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './main'
|
|
1
|
+
export * from './main.js'
|
|
2
2
|
export {}
|
package/dist/index.es.js
CHANGED
|
@@ -50,7 +50,8 @@ import X from "./components/molecules/switch/Switch2.js";
|
|
|
50
50
|
import Z from "./components/molecules/text-input/TextInput2.js";
|
|
51
51
|
import Q from "./components/organisms/dialog/Dialog2.js";
|
|
52
52
|
import $ from "./components/organisms/form/Form2.js";
|
|
53
|
-
import ee from "./components/organisms/
|
|
54
|
-
import te from "./components/organisms/
|
|
55
|
-
import ne from "./components/organisms/
|
|
56
|
-
|
|
53
|
+
import ee from "./components/organisms/gallery/Gallery2.js";
|
|
54
|
+
import te from "./components/organisms/grid/Grid2.js";
|
|
55
|
+
import ne from "./components/organisms/menu/Menu2.js";
|
|
56
|
+
import re from "./components/organisms/tabs/Tabs2.js";
|
|
57
|
+
export { H as Accordion, U as Alert, t as AlertMode, W as Breadcrumbs, l as Button, n as ButtonView, N as CL_DARK_THEME_CLASS, P as CL_LIGHT_THEME_CLASS, G as Checkbox, Q as Dialog, u as EditableText, r as ElementSize, d as ErrorMessage, $ as Form, M as FormContext, ee as Gallery, te as Grid, f as Header, p as Icon, i as IconName, g as Image, _ as Input, v as Label, y as Link, a as LoaderView, ne as Menu, K as MultiSelect, q as NumericInput, o as OrientationMode, b as Portal, J as Search, Y as Select, s as SemanticColor, X as Switch, re as Tabs, Z as TextInput, F as ThemeContext, I as ThemeProvider, V as Tooltip, c as TooltipContainer, x as useAutoClose, S as useClickOutside, C as useContainerDimensions, w as useDebounce, T as useElementIds, E as useIsHovered, D as useIsMounted, O as useIsOverflow, k as useKeyPress, A as useModalFocusTrap, j as useRemainingTimer, L as useResetFormInput, R as useTheme, z as useTooltipPosition, B as useWindowDimensions, m as withErrorBoundary, h as withFigureCaption, e as withTooltip };
|
package/dist/styles/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--cl-core-font:Arial, Helvetica, sans-serif;--cl-monospace-font:"Courier New", Courier, monospace;--cl-fancy-font:Georgia, "Times New Roman", Times, serif;--cl-xs-gap:2px;--cl-s-gap:4px;--cl-m-gap:8px;--cl-l-gap:16px;--cl-xl-gap:32px;--cl-xxl-gap:64px;--cl-icon-size:20px;--cl-thumb-size:24px;--cl-border-radius:4px;--cl-z-index-base:1;--cl-z-index-menu:5;--cl-z-index-popup:10;--cl-z-index-modal:20;--cl-typography-h1-mobile:2.25rem;--cl-typography-h1-tablet:2.5rem;--cl-typography-h1-desktop:3rem;--cl-typography-h2-mobile:2rem;--cl-typography-h2-tablet:2.25rem;--cl-typography-h2-desktop:2.5rem;--cl-typography-h3-mobile:1.75rem;--cl-typography-h3-tablet:2rem;--cl-typography-h3-desktop:2.25rem;--cl-typography-h4-mobile:1.5rem;--cl-typography-h4-tablet:1.75rem;--cl-typography-h4-desktop:2rem;--cl-typography-h5-mobile:1.25rem;--cl-typography-h5-tablet:1.5rem;--cl-typography-h5-desktop:1.75rem;--cl-typography-h6-mobile:1rem;--cl-typography-h6-tablet:1.125rem;--cl-typography-h6-desktop:1.25rem;--cl-typography-base-mobile:1rem;--cl-typography-base-tablet:1.125rem;--cl-typography-base-desktop:1.25rem;--cl-typography-small-mobile:.875rem;--cl-typography-small-tablet:1rem;--cl-typography-small-desktop:1.125rem;--cl-breakpoint-sm:640px;--cl-breakpoint-md:768px;--cl-breakpoint-lg:1024px;--cl-breakpoint-xl:1280px;--cl-breakpoint-xxl:1536px;--cl-base-font-color:#000;--cl-base-background-color:#fff;--cl-accent-a0:#8d1c12;--cl-accent-a10:#7d1c11;--cl-accent-a20:#6d1b10;--cl-accent-a30:#5e190f;--cl-surface-a0:#fff;--cl-surface-a10:#f0f0f0;--cl-surface-a20:#e1e1e1;--cl-surface-a30:#d3d3d3;--cl-surface-tonal-a0:#f7e8e4;--cl-surface-tonal-a10:#e9dcd8;--cl-surface-tonal-a20:#dbd0cd;--cl-surface-tonal-a30:#cec4c2;--cl-success-a0:#1b7f5c;--cl-success-a10:#28be8a;--cl-success-a20:#58dbad;--cl-warning-a0:#b8871f;--cl-warning-a10:#dfae44;--cl-warning-a20:#ebca85;--cl-danger-a0:#b13535;--cl-danger-a10:#d06262;--cl-danger-a20:#e29d9d;--cl-info-a0:#1e56a3;--cl-info-a10:#347ada;--cl-info-a20:#74a4e6;--cl-accent-gradient:linear-gradient(135deg, #8d1c12 0%, #7d1c11 50%, #6d1b10 100%);--cl-box-shadow:#0003 2.4px 2.4px 3.2px;--cl-box-shadow-extended:#0003 4.8px 4.8px 6.4px;--cl-text-shadow:2.4px 2.4px 3.2px #00000026;--cl-drop-shadow:drop-shadow(2.4px 2.4px 3.2px #00000026);--cl-shadow-background:#0000004d;--cl-accent-border:1px solid #8d1c12;--cl-danger-border:1px solid #d06262;--cl-success-border:1px solid #28be8a;--cl-warning-border:1px solid #dfae44;--cl-info-border:1px solid #347ada;--cl-light-border:1px solid #c0b8b6;--cl-outline-border:1px solid #000}.cl-components-dark-theme{--cl-base-background-color:#000;--cl-base-font-color:#fff;--cl-accent-a0:#eb5cbe;--cl-accent-a10:#ef71c5;--cl-accent-a20:#f385cc;--cl-accent-a30:#f697d4;--cl-surface-a0:#121212;--cl-surface-a10:#282828;--cl-surface-a20:#3f3f3f;--cl-surface-a30:#575757;--cl-surface-tonal-a0:#251a21;--cl-surface-tonal-a10:#3a2f36;--cl-surface-tonal-a20:#4f464c;--cl-surface-tonal-a30:#665d63;--cl-success-a0:#9ae8ce;--cl-success-a10:#47d5a6;--cl-success-a20:#22946e;--cl-warning-a0:#a87a2a;--cl-warning-a10:#d7ac61;--cl-warning-a20:#ecd7b2;--cl-danger-a0:#eb9e9e;--cl-danger-a10:#d94a4a;--cl-danger-a20:#9c2121;--cl-info-a0:#92b2e5;--cl-info-a10:#4077d1;--cl-info-a20:#21498a;--cl-accent-gradient:linear-gradient(135deg, #eb5cbe 0%, #ef71c5 50%, #f385cc 100%);--cl-box-shadow:#ffffff4d 2.4px 2.4px 3.2px;--cl-box-shadow-extended:#ffffff4d 4px 4px 5px;--cl-text-shadow:2.4px 2.4px 3.2px #ffffff80;--cl-drop-shadow:drop-shadow(2.4px 2.4px 3.2px #ffffff4d);--cl-shadow-background:#ffffff4d;--cl-accent-border:1px solid #eb5cbe;--cl-danger-border:1px solid #d94a4a;--cl-success-border:1px solid #47d5a6;--cl-warning-border:1px solid #d7ac61;--cl-info-border:1px solid #4077d1;--cl-light-border:1px solid #665d63;--cl-outline-border:1px solid #fff}@keyframes cl-fade-in{0%{opacity:0}to{opacity:1}}@keyframes cl-fade-out{0%{opacity:1}to{opacity:0}}.cl-fade-in{animation:.4s cl-fade-in}.cl-fade-out{animation:.4s cl-fade-out}
|
|
1
|
+
:root{--cl-core-font:Arial, Helvetica, sans-serif;--cl-monospace-font:"Courier New", Courier, monospace;--cl-fancy-font:Georgia, "Times New Roman", Times, serif;--cl-xs-gap:2px;--cl-s-gap:4px;--cl-m-gap:8px;--cl-l-gap:16px;--cl-xl-gap:32px;--cl-xxl-gap:64px;--cl-icon-size:20px;--cl-thumb-size:24px;--cl-border-radius:4px;--cl-z-index-base:1;--cl-z-index-menu:5;--cl-z-index-popup:10;--cl-z-index-modal:20;--cl-typography-h1-mobile:2.25rem;--cl-typography-h1-tablet:2.5rem;--cl-typography-h1-desktop:3rem;--cl-typography-h2-mobile:2rem;--cl-typography-h2-tablet:2.25rem;--cl-typography-h2-desktop:2.5rem;--cl-typography-h3-mobile:1.75rem;--cl-typography-h3-tablet:2rem;--cl-typography-h3-desktop:2.25rem;--cl-typography-h4-mobile:1.5rem;--cl-typography-h4-tablet:1.75rem;--cl-typography-h4-desktop:2rem;--cl-typography-h5-mobile:1.25rem;--cl-typography-h5-tablet:1.5rem;--cl-typography-h5-desktop:1.75rem;--cl-typography-h6-mobile:1rem;--cl-typography-h6-tablet:1.125rem;--cl-typography-h6-desktop:1.25rem;--cl-typography-base-mobile:1rem;--cl-typography-base-tablet:1.125rem;--cl-typography-base-desktop:1.25rem;--cl-typography-small-mobile:.875rem;--cl-typography-small-tablet:1rem;--cl-typography-small-desktop:1.125rem;--cl-breakpoint-sm:640px;--cl-breakpoint-md:768px;--cl-breakpoint-lg:1024px;--cl-breakpoint-xl:1280px;--cl-breakpoint-xxl:1536px;--cl-base-font-color:#000;--cl-base-background-color:#fff;--cl-accent-a0:#8d1c12;--cl-accent-a10:#7d1c11;--cl-accent-a20:#6d1b10;--cl-accent-a30:#5e190f;--cl-surface-a0:#fff;--cl-surface-a10:#f0f0f0;--cl-surface-a20:#e1e1e1;--cl-surface-a30:#d3d3d3;--cl-surface-tonal-a0:#f7e8e4;--cl-surface-tonal-a10:#e9dcd8;--cl-surface-tonal-a20:#dbd0cd;--cl-surface-tonal-a30:#cec4c2;--cl-success-a0:#1b7f5c;--cl-success-a10:#28be8a;--cl-success-a20:#58dbad;--cl-warning-a0:#b8871f;--cl-warning-a10:#dfae44;--cl-warning-a20:#ebca85;--cl-danger-a0:#b13535;--cl-danger-a10:#d06262;--cl-danger-a20:#e29d9d;--cl-info-a0:#1e56a3;--cl-info-a10:#347ada;--cl-info-a20:#74a4e6;--cl-accent-gradient:linear-gradient(135deg, #8d1c12 0%, #7d1c11 50%, #6d1b10 100%);--cl-box-shadow:#0003 2.4px 2.4px 3.2px;--cl-box-shadow-extended:#0003 4.8px 4.8px 6.4px;--cl-text-shadow:2.4px 2.4px 3.2px #00000026;--cl-drop-shadow:drop-shadow(2.4px 2.4px 3.2px #00000026);--cl-shadow-background:#0000004d;--cl-shadow-background-deep:#000000e6;--cl-accent-border:1px solid #8d1c12;--cl-danger-border:1px solid #d06262;--cl-success-border:1px solid #28be8a;--cl-warning-border:1px solid #dfae44;--cl-info-border:1px solid #347ada;--cl-light-border:1px solid #c0b8b6;--cl-outline-border:1px solid #000}.cl-components-dark-theme{--cl-base-background-color:#000;--cl-base-font-color:#fff;--cl-accent-a0:#eb5cbe;--cl-accent-a10:#ef71c5;--cl-accent-a20:#f385cc;--cl-accent-a30:#f697d4;--cl-surface-a0:#121212;--cl-surface-a10:#282828;--cl-surface-a20:#3f3f3f;--cl-surface-a30:#575757;--cl-surface-tonal-a0:#251a21;--cl-surface-tonal-a10:#3a2f36;--cl-surface-tonal-a20:#4f464c;--cl-surface-tonal-a30:#665d63;--cl-success-a0:#9ae8ce;--cl-success-a10:#47d5a6;--cl-success-a20:#22946e;--cl-warning-a0:#a87a2a;--cl-warning-a10:#d7ac61;--cl-warning-a20:#ecd7b2;--cl-danger-a0:#eb9e9e;--cl-danger-a10:#d94a4a;--cl-danger-a20:#9c2121;--cl-info-a0:#92b2e5;--cl-info-a10:#4077d1;--cl-info-a20:#21498a;--cl-accent-gradient:linear-gradient(135deg, #eb5cbe 0%, #ef71c5 50%, #f385cc 100%);--cl-box-shadow:#ffffff4d 2.4px 2.4px 3.2px;--cl-box-shadow-extended:#ffffff4d 4px 4px 5px;--cl-text-shadow:2.4px 2.4px 3.2px #ffffff80;--cl-drop-shadow:drop-shadow(2.4px 2.4px 3.2px #ffffff4d);--cl-shadow-background:#ffffff4d;--cl-shadow-background-deep:#000000e6;--cl-accent-border:1px solid #eb5cbe;--cl-danger-border:1px solid #d94a4a;--cl-success-border:1px solid #47d5a6;--cl-warning-border:1px solid #d7ac61;--cl-info-border:1px solid #4077d1;--cl-light-border:1px solid #665d63;--cl-outline-border:1px solid #fff}@keyframes cl-fade-in{0%{opacity:0}to{opacity:1}}@keyframes cl-fade-out{0%{opacity:1}to{opacity:0}}.cl-fade-in{animation:.4s cl-fade-in}.cl-fade-out{animation:.4s cl-fade-out}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChopLogicComponentProps } from './_common';
|
|
2
|
+
import { ImageProps } from './image';
|
|
3
|
+
export type GalleryItem = ImageProps;
|
|
4
|
+
export type GalleryMode = 'grid' | 'masonry' | 'carousel';
|
|
5
|
+
export interface GalleryProps extends ChopLogicComponentProps {
|
|
6
|
+
images?: GalleryItem[];
|
|
7
|
+
layout?: GalleryMode;
|
|
8
|
+
columns?: number;
|
|
9
|
+
rows?: number;
|
|
10
|
+
gap?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
enableFullscreen?: boolean;
|
|
13
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type { CheckboxProps } from './checkbox';
|
|
|
7
7
|
export type { DialogProps } from './dialog';
|
|
8
8
|
export type { EditableTextProps } from './editable-text';
|
|
9
9
|
export type { FormInputParams, FormProps, FormValidationState, FormValues } from './form';
|
|
10
|
+
export type { GalleryItem, GalleryMode, GalleryProps } from './gallery';
|
|
10
11
|
export type { GridColumn, GridItem, GridProps, GridRowValue, RenderDataItemCallback } from './grid';
|
|
11
12
|
export type { HeaderProps } from './header';
|
|
12
13
|
export type { ImageProps, ImageSource } from './image';
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/ChopLogic/chop-logic-components.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "4.
|
|
7
|
+
"version": "4.2.0",
|
|
8
8
|
"description": "Reusable React components and hooks for the Chop Logic project",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"module": "dist/index.es.js",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lint:warnings": "biome check --diagnostic-level warn --max-diagnostics 100",
|
|
84
84
|
"lint:fix": "biome check --write",
|
|
85
85
|
"typecheck": "tsc --pretty --noEmit",
|
|
86
|
-
"test": "vitest",
|
|
86
|
+
"test": "vitest --watch",
|
|
87
87
|
"test:ci": "vitest run --passWithNoTests",
|
|
88
88
|
"test:integration": "npm run build:storybook && start-server-and-test 'http-server storybook-static -p 6006 -s' http://127.0.0.1:6006 test-storybook",
|
|
89
89
|
"test:mutation": "stryker run",
|
|
@@ -117,34 +117,34 @@
|
|
|
117
117
|
},
|
|
118
118
|
"homepage": "https://choplogic.github.io/chop-logic-components",
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@biomejs/biome": "^2.4.
|
|
121
|
-
"@commitlint/cli": "^
|
|
122
|
-
"@commitlint/config-conventional": "^
|
|
123
|
-
"@storybook/addon-a11y": "^10.
|
|
124
|
-
"@storybook/addon-docs": "^10.
|
|
125
|
-
"@storybook/react-vite": "^10.
|
|
126
|
-
"@storybook/test-runner": "^0.24.
|
|
120
|
+
"@biomejs/biome": "^2.4.16",
|
|
121
|
+
"@commitlint/cli": "^21.0.2",
|
|
122
|
+
"@commitlint/config-conventional": "^21.0.2",
|
|
123
|
+
"@storybook/addon-a11y": "^10.4.4",
|
|
124
|
+
"@storybook/addon-docs": "^10.4.4",
|
|
125
|
+
"@storybook/react-vite": "^10.4.4",
|
|
126
|
+
"@storybook/test-runner": "^0.24.4",
|
|
127
127
|
"@stryker-mutator/core": "^9.6.1",
|
|
128
128
|
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
129
129
|
"@testing-library/jest-dom": "^6.9.1",
|
|
130
130
|
"@testing-library/react": "^16.3.2",
|
|
131
|
-
"@types/node": "^25.
|
|
132
|
-
"@types/react": "^19.2.
|
|
131
|
+
"@types/node": "^25.9.3",
|
|
132
|
+
"@types/react": "^19.2.17",
|
|
133
133
|
"@types/react-dom": "^19.2.3",
|
|
134
|
-
"@vitest/coverage-v8": "^4.1.
|
|
134
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
135
135
|
"http-server": "^14.1.1",
|
|
136
136
|
"husky": "^9.1.7",
|
|
137
137
|
"husky-init": "^8.0.0",
|
|
138
138
|
"jsdom": "^29.1.1",
|
|
139
|
-
"prettier": "^3.8.
|
|
139
|
+
"prettier": "^3.8.4",
|
|
140
140
|
"remark-gfm": "^4.0.1",
|
|
141
|
-
"start-server-and-test": "^3.0.
|
|
142
|
-
"storybook": "^10.
|
|
141
|
+
"start-server-and-test": "^3.0.10",
|
|
142
|
+
"storybook": "^10.4.4",
|
|
143
143
|
"typescript": "^6.0.3",
|
|
144
|
-
"vite": "^8.0.
|
|
145
|
-
"vite-plugin-dts": "^5.0.
|
|
144
|
+
"vite": "^8.0.16",
|
|
145
|
+
"vite-plugin-dts": "^5.0.2",
|
|
146
146
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
147
|
-
"vitest": "^4.1.
|
|
147
|
+
"vitest": "^4.1.8"
|
|
148
148
|
},
|
|
149
149
|
"overrides": {
|
|
150
150
|
"storybook": "$storybook"
|