@alto-avios/alto-ui 4.2.0 → 5.0.0-alpha.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/components/Accordion/Accordion.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/ErrorSummary/ErrorSummary.d.ts +1 -4
- package/dist/components/Image/Image.js +11 -13
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/package.json +6 -5
|
@@ -115,7 +115,7 @@ const AccordionGroup = ({
|
|
|
115
115
|
}) => {
|
|
116
116
|
const groupClasses = [styles.accordionGroup, className].filter(Boolean).join(" ");
|
|
117
117
|
const defaultExpandedKeys = React__default.Children.toArray(children).map((child, index) => {
|
|
118
|
-
if (React__default.isValidElement(child) && child.props.defaultExpanded) {
|
|
118
|
+
if (React__default.isValidElement(child) && typeof child.props === "object" && child.props !== null && "defaultExpanded" in child.props && child.props.defaultExpanded) {
|
|
119
119
|
return `accordion-${index}`;
|
|
120
120
|
}
|
|
121
121
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, ElementType, ReactNode } from 'react';
|
|
1
|
+
import { ComponentType, ElementType, ReactNode, JSX } from 'react';
|
|
2
2
|
import { AriaButtonOptions } from '@react-aria/button';
|
|
3
3
|
import { HoverProps } from '@react-aria/interactions';
|
|
4
4
|
import { IconProps } from '../Icon/Icon';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { CalloutBannerProps } from '../CalloutBanner/CalloutBanner';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
export interface ErrorSummaryProps extends Omit<CalloutBannerProps, 'emphasis' | 'styleVariant' | 'iconProps' | 'dismissButtonProps' | 'onDismiss' | 'hideIllustration' | 'dismissButtonTooltipLabel' | 'customAsset' | 'label' | 'alignButtons'> {
|
|
4
|
-
|
|
5
|
-
* One or more error messages to display in the summary
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactElement[] | React.ReactElement;
|
|
4
|
+
children: React.ReactElement<unknown>[] | React.ReactElement<unknown>;
|
|
8
5
|
}
|
|
9
6
|
export declare const ErrorSummary: ({ title, description, children, ...props }: ErrorSummaryProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
7
|
export default ErrorSummary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useState, useRef, useEffect } from "react";
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useMemo } from "react";
|
|
3
3
|
import { c as cva } from "../../index-DdUYounA.js";
|
|
4
4
|
import { borderVariants } from "../../utils/border/border.js";
|
|
5
5
|
import { backgroundColorVariants } from "../../utils/backgroundColor/backgroundColor.js";
|
|
@@ -42,7 +42,7 @@ const useImageLoaded = (onLoadProp) => {
|
|
|
42
42
|
if (ref.current && ref.current.complete) {
|
|
43
43
|
setLoaded(true);
|
|
44
44
|
}
|
|
45
|
-
});
|
|
45
|
+
}, []);
|
|
46
46
|
return {
|
|
47
47
|
ref,
|
|
48
48
|
loaded,
|
|
@@ -50,16 +50,13 @@ const useImageLoaded = (onLoadProp) => {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
const useMergedRef = (internalRef, forwardedRef) => {
|
|
53
|
-
return
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
internalRef.current = node;
|
|
62
|
-
};
|
|
53
|
+
return useMemo(() => (node) => {
|
|
54
|
+
if (typeof forwardedRef === "function") {
|
|
55
|
+
forwardedRef(node);
|
|
56
|
+
} else if (forwardedRef && "current" in forwardedRef) {
|
|
57
|
+
forwardedRef.current = node;
|
|
58
|
+
}
|
|
59
|
+
internalRef.current = node;
|
|
63
60
|
}, [internalRef, forwardedRef]);
|
|
64
61
|
};
|
|
65
62
|
const Image = React__default.forwardRef(({
|
|
@@ -115,9 +112,10 @@ const Image = React__default.forwardRef(({
|
|
|
115
112
|
...props
|
|
116
113
|
};
|
|
117
114
|
if (asChild && React__default.isValidElement(children)) {
|
|
115
|
+
const childProps = typeof children.props === "object" && children.props !== null ? children.props : {};
|
|
118
116
|
return React__default.cloneElement(children, {
|
|
119
117
|
...imgProps,
|
|
120
|
-
...
|
|
118
|
+
...childProps
|
|
121
119
|
});
|
|
122
120
|
}
|
|
123
121
|
return /* @__PURE__ */ jsx("img", { ...imgProps });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -37,7 +37,7 @@ export interface PopoverProps {
|
|
|
37
37
|
/** Direction of the arrow that points to the trigger element */
|
|
38
38
|
arrowDirection?: ArrowDirectionType;
|
|
39
39
|
/** Reference to the trigger element that opens the popover */
|
|
40
|
-
triggerRef: React.RefObject<HTMLButtonElement> | {
|
|
40
|
+
triggerRef: React.RefObject<HTMLButtonElement | null> | {
|
|
41
41
|
current: HTMLElement;
|
|
42
42
|
};
|
|
43
43
|
/** Whether to show the directional arrow on the popover */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alto-avios/alto-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.0",
|
|
4
4
|
"description": "A react component library for Alto Design System",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ian Caldwell IAGL",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"@testing-library/react": "^16.0.0",
|
|
68
68
|
"@types/jest": "^29.5.12",
|
|
69
69
|
"@types/node": "^22.3.0",
|
|
70
|
-
"@types/react": "^18.3.
|
|
71
|
-
"@types/react-dom": "^18.3.
|
|
70
|
+
"@types/react": "^18.3.1",
|
|
71
|
+
"@types/react-dom": "^18.3.1",
|
|
72
72
|
"@vitejs/plugin-react": "^4.3.1",
|
|
73
73
|
"autoprefixer": "^10.4.19",
|
|
74
74
|
"axe-playwright": "^2.0.3",
|
|
@@ -108,8 +108,9 @@
|
|
|
108
108
|
"wait-on": "^8.0.1"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"@alto-avios/alto-tokens": "^3.
|
|
112
|
-
"react": "^18.0.0"
|
|
111
|
+
"@alto-avios/alto-tokens": "^3.4.0",
|
|
112
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
113
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
113
114
|
},
|
|
114
115
|
"main": "dist/index.js",
|
|
115
116
|
"module": "dist/index.js",
|