@sb1/ffe-buttons-react 17.0.3 → 18.0.1
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/package.json +3 -3
- package/types/index.d.ts +58 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-buttons-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "React implementation of ffe-buttons",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ffe"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test:watch": "ffe-buildtool jest --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sb1/ffe-buttons": "^17.0.
|
|
31
|
+
"@sb1/ffe-buttons": "^17.0.3",
|
|
32
32
|
"@sb1/ffe-icons-react": "^7.3.5",
|
|
33
33
|
"classnames": "^2.3.1",
|
|
34
34
|
"prop-types": "^15.7.2"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "8ea46bb4f8e7624e55dbe57e75308b51ffbf9528"
|
|
50
50
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
type
|
|
4
|
-
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
3
|
+
export type MinimalBaseButtonProps =
|
|
4
|
+
| ({
|
|
5
|
+
className?: string;
|
|
6
|
+
element?: HTMLElement | string | React.ElementType;
|
|
7
|
+
innerRef?: React.Ref<HTMLElement>;
|
|
8
|
+
} & React.ComponentProps<'button'>)
|
|
9
|
+
| React.ComponentProps<'a'>;
|
|
11
10
|
|
|
12
|
-
export
|
|
13
|
-
className?: string;
|
|
14
|
-
element?: HTMLElement | string | React.ElementType;
|
|
15
|
-
innerRef?: React.Ref<HTMLElement>;
|
|
16
|
-
to?: To; //used in order to make buttons work with react-router functionality in typescript-files.
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface BaseButtonProps extends MinimalBaseButtonProps {
|
|
11
|
+
export type BaseButtonProps = {
|
|
20
12
|
children?: React.ReactNode;
|
|
21
13
|
ariaLoadingMessage?: string;
|
|
22
14
|
disabled?: boolean;
|
|
23
15
|
isLoading?: boolean;
|
|
24
16
|
leftIcon?: React.ReactNode;
|
|
25
17
|
rightIcon?: React.ReactNode;
|
|
26
|
-
}
|
|
18
|
+
} & MinimalBaseButtonProps;
|
|
27
19
|
|
|
28
|
-
|
|
20
|
+
type ActionButtonProps = BaseButtonProps;
|
|
29
21
|
|
|
30
|
-
export
|
|
22
|
+
export type BackButtonProps = {
|
|
31
23
|
children?: React.ReactNode;
|
|
32
|
-
}
|
|
24
|
+
} & MinimalBaseButtonProps;
|
|
33
25
|
|
|
34
26
|
export interface ButtonGroupProps {
|
|
35
27
|
className?: string;
|
|
@@ -38,63 +30,83 @@ export interface ButtonGroupProps {
|
|
|
38
30
|
children: React.ReactNode;
|
|
39
31
|
}
|
|
40
32
|
|
|
41
|
-
export
|
|
33
|
+
export type ExpandButtonProps = {
|
|
42
34
|
children: React.ReactNode;
|
|
43
35
|
closeLabel?: string;
|
|
44
36
|
leftIcon?: React.ReactNode;
|
|
45
37
|
rightIcon?: React.ReactNode;
|
|
46
38
|
isExpanded: boolean;
|
|
47
39
|
onClick: (e: React.MouseEvent | undefined) => void;
|
|
48
|
-
}
|
|
40
|
+
} & MinimalBaseButtonProps;
|
|
49
41
|
|
|
50
|
-
export
|
|
42
|
+
export type InlineExpandButtonProps = {
|
|
51
43
|
children?: React.ReactNode;
|
|
52
44
|
innerRef?: React.Ref<HTMLElement>;
|
|
53
45
|
isExpanded: boolean;
|
|
54
46
|
onClick: (e: React.MouseEvent | undefined) => void;
|
|
55
|
-
}
|
|
47
|
+
} & MinimalBaseButtonProps;
|
|
56
48
|
|
|
57
|
-
export
|
|
49
|
+
export type PrimaryButtonProps = BaseButtonProps;
|
|
58
50
|
|
|
59
|
-
export
|
|
51
|
+
export type SecondaryButtonProps = BaseButtonProps;
|
|
60
52
|
|
|
61
|
-
export
|
|
53
|
+
export type ShortcutButtonProps = {
|
|
62
54
|
children?: React.ReactNode;
|
|
63
55
|
disabled?: boolean;
|
|
64
56
|
leftIcon?: React.ReactNode;
|
|
65
|
-
}
|
|
57
|
+
} & MinimalBaseButtonProps;
|
|
66
58
|
|
|
67
|
-
export
|
|
59
|
+
export type TaskButtonProps = {
|
|
68
60
|
children?: React.ReactNode;
|
|
69
61
|
disabled?: boolean;
|
|
70
62
|
icon: React.ReactNode;
|
|
71
|
-
}
|
|
63
|
+
} & MinimalBaseButtonProps;
|
|
72
64
|
|
|
73
|
-
export
|
|
65
|
+
export type TertiaryButtonProps = {
|
|
74
66
|
children?: React.ReactNode;
|
|
75
67
|
leftIcon?: React.ReactNode;
|
|
76
68
|
rightIcon?: React.ReactNode;
|
|
77
|
-
}
|
|
69
|
+
} & MinimalBaseButtonProps;
|
|
70
|
+
|
|
71
|
+
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
78
72
|
|
|
79
|
-
declare class ActionButton extends React.Component<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
declare class
|
|
84
|
-
|
|
73
|
+
declare class ActionButton<T = {}> extends React.Component<
|
|
74
|
+
NoInfer<T> & ActionButtonProps,
|
|
75
|
+
any
|
|
76
|
+
> {}
|
|
77
|
+
declare class BackButton<T = {}> extends React.Component<
|
|
78
|
+
NoInfer<T> & BackButtonProps,
|
|
79
|
+
any
|
|
80
|
+
> {}
|
|
81
|
+
declare class ButtonGroup<T = {}> extends React.Component<
|
|
82
|
+
NoInfer<T> & ButtonGroupProps,
|
|
83
|
+
any
|
|
84
|
+
> {}
|
|
85
|
+
declare class ExpandButton<T = {}> extends React.Component<
|
|
86
|
+
NoInfer<T> & ExpandButtonProps,
|
|
87
|
+
any
|
|
88
|
+
> {}
|
|
89
|
+
declare class InlineExpandButton<T = {}> extends React.Component<
|
|
90
|
+
NoInfer<T> & InlineExpandButtonProps,
|
|
91
|
+
any
|
|
92
|
+
> {}
|
|
93
|
+
declare class PrimaryButton<T = {}> extends React.Component<
|
|
94
|
+
NoInfer<T> & PrimaryButtonProps,
|
|
95
|
+
any
|
|
96
|
+
> {}
|
|
97
|
+
declare class SecondaryButton<T = {}> extends React.Component<
|
|
98
|
+
NoInfer<T> & SecondaryButtonProps,
|
|
85
99
|
any
|
|
86
100
|
> {}
|
|
87
|
-
declare class
|
|
88
|
-
|
|
89
|
-
SecondaryButtonProps,
|
|
101
|
+
declare class ShortcutButton<T = {}> extends React.Component<
|
|
102
|
+
NoInfer<T> & ShortcutButtonProps,
|
|
90
103
|
any
|
|
91
104
|
> {}
|
|
92
|
-
declare class
|
|
93
|
-
|
|
105
|
+
declare class TaskButton<T = {}> extends React.Component<
|
|
106
|
+
NoInfer<T> & TaskButtonProps,
|
|
94
107
|
any
|
|
95
108
|
> {}
|
|
96
|
-
declare class
|
|
97
|
-
|
|
98
|
-
TertiaryButtonProps,
|
|
109
|
+
declare class TertiaryButton<T = {}> extends React.Component<
|
|
110
|
+
NoInfer<T> & TertiaryButtonProps,
|
|
99
111
|
any
|
|
100
112
|
> {}
|