@alto-avios/alto-ui 4.2.0 → 5.0.0-alpha.1

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.
@@ -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,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { AriaDialogProps } from 'react-aria';
2
+ import { AriaDialogProps } from '@react-types/dialog';
3
3
  type DialogSize = 'dialogSmall' | 'dialogMedium' | 'dialogLarge';
4
4
  type DialogRole = 'alertdialog' | 'dialog';
5
5
  export interface DialogProps extends AriaDialogProps {
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React__default, { useRef } from "react";
3
- import { IconButton } from "../IconButton/IconButton.js";
4
- import { OverlayContainer, useOverlay, usePreventScroll, useModal } from "@react-aria/overlays";
5
3
  import { useDialog } from "@react-aria/dialog";
4
+ import { OverlayContainer, useOverlay, usePreventScroll, useModal } from "@react-aria/overlays";
6
5
  import { FocusScope } from "@react-aria/focus";
6
+ import { IconButton } from "../IconButton/IconButton.js";
7
7
  import '../../assets/Dialog.css';const dialogWrapper = "_dialogWrapper_o29gm_1";
8
8
  const overlay = "_overlay_o29gm_10";
9
9
  const dialog = "_dialog_o29gm_1";
@@ -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 React__default.useMemo(() => {
54
- if (!forwardedRef) return internalRef;
55
- return (node) => {
56
- if (typeof forwardedRef === "function") {
57
- forwardedRef(node);
58
- } else if (forwardedRef && "current" in forwardedRef) {
59
- forwardedRef.current = node;
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
- ...children.props
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 */
@@ -1,8 +1,8 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { TextField } from "react-aria-components";
3
3
  import { useId } from "react";
4
- import { FieldHeader } from "../FieldHeader/FieldHeader.js";
5
4
  import { useFocusRing } from "@react-aria/focus";
5
+ import { FieldHeader } from "../FieldHeader/FieldHeader.js";
6
6
  import '../../assets/SelectNative.css';const select = "_select_16vwh_1";
7
7
  const selectInput = "_selectInput_16vwh_10";
8
8
  const styles = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alto-avios/alto-ui",
3
- "version": "4.2.0",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "A react component library for Alto Design System",
5
5
  "author": {
6
6
  "name": "Ian Caldwell IAGL",
@@ -23,6 +23,7 @@
23
23
  "test-a11y": "test-storybook",
24
24
  "clean-dist": "rimraf dist",
25
25
  "vite": "npm run clean-dist && tsc --p ./tsconfig.build.json && vite build",
26
+ "vite:analyze": "vite build --mode analyze",
26
27
  "storybook": "storybook dev -p 6006",
27
28
  "build:storybook": "storybook build",
28
29
  "lint": "eslint",
@@ -37,8 +38,16 @@
37
38
  "release:major": "standard-version --release-as major"
38
39
  },
39
40
  "dependencies": {
41
+ "@react-aria/button": "3.14.1",
42
+ "@react-aria/dialog": "3.5.30",
43
+ "@react-aria/focus": "3.21.1",
44
+ "@react-aria/interactions": "3.25.5",
45
+ "@react-aria/overlays": "3.29.1",
46
+ "@react-aria/utils": "3.30.1",
47
+ "@react-types/dialog": "3.5.21",
48
+ "react-stately": "3.41.0",
40
49
  "class-variance-authority": "^0.7.0",
41
- "react-aria-carousel": "0.2.0",
50
+ "react-aria-carousel": "^0.2.0",
42
51
  "react-aria-components": "1.5.0",
43
52
  "react-number-format": "^5.4.3",
44
53
  "ts-node": "^10.9.2",
@@ -67,8 +76,8 @@
67
76
  "@testing-library/react": "^16.0.0",
68
77
  "@types/jest": "^29.5.12",
69
78
  "@types/node": "^22.3.0",
70
- "@types/react": "^18.3.11",
71
- "@types/react-dom": "^18.3.0",
79
+ "@types/react": "^18.3.1",
80
+ "@types/react-dom": "^18.3.1",
72
81
  "@vitejs/plugin-react": "^4.3.1",
73
82
  "autoprefixer": "^10.4.19",
74
83
  "axe-playwright": "^2.0.3",
@@ -95,6 +104,7 @@
95
104
  "react-loading-skeleton": "^3.5.0",
96
105
  "react-remove-attr": "^0.0.6",
97
106
  "rimraf": "^6.0.1",
107
+ "rollup-plugin-visualizer": "^6.0.3",
98
108
  "standard-version": "^9.5.0",
99
109
  "terser": "^5.31.3",
100
110
  "ts-jest": "^29.2.5",
@@ -102,14 +112,14 @@
102
112
  "typescript": "^5.4.5",
103
113
  "typescript-eslint": "^8.14.0",
104
114
  "vite": "^5.3.5",
105
- "vite-bundle-visualizer": "^1.2.1",
106
115
  "vite-plugin-dts": "^4.0.0-beta.2",
107
116
  "vite-plugin-lib-inject-css": "^2.1.1",
108
117
  "wait-on": "^8.0.1"
109
118
  },
110
119
  "peerDependencies": {
111
- "@alto-avios/alto-tokens": "^3.3.0",
112
- "react": "^18.0.0"
120
+ "@alto-avios/alto-tokens": "^3.4.0",
121
+ "react": "^18.3.1 || ^19.0.0",
122
+ "react-dom": "^18.3.1 || ^19.0.0"
113
123
  },
114
124
  "main": "dist/index.js",
115
125
  "module": "dist/index.js",