@alto-avios/alto-ui 3.8.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IconButton.module-4obqG6tY.js +1050 -0
- package/dist/IconButton.module-4obqG6tY.js.map +1 -0
- package/dist/assets/AutoplayControl.css +1 -0
- package/dist/assets/AviosCurrency.css +1 -1
- package/dist/assets/AviosCurrencyBadge.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Carousel.css +1 -0
- package/dist/assets/CarouselButton.css +1 -0
- package/dist/assets/CarouselDots.css +1 -0
- package/dist/assets/ComboBox.css +1 -1
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/MonthYearField.css +1 -0
- package/dist/assets/SearchField.css +1 -1
- package/dist/assets/SelectNative.css +1 -1
- package/dist/assets/SkeletonLoader.css +1 -0
- package/dist/assets/TextAreaField.css +1 -1
- package/dist/components/Accordion/Accordion.js +8 -8
- package/dist/components/AviosCurrency/AviosCurrency.d.ts +1 -2
- package/dist/components/AviosCurrency/AviosCurrency.js +40 -36
- package/dist/components/AviosCurrency/AviosCurrency.js.map +1 -1
- package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.d.ts +48 -0
- package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js +165 -0
- package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js.map +1 -0
- package/dist/components/AviosCurrencyBadge/index.d.ts +1 -0
- package/dist/components/AviosCurrencyBadge/index.js +5 -0
- package/dist/components/AviosCurrencyBadge/index.js.map +1 -0
- package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js +3 -3
- package/dist/components/Badge/Badge.d.ts +1 -16
- package/dist/components/Badge/Badge.js +3 -9
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Box/Box.d.ts +0 -4
- package/dist/components/Box/Box.js +1 -5
- package/dist/components/Box/Box.js.map +1 -1
- package/dist/components/Button/Button.d.ts +34 -64
- package/dist/components/Button/Button.js +61 -44
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/components/CalloutBanner/CalloutBanner.js +3 -3
- package/dist/components/Carousel/AutoplayControl/AutoplayControl.d.ts +27 -0
- package/dist/components/Carousel/AutoplayControl/AutoplayControl.js +115 -0
- package/dist/components/Carousel/AutoplayControl/AutoplayControl.js.map +1 -0
- package/dist/components/Carousel/Carousel.d.ts +171 -0
- package/dist/components/Carousel/Carousel.js +373 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/components/Carousel/CarouselButton/CarouselButton.d.ts +44 -0
- package/dist/components/Carousel/CarouselButton/CarouselButton.js +195 -0
- package/dist/components/Carousel/CarouselButton/CarouselButton.js.map +1 -0
- package/dist/components/Carousel/CarouselControls.d.ts +7 -0
- package/dist/components/Carousel/CarouselControls.js +305 -0
- package/dist/components/Carousel/CarouselControls.js.map +1 -0
- package/dist/components/Carousel/CarouselDots/CarouselDots.d.ts +16 -0
- package/dist/components/Carousel/CarouselDots/CarouselDots.js +150 -0
- package/dist/components/Carousel/CarouselDots/CarouselDots.js.map +1 -0
- package/dist/components/Carousel/index.d.ts +1 -0
- package/dist/components/Carousel/index.js +5 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/ComboBox/ComboBox.js +10 -13
- package/dist/components/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js +5 -5
- package/dist/components/CreditCardSecurityCodeField/CreditCardSecurityCodeField.js +5 -5
- package/dist/components/Dialog/Dialog.js +4 -4
- package/dist/components/ErrorSummary/ErrorSummary.js +4 -4
- package/dist/components/FieldError/FieldError.d.ts +5 -1
- package/dist/components/FieldError/FieldError.js +8 -1
- package/dist/components/FieldError/FieldError.js.map +1 -1
- package/dist/components/FieldHeader/FieldHeader.js +1 -1
- package/dist/components/Grid/Grid.d.ts +6 -1
- package/dist/components/Grid/Grid.js +2 -0
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -6
- package/dist/components/Heading/Heading.js +1 -6
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -6
- package/dist/components/IconButton/IconButton.d.ts +3 -15
- package/dist/components/IconButton/IconButton.js +18 -128
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Image/Image.d.ts +0 -1
- package/dist/components/Image/Image.js +8 -13
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -16
- package/dist/components/Link/Link.js +4 -11
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/ListBoxItem/index.d.ts +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.js +6 -4
- package/dist/components/LoadingSpinner/LoadingSpinner.js.map +1 -1
- package/dist/components/MonthYearField/MonthYearField.d.ts +107 -0
- package/dist/components/MonthYearField/MonthYearField.js +332 -0
- package/dist/components/MonthYearField/MonthYearField.js.map +1 -0
- package/dist/components/MonthYearField/index.d.ts +2 -0
- package/dist/components/MonthYearField/index.js +5 -0
- package/dist/components/MonthYearField/index.js.map +1 -0
- package/dist/components/Paragraph/Paragraph.d.ts +1 -6
- package/dist/components/Paragraph/Paragraph.js +1 -6
- package/dist/components/Paragraph/Paragraph.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.js +3 -3
- package/dist/components/PhoneNumberField/PhoneNumberField.js +1 -1
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/SearchField/SearchField.js +9 -7
- package/dist/components/SearchField/SearchField.js.map +1 -1
- package/dist/components/Section/Section.d.ts +42 -1
- package/dist/components/Section/Section.js +8 -13
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SelectCard/SelectCard.js +2 -2
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +50 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.js +150 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.js.map +1 -0
- package/dist/components/SkeletonLoader/index.d.ts +1 -0
- package/dist/components/SkeletonLoader/index.js +5 -0
- package/dist/components/SkeletonLoader/index.js.map +1 -0
- package/dist/components/SubHeading/SubHeading.d.ts +1 -6
- package/dist/components/SubHeading/SubHeading.js +1 -6
- package/dist/components/SubHeading/SubHeading.js.map +1 -1
- package/dist/components/TextAreaField/TextAreaField.js +1 -1
- package/dist/components/_base/Field/Field.js +4 -4
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/{react-number-format.es-BjKL6crg.js → react-number-format.es-Dbc1db6s.js} +6 -6
- package/dist/{react-number-format.es-BjKL6crg.js.map → react-number-format.es-Dbc1db6s.js.map} +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import { c as cva } from "../../index-DdUYounA.js";
|
|
4
4
|
import '../../assets/AviosCurrencySymbol.css';const styles = {
|
|
5
5
|
"aviosCurrencySymbol-primary": "_aviosCurrencySymbol-primary_152jd_1",
|
|
@@ -51,7 +51,7 @@ const AviosCurrencySymbol = ({
|
|
|
51
51
|
"aria-label": ariaLabel,
|
|
52
52
|
...props
|
|
53
53
|
}) => {
|
|
54
|
-
const dimensions =
|
|
54
|
+
const dimensions = React__default.useMemo(() => {
|
|
55
55
|
if (width && height) {
|
|
56
56
|
return {
|
|
57
57
|
width,
|
|
@@ -73,7 +73,7 @@ const AviosCurrencySymbol = ({
|
|
|
73
73
|
return DEFAULT_DIMENSIONS;
|
|
74
74
|
}, [width, height]);
|
|
75
75
|
const screenReaderLabel = label || ariaLabel || `Avios ${kind} currency symbol`;
|
|
76
|
-
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0
|
|
76
|
+
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0.82 0.52 14.00 14.02", className: aviosCurrencySymbol({
|
|
77
77
|
styleVariant
|
|
78
78
|
}), ...dimensions, ...props, "aria-label": screenReaderLabel, children: [
|
|
79
79
|
/* @__PURE__ */ jsx("path", { fill: "#0032A0", d: "M14.512 5.968C14.025 5.127 9.659.865 4.364.526c-.923-.06-1.797.448-2.18 1.262-1.01 2.17-2.246 7.022-.459 11.442a2.06 2.06 0 0 0 1.94 1.312c.098 0 .191-.005.29-.016 6.043-.744 9.923-4.946 10.579-6.306.246-.514.508-1.3-.033-2.24z" }),
|
|
@@ -17,21 +17,6 @@ export interface BadgeProps {
|
|
|
17
17
|
* The style variant of the tag
|
|
18
18
|
*/
|
|
19
19
|
styleVariant?: 'neutral' | 'critical' | 'warning' | 'caution' | 'success' | 'info' | 'brand' | 'sale' | 'white';
|
|
20
|
-
/**
|
|
21
|
-
* The style variant of the tag
|
|
22
|
-
* @deprecated Use styleVariant instead
|
|
23
|
-
*/
|
|
24
|
-
variant?: 'neutral' | 'critical' | 'warning' | 'caution' | 'success' | 'info' | 'brand' | 'sale' | 'white';
|
|
25
|
-
/**
|
|
26
|
-
* Whether the tag has a leading icon and what icon to use
|
|
27
|
-
* @deprecated Use iconStartProps instead
|
|
28
|
-
*/
|
|
29
|
-
leadingIconProps?: IconProps;
|
|
30
|
-
/**
|
|
31
|
-
* Whether the tag has a trailing icon and what icon to use
|
|
32
|
-
* @deprecated Use iconEndProps instead
|
|
33
|
-
*/
|
|
34
|
-
trailingIconProps?: IconProps;
|
|
35
20
|
/**
|
|
36
21
|
* Whether an icon should display at the start of the Button and icon properties
|
|
37
22
|
*/
|
|
@@ -50,5 +35,5 @@ export interface BadgeProps {
|
|
|
50
35
|
*/
|
|
51
36
|
className?: string;
|
|
52
37
|
}
|
|
53
|
-
export declare const Badge: ({ children, size,
|
|
38
|
+
export declare const Badge: ({ children, size, styleVariant, ariaLabel, iconStartProps, iconEndProps, focusStyle, className, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
39
|
export default Badge;
|
|
@@ -54,29 +54,23 @@ const badge = cva(styles.badge, {
|
|
|
54
54
|
const Badge = ({
|
|
55
55
|
children,
|
|
56
56
|
size = "md",
|
|
57
|
-
variant,
|
|
58
57
|
styleVariant,
|
|
59
58
|
ariaLabel,
|
|
60
|
-
leadingIconProps,
|
|
61
|
-
trailingIconProps,
|
|
62
59
|
iconStartProps,
|
|
63
60
|
iconEndProps,
|
|
64
61
|
focusStyle = "default",
|
|
65
62
|
className,
|
|
66
63
|
...props
|
|
67
64
|
}) => {
|
|
68
|
-
const resolvedIconStartProps = iconStartProps ?? leadingIconProps;
|
|
69
|
-
const resolvedIconEndProps = iconEndProps ?? trailingIconProps;
|
|
70
|
-
const resolvedStyleVariant = styleVariant ?? variant;
|
|
71
65
|
return /* @__PURE__ */ jsxs("span", { className: `${badge({
|
|
72
66
|
size,
|
|
73
|
-
styleVariant
|
|
67
|
+
styleVariant
|
|
74
68
|
})} ${focusStyleVariants({
|
|
75
69
|
focusStyle
|
|
76
70
|
})} ${className || ""}`, role: "status", "aria-label": ariaLabel, ...props, children: [
|
|
77
|
-
|
|
71
|
+
iconStartProps && /* @__PURE__ */ jsx(Icon, { ...iconStartProps }),
|
|
78
72
|
children,
|
|
79
|
-
|
|
73
|
+
iconEndProps && /* @__PURE__ */ jsx(Icon, { ...iconEndProps })
|
|
80
74
|
] });
|
|
81
75
|
};
|
|
82
76
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -64,10 +64,6 @@ export interface BoxProps extends BackgroundVariants, FlexVariants, BorderVarian
|
|
|
64
64
|
* Accepts any valid CSS position value.
|
|
65
65
|
*/
|
|
66
66
|
left?: string;
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated Use `backgroundColor` instead.
|
|
69
|
-
*/
|
|
70
|
-
backgroundColour?: BackgroundVariants['backgroundColor'];
|
|
71
67
|
}
|
|
72
68
|
export declare const Box: ({ children, as: Component, width, maxWidth, minWidth, height, maxHeight, minHeight, zIndex, top, right, bottom, left, position, ...props }: BoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
73
69
|
export default Box;
|
|
@@ -21,10 +21,6 @@ const Box = ({
|
|
|
21
21
|
position,
|
|
22
22
|
...props
|
|
23
23
|
}) => {
|
|
24
|
-
if ((props == null ? void 0 : props.backgroundColour) && !(props == null ? void 0 : props.backgroundColor)) {
|
|
25
|
-
console.warn("Warning: `backgroundColour` is deprecated and will be removed in a future release. Please use `backgroundColor` instead.");
|
|
26
|
-
}
|
|
27
|
-
const resolvedBackgroundColor = props.backgroundColor ?? props.backgroundColour;
|
|
28
24
|
const borderWidth = !(props == null ? void 0 : props.borderWidth) && props.borderColour !== "none" ? "sm" : props.borderWidth;
|
|
29
25
|
const stylesProp = {
|
|
30
26
|
width: width === "full" ? "100%" : width,
|
|
@@ -47,7 +43,7 @@ const Box = ({
|
|
|
47
43
|
})} ${paddingVariants({
|
|
48
44
|
...props
|
|
49
45
|
})} ${backgroundColorVariants({
|
|
50
|
-
backgroundColor:
|
|
46
|
+
backgroundColor: props.backgroundColor,
|
|
51
47
|
...props
|
|
52
48
|
})} ${positionVariants({
|
|
53
49
|
position
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentType, ElementType, ReactNode } from 'react';
|
|
2
2
|
import { AriaButtonOptions } from '@react-aria/button';
|
|
3
3
|
import { HoverProps } from '@react-aria/interactions';
|
|
4
4
|
import { IconProps } from '../Icon/Icon';
|
|
@@ -8,15 +8,16 @@ export type DefaultButtonProps = ButtonProps<'button'>;
|
|
|
8
8
|
export type ButtonProps<T extends ElementType = 'button'> = AriaButtonOptions<T> & HoverProps & {
|
|
9
9
|
/**
|
|
10
10
|
* The HTML element to be rendered as the button.
|
|
11
|
+
* @default 'button'
|
|
12
|
+
* @example 'a' | 'button' | 'div'
|
|
11
13
|
*/
|
|
12
14
|
as?: T;
|
|
13
|
-
elementType?: 'a' | 'button';
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @default '
|
|
17
|
-
* @
|
|
16
|
+
* For NextJS support. If `as` is used for next/link, this prop should be set to 'a' or the desired element for prop typing.
|
|
17
|
+
* @default 'button'
|
|
18
|
+
* @example 'a' | 'button'
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
elementType?: 'a' | 'button';
|
|
20
21
|
/**
|
|
21
22
|
* What the base style of button is
|
|
22
23
|
* @default 'accent'
|
|
@@ -41,26 +42,6 @@ export type ButtonProps<T extends ElementType = 'button'> = AriaButtonOptions<T>
|
|
|
41
42
|
* Whether an icon should display at the start of the Button and icon properties
|
|
42
43
|
*/
|
|
43
44
|
iconStartProps?: IconProps;
|
|
44
|
-
/**
|
|
45
|
-
* Whether the button leading has an icon
|
|
46
|
-
* @deprecated use iconStartProps instead
|
|
47
|
-
*/
|
|
48
|
-
hasLeadingIcon?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Leading icon name
|
|
51
|
-
* @deprecated use iconStartProps instead
|
|
52
|
-
*/
|
|
53
|
-
leadingIconName?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the button trailing has an icon
|
|
56
|
-
* @deprecated use iconEndProps instead
|
|
57
|
-
*/
|
|
58
|
-
hasTrailingIcon?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Trailing icon name
|
|
61
|
-
* @deprecated use iconEndProps instead
|
|
62
|
-
*/
|
|
63
|
-
trailingIconName?: string;
|
|
64
45
|
/**
|
|
65
46
|
* isLoading is a boolean that will show a spinner in the button
|
|
66
47
|
*/
|
|
@@ -81,11 +62,6 @@ export type ButtonProps<T extends ElementType = 'button'> = AriaButtonOptions<T>
|
|
|
81
62
|
* Whether the button should be full width.
|
|
82
63
|
*/
|
|
83
64
|
fullWidth?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* @deprecated onPress should be preferred
|
|
86
|
-
* Handler to be called when the button is clicked.
|
|
87
|
-
*/
|
|
88
|
-
onClick?: React.MouseEventHandler;
|
|
89
65
|
/**
|
|
90
66
|
* The target of the link (if `as` is set to 'a').
|
|
91
67
|
*/
|
|
@@ -94,23 +70,33 @@ export type ButtonProps<T extends ElementType = 'button'> = AriaButtonOptions<T>
|
|
|
94
70
|
* What type of focus style to apply to the button.
|
|
95
71
|
*/
|
|
96
72
|
focusStyle?: 'default' | 'white';
|
|
73
|
+
/**
|
|
74
|
+
* The slot of the button
|
|
75
|
+
*/
|
|
76
|
+
slot?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Set to true to style button as an icon button
|
|
79
|
+
* @ignore
|
|
80
|
+
*/
|
|
81
|
+
iconButton?: boolean;
|
|
97
82
|
/**
|
|
98
83
|
* Passthrough props for the button element.
|
|
99
84
|
*/
|
|
100
85
|
passthroughProps?: Partial<T extends ComponentType<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : never>;
|
|
101
86
|
};
|
|
102
|
-
export declare const Button:
|
|
87
|
+
export declare const Button: import('react').ForwardRefExoticComponent<AriaButtonOptions<ElementType> & HoverProps & {
|
|
103
88
|
/**
|
|
104
89
|
* The HTML element to be rendered as the button.
|
|
90
|
+
* @default 'button'
|
|
91
|
+
* @example 'a' | 'button' | 'div'
|
|
105
92
|
*/
|
|
106
|
-
as?:
|
|
107
|
-
elementType?: "a" | "button";
|
|
93
|
+
as?: ElementType | undefined;
|
|
108
94
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @default '
|
|
111
|
-
* @
|
|
95
|
+
* For NextJS support. If `as` is used for next/link, this prop should be set to 'a' or the desired element for prop typing.
|
|
96
|
+
* @default 'button'
|
|
97
|
+
* @example 'a' | 'button'
|
|
112
98
|
*/
|
|
113
|
-
|
|
99
|
+
elementType?: "a" | "button";
|
|
114
100
|
/**
|
|
115
101
|
* What the base style of button is
|
|
116
102
|
* @default 'accent'
|
|
@@ -135,26 +121,6 @@ export declare const Button: React.ForwardRefExoticComponent<AriaButtonOptions<R
|
|
|
135
121
|
* Whether an icon should display at the start of the Button and icon properties
|
|
136
122
|
*/
|
|
137
123
|
iconStartProps?: IconProps;
|
|
138
|
-
/**
|
|
139
|
-
* Whether the button leading has an icon
|
|
140
|
-
* @deprecated use iconStartProps instead
|
|
141
|
-
*/
|
|
142
|
-
hasLeadingIcon?: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Leading icon name
|
|
145
|
-
* @deprecated use iconStartProps instead
|
|
146
|
-
*/
|
|
147
|
-
leadingIconName?: string;
|
|
148
|
-
/**
|
|
149
|
-
* Whether the button trailing has an icon
|
|
150
|
-
* @deprecated use iconEndProps instead
|
|
151
|
-
*/
|
|
152
|
-
hasTrailingIcon?: boolean;
|
|
153
|
-
/**
|
|
154
|
-
* Trailing icon name
|
|
155
|
-
* @deprecated use iconEndProps instead
|
|
156
|
-
*/
|
|
157
|
-
trailingIconName?: string;
|
|
158
124
|
/**
|
|
159
125
|
* isLoading is a boolean that will show a spinner in the button
|
|
160
126
|
*/
|
|
@@ -175,11 +141,6 @@ export declare const Button: React.ForwardRefExoticComponent<AriaButtonOptions<R
|
|
|
175
141
|
* Whether the button should be full width.
|
|
176
142
|
*/
|
|
177
143
|
fullWidth?: boolean;
|
|
178
|
-
/**
|
|
179
|
-
* @deprecated onPress should be preferred
|
|
180
|
-
* Handler to be called when the button is clicked.
|
|
181
|
-
*/
|
|
182
|
-
onClick?: React.MouseEventHandler;
|
|
183
144
|
/**
|
|
184
145
|
* The target of the link (if `as` is set to 'a').
|
|
185
146
|
*/
|
|
@@ -188,9 +149,18 @@ export declare const Button: React.ForwardRefExoticComponent<AriaButtonOptions<R
|
|
|
188
149
|
* What type of focus style to apply to the button.
|
|
189
150
|
*/
|
|
190
151
|
focusStyle?: "default" | "white";
|
|
152
|
+
/**
|
|
153
|
+
* The slot of the button
|
|
154
|
+
*/
|
|
155
|
+
slot?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Set to true to style button as an icon button
|
|
158
|
+
* @ignore
|
|
159
|
+
*/
|
|
160
|
+
iconButton?: boolean;
|
|
191
161
|
/**
|
|
192
162
|
* Passthrough props for the button element.
|
|
193
163
|
*/
|
|
194
164
|
passthroughProps?: Partial<any> | undefined;
|
|
195
|
-
} &
|
|
165
|
+
} & import('react').RefAttributes<any>>;
|
|
196
166
|
export default Button;
|
|
@@ -8,35 +8,39 @@ 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
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
11
|
+
import '../../assets/Button.css';const button$1 = "_button_1u9p3_1";
|
|
12
|
+
const content = "_content_1u9p3_19";
|
|
13
|
+
const isNotLoading = "_isNotLoading_1u9p3_28";
|
|
14
|
+
const loadingSpinner = "_loadingSpinner_1u9p3_28";
|
|
15
|
+
const isLoading = "_isLoading_1u9p3_37";
|
|
16
|
+
const focusWhite = "_focusWhite_1u9p3_53";
|
|
17
|
+
const sm = "_sm_1u9p3_60";
|
|
18
|
+
const md = "_md_1u9p3_69";
|
|
19
|
+
const lg = "_lg_1u9p3_78";
|
|
20
|
+
const iconButton = "_iconButton_1u9p3_87";
|
|
21
|
+
const iconButton__sm = "_iconButton__sm_1u9p3_91";
|
|
22
|
+
const iconButton__md = "_iconButton__md_1u9p3_95";
|
|
23
|
+
const iconButton__lg = "_iconButton__lg_1u9p3_99";
|
|
24
|
+
const fullWidth = "_fullWidth_1u9p3_103";
|
|
25
|
+
const textAlignLeft = "_textAlignLeft_1u9p3_110";
|
|
26
|
+
const textAlignCenter = "_textAlignCenter_1u9p3_114";
|
|
27
|
+
const textAlignRight = "_textAlignRight_1u9p3_118";
|
|
28
|
+
const accentPrimary = "_accentPrimary_1u9p3_126";
|
|
29
|
+
const accentSecondary = "_accentSecondary_1u9p3_150";
|
|
30
|
+
const accentTertiary = "_accentTertiary_1u9p3_184";
|
|
31
|
+
const accentQuaternary = "_accentQuaternary_1u9p3_214";
|
|
32
|
+
const criticalPrimary = "_criticalPrimary_1u9p3_244";
|
|
33
|
+
const criticalSecondary = "_criticalSecondary_1u9p3_269";
|
|
34
|
+
const criticalTertiary = "_criticalTertiary_1u9p3_303";
|
|
35
|
+
const criticalQuaternary = "_criticalQuaternary_1u9p3_333";
|
|
36
|
+
const neutralPrimary = "_neutralPrimary_1u9p3_364";
|
|
37
|
+
const neutralSecondary = "_neutralSecondary_1u9p3_389";
|
|
38
|
+
const neutralTertiary = "_neutralTertiary_1u9p3_422";
|
|
39
|
+
const neutralQuaternary = "_neutralQuaternary_1u9p3_452";
|
|
40
|
+
const whitePrimary = "_whitePrimary_1u9p3_483";
|
|
41
|
+
const whiteSecondary = "_whiteSecondary_1u9p3_513";
|
|
42
|
+
const whiteTertiary = "_whiteTertiary_1u9p3_546";
|
|
43
|
+
const whiteQuaternary = "_whiteQuaternary_1u9p3_576";
|
|
40
44
|
const styles = {
|
|
41
45
|
button: button$1,
|
|
42
46
|
content,
|
|
@@ -47,6 +51,10 @@ const styles = {
|
|
|
47
51
|
sm,
|
|
48
52
|
md,
|
|
49
53
|
lg,
|
|
54
|
+
iconButton,
|
|
55
|
+
iconButton__sm,
|
|
56
|
+
iconButton__md,
|
|
57
|
+
iconButton__lg,
|
|
50
58
|
fullWidth,
|
|
51
59
|
textAlignLeft,
|
|
52
60
|
textAlignCenter,
|
|
@@ -114,12 +122,27 @@ const button = cva(styles.button, {
|
|
|
114
122
|
left: styles.textAlignLeft,
|
|
115
123
|
center: styles.textAlignCenter,
|
|
116
124
|
right: styles.textAlignRight
|
|
125
|
+
},
|
|
126
|
+
iconButton: {
|
|
127
|
+
true: styles.iconButton
|
|
117
128
|
}
|
|
118
129
|
},
|
|
119
130
|
compoundVariants: [{
|
|
120
131
|
size: "md",
|
|
121
132
|
accent: "primary",
|
|
122
133
|
className: styles.accentPrimary
|
|
134
|
+
}, {
|
|
135
|
+
size: "sm",
|
|
136
|
+
iconButton: true,
|
|
137
|
+
className: styles.iconButton__sm
|
|
138
|
+
}, {
|
|
139
|
+
size: "md",
|
|
140
|
+
iconButton: true,
|
|
141
|
+
className: styles.iconButton__md
|
|
142
|
+
}, {
|
|
143
|
+
size: "lg",
|
|
144
|
+
iconButton: true,
|
|
145
|
+
className: styles.iconButton__lg
|
|
123
146
|
}],
|
|
124
147
|
defaultVariants: {
|
|
125
148
|
size: "md"
|
|
@@ -128,20 +151,19 @@ const button = cva(styles.button, {
|
|
|
128
151
|
const Button = forwardRef(function Button2({
|
|
129
152
|
as,
|
|
130
153
|
elementType,
|
|
131
|
-
styleType,
|
|
132
154
|
styleVariant,
|
|
133
155
|
emphasis = "primary",
|
|
134
156
|
size = "md",
|
|
135
157
|
iconStartProps,
|
|
136
158
|
iconEndProps,
|
|
137
|
-
leadingIconName,
|
|
138
|
-
trailingIconName,
|
|
139
159
|
children,
|
|
140
160
|
fullWidth: fullWidth2,
|
|
141
161
|
textAlign = "center",
|
|
142
162
|
focusStyle = "default",
|
|
143
163
|
passthroughProps,
|
|
144
164
|
isLoading: isLoading2 = false,
|
|
165
|
+
iconButton: iconButton2,
|
|
166
|
+
slot,
|
|
145
167
|
...props
|
|
146
168
|
}, forwardedRef) {
|
|
147
169
|
const ref = useObjectRef(forwardedRef);
|
|
@@ -171,30 +193,25 @@ const Button = forwardRef(function Button2({
|
|
|
171
193
|
}
|
|
172
194
|
return label;
|
|
173
195
|
};
|
|
174
|
-
const resolvedStyleVariant = styleVariant ??
|
|
196
|
+
const resolvedStyleVariant = styleVariant ?? "accent";
|
|
175
197
|
const className = button({
|
|
176
198
|
size,
|
|
177
199
|
fullWidth: fullWidth2,
|
|
178
200
|
focusStyle,
|
|
179
201
|
isLoading: isLoading2,
|
|
180
202
|
textAlign,
|
|
203
|
+
iconButton: iconButton2,
|
|
181
204
|
[resolvedStyleVariant]: emphasis
|
|
182
205
|
});
|
|
183
|
-
const Component =
|
|
184
|
-
const resolvedIconStartProps = leadingIconName ? {
|
|
185
|
-
iconName: leadingIconName
|
|
186
|
-
} : iconStartProps;
|
|
187
|
-
const resolvedIconEndProps = trailingIconName ? {
|
|
188
|
-
iconName: trailingIconName
|
|
189
|
-
} : iconEndProps;
|
|
206
|
+
const Component = as ?? "button";
|
|
190
207
|
return /* @__PURE__ */ jsx(Component, { className: `${className} ${focusStyleVariants({
|
|
191
208
|
focusStyle
|
|
192
|
-
})}`, ref, "data-focused": isFocused ? true : void 0, "data-focus-visible": isFocusVisible ? true : void 0, "data-hovered": isHovered ? true : void 0, "data-pressed": isPressed ? true : void 0, "aria-label": getAriaLabel(), "aria-disabled": props.isDisabled ? true : void 0, ...mergeProps(buttonProps, hoverProps, focusProps), ...passthroughProps, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
193
|
-
isLoading2 && /* @__PURE__ */ jsx(LoadingSpinner, { className: styles.loadingSpinner, size: size === "lg" ? "
|
|
209
|
+
})}`, ref, "data-focused": isFocused ? true : void 0, "data-focus-visible": isFocusVisible ? true : void 0, "data-hovered": isHovered ? true : void 0, "data-pressed": isPressed ? true : void 0, "aria-label": getAriaLabel(), "aria-disabled": props.isDisabled ? true : void 0, slot, ...mergeProps(buttonProps, hoverProps, focusProps), ...passthroughProps, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
210
|
+
isLoading2 && /* @__PURE__ */ jsx(LoadingSpinner, { className: styles.loadingSpinner, size: size === "lg" ? "1.25x" : "1x", "aria-hidden": "true" }),
|
|
194
211
|
/* @__PURE__ */ jsxs("span", { className: styles.content, children: [
|
|
195
|
-
|
|
212
|
+
iconStartProps && /* @__PURE__ */ jsx(Icon, { ...iconStartProps, "aria-hidden": "true" }),
|
|
196
213
|
children,
|
|
197
|
-
|
|
214
|
+
iconEndProps && /* @__PURE__ */ jsx(Icon, { ...iconEndProps, "aria-hidden": "true" })
|
|
198
215
|
] })
|
|
199
216
|
] }) });
|
|
200
217
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import { c as cva } from "../../index-DdUYounA.js";
|
|
4
4
|
import '../../assets/ButtonGroup.css';const buttonGroup = "_buttonGroup_zcnod_2";
|
|
5
5
|
const alignStart = "_alignStart_zcnod_10";
|
|
@@ -41,7 +41,7 @@ const ButtonGroup = ({
|
|
|
41
41
|
}) => {
|
|
42
42
|
return /* @__PURE__ */ jsx("div", { className: `${buttonGroupStyles({
|
|
43
43
|
align
|
|
44
|
-
})}`, role: "group", "aria-label": "Button Group", children:
|
|
44
|
+
})}`, role: "group", "aria-label": "Button Group", children: React__default.Children.map(children, (child) => child) });
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
47
|
ButtonGroup,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import { Icon } from "../Icon/Icon.js";
|
|
4
4
|
import { c as cva } from "../../index-DdUYounA.js";
|
|
5
5
|
import { IconButton } from "../IconButton/IconButton.js";
|
|
@@ -64,7 +64,7 @@ const CalloutBanner = ({
|
|
|
64
64
|
hideIllustration = false,
|
|
65
65
|
alignButtons = "left"
|
|
66
66
|
}) => {
|
|
67
|
-
const iconName =
|
|
67
|
+
const iconName = React__default.useMemo(() => {
|
|
68
68
|
switch (styleVariant) {
|
|
69
69
|
case "critical":
|
|
70
70
|
return "circle-exclamation";
|
|
@@ -86,7 +86,7 @@ const CalloutBanner = ({
|
|
|
86
86
|
/* @__PURE__ */ jsxs("div", { className: styles["calloutBanner__start"], children: [
|
|
87
87
|
!hideIllustration && (customAsset ? /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__custom-asset"], children: customAsset }) : /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__default-asset"], children: /* @__PURE__ */ jsx(Icon, { iconName, iconPrefix: "fas", className: styles["calloutBanner__icon"], iconSize: "1.25x", padding: "roomy" }) })),
|
|
88
88
|
/* @__PURE__ */ jsxs("div", { className: styles["calloutBanner__meta"], children: [
|
|
89
|
-
hasOnDismiss && /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__dismiss"], children: /* @__PURE__ */ jsx(IconButton, {
|
|
89
|
+
hasOnDismiss && /* @__PURE__ */ jsx("div", { className: styles["calloutBanner__dismiss"], children: /* @__PURE__ */ jsx(IconButton, { onPress: onDismiss, styleVariant: emphasis === "primary" ? "white" : "neutral", emphasis: "quaternary", size: "sm", iconProps: {
|
|
90
90
|
iconName: "close",
|
|
91
91
|
iconPrefix: "far",
|
|
92
92
|
iconSize: "1x"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface AutoplayControlProps {
|
|
2
|
+
/**
|
|
3
|
+
* Focus style
|
|
4
|
+
* @default 'default'
|
|
5
|
+
*/
|
|
6
|
+
focusStyle?: 'default' | 'white';
|
|
7
|
+
/**
|
|
8
|
+
* Style variant of the button
|
|
9
|
+
* @default 'neutralVibrant'
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'neutralVibrant' | 'neutralSubtle' | 'whiteVibrant' | 'whiteSubtle';
|
|
12
|
+
/**
|
|
13
|
+
* Size of the button
|
|
14
|
+
* @default 'md'
|
|
15
|
+
*/
|
|
16
|
+
size?: 'sm' | 'md';
|
|
17
|
+
/**
|
|
18
|
+
* Additional CSS class name for the container
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Additional CSS class name for the button
|
|
23
|
+
*/
|
|
24
|
+
buttonClassName?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const AutoplayControl: ({ variant, size, focusStyle, className, buttonClassName, }: AutoplayControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default AutoplayControl;
|