@zayne-labs/ui-react 0.10.45 → 0.10.47

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.
Files changed (63) hide show
  1. package/css/theme.css +4 -2
  2. package/dist/esm/{chunk-BL-4obUL.js → chunk-BN_g-Awi.js} +2 -2
  3. package/dist/esm/{client-gate-B3fRopBx.js → client-gate-Ch5I9_pc.js} +3 -3
  4. package/dist/esm/{client-gate-B3fRopBx.js.map → client-gate-Ch5I9_pc.js.map} +1 -1
  5. package/dist/esm/{cn-Dnsqr-G7.js → cn-pbJoeyH6.js} +1 -1
  6. package/dist/esm/cn-pbJoeyH6.js.map +1 -0
  7. package/dist/esm/common/await/index.d.ts +6 -6
  8. package/dist/esm/common/await/index.js +9 -9
  9. package/dist/esm/common/await/index.js.map +1 -1
  10. package/dist/esm/common/client-gate/index.d.ts +2 -2
  11. package/dist/esm/common/client-gate/index.js +1 -1
  12. package/dist/esm/common/error-boundary/index.d.ts +2 -2
  13. package/dist/esm/common/error-boundary/index.js +1 -1
  14. package/dist/esm/common/for/index.d.ts +4 -4
  15. package/dist/esm/common/for/index.js +1 -1
  16. package/dist/esm/common/presence/index.d.ts +2 -2
  17. package/dist/esm/common/presence/index.js +1 -1
  18. package/dist/esm/common/show/index.d.ts +4 -4
  19. package/dist/esm/common/show/index.js +1 -1
  20. package/dist/esm/common/slot/index.d.ts +4 -4
  21. package/dist/esm/common/slot/index.js +1 -1
  22. package/dist/esm/common/suspense-with-boundary/index.d.ts +2 -2
  23. package/dist/esm/common/suspense-with-boundary/index.js +1 -1
  24. package/dist/esm/common/switch/index.d.ts +6 -6
  25. package/dist/esm/common/switch/index.js +2 -2
  26. package/dist/esm/common/switch/index.js.map +1 -1
  27. package/dist/esm/common/teleport/index.d.ts +3 -3
  28. package/dist/esm/common/teleport/index.js +8 -3
  29. package/dist/esm/common/teleport/index.js.map +1 -1
  30. package/dist/esm/{error-boundary-TM4xzQfq.js → error-boundary-pMMeMfwH.js} +2 -2
  31. package/dist/esm/error-boundary-pMMeMfwH.js.map +1 -0
  32. package/dist/esm/{for-BeCRb3k2.js → for-IenHovla.js} +1 -1
  33. package/dist/esm/{for-BeCRb3k2.js.map → for-IenHovla.js.map} +1 -1
  34. package/dist/esm/{index-DzMX8Xce.d.ts → index-CW1qt3Kq.d.ts} +4 -4
  35. package/dist/esm/{index-Dvt8y6Uu.d.ts → index-DtJyivJH.d.ts} +9 -9
  36. package/dist/esm/{presence-Ctp-Trws.js → presence-BbOLyzEd.js} +3 -3
  37. package/dist/esm/presence-BbOLyzEd.js.map +1 -0
  38. package/dist/esm/{show-7VInUu_D.js → show-CWSAcfVL.js} +6 -6
  39. package/dist/esm/show-CWSAcfVL.js.map +1 -0
  40. package/dist/esm/{slot-CURylbjq.js → slot-C56gqKvk.js} +3 -3
  41. package/dist/esm/slot-C56gqKvk.js.map +1 -0
  42. package/dist/esm/ui/card/index.d.ts +8 -8
  43. package/dist/esm/ui/card/index.js +4 -4
  44. package/dist/esm/ui/card/index.js.map +1 -1
  45. package/dist/esm/ui/carousel/index.d.ts +9 -9
  46. package/dist/esm/ui/carousel/index.js +6 -6
  47. package/dist/esm/ui/carousel/index.js.map +1 -1
  48. package/dist/esm/ui/drag-scroll/index.d.ts +164 -11
  49. package/dist/esm/ui/drag-scroll/index.js +243 -72
  50. package/dist/esm/ui/drag-scroll/index.js.map +1 -1
  51. package/dist/esm/ui/drop-zone/index.d.ts +100 -29
  52. package/dist/esm/ui/drop-zone/index.js +84 -76
  53. package/dist/esm/ui/drop-zone/index.js.map +1 -1
  54. package/dist/esm/ui/form/index.d.ts +22 -23
  55. package/dist/esm/ui/form/index.js +34 -32
  56. package/dist/esm/ui/form/index.js.map +1 -1
  57. package/dist/style.css +12 -7
  58. package/package.json +19 -11
  59. package/dist/esm/cn-Dnsqr-G7.js.map +0 -1
  60. package/dist/esm/error-boundary-TM4xzQfq.js.map +0 -1
  61. package/dist/esm/presence-Ctp-Trws.js.map +0 -1
  62. package/dist/esm/show-7VInUu_D.js.map +0 -1
  63. package/dist/esm/slot-CURylbjq.js.map +0 -1
