@dfds-ui/forms 2.2.0-alpha.6205287b → 2.2.0-alpha.6caab7fc

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 (104) hide show
  1. package/assistive-text/AssistiveText.d.ts +2 -2
  2. package/asterisk/Asterisk.d.ts +3 -3
  3. package/checkbox/Checkbox.d.ts +4 -4
  4. package/checkbox/Checkbox.js +7 -7
  5. package/checkbox/CheckboxContext.d.ts +4 -3
  6. package/checkbox/CheckboxGroup.d.ts +3 -3
  7. package/checkbox/CheckboxGroup.js +2 -4
  8. package/cjs/assistive-text/AssistiveText.d.ts +2 -2
  9. package/cjs/asterisk/Asterisk.d.ts +3 -3
  10. package/cjs/asterisk/Asterisk.js +3 -3
  11. package/cjs/checkbox/Checkbox.d.ts +4 -4
  12. package/cjs/checkbox/Checkbox.js +24 -29
  13. package/cjs/checkbox/CheckboxContext.d.ts +4 -3
  14. package/cjs/checkbox/CheckboxContext.js +1 -1
  15. package/cjs/checkbox/CheckboxGroup.d.ts +3 -3
  16. package/cjs/checkbox/CheckboxGroup.js +16 -23
  17. package/cjs/checkbox/index.js +2 -2
  18. package/cjs/counter/Counter.d.ts +2 -2
  19. package/cjs/counter/Counter.js +34 -50
  20. package/cjs/counter/index.js +1 -1
  21. package/cjs/enhanced/EnhancedField.d.ts +4 -4
  22. package/cjs/enhanced/EnhancedField.js +16 -19
  23. package/cjs/enhanced/index.js +1 -1
  24. package/cjs/error-text/ErrorText.d.ts +2 -2
  25. package/cjs/field-wrap/FieldWrap.d.ts +3 -3
  26. package/cjs/field-wrap/FieldWrap.js +2 -4
  27. package/cjs/field-wrap/index.js +1 -1
  28. package/cjs/help-icon/HelpIcon.d.ts +3 -3
  29. package/cjs/index.js +19 -19
  30. package/cjs/label/Label.d.ts +2 -2
  31. package/cjs/label/Label.js +9 -15
  32. package/cjs/password-field/PasswordField.d.ts +1 -1
  33. package/cjs/password-field/PasswordField.js +2 -11
  34. package/cjs/radio/Radio.d.ts +4 -4
  35. package/cjs/radio/Radio.js +22 -26
  36. package/cjs/radio/RadioContext.d.ts +4 -3
  37. package/cjs/radio/RadioContext.js +1 -1
  38. package/cjs/radio/RadioGroup.d.ts +3 -3
  39. package/cjs/radio/RadioGroup.js +2 -4
  40. package/cjs/radio/index.js +2 -2
  41. package/cjs/rating/Rating.d.ts +4 -4
  42. package/cjs/rating/Rating.js +7 -19
  43. package/cjs/rating/index.js +1 -1
  44. package/cjs/select-field/AsyncSelectField.d.ts +5 -89
  45. package/cjs/select-field/AsyncSelectField.js +21 -28
  46. package/cjs/select-field/CreatableSelectField.d.ts +5 -122
  47. package/cjs/select-field/CreatableSelectField.js +57 -67
  48. package/cjs/select-field/NativeSelectField.d.ts +2 -2
  49. package/cjs/select-field/NativeSelectField.js +17 -21
  50. package/cjs/select-field/SelectField.d.ts +13 -50
  51. package/cjs/select-field/SelectField.js +59 -71
  52. package/cjs/switch/Switch.d.ts +3 -3
  53. package/cjs/switch/Switch.js +24 -31
  54. package/cjs/switch/SwitchContext.d.ts +4 -3
  55. package/cjs/switch/SwitchContext.js +1 -1
  56. package/cjs/switch/SwitchGroup.d.ts +3 -3
  57. package/cjs/switch/SwitchGroup.js +1 -2
  58. package/cjs/switch/index.js +2 -2
  59. package/cjs/tel-field/TelField.d.ts +9 -9
  60. package/cjs/tel-field/TelField.js +37 -66
  61. package/cjs/text-field/TextField.d.ts +18 -18
  62. package/cjs/text-field/TextField.js +36 -45
  63. package/cjs/textarea-field/TextareaField.d.ts +10 -10
  64. package/cjs/textarea-field/TextareaField.js +23 -38
  65. package/cjs/types/field.d.ts +1 -1
  66. package/cjs/types/index.js +2 -2
  67. package/cjs/types/size.d.ts +1 -1
  68. package/counter/Counter.d.ts +2 -2
  69. package/counter/Counter.js +3 -6
  70. package/enhanced/EnhancedField.d.ts +4 -4
  71. package/enhanced/EnhancedField.js +3 -6
  72. package/error-text/ErrorText.d.ts +2 -2
  73. package/field-wrap/FieldWrap.d.ts +3 -3
  74. package/field-wrap/FieldWrap.js +2 -4
  75. package/help-icon/HelpIcon.d.ts +3 -3
  76. package/label/Label.d.ts +2 -2
  77. package/package.json +12 -12
  78. package/password-field/PasswordField.d.ts +1 -1
  79. package/radio/Radio.d.ts +4 -4
  80. package/radio/Radio.js +7 -7
  81. package/radio/RadioContext.d.ts +4 -3
  82. package/radio/RadioGroup.d.ts +3 -3
  83. package/radio/RadioGroup.js +2 -4
  84. package/rating/Rating.d.ts +4 -4
  85. package/rating/Rating.js +3 -6
  86. package/select-field/AsyncSelectField.d.ts +5 -89
  87. package/select-field/AsyncSelectField.js +2 -4
  88. package/select-field/CreatableSelectField.d.ts +5 -122
  89. package/select-field/CreatableSelectField.js +3 -6
  90. package/select-field/NativeSelectField.d.ts +2 -2
  91. package/select-field/SelectField.d.ts +13 -50
  92. package/select-field/SelectField.js +4 -8
  93. package/switch/Switch.d.ts +3 -3
  94. package/switch/Switch.js +16 -19
  95. package/switch/SwitchContext.d.ts +4 -3
  96. package/switch/SwitchGroup.d.ts +3 -3
  97. package/switch/SwitchGroup.js +1 -2
  98. package/tel-field/TelField.d.ts +9 -9
  99. package/tel-field/TelField.js +7 -14
  100. package/text-field/TextField.d.ts +18 -18
  101. package/text-field/TextField.js +3 -6
  102. package/textarea-field/TextareaField.d.ts +10 -10
  103. package/types/field.d.ts +1 -1
  104. package/types/size.d.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { BaseFieldProps, Size } from '../types';
