@dfds-ui/forms 2.2.1 → 3.0.0
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 +18 -17
- package/checkbox/Checkbox.js +47 -39
- 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 +18 -17
- 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 +4 -3
- package/cjs/counter/Counter.js +85 -99
- package/cjs/counter/index.js +1 -1
- package/cjs/enhanced/EnhancedField.d.ts +4 -4
- package/cjs/enhanced/EnhancedField.js +44 -45
- 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 +2 -2
- package/cjs/password-field/PasswordField.js +11 -21
- package/cjs/radio/Radio.d.ts +7 -6
- 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 +5 -6
- package/cjs/rating/Rating.js +92 -87
- package/cjs/rating/index.js +1 -1
- package/cjs/select-field/AsyncSelectField.d.ts +5 -90
- package/cjs/select-field/AsyncSelectField.js +69 -75
- package/cjs/select-field/CreatableSelectField.d.ts +5 -123
- package/cjs/select-field/CreatableSelectField.js +144 -143
- package/cjs/select-field/NativeSelectField.d.ts +2 -2
- package/cjs/select-field/NativeSelectField.js +38 -42
- package/cjs/select-field/SelectField.d.ts +13 -51
- package/cjs/select-field/SelectField.js +156 -155
- package/cjs/switch/Switch.d.ts +4 -3
- package/cjs/switch/Switch.js +55 -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 +4 -32
- package/cjs/tel-field/TelField.js +121 -136
- package/cjs/text-field/TextField.d.ts +3 -28
- package/cjs/text-field/TextField.js +84 -90
- package/cjs/textarea-field/TextareaField.d.ts +5 -18
- 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 +4 -3
- package/counter/Counter.js +75 -72
- package/enhanced/EnhancedField.d.ts +4 -4
- package/enhanced/EnhancedField.js +40 -34
- 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 +2 -2
- package/password-field/PasswordField.js +18 -14
- package/radio/Radio.d.ts +7 -6
- package/radio/Radio.js +37 -31
- 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 +5 -6
- package/rating/Rating.js +96 -81
- package/select-field/AsyncSelectField.d.ts +5 -90
- package/select-field/AsyncSelectField.js +62 -56
- package/select-field/CreatableSelectField.d.ts +5 -123
- package/select-field/CreatableSelectField.js +106 -99
- package/select-field/NativeSelectField.d.ts +2 -2
- package/select-field/NativeSelectField.js +29 -22
- package/select-field/SelectField.d.ts +13 -51
- package/select-field/SelectField.js +115 -106
- package/switch/Switch.d.ts +4 -3
- package/switch/Switch.js +57 -47
- 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 +4 -32
- package/tel-field/TelField.js +116 -103
- package/text-field/TextField.d.ts +3 -28
- package/text-field/TextField.js +64 -58
- package/textarea-field/TextareaField.d.ts +5 -18
- package/textarea-field/TextareaField.js +34 -29
- package/types/field.d.ts +1 -1
- package/types/size.d.ts +1 -1
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
function
|
|
2
|
-
function
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
6
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
7
|
-
function _arrayWithHoles(
|
|
8
|
-
import React, {
|
|
9
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import React, { useState } from 'react';
|
|
9
14
|
import { css } from '@emotion/react';
|
|
10
15
|
import { theme } from '@dfds-ui/theme';
|
|
11
16
|
import { Show, Hide } from '@dfds-ui/icons/system';
|
|
12
17
|
import TextField from '../text-field/TextField';
|
|
13
|
-
import { jsx as
|
|
14
|
-
export var PasswordField =
|
|
18
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
19
|
+
export var PasswordField = function PasswordField(props) {
|
|
15
20
|
var _useState = useState(false),
|
|
16
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
22
|
visible = _useState2[0],
|
|
18
23
|
setVisible = _useState2[1];
|
|
19
24
|
var ToggleButton = function ToggleButton() {
|
|
20
25
|
var Icon = visible ? Show : Hide;
|
|
21
|
-
return
|
|
26
|
+
return _jsx(Icon, {
|
|
22
27
|
onClick: function onClick() {
|
|
23
28
|
return setVisible(!visible);
|
|
24
29
|
},
|
|
25
|
-
css: /*#__PURE__*/css("pointer-events:all;cursor:pointer;color:", theme.colors.text.dark.primary, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:ToggleButton;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
30
|
+
css: /*#__PURE__*/css("pointer-events:all;cursor:pointer;color:", theme.colors.text.dark.primary, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:ToggleButton;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXNzd29yZC1maWVsZC9QYXNzd29yZEZpZWxkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQmdCIiwiZmlsZSI6Ii4uLy4uL3NyYy9wYXNzd29yZC1maWVsZC9QYXNzd29yZEZpZWxkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gJ0BkZmRzLXVpL3RoZW1lJ1xuaW1wb3J0IHsgU2hvdywgSGlkZSB9IGZyb20gJ0BkZmRzLXVpL2ljb25zL3N5c3RlbSdcbmltcG9ydCB7IFRleHRGaWVsZFByb3BzIH0gZnJvbSAnLi4vdGV4dC1maWVsZC9UZXh0RmllbGQnXG5pbXBvcnQgVGV4dEZpZWxkIGZyb20gJy4uL3RleHQtZmllbGQvVGV4dEZpZWxkJ1xuXG5leHBvcnQgdHlwZSBQYXNzd29yZEZpZWxkUHJvcHMgPSBPbWl0PFRleHRGaWVsZFByb3BzLCAnaWNvbicgfCAnaW5wdXRUeXBlJz5cblxuZXhwb3J0IGNvbnN0IFBhc3N3b3JkRmllbGQgPSAocHJvcHM6IFBhc3N3b3JkRmllbGRQcm9wcykgPT4ge1xuICBjb25zdCBbdmlzaWJsZSwgc2V0VmlzaWJsZV0gPSB1c2VTdGF0ZShmYWxzZSlcblxuICBjb25zdCBUb2dnbGVCdXR0b24gPSAoKSA9PiB7XG4gICAgY29uc3QgSWNvbiA9IHZpc2libGUgPyBTaG93IDogSGlkZVxuICAgIHJldHVybiAoXG4gICAgICA8SWNvblxuICAgICAgICBvbkNsaWNrPXsoKSA9PiBzZXRWaXNpYmxlKCF2aXNpYmxlKX1cbiAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgcG9pbnRlci1ldmVudHM6IGFsbDtcbiAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgICAgY29sb3I6ICR7dGhlbWUuY29sb3JzLnRleHQuZGFyay5wcmltYXJ5fTtcbiAgICAgICAgYH1cbiAgICAgIC8+XG4gICAgKVxuICB9XG5cbiAgcmV0dXJuIDxUZXh0RmllbGQgey4uLnByb3BzfSBpbnB1dFR5cGU9e3Zpc2libGUgPyAndGV4dCcgOiAncGFzc3dvcmQnfSBpY29uPXtUb2dnbGVCdXR0b259IC8+XG59XG4iXX0= */")
|
|
26
31
|
});
|
|
27
32
|
};
|
|
28
|
-
return
|
|
29
|
-
ref: ref,
|
|
33
|
+
return _jsx(TextField, _objectSpread(_objectSpread({}, props), {}, {
|
|
30
34
|
inputType: visible ? 'text' : 'password',
|
|
31
35
|
icon: ToggleButton
|
|
32
36
|
}));
|
|
33
|
-
}
|
|
37
|
+
};
|
package/radio/Radio.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
5
6
|
/**
|
|
6
7
|
* Field name.
|
|
7
8
|
*/
|
|
@@ -41,11 +42,11 @@ export declare type RadioProps = {
|
|
|
41
42
|
/**
|
|
42
43
|
* Callback when the radio button is checked or unchecked
|
|
43
44
|
*/
|
|
44
|
-
onChange?: JSX.IntrinsicElements['input']['onChange'];
|
|
45
|
+
onChange?: React.JSX.IntrinsicElements['input']['onChange'];
|
|
45
46
|
Icon?: React.ComponentType;
|
|
46
47
|
styledAs?: RadioStyleState;
|
|
47
48
|
};
|
|
48
|
-
export declare const Radio:
|
|
49
|
+
export declare const Radio: ({ name, label, className, checked, disabled, defaultChecked, value, onChange, error: errorProp, visualSize: visualSizeProp, Icon, styledAs, ...rest }: RadioProps) => React.JSX.Element;
|
|
49
50
|
/** @deprecated Use Radio */
|
|
50
|
-
export declare const RadioField:
|
|
51
|
+
export declare const RadioField: ({ name, label, className, checked, disabled, defaultChecked, value, onChange, error: errorProp, visualSize: visualSizeProp, Icon, styledAs, ...rest }: RadioProps) => React.JSX.Element;
|
|
51
52
|
export {};
|