@alto-avios/alto-ui 3.0.0 → 3.2.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 (213) hide show
  1. package/dist/assets/Accordion.css +1 -0
  2. package/dist/assets/AviosBadge.css +1 -0
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/CalloutBanner.css +1 -0
  5. package/dist/assets/CreditCardNumberField.css +1 -0
  6. package/dist/assets/DetailsDisclosure.css +1 -0
  7. package/dist/assets/Dialog.css +1 -0
  8. package/dist/assets/ErrorSummary.css +1 -0
  9. package/dist/assets/FieldHeader.css +1 -1
  10. package/dist/assets/FieldLabel.css +1 -1
  11. package/dist/assets/FieldsetHeader.css +1 -1
  12. package/dist/assets/Icon.css +1 -0
  13. package/dist/assets/IconBackdrop.css +1 -0
  14. package/dist/assets/IconButton.css +1 -1
  15. package/dist/assets/Menu.css +1 -0
  16. package/dist/assets/PasswordField.css +1 -0
  17. package/dist/assets/PhoneNumberField.css +1 -0
  18. package/dist/assets/Popover.css +1 -0
  19. package/dist/assets/SelectCard.css +1 -0
  20. package/dist/assets/SelectNative.css +1 -0
  21. package/dist/assets/Slider.css +1 -0
  22. package/dist/assets/Switch.css +1 -0
  23. package/dist/assets/Tag.css +1 -1
  24. package/dist/assets/ToggleButton.css +1 -1
  25. package/dist/assets/ToggleIconButton.css +1 -1
  26. package/dist/assets/backgroundColor.css +1 -0
  27. package/dist/assets/flex.css +1 -1
  28. package/dist/assets/foregroundColor.css +1 -0
  29. package/dist/assets/position.css +1 -0
  30. package/dist/components/Accordion/Accordion.d.ts +35 -0
  31. package/dist/components/Accordion/Accordion.js +140 -0
  32. package/dist/components/Accordion/Accordion.js.map +1 -0
  33. package/dist/components/Accordion/index.d.ts +1 -0
  34. package/dist/components/Accordion/index.js +5 -0
  35. package/dist/components/Accordion/index.js.map +1 -0
  36. package/dist/components/AviosBadge/AviosBadge.d.ts +34 -0
  37. package/dist/components/AviosBadge/AviosBadge.js +58 -0
  38. package/dist/components/AviosBadge/AviosBadge.js.map +1 -0
  39. package/dist/components/AviosBadge/index.d.ts +1 -0
  40. package/dist/components/AviosBadge/index.js +5 -0
  41. package/dist/components/AviosBadge/index.js.map +1 -0
  42. package/dist/components/Badge/Badge.d.ts +7 -2
  43. package/dist/components/Badge/Badge.js +2 -1
  44. package/dist/components/Badge/Badge.js.map +1 -1
  45. package/dist/components/Box/Box.d.ts +9 -5
  46. package/dist/components/Box/Box.js +10 -1
  47. package/dist/components/Box/Box.js.map +1 -1
  48. package/dist/components/Button/Button.js +31 -31
  49. package/dist/components/CalloutBanner/CalloutBanner.d.ts +21 -0
  50. package/dist/components/CalloutBanner/CalloutBanner.js +96 -0
  51. package/dist/components/CalloutBanner/CalloutBanner.js.map +1 -0
  52. package/dist/components/CalloutBanner/index.d.ts +1 -0
  53. package/dist/components/CalloutBanner/index.js +5 -0
  54. package/dist/components/CalloutBanner/index.js.map +1 -0
  55. package/dist/components/Checkbox/index.d.ts +1 -0
  56. package/dist/components/CreditCardNumberField/CreditCardNumberField.d.ts +29 -0
  57. package/dist/components/CreditCardNumberField/CreditCardNumberField.js +46 -0
  58. package/dist/components/CreditCardNumberField/CreditCardNumberField.js.map +1 -0
  59. package/dist/components/CreditCardNumberField/index.d.ts +1 -0
  60. package/dist/components/CreditCardNumberField/index.js +5 -0
  61. package/dist/components/CreditCardNumberField/index.js.map +1 -0
  62. package/dist/components/DateField/DateField.d.ts +22 -3
  63. package/dist/components/DateField/DateField.js +856 -2
  64. package/dist/components/DateField/DateField.js.map +1 -1
  65. package/dist/components/DetailsDisclosure/DetailsDisclosure.d.ts +33 -0
  66. package/dist/components/DetailsDisclosure/DetailsDisclosure.js +39 -0
  67. package/dist/components/DetailsDisclosure/DetailsDisclosure.js.map +1 -0
  68. package/dist/components/DetailsDisclosure/index.d.ts +2 -0
  69. package/dist/components/DetailsDisclosure/index.js +5 -0
  70. package/dist/components/DetailsDisclosure/index.js.map +1 -0
  71. package/dist/components/Dialog/Dialog.d.ts +46 -0
  72. package/dist/components/Dialog/Dialog.js +117 -0
  73. package/dist/components/Dialog/Dialog.js.map +1 -0
  74. package/dist/components/Dialog/index.d.ts +1 -0
  75. package/dist/components/Dialog/index.js +5 -0
  76. package/dist/components/Dialog/index.js.map +1 -0
  77. package/dist/components/ErrorSummary/ErrorSummary.d.ts +7 -0
  78. package/dist/components/ErrorSummary/ErrorSummary.js +44 -0
  79. package/dist/components/ErrorSummary/ErrorSummary.js.map +1 -0
  80. package/dist/components/ErrorSummary/index.d.ts +1 -0
  81. package/dist/components/ErrorSummary/index.js +5 -0
  82. package/dist/components/ErrorSummary/index.js.map +1 -0
  83. package/dist/components/FieldError/FieldError.js +1 -1
  84. package/dist/components/FieldHeader/FieldHeader.js +6 -6
  85. package/dist/components/FieldLabel/FieldLabel.js +1 -1
  86. package/dist/components/FieldsetHeader/FieldsetHeader.js +3 -3
  87. package/dist/components/Heading/Heading.d.ts +25 -6
  88. package/dist/components/Heading/Heading.js +9 -4
  89. package/dist/components/Heading/Heading.js.map +1 -1
  90. package/dist/components/Icon/Icon.d.ts +31 -4
  91. package/dist/components/Icon/Icon.js +98 -5
  92. package/dist/components/Icon/Icon.js.map +1 -1
  93. package/dist/components/IconBackdrop/IconBackdrop.d.ts +24 -0
  94. package/dist/components/IconBackdrop/IconBackdrop.js +34 -0
  95. package/dist/components/IconBackdrop/IconBackdrop.js.map +1 -0
  96. package/dist/components/IconBackdrop/index.d.ts +1 -0
  97. package/dist/components/IconBackdrop/index.js +5 -0
  98. package/dist/components/IconBackdrop/index.js.map +1 -0
  99. package/dist/components/IconButton/IconButton.d.ts +1 -1
  100. package/dist/components/IconButton/IconButton.js +28 -28
  101. package/dist/components/Image/Image.d.ts +3 -2
  102. package/dist/components/Image/Image.js +7 -2
  103. package/dist/components/Image/Image.js.map +1 -1
  104. package/dist/components/Link/Link.d.ts +3 -3
  105. package/dist/components/Link/Link.js +2 -2
  106. package/dist/components/Menu/Menu.d.ts +75 -0
  107. package/dist/components/Menu/Menu.js +356 -0
  108. package/dist/components/Menu/Menu.js.map +1 -0
  109. package/dist/components/Menu/index.d.ts +1 -0
  110. package/dist/components/Menu/index.js +5 -0
  111. package/dist/components/Menu/index.js.map +1 -0
  112. package/dist/components/Paragraph/Paragraph.d.ts +9 -5
  113. package/dist/components/Paragraph/Paragraph.js +9 -4
  114. package/dist/components/Paragraph/Paragraph.js.map +1 -1
  115. package/dist/components/PasswordField/PasswordField.d.ts +30 -0
  116. package/dist/components/PasswordField/PasswordField.js +104 -0
  117. package/dist/components/PasswordField/PasswordField.js.map +1 -0
  118. package/dist/components/PasswordField/index.d.ts +1 -0
  119. package/dist/components/PasswordField/index.js +5 -0
  120. package/dist/components/PasswordField/index.js.map +1 -0
  121. package/dist/components/PhoneNumberField/PhoneNumberField.d.ts +53 -0
  122. package/dist/components/PhoneNumberField/PhoneNumberField.js +96 -0
  123. package/dist/components/PhoneNumberField/PhoneNumberField.js.map +1 -0
  124. package/dist/components/PhoneNumberField/index.d.ts +3 -0
  125. package/dist/components/PhoneNumberField/index.js +7 -0
  126. package/dist/components/PhoneNumberField/index.js.map +1 -0
  127. package/dist/components/Popover/Popover.d.ts +48 -0
  128. package/dist/components/Popover/Popover.js +65 -0
  129. package/dist/components/Popover/Popover.js.map +1 -0
  130. package/dist/components/Popover/index.d.ts +1 -0
  131. package/dist/components/Popover/index.js +5 -0
  132. package/dist/components/Popover/index.js.map +1 -0
  133. package/dist/components/Radio/index.d.ts +1 -0
  134. package/dist/components/Section/Section.d.ts +2 -1
  135. package/dist/components/Section/Section.js +7 -2
  136. package/dist/components/Section/Section.js.map +1 -1
  137. package/dist/components/SelectCard/SelectCard.d.ts +51 -0
  138. package/dist/components/SelectCard/SelectCard.js +85 -0
  139. package/dist/components/SelectCard/SelectCard.js.map +1 -0
  140. package/dist/components/SelectCard/index.d.ts +1 -0
  141. package/dist/components/SelectCard/index.js +5 -0
  142. package/dist/components/SelectCard/index.js.map +1 -0
  143. package/dist/components/SelectNative/SelectNative.d.ts +56 -0
  144. package/dist/components/SelectNative/SelectNative.js +40 -0
  145. package/dist/components/SelectNative/SelectNative.js.map +1 -0
  146. package/dist/components/SelectNative/index.d.ts +1 -0
  147. package/dist/components/SelectNative/index.js +5 -0
  148. package/dist/components/SelectNative/index.js.map +1 -0
  149. package/dist/components/Slider/Slider.d.ts +33 -0
  150. package/dist/components/Slider/Slider.js +113 -0
  151. package/dist/components/Slider/Slider.js.map +1 -0
  152. package/dist/components/Slider/index.d.ts +1 -0
  153. package/dist/components/Slider/index.js +5 -0
  154. package/dist/components/Slider/index.js.map +1 -0
  155. package/dist/components/SubHeading/SubHeading.d.ts +26 -5
  156. package/dist/components/SubHeading/SubHeading.js +9 -4
  157. package/dist/components/SubHeading/SubHeading.js.map +1 -1
  158. package/dist/components/Switch/Switch.d.ts +7 -0
  159. package/dist/components/Switch/Switch.js +18 -0
  160. package/dist/components/Switch/Switch.js.map +1 -0
  161. package/dist/components/Switch/index.d.ts +1 -0
  162. package/dist/components/Switch/index.js +5 -0
  163. package/dist/components/Switch/index.js.map +1 -0
  164. package/dist/components/Tag/Tag.js +4 -4
  165. package/dist/components/ToggleButton/ToggleButton.js +6 -6
  166. package/dist/components/ToggleIconButton/ToggleIconButton.js +6 -6
  167. package/dist/components/Tooltip/Tooltip.d.ts +5 -1
  168. package/dist/components/Tooltip/Tooltip.js +2 -1
  169. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  170. package/dist/components/_base/Field/Field.d.ts +2 -2
  171. package/dist/components/_base/Field/Field.js +2 -5
  172. package/dist/components/_base/Field/Field.js.map +1 -1
  173. package/dist/components/index.d.ts +16 -0
  174. package/dist/components/index.js +45 -14
  175. package/dist/components/index.js.map +1 -1
  176. package/dist/index.js +45 -14
  177. package/dist/index.js.map +1 -1
  178. package/dist/react-number-format.es-DMLgWFZX.js +760 -0
  179. package/dist/react-number-format.es-DMLgWFZX.js.map +1 -0
  180. package/dist/utils/backgroundColor/backgroundColor.d.ts +8 -0
  181. package/dist/utils/backgroundColor/backgroundColor.js +102 -0
  182. package/dist/utils/backgroundColor/backgroundColor.js.map +1 -0
  183. package/dist/utils/border/border.d.ts +3 -3
  184. package/dist/utils/creditCard/creditCard.d.ts +7 -0
  185. package/dist/utils/creditCard/creditCard.js +25 -0
  186. package/dist/utils/creditCard/creditCard.js.map +1 -0
  187. package/dist/utils/flex/flex.d.ts +11 -6
  188. package/dist/utils/flex/flex.js +390 -46
  189. package/dist/utils/flex/flex.js.map +1 -1
  190. package/dist/utils/flex/flex.test.d.ts +1 -0
  191. package/dist/utils/focus/focusStyles.d.ts +1 -1
  192. package/dist/utils/foregroundColour/foregroundColor.d.ts +8 -0
  193. package/dist/utils/foregroundColour/foregroundColor.js +125 -0
  194. package/dist/utils/foregroundColour/foregroundColor.js.map +1 -0
  195. package/dist/utils/padding/padding.d.ts +7 -7
  196. package/dist/utils/phoneNumber/phoneNumber.d.ts +24 -0
  197. package/dist/utils/phoneNumber/phoneNumber.js +566 -0
  198. package/dist/utils/phoneNumber/phoneNumber.js.map +1 -0
  199. package/dist/utils/position/position.d.ts +8 -0
  200. package/dist/utils/position/position.js +57 -0
  201. package/dist/utils/position/position.js.map +1 -0
  202. package/dist/utils/position/position.test.d.ts +1 -0
  203. package/dist/utils/stories/iconPropsArgTypes.js +49 -13
  204. package/dist/utils/stories/iconPropsArgTypes.js.map +1 -1
  205. package/package.json +2 -1
  206. package/dist/assets/backgroundColour.css +0 -1
  207. package/dist/assets/fgColor.css +0 -1
  208. package/dist/utils/backgroundColour/backgroundColour.d.ts +0 -8
  209. package/dist/utils/backgroundColour/backgroundColour.js +0 -102
  210. package/dist/utils/backgroundColour/backgroundColour.js.map +0 -1
  211. package/dist/utils/fgColour/fgColor.d.ts +0 -5
  212. package/dist/utils/fgColour/fgColor.js +0 -84
  213. package/dist/utils/fgColour/fgColor.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DateField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"DateField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,33 @@