@@ -1,18 +1,38 @@
1
1
  import { InferProps, PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
2
2
  import * as _zayne_labs_toolkit_type_helpers0 from "@zayne-labs/toolkit-type-helpers";
3
3
  import { Awaitable, SelectorFn } from "@zayne-labs/toolkit-type-helpers";
4
- import * as react1 from "react";
5
- import "@zayne-labs/toolkit-react";
6
- import * as react_jsx_runtime10 from "react/jsx-runtime";
4
+ import * as react6 from "react";
5
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
7
6
  import * as _zayne_labs_toolkit_core1 from "@zayne-labs/toolkit-core";
8
7
  import { FileMeta, FileOrFileMeta, FileValidationErrorContextEach, FileValidationHooksAsync, FileValidationSettingsAsync } from "@zayne-labs/toolkit-core";
8
+ import "@zayne-labs/toolkit-react";
9
9
 
10
10
  //#region src/components/ui/drop-zone/drop-zone-store.d.ts
11
11
  type RequiredUseDropZoneProps = { [Key in keyof Required<UseDropZoneProps>]: UseDropZoneProps[Key] | undefined };
12
- type InitStoreValues = Omit<RequiredUseDropZoneProps, "disabled" | "disableFilePickerOpenOnAreaClick" | "disableInternalStateSubscription" | "extraProps"> & {
13
- inputRef: React.RefObject<HTMLInputElement | null>;
12
+ type StoreContext = Pick<RequiredUseDropZoneProps, "allowedFileTypes" | "disablePreviewGenForNonImageFiles" | "initialFiles" | "maxFileCount" | "maxFileSize" | "multiple" | "onFilesChange" | "onUpload" | "onValidationError" | "onValidationSuccess" | "rejectDuplicateFiles" | "validator">;
13
+ declare const createDropZoneStore: (storeContext: StoreContext) => {
14
+ getInitialState: () => DropZoneStore;
15
+ getListeners: () => Set<(state: DropZoneStore, prevState: DropZoneStore) => void>;
16
+ getState: () => DropZoneStore;
17
+ resetState: () => void;
18
+ setState: {
19
+ (stateUpdate: Partial<DropZoneStore> | ((prevState: DropZoneStore) => Partial<DropZoneStore>), options?: ({
20
+ onNotifySync?: ((previousState: DropZoneStore) => void) | undefined;
21
+ onNotifyViaBatch?: ((previousStateSnapshot: DropZoneStore) => void) | undefined;
22
+ shouldNotifySync?: boolean | undefined;
23
+ } & {
24
+ shouldReplace?: false;
25
+ }) | undefined): void;
26
+ (stateUpdate: DropZoneStore | ((prevState: DropZoneStore) => DropZoneStore), options?: ({
27
+ onNotifySync?: ((previousState: DropZoneStore) => void) | undefined;
28
+ onNotifyViaBatch?: ((previousStateSnapshot: DropZoneStore) => void) | undefined;
29
+ shouldNotifySync?: boolean | undefined;
30
+ } & {
31
+ shouldReplace: true;
32
+ }) | undefined): void;
33
+ };
34
+ subscribe: _zayne_labs_toolkit_core1.SubscribeFn<DropZoneStore>;
14
35
  };
15
- declare const createDropZoneStore: (initStoreValues: InitStoreValues) => _zayne_labs_toolkit_core1.StoreApi<DropZoneStore>;
16
36
  //#endregion
17
37
  //#region src/components/ui/drop-zone/utils.d.ts
18
38
  declare class DropZoneError extends Error {
@@ -62,13 +82,19 @@ type FileStateOrIDProp = {
62
82
  fileStateOrID: FileOrFileMeta | FileState | FileState["id"];
63
83
  };
64
84
  type RecordForDataAttr = Record<`data-${string}`, unknown>;
85
+ type SharedInputProps = {
86
+ /**
87
+ * Set to `true` to disable the default styling
88
+ */
89
+ unstyled?: boolean;
90
+ };
65
91
  interface PartProps {
66
92
  container: {
67
- input: PartProps["container"]["output"];
93
+ input: PartProps["container"]["output"] & SharedInputProps;
68
94
  output: InferProps<HTMLElement> & RecordForDataAttr;
69
95
  };
70
96
  fileItem: {
71
- input: PartProps["fileItem"]["output"];
97
+ input: PartProps["fileItem"]["output"] & SharedInputProps;
72
98
  output: InferProps<"li"> & RecordForDataAttr;
73
99
  };
74
100
  fileItemClear: {
@@ -80,21 +106,21 @@ interface PartProps {
80
106
  output: InferProps<"button"> & RecordForDataAttr;
81
107
  };
82
108
  fileItemMetadata: {
83
- input: PartProps["fileItemMetadata"]["output"];
109
+ input: PartProps["fileItemMetadata"]["output"] & SharedInputProps;
84
110
  output: InferProps<"div"> & RecordForDataAttr;
85
111
  };
86
112
  fileItemPreview: {
87
- input: PartProps["fileItemPreview"]["output"];
113
+ input: PartProps["fileItemPreview"]["output"] & SharedInputProps;
88
114
  output: InferProps<"span"> & RecordForDataAttr;
89
115
  };
90
116
  fileItemProgress: {
91
- input: PartProps["fileItemProgress"]["output"] & {
117
+ input: PartProps["fileItemProgress"]["output"] & SharedInputProps & {
92
118
  variant?: "circular" | "fill" | "linear";
93
119
  };
94
120
  output: InferProps<"span"> & RecordForDataAttr;
95
121
  };
96
122
  fileList: {
97
- input: PartProps["fileList"]["output"] & {
123
+ input: PartProps["fileList"]["output"] & SharedInputProps & {
98
124
  orientation?: "horizontal" | "vertical";
99
125
  };
100
126
  output: InferProps<"ul"> & RecordForDataAttr;
@@ -146,6 +172,7 @@ type DropZoneActions = {
146
172
  handlePaste: (event: React.ClipboardEvent<HTMLElement>) => Awaitable<void>;
147
173
  openFilePicker: () => void;
148
174
  removeFile: (ctx: FileStateOrIDProp) => void;
175
+ setInputRef: (element: HTMLInputElement | null) => void;
149
176
  updateFileState: (ctx: FileStateOrIDProp & Partial<Omit<FileState, "file" | "id" | "preview">>) => void;
150
177
  };
151
178
  };
@@ -156,7 +183,7 @@ interface UseDropZoneResult extends Pick<Required<UseDropZoneProps>, "disabled"
156
183
  storeApi: ReturnType<typeof createDropZoneStore>;
157
184
  useDropZoneStore: typeof useDropZoneStoreContext;
158
185
  }
159
- interface UseDropZoneProps extends FileValidationSettingsAsync {
186
+ interface UseDropZoneProps extends FileValidationSettingsAsync, Pick<SharedInputProps, "unstyled"> {
160
187
  /**
161
188
  * Whether or not the drop zone is disabled
162
189
  */
@@ -213,7 +240,7 @@ interface UseDropZoneProps extends FileValidationSettingsAsync {
213
240
  /**
214
241
  * Custom validation function.
215
242
  *
216
- * If the function returns false, the file will be rejected
243
+ * If the function returns `false`, the file will be rejected
217
244
  *
218
245
  */
219
246
  validator?: FileValidationSettingsAsync["validator"];
@@ -222,8 +249,52 @@ interface UseDropZoneProps extends FileValidationSettingsAsync {
222
249
  //#region src/components/ui/drop-zone/drop-zone-context.d.ts
223
250
  declare const DropZoneStoreContextProvider: (props: {
224
251
  children: React.ReactNode;
225
- store: _zayne_labs_toolkit_core1.StoreApi<DropZoneStore>;
226
- }) => react1.FunctionComponentElement<react1.ProviderProps<_zayne_labs_toolkit_core1.StoreApi<DropZoneStore>>>, useDropZoneStoreContext: <TResult = DropZoneStore>(selector?: _zayne_labs_toolkit_type_helpers0.SelectorFn<DropZoneStore, TResult> | undefined) => TResult;
252
+ store: {
253
+ getInitialState: () => DropZoneStore;
254
+ getListeners: () => Set<(state: DropZoneStore, prevState: DropZoneStore) => void>;
255
+ getState: () => DropZoneStore;
256
+ resetState: () => void;
257
+ setState: {
258
+ (stateUpdate: Partial<DropZoneStore> | ((prevState: DropZoneStore) => Partial<DropZoneStore>), options?: ({
259
+ onNotifySync?: ((previousState: DropZoneStore) => void) | undefined;
260
+ onNotifyViaBatch?: ((previousStateSnapshot: DropZoneStore) => void) | undefined;
261
+ shouldNotifySync?: boolean | undefined;
262
+ } & {
263
+ shouldReplace?: false;
264
+ }) | undefined): void;
265
+ (stateUpdate: DropZoneStore | ((prevState: DropZoneStore) => DropZoneStore), options?: ({
266
+ onNotifySync?: ((previousState: DropZoneStore) => void) | undefined;
267
+ onNotifyViaBatch?: ((previousStateSnapshot: DropZoneStore) => void) | undefined;
268
+ shouldNotifySync?: boolean | undefined;
269
+ } & {
270
+ shouldReplace: true;
271
+ }) | undefined): void;
272
+ };
273
+ subscribe: _zayne_labs_toolkit_core1.SubscribeFn<DropZoneStore>;
274
+ };
275
+ }) => react6.FunctionComponentElement<react6.ProviderProps<{
276
+ getInitialState: () => DropZoneStore;
277
+ getListeners: () => Set<(state: DropZoneStore, prevState: DropZoneStore) => void>;
278
+ getState: () => DropZoneStore;
279
+ resetState: () => void;
280
+ setState: {
281
+ (stateUpdate: Partial<DropZoneStore> | ((prevState: DropZoneStore) => Partial<DropZoneStore>), options?: ({
282
+ onNotifySync?: ((previousState: DropZoneStore) => void) | undefined;
283
+ onNotifyViaBatch?: ((previousStateSnapshot: DropZoneStore) => void) | undefined;
284
+ shouldNotifySync?: boolean | undefined;
285
+ } & {
286
+ shouldReplace?: false;
287
+ }) | undefined): void;
288
+ (stateUpdate: DropZoneStore | ((prevState: DropZoneStore) => DropZoneStore), options?: ({
289
+ onNotifySync?: ((previousState: DropZoneStore) => void) | undefined;
290
+ onNotifyViaBatch?: ((previousStateSnapshot: DropZoneStore) => void) | undefined;
291
+ shouldNotifySync?: boolean | undefined;
292
+ } & {
293
+ shouldReplace: true;
294
+ }) | undefined): void;
295
+ };
296
+ subscribe: _zayne_labs_toolkit_core1.SubscribeFn<DropZoneStore>;
297
+ }>>, useDropZoneStoreContext: <TResult = DropZoneStore>(selector?: _zayne_labs_toolkit_type_helpers0.SelectorFn<DropZoneStore, TResult> | undefined) => TResult;
227
298
  type FileItemContextType = {
228
299
  fileState: FileState;
229
300
  };
@@ -232,29 +303,29 @@ type FileItemContextType = {
232
303
  type DropZoneRootProps = UseDropZoneProps & {
233
304
  children: React.ReactNode;
234
305
  };
235
- declare function DropZoneRoot(props: DropZoneRootProps): react_jsx_runtime10.JSX.Element;
306
+ declare function DropZoneRoot(props: DropZoneRootProps): react_jsx_runtime9.JSX.Element;
236
307
  type DropZoneContextProps<TSlice> = {
237
308
  children: React.ReactNode | ((context: TSlice) => React.ReactNode);
238
309
  selector?: SelectorFn<DropZoneStore, TSlice>;
239
310
  };
240
- declare function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>): react1.ReactNode;
311
+ declare function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>): react6.ReactNode;
241
312
  type DropZoneContainerProps = PartInputProps["container"] & {
242
313
  asChild?: boolean;
243
314
  };
244
- declare function DropZoneContainer<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, DropZoneContainerProps>): react_jsx_runtime10.JSX.Element;
315
+ declare function DropZoneContainer<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, DropZoneContainerProps>): react_jsx_runtime9.JSX.Element;
245
316
  type DropZoneInputProps = PartInputProps["input"] & {
246
317
  asChild?: boolean;
247
318
  };
248
- declare function DropZoneInput(props: DropZoneInputProps): react_jsx_runtime10.JSX.Element;
319
+ declare function DropZoneInput(props: DropZoneInputProps): react_jsx_runtime9.JSX.Element;
249
320
  type DropZoneAreaProps<TSlice> = DropZoneContextProps<TSlice> & PartInputProps["container"] & {
250
321
  classNames?: Partial<Record<Extract<keyof PartInputProps, "container" | "input">, string>>;
251
322
  extraProps?: Partial<Pick<PartInputProps, "container" | "input">>;
252
323
  };
253
- declare function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>): react_jsx_runtime10.JSX.Element;
324
+ declare function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>): react_jsx_runtime9.JSX.Element;
254
325
  type DropZoneTriggerProps = PartInputProps["trigger"] & {
255
326
  asChild?: boolean;
256
327
  };
257
- declare function DropZoneTrigger(props: DropZoneTriggerProps): react_jsx_runtime10.JSX.Element;
328
+ declare function DropZoneTrigger(props: DropZoneTriggerProps): react_jsx_runtime9.JSX.Element;
258
329
  type ListPerItemContext = Pick<DropZoneStore, "actions"> & {
259
330
  array: DropZoneStore["fileStateArray"];
260
331
  fileState: DropZoneStore["fileStateArray"][number];
@@ -273,21 +344,21 @@ type DropZoneFileListProps = Omit<PartInputProps["fileList"], "children"> & {
273
344
  asChild?: boolean;
274
345
  forceMount?: boolean;
275
346
  } & (FileListManualListVariant | FileListPerItemVariant);
276
- declare function DropZoneFileList<TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, DropZoneFileListProps>): react_jsx_runtime10.JSX.Element;
347
+ declare function DropZoneFileList<TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, DropZoneFileListProps>): react_jsx_runtime9.JSX.Element;
277
348
  type DropZoneFileItemProps = FileItemContextType & PartInputProps["fileItem"] & {
278
349
  asChild?: boolean;
279
350
  };
280
- declare function DropZoneFileItem<TElement extends React.ElementType = "li">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>): react_jsx_runtime10.JSX.Element;
351
+ declare function DropZoneFileItem<TElement extends React.ElementType = "li">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>): react_jsx_runtime9.JSX.Element;
281
352
  type DropZoneFileItemDeleteProps = PartInputProps["fileItemDelete"] & {
282
353
  asChild?: boolean;
283
354
  };
