@zayne-labs/ui-react 0.9.16 → 0.9.18
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/esm/await-Fe4LFRKd.js +89 -0
- package/dist/esm/await-Fe4LFRKd.js.map +1 -0
- package/dist/esm/card-DRjs-vtv.js +54 -0
- package/dist/esm/card-DRjs-vtv.js.map +1 -0
- package/dist/esm/carousel-Dznupnx8.js +270 -0
- package/dist/esm/carousel-Dznupnx8.js.map +1 -0
- package/dist/esm/chunk-Cl8Af3a2.js +11 -0
- package/dist/esm/cn-_FbtIrlZ.js +8 -0
- package/dist/esm/cn-_FbtIrlZ.js.map +1 -0
- package/dist/esm/common-BYWy8Q78.js +0 -0
- package/dist/esm/components/common/await/index.d.ts +6 -14
- package/dist/esm/components/common/await/index.js +10 -8
- package/dist/esm/components/common/error-boundary/index.d.ts +2 -17
- package/dist/esm/components/common/error-boundary/index.js +6 -4
- package/dist/esm/components/common/for/index.d.ts +2 -10
- package/dist/esm/components/common/for/index.js +3 -4
- package/dist/esm/components/common/index.d.ts +11 -13
- package/dist/esm/components/common/index.js +13 -14
- package/dist/esm/components/common/show/index.d.ts +2 -26
- package/dist/esm/components/common/show/index.js +7 -5
- package/dist/esm/components/common/slot/index.d.ts +2 -12
- package/dist/esm/components/common/slot/index.js +3 -4
- package/dist/esm/components/common/suspense-with-boundary/index.d.ts +3 -11
- package/dist/esm/components/common/suspense-with-boundary/index.js +4 -5
- package/dist/esm/components/common/switch/index.d.ts +2 -25
- package/dist/esm/components/common/switch/index.js +7 -5
- package/dist/esm/components/common/teleport/index.d.ts +2 -12
- package/dist/esm/components/common/teleport/index.js +3 -4
- package/dist/esm/components/ui/card/index.d.ts +2 -17
- package/dist/esm/components/ui/card/index.js +5 -6
- package/dist/esm/components/ui/carousel/index.d.ts +2 -95
- package/dist/esm/components/ui/carousel/index.js +18 -16
- package/dist/esm/components/ui/drag-scroll/index.d.ts +2 -21
- package/dist/esm/components/ui/drag-scroll/index.js +4 -5
- package/dist/esm/components/ui/drop-zone/index.d.ts +3 -11
- package/dist/esm/components/ui/drop-zone/index.js +18 -16
- package/dist/esm/components/ui/form/index.d.ts +2 -228
- package/dist/esm/components/ui/form/index.js +10 -8
- package/dist/esm/components/ui/index.d.ts +7 -11
- package/dist/esm/components/ui/index.js +19 -20
- package/dist/esm/drag-scroll-BLjij7aI.js +111 -0
- package/dist/esm/drag-scroll-BLjij7aI.js.map +1 -0
- package/dist/esm/drop-zone-_YK9C3Xj.js +313 -0
- package/dist/esm/drop-zone-_YK9C3Xj.js.map +1 -0
- package/dist/esm/error-boundary-B3ycUZ1t.js +126 -0
- package/dist/esm/error-boundary-B3ycUZ1t.js.map +1 -0
- package/dist/esm/for-aTw1TgJo.js +42 -0
- package/dist/esm/for-aTw1TgJo.js.map +1 -0
- package/dist/esm/form-DytCfL6R.js +590 -0
- package/dist/esm/form-DytCfL6R.js.map +1 -0
- package/dist/esm/getSlot-BIcGgBwN.js +85 -0
- package/dist/esm/getSlot-BIcGgBwN.js.map +1 -0
- package/dist/esm/{getSlotMap-DTkxtGhd.d.ts → getSlotMap-DA_uhXqU.d.ts} +17 -16
- package/dist/esm/index--1COprHP.d.ts +32 -0
- package/dist/esm/index-1UCPJf7B.d.ts +19 -0
- package/dist/esm/index-ASoFjmZ6.d.ts +196 -0
- package/dist/esm/index-BC0r1cBF.d.ts +104 -0
- package/dist/esm/index-BSJ30pGj.d.ts +68 -0
- package/dist/esm/{for-BH5FhFuV.d.ts → index-BhpBx8dH.d.ts} +14 -6
- package/dist/esm/index-BuSQsDCX.d.ts +22 -0
- package/dist/esm/index-C0XZoIZD.d.ts +35 -0
- package/dist/esm/index-CTZr4PTO.d.ts +24 -0
- package/dist/esm/index-CqlM1M0j.d.ts +14 -0
- package/dist/esm/index-D-j2Cn1J.d.ts +61 -0
- package/dist/esm/index-DQ1yFGd2.d.ts +229 -0
- package/dist/esm/index-DnaUCh8d.d.ts +15 -0
- package/dist/esm/index-TBkPiipk.d.ts +49 -0
- package/dist/esm/lib/utils/index.d.ts +3 -61
- package/dist/esm/lib/utils/index.js +4 -5
- package/dist/esm/show-BgYrfIxJ.js +41 -0
- package/dist/esm/show-BgYrfIxJ.js.map +1 -0
- package/dist/esm/slot-RXTKo4L7.js +58 -0
- package/dist/esm/slot-RXTKo4L7.js.map +1 -0
- package/dist/esm/suspense-with-boundary-TrQxYRG6.js +21 -0
- package/dist/esm/suspense-with-boundary-TrQxYRG6.js.map +1 -0
- package/dist/esm/switch-PF5xTJfr.js +42 -0
- package/dist/esm/switch-PF5xTJfr.js.map +1 -0
- package/dist/esm/teleport-dlSjWj_t.js +32 -0
- package/dist/esm/teleport-dlSjWj_t.js.map +1 -0
- package/dist/esm/utils-D4YNWj2X.js +89 -0
- package/dist/esm/utils-D4YNWj2X.js.map +1 -0
- package/package.json +4 -3
- package/dist/esm/await-parts-BJ6C-y1f.d.ts +0 -36
- package/dist/esm/chunk-6QJYHPBL.js +0 -45
- package/dist/esm/chunk-6QJYHPBL.js.map +0 -1
- package/dist/esm/chunk-BJ7WR4XW.js +0 -274
- package/dist/esm/chunk-BJ7WR4XW.js.map +0 -1
- package/dist/esm/chunk-CWUEUCR5.js +0 -3
- package/dist/esm/chunk-CWUEUCR5.js.map +0 -1
- package/dist/esm/chunk-D6QZA3UT.js +0 -56
- package/dist/esm/chunk-D6QZA3UT.js.map +0 -1
- package/dist/esm/chunk-EYWTW54R.js +0 -42
- package/dist/esm/chunk-EYWTW54R.js.map +0 -1
- package/dist/esm/chunk-G5BNZM66.js +0 -32
- package/dist/esm/chunk-G5BNZM66.js.map +0 -1
- package/dist/esm/chunk-JC52CA2O.js +0 -113
- package/dist/esm/chunk-JC52CA2O.js.map +0 -1
- package/dist/esm/chunk-M7YXNGT6.js +0 -48
- package/dist/esm/chunk-M7YXNGT6.js.map +0 -1
- package/dist/esm/chunk-MRYXZN2P.js +0 -336
- package/dist/esm/chunk-MRYXZN2P.js.map +0 -1
- package/dist/esm/chunk-MT2MQDK2.js +0 -13
- package/dist/esm/chunk-MT2MQDK2.js.map +0 -1
- package/dist/esm/chunk-N4274N5K.js +0 -50
- package/dist/esm/chunk-N4274N5K.js.map +0 -1
- package/dist/esm/chunk-NXZZXJRH.js +0 -41
- package/dist/esm/chunk-NXZZXJRH.js.map +0 -1
- package/dist/esm/chunk-OHG7GB7O.js +0 -8
- package/dist/esm/chunk-OHG7GB7O.js.map +0 -1
- package/dist/esm/chunk-P5QP73HG.js +0 -626
- package/dist/esm/chunk-P5QP73HG.js.map +0 -1
- package/dist/esm/chunk-PZ5AY32C.js +0 -9
- package/dist/esm/chunk-PZ5AY32C.js.map +0 -1
- package/dist/esm/chunk-V5ZPMMIH.js +0 -121
- package/dist/esm/chunk-V5ZPMMIH.js.map +0 -1
- package/dist/esm/chunk-YO5LJ7ZJ.js +0 -74
- package/dist/esm/chunk-YO5LJ7ZJ.js.map +0 -1
- package/dist/esm/chunk-YSDKXBU7.js +0 -68
- package/dist/esm/chunk-YSDKXBU7.js.map +0 -1
- package/dist/esm/components/common/await/index.js.map +0 -1
- package/dist/esm/components/common/error-boundary/index.js.map +0 -1
- package/dist/esm/components/common/for/index.js.map +0 -1
- package/dist/esm/components/common/index.js.map +0 -1
- package/dist/esm/components/common/show/index.js.map +0 -1
- package/dist/esm/components/common/slot/index.js.map +0 -1
- package/dist/esm/components/common/suspense-with-boundary/index.js.map +0 -1
- package/dist/esm/components/common/switch/index.js.map +0 -1
- package/dist/esm/components/common/teleport/index.js.map +0 -1
- package/dist/esm/components/ui/card/index.js.map +0 -1
- package/dist/esm/components/ui/carousel/index.js.map +0 -1
- package/dist/esm/components/ui/drag-scroll/index.js.map +0 -1
- package/dist/esm/components/ui/drop-zone/index.js.map +0 -1
- package/dist/esm/components/ui/form/index.js.map +0 -1
- package/dist/esm/components/ui/index.js.map +0 -1
- package/dist/esm/drop-zone-parts-CvseSoXA.d.ts +0 -186
- package/dist/esm/error-boundary-BD0X61Sg.d.ts +0 -28
- package/dist/esm/lib/utils/index.js.map +0 -1
- package/dist/esm/types-mdfDDNrr.d.ts +0 -25
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import { a as GetSlotComponentProps } from './getSlotMap-DTkxtGhd.js';
|
|
3
|
-
import { InferProps, DiscriminatedRenderProps, PolymorphicProps } from '@zayne-labs/toolkit-react/utils';
|
|
4
|
-
import { FileMeta, FileValidationErrorContext, FileValidationOptions } from '@zayne-labs/toolkit-core';
|
|
5
|
-
import { Prettify } from '@zayne-labs/toolkit-type-helpers';
|
|
6
|
-
|
|
7
|
-
type ContainerProps = InferProps<HTMLElement> & {
|
|
8
|
-
classNames?: {
|
|
9
|
-
base?: string;
|
|
10
|
-
isDragging?: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
type InputProps = InferProps<"input">;
|
|
14
|
-
type FileWithPreview = {
|
|
15
|
-
/**
|
|
16
|
-
* File object or file metadata
|
|
17
|
-
*/
|
|
18
|
-
file: File | FileMeta;
|
|
19
|
-
/**
|
|
20
|
-
* Unique ID for the file
|
|
21
|
-
*/
|
|
22
|
-
id: string;
|
|
23
|
-
/**
|
|
24
|
-
* Preview URL for the file
|
|
25
|
-
* - Will be undefined if `disallowPreviewForNonImageFiles` is set to `true` and the file is not an image
|
|
26
|
-
* - Can also be undefined if `URL.createObjectURL` fails
|
|
27
|
-
*/
|
|
28
|
-
preview: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
type DropZoneState = {
|
|
31
|
-
/**
|
|
32
|
-
* List of validation errors
|
|
33
|
-
*/
|
|
34
|
-
errors: FileValidationErrorContext[];
|
|
35
|
-
/**
|
|
36
|
-
* List of files with their preview URLs and unique IDs
|
|
37
|
-
*/
|
|
38
|
-
filesWithPreview: FileWithPreview[];
|
|
39
|
-
/**
|
|
40
|
-
* Whether or not a file is currently being dragged over the drop zone
|
|
41
|
-
*/
|
|
42
|
-
isDragging: boolean;
|
|
43
|
-
};
|
|
44
|
-
type ChangeOrDragEvent = React.ChangeEvent<HTMLInputElement> | React.DragEvent<HTMLElement>;
|
|
45
|
-
type DropZoneActions = {
|
|
46
|
-
addFiles: (fileList: File[] | FileList | null, event?: ChangeOrDragEvent) => void;
|
|
47
|
-
clearErrors: () => void;
|
|
48
|
-
clearFiles: () => void;
|
|
49
|
-
handleDragEnter: (event: React.DragEvent<HTMLElement>) => void;
|
|
50
|
-
handleDragLeave: (event: React.DragEvent<HTMLElement>) => void;
|
|
51
|
-
handleDragOver: (event: React.DragEvent<HTMLElement>) => void;
|
|
52
|
-
handleFileUpload: (event: ChangeOrDragEvent) => void;
|
|
53
|
-
openFilePicker: () => void;
|
|
54
|
-
removeFile: (fileToRemoveOrId: string | FileWithPreview) => void;
|
|
55
|
-
};
|
|
56
|
-
type UseDropZoneResult = {
|
|
57
|
-
dropZoneActions: DropZoneActions;
|
|
58
|
-
dropZoneState: DropZoneState;
|
|
59
|
-
getContainerProps: (containerProps?: ContainerProps) => ContainerProps;
|
|
60
|
-
getInputProps: (inputProps?: InputProps) => InputProps;
|
|
61
|
-
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
62
|
-
};
|
|
63
|
-
type UseDropZoneProps = {
|
|
64
|
-
/**
|
|
65
|
-
* Allowed file types to be uploaded.
|
|
66
|
-
*/
|
|
67
|
-
allowedFileTypes?: string[];
|
|
68
|
-
/**
|
|
69
|
-
* CSS classes to apply to the various parts of the drop zone
|
|
70
|
-
*/
|
|
71
|
-
classNames?: Prettify<ContainerProps["classNames"] & {
|
|
72
|
-
input?: string;
|
|
73
|
-
}>;
|
|
74
|
-
/**
|
|
75
|
-
* Whether to disallow duplicate files
|
|
76
|
-
* @default true
|
|
77
|
-
*/
|
|
78
|
-
disallowDuplicates?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Whether to disallow preview for non-image files
|
|
81
|
-
* @default true
|
|
82
|
-
*/
|
|
83
|
-
disallowPreviewForNonImageFiles?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Extra props to pass to the container element
|
|
86
|
-
*/
|
|
87
|
-
extraContainerProps?: ContainerProps;
|
|
88
|
-
/**
|
|
89
|
-
* Extra props to pass to the input element
|
|
90
|
-
*/
|
|
91
|
-
extraInputProps?: InputProps;
|
|
92
|
-
/**
|
|
93
|
-
* Initial files to populate the drop zone
|
|
94
|
-
*/
|
|
95
|
-
initialFiles?: FileMeta | FileMeta[] | null;
|
|
96
|
-
/**
|
|
97
|
-
* Maximum number of files that can be uploaded.
|
|
98
|
-
*/
|
|
99
|
-
maxFileCount?: number;
|
|
100
|
-
/**
|
|
101
|
-
* Maximum file size in MB
|
|
102
|
-
*/
|
|
103
|
-
maxFileSize?: number;
|
|
104
|
-
/**
|
|
105
|
-
* Whether to allow multiple files to be uploaded
|
|
106
|
-
*/
|
|
107
|
-
multiple?: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Callback function to be called when internal files state changes
|
|
110
|
-
*/
|
|
111
|
-
onFilesChange?: (context: {
|
|
112
|
-
filesWithPreview: FileWithPreview[];
|
|
113
|
-
}) => void;
|
|
114
|
-
/**
|
|
115
|
-
* Callback function to be called when the render props change
|
|
116
|
-
*/
|
|
117
|
-
onRenderPropsChange?: (props: UseDropZoneResult) => void;
|
|
118
|
-
/**
|
|
119
|
-
* Callback function to be called when new files are uploaded
|
|
120
|
-
*/
|
|
121
|
-
onUpload?: (context: {
|
|
122
|
-
event: ChangeOrDragEvent;
|
|
123
|
-
filesWithPreview: FileWithPreview[];
|
|
124
|
-
}) => void;
|
|
125
|
-
/**
|
|
126
|
-
* Callback function to be called on each file upload as they occur
|
|
127
|
-
*/
|
|
128
|
-
onUploadError?: FileValidationOptions["onError"];
|
|
129
|
-
/**
|
|
130
|
-
* Callback function to be called once after all file upload errors have occurred
|
|
131
|
-
*/
|
|
132
|
-
onUploadErrors?: FileValidationOptions["onErrors"];
|
|
133
|
-
/**
|
|
134
|
-
* Callback function to be called on file upload success
|
|
135
|
-
*/
|
|
136
|
-
onUploadSuccess?: FileValidationOptions["onSuccess"];
|
|
137
|
-
/**
|
|
138
|
-
* Custom validation function.
|
|
139
|
-
*
|
|
140
|
-
* If the function returns false, the file will be rejected
|
|
141
|
-
*/
|
|
142
|
-
validator?: NonNullable<FileValidationOptions["validationSettings"]>["validator"];
|
|
143
|
-
/**
|
|
144
|
-
* Custom validation function that runs after all file validation has occurred
|
|
145
|
-
*/
|
|
146
|
-
validatorForAllFiles?: FileValidationOptions["validatorForAllFiles"];
|
|
147
|
-
/**
|
|
148
|
-
* Whether to allow the default file picker via the file input element
|
|
149
|
-
* @default true
|
|
150
|
-
*/
|
|
151
|
-
withDefaultFilePicker?: boolean;
|
|
152
|
-
};
|
|
153
|
-
declare const useDropZone: (props?: UseDropZoneProps) => UseDropZoneResult;
|
|
154
|
-
|
|
155
|
-
type DropZoneRenderPropType = DiscriminatedRenderProps<React$1.ReactNode | ((props: UseDropZoneResult) => React$1.ReactNode)>;
|
|
156
|
-
type DropZoneRootProps = DropZoneRenderPropType & UseDropZoneProps & {
|
|
157
|
-
/**
|
|
158
|
-
* Controls whether to include internal elements (root and input) or not.
|
|
159
|
-
*/
|
|
160
|
-
withInternalElements?: boolean;
|
|
161
|
-
};
|
|
162
|
-
declare function DropZoneRoot(props: DropZoneRootProps): React$1.JSX.Element;
|
|
163
|
-
type DropZoneInputProps = InputProps & {
|
|
164
|
-
asChild?: boolean;
|
|
165
|
-
};
|
|
166
|
-
declare function DropZoneInput(props: DropZoneInputProps): React$1.JSX.Element;
|
|
167
|
-
type DropZoneContainerProps = ContainerProps & {
|
|
168
|
-
asChild?: boolean;
|
|
169
|
-
};
|
|
170
|
-
declare function DropZoneContainer<TElement extends React$1.ElementType = "div">(props: PolymorphicProps<TElement, DropZoneContainerProps>): React$1.JSX.Element;
|
|
171
|
-
type RenderPropFn = (props: UseDropZoneResult) => React$1.ReactNode;
|
|
172
|
-
type SlotComponentProps = GetSlotComponentProps<"preview", React$1.ReactNode | RenderPropFn>;
|
|
173
|
-
declare function DropZoneContext(props: {
|
|
174
|
-
children: RenderPropFn;
|
|
175
|
-
}): React$1.ReactNode;
|
|
176
|
-
declare const DropZoneImagePreview: {
|
|
177
|
-
(props: Pick<SlotComponentProps, "children">): React$1.ReactNode;
|
|
178
|
-
readonly slotName?: "preview" | undefined;
|
|
179
|
-
readonly slotSymbol?: symbol;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
declare namespace dropZoneParts {
|
|
183
|
-
export { DropZoneContainer as Container, DropZoneContext as Context, DropZoneImagePreview as ImagePreview, DropZoneInput as Input, DropZoneRoot as Root };
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export { type ContainerProps as C, type DropZoneRenderPropType as D, type FileWithPreview as F, type InputProps as I, type UseDropZoneResult as U, type DropZoneRootProps as a, DropZoneRoot as b, DropZoneInput as c, dropZoneParts as d, DropZoneContainer as e, DropZoneContext as f, DropZoneImagePreview as g, type DropZoneState as h, type DropZoneActions as i, type UseDropZoneProps as j, useDropZone as u };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
import { E as ErrorBoundaryProps } from './types-mdfDDNrr.js';
|
|
4
|
-
|
|
5
|
-
type ErrorBoundaryState = {
|
|
6
|
-
error: Error;
|
|
7
|
-
hasError: true;
|
|
8
|
-
} | {
|
|
9
|
-
error: null;
|
|
10
|
-
hasError: false;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Copied from react-error-boundary package
|
|
14
|
-
* @see https://github.com/bvaughn/react-error-boundary
|
|
15
|
-
*/
|
|
16
|
-
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
17
|
-
#private;
|
|
18
|
-
constructor(props: ErrorBoundaryProps);
|
|
19
|
-
static getDerivedStateFromError(error: Error): {
|
|
20
|
-
error: Error;
|
|
21
|
-
hasError: boolean;
|
|
22
|
-
};
|
|
23
|
-
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
24
|
-
componentDidUpdate(prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
|
|
25
|
-
render(): React.JSX.Element;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { ErrorBoundary as E };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type FallbackProps = {
|
|
2
|
-
error: unknown;
|
|
3
|
-
resetErrorBoundary: (...args: unknown[]) => void;
|
|
4
|
-
};
|
|
5
|
-
type ErrorBoundaryProps = {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
fallback?: React.ReactNode | ((props: FallbackProps) => React.ReactNode);
|
|
8
|
-
onError?: (context: {
|
|
9
|
-
error: Error;
|
|
10
|
-
info: React.ErrorInfo & {
|
|
11
|
-
ownerStack?: string;
|
|
12
|
-
};
|
|
13
|
-
}) => void;
|
|
14
|
-
onReset?: (context: {
|
|
15
|
-
args: unknown[];
|
|
16
|
-
reason: "imperative-api";
|
|
17
|
-
} | {
|
|
18
|
-
next: unknown[] | undefined;
|
|
19
|
-
prev: unknown[] | undefined;
|
|
20
|
-
reason: "keys";
|
|
21
|
-
}) => void;
|
|
22
|
-
resetKeys?: unknown[];
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type { ErrorBoundaryProps as E, FallbackProps as F };
|