@jobber/components 6.16.0 → 6.16.1-add-thumbn-d61b6d7.31

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.
@@ -23,11 +23,11 @@ function Banner({ children, type, primaryAction, dismissible = true, icon, onDis
23
23
  if (primaryAction != undefined) {
24
24
  primaryAction = Object.assign({
25
25
  size: "small",
26
- type: "tertiary",
27
- variation: type === "notice" ? "learning" : "work",
26
+ type: "primary",
27
+ variation: "subtle",
28
28
  }, primaryAction);
29
29
  }
30
- const bannerClassNames = classnames(BannerIcon.styles.banner, {
30
+ const bannerClassNames = classnames(BannerIcon.styles.banner, [BannerIcon.styles[type]], {
31
31
  [BannerIcon.styles.medium]: bannerWidth >= bannerWidths.medium,
32
32
  });
33
33
  if (!visible)
package/dist/Banner-es.js CHANGED
@@ -21,11 +21,11 @@ function Banner({ children, type, primaryAction, dismissible = true, icon, onDis
21
21
  if (primaryAction != undefined) {
22
22
  primaryAction = Object.assign({
23
23
  size: "small",
24
- type: "tertiary",
25
- variation: type === "notice" ? "learning" : "work",
24
+ type: "primary",
25
+ variation: "subtle",
26
26
  }, primaryAction);
27
27
  }
28
- const bannerClassNames = classnames(styles.banner, {
28
+ const bannerClassNames = classnames(styles.banner, [styles[type]], {
29
29
  [styles.medium]: bannerWidth >= bannerWidths.medium,
30
30
  });
31
31
  if (!visible)
@@ -4,7 +4,7 @@ var React = require('react');
4
4
  var classnames = require('classnames');
5
5
  var Icon = require('./Icon-cjs.js');
6
6
 
7
- var styles = {"banner":"ucGelS5nNm0-","bannerChildren":"dG2vHE6g8f0-","bannerContent":"j9IeihCCYxI-","medium":"D5X29shmSr0-","bannerAction":"W0pSTO-oRmk-","closeButton":"-IYYDBmq2Q0-","iconWrapper":"BQhacg0OlMs-","spinning":"fZdByimVT5Q-"};
7
+ var styles = {"banner":"ucGelS5nNm0-","notice":"_5VzH3Cz9ps8-","error":"_16jyB9OYJIs-","warning":"_4h-6cc8lZo8-","success":"k7T2IV0R8Q0-","bannerChildren":"dG2vHE6g8f0-","bannerContent":"j9IeihCCYxI-","medium":"D5X29shmSr0-","bannerAction":"W0pSTO-oRmk-","closeButton":"-IYYDBmq2Q0-","iconWrapper":"BQhacg0OlMs-","spinning":"fZdByimVT5Q-"};
8
8
 
9
9
  var iconStyles = {"success":"RRQ5CQj05jU-","error":"rLsOR1QiHC8-","warning":"KqPf0zuN2fg-","notice":"M3q29PUUYRM-","spinning":"ad7f3jNTQXM-"};
10
10
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { I as Icon } from './Icon-es.js';
4
4
 
5
- var styles = {"banner":"ucGelS5nNm0-","bannerChildren":"dG2vHE6g8f0-","bannerContent":"j9IeihCCYxI-","medium":"D5X29shmSr0-","bannerAction":"W0pSTO-oRmk-","closeButton":"-IYYDBmq2Q0-","iconWrapper":"BQhacg0OlMs-","spinning":"fZdByimVT5Q-"};
5
+ var styles = {"banner":"ucGelS5nNm0-","notice":"_5VzH3Cz9ps8-","error":"_16jyB9OYJIs-","warning":"_4h-6cc8lZo8-","success":"k7T2IV0R8Q0-","bannerChildren":"dG2vHE6g8f0-","bannerContent":"j9IeihCCYxI-","medium":"D5X29shmSr0-","bannerAction":"W0pSTO-oRmk-","closeButton":"-IYYDBmq2Q0-","iconWrapper":"BQhacg0OlMs-","spinning":"fZdByimVT5Q-"};
6
6
 
7
7
  var iconStyles = {"success":"RRQ5CQj05jU-","error":"rLsOR1QiHC8-","warning":"KqPf0zuN2fg-","notice":"M3q29PUUYRM-","spinning":"ad7f3jNTQXM-"};
8
8
 
@@ -1,6 +1,7 @@
1
1
  interface PresentedImage {
2
2
  title?: string;
3
3
  caption?: string;
4
+ alt?: string;
4
5
  url: string;
5
6
  }
6
7
  interface RequestCloseOptions {
@@ -13,7 +14,7 @@ interface LightBoxProps {
13
14
  readonly open: boolean;
14
15
  /**
15
16
  * Images is an array of objects defining a LightBox image. This object consists of
16
- * `title`, `caption` and `url`. `title` and `caption` are optional, `url` is
17
+ * `title`, `caption`, `alt` and `url`. `title`, `alt` and `caption` are optional, `url` is
17
18
  * required, for each image.
18
19
  */
19
20
  readonly images: PresentedImage[];
@@ -9,6 +9,7 @@ require('../useOnKeyDown-cjs.js');
9
9
  require('../useFocusTrap-cjs.js');
10
10
  require('../useIsMounted-cjs.js');
11
11
  require('../useSafeLayoutEffect-cjs.js');
12
+ require('classnames');
12
13
  require('../useDebounce-cjs.js');
13
14
  require('../debounce-cjs.js');
14
15
  require('../_commonjsHelpers-cjs.js');
@@ -16,7 +17,6 @@ require('../isObjectLike-cjs.js');
16
17
  require('../isSymbol-cjs.js');
17
18
  require('../ButtonDismiss-cjs.js');
18
19
  require('../Button-cjs.js');
19
- require('classnames');
20
20
  require('react-router-dom');
21
21
  require('../Icon-cjs.js');
22
22
  require('@jobber/design');
@@ -7,6 +7,7 @@ import '../useOnKeyDown-es.js';
7
7
  import '../useFocusTrap-es.js';
8
8
  import '../useIsMounted-es.js';
9
9
  import '../useSafeLayoutEffect-es.js';
10
+ import 'classnames';
10
11
  import '../useDebounce-es.js';
11
12
  import '../debounce-es.js';
12
13
  import '../_commonjsHelpers-es.js';
@@ -14,7 +15,6 @@ import '../isObjectLike-es.js';
14
15
  import '../isSymbol-es.js';
15
16
  import '../ButtonDismiss-es.js';
16
17
  import '../Button-es.js';
17
- import 'classnames';
18
18
  import 'react-router-dom';
19
19
  import '../Icon-es.js';
20
20
  import '@jobber/design';
@@ -7,6 +7,7 @@ var useRefocusOnActivator = require('./useRefocusOnActivator-cjs.js');
7
7
  var useOnKeyDown = require('./useOnKeyDown-cjs.js');
8
8
  var useFocusTrap = require('./useFocusTrap-cjs.js');
9
9
  var useIsMounted = require('./useIsMounted-cjs.js');
10
+ var classnames = require('classnames');
10
11
  var useDebounce = require('./useDebounce-cjs.js');
11
12
  var ButtonDismiss = require('./ButtonDismiss-cjs.js');
12
13
  var Text = require('./Text-cjs.js');
@@ -72,7 +73,7 @@ var useMediaQuery = {};
72
73
  }
73
74
  } (useBreakpoints));
74
75
 
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-"};
76
+ 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-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
76
77
 
77
78
  /* eslint-disable max-statements */
78
79
  const swipeConfidenceThreshold = 10000;
@@ -82,26 +83,20 @@ const swipePower = (offset, velocity) => {
82
83
  const variants = {
83
84
  enter: (direction) => {
84
85
  return {
85
- x: direction > 0 ? 1000 : -1000,
86
- opacity: 0,
86
+ x: direction > 0 ? "150%" : "-150%",
87
87
  };
88
88
  },
89
89
  center: {
90
- zIndex: 1,
91
90
  x: 0,
92
- opacity: 1,
93
91
  },
94
92
  exit: (direction) => {
95
93
  return {
96
- zIndex: 0,
97
- x: direction < 0 ? 1000 : -1000,
98
- opacity: 0,
94
+ x: direction < 0 ? "150%" : "-150%",
99
95
  };
100
96
  },
101
97
  };
102
98
  const imageTransition = {
103
- x: { type: "spring", stiffness: 300, damping: 30 },
104
- opacity: { duration: 0.2 },
99
+ x: { duration: 0.65, ease: [0.42, 0, 0, 1.03] },
105
100
  };
106
101
  // A little bit more than the transition's duration
107
102
  // We're doing this to prevent a bug from framer-motion
@@ -113,6 +108,7 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
113
108
  const [direction, setDirection] = React.useState(0);
114
109
  const [mouseIsStationary, setMouseIsStationary] = React.useState(true);
115
110
  const lightboxRef = useFocusTrap.useFocusTrap_2(open);
111
+ const selectedThumbnailRef = React.useRef(null);
116
112
  const debouncedHandleNext = useDebounce.useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
117
113
  const debouncedHandlePrevious = useDebounce.useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
118
114
  const mounted = useIsMounted.useIsMounted_2();
@@ -135,6 +131,14 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
135
131
  prevOpen.current = open;
136
132
  togglePrintStyles(open);
137
133
  }
134
+ React.useEffect(() => {
135
+ var _a;
136
+ (_a = selectedThumbnailRef === null || selectedThumbnailRef === void 0 ? void 0 : selectedThumbnailRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
137
+ behavior: "smooth",
138
+ block: "nearest",
139
+ inline: "center",
140
+ });
141
+ }, [currentImageIndex]);
138
142
  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
143
  if (mouseIsStationary) {
140
144
  setMouseIsStationary(false);
@@ -153,15 +157,22 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
153
157
  React.createElement(ButtonDismiss.ButtonDismiss, { ariaLabel: "Close", onClick: handleRequestClose })))),
154
158
  React.createElement("div", { className: styles.imageArea },
155
159
  React.createElement(framerMotion.AnimatePresence, { initial: false },
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 }))),
160
+ React.createElement(framerMotion.motion.img, { key: currentImageIndex, variants: variants, src: images[currentImageIndex].url, custom: direction, className: styles.image, initial: "enter", alt: images[currentImageIndex].alt ||
161
+ images[currentImageIndex].title ||
162
+ "", animate: "center", exit: "exit", transition: imageTransition, drag: "x", dragConstraints: { left: 0, right: 0 }, dragElastic: 1, onDragEnd: handleOnDragEnd }))),
157
163
  images.length > 1 && (React.createElement(React.Fragment, null,
158
164
  React.createElement(PreviousButton, { onClick: debouncedHandlePrevious, hideButton: mouseIsStationary }),
159
165
  React.createElement(NextButton, { onClick: debouncedHandleNext, hideButton: mouseIsStationary }))),
