@jobber/components 6.15.0 → 6.16.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/AtlantisThemeContext/index.cjs +5 -4
- package/dist/AtlantisThemeContext/index.mjs +2 -1
- package/dist/AtlantisThemeContext-cjs.js +396 -0
- package/dist/AtlantisThemeContext-es.js +391 -0
- package/dist/Autocomplete/index.cjs +1 -0
- package/dist/Autocomplete/index.mjs +1 -0
- package/dist/Autocomplete-cjs.js +2 -32
- package/dist/Autocomplete-es.js +2 -32
- package/dist/Combobox-es.js +1 -1
- package/dist/DataListSearch-es.js +1 -1
- package/dist/Gallery/index.cjs +15 -6
- package/dist/Gallery/index.mjs +15 -6
- package/dist/InputTime-es.js +1 -1
- package/dist/InternalChipDismissible-es.js +1 -1
- package/dist/LightBox/index.cjs +15 -4
- package/dist/LightBox/index.mjs +15 -4
- package/dist/LightBox-cjs.js +104 -21
- package/dist/LightBox-es.js +104 -21
- package/dist/debounce-es.js +1 -1
- package/dist/index.cjs +6 -4
- package/dist/index.mjs +3 -1
- package/dist/styles.css +134 -41
- package/dist/throttle-es.js +1 -1
- package/dist/updateTheme-cjs.js +2 -394
- package/dist/updateTheme-es.js +2 -390
- package/dist/useDebounce-cjs.js +36 -0
- package/dist/useDebounce-es.js +34 -0
- package/dist/useScrollToActive-es.js +1 -1
- package/package.json +2 -2
package/dist/LightBox/index.mjs
CHANGED
|
@@ -2,15 +2,16 @@ export { L as LightBox } from '../LightBox-es.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'framer-motion';
|
|
4
4
|
import 'react-dom';
|
|
5
|
-
import '../debounce-es.js';
|
|
6
|
-
import '../_commonjsHelpers-es.js';
|
|
7
|
-
import '../isObjectLike-es.js';
|
|
8
|
-
import '../isSymbol-es.js';
|
|
9
5
|
import '../useRefocusOnActivator-es.js';
|
|
10
6
|
import '../useOnKeyDown-es.js';
|
|
11
7
|
import '../useFocusTrap-es.js';
|
|
12
8
|
import '../useIsMounted-es.js';
|
|
13
9
|
import '../useSafeLayoutEffect-es.js';
|
|
10
|
+
import '../useDebounce-es.js';
|
|
11
|
+
import '../debounce-es.js';
|
|
12
|
+
import '../_commonjsHelpers-es.js';
|
|
13
|
+
import '../isObjectLike-es.js';
|
|
14
|
+
import '../isSymbol-es.js';
|
|
14
15
|
import '../ButtonDismiss-es.js';
|
|
15
16
|
import '../Button-es.js';
|
|
16
17
|
import 'classnames';
|
|
@@ -18,3 +19,13 @@ import 'react-router-dom';
|
|
|
18
19
|
import '../Icon-es.js';
|
|
19
20
|
import '@jobber/design';
|
|
20
21
|
import '../Typography-es.js';
|
|
22
|
+
import '../Text-es.js';
|
|
23
|
+
import '../Heading-es.js';
|
|
24
|
+
import '../AtlantisThemeContext-es.js';
|
|
25
|
+
import '../identity-es.js';
|
|
26
|
+
import '../isTypedArray-es.js';
|
|
27
|
+
import '../_baseAssignValue-es.js';
|
|
28
|
+
import '../_baseFor-es.js';
|
|
29
|
+
import '../keysIn-es.js';
|
|
30
|
+
import '../_isIterateeCall-es.js';
|
|
31
|
+
import '../_setToString-es.js';
|
package/dist/LightBox-cjs.js
CHANGED
|
@@ -3,15 +3,76 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var framerMotion = require('framer-motion');
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
|
-
var debounce = require('./debounce-cjs.js');
|
|
7
6
|
var useRefocusOnActivator = require('./useRefocusOnActivator-cjs.js');
|
|
8
7
|
var useOnKeyDown = require('./useOnKeyDown-cjs.js');
|
|
9
8
|
var useFocusTrap = require('./useFocusTrap-cjs.js');
|
|
10
9
|
var useIsMounted = require('./useIsMounted-cjs.js');
|
|
10
|
+
var useDebounce = require('./useDebounce-cjs.js');
|
|
11
11
|
var ButtonDismiss = require('./ButtonDismiss-cjs.js');
|
|
12
|
+
var Text = require('./Text-cjs.js');
|
|
12
13
|
var Button = require('./Button-cjs.js');
|
|
14
|
+
var Heading = require('./Heading-cjs.js');
|
|
15
|
+
var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
|
|
13
16
|
|
|
14
|
-
var
|
|
17
|
+
var useBreakpoints = {};
|
|
18
|
+
|
|
19
|
+
var useMediaQuery = {};
|
|
20
|
+
|
|
21
|
+
(function (exports) {
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.mediaQueryStore = void 0;
|
|
24
|
+
exports.useMediaQuery = useMediaQuery;
|
|
25
|
+
const react_1 = React;
|
|
26
|
+
exports.mediaQueryStore = {
|
|
27
|
+
subscribe(onChange, query) {
|
|
28
|
+
const matchMedia = window.matchMedia(query);
|
|
29
|
+
matchMedia.addEventListener("change", onChange);
|
|
30
|
+
return () => {
|
|
31
|
+
matchMedia.removeEventListener("change", onChange);
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
getSnapshot(query) {
|
|
35
|
+
return () => window.matchMedia(query).matches;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
function useMediaQuery(query) {
|
|
39
|
+
const subscribeMediaQuery = (0, react_1.useCallback)((onChange) => exports.mediaQueryStore.subscribe(onChange, query), [query]);
|
|
40
|
+
const matches = (0, react_1.useSyncExternalStore)(subscribeMediaQuery, exports.mediaQueryStore.getSnapshot(query), () => true);
|
|
41
|
+
return matches;
|
|
42
|
+
}
|
|
43
|
+
} (useMediaQuery));
|
|
44
|
+
|
|
45
|
+
(function (exports) {
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.BREAKPOINT_SIZES = void 0;
|
|
48
|
+
exports.useBreakpoints = useBreakpoints;
|
|
49
|
+
const useMediaQuery_1 = useMediaQuery;
|
|
50
|
+
exports.BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
|
|
51
|
+
/**
|
|
52
|
+
* Hook equivalent of CSS media queries with our
|
|
53
|
+
* [supported breakpoints](https://atlantis.getjobber.com/?path=/docs/design-breakpoints--docs).
|
|
54
|
+
*/
|
|
55
|
+
function useBreakpoints() {
|
|
56
|
+
const { sm, md, lg, xl } = exports.BREAKPOINT_SIZES;
|
|
57
|
+
const extraSmallOnly = (0, useMediaQuery_1.useMediaQuery)(`(max-width: ${sm - 1}px)`);
|
|
58
|
+
const smallAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${sm}px)`);
|
|
59
|
+
const mediumAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${md}px)`);
|
|
60
|
+
const largeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${lg}px)`);
|
|
61
|
+
const extraLargeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${xl}px)`);
|
|
62
|
+
return {
|
|
63
|
+
smallAndUp,
|
|
64
|
+
mediumAndUp,
|
|
65
|
+
largeAndUp,
|
|
66
|
+
extraLargeAndUp,
|
|
67
|
+
extraSmallOnly,
|
|
68
|
+
smallOnly: smallAndUp && !mediumAndUp,
|
|
69
|
+
mediumOnly: mediumAndUp && !largeAndUp,
|
|
70
|
+
largeOnly: largeAndUp && !extraLargeAndUp,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
} (useBreakpoints));
|
|
74
|
+
|
|
75
|
+
var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","blurOverlay":"GKIdLTmvcvQ-","spinning":"_8tDoqjgfLcw-"};
|
|
15
76
|
|
|
16
77
|
/* eslint-disable max-statements */
|
|
17
78
|
const swipeConfidenceThreshold = 10000;
|
|
@@ -45,16 +106,21 @@ const imageTransition = {
|
|
|
45
106
|
// A little bit more than the transition's duration
|
|
46
107
|
// We're doing this to prevent a bug from framer-motion
|
|
47
108
|
// https://github.com/framer/motion/issues/1769
|
|
48
|
-
const
|
|
109
|
+
const BUTTON_DEBOUNCE_DELAY = 250;
|
|
110
|
+
const MOVEMENT_DEBOUNCE_DELAY = 1000;
|
|
49
111
|
function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
50
112
|
const [currentImageIndex, setCurrentImageIndex] = React.useState(imageIndex);
|
|
51
113
|
const [direction, setDirection] = React.useState(0);
|
|
114
|
+
const [mouseIsStationary, setMouseIsStationary] = React.useState(true);
|
|
52
115
|
const lightboxRef = useFocusTrap.useFocusTrap_2(open);
|
|
53
|
-
const debouncedHandleNext =
|
|
54
|
-
const debouncedHandlePrevious =
|
|
116
|
+
const debouncedHandleNext = useDebounce.useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
|
|
117
|
+
const debouncedHandlePrevious = useDebounce.useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
|
|
55
118
|
const mounted = useIsMounted.useIsMounted_2();
|
|
56
119
|
const prevOpen = React.useRef(open);
|
|
57
120
|
useRefocusOnActivator.useRefocusOnActivator_2(open);
|
|
121
|
+
const handleMouseMovement = useDebounce.useDebounce(() => {
|
|
122
|
+
setMouseIsStationary(true);
|
|
123
|
+
}, MOVEMENT_DEBOUNCE_DELAY);
|
|
58
124
|
useOnKeyDown.useOnKeyDown_2(handleRequestClose, "Escape");
|
|
59
125
|
useOnKeyDown.useOnKeyDown_2(debouncedHandlePrevious, {
|
|
60
126
|
key: "ArrowLeft",
|
|
@@ -69,18 +135,33 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
|
69
135
|
prevOpen.current = open;
|
|
70
136
|
togglePrintStyles(open);
|
|
71
137
|
}
|
|
72
|
-
const template = (React.createElement(React.Fragment, null, open && (React.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": "Lightbox", key: "Lightbox", ref: lightboxRef
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
138
|
+
const template = (React.createElement(React.Fragment, null, open && (React.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": "Lightbox", key: "Lightbox", ref: lightboxRef, onMouseMove: () => {
|
|
139
|
+
if (mouseIsStationary) {
|
|
140
|
+
setMouseIsStationary(false);
|
|
141
|
+
}
|
|
142
|
+
handleMouseMovement();
|
|
143
|
+
} },
|
|
144
|
+
React.createElement("div", { className: styles.backgroundImage, style: {
|
|
145
|
+
backgroundImage: `url("${images[currentImageIndex].url}")`,
|
|
146
|
+
} }),
|
|
147
|
+
React.createElement("div", { className: styles.blurOverlay, onClick: handleRequestClose }),
|
|
148
|
+
React.createElement(AtlantisThemeContext.AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
|
|
149
|
+
React.createElement("div", { className: styles.toolbar },
|
|
150
|
+
React.createElement("div", { className: styles.slideNumber },
|
|
151
|
+
React.createElement(Text.Text, null, `${currentImageIndex + 1}/${images.length}`)),
|
|
152
|
+
React.createElement("div", { className: styles.closeButton },
|
|
153
|
+
React.createElement(ButtonDismiss.ButtonDismiss, { ariaLabel: "Close", onClick: handleRequestClose })))),
|
|
154
|
+
React.createElement("div", { className: styles.imageArea },
|
|
77
155
|
React.createElement(framerMotion.AnimatePresence, { initial: false },
|
|
78
|
-
React.createElement(framerMotion.motion.img, { key: currentImageIndex, variants: variants, src: images[currentImageIndex].url, custom: direction, className: styles.image,
|
|
156
|
+
React.createElement(framerMotion.motion.img, { key: currentImageIndex, variants: variants, src: images[currentImageIndex].url, custom: direction, className: styles.image, initial: "enter", animate: "center", exit: "exit", transition: imageTransition, drag: "x", dragConstraints: { left: 0, right: 0 }, dragElastic: 1, onDragEnd: handleOnDragEnd }))),
|
|
79
157
|
images.length > 1 && (React.createElement(React.Fragment, null,
|
|
80
|
-
React.createElement(PreviousButton, { onClick: debouncedHandlePrevious }),
|
|
81
|
-
React.createElement(NextButton, { onClick: debouncedHandleNext }))),
|
|
82
|
-
|
|
83
|
-
|
|
158
|
+
React.createElement(PreviousButton, { onClick: debouncedHandlePrevious, hideButton: mouseIsStationary }),
|
|
159
|
+
React.createElement(NextButton, { onClick: debouncedHandleNext, hideButton: mouseIsStationary }))),
|
|
160
|
+
(images[currentImageIndex].title ||
|
|
161
|
+
images[currentImageIndex].caption) && (React.createElement("div", { className: styles.captionWrapper },
|
|
162
|
+
React.createElement(AtlantisThemeContext.AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
|
|
163
|
+
images[currentImageIndex].title && (React.createElement(Heading.Heading, { level: 4 }, images[currentImageIndex].title)),
|
|
164
|
+
images[currentImageIndex].caption && (React.createElement(Text.Text, { size: "large" }, images[currentImageIndex].caption)))))))));
|
|
84
165
|
return mounted.current
|
|
85
166
|
? ReactDOM.createPortal(template, document.body)
|
|
86
167
|
: template;
|
|
@@ -105,13 +186,15 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
|
105
186
|
}
|
|
106
187
|
}
|
|
107
188
|
}
|
|
108
|
-
function PreviousButton({ onClick }) {
|
|
109
|
-
|
|
110
|
-
|
|
189
|
+
function PreviousButton({ onClick, hideButton }) {
|
|
190
|
+
const { mediumAndUp } = useBreakpoints.useBreakpoints();
|
|
191
|
+
return (React.createElement("div", { className: `${styles.prev} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
192
|
+
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "Previous image", onClick: onClick })));
|
|
111
193
|
}
|
|
112
|
-
function NextButton({ onClick }) {
|
|
113
|
-
|
|
114
|
-
|
|
194
|
+
function NextButton({ onClick, hideButton }) {
|
|
195
|
+
const { mediumAndUp } = useBreakpoints.useBreakpoints();
|
|
196
|
+
return (React.createElement("div", { className: `${styles.next} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
197
|
+
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "Next image", onClick: onClick })));
|
|
115
198
|
}
|
|
116
199
|
function togglePrintStyles(open) {
|
|
117
200
|
try {
|
package/dist/LightBox-es.js
CHANGED
|
@@ -1,15 +1,76 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
|
-
import { a as debounce } from './debounce-es.js';
|
|
5
4
|
import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
|
|
6
5
|
import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
|
|
7
6
|
import { u as useFocusTrap_2 } from './useFocusTrap-es.js';
|
|
8
7
|
import { u as useIsMounted_2 } from './useIsMounted-es.js';
|
|
8
|
+
import { u as useDebounce } from './useDebounce-es.js';
|
|
9
9
|
import { B as ButtonDismiss } from './ButtonDismiss-es.js';
|
|
10
|
+
import { T as Text } from './Text-es.js';
|
|
10
11
|
import { B as Button } from './Button-es.js';
|
|
12
|
+
import { H as Heading } from './Heading-es.js';
|
|
13
|
+
import { A as AtlantisThemeContextProvider } from './AtlantisThemeContext-es.js';
|
|
11
14
|
|
|
12
|
-
var
|
|
15
|
+
var useBreakpoints = {};
|
|
16
|
+
|
|
17
|
+
var useMediaQuery = {};
|
|
18
|
+
|
|
19
|
+
(function (exports) {
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.mediaQueryStore = void 0;
|
|
22
|
+
exports.useMediaQuery = useMediaQuery;
|
|
23
|
+
const react_1 = React;
|
|
24
|
+
exports.mediaQueryStore = {
|
|
25
|
+
subscribe(onChange, query) {
|
|
26
|
+
const matchMedia = window.matchMedia(query);
|
|
27
|
+
matchMedia.addEventListener("change", onChange);
|
|
28
|
+
return () => {
|
|
29
|
+
matchMedia.removeEventListener("change", onChange);
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
getSnapshot(query) {
|
|
33
|
+
return () => window.matchMedia(query).matches;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
function useMediaQuery(query) {
|
|
37
|
+
const subscribeMediaQuery = (0, react_1.useCallback)((onChange) => exports.mediaQueryStore.subscribe(onChange, query), [query]);
|
|
38
|
+
const matches = (0, react_1.useSyncExternalStore)(subscribeMediaQuery, exports.mediaQueryStore.getSnapshot(query), () => true);
|
|
39
|
+
return matches;
|
|
40
|
+
}
|
|
41
|
+
} (useMediaQuery));
|
|
42
|
+
|
|
43
|
+
(function (exports) {
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.BREAKPOINT_SIZES = void 0;
|
|
46
|
+
exports.useBreakpoints = useBreakpoints;
|
|
47
|
+
const useMediaQuery_1 = useMediaQuery;
|
|
48
|
+
exports.BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
|
|
49
|
+
/**
|
|
50
|
+
* Hook equivalent of CSS media queries with our
|
|
51
|
+
* [supported breakpoints](https://atlantis.getjobber.com/?path=/docs/design-breakpoints--docs).
|
|
52
|
+
*/
|
|
53
|
+
function useBreakpoints() {
|
|
54
|
+
const { sm, md, lg, xl } = exports.BREAKPOINT_SIZES;
|
|
55
|
+
const extraSmallOnly = (0, useMediaQuery_1.useMediaQuery)(`(max-width: ${sm - 1}px)`);
|
|
56
|
+
const smallAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${sm}px)`);
|
|
57
|
+
const mediumAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${md}px)`);
|
|
58
|
+
const largeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${lg}px)`);
|
|
59
|
+
const extraLargeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${xl}px)`);
|
|
60
|
+
return {
|
|
61
|
+
smallAndUp,
|
|
62
|
+
mediumAndUp,
|
|
63
|
+
largeAndUp,
|
|
64
|
+
extraLargeAndUp,
|
|
65
|
+
extraSmallOnly,
|
|
66
|
+
smallOnly: smallAndUp && !mediumAndUp,
|
|
67
|
+
mediumOnly: mediumAndUp && !largeAndUp,
|
|
68
|
+
largeOnly: largeAndUp && !extraLargeAndUp,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
} (useBreakpoints));
|
|
72
|
+
|
|
73
|
+
var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","blurOverlay":"GKIdLTmvcvQ-","spinning":"_8tDoqjgfLcw-"};
|
|
13
74
|
|
|
14
75
|
/* eslint-disable max-statements */
|
|
15
76
|
const swipeConfidenceThreshold = 10000;
|
|
@@ -43,16 +104,21 @@ const imageTransition = {
|
|
|
43
104
|
// A little bit more than the transition's duration
|
|
44
105
|
// We're doing this to prevent a bug from framer-motion
|
|
45
106
|
// https://github.com/framer/motion/issues/1769
|
|
46
|
-
const
|
|
107
|
+
const BUTTON_DEBOUNCE_DELAY = 250;
|
|
108
|
+
const MOVEMENT_DEBOUNCE_DELAY = 1000;
|
|
47
109
|
function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
48
110
|
const [currentImageIndex, setCurrentImageIndex] = useState(imageIndex);
|
|
49
111
|
const [direction, setDirection] = useState(0);
|
|
112
|
+
const [mouseIsStationary, setMouseIsStationary] = useState(true);
|
|
50
113
|
const lightboxRef = useFocusTrap_2(open);
|
|
51
|
-
const debouncedHandleNext =
|
|
52
|
-
const debouncedHandlePrevious =
|
|
114
|
+
const debouncedHandleNext = useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
|
|
115
|
+
const debouncedHandlePrevious = useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
|
|
53
116
|
const mounted = useIsMounted_2();
|
|
54
117
|
const prevOpen = useRef(open);
|
|
55
118
|
useRefocusOnActivator_2(open);
|
|
119
|
+
const handleMouseMovement = useDebounce(() => {
|
|
120
|
+
setMouseIsStationary(true);
|
|
121
|
+
}, MOVEMENT_DEBOUNCE_DELAY);
|
|
56
122
|
useOnKeyDown_2(handleRequestClose, "Escape");
|
|
57
123
|
useOnKeyDown_2(debouncedHandlePrevious, {
|
|
58
124
|
key: "ArrowLeft",
|
|
@@ -67,18 +133,33 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
|
67
133
|
prevOpen.current = open;
|
|
68
134
|
togglePrintStyles(open);
|
|
69
135
|
}
|
|
70
|
-
const template = (React.createElement(React.Fragment, null, open && (React.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": "Lightbox", key: "Lightbox", ref: lightboxRef
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
136
|
+
const template = (React.createElement(React.Fragment, null, open && (React.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": "Lightbox", key: "Lightbox", ref: lightboxRef, onMouseMove: () => {
|
|
137
|
+
if (mouseIsStationary) {
|
|
138
|
+
setMouseIsStationary(false);
|
|
139
|
+
}
|
|
140
|
+
handleMouseMovement();
|
|
141
|
+
} },
|
|
142
|
+
React.createElement("div", { className: styles.backgroundImage, style: {
|
|
143
|
+
backgroundImage: `url("${images[currentImageIndex].url}")`,
|
|
144
|
+
} }),
|
|
145
|
+
React.createElement("div", { className: styles.blurOverlay, onClick: handleRequestClose }),
|
|
146
|
+
React.createElement(AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
|
|
147
|
+
React.createElement("div", { className: styles.toolbar },
|
|
148
|
+
React.createElement("div", { className: styles.slideNumber },
|
|
149
|
+
React.createElement(Text, null, `${currentImageIndex + 1}/${images.length}`)),
|
|
150
|
+
React.createElement("div", { className: styles.closeButton },
|
|
151
|
+
React.createElement(ButtonDismiss, { ariaLabel: "Close", onClick: handleRequestClose })))),
|
|
152
|
+
React.createElement("div", { className: styles.imageArea },
|
|
75
153
|
React.createElement(AnimatePresence, { initial: false },
|
|
76
|
-
React.createElement(motion.img, { key: currentImageIndex, variants: variants, src: images[currentImageIndex].url, custom: direction, className: styles.image,
|
|
154
|
+
React.createElement(motion.img, { key: currentImageIndex, variants: variants, src: images[currentImageIndex].url, custom: direction, className: styles.image, initial: "enter", animate: "center", exit: "exit", transition: imageTransition, drag: "x", dragConstraints: { left: 0, right: 0 }, dragElastic: 1, onDragEnd: handleOnDragEnd }))),
|
|
77
155
|
images.length > 1 && (React.createElement(React.Fragment, null,
|
|
78
|
-
React.createElement(PreviousButton, { onClick: debouncedHandlePrevious }),
|
|
79
|
-
React.createElement(NextButton, { onClick: debouncedHandleNext }))),
|
|
80
|
-
|
|
81
|
-
|
|
156
|
+
React.createElement(PreviousButton, { onClick: debouncedHandlePrevious, hideButton: mouseIsStationary }),
|
|
157
|
+
React.createElement(NextButton, { onClick: debouncedHandleNext, hideButton: mouseIsStationary }))),
|
|
158
|
+
(images[currentImageIndex].title ||
|
|
159
|
+
images[currentImageIndex].caption) && (React.createElement("div", { className: styles.captionWrapper },
|
|
160
|
+
React.createElement(AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
|
|
161
|
+
images[currentImageIndex].title && (React.createElement(Heading, { level: 4 }, images[currentImageIndex].title)),
|
|
162
|
+
images[currentImageIndex].caption && (React.createElement(Text, { size: "large" }, images[currentImageIndex].caption)))))))));
|
|
82
163
|
return mounted.current
|
|
83
164
|
? ReactDOM.createPortal(template, document.body)
|
|
84
165
|
: template;
|
|
@@ -103,13 +184,15 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
|
103
184
|
}
|
|
104
185
|
}
|
|
105
186
|
}
|
|
106
|
-
function PreviousButton({ onClick }) {
|
|
107
|
-
|
|
108
|
-
|
|
187
|
+
function PreviousButton({ onClick, hideButton }) {
|
|
188
|
+
const { mediumAndUp } = useBreakpoints.useBreakpoints();
|
|
189
|
+
return (React.createElement("div", { className: `${styles.prev} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
190
|
+
React.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "Previous image", onClick: onClick })));
|
|
109
191
|
}
|
|
110
|
-
function NextButton({ onClick }) {
|
|
111
|
-
|
|
112
|
-
|
|
192
|
+
function NextButton({ onClick, hideButton }) {
|
|
193
|
+
const { mediumAndUp } = useBreakpoints.useBreakpoints();
|
|
194
|
+
return (React.createElement("div", { className: `${styles.next} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
195
|
+
React.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "Next image", onClick: onClick })));
|
|
113
196
|
}
|
|
114
197
|
function togglePrintStyles(open) {
|
|
115
198
|
try {
|
package/dist/debounce-es.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var AnimatedPresence = require('./AnimatedPresence-cjs.js');
|
|
4
4
|
var AnimatedSwitcher = require('./AnimatedSwitcher-cjs.js');
|
|
5
5
|
var AtlantisContext = require('./AtlantisContext-cjs.js');
|
|
6
|
+
var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
|
|
6
7
|
var updateTheme = require('./updateTheme-cjs.js');
|
|
7
8
|
var Autocomplete = require('./Autocomplete-cjs.js');
|
|
8
9
|
require('react');
|
|
@@ -103,6 +104,7 @@ require('./_isIterateeCall-cjs.js');
|
|
|
103
104
|
require('./_setToString-cjs.js');
|
|
104
105
|
require('./tslib.es6-cjs.js');
|
|
105
106
|
require('./useOnKeyDown-cjs.js');
|
|
107
|
+
require('./useDebounce-cjs.js');
|
|
106
108
|
require('./debounce-cjs.js');
|
|
107
109
|
require('./isSymbol-cjs.js');
|
|
108
110
|
require('color');
|
|
@@ -182,11 +184,11 @@ exports.AnimatedSwitcher = AnimatedSwitcher.AnimatedSwitcher;
|
|
|
182
184
|
exports.AtlantisContext = AtlantisContext.AtlantisContext;
|
|
183
185
|
exports.atlantisContextDefaultValues = AtlantisContext.atlantisContextDefaultValues;
|
|
184
186
|
exports.useAtlantisContext = AtlantisContext.useAtlantisContext;
|
|
185
|
-
exports.AtlantisThemeContextProvider =
|
|
186
|
-
exports.THEME_CHANGE_EVENT =
|
|
187
|
-
exports.atlantisThemeContextDefaultValues =
|
|
187
|
+
exports.AtlantisThemeContextProvider = AtlantisThemeContext.AtlantisThemeContextProvider;
|
|
188
|
+
exports.THEME_CHANGE_EVENT = AtlantisThemeContext.THEME_CHANGE_EVENT;
|
|
189
|
+
exports.atlantisThemeContextDefaultValues = AtlantisThemeContext.atlantisThemeContextDefaultValues;
|
|
190
|
+
exports.useAtlantisTheme = AtlantisThemeContext.useAtlantisTheme;
|
|
188
191
|
exports.updateTheme = updateTheme.updateTheme;
|
|
189
|
-
exports.useAtlantisTheme = updateTheme.useAtlantisTheme;
|
|
190
192
|
exports.Autocomplete = Autocomplete.Autocomplete;
|
|
191
193
|
exports.Heading = Heading.Heading;
|
|
192
194
|
exports.Text = Text.Text;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { A as AnimatedPresence } from './AnimatedPresence-es.js';
|
|
2
2
|
export { A as AnimatedSwitcher } from './AnimatedSwitcher-es.js';
|
|
3
3
|
export { A as AtlantisContext, a as atlantisContextDefaultValues, u as useAtlantisContext } from './AtlantisContext-es.js';
|
|
4
|
-
export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues,
|
|
4
|
+
export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues, u as useAtlantisTheme } from './AtlantisThemeContext-es.js';
|
|
5
|
+
export { u as updateTheme } from './updateTheme-es.js';
|
|
5
6
|
export { A as Autocomplete } from './Autocomplete-es.js';
|
|
6
7
|
import 'react';
|
|
7
8
|
import 'classnames';
|
|
@@ -101,6 +102,7 @@ import './_isIterateeCall-es.js';
|
|
|
101
102
|
import './_setToString-es.js';
|
|
102
103
|
import './tslib.es6-es.js';
|
|
103
104
|
import './useOnKeyDown-es.js';
|
|
105
|
+
import './useDebounce-es.js';
|
|
104
106
|
import './debounce-es.js';
|
|
105
107
|
import './isSymbol-es.js';
|
|
106
108
|
import 'color';
|
package/dist/styles.css
CHANGED
|
@@ -7230,10 +7230,21 @@ html.atlantisLightBoxActive {
|
|
|
7230
7230
|
}
|
|
7231
7231
|
}
|
|
7232
7232
|
}
|
|
7233
|
+
.i9Tw1T65W-k- {
|
|
7234
|
+
position: absolute;
|
|
7235
|
+
top: 0;
|
|
7236
|
+
right: 0;
|
|
7237
|
+
bottom: 0;
|
|
7238
|
+
left: 0;
|
|
7239
|
+
background-position: center center;
|
|
7240
|
+
background-repeat: no-repeat;
|
|
7241
|
+
background-size: cover;
|
|
7242
|
+
opacity: 0.6;
|
|
7243
|
+
-webkit-filter: saturate(67%);
|
|
7244
|
+
filter: saturate(67%);
|
|
7245
|
+
}
|
|
7233
7246
|
.Q8amcRaTGf0-,
|
|
7234
7247
|
.W9FVb24yJrk- {
|
|
7235
|
-
display: -ms-flexbox;
|
|
7236
|
-
display: flex;
|
|
7237
7248
|
position: absolute;
|
|
7238
7249
|
top: 50%;
|
|
7239
7250
|
z-index: 1;
|
|
@@ -7242,75 +7253,157 @@ html.atlantisLightBoxActive {
|
|
|
7242
7253
|
transform: translateY(-50%);
|
|
7243
7254
|
}
|
|
7244
7255
|
.Q8amcRaTGf0- {
|
|
7245
|
-
right:
|
|
7246
|
-
right: var(--space-
|
|
7256
|
+
right: 24px;
|
|
7257
|
+
right: var(--space-large);
|
|
7247
7258
|
}
|
|
7259
|
+
@media (min-width: 768px) {
|
|
7260
|
+
.Q8amcRaTGf0- {
|
|
7261
|
+
right: 32px;
|
|
7262
|
+
right: var(--space-larger);
|
|
7263
|
+
}
|
|
7264
|
+
}
|
|
7265
|
+
@media (--medium-screens-and-up) {
|
|
7266
|
+
.Q8amcRaTGf0- {
|
|
7267
|
+
right: 32px;
|
|
7268
|
+
right: var(--space-larger);
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7248
7271
|
.W9FVb24yJrk- {
|
|
7249
|
-
left:
|
|
7250
|
-
left: var(--space-
|
|
7272
|
+
left: 24px;
|
|
7273
|
+
left: var(--space-large);
|
|
7274
|
+
}
|
|
7275
|
+
@media (min-width: 768px) {
|
|
7276
|
+
.W9FVb24yJrk- {
|
|
7277
|
+
left: 32px;
|
|
7278
|
+
left: var(--space-larger);
|
|
7279
|
+
}
|
|
7280
|
+
}
|
|
7281
|
+
@media (--medium-screens-and-up) {
|
|
7282
|
+
.W9FVb24yJrk- {
|
|
7283
|
+
left: 32px;
|
|
7284
|
+
left: var(--space-larger);
|
|
7285
|
+
}
|
|
7286
|
+
}
|
|
7287
|
+
.nsN0TPWsBXI- {
|
|
7288
|
+
opacity: 0;
|
|
7289
|
+
transition: opacity 200ms ease-in;
|
|
7290
|
+
transition: opacity var(--timing-base) ease-in;
|
|
7291
|
+
}
|
|
7292
|
+
.nsN0TPWsBXI-:hover,
|
|
7293
|
+
.nsN0TPWsBXI-:focus-within {
|
|
7294
|
+
opacity: 1;
|
|
7295
|
+
}
|
|
7296
|
+
.dkLYp7AD2jE- {
|
|
7297
|
+
opacity: 1;
|
|
7298
|
+
transition: opacity 200ms ease-in;
|
|
7299
|
+
transition: opacity var(--timing-base) ease-in;
|
|
7251
7300
|
}
|
|
7252
7301
|
._5p2iAj4JfoE- {
|
|
7253
7302
|
display: -ms-flexbox;
|
|
7254
7303
|
display: flex;
|
|
7255
7304
|
position: fixed;
|
|
7256
7305
|
top: 0;
|
|
7306
|
+
right: 0;
|
|
7307
|
+
bottom: 0;
|
|
7257
7308
|
left: 0;
|
|
7258
7309
|
z-index: 1001;
|
|
7259
7310
|
z-index: var(--elevation-modal);
|
|
7260
|
-
width: 100%;
|
|
7261
|
-
height: 100%;
|
|
7262
|
-
|
|
7263
|
-
|
|
7311
|
+
max-width: 100%;
|
|
7312
|
+
max-height: 100%;
|
|
7313
|
+
padding: 16px;
|
|
7314
|
+
padding: var(--space-base);
|
|
7315
|
+
background-color: hsl(0, 0%, 72%);
|
|
7316
|
+
background-color: var(--color-base-grey--400);
|
|
7317
|
+
-ms-flex-pack: center;
|
|
7318
|
+
justify-content: center;
|
|
7264
7319
|
-ms-flex-direction: column;
|
|
7265
7320
|
flex-direction: column;
|
|
7266
7321
|
}
|
|
7322
|
+
@media (min-width: 768px) {
|
|
7323
|
+
._5p2iAj4JfoE- {
|
|
7324
|
+
padding: 16px 32px;
|
|
7325
|
+
padding: var(--space-base) var(--space-larger);
|
|
7326
|
+
}
|
|
7327
|
+
}
|
|
7328
|
+
@media (--medium-screens-and-up) {
|
|
7329
|
+
._5p2iAj4JfoE- {
|
|
7330
|
+
padding: 16px 32px;
|
|
7331
|
+
padding: var(--space-base) var(--space-larger);
|
|
7332
|
+
}
|
|
7333
|
+
}
|
|
7267
7334
|
.rMK4cKdOxFw- {
|
|
7268
|
-
display:
|
|
7269
|
-
display: flex;
|
|
7335
|
+
display: grid;
|
|
7270
7336
|
z-index: 1;
|
|
7271
7337
|
z-index: var(--elevation-base);
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
color: hsl(197, 15%, 45%);
|
|
7275
|
-
color: var(--color-text--secondary);
|
|
7338
|
+
margin-bottom: 48px;
|
|
7339
|
+
margin-bottom: var(--space-largest);
|
|
7276
7340
|
font-size: 16px;
|
|
7277
7341
|
font-size: var(--typography--fontSize-large);
|
|
7278
|
-
background-color: hsl(53, 21%, 93%);
|
|
7279
|
-
background-color: var(--color-surface--background);
|
|
7280
|
-
-ms-flex-pack: justify;
|
|
7281
|
-
justify-content: space-between;
|
|
7282
|
-
}
|
|
7283
|
-
.tZU2g-NYdIs- {
|
|
7284
|
-
display: -ms-inline-flexbox;
|
|
7285
|
-
display: inline-flex;
|
|
7286
7342
|
-ms-flex-align: center;
|
|
7287
7343
|
align-items: center;
|
|
7344
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
7345
|
+
}
|
|
7346
|
+
._0m6vb11DgiA- {
|
|
7347
|
+
grid-column: 3;
|
|
7348
|
+
justify-self: end;
|
|
7349
|
+
}
|
|
7350
|
+
.kCc68gGuTgg- {
|
|
7351
|
+
grid-column: 2;
|
|
7352
|
+
justify-self: center;
|
|
7353
|
+
}
|
|
7354
|
+
.yYFVVScosfQ- {
|
|
7355
|
+
position: absolute;
|
|
7356
|
+
width: 100%;
|
|
7357
|
+
height: 100%;
|
|
7358
|
+
-o-object-fit: contain;
|
|
7359
|
+
object-fit: contain;
|
|
7360
|
+
}
|
|
7361
|
+
.UskuwLHR6fg- {
|
|
7362
|
+
position: relative;
|
|
7363
|
+
height: 100%;
|
|
7364
|
+
max-width: 100%;
|
|
7365
|
+
margin-bottom: 24px;
|
|
7366
|
+
margin-bottom: var(--space-large);
|
|
7367
|
+
}
|
|
7368
|
+
@media (min-width: 768px) {
|
|
7369
|
+
.UskuwLHR6fg- {
|
|
7370
|
+
margin: 0 calc(48px + 16px) 24px;
|
|
7371
|
+
margin: 0 calc(var(--space-largest) + var(--space-base)) var(--space-large);
|
|
7372
|
+
}
|
|
7373
|
+
}
|
|
7374
|
+
@media (--medium-screens-and-up) {
|
|
7375
|
+
.UskuwLHR6fg- {
|
|
7376
|
+
margin: 0 calc(48px + 16px) 24px;
|
|
7377
|
+
margin: 0 calc(var(--space-largest) + var(--space-base)) var(--space-large);
|
|
7288
7378
|
}
|
|
7289
|
-
|
|
7379
|
+
}
|
|
7380
|
+
.OGjhge-r-U4- {
|
|
7290
7381
|
display: -ms-flexbox;
|
|
7291
7382
|
display: flex;
|
|
7292
|
-
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7383
|
+
z-index: 1;
|
|
7384
|
+
z-index: var(--elevation-base);
|
|
7385
|
+
max-width: 600px;
|
|
7386
|
+
max-height: 90px;
|
|
7387
|
+
margin: 0 auto 32px;
|
|
7388
|
+
margin: 0 auto var(--space-larger);
|
|
7389
|
+
overflow-y: auto;
|
|
7390
|
+
text-align: center;
|
|
7391
|
+
-ms-flex-direction: column;
|
|
7392
|
+
flex-direction: column;
|
|
7393
|
+
-ms-flex-negative: 0;
|
|
7394
|
+
flex-shrink: 0;
|
|
7395
|
+
gap: 8px;
|
|
7396
|
+
gap: var(--space-small);
|
|
7298
7397
|
}
|
|
7299
|
-
.
|
|
7398
|
+
.GKIdLTmvcvQ- {
|
|
7300
7399
|
position: fixed;
|
|
7301
7400
|
top: 0;
|
|
7302
7401
|
right: 0;
|
|
7303
7402
|
bottom: 0;
|
|
7304
7403
|
left: 0;
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
.yYFVVScosfQ- {
|
|
7309
|
-
position: absolute;
|
|
7310
|
-
top: 50%;
|
|
7311
|
-
max-width: 100%;
|
|
7312
|
-
max-height: 100%;
|
|
7313
|
-
margin: auto;
|
|
7404
|
+
-webkit-backdrop-filter: blur(30px);
|
|
7405
|
+
backdrop-filter: blur(30px);
|
|
7406
|
+
background-color: rgba(3, 43, 58, 0.25);
|
|
7314
7407
|
}
|
|
7315
7408
|
|
|
7316
7409
|
._0X4jj5NERa4- {
|