@alto-avios/alto-ui 3.4.0-alpha.2 → 3.4.0-alpha.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/dist/components/Carousel/Carousel.d.ts +6 -6
- package/dist/components/Carousel/Carousel.js +4 -3
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselButton/CarouselButton.d.ts +4 -5
- package/dist/components/Carousel/CarouselDots/CarouselDots.d.ts +1 -1
- package/dist/components/Carousel/CarouselDots/CarouselDots.js +7 -3
- package/dist/components/Carousel/CarouselDots/CarouselDots.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,11 +4,6 @@ export interface CarouselProps {
|
|
|
4
4
|
* Content to be displayed in the carousel
|
|
5
5
|
*/
|
|
6
6
|
children?: React.ReactNode | React.ReactNode[];
|
|
7
|
-
/**
|
|
8
|
-
* Carousel variant
|
|
9
|
-
* @default 'default'
|
|
10
|
-
*/
|
|
11
|
-
variant?: 'default' | 'minimal';
|
|
12
7
|
/**
|
|
13
8
|
* Looping behavior
|
|
14
9
|
* - 'infinite': Carousel loops continuously
|
|
@@ -54,6 +49,11 @@ export interface CarouselProps {
|
|
|
54
49
|
* @default 'md'
|
|
55
50
|
*/
|
|
56
51
|
buttonSize?: 'sm' | 'md' | 'lg';
|
|
52
|
+
/**
|
|
53
|
+
* Whether to hide navigation buttons when disabled
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
hideWhenDisabled?: boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Focus style for interactive elements
|
|
59
59
|
* @default 'default'
|
|
@@ -146,5 +146,5 @@ export interface CarouselProps {
|
|
|
146
146
|
*/
|
|
147
147
|
activeDotClassName?: string;
|
|
148
148
|
}
|
|
149
|
-
export declare const Carousel: ({ children, looping, className, itemsPerPage, spaceBetweenItems, hasScrollPeek, iconType, carouselArrow, buttonSize, focusStyle, dotSize, dotsVariant, hideDots, enableTapCycling, isPaused, autoPlayInterval, autoPlayControlVariant, autoPlayControlSize, mouseDragging, carouselWrapperClassName, controlsClassName, prevButtonClassName, nextButtonClassName, autoplayControlClassName, dotsContainerClassName, dotsWrapperClassName, dotClassName, activeDotClassName, }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
export declare const Carousel: ({ children, looping, className, itemsPerPage, spaceBetweenItems, hasScrollPeek, iconType, carouselArrow, buttonSize, hideWhenDisabled, focusStyle, dotSize, dotsVariant, hideDots, enableTapCycling, isPaused, autoPlayInterval, autoPlayControlVariant, autoPlayControlSize, mouseDragging, carouselWrapperClassName, controlsClassName, prevButtonClassName, nextButtonClassName, autoplayControlClassName, dotsContainerClassName, dotsWrapperClassName, dotClassName, activeDotClassName, }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
150
150
|
export default Carousel;
|
|
@@ -61,6 +61,7 @@ const Carousel = ({
|
|
|
61
61
|
iconType = "chevron",
|
|
62
62
|
carouselArrow = "neutral",
|
|
63
63
|
buttonSize = "md",
|
|
64
|
+
hideWhenDisabled = false,
|
|
64
65
|
focusStyle = "default",
|
|
65
66
|
// Dots/Tabs Props
|
|
66
67
|
dotSize = "md",
|
|
@@ -223,8 +224,8 @@ const Carousel = ({
|
|
|
223
224
|
isPaused && /* @__PURE__ */ jsx("div", { className: `${styles.autoplayControlWrapper} ${autoplayControlClassName || ""}`, children: /* @__PURE__ */ jsx(AutoplayControl, { variant: autoPlayControlVariant, size: autoPlayControlSize, className: "" }) }),
|
|
224
225
|
/* @__PURE__ */ jsx(CarouselScroller, { className: styles.scroller, children: items.map((child, index) => /* @__PURE__ */ jsx(CarouselItem, { className: styles.item, children: child }, index)) }),
|
|
225
226
|
/* @__PURE__ */ jsxs("div", { className: `${styles.controls} ${controlsClassName}`, children: [
|
|
226
|
-
/* @__PURE__ */ jsx(CarouselButton, { dir: "prev", variant: carouselArrow, size: buttonSize, focusStyle, iconType, className: prevButtonClassName }),
|
|
227
|
-
/* @__PURE__ */ jsx(CarouselButton, { dir: "next", variant: carouselArrow, size: buttonSize, focusStyle, iconType, className: nextButtonClassName })
|
|
227
|
+
/* @__PURE__ */ jsx(CarouselButton, { dir: "prev", variant: carouselArrow, size: buttonSize, focusStyle, iconType, hideWhenDisabled, className: prevButtonClassName }),
|
|
228
|
+
/* @__PURE__ */ jsx(CarouselButton, { dir: "next", variant: carouselArrow, size: buttonSize, focusStyle, iconType, hideWhenDisabled, className: nextButtonClassName })
|
|
228
229
|
] }),
|
|
229
230
|
/* @__PURE__ */ jsx("div", { className: styles.hiddenTabs, children: /* @__PURE__ */ jsx(CarouselTabs, { children: (page) => /* @__PURE__ */ jsx(CarouselTab, { index: page.index, "data-index": page.index, "data-slide-tab": "true" }, page.index) }) }),
|
|
230
231
|
!hideDots && /* @__PURE__ */ jsx(CarouselDots, { totalItems: totalPages, currentPage, onDotClick: (index) => {
|
|
@@ -235,7 +236,7 @@ const Carousel = ({
|
|
|
235
236
|
} else {
|
|
236
237
|
navigateToSlide(index);
|
|
237
238
|
}
|
|
238
|
-
},
|
|
239
|
+
}, focusStyle, dotSize, variant: dotsVariant, className: `${dotsContainerClassName} ${enableTapCycling ? styles.tapEnabled : ""}`, dotsWrapperClassName, dotClassName, activeDotClassName })
|
|
239
240
|
] }) });
|
|
240
241
|
};
|
|
241
242
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Carousel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,11 +23,6 @@ export interface CarouselButtonProps {
|
|
|
23
23
|
* @default false
|
|
24
24
|
*/
|
|
25
25
|
hideWhenDisabled?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Icon type to use
|
|
28
|
-
* @default 'chevron'
|
|
29
|
-
*/
|
|
30
|
-
iconType?: 'chevron';
|
|
31
26
|
/**
|
|
32
27
|
* Additional CSS class name for the button container
|
|
33
28
|
*/
|
|
@@ -36,6 +31,10 @@ export interface CarouselButtonProps {
|
|
|
36
31
|
* Additional CSS class name for the button content
|
|
37
32
|
*/
|
|
38
33
|
buttonClassName?: string;
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
iconType?: 'chevron';
|
|
39
38
|
}
|
|
40
39
|
export declare const CarouselButton: ({ dir, variant, size, focusStyle, hideWhenDisabled, iconType, className, buttonClassName, }: CarouselButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
40
|
export default CarouselButton;
|
|
@@ -4,7 +4,7 @@ export interface CarouselDotsProps {
|
|
|
4
4
|
currentPage: number;
|
|
5
5
|
onDotClick: (index: number) => void;
|
|
6
6
|
dotSize?: 'md' | 'lg';
|
|
7
|
-
|
|
7
|
+
focusStyle?: 'default' | 'white';
|
|
8
8
|
variant?: 'standard' | 'transparent';
|
|
9
9
|
className?: string;
|
|
10
10
|
dotsWrapperClassName?: string;
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState, useEffect, useCallback } from "react";
|
|
3
3
|
import { useFocusRing } from "@react-aria/focus";
|
|
4
4
|
import { useHover } from "@react-aria/interactions";
|
|
5
|
+
import { focusStyleVariants } from "../../../utils/focus/focusStyles.js";
|
|
5
6
|
import '../../../assets/CarouselDots.css';const tabsContainer = "_tabsContainer_1yet6_1";
|
|
6
7
|
const tabs = "_tabs_1yet6_1";
|
|
7
8
|
const transparent = "_transparent_1yet6_28";
|
|
@@ -29,9 +30,8 @@ const CarouselDots = ({
|
|
|
29
30
|
currentPage,
|
|
30
31
|
onDotClick,
|
|
31
32
|
dotSize = "md",
|
|
32
|
-
tabSize,
|
|
33
|
-
// For backward compatibility
|
|
34
33
|
variant = "standard",
|
|
34
|
+
focusStyle = "default",
|
|
35
35
|
className = "",
|
|
36
36
|
dotsWrapperClassName = "",
|
|
37
37
|
dotClassName = "",
|
|
@@ -39,7 +39,7 @@ const CarouselDots = ({
|
|
|
39
39
|
}) => {
|
|
40
40
|
const tabsRef = useRef(null);
|
|
41
41
|
const wrapperRef = useRef(null);
|
|
42
|
-
const effectiveDotSize = dotSize ||
|
|
42
|
+
const effectiveDotSize = dotSize || "md";
|
|
43
43
|
const {
|
|
44
44
|
isFocusVisible,
|
|
45
45
|
focusProps
|
|
@@ -51,6 +51,9 @@ const CarouselDots = ({
|
|
|
51
51
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
52
52
|
const [prevPage, setPrevPage] = useState(currentPage);
|
|
53
53
|
const [offsetPercentage, setOffsetPercentage] = useState(0);
|
|
54
|
+
const focusClass = focusStyleVariants({
|
|
55
|
+
focusStyle
|
|
56
|
+
});
|
|
54
57
|
const handleKeyDown = (e) => {
|
|
55
58
|
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
56
59
|
e.preventDefault();
|
|
@@ -93,6 +96,7 @@ const CarouselDots = ({
|
|
|
93
96
|
const getDotsWrapperClasses = () => {
|
|
94
97
|
const classes = [styles.tabs];
|
|
95
98
|
if (variant === "transparent") classes.push(styles.transparent);
|
|
99
|
+
classes.push(focusClass);
|
|
96
100
|
if (dotsWrapperClassName) classes.push(dotsWrapperClassName);
|
|
97
101
|
return classes.join(" ");
|
|
98
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselDots.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CarouselDots.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,6 +7,7 @@ export { default as Button } from './Button';
|
|
|
7
7
|
export { default as ButtonGroup } from './ButtonGroup';
|
|
8
8
|
export { default as CalloutBanner } from './CalloutBanner';
|
|
9
9
|
export { default as CardSection } from './CardSection';
|
|
10
|
+
export { default as Carousel } from './Carousel';
|
|
10
11
|
export { default as Checkbox } from './Checkbox';
|
|
11
12
|
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
12
13
|
export { default as CreditCardNumberField } from './CreditCardNumberField';
|
|
@@ -47,6 +48,7 @@ export { default as Section } from './Section';
|
|
|
47
48
|
export { default as Select } from './SelectNative';
|
|
48
49
|
export { default as SelectCard } from './SelectCard';
|
|
49
50
|
export { default as SelectNative } from './SelectNative';
|
|
51
|
+
export { default as Slider } from './Slider';
|
|
50
52
|
export { default as SubHeading } from './SubHeading';
|
|
51
53
|
export { default as Switch } from './Switch';
|
|
52
54
|
export { default as Tag } from './Tag';
|
package/dist/components/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { Button } from "./Button/Button.js";
|
|
|
8
8
|
import { ButtonGroup } from "./ButtonGroup/ButtonGroup.js";
|
|
9
9
|
import { CalloutBanner } from "./CalloutBanner/CalloutBanner.js";
|
|
10
10
|
import { default as default2 } from "./CardSection/CardSection.js";
|
|
11
|
+
import { Carousel } from "./Carousel/Carousel.js";
|
|
11
12
|
import { Checkbox } from "./Checkbox/Checkbox.js";
|
|
12
13
|
import { CheckboxGroup } from "./CheckboxGroup/CheckboxGroup.js";
|
|
13
14
|
import { CreditCardNumberField } from "./CreditCardNumberField/CreditCardNumberField.js";
|
|
@@ -47,6 +48,7 @@ import { SearchField } from "./SearchField/SearchField.js";
|
|
|
47
48
|
import { default as default8 } from "./Section/Section.js";
|
|
48
49
|
import { SelectNative, SelectNative as SelectNative2 } from "./SelectNative/SelectNative.js";
|
|
49
50
|
import { default as default9 } from "./SelectCard/SelectCard.js";
|
|
51
|
+
import { Slider } from "./Slider/Slider.js";
|
|
50
52
|
import { SubHeading } from "./SubHeading/SubHeading.js";
|
|
51
53
|
import { Switch } from "./Switch/Switch.js";
|
|
52
54
|
import { Tag } from "./Tag/Tag.js";
|
|
@@ -66,6 +68,7 @@ export {
|
|
|
66
68
|
ButtonGroup,
|
|
67
69
|
CalloutBanner,
|
|
68
70
|
default2 as CardSection,
|
|
71
|
+
Carousel,
|
|
69
72
|
Checkbox,
|
|
70
73
|
CheckboxGroup,
|
|
71
74
|
CreditCardNumberField,
|
|
@@ -106,6 +109,7 @@ export {
|
|
|
106
109
|
SelectNative as Select,
|
|
107
110
|
default9 as SelectCard,
|
|
108
111
|
SelectNative2 as SelectNative,
|
|
112
|
+
Slider,
|
|
109
113
|
SubHeading,
|
|
110
114
|
Switch,
|
|
111
115
|
Tag,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { Button } from "./components/Button/Button.js";
|
|
|
8
8
|
import { ButtonGroup } from "./components/ButtonGroup/ButtonGroup.js";
|
|
9
9
|
import { CalloutBanner } from "./components/CalloutBanner/CalloutBanner.js";
|
|
10
10
|
import { default as default2 } from "./components/CardSection/CardSection.js";
|
|
11
|
+
import { Carousel } from "./components/Carousel/Carousel.js";
|
|
11
12
|
import { Checkbox } from "./components/Checkbox/Checkbox.js";
|
|
12
13
|
import { CheckboxGroup } from "./components/CheckboxGroup/CheckboxGroup.js";
|
|
13
14
|
import { CreditCardNumberField } from "./components/CreditCardNumberField/CreditCardNumberField.js";
|
|
@@ -47,6 +48,7 @@ import { SearchField } from "./components/SearchField/SearchField.js";
|
|
|
47
48
|
import { default as default8 } from "./components/Section/Section.js";
|
|
48
49
|
import { SelectNative, SelectNative as SelectNative2 } from "./components/SelectNative/SelectNative.js";
|
|
49
50
|
import { default as default9 } from "./components/SelectCard/SelectCard.js";
|
|
51
|
+
import { Slider } from "./components/Slider/Slider.js";
|
|
50
52
|
import { SubHeading } from "./components/SubHeading/SubHeading.js";
|
|
51
53
|
import { Switch } from "./components/Switch/Switch.js";
|
|
52
54
|
import { Tag } from "./components/Tag/Tag.js";
|
|
@@ -66,6 +68,7 @@ export {
|
|
|
66
68
|
ButtonGroup,
|
|
67
69
|
CalloutBanner,
|
|
68
70
|
default2 as CardSection,
|
|
71
|
+
Carousel,
|
|
69
72
|
Checkbox,
|
|
70
73
|
CheckboxGroup,
|
|
71
74
|
CreditCardNumberField,
|
|
@@ -106,6 +109,7 @@ export {
|
|
|
106
109
|
SelectNative as Select,
|
|
107
110
|
default9 as SelectCard,
|
|
108
111
|
SelectNative2 as SelectNative,
|
|
112
|
+
Slider,
|
|
109
113
|
SubHeading,
|
|
110
114
|
Switch,
|
|
111
115
|
Tag,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|