@dfds-ui/forms 2.0.14-alpha.586868c3 → 2.0.14-alpha.703ad4f6
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/cjs/index.js +11 -0
- package/cjs/select-field/AsyncSelectField.js +111 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +7 -7
- package/select-field/AsyncSelectField.d.ts +99 -0
- package/select-field/AsyncSelectField.js +119 -0
- package/cjs/assistive-text/AssistiveText.d.ts +0 -9
- package/cjs/asterisk/Asterisk.d.ts +0 -11
- package/cjs/checkbox/Checkbox.d.ts +0 -65
- package/cjs/checkbox/CheckboxContext.d.ts +0 -13
- package/cjs/checkbox/CheckboxGroup.d.ts +0 -20
- package/cjs/checkbox/index.d.ts +0 -2
- package/cjs/counter/Counter.d.ts +0 -66
- package/cjs/counter/index.d.ts +0 -1
- package/cjs/enhanced/EnhancedField.d.ts +0 -20
- package/cjs/enhanced/index.d.ts +0 -1
- package/cjs/error-text/ErrorText.d.ts +0 -8
- package/cjs/field-wrap/FieldWrap.d.ts +0 -10
- package/cjs/field-wrap/index.d.ts +0 -1
- package/cjs/help-icon/HelpIcon.d.ts +0 -7
- package/cjs/index.d.ts +0 -17
- package/cjs/label/Label.d.ts +0 -11
- package/cjs/password-field/PasswordField.d.ts +0 -4
- package/cjs/radio/Radio.d.ts +0 -51
- package/cjs/radio/RadioContext.d.ts +0 -13
- package/cjs/radio/RadioGroup.d.ts +0 -12
- package/cjs/radio/index.d.ts +0 -2
- package/cjs/rating/Rating.d.ts +0 -55
- package/cjs/rating/index.d.ts +0 -1
- package/cjs/select-field/NativeSelectField.d.ts +0 -8
- package/cjs/select-field/SelectField.d.ts +0 -93
- package/cjs/switch/Switch.d.ts +0 -32
- package/cjs/switch/SwitchContext.d.ts +0 -11
- package/cjs/switch/SwitchGroup.d.ts +0 -10
- package/cjs/switch/index.d.ts +0 -2
- package/cjs/tel-field/TelField.d.ts +0 -67
- package/cjs/text-field/TextField.d.ts +0 -57
- package/cjs/textarea-field/TextareaField.d.ts +0 -44
- package/cjs/types/field.d.ts +0 -52
- package/cjs/types/index.d.ts +0 -2
- package/cjs/types/size.d.ts +0 -1
package/cjs/counter/Counter.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
declare type Size = 's' | 'm';
|
|
3
|
-
export declare type CounterProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Minimum value
|
|
6
|
-
*/
|
|
7
|
-
minValue: number;
|
|
8
|
-
/**
|
|
9
|
-
* Maximum value
|
|
10
|
-
*/
|
|
11
|
-
maxValue: number;
|
|
12
|
-
/**
|
|
13
|
-
* Disables the minus button
|
|
14
|
-
*/
|
|
15
|
-
disableMin?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Disables the plus button
|
|
18
|
-
*/
|
|
19
|
-
disableMax?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Class name
|
|
22
|
-
*/
|
|
23
|
-
className?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Disables input of counter
|
|
26
|
-
*/
|
|
27
|
-
disableInput?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Name of the input element
|
|
30
|
-
*/
|
|
31
|
-
name?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Initial value of the counter, if not specified it's set to `minValue`
|
|
34
|
-
*/
|
|
35
|
-
value?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Sets default value
|
|
38
|
-
*/
|
|
39
|
-
defaultValue?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Set aria label on plus/increase
|
|
42
|
-
*/
|
|
43
|
-
increaseAriaLabel?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Set aria label on minus/decrease
|
|
46
|
-
*/
|
|
47
|
-
decreaseAriaLabel?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Disable tool tips
|
|
50
|
-
*/
|
|
51
|
-
disableToolTips?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Callback when value changes
|
|
54
|
-
*/
|
|
55
|
-
onChange?: (arg: number, event: React.MouseEvent<HTMLButtonElement, MouseEvent> | React.ChangeEvent<HTMLInputElement>) => void;
|
|
56
|
-
/**
|
|
57
|
-
* Label to display instead of the input element, see example below
|
|
58
|
-
*/
|
|
59
|
-
text?: ReactNode;
|
|
60
|
-
/**
|
|
61
|
-
* Size of counter
|
|
62
|
-
*/
|
|
63
|
-
size?: Size;
|
|
64
|
-
};
|
|
65
|
-
export declare const Counter: React.ForwardRefExoticComponent<CounterProps & React.RefAttributes<HTMLInputElement>>;
|
|
66
|
-
export {};
|
package/cjs/counter/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Counter } from './Counter';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type ReactInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
3
|
-
export declare type EnhancedInputProps<TValue> = Omit<EnhancedFieldProps, 'value'> & {
|
|
4
|
-
value?: TValue;
|
|
5
|
-
};
|
|
6
|
-
export declare type EnhancedFieldProps = Omit<ReactInputProps, 'size' | 'css'> & {
|
|
7
|
-
name?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Label to be displayed
|
|
10
|
-
*/
|
|
11
|
-
label?: React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* Icon to be displayed
|
|
14
|
-
*/
|
|
15
|
-
icon?: React.ElementType;
|
|
16
|
-
className?: string;
|
|
17
|
-
onClick?: (e: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const EnhancedField: React.ForwardRefExoticComponent<Pick<EnhancedFieldProps, "max" | "required" | "type" | "key" | "id" | "height" | "width" | "name" | "color" | "translate" | "value" | "hidden" | "form" | "label" | "slot" | "style" | "title" | "dir" | "pattern" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "enterKeyHint" | "inputMode" | "tabIndex" | "disabled" | "multiple" | "icon" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "list" | "maxLength" | "min" | "minLength" | "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" | "readOnly" | "src" | "step" | "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"> & React.RefAttributes<HTMLInputElement>>;
|
|
20
|
-
export default EnhancedField;
|
package/cjs/enhanced/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './EnhancedField';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseFieldProps, Size } from '../types';
|
|
3
|
-
export declare type FieldWrapProps = BaseFieldProps & {
|
|
4
|
-
size: Size;
|
|
5
|
-
extraAssistiveText?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export declare const FieldWrap: ({ name, assistiveText, errorMessage, size, required, hideAsterisk, label, help, extraAssistiveText, disabled, className, children, }: FieldWrapProps) => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './FieldWrap';
|
package/cjs/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export * from './assistive-text/AssistiveText';
|
|
2
|
-
export * from './checkbox';
|
|
3
|
-
export * from './counter/Counter';
|
|
4
|
-
export * from './enhanced';
|
|
5
|
-
export * from './error-text/ErrorText';
|
|
6
|
-
export * from './field-wrap';
|
|
7
|
-
export * from './help-icon/HelpIcon';
|
|
8
|
-
export * from './label/Label';
|
|
9
|
-
export * from './password-field/PasswordField';
|
|
10
|
-
export * from './radio';
|
|
11
|
-
export * from './rating';
|
|
12
|
-
export * from './select-field/NativeSelectField';
|
|
13
|
-
export * from './select-field/SelectField';
|
|
14
|
-
export * from './switch/index';
|
|
15
|
-
export * from './tel-field/TelField';
|
|
16
|
-
export * from './text-field/TextField';
|
|
17
|
-
export * from './textarea-field/TextareaField';
|
package/cjs/label/Label.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { Size } from '../types';
|
|
3
|
-
export declare type LabelProps = {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
hideAsterisk?: boolean;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
visualSize?: Size;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
} & React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
|
|
11
|
-
export declare const Label: ({ visualSize, required, hideAsterisk, disabled, className, children, ...rest }: LabelProps) => JSX.Element;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextFieldProps } from '../text-field/TextField';
|
|
3
|
-
export declare type PasswordFieldProps = Omit<TextFieldProps, 'icon' | 'inputType'>;
|
|
4
|
-
export declare const PasswordField: React.ForwardRefExoticComponent<PasswordFieldProps & React.RefAttributes<HTMLInputElement>>;
|
package/cjs/radio/Radio.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
declare type RadioSize = 'medium' | 'small';
|
|
3
|
-
export declare type RadioStyleState = 'checked';
|
|
4
|
-
export declare type RadioProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Field name.
|
|
7
|
-
*/
|
|
8
|
-
name: string;
|
|
9
|
-
/**
|
|
10
|
-
* Indicate that the radio button is checked
|
|
11
|
-
*/
|
|
12
|
-
checked?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
defaultChecked?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Field label.
|
|
19
|
-
*/
|
|
20
|
-
label?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Class name to be assigned to the component
|
|
23
|
-
*/
|
|
24
|
-
className?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Field label.
|
|
27
|
-
*/
|
|
28
|
-
value?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Indicates that the radio button is disabled.
|
|
31
|
-
*/
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Indicates an error in the field.
|
|
35
|
-
*/
|
|
36
|
-
error?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Size variant.
|
|
39
|
-
*/
|
|
40
|
-
visualSize?: RadioSize;
|
|
41
|
-
/**
|
|
42
|
-
* Callback when the radio button is checked or unchecked
|
|
43
|
-
*/
|
|
44
|
-
onChange?: JSX.IntrinsicElements['input']['onChange'];
|
|
45
|
-
Icon?: React.ComponentType;
|
|
46
|
-
styledAs?: RadioStyleState;
|
|
47
|
-
};
|
|
48
|
-
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
49
|
-
/** @deprecated Use Radio */
|
|
50
|
-
export declare const RadioField: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
51
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioProps } from './Radio';
|
|
3
|
-
declare type RadioContextProps = {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
visualSize: NonNullable<RadioProps['visualSize']>;
|
|
6
|
-
error: RadioProps['error'];
|
|
7
|
-
};
|
|
8
|
-
export declare const RadioContext: React.Context<RadioContextProps | undefined>;
|
|
9
|
-
export declare const RadioContextProvider: React.FC<{
|
|
10
|
-
value: RadioContextProps;
|
|
11
|
-
}>;
|
|
12
|
-
declare const useRadioContext: () => RadioContextProps | undefined;
|
|
13
|
-
export default useRadioContext;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseFieldProps } from '../types';
|
|
3
|
-
import { RadioProps } from './Radio';
|
|
4
|
-
export declare type RadioGroupProps = Pick<BaseFieldProps, 'help' | 'label' | 'required' | 'hideAsterisk' | 'disabled' | 'errorMessage'> & Pick<RadioProps, 'visualSize'> & {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
* Class name to be assigned to the component
|
|
8
|
-
*/
|
|
9
|
-
className?: string;
|
|
10
|
-
column?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const RadioGroup: ({ visualSize, label, children, column, errorMessage, help, required, hideAsterisk, className, }: RadioGroupProps) => JSX.Element;
|
package/cjs/radio/index.d.ts
DELETED
package/cjs/rating/Rating.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldWrapProps } from '../field-wrap/FieldWrap';
|
|
3
|
-
import { Size } from '../types';
|
|
4
|
-
export declare type RatingProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Amount of related checkboxes
|
|
7
|
-
*/
|
|
8
|
-
rangeCardinality: number;
|
|
9
|
-
/**
|
|
10
|
-
* Name for the checkbox group
|
|
11
|
-
*/
|
|
12
|
-
name: string;
|
|
13
|
-
/**
|
|
14
|
-
* Hint text on the left
|
|
15
|
-
*/
|
|
16
|
-
leadingHint?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Hint text on the right
|
|
19
|
-
*/
|
|
20
|
-
trailingHint?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Labels on top of the radio selectors, a string returning function called with the selector's index
|
|
23
|
-
*/
|
|
24
|
-
scaleLabels?: (index: number) => string;
|
|
25
|
-
/**
|
|
26
|
-
* If used as a controlled component, this value sets the selected radio
|
|
27
|
-
*/
|
|
28
|
-
value?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Initial selected value
|
|
31
|
-
*/
|
|
32
|
-
defaultValue?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Callback when the user changes the selected value
|
|
35
|
-
*/
|
|
36
|
-
onChange?: (index: number, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
showScaleLabels?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* When this property is `true`, it styles the radios to the left of the selected as `checked`
|
|
41
|
-
*/
|
|
42
|
-
cumulative?: boolean;
|
|
43
|
-
Icon?: (index: number) => React.ComponentType;
|
|
44
|
-
};
|
|
45
|
-
export declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<HTMLInputElement>>;
|
|
46
|
-
export declare type RatingFieldProps = RatingProps & Omit<FieldWrapProps, 'size' | 'placeholder' | 'helpPlacement' | 'children'> & {
|
|
47
|
-
size: Exclude<Size, 'large'>;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* The `RatingField` component will allow the user to provide feedback by ranking things on a specified scale.
|
|
51
|
-
*/
|
|
52
|
-
export declare const RatingField: React.ForwardRefExoticComponent<RatingProps & Omit<FieldWrapProps, "children" | "size" | "placeholder" | "helpPlacement"> & {
|
|
53
|
-
size: Exclude<Size, 'large'>;
|
|
54
|
-
} & React.RefAttributes<HTMLInputElement>>;
|
|
55
|
-
export default RatingField;
|
package/cjs/rating/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Rating';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseFieldProps, Size } from '../types';
|
|
3
|
-
export declare type NativeSelectFieldProps = BaseFieldProps & React.ComponentPropsWithRef<'select'> & {
|
|
4
|
-
className?: string;
|
|
5
|
-
visualSize?: Size;
|
|
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>>;
|
|
8
|
-
export default NativeSelectField;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Select, { ActionMeta, createFilter, GroupBase, OptionsOrGroups, SingleValue } from 'react-select';
|
|
3
|
-
import { BaseFieldProps } from '../types';
|
|
4
|
-
export declare type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
|
|
5
|
-
export declare type Size = 'small' | 'medium' | 'large';
|
|
6
|
-
export declare const ReactSelectWrapper: import("@emotion/styled").StyledComponent<{
|
|
7
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: React.ElementType<any> | undefined;
|
|
9
|
-
} & {
|
|
10
|
-
error?: boolean | undefined;
|
|
11
|
-
size?: string | undefined;
|
|
12
|
-
arrow?: boolean | undefined;
|
|
13
|
-
selected?: boolean | undefined;
|
|
14
|
-
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
15
|
-
export declare const Menu: (props: any) => JSX.Element;
|
|
16
|
-
export declare type SelectFieldProps<T = string> = BaseFieldProps & {
|
|
17
|
-
autoFocus?: boolean;
|
|
18
|
-
defaultValue?: SingleValue<T>;
|
|
19
|
-
className?: string;
|
|
20
|
-
components?: any;
|
|
21
|
-
value?: SingleValue<T>;
|
|
22
|
-
visualSize?: Size;
|
|
23
|
-
options?: OptionsOrGroups<T, GroupBase<T>>;
|
|
24
|
-
isSearchable?: boolean;
|
|
25
|
-
onSelect?: (value: SingleValue<T>) => void;
|
|
26
|
-
onChange?: (newValue: SingleValue<T>, actionMeta: ActionMeta<T>) => void;
|
|
27
|
-
onBlur?: (value: any) => void;
|
|
28
|
-
menuIsOpen?: boolean;
|
|
29
|
-
menuPlacement?: 'bottom' | 'auto' | 'top';
|
|
30
|
-
placeholder?: string;
|
|
31
|
-
prefix?: React.ReactNode;
|
|
32
|
-
suffix?: React.ReactNode;
|
|
33
|
-
assistiveText?: string;
|
|
34
|
-
errorMessage?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Indicates that the Select can be cleared after selecting an Option.
|
|
37
|
-
*
|
|
38
|
-
* Setting this to true will display a small dismiss cross when a value is selected
|
|
39
|
-
*/
|
|
40
|
-
isClearable?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Configuration object passed to react-select createFilter function to create [custom filter
|
|
43
|
-
* logic](https://react-select.com/advanced#custom-filter-logic)
|
|
44
|
-
* @param ignoreCase - boolean (optional)
|
|
45
|
-
* @param ignoreAccents - boolean (optional)
|
|
46
|
-
* @param stringify (obj: any) => string (optional)
|
|
47
|
-
* @param trim - boolean (optional)
|
|
48
|
-
* @param matchForm - 'any' | 'start'
|
|
49
|
-
*/
|
|
50
|
-
filterConfig?: Parameters<typeof createFilter>[0];
|
|
51
|
-
styles?: any;
|
|
52
|
-
};
|
|
53
|
-
declare function SelectFieldInner<T>({ components, name, label, defaultValue, value, placeholder, onSelect, onChange, isSearchable, onBlur, assistiveText, options, errorMessage, isClearable, disabled, visualSize, required, hideAsterisk, filterConfig, styles, help, helpPlacement, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): JSX.Element;
|
|
54
|
-
export declare const SelectField: <T>(props: BaseFieldProps & {
|
|
55
|
-
autoFocus?: boolean | undefined;
|
|
56
|
-
defaultValue?: SingleValue<T> | undefined;
|
|
57
|
-
className?: string | undefined;
|
|
58
|
-
components?: any;
|
|
59
|
-
value?: SingleValue<T> | undefined;
|
|
60
|
-
visualSize?: Size | undefined;
|
|
61
|
-
options?: OptionsOrGroups<T, GroupBase<T>> | undefined;
|
|
62
|
-
isSearchable?: boolean | undefined;
|
|
63
|
-
onSelect?: ((value: SingleValue<T>) => void) | undefined;
|
|
64
|
-
onChange?: ((newValue: SingleValue<T>, actionMeta: ActionMeta<T>) => void) | undefined;
|
|
65
|
-
onBlur?: ((value: any) => void) | undefined;
|
|
66
|
-
menuIsOpen?: boolean | undefined;
|
|
67
|
-
menuPlacement?: "auto" | "top" | "bottom" | undefined;
|
|
68
|
-
placeholder?: string | undefined;
|
|
69
|
-
prefix?: React.ReactNode;
|
|
70
|
-
suffix?: React.ReactNode;
|
|
71
|
-
assistiveText?: string | undefined;
|
|
72
|
-
errorMessage?: string | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* Indicates that the Select can be cleared after selecting an Option.
|
|
75
|
-
*
|
|
76
|
-
* Setting this to true will display a small dismiss cross when a value is selected
|
|
77
|
-
*/
|
|
78
|
-
isClearable?: boolean | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Configuration object passed to react-select createFilter function to create [custom filter
|
|
81
|
-
* logic](https://react-select.com/advanced#custom-filter-logic)
|
|
82
|
-
* @param ignoreCase - boolean (optional)
|
|
83
|
-
* @param ignoreAccents - boolean (optional)
|
|
84
|
-
* @param stringify (obj: any) => string (optional)
|
|
85
|
-
* @param trim - boolean (optional)
|
|
86
|
-
* @param matchForm - 'any' | 'start'
|
|
87
|
-
*/
|
|
88
|
-
filterConfig?: Parameters<typeof createFilter>[0];
|
|
89
|
-
styles?: any;
|
|
90
|
-
} & {
|
|
91
|
-
ref?: React.ForwardedRef<any> | undefined;
|
|
92
|
-
}) => ReturnType<typeof SelectFieldInner>;
|
|
93
|
-
export default SelectField;
|
package/cjs/switch/Switch.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { ChangeEvent } from 'react';
|
|
2
|
-
declare type Size = 'small' | 'medium';
|
|
3
|
-
export declare type SwitchProps = React.PropsWithRef<JSX.IntrinsicElements['label']> & {
|
|
4
|
-
/**
|
|
5
|
-
* Name of the input element
|
|
6
|
-
*/
|
|
7
|
-
name?: string;
|
|
8
|
-
/**
|
|
9
|
-
* State of the switch
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
checked?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Controls whether the input is disabled
|
|
15
|
-
*/
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Callback to fire when the state of the input changes
|
|
19
|
-
*/
|
|
20
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
-
/**
|
|
22
|
-
* Controls whether the input label should be displayed on the right of the input, displayed on the left by default
|
|
23
|
-
*/
|
|
24
|
-
right?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Visual size of the switch
|
|
27
|
-
*/
|
|
28
|
-
size?: Size;
|
|
29
|
-
error?: boolean;
|
|
30
|
-
};
|
|
31
|
-
export declare const Switch: React.ForwardRefExoticComponent<Pick<SwitchProps, "error" | "key" | "name" | "right" | "disabled" | "size" | "checked" | "css" | keyof React.LabelHTMLAttributes<HTMLLabelElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
32
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SwitchProps } from './Switch';
|
|
3
|
-
declare type SwitchContextProps = Required<Pick<SwitchProps, 'size' | 'error'>> & {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
export declare const SwitchContext: React.Context<SwitchContextProps | undefined>;
|
|
7
|
-
export declare const SwitchContextProvider: React.FC<{
|
|
8
|
-
value: SwitchContextProps;
|
|
9
|
-
}>;
|
|
10
|
-
declare const useSwitchContext: () => SwitchContextProps | undefined;
|
|
11
|
-
export default useSwitchContext;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseFieldProps } from '../types';
|
|
3
|
-
import { SwitchProps } from './Switch';
|
|
4
|
-
export declare type SwitchGroupProps = Pick<BaseFieldProps, 'label' | 'errorMessage' | 'hideAsterisk' | 'required'> & {
|
|
5
|
-
/**
|
|
6
|
-
* JSX enclosed by the group.
|
|
7
|
-
*/
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
} & Pick<SwitchProps, 'size'>;
|
|
10
|
-
export declare const SwitchGroup: ({ size, label, errorMessage, required, hideAsterisk, children, }: SwitchGroupProps) => JSX.Element;
|
package/cjs/switch/index.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Locale } from '@dfds-ui/react-components';
|
|
3
|
-
import { BaseFieldProps } from '../types';
|
|
4
|
-
export declare type TelFieldProps = BaseFieldProps & {
|
|
5
|
-
/**
|
|
6
|
-
* Class name to be added to the TelField.
|
|
7
|
-
*/
|
|
8
|
-
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Default value for the phone number
|
|
11
|
-
*/
|
|
12
|
-
defaultValue?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Default locale. Will set the matching country in the dropdown
|
|
15
|
-
*/
|
|
16
|
-
defaultLocale?: Locale;
|
|
17
|
-
/**
|
|
18
|
-
* Show trunk values (the local area code shown in parenthesis)
|
|
19
|
-
*/
|
|
20
|
-
showTrunkValues?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Makes value splitted so easier to convert to object
|
|
23
|
-
*/
|
|
24
|
-
splitValues?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Callback when value changes
|
|
27
|
-
*/
|
|
28
|
-
onChange?: (newValue: string) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Callback when blur
|
|
31
|
-
*/
|
|
32
|
-
onBlur?: () => void;
|
|
33
|
-
};
|
|
34
|
-
export declare type TelFieldElement = {
|
|
35
|
-
focus?: () => void;
|
|
36
|
-
};
|
|
37
|
-
export declare const TelField: React.ForwardRefExoticComponent<BaseFieldProps & {
|
|
38
|
-
/**
|
|
39
|
-
* Class name to be added to the TelField.
|
|
40
|
-
*/
|
|
41
|
-
className?: string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Default value for the phone number
|
|
44
|
-
*/
|
|
45
|
-
defaultValue?: string | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Default locale. Will set the matching country in the dropdown
|
|
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" | "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
|
-
/**
|
|
51
|
-
* Show trunk values (the local area code shown in parenthesis)
|
|
52
|
-
*/
|
|
53
|
-
showTrunkValues?: boolean | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Makes value splitted so easier to convert to object
|
|
56
|
-
*/
|
|
57
|
-
splitValues?: boolean | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Callback when value changes
|
|
60
|
-
*/
|
|
61
|
-
onChange?: ((newValue: string) => void) | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Callback when blur
|
|
64
|
-
*/
|
|
65
|
-
onBlur?: (() => void) | undefined;
|
|
66
|
-
} & React.RefAttributes<TelFieldElement>>;
|
|
67
|
-
export default TelField;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseFieldProps, Size } from '../types';
|
|
3
|
-
export declare type TextFieldProps = BaseFieldProps & {
|
|
4
|
-
autoFocus?: boolean;
|
|
5
|
-
defaultValue?: string;
|
|
6
|
-
prefix?: React.ReactNode;
|
|
7
|
-
suffix?: React.ReactNode;
|
|
8
|
-
icon?: React.ElementType;
|
|
9
|
-
/**
|
|
10
|
-
* Element to be placed after the input element.
|
|
11
|
-
*
|
|
12
|
-
* Useful for adding a button next to the TextField.
|
|
13
|
-
*/
|
|
14
|
-
adornment?: React.ReactNode;
|
|
15
|
-
className?: string;
|
|
16
|
-
value?: string;
|
|
17
|
-
visualSize?: Size;
|
|
18
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
-
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
20
|
-
onBlur?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
-
inputType?: 'email' | 'text' | 'tel' | 'time' | 'url' | 'date' | 'file' | 'number' | 'search' | 'password';
|
|
22
|
-
autoComplete?: string;
|
|
23
|
-
minValue?: string;
|
|
24
|
-
maxValue?: string;
|
|
25
|
-
maxLength?: number;
|
|
26
|
-
minLength?: number;
|
|
27
|
-
readOnly?: boolean;
|
|
28
|
-
step?: number | 'any';
|
|
29
|
-
};
|
|
30
|
-
export declare const TextField: React.ForwardRefExoticComponent<BaseFieldProps & {
|
|
31
|
-
autoFocus?: boolean | undefined;
|
|
32
|
-
defaultValue?: string | undefined;
|
|
33
|
-
prefix?: React.ReactNode;
|
|
34
|
-
suffix?: React.ReactNode;
|
|
35
|
-
icon?: React.ElementType<any> | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Element to be placed after the input element.
|
|
38
|
-
*
|
|
39
|
-
* Useful for adding a button next to the TextField.
|
|
40
|
-
*/
|
|
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" | "file" | "password" | "url" | "time" | "text" | "tel" | "email" | "date" | 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;
|
|
56
|
-
} & React.RefAttributes<HTMLInputElement>>;
|
|
57
|
-
export default TextField;
|