react-magma-dom 4.10.0-next.16 → 4.10.0-next.18
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/components/AIButton/StyledAIButton.d.ts +13 -0
- package/dist/components/AIButton/StyledAIButtonTemplate.d.ts +15 -0
- package/dist/components/AIButton/index.d.ts +124 -0
- package/dist/components/AIButton/styles.d.ts +14 -0
- package/dist/components/Popover/Popover.d.ts +12 -1
- package/dist/esm/index.js +1675 -1276
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/properties.json +947 -110
- package/dist/react-magma-dom.cjs.development.js +1554 -1166
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/dist/theme/ThemeContext.d.ts +14 -0
- package/dist/theme/magma.d.ts +28 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AIButtonSize, BaseAIButtonProps } from '.';
|
|
3
|
+
export interface StyledAIButtonProps extends BaseAIButtonProps {
|
|
4
|
+
iconOnly?: boolean;
|
|
5
|
+
trailingIcon?: React.ReactElement;
|
|
6
|
+
leadingIcon?: boolean | React.ReactElement;
|
|
7
|
+
}
|
|
8
|
+
export declare function getIconSize(size: any, theme: any): any;
|
|
9
|
+
export interface SpanProps {
|
|
10
|
+
hasIconLeading?: boolean;
|
|
11
|
+
size?: AIButtonSize;
|
|
12
|
+
}
|
|
13
|
+
export declare const StyledAIButton: React.ForwardRefExoticComponent<StyledAIButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledAIButtonProps } from './StyledAIButton';
|
|
3
|
+
export declare const buttonStyles: (props: any) => import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const BaseStyledAIButton: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
as?: React.ElementType<any>;
|
|
7
|
+
}, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
8
|
+
export declare const ChildrenWrapper: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme;
|
|
10
|
+
as?: React.ElementType<any>;
|
|
11
|
+
} & {
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
testId?: string;
|
|
14
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
15
|
+
export declare const StyledAIButtonTemplate: React.ForwardRefExoticComponent<StyledAIButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconProps } from 'react-magma-icons';
|
|
3
|
+
import { ThemeInterface } from '../../theme/magma';
|
|
4
|
+
import { XOR } from '../../utils';
|
|
5
|
+
export declare enum AIButtonVariant {
|
|
6
|
+
variantA = "variantA",
|
|
7
|
+
variantB = "variantB"
|
|
8
|
+
}
|
|
9
|
+
export declare enum AIButtonShape {
|
|
10
|
+
fill = "fill",
|
|
11
|
+
leftCap = "leftCap",
|
|
12
|
+
rightCap = "rightCap",
|
|
13
|
+
round = "round"
|
|
14
|
+
}
|
|
15
|
+
export declare enum AIButtonSize {
|
|
16
|
+
large = "large",
|
|
17
|
+
medium = "medium",
|
|
18
|
+
small = "small"
|
|
19
|
+
}
|
|
20
|
+
export declare enum AIButtonTextTransform {
|
|
21
|
+
uppercase = "uppercase",
|
|
22
|
+
none = "none"
|
|
23
|
+
}
|
|
24
|
+
export declare enum AIButtonType {
|
|
25
|
+
button = "button",
|
|
26
|
+
submit = "submit",
|
|
27
|
+
reset = "reset"
|
|
28
|
+
}
|
|
29
|
+
export interface BaseAIButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
+
/**
|
|
31
|
+
* Set the button to display full-width.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
isFullWidth?: boolean;
|
|
35
|
+
isInverse?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Defines the border radius
|
|
38
|
+
* @default AIButtonShape.fill
|
|
39
|
+
*/
|
|
40
|
+
shape?: AIButtonShape;
|
|
41
|
+
/**
|
|
42
|
+
* Set the button to a loading state
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
isLoading?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The relative size of the button
|
|
48
|
+
* @default AIButtonSize.medium
|
|
49
|
+
*/
|
|
50
|
+
size?: AIButtonSize;
|
|
51
|
+
/**
|
|
52
|
+
* Determines whether the button appears in all-caps
|
|
53
|
+
* @default AIButtonTextTransform.uppercase
|
|
54
|
+
*/
|
|
55
|
+
textTransform?: AIButtonTextTransform;
|
|
56
|
+
/**
|
|
57
|
+
* The variant of the button
|
|
58
|
+
* @default AIButtonVariant.variantA
|
|
59
|
+
*/
|
|
60
|
+
variant?: AIButtonVariant;
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
testId?: string;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
theme?: ThemeInterface;
|
|
69
|
+
/**
|
|
70
|
+
* The type attribute of the button
|
|
71
|
+
* @default AIButtonType.button
|
|
72
|
+
*/
|
|
73
|
+
type?: AIButtonType;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the color for the left side of the button gradient.
|
|
76
|
+
*/
|
|
77
|
+
leftColor?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the color for the right side of the button gradient.
|
|
80
|
+
*/
|
|
81
|
+
rightColor?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Sets the color when the button is hovered.
|
|
84
|
+
*/
|
|
85
|
+
hoverColor?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the color when the button is pressed (active).
|
|
88
|
+
*/
|
|
89
|
+
pressedColor?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Enables gradient animation for the button background.
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
isAnimated?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface TextAIButtonProps extends BaseAIButtonProps {
|
|
97
|
+
/**
|
|
98
|
+
* The content of the component
|
|
99
|
+
*/
|
|
100
|
+
children: React.ReactChild | React.ReactChild[];
|
|
101
|
+
/**
|
|
102
|
+
* Icon to display on the right side within the component
|
|
103
|
+
*/
|
|
104
|
+
trailingIcon?: React.ReactElement<IconProps>;
|
|
105
|
+
/**
|
|
106
|
+
* Leading icon to display on the left side within the component
|
|
107
|
+
*/
|
|
108
|
+
leadingIcon?: boolean | React.ReactElement<IconProps>;
|
|
109
|
+
}
|
|
110
|
+
export interface IconOnlyAIButtonProps extends BaseAIButtonProps {
|
|
111
|
+
/**
|
|
112
|
+
* Icon to display on the right side within the component
|
|
113
|
+
*/
|
|
114
|
+
leadingIcon?: true | React.ReactElement<IconProps>;
|
|
115
|
+
/**
|
|
116
|
+
* The text the screen reader will announce. Required for icon-only buttons
|
|
117
|
+
*/
|
|
118
|
+
'aria-label': string;
|
|
119
|
+
children?: never;
|
|
120
|
+
}
|
|
121
|
+
export declare type AIButtonProps = XOR<TextAIButtonProps, IconOnlyAIButtonProps>;
|
|
122
|
+
export declare const AIButton: React.ForwardRefExoticComponent<({
|
|
123
|
+
trailingIcon?: never;
|
|
124
|
+
} & IconOnlyAIButtonProps & React.RefAttributes<HTMLButtonElement>) | ({} & TextAIButtonProps & React.RefAttributes<HTMLButtonElement>)>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function buildPropsWithDefaultAIButtonStyles(props: any): any;
|
|
2
|
+
export declare function buildAIButtonBorderRadius(props: any): any;
|
|
3
|
+
export declare function buildAIButtonFontSize(props: any): any;
|
|
4
|
+
export declare function buildAIButtonLineHeight(props: any): any;
|
|
5
|
+
export declare function buildAIButtonSize(props: any): any;
|
|
6
|
+
export declare function buildAIButtonPadding(props: any): string;
|
|
7
|
+
export declare function buildAIButtonBackground(initialProps: any): any;
|
|
8
|
+
export declare function buildAIBorderColor(initialProps: any): any;
|
|
9
|
+
export declare function buildAIColor(initialProps: any): any;
|
|
10
|
+
export declare function buildAIFocusBackground(initialProps: any): string;
|
|
11
|
+
export declare function buildAIFocusColor(initialProps: any): any;
|
|
12
|
+
export declare function buildAIActiveBackground(initialProps: any): string;
|
|
13
|
+
export declare function buildAIActiveColor(initialProps: any): any;
|
|
14
|
+
export declare function buildBoxShadow(props: any): string;
|
|
@@ -4,6 +4,12 @@ export declare enum PopoverPosition {
|
|
|
4
4
|
bottom = "bottom",
|
|
5
5
|
top = "top"
|
|
6
6
|
}
|
|
7
|
+
export declare enum PopoverAlignment {
|
|
8
|
+
center = "center",
|
|
9
|
+
start = "start",
|
|
10
|
+
end = "end"
|
|
11
|
+
}
|
|
12
|
+
export declare type PopoverPlacement = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';
|
|
7
13
|
export interface PopoverApi {
|
|
8
14
|
closePopoverManually(event: any): void;
|
|
9
15
|
openPopoverManually(event: any): void;
|
|
@@ -74,10 +80,15 @@ export interface PopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
74
80
|
* @default false
|
|
75
81
|
*/
|
|
76
82
|
focusTrap?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Alignment of the popover content
|
|
85
|
+
* @default PopoverAlignment.center
|
|
86
|
+
*/
|
|
87
|
+
alignment?: PopoverAlignment;
|
|
77
88
|
}
|
|
78
89
|
export interface PopoverContextInterface {
|
|
79
90
|
floatingStyles?: React.CSSProperties;
|
|
80
|
-
position?:
|
|
91
|
+
position?: PopoverPlacement;
|
|
81
92
|
closePopover?: (event: React.SyntheticEvent | React.KeyboardEvent) => void;
|
|
82
93
|
popoverTriggerId?: React.MutableRefObject<string>;
|
|
83
94
|
popoverContentId?: React.MutableRefObject<string>;
|