1
+ import { default as React } from 'react';
2
+ import { DisclosureProps as AriaDisclosureProps, DisclosurePanelProps as AriaDisclosurePanelProps } from 'react-aria-components';
3
+ interface DetailsDisclosureProps extends AriaDisclosureProps {
4
+ /**
5
+ * Whether the disclosure is expanded by default.
6
+ */
7
+ defaultExpanded?: boolean;
8
+ /**
9
+ * Whether the disclosure is expanded (Controlled)
10
+ */
11
+ isExpanded?: boolean;
12
+ /**
13
+ * Callback function that is called when the disclosure is expanded or collapsed. (Controlled)
14
+ */
15
+ onExpandedChange?: (isExpanded: boolean) => void;
16
+ /**
17
+ * <DetailsDisclosure.Trigger> and <DetailsDisclosure.Panel> children.
18
+ */
19
+ children?: React.ReactNode;
20
+ }
21
+ declare const DetailsDisclosure: {
22
+ ({ children, ...props }: DetailsDisclosureProps): import("react/jsx-runtime").JSX.Element;
23
+ Summary: {
24
+ ({ children, }: Pick<DetailsDisclosureProps, "children">): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
27
+ Details: {
28
+ ({ children, ...props }: AriaDisclosurePanelProps): import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
30
+ };
31
+ };
32
+ export type { DetailsDisclosureProps };
33
+ export default DetailsDisclosure;
@@ -0,0 +1,39 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Disclosure, Button, DisclosurePanel } from "react-aria-components";
3
+ import { Icon } from "../Icon/Icon.js";
4
+ import '../../assets/DetailsDisclosure.css';const detailsDisclosure = "_detailsDisclosure_9jcud_1";
5
+ const detailsDisclosureIcon = "_detailsDisclosureIcon_9jcud_8";
6
+ const detailsDisclosureDetails = "_detailsDisclosureDetails_9jcud_40";
7
+ const styles = {
8
+ detailsDisclosure,
9
+ detailsDisclosureIcon,
10
+ detailsDisclosureDetails
11
+ };
12
+ const DetailsDisclosureSummary = ({
13
+ children
14
+ }) => {
15
+ return /* @__PURE__ */ jsxs(Button, { slot: "trigger", children: [
16
+ /* @__PURE__ */ jsx(Icon, { className: styles["detailsDisclosureIcon"], iconName: "caret-right", iconPrefix: "fas", ariaLabel: "Open disclosure" }),
17
+ children
18
+ ] });
19
+ };
20
+ DetailsDisclosureSummary.displayName = "DetailsDisclosure.Summary";
21
+ const DetailsDisclosureDetails = ({
22
+ children,
23
+ ...props
24
+ }) => {
25
+ return /* @__PURE__ */ jsx(DisclosurePanel, { className: styles["detailsDisclosureDetails"], ...props, children });
26
+ };
27
+ DetailsDisclosureDetails.displayName = "DetailsDisclosure.Details";
28
+ const DetailsDisclosure = ({
29
+ children,
30
+ ...props
31
+ }) => {
32
+ return /* @__PURE__ */ jsx(Disclosure, { className: styles["detailsDisclosure"], ...props, children });
33
+ };
34
+ DetailsDisclosure.Summary = DetailsDisclosureSummary;
35
+ DetailsDisclosure.Details = DetailsDisclosureDetails;
36
+ export {
37
+ DetailsDisclosure as default
38
+ };
39
+ //# sourceMappingURL=DetailsDisclosure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DetailsDisclosure.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export type { DetailsDisclosureProps } from './DetailsDisclosure';
2
+ export { default } from './DetailsDisclosure';
@@ -0,0 +1,5 @@
1
+ import { default as default2 } from "./DetailsDisclosure.js";
2
+ export {
3
+ default2 as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,46 @@
1
+ import { default as React } from 'react';
2
+ import { AriaDialogProps } from 'react-aria';
3
+ export type DialogSize = 'dialogSmall' | 'dialogMedium' | 'dialogLarge';
4
+ export type DialogRole = 'alertdialog' | 'dialog';
5
+ export interface DialogProps extends AriaDialogProps {
6
+ /** Whether the dialog is currently visible */
7
+ isOpen?: boolean;
8
+ /** Callback function when dialog is requested to close */
9
+ onClose?: () => void;
10
+ /** Width variant of the dialog - affects max-width */
11
+ size?: DialogSize;
12
+ /** Whether clicking outside or escape key should be blocked */
13
+ modal?: boolean;
14
+ /** Shows/hides the close (X) button in header */
15
+ hasDismissButton?: boolean;
16
+ /** ARIA role - use 'alertdialog' for important messages */
17
+ role?: DialogRole;
18
+ /** Required unique ID for the dialog */
19
+ id?: string;
20
+ /** ID of element labeling the dialog (required for a11y) */
21
+ 'aria-describedby'?: string;
22
+ /** ID of element describing the dialog (optional but recommended) */
23
+ 'aria-labelledby'?: string;
24
+ }
25
+ export interface DialogComposition {
26
+ Header: typeof DialogHeader;
27
+ Content: typeof DialogContent;
28
+ }
29
+ declare const DialogHeader: ({ id, children, }: {
30
+ children: React.ReactNode;
31
+ id?: string;
32
+ }) => import("react/jsx-runtime").JSX.Element;
33
+ export declare function Dialog(props: React.PropsWithChildren<DialogProps>): import("react/jsx-runtime").JSX.Element | null;
34
+ export declare namespace Dialog {
35
+ var Header: ({ id, children, }: {
36
+ children: React.ReactNode;
37
+ id?: string;
38
+ }) => import("react/jsx-runtime").JSX.Element;
39
+ var Content: ({ children }: {
40
+ children: React.ReactNode;
41
+ }) => import("react/jsx-runtime").JSX.Element;
42
+ }
43
+ export declare const DialogContent: ({ children }: {
44
+ children: React.ReactNode;
45
+ }) => import("react/jsx-runtime").JSX.Element;
46
+ export default Dialog;
@@ -0,0 +1,117 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import React, { useRef } from "react";
3
+ import { IconButton } from "../IconButton/IconButton.js";
4
+ import { OverlayContainer, useOverlay, usePreventScroll, useModal } from "@react-aria/overlays";
5
+ import { useDialog } from "@react-aria/dialog";
6
+ import { FocusScope } from "@react-aria/focus";
7
+ import '../../assets/Dialog.css';const dialogWrapper = "_dialogWrapper_o29gm_1";
8
+ const overlay = "_overlay_o29gm_10";
9
+ const dialog = "_dialog_o29gm_1";
10
+ const dialogContent = "_dialogContent_o29gm_47";
11
+ const dialogHeading = "_dialogHeading_o29gm_54";
12
+ const dialogContentInner = "_dialogContentInner_o29gm_58";
13
+ const noHeader = "_noHeader_o29gm_64";
14
+ const closeButton = "_closeButton_o29gm_68";
15
+ const dialogSmall = "_dialogSmall_o29gm_94";
16
+ const dialogMedium = "_dialogMedium_o29gm_98";
17
+ const dialogLarge = "_dialogLarge_o29gm_102";
18
+ const styles = {
19
+ dialogWrapper,
20
+ overlay,
21
+ dialog,
22
+ dialogContent,
23
+ dialogHeading,
24
+ dialogContentInner,
25
+ noHeader,
26
+ closeButton,
27
+ dialogSmall,
28
+ dialogMedium,
29
+ dialogLarge
30
+ };
31
+ const DialogHeader = ({
32
+ /** ID used to reference this header for aria-labelledby */
33
+ id,
34
+ /** Content of the header section */
35
+ children
36
+ }) => {
37
+ return /* @__PURE__ */ jsx("div", { className: styles.dialogHeading, id, children });
38
+ };
39
+ function DialogWrapper({
40
+ children,
41
+ ...props
42
+ }) {
43
+ const {
44
+ onClose,
45
+ size = "medium",
46
+ modal = false,
47
+ hasDismissButton = true,
48
+ role = "dialog",
49
+ id
50
+ } = props;
51
+ const ref = useRef(null);
52
+ const {
53
+ dialogProps
54
+ } = useDialog({
55
+ ...props,
56
+ role
57
+ }, ref);
58
+ const {
59
+ overlayProps,
60
+ underlayProps
61
+ } = useOverlay({
62
+ isOpen: true,
63
+ onClose,
64
+ isDismissable: true,
65
+ ...props
66
+ }, ref);
67
+ usePreventScroll();
68
+ const {
69
+ modalProps
70
+ } = useModal();
71
+ const headerChild = React.Children.toArray(children).find((child) => React.isValidElement(child) && child.type === DialogHeader);
72
+ const otherChildren = React.Children.toArray(children).filter((child) => !React.isValidElement(child) || child.type !== DialogHeader);
73
+ const hasHeader = Boolean(headerChild) || hasDismissButton;
74
+ const headerId = props["aria-labelledby"] || `${id}-header`;
75
+ const contentId = props["aria-describedby"] || `${id}-content`;
76
+ return /* @__PURE__ */ jsxs("div", { className: `${styles.dialogWrapper} ${modal ? styles.modal : ""}`, children: [
77
+ modal && /* @__PURE__ */ jsx("div", { className: styles.overlay, ...underlayProps, onClick: onClose, onKeyDown: (e) => {
78
+ if (e.key === "Enter" || e.key === "Space") {
79
+ onClose == null ? void 0 : onClose();
80
+ }
81
+ }, role: "button", tabIndex: 0 }),
82
+ /* @__PURE__ */ jsx(FocusScope, { contain: true, restoreFocus: true, autoFocus: false, children: /* @__PURE__ */ jsxs("div", { ...overlayProps, ...dialogProps, ...modalProps, ref, className: `${styles.dialog} ${styles[size]}`, "data-size": size, id, role, "aria-labelledby": headerId, "aria-describedby": contentId, children: [
83
+ /* @__PURE__ */ jsxs("div", { className: `${styles.dialogContent} ${!hasHeader ? styles.noHeader : ""}`, children: [
84
+ hasHeader && /* @__PURE__ */ jsx("div", { className: styles.dialogHeader, id: headerId, children: headerChild }),
85
+ /* @__PURE__ */ jsx("div", { id: contentId, children: otherChildren })
86
+ ] }),
87
+ hasDismissButton && /* @__PURE__ */ jsx("div", { className: styles.closeButton, children: /* @__PURE__ */ jsx(IconButton, { onClick: onClose, styleVariant: "white", emphasis: "primary", size: "sm", iconProps: {
88
+ iconName: "close",
89
+ iconPrefix: "far",
90
+ iconSize: "1x"
91
+ }, tooltipLabel: "Close dialog", "aria-label": "Close dialog" }) })
92
+ ] }) })
93
+ ] });
94
+ }
95
+ function Dialog(props) {
96
+ const {
97
+ isOpen,
98
+ children
99
+ } = props;
100
+ if (!isOpen) {
101
+ return null;
102
+ }
103
+ return /* @__PURE__ */ jsx(OverlayContainer, { children: /* @__PURE__ */ jsx(DialogWrapper, { ...props, children }) });
104
+ }
105
+ const DialogContent = ({
106
+ children
107
+ }) => {
108
+ return /* @__PURE__ */ jsx("div", { className: styles.dialogContentInner, children });
109
+ };
110
+ Dialog.Header = DialogHeader;
111
+ Dialog.Content = DialogContent;
112
+ export {
113
+ Dialog,
114
+ DialogContent,
115
+ Dialog as default
116
+ };
117
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from './Dialog';
@@ -0,0 +1,5 @@
1
+ import { Dialog } from "./Dialog.js";
2
+ export {
3
+ Dialog as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,7 @@
1
+ import { CalloutBannerProps } from '../CalloutBanner/CalloutBanner';
2
+ import { default as React } from 'react';
3
+ export interface ErrorSummaryProps extends Pick<CalloutBannerProps, 'title' | 'description'> {
4
+ children: React.ReactElement[] | React.ReactElement;
5
+ }
6
+ export declare const ErrorSummary: ({ title, description, children, }: ErrorSummaryProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default ErrorSummary;
@@ -0,0 +1,44 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { CalloutBanner } from "../CalloutBanner/CalloutBanner.js";
3
+ import React, { useState } from "react";
4
+ import Link from "../Link/Link.js";
5
+ import { Box } from "../Box/Box.js";
6
+ import '../../assets/ErrorSummary.css';const styles = {
7
+ "errorSummary-list": "_errorSummary-list_yt1ru_1",
8
+ "errorSummary-list__item": "_errorSummary-list__item_yt1ru_24"
9
+ };
10
+ const MAX_ERRORS_SHOW = 4;
11
+ const ErrorSummary = ({
12
+ title,
13
+ description,
14
+ children
15
+ }) => {
16
+ const [showAllErrors, setShowAllErrors] = useState(false);
17
+ if (!children || Array.isArray(children) && children.length === 0) {
18
+ return null;
19
+ }
20
+ const errorsToRender = showAllErrors ? children : Array.isArray(children) ? children.slice(0, MAX_ERRORS_SHOW) : [children];
21
+ const hasMoreErrors = Array.isArray(children) && children.length > MAX_ERRORS_SHOW;
22
+ return /* @__PURE__ */ jsx(CalloutBanner, { title, description, children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
23
+ /* @__PURE__ */ jsx("div", { className: styles["errorSummary-list"], children: React.Children.map(errorsToRender, (child, index) => {
24
+ if (React.isValidElement(child)) {
25
+ return React.cloneElement(child, {
26
+ key: `error-${index}`,
27
+ iconEndProps: false
28
+ });
29
+ }
30
+ return child;
31
+ }) }),
32
+ hasMoreErrors && !showAllErrors && /* @__PURE__ */ jsx(Link, { onPress: () => setShowAllErrors(true), underline: true, size: "sm", iconEndProps: {
33
+ iconName: "chevron-down"
34
+ }, children: "Show more" }),
35
+ showAllErrors && hasMoreErrors && /* @__PURE__ */ jsx(Link, { onPress: () => setShowAllErrors(false), underline: true, size: "sm", iconEndProps: {
36
+ iconName: "chevron-up"
37
+ }, children: "Show less" })
38
+ ] }) });
39
+ };
40
+ export {
41
+ ErrorSummary,
42
+ ErrorSummary as default
43
+ };
44
+ //# sourceMappingURL=ErrorSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from './ErrorSummary';
@@ -0,0 +1,5 @@
1
+ import { ErrorSummary } from "./ErrorSummary.js";
2
+ export {
3
+ ErrorSummary as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -15,7 +15,7 @@ const FieldError = ({
15
15
  const errorMessage = children || (validationErrors == null ? void 0 : validationErrors[0]);
16
16
  if (!errorMessage) return null;
17
17
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18
- /* @__PURE__ */ jsx(Icon, { iconName: "triangle-exclamation", "aria-label": "error-icon" }),
18
+ /* @__PURE__ */ jsx(Icon, { iconName: "triangle-exclamation", iconPrefix: "fas", "aria-label": "error-icon" }),
19
19
  errorMessage
20
20
  ] });
