@nomos-ui/form 0.0.24 → 0.0.25
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/dist/components/file-input.d.ts +16 -30
- package/dist/components/file-input.d.ts.map +1 -1
- package/dist/components/file-input.js +16 -13
- package/dist/components/file-input.js.map +1 -1
- package/dist/exports/index.d.ts +2 -2
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/index.js.map +1 -1
- package/package.json +9 -3
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* Represents a single file entry managed by `FileInput`.
|
|
3
|
-
*
|
|
4
|
-
* The `id` is a stable random key generated on ingestion so React
|
|
5
|
-
* reconciliation stays correct even when the same filename is added twice.
|
|
6
|
-
*/
|
|
7
|
-
export type FileInputFile = {
|
|
8
|
-
/** The native browser `File` object. */
|
|
9
|
-
file: File;
|
|
10
|
-
/**
|
|
11
|
-
* Stable random identifier assigned when the file is added.
|
|
12
|
-
* Use this as the React `key` and to target a specific file for removal.
|
|
13
|
-
*/
|
|
14
|
-
id: string;
|
|
15
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
16
2
|
type FileInputPropsBase = {
|
|
17
3
|
/** Additional class name for the root container. */
|
|
18
4
|
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
|
|
5
|
+
/** Props forwarded to the dropzone wrapper div. */
|
|
6
|
+
dropzoneProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
21
7
|
/** Label text rendered above the dropzone. */
|
|
22
8
|
label?: string;
|
|
23
|
-
/**
|
|
24
|
-
|
|
9
|
+
/** Props forwarded to the label wrapper div. */
|
|
10
|
+
labelProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
25
11
|
/** Marks the field as required for native form validation. */
|
|
26
12
|
required?: boolean;
|
|
27
13
|
/**
|
|
@@ -65,36 +51,34 @@ type FileInputPropsBase = {
|
|
|
65
51
|
};
|
|
66
52
|
type FileInputPropsSingle = FileInputPropsBase & {
|
|
67
53
|
/**
|
|
68
|
-
*
|
|
69
|
-
* When `false` (default) `onChange` receives a single `FileInputFile | null`.
|
|
54
|
+
* When `false` (default) `onChange` receives a single `File | null`.
|
|
70
55
|
*/
|
|
71
56
|
multiple?: false;
|
|
72
57
|
/** The currently selected file, or `null` when empty. */
|
|
73
|
-
value?:
|
|
58
|
+
value?: File | null;
|
|
74
59
|
/**
|
|
75
60
|
* Fired whenever the selected file changes or is removed.
|
|
76
61
|
*
|
|
77
62
|
* @param file - The selected file, or `null` when cleared.
|
|
78
63
|
*/
|
|
79
|
-
onChange?: (file:
|
|
64
|
+
onChange?: (file: File | null) => void;
|
|
80
65
|
};
|
|
81
66
|
type FileInputPropsMultiple = FileInputPropsBase & {
|
|
82
67
|
/**
|
|
83
|
-
*
|
|
84
|
-
* When `true` `onChange` receives the full updated `FileInputFile[]`.
|
|
68
|
+
* When `true` `onChange` receives the full updated `File[]`.
|
|
85
69
|
*/
|
|
86
70
|
multiple: true;
|
|
87
71
|
/**
|
|
88
72
|
* Controlled list of currently accepted files.
|
|
89
73
|
* Pass an empty array (`[]`) to represent an empty / reset state.
|
|
90
74
|
*/
|
|
91
|
-
value?:
|
|
75
|
+
value?: File[];
|
|
92
76
|
/**
|
|
93
77
|
* Fired whenever the file list changes — either a file was added or removed.
|
|
94
78
|
*
|
|
95
79
|
* @param files - The complete updated file list.
|
|
96
80
|
*/
|
|
97
|
-
onChange?: (files:
|
|
81
|
+
onChange?: (files: File[]) => void;
|
|
98
82
|
};
|
|
99
83
|
/**
|
|
100
84
|
* A file-upload input that follows the shadcn component ideology.
|
|
@@ -105,10 +89,12 @@ type FileInputPropsMultiple = FileInputPropsBase & {
|
|
|
105
89
|
* - Drag-and-drop with a clear visual drag state
|
|
106
90
|
* - Per-file rows listing name, size, and a remove button
|
|
107
91
|
* - Single or multiple file support — `onChange` type is narrowed automatically
|
|
92
|
+
* - Pure `File` / `File[]` public API — no wrapper objects leaked to consumers
|
|
93
|
+
* - React keys managed internally via `WeakMap` + `crypto.randomUUID()`
|
|
108
94
|
*
|
|
109
95
|
* @example Single file
|
|
110
96
|
* ```tsx
|
|
111
|
-
* const [file, setFile] = React.useState<
|
|
97
|
+
* const [file, setFile] = React.useState<File | null>(null);
|
|
112
98
|
*
|
|
113
99
|
* <FileInput
|
|
114
100
|
* label="Resume"
|
|
@@ -122,7 +108,7 @@ type FileInputPropsMultiple = FileInputPropsBase & {
|
|
|
122
108
|
*
|
|
123
109
|
* @example Multiple files
|
|
124
110
|
* ```tsx
|
|
125
|
-
* const [files, setFiles] = React.useState<
|
|
111
|
+
* const [files, setFiles] = React.useState<File[]>([]);
|
|
126
112
|
*
|
|
127
113
|
* <FileInput
|
|
128
114
|
* label="Attachments"
|
|
@@ -135,6 +121,6 @@ type FileInputPropsMultiple = FileInputPropsBase & {
|
|
|
135
121
|
* ```
|
|
136
122
|
*/
|
|
137
123
|
export type FileInputProps = FileInputPropsSingle | FileInputPropsMultiple;
|
|
138
|
-
export default function FileInput({ className,
|
|
124
|
+
export default function FileInput({ className, dropzoneProps, label, labelProps, required, showRequiredSign, tip, error, accept, acceptLabel, maxSize, multiple, value, onChange, onError, disabled, }: FileInputProps): import("react/jsx-runtime").JSX.Element;
|
|
139
125
|
export {};
|
|
140
126
|
//# sourceMappingURL=file-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,kBAAkB,GAAG;IACxB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IACrD,8CAA8C;IAC9C,KAAK,CAAC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,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,aAAa,EACb,KAAK,EACL,UAAU,EACV,QAAgB,EAChB,gBAAwB,EACxB,GAAG,EACH,KAAK,EACL,MAAM,EACN,WAAW,EACX,OAAO,EACP,QAAgB,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAgB,GACjB,EAAE,cAAc,2CAwLhB"}
|
|
@@ -45,12 +45,16 @@ function formatBytes(bytes) {
|
|
|
45
45
|
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
46
46
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return Math.random().toString(36).slice(2, 9);
|
|
50
|
-
}
|
|
51
|
-
function FileInput({ className, dropzoneClassName, label, labelClassName, required = false, showRequiredSign = false, tip, error, accept, acceptLabel, maxSize, multiple = false, value, onChange, onError, disabled = false, }) {
|
|
48
|
+
function FileInput({ className, dropzoneProps, label, labelProps, required = false, showRequiredSign = false, tip, error, accept, acceptLabel, maxSize, multiple = false, value, onChange, onError, disabled = false, }) {
|
|
52
49
|
const inputRef = React.useRef(null);
|
|
53
50
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
51
|
+
const idMapRef = React.useRef(new WeakMap());
|
|
52
|
+
function getFileId(file) {
|
|
53
|
+
if (!idMapRef.current.has(file)) {
|
|
54
|
+
idMapRef.current.set(file, crypto.randomUUID());
|
|
55
|
+
}
|
|
56
|
+
return idMapRef.current.get(file);
|
|
57
|
+
}
|
|
54
58
|
const fileList = multiple
|
|
55
59
|
? (value ?? [])
|
|
56
60
|
: value
|
|
@@ -65,23 +69,20 @@ function FileInput({ className, dropzoneClassName, label, labelClassName, requir
|
|
|
65
69
|
onError?.(`"${file.name}" exceeds the maximum size of ${formatBytes(maxSize)}.`);
|
|
66
70
|
return;
|
|
67
71
|
}
|
|
68
|
-
incoming.push(
|
|
72
|
+
incoming.push(file);
|
|
69
73
|
});
|
|
70
74
|
if (!incoming.length)
|
|
71
75
|
return;
|
|
72
76
|
if (multiple) {
|
|
73
|
-
onChange?.([
|
|
74
|
-
...fileList,
|
|
75
|
-
...incoming,
|
|
76
|
-
]);
|
|
77
|
+
onChange?.([...fileList, ...incoming]);
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
80
|
onChange?.(incoming[0] ?? null);
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
|
-
function removeFile(
|
|
83
|
+
function removeFile(file) {
|
|
83
84
|
if (multiple) {
|
|
84
|
-
onChange?.(fileList.filter((f) => f
|
|
85
|
+
onChange?.(fileList.filter((f) => f !== file));
|
|
85
86
|
}
|
|
86
87
|
else {
|
|
87
88
|
onChange?.(null);
|
|
@@ -103,9 +104,11 @@ function FileInput({ className, dropzoneClassName, label, labelClassName, requir
|
|
|
103
104
|
setIsDragging(false);
|
|
104
105
|
processFiles(e.dataTransfer.files);
|
|
105
106
|
}
|
|
107
|
+
const { className: dropzoneClassName, ...restDropzoneProps } = dropzoneProps ?? {};
|
|
108
|
+
const { className: labelClassName, ...restLabelProps } = labelProps ?? {};
|
|
106
109
|
const hasFiles = fileList.length > 0;
|
|
107
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("w-full space-y-1.5", className), children: [label && ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("flex items-center gap-1", labelClassName), children: [(0, jsx_runtime_1.jsx)("label", { className: "text-sm font-bold text-foreground", children: label }), required && showRequiredSign && ((0, jsx_runtime_1.jsx)(lucide_react_1.AsteriskIcon, { className: "h-3 w-3 text-destructive" }))] })), (0, jsx_runtime_1.jsxs)("div", { onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, className: (0, utils_1.cn)("relative flex flex-col items-center justify-center gap-3 rounded-lg border-2 border-dashed px-6 py-8 text-center transition-colors", "border-input bg-transparent", !disabled && "hover:border-ring/50 hover:bg-accent/40", isDragging && "border-ring bg-accent/60", error && "border-destructive", disabled && "cursor-not-allowed opacity-50", dropzoneClassName), children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, className: "absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed", onChange: (e) => processFiles(e.target.files) }), (0, jsx_runtime_1.jsx)(lucide_react_1.CloudUploadIcon, { className: (0, utils_1.cn)("h-8 w-8 transition-colors", isDragging ? "text-ring" : "text-muted-foreground"), strokeWidth: 1.5 }), (0, jsx_runtime_1.jsxs)("div", { className: "pointer-events-none select-none space-y-1", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Choose a file or drag & drop it here" }), (acceptLabel || maxSize) && ((0, jsx_runtime_1.jsx)("p", { className: "text-xs text-muted-foreground", children: [acceptLabel, maxSize ? `up to ${formatBytes(maxSize)}` : null]
|
|
110
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("w-full space-y-1.5", className), children: [label && ((0, jsx_runtime_1.jsxs)("div", { ...restLabelProps, className: (0, utils_1.cn)("flex items-center gap-1", labelClassName), children: [(0, jsx_runtime_1.jsx)("label", { className: "text-sm font-bold text-foreground", children: label }), required && showRequiredSign && ((0, jsx_runtime_1.jsx)(lucide_react_1.AsteriskIcon, { className: "h-3 w-3 text-destructive" }))] })), (0, jsx_runtime_1.jsxs)("div", { ...restDropzoneProps, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, className: (0, utils_1.cn)("relative flex flex-col items-center justify-center gap-3 rounded-lg border-2 border-dashed px-6 py-8 text-center transition-colors", "border-input bg-transparent", !disabled && "hover:border-ring/50 hover:bg-accent/40", isDragging && "border-ring bg-accent/60", error && "border-destructive", disabled && "cursor-not-allowed opacity-50", dropzoneClassName), children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, className: "absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed", onChange: (e) => processFiles(e.target.files) }), (0, jsx_runtime_1.jsx)(lucide_react_1.CloudUploadIcon, { className: (0, utils_1.cn)("h-8 w-8 transition-colors", isDragging ? "text-ring" : "text-muted-foreground"), strokeWidth: 1.5 }), (0, jsx_runtime_1.jsxs)("div", { className: "pointer-events-none select-none space-y-1", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Choose a file or drag & drop it here" }), (acceptLabel || maxSize) && ((0, jsx_runtime_1.jsx)("p", { className: "text-xs text-muted-foreground", children: [acceptLabel, maxSize ? `up to ${formatBytes(maxSize)}` : null]
|
|
108
111
|
.filter(Boolean)
|
|
109
|
-
.join(", ") }))] }), (0, jsx_runtime_1.jsx)("span", { className: "pointer-events-none select-none inline-flex items-center rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium shadow-xs", children: "Browse File" })] }), hasFiles && ((0, jsx_runtime_1.jsx)("ul", { className: "space-y-2", children: fileList.map((
|
|
112
|
+
.join(", ") }))] }), (0, jsx_runtime_1.jsx)("span", { className: "pointer-events-none select-none inline-flex items-center rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium shadow-xs", children: "Browse File" })] }), hasFiles && ((0, jsx_runtime_1.jsx)("ul", { className: "space-y-2", children: fileList.map((file) => ((0, jsx_runtime_1.jsxs)("li", { className: "flex items-center gap-3 rounded-lg border border-input bg-background px-3 py-2.5 shadow-xs", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-input bg-muted", children: (0, jsx_runtime_1.jsx)(lucide_react_1.FileIcon, { className: "h-4 w-4 text-muted-foreground" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("p", { className: "truncate text-sm font-medium text-foreground", children: file.name }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-muted-foreground", children: formatBytes(file.size) })] }), !disabled && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => removeFile(file), className: "shrink-0 rounded-full p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "aria-label": `Remove ${file.name}`, children: (0, jsx_runtime_1.jsx)(lucide_react_1.XIcon, { className: "h-4 w-4" }) }))] }, getFileId(file)))) })), tip && !error && ((0, jsx_runtime_1.jsx)("p", { className: "text-xs text-muted-foreground tip-message", children: tip })), error && ((0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-destructive error-message", children: ["*", error] }))] }));
|
|
110
113
|
}
|
|
111
114
|
//# sourceMappingURL=file-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwIA,4BAyMC;;AAjVD,6CAA+B;AAC/B,+CAA8E;AAC9E,oDAA8C;AAgI9C,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC;AAED,SAAwB,SAAS,CAAC,EAChC,SAAS,EACT,aAAa,EACb,KAAK,EACL,UAAU,EACV,QAAQ,GAAG,KAAK,EAChB,gBAAgB,GAAG,KAAK,EACxB,GAAG,EACH,KAAK,EACL,MAAM,EACN,WAAW,EACX,OAA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AAC"}
|
package/dist/exports/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ import Textarea from "../components/textarea";
|
|
|
7
7
|
import FormTextarea from "../components/form-textarea";
|
|
8
8
|
import FormImageInput from "../components/form-image-input";
|
|
9
9
|
import ImageInput from "../components/image-input";
|
|
10
|
-
import FileInput, { FileInputProps
|
|
10
|
+
import FileInput, { FileInputProps } from "../components/file-input";
|
|
11
11
|
import FormFileInput, { FormFileInputProps } from "../components/form-file-input";
|
|
12
12
|
import FormDebugInfo from "../components/form-debug-info";
|
|
13
13
|
export { Button, FormDebugInfo, FormInput, Input, Select, FormSelect, Textarea, FormTextarea, ImageInput, FormImageInput, FileInput, FormFileInput, };
|
|
14
|
-
export type { SelectOption, SelectProps, FormSelectProps, FormFileInputProps, FileInputProps,
|
|
14
|
+
export type { SelectOption, SelectProps, FormSelectProps, FormFileInputProps, FileInputProps, };
|
|
15
15
|
export * from "../components/input";
|
|
16
16
|
export * from "../components/form-input";
|
|
17
17
|
export * from "../components/button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,SAAS,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,aAAa,EAAE,EACpB,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,KAAK,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,GACd,CAAC;AACF,YAAY,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,cAAc,GACf,CAAC;AACF,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kEAA0C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kEAA0C;AAgBxC,iBAhBK,gBAAM,CAgBL;AAfR,0EAAiD;AAiB/C,oBAjBK,oBAAS,CAiBL;AAhBX,gEAAwC;AAiBtC,gBAjBK,eAAK,CAiBL;AAhBP,kEAAyE;AAiBvE,iBAjBK,gBAAM,CAiBL;AAhBR,4EAAwE;AAiBtE,qBAjBK,qBAAU,CAiBL;AAhBZ,sEAA8C;AAiB5C,mBAjBK,kBAAQ,CAiBL;AAhBV,gFAAuD;AAiBrD,uBAjBK,uBAAY,CAiBL;AAhBd,sFAA4D;AAkB1D,yBAlBK,0BAAc,CAkBL;AAjBhB,4EAAmD;AAgBjD,qBAhBK,qBAAU,CAgBL;AAfZ,0EAAqE;AAiBnE,oBAjBK,oBAAS,CAiBL;AAhBX,oFAEuC;AAerC,wBAjBK,yBAAa,CAiBL;AAdf,oFAA0D;AAIxD,wBAJK,yBAAa,CAIL;AAmBf,sDAAoC;AACpC,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,gEAA8C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomos-ui/form",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "The Shadcn library for building robust React forms",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/exports/index.js",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"typesVersions": {
|
|
21
21
|
"*": {
|
|
22
|
-
"utils": [
|
|
22
|
+
"utils": [
|
|
23
|
+
"./dist/exports/utils/index.d.ts"
|
|
24
|
+
]
|
|
23
25
|
}
|
|
24
26
|
},
|
|
25
27
|
"scripts": {
|
|
@@ -62,7 +64,11 @@
|
|
|
62
64
|
"url": "https://github.com/uanela/nomos-ui/issues"
|
|
63
65
|
},
|
|
64
66
|
"homepage": "https://github.com/uanela/nomos-ui",
|
|
65
|
-
"files": [
|
|
67
|
+
"files": [
|
|
68
|
+
"dist",
|
|
69
|
+
"README.md",
|
|
70
|
+
"LICENSE"
|
|
71
|
+
],
|
|
66
72
|
"sideEffects": false,
|
|
67
73
|
"packageManager": "pnpm@10.13.1",
|
|
68
74
|
"dependencies": {
|