yet-another-react-lightbox 3.22.0 → 3.23.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/index.js CHANGED
@@ -317,7 +317,7 @@ function reducer(state, action) {
317
317
  const globalIndex = state.globalIndex + increment;
318
318
  const currentIndex = getSlideIndex(globalIndex, slides.length);
319
319
  const currentSlide = getSlideIfPresent(slides, currentIndex);
320
- const animation = increment || action.duration
320
+ const animation = increment || action.duration !== undefined
321
321
  ? {
322
322
  increment,
323
323
  duration: action.duration,
@@ -1208,7 +1208,7 @@ function Controller({ children, ...props }) {
1208
1208
  : null),
1209
1209
  ...(controller.touchAction !== "none" ? { [cssVar("controller_touch_action")]: controller.touchAction } : null),
1210
1210
  ...styles.container,
1211
- }, ...(controller.aria ? { role: "presentation", "aria-live": "polite" } : null), tabIndex: -1, ...registerSensors }, containerRect && (React.createElement(ControllerContext.Provider, { value: context },
1211
+ }, ...(controller.aria ? { role: "region", "aria-live": "polite", "aria-roledescription": "carousel" } : null), tabIndex: -1, ...registerSensors }, containerRect && (React.createElement(ControllerContext.Provider, { value: context },
1212
1212
  children, (_a = render.controls) === null || _a === void 0 ? void 0 :
1213
1213
  _a.call(render)))));
1214
1214
  }
@@ -1256,7 +1256,7 @@ function CarouselSlide({ slide, offset }) {
1256
1256
  close();
1257
1257
  }
1258
1258
  };
1259
- return (React.createElement("div", { ref: containerRef, className: clsx(cssClass(cssSlidePrefix()), !offscreen && cssClass(cssSlidePrefix("current")), cssClass(CLASS_FLEX_CENTER)), ...makeInertWhen(offscreen), onClick: handleBackdropClick, style: style }, renderSlide()));
1259
+ return (React.createElement("div", { ref: containerRef, className: clsx(cssClass(cssSlidePrefix()), !offscreen && cssClass(cssSlidePrefix("current")), cssClass(CLASS_FLEX_CENTER)), ...makeInertWhen(offscreen), onClick: handleBackdropClick, style: style, role: "region", "aria-roledescription": "slide" }, renderSlide()));
1260
1260
  }
1261
1261
  function Placeholder() {
1262
1262
  const style = useLightboxProps().styles.slide;
@@ -1472,7 +1472,7 @@ function Portal({ children, animation, styles, className, on, portal, close }) {
1472
1472
  }
1473
1473
  }, [handleEnter, handleCleanup]);
1474
1474
  return mounted
1475
- ? createPortal(React.createElement(LightboxRoot, { ref: handleRef, className: clsx(className, cssClass(cssPrefix$1()), cssClass(CLASS_NO_SCROLL_PADDING), visible && cssClass(cssPrefix$1("open"))), role: "presentation", "aria-live": "polite", style: {
1475
+ ? createPortal(React.createElement(LightboxRoot, { ref: handleRef, className: clsx(className, cssClass(cssPrefix$1()), cssClass(CLASS_NO_SCROLL_PADDING), visible && cssClass(cssPrefix$1("open"))), "aria-modal": true, role: "dialog", "aria-live": "polite", "aria-roledescription": "lightbox", style: {
1476
1476
  ...(animation.fade !== LightboxDefaultProps.animation.fade
1477
1477
  ? { [cssVar("fade_animation_duration")]: `${animationDuration}ms` }
1478
1478
  : null),
@@ -109,8 +109,8 @@ function ThumbnailsTrack({ visible, containerRef }) {
109
109
  useKeyboardNavigation(subscribeSensors);
110
110
  const thumbnails = useThumbnailsProps();
111
111
  const { position, width, height, border, borderStyle, borderColor, borderRadius, padding, gap, vignette } = thumbnails;
112
+ const offset = ((animation === null || animation === void 0 ? void 0 : animation.duration) !== undefined && (animation === null || animation === void 0 ? void 0 : animation.increment)) || 0;
112
113
  const animationDuration = (animation === null || animation === void 0 ? void 0 : animation.duration) || 0;
113
- const offset = (animationDuration > 0 && (animation === null || animation === void 0 ? void 0 : animation.increment)) || 0;
114
114
  const { prepareAnimation } = useAnimation(track, (snapshot) => ({
115
115
  keyframes: isHorizontal(position)
116
116
  ? [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "3.22.0",
3
+ "version": "3.23.0",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",