@homefile/components-v2 2.51.6 → 2.52.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.
@@ -42,6 +42,7 @@ export * from './span';
42
42
  export * from './subscription';
43
43
  export * from './tile';
44
44
  export * from './tour';
45
+ export * from './uploadTile';
45
46
  export * from './householdItems';
46
47
  export * from './valueMonitor';
47
48
  export * from './videoPlayer';
@@ -42,6 +42,7 @@ export * from './span';
42
42
  export * from './subscription';
43
43
  export * from './tile';
44
44
  export * from './tour';
45
+ export * from './uploadTile';
45
46
  export * from './householdItems';
46
47
  export * from './valueMonitor';
47
48
  export * from './videoPlayer';
@@ -0,0 +1,12 @@
1
+ import { UploadTileI } from '../../interfaces';
2
+ /**
3
+ * Homeboard quick-upload tile. A drop/click zone for a single image or PDF
4
+ * that goes straight to the platform ingest — no "add receipt / item / folder"
5
+ * step first. The engine classifies and files it (item / receipt / document)
6
+ * and the user gets a notification when it's ready.
7
+ *
8
+ * Presentational only: `onUpload` is wired by the consumer (homefile-v3) to
9
+ * post to /api/ingest. File-type restriction (images + PDFs) is enforced by
10
+ * the consumer before posting.
11
+ */
12
+ export declare const UploadTile: ({ onUpload, uploading, title, description, }: UploadTileI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Stack, Text } from '@chakra-ui/react';
3
+ import { DragDropArea } from '../../components';
4
+ import { useFilesUploader } from '../../hooks';
5
+ /**
6
+ * Homeboard quick-upload tile. A drop/click zone for a single image or PDF
7
+ * that goes straight to the platform ingest — no "add receipt / item / folder"
8
+ * step first. The engine classifies and files it (item / receipt / document)
9
+ * and the user gets a notification when it's ready.
10
+ *
11
+ * Presentational only: `onUpload` is wired by the consumer (homefile-v3) to
12
+ * post to /api/ingest. File-type restriction (images + PDFs) is enforced by
13
+ * the consumer before posting.
14
+ */
15
+ export const UploadTile = ({ onUpload, uploading = false, title = 'Quick Upload', description = 'Drop a photo or PDF and we’ll file it for you.', }) => {
16
+ const { errorMessage, getInputProps, getRootProps } = useFilesUploader({
17
+ onUpload,
18
+ uploading,
19
+ });
20
+ return (_jsxs(Stack, { spacing: "base", flex: "1", p: "base", bg: "neutral.white", borderRadius: "lg", boxShadow: "md", children: [_jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "lg", fontWeight: "medium", children: title }), description && (_jsx(Text, { fontSize: "sm", color: "darkBlue.2", children: description }))] }), _jsx(DragDropArea, { getInputProps: getInputProps, getRootProps: getRootProps, errorMessage: errorMessage, height: "120px", disabled: uploading })] }));
21
+ };
@@ -0,0 +1 @@
1
+ export * from './UploadTile';
@@ -0,0 +1 @@
1
+ export * from './UploadTile';
@@ -40,6 +40,7 @@ export * from './shareHome';
40
40
  export * from './subscription';
41
41
  export * from './tiles';
42
42
  export * from './tour';
43
+ export * from './uploadTile';
43
44
  export * from './householdItems';
44
45
  export * from './valueMonitor';
45
46
  export * from './DrawerHeader.interface';
@@ -40,6 +40,7 @@ export * from './shareHome';
40
40
  export * from './subscription';
41
41
  export * from './tiles';
42
42
  export * from './tour';
43
+ export * from './uploadTile';
43
44
  export * from './householdItems';
44
45
  export * from './valueMonitor';
45
46
  export * from './DrawerHeader.interface';
@@ -0,0 +1,15 @@
1
+ import { UploadFileI } from '../../interfaces';
2
+ export interface UploadTileI {
3
+ /**
4
+ * Fired when the user drops or selects file(s). The consumer wires this to
5
+ * the platform ingest (async, no doc-type hint) — the engine classifies and
6
+ * files the upload (item / receipt / document).
7
+ */
8
+ onUpload: (files: UploadFileI[]) => void;
9
+ /** Disables + dims the drop zone while an upload is in flight. */
10
+ uploading?: boolean;
11
+ /** Tile heading. Defaults to a generic upload title. */
12
+ title?: string;
13
+ /** Optional supporting copy under the title. */
14
+ description?: string;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './UploadTile.interface';
@@ -0,0 +1 @@
1
+ export * from './UploadTile.interface';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.51.6",
3
+ "version": "2.52.0",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",