@sb1/ffe-buttons-react 17.0.3 → 18.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/types/index.d.ts +35 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-buttons-react",
3
- "version": "17.0.3",
3
+ "version": "18.0.0",
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.2",
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": "8cbf828bcc67fe4a402abfca9a133061e3d2c37e"
49
+ "gitHead": "1ab898e744977e4cb4db1bee9b65369a0deeef9a"
50
50
  }
package/types/index.d.ts CHANGED
@@ -1,19 +1,9 @@
1
1
  import * as React from 'react';
2
2
 
3
- type To =
4
- | string
5
- | {
6
- pathname: string;
7
- search?: string;
8
- hash?: string;
9
- state?: { [key: string]: any };
10
- };
11
-
12
- export interface MinimalBaseButtonProps extends React.HTMLProps<HTMLElement> {
3
+ export interface MinimalBaseButtonProps extends React.ComponentPropsWithoutRef<'html'> {
13
4
  className?: string;
14
5
  element?: HTMLElement | string | React.ElementType;
15
6
  innerRef?: React.Ref<HTMLElement>;
16
- to?: To; //used in order to make buttons work with react-router functionality in typescript-files.
17
7
  }
18
8
 
19
9
  export interface BaseButtonProps extends MinimalBaseButtonProps {
@@ -76,25 +66,45 @@ export interface TertiaryButtonProps extends MinimalBaseButtonProps {
76
66
  rightIcon?: React.ReactNode;
77
67
  }
78
68
 
79
- declare class ActionButton extends React.Component<ActionButtonProps, any> {}
80
- declare class BackButton extends React.Component<BackButtonProps, any> {}
81
- declare class ButtonGroup extends React.Component<ButtonGroupProps, any> {}
82
- declare class ExpandButton extends React.Component<ExpandButtonProps, any> {}
83
- declare class InlineExpandButton extends React.Component<
84
- InlineExpandButtonProps,
69
+ type NoInfer<T> = [T][T extends any ? 0 : never];
70
+
71
+ declare class ActionButton<T = {}> extends React.Component<
72
+ NoInfer<T> & ActionButtonProps,
73
+ any
74
+ > {}
75
+ declare class BackButton<T = {}> extends React.Component<
76
+ NoInfer<T> & BackButtonProps,
77
+ any
78
+ > {}
79
+ declare class ButtonGroup<T = {}> extends React.Component<
80
+ NoInfer<T> & ButtonGroupProps,
81
+ any
82
+ > {}
83
+ declare class ExpandButton<T = {}> extends React.Component<
84
+ NoInfer<T> & ExpandButtonProps,
85
+ any
86
+ > {}
87
+ declare class InlineExpandButton<T = {}> extends React.Component<
88
+ NoInfer<T> & InlineExpandButtonProps,
89
+ any
90
+ > {}
91
+ declare class PrimaryButton<T = {}> extends React.Component<
92
+ NoInfer<T> & PrimaryButtonProps,
93
+ any
94
+ > {}
95
+ declare class SecondaryButton<T = {}> extends React.Component<
96
+ NoInfer<T> & SecondaryButtonProps,
85
97
  any
86
98
  > {}
87
- declare class PrimaryButton extends React.Component<PrimaryButtonProps, any> {}
88
- declare class SecondaryButton extends React.Component<
89
- SecondaryButtonProps,
99
+ declare class ShortcutButton<T = {}> extends React.Component<
100
+ NoInfer<T> & ShortcutButtonProps,
90
101
  any
91
102
  > {}
92
- declare class ShortcutButton extends React.Component<
93
- ShortcutButtonProps,
103
+ declare class TaskButton<T = {}> extends React.Component<
104
+ NoInfer<T> & TaskButtonProps,
94
105
  any
95
106
  > {}
96
- declare class TaskButton extends React.Component<TaskButtonProps, any> {}
97
- declare class TertiaryButton extends React.Component<
98
- TertiaryButtonProps,
107
+ declare class TertiaryButton<T = {}> extends React.Component<
108
+ NoInfer<T> & TertiaryButtonProps,
99
109
  any
100
110
  > {}