draft-components 1.0.0-beta.11 → 1.0.0-beta.13
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/components/password-input/password-input.cjs +1 -1
- package/cjs/components/text-input/text-input.cjs +8 -8
- package/cjs/components/toaster/toaster.cjs +2 -2
- package/css/draft-components.css +8 -8
- package/esm/components/password-input/password-input.js +1 -1
- package/esm/components/text-input/text-input.js +8 -8
- package/esm/components/toaster/toaster.js +2 -2
- package/package.json +1 -1
- package/types/components/form-field/form-field.d.ts +5 -2
- package/types/components/password-input/password-input.d.ts +2 -2
- package/types/components/text-input/text-input.d.ts +4 -4
- package/types/components/toaster/toaster.d.ts +1 -3
|
@@ -24,7 +24,7 @@ const PasswordInput = react.forwardRef(function PasswordInput({ isDefaultVisible
|
|
|
24
24
|
}
|
|
25
25
|
const handleButtonClick = () => setVisible(!visible);
|
|
26
26
|
const button = (jsxRuntime.jsx(tooltip.Tooltip, { content: content, children: jsxRuntime.jsx("button", { className: "dc-password-input__btn", type: "button", onClick: handleButtonClick, children: jsxRuntime.jsx(Icon, { className: "dc-password-input__icon", "aria-hidden": true }) }) }));
|
|
27
|
-
return (jsxRuntime.jsx(textInput.TextInput, { ...props, className: reactHelpers.classNames('dc-password-input', className), ref: ref, type: type,
|
|
27
|
+
return (jsxRuntime.jsx(textInput.TextInput, { ...props, className: reactHelpers.classNames('dc-password-input', className), ref: ref, type: type, rightAddOn: button }));
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
exports.PasswordInput = PasswordInput;
|
|
@@ -4,23 +4,23 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
const react = require('react');
|
|
5
5
|
const reactHelpers = require('../../lib/react-helpers.cjs');
|
|
6
6
|
|
|
7
|
-
const TextInput = react.forwardRef(function TextInput({ hasError = false, isBlock = false, type = 'text', size = 'md',
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const TextInput = react.forwardRef(function TextInput({ hasError = false, isBlock = false, type = 'text', size = 'md', leftAddOn, rightAddOn, style, className, disabled, width, htmlSize, onChange, onChangeValue, ...props }, ref) {
|
|
8
|
+
const showLeftAddOn = Boolean(leftAddOn);
|
|
9
|
+
const showRightAddOn = Boolean(rightAddOn);
|
|
10
10
|
return (jsxRuntime.jsxs("div", { style: style, className: reactHelpers.classNames(className, 'dc-text-input__container', {
|
|
11
11
|
[`dc-text-input__container_${size}`]: size,
|
|
12
|
+
'dc-text-input__container_block': isBlock,
|
|
12
13
|
'dc-text-input__container_disabled': disabled,
|
|
13
14
|
'dc-text-input__container_has_error': hasError,
|
|
14
|
-
'dc-text-
|
|
15
|
-
'dc-text-
|
|
16
|
-
|
|
17
|
-
}), children: [shouldRenderPrefix && (jsxRuntime.jsx("div", { className: "dc-text-input__prefix", children: prefix })), jsxRuntime.jsx("input", { ...props, className: reactHelpers.classNames({
|
|
15
|
+
'dc-text-input__container_has_left-addon': showLeftAddOn,
|
|
16
|
+
'dc-text-input__container_has_right-addon': showRightAddOn,
|
|
17
|
+
}), children: [showLeftAddOn && (jsxRuntime.jsx("div", { className: "dc-text-input__left-addon", children: leftAddOn })), jsxRuntime.jsx("input", { ...props, className: reactHelpers.classNames({
|
|
18
18
|
'dc-text-input': true,
|
|
19
19
|
[`dc-text-input_width_${width}`]: width,
|
|
20
20
|
}), ref: ref, type: type, size: htmlSize, disabled: disabled, onChange: (event) => {
|
|
21
21
|
onChange?.(event);
|
|
22
22
|
onChangeValue?.(event.target.value);
|
|
23
|
-
} }),
|
|
23
|
+
} }), showRightAddOn && (jsxRuntime.jsx("div", { className: "dc-text-input__right-addon", children: rightAddOn }))] }));
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
exports.TextInput = TextInput;
|
|
@@ -23,7 +23,7 @@ class Toaster {
|
|
|
23
23
|
this._id += 1;
|
|
24
24
|
return this._id;
|
|
25
25
|
}
|
|
26
|
-
showToast(toast
|
|
26
|
+
showToast(toast) {
|
|
27
27
|
const id = this._getNextId();
|
|
28
28
|
const event = new CustomEvent(TOAST_SHOW_EVENT, {
|
|
29
29
|
detail: {
|
|
@@ -31,7 +31,7 @@ class Toaster {
|
|
|
31
31
|
toast: { ...toast, id },
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
|
-
const timeoutMs = toast.timeoutMs ||
|
|
34
|
+
const timeoutMs = toast.timeoutMs || this.timeoutMs;
|
|
35
35
|
this.onShow?.(event.detail.toast);
|
|
36
36
|
window.dispatchEvent(event);
|
|
37
37
|
window.setTimeout(() => this.hideToast(id), timeoutMs);
|
package/css/draft-components.css
CHANGED
|
@@ -1282,35 +1282,35 @@
|
|
|
1282
1282
|
width: 40.5ch;
|
|
1283
1283
|
}
|
|
1284
1284
|
|
|
1285
|
-
.dc-text-
|
|
1286
|
-
.dc-text-
|
|
1285
|
+
.dc-text-input__left-addon,
|
|
1286
|
+
.dc-text-input__right-addon {
|
|
1287
1287
|
display: inline-flex;
|
|
1288
1288
|
flex: none;
|
|
1289
1289
|
align-items: center;
|
|
1290
1290
|
box-sizing: border-box;
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
-
.dc-text-
|
|
1293
|
+
.dc-text-input__left-addon {
|
|
1294
1294
|
color: var(--dc-input-prefix-color);
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
|
-
.dc-text-
|
|
1297
|
+
.dc-text-input__right-addon {
|
|
1298
1298
|
color: var(--dc-input-suffix-color);
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
|
-
.dc-text-
|
|
1301
|
+
.dc-text-input__container_has_left-addon {
|
|
1302
1302
|
padding-left: var(--dc-input-padding-x);
|
|
1303
1303
|
}
|
|
1304
1304
|
|
|
1305
|
-
.dc-text-
|
|
1305
|
+
.dc-text-input__container_has_left-addon .dc-text-input {
|
|
1306
1306
|
padding-left: calc(var(--dc-input-padding-x) * 0.5);
|
|
1307
1307
|
}
|
|
1308
1308
|
|
|
1309
|
-
.dc-text-
|
|
1309
|
+
.dc-text-input__container_has_right-addon {
|
|
1310
1310
|
padding-right: var(--dc-input-padding-x);
|
|
1311
1311
|
}
|
|
1312
1312
|
|
|
1313
|
-
.dc-text-
|
|
1313
|
+
.dc-text-input__container_has_right-addon .dc-text-input {
|
|
1314
1314
|
padding-right: calc(var(--dc-input-padding-x) * 0.5);
|
|
1315
1315
|
}
|
|
1316
1316
|
|
|
@@ -22,7 +22,7 @@ const PasswordInput = forwardRef(function PasswordInput({ isDefaultVisible = fal
|
|
|
22
22
|
}
|
|
23
23
|
const handleButtonClick = () => setVisible(!visible);
|
|
24
24
|
const button = (jsx(Tooltip, { content: content, children: jsx("button", { className: "dc-password-input__btn", type: "button", onClick: handleButtonClick, children: jsx(Icon, { className: "dc-password-input__icon", "aria-hidden": true }) }) }));
|
|
25
|
-
return (jsx(TextInput, { ...props, className: classNames('dc-password-input', className), ref: ref, type: type,
|
|
25
|
+
return (jsx(TextInput, { ...props, className: classNames('dc-password-input', className), ref: ref, type: type, rightAddOn: button }));
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
export { PasswordInput };
|
|
@@ -2,23 +2,23 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { classNames } from '../../lib/react-helpers.js';
|
|
4
4
|
|
|
5
|
-
const TextInput = forwardRef(function TextInput({ hasError = false, isBlock = false, type = 'text', size = 'md',
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const TextInput = forwardRef(function TextInput({ hasError = false, isBlock = false, type = 'text', size = 'md', leftAddOn, rightAddOn, style, className, disabled, width, htmlSize, onChange, onChangeValue, ...props }, ref) {
|
|
6
|
+
const showLeftAddOn = Boolean(leftAddOn);
|
|
7
|
+
const showRightAddOn = Boolean(rightAddOn);
|
|
8
8
|
return (jsxs("div", { style: style, className: classNames(className, 'dc-text-input__container', {
|
|
9
9
|
[`dc-text-input__container_${size}`]: size,
|
|
10
|
+
'dc-text-input__container_block': isBlock,
|
|
10
11
|
'dc-text-input__container_disabled': disabled,
|
|
11
12
|
'dc-text-input__container_has_error': hasError,
|
|
12
|
-
'dc-text-
|
|
13
|
-
'dc-text-
|
|
14
|
-
|
|
15
|
-
}), children: [shouldRenderPrefix && (jsx("div", { className: "dc-text-input__prefix", children: prefix })), jsx("input", { ...props, className: classNames({
|
|
13
|
+
'dc-text-input__container_has_left-addon': showLeftAddOn,
|
|
14
|
+
'dc-text-input__container_has_right-addon': showRightAddOn,
|
|
15
|
+
}), children: [showLeftAddOn && (jsx("div", { className: "dc-text-input__left-addon", children: leftAddOn })), jsx("input", { ...props, className: classNames({
|
|
16
16
|
'dc-text-input': true,
|
|
17
17
|
[`dc-text-input_width_${width}`]: width,
|
|
18
18
|
}), ref: ref, type: type, size: htmlSize, disabled: disabled, onChange: (event) => {
|
|
19
19
|
onChange?.(event);
|
|
20
20
|
onChangeValue?.(event.target.value);
|
|
21
|
-
} }),
|
|
21
|
+
} }), showRightAddOn && (jsx("div", { className: "dc-text-input__right-addon", children: rightAddOn }))] }));
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export { TextInput };
|
|
@@ -21,7 +21,7 @@ class Toaster {
|
|
|
21
21
|
this._id += 1;
|
|
22
22
|
return this._id;
|
|
23
23
|
}
|
|
24
|
-
showToast(toast
|
|
24
|
+
showToast(toast) {
|
|
25
25
|
const id = this._getNextId();
|
|
26
26
|
const event = new CustomEvent(TOAST_SHOW_EVENT, {
|
|
27
27
|
detail: {
|
|
@@ -29,7 +29,7 @@ class Toaster {
|
|
|
29
29
|
toast: { ...toast, id },
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
const timeoutMs = toast.timeoutMs ||
|
|
32
|
+
const timeoutMs = toast.timeoutMs || this.timeoutMs;
|
|
33
33
|
this.onShow?.(event.detail.toast);
|
|
34
34
|
window.dispatchEvent(event);
|
|
35
35
|
window.setTimeout(() => this.hideToast(id), timeoutMs);
|
package/package.json
CHANGED
|
@@ -4,12 +4,15 @@ export type FormFieldRenderFn = (props: {
|
|
|
4
4
|
required: boolean;
|
|
5
5
|
hasError: boolean;
|
|
6
6
|
}) => ReactNode;
|
|
7
|
-
|
|
7
|
+
type FormFieldHTMLProps = ComponentPropsWithoutRef<'div'>;
|
|
8
|
+
type FormFieldBaseProps = Omit<FormFieldHTMLProps, 'children'>;
|
|
9
|
+
export type FormFieldProps = {
|
|
8
10
|
required?: boolean;
|
|
9
11
|
labelFor?: string;
|
|
10
12
|
label?: ReactNode;
|
|
11
13
|
caption?: ReactNode;
|
|
12
14
|
error?: ReactNode;
|
|
13
15
|
children: ReactNode | FormFieldRenderFn;
|
|
14
|
-
};
|
|
16
|
+
} & FormFieldBaseProps;
|
|
15
17
|
export declare function FormField({ required, labelFor, label, caption, error, className, children, ...props }: FormFieldProps): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type TextInputProps } from '../text-input';
|
|
3
|
-
type PasswordInputBaseProps = Omit<TextInputProps, 'type' | '
|
|
3
|
+
type PasswordInputBaseProps = Omit<TextInputProps, 'type' | 'rightAddOn'>;
|
|
4
4
|
export type PasswordInputProps = {
|
|
5
5
|
isDefaultVisible?: boolean;
|
|
6
6
|
showPasswordTitle?: string;
|
|
7
7
|
hidePasswordTitle?: string;
|
|
8
8
|
} & PasswordInputBaseProps;
|
|
9
|
-
export declare const PasswordInput: import("react").ForwardRefExoticComponent<Pick<PasswordInputProps, "hidden" | "form" | "slot" | "style" | "title" | "pattern" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "children" | "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" | "onResize" | "onResizeCapture" | "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" | "list" | "step" | "size" | "src" | "alt" | "width" | "height" | "value" | "max" | "min" | "name" | "crossOrigin" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "isBlock" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "onChangeValue" | "hasError" | "htmlSize" | "widthCh" | "isDefaultVisible" | "showPasswordTitle" | "hidePasswordTitle"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export declare const PasswordInput: import("react").ForwardRefExoticComponent<Pick<PasswordInputProps, "hidden" | "form" | "slot" | "style" | "title" | "pattern" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "children" | "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" | "onResize" | "onResizeCapture" | "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" | "list" | "step" | "size" | "src" | "alt" | "width" | "height" | "value" | "max" | "min" | "name" | "crossOrigin" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "isBlock" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "onChangeValue" | "hasError" | "htmlSize" | "leftAddOn" | "widthCh" | "isDefaultVisible" | "showPasswordTitle" | "hidePasswordTitle"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
type TextInputHTMLProps = ComponentPropsWithRef<'input'>;
|
|
3
|
-
type TextInputBaseProps = Omit<TextInputHTMLProps, 'type' | 'width' | 'size'
|
|
3
|
+
type TextInputBaseProps = Omit<TextInputHTMLProps, 'type' | 'width' | 'size'>;
|
|
4
4
|
export type TextInputType = 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url';
|
|
5
5
|
export type TextInputWidth = '2ch' | '3ch' | '4ch' | '5ch' | '10ch' | '20ch' | '40ch';
|
|
6
6
|
export type TextInputSize = 'sm' | 'md' | 'lg';
|
|
@@ -12,10 +12,10 @@ export type TextInputProps = TextInputBaseProps & {
|
|
|
12
12
|
width?: TextInputWidth;
|
|
13
13
|
widthCh?: number;
|
|
14
14
|
size?: TextInputSize;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
leftAddOn?: ReactNode;
|
|
16
|
+
rightAddOn?: ReactNode;
|
|
17
17
|
htmlSize?: TextInputHTMLProps['size'];
|
|
18
18
|
onChangeValue?: TextInputChangeValueHandler;
|
|
19
19
|
};
|
|
20
|
-
export declare const TextInput: import("react").ForwardRefExoticComponent<Pick<TextInputProps, "hidden" | "form" | "slot" | "style" | "title" | "pattern" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "children" | "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" | "onResize" | "onResizeCapture" | "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" | "list" | "step" | "size" | "src" | "alt" | "width" | "height" | "value" | "type" | "max" | "min" | "name" | "crossOrigin" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "isBlock" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "onChangeValue" | "hasError" | "htmlSize" | "
|
|
20
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<Pick<TextInputProps, "hidden" | "form" | "slot" | "style" | "title" | "pattern" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "children" | "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" | "onResize" | "onResizeCapture" | "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" | "list" | "step" | "size" | "src" | "alt" | "width" | "height" | "value" | "type" | "max" | "min" | "name" | "crossOrigin" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "isBlock" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "onChangeValue" | "hasError" | "htmlSize" | "leftAddOn" | "rightAddOn" | "widthCh"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
21
|
export {};
|
|
@@ -31,9 +31,7 @@ export declare class Toaster {
|
|
|
31
31
|
onHideToast?: ToastHideCallback;
|
|
32
32
|
});
|
|
33
33
|
private _getNextId;
|
|
34
|
-
showToast(toast: ToastParams
|
|
35
|
-
timeoutMs?: number;
|
|
36
|
-
}): ToastID;
|
|
34
|
+
showToast(toast: ToastParams): ToastID;
|
|
37
35
|
hideToast(id: ToastID): void;
|
|
38
36
|
render(options?: {
|
|
39
37
|
toastGap?: number;
|