160
166
  (images[currentImageIndex].title ||
161
167
  images[currentImageIndex].caption) && (React.createElement("div", { className: styles.captionWrapper },
162
168
  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)))))))));
169
+ images[currentImageIndex].title && (React.createElement("div", { className: styles.title },
170
+ React.createElement(Heading.Heading, { level: 4 }, images[currentImageIndex].title))),
171
+ images[currentImageIndex].caption && (React.createElement(Text.Text, { size: "large" }, images[currentImageIndex].caption))))),
172
+ images.length > 1 && (React.createElement("div", { className: styles.thumbnailBar, "data-testid": "ATL-Thumbnail-Bar" }, images.map((image, index) => (React.createElement("div", { key: index, className: classnames(styles.thumbnail, {
173
+ [styles.selected]: index === currentImageIndex,
174
+ }), onClick: () => handleThumbnailClick(index), ref: index === currentImageIndex ? selectedThumbnailRef : null },
175
+ React.createElement("img", { key: index, src: image.url, alt: image.alt || image.title || "", className: styles.thumbnailImage }))))))))));
165
176
  return mounted.current
166
177
  ? ReactDOM.createPortal(template, document.body)
167
178
  : template;
@@ -185,6 +196,15 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
185
196
  handleMovePrevious();
186
197
  }
