@dfds-ui/forms 2.2.0-alpha.98e68873 → 2.2.0-alpha.9bb1ab0f
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/assistive-text/AssistiveText.d.ts +1 -1
- package/asterisk/Asterisk.d.ts +1 -1
- package/checkbox/Checkbox.d.ts +4 -4
- package/checkbox/Checkbox.js +7 -7
- package/checkbox/CheckboxContext.d.ts +3 -3
- package/checkbox/CheckboxGroup.d.ts +1 -1
- package/cjs/assistive-text/AssistiveText.d.ts +1 -1
- package/cjs/asterisk/Asterisk.d.ts +1 -1
- package/cjs/checkbox/Checkbox.d.ts +4 -4
- package/cjs/checkbox/Checkbox.js +7 -7
- package/cjs/checkbox/CheckboxContext.d.ts +3 -3
- package/cjs/checkbox/CheckboxGroup.d.ts +1 -1
- package/cjs/counter/Counter.d.ts +2 -2
- package/cjs/enhanced/EnhancedField.d.ts +3 -3
- package/cjs/error-text/ErrorText.d.ts +1 -1
- package/cjs/field-wrap/FieldWrap.d.ts +1 -1
- package/cjs/help-icon/HelpIcon.d.ts +1 -1
- package/cjs/label/Label.d.ts +1 -1
- package/cjs/password-field/PasswordField.d.ts +1 -1
- package/cjs/radio/Radio.d.ts +4 -4
- package/cjs/radio/Radio.js +7 -7
- package/cjs/radio/RadioContext.d.ts +3 -3
- package/cjs/radio/RadioGroup.d.ts +1 -1
- package/cjs/rating/Rating.d.ts +3 -3
- package/cjs/select-field/AsyncSelectField.d.ts +4 -100
- package/cjs/select-field/CreatableSelectField.d.ts +4 -133
- package/cjs/select-field/NativeSelectField.d.ts +1 -1
- package/cjs/select-field/SelectField.d.ts +11 -48
- package/cjs/switch/Switch.d.ts +2 -2
- package/cjs/switch/Switch.js +12 -12
- package/cjs/switch/SwitchContext.d.ts +3 -3
- package/cjs/switch/SwitchGroup.d.ts +1 -1
- package/cjs/tel-field/TelField.d.ts +9 -9
- package/cjs/text-field/TextField.d.ts +18 -18
- package/cjs/textarea-field/TextareaField.d.ts +10 -10
- package/cjs/types/field.d.ts +1 -1
- package/cjs/types/size.d.ts +1 -1
- package/counter/Counter.d.ts +2 -2
- package/enhanced/EnhancedField.d.ts +3 -3
- package/error-text/ErrorText.d.ts +1 -1
- package/field-wrap/FieldWrap.d.ts +1 -1
- package/help-icon/HelpIcon.d.ts +1 -1
- package/label/Label.d.ts +1 -1
- package/package.json +8 -8
- package/password-field/PasswordField.d.ts +1 -1
- package/radio/Radio.d.ts +4 -4
- package/radio/Radio.js +7 -7
- package/radio/RadioContext.d.ts +3 -3
- package/radio/RadioGroup.d.ts +1 -1
- package/rating/Rating.d.ts +3 -3
- package/select-field/AsyncSelectField.d.ts +4 -100
- package/select-field/CreatableSelectField.d.ts +4 -133
- package/select-field/NativeSelectField.d.ts +1 -1
- package/select-field/SelectField.d.ts +11 -48
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +16 -16
- package/switch/SwitchContext.d.ts +3 -3
- package/switch/SwitchGroup.d.ts +1 -1
- package/tel-field/TelField.d.ts +9 -9
- package/text-field/TextField.d.ts +18 -18
- package/textarea-field/TextareaField.d.ts +10 -10
- package/types/field.d.ts +1 -1
- package/types/size.d.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SwitchProps } from './Switch';
|
|
3
|
-
|
|
3
|
+
type SwitchContextProps = Required<Pick<SwitchProps, 'size' | 'error'>> & {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
};
|
|
6
6
|
export declare const SwitchContext: React.Context<SwitchContextProps | undefined>;
|
|
7
|
-
export declare const SwitchContextProvider:
|
|
7
|
+
export declare const SwitchContextProvider: ({ children, value, }: {
|
|
8
8
|
value: SwitchContextProps;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
-
}
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
11
|
declare const useSwitchContext: () => SwitchContextProps | undefined;
|
|
12
12
|
export default useSwitchContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFieldProps } from '../types';
|
|
3
3
|
import { SwitchProps } from './Switch';
|
|
4
|
-
export
|
|
4
|
+
export type SwitchGroupProps = Pick<BaseFieldProps, 'label' | 'errorMessage' | 'hideAsterisk' | 'required'> & {
|
|
5
5
|
/**
|
|
6
6
|
* JSX enclosed by the group.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Locale } from '@dfds-ui/react-components';
|
|
3
3
|
import { BaseFieldProps } from '../types';
|
|
4
|
-
export
|
|
4
|
+
export type TelFieldProps = BaseFieldProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Class name to be added to the TelField.
|
|
7
7
|
*/
|
|
@@ -31,37 +31,37 @@ export declare type TelFieldProps = BaseFieldProps & {
|
|
|
31
31
|
*/
|
|
32
32
|
onBlur?: () => void;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type TelFieldElement = {
|
|
35
35
|
focus?: () => void;
|
|
36
36
|
};
|
|
37
37
|
export declare const TelField: React.ForwardRefExoticComponent<BaseFieldProps & {
|
|
38
38
|
/**
|
|
39
39
|
* Class name to be added to the TelField.
|
|
40
40
|
*/
|
|
41
|
-
className?: string
|
|
41
|
+
className?: string;
|
|
42
42
|
/**
|
|
43
43
|
* Default value for the phone number
|
|
44
44
|
*/
|
|
45
|
-
defaultValue?: string
|
|
45
|
+
defaultValue?: string;
|
|
46
46
|
/**
|
|
47
47
|
* Default locale. Will set the matching country in the dropdown
|
|
48
48
|
*/
|
|
49
|
-
defaultLocale?:
|
|
49
|
+
defaultLocale?: Locale;
|
|
50
50
|
/**
|
|
51
51
|
* Show trunk values (the local area code shown in parenthesis)
|
|
52
52
|
*/
|
|
53
|
-
showTrunkValues?: boolean
|
|
53
|
+
showTrunkValues?: boolean;
|
|
54
54
|
/**
|
|
55
55
|
* Makes value splitted so easier to convert to object
|
|
56
56
|
*/
|
|
57
|
-
splitValues?: boolean
|
|
57
|
+
splitValues?: boolean;
|
|
58
58
|
/**
|
|
59
59
|
* Callback when value changes
|
|
60
60
|
*/
|
|
61
|
-
onChange?: (
|
|
61
|
+
onChange?: (newValue: string) => void;
|
|
62
62
|
/**
|
|
63
63
|
* Callback when blur
|
|
64
64
|
*/
|
|
65
|
-
onBlur?: (
|
|
65
|
+
onBlur?: () => void;
|
|
66
66
|
} & React.RefAttributes<TelFieldElement>>;
|
|
67
67
|
export default TelField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseFieldProps, Size } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type TextFieldProps = BaseFieldProps & {
|
|
4
4
|
autoFocus?: boolean;
|
|
5
5
|
defaultValue?: string;
|
|
6
6
|
prefix?: React.ReactNode;
|
|
@@ -28,30 +28,30 @@ export declare type TextFieldProps = BaseFieldProps & {
|
|
|
28
28
|
step?: number | 'any';
|
|
29
29
|
};
|
|
30
30
|
export declare const TextField: React.ForwardRefExoticComponent<BaseFieldProps & {
|
|
31
|
-
autoFocus?: boolean
|
|
32
|
-
defaultValue?: string
|
|
31
|
+
autoFocus?: boolean;
|
|
32
|
+
defaultValue?: string;
|
|
33
33
|
prefix?: React.ReactNode;
|
|
34
34
|
suffix?: React.ReactNode;
|
|
35
|
-
icon?: React.ElementType
|
|
35
|
+
icon?: React.ElementType;
|
|
36
36
|
/**
|
|
37
37
|
* Element to be placed after the input element.
|
|
38
38
|
*
|
|
39
39
|
* Useful for adding a button next to the TextField.
|
|
40
40
|
*/
|
|
41
41
|
adornment?: React.ReactNode;
|
|
42
|
-
className?: string
|
|
43
|
-
value?: string
|
|
44
|
-
visualSize?: Size
|
|
45
|
-
onChange?: (
|
|
46
|
-
onFocus?: (
|
|
47
|
-
onBlur?: (
|
|
48
|
-
inputType?: "
|
|
49
|
-
autoComplete?: string
|
|
50
|
-
minValue?: string
|
|
51
|
-
maxValue?: string
|
|
52
|
-
maxLength?: number
|
|
53
|
-
minLength?: number
|
|
54
|
-
readOnly?: boolean
|
|
55
|
-
step?: number | "any"
|
|
42
|
+
className?: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
visualSize?: Size;
|
|
45
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
46
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
47
|
+
onBlur?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
48
|
+
inputType?: "email" | "text" | "tel" | "time" | "url" | "date" | "file" | "number" | "search" | "password";
|
|
49
|
+
autoComplete?: string;
|
|
50
|
+
minValue?: string;
|
|
51
|
+
maxValue?: string;
|
|
52
|
+
maxLength?: number;
|
|
53
|
+
minLength?: number;
|
|
54
|
+
readOnly?: boolean;
|
|
55
|
+
step?: number | "any";
|
|
56
56
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
57
57
|
export default TextField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BaseFieldProps, Size } from '../types';
|
|
3
3
|
export declare const inputPaddings: {
|
|
4
4
|
small: {
|
|
@@ -10,8 +10,8 @@ export declare const inputPaddings: {
|
|
|
10
10
|
horizontal: number;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
export
|
|
13
|
+
type FieldSize = Extract<Size, 'small' | 'medium'>;
|
|
14
|
+
export type TextareaFieldProps = BaseFieldProps & {
|
|
15
15
|
defaultValue?: string;
|
|
16
16
|
size?: FieldSize;
|
|
17
17
|
/**
|
|
@@ -27,18 +27,18 @@ export declare type TextareaFieldProps = BaseFieldProps & {
|
|
|
27
27
|
rows?: number;
|
|
28
28
|
};
|
|
29
29
|
export declare const TextareaField: React.ForwardRefExoticComponent<BaseFieldProps & {
|
|
30
|
-
defaultValue?: string
|
|
31
|
-
size?: FieldSize
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
size?: FieldSize;
|
|
32
32
|
/**
|
|
33
33
|
* Set a limit to the amount of characters the user may add. This number is also displayed on the bottom counter by default.
|
|
34
34
|
*/
|
|
35
|
-
maxValueLength?: number
|
|
35
|
+
maxValueLength?: number;
|
|
36
36
|
/**
|
|
37
37
|
* Whether to show the length counter at the bottom right
|
|
38
38
|
*/
|
|
39
|
-
showLengthCounter?: boolean
|
|
40
|
-
value?: string
|
|
41
|
-
onChange?: (
|
|
42
|
-
rows?: number
|
|
39
|
+
showLengthCounter?: boolean;
|
|
40
|
+
value?: string;
|
|
41
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
42
|
+
rows?: number;
|
|
43
43
|
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
44
44
|
export {};
|
package/cjs/types/field.d.ts
CHANGED
package/cjs/types/size.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Size = 'small' | 'medium' | 'large';
|
package/counter/Counter.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type ReactInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
3
|
+
export type EnhancedInputProps<TValue> = Omit<EnhancedFieldProps, 'value'> & {
|
|
4
4
|
value?: TValue;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type EnhancedFieldProps = Omit<ReactInputProps, 'size' | 'css'> & {
|
|
7
7
|
name?: string;
|
|
8
8
|
/**
|
|
9
9
|
* Label to be displayed
|
package/help-icon/HelpIcon.d.ts
CHANGED
package/label/Label.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Form components",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "2.2.0-alpha.
|
|
6
|
+
"version": "2.2.0-alpha.9bb1ab0f",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"main": "./cjs/index.js",
|
|
9
9
|
"module": "./index.js",
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"typings": "./index.d.ts",
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@emotion/react": "11.14.0",
|
|
14
|
-
"@emotion/styled": "11.14.
|
|
14
|
+
"@emotion/styled": "11.14.1",
|
|
15
15
|
"react": ">= 18.3.1",
|
|
16
16
|
"react-dom": ">= 18.3.1",
|
|
17
17
|
"react-select": "^5.0.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@dfds-ui/hooks": "2.2.0-alpha.
|
|
21
|
-
"@dfds-ui/icons": "2.2.0-alpha.
|
|
22
|
-
"@dfds-ui/react-components": "2.2.0-alpha.
|
|
23
|
-
"@dfds-ui/theme": "2.2.0-alpha.
|
|
24
|
-
"@dfds-ui/typography": "2.2.0-alpha.
|
|
20
|
+
"@dfds-ui/hooks": "2.2.0-alpha.9bb1ab0f",
|
|
21
|
+
"@dfds-ui/icons": "2.2.0-alpha.9bb1ab0f",
|
|
22
|
+
"@dfds-ui/react-components": "2.2.0-alpha.9bb1ab0f",
|
|
23
|
+
"@dfds-ui/theme": "2.2.0-alpha.9bb1ab0f",
|
|
24
|
+
"@dfds-ui/typography": "2.2.0-alpha.9bb1ab0f"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "9bb1ab0fca74964da6edd580e53f175a223b4f49",
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextFieldProps } from '../text-field/TextField';
|
|
3
|
-
export
|
|
3
|
+
export type PasswordFieldProps = Omit<TextFieldProps, 'icon' | 'inputType'>;
|
|
4
4
|
export declare const PasswordField: React.ForwardRefExoticComponent<PasswordFieldProps & React.RefAttributes<HTMLInputElement>>;
|
package/radio/Radio.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
type RadioSize = 'medium' | 'small';
|
|
3
|
+
export type RadioStyleState = 'checked';
|
|
4
|
+
export type RadioProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Field name.
|
|
7
7
|
*/
|
|
@@ -41,7 +41,7 @@ export declare type RadioProps = {
|
|
|
41
41
|
/**
|
|
42
42
|
* Callback when the radio button is checked or unchecked
|
|
43
43
|
*/
|
|
44
|
-
onChange?: JSX.IntrinsicElements['input']['onChange'];
|
|
44
|
+
onChange?: React.JSX.IntrinsicElements['input']['onChange'];
|
|
45
45
|
Icon?: React.ComponentType;
|
|
46
46
|
styledAs?: RadioStyleState;
|
|
47
47
|
};
|