@sb1/ffe-cards-react 10.0.3 → 11.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/package.json +3 -3
- package/types/index.d.ts +40 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-cards-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "React implementation of ffe-react",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test:watch": "ffe-buildtool jest --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sb1/ffe-cards": "^15.0.
|
|
28
|
+
"@sb1/ffe-cards": "^15.0.3",
|
|
29
29
|
"prop-types": "^15.7.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b919e0b93e9e793893c3f804eba92591cfad81d7"
|
|
44
44
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export interface CardBaseProps extends ComponentBaseProps {
|
|
13
|
-
to?: string;
|
|
14
|
-
}
|
|
3
|
+
type ComponentBaseProps =
|
|
4
|
+
| ({
|
|
5
|
+
className?: string;
|
|
6
|
+
element?: HTMLElement | string | React.ElementType;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
} & React.ComponentProps<'html'>)
|
|
9
|
+
| React.ComponentProps<'button'>
|
|
10
|
+
| React.ComponentProps<'a'>;
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
type TitleProps = {
|
|
17
13
|
overflowEllipsis?: boolean;
|
|
18
|
-
}
|
|
14
|
+
} & ComponentBaseProps;
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export interface CardNameProps extends ComponentBaseProps {}
|
|
16
|
+
type SubtextProps = ComponentBaseProps;
|
|
17
|
+
type TextProps = ComponentBaseProps;
|
|
18
|
+
type CardNameProps = ComponentBaseProps;
|
|
25
19
|
|
|
26
20
|
export interface CardRenderProps {
|
|
27
21
|
CardName: React.FC<CardNameProps>;
|
|
@@ -30,26 +24,45 @@ export interface CardRenderProps {
|
|
|
30
24
|
Text: React.FC<TextProps>;
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
28
|
+
|
|
29
|
+
export interface ImageCardProps<T = {}>
|
|
30
|
+
extends Omit<ComponentBaseProps, 'children'> {
|
|
34
31
|
imageSrc: string;
|
|
35
32
|
imageAltText: string;
|
|
36
33
|
children?: React.ReactNode | ((props: CardRenderProps) => React.ReactNode);
|
|
37
34
|
}
|
|
38
35
|
|
|
39
|
-
export interface IconCardProps
|
|
36
|
+
export interface IconCardProps<T = {}>
|
|
37
|
+
extends Omit<ComponentBaseProps, 'children'> {
|
|
40
38
|
icon: React.ReactNode;
|
|
41
39
|
condensed?: boolean;
|
|
42
40
|
greyCharcoal?: boolean;
|
|
43
41
|
children?: React.ReactNode | ((props: CardRenderProps) => React.ReactNode);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
export interface TextCardProps extends Omit<
|
|
44
|
+
export interface TextCardProps extends Omit<ComponentBaseProps, 'children'> {
|
|
47
45
|
leftAlign?: boolean;
|
|
48
46
|
children: React.ReactNode | ((props: CardRenderProps) => React.ReactNode);
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
declare class CardBase extends React.Component<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
declare class
|
|
49
|
+
declare class CardBase<T = {}> extends React.Component<
|
|
50
|
+
NoInfer<T> & ComponentBaseProps,
|
|
51
|
+
any
|
|
52
|
+
> {}
|
|
53
|
+
declare class IconCard<T = {}> extends React.Component<
|
|
54
|
+
NoInfer<T> & IconCardProps,
|
|
55
|
+
any
|
|
56
|
+
> {}
|
|
57
|
+
declare class ImageCard<T = {}> extends React.Component<
|
|
58
|
+
NoInfer<T> & ImageCardProps,
|
|
59
|
+
any
|
|
60
|
+
> {}
|
|
61
|
+
declare class TextCard<T = {}> extends React.Component<
|
|
62
|
+
NoInfer<T> & TextCardProps,
|
|
63
|
+
any
|
|
64
|
+
> {}
|
|
65
|
+
declare class ComponentBase<T = {}> extends React.Component<
|
|
66
|
+
NoInfer<T> & ComponentBaseProps,
|
|
67
|
+
any
|
|
68
|
+
> {}
|