@jobber/components 6.20.7 → 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.
@@ -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 {};
@@ -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, "data-testid": "ATL-Thumbnail-Bar" }, images.map((image, index) => (React.createElement("div", { key: index, className: classnames(styles.thumbnail, {
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 }))))))))));
@@ -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, "data-testid": "ATL-Thumbnail-Bar" }, images.map((image, index) => (React.createElement("div", { key: index, className: classnames(styles.thumbnail, {
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
@@ -562,7 +562,7 @@
562
562
  }
563
563
 
564
564
  ._3RdwgIvvnZo- {
565
- color: hsl(207, 87%, 94%);
565
+ color: hsl(206, 61%, 23%);
566
566
  color: var(--color-payments--onSurface);
567
567
  }
568
568
 
@@ -7464,6 +7464,7 @@ html.atlantisLightBoxActive {
7464
7464
  background-color: rgba(3, 43, 58, 0.25);
7465
7465
  }
7466
7466
  ._3TfQLQEE3GQ- {
7467
+ --lightbox--box-sizing: content-box;
7467
7468
  display: -ms-flexbox;
7468
7469
  display: flex;
7469
7470
  position: relative;
@@ -7471,6 +7472,8 @@ html.atlantisLightBoxActive {
7471
7472
  z-index: var(--elevation-base);
7472
7473
  width: 100%;
7473
7474
  min-height: 92px;
7475
+ box-sizing: content-box;
7476
+ box-sizing: var(--lightbox--box-sizing);
7474
7477
  margin-bottom: 8px;
7475
7478
  margin-bottom: var(--space-small);
7476
7479
  padding-bottom: 8px;
@@ -7508,6 +7511,9 @@ html.atlantisLightBoxActive {
7508
7511
  background: var(--color-interactive--subtle);
7509
7512
  }
7510
7513
  }
7514
+ ._3TfQLQEE3GQ- * {
7515
+ box-sizing: var(--lightbox--box-sizing);
7516
+ }
7511
7517
  .eBMzUOlcfQ4- {
7512
7518
  width: 100%;
7513
7519
  height: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.20.7",
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": "802e3d976a30349c459a432d32a9a2a346bfbbd0"
492
+ "gitHead": "08d5668b5d461838c6a9474fb0b4b8fde7587cea"
493
493
  }