@dfds-ui/forms 2.2.0-alpha.c2f773c5 → 2.2.0-alpha.c79adffa
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 +2 -2
- package/assistive-text/AssistiveText.js +4 -5
- package/asterisk/Asterisk.d.ts +3 -3
- package/asterisk/Asterisk.js +3 -11
- package/checkbox/Checkbox.d.ts +15 -15
- package/checkbox/Checkbox.js +35 -44
- package/checkbox/CheckboxContext.d.ts +3 -4
- package/checkbox/CheckboxContext.js +4 -5
- package/checkbox/CheckboxGroup.d.ts +3 -3
- package/checkbox/CheckboxGroup.js +30 -43
- package/cjs/assistive-text/AssistiveText.d.ts +2 -2
- package/cjs/assistive-text/AssistiveText.js +3 -5
- package/cjs/asterisk/Asterisk.d.ts +3 -3
- package/cjs/asterisk/Asterisk.js +7 -9
- package/cjs/checkbox/Checkbox.d.ts +15 -15
- package/cjs/checkbox/Checkbox.js +56 -56
- package/cjs/checkbox/CheckboxContext.d.ts +3 -4
- package/cjs/checkbox/CheckboxContext.js +5 -6
- package/cjs/checkbox/CheckboxGroup.d.ts +3 -3
- package/cjs/checkbox/CheckboxGroup.js +49 -52
- package/cjs/checkbox/index.js +2 -2
- package/cjs/counter/Counter.d.ts +2 -2
- package/cjs/counter/Counter.js +92 -80
- package/cjs/counter/index.js +1 -1
- package/cjs/enhanced/EnhancedField.d.ts +4 -4
- package/cjs/enhanced/EnhancedField.js +39 -39
- package/cjs/enhanced/index.js +1 -1
- package/cjs/error-text/ErrorText.d.ts +2 -2
- package/cjs/error-text/ErrorText.js +3 -5
- package/cjs/field-wrap/FieldWrap.d.ts +3 -3
- package/cjs/field-wrap/FieldWrap.js +32 -38
- package/cjs/field-wrap/index.js +1 -1
- package/cjs/help-icon/HelpIcon.d.ts +3 -3
- package/cjs/help-icon/HelpIcon.js +6 -8
- package/cjs/index.js +19 -19
- package/cjs/label/Label.d.ts +2 -2
- package/cjs/label/Label.js +19 -15
- package/cjs/password-field/PasswordField.d.ts +1 -1
- package/cjs/password-field/PasswordField.js +15 -7
- package/cjs/radio/Radio.d.ts +4 -4
- package/cjs/radio/Radio.js +44 -43
- package/cjs/radio/RadioContext.d.ts +3 -4
- package/cjs/radio/RadioContext.js +5 -6
- package/cjs/radio/RadioGroup.d.ts +3 -3
- package/cjs/radio/RadioGroup.js +31 -39
- package/cjs/radio/index.js +2 -2
- package/cjs/rating/Rating.d.ts +4 -4
- package/cjs/rating/Rating.js +72 -76
- package/cjs/rating/index.js +1 -1
- package/cjs/select-field/AsyncSelectField.d.ts +89 -5
- package/cjs/select-field/AsyncSelectField.js +65 -66
- package/cjs/select-field/CreatableSelectField.d.ts +122 -5
- package/cjs/select-field/CreatableSelectField.js +133 -141
- package/cjs/select-field/NativeSelectField.d.ts +2 -2
- package/cjs/select-field/NativeSelectField.js +36 -35
- package/cjs/select-field/SelectField.d.ts +50 -13
- package/cjs/select-field/SelectField.js +142 -152
- package/cjs/switch/Switch.d.ts +3 -3
- package/cjs/switch/Switch.js +52 -52
- package/cjs/switch/SwitchContext.d.ts +3 -4
- package/cjs/switch/SwitchContext.js +5 -6
- package/cjs/switch/SwitchGroup.d.ts +3 -3
- package/cjs/switch/SwitchGroup.js +17 -25
- package/cjs/switch/index.js +2 -2
- package/cjs/tel-field/TelField.d.ts +9 -9
- package/cjs/tel-field/TelField.js +129 -115
- package/cjs/text-field/TextField.d.ts +18 -18
- package/cjs/text-field/TextField.js +85 -82
- package/cjs/textarea-field/TextareaField.d.ts +10 -10
- package/cjs/textarea-field/TextareaField.js +57 -46
- package/cjs/types/field.d.ts +1 -1
- package/cjs/types/index.js +2 -2
- package/cjs/types/size.d.ts +1 -1
- package/counter/Counter.d.ts +2 -2
- package/counter/Counter.js +57 -61
- package/enhanced/EnhancedField.d.ts +4 -4
- package/enhanced/EnhancedField.js +27 -32
- package/error-text/ErrorText.d.ts +2 -2
- package/error-text/ErrorText.js +4 -5
- package/field-wrap/FieldWrap.d.ts +3 -3
- package/field-wrap/FieldWrap.js +33 -44
- package/help-icon/HelpIcon.d.ts +3 -3
- package/help-icon/HelpIcon.js +7 -8
- package/label/Label.d.ts +2 -2
- package/label/Label.js +4 -11
- package/package.json +12 -12
- package/password-field/PasswordField.d.ts +1 -1
- package/password-field/PasswordField.js +4 -9
- package/radio/Radio.d.ts +4 -4
- package/radio/Radio.js +26 -33
- package/radio/RadioContext.d.ts +3 -4
- package/radio/RadioContext.js +4 -5
- package/radio/RadioGroup.d.ts +3 -3
- package/radio/RadioGroup.js +32 -39
- package/rating/Rating.d.ts +4 -4
- package/rating/Rating.js +64 -76
- package/select-field/AsyncSelectField.d.ts +89 -5
- package/select-field/AsyncSelectField.js +46 -57
- package/select-field/CreatableSelectField.d.ts +122 -5
- package/select-field/CreatableSelectField.js +87 -100
- package/select-field/NativeSelectField.d.ts +2 -2
- package/select-field/NativeSelectField.js +16 -24
- package/select-field/SelectField.d.ts +50 -13
- package/select-field/SelectField.js +96 -111
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +41 -50
- package/switch/SwitchContext.d.ts +3 -4
- package/switch/SwitchContext.js +4 -5
- package/switch/SwitchGroup.d.ts +3 -3
- package/switch/SwitchGroup.js +18 -25
- package/tel-field/TelField.d.ts +9 -9
- package/tel-field/TelField.js +86 -98
- package/text-field/TextField.d.ts +18 -18
- package/text-field/TextField.js +52 -59
- package/textarea-field/TextareaField.d.ts +10 -10
- package/textarea-field/TextareaField.js +18 -24
- package/types/field.d.ts +1 -1
- package/types/size.d.ts +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SwitchProps } from './Switch';
|
|
3
|
-
type SwitchContextProps = Required<Pick<SwitchProps, 'size' | 'error'>> & {
|
|
3
|
+
declare 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: React.FC<{
|
|
8
8
|
value: SwitchContextProps;
|
|
9
|
-
|
|
10
|
-
}) => React.JSX.Element;
|
|
9
|
+
}>;
|
|
11
10
|
declare const useSwitchContext: () => SwitchContextProps | undefined;
|
|
12
11
|
export default useSwitchContext;
|
package/switch/SwitchContext.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext } from 'react';
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
3
3
|
export var SwitchContext = /*#__PURE__*/createContext(undefined);
|
|
4
4
|
export var SwitchContextProvider = function SwitchContextProvider(_ref) {
|
|
5
5
|
var children = _ref.children,
|
|
@@ -8,10 +8,9 @@ export var SwitchContextProvider = function SwitchContextProvider(_ref) {
|
|
|
8
8
|
size: 'medium',
|
|
9
9
|
error: false
|
|
10
10
|
} : _ref$value;
|
|
11
|
-
return
|
|
12
|
-
value: value
|
|
13
|
-
|
|
14
|
-
});
|
|
11
|
+
return ___EmotionJSX(SwitchContext.Provider, {
|
|
12
|
+
value: value
|
|
13
|
+
}, children);
|
|
15
14
|
};
|
|
16
15
|
var useSwitchContext = function useSwitchContext() {
|
|
17
16
|
var context = useContext(SwitchContext);
|
package/switch/SwitchGroup.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { BaseFieldProps } from '../types';
|
|
3
3
|
import { SwitchProps } from './Switch';
|
|
4
|
-
export type SwitchGroupProps = Pick<BaseFieldProps, 'label' | 'errorMessage' | 'hideAsterisk' | 'required'> & {
|
|
4
|
+
export declare type SwitchGroupProps = Pick<BaseFieldProps, 'label' | 'errorMessage' | 'hideAsterisk' | 'required'> & {
|
|
5
5
|
/**
|
|
6
6
|
* JSX enclosed by the group.
|
|
7
7
|
*/
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
} & Pick<SwitchProps, 'size'>;
|
|
10
|
-
export declare const SwitchGroup: ({ size, label, errorMessage, required, hideAsterisk, children, }: SwitchGroupProps) =>
|
|
10
|
+
export declare const SwitchGroup: ({ size, label, errorMessage, required, hideAsterisk, children, }: SwitchGroupProps) => JSX.Element;
|
package/switch/SwitchGroup.js
CHANGED
|
@@ -5,21 +5,21 @@ import { Label } from '../label/Label';
|
|
|
5
5
|
import { SwitchContextProvider } from './SwitchContext';
|
|
6
6
|
import { FlexBox } from '@dfds-ui/react-components/flexbox';
|
|
7
7
|
import ErrorText from '../error-text/ErrorText';
|
|
8
|
-
import { jsx as
|
|
8
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
9
9
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
10
10
|
name: "1qz4298",
|
|
11
11
|
styles: "display:flex;flex-direction:column;border:none;padding:0;margin:0"
|
|
12
12
|
} : {
|
|
13
13
|
name: "7bcvef-SwitchGroupContainer",
|
|
14
|
-
styles: "display:flex;flex-direction:column;border:none;padding:0;margin:0;label:SwitchGroupContainer
|
|
14
|
+
styles: "display:flex;flex-direction:column;border:none;padding:0;margin:0;label:SwitchGroupContainer;",
|
|
15
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zd2l0Y2gvU3dpdGNoR3JvdXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtCWSIsImZpbGUiOiIuLi8uLi9zcmMvc3dpdGNoL1N3aXRjaEdyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEJhc2VGaWVsZFByb3BzIH0gZnJvbSAnLi4vdHlwZXMnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvb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3NhZ2UsXG4gIHJlcXVpcmVkLFxuICBoaWRlQXN0ZXJpc2ssXG4gIGNoaWxkcmVuLFxufTogU3dpdGNoR3JvdXBQcm9wcykgPT4ge1xuICByZXR1cm4gKFxuICAgIDxTd2l0Y2hHcm91cENvbnRhaW5lcj5cbiAgICAgIDxTd2l0Y2hDb250ZXh0UHJvdmlkZXIgdmFsdWU9e3sgc2l6ZSwgZXJyb3I6ICEhZXJyb3JNZXNzYWdlIH19PlxuICAgICAgICA8TGFiZWwgcmVxdWlyZWQ9e3JlcXVpcmVkfSBoaWRlQXN0ZXJpc2s9e2hpZGVBc3Rlcmlza30gdmlzdWFsU2l6ZT17c2l6ZX0+XG4gICAgICAgICAge2xhYmVsfVxuICAgICAgICA8L0xhYmVsPlxuICAgICAgICA8RmxleEJveCBkaXJlY3Rpb25Db2x1bW4+e2NoaWxkcmVufTwvRmxleEJveD5cbiAgICAgIDwvU3dpdGNoQ29udGV4dFByb3ZpZGVyPlxuICAgICAge2Vycm9yTWVzc2FnZSAmJiA8RXJyb3JUZXh0PntlcnJvck1lc3NhZ2V9PC9FcnJvclRleHQ+fVxuICAgIDwvU3dpdGNoR3JvdXBDb250YWluZXI+XG4gIClcbn1cbiJdfQ== */",
|
|
15
16
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
17
|
};
|
|
17
18
|
var SwitchGroupContainer = function SwitchGroupContainer(_ref2) {
|
|
18
19
|
var children = _ref2.children;
|
|
19
|
-
return
|
|
20
|
-
css: _ref
|
|
21
|
-
|
|
22
|
-
});
|
|
20
|
+
return ___EmotionJSX("fieldset", {
|
|
21
|
+
css: _ref
|
|
22
|
+
}, children);
|
|
23
23
|
};
|
|
24
24
|
export var SwitchGroup = function SwitchGroup(_ref3) {
|
|
25
25
|
var _ref3$size = _ref3.size,
|
|
@@ -29,23 +29,16 @@ export var SwitchGroup = function SwitchGroup(_ref3) {
|
|
|
29
29
|
required = _ref3.required,
|
|
30
30
|
hideAsterisk = _ref3.hideAsterisk,
|
|
31
31
|
children = _ref3.children;
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
directionColumn: true,
|
|
45
|
-
children: children
|
|
46
|
-
})]
|
|
47
|
-
}), errorMessage && _jsx(ErrorText, {
|
|
48
|
-
children: errorMessage
|
|
49
|
-
})]
|
|
50
|
-
});
|
|
32
|
+
return ___EmotionJSX(SwitchGroupContainer, null, ___EmotionJSX(SwitchContextProvider, {
|
|
33
|
+
value: {
|
|
34
|
+
size: size,
|
|
35
|
+
error: !!errorMessage
|
|
36
|
+
}
|
|
37
|
+
}, ___EmotionJSX(Label, {
|
|
38
|
+
required: required,
|
|
39
|
+
hideAsterisk: hideAsterisk,
|
|
40
|
+
visualSize: size
|
|
41
|
+
}, label), ___EmotionJSX(FlexBox, {
|
|
42
|
+
directionColumn: true
|
|
43
|
+
}, children)), errorMessage && ___EmotionJSX(ErrorText, null, errorMessage));
|
|
51
44
|
};
|
package/tel-field/TelField.d.ts
CHANGED
|
@@ -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 type TelFieldProps = BaseFieldProps & {
|
|
4
|
+
export declare type TelFieldProps = BaseFieldProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Class name to be added to the TelField.
|
|
7
7
|
*/
|
|
@@ -31,37 +31,37 @@ export type TelFieldProps = BaseFieldProps & {
|
|
|
31
31
|
*/
|
|
32
32
|
onBlur?: () => void;
|
|
33
33
|
};
|
|
34
|
-
export type TelFieldElement = {
|
|
34
|
+
export declare 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 | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Default value for the phone number
|
|
44
44
|
*/
|
|
45
|
-
defaultValue?: string;
|
|
45
|
+
defaultValue?: string | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Default locale. Will set the matching country in the dropdown
|
|
48
48
|
*/
|
|
49
|
-
defaultLocale?:
|
|
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;
|
|
50
50
|
/**
|
|
51
51
|
* Show trunk values (the local area code shown in parenthesis)
|
|
52
52
|
*/
|
|
53
|
-
showTrunkValues?: boolean;
|
|
53
|
+
showTrunkValues?: boolean | undefined;
|
|
54
54
|
/**
|
|
55
55
|
* Makes value splitted so easier to convert to object
|
|
56
56
|
*/
|
|
57
|
-
splitValues?: boolean;
|
|
57
|
+
splitValues?: boolean | undefined;
|
|
58
58
|
/**
|
|
59
59
|
* Callback when value changes
|
|
60
60
|
*/
|
|
61
|
-
onChange?: (newValue: string) => void;
|
|
61
|
+
onChange?: ((newValue: string) => void) | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* Callback when blur
|
|
64
64
|
*/
|
|
65
|
-
onBlur?: () => void;
|
|
65
|
+
onBlur?: (() => void) | undefined;
|
|
66
66
|
} & React.RefAttributes<TelFieldElement>>;
|
|
67
67
|
export default TelField;
|