@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.
Files changed (63) hide show
  1. package/assistive-text/AssistiveText.d.ts +1 -1
  2. package/asterisk/Asterisk.d.ts +1 -1
  3. package/checkbox/Checkbox.d.ts +4 -4
  4. package/checkbox/Checkbox.js +7 -7
  5. package/checkbox/CheckboxContext.d.ts +3 -3
  6. package/checkbox/CheckboxGroup.d.ts +1 -1
  7. package/cjs/assistive-text/AssistiveText.d.ts +1 -1
  8. package/cjs/asterisk/Asterisk.d.ts +1 -1
  9. package/cjs/checkbox/Checkbox.d.ts +4 -4
  10. package/cjs/checkbox/Checkbox.js +7 -7
  11. package/cjs/checkbox/CheckboxContext.d.ts +3 -3
  12. package/cjs/checkbox/CheckboxGroup.d.ts +1 -1
  13. package/cjs/counter/Counter.d.ts +2 -2
  14. package/cjs/enhanced/EnhancedField.d.ts +3 -3
  15. package/cjs/error-text/ErrorText.d.ts +1 -1
  16. package/cjs/field-wrap/FieldWrap.d.ts +1 -1
  17. package/cjs/help-icon/HelpIcon.d.ts +1 -1
  18. package/cjs/label/Label.d.ts +1 -1
  19. package/cjs/password-field/PasswordField.d.ts +1 -1
  20. package/cjs/radio/Radio.d.ts +4 -4
  21. package/cjs/radio/Radio.js +7 -7
  22. package/cjs/radio/RadioContext.d.ts +3 -3
  23. package/cjs/radio/RadioGroup.d.ts +1 -1
  24. package/cjs/rating/Rating.d.ts +3 -3
  25. package/cjs/select-field/AsyncSelectField.d.ts +4 -100
  26. package/cjs/select-field/CreatableSelectField.d.ts +4 -133
  27. package/cjs/select-field/NativeSelectField.d.ts +1 -1
  28. package/cjs/select-field/SelectField.d.ts +11 -48
  29. package/cjs/switch/Switch.d.ts +2 -2
  30. package/cjs/switch/Switch.js +12 -12
  31. package/cjs/switch/SwitchContext.d.ts +3 -3
  32. package/cjs/switch/SwitchGroup.d.ts +1 -1
  33. package/cjs/tel-field/TelField.d.ts +9 -9
  34. package/cjs/text-field/TextField.d.ts +18 -18
  35. package/cjs/textarea-field/TextareaField.d.ts +10 -10
  36. package/cjs/types/field.d.ts +1 -1
  37. package/cjs/types/size.d.ts +1 -1
  38. package/counter/Counter.d.ts +2 -2
  39. package/enhanced/EnhancedField.d.ts +3 -3
  40. package/error-text/ErrorText.d.ts +1 -1
  41. package/field-wrap/FieldWrap.d.ts +1 -1
  42. package/help-icon/HelpIcon.d.ts +1 -1
  43. package/label/Label.d.ts +1 -1
  44. package/package.json +8 -8
  45. package/password-field/PasswordField.d.ts +1 -1
  46. package/radio/Radio.d.ts +4 -4
  47. package/radio/Radio.js +7 -7
  48. package/radio/RadioContext.d.ts +3 -3
  49. package/radio/RadioGroup.d.ts +1 -1
  50. package/rating/Rating.d.ts +3 -3
  51. package/select-field/AsyncSelectField.d.ts +4 -100
  52. package/select-field/CreatableSelectField.d.ts +4 -133
  53. package/select-field/NativeSelectField.d.ts +1 -1
  54. package/select-field/SelectField.d.ts +11 -48
  55. package/switch/Switch.d.ts +2 -2
  56. package/switch/Switch.js +16 -16
  57. package/switch/SwitchContext.d.ts +3 -3
  58. package/switch/SwitchGroup.d.ts +1 -1
  59. package/tel-field/TelField.d.ts +9 -9
  60. package/text-field/TextField.d.ts +18 -18
  61. package/textarea-field/TextareaField.d.ts +10 -10
  62. package/types/field.d.ts +1 -1
  63. package/types/size.d.ts +1 -1
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { SwitchProps } from './Switch';
3
- declare type SwitchContextProps = Required<Pick<SwitchProps, 'size' | 'error'>> & {
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: React.FC<{
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 declare type SwitchGroupProps = Pick<BaseFieldProps, 'label' | 'errorMessage' | 'hideAsterisk' | 'required'> & {
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 declare type TelFieldProps = BaseFieldProps & {
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 declare type TelFieldElement = {
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 | undefined;
41
+ className?: string;
42
42
  /**
43
43
  * Default value for the phone number
44
44
  */
45
- defaultValue?: string | undefined;
45
+ defaultValue?: string;
46
46
  /**
47
47
  * Default locale. Will set the matching country in the dropdown
48
48
  */
49
- defaultLocale?: "en" | "nl-BE" | "bg-BG" | "pt-BR" | "en-CA" | "zh-CN" | "cs-CZ" | "da-DK" | "et-EE" | "fi-FI" | "fr-BE" | "fr-FR" | "fr-MA" | "de-DE" | "hu-HU" | "it-IT" | "ja-JP" | "lv-LV" | "lt-LT" | "nl-NL" | "nb-NO" | "pl-PL" | "ro-RO" | "ru-RU" | "sk-SK" | "ko-KR" | "es-ES" | "sv-SE" | "tr-TR" | "en-GB" | "en-US" | undefined;
49
+ defaultLocale?: Locale;
50
50
  /**
51
51
  * Show trunk values (the local area code shown in parenthesis)
52
52
  */
53
- showTrunkValues?: boolean | undefined;
53
+ showTrunkValues?: boolean;
54
54
  /**
55
55
  * Makes value splitted so easier to convert to object
56
56
  */
57
- splitValues?: boolean | undefined;
57
+ splitValues?: boolean;
58
58
  /**
59
59
  * Callback when value changes
60
60
  */
61
- onChange?: ((newValue: string) => void) | undefined;
61
+ onChange?: (newValue: string) => void;
62
62
  /**
63
63
  * Callback when blur
64
64
  */
65
- onBlur?: (() => void) | undefined;
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 declare type TextFieldProps = BaseFieldProps & {
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 | undefined;
32
- defaultValue?: string | undefined;
31
+ autoFocus?: boolean;
32
+ defaultValue?: string;
33
33
  prefix?: React.ReactNode;
34
34
  suffix?: React.ReactNode;
35
- icon?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
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 | undefined;
43
- value?: string | undefined;
44
- visualSize?: Size | undefined;
45
- onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
46
- onFocus?: ((event: React.FocusEvent<HTMLInputElement>) => void) | undefined;
47
- onBlur?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
48
- inputType?: "number" | "search" | "time" | "text" | "tel" | "url" | "email" | "date" | "file" | "password" | undefined;
49
- autoComplete?: string | undefined;
50
- minValue?: string | undefined;
51
- maxValue?: string | undefined;
52
- maxLength?: number | undefined;
53
- minLength?: number | undefined;
54
- readOnly?: boolean | undefined;
55
- step?: number | "any" | undefined;
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, { ChangeEvent } from '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
- declare type FieldSize = Extract<Size, 'small' | 'medium'>;
14
- export declare type TextareaFieldProps = BaseFieldProps & {
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 | undefined;
31
- size?: FieldSize | undefined;
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 | undefined;
35
+ maxValueLength?: number;
36
36
  /**
37
37
  * Whether to show the length counter at the bottom right
38
38
  */
39
- showLengthCounter?: boolean | undefined;
40
- value?: string | undefined;
41
- onChange?: ((event: React.ChangeEvent<HTMLTextAreaElement>) => void) | undefined;
42
- rows?: number | undefined;
39
+ showLengthCounter?: boolean;
40
+ value?: string;
41
+ onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
42
+ rows?: number;
43
43
  } & React.RefAttributes<HTMLTextAreaElement>>;
44
44
  export {};
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  /**
3
3
  * Generic FieldProps
4
4
  */
5
- export declare type BaseFieldProps = {
5
+ export type BaseFieldProps = {
6
6
  /**
7
7
  * Assistive text describing the field.
8
8
  *
@@ -1 +1 @@
1
- export declare type Size = 'small' | 'medium' | 'large';
1
+ export type Size = 'small' | 'medium' | 'large';
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
- declare type Size = 's' | 'm';
3
- export declare type CounterProps = {
2
+ type Size = 's' | 'm';
3
+ export type CounterProps = {
4
4
  /**
5
5
  * Minimum value
6
6
  */
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- declare type ReactInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
3
- export declare type EnhancedInputProps<TValue> = Omit<EnhancedFieldProps, 'value'> & {
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 declare type EnhancedFieldProps = Omit<ReactInputProps, 'size' | 'css'> & {
6
+ export type EnhancedFieldProps = Omit<ReactInputProps, 'size' | 'css'> & {
7
7
  name?: string;
8
8
  /**
9
9
  * Label to be displayed
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type ErrorTextProps = {
2
+ export type ErrorTextProps = {
3
3
  id?: string;
4
4
  children: React.ReactNode;
5
5
  className?: string;
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { BaseFieldProps, Size } from '../types';
3
- export declare type FieldWrapProps = BaseFieldProps & {
3
+ export type FieldWrapProps = BaseFieldProps & {
4
4
  size: Size;
5
5
  extraAssistiveText?: string;
6
6
  disabled?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type HelpIconProps = {
2
+ export type HelpIconProps = {
3
3
  content: string;
4
4
  className?: string;
5
5
  disabled?: boolean;
package/label/Label.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { Size } from '../types';
3
- export declare type LabelProps = {
3
+ export type LabelProps = {
4
4
  children: ReactNode;
5
5
  className?: string;
6
6
  hideAsterisk?: boolean;
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.98e68873",
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.0",
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.98e68873",
21
- "@dfds-ui/icons": "2.2.0-alpha.98e68873",
22
- "@dfds-ui/react-components": "2.2.0-alpha.98e68873",
23
- "@dfds-ui/theme": "2.2.0-alpha.98e68873",
24
- "@dfds-ui/typography": "2.2.0-alpha.98e68873"
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": "98e68873ace8ad4db37fd407dfe757396da57ac8",
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 declare type PasswordFieldProps = Omit<TextFieldProps, 'icon' | 'inputType'>;
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
- declare type RadioSize = 'medium' | 'small';
3
- export declare type RadioStyleState = 'checked';
4
- export declare type RadioProps = {
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
  };