wdwh 1.12.22 → 1.12.23-dev.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/components.d.ts +3 -1
- package/components.js +5 -5
- package/package.json +1 -1
package/components.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function Button({ label, children, className, ...props }: ButtonProps): import("react").JSX.Element;
|
|
2
2
|
export declare function TextInput({ onChange, allow, ...props }: TextInputProps): import("react").JSX.Element;
|
|
3
|
-
export declare function FileInput({ children, onFile, className, ...props }: FileInputProps): import("react").JSX.Element;
|
|
3
|
+
export declare function FileInput({ children, onFile, className, boxClassName, style, boxStyle, ...props }: FileInputProps): import("react").JSX.Element;
|
|
4
4
|
type ButtonProps = {
|
|
5
5
|
label?: string;
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -14,5 +14,7 @@ type TextInputProps = {
|
|
|
14
14
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, `type` | `onChange`>;
|
|
15
15
|
type FileInputProps = {
|
|
16
16
|
onFile: (file: File) => void;
|
|
17
|
+
boxClassName?: string;
|
|
18
|
+
boxStyle?: React.CSSProperties;
|
|
17
19
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, `type`>;
|
|
18
20
|
export {};
|
package/components.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{clsx as
|
|
1
|
+
import{clsx as p}from".";import{useConst as a}from"./hooks";function d({label:n,children:e,className:i,...t}){return<button className={p(i,"cursor-pointer")}{...t}>
|
|
2
2
|
{n||e}
|
|
3
|
-
</button>}function
|
|
4
|
-
<label htmlFor={
|
|
3
|
+
</button>}function f({onChange:n,allow:e,...i}){return<input type="text"onChange={n?({target:t})=>{if(e&&!e.test(t.value)){t.value=t.value.split("").filter(o=>e.test(o)).join("");return}n(t.value)}:void 0}{...i}/>}function x({children:n,onFile:e,className:i,boxClassName:t,style:o,boxStyle:r,...l}){const u=a(l?.id||Math.random().toFixed(7));return<div className={t}style={r}>
|
|
4
|
+
<label htmlFor={u}className={i}style={o}>
|
|
5
5
|
{n}
|
|
6
6
|
</label>
|
|
7
|
-
<input type="file"className="hidden"id={
|
|
8
|
-
</div>}export{
|
|
7
|
+
<input type="file"className="hidden"id={u}onChange={({target:s})=>{s.files&&s.files[0]&&e(s.files[0])}}{...l}/>
|
|
8
|
+
</div>}export{d as Button,x as FileInput,f as TextInput};
|