@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
@@ -0,0 +1,58 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { Badge } from "../Badge/Badge.js";
3
+ import { AviosCurrencySymbol } from "../AviosCurrencySymbol/AviosCurrencySymbol.js";
4
+ import '../../assets/AviosBadge.css';const aviosBadge = "_aviosBadge_a9p4a_1";
5
+ const collect = "_collect_a9p4a_13";
6
+ const spend = "_spend_a9p4a_18";
7
+ const content = "_content_a9p4a_23";
8
+ const points = "_points_a9p4a_30";
9
+ const label = "_label_a9p4a_31";
10
+ const textEnd = "_textEnd_a9p4a_37";
11
+ const sm = "_sm_a9p4a_43";
12
+ const lg = "_lg_a9p4a_48";
13
+ const styles = {
14
+ aviosBadge,
15
+ collect,
16
+ spend,
17
+ content,
18
+ points,
19
+ label,
20
+ textEnd,
21
+ sm,
22
+ lg
23
+ };
24
+ const AviosBadge = ({
25
+ kind = "collect",
26
+ size = "md",
27
+ textEnd: textEnd2,
28
+ points: points2,
29
+ children,
30
+ ariaLabel,
31
+ className,
32
+ ...props
33
+ }) => {
34
+ const formattedPoints = points2.toLocaleString();
35
+ const defaultAriaLabel = `${kind} ${formattedPoints} ${children || "Avios"} ${textEnd2 || ""}`.trim();
36
+ const iconSizes = {
37
+ sm: "18px",
38
+ md: "20px",
39
+ lg: "24px"
40
+ };
41
+ const badgeSize = size === "lg" ? "md" : size;
42
+ return /* @__PURE__ */ jsxs(Badge, { variant: kind === "collect" ? "success" : "info", size: badgeSize, ariaLabel: ariaLabel || defaultAriaLabel, className: `${styles.aviosBadge} ${styles[size]} ${styles[kind]} ${className || ""}`, ...props, children: [
43
+ /* @__PURE__ */ jsx(AviosCurrencySymbol, { kind, styleVariant: "secondary", width: iconSizes[size], height: iconSizes[size], "aria-hidden": "true" }),
44
+ /* @__PURE__ */ jsxs("span", { className: styles.content, children: [
45
+ /* @__PURE__ */ jsx("span", { className: styles.points, children: formattedPoints }),
46
+ children && /* @__PURE__ */ jsx("span", { className: styles.label, children }),
47
+ textEnd2 && /* @__PURE__ */ jsxs(Fragment, { children: [
48
+ /* @__PURE__ */ jsx("span", { className: styles.plusSign, children: "+" }),
49
+ /* @__PURE__ */ jsx("span", { className: styles.textEnd, children: textEnd2 })
50
+ ] })
51
+ ] })
52
+ ] });
53
+ };
54
+ export {
55
+ AviosBadge,
56
+ AviosBadge as default
57
+ };
58
+ //# sourceMappingURL=AviosBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AviosBadge.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from './AviosBadge';
@@ -0,0 +1,5 @@
1
+ import { AviosBadge } from "./AviosBadge.js";
2
+ export {
3
+ AviosBadge as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -26,9 +26,14 @@ export interface BadgeProps {
26
26
  */
27
27
  trailingIconProps?: IconProps;
28
28
  /**
29
- * The focus style of the button
29
+ * The focus style of the button
30
30
  */
31
31
  focusStyle?: 'default' | 'white';
32
+ /**
33
+ * @internal
34
+ * Internal className prop for design system use only
35
+ */
36
+ className?: string;
32
37
  }
33
- export declare const Badge: ({ children, size, variant, ariaLabel, leadingIconProps, trailingIconProps, focusStyle, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const Badge: ({ children, size, variant, ariaLabel, leadingIconProps, trailingIconProps, focusStyle, className, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
34
39
  export default Badge;
@@ -55,6 +55,7 @@ const Badge = ({
55
55
  leadingIconProps,
56
56
  trailingIconProps,
57
57
  focusStyle = "default",
58
+ className,
58
59
  ...props
59
60
  }) => {
60
61
  return /* @__PURE__ */ jsxs("span", { className: `${badge({
@@ -62,7 +63,7 @@ const Badge = ({
62
63
  variant
63
64
  })} ${focusStyleVariants({
64
65
  focusStyle
65
- })}`, role: "status", "aria-label": ariaLabel, ...props, children: [
66
+ })} ${className || ""}`, role: "status", "aria-label": ariaLabel, ...props, children: [
66
67
  leadingIconProps && /* @__PURE__ */ jsx(Icon, { ...leadingIconProps }),
67
68
  children,
68
69
  trailingIconProps && /* @__PURE__ */ jsx(Icon, { ...trailingIconProps })
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Badge.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,14 +1,14 @@
1
1
  import { default as React } from 'react';
2
- import { BackgroundVariants } from '../../utils/backgroundColour/backgroundColour';
2
+ import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
3
3
  import { FlexVariants } from '../../utils/flex/flex';
4
4
  import { BorderVariants } from '../../utils/border/border';
5
5
  import { PaddingVariants } from '../../utils/padding/padding';
6
- export interface BoxProps extends BackgroundVariants, FlexVariants, BorderVariants, PaddingVariants {
7
- children: React.ReactNode;
6
+ import { PositionVariants } from '../../utils/position/position';
7
+ export interface BoxProps extends BackgroundVariants, FlexVariants, BorderVariants, PaddingVariants, PositionVariants, Omit<React.HTMLAttributes<Element>, 'className' | 'style'> {
8
8
  /**
9
9
  * The HTML element to render the Box as.
10
10
  */
11
- as?: 'div' | 'article';
11
+ as?: 'div' | 'article' | 'aside' | 'nav' | 'section' | 'main';
12
12
  /**
13
13
  * The width of the Box.
14
14
  * Accepts any valid CSS unit or "full"
@@ -39,6 +39,10 @@ export interface BoxProps extends BackgroundVariants, FlexVariants, BorderVarian
39
39
  * Accepts any valid CSS unit.
40
40
  */
41
41
  minHeight?: string;
42
+ /**
43
+ * @deprecated Use `backgroundColor` instead.
44
+ */
45
+ backgroundColour?: BackgroundVariants['backgroundColor'];
42
46
  }
43
- export declare const Box: ({ children, as: Component, width, maxWidth, minWidth, height, maxHeight, minHeight, ...props }: BoxProps) => import("react/jsx-runtime").JSX.Element;
47
+ export declare const Box: ({ children, as: Component, width, maxWidth, minWidth, height, maxHeight, minHeight, position, ...props }: BoxProps) => import("react/jsx-runtime").JSX.Element;
44
48
  export default Box;
@@ -1,8 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { backgroundColorVariants } from "../../utils/backgroundColour/backgroundColour.js";
2
+ import { backgroundColorVariants } from "../../utils/backgroundColor/backgroundColor.js";
3
3
  import { flexVariants } from "../../utils/flex/flex.js";
4
4
  import { borderVariants } from "../../utils/border/border.js";
5
5
  import { paddingVariants } from "../../utils/padding/padding.js";
6
+ import { positionVariants } from "../../utils/position/position.js";
6
7
  const Box = ({
7
8
  children,
8
9
  as: Component = "div",
@@ -12,8 +13,13 @@ const Box = ({
12
13
  height,
13
14
  maxHeight,
14
15
  minHeight,
16
+ position,
15
17
  ...props
16
18
  }) => {
19
+ if ((props == null ? void 0 : props.backgroundColour) && !(props == null ? void 0 : props.backgroundColor)) {
20
+ console.warn("Warning: `backgroundColour` is deprecated and will be removed in a future release. Please use `backgroundColor` instead.");
21
+ }
22
+ const resolvedBackgroundColor = props.backgroundColor ?? props.backgroundColour;
17
23
  const borderWidth = !(props == null ? void 0 : props.borderWidth) && props.borderColour !== "none" ? "sm" : props.borderWidth;
18
24
  const stylesProp = {
19
25
  width: width === "full" ? "100%" : width,
@@ -31,7 +37,10 @@ const Box = ({
31
37
  })} ${paddingVariants({
32
38
  ...props
33
39
  })} ${backgroundColorVariants({
40
+ backgroundColor: resolvedBackgroundColor,
34
41
  ...props
42
+ })} ${positionVariants({
43
+ position
35
44
  })}`, style: stylesProp, children });
36
45
  };
37
46
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,35 +8,35 @@ import { useFocusRing } from "@react-aria/focus";
8
8
  import { Icon } from "../Icon/Icon.js";
9
9
  import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
10
10
  import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
11
- import '../../assets/Button.css';const button$1 = "_button_1pjm3_1";
12
- const content = "_content_1pjm3_22";
13
- const isNotLoading = "_isNotLoading_1pjm3_31";
14
- const loadingSpinner = "_loadingSpinner_1pjm3_31";
15
- const isLoading = "_isLoading_1pjm3_40";
16
- const focusWhite = "_focusWhite_1pjm3_52";
17
- const sm = "_sm_1pjm3_59";
18
- const md = "_md_1pjm3_64";
19
- const lg = "_lg_1pjm3_69";
20
- const fullWidth = "_fullWidth_1pjm3_74";
21
- const textAlignLeft = "_textAlignLeft_1pjm3_81";
22
- const textAlignCenter = "_textAlignCenter_1pjm3_85";
23
- const textAlignRight = "_textAlignRight_1pjm3_89";
24
- const accentPrimary = "_accentPrimary_1pjm3_97";
25
- const accentSecondary = "_accentSecondary_1pjm3_117";
26
- const accentTertiary = "_accentTertiary_1pjm3_147";
27
- const accentQuaternary = "_accentQuaternary_1pjm3_173";
28
- const criticalPrimary = "_criticalPrimary_1pjm3_199";
29
- const criticalSecondary = "_criticalSecondary_1pjm3_224";
30
- const criticalTertiary = "_criticalTertiary_1pjm3_254";
31
- const criticalQuaternary = "_criticalQuaternary_1pjm3_280";
32
- const neutralPrimary = "_neutralPrimary_1pjm3_307";
33
- const neutralSecondary = "_neutralSecondary_1pjm3_332";
34
- const neutralTertiary = "_neutralTertiary_1pjm3_361";
35
- const neutralQuaternary = "_neutralQuaternary_1pjm3_387";
36
- const whitePrimary = "_whitePrimary_1pjm3_414";
37
- const whiteSecondary = "_whiteSecondary_1pjm3_440";
38
- const whiteTertiary = "_whiteTertiary_1pjm3_473";
39
- const whiteQuaternary = "_whiteQuaternary_1pjm3_503";
11
+ import '../../assets/Button.css';const button$1 = "_button_etsb3_1";
12
+ const content = "_content_etsb3_19";
13
+ const isNotLoading = "_isNotLoading_etsb3_28";
14
+ const loadingSpinner = "_loadingSpinner_etsb3_28";
15
+ const isLoading = "_isLoading_etsb3_37";
16
+ const focusWhite = "_focusWhite_etsb3_49";
17
+ const sm = "_sm_etsb3_56";
18
+ const md = "_md_etsb3_64";
19
+ const lg = "_lg_etsb3_72";
20
+ const fullWidth = "_fullWidth_etsb3_80";
21
+ const textAlignLeft = "_textAlignLeft_etsb3_87";
22
+ const textAlignCenter = "_textAlignCenter_etsb3_91";
23
+ const textAlignRight = "_textAlignRight_etsb3_95";
24
+ const accentPrimary = "_accentPrimary_etsb3_103";
25
+ const accentSecondary = "_accentSecondary_etsb3_123";
26
+ const accentTertiary = "_accentTertiary_etsb3_153";
27
+ const accentQuaternary = "_accentQuaternary_etsb3_179";
28
+ const criticalPrimary = "_criticalPrimary_etsb3_205";
29
+ const criticalSecondary = "_criticalSecondary_etsb3_230";
30
+ const criticalTertiary = "_criticalTertiary_etsb3_260";
31
+ const criticalQuaternary = "_criticalQuaternary_etsb3_286";
32
+ const neutralPrimary = "_neutralPrimary_etsb3_313";
33
+ const neutralSecondary = "_neutralSecondary_etsb3_338";
34
+ const neutralTertiary = "_neutralTertiary_etsb3_367";
35
+ const neutralQuaternary = "_neutralQuaternary_etsb3_393";
36
+ const whitePrimary = "_whitePrimary_etsb3_420";
37
+ const whiteSecondary = "_whiteSecondary_etsb3_446";
38
+ const whiteTertiary = "_whiteTertiary_etsb3_479";
39
+ const whiteQuaternary = "_whiteQuaternary_etsb3_509";
40
40
  const styles = {
41
41
  button: button$1,
42
42
  content,
@@ -67,8 +67,8 @@ const styles = {
67
67
  whiteSecondary,
68
68
  whiteTertiary,
69
69
  whiteQuaternary,
70
- "fa-spinner-third": "_fa-spinner-third_1pjm3_535",
71
- "icon-wrapper": "_icon-wrapper_1pjm3_540"
70
+ "fa-spinner-third": "_fa-spinner-third_etsb3_541",
71
+ "icon-wrapper": "_icon-wrapper_etsb3_546"
72
72
  };
73
73
  const button = cva(styles.button, {
74
74
  variants: {
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const calloutBanner: (props?: ({
4
+ emphasis?: "secondary" | "primary" | "tertiary" | null | undefined;
5
+ styleVariant?: "neutral" | "critical" | "success" | "information" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export type CalloutBannerVariants = VariantProps<typeof calloutBanner>;
8
+ export interface CalloutBannerProps extends CalloutBannerVariants {
9
+ /** The main heading text of the banner */
10
+ title: string;
11
+ /** Optional secondary text providing more details */
12
+ description?: string;
13
+ /** Optional button group to be rendered as a label */
14
+ label?: React.ReactNode;
15
+ /** Optional content to be rendered in the end section of the banner */
16
+ children?: React.ReactNode;
17
+ /** Optional callback function triggered when the dismiss button is clicked */
18
+ onDismiss?: () => void;
19
+ }
20
+ export declare const CalloutBanner: ({ title, description, label, children, styleVariant, emphasis, onDismiss, }: CalloutBannerProps) => import("react/jsx-runtime").JSX.Element;
21
+ export default CalloutBanner;
@@ -0,0 +1,96 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { Icon } from "../Icon/Icon.js";
4
+ import { c as cva } from "../../index-Bi3v_EjJ.js";
5
+ import { IconButton } from "../IconButton/IconButton.js";
6
+ import '../../assets/CalloutBanner.css';const calloutBanner$1 = "_calloutBanner_1o7bw_1";
7
+ const calloutBanner__icon = "_calloutBanner__icon_1o7bw_11";
8
+ const calloutBanner__start = "_calloutBanner__start_1o7bw_15";
9
+ const calloutBanner__dismiss = "_calloutBanner__dismiss_1o7bw_23";
10
+ const calloutBanner__meta = "_calloutBanner__meta_1o7bw_29";
11
+ const calloutBanner__end = "_calloutBanner__end_1o7bw_58";
12
+ const styles = {
13
+ calloutBanner: calloutBanner$1,
14
+ calloutBanner__icon,
15
+ calloutBanner__start,
16
+ calloutBanner__dismiss,
17
+ calloutBanner__meta,
18
+ "calloutBanner__meta-title": "_calloutBanner__meta-title_1o7bw_41",
19
+ "calloutBanner__meta-description": "_calloutBanner__meta-description_1o7bw_45",
20
+ "calloutBanner__meta-label": "_calloutBanner__meta-label_1o7bw_49",
21
+ calloutBanner__end,
22
+ "calloutBanner-critical": "_calloutBanner-critical_1o7bw_66",
23
+ "calloutBanner-primary": "_calloutBanner-primary_1o7bw_70",
24
+ "calloutBanner-secondary": "_calloutBanner-secondary_1o7bw_74",
25
+ "calloutBanner-tertiary": "_calloutBanner-tertiary_1o7bw_80",
26
+ "calloutBanner-success": "_calloutBanner-success_1o7bw_89",
27
+ "calloutBanner-information": "_calloutBanner-information_1o7bw_112",
28
+ "calloutBanner-neutral": "_calloutBanner-neutral_1o7bw_135"
29
+ };
30
+ const calloutBanner = cva(styles.calloutBanner, {
31
+ variants: {
32
+ emphasis: {
33
+ primary: styles["calloutBanner-primary"],
34
+ secondary: styles["calloutBanner-secondary"],
35
+ tertiary: styles["calloutBanner-tertiary"]
36
+ },
37
+ styleVariant: {
38
+ critical: styles["calloutBanner-critical"],
39
+ success: styles["calloutBanner-success"],
40
+ information: styles["calloutBanner-information"],
41
+ neutral: styles["calloutBanner-neutral"]
42
+ }
43
+ },
44
+ defaultVariants: {
45
+ emphasis: "primary",
46
+ styleVariant: "critical"
47
+ }
48
+ });
49
+ const CalloutBanner = ({
50
+ title,
51
+ description,
52
+ label,
53
+ children,
54
+ styleVariant = "critical",
55
+ emphasis = "primary",
56
+ onDismiss
57
+ }) => {
58
+ const iconName = React.useMemo(() => {
59
+ switch (styleVariant) {
60
+ case "critical":
61
+ return "circle-exclamation";
62
+ case "success":
63
+ return "check-circle";
64
+ case "information":
65
+ return "info-circle";
66
+ case "neutral":
67
+ return "check-circle";
68
+ default:
69
+ return "circle-exclamation";
70
+ }
71
+ }, [emphasis]);
72
+ return /* @__PURE__ */ jsxs("div", { className: calloutBanner({
73
+ emphasis,
74
+ styleVariant
75
+ }), children: [
76
+ /* @__PURE__ */ jsxs("div", { className: styles["calloutBanner__start"], children: [
77
+ /* @__PURE__ */ jsx(Icon, { iconName, iconPrefix: "fas", className: styles["calloutBanner__icon"], iconSize: "1.25x", padding: "roomy" }),
78
+ /* @__PURE__ */ jsxs("div", { className: styles["calloutBanner__meta"], children: [
79
+ typeof onDismiss === "function" && /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__dismiss"], children: /* @__PURE__ */ jsx(IconButton, { onClick: onDismiss, styleVariant: emphasis === "primary" ? "white" : "neutral", emphasis: "quaternary", size: "sm", iconProps: {
80
+ iconName: "close",
81
+ iconPrefix: "far",
82
+ iconSize: "1x"
83
+ }, tooltipLabel: "Dismiss banner", "aria-label": "Dismiss banner" }) }),
84
+ /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__meta-title"], children: title }),
85
+ description && /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__meta-description"], children: description }),
86
+ label && /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__meta-label"], children: label })
87
+ ] })
88
+ ] }),
89
+ children && /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__end"], children })
90
+ ] });
91
+ };
92
+ export {
93
+ CalloutBanner,
94
+ CalloutBanner as default
95
+ };
96
+ //# sourceMappingURL=CalloutBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalloutBanner.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from './CalloutBanner';
@@ -0,0 +1,5 @@
1
+ import { CalloutBanner } from "./CalloutBanner.js";
2
+ export {
3
+ CalloutBanner as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +1,2 @@
1
+ export type { CheckboxProps } from './Checkbox';
1
2
  export { default } from './Checkbox';
@@ -0,0 +1,29 @@
1
+ import { TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
2
+ import { FieldProps } from '../_base/Field';
3
+ type CreditCardNumberValue = string | number | null | undefined;
4
+ interface CreditCardNumberFieldBaseProps {
5
+ /**
6
+ * The icon to display.
7
+ * If a function is provided, it will be called with the current value of the input.
8
+ * Expects an icon name from the font-awesome `brands` icon pack.
9
+ * https://fontawesome.com/search?q=credit%20card&o=r&ip=brands
10
+ */
11
+ cardIcon?: string | ((value?: CreditCardNumberValue) => string);
12
+ /**
13
+ * The controlled value of the credit card number.
14
+ */
15
+ value?: CreditCardNumberValue;
16
+ /**
17
+ * The controlled onChange handler for the credit card number.
18
+ */
19
+ onChange?: (value?: CreditCardNumberValue) => void;
20
+ /**
21
+ * The default value of the credit card number.
22
+ */
23
+ defaultValue?: CreditCardNumberValue;
24
+ }
25
+ export interface CreditCardNumberFieldProps extends Omit<FieldProps<Omit<AriaTextFieldProps, 'defaultValue' | 'value' | 'onChange'>>, 'isRequired'>, CreditCardNumberFieldBaseProps {
26
+ placeholder?: string;
27
+ }
28
+ export declare const CreditCardNumberField: ({ cardIcon: cardIconProp, defaultValue, value: valueControlled, onChange: onChangeControlled, label, ...props }: CreditCardNumberFieldProps) => import("react/jsx-runtime").JSX.Element;
29
+ export default CreditCardNumberField;
@@ -0,0 +1,46 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { TextField, Input } from "react-aria-components";
4
+ import { P as PatternFormat } from "../../react-number-format.es-DMLgWFZX.js";
5
+ import { Field } from "../_base/Field/Field.js";
6
+ import { Icon } from "../Icon/Icon.js";
7
+ import { getCardIcon } from "../../utils/creditCard/creditCard.js";
8
+ import '../../assets/CreditCardNumberField.css';const creditCardNumberField = "_creditCardNumberField_1d9o2_1";
9
+ const inputWrapper = "_inputWrapper_1d9o2_45";
10
+ const iconEnd = "_iconEnd_1d9o2_51";
11
+ const styles = {
12
+ creditCardNumberField,
13
+ inputWrapper,
14
+ iconEnd
15
+ };
16
+ const CreditCardNumberField = ({
17
+ cardIcon: cardIconProp = getCardIcon,
18
+ defaultValue,
19
+ value: valueControlled,
20
+ onChange: onChangeControlled,
21
+ label = "Credit card number",
22
+ ...props
23
+ }) => {
24
+ const [value, setValue] = React.useState(defaultValue);
25
+ const valueDefinitive = valueControlled ?? value;
26
+ const cardIcon = React.useMemo(() => {
27
+ if (typeof cardIconProp === "function") {
28
+ return cardIconProp(value) || "credit-card";
29
+ }
30
+ return cardIconProp || "credit-card";
31
+ }, [value, cardIconProp]);
32
+ return /* @__PURE__ */ jsx(Field, { className: styles.creditCardNumberField, as: TextField, label, isRequired: true, ...props, children: /* @__PURE__ */ jsxs("div", { className: styles.inputWrapper, children: [
33
+ /* @__PURE__ */ jsx(PatternFormat, { type: "text", format: "#### #### #### ####", customInput: Input, placeholder: props == null ? void 0 : props.placeholder, defaultValue, value: valueDefinitive, onValueChange: (values) => {
34
+ if (typeof onChangeControlled === "function") {
35
+ onChangeControlled(values.value);
36
+ }
37
+ setValue(values.value);
38
+ } }),
39
+ /* @__PURE__ */ jsx(Icon, { iconName: cardIcon, iconPrefix: cardIcon === "credit-card" ? "fas" : "fab", className: styles.iconEnd, iconSize: "1.25x", padding: "roomy" })
40
+ ] }) });
41
+ };
42
+ export {
43
+ CreditCardNumberField,
44
+ CreditCardNumberField as default
45
+ };
46
+ //# sourceMappingURL=CreditCardNumberField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreditCardNumberField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from './CreditCardNumberField';
@@ -0,0 +1,5 @@
1
+ import { CreditCardNumberField } from "./CreditCardNumberField.js";
2
+ export {
3
+ CreditCardNumberField as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +1,24 @@
1
- import { DateFieldProps as AriaDateFieldProps, DateValue } from 'react-aria-components';
1
+ import { DateFieldProps as AriaDateFieldBaseProps, DateValue } from 'react-aria-components';
2
2
  import { FieldProps } from '../_base/Field/Field';
3
- export type DateFieldProps = FieldProps<AriaDateFieldProps<DateValue>>;
4
- export declare const DateField: (props: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
3
+ type AriaDateFieldProps = Omit<AriaDateFieldBaseProps<DateValue>, 'defaultValue' | 'value' | 'onChange' | 'minValue' | 'maxValue'>;
4
+ export type DateFieldProps = FieldProps<AriaDateFieldProps> & {
5
+ /**
6
+ * The default value of the date field.
7
+ */
8
+ defaultValue?: string | DateValue;
9
+ /**
10
+ * The controlled value of the date field.
11
+ */
12
+ value?: string | DateValue;
13
+ onChange?: (value: string) => void;
14
+ /**
15
+ * The minimum value of the date field.
16
+ */
17
+ minValue?: string | DateValue;
18
+ /**
19
+ * The maximum value of the date field.
20
+ */
21
+ maxValue?: string | DateValue;
22
+ };
23
+ export declare const DateField: ({ defaultValue: defaultPropValue, value: controlledValue, onChange: onChangeProp, minValue: minPropValue, maxValue: maxPropValue, ...props }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
5
24
  export default DateField;