3
- export declare type NativeSelectFieldProps = BaseFieldProps & React.ComponentPropsWithRef<'select'> & {
3
+ export type NativeSelectFieldProps = BaseFieldProps & React.ComponentPropsWithRef<'select'> & {
4
4
  className?: string;
5
5
  visualSize?: Size;
6
6
  };
7
- export declare const NativeSelectField: React.ForwardRefExoticComponent<Pick<NativeSelectFieldProps, "required" | "key" | "id" | "name" | "color" | "translate" | "value" | "hidden" | "form" | "label" | "slot" | "style" | "title" | "dir" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "disabled" | "multiple" | "size" | "help" | "autoComplete" | "autoFocus" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "hideAsterisk" | "assistiveText" | "errorMessage" | "visualSize" | "helpPlacement"> & React.RefAttributes<HTMLSelectElement>>;
7
+ export declare const NativeSelectField: React.ForwardRefExoticComponent<Omit<NativeSelectFieldProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
8
8
  export default NativeSelectField;
@@ -10,11 +10,8 @@ var _system = require("@dfds-ui/icons/system/");
10
10
  var _theme = require("@dfds-ui/theme");
11
11
  var _FieldWrap = require("../field-wrap/FieldWrap");
12
12
  var _InputComposition = require("@dfds-ui/react-components/forms/input/InputComposition");
13
- const _excluded = ["name", "label", "defaultValue", "className", "help", "children", "helpPlacement", "assistiveText", "errorMessage", "disabled", "required", "hideAsterisk", "visualSize"];
14
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(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); }
13
+ 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); }
15
14
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
16
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
17
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
18
15
  const SelectChevron = () => {
19
16
  return (0, _react2.jsx)(_system.ChevronDown, {
20
17
  className: "native-select-chevron",
@@ -31,23 +28,22 @@ const leftPaddings = {
31
28
  medium: '1rem',
32
29
  large: '1rem'
33
30
  };
34
- const NativeSelectField = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
35
- let name = _ref.name,
36
- label = _ref.label,
37
- defaultValue = _ref.defaultValue,
38
- className = _ref.className,
39
- help = _ref.help,
40
- children = _ref.children,
41
- _ref$helpPlacement = _ref.helpPlacement,
42
- helpPlacement = _ref$helpPlacement === void 0 ? 'top' : _ref$helpPlacement,
43
- assistiveText = _ref.assistiveText,
44
- errorMessage = _ref.errorMessage,
45
- disabled = _ref.disabled,
46
- required = _ref.required,
47
- hideAsterisk = _ref.hideAsterisk,
48
- _ref$visualSize = _ref.visualSize,
49
- visualSize = _ref$visualSize === void 0 ? 'medium' : _ref$visualSize,
50
- rest = _objectWithoutProperties(_ref, _excluded);
31
+ const NativeSelectField = /*#__PURE__*/(0, _react.forwardRef)(({
32
+ name,
33
+ label,
34
+ defaultValue,
35
+ className,
36
+ help,
37
+ children,
38
+ helpPlacement = 'top',
39
+ assistiveText,
40
+ errorMessage,
41
+ disabled,
42
+ required,
43
+ hideAsterisk,
44
+ visualSize = 'medium',
45
+ ...rest
46
+ }, ref) => {
51
47
  return (0, _react2.jsx)(_FieldWrap.FieldWrap, {
52
48
  className: className,
53
49
  name: name,
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import Select, { ActionMeta, createFilter, GroupBase, MultiValue, OptionsOrGroups, SingleValue } from 'react-select';
3
3
  import { BaseFieldProps } from '../types';
4
- export declare type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
5
- export declare type Size = 'small' | 'medium' | 'large';
4
+ export type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
5
+ export type Size = 'small' | 'medium' | 'large';
6
6
  export declare const ReactSelectWrapper: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: React.ElementType<any> | undefined;
7
+ theme?: import("@emotion/react").Theme;
8
+ as?: React.ElementType;
9
9
  } & {
10
- error?: boolean | undefined;
11
- size?: string | undefined;
12
- arrow?: boolean | undefined;
13
- selected?: boolean | undefined;
10
+ error?: boolean;
11
+ size?: string;
12
+ arrow?: boolean;
13
+ selected?: boolean;
14
14
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
- export declare const Menu: (props: any) => JSX.Element;
16
- export declare type SelectFieldProps<T = string> = BaseFieldProps & {
15
+ export declare const Menu: (props: any) => React.JSX.Element;
16
+ export type SelectFieldProps<T = string> = BaseFieldProps & {
17
17
  assistiveText?: string;
18
18
  autoFocus?: boolean;
19
19
  className?: string;
@@ -51,45 +51,8 @@ export declare type SelectFieldProps<T = string> = BaseFieldProps & {
51
51
  value?: SingleValue<T> | MultiValue<T>;
52
52
  visualSize?: Size;
53
53
  };
54
- declare function SelectFieldInner<T>({ assistiveText, components, defaultValue, disabled, errorMessage, filterConfig, help, helpPlacement, hideAsterisk, isClearable, isMulti, isSearchable, label, name, onBlur, onChange, onSelect, options, placeholder, required, styles, value, visualSize, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): JSX.Element;
55
- export declare const SelectField: <T>(props: BaseFieldProps & {
56
- assistiveText?: string | undefined;
57
- autoFocus?: boolean | undefined;
58
- className?: string | undefined;
59
- components?: any;
60
- defaultValue?: SingleValue<T> | undefined;
61
- errorMessage?: string | undefined;
62
- /**
63
- * Configuration object passed to react-select createFilter function to create [custom filter
64
- * logic](https://react-select.com/advanced#custom-filter-logic)
65
- * @param ignoreCase - boolean (optional)
66
- * @param ignoreAccents - boolean (optional)
67
- * @param stringify (obj: any) => string (optional)
68
- * @param trim - boolean (optional)
69
- * @param matchForm - 'any' | 'start'
70
- */
71
- filterConfig?: Parameters<typeof createFilter>[0];
72
- /**
73
- * Indicates that the Select can be cleared after selecting an Option.
74
- *
75
- * Setting this to true will display a small dismiss cross when a value is selected
76
- */
77
- isClearable?: boolean | undefined;
78
- isMulti?: boolean | undefined;
79
- isSearchable?: boolean | undefined;
80
- menuIsOpen?: boolean | undefined;
81
- menuPlacement?: "auto" | "top" | "bottom" | undefined;
82
- onBlur?: ((value: any) => void) | undefined;
83
- onChange?: ((newValue: SingleValue<T> | MultiValue<T>, actionMeta: ActionMeta<T>) => void) | undefined;
84
- onSelect?: ((value: SingleValue<T> | MultiValue<T>) => void) | undefined;
85
- options?: OptionsOrGroups<T, GroupBase<T>> | undefined;
86
- placeholder?: string | undefined;
87
- prefix?: React.ReactNode;
88
- styles?: any;
89
- suffix?: React.ReactNode;
90
- value?: SingleValue<T> | MultiValue<T> | undefined;
91
- visualSize?: Size | undefined;
92
- } & {
93
- ref?: React.ForwardedRef<any> | undefined;
54
+ declare function SelectFieldInner<T>({ assistiveText, components, defaultValue, disabled, errorMessage, filterConfig, help, helpPlacement, hideAsterisk, isClearable, isMulti, isSearchable, label, name, onBlur, onChange, onSelect, options, placeholder, required, styles, value, visualSize, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): React.JSX.Element;
55
+ export declare const SelectField: <T>(props: SelectFieldProps<T> & {
56
+ ref?: React.ForwardedRef<any>;
94
57
  }) => ReturnType<typeof SelectFieldInner>;
95
58
  export default SelectField;