@devopness/ui-react 2.153.1 → 2.154.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/src/components/Buttons/Button/Button.d.ts +24 -30
- package/dist/src/components/Buttons/Button/Button.styled.d.ts +4 -22
- package/dist/src/components/Primitives/Dropdown/Dropdown.d.ts +47 -40
- package/dist/src/components/Primitives/Dropdown/Dropdown.styled.d.ts +14 -14
- package/dist/ui-react.cjs +114 -121
- package/dist/ui-react.js +1304 -1294
- package/package.json +3 -3
|
@@ -2,20 +2,10 @@ import { ButtonHTMLAttributes } from 'react';
|
|
|
2
2
|
import { getColor } from '../../../colors';
|
|
3
3
|
import { Icon } from '../../../icons';
|
|
4
4
|
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
typeSize?: 'default' | 'medium' | 'auto';
|
|
10
|
-
/** Icon name */
|
|
11
|
-
icon?: Icon;
|
|
12
|
-
/** Enable button loading animation */
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* With the property "revertOrientation" it is possible to change the positioning of
|
|
16
|
-
* the elements inside the button as "icon" or "loading"
|
|
17
|
-
*/
|
|
18
|
-
revertOrientation?: boolean;
|
|
5
|
+
/** Customize background color */
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
/** Customize border color */
|
|
8
|
+
borderColor?: string;
|
|
19
9
|
/** Predefined style variations for the button */
|
|
20
10
|
buttonType?: 'borderless' | 'outlinedSecondary' | 'outlinedAuxiliary' | 'Default';
|
|
21
11
|
/** `Warning`: This property overrides the style defined by the `buttonType` property!
|
|
@@ -23,42 +13,46 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
23
13
|
* Customize elements color
|
|
24
14
|
*/
|
|
25
15
|
color?: string;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
/** Icon name */
|
|
17
|
+
icon?: Icon;
|
|
18
|
+
/**
|
|
19
|
+
* By default the icon color is primary, use this prop to customize "iconColor"
|
|
29
20
|
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* Customize border color
|
|
21
|
+
iconColor?: ReturnType<typeof getColor>;
|
|
22
|
+
/**
|
|
23
|
+
* By default the icon component is 16px high, use this prop to customize "iconSize"
|
|
34
24
|
*/
|
|
35
|
-
|
|
25
|
+
iconSize?: number;
|
|
26
|
+
/** Enable button loading animation */
|
|
27
|
+
loading?: boolean;
|
|
36
28
|
/**
|
|
37
29
|
* The button component has a 15px margin on its sides, to remove activate the "noMargin" property
|
|
38
30
|
*/
|
|
39
|
-
|
|
31
|
+
noMargin?: boolean;
|
|
40
32
|
/**
|
|
41
33
|
* The button component has a 10px margin on its sides, to remove activate the "noIconMargin" property
|
|
42
34
|
*/
|
|
43
|
-
|
|
35
|
+
noIconMargin?: boolean;
|
|
44
36
|
/**
|
|
45
37
|
* The button component has a 15px padding on its sides, to remove activate the "noPadding" property
|
|
46
38
|
*/
|
|
47
|
-
|
|
39
|
+
noPadding?: boolean;
|
|
48
40
|
/**
|
|
49
41
|
* It should be true if the button is wrapped in a tooltip
|
|
50
42
|
*/
|
|
51
43
|
noPointerEvents?: boolean;
|
|
52
44
|
/**
|
|
53
|
-
*
|
|
45
|
+
* With the property "revertOrientation" it is possible to change the positioning of
|
|
46
|
+
* the elements inside the button as "icon" or "loading"
|
|
54
47
|
*/
|
|
55
|
-
|
|
48
|
+
revertOrientation?: boolean;
|
|
56
49
|
/**
|
|
57
|
-
* By default the
|
|
50
|
+
* By default the button component is 34px high, the "typeSize" property contains
|
|
51
|
+
* the "medium" variation that changes to 27px
|
|
58
52
|
*/
|
|
59
|
-
|
|
53
|
+
typeSize?: 'default' | 'medium' | 'auto';
|
|
60
54
|
};
|
|
61
55
|
/** Primary UI component for user interaction */
|
|
62
|
-
declare const Button: ({
|
|
56
|
+
declare const Button: ({ backgroundColor, borderColor, buttonType, children, color, disabled, icon, iconColor, iconSize, loading: isLoading, noIconMargin, noMargin, noPadding, noPointerEvents, revertOrientation, tabIndex, type, typeSize, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
63
57
|
export type { ButtonProps };
|
|
64
58
|
export { Button };
|
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
import { ButtonProps } from '.';
|
|
2
|
-
type CustomButton = {
|
|
3
|
-
backgroundColor?: string;
|
|
4
|
-
color?: string;
|
|
5
|
-
borderColor?: string;
|
|
6
|
-
};
|
|
7
2
|
type StyledProps = {
|
|
8
|
-
|
|
9
|
-
$noPadding?: boolean;
|
|
10
|
-
$size: NonNullable<ButtonProps['typeSize']>;
|
|
11
|
-
$variant?: string;
|
|
12
|
-
$custom?: CustomButton;
|
|
13
|
-
icon?: boolean;
|
|
14
|
-
alignEnd?: boolean;
|
|
15
|
-
reversed: boolean;
|
|
16
|
-
noPointerEvents?: boolean;
|
|
3
|
+
[Key in keyof Pick<ButtonProps, 'backgroundColor' | 'borderColor' | 'buttonType' | 'color' | 'iconSize' | 'noIconMargin' | 'noMargin' | 'noPadding' | 'noPointerEvents' | 'revertOrientation' | 'typeSize'> as `$${Key}`]: ButtonProps[Key];
|
|
17
4
|
};
|
|
18
|
-
declare const ContentIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<
|
|
19
|
-
reversed: ButtonProps["revertOrientation"];
|
|
20
|
-
size: Required<ButtonProps["iconSize"]>;
|
|
21
|
-
}>> & string;
|
|
5
|
+
declare const ContentIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<StyledProps, "$iconSize">>> & string;
|
|
22
6
|
declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
23
|
-
declare const
|
|
24
|
-
|
|
25
|
-
declare const SmallWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
|
|
26
|
-
export { ContentIcon, Label, WrapperButtons, BaseButton, SmallWrapper };
|
|
7
|
+
declare const BaseButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Pick<StyledProps, "$buttonType" | "$backgroundColor" | "$borderColor" | "$color" | "$noIconMargin" | "$noMargin" | "$noPadding" | "$noPointerEvents" | "$revertOrientation" | "$typeSize">>> & string;
|
|
8
|
+
export { BaseButton, ContentIcon, Label };
|
|
@@ -4,6 +4,7 @@ import { InjectedProps as PopupStateProps } from 'material-ui-popup-state';
|
|
|
4
4
|
import { Color } from '../../../colors';
|
|
5
5
|
import { ButtonProps } from '../../Buttons';
|
|
6
6
|
import { IconProps } from '../Icon';
|
|
7
|
+
import { LinkProps } from '../Link';
|
|
7
8
|
import { TooltipProps } from '../Tooltip';
|
|
8
9
|
import { Unwrap } from '../../types';
|
|
9
10
|
type DropdownOptionIcon = Unwrap<Partial<Pick<IconProps, 'name' | 'size'>> & Pick<React.CSSProperties, 'backgroundColor' | 'color'>> & {
|
|
@@ -14,9 +15,9 @@ type DropdownOptionLetter = Unwrap<Pick<React.CSSProperties, 'backgroundColor' |
|
|
|
14
15
|
};
|
|
15
16
|
type DropdownOption = {
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Background Color to use when option is active
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
activeBackgroundColor?: Color;
|
|
20
21
|
/**
|
|
21
22
|
* Option Badge configuration
|
|
22
23
|
*
|
|
@@ -24,31 +25,37 @@ type DropdownOption = {
|
|
|
24
25
|
*/
|
|
25
26
|
badge?: DropdownOptionIcon | DropdownOptionLetter;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Add separator from previous options
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
brokenSequence?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Label text color
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/color}
|
|
35
|
+
*/
|
|
36
|
+
color?: Color;
|
|
30
37
|
/**
|
|
31
38
|
* Highlight option
|
|
32
39
|
*/
|
|
33
40
|
isActive?: boolean;
|
|
34
41
|
/**
|
|
35
|
-
*
|
|
42
|
+
* Disables option
|
|
36
43
|
*/
|
|
37
|
-
|
|
44
|
+
isDisabled?: boolean;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
46
|
+
* Option description
|
|
40
47
|
*/
|
|
41
|
-
|
|
48
|
+
label?: string;
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
50
|
+
* Link properties
|
|
44
51
|
*
|
|
45
52
|
* @see {Link}
|
|
46
53
|
*/
|
|
47
|
-
|
|
54
|
+
linkProps?: LinkProps;
|
|
48
55
|
/**
|
|
49
|
-
*
|
|
56
|
+
* Event handler called when this option is clicked.
|
|
50
57
|
*/
|
|
51
|
-
|
|
58
|
+
onClick?: () => null;
|
|
52
59
|
/**
|
|
53
60
|
* Tooltip's title
|
|
54
61
|
*
|
|
@@ -56,11 +63,11 @@ type DropdownOption = {
|
|
|
56
63
|
*/
|
|
57
64
|
tooltip?: TooltipProps['title'];
|
|
58
65
|
/**
|
|
59
|
-
*
|
|
66
|
+
* Transforms label to a Link and point user to this url
|
|
60
67
|
*
|
|
61
|
-
* @see {
|
|
68
|
+
* @see {Link}
|
|
62
69
|
*/
|
|
63
|
-
|
|
70
|
+
url?: string;
|
|
64
71
|
};
|
|
65
72
|
type DropdownSharedProps = {
|
|
66
73
|
/**
|
|
@@ -75,45 +82,45 @@ type DropdownSharedProps = {
|
|
|
75
82
|
* help: https://mui.com/material-ui/react-popover/#anchor-playground
|
|
76
83
|
*/
|
|
77
84
|
anchorOrigin?: PopoverOrigin;
|
|
78
|
-
/**
|
|
79
|
-
* This is the point on the popover which
|
|
80
|
-
* will attach to the anchor's origin.
|
|
81
|
-
*
|
|
82
|
-
* Options:
|
|
83
|
-
* vertical: [top, center, bottom, x(px)];
|
|
84
|
-
* horizontal: [left, center, right, x(px)].
|
|
85
|
-
*
|
|
86
|
-
* help: https://mui.com/material-ui/react-popover/#anchor-playground
|
|
87
|
-
*/
|
|
88
|
-
transformOrigin?: PopoverOrigin;
|
|
89
85
|
/**
|
|
90
86
|
* The unique id to identify the dropdown anchor element.
|
|
91
87
|
*/
|
|
92
88
|
id: string;
|
|
93
89
|
/**
|
|
94
|
-
*
|
|
90
|
+
* Event handler called when a dropdown option is selected.
|
|
91
|
+
*
|
|
92
|
+
* This prop can be overriden using option.onClick
|
|
95
93
|
*
|
|
96
94
|
* @see {DropdownOption}
|
|
97
95
|
*/
|
|
98
|
-
|
|
96
|
+
onSelect?: (itemClicked: DropdownOption) => void;
|
|
99
97
|
/**
|
|
100
98
|
* Event handler called when the dropdown is opened or closed.
|
|
101
99
|
*/
|
|
102
100
|
onToggle?: (popupState: PopupStateProps) => void;
|
|
103
101
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* This prop can be overriden using option.onClick
|
|
102
|
+
* Options listed in the Dropdown menu popup.
|
|
107
103
|
*
|
|
108
104
|
* @see {DropdownOption}
|
|
109
105
|
*/
|
|
110
|
-
|
|
106
|
+
options: DropdownOption[] | undefined;
|
|
111
107
|
/**
|
|
112
108
|
* Tooltip's title
|
|
113
109
|
*
|
|
114
110
|
* @see {Tooltip}
|
|
115
111
|
*/
|
|
116
112
|
tooltip?: TooltipProps['title'];
|
|
113
|
+
/**
|
|
114
|
+
* This is the point on the popover which
|
|
115
|
+
* will attach to the anchor's origin.
|
|
116
|
+
*
|
|
117
|
+
* Options:
|
|
118
|
+
* vertical: [top, center, bottom, x(px)];
|
|
119
|
+
* horizontal: [left, center, right, x(px)].
|
|
120
|
+
*
|
|
121
|
+
* @see {@link https://mui.com/material-ui/react-popover/#anchor-playground}
|
|
122
|
+
*/
|
|
123
|
+
transformOrigin?: PopoverOrigin;
|
|
117
124
|
};
|
|
118
125
|
type DropdownVariationButtonProps = DropdownSharedProps & {
|
|
119
126
|
/**
|
|
@@ -122,6 +129,13 @@ type DropdownVariationButtonProps = DropdownSharedProps & {
|
|
|
122
129
|
* @see {Button}
|
|
123
130
|
*/
|
|
124
131
|
anchorType: 'button';
|
|
132
|
+
/**
|
|
133
|
+
* Button properties
|
|
134
|
+
*
|
|
135
|
+
* @see {Button}
|
|
136
|
+
*/
|
|
137
|
+
buttonProps?: ButtonProps;
|
|
138
|
+
content?: never;
|
|
125
139
|
/**
|
|
126
140
|
* Hide dropdown arrow icon
|
|
127
141
|
*/
|
|
@@ -130,19 +144,12 @@ type DropdownVariationButtonProps = DropdownSharedProps & {
|
|
|
130
144
|
* Hide dropdown label text
|
|
131
145
|
*/
|
|
132
146
|
hideLabel?: boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Button properties
|
|
135
|
-
*
|
|
136
|
-
* @see {Button}
|
|
137
|
-
*/
|
|
138
|
-
buttonProps?: ButtonProps;
|
|
139
147
|
/**
|
|
140
148
|
* Button label
|
|
141
149
|
*
|
|
142
150
|
* Default value: 'Open Popover'
|
|
143
151
|
*/
|
|
144
152
|
label?: string | React.JSX.Element;
|
|
145
|
-
content?: never;
|
|
146
153
|
};
|
|
147
154
|
type DropdownVariationContainerProps = DropdownSharedProps & {
|
|
148
155
|
/**
|
|
@@ -160,6 +167,6 @@ type DropdownProps = DropdownVariationContainerProps | DropdownVariationButtonPr
|
|
|
160
167
|
/**
|
|
161
168
|
* Display a menu with a list of options
|
|
162
169
|
*/
|
|
163
|
-
declare const Dropdown: ({
|
|
170
|
+
declare const Dropdown: ({ anchorType, content, onSelect, onToggle, ...props }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
164
171
|
export type { DropdownOption, DropdownProps };
|
|
165
172
|
export { Dropdown };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { DropdownOption } from './Dropdown';
|
|
2
|
-
import { Color } from '../../../colors';
|
|
3
2
|
type StyledProps = {
|
|
4
|
-
brokenSequence
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare const
|
|
15
|
-
declare const
|
|
16
|
-
declare const
|
|
3
|
+
[Key in keyof Pick<DropdownOption, 'activeBackgroundColor' | 'brokenSequence' | 'isActive' | 'color'> as `$${Key}`]: DropdownOption[Key];
|
|
4
|
+
} & {
|
|
5
|
+
disabled: DropdownOption['isDisabled'];
|
|
6
|
+
};
|
|
7
|
+
declare const MenuContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
declare const MenuOption: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<StyledProps, "disabled" | "$activeBackgroundColor" | "$brokenSequence" | "$isActive">>> & string;
|
|
9
|
+
declare const Text: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<StyledProps, "$color">>> & string;
|
|
10
|
+
type ContentBadgeProps = {
|
|
11
|
+
[Key in keyof Pick<NonNullable<DropdownOption['badge']>, 'backgroundColor'> as `$${Key}`]: NonNullable<DropdownOption['badge']>[Key];
|
|
12
|
+
};
|
|
13
|
+
declare const ContentBadge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<ContentBadgeProps, "$backgroundColor">>> & string;
|
|
14
|
+
declare const ClickableContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
declare const Grid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
16
|
+
declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
17
17
|
export { MenuContainer, MenuOption, Text, ContentBadge, ClickableContainer, Grid, Wrapper, };
|