@matthiaskrijgsman/mat-ui 0.0.19 → 0.0.21

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/README.md CHANGED
@@ -146,6 +146,16 @@ Each button variant (`primary`, `white`, `black`, `transparent`, `secondary`, `t
146
146
  | `--color-input-icon-button-ring` | Ring color for icon buttons inside inputs | `#e5e7eb` |
147
147
  | `--color-input-icon-button-icon` | Icon color for icon buttons inside inputs | `#6b7280` |
148
148
 
149
+ #### File inputs
150
+
151
+ `InputFileSingle` and `UploadFileTile` are composed from existing primitives (input tokens, `Button` for the inset "Choose" button, `ButtonIconSquare` for the remove (X) button) — no dedicated tokens of their own. `InputFileMultiple` adds:
152
+
153
+ | Token | Description | Light default |
154
+ |-------|-------------|---------------|
155
+ | `--color-input-file-icon-bg` | Background of the central icon frame inside `InputFileMultiple`'s dropzone | `#f3f4f6` |
156
+
157
+ All three components also rely on the shared `--color-status-success` / `--color-status-error` tokens for the green check / red error icons in their upload-state slots.
158
+
149
159
  #### Select options
150
160
 
151
161
  | Token | Description | Light default |
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export type AutoScrollProps = {
3
+ duration?: number;
4
+ ease?: "linear" | "easeIn" | "easeOut" | "easeInOut";
5
+ horizontal?: boolean;
6
+ } & React.HTMLAttributes<HTMLDivElement>;
7
+ export declare const AutoScroll: (props: AutoScrollProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { type Accept, type FileRejection } from "react-dropzone";
3
+ import { type TablerIcon } from "@tabler/icons-react";
4
+ import { type UploadFileTileProps } from "@/components/inputs/input-file/UploadFileTile.tsx";
5
+ export type InputFileMultipleProps = {
6
+ label?: string | React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ error?: string | React.ReactNode;
9
+ title?: string;
10
+ hint?: React.ReactNode;
11
+ Icon?: TablerIcon;
12
+ onUpload?: (file: File) => Promise<void> | void;
13
+ onFileRemoved?: (file: File) => void;
14
+ onDropRejected?: (fileRejections: FileRejection[]) => void;
15
+ renderFileTile?: (file: File, defaultProps: UploadFileTileProps) => React.ReactNode;
16
+ accept?: Accept;
17
+ maxSize?: number;
18
+ minSize?: number;
19
+ maxFiles?: number;
20
+ disabled?: boolean;
21
+ className?: string;
22
+ };
23
+ export declare const InputFileMultiple: (props: InputFileMultipleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { type Accept, type FileRejection } from "react-dropzone";
3
+ import { type TablerIcon } from "@tabler/icons-react";
4
+ export type Size = 'sm' | 'md' | 'lg';
5
+ export type InputFileSingleProps = {
6
+ label?: string | React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ error?: string | React.ReactNode;
9
+ placeholder?: string;
10
+ buttonText?: string;
11
+ Icon?: TablerIcon;
12
+ size?: Size;
13
+ value?: File | null;
14
+ isUploaded?: boolean;
15
+ isUploading?: boolean;
16
+ onChange?: (file: File | null) => void | Promise<void>;
17
+ onDropRejected?: (fileRejections: FileRejection[]) => void;
18
+ accept?: Accept;
19
+ maxSize?: number;
20
+ minSize?: number;
21
+ disabled?: boolean;
22
+ className?: string;
23
+ };
24
+ export declare const InputFileSingle: (props: InputFileSingleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ export type UploadFileTileProps = {
3
+ file: File;
4
+ isUploaded?: boolean;
5
+ isUploading?: boolean;
6
+ error?: string | React.ReactNode;
7
+ onRemove?: () => void;
8
+ className?: string;
9
+ };
10
+ export declare const UploadFileTile: (props: UploadFileTileProps) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -14,6 +14,9 @@ export { InputError } from "./components/inputs/InputError.tsx";
14
14
  export { InputErrorIcon } from "./components/inputs/InputErrorIcon.tsx";
15
15
  export { InputIconButton } from "./components/inputs/InputIconButton.tsx";
16
16
  export { InputIconButtonTray } from "./components/inputs/InputIconButtonTray.tsx";
17
+ export { InputFileSingle } from "./components/inputs/input-file/InputFileSingle.tsx";
18
+ export { InputFileMultiple } from "./components/inputs/input-file/InputFileMultiple.tsx";
19
+ export { UploadFileTile } from "./components/inputs/input-file/UploadFileTile.tsx";
17
20
  export { InputSelectNative } from "./components/inputs/InputSelectNative.tsx";
18
21
  export { InputSelect } from "./components/inputs/InputSelect.tsx";
19
22
  export { InputSelectSearchable } from "./components/inputs/InputSelectSearchable.tsx";
@@ -30,6 +33,7 @@ export { SidebarModal } from "./components/SidebarModal.tsx";
30
33
  export { Badge } from "./components/Badge.tsx";
31
34
  export { BadgeColor } from "./components/BadgeColors.tsx";
32
35
  export { TabButtons } from "./components/TabButtons.tsx";
36
+ export { AutoScroll } from "./components/AutoScroll.tsx";
33
37
  export { Spinner } from "./spinner/Spinner.tsx";
34
38
  export { DropdownButton } from "./components/dropdown-menu/DropdownButton.tsx";
35
39
  export { DropdownButtonGroup } from "./components/dropdown-menu/DropdownButtonGroup.tsx";