21
21
  } });
@@ -2,10 +2,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import FieldDescription from "../FieldDescription/FieldDescription.js";
3
3
  import { FieldError } from "../FieldError/FieldError.js";
4
4
  import { FieldLabel } from "../FieldLabel/FieldLabel.js";
5
- import '../../assets/FieldHeader.css';const fieldHeader = "_fieldHeader_3rjlj_1";
5
+ import '../../assets/FieldHeader.css';const fieldHeader = "_fieldHeader_jjofg_1";
6
6
  const styles = {
7
7
  fieldHeader,
8
- "label-container": "_label-container_3rjlj_12"
8
+ "label-container": "_label-container_jjofg_13"
9
9
  };
10
10
  const FieldHeader = ({
11
11
  label,
@@ -16,10 +16,10 @@ const FieldHeader = ({
16
16
  labelFor
17
17
  }) => {
18
18
  return /* @__PURE__ */ jsxs("div", { className: styles.fieldHeader, "data-invalid": isInvalid ? true : void 0, children: [
19
- /* @__PURE__ */ jsxs("div", { className: styles["label-container"], children: [
20
- label && /* @__PURE__ */ jsx(FieldLabel, { required: isRequired ? true : void 0, htmlFor: labelFor, children: label }),
21
- !isRequired && /* @__PURE__ */ jsx("span", { children: "Optional" })
22
- ] }),
19
+ /* @__PURE__ */ jsx("div", { className: styles["label-container"], children: label && /* @__PURE__ */ jsxs(FieldLabel, { required: isRequired ? true : void 0, htmlFor: labelFor, children: [
20
+ label,
21
+ !isRequired && ` (Optional)`
22
+ ] }) }),
23
23
  description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
24
24
  /* @__PURE__ */ jsx(FieldError, { children: errorMessage })
25
25
  ] });
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Label } from "react-aria-components";
3
- import '../../assets/FieldLabel.css';const fieldLabel = "_fieldLabel_1jqml_1";
3
+ import '../../assets/FieldLabel.css';const fieldLabel = "_fieldLabel_vou7c_1";
4
4
  const styles = {
5
5
  fieldLabel
6
6
  };
@@ -1,16 +1,16 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Heading } from "../Heading/Heading.js";
3
- import '../../assets/FieldsetHeader.css';const fieldsetHeader = "_fieldsetHeader_abhm4_1";
3
+ import '../../assets/FieldsetHeader.css';const fieldsetHeader = "_fieldsetHeader_6pt1c_1";
4
4
  const styles = {
5
5
  fieldsetHeader,
6
- "fieldsetHeader-description": "_fieldsetHeader-description_abhm4_12"
6
+ "fieldsetHeader-description": "_fieldsetHeader-description_6pt1c_12"
7
7
  };
8
8
  const FieldsetHeader = ({
9
9
  children,
10
10
  description
11
11
  }) => {
12
12
  return /* @__PURE__ */ jsxs("div", { className: styles["fieldsetHeader"], children: [
13
- /* @__PURE__ */ jsx(Heading, { as: "legend", size: "sm", fgColor: "accentSecondary", children }),
13
+ /* @__PURE__ */ jsx(Heading, { as: "legend", size: "sm", foregroundColor: "accentSecondary", children }),
14
14
  description && /* @__PURE__ */ jsx("span", { className: styles["fieldsetHeader-description"], children: description })
15
15
  ] });
16
16
  };
@@ -1,20 +1,39 @@
1
1
  import { default as React } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
- import { fgColorVariants } from '../../utils/fgColour/fgColor';
3
+ import { ForegroundVariants } from '../../utils/foregroundColour/foregroundColor';
4
4
  declare const heading: (props?: ({
5
- size?: "lg" | "sm" | "xs" | "md" | "xl" | "xxs" | null | undefined;
6
- textAlign?: "end" | "start" | "center" | null | undefined;
5
+ size?: "lg" | "sm" | "xs" | "xl" | "md" | "xxs" | null | undefined;
6
+ textAlign?: "center" | "end" | "start" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  type HeadingVariants = VariantProps<typeof heading>;
9
- type FgColorVariants = VariantProps<typeof fgColorVariants>;
10
9
  type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'legend';
11
10
  type HeadingSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
12
11
  export interface HeadingProps extends HeadingVariants {
12
+ /**
13
+ * children
14
+ */
13
15
  children: React.ReactNode;
16
+ /**
17
+ * The heading element to render
18
+ */
14
19
  as?: HeadingLevel;
20
+ /**
21
+ * The size of the heading
22
+ */
15
23
  size?: HeadingSize;
16
- fgColor?: FgColorVariants['fgColor'];
24
+ /**
25
+ * The foreground color of the heading
26
+ */
27
+ foregroundColor?: ForegroundVariants['foregroundColor'];
28
+ /**
29
+ * The foreground color of the heading
30
+ * @deprecated Use `foregroundColor` instead
31
+ */
32
+ fgColor?: ForegroundVariants['foregroundColor'];
33
+ /**
34
+ * The text alignment of the heading
35
+ */
17
36
  textAlign?: 'start' | 'center' | 'end';
18
37
  }
19
- export declare const Heading: ({ children, as: Component, size, fgColor, textAlign, ...props }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const Heading: ({ children, as: Component, size, foregroundColor, fgColor, textAlign, ...props }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
20
39
  export default Heading;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as cva } from "../../index-Bi3v_EjJ.js";
3
- import { fgColorVariants } from "../../utils/fgColour/fgColor.js";
3
+ import { foregroundColorVariants } from "../../utils/foregroundColour/foregroundColor.js";
4
4
  import '../../assets/Heading.css';const heading$1 = "_heading_15puj_1";
5
5
  const xxs = "_xxs_15puj_8";
6
6
  const xs = "_xs_15puj_15";
@@ -60,16 +60,21 @@ const Heading = ({
60
60
  children,
61
61
  as: Component = "h1",
62
62
  size,
63
- fgColor = "accentPrimary",
63
+ foregroundColor = "accentSecondary",
64
+ fgColor,
64
65
  textAlign = "start",
65
66
  ...props
66
67
  }) => {
67
68
  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";
68
73
  return /* @__PURE__ */ jsx(Component, { className: `${heading({
69
74
  size: effectiveSize,
70
75
  textAlign
71
- })} ${fgColorVariants({
72
- fgColor
76
+ })} ${foregroundColorVariants({
77
+ foregroundColor: resolvedFontColor
73
78
  })}`, ...props, children });
74
79
  };
75
80
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Heading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,11 @@
1
- export type IconSize = 'lg' | 'sm' | '1x' | 'xs' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x';
1
+ import { ForegroundVariants } from '../../utils/foregroundColour/foregroundColor';
2
+ import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
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
+ export type DeprecatedIconSize = 'lg' | 'sm' | 'xs' | '2xs' | 'xl' | '2xl';
2
9
  export interface IconProps {
3
10
  /**
4
11
  * What Icon to load from fontAwesome
@@ -6,13 +13,28 @@ export interface IconProps {
6
13
  iconName: string;
7
14
  /**
8
15
  * The prefix of the icon to load.
16
+ * See https://docs.fontawesome.com/web/add-icons/how-to
9
17
  * @default 'fas'
10
18
  */
11
- iconPrefix?: 'fas' | 'far' | 'fal' | 'fab' | 'fad';
19
+ iconPrefix?: 'fas' | 'far' | 'fal' | 'fab' | 'fad' | 'fak';
20
+ /**
21
+ * The icon pack to load.
22
+ * Example: 'brands'
23
+ */
24
+ iconPack?: string;
12
25
  /**
13
26
  * The size of the icon.
14
27
  */
15
- iconSize?: IconSize;
28
+ iconSize?: IconSize | DeprecatedIconSize;
29
+ /**
30
+ * The color of the icon.
31
+ */
32
+ color?: ForegroundVariants['foregroundColor'];
33
+ /**
34
+ * The padding of the icon.
35
+ * @default 'none'
36
+ */
37
+ padding?: 'none' | 'fixedWidth' | 'square' | 'roomy';
16
38
  /**
17
39
  * Flip the icon horizontally, vertically, or both.
18
40
  */
@@ -54,6 +76,11 @@ export interface IconProps {
54
76
  * Accessible text for the icon. If the icon is decorative, this can be omitted.
55
77
  */
56
78
  ariaLabel?: string;
79
+ /**
80
+ * Background color class for the icon used solely in iconBackdrop component
81
+ * @ignore
82
+ */
83
+ privateBgColorVariant?: BackgroundVariants['backgroundColor'];
57
84
  }
58
- export declare const Icon: ({ iconName, iconPrefix, iconSize: size, flip, fixedWidth, listItem, border, rotation, pull, spin, className, ariaLabel, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
85
+ export declare const Icon: ({ iconName, iconPrefix, iconSize, iconPack, color, padding, flip, fixedWidth, listItem, border, rotation, pull, spin, className, ariaLabel, privateBgColorVariant, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
59
86
  export default Icon;