@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.
Files changed (123) hide show
  1. package/dist/IconButton.module-4obqG6tY.js +1050 -0
  2. package/dist/IconButton.module-4obqG6tY.js.map +1 -0
  3. package/dist/assets/AutoplayControl.css +1 -0
  4. package/dist/assets/AviosCurrency.css +1 -1
  5. package/dist/assets/AviosCurrencyBadge.css +1 -0
  6. package/dist/assets/Button.css +1 -1
  7. package/dist/assets/Carousel.css +1 -0
  8. package/dist/assets/CarouselButton.css +1 -0
  9. package/dist/assets/CarouselDots.css +1 -0
  10. package/dist/assets/ComboBox.css +1 -1
  11. package/dist/assets/LoadingSpinner.css +1 -1
  12. package/dist/assets/MonthYearField.css +1 -0
  13. package/dist/assets/SearchField.css +1 -1
  14. package/dist/assets/SelectNative.css +1 -1
  15. package/dist/assets/SkeletonLoader.css +1 -0
  16. package/dist/assets/TextAreaField.css +1 -1
  17. package/dist/components/Accordion/Accordion.js +8 -8
  18. package/dist/components/AviosCurrency/AviosCurrency.d.ts +1 -2
  19. package/dist/components/AviosCurrency/AviosCurrency.js +40 -36
  20. package/dist/components/AviosCurrency/AviosCurrency.js.map +1 -1
  21. package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.d.ts +48 -0
  22. package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js +165 -0
  23. package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js.map +1 -0
  24. package/dist/components/AviosCurrencyBadge/index.d.ts +1 -0
  25. package/dist/components/AviosCurrencyBadge/index.js +5 -0
  26. package/dist/components/AviosCurrencyBadge/index.js.map +1 -0
  27. package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js +3 -3
  28. package/dist/components/Badge/Badge.d.ts +1 -16
  29. package/dist/components/Badge/Badge.js +3 -9
  30. package/dist/components/Badge/Badge.js.map +1 -1
  31. package/dist/components/Box/Box.d.ts +0 -4
  32. package/dist/components/Box/Box.js +1 -5
  33. package/dist/components/Box/Box.js.map +1 -1
  34. package/dist/components/Button/Button.d.ts +34 -64
  35. package/dist/components/Button/Button.js +61 -44
  36. package/dist/components/Button/Button.js.map +1 -1
  37. package/dist/components/ButtonGroup/ButtonGroup.js +2 -2
  38. package/dist/components/CalloutBanner/CalloutBanner.js +3 -3
  39. package/dist/components/Carousel/AutoplayControl/AutoplayControl.d.ts +27 -0
  40. package/dist/components/Carousel/AutoplayControl/AutoplayControl.js +115 -0
  41. package/dist/components/Carousel/AutoplayControl/AutoplayControl.js.map +1 -0
  42. package/dist/components/Carousel/Carousel.d.ts +171 -0
  43. package/dist/components/Carousel/Carousel.js +373 -0
  44. package/dist/components/Carousel/Carousel.js.map +1 -0
  45. package/dist/components/Carousel/CarouselButton/CarouselButton.d.ts +44 -0
  46. package/dist/components/Carousel/CarouselButton/CarouselButton.js +195 -0
  47. package/dist/components/Carousel/CarouselButton/CarouselButton.js.map +1 -0
  48. package/dist/components/Carousel/CarouselControls.d.ts +7 -0
  49. package/dist/components/Carousel/CarouselControls.js +305 -0
  50. package/dist/components/Carousel/CarouselControls.js.map +1 -0
  51. package/dist/components/Carousel/CarouselDots/CarouselDots.d.ts +16 -0
  52. package/dist/components/Carousel/CarouselDots/CarouselDots.js +150 -0
  53. package/dist/components/Carousel/CarouselDots/CarouselDots.js.map +1 -0
  54. package/dist/components/Carousel/index.d.ts +1 -0
  55. package/dist/components/Carousel/index.js +5 -0
  56. package/dist/components/Carousel/index.js.map +1 -0
  57. package/dist/components/ComboBox/ComboBox.js +10 -13
  58. package/dist/components/ComboBox/ComboBox.js.map +1 -1
  59. package/dist/components/CreditCardNumberField/CreditCardNumberField.js +5 -5
  60. package/dist/components/CreditCardSecurityCodeField/CreditCardSecurityCodeField.js +5 -5
  61. package/dist/components/Dialog/Dialog.js +4 -4
  62. package/dist/components/ErrorSummary/ErrorSummary.js +4 -4
  63. package/dist/components/FieldError/FieldError.d.ts +5 -1
  64. package/dist/components/FieldError/FieldError.js +8 -1
  65. package/dist/components/FieldError/FieldError.js.map +1 -1
  66. package/dist/components/FieldHeader/FieldHeader.js +1 -1
  67. package/dist/components/Grid/Grid.d.ts +6 -1
  68. package/dist/components/Grid/Grid.js +2 -0
  69. package/dist/components/Grid/Grid.js.map +1 -1
  70. package/dist/components/Heading/Heading.d.ts +1 -6
  71. package/dist/components/Heading/Heading.js +1 -6
  72. package/dist/components/Heading/Heading.js.map +1 -1
  73. package/dist/components/Icon/Icon.d.ts +1 -6
  74. package/dist/components/IconButton/IconButton.d.ts +3 -15
  75. package/dist/components/IconButton/IconButton.js +18 -128
  76. package/dist/components/IconButton/IconButton.js.map +1 -1
  77. package/dist/components/Image/Image.d.ts +0 -1
  78. package/dist/components/Image/Image.js +8 -13
  79. package/dist/components/Image/Image.js.map +1 -1
  80. package/dist/components/Link/Link.d.ts +1 -16
  81. package/dist/components/Link/Link.js +4 -11
  82. package/dist/components/Link/Link.js.map +1 -1
  83. package/dist/components/ListBoxItem/index.d.ts +1 -1
  84. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -1
  85. package/dist/components/LoadingSpinner/LoadingSpinner.js +6 -4
  86. package/dist/components/LoadingSpinner/LoadingSpinner.js.map +1 -1
  87. package/dist/components/MonthYearField/MonthYearField.d.ts +107 -0
  88. package/dist/components/MonthYearField/MonthYearField.js +332 -0
  89. package/dist/components/MonthYearField/MonthYearField.js.map +1 -0
  90. package/dist/components/MonthYearField/index.d.ts +2 -0
  91. package/dist/components/MonthYearField/index.js +5 -0
  92. package/dist/components/MonthYearField/index.js.map +1 -0
  93. package/dist/components/Paragraph/Paragraph.d.ts +1 -6
  94. package/dist/components/Paragraph/Paragraph.js +1 -6
  95. package/dist/components/Paragraph/Paragraph.js.map +1 -1
  96. package/dist/components/PasswordField/PasswordField.js +3 -3
  97. package/dist/components/PhoneNumberField/PhoneNumberField.js +1 -1
  98. package/dist/components/Popover/Popover.js +2 -2
  99. package/dist/components/SearchField/SearchField.js +9 -7
  100. package/dist/components/SearchField/SearchField.js.map +1 -1
  101. package/dist/components/Section/Section.d.ts +42 -1
  102. package/dist/components/Section/Section.js +8 -13
  103. package/dist/components/Section/Section.js.map +1 -1
  104. package/dist/components/SelectCard/SelectCard.js +2 -2
  105. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +50 -0
  106. package/dist/components/SkeletonLoader/SkeletonLoader.js +150 -0
  107. package/dist/components/SkeletonLoader/SkeletonLoader.js.map +1 -0
  108. package/dist/components/SkeletonLoader/index.d.ts +1 -0
  109. package/dist/components/SkeletonLoader/index.js +5 -0
  110. package/dist/components/SkeletonLoader/index.js.map +1 -0
  111. package/dist/components/SubHeading/SubHeading.d.ts +1 -6
  112. package/dist/components/SubHeading/SubHeading.js +1 -6
  113. package/dist/components/SubHeading/SubHeading.js.map +1 -1
  114. package/dist/components/TextAreaField/TextAreaField.js +1 -1
  115. package/dist/components/_base/Field/Field.js +4 -4
  116. package/dist/components/index.d.ts +8 -0
  117. package/dist/components/index.js +8 -0
  118. package/dist/components/index.js.map +1 -1
  119. package/dist/index.js +8 -0
  120. package/dist/index.js.map +1 -1
  121. package/dist/{react-number-format.es-BjKL6crg.js → react-number-format.es-Dbc1db6s.js} +6 -6
  122. package/dist/{react-number-format.es-BjKL6crg.js.map → react-number-format.es-Dbc1db6s.js.map} +1 -1
  123. package/package.json +4 -2