187
198
  }
199
+ function handleThumbnailClick(index) {
200
+ if (index < currentImageIndex) {
201
+ setDirection(-1);
202
+ }
203
+ else {
204
+ setDirection(1);
205
+ }
206
+ setCurrentImageIndex(index);
207
+ }
188
208
  }
189
209
  function PreviousButton({ onClick, hideButton }) {
190
210
  const { mediumAndUp } = useBreakpoints.useBreakpoints();
@@ -5,6 +5,7 @@ import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
5
5
  import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
6
6
  import { u as useFocusTrap_2 } from './useFocusTrap-es.js';
7
7
  import { u as useIsMounted_2 } from './useIsMounted-es.js';
8
+ import classnames from 'classnames';
8
9
  import { u as useDebounce } from './useDebounce-es.js';
9
10
  import { B as ButtonDismiss } from './ButtonDismiss-es.js';
10
11
  import { T as Text } from './Text-es.js';
@@ -70,7 +71,7 @@ var useMediaQuery = {};
70
71
  }
71
72
  } (useBreakpoints));
72
73
 
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-"};
74
+ 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-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
74
75
 
75
76
  /* eslint-disable max-statements */
76
77
  const swipeConfidenceThreshold = 10000;
@@ -80,26 +81,20 @@ const swipePower = (offset, velocity) => {
80
81
  const variants = {
81
82
  enter: (direction) => {
82
83
  return {
83
- x: direction > 0 ? 1000 : -1000,
84
- opacity: 0,
84
+ x: direction > 0 ? "150%" : "-150%",
85
85
  };
86
86
  },
87
87
  center: {
88
- zIndex: 1,
89
88
  x: 0,
90
- opacity: 1,
91
89
  },
92
90
  exit: (direction) => {
93
91
  return {
94
- zIndex: 0,
95
- x: direction < 0 ? 1000 : -1000,
96
- opacity: 0,
92
+ x: direction < 0 ? "150%" : "-150%",
97
93
  };
98
94
  },
99
95
  };
100
96
  const imageTransition = {
101
- x: { type: "spring", stiffness: 300, damping: 30 },
102
- opacity: { duration: 0.2 },
97
+ x: { duration: 0.65, ease: [0.42, 0, 0, 1.03] },
103
98
  };
104
99
  // A little bit more than the transition's duration
105
100
  // We're doing this to prevent a bug from framer-motion
@@ -111,6 +106,7 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
111
106
  const [direction, setDirection] = useState(0);
112
107
  const [mouseIsStationary, setMouseIsStationary] = useState(true);
113
108
  const lightboxRef = useFocusTrap_2(open);
109
+ const selectedThumbnailRef = useRef(null);
114
110
  const debouncedHandleNext = useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
115
111
  const debouncedHandlePrevious = useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
116
112
  const mounted = useIsMounted_2();
@@ -133,6 +129,14 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
133
129
  prevOpen.current = open;
134
130
  togglePrintStyles(open);
135
131
  }
