draft-components 1.0.0-beta.9 → 1.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/README.md +47 -1
- package/cjs/components/alert/alert.cjs +4 -3
- package/cjs/components/color-picker/color-picker-button.cjs +16 -0
- package/cjs/components/color-picker/color-picker.cjs +14 -0
- package/cjs/components/index.cjs +6 -0
- package/cjs/components/password-input/password-input.cjs +2 -2
- package/cjs/components/selection-control/selection-control.cjs +1 -1
- package/cjs/components/text-input/text-input.cjs +25 -9
- package/cjs/components/toaster/toaster.cjs +2 -2
- package/cjs/index.cjs +6 -0
- package/css/draft-components.css +33 -17
- package/esm/components/alert/alert.js +4 -3
- package/esm/components/color-picker/color-picker-button.js +14 -0
- package/esm/components/color-picker/color-picker.js +12 -0
- package/esm/components/index.js +3 -0
- package/esm/components/password-input/password-input.js +2 -2
- package/esm/components/selection-control/selection-control.js +2 -2
- package/esm/components/text-input/text-input.js +26 -10
- package/esm/components/toaster/toaster.js +2 -2
- package/esm/index.js +3 -0
- package/package.json +30 -29
- package/types/components/alert/alert.d.ts +5 -3
- package/types/components/avatar/avatar.d.ts +1 -1
- package/types/components/button/button.d.ts +1 -1
- package/types/components/button/icon-button.d.ts +1 -1
- package/types/components/caption/caption.d.ts +1 -1
- package/types/components/checkbox/checkbox.d.ts +1 -1
- package/types/components/file-picker/file-picker.d.ts +1 -1
- package/types/components/filter-buttons/filter-button.d.ts +1 -1
- package/types/components/form-field/form-field.d.ts +5 -2
- package/types/components/index.d.ts +3 -0
- package/types/components/label/label.d.ts +1 -1
- package/types/components/menu/menu-item.d.ts +1 -1
- package/types/components/password-input/password-input.d.ts +2 -2
- package/types/components/popover/popover.d.ts +1 -1
- package/types/components/radio/radio.d.ts +1 -1
- package/types/components/select/select.d.ts +3 -3
- package/types/components/selection-control/selection-control.d.ts +2 -2
- package/types/components/slider/slider.d.ts +1 -1
- package/types/components/spinner/spinner.d.ts +1 -1
- package/types/components/switch/switch.d.ts +1 -1
- package/types/components/table/table-body.d.ts +2 -2
- package/types/components/table/table-cell.d.ts +2 -2
- package/types/components/table/table-container.d.ts +1 -1
- package/types/components/table/table-head-cell.d.ts +1 -1
- package/types/components/table/table-head.d.ts +1 -1
- package/types/components/table/table-row.d.ts +1 -1
- package/types/components/table/table.d.ts +1 -1
- package/types/components/text-input/text-input.d.ts +7 -4
- package/types/components/textarea/textarea.d.ts +1 -1
- package/types/components/toast/toast-button.d.ts +2 -2
- package/types/components/toaster/toaster.d.ts +1 -3
|
@@ -1,10 +1,13 @@
|
|
|
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';
|
|
7
7
|
export type TextInputChangeValueHandler = (value: string) => void;
|
|
8
|
+
export type TextInputRenderAddOn = (props: {
|
|
9
|
+
className: string;
|
|
10
|
+
}) => ReactNode;
|
|
8
11
|
export type TextInputProps = TextInputBaseProps & {
|
|
9
12
|
hasError?: boolean;
|
|
10
13
|
isBlock?: boolean;
|
|
@@ -12,10 +15,10 @@ export type TextInputProps = TextInputBaseProps & {
|
|
|
12
15
|
width?: TextInputWidth;
|
|
13
16
|
widthCh?: number;
|
|
14
17
|
size?: TextInputSize;
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
leftAddOn?: ReactNode | TextInputRenderAddOn;
|
|
19
|
+
rightAddOn?: ReactNode | TextInputRenderAddOn;
|
|
17
20
|
htmlSize?: TextInputHTMLProps['size'];
|
|
18
21
|
onChangeValue?: TextInputChangeValueHandler;
|
|
19
22
|
};
|
|
20
|
-
export declare const TextInput: import("react").ForwardRefExoticComponent<
|
|
23
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
24
|
export {};
|
|
@@ -16,5 +16,5 @@ export type TextareaProps = TextareaHTMLProps & {
|
|
|
16
16
|
width?: TextareaWidth;
|
|
17
17
|
onChangeValue?: TextAreaChangeValueHandler;
|
|
18
18
|
};
|
|
19
|
-
export declare const Textarea: import("react").ForwardRefExoticComponent<
|
|
19
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
20
20
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef } from 'react';
|
|
2
2
|
export type ToastButtonProps = ComponentPropsWithRef<'button'>;
|
|
3
|
-
export declare const ToastButton: import("react").ForwardRefExoticComponent<
|
|
3
|
+
export declare const ToastButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
4
4
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
5
|
-
}, "
|
|
5
|
+
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -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;
|