@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.
- package/dist/assets/Accordion.css +1 -0
- package/dist/assets/AviosBadge.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CalloutBanner.css +1 -0
- package/dist/assets/CreditCardNumberField.css +1 -0
- package/dist/assets/DetailsDisclosure.css +1 -0
- package/dist/assets/Dialog.css +1 -0
- package/dist/assets/ErrorSummary.css +1 -0
- package/dist/assets/FieldHeader.css +1 -1
- package/dist/assets/FieldLabel.css +1 -1
- package/dist/assets/FieldsetHeader.css +1 -1
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/IconBackdrop.css +1 -0
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Menu.css +1 -0
- package/dist/assets/PasswordField.css +1 -0
- package/dist/assets/PhoneNumberField.css +1 -0
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/SelectCard.css +1 -0
- package/dist/assets/SelectNative.css +1 -0
- package/dist/assets/Slider.css +1 -0
- package/dist/assets/Switch.css +1 -0
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/ToggleButton.css +1 -1
- package/dist/assets/ToggleIconButton.css +1 -1
- package/dist/assets/backgroundColor.css +1 -0
- package/dist/assets/flex.css +1 -1
- package/dist/assets/foregroundColor.css +1 -0
- package/dist/assets/position.css +1 -0
- package/dist/components/Accordion/Accordion.d.ts +35 -0
- package/dist/components/Accordion/Accordion.js +140 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +5 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/AviosBadge/AviosBadge.d.ts +34 -0
- package/dist/components/AviosBadge/AviosBadge.js +58 -0
- package/dist/components/AviosBadge/AviosBadge.js.map +1 -0
- package/dist/components/AviosBadge/index.d.ts +1 -0
- package/dist/components/AviosBadge/index.js +5 -0
- package/dist/components/AviosBadge/index.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +7 -2
- package/dist/components/Badge/Badge.js +2 -1
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Box/Box.d.ts +9 -5
- package/dist/components/Box/Box.js +10 -1
- package/dist/components/Box/Box.js.map +1 -1
- package/dist/components/Button/Button.js +31 -31
- package/dist/components/CalloutBanner/CalloutBanner.d.ts +21 -0
- package/dist/components/CalloutBanner/CalloutBanner.js +96 -0
- package/dist/components/CalloutBanner/CalloutBanner.js.map +1 -0
- package/dist/components/CalloutBanner/index.d.ts +1 -0
- package/dist/components/CalloutBanner/index.js +5 -0
- package/dist/components/CalloutBanner/index.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/CreditCardNumberField/CreditCardNumberField.d.ts +29 -0
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js +46 -0
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js.map +1 -0
- package/dist/components/CreditCardNumberField/index.d.ts +1 -0
- package/dist/components/CreditCardNumberField/index.js +5 -0
- package/dist/components/CreditCardNumberField/index.js.map +1 -0
- package/dist/components/DateField/DateField.d.ts +22 -3
- package/dist/components/DateField/DateField.js +856 -2
- package/dist/components/DateField/DateField.js.map +1 -1
- package/dist/components/DetailsDisclosure/DetailsDisclosure.d.ts +33 -0
- package/dist/components/DetailsDisclosure/DetailsDisclosure.js +39 -0
- package/dist/components/DetailsDisclosure/DetailsDisclosure.js.map +1 -0
- package/dist/components/DetailsDisclosure/index.d.ts +2 -0
- package/dist/components/DetailsDisclosure/index.js +5 -0
- package/dist/components/DetailsDisclosure/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +46 -0
- package/dist/components/Dialog/Dialog.js +117 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +5 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/ErrorSummary/ErrorSummary.d.ts +7 -0
- package/dist/components/ErrorSummary/ErrorSummary.js +44 -0
- package/dist/components/ErrorSummary/ErrorSummary.js.map +1 -0
- package/dist/components/ErrorSummary/index.d.ts +1 -0
- package/dist/components/ErrorSummary/index.js +5 -0
- package/dist/components/ErrorSummary/index.js.map +1 -0
- package/dist/components/FieldError/FieldError.js +1 -1
- package/dist/components/FieldHeader/FieldHeader.js +6 -6
- package/dist/components/FieldLabel/FieldLabel.js +1 -1
- package/dist/components/FieldsetHeader/FieldsetHeader.js +3 -3
- package/dist/components/Heading/Heading.d.ts +25 -6
- package/dist/components/Heading/Heading.js +9 -4
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/Icon/Icon.d.ts +31 -4
- package/dist/components/Icon/Icon.js +98 -5
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/IconBackdrop/IconBackdrop.d.ts +24 -0
- package/dist/components/IconBackdrop/IconBackdrop.js +34 -0
- package/dist/components/IconBackdrop/IconBackdrop.js.map +1 -0
- package/dist/components/IconBackdrop/index.d.ts +1 -0
- package/dist/components/IconBackdrop/index.js +5 -0
- package/dist/components/IconBackdrop/index.js.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/IconButton/IconButton.js +28 -28
- package/dist/components/Image/Image.d.ts +3 -2
- package/dist/components/Image/Image.js +7 -2
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Link/Link.d.ts +3 -3
- package/dist/components/Link/Link.js +2 -2
- package/dist/components/Menu/Menu.d.ts +75 -0
- package/dist/components/Menu/Menu.js +356 -0
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.js +5 -0
- package/dist/components/Menu/index.js.map +1 -0
- package/dist/components/Paragraph/Paragraph.d.ts +9 -5
- package/dist/components/Paragraph/Paragraph.js +9 -4
- package/dist/components/Paragraph/Paragraph.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +30 -0
- package/dist/components/PasswordField/PasswordField.js +104 -0
- package/dist/components/PasswordField/PasswordField.js.map +1 -0
- package/dist/components/PasswordField/index.d.ts +1 -0
- package/dist/components/PasswordField/index.js +5 -0
- package/dist/components/PasswordField/index.js.map +1 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.d.ts +53 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.js +96 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.js.map +1 -0
- package/dist/components/PhoneNumberField/index.d.ts +3 -0
- package/dist/components/PhoneNumberField/index.js +7 -0
- package/dist/components/PhoneNumberField/index.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +48 -0
- package/dist/components/Popover/Popover.js +65 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +5 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Section/Section.d.ts +2 -1
- package/dist/components/Section/Section.js +7 -2
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SelectCard/SelectCard.d.ts +51 -0
- package/dist/components/SelectCard/SelectCard.js +85 -0
- package/dist/components/SelectCard/SelectCard.js.map +1 -0
- package/dist/components/SelectCard/index.d.ts +1 -0
- package/dist/components/SelectCard/index.js +5 -0
- package/dist/components/SelectCard/index.js.map +1 -0
- package/dist/components/SelectNative/SelectNative.d.ts +56 -0
- package/dist/components/SelectNative/SelectNative.js +40 -0
- package/dist/components/SelectNative/SelectNative.js.map +1 -0
- package/dist/components/SelectNative/index.d.ts +1 -0
- package/dist/components/SelectNative/index.js +5 -0
- package/dist/components/SelectNative/index.js.map +1 -0
- package/dist/components/Slider/Slider.d.ts +33 -0
- package/dist/components/Slider/Slider.js +113 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +5 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/SubHeading/SubHeading.d.ts +26 -5
- package/dist/components/SubHeading/SubHeading.js +9 -4
- package/dist/components/SubHeading/SubHeading.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +7 -0
- package/dist/components/Switch/Switch.js +18 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +5 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tag/Tag.js +4 -4
- package/dist/components/ToggleButton/ToggleButton.js +6 -6
- package/dist/components/ToggleIconButton/ToggleIconButton.js +6 -6
- package/dist/components/Tooltip/Tooltip.d.ts +5 -1
- package/dist/components/Tooltip/Tooltip.js +2 -1
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/_base/Field/Field.d.ts +2 -2
- package/dist/components/_base/Field/Field.js +2 -5
- package/dist/components/_base/Field/Field.js.map +1 -1
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +45 -14
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +45 -14
- package/dist/index.js.map +1 -1
- package/dist/react-number-format.es-DMLgWFZX.js +760 -0
- package/dist/react-number-format.es-DMLgWFZX.js.map +1 -0
- package/dist/utils/backgroundColor/backgroundColor.d.ts +8 -0
- package/dist/utils/backgroundColor/backgroundColor.js +102 -0
- package/dist/utils/backgroundColor/backgroundColor.js.map +1 -0
- package/dist/utils/border/border.d.ts +3 -3
- package/dist/utils/creditCard/creditCard.d.ts +7 -0
- package/dist/utils/creditCard/creditCard.js +25 -0
- package/dist/utils/creditCard/creditCard.js.map +1 -0
- package/dist/utils/flex/flex.d.ts +11 -6
- package/dist/utils/flex/flex.js +390 -46
- package/dist/utils/flex/flex.js.map +1 -1
- package/dist/utils/flex/flex.test.d.ts +1 -0
- package/dist/utils/focus/focusStyles.d.ts +1 -1
- package/dist/utils/foregroundColour/foregroundColor.d.ts +8 -0
- package/dist/utils/foregroundColour/foregroundColor.js +125 -0
- package/dist/utils/foregroundColour/foregroundColor.js.map +1 -0
- package/dist/utils/padding/padding.d.ts +7 -7
- package/dist/utils/phoneNumber/phoneNumber.d.ts +24 -0
- package/dist/utils/phoneNumber/phoneNumber.js +566 -0
- package/dist/utils/phoneNumber/phoneNumber.js.map +1 -0
- package/dist/utils/position/position.d.ts +8 -0
- package/dist/utils/position/position.js +57 -0
- package/dist/utils/position/position.js.map +1 -0
- package/dist/utils/position/position.test.d.ts +1 -0
- package/dist/utils/stories/iconPropsArgTypes.js +49 -13
- package/dist/utils/stories/iconPropsArgTypes.js.map +1 -1
- package/package.json +2 -1
- package/dist/assets/backgroundColour.css +0 -1
- package/dist/assets/fgColor.css +0 -1
- package/dist/utils/backgroundColour/backgroundColour.d.ts +0 -8
- package/dist/utils/backgroundColour/backgroundColour.js +0 -102
- package/dist/utils/backgroundColour/backgroundColour.js.map +0 -1
- package/dist/utils/fgColour/fgColor.d.ts +0 -5
- package/dist/utils/fgColour/fgColor.js +0 -84
- 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 @@
|
|
|
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
|
-
*
|
|
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/
|
|
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
|
-
|
|
7
|
-
|
|
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/
|
|
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 = "
|
|
12
|
-
const content = "
|
|
13
|
-
const isNotLoading = "
|
|
14
|
-
const loadingSpinner = "
|
|
15
|
-
const isLoading = "
|
|
16
|
-
const focusWhite = "
|
|
17
|
-
const sm = "
|
|
18
|
-
const md = "
|
|
19
|
-
const lg = "
|
|
20
|
-
const fullWidth = "
|
|
21
|
-
const textAlignLeft = "
|
|
22
|
-
const textAlignCenter = "
|
|
23
|
-
const textAlignRight = "
|
|
24
|
-
const accentPrimary = "
|
|
25
|
-
const accentSecondary = "
|
|
26
|
-
const accentTertiary = "
|
|
27
|
-
const accentQuaternary = "
|
|
28
|
-
const criticalPrimary = "
|
|
29
|
-
const criticalSecondary = "
|
|
30
|
-
const criticalTertiary = "
|
|
31
|
-
const criticalQuaternary = "
|
|
32
|
-
const neutralPrimary = "
|
|
33
|
-
const neutralSecondary = "
|
|
34
|
-
const neutralTertiary = "
|
|
35
|
-
const neutralQuaternary = "
|
|
36
|
-
const whitePrimary = "
|
|
37
|
-
const whiteSecondary = "
|
|
38
|
-
const whiteTertiary = "
|
|
39
|
-
const whiteQuaternary = "
|
|
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-
|
|
71
|
-
"icon-wrapper": "_icon-
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
import { DateFieldProps as
|
|
1
|
+
import { DateFieldProps as AriaDateFieldBaseProps, DateValue } from 'react-aria-components';
|
|
2
2
|
import { FieldProps } from '../_base/Field/Field';
|
|
3
|
-
|
|
4
|
-
export
|
|
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;
|