132
+ useEffect(() => {
133
+ var _a;
134
+ (_a = selectedThumbnailRef === null || selectedThumbnailRef === void 0 ? void 0 : selectedThumbnailRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
135
+ behavior: "smooth",
136
+ block: "nearest",
137
+ inline: "center",
138
+ });
139
+ }, [currentImageIndex]);
136
140
  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
141
  if (mouseIsStationary) {
138
142
  setMouseIsStationary(false);
@@ -151,15 +155,22 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
151
155
  React.createElement(ButtonDismiss, { ariaLabel: "Close", onClick: handleRequestClose })))),
152
156
  React.createElement("div", { className: styles.imageArea },
153
157
  React.createElement(AnimatePresence, { initial: false },
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 }))),
158
+ React.createElement(motion.img, { key: currentImageIndex, variants: variants, src: images[currentImageIndex].url, custom: direction, className: styles.image, initial: "enter", alt: images[currentImageIndex].alt ||
159
+ images[currentImageIndex].title ||
160
+ "", animate: "center", exit: "exit", transition: imageTransition, drag: "x", dragConstraints: { left: 0, right: 0 }, dragElastic: 1, onDragEnd: handleOnDragEnd }))),
155
161
  images.length > 1 && (React.createElement(React.Fragment, null,
156
162
  React.createElement(PreviousButton, { onClick: debouncedHandlePrevious, hideButton: mouseIsStationary }),
157
163
  React.createElement(NextButton, { onClick: debouncedHandleNext, hideButton: mouseIsStationary }))),
158
164
  (images[currentImageIndex].title ||
159
165
  images[currentImageIndex].caption) && (React.createElement("div", { className: styles.captionWrapper },
160
166
  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)))))))));
167
+ images[currentImageIndex].title && (React.createElement("div", { className: styles.title },
168
+ React.createElement(Heading, { level: 4 }, images[currentImageIndex].title))),
169
+ images[currentImageIndex].caption && (React.createElement(Text, { size: "large" }, images[currentImageIndex].caption))))),
170
+ images.length > 1 && (React.createElement("div", { className: styles.thumbnailBar, "data-testid": "ATL-Thumbnail-Bar" }, images.map((image, index) => (React.createElement("div", { key: index, className: classnames(styles.thumbnail, {
171
+ [styles.selected]: index === currentImageIndex,
172
+ }), onClick: () => handleThumbnailClick(index), ref: index === currentImageIndex ? selectedThumbnailRef : null },
173
+ React.createElement("img", { key: index, src: image.url, alt: image.alt || image.title || "", className: styles.thumbnailImage }))))))))));
163
174
  return mounted.current
164
175
  ? ReactDOM.createPortal(template, document.body)
165
176
  : template;
@@ -183,6 +194,15 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
183
194
  handleMovePrevious();
184
195
  }
185
196
  }
197
+ function handleThumbnailClick(index) {
198
+ if (index < currentImageIndex) {
199
+ setDirection(-1);
200
+ }
201
+ else {
202
+ setDirection(1);
203
+ }
204
+ setCurrentImageIndex(index);
205
+ }
186
206
  }
