@roy-ui/ui 0.0.12 → 0.0.14

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.
@@ -0,0 +1,56 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, HTMLAttributes } from 'react';
3
+
4
+ type UploadStatus = 'uploading' | 'complete' | 'error';
5
+ interface UploadFile {
6
+ /** Stable id — used as the React key and passed back to onRemove. */
7
+ id: string;
8
+ /** File name including extension; drives the type badge. */
9
+ name: string;
10
+ /** Total size in bytes. */
11
+ size: number;
12
+ /** Bytes transferred so far. Drives the "X OF Y" label and, when
13
+ * `progress` is omitted, the percentage. */
14
+ uploaded?: number;
15
+ /** Progress 0–100. Falls back to uploaded / size when omitted. */
16
+ progress?: number;
17
+ /** Lifecycle state. */
18
+ status: UploadStatus;
19
+ /** Optional override for the file-type badge. */
20
+ icon?: ReactNode;
21
+ }
22
+ type UploadTheme = 'auto' | 'light' | 'dark';
23
+ interface UploadFilesProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
24
+ /** The files to render. The component is controlled — it draws this
25
+ * list and emits events; the consumer owns the upload + progress. */
26
+ files: UploadFile[];
27
+ /** Panel heading. Defaults to "Upload files". */
28
+ title?: ReactNode;
29
+ /** Caption under the dropzone. Defaults to "MAX FILE SIZE: 20 MB". */
30
+ maxSizeLabel?: string;
31
+ /** Forwarded to the hidden file input's `accept`. */
32
+ accept?: string;
33
+ /** Allow selecting multiple files. Defaults to true. */
34
+ multiple?: boolean;
35
+ /** Color scheme. Dark by default; "auto" follows the OS. */
36
+ theme?: UploadTheme;
37
+ /** Words cycled (and morphed) in the per-file status while uploading.
38
+ * Defaults to a long, varied upload vocabulary so the wait stays lively. */
39
+ statusWords?: string[];
40
+ /** Footer action button content. Defaults to a state-derived label
41
+ * ("Uploading…" while in flight, "Done" otherwise). */
42
+ actionLabel?: ReactNode;
43
+ /** Fired with the dropped / browsed File objects. */
44
+ onFilesSelected?: (files: File[]) => void;
45
+ /** Fired when a single row's trash / cancel control is pressed. */
46
+ onRemove?: (id: string) => void;
47
+ /** Fired by the "Remove all" footer control. */
48
+ onRemoveAll?: () => void;
49
+ /** When provided, renders the header close (×) button. */
50
+ onClose?: () => void;
51
+ /** Fired by the footer action button. */
52
+ onAction?: () => void;
53
+ }
54
+ declare const UploadFiles: react.ForwardRefExoticComponent<UploadFilesProps & react.RefAttributes<HTMLDivElement>>;
55
+
56
+ export { type UploadFile, UploadFiles, type UploadFilesProps, type UploadStatus, type UploadTheme };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ export { UploadFiles } from '../../chunk-6JYEHTQR.js';
3
+ import '../../chunk-MO7UPMW7.js';
4
+ import '../../chunk-B6LXWGX5.js';
5
+ //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/index.d.ts CHANGED
@@ -14,5 +14,6 @@ export { A as AnalogClock, a as AnalogClockProps, T as TimePicker, b as TimePick
14
14
  export { ClockSwitch, ClockSwitchProps, DigitalClock, DigitalClockProps } from './components/time-picker/index.js';
15
15
  export { Column, ColumnMenu, ColumnType, DataIO, DataTable, DataTableProps, FilterState, SortDir, TableLayout, downloadString, fromCsv, fromJson, toCsv, toJson } from './components/data-table/index.js';
16
16
  export { Card, CardProps, CardStat, CarouselImage, ImageCarousel, ImageCarouselProps } from './components/card/index.js';
17
+ export { UploadFile, UploadFiles, UploadFilesProps, UploadStatus, UploadTheme } from './components/upload-files/index.js';
17
18
  import 'react';
18
19
  import 'react/jsx-runtime';
package/dist/index.js CHANGED
@@ -1,15 +1,18 @@
1
1
  "use client";
2
2
  export { Popover } from './chunk-C5X3TE5U.js';
3
- export { TextMorph } from './chunk-PGV55XSZ.js';
3
+ import './chunk-DAA5LXWQ.js';
4
4
  export { TreeNav, TreeNavItem } from './chunk-M6HB6BMA.js';
5
- export { Card, ImageCarousel } from './chunk-B7QN2JTN.js';
6
- export { Button } from './chunk-4SGMAZBG.js';
7
- export { ColumnMenu, DataTable, downloadString, fromCsv, fromJson, toCsv, toJson } from './chunk-PDUQROG2.js';
8
- export { Spinner, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './chunk-XERZVDIT.js';
5
+ export { UploadFiles } from './chunk-6JYEHTQR.js';
6
+ export { TextMorph } from './chunk-MO7UPMW7.js';
7
+ export { Card, ImageCarousel } from './chunk-TBBQRMCG.js';
8
+ import './chunk-ORTCK34Y.js';
9
+ export { Button } from './chunk-B6LXWGX5.js';
10
+ export { GradientButton } from './chunk-RLBVY3DG.js';
11
+ export { ColumnMenu, DataTable, downloadString, fromCsv, fromJson, toCsv, toJson } from './chunk-LV4JMUGV.js';
9
12
  export { TableSearch } from './chunk-KSHKVSNK.js';
10
13
  export { AnalogClock, ClockSwitch, DigitalClock, TimePicker, TimeRangePicker, formatTime, formatTimeRange } from './chunk-QOSMU4DV.js';
14
+ export { Spinner, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './chunk-XERZVDIT.js';
11
15
  export { DEFAULT_PRESETS, DateRangePicker, addDays, addMonths, formatMonthYear, formatRange, formatShort, isBetween, isSameDay, startOfDay } from './chunk-SFENGB5N.js';
12
- export { GradientButton } from './chunk-RLBVY3DG.js';
13
16
  export { MadeBy } from './chunk-MDPMEW4K.js';
14
17
  export { Pagination } from './chunk-5CIBIH7R.js';
15
18
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roy-ui/ui",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Free, animated React components built with TypeScript. Zero config, RSC-safe, sub-12 KB. Gradient button, popover, text morph and more.",
5
5
  "keywords": [
6
6
  "react",
@@ -214,6 +214,10 @@
214
214
  "types": "./dist/components/card/index.d.ts",
215
215
  "import": "./dist/components/card/index.js"
216
216
  },
217
+ "./upload-files": {
218
+ "types": "./dist/components/upload-files/index.d.ts",
219
+ "import": "./dist/components/upload-files/index.js"
220
+ },
217
221
  "./package.json": "./package.json"
218
222
  },
219
223
  "scripts": {