@alto-avios/alto-ui 3.8.0 → 4.0.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/IconButton.module-4obqG6tY.js +1050 -0
- package/dist/IconButton.module-4obqG6tY.js.map +1 -0
- package/dist/assets/AutoplayControl.css +1 -0
- package/dist/assets/AviosCurrency.css +1 -1
- package/dist/assets/AviosCurrencyBadge.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Carousel.css +1 -0
- package/dist/assets/CarouselButton.css +1 -0
- package/dist/assets/CarouselDots.css +1 -0
- package/dist/assets/ComboBox.css +1 -1
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/MonthYearField.css +1 -0
- package/dist/assets/SearchField.css +1 -1
- package/dist/assets/SelectNative.css +1 -1
- package/dist/assets/SkeletonLoader.css +1 -0
- package/dist/assets/TextAreaField.css +1 -1
- package/dist/components/Accordion/Accordion.js +8 -8
- package/dist/components/AviosCurrency/AviosCurrency.d.ts +1 -2
- package/dist/components/AviosCurrency/AviosCurrency.js +40 -36
- package/dist/components/AviosCurrency/AviosCurrency.js.map +1 -1
- package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.d.ts +48 -0
- package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js +165 -0
- package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js.map +1 -0
- package/dist/components/AviosCurrencyBadge/index.d.ts +1 -0
- package/dist/components/AviosCurrencyBadge/index.js +5 -0
- package/dist/components/AviosCurrencyBadge/index.js.map +1 -0
- package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js +3 -3
- package/dist/components/Badge/Badge.d.ts +1 -16
- package/dist/components/Badge/Badge.js +3 -9
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Box/Box.d.ts +0 -4
- package/dist/components/Box/Box.js +1 -5
- package/dist/components/Box/Box.js.map +1 -1
- package/dist/components/Button/Button.d.ts +34 -64
- package/dist/components/Button/Button.js +61 -44
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/components/CalloutBanner/CalloutBanner.js +3 -3
- package/dist/components/Carousel/AutoplayControl/AutoplayControl.d.ts +27 -0
- package/dist/components/Carousel/AutoplayControl/AutoplayControl.js +115 -0
- package/dist/components/Carousel/AutoplayControl/AutoplayControl.js.map +1 -0
- package/dist/components/Carousel/Carousel.d.ts +171 -0
- package/dist/components/Carousel/Carousel.js +373 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/components/Carousel/CarouselButton/CarouselButton.d.ts +44 -0
- package/dist/components/Carousel/CarouselButton/CarouselButton.js +195 -0
- package/dist/components/Carousel/CarouselButton/CarouselButton.js.map +1 -0
- package/dist/components/Carousel/CarouselControls.d.ts +7 -0
- package/dist/components/Carousel/CarouselControls.js +305 -0
- package/dist/components/Carousel/CarouselControls.js.map +1 -0
- package/dist/components/Carousel/CarouselDots/CarouselDots.d.ts +16 -0
- package/dist/components/Carousel/CarouselDots/CarouselDots.js +150 -0
- package/dist/components/Carousel/CarouselDots/CarouselDots.js.map +1 -0
- package/dist/components/Carousel/index.d.ts +1 -0
- package/dist/components/Carousel/index.js +5 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/ComboBox/ComboBox.js +10 -13
- package/dist/components/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js +5 -5
- package/dist/components/CreditCardSecurityCodeField/CreditCardSecurityCodeField.js +5 -5
- package/dist/components/Dialog/Dialog.js +4 -4
- package/dist/components/ErrorSummary/ErrorSummary.js +4 -4
- package/dist/components/FieldError/FieldError.d.ts +5 -1
- package/dist/components/FieldError/FieldError.js +8 -1
- package/dist/components/FieldError/FieldError.js.map +1 -1
- package/dist/components/FieldHeader/FieldHeader.js +1 -1
- package/dist/components/Grid/Grid.d.ts +6 -1
- package/dist/components/Grid/Grid.js +2 -0
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -6
- package/dist/components/Heading/Heading.js +1 -6
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -6
- package/dist/components/IconButton/IconButton.d.ts +3 -15
- package/dist/components/IconButton/IconButton.js +18 -128
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Image/Image.d.ts +0 -1
- package/dist/components/Image/Image.js +8 -13
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -16
- package/dist/components/Link/Link.js +4 -11
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/ListBoxItem/index.d.ts +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.js +6 -4
- package/dist/components/LoadingSpinner/LoadingSpinner.js.map +1 -1
- package/dist/components/MonthYearField/MonthYearField.d.ts +107 -0
- package/dist/components/MonthYearField/MonthYearField.js +332 -0
- package/dist/components/MonthYearField/MonthYearField.js.map +1 -0
- package/dist/components/MonthYearField/index.d.ts +2 -0
- package/dist/components/MonthYearField/index.js +5 -0
- package/dist/components/MonthYearField/index.js.map +1 -0
- package/dist/components/Paragraph/Paragraph.d.ts +1 -6
- package/dist/components/Paragraph/Paragraph.js +1 -6
- package/dist/components/Paragraph/Paragraph.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.js +3 -3
- package/dist/components/PhoneNumberField/PhoneNumberField.js +1 -1
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/SearchField/SearchField.js +9 -7
- package/dist/components/SearchField/SearchField.js.map +1 -1
- package/dist/components/Section/Section.d.ts +42 -1
- package/dist/components/Section/Section.js +8 -13
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SelectCard/SelectCard.js +2 -2
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +50 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.js +150 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.js.map +1 -0
- package/dist/components/SkeletonLoader/index.d.ts +1 -0
- package/dist/components/SkeletonLoader/index.js +5 -0
- package/dist/components/SkeletonLoader/index.js.map +1 -0
- package/dist/components/SubHeading/SubHeading.d.ts +1 -6
- package/dist/components/SubHeading/SubHeading.js +1 -6
- package/dist/components/SubHeading/SubHeading.js.map +1 -1
- package/dist/components/TextAreaField/TextAreaField.js +1 -1
- package/dist/components/_base/Field/Field.js +4 -4
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/{react-number-format.es-BjKL6crg.js → react-number-format.es-Dbc1db6s.js} +6 -6
- package/dist/{react-number-format.es-BjKL6crg.js.map → react-number-format.es-Dbc1db6s.js.map} +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SkeletonLoaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* The width of the skeleton
|
|
5
|
+
* Can be a number (pixels) or string (CSS value)
|
|
6
|
+
* @example 200 or "100%" or "50px"
|
|
7
|
+
*/
|
|
8
|
+
width?: string | number;
|
|
9
|
+
/**
|
|
10
|
+
* The height of the skeleton
|
|
11
|
+
* Can be a number (pixels) or string (CSS value)
|
|
12
|
+
* @example 20 or "100%" or "2rem"
|
|
13
|
+
*/
|
|
14
|
+
height?: string | number;
|
|
15
|
+
/**
|
|
16
|
+
* Number of skeleton lines to display
|
|
17
|
+
* @default 1
|
|
18
|
+
*/
|
|
19
|
+
count?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Whether to display the skeleton as a circle
|
|
22
|
+
* When true, height and width should be equal for best results
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
circle?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to show the loading skeleton
|
|
28
|
+
* When false, renders children or nothing
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
isLoading?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Children to render when not loading
|
|
34
|
+
*/
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Accessible label describing what is loading
|
|
38
|
+
* @example "Loading user profile" or "Loading product details"
|
|
39
|
+
*/
|
|
40
|
+
'aria-label'?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the skeleton loader itself should be focusable
|
|
43
|
+
* Set to true when the skeleton represents an interactive element (button, input, link)
|
|
44
|
+
* that was previously focusable in the interface
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
elementFocusable?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare const SkeletonLoader: ({ width, height, count, circle, isLoading, children, "aria-label": ariaLabel, elementFocusable, }: SkeletonLoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export default SkeletonLoader;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useRef, useState, useEffect } from "react";
|
|
3
|
+
import '../../assets/SkeletonLoader.css';const SkeletonThemeContext = React__default.createContext({});
|
|
4
|
+
const defaultEnableAnimation = true;
|
|
5
|
+
function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, customHighlightBackground }) {
|
|
6
|
+
const style = {};
|
|
7
|
+
if (direction === "rtl")
|
|
8
|
+
style["--animation-direction"] = "reverse";
|
|
9
|
+
if (typeof duration === "number")
|
|
10
|
+
style["--animation-duration"] = `${duration}s`;
|
|
11
|
+
if (!enableAnimation)
|
|
12
|
+
style["--pseudo-element-display"] = "none";
|
|
13
|
+
if (typeof width === "string" || typeof width === "number")
|
|
14
|
+
style.width = width;
|
|
15
|
+
if (typeof height === "string" || typeof height === "number")
|
|
16
|
+
style.height = height;
|
|
17
|
+
if (typeof borderRadius === "string" || typeof borderRadius === "number")
|
|
18
|
+
style.borderRadius = borderRadius;
|
|
19
|
+
if (circle)
|
|
20
|
+
style.borderRadius = "50%";
|
|
21
|
+
if (typeof baseColor !== "undefined")
|
|
22
|
+
style["--base-color"] = baseColor;
|
|
23
|
+
if (typeof highlightColor !== "undefined")
|
|
24
|
+
style["--highlight-color"] = highlightColor;
|
|
25
|
+
if (typeof customHighlightBackground === "string")
|
|
26
|
+
style["--custom-highlight-background"] = customHighlightBackground;
|
|
27
|
+
return style;
|
|
28
|
+
}
|
|
29
|
+
function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
const contextStyleOptions = React__default.useContext(SkeletonThemeContext);
|
|
32
|
+
const propsStyleOptions = { ...originalPropsStyleOptions };
|
|
33
|
+
for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
|
|
34
|
+
if (typeof value === "undefined") {
|
|
35
|
+
delete propsStyleOptions[key];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const styleOptions = {
|
|
39
|
+
...contextStyleOptions,
|
|
40
|
+
...propsStyleOptions,
|
|
41
|
+
circle
|
|
42
|
+
};
|
|
43
|
+
const style = {
|
|
44
|
+
...styleProp,
|
|
45
|
+
...styleOptionsToCssProperties(styleOptions)
|
|
46
|
+
};
|
|
47
|
+
let className = "react-loading-skeleton";
|
|
48
|
+
if (customClassName)
|
|
49
|
+
className += ` ${customClassName}`;
|
|
50
|
+
const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;
|
|
51
|
+
const elements = [];
|
|
52
|
+
const countCeil = Math.ceil(count);
|
|
53
|
+
for (let i = 0; i < countCeil; i++) {
|
|
54
|
+
let thisStyle = style;
|
|
55
|
+
if (countCeil > count && i === countCeil - 1) {
|
|
56
|
+
const width = (_b = thisStyle.width) !== null && _b !== void 0 ? _b : "100%";
|
|
57
|
+
const fractionalPart = count % 1;
|
|
58
|
+
const fractionalWidth = typeof width === "number" ? width * fractionalPart : `calc(${width} * ${fractionalPart})`;
|
|
59
|
+
thisStyle = { ...thisStyle, width: fractionalWidth };
|
|
60
|
+
}
|
|
61
|
+
const skeletonSpan = React__default.createElement("span", { className, style: thisStyle, key: i }, "");
|
|
62
|
+
if (inline) {
|
|
63
|
+
elements.push(skeletonSpan);
|
|
64
|
+
} else {
|
|
65
|
+
elements.push(React__default.createElement(
|
|
66
|
+
React__default.Fragment,
|
|
67
|
+
{ key: i },
|
|
68
|
+
skeletonSpan,
|
|
69
|
+
React__default.createElement("br", null)
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return React__default.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper ? elements.map((el, i) => React__default.createElement(Wrapper, { key: i }, el)) : elements);
|
|
74
|
+
}
|
|
75
|
+
const skeletonLoader = "_skeletonLoader_10o6z_1";
|
|
76
|
+
const multiLine = "_multiLine_10o6z_15";
|
|
77
|
+
const styles = {
|
|
78
|
+
skeletonLoader,
|
|
79
|
+
multiLine
|
|
80
|
+
};
|
|
81
|
+
const SkeletonLoader = ({
|
|
82
|
+
width,
|
|
83
|
+
height,
|
|
84
|
+
count = 1,
|
|
85
|
+
circle = false,
|
|
86
|
+
isLoading = true,
|
|
87
|
+
children,
|
|
88
|
+
"aria-label": ariaLabel,
|
|
89
|
+
elementFocusable = false
|
|
90
|
+
}) => {
|
|
91
|
+
const containerRef = useRef(null);
|
|
92
|
+
const [focusVisible, setFocusVisible] = useState(false);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (isLoading && elementFocusable && containerRef.current) {
|
|
95
|
+
const activeElement = document.activeElement;
|
|
96
|
+
const shouldReceiveFocus = !activeElement || activeElement === document.body || activeElement.closest("[data-skeleton-replaced]");
|
|
97
|
+
if (shouldReceiveFocus) {
|
|
98
|
+
containerRef.current.focus();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, [isLoading, elementFocusable]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (!elementFocusable || !containerRef.current) return;
|
|
104
|
+
const element = containerRef.current;
|
|
105
|
+
const handleFocus = () => {
|
|
106
|
+
setFocusVisible(true);
|
|
107
|
+
};
|
|
108
|
+
const handleBlur = () => {
|
|
109
|
+
setFocusVisible(false);
|
|
110
|
+
};
|
|
111
|
+
const handleMouseDown = () => {
|
|
112
|
+
setFocusVisible(false);
|
|
113
|
+
};
|
|
114
|
+
const handleKeyDown = (e) => {
|
|
115
|
+
if (e.key === "Tab") {
|
|
116
|
+
setFocusVisible(true);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
element.addEventListener("focus", handleFocus);
|
|
120
|
+
element.addEventListener("blur", handleBlur);
|
|
121
|
+
element.addEventListener("mousedown", handleMouseDown);
|
|
122
|
+
element.addEventListener("keydown", handleKeyDown);
|
|
123
|
+
return () => {
|
|
124
|
+
element.removeEventListener("focus", handleFocus);
|
|
125
|
+
element.removeEventListener("blur", handleBlur);
|
|
126
|
+
element.removeEventListener("mousedown", handleMouseDown);
|
|
127
|
+
element.removeEventListener("keydown", handleKeyDown);
|
|
128
|
+
};
|
|
129
|
+
}, [elementFocusable]);
|
|
130
|
+
if (!isLoading) {
|
|
131
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
132
|
+
}
|
|
133
|
+
const highlightGradient = `linear-gradient(90deg, var(--skeleton-highlight-start) 0%, var(--skeleton-highlight-center) 50%, var(--skeleton-highlight-end) 100%)`;
|
|
134
|
+
const wrapperClass = count > 1 ? `${styles.skeletonLoader} ${styles.multiLine}` : styles.skeletonLoader;
|
|
135
|
+
const containerStyle = {
|
|
136
|
+
"--skeleton-width": typeof width === "number" ? `${width}px` : width
|
|
137
|
+
};
|
|
138
|
+
const getAriaLabel = () => {
|
|
139
|
+
if (ariaLabel) return ariaLabel;
|
|
140
|
+
if (circle) return "Loading image";
|
|
141
|
+
if (count > 1) return "Loading content";
|
|
142
|
+
return "Loading";
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ jsx("div", { ref: containerRef, className: wrapperClass, style: containerStyle, role: "status", "aria-label": getAriaLabel(), tabIndex: elementFocusable ? 0 : -1, "data-skeleton-loader": "true", "data-focus-visible": elementFocusable && focusVisible ? "true" : void 0, children: /* @__PURE__ */ jsx(Skeleton, { width, height, count, circle, baseColor: "var(--skeleton-base-color)", customHighlightBackground: highlightGradient, inline: true }) });
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
SkeletonLoader,
|
|
148
|
+
SkeletonLoader as default
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=SkeletonLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonLoader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SkeletonLoader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -26,16 +26,11 @@ export interface SubHeadingProps extends SubHeadingVariants {
|
|
|
26
26
|
* @default "accentPrimary"
|
|
27
27
|
*/
|
|
28
28
|
foregroundColor?: ForegroundVariants['foregroundColor'];
|
|
29
|
-
/**
|
|
30
|
-
* The foreground color of the heading
|
|
31
|
-
* @deprecated Use `foregroundColor` instead
|
|
32
|
-
*/
|
|
33
|
-
fgColor?: ForegroundVariants['foregroundColor'];
|
|
34
29
|
/**
|
|
35
30
|
* The text alignment of the heading
|
|
36
31
|
* @default "start"
|
|
37
32
|
*/
|
|
38
33
|
textAlign?: 'start' | 'center' | 'end';
|
|
39
34
|
}
|
|
40
|
-
export declare const SubHeading: ({ children, as: Component, size, foregroundColor,
|
|
35
|
+
export declare const SubHeading: ({ children, as: Component, size, foregroundColor, textAlign, ...props }: SubHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
36
|
export default SubHeading;
|
|
@@ -37,20 +37,15 @@ const SubHeading = ({
|
|
|
37
37
|
as: Component = "span",
|
|
38
38
|
size,
|
|
39
39
|
foregroundColor = "accentPrimary",
|
|
40
|
-
fgColor,
|
|
41
40
|
textAlign = "start",
|
|
42
41
|
...props
|
|
43
42
|
}) => {
|
|
44
43
|
const effectiveSize = size;
|
|
45
|
-
if (fgColor) {
|
|
46
|
-
console.warn("The `fgColor` prop has been deprecated. Please use `foregroundColor` instead.");
|
|
47
|
-
}
|
|
48
|
-
const resolvedFontColor = fgColor ?? foregroundColor ?? "accentPrimary";
|
|
49
44
|
return /* @__PURE__ */ jsx(Component, { className: `${subHeading({
|
|
50
45
|
size: effectiveSize,
|
|
51
46
|
textAlign
|
|
52
47
|
})} ${foregroundColorVariants({
|
|
53
|
-
foregroundColor
|
|
48
|
+
foregroundColor
|
|
54
49
|
})}`, ...props, children });
|
|
55
50
|
};
|
|
56
51
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubHeading.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubHeading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ const styles = {
|
|
|
7
7
|
textAreaField
|
|
8
8
|
};
|
|
9
9
|
const TextAreaField = forwardRef((props, ref) => {
|
|
10
|
-
return /* @__PURE__ */ jsx(Field, { as: TextField, className: styles.textAreaField, ...props, children: /* @__PURE__ */ jsx(TextArea, { ref }) });
|
|
10
|
+
return /* @__PURE__ */ jsx(Field, { as: TextField, className: styles.textAreaField, label: (props == null ? void 0 : props.label) || (props == null ? void 0 : props["aria-label"]), ...props, children: /* @__PURE__ */ jsx(TextArea, { ref }) });
|
|
11
11
|
});
|
|
12
12
|
TextAreaField.displayName = "TextAreaField";
|
|
13
13
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { FieldHeader } from "../../FieldHeader/FieldHeader.js";
|
|
3
|
-
import
|
|
3
|
+
import React__default from "react";
|
|
4
4
|
import { fieldVariants } from "../../../utils/forms/field.js";
|
|
5
5
|
import { FieldError } from "../../FieldError/FieldError.js";
|
|
6
6
|
import '../../../assets/Field.css';const fieldGrid = "_fieldGrid_1ajki_1";
|
|
@@ -17,7 +17,7 @@ function PolymorphicField({
|
|
|
17
17
|
if (!as) {
|
|
18
18
|
console.warn("@alto/ui: Field expects an as prop");
|
|
19
19
|
}
|
|
20
|
-
return as ?
|
|
20
|
+
return as ? React__default.createElement(as, props, children) : /* @__PURE__ */ jsx("div", { children });
|
|
21
21
|
}
|
|
22
22
|
function Field({
|
|
23
23
|
as,
|
|
@@ -30,12 +30,12 @@ function Field({
|
|
|
30
30
|
errorPlacement = "top",
|
|
31
31
|
...props
|
|
32
32
|
}) {
|
|
33
|
-
|
|
33
|
+
React__default.useEffect(() => {
|
|
34
34
|
if ((props == null ? void 0 : props.label) === void 0) {
|
|
35
35
|
console.warn("@alto/ui: Field expects a label prop for accessibility compliance");
|
|
36
36
|
}
|
|
37
37
|
}, [props == null ? void 0 : props.label]);
|
|
38
|
-
return /* @__PURE__ */ jsxs(PolymorphicField, { as, isDisabled: props == null ? void 0 : props.isDisabled, className,
|
|
38
|
+
return /* @__PURE__ */ jsxs(PolymorphicField, { as, isDisabled: props == null ? void 0 : props.isDisabled, className, ...props, children: [
|
|
39
39
|
(props == null ? void 0 : props.label) ? /* @__PURE__ */ jsx(FieldHeader, { label: props == null ? void 0 : props.label, description: props == null ? void 0 : props.description, isInvalid: props == null ? void 0 : props.isInvalid, isRequired: props == null ? void 0 : props.isRequired, labelFor: props == null ? void 0 : props.labelFor, errorMessage: errorPlacement === "top" ? props == null ? void 0 : props.errorMessage : void 0, optionalTranslation: props == null ? void 0 : props.optionalTranslation }) : null,
|
|
40
40
|
/* @__PURE__ */ jsx("div", { className: styles.fieldGrid, children: /* @__PURE__ */ jsx("div", { className: fieldVariants({
|
|
41
41
|
columns,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as Accordion, AccordionGroup } from './Accordion';
|
|
2
2
|
export type * from './Accordion';
|
|
3
|
+
export { default as AviosCurrencyBadge } from './AviosCurrencyBadge';
|
|
4
|
+
export type * from './AviosCurrencyBadge';
|
|
3
5
|
export { default as AviosCurrency } from './AviosCurrency';
|
|
4
6
|
export type * from './AviosCurrency';
|
|
5
7
|
export { default as AviosBadge } from './AviosBadge';
|
|
@@ -18,6 +20,8 @@ export { default as CalloutBanner } from './CalloutBanner';
|
|
|
18
20
|
export type * from './CalloutBanner';
|
|
19
21
|
export { default as CardSection } from './CardSection';
|
|
20
22
|
export type * from './CardSection';
|
|
23
|
+
export { default as Carousel } from './Carousel';
|
|
24
|
+
export type * from './Carousel';
|
|
21
25
|
export { default as Checkbox } from './Checkbox';
|
|
22
26
|
export type * from './Checkbox';
|
|
23
27
|
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
@@ -80,6 +84,8 @@ export { default as LoadingSpinner } from './LoadingSpinner';
|
|
|
80
84
|
export type * from './LoadingSpinner';
|
|
81
85
|
export { default as Menu } from './Menu';
|
|
82
86
|
export type * from './Menu';
|
|
87
|
+
export { default as MonthYearField } from './MonthYearField';
|
|
88
|
+
export type * from './MonthYearField';
|
|
83
89
|
export { default as NumberField } from './NumberField';
|
|
84
90
|
export type * from './NumberField';
|
|
85
91
|
export { default as Paragraph } from './Paragraph';
|
|
@@ -102,6 +108,8 @@ export { default as SelectCard } from './SelectCard';
|
|
|
102
108
|
export type * from './SelectCard';
|
|
103
109
|
export { default as SelectNative } from './SelectNative';
|
|
104
110
|
export type * from './SelectNative';
|
|
111
|
+
export { default as SkeletonLoader } from './SkeletonLoader';
|
|
112
|
+
export type * from './SkeletonLoader';
|
|
105
113
|
export { default as Slider } from './Slider';
|
|
106
114
|
export type * from './Slider';
|
|
107
115
|
export { default as Spacer } from './Spacer';
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../assets/global.css';/* empty css */
|
|
2
2
|
import { Accordion, AccordionGroup } from "./Accordion/Accordion.js";
|
|
3
|
+
import { AviosCurrencyBadge } from "./AviosCurrencyBadge/AviosCurrencyBadge.js";
|
|
3
4
|
import { AviosCurrency } from "./AviosCurrency/AviosCurrency.js";
|
|
4
5
|
import { AviosBadge } from "./AviosBadge/AviosBadge.js";
|
|
5
6
|
import { AviosCurrencySymbol } from "./AviosCurrencySymbol/AviosCurrencySymbol.js";
|
|
@@ -9,6 +10,7 @@ import { Button } from "./Button/Button.js";
|
|
|
9
10
|
import { ButtonGroup } from "./ButtonGroup/ButtonGroup.js";
|
|
10
11
|
import { CalloutBanner } from "./CalloutBanner/CalloutBanner.js";
|
|
11
12
|
import { default as default2 } from "./CardSection/CardSection.js";
|
|
13
|
+
import { Carousel } from "./Carousel/Carousel.js";
|
|
12
14
|
import { Checkbox } from "./Checkbox/Checkbox.js";
|
|
13
15
|
import { CheckboxGroup } from "./CheckboxGroup/CheckboxGroup.js";
|
|
14
16
|
import { ClearFieldButton } from "./ClearFieldButton/ClearFieldButton.js";
|
|
@@ -40,6 +42,7 @@ import { ListBox } from "./ListBox/ListBox.js";
|
|
|
40
42
|
import { ListBoxItem } from "./ListBoxItem/ListBoxItem.js";
|
|
41
43
|
import { default as default7 } from "./LoadingSpinner/LoadingSpinner.js";
|
|
42
44
|
import { Menu } from "./Menu/Menu.js";
|
|
45
|
+
import { MonthYearField } from "./MonthYearField/MonthYearField.js";
|
|
43
46
|
import { NumberField } from "./NumberField/NumberField.js";
|
|
44
47
|
import { Paragraph } from "./Paragraph/Paragraph.js";
|
|
45
48
|
import { PhoneNumberField } from "./PhoneNumberField/PhoneNumberField.js";
|
|
@@ -51,6 +54,7 @@ import { SearchField } from "./SearchField/SearchField.js";
|
|
|
51
54
|
import { default as default8 } from "./Section/Section.js";
|
|
52
55
|
import { default as default9 } from "./SelectCard/SelectCard.js";
|
|
53
56
|
import { SelectNative } from "./SelectNative/SelectNative.js";
|
|
57
|
+
import { SkeletonLoader } from "./SkeletonLoader/SkeletonLoader.js";
|
|
54
58
|
import { Slider } from "./Slider/Slider.js";
|
|
55
59
|
import { Spacer } from "./Spacer/Spacer.js";
|
|
56
60
|
import { SubHeading } from "./SubHeading/SubHeading.js";
|
|
@@ -67,6 +71,7 @@ export {
|
|
|
67
71
|
AccordionGroup,
|
|
68
72
|
AviosBadge,
|
|
69
73
|
AviosCurrency,
|
|
74
|
+
AviosCurrencyBadge,
|
|
70
75
|
AviosCurrencySymbol,
|
|
71
76
|
Badge,
|
|
72
77
|
Box,
|
|
@@ -74,6 +79,7 @@ export {
|
|
|
74
79
|
ButtonGroup,
|
|
75
80
|
CalloutBanner,
|
|
76
81
|
default2 as CardSection,
|
|
82
|
+
Carousel,
|
|
77
83
|
Checkbox,
|
|
78
84
|
CheckboxGroup,
|
|
79
85
|
ClearFieldButton,
|
|
@@ -105,6 +111,7 @@ export {
|
|
|
105
111
|
ListBoxItem,
|
|
106
112
|
default7 as LoadingSpinner,
|
|
107
113
|
Menu,
|
|
114
|
+
MonthYearField,
|
|
108
115
|
NumberField,
|
|
109
116
|
Paragraph,
|
|
110
117
|
PasswordField,
|
|
@@ -116,6 +123,7 @@ export {
|
|
|
116
123
|
default8 as Section,
|
|
117
124
|
default9 as SelectCard,
|
|
118
125
|
SelectNative,
|
|
126
|
+
SkeletonLoader,
|
|
119
127
|
Slider,
|
|
120
128
|
Spacer,
|
|
121
129
|
SubHeading,
|
|
@@ -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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './assets/global.css';/* empty css */
|
|
2
2
|
import { Accordion, AccordionGroup } from "./components/Accordion/Accordion.js";
|
|
3
|
+
import { AviosCurrencyBadge } from "./components/AviosCurrencyBadge/AviosCurrencyBadge.js";
|
|
3
4
|
import { AviosCurrency } from "./components/AviosCurrency/AviosCurrency.js";
|
|
4
5
|
import { AviosBadge } from "./components/AviosBadge/AviosBadge.js";
|
|
5
6
|
import { AviosCurrencySymbol } from "./components/AviosCurrencySymbol/AviosCurrencySymbol.js";
|
|
@@ -9,6 +10,7 @@ import { Button } from "./components/Button/Button.js";
|
|
|
9
10
|
import { ButtonGroup } from "./components/ButtonGroup/ButtonGroup.js";
|
|
10
11
|
import { CalloutBanner } from "./components/CalloutBanner/CalloutBanner.js";
|
|
11
12
|
import { default as default2 } from "./components/CardSection/CardSection.js";
|
|
13
|
+
import { Carousel } from "./components/Carousel/Carousel.js";
|
|
12
14
|
import { Checkbox } from "./components/Checkbox/Checkbox.js";
|
|
13
15
|
import { CheckboxGroup } from "./components/CheckboxGroup/CheckboxGroup.js";
|
|
14
16
|
import { ClearFieldButton } from "./components/ClearFieldButton/ClearFieldButton.js";
|
|
@@ -40,6 +42,7 @@ import { ListBox } from "./components/ListBox/ListBox.js";
|
|
|
40
42
|
import { ListBoxItem } from "./components/ListBoxItem/ListBoxItem.js";
|
|
41
43
|
import { default as default7 } from "./components/LoadingSpinner/LoadingSpinner.js";
|
|
42
44
|
import { Menu } from "./components/Menu/Menu.js";
|
|
45
|
+
import { MonthYearField } from "./components/MonthYearField/MonthYearField.js";
|
|
43
46
|
import { NumberField } from "./components/NumberField/NumberField.js";
|
|
44
47
|
import { Paragraph } from "./components/Paragraph/Paragraph.js";
|
|
45
48
|
import { PhoneNumberField } from "./components/PhoneNumberField/PhoneNumberField.js";
|
|
@@ -51,6 +54,7 @@ import { SearchField } from "./components/SearchField/SearchField.js";
|
|
|
51
54
|
import { default as default8 } from "./components/Section/Section.js";
|
|
52
55
|
import { default as default9 } from "./components/SelectCard/SelectCard.js";
|
|
53
56
|
import { SelectNative } from "./components/SelectNative/SelectNative.js";
|
|
57
|
+
import { SkeletonLoader } from "./components/SkeletonLoader/SkeletonLoader.js";
|
|
54
58
|
import { Slider } from "./components/Slider/Slider.js";
|
|
55
59
|
import { Spacer } from "./components/Spacer/Spacer.js";
|
|
56
60
|
import { SubHeading } from "./components/SubHeading/SubHeading.js";
|
|
@@ -67,6 +71,7 @@ export {
|
|
|
67
71
|
AccordionGroup,
|
|
68
72
|
AviosBadge,
|
|
69
73
|
AviosCurrency,
|
|
74
|
+
AviosCurrencyBadge,
|
|
70
75
|
AviosCurrencySymbol,
|
|
71
76
|
Badge,
|
|
72
77
|
Box,
|
|
@@ -74,6 +79,7 @@ export {
|
|
|
74
79
|
ButtonGroup,
|
|
75
80
|
CalloutBanner,
|
|
76
81
|
default2 as CardSection,
|
|
82
|
+
Carousel,
|
|
77
83
|
Checkbox,
|
|
78
84
|
CheckboxGroup,
|
|
79
85
|
ClearFieldButton,
|
|
@@ -105,6 +111,7 @@ export {
|
|
|
105
111
|
ListBoxItem,
|
|
106
112
|
default7 as LoadingSpinner,
|
|
107
113
|
Menu,
|
|
114
|
+
MonthYearField,
|
|
108
115
|
NumberField,
|
|
109
116
|
Paragraph,
|
|
110
117
|
PasswordField,
|
|
@@ -116,6 +123,7 @@ export {
|
|
|
116
123
|
default8 as Section,
|
|
117
124
|
default9 as SelectCard,
|
|
118
125
|
SelectNative,
|
|
126
|
+
SkeletonLoader,
|
|
119
127
|
Slider,
|
|
120
128
|
Spacer,
|
|
121
129
|
SubHeading,
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useRef, useState, useEffect, useLayoutEffect, useMemo } from "react";
|
|
2
2
|
function __rest(s, e) {
|
|
3
3
|
var t = {};
|
|
4
4
|
for (var p in s) {
|
|
@@ -561,12 +561,12 @@ function NumberFormatBase(props) {
|
|
|
561
561
|
onBlur: _onBlur
|
|
562
562
|
});
|
|
563
563
|
if (displayType === "text") {
|
|
564
|
-
return renderText ?
|
|
564
|
+
return renderText ? React__default.createElement(React__default.Fragment, null, renderText(formattedValue, otherProps) || null) : React__default.createElement("span", Object.assign({}, otherProps, { ref: getInputRef }), formattedValue);
|
|
565
565
|
} else if (customInput) {
|
|
566
566
|
var CustomInput = customInput;
|
|
567
|
-
return
|
|
567
|
+
return React__default.createElement(CustomInput, Object.assign({}, inputProps, { ref: getInputRef }));
|
|
568
568
|
}
|
|
569
|
-
return
|
|
569
|
+
return React__default.createElement("input", Object.assign({}, inputProps, { ref: getInputRef }));
|
|
570
570
|
}
|
|
571
571
|
function format$1(numStr, props) {
|
|
572
572
|
var format = props.format;
|
|
@@ -750,11 +750,11 @@ function usePatternFormat(props) {
|
|
|
750
750
|
}
|
|
751
751
|
function PatternFormat(props) {
|
|
752
752
|
var patternFormatProps = usePatternFormat(props);
|
|
753
|
-
return
|
|
753
|
+
return React__default.createElement(NumberFormatBase, Object.assign({}, patternFormatProps));
|
|
754
754
|
}
|
|
755
755
|
export {
|
|
756
756
|
NumberFormatBase as N,
|
|
757
757
|
PatternFormat as P,
|
|
758
758
|
usePatternFormat as u
|
|
759
759
|
};
|
|
760
|
-
//# sourceMappingURL=react-number-format.es-
|
|
760
|
+
//# sourceMappingURL=react-number-format.es-Dbc1db6s.js.map
|
package/dist/{react-number-format.es-BjKL6crg.js.map → react-number-format.es-Dbc1db6s.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-number-format.es-
|
|
1
|
+
{"version":3,"file":"react-number-format.es-Dbc1db6s.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alto-avios/alto-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A react component library for Alto Design System",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ian Caldwell IAGL",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"class-variance-authority": "^0.7.0",
|
|
41
|
+
"react-aria-carousel": "^0.2.0",
|
|
41
42
|
"react-aria-components": "^1.5.0",
|
|
42
43
|
"react-number-format": "^5.4.3",
|
|
43
44
|
"ts-node": "^10.9.2",
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
"prettier": "3.3.3",
|
|
92
93
|
"react": "^18.3.1",
|
|
93
94
|
"react-dom": "^18.3.1",
|
|
95
|
+
"react-loading-skeleton": "^3.5.0",
|
|
94
96
|
"react-remove-attr": "^0.0.6",
|
|
95
97
|
"rimraf": "^6.0.1",
|
|
96
98
|
"standard-version": "^9.5.0",
|
|
@@ -106,7 +108,7 @@
|
|
|
106
108
|
"wait-on": "^8.0.1"
|
|
107
109
|
},
|
|
108
110
|
"peerDependencies": {
|
|
109
|
-
"@alto-avios/alto-tokens": "^3.
|
|
111
|
+
"@alto-avios/alto-tokens": "^3.3.0",
|
|
110
112
|
"react": "^18.0.0"
|
|
111
113
|
},
|
|
112
114
|
"main": "dist/index.js",
|