@sb1/ffe-buttons-react 17.0.2 → 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.
package/README.md CHANGED
@@ -8,10 +8,23 @@ npm install --save @sb1/ffe-buttons-react
8
8
 
9
9
  ## Usage
10
10
 
11
- Run Styleguidist from the repository root to see live examples and documentation,
12
- or see the markdown files next to the component code in `src/`.
11
+ Full documentation on button usage is available at https://design.sparebank1.no/komponenter/knapper/.
13
12
 
14
13
  ## TypeScript definition files
15
14
 
16
15
  This component supports TypeScript - please update `index.d.ts` if you change any
17
16
  of the external methods or properties in this component.
17
+
18
+ ## Development
19
+
20
+ To start a local development server, run the following from the designsystem root folder:
21
+
22
+ ```bash
23
+ npm install
24
+ npm run build
25
+ npm start
26
+ ```
27
+
28
+ A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
29
+
30
+ Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-buttons-react",
3
- "version": "17.0.2",
3
+ "version": "18.0.0",
4
4
  "description": "React implementation of ffe-buttons",
5
5
  "keywords": [
6
6
  "ffe"
@@ -28,8 +28,8 @@
28
28
  "test:watch": "ffe-buildtool jest --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@sb1/ffe-buttons": "^17.0.2",
32
- "@sb1/ffe-icons-react": "^7.3.4",
31
+ "@sb1/ffe-buttons": "^17.0.3",
32
+ "@sb1/ffe-icons-react": "^7.3.5",
33
33
  "classnames": "^2.3.1",
34
34
  "prop-types": "^15.7.2"
35
35
  },
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "af7fc1a32630d5717ffbc8f50f339ba697c73130"
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
  > {}