187
207
  function PreviousButton({ onClick, hideButton }) {
188
208
  const { mediumAndUp } = useBreakpoints.useBreakpoints();
@@ -5,6 +5,7 @@ require('react');
5
5
  require('react-popper');
6
6
  require('../useRefocusOnActivator-cjs.js');
7
7
  require('classnames');
8
+ require('react-dom');
8
9
  require('../ButtonDismiss-cjs.js');
9
10
  require('../Button-cjs.js');
10
11
  require('react-router-dom');
@@ -3,6 +3,7 @@ import 'react';
3
3
  import 'react-popper';
4
4
  import '../useRefocusOnActivator-es.js';
5
5
  import 'classnames';
6
+ import 'react-dom';
6
7
  import '../ButtonDismiss-es.js';
7
8
  import '../Button-es.js';
8
9
  import 'react-router-dom';
@@ -4,6 +4,7 @@ var React = require('react');
4
4
  var reactPopper = require('react-popper');
5
5
  var useRefocusOnActivator = require('./useRefocusOnActivator-cjs.js');
6
6
  var classnames = require('classnames');
7
+ var ReactDOM = require('react-dom');
7
8
  var ButtonDismiss = require('./ButtonDismiss-cjs.js');
8
9
 
9
10
  var classes = {"popover":"rY8OtuArIi0-","header":"UI1AohefbSo-","dismissButton":"HyA0TM5soDM-","arrow":"uClo-5-xhAc-","spinning":"VA0ROLmpLPs-"};
@@ -20,11 +21,12 @@ function Popover({ onRequestClose, children, attachTo, open, preferredPlacement
20
21
  const popoverClassNames = classnames(classes.popover, UNSAFE_className.container);
21
22
  const dismissButtonClassNames = classnames(classes.dismissButton, UNSAFE_className.dismissButtonContainer);
22
23
  const arrowClassNames = classnames(classes.arrow, UNSAFE_className.arrow);
23
- return (React.createElement(React.Fragment, null, open && (React.createElement("div", Object.assign({ role: "dialog", "data-elevation": "elevated", ref: setPopperElement, style: Object.assign(Object.assign({}, popperStyles.popper), ((_a = UNSAFE_style.container) !== null && _a !== void 0 ? _a : {})), className: popoverClassNames }, attributes.popper, { "data-testid": "popover-container" }),
24
+ const popoverContent = (React.createElement("div", Object.assign({ role: "dialog", "data-elevation": "elevated", ref: setPopperElement, style: Object.assign(Object.assign({}, popperStyles.popper), ((_a = UNSAFE_style.container) !== null && _a !== void 0 ? _a : {})), className: popoverClassNames }, attributes.popper, { "data-testid": "popover-container" }),
24
25
  React.createElement("div", { className: dismissButtonClassNames, style: (_b = UNSAFE_style.dismissButtonContainer) !== null && _b !== void 0 ? _b : {}, "data-testid": "popover-dismiss-button-container" },
25
26
  React.createElement(ButtonDismiss.ButtonDismiss, { onClick: onRequestClose, ariaLabel: "Close dialog" })),
26
27
  children,
27
- React.createElement("div", { ref: setArrowElement, className: arrowClassNames, style: Object.assign(Object.assign({}, popperStyles.arrow), ((_c = UNSAFE_style.arrow) !== null && _c !== void 0 ? _c : {})), "data-testid": "popover-arrow" })))));
28
+ React.createElement("div", { ref: setArrowElement, className: arrowClassNames, style: Object.assign(Object.assign({}, popperStyles.arrow), ((_c = UNSAFE_style.arrow) !== null && _c !== void 0 ? _c : {})), "data-testid": "popover-arrow" })));
29
+ return React.createElement(React.Fragment, null, open && ReactDOM.createPortal(popoverContent, document.body));
28
30
  }
29
31
  function buildModifiers(arrowElement) {
30
32
  const modifiers = [
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
2
2
  import { usePopper } from 'react-popper';
3
3
  import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
4
4
  import classnames from 'classnames';
5
+ import ReactDOM from 'react-dom';
5
6
  import { B as ButtonDismiss } from './ButtonDismiss-es.js';
6
7
 
7
8
  var classes = {"popover":"rY8OtuArIi0-","header":"UI1AohefbSo-","dismissButton":"HyA0TM5soDM-","arrow":"uClo-5-xhAc-","spinning":"VA0ROLmpLPs-"};
@@ -18,11 +19,12 @@ function Popover({ onRequestClose, children, attachTo, open, preferredPlacement
18
19
  const popoverClassNames = classnames(classes.popover, UNSAFE_className.container);
19
20
  const dismissButtonClassNames = classnames(classes.dismissButton, UNSAFE_className.dismissButtonContainer);
20
21
  const arrowClassNames = classnames(classes.arrow, UNSAFE_className.arrow);
21
- return (React.createElement(React.Fragment, null, open && (React.createElement("div", Object.assign({ role: "dialog", "data-elevation": "elevated", ref: setPopperElement, style: Object.assign(Object.assign({}, popperStyles.popper), ((_a = UNSAFE_style.container) !== null && _a !== void 0 ? _a : {})), className: popoverClassNames }, attributes.popper, { "data-testid": "popover-container" }),
22
+ const popoverContent = (React.createElement("div", Object.assign({ role: "dialog", "data-elevation": "elevated", ref: setPopperElement, style: Object.assign(Object.assign({}, popperStyles.popper), ((_a = UNSAFE_style.container) !== null && _a !== void 0 ? _a : {})), className: popoverClassNames }, attributes.popper, { "data-testid": "popover-container" }),
22
23
  React.createElement("div", { className: dismissButtonClassNames, style: (_b = UNSAFE_style.dismissButtonContainer) !== null && _b !== void 0 ? _b : {}, "data-testid": "popover-dismiss-button-container" },
23
24
  React.createElement(ButtonDismiss, { onClick: onRequestClose, ariaLabel: "Close dialog" })),
24
25
  children,
25
- React.createElement("div", { ref: setArrowElement, className: arrowClassNames, style: Object.assign(Object.assign({}, popperStyles.arrow), ((_c = UNSAFE_style.arrow) !== null && _c !== void 0 ? _c : {})), "data-testid": "popover-arrow" })))));
26
+ React.createElement("div", { ref: setArrowElement, className: arrowClassNames, style: Object.assign(Object.assign({}, popperStyles.arrow), ((_c = UNSAFE_style.arrow) !== null && _c !== void 0 ? _c : {})), "data-testid": "popover-arrow" })));
27
+ return React.createElement(React.Fragment, null, open && ReactDOM.createPortal(popoverContent, document.body));
26
28
  }
27
29
  function buildModifiers(arrowElement) {
28
30
  const modifiers = [
package/dist/styles.css CHANGED
@@ -1656,35 +1656,58 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
1656
1656
  }
1657
1657
 
1658
1658
  .ucGelS5nNm0- {
1659
+ --banner-surface: var(--color-surface);
1660
+ --banner-textColor: var(--color-text);
1659
1661
  display: -ms-flexbox;
1660
1662
  display: flex;
1661
1663
  position: relative;
1662
- box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 12px 0px rgba(0, 0, 0, 0.05);
1663
- box-shadow: var(--shadow-base);
1664
1664
  padding: calc(16px - 4px) 16px;
1665
1665
  padding: calc(var(--space-base) - var(--space-smaller)) var(--space-base);
1666
- border: 1px solid hsl(200, 13%, 87%);
1667
- border: var(--border-base) solid var(--color-border);
1668
1666
  border-radius: 8px;
1669
1667
  border-radius: var(--radius-base);
1670
1668
  color: hsl(198, 35%, 21%);
1671
- color: var(--color-text);
1669
+ color: var(--banner-textColor);
1672
1670
  background-color: rgba(255, 255, 255, 1);
1673
- background-color: var(--color-surface);
1671
+ background-color: var(--banner-surface);
1674
1672
  gap: 8px;
1675
1673
  gap: var(--space-small);
1676
1674
  -ms-flex-align: center;
1677
1675
  align-items: center;
1678
1676
  }
1679
1677
 
1678
+ ._5VzH3Cz9ps8- {
1679
+ --banner-surface: var(--color-informative--surface);
1680
+ --banner-textColor: var(--color-informative--onSurface);
1681
+ }
1682
+
1683
+ ._16jyB9OYJIs- {
1684
+ --banner-surface: var(--color-critical--surface);
1685
+ --banner-textColor: var(--color-critical--onSurface);
1686
+ }
1687
+
1688
+ ._4h-6cc8lZo8- {
1689
+ --banner-surface: var(--color-warning--surface);
1690
+ --banner-textColor: var(--color-warning--onSurface);
1691
+ }
1692
+
1693
+ .k7T2IV0R8Q0- {
1694
+ --banner-surface: var(--color-success--surface);
1695
+ --banner-textColor: var(--color-success--onSurface);
1696
+ }
1697
+
1698
+ .dG2vHE6g8f0- > a,
1699
+ .dG2vHE6g8f0- > p {
1700
+ color: inherit;
1701
+ }
1702
+
1680
1703
  .dG2vHE6g8f0- > a {
1681
- color: hsl(198, 35%, 21%);
1682
- color: var(--color-text);
1704
+ -webkit-text-decoration: underline;
1705
+ text-decoration: underline;
1683
1706
  }
1684
1707
 
1685
1708
  .dG2vHE6g8f0- > a:hover {
1686
1709
  color: hsl(197, 90%, 12%);
1687
- color: var(--color-blue);
1710
+ color: var(--color-heading);
1688
1711
  }
1689
1712
 
1690
1713
  .j9IeihCCYxI- {
@@ -1745,8 +1768,8 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
1745
1768
 
1746
1769
  .W0pSTO-oRmk- {
1747
1770
  width: 100%;
1748
- margin-top: 8px;
1749
- margin-top: var(--space-small);
1771
+ padding-left: 32px;
1772
+ padding-left: var(--space-larger);
1750
1773
  }
1751
1774
  }
1752
1775
 
@@ -1754,8 +1777,8 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
1754
1777
 
1755
1778
  .W0pSTO-oRmk- {
1756
1779
  width: 100%;
1757
- margin-top: 8px;
1758
- margin-top: var(--space-small);
1780
+ padding-left: 32px;
1781
+ padding-left: var(--space-larger);
1759
1782
  }
1760
1783
  }
1761
1784
 
@@ -1764,6 +1787,7 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
1764
1787
  margin: calc(var(--space-smallest) * -1) 0;
1765
1788
  -ms-flex-item-align: start;
1766
1789
  align-self: flex-start;
1790
+ mix-blend-mode: multiply;
1767
1791
  }
1768
1792
 
1769
1793
  @media (max-width: 489px) {
@@ -1782,6 +1806,10 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
1782
1806
  }
1783
1807
  }
1784
1808
 
1809
+ [data-theme="dark"] .-IYYDBmq2Q0- {
1810
+ mix-blend-mode: screen;
1811
+ }
1812
+
1785
1813
  .BQhacg0OlMs- {
1786
1814
  display: -ms-inline-flexbox;
1787
1815
  display: inline-flex;
@@ -7246,11 +7274,9 @@ html.atlantisLightBoxActive {
7246
7274
  .Q8amcRaTGf0-,
7247
7275
  .W9FVb24yJrk- {
7248
7276
  position: absolute;
7249
- top: 50%;
7277
+ top: 40%;
7250
7278
  z-index: 1;
7251
7279
  z-index: var(--elevation-base);
7252
- -webkit-transform: translateY(-50%);
7253
- transform: translateY(-50%);
7254
7280
  }
7255
7281
  .Q8amcRaTGf0- {
7256
7282
  right: 24px;
@@ -7310,8 +7336,6 @@ html.atlantisLightBoxActive {
7310
7336
  z-index: var(--elevation-modal);
7311
7337
  max-width: 100%;
7312
7338
  max-height: 100%;
7313
- padding: 16px;
7314
- padding: var(--space-base);
7315
7339
  background-color: hsl(0, 0%, 72%);
7316
7340
  background-color: var(--color-base-grey--400);
7317
7341
  -ms-flex-pack: center;
@@ -7319,24 +7343,14 @@ html.atlantisLightBoxActive {
7319
7343
  -ms-flex-direction: column;
7320
7344
  flex-direction: column;
7321
7345
  }
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
- }
7334
7346
  .rMK4cKdOxFw- {
7335
7347
  display: grid;
7336
7348
  z-index: 1;
7337
7349
  z-index: var(--elevation-base);
7338
7350
  margin-bottom: 48px;
7339
7351
  margin-bottom: var(--space-largest);
7352
+ padding: 16px 16px 0;
7353
+ padding: var(--space-base) var(--space-base) 0;
7340
7354
  font-size: 16px;
7341
7355
  font-size: var(--typography--fontSize-large);
7342
7356
  -ms-flex-align: center;
@@ -7355,26 +7369,34 @@ html.atlantisLightBoxActive {
7355
7369
  position: absolute;
7356
7370
  width: 100%;
7357
7371
  height: 100%;
7358
- -o-object-fit: contain;
7359
- object-fit: contain;
7372
+ -o-object-fit: scale-down;
7373
+ object-fit: scale-down;
7360
7374
  }
7361
7375
  .UskuwLHR6fg- {
7362
7376
  position: relative;
7363
7377
  height: 100%;
7364
7378
  max-width: 100%;
7365
- margin-bottom: 24px;
7366
- margin-bottom: var(--space-large);
7379
+ margin: 0 16px 24px;
7380
+ margin: 0 var(--space-base) var(--space-large);
7367
7381
  }
7368
7382
  @media (min-width: 768px) {
7369
7383
  .UskuwLHR6fg- {
7370
- margin: 0 calc(48px + 16px) 24px;
7371
- margin: 0 calc(var(--space-largest) + var(--space-base)) var(--space-large);
7384
+ margin: 0
7385
+ calc(48px + 16px + 24px)
7386
+ 24px;
7387
+ margin: 0 /* nav button width + inner padding + outer margin */
7388
+ calc(var(--space-largest) + var(--space-base) + var(--space-large))
7389
+ var(--space-large);
7372
7390
  }
7373
7391
  }
7374
7392
  @media (--medium-screens-and-up) {
7375
7393
  .UskuwLHR6fg- {
7376
- margin: 0 calc(48px + 16px) 24px;
7377
- margin: 0 calc(var(--space-largest) + var(--space-base)) var(--space-large);
7394
+ margin: 0
7395
+ calc(48px + 16px + 24px)
7396
+ 24px;
7397
+ margin: 0 /* nav button width + inner padding + outer margin */
7398
+ calc(var(--space-largest) + var(--space-base) + var(--space-large))
7399
+ var(--space-large);
7378
7400
  }
7379
7401
  }
7380
7402
  .OGjhge-r-U4- {
@@ -7386,8 +7408,9 @@ html.atlantisLightBoxActive {
7386
7408
  max-height: 90px;
7387
7409
  margin: 0 auto 32px;
7388
7410
  margin: 0 auto var(--space-larger);
7411
+ padding: 0 16px;
7412
+ padding: 0 var(--space-base);
7389
7413
  overflow-y: auto;
7390
- text-align: center;
7391
7414
  -ms-flex-direction: column;
7392
7415
  flex-direction: column;
7393
7416
  -ms-flex-negative: 0;
@@ -7395,6 +7418,9 @@ html.atlantisLightBoxActive {
7395
7418
  gap: 8px;
7396
7419
  gap: var(--space-small);
7397
7420
  }
7421
+ .tZU2g-NYdIs- {
7422
+ text-align: center;
7423
+ }
7398
7424
  .GKIdLTmvcvQ- {
7399
7425
  position: fixed;
7400
7426
  top: 0;
@@ -7405,6 +7431,113 @@ html.atlantisLightBoxActive {
7405
7431
  backdrop-filter: blur(30px);
7406
7432
  background-color: rgba(3, 43, 58, 0.25);
7407
7433
  }
7434
+ ._3TfQLQEE3GQ- {
7435
+ display: -ms-flexbox;
7436
+ display: flex;
7437
+ position: relative;
7438
+ z-index: 1;
7439
+ z-index: var(--elevation-base);
7440
+ width: 100%;
7441
+ min-height: 92px;
7442
+ margin-bottom: 8px;
7443
+ margin-bottom: var(--space-small);
7444
+ padding-bottom: 8px;
7445
+ padding-bottom: var(--space-small);
7446
+ overflow-x: scroll;
7447
+ -ms-flex-pack: safe center;
7448
+ justify-content: safe center;
7449
+ -ms-flex-align: center;
7450
+ align-items: center;
7451
+ gap: 8px;
7452
+ gap: var(--space-small);
7453
+ -ms-flex-negative: 0;
7454
+ flex-shrink: 0;
7455
+
7456
+ scrollbar-width: thin;
7457
+ scrollbar-color: hsl(198, 35%, 21%) transparent;
7458
+ scrollbar-color: var(--color-interactive--subtle) transparent;
7459
+ }
7460
+ ._3TfQLQEE3GQ-::-webkit-scrollbar {
7461
+ height: 8px;
7462
+ }
7463
+ ._3TfQLQEE3GQ-::-webkit-scrollbar-track {
7464
+ background: transparent;
7465
+ }
7466
+ ._3TfQLQEE3GQ-::-webkit-scrollbar-thumb {
7467
+ border-radius: 4px;
7468
+ border-radius: var(--radius-small);
7469
+ background: hsl(198, 35%, 21%);
7470
+ background: var(--color-interactive--subtle);
7471
+ }
7472
+ .eBMzUOlcfQ4- {
7473
+ width: 100%;
7474
+ height: 100%;
7475
+ border-radius: 4px;
7476
+ border-radius: var(--radius-small);
7477
+ opacity: 0.8;
7478
+ opacity: var(--opacity-overlay);
7479
+ -o-object-fit: cover;
7480
+ object-fit: cover;
7481
+ }
7482
+ .eapm2zruLn8- {
7483
+ width: 64px;
7484
+ height: 64px;
7485
+ border-radius: 4px;
7486
+ border-radius: var(--radius-small);
7487
+ background-color: rgba(255, 255, 255, 1);
7488
+ background-color: var(--color-surface);
7489
+ transition:
7490
+ border 200ms ease-in,
7491
+ -webkit-transform 100ms ease-in-out;
7492
+ transition:
7493
+ border var(--timing-base) ease-in,
7494
+ -webkit-transform var(--timing-quick) ease-in-out;
7495
+ transition:
7496
+ border 200ms ease-in,
7497
+ transform 100ms ease-in-out;
7498
+ transition:
7499
+ border var(--timing-base) ease-in,
7500
+ transform var(--timing-quick) ease-in-out;
7501
+ transition:
7502
+ border 200ms ease-in,
7503
+ transform 100ms ease-in-out,
7504
+ -webkit-transform 100ms ease-in-out;
7505
+ transition:
7506
+ border var(--timing-base) ease-in,
7507
+ transform var(--timing-quick) ease-in-out,
7508
+ -webkit-transform var(--timing-quick) ease-in-out;
7509
+ -ms-flex-negative: 0;
7510
+ flex-shrink: 0;
7511
+ }
7512
+ .eapm2zruLn8-:hover {
7513
+ cursor: pointer;
7514
+ }
7515
+ .eapm2zruLn8-.PeLn2u-QB0k- {
7516
+ margin: 0 4px;
7517
+ margin: 0 var(--space-smaller);
7518
+ padding: 2px;
7519
+ padding: var(--space-smallest);
7520
+ border: 2px solid rgba(255, 255, 255, 1);
7521
+ border: 2px solid var(--color-surface);
7522
+ background-color: transparent;
7523
+ -webkit-transform: scale(1.125);
7524
+ transform: scale(1.125);
7525
+ }
7526
+ .eapm2zruLn8-.PeLn2u-QB0k- .eBMzUOlcfQ4- {
7527
+ opacity: 1;
7528
+ transition: opacity 200ms linear;
7529
+ transition: opacity var(--timing-base) linear;
7530
+ }
7531
+ .eapm2zruLn8-:first-child,
7532
+ .eapm2zruLn8-.PeLn2u-QB0k-:first-child {
7533
+ margin-left: 16px;
7534
+ margin-left: var(--space-base);
7535
+ }
7536
+ .eapm2zruLn8-:last-child,
7537
+ .eapm2zruLn8-.PeLn2u-QB0k-:last-child {
7538
+ margin-right: 16px;
7539
+ margin-right: var(--space-base);
7540
+ }
7408
7541
 
7409
7542
  ._0X4jj5NERa4- {
7410
7543
  display: grid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.16.0",
3
+ "version": "6.16.1-add-thumbn-d61b6d7.31+d61b6d78",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -489,5 +489,5 @@
489
489
  "> 1%",
490
490
  "IE 10"
491
491
  ],
492
- "gitHead": "2e308bcccf914e471f8d82a72573e90d15e59bf8"
492
+ "gitHead": "d61b6d78c5305a629a60d5474aeec1b01b31316b"
493
493
  }