@@ -0,0 +1,150 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { useFocusRing } from "@react-aria/focus";
4
+ import { useHover } from "@react-aria/interactions";
5
+ import { focusStyleVariants } from "../../../utils/focus/focusStyles.js";
6
+ import '../../../assets/CarouselDots.css';const tabsContainer = "_tabsContainer_1aqyc_1";
7
+ const tabs = "_tabs_1aqyc_1";
8
+ const transparent = "_transparent_1aqyc_21";
9
+ const dotsScroller = "_dotsScroller_1aqyc_25";
10
+ const tab = "_tab_1aqyc_1";
11
+ const activeTab = "_activeTab_1aqyc_52";
12
+ const styles = {
13
+ tabsContainer,
14
+ tabs,
15
+ transparent,
16
+ dotsScroller,
17
+ tab,
18
+ activeTab
19
+ };
20
+ const CarouselDots = ({
21
+ totalItems,
22
+ currentPage,
23
+ onDotClick,
24
+ dotsSize = "md",
25
+ variant = "standard",
26
+ focusStyle = "default",
27
+ className = "",
28
+ dotsWrapperClassName = "",
29
+ dotClassName = "",
30
+ activeDotClassName = "",
31
+ isTransitioning = false
32
+ }) => {
33
+ const tabsRef = useRef(null);
34
+ const wrapperRef = useRef(null);
35
+ const {
36
+ isFocusVisible,
37
+ focusProps
38
+ } = useFocusRing();
39
+ const {
40
+ isHovered,
41
+ hoverProps
42
+ } = useHover({});
43
+ const handleKeyDown = (e) => {
44
+ if (isTransitioning) return;
45
+ let handled = false;
46
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") {
47
+ e.preventDefault();
48
+ const nextPage = (currentPage + 1) % totalItems;
49
+ onDotClick(nextPage);
50
+ handled = true;
51
+ } else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
52
+ e.preventDefault();
53
+ const prevPage = (currentPage - 1 + totalItems) % totalItems;
54
+ onDotClick(prevPage);
55
+ handled = true;
56
+ } else if (e.key === "Home") {
57
+ e.preventDefault();
58
+ onDotClick(0);
59
+ handled = true;
60
+ } else if (e.key === "End") {
61
+ e.preventDefault();
62
+ onDotClick(totalItems - 1);
63
+ handled = true;
64
+ } else if (e.key === " " || e.key === "Enter") {
65
+ e.preventDefault();
66
+ handled = true;
67
+ }
68
+ if (handled && tabsRef.current) {
69
+ tabsRef.current.focus();
70
+ }
71
+ };
72
+ const getContainerClasses = () => {
73
+ const classes = [styles.tabsContainer];
74
+ if (className) classes.push(className);
75
+ if (isTransitioning) classes.push(styles.transitioning);
76
+ return classes.join(" ");
77
+ };
78
+ const getDotsWrapperClasses = () => {
79
+ const classes = [styles.tabs];
80
+ if (variant === "transparent") classes.push(styles.transparent);
81
+ classes.push(focusStyleVariants({
82
+ focusStyle
83
+ }));
84
+ if (dotsWrapperClassName) classes.push(dotsWrapperClassName);
85
+ return classes.join(" ");
86
+ };
87
+ const handleDotClick = (index) => {
88
+ if (isTransitioning) return;
89
+ onDotClick(index);
90
+ };
91
+ const handleDotKeyDown = (e, index) => {
92
+ if (isTransitioning) return;
93
+ if (e.key === " " || e.key === "Enter") {
94
+ e.preventDefault();
95
+ e.stopPropagation();
96
+ onDotClick(index);
97
+ }
98
+ };
99
+ const getDotAriaLabel = (index) => {
100
+ const slideNumber = index + 1;
101
+ const isCurrent = index === currentPage;
102
+ return `Go to slide ${slideNumber}${isCurrent ? ", current slide" : ""}`;
103
+ };
104
+ const getContainerAriaLabel = () => {
105
+ return `Slide pagination, ${totalItems} slides, currently on slide ${currentPage + 1}`;
106
+ };
107
+ return /* @__PURE__ */ jsx("div", { className: getContainerClasses(), ref: wrapperRef, "data-dot-size": dotsSize, "data-transitioning": isTransitioning ? "true" : void 0, children: /* @__PURE__ */ jsx("div", { className: getDotsWrapperClasses(), ref: tabsRef, tabIndex: 0, role: "tablist", "aria-label": getContainerAriaLabel(), onKeyDown: handleKeyDown, "data-focused": isFocusVisible ? true : void 0, "data-focus-visible": isFocusVisible ? true : void 0, "data-hovered": isHovered ? true : void 0, "aria-activedescendant": `dot-${currentPage}`, ...focusProps, ...hoverProps, children: /* @__PURE__ */ jsx("div", { className: styles.dotsScroller, children: Array.from({
108
+ length: totalItems
109
+ }, (_, index) => {
110
+ const isActive = index === currentPage;
111
+ const baseStyle = {
112
+ width: dotsSize === "lg" ? "12px" : "8px",
113
+ height: dotsSize === "lg" ? "12px" : "8px",
114
+ borderRadius: "50%",
115
+ backgroundColor: isActive ? "var(--alto-sem-color-fg-primary)" : "rgba(0, 0, 0, 0.3)",
116
+ border: "none",
117
+ padding: 0,
118
+ cursor: isTransitioning ? "default" : "pointer",
119
+ display: "block",
120
+ flexShrink: 0,
121
+ margin: 0,
122
+ transition: "background-color 0.2s ease"
123
+ };
124
+ return /* @__PURE__ */ jsx(
125
+ "button",
126
+ {
127
+ id: `dot-${index}`,
128
+ type: "button",
129
+ className: `${styles.tab} ${isActive ? styles.activeTab : ""} ${dotClassName || ""} ${isActive && activeDotClassName ? activeDotClassName : ""}`,
130
+ onClick: () => handleDotClick(index),
131
+ onKeyDown: (e) => handleDotKeyDown(e, index),
132
+ "aria-label": getDotAriaLabel(index),
133
+ "aria-selected": isActive,
134
+ "aria-current": isActive ? "true" : "false",
135
+ role: "tab",
136
+ "data-tab-index": index,
137
+ tabIndex: -1,
138
+ style: baseStyle,
139
+ "aria-hidden": "true",
140
+ disabled: isTransitioning
141
+ },
142
+ index
143
+ );
144
+ }) }) }) });
145
+ };
146
+ export {
147
+ CarouselDots,
148
+ CarouselDots as default
149
+ };
150
+ //# sourceMappingURL=CarouselDots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CarouselDots.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from './Carousel';
@@ -0,0 +1,5 @@
1
+ import { Carousel } from "./Carousel.js";
2
+ export {
3
+ Carousel as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,15 +1,17 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { ComboBox as ComboBox$1, Group, Input, Popover } from "react-aria-components";
3
- import { IconButton } from "../IconButton/IconButton.js";
2
+ import { ComboBox as ComboBox$1, Group, Input, Button, Popover } from "react-aria-components";
3
+ import { Icon } from "../Icon/Icon.js";
4
4
  import { Field } from "../_base/Field/Field.js";
5
5
  import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
6
- import '../../assets/ComboBox.css';const comboBox = "_comboBox_168rl_1";
6
+ import '../../assets/ComboBox.css';const comboBox = "_comboBox_x47tm_1";
7
+ const comboBoxButton = "_comboBoxButton_x47tm_85";
7
8
  const styles = {
8
9
  comboBox,
9
- "comboBox-group": "_comboBox-group_168rl_14",
10
- "comboBox-input": "_comboBox-input_168rl_63",
11
- "comboBox-loading": "_comboBox-loading_168rl_74",
12
- "comboBox-popover": "_comboBox-popover_168rl_81"
10
+ "comboBox-group": "_comboBox-group_x47tm_14",
11
+ "comboBox-input": "_comboBox-input_x47tm_63",
12
+ "comboBox-loading": "_comboBox-loading_x47tm_74",
13
+ "comboBox-popover": "_comboBox-popover_x47tm_81",
14
+ comboBoxButton
13
15
  };
14
16
  const ComboBox = ({
15
17
  children,
@@ -19,12 +21,7 @@ const ComboBox = ({
19
21
  return /* @__PURE__ */ jsxs(Field, { as: ComboBox$1, className: styles["comboBox"], ...props, children: [
20
22
  /* @__PURE__ */ jsxs(Group, { className: styles["comboBox-group"], children: [
21
23
  /* @__PURE__ */ jsx(Input, { className: styles["comboBox-input"] }),
22
- isLoading ? /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x", buttonSize: "sm", className: styles["comboBox-loading"] }) : /* @__PURE__ */ jsx(IconButton, { size: "sm", styleVariant: "white", isDisabled: props == null ? void 0 : props.isDisabled, iconProps: {
23
- iconName: "angles-up-down",
24
- iconPrefix: "fas",
25
- padding: "roomy",
26
- scale: "1x"
27
- } })
24
+ isLoading ? /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x", buttonSize: "sm", className: styles["comboBox-loading"] }) : /* @__PURE__ */ jsx(Button, { className: styles.comboBoxButton, isDisabled: props == null ? void 0 : props.isDisabled, children: /* @__PURE__ */ jsx(Icon, { iconName: "angles-up-down", iconPrefix: "fas", padding: "roomy", scale: "1x" }) })
28
25
  ] }),
29
26
  /* @__PURE__ */ jsx(Popover, { className: styles["comboBox-popover"], children })
30
27
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ComboBox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import React from "react";
2
+ import React__default from "react";
3
3
  import { TextField, Input } from "react-aria-components";
4
- import { P as PatternFormat } from "../../react-number-format.es-BjKL6crg.js";
4
+ import { P as PatternFormat } from "../../react-number-format.es-Dbc1db6s.js";
5
5
  import { Field } from "../_base/Field/Field.js";
6
6
  import { Icon } from "../Icon/Icon.js";
7
7
  import { getCardIcon } from "../../utils/creditCard/creditCard.js";
@@ -21,15 +21,15 @@ const CreditCardNumberField = ({
21
21
  label = "Credit card number",
22
22
  ...props
23
23
  }) => {
24
- const [value, setValue] = React.useState(defaultValue);
24
+ const [value, setValue] = React__default.useState(defaultValue);
25
25
  const valueDefinitive = valueControlled ?? value;
26
- const cardIcon = React.useMemo(() => {
26
+ const cardIcon = React__default.useMemo(() => {
27
27
  if (typeof cardIconProp === "function") {
28
28
  return cardIconProp(value) || "credit-card";
29
29
  }
30
30
  return cardIconProp || "credit-card";
31
31
  }, [value, cardIconProp]);
32
- return /* @__PURE__ */ jsx(Field, { className: styles.creditCardNumberField, as: TextField, isRequired: true, hasEndIcon: true, ...props, children: /* @__PURE__ */ jsxs("div", { className: styles.inputWrapper, children: [
32
+ return /* @__PURE__ */ jsx(Field, { ...props, as: TextField, isRequired: true, hasEndIcon: true, label, className: styles.creditCardNumberField, children: /* @__PURE__ */ jsxs("div", { className: styles.inputWrapper, children: [
33
33
  /* @__PURE__ */ jsx(PatternFormat, { type: "text", format: "#### #### #### ####", customInput: Input, placeholder: props == null ? void 0 : props.placeholder, allowEmptyFormatting: false, defaultValue, value: valueDefinitive, onValueChange: (values) => {
34
34
  if (typeof onChangeControlled === "function") {
35
35
  onChangeControlled(values.value);
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import React from "react";
2
+ import React__default from "react";
3
3
  import { TextField, Input } from "react-aria-components";
4
- import { P as PatternFormat } from "../../react-number-format.es-BjKL6crg.js";
4
+ import { P as PatternFormat } from "../../react-number-format.es-Dbc1db6s.js";
5
5
  import { Field } from "../_base/Field/Field.js";
6
6
  import '../../assets/CreditCardSecurityCodeField.css';const creditCardSecurityCodeField = "_creditCardSecurityCodeField_14mb2_1";
7
7
  const inputWrapper = "_inputWrapper_14mb2_11";
@@ -20,16 +20,16 @@ const CreditCardSecurityCodeField = ({
20
20
  digits = 3,
21
21
  ...props
22
22
  }) => {
23
- const [value, setValue] = React.useState(defaultValue);
23
+ const [value, setValue] = React__default.useState(defaultValue);
24
24
  const valueDefinitive = valueControlled ?? value;
25
- return /* @__PURE__ */ jsxs(Field, { className: styles.creditCardSecurityCodeField, as: TextField, isRequired: true, ...props, children: [
25
+ return /* @__PURE__ */ jsxs(Field, { className: styles.creditCardSecurityCodeField, as: TextField, isRequired: true, label, ...props, children: [
26
26
  /* @__PURE__ */ jsxs("div", { className: styles.inputWrapper, children: [
27
27
  /* @__PURE__ */ jsx(PatternFormat, { type: "text", format: `${"#".repeat(digits)}`, customInput: Input, placeholder: props == null ? void 0 : props.placeholder, defaultValue, value: valueDefinitive, onValueChange: (values) => {
28
28
  if (typeof onChangeControlled === "function") {
29
29
  onChangeControlled(values.value);
30
30
  }
31
31
  setValue(values.value);
32
- }, autoComplete: "cc-csc", "aria-label": label }),
32
+ }, autoComplete: "cc-csc" }),
33
33
  /* @__PURE__ */ jsx(CreditCardSecurityCodeIcon, { cardIcon })
34
34
  ] }),
35
35
  (props == null ? void 0 : props.children) && /* @__PURE__ */ jsx("div", { className: styles.inputChildren, children: props.children })
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import React, { useRef } from "react";
2
+ import React__default, { useRef } from "react";
3
3
  import { IconButton } from "../IconButton/IconButton.js";
4
4
  import { OverlayContainer, useOverlay, usePreventScroll, useModal } from "@react-aria/overlays";
5
5
  import { useDialog } from "@react-aria/dialog";
@@ -69,8 +69,8 @@ function DialogWrapper({
69
69
  const {
70
70
  modalProps
71
71
  } = useModal();
72
- const headerChild = React.Children.toArray(children).find((child) => React.isValidElement(child) && child.type === DialogHeader);
73
- const otherChildren = React.Children.toArray(children).filter((child) => !React.isValidElement(child) || child.type !== DialogHeader);
72
+ const headerChild = React__default.Children.toArray(children).find((child) => React__default.isValidElement(child) && child.type === DialogHeader);
73
+ const otherChildren = React__default.Children.toArray(children).filter((child) => !React__default.isValidElement(child) || child.type !== DialogHeader);
74
74
  const hasHeader = Boolean(headerChild) || hasDismissButton;
75
75
  const headerId = props["aria-labelledby"] || `${id}-header`;
76
76
  const contentId = props["aria-describedby"] || `${id}-content`;
@@ -81,7 +81,7 @@ function DialogWrapper({
81
81
  hasHeader && /* @__PURE__ */ jsx("div", { className: styles.dialogHeader, id: headerId, children: headerChild }),
82
82
  /* @__PURE__ */ jsx("div", { id: contentId, children: otherChildren })
83
83
  ] }),
84
- hasDismissButton && /* @__PURE__ */ jsx("div", { className: styles.closeButton, children: /* @__PURE__ */ jsx(IconButton, { onClick: onClose, styleVariant: "white", emphasis: "primary", size: "sm", iconProps: {
84
+ hasDismissButton && /* @__PURE__ */ jsx("div", { className: styles.closeButton, children: /* @__PURE__ */ jsx(IconButton, { onPress: onClose, styleVariant: "white", emphasis: "primary", size: "sm", iconProps: {
85
85
  iconName: "close",
86
86
  iconPrefix: "far",
87
87
  iconSize: "1x"
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { CalloutBanner } from "../CalloutBanner/CalloutBanner.js";
3
- import React, { useState } from "react";
3
+ import React__default, { useState } from "react";
4
4
  import Link from "../Link/Link.js";
5
5
  import { Box } from "../Box/Box.js";
6
6
  import '../../assets/ErrorSummary.css';const styles = {
@@ -19,9 +19,9 @@ const ErrorSummary = ({
19
19
  const errorsToRender = showAllErrors ? children : Array.isArray(children) ? children.slice(0, MAX_ERRORS_SHOW) : [children];
20
20
  const hasMoreErrors = Array.isArray(children) && children.length > MAX_ERRORS_SHOW;
21
21
  return /* @__PURE__ */ jsx(CalloutBanner, { title, description, children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
22
- /* @__PURE__ */ jsx("div", { className: styles["errorSummary-list"], children: React.Children.map(errorsToRender, (child, index) => {
23
- if (React.isValidElement(child)) {
24
- return React.cloneElement(child, {
22
+ /* @__PURE__ */ jsx("div", { className: styles["errorSummary-list"], children: React__default.Children.map(errorsToRender, (child, index) => {
23
+ if (React__default.isValidElement(child)) {
24
+ return React__default.cloneElement(child, {
25
25
  key: `error-${index}`,
26
26
  iconEndProps: false
27
27
  });
@@ -1,6 +1,10 @@
1
1
  import { FieldErrorProps as AriaFieldErrorProps } from 'react-aria-components';
2
2
  export interface FieldErrorProps extends AriaFieldErrorProps {
3
3
  children?: React.ReactNode | any;
4
+ /**
5
+ * Whether the field is invalid.
6
+ */
7
+ isInvalid?: boolean;
4
8
  }
5
- export declare const FieldError: ({ children, ...props }: FieldErrorProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const FieldError: ({ children, isInvalid: isInvalidProp, ...props }: FieldErrorProps) => import("react/jsx-runtime").JSX.Element;
6
10
  export default FieldError;
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { FieldError as FieldError$1 } from "react-aria-components";
3
3
  import { Icon } from "../Icon/Icon.js";
4
4
  import '../../assets/FieldError.css';const fieldError = "_fieldError_1tsix_1";
@@ -7,8 +7,15 @@ const styles = {
7
7
  };
8
8
  const FieldError = ({
9
9
  children,
10
+ isInvalid: isInvalidProp,
10
11
  ...props
11
12
  }) => {
13
+ if (children && isInvalidProp) {
14
+ return /* @__PURE__ */ jsxs("div", { className: styles.fieldError, children: [
15
+ /* @__PURE__ */ jsx(Icon, { iconName: "triangle-exclamation", iconPrefix: "fas", "aria-label": "error-icon" }),
16
+ children
17
+ ] });
18
+ }
12
19
  return /* @__PURE__ */ jsx(FieldError$1, { className: styles.fieldError, ...props, children: ({
13
20
  validationErrors
14
21
  }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"FieldError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"FieldError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -22,7 +22,7 @@ const FieldHeader = ({
22
22
  !isRequired && ` (${optionalTranslation})`
23
23
  ] }) }),
24
24
  description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
25
- /* @__PURE__ */ jsx(FieldError, { children: errorMessage })
25
+ /* @__PURE__ */ jsx(FieldError, { isInvalid, children: errorMessage })
26
26
  ] });
27
27
  };
28
28
  export {
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { SpaceToken } from '../../utils/spaceToken/spaceToken';
3
3
  type AutoFlowValue = 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
4
4
  type AlignContentValue = 'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
5
+ type JustifyContentValue = 'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
5
6
  type ValidElements = 'div' | 'span';
6
7
  export type PolymorphicProps<E extends ValidElements> = {
7
8
  as?: E;
@@ -69,6 +70,10 @@ export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
69
70
  * Controls the vertical alignment of the content within the grid
70
71
  */
71
72
  alignContent?: AlignContentValue;
73
+ /**
74
+ * Controls the horizontal alignment of the content within the grid
75
+ */
76
+ justifyContent?: JustifyContentValue;
72
77
  /**
73
78
  * Determines how columns are automatically created in the grid
74
79
  * e.g., "minmax(100px, 1fr)" or "200px"
@@ -124,7 +129,7 @@ export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
124
129
  style?: React.CSSProperties;
125
130
  }
126
131
  export declare const Grid: {
127
- ({ id, isInline, alignContent, autoColumns, autoFlow, columns, rows, templateColumns, templateRows, gap, rowGap, columnGap, children, style, ...rest }: GridProps): import("react/jsx-runtime").JSX.Element;
132
+ ({ id, isInline, alignContent, justifyContent, autoColumns, autoFlow, columns, rows, templateColumns, templateRows, gap, rowGap, columnGap, children, style, ...rest }: GridProps): import("react/jsx-runtime").JSX.Element;
128
133
  Cell: <E extends ValidElements = "div">({ as, span, area, column, columnStart, columnEnd, row, rowStart, rowEnd, children, style, ...rest }: GridCellProps<E>) => import("react/jsx-runtime").JSX.Element;
129
134
  };
130
135
  declare const isValidElement: (value: unknown) => value is ValidElements;
@@ -72,6 +72,7 @@ const Grid = ({
72
72
  id,
73
73
  isInline = false,
74
74
  alignContent,
75
+ justifyContent,
75
76
  autoColumns,
76
77
  autoFlow,
77
78
  columns,
@@ -94,6 +95,7 @@ const Grid = ({
94
95
  gridAutoColumns: autoColumns,
95
96
  gridAutoFlow: autoFlow,
96
97
  alignContent,
98
+ justifyContent,
97
99
  ...rowGap || columnGap ? {
98
100
  rowGap: rowGap ? getSpaceValue(rowGap) : void 0,
99
101
  columnGap: columnGap ? getSpaceValue(columnGap) : void 0
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Grid.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -26,15 +26,10 @@ export interface HeadingProps extends HeadingVariants {
26
26
  * The foreground color of the heading
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
  */
37
32
  textAlign?: 'start' | 'center' | 'end';
38
33
  }
39
- export declare const Heading: ({ children, as: Component, size, foregroundColor, fgColor, textAlign, ...props }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
34
+ export declare const Heading: ({ children, as: Component, size, foregroundColor, textAlign, ...props }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
40
35
  export default Heading;
@@ -61,20 +61,15 @@ const Heading = ({
61
61
  as: Component = "h1",
62
62
  size,
63
63
  foregroundColor = "accentSecondary",
64
- fgColor,
65
64
  textAlign = "start",
66
65
  ...props
67
66
  }) => {
68
67
  const effectiveSize = size || DEFAULT_HEADING_SIZE_MAP[Component];
69
- if (fgColor) {
70
- console.warn("The `fgColor` prop has been deprecated. Please use `foregroundColor` instead.");
71
- }
72
- const resolvedFontColor = fgColor ?? foregroundColor ?? "accentSecondary";
73
68
  return /* @__PURE__ */ jsx(Component, { className: `${heading({
74
69
  size: effectiveSize,
75
70
  textAlign
76
71
  })} ${foregroundColorVariants({
77
- foregroundColor: resolvedFontColor
72
+ foregroundColor
78
73
  })}`, ...props, children });
79
74
  };
80
75
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Heading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,11 +1,6 @@
1
1
  import { ForegroundVariants } from '../../utils/foregroundColour/foregroundColor';
2
2
  import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
3
3
  export type IconSize = '0.5x' | '0.75x' | '1x' | '1.25x' | '1.5x' | '2x' | '2.5x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x';
4
- /**
5
- * @deprecated These sizes will be removed in the next major version. Use 1x instead.
6
- * @ignore
7
- */
8
- type DeprecatedIconSize = 'lg' | 'sm' | 'xs' | '2xs' | 'xl' | '2xl';
9
4
  export interface IconProps {
10
5
  /**
11
6
  * What Icon to load from fontAwesome
@@ -25,7 +20,7 @@ export interface IconProps {
25
20
  /**
26
21
  * The size of the icon.
27
22
  */
28
- iconSize?: IconSize | DeprecatedIconSize;
23
+ iconSize?: IconSize;
29
24
  /**
30
25
  * The color of the icon.
31
26
  */
@@ -1,24 +1,12 @@
1
- import { PressEvent } from 'react-aria-components';
1
+ import { ElementType } from 'react';
2
2
  import { ButtonProps } from '../Button/Button';
3
3
  import { IconProps } from '../Icon/Icon';
4
4
  import { FormProps } from '../../utils/forms/formProps';
5
- export interface IconButtonProps extends Omit<ButtonProps<'button'>, 'onClick'>, FormProps {
5
+ export interface IconButtonProps<T extends ElementType = 'button'> extends Omit<ButtonProps<T>, 'children' | 'iconStartProps' | 'iconEndProps'>, FormProps {
6
6
  /**
7
7
  * What icon from fontAwesome to use with all options
8
8
  */
9
9
  iconProps?: IconProps;
10
- /**
11
- * Whether the button is loading
12
- */
13
- isLoading?: boolean;
14
- /**
15
- * Handler to be called when the button is clicked.
16
- */
17
- onClick?: (e: PressEvent) => void;
18
- /**
19
- * The Slot of the button
20
- */
21
- slot?: string;
22
10
  /**
23
11
  * Tooltip text to display on hover and focus
24
12
  */
@@ -28,5 +16,5 @@ export interface IconButtonProps extends Omit<ButtonProps<'button'>, 'onClick'>,
28
16
  */
29
17
  tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
30
18
  }
31
- export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
19
+ export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps<ElementType> & import('react').RefAttributes<any>>;
32
20
  export default IconButton;