@dfds-ui/forms 2.2.0-alpha.3b2e3359 → 2.2.0-alpha.4d430dbf
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 +5 -4
- package/asterisk/Asterisk.d.ts +3 -3
- package/asterisk/Asterisk.js +13 -5
- package/checkbox/Checkbox.d.ts +15 -15
- package/checkbox/Checkbox.js +46 -37
- package/checkbox/CheckboxContext.d.ts +4 -3
- package/checkbox/CheckboxContext.js +5 -4
- package/checkbox/CheckboxGroup.d.ts +3 -3
- package/checkbox/CheckboxGroup.js +45 -32
- package/cjs/assistive-text/AssistiveText.d.ts +2 -2
- package/cjs/assistive-text/AssistiveText.js +7 -6
- package/cjs/asterisk/Asterisk.d.ts +3 -3
- package/cjs/asterisk/Asterisk.js +11 -10
- package/cjs/checkbox/Checkbox.d.ts +15 -15
- package/cjs/checkbox/Checkbox.js +58 -60
- package/cjs/checkbox/CheckboxContext.d.ts +4 -3
- package/cjs/checkbox/CheckboxContext.js +8 -10
- package/cjs/checkbox/CheckboxGroup.d.ts +3 -3
- package/cjs/checkbox/CheckboxGroup.js +53 -50
- package/cjs/checkbox/index.js +2 -2
- package/cjs/counter/Counter.d.ts +2 -2
- package/cjs/counter/Counter.js +81 -95
- package/cjs/counter/index.js +1 -1
- package/cjs/enhanced/EnhancedField.d.ts +4 -4
- package/cjs/enhanced/EnhancedField.js +40 -43
- package/cjs/enhanced/index.js +1 -1
- package/cjs/error-text/ErrorText.d.ts +2 -2
- package/cjs/error-text/ErrorText.js +7 -6
- package/cjs/field-wrap/FieldWrap.d.ts +3 -3
- package/cjs/field-wrap/FieldWrap.js +39 -33
- package/cjs/field-wrap/index.js +1 -1
- package/cjs/help-icon/HelpIcon.d.ts +3 -3
- package/cjs/help-icon/HelpIcon.js +10 -9
- package/cjs/index.js +19 -19
- package/cjs/label/Label.d.ts +2 -2
- package/cjs/label/Label.js +16 -20
- package/cjs/password-field/PasswordField.d.ts +1 -1
- package/cjs/password-field/PasswordField.js +10 -20
- package/cjs/radio/Radio.d.ts +4 -4
- package/cjs/radio/Radio.js +45 -48
- package/cjs/radio/RadioContext.d.ts +4 -3
- package/cjs/radio/RadioContext.js +8 -10
- package/cjs/radio/RadioGroup.d.ts +3 -3
- package/cjs/radio/RadioGroup.js +40 -32
- package/cjs/radio/index.js +2 -2
- package/cjs/rating/Rating.d.ts +4 -4
- package/cjs/rating/Rating.js +79 -79
- package/cjs/rating/index.js +1 -1
- package/cjs/select-field/AsyncSelectField.d.ts +5 -89
- package/cjs/select-field/AsyncSelectField.js +69 -70
- package/cjs/select-field/CreatableSelectField.d.ts +5 -122
- package/cjs/select-field/CreatableSelectField.js +144 -138
- package/cjs/select-field/NativeSelectField.d.ts +2 -2
- package/cjs/select-field/NativeSelectField.js +36 -40
- package/cjs/select-field/SelectField.d.ts +13 -50
- package/cjs/select-field/SelectField.js +156 -150
- package/cjs/switch/Switch.d.ts +3 -3
- package/cjs/switch/Switch.js +54 -56
- package/cjs/switch/SwitchContext.d.ts +4 -3
- package/cjs/switch/SwitchContext.js +8 -10
- package/cjs/switch/SwitchGroup.d.ts +3 -3
- package/cjs/switch/SwitchGroup.js +26 -18
- package/cjs/switch/index.js +2 -2
- package/cjs/tel-field/TelField.d.ts +9 -9
- package/cjs/tel-field/TelField.js +117 -134
- package/cjs/text-field/TextField.d.ts +18 -18
- package/cjs/text-field/TextField.js +83 -89
- package/cjs/textarea-field/TextareaField.d.ts +10 -10
- package/cjs/textarea-field/TextareaField.js +48 -62
- 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 +68 -64
- package/enhanced/EnhancedField.d.ts +4 -4
- package/enhanced/EnhancedField.js +34 -29
- package/error-text/ErrorText.d.ts +2 -2
- package/error-text/ErrorText.js +5 -4
- package/field-wrap/FieldWrap.d.ts +3 -3
- package/field-wrap/FieldWrap.js +44 -33
- package/help-icon/HelpIcon.d.ts +3 -3
- package/help-icon/HelpIcon.js +8 -7
- package/label/Label.d.ts +2 -2
- package/label/Label.js +13 -6
- package/package.json +12 -12
- package/password-field/PasswordField.d.ts +1 -1
- package/password-field/PasswordField.js +14 -9
- package/radio/Radio.d.ts +4 -4
- package/radio/Radio.js +36 -29
- package/radio/RadioContext.d.ts +4 -3
- package/radio/RadioContext.js +5 -4
- package/radio/RadioGroup.d.ts +3 -3
- package/radio/RadioGroup.js +39 -32
- package/rating/Rating.d.ts +4 -4
- package/rating/Rating.js +84 -72
- package/select-field/AsyncSelectField.d.ts +5 -89
- package/select-field/AsyncSelectField.js +60 -49
- package/select-field/CreatableSelectField.d.ts +5 -122
- package/select-field/CreatableSelectField.js +104 -91
- package/select-field/NativeSelectField.d.ts +2 -2
- package/select-field/NativeSelectField.js +26 -18
- package/select-field/SelectField.d.ts +13 -50
- package/select-field/SelectField.js +113 -98
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +52 -43
- package/switch/SwitchContext.d.ts +4 -3
- package/switch/SwitchContext.js +5 -4
- package/switch/SwitchGroup.d.ts +3 -3
- package/switch/SwitchGroup.js +25 -18
- package/tel-field/TelField.d.ts +9 -9
- package/tel-field/TelField.js +109 -97
- package/text-field/TextField.d.ts +18 -18
- package/text-field/TextField.js +62 -55
- package/textarea-field/TextareaField.d.ts +10 -10
- package/textarea-field/TextareaField.js +31 -25
- package/types/field.d.ts +1 -1
- package/types/size.d.ts +1 -1
|
@@ -1,11 +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
|
+
}) => React.JSX.Element;
|
|
10
11
|
declare const useSwitchContext: () => SwitchContextProps | undefined;
|
|
11
12
|
export default useSwitchContext;
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.SwitchContextProvider = exports.SwitchContext = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
const SwitchContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
12
|
-
exports.SwitchContext = SwitchContext;
|
|
8
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
+
const SwitchContext = exports.SwitchContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
13
11
|
const SwitchContextProvider = ({
|
|
14
12
|
children,
|
|
15
13
|
value = {
|
|
@@ -17,14 +15,14 @@ const SwitchContextProvider = ({
|
|
|
17
15
|
error: false
|
|
18
16
|
}
|
|
19
17
|
}) => {
|
|
20
|
-
return (0,
|
|
21
|
-
value: value
|
|
22
|
-
|
|
18
|
+
return (0, _jsxRuntime.jsx)(SwitchContext.Provider, {
|
|
19
|
+
value: value,
|
|
20
|
+
children: children
|
|
21
|
+
});
|
|
23
22
|
};
|
|
24
23
|
exports.SwitchContextProvider = SwitchContextProvider;
|
|
25
24
|
const useSwitchContext = () => {
|
|
26
25
|
const context = (0, _react.useContext)(SwitchContext);
|
|
27
26
|
return context;
|
|
28
27
|
};
|
|
29
|
-
var _default = useSwitchContext;
|
|
30
|
-
exports.default = _default;
|
|
28
|
+
var _default = exports.default = useSwitchContext;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
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
|
*/
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
} & Pick<SwitchProps, 'size'>;
|
|
10
|
-
export declare const SwitchGroup: ({ size, label, errorMessage, required, hideAsterisk, children, }: SwitchGroupProps) => JSX.Element;
|
|
10
|
+
export declare const SwitchGroup: ({ size, label, errorMessage, required, hideAsterisk, children, }: SwitchGroupProps) => React.JSX.Element;
|
|
@@ -10,22 +10,23 @@ var _Label = require("../label/Label");
|
|
|
10
10
|
var _SwitchContext = require("./SwitchContext");
|
|
11
11
|
var _flexbox = require("@dfds-ui/react-components/flexbox");
|
|
12
12
|
var _ErrorText = _interopRequireDefault(require("../error-text/ErrorText"));
|
|
13
|
-
|
|
13
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
15
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
16
17
|
name: "1qz4298",
|
|
17
18
|
styles: "display:flex;flex-direction:column;border:none;padding:0;margin:0"
|
|
18
19
|
} : {
|
|
19
20
|
name: "7bcvef-SwitchGroupContainer",
|
|
20
|
-
styles: "display:flex;flex-direction:column;border:none;padding:0;margin:0;label:SwitchGroupContainer;",
|
|
21
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zd2l0Y2gvU3dpdGNoR3JvdXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtCWSIsImZpbGUiOiIuLi8uLi8uLi9zcmMvc3dpdGNoL1N3aXRjaEdyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEJhc2VGaWVsZFByb3BzIH0gZnJvbSAnLi4vdHlwZXMnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IFN3aXRjaFByb3BzIH0gZnJvbSAnLi9Td2l0Y2gnXG5pbXBvcnQgeyBMYWJlbCB9IGZyb20gJy4uL2xhYmVsL0xhYmVsJ1xuaW1wb3J0IHsgU3dpdGNoQ29udGV4dFByb3ZpZGVyIH0gZnJvbSAnLi9Td2l0Y2hDb250ZXh0J1xuaW1wb3J0IHsgRmxleEJveCB9IGZyb20gJ0BkZmRzLXVpL3JlYWN0LWNvbXBvbmVudHMvZmxleGJveCdcbmltcG9ydCBFcnJvclRleHQgZnJvbSAnLi4vZXJyb3ItdGV4dC9FcnJvclRleHQnXG5cbmV4cG9ydCB0eXBlIFN3aXRjaEdyb3VwUHJvcHMgPSBQaWNrPEJhc2VGaWVsZFByb3BzLCAnbGFiZWwnIHwgJ2Vycm9yTWVzc2FnZScgfCAnaGl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xkcmVufTwvRmxleEJveD5cbiAgICAgIDwvU3dpdGNoQ29udGV4dFByb3ZpZGVyPlxuICAgICAge2Vycm9yTWVzc2FnZSAmJiA8RXJyb3JUZXh0PntlcnJvck1lc3NhZ2V9PC9FcnJvclRleHQ+fVxuICAgIDwvU3dpdGNoR3JvdXBDb250YWluZXI+XG4gIClcbn1cbiJdfQ== */",
|
|
21
|
+
styles: "display:flex;flex-direction:column;border:none;padding:0;margin:0;label:SwitchGroupContainer;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zd2l0Y2gvU3dpdGNoR3JvdXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtCWSIsImZpbGUiOiIuLi8uLi8uLi9zcmMvc3dpdGNoL1N3aXRjaEdyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEJhc2VGaWVsZFByb3BzIH0gZnJvbSAnLi4vdHlwZXMnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IFN3aXRjaFByb3BzIH0gZnJvbSAnLi9Td2l0Y2gnXG5pbXBvcnQgeyBMYWJlbCB9IGZyb20gJy4uL2xhYmVsL0xhYmVsJ1xuaW1wb3J0IHsgU3dpdGNoQ29udGV4dFByb3ZpZGVyIH0gZnJvbSAnLi9Td2l0Y2hDb250ZXh0J1xuaW1wb3J0IHsgRmxleEJveCB9IGZyb20gJ0BkZmRzLXVpL3JlYWN0LWNvbXBvbmVudHMvZmxleGJveCdcbmltcG9ydCBFcnJvclRleHQgZnJvbSAnLi4vZXJyb3ItdGV4dC9FcnJvclRleHQnXG5cbmV4cG9ydCB0eXBlIFN3aXRjaEdyb3VwUHJvcHMgPSBQaWNrPEJhc2VGaWVsZFByb3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ICAgICAgICA8RmxleEJveCBkaXJlY3Rpb25Db2x1bW4+e2NoaWxkcmVufTwvRmxleEJveD5cbiAgICAgIDwvU3dpdGNoQ29udGV4dFByb3ZpZGVyPlxuICAgICAge2Vycm9yTWVzc2FnZSAmJiA8RXJyb3JUZXh0PntlcnJvck1lc3NhZ2V9PC9FcnJvclRleHQ+fVxuICAgIDwvU3dpdGNoR3JvdXBDb250YWluZXI+XG4gIClcbn1cbiJdfQ== */",
|
|
22
22
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
23
|
};
|
|
24
24
|
const SwitchGroupContainer = ({
|
|
25
25
|
children
|
|
26
|
-
}) => (0,
|
|
27
|
-
css: _ref
|
|
28
|
-
|
|
26
|
+
}) => (0, _jsxRuntime.jsx)("fieldset", {
|
|
27
|
+
css: _ref,
|
|
28
|
+
children: children
|
|
29
|
+
});
|
|
29
30
|
const SwitchGroup = ({
|
|
30
31
|
size = 'medium',
|
|
31
32
|
label,
|
|
@@ -34,17 +35,24 @@ const SwitchGroup = ({
|
|
|
34
35
|
hideAsterisk,
|
|
35
36
|
children
|
|
36
37
|
}) => {
|
|
37
|
-
return (0,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
return (0, _jsxRuntime.jsxs)(SwitchGroupContainer, {
|
|
39
|
+
children: [(0, _jsxRuntime.jsxs)(_SwitchContext.SwitchContextProvider, {
|
|
40
|
+
value: {
|
|
41
|
+
size,
|
|
42
|
+
error: !!errorMessage
|
|
43
|
+
},
|
|
44
|
+
children: [(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
45
|
+
required: required,
|
|
46
|
+
hideAsterisk: hideAsterisk,
|
|
47
|
+
visualSize: size,
|
|
48
|
+
children: label
|
|
49
|
+
}), (0, _jsxRuntime.jsx)(_flexbox.FlexBox, {
|
|
50
|
+
directionColumn: true,
|
|
51
|
+
children: children
|
|
52
|
+
})]
|
|
53
|
+
}), errorMessage && (0, _jsxRuntime.jsx)(_ErrorText.default, {
|
|
54
|
+
children: errorMessage
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
49
57
|
};
|
|
50
58
|
exports.SwitchGroup = SwitchGroup;
|
package/cjs/switch/index.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.keys(_Switch).forEach(function (key) {
|
|
|
9
9
|
if (key in exports && exports[key] === _Switch[key]) return;
|
|
10
10
|
Object.defineProperty(exports, key, {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function
|
|
12
|
+
get: function () {
|
|
13
13
|
return _Switch[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
@@ -20,7 +20,7 @@ Object.keys(_SwitchGroup).forEach(function (key) {
|
|
|
20
20
|
if (key in exports && exports[key] === _SwitchGroup[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function
|
|
23
|
+
get: function () {
|
|
24
24
|
return _SwitchGroup[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
@@ -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;
|