@sb1/ffe-form-react 9.1.0 → 9.1.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/types/index.d.ts +20 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-form-react",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "React component for form elements in ffe",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "22e54c519db07ebad3a22daa305f143ffa4ff226"
48
+ "gitHead": "ed68570ec63c812cd52823867ccec7e9f206bc3a"
49
49
  }
package/types/index.d.ts CHANGED
@@ -49,10 +49,17 @@ export interface LabelProps
49
49
  htmlFor?: string;
50
50
  }
51
51
 
52
- export interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
52
+ export interface InputGroupProps
53
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
53
54
  inputId?: string;
54
55
  /** Unless you only have one element in your `InputGroup` you will have to use the function-as-a-child pattern. */
55
- children: React.ReactNode;
56
+ children:
57
+ | React.ReactNode
58
+ | ((extraProps: {
59
+ id: string;
60
+ 'aria-invalid': string;
61
+ 'aria-describedby': string;
62
+ }) => React.ReactNode);
56
63
  className?: string;
57
64
  extraMargin?: boolean;
58
65
  fieldMessage?: string | React.ReactNode;
@@ -112,8 +119,17 @@ interface WeakFieldSetAttributes
112
119
  onChange?: any;
113
120
  }
114
121
 
115
- export interface RadioButtonInputGroupProps extends WeakFieldSetAttributes {
116
- children: React.ReactNode;
122
+ export interface RadioButtonInputGroupProps
123
+ extends Omit<WeakFieldSetAttributes, 'children'> {
124
+ children:
125
+ | React.ReactNode
126
+ | ((inputProps: {
127
+ 'aria-invalid'?: 'true' | 'false';
128
+ inline?: boolean;
129
+ name: string;
130
+ onChange: (...args: any) => any;
131
+ selectedValue?: boolean | string | number;
132
+ }) => React.ReactNode);
117
133
  className?: string;
118
134
  description?: string | React.ReactNode;
119
135
  extraMargin?: boolean;