yet-another-react-lightbox
Advanced tools
Comparing version 3.19.0 to 3.20.0
@@ -22,2 +22,4 @@ import * as React from 'react'; | ||
ref?: React.ForwardedRef<CaptionsRef>; | ||
/** if `true`, captions are hidden when the lightbox opens */ | ||
hidden?: boolean; | ||
/** if `true`, show Captions Toggle button in the toolbar */ | ||
@@ -24,0 +26,0 @@ showToggle?: boolean; |
@@ -11,2 +11,3 @@ import { cssClass, useLightboxProps, makeUseContext, useController, clsx, cssVar, createIcon, createIconDisabled, IconButton, addToolbarButton, createModule } from '../../index.js'; | ||
showToggle: false, | ||
hidden: false, | ||
}; | ||
@@ -25,4 +26,4 @@ const resolveCaptionsProps = (captions) => ({ | ||
function CaptionsContextProvider({ captions, children }) { | ||
const { ref } = resolveCaptionsProps(captions); | ||
const [visible, setVisible] = React.useState(true); | ||
const { ref, hidden } = resolveCaptionsProps(captions); | ||
const [visible, setVisible] = React.useState(!hidden); | ||
const context = React.useMemo(() => ({ | ||
@@ -29,0 +30,0 @@ visible, |
@@ -39,2 +39,4 @@ import * as React from 'react'; | ||
vignette?: boolean; | ||
/** if `true`, thumbnails are hidden when the lightbox opens */ | ||
hidden?: boolean; | ||
/** if `true`, show the Toggle Thumbnails button in the toolbar */ | ||
@@ -41,0 +43,0 @@ showToggle?: boolean; |
@@ -16,2 +16,4 @@ import { useLightboxProps, composePrefix, createIcon, ImageSlide, isImageSlide, cssClass, makeComposePrefix, useDocumentContext, useEventCallback, clsx, cssVar, getSlideKey, useRTL, useEvents, useLightboxState, useSensors, useKeyboardNavigation, useAnimation, cleanup, calculatePreload, hasSlides, getSlide, makeUseContext, LightboxPropsProvider, createIconDisabled, IconButton, addToolbarButton, createModule } from '../../index.js'; | ||
vignette: true, | ||
hidden: false, | ||
showToggle: false, | ||
}; | ||
@@ -209,5 +211,5 @@ const resolveThumbnailsProps = (thumbnails) => ({ | ||
function ThumbnailsContextProvider({ children, ...props }) { | ||
const [visible, setVisible] = React.useState(true); | ||
const { ref, position, hidden } = resolveThumbnailsProps(props.thumbnails); | ||
const [visible, setVisible] = React.useState(!hidden); | ||
const containerRef = React.useRef(null); | ||
const { ref, position } = resolveThumbnailsProps(props.thumbnails); | ||
const context = React.useMemo(() => ({ | ||
@@ -214,0 +216,0 @@ visible, |
{ | ||
"name": "yet-another-react-lightbox", | ||
"version": "3.19.0", | ||
"version": "3.20.0", | ||
"description": "Modern React lightbox component", | ||
@@ -5,0 +5,0 @@ "author": "Igor Danchenko", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
222452
4154