@jobber/components 6.20.6 → 6.20.8
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/LightBox/LightBox.d.ts +8 -1
- package/dist/LightBox-cjs.js +4 -2
- package/dist/LightBox-es.js +4 -2
- package/dist/styles.css +12 -5
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
1
2
|
interface PresentedImage {
|
|
2
3
|
title?: string;
|
|
3
4
|
caption?: string;
|
|
@@ -32,6 +33,12 @@ interface LightBoxProps {
|
|
|
32
33
|
* that has the index of the image the user was on when LightBox was closed.
|
|
33
34
|
*/
|
|
34
35
|
onRequestClose(options: RequestCloseOptions): void;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the box-sizing for the thumbnails in the lightbox. This is a solution for a problem where
|
|
38
|
+
* tailwind was setting the box-sizing to `border-box` and causing issues with the lightbox.
|
|
39
|
+
* @default "content-box"
|
|
40
|
+
*/
|
|
41
|
+
readonly boxSizing?: CSSProperties["boxSizing"];
|
|
35
42
|
}
|
|
36
|
-
export declare function LightBox({ open, images, imageIndex, onRequestClose, }: LightBoxProps): JSX.Element;
|
|
43
|
+
export declare function LightBox({ boxSizing, open, images, imageIndex, onRequestClose, }: LightBoxProps): JSX.Element;
|
|
37
44
|
export {};
|
package/dist/LightBox-cjs.js
CHANGED
|
@@ -103,7 +103,7 @@ const imageTransition = {
|
|
|
103
103
|
// https://github.com/framer/motion/issues/1769
|
|
104
104
|
const BUTTON_DEBOUNCE_DELAY = 250;
|
|
105
105
|
const MOVEMENT_DEBOUNCE_DELAY = 1000;
|
|
106
|
-
function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
106
|
+
function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onRequestClose, }) {
|
|
107
107
|
const [currentImageIndex, setCurrentImageIndex] = React.useState(imageIndex);
|
|
108
108
|
const [direction, setDirection] = React.useState(0);
|
|
109
109
|
const [mouseIsStationary, setMouseIsStationary] = React.useState(true);
|
|
@@ -169,7 +169,9 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
|
169
169
|
images[currentImageIndex].title && (React.createElement("div", { className: styles.title },
|
|
170
170
|
React.createElement(Heading.Heading, { level: 4 }, images[currentImageIndex].title))),
|
|
171
171
|
images[currentImageIndex].caption && (React.createElement(Text.Text, { size: "large" }, images[currentImageIndex].caption))))),
|
|
172
|
-
images.length > 1 && (React.createElement("div", { className: styles.thumbnailBar,
|
|
172
|
+
images.length > 1 && (React.createElement("div", { className: styles.thumbnailBar, style: {
|
|
173
|
+
"--lightbox--box-sizing": boxSizing,
|
|
174
|
+
}, "data-testid": "ATL-Thumbnail-Bar" }, images.map((image, index) => (React.createElement("div", { key: index, className: classnames(styles.thumbnail, {
|
|
173
175
|
[styles.selected]: index === currentImageIndex,
|
|
174
176
|
}), onClick: () => handleThumbnailClick(index), ref: index === currentImageIndex ? selectedThumbnailRef : null },
|
|
175
177
|
React.createElement("img", { key: index, src: image.url, alt: image.alt || image.title || "", className: styles.thumbnailImage }))))))))));
|
package/dist/LightBox-es.js
CHANGED
|
@@ -101,7 +101,7 @@ const imageTransition = {
|
|
|
101
101
|
// https://github.com/framer/motion/issues/1769
|
|
102
102
|
const BUTTON_DEBOUNCE_DELAY = 250;
|
|
103
103
|
const MOVEMENT_DEBOUNCE_DELAY = 1000;
|
|
104
|
-
function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
104
|
+
function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onRequestClose, }) {
|
|
105
105
|
const [currentImageIndex, setCurrentImageIndex] = useState(imageIndex);
|
|
106
106
|
const [direction, setDirection] = useState(0);
|
|
107
107
|
const [mouseIsStationary, setMouseIsStationary] = useState(true);
|
|
@@ -167,7 +167,9 @@ function LightBox({ open, images, imageIndex = 0, onRequestClose, }) {
|
|
|
167
167
|
images[currentImageIndex].title && (React.createElement("div", { className: styles.title },
|
|
168
168
|
React.createElement(Heading, { level: 4 }, images[currentImageIndex].title))),
|
|
169
169
|
images[currentImageIndex].caption && (React.createElement(Text, { size: "large" }, images[currentImageIndex].caption))))),
|
|
170
|
-
images.length > 1 && (React.createElement("div", { className: styles.thumbnailBar,
|
|
170
|
+
images.length > 1 && (React.createElement("div", { className: styles.thumbnailBar, style: {
|
|
171
|
+
"--lightbox--box-sizing": boxSizing,
|
|
172
|
+
}, "data-testid": "ATL-Thumbnail-Bar" }, images.map((image, index) => (React.createElement("div", { key: index, className: classnames(styles.thumbnail, {
|
|
171
173
|
[styles.selected]: index === currentImageIndex,
|
|
172
174
|
}), onClick: () => handleThumbnailClick(index), ref: index === currentImageIndex ? selectedThumbnailRef : null },
|
|
173
175
|
React.createElement("img", { key: index, src: image.url, alt: image.alt || image.title || "", className: styles.thumbnailImage }))))))))));
|
package/dist/styles.css
CHANGED
|
@@ -11,10 +11,8 @@
|
|
|
11
11
|
visibility: hidden;
|
|
12
12
|
z-index: calc(6 + 1001);
|
|
13
13
|
z-index: calc(var(--elevation-menu) + var(--elevation-modal));
|
|
14
|
-
width:
|
|
15
|
-
|
|
16
|
-
This is a concession to maintain visual parity. */
|
|
17
|
-
max-height: 300px;
|
|
14
|
+
width: 0;
|
|
15
|
+
height: 0;
|
|
18
16
|
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 12px 0px rgba(0, 0, 0, 0.05);
|
|
19
17
|
box-shadow: var(--shadow-base);
|
|
20
18
|
box-sizing: border-box;
|
|
@@ -40,6 +38,9 @@
|
|
|
40
38
|
|
|
41
39
|
.dL5JShAJlKM-._2RzcnTdaPyc- {
|
|
42
40
|
visibility: visible;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: auto;
|
|
43
|
+
max-height: 300px;
|
|
43
44
|
opacity: 1;
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -561,7 +562,7 @@
|
|
|
561
562
|
}
|
|
562
563
|
|
|
563
564
|
._3RdwgIvvnZo- {
|
|
564
|
-
color: hsl(
|
|
565
|
+
color: hsl(206, 61%, 23%);
|
|
565
566
|
color: var(--color-payments--onSurface);
|
|
566
567
|
}
|
|
567
568
|
|
|
@@ -7463,6 +7464,7 @@ html.atlantisLightBoxActive {
|
|
|
7463
7464
|
background-color: rgba(3, 43, 58, 0.25);
|
|
7464
7465
|
}
|
|
7465
7466
|
._3TfQLQEE3GQ- {
|
|
7467
|
+
--lightbox--box-sizing: content-box;
|
|
7466
7468
|
display: -ms-flexbox;
|
|
7467
7469
|
display: flex;
|
|
7468
7470
|
position: relative;
|
|
@@ -7470,6 +7472,8 @@ html.atlantisLightBoxActive {
|
|
|
7470
7472
|
z-index: var(--elevation-base);
|
|
7471
7473
|
width: 100%;
|
|
7472
7474
|
min-height: 92px;
|
|
7475
|
+
box-sizing: content-box;
|
|
7476
|
+
box-sizing: var(--lightbox--box-sizing);
|
|
7473
7477
|
margin-bottom: 8px;
|
|
7474
7478
|
margin-bottom: var(--space-small);
|
|
7475
7479
|
padding-bottom: 8px;
|
|
@@ -7507,6 +7511,9 @@ html.atlantisLightBoxActive {
|
|
|
7507
7511
|
background: var(--color-interactive--subtle);
|
|
7508
7512
|
}
|
|
7509
7513
|
}
|
|
7514
|
+
._3TfQLQEE3GQ- * {
|
|
7515
|
+
box-sizing: var(--lightbox--box-sizing);
|
|
7516
|
+
}
|
|
7510
7517
|
.eBMzUOlcfQ4- {
|
|
7511
7518
|
width: 100%;
|
|
7512
7519
|
height: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.20.
|
|
3
|
+
"version": "6.20.8",
|
|
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": "
|
|
492
|
+
"gitHead": "08d5668b5d461838c6a9474fb0b4b8fde7587cea"
|
|
493
493
|
}
|