@dnanpm/styleguide 3.9.3 → 3.9.4
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/build/cjs/components/Carousel/Carousel.js +7 -3
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.d.ts +4 -0
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.js +3 -1
- package/build/es/components/Carousel/Carousel.js +7 -3
- package/build/es/components/PriorityNavigation/PriorityNavigation.d.ts +4 -0
- package/build/es/components/PriorityNavigation/PriorityNavigation.js +3 -1
- package/package.json +1 -1
|
@@ -293,9 +293,13 @@ const Carousel = (_a) => {
|
|
|
293
293
|
data.lastItemX /
|
|
294
294
|
(scrollbarRef.current.offsetWidth -
|
|
295
295
|
scrollbarRef.current.offsetWidth / slideScreensCount);
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
let slidesTransform = 0;
|
|
297
|
+
if (React.Children.count(props.children) >= visibleItems) {
|
|
298
|
+
slidesTransform =
|
|
299
|
+
data.itemWidth * currentIndex +
|
|
300
|
+
slidesWrapperGapSizePx * currentIndex -
|
|
301
|
+
(isRest ? data.itemWidth * (visibleItems % 1) + slidesWrapperGapSizePx : 0);
|
|
302
|
+
}
|
|
299
303
|
setElementTransform(slidesWrapperRef, -slidesTransform);
|
|
300
304
|
setElementTransform(knobRef, slidesTransform / data.scrollbarToSlidesRatio);
|
|
301
305
|
}
|
|
@@ -41,6 +41,10 @@ interface Props {
|
|
|
41
41
|
* Allows to pass a custom className
|
|
42
42
|
*/
|
|
43
43
|
className?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Allows to pass a custom aria-label for mobile dropdown button
|
|
46
|
+
*/
|
|
47
|
+
dropdownButtonAriaLabel?: string;
|
|
44
48
|
/**
|
|
45
49
|
* Allows to pass testid string for testing purposes
|
|
46
50
|
*/
|
|
@@ -280,7 +280,9 @@ const PriorityNavigation = (_a) => {
|
|
|
280
280
|
!isMobile && props.categoryLabel && React__default.default.createElement(Category, null, props.categoryLabel),
|
|
281
281
|
React__default.default.createElement("nav", { "aria-label": props.navigationLabel },
|
|
282
282
|
React__default.default.createElement(ListsContainer, { ref: listsContainerRef },
|
|
283
|
-
isMobile && selectedItem && (React__default.default.createElement(MobileDropdown, { onClick: toggleMobileNavigation, "aria-label": props.categoryLabel && selectedItem
|
|
283
|
+
isMobile && selectedItem && (React__default.default.createElement(MobileDropdown, { onClick: toggleMobileNavigation, "aria-label": (props.categoryLabel && selectedItem) ||
|
|
284
|
+
(props.dropdownButtonAriaLabel &&
|
|
285
|
+
`${props.dropdownButtonAriaLabel}: ${selectedItem}`), "aria-expanded": isMobileNavigationOpen, isCategoryLabel: Boolean(props.categoryLabel) },
|
|
284
286
|
React__default.default.createElement(MobileDropdownContent, null,
|
|
285
287
|
props.categoryLabel && React__default.default.createElement(Category, null, props.categoryLabel),
|
|
286
288
|
selectedItem),
|
|
@@ -285,9 +285,13 @@ const Carousel = (_a) => {
|
|
|
285
285
|
data.lastItemX /
|
|
286
286
|
(scrollbarRef.current.offsetWidth -
|
|
287
287
|
scrollbarRef.current.offsetWidth / slideScreensCount);
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
let slidesTransform = 0;
|
|
289
|
+
if (Children.count(props.children) >= visibleItems) {
|
|
290
|
+
slidesTransform =
|
|
291
|
+
data.itemWidth * currentIndex +
|
|
292
|
+
slidesWrapperGapSizePx * currentIndex -
|
|
293
|
+
(isRest ? data.itemWidth * (visibleItems % 1) + slidesWrapperGapSizePx : 0);
|
|
294
|
+
}
|
|
291
295
|
setElementTransform(slidesWrapperRef, -slidesTransform);
|
|
292
296
|
setElementTransform(knobRef, slidesTransform / data.scrollbarToSlidesRatio);
|
|
293
297
|
}
|
|
@@ -41,6 +41,10 @@ interface Props {
|
|
|
41
41
|
* Allows to pass a custom className
|
|
42
42
|
*/
|
|
43
43
|
className?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Allows to pass a custom aria-label for mobile dropdown button
|
|
46
|
+
*/
|
|
47
|
+
dropdownButtonAriaLabel?: string;
|
|
44
48
|
/**
|
|
45
49
|
* Allows to pass testid string for testing purposes
|
|
46
50
|
*/
|
|
@@ -272,7 +272,9 @@ const PriorityNavigation = (_a) => {
|
|
|
272
272
|
!isMobile && props.categoryLabel && React__default.createElement(Category, null, props.categoryLabel),
|
|
273
273
|
React__default.createElement("nav", { "aria-label": props.navigationLabel },
|
|
274
274
|
React__default.createElement(ListsContainer, { ref: listsContainerRef },
|
|
275
|
-
isMobile && selectedItem && (React__default.createElement(MobileDropdown, { onClick: toggleMobileNavigation, "aria-label": props.categoryLabel && selectedItem
|
|
275
|
+
isMobile && selectedItem && (React__default.createElement(MobileDropdown, { onClick: toggleMobileNavigation, "aria-label": (props.categoryLabel && selectedItem) ||
|
|
276
|
+
(props.dropdownButtonAriaLabel &&
|
|
277
|
+
`${props.dropdownButtonAriaLabel}: ${selectedItem}`), "aria-expanded": isMobileNavigationOpen, isCategoryLabel: Boolean(props.categoryLabel) },
|
|
276
278
|
React__default.createElement(MobileDropdownContent, null,
|
|
277
279
|
props.categoryLabel && React__default.createElement(Category, null, props.categoryLabel),
|
|
278
280
|
selectedItem),
|