@particle-academy/react-fancy 6.6.1 → 6.7.1
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/CHANGELOG.md +13 -0
- package/README.md +1 -0
- package/dist/chunk-5WMVBFBD.js +3 -0
- package/dist/{chunk-VXHFR5MV.js.map → chunk-5WMVBFBD.js.map} +1 -1
- package/dist/chunk-7STOB5MB.cjs +4 -0
- package/dist/{chunk-O5IO7TCO.cjs.map → chunk-7STOB5MB.cjs.map} +1 -1
- package/dist/chunk-LY3RQB3H.js +139 -0
- package/dist/chunk-LY3RQB3H.js.map +1 -0
- package/dist/{chunk-JEHV7PYP.js → chunk-SCGTO3PX.js} +21 -5
- package/dist/chunk-SCGTO3PX.js.map +1 -0
- package/dist/chunk-XBFTO64U.cjs +141 -0
- package/dist/chunk-XBFTO64U.cjs.map +1 -0
- package/dist/{chunk-AGO4AA3K.cjs → chunk-XHUV3VSM.cjs} +21 -5
- package/dist/chunk-XHUV3VSM.cjs.map +1 -0
- package/dist/file-upload.cjs +3 -3
- package/dist/file-upload.d.cts +17 -2
- package/dist/file-upload.d.ts +17 -2
- package/dist/file-upload.js +1 -1
- package/dist/index.cjs +9 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/inputs.cjs +6 -1
- package/dist/inputs.d.cts +1 -0
- package/dist/inputs.d.ts +1 -0
- package/dist/inputs.js +2 -1
- package/dist/number-field.cjs +30 -0
- package/dist/number-field.cjs.map +1 -0
- package/dist/number-field.d.cts +48 -0
- package/dist/number-field.d.ts +48 -0
- package/dist/number-field.js +21 -0
- package/dist/number-field.js.map +1 -0
- package/docs/FileUpload.md +32 -2
- package/docs/Input.md +2 -0
- package/docs/NumberField.md +85 -0
- package/package.json +11 -1
- package/dist/chunk-AGO4AA3K.cjs.map +0 -1
- package/dist/chunk-JEHV7PYP.js.map +0 -1
- package/dist/chunk-O5IO7TCO.cjs +0 -4
- package/dist/chunk-VXHFR5MV.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FileUpload/FileUpload.context.ts","../src/components/FileUpload/FileUploadDropzone.tsx","../src/components/FileUpload/FileUploadList.tsx","../src/components/FileUpload/matchesAccept.ts","../src/components/FileUpload/FileUpload.tsx"],"names":["createContext","useContext","useState","useRef","useId","useCallback","jsxs","cn","jsx","Fragment","Upload","useMemo","useEffect","File","X"],"mappings":";;;;;;;AAGO,IAAM,iBAAA,GACXA,oBAA6C,IAAI,CAAA;AAE5C,SAAS,aAAA,GAAwC;AACtD,EAAA,MAAM,GAAA,GAAMC,iBAAW,iBAAiB,CAAA;AACxC,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;ACPA,IAAM,oBAAA,GAAuB,cAAA;AAG7B,IAAM,YAAA,GAAe,oCAAA;AAqBd,SAAS,kBAAA,CAAmB;AAAA,EACjC,QAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,EAA4B;AAC1B,EAAA,MAAM,EAAE,QAAA,EAAU,QAAA,EAAU,MAAA,EAAQ,QAAA,KAAa,aAAA,EAAc;AAC/D,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAIC,eAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,QAAA,GAAWC,aAAyB,IAAI,CAAA;AAC9C,EAAA,MAAM,UAAUC,WAAA,EAAM;AACtB,EAAA,MAAM,MAAA,GAAS,QAAA,KAAa,MAAA,IAAa,QAAA,KAAa,IAAA;AACtD,EAAA,MAAM,UAAA,GAAa,WAAA,KAAgB,MAAA,GAAS,oBAAA,GAAuB,YAAA,CAAA;AAEnE,EAAA,MAAM,UAAA,GAAaC,iBAAA;AAAA,IACjB,CAAC,CAAA,KAAuB;A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AA,MAAM,UAAU,KAAA,CAAM,MAAA,CAAO,CAAC,CAAA,EAAG,CAAA,KAAM,MAAM,KAAK,CAAA;AAClD,MAAA,IAAI,KAAA,KAAU,MAAA,EAAW,gBAAA,CAAiB,OAAO,CAAA;AACjD,MAAA,QAAA,GAAW,OAAO,CAAA;AAAA,IACpB,CAAA;AAAA,IACA,CAAC,KAAA,EAAO,QAAA,EAAU,KAAK;AAAA,GACzB;AAEA,EAAA,MAAM,GAAA,GAAMM,aAAAA;AAAA,IACV,OAAO,EAAE,KAAA,EAAO,UAAU,UAAA,EAAY,QAAA,EAAU,QAAQ,QAAA,EAAS,CAAA;AAAA,IACjE,CAAC,KAAA,EAAO,QAAA,EAAU,UAAA,EAAY,QAAA,EAAU,QAAQ,QAAQ;AAAA,GAC1D;AAEA,EAAA,uBACEH,cAAAA,CAAC,iBAAA,CAAkB,QAAA,EAAlB,EAA2B,OAAO,GAAA,EACjC,QAAA,kBAAAA,cAAAA,CAAC,KAAA,EAAA,EAAI,gCAA6B,EAAA,EAAG,SAAA,EAAWD,qBAAG,SAAS,CAAA,EAAI,UAAS,CAAA,EAC3E,CAAA;AAEJ;AAEO,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,QAAA,EAAU,kBAAA;AAAA,EACV,IAAA,EAAM;AACR,CAAC","file":"chunk-XHUV3VSM.cjs","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { FileUploadContextValue } from \"./FileUpload.types\";\n\nexport const FileUploadContext =\n createContext<FileUploadContextValue | null>(null);\n\nexport function useFileUpload(): FileUploadContextValue {\n const ctx = useContext(FileUploadContext);\n if (!ctx) {\n throw new Error(\n \"FileUpload compound components must be used within <FileUpload>\",\n );\n }\n return ctx;\n}\n","import { useCallback, useId, useRef, useState } from \"react\";\nimport { Upload } from \"lucide-react\";\nimport { cn } from \"../../utils/cn\";\nimport { useFileUpload } from \"./FileUpload.context\";\nimport type { FileUploadDropzoneProps } from \"./FileUpload.types\";\n\n/** Accessible name of the browse trigger when the zone has custom children. */\nconst DEFAULT_BROWSE_LABEL = \"Browse files\";\n\n/** The default zone copy; it doubles as the trigger's accessible name. */\nconst DEFAULT_COPY = \"Drop files here or click to browse\";\n\n/*\n * Keyboard access (after 5.59.0). Until then the zone was a clickable div around a\n * display:none input: no tab stop, no role, no key handler, so a keyboard or\n * switch user could not open the picker at all.\n *\n * The trigger is a REAL <button type=\"button\">, not a div with role=\"button\":\n * focus, Enter and Space (Space on keyup, cancelled by moving off) then come\n * from the platform instead of a key handler that has to get those right.\n *\n * - Default content: the button wraps the icon and the copy, so the visible\n * text IS its accessible name and the look is unchanged.\n * - Custom children: they may contain their own interactive content, which a\n * button must not wrap, so the button is visually hidden beside them and the\n * ZONE draws the focus ring (has-focus-visible) — the focus indicator is\n * never invisible.\n *\n * A click anywhere on the zone still opens the picker, as before; a click on\n * the button bubbles to the zone and is handled there once.\n */\nexport function FileUploadDropzone({\n children,\n className,\n browseLabel,\n}: FileUploadDropzoneProps) {\n const { addFiles, disabled, accept, multiple } = useFileUpload();\n const [dragOver, setDragOver] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputId = useId();\n const custom = children !== undefined && children !== null;\n const inputLabel = browseLabel ?? (custom ? DEFAULT_BROWSE_LABEL : DEFAULT_COPY);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n setDragOver(false);\n if (disabled) return;\n addFiles(e.dataTransfer.files);\n },\n [addFiles, disabled],\n );\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n setDragOver(true);\n }, []);\n\n const handleDragLeave = useCallback(() => setDragOver(false), []);\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n // The input's own click bubbles back up here; re-entering would ask for a\n // second picker.\n if (e.target === inputRef.current) return;\n inputRef.current?.click();\n },\n [disabled],\n );\n\n return (\n <div\n data-react-fancy-file-upload-dropzone=\"\"\n data-drag-over={dragOver ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n aria-disabled={disabled || undefined}\n onDrop={handleDrop}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onClick={handleClick}\n className={cn(\n \"flex cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-8 text-center transition-[color,background-color,border-color,box-shadow]\",\n // Full opacity on purpose: a translucent 2px ring over a dashed border\n // falls under WCAG 2.2's 3:1 for a focus indicator. The offset gap is\n // painted with the surface token so it matches the page in dark mode.\n \"has-focus-visible:ring-2 has-focus-visible:ring-offset-2 has-focus-visible:ring-[color:var(--fancy-focus,var(--color-blue-500))] has-focus-visible:ring-offset-[color:var(--fancy-surface,var(--color-white))] dark:has-focus-visible:ring-[color:var(--fancy-focus-dark,var(--color-blue-400))] dark:has-focus-visible:ring-offset-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\",\n dragOver\n ? \"border-blue-400 bg-blue-50 dark:border-blue-500 dark:bg-blue-950\"\n : \"border-[color:var(--fancy-border-strong,var(--color-zinc-300))] hover:border-zinc-400 dark:border-[color:var(--fancy-border-strong-dark,var(--color-zinc-700))] dark:hover:border-zinc-500\",\n disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n >\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n className=\"hidden\"\n tabIndex={-1}\n aria-label={inputLabel}\n onChange={(e) => {\n if (e.target.files) addFiles(e.target.files);\n\n // Reset, or choosing the SAME file again fires no `change` event at\n // all and the gesture is simply dead — \"remove it, then re-add it\"\n // and \"retry the import that just failed\" both stop working. The\n // component never sees those files to reject them; it is not asked.\n e.target.value = \"\";\n }}\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n />\n {custom ? (\n <>\n {children}\n <button\n type=\"button\"\n data-react-fancy-file-upload-browse=\"\"\n aria-controls={inputId}\n disabled={disabled}\n className=\"sr-only\"\n >\n {browseLabel ?? DEFAULT_BROWSE_LABEL}\n </button>\n </>\n ) : (\n <button\n type=\"button\"\n data-react-fancy-file-upload-browse=\"\"\n aria-controls={inputId}\n aria-label={browseLabel}\n disabled={disabled}\n className=\"flex cursor-pointer flex-col items-center rounded-md outline-none disabled:cursor-not-allowed\"\n >\n <Upload size={32} strokeWidth={1.5} aria-hidden=\"true\" className=\"mb-2 text-zinc-400\" />\n <span className=\"text-sm text-zinc-500\">{DEFAULT_COPY}</span>\n </button>\n )}\n </div>\n );\n}\n\nFileUploadDropzone.displayName = \"FileUploadDropzone\";\n","import { useEffect, useMemo } from \"react\";\nimport { File, X } from \"lucide-react\";\nimport { cn } from \"../../utils/cn\";\nimport { useFileUpload } from \"./FileUpload.context\";\nimport type { FileUploadListProps } from \"./FileUpload.types\";\n\nfunction formatSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nfunction getExtension(name: string): string {\n const parts = name.split(\".\");\n return parts.length > 1 ? parts.pop()!.toUpperCase() : \"\";\n}\n\nfunction ThumbnailItem({ file, index, onRemove }: { file: File; index: number; onRemove: (i: number) => void }) {\n const isImage = file.type.startsWith(\"image/\");\n const objectUrl = useMemo(() => (isImage ? URL.createObjectURL(file) : null), [file, isImage]);\n\n useEffect(() => {\n return () => {\n if (objectUrl) URL.revokeObjectURL(objectUrl);\n };\n }, [objectUrl]);\n\n return (\n <div className=\"group relative flex w-20 flex-col items-center gap-1\">\n <div className=\"relative h-20 w-20 overflow-hidden rounded-lg border border-[color:var(--fancy-border,var(--color-zinc-200))] bg-zinc-50 dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))] dark:bg-zinc-800\">\n {isImage && objectUrl ? (\n <img src={objectUrl} alt={file.name} className=\"h-full w-full object-cover\" />\n ) : (\n <div className=\"flex h-full w-full flex-col items-center justify-center gap-1\">\n <File size={20} className=\"text-zinc-400\" />\n <span className=\"text-[10px] font-medium text-zinc-500\">{getExtension(file.name)}</span>\n </div>\n )}\n <button\n type=\"button\"\n onClick={() => onRemove(index)}\n className=\"absolute top-1 right-1 flex h-5 w-5 items-center justify-center rounded-full bg-black/60 text-white opacity-0 transition-opacity hover:bg-black/80 group-hover:opacity-100\"\n aria-label={`Remove ${file.name}`}\n >\n <X size={10} />\n </button>\n </div>\n <span className=\"w-full truncate text-center text-xs text-zinc-500\">{file.name}</span>\n </div>\n );\n}\n\nexport function FileUploadList({ thumbnail, className }: FileUploadListProps) {\n const { files, removeFile } = useFileUpload();\n\n if (files.length === 0) return null;\n\n if (thumbnail) {\n return (\n <div data-react-fancy-file-upload-list=\"\" className={cn(\"mt-3 flex flex-wrap gap-3\", className)}>\n {files.map((file, i) => (\n <ThumbnailItem key={`${file.name}-${i}`} file={file} index={i} onRemove={removeFile} />\n ))}\n </div>\n );\n }\n\n return (\n <ul data-react-fancy-file-upload-list=\"\" className={cn(\"mt-3 space-y-2\", className)}>\n {files.map((file, i) => (\n <li\n key={`${file.name}-${i}`}\n className=\"flex items-center gap-3 rounded-lg border border-[color:var(--fancy-border,var(--color-zinc-200))] px-3 py-2 text-sm dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))]\"\n >\n <File size={16} className=\"shrink-0 text-zinc-400\" />\n <span className=\"flex-1 truncate\">{file.name}</span>\n <span className=\"shrink-0 text-xs text-zinc-400\">\n {formatSize(file.size)}\n </span>\n <button\n type=\"button\"\n onClick={() => removeFile(i)}\n className=\"shrink-0 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300\"\n aria-label={`Remove ${file.name}`}\n >\n <X size={14} />\n </button>\n </li>\n ))}\n </ul>\n );\n}\n\nFileUploadList.displayName = \"FileUploadList\";\n","/**\n * Does a file satisfy an `accept` string?\n *\n * The browser enforces `accept` in the FILE PICKER only. A drag-and-drop never\n * opens a picker, so on the drop path this is the only thing standing between an\n * image-only dropzone and a dropped executable. Forwarding the attribute to the\n * hidden input is half the job; this is the other half.\n *\n * Follows the HTML `accept` grammar: a comma-separated list of extensions\n * (`.csv`), exact MIME types (`text/plain`) and type wildcards (`image/*`).\n * Matching is case-insensitive, because a drop reports whatever the OS says and\n * `TEXT/PLAIN` is a real thing to receive.\n *\n * A dropped file often carries an EMPTY `type` — the OS may not know it and\n * `File.type` is a hint, never a guarantee. That is why extension rules are\n * checked against the name and not the type: an `accept=\".csv\"` zone has to work\n * for a .csv whose type is `\"\"`, which is the common case rather than the edge.\n */\nexport function matchesAccept(file: File, accept: string): boolean {\n const rules = accept\n .split(\",\")\n .map((rule) => rule.trim().toLowerCase())\n .filter(Boolean);\n\n // An accept string that lists nothing constrains nothing. Failing closed here\n // would turn `accept=\"\"` into a dropzone that silently swallows every file.\n if (rules.length === 0) return true;\n\n const type = file.type.toLowerCase();\n const name = file.name.toLowerCase();\n\n return rules.some((rule) => {\n if (rule.startsWith(\".\")) return name.endsWith(rule);\n if (rule.endsWith(\"/*\")) return type.startsWith(rule.slice(0, -1));\n return type === rule;\n });\n}\n","import { useCallback, useMemo, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FileUploadContext } from \"./FileUpload.context\";\nimport { FileUploadDropzone } from \"./FileUploadDropzone\";\nimport { FileUploadList } from \"./FileUploadList\";\nimport { matchesAccept } from \"./matchesAccept\";\nimport type {\n FileRejection,\n FileRejectionReason,\n FileUploadProps,\n} from \"./FileUpload.types\";\n\nfunction rejection(file: File, reason: FileRejectionReason): FileRejection {\n return { name: file.name, size: file.size, type: file.type, reason };\n}\n\nfunction FileUploadRoot({\n children,\n value,\n onChange,\n onReject,\n accept,\n multiple = true,\n maxFiles,\n maxSize,\n disabled = false,\n className,\n}: FileUploadProps) {\n const [internalFiles, setInternalFiles] = useState<File[]>([]);\n const files = value ?? internalFiles;\n\n const addFiles = useCallback(\n (newFiles: FileList | File[]) => {\n let toAdd = Array.from(newFiles);\n const rejections: FileRejection[] = [];\n\n // Each file is reported once, under the first rule it failed.\n const keepOnly = (\n passes: (f: File) => boolean,\n reason: FileRejectionReason,\n ) => {\n toAdd = toAdd.filter((f) => {\n if (passes(f)) return true;\n rejections.push(rejection(f, reason));\n return false;\n });\n };\n\n // `accept` is enforced HERE, not only on the input: the input's attribute\n // governs the picker, and a drop never opens one.\n if (accept) {\n keepOnly((f) => matchesAccept(f, accept), \"accept\");\n }\n\n if (maxSize) {\n keepOnly((f) => f.size <= maxSize, \"maxSize\");\n }\n\n /*\n * `multiple={false}` REPLACES; `maxFiles` refuses the overflow.\n *\n * These used to be the same rule — a cap of one, first-wins — on the\n * reasoning that the two props must not disagree about what a single-file\n * upload means. But they are different statements:\n *\n * - `maxFiles={n}` is a QUOTA. Dropping five files into a three-file\n * field should keep three, not the last three.\n * - `multiple={false}` is a FIELD SHAPE: this input holds one file. Its\n * analogue is a radio group, where choosing again MOVES the selection.\n *\n * Under the old rule a single-file field could never change its mind: the\n * second choice computed `[old, new].slice(0, 1)` and discarded the new\n * file in silence. The YouGene estate worked around it by remounting the\n * component with a `key`, which is the shape of a bug rather than a\n * preference.\n */\n if (multiple === false) {\n /*\n * The FIRST of the incoming batch, not the last.\n *\n * Two separate questions hide here, and only one of them was the bug:\n *\n * - ACROSS gestures — choose a file, then choose another. The second\n * must win, or the field cannot change its mind. That is the fix.\n * - WITHIN one gesture — drop two files at once onto a single-file\n * field. Which one wins is arbitrary, and taking the first is what\n * has always shipped; there is no replacement intent in a single\n * ambiguous drop.\n *\n * Taking `slice(-1)` would have answered both with \"the last\", quietly\n * changing the second. The existing drop test caught it.\n */\n const replacement = toAdd.slice(0, 1);\n // Nothing survived the accept/size filters — leave the field alone\n // rather than clearing a file the user never asked to remove.\n const next = replacement.length > 0 ? replacement : files;\n\n // The file being replaced was not refused; the rest of this batch was,\n // by a field that holds one.\n for (const f of toAdd.slice(1)) rejections.push(rejection(f, \"maxFiles\"));\n\n if (value === undefined) setInternalFiles(next);\n onChange?.(next);\n if (rejections.length > 0) onReject?.(rejections);\n\n return;\n }\n\n const updated = [...files, ...toAdd];\n const limited = maxFiles ? updated.slice(0, maxFiles) : updated;\n\n for (const f of updated.slice(limited.length)) rejections.push(rejection(f, \"maxFiles\"));\n\n if (value === undefined) setInternalFiles(limited);\n onChange?.(limited);\n if (rejections.length > 0) onReject?.(rejections);\n },\n [accept, files, maxFiles, maxSize, multiple, onChange, onReject, value],\n );\n\n const removeFile = useCallback(\n (index: number) => {\n const updated = files.filter((_, i) => i !== index);\n if (value === undefined) setInternalFiles(updated);\n onChange?.(updated);\n },\n [files, onChange, value],\n );\n\n const ctx = useMemo(\n () => ({ files, addFiles, removeFile, disabled, accept, multiple }),\n [files, addFiles, removeFile, disabled, accept, multiple],\n );\n\n return (\n <FileUploadContext.Provider value={ctx}>\n <div data-react-fancy-file-upload=\"\" className={cn(className)}>{children}</div>\n </FileUploadContext.Provider>\n );\n}\n\nexport const FileUpload = Object.assign(FileUploadRoot, {\n Dropzone: FileUploadDropzone,\n List: FileUploadList,\n});\n"]}
|
package/dist/file-upload.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXHUV3VSM_cjs = require('./chunk-XHUV3VSM.cjs');
|
|
4
4
|
require('./chunk-ZU5Q77OT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "FileUpload", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkXHUV3VSM_cjs.FileUpload; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useFileUpload", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkXHUV3VSM_cjs.useFileUpload; }
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=file-upload.cjs.map
|
|
17
17
|
//# sourceMappingURL=file-upload.cjs.map
|
package/dist/file-upload.d.cts
CHANGED
|
@@ -10,10 +10,25 @@ interface FileUploadContextValue {
|
|
|
10
10
|
accept?: string;
|
|
11
11
|
multiple: boolean;
|
|
12
12
|
}
|
|
13
|
+
/** Stable code for why a file was refused. */
|
|
14
|
+
type FileRejectionReason = "accept" | "maxSize" | "maxFiles";
|
|
15
|
+
/** A refused file, as plain JSON so it can go to a log, a toast or an agent. */
|
|
16
|
+
interface FileRejection {
|
|
17
|
+
name: string;
|
|
18
|
+
size: number;
|
|
19
|
+
type: string;
|
|
20
|
+
reason: FileRejectionReason;
|
|
21
|
+
}
|
|
13
22
|
interface FileUploadProps {
|
|
14
23
|
children: ReactNode;
|
|
15
24
|
value?: File[];
|
|
16
25
|
onChange?: (files: File[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Files this gesture refused, one entry per file under the first rule it
|
|
28
|
+
* failed. Not called when nothing was refused. Fires after `onChange`, for
|
|
29
|
+
* the picker, a drop, and `useFileUpload().addFiles` alike.
|
|
30
|
+
*/
|
|
31
|
+
onReject?: (rejections: FileRejection[]) => void;
|
|
17
32
|
accept?: string;
|
|
18
33
|
multiple?: boolean;
|
|
19
34
|
maxFiles?: number;
|
|
@@ -46,7 +61,7 @@ declare namespace FileUploadList {
|
|
|
46
61
|
var displayName: string;
|
|
47
62
|
}
|
|
48
63
|
|
|
49
|
-
declare function FileUploadRoot({ children, value, onChange, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
|
|
64
|
+
declare function FileUploadRoot({ children, value, onChange, onReject, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
|
|
50
65
|
declare const FileUpload: typeof FileUploadRoot & {
|
|
51
66
|
Dropzone: typeof FileUploadDropzone;
|
|
52
67
|
List: typeof FileUploadList;
|
|
@@ -54,4 +69,4 @@ declare const FileUpload: typeof FileUploadRoot & {
|
|
|
54
69
|
|
|
55
70
|
declare function useFileUpload(): FileUploadContextValue;
|
|
56
71
|
|
|
57
|
-
export { FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
|
|
72
|
+
export { type FileRejection, type FileRejectionReason, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
|
package/dist/file-upload.d.ts
CHANGED
|
@@ -10,10 +10,25 @@ interface FileUploadContextValue {
|
|
|
10
10
|
accept?: string;
|
|
11
11
|
multiple: boolean;
|
|
12
12
|
}
|
|
13
|
+
/** Stable code for why a file was refused. */
|
|
14
|
+
type FileRejectionReason = "accept" | "maxSize" | "maxFiles";
|
|
15
|
+
/** A refused file, as plain JSON so it can go to a log, a toast or an agent. */
|
|
16
|
+
interface FileRejection {
|
|
17
|
+
name: string;
|
|
18
|
+
size: number;
|
|
19
|
+
type: string;
|
|
20
|
+
reason: FileRejectionReason;
|
|
21
|
+
}
|
|
13
22
|
interface FileUploadProps {
|
|
14
23
|
children: ReactNode;
|
|
15
24
|
value?: File[];
|
|
16
25
|
onChange?: (files: File[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Files this gesture refused, one entry per file under the first rule it
|
|
28
|
+
* failed. Not called when nothing was refused. Fires after `onChange`, for
|
|
29
|
+
* the picker, a drop, and `useFileUpload().addFiles` alike.
|
|
30
|
+
*/
|
|
31
|
+
onReject?: (rejections: FileRejection[]) => void;
|
|
17
32
|
accept?: string;
|
|
18
33
|
multiple?: boolean;
|
|
19
34
|
maxFiles?: number;
|
|
@@ -46,7 +61,7 @@ declare namespace FileUploadList {
|
|
|
46
61
|
var displayName: string;
|
|
47
62
|
}
|
|
48
63
|
|
|
49
|
-
declare function FileUploadRoot({ children, value, onChange, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
|
|
64
|
+
declare function FileUploadRoot({ children, value, onChange, onReject, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
|
|
50
65
|
declare const FileUpload: typeof FileUploadRoot & {
|
|
51
66
|
Dropzone: typeof FileUploadDropzone;
|
|
52
67
|
List: typeof FileUploadList;
|
|
@@ -54,4 +69,4 @@ declare const FileUpload: typeof FileUploadRoot & {
|
|
|
54
69
|
|
|
55
70
|
declare function useFileUpload(): FileUploadContextValue;
|
|
56
71
|
|
|
57
|
-
export { FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
|
|
72
|
+
export { type FileRejection, type FileRejectionReason, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
|
package/dist/file-upload.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-7STOB5MB.cjs');
|
|
4
4
|
var chunkKOAMRCSC_cjs = require('./chunk-KOAMRCSC.cjs');
|
|
5
|
+
var chunkXBFTO64U_cjs = require('./chunk-XBFTO64U.cjs');
|
|
5
6
|
var chunkH7ELUIF6_cjs = require('./chunk-H7ELUIF6.cjs');
|
|
6
7
|
require('./chunk-HXLSEBAL.cjs');
|
|
7
8
|
var chunkZ4UXLQSK_cjs = require('./chunk-Z4UXLQSK.cjs');
|
|
@@ -73,7 +74,7 @@ var chunkV5JTTLJP_cjs = require('./chunk-V5JTTLJP.cjs');
|
|
|
73
74
|
var chunkLIVC3WUU_cjs = require('./chunk-LIVC3WUU.cjs');
|
|
74
75
|
var chunkM5SEYDSS_cjs = require('./chunk-M5SEYDSS.cjs');
|
|
75
76
|
var chunkO5ORO2RX_cjs = require('./chunk-O5ORO2RX.cjs');
|
|
76
|
-
var
|
|
77
|
+
var chunkXHUV3VSM_cjs = require('./chunk-XHUV3VSM.cjs');
|
|
77
78
|
var chunkWVSHAJKI_cjs = require('./chunk-WVSHAJKI.cjs');
|
|
78
79
|
var chunkOOZCJLEF_cjs = require('./chunk-OOZCJLEF.cjs');
|
|
79
80
|
var chunk3QCAOD2W_cjs = require('./chunk-3QCAOD2W.cjs');
|
|
@@ -231,6 +232,10 @@ Object.defineProperty(exports, "MultiSwitch", {
|
|
|
231
232
|
enumerable: true,
|
|
232
233
|
get: function () { return chunkKOAMRCSC_cjs.MultiSwitch; }
|
|
233
234
|
});
|
|
235
|
+
Object.defineProperty(exports, "NumberField", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
get: function () { return chunkXBFTO64U_cjs.NumberField; }
|
|
238
|
+
});
|
|
234
239
|
Object.defineProperty(exports, "RadioGroup", {
|
|
235
240
|
enumerable: true,
|
|
236
241
|
get: function () { return chunkH7ELUIF6_cjs.RadioGroup; }
|
|
@@ -629,11 +634,11 @@ Object.defineProperty(exports, "validateFolderName", {
|
|
|
629
634
|
});
|
|
630
635
|
Object.defineProperty(exports, "FileUpload", {
|
|
631
636
|
enumerable: true,
|
|
632
|
-
get: function () { return
|
|
637
|
+
get: function () { return chunkXHUV3VSM_cjs.FileUpload; }
|
|
633
638
|
});
|
|
634
639
|
Object.defineProperty(exports, "useFileUpload", {
|
|
635
640
|
enumerable: true,
|
|
636
|
-
get: function () { return
|
|
641
|
+
get: function () { return chunkXHUV3VSM_cjs.useFileUpload; }
|
|
637
642
|
});
|
|
638
643
|
Object.defineProperty(exports, "FullScreen", {
|
|
639
644
|
enumerable: true,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;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,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,QAAA,EAAU,oBAAA;AAAA,IACV,YAAA,EAAc,yBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,aAAA,EAAe;AAAA,IACb,QAAA,EAAU,qBAAA;AAAA,IACV,YAAA,EAAc,0BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA;AAAA,IAEP,IAAA,EAAM,6DAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.cjs","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -9,6 +9,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.cjs';
|
|
|
9
9
|
export { RadioGroup, RadioGroupProps } from './radio-group.cjs';
|
|
10
10
|
export { Switch, SwitchProps } from './switch.cjs';
|
|
11
11
|
export { Slider, SliderProps } from './slider.cjs';
|
|
12
|
+
export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.cjs';
|
|
12
13
|
export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.cjs';
|
|
13
14
|
export { DatePicker, DatePickerProps } from './date-picker.cjs';
|
|
14
15
|
export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-duxPKadC.cjs';
|
|
@@ -70,7 +71,7 @@ export { Pagination, PaginationProps } from './pagination.cjs';
|
|
|
70
71
|
export { Autocomplete, AutocompleteOption, AutocompleteProps } from './autocomplete.cjs';
|
|
71
72
|
export { Pillbox, PillboxProps } from './pillbox.cjs';
|
|
72
73
|
export { OtpInput, OtpInputProps } from './otp-input.cjs';
|
|
73
|
-
export { FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.cjs';
|
|
74
|
+
export { FileRejection, FileRejectionReason, FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.cjs';
|
|
74
75
|
export { TimePicker, TimePickerProps } from './time-picker.cjs';
|
|
75
76
|
export { Calendar, CalendarDayContext, CalendarMode, CalendarProps, DateRange } from './calendar.cjs';
|
|
76
77
|
export { Composer, ComposerProps, ComposerSubmitExtras } from './composer.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.js';
|
|
|
9
9
|
export { RadioGroup, RadioGroupProps } from './radio-group.js';
|
|
10
10
|
export { Switch, SwitchProps } from './switch.js';
|
|
11
11
|
export { Slider, SliderProps } from './slider.js';
|
|
12
|
+
export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.js';
|
|
12
13
|
export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.js';
|
|
13
14
|
export { DatePicker, DatePickerProps } from './date-picker.js';
|
|
14
15
|
export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-DzGcqcPf.js';
|
|
@@ -70,7 +71,7 @@ export { Pagination, PaginationProps } from './pagination.js';
|
|
|
70
71
|
export { Autocomplete, AutocompleteOption, AutocompleteProps } from './autocomplete.js';
|
|
71
72
|
export { Pillbox, PillboxProps } from './pillbox.js';
|
|
72
73
|
export { OtpInput, OtpInputProps } from './otp-input.js';
|
|
73
|
-
export { FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.js';
|
|
74
|
+
export { FileRejection, FileRejectionReason, FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.js';
|
|
74
75
|
export { TimePicker, TimePickerProps } from './time-picker.js';
|
|
75
76
|
export { Calendar, CalendarDayContext, CalendarMode, CalendarProps, DateRange } from './calendar.js';
|
|
76
77
|
export { Composer, ComposerProps, ComposerSubmitExtras } from './composer.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-5WMVBFBD.js';
|
|
2
2
|
export { MultiSwitch } from './chunk-3S5ED522.js';
|
|
3
|
+
export { NumberField } from './chunk-LY3RQB3H.js';
|
|
3
4
|
export { RadioGroup } from './chunk-4FH2JHUY.js';
|
|
4
5
|
import './chunk-GNHQVPZP.js';
|
|
5
6
|
export { Slider } from './chunk-NVXTHTJI.js';
|
|
@@ -71,7 +72,7 @@ export { EmojiSelect } from './chunk-WGRLNXNB.js';
|
|
|
71
72
|
export { Eyebrow } from './chunk-EQ7G5F6K.js';
|
|
72
73
|
export { FauxClient } from './chunk-GVMWJ4NI.js';
|
|
73
74
|
export { FileBrowser, FileBrowserNewFolder, useFileBrowser, validateFolderName } from './chunk-WZAKEJDL.js';
|
|
74
|
-
export { FileUpload, useFileUpload } from './chunk-
|
|
75
|
+
export { FileUpload, useFileUpload } from './chunk-SCGTO3PX.js';
|
|
75
76
|
export { FullScreen } from './chunk-GZ5Z56QK.js';
|
|
76
77
|
export { Grid } from './chunk-TM3RTWKI.js';
|
|
77
78
|
export { Command, useCommand } from './chunk-EZZKHMR4.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,gBAAA;AAAA,IACV,YAAA,EAAc,qBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EA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AAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA;AAAA,IAEP,IAAA,EAAM,6DAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.js","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
|
package/dist/inputs.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-7STOB5MB.cjs');
|
|
4
4
|
var chunkKOAMRCSC_cjs = require('./chunk-KOAMRCSC.cjs');
|
|
5
|
+
var chunkXBFTO64U_cjs = require('./chunk-XBFTO64U.cjs');
|
|
5
6
|
var chunkH7ELUIF6_cjs = require('./chunk-H7ELUIF6.cjs');
|
|
6
7
|
require('./chunk-HXLSEBAL.cjs');
|
|
7
8
|
var chunkZ4UXLQSK_cjs = require('./chunk-Z4UXLQSK.cjs');
|
|
@@ -41,6 +42,10 @@ Object.defineProperty(exports, "MultiSwitch", {
|
|
|
41
42
|
enumerable: true,
|
|
42
43
|
get: function () { return chunkKOAMRCSC_cjs.MultiSwitch; }
|
|
43
44
|
});
|
|
45
|
+
Object.defineProperty(exports, "NumberField", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return chunkXBFTO64U_cjs.NumberField; }
|
|
48
|
+
});
|
|
44
49
|
Object.defineProperty(exports, "RadioGroup", {
|
|
45
50
|
enumerable: true,
|
|
46
51
|
get: function () { return chunkH7ELUIF6_cjs.RadioGroup; }
|
package/dist/inputs.d.cts
CHANGED
|
@@ -7,6 +7,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.cjs';
|
|
|
7
7
|
export { RadioGroup, RadioGroupProps } from './radio-group.cjs';
|
|
8
8
|
export { Switch, SwitchProps } from './switch.cjs';
|
|
9
9
|
export { Slider, SliderProps, SliderRangeProps, SliderSingleProps } from './slider.cjs';
|
|
10
|
+
export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.cjs';
|
|
10
11
|
export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.cjs';
|
|
11
12
|
export { DatePicker, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps } from './date-picker.cjs';
|
|
12
13
|
export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-duxPKadC.cjs';
|
package/dist/inputs.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.js';
|
|
|
7
7
|
export { RadioGroup, RadioGroupProps } from './radio-group.js';
|
|
8
8
|
export { Switch, SwitchProps } from './switch.js';
|
|
9
9
|
export { Slider, SliderProps, SliderRangeProps, SliderSingleProps } from './slider.js';
|
|
10
|
+
export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.js';
|
|
10
11
|
export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.js';
|
|
11
12
|
export { DatePicker, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps } from './date-picker.js';
|
|
12
13
|
export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-DzGcqcPf.js';
|
package/dist/inputs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import './chunk-
|
|
1
|
+
import './chunk-5WMVBFBD.js';
|
|
2
2
|
export { MultiSwitch } from './chunk-3S5ED522.js';
|
|
3
|
+
export { NumberField } from './chunk-LY3RQB3H.js';
|
|
3
4
|
export { RadioGroup } from './chunk-4FH2JHUY.js';
|
|
4
5
|
import './chunk-GNHQVPZP.js';
|
|
5
6
|
export { Slider } from './chunk-NVXTHTJI.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXBFTO64U_cjs = require('./chunk-XBFTO64U.cjs');
|
|
4
|
+
require('./chunk-QGPMVFZJ.cjs');
|
|
5
|
+
require('./chunk-HNJXBMHI.cjs');
|
|
6
|
+
require('./chunk-MRZXTL46.cjs');
|
|
7
|
+
require('./chunk-P53432AK.cjs');
|
|
8
|
+
require('./chunk-QF7CD4JH.cjs');
|
|
9
|
+
require('./chunk-O3F6DYWR.cjs');
|
|
10
|
+
require('./chunk-KKYILQTG.cjs');
|
|
11
|
+
require('./chunk-MKGWHSNV.cjs');
|
|
12
|
+
require('./chunk-6V44RRSB.cjs');
|
|
13
|
+
require('./chunk-MKHYENKR.cjs');
|
|
14
|
+
require('./chunk-J2DI6RMR.cjs');
|
|
15
|
+
require('./chunk-TI7D4QDM.cjs');
|
|
16
|
+
require('./chunk-KJ22KE56.cjs');
|
|
17
|
+
require('./chunk-L3V3BYVS.cjs');
|
|
18
|
+
require('./chunk-57FQGQJK.cjs');
|
|
19
|
+
require('./chunk-OUYC6EIL.cjs');
|
|
20
|
+
require('./chunk-SNHU2AI4.cjs');
|
|
21
|
+
require('./chunk-ZU5Q77OT.cjs');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, "NumberField", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkXBFTO64U_cjs.NumberField; }
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=number-field.cjs.map
|
|
30
|
+
//# sourceMappingURL=number-field.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"number-field.cjs"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { a as InputBaseProps, I as InputAffixProps } from './inputs.types-duxPKadC.cjs';
|
|
4
|
+
import './types-DJI492iY.cjs';
|
|
5
|
+
|
|
6
|
+
/** Validation messages, for a host working in another language. */
|
|
7
|
+
interface NumberFieldMessages {
|
|
8
|
+
/** The text is not a number. Default: "Enter a number." */
|
|
9
|
+
invalid?: string;
|
|
10
|
+
/** Below `min`. Default: "Must be at least {min}." */
|
|
11
|
+
min?: string;
|
|
12
|
+
/** Above `max`. Default: "Must be at most {max}." */
|
|
13
|
+
max?: string;
|
|
14
|
+
/** Off the `step` grid. Default: "Must be in steps of {step}." */
|
|
15
|
+
step?: string;
|
|
16
|
+
}
|
|
17
|
+
interface NumberFieldProps extends InputBaseProps, InputAffixProps, Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "prefix" | "value" | "defaultValue" | "min" | "max" | "step"> {
|
|
18
|
+
/** The number, or `null` when there is none. Blank is `null`, never `0`. */
|
|
19
|
+
value?: number | null;
|
|
20
|
+
/** Starting value when uncontrolled. */
|
|
21
|
+
defaultValue?: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* The number, or `null` when the field is blank or its text is not a number
|
|
24
|
+
* (a partial `-`, `.` or `1e`, or anything else unreadable). Called only when
|
|
25
|
+
* the value actually changes.
|
|
26
|
+
*/
|
|
27
|
+
onValueChange?: (value: number | null) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Lowest valid value. A typed value below it is emitted and reported as invalid,
|
|
30
|
+
* not rewritten: "5" may be on its way to "50". The arrow keys stop here.
|
|
31
|
+
*/
|
|
32
|
+
min?: number;
|
|
33
|
+
/** Highest valid value. Same rules as `min`. */
|
|
34
|
+
max?: number;
|
|
35
|
+
/**
|
|
36
|
+
* What the arrow keys move by, on a grid counted from `min` (or 0). Declaring it
|
|
37
|
+
* also makes off-grid values invalid. Omitted or `"any"`, the arrows move by 1 and
|
|
38
|
+
* any number is valid.
|
|
39
|
+
*/
|
|
40
|
+
step?: number | "any";
|
|
41
|
+
leading?: ReactNode;
|
|
42
|
+
trailing?: ReactNode;
|
|
43
|
+
messages?: NumberFieldMessages;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare const NumberField: react.ForwardRefExoticComponent<NumberFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
47
|
+
|
|
48
|
+
export { NumberField, type NumberFieldMessages, type NumberFieldProps };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { a as InputBaseProps, I as InputAffixProps } from './inputs.types-DzGcqcPf.js';
|
|
4
|
+
import './types-DJI492iY.js';
|
|
5
|
+
|
|
6
|
+
/** Validation messages, for a host working in another language. */
|
|
7
|
+
interface NumberFieldMessages {
|
|
8
|
+
/** The text is not a number. Default: "Enter a number." */
|
|
9
|
+
invalid?: string;
|
|
10
|
+
/** Below `min`. Default: "Must be at least {min}." */
|
|
11
|
+
min?: string;
|
|
12
|
+
/** Above `max`. Default: "Must be at most {max}." */
|
|
13
|
+
max?: string;
|
|
14
|
+
/** Off the `step` grid. Default: "Must be in steps of {step}." */
|
|
15
|
+
step?: string;
|
|
16
|
+
}
|
|
17
|
+
interface NumberFieldProps extends InputBaseProps, InputAffixProps, Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "prefix" | "value" | "defaultValue" | "min" | "max" | "step"> {
|
|
18
|
+
/** The number, or `null` when there is none. Blank is `null`, never `0`. */
|
|
19
|
+
value?: number | null;
|
|
20
|
+
/** Starting value when uncontrolled. */
|
|
21
|
+
defaultValue?: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* The number, or `null` when the field is blank or its text is not a number
|
|
24
|
+
* (a partial `-`, `.` or `1e`, or anything else unreadable). Called only when
|
|
25
|
+
* the value actually changes.
|
|
26
|
+
*/
|
|
27
|
+
onValueChange?: (value: number | null) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Lowest valid value. A typed value below it is emitted and reported as invalid,
|
|
30
|
+
* not rewritten: "5" may be on its way to "50". The arrow keys stop here.
|
|
31
|
+
*/
|
|
32
|
+
min?: number;
|
|
33
|
+
/** Highest valid value. Same rules as `min`. */
|
|
34
|
+
max?: number;
|
|
35
|
+
/**
|
|
36
|
+
* What the arrow keys move by, on a grid counted from `min` (or 0). Declaring it
|
|
37
|
+
* also makes off-grid values invalid. Omitted or `"any"`, the arrows move by 1 and
|
|
38
|
+
* any number is valid.
|
|
39
|
+
*/
|
|
40
|
+
step?: number | "any";
|
|
41
|
+
leading?: ReactNode;
|
|
42
|
+
trailing?: ReactNode;
|
|
43
|
+
messages?: NumberFieldMessages;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare const NumberField: react.ForwardRefExoticComponent<NumberFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
47
|
+
|
|
48
|
+
export { NumberField, type NumberFieldMessages, type NumberFieldProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { NumberField } from './chunk-LY3RQB3H.js';
|
|
2
|
+
import './chunk-SHDSKHCC.js';
|
|
3
|
+
import './chunk-PJNUGSKI.js';
|
|
4
|
+
import './chunk-KXYMMNNV.js';
|
|
5
|
+
import './chunk-WX5XYDVN.js';
|
|
6
|
+
import './chunk-5WQ6FPSP.js';
|
|
7
|
+
import './chunk-USWQAMI3.js';
|
|
8
|
+
import './chunk-6PRXG7L6.js';
|
|
9
|
+
import './chunk-QTS4Q2NK.js';
|
|
10
|
+
import './chunk-S42OGG43.js';
|
|
11
|
+
import './chunk-5VMILVWD.js';
|
|
12
|
+
import './chunk-MQ6VGG62.js';
|
|
13
|
+
import './chunk-RBCMKPBX.js';
|
|
14
|
+
import './chunk-OL53XYHF.js';
|
|
15
|
+
import './chunk-NRXK42LO.js';
|
|
16
|
+
import './chunk-RGANGU7X.js';
|
|
17
|
+
import './chunk-YX6FTJ6N.js';
|
|
18
|
+
import './chunk-EDYAXGUM.js';
|
|
19
|
+
import './chunk-MMW2JGKZ.js';
|
|
20
|
+
//# sourceMappingURL=number-field.js.map
|
|
21
|
+
//# sourceMappingURL=number-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"number-field.js"}
|
package/docs/FileUpload.md
CHANGED
|
@@ -30,8 +30,9 @@ Provides file state context to its children.
|
|
|
30
30
|
| `onChange` | `(files: File[]) => void` | - | Callback when files change |
|
|
31
31
|
| `accept` | `string` | - | Accepted file types (e.g. `"image/*,.pdf"`) |
|
|
32
32
|
| `multiple` | `boolean` | `true` | Allow multiple files |
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
33
|
+
| `onReject` | `(rejections: FileRejection[]) => void` | - | Called with the files a gesture refused. See [Refused files](#refused-files) |
|
|
34
|
+
| `maxFiles` | `number` | - | Maximum number of files. The overflow is refused |
|
|
35
|
+
| `maxSize` | `number` | - | Maximum file size in bytes. Larger files are refused |
|
|
35
36
|
| `disabled` | `boolean` | `false` | Disables upload and removal |
|
|
36
37
|
| `className` | `string` | - | Additional CSS classes on the wrapper |
|
|
37
38
|
|
|
@@ -56,6 +57,35 @@ Displays the uploaded files with remove buttons.
|
|
|
56
57
|
| `thumbnail` | `boolean` | `false` | Show image thumbnails in a grid instead of a file list |
|
|
57
58
|
| `className` | `string` | - | Additional CSS classes |
|
|
58
59
|
|
|
60
|
+
## Refused files
|
|
61
|
+
|
|
62
|
+
`accept`, `maxSize` and `maxFiles` refuse files without any message of their own. `onReject` is how you tell the person, whichever way the files arrived: the picker, a drop, or `useFileUpload().addFiles`.
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<FileUpload
|
|
66
|
+
accept="image/*"
|
|
67
|
+
maxSize={5 * 1024 * 1024}
|
|
68
|
+
maxFiles={5}
|
|
69
|
+
onReject={(rejections) => setError(rejections.map((r) => `${r.name}: ${r.reason}`).join(", "))}
|
|
70
|
+
>
|
|
71
|
+
<FileUpload.Dropzone />
|
|
72
|
+
</FileUpload>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Each entry is plain JSON, one per file, under the first rule that file failed:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
{ name: "scan.tiff", size: 7340032, type: "image/tiff", reason: "maxSize" }
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| `reason` | Means |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `accept` | The file does not match `accept` |
|
|
84
|
+
| `maxSize` | The file is larger than `maxSize` |
|
|
85
|
+
| `maxFiles` | The file is past `maxFiles`, or is an extra file in a batch dropped on a `multiple={false}` field |
|
|
86
|
+
|
|
87
|
+
It fires after `onChange`, and not at all when nothing was refused. A file replaced on a `multiple={false}` field was not refused, so it is not reported.
|
|
88
|
+
|
|
59
89
|
## Examples
|
|
60
90
|
|
|
61
91
|
### With file constraints
|
package/docs/Input.md
CHANGED