284
- declare function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps): react_jsx_runtime10.JSX.Element;
355
+ declare function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps): react_jsx_runtime9.JSX.Element;
285
356
  type DropZoneFileItemProgressProps = PartInputProps["fileItemProgress"] & {
286
357
  asChild?: boolean;
287
358
  forceMount?: boolean;
288
359
  size?: number;
289
360
  };
290
- declare function DropZoneFileItemProgress<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>): react_jsx_runtime10.JSX.Element | null;
361
+ declare function DropZoneFileItemProgress<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>): react_jsx_runtime9.JSX.Element | null;
291
362
  type RenderPreviewDetails<TElement extends React.ElementType = "svg"> = {
292
363
  node?: React.ReactNode;
293
364
  } & {
@@ -316,7 +387,7 @@ type DropZoneFileItemPreviewProps = Omit<PartInputProps["fileItemPreview"], "chi
316
387
  }) => React.ReactNode);
317
388
  renderPreview?: boolean | RenderPreview;
318
389
  };
319
- declare function DropZoneFileItemPreview<TElement extends React.ElementType>(props: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>): react_jsx_runtime10.JSX.Element | null;
390
+ declare function DropZoneFileItemPreview<TElement extends React.ElementType>(props: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>): react_jsx_runtime9.JSX.Element | null;
320
391
  type DropZoneFileItemMetadataProps = Omit<PartInputProps["fileItemMetadata"], "children"> & Partial<Pick<FileItemContextType, "fileState">> & {
321
392
  asChild?: boolean;
322
393
  children?: React.ReactNode | ((context: Pick<FileItemContextType, "fileState">) => React.ReactNode);
@@ -326,12 +397,12 @@ type DropZoneFileItemMetadataProps = Omit<PartInputProps["fileItemMetadata"], "c
326
397
  };
327
398
  size?: "default" | "sm";
328
399
  };
329
- declare function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps): react_jsx_runtime10.JSX.Element | null;
400
+ declare function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps): react_jsx_runtime9.JSX.Element | null;
330
401
  type DropZoneFileClearProps = PartInputProps["fileItemClear"] & {
331
402
  asChild?: boolean;
332
403
  forceMount?: boolean;
333
404
  };
334
- declare function DropZoneFileClear(props: DropZoneFileClearProps): react_jsx_runtime10.JSX.Element | null;
405
+ declare function DropZoneFileClear(props: DropZoneFileClearProps): react_jsx_runtime9.JSX.Element | null;
335
406
  declare namespace drop_zone_parts_d_exports {
336
407
  export { DropZoneArea as Area, DropZoneContainer as Container, DropZoneContext as Context, DropZoneFileClear as FileClear, DropZoneFileItem as FileItem, DropZoneFileItemDelete as FileItemDelete, DropZoneFileItemMetadata as FileItemMetadata, DropZoneFileItemPreview as FileItemPreview, DropZoneFileItemProgress as FileItemProgress, DropZoneFileList as FileList, DropZoneInput as Input, DropZoneRoot as Root, DropZoneTrigger as Trigger };
337
408
  }